ccjgmwz 3 anos atrás
pai
commit
e026caae44
2 arquivos alterados com 34 adições e 4 exclusões
  1. 33 3
      src/views/warehouse/warehouseManagementEdit.vue
  2. 1 1
      vue.config.js

+ 33 - 3
src/views/warehouse/warehouseManagementEdit.vue

@@ -177,8 +177,9 @@
         <ws-upload
           v-if="warehouseType == 1"
           ref="upload"
-          table-name="maintain_work_order"
+          table-name="warehouseEdit"
           oss-key="mainPlan"
+          :file-list="fileList"
           :comp-id="compId"
           :appendix-ids="appendixIdsAdd"
           :vesselId="deptBudgetList.addressUrl"
@@ -207,6 +208,7 @@
   </div>
 </template>
 <script>
+import { getFileList, saveFiles } from '@/model/upload'
 import {
   xiala,
   billoperatehis,
@@ -238,6 +240,8 @@ export default {
   },
   data() {
     return {
+      
+      fileList: [],
       //弹出框
       dialogViewSpareMoney: false,
       dialogApproveFormVisible: false,
@@ -362,7 +366,8 @@ export default {
         e.center.lat + ',' + e.center.lng
     },
     uploadSuccess(data, files, url) {
-      console.log(data, files, url)
+      this.fileList = files
+      console.log('uploadSuccess ',data, files, url)
     },
     onChange(files) {
       this.fileNum = files
@@ -479,9 +484,21 @@ export default {
             ].code
           this.selectedOptions = tmp
           this.deptBudgetList = response
+          if(this.deptBudgetList.addressUrl){
+            this.fileList =  this._getFileList(this.deptBudgetList.addressUrl)
+          }
         })
     },
-
+    // 传入appendixIds 从服务器获取文件列表信息
+    _getFileList (appendixIds) {
+      return new Promise(async next => {
+        try {
+          next(await getFileList({ appendixIds }).toPromise() || [])
+        } catch (error) {
+          next()
+        }
+      })
+    },
     //提交
     submit() {
       if (!this.deptBudgetList.warehouseName) {
@@ -610,6 +627,19 @@ export default {
           return false
         }
       })
+      new Promise((resolve, reject) => {
+        const newAppendixs = this.fileList
+        const params = { newAppendixs}
+        saveFiles(params)
+          .toPromise()
+          .then(res => {
+            resolve(res.join())
+          })
+          .catch(err => {
+            EventBus.$emit('error', this.$t('showMessage.saveFilesError'))
+            reject()
+          })
+      })
     },
 
     // 关闭 dialog时 处理文件url 初始化upload组件

+ 1 - 1
vue.config.js

@@ -145,7 +145,7 @@ module.exports = {
         // target: 'http://standard-dev.winsea.com/', //目标地址
         // target: 'http://localhost:8090/',
         // target: 'http://192.168.1.121:8090/',
-        target: 'http://192.168.1.116:8090/',
+        target: 'http://192.168.1.122:9100/',
         // target: 'http://192.168.1.119:8090/',
         // target: 'http://192.168.24.5:8098',//目标地址
         // target: 'http://product-server.winsea.com/',