fix:光芯日志mlog扫描设备二维码弹出新增表单

This commit is contained in:
shijing 2025-03-17 09:51:42 +08:00
parent 14e39014e0
commit 2d016d166d
2 changed files with 24 additions and 5 deletions

View File

@ -197,9 +197,7 @@
</el-form> </el-form>
</el-main> </el-main>
<el-footer> <el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit" <el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
>保存</el-button
>
<el-button @click="visible = false">取消</el-button> <el-button @click="visible = false">取消</el-button>
</el-footer> </el-footer>
</el-container> </el-container>
@ -217,6 +215,7 @@ const defaultForm = {
work_end_time:null, work_end_time:null,
note:'', note:'',
mgroup:'', mgroup:'',
handle_user_name:"",
reminder_interval_list: [0,0], reminder_interval_list: [0,0],
}; };
@ -294,6 +293,7 @@ export default {
{ id: 10, name: "自产" }, { id: 10, name: "自产" },
{ id: 20, name: "外协" }, { id: 20, name: "外协" },
], ],
codeText:"",
visible: false, visible: false,
isSaveing: false, isSaveing: false,
options: [], options: [],
@ -305,7 +305,7 @@ export default {
}, },
mounted() { mounted() {
this.getRoute(); this.getRoute();
this.getUser(); // this.getUser();
this.getSupplier(); this.getSupplier();
this.getEquipment(); this.getEquipment();
@ -336,6 +336,9 @@ export default {
let that = this; let that = this;
this.$API.em.equipment.list.req({ page: 0, type: 10,mgroup:that.mgroup}).then((res) => { this.$API.em.equipment.list.req({ page: 0, type: 10,mgroup:that.mgroup}).then((res) => {
res.forEach((item) => { res.forEach((item) => {
if(that.codeText = item.number){
this.form.equipment = item.id;
}
let obj = {}; let obj = {};
Object.assign(obj, item); Object.assign(obj, item);
obj.label = item.name+'-'+item.number; obj.label = item.name+'-'+item.number;
@ -361,8 +364,9 @@ export default {
}); });
}, },
// //
open(mode = "add") { open(mode = "add",text) {
this.mode = mode; this.mode = mode;
this.codeText = text;
this.visible = true; this.visible = true;
return this; return this;
}, },

View File

@ -9,6 +9,14 @@
v-auth="'mlog.create'" v-auth="'mlog.create'"
>新增</el-button >新增</el-button
> >
<el-input
ref="codeInput"
v-model="codeText"
clearable
placeholder="设备编号"
style="width:150px"
@keyup.enter="codeTextChange"
></el-input>
</div> </div>
<div class="right-panel"> <div class="right-panel">
<el-input <el-input
@ -206,6 +214,7 @@ export default {
selection: [], selection: [],
mtask: "", mtask: "",
mlogId: "", mlogId: "",
codeText: "",
}; };
}, },
mounted() { mounted() {
@ -346,6 +355,12 @@ export default {
} }
}, },
codeTextChange(text){
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add",text);
});
},
// //
selectionChange(selection) { selectionChange(selection) {
this.selection = selection; this.selection = selection;