瀏覽代碼

Merge remote-tracking branch 'origin/master'

lizhenhao 2 年之前
父節點
當前提交
f79ae95621

+ 7 - 0
src/api/cw/workContract/ContractInfoService.js

@@ -57,6 +57,13 @@ export default class ContractInfoService {
       data: param
     })
   }
+  updatePaperInfo (param) {
+    return request({
+      url: '/contract/registration/updatePaperInfo',
+      method: 'post',
+      data: param
+    })
+  }
   getByClientId (id, contractForm) {
     return request({
       url: '/contract/registration/getByClientId',

+ 19 - 1
src/views/modules/cw/reimbursementApproval/info/InfoForm.vue

@@ -61,7 +61,9 @@
         <el-row  :gutter="15" >
           <vxe-table
             border
+            show-footer
             show-overflow
+            :footer-method="footerMethod"
             ref="detailTable"
             class="vxe-table-element"
             :data="inputForm.detailInfos"
@@ -69,7 +71,7 @@
             @cell-click=""
             @edit-closed=""
             highlight-current-row
-            :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, autoClear: true}"
+            :edit-config="{trigger: 'click', mode: 'row', showStatus: false, autoClear: true, icon: '-'}"
           >
             <vxe-table-column field="userName" title="报销人" :edit-render="{}">
               <template v-slot:edit="scope">
@@ -191,6 +193,7 @@
   // import ReimbursementService from '@/api/sys/ReimbursementService'
   import ReimbursementApprovalService from '@/api/cw/reimbursementApproval/ReimbursementApprovalService'
   import UpLoadComponent from '@/views/common/UpLoadComponent'
+  import XEUtils from 'xe-utils'
   export default {
     data () {
       return {
@@ -265,6 +268,21 @@
           }
         })
       },
+      footerMethod ({ columns, data }) {
+        const footerData = [
+          columns.map((column, columnIndex) => {
+            if (columnIndex === 0) {
+              return '总报销费用'
+            }
+            if (['number'].includes(column.property)) {
+              // eslint-disable-next-line no-undef
+              return XEUtils.sum(data, column.property)
+            }
+            return null
+          })
+        ]
+        return footerData
+      },
       // 表单提交
       doSubmit () {
         this.$refs['inputForm'].validate((valid) => {

+ 3 - 3
src/views/modules/cw/workContract/ContractFilePaperForm.vue

@@ -704,9 +704,9 @@
                 // console.log('actualContractAmount', _this.inputForm.actualContractAmount)
                 // this.inputForm.contractInfoList = this.$refs.uploadFile.getDataList()
                 _this.contractFilePaperService.save(_this.inputForm).then(() => {
-                  // _this.contractInfoService.updateInfo(_this.inputForm).then(() => {
-                  //   resolve()
-                  // })
+                  _this.contractInfoService.updatePaperInfo(_this.inputForm).then(() => {
+                    resolve()
+                  })
                   resolve()
                 })
               }

+ 33 - 16
src/views/modules/cw/workContract/ContractRegistrationForm.vue

@@ -662,33 +662,50 @@
         let _this = this
         // eslint-disable-next-line no-unused-vars
         let _list = list
+        let _num = 0
         const waitForEach = function () {
           return new Promise(function (resolve, reject) {
-            _this.inputForm.cwWorkClientContactDTOList.forEach((client, index) => {
-              if (_this.inputForm.customerNo === client.no) {
-                _this.$refs.contactTable.remove(client)
-                _this.inputForm.cwWorkClientContactDTOList.splice(index, 1)
-                // _this.$message.error('已存在客户 “' + client.name + '”,请重新选择')
-                // throw new Error('已存在客户 “' + client.name + '”,请重新选择')
-              }
-            })
-            resolve()
+            if (_this.commonJS.isEmpty(_this.inputForm.cwWorkClientContactDTOList)) {
+              resolve()
+            } else {
+              _this.inputForm.cwWorkClientContactDTOList.forEach((client, index) => {
+                if (_this.inputForm.customerNo === client.no) {
+                  _this.$refs.contactTable.remove(client)
+                  _this.inputForm.cwWorkClientContactDTOList.splice(index, 1)
+                }
+              })
+              setTimeout(() => {
+                resolve()
+              }, 400)
+            }
           })
         }
         waitForEach().then(() => {
-          // eslint-disable-next-line no-unused-vars
-          let item = {
-            no: list.no,
-            name: list.name
-          }
-          // console.log('list', list)
           this.inputForm.customerNo = list.no
           this.inputForm.uscCode = list.uscCode
           this.inputForm.address = list.address
           this.inputForm.customerId = list.id
-          this.inputForm.cwWorkClientContactDTOList.push(item)
           this.inputForm.clientContacts = list.name
           this.inputForm.clientContactsPhone = list.mobile
+          const wait = function () {
+            return new Promise(function (resolve, reject) {
+              _this.inputForm.cwWorkClientContactDTOList.forEach(client => {
+                if (_list.no === client.no) {
+                  _num = 1
+                }
+              })
+              setTimeout(() => {
+                resolve()
+              }, 100)
+            })
+          }
+          wait().then(() => {
+            if (_num === 0) {
+              this.inputForm.cwWorkClientContactDTOList.push({no: list.no, name: list.name})
+              this.$refs.contactTable.insertAt({no: list.no, name: list.name})
+              this.tableKeyClient = Math.random()
+            }
+          })
         })
       },
       // 表单提交