领料,出库数量问题

This commit is contained in:
zzyuan 2025-07-21 13:19:21 +08:00
parent 35fa2f5eb8
commit 2e19d2ca9a
2 changed files with 18 additions and 4 deletions

View File

@ -82,7 +82,7 @@
<el-table-column label="档口名称" align="center" prop="stallName" :show-overflow-tooltip="true"/> <el-table-column label="档口名称" align="center" prop="stallName" :show-overflow-tooltip="true"/>
<el-table-column label="货品数量" align="center" prop="fetchNum" :show-overflow-tooltip="true"> <el-table-column label="货品数量" align="center" prop="fetchNum" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model.number="scope.row.fetchNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.fetchNum=v.replace(/[^\d]/g,''))"/> <el-input v-model="scope.row.fetchNum" placeholder="请输入" maxlength="10" clearable @change="patternValue(scope.row)"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"> <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true">
@ -521,7 +521,14 @@ export default {
} }
}); });
}, },
patternValue(row){
row.fetchNum = row.fetchNum.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1')
setTimeout(()=>{
if(Number(row.fetchNum)>Number(row.materialNum)){
row.fetchNum = row.materialNum
}
},500)
},
// //
formatDate(date) { formatDate(date) {
// YYYY-MM-DD // YYYY-MM-DD

View File

@ -74,7 +74,7 @@
<el-table-column label="库存数量" align="center" prop="materialNum" :show-overflow-tooltip="true"/> <el-table-column label="库存数量" align="center" prop="materialNum" :show-overflow-tooltip="true"/>
<el-table-column label="出库数量" align="center" prop="fetchNum" :show-overflow-tooltip="true"> <el-table-column label="出库数量" align="center" prop="fetchNum" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model.number="scope.row.fetchNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.fetchNum=v.replace(/[^\d]/g,''))"/> <el-input v-model.number="scope.row.fetchNum" placeholder="请输入" maxlength="10" clearable @change="patternValue(scope.row)"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -574,7 +574,14 @@ export default {
handleSelectionChange3(selection) { handleSelectionChange3(selection) {
}, },
patternValue(row){
row.fetchNum = row.fetchNum.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1')
setTimeout(()=>{
if(Number(row.fetchNum)>Number(row.materialNum)){
row.fetchNum = row.materialNum
}
},500)
},
// //
formatDate(date) { formatDate(date) {
// YYYY-MM-DD // YYYY-MM-DD