|
|
@ -147,14 +147,14 @@ |
|
|
|
<el-input v-model="scope.row.estimateConfirmedPrice" @input="limitInput1($event,scope.$index)" placeholder="" clearable></el-input> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="数量" width="100" prop="estimateNum" align="center"> |
|
|
|
<el-table-column label="数量" width="140" prop="estimateNum" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.estimateNum" @input="limitInput2($event,scope.$index)" placeholder="" clearable></el-input> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="总价值" width="120px" prop="estimateCalculatedValue" align="center"> |
|
|
|
<el-table-column label="总价值" width="150px" prop="estimateCalculatedValue" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.estimateCalculatedValue" @input="limitInput3($event,scope.$index)" :readonly="true" placeholder="" clearable></el-input> |
|
|
|
<el-input v-model="scope.row.estimateCalculatedValue" :readonly="true" placeholder="" clearable></el-input> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="规格单位" width="130" prop="proUnit" align="center"> |
|
|
@ -296,6 +296,7 @@ |
|
|
|
showAdd() { |
|
|
|
this.viewTitle = "【新增】采购订单"; |
|
|
|
this.clearList() |
|
|
|
this.openAddPurchaseDialog() |
|
|
|
}, |
|
|
|
async showEdit(row) { |
|
|
|
this.viewTitle = "【修改】采购订单"; |
|
|
@ -341,7 +342,6 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
openAddPurchaseDialog () { |
|
|
|
this.clearList() |
|
|
|
var now = new Date() |
|
|
|
this.purchaseForm.purchaseNo = 'IP' + now.getTime() |
|
|
|
if (this.productList2.length == 0) this.productList2 = this.productList |
|
|
@ -368,7 +368,8 @@ |
|
|
|
for(let i=0;i<arrList.length;i++){ |
|
|
|
if(arrList[i].estimateNum && arrList[i].estimateConfirmedPrice){ |
|
|
|
let newValue=parseFloat(arrList[i].estimateNum) * parseFloat(arrList[i].estimateConfirmedPrice) || 0 |
|
|
|
this.$set(arrList[i], 'estimateCalculatedValue', newValue) |
|
|
|
let getValue=Math.floor(newValue*100)/100 |
|
|
|
this.$set(arrList[i], 'estimateCalculatedValue', getValue) |
|
|
|
}else{ |
|
|
|
this.$set(arrList[i], 'estimateCalculatedValue', '') |
|
|
|
} |
|
|
@ -392,15 +393,6 @@ |
|
|
|
.match(/^\d*(\.?\d{0,2})/g)[0] || ""; // 第五步:最终匹配得到结果 以数字开头,只有一个小数点,而且小数点后面只能有0到2位小数 |
|
|
|
this.getLists() |
|
|
|
}, |
|
|
|
limitInput3(value, index) { |
|
|
|
this.purchaseForm.products[index].estimateCalculatedValue = |
|
|
|
("" + value) // 第一步:转成字符串 |
|
|
|
.replace(/[^\d^\.]+/g, "") // 第二步:把不是数字,不是小数点的过滤掉 |
|
|
|
.replace(/^0+(\d)/, "$1") // 第三步:第一位0开头,0后面为数字,则过滤掉,取后面的数字 |
|
|
|
.replace(/^\./, "0.") // 第四步:如果输入的第一位为小数点,则替换成 0. 实现自动补全 |
|
|
|
.match(/^\d*(\.?\d{0,2})/g)[0] || ""; // 第五步:最终匹配得到结果 以数字开头,只有一个小数点,而且小数点后面只能有0到2位小数 |
|
|
|
this.getLists() |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|