This commit is contained in:
zhangds 2022-09-29 15:18:37 +08:00
commit b20726b53d
2 changed files with 271 additions and 143 deletions

View File

@ -2,140 +2,209 @@ const menu={
//兑换码状态 //兑换码状态
exchangeStatus(params) { exchangeStatus(params) {
switch (params) { switch (params) {
case 0:return '未开始';break; case 0:
case 1:return '进行中';break; return "未开始"
case -1:return '暂停';break; case 1:
case 2:return '已结束';break; return "进行中"
case 5:return '已作废';break; case -1:
return "暂停"
case 2:
return "已结束"
case 5:
return "已作废"
} }
}, },
exchangeStatusBg(params) { exchangeStatusBg(params) {
switch (params) { switch (params) {
case 0:return '#BFBFBF';break; case 0:
case 1:return '#3575C7';break; return "#BFBFBF"
case -1:return '#F6C041';break; case 1:
case 2:return '#43A65D';break; return "#3575C7"
case 5:return '#DC4F40';break; case -1:
return "#F6C041"
case 2:
return "#43A65D"
case 5:
return "#DC4F40"
} }
}, },
//订单状态 //订单状态
orderStatus(params) { orderStatus(params) {
switch (params) { switch (params) {
case 0:return '待支付';break; case 0:
case 1:return '充值中';break; return "待支付"
case 2:return '已完成';break; case 1:
case 3:return '充值失败';break; return "充值中"
case 2:
return "已完成"
case 3:
return "充值失败"
} }
}, },
orderStatusBg(params) { orderStatusBg(params) {
switch (params) { switch (params) {
case 0:return '#BFBFBF';break; case 0:
case 1:return '#3575C7';break; return "#BFBFBF"
case 2:return '#43A65D';break; case 1:
case 3:return '#DC4F40';break; return "#3575C7"
case 2:
return "#43A65D"
case 3:
return "#DC4F40"
} }
}, },
//计划任务状态 //计划任务状态
planStatus(params) { planStatus(params) {
switch (params) { switch (params) {
case 0:return '创建中';break; case 0:
case 2:return '审核中';break; return "创建中"
case 3:return '待生效';break; case 2:
case 4:return '进行中';break; return "审核中"
case 5:return '暂停中';break; case 3:
case 6:return '已完结';break; return "待生效"
case 7:return '未通过';break; case 4:
return "进行中"
case 5:
return "暂停中"
case 6:
return "已完结"
case 7:
return "未通过"
} }
}, },
planStatusBg(params) { planStatusBg(params) {
switch (params) { switch (params) {
case 0:return '#BFBFBF';break; case 0:
case 2:return '#ffaa00';break; return "#BFBFBF"
case 3:return '#3575C7';break; case 2:
case 4:return '#55ff7f';break; return "#ffaa00"
case 5:return '#55aaff';break; case 3:
case 6:return '#e64c00';break; return "#3575C7"
case 7:return '#b6bcb8';break; case 4:
return "#55ff7f"
case 5:
return "#55aaff"
case 6:
return "#e64c00"
case 7:
return "#b6bcb8"
} }
}, },
//计划任务状态 //计划任务状态
keyStatus(params) { keyStatus(params) {
switch (params) { switch (params) {
case 1:return '待使用';break; case 1:
case 2:return '已使用';break; return "待使用"
case 3:return '已失效';break; case 2:
case 4:return '已作废';break; return "已使用"
case 5:return '使用锁定中';break; case 3:
return "已失效"
case 4:
return "已作废"
case 5:
return "使用锁定中"
} }
}, },
keyStatusBg(params) { keyStatusBg(params) {
switch (params) { switch (params) {
case 1:return '#BFBFBF';break; case 1:
case 2:return '#43A65D';break; return "#BFBFBF"
case 3:return '#ffaa00';break; case 2:
case 4:return '#e64c00';break; return "#43A65D"
case 5:return '#3575C7'; break; case 3:
return "#ffaa00"
case 4:
return "#e64c00"
case 5:
return "#3575C7"
} }
}, },
//落地页 //落地页
pageStatus(params) { pageStatus(params) {
switch (params) { switch (params) {
case 1:return 'H5';break; case 1:
case 2:return '微信';break; return "H5"
case 4:return '支付宝';break; case 2:
return "微信"
case 4:
return "支付宝"
} }
}, },
pageStatusBg(params) { pageStatusBg(params) {
switch (params) { switch (params) {
case 1:return '#ffaa00';break; case 1:
case 2:return '#55ff7f';break; return "#ffaa00"
case 4:return '#55aaff';break; case 2:
return "#55ff7f"
case 4:
return "#55aaff"
} }
}, },
//落地页 //落地页
pageTypeStatus(params) { pageTypeStatus(params) {
switch (params) { switch (params) {
case 3:return '兑换码';break; case 3:
case 1:return '白名单';break; return "兑换码"
case 2:return '立减金';break; case 1:
case 4:return '优惠券';break; return "白名单"
case 8:return '优惠券白名单';break; case 2:
return "立减金"
case 4:
return "优惠券"
case 8:
return "优惠券白名单"
} }
}, },
pageTypeStatusBg(params) { pageTypeStatusBg(params) {
switch (params) { switch (params) {
case 1:return '#ffaa00';break; case 1:
case 2:return '#e64c00';break; return "#ffaa00"
case 3:return '#55aaff';break; case 2:
case 4:return '#79AF83';break; return "#e64c00"
case 8:return '#F2A505';break; case 3:
return "#55aaff"
case 4:
return "#79AF83"
case 8:
return "#F2A505"
} }
}, },
keysStatus(params) { keysStatus(params) {
switch (params) { switch (params) {
case 1:return '创建中';break; case 1:
case 2:return '审核中';break; return "创建中"
case 4:return '进行中';break; case 2:
case 5:return '已暂停';break; return "审核中"
case 6:return '已完结';break; case 4:
case 7:return '已作废';break; return "进行中"
case 8:return '审批驳回';break; case 5:
return "已暂停"
case 6:
return "已完结"
case 7:
return "已作废"
case 8:
return "审批驳回"
} }
}, },
keysStatusBg(params) { keysStatusBg(params) {
switch (params) { switch (params) {
case 1:return '#ffaa00';break; case 1:
case 2:return '#55ff7f';break; return "#ffaa00"
case 5:return '#e64c00';break; case 2:
case 4:return '#55aaff';break; return "#55ff7f"
case 6:return '#555500';break; case 5:
case 7:return '#3575C7';break; return "#e64c00"
case 8:return '#e64c00';break; case 4:
return "#55aaff"
case 6:
return "#555500"
case 7:
return "#3575C7"
case 8:
return "#e64c00"
} }
} }
} }
export default menu; export default menu

View File

@ -112,13 +112,19 @@ const Column = [
width: "50px" width: "50px"
}, },
{ {
title: "状态", title: "订单状态",
name: "statusDom", name: "statusDom",
prop: "statusDom", prop: "statusDom",
type: "slot", type: "slot",
width: "80px" width: "80px"
}, },
{
title: "支付状态",
name: "pay_status",
prop: "pay_status",
type: "slot",
width: "80px"
},
{ {
title: "平台批次号", title: "平台批次号",
name: "channel_activity_id", name: "channel_activity_id",
@ -197,19 +203,32 @@ export default class orderlist extends React.Component {
{ id: 4, name: "直充-已取消" }, { id: 4, name: "直充-已取消" },
{ id: 111, name: "立减金-待领取" }, { id: 111, name: "立减金-待领取" },
{ id: 222, name: "立减金-已领取" }, { id: 222, name: "立减金-已领取" },
{ id: 5, name: "立减金-已过期" }, { id: 5, name: "立减金-已过期" }
{ id: 6, name: "优惠券-待支付" } ]
},
{
id: 1,
label: "支付状态",
prop: "pay_status",
menuList: [
{ id: 1, name: "待支付" },
{ id: 2, name: "已支付" },
{ id: 3, name: "已退款" }
] ]
} }
], ],
selectiondata: [], selectiondata: [],
menuList: [{ id: 0, name: "订单状态", check: false }], menuList: [
{ id: 0, name: "订单状态", check: false },
{ id: 1, name: "支付状态", check: false }
],
allcheck: false, allcheck: false,
itemcheck: false, itemcheck: false,
combinedValue: [], combinedValue: [],
tableHeight: 500, tableHeight: 500,
status: null, status: null,
pay_status: null,
page: 1, page: 1,
limit: 10, limit: 10,
key_word: "", key_word: "",
@ -280,9 +299,9 @@ export default class orderlist extends React.Component {
//导出订单 //导出订单
exportFn() { exportFn() {
let _self = this let _self = this
let { key_word, key, status, option, orderType } = _self.state let { key_word, status, option, orderType } = _self.state
let data = {} let data = {}
if (orderType) { if (orderType && status) {
//区分立减金和商品 //区分立减金和商品
data.type = orderType data.type = orderType
} }
@ -516,7 +535,8 @@ export default class orderlist extends React.Component {
//获取订单列表 //获取订单列表
getOrderFn(time = {}) { getOrderFn(time = {}) {
let _self = this let _self = this
let { page, limit, option, key_word, status, orderType } = _self.state let { page, limit, option, key_word, status, orderType, pay_status } =
_self.state
let data = { page, limit } let data = { page, limit }
if (orderType) { if (orderType) {
//区分立减金和商品 //区分立减金和商品
@ -526,9 +546,29 @@ export default class orderlist extends React.Component {
data.begin_time = this.state.combinedValue[0] data.begin_time = this.state.combinedValue[0]
data.end_time = this.state.combinedValue[1] data.end_time = this.state.combinedValue[1]
} }
if (status || status === 0) { if (status || status === 0) {
data.status = status data.status = status
} }
if (pay_status) {
data.pay_status = pay_status
}
if (status === 6) {
data.pay_status = 1
data.use_coupon = 1
}
if (status === 7) {
data.pay_status = 2
data.use_coupon = 1
}
if (status === 8) {
data.pay_status = 3
data.use_coupon = 1
}
if (time && time[0]) { if (time && time[0]) {
data.begin_time = time[0] data.begin_time = time[0]
data.end_time = time[1] data.end_time = time[1]
@ -562,7 +602,6 @@ export default class orderlist extends React.Component {
data.channel_activity_id = key_word data.channel_activity_id = key_word
} }
} }
getOrderList(data) getOrderList(data)
.then((res) => { .then((res) => {
handelResponse( handelResponse(
@ -647,6 +686,9 @@ export default class orderlist extends React.Component {
if (prevState.status != this.state.status) { if (prevState.status != this.state.status) {
this.getOrderFn() this.getOrderFn()
} }
if (prevState.pay_status != this.state.pay_status) {
this.getOrderFn()
}
} }
//过滤表格枚举状态 //过滤表格枚举状态
render() { render() {
@ -663,7 +705,6 @@ export default class orderlist extends React.Component {
/> />
) )
const { current, pageSize } = this.state
return ( return (
<div id='dislist' className='orderList'> <div id='dislist' className='orderList'>
<TabPage tabs={this.state.tabList} slot={date}> <TabPage tabs={this.state.tabList} slot={date}>
@ -781,6 +822,24 @@ export default class orderlist extends React.Component {
</p> </p>
) )
} }
if (com == "pay_status" && rowData.use_coupon === 1) {
return (
<p className='dflexa'>
<span>
<font
className='icon'
style={{
background: menu.orderStatusBg(
rowData.pay_status === 1
? ""
: parseInt(rowData.pay_status)
)
}}></font>
{rowData.pay_status_text}
</span>
</p>
)
}
if (com === "type_text") { if (com === "type_text") {
return <span>{rowData.type === 1 ? "直充" : "立减金"}</span> return <span>{rowData.type === 1 ? "直充" : "立减金"}</span>
} }