From 84d7dbea21cbe9276bd1eccdb3e60daef095242e Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期二, 08 六月 2021 11:33:57 +0800
Subject: [PATCH] Merge branch 'master' of https://gitee.com/luxiaotao1123/xtywms

---
 src/main/webapp/static/js/salesOrder/erpOrder.js |   90 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 90 insertions(+), 0 deletions(-)

diff --git a/src/main/webapp/static/js/salesOrder/erpOrder.js b/src/main/webapp/static/js/salesOrder/erpOrder.js
new file mode 100644
index 0000000..26b863c
--- /dev/null
+++ b/src/main/webapp/static/js/salesOrder/erpOrder.js
@@ -0,0 +1,90 @@
+function getCol() {
+    var cols = [];
+    cols.push(
+        {field: 'fbillNo', align: 'center', title: '閫氱煡鍗曞彿', width: 180}
+        , {field: 'fsourceBillNo', align: 'center', title: '鐢熶骇鍗曞彿', width: 180}
+        , {field: 'fnumber', align: 'center', title: '鐗╂枡缂栫爜', width: 180}
+        , {field: 'fname', align: 'center', title: '鐗╂枡鍚嶇О'}
+        , {field: 'fmodel', align: 'center', title: '瑙勬牸', width: 180}
+    );
+    return cols;
+}
+
+layui.use(['table', 'laydate', 'form', 'upload'], function () {
+    var table = layui.table;
+    var $ = layui.jquery;
+    var layer = layui.layer;
+    var layDate = layui.laydate;
+    var form = layui.form;
+    var upload = layui.upload;
+
+    // 鏁版嵁娓叉煋
+    tableIns = table.render({
+        elem: '#salesOrder',
+        headers: {token: localStorage.getItem('token')},
+        url: baseUrl + '/erp/cpicmo/query',
+        even: true,
+        toolbar: '#toolbar',
+        cellMinWidth: 50,
+        cols: [getCol()],
+        parseData: function (res) {
+            return {
+                'code': res.code,
+                'msg': res.msg,
+                'data': res.data
+            }
+        },
+        response: {
+            statusCode: 200
+        },
+        done: function (res, curr, count) {
+            if (res.code === 403) {
+                top.location.href = baseUrl + "/";
+            }
+        }
+    });
+
+    // 鎼滅储鏍忛噸缃簨浠�
+    form.on('submit(reset)', function (data) {
+        clearFormVal($('#search-box'));
+        tableReload(false);
+    });
+
+    // 鎼滅储鏍忔悳绱簨浠�
+    form.on('submit(search)', function (data) {
+        tableReload(false);
+    });
+
+
+    // 鏃堕棿閫夋嫨鍣�
+    layDate.render({
+        elem: '.layui-laydate-range'
+        , style: 'width: 150px'
+        , range: true
+    });
+});
+
+/* 琛ㄦ牸鏁版嵁閲嶈浇 */
+function tableReload(child) {
+    var searchData = {};
+    $.each($('#search-box [name]').serializeArray(), function() {
+        searchData[this.name] = this.value;
+    });
+
+    (child ? parent.tableIns : tableIns).reload({
+        where: searchData,
+        done: function (res, curr, count) {
+            if (res.code === 403) {
+                top.location.href = baseUrl + "/";
+            }
+            limit(child);
+        }
+    });
+}
+
+/* 鐩戝惉鍥炶溅浜嬩欢 */
+$('body').keydown(function () {
+    if (event.keyCode === 13) {
+        $("#search").click();
+    }
+});

--
Gitblit v1.9.1