feat: 订单列表新增查询条件

This commit is contained in:
wangsongsole 2023-07-07 19:56:04 +08:00
parent bf2f870aa4
commit c4234b9a57
2 changed files with 57 additions and 93 deletions

View File

@ -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 {
<Select
width="180px"
value={this.state.option}
onChange={(e) => this.optiononChange(e)}
onChange={(e) =>
this.setState({ option: e, key_word: "", placeholder: e.placeholder })
}
disableSearch
options={options}
clearable

View File

@ -158,24 +158,64 @@ export const Column = [
export const options = [
{
key: "1",
text: "key查询"
key: "order_number",
text: "订单号",
placeholder: "请输入订单号查询"
},
{
key: "2",
text: "通用查询"
key: "key",
text: "key查询",
placeholder: "请输入key查询"
},
{
key: "3",
text: "key批次"
key: "product_name",
text: "商品名称",
placeholder: "请输入商品名称查询"
},
{
key: "4",
text: "兑换码批次ID"
key: "key_batch_id",
text: "key批次",
placeholder: "请输入key批次查询"
},
{
key: "5",
text: "平台批次号"
key: "account",
text: "充值账号",
placeholder: "请输入充值账号查询"
},
{
key: "plan_title",
text: "计划标题",
placeholder: "请输入计划标题查询"
},
{
key: "reseller_name",
text: "分销商名称",
placeholder: "请输入分销商名称查询"
},
{
key: "cash_activity_id ",
text: "红包批次号",
placeholder: "请输入红包批次号查询"
},
{
key: "code_batch_id",
text: "兑换码批次ID",
placeholder: "请输入兑换码批次ID查询"
},
{
key: "channel_activity_id ",
text: "立减金批次号",
placeholder: "请输入立减金批次号查询"
},
{
key: "receive_user_id",
text: "红包订单用户openId",
placeholder: "请输入红包订单用户openId查询"
},
{
key: "channel_user_id",
text: "立减金订单用户openId",
placeholder: "请输入立减金订单用户openId查询"
}
]