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