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