ccj 3 năm trước cách đây
mục cha
commit
472483f9f8

+ 10 - 8
src/components/WsUpload/index.vue

@@ -25,7 +25,7 @@
       </div>
     </div>
     <el-upload
-      action="https://www.zthymaoyi.com/upload/admin"
+      action="#"
       list-type="picture-card"
       :http-request="_handleRequest"
       :file-list="fileList"
@@ -39,7 +39,7 @@
       </template>
       <template v-slot:file="{ file }">
         <div class="thumbnail-group">
-          <!-- <winsea-picture-view
+          <winsea-picture-view
             v-if="isPictureFile(file)"
             class="el-upload-list__item-thumbnail"
             picturesShowType="fold"
@@ -47,8 +47,9 @@
             :pic-list="_getFileImgs"
             :width="110"
             :height="110"
-          /> -->
+          />
           <img
+            v-else
             class="el-upload-list__item-thumbnail"
             :class="getFileClass(file)"
           />
@@ -169,7 +170,7 @@ export default {
     },
     ossKey: {
       type: String,
-      required: true,
+      required: false,
     },
     compId: {
       // 公司ID
@@ -185,7 +186,7 @@ export default {
     tableName: {
       // 要保存的表的名字
       type: String,
-      required: true,
+      required: false,
     },
     onlineEdit: false,
     disabled: false,
@@ -588,12 +589,13 @@ export default {
     },
     getFilePath(path) {
       // let sysUrl =  process.env.NODE_ENV === "production"?"http://" + window.location.host+"/":"http://product-dev.winsea.com/";
-      let sysUrl = this.$store.getters.baseInfo.fileUrl
-      path = this.checkUrl(path)
+      // let sysUrl = this.$store.getters.baseInfo.fileUrl
+      // path = this.checkUrl(path)
       // if (this.clientFag === "B") {
       //   // sysUrl+="pb/"
       // }
-      return sysUrl + this.slash(path)
+      // return sysUrl + this.slash(path)
+      return path
     },
     // 字节转KB
     toKB(bt) {

+ 32 - 21
src/views/contractManagement/futuresPurchaseContractEdit.vue

@@ -569,25 +569,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
@@ -618,6 +607,18 @@ import {
   editInfo,
   getstaff,
 } from '@/model/contarct/index'
+import {
+  findTreeList,
+  findFileUnderFolder,
+  removeAll,
+  addInfo,
+  findFileType,
+  fileRename,
+  changeInfo,
+  addFile,
+  moveFile,
+  removeInfo
+} from '@/model/dataManageMent'
 import WsUpload from '@/components/WsUpload'
 import { EventBus, dayjs } from 'base-core-lib'
 export default {
@@ -835,8 +836,18 @@ 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({