diff --git a/src/assets/enum.js b/src/assets/enum.js index 37faec91..47078292 100644 --- a/src/assets/enum.js +++ b/src/assets/enum.js @@ -1,141 +1,210 @@ -const menu={ +const menu = { //兑换码状态 exchangeStatus(params) { - switch(params){ - case 0:return '未开始';break; - case 1:return '进行中';break; - case -1:return '暂停';break; - case 2:return '已结束';break; - case 5:return '已作废';break; + switch (params) { + case 0: + return "未开始" + case 1: + return "进行中" + case -1: + return "暂停" + case 2: + return "已结束" + case 5: + return "已作废" } }, - exchangeStatusBg(params) { - switch(params){ - case 0:return '#BFBFBF';break; - case 1:return '#3575C7';break; - case -1:return '#F6C041';break; - case 2:return '#43A65D';break; - case 5:return '#DC4F40';break; + exchangeStatusBg(params) { + switch (params) { + case 0: + return "#BFBFBF" + case 1: + return "#3575C7" + case -1: + return "#F6C041" + case 2: + return "#43A65D" + case 5: + return "#DC4F40" } }, //订单状态 - orderStatus(params) { - switch(params){ - case 0:return '待支付';break; - case 1:return '充值中';break; - case 2:return '已完成';break; - case 3:return '充值失败';break; - } - }, - orderStatusBg(params) { - switch(params){ - case 0:return '#BFBFBF';break; - case 1:return '#3575C7';break; - case 2:return '#43A65D';break; - case 3:return '#DC4F40';break; - } - }, - //计划任务状态 - planStatus(params) { - switch(params){ - case 0:return '创建中';break; - case 2:return '审核中';break; - case 3:return '待生效';break; - case 4:return '进行中';break; - case 5:return '暂停中';break; - case 6:return '已完结';break; - case 7:return '未通过';break; - } - }, - planStatusBg(params) { - switch(params){ - case 0:return '#BFBFBF';break; - case 2:return '#ffaa00';break; - case 3:return '#3575C7';break; - case 4:return '#55ff7f';break; - case 5:return '#55aaff';break; - case 6:return '#e64c00';break; - case 7:return '#b6bcb8';break; - } - }, - //计划任务状态 - keyStatus(params) { - switch(params){ - case 1:return '待使用';break; - case 2:return '已使用';break; - case 3:return '已失效';break; - case 4:return '已作废';break; - case 5:return '使用锁定中';break; - } - }, - keyStatusBg(params) { - switch(params){ - case 1:return '#BFBFBF';break; - case 2:return '#43A65D';break; - case 3:return '#ffaa00';break; - case 4:return '#e64c00';break; - case 5:return '#3575C7'; break; - } - }, - - - //落地页 - pageStatus(params) { - switch(params){ - case 1:return 'H5';break; - case 2:return '微信';break; - case 4:return '支付宝';break; - } - }, - pageStatusBg(params) { - switch(params){ - case 1:return '#ffaa00';break; - case 2:return '#55ff7f';break; - case 4:return '#55aaff';break; - } - }, - //落地页 - pageTypeStatus(params) { - switch(params){ - case 3:return '兑换码';break; - case 1:return '白名单';break; - case 2:return '立减金';break; - case 4:return '优惠券';break; - case 8:return '优惠券白名单';break; - } - }, - pageTypeStatusBg(params) { - switch(params){ - case 1:return '#ffaa00';break; - case 2:return '#e64c00';break; - case 3:return '#55aaff';break; - case 4:return '#79AF83';break; - case 8:return '#F2A505';break; - } - }, - keysStatus(params) { - switch(params){ - case 1:return '创建中';break; - case 2:return '审核中';break; - case 4:return '进行中';break; - case 5:return '已暂停';break; - case 6:return '已完结';break; - case 7:return '已作废';break; - case 8:return '审批驳回';break; - } - }, - keysStatusBg(params) { - switch(params){ - case 1:return '#ffaa00';break; - case 2:return '#55ff7f';break; - case 5:return '#e64c00';break; - case 4:return '#55aaff';break; - case 6:return '#555500';break; - case 7:return '#3575C7';break; - case 8:return '#e64c00';break; - } - } - - + orderStatus(params) { + switch (params) { + case 0: + return "待支付" + case 1: + return "充值中" + case 2: + return "已完成" + case 3: + return "充值失败" + } + }, + orderStatusBg(params) { + switch (params) { + case 0: + return "#BFBFBF" + case 1: + return "#3575C7" + case 2: + return "#43A65D" + case 3: + return "#DC4F40" + } + }, + //计划任务状态 + planStatus(params) { + switch (params) { + case 0: + return "创建中" + case 2: + return "审核中" + case 3: + return "待生效" + case 4: + return "进行中" + case 5: + return "暂停中" + case 6: + return "已完结" + case 7: + return "未通过" + } + }, + planStatusBg(params) { + switch (params) { + case 0: + return "#BFBFBF" + case 2: + return "#ffaa00" + case 3: + return "#3575C7" + case 4: + return "#55ff7f" + case 5: + return "#55aaff" + case 6: + return "#e64c00" + case 7: + return "#b6bcb8" + } + }, + //计划任务状态 + keyStatus(params) { + switch (params) { + case 1: + return "待使用" + case 2: + return "已使用" + case 3: + return "已失效" + case 4: + return "已作废" + case 5: + return "使用锁定中" + } + }, + keyStatusBg(params) { + switch (params) { + case 1: + return "#BFBFBF" + case 2: + return "#43A65D" + case 3: + return "#ffaa00" + case 4: + return "#e64c00" + case 5: + return "#3575C7" + } + }, + + //落地页 + pageStatus(params) { + switch (params) { + case 1: + return "H5" + case 2: + return "微信" + case 4: + return "支付宝" + } + }, + pageStatusBg(params) { + switch (params) { + case 1: + return "#ffaa00" + case 2: + return "#55ff7f" + case 4: + return "#55aaff" + } + }, + //落地页 + pageTypeStatus(params) { + switch (params) { + case 3: + return "兑换码" + case 1: + return "白名单" + case 2: + return "立减金" + case 4: + return "优惠券" + case 8: + return "优惠券白名单" + } + }, + pageTypeStatusBg(params) { + switch (params) { + case 1: + return "#ffaa00" + case 2: + return "#e64c00" + case 3: + return "#55aaff" + case 4: + return "#79AF83" + case 8: + return "#F2A505" + } + }, + keysStatus(params) { + switch (params) { + case 1: + return "创建中" + case 2: + return "审核中" + case 4: + return "进行中" + case 5: + return "已暂停" + case 6: + return "已完结" + case 7: + return "已作废" + case 8: + return "审批驳回" + } + }, + keysStatusBg(params) { + switch (params) { + case 1: + return "#ffaa00" + case 2: + return "#55ff7f" + case 5: + return "#e64c00" + case 4: + return "#55aaff" + case 6: + return "#555500" + case 7: + return "#3575C7" + case 8: + return "#e64c00" + } + } } -export default menu; \ No newline at end of file +export default menu diff --git a/src/pages/order/list/list.js b/src/pages/order/list/list.js index 4806a73e..cf48ed73 100644 --- a/src/pages/order/list/list.js +++ b/src/pages/order/list/list.js @@ -112,13 +112,19 @@ const Column = [ width: "50px" }, { - title: "状态", + title: "订单状态", name: "statusDom", prop: "statusDom", type: "slot", width: "80px" }, - + { + title: "支付状态", + name: "pay_status", + prop: "pay_status", + type: "slot", + width: "80px" + }, { title: "平台批次号", name: "channel_activity_id", @@ -197,19 +203,32 @@ export default class orderlist extends React.Component { { id: 4, name: "直充-已取消" }, { id: 111, name: "立减金-待领取" }, { id: 222, name: "立减金-已领取" }, - { id: 5, name: "立减金-已过期" }, - { id: 6, name: "优惠券-待支付" } + { id: 5, name: "立减金-已过期" } + ] + }, + { + id: 1, + label: "支付状态", + prop: "pay_status", + menuList: [ + { id: 1, name: "待支付" }, + { id: 2, name: "已支付" }, + { id: 3, name: "已退款" } ] } ], selectiondata: [], - menuList: [{ id: 0, name: "订单状态", check: false }], + menuList: [ + { id: 0, name: "订单状态", check: false }, + { id: 1, name: "支付状态", check: false } + ], allcheck: false, itemcheck: false, combinedValue: [], tableHeight: 500, status: null, + pay_status: null, page: 1, limit: 10, key_word: "", @@ -280,9 +299,9 @@ export default class orderlist extends React.Component { //导出订单 exportFn() { let _self = this - let { key_word, key, status, option, orderType } = _self.state + let { key_word, status, option, orderType } = _self.state let data = {} - if (orderType) { + if (orderType && status) { //区分立减金和商品 data.type = orderType } @@ -516,7 +535,8 @@ export default class orderlist extends React.Component { //获取订单列表 getOrderFn(time = {}) { 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 } if (orderType) { //区分立减金和商品 @@ -526,9 +546,29 @@ export default class orderlist extends React.Component { data.begin_time = this.state.combinedValue[0] data.end_time = this.state.combinedValue[1] } + if (status || status === 0) { 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]) { data.begin_time = time[0] data.end_time = time[1] @@ -562,7 +602,6 @@ export default class orderlist extends React.Component { data.channel_activity_id = key_word } } - getOrderList(data) .then((res) => { handelResponse( @@ -647,6 +686,9 @@ export default class orderlist extends React.Component { if (prevState.status != this.state.status) { this.getOrderFn() } + if (prevState.pay_status != this.state.pay_status) { + this.getOrderFn() + } } //过滤表格枚举状态 render() { @@ -663,7 +705,6 @@ export default class orderlist extends React.Component { /> ) - const { current, pageSize } = this.state return (
+ + + {rowData.pay_status_text} + +
+ ) + } if (com === "type_text") { return {rowData.type === 1 ? "直充" : "立减金"} }