fix:快速创建日志时展示操作项

This commit is contained in:
shijing 2025-08-22 11:18:30 +08:00
parent 97daddeef6
commit a637ab19bf
1 changed files with 75 additions and 0 deletions

View File

@ -80,6 +80,61 @@
</el-select> </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-form-item :label="item.name">
<el-input-number
v-if="item.field_type=='input-number'"
v-model="item.value"
:min="0"
class="width-100"
controls-position="right"
>
</el-input-number>
<el-input-number
v-if="item.field_type=='input-int'"
v-model="item.value"
:min="0"
class="width-100"
controls-position="right"
>
</el-input-number>
<el-input
v-if="item.field_type=='input-text'"
v-model="item.value"
class="width-100"
>
</el-input>
<el-select
v-if="item.field_type=='select-text'"
v-model="item.value"
clearable
class="width-100"
>
<el-option
v-for="item0 in item.choices"
:key="item0"
:label="item0"
:value="item0"
>
</el-option>
</el-select>
<el-select
v-if="item.field_type=='selects-text'"
v-model="item.value"
clearable
multiple
class="width-100"
>
<el-option
v-for="item1 in item.choices"
:key="item1"
:label="item1"
:value="item1"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24"> <el-col :md="12" :sm="12" :xs="24">
<el-form-item label="工艺路线:"> <el-form-item label="工艺路线:">
<el-select <el-select
@ -175,6 +230,7 @@ export default {
isSaveing: false, isSaveing: false,
batchCountCando:0, batchCountCando:0,
materialTracking:10, materialTracking:10,
testitems:[],
options: [], options: [],
bwItemForms: [], bwItemForms: [],
routeOptions: [], routeOptions: [],
@ -190,6 +246,7 @@ export default {
this.getMaterial(); this.getMaterial();
this.getRoute(); this.getRoute();
this.getEquipment(); this.getEquipment();
this.gettestitem();
}, },
methods: { methods: {
// //
@ -211,6 +268,17 @@ export default {
}); });
}); });
}, },
gettestitem(){
let that = this;
that.$API.qm.testitem.list.req({ process: that.process,type:20 }).then((res) => {
res.results.forEach((item) => {
let obj = {};
Object.assign(obj, item);
obj.value = '';
that.testitems.push(obj);
})
});
},
// //
open(mode = "add") { open(mode = "add") {
let that = this; let that = this;
@ -362,6 +430,13 @@ export default {
if (valid) { if (valid) {
that.isSaveing = true; that.isSaveing = true;
that.form.mgroup = that.mgroup; that.form.mgroup = that.mgroup;
if(that.testitems.length>0){
let oinfo_json = {};
that.testitems.forEach((item) => {
oinfo_json[item.id] = item.value;
})
that.form.oinfo_json = oinfo_json;
}
that.$API.wpm.mlog.quick.req(that.form).then((res) => { that.$API.wpm.mlog.quick.req(that.form).then((res) => {
if(that.bwItemForms.length>0&&that.batchCountCando!==that.bwItemForms.length){ if(that.bwItemForms.length>0&&that.batchCountCando!==that.bwItemForms.length){
that.bwItemForms.forEach(item=>{ that.bwItemForms.forEach(item=>{