fix:光芯日志选择物料组件更换成el-select

This commit is contained in:
shijing 2026-03-06 16:27:44 +08:00
parent 2aec38201a
commit 809c14c123
1 changed files with 28 additions and 31 deletions

View File

@ -40,25 +40,20 @@
</el-col>
<el-col>
<el-form-item label="批次号" prop="wm_in">
<el-select
<xtSelect
:apiObj="apiObj"
:params="params"
v-model="form.wm_in"
placeholder="交接物料批次号"
class="width100"
filterable
@change="changeMaterial"
:labelField="'batch'"
v-model:obj="materialrow"
v-model:label="form.batch"
style="width:100%"
@change="materialChange"
>
<el-option
v-for="item in materialOptions"
:key="item.id"
:label="item.batch"
:value="item.id"
>
<div style="position:relative;width:100%">
<span style="margin-right:15px!important;">{{ item.batch }}({{ item.material_name }})</span>
<span style="position:absolute;right:0">{{ item.count }}</span>
</div>
</el-option>
</el-select>
<el-table-column label="批次号" prop="batch"></el-table-column>
<el-table-column label="名称" prop="material_name"></el-table-column>
<el-table-column label="数量" prop="count"></el-table-column>
</xtSelect>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
@ -407,6 +402,9 @@ export default {
show: "查看日志",
},
//
apiObj:this.$API.wpm.wmaterial.list,
params:{},
materialrow:{},
form: Object.assign({}, defaultForm),
//
rules: {
@ -638,20 +636,19 @@ export default {
params.state = 10;//
params.material = that.material_in!==''?that.material_in:'';
}
console.log('that.material_in:',that.material_in);
that.$API.wpm.wmaterial.list.req(params).then((res) => {
that.materialOptions = res;
if(that.codeText!==''){
res.forEach(item=>{
if(item.batch == that.codeBatch){
that.form.wm_in = item.id;
that.form.batch = item.batch;
that.materialCount = that.form.count_use = that.form.count_ok = item.count_cando;
that.form.count_real = item.count-that.form.count_pn_jgqbl;
}
that.params = params;
},
materialChange(){
let that = this;
that.qct_defects.forEach((item) => {
that.defectform[item.defect_name] = 0;
that.defectinform[item.defect_name] = 0;
})
}
});
that.materialFix = that.materialrow.material;
that.form.batch = that.materialrow.batch;
that.materialCount = that.form.count_use = that.form.count_real = that.form.count_ok = Number(that.materialrow.count);
that.form.count_real = Number(that.materialrow.count)-that.form.count_pn_jgqbl;
that.getdefects(that.route,that.material_in,that.material_out);
},
changeMaterial(val){
let that = this;