|
|
@@ -466,6 +466,49 @@
|
|
|
</template>
|
|
|
</finstlbillsitems>
|
|
|
</el-tab-pane>
|
|
|
+ <el-tab-pane label="凭证数据" name="3">
|
|
|
+ <div style="margin-bottom: 10px">
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ style="margin-right: 8px"
|
|
|
+ :loading="saveLoading"
|
|
|
+ @click="addEntryfun"
|
|
|
+ :disabled="editSave || generateStatus"
|
|
|
+ >添加分录
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ style="margin-right: 8px"
|
|
|
+ :loading="saveLoading"
|
|
|
+ @click="oneClickSave"
|
|
|
+ :disabled="editSave || generateStatus"
|
|
|
+ >一键保存
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="danger"
|
|
|
+ style="margin-right: 8px"
|
|
|
+ :loading="saveLoading"
|
|
|
+ @click="deleteEntryfun"
|
|
|
+ :disabled="editSave || generateStatus"
|
|
|
+ >删除分录
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <fromtable-details
|
|
|
+ :assemblyForm="form"
|
|
|
+ :tableData="form.finStlBillsVoucherItemsList"
|
|
|
+ :handleSelectionData="handleSelectionData2"
|
|
|
+ :disabled="editSave || generateStatus"
|
|
|
+ @handleSelectionChange="handleSelectionChange2"
|
|
|
+ @addRowsfun="addRowsfun"
|
|
|
+ @deletefun="deletefun"
|
|
|
+ @auxiliaryAccountingfun="auxiliaryAccountingfun"
|
|
|
+ @showOffRecordsfun="showOffRecordsfun"
|
|
|
+ >
|
|
|
+ </fromtable-details>
|
|
|
+ </el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</el-card>
|
|
|
</div>
|
|
|
@@ -557,6 +600,256 @@
|
|
|
|
|
|
<!--报表组件-->
|
|
|
<reportContainer ref="reportContainer"></reportContainer>
|
|
|
+ <!--预收预付核销-->
|
|
|
+ <el-dialog
|
|
|
+ title="预收预付核销管理"
|
|
|
+ append-to-body
|
|
|
+ :visible.sync="offRecordsVisible"
|
|
|
+ class="el-dialogDeep"
|
|
|
+ width="80%"
|
|
|
+ :before-close="handleClose"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ 科目名称:
|
|
|
+ {{
|
|
|
+ subjectRow.accountCode +
|
|
|
+ " " +
|
|
|
+ subjectRow.accountFullName +
|
|
|
+ (subjectRow.isEmpl === 1 && subjectRow.emplName ? "/" + subjectRow.emplName : "") +
|
|
|
+ (subjectRow.isDept === 1 && subjectRow.deptName ? "/" + subjectRow.deptName : "") +
|
|
|
+ (subjectRow.isCorp === 1 && subjectRow.corpShortName ? "/" + subjectRow.corpShortName : "") +
|
|
|
+ (subjectRow.isItem === 1 ? "/" + subjectRow.itemClassify + "-" + (subjectRow.itemName ? subjectRow.itemName : "") : "")
|
|
|
+ }}
|
|
|
+ 方向:{{ subjectRow.dc === "D" ? "借" : "贷" }}
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ 借方金额: CNY {{ fixedAmt(subjectRow.amountDr, 16) }} {{ subjectRow.isForeign === 1 ? "USD " + fixedAmt(subjectRow.amountDrUsd, 16) : "" }}
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ 贷方金额: CNY {{ fixedAmt(subjectRow.amountCr, 16) }} {{ subjectRow.isForeign === 1 ? "USD " + fixedAmt(subjectRow.amountCrUsd, 16) : "" }}
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 10px; margin-bottom: 10px">
|
|
|
+ <el-form :model="subjectRowOff" ref="subjectRowOff" label-width="70px" class="demo-ruleForm">
|
|
|
+ <el-row :gutter="40">
|
|
|
+ <el-col :span="12" v-if="subjectRowOff.isCorp">
|
|
|
+ <!--<div>客户核算:</div>-->
|
|
|
+ <el-form-item label="客户名称:" prop="corpCnName">
|
|
|
+ <search-query
|
|
|
+ style="width: 100%"
|
|
|
+ ref="searchQueryRef"
|
|
|
+ :datalist="corpCnNameData"
|
|
|
+ :selectValue="subjectRowOff.corpCnName"
|
|
|
+ :filterable="true"
|
|
|
+ :clearable="true"
|
|
|
+ :remote="true"
|
|
|
+ :buttonIf="true"
|
|
|
+ placeholder="请选择客户名称"
|
|
|
+ :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }"
|
|
|
+ @corpFocus="getBcorpsListfun"
|
|
|
+ @remoteMethod="getBcorpsListfun"
|
|
|
+ @corpChange="corpChangeOff($event, 'corpCnName')"
|
|
|
+ @eldialogConfirm="eldialogConfirmOff('bcorps')"
|
|
|
+ @bottonSearchfun="bottonSearchfun('bcorps')"
|
|
|
+ >
|
|
|
+ <bcorps ref="bcorps" :eldialog="true" @selectionChange="eldialogMultipleChoice($event, 'bcorps')"></bcorps>
|
|
|
+ </search-query>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" v-if="subjectRowOff.isCorp">
|
|
|
+ <el-form-item label="" prop="">
|
|
|
+ <el-button type="primary" @click="regetOffVoucherItems">查询</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 10px">
|
|
|
+ <!-- show-summary-->
|
|
|
+ <!-- :summary-method="summaryMethodOff"-->
|
|
|
+ <el-table
|
|
|
+ ref="tableOffRecords"
|
|
|
+ :cell-style="{ padding: '0px', fontSize: '12px' }"
|
|
|
+ :header-cell-style="tableHeaderCellStyle"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :data="offRecordsData"
|
|
|
+ :border="true"
|
|
|
+ style="width: 100%"
|
|
|
+ show-summary
|
|
|
+ :summary-method="summaryMethodOff"
|
|
|
+ @selection-change="handleOffRecordsSelectionChange"
|
|
|
+ :row-class-name="rowClassName"
|
|
|
+ >
|
|
|
+ <el-table-column fixed="left" type="selection" width="50"> </el-table-column>
|
|
|
+ <el-table-column type="index" width="40" style="text-align: center"> </el-table-column>
|
|
|
+ <el-table-column prop="voucherDate" label="凭证日期" width="120" style="padding: 0">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span>{{ row.voucherDate }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="descr" label="摘要" width="200" style="padding: 0">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span>{{ row.descr }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="accountCode" label="科目名称" width="240" style="padding: 0">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span>
|
|
|
+ {{
|
|
|
+ row.accountCode +
|
|
|
+ " " +
|
|
|
+ row.accountFullName +
|
|
|
+ (row.isEmpl === 1 && row.emplName ? "/" + row.emplName : "") +
|
|
|
+ (row.isDept === 1 && row.deptName ? "/" + row.deptName : "") +
|
|
|
+ (row.isCorp === 1 && row.corpShortName ? "/" + row.corpShortName : "") +
|
|
|
+ (row.isItem === 1 ? "/" + row.itemClassify + "-" + (row.itemName ? row.itemName : "") : "")
|
|
|
+ }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="dc" label="借贷" width="40px" style="padding: 0">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span>{{ row.dc === "C" ? "借" : "贷" }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="本币金额">
|
|
|
+ <el-table-column label="借方">
|
|
|
+ <el-table-column prop="amountDr" label="金额" width="100px" style="text-align: right">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span>{{ displayAmt(row.amountDr) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="amountDrOffCurrent" label="本次可核销" width="120px" style="text-align: right">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-input-number
|
|
|
+ v-if="subjectRow.dc === 'C' && row.amountDrBlc !== '0.00'"
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="row.amountDrOffCurrent"
|
|
|
+ size="small"
|
|
|
+ autocomplete="off"
|
|
|
+ :disabled="form.voucherStatus == 1"
|
|
|
+ placeholder="请输入借方"
|
|
|
+ :precision="2"
|
|
|
+ @change="offAmountBlur(row, 'D')"
|
|
|
+ :controls="false"
|
|
|
+ >
|
|
|
+ </el-input-number>
|
|
|
+ <span v-if="subjectRow.dc === 'D' || row.amountDr === '0.00'">{{ displayAmt(row.amountDrOff) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="amountDrBlc" label="核销余额" width="100px" style="text-align: right">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span>{{ displayAmt(row.amountDrBlc) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="货方">
|
|
|
+ <el-table-column prop="amountCr" label="金额" width="100px" style="text-align: right">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span>{{ displayAmt(row.amountCr) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="amountCrOffCurrent" label="本次可核销" width="120px" style="text-align: right">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-input-number
|
|
|
+ v-if="subjectRow.dc !== 'C' && row.amountCrBlc !== '0.00'"
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="row.amountCrOffCurrent"
|
|
|
+ size="small"
|
|
|
+ autocomplete="off"
|
|
|
+ :disabled="form.voucherStatus == 1"
|
|
|
+ placeholder="请输入货方"
|
|
|
+ :precision="2"
|
|
|
+ @change="offAmountBlur(row, 'C')"
|
|
|
+ :controls="false"
|
|
|
+ >
|
|
|
+ </el-input-number>
|
|
|
+ <span v-if="subjectRow.dc === 'C' || row.amountCrBlc === '0.00'">{{ displayAmt(row.amountCrOff) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="amountCrBlc" label="核销余额" width="100px" style="text-align: right">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span>{{ displayAmt(row.amountCrBlc) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="外币金额">
|
|
|
+ <el-table-column prop="curCode" label="币种" width="50px" align="center"> </el-table-column>
|
|
|
+ <el-table-column prop="exrate" label="汇率" width="80px" style="text-align: right">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span>{{ row.exrate ? Number(row.exrate).toFixed(4) : "" }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="借方">
|
|
|
+ <el-table-column prop="amountDrUsd" label="金额" width="100px" style="text-align: right">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span>{{ displayAmt(row.amountDrUsd) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="amountDrUsdOffCurrent" label="本次可核销" width="120px" style="text-align: right">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-input-number
|
|
|
+ v-if="subjectRow.dc === 'C' && row.amountDrUsdBlc !== '0.00'"
|
|
|
+ style="width: 100%; text-align: right"
|
|
|
+ v-model="row.amountDrUsdOffCurrent"
|
|
|
+ size="small"
|
|
|
+ autocomplete="off"
|
|
|
+ :disabled="form.voucherStatus == 1 || row.curCode == 'CNY'"
|
|
|
+ clearable
|
|
|
+ placeholder="请输入借方"
|
|
|
+ :precision="2"
|
|
|
+ @change="offAmountUSDBlur(row, 'Dusd')"
|
|
|
+ :controls="false"
|
|
|
+ >
|
|
|
+ </el-input-number>
|
|
|
+ <span v-if="subjectRow.dc === 'D' || row.amountDrUsdBlc === '0.00'">{{ displayAmt(row.amountDrUsdOff) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="amountDrUsdBlc" label="核销余额" width="100px" style="text-align: right">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span>{{ displayAmt(row.amountDrUsdBlc) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="货方">
|
|
|
+ <el-table-column prop="amountCrUsd" label="金额" width="100px" style="text-align: right">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span>{{ displayAmt(row.amountCrUsd) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="amountCrUsdOffCurrent" label="金额" width="120px" style="text-align: right">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-input-number
|
|
|
+ v-if="subjectRow.dc !== 'C' && row.amountCrUsdBlc !== '0.00'"
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="row.amountCrUsdOffCurrent"
|
|
|
+ size="small"
|
|
|
+ autocomplete="off"
|
|
|
+ :disabled="form.voucherStatus == 1 || row.curCode == 'CNY'"
|
|
|
+ clearable
|
|
|
+ placeholder="请输入货方"
|
|
|
+ :precision="2"
|
|
|
+ @change="offAmountUSDBlur(row, 'Cusd')"
|
|
|
+ :controls="false"
|
|
|
+ >
|
|
|
+ </el-input-number>
|
|
|
+ <span v-if="subjectRow.dc === 'C' || row.amountCrUsdBlc === '0.00'">{{ displayAmt(row.amountCrUsdOff) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="amountCrUsdBlc" label="核销余额" width="100px" style="text-align: right">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span>{{ displayAmt(row.amountCrUsdBlc) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="offRecordsVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="offRecordsDeterminefun">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -573,7 +866,8 @@ import {
|
|
|
finstlbillsRevokeSettlement,
|
|
|
finstlbillsGetByDetail,
|
|
|
finstlbillslistAccBillByCorp,
|
|
|
- finstlbillsGenerateVoucher
|
|
|
+ finstlbillsGenerateVoucher,
|
|
|
+ voucherRemove
|
|
|
} from "@/api/iosBasicData/finstlbills";
|
|
|
import expand from "@/components/basic-container/expand.vue";
|
|
|
import queryFinstlbillsitems from "@/views/iosBasicData/PaymentApplication/assembly/finstlbillsitems.vue";
|
|
|
@@ -586,6 +880,10 @@ import { generateFinStlBills } from "@/api/iosBasicData/fininvoices";
|
|
|
import { dateFormat } from "@/util/date";
|
|
|
import dicSelect from "@/components/dicSelect/main";
|
|
|
import { isProcurement } from "@/api/basicData/configuration";
|
|
|
+import fromtableDetails from "./components/fromtableDetails.vue";
|
|
|
+import { getCurrentDate } from "@/util/date";
|
|
|
+import { accountsDetail } from "@/api/iosBasicData/accounts";
|
|
|
+import { getOffVoucherItems } from "@/api/iosBasicData/finvouchers";
|
|
|
export default {
|
|
|
components: {
|
|
|
reportContainer,
|
|
|
@@ -595,7 +893,8 @@ export default {
|
|
|
expand,
|
|
|
finstlbillsitems,
|
|
|
dicSelect,
|
|
|
- queryFinstlbillsitems
|
|
|
+ queryFinstlbillsitems,
|
|
|
+ fromtableDetails
|
|
|
},
|
|
|
props: {
|
|
|
// 编辑还是保存
|
|
|
@@ -610,6 +909,21 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ handleSelectionData2: [], // 分录多选的数据
|
|
|
+ removedFinvouchersitems: [],
|
|
|
+ voucherTypeData: [], // 凭证字数据
|
|
|
+ voucherSourceData: [], // 业务类型
|
|
|
+ auxiliaryVisible: false, // 辅助核算弹窗
|
|
|
+ offRecordsVisible: false, // 预收预付核销弹窗
|
|
|
+ offRecordsData: [], // 预收预付核销数据
|
|
|
+ offRecordsSelectionData: [],
|
|
|
+ subjectRowOff: {}, // 核销科目弹窗的显示数据
|
|
|
+ subjectRow: {}, // 科目弹窗的显示数据
|
|
|
+ subjectAccount: {}, // 当前选择科目的数据
|
|
|
+ corpCnNameData: [], // 客户核算 下拉数据
|
|
|
+ deptData: [], // 部门核算 下拉数据
|
|
|
+ emplData: [], // 职员核算 下拉数据
|
|
|
+ itemData: [], // 项目核算 下拉数据
|
|
|
generateStatus: false,
|
|
|
amountSubSum: 0,
|
|
|
amountDSubSum: 0,
|
|
|
@@ -674,7 +988,13 @@ export default {
|
|
|
// 绑定的数据
|
|
|
form: {
|
|
|
dc: null,
|
|
|
- billDate: dateFormat(new Date())
|
|
|
+ billDate: dateFormat(new Date()),
|
|
|
+ voucherSource: "MANUAL",
|
|
|
+ voucherSourceName: "手工凭证",
|
|
|
+ voucherType: "VOUNO-TRANS", // 凭证类型
|
|
|
+ voucherTypeName: "转账凭证",
|
|
|
+ voucherDate: getCurrentDate(),
|
|
|
+ finStlBillsVoucherItemsList: []
|
|
|
},
|
|
|
addData: [],
|
|
|
handleSelectionData: [], // 表格选择的数据
|
|
|
@@ -750,7 +1070,7 @@ export default {
|
|
|
this.voucher = res.data.data;
|
|
|
});
|
|
|
isProcurement({ param: "whether.open" }).then(res => {
|
|
|
- res.data.data = '1'
|
|
|
+ res.data.data = "1";
|
|
|
this.whetheropen = res.data.data;
|
|
|
});
|
|
|
isProcurement({ param: "whether.auditing" }).then(res => {
|
|
|
@@ -759,6 +1079,322 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
+ corpChangeOff(value, name) {
|
|
|
+ let found = false;
|
|
|
+ // 客户名称
|
|
|
+ if (name == "corpCnName") {
|
|
|
+ for (let item of this.corpCnNameData) {
|
|
|
+ if (item.cnName == value) {
|
|
|
+ found = true;
|
|
|
+ this.$set(this.subjectRowOff, "corpEnName", item.enName);
|
|
|
+ this.$set(this.subjectRowOff, "corpCnName", item.cnName);
|
|
|
+ this.$set(this.subjectRowOff, "corpShortName", item.shortName);
|
|
|
+ this.$set(this.subjectRowOff, "corpId", item.id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!found) {
|
|
|
+ this.$set(this.subjectRowOff, "corpEnName", "");
|
|
|
+ this.$set(this.subjectRowOff, "corpCnName", "");
|
|
|
+ this.$set(this.subjectRowOff, "corpShortName", "");
|
|
|
+ this.$set(this.subjectRowOff, "corpId", 0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 核算
|
|
|
+ else if (name == "deptName") {
|
|
|
+ for (let item of this.deptData) {
|
|
|
+ if (item.title == value) {
|
|
|
+ found = true;
|
|
|
+ this.$set(this.subjectRowOff, "deptName", item.title);
|
|
|
+ this.$set(this.subjectRowOff, "deptId", item.id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!found) {
|
|
|
+ this.$set(this.subjectRowOff, "deptName", "");
|
|
|
+ this.$set(this.subjectRowOff, "deptId", 0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 职员
|
|
|
+ else if (name == "emplName") {
|
|
|
+ for (let item of this.emplData) {
|
|
|
+ if (item.name == value) {
|
|
|
+ found = true;
|
|
|
+ this.$set(this.subjectRowOff, "emplName", item.name);
|
|
|
+ this.$set(this.subjectRowOff, "emplId", item.id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!found) {
|
|
|
+ this.$set(this.subjectRowOff, "emplName", "");
|
|
|
+ this.$set(this.subjectRowOff, "emplId", 0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 项目核算
|
|
|
+ else if (name == "itemName") {
|
|
|
+ for (let item of this.itemData) {
|
|
|
+ if (item.cnName == value) {
|
|
|
+ found = true;
|
|
|
+ this.$set(this.subjectRowOff, "itemName", item.cnName);
|
|
|
+ this.$set(this.subjectRowOff, "itemId", item.id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!found) {
|
|
|
+ this.$set(this.subjectRowOff, "itemName", "");
|
|
|
+ this.$set(this.subjectRowOff, "itemId", 0);
|
|
|
+ }
|
|
|
+ } else if (name == "voucherType") {
|
|
|
+ this.$set(this.form, name, value);
|
|
|
+ for (let item of this.voucherTypeData) {
|
|
|
+ if (item.dictKey == value) {
|
|
|
+ found = true;
|
|
|
+ this.$set(this.form, "voucherTypeName", item.dictValue + "凭证");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!found) {
|
|
|
+ this.$set(this.subjectRowOff, "voucherTypeName", "");
|
|
|
+ }
|
|
|
+ } else if (name == "voucherSource") {
|
|
|
+ this.$set(this.form, name, value);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 下拉多选弹窗的确认
|
|
|
+ eldialogConfirmOff(name) {
|
|
|
+ if (name == "bcorps") {
|
|
|
+ if (this.$refs.bcorps.isShow) {
|
|
|
+ console.log("列表确认");
|
|
|
+ this.$set(this.subjectRowOff, "corpCnName", this.$refs.bcorps.selectionList[0].cnName);
|
|
|
+ this.$set(this.subjectRowOff, "corpEnName", this.$refs.bcorps.selectionList[0].enName);
|
|
|
+ this.$set(this.subjectRowOff, "corpId", this.$refs.bcorps.selectionList[0].id);
|
|
|
+ } else {
|
|
|
+ console.log("详情确认");
|
|
|
+ this.$refs.bcorps.$refs.detail.submitForm();
|
|
|
+ this.$set(this.subjectRowOff, "corpCnName", this.$refs.bcorps.$refs.detail.formData.cnName);
|
|
|
+ this.$set(this.subjectRowOff, "corpEnName", this.$refs.bcorps.$refs.detail.formData.enName);
|
|
|
+ this.$set(this.subjectRowOff, "corpId", this.$refs.bcorps.$refs.detail.formData.id);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log("其他的组件");
|
|
|
+ }
|
|
|
+ this.$refs.searchQueryRef.corpVisible = false;
|
|
|
+ },
|
|
|
+ fixedAmt(amt, len) {
|
|
|
+ let N = Number(amt);
|
|
|
+ let S = isNaN(N) ? "0.00" : N.toFixed(2);
|
|
|
+ while (S.length < len) {
|
|
|
+ S = "_" + S;
|
|
|
+ }
|
|
|
+ return S;
|
|
|
+ },
|
|
|
+ displayAmt(amt, len) {
|
|
|
+ let N = Number(amt);
|
|
|
+ let S = isNaN(N) ? "" : N.toFixed(len ? len : 2);
|
|
|
+ let Z = 0;
|
|
|
+ return S === Z.toFixed(len ? len : 2) ? "" : S;
|
|
|
+ },
|
|
|
+ // 表头样式
|
|
|
+ tableHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
|
|
|
+ return "padding:4px 0px;fontSize:12px;color:#000;background:#ecf5ff;text-align:center";
|
|
|
+ },
|
|
|
+ summaryMethodOff(param) {
|
|
|
+ const { columns, data } = param;
|
|
|
+ const sums = [];
|
|
|
+ columns.forEach((column, index) => {
|
|
|
+ if (index === 2) {
|
|
|
+ sums[index] = "合计";
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const values = data.map(item => Number(item[column.property]));
|
|
|
+ // 显示列的统计 金额
|
|
|
+ let arr = ["amountDrOffCurrent", "amountCrOffCurrent", "amountDrUsdOffCurrent", "amountCrUsdOffCurrent"];
|
|
|
+ // 判断是否有这个数据
|
|
|
+ if (arr.indexOf(column.property) != -1) {
|
|
|
+ if (!values.every(value => isNaN(value))) {
|
|
|
+ sums[index] = values.reduce((prev, curr) => {
|
|
|
+ const value = Number(curr);
|
|
|
+ if (!isNaN(value)) {
|
|
|
+ return prev + curr;
|
|
|
+ } else {
|
|
|
+ return prev;
|
|
|
+ }
|
|
|
+ }, 0);
|
|
|
+ sums[index] = this.displayAmt(sums[index]); // 把合计的参数保留两位小数
|
|
|
+ // sums[index] += " 元";
|
|
|
+ } else {
|
|
|
+ sums[index] = " ";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return sums;
|
|
|
+ },
|
|
|
+ rowClassName({ row, rowIndex }) {
|
|
|
+ let rowName = "",
|
|
|
+ findRow = this.handleSelectionData.find(c => c.rowIndex === row.rowIndex);
|
|
|
+ if (findRow) {
|
|
|
+ rowName = "current-row "; // elementUI 默认高亮行的class类 不用再样式了^-^,也可通过css覆盖改变背景颜色
|
|
|
+ }
|
|
|
+ return rowName; //也可以再加上其他类名 如果有需求的话
|
|
|
+ },
|
|
|
+ // 表格多选数据
|
|
|
+ handleOffRecordsSelectionChange(list) {
|
|
|
+ this.offRecordsSelectionData = list;
|
|
|
+ },
|
|
|
+ newGuid() {
|
|
|
+ let vd = "0123456789abcdefghijklmnopqrstuvwxyz".split("");
|
|
|
+ var i = vd,
|
|
|
+ o = [],
|
|
|
+ s = Math.random,
|
|
|
+ n;
|
|
|
+ (o[8] = o[13] = o[18] = o[23] = "-"), (o[14] = "4");
|
|
|
+ for (var r = 0; r < 36; r++) o[r] || ((n = 0 | (16 * s())), (o[r] = i[19 == r ? (3 & n) | 8 : 15 & n]));
|
|
|
+ return o.join("");
|
|
|
+ },
|
|
|
+ // 添加分录
|
|
|
+ addEntryfun() {
|
|
|
+ let obj = {
|
|
|
+ dynUID: this.newGuid().replace(/-/g, "")
|
|
|
+ };
|
|
|
+ console.log(obj);
|
|
|
+ if (this.form.finStlBillsVoucherItemsList.length > 0) {
|
|
|
+ obj.descr = this.form.finStlBillsVoucherItemsList[this.form.finStlBillsVoucherItemsList.length - 1].descr;
|
|
|
+ }
|
|
|
+ this.form.finStlBillsVoucherItemsList.push(obj);
|
|
|
+ },
|
|
|
+ forceNumber(n) {
|
|
|
+ try {
|
|
|
+ let N = parseFloat(n);
|
|
|
+ if (isNaN(N)) {
|
|
|
+ N = 0.0;
|
|
|
+ } else {
|
|
|
+ let S = N.toFixed(2);
|
|
|
+ N = Number(S);
|
|
|
+ }
|
|
|
+
|
|
|
+ return N;
|
|
|
+ } catch (e) {
|
|
|
+ return 0.0;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ oneClickSave() {
|
|
|
+ if (this.form.finStlBillsVoucherItemsList.length < 2) {
|
|
|
+ return this.$message.warning("请填写至少凭证两笔分录后再保存!");
|
|
|
+ }
|
|
|
+ this.editCustomer();
|
|
|
+ },
|
|
|
+ // 行添加
|
|
|
+ addRowsfun(row, index) {
|
|
|
+ //第二个参数为0的时候,是可以添加参数的,1的时候是删除
|
|
|
+ let obj = {
|
|
|
+ dynUID: this.newGuid().replace(/-/g, "")
|
|
|
+ };
|
|
|
+ this.form.finStlBillsVoucherItemsList.splice(index, 0, obj);
|
|
|
+ },
|
|
|
+ // 行删除
|
|
|
+ deletefun(row, index) {
|
|
|
+ let offVouItems = Array.isArray(row.offVouItems) ? row.offVouItems : [];
|
|
|
+
|
|
|
+ if (row.id) {
|
|
|
+ this.$set(row, "changeMode", row.changeMode === "d" ? "u" : "d");
|
|
|
+ // this.finvouchersitemsRemovefun(row.id);
|
|
|
+ this.removedFinvouchersitems.push(row);
|
|
|
+ voucherRemove(row.id).then(res => {
|
|
|
+ this.form.finStlBillsVoucherItemsList.splice(index, 1);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.form.finStlBillsVoucherItemsList.splice(index, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ offVouItems.forEach(item => {
|
|
|
+ let rowIdx = this.form.finStlBillsVoucherItemsList.indexOf(item);
|
|
|
+ if (rowIdx >= 0) {
|
|
|
+ if (item.id) {
|
|
|
+ this.$set(item, "changeMode", item.changeMode === "d" ? "u" : "d");
|
|
|
+ // this.finvouchersitemsRemovefun(row.id);
|
|
|
+ this.removedFinvouchersitems.push(item);
|
|
|
+ this.form.finStlBillsVoucherItemsList.splice(rowIdx, 1);
|
|
|
+ } else this.form.finStlBillsVoucherItemsList.splice(rowIdx, 1);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 删除分录
|
|
|
+ deleteEntryfun() {
|
|
|
+ if (this.handleSelectionData2.length == 0) {
|
|
|
+ return this.$message.warning("请选择至少一条数据");
|
|
|
+ }
|
|
|
+ let offVouItems = [];
|
|
|
+ let multiList = this.handleSelectionData2;
|
|
|
+ let arr = this.form.finStlBillsVoucherItemsList;
|
|
|
+ // 获取有id 的数据
|
|
|
+ const itemsWithId = multiList.filter(item => item.id);
|
|
|
+ let arrIds = itemsWithId.map(item => item.id); // 获取id 数据
|
|
|
+ console.log(arrIds);
|
|
|
+ // 把选中的删除掉
|
|
|
+ multiList.forEach(item => {
|
|
|
+ offVouItems = offVouItems.concat(Array.isArray(item.offVouItems) ? item.offVouItems : []);
|
|
|
+
|
|
|
+ if (!item.hasOwnProperty("id")) {
|
|
|
+ for (let index in arr) {
|
|
|
+ if (JSON.stringify(item) == JSON.stringify(arr[index])) {
|
|
|
+ arr.splice(Number(index), 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // 有id 的处理
|
|
|
+ if (itemsWithId.length != 0) {
|
|
|
+ voucherRemove(arrIds.join(",")).then(res => {
|
|
|
+ arrIds.forEach(id => {
|
|
|
+ let i = this.form.finStlBillsVoucherItemsList.findIndex(item => item.id === id);
|
|
|
+ if (i >= 0) {
|
|
|
+ let row = this.form.finStlBillsVoucherItemsList[i];
|
|
|
+ this.$set(row, "changeMode", "d");
|
|
|
+ this.removedFinvouchersitems.push();
|
|
|
+ this.form.finStlBillsVoucherItemsList.splice(i, 1);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.$message.success("删除成功");
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ offVouItems.forEach(item => {
|
|
|
+ let rowIdx = this.form.finStlBillsVoucherItemsList.indexOf(item);
|
|
|
+ if (rowIdx >= 0) {
|
|
|
+ if (item.id) {
|
|
|
+ this.$set(item, "changeMode", item.changeMode === "d" ? "u" : "d");
|
|
|
+ // this.finvouchersitemsRemovefun(row.id);
|
|
|
+ this.removedFinvouchersitems.push(item);
|
|
|
+ this.form.finStlBillsVoucherItemsList.splice(rowIdx, 1);
|
|
|
+ } else this.form.finStlBillsVoucherItemsList.splice(rowIdx, 1);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleSelectionChange2(list) {
|
|
|
+ this.handleSelectionData2 = list;
|
|
|
+ },
|
|
|
+ // 科目编辑打开辅助核算弹窗
|
|
|
+ auxiliaryAccountingfun(row) {
|
|
|
+ // 获取状态
|
|
|
+ accountsDetail(row.accountId).then(res => {
|
|
|
+ this.subjectAccount = res.data.data;
|
|
|
+ this.subjectRow = row;
|
|
|
+ // 如果三个都没有勾选 直接不自动打开弹窗
|
|
|
+ if (res.data.data.isCorp || res.data.data.isDept || res.data.data.isEmpl || res.data.data.isItem) {
|
|
|
+ this.auxiliaryVisible = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 辅助核算弹窗确认按钮
|
|
|
+ auxiliaryDeterminefun() {
|
|
|
+ this.auxiliaryVisible = false;
|
|
|
+ },
|
|
|
+ // 获取核销记录
|
|
|
+ showOffRecordsfun(row) {
|
|
|
+ // 获取状态
|
|
|
+ this.subjectRowOff = JSON.parse(JSON.stringify(row));
|
|
|
+ getOffVoucherItems(this.subjectRowOff).then(res => {
|
|
|
+ this.offRecordsSelectionData = [];
|
|
|
+ this.offRecordsData = Array.isArray(res.data.data) ? res.data.data : [];
|
|
|
+ this.subjectRow = row;
|
|
|
+ this.offRecordsVisible = true;
|
|
|
+ });
|
|
|
+ },
|
|
|
lastPage() {
|
|
|
if (this.pageIds.length) {
|
|
|
const index = this.pageIds.indexOf(this.form.id);
|
|
|
@@ -1035,6 +1671,56 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ // 判断借方金额合计 是否等于 贷方金额合计
|
|
|
+ let msgs = [];
|
|
|
+ let amountDrSum = 0;
|
|
|
+ let amountCrSum = 0;
|
|
|
+ let index = 0;
|
|
|
+ for (let item of this.form.finStlBillsVoucherItemsList) {
|
|
|
+ // console.log(item);
|
|
|
+ index++;
|
|
|
+ let amtDr = this.forceNumber(item.amountDr);
|
|
|
+ let amtCr = this.forceNumber(item.amountCr);
|
|
|
+ amountDrSum += amtDr;
|
|
|
+ amountCrSum += amtCr;
|
|
|
+ let descr = item.descr ? item.descr.trim() : "";
|
|
|
+ if (!descr) {
|
|
|
+ msgs.push(`第 ${index} 行分录请填写摘要!`);
|
|
|
+ } else {
|
|
|
+ item.descr = descr;
|
|
|
+ }
|
|
|
+ if (!item.accountId) {
|
|
|
+ msgs.push(`第 ${index} 行分录缺少科目代码!`);
|
|
|
+ } else {
|
|
|
+ if (item.isCorp === 1 && !item.corpId) {
|
|
|
+ msgs.push(`第 ${index} 行分录科目 ${item.accountCode} ${item.accountFullName} 核算客户,请选择客户名称!`);
|
|
|
+ }
|
|
|
+ if (item.isDept === 1 && !item.deptId) {
|
|
|
+ msgs.push(`第 ${index} 行分录科目 ${item.accountCode} ${item.accountFullName} 核算部门,请选择部门名称!`);
|
|
|
+ }
|
|
|
+ if (item.isEmpl === 1 && !item.emplId) {
|
|
|
+ msgs.push(`第 ${index} 行分录科目 ${item.accountCode} ${item.accountFullName} 核算职员,请选择职员名称!`);
|
|
|
+ }
|
|
|
+ if (item.isItem === 1 && !item.itemId) {
|
|
|
+ msgs.push(`第 ${index} 行分录科目 ${item.accountCode} ${item.accountFullName} 核算项目,请选择项目名称!`);
|
|
|
+ }
|
|
|
+ if (amtDr.toFixed(2) === "0.00" && amtCr.toFixed(2) === "0.00") {
|
|
|
+ msgs.push(`第 ${index} 行分录科目 ${item.accountCode} ${item.accountFullName} 请填写金额!`);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (amountDrSum !== amountCrSum) {
|
|
|
+ msgs.push(`凭证借贷金额不平衡!`);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (msgs.length > 0) {
|
|
|
+ return this.$message({
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
+ message: msgs.join("<br /><br />"),
|
|
|
+ type: "warning"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // this.form.finStlBillsVoucherItemsList = this.form.finStlBillsVoucherItemsList.concat(this.removedFinvouchersitems);
|
|
|
this.saveLoading = true; // 打开按钮动画
|
|
|
if (this.form.estimatedTime) {
|
|
|
this.form.estimatedTime = this.form.estimatedTime + " 00:00:00";
|
|
|
@@ -1047,6 +1733,7 @@ export default {
|
|
|
this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
|
|
|
this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
|
|
|
this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
|
|
|
+ this.form.voucherDate = this.form.voucherDate ? this.form.voucherDate.slice(0, 10) + " 00:00:00" : null;
|
|
|
this.form.settlementType = this.settlementType;
|
|
|
if (this.form.id) {
|
|
|
if (type == "选定行") {
|
|
|
@@ -1702,7 +2389,7 @@ export default {
|
|
|
item.accountBankNo = item.accountBank + " - " + item.accountNo;
|
|
|
return item;
|
|
|
});
|
|
|
- if (this.bankData.length>0) {
|
|
|
+ if (this.bankData.length > 0) {
|
|
|
this.$set(this.form, "bankId", res.data.data.records[0].id);
|
|
|
this.$set(this.form, "bankAccountName", res.data.data.records[0].accountName);
|
|
|
this.$set(this.form, "bankAccountBank", res.data.data.records[0].accountBank);
|