Refine defect labels in material selectors

This commit is contained in:
caoqianming 2026-04-23 08:46:41 +08:00
parent 79c579c55e
commit 1b613f0d7f
4 changed files with 28 additions and 5 deletions

View File

@ -55,7 +55,7 @@
<span>{{ item.batch }}</span>
<span v-if="item.material_&&item.material_.process_name">({{ item.material_.process_name }})</span>
<span v-else>(原料棒)</span>
<span v-if="item.defect!==null" style="color: red;">{{ item.defect_name }}</span>
<el-tag v-if="item.defect!==null" type="warning" size="small" effect="plain" style="margin-left: 8px;">{{ item.defect_name }}</el-tag>
<div style="float: right">
<span>{{ item.count_canhandover }}</span>
<span v-if="item.notok_sign_name !== null" style="color: #aaaaaa">

View File

@ -75,7 +75,7 @@
:value="item.id"
>
<span>{{ item.batch }}</span>
<span v-if="item.defect_name&&item.defect_name!==null">({{ item.defect_name }})</span>
<el-tag v-if="item.defect_name&&item.defect_name!==null" type="warning" size="small" effect="plain" style="margin-left: 8px;">{{ item.defect_name }}</el-tag>
<span style="float: right;">{{ item.count_cando }}</span>
</el-option>
</el-select>

View File

@ -36,6 +36,7 @@
:apiObj="apiObjM"
v-model="selectObjIds"
v-model:obj="selectObjs"
v-model:label="selectMaterialLabel"
:labelField="'batch'"
style="width: 100%;"
:params = "paramsM"
@ -47,7 +48,7 @@
<span v-if="scope.row.state==20" style="color: red;border: 1px solid red;border-radius: 3px;">不合格</span>
<span v-if="scope.row.state==30" style="color: orange;border: 1px solid orange;border-radius: 3px;">返工</span>
<span>{{ scope.row.batch }}({{ scope.row.material_name }})</span>
<span v-if="scope.row.defect_name !== null" style="color: orangered">{{ scope.row.defect_name }}</span>
<el-tag v-if="scope.row.defect_name" type="warning" size="small" effect="plain" style="margin-left: 8px;">{{ scope.row.defect_name }}</el-tag>
</template>
</el-table-column>
<el-table-column label="可交接数量" prop="count_canhandover" width="110px"></el-table-column>
@ -200,6 +201,7 @@
:apiObj="apiObjM"
v-model="selectObjIds"
v-model:obj="selectObjs"
v-model:label="selectMaterialLabel"
:labelField="'batch'"
style="width: 100%;"
:params = "paramsM"
@ -211,7 +213,7 @@
<span v-if="scope.row.state==20" style="color: red;border: 1px solid red;border-radius: 3px;">不合格</span>
<span v-if="scope.row.state==30" style="color: orange;border: 1px solid orange;border-radius: 3px;">返工</span>
<span>{{ scope.row.batch }}({{ scope.row.material_name }})</span>
<span v-if="scope.row.defect_name !== null" style="color: orangered">{{ scope.row.defect_name }}</span>
<el-tag v-if="scope.row.defect_name" type="warning" size="small" effect="plain" style="margin-left: 8px;">{{ scope.row.defect_name }}</el-tag>
</template>
</el-table-column>
<el-table-column label="可交接数量" prop="count_canhandover" width="110px"></el-table-column>
@ -343,6 +345,7 @@ export default {
},
initForm:{},
selectObjIds:[],
selectMaterialLabel:"",
apiObj:this.$API.mtm.material.list,
apiObjM:null,
params:{},
@ -662,6 +665,7 @@ export default {
//handoverb
materialChange0(){
let that = this;
that.selectMaterialLabel = that.selectObjs.map(item => that.formatWmaterialLabel(item)).join(";");
that.totalCount = 0;
that.selectObjs.forEach(item=>{
if(that.handoverbIds.indexOf(item.id)==-1){
@ -692,6 +696,12 @@ export default {
that.countChange();
},500)
},
formatWmaterialLabel(row){
if(!row || !row.batch){
return "";
}
return row.defect_name ? `${row.batch} [${row.defect_name}]` : row.batch;
},
countChange(){
let that = this;
let totalCount = 0;

View File

@ -44,6 +44,7 @@
:apiObj="apiObjM"
v-model="form.wm_in"
v-model:obj="selectObj"
v-model:label="wmInLabel"
:labelField="'batch'"
style="width: 100%;"
:params = "paramsM"
@ -55,7 +56,7 @@
<span v-if="scope.row.state==20" style="color: red;border: 1px solid red;border-radius: 3px;">不合格</span>
<span v-if="scope.row.state==30" style="color: orange;border: 1px solid orange;border-radius: 3px;">返工</span>
<span>{{ scope.row.batch }}({{ scope.row.material_name }})</span>
<span v-if="scope.row.defect_name !== null" style="color: orangered">{{ scope.row.defect_name }}</span>
<el-tag v-if="scope.row.defect_name" type="warning" size="small" effect="plain" style="margin-left: 8px;">{{ scope.row.defect_name }}</el-tag>
</template>
</el-table-column>
<el-table-column label="车间库存" prop="count" width="110px"></el-table-column>
@ -271,6 +272,7 @@ export default {
],
},
selectObj:{count:0},
wmInLabel:"",
batch_count:null,
codeBatch:"",
materialFix:"",
@ -420,6 +422,11 @@ export default {
},
materialBatchChange(){
let that = this;
if(!that.selectObj || !that.selectObj.id){
that.wmInLabel = "";
return;
}
that.wmInLabel = that.formatWmaterialLabel(that.selectObj);
that.getRoute(that.selectObj.material);
that.form.batch = that.selectObj.batch;
that.form.count_use = that.selectObj.count_cando;
@ -483,6 +490,12 @@ export default {
})
that.countCellChanges();
},
formatWmaterialLabel(row){
if(!row || !row.batch){
return "";
}
return row.defect_name ? `${row.batch} [${row.defect_name}]` : row.batch;
},
//
submit() {
let that = this;