From def97c88edd3564e0fb358cf5cbabf0b58e58b33 Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期三, 02 十月 2024 12:39:52 +0800
Subject: [PATCH] 机器编号

---
 src/views/console/workstation/Dialog.vue |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/src/views/console/workstation/Dialog.vue b/src/views/console/workstation/Dialog.vue
index 9f415a7..1ac31eb 100644
--- a/src/views/console/workstation/Dialog.vue
+++ b/src/views/console/workstation/Dialog.vue
@@ -68,7 +68,8 @@
                             filterable>
                             <el-option v-for="item in options.listnoband" :key="item.id" :label="item.machineName"
                                 :value="item.id">
-                                {{ `${item?.machineCode}-${item?.machineName}-${item?.brand}` }}</el-option>
+                                {{ `${item?.machineCode}-${item?.machineName}${item?.brand ? '-' + item.brand : ''}`
+                                }}</el-option>
                         </el-select>
                         <el-input v-if="form.id" :disabled="form.id" v-model="form.machineName"></el-input>
                     </el-form-item>
@@ -92,7 +93,7 @@
                         </el-select>
                     </el-form-item>
                 </el-col>
-                <el-col :span="12">
+                <!-- <el-col :span="12">
                     <el-form-item label="绋嬪簭浼犺緭鏂瑰紡" prop="transmissionMethod">
                         <el-select v-model="form.transmissionMethod" style="width: 240px">
                             <el-option label="FTP" :value="1" />
@@ -107,7 +108,7 @@
                                 :value="item.value" />
                         </el-select>
                     </el-form-item>
-                </el-col>
+                </el-col> -->
                 <el-col :span="12" v-if="form.ftpDirectoryType == 1">
                     <el-form-item label="鍏宠仈鐩綍" prop="directoryId">
                         <el-select v-model="form.directoryId" style="width: 240px">
@@ -293,6 +294,7 @@
     methods: {
         //鏄剧ず
         open(mode = 'add', params) {
+            this.isSaveing = false;
             this.mode = mode;
             this.visible = true;
             console.log('---------', params)
@@ -308,6 +310,7 @@
                 })
             } else {
                 this.form.id = ''
+                this.form.workbenchVOList = []
                 Object.keys(this.form).forEach(key => {
                     this.form[key] = ''
                 })
@@ -316,10 +319,22 @@
         },
         //琛ㄥ崟鎻愪氦鏂规硶
         submit() {
+            if (!this.form.workbenchVOList) {
+                this.form.workbenchVOList = []
+            }
+            if (this.mode === 'add' && this.form.linkWay === 1) {
+                this.form.machineId
+                this.form.machineCode = this.form.code
+                this.form.machineName = this.form.name
+            }
             this.$refs.dialogForm.validate(async (valid) => {
                 if (valid) {
                     this.isSaveing = true;
-                    var res = await this.$API.workstation.add.post(this.form);
+                    try {
+                        var res = await this.$API.workstation.add.post(this.form);
+                    } catch (error) {
+                        this.isSaveing = false;
+                    }
                     this.isSaveing = false;
                     if (res.code == 200) {
                         this.$emit('success', this.form, this.mode)

--
Gitblit v1.9.3