From e2baf4489177821dd526301c4a69d1caf2fda63a Mon Sep 17 00:00:00 2001 From: zhangds Date: Tue, 20 Feb 2024 17:09:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8C=85=E7=A0=81=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/plan/add/edit.js | 3 +- src/pages/plan/add/step1.js | 60 +++++++++++++++++++++++-------------- src/pages/plan/list/list.js | 6 ++++ 3 files changed, 45 insertions(+), 24 deletions(-) diff --git a/src/pages/plan/add/edit.js b/src/pages/plan/add/edit.js index 13ae4b24..3106dc33 100644 --- a/src/pages/plan/add/edit.js +++ b/src/pages/plan/add/edit.js @@ -89,7 +89,7 @@ export default class add extends React.Component { componentDidMount(e) { let plan_status = sessionStorage.getItem("plan_status") - if (plan_status == 3 || plan_status == 4 || plan_status == 5) { + if (plan_status == 3 || plan_status == 4 || plan_status == 5 || plan_status == 2) { this.setState({ disabled: true }) } let plan_id = sessionStorage.getItem("plan_id") @@ -113,6 +113,7 @@ export default class add extends React.Component { if (req.info) { sessionStorage.setItem("step1", JSON.stringify(req.info)) this.refs.step1.edit(req.info) + return } if (req.keys.length > 0 && this.state.disabled == false) { this.setState({ curstep: 2 }) diff --git a/src/pages/plan/add/step1.js b/src/pages/plan/add/step1.js index 4cb3dd83..466f22e5 100644 --- a/src/pages/plan/add/step1.js +++ b/src/pages/plan/add/step1.js @@ -35,29 +35,6 @@ export default class accList extends React.Component { } } - edit(data) { - let model = {} - model.title = data.title - model.type = parseInt(data.type) - model.return_id = data.return_type - model.settlement_type = this.state.settlementOptions.filter( - (item) => item.key == data.settlement_type - )[0] - model.reseller = { - key: data.reseller_id, - text: data.reseller_name - } - - model.date_time = [data.begin_time, data.end_time] - const date = { - begin_time: model.date_time[0], - end_time: model.date_time[1] - } - sessionStorage.setItem("knockGold_effectDate", JSON.stringify(date)) - sessionStorage.setItem("redPackets_effectDate", JSON.stringify(date)) - this.setState({ model: model, lodshow: true, isSettlement: data.settlement_type ? 1 : 2 }) - } - // componentDidMount(e) { getReSellerOption().then((res) => { handelResponse( @@ -98,6 +75,43 @@ export default class accList extends React.Component { }) } + edit(data) { + let model = {} + model.title = data.title + model.type = parseInt(data.type) + model.return_id = data.return_type + + model.reseller = { + key: data.reseller_id, + text: data.reseller_name + } + model.date_time = [data.begin_time, data.end_time] + const date = { + begin_time: model.date_time[0], + end_time: model.date_time[1] + } + sessionStorage.setItem("knockGold_effectDate", JSON.stringify(date)) + sessionStorage.setItem("redPackets_effectDate", JSON.stringify(date)) + + // 是否是包码 + let bm_obj_str = sessionStorage.getItem("bm_obj") + if (bm_obj_str) { + let bm_obj = JSON.parse(bm_obj_str) + if (bm_obj.settlement_type > 0) { + this.setState({ + isSettlement: 1 + }) + model.settlement_type = { key: bm_obj.settlement_type, text: bm_obj.settlement_type_text } + } else { + this.setState({ + isSettlement: 2 + }) + } + } + + this.setState({ model: model, lodshow: true }) + } + async submit(id) { let valide = false if (this.refs.form1.validator()) { diff --git a/src/pages/plan/list/list.js b/src/pages/plan/list/list.js index 6f722f53..343a4e1a 100644 --- a/src/pages/plan/list/list.js +++ b/src/pages/plan/list/list.js @@ -717,6 +717,12 @@ export default class acclist extends React.Component { Notify.error("不可编辑") return } + // 如果是包码 + let bm_obj = { + settlement_type: row.settlement_type, + settlement_type_text: row.settlement_type_text + } + sessionStorage.setItem("bm_obj", JSON.stringify(bm_obj)) sessionStorage.setItem("plan_id", row.id) sessionStorage.setItem("plan_status", row.status) sessionStorage.setItem("approval_id", row.approval_id)