💪 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,29 +614,29 @@ export default class orderList extends React.Component {
) )
} }
/* 事件通知 */ menuItemClick(event, order_number) {
eventNotify(order_number, event) { /* 核销查询 */
notifyReseller({ order_number, event }).then(({ code, message }) => { if (event == 0) {
Notify.clear() voucherUsageQuery({ order_number }).then(({ code, message }) => {
if (code === 200) { Notify.clear()
Notify.success(message) if (code === 200) {
} else { this.getOrderFn()
Notify.error(message) Notify.success(message)
} } else {
}) Notify.error(message)
} }
})
/* 核销查询 */ } else {
writeOffQuery(order_number) { /* 事件通知 */
voucherUsageQuery({ order_number }).then(({ code, message }) => { notifyReseller({ order_number, event }).then(({ code, message }) => {
Notify.clear() Notify.clear()
if (code === 200) { if (code === 200) {
this.getOrderFn() Notify.success(message)
Notify.success(message) } else {
} else { Notify.error(message)
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>
)} )}
{rowData.notifyEvent && <Dropdown
rowData.notifyEvent.map((item) => ( position={DropdownPosition.RightTop}
<span visible={this.state.menuVisible}
className="grid-link" onVisibleChange={(v) => this.setState({ visible1: v })}
onClick={() => this.eventNotify(rowData.order_number, item.event)} >
> <DropdownClickTrigger>
{item.name} <div className="linkmore grid-link">
</span> 更多 <Icon type={"down"} />
))} </div>
</DropdownClickTrigger>
{rowData.type === 2 && <DropdownContent>
rowData.orderVoucher && <Menu onClick={(e, key) => this.menuItemClick(key, rowData.order_number)}>
rowData.orderVoucher.status === 1 && ( {rowData.notifyEvent &&
<span rowData.notifyEvent.map((item) => (
className="grid-link" <MenuItem key={item.event}>{item.name}</MenuItem>
onClick={() => this.writeOffQuery(rowData.order_number)} ))}
> {rowData.type === 2 &&
核销查询 rowData.orderVoucher &&
</span> rowData.orderVoucher.status === 1 && (
)} <MenuItem key={0}>核销查询</MenuItem>
)}
</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: "批次号",