|
@@ -779,6 +779,7 @@ import {
|
|
|
deleteSettlementUnit,
|
|
|
} from "@/api/system/SaleRegistrationCollection";
|
|
|
import moment from "moment";
|
|
|
+import { mapState } from "vuex";
|
|
|
|
|
|
export default {
|
|
|
name: "saleAccountsReceivableDetail",
|
|
@@ -904,6 +905,12 @@ export default {
|
|
|
if (!this.settleTableData.length) return false;
|
|
|
return this.settleTableData.some((item) => !item.id);
|
|
|
},
|
|
|
+ ...mapState({
|
|
|
+ username: (state) => state.user.name,
|
|
|
+ owner: (state) => state.user?.tenant.owner,
|
|
|
+ tenantName: (state) => state.user?.tenant.tenantName,
|
|
|
+ nickName: (state) => state.user?.nickName,
|
|
|
+ }),
|
|
|
},
|
|
|
methods: {
|
|
|
// 确认开票
|
|
@@ -1050,14 +1057,25 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 新增开票
|
|
|
- addBilling() {
|
|
|
+ addBilling(row) {
|
|
|
this.resetBillingForm();
|
|
|
+ // let {} = row;
|
|
|
+ this.billingForm.customerId = row.customerId;
|
|
|
+ this.billingForm.invoiceType =
|
|
|
+ this.dict.type?.finished_product_invoice_type[0]?.value;
|
|
|
+ this.billingForm.personInCharge = this.nickName;
|
|
|
+ this.billingForm.settlementUnitId = row.settlementUnit;
|
|
|
+ this.billingForm.billingAmount = row.receivedAmount;
|
|
|
+ if (this.billingForm.customerId) {
|
|
|
+ this.getSettlementUnitList();
|
|
|
+ }
|
|
|
+
|
|
|
this.billingVisible = true;
|
|
|
},
|
|
|
resetBillingForm() {
|
|
|
this.billingForm = {
|
|
|
id: null,
|
|
|
- invoiceDate: null,
|
|
|
+ invoiceDate: new Date(),
|
|
|
customerId: null,
|
|
|
settlementUnitId: null,
|
|
|
invoiceNumber: null,
|
|
@@ -1081,7 +1099,7 @@ export default {
|
|
|
if (billingFlag == 1) {
|
|
|
//开票
|
|
|
this.currentRow = row;
|
|
|
- this.addBilling();
|
|
|
+ this.addBilling(row);
|
|
|
} else {
|
|
|
this.$confirm("是否确认取消开票?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
@@ -1096,6 +1114,7 @@ export default {
|
|
|
billingFlag: 0,
|
|
|
};
|
|
|
let res = await cancelBilling(payload);
|
|
|
+ console.log(res);
|
|
|
if (res.code == 200) {
|
|
|
this.$message({
|
|
|
message: "取消开票成功",
|
|
@@ -1111,10 +1130,10 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
.catch(() => {
|
|
|
- this.$message({
|
|
|
- type: "info",
|
|
|
- message: "已取消",
|
|
|
- });
|
|
|
+ // this.$message({
|
|
|
+ // type: "info",
|
|
|
+ // message: "已取消",
|
|
|
+ // });
|
|
|
this.getList();
|
|
|
});
|
|
|
}
|