|
@@ -282,29 +282,17 @@ export default {
|
|
|
this.$message.warning('无数据')
|
|
|
return
|
|
|
}
|
|
|
- const returnList = this.batchInvoiceData.filter(x => !x.invoiceEmail || !x.invoicePhone ||
|
|
|
- !x.invoiceHeaderId || !x.invoiceContent || !x.invoiceType || !x.invoiceSellerBank || !x.invoiceTax)
|
|
|
- const passList = this.batchInvoiceData.filter(x => x.invoiceEmail &&
|
|
|
- x.invoiceHeaderId && x.invoiceContent && x.invoiceType && x.invoiceSellerBank && x.invoiceTax)
|
|
|
- if (!passList.length) {
|
|
|
- this.$message.warning('无符合提交条件的数据,请确认发票发送邮箱是否为空')
|
|
|
- return
|
|
|
- }
|
|
|
this.$confirm('是否确定提交?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
this.loading = true
|
|
|
- this.baseRequest('batchInvoice', { data: JSON.stringify(passList) }).then(res => {
|
|
|
+ this.baseArrRequest('batchSendInvoice', this.batchInvoiceData, true).then(res => {
|
|
|
this.loading = false
|
|
|
if (res.data.key === 200) {
|
|
|
this.$message.success('提交成功')
|
|
|
- if (returnList.length) {
|
|
|
- this.batchInvoiceData = returnList
|
|
|
- } else {
|
|
|
- this.$emit('editClose', true)
|
|
|
- }
|
|
|
+ this.$emit('editClose', true)
|
|
|
} else if (res.data.key === 504) {
|
|
|
this.$message.error(res.data.msg)
|
|
|
this.$emit('editClose', true)
|
|
@@ -339,6 +327,9 @@ export default {
|
|
|
},
|
|
|
baseRequest(opUrl, postData) {
|
|
|
return this.$channel.globeRequest('InvoiceManageController', opUrl, postData, 'project')
|
|
|
+ },
|
|
|
+ baseArrRequest(opUrl, postData, isArr) {
|
|
|
+ return this.$channel.globeRequest('InvoiceManageController', opUrl, postData, 'project', isArr)
|
|
|
}
|
|
|
}
|
|
|
}
|