zhangyu 3 år sedan
förälder
incheckning
ece01c4015

+ 1 - 1
config/index.js

@@ -10,7 +10,7 @@ module.exports = {
     // Paths
     assetsSubDirectory: 'static',
     assetsPublicPath: '/',
-    proxyTable: proxyTable["18"],
+    proxyTable: proxyTable["14"],
 
     // Various Dev Server settings
     host: '0.0.0.0', // can be overwritten by process.env.HOST

+ 89 - 6
src/components/dialogs/list/batchDialog.vue

@@ -121,6 +121,7 @@
 
       <el-button
         type="primary"
+        :loading="loading"
         @click="maintenanceSelect"
         style="margin-top:10px"
       >维护已选
@@ -135,7 +136,8 @@
 </template>
 
 <script>
-import myPagination from "@/components/ledger/lib/myPagination"
+import myPagination from "@/components/ledger/lib/myPagination";
+import { queryUpdate, updateEquip } from "@/api/scan/request";
 import tools from "@/utils/buildfloor/tools";
 
 export default {
@@ -146,6 +148,7 @@ export default {
     return {
       form: {},
       batchDialog: false,//dialog
+      loading: false, //批量维护加载状态
       active: 0,//进度条
       checkAll: false,//全选
       isIndeterminate: true,
@@ -404,9 +407,8 @@ export default {
           ...item,
           ...newValuable
         }))
-        this.$emit('upDataDevice', 1, arr1, arr2)
-      }
-      if (this.radio === 2) {
+        this.upDataDevice(1, arr1, arr2);
+      } else if (this.radio === 2) {
         let param = {}, singleList = {}
         this.newEnclosure.forEach(({ path, value }) => param[path] = value)
         singleList.infos = { ...equipManufactor, ...supplyPurchase, ...operationMainte, ...insuranceDoc }
@@ -418,9 +420,90 @@ export default {
           ...pa,
 
         }))
-        this.$emit('upDataDevice', 2, arr3)
+        this.upDataDevice(2, arr3);
+      } else {
+          this.closeDialog()
+      }
+    },
+    upDataDevice(type, data1, data2) {
+      this.loading = true;
+      let param = {content: data1};
+      let param1 = {content: data2};
+      if (type === 1) {
+        //增量
+        //LedgerParam
+        let filterParam = this.filterCheck(param, "sole");
+        let filterParam1 = this.filterCheck(param1, "multiple");
+        if (filterParam) {
+          updateEquip(param, res => {
+						if (res.result === "success") {
+							this.loading = false;
+							this.$emit('upDataDevice')
+						} else {
+							this.$message.error(res.message);
+						}
+						this.closeDialog();
+          });
+        }
+        if (filterParam1) {
+          param1.content.map(i => {
+            i.equipId = i.id
+            delete i.id
+            return i
+          })
+          setTimeout(() => {
+            queryUpdate(param1, res => {
+							if (res.result === "success") {
+								this.loading = false;
+								this.$emit('upDataDevice')
+							} else {
+								this.$message.error(res.message);
+							}
+							this.closeDialog();
+            });
+          });
+        }
+      } else if (type === 2) {
+        //覆盖
+        let filterParams = this.filterCheck(param, "sole");
+        if (filterParams) {
+          updateEquip(param, res => {
+						if (res.result === "success") {
+							this.loading = false;
+							this.$emit('upDataDevice')
+						} else {
+							this.$message.error(res.message);
+						}
+						this.closeDialog();
+          });
+        }
+      }
+    },
+    filterCheck(arr, type) {
+      if (type === "sole") {
+        for (let i of arr.content) {
+          for (let j in i.infos) {
+            if (Array.isArray(i.infos[j]) && i.infos[j].length < 1) {
+              delete i.infos[j]
+            }
+          }
+          return Object.keys(i.infos).length;
+        }
+      } else if (type === "multiple") {
+        let nArr = [];
+        arr.content.forEach(i => {
+          let {id, ...value} = i;
+          nArr.push({infos: value});
+        });
+        // nArr.map(i => {
+        //   if (Array.isArray(i) && i.length < 1) {
+        //     console.log(i)
+        //   }
+        // })
+        for (let j of nArr) {
+          return Object.keys(j.infos).length;
+        }
       }
-      this.closeDialog()
     },
     closeDialog() {  //关闭弹窗,返回初始状态
       this.batchDialog = false

+ 1 - 60
src/components/ledger/handsontables/device.vue

@@ -1369,70 +1369,11 @@ export default {
         params: query
       })
     },
-    upDataDevice(type, data1, data2) {
-
-      let param = {content: data1};
-      let param1 = {content: data2};
-      if (type === 1) {
-        //增量
-        //LedgerParam
-        let filterParam = this.filterCheck(param, "sole");
-        let filterParam1 = this.filterCheck(param1, "multiple");
-        if (filterParam) {
-          updateEquip(param, res => {
-          });
-        }
-        if (filterParam1) {
-          param1.content.map(i => {
-            i.equipId = i.id
-            delete i.id
-            return i
-          })
-          setTimeout(() => {
-            queryUpdate(param1, res => {
-            });
-          });
-        }
-      }
-      if (type === 2) {
-        //覆盖
-        let filterParams = this.filterCheck(param, "sole");
-        if (filterParams) {
-          updateEquip(param, res => {
-          });
-        }
-      }
-
+    upDataDevice() {
       setTimeout(() => {
         this.getTableData();
         this.getAllData();
       }, 1000);
-    },
-    filterCheck(arr, type) {
-      if (type === "sole") {
-        for (let i of arr.content) {
-          for (let j in i.infos) {
-            if (Array.isArray(i.infos[j]) && i.infos[j].length < 1) {
-              delete i.infos[j]
-            }
-          }
-          return Object.keys(i.infos).length;
-        }
-      } else if (type === "multiple") {
-        let nArr = [];
-        arr.content.forEach(i => {
-          let {id, ...value} = i;
-          nArr.push({infos: value});
-        });
-        // nArr.map(i => {
-        //   if (Array.isArray(i) && i.length < 1) {
-        //     console.log(i)
-        //   }
-        // })
-        for (let j of nArr) {
-          return Object.keys(j.infos).length;
-        }
-      }
     }
   },
   watch: {

+ 2 - 2
src/components/relation/overview/Modal/RelationMaintain.vue

@@ -347,9 +347,9 @@ export default {
       sourceQuery(param, res => {
         this.value = []
         this.setValue = []
-        res.content && res.content.forEach(({sourceType}) => this.value.push(sourceType))
+        res.content && res.content.forEach(({sourceType}) => sourceType && this.value.push(sourceType))
         //启动计算
-        res.content && res.content.forEach(({sourceType}) => this.setValue.push(sourceType))
+        res.content && res.content.forEach(({sourceType}) => sourceType && this.setValue.push(sourceType))
         // this.setOriginOption = this.oraginOption.forEach(i => this.setValue.includes(i.value))
         this.changeVal(this.value)
         this.setValue && this.handleSetValue()

+ 1 - 1
src/components/relation/overview/Modal/setCascader.vue

@@ -136,7 +136,7 @@ export default {
         })
       })
       Promise.all([promise1, promise2, promise3]).then((res) => {
-        let allData = res[0], data = res[1], arr = res[2].Content
+        let allData = res[0], data = res[1], arr = res[2].content
         this.options = this.formatOptions(allData.content)
         if (!this.all) {
           this.content = data.content.map(t => {

+ 1 - 1
src/framework/components/messagesever/index.vue

@@ -32,7 +32,7 @@
                     </p>
                   </div>
                   <div class="noticeItem_time">
-                    <span class="proname">{{ item.project[0].localName || '' }}</span>
+                    <span class="proname">{{ item.project && item.project.length && item.project[0].localName || '' }}</span>
                     {{ item.createTime }}
                     <template v-if="item.content.buttonList.length">
                       <el-link v-for="(btn, index) in item.content.buttonList"

+ 1 - 1
src/framework/layout/layout-store.js

@@ -26,7 +26,7 @@ export default {
     },
     projectId: '',
     group_code: '',
-    projects: project["18"],
+    projects: project["14"],
     breadcrumb: [],
     uploaderList: [], //当前上传文件列表
     secret: "saga123456", //项目密码