Commit 2e20814d authored by dcy's avatar dcy

Merge remote-tracking branch 'origin/dev' into dev

parents a4ce6aee c80e5a02
...@@ -46,20 +46,20 @@ export function getReceiptList(query) { ...@@ -46,20 +46,20 @@ export function getReceiptList(query) {
} }
// 核销收款单 // 核销收款单
export function receiptVerification(id) { // export function receiptVerification(id) {
return request({ // return request({
url: '/ecw/receipt/verification/' + id, // url: '/ecw/receipt/verification/' + id,
method: 'GET' // method: 'GET'
}) // })
} // }
// 反核销收款单 // 反核销收款单
export function receiptVerificationCancel(id) { // export function receiptVerificationCancel(id) {
return request({ // return request({
url: '/ecw/receipt/verificationCancel/' + id, // url: '/ecw/receipt/verificationCancel/' + id,
method: 'GET' // method: 'GET'
}) // })
} // }
// 获取收款单详情 // 获取收款单详情
export function getReceiptInfoByIds(query) { export function getReceiptInfoByIds(query) {
......
...@@ -163,7 +163,7 @@ export function orderWarehouseIn(data){ ...@@ -163,7 +163,7 @@ export function orderWarehouseIn(data){
}) })
} }
// 入仓 // 入仓修改
export function orderWarehouseInUpdateApply(data){ export function orderWarehouseInUpdateApply(data){
return request({ return request({
url: '/order/order-warehouse-in/update-apply', url: '/order/order-warehouse-in/update-apply',
...@@ -171,6 +171,13 @@ export function orderWarehouseInUpdateApply(data){ ...@@ -171,6 +171,13 @@ export function orderWarehouseInUpdateApply(data){
data data
}) })
} }
// 获取入仓修改审批单详情-审批使用
export function getWarehouseUpdateApprovalInfo(id) {
return request({
url: '/order/order-warehouse-in/get-update-approval-info?formId=' + id,
method: 'get'
})
}
// 入仓完成 // 入仓完成
export function orderWarehouseInFinish(data){ export function orderWarehouseInFinish(data){
......
<template> <template>
<div class="dict-selector"> <div class="dict-selector">
<el-select v-if="formType == 'select'" v-model="valueSync" :placeholder="placeholder" clearable :multiple="multiple" :disabled="disabled"> <el-select v-if="formType == 'select'" v-model="valueSync" :placeholder="placeholder" clearable :multiple="multiple" :disabled="disabled" @change="val => $emit('change', val)">
<el-option v-for="dict in formattedList" <el-option v-for="dict in formattedList"
:key="dict.value" :label="dict.label" :value="dict.value"/> :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select> </el-select>
......
...@@ -177,6 +177,11 @@ export default { ...@@ -177,6 +177,11 @@ export default {
processId: this.processInstance.businessKey, processId: this.processInstance.businessKey,
type: 1 type: 1
}, },
warehouse_update: {
component: "warehouseDetails",
processId: this.processInstance.businessKey,
type: 4
},
container_modify: { container_modify: {
component: "shippingDetail", component: "shippingDetail",
processId: this.processInstance.businessKey, processId: this.processInstance.businessKey,
......
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
<el-card class="card"> <el-card class="card amountCard">
<div slot="header" class="card-title">订单信息</div> <div slot="header" class="card-title">订单信息</div>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
...@@ -114,21 +114,6 @@ ...@@ -114,21 +114,6 @@
</el-table-column> </el-table-column>
<el-table-column label="箱数" align="center" prop="num" /> <el-table-column label="箱数" align="center" prop="num" />
<el-table-column label="体积/重量" align="center" prop="weight" /> <el-table-column label="体积/重量" align="center" prop="weight" />
<!-- <el-table-column label="发货人" align="center" prop="consignorName" />
<el-table-column label="收货人" align="center" prop="consigneeName" /> -->
<!-- <el-table-column label="订单状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag
:type="DICT_TYPE.ORDER_STATUS"
:value="scope.row.status"
/>
</template>
</el-table-column> -->
<!-- <el-table-column label="收款类型" align="center" prop="paymentType">
<template slot-scope="scope">
<dict-selector :type="DICT_TYPE.PAYMENT_TYPE" v-model="scope.row.paymentType"></dict-selector>
</template>
</el-table-column> -->
<el-table-column label="收入类型" align="center" prop="feeType"> <el-table-column label="收入类型" align="center" prop="feeType">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <dict-tag
...@@ -149,29 +134,9 @@ ...@@ -149,29 +134,9 @@
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="核销比例" align="center" prop="totalAmount">
<template slot-scope="scope">
<span>{{ scope.row.totalAmount }}%</span>
</template>
</el-table-column> -->
<!-- <el-table-column label="已收金额" align="center" prop="unitPrice">
<template slot-scope="scope">
<span>{{ scope.row.unitPrice }}</span>
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
</template>
</el-table-column>
<el-table-column label="本次实收金额" align="center" prop="amount">
<template slot-scope="scope">
<el-input v-model="scope.row.amount">
<template slot="append">
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
</template>
</el-input>
</template>
</el-table-column> -->
</el-table> </el-table>
<el-descriptions :column="1" border class="card"> <el-descriptions :column="2" border class="card">
<el-descriptions-item v-for="(v, index) in form.receiptAccountList" :label="`收款账户${index + 1}`" :key="index"> <!-- <el-descriptions-item v-for="(v, index) in form.receiptAccountList" :label="`收款账户${index + 1}`" :key="index">
<div style="display: flex"> <div style="display: flex">
<el-form-item <el-form-item
label="" label=""
...@@ -207,7 +172,7 @@ ...@@ -207,7 +172,7 @@
<el-button type="text" v-if="index === 0" @click="form.receiptAccountList = [...form.receiptAccountList, {}]">添加收款账户</el-button> <el-button type="text" v-if="index === 0" @click="form.receiptAccountList = [...form.receiptAccountList, {}]">添加收款账户</el-button>
<el-button type="text" v-if="index > 0" @click="subtractItem(index)"><span style="color: red">删除</span></el-button> <el-button type="text" v-if="index > 0" @click="subtractItem(index)"><span style="color: red">删除</span></el-button>
</div> </div>
</el-descriptions-item> </el-descriptions-item> -->
<el-descriptions-item label="是否需要开票"> <el-descriptions-item label="是否需要开票">
<el-form-item <el-form-item
...@@ -230,68 +195,6 @@ ...@@ -230,68 +195,6 @@
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" /> <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
<!-- <div class="card">
<el-form-item
label="收款附件"
label-width="120px"
style="margin-bottom: 0; width: 33%; display: inline-block"
prop="wenjian"
>
<el-upload
class="upload-demo"
:action="uploadFileUrl"
:headers="headers"
:on-success="handleUploadSuccess"
:before-upload="handleBeforeUpload"
:on-error="handleUploadError"
:before-remove="beforeRemove"
multiple
>
<el-button size="small" type="primary">上传附件</el-button>
</el-upload>
</el-form-item>
<el-form-item
label="水单号:"
label-width="120px"
style="
margin-bottom: 0;
width: 31%;
margin-left: 2%;
display: inline-block;
"
prop="waterBillNo"
required
error="水单号不能为空"
>
<el-input
v-model="form.waterBillNo"
maxlength="200"
placeholder="请输入水单号"
></el-input>
</el-form-item>
<el-form-item
label="实收日期:"
label-width="120px"
style="
margin-bottom: 0;
width: 31%;
margin-left: 2%;
display: inline-block;
"
prop="payedAt"
required
error="实收日期不能为空"
>
<el-date-picker
clearable
v-model="form.payedAt"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
type="date"
placeholder="选择实收日期"
/>
</el-form-item>
</div> -->
</el-card> </el-card>
<el-card v-if="showInvoice" class="card"> <el-card v-if="showInvoice" class="card">
<div slot="header" class="card-title">开票资料</div> <div slot="header" class="card-title">开票资料</div>
...@@ -375,7 +278,126 @@ ...@@ -375,7 +278,126 @@
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
<el-card class="card amountCard"> <el-card class="card">
<div slot="header" class="card-title">应收账单</div>
<el-table :data="form.receiptAccountList" border>
<el-table-column label="应收币种" align="center">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
</template>
</el-table-column>
<el-table-column label="应收金额" align="center" prop="receivableAmount" />
<el-table-column align="center" width="220">
<template #header>
核销基准币种(<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />)汇率
</template>
<template slot-scope="scope">
<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"></el-input>
</el-form-item>
</template>
<template v-else>
应收总金额(<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
</template>
</template>
</el-table-column>
<el-table-column align="center" prop="writeOffAmount">
<template #header>
核销基准金额(<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
</template>
</el-table-column>
<el-table-column label="收款账户" 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-select
v-model="scope.row.platformAccountId"
placeholder="请选择收款账户"
>
<el-option
v-for="item in bankData"
:key="item.id"
:label="item.baAccountName + '(' + item.baAccountNum + ')'"
:value="item.id"
/>
</el-select>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="收款币种" 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`"
>
<dict-selector
:type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT"
v-model="scope.row.collectionCurrencyId"
@change="val => currencyIdChange(val, scope.row, scope.$index)"
/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="收款汇率" 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}.collectionRate`"
>
<el-input v-model="scope.row.collectionRate" @input="() => rateChange(scope.row, scope.$index)"></el-input>
</el-form-item>
<span v-else>收款总金额</span>
</template>
</el-table-column>
<el-table-column label="收款金额" align="center" prop="collectionAmount">
<template slot-scope="scope">
<span v-if="scope.row.type !== 'total'">{{ scope.row.collectionAmount }}</span>
<div v-else>
<div v-if="scope.row.collectionAmount[0]">美元: {{ scope.row.collectionAmount[0] }}</div>
<div v-if="scope.row.collectionAmount[1]">人民币: {{ scope.row.collectionAmount[1] }}</div>
<div v-if="scope.row.collectionAmount[2]">奈拉: {{ scope.row.collectionAmount[2] }}</div>
</div>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template>
</el-table-column>
</el-table>
<el-descriptions :column="2" border class="card">
<el-descriptions-item label="账单汇率有效期">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="rateValidateDate"
>
<el-date-picker
v-model="form.rateValidateDate"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
</el-descriptions-item>
</el-descriptions>
</el-card>
<!-- <el-card class="card amountCard">
<el-descriptions :column="2" border> <el-descriptions :column="2" border>
<template v-for="(item, index) in form.receivableDetailList"> <template v-for="(item, index) in form.receivableDetailList">
<el-descriptions-item :label="index === 0 ? '应收总金额' : ''" :key="index+3"> <el-descriptions-item :label="index === 0 ? '应收总金额' : ''" :key="index+3">
...@@ -398,40 +420,6 @@ ...@@ -398,40 +420,6 @@
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
</template> </template>
<!-- <el-descriptions-item label="">-</el-descriptions-item>
<el-descriptions-item>
<template v-if="showCurrencyId !== 2" slot="label">
汇率(<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />)
</template>
<el-form-item
v-if="showCurrencyId !== 2"
label=""
label-width="0"
style="margin-bottom: 0"
prop="addressPhone"
required
error="请输入汇率"
>
<el-input v-model="form.addressPhone"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="">-</el-descriptions-item>
<el-descriptions-item>
<template v-if="showCurrencyId !== 3" slot="label">
汇率(<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />)
</template>
<el-form-item
v-if="showCurrencyId !== 3"
label=""
label-width="0"
style="margin-bottom: 0"
prop="taxRate"
required
error="请输入汇率"
>
<el-input v-model="form.taxRate"></el-input>
</el-form-item>
</el-descriptions-item> -->
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> <template slot="label">
应收总金额(<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />) 应收总金额(<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />)
...@@ -439,7 +427,7 @@ ...@@ -439,7 +427,7 @@
{{ form.receivableTotalAmount }} {{ form.receivableTotalAmount }}
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card> -->
</el-form> </el-form>
<div slot="footer" style="margin: 20px 0"> <div slot="footer" style="margin: 20px 0">
<el-button type="primary" @click="submitForm(1)">保 存</el-button> <el-button type="primary" @click="submitForm(1)">保 存</el-button>
...@@ -636,11 +624,16 @@ export default { ...@@ -636,11 +624,16 @@ export default {
loading1: false, loading1: false,
uploadFileUrl: process.env.VUE_APP_BASE_API + "/app-api/file/upload", // 上传的图片服务器地址 uploadFileUrl: process.env.VUE_APP_BASE_API + "/app-api/file/upload", // 上传的图片服务器地址
form: { form: {
receiptAccountList: [{}], // receiptAccountList: [{}],
receivableDetailList: [ // receivableDetailList: [
{ amount: 0, currencyId: 1, rate: 0 }, // { amount: 0, currencyId: 1, rate: 0 },
{ amount: 0, currencyId: 2, rate: 0 }, // { amount: 0, currencyId: 2, rate: 0 },
{ amount: 0, currencyId: 3, rate: 0 } // { amount: 0, currencyId: 3, rate: 0 }
// ],
receiptAccountList: [
// { currencyId: 1, receivableAmount: 0, writeOffRate: 1, writeOffAmount: 999, platformAccountId: '', currencyId: '', rate: 1, collectionAmount: 0 },
// { currencyId: 2, receivableAmount: 0, writeOffRate: 1, writeOffAmount: 999, platformAccountId: '', currencyId: '', rate: 1, collectionAmount: 0 },
// { currencyId: 3, receivableAmount: 0, writeOffRate: 1, writeOffAmount: 999, platformAccountId: '', currencyId: '', rate: 1, collectionAmount: 0 },
] ]
}, },
creatorData: [], creatorData: [],
...@@ -687,13 +680,31 @@ export default { ...@@ -687,13 +680,31 @@ export default {
this.list = [...res.data] this.list = [...res.data]
}) })
getReceiptAccountList({ id: this.id }).then(res => { getReceiptAccountList({ id: this.id }).then(res => {
if (res.data.length > 0) {
// totalAmount
res.data = [...res.data, {
type: 'total',
writeOffAmount: res.data.reduce((total, currentValue) => NP.plus(total, currentValue.writeOffAmount || 0), 0),
collectionAmount: [0, 0, 0]
}]
}
this.$set(this.form, 'receiptAccountList', [...res.data]) this.$set(this.form, 'receiptAccountList', [...res.data])
this.$nextTick(() => {
this.form.receiptAccountList.forEach((item, index) => {
this.rateChange(item, index)
});
})
}) })
} }
if (that.$route.query.receiptId && that.$route.query.receiptId !== '0') { if (that.$route.query.receiptId && that.$route.query.receiptId !== '0') {
this.receiptId = this.$route.query.receiptId; this.receiptId = this.$route.query.receiptId;
getReceivableInfoByIds({ id: this.receiptId }).then(res => { getReceivableInfoByIds({ id: this.receiptId }).then(res => {
this.list = [{...res.data}] this.list = [{...res.data}]
// this.list = [
// { collectionAmount: 100, currencyId: 2 },
// { collectionAmount: 100, currencyId: 3 },
// { collectionAmount: 100, currencyId: 3 },
// ]
// this.$set(this.form, 'supplierId', res.data.supplierId) // this.$set(this.form, 'supplierId', res.data.supplierId)
this.calculation() this.calculation()
}) })
...@@ -761,49 +772,146 @@ export default { ...@@ -761,49 +772,146 @@ export default {
} }
}, },
methods: { methods: {
currencyIdChange(val, row, index) {
row.collectionCurrencyId = val
if (val == row.currencyId) row.collectionRate = 1
else {
if (row.currencyId == 1 && val == 2) row.collectionRate = this.UStoRMB()
if (row.currencyId == 1 && val == 3) row.collectionRate = this.UStoNAN()
if (row.currencyId == 2 && val == 1) row.collectionRate = this.RMBtoUS()
if (row.currencyId == 2 && val == 3) row.collectionRate = this.RMBtoNAN()
if (row.currencyId == 3 && val == 1) row.collectionRate = this.NANtoUS()
if (row.currencyId == 3 && val == 2) row.collectionRate = this.NANtoRMB()
}
this.rateChange(row, index)
},
rateChange(row, index) {
row.receivableAmount && (row.collectionAmount = NP.times(row.collectionRate || 0, row.receivableAmount))
this.form.receiptAccountList[index] = {...row}
setTimeout(() => {
// 收款总计
const dollarList = this.form.receiptAccountList.filter(v => v.collectionCurrencyId == 1)
const dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0)
const rmbList = this.form.receiptAccountList.filter(v => v.collectionCurrencyId == 2)
const rmb = rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0)
const nairaList = this.form.receiptAccountList.filter(v => v.collectionCurrencyId == 3)
const naira = nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0)
this.form.receiptAccountList[this.form.receiptAccountList.length -1].collectionAmount = [dollar, rmb, naira]
this.$set(this.form, 'receiptAccountList', [...this.form.receiptAccountList])
}, 100)
},
calculation() { calculation() {
const copyList = this.form.receiptAccountList
this.form.receiptAccountList = []
const dollarList = this.list.filter(v => v.currencyId === 1) const dollarList = this.list.filter(v => v.currencyId === 1)
const dollar = dollarList.length > 0 ? dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.totalAmount || 0), 0) : 0 let dollar
if (dollarList.length > 0) {
dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.totalAmount || 0), 0)
const t = copyList.find(v => v.currencyId == 1)
this.form.receiptAccountList = [
{
currencyId: 1,
receivableAmount: dollar,
writeOffRate: t?.writeOffRate || (this.showCurrencyId === 1 ? 1 : this.showCurrencyId === 2 ? this.UStoRMB() : this.UStoNAN()),
platformAccountId: t?.platformAccountId || '',
collectionCurrencyId: t?.collectionCurrencyId || '',
collectionRate: t?.collectionRate || ''
}
]
this.calculationCount(dollar, 1)
}
const rmbList = this.list.filter(v => v.currencyId === 2) const rmbList = this.list.filter(v => v.currencyId === 2)
const rmb = rmbList.length > 0 ? rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.totalAmount || 0), 0) : 0 let rmb
if (rmbList.length > 0) {
rmb = rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.totalAmount || 0), 0)
const t = copyList.find(v => v.currencyId == 2)
this.form.receiptAccountList = [
...this.form.receiptAccountList,
{
currencyId: 2,
receivableAmount: rmb,
writeOffRate: t?.writeOffRate || (this.showCurrencyId === 1 ? this.RMBtoUS() : this.showCurrencyId === 2 ? 1 : this.RMBtoNAN()),
platformAccountId: t?.platformAccountId || '',
collectionCurrencyId: t?.collectionCurrencyId || '',
collectionRate: t?.collectionRate || ''
}
]
this.calculationCount(rmb, 2)
}
const nairaList = this.list.filter(v => v.currencyId === 3) const nairaList = this.list.filter(v => v.currencyId === 3)
const naira = nairaList.length > 0 ? nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.totalAmount || 0), 0) : 0 let naira
if (nairaList.length > 0) {
naira = nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.totalAmount || 0), 0)
const t = copyList.find(v => v.currencyId == 3)
this.form.receiptAccountList = [
...this.form.receiptAccountList,
{
currencyId: 3,
receivableAmount: naira,
writeOffRate: t?.writeOffRate || (this.showCurrencyId === 1 ? this.NANtoUS() : this.showCurrencyId === 2 ? this.NANtoRMB() : 1),
platformAccountId: t?.platformAccountId || '',
collectionCurrencyId: t?.collectionCurrencyId || '',
collectionRate: t?.collectionRate || ''
}
]
this.calculationCount(naira, 3)
}
if (this.form.receiptAccountList.length > 0) {
// totalAmount
const totalt = this.form.receiptAccountList.reduce((total, currentValue) => NP.plus(total, currentValue.writeOffAmount || 0), 0)
this.form.receiptAccountList = [...this.form.receiptAccountList, {
type: 'total',
writeOffAmount: totalt,
collectionAmount: [0, 0, 0]
}]
this.form.receivableTotalAmount = totalt
}
// receiptAccountList: [
// { currencyId: 1, receivableAmount: 0, writeOffRate: 1, writeOffAmount: 999, platformAccountId: '', currencyId: '', rate: 1, collectionAmount: 0 },
// { currencyId: 2, receivableAmount: 0, writeOffRate: 1, writeOffAmount: 999, platformAccountId: '', currencyId: '', rate: 1, collectionAmount: 0 },
// { currencyId: 3, receivableAmount: 0, writeOffRate: 1, writeOffAmount: 999, platformAccountId: '', currencyId: '', rate: 1, collectionAmount: 0 },
// ]
if (this.showCurrencyId === 1) { // 美元 if (this.showCurrencyId === 1) { // 美元
const usCount = NP.plus(dollar, NP.times(this.RMBtoUS(), rmb), NP.times(this.NANtoUS(), naira)) // const usCount = NP.plus(dollar, NP.times(this.RMBtoUS(), rmb), NP.times(this.NANtoUS(), naira))
this.form.receivableDetailList[0].rate = 1 // this.form.receivableDetailList[0].rate = 1
this.form.receivableDetailList[0].amount = usCount // this.form.receivableDetailList[0].amount = usCount
this.form.receivableDetailList[1].rate || (this.form.receivableDetailList[1].rate = this.UStoRMB()) // this.form.receivableDetailList[1].rate || (this.form.receivableDetailList[1].rate = this.UStoRMB())
this.form.receivableDetailList[2].rate || (this.form.receivableDetailList[2].rate = this.UStoNAN()) // this.form.receivableDetailList[2].rate || (this.form.receivableDetailList[2].rate = this.UStoNAN())
this.form.receivableTotalAmount = usCount // this.form.receivableTotalAmount = usCount
this.calculationCount(usCount) // this.calculationCount(usCount)
} else if (this.showCurrencyId === 2) { // 人民币 } else if (this.showCurrencyId === 2) { // 人民币
const rmbCount = NP.plus(rmb, NP.times(this.UStoRMB(), dollar), NP.times(this.NANtoRMB(), naira)) // const rmbCount = NP.plus(rmb, NP.times(this.UStoRMB(), dollar), NP.times(this.NANtoRMB(), naira))
this.form.receivableDetailList[1].rate = 1 // this.form.receivableDetailList[1].rate = 1
this.form.receivableDetailList[1].amount = usCount // this.form.receivableDetailList[1].amount = usCount
this.form.receivableDetailList[0].rate || (this.form.receivableDetailList[0].rate = this.RMBtoUS()) // this.form.receivableDetailList[0].rate || (this.form.receivableDetailList[0].rate = this.RMBtoUS())
this.form.receivableDetailList[2].rate || (this.form.receivableDetailList[2].rate = this.RMBtoNAN()) // this.form.receivableDetailList[2].rate || (this.form.receivableDetailList[2].rate = this.RMBtoNAN())
this.form.receivableTotalAmount = rmbCount // this.form.receivableTotalAmount = rmbCount
this.calculationCount(rmbCount) // this.calculationCount(rmbCount)
} else if (this.showCurrencyId === 3) { // 奈拉 } else if (this.showCurrencyId === 3) { // 奈拉
const nairaCount = NP.plus(naira, NP.times(this.UStoNAN(), dollar), NP.times(this.RMBtoNAN(), rmb)) // const nairaCount = NP.plus(naira, NP.times(this.UStoNAN(), dollar), NP.times(this.RMBtoNAN(), rmb))
this.form.receivableDetailList[2].rate = 1 // this.form.receivableDetailList[2].rate = 1
this.form.receivableDetailList[2].amount = nairaCount // this.form.receivableDetailList[2].amount = nairaCount
this.form.receivableDetailList[0].rate || (this.form.receivableDetailList[0].rate = this.NANtoUS()) // this.form.receivableDetailList[0].rate || (this.form.receivableDetailList[0].rate = this.NANtoUS())
this.form.receivableDetailList[1].rate || (this.form.receivableDetailList[1].rate = this.NANtoRMB()) // this.form.receivableDetailList[1].rate || (this.form.receivableDetailList[1].rate = this.NANtoRMB())
this.form.receivableTotalAmount = nairaCount // this.form.receivableTotalAmount = nairaCount
this.calculationCount(nairaCount) // this.calculationCount(nairaCount)
} }
this.$set(this.form, 'receiptAccountList', [...this.form.receiptAccountList])
}, },
calculationCount(usCount) { calculationCount(usCount, type) {
if (this.showCurrencyId === 1) { const index = this.form.receiptAccountList.findIndex(v => v.currencyId == type)
this.form.receivableDetailList[2].amount = NP.times(this.form.receivableDetailList[2].rate, usCount) const t = this.form.receiptAccountList[index]
this.form.receivableDetailList[1].amount = NP.times(this.form.receivableDetailList[1].rate, usCount) if (t) {
} else if (this.showCurrencyId === 2) { t.writeOffAmount = NP.times(t.writeOffRate || 0, usCount)
this.form.receivableDetailList[2].amount = NP.times(this.form.receivableDetailList[2].rate, usCount) this.rateChange(t, index)
this.form.receivableDetailList[0].amount = NP.times(this.form.receivableDetailList[0].rate, usCount)
} else if (this.showCurrencyId === 3) {
this.form.receivableDetailList[1].amount = NP.times(this.form.receivableDetailList[1].rate, usCount)
this.form.receivableDetailList[0].amount = NP.times(this.form.receivableDetailList[0].rate, usCount)
} }
}, },
RMBtoUS() { RMBtoUS() {
...@@ -839,10 +947,10 @@ export default { ...@@ -839,10 +947,10 @@ export default {
} }
}) })
}, },
subtractItem(index) { // subtractItem(index) {
this.form.receiptAccountList.splice(index, 1) // this.form.receiptAccountList.splice(index, 1)
this.$set(this.form, 'receiptAccountList', [...this.form.receiptAccountList]) // this.$set(this.form, 'receiptAccountList', [...this.form.receiptAccountList])
}, // },
getReceivableListByIds() { getReceivableListByIds() {
}, },
...@@ -902,7 +1010,8 @@ export default { ...@@ -902,7 +1010,8 @@ export default {
}, },
submitForm(addType) { submitForm(addType) {
const params = {...this.form, addType} const params = {...this.form, addType}
params.receiptAccountList = params.receiptAccountList params.receiptAccountList.length = params.receiptAccountList.length - 1
// params.receiptAccountList = params.receiptAccountList.map(v => Object.assign(v, { }))
delete params.receivableDetail delete params.receivableDetail
if (this.list && this.list.length > 0) { if (this.list && this.list.length > 0) {
params.receivableVOList = this.list params.receivableVOList = this.list
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<el-descriptions-item label="纳税人识别号">{{ invoiceData.taxpayer }}</el-descriptions-item> <el-descriptions-item label="纳税人识别号">{{ invoiceData.taxpayer }}</el-descriptions-item>
<el-descriptions-item label="地址">{{ invoiceData.addressPhone }}</el-descriptions-item> <el-descriptions-item label="地址">{{ invoiceData.addressPhone }}</el-descriptions-item>
<el-descriptions-item label="开户行">{{ invoiceData.accountBank }}</el-descriptions-item> <el-descriptions-item label="开户行">{{ invoiceData.accountBank }}</el-descriptions-item>
<el-descriptions-item label="税率"> <el-descriptions-item label="税率%">
<el-form-item label=""> <el-form-item label="">
<el-input v-model="invoiceData.taxRate"></el-input> <el-input v-model="invoiceData.taxRate"></el-input>
</el-form-item> </el-form-item>
...@@ -57,24 +57,36 @@ ...@@ -57,24 +57,36 @@
</el-table-column> </el-table-column>
<el-table-column label="箱数" align="center" prop="num" /> <el-table-column label="箱数" align="center" prop="num" />
<el-table-column label="体积/重量" align="center" prop="weight"></el-table-column> <el-table-column label="体积/重量" align="center" prop="weight"></el-table-column>
<el-table-column label="费用类型" align="center" prop="feeType"> <el-table-column label="收入类型" align="center" prop="feeType">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <dict-tag
:type="DICT_TYPE.ECW_TRANSPORT_TYPE" :type="DICT_TYPE.FEE_TYPE"
:value="scope.row.feeType" :value="scope.row.feeType"
></dict-tag> ></dict-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="单价" align="center" prop="unitPrice" /> <el-table-column label="单价金额" align="center" prop="unitPrice">
<el-table-column label="总金额" align="center" prop="totalAmount" /> <template slot-scope="scope">
<el-table-column label="税额" align="center"> <span>{{ scope.row.unitPrice }}</span>
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
</template>
</el-table-column>
<el-table-column label="总金额" align="center" prop="totalAmount">
<template slot-scope="scope">
<span>{{ scope.row.totalAmount }}</span>
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
</template>
</el-table-column>
<el-table-column label="税额" align="center" prop="tax">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.tax }}</span>
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="价税合计" align="center"> <el-table-column label="价税合计" align="center" prop="taxAndTotalAmount">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.taxAndTotalAmount }}</span>
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -99,6 +111,7 @@ ...@@ -99,6 +111,7 @@
<script> <script>
import { DICT_TYPE } from "@/utils/dict"; import { DICT_TYPE } from "@/utils/dict";
import { getReceiptInvoicing, getInvoicingItem, updateReceiptInvoicing } from "@/api/ecw/financial"; import { getReceiptInvoicing, getInvoicingItem, updateReceiptInvoicing } from "@/api/ecw/financial";
import NP from 'number-precision'
export default { export default {
name: "OpenInvoice", name: "OpenInvoice",
...@@ -118,9 +131,9 @@ export default { ...@@ -118,9 +131,9 @@ export default {
} }
}, },
methods: { methods: {
getData() { async getData() {
this.loading = true; this.loading = true;
getReceiptInvoicing(this.id).then((res) => { await getReceiptInvoicing(this.id).then((res) => {
this.invoiceData = res.data; this.invoiceData = res.data;
this.invoiceData.invoicingTypeId = this.invoiceData.invoicingTypeId || '' this.invoiceData.invoicingTypeId = this.invoiceData.invoicingTypeId || ''
// if (!this.invoiceData.info || this.invoiceData.info.length == 0) { // if (!this.invoiceData.info || this.invoiceData.info.length == 0) {
...@@ -129,9 +142,15 @@ export default { ...@@ -129,9 +142,15 @@ export default {
this.loading = false; this.loading = false;
}); });
getInvoicingItem({ id: this.id }).then(res => { getInvoicingItem({ id: this.id }).then(res => {
res.data.map(v => {
v.tax = NP.times(v.totalAmount, this.invoiceData.taxRate/100)
v.taxAndTotalAmount = NP.plus(v.totalAmount, NP.times(v.totalAmount, this.invoiceData.taxRate/100))
})
const t = { const t = {
orderNo: '合计', orderNo: '合计',
totalAmount: res.data.reduce((total, curr) => total + curr.totalAmount, 0) totalAmount: res.data.reduce((total, curr) => NP.plus(total, curr.totalAmount), 0),
tax: res.data.reduce((total, curr) => NP.plus(total, curr.tax), 0),
taxAndTotalAmount: res.data.reduce((total, curr) => NP.plus(total, curr.taxAndTotalAmount), 0)
} }
this.list = [...res.data, t] this.list = [...res.data, t]
}) })
...@@ -148,8 +167,98 @@ export default { ...@@ -148,8 +167,98 @@ export default {
}) })
}, },
getSummaries(param) { getSummaries(param) {
return ['收款人', this.invoiceData.payeeName, '核销人', this.invoiceData.writeOffName, '开票人', this.invoiceData.issuerName, '', '价税合计大写', 444]; const t = this.list[this.list.length - 1].taxAndTotalAmount
return ['收款人', this.invoiceData.payeeName, '核销人', this.invoiceData.writeOffName, '开票人', this.invoiceData.issuerName, '', '价税合计大写', this.convertCurrency(t)];
}, },
convertCurrency(money) {
//汉字的数字
var cnNums = new Array('', '', '', '', '', '', '', '', '', '');
//基本单位
var cnIntRadice = new Array('', '', '', '');
//对应整数部分扩展单位
var cnIntUnits = new Array('', '', '亿', '');
//对应小数部分单位
var cnDecUnits = new Array('', '', '', '');
//整数金额时后面跟的字符
var cnInteger = '';
//整型完以后的单位
var cnIntLast = '';
//最大处理的数字
var maxNum = 999999999999999.9999;
//金额整数部分
var integerNum;
//金额小数部分
var decimalNum;
//输出的中文金额字符串
var chineseStr = '';
//分离金额后用的数组,预定义
var parts;
// 传入的参数为空情况
if(money === '') {
return '';
}
money = parseFloat(money)
if(money >= maxNum){
return ''
}
// 传入的参数为0情况
if (money === 0) {
chineseStr = cnNums[0] + cnIntLast + cnInteger;
return chineseStr
}
// 转为字符串
money = money.toString();
// indexOf 检测某字符在字符串中首次出现的位置 返回索引值(从0 开始) -1 代表无
if (money.indexOf('.') == -1) {
integerNum = money;
decimalNum = ''
}else{
parts = money.split('.');
integerNum = parts[0];
decimalNum = parts[1].substr(0,4);
}
//转换整数部分
if(parseInt(integerNum,10) > 0){
let zeroCount = 0;
let IntLen = integerNum.length
for(let i = 0; i < IntLen; i++){
let n = integerNum.substr(i,1);
let p = IntLen - i - 1;
let q = p / 4;
let m = p % 4;
if( n == '0'){
zeroCount ++ ;
}else{
if(zeroCount > 0){
chineseStr += cnNums[0]
}
zeroCount = 0;
chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
}
if(m == 0 && zeroCount < 4){
chineseStr += cnIntUnits[q];
}
}
// 最后+ 元
chineseStr += cnIntLast;
}
// 转换小数部分
if(decimalNum != ''){
let decLen = decimalNum.length;
for(let i = 0; i <decLen; i++){
let n = decimalNum.substr(i,1);
if(n != '0'){
chineseStr += cnNums[Number(n)] + cnDecUnits[i]
}
}
}
if(chineseStr == ''){
chineseStr += cnNums[0] + cnIntLast + cnInteger;
}else if(decimalNum == ''){
chineseStr += cnInteger;
}
return chineseStr
}
}, },
}; };
</script> </script>
......
...@@ -100,18 +100,11 @@ ...@@ -100,18 +100,11 @@
id:0 id:0
} }
}, },
created() { async created() {
let that = this let that = this
if(that.$route.query.id){
that.id = that.$route.query.id
that.getCollectionData()
getInvoicingItem({id: this.id}).then(res => {
this.list = res.data
})
}
listSimpleUsers().then(res =>that.creatorData = res.data) listSimpleUsers().then(res =>that.creatorData = res.data)
getBankAccountPage(that.params).then(res =>that.bankData = res.data.list) getBankAccountPage(that.params).then(res =>that.bankData = res.data.list)
listSimpleDepts().then(res =>{ await listSimpleDepts().then(res =>{
res.data.forEach((item)=>{ res.data.forEach((item)=>{
if(item.parentId==0){ if(item.parentId==0){
...@@ -130,12 +123,20 @@ ...@@ -130,12 +123,20 @@
}) })
}) })
if(that.$route.query.id){
that.id = that.$route.query.id
that.getCollectionData()
getInvoicingItem({id: this.id}).then(res => {
this.list = res.data
})
}
}, },
methods: { methods: {
getCollectionData(){ getCollectionData(){
let that = this let that = this
getReceiptInfoByIds({id:that.id}).then(res =>{ getReceiptInfoByIds({id:that.id}).then(res =>{
that.form = res.data that.form = res.data
that.form.departmentName = that.deptData.find(v => v.id == that.form.departmentId).name
}) })
}, },
print(){ print(){
......
...@@ -16,17 +16,6 @@ ...@@ -16,17 +16,6 @@
</el-card> </el-card>
<el-card class="card"> <el-card class="card">
<div slot="header" class="card-title">订单信息</div> <div slot="header" class="card-title">订单信息</div>
<!-- <el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
style="padding: 10px; margin-bottom: 10px"
>添加未收客户款项</el-button
>
</el-col> -->
<el-table :data="list" border> <el-table :data="list" border>
<el-table-column label="订单号" align="center" prop="orderNo" /> <el-table-column label="订单号" align="center" prop="orderNo" />
<el-table-column label="唛头" align="center" prop="marks" /> <el-table-column label="唛头" align="center" prop="marks" />
...@@ -37,21 +26,6 @@ ...@@ -37,21 +26,6 @@
</el-table-column> </el-table-column>
<el-table-column label="箱数" align="center" prop="num" /> <el-table-column label="箱数" align="center" prop="num" />
<el-table-column label="体积/重量" align="center" prop="weight" /> <el-table-column label="体积/重量" align="center" prop="weight" />
<!-- <el-table-column label="发货人" align="center" prop="consignorName" />
<el-table-column label="收货人" align="center" prop="consigneeName" /> -->
<!-- <el-table-column label="订单状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag
:type="DICT_TYPE.ORDER_STATUS"
:value="scope.row.status"
/>
</template>
</el-table-column> -->
<!-- <el-table-column label="收款类型" align="center" prop="paymentType">
<template slot-scope="scope">
<dict-selector :type="DICT_TYPE.PAYMENT_TYPE" v-model="scope.row.paymentType"></dict-selector>
</template>
</el-table-column> -->
<el-table-column label="收入类型" align="center" prop="feeType"> <el-table-column label="收入类型" align="center" prop="feeType">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <dict-tag
...@@ -72,68 +46,15 @@ ...@@ -72,68 +46,15 @@
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="核销比例" align="center" prop="totalAmount">
<template slot-scope="scope">
<span>{{ scope.row.totalAmount }}%</span>
</template>
</el-table-column> -->
<!-- <el-table-column label="已收金额" align="center" prop="unitPrice">
<template slot-scope="scope">
<span>{{ scope.row.unitPrice }}</span>
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
</template>
</el-table-column>
<el-table-column label="本次实收金额" align="center" prop="amount">
<template slot-scope="scope">
<el-input v-model="scope.row.amount">
<template slot="append">
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
</template>
</el-input>
</template>
</el-table-column> -->
</el-table> </el-table>
<el-descriptions :column="1" border class="card"> <el-descriptions :column="2" border class="card">
<el-descriptions-item v-for="(v, index) in form.platformAccountIdList" :label="`收款账户${index + 1}`" :key="index"> <!-- <el-descriptions-item v-for="(v, index) in form.platformAccountIdList" :label="`收款账户${index + 1}`" :key="index">
<div style="display: flex"> <div style="display: flex">
<!-- <el-form-item
label=""
label-width="0"
style="margin-bottom: 0; margin-right: 12px"
:prop="`platformAccountIdList[${index}].platformAccountId`"
required
error="请选择收款账户"
>
<el-select
v-model="v.platformAccountId"
placeholder="请选择收款账户"
>
<el-option
v-for="item in bankData"
:key="item.id"
:label="item.baAccountName + '(' + item.baAccountNum + ')'"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0; margin-right: 12px"
:prop="`platformAccountIdList[${index}].currencyId`"
required
error="请选择币种"
>
<dict-selector
:type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT"
v-model="v.currencyId"
/>
</el-form-item> -->
<el-button type="text" v-if="index === 0" @click="form.platformAccountIdList = [...form.platformAccountIdList, {}]">添加收款账户</el-button> <el-button type="text" v-if="index === 0" @click="form.platformAccountIdList = [...form.platformAccountIdList, {}]">添加收款账户</el-button>
<el-button type="text" v-if="index > 0" @click="subtractItem(index)"><span style="color: red">删除</span></el-button> <el-button type="text" v-if="index > 0" @click="subtractItem(index)"><span style="color: red">删除</span></el-button>
</div> </div>
</el-descriptions-item> </el-descriptions-item>
-->
<el-descriptions-item label="是否需要开票"> <el-descriptions-item label="是否需要开票">
<span>{{ form.openInvoice == 1 ? '需要' : '不需要' }}</span> <span>{{ form.openInvoice == 1 ? '需要' : '不需要' }}</span>
<!-- <el-select <!-- <el-select
...@@ -208,7 +129,7 @@ ...@@ -208,7 +129,7 @@
<el-table-column label="水单号" align="center" prop="billNo" /> <el-table-column label="水单号" align="center" prop="billNo" />
<el-table-column label="水单附件" align="center" prop="attr"> <el-table-column label="水单附件" align="center" prop="attr">
<template slot-scope="scope" v-if="scope.row.attr"> <template slot-scope="scope" v-if="scope.row.attr">
<el-link v-for="(v, i) in scope.row.attr" :href="v.url" :key="i" type="primary" target="_blank">{{ v.name }}</el-link> <div v-for="(v, i) in scope.row.attr" :key="i"><el-link :href="v.url" type="primary" target="_blank">{{ v.name }}</el-link></div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" align="center" prop="status"> <el-table-column label="状态" align="center" prop="status">
...@@ -219,7 +140,7 @@ ...@@ -219,7 +140,7 @@
<el-table-column label="操作" align="center" width="200"> <el-table-column label="操作" align="center" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="scope.row.status == 0" type="text" @click="deleteClick(scope.row)">删除</el-button> <el-button v-if="scope.row.status == 0" type="text" @click="deleteClick(scope.row)">删除</el-button>
<el-button type="text">详情</el-button> <el-button type="text" @click="detailClick(scope.row)">详情</el-button>
<el-button v-if="scope.row.status == 0" type="text" @click="verificationClick(scope.row)">核销</el-button> <el-button v-if="scope.row.status == 0" type="text" @click="verificationClick(scope.row)">核销</el-button>
<el-button v-if="scope.row.status == 1" type="text" @click="verificationCancelClick(scope.row)">反核销</el-button> <el-button v-if="scope.row.status == 1" type="text" @click="verificationCancelClick(scope.row)">反核销</el-button>
<el-button v-if="scope.row.status == 0" type="text" @click="editClick(scope.row)">编辑</el-button> <el-button v-if="scope.row.status == 0" type="text" @click="editClick(scope.row)">编辑</el-button>
...@@ -228,8 +149,90 @@ ...@@ -228,8 +149,90 @@
</el-table> </el-table>
</el-card> </el-card>
<el-card class="card"> <el-card class="card">
<el-descriptions :column="2" border> <div slot="header" class="card-title">应收账单</div>
<template v-for="(item, index) in form.receivableDetailList"> <el-table :data="form.receiptAccountList" border>
<el-table-column label="应收币种" align="center">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
</template>
</el-table-column>
<el-table-column label="应收金额" align="center" prop="receivableAmount" />
<el-table-column align="center" width="220">
<template #header>
核销基准币种(<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />)汇率
</template>
<template slot-scope="scope">
<template v-if="scope.row.type !== 'total'">
<span>{{ scope.row.writeOffRate }}</span>
</template>
<template v-else>
应收总金额(<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
</template>
</template>
</el-table-column>
<el-table-column align="center" prop="writeOffAmount">
<template #header>
核销基准金额(<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
</template>
</el-table-column>
<el-table-column label="收款账户" align="center">
<template slot-scope="scope" v-if="scope.row.type !== 'total'">
{{ `${bankData.find(v => v.id == scope.row.platformAccountId).baAccountName}(${bankData.find(v => v.id == scope.row.platformAccountId).baAccountNum})` }}
</template>
</el-table-column>
<el-table-column label="收款币种" align="center">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.collectionCurrencyId" />
</template>
</el-table-column>
<el-table-column label="收款汇率" 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}.collectionRate`"
>
<el-input v-model="scope.row.collectionRate" @input="() => rateChange(scope.row, scope.$index)"></el-input>
</el-form-item> -->
<span v-if="scope.row.type !== 'total'">{{ scope.row.collectionRate }}</span>
<span v-else>收款总金额</span>
</template>
</el-table-column>
<el-table-column label="收款金额" align="center" prop="collectionAmount">
<template slot-scope="scope">
<span v-if="scope.row.type !== 'total'">{{ scope.row.collectionAmount }}</span>
<div v-else>
<div v-if="scope.row.collectionAmount[0]">美元: {{ scope.row.collectionAmount[0] }}</div>
<div v-if="scope.row.collectionAmount[1]">人民币: {{ scope.row.collectionAmount[1] }}</div>
<div v-if="scope.row.collectionAmount[2]">奈拉: {{ scope.row.collectionAmount[2] }}</div>
</div>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template>
</el-table-column>
</el-table>
<el-descriptions :column="2" border class="card">
<el-descriptions-item label="账单汇率有效期">
{{ parseTime(form.rateValidateDate) }}
<!-- <el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="rateValidateDate"
>
<el-date-picker
v-model="form.rateValidateDate"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
</el-form-item> -->
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card class="card hexiaoCard">
<el-descriptions :column="3" border>
<!-- <template v-for="(item, index) in form.receivableDetailList">
<el-descriptions-item :label="index === 0 ? '应收总金额' : ''" :key="index+3"> <el-descriptions-item :label="index === 0 ? '应收总金额' : ''" :key="index+3">
{{ item.amount }} {{ item.amount }}
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="index + 1" /> <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="index + 1" />
...@@ -240,13 +243,13 @@ ...@@ -240,13 +243,13 @@
</template> </template>
<span v-if="showCurrencyId !== item.currencyId">{{ item.rate }}</span> <span v-if="showCurrencyId !== item.currencyId">{{ item.rate }}</span>
</el-descriptions-item> </el-descriptions-item>
</template> </template> -->
<el-descriptions-item> <!-- <el-descriptions-item>
<template slot="label"> <template slot="label">
应收总金额(<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" /> 应收总金额(<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
</template> </template>
{{ form.receivableTotalAmount }} {{ form.receivableTotalAmount }}
</el-descriptions-item> </el-descriptions-item> -->
<el-descriptions-item label="已核销总金额"> <el-descriptions-item label="已核销总金额">
<el-tag>{{ verificationData.usCount }}美元</el-tag> <el-tag>{{ verificationData.usCount }}美元</el-tag>
<el-tag>{{ verificationData.rmbCount }}人民币</el-tag> <el-tag>{{ verificationData.rmbCount }}人民币</el-tag>
...@@ -281,18 +284,19 @@ ...@@ -281,18 +284,19 @@
<div>{{ remainingAmount.nairaAmount }}奈拉</div> <div>{{ remainingAmount.nairaAmount }}奈拉</div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="收款账户" required prop="accountNo" error="收款账户不能为空"> <el-form-item label="收款账户" prop="accountNo" :rules="{ required: true, trigger: ['blur', 'change'], message: '收款账户不能为空' }">
<el-select v-model="addForm.accountNo" placeholder="请选择收款账户" style="width: 220px"> <el-select v-if="!isView" v-model="addForm.accountNo" placeholder="请选择收款账户" style="width: 220px">
<el-option v-for="item in bankData" :key="item.id" :label="item.baAccountName + '(' + item.baAccountNum + ')'" :value="item.id" /> <el-option v-for="item in bankData" :key="item.id" :label="item.baAccountName + '(' + item.baAccountNum + ')'" :value="item.id" />
</el-select> </el-select>
<span v-else>{{ addForm.accountNo }}</span>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="实收日期" label="实收日期"
prop="amountDate" prop="amountDate"
required :rules="{ required: true, trigger: ['blur', 'change'], message: '实收日期不能为空' }"
error="实收日期不能为空"
> >
<el-date-picker <el-date-picker
v-if="!isView"
clearable clearable
v-model="addForm.amountDate" v-model="addForm.amountDate"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
...@@ -300,35 +304,37 @@ ...@@ -300,35 +304,37 @@
type="date" type="date"
placeholder="选择实收日期" placeholder="选择实收日期"
/> />
<span v-else>{{ addForm.amountDate }}</span>
</el-form-item> </el-form-item>
<div style="display: flex;"> <div style="display: flex;">
<el-form-item <el-form-item
label="实收" label="实收"
prop="amount" prop="amount"
required :rules="{ required: true, trigger: ['blur', 'change'], message: '实收不能为空' }"
error="实收不能为空"
> >
<el-input v-model="addForm.amount" style="width: 220px; margin-right: 12px"></el-input> <el-input v-if="!isView" v-model="addForm.amount" style="width: 220px; margin-right: 12px" @input="setWriteOffAmount"></el-input>
<span v-else>{{ addForm.amount }}</span>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label-width="0px" label-width="0px"
prop="currencyId" prop="currencyId"
required :rules="{ required: true, trigger: ['blur', 'change'], message: '币种不能为空' }"
error="币种不能为空"
> >
<dict-selector :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" v-model="addForm.currencyId" /> <dict-selector v-if="!isView" :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" v-model="addForm.currencyId" @change="val => currencyIdChange(val)"/>
<!-- <span v-else>{{ addForm.currencyId }}</span> -->
<dict-tag v-else :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="addForm.currencyId" />
</el-form-item> </el-form-item>
</div> </div>
<el-form-item <el-form-item
v-if="showCurrencyId != addForm.currencyId" v-if="showCurrencyId != addForm.currencyId"
prop="rate" prop="rate"
required :rules="{ required: true, trigger: ['blur', 'change'], message: '汇率不能为空' }"
error="汇率不能为空"
> >
<template slot="label"> <template slot="label">
汇率(<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" /> 汇率(<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
</template> </template>
<el-input v-model="addForm.rate" style="width: 220px"></el-input> <el-input v-if="!isView" v-model="addForm.rate" style="width: 220px"></el-input>
<span v-else>{{ addForm.rate }}</span>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
v-if="showCurrencyId != addForm.currencyId" v-if="showCurrencyId != addForm.currencyId"
...@@ -336,13 +342,14 @@ ...@@ -336,13 +342,14 @@
<template slot="label"> <template slot="label">
金额(<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" /> 金额(<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
</template> </template>
<!-- <el-input v-model="addForm.rate"></el-input> --> <span>{{ addForm.writeOffAmount }}</span>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="收款附件" label="水单附件"
prop="attr" prop="attr"
> >
<el-upload <el-upload
v-if="!isView"
class="upload-demo" class="upload-demo"
:action="uploadFileUrl" :action="uploadFileUrl"
:headers="headers" :headers="headers"
...@@ -355,17 +362,20 @@ ...@@ -355,17 +362,20 @@
> >
<el-button size="small" type="primary">上传附件</el-button> <el-button size="small" type="primary">上传附件</el-button>
</el-upload> </el-upload>
<div v-else>
<div v-for="(v, i) in addForm.attr" :key="i"><el-link :href="v.url" type="primary" target="_blank">{{ v.name }}</el-link></div>
</div>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="水单号" label="水单号"
prop="billNo" prop="billNo"
required :rules="{ required: true, trigger: ['blur', 'change'], message: '水单号不能为空' }"
error="水单号不能为空"
> >
<el-input v-model="addForm.billNo" style="width: 220px"></el-input> <el-input v-if="!isView" v-model="addForm.billNo" style="width: 220px"></el-input>
<span v-else>{{ addForm.billNo }}</span>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer"> <div slot="footer" v-if="!isView">
<el-button type="primary" @click="saveFrom">{{ saveBtnText }}</el-button> <el-button type="primary" @click="saveFrom">{{ saveBtnText }}</el-button>
<el-button @click="hiddenDialog"> </el-button> <el-button @click="hiddenDialog"> </el-button>
</div> </div>
...@@ -388,7 +398,8 @@ import { ...@@ -388,7 +398,8 @@ import {
receiptItemVerificationCancel, receiptItemVerificationCancel,
updateReceiptItem, updateReceiptItem,
receiptItemBatchVerification, receiptItemBatchVerification,
receiptItemAllVerification receiptItemAllVerification,
getReceiptAccountList
} from "@/api/ecw/financial"; } from "@/api/ecw/financial";
import { getCurrencyPage } from "@/api/ecw/currency"; import { getCurrencyPage } from "@/api/ecw/currency";
import NP from 'number-precision' import NP from 'number-precision'
...@@ -412,8 +423,9 @@ export default { ...@@ -412,8 +423,9 @@ export default {
}, },
addForm: {}, addForm: {},
detailed: [], detailed: [],
dialogTitle: '添加收款明细', dialogTitle: '添加银行实收明细',
saveBtnText: '添 加', saveBtnText: '添 加',
isView: false,
multipleSelection: [], multipleSelection: [],
currencyList: [], currencyList: [],
verificationData: { verificationData: {
...@@ -453,14 +465,17 @@ export default { ...@@ -453,14 +465,17 @@ export default {
} }
}, },
watch: { watch: {
'addForm.currencyId'(newVal) { // 'addForm.currencyId'(newVal) {
this.currencyIdChange(newVal) // this.currencyIdChange(newVal)
} // },
'addForm.rate'() {
this.setWriteOffAmount()
},
}, },
async created() { async created() {
// 获取汇率 // 获取汇率
await getCurrencyPage(this.params).then(res => this.currencyList = res.data.list) await getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
await getBankAccountPage(this.params).then((res) => (this.bankData = res.data.list));
if (this.$route.query.id) { if (this.$route.query.id) {
this.id = this.$route.query.id; this.id = this.$route.query.id;
await getReceiptInfoByIds({ id: this.id }).then(res => { await getReceiptInfoByIds({ id: this.id }).then(res => {
...@@ -472,11 +487,43 @@ export default { ...@@ -472,11 +487,43 @@ export default {
await getInvoicingItem({ id: this.id }).then(res => { await getInvoicingItem({ id: this.id }).then(res => {
this.list = [...res.data] this.list = [...res.data]
}) })
getReceiptAccountList({ id: this.id }).then(res => {
if (res.data.length > 0) {
// totalAmount
res.data = [...res.data, {
type: 'total',
writeOffAmount: res.data.reduce((total, currentValue) => NP.plus(total, currentValue.writeOffAmount || 0), 0),
collectionAmount: [0, 0, 0]
}]
}
// 收款总计
const dollarList = res.data.filter(v => v.collectionCurrencyId == 1)
const dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0)
const rmbList = res.data.filter(v => v.collectionCurrencyId == 2)
const rmb = rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0)
const nairaList = res.data.filter(v => v.collectionCurrencyId == 3)
const naira = nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0)
res.data[res.data.length -1].collectionAmount = [dollar, rmb, naira]
// this.$set(this.form, 'receiptAccountList', [...this.form.receiptAccountList])
this.$set(this.form, 'receiptAccountList', [...res.data])
this.$nextTick(() => {
// this.form.receiptAccountList.forEach((item, index) => {
// this.rateChange(item, index)
// });
})
})
} }
getBankAccountPage(this.params).then((res) => (this.bankData = res.data.list));
this.getList() this.getList()
}, },
methods: { methods: {
setWriteOffAmount() {
this.$set(this.addForm, 'writeOffAmount', NP.times(this.addForm.rate || 0, this.addForm.amount || 0))
},
calculation() { calculation() {
const verificationList = this.detailed.filter(v => v.status === 1) const verificationList = this.detailed.filter(v => v.status === 1)
const dollarList = verificationList.filter(v => v.currencyId === 1) const dollarList = verificationList.filter(v => v.currencyId === 1)
...@@ -543,16 +590,18 @@ export default { ...@@ -543,16 +590,18 @@ export default {
}, },
currencyIdChange(val) { currencyIdChange(val) {
val = Number(val) val = Number(val)
let rate
if(val === this.showCurrencyId) { if(val === this.showCurrencyId) {
this.addForm.rate = 1 rate = 1
} else { } else {
if (this.showCurrencyId === 1 && val === 2) this.addForm.rate = this.RMBtoUS() if (this.showCurrencyId === 1 && val === 2) rate = this.RMBtoUS()
else if (this.showCurrencyId === 1 && val === 3) this.addForm.rate = this.NANtoUS() else if (this.showCurrencyId === 1 && val === 3) rate = this.NANtoUS()
else if (this.showCurrencyId === 2 && val === 1) this.addForm.rate = this.UStoRMB() else if (this.showCurrencyId === 2 && val === 1) rate = this.UStoRMB()
else if (this.showCurrencyId === 2 && val === 3) this.addForm.rate = this.NANtoRMB() else if (this.showCurrencyId === 2 && val === 3) rate = this.NANtoRMB()
else if (this.showCurrencyId === 3 && val === 1) this.addForm.rate = this.UStoNAN() else if (this.showCurrencyId === 3 && val === 1) rate = this.UStoNAN()
else if (this.showCurrencyId === 3 && val === 2) this.addForm.rate = this.RMBtoNAN() else if (this.showCurrencyId === 3 && val === 2) rate = this.RMBtoNAN()
} }
this.$set(this.addForm, 'rate', rate)
}, },
getList() { getList() {
getReceivableItem({ id: this.id }).then(res => { getReceivableItem({ id: this.id }).then(res => {
...@@ -593,10 +642,19 @@ export default { ...@@ -593,10 +642,19 @@ export default {
toEdit() { toEdit() {
return this.$router.push("creatCollection?id=" + this.id); return this.$router.push("creatCollection?id=" + this.id);
}, },
detailClick(row) {
this.openAddDialog = true
this.dialogTitle = '银行实收明细详情'
this.isView = true
setTimeout(() => {
this.addForm = { ...row }
}, 0)
},
editClick(row) { editClick(row) {
this.openAddDialog = true this.openAddDialog = true
this.dialogTitle = '编辑收款明细' this.dialogTitle = '编辑银行实收明细'
this.saveBtnText = '提 交' this.saveBtnText = '提 交'
this.isView = false
setTimeout(() => { setTimeout(() => {
this.addForm = { ...row } this.addForm = { ...row }
}, 0) }, 0)
...@@ -662,12 +720,12 @@ export default { ...@@ -662,12 +720,12 @@ export default {
verificationAll() { verificationAll() {
this.$modal this.$modal
.confirm("您确认要全部核销吗?") .confirm("您确认要全部核销吗?")
.then(function () { .then(() => {
return receiptItemAllVerification(this.id); return receiptItemAllVerification(this.id);
}) })
.then(() => { .then(() => {
this.getList();
this.$modal.msgSuccess("核销成功"); this.$modal.msgSuccess("核销成功");
this.$router.back();
}) })
.catch(() => {}); .catch(() => {});
}, },
...@@ -677,7 +735,8 @@ export default { ...@@ -677,7 +735,8 @@ export default {
handleAddReceiptItem() { handleAddReceiptItem() {
this.addForm = {} this.addForm = {}
this.openAddDialog = true this.openAddDialog = true
this.dialogTitle = '添加收款明细' this.isView = false
this.dialogTitle = '添加银行实收明细'
this.saveBtnText = '添 加' this.saveBtnText = '添 加'
}, },
handleUploadSuccess(res, file, fileList) { handleUploadSuccess(res, file, fileList) {
...@@ -734,4 +793,12 @@ export default { ...@@ -734,4 +793,12 @@ export default {
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;
} }
.hexiaoCard {
::v-deep .el-descriptions-item__label {
width: 11%;
}
::v-deep .el-descriptions-item__content {
width: 22%;
}
}
</style> </style>
\ No newline at end of file
...@@ -154,43 +154,44 @@ ...@@ -154,43 +154,44 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
v-if="scope.row.state === 0 || scope.row.state == 1 || scope.row.state == 5" v-if="scope.row.state === 0 || scope.row.state == 1 || scope.row.state == 2 || scope.row.state == 3"
size="mini" size="mini"
type="text" type="text"
@click="handleAdd(scope.row.id)" @click="handleAdd(scope.row.id)"
>编辑</el-button >编辑</el-button
> >
<el-button <!-- <el-button
v-if="scope.row.state == 1" v-if="scope.row.state == "
size="mini" size="mini"
type="text" type="text"
@click="verificationClick(scope.row)" @click="verificationClick(scope.row)"
>核销</el-button >核销</el-button
> > -->
<el-button <el-button
v-if="scope.row.state != 1 && scope.row.state != 5" v-if="scope.row.state == 4 || scope.row.state == 5 || scope.row.state == 6"
size="mini" size="mini"
type="text" type="text"
@click="verificationCancelClick(scope.row)" @click="verificationCancelClick(scope.row)"
>反核销</el-button >反核销</el-button
> >
<el-button <el-button
v-if="scope.row.state == 3" v-if="scope.row.state == 5"
size="mini" size="mini"
type="text" type="text"
@click="openInvoice(scope.row.id)" @click="openInvoice(scope.row.id)"
>开票</el-button >开票</el-button
> >
<el-button v-if="scope.row.state === 0" size="mini" type="text" @click="deleteClick(scope.row)">删除</el-button> <el-button v-if="scope.row.state == 1 || scope.row.state == 2 || scope.row.state == 3" size="mini" type="text" @click="verificationCancelClick(scope.row)">收款</el-button>
<el-button v-if="scope.row.state == 0 || scope.row.state == 1" size="mini" type="text" @click="deleteClick(scope.row)">删除</el-button>
<el-button <el-button
v-if="scope.row.state != 5" v-if="scope.row.state != 0"
size="mini" size="mini"
type="text" type="text"
@click="toprint(scope.row.id)" @click="toprint(scope.row.id)"
>打印</el-button >打印</el-button
> >
<el-button <el-button
v-if="scope.row.state != 5" v-if="scope.row.state != 0"
size="mini" size="mini"
type="text" type="text"
@click="exportReceipt(scope.row.id)" @click="exportReceipt(scope.row.id)"
...@@ -241,8 +242,8 @@ import { DICT_TYPE } from "@/utils/dict"; ...@@ -241,8 +242,8 @@ import { DICT_TYPE } from "@/utils/dict";
import CustomerSelector from "@/components/CustomerSelector"; import CustomerSelector from "@/components/CustomerSelector";
import { import {
getReceiptList, getReceiptList,
receiptVerification, // receiptVerification,
receiptVerificationCancel, // receiptVerificationCancel,
receiptExportExcel, receiptExportExcel,
deleteReceipt deleteReceipt
} from "@/api/ecw/financial"; } from "@/api/ecw/financial";
......
...@@ -124,6 +124,12 @@ ...@@ -124,6 +124,12 @@
{{ FeeDetails.details && FeeDetails.details.reason ? FeeDetails.details.reason :''}} {{ FeeDetails.details && FeeDetails.details.reason ? FeeDetails.details.reason :''}}
</div> </div>
</div> </div>
<div v-if="type === 4">
<p>申请理由</p>
<div>
{{ FeeDetails.details || '' }}
</div>
</div>
</div> </div>
</template> </template>
...@@ -133,7 +139,13 @@ import { ...@@ -133,7 +139,13 @@ import {
warehouseApprovalGetById, warehouseApprovalGetById,
warehouseAreaPositionList warehouseAreaPositionList
} from "@/api/ecw/batchSingleApplication"; } from "@/api/ecw/batchSingleApplication";
import {applicationGetOrderByProcessId, feeApplicationGet, getOrder, getOrderPage,} from "@/api/ecw/order"; import {
applicationGetOrderByProcessId,
feeApplicationGet,
getOrder,
getOrderPage,
getWarehouseUpdateApprovalInfo
} from '@/api/ecw/order'
import { getChannelList } from '@/api/ecw/channel'; import { getChannelList } from '@/api/ecw/channel';
import Template from "@/views/cms/template"; import Template from "@/views/cms/template";
import {getSupplierPage} from "@/api/ecw/supplier"; import {getSupplierPage} from "@/api/ecw/supplier";
...@@ -221,6 +233,12 @@ export default { ...@@ -221,6 +233,12 @@ export default {
}) })
}); });
break; break;
case 4:
// 入仓修改
getWarehouseUpdateApprovalInfo(this.processInstanceID).then(r => {
this.FeeDetails.details = r.data.details
})
break
} }
} }
......
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