Commit e21d9277 authored by chenwei's avatar chenwei

feat: 字典和翻译 财务2.2相关

parent 696ef223
import request from '@/utils/request' import request from "@/utils/request"
import { data } from "vue2-ace-editor"
// 创建收款单 // 创建收款单
export function createReceipt(data) { export function createReceipt(data) {
return request({ return request({
url: '/ecw/receipt/create', url: "/ecw/receipt/create",
method: 'post', method: "post",
data: data data: data
}) })
} }
...@@ -12,26 +13,40 @@ export function createReceipt(data) { ...@@ -12,26 +13,40 @@ export function createReceipt(data) {
// 更新收款单 // 更新收款单
export function updateReceipt(data) { export function updateReceipt(data) {
return request({ return request({
url: '/ecw/receipt/update', url: "/ecw/receipt/update",
method: 'put', method: "put",
data: data data: data
}) })
} }
// 获取收款单列表 // 获取收款单列表
export function getReceiptList(query) { export function getReceiptList(data) {
return request({ const params = {
url: '/ecw/receipt/page', page: data.page,
method: 'get', rows: data.rows
params: query }
return request({
url: "/ecw/receipt/page",
method: "post",
params,
data
}) })
} }
// 获取应收款列表 // 获取应收款列表
export function getReceivableList(query) { export function getReceivableList(query) {
return request({ return request({
url: '/ecw/receivable/page', url: "/ecw/receivable/page",
method: 'get', method: "get",
params: query
})
}
// 获取应收款总额
export function getReceivableAmount(query) {
return request({
url: "/ecw/receivable/page/amount",
method: "get",
params: query params: query
}) })
} }
...@@ -39,8 +54,8 @@ export function getReceivableList(query) { ...@@ -39,8 +54,8 @@ export function getReceivableList(query) {
// 获取应收款详情 // 获取应收款详情
export function getReceivableInfoByIds(query) { export function getReceivableInfoByIds(query) {
return request({ return request({
url: '/ecw/receivable/get', url: "/ecw/receivable/get",
method: 'get', method: "get",
params: query params: query
}) })
} }
...@@ -48,8 +63,8 @@ export function getReceivableInfoByIds(query) { ...@@ -48,8 +63,8 @@ export function getReceivableInfoByIds(query) {
// 修改优惠信息 // 修改优惠信息
export function updateReceivableDiscountById(query) { export function updateReceivableDiscountById(query) {
return request({ return request({
url: '/ecw/receivable/updateReceivableDiscountById', url: "/ecw/receivable/updateReceivableDiscountById",
method: 'post', method: "post",
data: query data: query
}) })
} }
...@@ -57,24 +72,24 @@ export function updateReceivableDiscountById(query) { ...@@ -57,24 +72,24 @@ export function updateReceivableDiscountById(query) {
// 得到应收优惠的最后操作人 // 得到应收优惠的最后操作人
export function getReceivableDiscountLogById(query) { export function getReceivableDiscountLogById(query) {
return request({ return request({
url: '/ecw/receivable/getReceivableDiscountLogById', url: "/ecw/receivable/getReceivableDiscountLogById",
method: 'get', method: "get",
params: query params: query
}) })
} }
// 根据订单ID获得需要预付应收款列表 // 根据订单ID获得需要预付应收款列表
export function getReceivableByOrderId(query) { export function getReceivableByOrderId(query) {
return request({ return request({
url: '/ecw/receivable/getReceivableByOrderId', url: "/ecw/receivable/getReceivableByOrderId",
method: 'get', method: "get",
params: query params: query
}) })
} }
// 根据订单ID获得需要预付应收款列表 // 根据订单ID获得需要预付应收款列表
export function getFirstReceivableListByOrderId(query) { export function getFirstReceivableListByOrderId(query) {
return request({ return request({
url: '/ecw/receivable/getFirstReceivableListByOrderId', url: "/ecw/receivable/getFirstReceivableListByOrderId",
method: 'get', method: "get",
params: query params: query
}) })
} }
...@@ -98,8 +113,8 @@ export function getFirstReceivableListByOrderId(query) { ...@@ -98,8 +113,8 @@ export function getFirstReceivableListByOrderId(query) {
// 获取收款单详情 // 获取收款单详情
export function getReceiptInfoByIds(query) { export function getReceiptInfoByIds(query) {
return request({ return request({
url: '/ecw/receipt/get', url: "/ecw/receipt/get",
method: 'get', method: "get",
params: query params: query
}) })
} }
...@@ -107,8 +122,8 @@ export function getReceiptInfoByIds(query) { ...@@ -107,8 +122,8 @@ export function getReceiptInfoByIds(query) {
// 获取收款单明细列表 // 获取收款单明细列表
export function getReceivableItemDetail(query) { export function getReceivableItemDetail(query) {
return request({ return request({
url: '/ecw/receipt/getReceivableItemDetail', url: "/ecw/receipt/getReceivableItemDetail",
method: 'get', method: "get",
params: query params: query
}) })
} }
...@@ -116,8 +131,8 @@ export function getReceivableItemDetail(query) { ...@@ -116,8 +131,8 @@ export function getReceivableItemDetail(query) {
// 获取收款单明细 // 获取收款单明细
export function getInvoicingItem(query) { export function getInvoicingItem(query) {
return request({ return request({
url: '/ecw/receipt/getReceivableItemDetail', url: "/ecw/receipt/getReceivableItemDetail",
method: 'get', method: "get",
params: query params: query
}) })
} }
...@@ -125,8 +140,8 @@ export function getInvoicingItem(query) { ...@@ -125,8 +140,8 @@ export function getInvoicingItem(query) {
// 创建收款明细 // 创建收款明细
export function receiptItemCreate(data) { export function receiptItemCreate(data) {
return request({ return request({
url: '/ecw/receipt-item/create', url: "/ecw/receipt-item/create",
method: 'post', method: "post",
data: data data: data
}) })
} }
...@@ -134,8 +149,8 @@ export function receiptItemCreate(data) { ...@@ -134,8 +149,8 @@ export function receiptItemCreate(data) {
// 根据收款单ID获得收款明细列表 // 根据收款单ID获得收款明细列表
export function getReceivableItem(query) { export function getReceivableItem(query) {
return request({ return request({
url: '/ecw/receipt-item/getReceivableItem', url: "/ecw/receipt-item/getReceivableItem",
method: 'get', method: "get",
params: query params: query
}) })
} }
...@@ -143,16 +158,16 @@ export function getReceivableItem(query) { ...@@ -143,16 +158,16 @@ export function getReceivableItem(query) {
//lanbm 2024-06-05 add //lanbm 2024-06-05 add
export function getReceivableItem2(id) { export function getReceivableItem2(id) {
return request({ return request({
url: '/ecw/receipt-item/get?id=' + id, url: "/ecw/receipt-item/get?id=" + id,
method: 'get' method: "get"
}) })
} }
// 根据收款单ID获得收款账户细列表 // 根据收款单ID获得收款账户细列表
export function getReceiptAccountList(query) { export function getReceiptAccountList(query) {
return request({ return request({
url: '/ecw/receipt/getReceiptAccountList', url: "/ecw/receipt/getReceiptAccountList",
method: 'get', method: "get",
params: query params: query
}) })
} }
...@@ -160,16 +175,16 @@ export function getReceiptAccountList(query) { ...@@ -160,16 +175,16 @@ export function getReceiptAccountList(query) {
// 删除收款明细 // 删除收款明细
export function deleteReceiptItem(id) { export function deleteReceiptItem(id) {
return request({ return request({
url: '/ecw/receipt-item/delete?id=' + id, url: "/ecw/receipt-item/delete?id=" + id,
method: 'delete' method: "delete"
}) })
} }
// 更新收款明细 // 更新收款明细
export function updateReceiptItem(data) { export function updateReceiptItem(data) {
return request({ return request({
url: '/ecw/receipt-item/update', url: "/ecw/receipt-item/update",
method: 'put', method: "put",
data: data data: data
}) })
} }
...@@ -177,24 +192,24 @@ export function updateReceiptItem(data) { ...@@ -177,24 +192,24 @@ export function updateReceiptItem(data) {
// 收款明细核销 // 收款明细核销
export function receiptItemVerification(id) { export function receiptItemVerification(id) {
return request({ return request({
url: '/ecw/receipt-item/verification/' + id, url: "/ecw/receipt-item/verification/" + id,
method: 'GET' method: "GET"
}) })
} }
// 反核销收款单 // 反核销收款单
export function receiptItemVerificationCancel(id) { export function receiptItemVerificationCancel(id) {
return request({ return request({
url: '/ecw/receipt-item/verificationCancel/' + id, url: "/ecw/receipt-item/verificationCancel/" + id,
method: 'GET' method: "GET"
}) })
} }
// 收款明细批量核销 // 收款明细批量核销
export function receiptItemBatchVerification(query) { export function receiptItemBatchVerification(query) {
return request({ return request({
url: '/ecw/receipt-item/batchVerification', url: "/ecw/receipt-item/batchVerification",
method: 'GET', method: "GET",
params: query params: query
}) })
} }
...@@ -202,8 +217,8 @@ export function receiptItemBatchVerification(query) { ...@@ -202,8 +217,8 @@ export function receiptItemBatchVerification(query) {
// 收款单全部核销 // 收款单全部核销
export function receiptItemAllVerification(id) { export function receiptItemAllVerification(id) {
return request({ return request({
url: '/ecw/receipt-item/allVerification/' + id, url: "/ecw/receipt-item/allVerification/" + id,
method: 'GET' method: "GET"
}) })
} }
...@@ -219,9 +234,9 @@ export function receiptItemAllVerification(id) { ...@@ -219,9 +234,9 @@ export function receiptItemAllVerification(id) {
// 导出收款单 Excel // 导出收款单 Excel
export function receiptExportExcel(query) { export function receiptExportExcel(query) {
return request({ return request({
url: '/ecw/receipt/export-excel', url: "/ecw/receipt/export-excel",
method: 'get', method: "get",
responseType: 'blob', responseType: "blob",
params: query params: query
}) })
} }
...@@ -229,34 +244,33 @@ export function receiptExportExcel(query) { ...@@ -229,34 +244,33 @@ export function receiptExportExcel(query) {
// 删除收款单 // 删除收款单
export function deleteReceipt(id) { export function deleteReceipt(id) {
return request({ return request({
url: '/ecw/receipt/delete?id=' + id, url: "/ecw/receipt/delete?id=" + id,
method: 'delete' method: "delete"
}) })
} }
// 获得收款单开票信息 // 获得收款单开票信息
export function getReceiptInvoicing(id) { export function getReceiptInvoicing(id) {
return request({ return request({
url: '/ecw/receipt/invoicing/info/' + id, url: "/ecw/receipt/invoicing/info/" + id,
method: 'get' method: "get"
}) })
} }
// 更新收款单开票信息 // 更新收款单开票信息
export function updateReceiptInvoicing(data) { export function updateReceiptInvoicing(data) {
return request({ return request({
url: '/ecw/receipt/invoicing/info', url: "/ecw/receipt/invoicing/info",
method: 'put', method: "put",
data: data data: data
}) })
} }
// 更新应付款 // 更新应付款
export function updatePayable(data) { export function updatePayable(data) {
return request({ return request({
url: '/ecw/payable/update', url: "/ecw/payable/update",
method: 'put', method: "put",
data: data data: data
}) })
} }
...@@ -264,18 +278,16 @@ export function updatePayable(data) { ...@@ -264,18 +278,16 @@ export function updatePayable(data) {
// 删除应付款 // 删除应付款
export function deletePayable(id) { export function deletePayable(id) {
return request({ return request({
url: '/ecw/payable/delete?id=' + id, url: "/ecw/payable/delete?id=" + id,
method: 'delete' method: "delete"
}) })
} }
// 获取应付款列表 // 获取应付款列表
export function getPayableList(query) { export function getPayableList(query) {
return request({ return request({
url: '/ecw/payable/page', url: "/ecw/payable/page",
method: 'get', method: "get",
params: query params: query
}) })
} }
...@@ -283,16 +295,16 @@ export function getPayableList(query) { ...@@ -283,16 +295,16 @@ export function getPayableList(query) {
// 获取应付款详情 // 获取应付款详情
export function getPayableInfoByIds(query) { export function getPayableInfoByIds(query) {
return request({ return request({
url: '/ecw/payable/get', url: "/ecw/payable/get",
method: 'get', method: "get",
params: query params: query
}) })
} }
//获取佣金应付款详情 //获取佣金应付款详情
export function getCommissionPayable(params){ export function getCommissionPayable(params) {
return request({ return request({
url:'/ecw/commission-payable/get', url: "/ecw/commission-payable/get",
method:"get", method: "get",
params params
}) })
} }
...@@ -300,16 +312,16 @@ export function getCommissionPayable(params){ ...@@ -300,16 +312,16 @@ export function getCommissionPayable(params){
// 创建付款单 // 创建付款单
export function createPayment(data) { export function createPayment(data) {
return request({ return request({
url: '/ecw/payment/create', url: "/ecw/payment/create",
method: 'post', method: "post",
data: data data: data
}) })
} }
// 创建佣金订单 // 创建佣金订单
export function commissionPayment(data){ export function commissionPayment(data) {
return request({ return request({
url:'/ecw/commission-payment/create', url: "/ecw/commission-payment/create",
method:'post', method: "post",
data data
}) })
} }
...@@ -317,8 +329,8 @@ export function commissionPayment(data){ ...@@ -317,8 +329,8 @@ export function commissionPayment(data){
// 获取付款单列表 // 获取付款单列表
export function getPaymentList(query) { export function getPaymentList(query) {
return request({ return request({
url: '/ecw/payment/page', url: "/ecw/payment/page",
method: 'get', method: "get",
params: query params: query
}) })
} }
...@@ -326,24 +338,24 @@ export function getPaymentList(query) { ...@@ -326,24 +338,24 @@ export function getPaymentList(query) {
// 获取付款单详情 // 获取付款单详情
export function getPaymentInfoByIds(query) { export function getPaymentInfoByIds(query) {
return request({ return request({
url: '/ecw/payment/get', url: "/ecw/payment/get",
method: 'get', method: "get",
params: query params: query
}) })
} }
// 获得佣金付款单 // 获得佣金付款单
export function getCommissionPayment(params){ export function getCommissionPayment(params) {
return request({ return request({
url:'/ecw/commission-payment/get', url: "/ecw/commission-payment/get",
method:'get', method: "get",
params params
}) })
} }
// 获得佣金付款单列表 // 获得佣金付款单列表
export function getCommissionPayableList(params){ export function getCommissionPayableList(params) {
return request({ return request({
url:'/ecw/commission-payable/list', url: "/ecw/commission-payable/list",
method:'get', method: "get",
params params
}) })
} }
...@@ -351,26 +363,25 @@ export function getCommissionPayableList(params){ ...@@ -351,26 +363,25 @@ export function getCommissionPayableList(params){
// 获得付款单付款明细 // 获得付款单付款明细
export function getPaymentItem(query) { export function getPaymentItem(query) {
return request({ return request({
url: '/ecw/payment/getPaymentItem', url: "/ecw/payment/getPaymentItem",
method: 'get', method: "get",
params: query params: query
}) })
} }
// 更新付款单 // 更新付款单
export function updatePayment(data) { export function updatePayment(data) {
return request({ return request({
url: '/ecw/payment/update', url: "/ecw/payment/update",
method: 'put', method: "put",
data: data data: data
}) })
} }
// 更新佣金付款单 // 更新佣金付款单
export function commissionPaymentUpdate(data){ export function commissionPaymentUpdate(data) {
return request({ return request({
url:'/ecw/commission-payment/update', url: "/ecw/commission-payment/update",
method:'put', method: "put",
data data
}) })
} }
...@@ -378,16 +389,16 @@ export function commissionPaymentUpdate(data){ ...@@ -378,16 +389,16 @@ export function commissionPaymentUpdate(data){
// 删除付款单 // 删除付款单
export function deletePayment(id) { export function deletePayment(id) {
return request({ return request({
url: '/ecw/payment/delete?id=' + id, url: "/ecw/payment/delete?id=" + id,
method: 'delete' method: "delete"
}) })
} }
// 审核付款单 // 审核付款单
export function paymentVerify(query) { export function paymentVerify(query) {
return request({ return request({
url: '/ecw/payment/verify', url: "/ecw/payment/verify",
method: 'post', method: "post",
data: query data: query
}) })
} }
...@@ -395,8 +406,8 @@ export function paymentVerify(query) { ...@@ -395,8 +406,8 @@ export function paymentVerify(query) {
// 核销付款单 // 核销付款单
export function paymentVerification(data) { export function paymentVerification(data) {
return request({ return request({
url: '/ecw/payment/verification', url: "/ecw/payment/verification",
method: 'post', method: "post",
data data
}) })
} }
...@@ -404,16 +415,16 @@ export function paymentVerification(data) { ...@@ -404,16 +415,16 @@ export function paymentVerification(data) {
// 反核销付款单 // 反核销付款单
export function paymentVerificationCancel(data) { export function paymentVerificationCancel(data) {
return request({ return request({
url: '/ecw/payment/verificationCancel', url: "/ecw/payment/verificationCancel",
method: 'post', method: "post",
data data
}) })
} }
// 取消付款单反核销 // 取消付款单反核销
export function paymentCancelFinancePaymentWriteOffNo(data){ export function paymentCancelFinancePaymentWriteOffNo(data) {
return request({ return request({
url:'ecw/payment/cancelFinancePaymentWriteOffNo', url: "ecw/payment/cancelFinancePaymentWriteOffNo",
method:'post', method: "post",
data data
}) })
} }
...@@ -421,26 +432,26 @@ export function paymentCancelFinancePaymentWriteOffNo(data){ ...@@ -421,26 +432,26 @@ export function paymentCancelFinancePaymentWriteOffNo(data){
// 反审核付款单 // 反审核付款单
export function paymentVerifyCancel(data) { export function paymentVerifyCancel(data) {
return request({ return request({
url: '/ecw/payment/verifyCancel', url: "/ecw/payment/verifyCancel",
method: 'post', method: "post",
data data
}) })
} }
//获取佣金应付款 //获取佣金应付款
export function payablePage(params){ export function payablePage(params) {
return request({ return request({
url:'/ecw/commission-payable/page', url: "/ecw/commission-payable/page",
method:'get', method: "get",
params params
}) })
} }
//获取佣金付款单 //获取佣金付款单
export function commissionPaymentPage(params){ export function commissionPaymentPage(params) {
return request({ return request({
url:'/ecw/commission-payment/page', url: "/ecw/commission-payment/page",
method:'get', method: "get",
params params
}) })
} }
...@@ -448,71 +459,70 @@ export function commissionPaymentPage(params){ ...@@ -448,71 +459,70 @@ export function commissionPaymentPage(params){
// 根据流程主键获取付款单流程审核信息 // 根据流程主键获取付款单流程审核信息
export function getPaymentApprove(id) { export function getPaymentApprove(id) {
return request({ return request({
url: '/ecw/payment/getPaymentApprove?id='+id, url: "/ecw/payment/getPaymentApprove?id=" + id,
method: 'GET' method: "GET"
}) })
} }
// 根据流程主键获取收款单流程审核信息 // 根据流程主键获取收款单流程审核信息
export function getReceiptApprove(id) { export function getReceiptApprove(id) {
return request({ return request({
url: '/ecw/receipt/getReceiptApprove?id='+id, url: "/ecw/receipt/getReceiptApprove?id=" + id,
method: 'GET' method: "GET"
}) })
} }
// 收款单核销 // 收款单核销
export function financeReceiptWriteOff(query) { export function financeReceiptWriteOff(query) {
return request({ return request({
url: '/ecw/receipt/financeReceiptWriteOff', url: "/ecw/receipt/financeReceiptWriteOff",
method: 'POST', method: "POST",
data: query data: query
}) })
} }
// lanbm 2024-05-29 add 批量收款单核销 // lanbm 2024-05-29 add 批量收款单核销
export function financeReceiptWriteOff2(query) { export function financeReceiptWriteOff2(query) {
return request({ return request({
url: '/ecw/receipt/financeReceiptWriteOff2', url: "/ecw/receipt/financeReceiptWriteOff2",
method: 'POST', method: "POST",
data: query data: query
}) })
} }
// 收款单银行明细核销 // 收款单银行明细核销
export function financeReceiptItemWriteOff(query) { export function financeReceiptItemWriteOff(query) {
return request({ return request({
url: '/ecw/receipt-item/financeReceiptItemWriteOff', url: "/ecw/receipt-item/financeReceiptItemWriteOff",
method: 'POST', method: "POST",
data: query data: query
}) })
} }
//批量 银行实收明细提交审核 lanbm 2024-05-30 add //批量 银行实收明细提交审核 lanbm 2024-05-30 add
export function financeReceiptItemWriteOff2(query) { export function financeReceiptItemWriteOff2(query) {
return request({ return request({
url: '/ecw/receipt-item/financeReceiptItemWriteOff2', url: "/ecw/receipt-item/financeReceiptItemWriteOff2",
method: 'POST', method: "POST",
data: query data: query
}) })
} }
// 收款单银行明细核销反审核 // 收款单银行明细核销反审核
export function financeReceiptItemWriteOffNo(query) { export function financeReceiptItemWriteOffNo(query) {
return request({ return request({
url: '/ecw/receipt-item/financeReceiptItemWriteOffNo', url: "/ecw/receipt-item/financeReceiptItemWriteOffNo",
method: 'POST', method: "POST",
data: query data: query
}) })
} }
// 收款单反审核 // 收款单反审核
export function financeApproveNo(query) { export function financeApproveNo(query) {
return request({ return request({
url: '/ecw/receipt/financeApproveNo', url: "/ecw/receipt/financeApproveNo",
method: 'POST', method: "POST",
data: query data: query
}) })
} }
...@@ -520,18 +530,18 @@ export function financeApproveNo(query) { ...@@ -520,18 +530,18 @@ export function financeApproveNo(query) {
//参数query 为List //参数query 为List
export function financeApproveNo2(query) { export function financeApproveNo2(query) {
return request({ return request({
url: '/ecw/receipt/financeApproveNo2', url: "/ecw/receipt/financeApproveNo2",
method: 'POST', method: "POST",
data: query data: query
}) })
} }
// 收款单反核销 // 收款单反核销
export function financeReceiptWriteOffNo(query) { export function financeReceiptWriteOffNo(query) {
return request({ return request({
url: '/ecw/receipt/financeReceiptWriteOffNo', url: "/ecw/receipt/financeReceiptWriteOffNo",
method: 'POST', method: "POST",
data: query data: query
}) })
} }
...@@ -539,170 +549,332 @@ export function financeReceiptWriteOffNo(query) { ...@@ -539,170 +549,332 @@ export function financeReceiptWriteOffNo(query) {
//query 为List //query 为List
export function financeReceiptWriteOffNo2(query) { export function financeReceiptWriteOffNo2(query) {
return request({ return request({
url: '/ecw/receipt/financeReceiptWriteOffNo2', url: "/ecw/receipt/financeReceiptWriteOffNo2",
method: 'POST', method: "POST",
data: query data: query
}) })
} }
//收款单取消审核 //收款单取消审核
export function cancelFinanceReceiptApproval(query) { export function cancelFinanceReceiptApproval(query) {
return request({ return request({
url: '/ecw/receipt/cancelFinanceReceiptApproval', url: "/ecw/receipt/cancelFinanceReceiptApproval",
method: 'POST', method: "POST",
data: query data: query
}) })
} }
// 取消收款单反审核 // 取消收款单反审核
export function cancelFinanceReceiptApprovalNo(query) { export function cancelFinanceReceiptApprovalNo(query) {
return request({ return request({
url: '/ecw/receipt/cancelFinanceReceiptApprovalNo', url: "/ecw/receipt/cancelFinanceReceiptApprovalNo",
method: 'POST', method: "POST",
data: query data: query
}) })
} }
// 取消收款单全部核销审核 // 取消收款单全部核销审核
export function cancelFinanceReceiptWriteOff(query) { export function cancelFinanceReceiptWriteOff(query) {
return request({ return request({
url: '/ecw/receipt/cancelFinanceReceiptWriteOff', url: "/ecw/receipt/cancelFinanceReceiptWriteOff",
method: 'POST', method: "POST",
data: query data: query
}) })
} }
// 取消收款单反核销 // 取消收款单反核销
export function cancelFinanceReceiptWriteOffNo(query) { export function cancelFinanceReceiptWriteOffNo(query) {
return request({ return request({
url: '/ecw/receipt/cancelFinanceReceiptWriteOffNo', url: "/ecw/receipt/cancelFinanceReceiptWriteOffNo",
method: 'POST', method: "POST",
data: query data: query
}) })
} }
// 取消收款明细核销 // 取消收款明细核销
export function cancelFinanceReceiptItemWriteOff(query) { export function cancelFinanceReceiptItemWriteOff(query) {
return request({ return request({
url: '/ecw/receipt-item/cancelFinanceReceiptItemWriteOff', url: "/ecw/receipt-item/cancelFinanceReceiptItemWriteOff",
method: 'POST', method: "POST",
data: query data: query
}) })
} }
// 取消收款明细反核销 // 取消收款明细反核销
export function cancelFinanceReceiptItemWriteOffNo(query) { export function cancelFinanceReceiptItemWriteOffNo(query) {
return request({ return request({
url: '/ecw/receipt-item/cancelFinanceReceiptItemWriteOffNo', url: "/ecw/receipt-item/cancelFinanceReceiptItemWriteOffNo",
method: 'POST', method: "POST",
data: query data: query
}) })
} }
// 取消审核 // 取消审核
export function cancelFinancePaymentApproval(data){ export function cancelFinancePaymentApproval(data) {
return request({ return request({
url:'/ecw/payment/cancelFinancePaymentApproval', url: "/ecw/payment/cancelFinancePaymentApproval",
method:'post', method: "post",
data data
}) })
} }
// 取消付款单反审核 // 取消付款单反审核
export function cancelFinancePaymentApprovalNo(data){ export function cancelFinancePaymentApprovalNo(data) {
return request({ return request({
url:'/ecw/payment/cancelFinancePaymentApprovalNo', url: "/ecw/payment/cancelFinancePaymentApprovalNo",
method:'post', method: "post",
data data
}) })
} }
// 取消付款单核销 // 取消付款单核销
export function cancelFinancePaymentWriteOff(data){ export function cancelFinancePaymentWriteOff(data) {
return request({ return request({
url:'/ecw/payment/cancelFinancePaymentWriteOff', url: "/ecw/payment/cancelFinancePaymentWriteOff",
method:'post', method: "post",
data data
}) })
} }
// 取消付款单反核销 // 取消付款单反核销
export function cancelFinancePaymentWriteOffNo(data){ export function cancelFinancePaymentWriteOffNo(data) {
return request({ return request({
url:'/ecw/payment/cancelFinancePaymentWriteOffNo', url: "/ecw/payment/cancelFinancePaymentWriteOffNo",
method:'post', method: "post",
data data
}) })
} }
//删除佣金付款单 //删除佣金付款单
export function commissionPaymentDelete(params){ export function commissionPaymentDelete(params) {
return request({ return request({
url:'/ecw/commission-payment/delete', url: "/ecw/commission-payment/delete",
method:'delete', method: "delete",
params params
}) })
} }
//反审核佣金付款单 //反审核佣金付款单
export function commissionPaymentVerifyCancel(data){ export function commissionPaymentVerifyCancel(data) {
return request({ return request({
url:'/ecw/commission-payment/verifyCancel', url: "/ecw/commission-payment/verifyCancel",
method:'post', method: "post",
data data
}) })
} }
// 佣金付款单核销 // 佣金付款单核销
export function commissionPaymentVerification(data){ export function commissionPaymentVerification(data) {
return request({ return request({
url:'/ecw/commission-payment/verification', url: "/ecw/commission-payment/verification",
method:'post', method: "post",
data data
}) })
} }
//付款单反核销申请 //付款单反核销申请
export function commissionPaymentVerificationCancel(data){ export function commissionPaymentVerificationCancel(data) {
return request({ return request({
url:'/ecw/commission-payment/verificationCancel', url: "/ecw/commission-payment/verificationCancel",
method:'post', method: "post",
data data
}) })
} }
// 取消付款单反审核 // 取消付款单反审核
export function commissionPaymentCancelFinancePaymentApprovalNo(data){ export function commissionPaymentCancelFinancePaymentApprovalNo(data) {
return request({ return request({
url:'/ecw/commission-payment/cancelFinancePaymentApprovalNo', url: "/ecw/commission-payment/cancelFinancePaymentApprovalNo",
method:'post', method: "post",
data data
}) })
} }
// 取消付款单核销 // 取消付款单核销
export function commissionPaymentCancelFinancePaymentWriteOff(data){ export function commissionPaymentCancelFinancePaymentWriteOff(data) {
return request({ return request({
url:'/ecw/commission-payment/cancelFinancePaymentWriteOff', url: "/ecw/commission-payment/cancelFinancePaymentWriteOff",
method:'post', method: "post",
data data
}) })
} }
// 取消付款单反核销 // 取消付款单反核销
export function commissionPaymentCancelFinancePaymentWriteOffNo(data){ export function commissionPaymentCancelFinancePaymentWriteOffNo(data) {
return request({ return request({
url:'/ecw/commission-payment/cancelFinancePaymentWriteOffNo', url: "/ecw/commission-payment/cancelFinancePaymentWriteOffNo",
method:'post', method: "post",
data, data
}) })
} }
//取消付款单审核 //取消付款单审核
export function commissionPaymentCancelFinancePaymentApproval(data){ export function commissionPaymentCancelFinancePaymentApproval(data) {
return request({ return request({
url:'/ecw/commission-payment/cancelFinancePaymentApproval', url: "/ecw/commission-payment/cancelFinancePaymentApproval",
method:'post', method: "post",
data data
}) })
} }
//根据流程主键获取付款单流程审核信息 //根据流程主键获取付款单流程审核信息
export function commissionPaymentGetPaymentApprove(params){ export function commissionPaymentGetPaymentApprove(params) {
return request({
url: "/ecw/commission-payment/getPaymentApprove",
method: "get",
params
})
}
//获取银行收款明细对应核销比例
export function loadbankWriteOffRange(params) {
return request({
url: "/ecw/receipt/bank-writeoff-range",
method: "get"
})
}
//修改银行收款明细对应核销比例
export function updatebankWriteOffRange(data) {
return request({
url: "/ecw/receipt/bank-writeoff-range",
method: "post",
data
})
}
//查询费用明细列表
export function loadCostDetail(data) {
let params = {
page: data.page,
rows: data.rows
}
return request({
url: "/ecw/receivable/page/costDetail",
method: "post",
data,
params
})
}
//通过收款单ID获得收款单开票信息
export function loadReceiptInvoiceInfo(params) {
return request({ return request({
url:'/ecw/commission-payment/getPaymentApprove', url: "/ecw/receipt-invoice/receipt/info/get",
method:'get', method: "get",
params params
}) })
} }
//通过开票ID获得收款单开票信息
export function loadINVInfoByInvoiceId(params) {
return request({
url: "/ecw/receipt-invoice/get",
method: "get",
params
})
}
//创建开票申请
export function createInvoiceApplication(data) {
return request({
url: "/ecw/receipt-invoice/create",
method: "post",
data
})
}
// 取消开票
export function cancelInvoiceApplication(data) {
return request({
url: "/ecw/receipt-invoice/cancel",
method: "post",
data
})
}
// 删除开票
export function delInvoiceApplication(data) {
return request({
url: "/ecw/receipt-invoice/delete",
method: "post",
data
})
}
//编辑收款单开票资料
export function updateInvoiceApplication(data) {
return request({
url: "/ecw/receipt-invoice/update/data",
method: "post",
data
})
}
//编辑收款单开票信息
export function updateInvoiceApplicationInfo(data) {
return request({
url: "/ecw/receipt-invoice/update/info",
method: "post",
data
})
}
// 驳回开票信息
export function rejectInvoiceApplication(data) {
return request({
url: "/ecw/receipt-invoice/reject",
method: "post",
data
})
}
//收款单开票信息分页
export function loadInvApplicationList(data) {
let params = {
page: data.page,
rows: data.rows
}
return request({
url: "/ecw/receipt-invoice/page",
method: "post",
data,
params
})
}
//获得收款数据审批列表
//
export function loadReceiptReviewList(data) {
let params = {
page: data.page,
rows: data.rows
}
return request({
url: "/ecw/receipt-item/review/page",
method: "post",
data,
params
})
}
//创建收款明细获取应收明细
export function loadBankReceiptItemList(params) {
return request({
url: "/ecw/receivable/getListForReceiptItem",
method: "get",
params
})
}
//通过单个银行收款ID获取应收明细
export function loadBankReceiptItemListByID(params) {
return request({
url: "/ecw/receivable/getReceivableByReceiptItem",
method: "get",
params
})
}
// 导出收款单模板
export function handleDownloadReceiptTmp() {
return request({
url: "/ecw/receipt-item/import/template",
method: "get",
responseType: "blob"
})
}
// 导入收款单
export function handleImportReceipt(data) {
return request({
url: "/admin-api/ecw/receipt-item/import",
method: "post",
data
})
}
<template> <template>
<el-select :clearable="clearable" v-model="valueSync" :multiple="multiple" :disabled="disabled" :filterable="filterable" :placeholder="$t('请选择')"> <el-select :clearable="clearable" v-model="valueSync" :multiple="multiple" :disabled="disabled" :filterable="filterable" :placeholder="$t('请选择')" @change="(val) => $emit('change', val)">
<el-option v-for="item in optionsFormated" :key="item.key" :label="item.label" :value="item.value" /> <el-option v-for="item in optionsFormated" :key="item.key" :label="item.label" :value="item.value" />
</el-select> </el-select>
</template> </template>
<script> <script>
export default { export default {
data(){ data() {
return { return {
valueSync: undefined valueSync: undefined
} }
},
props: {
options: Array,
value: [String, Number, Array, Boolean, Object],
labelField: {
type: [String, Function],
default: "label"
},
valueField: {
type: String,
default: "value"
}, },
props:{ keyField: {
options: Array, type: String,
value: [String, Number, Array, Boolean, Object], default: "value"
labelField: {
type: [String, Function],
default: 'label'
},
valueField: {
type: String,
default: 'value'
},
keyField:{
type: String,
default: 'value'
},
filterable: Boolean,
multiple: Boolean,
clearable: Boolean,
defaultable: Boolean, // 没有值的时候是否选择第一项
disabled: Boolean,
test: String
}, },
computed:{ filterable: Boolean,
optionsFormated(){ multiple: Boolean,
let arr = [] clearable: Boolean,
this.options.forEach((item, index) => { defaultable: Boolean, // 没有值的时候是否选择第一项
arr.push({ disabled: Boolean,
label: typeof this.labelField == 'string' ? item[this.labelField] : (this.labelField)(item, index), test: String
value: item[this.valueField], },
key: item[this.keyField] computed: {
}) optionsFormated() {
}) let arr = []
return arr this.options.forEach((item, index) => {
} arr.push({
label: typeof this.labelField == "string" ? item[this.labelField] : this.labelField(item, index),
value: item[this.valueField],
key: item[this.keyField]
})
})
return arr
}
},
watch: {
valueSync(val) {
console.log("valueSync变化", val, this.value)
this.$emit("input", val)
}, },
watch:{ value(value) {
valueSync(val){ console.log("value传值变化", value, this.valueSync)
console.log('valueSync变化', val, this.value) if (value !== undefined) this.valueSync = value
this.$emit('input', val)
},
value(value){
console.log('value传值变化', value, this.valueSync)
if(value !== undefined)this.valueSync = value
},
optionsFormated(){
this.setDefault()
},
test(val, old){
console.warn('test变化', val, old)
}
}, },
created(){ optionsFormated() {
if(this.test == 'allPriceUnit'){ this.setDefault()
console.log('allPriceUnit selector', this.value, this.defaultable)
}
this.valueSync = this.value
this.setDefault()
}, },
methods:{ test(val, old) {
setDefault(){ console.warn("test变化", val, old)
if(!this.defaultable){ }
return false },
} created() {
if(this.optionsFormated.length && (this.valueSync == null || this.valueSync == '')){ if (this.test == "allPriceUnit") {
this.valueSync = this.optionsFormated[0].value console.log("allPriceUnit selector", this.value, this.defaultable)
} }
} this.valueSync = this.value
this.setDefault()
},
methods: {
setDefault() {
if (!this.defaultable) {
return false
}
if (this.optionsFormated.length && (this.valueSync == null || this.valueSync == "")) {
this.valueSync = this.optionsFormated[0].value
}
} }
}
} }
</script> </script>
...@@ -740,6 +740,7 @@ ...@@ -740,6 +740,7 @@
"请输入邮箱": "please input your email", "请输入邮箱": "please input your email",
"设为默认": "set as Default", "设为默认": "set as Default",
"请输入发票抬头": "Please enter the title of the invoice", "请输入发票抬头": "Please enter the title of the invoice",
"请输入开票品名": "Please enter the invoice name",
"纳税人识别号": "Taxpayer Identification Number", "纳税人识别号": "Taxpayer Identification Number",
"请输入纳税人识别号": "Please enter the taxpayer identification number", "请输入纳税人识别号": "Please enter the taxpayer identification number",
"开户行": "Opening Bank", "开户行": "Opening Bank",
...@@ -4723,5 +4724,102 @@ ...@@ -4723,5 +4724,102 @@
"请输入免泡重量": "请输入免泡重量", "请输入免泡重量": "请输入免泡重量",
"出货撤回": "出货撤回", "出货撤回": "出货撤回",
"启用时间": "Enable Time", "启用时间": "Enable Time",
"等级": "Level" "等级": "Level",
"此操作将修改自动核销比例?": "Will this action modify the automatic write-off ratio?",
"请输入核销比例下界": "Please enter the lower bound of the write-off ratio",
"请输入核销比例上界": "Please enter the upper bound of the write-off ratio",
"银行收款明细对应核销比例设置": "Bank collection details corresponding to the write-off ratio setting",
"单位(%)": "Unit (%)",
"核销比例数值错误": "Error in the value of the write-off ratio",
"未核销金额合计": "Total amount not written off",
"核销金额合计": "Total amount of write-off ",
"金额合计": "Total amount ",
"实际金额": "Actual amount ",
"核销金额": "Write-off amount ",
"未核销金额": "Unwritten amount ",
"箱数/体积/重量": "Carton number/Volume/Weight ",
"关联收款单": "Associated receipt ",
"关联银行收款明细": "Related bank Collection Details ",
"最后修改信息": "Last modified information ",
"最后审批信息": "Final Approval Information",
"已核销本币金额": "Amount written off in local currency",
"未核销本币金额": "Amount not written off in local currency",
"基准币种({currency})汇率": "Base currency ({currency}) exchange rate",
"基准金额({currency})": "Base Amount ({currency})",
"已核销金额({currency})": "Written off Amount ({currency})",
"未核销金额({currency})": "Unwritten amount ({currency})",
"开票编号": "Invoice Number",
"开票状态": "Invoice Status",
"开票资料状态": "Billing Data Status ",
"开票申请信息": "Invoice Application Information",
"应收总{currency}": "Total receivable {currency}",
"已收总{currency}": "Total {currency} received",
"总核销比例({currency})": "Total write-off ratio ({currency})",
"开票资料备注": "Remarks on Billing Information",
"开票品名": "Name of invoicing item",
"开票取消人": "Bill canceller",
"开票取消时间": "Billing and Cancellation time",
"驳回备注": "Remarks on rejection",
"账单信息": "Bill information",
"订单号/提单号": "Order number/Bill of lading number",
"结算币种金额": "Amount of settlement currency",
"收款状态/核销比例": "Collection status/write-off ratio",
"收款编号": "Payment collection number",
"申请人/部门": "Applicant/Department",
"开票抬头": "invoice title",
"开票金额": "invoice amount",
"订单/提单": "Order/bill of lading",
"请输入开票编号": "Please enter the billing number",
"请输入收款编号": "Please enter the collection number",
"驳回资料": "Rejected Information ",
"取消开票": "Cancel billing ",
"提交开票": "Submit invoicing",
"修改开票申请": "Application for Amendment of Billing",
"驳回信息": "Rejection of information",
"确认驳回资料": "Confirm rejection of information",
"取消信息": "Cancel Information",
"取消备注": "Cancellation Remarks",
"确认取消开票": "Confirm cancellation",
"开票信息备注": "Billing Information Remarks",
"开票时间": "Billing Time",
"驳回": "Rejected",
"确认删除开票信息吗?": "Confirm to delete billing information?",
"确认驳回开票资料吗?": "Confirm the rejection of billing information?",
"确认取消开票资料吗?": "Confirm the cancellation information?",
"确认创建开票资料吗?": "Confirm the creation of billing information?",
"确认修改开票申请": "Confirm the application for modification of billing",
"确认更新开票资料吗?": "Confirm to update billing information?",
"请输入发票号码": "Please enter the invoice number",
"请选择开票类型": "Please select billing type",
"请输入开票人": "Please enter the ticket drawer",
"请输入开票金额": "Please enter the invoice amount",
"明细状态": "State of detail",
"删除开票备注": "Delete billing remarks",
"申请开票": "Apply for billing",
"导入银行收款信息": "Import bank collection information",
"环节": "link",
"生成路径": "Generating a path",
"合计金额": "Total amount",
"请注意:汇率已失效": "Please note: The exchange rate has expired",
"审核通过时间": "Approval time",
"基准金额": "Base amount",
"基准币种": "Base currency",
"流水号": "serial number",
"实际金额=含税金额-优惠金额": "Actual amount = tax-inclusive amount - preferential amount",
"核销误差兑额外费用主币种金额": "Write off the error against the amount of additional charge in main currency",
"本次实收基准金额小于上次填写核销金额总额,请注意": "Please note that the actual benchmark amount is less than the total amount of write-off filled in last time",
"填写核销金额总额大于本次实收基准金额,请重新填写": "The total amount of write-off is greater than the benchmark amount received this time, please fill in again",
"未填写核销金额>0 ,请检查": "Unfilled write-off amount >0, please check",
"本次填写核销金额总数大于实收基准金额": "The total amount of write-off filled in this time is greater than the benchmark amount actually received",
"请输入明细核销金额": "Please enter the detailed write-off amount",
"自动填写": "Fill in automatically",
"本次核销金额({currency})": "Amount of this write-off ({currency})",
"剩余核销金额({currency})": "Remaining write-off amount ({currency})",
"未填写核销金额": "The amount of write-off is not filled in",
"已填写核销金额": "The amount of verification has been filled in",
"基准金额{currency}": "Base amount {currency}",
"批量提交审核": "Batch submission for review",
"导入提示信息,请确认是否提交": "Import prompt information, please confirm whether to submit",
"银行收款信息模板": "Template of bank collection information",
"仅允许导入xls、xlsx格式文件。": "Only xls and xlsx format files are allowed to be imported."
} }
import Vue from 'vue' import Vue from "vue"
import Cookies from 'js-cookie' import Cookies from "js-cookie"
import Element from 'element-ui' import Element from "element-ui"
import './assets/styles/element-variables.scss' import "./assets/styles/element-variables.scss"
import '@/assets/styles/index.scss' // global css import "@/assets/styles/index.scss" // global css
import '@/assets/styles/ruoyi.scss' // ruoyi css import "@/assets/styles/ruoyi.scss" // ruoyi css
import App from './App' import App from "./App"
import store from './store' import store from "./store"
import router from './router' import router from "./router"
import directive from './directive' // directive import directive from "./directive" // directive
import plugins from './plugins' // plugins import plugins from "./plugins" // plugins
import Print from 'vue-print-nb' import Print from "vue-print-nb"
import './assets/icons' // icon import "./assets/icons" // icon
import './permission' // permission control import "./permission" // permission control
import './tongji' // 百度统计 import "./tongji" // 百度统计
import { getDicts } from "@/api/system/dict/data"; import { getDicts } from "@/api/system/dict/data"
import { getConfigKey } from "@/api/infra/config"; import { getConfigKey } from "@/api/infra/config"
import { parseTime, resetForm, addDateRange, addBeginAndEndTime, addBeginAndEndTimeNew, handleTree} from "@/utils/ruoyi"; import { parseTime, resetForm, addDateRange, addBeginAndEndTime, addBeginAndEndTimeNew, handleTree } from "@/utils/ruoyi"
import Pagination from "@/components/Pagination"; import { removeEmpty } from "@/utils/index"
import Pagination from "@/components/Pagination"
// 自定义表格工具扩展 // 自定义表格工具扩展
import RightToolbar from "@/components/RightToolbar" import RightToolbar from "@/components/RightToolbar"
import DictSelector from '@/components/DictSelector' import DictSelector from "@/components/DictSelector"
// 代码高亮插件 // 代码高亮插件
// import hljs from 'highlight.js' // import hljs from 'highlight.js'
// import 'highlight.js/styles/github-gist.css' // import 'highlight.js/styles/github-gist.css'
import {DICT_TYPE, getDictDataLabel, getDictDatas, getDictDatas2} from "@/utils/dict"; import { DICT_TYPE, getDictDataLabel, getDictDatas, getDictDatas2 } from "@/utils/dict"
import i18n from './i18n' import i18n from "./i18n"
// 全局方法挂载 // 全局方法挂载
Vue.prototype.getDicts = getDicts Vue.prototype.getDicts = getDicts
...@@ -39,40 +40,40 @@ Vue.prototype.getDictDatas2 = getDictDatas2 ...@@ -39,40 +40,40 @@ Vue.prototype.getDictDatas2 = getDictDatas2
Vue.prototype.getDictDataLabel = getDictDataLabel Vue.prototype.getDictDataLabel = getDictDataLabel
Vue.prototype.DICT_TYPE = DICT_TYPE Vue.prototype.DICT_TYPE = DICT_TYPE
Vue.prototype.handleTree = handleTree Vue.prototype.handleTree = handleTree
Vue.prototype.removeEmpty = removeEmpty
Date.prototype.format = function(format) { Date.prototype.format = function (format) {
var date = { var date = {
"M+": this.getMonth() + 1, "M+": this.getMonth() + 1,
"d+": this.getDate(), "d+": this.getDate(),
"h+": this.getHours(), "h+": this.getHours(),
"m+": this.getMinutes(), "m+": this.getMinutes(),
"s+": this.getSeconds(), "s+": this.getSeconds(),
"q+": Math.floor((this.getMonth() + 3) / 3), "q+": Math.floor((this.getMonth() + 3) / 3),
"S+": this.getMilliseconds() "S+": this.getMilliseconds()
}; }
if (/(y+)/i.test(format)) { if (/(y+)/i.test(format)) {
format = format.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length)); format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length))
} }
for (var k in date) { for (var k in date) {
if (new RegExp("(" + k + ")").test(format)) { if (new RegExp("(" + k + ")").test(format)) {
format = format.replace(RegExp.$1, RegExp.$1.length == 1 format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? date[k] : ("00" + date[k]).substr(("" + date[k]).length))
? date[k] : ("00" + date[k]).substr(("" + date[k]).length)); }
}
} }
return format; return format
} }
// 全局组件挂载 // 全局组件挂载
Vue.component('DictTag', DictTag) Vue.component("DictTag", DictTag)
Vue.component('DocAlert', DocAlert) Vue.component("DocAlert", DocAlert)
Vue.component('Pagination', Pagination) Vue.component("Pagination", Pagination)
Vue.component('RightToolbar', RightToolbar) Vue.component("RightToolbar", RightToolbar)
Vue.component('DictSelector', DictSelector) Vue.component("DictSelector", DictSelector)
// 字典标签组件 // 字典标签组件
import DictTag from '@/components/DictTag' import DictTag from "@/components/DictTag"
import DocAlert from '@/components/DocAlert' import DocAlert from "@/components/DocAlert"
// 头部标签插件 // 头部标签插件
import VueMeta from 'vue-meta' import VueMeta from "vue-meta"
Vue.use(directive) Vue.use(directive)
Vue.use(plugins) Vue.use(plugins)
...@@ -81,22 +82,22 @@ Vue.use(Print) ...@@ -81,22 +82,22 @@ Vue.use(Print)
// Vue.use(hljs.vuePlugin); // Vue.use(hljs.vuePlugin);
// bpmnProcessDesigner 需要引入 // bpmnProcessDesigner 需要引入
import MyPD from "@/components/bpmnProcessDesigner/package/index.js"; import MyPD from "@/components/bpmnProcessDesigner/package/index.js"
Vue.use(MyPD); Vue.use(MyPD)
import "@/components/bpmnProcessDesigner/package/theme/index.scss"; import "@/components/bpmnProcessDesigner/package/theme/index.scss"
import "bpmn-js/dist/assets/diagram-js.css"; import "bpmn-js/dist/assets/diagram-js.css"
import "bpmn-js/dist/assets/bpmn-font/css/bpmn.css"; import "bpmn-js/dist/assets/bpmn-font/css/bpmn.css"
import "bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css"; import "bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css"
import "bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css"; import "bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css"
// Form Generator 组件需要使用到 tinymce // Form Generator 组件需要使用到 tinymce
import Tinymce from '@/components/tinymce/index.vue' import Tinymce from "@/components/tinymce/index.vue"
Vue.component('tinymce', Tinymce) Vue.component("tinymce", Tinymce)
import '@/icons' import "@/icons"
import axios from 'axios' import axios from "axios"
Vue.prototype.$axios = axios Vue.prototype.$axios = axios
import '@/styles/index.scss' import "@/styles/index.scss"
import '@/styles/custom.scss' import "@/styles/custom.scss"
/** /**
* If you don't want to use mock-server * If you don't want to use mock-server
...@@ -108,40 +109,46 @@ import '@/styles/custom.scss' ...@@ -108,40 +109,46 @@ import '@/styles/custom.scss'
*/ */
Vue.use(Element, { Vue.use(Element, {
size: Cookies.get('size') || 'medium', // set element-ui default size size: Cookies.get("size") || "medium", // set element-ui default size
i18n: (key, value) => i18n.t(key, value) i18n: (key, value) => i18n.t(key, value)
}) })
// 重定向路由(关闭当前标签) // 重定向路由(关闭当前标签)
Vue.prototype.$redirect = (path) =>{ Vue.prototype.$redirect = (path) => {
let currentView = router.history.current let currentView = router.history.current
router.replace(path) router.replace(path)
store.dispatch("tagsView/delView", currentView) store.dispatch("tagsView/delView", currentView)
} }
window.ElementUI = Element window.ElementUI = Element
// 显示表单错误信息 // 显示表单错误信息
Vue.prototype.$showFormValidateErrors = (errors) => { Vue.prototype.$showFormValidateErrors = (errors) => {
let vm = new Vue() let vm = new Vue()
let createElement = vm.$createElement let createElement = vm.$createElement
let fieldList = Object.values(errors) let fieldList = Object.values(errors)
Element.Notification({ Element.Notification({
title: i18n.$t('表单错误'), title: i18n.$t("表单错误"),
type: 'warning', type: "warning",
duration: 3000, duration: 3000,
message: createElement('div', fieldList.map(function (errorList) { message: createElement(
return createElement('div', errorList.map((item) => { "div",
return createElement('div', item.message) fieldList.map(function (errorList) {
})) return createElement(
})) "div",
}) errorList.map((item) => {
return createElement("div", item.message)
})
)
})
)
})
} }
Vue.config.productionTip = false Vue.config.productionTip = false
new Vue({ new Vue({
el: '#app', el: "#app",
router, router,
store, store,
i18n, i18n,
render: h => h(App) render: (h) => h(App)
}) })
import router from "./router"; import router from "./router"
import store from "./store"; import store from "./store"
import { Message } from "element-ui"; import { Message } from "element-ui"
import NProgress from "nprogress"; import NProgress from "nprogress"
import "nprogress/nprogress.css"; import "nprogress/nprogress.css"
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth"
import { isRelogin } from "@/utils/request"; import { isRelogin } from "@/utils/request"
NProgress.configure({ showSpinner: false }); NProgress.configure({ showSpinner: false })
// 增加三方登陆 update by 芋艿 // 增加三方登陆 update by 芋艿
const whiteList = [ const whiteList = ["/login", "/social-login", "/auth-redirect", "/bind", "/register", "/oauthLogin/gitee"]
"/login",
"/social-login",
"/auth-redirect",
"/bind",
"/register",
"/oauthLogin/gitee",
];
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
NProgress.start(); NProgress.start()
if (to.matched && to.matched.length > 2) { if (to.matched && to.matched.length > 2) {
to.matched.splice(1, to.matched.length - 2); to.matched.splice(1, to.matched.length - 2)
} }
if (getToken()) { if (getToken()) {
to.meta.title && store.dispatch("settings/setTitle", to.meta.title); to.meta.title && store.dispatch("settings/setTitle", to.meta.title)
/* has token*/ /* has token*/
if (to.path === "/login") { if (to.path === "/login") {
next({ path: "/" }); next({ path: "/" })
NProgress.done(); NProgress.done()
} else { } else {
if (store.getters.roles.length === 0) { if (store.getters.roles.length === 0) {
isRelogin.show = true; isRelogin.show = true
// 获取字典数据 add by 芋艿 // 获取字典数据 add by 芋艿
store.dispatch("dict/loadDictDatas"); store.dispatch("dict/loadDictDatas")
//获取货币
store.dispatch("staticData/loadCurrencyList")
// 判断当前用户是否已拉取完user_info信息 // 判断当前用户是否已拉取完user_info信息
store store
.dispatch("GetInfo") .dispatch("GetInfo")
.then(() => { .then(() => {
isRelogin.show = false; isRelogin.show = false
store.dispatch("GenerateRoutes").then((accessRoutes) => { store.dispatch("GenerateRoutes").then((accessRoutes) => {
// 根据roles权限生成可访问的路由表 // 根据roles权限生成可访问的路由表
router.addRoutes(accessRoutes); // 动态添加可访问路由表 router.addRoutes(accessRoutes) // 动态添加可访问路由表
next({ ...to, replace: true }); // hack方法 确保addRoutes已完成 next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
}); })
}) })
.catch((err) => { .catch((err) => {
store.dispatch("LogOut").then(() => { store.dispatch("LogOut").then(() => {
Message.error(err); Message.error(err)
next({ path: "/" }); next({ path: "/" })
}); })
}); })
} else { } else {
next(); next()
} }
} }
} else { } else {
// 没有token // 没有token
if (whiteList.indexOf(to.path) !== -1) { if (whiteList.indexOf(to.path) !== -1) {
// 在免登录白名单,直接进入 // 在免登录白名单,直接进入
next(); next()
} else { } else {
next(`/login?redirect=${to.fullPath}`); // 否则全部重定向到登录页 next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
NProgress.done(); NProgress.done()
} }
} }
}); })
router.afterEach(() => { router.afterEach(() => {
NProgress.done(); NProgress.done()
}); })
import { getCurrency } from "@/api/ecw/currency"
const getters = { const getters = {
sidebar: state => state.app.sidebar, sidebar: (state) => state.app.sidebar,
size: state => state.app.size, size: (state) => state.app.size,
device: state => state.app.device, device: (state) => state.app.device,
visitedViews: state => state.tagsView.visitedViews, visitedViews: (state) => state.tagsView.visitedViews,
cachedViews: state => state.tagsView.cachedViews, cachedViews: (state) => state.tagsView.cachedViews,
userId: state => state.user.id, userId: (state) => state.user.id,
token: state => state.user.token, token: (state) => state.user.token,
avatar: state => state.user.avatar, avatar: (state) => state.user.avatar,
name: state => state.user.name, name: (state) => state.user.name,
introduction: state => state.user.introduction, introduction: (state) => state.user.introduction,
roles: state => state.user.roles, roles: (state) => state.user.roles,
permissions: state => state.user.permissions, permissions: (state) => state.user.permissions,
permission_routes: state => state.permission.routes, permission_routes: (state) => state.permission.routes,
// 工具栏 // 工具栏
topbarRouters:state => state.permission.topbarRouters, topbarRouters: (state) => state.permission.topbarRouters,
defaultRoutes:state => state.permission.defaultRoutes, defaultRoutes: (state) => state.permission.defaultRoutes,
sidebarRouters:state => state.permission.sidebarRouters, sidebarRouters: (state) => state.permission.sidebarRouters,
// 数据字典 // 数据字典
dict_datas: state => state.dict.dictDatas, dict_datas: (state) => state.dict.dictDatas,
// 角标数据 // 角标数据
badgeData: state => state.user.badgeData badgeData: (state) => state.user.badgeData,
//获取货币
getCurrencySymbol: (state) => (id) => {
const label = state.staticData.currencyList.find((currencyItem) => currencyItem.id === id)
return label ? label.fuhao : ""
},
getCurrencyData: (state) => (id) => {
const label = state.staticData.currencyList.find((currencyItem) => currencyItem.id === id)
return label ? label : {}
}
} }
export default getters export default getters
import Vue from 'vue' import Vue from "vue"
import Vuex from 'vuex' import Vuex from "vuex"
import app from './modules/app' import app from "./modules/app"
import user from './modules/user' import user from "./modules/user"
import tagsView from './modules/tagsView' import tagsView from "./modules/tagsView"
import permission from './modules/permission' import permission from "./modules/permission"
import settings from './modules/settings' import settings from "./modules/settings"
import dict from './modules/dict' import dict from "./modules/dict"
import getters from './getters' import getters from "./getters"
import staticData from "./modules/staticData"
Vue.use(Vuex) Vue.use(Vuex)
...@@ -18,6 +19,7 @@ const store = new Vuex.Store({ ...@@ -18,6 +19,7 @@ const store = new Vuex.Store({
permission, permission,
settings, settings,
dict, dict,
staticData
}, },
getters getters
}) })
......
import { getCurrencyList } from "@/api/ecw/currency" //币种列表
const state = {
currencyList: []
}
const mutations = {
SET_CURRENCY_LIST: (state, currencyList) => {
state.currencyList = currencyList
}
}
const actions = {
async loadCurrencyList({ commit }) {
const response = await getCurrencyList()
if (!response || !response.data) {
return
}
commit("SET_CURRENCY_LIST", response.data)
}
}
export default {
namespaced: true,
state,
mutations,
actions
}
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* *
* 数据字典工具类 * 数据字典工具类
*/ */
import store from "@/store"; import store from "@/store"
import i18n from "@/i18n"; import i18n from "@/i18n"
export const DICT_TYPE = { export const DICT_TYPE = {
USER_TYPE: "user_type", USER_TYPE: "user_type",
...@@ -27,9 +27,9 @@ export const DICT_TYPE = { ...@@ -27,9 +27,9 @@ export const DICT_TYPE = {
SYSTEM_SMS_TEMPLATE_TYPE: "system_sms_template_type", SYSTEM_SMS_TEMPLATE_TYPE: "system_sms_template_type",
SYSTEM_SMS_SEND_STATUS: "system_sms_send_status", SYSTEM_SMS_SEND_STATUS: "system_sms_send_status",
SYSTEM_SMS_RECEIVE_STATUS: "system_sms_receive_status", SYSTEM_SMS_RECEIVE_STATUS: "system_sms_receive_status",
SYSTEM_SMS_NODE_NODE: 'system_sms_node_node',//节点 SYSTEM_SMS_NODE_NODE: "system_sms_node_node", //节点
SYSTEM_SMS_TEMPLATE_MESSAGE_TYPE: 'system_sms_template_message_type',//发送类型 SYSTEM_SMS_TEMPLATE_MESSAGE_TYPE: "system_sms_template_message_type", //发送类型
SYSTEM_SMS_TEMPLATE_LANGUAGE: 'system_sms_template_language',//节点 SYSTEM_SMS_TEMPLATE_LANGUAGE: "system_sms_template_language", //节点
SYSTEM_MAIL_SEND_STATUS: "mail_send_status", SYSTEM_MAIL_SEND_STATUS: "mail_send_status",
SYSTEM_ERROR_CODE_TYPE: "system_error_code_type", SYSTEM_ERROR_CODE_TYPE: "system_error_code_type",
INTERNAL_MESSAGE_TYPE: "internal_message_type", INTERNAL_MESSAGE_TYPE: "internal_message_type",
...@@ -158,25 +158,25 @@ export const DICT_TYPE = { ...@@ -158,25 +158,25 @@ export const DICT_TYPE = {
ECW_PORT_TYPE: "port_type", //港口类型 ECW_PORT_TYPE: "port_type", //港口类型
CERTIFICATE_TYPE: "certificate_type", //证件类型 CERTIFICATE_TYPE: "certificate_type", //证件类型
//customer //customer
CUSTOMER_CREDIT_RULE_TYPE: 'customer_credit_rule_type', CUSTOMER_CREDIT_RULE_TYPE: "customer_credit_rule_type",
CUSTOMER_LEVEL_RULE_TYPE: 'customer_level_rule_type', CUSTOMER_LEVEL_RULE_TYPE: "customer_level_rule_type",
CUSTOMER_ESOURCE_TYPE:'customer_resource_type',//客户资源类型 CUSTOMER_ESOURCE_TYPE: "customer_resource_type", //客户资源类型
CUSTOMER_OPERATE_TYPE:'customer_operate_type', CUSTOMER_OPERATE_TYPE: "customer_operate_type",
CUSTOMER_GET_METHOD: 'customer_get_method', //获取方式 CUSTOMER_GET_METHOD: "customer_get_method", //获取方式
CUSTOMER_FROM: 'customer_from', //创建入口 CUSTOMER_FROM: "customer_from", //创建入口
CUSTOMER_ROLE: 'customer_role', //角色 CUSTOMER_ROLE: "customer_role", //角色
PICKUP_POINTS: 'pickup_points', //常用提货网点 PICKUP_POINTS: "pickup_points", //常用提货网点
CUSTOMER_FOLLOWUP_TYPE: 'customer_followup_type', //跟进类型 CUSTOMER_FOLLOWUP_TYPE: "customer_followup_type", //跟进类型
CUSTOMER_FOLLOWUP_METHOD: 'customer_followup_method', //跟进方式 CUSTOMER_FOLLOWUP_METHOD: "customer_followup_method", //跟进方式
CUSTOMER_FOLLOWUP_SALE_STAGE: 'sale_stage', //销售阶段 CUSTOMER_FOLLOWUP_SALE_STAGE: "sale_stage", //销售阶段
CUSTOMER_FOLLOWUP_RESULT_TYPE: 'customer_followup_result_type', //跟进结果 CUSTOMER_FOLLOWUP_RESULT_TYPE: "customer_followup_result_type", //跟进结果
CUSTOMER_FOLLOWUP_STATUS: 'customer_followup_status', //跟进状态 CUSTOMER_FOLLOWUP_STATUS: "customer_followup_status", //跟进状态
CUSTOMER_QUERY_NUMBER_FIELD: "customer_query_number_field", //客户查询数字字段 CUSTOMER_QUERY_NUMBER_FIELD: "customer_query_number_field", //客户查询数字字段
// order // order
ORDER_TYPE: "order_type", // 订单类型 ORDER_TYPE: "order_type", // 订单类型
PRODUCT_RECORD_ATTRIBUTE: "product_record_attribute", //产品备案属性 PRODUCT_RECORD_ATTRIBUTE: "product_record_attribute", //产品备案属性
PROD_QUERY_TITLE_ZH_FIELD: 'prod_query_title_zh_field', // 商品列表商品中文名称查询类型 PROD_QUERY_TITLE_ZH_FIELD: "prod_query_title_zh_field", // 商品列表商品中文名称查询类型
CONTROL_GOODS_STATUS: "control_goods_status", //控货状态 CONTROL_GOODS_STATUS: "control_goods_status", //控货状态
DISBURSEMENT_TYPE: "disbursement_type", //垫付类型 DISBURSEMENT_TYPE: "disbursement_type", //垫付类型
DRAWEE: "drawee", // 付款人 DRAWEE: "drawee", // 付款人
...@@ -188,13 +188,11 @@ export const DICT_TYPE = { ...@@ -188,13 +188,11 @@ export const DICT_TYPE = {
PAYMENT_TYPE: "payment_type", //收款类型 PAYMENT_TYPE: "payment_type", //收款类型
ORDER_WAREHOUSE_IN_STATUS: "order_warehouse_in_diff_status", // 入仓状态 ORDER_WAREHOUSE_IN_STATUS: "order_warehouse_in_diff_status", // 入仓状态
ORDER_NO_QUOTE_EXCEPTION_RESULT: "order_no_quote_exception_result", //未报价异常处理结果 ORDER_NO_QUOTE_EXCEPTION_RESULT: "order_no_quote_exception_result", //未报价异常处理结果
ORDER_SUPERFLUOUS_BOX_EXCEPTION_RESULT: ORDER_SUPERFLUOUS_BOX_EXCEPTION_RESULT: "order_superfluous_box_exception_result", //多箱异常处理结果
"order_superfluous_box_exception_result", //多箱异常处理结果
ORDER_LACI_BOX_EXCEPTION_RESULT: "order_lack_box_exception_result", //少箱异常处理结果 ORDER_LACI_BOX_EXCEPTION_RESULT: "order_lack_box_exception_result", //少箱异常处理结果
ORDER_PAY_EXCEPTION_RESULT: "order_pay_exception_result", //预付异常处理结果 ORDER_PAY_EXCEPTION_RESULT: "order_pay_exception_result", //预付异常处理结果
ORDER_MISS_EXCEPTION_RESULT: "order_miss_exception_result", //货物丢失异常处理结果 ORDER_MISS_EXCEPTION_RESULT: "order_miss_exception_result", //货物丢失异常处理结果
ORDER_SUPERFLUOUS_GOODS_EXCEPTION_RESULT: ORDER_SUPERFLUOUS_GOODS_EXCEPTION_RESULT: "order_superfluous_goods_exception_result", //货物增多异常处理结果
"order_superfluous_goods_exception_result", //货物增多异常处理结果
ORDER_DAMAGE_EXCEPTION_RESULT: "order_damage_exception_result", //货物破损异常处理结果 ORDER_DAMAGE_EXCEPTION_RESULT: "order_damage_exception_result", //货物破损异常处理结果
ORDER_IN_WATER_EXCEPTION_RESULT: "order_in_water_exception_result", //货物浸水异常处理结果 ORDER_IN_WATER_EXCEPTION_RESULT: "order_in_water_exception_result", //货物浸水异常处理结果
ORDER_HEAVY_CARGO_EXCEPTION_RESULT: "order_heavy_cargo_exception_result", //重货异常处理结果 ORDER_HEAVY_CARGO_EXCEPTION_RESULT: "order_heavy_cargo_exception_result", //重货异常处理结果
...@@ -280,7 +278,13 @@ export const DICT_TYPE = { ...@@ -280,7 +278,13 @@ export const DICT_TYPE = {
MEMBERSHIP_LEVELS: "membership_levels", //会员等级 MEMBERSHIP_LEVELS: "membership_levels", //会员等级
ENABLE_STATUS: "enable_status", //会员等级规则开启状态 ENABLE_STATUS: "enable_status", //会员等级规则开启状态
MEMBER_USER_OPERATE_LOG: "member_user_operate_log", //会员等级操作日志 MEMBER_USER_OPERATE_LOG: "member_user_operate_log", //会员等级操作日志
}; INVOICE_DATA_STATUS: "invoice_data_status", // 开票资料状态
INVOICING_STATUS: "invoicing_status", //开票状态
RECEIPT_DETAIL_STATUS: "receipt_detail_status", //明细状态
INVOICEING_LINK: "invoicing_link", //开票环节
RECEIPT_GENERATE_PATH: "receipt_generate_path", //收款单生成路径
RECEIPT_LINK: "receipt_link" //应收款日志环节
}
/** /**
* 获取 dictType 对应的数据字典数组 * 获取 dictType 对应的数据字典数组
...@@ -294,7 +298,7 @@ export function getDictDatas(dictType) { ...@@ -294,7 +298,7 @@ export function getDictDatas(dictType) {
// debugger // debugger
// } // }
// debugger // debugger
return store.getters.dict_datas[dictType] || []; return store.getters.dict_datas[dictType] || []
} }
/** /**
...@@ -306,44 +310,44 @@ export function getDictDatas(dictType) { ...@@ -306,44 +310,44 @@ export function getDictDatas(dictType) {
*/ */
export function getDictDatas2(dictType, values) { export function getDictDatas2(dictType, values) {
if (values === undefined) { if (values === undefined) {
return []; return []
} }
// 如果是单个元素,则转换成数组 // 如果是单个元素,则转换成数组
if (!Array.isArray(values)) { if (!Array.isArray(values)) {
values = [this.value]; values = [this.value]
} }
// 获得字典数据 // 获得字典数据
const results = []; const results = []
for (const value of values) { for (const value of values) {
const dict = getDictData(dictType, value); const dict = getDictData(dictType, value)
if (dict) { if (dict) {
results.push(dict); results.push(dict)
} }
} }
// debugger // debugger
// console.log(results); // console.log(results);
return results; return results
} }
export function getDictData(dictType, value) { export function getDictData(dictType, value) {
// 获取 dictType 对应的数据字典数组 // 获取 dictType 对应的数据字典数组
const dictDatas = getDictDatas(dictType); const dictDatas = getDictDatas(dictType)
if (!dictDatas || dictDatas.length === 0) { if (!dictDatas || dictDatas.length === 0) {
return ""; return ""
} }
// 获取 value 对应的展示名 // 获取 value 对应的展示名
value = value + ""; // 强制转换成字符串,因为 DictData 小类数值,是字符串 value = value + "" // 强制转换成字符串,因为 DictData 小类数值,是字符串
for (const dictData of dictDatas) { for (const dictData of dictDatas) {
if (dictData.value === value) { if (dictData.value === value) {
return dictData; return dictData
} }
} }
return undefined; return undefined
} }
export function getDictDataLabel(dictType, value) { export function getDictDataLabel(dictType, value) {
const dict = getDictData(dictType, value); const dict = getDictData(dictType, value)
return dict ? i18n.l(dict, "label") : ""; return dict ? i18n.l(dict, "label") : ""
} }
export class getDictDataL {} export class getDictDataL {}
import { parseTime } from './ruoyi' import { parseTime } from "./ruoyi"
/** /**
* 表格时间格式化 * 表格时间格式化
*/ */
export function formatDate(cellValue) { export function formatDate(cellValue) {
if (cellValue == null || cellValue == "") return ""; if (cellValue == null || cellValue == "") return ""
var date = new Date(cellValue) var date = new Date(cellValue)
var year = date.getFullYear() var year = date.getFullYear()
var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1 var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1
var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate() var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate()
var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours() var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours()
var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes() var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()
var seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds() var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds()
return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds
} }
/** /**
...@@ -21,7 +21,7 @@ export function formatDate(cellValue) { ...@@ -21,7 +21,7 @@ export function formatDate(cellValue) {
* @returns {string} * @returns {string}
*/ */
export function formatTime(time, option) { export function formatTime(time, option) {
if (('' + time).length === 10) { if (("" + time).length === 10) {
time = parseInt(time) * 1000 time = parseInt(time) * 1000
} else { } else {
time = +time time = +time
...@@ -32,29 +32,19 @@ export function formatTime(time, option) { ...@@ -32,29 +32,19 @@ export function formatTime(time, option) {
const diff = (now - d) / 1000 const diff = (now - d) / 1000
if (diff < 30) { if (diff < 30) {
return '刚刚' return "刚刚"
} else if (diff < 3600) { } else if (diff < 3600) {
// less 1 hour // less 1 hour
return Math.ceil(diff / 60) + '分钟前' return Math.ceil(diff / 60) + "分钟前"
} else if (diff < 3600 * 24) { } else if (diff < 3600 * 24) {
return Math.ceil(diff / 3600) + '小时前' return Math.ceil(diff / 3600) + "小时前"
} else if (diff < 3600 * 24 * 2) { } else if (diff < 3600 * 24 * 2) {
return '1天前' return "1天前"
} }
if (option) { if (option) {
return parseTime(time, option) return parseTime(time, option)
} else { } else {
return ( return d.getMonth() + 1 + "" + d.getDate() + "" + d.getHours() + "" + d.getMinutes() + ""
d.getMonth() +
1 +
'' +
d.getDate() +
'' +
d.getHours() +
'' +
d.getMinutes() +
''
)
} }
} }
...@@ -64,7 +54,7 @@ export function formatTime(time, option) { ...@@ -64,7 +54,7 @@ export function formatTime(time, option) {
*/ */
export function getQueryObject(url) { export function getQueryObject(url) {
url = url == null ? window.location.href : url url = url == null ? window.location.href : url
const search = url.substring(url.lastIndexOf('?') + 1) const search = url.substring(url.lastIndexOf("?") + 1)
const obj = {} const obj = {}
const reg = /([^?&=]+)=([^?&=]*)/g const reg = /([^?&=]+)=([^?&=]*)/g
search.replace(reg, (rs, $1, $2) => { search.replace(reg, (rs, $1, $2) => {
...@@ -88,7 +78,7 @@ export function byteLength(str) { ...@@ -88,7 +78,7 @@ export function byteLength(str) {
const code = str.charCodeAt(i) const code = str.charCodeAt(i)
if (code > 0x7f && code <= 0x7ff) s++ if (code > 0x7f && code <= 0x7ff) s++
else if (code > 0x7ff && code <= 0xffff) s += 2 else if (code > 0x7ff && code <= 0xffff) s += 2
if (code >= 0xDC00 && code <= 0xDFFF) i-- if (code >= 0xdc00 && code <= 0xdfff) i--
} }
return s return s
} }
...@@ -112,13 +102,13 @@ export function cleanArray(actual) { ...@@ -112,13 +102,13 @@ export function cleanArray(actual) {
* @returns {Array} * @returns {Array}
*/ */
export function param(json) { export function param(json) {
if (!json) return '' if (!json) return ""
return cleanArray( return cleanArray(
Object.keys(json).map(key => { Object.keys(json).map((key) => {
if (json[key] === undefined) return '' if (json[key] === undefined) return ""
return encodeURIComponent(key) + '=' + encodeURIComponent(json[key]) return encodeURIComponent(key) + "=" + encodeURIComponent(json[key])
}) })
).join('&') ).join("&")
} }
/** /**
...@@ -126,14 +116,14 @@ export function param(json) { ...@@ -126,14 +116,14 @@ export function param(json) {
* @returns {Object} * @returns {Object}
*/ */
export function param2Obj(url) { export function param2Obj(url) {
const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ') const search = decodeURIComponent(url.split("?")[1]).replace(/\+/g, " ")
if (!search) { if (!search) {
return {} return {}
} }
const obj = {} const obj = {}
const searchArr = search.split('&') const searchArr = search.split("&")
searchArr.forEach(v => { searchArr.forEach((v) => {
const index = v.indexOf('=') const index = v.indexOf("=")
if (index !== -1) { if (index !== -1) {
const name = v.substring(0, index) const name = v.substring(0, index)
const val = v.substring(index + 1, v.length) const val = v.substring(index + 1, v.length)
...@@ -148,7 +138,7 @@ export function param2Obj(url) { ...@@ -148,7 +138,7 @@ export function param2Obj(url) {
* @returns {string} * @returns {string}
*/ */
export function html2Text(val) { export function html2Text(val) {
const div = document.createElement('div') const div = document.createElement("div")
div.innerHTML = val div.innerHTML = val
return div.textContent || div.innerText return div.textContent || div.innerText
} }
...@@ -160,15 +150,15 @@ export function html2Text(val) { ...@@ -160,15 +150,15 @@ export function html2Text(val) {
* @returns {Object} * @returns {Object}
*/ */
export function objectMerge(target, source) { export function objectMerge(target, source) {
if (typeof target !== 'object') { if (typeof target !== "object") {
target = {} target = {}
} }
if (Array.isArray(source)) { if (Array.isArray(source)) {
return source.slice() return source.slice()
} }
Object.keys(source).forEach(property => { Object.keys(source).forEach((property) => {
const sourceProperty = source[property] const sourceProperty = source[property]
if (typeof sourceProperty === 'object') { if (typeof sourceProperty === "object") {
target[property] = objectMerge(target[property], sourceProperty) target[property] = objectMerge(target[property], sourceProperty)
} else { } else {
target[property] = sourceProperty target[property] = sourceProperty
...@@ -188,11 +178,9 @@ export function toggleClass(element, className) { ...@@ -188,11 +178,9 @@ export function toggleClass(element, className) {
let classString = element.className let classString = element.className
const nameIndex = classString.indexOf(className) const nameIndex = classString.indexOf(className)
if (nameIndex === -1) { if (nameIndex === -1) {
classString += '' + className classString += "" + className
} else { } else {
classString = classString = classString.substr(0, nameIndex) + classString.substr(nameIndex + className.length)
classString.substr(0, nameIndex) +
classString.substr(nameIndex + className.length)
} }
element.className = classString element.className = classString
} }
...@@ -202,7 +190,7 @@ export function toggleClass(element, className) { ...@@ -202,7 +190,7 @@ export function toggleClass(element, className) {
* @returns {Date} * @returns {Date}
*/ */
export function getTime(type) { export function getTime(type) {
if (type === 'start') { if (type === "start") {
return new Date().getTime() - 3600 * 1000 * 24 * 90 return new Date().getTime() - 3600 * 1000 * 24 * 90
} else { } else {
return new Date(new Date().toDateString()) return new Date(new Date().toDateString())
...@@ -218,7 +206,7 @@ export function getTime(type) { ...@@ -218,7 +206,7 @@ export function getTime(type) {
export function debounce(func, wait, immediate) { export function debounce(func, wait, immediate) {
let timeout, args, context, timestamp, result let timeout, args, context, timestamp, result
const later = function() { const later = function () {
// 据上一次触发时间间隔 // 据上一次触发时间间隔
const last = +new Date() - timestamp const last = +new Date() - timestamp
...@@ -235,7 +223,7 @@ export function debounce(func, wait, immediate) { ...@@ -235,7 +223,7 @@ export function debounce(func, wait, immediate) {
} }
} }
return function(...args) { return function (...args) {
context = this context = this
timestamp = +new Date() timestamp = +new Date()
const callNow = immediate && !timeout const callNow = immediate && !timeout
...@@ -278,28 +266,34 @@ export function deepClone(obj) { ...@@ -278,28 +266,34 @@ export function deepClone(obj) {
const _toString = Object.prototype.toString const _toString = Object.prototype.toString
// null, undefined, non-object, function // null, undefined, non-object, function
if (!obj || typeof obj !== 'object') { if (!obj || typeof obj !== "object") {
return obj return obj
} }
// DOM Node // DOM Node
if (obj.nodeType && 'cloneNode' in obj) { if (obj.nodeType && "cloneNode" in obj) {
return obj.cloneNode(true) return obj.cloneNode(true)
} }
// Date // Date
if (_toString.call(obj) === '[object Date]') { if (_toString.call(obj) === "[object Date]") {
return new Date(obj.getTime()) return new Date(obj.getTime())
} }
// RegExp // RegExp
if (_toString.call(obj) === '[object RegExp]') { if (_toString.call(obj) === "[object RegExp]") {
const flags = [] const flags = []
if (obj.global) { flags.push('g') } if (obj.global) {
if (obj.multiline) { flags.push('m') } flags.push("g")
if (obj.ignoreCase) { flags.push('i') } }
if (obj.multiline) {
flags.push("m")
}
if (obj.ignoreCase) {
flags.push("i")
}
return new RegExp(obj.source, flags.join('')) return new RegExp(obj.source, flags.join(""))
} }
const result = Array.isArray(obj) ? [] : obj.constructor ? new obj.constructor() : {} const result = Array.isArray(obj) ? [] : obj.constructor ? new obj.constructor() : {}
...@@ -323,8 +317,8 @@ export function uniqueArr(arr) { ...@@ -323,8 +317,8 @@ export function uniqueArr(arr) {
* @returns {string} * @returns {string}
*/ */
export function createUniqueString() { export function createUniqueString() {
const timestamp = +new Date() + '' const timestamp = +new Date() + ""
const randomNum = parseInt((1 + Math.random()) * 65536) + '' const randomNum = parseInt((1 + Math.random()) * 65536) + ""
return (+(randomNum + timestamp)).toString(32) return (+(randomNum + timestamp)).toString(32)
} }
...@@ -335,7 +329,7 @@ export function createUniqueString() { ...@@ -335,7 +329,7 @@ export function createUniqueString() {
* @returns {boolean} * @returns {boolean}
*/ */
export function hasClass(ele, cls) { export function hasClass(ele, cls) {
return !!ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)')) return !!ele.className.match(new RegExp("(\\s|^)" + cls + "(\\s|$)"))
} }
/** /**
...@@ -344,7 +338,7 @@ export function hasClass(ele, cls) { ...@@ -344,7 +338,7 @@ export function hasClass(ele, cls) {
* @param {string} cls * @param {string} cls
*/ */
export function addClass(ele, cls) { export function addClass(ele, cls) {
if (!hasClass(ele, cls)) ele.className += ' ' + cls if (!hasClass(ele, cls)) ele.className += " " + cls
} }
/** /**
...@@ -354,58 +348,56 @@ export function addClass(ele, cls) { ...@@ -354,58 +348,56 @@ export function addClass(ele, cls) {
*/ */
export function removeClass(ele, cls) { export function removeClass(ele, cls) {
if (hasClass(ele, cls)) { if (hasClass(ele, cls)) {
const reg = new RegExp('(\\s|^)' + cls + '(\\s|$)') const reg = new RegExp("(\\s|^)" + cls + "(\\s|$)")
ele.className = ele.className.replace(reg, ' ') ele.className = ele.className.replace(reg, " ")
} }
} }
export function makeMap(str, expectsLowerCase) { export function makeMap(str, expectsLowerCase) {
const map = Object.create(null) const map = Object.create(null)
const list = str.split(',') const list = str.split(",")
for (let i = 0; i < list.length; i++) { for (let i = 0; i < list.length; i++) {
map[list[i]] = true map[list[i]] = true
} }
return expectsLowerCase return expectsLowerCase ? (val) => map[val.toLowerCase()] : (val) => map[val]
? val => map[val.toLowerCase()]
: val => map[val]
} }
export const exportDefault = 'export default ' export const exportDefault = "export default "
export const beautifierConf = { export const beautifierConf = {
html: { html: {
indent_size: '2', indent_size: "2",
indent_char: ' ', indent_char: " ",
max_preserve_newlines: '-1', max_preserve_newlines: "-1",
preserve_newlines: false, preserve_newlines: false,
keep_array_indentation: false, keep_array_indentation: false,
break_chained_methods: false, break_chained_methods: false,
indent_scripts: 'separate', indent_scripts: "separate",
brace_style: 'end-expand', brace_style: "end-expand",
space_before_conditional: true, space_before_conditional: true,
unescape_strings: false, unescape_strings: false,
jslint_happy: false, jslint_happy: false,
end_with_newline: true, end_with_newline: true,
wrap_line_length: '110', wrap_line_length: "110",
indent_inner_html: true, indent_inner_html: true,
comma_first: false, comma_first: false,
e4x: true, e4x: true,
indent_empty_lines: true indent_empty_lines: true
}, },
js: { js: {
indent_size: '2', indent_size: "2",
indent_char: ' ', indent_char: " ",
max_preserve_newlines: '-1', max_preserve_newlines: "-1",
preserve_newlines: false, preserve_newlines: false,
keep_array_indentation: false, keep_array_indentation: false,
break_chained_methods: false, break_chained_methods: false,
indent_scripts: 'normal', indent_scripts: "normal",
brace_style: 'end-expand', brace_style: "end-expand",
space_before_conditional: true, space_before_conditional: true,
unescape_strings: false, unescape_strings: false,
jslint_happy: true, jslint_happy: true,
end_with_newline: true, end_with_newline: true,
wrap_line_length: '110', wrap_line_length: "110",
indent_inner_html: true, indent_inner_html: true,
comma_first: false, comma_first: false,
e4x: true, e4x: true,
...@@ -415,12 +407,12 @@ export const beautifierConf = { ...@@ -415,12 +407,12 @@ export const beautifierConf = {
// 首字母大小 // 首字母大小
export function titleCase(str) { export function titleCase(str) {
return str.replace(/( |^)[a-z]/g, L => L.toUpperCase()) return str.replace(/( |^)[a-z]/g, (L) => L.toUpperCase())
} }
// 下划转驼峰 // 下划转驼峰
export function camelCase(str) { export function camelCase(str) {
return str.replace(/_[a-z]/g, str1 => str1.substr(-1).toUpperCase()) return str.replace(/_[a-z]/g, (str1) => str1.substr(-1).toUpperCase())
} }
export function isNumberStr(str) { export function isNumberStr(str) {
...@@ -428,10 +420,10 @@ export function isNumberStr(str) { ...@@ -428,10 +420,10 @@ export function isNumberStr(str) {
} }
// 将数组变成object // 将数组变成object
export function arrryToKeyedObjectBy(arr, key){ export function arrryToKeyedObjectBy(arr, key) {
let obj = {} let obj = {}
arr.forEach(item => { arr.forEach((item) => {
obj[item[key]] = item obj[item[key]] = item
}) })
return obj return obj
} }
...@@ -439,28 +431,60 @@ export function arrryToKeyedObjectBy(arr, key){ ...@@ -439,28 +431,60 @@ export function arrryToKeyedObjectBy(arr, key){
// dataurl转blob // dataurl转blob
export function dataURLtoBlob(base64Data) { export function dataURLtoBlob(base64Data) {
//console.log(base64Data);//data:image/png;base64, //console.log(base64Data);//data:image/png;base64,
var byteString; var byteString
if(base64Data.split(',')[0].indexOf('base64') >= 0) if (base64Data.split(",")[0].indexOf("base64") >= 0) byteString = atob(base64Data.split(",")[1]) //base64 解码
byteString = atob(base64Data.split(',')[1]);//base64 解码 else {
else{ byteString = unescape(base64Data.split(",")[1])
byteString = unescape(base64Data.split(',')[1]);
} }
var mimeString = base64Data.split(',')[0].split(':')[1].split(';')[0];//mime类型 -- image/png var mimeString = base64Data.split(",")[0].split(":")[1].split(";")[0] //mime类型 -- image/png
// var arrayBuffer = new ArrayBuffer(byteString.length); //创建缓冲数组 // var arrayBuffer = new ArrayBuffer(byteString.length); //创建缓冲数组
// var ia = new Uint8Array(arrayBuffer);//创建视图 // var ia = new Uint8Array(arrayBuffer);//创建视图
var ia = new Uint8Array(byteString.length);//创建视图 var ia = new Uint8Array(byteString.length) //创建视图
for(var i = 0; i < byteString.length; i++) { for (var i = 0; i < byteString.length; i++) {
ia[i] = byteString.charCodeAt(i); ia[i] = byteString.charCodeAt(i)
} }
var blob = new Blob([ia], { var blob = new Blob([ia], {
type: mimeString type: mimeString
}); })
return blob; return blob
} }
// 将字符串转成数组 // 将字符串转成数组
export function str2arr(str, separator = ','){ export function str2arr(str, separator = ",") {
if(!str) return [] if (!str) return []
return str.split(separator).filter(item => item) return str.split(separator).filter((item) => item)
} }
\ No newline at end of file
function isEmptyValue(value) {
if (value === null || value === undefined || value === "") {
return true
}
if (Array.isArray(value) && value.length === 0) {
return true
}
if (typeof value === "object" && Object.keys(value).length === 0) {
return true
}
return false
}
//清空对象
export function removeEmpty(obj) {
if (obj === null || obj === undefined || typeof obj !== "object") {
return obj
}
Object.keys(obj).forEach((key) => {
if (isEmptyValue(obj[key])) {
delete obj[key]
} else if (typeof obj[key] === "object") {
removeEmpty(obj[key])
// If the nested object/array became empty after cleaning, delete it
if (isEmptyValue(obj[key])) {
delete obj[key]
}
}
})
return obj
}
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="108px">
<el-form-item :label="$t('户名')" prop="baAccountName"> <el-form-item :label="$t('户名')" prop="baAccountName">
<el-input v-model="queryParams.baAccountName" :placeholder="$t('请输入户名')" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.baAccountName" :placeholder="$t('请输入户名')" clearable @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('开户银行')" prop="baBankName"> <el-form-item :label="$t('开户银行')" prop="baBankName">
<el-input v-model="queryParams.baBankName" :placeholder="$t('请输入开户银行')" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.baBankName" :placeholder="$t('请输入开户银行')" clearable @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('银行账号')" prop="baAccountNum"> <el-form-item :label="$t('银行账号')" prop="baAccountNum">
<el-input v-model="queryParams.baAccountNum" :placeholder="$t('请输入银行账号')" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.baAccountNum" :placeholder="$t('请输入银行账号')" clearable @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('银行代码')" prop="baSwiftCode"> <el-form-item :label="$t('银行代码')" prop="baSwiftCode">
<el-input v-model="queryParams.baSwiftCode" :placeholder="$t('请输入银行代码')" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.baSwiftCode" :placeholder="$t('请输入银行代码')" clearable @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('开户银行地址')" prop="baBankAdd"> <el-form-item :label="$t('开户银行地址')" prop="baBankAdd">
<el-input v-model="queryParams.baBankAdd" :placeholder="$t('请输入开户银行地址')" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.baBankAdd" :placeholder="$t('请输入开户银行地址')" clearable @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('类型')" prop="baType"> <el-form-item :label="$t('类型')" prop="baType">
<!-- <el-select v-model="queryParams.baType" placeholder="请选择类型字典(1公账,2私账)" clearable size="small">--> <!-- <el-select v-model="queryParams.baType" placeholder="请选择类型字典(1公账,2私账)" clearable size="small">-->
<!-- <el-option :label="$t('请选择字典生成')" value="" />--> <!-- <el-option :label="$t('请选择字典生成')" value="" />-->
<!-- </el-select>--> <!-- </el-select>-->
<el-select v-model="queryParams.baType" :placeholder="$t('请选择类型字典')" clearable style="width: 240px"> <el-select v-model="queryParams.baType" :placeholder="$t('请选择类型字典')" clearable>
<el-option v-for="dict in bankTypeDatas" :key="parseInt(dict.value)" :label="dict.label" :value="parseInt(dict.value)"/> <el-option v-for="dict in bankTypeDatas" :key="parseInt(dict.value)" :label="dict.label" :value="parseInt(dict.value)" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item :label="$t('数据来源')" prop="source">--> <!-- <el-form-item :label="$t('数据来源')" prop="source">-->
<!--&lt;!&ndash; <el-input v-model="queryParams.source" placeholder="请输入数据来源字典(pc端,mobile端)" clearable @keyup.enter.native="handleQuery"/>&ndash;&gt;--> <!--&lt;!&ndash; <el-input v-model="queryParams.source" placeholder="请输入数据来源字典(pc端,mobile端)" clearable @keyup.enter.native="handleQuery"/>&ndash;&gt;-->
<!-- <el-select v-model="queryParams.source" :placeholder="$t('请选择数据来源')" clearable style="width: 240px">--> <!-- <el-select v-model="queryParams.source" :placeholder="$t('请选择数据来源')" clearable style="width: 240px">-->
<!-- <el-option v-for="dict in sourceDatas" :key="dict.value" :label="dict.label" :value="dict.value"/>--> <!-- <el-option v-for="dict in sourceDatas" :key="dict.value" :label="dict.label" :value="dict.value"/>-->
<!-- </el-select>--> <!-- </el-select>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<el-form-item :label="$t('状态')" prop="status"> <el-form-item :label="$t('状态')" prop="status">
<el-select v-model="queryParams.status" :placeholder="$t('用户状态')" clearable style="width: 240px"> <el-select v-model="queryParams.status" :placeholder="$t('用户状态')" clearable>
<el-option v-for="dict in statusDictDatas" :key="parseInt(dict.value)" :label="dict.label" :value="parseInt(dict.value)"/> <el-option v-for="dict in statusDictDatas" :key="parseInt(dict.value)" :label="dict.label" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
<el-form-item :label="$t('开户国家')" prop="baCountry">
<el-select v-model="queryParams.baCountry" :placeholder="$t('请选择国家')" clearable>
<el-option v-for="countryItem in countryList" :key="countryItem.id" :label="$l(countryItem, 'title')" :value="countryItem.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('收入归属')" prop="baIncomeBelong">
<el-select v-model="queryParams.baIncomeBelong" :placeholder="$t('请选择')" clearable>
<el-option v-for="countryItem in countryList" :key="countryItem.id" :label="$l(countryItem, 'title')" :value="countryItem.id" />
</el-select>
</el-form-item>
<el-form-item :label="$t('币种')" prop="baCurrency">
<el-select v-model="queryParams.baCurrency" :placeholder="$t('请选择')" clearable>
<el-option v-for="item in $store.state.staticData.currencyList" :key="item.id" :label="$l(item, 'title')" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item :label="$t('余额')" prop="baBalance">
<el-input v-model="queryParams.baBalance" :placeholder="$t('请输入余额')" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('创建时间')"> <el-form-item :label="$t('创建时间')">
<el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd" <el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ $t('搜索') }}</el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ $t("搜索") }}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{ $t('重置') }}</el-button> <el-button icon="el-icon-refresh" @click="resetQuery">{{ $t("重置") }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- 操作工具栏 --> <!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['ecw:bank-account:create']">{{ $t("新增") }}</el-button>
v-hasPermi="['ecw:bank-account:create']">{{ $t('新增') }}</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading" <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading" v-hasPermi="['ecw:bank-account:export']">{{ $t("导出") }}</el-button>
v-hasPermi="['ecw:bank-account:export']">{{ $t('导出') }}</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
...@@ -67,24 +82,32 @@ ...@@ -67,24 +82,32 @@
<el-table-column :label="$t('开户银行')" align="center" prop="baBankName" /> <el-table-column :label="$t('开户银行')" align="center" prop="baBankName" />
<el-table-column :label="$t('银行账号')" align="center" prop="baAccountNum" /> <el-table-column :label="$t('银行账号')" align="center" prop="baAccountNum" />
<el-table-column :label="$t('银行代码')" align="center" prop="baSwiftCode" /> <el-table-column :label="$t('银行代码')" align="center" prop="baSwiftCode" />
<el-table-column :label="$t('开户国家')" align="center" :prop="$l('baCountry')" />
<el-table-column :label="$t('开户银行地址')" align="center" prop="baBankAdd" /> <el-table-column :label="$t('开户银行地址')" align="center" prop="baBankAdd" />
<el-table-column :label="$t('类型')" align="center" prop="baType" > <el-table-column :label="$t('类型')" align="center" prop="baType">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.ECW_BANK_TYPE" :value="scope.row.baType" />
</template>
</el-table-column>
<el-table-column :label="$t('收入归属')" align="center" :prop="$l('baIncomeBelong')" />
<el-table-column :label="$t('币种')" align="center" prop="baCurrency">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :type="DICT_TYPE.ECW_BANK_TYPE" :value="scope.row.baType"/> {{ $l(getCurrencyData(scope.row.baCurrency), "title") }}
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column :label="$t('数据来源')" align="center" prop="source" >--> <!-- <el-table-column :label="$t('数据来源')" align="center" prop="source" >-->
<!-- <template slot-scope="scope">--> <!-- <template slot-scope="scope">-->
<!-- <dict-tag :type="DICT_TYPE.ECW_DATA_SOURCE" :value="scope.row.source"/>--> <!-- <dict-tag :type="DICT_TYPE.ECW_DATA_SOURCE" :value="scope.row.source"/>-->
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<!-- <el-table-column :label="$t('状态')" align="center" prop="status" />--> <!-- <el-table-column :label="$t('状态')" align="center" prop="status" />-->
<el-table-column :label="$t('状态')" key="status" align="center"> <el-table-column :label="$t('状态')" key="status" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch v-model="scope.row.status" :active-value="0" :inactive-value="1" @change="handleStatusChange(scope.row)" /> <el-switch v-model="scope.row.status" :active-value="0" :inactive-value="1" @change="handleStatusChange(scope.row)" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('余额')" align="center" prop="baBalance" />
<el-table-column :label="$t('创建时间')" align="center" prop="createTime" width="180"> <el-table-column :label="$t('创建时间')" align="center" prop="createTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
...@@ -92,16 +115,13 @@ ...@@ -92,16 +115,13 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width"> <el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['ecw:bank-account:update']">{{ $t("修改") }}</el-button>
v-hasPermi="['ecw:bank-account:update']">{{ $t('修改') }}</el-button> <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['ecw:bank-account:delete']">{{ $t("删除") }}</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['ecw:bank-account:delete']">{{ $t('删除') }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页组件 --> <!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" @pagination="getList" />
@pagination="getList"/>
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
...@@ -118,60 +138,69 @@ ...@@ -118,60 +138,69 @@
<el-form-item :label="$t('银行代码')" prop="baSwiftCode"> <el-form-item :label="$t('银行代码')" prop="baSwiftCode">
<el-input v-model="form.baSwiftCode" :placeholder="$t('请输入银行代码')" /> <el-input v-model="form.baSwiftCode" :placeholder="$t('请输入银行代码')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('开户国家')" prop="baCountry">
<el-select v-model="form.baCountry" :placeholder="$t('请选择国家')" clearable>
<el-option v-for="countryItem in countryList" :key="countryItem.id" :label="$l(countryItem, 'title')" :value="countryItem.id" />
</el-select>
</el-form-item>
<el-form-item :label="$t('开户银行地址')" prop="baBankAdd"> <el-form-item :label="$t('开户银行地址')" prop="baBankAdd">
<el-input v-model="form.baBankAdd" :placeholder="$t('请输入开户银行地址')" /> <el-input v-model="form.baBankAdd" :placeholder="$t('请输入开户银行地址')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('类型')" prop="baType"> <el-form-item :label="$t('类型')" prop="baType">
<!-- <el-select v-model="form.baType" :placeholder="$t('请选择类型')">--> <!-- <el-select v-model="form.baType" :placeholder="$t('请选择类型')">-->
<!-- <el-option :label="$t('请选择字典生成')" value="" />--> <!-- <el-option :label="$t('请选择字典生成')" value="" />-->
<!-- </el-select>--> <!-- </el-select>-->
<el-select v-model="form.baType" :placeholder="$t('请选择类型')" clearable style="width: 240px"> <el-select v-model="form.baType" :placeholder="$t('请选择类型')" clearable style="width: 240px">
<el-option v-for="dict in bankTypeDatas" :key="parseInt(dict.value)" :label="dict.label" :value="parseInt(dict.value)"/> <el-option v-for="dict in bankTypeDatas" :key="parseInt(dict.value)" :label="dict.label" :value="parseInt(dict.value)" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('收入归属')" prop="baIncomeBelong">
<el-select v-model="form.baIncomeBelong" :placeholder="$t('请选择收入归属')" clearable>
<el-option v-for="countryItem in countryList" :key="countryItem.id" :label="$l(countryItem, 'title')" :value="countryItem.id" />
</el-select>
</el-form-item>
<el-form-item :label="$t('余额')" prop="baBalance">
<el-input v-model="form.baBalance" :placeholder="$t('请输入开户银行地址')" />
</el-form-item>
<el-form-item :label="$t('币种')" prop="baCurrency">
<el-select v-model="form.baCurrency" :placeholder="$t('请选择')" clearable>
<el-option v-for="item in $store.state.staticData.currencyList" :key="item.id" :label="$l(item, 'title')" :value="item.id" />
</el-select>
</el-form-item>
<!-- <el-form-item :label="$t('数据字典')" prop="source">-->
<!-- &lt;!&ndash; <el-select v-model="form.baType" :placeholder="$t('请选择类型')">&ndash;&gt;-->
<!-- &lt;!&ndash; <el-option :label="$t('请选择字典生成')" value="" />&ndash;&gt;-->
<!-- &lt;!&ndash; </el-select>&ndash;&gt;-->
<!-- <el-select v-model="form.source" :placeholder="$t('请选择数据来源')" clearable style="width: 240px">-->
<!-- <el-option v-for="dict in sourceDatas" :key="dict.value" :label="dict.label" :value="dict.value"/>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item :label="$t('状态')" prop="status">-->
<!-- <el-radio-group v-model="form.status">-->
<!--&lt;!&ndash; <el-radio label="1">{{ $t('请选择字典生成') }}</el-radio>&ndash;&gt;-->
<!-- <el-radio v-for="dict in statusDictDatas" :key="parseInt(dict.value)" :label="dict.label" :value="parseInt(dict.value)"/>-->
<!-- <el-form-item :label="$t('数据字典')" prop="source">--> <!-- </el-radio-group>-->
<!-- &lt;!&ndash; <el-select v-model="form.baType" :placeholder="$t('请选择类型')">&ndash;&gt;--> <!-- </el-form-item>-->
<!-- &lt;!&ndash; <el-option :label="$t('请选择字典生成')" value="" />&ndash;&gt;-->
<!-- &lt;!&ndash; </el-select>&ndash;&gt;-->
<!-- <el-select v-model="form.source" :placeholder="$t('请选择数据来源')" clearable style="width: 240px">-->
<!-- <el-option v-for="dict in sourceDatas" :key="dict.value" :label="dict.label" :value="dict.value"/>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item :label="$t('状态')" prop="status">-->
<!-- <el-radio-group v-model="form.status">-->
<!--&lt;!&ndash; <el-radio label="1">{{ $t('请选择字典生成') }}</el-radio>&ndash;&gt;-->
<!-- <el-radio v-for="dict in statusDictDatas" :key="parseInt(dict.value)" :label="dict.label" :value="parseInt(dict.value)"/>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">{{ $t('确 定') }}</el-button> <el-button type="primary" @click="submitForm">{{ $t("确 定") }}</el-button>
<el-button @click="cancel">{{ $t('取 消') }}</el-button> <el-button @click="cancel">{{ $t("取 消") }}</el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { import { createBankAccount, updateBankAccount, deleteBankAccount, getBankAccount, getBankAccountPage, exportBankAccountExcel, updateBankAccountStatus } from "@/api/ecw/bankAccount"
createBankAccount, import { DICT_TYPE, getDictDatas } from "@/utils/dict"
updateBankAccount, import { CommonStatusEnum } from "@/utils/constants"
deleteBankAccount, import { changeUserStatus } from "@/api/system/user"
getBankAccount, import { getTradeCountryList } from "@/api/ecw/region"
getBankAccountPage, import { mapGetters } from "vuex"
exportBankAccountExcel,
updateBankAccountStatus
} from "@/api/ecw/bankAccount";
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
import {CommonStatusEnum} from "@/utils/constants";
import {changeUserStatus} from "@/api/system/user";
export default { export default {
name: "BankAccount", name: "BankAccount",
components: { components: {},
},
data() { data() {
return { return {
// 遮罩层 // 遮罩层
...@@ -184,6 +213,7 @@ export default { ...@@ -184,6 +213,7 @@ export default {
total: 0, total: 0,
// 银行账户列表 // 银行账户列表
list: [], list: [],
countryList: [],
// 弹出层标题 // 弹出层标题
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
...@@ -201,9 +231,15 @@ export default { ...@@ -201,9 +231,15 @@ export default {
baType: null, baType: null,
source: null, source: null,
status: null, status: null,
baCountry: "",
baCurrency: "",
baIncomeBelong: "",
baBalance: ""
}, },
// 表单参数 // 表单参数
form: {}, form: {
baCountry: "" //开户国家
},
// 表单校验 // 表单校验
rules: { rules: {
...@@ -213,34 +249,42 @@ export default { ...@@ -213,34 +249,42 @@ export default {
baSwiftCode: [{ required: true, message: this.$t("银行代码不能为空"), trigger: "blur" }], baSwiftCode: [{ required: true, message: this.$t("银行代码不能为空"), trigger: "blur" }],
baBankAdd: [{ required: true, message: this.$t("开户银行地址不能为空"), trigger: "blur" }], baBankAdd: [{ required: true, message: this.$t("开户银行地址不能为空"), trigger: "blur" }],
baType: [{ required: true, message: this.$t("类型不能为空"), trigger: "change" }], baType: [{ required: true, message: this.$t("类型不能为空"), trigger: "change" }],
baCountry: [{ required: true, message: this.$t("开户国家不能为空"), trigger: "change" }],
baIncomeBelong: [{ required: true, message: this.$t("收入归属不能为空"), trigger: "change" }],
baBalance: [{ required: true, message: this.$t("余额不能为空"), trigger: "blur" }],
baCurrency: [{ required: true, message: this.$t("币种不能为空"), trigger: "change" }]
// status: [{ required: true, message: "状态(0正常 1停用)不能为空", trigger: "blur" }], // status: [{ required: true, message: "状态(0正常 1停用)不能为空", trigger: "blur" }],
}, },
statusDictDatas: getDictDatas(DICT_TYPE.COMMON_STATUS), statusDictDatas: getDictDatas(DICT_TYPE.COMMON_STATUS),
bankTypeDatas: getDictDatas(DICT_TYPE.ECW_BANK_TYPE), bankTypeDatas: getDictDatas(DICT_TYPE.ECW_BANK_TYPE),
sourceDatas: getDictDatas(DICT_TYPE.ECW_DATA_SOURCE), sourceDatas: getDictDatas(DICT_TYPE.ECW_DATA_SOURCE)
}; }
},
computed: {
...mapGetters(["getCurrencyData"])
}, },
created() { async created() {
this.getList(); this.getList()
this.countryList = (await getTradeCountryList()).data
}, },
methods: { methods: {
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true
// 处理查询参数 // 处理查询参数
let params = {...this.queryParams}; let params = { ...this.queryParams }
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime'); this.addBeginAndEndTime(params, this.dateRangeCreateTime, "createTime")
// 执行查询 // 执行查询
getBankAccountPage(params).then(response => { getBankAccountPage(params).then((response) => {
this.list = response.data.list; this.list = response.data.list
this.total = response.data.total; this.total = response.data.total
this.loading = false; this.loading = false
}); })
}, },
/** 取消按钮 */ /** 取消按钮 */
cancel() { cancel() {
this.open = false; this.open = false
this.reset(); this.reset()
}, },
/** 表单重置 */ /** 表单重置 */
reset() { reset() {
...@@ -253,97 +297,112 @@ export default { ...@@ -253,97 +297,112 @@ export default {
baBankAdd: undefined, baBankAdd: undefined,
baType: undefined, baType: undefined,
status: undefined, status: undefined,
}; baCountry: undefined,
this.resetForm("form"); baIncomeBelong: undefined,
baBalance: undefined,
baBalance: undefined
}
this.resetForm("form")
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1
this.getList(); this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRangeCreateTime = []; this.dateRangeCreateTime = []
this.resetForm("queryForm"); this.resetForm("queryForm")
this.handleQuery(); this.handleQuery()
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset()
this.open = true; this.open = true
this.title = this.$t("添加银行账户"); this.title = this.$t("添加银行账户")
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset()
const id = row.id; const id = row.id
getBankAccount(id).then(response => { getBankAccount(id).then((response) => {
this.form = response.data; this.form = response.data
this.open = true; this.open = true
this.title = this.$t("修改银行账户"); this.title = this.$t("修改银行账户")
}); })
}, },
// 用户状态修改 // 用户状态修改
handleStatusChange(row) { handleStatusChange(row) {
let text = row.status === CommonStatusEnum.ENABLE ? this.$t("启用") : this.$t("停用"); let text = row.status === CommonStatusEnum.ENABLE ? this.$t("启用") : this.$t("停用")
this.$modal.confirm('确认要' + text + this.$t('编号为') + row.id + '的数据吗?').then(function() { this.$modal
return updateBankAccountStatus({id:row.id,status:!row.status?CommonStatusEnum.DISABLE:CommonStatusEnum.ENABLE}); .confirm("确认要" + text + this.$t("编号为") + row.id + "的数据吗?")
}).then(() => { .then(function () {
this.$modal.msgSuccess(text + "成功"); return updateBankAccountStatus({ id: row.id, status: !row.status ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE })
}).catch(function() { })
row.status = row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE .then(() => {
: CommonStatusEnum.ENABLE; this.$modal.msgSuccess(text + "成功")
}); })
.catch(function () {
row.status = row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE
})
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (!valid) { if (!valid) {
return; return
} }
// 修改的提交 // 修改的提交
if (this.form.id != null) { if (this.form.id != null) {
updateBankAccount(this.form).then(response => { updateBankAccount(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功")
this.open = false; this.open = false
this.getList(); this.getList()
}); })
return; return
} }
// 添加的提交 // 添加的提交
createBankAccount(this.form).then(response => { createBankAccount(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功")
this.open = false; this.open = false
this.getList(); this.getList()
}); })
}); })
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const id = row.id; const id = row.id
this.$modal.confirm('是否确认删除银行账户编号为"' + id + '"的数据项?').then(function() { this.$modal
return deleteBankAccount(id); .confirm('是否确认删除银行账户编号为"' + id + '"的数据项?')
}).then(() => { .then(function () {
this.getList(); return deleteBankAccount(id)
this.$modal.msgSuccess("删除成功"); })
}).catch(() => {}); .then(() => {
this.getList()
this.$modal.msgSuccess("删除成功")
})
.catch(() => {})
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
// 处理查询参数 // 处理查询参数
let params = {...this.queryParams}; let params = { ...this.queryParams }
params.pageNo = undefined; params.pageNo = undefined
params.pageSize = undefined; params.pageSize = undefined
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime'); this.addBeginAndEndTime(params, this.dateRangeCreateTime, "createTime")
// 执行导出 // 执行导出
this.$modal.confirm('是否确认导出所有银行账户数据项?').then(() => { this.$modal
this.exportLoading = true; .confirm("是否确认导出所有银行账户数据项?")
return exportBankAccountExcel(params); .then(() => {
}).then(response => { this.exportLoading = true
this.$download.excel(response, '${table.classComment}.xls'); return exportBankAccountExcel(params)
this.exportLoading = false; })
}).catch(() => {}); .then((response) => {
this.$download.excel(response, "${table.classComment}.xls")
this.exportLoading = false
})
.catch(() => {})
} }
} }
}; }
</script> </script>
<template>
<div class="app-container">
<el-form v-show="showSearch" :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="80px">
<el-form-item :label="$t('订单号')" prop="orderNo">
<el-input v-model.trim="queryParams.orderNo" :placeholder="$t('请输入订单号')" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('运输方式')" prop="transportId">
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model.number="queryParams.transportId" clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('出货渠道')" prop="shipmentChannel">
<selector :clearable="true" :options="channelList" :label-field="$l('name')" value-field="channelId" v-model="queryParams.shipmentChannel" multiple @change="handleQuery"></selector>
</el-form-item>
<el-form-item :label="$t('始发地')" prop="departureWareHouseId">
<el-select v-model="queryParams.departureWareHouseId" multiple :placeholder="$t('请选择始发仓')" clearable @change="handleQuery">
<el-option v-for="item in exportWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的国')" prop="destCountry">
<el-select v-model="queryParams.destCountry" multiple :placeholder="$t('请选择目的国')" clearable @change="handleQuery">
<el-option v-for="item in countryList" :key="item.guojia" :label="item.guojiaName" :value="item.guojia"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的城市')" prop="destCity">
<el-select v-model="queryParams.destCity" multiple :placeholder="$t('请选择目的城市')" clearable @change="handleQuery">
<el-option v-for="item in cityList" :key="item.shi" :label="item.shiName" :value="item.shi"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的地')" prop="objectiveWareHouseId">
<el-select v-model="queryParams.objectiveWareHouseId" multiple :placeholder="$t('请选择目的仓')" clearable @change="handleQuery">
<el-option v-for="item in objWareHouseList" :key="item.id" :label="item.titleZh" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('品名')" prop="title">
<el-input v-model.trim="queryParams.title" :placeholder="$t('品名')" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('费用来源')" prop="feeSource">
<dict-selector ref="dictMethod" multiple v-model="queryParams.feeSource" :type="DICT_TYPE.ECW_FEE_SOURCE"></dict-selector>
</el-form-item>
<el-form-item :label="$t('收款类型')" prop="collectionType">
<dict-selector ref="dictMethod" multiple v-model="queryParams.collectionType" :type="DICT_TYPE.PAYMENT_TYPE"></dict-selector>
</el-form-item>
<el-form-item :label="$t('收入类型')" prop="feeType">
<dict-selector ref="dictMethod" multiple v-model="queryParams.feeType" :type="DICT_TYPE.FEE_TYPE"></dict-selector>
</el-form-item>
<el-form-item :label="$t('订单状态')" prop="status">
<dict-selector ref="dictMethod" v-model="queryParams.status" :type="DICT_TYPE.ORDER_STATUS"></dict-selector>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ $t("搜索") }}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{ $t("重置") }}</el-button>
</el-form-item>
</el-form>
<div class="mb8 showBar">
<el-descriptions class="margin-top barTop" :title="$t('筛选合计信息:')" :column="2" :size="size" border>
<!-- <template slot="extra">
<el-button type="primary" size="small" @click="totalDetailVisible = !totalDetailVisible">
{{ totalDetailVisible ? $t("隐藏信息") : $t("显示信息") }}
</el-button>
</template> -->
<el-descriptions-item v-if="showSearch">
<template slot="label"> {{ $t("总金额") }}: </template>
<span class="unit" v-for="item in searchStatistics" :key="item.currencyId">{{ item.currencySymbol }}{{ item.totalAmount }}</span>
</el-descriptions-item>
<el-descriptions-item v-if="showSearch">
<template slot="label"> {{ $t("不含税金额") }}: </template>
<span class="unit" v-for="item in searchStatistics" :key="item.currencyId">{{ item.currencySymbol }}{{ item.notIncludedTaxAmount }}</span>
</el-descriptions-item>
<el-descriptions-item v-if="showSearch">
<template slot="label"> {{ $t("含税金额") }}: </template>
<span class="unit" v-for="item in searchStatistics" :key="item.currencyId">{{ item.currencySymbol }}{{ item.taxAmount }}</span>
</el-descriptions-item>
<el-descriptions-item v-if="showSearch">
<template slot="label"> {{ $t("优惠金额") }}: </template>
<span class="unit" v-for="item in searchStatistics" :key="item.currencyId">{{ item.currencySymbol }}{{ item.discountTotal }}</span>
</el-descriptions-item>
<el-descriptions-item v-if="showSearch">
<template slot="label"> {{ $t("实际金额") }}: </template>
<span class="unit" v-for="item in searchStatistics" :key="item.currencyId">{{ item.currencySymbol }}{{ item.receivableTotalAmount }}</span>
</el-descriptions-item>
<el-descriptions-item v-if="showSearch">
<template slot="label">
<i class="el-icon-office-building"></i>
{{ $t("核销金额") }}:
</template>
<span class="unit" v-for="item in searchStatistics" :key="item.currencyId">{{ item.currencySymbol }}{{ item.writeOffAmount }}</span>
</el-descriptions-item>
<el-descriptions-item v-if="showSearch">
<template slot="label"> {{ $t("未核销金额") }}: </template>
<span class="unit" v-for="item in searchStatistics" :key="item.currencyId">{{ item.currencySymbol }}{{ item.notWriteOffAmount }}</span>
</el-descriptions-item>
</el-descriptions>
<!-- <div class="bar">
<div class="sideBar">
{{ $t("总金额合计") }}:<span class="unit" v-for="item in searchStatistics" :key="item.currencyId">{{ item.currencySymbol }}{{ item.totalAmount }}</span>
</div>
<div class="sideBar">
{{ $t("核销金额合计") }}: <span class="unit" v-for="item in searchStatistics" :key="item.currencyId">{{ item.currencySymbol }}{{ item.writeOffAmount }}</span>
</div>
<div class="sideBar">
{{ $t("未核销金额合计") }}: <span class="unit" v-for="item in searchStatistics" :key="item.currencyId">{{ item.currencySymbol }}{{ item.notWriteOffAmount }}</span>
</div>
</div> -->
<right-toolbar :show-search.sync="showSearch" class="show-bt" @queryTable="getList" />
</div>
<div class="table">
<!-- 礼品列表 -->
<el-table ref="multipleTable" v-loading="loading" :data="list">
<el-table-column width="140" :label="$t('订单号')" align="center" prop="orderNo">
<template v-slot="{ row }">
<router-link :to="{ path: '/order/detail', query: { orderId: row.orderId } }" class="link-type">
<span>{{ row.orderNo }}</span>
</router-link>
</template>
</el-table-column>
<el-table-column :label="$t('运输方式')" align="center">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="scope.row.transportId" />
</template>
</el-table-column>
<el-table-column :label="$t('出货渠道')" align="center">
<template slot-scope="{ row }">
{{ getChannelName(row.channelId) }}
</template>
</el-table-column>
<el-table-column :label="$t('始发地')" :prop="$l('departureWarehouse')">
<!-- {{$l(departure, 'title') || '-'}} -->
</el-table-column>
<el-table-column :label="$t('目的地')" :prop="$l('objectiveWarehouse')" width="300" align="center">
<template slot-scope="{ row }"> {{ $l(row, "destinationCountry") }}/{{ $l(row, "destinationCity") }}/{{ $l(row, "objectiveWarehouse") }} </template>
<!-- {{$l(objective, 'title') || '-'}} -->
</el-table-column>
<el-table-column :label="$t('品名')" width="160" align="center">
<template slot-scope="{ row }">
{{ $l(row, "title") }}
</template>
</el-table-column>
<el-table-column :label="$t('费用来源')">
<template slot-scope="{ row }">
<dict-tag :type="DICT_TYPE.ECW_FEE_SOURCE" :value="row.feeSource" />
</template>
</el-table-column>
<el-table-column :label="$t('箱数/体积/重量')" width="160" align="center">
<template slot-scope="{ row }"> {{ row.num || "-" }} / {{ row.volume || "-" }} / {{ row.weight || "-" }} </template>
</el-table-column>
<el-table-column :label="$t('费用类型')" width="160" align="center">
<template slot-scope="{ row }">
<dict-tag :type="DICT_TYPE.PAYMENT_TYPE" :value="row.collectionType" />/
<dict-tag :type="DICT_TYPE.FEE_TYPE" :value="row.feeType" />
</template>
</el-table-column>
<el-table-column :label="$t('订单状态')">
<!-- {{$l(departure, 'title') || '-'}} -->
<template slot-scope="{ row }">
<dict-tag :type="DICT_TYPE.ORDER_STATUS" :value="row.status" />
</template>
</el-table-column>
<el-table-column :label="$t('单价金额')" prop="unitPrice">
<template slot-scope="{ row }"> {{ row.currencySymbol }}{{ row.unitPrice }} </template>
</el-table-column>
<el-table-column :label="$t('总金额')" prop="totalAmount">
<template slot-scope="{ row }"> {{ row.currencySymbol }} {{ row.totalAmount }} </template>
</el-table-column>
<el-table-column :label="$t('税率')" prop="taxPoint"> </el-table-column>
<!-- 没确定 -->
<el-table-column :label="$t('不含税金额')" prop="notIncludedTaxAmount" width="140" align="center">
<template slot-scope="{ row }"> {{ row.currencySymbol }} {{ row.notIncludedTaxAmount }} </template>
</el-table-column>
<el-table-column :label="$t('含税金额')">
<template slot-scope="{ row }"> {{ row.currencySymbol }} {{ row.taxAmount }} </template>
</el-table-column>
<el-table-column :label="$t('优惠金额')">
<template slot-scope="{ row }"> {{ row.currencySymbol }} {{ row.discountTotal }} </template>
</el-table-column>
<el-table-column :label="$t('实际金额')" prop="receivableTotalAmount">
<template slot-scope="{ row }"> {{ row.currencySymbol }} {{ row.receivableTotalAmount }} </template>
</el-table-column>
<el-table-column :label="$t('关联收款单')" prop="receiptNo" width="160" align="center">
<template slot-scope="{ row }">
<router-link :to="{ path: '/financial/receiptDetail', query: { id: row.receiptId } }" class="link-type">
<span>{{ row.receiptNo }}</span>
</router-link>
</template>
</el-table-column>
<el-table-column :label="$t('核销金额')">
<template slot-scope="{ row }"> {{ row.currencySymbol }} {{ row.writeOffAmount }} </template>
</el-table-column>
<el-table-column :label="$t('未核销金额')" prop="totalAmount" width="160" align="center">
<template slot-scope="{ row }"> {{ row.currencySymbol }} {{ row.notWriteOffAmount }} </template>
</el-table-column>
<el-table-column :label="$t('核销比例')">
<template slot-scope="{ row }">
{{ row.writeOffProportion || 0 }}
</template>
</el-table-column>
<el-table-column :label="$t('关联银行收款明细')" prop="totalAmount" width="160" align="center">
<template slot-scope="{ row }"
><el-button type="text" @click="goBankReceiptDetailsList(row)"> {{ $t("查看收款明细") }}</el-button>
</template>
</el-table-column>
<el-table-column :label="$t('最后修改信息')" prop="totalAmount" width="160" align="center">
<template slot-scope="{ row }"> {{ row.updater || "-" }}/{{ parseTime(row.updateTime) || "-" }} </template>
</el-table-column>
<el-table-column :label="$t('最后审批信息')" prop="totalAmount" width="160" align="center">
<template slot-scope="{ row }"> {{ row.approver || "-" }}/{{ row.approverTime || "-" }} </template>
</el-table-column>
</el-table>
<!-- <div class="mb8 showBar pd-t">
<div class="bar">
<div class="sideBar-bt">
{{ $t("总金额") }}: <span class="unit" v-for="item in totalStatistics" :key="item.currencyId">{{ item.currencySymbol }}{{ item.totalAmount }}</span>
</div>
<div class="sideBar-bt">
{{ $t("不含税金额") }}: <span class="unit" v-for="item in totalStatistics" :key="item.currencyId">{{ item.currencySymbol }}{{ item.notIncludedTaxAmount }}</span>
</div>
<div class="sideBar-bt">
{{ $t("含税金额") }}: <span class="unit" v-for="item in totalStatistics" :key="item.currencyId">{{ item.currencySymbol }}{{ item.taxAmount }}</span>
</div>
<div class="sideBar-bt">
{{ $t("优惠金额") }}: <span class="unit" v-for="item in totalStatistics" :key="item.currencyId">{{ item.currencySymbol }}{{ item.discountTotal }}</span>
</div>
<div class="sideBar-bt">
{{ $t("实际金额") }}: <span class="unit" v-for="item in totalStatistics" :key="item.currencyId">{{ item.currencySymbol }}{{ item.receivableTotalAmount }}</span>
</div>
<div class="sideBar-bt">
{{ $t("核销金额") }}: <span class="unit" v-for="item in totalStatistics" :key="item.currencyId">{{ item.currencySymbol }}{{ item.writeOffAmount }}</span>
</div>
<div class="sideBar-bt">
{{ $t("未核销金额") }}: <span class="unit" v-for="item in totalStatistics" :key="item.currencyId">{{ item.currencySymbol }}{{ item.notWriteOffAmount }}</span>
</div>
</div>
</div> -->
<!-- //分页列表 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :limit.sync="queryParams.rows" @pagination="getList" />
<el-descriptions class="margin-top" :title="$t('总合计信息')" :column="2" :size="size" border>
<template slot="extra">
<el-button type="primary" size="small" @click="totalDetailVisible = !totalDetailVisible">
{{ totalDetailVisible ? $t("隐藏信息") : $t("显示信息") }}
</el-button>
</template>
<el-descriptions-item v-if="totalDetailVisible">
<template slot="label"> {{ $t("总金额") }}: </template>
<span class="unit" v-for="item in totalStatistics" :key="item.currencyId">{{ item.currencySymbol }}{{ item.totalAmount }}</span>
</el-descriptions-item>
<el-descriptions-item v-if="totalDetailVisible">
<template slot="label"> {{ $t("不含税金额") }}: </template>
<span class="unit" v-for="item in totalStatistics" :key="item.currencyId">{{ item.currencySymbol }}{{ item.notIncludedTaxAmount }}</span>
</el-descriptions-item>
<el-descriptions-item v-if="totalDetailVisible">
<template slot="label"> {{ $t("含税金额") }}: </template>
<span class="unit" v-for="item in totalStatistics" :key="item.currencyId">{{ item.currencySymbol }}{{ item.taxAmount }}</span>
</el-descriptions-item>
<el-descriptions-item v-if="totalDetailVisible">
<template slot="label"> {{ $t("优惠金额") }}: </template>
<span class="unit" v-for="item in totalStatistics" :key="item.currencyId">{{ item.currencySymbol }}{{ item.discountTotal }}</span>
</el-descriptions-item>
<el-descriptions-item v-if="totalDetailVisible">
<template slot="label"> {{ $t("实际金额") }}: </template>
<span class="unit" v-for="item in totalStatistics" :key="item.currencyId">{{ item.currencySymbol }}{{ item.receivableTotalAmount }}</span>
</el-descriptions-item>
<el-descriptions-item v-if="totalDetailVisible">
<template slot="label">
<i class="el-icon-office-building"></i>
{{ $t("核销金额") }}:
</template>
<span class="unit" v-for="item in totalStatistics" :key="item.currencyId">{{ item.currencySymbol }}{{ item.writeOffAmount }}</span>
</el-descriptions-item>
<el-descriptions-item v-if="totalDetailVisible">
<template slot="label"> {{ $t("未核销金额") }}: </template>
<span class="unit" v-for="item in totalStatistics" :key="item.currencyId">{{ item.currencySymbol }}{{ item.notWriteOffAmount }}</span>
</el-descriptions-item>
</el-descriptions>
</div>
</div>
</template>
<script>
import { getChannelList } from "@/api/ecw/channel"
import { getWarehouseList } from "@/api/ecw/warehouse"
import { getRegionList } from "@/api/ecw/order"
import { loadCostDetail } from "@/api/ecw/financial"
import Selector from "@/components/Selector"
export default {
name: "EcwFinancialChargedetails",
components: {
Selector
},
data() {
return {
totalDetailVisible: false,
loading: true,
searchStatistics: {}, //查询条件所有
totalStatistics: {}, //当前页所有
showSearch: true,
warehouseList: [], //仓库列表
exportWarehouseList: [], //始发仓列表
countryList: [], //国家列表
channelList: [], // 渠道
cityList: [], //城市列表
objWareHouseList: [], //目的仓列表
list: [],
total: 0,
queryParams: {
page: 1,
rows: 10,
orderNo: "",
transportId: "",
shipmentChannel: [], //出货渠道
departureWareHouseId: [], //始发地
destCountry: [], //目的国
destCity: [],
objectiveWareHouseId: [],
title: "",
feeSource: [],
collectionType: [],
feeType: [],
status: ""
}
}
},
computed: {},
watch: {
"queryParams.destCountry": {
handler(val, oldVal) {
this.queryParams.destCity = []
if (val && val.length > 0) {
this.loadCityList(2, val.join())
} else {
this.loadCityList()
}
}
},
"queryParams.destCity": {
handler(val, oldVal) {
this.queryParams.objectiveWareHouseId = []
if (val.length > 0) {
this.loadWareHouseList(3, val.join())
} else {
this.loadWareHouseList()
}
}
}
},
created() {
//获取仓库渠道
getWarehouseList().then((res) => {
this.warehouseList = res.data
this.exportWarehouseList = this.warehouseList.filter((item) => item.tradeType == 2 || item.tradeType == 3)
})
getChannelList().then((res) => (this.channelList = res.data))
this.init()
this.handleQuery()
},
methods: {
goBankReceiptDetailsList(row) {
this.$router.push({ path: "/financial/BankReceiptDetails", query: { receiptNo: row.receiptNo } })
},
getChannelName(channelId) {
const channel = this.channelList.filter((item) => item.channelId == channelId)
return channel.length > 0 ? this.$l(channel, "name") : "-"
},
init() {
//请求获取国家
this.loadCountyList()
},
//目的地
loadWareHouseList(type = 5, cityId = 5) {
getRegionList(type, cityId)
.then(({ data }) => {
this.objWareHouseList = data
})
.catch((error) => {
console.log(error)
})
},
loadCityList(type = 4, countryId = 4) {
getRegionList(type, countryId)
.then(({ data }) => {
this.cityList = data
})
.catch((error) => {
console.log(error)
})
},
loadCountyList() {
getRegionList(1, 1)
.then(({ data }) => {
this.countryList = data
})
.catch((error) => {
console.log(error)
})
},
resetQuery() {
this.$refs["queryForm"].resetFields()
this.queryParams.page = 1
this.queryParams.rows = 10
this.handleQuery()
},
handleQuery() {
this.loading = true
this.$nextTick(() => {
this.queryParams.page = 1
this.getList()
})
},
async getList() {
const params = this.removeEmpty({ ...this.queryParams })
const { data } = await loadCostDetail(params)
this.list = data.list
this.loading = false
this.searchStatistics = data.searchStatistics
this.totalStatistics = data.totalStatistics
this.total = data.total
}
}
}
</script>
<style lang="scss" scoped>
.margin-top {
margin-top: 40px;
}
.show-bt {
display: flex;
align-items: end;
}
.unit {
margin-right: 10px;
font-size: 12px;
}
.bar {
flex: 1;
flex-wrap: wrap;
display: flex;
}
.showBar {
display: flex;
}
.sideBar {
margin-bottom: 2px;
font-size: 14px;
padding-right: 20px;
width: 50%;
}
.sideBar-bt {
margin-bottom: 2px;
font-size: 14px;
padding-right: 20px;
width: 50%;
}
.inlineForm {
display: flex;
}
.pd-t {
padding-top: 10px;
}
.barTop {
flex: 1;
display: flex;
flex-direction: column;
}
</style>
<template>
<div class="app-container">
<el-card>
<el-form ref="formSearch" :model="formQuery" label-width="100px" label-position="left" :inline="true">
<el-form-item :label="$t('编号') + ':'" style="margin-bottom: 0; margin-top: 20px" label-width="100px" prop="orderNumber">
<el-input v-model="formQuery.orderNumber" style="width: 260px" :placeholder="$t('订单号/提单号')">
<template slot="prepend"> <dict-selector :type="DICT_TYPE.ORDER_QUERY_NO_FIELD" defaultable v-model="formQuery.key" /> </template
></el-input>
</el-form-item>
<el-form-item :label="$t('付款方') + ':'" style="margin-bottom: 0; margin-top: 20px" label-width="100px" prop="payerType">
<el-select style="width: 260px" v-model="formQuery.payerType" clearable>
<el-option :label="$t('发货方')" value="1"></el-option>
<el-option :label="$t('收货方')" value="2"></el-option>
<el-option :label="$t('自定义')" value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('收款日期') + ':'" style="margin-bottom: 0; margin-top: 20px" label-width="100px" prop="timeData">
<el-date-picker v-model="formQuery.timeData" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('收款账号') + ':'" style="margin-bottom: 0; margin-top: 20px" label-width="100px" prop="accountId">
<el-select style="width: 260px" multiple clear v-model="formQuery.accountId" :placeholder="$t('请选择收款账户')">
<el-option v-for="(item, i) in bankData" :key="'opt-code' + i" :label="item.baAccountName + '(' + item.baAccountNum + ')'" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('客户经理') + ':'" style="margin-bottom: 0; margin-top: 20px" label-width="100px" prop="salesmanIds">
<user-selector style="width: 260px" multiple manage v-model="formQuery.salesmanIds" clearable :placeholder="$t('请选择')" />
</el-form-item>
<el-form-item :label="$t('客户') + ':'" style="margin-bottom: 0; margin-top: 20px" label-width="100px" prop="customerName">
<el-input style="width: 260px" v-model="formQuery.customerName" :placeholder="$t('输入客户')"> ></el-input>
</el-form-item>
<el-form-item :label="$t('提交时间') + ':'" style="margin-bottom: 0; margin-top: 20px" label-width="100px" prop="endTimeData">
<el-date-picker v-model="formQuery.endTimeData" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')"></el-date-picker>
</el-form-item>
<el-form-item style="padding-left: 20px; margin-bottom: 0; margin-top: 20px">
<el-button type="primary" icon="el-icon-search" @click="getList">{{ $t("搜索") }}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{ $t("重置") }}</el-button>
</el-form-item>
</el-form>
</el-card>
<el-row :gutter="10" class="mb8 pad-t">
<el-col :span="1.5">
<el-button @click="batchApprove('approval')" type="primary" plain icon="el-icon-plus" size="mini">{{ $t("批量通过") }} </el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" @click="batchApprove('unApproval')" size="mini">{{ $t("批量不通过") }}</el-button>
</el-col>
</el-row>
<el-card>
<el-descriptions class="margin-top barTop" :column="2" border>
<el-descriptions-item>
<template slot="label"> {{ $t("实收金额汇总") }}: </template>
<span class="unit" v-for="item in actualAmountList" :key="item.currencyId">{{ getCurrencySymbol(item.currencyId * 1) }}{{ item.amount }}</span>
</el-descriptions-item>
</el-descriptions>
</el-card>
<div class="tableTop">
<el-table v-loading="loading" :data="receiptApproveList" @selection-change="handleSelectionChange" border>
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column :label="$t('订单号')" width="160" fixed="left" align="center">
<template slot-scope="{ row }">
<div v-for="item in row.orderInfoList" :key="item.orderId">
<router-link :to="`/order/detail?orderId=${item.orderId}`" class="link-type"> {{ item.orderNo }}/{{ item.tidanNo }} </router-link>
<dict-tag :type="DICT_TYPE.ORDER_STATUS" :value="item.status" />
</div>
<!-- <span style="color: #1890ff" @click="paymentDetail2(scope.row)">{{ scope.row.orderNo }}</span> -->
</template>
</el-table-column>
<el-table-column :label="$t('收款单号')" fixed="left" width="160" align="center" prop="receiptNo"> </el-table-column>
<el-table-column :label="$t('付款方')" width="160" align="center">
<template slot-scope="scope">
<span v-if="scope.row.payerType == 3"> {{ $t("自定义") }}</span>
<span v-else> {{ scope.row.payerType == 1 ? $t("发货人") : $t("收货人") }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('费用')" width="160" align="center">
<template slot-scope="{ row }">
<div>
{{ $t("明细") }}:
<span class="feeStatistics" v-for="item in row.feeStatistics.details"> <dict-tag :type="DICT_TYPE.FEE_TYPE" :value="item.feeType" />:{{ item.feeAmount }}</span>
</div>
<div>
{{ $t("汇总") }}:
{{ row.feeStatistics.summary }}
</div>
<div>
{{ $t("结算币种") }}:
{{ row.feeStatistics.baseCurrencySummary }}
</div>
</template>
</el-table-column>
<el-table-column :label="$t('收款日期')" width="160" align="center" prop="amountDate"> </el-table-column>
<el-table-column :label="$t('收款账号')" width="160" align="center" prop="accountName"> </el-table-column>
<el-table-column :label="$t('实收金额')" width="160" align="center" prop="amount" :formatter="formatCurrency"> </el-table-column>
<el-table-column :label="$t('汇率')" width="160" align="center" prop="rate"> </el-table-column>
<el-table-column :label="$t('结算币种金额')" :formatter="formatCurrency" width="160" align="center" prop="writeOffAmount"> </el-table-column>
<el-table-column :label="$t('附件')" width="160" align="center">
<template slot-scope="scope">
<div v-if="scope.row.attr">
<div v-for="url in scope.row.attr.split(',').filter((item) => !!item)">
<el-link :href="url" target="_blank">{{ url.split("/").pop() }}</el-link>
</div>
</div>
</template>
</el-table-column>
<el-table-column :label="$t('备注')" width="160" align="center" prop="remark"> </el-table-column>
<el-table-column :label="$t('客户')" width="160" align="center">
<template v-slot="{ row }">
<router-link :to="`/customer/query/${row.customerId}`" class="link-type">
{{ row.customerName }}
</router-link>
</template>
</el-table-column>
<el-table-column :label="$t('客户经理')" width="160" align="center" prop="salesmanName"> </el-table-column>
<el-table-column :label="$t('提交时间')" width="160" align="center" prop="submitTime"> </el-table-column>
<el-table-column :label="$t('操作')" width="160" fixed="right" align="center">
<template v-slot="{ row }">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleAudit(row)" v-hasPermi="['ecw:collectionApprovalList:update']">{{ $t("审批") }} </el-button>
</template>
</el-table-column>
</el-table>
<el-card>
<el-descriptions class="margin-top barTop" :column="2" border>
<el-descriptions-item>
<template slot="label"> {{ $t("实收金额合计") }}: </template>
<span class="unit" v-for="item in totalActualAmountList" :key="item.currencyId">{{ getCurrencySymbol(item.currencyId * 1) }}{{ item.amount }}</span>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> {{ $t("结算币种金额合计") }}: </template>
<span class="unit" v-for="item in totalWriteOffAmountList" :key="item.currencyId">{{ getCurrencySymbol(item.currencyId * 1) }}{{ item.amount }}</span>
</el-descriptions-item>
</el-descriptions>
</el-card>
<pagination v-show="total > 0" :total="total" :page.sync="formQuery.page" :limit.sync="formQuery.rows" @pagination="handleQuery" />
</div>
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="审批意见" prop="comment">
<el-input v-model="form.comment" style="width: 300px" placeholder="请输入审批意见" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import UserSelector from "@/components/UserSelector/index.vue"
import { getBankAccountPage } from "@/api/ecw/bankAccount"
import { loadReceiptReviewList } from "@/api/ecw/financial"
import { mapGetters } from "vuex"
import { approveTask2, rejectTask2 } from "@/api/bpm/task"
export default {
components: {
UserSelector
},
data() {
return {
total: 0,
bankData: [],
loading: false,
actualAmountList: [],
totalActualAmountList: [],
totalWriteOffAmountList: [],
open: false,
title: "",
receiptApproveList: [],
form: {
//审批意见
comment: undefined
},
ids: [],
rules: {
comment: [
{
required: true,
message: this.$t("审批意见不能为空。"),
trigger: "blur"
}
]
},
formQuery: {
key: "",
orderNumber: "",
payerType: "",
timeData: [],
endTimeData: [],
accountId: [],
salesmanIds: [],
customerName: "",
page: 1,
rows: 10
}
}
},
created() {
this.getBankDataList()
this.handleQuery()
},
computed: {
...mapGetters(["getCurrencySymbol"])
},
methods: {
submitForm() {
this.$refs["form"].validate((valid) => {
if (!valid) {
return
}
//approveTask2
if (this.titleType == 1) {
let p1 = []
for (var i = 0; i < this.ids.length; i++) {
var obj = {}
obj.id = this.ids[i].bmpId
obj.comment = this.form.comment
p1.push(obj)
}
approveTask2(p1).then((response) => {
if (response.data == true) {
this.open = false
this.$modal.msgSuccess(this.$t("批量处理成功"))
this.handleQuery()
} else {
this.open = false
this.$modal.msgSuccess(this.$t("批量处理失败"))
}
})
} else {
let p2 = []
for (var i = 0; i < this.ids.length; i++) {
var obj = {}
obj.id = this.ids[i]
obj.comment = this.form.comment
p2.push(obj)
}
rejectTask2(p2).then((response) => {
if (response.data == true) {
this.open = false
this.$modal.msgSuccess(this.$t("批量处理成功"))
this.handleQuery()
} else {
this.open = false
this.$modal.msgSuccess(this.$t("批量处理失败"))
}
})
}
})
},
cancel() {
this.title = ""
this.open = false
},
// 批量审批
batchApprove(key) {
if (this.ids.length == 0) {
//this.modal.msgSuccess
this.$message.error(this.$t("请选择需要批量不通过的任务。"))
return
}
this.form.comment = ""
if (key == "approval") {
this.title = this.$t("批量通过")
this.titleType = 1
} else {
this.title = this.$t("批量不通过")
this.titleType = 2
}
this.open = true
},
/** 处理审批按钮 */
handleAudit(row) {
this.$router.push({
path: "/bpm/process-instance/detail2",
query: { id: row.bmpId }
})
},
// 用于格式化货币的函数
formatCurrency(row, column, cellValue) {
if (column.property == "writeOffAmount") {
return this.getCurrencySymbol(row.writeOffCurrencyId) + (cellValue || "0")
}
return this.getCurrencySymbol(row.currencyId) + (cellValue || "0")
},
handleSelectionChange(val) {
this.ids = val
},
getList() {
this.formQuery.page = 1
this.handleQuery()
},
async handleQuery() {
this.loading = true
let params = { ...this.formQuery }
this.addBeginAndEndTime(params, this.formQuery.timeData, "CreateTime")
this.addBeginAndEndTime(params, this.formQuery.endTimeData, "AmountDate")
if (params.key && params.orderNumber) {
params[params.key] = params.orderNumber
}
const { data } = await loadReceiptReviewList(params)
this.actualAmountList = data.actualAmount
this.totalActualAmountList = data.totalActualAmount
this.totalWriteOffAmountList = data.totalWriteOffAmount
this.loading = false
this.receiptApproveList = data.list
this.total = data.total
console.log("99999", data)
},
resetQuery() {
this.formQuery = {
key: "",
orderNumber: "",
payerType: "",
timeData: [],
endTimeData: "",
accountId: [],
salesmanIds: [],
customerName: "",
page: 1,
rows: 10
}
},
getBankDataList() {
getBankAccountPage({ pageNo: 1, pageSize: 1000 }).then((res) => {
this.bankData = res.data.list
})
}
}
}
</script>
<style lang="scss" scoped>
.feeStatistics {
padding: 0 6px;
}
.pad-t {
padding: 10px 0;
}
.unit {
padding-left: 10px;
}
</style>
<template>
<div class="app-container">
<el-dialog :before-close="hiddenDialog" :visible.sync="openBankReceiptsDetailItemDialog" :title="dialogTitle" width="50%" append-to-body>
<div style="padding: 0 24px">
<el-form :disabled="statusKey == 'view'" ref="addForm" :model="bankReceiptDetails" label-width="250px">
<el-form-item :label="$t('流水号')">{{ dialogTitle }}--{{ bankReceiptDetails.serialNumber }}</el-form-item>
<el-form-item :label="$t('收款单号')">{{ bankReceiptDetails.receiptNo }}</el-form-item>
<el-form-item :label="$t('剩余应收金额')">
<span> {{ bankReceiptDetails.syValue }} </span>
</el-form-item>
<el-form-item
:label="$t('收款账户')"
prop="accountNo"
:rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('收款账户不能为空')
}"
>
<el-select filterable clear v-model="bankReceiptDetails.accountId" :placeholder="$t('请选择收款账户')" style="width: 250px" @change="accountChange">
<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="$t('实收日期')"
prop="amountDate"
:rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('实收日期不能为空')
}"
>
<el-date-picker v-if="statusKey != 'view'" clearable v-model="bankReceiptDetails.amountDate" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" :placeholder="$t('选择实收日期')" />
<span v-else>{{ bankReceiptDetails.amountDate }}</span>
</el-form-item>
<div style="display: flex">
<el-form-item
:label="$t('实收')"
prop="amount"
:rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('实收不能为空')
}"
>
<el-input v-if="statusKey != 'view'" v-model="bankReceiptDetails.amount" style="width: 220px; margin-right: 12px" @change="setWriteOffAmount('input')"></el-input>
<span v-else>{{ bankReceiptDetails.amount }}</span>
</el-form-item>
<el-form-item
label-width="0px"
prop="currencyId"
:rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('币种不能为空')
}"
>
<el-select v-model="bankReceiptDetails.currencyId" :placeholder="$t('请选择')" @change="(val) => currencyIdChange(val)">
<el-option v-for="item in currencyList" :key="item.id" :label="$i18n.locale == 'zh_CN' ? item.titleZh : item.titleEn" :value="item.id" />
</el-select>
</el-form-item>
</div>
<el-form-item
v-if="bankReceiptDetails.writeOffCurrencyId != bankReceiptDetails.currencyId"
prop="rate"
:rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('兑核销基准币种汇率不能为空')
}"
>
<template slot="label">
<span :title="$t('实收币种与核销基准币种一样时,无需填写汇率,不一样需要填写汇率')">{{ $t("兑核销基准币种汇率") }}{{ getCurrencyLabel(bankReceiptDetails.writeOffCurrencyId) }}</span>
</template>
<el-input v-if="statusKey != 'view'" v-model="bankReceiptDetails.rate" style="width: 220px"></el-input>
<span v-else>{{ bankReceiptDetails.rate }}</span>
</el-form-item>
<el-form-item v-if="bankReceiptDetails.writeOffCurrencyId != bankReceiptDetails.currencyId">
<template slot="label"> {{ $t("兑核销基准币种金额") }}{{ getCurrencyLabel(bankReceiptDetails.writeOffCurrencyId) }}</template>
<span>{{ bankReceiptDetails.writeOffAmount ? parseFloat(bankReceiptDetails.writeOffAmount).toFixed(2) : "" }}</span>
</el-form-item>
<el-form-item :label="$t('水单附件')" prop="attr">
<el-upload v-if="statusKey != 'view'" class="upload-demo" :action="uploadFileUrl" :headers="headers" :on-success="handleUploadSuccess" :before-upload="handleBeforeUpload" :on-error="handleUploadError" :before-remove="beforeRemove" :file-list="bankReceiptDetails.attr" multiple>
<el-button size="small" type="primary">{{ $t("上传附件") }}</el-button>
</el-upload>
<div v-else>
<div v-for="(v, i) in bankReceiptDetails.attr" :key="i">
<el-link :href="v.url" type="primary" target="_blank">{{ v.name }}</el-link>
</div>
</div>
</el-form-item>
<el-form-item>
<template slot="label"> {{ $t("备注") }} </template>
<div>
<el-input v-if="statusKey != 'view'" type="textarea" :autosize="{ minRows: 2, maxRows: 4 }" :placeholder="$t('请输入内容')" v-model="bankReceiptDetails.remark"></el-input>
<span v-else>{{ bankReceiptDetails.remark }}</span>
</div>
</el-form-item>
<div class="title">
{{ $t("应收明细") }}
</div>
<div class="detail">
<div class="detailItem" v-if="statusKey != 'view'">
<el-descriptions :column="4" border class="card detailLeft" v-if="bankReceiptDetails.writeOffAmount">
<el-descriptions-item
:label="
$t('基准金额{currency}', {
currency: getCurrencyLabel(bankReceiptDetails.writeOffCurrencyId)
})
"
>
{{ bankReceiptDetails.writeOffAmount }}
</el-descriptions-item>
<el-descriptions-item :label="$t('已填写核销金额')"> {{ bankReceiptDetails.currentWriteOffAmount || 0 }} </el-descriptions-item>
<el-descriptions-item label-class-name="warnColor" content-class-name="warnColor" :label="$t('未填写核销金额')"> {{ bankReceiptDetails.remainingWriteOffAmount || 0 }} </el-descriptions-item>
</el-descriptions>
<div class="detailBtn" v-if="bankReceiptDetails.writeOffAmount">
<el-button size="small" :disabled="statusKey == 'view'" type="primary" @click="autoFillWriteOffAmount">{{ $t("自动填写") }}</el-button>
</div>
</div>
<el-table border :data="bankReceiptDetails.receivableList">
<el-table-column prop="incomeType" :label="$t('类型')" width="120">
<template slot-scope="{ row }">
<div>
<dict-tag :type="DICT_TYPE.FEE_TYPE" :value="row.feeType" />
</div>
</template>
</el-table-column>
<el-table-column prop="actualAmount" :label="$t('实际金额')" width="120" :formatter="formatCurrency"></el-table-column>
<el-table-column
prop="exchangeRate"
:label="
$t('基准币种({currency})汇率', {
currency: getBaseCurrencynName(bankReceiptDetails.writeOffCurrencyId)
})
"
>
</el-table-column>
<el-table-column
prop="baseAmount"
:label="
$t('基准金额({currency})', {
currency: getBaseCurrencynName(bankReceiptDetails.writeOffCurrencyId)
})
"
width="120"
:formatter="formatCurrency"
></el-table-column>
<el-table-column
prop="writeOffAmountUsd"
v-if="statusKey != 'view'"
:label="
$t('已核销金额({currency})', {
currency: getBaseCurrencynName(bankReceiptDetails.writeOffCurrencyId)
})
"
:formatter="formatCurrency"
></el-table-column>
<el-table-column
v-if="statusKey != 'view'"
:label="
$t('剩余核销金额({currency})', {
currency: getBaseCurrencynName(bankReceiptDetails.writeOffCurrencyId)
})
"
width="120"
>
<template v-slot="{ row }">
<div :class="{ warnColor: row.notWriteOffAmountUsd < 0 }">{{ getCurrencySymbol(row.baseCurrencyId) }} {{ row.notWriteOffAmountUsd }}</div>
</template>
</el-table-column>
<!-- 本次核销金额(美元) -->
<el-table-column
:label="
$t('本次核销金额({currency})', {
currency: getBaseCurrencynName(bankReceiptDetails.writeOffCurrencyId)
})
"
>
<template slot-scope="scope">
<el-input-number @change="changeCurrentItemWirteOff(scope.row.id)" v-if="statusKey != 'view' && bankReceiptDetails.writeOffAmount" :min="0" :precision="2" :controls="false" v-model="scope.row.writeOffAmount"></el-input-number>
<span v-else>{{ scope.row.writeOffAmount }}</span>
</template>
<!-- writeOffAmount -->
</el-table-column>
</el-table>
<!-- 应收明细列表弹窗 -->
</div>
</el-form>
</div>
<div slot="footer" v-if="statusKey != 'view'">
<el-button type="primary" @click="saveFrom">{{ $t("编辑") }}</el-button>
<el-button @click="hiddenDialog">{{ $t("取消") }}</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getBankAccountPage } from "@/api/ecw/bankAccount"
import { getReceivableItem2, updateReceiptItem, receiptItemCreate, loadBankReceiptItemListByID } from "@/api/ecw/financial"
import { getExchangeRatePage } from "@/api/ecw/exchangeRate"
import { getToken } from "@/utils/auth"
import { getCurrencyPage } from "@/api/ecw/currency"
import { mapGetters } from "vuex"
import NP from "number-precision"
export default {
name: "BankReceiptsDetailItem",
props: {
statusKey: {
type: String,
default: ""
},
openBankReceiptsDetailItemDialog: {
type: Boolean,
default: false
},
bankReceiptId: {
type: [String, Number],
default: ""
}
},
watch: {
openBankReceiptsDetailItemDialog(val, old) {
this.getBankReceiptsDetails()
},
statusKey(val, old) {
if (val == "edit") {
// this.getBankReceiptsDetails()
this.dialogTitle = this.$t("编辑银行实收明细")
} else {
// this.getBankReceiptsDetails()
this.dialogTitle = this.$t("银行实收明细详情")
}
},
"bankReceiptDetails.rate"() {
this.setWriteOffAmount()
}
},
data() {
return {
NP,
uploadFileUrl: process.env.VUE_APP_BASE_API + "/app-api/file/upload",
headers: {
Authorization: "Bearer " + getToken()
},
bankData: [],
currencyList: [],
dialogTitle: "",
rateList: [],
bankReceiptDetails: {},
codePage: {
pageNo: 1,
pageSize: 1000,
page: 1,
rows: 1000
}
}
},
created() {
getCurrencyPage(this.codePage).then((res) => (this.currencyList = res.data.list))
getExchangeRatePage(this.codePage).then((res) => (this.rateList = res.data.list))
getBankAccountPage(this.codePage).then((res) => {
this.bankData = res.data.list
})
},
computed: {
...mapGetters(["getCurrencySymbol", "getCurrencyData"]),
getBaseCurrencynName() {
return (currencyId) => {
if (currencyId) {
return this.$l(this.getCurrencyData(currencyId), "title")
}
return "XX"
}
}
},
methods: {
// 获取应收明细
getReceiptDetails() {
let id = this.bankReceiptId
let currentTotal = 0
loadBankReceiptItemListByID({ receiptItemId: id }).then((res) => {
this.bankReceiptDetails.receivableList = res.data
this.bankReceiptDetails.receivableList.forEach((item) => {
currentTotal += item.writeOffAmount
})
if (currentTotal > this.bankReceiptDetails.writeOffAmount) {
this.$modal.msgError(this.$t("本次实收基准金额小于上次填写核销金额总额,请注意"))
}
// this.bankReceiptDetails.receivableList.forEach((item) => {
// 未填写实收
this.bankReceiptDetails.remainingWriteOffAmount = NP.minus(this.bankReceiptDetails.writeOffAmount, currentTotal)
// 已填写核销金额
this.bankReceiptDetails.currentWriteOffAmount = currentTotal
// })
})
},
// 自动填充
autoFillWriteOffAmount() {
let id = this.bankReceiptId
loadBankReceiptItemListByID({ receiptItemId: id }).then((res) => {
let currentTotal = 0
this.bankReceiptDetails.receivableList = res.data
this.bankReceiptDetails.receivableList.forEach((item) => {
currentTotal += item.writeOffAmount
})
if (currentTotal > this.bankReceiptDetails.writeOffAmount) {
this.$modal.msgError(this.$t("本次实收基准金额小于上次填写核销金额总额,请注意"))
}
// this.bankReceiptDetails.receivableList.forEach((item) => {
// 未填写实收
this.bankReceiptDetails.remainingWriteOffAmount = NP.minus(this.bankReceiptDetails.writeOffAmount, currentTotal)
// 已填写核销金额
this.bankReceiptDetails.currentWriteOffAmount = currentTotal
// })
// this.bankReceiptItemList.forEach((item) => {
// currentTotal += item.writeOffAmount
// })
// if (currentTotal > this.addForm.writeOffAmount) {
// this.$modal.msgError(this.$t("本次实收基准金额小于上次填写核销金额总额,请注意"))
// }
// this.bankReceiptItemList.forEach((item) => {
// // 未填写实收
// this.addForm.remainingWriteOffAmount = NP.minus(this.addForm.writeOffAmount, currentTotal)
// // 已填写核销金额
// this.addForm.currentWriteOffAmount = currentTotal
// })
this.autoFillCalculate()
})
},
autoFillCalculate() {
let writeOffAmount = this.bankReceiptDetails.writeOffAmount
// 已填写核销金额
let totalWriteOffAmountUsd = this.bankReceiptDetails.currentWriteOffAmount
// 未填写核销金额
let remainingWriteOffAmount = this.bankReceiptDetails.remainingWriteOffAmount
this.bankReceiptDetails.receivableList.forEach((item) => {
// baseAmount 基准金额 writeOffAmountUsd 已核销金额, notWriteOffAmountUsd剩余未核销
if (item.notWriteOffAmountUsd > 0 && writeOffAmount && writeOffAmount > 0 && writeOffAmount >= item.notWriteOffAmountUsd) {
// 本次核销金额
item.writeOffAmount = NP.minus(item.baseAmount, item.writeOffAmountUsd)
// 总核销实收剩余
writeOffAmount = NP.minus(writeOffAmount, item.writeOffAmount)
//剩余未核销
item.notWriteOffAmountUsd = 0
//未填写实收
// this.bankReceiptDetails.remainingWriteOffAmount = writeOffAmount
} else if (writeOffAmount && writeOffAmount > 0 && writeOffAmount < item.notWriteOffAmountUsd) {
item.writeOffAmount = writeOffAmount
item.notWriteOffAmountUsd = NP.minus(item.baseAmount, item.writeOffAmountUsd, item.writeOffAmount)
writeOffAmount = 0
// this.bankReceiptDetails.remainingWriteOffAmount = writeOffAmount
} else {
item.writeOffAmount = 0
}
})
// 未填写实收
this.bankReceiptDetails.remainingWriteOffAmount = writeOffAmount
// 已填写核销金额
this.bankReceiptDetails.currentWriteOffAmount = NP.minus(this.bankReceiptDetails.writeOffAmount, writeOffAmount)
},
changeCurrentItemWirteOff(id) {
let currentTotal = 0
this.$nextTick(() => {
this.bankReceiptDetails.receivableList.forEach((item) => {
currentTotal += item.writeOffAmount
})
if (currentTotal > this.bankReceiptDetails.writeOffAmount) {
this.$modal.msgError(this.$t("填写核销金额总额大于本次实收基准金额,请重新填写"))
}
this.bankReceiptDetails.receivableList.forEach((item) => {
if (item.id == id) {
if (currentTotal > this.bankReceiptDetails.writeOffAmount) {
item.writeOffAmount = 0
} else {
// 未填写实收
this.bankReceiptDetails.remainingWriteOffAmount = NP.minus(this.bankReceiptDetails.writeOffAmount, currentTotal)
// 已填写核销金额
this.bankReceiptDetails.currentWriteOffAmount = currentTotal
}
}
})
})
},
hiddenDialog() {
this.$emit("update:openBankReceiptsDetailItemDialog", false)
},
saveFrom() {
const params = { ...this.bankReceiptDetails }
params.receivableWriteOffList = []
try {
let totalInput = 0
this.bankReceiptDetails.receivableList.map((item) => {
totalInput += item.writeOffAmount
if (!isNumberStr(item.writeOffAmount)) {
this.$modal.msgError(this.$t(`请输入明细核销金额`))
throw new Error("Exit loop")
}
if (isNumberStr(item.writeOffAmount) && item.writeOffAmount > 0) {
params.receivableWriteOffList.push({
receivableId: item.id,
writeOffAmount: item.writeOffAmount
})
}
})
if (this.bankReceiptDetails.remainingWriteOffAmount != 0) {
this.$modal.msgError(this.$t(`未填写核销金额>0 ,请检查`))
throw new Error("Exit loop")
}
if (totalInput > this.bankReceiptDetails.writeOffAmount) {
this.$modal.msgError(this.$t(`本次填写核销金额总数大于实收基准金额`))
throw new Error("Exit loop")
}
} catch (e) {
return
}
this.$refs.addForm.validate((valid) => {
if (valid) {
// if (this.addForm.id) {
params.attr && (params.attr = params.attr.map((v) => v.url).join(","))
updateReceiptItem(params).then((res) => {
this.$modal.msgSuccess(this.$t("修改成功"))
// this.openAddDialog = false
this.hiddenDialog()
this.getList()
})
}
})
},
setWriteOffAmount(key = "") {
console.log("ksnjsnasjn")
let pointArr = []
let regs = /^[0-9]+\d*(\.\d*)?$|^0?\.\d*[0-9]\d*$/
if (this.bankReceiptDetails.amount && !regs.test(this.bankReceiptDetails.amount)) {
this.bankReceiptDetails.amount = ""
this.$modal.msgError(this.$t("输入金额不对"))
} else {
if (this.bankReceiptDetails && this.bankReceiptDetails.amount) {
pointArr = this.bankReceiptDetails.amount.toString().split(".")
if (pointArr.length > 1 && pointArr[1]) {
this.bankReceiptDetails.amount = Math.round(this.bankReceiptDetails.amount * 100) / 100
}
}
}
this.$set(this.bankReceiptDetails, "writeOffAmount", Math.round(NP.times(this.bankReceiptDetails.rate || 0, this.bankReceiptDetails.amount || 0)), 2)
//已填写核销金额
this.$set(this.bankReceiptDetails, "currentWriteOffAmount", 0)
// 剩余核销金额
this.$set(this.bankReceiptDetails, "remainingWriteOffAmount", NP.times(this.bankReceiptDetails.rate || 0, this.bankReceiptDetails.amount || 0))
this.getReceiptDetails()
},
//币种更改
currencyIdChange(val) {
val = Number(val)
let rate
if (val === this.bankReceiptDetails.writeOffCurrencyId) {
rate = 1
} else {
rate = this.getRate(val, this.bankReceiptDetails.writeOffCurrencyId)
}
this.$set(this.bankReceiptDetails, "rate", rate)
},
//获取汇率
getRate(sourceCurrencyId, targetCurrencyId) {
let rate = this.rateList.find((v) => v.sourceCurrencyId === sourceCurrencyId && v.targetCurrencyId === targetCurrencyId)
if (rate) return rate.currencyRate
return ""
},
getCurrencyLabel(id) {
let label = this.currencyList.filter((item) => item.id == id)
if (label.length > 0) return this.$i18n.locale == "zh_CN" ? label[0].titleZh : label[0].titleEn
return ""
},
formatCurrency(row, column, cellValue) {
if (column.property == "writeOffAmount") {
return this.getCurrencySymbol(row.writeOffCurrencyId) + (cellValue || "0")
}
return this.getCurrencySymbol(row.currencyId) + (cellValue || "0")
},
//银行账号变动
accountChange(val) {
let data = this.bankData.find((item) => item.id == val)
this.$set(this.bankReceiptDetails, "accountName", data.baAccountName || "")
this.$set(this.bankReceiptDetails, "accountNo", data.baAccountNum || "")
this.$set(this.bankReceiptDetails, "accountBankName", data.baBankName || "")
},
getBankReceiptsDetails() {
let id = this.bankReceiptId
let currentTotal = 0
getReceivableItem2(id).then((response) => {
this.bankReceiptDetails = response.data
if (this.bankReceiptDetails.attr === "") {
this.bankReceiptDetails.attr = []
}
loadBankReceiptItemListByID({ receiptItemId: id }).then((res) => {
this.bankReceiptDetails.receivableList = res.data
this.bankReceiptDetails.receivableList.forEach((item) => {
currentTotal += item.writeOffAmount
})
if (currentTotal > this.bankReceiptDetails.writeOffAmount) {
this.$modal.msgError(this.$t("本次实收基准金额小于上次填写核销金额总额,请注意"))
}
// this.bankReceiptDetails.receivableList.forEach((item) => {
// 未填写实收
this.bankReceiptDetails.remainingWriteOffAmount = NP.minus(this.bankReceiptDetails.writeOffAmount, currentTotal)
// 已填写核销金额
this.bankReceiptDetails.currentWriteOffAmount = currentTotal
// })
})
})
},
//上传
handleUploadSuccess(res, file, fileList) {
let arr = []
setTimeout(() => {
fileList.forEach((item) => {
arr.push({
name: item.name,
url: item.response ? item.response.data : item.url
})
})
this.bankReceiptDetails.attr = arr
}, 300)
this.loading.close()
},
handleBeforeUpload() {
this.loading = this.$loading({
lock: true,
text: this.$t("上传中"),
background: "rgba(0, 0, 0, 0.7)"
})
},
handleUploadError() {
this.$message({
type: "error",
message: this.$t("上传失败")
})
this.loading.close()
},
beforeRemove(file, fileList) {
return this.$confirm(this.$t("确定移除") + "?").then((res) => {
setTimeout(() => {
this.bankReceiptDetails.attr = fileList.map((v) => ({
name: v.name,
url: v.response ? v.response.data : v.url
}))
}, 300)
})
}
}
}
</script>
<style scoped>
.detailItem {
display: flex;
}
.detailLeft {
flex: 1;
padding-right: 20px;
}
.detailBtn {
margin-top: 20px;
}
::v-deep .warnColor {
color: red;
}
</style>
<template> <template>
<div class="app-container"> <div class="app-container">
<el-descriptions :column="4"> <el-descriptions :column="4">
<el-descriptions-item :label="$t('收款单编号')">{{ <el-descriptions-item :label="$t('收款单编号')">{{ form.receiptNo }}</el-descriptions-item>
form.receiptNo <el-descriptions-item :label="$t('客户')">{{ form.customerName }}</el-descriptions-item>
}}</el-descriptions-item>
<el-descriptions-item :label="$t('客户')">{{
form.customerName
}}</el-descriptions-item>
<el-descriptions-item :label="$t('创建时间')"> <el-descriptions-item :label="$t('创建时间')">
<template> <template>
<span>{{ parseTime(form.createTime, "{y}-{m}-{d}") }}</span> <span>{{ parseTime(form.createTime, "{y}-{m}-{d}") }}</span>
</template></el-descriptions-item </template></el-descriptions-item
> >
<el-descriptions-item :label="$t('业务员')">{{ <el-descriptions-item :label="$t('业务员')">{{ form.salesmanName }}</el-descriptions-item>
form.salesmanName <el-descriptions-item v-if="reason" :label="$t('申请理由')">{{ reason }}</el-descriptions-item>
}}</el-descriptions-item>
<el-descriptions-item v-if="reason" :label="$t('申请理由')">{{
reason
}}</el-descriptions-item>
</el-descriptions> </el-descriptions>
<div class="btn"> <div class="btn">
<el-table ref="multipleTable" :data="detailed" border row-key="id"> <el-table ref="multipleTable" :data="detailed" border row-key="id">
<!-- <el-table-column :label="$t('序号')" type="index" align="center" width="50"></el-table-column> --> <!-- <el-table-column :label="$t('序号')" type="index" align="center" width="50"></el-table-column> -->
<el-table-column <el-table-column :label="$t('收款账户')" align="center" prop="accountName" />
:label="$t('收款账户')"
align="center"
prop="accountName"
/>
<el-table-column :label="$t('实收金额')" align="center" prop="amount" /> <el-table-column :label="$t('实收金额')" align="center" prop="amount" />
<el-table-column :label="$t('实收币种')" align="center" prop="marks"> <el-table-column :label="$t('实收币种')" align="center" prop="marks">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -35,29 +23,19 @@ ...@@ -35,29 +23,19 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('汇率')" align="center" prop="rate" /> <el-table-column :label="$t('汇率')" align="center" prop="rate" />
<el-table-column align="center" prop="writeOffAmount"> <el-table-column align="center" prop="writeOffAmount">
<template #header> <template #header> {{ $t("兑核销基准金额") }}{{ getCurrencyLabel(showCurrencyId) }} </template>
{{ $t("兑核销基准金额") }}{{ getCurrencyLabel(showCurrencyId) }}
</template>
</el-table-column>
<el-table-column
:label="$t('实收日期')"
align="center"
prop="amountDate"
>
</el-table-column> </el-table-column>
<el-table-column :label="$t('实收日期')" align="center" prop="amountDate"> </el-table-column>
<el-table-column :label="$t('水单号')" align="center" prop="billNo" /> <el-table-column :label="$t('水单号')" align="center" prop="billNo" />
<el-table-column :label="$t('水单附件')" align="center" prop="attr"> <el-table-column :label="$t('水单附件')" align="center" prop="attr">
<template slot-scope="scope" v-if="scope.row.attr"> <template slot-scope="scope" v-if="scope.row.attr">
<div v-for="(v, i) in scope.row.attr" :key="i"> <div v-for="(v, i) in scope.row.attr" :key="i">
<el-link :href="v.url" type="primary" target="_blank">{{ <el-link :href="v.url" type="primary" target="_blank">{{ v.name }}</el-link>
v.name
}}</el-link>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<el-card class="card"> <el-card class="card">
<div class="btn"> <div class="btn">
<!--链接到收款单详情页面 lanbm 2024-05-24 add--> <!--链接到收款单详情页面 lanbm 2024-05-24 add-->
...@@ -78,26 +56,16 @@ ...@@ -78,26 +56,16 @@
@click="openAddDialog=true" @click="openAddDialog=true"
>{{ $t('查看银行实收明细')}}</el-button> >{{ $t('查看银行实收明细')}}</el-button>
</div>--> </div>-->
<el-dialog <el-dialog v-if="openAddDialog" :visible.sync="openAddDialog" :title="this.$t('银行实收明细详情')" width="50%" append-to-body>
v-if="openAddDialog"
:visible.sync="openAddDialog"
:title="this.$t('银行实收明细详情')"
width="50%"
append-to-body
>
<div style="padding: 0 24px"> <div style="padding: 0 24px">
<el-form ref="addForm" :model="addForm" label-width="250px"> <el-form ref="addForm" :model="addForm" label-width="250px">
<el-form-item :label="$t('收款单号') + ':'">{{ <el-form-item :label="$t('收款单号') + ':'">{{ form.receiptNo }}</el-form-item>
form.receiptNo
}}</el-form-item>
<el-form-item :label="$t('剩余应收金额') + ':'"> <el-form-item :label="$t('剩余应收金额') + ':'">
<template> <template>
<div v-if="surplusData.length == 0">0</div> <div v-if="surplusData.length == 0">0</div>
<div v-else> <div v-else>
<div v-for="(amount, currency) in surplusData" :key="currency"> <div v-for="(amount, currency) in surplusData" :key="currency">
<span v-if="amount"> <span v-if="amount"> {{ amount }}{{ getCurrencyLabel(currency) }}</span>
{{ amount }}{{ getCurrencyLabel(currency) }}</span
>
</div> </div>
</div> </div>
</template> </template>
...@@ -113,18 +81,8 @@ ...@@ -113,18 +81,8 @@
><span>{{ addForm.amount }}</span></el-form-item ><span>{{ addForm.amount }}</span></el-form-item
> >
<el-form-item label-width="0px" prop="currencyId"> <el-form-item label-width="0px" prop="currencyId">
<el-select <el-select v-model="addForm.currencyId" :placeholder="$t('请选择')" :disabled="true" @change="(val) => currencyIdChange(val)">
v-model="addForm.currencyId" <el-option v-for="item in currencyList" :key="item.id" :label="$i18n.locale == 'zh_CN' ? item.titleZh : item.titleEn" :value="item.id" />
:placeholder="$t('请选择')"
:disabled="true"
@change="(val) => currencyIdChange(val)"
>
<el-option
v-for="item in currencyList"
:key="item.id"
:label="$i18n.locale == 'zh_CN' ? item.titleZh : item.titleEn"
:value="item.id"
/>
</el-select> </el-select>
<!-- <dict-selector v-if="!isView" :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" v-model="addForm.currencyId" @change="val => currencyIdChange(val)"/> --> <!-- <dict-selector v-if="!isView" :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" v-model="addForm.currencyId" @change="val => currencyIdChange(val)"/> -->
<!-- <span v-else>{{ addForm.currencyId }}</span> --> <!-- <span v-else>{{ addForm.currencyId }}</span> -->
...@@ -133,37 +91,18 @@ ...@@ -133,37 +91,18 @@
</div> </div>
<el-form-item v-if="showCurrencyId != addForm.currencyId" prop="rate"> <el-form-item v-if="showCurrencyId != addForm.currencyId" prop="rate">
<template slot="label"> <template slot="label">
<span <span :title="$t('实收币种与核销基准币种一样时,无需填写汇率,不一样需要填写汇率')">{{ $t("兑核销基准币种汇率") }}{{ getCurrencyLabel(showCurrencyId) }}</span>
:title="
$t(
'实收币种与核销基准币种一样时,无需填写汇率,不一样需要填写汇率'
)
"
>{{ $t("兑核销基准币种汇率") }}{{
getCurrencyLabel(showCurrencyId)
}}</span
>
</template> </template>
<span>{{ addForm.rate }}</span> <span>{{ addForm.rate }}</span>
</el-form-item> </el-form-item>
<el-form-item v-if="showCurrencyId != addForm.currencyId"> <el-form-item v-if="showCurrencyId != addForm.currencyId">
<template slot="label"> <template slot="label"> {{ $t("兑核销基准币种金额") }}{{ getCurrencyLabel(showCurrencyId) }}: </template>
{{ $t("兑核销基准币种金额") }}{{ <span>{{ addForm.writeOffAmount ? parseFloat(addForm.writeOffAmount).toFixed(6) : "" }}</span>
getCurrencyLabel(showCurrencyId)
}}:
</template>
<span>{{
addForm.writeOffAmount
? parseFloat(addForm.writeOffAmount).toFixed(6)
: ""
}}</span>
</el-form-item> </el-form-item>
<el-form-item :label="$t('水单附件') + ':'" prop="attr"> <el-form-item :label="$t('水单附件') + ':'" prop="attr">
<div v-if="addForm.attr.length > 0"> <div v-if="addForm.attr.length > 0">
<div v-for="(v, i) in addForm.attr" :key="i"> <div v-for="(v, i) in addForm.attr" :key="i">
<el-link :href="v.url" type="primary" target="_blank">{{ <el-link :href="v.url" type="primary" target="_blank">{{ v.name }}</el-link>
v.name
}}</el-link>
</div> </div>
</div> </div>
<div v-else>{{ $t("") }}</div> <div v-else>{{ $t("") }}</div>
...@@ -178,24 +117,18 @@ ...@@ -178,24 +117,18 @@
</template> </template>
<script> <script>
import { getCustomer } from "@/api/ecw/customer"; import { getCustomer } from "@/api/ecw/customer"
import { import { getReceiptInfoByIds, getReceivableItem, getInvoicingItem, getReceiptAccountList, getReceiptApprove } from "@/api/ecw/financial"
getReceiptInfoByIds, import { getCurrencyPage } from "@/api/ecw/currency"
getReceivableItem, import NP from "number-precision"
getInvoicingItem, import receiptDetail from "@/views/ecw/financial/receiptDetail2"
getReceiptAccountList,
getReceiptApprove,
} from "@/api/ecw/financial";
import { getCurrencyPage } from "@/api/ecw/currency";
import NP from "number-precision";
import receiptDetail from "@/views/ecw/financial/receiptDetail2";
export default { export default {
props: { props: {
id: [String, Number], id: [String, Number]
}, },
components: { components: {
receiptDetail, receiptDetail
}, },
data() { data() {
return { return {
...@@ -212,20 +145,20 @@ export default { ...@@ -212,20 +145,20 @@ export default {
receiptId: 0, receiptId: 0,
receiptItemId: 0, receiptItemId: 0,
reason: "", reason: "",
receiptAccountList: [], receiptAccountList: []
}; }
}, },
watch: { watch: {
id() { id() {
this.getCurrencyData(); this.getCurrencyData()
}, },
currencyList() { currencyList() {
this.getData(); this.getData()
}, },
form() { form() {
this.getList(); this.getList()
this.getListData(); this.getListData()
}, }
}, },
computed: { computed: {
businessKeyToComponent() { businessKeyToComponent() {
...@@ -233,32 +166,32 @@ export default { ...@@ -233,32 +166,32 @@ export default {
component: () => import("@/views/ecw/financial/receiptDetail"), component: () => import("@/views/ecw/financial/receiptDetail"),
id: this.receiptId, id: this.receiptId,
name: "receiptDetail", name: "receiptDetail",
path: "receiptDetail", path: "receiptDetail"
}; }
return page; return page
}, }
}, },
created() { created() {
if (this.id) { if (this.id) {
this.getCurrencyData(); this.getCurrencyData()
} }
}, },
methods: { methods: {
getData() { getData() {
getReceiptApprove(this.id).then((res) => { getReceiptApprove(this.id).then((res) => {
if (res.data.receiptId) { if (res.data.receiptId) {
this.receiptId = res.data.receiptId; this.receiptId = res.data.receiptId
this.receiptItemId = res.data.receiptItemId; this.receiptItemId = res.data.receiptItemId
this.reason = res.data.reason; this.reason = res.data.reason
this.getReceiptInfo(); this.getReceiptInfo()
} }
}); })
}, },
// 获取汇率 // 获取汇率
getCurrencyData() { getCurrencyData() {
getCurrencyPage(this.params).then((res) => { getCurrencyPage(this.params).then((res) => {
this.currencyList = res.data.list; this.currencyList = res.data.list
}); })
}, },
getList() { getList() {
getReceivableItem({ id: this.receiptId }).then((res) => { getReceivableItem({ id: this.receiptId }).then((res) => {
...@@ -267,150 +200,118 @@ export default { ...@@ -267,150 +200,118 @@ export default {
amountDate: this.parseTime(v.amountDate, "{y}-{m}-{d}"), amountDate: this.parseTime(v.amountDate, "{y}-{m}-{d}"),
accountNo: +v.accountNo, accountNo: +v.accountNo,
rate: parseFloat(v.rate).toFixed(6), rate: parseFloat(v.rate).toFixed(6),
attr: v.attr attr: v.attr ? v.attr.split(",").map((t) => ({ name: t.slice(t.lastIndexOf("/") + 1), url: t })) : []
? v.attr }))
.split(",") this.addForm = this.detatilData.find((v) => v.id == this.receiptItemId)
.map((t) => ({ name: t.slice(t.lastIndexOf("/") + 1), url: t })) this.detailed = []
: [], this.detailed.push(this.addForm)
})); this.getCollectionData()
this.addForm = this.detatilData.find((v) => v.id == this.receiptItemId); })
this.detailed = [];
this.detailed.push(this.addForm);
this.getCollectionData();
});
}, },
getReceiptInfo() { getReceiptInfo() {
getReceiptInfoByIds({ id: this.receiptId }).then((res) => { getReceiptInfoByIds({ id: this.receiptId }).then((res) => {
this.form = res.data; this.form = res.data
getCustomer(this.form.customerId).then((res) => { getCustomer(this.form.customerId).then((res) => {
this.form.customerName = res?.data?.name; this.form.customerName = res?.data?.name
}); })
}); })
}, },
getCurrencyLabel(id) { getCurrencyLabel(id) {
var label = this.currencyList.filter((item) => item.id == id); var label = this.currencyList.filter((item) => item.id == id)
if (label.length > 0) if (label.length > 0) return this.$i18n.locale == "zh_CN" ? label[0].titleZh : label[0].titleEn
return this.$i18n.locale == "zh_CN" return ""
? label[0].titleZh
: label[0].titleEn;
return "";
}, },
getListData() { getListData() {
getInvoicingItem({ id: this.receiptId }).then((res) => { getInvoicingItem({ id: this.receiptId }).then((res) => {
this.list = [...res.data]; this.list = [...res.data]
let fieldList = []; let fieldList = []
let groupList = []; let groupList = []
this.list.map((element) => { this.list.map((element) => {
if (fieldList.indexOf(element["currencyId"]) === -1) { if (fieldList.indexOf(element["currencyId"]) === -1) {
fieldList.push(element["currencyId"]); fieldList.push(element["currencyId"])
} }
}); })
for (let i = 0; i < fieldList.length; i++) { for (let i = 0; i < fieldList.length; i++) {
let arr = this.list.filter((element) => { let arr = this.list.filter((element) => {
return element["currencyId"] === fieldList[i]; return element["currencyId"] === fieldList[i]
}); })
groupList.push({ groupList.push({
currencyId: arr[0].currencyId, currencyId: arr[0].currencyId,
list: arr, list: arr
}); })
} }
this.showCurrencyId = 1; this.showCurrencyId = 1
if (groupList.length === 1) if (groupList.length === 1) this.showCurrencyId = groupList[0].currencyId
this.showCurrencyId = groupList[0].currencyId; })
});
}, },
getCollectionData() { getCollectionData() {
getReceiptAccountList({ id: this.receiptId }).then((res) => { getReceiptAccountList({ id: this.receiptId }).then((res) => {
var n; var n
// 收款总计 // 收款总计
var amountList = []; var amountList = []
this.currencyList.forEach((item, index) => { this.currencyList.forEach((item, index) => {
var nairaListByList = this.list.filter( var nairaListByList = this.list.filter((v) => v.currencyId === item.id)
(v) => v.currencyId === item.id
);
if (nairaListByList.length > 0) { if (nairaListByList.length > 0) {
var discountNaira = nairaListByList.reduce( var discountNaira = nairaListByList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
(total, currentValue) => n = res.data.find((v) => v.currencyId == item.id)
NP.plus(total, currentValue.discountTotal || 0), n && (n.discountTotal = discountNaira)
0
);
n = res.data.find((v) => v.currencyId == item.id);
n && (n.discountTotal = discountNaira);
} }
var dollarList = res.data.filter( var dollarList = res.data.filter((v) => v.collectionCurrencyId == item.id)
(v) => v.collectionCurrencyId == item.id
);
if (dollarList.length > 0) { if (dollarList.length > 0) {
var dollar = dollarList var dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount), 0).toFixed(2)
.reduce(
(total, currentValue) =>
NP.plus(total, currentValue.collectionAmount),
0
)
.toFixed(2);
amountList.push({ amountList.push({
currencyId: item.id, currencyId: item.id,
currencyNameEn: item.titleEn, currencyNameEn: item.titleEn,
currencyNameZh: item.titleZh, currencyNameZh: item.titleZh,
amount: dollar, amount: dollar
}); })
} }
}); })
this.$set(this, "collectionAmount", amountList); this.$set(this, "collectionAmount", amountList)
this.handleAddReceiptItem(); this.handleAddReceiptItem()
}); })
}, },
handleAddReceiptItem() { handleAddReceiptItem() {
// 已收 // 已收
let recepted = []; let recepted = []
this.detatilData.forEach((item) => { this.detatilData.forEach((item) => {
if (!recepted[item.currencyId]) { if (!recepted[item.currencyId]) {
recepted[item.currencyId] = item.amount; recepted[item.currencyId] = item.amount
} else } else recepted[item.currencyId] = NP.plus(recepted[item.currencyId], item.amount)
recepted[item.currencyId] = NP.plus( })
recepted[item.currencyId],
item.amount
);
});
// 应收 // 应收
let collom = []; let collom = []
// 从期望收费金额中提取应收币种和金额 // 从期望收费金额中提取应收币种和金额
this.collectionAmount.forEach((item) => { this.collectionAmount.forEach((item) => {
collom[item.currencyId] = item.amount; collom[item.currencyId] = item.amount
}); })
console.log(recepted); console.log(recepted)
recepted.forEach((amount, currency) => { recepted.forEach((amount, currency) => {
if (amount) { if (amount) {
if (collom[currency]) { if (collom[currency]) {
if (collom[currency] - amount != 0) if (collom[currency] - amount != 0) this.surplusData[currency] = +parseFloat((collom[currency] - amount).toPrecision(12))
this.surplusData[currency] = +parseFloat(
(collom[currency] - amount).toPrecision(12)
);
} else { } else {
this.surplusData[currency] = -amount; this.surplusData[currency] = -amount
} }
} }
}); })
console.log(collom); console.log(collom)
collom.forEach((amount, currency) => { collom.forEach((amount, currency) => {
if (amount) { if (amount) {
if (!this.surplusData[currency]) { if (!this.surplusData[currency]) {
if (recepted[currency]) { if (recepted[currency]) {
if (amount - recepted[currency] != 0) if (amount - recepted[currency] != 0) this.surplusData[currency] = +parseFloat((amount - recepted[currency]).toPrecision(12))
this.surplusData[currency] = +parseFloat(
(amount - recepted[currency]).toPrecision(12)
);
} else { } else {
this.surplusData[currency] = amount; this.surplusData[currency] = amount
} }
} }
} }
}); })
console.log(this.surplusData); console.log(this.surplusData)
}, }
}, }
}; }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
......
This source diff could not be displayed because it is too large. You can view the blob instead.
<template>
<div class="app-container">
<el-card v-show="showSearch">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px" class="card">
<!-- <el-row :span="24"> -->
<el-form-item :label="$t('开票编号')">
<el-input style="max-width: 188px" v-model="queryParams.invoiceNo" :placeholder="$t('请输入开票编号')" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('收款编号')">
<el-input style="max-width: 188px" v-model="queryParams.receiptNo" :placeholder="$t('请输入收款编号')" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('提单号')">
<el-input style="max-width: 188px" v-model="queryParams.tidanNo" :placeholder="$t('请输入提单号')" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('订单号')">
<el-input style="max-width: 188px" v-model="queryParams.orderNo" :placeholder="$t('请输入订单号')" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('开票状态')">
<dict-selector multiple :type="DICT_TYPE.INVOICING_STATUS" v-model="queryParams.invoicingStatus" clearable />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ $t("搜索") }}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{ $t("重置") }}</el-button>
</el-form-item>
</el-form>
</el-card>
<div class="tableTop">
<el-table v-loading="loading" :data="invoiceList" border>
<el-table-column :label="$t('开票编号')" width="160" align="center" prop="invoiceNo">
<template slot-scope="{ row }">
<router-link
:to="{
path: '/financial/invoiceOperate',
query: {
id: row.id,
key: 'view'
}
}"
class="link-type"
>
{{ row.invoiceNo }}
</router-link>
</template>
</el-table-column>
<el-table-column :label="$t('收款单号')" width="160" align="center" prop="receiptNo">
<template slot-scope="{ row }">
<router-link
:to="{
path: '/financial/receiptDetail',
query: {
id: row.receiptId
}
}"
class="link-type"
>
{{ row.receiptNo }}
</router-link>
</template>
</el-table-column>
<el-table-column :label="$t('申请日期')" width="160" align="center" prop="invoiceInfoSaveTime" />
<el-table-column :label="$t('申请人/部门')" width="200" align="center">
<template slot-scope="{ row }">
<div>{{ row.applyUserName }}/{{ row.departmentName }}</div>
</template>
</el-table-column>
<el-table-column :label="$t('开票抬头')" width="160" align="center" prop="invoiceHeader" />
<el-table-column :label="$t('开票金额')" align="center" prop="invoiceMoney" />
<el-table-column :label="$t('开票品名')" width="160" align="center" prop="invoiceItem" />
<el-table-column :label="$t('税率')" align="center" prop="taxRate" />
<el-table-column :label="$t('开票状态')" align="center" prop="invoicingStatus">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.INVOICING_STATUS" :value="scope.row.invoicingStatus" />
</template>
</el-table-column>
<el-table-column :label="$t('开票资料状态')" width="160" align="center">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.INVOICE_DATA_STATUS" :value="scope.row.invoiceDataStatus" />
</template>
</el-table-column>
<el-table-column :label="$t('订单/提单')" width="260" align="center" prop="orderNo">
<template slot-scope="{ row }">
<div v-for="item in row.orderInfoList" :key="item.orderId">
<router-link :to="`/order/detail?orderId=${item.orderId}`" class="link-type"> {{ item.orderNo }}/{{ item.tidanNo }} </router-link>
</div>
</template>
</el-table-column>
<el-table-column :label="$t('收款状态/核销比例')" width="160" align="center">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.ECW_RECEIPT_STATE" :value="scope.row.receiptState" />
/ {{ scope.row.writeOffProportion }}
</template>
</el-table-column>
<el-table-column :label="$t('操作')" width="200" fixed="right" align="center">
<template slot-scope="{ row }">
<!-- 待开票0已提交0可以驳回 -->
<el-button type="text" v-if="row.invoicingStatus === 0 && row.invoiceDataStatus === 0" @click="handleInvoiceOperate({ id: row.id, key: 'reject' })">{{ $t("驳回资料") }}</el-button>
<!-- 开票状态=待开票 -->
<el-button v-if="row.invoicingStatus === 0" @click="handleInvoiceOperate({ id: row.id, key: 'cancel' })" type="text">{{ $t("取消开票") }}</el-button>
<!-- 开票状态=待开票且开票资料状态=已提交 提交开票提交的是开票信息 -->
<el-button v-if="row.invoicingStatus === 0 && row.invoiceDataStatus === 0" @click="handleInvoiceOperate({ id: row.id, key: 'submitInfo' })" type="text">{{ $t("提交开票") }}</el-button>
<!-- 开票状态=待开票0 -->
<el-button v-if="row.invoicingStatus === 0" @click="handleInvoiceOperate({ id: row.id, key: 'edit' })" type="text">{{ $t("修改开票申请") }}</el-button>
<!--开票状态=已开票1 -->
<el-button v-if="row.invoicingStatus === 1" type="text" @click="handleInvoiceOperate({ id: row.id, key: 'editInfo' })">{{ $t("修改开票信息") }}</el-button>
<!-- 开票状态=已开票 -->
<el-button v-if="row.invoicingStatus === 1" @click="handleInvoiceOperate({ id: row.id, key: 'delInfo' })" type="text">{{ $t("删除开票信息") }}</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :limit.sync="queryParams.rows" @pagination="getInvoiceList" />
</div>
</div>
</template>
<script>
import { loadInvApplicationList } from "@/api/ecw/financial"
export default {
data() {
return {
showSearch: true,
loading: false,
invoiceList: [],
total: 0,
queryParams: {
page: 1,
rows: 10,
invoiceNo: "", //开票编号
invoicingStatus: [], //开票状态
orderNo: "", //订单号
receiptNo: "", //收款单号
tidanNo: "" // 提单号
}
}
},
created() {
this.getInvoiceList()
},
activated() {
this.getInvoiceList()
},
methods: {
handleInvoiceOperate({ id, key }) {
this.$router.push("invoiceOperate?id=" + id + "&key=" + key)
},
async getInvoiceList() {
this.loading = true
let params = {
...this.queryParams
}
const { data } = await loadInvApplicationList(params)
this.loading = false
this.total = data.total
this.invoiceList = data.list
},
resetQuery() {
this.queryParams = {
page: 1,
rows: 10,
invoiceNo: "", //开票编号
invoicingStatus: [], //开票状态
orderNo: "", //订单号
receiptNo: "", //收款单号
tidanNo: "" // 提单号
}
this.getInvoiceList()
},
handleQuery() {
this.queryParams.page = 1
this.getInvoiceList()
}
}
}
</script>
<style lang="scss" scoped>
.card {
padding: 20px;
}
.tableTop {
margin-top: 20px;
}
</style>
<template>
<div class="app-container">
<el-form ref="formInvoiceEL" :model="form" label-width="120px" label-position="left">
<el-card class="margin-top-card">
<div slot="header" class="card-title">{{ $t("开票申请信息") }}</div>
<el-descriptions :column="3" border>
<el-descriptions-item :label="$t('开票编号')" v-if="$route.query.key != 'reject'">{{ form.invoiceNo }}</el-descriptions-item>
<el-descriptions-item :label="$t('收款单编号')">
<router-link :to="`/financial/receiptDetail?id=${form.receiptId}`" class="link-type">
{{ form.receiptNo }}
</router-link>
</el-descriptions-item>
<el-descriptions-item :label="$t('订单号')" v-if="$route.query.key == 'reject' || $route.query.key == 'delInfo'">
<div v-for="item in form.orderInfoList" :key="item.orderNo">
<router-link :to="`/order/detail?orderId=${item.orderId}`" class="link-type">
{{ item.orderNo }}
</router-link>
</div>
</el-descriptions-item>
<el-descriptions-item :label="$t('客户')" v-if="$route.query.key != 'reject'">
<router-link :to="`/customer/query/${form.customerId}`" class="link-type">
{{ form.customerName }}
</router-link>
</el-descriptions-item>
<el-descriptions-item :label="$t('应收总金额')"
><div v-for="item in form.receiptAmount" :key="item.currencyId" class="totalAmountReceivable">{{ item.currencySymbol }}{{ item.totalAmount }}</div>
</el-descriptions-item>
<el-descriptions-item
v-if="$route.query.key != 'reject'"
:label="
$t('应收总{currency}', {
currency: getBaseCurrencynName(form.baseCurrencyId)
})
"
>{{ getCurrencySymbol(form.baseCurrencyId) }}{{ form.receivableTotalAmountUsd }}</el-descriptions-item
>
<el-descriptions-item
v-if="$route.query.key != 'reject'"
:label="
$t('总核销比例({currency})', {
currency: getBaseCurrencynName(form.baseCurrencyId)
})
"
>{{ form.writeOffProportion }}</el-descriptions-item
>
<el-descriptions-item :label="$t('已收总金额')" v-if="$route.query.key != 'reject'">
<div v-for="item in form.receiptAmount" :key="item.currencyId" class="totalAmountReceivable">{{ item.currencySymbol }}{{ item.writeOffAmount }}</div>
</el-descriptions-item>
<el-descriptions-item
v-if="$route.query.key != 'reject'"
:label="
$t('已收总{currency}', {
currency: getBaseCurrencynName(form.baseCurrencyId)
})
"
>{{ getCurrencySymbol(form.baseCurrencyId) }}{{ form.writeOffAmountUsd }}</el-descriptions-item
>
<!-- <el-descriptions-item :label="$t('开票状态')">
<dict-tag :type="DICT_TYPE.INVOICING_STATUS" :value="form.invoicingStatus" />
</el-descriptions-item>
<el-descriptions-item :label="$t('开票资料状态')"> <dict-tag :type="DICT_TYPE.INVOICE_DATA_STATUS" :value="form.invoiceDataStatus" /></el-descriptions-item> -->
</el-descriptions>
</el-card>
<!-- 开票资料 -->
<el-card class="margin-top-card">
<div slot="header" class="card-title">
<span>{{ $t("开票资料") }}</span>
<!--开票状态=待开票且资料状态=已提交显示驳回资料按钮 -->
<el-button type="primary" style="float: right" size="small" v-if="$route.query.key === 'view' && form.invoicingStatus === 0 && form.invoiceDataStatus === 0" @click="refreshForReject">{{ $t("驳回资料") }}</el-button>
</div>
<el-descriptions :column="3" border>
<el-descriptions-item :label="$t('发票抬头')">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="invoiceHeader"
:rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('请输入发票抬头')
}"
>
<el-input :disabled="$route.query.key != 'create' && $route.query.key != 'edit'" v-model="form.invoiceHeader"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item :label="$t('纳税人识别号')">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="taxpayer"
:rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('请输入纳税人识别号')
}"
>
<el-input :disabled="$route.query.key != 'create' && $route.query.key != 'edit'" style="width: 280px" v-model="form.taxpayer"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item :label="$t('开户行')">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="accountBank"
:rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('请输入开户行')
}"
>
<el-input :disabled="$route.query.key != 'create' && $route.query.key != 'edit'" v-model="form.accountBank"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item :label="$t('账号')">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="accountName"
:rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('请输入账号')
}"
>
<el-input :disabled="$route.query.key != 'create' && $route.query.key != 'edit'" v-model="form.accountName"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item :label="$t('开票品名')">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="invoiceItem"
:rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('请输入开票品名')
}"
>
<el-input :disabled="$route.query.key != 'create' && $route.query.key != 'edit'" style="width: 280px" v-model="form.invoiceItem"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item :label="$t('税率%')">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="taxRate"
:rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('请输入税率')
}"
>
<el-input-number :controls="false" :disabled="$route.query.key != 'create' && $route.query.key != 'edit'" v-model="form.taxRate"></el-input-number>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item :label="$t('开票地址/电话')">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="invoiceAddress"
:rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('请输入开票地址/电话')
}"
>
<el-input :disabled="$route.query.key != 'create' && $route.query.key != 'edit'" v-model="form.invoiceAddress"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item :label="$t('开票资料备注')">
<el-form-item label="" label-width="0" style="margin-bottom: 0">
<el-input :disabled="$route.query.key != 'create' && $route.query.key != 'edit'" style="width: 280px" v-model="form.invoiceRemark"></el-input>
</el-form-item>
</el-descriptions-item>
<!-- <el-descriptions-item :label="$t('开票资料状态')">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="remark"
:rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('请选择开票资料状态')
}"
>
<dict-selector multiple :type="DICT_TYPE.INVOICE_DATA_STATUS" v-model="form.invoiceDataStatus" clearable />
</el-form-item>
</el-descriptions-item> -->
</el-descriptions>
</el-card>
<!-- 开票信息 -->
<el-card class="margin-top-card" v-if="$route.query.key == 'view' || $route.query.key == 'submitInfo' || $route.query.key == 'editInfo' || $route.query.key == 'delInfo'">
<div slot="header" class="card-title">{{ $t("开票信息") }}</div>
<el-descriptions :column="3" border>
<el-descriptions-item :label="$t('发票号码')">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="invoiceNumber"
:rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('请输入发票号码')
}"
>
<el-input :disabled="$route.query.key != 'submitInfo' && $route.query.key != 'editInfo'" v-model="form.invoiceNumber"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item :label="$t('开票类型')">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="invoiceTypeId"
:rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('请选择开票类型')
}"
>
<dict-selector :disabled="$route.query.key != 'submitInfo' && $route.query.key != 'editInfo'" :type="DICT_TYPE.ECW_INVOICING_TYPE" v-model="form.invoiceTypeId" />
</el-form-item>
</el-descriptions-item>
<el-descriptions-item :label="$t('开票金额')">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="invoiceMoney"
:rules="[
{
required: true,
trigger: ['blur', 'change'],
message: $t('请输入开票金额')
}
]"
>
<!-- <jd-input-number :disabled="$route.query.key != 'submitInfo' && $route.query.key != 'editInfo'" v-model="form.invoiceMoney"> </jd-input-number> -->
<el-input-number :controls="false" :disabled="$route.query.key != 'submitInfo' && $route.query.key != 'editInfo'" v-model="form.invoiceMoney"></el-input-number>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item :label="$t('币种')">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="currencyId"
:rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('请选择币种')
}"
>
<el-select :disabled="$route.query.key != 'submitInfo' && $route.query.key != 'editInfo'" v-model="form.currencyId" :placeholder="$t('请选择币种')" clearable size="small">
<el-option v-for="dict in currencyList" :key="dict.id" :label="$l(dict, 'title') + dict.fuhao" :value="dict.id" />
</el-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item :label="$t('开票人')">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="invoicerId"
:rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('请输入开票人')
}"
>
<el-select v-model="form.invoicerId" :disabled="$route.query.key != 'submitInfo' && $route.query.key != 'editInfo'" style="width: 280px" :placeholder="$t('开票人')" clearable>
<el-option v-for="item in creatorData" :key="item.id" :label="item.nickname" :value="item.id" />
</el-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item :label="$t('开票时间')">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="invoiceTime"
:rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('开票时间')
}"
>
<el-date-picker :disabled="$route.query.key != 'submitInfo' && $route.query.key != 'editInfo'" v-model="form.invoiceTime" type="date" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"> </el-date-picker>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item :label="$t('开票信息备注')">
<el-form-item label="" label-width="0" style="margin-bottom: 0">
<el-input :disabled="$route.query.key != 'submitInfo' && $route.query.key != 'editInfo'" style="width: 280px" v-model="form.invoiceInfoRemark"></el-input>
</el-form-item>
</el-descriptions-item>
</el-descriptions>
</el-card>
<!-- 应收明细 -->
<el-card class="margin-top-card" v-if="$route.query.key != 'reject' && $route.query.key != 'cancel'">
<div slot="header" class="card-title">
<span> {{ $t("应收明细") }}</span>
<el-button @click="controlVisibleReceivables" style="float: right; padding: 3px 0" type="text">{{ $t("隐藏") }}</el-button>
</div>
<el-table row-key="id" v-if="visibleReceivables" style="width: 100%" :data="receivableList" show-summary :summary-method="getSummaries" border>
<el-table-column prop="orderNo" :label="$t('订单号')" width="150"></el-table-column>
<el-table-column prop="tidanNo" :label="$t('提单号')" width="150" v-if="$route.query.key != 'create' && $route.query.key != 'delInfo'"></el-table-column>
<el-table-column prop="marks" :label="$t('唛头')" width="100" v-if="$route.query.key != 'create' && $route.query.key != 'delInfo'"></el-table-column>
<el-table-column prop="titleZh" :label="$t('品名')" width="100">
<template slot-scope="{ row }">
{{ $l(row, "title") }}
</template>
</el-table-column>
<el-table-column prop="num" :label="$t('箱数')" width="100"></el-table-column>
<el-table-column prop="volumeOrWeight" :label="$t('体积/重量')" width="180">
<template slot-scope="{ row }">
<div>{{ row.volume }}m³/{{ row.weight }}kg</div>
</template>
</el-table-column>
<el-table-column prop="incomeType" :label="$t('收入类型')" width="120">
<template slot-scope="{ row }">
<div>
<dict-tag :type="DICT_TYPE.FEE_TYPE" :value="row.feeType" />
</div>
</template>
</el-table-column>
<el-table-column prop="unitPrice" :label="$t('单价金额')" width="120" :formatter="formatCurrency"></el-table-column>
<el-table-column prop="taxPoint" :label="$t('税率%')" width="80"></el-table-column>
<el-table-column prop="notIncludedTaxAmount" :label="$t('不含税金额')" width="120" :formatter="formatCurrency"></el-table-column>
<el-table-column prop="taxAmount" :label="$t('含税金额')" width="120" :formatter="formatCurrency"></el-table-column>
<el-table-column prop="discountTotal" :label="$t('优惠金额')" width="120" :formatter="formatCurrency"></el-table-column>
<el-table-column prop="actualAmount" :label="$t('实际金额')" width="120" :formatter="formatCurrency"></el-table-column>
<el-table-column prop="writeOffAmount" v-if="$route.query.key != 'create' && $route.query.key != 'delInfo'" :label="$t('已核销本币金额')" width="120" :formatter="formatCurrency"></el-table-column>
<el-table-column prop="notWriteOffAmount" v-if="$route.query.key != 'create' && $route.query.key != 'delInfo'" :label="$t('未核销本币金额')" width="120" :formatter="formatCurrency"></el-table-column>
<el-table-column
prop="exchangeRate"
:label="
$t('基准币种({currency})汇率', {
currency: getBaseCurrencynName(form.baseCurrencyId)
})
"
width="120"
>
</el-table-column>
<el-table-column
prop="baseAmount"
:label="
$t('基准金额({currency})', {
currency: getBaseCurrencynName(form.baseCurrencyId)
})
"
width="120"
:formatter="formatCurrency"
></el-table-column>
<el-table-column
v-if="$route.query.key != 'create' && $route.query.key != 'delInfo'"
prop="writeOffAmountUsd"
:label="
$t('已核销金额({currency})', {
currency: getBaseCurrencynName(form.baseCurrencyId)
})
"
width="120"
:formatter="formatCurrency"
></el-table-column>
<el-table-column
v-if="$route.query.key != 'create' && $route.query.key != 'delInfo'"
prop="notWriteOffAmountUsd"
:label="
$t('未核销金额({currency})', {
currency: getBaseCurrencynName(form.baseCurrencyId)
})
"
width="120"
:formatter="formatCurrency"
></el-table-column>
<el-table-column prop="writeOffProportion" v-if="$route.query.key != 'create' && $route.query.key != 'delInfo'" :label="$t('已核销比例')" width="120"></el-table-column>
</el-table>
</el-card>
<!-- 最后操作人信息 -->
<el-card class="margin-top-card" v-if="$route.query.key != 'reject' && $route.query.key != 'cancel'">
<el-descriptions :column="4" border>
<el-descriptions-item :label="$t('收款人')">{{ form.payee }}</el-descriptions-item>
<el-descriptions-item :label="$t('核销人')">{{ form.writeOffUser }}</el-descriptions-item>
<el-descriptions-item :label="$t('申请人')">{{ form.creator }}</el-descriptions-item>
<el-descriptions-item :label="$t('申请时间')">{{ form.createTime }}</el-descriptions-item>
<el-descriptions-item :label="$t('最后修改人')">{{ form.updater }}</el-descriptions-item>
<el-descriptions-item :label="$t('最后修改时间')">{{ form.updateTime }}</el-descriptions-item>
<el-descriptions-item v-if="form.cancelUserName" :label="$t('开票取消人')">{{ form.cancelUserName }}</el-descriptions-item>
<el-descriptions-item v-if="form.cancelTime" :label="$t('开票取消时间')">{{ form.cancelTime }}</el-descriptions-item>
</el-descriptions>
</el-card>
<!-- 驳回/取消资料 -->
<el-card class="margin-top-card" v-if="visibleRejectOrcancelCard">
<div slot="header" class="card-title">{{ $t(`${rejectOrCancelLabel}信息`) }}</div>
<div class="infoBox">
<el-form-item
:label="$t(`${rejectOrCancelLabel}备注`)"
prop="remark"
:rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('请输入备注')
}"
>
<el-input style="width: 280px" v-model="form.remark"></el-input>
</el-form-item>
<el-form-item :label="$t('通知人')" :rules="[{ required: true, message: '请选择通知人', trigger: ['blur', 'change'] }]">
<el-select style="width: 280px" v-model="form.notifyUserIdList" multiple :placeholder="$t('通知人')" clearable>
<el-option v-for="item in creatorData" :key="item.id" :label="item.nickname" :value="item.id" />
</el-select>
</el-form-item>
</div>
</el-card>
<!-- 删除开票信息 -->
<el-card class="margin-top-card" v-if="$route.query.key == 'delInfo'">
<div class="infoBox">
<el-form-item
:label="$t(`删除开票备注`)"
prop="remark"
:rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('请输入备注')
}"
>
<el-input style="width: 280px" v-model="form.remark"></el-input>
</el-form-item>
</div>
</el-card>
<!-- 日志信息 -->
<el-card class="margin-top-card" v-if="$route.query.key == 'view'">
<div class="infoBox">
<div slot="header" class="card-title">{{ $t("日志信息") }}</div>
<div class="box-table">
<el-table v-loading="loading" :data="invoiceLogList" border class="card" row-key="id">
<el-table-column :label="$t('环节')" align="center">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.INVOICEING_LINK" :value="scope.row.invoicingLink" />
</template>
</el-table-column>
<el-table-column :label="$t('操作人')" align="center" prop="operator" />
<el-table-column :label="$t('操作时间')" align="center" prop="createTime" />
<el-table-column :label="$t('备注')" align="center" prop="remark" />
</el-table>
</div>
</div>
</el-card>
<!-- 操作按钮 -->
<div class="btnBox">
<el-button type="primary" @click="goBack" plain>{{ $t("返回") }}</el-button>
<el-button type="primary" v-if="$route.query.key === 'create'" @click="submitInvoiceForm('create')">{{ $t("提交申请") }}</el-button>
<el-button type="primary" v-if="$route.query.key === 'edit'" @click="submitInvoiceForm('edit')">{{ $t("确认修改开票申请") }}</el-button>
<el-button type="primary" v-if="$route.query.key === 'reject'" @click="rejectOrCancleInvoiceData">{{ $t("确认驳回资料") }}</el-button>
<el-button type="primary" v-if="$route.query.key === 'cancel'" @click="rejectOrCancleInvoiceData">{{ $t("确认取消开票") }}</el-button>
<el-button type="primary" v-if="$route.query.key === 'submitInfo'" @click="submitInvoiceFormInfo">{{ $t("提交开票") }}</el-button>
<el-button type="primary" v-if="$route.query.key === 'editInfo'" @click="submitInvoiceFormInfo">{{ $t("修改开票信息") }}</el-button>
<el-button type="primary" v-if="$route.query.key === 'delInfo'" @click="delInvoiceFormInfo">{{ $t("删除开票信息") }}</el-button>
</div>
</el-form>
</div>
</template>
<script>
import { loadReceiptInvoiceInfo, createInvoiceApplication, loadINVInfoByInvoiceId, updateInvoiceApplication, rejectInvoiceApplication, cancelInvoiceApplication, updateInvoiceApplicationInfo, delInvoiceApplication } from "@/api/ecw/financial"
import { getNowDateTime } from "@/utils/ruoyi"
import { listSimpleUsers } from "@/api/system/user"
import { DICT_TYPE } from "@/utils/dict"
import { mapGetters } from "vuex"
import JdInputNumber from "@/views/ecw/customer/components/jd-input-number.vue"
export default {
components: {
JdInputNumber
},
data() {
return {
currencyList: this.$store.state.staticData.currencyList,
creatorData: [], //业务员列表
rejectOrCancelLabel: "驳回",
visibleRejectOrcancelCard: false,
visibleReceivables: false,
form: {},
invoiceLogList: [],
receivableList: []
}
},
mounted() {
this.getReceiptInvoiceInfo()
listSimpleUsers().then((res) => (this.creatorData = res.data))
},
watch: {
"$route.query.key": {
handler(val) {
switch (val) {
case "reject":
this.rejectOrCancelLabel = "驳回"
this.visibleRejectOrcancelCard = true
break
case "cancel":
this.rejectOrCancelLabel = "取消"
this.visibleRejectOrcancelCard = true
break
default:
this.visibleRejectOrcancelCard = false
break
}
// if (val) {
// this.queryParams.rewardCode = val
// }
},
immediate: true
}
},
computed: {
...mapGetters(["getCurrencySymbol", "getCurrencyData", "name", "userId"]),
getBaseCurrencynName() {
return (currencyId) => {
if (currencyId) {
return this.$l(this.getCurrencyData(currencyId), "title")
}
return "XX"
}
}
},
methods: {
goBack() {
this.$router.go(-1)
},
// 刷新当前到驳回状态
refreshForReject() {
this.$router.push("invoiceOperate?id=" + this.$route.query.id + "&key=reject")
},
async validateFormResult() {
return await this.$refs["formInvoiceEL"].validate()
},
// delete invoice info
async delInvoiceFormInfo() {
const result = await this.validateFormResult()
if (result) {
let params = {
remark: this.form.remark,
id: this.form.id
}
await this.$modal.confirm(this.$t("确认删除开票信息吗?"))
const data = await delInvoiceApplication(params)
if (data.code === 0) {
this.$message({
message: this.$t("成功"),
type: "success"
})
this.goBack()
}
}
},
//驳回取消资料
async rejectOrCancleInvoiceData() {
const result = await this.validateFormResult()
let apiFuncName = rejectInvoiceApplication
if (result) {
if (this.$route.query.key == "cancel") {
apiFuncName = cancelInvoiceApplication
}
let params = {
remark: this.form.remark,
id: this.form.id,
notifyUserIdList: this.form.notifyUserIdList
}
await this.$modal.confirm(this.$t(`确认${this.rejectOrCancelLabel}开票资料吗?`))
const data = await apiFuncName(params)
if (data.code === 0) {
this.$message({
message: this.$t("成功"),
type: "success"
})
this.goBack()
}
}
},
//提交开票--提交的是开票信息
async submitInvoiceFormInfo() {
const result = await this.validateFormResult()
if (result) {
let params = {
invoiceNumber: this.form.invoiceNumber,
invoiceTypeId: this.form.invoiceTypeId,
invoiceMoney: this.form.invoiceMoney,
currencyId: this.form.currencyId,
id: this.form.id,
invoicerId: this.form.invoicerId,
invoiceTime: this.form.invoiceTime,
invoiceInfoRemark: this.form?.invoiceInfoRemark || ""
}
const data = await updateInvoiceApplicationInfo(params)
if (data.code === 0) {
this.$message({
message: this.$t("成功"),
type: "success"
})
this.goBack()
}
}
},
//提交开票申请
submitInvoiceForm(key) {
this.$refs["formInvoiceEL"].validate((valid) => {
if (valid) {
const params = {
invoiceHeader: this.form.invoiceHeader, //发票抬头
taxpayer: this.form.taxpayer, //纳税人识别号
accountBank: this.form.accountBank, //开户行
accountName: this.form.accountName, //账号
invoiceItem: this.form.invoiceItem, // 开票品名
taxRate: this.form.taxRate, //税率%
invoiceAddress: this.form.invoiceAddress, // 开票地址/电话字段合二为一
invoiceRemark: this.form.invoiceRemark || "", //备注
receiptId: this.form.receiptId //收款单id
}
let createOrEditFunc = createInvoiceApplication //创建开票
let confirmLabel = "创建"
if (key == "edit") {
params.id = this.$route.query.id
createOrEditFunc = updateInvoiceApplication //更新开票资料
confirmLabel = "更新"
}
this.$modal.confirm(this.$t(`确认${confirmLabel}开票资料吗?`)).then((result) => {
createOrEditFunc(params).then((res) => {
console.log("FORMiNFO1", res)
if (res.code === 0) {
this.$message({
message: this.$t("成功"),
type: "success"
})
this.$router.push({ path: "/financial/voucher" })
}
})
})
} else {
console.log("error submit!!")
return false
}
})
},
//应收明细显示隐藏
controlVisibleReceivables() {
this.visibleReceivables = !this.visibleReceivables
},
// 获取开票信息
async getReceiptInvoiceInfo() {
let params = {}
let loadInvoiceFuncName = loadReceiptInvoiceInfo
if (this.$route.query.key === "create") {
//通过收款单id
params = { receiptId: this.$route.query.id }
} else {
//开票id
params = { id: this.$route.query.id }
loadInvoiceFuncName = loadINVInfoByInvoiceId
}
const { data } = await loadInvoiceFuncName(params)
this.form = data
this.receivableList = data?.receivableList
this.invoiceLogList = data?.invoiceLog
if (this.$route.query.key === "create") {
this.form.creator = this.name
this.form.taxRate = undefined
} else {
console.log("edwedfnwevjc", this.userId)
this.form.invoicerId = this.userId
this.form.invoiceTime = getNowDateTime()
}
if (!this.form?.currencyId) {
this.form.invoiceMoney = undefined
this.form.currencyId = 3
}
this.$nextTick(() => {
this.$refs["formInvoiceEL"].clearValidate()
})
},
// 用于格式化货币的函数
formatCurrency(row, column, cellValue) {
if (column.property == "baseAmount" || column.property == "writeOffAmountUsd" || column.property == "notWriteOffAmountUsd") {
return this.getCurrencySymbol(row.baseCurrencyId) + (cellValue || "0")
}
return this.getCurrencySymbol(row.currencyId) + (cellValue || "0")
},
//合计金额
getSummaries(param) {
const { columns, data } = param
console.log("edcfbnsdjbnwode", param)
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = this.$t("合计金额")
return
} else if (column.property != "unitPrice" && column.property != "notIncludedTaxAmount" && column.property != "taxAmount" && column.property != "discountTotal" && column.property != "actualAmount" && column.property != "writeOffAmount" && column.property != "notWriteOffAmount" && column.property != "baseAmount" && column.property != "writeOffAmountUsd" && column.property != "notWriteOffAmountUsd") {
sums[index] = "NA"
return
} else {
const currencyIdList = Array.from(new Set(data.map((item) => item.currencyId)))
// if (index == 7) {
const currencySums = {}
data.forEach((item) => {
let currencyId = item.currencyId
// 基准金额(XX)baseAmount 已核销金额 writeOffAmountUsd 未核销金额 notWriteOffAmountUsd 币种取 基准币种
if (column.property == "writeOffAmountUsd" || column.property == "baseAmount" || column.property == "notWriteOffAmountUsd") {
currencyId = item.baseCurrencyId
}
currencySums[currencyId] = (currencySums[currencyId] || 0) + parseInt(item[column.property], 10)
})
const reducedDataList = Object.keys(currencySums).map((currencyId) => {
return `${this.getCurrencySymbol(currencyId * 1)}${currencySums[currencyId].toString()} `
})
sums[index] = reducedDataList
return
}
})
return sums
}
}
}
</script>
<style lang="scss" scoped>
.margin-top-card {
margin-top: 20px;
}
.btnBox {
padding-top: 80px;
padding-bottom: 20px;
}
.card-title {
font-size: 18px;
font-weight: bold;
}
</style>
This source diff could not be displayed because it is too large. You can view the blob instead.
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 操作工具栏 --> <!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8" style="margin-right: 60px"> <el-row :gutter="10" class="mb8" style="margin-right: 60px">
<div class="card-title">{{ $t('待收款') }}</div> <div class="card-title">{{ $t("待收款") }}</div>
<el-button <el-button style="float: right; margin-left: 10px" type="primary" size="mini" v-hasPermi="['ecw:receivable:add']" @click="handleAdd(0)">{{ $t("新增收款单") }}</el-button>
style="float: right; margin-left: 10px" <el-button v-if="showSearch" style="float: right" type="primary" size="mini" icon="el-icon-s-unfold" @click="showSearch = !showSearch"></el-button>
type="primary" <el-button v-else style="float: right" type="primary" size="mini" icon="el-icon-s-fold" @click="showSearch = !showSearch"></el-button>
size="mini"
v-hasPermi="['ecw:receivable:add']"
@click="handleAdd(0)"
>{{ $t('新增收款单') }}</el-button
>
<el-button
v-if="showSearch"
style="float: right"
type="primary"
size="mini"
icon="el-icon-s-unfold"
@click="showSearch = !showSearch"
></el-button>
<el-button
v-else
style="float: right"
type="primary"
size="mini"
icon="el-icon-s-fold"
@click="showSearch = !showSearch"
></el-button>
</el-row> </el-row>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-card v-show="showSearch"> <el-card v-show="showSearch">
<el-form <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="80px" class="card">
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
label-width="80px"
class="card"
>
<el-row> <el-row>
<el-form-item :label="$t('始发地')"> <el-form-item :label="$t('始发地')">
<el-select <el-select v-model="queryParams.departureId" :placeholder="$t('请选择始发地')" clearable>
v-model="queryParams.departureId" <el-option v-for="item in exportWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
:placeholder="$t('请选择始发地')"
clearable
>
<el-option
v-for="item in exportWarehouseList"
:label="$l(item, 'title')"
:value="item.id"
:key="item.id"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('目的地')"> <el-form-item :label="$t('目的地')">
<el-select <el-select v-model="queryParams.objectiveId" :placeholder="$t('请选择目的地')" clearable>
v-model="queryParams.objectiveId" <el-option v-for="item in importWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
:placeholder="$t('请选择目的地')"
clearable
>
<el-option
v-for="item in importWarehouseList"
:label="$l(item, 'title')"
:value="item.id"
:key="item.id"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('运输方式')"> <el-form-item :label="$t('运输方式')">
<dict-selector <dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="queryParams.transportId" formatter="number" clearable />
:type="DICT_TYPE.ECW_TRANSPORT_TYPE"
v-model="queryParams.transportId"
formatter="number"
clearable
/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('控货')"> <el-form-item :label="$t('控货')">
<dict-selector <dict-selector :type="DICT_TYPE.INFRA_BOOLEAN_STRING" v-model="queryParams.isCargoControl" clearable />
:type="DICT_TYPE.INFRA_BOOLEAN_STRING"
v-model="queryParams.isCargoControl"
clearable
/>
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-row> <el-row>
<el-form-item :label="$t('订单状态')"> <el-form-item :label="$t('订单状态')">
<dict-selector <dict-selector :type="DICT_TYPE.ORDER_STATUS" v-model="queryParams.status" clearable />
:type="DICT_TYPE.ORDER_STATUS"
v-model="queryParams.status"
clearable
/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('报关方式')"> <el-form-item :label="$t('报关方式')">
<dict-selector <dict-selector :type="DICT_TYPE.ECW_CUSTOMS_TYPE" v-model="queryParams.customsType" clearable />
:type="DICT_TYPE.ECW_CUSTOMS_TYPE"
v-model="queryParams.customsType"
clearable
/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('订单号')"> <el-form-item :label="$t('订单号')">
<el-input <el-input style="max-width: 188px" v-model="queryParams.orderNo" :placeholder="$t('请输入订单编号')" clearable @keyup.enter.native="handleQuery" />
style="max-width: 188px"
v-model="queryParams.orderNo"
:placeholder="$t('请输入订单编号')"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('品名')"> <el-form-item :label="$t('品名')">
<el-input <el-input style="max-width: 188px" v-model="queryParams.title" :placeholder="$t('请输入品名')" clearable @keyup.enter.native="handleQuery" />
style="max-width: 188px"
v-model="queryParams.title"
:placeholder="$t('请输入品名')"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-row> <el-row>
<el-form-item :label="$t('提单号')"> <el-form-item :label="$t('提单号')">
<el-input <el-input style="max-width: 188px" v-model="queryParams.tidanNo" :placeholder="$t('请输入提单号')" clearable @keyup.enter.native="handleQuery" />
style="max-width: 188px"
v-model="queryParams.tidanNo"
:placeholder="$t('请输入提单号')"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('唛头')"> <el-form-item :label="$t('唛头')">
<el-input <el-input style="max-width: 188px" v-model="queryParams.marks" :placeholder="$t('请输入唛头')" clearable @keyup.enter.native="handleQuery" />
style="max-width: 188px"
v-model="queryParams.marks"
:placeholder="$t('请输入唛头')"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('费用类型')"> <el-form-item :label="$t('费用类型')">
<dict-selector <dict-selector :type="DICT_TYPE.FEE_TYPE" v-model="queryParams.feeType" clearable></dict-selector>
:type="DICT_TYPE.FEE_TYPE"
v-model="queryParams.feeType"
clearable
></dict-selector>
</el-form-item> </el-form-item>
<!-- <el-form-item :label="$t('发货人')"> <!-- <el-form-item :label="$t('发货人')">
<customer-selector <customer-selector
v-model="queryParams.consignorNameOrPhone" v-model="queryParams.consignorNameOrPhone"
@change="consignor = $event" @change="consignor = $event"
clearable clearable
/> />
</el-form-item> --> </el-form-item> -->
<el-form-item label="发货人:" > <el-form-item label="发货人:">
<el-input style="max-width: 188px;" v-model="queryParams.consignorNameOrPhone" :placeholder="$t('请输入发货人')" clearable @keyup.enter.native="handleQuery"/> <el-input style="max-width: 188px" v-model="queryParams.consignorNameOrPhone" :placeholder="$t('请输入发货人')" clearable @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-row> <el-row>
<el-form-item :label="$t('收货人')"> <el-form-item :label="$t('收货人')">
<el-input style="max-width: 188px;" v-model="queryParams.consigneeNameOrPhone" :placeholder="$t('请输入收货人')" clearable @keyup.enter.native="handleQuery"/> <el-input style="max-width: 188px" v-model="queryParams.consigneeNameOrPhone" :placeholder="$t('请输入收货人')" clearable @keyup.enter.native="handleQuery" />
<!-- <customer-selector <!-- <customer-selector
v-model="queryParams.consigneeNameOrPhone" v-model="queryParams.consigneeNameOrPhone"
@change="consignor = $event" @change="consignor = $event"
clearable clearable
...@@ -166,102 +74,86 @@ ...@@ -166,102 +74,86 @@
</el-form-item> </el-form-item>
<el-form-item :label="$t('创建时间')"> <el-form-item :label="$t('创建时间')">
<!-- <dict-selector :type="DICT_TYPE.BEGINTIME_TYPE_ENDTIME" v-model="queryParams.date"></dict-selector> --> <!-- <dict-selector :type="DICT_TYPE.BEGINTIME_TYPE_ENDTIME" v-model="queryParams.date"></dict-selector> -->
<el-date-picker <el-date-picker v-model="dateType" type="datetimerange" range-separator="-" value-format="yyyy-MM-dd" :start-placeholder="$t('请选择日期')" :end-placeholder="$t('请选择日期')"> </el-date-picker>
v-model="dateType"
type="datetimerange"
range-separator="-"
value-format="yyyy-MM-dd"
:start-placeholder="$t('请选择日期')"
:end-placeholder="$t('请选择日期')"
>
</el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</el-form-item> </el-form-item>
</el-row> </el-row>
</el-form> </el-form>
</el-card> </el-card>
<el-table v-loading="loadings" :data="list" border class="card"> <div v-loading="loading">
<el-table-column :label="$t('订单号')" align="center" prop="orderNo" /> <el-row :gutter="10" class="mb8 pad-t20">
<el-table-column :label="$t('唛头')" align="center" prop="marks" /> <div class="card-title">
<el-table-column :label="$t('品名')" align="center" prop="title"> <div class="gird-cell">
<template slot-scope="scope"> <div>{{ $t("合计:") }}</div>
{{ scope.row.titleZh? (scope.row.titleZh + "(" + scope.row.titleEn + ")"):'' }} <div v-for="item in totalAmountList" :key="item.currencyId" class="pad-cell">
</template> {{ `${item.currencySymbol}${item.totalAmount}` }}
</el-table-column> </div>
<el-table-column :label="$t('箱数')" align="center" prop="num" /> </div>
<el-table-column :label="$t('体积/重量')" align="center" prop="weight" > </div>
<template slot-scope="scope"> </el-row>
{{ scope.row.volume}}/ {{ scope.row.weight}} <el-table :data="list" border class="card">
<el-table-column :label="$t('订单号')" align="center" prop="orderNo" />
<el-table-column :label="$t('唛头')" align="center" prop="marks" />
<el-table-column :label="$t('品名')" align="center" prop="title">
<template slot-scope="scope">
{{ scope.row.titleZh ? scope.row.titleZh + "(" + scope.row.titleEn + ")" : "" }}
</template>
</el-table-column>
<el-table-column :label="$t('箱数')" align="center" prop="num" />
<el-table-column :label="$t('体积/重量')" align="center" prop="weight">
<template slot-scope="scope"> {{ scope.row.volume }}/ {{ scope.row.weight }} </template>
</el-table-column>
<el-table-column :label="$t('发货人')" align="center" prop="consignorName" />
<el-table-column :label="$t('收货人')" align="center" prop="consigneeName" />
<el-table-column :label="$t('付款方')" align="center" prop="weight">
<template slot-scope="scope">
{{ scope.row.paymentUser == 1 ? $t("发货人") : $t("收货人") }}
</template>
</el-table-column>
<el-table-column :label="$t('订单状态')" 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="$t('收入类型')" align="center" prop="feeType">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.FEE_TYPE" :value="scope.row.feeType"></dict-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('发货人')" align="center" prop="consignorName" /> <el-table-column :label="$t('单价')" align="center" prop="unitPrice">
<el-table-column :label="$t('收货人')" align="center" prop="consigneeName" /> <template slot-scope="scope">
<el-table-column :label="$t('付款方')" align="center" prop="weight" > <span>{{ scope.row.unitPrice }}{{ getCurrencyLabel(scope.row.currencyId) }}</span>
<template slot-scope="scope"> <!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
{{ scope.row.paymentUser==1?$t('发货人'):$t('收货人')}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('订单状态')" align="center" prop="status"> <el-table-column :label="$t('总金额')" align="center" prop="totalAmount">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :type="DICT_TYPE.ORDER_STATUS" :value="scope.row.status" /> <span>{{ scope.row.totalAmount }}{{ getCurrencyLabel(scope.row.currencyId) }}</span>
</template> <!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</el-table-column> </template>
<el-table-column :label="$t('收入类型')" align="center" prop="feeType"> </el-table-column>
<template slot-scope="scope"> <el-table-column :label="$t('操作')" align="center" fixed="right" class-name="small-padding fixed-width">
<dict-tag <template slot-scope="scope">
:type="DICT_TYPE.FEE_TYPE" <el-button size="mini" type="text" v-hasPermi="['ecw:receivable:collection']" @click="handleAdd(scope.row)">{{ $t("收款") }}</el-button>
:value="scope.row.feeType" </template>
></dict-tag> </el-table-column>
</template> </el-table>
</el-table-column> </div>
<el-table-column :label="$t('单价')" align="center" prop="unitPrice">
<template slot-scope="scope">
<span>{{ scope.row.unitPrice }}{{getCurrencyLabel(scope.row.currencyId)}}</span>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template>
</el-table-column>
<el-table-column :label="$t('总金额')" align="center" prop="totalAmount">
<template slot-scope="scope">
<span>{{ scope.row.totalAmount }}{{getCurrencyLabel(scope.row.currencyId)}}</span>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template>
</el-table-column>
<el-table-column
:label="$t('操作')"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button size="mini" type="text" v-hasPermi="['ecw:receivable:collection']" @click="handleAdd(scope.row)" >{{ $t('收款') }}</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 --> <!-- 分页组件 -->
<pagination <pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :limit.sync="queryParams.rows" @pagination="getList" />
v-show="total > 0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.rows"
@pagination="getList"
/>
</div> </div>
</template> </template>
<script> <script>
import { userList } from "@/api/system/user"; import { userList } from "@/api/system/user"
import { DICT_TYPE } from "@/utils/dict"; import { DICT_TYPE } from "@/utils/dict"
import CustomerSelector from "@/components/CustomerSelector"; import CustomerSelector from "@/components/CustomerSelector"
import { getTradeCityList } from "@/api/ecw/region"; import { getTradeCityList } from "@/api/ecw/region"
import { getReceivableList } from "@/api/ecw/financial"; import { getReceivableList, getReceivableAmount } from "@/api/ecw/financial"
import { getCurrencyPage } from "@/api/ecw/currency"; import { getCurrencyPage } from "@/api/ecw/currency"
import {getWarehouseList} from '@/api/ecw/warehouse' import { getWarehouseList } from "@/api/ecw/warehouse"
export default { export default {
name: "EcwFinancialReceivable", name: "EcwFinancialReceivable",
...@@ -271,100 +163,107 @@ export default { ...@@ -271,100 +163,107 @@ export default {
data() { data() {
return { return {
showSearch: true, showSearch: true,
loadings: false, loading: false,
form: {}, form: {},
creatorData: [], creatorData: [],
list: [], list: [],
total: 0, total: 0,
dateType: [], dateType: [],
loading: "",
params: { params: {
page: 1, page: 1,
rows: 20, rows: 20
}, },
queryParams: { queryParams: {
page: 1, page: 1,
rows: 20, rows: 20
}, },
tradeCityList: [], tradeCityList: [],
params: { params: {
page: 1, page: 1,
rows: 20, rows: 20
}, },
currencyList:[], currencyList: [],
warehouseList:[], warehouseList: [],
}; totalAmountList: []
}
}, },
activated(){ activated() {
console.log(11) console.log(11)
this.getList(); this.getList()
}, },
created() { created() {
let that = this; let that = this
getCurrencyPage(this.params).then(res => this.currencyList = res.data.list) getCurrencyPage(this.params).then((res) => (this.currencyList = res.data.list))
userList("salesman").then((res) => (that.creatorData = res.data)); userList("salesman").then((res) => (that.creatorData = res.data))
getTradeCityList().then((res) => (that.tradeCityList = res.data)); getTradeCityList().then((res) => (that.tradeCityList = res.data))
this.getList(); this.getList()
getWarehouseList().then(res => this.warehouseList = res.data) getWarehouseList().then((res) => (this.warehouseList = res.data))
}, },
computed: { computed: {
expoerCityList() { expoerCityList() {
return this.tradeCityList.filter((item) => item.type == 2); return this.tradeCityList.filter((item) => item.type == 2)
}, },
importCityList() { importCityList() {
return this.tradeCityList.filter((item) => item.type == 1); return this.tradeCityList.filter((item) => item.type == 1)
}, },
exportWarehouseList(){ exportWarehouseList() {
/* tradeType 1 进口,2出口,3进出口 */ /* tradeType 1 进口,2出口,3进出口 */
return this.warehouseList.filter(item => item.tradeType == 2 || item.tradeType == 3) return this.warehouseList.filter((item) => item.tradeType == 2 || item.tradeType == 3)
},
importWarehouseList(){
return this.warehouseList.filter(item => item.tradeType == 1 || item.tradeType == 3)
}, },
importWarehouseList() {
return this.warehouseList.filter((item) => item.tradeType == 1 || item.tradeType == 3)
}
}, },
methods: { methods: {
getCurrencyLabel(id){ getCurrencyLabel(id) {
var label = this.currencyList.filter(item=>item.id == id) var label = this.currencyList.filter((item) => item.id == id)
if(label.length>0) return this.$i18n.locale=='zh_CN'?label[0].titleZh:label[0].titleEn if (label.length > 0) return this.$i18n.locale == "zh_CN" ? label[0].titleZh : label[0].titleEn
return '' return ""
}, },
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true
// 处理查询参数 // 处理查询参数
console.log(this.queryParams) console.log(this.queryParams)
let params = {}; let params = {}
for(let key in this.queryParams){ for (let key in this.queryParams) {
if(this.queryParams[key]&&this.queryParams[key]!= undefined){ if (this.queryParams[key] && this.queryParams[key] != undefined) {
params[key] = this.queryParams[key] params[key] = this.queryParams[key]
} }
} }
this.addBeginAndEndTime(params, this.dateType, "createTime"); this.addBeginAndEndTime(params, this.dateType, "createTime")
// 执行查询 // 执行查询
getReceivableList(params).then((response) => { getReceivableList(params).then((response) => {
this.list = response.data.list; this.list = response.data.list
this.total = response.data.total; this.total = response.data.total
this.loading = false; this.loading = false
}); })
this.getTotalAmount(params)
},
/**总金额合计 */
getTotalAmount(params) {
getReceivableAmount(params).then((res) => {
this.totalAmountList = res.data
})
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.page = 1; this.queryParams.page = 1
this.getList(); this.getList()
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd(row) { handleAdd(row) {
if(!row) return this.$router.push("creatCollection"); if (!row) return this.$router.push("creatCollection")
return this.$router.push("creatCollection?orderId=" + row.orderId); return this.$router.push("creatCollection?orderId=" + row.orderId)
}, },
submitForm() {}, submitForm() {}
}, }
}; }
</script> </script>
<style scoped> <style scoped>
.card { .card {
margin-top: 20px; margin-top: 20px;
} }
...@@ -376,4 +275,13 @@ export default { ...@@ -376,4 +275,13 @@ export default {
font-weight: bold; font-weight: bold;
display: inline-block; display: inline-block;
} }
.pad-t20 {
padding-top: 20px;
}
.gird-cell {
display: flex;
}
.pad-cell {
padding: 0 20px;
}
</style> </style>
<template>
<div class="app-container">
<div class="title">{{ $t("银行收款明细对应核销比例设置") }}</div>
<div class="main">
<div class="sideBar">
{{ $t("核销比例") }} <span class="unit">{{ $t("单位(%)") }}</span>
</div>
<el-form :inline="true" :model="form" ref="ruleForm" :rules="rules" class="inlineForm">
<el-form-item prop="writeOffDown">
<el-input-number v-model="form.writeOffDown" :controls="false" :precision="2" :min="0" :max="99.99"></el-input-number>
</el-form-item>
<div class="col">-</div>
<el-form-item prop="writeOffUp">
<el-input-number v-model="form.writeOffUp" :controls="false" :precision="2" :min="0.01" :max="100"></el-input-number>
</el-form-item>
<el-form-item class="subButton">
<el-button type="primary" @click="onSubmit('ruleForm')">{{ $t("提交") }}</el-button>
</el-form-item>
</el-form>
</div>
</div>
</template>
<script>
import { loadbankWriteOffRange, updatebankWriteOffRange } from "@/api/ecw/financial"
export default {
name: "EcwFinancialSetautoapprovalrules",
data() {
return {
form: {
id: null,
writeOffDown: "",
writeOffUp: ""
},
rules: {
writeOffDown: [{ required: true, message: this.$t("请输入核销比例下界"), trigger: "blur" }],
writeOffUp: [{ required: true, message: this.$t("请输入核销比例上界"), trigger: "blur" }]
}
}
},
created() {
this.getBankWriteOffRange()
},
activated() {
this.getBankWriteOffRange()
},
methods: {
async getBankWriteOffRange() {
const { data } = await loadbankWriteOffRange()
this.form.id = data.id
this.form.writeOffDown = data.writeOffDown / 100
this.form.writeOffUp = data.writeOffUp / 100
this.$refs["ruleForm"].clearValidate()
},
openConfirmBox() {
if (this.form.writeOffDown > this.form.writeOffUp) {
this.$message({
type: "info",
message: this.$t("核销比例数值错误")
})
return
}
this.$confirm(this.$t("此操作将修改自动核销比例?"), this.$t("提示"), {
confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t("取消"),
type: "warning"
})
.then(() => {
const params = {
id: this.form.id,
writeOffDown: this.form.writeOffDown * 100,
writeOffUp: this.form.writeOffUp * 100
}
updatebankWriteOffRange(params).then((res) => {
this.$message({
message: this.$t("修改成功"),
type: "success"
})
})
})
.catch(() => {
this.$message({
type: "info",
message: this.$t("已取消删除")
})
})
},
onSubmit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.openConfirmBox()
} else {
console.log("error submit!!")
return false
}
})
}
}
}
</script>
<style lang="scss" scoped>
.title {
font-size: 26px;
padding: 60px 0;
text-align: center;
}
.main {
display: flex;
align-items: center;
justify-content: center;
.unit {
font-size: 12px;
color: #a1a1a1;
}
.sideBar {
margin-bottom: 22px;
font-size: 18px;
padding-right: 20px;
}
.inlineForm {
display: flex;
}
.col {
width: 60px;
display: flex;
margin-bottom: 22px;
justify-content: center;
align-items: center;
margin-right: 10px;
}
.subButton {
padding-left: 20px;
}
}
</style>
...@@ -3,146 +3,89 @@ ...@@ -3,146 +3,89 @@
<div slot="header" class="card-title">{{ $t("收款单") }}</div> <div slot="header" class="card-title">{{ $t("收款单") }}</div>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-card v-show="showSearch" class="card"> <el-card v-show="showSearch" class="card">
<el-form <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px" class="card">
:model="queryParams" <!-- <el-row :span="24"> -->
ref="queryForm" <el-form-item :label="$t('收款单号')">
size="small" <el-input style="max-width: 188px" v-model="queryParams.receiptNo" :placeholder="$t('请输入收款单号')" clearable @keyup.enter.native="handleQuery" />
:inline="true" </el-form-item>
label-width="100px" <el-form-item :label="$t('客户名称')">
class="card" <customer-selector v-model="queryParams.customerId" @change="changeCustomerId" clearable />
> </el-form-item>
<el-row :span="24"> <el-form-item :label="$t('状态')">
<el-form-item :label="$t('收款单号')"> <dict-selector :type="DICT_TYPE.ECW_RECEIPT_STATE" v-model="queryParams.state" clearable />
<el-input </el-form-item>
style="max-width: 188px" <el-form-item :label="$t('业务员')">
v-model="queryParams.receiptNo" <el-select v-model="queryParams.salesmanId" :placeholder="$t('请选择业务员')" clearable>
:placeholder="$t('请输入收款单号')" <el-option v-for="item in creatorData" :key="item.id" :label="item.nickname" :value="item.id" />
clearable </el-select>
@keyup.enter.native="handleQuery" </el-form-item>
/>
</el-form-item> <el-form-item :label="$t('开票状态')">
<el-form-item :label="$t('客户名称')"> <dict-selector multiple :type="DICT_TYPE.INVOICING_STATUS" v-model="queryParams.invoicingStatus" clearable />
<customer-selector </el-form-item>
v-model="queryParams.customerId" <el-form-item :label="$t('明细状态')">
@change="changeCustomerId" <dict-selector multiple :type="DICT_TYPE.RECEIPT_DETAIL_STATUS" v-model="queryParams.receiptItemStatus" clearable />
clearable </el-form-item>
/> <el-form-item :label="$t('开票资料状态')">
</el-form-item> <dict-selector multiple :type="DICT_TYPE.INVOICE_DATA_STATUS" v-model="queryParams.invoiceDataStatus" clearable />
<el-form-item :label="$t('状态')"> </el-form-item>
<dict-selector <!-- </el-row> -->
:type="DICT_TYPE.ECW_RECEIPT_STATE" <el-form-item :label="$t('编号')">
v-model="queryParams.state" <el-input style="max-width: 188px" v-model="queryParams.numberNo" :placeholder="$t('订单号和提单号,自编号')" clearable @keyup.enter.native="handleQuery" />
clearable </el-form-item>
/> <!-- <el-row :span="24"> -->
</el-form-item> <!-- <el-col style="width: 592px"> -->
<el-form-item :label="$t('业务员')"> <el-form-item :label="$t('创建时间')">
<el-select <el-date-picker v-model="dateFilter" type="datetimerange" range-separator="-" value-format="yyyy-MM-dd HH:mm:ss" :start-placeholder="$t('请选择日期')" :end-placeholder="$t('请选择日期')"> </el-date-picker>
v-model="queryParams.salesmanId" </el-form-item>
:placeholder="$t('请选择业务员')" <!-- </el-col> -->
clearable
> <!-- </el-row> -->
<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="$t('创建时间')">
<el-date-picker
v-model="dateFilter"
type="datetimerange"
range-separator="-"
value-format="yyyy-MM-dd HH:mm:ss"
:start-placeholder="$t('请选择日期')"
:end-placeholder="$t('请选择日期')"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-form-item :label="$t('编号')">
<el-input
style="max-width: 188px"
v-model="queryParams.numberNo"
:placeholder="$t('订单号和提单号,自编号')"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-row>
<el-row :span="24"> <el-row :span="24">
<el-col style="width: 592px"> <el-col style="width: 592px">
<el-form-item> <el-form-item>
<el-button type="primary" @click="handleQuery">{{ <el-button type="primary" @click="handleQuery">{{ $t("查找") }}</el-button>
$t("查找")
}}</el-button>
<!--lanbm 2024-05-29 添加的批处理功能按钮--> <!--lanbm 2024-05-29 添加的批处理功能按钮-->
<el-button type="primary" @click="handleQuery2">{{ <el-button type="primary" @click="handleQuery2">{{ $t("批量反审核") }}</el-button>
$t("批量反审核") <el-button type="primary" @click="handleQuery3">{{ $t("批量反核销") }}</el-button>
}}</el-button> <el-button type="primary" @click="handleQuery4">{{ $t("批量核销") }}</el-button>
<el-button type="primary" @click="handleQuery3">{{
$t("批量反核销")
}}</el-button>
<el-button type="primary" @click="handleQuery4">{{
$t("批量核销")
}}</el-button>
<!--lanbm 2024-05-29 添加的批处理功能按钮--> <!--lanbm 2024-05-29 添加的批处理功能按钮-->
<!-- 财务2.2-->
<el-button @click="handleShowFileUploadDialog" type="primary" v-hasPermi="['ecw:voucher:importBankCollectionInfo']">{{ $t("导入银行收款信息") }}</el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
</el-card> </el-card>
<el-table <el-table v-loading="loadings" :data="list" @selection-change="handleSelectionChange" border class="card">
v-loading="loadings" <el-table-column type="selection" width="55" align="center" fixed="left"> </el-table-column>
:data="list" <el-table-column :label="$t('序号')" align="center" fixed="left" prop="id" type="index">
@selection-change="handleSelectionChange"
border
class="card"
>
<el-table-column type="selection" width="55" align="center">
</el-table-column>
<el-table-column
:label="$t('序号')"
align="center"
prop="id"
type="index"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.$index + 1 }}</span> <span>{{ scope.$index + 1 }}</span>
</template> </template>
</el-table-column> </el-table-column>
<!--lanbm 2024-06-06 添加链接--> <!--lanbm 2024-06-06 添加链接-->
<el-table-column :label="$t('收款单号')" align="center" prop="receiptNo"> <el-table-column :label="$t('收款单号')" fixed="left" align="center" prop="receiptNo">
<template slot-scope="scope"> <template slot-scope="scope">
<span <span style="color: #1890ff" @click="verificationCancelClick(scope.row)">{{ scope.row.receiptNo }}</span>
style="color: #1890ff"
@click="verificationCancelClick(scope.row)"
>{{ scope.row.receiptNo }}</span
>
</template> </template>
</el-table-column> </el-table-column>
<!--订单号,提单号,lanbm 2024-05-29 add--> <!--订单号,提单号,lanbm 2024-05-29 add-->
<el-table-column :label="$t('订单号')" align="center" prop="orderNo"> <!-- 财务v2.2 新增收款单对应多订单展示处理 -->
<template slot-scope="scope"> <el-table-column :label="$t('订单号/提单号')" fixed="left" width="230" align="center" prop="orderNo">
<span style="color: #1890ff" @click="paymentDetail2(scope.row)">{{ <template slot-scope="{ row }">
scope.row.orderNo <div v-for="item in row.orderInfoList" :key="item.orderId">
}}</span> <router-link :to="`/order/detail?orderId=${item.orderId}`" class="link-type"> {{ item.orderNo }}/{{ item.tidanNo }} </router-link>
</div>
<!-- <span style="color: #1890ff" @click="paymentDetail2(scope.row)">{{ scope.row.orderNo }}</span> -->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('提单号')" align="center" prop="tidanNo" /> <!-- <el-table-column :label="$t('提单号')" align="center" prop="tidanNo" /> -->
<!-- <template slot-scope="scope"> --> <!-- <template slot-scope="scope"> -->
<!-- <span style="color: #1890ff;" @click="verificationCancelClick(scope.row)">{{scope.row.receiptNo}}</span> --> <!-- <span style="color: #1890ff;" @click="verificationCancelClick(scope.row)">{{scope.row.receiptNo}}</span> -->
<!-- </template> --> <!-- </template> -->
<!-- </el-table-column> --> <!-- </el-table-column> -->
<el-table-column <el-table-column :label="$t('客户名称')" align="center" prop="customerName" />
:label="$t('客户名称')"
align="center"
prop="customerName"
/>
<el-table-column :label="$t('创建日期')" align="center" prop="createTime"> <el-table-column :label="$t('创建日期')" align="center" prop="createTime">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span> <span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
...@@ -153,71 +96,42 @@ ...@@ -153,71 +96,42 @@
<span>{{ parseTime(scope.row.payedAt, "{y}-{m}-{d}") }}</span> <span>{{ parseTime(scope.row.payedAt, "{y}-{m}-{d}") }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column :label="$t('业务员')" align="center" prop="salesmanName" />
:label="$t('业务员')"
align="center"
prop="salesmanName"
/>
<el-table-column :label="$t('状态')" align="center"> <el-table-column :label="$t('状态')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <dict-tag :type="DICT_TYPE.ECW_RECEIPT_STATE" :value="scope.row.state" />
:type="DICT_TYPE.ECW_RECEIPT_STATE" <span v-if="scope.row.remark && (scope.row.state == 1 || scope.row.state == 3 || scope.row.state == 8)" :title="scope.row.remark"><i class="el-icon-question"></i></span>
:value="scope.row.state"
/>
<span
v-if="
scope.row.remark &&
(scope.row.state == 1 ||
scope.row.state == 3 ||
scope.row.state == 8)
"
:title="scope.row.remark"
><i class="el-icon-question"></i
></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column :label="$t('应收')" align="center" prop="ysShow"> </el-table-column>
:label="$t('应收')" <el-table-column :label="$t('实收')" align="center" prop="ssShow"> </el-table-column>
align="center" <el-table-column :label="$t('核销比例')" align="center" prop="hxBiLi"> </el-table-column>
prop="ysShow"
>
</el-table-column>
<el-table-column :label="$t('实收')" align="center" prop="ssShow">
</el-table-column>
<el-table-column
:label="$t('核销比例')"
align="center"
prop="hxBiLi"
>
</el-table-column>
<el-table-column :label="$t('是否开票')" align="center"> <el-table-column :label="$t('是否开票')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.openInvoice === 0 ? $t("") : $t("") }} {{ scope.row.openInvoice === 0 ? $t("") : $t("") }}
</template> </template>
</el-table-column> </el-table-column>
<!--lanbm 2024-05-14 add--> <!--lanbm 2024-05-14 add-->
<el-table-column :label="$t('明细状态')" align="center" prop="mxStatus" /> <el-table-column :label="$t('明细状态')" align="center" prop="mxStatus">
<el-table-column <template slot-scope="{ row }">
:label="$t('操作')" {{ row.mxStatus }}/
align="center" <dict-tag :type="DICT_TYPE.RECEIPT_DETAIL_STATUS" :value="row.receiptItemStatus" />
class-name="small-padding fixed-width" </template>
> </el-table-column>
<el-table-column :label="$t('开票状态')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <dict-tag :type="DICT_TYPE.INVOICING_STATUS" :value="scope.row.invoicingStatus" />
size="mini" </template>
type="text" </el-table-column>
v-hasPermi="['ecw:voucher:see']" <el-table-column :label="$t('开票资料状态')" align="center">
@click="verificationCancelClick(scope.row)" <template slot-scope="scope">
>{{ $t("查看") }}</el-button <dict-tag :type="DICT_TYPE.INVOICE_DATA_STATUS" :value="scope.row.invoiceDataStatus" />
> </template>
<el-button </el-table-column>
v-if="scope.row.state === 0" <el-table-column :label="$t('操作')" width="300" fixed="right" align="center" class-name="small-padding fixed-width">
size="mini" <template slot-scope="scope">
type="text" <el-button size="mini" type="text" v-hasPermi="['ecw:voucher:see']" @click="verificationCancelClick(scope.row)">{{ $t("查看") }}</el-button>
v-hasPermi="['ecw:voucher:edit']" <el-button v-if="scope.row.state === 0" size="mini" type="text" v-hasPermi="['ecw:voucher:edit']" @click="handleAdd(scope.row.id)">{{ $t("编辑") }}</el-button>
@click="handleAdd(scope.row.id)"
>{{ $t("编辑") }}</el-button
>
<!-- <el-button <!-- <el-button
v-if="scope.row.state == " v-if="scope.row.state == "
size="mini" size="mini"
...@@ -225,211 +139,64 @@ ...@@ -225,211 +139,64 @@
@click="verificationClick(scope.row)" @click="verificationClick(scope.row)"
>{{ $t('核销') }}</el-button >{{ $t('核销') }}</el-button
> --> > -->
<el-button <el-button v-if="scope.row.state == 4 || scope.row.state == 5 || scope.row.state == 6" size="mini" type="text" v-hasPermi="['ecw:voucher:cancelWriteOff']" @click="writeOffShow(2, scope.$index)">{{ $t("反核销") }}</el-button>
v-if=" <el-button v-if="scope.row.state == 1" size="mini" type="text" v-hasPermi="['ecw:voucher:deApproval']" @click="writeOffShow(1, scope.$index)">{{ $t("反审核") }}</el-button>
scope.row.state == 4 || <el-button v-if="scope.row.state == 7" size="mini" type="text" v-hasPermi="['ecw:vocher:cancelAppoval']" @click="cancelClick(scope.$index, 1)">{{ $t("取消审核") }}</el-button>
scope.row.state == 5 || <el-button v-if="scope.row.state == 11" size="mini" type="text" v-hasPermi="['ecw:vocher:cancelWriteOfflNo']" @click="cancelClick(scope.$index, 3)">{{ $t("取消反核销审核") }}</el-button>
scope.row.state == 6 <el-button v-if="scope.row.state == 10" size="mini" type="text" v-hasPermi="['ecw:vocher:cancelWriteOffAll']" @click="cancelClick(scope.$index, 4)">{{ $t("取消全部核销审核") }}</el-button>
" <el-button v-if="scope.row.state == 9" size="mini" type="text" v-hasPermi="['ecw:vocher:cancelAppovalNo']" @click="cancelClick(scope.$index, 2)">{{ $t("取消反审核") }}</el-button>
size="mini" <el-button size="mini" type="text" v-if="scope.row.state == 9 || scope.row.state == 7 || scope.row.state == 11 || scope.row.state == 10" v-hasPermi="['ecw:voucher:cancelWriteOff']" @click="$router.push(`/bpm/process-instance/detail?id=` + scope.row.bmpId)">{{ $t("审核详情") }}</el-button>
type="text" <el-button v-if="scope.row.state == 5" size="mini" type="text" v-hasPermi="['ecw:voucher:ballot']" @click="openInvoice(scope.row.id)">{{ $t("开票") }}</el-button>
v-hasPermi="['ecw:voucher:cancelWriteOff']" <el-button v-if="scope.row.state == 1 || scope.row.state == 2 || scope.row.state == 3" v-hasPermi="['ecw:voucher:payment']" size="mini" type="text" @click="verificationCancelClick(scope.row)">{{ $t("收款") }}</el-button>
@click="writeOffShow(2, scope.$index)" <el-button v-if="scope.row.state == 0" size="mini" type="text" v-hasPermi="['ecw:voucher:delete']" @click="deleteClick(scope.row)">{{ $t("删除") }}</el-button>
>{{ $t("反核销") }}</el-button <el-button v-if="scope.row.state != 0 && scope.row.state != 7 && scope.row.state != 11 && scope.row.state != 8 && scope.row.state != 9" size="mini" type="text" @click="toprint(scope.row.id)" v-hasPermi="['ecw:voucher:print']">{{ $t("打印") }}</el-button>
> <el-button v-if="scope.row.state != 0 && scope.row.state != 7 && scope.row.state != 11 && scope.row.state != 8 && scope.row.state != 9" size="mini" type="text" v-hasPermi="['ecw:voucher:derive']" @click="exportReceipt(scope.row.id)">{{ $t("导出账单") }}</el-button>
<el-button
v-if="scope.row.state == 1" <!-- 财务2.2新增 5 个按钮-->
size="mini" <!-- 待收款==1 待提交 ==2 已部分核销==3 -->
type="text" <el-button size="mini" v-if="scope.row.state == 1 || scope.row.state == 2 || scope.row.state == 3" v-hasPermi="['ecw:voucher:editReceipt']" @click="handleAdd(scope.row.id)" type="text"> {{ $t("修改收款单") }}</el-button>
v-hasPermi="['ecw:voucher:deApproval']" <!-- 当收款单状态≠草稿0且≠审核中7且≠审批拒绝8,开票状态=已取消2||不开票 3,按钮显示且可点击,跳转申请开票页面 -->
@click="writeOffShow(1, scope.$index)" <el-button size="mini" v-if="scope.row.state != 0 && scope.row.state != 7 && scope.row.state != 8 && (scope.row.invoicingStatus == 2 || scope.row.invoicingStatus == 3)" v-hasPermi="['ecw:voucher:applyInvoice']" type="text" @click="goInvoiceOperate({ id: scope.row.id, key: 'create' })">{{ $t("申请开票") }}</el-button>
>{{ $t("反审核") }}</el-button <!-- 开票状态=待开票0 -->
> <el-button size="mini" v-hasPermi="['ecw:voucher:editInvoiceApplication']" v-if="scope.row.invoicingStatus === 0" type="text" @click="goInvoiceOperate({ id: scope.row.invoiceId, key: 'edit' })">{{ $t("修改开票申请") }}</el-button>
<el-button <!-- 当收款单状态≠草稿0且开票状态=待开票0 -->
v-if="scope.row.state == 7" <el-button v-if="scope.row.state != 0 && scope.row.invoicingStatus === 0" size="mini" v-hasPermi="['ecw:voucher:cancalInvoicing']" type="text" @click="goInvoiceOperate({ id: scope.row.invoiceId, key: 'cancel' })">{{ $t("取消开票") }}</el-button>
size="mini" <!-- 当开票状态=已开票才显示,跳转开票信息查看页面 -->
type="text" <el-button v-if="scope.row.invoicingStatus === 1" @click="goInvoiceOperate({ id: scope.row.invoiceId, key: 'view' })" size="mini" v-hasPermi="['ecw:voucher:invoiceInformation']" type="text">{{ $t("开票信息") }}</el-button>
v-hasPermi="['ecw:vocher:cancelAppoval']"
@click="cancelClick(scope.$index, 1)"
>{{ $t("取消审核") }}</el-button
>
<el-button
v-if="scope.row.state == 11"
size="mini"
type="text"
v-hasPermi="['ecw:vocher:cancelWriteOfflNo']"
@click="cancelClick(scope.$index, 3)"
>{{ $t("取消反核销审核") }}</el-button
>
<el-button
v-if="scope.row.state == 10"
size="mini"
type="text"
v-hasPermi="['ecw:vocher:cancelWriteOffAll']"
@click="cancelClick(scope.$index, 4)"
>{{ $t("取消全部核销审核") }}</el-button
>
<el-button
v-if="scope.row.state == 9"
size="mini"
type="text"
v-hasPermi="['ecw:vocher:cancelAppovalNo']"
@click="cancelClick(scope.$index, 2)"
>{{ $t("取消反审核") }}</el-button
>
<el-button
size="mini"
type="text"
v-if="
scope.row.state == 9 ||
scope.row.state == 7 ||
scope.row.state == 11 ||
scope.row.state == 10
"
v-hasPermi="['ecw:voucher:cancelWriteOff']"
@click="
$router.push(`/bpm/process-instance/detail?id=` + scope.row.bmpId)
"
>{{ $t("审核详情") }}</el-button
>
<el-button
v-if="scope.row.state == 5"
size="mini"
type="text"
v-hasPermi="['ecw:voucher:ballot']"
@click="openInvoice(scope.row.id)"
>{{ $t("开票") }}</el-button
>
<el-button
v-if="
scope.row.state == 1 ||
scope.row.state == 2 ||
scope.row.state == 3
"
v-hasPermi="['ecw:voucher:payment']"
size="mini"
type="text"
@click="verificationCancelClick(scope.row)"
>{{ $t("收款") }}</el-button
>
<el-button
v-if="scope.row.state == 0"
size="mini"
type="text"
v-hasPermi="['ecw:voucher:delete']"
@click="deleteClick(scope.row)"
>{{ $t("删除") }}</el-button
>
<el-button
v-if="
scope.row.state != 0 &&
scope.row.state != 7 &&
scope.row.state != 11 &&
scope.row.state != 8 &&
scope.row.state != 9
"
size="mini"
type="text"
@click="toprint(scope.row.id)"
v-hasPermi="['ecw:voucher:print']"
>{{ $t("打印") }}</el-button
>
<el-button
v-if="
scope.row.state != 0 &&
scope.row.state != 7 &&
scope.row.state != 11 &&
scope.row.state != 8 &&
scope.row.state != 9
"
size="mini"
type="text"
v-hasPermi="['ecw:voucher:derive']"
@click="exportReceipt(scope.row.id)"
>{{ $t("导出账单") }}</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页组件 --> <!-- 分页组件 -->
<pagination <pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :limit.sync="queryParams.rows" @pagination="getList" />
v-show="total > 0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.rows"
@pagination="getList"
/>
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<el-dialog <el-dialog :title="$t('导出账单')" :visible.sync="open" width="500px" style="margin-top: 20vh !important" append-to-body>
:title="$t('导出账单')"
: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;'> <!-- <div slot="title" class="card-title" style='border-bottom: 2px solid #f8f8f8;'>
<span>{{ $t('导出账单') }}</span> <span>{{ $t('导出账单') }}</span>
<i class="el-icon-close" @click="cancel"></i> <i class="el-icon-close" @click="cancel"></i>
</div> --> </div> -->
<div class="dialog-footer"> <div class="dialog-footer">
<el-button <el-button type="primary" style="width: 130px" @click="submitForm(1)" v-loading="downloading">{{ $t("国内账单") }}</el-button>
type="primary" <el-button plain v-loading="downloading" type="primary" style="width: 130px; margin: 0" @click="submitForm(2)">Debite note</el-button>
style="width: 130px"
@click="submitForm(1)"
v-loading="downloading"
>{{ $t("国内账单") }}</el-button
>
<el-button
plain
v-loading="downloading"
type="primary"
style="width: 130px; margin: 0"
@click="submitForm(2)"
>Debite note</el-button
>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog <el-dialog :title="writeOffType == 1 ? $t('收款单反审核') : $t('收款单反核销')" :visible.sync="dialogVisible" width="30%">
:title="writeOffType == 1 ? $t('收款单反审核') : $t('收款单反核销')"
:visible.sync="dialogVisible"
width="30%"
>
<div class="cancel_content"> <div class="cancel_content">
<span>{{ $t("申请理由") }}</span> <span>{{ $t("申请理由") }}</span>
<el-input <el-input type="textarea" :rows="6" v-model="reason" :placeholder="$t('请输入理由')"></el-input>
type="textarea"
:rows="6"
v-model="reason"
:placeholder="$t('请输入理由')"
></el-input>
</div> </div>
<span slot="footer" class="dialog-footers"> <span slot="footer" class="dialog-footers">
<el-button <el-button v-if="writeOffType == 1" type="primary" @click="writeOffClick()">{{ $t("提交反审核") }}</el-button>
v-if="writeOffType == 1" <el-button v-else type="primary" @click="writeOffClick()">{{ $t("提交反核销") }}</el-button>
type="primary"
@click="writeOffClick()"
>{{ $t("提交反审核") }}</el-button
>
<el-button v-else type="primary" @click="writeOffClick()">{{
$t("提交反核销")
}}</el-button>
<el-button @click="dialogVisible = false">{{ $t("取消") }}</el-button> <el-button @click="dialogVisible = false">{{ $t("取消") }}</el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog :title="cancelTitle" :visible.sync="cancelShow" width="30%"> <el-dialog :title="cancelTitle" :visible.sync="cancelShow" width="30%">
<div class="cancel_content"> <div class="cancel_content">
<span>{{ $t("申请理由") }}</span> <span>{{ $t("申请理由") }}</span>
<el-input <el-input type="textarea" :rows="6" v-model="cancelReason" :placeholder="$t('请输入取消理由')"></el-input>
type="textarea"
:rows="6"
v-model="cancelReason"
:placeholder="$t('请输入取消理由')"
></el-input>
</div> </div>
<span slot="footer" class="dialog-footers"> <span slot="footer" class="dialog-footers">
<el-button type="primary" @click="cancelWriteOffClick()">{{ <el-button type="primary" @click="cancelWriteOffClick()">{{ $t("提交") }}</el-button>
$t("提交")
}}</el-button>
<el-button @click="cancelShow = false">{{ $t("取消") }}</el-button> <el-button @click="cancelShow = false">{{ $t("取消") }}</el-button>
</span> </span>
</el-dialog> </el-dialog>
...@@ -438,17 +205,10 @@ ...@@ -438,17 +205,10 @@
<el-dialog :title="dialogTitle2" :visible.sync="dialogVisible2" width="30%"> <el-dialog :title="dialogTitle2" :visible.sync="dialogVisible2" width="30%">
<div class="cancel_content"> <div class="cancel_content">
<span>{{ $t("申请理由") }}</span> <span>{{ $t("申请理由") }}</span>
<el-input <el-input type="textarea" :rows="6" v-model="reason" :placeholder="$t('请输入理由')"></el-input>
type="textarea"
:rows="6"
v-model="reason"
:placeholder="$t('请输入理由')"
></el-input>
</div> </div>
<span slot="footer" class="dialog-footers"> <span slot="footer" class="dialog-footers">
<el-button type="primary" @click="writeOffClick2()">{{ <el-button type="primary" @click="writeOffClick2()">{{ $t("提交反审核") }}</el-button>
$t("提交反审核")
}}</el-button>
<el-button @click="dialogVisible2 = false">{{ $t("取消") }}</el-button> <el-button @click="dialogVisible2 = false">{{ $t("取消") }}</el-button>
</span> </span>
</el-dialog> </el-dialog>
...@@ -457,28 +217,48 @@ ...@@ -457,28 +217,48 @@
<el-dialog :title="dialogTitle3" :visible.sync="dialogVisible3" width="30%"> <el-dialog :title="dialogTitle3" :visible.sync="dialogVisible3" width="30%">
<div class="cancel_content"> <div class="cancel_content">
<span>{{ $t("申请理由") }}</span> <span>{{ $t("申请理由") }}</span>
<el-input <el-input type="textarea" :rows="6" v-model="reason" :placeholder="$t('请输入理由')"></el-input>
type="textarea"
:rows="6"
v-model="reason"
:placeholder="$t('请输入理由')"
></el-input>
</div> </div>
<span slot="footer" class="dialog-footers"> <span slot="footer" class="dialog-footers">
<el-button type="primary" @click="writeOffClick3()">{{ <el-button type="primary" @click="writeOffClick3()">{{ $t("提交反核销") }}</el-button>
$t("提交反核销")
}}</el-button>
<el-button @click="dialogVisible3 = false">{{ $t("取消") }}</el-button> <el-button @click="dialogVisible3 = false">{{ $t("取消") }}</el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- 批量导入弹窗 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload ref="upload" :multiple="false" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url + '?ignoreItem=' + upload.ignoreItem" :data="upload.data" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<i class="el-icon-upload" />
<div class="el-upload__text">
{{ $t("将文件拖到此处,或") }}<em>{{ $t("点击上传") }}</em>
</div>
<div slot="tip" class="el-upload__tip text-center">
<span>{{ $t("仅允许导入xls、xlsx格式文件。") }}</span>
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">{{ $t("下载模板") }} </el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer-upload">
<el-button type="primary" @click="submitFileForm">{{ $t("确 定") }}</el-button>
<el-button @click="upload.open = false">{{ $t("取 消") }}</el-button>
</div>
</el-dialog>
<el-dialog :title="$t('导入提示信息,请确认是否提交')" :visible.sync="continueUploadModal.show" width="30%">
<div v-html="continueUploadModal.msg"></div>
<span slot="footer" class="dialog-footer-upload">
<el-button @click="continueUploadModal.show = false">{{ $t("取 消") }}</el-button>
<el-button type="primary" @click="continueUpload">{{ $t("确 定") }}</el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { listSimpleUsers } from "@/api/system/user"; import { listSimpleUsers } from "@/api/system/user"
import { DICT_TYPE } from "@/utils/dict"; import { DICT_TYPE } from "@/utils/dict"
import CustomerSelector from "@/components/CustomerSelector"; import CustomerSelector from "@/components/CustomerSelector"
import { getCurrencyPage } from "@/api/ecw/currency"; import { getCurrencyPage } from "@/api/ecw/currency"
import { getBaseHeader } from "@/utils/request"
import { import {
getReceiptList, getReceiptList,
// receiptVerification, // receiptVerification,
...@@ -494,7 +274,8 @@ import { ...@@ -494,7 +274,8 @@ import {
cancelFinanceReceiptApprovalNo, cancelFinanceReceiptApprovalNo,
cancelFinanceReceiptWriteOffNo, cancelFinanceReceiptWriteOffNo,
cancelFinanceReceiptWriteOff, cancelFinanceReceiptWriteOff,
} from "@/api/ecw/financial"; handleDownloadReceiptTmp
} from "@/api/ecw/financial"
// lanbm 2024-05-30 添加注释 // lanbm 2024-05-30 添加注释
// 收款单状态 0 草稿,1 待收款,2 待提交 // 收款单状态 0 草稿,1 待收款,2 待提交
...@@ -506,10 +287,28 @@ import { ...@@ -506,10 +287,28 @@ import {
export default { export default {
name: "EcwFinancialVoucher", name: "EcwFinancialVoucher",
components: { components: {
CustomerSelector, CustomerSelector
}, },
data() { data() {
return { return {
fileCopy: null,
upload: {
ignoreItem: false,
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: this.$t("导入银行收款信息"),
// 是否禁用上传
isUploading: false,
// 设置上传的请求头部
headers: getBaseHeader(),
// 上传的地址
url: process.env.VUE_APP_BASE_API + "/admin-api/ecw/receipt-item/import"
},
continueUploadModal: {
show: false,
msg: ""
},
exportId: "", exportId: "",
open: false, open: false,
showSearch: true, showSearch: true,
...@@ -539,6 +338,9 @@ export default { ...@@ -539,6 +338,9 @@ export default {
prodId: null, prodId: null,
productRecord: null, productRecord: null,
followUpSalesmanId: null, followUpSalesmanId: null,
receiptItemStatus: null, //明细状态
invoicingStatus: null, //开票状态
invoiceDataStatus: null //开票明细状态
}, },
dateFilter: [], dateFilter: [],
downloading: false, // 导出状态 downloading: false, // 导出状态
...@@ -563,50 +365,132 @@ export default { ...@@ -563,50 +365,132 @@ export default {
dialogTitle2: "收款单批量反审核", dialogTitle2: "收款单批量反审核",
dialogVisible3: false, //批量反核销对话框 dialogVisible3: false, //批量反核销对话框
dialogTitle3: "收款单批量反核销", dialogTitle3: "收款单批量反核销",
currencyList: [], currencyList: []
}; }
}, },
activated() { activated() {
this.getList(); this.getList()
}, },
created() { created() {
//获取汇率 lanbm 2024-06-06 add //获取汇率 lanbm 2024-06-06 add
getCurrencyPage(this.params).then( getCurrencyPage(this.params).then((res) => (this.currencyList = res.data.list))
(res) => (this.currencyList = res.data.list)
);
let that = this; let that = this
listSimpleUsers().then((res) => (that.creatorData = res.data)); listSimpleUsers().then((res) => (that.creatorData = res.data))
this.getList(); this.getList()
}, },
methods: { methods: {
continueUpload() {
this.$refs.upload.handleStart(this.fileCopy.raw)
this.$refs.upload.submit()
},
handleShowFileUploadDialog() {
this.upload.open = true
this.upload.ignoreItem = false
this.$nextTick(() => {
this.upload.isUploading = false
this.$refs.upload.clearFiles()
})
// this.upload.url = process.env.VUE_APP_BASE_API + "/admin-api/ecw/receipt-item/import?ignoreItem=" + false
},
// 下载导入模板
importTemplate() {
handleDownloadReceiptTmp().then((res) => {
this.$download.excel(res, "银行收款信息模板.xlsx")
this.$message({
message: this.$t("下载模板成功"),
type: "success"
})
})
},
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.isUploading = false
// 错误
if (response.code == "1004520042") {
// this.$modal.msgError(response.msg)
this.$notify({
title: this.$t("错误提示"),
dangerouslyUseHTMLString: true,
message: this.$t(response.msg),
type: "error",
duration: 0
})
this.$refs.upload.clearFiles()
return
}
// 警告
if (response.code == "1004520043") {
this.upload.ignoreItem = true
this.fileCopy = file
// this.$modal.msgError(response.msg)
this.continueUploadModal.show = true
this.continueUploadModal.msg = response.msg
return
}
if (response.code !== 0) {
this.$modal.msgError(response.msg)
return
}
this.upload.open = false
this.$refs.upload.clearFiles()
// 拼接提示语
// let data = response.data
// let text = this.$t("创建成功数量:") + data.createUsernames.length
// for (const username of data.createUsernames) {
// text += "<br />&nbsp;&nbsp;&nbsp;&nbsp;" + username
// }
// text += "<br />更新成功数量:" + data.updateUsernames.length
// for (const username of data.updateUsernames) {
// text += "<br />&nbsp;&nbsp;&nbsp;&nbsp;" + username
// }
// text += "<br />更新失败数量:" + Object.keys(data.failureUsernames).length
// for (const username in data.failureUsernames) {
// text += "<br />&nbsp;&nbsp;&nbsp;&nbsp;" + username + this.$t(":") + data.failureUsernames[username]
// }
// this.$alert(text, this.$t("导入结果"), { dangerouslyUseHTMLString: true })
// this.getList()
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit()
},
//发票新增/编辑页面
goInvoiceOperate({ id, key }) {
this.$router.push("invoiceOperate?id=" + id + "&key=" + key)
},
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true
this.params = {}; this.params = {}
for (var key in this.queryParams) { for (var key in this.queryParams) {
if (this.queryParams[key]) { if (this.queryParams[key]) {
this.params[key] = this.queryParams[key]; this.params[key] = this.queryParams[key]
} }
} }
console.log(this.params); console.log(this.params)
// 处理查询参数 // 处理查询参数
let params = { ...this.params }; let params = this.removeEmpty({ ...this.params })
this.addBeginAndEndTime(params, this.dateRangeCreateTime, "createTime"); this.addBeginAndEndTime(params, this.dateRangeCreateTime, "createTime")
// 执行查询 // 执行查询
getReceiptList(params).then((response) => { getReceiptList(params).then((response) => {
this.list = response.data.list; this.list = response.data.list
this.total = response.data.total; this.total = response.data.total
this.loading = false; this.loading = false
}); })
}, },
changeCustomerId(e) { changeCustomerId(e) {
this.$set(this.queryParams, "customerId", e.id); this.$set(this.queryParams, "customerId", e.id)
}, },
verificationClick(row) { verificationClick(row) {
const id = row.id; const id = row.id
return this.$router.push("receiptDetail?id=" + id); return this.$router.push("receiptDetail?id=" + id)
// this.$modal // this.$modal
// .confirm("您确认要核销吗?") // .confirm("您确认要核销吗?")
// .then(function () { // .then(function () {
...@@ -619,8 +503,8 @@ export default { ...@@ -619,8 +503,8 @@ export default {
// .catch(() => {}); // .catch(() => {});
}, },
verificationCancelClick(row) { verificationCancelClick(row) {
const id = row.id; const id = row.id
return this.$router.push("receiptDetail?id=" + id); return this.$router.push("receiptDetail?id=" + id)
// this.$modal // this.$modal
// .confirm("您确认要反核销吗?") // .confirm("您确认要反核销吗?")
// .then(function () { // .then(function () {
...@@ -633,282 +517,275 @@ export default { ...@@ -633,282 +517,275 @@ export default {
// .catch(() => {}); // .catch(() => {});
}, },
getCurrencyLabel(id) { getCurrencyLabel(id) {
let label = this.currencyList.filter((item) => item.id == id); let label = this.currencyList.filter((item) => item.id == id)
if (label.length > 0) if (label.length > 0) return this.$i18n.locale == "zh_CN" ? label[0].titleZh : label[0].titleEn
return this.$i18n.locale == "zh_CN" return ""
? label[0].titleZh
: label[0].titleEn;
return "";
}, },
//显示取消审核弹窗 //显示取消审核弹窗
cancelClick(index, type) { cancelClick(index, type) {
this.selectIndex = index; this.selectIndex = index
this.cancelIndex = type; this.cancelIndex = type
this.cancelReason = ""; this.cancelReason = ""
if (this.cancelIndex == 1) { if (this.cancelIndex == 1) {
this.cancelTitle = this.$t("取消审核"); this.cancelTitle = this.$t("取消审核")
} else if (this.cancelIndex == 2) { } else if (this.cancelIndex == 2) {
this.cancelTitle = this.$t("取消反审核"); this.cancelTitle = this.$t("取消反审核")
} else if (this.cancelIndex == 3) { } else if (this.cancelIndex == 3) {
this.cancelTitle = this.$t("取消反核销审核"); this.cancelTitle = this.$t("取消反核销审核")
} else { } else {
this.cancelTitle = this.$t("取消全部核销审核"); this.cancelTitle = this.$t("取消全部核销审核")
} }
this.cancelShow = true; this.cancelShow = true
}, },
//取消审核 //取消审核
cancelWriteOffClick() { cancelWriteOffClick() {
if (!this.cancelReason) { if (!this.cancelReason) {
this.$modal.msgError(this.$t("请输入申请理由")); this.$modal.msgError(this.$t("请输入申请理由"))
return; return
} }
var receiptId = this.list[this.selectIndex].id; var receiptId = this.list[this.selectIndex].id
if (this.cancelIndex == 1) { if (this.cancelIndex == 1) {
cancelFinanceReceiptApproval({ cancelFinanceReceiptApproval({
receiptId: receiptId, receiptId: receiptId,
remark: this.cancelReason, remark: this.cancelReason
}).then((res) => { }).then((res) => {
this.cancelShow = false; this.cancelShow = false
this.getList(); this.getList()
this.$message.success(this.$t("提交成功")); this.$message.success(this.$t("提交成功"))
}); })
} else if (this.cancelIndex == 2) { } else if (this.cancelIndex == 2) {
cancelFinanceReceiptApprovalNo({ cancelFinanceReceiptApprovalNo({
receiptId: receiptId, receiptId: receiptId,
remark: this.cancelReason, remark: this.cancelReason
}).then((res) => { }).then((res) => {
this.cancelShow = false; this.cancelShow = false
this.getList(); this.getList()
this.$message.success(this.$t("提交成功")); this.$message.success(this.$t("提交成功"))
}); })
} else if (this.cancelIndex == 3) { } else if (this.cancelIndex == 3) {
cancelFinanceReceiptWriteOffNo({ cancelFinanceReceiptWriteOffNo({
receiptId: receiptId, receiptId: receiptId,
remark: this.cancelReason, remark: this.cancelReason
}).then((res) => { }).then((res) => {
this.cancelShow = false; this.cancelShow = false
this.getList(); this.getList()
this.$message.success(this.$t("提交成功")); this.$message.success(this.$t("提交成功"))
}); })
} else { } else {
cancelFinanceReceiptWriteOff({ cancelFinanceReceiptWriteOff({
receiptId: receiptId, receiptId: receiptId,
remark: this.cancelReason, remark: this.cancelReason
}).then((res) => { }).then((res) => {
this.cancelShow = false; this.cancelShow = false
this.getList(); this.getList()
this.$message.success(this.$t("提交成功")); this.$message.success(this.$t("提交成功"))
}); })
} }
}, },
writeOffClick() { writeOffClick() {
if (!this.reason) { if (!this.reason) {
this.$modal.msgError(this.$t("请输入申请理由")); this.$modal.msgError(this.$t("请输入申请理由"))
return; return
} }
const receiptIdData = this.list[this.writeOffIndex]; const receiptIdData = this.list[this.writeOffIndex]
if (this.writeOffType == 1) { if (this.writeOffType == 1) {
financeApproveNo({ financeApproveNo({
receiptId: receiptIdData.id, receiptId: receiptIdData.id,
receiptNo: receiptIdData.receiptNo, receiptNo: receiptIdData.receiptNo,
remark: this.reason, remark: this.reason
}).then((res) => { }).then((res) => {
this.getList(); this.getList()
this.$message.success(this.$t("提交成功")); this.$message.success(this.$t("提交成功"))
this.dialogVisible = false; this.dialogVisible = false
}); })
} else { } else {
financeReceiptWriteOffNo({ financeReceiptWriteOffNo({
receiptId: receiptIdData.id, receiptId: receiptIdData.id,
receiptNo: receiptIdData.receiptNo, receiptNo: receiptIdData.receiptNo,
remark: this.reason, remark: this.reason
}).then((res) => { }).then((res) => {
this.getList(); this.getList()
this.$message.success(this.$t("提交成功")); this.$message.success(this.$t("提交成功"))
this.dialogVisible = false; this.dialogVisible = false
}); })
} }
}, },
deleteClick(row) { deleteClick(row) {
const id = row.id; const id = row.id
this.$modal this.$modal
.confirm(this.$t("是否确认删除该收款单") + "?") .confirm(this.$t("是否确认删除该收款单") + "?")
.then(function () { .then(function () {
return deleteReceipt(id); return deleteReceipt(id)
}) })
.then(() => { .then(() => {
this.getList(); this.getList()
this.$modal.msgSuccess(this.$t("删除成功")); this.$modal.msgSuccess(this.$t("删除成功"))
}) })
.catch(() => {}); .catch(() => {})
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
if (this.dateFilter && this.dateFilter.length > 0) { if (this.dateFilter && this.dateFilter.length > 0) {
this.queryParams.beginCreateTime = this.dateFilter[0]; this.queryParams.beginCreateTime = this.dateFilter[0]
this.queryParams.endCreateTime = this.dateFilter[1]; this.queryParams.endCreateTime = this.dateFilter[1]
} else { } else {
this.queryParams.beginCreateTime = ""; this.queryParams.beginCreateTime = ""
this.queryParams.endCreateTime = ""; this.queryParams.endCreateTime = ""
} }
this.queryParams.page = 1; this.queryParams.page = 1
this.getList(); this.getList()
}, },
handleQuery2() { handleQuery2() {
//批量反审核 lanbm 2024-05-14 add //批量反审核 lanbm 2024-05-14 add
if (this.ids.length == 0) { if (this.ids.length == 0) {
this.$message.error(this.$t("请选择需要批量反审核收款单。")); this.$message.error(this.$t("请选择需要批量反审核收款单。"))
return; return
} }
this.listPar = []; this.listPar = []
for (var i = 0; i < this.ids.length; i++) { for (var i = 0; i < this.ids.length; i++) {
if (this.ids[i].state != 1) { if (this.ids[i].state != 1) {
this.$message.error(this.$t("选中项中有不符合反审核条件的收款单。")); this.$message.error(this.$t("选中项中有不符合反审核条件的收款单。"))
return; return
} }
let obj = { let obj = {
receiptId: this.ids[i].id, receiptId: this.ids[i].id,
receiptNo: this.ids[i].receiptNo, receiptNo: this.ids[i].receiptNo,
remark: this.reason, remark: this.reason
}; }
this.listPar.push(obj); this.listPar.push(obj)
} }
this.reason = ""; this.reason = ""
this.dialogVisible2 = true; this.dialogVisible2 = true
}, },
writeOffClick2() { writeOffClick2() {
//批量反审核 提交响应函数 //批量反审核 提交响应函数
financeReceiptWriteOffNo2(this.listPar).then((res) => { financeReceiptWriteOffNo2(this.listPar).then((res) => {
this.getList(); this.getList()
this.$message.success(this.$t("提交成功")); this.$message.success(this.$t("提交成功"))
this.reason = ""; this.reason = ""
this.dialogVisible2 = true; this.dialogVisible2 = true
}); })
}, },
handleQuery3() { handleQuery3() {
//批量反核销 lanbm 2024-05-14 add //批量反核销 lanbm 2024-05-14 add
if (this.ids.length == 0) { if (this.ids.length == 0) {
this.$message.error(this.$t("请选择需要批量反核销收款单。")); this.$message.error(this.$t("请选择需要批量反核销收款单。"))
return; return
} }
this.listPar = []; this.listPar = []
for (var i = 0; i < this.ids.length; i++) { for (var i = 0; i < this.ids.length; i++) {
//必须满足能反核销的状态条件 //必须满足能反核销的状态条件
if ( if (this.ids[i].state == 4 || this.ids[i].state == 5 || this.ids[i].state == 6) {
this.ids[i].state == 4 ||
this.ids[i].state == 5 ||
this.ids[i].state == 6
) {
let obj = { let obj = {
receiptId: this.ids[i].id, receiptId: this.ids[i].id,
receiptNo: this.ids[i].receiptNo, receiptNo: this.ids[i].receiptNo,
remark: this.reason, remark: this.reason
}; }
this.listPar.push(obj); this.listPar.push(obj)
} else { } else {
this.$message.error(this.$t("选中项中有不符合反审核条件的收款单。")); this.$message.error(this.$t("选中项中有不符合反审核条件的收款单。"))
return; return
} }
} }
this.reason = ""; this.reason = ""
this.dialogVisible3 = true; this.dialogVisible3 = true
}, },
writeOffClick3() { writeOffClick3() {
//批量反核销 提交按钮响应函数 //批量反核销 提交按钮响应函数
financeReceiptWriteOffNo2(this.listPar).then((res) => { financeReceiptWriteOffNo2(this.listPar).then((res) => {
this.getList(); this.getList()
this.$message.success(this.$t("提交成功")); this.$message.success(this.$t("提交成功"))
this.reason = ""; this.reason = ""
this.dialogVisible3 = true; this.dialogVisible3 = true
}); })
}, },
handleQuery4() { handleQuery4() {
//批量核销 lanbm 2024-05-14 add //批量核销 lanbm 2024-05-14 add
if (this.ids.length == 0) { if (this.ids.length == 0) {
//校验参数 //校验参数
this.$message.error(this.$t("请选择需要批量核销的收款单。")); this.$message.error(this.$t("请选择需要批量核销的收款单。"))
return; return
} }
//var str = JSON.stringify(this.ids); //var str = JSON.stringify(this.ids);
this.listPar = []; this.listPar = []
for (var i = 0; i < this.ids.length; i++) { for (var i = 0; i < this.ids.length; i++) {
if (this.ids[i].state == 0) { if (this.ids[i].state == 0) {
this.$message.error(this.ids[i].receiptNo + "是草稿状态,不能核销。"); this.$message.error(this.ids[i].receiptNo + "是草稿状态,不能核销。")
return; return
} }
if (this.ids[i].state == 4) { if (this.ids[i].state == 4) {
this.$message.error( this.$message.error(this.ids[i].receiptNo + "是已核销状态,不用再次核销。")
this.ids[i].receiptNo + "是已核销状态,不用再次核销。" return
);
return;
} }
let obj = { let obj = {
receiptId: this.ids[i].id, receiptId: this.ids[i].id,
receiptNo: this.ids[i].receiptNo, receiptNo: this.ids[i].receiptNo,
remark: this.reason, remark: this.reason
}; }
this.listPar.push(obj); this.listPar.push(obj)
} }
//var str2 = JSON.stringify(listPar); //var str2 = JSON.stringify(listPar);
financeReceiptWriteOff2(this.listPar).then((res) => { financeReceiptWriteOff2(this.listPar).then((res) => {
this.getList(); this.getList()
this.$message.success(this.$t("提交成功")); this.$message.success(this.$t("提交成功"))
this.dialogVisible = false; this.dialogVisible = false
}); })
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd(id) { handleAdd(id) {
return this.$router.push("creatCollection?id=" + id); return this.$router.push("creatCollection?id=" + id)
}, },
toprint(id) { toprint(id) {
return this.$router.push("printVoucher?id=" + id); return this.$router.push("printVoucher?id=" + id)
}, },
openInvoice(id) { openInvoice(id) {
return this.$router.push("openInvoice?id=" + id); return this.$router.push("openInvoice?id=" + id)
}, },
exportReceipt(id) { exportReceipt(id) {
this.open = true; this.open = true
this.exportId = id; this.exportId = id
}, },
//显示反审核反核销弹窗 //显示反审核反核销弹窗
writeOffShow(type, index) { writeOffShow(type, index) {
this.writeOffType = type; this.writeOffType = type
this.writeOffIndex = index; this.writeOffIndex = index
this.reason = ""; this.reason = ""
this.dialogVisible = true; this.dialogVisible = true
}, },
submitForm(type) { submitForm(type) {
this.downloading = true; this.downloading = true
receiptExportExcel({ id: this.exportId, billType: type }) receiptExportExcel({ id: this.exportId, billType: type })
.then((response) => { .then((response) => {
this.$download.excel( this.$download.excel(response, `${type === 1 ? this.$t("国内账单") : "Debite_note"}.xls`)
response, this.open = false
`${type === 1 ? this.$t("国内账单") : "Debite_note"}.xls`
);
this.open = false;
}) })
.finally(() => (this.downloading = false)); .finally(() => (this.downloading = false))
}, },
paymentDetail2(row) { paymentDetail2(row) {
//到订单详情 lanbm 2024-05-29 add //到订单详情 lanbm 2024-05-29 add
const id = row.orderId; const id = row.orderId
//路由地址,不是文件路径地址 //路由地址,不是文件路径地址
return this.$router.push("/order/detail?orderId=" + id); return this.$router.push("/order/detail?orderId=" + id)
}, },
handleSelectionChange(selection) { handleSelectionChange(selection) {
//表格多选函数 lanbm 2024-05-20 add //表格多选函数 lanbm 2024-05-20 add
this.id = []; this.id = []
this.ids = selection; this.ids = selection
this.single = selection.length !== 1; this.single = selection.length !== 1
this.multiple = !selection.length; this.multiple = !selection.length
}, }
}, }
}; }
</script> </script>
<style scoped> <style scoped>
.dialog-footer-upload {
display: flex;
justify-content: end;
padding-top: 30px;
}
.card { .card {
margin-top: 20px; margin-top: 20px;
} }
...@@ -918,6 +795,7 @@ export default { ...@@ -918,6 +795,7 @@ export default {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
height: 160px; height: 160px;
} }
.dialog-footers { .dialog-footers {
......
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="120px"
>
<el-form-item label="收款单编号" prop="receiptNo"> <el-form-item label="收款单编号" prop="receiptNo">
<el-input <el-input v-model="queryParams.receiptNo" placeholder="收款单编号" clearable />
v-model="queryParams.receiptNo"
placeholder="收款单编号"
clearable
/>
</el-form-item> </el-form-item>
<el-form-item label="订单号" prop="orderNo"> <el-form-item label="订单号" prop="orderNo">
<el-input <el-input v-model="queryParams.orderNo" placeholder="订单号" clearable />
v-model="queryParams.orderNo"
placeholder="订单号"
clearable
/>
</el-form-item> </el-form-item>
<el-form-item label="提单号" prop="tidanNo"> <el-form-item label="提单号" prop="tidanNo">
<el-input <el-input v-model="queryParams.tidanNo" placeholder="提单号" clearable />
v-model="queryParams.tidanNo"
placeholder="提单号"
clearable
/>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="creator"> <el-form-item label="创建人" prop="creator">
<el-input <el-input v-model="queryParams.creator" placeholder="创建人" clearable />
v-model="queryParams.creator"
placeholder="创建人"
clearable
/>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createDate"> <el-form-item label="创建时间" prop="createDate">
<el-date-picker <el-date-picker v-model="queryParams.sDate1" type="date" style="width: 150px" value-format="yyyy-MM-dd" clearable placeholder="请输起始月" />
v-model="queryParams.sDate1" <el-date-picker v-model="queryParams.eDate1" type="date" style="width: 150px" value-format="yyyy-MM-dd" clearable placeholder="请输截止月" />
type="date"
style="width: 150px"
value-format="yyyy-MM-dd"
clearable
placeholder="请输起始月"
/>
<el-date-picker
v-model="queryParams.eDate1"
type="date"
style="width: 150px"
value-format="yyyy-MM-dd"
clearable
placeholder="请输截止月"
/>
</el-form-item> </el-form-item>
<el-form-item label="提交审批时间" prop="spDate"> <el-form-item label="提交审批时间" prop="spDate">
<el-date-picker <el-date-picker v-model="queryParams.sDate2" type="date" style="width: 150px" value-format="yyyy-MM-dd" clearable placeholder="请输起始月" />
v-model="queryParams.sDate2" <el-date-picker v-model="queryParams.eDate2" type="date" style="width: 150px" value-format="yyyy-MM-dd" clearable placeholder="请输截止月" />
type="date"
style="width: 150px"
value-format="yyyy-MM-dd"
clearable
placeholder="请输起始月"
/>
<el-date-picker
v-model="queryParams.eDate2"
type="date"
style="width: 150px"
value-format="yyyy-MM-dd"
clearable
placeholder="请输截止月"
/>
</el-form-item> </el-form-item>
<el-form-item label="审批通过时间" prop="tgDate"> <el-form-item label="审批通过时间" prop="tgDate">
<el-date-picker <el-date-picker v-model="queryParams.sDate3" type="date" style="width: 150px" value-format="yyyy-MM-dd" clearable placeholder="请输起始月" />
v-model="queryParams.sDate3" <el-date-picker v-model="queryParams.eDate3" type="date" style="width: 150px" value-format="yyyy-MM-dd" clearable placeholder="请输截止月" />
type="date"
style="width: 150px"
value-format="yyyy-MM-dd"
clearable
placeholder="请输起始月"
/>
<el-date-picker
v-model="queryParams.eDate3"
type="date"
style="width: 150px"
value-format="yyyy-MM-dd"
clearable
placeholder="请输截止月"
/>
</el-form-item> </el-form-item>
<el-form-item label="实收日期" prop="ssDate"> <el-form-item label="实收日期" prop="ssDate">
<el-date-picker <el-date-picker v-model="queryParams.sDate4" type="date" style="width: 150px" value-format="yyyy-MM-dd" clearable placeholder="请输起始月" />
v-model="queryParams.sDate4" <el-date-picker v-model="queryParams.eDate4" type="date" style="width: 150px" value-format="yyyy-MM-dd" clearable placeholder="请输截止月" />
type="date"
style="width: 150px"
value-format="yyyy-MM-dd"
clearable
placeholder="请输起始月"
/>
<el-date-picker
v-model="queryParams.eDate4"
type="date"
style="width: 150px"
value-format="yyyy-MM-dd"
clearable
placeholder="请输截止月"
/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('收款账户')" prop="accountNo"> <el-form-item :label="$t('收款账户')" prop="accountNo">
<el-select <el-select filterable clear v-model="queryParams.accountNo" :placeholder="$t('请选择收款账户')" style="width: 220px" v-el-select-loadmore="loadmore">
filterable <el-option v-for="item in bankData" :key="item.id" :label="item.baAccountName" :value="item.baAccountName" />
clear
v-model="queryParams.accountNo"
:placeholder="$t('请选择收款账户')"
style="width: 220px"
v-el-select-loadmore="loadmore"
>
<el-option
v-for="item in bankData"
:key="item.id"
:label="item.baAccountName"
:value="item.baAccountName"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="creator"> <el-form-item label="状态" prop="creator">
<el-select <el-select v-model="queryParams.status" clearable style="width: 100px">
v-model="queryParams.status" <el-option v-for="dict in getDictDatas(DICT_TYPE.RECEIPT_ITEM_STATE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
clearable
style="width: 100px"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.RECEIPT_ITEM_STATE)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('流水号')" prop="serialNumber">
<el-input v-model="queryParams.serialNumber" :placeholder="$t('流水号')" clearable />
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery" <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
>搜索</el-button
>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
<el-button type="primary" @click="handleAdd"> <el-button type="primary" @click="handleAdd"> {{ $t("批量提交审核") }}</el-button>
{{ $t("批量提交审核") }}</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> </el-col> <el-col :span="1.5"> </el-col>
<right-toolbar <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row> </el-row>
<el-table <el-table ref="multipleTable" v-loading="loading" :data="list" border row-key="id" @selection-change="handleSelectionChange">
ref="multipleTable" <el-table-column type="selection" width="50" :reserve-selection="true"> </el-table-column>
v-loading="loading" <el-table-column :label="$t('序号')" type="index" align="center" width="50"></el-table-column>
:data="list" <el-table-column :label="$t('收款单编号')" width="120" align="center" prop="receiptNo">
border
row-key="id"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="50" :reserve-selection="true">
</el-table-column>
<el-table-column
:label="$t('序号')"
type="index"
align="center"
width="50"
></el-table-column>
<el-table-column
:label="$t('收款单编号')"
align="center"
prop="receiptNo"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span style="color: #1890ff" @click="paymentDetail1(scope.row)">{{ <span style="color: #1890ff" @click="paymentDetail1(scope.row)">{{ scope.row.receiptNo }}</span>
scope.row.receiptNo
}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('订单编号')" align="center" prop="orderNo"> <el-table-column :label="$t('流水号')" width="160" align="center" prop="serialNumber" />
<template slot-scope="scope">
<span style="color: #1890ff" @click="paymentDetail2(scope.row)">{{ <el-table-column :label="$t('订单编号/提单编号')" width="200" align="center" prop="orderNo">
scope.row.orderNo <!-- <template slot-scope="scope"> -->
}}</span>
<template slot-scope="{ row }">
<div v-for="item in row.orderInfoList" :key="item.orderId">
<router-link :to="`/order/detail?orderId=${item.orderId}`" class="link-type"> {{ item.orderNo }}/{{ item.tidanNo }} </router-link>
</div>
<!-- <span style="color: #1890ff" @click="paymentDetail2(scope.row)">{{ scope.row.orderNo }}</span> -->
</template> </template>
<!-- <span style="color: #1890ff" @click="paymentDetail2(scope.row)">{{ scope.row.orderNo }}</span>
</template> -->
</el-table-column> </el-table-column>
<el-table-column :label="$t('提单编号')" align="center" prop="tidanNo"> <!-- <el-table-column :label="$t('提单编号')" align="center" prop="tidanNo">
<template slot-scope="scope"> <template slot-scope="scope">
<span style="color: #1890ff" @click="paymentDetail3(scope.row)">{{ <span style="color: #1890ff" @click="paymentDetail3(scope.row)">{{ scope.row.tidanNo }}</span>
scope.row.tidanNo
}}</span>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column <el-table-column :label="$t('收款账户')" width="100" align="center" prop="accountName" />
:label="$t('收款账户')" <el-table-column :label="$t('实收金额')" width="100" align="center" prop="amount" />
align="center"
prop="accountName"
/>
<el-table-column :label="$t('实收金额')" align="center" prop="amount" />
<el-table-column :label="$t('实收币种')" align="center" prop="marks"> <el-table-column :label="$t('实收币种')" align="center" prop="marks">
<template slot-scope="scope"> <template slot-scope="scope">
{{ getCurrencyLabel(scope.row.currencyId) }} {{ getCurrencyLabel(scope.row.currencyId) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('汇率')" align="center" prop="rate" /> <el-table-column :label="$t('汇率')" align="center" prop="rate" />
<el-table-column align="center" prop="writeOffAmount"> <el-table-column align="center" prop="writeOffAmount" :formatter="formatCurrency">
<template #header> <template #header> {{ $t("兑核销基准金额") }} </template>
{{ $t("兑核销基准金额") }}{{ getCurrencyLabel(showCurrencyId) }}
</template>
</el-table-column>
<el-table-column :label="$t('实收日期')" align="center" prop="amountDate">
</el-table-column> </el-table-column>
<el-table-column :label="$t('实收日期')" width="160" align="center" prop="amountDate"> </el-table-column>
<el-table-column :label="$t('水单号')" align="center" prop="billNo" /> <el-table-column :label="$t('水单号')" align="center" prop="billNo" />
<el-table-column :label="$t('水单附件')" align="center" prop="attr"> <el-table-column :label="$t('水单附件')" align="center" prop="attr">
<template slot-scope="scope" v-if="scope.row.attrList"> <template slot-scope="scope" v-if="scope.row.attrList">
<div v-for="(v, i) in scope.row.attrList" :key="i"> <div v-for="(v, i) in scope.row.attrList" :key="i">
<el-link :href="v.url" type="primary" target="_blank">{{ <el-link :href="v.url" type="primary" target="_blank">{{ v.name }}</el-link>
v.name
}}</el-link>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('状态')" align="center" prop="status"> <el-table-column :label="$t('状态')" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <dict-tag :type="DICT_TYPE.RECEIPT_ITEM_STATE" :value="scope.row.status" />
:type="DICT_TYPE.RECEIPT_ITEM_STATE"
:value="scope.row.status"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('创建人')" align="center" prop="creator" /> <el-table-column :label="$t('创建人')" align="center" prop="creator" />
<el-table-column <el-table-column :label="$t('创建时间')" width="160" align="center" prop="createTime" />
:label="$t('创建时间')" <el-table-column :label="$t('提交审批人')" align="center" prop="createBpm" />
align="center" <el-table-column :label="$t('提交审批时间')" width="160" align="center" prop="createTimeBpm" />
prop="createTime" <el-table-column :label="$t('审批通过时间')" width="160" align="center" prop="updateTimeBpm" />
/> <el-table-column :label="$t('操作')" fixed="right" align="center" width="200">
<el-table-column
:label="$t('提交审批人')"
align="center"
prop="createBpm"
/>
<el-table-column
:label="$t('提交审批时间')"
align="center"
prop="createTimeBpm"
/>
<el-table-column
:label="$t('审批通过时间')"
align="center"
prop="updateTimeBpm"
/>
<el-table-column :label="$t('操作')" align="center" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button v-if="scope.row.status == 0" v-hasPermi="['ecw:payment:detail:delete']" type="text" @click="deleteClick(scope.row)">{{ $t("删除") }}</el-button>
v-if="scope.row.status == 0" <el-button type="text" @click="detailClick(scope.row)" v-hasPermi="['ecw:payment:detail:detail']">{{ $t("详情") }}</el-button>
v-hasPermi="['ecw:payment:detail:delete']" <el-button v-if="scope.row.status == 0" type="text" @click="$router.push(`bankDetail?id=` + scope.row.receiptId + `&bankId=` + scope.row.id)" v-hasPermi="['ecw:payment:detail:writeOff']">{{ $t("提交") }}</el-button>
type="text" <el-button v-if="scope.row.status == 1" type="text" @click="showCancel(scope.$index)" v-hasPermi="['ecw:payment:detail:cancelWriteOff']">{{ $t("反核销") }}</el-button>
@click="deleteClick(scope.row)"
>{{ $t("删除") }}</el-button
>
<el-button
type="text"
@click="detailClick(scope.row)"
v-hasPermi="['ecw:payment:detail:detail']"
>{{ $t("详情") }}</el-button
>
<el-button
v-if="scope.row.status == 0"
type="text"
@click="
$router.push(
`bankDetail?id=` +
scope.row.receiptId +
`&bankId=` +
scope.row.id
)
"
v-hasPermi="['ecw:payment:detail:writeOff']"
>{{ $t("提交") }}</el-button
>
<el-button
v-if="scope.row.status == 1"
type="text"
@click="showCancel(scope.$index)"
v-hasPermi="['ecw:payment:detail:cancelWriteOff']"
>{{ $t("反核销") }}</el-button
>
<el-button <el-button v-if="scope.row.status == 0" type="text" @click="editClick(scope.row)" v-hasPermi="['ecw:payment:detail:bankEdit']">{{ $t("编辑") }}</el-button>
v-if="scope.row.status == 0" <el-button v-if="scope.row.status == 2" type="text" @click="cancelClick(scope.$index, 1)" v-hasPermi="['ecw:payment:detail:cancelDetailApproval']">{{ $t("取消审核") }}</el-button>
type="text" <el-button v-if="scope.row.status == 3" type="text" @click="cancelClick(scope.$index, 2)" v-hasPermi="['ecw:payment:detail:cancelWriteOffNo']">{{ $t("取消反核销审核") }}</el-button>
@click="editClick(scope.row)" <el-button v-if="scope.row.status == 3 || scope.row.status == 2" type="text" @click="$router.push(`/bpm/process-instance/detail?id=` + scope.row.bmpId)" v-hasPermi="['ecw:payment:detail:approval']">{{ $t("审核详情") }}</el-button>
v-hasPermi="['ecw:payment:detail:bankEdit']"
>{{ $t("编辑") }}</el-button
>
<el-button
v-if="scope.row.status == 2"
type="text"
@click="cancelClick(scope.$index, 1)"
v-hasPermi="['ecw:payment:detail:cancelDetailApproval']"
>{{ $t("取消审核") }}</el-button
>
<el-button
v-if="scope.row.status == 3"
type="text"
@click="cancelClick(scope.$index, 2)"
v-hasPermi="['ecw:payment:detail:cancelWriteOffNo']"
>{{ $t("取消反核销审核") }}</el-button
>
<el-button
v-if="scope.row.status == 3 || scope.row.status == 2"
type="text"
@click="
$router.push(`/bpm/process-instance/detail?id=` + scope.row.bmpId)
"
v-hasPermi="['ecw:payment:detail:approval']"
>{{ $t("审核详情") }}</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" @pagination="getList" />
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<el-dialog :title="cancelTitle" :visible.sync="cancelShow" width="30%"> <el-dialog :title="cancelTitle" :visible.sync="cancelShow" width="30%">
<div class="cancel_content"> <div class="cancel_content">
<span>{{ $t("申请理由") }}</span> <span>{{ $t("申请理由") }}</span>
<el-input <el-input type="textarea" :rows="6" v-model="cancelReason" :placeholder="$t('请输入取消理由')"></el-input>
type="textarea"
:rows="6"
v-model="cancelReason"
:placeholder="$t('请输入取消理由')"
></el-input>
</div> </div>
<span slot="footer" class="dialog-footers"> <span slot="footer" class="dialog-footers">
<el-button type="primary" @click="cancelWriteOffClick()">{{ <el-button type="primary" @click="cancelWriteOffClick()">{{ $t("提交") }}</el-button>
$t("提交")
}}</el-button>
<el-button @click="cancelShow = false">{{ $t("取消") }}</el-button> <el-button @click="cancelShow = false">{{ $t("取消") }}</el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog <el-dialog :title="$t('收款单银行实收明细反核销-未提交')" :visible.sync="dialogVisible" width="30%">
:title="$t('收款单银行实收明细反核销-未提交')"
:visible.sync="dialogVisible"
width="30%"
>
<div class="cancel_content"> <div class="cancel_content">
<span>{{ $t("申请理由") }}</span> <span>{{ $t("申请理由") }}</span>
<el-input <el-input type="textarea" :rows="6" v-model="reason" :placeholder="$t('请输入理由')"></el-input>
type="textarea"
:rows="6"
v-model="reason"
:placeholder="$t('请输入理由')"
></el-input>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="verificationCancelClick()">{{ <el-button type="primary" @click="verificationCancelClick()">{{ $t("提交反核销") }}</el-button>
$t("提交反核销")
}}</el-button>
<el-button @click="dialogVisible = false">{{ $t("取消") }}</el-button> <el-button @click="dialogVisible = false">{{ $t("取消") }}</el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog
:visible.sync="openAddDialog" <!--
:title="dialogTitle" <el-dialog :visible.sync="openAddDialog" :title="dialogTitle" width="50%" append-to-body>
width="50%"
append-to-body
>
<el-form ref="form" :model="form" label-width="250px"> <el-form ref="form" :model="form" label-width="250px">
<el-form-item :label="$t('流水号')">
<el-input disabled v-model="form.serialNumber" style="width: 220px"></el-input>
</el-form-item>
<el-form-item :label="$t('收款单号')"> <el-form-item :label="$t('收款单号')">
<el-input <el-input disabled v-model="form.receipt_no" style="width: 220px"></el-input>
disabled
v-model="form.receipt_no"
style="width: 220px"
></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('剩余应收金额')"> <el-form-item :label="$t('剩余应收金额')">
<span> {{ form.syValue }}</span> <span> {{ form.syValue }}</span>
</el-form-item> </el-form-item>
<el-form-item :label="$t('收款账户')" prop="accountNo"> <el-form-item :label="$t('收款账户')" prop="accountNo">
<el-select <el-select :disabled="isEdit" filterable clear v-model="form.accountId" :placeholder="$t('请选择收款账户')" style="width: 250px" @change="accountChange" v-el-select-loadmore="loadmore">
:disabled="isEdit" <el-option v-for="item in bankData" :key="item.id" :label="item.baAccountName + '(' + item.baAccountNum + ')'" :value="item.id" />
filterable
clear
v-model="form.accountId"
:placeholder="$t('请选择收款账户')"
style="width: 250px"
@change="accountChange"
v-el-select-loadmore="loadmore"
>
<el-option
v-for="item in bankData"
:key="item.id"
:label="item.baAccountName + '(' + item.baAccountNum + ')'"
:value="item.id"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('实收日期')" prop="amountDate"> <el-form-item :label="$t('实收日期')" prop="amountDate">
<el-date-picker <el-date-picker :disabled="isEdit" v-model="form.amountDate" type="date" style="width: 150px" value-format="yyyy-MM-dd"></el-date-picker>
:disabled="isEdit"
v-model="form.amountDate"
type="date"
style="width: 150px"
value-format="yyyy-MM-dd"
></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item :label="$t('实收')" prop="amount"> <el-form-item :label="$t('实收')" prop="amount">
<el-input <el-input v-model="form.amount" :disabled="isEdit" style="width: 100px"></el-input>
v-model="form.amount"
:disabled="isEdit"
style="width: 100px"
></el-input>
<el-select <el-select v-model="form.currencyId" :disabled="isEdit" :placeholder="$t('请选择')" @change="(val) => currencyIdChange(val)">
v-model="form.currencyId" <el-option v-for="item in currencyList" :key="item.id" :label="$i18n.locale == 'zh_CN' ? item.titleZh : item.titleEn" :value="item.id" />
:disabled="isEdit"
:placeholder="$t('请选择')"
@change="(val) => currencyIdChange(val)"
>
<el-option
v-for="item in currencyList"
:key="item.id"
:label="$i18n.locale == 'zh_CN' ? item.titleZh : item.titleEn"
:value="item.id"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="rate"> <el-form-item prop="rate">
<template slot="label"> <template slot="label">
<span <span :title="$t('实收币种与核销基准币种一样时,无需填写汇率,不一样需要填写汇率')">{{ $t("兑核销基准币种汇率") }}({{ getCurrencyLabel(showCurrencyId) }})</span>
:title="
$t(
'实收币种与核销基准币种一样时,无需填写汇率,不一样需要填写汇率'
)
"
>{{ $t("兑核销基准币种汇率") }}{{
getCurrencyLabel(showCurrencyId)
}}</span
>
</template> </template>
<el-input <el-input v-model="form.rate" :disabled="isEdit" style="width: 220px"></el-input>
v-model="form.rate"
:disabled="isEdit"
style="width: 220px"
></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<template slot="label"> <template slot="label"> {{ $t("兑核销基准币种金额") }}({{ getCurrencyLabel(showCurrencyId) }}) </template>
{{ $t("兑核销基准币种金额") }}{{ <el-input :disabled="isEdit" v-model="form.writeOffAmount" style="width: 220px"></el-input>
getCurrencyLabel(showCurrencyId)
}}
</template>
<el-input
:disabled="isEdit"
v-model="form.writeOffAmount"
style="width: 220px"
></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('水单附件')" prop="attr"> <el-form-item :label="$t('水单附件')" prop="attr">
<el-upload <el-upload v-if="!isView" class="upload-demo" :action="uploadFileUrl" :headers="headers" :on-success="handleUploadSuccess" :before-upload="handleBeforeUpload" :on-error="handleUploadError" :before-remove="beforeRemove" :file-list="form.attr" multiple>
v-if="!isView" <el-button size="small" type="primary">{{ $t("上传附件") }}</el-button>
class="upload-demo"
:action="uploadFileUrl"
:headers="headers"
:on-success="handleUploadSuccess"
:before-upload="handleBeforeUpload"
:on-error="handleUploadError"
:before-remove="beforeRemove"
:file-list="form.attr"
multiple
>
<el-button size="small" type="primary">{{
$t("上传附件")
}}</el-button>
</el-upload> </el-upload>
<div v-else> <div v-else>
<div v-for="(v, i) in form.attr" :key="i"> <div v-for="(v, i) in form.attr" :key="i">
<el-link :href="v.url" type="primary" target="_blank">{{ <el-link :href="v.url" type="primary" target="_blank">{{ v.name }}</el-link>
v.name
}}</el-link>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item :label="$t('水单号')" prop="billNo"> <el-form-item :label="$t('水单号')" prop="billNo">
<el-input <el-input v-model="form.billNo" :disabled="isEdit" style="width: 220px"></el-input>
v-model="form.billNo"
:disabled="isEdit"
style="width: 220px"
></el-input>
</el-form-item> </el-form-item>
<!--lanbm 2024-06-12 add-->
<el-form-item :label="$t('创建人')" v-show="isEdit" prop="creator"> <el-form-item :label="$t('创建人')" v-show="isEdit" prop="creator">
<el-input <el-input v-model="form.creator" style="width: 220px"></el-input>
v-model="form.creator"
style="width: 220px"
></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('创建时间')" v-show="isEdit" prop="createTime"> <el-form-item :label="$t('创建时间')" v-show="isEdit" prop="createTime">
<el-input <el-input v-model="form.createTime" style="width: 220px"></el-input>
v-model="form.createTime"
style="width: 220px"
></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('最后更新人')" v-show="isEdit" prop="updater"> <el-form-item :label="$t('最后更新人')" v-show="isEdit" prop="updater">
<el-input <el-input v-model="form.updater" style="width: 220px"></el-input>
v-model="form.updater"
style="width: 220px"
></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('最后更新时间')" v-show="isEdit" prop="updateTime"> <el-form-item :label="$t('最后更新时间')" v-show="isEdit" prop="updateTime">
<el-input <el-input v-model="form.updateTime" style="width: 220px"></el-input>
v-model="form.updateTime"
style="width: 220px"
></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('提交审批人')" v-show="isEdit" prop="createBpm"> <el-form-item :label="$t('提交审批人')" v-show="isEdit" prop="createBpm">
<el-input <el-input v-model="form.createBpm" style="width: 220px"></el-input>
v-model="form.createBpm"
style="width: 220px"
></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('审批通过时间')" v-show="isEdit" prop="updateTimeBpm"> <el-form-item :label="$t('审批通过时间')" v-show="isEdit" prop="updateTimeBpm">
<el-input <el-input v-model="form.updateTimeBpm" style="width: 220px"></el-input>
v-model="form.updateTimeBpm"
style="width: 220px"
></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer"> <div slot="footer">
<el-button type="primary" v-show="!isEdit" @click="saveFrom">{{ <el-button type="primary" v-show="!isEdit" @click="saveFrom">{{ saveBtnText }}</el-button>
saveBtnText
}}</el-button>
<el-button @click="hiddenDialog">{{ $t("取消") }}</el-button> <el-button @click="hiddenDialog">{{ $t("取消") }}</el-button>
</div> </div>
</el-dialog> </el-dialog> -->
<BankReceiptsDetailItem :bankReceiptId="bankReceiptId" :statusKey="bankDetailKey" :openBankReceiptsDetailItemDialog.sync="openDetailItemDialog"></BankReceiptsDetailItem>
</div> </div>
</template> </template>
<script> <script>
import { getPageList } from "@/api/report/bankReceiptDetail"; import { getPageList } from "@/api/report/bankReceiptDetail"
import { getReceivableItem2 } from "@/api/ecw/financial"; import { getReceivableItem2 } from "@/api/ecw/financial"
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect"
import "@/assets/styles/vue-treeselect.css"; import "@/assets/styles/vue-treeselect.css"
import { getBankAccountPage } from "@/api/ecw/bankAccount"; import { getBankAccountPage } from "@/api/ecw/bankAccount"
import { getCurrencyPage } from "@/api/ecw/currency"; import { getCurrencyPage } from "@/api/ecw/currency"
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth"
import { getExchangeRatePage } from "@/api/ecw/exchangeRate"; import { mapGetters } from "vuex"
import { getExchangeRatePage } from "@/api/ecw/exchangeRate"
import BankReceiptsDetailItem from "@/views/ecw/financial/components/BankReceiptsDetailItem.vue"
import { import {
deleteReceiptItem, //删除收款单明细 deleteReceiptItem, //删除收款单明细
updateReceiptItem, updateReceiptItem,
...@@ -568,21 +248,25 @@ import { ...@@ -568,21 +248,25 @@ import {
cancelFinanceReceiptApprovalNo, cancelFinanceReceiptApprovalNo,
cancelFinanceReceiptWriteOffNo, cancelFinanceReceiptWriteOffNo,
cancelFinanceReceiptWriteOff, cancelFinanceReceiptWriteOff,
financeReceiptItemWriteOffNo, financeReceiptItemWriteOffNo
} from "@/api/ecw/financial"; } from "@/api/ecw/financial"
//2024-05-14 银行收款明细列表 //2024-05-14 银行收款明细列表
export default { export default {
name: "ReportBankReceiptDetailsIndex", name: "ReportBankReceiptDetailsIndex",
components: { components: {
Treeselect, Treeselect,
BankReceiptsDetailItem
}, },
data() { data() {
return { return {
bankReceiptId: "",
bankDetailKey: "edit",
openDetailItemDialog: false,
uploadFileUrl: process.env.VUE_APP_BASE_API + "/app-api/file/upload", uploadFileUrl: process.env.VUE_APP_BASE_API + "/app-api/file/upload",
//上传的图片服务器地址 //上传的图片服务器地址
headers: { headers: {
Authorization: "Bearer " + getToken(), Authorization: "Bearer " + getToken()
}, },
// 遮罩层 // 遮罩层
loading: true, loading: true,
...@@ -631,11 +315,12 @@ export default { ...@@ -631,11 +315,12 @@ export default {
eDate4: undefined, //实收日期 eDate4: undefined, //实收日期
creator: undefined, //创建人 creator: undefined, //创建人
accountNo: undefined, //收款账号 lanbm 2024-06-12 add accountNo: undefined, //收款账号 lanbm 2024-06-12 add
status:undefined,//审批状态 lanbm 2024-06-13 add status: undefined, //审批状态 lanbm 2024-06-13 add
serialNumber: undefined
}, },
params: { params: {
page: 1, page: 1,
rows: 100, rows: 100
}, },
currencyList: [], currencyList: [],
// 非单个禁用 // 非单个禁用
...@@ -650,111 +335,119 @@ export default { ...@@ -650,111 +335,119 @@ export default {
bankData: [], bankData: [],
codePage: { codePage: {
pageNo: 1, pageNo: 1,
pageSize: 20, pageSize: 20
}, },
pages: 1, pages: 1,
rateList: [], rateList: []
}; }
}, },
async created() { async created() {
await getBankAccountPage(this.codePage).then((res) => { await getBankAccountPage(this.codePage).then((res) => {
this.bankData = res.data.list; this.bankData = res.data.list
this.pages = res.data.total / this.codePage.pageSize + 1; this.pages = res.data.total / this.codePage.pageSize + 1
}); })
// 获取汇率 // 获取汇率
await getExchangeRatePage(this.params).then( await getExchangeRatePage(this.params).then((res) => (this.rateList = res.data.list))
(res) => (this.rateList = res.data.list)
);
//币种 //币种
await getCurrencyPage(this.params).then( await getCurrencyPage(this.params).then((res) => (this.currencyList = res.data.list))
(res) => (this.currencyList = res.data.list) this.getList()
);
this.getList();
}, },
computed: { computed: {
...mapGetters(["getCurrencySymbol"]),
showCurrencyId() { showCurrencyId() {
let fieldList = []; let fieldList = []
let groupList = []; let groupList = []
this.list.map((element) => { this.list.map((element) => {
if (fieldList.indexOf(element["currencyId"]) === -1) { if (fieldList.indexOf(element["currencyId"]) === -1) {
fieldList.push(element["currencyId"]); fieldList.push(element["currencyId"])
} }
}); })
for (let i = 0; i < fieldList.length; i++) { for (let i = 0; i < fieldList.length; i++) {
let arr = this.list.filter((element) => { let arr = this.list.filter((element) => {
return element["currencyId"] === fieldList[i]; return element["currencyId"] === fieldList[i]
}); })
groupList.push({ groupList.push({
currencyId: arr[0].currencyId, currencyId: arr[0].currencyId,
list: arr, list: arr
}); })
} }
if (groupList.length === 1) return groupList[0].currencyId; if (groupList.length === 1) return groupList[0].currencyId
else return 1; else return 1
}, }
}, },
watch: { watch: {
"form.rate"() { "$route.query.receiptNo": {
this.setWriteOffAmount(); handler(val) {
}, if (val) {
this.queryParams.receiptNo = val
}
},
immediate: true
}
// "form.rate"() {
// this.setWriteOffAmount()
// }
}, },
methods: { methods: {
// 基准币种的展示
formatCurrency(row, column, cellValue) {
if (column.property == "writeOffAmount") {
return this.getCurrencySymbol(row.writeOffCurrencyId) + (cellValue || "0")
}
return this.getCurrencySymbol(row.currencyId) + (cellValue || "0")
},
isChinese() { isChinese() {
//基础函数,判断系统显示语言是中文还是英文 //基础函数,判断系统显示语言是中文还是英文
return this.$i18n.locale === "zh_CN"; return this.$i18n.locale === "zh_CN"
}, },
// 懒加载 // 懒加载
loadmore() { loadmore() {
this.codePage.pageNo++; this.codePage.pageNo++
// 大于页码不请求了 // 大于页码不请求了
if (this.codePage.pageNo > this.pages) { if (this.codePage.pageNo > this.pages) {
return; return
} }
this.getCodeList(); this.getCodeList()
}, },
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true
// 处理查询参数 // 处理查询参数
let params = { ...this.queryParams }; let params = { ...this.queryParams }
// 执行查询 // 执行查询
getPageList(params).then((response) => { getPageList(params).then((response) => {
this.list = response.data.list; this.list = response.data.list
this.total = response.data.total; this.total = response.data.total
this.loading = false; this.loading = false
}); })
}, },
currencyIdChange(val) { currencyIdChange(val) {
val = Number(val); val = Number(val)
let rate; let rate
if (val === this.showCurrencyId) { if (val === this.showCurrencyId) {
rate = 1; rate = 1
} else { } else {
rate = this.getRate(val, 1); rate = this.getRate(val, 1)
} }
this.$set(this.form, "rate", rate); this.$set(this.form, "rate", rate)
var sR = (rate * this.form.amount).toFixed(6); var sR = (rate * this.form.amount).toFixed(6)
this.$set(this.form, "writeOffAmount", sR); this.$set(this.form, "writeOffAmount", sR)
}, },
accountChange(val) { accountChange(val) {
let data = this.bankData.find((item) => item.id == val); let data = this.bankData.find((item) => item.id == val)
this.$set(this.form, "accountName", data.baAccountName || ""); this.$set(this.form, "accountName", data.baAccountName || "")
this.$set(this.form, "accountNo", data.baAccountNum || ""); this.$set(this.form, "accountNo", data.baAccountNum || "")
this.$set(this.form, "accountBankName", data.baBankName || ""); this.$set(this.form, "accountBankName", data.baBankName || "")
}, },
//获取汇率 //获取汇率
getRate(sourceCurrencyId, targetCurrencyId) { getRate(sourceCurrencyId, targetCurrencyId) {
//let json1 = JSON.stringify(this.rateList); //let json1 = JSON.stringify(this.rateList);
//alert(json1); //alert(json1);
let rate = this.rateList.find( let rate = this.rateList.find((v) => v.sourceCurrencyId === sourceCurrencyId && v.targetCurrencyId === targetCurrencyId)
(v) => if (rate) return rate.currencyRate
v.sourceCurrencyId === sourceCurrencyId && return ""
v.targetCurrencyId === targetCurrencyId
);
if (rate) return rate.currencyRate;
return "";
}, },
/** 表单重置 */ /** 表单重置 */
reset() { reset() {
...@@ -771,60 +464,60 @@ export default { ...@@ -771,60 +464,60 @@ export default {
sDate3: undefined, sDate3: undefined,
eDate3: undefined, //审批通过日期 eDate3: undefined, //审批通过日期
creator: undefined, //创建人 creator: undefined, //创建人
}; serialNumber: undefined
}
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1
this.getList(); this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.reset(); this.reset()
}, },
hiddenDialog() { hiddenDialog() {
this.openAddDialog = false; this.openAddDialog = false
}, },
saveFrom() { saveFrom() {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
if (this.form.id) { if (this.form.id) {
const params = { ...this.form }; const params = { ...this.form }
/* /*
params.attr && params.attr &&
(params.attr = params.attr.map((v) => v.url).join(",")); (params.attr = params.attr.map((v) => v.url).join(","));
*/ */
updateReceiptItem(params).then((res) => { updateReceiptItem(params).then((res) => {
this.$modal.msgSuccess(this.$t("修改成功")); this.$modal.msgSuccess(this.$t("修改成功"))
this.openAddDialog = false; this.openAddDialog = false
this.getList(); this.getList()
}); })
return; return
} }
const params = { ...this.form }; const params = { ...this.form }
params.attr && params.attr && (params.attr = params.attr.map((v) => v.url).join(","))
(params.attr = params.attr.map((v) => v.url).join(",")); params.receiptId = this.id
params.receiptId = this.id;
receiptItemCreate(params).then((res) => { receiptItemCreate(params).then((res) => {
this.$modal.msgSuccess(this.$t("新增成功")); this.$modal.msgSuccess(this.$t("新增成功"))
this.openAddDialog = false; this.openAddDialog = false
this.getList(); this.getList()
}); })
} }
}); })
}, },
//银行明细反核销 //银行明细反核销
verificationCancelClick() { verificationCancelClick() {
if (!this.reason) { if (!this.reason) {
this.$modal.msgError(this.$t("请输入申请理由")); this.$modal.msgError(this.$t("请输入申请理由"))
return; return
} }
//银行收款明细ID //银行收款明细ID
const s_id = this.list[this.selectIndex].id; const s_id = this.list[this.selectIndex].id
//收款单ID //收款单ID
const s_receiptId = this.list[this.selectIndex].receiptId; const s_receiptId = this.list[this.selectIndex].receiptId
const s_receiptNo = this.list[this.selectIndex].receiptNo; const s_receiptNo = this.list[this.selectIndex].receiptNo
this.$modal this.$modal
.confirm(this.$t("您确认要反核销吗") + "?") .confirm(this.$t("您确认要反核销吗") + "?")
.then(() => { .then(() => {
...@@ -832,328 +525,320 @@ export default { ...@@ -832,328 +525,320 @@ export default {
receiptId: s_receiptId, //收款单ID receiptId: s_receiptId, //收款单ID
receiptNo: s_receiptNo, //收款单编号 receiptNo: s_receiptNo, //收款单编号
receiptItemId: s_id, //银行收款明细项ID receiptItemId: s_id, //银行收款明细项ID
remark: this.reason, remark: this.reason
}).then((res) => { }).then((res) => {
this.getList(); this.getList()
this.$message.success(this.$t("提交成功")); this.$message.success(this.$t("提交成功"))
this.dialogVisible = false; this.dialogVisible = false
}); })
}) })
.catch(() => { .catch(() => {
this.dialogVisible = false; this.dialogVisible = false
}); })
}, },
//取消审核 //取消审核
cancelWriteOffClick() { cancelWriteOffClick() {
if (!this.cancelReason) { if (!this.cancelReason) {
this.$modal.msgError(this.$t("请输入申请理由")); this.$modal.msgError(this.$t("请输入申请理由"))
return; return
} }
//银行收款明细ID //银行收款明细ID
const s_id = this.list[this.selectIndex].id; const s_id = this.list[this.selectIndex].id
//收款单ID //收款单ID
var s_receiptId = this.list[this.selectIndex].receiptId; var s_receiptId = this.list[this.selectIndex].receiptId
if (this.cancelIndex == 1) { if (this.cancelIndex == 1) {
//取消审核 //取消审核
cancelFinanceReceiptApproval({ cancelFinanceReceiptApproval({
receiptId: s_receiptId, receiptId: s_receiptId,
remark: this.cancelReason, remark: this.cancelReason
}).then((res) => { }).then((res) => {
this.cancelShow = false; this.cancelShow = false
this.getList(); this.getList()
this.$message.success(this.$t("提交成功")); this.$message.success(this.$t("提交成功"))
}); })
} else if (this.cancelIndex == 2) { } else if (this.cancelIndex == 2) {
//取消反审核 //取消反审核
cancelFinanceReceiptApprovalNo({ cancelFinanceReceiptApprovalNo({
receiptId: s_receiptId, receiptId: s_receiptId,
remark: this.cancelReason, remark: this.cancelReason
}).then((res) => { }).then((res) => {
this.cancelShow = false; this.cancelShow = false
this.getList(); this.getList()
this.$message.success(this.$t("提交成功")); this.$message.success(this.$t("提交成功"))
}); })
} else if (this.cancelIndex == 3) { } else if (this.cancelIndex == 3) {
//取消反核销审核 //取消反核销审核
cancelFinanceReceiptWriteOffNo({ cancelFinanceReceiptWriteOffNo({
receiptId: s_receiptId, receiptId: s_receiptId,
remark: this.cancelReason, remark: this.cancelReason
}).then((res) => { }).then((res) => {
this.cancelShow = false; this.cancelShow = false
this.getList(); this.getList()
this.$message.success(this.$t("提交成功")); this.$message.success(this.$t("提交成功"))
}); })
} else { } else {
//取消全部核销审核 //取消全部核销审核
cancelFinanceReceiptWriteOff({ cancelFinanceReceiptWriteOff({
receiptId: s_receiptId, receiptId: s_receiptId,
remark: this.cancelReason, remark: this.cancelReason
}).then((res) => { }).then((res) => {
this.cancelShow = false; this.cancelShow = false
this.getList(); this.getList()
this.$message.success(this.$t("提交成功")); this.$message.success(this.$t("提交成功"))
}); })
} }
}, },
//显示反核销弹窗 //显示反核销弹窗
showCancel(index) { showCancel(index) {
this.selectIndex = index; this.selectIndex = index
this.reason = ""; this.reason = ""
this.dialogVisible = true; this.dialogVisible = true
}, },
//显示取消审核弹窗 //显示取消审核弹窗
cancelClick(index, type) { cancelClick(index, type) {
this.selectIndex = index; this.selectIndex = index
this.cancelIndex = type; this.cancelIndex = type
this.cancelReason = ""; this.cancelReason = ""
if (this.cancelIndex == 1) { if (this.cancelIndex == 1) {
this.cancelTitle = this.$t("取消审核"); this.cancelTitle = this.$t("取消审核")
} else if (this.cancelIndex == 2) { } else if (this.cancelIndex == 2) {
this.cancelTitle = this.$t("取消反审核"); this.cancelTitle = this.$t("取消反审核")
} else if (this.cancelIndex == 3) { } else if (this.cancelIndex == 3) {
this.cancelTitle = this.$t("取消反核销审核"); this.cancelTitle = this.$t("取消反核销审核")
} else { } else {
this.cancelTitle = this.$t("取消全部核销审核"); this.cancelTitle = this.$t("取消全部核销审核")
} }
this.cancelShow = true; this.cancelShow = true
}, },
/** 批量提交审核 */ /** 批量提交审核 */
handleAdd() { handleAdd() {
if (this.ids.length == 0) { if (this.ids.length == 0) {
this.$message.error(this.$t("请选择需要批量提交的收款明细。")); this.$message.error(this.$t("请选择需要批量提交的收款明细。"))
return; return
} }
let objDataList = []; let objDataList = []
for (var i = 0; i < this.ids.length; i++) { for (var i = 0; i < this.ids.length; i++) {
//选中项中都是待提交的记录 //选中项中都是待提交的记录
if (this.ids[i].status != 0) { if (this.ids[i].status != 0) {
this.$message.error(this.$t("选择中有不符合提交条件的收款明细。")); this.$message.error(this.$t("选择中有不符合提交条件的收款明细。"))
return; return
} }
var objData = { var objData = {
receiptId: this.ids[i].receiptId, //收款单ID receiptId: this.ids[i].receiptId, //收款单ID
receiptNo: this.ids[i].receiptNo, //收款单编号 receiptNo: this.ids[i].receiptNo, //收款单编号
receiptItemId: this.ids[i].id, //收款明细ID receiptItemId: this.ids[i].id //收款明细ID
}; }
objDataList.push(objData); objDataList.push(objData)
} }
this.$modal this.$modal
.confirm(this.$t("您确认要提交审核吗" + "?")) .confirm(this.$t("您确认要提交审核吗" + "?"))
.then(() => { .then(() => {
financeReceiptItemWriteOff2(objDataList).then((res) => { financeReceiptItemWriteOff2(objDataList).then((res) => {
this.$message.success(this.$t("提交成功")); this.$message.success(this.$t("提交成功"))
//刷新列表 //刷新列表
this.getList(); this.getList()
}); })
}) })
.catch(() => {}); .catch(() => {})
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (!valid) { if (!valid) {
return; return
} }
// 修改的提交 // 修改的提交
if (this.form.id != null) { if (this.form.id != null) {
update(this.form).then((response) => { update(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功")
this.open = false; this.open = false
this.getList(); this.getList()
}); })
return; return
} }
// 添加的提交 // 添加的提交
create(this.form).then((response) => { create(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功")
this.open = false; this.open = false
this.getList(); this.getList()
}); })
}); })
}, },
paymentDetail1(row) { paymentDetail1(row) {
//到收款单详情 lanbm 2024-05-18 add //到收款单详情 lanbm 2024-05-18 add
const id = row.receiptId; const id = row.receiptId
return this.$router.push("/financial/receiptDetail?id=" + id); return this.$router.push("/financial/receiptDetail?id=" + id)
}, },
paymentDetail2(row) { paymentDetail2(row) {
//到订单详情 lanbm 2024-05-18 add //到订单详情 lanbm 2024-05-18 add
const id = row.id; const id = row.id
return this.$router.push("/financial/receiptDetail?id=" + id); return this.$router.push("/financial/receiptDetail?id=" + id)
}, },
paymentDetail3(row) { paymentDetail3(row) {
//到提单详情 lanbm 2024-05-18 add //到提单详情 lanbm 2024-05-18 add
const id = row.id; const id = row.id
return this.$router.push("/financial/receiptDetail?id=" + id); return this.$router.push("/financial/receiptDetail?id=" + id)
}, },
getCurrencyLabel(id) { getCurrencyLabel(id) {
let label = this.currencyList.filter((item) => item.id == id); let label = this.currencyList.filter((item) => item.id == id)
if (label.length > 0) if (label.length > 0) return this.$i18n.locale == "zh_CN" ? label[0].titleZh : label[0].titleEn
return this.$i18n.locale == "zh_CN" return ""
? label[0].titleZh
: label[0].titleEn;
return "";
}, },
handleSelectionChange(selection) { handleSelectionChange(selection) {
//表格多选函数 lanbm 2024-05-30 add //表格多选函数 lanbm 2024-05-30 add
this.ids = []; this.ids = []
this.ids = selection; this.ids = selection
this.single = selection.length !== 1; this.single = selection.length !== 1
this.multiple = !selection.length; this.multiple = !selection.length
}, },
normalizer(node) { normalizer(node) {
if (node.children && !node.children.length) { if (node.children && !node.children.length) {
delete node.children; delete node.children
} }
return { return {
id: node.id, id: node.id,
label: node.name, label: node.name,
children: node.children, children: node.children
}; }
}, },
getsurplusData() { getsurplusData() {
// 已收 // 已收
this.surplusData = []; this.surplusData = []
let recepted = []; let recepted = []
this.detailed.forEach((item) => { this.detailed.forEach((item) => {
if (!recepted[item.currencyId]) { if (!recepted[item.currencyId]) {
recepted[item.currencyId] = item.amount; recepted[item.currencyId] = item.amount
} else } else recepted[item.currencyId] = NP.plus(recepted[item.currencyId], item.amount)
recepted[item.currencyId] = NP.plus( })
recepted[item.currencyId],
item.amount
);
});
// 应收 // 应收
let collom = []; let collom = []
// 从期望收费金额中提取应收币种和金额 // 从期望收费金额中提取应收币种和金额
this.form.receiptAccountList this.form.receiptAccountList
.find((item) => item.type == "total") .find((item) => item.type == "total")
.collectionAmount.forEach((item) => { .collectionAmount.forEach((item) => {
collom[item.currencyId] = item.amount; collom[item.currencyId] = item.amount
}); })
recepted.forEach((amount, currency) => { recepted.forEach((amount, currency) => {
if (amount) { if (amount) {
if (collom[currency]) { if (collom[currency]) {
if (collom[currency] - amount != 0) if (collom[currency] - amount != 0) this.surplusData[currency] = +parseFloat((collom[currency] - amount).toPrecision(12))
this.surplusData[currency] = +parseFloat(
(collom[currency] - amount).toPrecision(12)
);
} else { } else {
this.surplusData[currency] = -amount; this.surplusData[currency] = -amount
} }
} }
}); })
collom.forEach((amount, currency) => { collom.forEach((amount, currency) => {
if (amount) { if (amount) {
if (!this.surplusData[currency]) { if (!this.surplusData[currency]) {
if (recepted[currency]) { if (recepted[currency]) {
if (amount - recepted[currency] != 0) if (amount - recepted[currency] != 0) this.surplusData[currency] = +parseFloat((amount - recepted[currency]).toPrecision(12))
this.surplusData[currency] = +parseFloat(
(amount - recepted[currency]).toPrecision(12)
);
} else { } else {
this.surplusData[currency] = amount; this.surplusData[currency] = amount
} }
} }
} }
}); })
}, },
detailClick(row) { detailClick(row) {
//查看详情 this.bankDetailKey = "view"
let id = row.id; this.bankReceiptId = row.id
this.isEdit = true;
getReceivableItem2(id).then((response) => { this.openDetailItemDialog = true
this.form = response.data;
//收款单号 // this.dialogTitle = this.$t("银行实收明细详情")
this.form.receipt_no = row.receiptNo; // //查看详情
//实收币种 // let id = row.id
this.form.currencyName = this.getCurrencyLabel(row.currencyId); // this.isEdit = true
//水单附件 分解附件路径 // getReceivableItem2(id).then((response) => {
this.form.attr = response.data.attr // this.form = response.data
? response.data.attr // //收款单号
.split(",") // this.form.receipt_no = row.receiptNo
.map((t) => ({ name: t.slice(t.lastIndexOf("/") + 1), url: t })) // //实收币种
: []; // this.form.currencyName = this.getCurrencyLabel(row.currencyId)
this.openAddDialog = true; // //水单附件 分解附件路径
this.dialogTitle = this.$t("银行实收明细详情"); // this.form.attr = response.data.attr ? response.data.attr.split(",").map((t) => ({ name: t.slice(t.lastIndexOf("/") + 1), url: t })) : []
this.isView = true; // this.openAddDialog = true
}); // this.dialogTitle = this.$t("银行实收明细详情")
// this.isView = true
// })
}, },
editClick(row) { editClick(row) {
let id = row.id; this.bankDetailKey = "edit"
this.isEdit = false; this.bankReceiptId = row.id
getReceivableItem2(id).then((response) => { this.openDetailItemDialog = true
this.form = response.data;
//收款单号
this.form.receipt_no = row.receiptNo;
//实收币种
this.form.currencyName = this.getCurrencyLabel(row.currencyId);
//水单附件
this.form.attr = row.attr;
let bank = this.bankData.find( // this.dialogTitle = this.$t("编辑银行实收明细")
(v) => v.baAccountNum == this.form.accountNo // let id = row.id
); // this.isEdit = false
if (bank) this.form.accountId = bank.id; // getReceivableItem2(id).then((response) => {
// this.form = response.data
// //收款单号
// this.form.receipt_no = row.receiptNo
// //实收币种
// this.form.currencyName = this.getCurrencyLabel(row.currencyId)
// //水单附件
// this.form.attr = row.attr
this.openAddDialog = true; // let bank = this.bankData.find((v) => v.baAccountNum == this.form.accountNo)
this.dialogTitle = this.$t("编辑银行实收明细"); // if (bank) this.form.accountId = bank.id
this.saveBtnText = this.$t("提交");
this.isView = false; // this.openAddDialog = true
}); // this.dialogTitle = this.$t("编辑银行实收明细")
// this.saveBtnText = this.$t("提交")
// this.isView = false
// })
}, },
deleteClick(row) { deleteClick(row) {
const id = row.id; const id = row.id
this.$modal this.$modal
.confirm(this.$t("是否确认删除该收款单") + "?") .confirm(this.$t("是否确认删除该收款单") + "?")
.then(function () { .then(function () {
return deleteReceiptItem(id); return deleteReceiptItem(id)
}) })
.then(() => { .then(() => {
this.getList(); this.getList()
this.$modal.msgSuccess(this.$t("删除成功")); this.$modal.msgSuccess(this.$t("删除成功"))
}) })
.catch(() => {}); .catch(() => {})
}, },
handleUploadSuccess(res, file, fileList) { handleUploadSuccess(res, file, fileList) {
let arr = []; let arr = []
setTimeout(() => { setTimeout(() => {
fileList.forEach((item) => { fileList.forEach((item) => {
arr.push({ arr.push({
name: item.name, name: item.name,
url: item.response ? item.response.data : item.url, url: item.response ? item.response.data : item.url
}); })
}); })
this.form.attr = arr; this.form.attr = arr
}, 300); }, 300)
this.UpLoading.close(); this.UpLoading.close()
}, },
handleBeforeUpload() { handleBeforeUpload() {
this.UpLoading = this.$loading({ this.UpLoading = this.$loading({
lock: true, lock: true,
text: this.$t("上传中"), text: this.$t("上传中"),
background: "rgba(0, 0, 0, 0.7)", background: "rgba(0, 0, 0, 0.7)"
}); })
}, },
handleUploadError() { handleUploadError() {
this.$message({ this.$message({
type: "error", type: "error",
message: this.$t("上传失败"), message: this.$t("上传失败")
}); })
this.UpLoading.close(); this.UpLoading.close()
}, },
beforeRemove(file, fileList) { beforeRemove(file, fileList) {
return this.$confirm(this.$t("确定移除") + "?").then((res) => { return this.$confirm(this.$t("确定移除") + "?").then((res) => {
setTimeout(() => { setTimeout(() => {
this.form.attr = fileList.map((v) => ({ this.form.attr = fileList.map((v) => ({
name: v.name, name: v.name,
url: v.response ? v.response.data : v.url, url: v.response ? v.response.data : v.url
})); }))
}, 300); }, 300)
}); })
}, }
}, }
}; }
</script> </script>
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