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)
}
/* 立减金订单核销主动查询 */
export const voucherUsageQuery = (data) => {
return req("post", baseurl + "/order/voucherUsageQuery", data)
}
/* 触发订单商品营销事件通知 */
export const notifyReseller = (data) => {
return req("post", baseurl + "/order/notifyReseller", data)
}
export { req }

View File

@ -10,7 +10,9 @@ import {
resendCardCode,
getPlanChoseOption,
getReSellerOption,
goodsListByPlanId
goodsListByPlanId,
voucherUsageQuery,
notifyReseller
} from "@/assets/api.js"
import "@/assets/comm.css"
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() {
const date = (
@ -937,6 +964,26 @@ export default class orderList extends React.Component {
发送卡密短信
</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>
)
}

View File

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