到货情况查询:可设置预警天数,已到货数量空为0

This commit is contained in:
chenjianan
2018-11-19 10:30:36 +08:00
parent 36cec28ab6
commit 04819196ff

View File

@@ -14,6 +14,9 @@
</el-select>
<span>供应商:</span>
<el-input v-model="supplierName" placeholder="供应商" size="small" clearable/>
<span>提前</span>
<el-input-number v-model="warningValue" :min="1" controls-position="right" size="small" style="width: 90px"/>
<span>天预警</span>
<el-button
type="success"
size="small"
@@ -70,7 +73,7 @@
<el-progress
:text-inside="true"
:stroke-width="18"
:percentage="100*(parseInt(scope.row.合同物料到货总数)/parseInt(scope.row.合同物料采购总数)).toFixed(4)"
:percentage="parseFloat((100*scope.row.合同物料到货总数/scope.row.合同物料采购总数).toFixed(2))"
status="success"/>
</template>
</el-table-column>
@@ -114,7 +117,7 @@
</el-table-column>
<el-table-column label="已到货数量" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.总到货数量 }}
{{ scope.row.总到货数量 ? scope.row.总到货数量 : 0 }}
</template>
</el-table-column>
</el-table>
@@ -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