fix:无聊添加时无聊系列的获取

This commit is contained in:
shijing 2024-08-07 13:29:46 +08:00
parent edc93d7110
commit fd08cc9356
2 changed files with 26 additions and 9 deletions

View File

@ -147,6 +147,12 @@ export default {
); );
}, },
}, },
cates: {
name: "产品系列",
req: async function (data) {
return await http.get(`${config.API_URL}/mtm/material/cates/`, data);
},
},
}, },
// 工段 // 工段
mgroup: { mgroup: {

View File

@ -55,13 +55,17 @@
v-model="form.cate" v-model="form.cate"
placeholder="物料系列" placeholder="物料系列"
clearable clearable
allow-create
filterable
default-first-option
:reserve-keyword="false"
style="width: 100%" style="width: 100%"
> >
<el-option <el-option
v-for="item in cateOptions" v-for="item in cateOptions"
:key="item.id" :key="item"
:label="item.name" :label="item"
:value="item.id" :value="item"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -244,12 +248,12 @@ export default {
}, },
visible: false, visible: false,
isSaveing: false, isSaveing: false,
cateOptions: [ // cateOptions: [
{ id: "bang", name: "棒" }, // { id: "bang", name: "" },
{ id: "guan", name: "管" }, // { id: "guan", name: "" },
{ id: "bangguan", name: "棒管" }, // { id: "bangguan", name: "" },
{ id: "huiliao", name: "混料" }, // { id: "huiliao", name: "" },
], // ],
options: [ options: [
{ id: 0, name: "电/水/气" }, { id: 0, name: "电/水/气" },
{ id: 10, name: "成品" }, { id: 10, name: "成品" },
@ -270,8 +274,15 @@ export default {
}, },
mounted() { mounted() {
this.getProcessOptions(); this.getProcessOptions();
this.getMaterialCate();
}, },
methods: { methods: {
getMaterialCate() {
this.$API.mtm.material.cates.req({ page: 0 }).then((res) => {
this.cateOptions = res;
});
},
getProcessOptions() { getProcessOptions() {
this.$API.mtm.process.list.req({ page: 0 }).then((res) => { this.$API.mtm.process.list.req({ page: 0 }).then((res) => {
this.processOptions = res; this.processOptions = res;