From dadea66564ccc648d8cf09c2bb3e95ed3e52f215 Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Tue, 30 Jan 2024 11:54:34 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E8=AE=A2=E5=8D=95=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=96=B0=E5=A2=9E=E7=89=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/api.js | 10 ++++ src/pages/order/list/list.js | 49 ++++++++++++++++- src/pages/plan/list/list.js | 101 ++++++++++++++++++----------------- 3 files changed, 109 insertions(+), 51 deletions(-) diff --git a/src/assets/api.js b/src/assets/api.js index 372cf02b..2301734f 100644 --- a/src/assets/api.js +++ b/src/assets/api.js @@ -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 } diff --git a/src/pages/order/list/list.js b/src/pages/order/list/list.js index d9518a2e..585fb28b 100644 --- a/src/pages/order/list/list.js +++ b/src/pages/order/list/list.js @@ -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 { 发送卡密短信 )} + {rowData.notifyEvent && + rowData.notifyEvent.map((item) => ( + this.eventNotify(rowData.order_number, item.event)} + > + {item.name} + + ))} + + {rowData.type === 2 && + rowData.orderVoucher && + rowData.orderVoucher.status === 1 && ( + this.writeOffQuery(rowData.order_number)} + > + 核销查询 + + )} ) } diff --git a/src/pages/plan/list/list.js b/src/pages/plan/list/list.js index 834b89a5..577e175c 100644 --- a/src/pages/plan/list/list.js +++ b/src/pages/plan/list/list.js @@ -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(