Browse Source

Merge branch 'master' of http://47.100.3.209:3000/gdc/yiliangyiyun-pc

ccj 2 years ago
parent
commit
e9475ea864

+ 2 - 0
src/api/V2/profitable/index.js

@@ -20,6 +20,8 @@ export const API_POST_AUDITRECORD = '/billOperateHis/query/commonBillOperateHis'
 export const API_GET_WAREHOUSE = '/warehouseBaseInfo/selectWarehouse'
 // 费用管理提交
 export const API_POST_SUBMIT = '/feeDetailsInfo/submit'
+// 费用管理编辑附件
+export const API_POST_UPLOADIMAGE = '/expenseInfo/uploadAttachments'
 // 费用管理查看
 export const API_GET_LOOK = '/feeDetailsInfo/selectInfo'
 // 费用管理付款,确认付款

+ 3 - 0
src/model/profitable/index.js

@@ -56,6 +56,7 @@ import {
   API_POST_EXPORTFILE,
   API_GET_CONSTNO,
   API_IMPORT_FIXED,
+  API_POST_UPLOADIMAGE
 } from '@/api/V2/profitable'
 //收支明细列表
 export const getInOutDetailed = appRx.get(API_GET_INOUTDETAILED, errorCatcher, errorHandle, filter)
@@ -79,6 +80,8 @@ export const getAuditRecord = appRx.get(API_POST_AUDITRECORD, errorCatcher, erro
 export const getwarehouse= appRx.get(API_GET_WAREHOUSE, errorCatcher, errorHandle, filter)
 // 费用管理提交
 export const setexpense = appRx.post(API_POST_SUBMIT, errorCatcher, errorHandle, filter)
+// 费用管理编辑附件
+export const editfujian = appRx.post(API_POST_UPLOADIMAGE, errorCatcher, errorHandle, filter)
 // 合同编号下拉
 export const getcontract = appRx.get(API_GET_WAREHOUSE_NO, errorCatcher, errorHandle, filter)
 // 费用管理提交

+ 27 - 9
src/views/profitable/expensemanagementdetails.vue

@@ -278,7 +278,7 @@
       </div>
     </el-dialog>
     <WinseaContentModal v-model="fujianshow" :title="title" @on-cancel="handleClose">
-      <ws-upload :editable="false" ref="upload" accept=".jpg, .jpeg, .png, .pdf, .doc, .docx, .xls, .xlsx"
+      <ws-upload ref="upload" @onChange="onChange1" accept=".jpg, .jpeg, .png, .pdf, .doc, .docx, .xls, .xlsx"
         :comp-id="compId" :appendix-ids="appendixIdss" :size-limit="size" />
     </WinseaContentModal>
     <el-dialog
@@ -312,7 +312,8 @@ import {
   getXialaList,
   sponsorWithdraw,
   exportFile,
-  getcostNo
+  getcostNo,
+  editfujian
 } from '@/model/profitable/index'
 import { getwarehousName} from '@/model/warehouse/index'
 import {
@@ -543,6 +544,23 @@ export default {
             this.$refs.upload1.clearFiles()
           })
       },
+      onChange1() {
+        this.$refs.upload
+          .handleSaveBill()
+          .then(async (response) => {
+            editfujian({addressUrl:response,id:this.id})
+              .toPromise()
+              .then((response) => {
+                this.fujianshow = false
+                this.$message.success('上传成功')
+                this.getList()
+              })
+          })
+          .catch((res) => {
+            EventBus.$emit('error', (JSON.parse(res) || {}).message)
+            this.$refs.upload.clearFiles()
+          })
+      },
     handlerecord(row) {
       if (row.expensesType == 1) {
         this.title1 = '收款审核记录'
@@ -566,15 +584,15 @@ export default {
     fujian(row) {
       this.id = row.id
 
-      if (row.addressUrl) {
+      // if (row.addressUrl) {
         this.appendixIdss = row.addressUrl
         this.fujianshow = true
-      } else {
-        this.$message({
-          message: '暂无附件查看!',
-          type: 'warning',
-        })
-      }
+      // } else {
+      //   this.$message({
+      //     message: '暂无附件查看!',
+      //     type: 'warning',
+      //   })
+      // }
     },
     look(row) {
       this.$router.push({