|
|
@@ -20,7 +20,7 @@
|
|
|
<el-form-item label="会计科目:" prop="accountingSubjectId">
|
|
|
<ele-tree-select
|
|
|
clearable
|
|
|
- :disabled="isDetail"
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
filterable
|
|
|
ref="treeSelect"
|
|
|
:data="accountingSubjectList"
|
|
|
@@ -36,11 +36,11 @@
|
|
|
<el-col :span="8">
|
|
|
<el-form-item
|
|
|
label="应收日期"
|
|
|
- prop="date"
|
|
|
+ prop="receivableDate"
|
|
|
>
|
|
|
<el-date-picker
|
|
|
:disabled="dialogType == 'view'"
|
|
|
- v-model="dataForm.date"
|
|
|
+ v-model="dataForm.receivableDate"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
type="date"
|
|
|
style="width: 100%"
|
|
|
@@ -49,8 +49,8 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item prop="receivablePrice" label="应收金额">
|
|
|
- <el-input disabled v-model="dataForm.receivablePrice"></el-input>
|
|
|
+ <el-form-item prop="receivableTotalPrice" label="应收金额">
|
|
|
+ <el-input :disabled="dialogType == 'view'" v-model="dataForm.receivableTotalPrice"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -66,62 +66,59 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item prop="createUserName" label="发票种类">
|
|
|
+ <el-form-item prop="category" label="发票种类">
|
|
|
<el-select
|
|
|
- :disabled="dialogType == 'view' || !!saleOrderData?.id"
|
|
|
+ :disabled="true"
|
|
|
clearable
|
|
|
class="ele-block"
|
|
|
- v-model="dataForm.sourceType"
|
|
|
+ v-model="dataForm.category"
|
|
|
placeholder="请选择"
|
|
|
>
|
|
|
- <el-option label="客户" :value="1" />
|
|
|
- <!-- <el-option label="项目" :value="2"/>-->
|
|
|
- <!-- <el-option label="合同" :value="4" /> -->
|
|
|
-
|
|
|
- <el-option label="销售订单" :value="3" />
|
|
|
+ <el-option label="增值税专用发票" :value="1"></el-option>
|
|
|
+ <el-option label="增值税普通发票" :value="2"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item prop="createUserName" label="公司名称">
|
|
|
- <el-input disabled v-model="dataForm.price"></el-input>
|
|
|
+ <el-form-item prop="contactName" label="公司名称">
|
|
|
+ <el-input disabled v-model="dataForm.contactName"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="来源类型" prop="sourceType">
|
|
|
<el-select
|
|
|
- :disabled="dialogType == 'view' || !!saleOrderData?.id"
|
|
|
+ :disabled="true"
|
|
|
clearable
|
|
|
class="ele-block"
|
|
|
v-model="dataForm.sourceType"
|
|
|
placeholder="请选择"
|
|
|
>
|
|
|
- <el-option label="客户" :value="1" />
|
|
|
+ <el-option label="采购订单" :value="2" />
|
|
|
<!-- <el-option label="项目" :value="2"/>-->
|
|
|
<!-- <el-option label="合同" :value="4" /> -->
|
|
|
|
|
|
- <el-option label="销售订单" :value="3" />
|
|
|
+ <el-option label="销售订单" :value="1" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item prop="createUserName" label="来源编码">
|
|
|
- <el-input disabled v-model="dataForm.price"></el-input>
|
|
|
+ <el-form-item prop="sourceCode" label="来源编码">
|
|
|
+ <el-input disabled v-model="dataForm.sourceCode"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item prop="createTime" label="备注">
|
|
|
- <el-input disabled v-model="dataForm.createTime"></el-input>
|
|
|
+ <el-form-item prop="remark" label="备注">
|
|
|
+ <el-input :disabled="dialogType == 'view'" v-model="dataForm.remark"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item prop="repliedFiles" label="附件">
|
|
|
- <fileMain v-model="dataForm.repliedFiles" type="view"></fileMain>
|
|
|
+ <el-form-item prop="files" label="附件">
|
|
|
+ <fileMain v-model="dataForm.files" :type="dialogType == 'view' ? 'view' : 'add'"></fileMain>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -131,38 +128,16 @@
|
|
|
<receivable-info
|
|
|
:dataForm.sync="dataForm"
|
|
|
:receivableList.sync="receivableList"
|
|
|
- :dialogType="dialogType"
|
|
|
+ dialogType="view"
|
|
|
@addAdvanceReceipt="addAdvanceReceipt"
|
|
|
ref="receivableInfoRef"
|
|
|
></receivable-info>
|
|
|
|
|
|
- <headerTitle title="对账明细" style="margin-top: 30px">
|
|
|
- <!-- <template v-slot>
|
|
|
- <el-row style="font-weight: 700; color: red">
|
|
|
- <span>订单总金额:</span>
|
|
|
- <span>{{ isNonDirectionalSale ? '--' : dataForm.orderTotalAmount || 0 }}</span>
|
|
|
- <el-divider direction="vertical"></el-divider>
|
|
|
- <span>已对账金额:</span>
|
|
|
- <span>{{ dataForm.amountCompletePrice || 0 }}</span>
|
|
|
- <el-divider direction="vertical"></el-divider>
|
|
|
- <span>未对账金额:</span>
|
|
|
- <span>{{ dataForm.amountUnCompletePrice || 0 }}</span>
|
|
|
- <el-divider direction="vertical"></el-divider>
|
|
|
- <span>本次对账总金额:</span>
|
|
|
- <span>{{ dataForm.amountTotalPrice || 0 }}</span>
|
|
|
- </el-row>
|
|
|
- </template> -->
|
|
|
- </headerTitle>
|
|
|
- <!-- <recorpayTableList
|
|
|
- ref="recorpayListRef"
|
|
|
- :dataForm="dataForm"
|
|
|
- :recorpayList.sync="recorpayList"
|
|
|
- :dialogType="dialogType"
|
|
|
- ></recorpayTableList> -->
|
|
|
+ <headerTitle title="对账明细" style="margin-top: 30px"></headerTitle>
|
|
|
<account-detail-table
|
|
|
ref="accountDetailTableRef"
|
|
|
:datasource.sync="datasource"
|
|
|
- :dialogType="dialogType"
|
|
|
+ dialogType="view"
|
|
|
:queryDimension="dataForm.queryDimension"
|
|
|
@totalChange="handleTotalChange"
|
|
|
@countChange="handleCountChange"
|
|
|
@@ -214,6 +189,7 @@
|
|
|
accountstatementInfoAPI,
|
|
|
accountstatementUpdateAPI
|
|
|
} from '@/api/saleManage/accountstatement';
|
|
|
+ import { getFinReceivableInitInfoAPI, getFinReceivableInfoAPI, saveReceivableAPI, updateReceivableAPI } from '@/api/financialManage/receivableManage';
|
|
|
import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
|
|
|
import { paymentTypeOp } from '@/enum/dict';
|
|
|
import { getTreeByPid } from '@/api/classifyManage';
|
|
|
@@ -257,7 +233,11 @@
|
|
|
receivableList: [],
|
|
|
accountingSubjectList: [],
|
|
|
isDetail: false,
|
|
|
+ statReceipt: null,
|
|
|
dataForm: {
|
|
|
+ accountingSubjectId: '',
|
|
|
+ accountingSubjectCode: '',
|
|
|
+ accountingSubjectName: '',
|
|
|
sourceType: 1,
|
|
|
dateType: 1,
|
|
|
queryDimension: 1,
|
|
|
@@ -286,26 +266,29 @@
|
|
|
totalReceivableAmount: 0
|
|
|
},
|
|
|
rules: {
|
|
|
- sourceType: { required: true, message: '请选择', trigger: 'change' },
|
|
|
- contactId: { required: true, message: '请选择', trigger: 'change' },
|
|
|
- projectId: { required: true, message: '请选择', trigger: 'change' },
|
|
|
- orderId: { required: true, message: '请选择', trigger: 'change' },
|
|
|
- dateType: { required: true, message: '请选择', trigger: 'change' },
|
|
|
- year: { required: true, message: '请选择', trigger: 'change' },
|
|
|
- quarter: { required: true, message: '请选择', trigger: 'change' },
|
|
|
- month: { required: true, message: '请选择', trigger: 'change' },
|
|
|
- dateTimeRange: {
|
|
|
- required: true,
|
|
|
- message: '请选择',
|
|
|
- trigger: 'change'
|
|
|
- },
|
|
|
- sourceId: { required: true, message: '请选择', trigger: 'change' },
|
|
|
- contractId: { required: true, message: '请选择', trigger: 'change' },
|
|
|
- queryDimension: {
|
|
|
- required: true,
|
|
|
- message: '请选择',
|
|
|
- trigger: 'change'
|
|
|
- }
|
|
|
+ accountingSubjectId: { required: true, message: '请选择', trigger: 'change' },
|
|
|
+ receivableDate: { required: true, message: '请选择', trigger: 'change' },
|
|
|
+ receivableTotalPrice: { required: true, message: '请输入', trigger: 'change' },
|
|
|
+ // sourceType: { required: true, message: '请选择', trigger: 'change' },
|
|
|
+ // contactId: { required: true, message: '请选择', trigger: 'change' },
|
|
|
+ // projectId: { required: true, message: '请选择', trigger: 'change' },
|
|
|
+ // orderId: { required: true, message: '请选择', trigger: 'change' },
|
|
|
+ // dateType: { required: true, message: '请选择', trigger: 'change' },
|
|
|
+ // year: { required: true, message: '请选择', trigger: 'change' },
|
|
|
+ // quarter: { required: true, message: '请选择', trigger: 'change' },
|
|
|
+ // month: { required: true, message: '请选择', trigger: 'change' },
|
|
|
+ // dateTimeRange: {
|
|
|
+ // required: true,
|
|
|
+ // message: '请选择',
|
|
|
+ // trigger: 'change'
|
|
|
+ // },
|
|
|
+ // sourceId: { required: true, message: '请选择', trigger: 'change' },
|
|
|
+ // contractId: { required: true, message: '请选择', trigger: 'change' },
|
|
|
+ // queryDimension: {
|
|
|
+ // required: true,
|
|
|
+ // message: '请选择',
|
|
|
+ // trigger: 'change'
|
|
|
+ // }
|
|
|
},
|
|
|
title: '',
|
|
|
processSubmitDialogFlag: false,
|
|
|
@@ -314,9 +297,9 @@
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- isNonDirectionalSale() {
|
|
|
- return this.datasource.some((item) => item.orderCategory == 4);
|
|
|
- }
|
|
|
+ // isNonDirectionalSale() {
|
|
|
+ // return this.datasource.some((item) => item.orderCategory == 4);
|
|
|
+ // }
|
|
|
},
|
|
|
methods: {
|
|
|
changeSubjectInfo(val) {
|
|
|
@@ -364,95 +347,133 @@
|
|
|
: dialogType == 'update'
|
|
|
? '修改'
|
|
|
: '详情';
|
|
|
- this.dataForm.type = type;
|
|
|
+ // this.dataForm.type = type;
|
|
|
await this.getClassifyList(24, 'accountingSubjectList');
|
|
|
- this.$nextTick(() => {
|
|
|
- if (this.contactData.id) {
|
|
|
- this.$refs.saleFormRef.getCusInfo(this.contactData);
|
|
|
- }
|
|
|
- if (this.saleOrderData.id) {
|
|
|
- this.$refs.saleFormRef.getOrderInfo(this.saleOrderData);
|
|
|
- }
|
|
|
- });
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // if (this.contactData.id) {
|
|
|
+ // this.$refs.saleFormRef.getCusInfo(this.contactData);
|
|
|
+ // }
|
|
|
+ // if (this.saleOrderData.id) {
|
|
|
+ // this.$refs.saleFormRef.getOrderInfo(this.saleOrderData);
|
|
|
+ // }
|
|
|
+ // });
|
|
|
if (this.dialogType !== 'add') {
|
|
|
this.businessId = row.id;
|
|
|
this.getInfo(row);
|
|
|
+ } else {
|
|
|
+ let data = await getFinReceivableInitInfoAPI({
|
|
|
+ statementId: row.id
|
|
|
+ });
|
|
|
+
|
|
|
+ this.dataForm = {
|
|
|
+ ...this.dataForm,
|
|
|
+ ...data
|
|
|
+ };
|
|
|
+
|
|
|
+ this.statReceipt = data.statReceipt || null;
|
|
|
+
|
|
|
+ this.receivableList =
|
|
|
+ (data.statReceipt && data.statReceipt.statReceiptDetailList) || [];
|
|
|
+
|
|
|
+ this.datasource = data.productList || [];
|
|
|
+
|
|
|
+
|
|
|
+ console.log('data~~~~~~~', data);
|
|
|
}
|
|
|
},
|
|
|
+ // 应收
|
|
|
+ // handleAddReceivable(type, row) {
|
|
|
+ // this.addReceivableDialogFlag = true;
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // this.$refs.addReceivableDialogRef.open(type, row);
|
|
|
+ // });
|
|
|
+ // },
|
|
|
//获取对账单详情
|
|
|
async getInfo(row) {
|
|
|
- let data = await accountstatementInfoAPI(row.id);
|
|
|
- console.log('data~~~', data);
|
|
|
- // this.recorpayList = data.recorpayList || [];
|
|
|
- // 解决小数精度丢失问题,使用分进行计算
|
|
|
- data.orderTotalAmount =
|
|
|
- data.orderList.reduce(
|
|
|
- (pre, cur) => pre + Math.round(+cur.orderAmount * 100),
|
|
|
- 0
|
|
|
- ) / 100;
|
|
|
- data.amountTotalPrice =
|
|
|
- data.orderList.reduce(
|
|
|
- (pre, cur) => pre + Math.round(+cur.statementAmount * 100),
|
|
|
- 0
|
|
|
- ) / 100;
|
|
|
- data.amountCompletePrice =
|
|
|
- data.orderList.reduce(
|
|
|
- (pre, cur) => pre + Math.round(+cur.statementedAmount * 100),
|
|
|
- 0
|
|
|
- ) / 100;
|
|
|
- data.amountUnCompletePrice =
|
|
|
- data.orderList.reduce(
|
|
|
- (pre, cur) => pre + Math.round(+cur.unStatementAmount * 100),
|
|
|
- 0
|
|
|
- ) / 100;
|
|
|
- data.orderList = data.orderList.map((item) => {
|
|
|
- item.deliveryProducts = item.deliveryProducts.map((i) => {
|
|
|
- return {
|
|
|
- ...i,
|
|
|
- taxRate: i.taxRate || 0,
|
|
|
- discountRatio: i.discountRatio || 100,
|
|
|
- singlePrice: i.singlePrice || 0,
|
|
|
- originalTotalCount: i.totalCount // 保存原始数量值用于校验
|
|
|
- };
|
|
|
- });
|
|
|
- return item;
|
|
|
- });
|
|
|
- this.datasource = data.orderList || [];
|
|
|
- this.receivableList = data.receivableList || [];
|
|
|
+ let data = await getFinReceivableInfoAPI(row.id);
|
|
|
+ console.log('getInfo~~~', data);
|
|
|
+
|
|
|
this.dataForm = {
|
|
|
...this.dataForm,
|
|
|
- ...data,
|
|
|
- fundType: data.fundType || 2,
|
|
|
- transactionMethod: data.transactionMethod || 1,
|
|
|
- collectionTerms: data.collectionTerms || '',
|
|
|
- receiptStatus: data.receiptStatus || 0,
|
|
|
- totalAdvanceConfirmAmount: data.totalAdvanceConfirmAmount || 0,
|
|
|
- totalReceivableAmount: data.totalReceivableAmount || 0
|
|
|
+ ...data
|
|
|
};
|
|
|
- switch (this.dataForm.dateType) {
|
|
|
- case 1:
|
|
|
- // this.dataForm.year = this.dataForm.dateValue;
|
|
|
- this.$set(this.dataForm, 'year', this.dataForm.dateValue);
|
|
|
- break;
|
|
|
- case 2: {
|
|
|
- //2023年-四季度
|
|
|
- let data = this.dataForm.dateValue.split('年-');
|
|
|
|
|
|
- this.$set(this.dataForm, 'year', data[0]);
|
|
|
- this.$set(this.dataForm, 'quarter', data[1]);
|
|
|
- break;
|
|
|
- }
|
|
|
- case 3:
|
|
|
- this.$set(this.dataForm, 'month', this.dataForm.dateValue);
|
|
|
+ this.statReceipt = data.statReceipt || null;
|
|
|
|
|
|
- break;
|
|
|
- default:
|
|
|
- this.dataForm.dateValue = '';
|
|
|
- this.$set(this.dataForm, 'dateTimeRange', [
|
|
|
- this.dataForm.startDate,
|
|
|
- this.dataForm.endDate
|
|
|
- ]);
|
|
|
- }
|
|
|
+ this.receivableList =
|
|
|
+ (data.statReceipt && data.statReceipt.statReceiptDetailList) || [];
|
|
|
+
|
|
|
+ this.datasource = data.productList || [];
|
|
|
+ // this.recorpayList = data.recorpayList || [];
|
|
|
+ // 解决小数精度丢失问题,使用分进行计算
|
|
|
+ // data.orderTotalAmount =
|
|
|
+ // data.orderList.reduce(
|
|
|
+ // (pre, cur) => pre + Math.round(+cur.orderAmount * 100),
|
|
|
+ // 0
|
|
|
+ // ) / 100;
|
|
|
+ // data.amountTotalPrice =
|
|
|
+ // data.orderList.reduce(
|
|
|
+ // (pre, cur) => pre + Math.round(+cur.statementAmount * 100),
|
|
|
+ // 0
|
|
|
+ // ) / 100;
|
|
|
+ // data.amountCompletePrice =
|
|
|
+ // data.orderList.reduce(
|
|
|
+ // (pre, cur) => pre + Math.round(+cur.statementedAmount * 100),
|
|
|
+ // 0
|
|
|
+ // ) / 100;
|
|
|
+ // data.amountUnCompletePrice =
|
|
|
+ // data.orderList.reduce(
|
|
|
+ // (pre, cur) => pre + Math.round(+cur.unStatementAmount * 100),
|
|
|
+ // 0
|
|
|
+ // ) / 100;
|
|
|
+ // data.orderList = data.orderList.map((item) => {
|
|
|
+ // item.deliveryProducts = item.deliveryProducts.map((i) => {
|
|
|
+ // return {
|
|
|
+ // ...i,
|
|
|
+ // taxRate: i.taxRate || 0,
|
|
|
+ // discountRatio: i.discountRatio || 100,
|
|
|
+ // singlePrice: i.singlePrice || 0,
|
|
|
+ // originalTotalCount: i.totalCount // 保存原始数量值用于校验
|
|
|
+ // };
|
|
|
+ // });
|
|
|
+ // return item;
|
|
|
+ // });
|
|
|
+ // this.datasource = data.orderList || [];
|
|
|
+ // this.receivableList = data.receivableList || [];
|
|
|
+ // this.dataForm = {
|
|
|
+ // ...this.dataForm,
|
|
|
+ // ...data,
|
|
|
+ // fundType: data.fundType || 2,
|
|
|
+ // transactionMethod: data.transactionMethod || 1,
|
|
|
+ // collectionTerms: data.collectionTerms || '',
|
|
|
+ // receiptStatus: data.receiptStatus || 0,
|
|
|
+ // totalAdvanceConfirmAmount: data.totalAdvanceConfirmAmount || 0,
|
|
|
+ // totalReceivableAmount: data.totalReceivableAmount || 0
|
|
|
+ // };
|
|
|
+ // switch (this.dataForm.dateType) {
|
|
|
+ // case 1:
|
|
|
+ // // this.dataForm.year = this.dataForm.dateValue;
|
|
|
+ // this.$set(this.dataForm, 'year', this.dataForm.dateValue);
|
|
|
+ // break;
|
|
|
+ // case 2: {
|
|
|
+ // //2023年-四季度
|
|
|
+ // let data = this.dataForm.dateValue.split('年-');
|
|
|
+
|
|
|
+ // this.$set(this.dataForm, 'year', data[0]);
|
|
|
+ // this.$set(this.dataForm, 'quarter', data[1]);
|
|
|
+ // break;
|
|
|
+ // }
|
|
|
+ // case 3:
|
|
|
+ // this.$set(this.dataForm, 'month', this.dataForm.dateValue);
|
|
|
+
|
|
|
+ // break;
|
|
|
+ // default:
|
|
|
+ // this.dataForm.dateValue = '';
|
|
|
+ // this.$set(this.dataForm, 'dateTimeRange', [
|
|
|
+ // this.dataForm.startDate,
|
|
|
+ // this.dataForm.endDate
|
|
|
+ // ]);
|
|
|
+ // }
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
//关闭弹窗
|
|
|
@@ -539,26 +560,26 @@
|
|
|
|
|
|
let api =
|
|
|
this.dialogType == 'add'
|
|
|
- ? createAccountStatementAPI
|
|
|
- : accountstatementUpdateAPI;
|
|
|
- const totalAdvanceConfirmAmount =
|
|
|
- this.receivableList.reduce(
|
|
|
- (pre, cur) =>
|
|
|
- pre + Math.round((+cur.currentConfirmAmount || 0) * 100),
|
|
|
- 0
|
|
|
- ) / 100;
|
|
|
- const totalReceivableAmount =
|
|
|
- Math.round(
|
|
|
- ((+this.dataForm.amountTotalPrice || 0) -
|
|
|
- totalAdvanceConfirmAmount) *
|
|
|
- 100
|
|
|
- ) / 100;
|
|
|
+ ? saveReceivableAPI
|
|
|
+ : updateReceivableAPI;
|
|
|
+ // const totalAdvanceConfirmAmount =
|
|
|
+ // this.receivableList.reduce(
|
|
|
+ // (pre, cur) =>
|
|
|
+ // pre + Math.round((+cur.currentConfirmAmount || 0) * 100),
|
|
|
+ // 0
|
|
|
+ // ) / 100;
|
|
|
+ // const totalReceivableAmount =
|
|
|
+ // Math.round(
|
|
|
+ // ((+this.dataForm.amountTotalPrice || 0) -
|
|
|
+ // totalAdvanceConfirmAmount) *
|
|
|
+ // 100
|
|
|
+ // ) / 100;
|
|
|
let params = {
|
|
|
...this.dataForm,
|
|
|
- totalAdvanceConfirmAmount,
|
|
|
- totalReceivableAmount,
|
|
|
- orderList: this.datasource,
|
|
|
- receivableList: this.receivableList
|
|
|
+ // totalAdvanceConfirmAmount,
|
|
|
+ // totalReceivableAmount,
|
|
|
+ productList: this.datasource,
|
|
|
+ statReceipt: this.statReceipt
|
|
|
// recorpayList: this.recorpayList
|
|
|
};
|
|
|
this.saveLoading = true;
|