perf:生产领料/其他出库(bxerp+gz)改按仓库批次选择,生产入库批次下拉显示工段

抽isBatchPick统一bxerp/gz出库(do_out/other_out)为选仓库批次:下拉带
物料名/批次号/仓库/可发量、只读批次摘要、隐藏冗余框,选中自动回填并按
物料类型限定可领范围;销售发货仍仅bxerp,gx出库靠扫码保持原样不变。
生产入库批次下拉每项加显示工段(mgroup_name)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
caoqianming 2026-07-15 21:16:28 +08:00
parent 4c2caee8f6
commit 61c04fe150
1 changed files with 35 additions and 14 deletions

View File

@ -19,13 +19,13 @@
</el-form-item>
</el-col>
<el-col>
<el-form-item :label="type=='sale_out'&&project_code=='bxerp'?'仓库批次':'物料'" prop="material">
<el-form-item :label="isBatchPick?'仓库批次':'物料'" prop="material">
<xtSelect
:apiObj="apiObj"
v-model="form.material"
v-model:obj="selectObj"
:labelField="type=='sale_out'&&project_code=='bxerp'?'material_name':'full_name'"
:tableWidth="type=='sale_out'&&project_code=='bxerp'?760:600"
:labelField="isBatchPick?'material_name':'full_name'"
:tableWidth="isBatchPick?760:600"
style="width:100%"
:params="query"
@change="selectMaterialChange"
@ -36,13 +36,13 @@
<span v-else>{{ scope.row.material_name }}</span>
</template>
</el-table-column>
<el-table-column v-if="type=='sale_out'&&project_code=='bxerp'" label="批次号" prop="batch" min-width="120" />
<el-table-column v-if="type=='sale_out'&&project_code=='bxerp'" label="仓库" prop="warehouse_name" width="90" />
<el-table-column v-if="type=='sale_out'&&project_code=='bxerp'" label="可发数量" prop="count_canmio" width="90" />
<el-table-column v-if="isBatchPick" label="批次号" prop="batch" min-width="120" />
<el-table-column v-if="isBatchPick" label="仓库" prop="warehouse_name" width="90" />
<el-table-column v-if="isBatchPick" label="可发数量" prop="count_canmio" width="90" />
</xtSelect>
</el-form-item>
</el-col>
<el-col v-if="type=='sale_out'&&project_code=='bxerp'&&form.batch">
<el-col v-if="isBatchPick&&form.batch">
<el-form-item label="批次信息">
<span style="color: var(--el-text-color-regular);">
批次号{{ form.batch }}  仓库{{ selectObj&&selectObj.warehouse_name?selectObj.warehouse_name:'' }}  可发数量{{ batchcount }}
@ -50,7 +50,7 @@
</el-form-item>
</el-col>
<el-col>
<el-form-item label="批次号" prop="batch" v-if="!(type=='sale_out'&&project_code=='bxerp')">
<el-form-item label="批次号" prop="batch" v-if="!isBatchPick">
<el-input
v-if="form.type == 'pur_in'||form.type == 'other_in'"
v-model="form.batch"
@ -81,7 +81,7 @@
color: var(--el-text-color-secondary);
font-size: 13px;
"
>{{ item.count }}</span
>{{ item.count }}<template v-if="item.mgroup_name"> {{ item.mgroup_name }}</template></span
>
</el-option>
</el-select>
@ -95,7 +95,7 @@
/>
</el-form-item>
</el-col>
<el-col v-if="form.type == 'pur_in'||form.type == 'pur_out'||form.type == 'other_in'||form.type == 'do_out'||(form.type=='sale_out'&&project_code!='bxerp')||form.type=='other_out'||form.type=='pur_out'||form.type=='borrow_out'">
<el-col v-if="(form.type == 'pur_in'||form.type == 'pur_out'||form.type == 'other_in'||form.type == 'do_out'||form.type=='sale_out'||form.type=='other_out'||form.type=='pur_out'||form.type=='borrow_out')&&!isBatchPick">
<el-form-item label="仓库已有批次">
<el-select
v-model="selectBatch"
@ -129,7 +129,7 @@
<scScanner v-if="project_code=='gx'" @scanResult="codeTextChange"></scScanner>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="!(type=='sale_out'&&project_code=='bxerp')">
<el-col :md="12" :sm="24" v-if="!isBatchPick">
<el-form-item label="仓库" prop="warehouse">
<el-select
v-model="form.warehouse"
@ -368,6 +368,12 @@ export default {
}
},
computed: {
isBatchPick(){
// bxerp(gz/gx);/bxerp+gz(gx,)
if(this.type=='sale_out') return this.project_code=='bxerp';
if(this.type=='do_out'||this.type=='other_out') return ['bxerp','gz'].includes(this.project_code);
return false;
},
divStyle() {
return {
width: this.project_code=='gx' ? '80%' : '100%'
@ -522,9 +528,12 @@ export default {
this.inputBatchDisable = false;
}
this.query = query;
if(type == "sale_out"&&this.project_code=='bxerp'){
if(this.isBatchPick){
this.apiObj=this.$API.inm.warehouse.batch;
if(type=='do_out'||type=='other_out'){
// /(bxerp):,
this.query = type__in ? { material__type__in: type__in.replace(/\s/g,'') } : {};
}
}else{
this.apiObj=this.$API.mtm.material.list;
}
@ -583,7 +592,19 @@ export default {
sessionStorage.setItem("mioitemSelecObj",JSON.stringify(that.selectObj));
console.log("mioitemSelecObj",that.selectObj);
}
if(that.type == "sale_out"&&that.project_code=='bxerp'){
if((that.type == "do_out"||that.type == "other_out")&&that.isBatchPick){
// /(bxerp):,//
that.form.material = that.selectObj.material;
that.form.unit = that.selectObj.material_?that.selectObj.material_.unit:undefined;
that.form.unit_price = that.selectObj.material_?that.selectObj.material_.unit_price:0;
that.form.batch = that.selectObj.batch;
that.form.mb = that.selectObj.id;
that.form.warehouse = that.selectObj.warehouse;
that.batchcount = Number(that.selectObj.count_canmio);
that.form.count = Number(that.selectObj.count_canmio);
that.mTracking = that.selectObj.material_?that.selectObj.material_.tracking:10;
that.inputBatchDisable = true;
}else if(that.type == "sale_out"&&that.project_code=='bxerp'){
that.form.material = that.selectObj.material;
that.form.unit = that.selectObj.material_.unit;
that.form.unit_price = that.selectObj.material_.unit_price;