到货情况查询:可设置预警天数,已到货数量空为0
This commit is contained in:
@@ -14,6 +14,9 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
<span>供应商:</span>
|
<span>供应商:</span>
|
||||||
<el-input v-model="supplierName" placeholder="供应商" size="small" clearable/>
|
<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
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
size="small"
|
size="small"
|
||||||
@@ -70,7 +73,7 @@
|
|||||||
<el-progress
|
<el-progress
|
||||||
:text-inside="true"
|
:text-inside="true"
|
||||||
:stroke-width="18"
|
:stroke-width="18"
|
||||||
:percentage="100*(parseInt(scope.row.合同物料到货总数)/parseInt(scope.row.合同物料采购总数)).toFixed(4)"
|
:percentage="parseFloat((100*scope.row.合同物料到货总数/scope.row.合同物料采购总数).toFixed(2))"
|
||||||
status="success"/>
|
status="success"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -114,7 +117,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="已到货数量" align="center" min-width="100">
|
<el-table-column label="已到货数量" align="center" min-width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.总到货数量 }}
|
{{ scope.row.总到货数量 ? scope.row.总到货数量 : 0 }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -130,6 +133,7 @@ export default {
|
|||||||
name: '', // 项目总价查询
|
name: '', // 项目总价查询
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
warningValue: 3,
|
||||||
check1: 0,
|
check1: 0,
|
||||||
check2: 0,
|
check2: 0,
|
||||||
contractNumValue: '',
|
contractNumValue: '',
|
||||||
@@ -169,6 +173,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
searchTable1() {
|
searchTable1() {
|
||||||
|
this.warningValue ? this.warningValue : this.warningValue = 1
|
||||||
this.arrival = [] // 规定到货时间数组
|
this.arrival = [] // 规定到货时间数组
|
||||||
this.now = new Date()
|
this.now = new Date()
|
||||||
this.contractNumValue ? this.check1 = 1 : this.check1 = 0
|
this.contractNumValue ? this.check1 = 1 : this.check1 = 0
|
||||||
@@ -177,13 +182,13 @@ export default {
|
|||||||
for (let i = 0; i < response.data.rows.length; i++) {
|
for (let i = 0; i < response.data.rows.length; i++) {
|
||||||
this.arrival.push(new Date(response.data.rows[i].规定到货时间))
|
this.arrival.push(new Date(response.data.rows[i].规定到货时间))
|
||||||
if (parseInt(response.data.rows[i].合同物料到货总数) === parseInt(response.data.rows[i].合同物料采购总数)) {
|
if (parseInt(response.data.rows[i].合同物料到货总数) === parseInt(response.data.rows[i].合同物料采购总数)) {
|
||||||
this.judge[i] = 1
|
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) {
|
} 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
|
this.judge[i] = 2 // 即将拖期
|
||||||
} else if (parseInt(response.data.rows[i].合同物料到货总数) !== parseInt(response.data.rows[i].合同物料采购总数) && (this.now - this.arrival[i]) > 86400000) {
|
} else if (parseInt(response.data.rows[i].合同物料到货总数) !== parseInt(response.data.rows[i].合同物料采购总数) && (this.arrival[i] - this.now) < 0) {
|
||||||
this.judge[i] = 3
|
this.judge[i] = 3 // 已拖期
|
||||||
} else if (parseInt(response.data.rows[i].合同物料到货总数) !== parseInt(response.data.rows[i].合同物料采购总数) && (this.now - this.arrival[i]) < 0) {
|
} 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.judge[i] = 4 // 进度正常
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.tableData1 = response.data.rows
|
this.tableData1 = response.data.rows
|
||||||
|
|||||||
Reference in New Issue
Block a user