Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/master'

lizhenhao 2 anni fa
parent
commit
54435d7da6

+ 38 - 25
src/views/modules/cw/workContract/ContractFileForm.vue

@@ -83,7 +83,7 @@
                         :rules="[
                   {required: true, message:'请输入合同实际金额(元)', trigger:'blur'}
                ]">
-            <el-input maxlength="15" v-model="inputForm.actualContractAmount" placeholder="请输入合同实际金额(元)"
+            <el-input maxlength="10" v-model="inputForm.actualContractAmount" placeholder="请输入合同实际金额(元)"
                       @keyup.native="inputForm.actualContractAmount = twoDecimalPlaces(inputForm.actualContractAmount)"
             ></el-input>
           </el-form-item>
@@ -564,35 +564,48 @@
       },
       // 表单提交
       // 暂存
-      async saveForm (callback) {
+      saveForm (callback) {
         if (this.$refs.archiveFile.checkProgress() || this.$refs.uploadFile.checkProgress()) {
           this.loading = false
           throw new Error()
         } else {
-          // 合同登记暂存
-          if (this.status === 'startAndHold' || this.status === 'startAndHoldFiled') {
-            this.loading = true
-            if (this.status === 'startAndHold') {
-              this.inputForm.status = '1'
-            }
-            if (this.status === 'startAndHoldFiled') {
-              this.inputForm.status = '5'
-            }
-            // await this.contractInfoService.save(this.inputForm)
-          }
-          // 合同登记归档暂存
-          if (this.status === 'startAndHoldFiled') {
-            this.inputForm.filedType = '1'
-            this.inputForm.contractInfoId = this.businessId
-            this.inputForm.contractInfoList = this.$refs.archiveFile.getDataList()
-            // this.inputForm.contractInfoList = this.$refs.uploadFile.getDataList()
-            this.contractFileService.save(this.inputForm)
-            this.contractInfoService.updateInfo(this.inputForm)
+          let _this = this
+          const wait = function () {
+            return new Promise((resolve, reject) => {
+              // 合同登记暂存
+              if (_this.status === 'startAndHold' || _this.status === 'startAndHoldFiled') {
+                _this.loading = true
+                if (_this.status === 'startAndHold') {
+                  _this.inputForm.status = '1'
+                }
+                if (_this.status === 'startAndHoldFiled') {
+                  _this.inputForm.status = '5'
+                }
+                // await this.contractInfoService.save(this.inputForm)
+              }
+              console.log('actualContractAmount', _this.inputForm.actualContractAmount)
+              // eslint-disable-next-line no-unused-vars
+              // 合同登记归档暂存
+              if (_this.status === 'startAndHoldFiled') {
+                _this.inputForm.filedType = '1'
+                _this.inputForm.contractInfoId = _this.businessId
+                _this.inputForm.contractInfoList = _this.$refs.archiveFile.getDataList()
+                console.log('actualContractAmount', _this.inputForm.actualContractAmount)
+                // this.inputForm.contractInfoList = this.$refs.uploadFile.getDataList()
+                _this.contractFileService.save(_this.inputForm).then(() => {
+                  _this.contractInfoService.updateInfo(_this.inputForm).then(() => {
+                    resolve()
+                  })
+                })
+              }
+            })
           }
-          this.$refs.inputForm.resetFields()
-          this.loading = false
-          this.businessId = ''
-          callback()
+          wait().then(() => {
+            this.$refs.inputForm.resetFields()
+            this.loading = false
+            // this.businessId = ''
+            callback()
+          })
         }
       },
       // 送审

+ 16 - 4
src/views/modules/cw/workContract/ContractNameForm.vue

@@ -297,6 +297,7 @@
           customerName: ''
         },
         inputForm: {
+          filedType: '',
           contractNo: '',
           contractName: '',
           payerSubject: '',
@@ -482,7 +483,9 @@
                 // console.log('data1.22222')
                 // console.log('data1.data.contractProperList', data1.data.contractProperList)
               this.$refs.uploadFile.clearUpload()
+              this.$refs.archiveFile.clearUpload()
               this.$refs.uploadFile.newUpload(method, data1.data.contractProperList, 'cwWorkContract', null, null, null, null, false)
+              this.$refs.archiveFile.newUpload(method, data1.data.contractInfoList, 'cwWorkContract', null, null, null, null, false)
               this.contractFileService.findById(this.inputForm.id).then(data2 => {
                 this.inputForm.contractProperList = data2.data.contractProperList
                 this.inputForm.contractInfoList = data2.data.contractInfoList
@@ -491,10 +494,12 @@
                   data3.data.contractProperList = this.inputForm.contractProperList
                   data3.data.contractInfoList = this.inputForm.contractInfoList
                   if (data3.data.filedType === '2' || data3.data.filedType === '5') {
+                    this.$refs.archiveFile.clearUpload()
                     // this.$refs.uploadFile.clearUpload()
                     // this.$refs.uploadFile.newUpload(method, data3.data.contractProperList, 'cwWorkContract', null, null, null, null, false)
                     this.$refs.archiveFile.newUpload(method, data3.data.contractInfoList, 'cwWorkContract', null, null, null, null, false)
                   } else {
+                    this.$refs.archiveFile.clearUpload()
                     // this.$refs.uploadFile.clearUpload()
                     // this.$refs.uploadFile.newUpload(method, data3.data.contractProperList, 'cwWorkContract', null, null, null, null, false)
                     this.$refs.archiveFile.newUpload(method, data3.data.contractInfoList, 'cwWorkContract', null, null, null, null, false)
@@ -507,9 +512,16 @@
                 })
               })
             } else {
-                // console.log('进来了22')
+              console.log('进来了22')
+              console.log('this.inputForm.filedType', this.inputForm.filedType)
               this.$refs.uploadFile.clearUpload()
-              this.$refs.uploadFile.newUpload('view', data1.data.contractProperList, 'cwWorkContract', null, null, null, null, false)
+              this.$refs.archiveFile.clearUpload()
+              if (this.inputForm.filedType === undefined) {
+                this.$refs.archiveFile.newUpload('view', data1.data.contractInfoList, 'cwWorkContract', null, null, null, null, false)
+              } else {
+                this.$refs.archiveFile.newUpload(method, data1.data.contractInfoList, 'cwWorkContract', null, null, null, null, false)
+              }
+              this.$refs.uploadFile.newUpload(method, data1.data.contractProperList, 'cwWorkContract', null, null, null, null, false)
               this.saveData(data1.data, method)
               if (this.formReadOnly) {
                 method = 'view'
@@ -607,14 +619,14 @@
         // 合同登记归档暂存
         if (this.status === 'startAndHoldFiled') {
           this.inputForm.filedType = '1'
-          this.inputForm.contractInfoId = this.businessId
+          // this.inputForm.contractInfoId = this.businessId
           this.inputForm.contractInfoList = this.$refs.archiveFile.getDataList()
           // this.inputForm.contractInfoList = this.$refs.uploadFile.getDataList()
           this.contractFileService.save(this.inputForm)
         }
         this.$refs.inputForm.resetFields()
         this.loading = false
-        this.businessId = ''
+        // this.businessId = ''
         callback()
       },
       // 送审