feat(wpm): use recommended equipment selector

This commit is contained in:
caoqianming 2026-08-07 16:24:46 +08:00
parent 722789502e
commit b7580a0fd6
6 changed files with 60 additions and 131 deletions

View File

@ -177,6 +177,15 @@ export default {
} }
}, },
mlog: { mlog: {
equipmentOptions: {
name: "日志设备选项",
req: async function (data) {
return await http.get(
`${config.API_URL}/wpm/mlog/equipment_options/`,
data
);
},
},
list: { list: {
name: "列表", name: "列表",
req: async function (data) { req: async function (data) {

View File

@ -127,20 +127,19 @@
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="生产设备"> <el-form-item label="生产设备">
<el-select <xtSelect
v-model="form.equipments" v-model="form.equipments"
style="width: 100%" :apiObj="$API.wpm.mlog.equipmentOptions"
filterable :params="{ mgroup }"
labelField="full_name"
multiple multiple
clearable style="width: 100%"
> >
<el-option <el-table-column label="来源" prop="option_group" width="110" />
v-for="item in equipmentOptions" <el-table-column label="设备名称" prop="name" min-width="160" />
:key="item.id" <el-table-column label="设备编号" prop="number" min-width="140" />
:label="item.full_name" <el-table-column label="规格型号" prop="model" min-width="140" />
:value="item.id" </xtSelect>
/>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :md="12" :sm="24"> <!-- <el-col :md="12" :sm="24">
@ -593,7 +592,6 @@ export default {
count_cando:0, count_cando:0,
mlogb: [], mlogb: [],
userList: [], userList: [],
equipmentOptions: [],
wmaterialOptions: [], wmaterialOptions: [],
shiftOptions: [], shiftOptions: [],
routeOptions: [], routeOptions: [],
@ -614,7 +612,6 @@ export default {
}, },
mounted() { mounted() {
this.getUserList(); this.getUserList();
this.getEquipment();
this.getShiftOptions(); this.getShiftOptions();
this.form.material_out = this.material_out; this.form.material_out = this.material_out;
this.form.handle_date = this.handle_date; this.form.handle_date = this.handle_date;
@ -700,14 +697,6 @@ export default {
}); });
}, },
//
getEquipment() {
this.$API.em.equipment.list
.req({ page: 0, type: 10 })
.then((res) => {
this.equipmentOptions = res;
});
},
// //
open(mode = "add") { open(mode = "add") {
this.mode = mode; this.mode = mode;

View File

@ -65,23 +65,19 @@
</el-col> </el-col>
<el-col :md="12" :sm="12" :xs="24" v-if="base_code=='tcerp'||route_code=='ladansi'||route_code=='yicifusi'||route_code=='ercifusi'||route_code=='zlybcl'||route_code=='djg'||route_code=='cnc'"> <el-col :md="12" :sm="12" :xs="24" v-if="base_code=='tcerp'||route_code=='ladansi'||route_code=='yicifusi'||route_code=='ercifusi'||route_code=='zlybcl'||route_code=='djg'||route_code=='cnc'">
<el-form-item label="生产设备" :prop="base_code!=='tcerp' ? 'equipment' : null"> <el-form-item label="生产设备" :prop="base_code!=='tcerp' ? 'equipment' : null">
<el-select <xtSelect
v-model="form.equipment" v-model="form.equipment"
placeholder="生产设备" v-model:label="form.equipment_name"
clearable :apiObj="$API.wpm.mlog.equipmentOptions"
filterable :params="{ mgroup }"
labelField="full_name"
style="width: 100%" style="width: 100%"
> >
<el-option <el-table-column label="来源" prop="option_group" width="110" />
v-for="item in options" <el-table-column label="设备名称" prop="name" min-width="160" />
:key="item.id" <el-table-column label="设备编号" prop="number" min-width="140" />
:label="item.label" <el-table-column label="规格型号" prop="model" min-width="140" />
:value="item.id" </xtSelect>
>
<span style="float:left">{{item.name}}</span>
<span style="float:right">{{item.number}}</span>
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="12" :xs="24" v-for="item in testitems" :key="item.id"> <el-col :md="12" :sm="12" :xs="24" v-for="item in testitems" :key="item.id">
@ -312,7 +308,6 @@ export default {
route_code:"", route_code:"",
visible: false, visible: false,
isSaveing: false, isSaveing: false,
options: [],
testitems:[], testitems:[],
routeOptions: [], routeOptions: [],
mtaskOptions:[], mtaskOptions:[],
@ -331,7 +326,6 @@ export default {
}) })
} }
this.getRoute(); this.getRoute();
this.getEquipment();
this.getMtask(); this.getMtask();
this.gettestitem(); this.gettestitem();
if(this.route_code=='ladansi'||this.route_code=='yicifusi'||this.route_code=='ercifusi'||this.route_code=='zlybcl'){ if(this.route_code=='ladansi'||this.route_code=='yicifusi'||this.route_code=='ercifusi'||this.route_code=='zlybcl'){
@ -355,17 +349,6 @@ export default {
}); });
}, },
// //
getEquipment() {
let that = this;
this.$API.em.equipment.list.req({ page: 0, type: 10,belong_dept:that.dept}).then((res) => {
res.forEach((item) => {
let obj = {};
Object.assign(obj, item);
obj.label = item.name+'-'+item.number;
that.options.push(obj);
});
});
},
// //
getMtask() { getMtask() {
let that = this; let that = this;

View File

@ -89,23 +89,19 @@
</el-col> </el-col>
<el-col :md="12" :sm="12" :xs="24" v-if="base_code=='tcerp'||route_code=='ladansi'||route_code=='yicifusi'||route_code=='ercifusi'||route_code=='zlybcl'||route_code=='djg'||route_code=='cnc'"> <el-col :md="12" :sm="12" :xs="24" v-if="base_code=='tcerp'||route_code=='ladansi'||route_code=='yicifusi'||route_code=='ercifusi'||route_code=='zlybcl'||route_code=='djg'||route_code=='cnc'">
<el-form-item label="生产设备" :prop="base_code!=='tcerp' ? 'equipment' : null"> <el-form-item label="生产设备" :prop="base_code!=='tcerp' ? 'equipment' : null">
<el-select <xtSelect
v-model="form.equipment" v-model="form.equipment"
placeholder="生产设备" v-model:label="form.equipment_name"
clearable :apiObj="$API.wpm.mlog.equipmentOptions"
filterable :params="{ mgroup }"
labelField="full_name"
style="width: 100%" style="width: 100%"
> >
<el-option <el-table-column label="来源" prop="option_group" width="110" />
v-for="item in options" <el-table-column label="设备名称" prop="name" min-width="160" />
:key="item.id" <el-table-column label="设备编号" prop="number" min-width="140" />
:label="item.label" <el-table-column label="规格型号" prop="model" min-width="140" />
:value="item.id" </xtSelect>
>
<span style="float:left">{{item.name}}</span>
<span style="float:right">{{item.number}}</span>
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="12" :xs="24" v-for="item in testitems" :key="item.id"> <el-col :md="12" :sm="12" :xs="24" v-for="item in testitems" :key="item.id">
@ -307,7 +303,6 @@ export default {
materialTracking:10, materialTracking:10,
fileList:[], fileList:[],
testitems:[], testitems:[],
options: [],
mtaskOptions:[], mtaskOptions:[],
bwItemForms: [], bwItemForms: [],
routeOptions: [], routeOptions: [],
@ -327,7 +322,6 @@ export default {
this.form.mgroup = this.mgroup; this.form.mgroup = this.mgroup;
this.getMaterial(); this.getMaterial();
this.getRoute(); this.getRoute();
this.getEquipment();
this.gettestitem(); this.gettestitem();
this.getMtask(); this.getMtask();
if(that.route_code=='tuomoceliang'){ if(that.route_code=='tuomoceliang'){
@ -365,17 +359,6 @@ export default {
}); });
}, },
// //
getEquipment() {
let that = this;
this.$API.em.equipment.list.req({ page: 0, type: 10,belong_dept:that.dept}).then((res) => {
res.forEach((item) => {
let obj = {};
Object.assign(obj, item);
obj.label = item.name+'-'+item.number;
that.options.push(obj);
});
});
},
getSupplier() { getSupplier() {
let that = this; let that = this;
let obj = {}; let obj = {};

View File

@ -79,23 +79,19 @@
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="生产设备"> <el-form-item label="生产设备">
<el-select <xtSelect
v-model="form.equipment" v-model="form.equipment"
placeholder="生产设备" v-model:label="form.equipment_name"
clearable :apiObj="$API.wpm.mlog.equipmentOptions"
filterable :params="{ mgroup }"
labelField="full_name"
class="width100" class="width100"
> >
<el-option <el-table-column label="来源" prop="option_group" width="110" />
v-for="item in options" <el-table-column label="设备名称" prop="name" min-width="160" />
:key="item.id" <el-table-column label="设备编号" prop="number" min-width="140" />
:label="item.label" <el-table-column label="规格型号" prop="model" min-width="140" />
:value="item.id" </xtSelect>
>
<span style="float:left">{{item.name}}</span>
<span style="float:right">{{item.number}}</span>
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 操作员多选 --> <!-- 操作员多选 -->
@ -427,7 +423,6 @@ export default {
userList:[], userList:[],
visible: false, visible: false,
isSaveing: false, isSaveing: false,
options: [],
testitems:[], testitems:[],
mlogdefect:[], mlogdefect:[],
qct_defects:[], qct_defects:[],
@ -506,7 +501,6 @@ export default {
that.deptId = res.belong_dept; that.deptId = res.belong_dept;
that.mgroupName = res.name; that.mgroupName = res.name;
this.getTeam(); this.getTeam();
that.getEquipment();
that.getUserList(); that.getUserList();
}); });
}, },
@ -564,18 +558,6 @@ export default {
} }
} }
}, },
getEquipment() {
let that = this;
that.options = [];
that.$API.em.equipment.list.req({ page: 0, type: 10,mgroup:that.mgroup }).then((res) => {
res.forEach((item) => {
let obj = {};
Object.assign(obj, item);
obj.label = item.name+'-'+item.number;
that.options.push(obj);
});
});
},
getRoute() { getRoute() {
let that = this; let that = this;
if(!that.is_fix){// if(!that.is_fix){//

View File

@ -157,24 +157,20 @@
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="生产设备"> <el-form-item label="生产设备">
<el-select <xtSelect
v-model="form.equipment" v-model="form.equipment"
placeholder="生产设备" v-model:label="form.equipment_name"
clearable :apiObj="$API.wpm.mlog.equipmentOptions"
filterable :params="{ mgroup }"
:disabled="mode == 'edit'" :edit="mode != 'edit'"
labelField="full_name"
style="width: 100%" style="width: 100%"
> >
<el-option <el-table-column label="来源" prop="option_group" width="110" />
v-for="item in options" <el-table-column label="设备名称" prop="name" min-width="160" />
:key="item.id" <el-table-column label="设备编号" prop="number" min-width="140" />
:label="item.label" <el-table-column label="规格型号" prop="model" min-width="140" />
:value="item.id" </xtSelect>
>
<span style="float:left">{{item.name}}</span>
<span style="float:right">{{item.number}}</span>
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 黑化 --> <!-- 黑化 -->
@ -375,7 +371,6 @@ export default {
is_fix:false, is_fix:false,
visible: false, visible: false,
isSaveing: false, isSaveing: false,
options: [],
teamOptions:[], teamOptions:[],
routeOptions: [], routeOptions: [],
userOptions: [], userOptions: [],
@ -390,7 +385,6 @@ export default {
this.getRoute(); this.getRoute();
this.getTeam(); this.getTeam();
this.getSupplier(); this.getSupplier();
this.getEquipment();
this.gettestitem(); this.gettestitem();
let date = new Date(); let date = new Date();
this.form.work_start_time = this.form.work_end_time = this.$TOOL.dateFormat(date); this.form.work_start_time = this.form.work_end_time = this.$TOOL.dateFormat(date);
@ -447,17 +441,6 @@ export default {
} }
}); });
}, },
getEquipment() {
let that = this;
this.$API.em.equipment.list.req({ page: 0, type: 10,mgroup:that.mgroup}).then((res) => {
res.forEach((item) => {
let obj = {};
Object.assign(obj, item);
obj.label = item.name+'-'+item.number;
that.options.push(obj);
});
});
},
getSupplier() { getSupplier() {
let that = this; let that = this;
let obj = {}; let obj = {};