From 778354d2ae8cde6b13a70c7a962806e2d735a654 Mon Sep 17 00:00:00 2001
From: 唐耀东 <18861537@qq.com>
Date: 星期二, 22 二月 2022 12:23:20 +0800
Subject: [PATCH] 问题修改

---
 src/views/device/peripheralUnit/index.vue |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/views/device/peripheralUnit/index.vue b/src/views/device/peripheralUnit/index.vue
index d6a5142..b76058a 100644
--- a/src/views/device/peripheralUnit/index.vue
+++ b/src/views/device/peripheralUnit/index.vue
@@ -227,7 +227,7 @@
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button :loading="buttonLoading" type="primary" @click="submitForm">纭� 瀹�</el-button>
+        <el-button :loading="buttonLoading" type="primary" @click="submitForm" :disabled="disabled">纭� 瀹�</el-button>
         <el-button @click="cancel">鍙� 娑�</el-button>
       </div>
     </Dialog>
@@ -236,7 +236,7 @@
     <Dialog :title="title" :visible.sync="uploadFlag" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
         <el-form-item label="闄勪欢">
-          <fileUpload v-model="form.filePath" limit="1"/>
+          <fileUpload v-model="form.filePath" :limit="1"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -358,12 +358,12 @@
   },
   created() {
     this.getList();
-    this.getManufacturerList();
+
   },
   methods: {
     getManufacturerList() {
       listManufacturer().then(res => {
-        this.manufacturerList = res.data
+        this.manufacturerList = res.data;
       })
     },
     /** 鏌ヨ澶栬鍗曞厓鍒楄〃 */
@@ -373,6 +373,7 @@
         this.peripheralUnitList = response.rows;
         this.total = response.total;
         this.loading = false;
+        this.getManufacturerList();
       });
     },
     // 鍙栨秷鎸夐挳
@@ -440,7 +441,7 @@
         this.loading = false;
         this.form = response.data;
         this.open = true;
-        this.title = "淇敼澶栬鍗曞厓";
+        this.title = "鏌ョ湅澶栬鍗曞厓";
       });
     },
     /** 淇敼鎸夐挳鎿嶄綔 */
@@ -448,11 +449,12 @@
       this.loading = true;
       this.disabled = false
       this.reset();
-      this.getManufacturerList();
+      //this.getManufacturerList();
       const id = row.id || this.ids
       getPeripheralUnit(id).then(response => {
         this.loading = false;
         this.form = response.data;
+        this.form.manufacturer = parseInt(this.form.manufacturer);
         this.open = true;
         this.title = "淇敼澶栬鍗曞厓";
       });
@@ -461,6 +463,12 @@
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
+          // if(this.uploadFlag){
+          //   if(!this.form.filePath){
+          //     this.$modal.msgWarning("璇烽�夋嫨涓婁紶闄勪欢");
+          //     return;
+          //   }
+          // }
           this.buttonLoading = true;
           if (this.form.id != null) {
             updatePeripheralUnit(this.form).then(response => {

--
Gitblit v1.9.1