Compare commits

..

No commits in common. "7ecafc649519d36f86d1f93d7e9648fc87598bdc" and "1d274099399bbfcf16a4a67369704be875106a05" have entirely different histories.

1 changed files with 72 additions and 37 deletions

View File

@ -49,42 +49,68 @@
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="输入物料" prop="material_in"> <el-form-item label="输入物料" prop="material_in">
<xtSelect <el-select
:apiObj="apiObjM"
v-model="form.material_in" v-model="form.material_in"
v-model:lable="form.material_in_name" placeholder="输入物料"
:labelField="'full_name'" clearable
style="width: 100%;" filterable
:params = "paramsMIn" :value-on-clear="null"
style="width: 100%"
@clear="clearHandle('material_in')"
> >
<el-table-column label="物料"> <el-option
<template #default="scope"> v-for="item in materialsIn"
{{ scope.row.full_name }} :key="item.id"
<span v-if="scope.row.is_hidden" style="float: right;color:'#E6A23C';font-size:13px;"></span> :label="item.full_name"
</template> :value="item.id"
</el-table-column> >
</xtSelect> <span style="float: left">{{
item.full_name
}}</span>
<span
style="
float: right;
color: '#E6A23C';
font-size: 13px;
"
v-if="item.is_hidden"
></span
>
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="输出物料" prop="material_out"> <el-form-item label="输出物料" prop="material_out">
<xtSelect <el-select
:apiObj="apiObjM"
v-model="form.material_out" v-model="form.material_out"
v-model:lable="form.material_out_name" placeholder="输出物料"
:labelField="'full_name'" clearable
style="width: 100%;" filterable
:params = "paramsMOut" :value-on-clear="null"
style="width: 100%"
@clear="clearHandle('material_out')"
> >
<el-table-column label="物料"> <el-option
<template #default="scope"> v-for="item in materialsOut"
{{ scope.row.full_name }} :key="item.id"
<span v-if="scope.row.is_hidden" style="float: right;color:'#E6A23C';font-size:13px;"></span> :label="item.full_name"
</template> :value="item.id"
</el-table-column> >
</xtSelect> </el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :md="12" :sm="24">
<el-form-item label="统计工序">
<el-switch v-model="form.is_count_utask" />
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="自动排产" prop="is_autotask">
<el-switch v-model="form.is_autotask" />
</el-form-item>
</el-col> -->
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="切分数量"> <el-form-item label="切分数量">
<el-input-number <el-input-number
@ -286,9 +312,7 @@ const defaultForm = {
sort: 1, sort: 1,
out_rate: 100, out_rate: 100,
material_in:'', material_in:'',
material_in_name:'',
material_out:'', material_out:'',
material_out_name:'',
hour_work:0, hour_work:0,
div_number:1, div_number:1,
batch_bind: false, batch_bind: false,
@ -345,18 +369,15 @@ export default {
material:'', material:'',
route:'', route:'',
}, }
apiObjM: this.$API.mtm.material.list,
paramsMIn: { type__in: '10,20,30',ordering: '-create_time',query:'{full_name,id,is_hidden}'},
paramsMOut: { type__in: '10,20',ordering: '-create_time',query:'{full_name,id,is_hidden}'},
}; };
}, },
mounted() { mounted() {
this.getMgroup(); this.getMgroup();
this.getProcess(); this.getProcess();
if(this.project_code=='bxerp'&&this.mode=='edit'){ this.getMaterialIn();
this.getMaterialOut();
this.getMaterialOptions(); this.getMaterialOptions();
}
this.project_code = this.$TOOL.data.get("BASE_INFO").base.base_code; this.project_code = this.$TOOL.data.get("BASE_INFO").base.base_code;
this.form.routepack = this.routepack; this.form.routepack = this.routepack;
if(this.project_code=='bxerp'||this.project_code=='tcerp'){ if(this.project_code=='bxerp'||this.project_code=='tcerp'){
@ -379,6 +400,22 @@ export default {
that.materialOptions = res; that.materialOptions = res;
}); });
}, },
getMaterialIn() {
let that = this;
that.$API.mtm.material.list
.req({ page: 0, type__in: "10,20,30",ordering: "-create_time"})
.then((res) => {
that.materialsIn = res;
});
},
getMaterialOut() {
let that = this;
that.$API.mtm.material.list
.req({ page: 0, type__in: "10,20" })
.then((res) => {
that.materialsOut = res;
});
},
getProcess() { getProcess() {
let that = this; let that = this;
that.$API.mtm.process.list.req({ page: 0 }).then((res) => { that.$API.mtm.process.list.req({ page: 0 }).then((res) => {
@ -440,8 +477,6 @@ export default {
setData(data) { setData(data) {
let that = this; let that = this;
Object.assign(that.form, data); Object.assign(that.form, data);
console.log('that.form',that.form);
console.log('that.form.material_in_name',that.form.material_in_name);
that.routeId = data.id; that.routeId = data.id;
that.addTemplate.route = data.id; that.addTemplate.route = data.id;
that.params_json=that.form.params_json; that.params_json=that.form.params_json;