|
|
@@ -1,110 +1,133 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="130px">
|
|
|
- <headerTitle title="基本信息"></headerTitle>
|
|
|
- <el-row :gutter="12">
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- label="应收日期"
|
|
|
- prop="receivableDate"
|
|
|
- style="margin-bottom: 22px"
|
|
|
- >
|
|
|
- <el-date-picker
|
|
|
- style="width: 100%"
|
|
|
- v-model="form.receivableDate"
|
|
|
- type="date"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
+ <headerTitle title="基本信息" style="margin-top: 30px"></headerTitle>
|
|
|
+ <el-form ref="form" :model="dataForm" :rules="rules" label-width="120px">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="会计科目:" prop="accountingSubjectId">
|
|
|
+ <ele-tree-select
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ ref="treeSelect"
|
|
|
+ :data="accountingSubjectList"
|
|
|
+ v-model="dataForm.accountingSubjectId"
|
|
|
+ valueKey="id"
|
|
|
+ labelKey="name"
|
|
|
+ placeholder="请选择"
|
|
|
+ @change="changeSubjectInfo"
|
|
|
+ default-expand-all
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item
|
|
|
+ label="应收日期"
|
|
|
+ prop="receivableDate"
|
|
|
>
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- label="应收金额"
|
|
|
- prop="receivableTotalPrice"
|
|
|
- style="margin-bottom: 22px"
|
|
|
- >
|
|
|
- <el-input-number
|
|
|
- disabled
|
|
|
- v-model="form.receivableTotalPrice"
|
|
|
- :precision="2"
|
|
|
- :controls="false"
|
|
|
- style="width: 100%"
|
|
|
- :min="0"
|
|
|
- ></el-input-number>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- label="会计科目"
|
|
|
- prop="accountingSubjectId"
|
|
|
- style="margin-bottom: 22px"
|
|
|
- >
|
|
|
- <ele-tree-select
|
|
|
- clearable
|
|
|
- filterable
|
|
|
- ref="treeSelect"
|
|
|
- :data="accountingSubjectList"
|
|
|
- v-model="form.accountingSubjectId"
|
|
|
- valueKey="id"
|
|
|
- labelKey="name"
|
|
|
- placeholder="请选择"
|
|
|
- @change="changeSubjectInfo"
|
|
|
- default-expand-all
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row :gutter="12">
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- label="发票编码"
|
|
|
- prop="invoiceCode"
|
|
|
- style="margin-bottom: 22px"
|
|
|
- >
|
|
|
- <el-input disabled v-model="form.invoiceCode"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- label="来源类型"
|
|
|
- prop="sourceType"
|
|
|
- style="margin-bottom: 22px"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- :value="form.sourceTypeName"
|
|
|
- disabled
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- label="来源编码"
|
|
|
- prop="sourceCode"
|
|
|
- style="margin-bottom: 22px"
|
|
|
- >
|
|
|
- <el-input v-model="form.sourceCode" disabled></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <el-row :gutter="12">
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- label="公司名称"
|
|
|
- prop="contactName"
|
|
|
- style="margin-bottom: 22px"
|
|
|
- >
|
|
|
- <el-input disabled v-model="form.contactName"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="附件">
|
|
|
- <fileMain v-model="form.files"></fileMain>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
+ <el-date-picker
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
+ v-model="dataForm.receivableDate"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ type="date"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="receivableTotalPrice" label="应收金额">
|
|
|
+ <el-input :disabled="dialogType == 'view'" v-model="dataForm.receivableTotalPrice"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="invoiceCode" label="发票编码">
|
|
|
+ <el-input disabled v-model="dataForm.invoiceCode"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="invoiceNo" label="发票号">
|
|
|
+ <el-input disabled v-model="dataForm.invoiceNo"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="category" label="发票种类">
|
|
|
+ <el-select
|
|
|
+ :disabled="true"
|
|
|
+ clearable
|
|
|
+ class="ele-block"
|
|
|
+ v-model="dataForm.category"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ <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="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="true"
|
|
|
+ clearable
|
|
|
+ class="ele-block"
|
|
|
+ v-model="dataForm.sourceType"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ <el-option label="采购订单" :value="2" />
|
|
|
+ <!-- <el-option label="项目" :value="2"/>-->
|
|
|
+ <!-- <el-option label="合同" :value="4" /> -->
|
|
|
+
|
|
|
+ <el-option label="销售订单" :value="1" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <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="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="files" label="附件">
|
|
|
+ <fileMain v-model="dataForm.files" :type="dialogType == 'view' ? 'view' : 'add'"></fileMain>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <headerTitle title="应收信息" style="margin-top: 30px"></headerTitle>
|
|
|
+ <receivable-info
|
|
|
+ :dataForm.sync="dataForm"
|
|
|
+ :receivableList.sync="receivableList"
|
|
|
+ dialogType="view"
|
|
|
+ ref="receivableInfoRef"
|
|
|
+ @addAdvanceReceipt="addAdvanceReceipt"
|
|
|
+ ></receivable-info>
|
|
|
+
|
|
|
+ <headerTitle title="对账明细" style="margin-top: 30px"></headerTitle>
|
|
|
+ <account-detail-table
|
|
|
+ ref="accountDetailTableRef"
|
|
|
+ :datasource.sync="datasource"
|
|
|
+ dialogType="view"
|
|
|
+ :queryDimension="dataForm.queryDimension"
|
|
|
+ @totalChange="handleTotalChange"
|
|
|
+ @countChange="handleCountChange"
|
|
|
+ ></account-detail-table>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -124,6 +147,8 @@
|
|
|
import { getTreeByPid } from '@/api/classifyManage';
|
|
|
import { payAndReceiveEnum } from '@/enum/dict';
|
|
|
// import fileMain from "@/components/addDoc/index.vue";
|
|
|
+ import AccountDetailTable from '@/views/bpm/handleTask/components/saleOrder/accountstatement/accountDetailTable.vue';
|
|
|
+ import ReceivableInfo from '@/views/bpm/handleTask/components/saleOrder/accountstatement/receivableInfo.vue';
|
|
|
|
|
|
export default {
|
|
|
mixins: [dictMixins],
|
|
|
@@ -131,12 +156,14 @@
|
|
|
// fileMain,
|
|
|
tableInfo,
|
|
|
personSelect,
|
|
|
- fileUpload
|
|
|
+ fileUpload,
|
|
|
+ AccountDetailTable,
|
|
|
+ ReceivableInfo
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- dialogType: '',
|
|
|
- form: {
|
|
|
+ dialogType: 'view',
|
|
|
+ dataForm: {
|
|
|
accountingSubjectCode: '',
|
|
|
accountingSubjectId: '',
|
|
|
accountingSubjectName: '',
|
|
|
@@ -154,7 +181,10 @@
|
|
|
sourceType: '',
|
|
|
unreceiveTotalPrice: 0
|
|
|
},
|
|
|
+ receivableList: [],
|
|
|
accountingSubjectList: [],
|
|
|
+ statReceipt: null,
|
|
|
+ datasource: [],
|
|
|
rules: {
|
|
|
accountingSubjectId: {
|
|
|
required: true,
|
|
|
@@ -181,21 +211,49 @@
|
|
|
await this.getInfo(this.businessId);
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleTotalChange(total) {
|
|
|
+ this.dataForm.amountTotalPrice = total;
|
|
|
+ },
|
|
|
+ handleCountChange(count) {
|
|
|
+ this.dataForm.totalStatementCount = count;
|
|
|
+ },
|
|
|
+ // 明细表本次对账金额变化时,按销售单号同步到应收信息对应行
|
|
|
+ handleStatementAmountChange(summaryMap) {
|
|
|
+ if (this.$refs.receivableInfoRef) {
|
|
|
+ this.$refs.receivableInfoRef.syncStatementAmount(summaryMap);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 新增预收款:打开预收款选择弹窗
|
|
|
+ addAdvanceReceipt() {
|
|
|
+ this.$refs.advanceReceiptSelectRef.open();
|
|
|
+ },
|
|
|
//获取详情
|
|
|
async getInfo(id) {
|
|
|
await this.getClassifyList(24, 'accountingSubjectList');
|
|
|
let data = await getFinReceivableInfoAPI(id);
|
|
|
- data.sourceTypeName = payAndReceiveEnum.find(item=>item.value==data.sourceType)?.label;
|
|
|
- this.form = data;
|
|
|
- console.log('获取详情', data);
|
|
|
- let invoiceData = {};
|
|
|
- if (data.invoiceId) {
|
|
|
- invoiceData = await invoiceApplyInfoAPI(data.invoiceId);
|
|
|
- }
|
|
|
|
|
|
- this.form.accountingSubjectCode = invoiceData.accountingSubjectCode;
|
|
|
- this.form.accountingSubjectId = invoiceData.accountingSubjectId || '';
|
|
|
- this.form.accountingSubjectName = invoiceData.accountingSubjectName || '';
|
|
|
+ this.dataForm = {
|
|
|
+ ...this.dataForm,
|
|
|
+ ...data
|
|
|
+ };
|
|
|
+
|
|
|
+ this.statReceipt = data.statReceipt || null;
|
|
|
+
|
|
|
+ this.receivableList =
|
|
|
+ (data.statReceipt && data.statReceipt.statReceiptDetailList) || [];
|
|
|
+
|
|
|
+ this.datasource = data.productList || [];
|
|
|
+ // data.sourceTypeName = payAndReceiveEnum.find(item=>item.value==data.sourceType)?.label;
|
|
|
+ // this.form = data;
|
|
|
+ // console.log('获取详情', data);
|
|
|
+ // let invoiceData = {};
|
|
|
+ // if (data.invoiceId) {
|
|
|
+ // invoiceData = await invoiceApplyInfoAPI(data.invoiceId);
|
|
|
+ // }
|
|
|
+
|
|
|
+ // this.form.accountingSubjectCode = invoiceData.accountingSubjectCode;
|
|
|
+ // this.form.accountingSubjectId = invoiceData.accountingSubjectId || '';
|
|
|
+ // this.form.accountingSubjectName = invoiceData.accountingSubjectName || '';
|
|
|
},
|
|
|
downloadFile(file) {
|
|
|
getFile({ objectName: file.storePath }, file.name);
|
|
|
@@ -219,7 +277,7 @@
|
|
|
this.$refs.form.validate(async (valid) => {
|
|
|
if (!valid) return this.$message.warning('有必填项未填,请检查');
|
|
|
const API = finReceivableUpdateAPI;
|
|
|
- const res = await API(this.form);
|
|
|
+ const res = await API(this.dataForm);
|
|
|
res.code == '0' ? resolve('1') : reject(new Error(data.message));
|
|
|
});
|
|
|
});
|