Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wenHuaBu_adminServer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
node_server
wenHuaBu_adminServer
Commits
f8cff672
Commit
f8cff672
authored
Nov 01, 2024
by
chenjinjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据导出、审批历史、批量开票确认
parent
168c9933
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
413 additions
and
0 deletions
+413
-0
order.ts
src/biz/member/order.ts
+273
-0
outPutConfig.ts
src/config/outPutConfig.ts
+63
-0
router.ts
src/routers/order/router.ts
+56
-0
router.ts
src/routers/public/router.ts
+21
-0
No files found.
src/biz/member/order.ts
View file @
f8cff672
...
...
@@ -307,6 +307,87 @@ export async function confirmReceiptOut({id, isReceive, returnsReasons}) {
/**
* 发票管理-财务核对页-数据导出
* @param param0
*/
export
async
function
outPutConfirmReceipt
({
exportColumns
})
{
let
findParam
:
any
=
{
confirmReceipt
:
RECEIPTCONFIRMATION
.
待确认
,
state
:
ORDERSTATE
.
已支付
}
let
selectTitle
=
[];
let
selectConf
=
[];
exportColumns
.
forEach
(
info
=>
{
selectTitle
.
push
(
info
.
key
);
selectConf
.
push
(
info
.
value
);
})
let
selectFile
=
[
"id"
,
"unitName"
,
"userId"
,
"orderCycleStart"
,
"orderCycleEnd"
,
"money"
,
"paymentMethod"
,
"memberCategory"
,
"paymentNum"
,
"desc"
,
"invoiceMail"
];
let
dbList
=
await
find
(
TABLEENUM
.
订单表
,
findParam
,
selectFile
);
let
timeChnageList
=
[
"orderCycleStart"
,
"operationTime"
];
let
dataList
=
[
selectTitle
];
for
(
let
i
=
0
;
i
<
dbList
.
length
;
i
++
)
{
let
info
=
dbList
[
i
];
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
:
info
.
userId
},
[
"memberState"
,
"name"
,
"unitName"
,
"documentId"
,
"uscc"
,
"mail"
,
"unitMail"
]);
let
subList
=
[];
for
(
let
i
=
0
;
i
<
selectConf
.
length
;
i
++
)
{
let
key
=
selectConf
[
i
];
let
value
=
info
[
key
]
||
""
;
if
(
key
==
"name"
)
{
if
(
info
.
memberCategory
==
MEMBERTYPE
.
个人会员
)
value
=
userInfo
.
name
;
else
if
(
info
.
memberCategory
==
MEMBERTYPE
.
单位会员
)
value
=
userInfo
.
unitName
;
}
if
(
key
==
"card"
)
{
if
(
info
.
memberCategory
==
MEMBERTYPE
.
个人会员
)
value
=
userInfo
.
documentId
;
else
if
(
info
.
memberCategory
==
MEMBERTYPE
.
单位会员
)
value
=
userInfo
.
uscc
;
}
if
(
key
==
"mail"
)
{
if
(
info
.
memberCategory
==
MEMBERTYPE
.
个人会员
)
value
=
userInfo
.
mail
;
else
if
(
info
.
memberCategory
==
MEMBERTYPE
.
单位会员
)
value
=
userInfo
.
unitMail
;
}
if
(
key
==
"paymentMethod"
||
key
==
"paymentNum"
)
{
if
(
!
info
.
paymentMethod
)
{
value
=
"-"
;
}
}
if
(
value
)
{
if
(
timeChnageList
.
indexOf
(
key
)
!=
-
1
)
value
=
moment
(
value
).
format
(
"YYYY-MM-DD"
);
else
if
(
key
==
"memberCategory"
)
value
=
changeEnumValue
(
MEMBERTYPE
,
value
);
else
if
(
key
==
"orderCycle"
)
value
=
`
${
moment
(
info
.
orderCycleStart
).
format
(
"YYYY-MM-DD"
)}
至
${
moment
(
info
.
orderCycleEnd
).
format
(
"YYYY-MM-DD"
)}
`
;
else
if
(
key
==
"memberLevel"
)
value
=
changeEnumValue
(
MEMBERLEVEL
,
value
);
}
subList
.
push
(
value
);
}
dataList
.
push
(
subList
);
}
return
{
dataList
};
}
/**
* 发票管理-财务核对页面-审批历史
* @param param0
* @returns
*/
export
async
function
confirmReceiptHistory
({
id
})
{
let
dbList
=
await
find
(
TABLEENUM
.
订单审批历史表
,
{
orderId
:
id
});
let
dataList
=
[];
dbList
.
forEach
(
info
=>
{
let
item
:
any
=
extractData
(
info
,
[
"operationTime"
,
"operationBehavior"
,
"remarks"
,
"refundImgUrl"
]);
item
.
operationTime
=
moment
(
item
.
operationTime
).
format
(
"YYYY-MM-DD HH:mm:SS"
);
item
.
operationBehavior
=
changeEnumValue
(
ORDEREXAMINE
,
item
.
operationBehavior
);
dataList
.
push
(
item
);
});
return
{
dataList
};
}
/**
* 发票管理-待开发票 success
* @param name 名称关键字:个人会员匹配真实姓名,单位会员匹配单位名称
* @param memberType 会员类别 unitMemberType、individualMemberType 多选
...
...
@@ -427,6 +508,118 @@ export async function backInvoice({id}) {
/**
* 发票管理-待开发票-数据导出
* @param param0
*/
export
async
function
outPutBillState
({
exportColumns
})
{
let
findParam
:
any
=
{
invoiceStatus
:
INVOICESTATUS
.
未开发票
};
let
selectTitle
=
[];
let
selectConf
=
[];
exportColumns
.
forEach
(
info
=>
{
selectTitle
.
push
(
info
.
key
);
selectConf
.
push
(
info
.
value
);
})
let
selectFile
=
[
"id"
,
"unitName"
,
"userId"
,
"orderCycleStart"
,
"orderCycleEnd"
,
"money"
,
"paymentMethod"
,
"memberCategory"
,
"paymentNum"
,
"desc"
,
"invoiceMail"
];
let
dbList
=
await
find
(
TABLEENUM
.
订单表
,
findParam
,
selectFile
);
let
timeChnageList
=
[
"orderCycleStart"
,
"operationTime"
];
let
memberChnageList
=
[
"name"
,
"card"
,
"mail"
];
let
dataList
=
[
selectTitle
];
for
(
let
i
=
0
;
i
<
dbList
.
length
;
i
++
)
{
let
info
=
dbList
[
i
];
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
:
info
.
userId
},
[
"memberState"
,
"name"
,
"unitName"
,
"documentId"
,
"uscc"
,
"mail"
,
"unitMail"
]);
let
subList
=
[];
for
(
let
i
=
0
;
i
<
selectConf
.
length
;
i
++
)
{
let
key
=
selectConf
[
i
];
let
value
=
info
[
key
]
||
""
;
if
(
key
==
"name"
)
{
if
(
info
.
memberCategory
==
MEMBERTYPE
.
个人会员
)
value
=
userInfo
.
name
;
else
if
(
info
.
memberCategory
==
MEMBERTYPE
.
单位会员
)
value
=
userInfo
.
unitName
;
}
if
(
key
==
"card"
)
{
if
(
info
.
memberCategory
==
MEMBERTYPE
.
个人会员
)
value
=
userInfo
.
documentId
;
else
if
(
info
.
memberCategory
==
MEMBERTYPE
.
单位会员
)
value
=
userInfo
.
uscc
;
}
if
(
key
==
"mail"
)
{
if
(
info
.
memberCategory
==
MEMBERTYPE
.
个人会员
)
value
=
userInfo
.
mail
;
else
if
(
info
.
memberCategory
==
MEMBERTYPE
.
单位会员
)
value
=
userInfo
.
unitMail
;
}
if
(
key
==
"paymentMethod"
||
key
==
"paymentNum"
)
{
if
(
!
info
.
paymentMethod
)
{
value
=
"-"
;
}
}
if
(
value
)
{
if
(
timeChnageList
.
indexOf
(
key
)
!=
-
1
)
value
=
moment
(
value
).
format
(
"YYYY-MM-DD"
);
else
if
(
key
==
"memberCategory"
)
value
=
changeEnumValue
(
MEMBERTYPE
,
value
);
else
if
(
key
==
"orderCycle"
)
value
=
`
${
moment
(
info
.
orderCycleStart
).
format
(
"YYYY-MM-DD"
)}
至
${
moment
(
info
.
orderCycleEnd
).
format
(
"YYYY-MM-DD"
)}
`
;
else
if
(
key
==
"memberLevel"
)
value
=
changeEnumValue
(
MEMBERLEVEL
,
value
);
}
subList
.
push
(
value
);
}
dataList
.
push
(
subList
);
}
return
{
dataList
};
}
/**
* 发票管理-待开发票-审批历史 todo
* @param param0
* @returns
*/
export
async
function
billStateHistory
({
id
})
{
let
dbList
=
await
find
(
TABLEENUM
.
订单审批历史表
,
{
orderId
:
id
});
let
dataList
=
[];
dbList
.
forEach
(
info
=>
{
let
item
:
any
=
extractData
(
info
,
[
"operationTime"
,
"operationBehavior"
,
"remarks"
,
"refundImgUrl"
]);
item
.
operationTime
=
moment
(
item
.
operationTime
).
format
(
"YYYY-MM-DD HH:mm:SS"
);
item
.
operationBehavior
=
changeEnumValue
(
ORDEREXAMINE
,
item
.
operationBehavior
);
dataList
.
push
(
item
);
});
return
{
dataList
};
}
/**
* 批量开票确认
* @param param0
*/
export
async
function
billStateBatchAdopt
({
idList
})
{
//限制长度
if
(
idList
.
length
>=
10
)
throw
new
BizError
(
ERRORENUM
.
批量操作超过个数限制
);
let
thisDate
=
new
Date
();
const
NowMs
=
thisDate
.
valueOf
();
for
(
let
i
=
0
;
i
<
idList
.
length
;
i
++
)
{
let
id
=
idList
[
i
];
if
(
!
id
)
continue
;
//空id跳过
let
orderInfo
=
await
findOnce
(
TABLEENUM
.
订单表
,
{
id
});
if
(
!
orderInfo
||
!
orderInfo
.
id
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
if
(
orderInfo
.
invoiceStatus
!=
INVOICESTATUS
.
未开发票
&&
orderInfo
.
invoiceStatus
!=
INVOICESTATUS
.
已开发票
)
throw
new
BizError
(
ERRORENUM
.
订单状态无法开具发票
,
`
${
orderInfo
.
id
}
无法开具发票,因为发票状态为
${
orderInfo
.
invoiceStatus
}
`
);
let
updateInfo
=
{
invoiceStatus
:
INVOICESTATUS
.
已开发票
,
// invoiceAdd:invoiceUrl
};
await
updateOneData
(
TABLEENUM
.
订单表
,
{
id
},
updateInfo
);
}
return
successResult
();
}
/**
* 发票管理-已开发票 success
* @param name 名称关键字:个人会员匹配真实姓名,单位会员匹配单位名称
* @param memberType 会员类别 unitMemberType、individualMemberType 多选
...
...
@@ -503,6 +696,86 @@ export async function invoicedList({name, memberType, documentId, phone, mail, j
/**
* 发票管理-已开发票-数据导出
* @param param0
*/
export
async
function
outPutInvoiced
({
exportColumns
})
{
let
findParam
:
any
=
{
invoiceStatus
:
INVOICESTATUS
.
已开发票
};
let
selectTitle
=
[];
let
selectConf
=
[];
exportColumns
.
forEach
(
info
=>
{
selectTitle
.
push
(
info
.
key
);
selectConf
.
push
(
info
.
value
);
})
let
selectFile
=
[
"id"
,
"unitName"
,
"userId"
,
"orderCycleStart"
,
"orderCycleEnd"
,
"money"
,
"paymentMethod"
,
"memberCategory"
,
"paymentNum"
,
"desc"
,
"invoiceMail"
];
let
dbList
=
await
find
(
TABLEENUM
.
订单表
,
findParam
,
selectFile
);
let
timeChnageList
=
[
"orderCycleStart"
,
"operationTime"
];
let
dataList
=
[
selectTitle
];
for
(
let
i
=
0
;
i
<
dbList
.
length
;
i
++
)
{
let
info
=
dbList
[
i
];
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
:
info
.
userId
},
[
"memberState"
,
"name"
,
"unitName"
,
"documentId"
,
"uscc"
,
"mail"
,
"unitMail"
]);
let
subList
=
[];
for
(
let
i
=
0
;
i
<
selectConf
.
length
;
i
++
)
{
let
key
=
selectConf
[
i
];
let
value
=
info
[
key
]
||
""
;
if
(
key
==
"name"
)
{
if
(
info
.
memberCategory
==
MEMBERTYPE
.
个人会员
)
value
=
userInfo
.
name
;
else
if
(
info
.
memberCategory
==
MEMBERTYPE
.
单位会员
)
value
=
userInfo
.
unitName
;
}
if
(
key
==
"card"
)
{
if
(
info
.
memberCategory
==
MEMBERTYPE
.
个人会员
)
value
=
userInfo
.
documentId
;
else
if
(
info
.
memberCategory
==
MEMBERTYPE
.
单位会员
)
value
=
userInfo
.
uscc
;
}
if
(
key
==
"mail"
)
{
if
(
info
.
memberCategory
==
MEMBERTYPE
.
个人会员
)
value
=
userInfo
.
mail
;
else
if
(
info
.
memberCategory
==
MEMBERTYPE
.
单位会员
)
value
=
userInfo
.
unitMail
;
}
if
(
key
==
"paymentMethod"
||
key
==
"paymentNum"
)
{
if
(
!
info
.
paymentMethod
)
{
value
=
"-"
;
}
}
if
(
value
)
{
if
(
timeChnageList
.
indexOf
(
key
)
!=
-
1
)
value
=
moment
(
value
).
format
(
"YYYY-MM-DD"
);
else
if
(
key
==
"memberCategory"
)
value
=
changeEnumValue
(
MEMBERTYPE
,
value
);
else
if
(
key
==
"orderCycle"
)
value
=
`
${
moment
(
info
.
orderCycleStart
).
format
(
"YYYY-MM-DD"
)}
至
${
moment
(
info
.
orderCycleEnd
).
format
(
"YYYY-MM-DD"
)}
`
;
else
if
(
key
==
"memberLevel"
)
value
=
changeEnumValue
(
MEMBERLEVEL
,
value
);
}
subList
.
push
(
value
);
}
dataList
.
push
(
subList
);
}
return
{
dataList
};
}
/**
* 发票管理-已开发票-审批历史 todo
* @param param0
* @returns
*/
export
async
function
invoicedHistory
({
id
})
{
let
dbList
=
await
find
(
TABLEENUM
.
订单审批历史表
,
{
orderId
:
id
});
let
dataList
=
[];
dbList
.
forEach
(
info
=>
{
let
item
:
any
=
extractData
(
info
,
[
"operationTime"
,
"operationBehavior"
,
"remarks"
,
"refundImgUrl"
]);
item
.
operationTime
=
moment
(
item
.
operationTime
).
format
(
"YYYY-MM-DD HH:mm:SS"
);
item
.
operationBehavior
=
changeEnumValue
(
ORDEREXAMINE
,
item
.
operationBehavior
);
dataList
.
push
(
item
);
});
return
{
dataList
};
}
/**
* 转账截图、转账单号弹窗
* @param id 订单id
* @returns
...
...
src/config/outPutConfig.ts
View file @
f8cff672
...
...
@@ -68,4 +68,67 @@ export enum AUDITINGCOLUMNS {
}
/**
* 费用核对导出列-发票管理
*/
export
enum
CONFIRMRECEIPTCOLUMNS
{
"单位/个人名称"
=
"name"
,
会员类别
=
"memberCategory"
,
所缴周期
=
"orderCycle"
,
缴费金额
=
"money"
,
支付订单
=
"paymentNum"
,
支付方式
=
"paymentMethod"
,
"单位代码/个人身份证"
=
"card"
,
备注
=
"desc"
,
发票邮箱
=
"invoiceMail"
,
"单位/个人邮箱"
=
"mail"
,
提交时间
=
"operationTime"
,
//上传转账凭证的时间
}
/**
* 待开发票导出列-发票管理
*/
export
enum
BILLSTATECOLUMNS
{
"单位/个人名称"
=
"name"
,
会员类别
=
"memberCategory"
,
所缴周期
=
"orderCycle"
,
缴费金额
=
"money"
,
支付订单
=
"paymentNum"
,
支付方式
=
"paymentMethod"
,
"单位代码/个人身份证"
=
"card"
,
备注
=
"desc"
,
发票邮箱
=
"invoiceMail"
,
"单位/个人邮箱"
=
"mail"
,
审核时间
=
""
,
//什么时候从费用核对通过审核时间
提交时间
=
"operationTime"
,
//上传转账凭证的时间
支付时间
=
""
//微信支付的时间
}
/**
* 已开发票导出列-发票管理
*/
export
enum
INVOICEDCOLUMNS
{
"单位/个人名称"
=
"name"
,
会员类别
=
"memberCategory"
,
所缴周期
=
"orderCycle"
,
缴费金额
=
"money"
,
支付订单
=
"paymentNum"
,
支付方式
=
"paymentMethod"
,
"单位代码/个人身份证"
=
"card"
,
备注
=
"desc"
,
发票邮箱
=
"invoiceMail"
,
"单位/个人邮箱"
=
"mail"
,
审核时间
=
""
,
//什么时候从费用核对通过审核时间
提交时间
=
"operationTime"
,
//上传转账凭证的时间
支付时间
=
""
//微信支付的时间
}
src/routers/order/router.ts
View file @
f8cff672
...
...
@@ -91,6 +91,22 @@ export const Config = {
bindBiz
:
orderBiz
.
confirmReceiptOut
},
{
apiName
:
"财务核对-数据导出"
,
subUrl
:
'/order/invoice/examine/outputconfirmreceipt'
,
param
:[
{
key
:
"exportColumns"
,
type
:
"[]"
,
desc
:
"导出数据列"
}
],
bindBiz
:
orderBiz
.
outPutConfirmReceipt
},
{
apiName
:
"财务核对-审批历史"
,
subUrl
:
'/order/invoice/examine/confirmreceipthistory'
,
param
:[
{
key
:
"id"
,
type
:
"String"
,
desc
:
"订单id"
},
],
bindBiz
:
orderBiz
.
confirmReceiptHistory
},
{
apiName
:
"待开发票-上传发票 已开发票-修改发票"
,
subUrl
:
'/order/invoice/examine/upinvoice'
,
param
:[
...
...
@@ -108,6 +124,30 @@ export const Config = {
// bindBiz:orderBiz.backInvoice
// },
{
apiName
:
"待开发票-数据导出"
,
subUrl
:
'/order/invoice/examine/outputbillstate'
,
param
:[
{
key
:
"exportColumns"
,
type
:
"[]"
,
desc
:
"导出数据列"
}
],
bindBiz
:
orderBiz
.
outPutBillState
},
{
apiName
:
"待开发票-审批历史"
,
subUrl
:
'/order/invoice/examine/billstatehistory'
,
param
:[
{
key
:
"id"
,
type
:
"String"
,
desc
:
"订单id"
},
],
bindBiz
:
orderBiz
.
billStateHistory
},
{
apiName
:
"待开发票-批量开票确认"
,
subUrl
:
'/order/invoice/examine/billstatebatchadopt'
,
param
:[
{
key
:
"idList"
,
type
:
"[String]"
,
desc
:
"批量通过的用户列表"
},
],
bindBiz
:
orderBiz
.
billStateBatchAdopt
},
{
apiName
:
"发票管理-已开发票"
,
subUrl
:
'/order/invoice/examine/invoicedlist'
,
param
:[
...
...
@@ -126,6 +166,22 @@ export const Config = {
bindBiz
:
orderBiz
.
invoicedList
},
{
apiName
:
"已开发票-数据导出"
,
subUrl
:
'/order/invoice/examine/outputinvoiced'
,
param
:[
{
key
:
"exportColumns"
,
type
:
"[]"
,
desc
:
"导出数据列"
}
],
bindBiz
:
orderBiz
.
outPutInvoiced
},
{
apiName
:
"已开发票-审批历史"
,
subUrl
:
'/order/invoice/examine/invoicedhistory'
,
param
:[
{
key
:
"id"
,
type
:
"String"
,
desc
:
"订单id"
},
],
bindBiz
:
orderBiz
.
invoicedHistory
},
{
apiName
:
"转账单号弹窗"
,
subUrl
:
'/order/transferscreenshot'
,
param
:[
...
...
src/routers/public/router.ts
View file @
f8cff672
...
...
@@ -315,6 +315,27 @@ export const Config = {
param
:[],
defaultParam
:
enumConfig
.
MEMBERLEVELCHANGE
,
bindBiz
:
publicBiz
.
setEnumInterface
},
{
apiName
:
"发票管理-费用核对导出列"
,
subUrl
:
'/confirmreceiptcolumns'
,
param
:[],
defaultParam
:
outPutConfig
.
CONFIRMRECEIPTCOLUMNS
,
bindBiz
:
publicBiz
.
setEnumInterface
},
{
apiName
:
"发票管理-待开发票导出列"
,
subUrl
:
'/billstatecolumns'
,
param
:[],
defaultParam
:
outPutConfig
.
BILLSTATECOLUMNS
,
bindBiz
:
publicBiz
.
setEnumInterface
},
{
apiName
:
"发票管理-已开发票导出列"
,
subUrl
:
'/invoicedcolumns'
,
param
:[],
defaultParam
:
outPutConfig
.
INVOICEDCOLUMNS
,
bindBiz
:
publicBiz
.
setEnumInterface
}
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment