From c4234b9a57073d2837e4f94cd058cb2dacbf2429 Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Fri, 7 Jul 2023 19:56:04 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E8=AE=A2=E5=8D=95=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=96=B0=E5=A2=9E=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/order/list/list.js | 90 +++-------------------------------- src/pages/order/list/utils.js | 60 +++++++++++++++++++---- 2 files changed, 57 insertions(+), 93 deletions(-) diff --git a/src/pages/order/list/list.js b/src/pages/order/list/list.js index a3069627..1ee481be 100644 --- a/src/pages/order/list/list.js +++ b/src/pages/order/list/list.js @@ -123,7 +123,7 @@ export default class orderList extends React.Component { //导出订单 exportFn() { let _self = this - let { key_word, status, option, orderType, pay_status, voucher_status } = _self.state + let { status, orderType, option, key_word, pay_status, voucher_status } = _self.state let data = {} if (orderType && status) { //区分立减金和商品 @@ -144,33 +144,7 @@ export default class orderList extends React.Component { if (voucher_status?.length) { data.voucher_status = voucher_status?.join(",") } - - if (option && option.key == 1) { - if (key_word) { - data.key = key_word - } - } - - if (option && option.key == 2) { - if (key_word) { - data.key_word = key_word - } - } - if (option && option.key == 3) { - if (key_word) { - data.key_batch_id = key_word - } - } - if (option && option.key == 4) { - if (key_word) { - data.code_batch_id = key_word - } - } - if (option && option.key == 5) { - if (key_word) { - data.channel_activity_id = key_word - } - } + option && (data[option.key] = key_word) if (this.state.selectiondata && this.state.selectiondata.length > 0) { let orders = this.state.selectiondata let orderNum = orders.map((item) => item.order_number) @@ -370,7 +344,7 @@ export default class orderList extends React.Component { //!获取订单列表 getOrderFn(time = {}) { let _self = this - let { page, limit, option, key_word, status, orderType, pay_status, voucher_status } = + let { page, limit, status, option, key_word, orderType, pay_status, voucher_status } = _self.state let data = { page, limit } if (orderType) { @@ -390,32 +364,7 @@ export default class orderList extends React.Component { delete data.begin_time delete data.end_time } - if (option && option.key == 1) { - if (key_word) { - data.key = key_word - } - } - if (option && option.key == 2) { - if (key_word) { - data.key_word = key_word - } - } - if (option && option.key == 3) { - if (key_word) { - data.key_batch_id = key_word - } - } - if (option && option.key == 4) { - if (key_word) { - data.code_batch_id = key_word - } - } - if (option && option.key == 5) { - if (key_word) { - data.channel_activity_id = key_word - } - } - + option && (data[option.key] = key_word) if (status?.length) { data.status = status?.join(",") } @@ -443,33 +392,6 @@ export default class orderList extends React.Component { .catch((err) => {}) } - optiononChange(e) { - let placeholder - let searchOption = Number(e ? e.key : 0) - switch (searchOption) { - case 1: - placeholder = "请输入key搜索" - break - case 2: - placeholder = "请输入关键字查询" - break - case 3: - placeholder = "请输入key批次搜索" - break - case 4: - placeholder = "请输入兑换码批次ID搜索" - break - case 5: - placeholder = "请输入平台批次号" - break - default: - placeholder = "请输入key搜索" - break - } - this.setState({ option: e, key_word: "", placeholder }) - return - } - componentWillMount() { let datetime = [tomonth + " " + "00:00:00", day + " " + "23:59:59"] this.setState({ combinedValue: datetime }) @@ -612,7 +534,9 @@ export default class orderList extends React.Component {