From e2a27aeebf9e6d4e23eb8fde4b1c71a4f344383c Mon Sep 17 00:00:00 2001
From: 王佳豪 <g675230687@126.com>
Date: 星期一, 07 六月 2021 11:09:54 +0800
Subject: [PATCH] 新增erp生产单查询
---
src/main/webapp/static/js/salesOrder/salsesOrder.js | 107 +++++++++++++++++++++++++++++------------------------
1 files changed, 59 insertions(+), 48 deletions(-)
diff --git a/src/main/webapp/static/js/salesOrder/salsesOrder.js b/src/main/webapp/static/js/salesOrder/salsesOrder.js
index ffa4cfd..f3159b4 100644
--- a/src/main/webapp/static/js/salesOrder/salsesOrder.js
+++ b/src/main/webapp/static/js/salesOrder/salsesOrder.js
@@ -1,14 +1,21 @@
-var pageCurr;
+var pageCurr = 1;
+var limit = 16;
function getCol() {
var cols = [];
cols.push(
- {field: 'orderNo', align: 'center', title: '璁㈠崟缂栧彿'}
- , {field: 'col1', align: 'center', title: '璁㈠崟鍚嶇О'}
- , {field: 'col2', align: 'center', title: '璁㈠崟璇︽儏'}
- , {field: 'col3', align: 'center', title: '璁㈠崟瀹㈡埛'}
- , {field: 'col4', align: 'center', title: '璁㈠崟鐘舵��'}
- , {fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width: 80}
+ {field: 'orderCode', align: 'center', title: '璁㈠崟缂栧彿'}
+ , {field: 'orderDate', align: 'center', title: '璁㈠崟鏃ユ湡'}
+ , {field: 'invCode', align: 'center', title: '鐗╂枡缂栫爜'}
+ , {field: 'invName', align: 'center', title: '鐗╂枡鍚嶇О'}
+ , {field: 'invStd', align: 'center', title: '瑙勬牸鍨嬪彿'}
+ , {field: 'invUnit', align: 'center', title: '鍗曚綅'}
+ , {field: 'orderQty', align: 'center', title: '璁㈠崟鏁伴噺'}
+ , {field: 'izMrp', align: 'center', title: '鏄惁mrp璁$畻', hide: true}
+ , {field: 'productQty', align: 'center', title: '鐢熶骇浠诲姟鍗曟暟閲�'}
+ , {field: 'izReceive', align: 'center', title: '鏄惁鏀舵枡', hide: true}
+ , {field: 'inQty', align: 'center', title: '浜ф垚鍝佸叆搴撴暟閲�'}
+ , {field: 'outQty', align: 'center', title: '鍙戣揣鏁伴噺'}
);
return cols;
}
@@ -25,18 +32,14 @@
tableIns = table.render({
elem: '#salesOrder',
headers: {token: localStorage.getItem('token')},
- // url: baseUrl+'/matCode/list/auth',
- data: [
- {
- "orderNo": 20210315000001,
- "col1": "瑗跨彮鐗檟x 210315鍙�",
- "col2": "鍏板崥鍩哄凹绔ヨ溅 5000鍙�",
- "col3": "瑗跨彮鐗檟x鍎跨鐜╁叿鍏徃",
- "col4": "鐢熶骇涓�",
- }
- ],
+ url: 'http://192.168.0.253:8073/api/report/getorderreport',
+ // where: {
+ // orderCode: 'NX5288',
+ // startTime: '2021-01-01',
+ // endTime: '2021-01-01',
+ // },
page: true,
- limit: 16,
+ limit: limit,
limits: [16, 50, 100, 200, 500],
even: true,
toolbar: '#toolbar',
@@ -57,11 +60,11 @@
response: {
statusCode: 200
},
- done: function(res, curr, count) {
+ done: function (res, curr, count) {
if (res.code === 403) {
- top.location.href = baseUrl+"/";
+ top.location.href = baseUrl + "/";
}
- pageCurr=curr;
+ pageCurr = curr;
}
});
@@ -69,6 +72,8 @@
form.on('submit(reset)', function (data) {
pageCurr = 1;
clearFormVal($('#search-box'));
+ debugger
+
tableReload(false);
});
@@ -82,7 +87,7 @@
// 鏃堕棿閫夋嫨鍣�
layDate.render({
elem: '.layui-laydate-range'
- , type: 'datetime'
+ ,style: 'width: 150px'
, range: true
});
});
@@ -91,35 +96,41 @@
function tableReload(child) {
var searchData = {};
$.each($('#search-box [name]').serializeArray(), function () {
- searchData[this.name] = this.value;
+ if (this.name == 'orderCode') {
+ searchData.orderCode = this.value;
+ }
+ if (this.name == 'orderTime') {
+ searchData.startTime = this.value.substring(0, 10);
+ searchData.endTime = this.value.substring(13, this.value.length);
+ }
});
- console.log('鎼滅储鍐呭', searchData);
+ console.log(searchData);
- // (child ? parent.tableIns : tableIns).reload({
- // where: searchData,
- // page: {
- // curr: pageCurr
- // },
- // done: function (res, curr, count) {
- // if (res.code === 403) {
- // top.location.href = baseUrl + "/";
- // }
- // pageCurr = curr;
- // if (res.data.length === 0 && count !== 0) {
- // tableIns.reload({
- // where: searchData,
- // page: {
- // curr: pageCurr - 1
- // }
- // });
- // pageCurr -= 1;
- // }
- // limit(child);
- // // 褰撳墠鍒嗛〉鏁版嵁瀛樺偍
- // locNormalList = res.data;
- // }
- // });
+ (child ? parent.tableIns : tableIns).reload({
+ where: searchData,
+ page: {
+ curr: pageCurr
+ },
+ done: function (res, curr, count) {
+ if (res.code === 403) {
+ top.location.href = baseUrl + "/";
+ }
+ pageCurr = curr;
+ if (res.data.length === 0 && count !== 0) {
+ tableIns.reload({
+ where: searchData,
+ page: {
+ curr: pageCurr - 1
+ }
+ });
+ pageCurr -= 1;
+ }
+ limit(child);
+ // 褰撳墠鍒嗛〉鏁版嵁瀛樺偍
+ locNormalList = res.data;
+ }
+ });
}
/* 鐩戝惉鍥炶溅浜嬩欢 */
--
Gitblit v1.9.1