Browse Source

评估和会计-发票红冲

huangguoce 1 week ago
parent
commit
2dc4d64a21

+ 29 - 2
src/views/cw/invoice/InvoiceFormTask.vue

@@ -1032,6 +1032,11 @@ export default {
 					this.userEmail = data.email
 
 				});
+				let redInvoice = "0"
+				if (this.$route.query.redInvoice == 1) {
+					this.inputForm.id = this.$route.query.dataId
+					redInvoice = this.$route.query.redInvoice
+				}
 				this.$refs.inputForm.resetFields()
 				this.loading = true
 				financeInvoiceService.queryById(this.inputForm.id).then((data) => {
@@ -1157,6 +1162,30 @@ export default {
 					}
 					this.$refs.uploadComponent.newUpload(method, this.inputForm.workAttachmentDtoList, 'invoice')
 					this.$refs.uploadComponentSignContract.newUpload(method, this.inputForm.workAttachmenSignContract, 'signContract')
+
+
+					//针对红冲处理
+					if (redInvoice == "1") {
+						console.log("红冲处理")
+						this.inputForm.redInvoiceRelevancyId = this.inputForm.id
+						this.inputForm.redInvoiceRelevancyNumber = this.inputForm.no
+						this.inputForm.invoiceNumberStr = this.inputForm.financeInvoiceDetailDTOList[0].number
+						// 恢复
+						this.inputForm.financeInvoiceBaseDTOList[0].id = ""
+						this.inputForm.id = ''
+						this.$nextTick(() => {
+							this.inputForm.redInvoiceFlag = '1';
+							this.inputForm.accountTotal = -Math.abs(this.inputForm.accountTotal);
+						})
+						this.inputForm.financeInvoiceDetailDTOList = []
+						this.inputForm.no = ""
+						this.inputForm.billingPeople = ""
+						this.inputForm.billingPeopleId = this.$store.state.user.id
+						this.inputForm.procInsId = ""
+						this.inputForm.processDefinitionId = ""
+						this.inputForm.billingDate = ""
+						this.inputForm.collectDate = ""
+					}
 					this.loading = false
 				})
 			})
@@ -1247,7 +1276,6 @@ export default {
 			}
 
 			this.inputForm.account = this.inputForm.accountTotal
-			console.log(this.inputForm.account)
 			if (status === 'save') {
 				// 暂存
 				this.loading = true
@@ -1500,7 +1528,6 @@ export default {
 			}
 			if (type === 'detail') {
 				this.$refs.detailTable.insert().then((data) => {
-					console.log(this.inputForm.accountTotal)
 					data.account = this.inputForm.accountTotal
 					this.inputForm.financeInvoiceDetailDTOList.push(data)
 					this.detailKey = Math.random()

+ 34 - 1
src/views/cw/invoice/InvoiceList.vue

@@ -232,9 +232,13 @@
                   @click="editForm(scope.row.id)">修改</el-button>
                 <el-button v-if="(scope.row.status === '5')" text type="primary"
                   @click="del(scope.row.id)">删除</el-button>
+
               </div>
               <div v-else>
                 <el-button
+                  v-if="hasPermission('cw_finance:invoice:add') && scope.row.status === '5' && scope.row.account > 0"
+                  text type="primary" @click="handleRedInvoice(scope.row)">红冲</el-button>
+                <el-button
                   v-if="hasPermission('cw_finance:invoice:edit') && scope.row.createBy.id === $store.state.user.id && (scope.row.status === '1' || scope.row.status === '3')"
                   text type="primary" @click="invoicePush(scope.row)">修改</el-button>
                 <el-button
@@ -1102,7 +1106,36 @@ export default {
         .catch(() => {
 
         })
-    }
+    },
+    // 发起评估-发票申请审批(红冲调用)
+    handleRedInvoice(row) {
+      // 读取流程表单
+      let tabTitle = `发起流程【会计-发票申请】`
+      let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [会计-发票申请]`
+      taskService.getTaskDef({
+        procDefId: this.processDefinitionId,
+        status: 'startAndHold'
+      }).then((data) => {
+        this.$router.push({
+          path: '/flowable/task/TaskForm',
+          query: {
+            ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
+            procDefId: this.processDefinitionId,
+            procDefKey: this.procDefKey,
+            status: 'startAndHold',
+            title: tabTitle,
+            formType: data.formType,
+            formUrl: data.formUrl,
+            formTitle: processTitle,
+            businessId: 'false',
+            isShow: false,
+            routePath: '/cw/invoice/InvoiceList',
+            redInvoice: "1",
+            dataId: row.id
+          }
+        })
+      })
+    },
   }
 }
 </script>

+ 26 - 1
src/views/finance/invoice/InvoiceFormTask.vue

@@ -860,6 +860,11 @@ export default {
           this.userEmail = data.email
 
         });
+        let redInvoice = "0"
+        if (this.$route.query.redInvoice == 1) {
+          this.inputForm.id = this.$route.query.dataId
+          redInvoice = this.$route.query.redInvoice
+        }
         this.$refs.inputForm.resetFields()
         this.loading = true
         this.financeInvoiceService.queryById(this.inputForm.id).then(async (data) => {
@@ -934,8 +939,28 @@ export default {
               allAmount: ''
             })
           }
-          console.log('data', this.inputForm)
+
           this.$refs.uploadComponent.newUpload(method, this.inputForm.workAttachmentDtoList, 'invoice')
+
+          //针对红冲处理
+          if (redInvoice == "1") {
+            this.inputForm.redInvoiceRelevancyId = this.inputForm.id
+            this.inputForm.redInvoiceRelevancyNumber = this.inputForm.no
+            this.inputForm.invoiceNumberStr = this.inputForm.financeInvoiceDetailDTOList[0].number
+            // 恢复
+            this.inputForm.financeInvoiceBaseDTOList[0].id = ""
+            this.inputForm.id = ''
+            this.inputForm.redInvoiceFlag = '1';
+            this.inputForm.account = -Math.abs(this.inputForm.account);
+            this.inputForm.financeInvoiceDetailDTOList = []
+            this.inputForm.no = ""
+            this.inputForm.billingPeople = ""
+            this.inputForm.billingPeopleId = this.$store.state.user.id
+            this.inputForm.procInsId = ""
+            this.inputForm.processDefinitionId = ""
+            this.inputForm.billingDate = ""
+            this.inputForm.collectDate = ""
+          }
           this.loading = false
         })
       })

File diff suppressed because it is too large
+ 748 - 761
src/views/finance/invoice/InvoiceList.vue