From d135037cb066e049ec88ee08eba3942fe75d342c Mon Sep 17 00:00:00 2001
From: 王佳豪 <g675230687@126.com>
Date: 星期二, 13 四月 2021 12:49:16 +0800
Subject: [PATCH] 销售订单功能补充
---
src/main/webapp/static/js/salesOrder/salsesOrder.js | 97 +++++++++++++++++++++++-------------------------
1 files changed, 47 insertions(+), 50 deletions(-)
diff --git a/src/main/webapp/static/js/salesOrder/salsesOrder.js b/src/main/webapp/static/js/salesOrder/salsesOrder.js
index df18260..f3159b4 100644
--- a/src/main/webapp/static/js/salesOrder/salsesOrder.js
+++ b/src/main/webapp/static/js/salesOrder/salsesOrder.js
@@ -1,4 +1,5 @@
-var pageCurr;
+var pageCurr = 1;
+var limit = 16;
function getCol() {
var cols = [];
@@ -15,7 +16,6 @@
, {field: 'izReceive', align: 'center', title: '鏄惁鏀舵枡', hide: true}
, {field: 'inQty', align: 'center', title: '浜ф垚鍝佸叆搴撴暟閲�'}
, {field: 'outQty', align: 'center', title: '鍙戣揣鏁伴噺'}
- , {fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width: 80}
);
return cols;
}
@@ -32,25 +32,14 @@
tableIns = table.render({
elem: '#salesOrder',
headers: {token: localStorage.getItem('token')},
- // url: baseUrl+'/matCode/list/auth',
- data: [
- {
- "orderCode": 20210315000001,
- "orderDate": "2021-03-26 13:40",
- "invCode": "CPXXX00123",
- "invName": "鍏板崥鍩哄凹鎺堟潈鍎跨杞�",
- "invStd": "21脳25",
- "invUnit": "杈�",
- "orderQty": 300,
- "izMrp": "鍚�",
- "productQty": 150,
- "izReceive": "鏄�",
- "inQty": 50,
- "outQty": 0,
- }
- ],
+ 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',
@@ -71,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;
}
});
@@ -83,6 +72,8 @@
form.on('submit(reset)', function (data) {
pageCurr = 1;
clearFormVal($('#search-box'));
+ debugger
+
tableReload(false);
});
@@ -96,7 +87,7 @@
// 鏃堕棿閫夋嫨鍣�
layDate.render({
elem: '.layui-laydate-range'
- , type: 'datetime'
+ ,style: 'width: 150px'
, range: true
});
});
@@ -105,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