|
@@ -403,10 +403,16 @@
|
|
|
:loading="saveLoading" @click="editHandle">一键编辑
|
|
|
</el-button>
|
|
|
<el-button size="small" type="primary" style="margin-right: 8px" :disabled="editSave"
|
|
|
- :loading="saveLoading" @click="Confirminvoicefun">禁止开票
|
|
|
+ :loading="saveLoading" @click="Confirminvoicefun('2')">不开发票
|
|
|
</el-button>
|
|
|
<el-button size="small" type="warning" style="margin-right: 8px" :disabled="editSave"
|
|
|
- :loading="saveLoading" @click="Notinvoicingfun">取消禁止开票
|
|
|
+ :loading="saveLoading" @click="Notinvoicingfun('2')">取消不开发票
|
|
|
+ </el-button>
|
|
|
+ <el-button size="small" type="primary" style="margin-right: 8px" :disabled="editSave"
|
|
|
+ :loading="saveLoading" @click="Confirminvoicefun('1')">确认开票
|
|
|
+ </el-button>
|
|
|
+ <el-button size="small" type="warning" style="margin-right: 8px" :disabled="editSave"
|
|
|
+ :loading="saveLoading" @click="Notinvoicingfun('1')">撤销开票
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -854,15 +860,15 @@ export default {
|
|
|
this.tableData = this.form.finStlBillsItemsList.map(item => {
|
|
|
if (item.curCode == 'CNY') {
|
|
|
this.$set(item, 'amountRMB', item.amount)
|
|
|
- this.$set(item, 'currentInvoiceAmountRMB', Number(item.currentInvoiceAmount?item.currentInvoiceAmount:0))
|
|
|
- this.$set(item, 'unsettledAmountRMB', Number(item.unsettledAmount?item.unsettledAmount:0))
|
|
|
- this.$set(item, 'currentStlAmountRMB', Number(item.currentStlAmount?item.currentStlAmount:0))
|
|
|
+ this.$set(item, 'currentInvoiceAmountRMB', Number(item.currentInvoiceAmount ? item.currentInvoiceAmount : 0))
|
|
|
+ this.$set(item, 'unsettledAmountRMB', Number(item.unsettledAmount ? item.unsettledAmount : 0))
|
|
|
+ this.$set(item, 'currentStlAmountRMB', Number(item.currentStlAmount ? item.currentStlAmount : 0))
|
|
|
this.$set(item, 'currentStlAmountUSD', Number(0))
|
|
|
} else {
|
|
|
this.$set(item, 'amountUSD', item.amount)
|
|
|
this.$set(item, 'currentInvoiceAmountUSD', item.currentInvoiceAmount)
|
|
|
- this.$set(item, 'unsettledAmountUSD', Number(item.unsettledAmount?item.unsettledAmount:0))
|
|
|
- this.$set(item, 'currentStlAmountUSD', Number(item.currentStlAmount?item.currentStlAmount:0))
|
|
|
+ this.$set(item, 'unsettledAmountUSD', Number(item.unsettledAmount ? item.unsettledAmount : 0))
|
|
|
+ this.$set(item, 'currentStlAmountUSD', Number(item.currentStlAmount ? item.currentStlAmount : 0))
|
|
|
this.$set(item, 'currentStlAmountRMB', Number(0))
|
|
|
}
|
|
|
this.$set(item, 'costDate', [])
|
|
@@ -1004,15 +1010,15 @@ export default {
|
|
|
item.dc = item.accountDc // 收付
|
|
|
if (item.curCode == 'CNY') {
|
|
|
this.$set(item, 'amountRMB', item.amount)
|
|
|
- this.$set(item, 'currentInvoiceAmountRMB',Number(item.currentInvoiceAmount?item.currentInvoiceAmount:0) )
|
|
|
- this.$set(item, 'unsettledAmountRMB', Number(item.unsettledAmount?item.unsettledAmount:0))
|
|
|
- this.$set(item, 'currentStlAmountRMB', Number(item.reconciliationCurrentAmount?item.reconciliationCurrentAmount:0))
|
|
|
+ this.$set(item, 'currentInvoiceAmountRMB', Number(item.currentInvoiceAmount ? item.currentInvoiceAmount : 0))
|
|
|
+ this.$set(item, 'unsettledAmountRMB', Number(item.unsettledAmount ? item.unsettledAmount : 0))
|
|
|
+ this.$set(item, 'currentStlAmountRMB', Number(item.reconciliationCurrentAmount ? item.reconciliationCurrentAmount : 0))
|
|
|
this.$set(item, 'currentStlAmountUSD', Number(0))
|
|
|
} else {
|
|
|
this.$set(item, 'amountUSD', item.amount)
|
|
|
- this.$set(item, 'currentInvoiceAmountUSD', Number(item.currentInvoiceAmount?item.currentInvoiceAmount:0))
|
|
|
- this.$set(item, 'unsettledAmountUSD', Number(item.unsettledAmount?item.unsettledAmount:0))
|
|
|
- this.$set(item, 'currentStlAmountUSD', Number(item.reconciliationCurrentAmount?item.reconciliationCurrentAmount:0))
|
|
|
+ this.$set(item, 'currentInvoiceAmountUSD', Number(item.currentInvoiceAmount ? item.currentInvoiceAmount : 0))
|
|
|
+ this.$set(item, 'unsettledAmountUSD', Number(item.unsettledAmount ? item.unsettledAmount : 0))
|
|
|
+ this.$set(item, 'currentStlAmountUSD', Number(item.reconciliationCurrentAmount ? item.reconciliationCurrentAmount : 0))
|
|
|
this.$set(item, 'currentStlAmountRMB', Number(0))
|
|
|
}
|
|
|
return item
|
|
@@ -1023,14 +1029,20 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
// 确认发票
|
|
|
- Confirminvoicefun() {
|
|
|
+ Confirminvoicefun(type) {
|
|
|
if (this.handleSelectionData.length === 0) {
|
|
|
this.$message.warning("请选择至少一条数据");
|
|
|
return;
|
|
|
}
|
|
|
for (let item of this.handleSelectionData) {
|
|
|
if (item.isInvoice == 3) {
|
|
|
- this.$message.error('已禁止开票,请重新选择');
|
|
|
+ this.$message.error('已不开发票,请重新选择');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (let item of this.handleSelectionData) {
|
|
|
+ if (item.isInvoice == 2) {
|
|
|
+ this.$message.error('已确认开票,请重新选择');
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
@@ -1039,19 +1051,37 @@ export default {
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
|
- this.finstlbillsConfirmInvoicingfun()
|
|
|
+ this.finstlbillsConfirmInvoicingfun(type)
|
|
|
})
|
|
|
},
|
|
|
// 不开发票
|
|
|
- Notinvoicingfun() {
|
|
|
+ Notinvoicingfun(type) {
|
|
|
if (this.handleSelectionData.length === 0) {
|
|
|
this.$message.warning("请选择至少一条数据");
|
|
|
return;
|
|
|
}
|
|
|
- for (let item of this.handleSelectionData) {
|
|
|
- if (item.isInvoice == 0) {
|
|
|
- this.$message.error('已开票,请重新选择');
|
|
|
- return;
|
|
|
+ if (type == 1) {
|
|
|
+ for (let item of this.handleSelectionData) {
|
|
|
+ if (item.isInvoice == 1) {
|
|
|
+ this.$message.error('未确认开票,请重新选择');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (item.isInvoice == 3) {
|
|
|
+ this.$message.error('已不开发票,请重新选择');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (type == 2) {
|
|
|
+ for (let item of this.handleSelectionData) {
|
|
|
+ if (item.isInvoice == 1) {
|
|
|
+ this.$message.error('未不开发票,请重新选择');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (item.isInvoice == 2) {
|
|
|
+ this.$message.error('已确认开票,请重新选择');
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
this.$confirm("确定将选择数据撤销签收?", {
|
|
@@ -1063,7 +1093,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
// 确认发票接口
|
|
|
- finstlbillsConfirmInvoicingfun() {
|
|
|
+ finstlbillsConfirmInvoicingfun(type) {
|
|
|
this.form.billNoFormat = 'HYDZ'
|
|
|
this.form.businessTypeCode = 'HYDZ'
|
|
|
this.form.businessType = 'CHK' //对账单
|
|
@@ -1078,8 +1108,12 @@ export default {
|
|
|
this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + ' 00:00:00' : null
|
|
|
// 保留id
|
|
|
this.form.finStlBillsItemsList = this.handleSelectionData
|
|
|
+ let obj = {
|
|
|
+ ...this.form,
|
|
|
+ type: type
|
|
|
+ }
|
|
|
this.pageLoading = true
|
|
|
- finstlbillsConfirmInvoicing(this.form).then(res => {
|
|
|
+ finstlbillsConfirmInvoicing(obj).then(res => {
|
|
|
this.$message.success('操作成功');
|
|
|
this.finstlbillsDetailfun(res.data.data.id)
|
|
|
}).finally(() => {
|
|
@@ -1210,6 +1244,18 @@ export default {
|
|
|
if (this.handleSelectionData.length == 0) {
|
|
|
return this.$message.warning('请选择要删除的数据')
|
|
|
}
|
|
|
+ for (let item of this.handleSelectionData) {
|
|
|
+ if (item.isInvoice == 3) {
|
|
|
+ this.$message.error('已不开发票,请重新选择');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (let item of this.handleSelectionData) {
|
|
|
+ if (item.isInvoice == 2) {
|
|
|
+ this.$message.error('已确认开票,请重新选择');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
this.$confirm("确定将选择数据删除?", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
@@ -1230,6 +1276,7 @@ export default {
|
|
|
if (itemsWithId.length != 0) {
|
|
|
finstlbillsitemsRemove(arrIds.join(',')).then(res => {
|
|
|
this.$message.success('操作成功')
|
|
|
+ this.finstlbillsDetailfun(this.form.id)
|
|
|
})
|
|
|
}
|
|
|
})
|