From c69a2a5b7fed3bbf2349516f41e40d54407e6ee3 Mon Sep 17 00:00:00 2001 From: Apple <> Date: Tue, 27 Dec 2022 14:40:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=AB=8B=E5=87=8F=E9=87=91=E6=A0=B8=E9=94=80?= =?UTF-8?q?=E7=8A=B6=E6=80=81voucher=5Fstatus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/enum.js | 2 ++ src/pages/order/list/list.js | 43 ++++++++++++++++++++++++++--------- src/pages/order/list/utils.js | 11 +++++++++ 3 files changed, 45 insertions(+), 11 deletions(-) diff --git a/src/assets/enum.js b/src/assets/enum.js index 47078292..4521dcb0 100644 --- a/src/assets/enum.js +++ b/src/assets/enum.js @@ -51,6 +51,8 @@ const menu = { return "#43A65D" case 3: return "#DC4F40" + case 333: + return "transparent" } }, //计划任务状态 diff --git a/src/pages/order/list/list.js b/src/pages/order/list/list.js index 3c0f53e1..fb2635fe 100644 --- a/src/pages/order/list/list.js +++ b/src/pages/order/list/list.js @@ -44,7 +44,8 @@ export default class orderlist extends React.Component { selectiondata: [], menuList: [ { id: 0, name: "订单状态", check: false }, - { id: 1, name: "支付状态", check: false } + { id: 1, name: "支付状态", check: false }, + { id: 3, name: "核销状态", check: false } ], allcheck: false, itemcheck: false, @@ -52,6 +53,7 @@ export default class orderlist extends React.Component { tableHeight: 500, status: null, pay_status: null, + voucher_status:null, page: 1, limit: 10, key_word: "", @@ -168,7 +170,7 @@ export default class orderlist extends React.Component { //导出订单 exportFn() { let _self = this; - let { key_word, status, option, orderType, pay_status } = _self.state; + let { key_word, status, option, orderType, pay_status,voucher_status } = _self.state; let data = {}; if (orderType && status) { //区分立减金和商品 @@ -186,6 +188,9 @@ export default class orderlist extends React.Component { if (pay_status?.length) { data.pay_status = pay_status?.join(","); } + if (voucher_status?.length) { + data.voucher_status = voucher_status?.join(","); + } if (option && option.key == 1) { if (key_word) { @@ -259,11 +264,11 @@ export default class orderlist extends React.Component { var year = now.getFullYear(); var month = now.getMonth() + 1 <= 9 ? "0" + (now.getMonth() + 1) : now.getMonth() + 1; - var day = now.getDate() <= 9 ? "0" + now.getDate() : now.getDate(); - var tt = now.getHours() <= 9 ? "0" + now.getHours() : now.getHours(); - var mm = now.getMinutes() <= 9 ? "0" + now.getMinutes() : now.getMinutes(); - var ss = now.getSeconds() <= 9 ? "0" + now.getSeconds() : now.getSeconds(); - let datelist = [year, month, day, tt, mm, ss]; + var day = now.getDate() <= 9 ? "0" + now.getDate() : now.getDate(); + var tt = now.getHours() <= 9 ? "0" + now.getHours() : now.getHours(); + var mm = now.getMinutes() <= 9 ? "0" + now.getMinutes() : now.getMinutes(); + var ss = now.getSeconds() <= 9 ? "0" + now.getSeconds() : now.getSeconds(); + let datelist = [year, month, day, tt, mm, ss]; return datelist.join(""); } componentWillMount() { @@ -409,7 +414,7 @@ export default class orderlist extends React.Component { //获取订单列表 getOrderFn(time = {}) { let _self = this; - let { page, limit, option, key_word, status, orderType, pay_status } = + let { page, limit, option, key_word, status, orderType, pay_status,voucher_status } = _self.state; let data = { page, limit }; if (orderType) { @@ -462,7 +467,9 @@ export default class orderlist extends React.Component { if (pay_status?.length) { data.pay_status = pay_status?.join(","); } - + if (voucher_status?.length) { + data.voucher_status = voucher_status?.join(","); + } getOrderList(data) .then((res) => { handelResponse( @@ -579,7 +586,11 @@ export default class orderlist extends React.Component { if (prevState.pay_status != this.state.pay_status) { this.getOrderFn(); } + if (prevState.voucher_status != this.state.voucher_status) { + this.getOrderFn(); + } } + //过滤表格枚举状态 render() { const date = ( @@ -753,9 +764,19 @@ export default class orderlist extends React.Component { if (com == "usage_status") { return ( - + +

+ + {this.usageFunction(rowData.orderVoucher?.status)} - + +

); } diff --git a/src/pages/order/list/utils.js b/src/pages/order/list/utils.js index 28ccd1cc..3278374d 100644 --- a/src/pages/order/list/utils.js +++ b/src/pages/order/list/utils.js @@ -203,6 +203,17 @@ export const filterList = [ { id: 2, name: "已支付" }, { id: 3, name: "已退款" } ] + }, + { + id: 3, + label: "核销状态", + prop: "voucher_status", + menuList: [ + { id: 1, name: "未核销" }, + { id: 2, name: "已核销" }, + { id: 3, name: "已过期" }, + { id: 4, name: "已退款" } + ] } ];