Commit 04cc9846 authored by dragondean@qq.com's avatar dragondean@qq.com
parents b4a2e2ca b0e0fe76
......@@ -9,6 +9,15 @@ export function createReceipt(data) {
})
}
// 更新收款单
export function updateReceipt(data) {
return request({
url: '/ecw/receipt/update',
method: 'put',
data: data
})
}
// 获取应收款列表
export function getReceivableList(query) {
return request({
......@@ -18,6 +27,144 @@ export function getReceivableList(query) {
})
}
// 获取应收款详情
export function getReceivableInfoByIds(query) {
return request({
url: '/ecw/receivable/get',
method: 'get',
params: query
})
}
// 获取收款单列表
export function getReceiptList(query) {
return request({
url: '/ecw/receipt/page',
method: 'get',
params: query
})
}
// 核销收款单
export function receiptVerification(id) {
return request({
url: '/ecw/receipt/verification/' + id,
method: 'GET'
})
}
// 反核销收款单
export function receiptVerificationCancel(id) {
return request({
url: '/ecw/receipt/verificationCancel/' + id,
method: 'GET'
})
}
// 获取收款单详情
export function getReceiptInfoByIds(query) {
return request({
url: '/ecw/receipt/get',
method: 'get',
params: query
})
}
// 获取收款单明细列表
export function getReceivableItemDetail(query) {
return request({
url: '/ecw/receipt/getReceivableItemDetail',
method: 'get',
params: query
})
}
// 获取收款单明细
export function getInvoicingItem(query) {
return request({
url: '/ecw/receipt/getInvoicingItem',
method: 'get',
params: query
})
}
// 创建收款明细
export function receiptItemCreate(data) {
return request({
url: '/ecw/receipt-item/create',
method: 'post',
data: data
})
}
// 根据收款单ID获得收款明细列表
export function getReceivableItem(query) {
return request({
url: '/ecw/receipt-item/getReceivableItem',
method: 'get',
params: query
})
}
// 根据收款单ID获得收款账户细列表
export function getReceiptAccountList(query) {
return request({
url: '/ecw/receipt/getReceiptAccountList',
method: 'get',
params: query
})
}
// 删除收款明细
export function deleteReceiptItem(id) {
return request({
url: '/ecw/receipt-item/delete?id=' + id,
method: 'delete'
})
}
// 更新收款明细
export function updateReceiptItem(data) {
return request({
url: '/ecw/receipt-item/update',
method: 'put',
data: data
})
}
// 收款明细核销
export function receiptItemVerification(id) {
return request({
url: '/ecw/receipt-item/verification/' + id,
method: 'GET'
})
}
// 反核销收款单
export function receiptItemVerificationCancel(id) {
return request({
url: '/ecw/receipt-item/verificationCancel/' + id,
method: 'GET'
})
}
// 收款明细批量核销
export function receiptItemBatchVerification(query) {
return request({
url: '/ecw/receipt-item/batchVerification',
method: 'GET',
params: query
})
}
// 收款单全部核销
export function receiptItemAllVerification(id) {
return request({
url: '/ecw/receipt-item/allVerification/' + id,
method: 'GET'
})
}
// 根据获取应收款列表
// export function getReceivableListByIds(query) {
// return request({
......@@ -27,6 +174,41 @@ export function getReceivableList(query) {
// })
// }
// 导出收款单 Excel
export function receiptExportExcel(query) {
return request({
url: '/ecw/receipt/export-excel',
method: 'get',
params: query
})
}
// 删除收款单
export function deleteReceipt(id) {
return request({
url: '/ecw/receipt/delete?id=' + id,
method: 'delete'
})
}
// 获得收款单开票信息
export function getReceiptInvoicing(id) {
return request({
url: '/ecw/receipt/invoicing/info/' + id,
method: 'get'
})
}
// 更新收款单开票信息
export function updateReceiptInvoicing(data) {
return request({
url: '/ecw/receipt/invoicing/info',
method: 'put',
data: data
})
}
// 更新应付款
export function updatePayable(data) {
return request({
......
......@@ -27,7 +27,6 @@ export default {
download0(data, fileName, mineType) {
// 创建 blob
let blob = new Blob([data], {type: mineType});
debugger
// 创建 href 超链接,点击进行下载
window.URL = window.URL || window.webkitURL;
let href = URL.createObjectURL(blob);
......
......@@ -104,6 +104,7 @@ export const DICT_TYPE = {
ECW_CUSTOM_DRAWEE: 'custom_drawee', // 自定义付款人费用类型
ECW_IS_DRAFT: 'is_draft', // 草稿发布状态
ECW_PAYMENT_STATE: 'payment_state',//付款单状态
ECW_INVOICING_TYPE: 'invoicing_type',
ECW_PRICE_TYPE: 'price_type',
//--------ecw---------
CUSTOMER_STATUS: 'customer_status',
......@@ -149,7 +150,7 @@ export const DICT_TYPE = {
ORDER_ERROR_TYPE:'order_error_type',//订单异常类型
ORDER_EXCEPTION_STATUS:'order_exception_status',//异常订单状态
PAYMENT_TYPE:'payment_type',//收款类型
ORDER_WAREHOUSE_IN_STATUS: 'order_warehouse_in_status', // 入仓状态
ORDER_WAREHOUSE_IN_STATUS: 'order_warehouse_in_diff_status', // 入仓状态
ORDER_NO_QUOTE_EXCEPTION_RESULT:'order_no_quote_exception_result',//未报价异常处理结果
ORDER_SUPERFLUOUS_BOX_EXCEPTION_RESULT:'order_superfluous_box_exception_result',//多箱异常处理结果
ORDER_LACI_BOX_EXCEPTION_RESULT:'order_lack_box_exception_result',//少箱异常处理结果
......
<template>
<div class="app-container">
<el-card>
<div v-if="id" slot="header" class="card-title">新增收款单</div>
<div v-else slot="header" class="card-title">新增收款单</div>
<el-form
<el-form
ref="form"
:model="form"
label-width="120px"
label-position="left"
>
<el-card>
<div v-if="id" slot="header" class="card-title">修改收款单</div>
<div v-else slot="header" class="card-title">新增收款单</div>
<el-descriptions :column="3" border>
<el-descriptions-item label="客户">
<el-form-item
......@@ -16,12 +16,11 @@
label-width="0"
style="margin-bottom: 0"
prop="customerId"
required
error="客户不能为空"
:rules="{ required: true, trigger: ['blur', 'change'], message: '客户不能为空' }"
>
<customer-selector
v-model="form.customerId"
@change="consignor = $event"
@change="customerChange"
/>
</el-form-item>
</el-descriptions-item>
......@@ -31,8 +30,7 @@
label-width="0"
style="margin-bottom: 0"
prop="departmentId"
required
error="部门不能为空"
:rules="{ required: true, trigger: ['blur', 'change'], message: '部门不能为空' }"
>
<el-select
v-model="form.departmentId"
......@@ -54,10 +52,9 @@
label-width="0"
style="margin-bottom: 0"
prop="salesmanId"
required
error="客户不能为空"
:rules="{ required: true, trigger: ['blur', 'change'], message: '客户不能为空' }"
>
<el-select v-model="form.salesmanId" placeholder="请选择业务员">
<el-select v-model="form.salesmanId" placeholder="请选择业务员" @change="v => form.salesmanName = creatorData.find(t => t.id === v).nickname">
<el-option
v-for="item in creatorData"
:key="item.id"
......@@ -73,8 +70,7 @@
label-width="0"
style="margin-bottom: 0"
prop="feeRate"
required
error="手续费不能为空"
:rules="{ required: true, trigger: ['blur', 'change'], message: '手续费不能为空' }"
>
<el-input
v-model="form.feeRate"
......@@ -88,213 +84,373 @@
label-width="0"
style="margin-bottom: 0"
prop="remark"
required
error="备注不能为空"
:rules="{ required: true, trigger: ['blur', 'change'], message: '备注不能为空' }"
>
<el-input v-model="form.remark" placeholder="备注"></el-input>
</el-form-item>
</el-descriptions-item>
</el-descriptions>
</el-form>
</el-card>
<el-card class="card">
<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 v-loading="loadings" :data="list" border>
<el-table-column label="订单号" align="center" prop="orderNo" />
<el-table-column label="运输方式" align="center" prop="transportId">
<template slot-scope="scope">
<dict-tag
:type="DICT_TYPE.ECW_TRANSPORT_TYPE"
:value="scope.row.transportId"
></dict-tag>
</template>
</el-table-column>
<el-table-column label="出货渠道" align="center" prop="channelName" />
<el-table-column label="始发地" align="center" prop="toDepartureId" />
<el-table-column label="目的地" align="center" prop="toDepartureId" />
<el-table-column label="品名" align="center" prop="title">
<template slot-scope="scope">
{{ scope.row.titleZh + "(" + scope.row.titleEn + ")" }}
</template>
</el-table-column>
<el-table-column label="箱数" align="center" prop="num" />
<el-table-column label="体积/重量" align="center" prop="weight" />
<!-- <el-table-column label="体积/重量" align="center" prop="sumVolume">
<template slot-scope="scope">
{{ scope.row.sumVolume + "/" + scope.row.sumWeight }}
</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="sumWeight" /> -->
<el-table-column label="收入类型" align="center" prop="feeType">
<template slot-scope="scope">
<dict-tag
:type="DICT_TYPE.FEE_TYPE"
:value="scope.row.feeType"
></dict-tag>
</template>
</el-table-column>
<el-table-column label="单价美元" align="center" prop="unitPrice" />
<el-table-column label="外币兑1人民币汇率" align="center" prop="huilv">
<template slot-scope="scope">
<el-input v-model="scope.row.huilv"></el-input>
</template>
</el-table-column>
<el-table-column label="总金额$" align="center" prop="totalAmount" />
<el-table-column label="总金额¥" align="center" prop="totalAmount" />
<el-table-column label="已收金额" align="center" prop="totalAmount" />
<el-table-column label="本次实收金额" align="center" width="140" prop="totalAmount">
<template slot-scope="scope">
<el-input v-model="scope.row.totalAmount">
<template slot="append">美元</template>
</el-input>
</template>
</el-table-column>
<!-- <el-table-column label="本次实收金额" align="center" prop="totalAmount" /> -->
<!-- <el-table-column label="应收金额" align="center" prop="sumWeight" />
<el-table-column label="收款类型" align="center" prop="payType" />
<el-table-column label="总金额美元" align="center" prop="sumWeight" />
<el-table-column label="总金额RMB" align="center" prop="payType" />
<el-table-column label="实收金额" align="center" prop="actualAmount" /> -->
</el-table>
<el-form
ref="forms"
:model="form"
label-width="120px"
label-position="left"
>
<el-descriptions :column="2" border class="card">
<el-descriptions-item label="收款账户" style="width: 50%">
</el-card>
<el-card class="card">
<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 v-loading="loadings" :data="list" border>
<el-table-column label="订单号" align="center" prop="orderNo" />
<el-table-column label="唛头" align="center" prop="marks" />
<el-table-column label="品名" align="center" prop="title">
<template slot-scope="scope">
{{ scope.row.titleZh + "(" + scope.row.titleEn + ")" }}
</template>
</el-table-column>
<el-table-column label="箱数" align="center" prop="num" />
<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">
<template slot-scope="scope">
<dict-tag
:type="DICT_TYPE.FEE_TYPE"
:value="scope.row.feeType"
></dict-tag>
</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="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="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-descriptions :column="1" border class="card">
<el-descriptions-item v-for="(v, index) in form.receiptAccountList" :label="`收款账户${index + 1}`" :key="index">
<div style="display: flex">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0; margin-right: 12px"
:prop="`receiptAccountList[${index}].platformAccountId`"
:rules="{ required: true, trigger: ['blur', 'change'], message: '请选择收款账户' }"
>
<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="`receiptAccountList[${index}].currencyId`"
:rules="{ required: true, trigger: ['blur', 'change'], message: '请选择币种' }"
>
<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.receiptAccountList = [...form.receiptAccountList, {}]">添加收款账户</el-button>
<el-button type="text" v-if="index > 0" @click="subtractItem(index)"><span style="color: red">删除</span></el-button>
</div>
</el-descriptions-item>
<el-descriptions-item label="是否需要开票">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="platformAccountId"
required
error="请选择收款账户"
prop="openInvoice"
:rules="{ required: true, trigger: ['blur', 'change'], message: '请选择是否需要开票' }"
>
<el-select
v-model="form.platformAccountId"
placeholder="请选择收款账户"
v-model="form.openInvoice"
placeholder="请选择是否需要开票"
>
<el-option
v-for="item in bankData"
:key="item.id"
:label="item.baAccountName + '(' + item.baAccountNum + ')'"
:value="item.id"
/>
<el-option :value="1" label="需要"></el-option>
<el-option :value="0" label="不需要"></el-option>
</el-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="是否需要开票" style="width: 50%">
<el-descriptions-item label="核销基准币种">
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
</el-descriptions-item>
</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 v-if="showInvoice" class="card">
<div slot="header" class="card-title">开票资料</div>
<el-descriptions :column="3" border>
<el-descriptions-item label="发票抬头">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="transportId"
required
error="请选择是否需要开票"
prop="invoice"
:rules="{ required: true, trigger: ['blur', 'change'], message: '请输入发票抬头' }"
>
<dict-selector
:type="DICT_TYPE.INFRA_BOOLEAN_STRING"
v-model="form.transportId"
/>
<el-input v-model="form.invoice"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="纳税人识别号">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="taxpayer"
:rules="{ required: true, trigger: ['blur', 'change'], message: '请输入纳税人识别号' }"
>
<el-input v-model="form.taxpayer"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="开户行">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="accountBank"
:rules="{ required: true, trigger: ['blur', 'change'], message: '请输入开户行' }"
>
<el-input v-model="form.accountBank"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="账号">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="accountName"
:rules="{ required: true, trigger: ['blur', 'change'], message: '请输入账号' }"
>
<el-input v-model="form.accountName"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="项目">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="projectName"
:rules="{ required: true, trigger: ['blur', 'change'], message: '请输入项目' }"
>
<el-input v-model="form.projectName"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="税率%">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="taxRate"
:rules="{ required: true, trigger: ['blur', 'change'], message: '请输入税率' }"
>
<el-input v-model="form.taxRate"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="开票地址/电话">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="addressPhone"
:rules="{ required: true, trigger: ['blur', 'change'], message: '请输入开票地址/电话' }"
>
<el-input v-model="form.addressPhone"></el-input>
</el-form-item>
</el-descriptions-item>
</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-card>
<el-card class="card amountCard">
<el-descriptions :column="2" border>
<template v-for="(item, index) in form.receivableDetailList">
<el-descriptions-item :label="index === 0 ? '应收总金额' : ''" :key="index+3">
{{ item.amount }}
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="index + 1" />
</el-descriptions-item>
<el-descriptions-item :key="index">
<template v-if="showCurrencyId !== item.currencyId" slot="label">
汇率(<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
</template>
<el-form-item
v-if="showCurrencyId !== item.currencyId"
label=""
label-width="0"
style="margin-bottom: 0"
:prop="`receivableDetailList[${index}].rate`"
:rules="{ required: true, trigger: ['blur', 'change'], message: '请输入汇率' }"
>
<el-input v-model="item.rate" style="width: 220px" @input="calculationCount(form.receivableTotalAmount)"></el-input>
</el-form-item>
</el-descriptions-item>
</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-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 HH:mm:ss"
format="yyyy-MM-dd HH:mm:ss"
type="datetime"
placeholder="选择实收日期"
/>
</el-form-item>
</div>
</el-form>
</el-card>
<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>
<template slot="label">
应收总金额(<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
</template>
{{ form.receivableTotalAmount }}
</el-descriptions-item>
</el-descriptions>
</el-card>
</el-form>
<div slot="footer" style="margin: 20px 0">
<el-button type="primary" @click="submitForm">保 存</el-button>
<el-button type="primary" @click="submitForm">新 增</el-button>
<el-button type="primary" @click="submitForm(1)">保 存</el-button>
<el-button type="primary" @click="submitForm(0)">{{ id ? '修 改' : '新 增' }}</el-button>
</div>
<el-dialog
:visible.sync="open"
title="添加未收客户款项"
width="80%"
append-to-body
@open="getList"
>
<div>
<!-- <div slot="header" class="card-title">添加未收客户款项</div> -->
......@@ -399,10 +555,13 @@
</el-form-item>
</el-form>
<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" :reserve-selection="true"> </el-table-column>
<el-table-column label="订单号" align="center" prop="orderNo" />
......@@ -452,7 +611,7 @@
</template>
<script>
import { userList } from "@/api/system/user";
import { listSimpleUsers } from "@/api/system/user";
import { DICT_TYPE } from "@/utils/dict";
import { getToken } from "@/utils/auth";
import CustomerSelector from "@/components/CustomerSelector";
......@@ -460,8 +619,11 @@ 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 } from "@/api/ecw/financial";
import { getReceivableList } from "@/api/ecw/financial";
import { createReceipt, getReceivableList, getReceivableInfoByIds, getReceiptInfoByIds, getReceiptAccountList, getInvoicingItem, updateReceipt } from "@/api/ecw/financial";
import {getCustomer} from '@/api/ecw/customer'
import NP from 'number-precision'
import { getCurrencyPage } from "@/api/ecw/currency";
import ret from "bluebird/js/release/util";
export default {
name: "CreatCollection",
......@@ -473,11 +635,19 @@ export default {
loadings: false,
loading1: false,
uploadFileUrl: process.env.VUE_APP_BASE_API + "/app-api/file/upload", // 上传的图片服务器地址
form: {},
form: {
receiptAccountList: [{}],
receivableDetailList: [
{ amount: 0, currencyId: 1, rate: 0 },
{ amount: 0, currencyId: 2, rate: 0 },
{ amount: 0, currencyId: 3, rate: 0 }
]
},
creatorData: [],
list: [],
fileList: [],
// fileList: [],
orderData: [],
total: 0,
headers: {
Authorization: "Bearer " + getToken(),
},
......@@ -498,23 +668,45 @@ export default {
},
multipleSelection: [],
tradeCityList: [],
id: 0
id: 0,
receiptId: 0,
currencyList: []
};
},
async created() {
// 获取汇率
await getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
created() {
let that = this;
if (that.$route.query.id) {
this.id = this.$route.query.id;
getReceiptInfoByIds({ id: this.id }).then(res => {
this.form = Object.assign({}, this.form, res.data)
})
getInvoicingItem({ id: this.id }).then(res => {
this.list = [...res.data]
})
getReceiptAccountList({ id: this.id }).then(res => {
this.$set(this.form, 'receiptAccountList', [...res.data])
})
}
if (that.$route.query.receiptId && that.$route.query.receiptId !== '0') {
this.receiptId = this.$route.query.receiptId;
getReceivableInfoByIds({ id: this.receiptId }).then(res => {
this.list = [{...res.data}]
// this.$set(this.form, 'supplierId', res.data.supplierId)
this.calculation()
})
}
this.getList();
// this.getList();
// if(that.$route.query.consignorId){
// this.queryParams.consignorId = this.$route.query.consignorId
// }
// if(that.$route.query.writeOffName){
// this.form.writeOffName = this.$route.query.writeOffName
// }
userList("salesman").then((res) => (that.creatorData = res.data));
listSimpleUsers().then((res) => (that.creatorData = res.data));
getChannelList().then((res) => (that.channelList = res.data));
getTradeCityList().then((res) => (that.tradeCityList = res.data));
getBankAccountPage(that.params).then(
......@@ -536,9 +728,6 @@ export default {
}
});
});
this.id && getReceivableList({ ...that.params, id: this.id }).then(res => {
console.log(res, '==================')
})
},
computed: {
expoerCityList() {
......@@ -547,8 +736,113 @@ export default {
importCityList() {
return this.tradeCityList.filter((item) => item.type == 1);
},
showCurrencyId() {
let fieldList = [];
let groupList=[];
this.list.map((element)=>{
if(fieldList.indexOf(element['currencyId'])===-1){
fieldList.push(element['currencyId'])
}
})
for(let i=0;i<fieldList.length;i++){
let arr = this.list.filter((element)=>{
return element['currencyId']===fieldList[i];
})
groupList.push({
currencyId:arr[0].currencyId,
list:arr
})
}
if (groupList.length === 1) return groupList[0].currencyId
else return 1
},
showInvoice() {
return this.form.openInvoice == 1
}
},
methods: {
calculation() {
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
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
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
if (this.showCurrencyId === 1) { // 美元
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].amount = usCount
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.receivableTotalAmount = usCount
this.calculationCount(usCount)
} else if (this.showCurrencyId === 2) { // 人民币
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].amount = usCount
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.receivableTotalAmount = rmbCount
this.calculationCount(rmbCount)
} else if (this.showCurrencyId === 3) { // 奈拉
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].amount = nairaCount
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.receivableTotalAmount = nairaCount
this.calculationCount(nairaCount)
}
},
calculationCount(usCount) {
if (this.showCurrencyId === 1) {
this.form.receivableDetailList[2].amount = NP.times(this.form.receivableDetailList[2].rate, usCount)
this.form.receivableDetailList[1].amount = NP.times(this.form.receivableDetailList[1].rate, usCount)
} else if (this.showCurrencyId === 2) {
this.form.receivableDetailList[2].amount = NP.times(this.form.receivableDetailList[2].rate, usCount)
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() {
return NP.divide(100, this.currencyList.find(v => v.titleEn === 'USD').huilv)
},
NANtoUS() {
return NP.times(this.RMBtoUS(), this.NANtoRMB())
},
UStoRMB() {
return NP.divide(this.currencyList.find(v => v.titleEn === 'USD').huilv, 100)
},
UStoNAN() {
return NP.times(this.RMBtoNAN(), this.UStoRMB())
},
RMBtoNAN() {
return NP.divide(100, this.currencyList.find(v => v.titleEn === 'NGN').huilv)
},
NANtoRMB() {
return NP.divide(this.currencyList.find(v => v.titleEn === 'NGN').huilv, 100)
},
customerChange(value) {
this.form.customerName = value.name
this.form.customerId && getCustomer(this.form.customerId).then(res => {
this.form = {
...this.form,
invoice: this.form.invoice || res.data.invoiceTitle,
taxpayer: this.form.taxpayer || res.data.licenseNumber,
accountBank: this.form.accountBank || res.data.bank,
accountName: this.form.accountName || res.data.bankNumber,
projectName: this.form.projectName || res.data.project,
taxRate: this.form.taxRate || res.data.taxRate,
addressPhone: this.form.addressPhone || `${res.data.billingAddress || ''}/${res.data.billingTell || ''}`,
}
})
},
subtractItem(index) {
this.form.receiptAccountList.splice(index, 1)
this.$set(this.form, 'receiptAccountList', [...this.form.receiptAccountList])
},
getReceivableListByIds() {
},
......@@ -562,34 +856,43 @@ export default {
this.orderData = response.data.list;
this.total = response.data.total;
this.loading1 = false;
this.$nextTick(() => {
this.list.forEach(itm => {
const t = this.orderData.find(v => v.id == itm.id)
t && this.$refs.multipleTable.toggleRowSelection(t, true)
})
})
});
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除?`);
},
handleUploadSuccess(res, file, fileList) {
var arr = [];
fileList.forEach((item) => {
arr.push(item.response.data);
});
this.fileList = arr;
console.log(this.fileList);
this.loading.close();
},
handleBeforeUpload() {
this.loading = this.$loading({
lock: true,
text: "上传中",
background: "rgba(0, 0, 0, 0.7)",
});
},
handleUploadError() {
this.$message({
type: "error",
message: "上传失败",
});
this.loading.close();
},
// beforeRemove(file, fileList) {
// return this.$confirm(`确定移除?`).then(res => {
// setTimeout(() => {
// this.fileList = fileList.map(v => v.response.data)
// }, 300)
// });
// },
// handleUploadSuccess(res, file, fileList) {
// var arr = [];
// fileList.forEach((item) => {
// arr.push(item.response.data);
// });
// this.fileList = arr;
// this.loading.close();
// },
// handleBeforeUpload() {
// this.loading = this.$loading({
// lock: true,
// text: "上传中",
// background: "rgba(0, 0, 0, 0.7)",
// });
// },
// handleUploadError() {
// this.$message({
// type: "error",
// message: "上传失败",
// });
// this.loading.close();
// },
/** 新增按钮操作 */
handleAdd() {
this.open = true;
......@@ -597,10 +900,73 @@ export default {
hiddenDialog() {
this.open = false;
},
submitForm() {
const params = this.form;
console.log(params);
// createReceipt()
submitForm(addType) {
const params = {...this.form, addType}
params.receiptAccountList = params.receiptAccountList
delete params.receivableDetail
if (this.list && this.list.length > 0) {
params.receivableVOList = this.list
}
if (params.receivableVOList.length === 0) {
this.$modal.msgError("请添加未收客户款项");
return
}
if (addType === 1) {
let fieldsToValidate = ['customerId', 'departmentId', 'salesmanId']; // 部分字段校验 保存草稿用
Promise.all(
fieldsToValidate.map((field) => {
return new Promise((resolve, reject) => {
this.$refs['form'].validateField(field, (errorMessage) => {
resolve(errorMessage);
});
});
})
).then((errorMessages) => {
let valid = errorMessages.every((errorMessage) => {
return errorMessage == '';
});
if (valid) {
if (this.id && this.id !== '0') {
updateReceipt(params).then(res => {
this.$modal.msgSuccess("修改成功");
this.$router.back();
})
} else {
createReceipt(params).then(res => {
this.$modal.msgSuccess("保存成功");
this.$router.back();
})
}
}
});
return
}
this.$refs.form.validate ((valid)=>{
if (valid) {
// const params = {...this.form, addType}
// params.receiptAccountList = params.receiptAccountList
// delete params.receivableDetail
// if (this.list && this.list.length > 0) {
// params.receivableVOList = this.list
// }
// // params.fileList = this.fileList.join(',')
// if (params.receivableVOList.length === 0) {
// this.$modal.msgError("请添加未收客户款项");
// return
// }
if (this.id && this.id !== '0') {
updateReceipt(params).then(res => {
this.$modal.msgSuccess("修改成功");
this.$router.back();
})
} else {
createReceipt(params).then(res => {
this.$modal.msgSuccess("新增成功");
this.$router.back();
})
}
}
})
},
handleSelectionChange(val) {
this.multipleSelection = val;
......@@ -608,6 +974,7 @@ export default {
saveSelectList() {
this.list = this.multipleSelection
this.open = false;
this.calculation()
},
/** 搜索按钮操作 */
handleQuery() {
......@@ -617,7 +984,7 @@ export default {
};
</script>
<style>
<style scoped lang="scss">
.card {
margin-top: 20px;
}
......@@ -628,4 +995,15 @@ export default {
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%;
}
}
</style>
......@@ -196,7 +196,11 @@
<el-input v-model="scope.row.taxRate" @keyup.native="scope.row.taxRate = oninput(scope.row.taxRate)"></el-input>
</template>
</el-table-column>
<el-table-column label="价税合计(RMB)" align="center" prop="total" />
<el-table-column label="价税合计(RMB)" align="center" prop="total" >
<template slot-scope="scope">
<span>{{ scope.row.total = (scope.row.totalAmount * scope.row.exchangeRate) + (scope.row.totalAmount * scope.row.exchangeRate) * (scope.row.taxRate/100) }}</span>
</template>
</el-table-column>
</el-table>
<el-form
......@@ -405,7 +409,7 @@
</template>
<script>
import { userList } from "@/api/system/user";
import { listSimpleUsers } from "@/api/system/user";
import { DICT_TYPE } from "@/utils/dict";
import { getToken } from "@/utils/auth";
import { getChannelList } from "@/api/ecw/channel";
......@@ -475,7 +479,7 @@ export default {
this.defaultList = [...res.data]
})
}
userList("salesman").then((res) => (that.creatorData = res.data));
listSimpleUsers().then((res) => (that.creatorData = res.data));
getChannelList().then((res) => (that.channelList = res.data));
getTradeCityList().then((res) => (that.tradeCityList = res.data));
getBankAccountPage(that.params).then(
......
<template>
<div class="app-container">
<div slot="header" class="card-title">开票</div>
<div slot="header" class="card-title">开票</div>
<!-- 搜索工作栏 -->
<el-card class="card">
<el-form ref="queryForm" size="small" :inline="true" label-width="100px" class="card">
<el-form-item label="发票号码:" >
{{invoiceData.sn}}
</el-form-item>
<el-form-item label="开票类型:" >
<dict-selector :type="DICT_TYPE.ECW_RECEIPT_STATE" v-model="invoiceData.invoicingTypeId" />
</el-form-item>
</el-form>
</el-card>
<el-card class="card">
<el-form
:model="invoiceData"
ref="queryForm"
size="small"
:inline="true"
label-width="120px"
class="card"
>
<el-card class="card">
<el-form-item label="发票号码:" prop="invoiceNumber" :rules="{ required: true, trigger: ['blur'], message: '发票号码不能为空' }">
<el-input v-model="invoiceData.invoiceNumber"></el-input>
</el-form-item>
<el-form-item label="开票类型:" prop="invoicingTypeId" :rules="{ required: true, trigger: ['blur', 'change'], message: '开票类型不能为空' }">
<dict-selector
:type="DICT_TYPE.ECW_INVOICING_TYPE"
v-model="invoiceData.invoicingTypeId"
/>
</el-form-item>
</el-card>
<el-card class="card">
<div slot="header" class="card-title">开票资料</div>
<el-table v-loading="loading" :data="invoiceData.info" border class="card">
<el-table-column label="发票抬头" align="center" prop="taxpayer" />
<el-table-column label="纳税人识别号" align="center" prop="taxpayer" />
<el-table-column label="地址" align="center" prop="orderNo" />
<el-table-column label="开户行" align="center" prop="customerName" />
<el-table-column label="税率" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.taxRate" type="number" min="0"></el-input>
</template>
</el-table-column>
<el-table-column label="项目" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.projectName" type="text"></el-input>
</template>
</el-table-column>
</el-table>
</el-card>
<el-card class="card">
<el-table v-loading="loading" :data="invoiceData.list" border class="card" show-summary :summary-method="getSummaries">
<el-table-column label="订单号" align="center" prop="orderSn" />
<el-table-column label="品名" align="center" prop="prodName" />
<el-table-column label="箱数" align="center" prop="num" />
<el-table-column label="体积/重量" align="center">
<el-descriptions title="" direction="vertical" :column="6" border>
<el-descriptions-item label="发票抬头">{{ invoiceData.invoice }}</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.accountBank }}</el-descriptions-item>
<el-descriptions-item label="税率">
<el-form-item label="">
<el-input v-model="invoiceData.taxRate"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="项目">
<el-form-item label="">
<el-input v-model="invoiceData.projectName"></el-input>
</el-form-item>
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card class="card">
<el-table
v-loading="loading"
:data="list"
border
class="card"
show-summary
:summary-method="getSummaries"
>
<el-table-column label="订单号" align="center" prop="orderNo" />
<el-table-column label="品名" align="center" prop="titleZh">
<template slot-scope="scope">
<span>{{scope.row.volume+"m³/"+scope.row.weight+"kg"}}</span>
{{ scope.row.titleZh || scope.row.titleEn ? scope.row.titleZh + "(" + scope.row.titleEn + ")" : '' }}
</template>
</el-table-column>
<el-table-column label="费用类型" align="center" prop="feeType">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="scope.row.feeType"></dict-tag>
</template>
</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="num" />
<el-table-column label="价税合计" align="center" prop="num" />
<div slot="append" class="lastRow">
<div>收款人</div>
<div>111</div>
<div>核销人</div>
<div>222</div>
<div>开票人</div>
<div>333</div>
<div></div>
<div>价税合计大写</div>
<div>444</div>
</div>
</el-table>
</el-card>
<el-descriptions class="card" style="width: 50%;">
<el-descriptions-item label="备注" >
<el-input v-model="invoiceData.remarks" type="text" placeholder="" clearable></el-input>
</el-descriptions-item>
</el-descriptions>
<div slot="footer" class="card">
<el-button type="primary" @click="submitForm">确定</el-button>
</div>
</el-table-column>
<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="feeType">
<template slot-scope="scope">
<dict-tag
:type="DICT_TYPE.ECW_TRANSPORT_TYPE"
:value="scope.row.feeType"
></dict-tag>
</template>
</el-table-column>
<el-table-column label="单价" align="center" prop="unitPrice" />
<el-table-column label="总金额" align="center" prop="totalAmount" />
<el-table-column label="税额" align="center">
<template slot-scope="scope">
</template>
</el-table-column>
<el-table-column label="价税合计" align="center">
<template slot-scope="scope">
</template>
</el-table-column>
</el-table>
</el-card>
<el-descriptions class="card" style="width: 50%">
<el-descriptions-item label="备注">
<el-input
v-model="invoiceData.invoicingRemark"
type="text"
placeholder=""
clearable
></el-input>
</el-descriptions-item>
</el-descriptions>
</el-form>
<div slot="footer" class="card">
<el-button type="primary" @click="submitForm">确定</el-button>
</div>
</div>
</template>
<script>
import { DICT_TYPE } from "@/utils/dict";
import { getReceiptInvoicing, getInvoicingItem, updateReceiptInvoicing } from "@/api/ecw/financial";
import {DICT_TYPE} from '@/utils/dict'
export default {
name: "OpenInvoice",
components: {
},
data() {
return {
loading: false,
invoiceData:{},
}
},
created() {
let that = this
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
// 处理查询参数
getReceiptPage().then(response => {
this.invoiceData = response.data;
if(!this.invoiceData.info||this.invoiceData.info.length==0){
this.$modal.msgError("客户开票资料不能为空,请完善客户开票信息");
}
this.loading = false;
});
},
submitForm(){
this.open = false;
},
getSummaries(param) {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '总价';
return;
}else if(index<6){
sums[index] = 'N/A';
return;
}
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index] += '';
} else {
sums[index] = 'N/A';
}
});
return sums;
}
},
}
</script>
<style>
.card{
margin-top: 20px;
}
.dialog-footer{
padding: 30px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
height: 160px;
}
.card-title{
font-size: 18px;
font-weight: bold;
}
.lastRow{
border-top:1px solid #dfe6ec;
display: flex;
width: 100%;
height: 44px;
text-align: center;
align-items: center;
}
.lastRow div{
flex:1;
height: 44px;
line-height: 44px;
border-right:1px solid #dfe6ec;
}
export default {
name: "OpenInvoice",
components: {},
data() {
return {
loading: false,
invoiceData: {},
id: 0,
list: []
};
},
created() {
if (this.$route.query.id) {
this.id = this.$route.query.id;
this.getData();
}
},
methods: {
getData() {
this.loading = true;
getReceiptInvoicing(this.id).then((res) => {
this.invoiceData = res.data;
this.invoiceData.invoicingTypeId = this.invoiceData.invoicingTypeId || ''
// if (!this.invoiceData.info || this.invoiceData.info.length == 0) {
// this.$modal.msgError("客户开票资料不能为空,请完善客户开票信息");
// }
this.loading = false;
});
getInvoicingItem({ id: this.id }).then(res => {
const t = {
orderNo: '合计',
totalAmount: res.data.reduce((total, curr) => total + curr.totalAmount, 0)
}
this.list = [...res.data, t]
})
},
submitForm() {
this.$refs.queryForm.validate(valid => {
if (valid) {
updateReceiptInvoicing(this.invoiceData).then(res => {
this.open = false;
this.$modal.msgSuccess("操作成功");
this.$router.back();
})
}
})
},
getSummaries(param) {
return ['收款人', this.invoiceData.payeeName, '核销人', this.invoiceData.writeOffName, '开票人', this.invoiceData.issuerName, '', '价税合计大写', 444];
},
},
};
</script>
</style>
<style scoped lang="scss">
.card {
margin-top: 20px;
}
.dialog-footer {
padding: 30px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
height: 160px;
}
.card-title {
font-size: 18px;
font-weight: bold;
}
.lastRow {
border-top: 1px solid #dfe6ec;
display: flex;
width: 100%;
height: 44px;
text-align: center;
align-items: center;
}
.lastRow div {
flex: 1;
height: 44px;
line-height: 44px;
border-right: 1px solid #dfe6ec;
}
::v-deep .el-form-item--small.el-form-item {
margin-bottom: 0;
}
</style>
......@@ -71,6 +71,7 @@
<el-date-picker
v-model="queryParams.beginCreateTime"
type="datetimerange"
value-format="yyyy-MM-dd"
range-separator="到"
start-placeholder="请选择日期"
end-placeholder="请选择日期">
......@@ -247,7 +248,7 @@ export default {
this.loading = true;
// 处理查询参数
let params = { ...this.queryParams };
this.addBeginAndEndTime(params, this.dateRangeCreateTime, "createTime");
this.addBeginAndEndTime(params, this.queryParams.beginCreateTime, "createTime");
// 执行查询
getPaymentList(params).then((response) => {
this.list = response.data.list;
......@@ -281,7 +282,7 @@ export default {
},
deleteClick(row) {
const id = row.id;
this.$modal.confirm('是否确认删除该应付款?').then(function() {
this.$modal.confirm('是否确认删除该付款单?').then(function() {
return deletePayment(id);
}).then(() => {
this.getList();
......
......@@ -29,11 +29,11 @@
</div>
<table border="1" style="margin-top: 20px;width: 100%;text-align: center;border-collapse: collapse;line-height: 2 ">
<tr>
<th style="width: 4%;">序号</th>
<th style="width: 6%;">序号</th>
<th style="width: 15%;">自编号</th>
<th style="width: 15%;">费用类型</th>
<th style="width: 15%;">币别</th>
<th style="width: 12%;">汇率</th>
<th style="width: 10%;">汇率</th>
<th style="width: 15%;">发票号</th>
<th style="width: 12%;">应付金额</th>
<th style="width: 12%;">申请金额</th>
......
......@@ -4,26 +4,26 @@
<div style="text-align: center;font-weight: bold;font-size: 20px;">收款单</div>
<div style="margin-top: 20px;">
<div style="display: flex;width: 80%;align-items: center;margin-bottom: 10px;">
<div style="flex:1"><div style="width: 120px;text-align: right;">部门:</div><span>{{form?form.departmentName:''}}</span></div>
<div style="flex:1"><div style="width: 120px;text-align: right;display:inline-block;">部门:</div><span>{{form?form.departmentName:''}}</span></div>
</div>
<div style="display: flex;width: 80%;align-items: center;margin-bottom: 10px;">
<div style="flex:1"><div style="width: 120px;text-align: right;">收款单号:</div> <span>{{form?form.receiptNo:''}}</span></div>
<div style="flex:1"><div style="width: 120px;text-align: right;">收款日期:</div><span>{{form?form.payedAt:''}}</span></div>
<div style="flex:1"><div style="width: 120px;text-align: right;display:inline-block;">收款单号:</div> <span>{{form?form.receiptNo:''}}</span></div>
<div style="flex:1"><div style="width: 120px;text-align: right;display:inline-block;">收款日期:</div><span>{{form?form.payedAt:''}}</span></div>
</div>
<div style="display: flex;width: 80%;align-items: center;margin-bottom: 10px;">
<div style="flex:1"><div style="width: 120px;text-align: right;">客户名称:</div><span>{{form?form.customerName:''}}</span></div>
<div style="flex:1"><div style="width: 120px;text-align: right;">收款户名:</div><span>{{form?form.platformAccount:''}}</span></div>
<div style="flex:1"><div style="width: 120px;text-align: right;display:inline-block;">客户名称:</div><span>{{form?form.customerName:''}}</span></div>
<div style="flex:1"><div style="width: 120px;text-align: right;display:inline-block;">收款户名:</div><span>{{form?form.payeeName:''}}</span></div>
</div>
<div style="display: flex;width: 80%;align-items: center;margin-bottom: 10px;">
<div style="flex:1"><div style="width: 120px;text-align: right;">银行名称:</div><span>{{form?form.accountBank:''}}</span></div>
<div style="flex:1"><div style="width: 120px;text-align: right;">银行账号:</div><span>{{form?form.accountBank:''}}</span></div>
<div style="flex:1"><div style="width: 120px;text-align: right;display:inline-block;">银行名称:</div><span>{{form?form.accountBank:''}}</span></div>
<div style="flex:1"><div style="width: 120px;text-align: right;display:inline-block;">银行账号:</div><span>{{form?form.platformAccount:''}}</span></div>
</div>
<div style="display: flex;width: 80%;align-items: center;margin-bottom: 10px;">
<div style="flex:1"><div style="width: 120px;text-align: right;">水单号:</div><span>{{form?form.accountBank:''}}</span></div>
<div style="flex:1"><div style="width: 120px;text-align: right;">手续费:</div><span>{{form?form.accountBank:''}}</span></div>
<div style="flex:1"><div style="width: 120px;text-align: right;display:inline-block;">水单号:</div><span>{{form?form.waterBillNo:''}}</span></div>
<div style="flex:1"><div style="width: 120px;text-align: right;display:inline-block;">手续费:</div><span>{{form?form.feeRate:''}}</span></div>
</div>
<div style="display: flex;width: 80%;align-items: center;">
<div style="flex:1"><div style="width: 120px;text-align: right;">备注:</div><span>{{form?form.accountBank:''}}</span></div>
<div style="flex:1"><div style="width: 120px;text-align: right;display:inline-block;">备注:</div><span>{{form?form.remark:''}}</span></div>
</div>
</div>
<table border="1" style="margin-top: 20px;width: 100%;text-align: center;border-collapse: collapse; ">
......@@ -36,44 +36,22 @@
<th style="width: 12%;">总金额</th>
<th style="width: 20%;">实收金额</th>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
<tr v-for="(item, index) in list" :key="index">
<td>{{ index + 1 }}</td>
<td>{{ item.orderNo }}</td>
<td>-</td>
<td>{{ item.titleZh }}</td>
<td>{{ item.exchangeRate }}</td>
<td>{{ item.totalAmount }}</td>
<td>{{ item.actualAmount }}</td>
</tr>
<tr>
<td colspan="2">合计(大写)</td>
<td colspan="2">$80</td>
<td colspan="2">价税合计</td>
<td>$80</td>
<td colspan="2">{{ convertCurrency(totalMoney()) }}</td>
<td colspan="2">合计实收</td>
<td>{{ totalMoney() }}</td>
</tr>
</table>
<!-- <el-table-column label="序号" align="center" min-width="80">
<template slot-scope="scope">
<span>{{scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column min-width="120" label="订单号" align="center" prop="orderNo" />
<el-table-column label="收入类型" align="center" min-width="180">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.PAYMENT_TYPE" :value="scope.row.paymentType"></dict-tag>
</template>
</el-table-column>
<el-table-column label="品名" align="center" prop="orderNo" min-width="220" />
<el-table-column label="汇率" align="center" prop="totalAmount" min-width="80" />
<el-table-column label="总金额" align="center" prop="toDepartureId" min-width="120" />
<el-table-column label="实收金额" align="center" prop="toDepartureId" min-width="200"/>
<div slot="append" class="lastRow">
<div style="min-width: 200px;width: 20%;">合计(大写)</div>
<div style="min-width: 400px;width: 40%;">111</div>
<div style="min-width: 200px;width: 20%;">价税合计</div>
<div style="min-width: 200px;width: 20%;">444</div>
</div>
</el-table> -->
<div style="margin-top: 20px;">
<div style="display: flex;width: 100%;align-items: center;">
<div style="flex:1"><span style="width: 120px;">主管:</span></div>
......@@ -90,13 +68,14 @@
</template>
<script>
import { userList } from "@/api/system/user"
import { listSimpleUsers } from "@/api/system/user"
import {DICT_TYPE} from '@/utils/dict'
import CustomerSelector from '@/components/CustomerSelector'
import { getBankAccountPage } from "@/api/ecw/bankAccount";
import { listSimpleDepts } from "@/api/system/dept"
import { getReceipt} from "@/api/ecw/receipt";
import lodop from '@/utils/lodop'
import { getReceiptInfoByIds, getInvoicingItem } from "@/api/ecw/financial";
export default {
name: "PrintVoucher",
......@@ -126,8 +105,11 @@
if(that.$route.query.id){
that.id = that.$route.query.id
that.getCollectionData()
getInvoicingItem({id: this.id}).then(res => {
this.list = res.data
})
}
userList('salesman').then(res =>that.creatorData = res.data)
listSimpleUsers().then(res =>that.creatorData = res.data)
getBankAccountPage(that.params).then(res =>that.bankData = res.data.list)
listSimpleDepts().then(res =>{
res.data.forEach((item)=>{
......@@ -152,7 +134,7 @@
methods: {
getCollectionData(){
let that = this
getReceipt({id:that.id}).then(res =>{
getReceiptInfoByIds({id:that.id}).then(res =>{
that.form = res.data
})
},
......@@ -175,7 +157,102 @@
console.error('lodop异常', err)
alert('请检查LODOP打印控件是否安装并启动');
})
}
},
totalMoney() {
const t = this.list.map(v => v.actualAmount).reduce((prev, curr) => {
return prev + curr;
}, 0)
return 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
},
},
}
......
<template>
<div class="app-container">
<el-card>
<div slot="header" class="card-title">收款单详情</div>
<el-descriptions :column="3" border>
<el-descriptions-item label="收款单编号">{{ form.receiptNo }}</el-descriptions-item>
<el-descriptions-item label="状态">
<dict-tag :type="DICT_TYPE.ECW_RECEIPT_STATE" :value="form.state"/>
</el-descriptions-item>
<el-descriptions-item label="客户">{{ form.customerName }}</el-descriptions-item>
<el-descriptions-item label="部门">{{ form.departmentName }}</el-descriptions-item>
<el-descriptions-item label="业务员">{{ form.salesmanName }}</el-descriptions-item>
<el-descriptions-item label="手续费(RMB)">{{ form.feeRate }}</el-descriptions-item>
<el-descriptions-item label="备注">{{ form.remark }}</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card class="card">
<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-column label="订单号" align="center" prop="orderNo" />
<el-table-column label="唛头" align="center" prop="marks" />
<el-table-column label="品名" align="center" prop="title">
<template slot-scope="scope">
{{ scope.row.titleZh + "(" + scope.row.titleEn + ")" }}
</template>
</el-table-column>
<el-table-column label="箱数" align="center" prop="num" />
<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">
<template slot-scope="scope">
<dict-tag
:type="DICT_TYPE.FEE_TYPE"
:value="scope.row.feeType"
></dict-tag>
</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="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="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-descriptions :column="1" border class="card">
<el-descriptions-item v-for="(v, index) in form.platformAccountIdList" :label="`收款账户${index + 1}`" :key="index">
<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="subtractItem(index)"><span style="color: red">删除</span></el-button>
</div>
</el-descriptions-item>
<el-descriptions-item label="是否需要开票">
<span>{{ form.openInvoice == 1 ? '需要' : '不需要' }}</span>
<!-- <el-select
v-model="form.openInvoice"
placeholder="请选择是否需要开票"
>
<el-option :value="1" label="需要"></el-option>
<el-option :value="0" label="不需要"></el-option>
</el-select> -->
</el-descriptions-item>
<el-descriptions-item label="核销基准币种">
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card class="card">
<div slot="header" class="card-title">开票资料</div>
<el-descriptions :column="3" border>
<el-descriptions-item label="发票抬头">
{{ form.invoice }}
<!-- <el-input v-model="form.invoice"></el-input> -->
</el-descriptions-item>
<el-descriptions-item label="纳税人识别号">
{{ form.taxpayer }}
<!-- <el-input v-model="form.taxpayer"></el-input> -->
</el-descriptions-item>
<el-descriptions-item label="开户行">
{{ form.accountBank }}
<!-- <el-input v-model="form.accountBank"></el-input> -->
</el-descriptions-item>
<el-descriptions-item label="账号">
{{ form.accountName }}
<!-- <el-input v-model="form.accountName"></el-input> -->
</el-descriptions-item>
<el-descriptions-item label="项目">
{{ form.projectName }}
<!-- <el-input v-model="form.projectName"></el-input> -->
</el-descriptions-item>
<el-descriptions-item label="税率%">
{{ form.taxRate }}
<!-- <el-input v-model="form.taxRate"></el-input> -->
</el-descriptions-item>
<el-descriptions-item label="开票地址/电话">
{{ form.addressPhone }}
<!-- <el-input v-model="form.addressPhone"></el-input> -->
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card class="card">
<div slot="header" class="card-title">银行收款明细</div>
<div>
<el-button type="primary" plain size="mini" @click="batchVerification" style="padding: 10px; margin-bottom: 10px">批量核销</el-button>
<el-button type="primary" plain size="mini" @click="handleAddReceiptItem" style="padding: 10px; margin-bottom: 10px">添加收款明细</el-button>
</div>
<el-table ref="multipleTable" :data="detailed" border row-key="id" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" :reserve-selection="true"> </el-table-column>
<el-table-column label="序号" type="index" align="center" width="50"></el-table-column>
<el-table-column label="收款账户" align="center" prop="accountName" />
<el-table-column label="实收金额" align="center" prop="amount" />
<el-table-column label="实收币种" align="center" prop="marks">
<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="rate" />
<el-table-column label="核销货币金额" align="center" prop="writeOffAmount" />
<el-table-column label="实收日期" align="center" prop="amountDate">
<!-- <template slot-scope="scope">
<span>{{ parseTime(scope.row.amountDate, '{y}-{m}-{d}') }}</span>
</template> -->
</el-table-column>
<el-table-column label="水单号" align="center" prop="billNo" />
<el-table-column label="水单附件" align="center" prop="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>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<span>{{ scope.row.status == 0 ? '待核销' : '已核销' }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200">
<template slot-scope="scope">
<el-button v-if="scope.row.status == 0" type="text" @click="deleteClick(scope.row)">删除</el-button>
<el-button type="text">详情</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 == 0" type="text" @click="editClick(scope.row)">编辑</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-card class="card">
<el-descriptions :column="2" border>
<template v-for="(item, index) in form.receivableDetailList">
<el-descriptions-item :label="index === 0 ? '应收总金额' : ''" :key="index+3">
{{ item.amount }}
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="index + 1" />
</el-descriptions-item>
<el-descriptions-item :key="index">
<template v-if="showCurrencyId !== item.currencyId" slot="label">
汇率(<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
</template>
<span v-if="showCurrencyId !== item.currencyId">{{ item.rate }}</span>
</el-descriptions-item>
</template>
<el-descriptions-item>
<template slot="label">
应收总金额(<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
</template>
{{ form.receivableTotalAmount }}
</el-descriptions-item>
<el-descriptions-item label="已核销总金额">
<el-tag>{{ verificationData.usCount }}美元</el-tag>
<el-tag>{{ verificationData.rmbCount }}人民币</el-tag>
<el-tag>{{ verificationData.nairaCount }}奈拉</el-tag>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
已核销金额(<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
</template>
{{ verificationData.writtenOff }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
已核销比例(<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
</template>
{{ verificationData.WriteOffProportion }}%
</el-descriptions-item>
</el-descriptions>
</el-card>
<div slot="footer" style="margin: 20px 0">
<el-button type="primary" @click="toEdit">编 辑</el-button>
<el-button type="primary" @click="verificationAll">全部核销</el-button>
</div>
<el-dialog v-if="openAddDialog" :visible.sync="openAddDialog" :title="dialogTitle" width="40%" append-to-body>
<div style="padding: 0 24px">
<el-form ref="addForm" :model="addForm" label-width="150px">
<el-form-item label="收款单号">{{ form.receiptNo }}</el-form-item>
<el-form-item label="剩余应收金额">
<div>
<div>{{ remainingAmount.usAmount }}美元</div>
<div>{{ remainingAmount.rmbAmount }}人民币</div>
<div>{{ remainingAmount.nairaAmount }}奈拉</div>
</div>
</el-form-item>
<el-form-item label="收款账户" required prop="accountNo" error="收款账户不能为空">
<el-select 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-select>
</el-form-item>
<el-form-item
label="实收日期"
prop="amountDate"
required
error="实收日期不能为空"
>
<el-date-picker
clearable
v-model="addForm.amountDate"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
type="date"
placeholder="选择实收日期"
/>
</el-form-item>
<div style="display: flex;">
<el-form-item
label="实收"
prop="amount"
required
error="实收不能为空"
>
<el-input v-model="addForm.amount" style="width: 220px; margin-right: 12px"></el-input>
</el-form-item>
<el-form-item
label-width="0px"
prop="currencyId"
required
error="币种不能为空"
>
<dict-selector :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" v-model="addForm.currencyId" />
</el-form-item>
</div>
<el-form-item
v-if="showCurrencyId != addForm.currencyId"
prop="rate"
required
error="汇率不能为空"
>
<template slot="label">
汇率(<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
</template>
<el-input v-model="addForm.rate" style="width: 220px"></el-input>
</el-form-item>
<el-form-item
v-if="showCurrencyId != addForm.currencyId"
>
<template slot="label">
金额(<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
</template>
<!-- <el-input v-model="addForm.rate"></el-input> -->
</el-form-item>
<el-form-item
label="收款附件"
prop="attr"
>
<el-upload
class="upload-demo"
:action="uploadFileUrl"
:headers="headers"
:on-success="handleUploadSuccess"
:before-upload="handleBeforeUpload"
:on-error="handleUploadError"
:before-remove="beforeRemove"
:file-list="addForm.attr"
multiple
>
<el-button size="small" type="primary">上传附件</el-button>
</el-upload>
</el-form-item>
<el-form-item
label="水单号"
prop="billNo"
required
error="水单号不能为空"
>
<el-input v-model="addForm.billNo" style="width: 220px"></el-input>
</el-form-item>
</el-form>
<div slot="footer">
<el-button type="primary" @click="saveFrom">{{ saveBtnText }}</el-button>
<el-button @click="hiddenDialog">取 消</el-button>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import { getBankAccountPage } from "@/api/ecw/bankAccount";
import { getToken } from "@/utils/auth";
import { getCustomer } from '@/api/ecw/customer'
import {
getReceiptInfoByIds,
getInvoicingItem,
receiptItemCreate,
getReceivableItem,
deleteReceiptItem,
receiptItemVerification,
receiptItemVerificationCancel,
updateReceiptItem,
receiptItemBatchVerification,
receiptItemAllVerification
} from "@/api/ecw/financial";
import { getCurrencyPage } from "@/api/ecw/currency";
import NP from 'number-precision'
export default {
data() {
return {
uploadFileUrl: process.env.VUE_APP_BASE_API + "/app-api/file/upload", // 上传的图片服务器地址
headers: {
Authorization: "Bearer " + getToken(),
},
id: 0,
form: {},
list: [],
detailedList: [],
openAddDialog: false,
bankData: [],
params: {
page: 1,
rows: 20,
},
addForm: {},
detailed: [],
dialogTitle: '添加收款明细',
saveBtnText: '添 加',
multipleSelection: [],
currencyList: [],
verificationData: {
usCount: 0,
rmbCount: 0,
nairaCount: 0,
writtenOff: 0,
WriteOffProportion: 0
},
remainingAmount: {
usAmount: 0,
rmbAmount: 0,
nairaAmount: 0
}
}
},
computed: {
showCurrencyId() {
let fieldList = [];
let groupList=[];
this.list.map((element)=>{
if(fieldList.indexOf(element['currencyId'])===-1){
fieldList.push(element['currencyId'])
}
})
for(let i=0;i<fieldList.length;i++){
let arr = this.list.filter((element)=>{
return element['currencyId']===fieldList[i];
})
groupList.push({
currencyId:arr[0].currencyId,
list:arr
})
}
if (groupList.length === 1) return groupList[0].currencyId
else return 1
}
},
watch: {
'addForm.currencyId'(newVal) {
this.currencyIdChange(newVal)
}
},
async created() {
// 获取汇率
await getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
if (this.$route.query.id) {
this.id = this.$route.query.id;
await getReceiptInfoByIds({ id: this.id }).then(res => {
this.form = res.data
getCustomer(this.form.customerId).then(res => {
this.form.customerName = res?.data?.name
})
})
await getInvoicingItem({ id: this.id }).then(res => {
this.list = [...res.data]
})
}
getBankAccountPage(this.params).then((res) => (this.bankData = res.data.list));
this.getList()
},
methods: {
calculation() {
const verificationList = this.detailed.filter(v => v.status === 1)
const dollarList = verificationList.filter(v => v.currencyId === 1)
const dollar = dollarList.length > 0 ? dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.amount || 0), 0) : 0
const rmbList = verificationList.filter(v => v.currencyId === 2)
const rmb = rmbList.length > 0 ? rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.amount || 0), 0) : 0
const nairaList = verificationList.filter(v => v.currencyId === 3)
const naira = nairaList.length > 0 ? nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.amount || 0), 0) : 0
const usCount = NP.plus(dollar, NP.times(this.RMBtoUS(), rmb), NP.times(this.NANtoUS(), naira))
const rmbCount = NP.plus(rmb, NP.times(this.UStoRMB(), dollar), NP.times(this.NANtoRMB(), naira))
const nairaCount = NP.plus(naira, NP.times(this.UStoNAN(), dollar), NP.times(this.RMBtoNAN(), rmb))
this.verificationData.usCount = usCount
this.verificationData.rmbCount = rmbCount
this.verificationData.nairaCount = nairaCount
if (this.showCurrencyId === 1) { // 美元
this.verificationData.writtenOff = usCount
this.verificationData.WriteOffProportion = NP.times(NP.divide(usCount, this.form.receivableTotalAmount), 100)
const remaining = NP.minus(this.form.receivableTotalAmount, usCount)
this.remainingAmount = {
usAmount: remaining,
rmbAmount: NP.times(this.UStoRMB(), remaining),
nairaAmount: NP.times(this.UStoNAN(), remaining)
}
} else if (this.showCurrencyId === 2) { // 人民币
this.verificationData.writtenOff = rmbCount
this.verificationData.WriteOffProportion = NP.times(NP.divide(rmbCount, this.form.receivableTotalAmount), 100)
const remaining = NP.minus(this.form.receivableTotalAmount, rmbCount)
this.remainingAmount = {
usAmount: NP.times(this.RMBtoUS(), remaining),
rmbAmount: remaining,
nairaAmount: NP.times(this.RMBtoNAN(), remaining)
}
} else if (this.showCurrencyId === 3) { // 奈拉
this.verificationData.writtenOff = nairaCount
this.verificationData.WriteOffProportion = NP.times(NP.divide(nairaCount, this.form.receivableTotalAmount), 100)
const remaining = NP.minus(this.form.receivableTotalAmount, nairaCount)
this.remainingAmount = {
usAmount: NP.times(this.NANtoUS(), remaining),
rmbAmount: NP.times(this.NANtoRMB(), remaining),
nairaAmount: remaining
}
}
},
RMBtoUS() {
return NP.divide(100, this.currencyList.find(v => v.titleEn === 'USD').huilv)
},
NANtoUS() {
return NP.times(this.RMBtoUS(), this.NANtoRMB())
},
UStoRMB() {
return NP.divide(this.currencyList.find(v => v.titleEn === 'USD').huilv, 100)
},
UStoNAN() {
return NP.times(this.RMBtoNAN(), this.UStoRMB())
},
RMBtoNAN() {
return NP.divide(100, this.currencyList.find(v => v.titleEn === 'NGN').huilv)
},
NANtoRMB() {
return NP.divide(this.currencyList.find(v => v.titleEn === 'NGN').huilv, 100)
},
currencyIdChange(val) {
val = Number(val)
if(val === this.showCurrencyId) {
this.addForm.rate = 1
} else {
if (this.showCurrencyId === 1 && val === 2) this.addForm.rate = this.RMBtoUS()
else if (this.showCurrencyId === 1 && val === 3) this.addForm.rate = this.NANtoUS()
else if (this.showCurrencyId === 2 && val === 1) this.addForm.rate = this.UStoRMB()
else if (this.showCurrencyId === 2 && val === 3) this.addForm.rate = this.NANtoRMB()
else if (this.showCurrencyId === 3 && val === 1) this.addForm.rate = this.UStoNAN()
else if (this.showCurrencyId === 3 && val === 2) this.addForm.rate = this.RMBtoNAN()
}
},
getList() {
getReceivableItem({ id: this.id }).then(res => {
this.detailed = res.data.map(v => ({
...v,
amountDate: this.parseTime(v.amountDate, '{y}-{m}-{d}'),
accountNo: +v.accountNo,
attr: v.attr ? v.attr.split(',').map(t => ({ name: t.slice(t.lastIndexOf('/') + 1), url: t })) : []
}))
this.calculation()
})
},
saveFrom() {
this.$refs.addForm.validate ((valid)=>{
if (valid) {
if (this.addForm.id) {
const params = {...this.addForm}
params.attr && (params.attr = params.attr.map(v => v.url).join(','))
updateReceiptItem(params).then(res => {
this.$modal.msgSuccess("修改成功");
this.openAddDialog = false
this.getList()
})
return
}
const params = {...this.addForm}
params.attr && (params.attr = params.attr.map(v => v.url).join(','))
params.receiptId = this.id
receiptItemCreate(params).then(res => {
this.$modal.msgSuccess("新增成功");
this.openAddDialog = false
this.getList()
})
}
})
},
toEdit() {
return this.$router.push("creatCollection?id=" + this.id);
},
editClick(row) {
this.openAddDialog = true
this.dialogTitle = '编辑收款明细'
this.saveBtnText = '提 交'
setTimeout(() => {
this.addForm = { ...row }
}, 0)
},
deleteClick(row) {
const id = row.id;
this.$modal.confirm('是否确认删除该收款单?').then(function() {
return deleteReceiptItem(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
verificationClick(row) {
const id = row.id;
this.$modal
.confirm("您确认要核销吗?")
.then(function () {
return receiptItemVerification(id);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("核销成功");
})
.catch(() => {});
},
verificationCancelClick(row) {
const id = row.id;
this.$modal
.confirm("您确认要反核销吗?")
.then(function () {
return receiptItemVerificationCancel(id);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("反核销成功");
})
.catch(() => {});
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
batchVerification() {
if (this.multipleSelection.length === 0) {
this.$modal.msgError("请选择需要核销的收款明细!");
return
}
const params = { ids: this.multipleSelection.map(v => v.id).join(',') }
this.$modal
.confirm("您确认要核销吗?")
.then(function () {
return receiptItemBatchVerification(params);
})
.then(() => {
this.multipleSelection.forEach(row => {
this.$refs.multipleTable.toggleRowSelection(row);
});
this.getList();
this.$modal.msgSuccess("核销成功");
})
.catch(() => {});
},
verificationAll() {
this.$modal
.confirm("您确认要全部核销吗?")
.then(function () {
return receiptItemAllVerification(this.id);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("核销成功");
})
.catch(() => {});
},
hiddenDialog() {
this.openAddDialog = false
},
handleAddReceiptItem() {
this.addForm = {}
this.openAddDialog = true
this.dialogTitle = '添加收款明细'
this.saveBtnText = '添 加'
},
handleUploadSuccess(res, file, fileList) {
var arr = [];
setTimeout(() => {
fileList.forEach((item) => {
arr.push({ name: item.name, url: item.response ? item.response.data : item.url });
});
this.addForm.attr = arr;
}, 300)
this.loading.close();
},
handleBeforeUpload() {
this.loading = this.$loading({
lock: true,
text: "上传中",
background: "rgba(0, 0, 0, 0.7)",
});
},
handleUploadError() {
this.$message({
type: "error",
message: "上传失败",
});
this.loading.close();
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除?`).then(res => {
setTimeout(() => {
this.addForm.attr = fileList.map(v => ({ name: v.name, url: v.response ? v.response.data : v.url }))
}, 300)
});
}
}
}
</script>
<style scoped lang="scss">
.app-container {
::v-deep .el-descriptions-item__label {
width: 200px;
}
::v-deep .el-tag + .el-tag {
margin-left: 8px;
}
}
.card {
margin-top: 20px;
}
.dialog-footer {
padding: 40px;
}
.card-title {
font-size: 18px;
font-weight: bold;
}
</style>
\ No newline at end of file
......@@ -209,15 +209,25 @@
></dict-tag>
</template>
</el-table-column>
<el-table-column label="单价美元" align="center" prop="unitPrice" />
<el-table-column label="总金额美元" align="center" prop="totalAmount" />
<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="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"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button size="mini" type="text" @click="handleAdd(scope.row)"
<el-button size="mini" type="text" @click="handleAdd(scope.row.id)"
>收款</el-button
>
</template>
......@@ -301,9 +311,8 @@ export default {
this.getList();
},
/** 新增按钮操作 */
handleAdd(row) {
// return this.$router.push("creatCollection?id=" + row.id, { params });
return this.$router.push({ path: "creatCollection?id=" + row.id, query: { data: JSON.stringify(row) } })
handleAdd(id) {
return this.$router.push("creatCollection?receiptId=" + id);
},
submitForm() {},
},
......
<template>
<div class="app-container">
<div slot="header" class="card-title">收款单</div>
<div slot="header" class="card-title">收款单</div>
<!-- 搜索工作栏 -->
<el-card v-show="showSearch" class="card">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px" class="card">
<el-row :span="24">
<el-form-item label="收款单号:" >
<el-input style="max-width: 188px;" v-model="queryParams.receiptNo" placeholder="请输入收款单号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="客户名称:" >
<customer-selector v-model="queryParams.customerId" @change="consignor = $event" />
</el-form-item>
<el-form-item label="状态:" >
<dict-selector :type="DICT_TYPE.ECW_RECEIPT_STATE" v-model="queryParams.state" />
</el-form-item>
<el-form-item label="业务员:">
<el-select v-model="queryParams.salesmanId" placeholder="请选择业务员">
<el-option v-for="item in creatorData" :key="item.id" :label="item.nickname" :value="item.id"/>
</el-select>
</el-form-item>
</el-row>
<el-row :span="24">
<el-col style="width: 592px;">
<el-form-item label="创建时间:" >
<el-date-picker
v-model="queryParams.beginCreateTime"
type="datetimerange"
range-separator="到"
start-placeholder="请选择日期"
end-placeholder="请选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-form-item label="自编号:" >
<el-input style="max-width: 188px;" v-model="queryParams.orderNo" placeholder="请输入自编号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="订单号:" >
<el-input style="max-width: 188px;" v-model="queryParams.orderNo" placeholder="请输入订单号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
</el-row>
<el-row :span="24">
<el-form-item label="商品名称:" >
<el-input style="max-width: 188px;" v-model="queryParams.orderNo" placeholder="请输入商品名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="费用类型:" >
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="queryParams.feeType"></dict-selector>
</el-form-item>
<el-form-item label="收款类型:" >
<dict-selector :type="DICT_TYPE.PAYMENT_TYPE" v-model="queryParams.paymentType"></dict-selector>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleQuery">查找</el-button>
</el-form-item>
</el-row>
</el-form>
</el-card>
<el-table v-loading="loadings" :data="list" border class="card">
<el-table-column label="序号" align="center" prop="id" type="index">
<template slot-scope="scope">
<span>{{scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="收款单号" align="center" prop="receiptNo" />
<el-table-column label="自编号" align="center" prop="orderNo" />
<el-table-column label="订单号" align="center" prop="orderNo" />
<el-table-column label="客户名称" align="center" prop="customerName" />
<el-table-column label="金额" align="center" prop="totalAmount" />
<el-table-column label="币种" align="center">
<el-card v-show="showSearch" class="card">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
label-width="100px"
class="card"
>
<el-row :span="24">
<el-form-item label="收款单号:">
<el-input
style="max-width: 188px"
v-model="queryParams.receiptNo"
placeholder="请输入收款单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="客户名称:">
<customer-selector
v-model="queryParams.customerId"
@change="consignor = $event"
/>
</el-form-item>
<el-form-item label="状态:">
<dict-selector
:type="DICT_TYPE.ECW_RECEIPT_STATE"
v-model="queryParams.state"
/>
</el-form-item>
<el-form-item label="业务员:">
<el-select
v-model="queryParams.salesmanId"
placeholder="请选择业务员"
>
<el-option
v-for="item in creatorData"
:key="item.id"
:label="item.nickname"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-row>
<el-row :span="24">
<el-col style="width: 592px">
<el-form-item label="创建时间:">
<el-date-picker
v-model="queryParams.beginCreateTime"
type="datetimerange"
range-separator="到"
start-placeholder="请选择日期"
end-placeholder="请选择日期"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-form-item label="自编号:">
<el-input
style="max-width: 188px"
v-model="queryParams.orderNo"
placeholder="请输入自编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="订单号:">
<el-input
style="max-width: 188px"
v-model="queryParams.orderNo"
placeholder="请输入订单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-row>
<el-row :span="24">
<el-form-item label="商品名称:">
<el-input
style="max-width: 188px"
v-model="queryParams.orderNo"
placeholder="请输入商品名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="费用类型:">
<dict-selector
:type="DICT_TYPE.FEE_TYPE"
v-model="queryParams.feeType"
></dict-selector>
</el-form-item>
<el-form-item label="收款类型:">
<dict-selector
:type="DICT_TYPE.PAYMENT_TYPE"
v-model="queryParams.paymentType"
></dict-selector>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleQuery">查找</el-button>
</el-form-item>
</el-row>
</el-form>
</el-card>
<el-table v-loading="loadings" :data="list" border class="card">
<el-table-column label="序号" align="center" prop="id" type="index">
<template slot-scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="收款单号" align="center" prop="receiptNo" />
<!-- <el-table-column label="自编号" align="center" prop="orderNo" /> -->
<el-table-column label="订单号" align="center" prop="orderNo" />
<el-table-column label="客户名称" align="center" prop="customerName" />
<el-table-column label="创建日期" align="center" prop="createTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="币种" align="center">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.COMMISSION_CURRENCY_TYPE" :value="scope.row.currencyId" />
</template>
</el-table-column>
<el-table-column label="汇率" align="center" prop="totalAmount" />
<el-table-column label="实收日期" align="center" prop="channelName" />
<el-table-column label="业务员" align="center" prop="toDepartureId" />
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.ECW_RECEIPT_STATE" :value="scope.row.state" />
</template>
</el-table-column>
<el-table-column label="是否开票" align="center">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.isCargoControl" />
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button v-if="scope.row.state==1" size="mini" type="primary">核销</el-button>
<el-button v-if="scope.row.state>1" size="mini" type="primary">反核销</el-button>
<el-button v-if="scope.row.state==3" size="mini" type="primary">开票</el-button>
<el-button size="mini" @click="handleAdd(scope.row.id)">编辑</el-button>
<el-button size="mini" type="danger">删除</el-button>
<el-button size="mini" type="primary" @click="toprint(scope.row.id)">打印</el-button>
<el-button size="mini" type="success" @click="open=true">导出订单</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :limit.sync="queryParams.rows"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog title="费用登记" :visible.sync="open" width="500px" style="margin-top: 20vh !important;" append-to-body>
<div slot="header" class="card-title" style='border-bottom: 2px solid #f8f8f8;'>
</el-table-column> -->
<!-- <el-table-column label="汇率" align="center" prop="totalAmount" /> -->
<el-table-column label="实收日期" align="center" prop="payedAt">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.payedAt, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="业务员" align="center" prop="salesmanName" />
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<dict-tag
:type="DICT_TYPE.ECW_RECEIPT_STATE"
:value="scope.row.state"
/>
</template>
</el-table-column>
<el-table-column label="是否开票" align="center">
<template slot-scope="scope">
{{ scope.row.openInvoice === 0 ? '' : '' }}
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
v-if="scope.row.state === 0 || scope.row.state == 1 || scope.row.state == 5"
size="mini"
type="text"
@click="handleAdd(scope.row.id)"
>编辑</el-button
>
<el-button
v-if="scope.row.state == 1"
size="mini"
type="text"
@click="verificationClick(scope.row)"
>核销</el-button
>
<el-button
v-if="scope.row.state != 1 && scope.row.state != 5"
size="mini"
type="text"
@click="verificationCancelClick(scope.row)"
>反核销</el-button
>
<el-button
v-if="scope.row.state == 3"
size="mini"
type="text"
@click="openInvoice(scope.row.id)"
>开票</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 != 5"
size="mini"
type="text"
@click="toprint(scope.row.id)"
>打印</el-button
>
<el-button
v-if="scope.row.state != 5"
size="mini"
type="text"
@click="exportReceipt(scope.row.id)"
>导出订单</el-button
>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.rows"
@pagination="getList"
/>
<!-- 对话框(添加 / 修改) -->
<el-dialog
title="导出账单"
:visible.sync="open"
width="500px"
style="margin-top: 20vh !important"
append-to-body
>
<!-- <div slot="title" class="card-title" style='border-bottom: 2px solid #f8f8f8;'>
<span>导出账单</span>
<i class="el-icon-close" @click="cancel"></i>
</div>
<div class="dialog-footer">
<el-button type="primary" style="width: 130px;" @click="submitForm">国内账单</el-button>
<el-button plain type="primary" style="width: 130px;margin: 0;" @click="submitForm">Debite note</el-button>
</div>
</el-dialog>
</div> -->
<div class="dialog-footer">
<el-button type="primary" style="width: 130px" @click="submitForm(1)"
>国内账单</el-button
>
<el-button
plain
type="primary"
style="width: 130px; margin: 0"
@click="submitForm(2)"
>Debite note</el-button
>
</div>
</el-dialog>
</div>
</template>
<script>
import { userList } from "@/api/system/user"
import {DICT_TYPE} from '@/utils/dict'
import CustomerSelector from '@/components/CustomerSelector'
import { listSimpleUsers } from "@/api/system/user";
import { DICT_TYPE } from "@/utils/dict";
import CustomerSelector from "@/components/CustomerSelector";
import {
getReceiptList,
receiptVerification,
receiptVerificationCancel,
receiptExportExcel,
deleteReceipt
} from "@/api/ecw/financial";
export default {
name: "Voucher",
components: {
CustomerSelector
},
data() {
return {
open:false,
showSearch:true,
loadings: false,
form:{},
creatorData:[],
list:[],
total:0,
dateType:[],
loading:'',
params:{
page:1,
rows:20,
},
// 查询参数
queryParams: {
page: 1,
rows: 10,
dateType:null,
date:null,
originId:null,
destinationId:null,
transportId:null,
isCargoControl:null,
orderExceptionStatus:null,
orderExceptionType:null,
orderNo:null,
consignorId:null,
marks:null,
prodId:null,
productRecord:null,
followUpSalesmanId:null
},
}
},
created() {
let that = this
userList('salesman').then(res =>that.creatorData = res.data)
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
// 处理查询参数
let params = {...this.queryParams};
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行查询
getReceiptPage(params).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
// this.getList();
},
/** 新增按钮操作 */
handleAdd(id) {
return this.$router.push('creatCollection?id='+id)
},
toprint(id){
return this.$router.push('printVoucher?id='+id)
},
submitForm(){
export default {
name: "Voucher",
components: {
CustomerSelector,
},
data() {
return {
exportId: "",
open: false,
showSearch: true,
loadings: false,
form: {},
creatorData: [],
list: [],
total: 0,
dateType: [],
loading: "",
params: {
page: 1,
rows: 20,
},
// 查询参数
queryParams: {
page: 1,
rows: 20,
dateType: null,
date: null,
originId: null,
destinationId: null,
transportId: null,
isCargoControl: null,
orderExceptionStatus: null,
orderExceptionType: null,
orderNo: null,
consignorId: null,
marks: null,
prodId: null,
productRecord: null,
followUpSalesmanId: null,
},
};
},
created() {
let that = this;
listSimpleUsers().then((res) => (that.creatorData = res.data));
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
// 处理查询参数
let params = { ...this.queryParams };
this.addBeginAndEndTime(params, this.dateRangeCreateTime, "createTime");
// 执行查询
getReceiptList(params).then((response) => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
verificationClick(row) {
const id = row.id;
return this.$router.push("receiptDetail?id=" + id);
// this.$modal
// .confirm("您确认要核销吗?")
// .then(function () {
// return receiptVerification(id);
// })
// .then(() => {
// this.getList();
// this.$modal.msgSuccess("核销成功");
// })
// .catch(() => {});
},
verificationCancelClick(row) {
const id = row.id;
return this.$router.push("receiptDetail?id=" + id);
// this.$modal
// .confirm("您确认要反核销吗?")
// .then(function () {
// return receiptVerificationCancel(id);
// })
// .then(() => {
// this.getList();
// this.$modal.msgSuccess("反核销成功");
// })
// .catch(() => {});
},
deleteClick(row) {
const id = row.id;
this.$modal.confirm('是否确认删除该收款单?').then(function() {
return deleteReceipt(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
// this.getList();
},
/** 新增按钮操作 */
handleAdd(id) {
return this.$router.push("creatCollection?id=" + id);
},
toprint(id) {
return this.$router.push("printVoucher?id=" + id);
},
openInvoice(id) {
return this.$router.push("openInvoice?id=" + id);
},
exportReceipt(id) {
this.open = true;
this.exportId = id;
},
submitForm(type) {
receiptExportExcel({ id: this.exportId, billType: type }).then((response) => {
this.$download.excel(response, `${type === 2 ? "国外账单" : "Debite_note"}.xls`);
this.open = false;
},
/** 取消按钮 */
cancel() {
this.open = false;
},
},
}
</script>
}
);
},
/** 取消按钮 */
// cancel() {
// this.open = false;
// },
},
};
</script>
<style>
.card{
margin-top: 20px;
}
.dialog-footer{
padding: 30px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
height: 160px;
}
.card-title{
font-size: 18px;
font-weight: bold;
}
</style>
.card {
margin-top: 20px;
}
.dialog-footer {
padding: 30px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
height: 160px;
}
.card-title {
font-size: 18px;
font-weight: bold;
}
</style>
......@@ -315,7 +315,7 @@ export default {
return [...this.warehousing.orderWarehouseInBackItemDoList, ...this.form.orderWarehouseInItemDoList]
},
isBeian(){
return this.brandList.find(e => e.titleZh === this.form.brand) ? '有备案' : '无备案'
return ['无备案', '有备案', '中性'][this.warehousing.brandType]
},
brand(){
if (!!this.form.brand){
......
......@@ -25,7 +25,7 @@
<el-table-column
label="填单货物属性">
<template v-slot="{row}">
品牌:{{ row.brand !== '0' ? '' : '' }}<br>
品牌:{{ ['无牌', '有牌', '中性'][row.brandType] }}<br>
箱数:{{ row.num }}<br>
体积:{{ row.volume }}<br>
重量:{{ row.weight }}Kg
......@@ -34,10 +34,12 @@
<el-table-column
label="入库货物属性">
<template v-slot="{row}">
品牌:{{ row.brand !== '0' ? '' : '' }}<br>
箱数:{{ row.warehouseInInfoVO.cartonsNum }}<br>
体积:{{ row.warehouseInInfoVO.volume }}<br>
重量:{{ row.warehouseInInfoVO.weight }}Kg
<template v-if="row.warehouseInInfoVO">
品牌:{{ ['无牌', '有牌', '中性'][row.brandType] }}<br>
箱数:{{ row.warehouseInInfoVO.cartonsNum }}<br>
体积:{{ row.warehouseInInfoVO.volume }}<br>
重量:{{ row.warehouseInInfoVO.weight }}Kg
</template>
</template>
</el-table-column>
<el-table-column
......
......@@ -301,14 +301,14 @@ export default {
name: [{ required: true, message: "用户昵称不能为空", trigger: "blur" }],
cardType: [{ required: true, message: "证件类型不能为空", trigger: "blur" }],
cardNumber: [{ required: true, message: "证件号码不能为空", trigger: "blur" }],
img1: [{ required: true, message: "身份正面照不能为空", trigger: "blur" }],
img2: [{ required: true, message: "身份正面照不能为空", trigger: "blur" }],
img1: [{ required: true, message: "身份正面照不能为空", trigger: ['blur','change'] }],
img2: [{ required: true, message: "身份正面照不能为空", trigger: ['blur','change'] }],
},
rulesEnterprise: {
name: [{required: true, message: "企业名称不能为空", trigger: "blur"}],
legalName: [{required: true, message: "企业法人不能为空", trigger: "blur"}],
cardNumber: [{required: true, message: "证件号码不能为空", trigger: "blur"}],
img1: [{required: true, message: "证件照不能为空", trigger: "blur"}],
img1: [{required: true, message: "证件照不能为空", trigger: ['blur','change']}],
},
publicObj:undefined,
operationLogShow:false,
......
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