|
|
@@ -2,7 +2,9 @@
|
|
|
<div class="borderless" v-loading="pageLoading">
|
|
|
<div class="customer-head">
|
|
|
<div class="customer-back">
|
|
|
- <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left" @click="backToList">返回列表 </el-button>
|
|
|
+ <el-button type="danger" style="border: none; background: none; color: red" icon="el-icon-arrow-left" @click="backToList"
|
|
|
+ >返回列表
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
<div class="add-customer-btn">
|
|
|
<el-button type="primary" size="small" @click="addEdit()">新建财务凭证 </el-button>
|
|
|
@@ -27,10 +29,10 @@
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div style="margin: 55px 5px 0px 5px;'">
|
|
|
-<!-- :style="{'text-align': 'center', 'line-height': '40px', 'background-color': 'white'}"-->
|
|
|
- <div style="text-align: center; line-height: 40px; background-color: white;">
|
|
|
- <span style="font-size: 24px;">{{form.voucherTypeName}}</span>
|
|
|
+ <div style="margin: 55px 5px 0 5px;'">
|
|
|
+ <!-- :style="{'text-align': 'center', 'line-height': '40px', 'background-color': 'white'}"-->
|
|
|
+ <div :style="{ 'text-align': 'center', 'line-height': '40px', 'background-color': 'white' }">
|
|
|
+ <span style="font-size: 24px">{{ form.voucherTypeName }}</span>
|
|
|
</div>
|
|
|
<el-card class="box-card">
|
|
|
<el-form :model="form" ref="form" label-width="90px" class="demo-ruleForm">
|
|
|
@@ -69,37 +71,29 @@
|
|
|
<el-col :span="4">
|
|
|
<el-form :model="form" ref="form1">
|
|
|
<el-row>
|
|
|
- <el-col :span="10">
|
|
|
- <el-form-item prop="voucherType">
|
|
|
- <search-query
|
|
|
- :datalist="voucherTypeData"
|
|
|
- :selectValue="form.voucherType"
|
|
|
- :clearable="false"
|
|
|
- :buttonIf="false"
|
|
|
- :disabled="!getVoucherCanModify"
|
|
|
- :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
|
|
|
- placeholder="请选择凭证类型"
|
|
|
- @corpChange="corpChange($event, 'voucherType')"
|
|
|
- >
|
|
|
- </search-query>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="4" style="line-height: 40px; text-align: center;">
|
|
|
- <span>字 第</span>
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-form-item prop="voucherType">
|
|
|
+ <search-query
|
|
|
+ :datalist="voucherTypeData"
|
|
|
+ :selectValue="form.voucherType"
|
|
|
+ :clearable="false"
|
|
|
+ :buttonIf="false"
|
|
|
+ :disabled="!getVoucherCanModify"
|
|
|
+ :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
|
|
|
+ placeholder="请选择凭证类型"
|
|
|
+ @corpChange="corpChange($event, 'voucherType')"
|
|
|
+ >
|
|
|
+ </search-query>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4" style="line-height: 40px; text-align: center">
|
|
|
+ <span>字 第</span>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-form-item label="" prop="voucherNo">
|
|
|
+ <el-input v-model="form.voucherNo" size="small" autocomplete="off" :disabled="true" clearable placeholder="凭证号"> </el-input>
|
|
|
+ </el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="10">
|
|
|
- <el-form-item label="" prop="voucherNo">
|
|
|
- <el-input
|
|
|
- v-model="form.voucherNo"
|
|
|
- size="small"
|
|
|
- autocomplete="off"
|
|
|
- :disabled="true"
|
|
|
- clearable
|
|
|
- placeholder="凭证号"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
</el-col>
|
|
|
@@ -108,7 +102,7 @@
|
|
|
<el-date-picker
|
|
|
v-model="form.voucherDate"
|
|
|
clearable
|
|
|
- style="width: 100%;"
|
|
|
+ style="width: 100%"
|
|
|
type="date"
|
|
|
size="small"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
@@ -121,7 +115,7 @@
|
|
|
<el-col :span="4">
|
|
|
<el-form-item label="REF NO" prop="billNo">
|
|
|
<el-input
|
|
|
- style="width: 100%;"
|
|
|
+ style="width: 100%"
|
|
|
v-model="form.billNo"
|
|
|
size="small"
|
|
|
autocomplete="off"
|
|
|
@@ -150,26 +144,24 @@
|
|
|
</el-col>
|
|
|
<el-col :span="4">
|
|
|
<el-form-item label="来源业务编号" prop="srcBlllNo">
|
|
|
+ <el-input style="width: 100%" v-model="form.srcBlllNo" size="small" autocomplete="off" :disabled="true" clearable placeholder="无">
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-form-item label="附件" prop="attachmentCount">
|
|
|
<el-input
|
|
|
- style="width: 100%;"
|
|
|
- v-model="form.srcBlllNo"
|
|
|
+ type="number"
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="form.attachmentCount"
|
|
|
size="small"
|
|
|
autocomplete="off"
|
|
|
- :disabled="true"
|
|
|
clearable
|
|
|
- placeholder="无"
|
|
|
+ placeholder="请输入附件"
|
|
|
>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="4">
|
|
|
- <el-form-item label="附件" prop="attachmentCount">
|
|
|
- <el-input type="number" style="width: 100%;" v-model="form.attachmentCount"
|
|
|
- size="small" autocomplete="off"
|
|
|
- clearable placeholder="请输入附件" >
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
</el-card>
|
|
|
@@ -218,13 +210,14 @@
|
|
|
@addRowsfun="addRowsfun"
|
|
|
@deletefun="deletefun"
|
|
|
@auxiliaryAccountingfun="auxiliaryAccountingfun"
|
|
|
+ @showOffRecordsfun="showOffRecordsfun"
|
|
|
>
|
|
|
</fromtable-details>
|
|
|
</el-card>
|
|
|
</div>
|
|
|
|
|
|
<!--辅助核算-->
|
|
|
- <el-dialog title=" " append-to-body :visible.sync="auxiliaryVisible" class="el-dialogDeep" width="40%" :before-close="handleClose">
|
|
|
+ <el-dialog title="核算项目维护" append-to-body :visible.sync="auxiliaryVisible" class="el-dialogDeep" width="40%" :before-close="handleClose">
|
|
|
<div>科目名称: {{ subjectRow.accountFullName }}</div>
|
|
|
<div style="margin-top: 10px">
|
|
|
<el-form :model="subjectRow" ref="subjectRow" label-width="70px" class="demo-ruleForm">
|
|
|
@@ -425,13 +418,222 @@
|
|
|
<el-button type="primary" @click="auxiliaryDeterminefun">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!--预收预付核销-->
|
|
|
+ <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">
|
|
|
+ <!-- show-summary-->
|
|
|
+ <!-- :summary-method="summaryMethod"-->
|
|
|
+ <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%"
|
|
|
+ @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="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="amountDrOff" 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="amountCrOff" 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="amountDrUsdOff" 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="amountCrUsdOff" 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>
|
|
|
|
|
|
<script>
|
|
|
import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
|
|
|
import { getWorkDicts } from "@/api/system/dictbiz";
|
|
|
-import { finvouchersDetail, finvouchersitemsRemove, finvouchersSubmit } from "@/api/iosBasicData/finvouchers";
|
|
|
+import { finvouchersDetail, finvouchersitemsRemove, finvouchersSubmit, getOffVoucherItems } from "@/api/iosBasicData/finvouchers";
|
|
|
import { getCurrentDate, getYearDate } from "@/util/date";
|
|
|
import fromtableDetails from "@/views/iosBasicData/finvouchers/assembly/fromtableDetails.vue";
|
|
|
import { accountsDetail } from "@/api/iosBasicData/accounts";
|
|
|
@@ -458,33 +660,70 @@ export default {
|
|
|
voucherType: "VOUNO-TRANS", // 凭证类型
|
|
|
voucherTypeName: "转账凭证",
|
|
|
voucherDate: getCurrentDate(),
|
|
|
- finVouchersItemsList: []
|
|
|
+ finVouchersItemsList: [],
|
|
|
},
|
|
|
+ removedFinvouchersitems: [],
|
|
|
voucherTypeData: [], // 凭证字数据
|
|
|
voucherSourceData: [], // 业务类型
|
|
|
auxiliaryVisible: false, // 辅助核算弹窗
|
|
|
+ offRecordsVisible: false, // 预收预付核销弹窗
|
|
|
+ offRecordsData: [], // 预收预付核销数据
|
|
|
+ offRecordsSelectionData: [],
|
|
|
handleSelectionData: [], // 分录多选的数据
|
|
|
subjectRow: {}, // 科目弹窗的显示数据
|
|
|
subjectAccount: {}, // 当前选择科目的数据
|
|
|
corpCnNameData: [], // 客户核算 下拉数据
|
|
|
deptData: [], // 部门核算 下拉数据
|
|
|
emplData: [], // 职员核算 下拉数据
|
|
|
- itemData: [] // 项目核算 下拉数据
|
|
|
+ itemData: [], // 项目核算 下拉数据
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.saberUserInfo = JSON.parse(localStorage.getItem("saber-userInfo")).content;
|
|
|
- if(!this.saberUserInfo){
|
|
|
- this.saberUserInfo = {}
|
|
|
+ if (!this.saberUserInfo) {
|
|
|
+ this.saberUserInfo = {};
|
|
|
}
|
|
|
this.getWorkDictsfun();
|
|
|
},
|
|
|
- computed:{
|
|
|
- getVoucherCanModify(){
|
|
|
- return !this.form.id || (this.saberUserInfo.user_id==this.form.createUser && this.form.voucherStatus != 1 && this.form.voucherSource === 'MANUAL');
|
|
|
+ computed: {
|
|
|
+ getVoucherCanModify() {
|
|
|
+ return (
|
|
|
+ !this.form.id || (this.saberUserInfo.user_id == this.form.createUser && this.form.voucherStatus != 1 && this.form.voucherSource === "MANUAL")
|
|
|
+ );
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
+ 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";
|
|
|
+ },
|
|
|
+ summaryMethod(param) {},
|
|
|
+ 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;
|
|
|
+ },
|
|
|
addEdit() {
|
|
|
if (this.form.voucherStatus == 1) {
|
|
|
this.$emit("toAddEdit");
|
|
|
@@ -539,7 +778,7 @@ export default {
|
|
|
finvouchersDetailfun(id) {
|
|
|
this.pageLoading = true;
|
|
|
finvouchersDetail(id)
|
|
|
- .then(res => {
|
|
|
+ .then((res) => {
|
|
|
this.form = res.data.data;
|
|
|
})
|
|
|
.finally(() => {
|
|
|
@@ -558,27 +797,47 @@ export default {
|
|
|
addRowsfun(row, index) {
|
|
|
//第二个参数为0的时候,是可以添加参数的,1的时候是删除
|
|
|
this.form.finVouchersItemsList.splice(index, 0, {
|
|
|
- descr: row.descr
|
|
|
+ descr: row.descr,
|
|
|
});
|
|
|
},
|
|
|
// 行删除
|
|
|
deletefun(row, index) {
|
|
|
+ let offVouItems = Array.isArray(row.offVouItems) ? row.offVouItems : [];
|
|
|
+
|
|
|
if (row.id) {
|
|
|
- this.finvouchersitemsRemovefun(row.id);
|
|
|
+ this.$set(row, "changeMode", row.changeMode === "d" ? "u" : "d");
|
|
|
+ // this.finvouchersitemsRemovefun(row.id);
|
|
|
+ this.removedFinvouchersitems.push(row);
|
|
|
+ this.form.finVouchersItemsList.splice(index, 1);
|
|
|
} else this.form.finVouchersItemsList.splice(index, 1);
|
|
|
+
|
|
|
+ offVouItems.forEach((item) => {
|
|
|
+ let rowIdx = this.form.finVouchersItemsList.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.finVouchersItemsList.splice(rowIdx, 1);
|
|
|
+ } else this.form.finVouchersItemsList.splice(rowIdx, 1);
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
// 删除分录
|
|
|
deleteEntryfun() {
|
|
|
if (this.handleSelectionData.length == 0) {
|
|
|
return this.$message.warning("请选择至少一条数据");
|
|
|
}
|
|
|
+ let offVouItems = [];
|
|
|
let multiList = this.handleSelectionData;
|
|
|
let arr = this.form.finVouchersItemsList;
|
|
|
// 获取有id 的数据
|
|
|
- const itemsWithId = multiList.filter(item => item.hasOwnProperty("id"));
|
|
|
- let arrIds = itemsWithId.map(item => item.id); // 获取id 数据
|
|
|
+ const itemsWithId = multiList.filter((item) => item.hasOwnProperty("id"));
|
|
|
+ let arrIds = itemsWithId.map((item) => item.id); // 获取id 数据
|
|
|
// 把选中的删除掉
|
|
|
- multiList.forEach(item => {
|
|
|
+ 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])) {
|
|
|
@@ -589,8 +848,29 @@ export default {
|
|
|
});
|
|
|
// 有id 的处理
|
|
|
if (itemsWithId.length != 0) {
|
|
|
- this.finvouchersitemsRemovefun(arrIds.join(","));
|
|
|
+ // this.finvouchersitemsRemovefun(arrIds.join(","));
|
|
|
+ arrIds.forEach((id) => {
|
|
|
+ let i = this.form.finVouchersItemsList.findIndex((item) => item.id === id);
|
|
|
+ if (i >= 0) {
|
|
|
+ let row = this.form.finVouchersItemsList[i];
|
|
|
+ this.$set(row, "changeMode", "d");
|
|
|
+ this.removedFinvouchersitems.push();
|
|
|
+ this.form.finVouchersItemsList.splice(i, 1);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
+
|
|
|
+ offVouItems.forEach((item) => {
|
|
|
+ let rowIdx = this.form.finVouchersItemsList.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.finVouchersItemsList.splice(rowIdx, 1);
|
|
|
+ } else this.form.finVouchersItemsList.splice(rowIdx, 1);
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
forceNumber(n) {
|
|
|
try {
|
|
|
@@ -611,7 +891,7 @@ export default {
|
|
|
finvouchersSubmitfun(type) {
|
|
|
this.form.businessTypeCode = "PZDH";
|
|
|
this.form.billNoFormat = "BILL-NO";
|
|
|
- this.form.attachmentCount = parseInt(this.forceNumber(this.form.attachmentCount))
|
|
|
+ this.form.attachmentCount = parseInt(this.forceNumber(this.form.attachmentCount));
|
|
|
if (this.form.finVouchersItemsList.length < 2) {
|
|
|
return this.$message.warning("请填写至少凭证两笔分录后再保存!");
|
|
|
}
|
|
|
@@ -621,6 +901,7 @@ export default {
|
|
|
let amountCrSum = 0;
|
|
|
let index = 0;
|
|
|
for (let item of this.form.finVouchersItemsList) {
|
|
|
+ // console.log(item);
|
|
|
index++;
|
|
|
let amtDr = this.forceNumber(item.amountDr);
|
|
|
let amtCr = this.forceNumber(item.amountCr);
|
|
|
@@ -660,13 +941,15 @@ export default {
|
|
|
return this.$message({
|
|
|
dangerouslyUseHTMLString: true,
|
|
|
message: msgs.join("<br /><br />"),
|
|
|
- type: "warning"
|
|
|
+ type: "warning",
|
|
|
});
|
|
|
}
|
|
|
|
|
|
this.pageLoading = true;
|
|
|
- finvouchersSubmit(this.form)
|
|
|
- .then(res => {
|
|
|
+ let data = JSON.parse(JSON.stringify(this.form));
|
|
|
+ data.finVouchersItemsList = data.finVouchersItemsList.concat(this.removedFinvouchersitems);
|
|
|
+ finvouchersSubmit(data)
|
|
|
+ .then((res) => {
|
|
|
this.$message.success("操作成功");
|
|
|
if (type == "toAddEdit") {
|
|
|
this.$emit("toAddEdit");
|
|
|
@@ -679,12 +962,12 @@ export default {
|
|
|
},
|
|
|
// 分录删除接口
|
|
|
finvouchersitemsRemovefun(id) {
|
|
|
- finvouchersitemsRemove(id).then(res => {
|
|
|
+ finvouchersitemsRemove(id).then((res) => {
|
|
|
this.$message.success("操作成功");
|
|
|
// this.finvouchersDetailfun();
|
|
|
let ids = id.split(",");
|
|
|
- ids.forEach(id => {
|
|
|
- let i = this.form.finVouchersItemsList.findIndex(item => item.id === id);
|
|
|
+ ids.forEach((id) => {
|
|
|
+ let i = this.form.finVouchersItemsList.findIndex((item) => item.id === id);
|
|
|
if (i >= 0) {
|
|
|
this.form.finVouchersItemsList.splice(i, 1);
|
|
|
}
|
|
|
@@ -694,11 +977,11 @@ export default {
|
|
|
// 科目编辑打开辅助核算弹窗
|
|
|
auxiliaryAccountingfun(row) {
|
|
|
// 获取状态
|
|
|
- accountsDetail(row.accountId).then(res => {
|
|
|
+ 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) {
|
|
|
+ if (res.data.data.isCorp || res.data.data.isDept || res.data.data.isEmpl || res.data.data.isItem) {
|
|
|
this.auxiliaryVisible = true;
|
|
|
}
|
|
|
});
|
|
|
@@ -707,6 +990,94 @@ export default {
|
|
|
auxiliaryDeterminefun() {
|
|
|
this.auxiliaryVisible = false;
|
|
|
},
|
|
|
+ // 获取核销记录
|
|
|
+ showOffRecordsfun(row) {
|
|
|
+ // 获取状态
|
|
|
+ getOffVoucherItems(row).then((res) => {
|
|
|
+ this.offRecordsSelectionData = [];
|
|
|
+ let data = Array.isArray(res.data.data) ? res.data.data : [];
|
|
|
+ this.offRecordsData = data;
|
|
|
+ this.subjectRow = row;
|
|
|
+ this.offRecordsVisible = true;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ offRecordsDeterminefun() {
|
|
|
+ if (!Array.isArray(this.offRecordsData)) {
|
|
|
+ this.offRecordsVisible = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let row = this.subjectRow;
|
|
|
+ let amt = row.dc === "D" ? Number(row.amountCr) : Number(row.amountDr);
|
|
|
+ let usd = row.dc === "D" ? Number(row.amountCrUsd) : Number(row.amountDrUsd);
|
|
|
+ let amtOff = 0.0,
|
|
|
+ usdOff = 0;
|
|
|
+ let rows = [];
|
|
|
+ this.offRecordsData.forEach((item) => {
|
|
|
+ let currAmt = 0;
|
|
|
+ if (row.dc === "D") {
|
|
|
+ currAmt = Number(item.amountCrOffCurrent);
|
|
|
+ amtOff = amtOff + currAmt;
|
|
|
+ if (item.curCode === "USD") {
|
|
|
+ usdOff = usdOff + Number(item.amountCrUsdOffCurrent);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ currAmt = Number(item.amountDrOffCurrent);
|
|
|
+ amtOff = amtOff + currAmt;
|
|
|
+ if (item.curCode === "USD") {
|
|
|
+ usdOff = usdOff + Number(item.amountDrUsdOffCurrent);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ currAmt = currAmt > 0.0 ? currAmt.toFixed(2) : "0.00";
|
|
|
+ if (currAmt !== "0.00") {
|
|
|
+ rows.push(item);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ if (amt.toFixed(2) !== amtOff.toFixed(2)) {
|
|
|
+ return this.$message({
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
+ message: "<div>选定核销金额与应核销金额不一致!</div>",
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ rows.forEach((item) => {
|
|
|
+ let obj = {};
|
|
|
+ let flds = "accountId,accountCode,accountCnName,accountEnName,accountFullName,accountLevel,accountProperty,dc,";
|
|
|
+ flds += "isArAp,isCorp,isDc,isDept,isEmpl,isForeign,curCode,isQuantity,unitNo,isItem,itemClassify,itemClassifyId,itemId,itemName,";
|
|
|
+ flds += "corpId,corpShortName,corpCnName,corpEnName,deptId,deptName,emplId,emplName,exrate";
|
|
|
+ flds.split(",").forEach((name) => {
|
|
|
+ obj[name] = item[name];
|
|
|
+ });
|
|
|
+ obj.descr = row.descr;
|
|
|
+ if (row.dc === "D") {
|
|
|
+ obj.amountDr = item.amountCrOffCurrent;
|
|
|
+ obj.amountCr = 0.0;
|
|
|
+ if (item.curCode === "USD") {
|
|
|
+ obj.amountDrUsd = item.amountCrUsdOffCurrent;
|
|
|
+ obj.amountCrUsd = 0.0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ obj.amountCr = item.amountDrOffCurrent;
|
|
|
+ obj.amountDr = 0.0;
|
|
|
+ if (item.curCode === "USD") {
|
|
|
+ obj.amountCrUsd = item.amountDrUsdOffCurrent;
|
|
|
+ obj.amountDrUsd = 0.0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ obj.isOff = 1;
|
|
|
+ obj.offSrcItemId = item.id;
|
|
|
+ obj.offVouItemId = row.id;
|
|
|
+ obj.offVouItemIndex = this.form.finVouchersItemsList.indexOf(row);
|
|
|
+ obj.offVouItem = row;
|
|
|
+ if (!Array.isArray(row.offVouItems)) row.offVouItems = [];
|
|
|
+ row.offVouItems.push(obj);
|
|
|
+
|
|
|
+ this.form.finVouchersItemsList.push(obj);
|
|
|
+ });
|
|
|
+
|
|
|
+ this.offRecordsVisible = false;
|
|
|
+ },
|
|
|
// 下拉回调
|
|
|
corpChange(value, name) {
|
|
|
let found = false;
|
|
|
@@ -784,16 +1155,53 @@ export default {
|
|
|
this.$set(this.form, name, value);
|
|
|
}
|
|
|
},
|
|
|
+ // 借方/贷方 本币的计算
|
|
|
+ offAmountBlur(row, name) {
|
|
|
+ if (name === "D") {
|
|
|
+ this.$set(row, "amountCrOffCurrent", 0);
|
|
|
+ }
|
|
|
+ if (name === "C") {
|
|
|
+ this.$set(row, "amountDrOffCurrent", 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ let a = row.amountCrOffCurrent ? Number(row.amountCrOffCurrent) : 0;
|
|
|
+ this.$set(row, "amountCrOffCurrent", a > Number(row.amountCrBlc) ? Number(row.amountCrBlc) : a);
|
|
|
+ a = row.amountDrOff ? Number(row.amountDrOff) : 0;
|
|
|
+ this.$set(row, "amountDrOffCurrent", a > Number(row.amountDrBlc) ? Number(row.amountDrBlc) : a);
|
|
|
+
|
|
|
+ if (row.curCode === "USD") {
|
|
|
+ this.$set(row, "exrate", row.exrate ? Number(row.exrate) : 1);
|
|
|
+ this.$set(row, "amountCrUsdOffCurrent", (row.amountCrOffCurrent / row.exrate).toFixed(2));
|
|
|
+ this.$set(row, "amountDrUsdOffCurrent", (row.amountDrOffCurrent / row.exrate).toFixed(2));
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 外币的计算
|
|
|
+ offAmountUSDBlur(row, name) {
|
|
|
+ if (name === "Dusd") {
|
|
|
+ this.$set(row, "amountCrUsdOffCurrent", 0);
|
|
|
+ }
|
|
|
+ if (name === "Cusd") {
|
|
|
+ this.$set(row, "amountDrUsdOffCurrent", 0);
|
|
|
+ }
|
|
|
+ let a = row.amountCrUsdOffCurrent ? Number(row.amountCrUsdOffCurrent) : 0;
|
|
|
+ this.$set(row, "amountCrUsdOffCurrent", a > Number(row.amountCrUsdBlc) ? Number(row.amountCrUsdBlc) : a);
|
|
|
+ a = row.amountDrUsdOffCurrent ? Number(row.amountDrUsdOffCurrent) : 0;
|
|
|
+ this.$set(row, "amountDrUsdOffCurrent", a > Number(row.amountDrUsdBlc) ? Number(row.amountDrUsdBlc) : a);
|
|
|
+
|
|
|
+ this.$set(row, "exrate", row.exrate ? Number(row.exrate) : 1);
|
|
|
+ this.$set(row, "amountCrOffCurrent", (row.amountCrUsdOffCurrent * row.exrate).toFixed(2));
|
|
|
+ this.$set(row, "amountDrOffCurrent", (row.amountDrUsdOffCurrent * row.exrate).toFixed(2));
|
|
|
+ },
|
|
|
// 接口数据调用
|
|
|
// 客户
|
|
|
getBcorpsListfun(cnName) {
|
|
|
- getBcorpsList(1, 10, { cnName }).then(res => {
|
|
|
+ getBcorpsList(1, 10, { cnName }).then((res) => {
|
|
|
this.corpCnNameData = res.data.data.records;
|
|
|
});
|
|
|
},
|
|
|
// 部门
|
|
|
getDeptTreefun() {
|
|
|
- getDeptLazyTree(JSON.parse(localStorage.getItem("saber-userInfo")).content.dept_pid.split(",")[0]).then(res => {
|
|
|
+ getDeptLazyTree(JSON.parse(localStorage.getItem("saber-userInfo")).content.dept_pid.split(",")[0]).then((res) => {
|
|
|
this.deptData = res.data.data;
|
|
|
});
|
|
|
},
|
|
|
@@ -802,9 +1210,9 @@ export default {
|
|
|
// userGetList(1, 10, { account }, JSON.parse(localStorage.getItem('saber-userInfo')).content.dept_pid.split(',')[0]).then(res => {
|
|
|
// this.emplData = res.data.data.records
|
|
|
// })
|
|
|
- selectEmpls(1, 10, { cname: account, whetherEmployedOrNot: 1 }).then(res => {
|
|
|
+ selectEmpls(1, 10, { cname: account, whetherEmployedOrNot: 1 }).then((res) => {
|
|
|
if (Array.isArray(res.data.data.records)) {
|
|
|
- res.data.data.records.forEach(item => {
|
|
|
+ res.data.data.records.forEach((item) => {
|
|
|
item.name = item.cname;
|
|
|
});
|
|
|
}
|
|
|
@@ -813,7 +1221,7 @@ export default {
|
|
|
},
|
|
|
// 项目核算
|
|
|
baccitemstypeListfun(cnName) {
|
|
|
- baccitemstypeList(1, 10, { cnName }).then(res => {
|
|
|
+ baccitemstypeList(1, 10, { cnName }).then((res) => {
|
|
|
this.itemData = res.data.data.records;
|
|
|
});
|
|
|
},
|
|
|
@@ -828,9 +1236,9 @@ export default {
|
|
|
// 获取字典数据
|
|
|
getWorkDictsfun() {
|
|
|
// 凭证字数据
|
|
|
- getWorkDicts("voucher_word_los").then(res => {
|
|
|
+ getWorkDicts("voucher_word_los").then((res) => {
|
|
|
this.voucherTypeData = res.data.data;
|
|
|
- let vt = this.voucherTypeData.find(j => j.dictValue == this.form.voucherType);
|
|
|
+ let vt = this.voucherTypeData.find((j) => j.dictValue == this.form.voucherType);
|
|
|
if (vt) {
|
|
|
this.$set(this.form, "voucherTypeName", vt.dictValue);
|
|
|
} else if (this.voucherTypeData.length > 0) {
|
|
|
@@ -840,10 +1248,10 @@ export default {
|
|
|
}
|
|
|
console.log(this.form);
|
|
|
});
|
|
|
- bbusinesstypeList(1,100,{enableVoucher:'1'}).then(res => {
|
|
|
- let data=[{id: 0, code: "MANUAL", cnName: "手工凭证"}].concat(res.data.data.records)
|
|
|
+ bbusinesstypeList(1, 100, { enableVoucher: "1" }).then((res) => {
|
|
|
+ let data = [{ id: 0, code: "MANUAL", cnName: "手工凭证" }].concat(res.data.data.records);
|
|
|
this.voucherSourceData = data;
|
|
|
- })
|
|
|
+ });
|
|
|
|
|
|
// getWorkDicts("voucher_source_los").then(res => {
|
|
|
// this.voucherSourceData = res.data.data;
|
|
|
@@ -852,8 +1260,8 @@ export default {
|
|
|
//返回列表
|
|
|
backToList() {
|
|
|
this.$emit("goBack");
|
|
|
- }
|
|
|
- }
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|