From 60e1a2d2d282e350df13e12a5148c151ab633829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=B0=20=E6=9C=B1?= <501697962@qq.com> Date: Tue, 18 May 2021 20:46:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E4=B8=AA=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NX.ERP.Webapp/src/views/inventory-po.vue | 106 +++++++++++------------ 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/NX.ERP.Webapp/src/views/inventory-po.vue b/NX.ERP.Webapp/src/views/inventory-po.vue index 2fdd1f8..fdd7ef6 100644 --- a/NX.ERP.Webapp/src/views/inventory-po.vue +++ b/NX.ERP.Webapp/src/views/inventory-po.vue @@ -52,6 +52,7 @@ style="margin-top: 20px" size="small" border + :loading="loading" :columns="columns" :data="pagedData" > @@ -81,13 +82,14 @@ import { dateFormatFull, dateFormat, sortByKey, - getMonth + getMonth, } from "@/libs/tools"; export default { data() { return { PageSizeOpts: [10, 15, 20, 30], pageNo: 1, + loading: false, strfilter: "", multiple: false, pageSize: 15, @@ -97,29 +99,25 @@ export default { inv_std: "", po_codes: "", app_codes: "", - dates: [getMonth("s",-1),getMonth("e",0)], + dates: [getMonth("s", -1), getMonth("e", 0)], dates2: [], }, columns: [ - { title: "采购订单号", align: "center", key: "cpoid", - }, { title: "订单日期", align: "center", key: "dpodate", - }, { title: "供应商", align: "center", key: "cvenabbname", - }, { title: "存货编码", @@ -132,12 +130,11 @@ export default { key: "cinvname", className: "demo-table-info-new", }, - + { title: "规格型号", align: "center", key: "cinvstd", - }, { title: "单位", @@ -153,7 +150,6 @@ export default { title: "订单数量", align: "center", key: "iquantity", - }, { title: "合计在途", @@ -180,8 +176,6 @@ export default { align: "center", key: "drequirdate", }, - - ], }; }, @@ -205,49 +199,55 @@ export default { this.loadData(); }, async loadData() { - let _beginDate = null; - let _endDate = null; - let _beginDate2 = null; - let _endDate2 = null; - if ( - this.filter.dates.length == 2 && - this.filter.dates[0] !== "" && - this.filter.dates[0] !== "" - ) { - _beginDate = this.filter.dates[0]; - _endDate = this.filter.dates[1]; + try { + let _beginDate = null; + let _endDate = null; + let _beginDate2 = null; + let _endDate2 = null; + if ( + this.filter.dates.length == 2 && + this.filter.dates[0] !== "" && + this.filter.dates[0] !== "" + ) { + _beginDate = this.filter.dates[0]; + _endDate = this.filter.dates[1]; + } + if ( + this.filter.dates2.length == 2 && + this.filter.dates2[0] !== "" && + this.filter.dates2[0] !== "" + ) { + _beginDate2 = this.filter.dates2[0]; + _endDate2 = this.filter.dates2[1]; + } + let _filert = { + inv_codes: + this.filter.inv_codes !== "" + ? this.filter.inv_codes.split(/[,\s\n,]/) + : null, + inv_std: this.filter.inv_std, + po_codes: + this.filter.po_codes !== "" + ? this.filter.po_codes.split(/[,\s\n,]/) + : null, + app_codes: + this.filter.app_codes !== "" + ? this.filter.app_codes.split(/[,\s\n,]/) + : null, + begin_date: _beginDate, + end_date: _endDate, + begin_date2: _beginDate2, + end_date2: _endDate2, + }; + this.loading = true; + let resp = await getInventorypo(_filert); + this.pageNo = 1; + this.datas = resp.data.data; + this.datas = sortByKey(resp.data.data, "cpoid"); + } catch (error) { + } finally { + this.loading = false; } - if ( - this.filter.dates2.length == 2 && - this.filter.dates2[0] !== "" && - this.filter.dates2[0] !== "" - ) { - _beginDate2 = this.filter.dates2[0]; - _endDate2 = this.filter.dates2[1]; - } - let _filert = { - inv_codes: - this.filter.inv_codes !== "" - ? this.filter.inv_codes.split(/[,\s\n,]/) - : null, - inv_std: this.filter.inv_std, - po_codes: - this.filter.po_codes !== "" - ? this.filter.po_codes.split(/[,\s\n,]/) - : null, - app_codes: - this.filter.app_codes !== "" - ? this.filter.app_codes.split(/[,\s\n,]/) - : null, - begin_date: _beginDate, - end_date: _endDate, - begin_date2: _beginDate2, - end_date2: _endDate2, - }; - let resp = await getInventorypo(_filert); - this.pageNo = 1; - this.datas = resp.data.data; - this.datas = sortByKey(resp.data.data, "cpoid"); }, handlePagechange(page) {