Commit 18bb191d authored by Administrator's avatar Administrator

Merge branch 'pre-release' into 'jd_dev'

Pre Release分支合并到jd分支20250108

See merge request !127
parents 8013a2a0 c5eb4608
import request from '@/utils/request'
import request from "@/utils/request"
import { data } from "vue2-ace-editor"
// 创建收款单
export function createReceipt(data) {
return request({
url: '/ecw/receipt/create',
method: 'post',
url: "/ecw/receipt/create",
method: "post",
data: data
})
}
......@@ -12,26 +13,40 @@ export function createReceipt(data) {
// 更新收款单
export function updateReceipt(data) {
return request({
url: '/ecw/receipt/update',
method: 'put',
url: "/ecw/receipt/update",
method: "put",
data: data
})
}
// 获取收款单列表
export function getReceiptList(query) {
return request({
url: '/ecw/receipt/page',
method: 'get',
params: query
export function getReceiptList(data) {
const params = {
page: data.page,
rows: data.rows
}
return request({
url: "/ecw/receipt/page",
method: "post",
params,
data
})
}
// 获取应收款列表
export function getReceivableList(query) {
return request({
url: '/ecw/receivable/page',
method: 'get',
url: "/ecw/receivable/page",
method: "get",
params: query
})
}
// 获取应收款总额
export function getReceivableAmount(query) {
return request({
url: "/ecw/receivable/page/amount",
method: "get",
params: query
})
}
......@@ -39,8 +54,8 @@ export function getReceivableList(query) {
// 获取应收款详情
export function getReceivableInfoByIds(query) {
return request({
url: '/ecw/receivable/get',
method: 'get',
url: "/ecw/receivable/get",
method: "get",
params: query
})
}
......@@ -48,8 +63,8 @@ export function getReceivableInfoByIds(query) {
// 修改优惠信息
export function updateReceivableDiscountById(query) {
return request({
url: '/ecw/receivable/updateReceivableDiscountById',
method: 'post',
url: "/ecw/receivable/updateReceivableDiscountById",
method: "post",
data: query
})
}
......@@ -57,24 +72,24 @@ export function updateReceivableDiscountById(query) {
// 得到应收优惠的最后操作人
export function getReceivableDiscountLogById(query) {
return request({
url: '/ecw/receivable/getReceivableDiscountLogById',
method: 'get',
url: "/ecw/receivable/getReceivableDiscountLogById",
method: "get",
params: query
})
}
// 根据订单ID获得需要预付应收款列表
export function getReceivableByOrderId(query) {
return request({
url: '/ecw/receivable/getReceivableByOrderId',
method: 'get',
url: "/ecw/receivable/getReceivableByOrderId",
method: "get",
params: query
})
}
// 根据订单ID获得需要预付应收款列表
export function getFirstReceivableListByOrderId(query) {
return request({
url: '/ecw/receivable/getFirstReceivableListByOrderId',
method: 'get',
url: "/ecw/receivable/getFirstReceivableListByOrderId",
method: "get",
params: query
})
}
......@@ -98,8 +113,8 @@ export function getFirstReceivableListByOrderId(query) {
// 获取收款单详情
export function getReceiptInfoByIds(query) {
return request({
url: '/ecw/receipt/get',
method: 'get',
url: "/ecw/receipt/get",
method: "get",
params: query
})
}
......@@ -107,8 +122,8 @@ export function getReceiptInfoByIds(query) {
// 获取收款单明细列表
export function getReceivableItemDetail(query) {
return request({
url: '/ecw/receipt/getReceivableItemDetail',
method: 'get',
url: "/ecw/receipt/getReceivableItemDetail",
method: "get",
params: query
})
}
......@@ -116,8 +131,8 @@ export function getReceivableItemDetail(query) {
// 获取收款单明细
export function getInvoicingItem(query) {
return request({
url: '/ecw/receipt/getReceivableItemDetail',
method: 'get',
url: "/ecw/receipt/getReceivableItemDetail",
method: "get",
params: query
})
}
......@@ -125,8 +140,8 @@ export function getInvoicingItem(query) {
// 创建收款明细
export function receiptItemCreate(data) {
return request({
url: '/ecw/receipt-item/create',
method: 'post',
url: "/ecw/receipt-item/create",
method: "post",
data: data
})
}
......@@ -134,8 +149,8 @@ export function receiptItemCreate(data) {
// 根据收款单ID获得收款明细列表
export function getReceivableItem(query) {
return request({
url: '/ecw/receipt-item/getReceivableItem',
method: 'get',
url: "/ecw/receipt-item/getReceivableItem",
method: "get",
params: query
})
}
......@@ -143,16 +158,16 @@ export function getReceivableItem(query) {
//lanbm 2024-06-05 add
export function getReceivableItem2(id) {
return request({
url: '/ecw/receipt-item/get?id=' + id,
method: 'get'
url: "/ecw/receipt-item/get?id=" + id,
method: "get"
})
}
// 根据收款单ID获得收款账户细列表
export function getReceiptAccountList(query) {
return request({
url: '/ecw/receipt/getReceiptAccountList',
method: 'get',
url: "/ecw/receipt/getReceiptAccountList",
method: "get",
params: query
})
}
......@@ -160,16 +175,16 @@ export function getReceiptAccountList(query) {
// 删除收款明细
export function deleteReceiptItem(id) {
return request({
url: '/ecw/receipt-item/delete?id=' + id,
method: 'delete'
url: "/ecw/receipt-item/delete?id=" + id,
method: "delete"
})
}
// 更新收款明细
export function updateReceiptItem(data) {
return request({
url: '/ecw/receipt-item/update',
method: 'put',
url: "/ecw/receipt-item/update",
method: "put",
data: data
})
}
......@@ -177,24 +192,24 @@ export function updateReceiptItem(data) {
// 收款明细核销
export function receiptItemVerification(id) {
return request({
url: '/ecw/receipt-item/verification/' + id,
method: 'GET'
url: "/ecw/receipt-item/verification/" + id,
method: "GET"
})
}
// 反核销收款单
export function receiptItemVerificationCancel(id) {
return request({
url: '/ecw/receipt-item/verificationCancel/' + id,
method: 'GET'
url: "/ecw/receipt-item/verificationCancel/" + id,
method: "GET"
})
}
// 收款明细批量核销
export function receiptItemBatchVerification(query) {
return request({
url: '/ecw/receipt-item/batchVerification',
method: 'GET',
url: "/ecw/receipt-item/batchVerification",
method: "GET",
params: query
})
}
......@@ -202,8 +217,8 @@ export function receiptItemBatchVerification(query) {
// 收款单全部核销
export function receiptItemAllVerification(id) {
return request({
url: '/ecw/receipt-item/allVerification/' + id,
method: 'GET'
url: "/ecw/receipt-item/allVerification/" + id,
method: "GET"
})
}
......@@ -219,9 +234,9 @@ export function receiptItemAllVerification(id) {
// 导出收款单 Excel
export function receiptExportExcel(query) {
return request({
url: '/ecw/receipt/export-excel',
method: 'get',
responseType: 'blob',
url: "/ecw/receipt/export-excel",
method: "get",
responseType: "blob",
params: query
})
}
......@@ -229,34 +244,33 @@ export function receiptExportExcel(query) {
// 删除收款单
export function deleteReceipt(id) {
return request({
url: '/ecw/receipt/delete?id=' + id,
method: 'delete'
url: "/ecw/receipt/delete?id=" + id,
method: "delete"
})
}
// 获得收款单开票信息
export function getReceiptInvoicing(id) {
return request({
url: '/ecw/receipt/invoicing/info/' + id,
method: 'get'
url: "/ecw/receipt/invoicing/info/" + id,
method: "get"
})
}
// 更新收款单开票信息
export function updateReceiptInvoicing(data) {
return request({
url: '/ecw/receipt/invoicing/info',
method: 'put',
url: "/ecw/receipt/invoicing/info",
method: "put",
data: data
})
}
// 更新应付款
export function updatePayable(data) {
return request({
url: '/ecw/payable/update',
method: 'put',
url: "/ecw/payable/update",
method: "put",
data: data
})
}
......@@ -264,18 +278,16 @@ export function updatePayable(data) {
// 删除应付款
export function deletePayable(id) {
return request({
url: '/ecw/payable/delete?id=' + id,
method: 'delete'
url: "/ecw/payable/delete?id=" + id,
method: "delete"
})
}
// 获取应付款列表
export function getPayableList(query) {
return request({
url: '/ecw/payable/page',
method: 'get',
url: "/ecw/payable/page",
method: "get",
params: query
})
}
......@@ -283,16 +295,16 @@ export function getPayableList(query) {
// 获取应付款详情
export function getPayableInfoByIds(query) {
return request({
url: '/ecw/payable/get',
method: 'get',
url: "/ecw/payable/get",
method: "get",
params: query
})
}
//获取佣金应付款详情
export function getCommissionPayable(params){
export function getCommissionPayable(params) {
return request({
url:'/ecw/commission-payable/get',
method:"get",
url: "/ecw/commission-payable/get",
method: "get",
params
})
}
......@@ -300,16 +312,16 @@ export function getCommissionPayable(params){
// 创建付款单
export function createPayment(data) {
return request({
url: '/ecw/payment/create',
method: 'post',
url: "/ecw/payment/create",
method: "post",
data: data
})
}
// 创建佣金订单
export function commissionPayment(data){
export function commissionPayment(data) {
return request({
url:'/ecw/commission-payment/create',
method:'post',
url: "/ecw/commission-payment/create",
method: "post",
data
})
}
......@@ -317,8 +329,8 @@ export function commissionPayment(data){
// 获取付款单列表
export function getPaymentList(query) {
return request({
url: '/ecw/payment/page',
method: 'get',
url: "/ecw/payment/page",
method: "get",
params: query
})
}
......@@ -326,24 +338,24 @@ export function getPaymentList(query) {
// 获取付款单详情
export function getPaymentInfoByIds(query) {
return request({
url: '/ecw/payment/get',
method: 'get',
url: "/ecw/payment/get",
method: "get",
params: query
})
}
// 获得佣金付款单
export function getCommissionPayment(params){
export function getCommissionPayment(params) {
return request({
url:'/ecw/commission-payment/get',
method:'get',
url: "/ecw/commission-payment/get",
method: "get",
params
})
}
// 获得佣金付款单列表
export function getCommissionPayableList(params){
export function getCommissionPayableList(params) {
return request({
url:'/ecw/commission-payable/list',
method:'get',
url: "/ecw/commission-payable/list",
method: "get",
params
})
}
......@@ -351,26 +363,25 @@ export function getCommissionPayableList(params){
// 获得付款单付款明细
export function getPaymentItem(query) {
return request({
url: '/ecw/payment/getPaymentItem',
method: 'get',
url: "/ecw/payment/getPaymentItem",
method: "get",
params: query
})
}
// 更新付款单
export function updatePayment(data) {
return request({
url: '/ecw/payment/update',
method: 'put',
url: "/ecw/payment/update",
method: "put",
data: data
})
}
// 更新佣金付款单
export function commissionPaymentUpdate(data){
export function commissionPaymentUpdate(data) {
return request({
url:'/ecw/commission-payment/update',
method:'put',
url: "/ecw/commission-payment/update",
method: "put",
data
})
}
......@@ -378,16 +389,16 @@ export function commissionPaymentUpdate(data){
// 删除付款单
export function deletePayment(id) {
return request({
url: '/ecw/payment/delete?id=' + id,
method: 'delete'
url: "/ecw/payment/delete?id=" + id,
method: "delete"
})
}
// 审核付款单
export function paymentVerify(query) {
return request({
url: '/ecw/payment/verify',
method: 'post',
url: "/ecw/payment/verify",
method: "post",
data: query
})
}
......@@ -395,8 +406,8 @@ export function paymentVerify(query) {
// 核销付款单
export function paymentVerification(data) {
return request({
url: '/ecw/payment/verification',
method: 'post',
url: "/ecw/payment/verification",
method: "post",
data
})
}
......@@ -404,16 +415,16 @@ export function paymentVerification(data) {
// 反核销付款单
export function paymentVerificationCancel(data) {
return request({
url: '/ecw/payment/verificationCancel',
method: 'post',
url: "/ecw/payment/verificationCancel",
method: "post",
data
})
}
// 取消付款单反核销
export function paymentCancelFinancePaymentWriteOffNo(data){
export function paymentCancelFinancePaymentWriteOffNo(data) {
return request({
url:'ecw/payment/cancelFinancePaymentWriteOffNo',
method:'post',
url: "ecw/payment/cancelFinancePaymentWriteOffNo",
method: "post",
data
})
}
......@@ -421,26 +432,26 @@ export function paymentCancelFinancePaymentWriteOffNo(data){
// 反审核付款单
export function paymentVerifyCancel(data) {
return request({
url: '/ecw/payment/verifyCancel',
method: 'post',
url: "/ecw/payment/verifyCancel",
method: "post",
data
})
}
//获取佣金应付款
export function payablePage(params){
export function payablePage(params) {
return request({
url:'/ecw/commission-payable/page',
method:'get',
url: "/ecw/commission-payable/page",
method: "get",
params
})
}
//获取佣金付款单
export function commissionPaymentPage(params){
export function commissionPaymentPage(params) {
return request({
url:'/ecw/commission-payment/page',
method:'get',
url: "/ecw/commission-payment/page",
method: "get",
params
})
}
......@@ -448,24 +459,24 @@ export function commissionPaymentPage(params){
// 根据流程主键获取付款单流程审核信息
export function getPaymentApprove(id) {
return request({
url: '/ecw/payment/getPaymentApprove?id='+id,
method: 'GET'
url: "/ecw/payment/getPaymentApprove?id=" + id,
method: "GET"
})
}
// 根据流程主键获取收款单流程审核信息
export function getReceiptApprove(id) {
return request({
url: '/ecw/receipt/getReceiptApprove?id='+id,
method: 'GET'
url: "/ecw/receipt/getReceiptApprove?id=" + id,
method: "GET"
})
}
// 收款单核销
export function financeReceiptWriteOff(query) {
return request({
url: '/ecw/receipt/financeReceiptWriteOff',
method: 'POST',
url: "/ecw/receipt/financeReceiptWriteOff",
method: "POST",
data: query
})
}
......@@ -473,8 +484,8 @@ export function financeReceiptWriteOff(query) {
// lanbm 2024-05-29 add 批量收款单核销
export function financeReceiptWriteOff2(query) {
return request({
url: '/ecw/receipt/financeReceiptWriteOff2',
method: 'POST',
url: "/ecw/receipt/financeReceiptWriteOff2",
method: "POST",
data: query
})
}
......@@ -482,8 +493,8 @@ export function financeReceiptWriteOff2(query) {
// 收款单银行明细核销
export function financeReceiptItemWriteOff(query) {
return request({
url: '/ecw/receipt-item/financeReceiptItemWriteOff',
method: 'POST',
url: "/ecw/receipt-item/financeReceiptItemWriteOff",
method: "POST",
data: query
})
}
......@@ -491,18 +502,17 @@ export function financeReceiptItemWriteOff(query) {
//批量 银行实收明细提交审核 lanbm 2024-05-30 add
export function financeReceiptItemWriteOff2(query) {
return request({
url: '/ecw/receipt-item/financeReceiptItemWriteOff2',
method: 'POST',
url: "/ecw/receipt-item/financeReceiptItemWriteOff2",
method: "POST",
data: query
})
}
// 收款单银行明细核销反审核
export function financeReceiptItemWriteOffNo(query) {
return request({
url: '/ecw/receipt-item/financeReceiptItemWriteOffNo',
method: 'POST',
url: "/ecw/receipt-item/financeReceiptItemWriteOffNo",
method: "POST",
data: query
})
}
......@@ -510,8 +520,8 @@ export function financeReceiptItemWriteOffNo(query) {
// 收款单反审核
export function financeApproveNo(query) {
return request({
url: '/ecw/receipt/financeApproveNo',
method: 'POST',
url: "/ecw/receipt/financeApproveNo",
method: "POST",
data: query
})
}
......@@ -520,8 +530,8 @@ export function financeApproveNo(query) {
//参数query 为List
export function financeApproveNo2(query) {
return request({
url: '/ecw/receipt/financeApproveNo2',
method: 'POST',
url: "/ecw/receipt/financeApproveNo2",
method: "POST",
data: query
})
}
......@@ -529,8 +539,8 @@ export function financeApproveNo2(query) {
// 收款单反核销
export function financeReceiptWriteOffNo(query) {
return request({
url: '/ecw/receipt/financeReceiptWriteOffNo',
method: 'POST',
url: "/ecw/receipt/financeReceiptWriteOffNo",
method: "POST",
data: query
})
}
......@@ -539,8 +549,8 @@ export function financeReceiptWriteOffNo(query) {
//query 为List
export function financeReceiptWriteOffNo2(query) {
return request({
url: '/ecw/receipt/financeReceiptWriteOffNo2',
method: 'POST',
url: "/ecw/receipt/financeReceiptWriteOffNo2",
method: "POST",
data: query
})
}
......@@ -548,8 +558,8 @@ export function financeReceiptWriteOffNo2(query) {
//收款单取消审核
export function cancelFinanceReceiptApproval(query) {
return request({
url: '/ecw/receipt/cancelFinanceReceiptApproval',
method: 'POST',
url: "/ecw/receipt/cancelFinanceReceiptApproval",
method: "POST",
data: query
})
}
......@@ -557,24 +567,24 @@ export function cancelFinanceReceiptApproval(query) {
// 取消收款单反审核
export function cancelFinanceReceiptApprovalNo(query) {
return request({
url: '/ecw/receipt/cancelFinanceReceiptApprovalNo',
method: 'POST',
url: "/ecw/receipt/cancelFinanceReceiptApprovalNo",
method: "POST",
data: query
})
}
// 取消收款单全部核销审核
export function cancelFinanceReceiptWriteOff(query) {
return request({
url: '/ecw/receipt/cancelFinanceReceiptWriteOff',
method: 'POST',
url: "/ecw/receipt/cancelFinanceReceiptWriteOff",
method: "POST",
data: query
})
}
// 取消收款单反核销
export function cancelFinanceReceiptWriteOffNo(query) {
return request({
url: '/ecw/receipt/cancelFinanceReceiptWriteOffNo',
method: 'POST',
url: "/ecw/receipt/cancelFinanceReceiptWriteOffNo",
method: "POST",
data: query
})
}
......@@ -582,8 +592,8 @@ export function cancelFinanceReceiptWriteOffNo(query) {
// 取消收款明细核销
export function cancelFinanceReceiptItemWriteOff(query) {
return request({
url: '/ecw/receipt-item/cancelFinanceReceiptItemWriteOff',
method: 'POST',
url: "/ecw/receipt-item/cancelFinanceReceiptItemWriteOff",
method: "POST",
data: query
})
}
......@@ -591,118 +601,280 @@ export function cancelFinanceReceiptItemWriteOff(query) {
// 取消收款明细反核销
export function cancelFinanceReceiptItemWriteOffNo(query) {
return request({
url: '/ecw/receipt-item/cancelFinanceReceiptItemWriteOffNo',
method: 'POST',
url: "/ecw/receipt-item/cancelFinanceReceiptItemWriteOffNo",
method: "POST",
data: query
})
}
// 取消审核
export function cancelFinancePaymentApproval(data){
export function cancelFinancePaymentApproval(data) {
return request({
url:'/ecw/payment/cancelFinancePaymentApproval',
method:'post',
url: "/ecw/payment/cancelFinancePaymentApproval",
method: "post",
data
})
}
// 取消付款单反审核
export function cancelFinancePaymentApprovalNo(data){
export function cancelFinancePaymentApprovalNo(data) {
return request({
url:'/ecw/payment/cancelFinancePaymentApprovalNo',
method:'post',
url: "/ecw/payment/cancelFinancePaymentApprovalNo",
method: "post",
data
})
}
// 取消付款单核销
export function cancelFinancePaymentWriteOff(data){
export function cancelFinancePaymentWriteOff(data) {
return request({
url:'/ecw/payment/cancelFinancePaymentWriteOff',
method:'post',
url: "/ecw/payment/cancelFinancePaymentWriteOff",
method: "post",
data
})
}
// 取消付款单反核销
export function cancelFinancePaymentWriteOffNo(data){
export function cancelFinancePaymentWriteOffNo(data) {
return request({
url:'/ecw/payment/cancelFinancePaymentWriteOffNo',
method:'post',
url: "/ecw/payment/cancelFinancePaymentWriteOffNo",
method: "post",
data
})
}
//删除佣金付款单
export function commissionPaymentDelete(params){
export function commissionPaymentDelete(params) {
return request({
url:'/ecw/commission-payment/delete',
method:'delete',
url: "/ecw/commission-payment/delete",
method: "delete",
params
})
}
//反审核佣金付款单
export function commissionPaymentVerifyCancel(data){
export function commissionPaymentVerifyCancel(data) {
return request({
url:'/ecw/commission-payment/verifyCancel',
method:'post',
url: "/ecw/commission-payment/verifyCancel",
method: "post",
data
})
}
// 佣金付款单核销
export function commissionPaymentVerification(data){
export function commissionPaymentVerification(data) {
return request({
url:'/ecw/commission-payment/verification',
method:'post',
url: "/ecw/commission-payment/verification",
method: "post",
data
})
}
//付款单反核销申请
export function commissionPaymentVerificationCancel(data){
export function commissionPaymentVerificationCancel(data) {
return request({
url:'/ecw/commission-payment/verificationCancel',
method:'post',
url: "/ecw/commission-payment/verificationCancel",
method: "post",
data
})
}
// 取消付款单反审核
export function commissionPaymentCancelFinancePaymentApprovalNo(data){
export function commissionPaymentCancelFinancePaymentApprovalNo(data) {
return request({
url:'/ecw/commission-payment/cancelFinancePaymentApprovalNo',
method:'post',
url: "/ecw/commission-payment/cancelFinancePaymentApprovalNo",
method: "post",
data
})
}
// 取消付款单核销
export function commissionPaymentCancelFinancePaymentWriteOff(data){
export function commissionPaymentCancelFinancePaymentWriteOff(data) {
return request({
url:'/ecw/commission-payment/cancelFinancePaymentWriteOff',
method:'post',
url: "/ecw/commission-payment/cancelFinancePaymentWriteOff",
method: "post",
data
})
}
// 取消付款单反核销
export function commissionPaymentCancelFinancePaymentWriteOffNo(data){
export function commissionPaymentCancelFinancePaymentWriteOffNo(data) {
return request({
url:'/ecw/commission-payment/cancelFinancePaymentWriteOffNo',
method:'post',
data,
url: "/ecw/commission-payment/cancelFinancePaymentWriteOffNo",
method: "post",
data
})
}
//取消付款单审核
export function commissionPaymentCancelFinancePaymentApproval(data){
export function commissionPaymentCancelFinancePaymentApproval(data) {
return request({
url:'/ecw/commission-payment/cancelFinancePaymentApproval',
method:'post',
url: "/ecw/commission-payment/cancelFinancePaymentApproval",
method: "post",
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({
url: "/ecw/receipt-invoice/receipt/info/get",
method: "get",
params
})
}
//通过开票ID获得收款单开票信息
export function loadINVInfoByInvoiceId(params) {
return request({
url:'/ecw/commission-payment/getPaymentApprove',
method:'get',
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>
<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-select>
</template>
<script>
export default {
data(){
data() {
return {
valueSync: undefined
}
},
props:{
props: {
options: Array,
value: [String, Number, Array, Boolean, Object],
labelField: {
type: [String, Function],
default: 'label'
default: "label"
},
valueField: {
type: String,
default: 'value'
default: "value"
},
keyField:{
keyField: {
type: String,
default: 'value'
default: "value"
},
filterable: Boolean,
multiple: Boolean,
......@@ -32,12 +32,12 @@ export default {
disabled: Boolean,
test: String
},
computed:{
optionsFormated(){
computed: {
optionsFormated() {
let arr = []
this.options.forEach((item, index) => {
arr.push({
label: typeof this.labelField == 'string' ? item[this.labelField] : (this.labelField)(item, index),
label: typeof this.labelField == "string" ? item[this.labelField] : this.labelField(item, index),
value: item[this.valueField],
key: item[this.keyField]
})
......@@ -45,35 +45,35 @@ export default {
return arr
}
},
watch:{
valueSync(val){
console.log('valueSync变化', val, this.value)
this.$emit('input', val)
watch: {
valueSync(val) {
console.log("valueSync变化", val, this.value)
this.$emit("input", val)
},
value(value){
console.log('value传值变化', value, this.valueSync)
if(value !== undefined)this.valueSync = value
value(value) {
console.log("value传值变化", value, this.valueSync)
if (value !== undefined) this.valueSync = value
},
optionsFormated(){
optionsFormated() {
this.setDefault()
},
test(val, old){
console.warn('test变化', val, old)
test(val, old) {
console.warn("test变化", val, old)
}
},
created(){
if(this.test == 'allPriceUnit'){
console.log('allPriceUnit selector', this.value, this.defaultable)
created() {
if (this.test == "allPriceUnit") {
console.log("allPriceUnit selector", this.value, this.defaultable)
}
this.valueSync = this.value
this.setDefault()
},
methods:{
setDefault(){
if(!this.defaultable){
methods: {
setDefault() {
if (!this.defaultable) {
return false
}
if(this.optionsFormated.length && (this.valueSync == null || this.valueSync == '')){
if (this.optionsFormated.length && (this.valueSync == null || this.valueSync == "")) {
this.valueSync = this.optionsFormated[0].value
}
}
......
......@@ -740,6 +740,7 @@
"请输入邮箱": "please input your email",
"设为默认": "set as Default",
"请输入发票抬头": "Please enter the title of the invoice",
"请输入开票品名": "Please enter the invoice name",
"纳税人识别号": "Taxpayer Identification Number",
"请输入纳税人识别号": "Please enter the taxpayer identification number",
"开户行": "Opening Bank",
......@@ -4723,5 +4724,102 @@
"请输入免泡重量": "请输入免泡重量",
"出货撤回": "出货撤回",
"启用时间": "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 Cookies from 'js-cookie'
import Element from 'element-ui'
import './assets/styles/element-variables.scss'
import '@/assets/styles/index.scss' // global css
import '@/assets/styles/ruoyi.scss' // ruoyi css
import App from './App'
import store from './store'
import router from './router'
import directive from './directive' // directive
import plugins from './plugins' // plugins
import Print from 'vue-print-nb'
import './assets/icons' // icon
import './permission' // permission control
import './tongji' // 百度统计
import { getDicts } from "@/api/system/dict/data";
import { getConfigKey } from "@/api/infra/config";
import { parseTime, resetForm, addDateRange, addBeginAndEndTime, addBeginAndEndTimeNew, handleTree} from "@/utils/ruoyi";
import Pagination from "@/components/Pagination";
import Vue from "vue"
import Cookies from "js-cookie"
import Element from "element-ui"
import "./assets/styles/element-variables.scss"
import "@/assets/styles/index.scss" // global css
import "@/assets/styles/ruoyi.scss" // ruoyi css
import App from "./App"
import store from "./store"
import router from "./router"
import directive from "./directive" // directive
import plugins from "./plugins" // plugins
import Print from "vue-print-nb"
import "./assets/icons" // icon
import "./permission" // permission control
import "./tongji" // 百度统计
import { getDicts } from "@/api/system/dict/data"
import { getConfigKey } from "@/api/infra/config"
import { parseTime, resetForm, addDateRange, addBeginAndEndTime, addBeginAndEndTimeNew, handleTree } from "@/utils/ruoyi"
import { removeEmpty } from "@/utils/index"
import Pagination from "@/components/Pagination"
// 自定义表格工具扩展
import RightToolbar from "@/components/RightToolbar"
import DictSelector from '@/components/DictSelector'
import DictSelector from "@/components/DictSelector"
// 代码高亮插件
// import hljs from 'highlight.js'
// import 'highlight.js/styles/github-gist.css'
import {DICT_TYPE, getDictDataLabel, getDictDatas, getDictDatas2} from "@/utils/dict";
import i18n from './i18n'
import { DICT_TYPE, getDictDataLabel, getDictDatas, getDictDatas2 } from "@/utils/dict"
import i18n from "./i18n"
// 全局方法挂载
Vue.prototype.getDicts = getDicts
......@@ -39,8 +40,9 @@ Vue.prototype.getDictDatas2 = getDictDatas2
Vue.prototype.getDictDataLabel = getDictDataLabel
Vue.prototype.DICT_TYPE = DICT_TYPE
Vue.prototype.handleTree = handleTree
Vue.prototype.removeEmpty = removeEmpty
Date.prototype.format = function(format) {
Date.prototype.format = function (format) {
var date = {
"M+": this.getMonth() + 1,
"d+": this.getDate(),
......@@ -49,30 +51,29 @@ Date.prototype.format = function(format) {
"s+": this.getSeconds(),
"q+": Math.floor((this.getMonth() + 3) / 3),
"S+": this.getMilliseconds()
};
}
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) {
if (new RegExp("(" + k + ")").test(format)) {
format = format.replace(RegExp.$1, RegExp.$1.length == 1
? date[k] : ("00" + date[k]).substr(("" + date[k]).length));
format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? date[k] : ("00" + date[k]).substr(("" + date[k]).length))
}
}
return format;
return format
}
// 全局组件挂载
Vue.component('DictTag', DictTag)
Vue.component('DocAlert', DocAlert)
Vue.component('Pagination', Pagination)
Vue.component('RightToolbar', RightToolbar)
Vue.component('DictSelector', DictSelector)
Vue.component("DictTag", DictTag)
Vue.component("DocAlert", DocAlert)
Vue.component("Pagination", Pagination)
Vue.component("RightToolbar", RightToolbar)
Vue.component("DictSelector", DictSelector)
// 字典标签组件
import DictTag from '@/components/DictTag'
import DocAlert from '@/components/DocAlert'
import DictTag from "@/components/DictTag"
import DocAlert from "@/components/DocAlert"
// 头部标签插件
import VueMeta from 'vue-meta'
import VueMeta from "vue-meta"
Vue.use(directive)
Vue.use(plugins)
......@@ -81,22 +82,22 @@ Vue.use(Print)
// Vue.use(hljs.vuePlugin);
// bpmnProcessDesigner 需要引入
import MyPD from "@/components/bpmnProcessDesigner/package/index.js";
Vue.use(MyPD);
import "@/components/bpmnProcessDesigner/package/theme/index.scss";
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-codes.css";
import "bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css";
import MyPD from "@/components/bpmnProcessDesigner/package/index.js"
Vue.use(MyPD)
import "@/components/bpmnProcessDesigner/package/theme/index.scss"
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-codes.css"
import "bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css"
// Form Generator 组件需要使用到 tinymce
import Tinymce from '@/components/tinymce/index.vue'
Vue.component('tinymce', Tinymce)
import '@/icons'
import axios from 'axios'
import Tinymce from "@/components/tinymce/index.vue"
Vue.component("tinymce", Tinymce)
import "@/icons"
import axios from "axios"
Vue.prototype.$axios = axios
import '@/styles/index.scss'
import '@/styles/custom.scss'
import "@/styles/index.scss"
import "@/styles/custom.scss"
/**
* If you don't want to use mock-server
......@@ -108,11 +109,11 @@ import '@/styles/custom.scss'
*/
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)
})
// 重定向路由(关闭当前标签)
Vue.prototype.$redirect = (path) =>{
Vue.prototype.$redirect = (path) => {
let currentView = router.history.current
router.replace(path)
store.dispatch("tagsView/delView", currentView)
......@@ -125,23 +126,29 @@ Vue.prototype.$showFormValidateErrors = (errors) => {
let createElement = vm.$createElement
let fieldList = Object.values(errors)
Element.Notification({
title: i18n.$t('表单错误'),
type: 'warning',
title: i18n.$t("表单错误"),
type: "warning",
duration: 3000,
message: createElement('div', fieldList.map(function (errorList) {
return createElement('div', errorList.map((item) => {
return createElement('div', item.message)
}))
}))
message: createElement(
"div",
fieldList.map(function (errorList) {
return createElement(
"div",
errorList.map((item) => {
return createElement("div", item.message)
})
)
})
)
})
}
Vue.config.productionTip = false
new Vue({
el: '#app',
el: "#app",
router,
store,
i18n,
render: h => h(App)
render: (h) => h(App)
})
import router from "./router";
import store from "./store";
import { Message } from "element-ui";
import NProgress from "nprogress";
import "nprogress/nprogress.css";
import { getToken } from "@/utils/auth";
import { isRelogin } from "@/utils/request";
import router from "./router"
import store from "./store"
import { Message } from "element-ui"
import NProgress from "nprogress"
import "nprogress/nprogress.css"
import { getToken } from "@/utils/auth"
import { isRelogin } from "@/utils/request"
NProgress.configure({ showSpinner: false });
NProgress.configure({ showSpinner: false })
// 增加三方登陆 update by 芋艿
const whiteList = [
"/login",
"/social-login",
"/auth-redirect",
"/bind",
"/register",
"/oauthLogin/gitee",
];
const whiteList = ["/login", "/social-login", "/auth-redirect", "/bind", "/register", "/oauthLogin/gitee"]
router.beforeEach((to, from, next) => {
NProgress.start();
NProgress.start()
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()) {
to.meta.title && store.dispatch("settings/setTitle", to.meta.title);
to.meta.title && store.dispatch("settings/setTitle", to.meta.title)
/* has token*/
if (to.path === "/login") {
next({ path: "/" });
NProgress.done();
next({ path: "/" })
NProgress.done()
} else {
if (store.getters.roles.length === 0) {
isRelogin.show = true;
isRelogin.show = true
// 获取字典数据 add by 芋艿
store.dispatch("dict/loadDictDatas");
store.dispatch("dict/loadDictDatas")
//获取货币
store.dispatch("staticData/loadCurrencyList")
// 判断当前用户是否已拉取完user_info信息
store
.dispatch("GetInfo")
.then(() => {
isRelogin.show = false;
isRelogin.show = false
store.dispatch("GenerateRoutes").then((accessRoutes) => {
// 根据roles权限生成可访问的路由表
router.addRoutes(accessRoutes); // 动态添加可访问路由表
next({ ...to, replace: true }); // hack方法 确保addRoutes已完成
});
router.addRoutes(accessRoutes) // 动态添加可访问路由表
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
})
})
.catch((err) => {
store.dispatch("LogOut").then(() => {
Message.error(err);
next({ path: "/" });
});
});
Message.error(err)
next({ path: "/" })
})
})
} else {
next();
next()
}
}
} else {
// 没有token
if (whiteList.indexOf(to.path) !== -1) {
// 在免登录白名单,直接进入
next();
next()
} else {
next(`/login?redirect=${to.fullPath}`); // 否则全部重定向到登录页
NProgress.done();
next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
NProgress.done()
}
}
});
})
router.afterEach(() => {
NProgress.done();
});
NProgress.done()
})
import { getCurrency } from "@/api/ecw/currency"
const getters = {
sidebar: state => state.app.sidebar,
size: state => state.app.size,
device: state => state.app.device,
visitedViews: state => state.tagsView.visitedViews,
cachedViews: state => state.tagsView.cachedViews,
userId: state => state.user.id,
token: state => state.user.token,
avatar: state => state.user.avatar,
name: state => state.user.name,
introduction: state => state.user.introduction,
roles: state => state.user.roles,
permissions: state => state.user.permissions,
permission_routes: state => state.permission.routes,
sidebar: (state) => state.app.sidebar,
size: (state) => state.app.size,
device: (state) => state.app.device,
visitedViews: (state) => state.tagsView.visitedViews,
cachedViews: (state) => state.tagsView.cachedViews,
userId: (state) => state.user.id,
token: (state) => state.user.token,
avatar: (state) => state.user.avatar,
name: (state) => state.user.name,
introduction: (state) => state.user.introduction,
roles: (state) => state.user.roles,
permissions: (state) => state.user.permissions,
permission_routes: (state) => state.permission.routes,
// 工具栏
topbarRouters:state => state.permission.topbarRouters,
defaultRoutes:state => state.permission.defaultRoutes,
sidebarRouters:state => state.permission.sidebarRouters,
topbarRouters: (state) => state.permission.topbarRouters,
defaultRoutes: (state) => state.permission.defaultRoutes,
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
import Vue from 'vue'
import Vuex from 'vuex'
import app from './modules/app'
import user from './modules/user'
import tagsView from './modules/tagsView'
import permission from './modules/permission'
import settings from './modules/settings'
import dict from './modules/dict'
import getters from './getters'
import Vue from "vue"
import Vuex from "vuex"
import app from "./modules/app"
import user from "./modules/user"
import tagsView from "./modules/tagsView"
import permission from "./modules/permission"
import settings from "./modules/settings"
import dict from "./modules/dict"
import getters from "./getters"
import staticData from "./modules/staticData"
Vue.use(Vuex)
......@@ -18,6 +19,7 @@ const store = new Vuex.Store({
permission,
settings,
dict,
staticData
},
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 @@
*
* 数据字典工具类
*/
import store from "@/store";
import i18n from "@/i18n";
import store from "@/store"
import i18n from "@/i18n"
export const DICT_TYPE = {
USER_TYPE: "user_type",
......@@ -27,9 +27,9 @@ export const DICT_TYPE = {
SYSTEM_SMS_TEMPLATE_TYPE: "system_sms_template_type",
SYSTEM_SMS_SEND_STATUS: "system_sms_send_status",
SYSTEM_SMS_RECEIVE_STATUS: "system_sms_receive_status",
SYSTEM_SMS_NODE_NODE: 'system_sms_node_node',//节点
SYSTEM_SMS_TEMPLATE_MESSAGE_TYPE: 'system_sms_template_message_type',//发送类型
SYSTEM_SMS_TEMPLATE_LANGUAGE: 'system_sms_template_language',//节点
SYSTEM_SMS_NODE_NODE: "system_sms_node_node", //节点
SYSTEM_SMS_TEMPLATE_MESSAGE_TYPE: "system_sms_template_message_type", //发送类型
SYSTEM_SMS_TEMPLATE_LANGUAGE: "system_sms_template_language", //节点
SYSTEM_MAIL_SEND_STATUS: "mail_send_status",
SYSTEM_ERROR_CODE_TYPE: "system_error_code_type",
INTERNAL_MESSAGE_TYPE: "internal_message_type",
......@@ -158,25 +158,25 @@ export const DICT_TYPE = {
ECW_PORT_TYPE: "port_type", //港口类型
CERTIFICATE_TYPE: "certificate_type", //证件类型
//customer
CUSTOMER_CREDIT_RULE_TYPE: 'customer_credit_rule_type',
CUSTOMER_LEVEL_RULE_TYPE: 'customer_level_rule_type',
CUSTOMER_ESOURCE_TYPE:'customer_resource_type',//客户资源类型
CUSTOMER_OPERATE_TYPE:'customer_operate_type',
CUSTOMER_CREDIT_RULE_TYPE: "customer_credit_rule_type",
CUSTOMER_LEVEL_RULE_TYPE: "customer_level_rule_type",
CUSTOMER_ESOURCE_TYPE: "customer_resource_type", //客户资源类型
CUSTOMER_OPERATE_TYPE: "customer_operate_type",
CUSTOMER_GET_METHOD: 'customer_get_method', //获取方式
CUSTOMER_FROM: 'customer_from', //创建入口
CUSTOMER_ROLE: 'customer_role', //角色
PICKUP_POINTS: 'pickup_points', //常用提货网点
CUSTOMER_FOLLOWUP_TYPE: 'customer_followup_type', //跟进类型
CUSTOMER_FOLLOWUP_METHOD: 'customer_followup_method', //跟进方式
CUSTOMER_FOLLOWUP_SALE_STAGE: 'sale_stage', //销售阶段
CUSTOMER_FOLLOWUP_RESULT_TYPE: 'customer_followup_result_type', //跟进结果
CUSTOMER_FOLLOWUP_STATUS: 'customer_followup_status', //跟进状态
CUSTOMER_GET_METHOD: "customer_get_method", //获取方式
CUSTOMER_FROM: "customer_from", //创建入口
CUSTOMER_ROLE: "customer_role", //角色
PICKUP_POINTS: "pickup_points", //常用提货网点
CUSTOMER_FOLLOWUP_TYPE: "customer_followup_type", //跟进类型
CUSTOMER_FOLLOWUP_METHOD: "customer_followup_method", //跟进方式
CUSTOMER_FOLLOWUP_SALE_STAGE: "sale_stage", //销售阶段
CUSTOMER_FOLLOWUP_RESULT_TYPE: "customer_followup_result_type", //跟进结果
CUSTOMER_FOLLOWUP_STATUS: "customer_followup_status", //跟进状态
CUSTOMER_QUERY_NUMBER_FIELD: "customer_query_number_field", //客户查询数字字段
// order
ORDER_TYPE: "order_type", // 订单类型
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", //控货状态
DISBURSEMENT_TYPE: "disbursement_type", //垫付类型
DRAWEE: "drawee", // 付款人
......@@ -188,13 +188,11 @@ export const DICT_TYPE = {
PAYMENT_TYPE: "payment_type", //收款类型
ORDER_WAREHOUSE_IN_STATUS: "order_warehouse_in_diff_status", // 入仓状态
ORDER_NO_QUOTE_EXCEPTION_RESULT: "order_no_quote_exception_result", //未报价异常处理结果
ORDER_SUPERFLUOUS_BOX_EXCEPTION_RESULT:
"order_superfluous_box_exception_result", //多箱异常处理结果
ORDER_SUPERFLUOUS_BOX_EXCEPTION_RESULT: "order_superfluous_box_exception_result", //多箱异常处理结果
ORDER_LACI_BOX_EXCEPTION_RESULT: "order_lack_box_exception_result", //少箱异常处理结果
ORDER_PAY_EXCEPTION_RESULT: "order_pay_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_IN_WATER_EXCEPTION_RESULT: "order_in_water_exception_result", //货物浸水异常处理结果
ORDER_HEAVY_CARGO_EXCEPTION_RESULT: "order_heavy_cargo_exception_result", //重货异常处理结果
......@@ -280,7 +278,13 @@ export const DICT_TYPE = {
MEMBERSHIP_LEVELS: "membership_levels", //会员等级
ENABLE_STATUS: "enable_status", //会员等级规则开启状态
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 对应的数据字典数组
......@@ -294,7 +298,7 @@ export function getDictDatas(dictType) {
// debugger
// }
// debugger
return store.getters.dict_datas[dictType] || [];
return store.getters.dict_datas[dictType] || []
}
/**
......@@ -306,44 +310,44 @@ export function getDictDatas(dictType) {
*/
export function getDictDatas2(dictType, values) {
if (values === undefined) {
return [];
return []
}
// 如果是单个元素,则转换成数组
if (!Array.isArray(values)) {
values = [this.value];
values = [this.value]
}
// 获得字典数据
const results = [];
const results = []
for (const value of values) {
const dict = getDictData(dictType, value);
const dict = getDictData(dictType, value)
if (dict) {
results.push(dict);
results.push(dict)
}
}
// debugger
// console.log(results);
return results;
return results
}
export function getDictData(dictType, value) {
// 获取 dictType 对应的数据字典数组
const dictDatas = getDictDatas(dictType);
const dictDatas = getDictDatas(dictType)
if (!dictDatas || dictDatas.length === 0) {
return "";
return ""
}
// 获取 value 对应的展示名
value = value + ""; // 强制转换成字符串,因为 DictData 小类数值,是字符串
value = value + "" // 强制转换成字符串,因为 DictData 小类数值,是字符串
for (const dictData of dictDatas) {
if (dictData.value === value) {
return dictData;
return dictData
}
}
return undefined;
return undefined
}
export function getDictDataLabel(dictType, value) {
const dict = getDictData(dictType, value);
return dict ? i18n.l(dict, "label") : "";
const dict = getDictData(dictType, value)
return dict ? i18n.l(dict, "label") : ""
}
export class getDictDataL {}
import { parseTime } from './ruoyi'
import { parseTime } from "./ruoyi"
/**
* 表格时间格式化
*/
export function formatDate(cellValue) {
if (cellValue == null || cellValue == "") return "";
if (cellValue == null || cellValue == "") return ""
var date = new Date(cellValue)
var year = date.getFullYear()
var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
var seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds
var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1
var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate()
var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours()
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()
var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds()
return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds
}
/**
......@@ -21,7 +21,7 @@ export function formatDate(cellValue) {
* @returns {string}
*/
export function formatTime(time, option) {
if (('' + time).length === 10) {
if (("" + time).length === 10) {
time = parseInt(time) * 1000
} else {
time = +time
......@@ -32,29 +32,19 @@ export function formatTime(time, option) {
const diff = (now - d) / 1000
if (diff < 30) {
return '刚刚'
return "刚刚"
} else if (diff < 3600) {
// less 1 hour
return Math.ceil(diff / 60) + '分钟前'
return Math.ceil(diff / 60) + "分钟前"
} else if (diff < 3600 * 24) {
return Math.ceil(diff / 3600) + '小时前'
return Math.ceil(diff / 3600) + "小时前"
} else if (diff < 3600 * 24 * 2) {
return '1天前'
return "1天前"
}
if (option) {
return parseTime(time, option)
} else {
return (
d.getMonth() +
1 +
'' +
d.getDate() +
'' +
d.getHours() +
'' +
d.getMinutes() +
''
)
return d.getMonth() + 1 + "" + d.getDate() + "" + d.getHours() + "" + d.getMinutes() + ""
}
}
......@@ -64,7 +54,7 @@ export function formatTime(time, option) {
*/
export function getQueryObject(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 reg = /([^?&=]+)=([^?&=]*)/g
search.replace(reg, (rs, $1, $2) => {
......@@ -88,7 +78,7 @@ export function byteLength(str) {
const code = str.charCodeAt(i)
if (code > 0x7f && code <= 0x7ff) s++
else if (code > 0x7ff && code <= 0xffff) s += 2
if (code >= 0xDC00 && code <= 0xDFFF) i--
if (code >= 0xdc00 && code <= 0xdfff) i--
}
return s
}
......@@ -112,13 +102,13 @@ export function cleanArray(actual) {
* @returns {Array}
*/
export function param(json) {
if (!json) return ''
if (!json) return ""
return cleanArray(
Object.keys(json).map(key => {
if (json[key] === undefined) return ''
return encodeURIComponent(key) + '=' + encodeURIComponent(json[key])
Object.keys(json).map((key) => {
if (json[key] === undefined) return ""
return encodeURIComponent(key) + "=" + encodeURIComponent(json[key])
})
).join('&')
).join("&")
}
/**
......@@ -126,14 +116,14 @@ export function param(json) {
* @returns {Object}
*/
export function param2Obj(url) {
const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ')
const search = decodeURIComponent(url.split("?")[1]).replace(/\+/g, " ")
if (!search) {
return {}
}
const obj = {}
const searchArr = search.split('&')
searchArr.forEach(v => {
const index = v.indexOf('=')
const searchArr = search.split("&")
searchArr.forEach((v) => {
const index = v.indexOf("=")
if (index !== -1) {
const name = v.substring(0, index)
const val = v.substring(index + 1, v.length)
......@@ -148,7 +138,7 @@ export function param2Obj(url) {
* @returns {string}
*/
export function html2Text(val) {
const div = document.createElement('div')
const div = document.createElement("div")
div.innerHTML = val
return div.textContent || div.innerText
}
......@@ -160,15 +150,15 @@ export function html2Text(val) {
* @returns {Object}
*/
export function objectMerge(target, source) {
if (typeof target !== 'object') {
if (typeof target !== "object") {
target = {}
}
if (Array.isArray(source)) {
return source.slice()
}
Object.keys(source).forEach(property => {
Object.keys(source).forEach((property) => {
const sourceProperty = source[property]
if (typeof sourceProperty === 'object') {
if (typeof sourceProperty === "object") {
target[property] = objectMerge(target[property], sourceProperty)
} else {
target[property] = sourceProperty
......@@ -188,11 +178,9 @@ export function toggleClass(element, className) {
let classString = element.className
const nameIndex = classString.indexOf(className)
if (nameIndex === -1) {
classString += '' + className
classString += "" + className
} else {
classString =
classString.substr(0, nameIndex) +
classString.substr(nameIndex + className.length)
classString = classString.substr(0, nameIndex) + classString.substr(nameIndex + className.length)
}
element.className = classString
}
......@@ -202,7 +190,7 @@ export function toggleClass(element, className) {
* @returns {Date}
*/
export function getTime(type) {
if (type === 'start') {
if (type === "start") {
return new Date().getTime() - 3600 * 1000 * 24 * 90
} else {
return new Date(new Date().toDateString())
......@@ -218,7 +206,7 @@ export function getTime(type) {
export function debounce(func, wait, immediate) {
let timeout, args, context, timestamp, result
const later = function() {
const later = function () {
// 据上一次触发时间间隔
const last = +new Date() - timestamp
......@@ -235,7 +223,7 @@ export function debounce(func, wait, immediate) {
}
}
return function(...args) {
return function (...args) {
context = this
timestamp = +new Date()
const callNow = immediate && !timeout
......@@ -278,28 +266,34 @@ export function deepClone(obj) {
const _toString = Object.prototype.toString
// null, undefined, non-object, function
if (!obj || typeof obj !== 'object') {
if (!obj || typeof obj !== "object") {
return obj
}
// DOM Node
if (obj.nodeType && 'cloneNode' in obj) {
if (obj.nodeType && "cloneNode" in obj) {
return obj.cloneNode(true)
}
// Date
if (_toString.call(obj) === '[object Date]') {
if (_toString.call(obj) === "[object Date]") {
return new Date(obj.getTime())
}
// RegExp
if (_toString.call(obj) === '[object RegExp]') {
if (_toString.call(obj) === "[object RegExp]") {
const flags = []
if (obj.global) { flags.push('g') }
if (obj.multiline) { flags.push('m') }
if (obj.ignoreCase) { flags.push('i') }
if (obj.global) {
flags.push("g")
}
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() : {}
......@@ -323,8 +317,8 @@ export function uniqueArr(arr) {
* @returns {string}
*/
export function createUniqueString() {
const timestamp = +new Date() + ''
const randomNum = parseInt((1 + Math.random()) * 65536) + ''
const timestamp = +new Date() + ""
const randomNum = parseInt((1 + Math.random()) * 65536) + ""
return (+(randomNum + timestamp)).toString(32)
}
......@@ -335,7 +329,7 @@ export function createUniqueString() {
* @returns {boolean}
*/
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) {
* @param {string} 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) {
*/
export function removeClass(ele, cls) {
if (hasClass(ele, cls)) {
const reg = new RegExp('(\\s|^)' + cls + '(\\s|$)')
ele.className = ele.className.replace(reg, ' ')
const reg = new RegExp("(\\s|^)" + cls + "(\\s|$)")
ele.className = ele.className.replace(reg, " ")
}
}
export function makeMap(str, expectsLowerCase) {
const map = Object.create(null)
const list = str.split(',')
const list = str.split(",")
for (let i = 0; i < list.length; i++) {
map[list[i]] = true
}
return expectsLowerCase
? val => map[val.toLowerCase()]
: val => map[val]
return expectsLowerCase ? (val) => map[val.toLowerCase()] : (val) => map[val]
}
export const exportDefault = 'export default '
export const exportDefault = "export default "
export const beautifierConf = {
html: {
indent_size: '2',
indent_char: ' ',
max_preserve_newlines: '-1',
indent_size: "2",
indent_char: " ",
max_preserve_newlines: "-1",
preserve_newlines: false,
keep_array_indentation: false,
break_chained_methods: false,
indent_scripts: 'separate',
brace_style: 'end-expand',
indent_scripts: "separate",
brace_style: "end-expand",
space_before_conditional: true,
unescape_strings: false,
jslint_happy: false,
end_with_newline: true,
wrap_line_length: '110',
wrap_line_length: "110",
indent_inner_html: true,
comma_first: false,
e4x: true,
indent_empty_lines: true
},
js: {
indent_size: '2',
indent_char: ' ',
max_preserve_newlines: '-1',
indent_size: "2",
indent_char: " ",
max_preserve_newlines: "-1",
preserve_newlines: false,
keep_array_indentation: false,
break_chained_methods: false,
indent_scripts: 'normal',
brace_style: 'end-expand',
indent_scripts: "normal",
brace_style: "end-expand",
space_before_conditional: true,
unescape_strings: false,
jslint_happy: true,
end_with_newline: true,
wrap_line_length: '110',
wrap_line_length: "110",
indent_inner_html: true,
comma_first: false,
e4x: true,
......@@ -415,12 +407,12 @@ export const beautifierConf = {
// 首字母大小
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) {
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) {
......@@ -428,9 +420,9 @@ export function isNumberStr(str) {
}
// 将数组变成object
export function arrryToKeyedObjectBy(arr, key){
export function arrryToKeyedObjectBy(arr, key) {
let obj = {}
arr.forEach(item => {
arr.forEach((item) => {
obj[item[key]] = item
})
return obj
......@@ -439,28 +431,60 @@ export function arrryToKeyedObjectBy(arr, key){
// dataurl转blob
export function dataURLtoBlob(base64Data) {
//console.log(base64Data);//data:image/png;base64,
var byteString;
if(base64Data.split(',')[0].indexOf('base64') >= 0)
byteString = atob(base64Data.split(',')[1]);//base64 解码
else{
byteString = unescape(base64Data.split(',')[1]);
var byteString
if (base64Data.split(",")[0].indexOf("base64") >= 0) byteString = atob(base64Data.split(",")[1]) //base64 解码
else {
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 ia = new Uint8Array(arrayBuffer);//创建视图
var ia = new Uint8Array(byteString.length);//创建视图
for(var i = 0; i < byteString.length; i++) {
ia[i] = byteString.charCodeAt(i);
var ia = new Uint8Array(byteString.length) //创建视图
for (var i = 0; i < byteString.length; i++) {
ia[i] = byteString.charCodeAt(i)
}
var blob = new Blob([ia], {
type: mimeString
});
return blob;
})
return blob
}
// 将字符串转成数组
export function str2arr(str, separator = ','){
if(!str) return []
return str.split(separator).filter(item => item)
export function str2arr(str, separator = ",") {
if (!str) return []
return str.split(separator).filter((item) => item)
}
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>
<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-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 :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 :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 :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 :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 :label="$t('类型')" prop="baType">
<!-- <el-select v-model="queryParams.baType" placeholder="请选择类型字典(1公账,2私账)" clearable size="small">-->
<!-- <el-option :label="$t('请选择字典生成')" value="" />-->
<!-- </el-select>-->
<el-select v-model="queryParams.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-select v-model="queryParams.baType" placeholder="请选择类型字典(1公账,2私账)" clearable size="small">-->
<!-- <el-option :label="$t('请选择字典生成')" value="" />-->
<!-- </el-select>-->
<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-select>
</el-form-item>
<!-- <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;-->
<!-- <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-select>-->
<!-- </el-form-item>-->
<!-- <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;-->
<!-- <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-select>-->
<!-- </el-form-item>-->
<el-form-item :label="$t('状态')" prop="status">
<el-select v-model="queryParams.status" :placeholder="$t('用户状态')" clearable style="width: 240px">
<el-option v-for="dict in statusDictDatas" :key="parseInt(dict.value)" :label="dict.label" :value="parseInt(dict.value)"/>
<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-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-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-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
<el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
</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-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-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['ecw:bank-account:create']">{{ $t('新增') }}</el-button>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['ecw:bank-account:create']">{{ $t("新增") }}</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['ecw:bank-account:export']">{{ $t('导出') }}</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading" v-hasPermi="['ecw:bank-account:export']">{{ $t("导出") }}</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
......@@ -67,24 +82,32 @@
<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="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="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">
<dict-tag :type="DICT_TYPE.ECW_BANK_TYPE" :value="scope.row.baType"/>
{{ $l(getCurrencyData(scope.row.baCurrency), "title") }}
</template>
</el-table-column>
<!-- <el-table-column :label="$t('数据来源')" align="center" prop="source" >-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :type="DICT_TYPE.ECW_DATA_SOURCE" :value="scope.row.source"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column :label="$t('数据来源')" align="center" prop="source" >-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :type="DICT_TYPE.ECW_DATA_SOURCE" :value="scope.row.source"/>-->
<!-- </template>-->
<!-- </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">
<template slot-scope="scope">
<el-switch v-model="scope.row.status" :active-value="0" :inactive-value="1" @change="handleStatusChange(scope.row)" />
</template>
</el-table-column>
<el-table-column :label="$t('余额')" align="center" prop="baBalance" />
<el-table-column :label="$t('创建时间')" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
......@@ -92,16 +115,13 @@
</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" icon="el-icon-edit" @click="handleUpdate(scope.row)"
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-edit" @click="handleUpdate(scope.row)" 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>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" @pagination="getList" />
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
......@@ -118,60 +138,69 @@
<el-form-item :label="$t('银行代码')" prop="baSwiftCode">
<el-input v-model="form.baSwiftCode" :placeholder="$t('请输入银行代码')" />
</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-input v-model="form.baBankAdd" :placeholder="$t('请输入开户银行地址')" />
</el-form-item>
<el-form-item :label="$t('类型')" prop="baType">
<!-- <el-select v-model="form.baType" :placeholder="$t('请选择类型')">-->
<!-- <el-option :label="$t('请选择字典生成')" value="" />-->
<!-- </el-select>-->
<!-- <el-select v-model="form.baType" :placeholder="$t('请选择类型')">-->
<!-- <el-option :label="$t('请选择字典生成')" value="" />-->
<!-- </el-select>-->
<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-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">-->
<!-- &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-radio-group>-->
<!-- </el-form-item>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">{{ $t('确 定') }}</el-button>
<el-button @click="cancel">{{ $t('取 消') }}</el-button>
<el-button type="primary" @click="submitForm">{{ $t("确 定") }}</el-button>
<el-button @click="cancel">{{ $t("取 消") }}</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
createBankAccount,
updateBankAccount,
deleteBankAccount,
getBankAccount,
getBankAccountPage,
exportBankAccountExcel,
updateBankAccountStatus
} from "@/api/ecw/bankAccount";
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
import {CommonStatusEnum} from "@/utils/constants";
import {changeUserStatus} from "@/api/system/user";
import { createBankAccount, updateBankAccount, deleteBankAccount, getBankAccount, getBankAccountPage, exportBankAccountExcel, updateBankAccountStatus } from "@/api/ecw/bankAccount"
import { DICT_TYPE, getDictDatas } from "@/utils/dict"
import { CommonStatusEnum } from "@/utils/constants"
import { changeUserStatus } from "@/api/system/user"
import { getTradeCountryList } from "@/api/ecw/region"
import { mapGetters } from "vuex"
export default {
name: "BankAccount",
components: {
},
components: {},
data() {
return {
// 遮罩层
......@@ -184,6 +213,7 @@ export default {
total: 0,
// 银行账户列表
list: [],
countryList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
......@@ -201,9 +231,15 @@ export default {
baType: null,
source: null,
status: null,
baCountry: "",
baCurrency: "",
baIncomeBelong: "",
baBalance: ""
},
// 表单参数
form: {},
form: {
baCountry: "" //开户国家
},
// 表单校验
rules: {
......@@ -213,34 +249,42 @@ export default {
baSwiftCode: [{ required: true, message: this.$t("银行代码不能为空"), trigger: "blur" }],
baBankAdd: [{ required: true, message: this.$t("开户银行地址不能为空"), trigger: "blur" }],
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" }],
},
statusDictDatas: getDictDatas(DICT_TYPE.COMMON_STATUS),
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() {
this.getList();
async created() {
this.getList()
this.countryList = (await getTradeCountryList()).data
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
this.loading = true
// 处理查询参数
let params = {...this.queryParams};
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
let params = { ...this.queryParams }
this.addBeginAndEndTime(params, this.dateRangeCreateTime, "createTime")
// 执行查询
getBankAccountPage(params).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
getBankAccountPage(params).then((response) => {
this.list = response.data.list
this.total = response.data.total
this.loading = false
})
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
/** 表单重置 */
reset() {
......@@ -253,97 +297,112 @@ export default {
baBankAdd: undefined,
baType: undefined,
status: undefined,
};
this.resetForm("form");
baCountry: undefined,
baIncomeBelong: undefined,
baBalance: undefined,
baBalance: undefined
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
this.queryParams.pageNo = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.dateRangeCreateTime = [];
this.resetForm("queryForm");
this.handleQuery();
this.dateRangeCreateTime = []
this.resetForm("queryForm")
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = this.$t("添加银行账户");
this.reset()
this.open = true
this.title = this.$t("添加银行账户")
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getBankAccount(id).then(response => {
this.form = response.data;
this.open = true;
this.title = this.$t("修改银行账户");
});
this.reset()
const id = row.id
getBankAccount(id).then((response) => {
this.form = response.data
this.open = true
this.title = this.$t("修改银行账户")
})
},
// 用户状态修改
handleStatusChange(row) {
let text = row.status === CommonStatusEnum.ENABLE ? this.$t("启用") : this.$t("停用");
this.$modal.confirm('确认要' + text + this.$t('编号为') + row.id + '的数据吗?').then(function() {
return updateBankAccountStatus({id:row.id,status:!row.status?CommonStatusEnum.DISABLE:CommonStatusEnum.ENABLE});
}).then(() => {
this.$modal.msgSuccess(text + "成功");
}).catch(function() {
row.status = row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE
: CommonStatusEnum.ENABLE;
});
let text = row.status === CommonStatusEnum.ENABLE ? this.$t("启用") : this.$t("停用")
this.$modal
.confirm("确认要" + text + this.$t("编号为") + row.id + "的数据吗?")
.then(function () {
return updateBankAccountStatus({ id: row.id, status: !row.status ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE })
})
.then(() => {
this.$modal.msgSuccess(text + "成功")
})
.catch(function () {
row.status = row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
this.$refs["form"].validate((valid) => {
if (!valid) {
return;
return
}
// 修改的提交
if (this.form.id != null) {
updateBankAccount(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
updateBankAccount(this.form).then((response) => {
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
return
}
// 添加的提交
createBankAccount(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
createBankAccount(this.form).then((response) => {
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
})
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除银行账户编号为"' + id + '"的数据项?').then(function() {
return deleteBankAccount(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
const id = row.id
this.$modal
.confirm('是否确认删除银行账户编号为"' + id + '"的数据项?')
.then(function () {
return deleteBankAccount(id)
})
.then(() => {
this.getList()
this.$modal.msgSuccess("删除成功")
})
.catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
// 处理查询参数
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
let params = { ...this.queryParams }
params.pageNo = undefined
params.pageSize = undefined
this.addBeginAndEndTime(params, this.dateRangeCreateTime, "createTime")
// 执行导出
this.$modal.confirm('是否确认导出所有银行账户数据项?').then(() => {
this.exportLoading = true;
return exportBankAccountExcel(params);
}).then(response => {
this.$download.excel(response, '${table.classComment}.xls');
this.exportLoading = false;
}).catch(() => {});
this.$modal
.confirm("是否确认导出所有银行账户数据项?")
.then(() => {
this.exportLoading = true
return exportBankAccountExcel(params)
})
.then((response) => {
this.$download.excel(response, "${table.classComment}.xls")
this.exportLoading = false
})
.catch(() => {})
}
}
};
}
</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('流水号')">{{ 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.bankReceiptDetails = {}
if (val) {
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 (this.bankReceiptDetails.writeOffAmount && 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 (this.bankReceiptDetails.writeOffAmount && 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 (this.bankReceiptDetails.writeOffAmount && 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>
<div class="app-container">
<el-descriptions :column="4">
<el-descriptions-item :label="$t('收款单编号')">{{
form.receiptNo
}}</el-descriptions-item>
<el-descriptions-item :label="$t('客户')">{{
form.customerName
}}</el-descriptions-item>
<el-descriptions-item :label="$t('收款单编号')">{{ form.receiptNo }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户')">{{ form.customerName }}</el-descriptions-item>
<el-descriptions-item :label="$t('创建时间')">
<template>
<span>{{ parseTime(form.createTime, "{y}-{m}-{d}") }}</span>
</template></el-descriptions-item
>
<el-descriptions-item :label="$t('业务员')">{{
form.salesmanName
}}</el-descriptions-item>
<el-descriptions-item v-if="reason" :label="$t('申请理由')">{{
reason
}}</el-descriptions-item>
<el-descriptions-item :label="$t('业务员')">{{ form.salesmanName }}</el-descriptions-item>
<el-descriptions-item v-if="reason" :label="$t('申请理由')">{{ reason }}</el-descriptions-item>
</el-descriptions>
<div class="btn">
<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('收款账户')"
align="center"
prop="accountName"
/>
<el-table-column :label="$t('收款账户')" align="center" prop="accountName" />
<el-table-column :label="$t('实收金额')" align="center" prop="amount" />
<el-table-column :label="$t('实收币种')" align="center" prop="marks">
<template slot-scope="scope">
......@@ -35,29 +23,19 @@
</el-table-column>
<el-table-column :label="$t('汇率')" align="center" prop="rate" />
<el-table-column align="center" prop="writeOffAmount">
<template #header>
{{ $t("兑核销基准金额") }}{{ getCurrencyLabel(showCurrencyId) }}
</template>
</el-table-column>
<el-table-column
:label="$t('实收日期')"
align="center"
prop="amountDate"
>
<template #header> {{ $t("兑核销基准金额") }}{{ getCurrencyLabel(showCurrencyId) }} </template>
</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="attr">
<template slot-scope="scope" v-if="scope.row.attr">
<div v-for="(v, i) in scope.row.attr" :key="i">
<el-link :href="v.url" type="primary" target="_blank">{{
v.name
}}</el-link>
<el-link :href="v.url" type="primary" target="_blank">{{ v.name }}</el-link>
</div>
</template>
</el-table-column>
</el-table>
</div>
<el-card class="card">
<div class="btn">
<!--链接到收款单详情页面 lanbm 2024-05-24 add-->
......@@ -78,26 +56,16 @@
@click="openAddDialog=true"
>{{ $t('查看银行实收明细')}}</el-button>
</div>-->
<el-dialog
v-if="openAddDialog"
:visible.sync="openAddDialog"
:title="this.$t('银行实收明细详情')"
width="50%"
append-to-body
>
<el-dialog v-if="openAddDialog" :visible.sync="openAddDialog" :title="this.$t('银行实收明细详情')" width="50%" append-to-body>
<div style="padding: 0 24px">
<el-form ref="addForm" :model="addForm" label-width="250px">
<el-form-item :label="$t('收款单号') + ':'">{{
form.receiptNo
}}</el-form-item>
<el-form-item :label="$t('收款单号') + ':'">{{ form.receiptNo }}</el-form-item>
<el-form-item :label="$t('剩余应收金额') + ':'">
<template>
<div v-if="surplusData.length == 0">0</div>
<div v-else>
<div v-for="(amount, currency) in surplusData" :key="currency">
<span v-if="amount">
{{ amount }}{{ getCurrencyLabel(currency) }}</span
>
<span v-if="amount"> {{ amount }}{{ getCurrencyLabel(currency) }}</span>
</div>
</div>
</template>
......@@ -113,18 +81,8 @@
><span>{{ addForm.amount }}</span></el-form-item
>
<el-form-item label-width="0px" prop="currencyId">
<el-select
v-model="addForm.currencyId"
: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 v-model="addForm.currencyId" :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>
<!-- <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> -->
......@@ -133,37 +91,18 @@
</div>
<el-form-item v-if="showCurrencyId != addForm.currencyId" prop="rate">
<template slot="label">
<span
:title="
$t(
'实收币种与核销基准币种一样时,无需填写汇率,不一样需要填写汇率'
)
"
>{{ $t("兑核销基准币种汇率") }}{{
getCurrencyLabel(showCurrencyId)
}}</span
>
<span :title="$t('实收币种与核销基准币种一样时,无需填写汇率,不一样需要填写汇率')">{{ $t("兑核销基准币种汇率") }}{{ getCurrencyLabel(showCurrencyId) }}</span>
</template>
<span>{{ addForm.rate }}</span>
</el-form-item>
<el-form-item v-if="showCurrencyId != addForm.currencyId">
<template slot="label">
{{ $t("兑核销基准币种金额") }}{{
getCurrencyLabel(showCurrencyId)
}}:
</template>
<span>{{
addForm.writeOffAmount
? parseFloat(addForm.writeOffAmount).toFixed(6)
: ""
}}</span>
<template slot="label"> {{ $t("兑核销基准币种金额") }}{{ getCurrencyLabel(showCurrencyId) }}: </template>
<span>{{ addForm.writeOffAmount ? parseFloat(addForm.writeOffAmount).toFixed(6) : "" }}</span>
</el-form-item>
<el-form-item :label="$t('水单附件') + ':'" prop="attr">
<div v-if="addForm.attr.length > 0">
<div v-for="(v, i) in addForm.attr" :key="i">
<el-link :href="v.url" type="primary" target="_blank">{{
v.name
}}</el-link>
<el-link :href="v.url" type="primary" target="_blank">{{ v.name }}</el-link>
</div>
</div>
<div v-else>{{ $t("") }}</div>
......@@ -178,24 +117,18 @@
</template>
<script>
import { getCustomer } from "@/api/ecw/customer";
import {
getReceiptInfoByIds,
getReceivableItem,
getInvoicingItem,
getReceiptAccountList,
getReceiptApprove,
} from "@/api/ecw/financial";
import { getCurrencyPage } from "@/api/ecw/currency";
import NP from "number-precision";
import receiptDetail from "@/views/ecw/financial/receiptDetail2";
import { getCustomer } from "@/api/ecw/customer"
import { getReceiptInfoByIds, getReceivableItem, getInvoicingItem, 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 {
props: {
id: [String, Number],
id: [String, Number]
},
components: {
receiptDetail,
receiptDetail
},
data() {
return {
......@@ -212,20 +145,20 @@ export default {
receiptId: 0,
receiptItemId: 0,
reason: "",
receiptAccountList: [],
};
receiptAccountList: []
}
},
watch: {
id() {
this.getCurrencyData();
this.getCurrencyData()
},
currencyList() {
this.getData();
this.getData()
},
form() {
this.getList();
this.getListData();
},
this.getList()
this.getListData()
}
},
computed: {
businessKeyToComponent() {
......@@ -233,32 +166,32 @@ export default {
component: () => import("@/views/ecw/financial/receiptDetail"),
id: this.receiptId,
name: "receiptDetail",
path: "receiptDetail",
};
return page;
},
path: "receiptDetail"
}
return page
}
},
created() {
if (this.id) {
this.getCurrencyData();
this.getCurrencyData()
}
},
methods: {
getData() {
getReceiptApprove(this.id).then((res) => {
if (res.data.receiptId) {
this.receiptId = res.data.receiptId;
this.receiptItemId = res.data.receiptItemId;
this.reason = res.data.reason;
this.getReceiptInfo();
this.receiptId = res.data.receiptId
this.receiptItemId = res.data.receiptItemId
this.reason = res.data.reason
this.getReceiptInfo()
}
});
})
},
// 获取汇率
getCurrencyData() {
getCurrencyPage(this.params).then((res) => {
this.currencyList = res.data.list;
});
this.currencyList = res.data.list
})
},
getList() {
getReceivableItem({ id: this.receiptId }).then((res) => {
......@@ -267,150 +200,118 @@ export default {
amountDate: this.parseTime(v.amountDate, "{y}-{m}-{d}"),
accountNo: +v.accountNo,
rate: parseFloat(v.rate).toFixed(6),
attr: v.attr
? v.attr
.split(",")
.map((t) => ({ name: t.slice(t.lastIndexOf("/") + 1), url: t }))
: [],
}));
this.addForm = this.detatilData.find((v) => v.id == this.receiptItemId);
this.detailed = [];
this.detailed.push(this.addForm);
this.getCollectionData();
});
attr: v.attr ? v.attr.split(",").map((t) => ({ name: t.slice(t.lastIndexOf("/") + 1), url: t })) : []
}))
this.addForm = this.detatilData.find((v) => v.id == this.receiptItemId)
this.detailed = []
this.detailed.push(this.addForm)
this.getCollectionData()
})
},
getReceiptInfo() {
getReceiptInfoByIds({ id: this.receiptId }).then((res) => {
this.form = res.data;
this.form = res.data
getCustomer(this.form.customerId).then((res) => {
this.form.customerName = res?.data?.name;
});
});
this.form.customerName = res?.data?.name
})
})
},
getCurrencyLabel(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;
return "";
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
return ""
},
getListData() {
getInvoicingItem({ id: this.receiptId }).then((res) => {
this.list = [...res.data];
let fieldList = [];
let groupList = [];
this.list = [...res.data]
let fieldList = []
let groupList = []
this.list.map((element) => {
if (fieldList.indexOf(element["currencyId"]) === -1) {
fieldList.push(element["currencyId"]);
fieldList.push(element["currencyId"])
}
});
})
for (let i = 0; i < fieldList.length; i++) {
let arr = this.list.filter((element) => {
return element["currencyId"] === fieldList[i];
});
return element["currencyId"] === fieldList[i]
})
groupList.push({
currencyId: arr[0].currencyId,
list: arr,
});
list: arr
})
}
this.showCurrencyId = 1;
if (groupList.length === 1)
this.showCurrencyId = groupList[0].currencyId;
});
this.showCurrencyId = 1
if (groupList.length === 1) this.showCurrencyId = groupList[0].currencyId
})
},
getCollectionData() {
getReceiptAccountList({ id: this.receiptId }).then((res) => {
var n;
var n
// 收款总计
var amountList = [];
var amountList = []
this.currencyList.forEach((item, index) => {
var nairaListByList = this.list.filter(
(v) => v.currencyId === item.id
);
var nairaListByList = this.list.filter((v) => v.currencyId === item.id)
if (nairaListByList.length > 0) {
var discountNaira = nairaListByList.reduce(
(total, currentValue) =>
NP.plus(total, currentValue.discountTotal || 0),
0
);
n = res.data.find((v) => v.currencyId == item.id);
n && (n.discountTotal = discountNaira);
var discountNaira = nairaListByList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
n = res.data.find((v) => v.currencyId == item.id)
n && (n.discountTotal = discountNaira)
}
var dollarList = res.data.filter(
(v) => v.collectionCurrencyId == item.id
);
var dollarList = res.data.filter((v) => v.collectionCurrencyId == item.id)
if (dollarList.length > 0) {
var dollar = dollarList
.reduce(
(total, currentValue) =>
NP.plus(total, currentValue.collectionAmount),
0
)
.toFixed(2);
var dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount), 0).toFixed(2)
amountList.push({
currencyId: item.id,
currencyNameEn: item.titleEn,
currencyNameZh: item.titleZh,
amount: dollar,
});
amount: dollar
})
}
});
this.$set(this, "collectionAmount", amountList);
this.handleAddReceiptItem();
});
})
this.$set(this, "collectionAmount", amountList)
this.handleAddReceiptItem()
})
},
handleAddReceiptItem() {
// 已收
let recepted = [];
let recepted = []
this.detatilData.forEach((item) => {
if (!recepted[item.currencyId]) {
recepted[item.currencyId] = item.amount;
} else
recepted[item.currencyId] = NP.plus(
recepted[item.currencyId],
item.amount
);
});
recepted[item.currencyId] = item.amount
} else recepted[item.currencyId] = NP.plus(recepted[item.currencyId], item.amount)
})
// 应收
let collom = [];
let collom = []
// 从期望收费金额中提取应收币种和金额
this.collectionAmount.forEach((item) => {
collom[item.currencyId] = item.amount;
});
console.log(recepted);
collom[item.currencyId] = item.amount
})
console.log(recepted)
recepted.forEach((amount, currency) => {
if (amount) {
if (collom[currency]) {
if (collom[currency] - amount != 0)
this.surplusData[currency] = +parseFloat(
(collom[currency] - amount).toPrecision(12)
);
if (collom[currency] - amount != 0) this.surplusData[currency] = +parseFloat((collom[currency] - amount).toPrecision(12))
} else {
this.surplusData[currency] = -amount;
this.surplusData[currency] = -amount
}
}
});
console.log(collom);
})
console.log(collom)
collom.forEach((amount, currency) => {
if (amount) {
if (!this.surplusData[currency]) {
if (recepted[currency]) {
if (amount - recepted[currency] != 0)
this.surplusData[currency] = +parseFloat(
(amount - recepted[currency]).toPrecision(12)
);
if (amount - recepted[currency] != 0) this.surplusData[currency] = +parseFloat((amount - recepted[currency]).toPrecision(12))
} else {
this.surplusData[currency] = amount;
this.surplusData[currency] = amount
}
}
}
});
console.log(this.surplusData);
},
},
};
})
console.log(this.surplusData)
}
}
}
</script>
<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>
<div class="app-container">
<!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8" style="margin-right: 60px">
<div class="card-title">{{ $t('待收款') }}</div>
<el-button
style="float: right; margin-left: 10px"
type="primary"
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>
<div class="card-title">{{ $t("待收款") }}</div>
<el-button style="float: right; margin-left: 10px" type="primary" 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-card v-show="showSearch">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
label-width="80px"
class="card"
>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="80px" class="card">
<el-row>
<el-form-item :label="$t('始发地')">
<el-select
v-model="queryParams.departureId"
:placeholder="$t('请选择始发地')"
clearable
>
<el-option
v-for="item in exportWarehouseList"
:label="$l(item, 'title')"
:value="item.id"
:key="item.id"
></el-option>
<el-select v-model="queryParams.departureId" :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-form-item>
<el-form-item :label="$t('目的地')">
<el-select
v-model="queryParams.objectiveId"
:placeholder="$t('请选择目的地')"
clearable
>
<el-option
v-for="item in importWarehouseList"
:label="$l(item, 'title')"
:value="item.id"
:key="item.id"
></el-option>
<el-select v-model="queryParams.objectiveId" :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-form-item>
<el-form-item :label="$t('运输方式')">
<dict-selector
:type="DICT_TYPE.ECW_TRANSPORT_TYPE"
v-model="queryParams.transportId"
formatter="number"
clearable
/>
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="queryParams.transportId" formatter="number" clearable />
</el-form-item>
<el-form-item :label="$t('控货')">
<dict-selector
:type="DICT_TYPE.INFRA_BOOLEAN_STRING"
v-model="queryParams.isCargoControl"
clearable
/>
<dict-selector :type="DICT_TYPE.INFRA_BOOLEAN_STRING" v-model="queryParams.isCargoControl" clearable />
</el-form-item>
</el-row>
<el-row>
<el-form-item :label="$t('订单状态')">
<dict-selector
:type="DICT_TYPE.ORDER_STATUS"
v-model="queryParams.status"
clearable
/>
<dict-selector :type="DICT_TYPE.ORDER_STATUS" v-model="queryParams.status" clearable />
</el-form-item>
<el-form-item :label="$t('报关方式')">
<dict-selector
:type="DICT_TYPE.ECW_CUSTOMS_TYPE"
v-model="queryParams.customsType"
clearable
/>
<dict-selector :type="DICT_TYPE.ECW_CUSTOMS_TYPE" v-model="queryParams.customsType" clearable />
</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-input style="max-width: 188px" v-model="queryParams.orderNo" :placeholder="$t('请输入订单编号')" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('品名')">
<el-input
style="max-width: 188px"
v-model="queryParams.title"
:placeholder="$t('请输入品名')"
clearable
@keyup.enter.native="handleQuery"
/>
<el-input style="max-width: 188px" v-model="queryParams.title" :placeholder="$t('请输入品名')" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
</el-row>
<el-row>
<el-form-item :label="$t('提单号')">
<el-input
style="max-width: 188px"
v-model="queryParams.tidanNo"
:placeholder="$t('请输入提单号')"
clearable
@keyup.enter.native="handleQuery"
/>
<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.marks"
:placeholder="$t('请输入唛头')"
clearable
@keyup.enter.native="handleQuery"
/>
<el-input style="max-width: 188px" v-model="queryParams.marks" :placeholder="$t('请输入唛头')" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('费用类型')">
<dict-selector
:type="DICT_TYPE.FEE_TYPE"
v-model="queryParams.feeType"
clearable
></dict-selector>
<dict-selector :type="DICT_TYPE.FEE_TYPE" v-model="queryParams.feeType" clearable></dict-selector>
</el-form-item>
<!-- <el-form-item :label="$t('发货人')">
<!-- <el-form-item :label="$t('发货人')">
<customer-selector
v-model="queryParams.consignorNameOrPhone"
@change="consignor = $event"
clearable
/>
</el-form-item> -->
<el-form-item label="发货人:" >
<el-input style="max-width: 188px;" v-model="queryParams.consignorNameOrPhone" :placeholder="$t('请输入发货人')" clearable @keyup.enter.native="handleQuery"/>
<el-form-item label="发货人:">
<el-input style="max-width: 188px" v-model="queryParams.consignorNameOrPhone" :placeholder="$t('请输入发货人')" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
</el-row>
<el-row>
<el-form-item :label="$t('收货人')">
<el-input style="max-width: 188px;" v-model="queryParams.consigneeNameOrPhone" :placeholder="$t('请输入收货人')" clearable @keyup.enter.native="handleQuery"/>
<!-- <customer-selector
<el-input style="max-width: 188px" v-model="queryParams.consigneeNameOrPhone" :placeholder="$t('请输入收货人')" clearable @keyup.enter.native="handleQuery" />
<!-- <customer-selector
v-model="queryParams.consigneeNameOrPhone"
@change="consignor = $event"
clearable
......@@ -166,45 +74,42 @@
</el-form-item>
<el-form-item :label="$t('创建时间')">
<!-- <dict-selector :type="DICT_TYPE.BEGINTIME_TYPE_ENDTIME" v-model="queryParams.date"></dict-selector> -->
<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-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-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
</el-form-item>
</el-row>
</el-form>
</el-card>
<el-table v-loading="loadings" :data="list" border class="card">
<div v-loading="loading">
<el-row :gutter="10" class="mb8 pad-t20">
<div class="card-title">
<div class="gird-cell">
<div>{{ $t("合计:") }}</div>
<div v-for="item in totalAmountList" :key="item.currencyId" class="pad-cell">
{{ `${item.currencySymbol}${item.totalAmount}` }}
</div>
</div>
</div>
</el-row>
<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 + ")"):'' }}
{{ 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 :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" >
<el-table-column :label="$t('付款方')" align="center" prop="weight">
<template slot-scope="scope">
{{ scope.row.paymentUser==1?$t('发货人'):$t('收货人')}}
{{ scope.row.paymentUser == 1 ? $t("发货人") : $t("收货人") }}
</template>
</el-table-column>
<el-table-column :label="$t('订单状态')" align="center" prop="status">
......@@ -214,54 +119,41 @@
</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>
<dict-tag :type="DICT_TYPE.FEE_TYPE" :value="scope.row.feeType"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="$t('单价')" align="center" prop="unitPrice">
<template slot-scope="scope">
<span>{{ scope.row.unitPrice }}{{getCurrencyLabel(scope.row.currencyId)}}</span>
<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>
<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"
>
<el-table-column :label="$t('操作')" align="center" fixed="right" 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>
<el-button size="mini" type="text" v-hasPermi="['ecw:receivable:collection']" @click="handleAdd(scope.row)">{{ $t("收款") }}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!-- 分页组件 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.rows"
@pagination="getList"
/>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :limit.sync="queryParams.rows" @pagination="getList" />
</div>
</template>
<script>
import { userList } from "@/api/system/user";
import { DICT_TYPE } from "@/utils/dict";
import CustomerSelector from "@/components/CustomerSelector";
import { getTradeCityList } from "@/api/ecw/region";
import { getReceivableList } from "@/api/ecw/financial";
import { getCurrencyPage } from "@/api/ecw/currency";
import {getWarehouseList} from '@/api/ecw/warehouse'
import { userList } from "@/api/system/user"
import { DICT_TYPE } from "@/utils/dict"
import CustomerSelector from "@/components/CustomerSelector"
import { getTradeCityList } from "@/api/ecw/region"
import { getReceivableList, getReceivableAmount } from "@/api/ecw/financial"
import { getCurrencyPage } from "@/api/ecw/currency"
import { getWarehouseList } from "@/api/ecw/warehouse"
export default {
name: "EcwFinancialReceivable",
......@@ -271,100 +163,107 @@ export default {
data() {
return {
showSearch: true,
loadings: false,
loading: false,
form: {},
creatorData: [],
list: [],
total: 0,
dateType: [],
loading: "",
params: {
page: 1,
rows: 20,
rows: 20
},
queryParams: {
page: 1,
rows: 20,
rows: 20
},
tradeCityList: [],
params: {
page: 1,
rows: 20,
rows: 20
},
currencyList:[],
warehouseList:[],
};
currencyList: [],
warehouseList: [],
totalAmountList: []
}
},
activated(){
activated() {
console.log(11)
this.getList();
this.getList()
},
created() {
let that = this;
getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
userList("salesman").then((res) => (that.creatorData = res.data));
getTradeCityList().then((res) => (that.tradeCityList = res.data));
this.getList();
getWarehouseList().then(res => this.warehouseList = res.data)
let that = this
getCurrencyPage(this.params).then((res) => (this.currencyList = res.data.list))
userList("salesman").then((res) => (that.creatorData = res.data))
getTradeCityList().then((res) => (that.tradeCityList = res.data))
this.getList()
getWarehouseList().then((res) => (this.warehouseList = res.data))
},
computed: {
expoerCityList() {
return this.tradeCityList.filter((item) => item.type == 2);
return this.tradeCityList.filter((item) => item.type == 2)
},
importCityList() {
return this.tradeCityList.filter((item) => item.type == 1);
return this.tradeCityList.filter((item) => item.type == 1)
},
exportWarehouseList(){
exportWarehouseList() {
/* tradeType 1 进口,2出口,3进出口 */
return this.warehouseList.filter(item => item.tradeType == 2 || item.tradeType == 3)
},
importWarehouseList(){
return this.warehouseList.filter(item => item.tradeType == 1 || 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)
}
},
methods: {
getCurrencyLabel(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
return ''
getCurrencyLabel(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
return ""
},
/** 查询列表 */
getList() {
this.loading = true;
this.loading = true
// 处理查询参数
console.log(this.queryParams)
let params = {};
for(let key in this.queryParams){
if(this.queryParams[key]&&this.queryParams[key]!= undefined){
let params = {}
for (let key in this.queryParams) {
if (this.queryParams[key] && this.queryParams[key] != undefined) {
params[key] = this.queryParams[key]
}
}
this.addBeginAndEndTime(params, this.dateType, "createTime");
this.addBeginAndEndTime(params, this.dateType, "createTime")
// 执行查询
getReceivableList(params).then((response) => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
this.list = response.data.list
this.total = response.data.total
this.loading = false
})
this.getTotalAmount(params)
},
/**总金额合计 */
getTotalAmount(params) {
getReceivableAmount(params).then((res) => {
this.totalAmountList = res.data
})
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.page = 1;
this.getList();
this.queryParams.page = 1
this.getList()
},
/** 新增按钮操作 */
handleAdd(row) {
if(!row) return this.$router.push("creatCollection");
return this.$router.push("creatCollection?orderId=" + row.orderId);
if (!row) return this.$router.push("creatCollection")
return this.$router.push("creatCollection?orderId=" + row.orderId)
},
submitForm() {},
},
};
submitForm() {}
}
}
</script>
<style scoped>
<style scoped>
.card {
margin-top: 20px;
}
......@@ -376,4 +275,13 @@ export default {
font-weight: bold;
display: inline-block;
}
.pad-t20 {
padding-top: 20px;
}
.gird-cell {
display: flex;
}
.pad-cell {
padding: 0 20px;
}
</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 @@
<div slot="header" class="card-title">{{ $t("收款单") }}</div>
<!-- 搜索工作栏 -->
<el-card v-show="showSearch" class="card">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
label-width="100px"
class="card"
>
<el-row :span="24">
<el-form :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.receiptNo"
:placeholder="$t('请输入收款单号')"
clearable
@keyup.enter.native="handleQuery"
/>
<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('客户名称')">
<customer-selector
v-model="queryParams.customerId"
@change="changeCustomerId"
clearable
/>
<customer-selector v-model="queryParams.customerId" @change="changeCustomerId" clearable />
</el-form-item>
<el-form-item :label="$t('状态')">
<dict-selector
:type="DICT_TYPE.ECW_RECEIPT_STATE"
v-model="queryParams.state"
clearable
/>
<dict-selector :type="DICT_TYPE.ECW_RECEIPT_STATE" v-model="queryParams.state" clearable />
</el-form-item>
<el-form-item :label="$t('业务员')">
<el-select
v-model="queryParams.salesmanId"
:placeholder="$t('请选择业务员')"
clearable
>
<el-option
v-for="item in creatorData"
:key="item.id"
:label="item.nickname"
:value="item.id"
/>
<el-select v-model="queryParams.salesmanId" :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-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 :label="$t('开票状态')">
<dict-selector multiple :type="DICT_TYPE.INVOICING_STATUS" v-model="queryParams.invoicingStatus" clearable />
</el-form-item>
</el-col>
<el-form-item :label="$t('明细状态')">
<dict-selector multiple :type="DICT_TYPE.RECEIPT_DETAIL_STATUS" v-model="queryParams.receiptItemStatus" clearable />
</el-form-item>
<el-form-item :label="$t('开票资料状态')">
<dict-selector multiple :type="DICT_TYPE.INVOICE_DATA_STATUS" v-model="queryParams.invoiceDataStatus" clearable />
</el-form-item>
<!-- </el-row> -->
<el-form-item :label="$t('编号')">
<el-input
style="max-width: 188px"
v-model="queryParams.numberNo"
:placeholder="$t('订单号和提单号,自编号')"
clearable
@keyup.enter.native="handleQuery"
/>
<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-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-row> -->
<el-row :span="24">
<el-col style="width: 592px">
<el-form-item>
<el-button type="primary" @click="handleQuery">{{
$t("查找")
}}</el-button>
<el-button type="primary" @click="handleQuery">{{ $t("查找") }}</el-button>
<!--lanbm 2024-05-29 添加的批处理功能按钮-->
<el-button type="primary" @click="handleQuery2">{{
$t("批量反审核")
}}</el-button>
<el-button type="primary" @click="handleQuery3">{{
$t("批量反核销")
}}</el-button>
<el-button type="primary" @click="handleQuery4">{{
$t("批量核销")
}}</el-button>
<el-button type="primary" @click="handleQuery2">{{ $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 添加的批处理功能按钮-->
<!-- 财务2.2-->
<el-button @click="handleShowFileUploadDialog" type="primary" v-hasPermi="['ecw:voucher:importBankCollectionInfo']">{{ $t("导入银行收款信息") }}</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-table
v-loading="loadings"
:data="list"
@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"
>
<el-table v-loading="loadings" :data="list" @selection-change="handleSelectionChange" border class="card">
<el-table-column type="selection" width="55" align="center" fixed="left"> </el-table-column>
<el-table-column :label="$t('序号')" align="center" fixed="left" prop="id" type="index">
<template slot-scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<!--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">
<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>
</el-table-column>
<!--订单号,提单号,lanbm 2024-05-29 add-->
<el-table-column :label="$t('订单号')" align="center" prop="orderNo">
<template slot-scope="scope">
<span style="color: #1890ff" @click="paymentDetail2(scope.row)">{{
scope.row.orderNo
}}</span>
<!-- 财务v2.2 新增收款单对应多订单展示处理 -->
<el-table-column :label="$t('订单号/提单号')" fixed="left" width="230" 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>
<!-- <span style="color: #1890ff" @click="paymentDetail2(scope.row)">{{ scope.row.orderNo }}</span> -->
</template>
</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"> -->
<!-- <span style="color: #1890ff;" @click="verificationCancelClick(scope.row)">{{scope.row.receiptNo}}</span> -->
<!-- </template> -->
<!-- </el-table-column> -->
<el-table-column
:label="$t('客户名称')"
align="center"
prop="customerName"
/>
<el-table-column :label="$t('客户名称')" align="center" prop="customerName" />
<el-table-column :label="$t('创建日期')" align="center" prop="createTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
......@@ -153,71 +96,42 @@
<span>{{ parseTime(scope.row.payedAt, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column
:label="$t('业务员')"
align="center"
prop="salesmanName"
/>
<el-table-column :label="$t('业务员')" align="center" prop="salesmanName" />
<el-table-column :label="$t('状态')" align="center">
<template slot-scope="scope">
<dict-tag
:type="DICT_TYPE.ECW_RECEIPT_STATE"
: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>
<dict-tag :type="DICT_TYPE.ECW_RECEIPT_STATE" :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>
</el-table-column>
<el-table-column
:label="$t('应收')"
align="center"
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" 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">
<template slot-scope="scope">
{{ scope.row.openInvoice === 0 ? $t("") : $t("") }}
</template>
</el-table-column>
<!--lanbm 2024-05-14 add-->
<el-table-column :label="$t('明细状态')" align="center" prop="mxStatus" />
<el-table-column
:label="$t('操作')"
align="center"
class-name="small-padding fixed-width"
>
<el-table-column :label="$t('明细状态')" align="center" prop="mxStatus">
<template slot-scope="{ row }">
{{ row.mxStatus }}/
<dict-tag :type="DICT_TYPE.RECEIPT_DETAIL_STATUS" :value="row.receiptItemStatus" />
</template>
</el-table-column>
<el-table-column :label="$t('开票状态')" align="center">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
v-hasPermi="['ecw:voucher:see']"
@click="verificationCancelClick(scope.row)"
>{{ $t("查看") }}</el-button
>
<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
>
<dict-tag :type="DICT_TYPE.INVOICING_STATUS" :value="scope.row.invoicingStatus" />
</template>
</el-table-column>
<el-table-column :label="$t('开票资料状态')" 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="300" fixed="right" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" v-hasPermi="['ecw:voucher:see']" @click="verificationCancelClick(scope.row)">{{ $t("查看") }}</el-button>
<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>
<!-- <el-button
v-if="scope.row.state == "
size="mini"
......@@ -225,211 +139,64 @@
@click="verificationClick(scope.row)"
>{{ $t('核销') }}</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
>
<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
>
<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
>
<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
>
<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>
<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>
<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>
<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>
<!-- 财务2.2新增 5 个按钮-->
<!-- 待收款==1 待提交 ==2 已部分核销==3 -->
<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>
<!-- 当收款单状态≠草稿0且≠审核中7且≠审批拒绝8,开票状态=已取消2||不开票 3,按钮显示且可点击,跳转申请开票页面 -->
<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>
<!-- 开票状态=待开票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>
<!-- 当收款单状态≠草稿0且开票状态=待开票0 -->
<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>
<!-- 当开票状态=已开票才显示,跳转开票信息查看页面 -->
<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>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.rows"
@pagination="getList"
/>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :limit.sync="queryParams.rows" @pagination="getList" />
<!-- 对话框(添加 / 修改) -->
<el-dialog
:title="$t('导出账单')"
:visible.sync="open"
width="500px"
style="margin-top: 20vh !important"
append-to-body
>
<el-dialog :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;'>
<span>{{ $t('导出账单') }}</span>
<i class="el-icon-close" @click="cancel"></i>
</div> -->
<div class="dialog-footer">
<el-button
type="primary"
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
>
<el-button type="primary" 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>
</el-dialog>
<el-dialog
:title="writeOffType == 1 ? $t('收款单反审核') : $t('收款单反核销')"
:visible.sync="dialogVisible"
width="30%"
>
<el-dialog :title="writeOffType == 1 ? $t('收款单反审核') : $t('收款单反核销')" :visible.sync="dialogVisible" width="30%">
<div class="cancel_content">
<span>{{ $t("申请理由") }}</span>
<el-input
type="textarea"
:rows="6"
v-model="reason"
:placeholder="$t('请输入理由')"
></el-input>
<el-input type="textarea" :rows="6" v-model="reason" :placeholder="$t('请输入理由')"></el-input>
</div>
<span slot="footer" class="dialog-footers">
<el-button
v-if="writeOffType == 1"
type="primary"
@click="writeOffClick()"
>{{ $t("提交反审核") }}</el-button
>
<el-button v-else type="primary" @click="writeOffClick()">{{
$t("提交反核销")
}}</el-button>
<el-button v-if="writeOffType == 1" 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>
</span>
</el-dialog>
<el-dialog :title="cancelTitle" :visible.sync="cancelShow" width="30%">
<div class="cancel_content">
<span>{{ $t("申请理由") }}</span>
<el-input
type="textarea"
:rows="6"
v-model="cancelReason"
:placeholder="$t('请输入取消理由')"
></el-input>
<el-input type="textarea" :rows="6" v-model="cancelReason" :placeholder="$t('请输入取消理由')"></el-input>
</div>
<span slot="footer" class="dialog-footers">
<el-button type="primary" @click="cancelWriteOffClick()">{{
$t("提交")
}}</el-button>
<el-button type="primary" @click="cancelWriteOffClick()">{{ $t("提交") }}</el-button>
<el-button @click="cancelShow = false">{{ $t("取消") }}</el-button>
</span>
</el-dialog>
......@@ -438,17 +205,10 @@
<el-dialog :title="dialogTitle2" :visible.sync="dialogVisible2" width="30%">
<div class="cancel_content">
<span>{{ $t("申请理由") }}</span>
<el-input
type="textarea"
:rows="6"
v-model="reason"
:placeholder="$t('请输入理由')"
></el-input>
<el-input type="textarea" :rows="6" v-model="reason" :placeholder="$t('请输入理由')"></el-input>
</div>
<span slot="footer" class="dialog-footers">
<el-button type="primary" @click="writeOffClick2()">{{
$t("提交反审核")
}}</el-button>
<el-button type="primary" @click="writeOffClick2()">{{ $t("提交反审核") }}</el-button>
<el-button @click="dialogVisible2 = false">{{ $t("取消") }}</el-button>
</span>
</el-dialog>
......@@ -457,28 +217,48 @@
<el-dialog :title="dialogTitle3" :visible.sync="dialogVisible3" width="30%">
<div class="cancel_content">
<span>{{ $t("申请理由") }}</span>
<el-input
type="textarea"
:rows="6"
v-model="reason"
:placeholder="$t('请输入理由')"
></el-input>
<el-input type="textarea" :rows="6" v-model="reason" :placeholder="$t('请输入理由')"></el-input>
</div>
<span slot="footer" class="dialog-footers">
<el-button type="primary" @click="writeOffClick3()">{{
$t("提交反核销")
}}</el-button>
<el-button type="primary" @click="writeOffClick3()">{{ $t("提交反核销") }}</el-button>
<el-button @click="dialogVisible3 = false">{{ $t("取消") }}</el-button>
</span>
</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>
</template>
<script>
import { listSimpleUsers } from "@/api/system/user";
import { DICT_TYPE } from "@/utils/dict";
import CustomerSelector from "@/components/CustomerSelector";
import { getCurrencyPage } from "@/api/ecw/currency";
import { listSimpleUsers } from "@/api/system/user"
import { DICT_TYPE } from "@/utils/dict"
import CustomerSelector from "@/components/CustomerSelector"
import { getCurrencyPage } from "@/api/ecw/currency"
import { getBaseHeader } from "@/utils/request"
import {
getReceiptList,
// receiptVerification,
......@@ -494,7 +274,8 @@ import {
cancelFinanceReceiptApprovalNo,
cancelFinanceReceiptWriteOffNo,
cancelFinanceReceiptWriteOff,
} from "@/api/ecw/financial";
handleDownloadReceiptTmp
} from "@/api/ecw/financial"
// lanbm 2024-05-30 添加注释
// 收款单状态 0 草稿,1 待收款,2 待提交
......@@ -506,10 +287,28 @@ import {
export default {
name: "EcwFinancialVoucher",
components: {
CustomerSelector,
CustomerSelector
},
data() {
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: "",
open: false,
showSearch: true,
......@@ -539,6 +338,9 @@ export default {
prodId: null,
productRecord: null,
followUpSalesmanId: null,
receiptItemStatus: null, //明细状态
invoicingStatus: null, //开票状态
invoiceDataStatus: null //开票明细状态
},
dateFilter: [],
downloading: false, // 导出状态
......@@ -563,50 +365,132 @@ export default {
dialogTitle2: "收款单批量反审核",
dialogVisible3: false, //批量反核销对话框
dialogTitle3: "收款单批量反核销",
currencyList: [],
};
currencyList: []
}
},
activated() {
this.getList();
this.getList()
},
created() {
//获取汇率 lanbm 2024-06-06 add
getCurrencyPage(this.params).then(
(res) => (this.currencyList = res.data.list)
);
getCurrencyPage(this.params).then((res) => (this.currencyList = res.data.list))
let that = this;
listSimpleUsers().then((res) => (that.creatorData = res.data));
let that = this
listSimpleUsers().then((res) => (that.creatorData = res.data))
this.getList();
this.getList()
},
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() {
this.loading = true;
this.params = {};
this.loading = true
this.params = {}
for (var key in this.queryParams) {
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 };
this.addBeginAndEndTime(params, this.dateRangeCreateTime, "createTime");
let params = this.removeEmpty({ ...this.params })
this.addBeginAndEndTime(params, this.dateRangeCreateTime, "createTime")
// 执行查询
getReceiptList(params).then((response) => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
this.list = response.data.list
this.total = response.data.total
this.loading = false
})
},
changeCustomerId(e) {
this.$set(this.queryParams, "customerId", e.id);
this.$set(this.queryParams, "customerId", e.id)
},
verificationClick(row) {
const id = row.id;
return this.$router.push("receiptDetail?id=" + id);
const id = row.id
return this.$router.push("receiptDetail?id=" + id)
// this.$modal
// .confirm("您确认要核销吗?")
// .then(function () {
......@@ -619,8 +503,8 @@ export default {
// .catch(() => {});
},
verificationCancelClick(row) {
const id = row.id;
return this.$router.push("receiptDetail?id=" + id);
const id = row.id
return this.$router.push("receiptDetail?id=" + id)
// this.$modal
// .confirm("您确认要反核销吗?")
// .then(function () {
......@@ -633,282 +517,275 @@ export default {
// .catch(() => {});
},
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 "";
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 ""
},
//显示取消审核弹窗
cancelClick(index, type) {
this.selectIndex = index;
this.cancelIndex = type;
this.cancelReason = "";
this.selectIndex = index
this.cancelIndex = type
this.cancelReason = ""
if (this.cancelIndex == 1) {
this.cancelTitle = this.$t("取消审核");
this.cancelTitle = this.$t("取消审核")
} else if (this.cancelIndex == 2) {
this.cancelTitle = this.$t("取消反审核");
this.cancelTitle = this.$t("取消反审核")
} else if (this.cancelIndex == 3) {
this.cancelTitle = this.$t("取消反核销审核");
this.cancelTitle = this.$t("取消反核销审核")
} else {
this.cancelTitle = this.$t("取消全部核销审核");
this.cancelTitle = this.$t("取消全部核销审核")
}
this.cancelShow = true;
this.cancelShow = true
},
//取消审核
cancelWriteOffClick() {
if (!this.cancelReason) {
this.$modal.msgError(this.$t("请输入申请理由"));
return;
this.$modal.msgError(this.$t("请输入申请理由"))
return
}
var receiptId = this.list[this.selectIndex].id;
var receiptId = this.list[this.selectIndex].id
if (this.cancelIndex == 1) {
cancelFinanceReceiptApproval({
receiptId: receiptId,
remark: this.cancelReason,
remark: this.cancelReason
}).then((res) => {
this.cancelShow = false;
this.getList();
this.$message.success(this.$t("提交成功"));
});
this.cancelShow = false
this.getList()
this.$message.success(this.$t("提交成功"))
})
} else if (this.cancelIndex == 2) {
cancelFinanceReceiptApprovalNo({
receiptId: receiptId,
remark: this.cancelReason,
remark: this.cancelReason
}).then((res) => {
this.cancelShow = false;
this.getList();
this.$message.success(this.$t("提交成功"));
});
this.cancelShow = false
this.getList()
this.$message.success(this.$t("提交成功"))
})
} else if (this.cancelIndex == 3) {
cancelFinanceReceiptWriteOffNo({
receiptId: receiptId,
remark: this.cancelReason,
remark: this.cancelReason
}).then((res) => {
this.cancelShow = false;
this.getList();
this.$message.success(this.$t("提交成功"));
});
this.cancelShow = false
this.getList()
this.$message.success(this.$t("提交成功"))
})
} else {
cancelFinanceReceiptWriteOff({
receiptId: receiptId,
remark: this.cancelReason,
remark: this.cancelReason
}).then((res) => {
this.cancelShow = false;
this.getList();
this.$message.success(this.$t("提交成功"));
});
this.cancelShow = false
this.getList()
this.$message.success(this.$t("提交成功"))
})
}
},
writeOffClick() {
if (!this.reason) {
this.$modal.msgError(this.$t("请输入申请理由"));
return;
this.$modal.msgError(this.$t("请输入申请理由"))
return
}
const receiptIdData = this.list[this.writeOffIndex];
const receiptIdData = this.list[this.writeOffIndex]
if (this.writeOffType == 1) {
financeApproveNo({
receiptId: receiptIdData.id,
receiptNo: receiptIdData.receiptNo,
remark: this.reason,
remark: this.reason
}).then((res) => {
this.getList();
this.$message.success(this.$t("提交成功"));
this.dialogVisible = false;
});
this.getList()
this.$message.success(this.$t("提交成功"))
this.dialogVisible = false
})
} else {
financeReceiptWriteOffNo({
receiptId: receiptIdData.id,
receiptNo: receiptIdData.receiptNo,
remark: this.reason,
remark: this.reason
}).then((res) => {
this.getList();
this.$message.success(this.$t("提交成功"));
this.dialogVisible = false;
});
this.getList()
this.$message.success(this.$t("提交成功"))
this.dialogVisible = false
})
}
},
deleteClick(row) {
const id = row.id;
const id = row.id
this.$modal
.confirm(this.$t("是否确认删除该收款单") + "?")
.then(function () {
return deleteReceipt(id);
return deleteReceipt(id)
})
.then(() => {
this.getList();
this.$modal.msgSuccess(this.$t("删除成功"));
this.getList()
this.$modal.msgSuccess(this.$t("删除成功"))
})
.catch(() => {});
.catch(() => {})
},
/** 搜索按钮操作 */
handleQuery() {
if (this.dateFilter && this.dateFilter.length > 0) {
this.queryParams.beginCreateTime = this.dateFilter[0];
this.queryParams.endCreateTime = this.dateFilter[1];
this.queryParams.beginCreateTime = this.dateFilter[0]
this.queryParams.endCreateTime = this.dateFilter[1]
} else {
this.queryParams.beginCreateTime = "";
this.queryParams.endCreateTime = "";
this.queryParams.beginCreateTime = ""
this.queryParams.endCreateTime = ""
}
this.queryParams.page = 1;
this.getList();
this.queryParams.page = 1
this.getList()
},
handleQuery2() {
//批量反审核 lanbm 2024-05-14 add
if (this.ids.length == 0) {
this.$message.error(this.$t("请选择需要批量反审核收款单。"));
return;
this.$message.error(this.$t("请选择需要批量反审核收款单。"))
return
}
this.listPar = [];
this.listPar = []
for (var i = 0; i < this.ids.length; i++) {
if (this.ids[i].state != 1) {
this.$message.error(this.$t("选中项中有不符合反审核条件的收款单。"));
return;
this.$message.error(this.$t("选中项中有不符合反审核条件的收款单。"))
return
}
let obj = {
receiptId: this.ids[i].id,
receiptNo: this.ids[i].receiptNo,
remark: this.reason,
};
this.listPar.push(obj);
remark: this.reason
}
this.listPar.push(obj)
}
this.reason = "";
this.dialogVisible2 = true;
this.reason = ""
this.dialogVisible2 = true
},
writeOffClick2() {
//批量反审核 提交响应函数
financeReceiptWriteOffNo2(this.listPar).then((res) => {
this.getList();
this.$message.success(this.$t("提交成功"));
this.reason = "";
this.dialogVisible2 = true;
});
this.getList()
this.$message.success(this.$t("提交成功"))
this.reason = ""
this.dialogVisible2 = true
})
},
handleQuery3() {
//批量反核销 lanbm 2024-05-14 add
if (this.ids.length == 0) {
this.$message.error(this.$t("请选择需要批量反核销收款单。"));
return;
this.$message.error(this.$t("请选择需要批量反核销收款单。"))
return
}
this.listPar = [];
this.listPar = []
for (var i = 0; i < this.ids.length; i++) {
//必须满足能反核销的状态条件
if (
this.ids[i].state == 4 ||
this.ids[i].state == 5 ||
this.ids[i].state == 6
) {
if (this.ids[i].state == 4 || this.ids[i].state == 5 || this.ids[i].state == 6) {
let obj = {
receiptId: this.ids[i].id,
receiptNo: this.ids[i].receiptNo,
remark: this.reason,
};
this.listPar.push(obj);
remark: this.reason
}
this.listPar.push(obj)
} else {
this.$message.error(this.$t("选中项中有不符合反审核条件的收款单。"));
return;
this.$message.error(this.$t("选中项中有不符合反审核条件的收款单。"))
return
}
}
this.reason = "";
this.dialogVisible3 = true;
this.reason = ""
this.dialogVisible3 = true
},
writeOffClick3() {
//批量反核销 提交按钮响应函数
financeReceiptWriteOffNo2(this.listPar).then((res) => {
this.getList();
this.$message.success(this.$t("提交成功"));
this.reason = "";
this.dialogVisible3 = true;
});
this.getList()
this.$message.success(this.$t("提交成功"))
this.reason = ""
this.dialogVisible3 = true
})
},
handleQuery4() {
//批量核销 lanbm 2024-05-14 add
if (this.ids.length == 0) {
//校验参数
this.$message.error(this.$t("请选择需要批量核销的收款单。"));
return;
this.$message.error(this.$t("请选择需要批量核销的收款单。"))
return
}
//var str = JSON.stringify(this.ids);
this.listPar = [];
this.listPar = []
for (var i = 0; i < this.ids.length; i++) {
if (this.ids[i].state == 0) {
this.$message.error(this.ids[i].receiptNo + "是草稿状态,不能核销。");
return;
this.$message.error(this.ids[i].receiptNo + "是草稿状态,不能核销。")
return
}
if (this.ids[i].state == 4) {
this.$message.error(
this.ids[i].receiptNo + "是已核销状态,不用再次核销。"
);
return;
this.$message.error(this.ids[i].receiptNo + "是已核销状态,不用再次核销。")
return
}
let obj = {
receiptId: this.ids[i].id,
receiptNo: this.ids[i].receiptNo,
remark: this.reason,
};
this.listPar.push(obj);
remark: this.reason
}
this.listPar.push(obj)
}
//var str2 = JSON.stringify(listPar);
financeReceiptWriteOff2(this.listPar).then((res) => {
this.getList();
this.$message.success(this.$t("提交成功"));
this.dialogVisible = false;
});
this.getList()
this.$message.success(this.$t("提交成功"))
this.dialogVisible = false
})
},
/** 新增按钮操作 */
handleAdd(id) {
return this.$router.push("creatCollection?id=" + id);
return this.$router.push("creatCollection?id=" + id)
},
toprint(id) {
return this.$router.push("printVoucher?id=" + id);
return this.$router.push("printVoucher?id=" + id)
},
openInvoice(id) {
return this.$router.push("openInvoice?id=" + id);
return this.$router.push("openInvoice?id=" + id)
},
exportReceipt(id) {
this.open = true;
this.exportId = id;
this.open = true
this.exportId = id
},
//显示反审核反核销弹窗
writeOffShow(type, index) {
this.writeOffType = type;
this.writeOffIndex = index;
this.reason = "";
this.dialogVisible = true;
this.writeOffType = type
this.writeOffIndex = index
this.reason = ""
this.dialogVisible = true
},
submitForm(type) {
this.downloading = true;
this.downloading = true
receiptExportExcel({ id: this.exportId, billType: type })
.then((response) => {
this.$download.excel(
response,
`${type === 1 ? this.$t("国内账单") : "Debite_note"}.xls`
);
this.open = false;
this.$download.excel(response, `${type === 1 ? this.$t("国内账单") : "Debite_note"}.xls`)
this.open = false
})
.finally(() => (this.downloading = false));
.finally(() => (this.downloading = false))
},
paymentDetail2(row) {
//到订单详情 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) {
//表格多选函数 lanbm 2024-05-20 add
this.id = [];
this.ids = selection;
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
},
};
this.id = []
this.ids = selection
this.single = selection.length !== 1
this.multiple = !selection.length
}
}
}
</script>
<style scoped>
<style scoped>
.dialog-footer-upload {
display: flex;
justify-content: end;
padding-top: 30px;
}
.card {
margin-top: 20px;
}
......@@ -918,6 +795,7 @@ export default {
flex-direction: column;
align-items: center;
justify-content: space-between;
height: 160px;
}
.dialog-footers {
......
......@@ -340,7 +340,7 @@
<el-dropdown-menu slot="dropdown">
<!--出货订单编辑,shipmentState > 0表示出货后,inWarehouseState == 0 表示预装未审核或者是卸柜到仓 , shipmentState==307 表示已预装,待封柜, shipmentState==407 表示已预装,待封柜)-->
<template
v-if="scope.row.shipmentState > 0 &&
v-if="(scope.row.shipmentState > 0 || scope.row.status == 16) &&
scope.row.inWarehouseState == 0 &&
exclude(scope.row.auditType, [1, 2, 3, 4, 5, 6, 11, 23, 28, 31, 32]) &&
exclude(scope.row.shipmentState, [305, 307, 309, 310, 311, 313, 407,409,411])"
......
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="120px"
>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
<el-form-item label="收款单编号" prop="receiptNo">
<el-input
v-model="queryParams.receiptNo"
placeholder="收款单编号"
clearable
/>
<el-input v-model="queryParams.receiptNo" placeholder="收款单编号" clearable />
</el-form-item>
<el-form-item label="订单号" prop="orderNo">
<el-input
v-model="queryParams.orderNo"
placeholder="订单号"
clearable
/>
<el-input v-model="queryParams.orderNo" placeholder="订单号" clearable />
</el-form-item>
<el-form-item label="提单号" prop="tidanNo">
<el-input
v-model="queryParams.tidanNo"
placeholder="提单号"
clearable
/>
<el-input v-model="queryParams.tidanNo" placeholder="提单号" clearable />
</el-form-item>
<el-form-item label="创建人" prop="creator">
<el-input
v-model="queryParams.creator"
placeholder="创建人"
clearable
/>
<el-input v-model="queryParams.creator" placeholder="创建人" clearable />
</el-form-item>
<el-form-item label="创建时间" prop="createDate">
<el-date-picker
v-model="queryParams.sDate1"
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-date-picker v-model="queryParams.sDate1" 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 label="提交审批时间" prop="spDate">
<el-date-picker
v-model="queryParams.sDate2"
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-date-picker v-model="queryParams.sDate2" 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 label="审批通过时间" prop="tgDate">
<el-date-picker
v-model="queryParams.sDate3"
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-date-picker v-model="queryParams.sDate3" 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 label="实收日期" prop="ssDate">
<el-date-picker
v-model="queryParams.sDate4"
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-date-picker v-model="queryParams.sDate4" 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 :label="$t('收款账户')" prop="accountNo">
<el-select
filterable
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 filterable 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-form-item>
<el-form-item label="状态" prop="creator">
<el-select
v-model="queryParams.status"
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 v-model="queryParams.status" 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-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-button type="primary" icon="el-icon-search" @click="handleQuery"
>搜索</el-button
>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
<el-button type="primary" @click="handleAdd">
{{ $t("批量提交审核") }}</el-button
>
<el-button type="primary" @click="handleAdd"> {{ $t("批量提交审核") }}</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5"> </el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table
ref="multipleTable"
v-loading="loading"
:data="list"
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"
>
<el-table ref="multipleTable" v-loading="loading" :data="list" 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('收款单编号')" width="120" align="center" prop="receiptNo">
<template slot-scope="scope">
<span style="color: #1890ff" @click="paymentDetail1(scope.row)">{{
scope.row.receiptNo
}}</span>
<span style="color: #1890ff" @click="paymentDetail1(scope.row)">{{ scope.row.receiptNo }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('订单编号')" align="center" prop="orderNo">
<template slot-scope="scope">
<span style="color: #1890ff" @click="paymentDetail2(scope.row)">{{
scope.row.orderNo
}}</span>
<el-table-column :label="$t('流水号')" width="160" align="center" prop="serialNumber" />
<el-table-column :label="$t('订单编号/提单编号')" width="200" align="center" prop="orderNo">
<!-- <template slot-scope="scope"> -->
<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>
<!-- <span style="color: #1890ff" @click="paymentDetail2(scope.row)">{{ scope.row.orderNo }}</span>
</template> -->
</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">
<span style="color: #1890ff" @click="paymentDetail3(scope.row)">{{
scope.row.tidanNo
}}</span>
<span style="color: #1890ff" @click="paymentDetail3(scope.row)">{{ scope.row.tidanNo }}</span>
</template>
</el-table-column>
<el-table-column
:label="$t('收款账户')"
align="center"
prop="accountName"
/>
<el-table-column :label="$t('实收金额')" align="center" prop="amount" />
</el-table-column> -->
<el-table-column :label="$t('收款账户')" width="100" align="center" prop="accountName" />
<el-table-column :label="$t('实收金额')" width="100" align="center" prop="amount" />
<el-table-column :label="$t('实收币种')" align="center" prop="marks">
<template slot-scope="scope">
{{ getCurrencyLabel(scope.row.currencyId) }}
</template>
</el-table-column>
<el-table-column :label="$t('汇率')" align="center" prop="rate" />
<el-table-column align="center" prop="writeOffAmount">
<template #header>
{{ $t("兑核销基准金额") }}{{ getCurrencyLabel(showCurrencyId) }}
</template>
</el-table-column>
<el-table-column :label="$t('实收日期')" align="center" prop="amountDate">
<el-table-column align="center" prop="writeOffAmount" :formatter="formatCurrency">
<template #header> {{ $t("兑核销基准金额") }} </template>
</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="attr">
<template slot-scope="scope" v-if="scope.row.attrList">
<div v-for="(v, i) in scope.row.attrList" :key="i">
<el-link :href="v.url" type="primary" target="_blank">{{
v.name
}}</el-link>
<el-link :href="v.url" type="primary" target="_blank">{{ v.name }}</el-link>
</div>
</template>
</el-table-column>
<el-table-column :label="$t('状态')" align="center" prop="status">
<template slot-scope="scope">
<dict-tag
:type="DICT_TYPE.RECEIPT_ITEM_STATE"
:value="scope.row.status"
/>
<dict-tag :type="DICT_TYPE.RECEIPT_ITEM_STATE" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column :label="$t('创建人')" align="center" prop="creator" />
<el-table-column
:label="$t('创建时间')"
align="center"
prop="createTime"
/>
<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">
<el-table-column :label="$t('创建时间')" width="160" align="center" prop="createTime" />
<el-table-column :label="$t('提交审批人')" align="center" prop="createBpm" />
<el-table-column :label="$t('提交审批时间')" width="160" align="center" prop="createTimeBpm" />
<el-table-column :label="$t('审批通过时间')" width="160" align="center" prop="updateTimeBpm" />
<el-table-column :label="$t('操作')" fixed="right" align="center" width="200">
<template slot-scope="scope">
<el-button
v-if="scope.row.status == 0"
v-hasPermi="['ecw:payment:detail:delete']"
type="text"
@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 v-if="scope.row.status == 0" v-hasPermi="['ecw:payment:detail:delete']" type="text" @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
v-if="scope.row.status == 0"
type="text"
@click="editClick(scope.row)"
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
>
<el-button v-if="scope.row.status == 0" type="text" @click="editClick(scope.row)" 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>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<pagination 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%">
<div class="cancel_content">
<span>{{ $t("申请理由") }}</span>
<el-input
type="textarea"
:rows="6"
v-model="cancelReason"
:placeholder="$t('请输入取消理由')"
></el-input>
<el-input type="textarea" :rows="6" v-model="cancelReason" :placeholder="$t('请输入取消理由')"></el-input>
</div>
<span slot="footer" class="dialog-footers">
<el-button type="primary" @click="cancelWriteOffClick()">{{
$t("提交")
}}</el-button>
<el-button type="primary" @click="cancelWriteOffClick()">{{ $t("提交") }}</el-button>
<el-button @click="cancelShow = false">{{ $t("取消") }}</el-button>
</span>
</el-dialog>
<el-dialog
:title="$t('收款单银行实收明细反核销-未提交')"
:visible.sync="dialogVisible"
width="30%"
>
<el-dialog :title="$t('收款单银行实收明细反核销-未提交')" :visible.sync="dialogVisible" width="30%">
<div class="cancel_content">
<span>{{ $t("申请理由") }}</span>
<el-input
type="textarea"
:rows="6"
v-model="reason"
:placeholder="$t('请输入理由')"
></el-input>
<el-input type="textarea" :rows="6" v-model="reason" :placeholder="$t('请输入理由')"></el-input>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="verificationCancelClick()">{{
$t("提交反核销")
}}</el-button>
<el-button type="primary" @click="verificationCancelClick()">{{ $t("提交反核销") }}</el-button>
<el-button @click="dialogVisible = false">{{ $t("取消") }}</el-button>
</span>
</el-dialog>
<el-dialog
:visible.sync="openAddDialog"
:title="dialogTitle"
width="50%"
append-to-body
>
<!--
<el-dialog :visible.sync="openAddDialog" :title="dialogTitle" width="50%" append-to-body>
<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-input
disabled
v-model="form.receipt_no"
style="width: 220px"
></el-input>
<el-input disabled v-model="form.receipt_no" style="width: 220px"></el-input>
</el-form-item>
<el-form-item :label="$t('剩余应收金额')">
<span> {{ form.syValue }}</span>
</el-form-item>
<el-form-item :label="$t('收款账户')" prop="accountNo">
<el-select
:disabled="isEdit"
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 :disabled="isEdit" 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-form-item>
<el-form-item :label="$t('实收日期')" prop="amountDate">
<el-date-picker
:disabled="isEdit"
v-model="form.amountDate"
type="date"
style="width: 150px"
value-format="yyyy-MM-dd"
></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>
</el-form-item>
<el-form-item :label="$t('实收')" prop="amount">
<el-input
v-model="form.amount"
:disabled="isEdit"
style="width: 100px"
></el-input>
<el-input v-model="form.amount" :disabled="isEdit" style="width: 100px"></el-input>
<el-select
v-model="form.currencyId"
: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 v-model="form.currencyId" :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-form-item>
<el-form-item prop="rate">
<template slot="label">
<span
:title="
$t(
'实收币种与核销基准币种一样时,无需填写汇率,不一样需要填写汇率'
)
"
>{{ $t("兑核销基准币种汇率") }}{{
getCurrencyLabel(showCurrencyId)
}}</span
>
<span :title="$t('实收币种与核销基准币种一样时,无需填写汇率,不一样需要填写汇率')">{{ $t("兑核销基准币种汇率") }}({{ getCurrencyLabel(showCurrencyId) }})</span>
</template>
<el-input
v-model="form.rate"
:disabled="isEdit"
style="width: 220px"
></el-input>
<el-input v-model="form.rate" :disabled="isEdit" style="width: 220px"></el-input>
</el-form-item>
<el-form-item>
<template slot="label">
{{ $t("兑核销基准币种金额") }}{{
getCurrencyLabel(showCurrencyId)
}}
</template>
<el-input
:disabled="isEdit"
v-model="form.writeOffAmount"
style="width: 220px"
></el-input>
<template slot="label"> {{ $t("兑核销基准币种金额") }}({{ getCurrencyLabel(showCurrencyId) }}) </template>
<el-input :disabled="isEdit" v-model="form.writeOffAmount" style="width: 220px"></el-input>
</el-form-item>
<el-form-item :label="$t('水单附件')" prop="attr">
<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
>
<el-button size="small" type="primary">{{
$t("上传附件")
}}</el-button>
<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>
<el-button size="small" type="primary">{{ $t("上传附件") }}</el-button>
</el-upload>
<div v-else>
<div v-for="(v, i) in form.attr" :key="i">
<el-link :href="v.url" type="primary" target="_blank">{{
v.name
}}</el-link>
<el-link :href="v.url" type="primary" target="_blank">{{ v.name }}</el-link>
</div>
</div>
</el-form-item>
<el-form-item :label="$t('水单号')" prop="billNo">
<el-input
v-model="form.billNo"
:disabled="isEdit"
style="width: 220px"
></el-input>
<el-input v-model="form.billNo" :disabled="isEdit" style="width: 220px"></el-input>
</el-form-item>
<!--lanbm 2024-06-12 add-->
<el-form-item :label="$t('创建人')" v-show="isEdit" prop="creator">
<el-input
v-model="form.creator"
style="width: 220px"
></el-input>
<el-input v-model="form.creator" style="width: 220px"></el-input>
</el-form-item>
<el-form-item :label="$t('创建时间')" v-show="isEdit" prop="createTime">
<el-input
v-model="form.createTime"
style="width: 220px"
></el-input>
<el-input v-model="form.createTime" style="width: 220px"></el-input>
</el-form-item>
<el-form-item :label="$t('最后更新人')" v-show="isEdit" prop="updater">
<el-input
v-model="form.updater"
style="width: 220px"
></el-input>
<el-input v-model="form.updater" style="width: 220px"></el-input>
</el-form-item>
<el-form-item :label="$t('最后更新时间')" v-show="isEdit" prop="updateTime">
<el-input
v-model="form.updateTime"
style="width: 220px"
></el-input>
<el-input v-model="form.updateTime" style="width: 220px"></el-input>
</el-form-item>
<el-form-item :label="$t('提交审批人')" v-show="isEdit" prop="createBpm">
<el-input
v-model="form.createBpm"
style="width: 220px"
></el-input>
<el-input v-model="form.createBpm" style="width: 220px"></el-input>
</el-form-item>
<el-form-item :label="$t('审批通过时间')" v-show="isEdit" prop="updateTimeBpm">
<el-input
v-model="form.updateTimeBpm"
style="width: 220px"
></el-input>
<el-input v-model="form.updateTimeBpm" style="width: 220px"></el-input>
</el-form-item>
</el-form>
<div slot="footer">
<el-button type="primary" v-show="!isEdit" @click="saveFrom">{{
saveBtnText
}}</el-button>
<el-button type="primary" v-show="!isEdit" @click="saveFrom">{{ saveBtnText }}</el-button>
<el-button @click="hiddenDialog">{{ $t("取消") }}</el-button>
</div>
</el-dialog>
</el-dialog> -->
<BankReceiptsDetailItem :bankReceiptId="bankReceiptId" :statusKey="bankDetailKey" :openBankReceiptsDetailItemDialog.sync="openDetailItemDialog"></BankReceiptsDetailItem>
</div>
</template>
<script>
import { getPageList } from "@/api/report/bankReceiptDetail";
import { getReceivableItem2 } from "@/api/ecw/financial";
import Treeselect from "@riophae/vue-treeselect";
import "@/assets/styles/vue-treeselect.css";
import { getBankAccountPage } from "@/api/ecw/bankAccount";
import { getCurrencyPage } from "@/api/ecw/currency";
import { getToken } from "@/utils/auth";
import { getExchangeRatePage } from "@/api/ecw/exchangeRate";
import { getPageList } from "@/api/report/bankReceiptDetail"
import { getReceivableItem2 } from "@/api/ecw/financial"
import Treeselect from "@riophae/vue-treeselect"
import "@/assets/styles/vue-treeselect.css"
import { getBankAccountPage } from "@/api/ecw/bankAccount"
import { getCurrencyPage } from "@/api/ecw/currency"
import { getToken } from "@/utils/auth"
import { mapGetters } from "vuex"
import { getExchangeRatePage } from "@/api/ecw/exchangeRate"
import BankReceiptsDetailItem from "@/views/ecw/financial/components/BankReceiptsDetailItem.vue"
import {
deleteReceiptItem, //删除收款单明细
updateReceiptItem,
......@@ -568,21 +248,25 @@ import {
cancelFinanceReceiptApprovalNo,
cancelFinanceReceiptWriteOffNo,
cancelFinanceReceiptWriteOff,
financeReceiptItemWriteOffNo,
} from "@/api/ecw/financial";
financeReceiptItemWriteOffNo
} from "@/api/ecw/financial"
//2024-05-14 银行收款明细列表
export default {
name: "ReportBankReceiptDetailsIndex",
components: {
Treeselect,
BankReceiptsDetailItem
},
data() {
return {
bankReceiptId: "",
bankDetailKey: "edit",
openDetailItemDialog: false,
uploadFileUrl: process.env.VUE_APP_BASE_API + "/app-api/file/upload",
//上传的图片服务器地址
headers: {
Authorization: "Bearer " + getToken(),
Authorization: "Bearer " + getToken()
},
// 遮罩层
loading: true,
......@@ -631,11 +315,12 @@ export default {
eDate4: undefined, //实收日期
creator: undefined, //创建人
accountNo: undefined, //收款账号 lanbm 2024-06-12 add
status:undefined,//审批状态 lanbm 2024-06-13 add
status: undefined, //审批状态 lanbm 2024-06-13 add
serialNumber: undefined
},
params: {
page: 1,
rows: 100,
rows: 100
},
currencyList: [],
// 非单个禁用
......@@ -650,111 +335,119 @@ export default {
bankData: [],
codePage: {
pageNo: 1,
pageSize: 20,
pageSize: 20
},
pages: 1,
rateList: [],
};
rateList: []
}
},
async created() {
await getBankAccountPage(this.codePage).then((res) => {
this.bankData = res.data.list;
this.pages = res.data.total / this.codePage.pageSize + 1;
});
this.bankData = res.data.list
this.pages = res.data.total / this.codePage.pageSize + 1
})
// 获取汇率
await getExchangeRatePage(this.params).then(
(res) => (this.rateList = res.data.list)
);
await getExchangeRatePage(this.params).then((res) => (this.rateList = res.data.list))
//币种
await getCurrencyPage(this.params).then(
(res) => (this.currencyList = res.data.list)
);
this.getList();
await getCurrencyPage(this.params).then((res) => (this.currencyList = res.data.list))
this.getList()
},
computed: {
...mapGetters(["getCurrencySymbol"]),
showCurrencyId() {
let fieldList = [];
let groupList = [];
let fieldList = []
let groupList = []
this.list.map((element) => {
if (fieldList.indexOf(element["currencyId"]) === -1) {
fieldList.push(element["currencyId"]);
fieldList.push(element["currencyId"])
}
});
})
for (let i = 0; i < fieldList.length; i++) {
let arr = this.list.filter((element) => {
return element["currencyId"] === fieldList[i];
});
return element["currencyId"] === fieldList[i]
})
groupList.push({
currencyId: arr[0].currencyId,
list: arr,
});
list: arr
})
}
if (groupList.length === 1) return groupList[0].currencyId
else return 1
}
if (groupList.length === 1) return groupList[0].currencyId;
else return 1;
},
},
watch: {
"form.rate"() {
this.setWriteOffAmount();
"$route.query.receiptNo": {
handler(val) {
if (val) {
this.queryParams.receiptNo = val
}
},
immediate: true
}
// "form.rate"() {
// this.setWriteOffAmount()
// }
},
methods: {
// 基准币种的展示
formatCurrency(row, column, cellValue) {
if (column.property == "writeOffAmount") {
return this.getCurrencySymbol(row.writeOffCurrencyId) + (cellValue || "0")
}
return this.getCurrencySymbol(row.currencyId) + (cellValue || "0")
},
isChinese() {
//基础函数,判断系统显示语言是中文还是英文
return this.$i18n.locale === "zh_CN";
return this.$i18n.locale === "zh_CN"
},
// 懒加载
loadmore() {
this.codePage.pageNo++;
this.codePage.pageNo++
// 大于页码不请求了
if (this.codePage.pageNo > this.pages) {
return;
return
}
this.getCodeList();
this.getCodeList()
},
/** 查询列表 */
getList() {
this.loading = true;
this.loading = true
// 处理查询参数
let params = { ...this.queryParams };
let params = { ...this.queryParams }
// 执行查询
getPageList(params).then((response) => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
this.list = response.data.list
this.total = response.data.total
this.loading = false
})
},
currencyIdChange(val) {
val = Number(val);
let rate;
val = Number(val)
let rate
if (val === this.showCurrencyId) {
rate = 1;
rate = 1
} else {
rate = this.getRate(val, 1);
rate = this.getRate(val, 1)
}
this.$set(this.form, "rate", rate);
var sR = (rate * this.form.amount).toFixed(6);
this.$set(this.form, "writeOffAmount", sR);
this.$set(this.form, "rate", rate)
var sR = (rate * this.form.amount).toFixed(6)
this.$set(this.form, "writeOffAmount", sR)
},
accountChange(val) {
let data = this.bankData.find((item) => item.id == val);
this.$set(this.form, "accountName", data.baAccountName || "");
this.$set(this.form, "accountNo", data.baAccountNum || "");
this.$set(this.form, "accountBankName", data.baBankName || "");
let data = this.bankData.find((item) => item.id == val)
this.$set(this.form, "accountName", data.baAccountName || "")
this.$set(this.form, "accountNo", data.baAccountNum || "")
this.$set(this.form, "accountBankName", data.baBankName || "")
},
//获取汇率
getRate(sourceCurrencyId, targetCurrencyId) {
//let json1 = JSON.stringify(this.rateList);
//alert(json1);
let rate = this.rateList.find(
(v) =>
v.sourceCurrencyId === sourceCurrencyId &&
v.targetCurrencyId === targetCurrencyId
);
if (rate) return rate.currencyRate;
return "";
let rate = this.rateList.find((v) => v.sourceCurrencyId === sourceCurrencyId && v.targetCurrencyId === targetCurrencyId)
if (rate) return rate.currencyRate
return ""
},
/** 表单重置 */
reset() {
......@@ -771,60 +464,60 @@ export default {
sDate3: undefined,
eDate3: undefined, //审批通过日期
creator: undefined, //创建人
};
serialNumber: undefined
}
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
this.queryParams.pageNo = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.reset();
this.reset()
},
hiddenDialog() {
this.openAddDialog = false;
this.openAddDialog = false
},
saveFrom() {
this.$refs.form.validate((valid) => {
if (valid) {
if (this.form.id) {
const params = { ...this.form };
const params = { ...this.form }
/*
params.attr &&
(params.attr = params.attr.map((v) => v.url).join(","));
*/
updateReceiptItem(params).then((res) => {
this.$modal.msgSuccess(this.$t("修改成功"));
this.openAddDialog = false;
this.getList();
});
return;
this.$modal.msgSuccess(this.$t("修改成功"))
this.openAddDialog = false
this.getList()
})
return
}
const params = { ...this.form };
params.attr &&
(params.attr = params.attr.map((v) => v.url).join(","));
params.receiptId = this.id;
const params = { ...this.form }
params.attr && (params.attr = params.attr.map((v) => v.url).join(","))
params.receiptId = this.id
receiptItemCreate(params).then((res) => {
this.$modal.msgSuccess(this.$t("新增成功"));
this.openAddDialog = false;
this.getList();
});
this.$modal.msgSuccess(this.$t("新增成功"))
this.openAddDialog = false
this.getList()
})
}
});
})
},
//银行明细反核销
verificationCancelClick() {
if (!this.reason) {
this.$modal.msgError(this.$t("请输入申请理由"));
return;
this.$modal.msgError(this.$t("请输入申请理由"))
return
}
//银行收款明细ID
const s_id = this.list[this.selectIndex].id;
const s_id = this.list[this.selectIndex].id
//收款单ID
const s_receiptId = this.list[this.selectIndex].receiptId;
const s_receiptNo = this.list[this.selectIndex].receiptNo;
const s_receiptId = this.list[this.selectIndex].receiptId
const s_receiptNo = this.list[this.selectIndex].receiptNo
this.$modal
.confirm(this.$t("您确认要反核销吗") + "?")
.then(() => {
......@@ -832,328 +525,320 @@ export default {
receiptId: s_receiptId, //收款单ID
receiptNo: s_receiptNo, //收款单编号
receiptItemId: s_id, //银行收款明细项ID
remark: this.reason,
remark: this.reason
}).then((res) => {
this.getList();
this.$message.success(this.$t("提交成功"));
this.dialogVisible = false;
});
this.getList()
this.$message.success(this.$t("提交成功"))
this.dialogVisible = false
})
})
.catch(() => {
this.dialogVisible = false;
});
this.dialogVisible = false
})
},
//取消审核
cancelWriteOffClick() {
if (!this.cancelReason) {
this.$modal.msgError(this.$t("请输入申请理由"));
return;
this.$modal.msgError(this.$t("请输入申请理由"))
return
}
//银行收款明细ID
const s_id = this.list[this.selectIndex].id;
const s_id = this.list[this.selectIndex].id
//收款单ID
var s_receiptId = this.list[this.selectIndex].receiptId;
var s_receiptId = this.list[this.selectIndex].receiptId
if (this.cancelIndex == 1) {
//取消审核
cancelFinanceReceiptApproval({
receiptId: s_receiptId,
remark: this.cancelReason,
remark: this.cancelReason
}).then((res) => {
this.cancelShow = false;
this.getList();
this.$message.success(this.$t("提交成功"));
});
this.cancelShow = false
this.getList()
this.$message.success(this.$t("提交成功"))
})
} else if (this.cancelIndex == 2) {
//取消反审核
cancelFinanceReceiptApprovalNo({
receiptId: s_receiptId,
remark: this.cancelReason,
remark: this.cancelReason
}).then((res) => {
this.cancelShow = false;
this.getList();
this.$message.success(this.$t("提交成功"));
});
this.cancelShow = false
this.getList()
this.$message.success(this.$t("提交成功"))
})
} else if (this.cancelIndex == 3) {
//取消反核销审核
cancelFinanceReceiptWriteOffNo({
receiptId: s_receiptId,
remark: this.cancelReason,
remark: this.cancelReason
}).then((res) => {
this.cancelShow = false;
this.getList();
this.$message.success(this.$t("提交成功"));
});
this.cancelShow = false
this.getList()
this.$message.success(this.$t("提交成功"))
})
} else {
//取消全部核销审核
cancelFinanceReceiptWriteOff({
receiptId: s_receiptId,
remark: this.cancelReason,
remark: this.cancelReason
}).then((res) => {
this.cancelShow = false;
this.getList();
this.$message.success(this.$t("提交成功"));
});
this.cancelShow = false
this.getList()
this.$message.success(this.$t("提交成功"))
})
}
},
//显示反核销弹窗
showCancel(index) {
this.selectIndex = index;
this.reason = "";
this.dialogVisible = true;
this.selectIndex = index
this.reason = ""
this.dialogVisible = true
},
//显示取消审核弹窗
cancelClick(index, type) {
this.selectIndex = index;
this.cancelIndex = type;
this.cancelReason = "";
this.selectIndex = index
this.cancelIndex = type
this.cancelReason = ""
if (this.cancelIndex == 1) {
this.cancelTitle = this.$t("取消审核");
this.cancelTitle = this.$t("取消审核")
} else if (this.cancelIndex == 2) {
this.cancelTitle = this.$t("取消反审核");
this.cancelTitle = this.$t("取消反审核")
} else if (this.cancelIndex == 3) {
this.cancelTitle = this.$t("取消反核销审核");
this.cancelTitle = this.$t("取消反核销审核")
} else {
this.cancelTitle = this.$t("取消全部核销审核");
this.cancelTitle = this.$t("取消全部核销审核")
}
this.cancelShow = true;
this.cancelShow = true
},
/** 批量提交审核 */
handleAdd() {
if (this.ids.length == 0) {
this.$message.error(this.$t("请选择需要批量提交的收款明细。"));
return;
this.$message.error(this.$t("请选择需要批量提交的收款明细。"))
return
}
let objDataList = [];
let objDataList = []
for (var i = 0; i < this.ids.length; i++) {
//选中项中都是待提交的记录
if (this.ids[i].status != 0) {
this.$message.error(this.$t("选择中有不符合提交条件的收款明细。"));
return;
this.$message.error(this.$t("选择中有不符合提交条件的收款明细。"))
return
}
var objData = {
receiptId: this.ids[i].receiptId, //收款单ID
receiptNo: this.ids[i].receiptNo, //收款单编号
receiptItemId: this.ids[i].id, //收款明细ID
};
objDataList.push(objData);
receiptItemId: this.ids[i].id //收款明细ID
}
objDataList.push(objData)
}
this.$modal
.confirm(this.$t("您确认要提交审核吗" + "?"))
.then(() => {
financeReceiptItemWriteOff2(objDataList).then((res) => {
this.$message.success(this.$t("提交成功"));
this.$message.success(this.$t("提交成功"))
//刷新列表
this.getList();
});
this.getList()
})
.catch(() => {});
})
.catch(() => {})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (!valid) {
return;
return
}
// 修改的提交
if (this.form.id != null) {
update(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
return
}
// 添加的提交
create(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
})
},
paymentDetail1(row) {
//到收款单详情 lanbm 2024-05-18 add
const id = row.receiptId;
return this.$router.push("/financial/receiptDetail?id=" + id);
const id = row.receiptId
return this.$router.push("/financial/receiptDetail?id=" + id)
},
paymentDetail2(row) {
//到订单详情 lanbm 2024-05-18 add
const id = row.id;
return this.$router.push("/financial/receiptDetail?id=" + id);
const id = row.id
return this.$router.push("/financial/receiptDetail?id=" + id)
},
paymentDetail3(row) {
//到提单详情 lanbm 2024-05-18 add
const id = row.id;
return this.$router.push("/financial/receiptDetail?id=" + id);
const id = row.id
return this.$router.push("/financial/receiptDetail?id=" + id)
},
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 "";
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 ""
},
handleSelectionChange(selection) {
//表格多选函数 lanbm 2024-05-30 add
this.ids = [];
this.ids = selection;
this.single = selection.length !== 1;
this.multiple = !selection.length;
this.ids = []
this.ids = selection
this.single = selection.length !== 1
this.multiple = !selection.length
},
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
delete node.children
}
return {
id: node.id,
label: node.name,
children: node.children,
};
children: node.children
}
},
getsurplusData() {
// 已收
this.surplusData = [];
let recepted = [];
this.surplusData = []
let recepted = []
this.detailed.forEach((item) => {
if (!recepted[item.currencyId]) {
recepted[item.currencyId] = item.amount;
} else
recepted[item.currencyId] = NP.plus(
recepted[item.currencyId],
item.amount
);
});
recepted[item.currencyId] = item.amount
} else recepted[item.currencyId] = NP.plus(recepted[item.currencyId], item.amount)
})
// 应收
let collom = [];
let collom = []
// 从期望收费金额中提取应收币种和金额
this.form.receiptAccountList
.find((item) => item.type == "total")
.collectionAmount.forEach((item) => {
collom[item.currencyId] = item.amount;
});
collom[item.currencyId] = item.amount
})
recepted.forEach((amount, currency) => {
if (amount) {
if (collom[currency]) {
if (collom[currency] - amount != 0)
this.surplusData[currency] = +parseFloat(
(collom[currency] - amount).toPrecision(12)
);
if (collom[currency] - amount != 0) this.surplusData[currency] = +parseFloat((collom[currency] - amount).toPrecision(12))
} else {
this.surplusData[currency] = -amount;
this.surplusData[currency] = -amount
}
}
});
})
collom.forEach((amount, currency) => {
if (amount) {
if (!this.surplusData[currency]) {
if (recepted[currency]) {
if (amount - recepted[currency] != 0)
this.surplusData[currency] = +parseFloat(
(amount - recepted[currency]).toPrecision(12)
);
if (amount - recepted[currency] != 0) this.surplusData[currency] = +parseFloat((amount - recepted[currency]).toPrecision(12))
} else {
this.surplusData[currency] = amount;
this.surplusData[currency] = amount
}
}
}
});
})
},
detailClick(row) {
//查看详情
let id = row.id;
this.isEdit = true;
getReceivableItem2(id).then((response) => {
this.form = response.data;
//收款单号
this.form.receipt_no = row.receiptNo;
//实收币种
this.form.currencyName = this.getCurrencyLabel(row.currencyId);
//水单附件 分解附件路径
this.form.attr = response.data.attr
? response.data.attr
.split(",")
.map((t) => ({ name: t.slice(t.lastIndexOf("/") + 1), url: t }))
: [];
this.openAddDialog = true;
this.dialogTitle = this.$t("银行实收明细详情");
this.isView = true;
});
this.bankDetailKey = "view"
this.bankReceiptId = row.id
this.openDetailItemDialog = true
// this.dialogTitle = this.$t("银行实收明细详情")
// //查看详情
// let id = row.id
// this.isEdit = true
// getReceivableItem2(id).then((response) => {
// this.form = response.data
// //收款单号
// this.form.receipt_no = row.receiptNo
// //实收币种
// this.form.currencyName = this.getCurrencyLabel(row.currencyId)
// //水单附件 分解附件路径
// this.form.attr = response.data.attr ? response.data.attr.split(",").map((t) => ({ name: t.slice(t.lastIndexOf("/") + 1), url: t })) : []
// this.openAddDialog = true
// this.dialogTitle = this.$t("银行实收明细详情")
// this.isView = true
// })
},
editClick(row) {
let id = row.id;
this.isEdit = false;
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.bankDetailKey = "edit"
this.bankReceiptId = row.id
this.openDetailItemDialog = true
// this.dialogTitle = this.$t("编辑银行实收明细")
// let id = row.id
// this.isEdit = false
// 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
let bank = this.bankData.find(
(v) => v.baAccountNum == this.form.accountNo
);
if (bank) this.form.accountId = bank.id;
// let bank = this.bankData.find((v) => v.baAccountNum == this.form.accountNo)
// if (bank) this.form.accountId = bank.id
this.openAddDialog = true;
this.dialogTitle = this.$t("编辑银行实收明细");
this.saveBtnText = this.$t("提交");
this.isView = false;
});
// this.openAddDialog = true
// this.dialogTitle = this.$t("编辑银行实收明细")
// this.saveBtnText = this.$t("提交")
// this.isView = false
// })
},
deleteClick(row) {
const id = row.id;
const id = row.id
this.$modal
.confirm(this.$t("是否确认删除该收款单") + "?")
.then(function () {
return deleteReceiptItem(id);
return deleteReceiptItem(id)
})
.then(() => {
this.getList();
this.$modal.msgSuccess(this.$t("删除成功"));
this.getList()
this.$modal.msgSuccess(this.$t("删除成功"))
})
.catch(() => {});
.catch(() => {})
},
handleUploadSuccess(res, file, fileList) {
let arr = [];
let arr = []
setTimeout(() => {
fileList.forEach((item) => {
arr.push({
name: item.name,
url: item.response ? item.response.data : item.url,
});
});
this.form.attr = arr;
}, 300);
this.UpLoading.close();
url: item.response ? item.response.data : item.url
})
})
this.form.attr = arr
}, 300)
this.UpLoading.close()
},
handleBeforeUpload() {
this.UpLoading = this.$loading({
lock: true,
text: this.$t("上传中"),
background: "rgba(0, 0, 0, 0.7)",
});
background: "rgba(0, 0, 0, 0.7)"
})
},
handleUploadError() {
this.$message({
type: "error",
message: this.$t("上传失败"),
});
this.UpLoading.close();
message: this.$t("上传失败")
})
this.UpLoading.close()
},
beforeRemove(file, fileList) {
return this.$confirm(this.$t("确定移除") + "?").then((res) => {
setTimeout(() => {
this.form.attr = fileList.map((v) => ({
name: v.name,
url: v.response ? v.response.data : v.url,
}));
}, 300);
});
},
},
};
url: v.response ? v.response.data : v.url
}))
}, 300)
})
}
}
}
</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