光子分支

This commit is contained in:
shijing 2025-04-07 16:34:59 +08:00
parent 5980db9a50
commit 4255889281
4 changed files with 86 additions and 56 deletions

View File

@ -12,9 +12,9 @@
:rules="rules" :rules="rules"
label-width="120px" label-width="120px"
> >
<!-- <el-form-item label="编号" prop="number"> <el-form-item label="编号" prop="number">
<el-input v-model="form.number" placeholder="编号" /> <el-input v-model="form.number" placeholder="编号" />
</el-form-item> --> </el-form-item>
<el-form-item label="出入库日期"> <el-form-item label="出入库日期">
<el-date-picker <el-date-picker
v-model="form.inout_date" v-model="form.inout_date"

View File

@ -15,7 +15,18 @@
<el-row> <el-row>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="物料" prop="material"> <el-form-item label="物料" prop="material">
<el-select <xtSelect
:apiObj="apiObj"
v-model="form.material"
v-model:obj="selectObj"
:labelField="'full_name'"
style="width:100%"
:params="query"
@change="selectMaterialChange"
>
<el-table-column label="物料" prop="full_name"></el-table-column>
</xtSelect>
<!-- <el-select
v-model="selectMaterial" v-model="selectMaterial"
value-key="id" value-key="id"
clearable clearable
@ -40,7 +51,7 @@
></span ></span
> >
</el-option> </el-option>
</el-select> </el-select> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
@ -53,6 +64,8 @@
clearable clearable
style="width: 100%" style="width: 100%"
:disabled="inputBatchDisable" :disabled="inputBatchDisable"
@clear="selectBatchClear"
@change="selectChange"
> >
<el-option <el-option
v-for="item in wbatchOptions" v-for="item in wbatchOptions"
@ -81,7 +94,6 @@
style="width: 100%" style="width: 100%"
@change="selectBatchChange" @change="selectBatchChange"
@clear="selectBatchClear" @clear="selectBatchClear"
:disabled="selectBatchDisable"
> >
<el-option <el-option
v-for="item in batchOptions" v-for="item in batchOptions"
@ -119,7 +131,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24" v-if="cate == 'mainso'"> <el-col :md="12" :sm="24" v-if="mTracking==20&&(form.type == 'do_in' ||form.type == 'pur_in'||form.type == 'other_in')">
<el-form-item label="数量"> <el-form-item label="数量">
<el-input-number <el-input-number
v-model="form.count" v-model="form.count"
@ -141,7 +153,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row v-if="project_code=='bxerp'&&form.type == 'pur_in'&&form.count>1"> <el-row v-if="mTracking==20&&form.count>1&&(form.type == 'do_in'||form.type == 'pur_in'||form.type == 'other_in')">
<el-col :md="12" :sm="24" v-for="i in form.count" :key="i"> <el-col :md="12" :sm="24" v-for="i in form.count" :key="i">
<el-form-item :label="'编号'+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-number v-if="i==1" v-model="mioitems[0]" @change="firstNumberChange" placeholder="请输入编号" controls-position="right" style="width:100%"/> -->
@ -253,6 +265,7 @@ export default {
}, },
], ],
}, },
selectObj:{},
visible: false, visible: false,
isSaveing: false, isSaveing: false,
materialOptions: [], materialOptions: [],
@ -269,6 +282,8 @@ export default {
mioitems:[''], mioitems:[''],
mioitemw:[], mioitemw:[],
project_code:'', project_code:'',
mTracking:10,
apiObj:this.$API.mtm.material.list,
}; };
}, },
mounted() { mounted() {
@ -347,7 +362,7 @@ export default {
this.inputBatchDisable = true; this.inputBatchDisable = true;
} else if (type == "do_in") { } else if (type == "do_in") {
// //
query = { page: 0, type__in: type__in }; query = { page: 0,is_hidden: false, type__in: type__in };
this.inputBatchDisable = false; this.inputBatchDisable = false;
} else if (type == "pur_in") { } else if (type == "pur_in") {
// //
@ -368,12 +383,13 @@ export default {
}; };
this.inputBatchDisable = true; this.inputBatchDisable = true;
} else { } else {
query = { page: 0 }; query = { page: 0 ,is_hidden:false};
} }
this.query = query;
this.$API.mtm.material.list.req(query).then((res) => { this.apiObj=this.$API.mtm.material.list;
this.materialOptions = res; // this.$API.mtm.material.list.req(query).then((res) => {
}); // this.materialOptions = res;
// });
}, },
async initAssemb(item) { async initAssemb(item) {
this.selectBatchDisable = true; this.selectBatchDisable = true;
@ -410,23 +426,35 @@ export default {
} }
}); });
}, },
selectMaterialChange(item) { selectChange(item){
var that = this; console.log(item)
var type = this.form.type; let that = this;
var material = item.id; that.wbatchOptions.forEach((item) => {
that.form.material = material; if(that.form.batch == item.batch){
that.form.count = item.count;
if (type == "do_in") { that.form.wm = item.id;
if (item.is_assemb) { }
this.initAssemb(item); })
} else {
this.selectBatchDisable = false; },
this.components = []; selectMaterialChange() {
this.assembShow = false; var that = this;
this.getBatchOptions(); if(that.form.material!==''&&that.form.material!==null&&that.form.material!==undefined){
var type = that.form.type;
that.form.material = that.selectObj.id;
that.mTracking = that.selectObj.tracking;
if (type == "do_in") {
if (that.selectObj.is_assemb) {
that.initAssemb(that.selectObj);
} else {
that.selectBatchDisable = false;
that.components = [];
that.assembShow = false;
that.getBatchOptions();
}
} else {
that.getBatchOptions();
} }
} else {
this.getBatchOptions();
} }
}, },
getItem(options, id) { getItem(options, id) {
@ -437,15 +465,18 @@ export default {
} }
}, },
selectBatchChange(item) { selectBatchChange(item) {
this.form.batch = item.batch; if(item!==''&&item!==null&&item!==undefined){
this.form.mb = item.id; this.form.batch = item.batch;
this.form.count = item.count; this.form.mb = item.id;
this.form.warehouse = item.warehouse; this.form.count = item.count;
this.warehouseDisable = true; this.form.warehouse = item.warehouse;
this.inputBatchDisable = true; this.warehouseDisable = true;
this.inputBatchDisable = true;
}
}, },
selectBatchClear() { selectBatchClear() {
this.form.mb = ""; this.form.mb = "";
this.form.wm = "";
this.form.batch = ""; this.form.batch = "";
this.form.count = ""; this.form.count = "";
this.form.warehouse = ""; this.form.warehouse = "";
@ -464,23 +495,22 @@ export default {
}, },
countChange(){ countChange(){
let that = this; let that = this;
if(that.project_code=='bxerp'){ if(that.mTracking == 20&&that.form.count>1&&( that.form.type == 'pur_in'|| that.form.type == 'other_in')){
if(that.form.type == "pur_in"){ that.mioitems = [];that.mioitemw = [];
that.mioitems = [];that.mioitemw = []; for(let i=0;i<that.form.count;i++){
for(let i=0;i<that.form.count;i++){ let indexs = i+1;
let indexs = i+1; indexs = indexs<10?'0'+indexs:indexs;
indexs = indexs<10?'0'+indexs:indexs; that.mioitems[i] = that.form.batch+'-'+indexs;
that.mioitems[i] = that.form.batch+'-'+indexs; let obj = {};
let obj = {}; obj.number = that.mioitems[i];
obj.number = that.mioitems[i]; that.mioitemw.push(obj);
that.mioitemw.push(obj); }
} }else{
}else if(that.form.type == "do_out"){ //
for(let i=0;i<that.form.count;i++){ for(let i=0;i<that.form.count;i++){
let obj = {}; let obj = {};
obj.number = that.form.batch+'-'+(i+1); obj.number = that.form.batch+'-'+(i+1);
that.mioitemw.push(obj); that.mioitemw.push(obj);
}
} }
} }
}, },

View File

@ -24,13 +24,13 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item label="任务编号" prop="number"> <el-form-item label="任务编号" prop="number">
<el-input <el-input
v-model="form.number" v-model="form.number"
placeholder="任务编号" placeholder="任务编号"
:disabled="mode == 'edit'" :disabled="mode == 'edit'"
/> />
</el-form-item> --> </el-form-item>
<el-form-item :label="routeText" v-if="mode == 'add'"> <el-form-item :label="routeText" v-if="mode == 'add'">
<el-select <el-select
:placeholder="routeText" :placeholder="routeText"

View File

@ -3,9 +3,9 @@
<el-container v-loading="loading"> <el-container v-loading="loading">
<el-main style="padding: 0 20px 20px 20px"> <el-main style="padding: 0 20px 20px 20px">
<el-form ref="dialogForm" :model="form" :rules="rules" label-width="120px"> <el-form ref="dialogForm" :model="form" :rules="rules" label-width="120px">
<!-- <el-form-item label="任务编号" prop="number"> <el-form-item label="任务编号" prop="number">
<el-input v-model="form.number" placeholder="任务编号" :disabled="mode == 'edit'" /> <el-input v-model="form.number" placeholder="任务编号" :disabled="mode == 'edit'" />
</el-form-item> --> </el-form-item>
<el-form-item label="产物" prop="material" v-if="mode == 'add'"> <el-form-item label="产物" prop="material" v-if="mode == 'add'">
<el-select placeholder="产物" v-model="form.material" filterable style="width:100%"> <el-select placeholder="产物" v-model="form.material" filterable style="width:100%">
<el-option v-for="item in materialOptions" :key="item.id" :label="item.full_name" :value="item.id"> <el-option v-for="item in materialOptions" :key="item.id" :label="item.full_name" :value="item.id">