Commit 541297c5 authored by 332784038@qq.com's avatar 332784038@qq.com

收款单汇率计算业务修改

parent 1a52502a
......@@ -12,20 +12,21 @@
<!-- <el-descriptions-item > -->
<el-form-item style="margin-bottom: 0; margin-top: 20px" prop="customerId" :span="4">
<span style="margin-right: 20px"><span style="color: #ff4949">*</span>{{ $t("客户") }}</span>
<customer-selectorpay ref="customer" v-model="form.customerId" @change="customerChange" />
<customer-selectorpay ref="customer" v-model="form.customerId" @change="customerChange"/>
</el-form-item>
<!-- </el-descriptions-item>
<el-descriptions-item > -->
<el-form-item style="margin-bottom: 0; margin-top: 20px" prop="departmentId" :span="4">
<span style="margin-right: 20px"><span style="color: #ff4949">*</span>{{ $t("部门") }}:</span>
<el-select v-model="form.departmentId" style="width: 300px" :placeholder="$t('请选择部门')">
<el-option v-for="item in deptData" :key="item.id" :label="item.name" :value="item.id" />
<el-option v-for="item in deptData" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</el-form-item>
<el-form-item style="margin-bottom: 0; margin-top: 20px" prop="salesmanId" :span="4">
<span style="margin-right: 20px"><span style="color: #ff4949">*</span>{{ $t("业务员") }}:</span>
<el-select v-model="form.salesmanId" filterable :placeholder="$t('请选择业务员')" @change="(v) => (form.salesmanName = creatorData.find((t) => t.id === v).nickname)">
<el-option v-for="item in creatorData" :key="item.id" :label="item.nickname" :value="item.id" />
<el-select v-model="form.salesmanId" filterable :placeholder="$t('请选择业务员')"
@change="(v) => (form.salesmanName = creatorData.find((t) => t.id === v).nickname)">
<el-option v-for="item in creatorData" :key="item.id" :label="item.nickname" :value="item.id"/>
</el-select>
</el-form-item>
<!-- </el-descriptions-item> -->
......@@ -43,7 +44,8 @@
</el-form-item> -->
<!-- </el-descriptions-item>
<el-descriptions-item > -->
<el-form-item :label="$t('备注') + ':'" style="margin-bottom: 0; margin-top: 20px" label-width="55px" prop="remark">
<el-form-item :label="$t('备注') + ':'" style="margin-bottom: 0; margin-top: 20px" label-width="55px"
prop="remark">
<el-input style="display: inline-block" v-model="form.remark" :placeholder="$t('备注')"></el-input>
</el-form-item>
<!-- </el-descriptions-item> -->
......@@ -52,20 +54,23 @@
<el-card class="card amountCard">
<div slot="header" class="card-title">{{ $t("应收明细") }}</div>
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['ecw:voucher:create:add']" style="padding: 10px; margin-bottom: 10px">{{ $t("添加未收客户款项") }}</el-button>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['ecw:voucher:create:add']" style="padding: 10px; margin-bottom: 10px">
{{ $t("添加未收客户款项") }}
</el-button>
</el-col>
<el-table v-loading="loadings" :data="list" border show-summary :summary-method="getSummaries">
<el-table-column :label="$t('订单号')" align="center" prop="orderNo" />
<el-table-column :label="$t('提单号')" align="center" prop="tidanNo" />
<el-table-column :label="$t('唛头')" align="center" prop="marks" />
<el-table-column :label="$t('订单号')" align="center" prop="orderNo"/>
<el-table-column :label="$t('提单号')" align="center" prop="tidanNo"/>
<el-table-column :label="$t('唛头')" align="center" prop="marks"/>
<el-table-column :label="$t('品名')" align="center" prop="title">
<template slot-scope="scope">
{{ scope.row.titleZh ? scope.row.titleZh + "(" + scope.row.titleEn + ")" : "" }}
</template>
</el-table-column>
<el-table-column :label="$t('箱数')" align="center" prop="num" />
<el-table-column :label="$t('箱数')" align="center" prop="num"/>
<el-table-column :label="$t('体积/重量')" align="center" prop="weight">
<template slot-scope="scope"> {{ scope.row.volume }}/{{ scope.row.weight }} </template>
<template slot-scope="scope"> {{ scope.row.volume }}/{{ scope.row.weight }}</template>
</el-table-column>
<el-table-column :label="$t('收入类型')" align="center" prop="feeType">
<template slot-scope="scope">
......@@ -80,7 +85,8 @@
</el-table-column>
<el-table-column :label="$t('税率%')" align="center" prop="taxPoint">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.taxPoint" @input="changeTaxRate(scope.row, scope.$index)"></el-input>
<el-input type="text" v-model="scope.row.taxPoint"
@input="changeTaxRate(scope.row, scope.$index)"></el-input>
</template>
</el-table-column>
<el-table-column :label="$t('不含税金额')" align="center" prop="totalAmount">
......@@ -88,12 +94,17 @@
<span>{{ getCurrencySymbol(scope.row.currencyId) }}{{ scope.row.totalAmount }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('含税金额')" align="center" prop="taxAmount" :formatter="formatCurrency"> </el-table-column>
<el-table-column :label="$t('含税金额')" align="center" prop="taxAmount"
:formatter="formatCurrency"></el-table-column>
<el-table-column :label="$t('优惠金额')" align="center" prop="discountTotal">
<template slot-scope="scope">
<span> {{ getCurrencySymbol(scope.row.currencyId) }}{{ scope.row.discountTotal ? `${scope.row.discountTotal}` : 0 }}</span>
<span> {{
getCurrencySymbol(scope.row.currencyId)
}}{{ scope.row.discountTotal ? `${scope.row.discountTotal}` : 0 }}</span>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
<span v-if="scope.row.discountTotal">{{ scope.row.discountRemark ? "(" + scope.row.discountRemark + ")" : "" }}</span>
<span v-if="scope.row.discountTotal">{{
scope.row.discountRemark ? "(" + scope.row.discountRemark + ")" : ""
}}</span>
</template>
</el-table-column>
<el-table-column prop="actualAmount" width="120" :formatter="formatCurrency">
......@@ -102,8 +113,11 @@
</template>
</el-table-column>
<el-table-column prop="exchangeRate" :label="$t('基准币种({currency})汇率', { currency: getBaseCurrencynName(showCurrencyId) })" width="120">
<template v-slot="{ row }"> {{ getCurrencySymbol(row.currencyId) }}1:{{ getCurrencySymbol(showCurrencyId) }}{{ row.exchangeRate }} </template>
<el-table-column prop="exchangeRate"
:label="$t('基准币种({currency})汇率', { currency: getBaseCurrencynName(showCurrencyId) })"
width="120">
<template v-slot="{ row }"> {{ getCurrencySymbol(row.currencyId) }}{{ row.sourceAmount }} : {{ row.targetAmount }}{{getCurrencySymbol(showCurrencyId) }}
</template>
</el-table-column>
<el-table-column
prop="baseAmount"
......@@ -119,8 +133,13 @@
<el-table-column fixed="right" :label="$t('操作')" align="center">
<template slot-scope="scope">
<el-button v-if="scope.row.type !== 'total'" type="text" v-hasPermi="['ecw:voucher:create:editdiscount']" @click="addDiscount(scope.row, scope.$index)">{{ scope.row.discountTotal ? $t("修改优惠") : $t("新增优惠") }}</el-button>
<el-button v-if="scope.row.type !== 'total'" type="text" v-hasPermi="['ecw:voucher:create:deldiscount']" @click="deleteListRow(scope.$index)">{{ $t("删除") }}</el-button>
<el-button v-if="scope.row.type !== 'total'" type="text" v-hasPermi="['ecw:voucher:create:editdiscount']"
@click="addDiscount(scope.row, scope.$index)">
{{ scope.row.discountTotal ? $t("修改优惠") : $t("新增优惠") }}
</el-button>
<el-button v-if="scope.row.type !== 'total'" type="text" v-hasPermi="['ecw:voucher:create:deldiscount']"
@click="deleteListRow(scope.$index)">{{ $t("删除") }}
</el-button>
</template>
</el-table-column>
</el-table>
......@@ -141,20 +160,33 @@
</el-table-column>
<el-table-column :label="$t('应收金额')" align="center" prop="receivableAmount">
<template slot-scope="scope">
<template v-if="scope.row.type !== 'total'"> {{ getCurrencySymbol(scope.row.currencyId) }}{{ NP.round(`${NP.minus(scope.row.receivableAmount, scope.row.discountTotal || 0)}`, 0) }}{{ `${scope.row.discountTotal > 0 ? `(${scope.row.receivableAmount} - ${scope.row.discountTotal})` : ""}` }}</template>
<template v-if="scope.row.type !== 'total'"> {{
getCurrencySymbol(scope.row.currencyId)
}}{{
NP.round(`${NP.minus(scope.row.receivableAmount, scope.row.discountTotal || 0)}`, 0)
}}{{
`${scope.row.discountTotal > 0 ? `(${scope.row.receivableAmount} - ${scope.row.discountTotal})` : ""}`
}}
</template>
<template v-else> {{ getCurrencyLabel(showCurrencyId) }}</template>
</template>
</el-table-column>
<el-table-column align="center">
<template #header>
{{ $t("基准币种({currency})汇率", { currency: getBaseCurrencynName(showCurrencyId) }) }}
{{ $t("基准币种({currency})汇率", {currency: getBaseCurrencynName(showCurrencyId)}) }}
</template>
<template slot-scope="scope">
<template slot-scope="scope" wit>
<template v-if="scope.row.type !== 'total'">
<span v-if="showCurrencyId === scope.row.currencyId">{{ scope.row.writeOffRate }}</span>
<el-form-item v-else label="" label-width="0" style="margin-bottom: 0" :prop="`receiptAccountList.${scope.$index}.writeOffRate`">
<el-input v-model="scope.row.writeOffRate" @input="() => writeOffRateChange(scope.row, scope.$index)"></el-input>
</el-form-item>
<span v-if="showCurrencyId === scope.row.currencyId">{{
scope.row.sourceCurrencyCode
}} {{ scope.row.sourceAmount }} : {{ scope.row.targetAmount }} {{
scope.row.targetCurrencyCode
}}
</span>
<span v-else >
{{ scope.row.sourceCurrencyCode }}<el-input v-model="scope.row.sourceAmount" style="width: 100px" @input="() => sourceAmountChange(scope.row, scope.$index)"/>:
<el-input v-model="scope.row.targetAmount " style="width: 100px" @input="() => targetAmountChange(scope.row, scope.$index)"/>{{ scope.row.targetCurrencyCode }}
</span>
</template>
<template v-else>
{{ $t("应核销总金额") + "" + getCurrencyLabel(showCurrencyId) + "" }}
......@@ -166,13 +198,15 @@
{{ $t("基准金额") + "" + getCurrencyLabel(showCurrencyId) + "" }}
</template>
<template slot-scope="scope">
<div>{{ getCurrencySymbol(showCurrencyId) }}{{ scope.row.writeOffAmount }}</div></template
<div>{{ getCurrencySymbol(showCurrencyId) }}{{ scope.row.writeOffAmount }}</div>
</template
>
</el-table-column>
<el-table-column :label="$t('期望收款账户')" align="center">
<template slot-scope="scope">
<el-form-item v-if="scope.row.type !== 'total'" label="" label-width="0" style="margin-bottom: 0" :prop="`receiptAccountList.${scope.$index}.platformAccountId`">
<el-form-item v-if="scope.row.type !== 'total'" label="" label-width="0" style="margin-bottom: 0"
:prop="`receiptAccountList.${scope.$index}.platformAccountId`">
<!-- <el-select
v-model="scope.row.platformAccountId"
:placeholder="$t('请选择收款账户')"
......@@ -185,17 +219,23 @@
:value="item.id"
/>
</el-select> -->
<el-select filterable clear v-model="scope.row.platformAccountId" :placeholder="$t('请选择收款账户')" @change="(platformAccountId) => changePlatformAccountId(platformAccountId, scope.$index)" v-el-select-loadmore="loadmore" :loading="codeLoading">
<el-option v-for="(item, i) in bankData" :key="'opt-code' + i" :label="item.baAccountName + '(' + item.baAccountNum + ')'" :value="item.id"></el-option>
<el-select filterable clear v-model="scope.row.platformAccountId" :placeholder="$t('请选择收款账户')"
@change="(platformAccountId) => changePlatformAccountId(platformAccountId, scope.$index)"
v-el-select-loadmore="loadmore" :loading="codeLoading">
<el-option v-for="(item, i) in bankData" :key="'opt-code' + i"
:label="item.baAccountName + '(' + item.baAccountNum + ')'" :value="item.id"></el-option>
</el-select>
</el-form-item>
</template>
</el-table-column>
<el-table-column :label="$t('期望收款币种')" align="center">
<template slot-scope="scope">
<el-form-item v-if="scope.row.type !== 'total'" label="" label-width="0" style="margin-bottom: 0" :prop="`receiptAccountList.${scope.$index}.collectionCurrencyId`">
<el-select v-model="scope.row.collectionCurrencyId" :placeholder="$t('请选择')" @change="(val) => currencyIdChange(val, scope.row, scope.$index)">
<el-option v-for="item in currencyList" :key="item.id" :label="$i18n.locale == 'zh_CN' ? item.titleZh : item.titleEn" :value="item.id" />
<el-form-item v-if="scope.row.type !== 'total'" label="" label-width="0" style="margin-bottom: 0"
:prop="`receiptAccountList.${scope.$index}.collectionCurrencyId`">
<el-select v-model="scope.row.collectionCurrencyId" :placeholder="$t('请选择')"
@change="(val) => currencyIdChange(val, scope.row, scope.$index)">
<el-option v-for="item in currencyList" :key="item.id"
:label="$i18n.locale == 'zh_CN' ? item.titleZh : item.titleEn" :value="item.id"/>
</el-select>
</el-form-item>
</template>
......@@ -203,15 +243,20 @@
<el-table-column :label="$t('期望收款汇率')" align="center">
<!--lanbm 2024-05-06 汇率保留小数增加到6位,为了方便显示,加宽此列的显示-->
<template slot-scope="scope" style="width: 200px">
<el-form-item v-if="scope.row.type !== 'total'" label="" label-width="0" style="margin-bottom: 0" :prop="`receiptAccountList.${scope.$index}.collectionRate`">
<el-input v-model="scope.row.collectionRate" @input="() => rateChange(scope.row, scope.$index)"></el-input>
<el-form-item v-if="scope.row.type !== 'total'" label="" label-width="0" style="margin-bottom: 0">
<!-- <el-input v-model="scope.row.collectionRate"-->
<!-- @input="() => rateChange(scope.row, scope.$index)"></el-input>-->
{{ scope.row.collectionSourceCurrencyCode }}<el-input v-model="scope.row.collectionSourceAmount" style="width: 100px" @input="() => collectionSourceAmountChange(scope.row, scope.$index)"/>:
<el-input v-model="scope.row.collectionTargetAmount" style="width: 100px" @input="() => collectionTargetAmountChange(scope.row, scope.$index)"/>{{ scope.row.targetCurrencyCode }}
</el-form-item>
<span v-else>{{ $t("期望收费金额") }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('期望收款金额')" align="center" prop="collectionAmount">
<template slot-scope="scope">
<span v-if="scope.row.type !== 'total'">{{ getCurrencySymbol(scope.row.collectionCurrencyId) }}{{ scope.row.collectionAmount }}</span>
<span v-if="scope.row.type !== 'total'">{{
getCurrencySymbol(scope.row.collectionCurrencyId)
}}{{ scope.row.collectionAmount }}</span>
<div v-else>
<div v-for="itemAmount in scope.row.collectionAmount">
<!-- {{ itemAmount }}-- {{ $i18n.locale == "zh_CN" ? (itemAmount ? itemAmount.currencyNameZh : "") : itemAmount ? itemAmount.currencyNameEn : "" }}: -->
......@@ -229,7 +274,8 @@
<el-descriptions :column="2" border class="card">
<el-descriptions-item :label="$t('账单汇率有效期')">
<el-form-item label="" label-width="0" style="margin-bottom: 0" prop="rateValidateDate">
<el-date-picker v-model="form.rateValidateDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" :placeholder="$t('选择日期时间')"> </el-date-picker>
<el-date-picker v-model="form.rateValidateDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
:placeholder="$t('选择日期时间')"></el-date-picker>
</el-form-item>
</el-descriptions-item>
</el-descriptions>
......@@ -354,7 +400,8 @@
</el-form-item>
</el-descriptions-item>
<el-descriptions-item :label="$t('开票资料备注')">
<el-input type="textarea" rows="1" show-word-limit style="width: 78%" v-model="form.invoiceRemark" maxlength="500"></el-input>
<el-input type="textarea" rows="1" show-word-limit style="width: 78%" v-model="form.invoiceRemark"
maxlength="500"></el-input>
</el-descriptions-item>
</el-descriptions>
</el-card>
......@@ -364,9 +411,17 @@
<work-flow xmlkey="merge_order" v-model="form.copyUserList"></work-flow>
<div slot="footer" style="margin: 20px 0">
<el-button type="primary" @click="submitForm(0)" v-hasPermi="['ecw:voucher:create:sumbit']">{{ $t("提交申请") }}</el-button>
<el-button v-if="id == 0 || form.state == 0" type="primary" :loading="saveBtnLoading" v-hasPermi="['ecw:voucher:create:save']" @click="submitForm(1)">{{ $t("保存草稿") }}</el-button>
<el-button v-if="orderData.inWarehouseState == 207" type="primary" v-hasPermi="['ecw:voucher:create:see']" @click="$router.push(`/bpm/process-instance/detail?id=` + orderApprovalBackVO.applyingFormId)">{{ $t("审核中") }}</el-button>
<el-button type="primary" @click="submitForm(0)" v-hasPermi="['ecw:voucher:create:sumbit']">{{
$t("提交申请")
}}
</el-button>
<el-button v-if="id == 0 || form.state == 0" type="primary" :loading="saveBtnLoading"
v-hasPermi="['ecw:voucher:create:save']" @click="submitForm(1)">{{ $t("保存草稿") }}
</el-button>
<el-button v-if="orderData.inWarehouseState == 207" type="primary" v-hasPermi="['ecw:voucher:create:see']"
@click="$router.push(`/bpm/process-instance/detail?id=` + orderApprovalBackVO.applyingFormId)">
{{ $t("审核中") }}
</el-button>
<el-button plain type="primary" @click="$store.dispatch('tagsView/delCurrentView')">{{ $t("返回") }}</el-button>
</div>
......@@ -380,40 +435,45 @@
<el-row>
<el-form-item :label="$t('始发仓')">
<el-select v-model="queryParams.departureId" :placeholder="$t('请选择始发地')">
<el-option v-for="item in expoerCityList" :label="item.titleZh" :value="item.id" :key="item.id"></el-option>
<el-option v-for="item in expoerCityList" :label="item.titleZh" :value="item.id"
:key="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的仓')">
<el-select v-model="queryParams.objectiveId" :placeholder="$t('请选择始发地')">
<el-option v-for="item in importCityList" :label="item.titleZh" :value="item.id" :key="item.id"></el-option>
<el-option v-for="item in importCityList" :label="item.titleZh" :value="item.id"
:key="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('运输方式')">
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="queryParams.transportId" formatter="number" />
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="queryParams.transportId" formatter="number"/>
</el-form-item>
<el-form-item :label="$t('出货渠道')">
<el-select v-model="queryParams.channelId" :placeholder="$t('请选择出货渠道')">
<el-option v-for="item in channelList" :label="item.nameZh" :value="item.channelId" :key="item.channelId"></el-option>
<el-option v-for="item in channelList" :label="item.nameZh" :value="item.channelId"
:key="item.channelId"></el-option>
</el-select>
</el-form-item>
</el-row>
<el-row>
<el-form-item :label="$t('报关方式')">
<dict-selector :type="DICT_TYPE.ECW_CUSTOMS_TYPE" v-model="queryParams.customsType" />
<dict-selector :type="DICT_TYPE.ECW_CUSTOMS_TYPE" v-model="queryParams.customsType"/>
</el-form-item>
<el-form-item :label="$t('控货')">
<dict-selector :type="DICT_TYPE.INFRA_BOOLEAN_STRING" v-model="queryParams.control" />
<dict-selector :type="DICT_TYPE.INFRA_BOOLEAN_STRING" v-model="queryParams.control"/>
</el-form-item>
<el-form-item :label="$t('客户名称')">
<customer-selector v-model="queryParams.customerId" @change="consignor = $event" />
<customer-selector v-model="queryParams.customerId" @change="consignor = $event"/>
</el-form-item>
</el-row>
<el-form-item :label="$t('订单编号')" prop="orderNo">
<el-input v-model="queryParams.orderNo" :placeholder="$t('请输入订单编号')" clearable @keyup.enter.native="handleQuery" />
<el-input v-model="queryParams.orderNo" :placeholder="$t('请输入订单编号')" clearable
@keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item :label="$t('提单号')" prop="tidanNo">
<el-input v-model="queryParams.tidanNo" :placeholder="$t('请输入提单号')" clearable @keyup.enter.native="handleQuery" />
<el-input v-model="queryParams.tidanNo" :placeholder="$t('请输入提单号')" clearable
@keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item>
......@@ -421,25 +481,26 @@
</el-form-item>
</el-form>
<div class="hintBox">{{ $t("收款单只能选择相同目的国订单") }}</div>
<el-table ref="multipleTable" v-loading="loading1" :data="orderData" border @selection-change="handleSelectionChange" row-key="id" height="calc(100vh - 480px)">
<el-table-column type="selection" width="55" :selectable="selectableStatus"> </el-table-column>
<el-table-column :label="$t('订单号')" align="center" prop="orderNo" />
<el-table-column :label="$t('提单号')" align="center" prop="tidanNo" />
<el-table-column :label="$t('唛头')" align="center" prop="marks" />
<el-table ref="multipleTable" v-loading="loading1" :data="orderData" border
@selection-change="handleSelectionChange" row-key="id" height="calc(100vh - 480px)">
<el-table-column type="selection" width="55" :selectable="selectableStatus"></el-table-column>
<el-table-column :label="$t('订单号')" align="center" prop="orderNo"/>
<el-table-column :label="$t('提单号')" align="center" prop="tidanNo"/>
<el-table-column :label="$t('唛头')" align="center" prop="marks"/>
<el-table-column :label="$t('品名')" align="center" prop="title">
<template slot-scope="scope">
{{ scope.row.titleZh ? scope.row.titleZh + "(" + scope.row.titleEn + ")" : "" }}
</template>
</el-table-column>
<el-table-column :label="$t('箱数')" align="center" prop="num" />
<el-table-column :label="$t('箱数')" align="center" prop="num"/>
<el-table-column :label="$t('体积/重量')" align="center" prop="weight">
<template slot-scope="scope"> {{ scope.row.volume }}/{{ scope.row.weight }} </template>
<template slot-scope="scope"> {{ scope.row.volume }}/{{ scope.row.weight }}</template>
</el-table-column>
<el-table-column :label="$t('发货人')" align="center" prop="consignorName" />
<el-table-column :label="$t('收货人')" align="center" prop="consigneeName" />
<el-table-column :label="$t('发货人')" align="center" prop="consignorName"/>
<el-table-column :label="$t('收货人')" align="center" prop="consigneeName"/>
<el-table-column :label="$t('订单状态')" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.ORDER_STATUS" :value="scope.row.status" />
<dict-tag :type="DICT_TYPE.ORDER_STATUS" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column :label="$t('收入类型')" align="center" prop="feeType">
......@@ -461,7 +522,8 @@
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :limit.sync="queryParams.rows" @pagination="getList" />
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :limit.sync="queryParams.rows"
@pagination="getList"/>
<!-- </el-card> -->
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="saveSelectList">{{ $t("确认添加") }}</el-button>
......@@ -469,22 +531,23 @@
</div>
</div>
</el-dialog>
<el-dialog v-if="discountVisible" :visible.sync="discountVisible" :title="$t('优惠信息确认')" width="60%" append-to-body>
<el-dialog v-if="discountVisible" :visible.sync="discountVisible" :title="$t('优惠信息确认')" width="60%"
append-to-body>
<el-form label-width="120px">
<el-form-item v-if="form.receiptNo" :label="$t('收款单号')">
{{ form.receiptNo }}
</el-form-item>
<el-table :data="[selectListRow]" border style="margin-bottom: 22px">
<el-table-column :label="$t('订单号')" align="center" prop="orderNo" />
<el-table-column :label="$t('唛头')" align="center" prop="marks" />
<el-table-column :label="$t('订单号')" align="center" prop="orderNo"/>
<el-table-column :label="$t('唛头')" align="center" prop="marks"/>
<el-table-column :label="$t('品名')" align="center" prop="title">
<template slot-scope="scope">
{{ scope.row.titleZh ? scope.row.titleZh + "(" + scope.row.titleEn + ")" : "" }}
</template>
</el-table-column>
<el-table-column :label="$t('箱数')" align="center" prop="num" />
<el-table-column :label="$t('箱数')" align="center" prop="num"/>
<el-table-column :label="$t('体积/重量')" align="center" prop="weight">
<template slot-scope="scope"> {{ scope.row.volume }}/{{ scope.row.weight }} </template>
<template slot-scope="scope"> {{ scope.row.volume }}/{{ scope.row.weight }}</template>
</el-table-column>
<el-table-column :label="$t('收入类型')" align="center" prop="feeType">
<template slot-scope="scope">
......@@ -504,9 +567,13 @@
</template>
</el-table-column>
</el-table>
<el-form-item :label="$t('总金额')"> {{ selectListRow.taxAmount }}{{ getCurrencyLabel(selectListRow.currencyId) }} </el-form-item>
<el-form-item :label="$t('总金额')"> {{ selectListRow.taxAmount }}{{
getCurrencyLabel(selectListRow.currencyId)
}}
</el-form-item>
<el-form-item :label="$t('优惠金额')">
<el-input v-model="discountForm.discountTotal" type="number" min="0" :max="selectListRow.totalAmount" @input="checkDiscount" style="width: 300px"></el-input>
<el-input v-model="discountForm.discountTotal" type="number" min="0" :max="selectListRow.totalAmount"
@input="checkDiscount" style="width: 300px"></el-input>
&nbsp;&nbsp;{{ getCurrencyLabel(selectListRow.currencyId) }}
</el-form-item>
<el-form-item :label="$t('优惠原因')">
......@@ -532,28 +599,40 @@
</template>
<script>
import { listSimpleUsers } from "@/api/system/user"
import { DICT_TYPE } from "@/utils/dict"
import { getToken } from "@/utils/auth"
import {listSimpleUsers} from "@/api/system/user"
import {DICT_TYPE} from "@/utils/dict"
import {getToken} from "@/utils/auth"
import CustomerSelector from "@/components/CustomerSelector"
import CustomerSelectorpay from "@/components/CustomerSelectorpay"
import { getBankAccountPage } from "@/api/ecw/bankAccount"
import { listSimpleDepts } from "@/api/system/dept"
import { getChannelList } from "@/api/ecw/channel"
import { getTradeCityList } from "@/api/ecw/region"
import { createReceipt, getReceivableByOrderId, getReceivableList, getReceivableItemDetail, getReceiptInfoByIds, getReceiptAccountList, getInvoicingItem, updateReceipt, updateReceivableDiscountById, getReceivableDiscountLogById } from "@/api/ecw/financial"
import { getCustomer } from "@/api/ecw/customer"
import {getBankAccountPage} from "@/api/ecw/bankAccount"
import {listSimpleDepts} from "@/api/system/dept"
import {getChannelList} from "@/api/ecw/channel"
import {getTradeCityList} from "@/api/ecw/region"
import {
createReceipt,
getReceivableByOrderId,
getReceivableList,
getReceivableItemDetail,
getReceiptInfoByIds,
getReceiptAccountList,
getInvoicingItem,
updateReceipt,
updateReceivableDiscountById,
getReceivableDiscountLogById
} from "@/api/ecw/financial"
import {getCustomer} from "@/api/ecw/customer"
import NP from "number-precision"
import { getOrder, getDestCountryByOrderId } from "@/api/ecw/order"
import { getCurrencyPage } from "@/api/ecw/currency"
import { getExchangeRatePage } from "@/api/ecw/exchangeRate"
import {getOrder, getDestCountryByOrderId} from "@/api/ecw/order"
import {getCurrencyPage} from "@/api/ecw/currency"
import {getCurrencyRateAllAvailable} from "@/api/ecw/exchangeRate"
import ret from "bluebird/js/release/util"
import dayjs from "dayjs"
import { getUserProfile } from "@/api/system/user"
import { getWarehouseList } from "@/api/ecw/warehouse"
import {getUserProfile} from "@/api/system/user"
import {getWarehouseList} from "@/api/ecw/warehouse"
import WorkFlow from "@/components/WorkFlow/"
import { mapGetters } from "vuex"
import { list } from "@/api/system/loginlog"
import {mapGetters} from "vuex"
import {list} from "@/api/system/loginlog"
export default {
name: "EcwFinancialCreatcollection",
components: {
......@@ -647,7 +726,7 @@ export default {
// that.removeData()
}
if (that.$route.query.orderId) {
getReceivableByOrderId({ orderId: that.$route.query.orderId }).then((response) => {
getReceivableByOrderId({orderId: that.$route.query.orderId}).then((response) => {
that.list = [...response.data]
that.list.map((v) => {
if (!v.taxPoint) {
......@@ -679,7 +758,7 @@ export default {
}
}
})
getDestCountryByOrderId({ orderId: that.$route.query.orderId }).then((response) => {
getDestCountryByOrderId({orderId: that.$route.query.orderId}).then((response) => {
// console.log(response.data)
if (response.data) that.$set(that.queryParams, "destCountry", response.data)
})
......@@ -703,13 +782,13 @@ export default {
await getUserProfile().then((res) => (this.userInfo = res.data))
// 获取汇率
await getCurrencyPage(this.params).then((res) => (this.currencyList = res.data.list))
await getExchangeRatePage(this.params).then((res) => (this.rateList = res.data.list))
await getCurrencyRateAllAvailable().then((res) => (this.rateList = res.data.list))
getWarehouseList().then((res) => (this.warehouseList = res.data))
let that = this
if (that.$route.query.orderId) {
//lanbm 2024-05-20 添加订单ID
this.orderId = that.$route.query.orderId
await getReceivableByOrderId({ orderId: that.$route.query.orderId }).then((response) => {
await getReceivableByOrderId({orderId: that.$route.query.orderId}).then((response) => {
this.list = [...response.data]
this.list.map((v) => {
if (!v.taxPoint) {
......@@ -741,7 +820,7 @@ export default {
}
})
})
getDestCountryByOrderId({ orderId: this.$route.query.orderId }).then((response) => {
getDestCountryByOrderId({orderId: this.$route.query.orderId}).then((response) => {
if (response.data) this.$set(this.queryParams, "destCountry", response.data)
})
}
......@@ -856,7 +935,7 @@ export default {
},
//应收明细合计
getSummaries(param) {
const { columns, data } = param
const {columns, data} = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
......@@ -918,7 +997,7 @@ export default {
}, 200)
},
getReceivableData() {
getReceiptInfoByIds({ id: this.id }).then((res) => {
getReceiptInfoByIds({id: this.id}).then((res) => {
if (res.data.rateValidateDate) res.data.rateValidateDate = dayjs(res.data.rateValidateDate).format("YYYY-MM-DD HH:mm:ss")
this.form = Object.assign({}, this.form, res.data)
this.discountForm.author = this.userInfo.nickname
......@@ -932,7 +1011,7 @@ export default {
}
}
})
getInvoicingItem({ id: this.id }).then((res) => {
getInvoicingItem({id: this.id}).then((res) => {
this.list = [...res.data]
this.list.map((v) => {
if (!v.taxPoint) {
......@@ -940,7 +1019,7 @@ export default {
}
})
})
getReceiptAccountList({ id: this.id }).then((res) => {
getReceiptAccountList({id: this.id}).then((res) => {
if (res.data.length > 0) {
// totalAmount
res.data = [
......@@ -982,7 +1061,7 @@ export default {
})
},
getReceivableInfo() {
getReceivableItemDetail({ id: this.receiptId }).then((res) => {
getReceivableItemDetail({id: this.receiptId}).then((res) => {
this.list = res.data
this.list.map((v) => {
if (!v.taxPoint) {
......@@ -1009,8 +1088,12 @@ export default {
},
currencyIdChange(val, row, index) {
row.collectionCurrencyId = val
if (val == row.currencyId) row.collectionRate = 1
else {
if (val == row.currencyId) {
row.collectionSourceAmount = 1
row.collectionSourceCurrencyCode = this.getCurrencySymbol(row.currencyId)
row.collectionTargetAmount = 1
row.collectionTargetCurrencyCode = this.getCurrencySymbol(row.currencyId)
} else {
// if (row.currencyId == 1 && val == 3) row.collectionRate = this.UStoRMB()
// if (row.currencyId == 1 && val == 2) row.collectionRate = this.UStoNAN()
// if (row.currencyId == 3 && val == 1) row.collectionRate = this.RMBtoUS()
......@@ -1018,7 +1101,19 @@ export default {
// if (row.currencyId == 2 && val == 1) row.collectionRate = this.NANtoUS()
// if (row.currencyId == 2 && val == 3) row.collectionRate = this.NANtoRMB()
// row.collectionRate = NP.times(this.currencyList.find(v => v.id === row.currencyId).huilv/100, this.currencyList.find(v => v.id === val).exchangeToFc/100).toFixed(6)
row.collectionRate = this.getRate(row.currencyId, val)
var rate = this.getRate(row.currencyId, val);
if (rate){
row.collectionSourceAmount = rate.sourceAmount
row.collectionSourceCurrencyCode = this.getCurrencySymbol(row.currencyId)
row.collectionTargetAmount = rate.targetAmount
row.collectionTargetCurrencyCode = this.getCurrencySymbol(val)
} else {
row.collectionSourceAmount = 1
row.collectionSourceCurrencyCode = this.getCurrencySymbol(row.currencyId)
row.collectionTargetAmount = 1
row.collectionTargetCurrencyCode = this.getCurrencySymbol(row.currencyId)
}
}
this.rateChange(row, index)
......@@ -1026,15 +1121,25 @@ export default {
//获取汇率
getRate(sourceCurrencyId, targetCurrencyId) {
var rate = this.rateList.find((v) => v.sourceCurrencyId === sourceCurrencyId && v.targetCurrencyId === targetCurrencyId)
if (rate) return rate.currencyRate
return ""
if (rate) return rate
return null
},
writeOffRateChange(row, index) {
if (row.writeOffRate == 0 && parseInt(row.writeOffRate) === 0) {
this.$modal.msgError(this.$t("汇率不能为0,请输入正确的汇率"))
}
if (row.writeOffRate) {
row.writeOffAmount = NP.times(row.writeOffRate || 0, NP.minus(row.receivableAmount, row.discountTotal || 0)).toFixed(2)
targetAmountChange(row, index) {
if (!row.targetAmount) {
var rate = this.getRate(row.currencyId, this.showCurrencyId)
if (!rate) {
// this.$modal.msgError(this.$t("11汇率不能为0,请输入正确的汇率"))
this.$modal.msgError("11汇率不能为0,请输入正确的汇率")
}
row.targetAmount = rate.targetAmount
row.targetCurrencyCode = rate.targetCurrencyCode
}
if (row.targetAmount == 0 && parseInt(row.targetAmount) === 0) {
// this.$modal.msgError(this.$t("22汇率不能为0,请输入正确的汇率"))
this.$modal.msgError("22汇率不能为0,请输入正确的汇率")
}
if (row.targetAmount) {
row.writeOffAmount = NP.divide(NP.times(row.targetAmount || 0, NP.minus(row.receivableAmount, row.discountTotal || 0)), row.sourceAmount || 1).toFixed(2)
} else {
row.writeOffAmount = ""
}
......@@ -1043,9 +1148,40 @@ export default {
this.list.forEach((item) => {
if (item.currencyId == row.currencyId) {
item.exchangeRate = row.writeOffRate
item.baseAmount = NP.round(NP.divide(NP.times(row.targetAmount || 0, item.actualAmount), row.sourceAmount || 1), 2)
}
})
// this.list[index].exchangeRate = row.writeOffRate
// this.list[index].baseAmount = row.writeOffAmount
// console.log("listdd", this.list)
this.form.receiptAccountList[this.form.receiptAccountList.length - 1].writeOffAmount = writeOffAmountTotal
},
sourceAmountChange(row, index) {
if (!row.sourceAmount) {
var rate = this.getRate(row.currencyId, this.showCurrencyId)
if (!rate) {
// this.$modal.msgError(this.$t("33汇率不能为0,请输入正确的汇率"))
this.$modal.msgError("33汇率不能为0,请输入正确的汇率")
}
row.sourceAmount = rate.sourceAmount
row.sourceCurrencyCode = rate.sourceCurrencyCode
}
if (row.sourceAmount == 0 && parseInt(row.sourceAmount) === 0) {
// this.$modal.msgError(this.$t("44汇率不能为0,请输入正确的汇率"))
this.$modal.msgError("44汇率不能为0,请输入正确的汇率")
}
if (row.sourceAmount) {
row.writeOffAmount = NP.divide(NP.times(row.targetAmount || 0, NP.minus(row.receivableAmount, row.discountTotal || 0)), row.sourceAmount || 1).toFixed(2)
} else {
row.writeOffAmount = ""
}
item.baseAmount = NP.round(NP.times(row.writeOffRate || 0, item.actualAmount), 2)
const writeOffAmountTotal = this.form.receiptAccountList.filter((v) => v.type !== "total").reduce((total, currentValue) => NP.plus(total, currentValue.writeOffAmount || 0), 0)
this.list.forEach((item) => {
if (item.currencyId == row.currencyId) {
item.baseAmount = NP.round(NP.divide(NP.times(row.targetAmount || 0, item.actualAmount), row.sourceAmount || 1), 2)
}
})
// this.list[index].exchangeRate = row.writeOffRate
......@@ -1054,16 +1190,49 @@ export default {
this.form.receiptAccountList[this.form.receiptAccountList.length - 1].writeOffAmount = writeOffAmountTotal
},
rateChange(row, index) {
if (row.collectionRate == 0 && parseInt(row.collectionRate) === 0) {
this.$modal.msgError(this.$t("汇率不能为0,请输入正确的汇率"))
collectionSourceAmountChange(row, index) {
if (!row.collectionSourceAmount) {
var rate = this.getRate(row.currencyId, this.collectionCurrencyId)
if (!rate) {
this.$modal.msgError(this.$t("期望收款汇率不能为空"))
}
row.collectionSourceAmount = rate.sourceAmount
row.collectionSourceCurrencyCode = rate.sourceCurrencyCode
}
if (row.collectionSourceAmount == 0 && parseInt(row.collectionSourceAmount) === 0) {
this.$modal.msgError(this.$t("期望收款汇率不能为0,请输入正确的汇率"))
}
if (row.collectionSourceAmount) {
row.collectionAmount = NP.divide(NP.times(row.collectionTargetAmount || 0, NP.minus(row.receivableAmount, row.discountTotal || 0)), row.collectionSourceAmount || 1).toFixed(2)
} else {
row.collectionAmount = ""
}
},
collectionTargetAmountChange(row, index) {
if (!row.collectionTargetAmount) {
var rate = this.getRate(row.currencyId, this.collectionCurrencyId)
if (!rate) {
this.$modal.msgError(this.$t("期望收款汇率不能为空"))
}
row.collectionTargetAmount = rate.targetAmount
row.collectionTargetCurrencyCode = rate.targetCurrencyCode
}
if (row.collectionTargetAmount == 0 && parseInt(row.collectionTargetAmount) === 0) {
this.$modal.msgError(this.$t("期望收款汇率不能为0,请输入正确的汇率"))
}
if (row.collectionRate) {
row.receivableAmount && (row.collectionAmount = NP.times(row.collectionRate || 0, NP.minus(row.receivableAmount, row.discountTotal || 0)).toFixed(2))
if (row.collectionTargetAmount) {
row.collectionAmount = NP.divide(NP.times(row.collectionTargetAmount || 0, NP.minus(row.receivableAmount, row.discountTotal || 0)), row.collectionSourceAmount || 1).toFixed(2)
} else {
row.collectionAmount = ""
}
this.form.receiptAccountList[index] = { ...row }
},
rateChange(row, index) {
if (row.collectionTargetAmount && row.collectionSourceAmount) {
row.receivableAmount && (row.collectionAmount = NP.divide(NP.times(row.collectionTargetAmount || 0, NP.minus(row.receivableAmount, row.discountTotal || 0)), row.collectionSourceAmount || 1).toFixed(2))
} else {
row.collectionAmount = ""
}
this.form.receiptAccountList[index] = {...row}
setTimeout(() => {
// 收款总计
......@@ -1110,8 +1279,8 @@ export default {
// 财务2.2. 实际金额 含税金额-优惠金额
row.actualAmount = NP.minus(row.taxAmount, row.discountTotal)
//财务2.2 基准金额 实际金额*账单明细对应应收币种汇率(保留两位小数)
row.baseAmount = NP.round(NP.times(row.actualAmount, row.exchangeRate), 2)
this.list[index] = { ...row }
row.baseAmount = NP.round(NP.divide(NP.times(row.actualAmount, row.targetAmount), row.sourceAmount), 2)
this.list[index] = {...row}
let dataArrTemp = JSON.stringify(this.list)
this.list = JSON.parse(dataArrTemp)
if (pointArr.length > 1 && !pointArr[1]) {
......@@ -1135,10 +1304,17 @@ export default {
currencyId: item.id,
receivableAmount: NP.round(dollar, 2),
writeOffRate: item.id == this.showCurrencyId ? 1 : dollarList[0].exchangeRate,
sourceAmount: item.id == this.showCurrencyId ? 1 : dollarList[0].sourceAmount,
sourceCurrencyCode: item.id == this.showCurrencyId ? item.fuhao : dollarList[0].sourceCurrencyCode,
targetAmount: item.id == this.showCurrencyId ? 1 : dollarList[0].targetAmount,
targetCurrencyCode: item.id == this.showCurrencyId ? item.fuhao : dollarList[0].targetCurrencyCode,
// this.getRate(item.id, this.showCurrencyId),
platformAccountId: t?.platformAccountId || "",
collectionCurrencyId: item.id,
collectionRate: 1
collectionSourceAmount: item.id == this.collectionCurrencyId ? 1 : dollarList[0].sourceAmount,
collectionSourceCurrencyCode: item.id == this.collectionCurrencyId ? item.fuhao : dollarList[0].sourceCurrencyCode,
collectionTargetAmount: item.id == this.collectionCurrencyId ? 1 : dollarList[0].targetAmount,
collectionTargetCurrencyCode: item.id == this.collectionCurrencyId ? item.fuhao : dollarList[0].targetCurrencyCode,
})
this.calculationCount(NP.minus(dollar, discountDollar), item.id)
}
......@@ -1165,7 +1341,11 @@ export default {
const index = this.form.receiptAccountList.findIndex((v) => v.currencyId == type)
const t = this.form.receiptAccountList[index]
if (t) {
t.writeOffAmount = NP.times(t.writeOffRate || 0, usCount).toFixed(2)
t.writeOffAmount = NP.divide(NP.times(t.targetAmount || 0, usCount), t.sourceAmount || 1).toFixed(2)
t.collectionSourceAmount = t.sourceAmount
t.collectionSourceCurrencyCode = t.sourceCurrencyCode
t.collectionTargetAmount = t.targetAmount
t.collectionTargetCurrencyCode = t.targetCurrencyCode
this.rateChange(t, index)
}
},
......@@ -1213,7 +1393,7 @@ export default {
setTimeout(() => {
// getReceivableInfoByIds({ id: this.selectListRow.id }).then(res => {
this.$set(this.list, this.selectListIndex, { ...discount })
this.$set(this.list, this.selectListIndex, {...discount})
this.cancelDiscount()
this.calculation()
// })
......@@ -1268,11 +1448,11 @@ export default {
},
addDiscount(row, index) {
this.discountVisible = true
this.selectListRow = { ...row }
this.selectListRow = {...row}
console.log(this.selectListRow)
this.selectListIndex = index
this.$set(this.discountForm, "time", dayjs().format("YYYY-MM-DD HH:mm:ss"))
getReceivableDiscountLogById({ id: row.id }).then((res) => {
getReceivableDiscountLogById({id: row.id}).then((res) => {
if (res.data?.creatorName) {
this.$set(this.discountForm, "time", dayjs(res.data.createTime).format("YYYY-MM-DD HH:mm:ss"))
this.$set(this.discountForm, "discountTotal", res.data.discountTotal)
......@@ -1291,7 +1471,7 @@ export default {
getList() {
this.loading1 = true
// 处理查询参数
let params = { ...this.queryParams }
let params = {...this.queryParams}
this.addBeginAndEndTime(params, this.dateType, "createTime")
// 执行查询
getReceivableList(params).then((response) => {
......@@ -1541,31 +1721,38 @@ export default {
.card {
margin-top: 20px;
}
.dialog-footer {
// padding: 40px;
text-align: left;
}
.card-title {
font-size: 18px;
font-weight: bold;
}
::v-deep .el-descriptions-item__label {
width: 200px;
}
.amountCard {
::v-deep .el-descriptions-item__label {
width: 20%;
}
::v-deep .el-descriptions-item__content {
width: 30%;
}
}
.bpm-title {
font-size: 20px;
font-weight: bold;
color: #666;
margin: 20px 0;
}
.hintBox {
font-size: 12px;
color: #c9c9c9;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment