Selaa lähdekoodia

OMS发票信息代码上传

huangguoce 2 kuukautta sitten
vanhempi
commit
93914884ef

+ 24 - 0
src/api/cw/invoice/CwFinanceInvoiceService.js

@@ -173,4 +173,28 @@ export default {
 			data: data,
 		});
 	},
+	downLoadOMSInvoiceAttachzip(fileUrl) {
+		return request({
+			url: prefix + "/cw_finance/invoice/downLoadOMSInvoiceAttachzip",
+			method: "get",
+			params: { fileUrl: fileUrl },
+			responseType: "blob",
+		});
+	},
+
+	invoiceOMSView(invoiceId) {
+		return request({
+			url: prefix + "/cw_finance/invoice/invoiceOMSView",
+			method: "get",
+			params: { invoiceId: invoiceId },
+		});
+	},
+
+	invoiceFastRedOMSView(params) {
+		return request({
+			url: prefix + "/cw_finance/invoice/invoiceFastRedOMSView",
+			method: "get",
+			params: params,
+		});
+	},
 };

+ 15 - 0
src/views/cw/invoice/InvoiceFormTask.vue

@@ -1517,6 +1517,21 @@ export default {
 								this.inputForm.title = `${this.$store.state.user.name} 发起了 ${data.no} [财务-发票申请]`
 							}
 						}
+						// 触发开票接口
+						if (this.inputForm.status === '5') {
+							// 区分红票,蓝票
+							if (this.inputForm.redInvoiceFlag === '1') {
+								let params = {
+									allEinvno: this.inputForm.invoiceNumberStr,
+									workInvoiceId: this.inputForm.id
+								}
+								financeInvoiceService.invoiceFastRedOMSView(params)
+							}
+							if (this.inputForm.redInvoiceFlag === '0') {
+								financeInvoiceService.invoiceOMSView(this.inputForm.id)
+							}
+						}
+
 						this.inputForm.id = data.businessId
 						callback(data.businessTable, data.businessId, this.inputForm, data.recordType)
 						this.loading = false

+ 21 - 0
src/views/cw/invoice/InvoiceList.vue

@@ -235,6 +235,8 @@
 
               </div>
               <div v-else>
+
+                <el-button text type="primary" @click="handleDownloadAllInvoice(scope.row)">下载所有格式发票</el-button>
                 <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>
@@ -1136,6 +1138,25 @@ export default {
         })
       })
     },
+    handleDownloadAllInvoice(row) {
+      this.$confirm(`确定下载当前全部发票文件吗?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.loading = true
+        financeInvoiceService.downLoadOMSInvoiceAttachzip(row.omsAttachmentUrl).then((res) => {
+          // 将二进制流文件写入excel表,以下为重要步骤
+          this.$utils.downloadZip(res, '发票文件')
+          this.loading = false
+        }).catch(function (err) {
+          this.loading = false
+          if (err.response) {
+            console.log(err.response)
+          }
+        })
+      })
+    }
   }
 }
 </script>