小数限制修改。日期默认修改
This commit is contained in:
parent
03fc862fbd
commit
1d25cee51e
|
|
@ -123,7 +123,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="本次入库数量" align="center" prop="purNum" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.purNum" placeholder="请输入" maxlength="3" clearable @change="patternValue(scope.row)"/>
|
||||
<el-input v-model="scope.row.purNum" placeholder="请输入" maxlength="6" clearable @change="patternValue(scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -510,6 +510,8 @@ export default {
|
|||
obj.unitPrice = item.unitPrice/100;
|
||||
this.$set(obj,"purNum",0)
|
||||
this.$set(obj,"supplierId",null)
|
||||
this.$set(obj, "productDate", this.formatDate(new Date()));
|
||||
this.$set(obj, "expireTime", this.formatDate(new Date()));
|
||||
this.batchChosenMaterial.push(obj)
|
||||
})
|
||||
},
|
||||
|
|
@ -725,12 +727,14 @@ export default {
|
|||
this.materialList.forEach(item=>{
|
||||
this.$set(item,"unitPrice",Number(item.singlePrice)/100)
|
||||
this.$set(item,"supplierId",this.importRow.supplierId)
|
||||
this.$set(item, "productDate", this.formatDate(new Date()));
|
||||
this.$set(item, "expireTime", this.formatDate(new Date()));
|
||||
if(item.intoNum&&item.intoNum>0){
|
||||
this.$set(item,"purNum",Number(item.totalQualifiedNum)-Number(item.intoNum))
|
||||
}else{
|
||||
this.$set(item,"purNum",Number(item.totalQualifiedNum))
|
||||
}
|
||||
})
|
||||
});
|
||||
this.baseInfo.relateOrderGoodsId = this.importRow.orderGoodsCode;
|
||||
this.$set(this.baseInfo,"remark","导入采购订单")
|
||||
setTimeout(()=>{
|
||||
|
|
@ -744,6 +748,14 @@ export default {
|
|||
},
|
||||
patternValue(row){
|
||||
row.purNum = row.purNum.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1')
|
||||
if (row.purNum.split(".").length > 2) {
|
||||
row.purNum = 0;
|
||||
return
|
||||
}
|
||||
if (row.purNum.split(".")[1].length > 2) {
|
||||
row.purNum = row.purNum.substr(0, row.purNum.length - 1);
|
||||
return
|
||||
}
|
||||
if(row.intoNum&&row.intoNum>0){
|
||||
setTimeout(()=>{
|
||||
if(Number(row.purNum)>(Number(row.totalQualifiedNum)-Number(row.intoNum))){
|
||||
|
|
|
|||
Loading…
Reference in New Issue