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(