From 04819196ff306563a2b5022fc6995266843ef9b3 Mon Sep 17 00:00:00 2001 From: chenjianan Date: Mon, 19 Nov 2018 10:30:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B0=E8=B4=A7=E6=83=85=E5=86=B5=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=EF=BC=9A=E5=8F=AF=E8=AE=BE=E7=BD=AE=E9=A2=84=E8=AD=A6?= =?UTF-8?q?=E5=A4=A9=E6=95=B0=EF=BC=8C=E5=B7=B2=E5=88=B0=E8=B4=A7=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E7=A9=BA=E4=B8=BA0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ArrivalStateSearch/index.vue | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/views/PurchasingCenter/ArrivalStateSearch/index.vue b/src/views/PurchasingCenter/ArrivalStateSearch/index.vue index f2b638ac..f31b247a 100644 --- a/src/views/PurchasingCenter/ArrivalStateSearch/index.vue +++ b/src/views/PurchasingCenter/ArrivalStateSearch/index.vue @@ -14,6 +14,9 @@ 供应商: + 提前 + + 天预警 @@ -114,7 +117,7 @@ @@ -130,6 +133,7 @@ export default { name: '', // 项目总价查询 data() { return { + warningValue: 3, check1: 0, check2: 0, contractNumValue: '', @@ -169,6 +173,7 @@ export default { }) }, searchTable1() { + this.warningValue ? this.warningValue : this.warningValue = 1 this.arrival = [] // 规定到货时间数组 this.now = new Date() this.contractNumValue ? this.check1 = 1 : this.check1 = 0 @@ -177,13 +182,13 @@ export default { for (let i = 0; i < response.data.rows.length; i++) { this.arrival.push(new Date(response.data.rows[i].规定到货时间)) if (parseInt(response.data.rows[i].合同物料到货总数) === parseInt(response.data.rows[i].合同物料采购总数)) { - this.judge[i] = 1 - } else if (parseInt(response.data.rows[i].合同物料到货总数) !== parseInt(response.data.rows[i].合同物料采购总数) && (this.now - this.arrival[i]) > 0 && (this.now - this.arrival[i]) < 86400000) { - this.judge[i] = 2 - } else if (parseInt(response.data.rows[i].合同物料到货总数) !== parseInt(response.data.rows[i].合同物料采购总数) && (this.now - this.arrival[i]) > 86400000) { - this.judge[i] = 3 - } else if (parseInt(response.data.rows[i].合同物料到货总数) !== parseInt(response.data.rows[i].合同物料采购总数) && (this.now - this.arrival[i]) < 0) { - this.judge[i] = 4 + this.judge[i] = 1 // 全部到货 + } else if (parseInt(response.data.rows[i].合同物料到货总数) !== parseInt(response.data.rows[i].合同物料采购总数) && (this.arrival[i] - this.now) > 0 && (this.arrival[i] - this.now) < (86400000 * this.warningValue)) { + this.judge[i] = 2 // 即将拖期 + } else if (parseInt(response.data.rows[i].合同物料到货总数) !== parseInt(response.data.rows[i].合同物料采购总数) && (this.arrival[i] - this.now) < 0) { + this.judge[i] = 3 // 已拖期 + } else if (parseInt(response.data.rows[i].合同物料到货总数) !== parseInt(response.data.rows[i].合同物料采购总数) && (this.arrival[i] - this.now) > (86400000 * this.warningValue)) { + this.judge[i] = 4 // 进度正常 } } this.tableData1 = response.data.rows