Compare commits

..

2 Commits

Author SHA1 Message Date
caoqianming c37eab7bbc Clarify available inventory quantities 2026-07-30 14:22:46 +08:00
caoqianming 41b8e6f29b Fix defect metadata in batch merge 2026-07-30 14:22:46 +08:00
6 changed files with 85 additions and 32 deletions

View File

@ -26,7 +26,7 @@
></el-input>
<scScanner @scanResult="codeTextChange" v-if="project_code!=='bxerp'"></scScanner>
</el-form-item>
<el-form-item label="计:">
<el-form-item label="交接合计:">
{{ totalCount }}
</el-form-item>
<el-form-item label="原始物料" v-if="mode!='add'&&form.mtype==20" style="margin-left: 20px;">
@ -75,7 +75,7 @@
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="数量">
<el-form-item label="可交接数量">
<span>{{ listItem.count_canhandover }}</span>
</el-form-item>
</el-col>
@ -976,6 +976,8 @@ export default {
obj.count = item.count_canhandover;
obj.state = res.state;
obj.defect = res.defect;
obj.defect_okcate = item.defect_okcate;
obj.tracking = item.material_ && item.material_.tracking;
obj.handoverbw = [];
that.$API.wpm.wpr.list.req({wm:item.id,page:0}).then((res) => {
let handoverbw = [];

View File

@ -72,7 +72,7 @@
:query="query"
@selection-change="selectionChange"
>
<el-table-column type="selection" width="50"></el-table-column>
<el-table-column type="selection" width="50" :selectable="canSelectForHandover"></el-table-column>
<el-table-column label="库存状态" prop="state" width="110" >
<template #default="scope">
<el-tag :type="wmState[scope.row.state]?.type">
@ -132,24 +132,30 @@
</template>
</el-table-column>
<el-table-column
label="数量"
prop="count"
min-width="80"
label="可用/库存"
prop="count_canhandover"
min-width="100"
>
<template #default="scope">
<span v-if="scope.row.material_&&scope.row.material_.tracking==10">{{scope.row.count}}</span>
<el-link v-else :underline="false" type="primary" @click="showWpr(scope.row)">{{scope.row.count}}</el-link>
</template>
<template #default="scope">
<el-tooltip
:content="`生产中:${scope.row.count_working || 0};交接中:${scope.row.count_handovering || 0}`"
placement="top"
>
<span>
<span :style="{ color: Number(scope.row.count_canhandover || 0) > 0 ? '#0052d9' : '#909399', fontWeight: 600 }">
{{ scope.row.count_canhandover }}
</span>
<span> / </span>
<span v-if="scope.row.material_&&scope.row.material_.tracking==10">{{scope.row.count}}</span>
<el-link v-else :underline="false" type="primary" @click.stop="showWpr(scope.row)">{{scope.row.count}}</el-link>
</span>
</el-tooltip>
</template>
</el-table-column>
<el-table-column
label="备注"
prop="note"
></el-table-column>
<el-table-column
label="生产中"
prop="count_working"
min-width="80"
></el-table-column>
<el-table-column
label="缺陷项/标记"
prop="defect_name"
@ -519,6 +525,9 @@ export default {
});
},
//
canSelectForHandover(row) {
return Number(row.count_canhandover || 0) > 0;
},
selectionChange(selection) {
let that = this;
that.selection = selection;
@ -547,13 +556,26 @@ export default {
let that = this;
that.changebatch = true;
let handoverb = [];
if(that.selection.length>0){
that.selection.forEach(item=>{
const selectableItems = that.selection.filter(item => Number(item.count_canhandover || 0) > 0);
if(selectableItems.length !== that.selection.length){
that.$message.warning("已忽略无可交接数量的批次");
}
if(selectableItems.length === 0){
return;
}
if(selectableItems.length>0){
selectableItems.forEach(item=>{
that.Mmodel = item.material_.model;
let obj = {};
obj.id = item.id;
obj.wm = item.id;
obj.batch = item.batch;
obj.state = item.state;
obj.defect = item.defect;
obj.defect_okcate = item.defect_okcate;
obj.tracking = item.material_ && item.material_.tracking;
obj.material_ = item.material_;
obj.material = item.material;
obj.process = item.material_.process_name;
obj.count_canhandover = item.count_canhandover;
obj.count = item.count_canhandover;

View File

@ -71,7 +71,7 @@
:query="query"
@selection-change="selectionChange"
>
<el-table-column type="selection" width="50"></el-table-column>
<el-table-column type="selection" width="50" :selectable="canSelectForHandover"></el-table-column>
<el-table-column label="库存状态" prop="state" width="110" >
<template #default="scope">
<el-tag :type="wmState[scope.row.state]?.type">
@ -131,24 +131,30 @@
</template>
</el-table-column>
<el-table-column
label="数量"
prop="count"
min-width="80"
label="可用/库存"
prop="count_canhandover"
min-width="100"
>
<template #default="scope">
<span v-if="scope.row.material_&&scope.row.material_.tracking==10">{{scope.row.count}}</span>
<el-link v-else :underline="false" type="primary" @click="showWpr(scope.row)">{{scope.row.count}}</el-link>
</template>
<template #default="scope">
<el-tooltip
:content="`生产中:${scope.row.count_working || 0};交接中:${scope.row.count_handovering || 0}`"
placement="top"
>
<span>
<span :style="{ color: Number(scope.row.count_canhandover || 0) > 0 ? '#0052d9' : '#909399', fontWeight: 600 }">
{{ scope.row.count_canhandover }}
</span>
<span> / </span>
<span v-if="scope.row.material_&&scope.row.material_.tracking==10">{{scope.row.count}}</span>
<el-link v-else :underline="false" type="primary" @click.stop="showWpr(scope.row)">{{scope.row.count}}</el-link>
</span>
</el-tooltip>
</template>
</el-table-column>
<el-table-column
label="备注"
prop="note"
></el-table-column>
<el-table-column
label="生产中"
prop="count_working"
min-width="80"
></el-table-column>
<el-table-column
label="缺陷项/标记"
prop="defect_name"
@ -509,6 +515,9 @@ export default {
});
},
//
canSelectForHandover(row) {
return Number(row.count_canhandover || 0) > 0;
},
selectionChange(selection) {
let that = this;
that.selection = selection;
@ -536,13 +545,25 @@ export default {
batchConcat(){
this.changebatch = true;
let handoverb = [];
if(this.selection.length>0){
this.selection.forEach(item=>{
const selectableItems = this.selection.filter(item => Number(item.count_canhandover || 0) > 0);
if(selectableItems.length !== this.selection.length){
this.$message.warning("已忽略无可交接数量的批次");
}
if(selectableItems.length === 0){
return;
}
if(selectableItems.length>0){
selectableItems.forEach(item=>{
let obj = {};
obj.id = item.id;
obj.wm = item.id;
obj.state = item.state;
obj.batch = item.batch;
obj.defect = item.defect;
obj.defect_okcate = item.defect_okcate;
obj.tracking = item.material_ && item.material_.tracking;
obj.material_ = item.material_;
obj.material = item.material;
obj.process = item.material_.process_name;
obj.count_canhandover = item.count_canhandover;
obj.count = item.count_canhandover;

View File

@ -911,6 +911,8 @@ export default {
obj.state = item.state;
obj.defect = item.defect;
obj.defect_name = item.defect_name;
obj.defect_okcate = item.defect_okcate;
obj.tracking = item.material_ && item.material_.tracking;
obj.count_cando = cando;
obj.material = item.material;
that.form.handoverb.push(obj)

View File

@ -362,6 +362,9 @@ export default {
obj.batch = item.batch;
obj.state = item.state;
obj.defect = item.defect;
obj.defect_okcate = item.defect_okcate;
obj.tracking = item.material_ && item.material_.tracking;
obj.material_ = item.material_;
obj.material = item.material;
obj.count_canhandover = item.count_canhandover;
obj.count = item.count_canhandover;

View File

@ -434,6 +434,9 @@ export default {
obj.batch = item.batch;
obj.state = item.state;
obj.defect = item.defect;
obj.defect_okcate = item.defect_okcate;
obj.tracking = item.material_ && item.material_.tracking;
obj.material_ = item.material_;
obj.material = item.material;
obj.count_canhandover = item.count_canhandover;
obj.count = item.count_canhandover;