feat: 订单列表新增特性

This commit is contained in:
wangsongsole 2024-01-30 11:54:34 +08:00
parent f219a927dc
commit dadea66564
3 changed files with 109 additions and 51 deletions

View File

@ -1004,4 +1004,14 @@ export const goodsListByPlanId = (id) => {
return req("get", baseurl + "/goods/goodsListByPlanId/" + id) return req("get", baseurl + "/goods/goodsListByPlanId/" + id)
} }
/* 立减金订单核销主动查询 */
export const voucherUsageQuery = (data) => {
return req("post", baseurl + "/order/voucherUsageQuery", data)
}
/* 触发订单商品营销事件通知 */
export const notifyReseller = (data) => {
return req("post", baseurl + "/order/notifyReseller", data)
}
export { req } export { req }

View File

@ -10,7 +10,9 @@ import {
resendCardCode, resendCardCode,
getPlanChoseOption, getPlanChoseOption,
getReSellerOption, getReSellerOption,
goodsListByPlanId goodsListByPlanId,
voucherUsageQuery,
notifyReseller
} from "@/assets/api.js" } from "@/assets/api.js"
import "@/assets/comm.css" import "@/assets/comm.css"
import { nowDay, nowMonth } from "@/assets/comm.js" import { nowDay, nowMonth } from "@/assets/comm.js"
@ -596,6 +598,31 @@ export default class orderList extends React.Component {
) )
} }
/* 事件通知 */
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) {
voucherUsageQuery({ order_number }).then(({ code, message }) => {
Notify.clear()
if (code === 200) {
this.getOrderFn()
Notify.success(message)
} else {
Notify.error(message)
}
})
}
//过滤表格枚举状态 //过滤表格枚举状态
render() { render() {
const date = ( const date = (
@ -937,6 +964,26 @@ export default class orderList extends React.Component {
发送卡密短信 发送卡密短信
</span> </span>
)} )}
{rowData.notifyEvent &&
rowData.notifyEvent.map((item) => (
<span
className="grid-link"
onClick={() => this.eventNotify(rowData.order_number, item.event)}
>
{item.name}
</span>
))}
{rowData.type === 2 &&
rowData.orderVoucher &&
rowData.orderVoucher.status === 1 && (
<span
className="grid-link"
onClick={() => this.writeOffQuery(rowData.order_number)}
>
核销查询
</span>
)}
</div> </div>
) )
} }

View File

@ -371,56 +371,57 @@ export default class acclist extends React.Component {
operation: status ? 1 : 2 operation: status ? 1 : 2
} }
if (row.status == 3) { if (row.status == 3) {
this.setState({ plan_id: row.id }) return Notify.warn("待生效状态计划无法启用!")
planIsSend(row.id).then((res) => { // this.setState({ plan_id: row.id })
handelResponse(res, (req, msg) => { // planIsSend(row.id).then((res) => {
if (req.is_send == false) { // handelResponse(res, (req, msg) => {
this.setState({ cur_item: row }) // if (req.is_send == false) {
getReseller(row.reseller_id).then((res) => { // this.setState({ cur_item: row })
handelResponse( // getReseller(row.reseller_id).then((res) => {
res, // handelResponse(
(req, msg) => { // res,
this.setState({ // (req, msg) => {
audit_visible: true, // this.setState({
isSend: false, // audit_visible: true,
email_list: req.contact_email, // isSend: false,
phone_list: req.contact_phone // email_list: req.contact_email,
}) // phone_list: req.contact_phone
}, // })
(err) => { // },
Notify.error(err) // (err) => {
} // Notify.error(err)
) // }
}) // )
} else { // })
startOrStopPlan(row.id, data).then((res) => { // } else {
handelResponse( // startOrStopPlan(row.id, data).then((res) => {
res, // handelResponse(
(req, msg) => { // res,
let id = findIndex(this.state.distdata, (o) => { // (req, msg) => {
return o.id == row.id // let id = findIndex(this.state.distdata, (o) => {
}) // return o.id == row.id
this.state.distdata[id].open = status ? 2 : 1 // })
this.setState({ distdata: this.state.distdata }) // this.state.distdata[id].open = status ? 2 : 1
let data = { // this.setState({ distdata: this.state.distdata })
page: this.state.page, // let data = {
limit: this.state.limit, // page: this.state.page,
status: this.state.status // limit: this.state.limit,
} // status: this.state.status
if (this.state.searchOption) { // }
data[this.state.searchOption.key] = this.state.key_word // if (this.state.searchOption) {
} // data[this.state.searchOption.key] = this.state.key_word
self.getPlanList(data) // }
Notify.success("更改状态成功") // self.getPlanList(data)
}, // Notify.success("更改状态成功")
(err) => { // },
Notify.error(err) // (err) => {
} // Notify.error(err)
) // }
}) // )
} // })
}) // }
}) // })
// })
} else { } else {
startOrStopPlan(row.id, data).then((res) => { startOrStopPlan(row.id, data).then((res) => {
handelResponse( handelResponse(