fix:玻纤采购入库编号自动生成

This commit is contained in:
shijing 2025-03-14 09:45:25 +08:00
parent 2f9c0edd00
commit 0564c5f6da
1 changed files with 22 additions and 14 deletions

View File

@ -141,11 +141,11 @@
</el-form-item>
</el-col>
</el-row>
<el-row v-if="project_code=='bxerp'&&form.type == 'pur_in'">
<el-row v-if="project_code=='bxerp'&&form.type == 'pur_in'&&form.count>1">
<el-col :md="12" :sm="24" v-for="i in form.count" :key="i">
<el-form-item :label="'编号'+i">
<el-input-number v-if="i==1" v-model="mioitems[0]" @change="firstNumberChange" placeholder="请输入编号" controls-position="right" style="width:100%"/>
<el-input v-else v-model="mioitems[i-1]" placeholder="请输入编号" :disabled="true" />
<!-- <el-input-number v-if="i==1" v-model="mioitems[0]" @change="firstNumberChange" placeholder="请输入编号" controls-position="right" style="width:100%"/> -->
<el-input v-model="mioitems[i-1]" placeholder="请输入编号" :disabled="true" />
</el-form-item>
</el-col>
</el-row>
@ -282,8 +282,16 @@ export default {
this.getWarehouseOptions();
},
getWarehouseOptions() {
let that = this;
this.$API.inm.warehouse.list.req({ page: 0 }).then((res) => {
this.warehouseOptions = res;
if(that.form.type=='pur_in'){
res.forEach((item) => {
if (item.name == "原料库") {
that.form.warehouse = item.id;
}
})
}
});
},
//
@ -458,22 +466,19 @@ export default {
let that = this;
if(that.project_code=='bxerp'){
if(that.form.type == "pur_in"){
let numbers = that.mioitems[0];
that.mioitems = [];that.mioitemw = [];
for(let i=0;i<that.form.count;i++){
if(numbers!=''&&numbers!=null&&numbers!=undefined){
that.mioitems[i] = Number(numbers)+i;
let obj = {};
obj.number = that.mioitems[i];
that.mioitemw.push(obj);
}else{
that.mioitems[i] = '';
}
let indexs = i+1;
indexs = indexs<10?'0'+indexs:indexs;
that.mioitems[i] = that.form.batch+'-'+indexs;
let obj = {};
obj.number = that.mioitems[i];
that.mioitemw.push(obj);
}
}else if(that.form.type == "do_out"){
for(let i=0;i<that.form.count;i++){
let obj = {};
obj.number = that.form.batch+'0'+(i+1);
obj.number = that.form.batch+'-'+(i+1);
that.mioitemw.push(obj);
}
}
@ -486,10 +491,13 @@ export default {
for(let i=0;i<that.form.count;i++){
that.mioitems[i] = Number(numbers)+i;
let obj = {};
obj.number = that.mioitems[i];
obj.number = that.form.batch+'-'+(i+1);
that.mioitemw.push(obj);
}
},
validateInput(i){
this.mioitems[i] = this.mioitems[i].replace(/\D/g, '');
},
//
submit() {
let that = this;