代码更新

This commit is contained in:
2022-12-26 18:37:55 +08:00
parent c45532ac32
commit 90eb62000a

View File

@@ -105,12 +105,12 @@
<el-table-column show-overflow-tooltip sortable prop="pcsn" label="子卷批次号" align="center" />
<el-table-column show-overflow-tooltip sortable prop="sap_pcsn" label="sap批次" align="center" />
<el-table-column show-overflow-tooltip prop="canuse_qty" label="可出重量" :formatter="crud.formatNum3" align="center" />
<el-table-column show-overflow-tooltip prop="plan_qty" label="重量" :formatter="crud.formatNum3" width="160" align="center">
<template scope="scope">
<el-input-number v-show="!scope.row.edit" v-model="scope.row.plan_qty" :precision="3" :max="100000000" />
<span v-show="scope.row.edit">{{ scope.row.plan_qty }}</span>
</template>
</el-table-column>
<!-- <el-table-column show-overflow-tooltip prop="plan_qty" label="重量" :formatter="crud.formatNum3" width="160" align="center">-->
<!-- <template scope="scope">-->
<!-- <el-input-number v-show="!scope.row.edit" v-model="scope.row.plan_qty" :precision="3" :max="100000000" />-->
<!-- <span v-show="scope.row.edit">{{ scope.row.plan_qty }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" align="center" />
<el-table-column align="center" label="操作" width="160" fixed="right">
<template scope="scope">
@@ -215,22 +215,22 @@ export default {
this.crud.notify('出库重量不能超过未分配数', CRUD.NOTIFICATION_TYPE.INFO)
return false
}*/
if (row.plan_qty > row.canuse_qty) {
/* if (row.plan_qty > row.canuse_qty) {
this.crud.notify('出库重量不能超过库存可出重量', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (row.plan_qty === 0) {
this.crud.notify('出库重量为0不能保存', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
}*/
}
row.edit = !row.edit
if (row.edit) {
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) - row.plan_qty
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) + row.plan_qty
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) - parseFloat(row.canuse_qty)
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) + parseFloat(row.canuse_qty)
} else {
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) + row.plan_qty
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) - row.plan_qty
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) + parseFloat(row.canuse_qty)
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) - parseFloat(row.canuse_qty)
}
this.tableDtl.splice(index, 1, row) // 通过splice 替换数据 触发视图更新
},