💪 optimize: 优化用户体验

This commit is contained in:
wangsongsole 2024-01-30 15:55:41 +08:00
parent 28f74d49ed
commit 6122efd02a
2 changed files with 78 additions and 58 deletions

View File

@ -25,7 +25,22 @@ import Ipt from "@/components/input/main"
import TabPage from "@/components/tabPage/main.js" import TabPage from "@/components/tabPage/main.js"
import { intersection } from "lodash-es" import { intersection } from "lodash-es"
import React from "react" import React from "react"
import { Alert, Button, CombinedDateRangePicker, Dialog, Notify, Select, Sweetalert } from "zent" import {
Alert,
Button,
CombinedDateRangePicker,
Dialog,
Notify,
Select,
Sweetalert,
Dropdown,
DropdownClickTrigger,
Icon,
DropdownContent,
Menu,
MenuItem,
DropdownPosition
} from "zent"
import "./list.less" import "./list.less"
import { Column, filterList, options, rules } from "./utils" import { Column, filterList, options, rules } from "./utils"
var moment = require("moment") var moment = require("moment")
@ -47,6 +62,7 @@ export default class orderList extends React.Component {
], ],
allcheck: false, allcheck: false,
itemcheck: false, itemcheck: false,
menuVisible: false,
combinedValue: [], combinedValue: [],
tableHeight: 500, tableHeight: 500,
status: null, status: null,
@ -598,20 +614,9 @@ export default class orderList extends React.Component {
) )
} }
/* 事件通知 */ menuItemClick(event, order_number) {
eventNotify(order_number, event) {
notifyReseller({ order_number, event }).then(({ code, message }) => {
Notify.clear()
if (code === 200) {
Notify.success(message)
} else {
Notify.error(message)
}
})
}
/* 核销查询 */ /* 核销查询 */
writeOffQuery(order_number) { if (event == 0) {
voucherUsageQuery({ order_number }).then(({ code, message }) => { voucherUsageQuery({ order_number }).then(({ code, message }) => {
Notify.clear() Notify.clear()
if (code === 200) { if (code === 200) {
@ -621,6 +626,17 @@ export default class orderList extends React.Component {
Notify.error(message) Notify.error(message)
} }
}) })
} else {
/* 事件通知 */
notifyReseller({ order_number, event }).then(({ code, message }) => {
Notify.clear()
if (code === 200) {
Notify.success(message)
} else {
Notify.error(message)
}
})
}
} }
//过滤表格枚举状态 //过滤表格枚举状态
@ -662,19 +678,6 @@ export default class orderList extends React.Component {
}} }}
/> />
</FormItem> </FormItem>
<FormItem labelname="分销商名称:" required="" labelwidth="120px">
<Select
name="state"
value={this.state.search.reseller_id}
options={this.state.resellerOptions}
placeholder="请选择"
width={204}
clearable
onChange={(va) => {
this.searchChange("reseller_id", va)
}}
/>
</FormItem>
<FormItem labelname="商品名称:" required="" labelwidth="100px"> <FormItem labelname="商品名称:" required="" labelwidth="100px">
<Select <Select
name="state" name="state"
@ -688,6 +691,19 @@ export default class orderList extends React.Component {
}} }}
/> />
</FormItem> </FormItem>
<FormItem labelname="分销商名称:" required="" labelwidth="120px">
<Select
name="state"
value={this.state.search.reseller_id}
options={this.state.resellerOptions}
placeholder="请选择"
width={204}
clearable
onChange={(va) => {
this.searchChange("reseller_id", va)
}}
/>
</FormItem>
<FormItem labelname="多功能查询:" required="" labelwidth="120px"> <FormItem labelname="多功能查询:" required="" labelwidth="120px">
<Select <Select
width="204px" width="204px"
@ -964,26 +980,30 @@ export default class orderList extends React.Component {
发送卡密短信 发送卡密短信
</span> </span>
)} )}
<Dropdown
position={DropdownPosition.RightTop}
visible={this.state.menuVisible}
onVisibleChange={(v) => this.setState({ visible1: v })}
>
<DropdownClickTrigger>
<div className="linkmore grid-link">
更多 <Icon type={"down"} />
</div>
</DropdownClickTrigger>
<DropdownContent>
<Menu onClick={(e, key) => this.menuItemClick(key, rowData.order_number)}>
{rowData.notifyEvent && {rowData.notifyEvent &&
rowData.notifyEvent.map((item) => ( rowData.notifyEvent.map((item) => (
<span <MenuItem key={item.event}>{item.name}</MenuItem>
className="grid-link"
onClick={() => this.eventNotify(rowData.order_number, item.event)}
>
{item.name}
</span>
))} ))}
{rowData.type === 2 && {rowData.type === 2 &&
rowData.orderVoucher && rowData.orderVoucher &&
rowData.orderVoucher.status === 1 && ( rowData.orderVoucher.status === 1 && (
<span <MenuItem key={0}>核销查询</MenuItem>
className="grid-link"
onClick={() => this.writeOffQuery(rowData.order_number)}
>
核销查询
</span>
)} )}
</Menu>
</DropdownContent>
</Dropdown>
</div> </div>
) )
} }

View File

@ -88,7 +88,7 @@ export const Column = [
prop: "opearo", prop: "opearo",
name: "opearo", name: "opearo",
type: "slot", type: "slot",
width: "160px" width: "220px"
}, },
{ {
title: "批次号", title: "批次号",