Browse Source

更新合同附件

ccj 3 years ago
parent
commit
8c0dc92972

+ 10 - 25
src/views/contractManagement/futuresPurchaseContract.vue

@@ -239,30 +239,14 @@
       :title="$t('system.noticeCircular.information')"
       @on-cancel="handleClose"
     >
-      <el-upload
-        class="upload-demo"
-        action="https://www.zthymaoyi.com/upload/admin"
-        :on-success="
-          (res, file) => {
-            uploadSuccessHandle(res)
-          }
-        "
-        multiple
-        :limit="3"
-        :file-list="fileList"
-      >
-        <el-button size="small" type="primary">附件附件</el-button>
-        <div slot="tip" class="el-upload__tip">
-          推荐格式.jpg, .jpeg, .png, .gif, .pdf, .doc, .zip,
-          .rar,单个文件大小不超过10M
-        </div>
-      </el-upload>
-      <p>查看附件</p>
-      <div style="display: flex;">
-      <div style="display: flex; margin: 5px" v-for="item in this.appendixIdss">
-          <img width="100" height="100" :src="item" alt=""/>
-      </div>
-      </div>
+    <ws-upload
+        ref="upload"
+        :comp-id="compId"
+        :appendix-ids="appendixIdss"
+        :editable="false"
+        accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
+      />
+      
     </WinseaContentModal>
   </div>
 </template>
@@ -532,7 +516,8 @@ export default {
           this.$t('system.noticeCircular.NoInformation')
         )
       }
-      this.appendixIdss = row.addressUrl.split(',')
+      this.appendixIdss = row.addressUrl
+      this.accessoryTFs = true
     },
     handleExamine(row) {
       console.log(row)

+ 19 - 37
src/views/contractManagement/futuresPurchaseContractAdd.vue

@@ -572,24 +572,14 @@
         placeholder="请输入备注信息,不超过200字"
         maxlength="200"
       />
-      
-      <el-upload
-        class="upload-demo"
-        action="https://www.zthymaoyi.com/upload/admin"
-         :on-success="
-            (res, file) => {
-              uploadSuccessHandle(res)
-            }
-          "
-        multiple
-        :limit="3"
-        :file-list="fileList"
-      >
-        <el-button size="small" type="primary">点击上传</el-button>
-        <div slot="tip" class="el-upload__tip">
-          推荐格式.jpg, .jpeg, .png, .gif, .pdf, .doc, .zip, .rar,单个文件大小不超过10M
-        </div>
-      </el-upload>
+      <ws-upload
+        ref="upload"
+        :comp-id="compId"
+        :appendix-ids="deptBudgetList.addressUrl"
+        :size-limit="size"
+        @onChange="onChange"
+        accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
+      />
     </ws-form>
     <div style="text-align: right; padding: 10px" class="center">
       <el-button
@@ -663,8 +653,6 @@ export default {
       staffList: [],
       appendixIdsAdd: '',
       size: 10,
-      // uploadSuccess: {},
-      // onChange:{},
       unitList: [],
       goodnameList: [],
       value1: '袋装',
@@ -701,8 +689,6 @@ export default {
       },
       selectIntendedShip: {},
       interviewTypeList: {},
-      addressUrls: [],
-      fileList:[],
     }
   },
   activated() {
@@ -727,9 +713,6 @@ export default {
     this.showType = this.isShow
   },
   methods: {
-    close(index) {
-      this.addressUrls.splice(index, 1)
-    },
     dataFilter(val) {
       this.deptBudgetList.personCharge = val
       if (val) {
@@ -827,17 +810,16 @@ export default {
           this.ChapterTwoList = response
         })
     },
-    // 上传附件
-    uploadSuccessHandle(e) {
-      console.log(e)
-      this.addressUrls.push(e.url)
-      // this.deptBudgetList.addressUrl = this.addressUrls.toString
-    },
-    onChange(files) {
-      this.fileNum = files
-      this.$refs.upload.handleSaveBill().then((res) => {
-        console.log(files)
-      })
+    onChange() {
+      this.$refs.upload
+        .handleSaveBill()
+        .then(async response => {
+          this.deptBudgetList.addressUrl = response
+        })
+        .catch(res => {
+          EventBus.$emit('error', (JSON.parse(res) || {}).message)
+          this.$refs.upload.clearFiles()
+        })
     },
     getUnitList() {
       xiala({
@@ -1497,7 +1479,7 @@ export default {
           }else{ 
                  this.deptBudgetList.deliveryArea =  CodeToText[this.selectedOptions[2]]
           }
-          this.deptBudgetList.addressUrl = this.addressUrls.toString()
+          
 
           addList(this.deptBudgetList)
             .toPromise()

+ 4 - 15
src/views/contractManagement/futuresPurchaseContractEdit.vue

@@ -680,9 +680,7 @@ export default {
       },
       acceptanceCheck: {},
       compId: sessionStorage.getItem('ws-pf_compId'),
-      addressUrls: [],
-      addressUrl: '',
-      fileList: [],
+
     }
   },
 
@@ -697,9 +695,7 @@ export default {
     this.showType = this.isShow
   },
   methods: {
-    close(index) {
-      this.addressUrls.splice(index, 1)
-    },
+
     dataFilter(val) {
       this.deptBudgetList.personCharge = val
       if (val) {
@@ -771,10 +767,7 @@ export default {
           tmp1[1] =
             TextToCode[response.contractGoodsInfo.outputPrivate][response.contractGoodsInfo.outputCity].code
           this.selectedOptions1 = tmp1
-          if (this.deptBudgetList.addressUrl != null) {
-            this.addressUrls = this.deptBudgetList.addressUrl.split(',')
-            this.fileList = this.deptBudgetList.addressUrl.split(',')
-          }
+
         })
 
       // 包装方式
@@ -835,9 +828,6 @@ export default {
       })
     },
     // 上传附件
-    uploadSuccessHandle(e) {
-    },
-    // 上传附件
     onChange () {
       this.$refs.upload
         .handleSaveBill()
@@ -1192,7 +1182,7 @@ export default {
         })
         return
       }
-      if (!String(this.deptBudgetList.basisPrice) ) {
+      if (this.deptBudgetList.basisPrice!= 0 && !String(this.deptBudgetList.basisPrice) ) {
         this.$message({
           message: '请输入基差!',
           type: 'warning',
@@ -1645,7 +1635,6 @@ export default {
               CodeToText[this.selectedOptions[2]]
 
           }
-          this.deptBudgetList.addressUrl = this.addressUrls.toString()
 
           editInfo(this.deptBudgetList)
             .toPromise()

+ 13 - 3
src/views/contractManagement/futuresPurchaseContractExamine.vue

@@ -232,7 +232,13 @@
       <div style=" color: #afb5cb;margin-left: 20px;">
       {{ deptBudgetList.remarks }}
       </div>
-      <!-- <img :src="deptBudgetList.addressUrl" alt="" /> -->
+      <ws-upload
+        ref="upload"
+        :comp-id="compId"
+        :appendix-ids="deptBudgetList.addressUrl"
+        :editable="false"
+        accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
+      />
     </ws-form>
     <div style="text-align: right; padding: 10px">
       <el-button
@@ -252,6 +258,8 @@ import {
   examineList,
   billoperatehis,
 } from '@/model/contarct/index'
+
+import WsUpload from '@/components/WsUpload'
 export default {
   name: 'viewSpareMoney',
   watch: {
@@ -262,6 +270,9 @@ export default {
       this.showType = val
     },
   },
+  components: {
+    WsUpload,
+  },
   data() {
     return {
       //弹出框
@@ -288,8 +299,7 @@ export default {
       mainReportAdd: {},
       list: {},
       id : '',
-      // contractNo:this.deptBudgetList.contractNo,
-      // contractType : this.deptBudgetList.contractType
+      compId: sessionStorage.getItem('ws-pf_compId'),
 
     }
   },

+ 8 - 25
src/views/contractManagement/futuresSalesContract.vue

@@ -240,30 +240,13 @@
       :title="$t('system.noticeCircular.information')"
       @on-cancel="handleClose"
     >
-      <el-upload
-        class="upload-demo"
-        action="https://www.zthymaoyi.com/upload/admin"
-        :on-success="
-          (res, file) => {
-            uploadSuccessHandle(res)
-          }
-        "
-        multiple
-        :limit="3"
-        :file-list="fileList"
-      >
-        <el-button size="small" type="primary">附件附件</el-button>
-        <div slot="tip" class="el-upload__tip">
-          推荐格式.jpg, .jpeg, .png, .gif, .pdf, .doc, .zip,
-          .rar,单个文件大小不超过10M
-        </div>
-      </el-upload>
-      <p>查看附件</p>
-      <div style="display: flex;">
-      <div style="display: flex; margin: 5px" v-for="item in this.appendixIdss">
-          <img width="100" height="100" :src="item" alt=""/>
-      </div>
-      </div>
+     <ws-upload
+        ref="upload"
+        :comp-id="compId"
+        :appendix-ids="appendixIdss"
+        :editable="false"
+        accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
+      />
     </WinseaContentModal>
   </div>
 </template>
@@ -536,7 +519,7 @@ export default {
       } else {
         this.accessoryTFs = true
       }
-      this.appendixIdss = row.addressUrl.split(',')
+      this.appendixIdss = row.addressUrl
     },
     handleExamine(row) {
       console.log(row)

+ 17 - 35
src/views/contractManagement/futuresSalesContractAdd.vue

@@ -573,23 +573,14 @@
         maxlength="200"
       />
       
-      <el-upload
-        class="upload-demo"
-        action="https://www.zthymaoyi.com/upload/admin"
-         :on-success="
-            (res, file) => {
-              uploadSuccessHandle(res)
-            }
-          "
-        multiple
-        :limit="3"
-        :file-list="fileList"
-      >
-        <el-button size="small" type="primary">点击上传</el-button>
-        <div slot="tip" class="el-upload__tip">
-          推荐格式.jpg, .jpeg, .png, .gif, .pdf, .doc, .zip, .rar,单个文件大小不超过10M
-        </div>
-      </el-upload>
+       <ws-upload
+        ref="upload"
+        :comp-id="compId"
+        :appendix-ids="deptBudgetList.addressUrl"
+        :size-limit="size"
+        @onChange="onChange"
+        accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
+      />
     </ws-form>
     <div style="text-align: right; padding: 10px" class="center">
       <el-button
@@ -663,8 +654,6 @@ export default {
       staffList: [],
       appendixIdsAdd: '',
       size: 10,
-      // uploadSuccess: {},
-      // onChange:{},
       unitList: [],
       goodnameList: [],
       value1: '袋装',
@@ -701,8 +690,6 @@ export default {
       },
       selectIntendedShip: {},
       interviewTypeList: {},
-      addressUrls: [],
-      fileList:[],
     }
   },
   activated() {
@@ -727,9 +714,6 @@ export default {
     this.showType = this.isShow
   },
   methods: {
-    close(index) {
-      this.addressUrls.splice(index, 1)
-    },
     dataFilter(val) {
       this.deptBudgetList.personCharge = val
       if (val) {
@@ -827,17 +811,16 @@ export default {
           this.ChapterTwoList = response
         })
     },
-    // 上传附件
-    uploadSuccessHandle(e) {
-      console.log(e)
-      this.addressUrls.push(e.url)
-      // this.deptBudgetList.addressUrl = this.addressUrls.toString
-    },
     onChange(files) {
-      this.fileNum = files
-      this.$refs.upload.handleSaveBill().then((res) => {
-        console.log(files)
-      })
+       this.$refs.upload
+        .handleSaveBill()
+        .then(async response => {
+          this.deptBudgetList.addressUrl = response
+        })
+        .catch(res => {
+          EventBus.$emit('error', (JSON.parse(res) || {}).message)
+          this.$refs.upload.clearFiles()
+        })
     },
     getUnitList() {
       xiala({
@@ -1474,7 +1457,6 @@ export default {
           }else{ 
                  this.deptBudgetList.deliveryArea =  CodeToText[this.selectedOptions[2]]
           }
-          this.deptBudgetList.addressUrl = this.addressUrls.toString()
 
           addList(this.deptBudgetList)
             .toPromise()

+ 18 - 31
src/views/contractManagement/futuresSalesContractEdit.vue

@@ -573,23 +573,14 @@
         maxlength="200"
       />
       
-      <el-upload
-        class="upload-demo"
-        action="https://www.zthymaoyi.com/upload/admin"
-         :on-success="
-            (res, file) => {
-              uploadSuccessHandle(res)
-            }
-          "
-        multiple
-        :limit="3"
-        :file-list="fileList"
-      >
-        <el-button size="small" type="primary">点击上传</el-button>
-        <div slot="tip" class="el-upload__tip">
-          推荐格式.jpg, .jpeg, .png, .gif, .pdf, .doc, .zip, .rar,单个文件大小不超过10M
-        </div>
-      </el-upload>
+      <ws-upload
+        ref="upload"
+        :comp-id="compId"
+        :appendix-ids="deptBudgetList.addressUrl"
+        :size-limit="size"
+        @onChange="onChange"
+        accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
+      />
     </ws-form>
     <div style="text-align: right; padding: 10px" class="center">
       <el-button
@@ -676,9 +667,6 @@ export default {
       },
       acceptanceCheck: {},
       compId: sessionStorage.getItem('ws-pf_compId'),
-      addressUrls:[],
-      addressUrl:'',
-      fileList:[],
     }
   },
 
@@ -693,9 +681,6 @@ export default {
     this.showType = this.isShow
   },
   methods: {
-    close(index) {
-      this.addressUrls.splice(index, 1)
-    },
     dataFilter(val) {
       this.deptBudgetList.personCharge = val
       if (val) {
@@ -767,10 +752,6 @@ export default {
           } else if (this.deptBudgetList.deliverType == 2) {
             this.deptBudgetList.deliverType1 = '对方自提'
           }
-          if(this.deptBudgetList.addressUrl != null){
-            this.addressUrls = this.deptBudgetList.addressUrl.split(",")
-            this.fileList = this.deptBudgetList.addressUrl.split(",")
-          }
         })
 
       // 包装方式
@@ -831,9 +812,16 @@ export default {
       })
     },
     // 上传附件
-    uploadSuccessHandle(e) {
-      this.addressUrl += e.url+""
-       this.addressUrls.push(this.addressUrl.split(","))
+    onChange () {
+      this.$refs.upload
+        .handleSaveBill()
+        .then(async response => {
+          this.deptBudgetList.addressUrl = response
+        })
+        .catch(res => {
+          EventBus.$emit('error', (JSON.parse(res) || {}).message)
+          this.$refs.upload.clearFiles()
+        })
     },
     getUnitList() {
       xiala({
@@ -1600,7 +1588,6 @@ export default {
           }else{ 
                  this.deptBudgetList.deliveryArea =  CodeToText[this.selectedOptions[2]]
           }
-          this.deptBudgetList.addressUrl = this.addressUrls.toString()
           editInfo(this.deptBudgetList)
             .toPromise()
             .then((response) => {

+ 8 - 1
src/views/contractManagement/futuresSalesContractExamine.vue

@@ -232,7 +232,13 @@
       <div style=" color: #afb5cb;margin-left: 20px;">
       {{ deptBudgetList.remarks }}
       </div>
-      <!-- <img :src="deptBudgetList.addressUrl" alt="" /> -->
+     <ws-upload
+        ref="upload"
+        :comp-id="compId"
+        :appendix-ids="deptBudgetList.addressUrl"
+        :editable="false"
+        accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
+      />
     </ws-form>
     <div style="text-align: right; padding: 10px">
       <el-button
@@ -288,6 +294,7 @@ export default {
       mainReportAdd: {},
       list: {},
       id : '',
+      compId: sessionStorage.getItem('ws-pf_compId'),
     }
   },
 

+ 6 - 57
src/views/contractManagement/purchaseContract.vue

@@ -254,70 +254,19 @@
       :total="deptBudgetTotal"
     >
     </el-pagination>
-    <!-- 附件弹框 -->
-    <!-- <WinseaContentModal
+
+    <WinseaContentModal
       v-model="accessoryTFs"
       :title="$t('system.noticeCircular.information')"
       @on-cancel="handleClose"
     >
-      <p>查看附件</p>
-      <ws-upload
+     <ws-upload
         ref="upload"
-        table-name="maintain_work_order"
-        oss-key="mainPlan"
         :comp-id="compId"
-        :appendix-ids="appendixIdsAdd"
-        :vesselId="deptBudgetList.addressUrl"
-        :size-limit="size"
-        @uploadSuccess="uploadSuccess"
+        :appendix-ids="appendixIdss"
+        :editable="false"
         accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
       />
-    </WinseaContentModal> -->
-    <!-- <WinseaContentModal
-      v-model="accessoryTFs"
-      :title="$t('system.noticeCircular.information')"
-      @on-cancel="handleClose"
-    >
-      <p>查看附件</p>
-      <div
-        style="display: flex; margin: 5px"
-        v-for="item in this.addressUrls"
-      >
-      <div  v-for="items1 in item">
-        <img width="100" height="100" :src="items1" alt="" style=""/>
-        </div>
-      </div>
-    </WinseaContentModal> -->
-
-    <WinseaContentModal
-      v-model="accessoryTFs"
-      :title="$t('system.noticeCircular.information')"
-      @on-cancel="handleClose"
-    >
-      <el-upload
-        class="upload-demo"
-        action="https://www.zthymaoyi.com/upload/admin"
-        :on-success="
-          (res, file) => {
-            uploadSuccessHandle(res)
-          }
-        "
-        multiple
-        :limit="3"
-        :file-list="fileList"
-      >
-        <el-button size="small" type="primary">附件附件</el-button>
-        <div slot="tip" class="el-upload__tip">
-          推荐格式.jpg, .jpeg, .png, .gif, .pdf, .doc, .zip,
-          .rar,单个文件大小不超过10M
-        </div>
-      </el-upload>
-      <p>查看附件</p>
-      <div style="display: flex;">
-      <div style="display: flex; margin: 5px" v-for="item in this.appendixIdss">
-          <img width="100" height="100" :src="item" alt=""/>
-      </div>
-      </div>
     </WinseaContentModal>
   </div>
 </template>
@@ -590,7 +539,7 @@ export default {
       } else {
         this.accessoryTFs = true
       }
-      this.appendixIdss = row.addressUrl.split(',')
+      this.appendixIdss = row.addressUrl
     },
     handleExamine(row) {
       console.log(row)

+ 13 - 76
src/views/contractManagement/purchaseContractAdd.vue

@@ -520,68 +520,14 @@
         placeholder="请输入备注信息,不超过200字"
         maxlength="200"
       />
-      <!-- <ws-upload
+      <ws-upload
         ref="upload"
-        table-name="maintain_work_order"
-        oss-key="mainPlan"
         :comp-id="compId"
-        :appendix-ids="appendixIdsAdd"
-        :vesselId="deptBudgetList.addressUrl"
+        :appendix-ids="deptBudgetList.addressUrl"
         :size-limit="size"
-        @uploadSuccess="uploadSuccess"
         @onChange="onChange"
         accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
-      /> -->
-      <!-- -------------- -->
-      <!-- <el-upload
-          action="https://www.zthymaoyi.com/upload/admin"
-          :show-file-list="false"
-          :on-success="
-            (res, file) => {
-              uploadSuccessHandle(res)
-            }
-          "
-          class="avatar-uploader"
-          accept=".jpg, .jpeg, .png, .gif, .pdf, .doc, .zip, .rar"
-        >
-          <el-button style="margin-top: 10px">上传附件</el-button>
-        </el-upload>
-        <div class="addressUrls" v-if="addressUrls != null">
-          <div class="addressUrls-item">
-            <div
-              v-for="(item, index) in addressUrls"
-              class="addressUrl"
-              :key="index"
-            >
-              <div @click="close(index)" class="iconfont icon-guanbi"></div>
-              <img
-                v-if="addressUrls != null"
-                width="100"
-                height="100"
-                :src="item"
-                alt=""
-              />
-            </div>
-          </div>
-        </div> -->
-
-      <el-upload
-        class="upload-demo"
-        action="https://www.zthymaoyi.com/upload/admin"
-         :on-success="
-            (res, file) => {
-              uploadSuccessHandle(res)
-            }
-          "
-        multiple
-        :limit="3"
-        :file-list="fileList"
-      >
-        <el-button size="small" type="primary">点击上传</el-button>
-        <div slot="tip" class="el-upload__tip">
-          推荐格式.jpg, .jpeg, .png, .gif, .pdf, .doc, .zip, .rar,单个文件大小不超过10M
-        </div>
-      </el-upload>
+      />
     </ws-form>
     <div style="text-align: right; padding: 10px" class="center">
       <el-button
@@ -653,8 +599,6 @@ export default {
       staffList: [],
       appendixIdsAdd: '',
       size: 10,
-      // uploadSuccess: {},
-      // onChange:{},
       unitList: [],
       goodnameList: [],
       value1: '袋装',
@@ -689,8 +633,6 @@ export default {
       },
       selectIntendedShip: {},
       interviewTypeList: {},
-      addressUrls: [],
-      fileList:[],
     }
   },
   activated() {
@@ -712,9 +654,6 @@ export default {
     this.showType = this.isShow
   },
   methods: {
-    close(index) {
-      this.addressUrls.splice(index, 1)
-    },
     dataFilter(val) {
       this.deptBudgetList.personCharge = val
       if (val) {
@@ -784,17 +723,16 @@ export default {
           this.ChapterTwoList = response
         })
     },
-    // 上传附件
-    uploadSuccessHandle(e) {
-      console.log(e)
-      this.addressUrls.push(e.url)
-      // this.deptBudgetList.addressUrl = this.addressUrls.toString
-    },
-    onChange(files) {
-      this.fileNum = files
-      this.$refs.upload.handleSaveBill().then((res) => {
-        console.log(files)
-      })
+    onChange() {
+     this.$refs.upload
+        .handleSaveBill()
+        .then(async response => {
+          this.deptBudgetList.addressUrl = response
+        })
+        .catch(res => {
+          EventBus.$emit('error', (JSON.parse(res) || {}).message)
+          this.$refs.upload.clearFiles()
+        })
     },
     getUnitList() {
       xiala({
@@ -1389,7 +1327,6 @@ export default {
           } else {
             this.deptBudgetList.sourceArea = CodeToText[this.selectedOptions[2]]
           }
-          this.deptBudgetList.addressUrl = this.addressUrls.toString()
 
           addList(this.deptBudgetList)
             .toPromise()

+ 19 - 32
src/views/contractManagement/purchaseContractEdit.vue

@@ -478,23 +478,14 @@
           placeholder="请输入备注信息,不超过200字"
           maxlength="200"
         />
-        <el-upload
-        class="upload-demo"
-        action="https://www.zthymaoyi.com/upload/admin"
-         :on-success="
-            (res, file) => {
-              uploadSuccessHandle(res)
-            }
-          "
-        multiple
-        :limit="3"
-        :file-list="fileList"
-      >
-        <el-button size="small" type="primary">上传附件</el-button>
-        <div slot="tip" class="el-upload__tip">
-          推荐格式.jpg, .jpeg, .png, .gif, .pdf, .doc, .zip, .rar,单个文件大小不超过10M
-        </div>
-      </el-upload>
+        <ws-upload
+        ref="upload"
+        :comp-id="compId"
+        :appendix-ids="deptBudgetList.addressUrl"
+        :size-limit="size"
+        @onChange="onChange"
+        accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
+      />
       </base-card>
     </ws-form>
     <div style="text-align: right; padding: 10px">
@@ -574,9 +565,6 @@ export default {
       },
       acceptanceCheck: {},
       compId: sessionStorage.getItem('ws-pf_compId'),
-      addressUrls:[],
-      addressUrl:'',
-      fileList:[],
     }
   },
 
@@ -591,9 +579,6 @@ export default {
     this.showType = this.isShow
   },
   methods: {
-    close(index) {
-      this.addressUrls.splice(index, 1)
-    },
     dataFilter(val) {
       this.deptBudgetList.personCharge = val
       if (val) {
@@ -676,10 +661,6 @@ export default {
           } else if (this.deptBudgetList.deliverType == 2) {
             this.deptBudgetList.deliverType1 = '对方送货'
           }
-          if(this.deptBudgetList.addressUrl != null){
-            this.addressUrls = this.deptBudgetList.addressUrl.split(",")
-            this.fileList = this.deptBudgetList.addressUrl.split(",")
-          }
           
         })
       // 包装方式
@@ -716,10 +697,17 @@ export default {
         constKey: '',
       })
     },
-    // 上传附件
-    uploadSuccessHandle(e) {
-      this.addressUrl += e.url+""
-       this.addressUrls.push(this.addressUrl.split(","))
+     // 上传附件
+    onChange () {
+      this.$refs.upload
+        .handleSaveBill()
+        .then(async response => {
+          this.deptBudgetList.addressUrl = response
+        })
+        .catch(res => {
+          EventBus.$emit('error', (JSON.parse(res) || {}).message)
+          this.$refs.upload.clearFiles()
+        })
     },
     getUnitList() {
       xiala({
@@ -1418,7 +1406,6 @@ export default {
           }else{
                this.deptBudgetList.sourceArea = CodeToText[this.selectedOptions[2]]
           }
-          this.deptBudgetList.addressUrl = this.addressUrls.toString()
           editInfo(this.deptBudgetList)
             .toPromise()
             .then((response) => {

+ 8 - 1
src/views/contractManagement/purchaseContractExamine.vue

@@ -218,7 +218,13 @@
       <div style=" color: #afb5cb;margin-left: 20px;">
       {{ deptBudgetList.remarks }}
       </div>
-      <!-- <img :src="deptBudgetList.addressUrl" alt="" /> -->
+      <ws-upload
+        ref="upload"
+        :comp-id="compId"
+        :appendix-ids="deptBudgetList.addressUrl"
+        :editable="false"
+        accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
+      />
     </ws-form>
     <div style="text-align: right; padding: 10px">
       <el-button
@@ -273,6 +279,7 @@ export default {
       },
       mainReportAdd: {},
       list: {},
+      compId: sessionStorage.getItem('ws-pf_compId'),
     }
   },
 

+ 8 - 25
src/views/contractManagement/salesContract.vue

@@ -266,30 +266,13 @@
       :title="$t('system.noticeCircular.information')"
       @on-cancel="handleClose"
     >
-      <el-upload
-        class="upload-demo"
-        action="https://www.zthymaoyi.com/upload/admin"
-        :on-success="
-          (res, file) => {
-            uploadSuccessHandle(res)
-          }
-        "
-        multiple
-        :limit="3"
-        :file-list="fileList"
-      >
-        <el-button size="small" type="primary">上传附件</el-button>
-        <div slot="tip" class="el-upload__tip">
-          推荐格式.jpg, .jpeg, .png, .gif, .pdf, .doc, .zip,
-          .rar,单个文件大小不超过10M
-        </div>
-      </el-upload>
-      <p>查看附件</p>
-      <div style="display: flex;">
-      <div style="display: flex; margin: 5px" v-for="item in this.appendixIdss">
-          <img width="100" height="100" :src="item" alt=""/>
-      </div>
-      </div>
+     <ws-upload
+        ref="upload"
+        :comp-id="compId"
+        :appendix-ids="appendixIdss"
+        :editable="false"
+        accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
+      />
     </WinseaContentModal>
   </div>
 </template>
@@ -580,7 +563,7 @@ export default {
       } else {
         this.accessoryTFs = true
       }
-      this.appendixIdss = row.addressUrl.split(',')
+      this.appendixIdss = row.addressUrl
     },
     handleExamine(row) {
       this.$router.push({

+ 18 - 34
src/views/contractManagement/salesContractAdd.vue

@@ -542,23 +542,14 @@
           placeholder="请输入备注信息,不超过200字"
           maxlength="200"
         />
-        <el-upload
-        class="upload-demo"
-        action="https://www.zthymaoyi.com/upload/admin"
-         :on-success="
-            (res, file) => {
-              uploadSuccessHandle(res)
-            }
-          "
-        multiple
-        :limit="3"
-        :file-list="fileList"
-      >
-        <el-button size="small" type="primary">上传附件</el-button>
-        <div slot="tip" class="el-upload__tip">
-          推荐格式.jpg, .jpeg, .png, .gif, .pdf, .doc, .zip, .rar,单个文件大小不超过10M
-        </div>
-      </el-upload>
+       <ws-upload
+        ref="upload"
+        :comp-id="compId"
+        :appendix-ids="deptBudgetList.addressUrl"
+        :size-limit="size"
+        @onChange="onChange"
+        accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
+      />
       </ws-form>
     </div>
     <div style="text-align: right; padding: 10px" class="center">
@@ -623,13 +614,10 @@ export default {
       mainReportAdd: {},
       appendixIdsAdd: '',
       size: 10,
-      // uploadSuccess: {},
-      // onChange:{},
       unitList: [],
       goodnameList: [],
       gradeList: [],
       ChapterTwoList: [],
-      addressUrls: [],
       deptBudgetList: {
         deliverType: '1',
         finalTradingVolume: 0,
@@ -676,9 +664,6 @@ export default {
     this.showType = this.isShow
   },
   methods: {
-    close(index) {
-      this.addressUrls.splice(index, 1)
-    },
     // 关闭 dialog时 处理文件url 初始化upload组件
     handleClose() {
       this.dialogViewSpareMoney = false
@@ -720,16 +705,16 @@ export default {
           this.ChapterTwoList = response
         })
     },
-    // 上传附件
-    uploadSuccessHandle(e) {
-      this.addressUrls.push(e.url)
-      this.deptBudgetList.addressUrl = this.addressUrls.toString
-    },
-    onChange(files) {
-      this.fileNum = files
-      this.$refs.upload.handleSaveBill().then((res) => {
-        console.log(files)
-      })
+    onChange() {
+      this.$refs.upload
+        .handleSaveBill()
+        .then(async response => {
+          this.deptBudgetList.addressUrl = response
+        })
+        .catch(res => {
+          EventBus.$emit('error', (JSON.parse(res) || {}).message)
+          this.$refs.upload.clearFiles()
+        })
     },
     getUnitList() {
       xiala({
@@ -1327,7 +1312,6 @@ export default {
           } else {
             this.deptBudgetList.sourceArea = CodeToText[this.selectedOptions[2]]
           }
-          this.deptBudgetList.addressUrl = this.addressUrls.toString()
           addList(this.deptBudgetList)
             .toPromise()
             .then((response) => {

+ 18 - 35
src/views/contractManagement/salesContractEdit.vue

@@ -509,23 +509,14 @@
           placeholder="请输入备注信息,不超过200字"
           maxlength="200"
         />
-        <el-upload
-        class="upload-demo"
-        action="https://www.zthymaoyi.com/upload/admin"
-         :on-success="
-            (res, file) => {
-              uploadSuccessHandle(res)
-            }
-          "
-        multiple
-        :limit="3"
-        :file-list="fileList"
-      >
-        <el-button size="small" type="primary">上传附件</el-button>
-        <div slot="tip" class="el-upload__tip">
-          推荐格式.jpg, .jpeg, .png, .gif, .pdf, .doc, .zip, .rar,单个文件大小不超过10M
-        </div>
-      </el-upload>
+        <ws-upload
+        ref="upload"
+        :comp-id="compId"
+        :appendix-ids="deptBudgetList.addressUrl"
+        :size-limit="size"
+        @onChange="onChange"
+        accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
+      />
       </ws-form>
     </div>
     <div style="text-align: right; padding: 10px" class="center">
@@ -584,10 +575,7 @@ export default {
           return time.getTime() > Date.now()
         },
       },
-      // selectpackingMethod:{},
       selectunitList: {},
-      //change:{},
-      onChange: {},
       uploadSuccess: {},
       selectgrade: {},
       goodnameList: {},
@@ -603,8 +591,6 @@ export default {
         },
         contractProcessInfo: {},
       },
-      // selectpackingMethod:{},
-      //  change:{},
       ruleDeptBudget: {},
       trainingMethods: {},
       isEdited: false,
@@ -617,9 +603,6 @@ export default {
       ChapterTwoList: {},
       selectIntendedShip: {},
       interviewTypeList: {},
-      addressUrl:'',
-      addressUrls:[],
-      fileList:[]
     }
   },
   activated() {
@@ -633,9 +616,6 @@ export default {
     this.showType = this.isShow
   },
   methods: {
-     close(index) {
-      this.addressUrls.splice(index, 1)
-    },
     // 关闭 dialog时 处理文件url 初始化upload组件
     handleClose() {
       this.dialogViewSpareMoney = false
@@ -651,9 +631,16 @@ export default {
       this.selectedOptions1 = value
     },
       // 上传附件
-    uploadSuccessHandle(e) {
-      this.addressUrl += e.url+""
-       this.addressUrls.push(this.addressUrl.split(","))
+    onChange() {
+      this.$refs.upload
+        .handleSaveBill()
+        .then(async response => {
+          this.deptBudgetList.addressUrl = response
+        })
+        .catch(res => {
+          EventBus.$emit('error', (JSON.parse(res) || {}).message)
+          this.$refs.upload.clearFiles()
+        })
     },
     loaddata() {
       // 数据
@@ -692,9 +679,6 @@ export default {
           } else if (this.deptBudgetList.deliverType == 2) {
             this.deptBudgetList.deliverType1 = '对方自提'
           }
-          if(this.deptBudgetList.addressUrl != null){
-            this.addressUrls = this.deptBudgetList.addressUrl.split(",")
-          }
         })
       // 包装方式
       packList({ constId: 'CON1' })
@@ -1400,7 +1384,6 @@ export default {
           } else {
             this.deptBudgetList.sourceArea = CodeToText[this.selectedOptions[2]]
           }
-          this.deptBudgetList.addressUrl = this.addressUrls.toString()
           editInfo(this.deptBudgetList)
             .toPromise()
             .then((response) => {

+ 8 - 1
src/views/contractManagement/salesContractExamine.vue

@@ -316,7 +316,13 @@
           </div>
         </div>
 
-        <img :src="deptBudgetList.addressUrl" alt="" />
+        <ws-upload
+        ref="upload"
+        :comp-id="compId"
+        :appendix-ids="deptBudgetList.addressUrl"
+        :editable="false"
+        accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
+      />
       </ws-form>
       <div style="text-align: right; padding: 10px">
         <el-button
@@ -377,6 +383,7 @@ export default {
       mainReportAdd: {},
       list: {},
       historyList: [],
+      compId: sessionStorage.getItem('ws-pf_compId'),
     }
   },