From 5d243384d929334806df361fc861d7741519ecfa Mon Sep 17 00:00:00 2001 From: red-deng-deng <1924913374@qq.com> Date: Thu, 30 Dec 2021 11:01:49 +0800 Subject: [PATCH 01/50] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=96=B0=E5=A2=9E=E5=90=8E=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=97=A0=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/system/role/add/add.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/system/role/add/add.js b/src/pages/system/role/add/add.js index 6d93d872..0ac80813 100644 --- a/src/pages/system/role/add/add.js +++ b/src/pages/system/role/add/add.js @@ -69,7 +69,8 @@ export default class addrole extends React.Component{ Notify.clear(); Notify.success(msg); setTimeout(()=>{ - window.history.back(); + // window.history.back(); + window.location.replace('#/home/system/role-list'); },1000); },(err)=>{ Notify.error(err) From 969afe92194b24ebf1dc9d87c08354d6fb98b5f5 Mon Sep 17 00:00:00 2001 From: red-deng-deng <1924913374@qq.com> Date: Thu, 30 Dec 2021 11:14:57 +0800 Subject: [PATCH 02/50] =?UTF-8?q?=E5=AE=8C=E6=88=90=E3=80=90=E5=A4=8D?= =?UTF-8?q?=E5=88=B6key=E3=80=91=E9=80=BB=E8=BE=91=E4=B8=B2=E9=80=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ src/pages/exchangecode/add/add.js | 21 ++++++++++----------- src/pages/plan/add/step2.js | 2 +- src/pages/plan/key/edit.js | 4 ++-- src/pages/plan/key/list.js | 24 ++++++++++++++++++++++-- 5 files changed, 37 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 4d29575d..fa9b5e2e 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ npm-debug.log* yarn-debug.log* yarn-error.log* +src/pages/exchangecode/contenttaggedwith/add.js +src/pages/exchangecode/contenttaggedwith/add.less diff --git a/src/pages/exchangecode/add/add.js b/src/pages/exchangecode/add/add.js index 603a794d..1657deda 100644 --- a/src/pages/exchangecode/add/add.js +++ b/src/pages/exchangecode/add/add.js @@ -77,18 +77,17 @@ export default class acclist extends React.Component{ componentDidMount(e){ let batch_id=sessionStorage.getItem("keybatch_id") - + let copyOpearo=sessionStorage.getItem("copyOpearo") //编辑 - if(batch_id > 0) + if(batch_id > 0||copyOpearo==2) { - this.setState({isEdit:true}) + // this.setState({isEdit:true}) getKeyBatchDetail(batch_id).then((res)=>{ handelResponse(res,(req,msg)=>{ - - console.log("和编辑",req) - this.setState({pagetitle:"编辑key"}) + this.setState({pagetitle:"复制key"}) let model = { - batch_name:req.batch_name, + title:req.plan_title, + batch_name:'', style: req.style, quantity:req.quantity, allow_repetition:req.allow_repetition, @@ -102,8 +101,8 @@ export default class acclist extends React.Component{ this.setState({begintime:req.begin_time}) let list = _.map(req.code_batch,(item)=>{ - item.disabled = true; - item.checked = true; + // item.disabled = true; + // item.checked = true; return item }) console.log(list) @@ -895,7 +894,7 @@ export default class acclist extends React.Component{
- +
{this.state.model.title}
@@ -940,7 +939,7 @@ export default class acclist extends React.Component{ {this.onCheckChange(e)}} disabled={this.state.isEdit} > 兑换码 优惠券 - 立减金 + {/* 立减金 */} { diff --git a/src/pages/plan/add/step2.js b/src/pages/plan/add/step2.js index 0f5adc33..76194aca 100644 --- a/src/pages/plan/add/step2.js +++ b/src/pages/plan/add/step2.js @@ -767,7 +767,7 @@ export default class acclist extends React.Component{ {this.onCheckChange(e)}}> 兑换码 优惠券 - 立减金 + {/* 立减金 */}
{ diff --git a/src/pages/plan/key/edit.js b/src/pages/plan/key/edit.js index 3b4d2876..24bde0f2 100644 --- a/src/pages/plan/key/edit.js +++ b/src/pages/plan/key/edit.js @@ -832,7 +832,7 @@ export default class acclist extends React.Component{ - +
{this.state.model.plan_title}
@@ -867,7 +867,7 @@ export default class acclist extends React.Component{ {this.onCheckChange(e)}} disabled={this.state.isEdit} > 兑换码 优惠券 - 立减金 + {/* 立减金 */}
{ diff --git a/src/pages/plan/key/list.js b/src/pages/plan/key/list.js index cc584402..93dbbbbc 100644 --- a/src/pages/plan/key/list.js +++ b/src/pages/plan/key/list.js @@ -266,7 +266,7 @@ export default class acclist extends React.Component{ } ]}] sessionStorage.setItem("keybatch_id","") - + sessionStorage.setItem("copyOpearo",0) sessionStorage.setItem('breakchangenav',JSON.stringify(activerou)); } aboutFn(e,row){ @@ -283,7 +283,25 @@ export default class acclist extends React.Component{ } ]}] sessionStorage.setItem('breaknav',JSON.stringify(activerou)); - } + } + //复制 + onCopyRow(status,row){ + this.props.history.push('/home/exchangecode-add'); + sessionStorage.setItem('pathname2','/home/exchangecode-add') + let activerou=[{pagetitle:'复制',items:[ + { + "path": "/home/exchangecode-list", + "name": "key列表管理" + }, + { + "path": "/home/exchangecode-add", + "name": "复制key" + } + ]}] + sessionStorage.setItem("keybatch_id",row.id) + sessionStorage.setItem("copyOpearo",1) + sessionStorage.setItem('breakchangenav',JSON.stringify(activerou)); + } //page pageChange(e){ this.setState({page:e}); @@ -397,6 +415,7 @@ onEditRow(status,row){ sessionStorage.setItem("keybatch_id",row.id) } + //敲回车查询 iptsureFn(){ this.setState({page:1}) @@ -621,6 +640,7 @@ linkTo(row){ str = {this.onEditRow(e,rowData)}} >编辑 + {this.onCopyRow(e,rowData)}} >复制 { keysIsSend(rowData.id).then((res)=>{ From b65680bb3f8d3066582d01704a20591f770ea3ed Mon Sep 17 00:00:00 2001 From: red-deng-deng <1924913374@qq.com> Date: Thu, 30 Dec 2021 11:17:10 +0800 Subject: [PATCH 03/50] =?UTF-8?q?=E4=BC=98=E5=8C=96key=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E5=88=97=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/plan/key/list.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/plan/key/list.js b/src/pages/plan/key/list.js index 93dbbbbc..26195e31 100644 --- a/src/pages/plan/key/list.js +++ b/src/pages/plan/key/list.js @@ -46,7 +46,7 @@ const Column = [ name: 'plan', type: "slot", prop:'edit', - width:'90px' + width:'120px' }, { title: '状态', From 507b01ca23c2cbae252c7a0f5215eea090caa752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Fri, 31 Dec 2021 11:09:29 +0800 Subject: [PATCH 04/50] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AE=A1=E6=89=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/api.js | 77 +++++++----- src/assets/enum.js | 2 + src/pages/plan/add/add.js | 157 ++++++++++-------------- src/pages/plan/add/add.less | 234 +++++++++++++++++++++++++++++++++++- src/pages/plan/add/edit.js | 56 ++++++++- src/pages/plan/list/list.js | 2 +- 6 files changed, 399 insertions(+), 129 deletions(-) diff --git a/src/assets/api.js b/src/assets/api.js index 1f19f8c1..15838c18 100644 --- a/src/assets/api.js +++ b/src/assets/api.js @@ -304,60 +304,60 @@ export const addPlanStep = (id, params) => { let str = id ? "/"+id :"" if(str) { - return req('put', baseurl + "/plan/step" + str, params) + return req('put',"http://192.168.6.165:8080" + "/plan/step" + str, params) } - return req('post', baseurl + "/plan/step" + str, params) + return req('post', "http://192.168.6.165:8080" + "/plan/step" + str, params) } //获取营销计划草稿信息 export const getDraftInfo = (id, params) => { - return req('get', baseurl + "/plan/draft/" + id, params) + return req('get', "http://192.168.6.165:8080" + "/plan/draft/" + id, params) } //启用停用 营销计划 export const startOrStopPlan = (id, params) => { - return req('put', baseurl + "/plan/status/" + id, params) + return req('put', "http://192.168.6.165:8080" + "/plan/status/" + id, params) } //创建key批次信息 export const addKeysBatchInfo = (id, params) => { - return req('post', baseurl + "/plan/" + id + "/keys", params) + return req('post', "http://192.168.6.165:8080" + "/plan/" + id + "/keys", params) } //编辑修改 export const putPlanStep = (id, params) => { - return req('put', baseurl + "/plan/edit/"+id,params) + return req('put', "http://192.168.6.165:8080" + "/plan/edit/"+id,params) } //获取key批次信息 export const getKeysBatchInfo = (id, params) => { - return req('get', baseurl + "/keys", params) + return req('get', "http://192.168.6.165:8080" + "/keys", params) } //启用停用key批次信息 export const startOrStopKeybatch = (id, params) => { - return req('put', baseurl + "/keys/status/" + id, params) + return req('put', "http://192.168.6.165:8080" + "/keys/status/" + id, params) } //获取key批次详细信息 export const getKeyBatchDetail = (id, params) => { - return req('get', baseurl + "/keys/" + id, params) + return req('get', "http://192.168.6.165:8080" + "/keys/" + id, params) } //更新key批次详细信息 export const putKeyBatchDetail = (id, params) => { - return req('put', baseurl + "/keys/" + id, params) + return req('put', "http://192.168.6.165:8080" + "/keys/" + id, params) } //发送key批次压缩包和压缩包密码 export const planSend = (id, params) => { - return req('put', baseurl + "/plan/send/" + id, params) + return req('put', "http://192.168.6.165:8080" + "/plan/send/" + id, params) } //是否已经发送过邮件 export const planIsSend = (id) => { - return req('get', baseurl + "/plan/is_send/" + id) + return req('get', "http://192.168.6.165:8080" + "/plan/is_send/" + id) } @@ -366,39 +366,39 @@ export const planIsSend = (id) => { //重新修改手机号邮箱 export const planReceive = (id, params) => { - return req('put', baseurl + "/plan/receive/" + id, params) + return req('put', "http://192.168.6.165:8080" + "/plan/receive/" + id, params) } //重新发送key批次压缩包和压缩包密码 export const planResend = (id, params) => { - return req('put', baseurl + "/plan/resend/" + id, params) + return req('put', "http://192.168.6.165:8080" + "/plan/resend/" + id, params) } export const keysIsSend = (id, params) => { - return req('get', baseurl + "/keys/is_send/" + id, params) + return req('get', "http://192.168.6.165:8080" + "/keys/is_send/" + id, params) } //作废key批次 export const cancelKey = (id, params) => { - return req('put', baseurl + "/keys/cancel/" + id, params) + return req('put', "http://192.168.6.165:8080" + "/keys/cancel/" + id, params) } //发送密钥邮件 export const postKeyEmail = (id, params) => { - return req('put', baseurl + "/keys/send/" + id, params) + return req('put', "http://192.168.6.165:8080" + "/keys/send/" + id, params) } //修改密钥邮件 export const putKeyEmail = (id, params) => { - return req('put', baseurl + "/keys/receive/" + id, params) + return req('put', "http://192.168.6.165:8080" + "/keys/receive/" + id, params) } export const resKeyEmail = (id, params) => { - return req('put', baseurl + "/keys/resend/" + id, params) + return req('put', "http://192.168.6.165:8080" + "/keys/resend/" + id, params) } @@ -406,17 +406,17 @@ export const resKeyEmail = (id, params) => { // 兑换码管理 //兑换码管理列表 export const getCodesList = (params) => { - return getData('get', baseurl + "/codes", params) + return getData('get', "http://192.168.6.165:8080" + "/codes", params) } //获取兑换码明细 export const getCodesDetail = (id) => { - return req('get', baseurl + "/codes/"+id) + return req('get', "http://192.168.6.165:8080" + "/codes/"+id) } //修改兑换码批次 export const putCodesBatch = (id,params) => { - return req('put', baseurl + "/codes/edit/"+id,params) + return req('put', "http://192.168.6.165:8080" + "/codes/edit/"+id,params) } @@ -425,45 +425,45 @@ export const putCodesBatch = (id,params) => { //更新兑换码 export const putCodes = (id,params) => { - return req('put', baseurl + "/codes/"+id,params) + return req('put', "http://192.168.6.165:8080" + "/codes/"+id,params) } //作废本批次兑换码 export const delCode = (id) => { - return req('delete', baseurl + "/codes/discard/"+id) + return req('delete', "http://192.168.6.165:8080" + "/codes/discard/"+id) } //作废本批次兑换码 export const putCodeStatus = (id,params) => { - return req('put', baseurl + "/codes/status/"+id,params) + return req('put', "http://192.168.6.165:8080" + "/codes/status/"+id,params) } //兑换码商品列表 export const getCodeProductList = (params) => { - return req('get', baseurl + "/codes/products",params) + return req('get', "http://192.168.6.165:8080" + "/codes/products",params) } //删除商品库存信息 export const delCodeProduct = (batch_id,id) => { - return req('delete', baseurl + "/codes/products/"+batch_id+"/"+id) + return req('delete', "http://192.168.6.165:8080" + "/codes/products/"+batch_id+"/"+id) } //更新单个商品信息 export const putCodeProduct = (batch_id,id,params) => { - return req('put', baseurl + "/codes/products/"+batch_id+"/"+id,params) + return req('put', "http://192.168.6.165:8080" + "/codes/products/"+batch_id+"/"+id,params) } //获取商品库存明细 export const getCodeProduct = (batch_id,id) => { - return req('get', baseurl + "/codes/products/"+batch_id+"/"+id) + return req('get', "http://192.168.6.165:8080" + "/codes/products/"+batch_id+"/"+id) } // //蓝色兄弟映射商品 export const getProductInfoSelect = (params) => { - return req('get', baseurl + "/product/market/products",params) + return req('get', "http://192.168.6.165:8080" + "/product/market/products",params) } // 上传 @@ -840,6 +840,23 @@ export const getkeyDetailList= (id,data) => { } +//提交审核 +export const approvals= (id,data) => { + return req('post', "http://192.168.6.165:8080" + "/plan/"+id+"/approvals",data) +} + + +export const getApprovalsInfo= (id,data) => { + return req('get', "http://192.168.6.165:8080" + "/approvals/"+id+"/market_approval_data",data) +} + + +export const terminateApprovals= (id,data) => { + return req('get', "http://192.168.6.165:8080" + "/approvals/"+id+"/terminate",data) +} + + + diff --git a/src/assets/enum.js b/src/assets/enum.js index cd991906..6b0b1303 100644 --- a/src/assets/enum.js +++ b/src/assets/enum.js @@ -44,6 +44,7 @@ const menu={ case 4:return '进行中';break; case 5:return '暂停中';break; case 6:return '已完结';break; + case 7:return '审批驳回';break; } }, planStatusBg(params) { @@ -54,6 +55,7 @@ const menu={ case 4:return '#55aaff';break; case 5:return '#55ff7f';break; case 6:return '#e64c00';break; + case 7:return '#b6bcb8';break; } }, keyStatusBg(params) { diff --git a/src/pages/plan/add/add.js b/src/pages/plan/add/add.js index 6998339e..d04e701f 100644 --- a/src/pages/plan/add/add.js +++ b/src/pages/plan/add/add.js @@ -7,7 +7,7 @@ import Step1 from "./step1.js" import Step2 from "./step2.js" import Step3 from "./step3.js" import _ from "lodash"; -import {addPlanStep,handelResponse,getReseller,planSend} from "../../../assets/api.js" +import {addPlanStep,handelResponse,getReseller,planSend,approvals} from "../../../assets/api.js" export default class add extends React.Component{ constructor(props){ @@ -31,7 +31,10 @@ export default class add extends React.Component{ phone_radio:-1, audit_visible:false, card_visible:false, - step1:null + step1:null, + paytype:1, + reseller:"", + payment_direction:["对私账户","对公账户","预付款扣除"] } } @@ -39,8 +42,6 @@ export default class add extends React.Component{ this.refs.step1.submit(); } onReturn(){ - - let self = this; Sweetalert.confirm({ type:'warning', @@ -53,16 +54,43 @@ export default class add extends React.Component{ parentComponent: this }); - - } componentDidMount(e){ sessionStorage.setItem("plan_id","") - } + } + onConfirm(e){ + + let plan_id = sessionStorage.getItem("plan_id") + + let data = + { + "reseller_id":this.state.reseller.id, + "reseller_name":this.state.reseller.name, + "company_name":this.state.reseller.company_name, + "receive_email":this.state.email_list[0], + "payment_direction":this.state.payment_direction[this.state.paytype - 1], + } + + approvals(plan_id,data).then((res)=>{ + handelResponse(res,(req,msg)=>{ + this.setState({audit_visible:false}) + Notify.success("成功发起审批") + this.props.history.push('/home/plan-list/'); + },(err)=>{ + Notify.error(err) + }) + }) + + + } + onPayTypeChange(e){ + console.log("渠道类型",e.target.value) + this.setState({paytype:e.target.value}) + } async onNextStep(){ if(this.state.curstep >= 1) @@ -151,10 +179,11 @@ export default class add extends React.Component{ getReseller(id).then((res)=>{ handelResponse(res,(req,msg)=>{ - - + console.log("分销商数据") + console.log(req) + this.setState({reseller:req}) this.setState({phone_list:req.contact_phone}) - this.setState({email_list:req.contact_email}) + this.setState({email_list:req.contact_email}) this.setState({audit_visible:true}) }) @@ -182,11 +211,9 @@ export default class add extends React.Component{ } onPhoneChange(e){ - console.log("电话改变",e) this.setState({phone_radio:e.target.value}) } onEmailChange(e){ - console.log("邮箱改变",e) this.setState({email_radio:e.target.value}) } cancel(e){ @@ -218,20 +245,16 @@ export default class add extends React.Component{ } let phoneReg = new RegExp("^[1][3,4,5,6,7,8,9][0-9]{9}$"); - // let emailReg = new RegExp( "\w+@\w+\.\w+(\.\w+){0,1}"); - + + + if (!phoneReg.test(data.phone)) { Notify.error("手机号格式不正确") return; } - // if(!emailReg.test(data.email)){ - - // Notify.error("邮箱格式不正确") - // return; - - // } + planSend(plan_id,data).then((res)=>{ @@ -356,85 +379,27 @@ export default class add extends React.Component{ { this.state.audit_visible ? ( -
+
-
- {this.onReturn(e)}} /> -
审核通过
-
是否立即发送key以及解压密码?
-
-
- 接收手机号 -
-
- {this.onPhoneChange(e)}} - > - { - - this.state.phone_list.map((item, index) => { - - return { - - if(item == this.state.phone_list[this.state.phone_radio]) - { - this.setState({phone_radio:-1}) - } - - }}>{item} - - }) - - } - -
-
-
-
- 接收邮箱 -
-
- {this.onEmailChange(e)} } - - - - > - { - this.state.email_list.map((item, index) => { - - return { - - if(item == this.state.email_list[this.state.email_radio]) - { - this.setState({email_radio:-1}) - } - - }}>{item} - - }) - } - -
-
-
- -1} > -
-
- -1} > -
-
- - -
-
+
+ {this.onReturn(e)}} /> +
提交审核
+
+ + {this.onPayTypeChange(e)}} value={this.state.paytype} className="audit-obj"> + 对私账户 + 对公账户 + 预付款扣除 + + +
+
+ + +
+
):null - }
diff --git a/src/pages/plan/add/add.less b/src/pages/plan/add/add.less index a11e8202..ad9fd2ac 100644 --- a/src/pages/plan/add/add.less +++ b/src/pages/plan/add/add.less @@ -253,4 +253,236 @@ } // .zent-datepicker-trigger{ // width: 280px !important; -// } \ No newline at end of file +// } + +.key_number{ + width: 90%; + display: flex; +} + + + +//导入模板 + +.import-excel +{ + width: 431px; + height:560px; + background-color: #FFFFFF; + border-radius: 5px; + box-shadow: 0 0 10px #DEE2E5; + position: fixed; + top: 50%; + margin-top: -280px; + left: 50%; + margin-left: -215px; + z-index: 100; + .import-header{ + width: 100%; + height: 48px; + display: flex; + align-items: center; + .import-title{ + width: 70%; + font-size: 14px; + font-weight: bold; + margin-left: 20px; + } + + .closebtn{ + width: 30%; + + } + + .import-close{ + margin-left: 70px; + font-size: 20px; + font-weight: bold; + } + } + .step-bar{ + width: 75%; + height: 80px; + margin: 10px auto; + display: flex; + justify-content: center; + } + .step-code{ + width: 24px; + height: 24px; + border-radius: 50%; + border: 1px solid #e8e8e8; + display: flex; + align-items: center; + justify-content: center; + color: #e8e8e8; + + } + .step-code.active + { + background-color: #1890ff; + } + + .step-group{ + width: 150px; + height: 50px; + display: flex; + align-items: center; + } + .step-center{ + width: 60px; + height: 50px; + display: flex; + align-items: center; + margin-right: 40px; + } + .step-line{ + width: 50px; + height: 1px; + background-color:#e8e8e8; + + } + .step-line.active{ + background-color: #1890ff; + } + + .step-label{ + color: #8d8d8d; + font-size: 14px; + margin-left: 10px; + } + .step-label.active{ + color: #000000; + } + + + .upload-panel1{ + width: 85%; + margin: 10px auto; + margin-bottom: 20px; + .upload-label{ + font-size: 16px; + font-weight: bold; + margin-bottom: 30px; + } + .upload-info{ + color:#626366; + } + } + + .btn-upload{ + margin-top: 10px; + margin-left: 50px; + margin-bottom: 20px; + } + .btn-download{ + margin-top: 10px; + margin-left: 30px; + } + .foot-bar + { + width: 100%; + height: 50px; + position: absolute; + bottom: 20px; + .btn-group{ + width: 240px; + margin-left: 160px; + } + button{ + width: 100px; + } + } + + .upload-msgbar{ + width: 82%; + background-color: #f5f5f5; + margin: 0 auto; + min-height: 40px; + border-radius: 5px; + + display: flex; + .execel-name{ + width: 75%; + display: flex; + min-height: 40px; + + align-items: center; + .excel-txt{ + font-size: 12px; + margin-left: 10px; + } + .doc-flag{ + font-size: 20px; + margin-left: 5px; + } + + + } + + .file-tag{ + width: 25%; + font-size: 12px; + display: flex; + align-items: center; + color: #1890ff; + + .upload-flag{ + font-size: 20px; + margin-left: 5px; + color: #1890ff; + margin-right: 3px; + } + } + + + } + .file-tip{ + margin-left: 35px; + margin-top: 10px; + margin-bottom: 50px; + } + .error{ + color: #e83f2e; + } + .success{ + color: #98d673; + } + + .error-icon{ + color: #e83f2e; + font-size: 18px; + margin-right: 10px; + } + .success-icon{ + color: #98d673; + font-size: 18px; + margin-right: 10px; + } + .file-upload-tip{ + color: #000000; + font-size: 14px; + font-weight: bold; + margin-left: 40px; + margin-top: 20px; + } + .file-errmsg{ + color: #000000; + font-size: 14px; + margin-left: 40px; + margin-top: 40px; + } + + .gridpanel{ + width: 90%; + height: 400px; + margin: 0 auto; + margin-top: 50px; + } + + +} +.audit-obj{ + margin-left: 30px; + margin-bottom: 30px; + } \ No newline at end of file diff --git a/src/pages/plan/add/edit.js b/src/pages/plan/add/edit.js index d161bd06..41b44b5a 100644 --- a/src/pages/plan/add/edit.js +++ b/src/pages/plan/add/edit.js @@ -7,7 +7,7 @@ import Step1 from "./step1.js" import Step2 from "./step2.js" import Step3 from "./step3.js" import _ from "lodash"; -import {addPlanStep,handelResponse,getReseller,planSend,getDraftInfo,putPlanStep,uploadImg} from "../../../assets/api.js" +import {addPlanStep,handelResponse,getReseller,planSend,getDraftInfo,putPlanStep,uploadImg,getApprovalsInfo} from "../../../assets/api.js" export default class add extends React.Component{ constructor(props){ @@ -69,6 +69,60 @@ export default class add extends React.Component{ this.setState({disabled:true}) } let plan_id = sessionStorage.getItem("plan_id") + let approval_id = sessionStorage.getItem("approval_id") + + //获取审批接口的编辑信息 + if(plan_status == 2 || plan_status == 7) + { + getApprovalsInfo(approval_id).then((res)=>{ + handelResponse(res,(req,msg)=>{ + console.log("当前营销计划编辑信息") + console.log(req) + + if(req.info) + { + this.refs.step1.edit(req.info) + } + if(req.keys.length > 0 && this.state.disabled ==false) + { + + this.setState({curstep:2}) + + for(let i = 0;i < req.keys.length;i++) + { + this.addNewkey() + } + + // this.setState({keys:req.keys}) + + setTimeout(()=>{ + for(let i = 0;i < this.state.keys.length;i++) + { + this.refs["step2-"+i].edit(req.keys[i]) + } + },500) + + } + else{ + this.addNewkey() + } + + },(err)=>{ + Notify.error(err) + }) + }) + + + + + + } + + + + + + //获取草稿信息 getDraftInfo(plan_id).then((res)=>{ handelResponse(res,(req,msg)=>{ console.log("当前营销计划编辑") diff --git a/src/pages/plan/list/list.js b/src/pages/plan/list/list.js index 7ac95974..e15f377a 100644 --- a/src/pages/plan/list/list.js +++ b/src/pages/plan/list/list.js @@ -24,7 +24,7 @@ export default class acclist extends React.Component{ limit:10, tabList:[{title:"营销计划列表"}], distdata:[{title:'士大夫大师傅'}], - filterList:[{id:0,label:"状态", prop:"status", menuList:[{id:999,name:"全部"},{id:0,name:"创建中"},{id:2,name:"审核中"},{id:3,name:"待生效"},{id:4,name:"进行中"},{id:5,name:"暂停中"},{id:6,name:"已完结"}]}, + filterList:[{id:0,label:"状态", prop:"status", menuList:[{id:999,name:"全部"},{id:0,name:"创建中"},{id:2,name:"审核中"},{id:3,name:"待生效"},{id:4,name:"进行中"},{id:5,name:"暂停中"},{id:6,name:"已完结"},{id:7,name:"审批驳回"}]}, ], tableHeight:500, menuList:[{id:0,name:"状态",check:false}], From 77696d8874e3c775a1570a3ff8c1333b06427497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Tue, 4 Jan 2022 14:16:24 +0800 Subject: [PATCH 05/50] =?UTF-8?q?=E6=8E=A5=E5=85=A5=E5=85=91=E6=8D=A2?= =?UTF-8?q?=E7=A0=81=E5=92=8Ckey=E6=89=B9=E6=AC=A1=E7=9A=84=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/api.js | 13 +- src/pages/exchangecode/add/add.js | 189 ++++-------- src/pages/exchangecode/edit/edit.js | 463 +++++++++++++++++++--------- src/pages/exchangecode/list/list.js | 1 + src/pages/plan/add/edit.js | 318 +++++++++++-------- src/pages/plan/add/edit.less | 8 + src/pages/plan/key/edit.js | 232 +++++++++++--- src/pages/plan/key/list.js | 2 + src/pages/plan/list/list.js | 3 +- 9 files changed, 785 insertions(+), 444 deletions(-) diff --git a/src/assets/api.js b/src/assets/api.js index 15838c18..4f5b5cac 100644 --- a/src/assets/api.js +++ b/src/assets/api.js @@ -281,12 +281,12 @@ export const handelResponse = (res, cb, errCb) => { } //营销计划列表 export const getPlanList = (params) => { - return req('get', baseurl + "/plan", params) + return req('get', "http://192.168.6.165:8080" + "/plan", params) } //获取key批次列表 export const getKeyList = (params) => { - return req('get', baseurl + "/keys", params) + return req('get', "http://192.168.6.165:8080" + "/keys", params) } //获取分销商下拉菜单 export const getReSellerOption = (params) => { @@ -463,7 +463,7 @@ export const getCodeProduct = (batch_id,id) => { // //蓝色兄弟映射商品 export const getProductInfoSelect = (params) => { - return req('get', "http://192.168.6.165:8080" + "/product/market/products",params) + return req('get', baseurl + "/product/market/products",params) } // 上传 @@ -852,7 +852,12 @@ export const getApprovalsInfo= (id,data) => { export const terminateApprovals= (id,data) => { - return req('get', "http://192.168.6.165:8080" + "/approvals/"+id+"/terminate",data) + return req('put', "http://192.168.6.165:8080" + "/approvals/"+id+"/terminate",data) +} + + +export const getApprovalsStatus= (id,data) => { + return req('get', "http://192.168.6.165:8080" + "/approvals/"+id+"/status") } diff --git a/src/pages/exchangecode/add/add.js b/src/pages/exchangecode/add/add.js index 1657deda..878743ad 100644 --- a/src/pages/exchangecode/add/add.js +++ b/src/pages/exchangecode/add/add.js @@ -70,7 +70,10 @@ export default class acclist extends React.Component{ phone_list:[], email_list:[], email_radio:-1, - phone_radio:-1 + phone_radio:-1, + paytype:1, + reseller:null, + payment_direction:["对私账户","对公账户","预付款扣除"], } } @@ -131,6 +134,20 @@ export default class acclist extends React.Component{ this.setState({endtime:plan_item.end_time}) this.setState({begintime:plan_item.begin_time}) + let id = plan_item.reseller_id + + getReseller(id).then((res)=>{ + handelResponse(res,(req,msg)=>{ + this.setState({reseller:req}) + + this.setState({phone_list:req.contact_phone}) + this.setState({email_list:req.contact_email}) + + }) + }) + + + let codeInfo= { //数据模型不可少 code_name:"", issued:'',//发放总量 @@ -146,6 +163,10 @@ export default class acclist extends React.Component{ } } + + onPayTypeChange(e){ + this.setState({paytype:e.target.value}) + } async submit(){ let valide = false; @@ -431,16 +452,6 @@ export default class acclist extends React.Component{ window.history.back() },1000); - // getReseller(req.reseller_id).then((res)=>{ - // handelResponse(res,(req,msg)=>{ - - - // this.setState({phone_list:req.contact_phone}) - // this.setState({email_list:req.contact_email}) - // this.setState({audit_visible:true}) - - // }) - // }) },(err)=>{ Notify.error(err); @@ -461,25 +472,30 @@ export default class acclist extends React.Component{ data.allow_loss = this.state.model.allow_loss; data.merge_stock = this.state.model.merge_stock; data.code_batch = this.refs.bindObj.getSelectData(); + + data.reseller_id=this.state.reseller.id + data.reseller_name=this.state.reseller.name + data.company_name=this.state.reseller.company_name + data.receive_email=this.state.reseller.contact_email[0] + data.payment_direction=this.state.payment_direction[this.state.paytype - 1] + + if(data.code_batch.length == 0) { Notify.error("请绑定对象") return } - + this.setState({audit_visible:false}) let id = sessionStorage.getItem("key_plan_id") addKeysBatchInfo(id,data).then((res)=>{ handelResponse(res,(req,msg)=>{ + Notify.success("创建key成功"); - sessionStorage.setItem("keyBatchId",req.key_batch_id) - getReseller(req.reseller_id).then((res)=>{ - handelResponse(res,(req,msg)=>{ - this.setState({phone_list:req.contact_phone}) - this.setState({email_list:req.contact_email}) - this.setState({audit_visible:true}) + setTimeout(()=>{ - }) - }) + this.props.history.push('/home/key-list/'); + },2000) + },(err)=>{ Notify.error(err); }) @@ -592,10 +608,7 @@ export default class acclist extends React.Component{ }; - - onNameChange(){ - - } + onUploadError = (type, data) => { if (type === 'overMaxAmount') { Notify.error(`最多可上传 ${data.maxAmount} 张图片`); @@ -666,41 +679,7 @@ export default class acclist extends React.Component{ : {}; }; - send(e) - { - let key_id = sessionStorage.getItem("keyBatchId") - let data ={ - phone: this.state.phone_radio > -1 ? this.state.phone_list[this.state.phone_radio] : this.state.phone , - email: this.state.email_radio > -1 ? this.state.email_list[this.state.email_radio] : this.state.email - } - - let phoneReg = new RegExp("^[1][3,4,5,6,7,8,9][0-9]{9}$"); - // let emailReg = new RegExp( "\w+@\w+\.\w+(\.\w+){0,1}"); - - - if (!phoneReg.test(data.phone)) { - Notify.error("手机号格式不正确") - return; - } - // if(!emailReg.test(data.email)){ - // Notify.error("邮箱格式不正确") - // return; - // } - - - postKeyEmail(key_id,data).then((res)=>{ - handelResponse(res,(req,msg)=>{ - Notify.success("发送成功,请在1-2分钟后查看") - this.props.history.push('/home/key-list/'); - },(err)=>{ - Notify.error(err) - this.props.history.push('/home/key-list/'); - }) - }) - - - } onReturn(){ let self = this; @@ -1005,7 +984,7 @@ export default class acclist extends React.Component{
- +
@@ -1201,83 +1180,29 @@ export default class acclist extends React.Component{ { + this.state.audit_visible ? ( -
+
-
- {this.onReturn(e)}} /> -
审核通过
-
是否立即发送key以及解压密码?
-
-
- 接收手机号 -
-
- {this.onPhoneChange(e)}} - > - { - - this.state.phone_list.map((item, index) => { - - return { - - if(item == this.state.phone_list[this.state.phone_radio]) - { - this.setState({phone_radio:-1}) - } - - }}>{item} - - }) - - } - -
-
-
-
- 接收邮箱 -
-
- {this.onEmailChange(e)} } - > - { - this.state.email_list.map((item, index) => { - - return { - - if(item == this.state.email_list[this.state.email_radio]) - { - this.setState({email_radio:-1}) - } - - }}>{item} - - }) - } - -
-
-
- -1} > -
-
- -1} > -
-
- - -
-
+
+ {this.setState({audit_visible:false})}} /> +
提交审核
+
+ + {this.onPayTypeChange(e)}} value={this.state.paytype} className="audit-obj"> + 对私账户 + 对公账户 + 预付款扣除 + + +
+
+ + +
+
):null - }
) diff --git a/src/pages/exchangecode/edit/edit.js b/src/pages/exchangecode/edit/edit.js index 06cd02a3..10c3af9f 100644 --- a/src/pages/exchangecode/edit/edit.js +++ b/src/pages/exchangecode/edit/edit.js @@ -3,9 +3,9 @@ import React from "react" import Ipt from "../../../components/input/main" import Form from "../../../components/form/main" import FormItem from "../../../components/form-item/main" -import {Card, Drawer, Select,Button,ImageUpload ,DateRangePicker,onUpload,Sweetalert,RadioButton,RadioGroup,Notify,Input,CombinedDateRangePicker} from "zent" +import {Card,Radio,Icon, Drawer, Select,Button,ImageUpload ,DateRangePicker,onUpload,Sweetalert,RadioButton,RadioGroup,Notify,Input,CombinedDateRangePicker} from "zent" import Bus from "../../../assets/eventBus.js" -import {getProductInfoSelect,handelResponse,uploadImg,getCodeProduct,putCodeProduct,getCodesDetail,putCodes,putCodesBatch} from "../../../assets/api.js" +import {getApprovalsStatus,getApprovalsInfo,terminateApprovals,getProductInfoSelect,handelResponse,uploadImg,getCodeProduct,putCodeProduct,getCodesDetail,putCodes,putCodesBatch} from "../../../assets/api.js" import _ from "lodash"; import Productform from "../product/add" import "./edit.less" @@ -16,22 +16,6 @@ const initArray = targetNum => { return Array.from({ length: targetNum }, (_, index) => index); }; - // { - - // Bus.emit('change',"date_time" ,e); - // this.onChangeCombinedDate(e)} - // } - // /> - export default class exchangedit extends React.Component{ constructor(props){ @@ -63,7 +47,14 @@ export default class exchangedit extends React.Component{ cur_product:null, productOption:[], rankoptions:[], - rank:[] + rank:[], + recall_visible:false, + approvalLoading:false, + timer:3, + paytype:1, + reseller:null, + payment_direction:["对私账户","对公账户","预付款扣除"], + } } @@ -76,50 +67,90 @@ export default class exchangedit extends React.Component{ //获取商品信息 let code_batch_id = sessionStorage.getItem("code_id") - - getCodesDetail(code_batch_id).then(res=>{ - handelResponse(res,(req,msg)=>{ - - let codeInfo={ - code_name:req.title, - issued:req.quantity, - stock:req.stock, - describe:req.describe, - date_time:[req.begin_time,req.end_time], - range:req.code_batch_stock - } - - this.setState({codeInfo:codeInfo}) - this.setState({isload:true}); - let table = _.map(req.code_batch_stock,(res)=>{ - res.checked = true; - return res - }); - - this.setState({tempdata:req.code_batch_stock }) - - let arr = []; - - _.map(req.code_batch_stock,(res)=>{ - let obj = {}; - obj.key = res.product_id; - obj.text= res.product_name; - this.state.oldProduct.push(res.product_id); - arr.push(obj) - return obj; - }) - - this.setState({rankoptions:arr}) - this.setState({rank:arr}) - },(err)=>{ - - }) - }).catch(err=>{ - }); - - - - + let approval_id = sessionStorage.getItem("approval_id") + if(approval_id > 0) + { + getApprovalsInfo(approval_id).then(res=>{ + handelResponse(res,(req,msg)=>{ + + let codeInfo={ + code_name:req.title, + issued:req.quantity, + stock:req.stock, + describe:req.describe, + date_time:[req.begin_time,req.end_time], + range:req.code_batch_stock + } + + this.setState({codeInfo:codeInfo}) + this.setState({isload:true}); + let table = _.map(req.code_batch_stock,(res)=>{ + res.checked = true; + return res + }); + + this.setState({tempdata:req.code_batch_stock }) + + let arr = []; + + _.map(req.code_batch_stock,(res)=>{ + let obj = {}; + obj.key = res.product_id; + obj.text= res.product_name; + this.state.oldProduct.push(res.product_id); + arr.push(obj) + return obj; + }) + + this.setState({rankoptions:arr}) + this.setState({rank:arr}) + },(err)=>{ + + }) + }).catch(err=>{ + }); + } + else{ + getCodesDetail(code_batch_id).then(res=>{ + handelResponse(res,(req,msg)=>{ + + let codeInfo={ + code_name:req.title, + issued:req.quantity, + stock:req.stock, + describe:req.describe, + date_time:[req.begin_time,req.end_time], + range:req.code_batch_stock + } + + this.setState({codeInfo:codeInfo}) + this.setState({isload:true}); + let table = _.map(req.code_batch_stock,(res)=>{ + res.checked = true; + return res + }); + + this.setState({tempdata:req.code_batch_stock }) + + let arr = []; + + _.map(req.code_batch_stock,(res)=>{ + let obj = {}; + obj.key = res.product_id; + obj.text= res.product_name; + this.state.oldProduct.push(res.product_id); + arr.push(obj) + return obj; + }) + + this.setState({rankoptions:arr}) + this.setState({rank:arr}) + },(err)=>{ + + }) + }).catch(err=>{ + }); + } } onRankChange(e){ _.forEach(this.state.tempdata, (item) => { @@ -146,97 +177,146 @@ export default class exchangedit extends React.Component{ } + + submitCodeData(){ + + let code_batch_id = sessionStorage.getItem("code_id") + + let range = [] + _.map(this.state.rank,(o)=>{ + + if(this.state.oldProduct.indexOf(o.key) < 0) + { + range.push(o.text) ; + } + }) + console.log("范围",this.state.rank) + console.log("旧商品",this.state.oldProduct) + let selectData = this.refs.tempdata.getSelectData(); + let addProduct = selectData.filter((o)=>{ + + return this.state.oldProduct.indexOf(o.product_id) < 0 + }) + + let updateIds = [] + let updateProduct = [] + _.map(selectData,(o)=>{ + + if(this.state.oldProduct.indexOf(o.product_id) > -1) + { + + updateIds.push(o.product_id) + + let _object = {} + _object.contract_price= o.contract_price; + _object.cost_price= o.cost_price; + _object.describe_url= o.describe_url; + _object.official_price= o.official_price; + _object.product_id= o.product_id + _object.account_type =o.account_type; + _object.product_name= o.product_name + _object.product_type= o.product_type + _object.quantity= o.quantity + _object.show_url = o.show_url + _object.map_product_name = o.map_product_name + updateProduct.push(_object) + } + + + }); + + + let deleteProduct= _.differenceWith(this.state.oldProduct, updateIds, _.isEqual); + let data ={ + "reseller_id":"15", + "reseller_name":"熊大的分销商", + "company_name":"数字世界", + "receive_email":"2371536879@qq.com", + "payment_direction":this.state.payment_direction[this.state.paytype - 1], + "title": this.state.codeInfo.code_name, + "range": range, + "describe": this.state.codeInfo.describe, + "begin_time": this.state.codeInfo.date_time[0], + "end_time": this.state.codeInfo.date_time[1], + "quantity":this.state.codeInfo.issued, + "new_product":addProduct, + "update_product":updateProduct, + "delete_product": deleteProduct, + } + putCodesBatch(code_batch_id,data).then((res)=>{ + handelResponse(res,(req,msg)=>{ + console.log(req) + let model2 = this.state.model; + model2.show_url = req.path; + this.setState({model:model2}) + + Notify.clear(); + Notify.success(msg); + setTimeout(()=>{ + window.location.replace('#/home/exchangecode-list'); + },1000); + },(error)=>{ + Notify.error(error); + }) + }); + } + onPayTypeChange(e){ + this.setState({paytype:e.target.value}) + } + + + submit(){ if(this.refs.code_info.validator() && this.refs.code_rule.validator() ) { - - - if(this.state.uploading ) - { - - Notify.error("还有图片上传中,不可提交") - return - } - - - - let code_batch_id = sessionStorage.getItem("code_id") - - let range = [] - _.map(this.state.rank,(o)=>{ - - if(this.state.oldProduct.indexOf(o.key) < 0) - { - range.push(o.text) ; - } - }) - let selectData = this.refs.tempdata.getSelectData(); - let addProduct = selectData.filter((o)=>{ - - return this.state.oldProduct.indexOf(o.product_id) < 0 - }) - - let updateIds = [] - let updateProduct = [] - _.map(selectData,(o)=>{ - - if(this.state.oldProduct.indexOf(o.product_id) > -1) - { - - updateIds.push(o.product_id) - - let _object = {} - _object.contract_price= o.contract_price; - _object.cost_price= o.cost_price; - _object.describe_url= o.describe_url; - _object.official_price= o.official_price; - _object.product_id= o.product_id - _object.account_type =o.account_type; - _object.product_name= o.product_name - _object.product_type= o.product_type - _object.quantity= o.quantity - _object.show_url = o.show_url - updateProduct .push(_object) - } - - - }); - - - let deleteProduct= _.differenceWith(this.state.oldProduct, updateIds, _.isEqual); - - - - let data ={ - "title": this.state.codeInfo.code_name, - "range": range, - "describe": this.state.codeInfo.describe, - "begin_time": this.state.codeInfo.date_time[0], - "end_time": this.state.codeInfo.date_time[1], - "quantity":this.state.codeInfo.issued, - "new_product":addProduct, - "update_product":updateProduct, - "delete_product": deleteProduct + if(this.state.uploading ) + { + + Notify.error("还有图片上传中,不可提交") + return } - putCodesBatch(code_batch_id,data).then((res)=>{ - handelResponse(res,(req,msg)=>{ - console.log(req) - let model2 = this.state.model; - model2.show_url = req.path; - this.setState({model:model2}) - - Notify.clear(); - Notify.success(msg); - setTimeout(()=>{ - window.location.replace('#/home/exchangecode-list'); - },1000); - },(error)=>{ - Notify.error(error); - }) - }); + + this.setState({audit_visible:true}) } } + + onConfirm(){ + let approval_id = sessionStorage.getItem("approval_id") + if(approval_id <= 0) + { + this.submitCodeData(); + }else{ + + getApprovalsStatus(approval_id).then((res)=>{ + handelResponse(res,(req,msg)=>{ + if(req.status == 0) + { + this.setState({recall_visible:true}) + } + if(req.status == 1) + { + Notify.error("进行中的批次不能提交审核") + setTimeout(()=>{ + this.props.history.push('/home/key-list/'); + },2000) + + } + if(req.status == 2 || req.status == 3){ + + this.submitCodeData(); + + } + },(err)=>{ + Notify.error(err) + }) + }) + + + + } + + } onTypeChange(e){ console.log(e) @@ -474,6 +554,28 @@ export default class exchangedit extends React.Component{ } return isdisabled } + + onReCall(){ + let approval_id = sessionStorage.getItem("approval_id") + this.setState({recall_visible:false}) + terminateApprovals(approval_id).then((res)=>{ + handelResponse(res,(req,msg)=>{ + this.setState({approvalLoading:true}) + let timer_c = setInterval(()=>{ + console.log(this.state.timer) + if(this.state.timer <= 0) + { + clearInterval(timer_c) + this.setState({approvalLoading:false}) + } + let time = this.state.timer - 1; + this.setState({timer:time}) + },1000) + },(err)=>{ + Notify.error(err) + }) + }) + } render(){ @@ -752,8 +854,73 @@ export default class exchangedit extends React.Component{
+ + + { + + this.state.audit_visible ? ( +
+
+
+ {this.setState({audit_visible:false})}} /> +
提交审核
+
+ + {this.onPayTypeChange(e)}} value={this.state.paytype} className="audit-obj"> + 对私账户 + 对公账户 + 预付款扣除 + + +
+
+ + +
+
+
+ ):null + } + { + + this.state.recall_visible ? ( +
+
+
+ {this.setState({recall_visible:false})}} /> +
当前正在审核中
+
+ + 是否确定撤回正在审批 + +
+
+ + +
+
+
+ ):null + } + { + + this.state.approvalLoading ? ( +
+
+
+ {this.setState({approvalLoading:false})}} /> +
撤销审批中
+
+ 正在发起撤销...,请等待{this.state.timer}秒 +
+
+
+ ):null + } + +
- +
diff --git a/src/pages/exchangecode/list/list.js b/src/pages/exchangecode/list/list.js index 7a59eb2c..1746f686 100644 --- a/src/pages/exchangecode/list/list.js +++ b/src/pages/exchangecode/list/list.js @@ -174,6 +174,7 @@ export default class acclist extends React.Component{ ]}] sessionStorage.setItem("code_id",rowData.id) sessionStorage.setItem('breaknav',JSON.stringify(activerou)); + sessionStorage.setItem("approval_id",rowData.approval_id) window.open('#/home/exchangecode-edit'); } tabFn(index){ diff --git a/src/pages/plan/add/edit.js b/src/pages/plan/add/edit.js index 41b44b5a..f0a5154a 100644 --- a/src/pages/plan/add/edit.js +++ b/src/pages/plan/add/edit.js @@ -7,7 +7,7 @@ import Step1 from "./step1.js" import Step2 from "./step2.js" import Step3 from "./step3.js" import _ from "lodash"; -import {addPlanStep,handelResponse,getReseller,planSend,getDraftInfo,putPlanStep,uploadImg,getApprovalsInfo} from "../../../assets/api.js" +import {addPlanStep,handelResponse,getReseller,planSend,getDraftInfo,putPlanStep,uploadImg,getApprovalsInfo,approvals,terminateApprovals,getApprovalsStatus} from "../../../assets/api.js" export default class add extends React.Component{ constructor(props){ @@ -31,11 +31,18 @@ export default class add extends React.Component{ phone_radio:-1, audit_visible:false, card_visible:false, + recall_visible:false, step1_data:null, step2_data:null, step3_data:null, disabled:false, - disabled_time:false + disabled_time:false, + paytype:1, + reseller:null, + payment_direction:["对私账户","对公账户","预付款扣除"], + approvalLoading:false, + timer:3, + } } @@ -72,13 +79,13 @@ export default class add extends React.Component{ let approval_id = sessionStorage.getItem("approval_id") //获取审批接口的编辑信息 - if(plan_status == 2 || plan_status == 7) + if(approval_id !=0) { getApprovalsInfo(approval_id).then((res)=>{ handelResponse(res,(req,msg)=>{ console.log("当前营销计划编辑信息") console.log(req) - + if(req.info) { this.refs.step1.edit(req.info) @@ -104,7 +111,7 @@ export default class add extends React.Component{ } else{ - this.addNewkey() + this.setState({card_visible : true}) } },(err)=>{ @@ -117,50 +124,47 @@ export default class add extends React.Component{ } - - - - - - //获取草稿信息 - getDraftInfo(plan_id).then((res)=>{ - handelResponse(res,(req,msg)=>{ - console.log("当前营销计划编辑") - console.log(req) - - if(req.info) - { - this.refs.step1.edit(req.info) - } - if(req.keys.length > 0 && this.state.disabled ==false) - { - - this.setState({curstep:2}) - - for(let i = 0;i < req.keys.length;i++) + else{ + //获取草稿信息 + getDraftInfo(plan_id).then((res)=>{ + handelResponse(res,(req,msg)=>{ + console.log("当前营销计划编辑") + console.log(req) + + if(req.info) { + this.refs.step1.edit(req.info) + } + if(req.keys.length > 0 && this.state.disabled ==false) + { + + this.setState({curstep:2}) + + for(let i = 0;i < req.keys.length;i++) + { + this.addNewkey() + } + + // this.setState({keys:req.keys}) + + setTimeout(()=>{ + for(let i = 0;i < this.state.keys.length;i++) + { + this.refs["step2-"+i].edit(req.keys[i]) + } + },500) + + } + else{ this.addNewkey() } - // this.setState({keys:req.keys}) - - setTimeout(()=>{ - for(let i = 0;i < this.state.keys.length;i++) - { - this.refs["step2-"+i].edit(req.keys[i]) - } - },500) - - } - else{ - this.addNewkey() - } - - },(err)=>{ - Notify.error(err) - }) - }) - + },(err)=>{ + Notify.error(err) + }) + }) + + } } async onNextStep(){ @@ -268,6 +272,8 @@ export default class add extends React.Component{ getReseller(id).then((res)=>{ handelResponse(res,(req,msg)=>{ + console.log("分销商数据",req) + this.setState({reseller:req}) this.setState({phone_list:req.contact_phone}) this.setState({email_list:req.contact_email}) @@ -366,7 +372,62 @@ export default class add extends React.Component{ },1500) } } + onConfirm(e){ + + let plan_id = sessionStorage.getItem("plan_id") + console.log("分销商",this.state.reseller) + let plan_status = sessionStorage.getItem("plan_status"); + this.setState({audit_visible:false}) + + let approval_id = sessionStorage.getItem("approval_id") + getApprovalsStatus(approval_id).then((res)=>{ + handelResponse(res,(req,msg)=>{ + if(req.status == 0) + { + this.setState({recall_visible:true}) + } + if(req.status == 1) + { + Notify.error("进行中的计划不能提交审核") + setTimeout(()=>{ + this.props.history.push('/home/plan-list/'); + },2000) + + } + if(req.status == 2 || req.status == 3){ + let data = + { + "reseller_id":this.state.reseller.id, + "reseller_name":this.state.reseller.name, + "company_name":this.state.reseller.company_name, + "receive_email":this.state.reseller.contact_email[0], + "payment_direction":this.state.payment_direction[this.state.paytype - 1], + } + + approvals(plan_id,data).then((res)=>{ + handelResponse(res,(req,msg)=>{ + this.setState({audit_visible:false}) + Notify.success("成功发起审批") + this.props.history.push('/home/plan-list/'); + },(err)=>{ + Notify.error(err) + }) + }) + + } + + + + },(err)=>{ + Notify.error(err) + }) + }) + + + + + } phoneChange=(e)=> { @@ -381,7 +442,31 @@ export default class add extends React.Component{ } - + onPayTypeChange(e){ + console.log("渠道类型",e.target.value) + this.setState({paytype:e.target.value}) + } + onReCall(){ + let approval_id = sessionStorage.getItem("approval_id") + this.setState({recall_visible:false}) + terminateApprovals(approval_id).then((res)=>{ + handelResponse(res,(req,msg)=>{ + this.setState({approvalLoading:true}) + let timer_c = setInterval(()=>{ + console.log(this.state.timer) + if(this.state.timer <= 0) + { + clearInterval(timer_c) + this.setState({approvalLoading:false}) + } + let time = this.state.timer - 1; + this.setState({timer:time}) + },1000) + },(err)=>{ + Notify.error(err) + }) + }) + } render(){ return( @@ -477,88 +562,73 @@ export default class add extends React.Component{ { this.state.audit_visible ? ( -
-
-
- {this.cancel(e)}} /> -
审核通过
-
是否立即发送key以及解压密码?
-
-
- 接收手机号 -
-
- {this.onPhoneChange(e)}} - > - { - - this.state.phone_list.map((item, index) => { - - return { - - if(item == this.state.phone_list[this.state.phone_radio]) - { - this.setState({phone_radio:-1}) - } - - }} >{item} - - }) - - } - -
-
-
-
- 接收邮箱 -
-
- {this.onEmailChange(e)} } - > - { - this.state.email_list.map((item, index) => { - - return { - - if(item == this.state.email_list[this.state.email_radio]) - { - this.setState({email_radio:-1}) - } - - }} - - >{item} - - }) - } - -
-
-
- -1} > -
-
- -1} > -
-
- - -
-
+
+
+
+ {this.onReturn(e)}} /> +
提交审核
+
+ + {this.onPayTypeChange(e)}} value={this.state.paytype} className="audit-obj"> + 对私账户 + 对公账户 + 预付款扣除 + + +
+
+ + +
+
):null - } + + + { + + this.state.recall_visible ? ( +
+
+
+ {this.onReturn(e)}} /> +
当前正在审核中
+
+ + 是否确定撤回正在审批 + +
+
+ + +
+
+
+ ):null + } + + { + + this.state.approvalLoading ? ( +
+
+
+ {this.onReturn(e)}} /> +
撤销审批中
+
+ 正在发起撤销...,请等待{this.state.timer}秒 +
+
+
+ ):null + } + + + + +
diff --git a/src/pages/plan/add/edit.less b/src/pages/plan/add/edit.less index cd1bdab1..0fc8f307 100644 --- a/src/pages/plan/add/edit.less +++ b/src/pages/plan/add/edit.less @@ -1,3 +1,11 @@ .plan-main{ +} +.audit-box-txt{ + width: 100%; + display: flex; + align-items: center; + justify-content: center; + height: 50px; + padding-bottom: 20px; } \ No newline at end of file diff --git a/src/pages/plan/key/edit.js b/src/pages/plan/key/edit.js index 24bde0f2..2309fbb9 100644 --- a/src/pages/plan/key/edit.js +++ b/src/pages/plan/key/edit.js @@ -1,12 +1,12 @@ import ReactDOM from 'react-dom'; import React, { Component } from 'react'; import { HashRouter as Router, Route, Link } from "react-router-dom"; -import {Card,Sweetalert, Drawer,Button ,Tabs, Notify,DateRangePicker,ImageUpload,Select,Input,Checkbox,Switch ,Swiper,Dropdown,DropdownPosition,DropdownClickTrigger,Icon,MenuItem,DropdownContent,Menu,RadioGroup,RadioButton } from 'zent'; +import {Radio,Card,Sweetalert, Drawer,Button ,Tabs, Notify,DateRangePicker,ImageUpload,Select,Input,Checkbox,Switch ,Swiper,Dropdown,DropdownPosition,DropdownClickTrigger,Icon,MenuItem,DropdownContent,Menu,RadioGroup,RadioButton } from 'zent'; import Ipt from "../../../components/input/main" import Form from "../../../components/form/main" import FormItem from "../../../components/form-item/main" import Grid from "../../../components/gird/main.js" -import {addPlanStep,handelResponse,getPlanList,addKeysBatchInfo,getKeyBatchDetail,putKeyBatchDetail,uploadImg +import {addPlanStep,getApprovalsInfo,handelResponse,getPlanList,addKeysBatchInfo,getKeyBatchDetail,getReseller,putKeyBatchDetail,uploadImg,terminateApprovals,getApprovalsStatus,approvals } from "../../../assets/api.js" import Productform from "../product/add" import Bus from "../../../assets/eventBus.js" @@ -65,23 +65,39 @@ export default class acclist extends React.Component{ endtime:"", isCancel:false, rowIndex:-1, + paytype:1, + reseller:null, + payment_direction:["对私账户","对公账户","预付款扣除"], + recall_visible:false, + timer:3 } } componentDidMount(e){ let batch_id=sessionStorage.getItem("keybatch_id") - + let reseller_id =sessionStorage.getItem("key_reseller_id") + let approval_id = sessionStorage.getItem("approval_id") //编辑 if(batch_id > 0) { + + getReseller(reseller_id).then((res)=>{ + handelResponse(res,(req,msg)=>{ + console.log("分销商数据") + console.log(req) + this.setState({reseller:req}) + this.setState({phone_list:req.contact_phone}) + this.setState({email_list:req.contact_email}) + + }) + }) + this.setState({isEdit:true}) getKeyBatchDetail(batch_id).then((res)=>{ handelResponse(res,(req,msg)=>{ console.log("和编辑",req) - - // - + if(req.status == 7) { @@ -89,7 +105,7 @@ export default class acclist extends React.Component{ } this.setState({pagetitle:"编辑key"}) - + let temp = []; for(let i = 0;i < req.code_batch.length;i++) { let code_batch = req.code_batch[i]; @@ -99,9 +115,32 @@ export default class acclist extends React.Component{ let product = code_batch.product[j]; range.push(product.product_name) } + req.code_batch[i].disabled = true + req.code_batch[i].checked = true code_batch.range = range.toString(); + temp.push(req.code_batch[i]) } - + //获取审批单信息 + getApprovalsInfo(approval_id).then((res)=>{ + handelResponse(res,(req,msg)=>{ + + for(let i = 0;i < req.code_batch.length;i++) + { + let code_batch = req.code_batch[i]; + let range = [] + for(let j = 0;j < code_batch.product.length;j++) + { + let product = code_batch.product[j]; + range.push(product.product_name) + } + req.code_batch[i].disabled = false + req.code_batch[i].checked = false + code_batch.range = range.toString(); + temp.push(req.code_batch[i]) + } + + }) + }) let model = { style: req.style, @@ -118,14 +157,10 @@ export default class acclist extends React.Component{ this.setState({endtime:req.end_time}) this.setState({begintime:req.begin_time}) - let list = _.map(req.code_batch,(item)=>{ - item.disabled = true; - item.checked = true; - return item - }) - console.log(list) + + - this.setState({distdata:list}) + this.setState({distdata:temp}) // console.log(this.state.checkedList) @@ -440,28 +475,93 @@ export default class acclist extends React.Component{ this.setState({keys:keys}) } - onAudit(){ - if(this.state.isEdit) - { - let selection = this.refs.bindObj.getSelectData() - let formdata = selection.filter((item)=>{ - return !item.hasOwnProperty("disabled") - }) - - let id = sessionStorage.getItem("keybatch_id") - let data = { - code_batch:formdata - } - putKeyBatchDetail(id,data).then((res)=>{ + + + onReCall(){ + let approval_id = sessionStorage.getItem("approval_id") + this.setState({recall_visible:false}) + terminateApprovals(approval_id).then((res)=>{ handelResponse(res,(req,msg)=>{ - Notify.success("更新key成功"); - setTimeout(()=>{ - window.history.back() - },1000); + this.setState({approvalLoading:true}) + let timer_c = setInterval(()=>{ + console.log(this.state.timer) + if(this.state.timer <= 0) + { + clearInterval(timer_c) + this.setState({approvalLoading:false}) + } + let time = this.state.timer - 1; + this.setState({timer:time}) + },1000) },(err)=>{ - Notify.error(err) + Notify.error(err) }) }) + } + + onSubmit(){ + + this.setState({audit_visible:true}) + } + + + onConfirm(){ + if(this.state.isEdit) + { + this.setState({audit_visible:false}) + let approval_id = sessionStorage.getItem("approval_id") + getApprovalsStatus(approval_id).then((res)=>{ + handelResponse(res,(req,msg)=>{ + if(req.status == 0) + { + this.setState({recall_visible:true}) + } + if(req.status == 1) + { + Notify.error("进行中的批次不能提交审核") + setTimeout(()=>{ + this.props.history.push('/home/key-list/'); + },2000) + + } + if(req.status == 2 || req.status == 3){ + + + + let selection = this.refs.bindObj.getSelectData() + console.log("选中对象") + console.log(selection) + let formdata = selection.filter((item)=>{ + return !item.hasOwnProperty("disabled") || item.disabled == false + }) + + let id = sessionStorage.getItem("keybatch_id") + let data = { + code_batch:formdata, + "reseller_id":this.state.reseller.id, + "reseller_name":this.state.reseller.name, + "company_name":this.state.reseller.company_name, + "receive_email":this.state.reseller.contact_email[0], + "payment_direction":this.state.payment_direction[this.state.paytype - 1], + } + putKeyBatchDetail(id,data).then((res)=>{ + handelResponse(res,(req,msg)=>{ + Notify.success("更新key成功"); + setTimeout(()=>{ + window.history.back() + },1000); + },(err)=>{ + Notify.error(err) + }) + }) + } + },(err)=>{ + Notify.error(err) + }) + }) + + + } else{ if(this.refs.form1.validator()) @@ -938,7 +1038,7 @@ export default class acclist extends React.Component{
{ - this.state.isCancel ? null :() + this.state.isCancel ? null :() } @@ -1136,8 +1236,70 @@ export default class acclist extends React.Component{
- + { + this.state.audit_visible ? ( +
+
+
+ {this.onReturn(e)}} /> +
提交审核
+
+ + {this.onPayTypeChange(e)}} value={this.state.paytype} className="audit-obj"> + 对私账户 + 对公账户 + 预付款扣除 + + +
+
+ + +
+
+
+ ):null + } + + + + { + + this.state.recall_visible ? ( +
+
+
+ {this.setState({recall_visible:false})}} /> +
当前正在审核中
+
+ + 是否确定撤回正在审批 + +
+
+ + +
+
+
+ ):null + } + { + + this.state.approvalLoading ? ( +
+
+
+ {this.setState({approvalLoading:false})}} /> +
撤销审批中
+
+ 正在发起撤销...,请等待{this.state.timer}秒 +
+
+
+ ):null + } ) } diff --git a/src/pages/plan/key/list.js b/src/pages/plan/key/list.js index 26195e31..c12ee0cb 100644 --- a/src/pages/plan/key/list.js +++ b/src/pages/plan/key/list.js @@ -413,6 +413,8 @@ onEditRow(status,row){ ]}] sessionStorage.setItem('breakchangenav',JSON.stringify(activerou)); sessionStorage.setItem("keybatch_id",row.id) + sessionStorage.setItem("key_reseller_id",row.reseller_id) + sessionStorage.setItem("approval_id",row.approval_id) } diff --git a/src/pages/plan/list/list.js b/src/pages/plan/list/list.js index e15f377a..b03208dd 100644 --- a/src/pages/plan/list/list.js +++ b/src/pages/plan/list/list.js @@ -431,7 +431,7 @@ export default class acclist extends React.Component{ {path:'/home/key-list',name:'编辑:'+row.title} ]}] sessionStorage.setItem('breakchangenav',JSON.stringify(editarr)); - if(row.status == 2 || row.status == 6) + if( row.status == 6) { Notify.clear(); Notify.error("不可编辑") @@ -439,6 +439,7 @@ export default class acclist extends React.Component{ } sessionStorage.setItem("plan_id",row.id) sessionStorage.setItem("plan_status",row.status) + sessionStorage.setItem("approval_id",row.approval_id) let link = window.location.href.replace(window.location.hash,"#/home/plan-edit"); window.open(link, "_blank") From 102c5de273c9f5e4dfba2fe598d46c18d61ea9be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Tue, 4 Jan 2022 18:23:24 +0800 Subject: [PATCH 06/50] =?UTF-8?q?=E5=85=91=E6=8D=A2=E7=A0=81=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangecode/edit/edit.js | 138 ++++++++++++++++++++++++---- src/pages/plan/key/edit.js | 4 + 2 files changed, 125 insertions(+), 17 deletions(-) diff --git a/src/pages/exchangecode/edit/edit.js b/src/pages/exchangecode/edit/edit.js index 10c3af9f..a11527d7 100644 --- a/src/pages/exchangecode/edit/edit.js +++ b/src/pages/exchangecode/edit/edit.js @@ -5,7 +5,7 @@ import Form from "../../../components/form/main" import FormItem from "../../../components/form-item/main" import {Card,Radio,Icon, Drawer, Select,Button,ImageUpload ,DateRangePicker,onUpload,Sweetalert,RadioButton,RadioGroup,Notify,Input,CombinedDateRangePicker} from "zent" import Bus from "../../../assets/eventBus.js" -import {getApprovalsStatus,getApprovalsInfo,terminateApprovals,getProductInfoSelect,handelResponse,uploadImg,getCodeProduct,putCodeProduct,getCodesDetail,putCodes,putCodesBatch} from "../../../assets/api.js" +import {getApprovalsStatus,getReseller,getApprovalsInfo,terminateApprovals,getProductInfoSelect,handelResponse,uploadImg,getCodeProduct,putCodeProduct,getCodesDetail,putCodes,putCodesBatch} from "../../../assets/api.js" import _ from "lodash"; import Productform from "../product/add" import "./edit.less" @@ -44,6 +44,8 @@ export default class exchangedit extends React.Component{ isload:false, tempdata:[], oldProduct:[], + deleteProduct:[], //审批删除的商品 + new_product:[], cur_product:null, productOption:[], rankoptions:[], @@ -73,27 +75,50 @@ export default class exchangedit extends React.Component{ getApprovalsInfo(approval_id).then(res=>{ handelResponse(res,(req,msg)=>{ + let resller_obj = { + id:req.reseller_id, + name:req.reseller_name, + company_name:req.company_name, + receive_email:req.receive_email + } + this.setState({reseller:resller_obj}) + let codeInfo={ code_name:req.title, issued:req.quantity, stock:req.stock, describe:req.describe, date_time:[req.begin_time,req.end_time], - range:req.code_batch_stock + range:req.update_product } + if(req.new_product.length > 0) + { + codeInfo.range = codeInfo.range.concat(req.new_product); + } + + let new_ids = _.map(req.new_product,(o)=>{ + return o.product_id; + }) + + + this.setState({new_product:new_ids}) + this.setState({codeInfo:codeInfo}) this.setState({isload:true}); - let table = _.map(req.code_batch_stock,(res)=>{ + let table = _.map(codeInfo.range,(res)=>{ res.checked = true; return res }); - this.setState({tempdata:req.code_batch_stock }) + + this.setState({deleteProduct:req.delete_product}) + + this.setState({tempdata:codeInfo.range}) let arr = []; - _.map(req.code_batch_stock,(res)=>{ + _.map(codeInfo.range,(res)=>{ let obj = {}; obj.key = res.product_id; obj.text= res.product_name; @@ -122,6 +147,22 @@ export default class exchangedit extends React.Component{ date_time:[req.begin_time,req.end_time], range:req.code_batch_stock } + console.log(111) + console.log("计划任务的分销商id") + console.log(req.plan.reseller_id) + + //获取分销商 + getReseller(req.plan.reseller_id).then((res)=>{ + handelResponse(res,(req,msg)=>{ + console.log("获取分销商",req) + req.receive_email = req.contact_email[0] + this.setState({reseller:req}) + this.setState({phone_list:req.contact_phone}) + this.setState({email_list:req.contact_email}) + }) + }) + + this.setState({codeInfo:codeInfo}) this.setState({isload:true}); @@ -185,10 +226,10 @@ export default class exchangedit extends React.Component{ let range = [] _.map(this.state.rank,(o)=>{ - if(this.state.oldProduct.indexOf(o.key) < 0) - { + // if(this.state.oldProduct.indexOf(o.key) < 0) + // { range.push(o.text) ; - } + // } }) console.log("范围",this.state.rank) console.log("旧商品",this.state.oldProduct) @@ -227,11 +268,75 @@ export default class exchangedit extends React.Component{ let deleteProduct= _.differenceWith(this.state.oldProduct, updateIds, _.isEqual); + + console.log("分销商",this.state.reseller) + + + // _.filter(deleteProduct,(item)=>{ + // this.state.new_product.indexOf(item) + // }) + + + + deleteProduct = deleteProduct.filter((item)=>{return this.state.new_product.indexOf(item) < 0}) + console.log(this.state.new_product) + if(this.state.deleteProduct.length > 0) + { + deleteProduct = deleteProduct.concat(this.state.deleteProduct).map(Number) + } + + + console.log("新增商品",addProduct) + console.log(deleteProduct) + + let temp = addProduct.filter((item)=>{ + return deleteProduct.indexOf(item.product_id) > -1 + }) + let tempIds = _.map(temp,(item)=>{ + return item.product_id + }) + + if(temp.length > 0) + { + + + addProduct = addProduct.filter((item)=>{ + return tempIds.indexOf(item.product_id) < 0 + }) + + console.log("新增",addProduct) + + let updateAdd =_.filter(addProduct,(item)=>{ + + return deleteProduct.indexOf(item.product_id) > -1 + }) + + + + + + + updateProduct = updateProduct.concat(updateAdd); + + } + + + + updateIds = _.map(updateProduct,(o)=>{ + return o.product_id; + }) + + + deleteProduct = _.filter(deleteProduct,(o)=>{ + return updateIds.indexOf(o) < 0 + }) + + let data ={ - "reseller_id":"15", - "reseller_name":"熊大的分销商", - "company_name":"数字世界", - "receive_email":"2371536879@qq.com", + "reseller_id":this.state.reseller.id, + "reseller_name":this.state.reseller.name, + "company_name":this.state.reseller.company_name, + "receive_email":this.state.reseller.receive_email, "payment_direction":this.state.payment_direction[this.state.paytype - 1], "title": this.state.codeInfo.code_name, "range": range, @@ -267,6 +372,7 @@ export default class exchangedit extends React.Component{ submit(){ + if(this.refs.code_info.validator() && this.refs.code_rule.validator() ) { if(this.state.uploading ) @@ -275,14 +381,13 @@ export default class exchangedit extends React.Component{ Notify.error("还有图片上传中,不可提交") return } - - this.setState({audit_visible:true}) } } onConfirm(){ let approval_id = sessionStorage.getItem("approval_id") + this.setState({audit_visible:false}) if(approval_id <= 0) { this.submitCodeData(); @@ -356,8 +461,6 @@ export default class exchangedit extends React.Component{ { this.setState({drawerVisible2:false}) setTimeout(()=>{ - console.log("获取到商品456456") - console.log(sessionStorage.getItem("productData")); let data = JSON.parse(sessionStorage.getItem("productData")); @@ -567,6 +670,7 @@ export default class exchangedit extends React.Component{ { clearInterval(timer_c) this.setState({approvalLoading:false}) + Notify.success("撤销成功,请重新提交审核") } let time = this.state.timer - 1; this.setState({timer:time}) @@ -911,7 +1015,7 @@ export default class exchangedit extends React.Component{ {this.setState({approvalLoading:false})}} />
撤销审批中
- 正在发起撤销...,请等待{this.state.timer}秒 + 正在发起撤销...,请等待 {this.state.timer}
diff --git a/src/pages/plan/key/edit.js b/src/pages/plan/key/edit.js index 2309fbb9..32a61d26 100644 --- a/src/pages/plan/key/edit.js +++ b/src/pages/plan/key/edit.js @@ -781,6 +781,10 @@ export default class acclist extends React.Component{ } return isdisabled } + onPayTypeChange(e){ + console.log("渠道类型",e.target.value) + this.setState({paytype:e.target.value}) + } render(){ From 0b1bf84d5e918e5a8edc46dc99b2d73e0d8a951d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Wed, 5 Jan 2022 09:52:10 +0800 Subject: [PATCH 07/50] =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/api.js | 70 +++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/src/assets/api.js b/src/assets/api.js index 4f5b5cac..f9a268a9 100644 --- a/src/assets/api.js +++ b/src/assets/api.js @@ -281,12 +281,12 @@ export const handelResponse = (res, cb, errCb) => { } //营销计划列表 export const getPlanList = (params) => { - return req('get', "http://192.168.6.165:8080" + "/plan", params) + return req('get', baseurl + "/plan", params) } //获取key批次列表 export const getKeyList = (params) => { - return req('get', "http://192.168.6.165:8080" + "/keys", params) + return req('get', baseurl + "/keys", params) } //获取分销商下拉菜单 export const getReSellerOption = (params) => { @@ -304,60 +304,60 @@ export const addPlanStep = (id, params) => { let str = id ? "/"+id :"" if(str) { - return req('put',"http://192.168.6.165:8080" + "/plan/step" + str, params) + return req('put',baseurl + "/plan/step" + str, params) } - return req('post', "http://192.168.6.165:8080" + "/plan/step" + str, params) + return req('post', baseurl + "/plan/step" + str, params) } //获取营销计划草稿信息 export const getDraftInfo = (id, params) => { - return req('get', "http://192.168.6.165:8080" + "/plan/draft/" + id, params) + return req('get', baseurl + "/plan/draft/" + id, params) } //启用停用 营销计划 export const startOrStopPlan = (id, params) => { - return req('put', "http://192.168.6.165:8080" + "/plan/status/" + id, params) + return req('put', baseurl + "/plan/status/" + id, params) } //创建key批次信息 export const addKeysBatchInfo = (id, params) => { - return req('post', "http://192.168.6.165:8080" + "/plan/" + id + "/keys", params) + return req('post', baseurl + "/plan/" + id + "/keys", params) } //编辑修改 export const putPlanStep = (id, params) => { - return req('put', "http://192.168.6.165:8080" + "/plan/edit/"+id,params) + return req('put', baseurl + "/plan/edit/"+id,params) } //获取key批次信息 export const getKeysBatchInfo = (id, params) => { - return req('get', "http://192.168.6.165:8080" + "/keys", params) + return req('get', baseurl + "/keys", params) } //启用停用key批次信息 export const startOrStopKeybatch = (id, params) => { - return req('put', "http://192.168.6.165:8080" + "/keys/status/" + id, params) + return req('put', baseurl + "/keys/status/" + id, params) } //获取key批次详细信息 export const getKeyBatchDetail = (id, params) => { - return req('get', "http://192.168.6.165:8080" + "/keys/" + id, params) + return req('get', baseurl + "/keys/" + id, params) } //更新key批次详细信息 export const putKeyBatchDetail = (id, params) => { - return req('put', "http://192.168.6.165:8080" + "/keys/" + id, params) + return req('put', baseurl + "/keys/" + id, params) } //发送key批次压缩包和压缩包密码 export const planSend = (id, params) => { - return req('put', "http://192.168.6.165:8080" + "/plan/send/" + id, params) + return req('put', baseurl + "/plan/send/" + id, params) } //是否已经发送过邮件 export const planIsSend = (id) => { - return req('get', "http://192.168.6.165:8080" + "/plan/is_send/" + id) + return req('get', baseurl + "/plan/is_send/" + id) } @@ -366,39 +366,39 @@ export const planIsSend = (id) => { //重新修改手机号邮箱 export const planReceive = (id, params) => { - return req('put', "http://192.168.6.165:8080" + "/plan/receive/" + id, params) + return req('put', baseurl + "/plan/receive/" + id, params) } //重新发送key批次压缩包和压缩包密码 export const planResend = (id, params) => { - return req('put', "http://192.168.6.165:8080" + "/plan/resend/" + id, params) + return req('put', baseurl + "/plan/resend/" + id, params) } export const keysIsSend = (id, params) => { - return req('get', "http://192.168.6.165:8080" + "/keys/is_send/" + id, params) + return req('get', baseurl + "/keys/is_send/" + id, params) } //作废key批次 export const cancelKey = (id, params) => { - return req('put', "http://192.168.6.165:8080" + "/keys/cancel/" + id, params) + return req('put', baseurl + "/keys/cancel/" + id, params) } //发送密钥邮件 export const postKeyEmail = (id, params) => { - return req('put', "http://192.168.6.165:8080" + "/keys/send/" + id, params) + return req('put', baseurl + "/keys/send/" + id, params) } //修改密钥邮件 export const putKeyEmail = (id, params) => { - return req('put', "http://192.168.6.165:8080" + "/keys/receive/" + id, params) + return req('put', baseurl + "/keys/receive/" + id, params) } export const resKeyEmail = (id, params) => { - return req('put', "http://192.168.6.165:8080" + "/keys/resend/" + id, params) + return req('put', baseurl + "/keys/resend/" + id, params) } @@ -406,17 +406,17 @@ export const resKeyEmail = (id, params) => { // 兑换码管理 //兑换码管理列表 export const getCodesList = (params) => { - return getData('get', "http://192.168.6.165:8080" + "/codes", params) + return getData('get', baseurl + "/codes", params) } //获取兑换码明细 export const getCodesDetail = (id) => { - return req('get', "http://192.168.6.165:8080" + "/codes/"+id) + return req('get', baseurl + "/codes/"+id) } //修改兑换码批次 export const putCodesBatch = (id,params) => { - return req('put', "http://192.168.6.165:8080" + "/codes/edit/"+id,params) + return req('put', baseurl + "/codes/edit/"+id,params) } @@ -425,39 +425,39 @@ export const putCodesBatch = (id,params) => { //更新兑换码 export const putCodes = (id,params) => { - return req('put', "http://192.168.6.165:8080" + "/codes/"+id,params) + return req('put', baseurl + "/codes/"+id,params) } //作废本批次兑换码 export const delCode = (id) => { - return req('delete', "http://192.168.6.165:8080" + "/codes/discard/"+id) + return req('delete', baseurl + "/codes/discard/"+id) } //作废本批次兑换码 export const putCodeStatus = (id,params) => { - return req('put', "http://192.168.6.165:8080" + "/codes/status/"+id,params) + return req('put', baseurl + "/codes/status/"+id,params) } //兑换码商品列表 export const getCodeProductList = (params) => { - return req('get', "http://192.168.6.165:8080" + "/codes/products",params) + return req('get', baseurl + "/codes/products",params) } //删除商品库存信息 export const delCodeProduct = (batch_id,id) => { - return req('delete', "http://192.168.6.165:8080" + "/codes/products/"+batch_id+"/"+id) + return req('delete', baseurl + "/codes/products/"+batch_id+"/"+id) } //更新单个商品信息 export const putCodeProduct = (batch_id,id,params) => { - return req('put', "http://192.168.6.165:8080" + "/codes/products/"+batch_id+"/"+id,params) + return req('put', baseurl + "/codes/products/"+batch_id+"/"+id,params) } //获取商品库存明细 export const getCodeProduct = (batch_id,id) => { - return req('get', "http://192.168.6.165:8080" + "/codes/products/"+batch_id+"/"+id) + return req('get', baseurl + "/codes/products/"+batch_id+"/"+id) } @@ -842,22 +842,22 @@ export const getkeyDetailList= (id,data) => { //提交审核 export const approvals= (id,data) => { - return req('post', "http://192.168.6.165:8080" + "/plan/"+id+"/approvals",data) + return req('post', baseurl + "/plan/"+id+"/approvals",data) } export const getApprovalsInfo= (id,data) => { - return req('get', "http://192.168.6.165:8080" + "/approvals/"+id+"/market_approval_data",data) + return req('get', baseurl + "/approvals/"+id+"/market_approval_data",data) } export const terminateApprovals= (id,data) => { - return req('put', "http://192.168.6.165:8080" + "/approvals/"+id+"/terminate",data) + return req('put', baseurl + "/approvals/"+id+"/terminate",data) } export const getApprovalsStatus= (id,data) => { - return req('get', "http://192.168.6.165:8080" + "/approvals/"+id+"/status") + return req('get', baseurl + "/approvals/"+id+"/status") } From 74c72edc356a0d2503e26cba13915b1edbdc0048 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Wed, 5 Jan 2022 13:28:58 +0800 Subject: [PATCH 08/50] =?UTF-8?q?=E5=AE=A1=E6=89=B9=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangecode/edit/edit.js | 1 - src/pages/plan/add/edit.js | 52 +++++-- src/pages/plan/add/step3.js | 31 +++- src/pages/plan/key/edit.js | 216 ++++++++++++++++------------ 4 files changed, 197 insertions(+), 103 deletions(-) diff --git a/src/pages/exchangecode/edit/edit.js b/src/pages/exchangecode/edit/edit.js index a11527d7..0818f6af 100644 --- a/src/pages/exchangecode/edit/edit.js +++ b/src/pages/exchangecode/edit/edit.js @@ -1012,7 +1012,6 @@ export default class exchangedit extends React.Component{
- {this.setState({approvalLoading:false})}} />
撤销审批中
正在发起撤销...,请等待 {this.state.timer} 秒 diff --git a/src/pages/plan/add/edit.js b/src/pages/plan/add/edit.js index f0a5154a..682617b7 100644 --- a/src/pages/plan/add/edit.js +++ b/src/pages/plan/add/edit.js @@ -7,7 +7,7 @@ import Step1 from "./step1.js" import Step2 from "./step2.js" import Step3 from "./step3.js" import _ from "lodash"; -import {addPlanStep,handelResponse,getReseller,planSend,getDraftInfo,putPlanStep,uploadImg,getApprovalsInfo,approvals,terminateApprovals,getApprovalsStatus} from "../../../assets/api.js" +import {getThemeChoice,addPlanStep,handelResponse,getReseller,planSend,getDraftInfo,putPlanStep,uploadImg,getApprovalsInfo,approvals,terminateApprovals,getApprovalsStatus} from "../../../assets/api.js" export default class add extends React.Component{ constructor(props){ @@ -42,6 +42,7 @@ export default class add extends React.Component{ payment_direction:["对私账户","对公账户","预付款扣除"], approvalLoading:false, timer:3, + theme_options:[] } } @@ -79,7 +80,7 @@ export default class add extends React.Component{ let approval_id = sessionStorage.getItem("approval_id") //获取审批接口的编辑信息 - if(approval_id !=0) + if(approval_id > 0) { getApprovalsInfo(approval_id).then((res)=>{ handelResponse(res,(req,msg)=>{ @@ -110,10 +111,26 @@ export default class add extends React.Component{ },500) } - else{ + if(req.theme) + { + + + let theme_data ={ + + theme_id:req.theme.theme_id, + use:req.theme.theme_data.use, + link:req.theme.theme_data.link, + list:req.theme.theme_data.list + + } + this.getThemeData(); + console.log("样式数据",theme_data) + this.setState({step3_data:theme_data}) this.setState({card_visible : true}) + this.setState({curstep:3}) } + },(err)=>{ Notify.error(err) }) @@ -296,6 +313,23 @@ export default class add extends React.Component{ } } + + getThemeData(){ + + getThemeChoice().then((res)=>{ + handelResponse(res,(req,msg)=>{ + let arr = _.map(req,(o)=>{ + let obj = {}; + obj.key = o.id; + obj.text = o.title + return obj + }) + + this.setState({theme_options:arr}) + },(err)=>{ + }) + }) + } addNewkey(){ let step = "step2-" + this.state.keys.length this.state.keys.push(step) @@ -535,7 +569,7 @@ export default class add extends React.Component{ this.state.card_visible ? (
- +
) : null @@ -565,7 +599,7 @@ export default class add extends React.Component{
- {this.onReturn(e)}} /> + {this.setState({audit_visible:false})}} />
提交审核
@@ -577,7 +611,7 @@ export default class add extends React.Component{
- +
@@ -615,11 +649,11 @@ export default class add extends React.Component{
- {this.onReturn(e)}} /> -
撤销审批中
+
撤销审批中
- 正在发起撤销...,请等待{this.state.timer}秒 + 正在发起撤销...,请等待 {this.state.timer}
+
):null diff --git a/src/pages/plan/add/step3.js b/src/pages/plan/add/step3.js index 15348279..9575a5e5 100644 --- a/src/pages/plan/add/step3.js +++ b/src/pages/plan/add/step3.js @@ -15,20 +15,30 @@ const TabPanel = Tabs.TabPanel; export default class acclist extends React.Component{ constructor(props){ super(props) + console.log(props) + + + + + this.state={ model:{ //数据模型不可少 - "theme_id": "", + "theme_id":"", "list": 2, "use": 1, "link": 3, }, - options:[] + select_theme:null } + + + + } componentDidMount(e){ - this.getThemeData(); + this.getThemeData(); } @@ -44,6 +54,19 @@ export default class acclist extends React.Component{ }) this.setState({options:arr}) + + if(this.props.data && this.props.data.theme_id) + { + this.setState({theme_id:this.props.data.theme_id}) + + let selctobj = this.state.options.find(o=>o.key == this.props.data.theme_id) + + let model = this.state.model; + model.theme_id = selctobj + this.setState({model:model}) + } + + },(err)=>{ }) }) @@ -101,7 +124,7 @@ export default class acclist extends React.Component{ edit(data) { let model={ //数据模型不可少 - "theme_id": data.theme_id, + "theme_id":192 , "list": data.list, "use": data.use, "link": data.link diff --git a/src/pages/plan/key/edit.js b/src/pages/plan/key/edit.js index 32a61d26..32bd730a 100644 --- a/src/pages/plan/key/edit.js +++ b/src/pages/plan/key/edit.js @@ -121,26 +121,30 @@ export default class acclist extends React.Component{ temp.push(req.code_batch[i]) } //获取审批单信息 - getApprovalsInfo(approval_id).then((res)=>{ - handelResponse(res,(req,msg)=>{ - - for(let i = 0;i < req.code_batch.length;i++) - { - let code_batch = req.code_batch[i]; - let range = [] - for(let j = 0;j < code_batch.product.length;j++) - { - let product = code_batch.product[j]; - range.push(product.product_name) - } - req.code_batch[i].disabled = false - req.code_batch[i].checked = false - code_batch.range = range.toString(); - temp.push(req.code_batch[i]) - } - - }) - }) + if(approval_id > 0) + { + getApprovalsInfo(approval_id).then((res)=>{ + handelResponse(res,(req,msg)=>{ + + for(let i = 0;i < req.code_batch.length;i++) + { + let code_batch = req.code_batch[i]; + let range = [] + for(let j = 0;j < code_batch.product.length;j++) + { + let product = code_batch.product[j]; + range.push(product.product_name) + } + req.code_batch[i].disabled = false + req.code_batch[i].checked = false + code_batch.range = range.toString(); + temp.push(req.code_batch[i]) + } + + }) + }) + } + let model = { style: req.style, @@ -477,26 +481,32 @@ export default class acclist extends React.Component{ } - onReCall(){ + onReCall(){ + let approval_id = sessionStorage.getItem("approval_id") this.setState({recall_visible:false}) - terminateApprovals(approval_id).then((res)=>{ - handelResponse(res,(req,msg)=>{ - this.setState({approvalLoading:true}) - let timer_c = setInterval(()=>{ - console.log(this.state.timer) - if(this.state.timer <= 0) - { - clearInterval(timer_c) - this.setState({approvalLoading:false}) - } - let time = this.state.timer - 1; - this.setState({timer:time}) - },1000) - },(err)=>{ - Notify.error(err) - }) - }) + if(approval_id > 0) + { + terminateApprovals(approval_id).then((res)=>{ + handelResponse(res,(req,msg)=>{ + this.setState({approvalLoading:true}) + let timer_c = setInterval(()=>{ + console.log(this.state.timer) + if(this.state.timer <= 0) + { + clearInterval(timer_c) + this.setState({approvalLoading:false}) + } + let time = this.state.timer - 1; + this.setState({timer:time}) + },1000) + },(err)=>{ + Notify.error(err) + }) + }) + + } + } onSubmit(){ @@ -508,60 +518,88 @@ export default class acclist extends React.Component{ onConfirm(){ if(this.state.isEdit) { - this.setState({audit_visible:false}) + this.setState({audit_visible:false}) let approval_id = sessionStorage.getItem("approval_id") - getApprovalsStatus(approval_id).then((res)=>{ - handelResponse(res,(req,msg)=>{ - if(req.status == 0) - { - this.setState({recall_visible:true}) - } - if(req.status == 1) - { - Notify.error("进行中的批次不能提交审核") - setTimeout(()=>{ - this.props.history.push('/home/key-list/'); - },2000) - - } - if(req.status == 2 || req.status == 3){ - - - - let selection = this.refs.bindObj.getSelectData() - console.log("选中对象") - console.log(selection) - let formdata = selection.filter((item)=>{ - return !item.hasOwnProperty("disabled") || item.disabled == false - }) - - let id = sessionStorage.getItem("keybatch_id") - let data = { - code_batch:formdata, - "reseller_id":this.state.reseller.id, - "reseller_name":this.state.reseller.name, - "company_name":this.state.reseller.company_name, - "receive_email":this.state.reseller.contact_email[0], - "payment_direction":this.state.payment_direction[this.state.paytype - 1], + if(approval_id > 0) + { + getApprovalsStatus(approval_id).then((res)=>{ + handelResponse(res,(req,msg)=>{ + if(req.status == 0) + { + this.setState({recall_visible:true}) } - putKeyBatchDetail(id,data).then((res)=>{ - handelResponse(res,(req,msg)=>{ - Notify.success("更新key成功"); + if(req.status == 1) + { + Notify.error("进行中的批次不能提交审核") setTimeout(()=>{ - window.history.back() - },1000); - },(err)=>{ - Notify.error(err) - }) - }) - } + this.props.history.push('/home/key-list/'); + },2000) + + } + if(req.status == 2 || req.status == 3){ + + + + let selection = this.refs.bindObj.getSelectData() + console.log("选中对象") + console.log(selection) + let formdata = selection.filter((item)=>{ + return !item.hasOwnProperty("disabled") || item.disabled == false + }) + + let id = sessionStorage.getItem("keybatch_id") + let data = { + code_batch:formdata, + "reseller_id":this.state.reseller.id, + "reseller_name":this.state.reseller.name, + "company_name":this.state.reseller.company_name, + "receive_email":this.state.reseller.contact_email[0], + "payment_direction":this.state.payment_direction[this.state.paytype - 1], + } + putKeyBatchDetail(id,data).then((res)=>{ + handelResponse(res,(req,msg)=>{ + Notify.success("更新key成功"); + setTimeout(()=>{ + window.history.back() + },1000); + },(err)=>{ + Notify.error(err) + }) + }) + } + },(err)=>{ + Notify.error(err) + }) + }) + } + else{ + let selection = this.refs.bindObj.getSelectData() + console.log("选中对象") + console.log(selection) + let formdata = selection.filter((item)=>{ + return !item.hasOwnProperty("disabled") || item.disabled == false + }) + + let id = sessionStorage.getItem("keybatch_id") + let data = { + code_batch:formdata, + "reseller_id":this.state.reseller.id, + "reseller_name":this.state.reseller.name, + "company_name":this.state.reseller.company_name, + "receive_email":this.state.reseller.contact_email[0], + "payment_direction":this.state.payment_direction[this.state.paytype - 1], + } + putKeyBatchDetail(id,data).then((res)=>{ + handelResponse(res,(req,msg)=>{ + Notify.success("更新key成功"); + setTimeout(()=>{ + window.history.back() + },1000); },(err)=>{ - Notify.error(err) + Notify.error(err) }) }) - - - + } } else{ if(this.refs.form1.validator()) @@ -1246,7 +1284,7 @@ export default class acclist extends React.Component{
- {this.onReturn(e)}} /> + {this.setState({audit_visible:false})}} />
提交审核
@@ -1258,7 +1296,7 @@ export default class acclist extends React.Component{
- +
@@ -1298,7 +1336,7 @@ export default class acclist extends React.Component{ {this.setState({approvalLoading:false})}} />
撤销审批中
- 正在发起撤销...,请等待{this.state.timer}秒 + 正在发起撤销...,请等待 {this.state.timer}
From aff6b5b463c6a56e175f1bea4316772c97474cda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Wed, 5 Jan 2022 14:08:39 +0800 Subject: [PATCH 09/50] =?UTF-8?q?key=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/api.js | 2 +- src/assets/enum.js | 11 +++++++++++ src/pages/plan/key/detail/list.js | 16 ++++++++-------- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/assets/api.js b/src/assets/api.js index f9a268a9..36243158 100644 --- a/src/assets/api.js +++ b/src/assets/api.js @@ -836,7 +836,7 @@ export const delSystemTemplate= (id) => { //key码列表 export const getkeyDetailList= (id,data) => { - return req('get', baseurl + "/key/"+id,data) + return req('get', "http://192.168.6.98:8000" + "/key/"+id,data) } diff --git a/src/assets/enum.js b/src/assets/enum.js index 6b0b1303..6072510a 100644 --- a/src/assets/enum.js +++ b/src/assets/enum.js @@ -58,12 +58,23 @@ const menu={ case 7:return '#b6bcb8';break; } }, + //计划任务状态 + keyStatus(params) { + switch(params){ + case 1:return '待使用';break; + case 2:return '已使用';break; + case 3:return '已失效';break; + case 4:return '已作废';break; + case 5:return '使用锁定中';break; + } + }, keyStatusBg(params) { switch(params){ case 1:return '#BFBFBF';break; case 2:return '#43A65D';break; case 3:return '#ffaa00';break; case 4:return '#e64c00';break; + case 5:return '#3575C7'; break; } }, diff --git a/src/pages/plan/key/detail/list.js b/src/pages/plan/key/detail/list.js index 7b1474bd..e3b53062 100644 --- a/src/pages/plan/key/detail/list.js +++ b/src/pages/plan/key/detail/list.js @@ -209,13 +209,13 @@ export default class acclist extends React.Component{ prop:'plan_title', name: 'plan_title', }, - // { - // title: '状态', - // prop:'status', - // name: 'status', - // width:'auto', - // type: "slot", - // }, + { + title: '状态', + prop:'status', + name: 'status', + width:'auto', + type: "slot", + }, { title: '使用量', name: 'usage', @@ -308,7 +308,7 @@ export default class acclist extends React.Component{ } if(com == "status") { - return

{rowData.status_text}

+ return

{ menu.keyStatus(parseInt(rowData.status))}

} if(com == "opearo") { From c2a4dee1e2e414cbe7f749af6128473dc07bfc10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Wed, 5 Jan 2022 15:06:48 +0800 Subject: [PATCH 10/50] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangecode/add/add.js | 7 +++--- src/pages/exchangecode/edit/edit.js | 22 +++++++++++------ src/pages/plan/add/add.js | 7 +++--- src/pages/plan/add/edit.js | 38 ++++++++++++----------------- src/pages/plan/add/edit.less | 2 +- src/pages/plan/add/step3.js | 6 ----- src/pages/plan/key/edit.js | 19 +++++++++++---- 7 files changed, 53 insertions(+), 48 deletions(-) diff --git a/src/pages/exchangecode/add/add.js b/src/pages/exchangecode/add/add.js index 878743ad..e15d59f8 100644 --- a/src/pages/exchangecode/add/add.js +++ b/src/pages/exchangecode/add/add.js @@ -71,7 +71,7 @@ export default class acclist extends React.Component{ email_list:[], email_radio:-1, phone_radio:-1, - paytype:1, + paytype:3, reseller:null, payment_direction:["对私账户","对公账户","预付款扣除"], @@ -1190,9 +1190,10 @@ export default class acclist extends React.Component{
{this.onPayTypeChange(e)}} value={this.state.paytype} className="audit-obj"> - 对私账户 + 预付款扣除 + 对私账户 对公账户 - 预付款扣除 +
diff --git a/src/pages/exchangecode/edit/edit.js b/src/pages/exchangecode/edit/edit.js index 0818f6af..b5131984 100644 --- a/src/pages/exchangecode/edit/edit.js +++ b/src/pages/exchangecode/edit/edit.js @@ -53,7 +53,7 @@ export default class exchangedit extends React.Component{ recall_visible:false, approvalLoading:false, timer:3, - paytype:1, + paytype:3, reseller:null, payment_direction:["对私账户","对公账户","预付款扣除"], @@ -129,6 +129,15 @@ export default class exchangedit extends React.Component{ this.setState({rankoptions:arr}) this.setState({rank:arr}) + + + if(req.payment_direction) + { + let index = this.state.payment_direction.indexOf(req.payment_direction) + this.setState({paytype: index+1}) + } + + },(err)=>{ }) @@ -147,10 +156,6 @@ export default class exchangedit extends React.Component{ date_time:[req.begin_time,req.end_time], range:req.code_batch_stock } - console.log(111) - console.log("计划任务的分销商id") - console.log(req.plan.reseller_id) - //获取分销商 getReseller(req.plan.reseller_id).then((res)=>{ handelResponse(res,(req,msg)=>{ @@ -971,9 +976,10 @@ export default class exchangedit extends React.Component{
{this.onPayTypeChange(e)}} value={this.state.paytype} className="audit-obj"> - 对私账户 + 预付款扣除 + 对私账户 对公账户 - 预付款扣除 +
@@ -995,7 +1001,7 @@ export default class exchangedit extends React.Component{
当前正在审核中
- 是否确定撤回正在审批 + 提交审核会将原来审批撤回才可进行提交,是否撤回?
diff --git a/src/pages/plan/add/add.js b/src/pages/plan/add/add.js index d04e701f..45ee8792 100644 --- a/src/pages/plan/add/add.js +++ b/src/pages/plan/add/add.js @@ -32,7 +32,7 @@ export default class add extends React.Component{ audit_visible:false, card_visible:false, step1:null, - paytype:1, + paytype:3, reseller:"", payment_direction:["对私账户","对公账户","预付款扣除"] } @@ -387,9 +387,10 @@ export default class add extends React.Component{
{this.onPayTypeChange(e)}} value={this.state.paytype} className="audit-obj"> - 对私账户 + 预付款扣除 + 对私账户 对公账户 - 预付款扣除 +
diff --git a/src/pages/plan/add/edit.js b/src/pages/plan/add/edit.js index 682617b7..e70cba57 100644 --- a/src/pages/plan/add/edit.js +++ b/src/pages/plan/add/edit.js @@ -37,7 +37,7 @@ export default class add extends React.Component{ step3_data:null, disabled:false, disabled_time:false, - paytype:1, + paytype:3, reseller:null, payment_direction:["对私账户","对公账户","预付款扣除"], approvalLoading:false, @@ -123,12 +123,20 @@ export default class add extends React.Component{ list:req.theme.theme_data.list } - this.getThemeData(); + console.log("样式数据",theme_data) this.setState({step3_data:theme_data}) this.setState({card_visible : true}) this.setState({curstep:3}) } + if(req.payment_direction) + { + console.log(req.payment_direction) + let index = this.state.payment_direction.indexOf(req.payment_direction) + console.log("对应的下标",index) + this.setState({paytype: index+1}) + console.log(this.state.paytype) + } },(err)=>{ @@ -295,7 +303,7 @@ export default class add extends React.Component{ this.setState({phone_list:req.contact_phone}) this.setState({email_list:req.contact_email}) this.setState({audit_visible:true}) - + console.log(this.state.paytype) }) }) @@ -314,22 +322,6 @@ export default class add extends React.Component{ } - getThemeData(){ - - getThemeChoice().then((res)=>{ - handelResponse(res,(req,msg)=>{ - let arr = _.map(req,(o)=>{ - let obj = {}; - obj.key = o.id; - obj.text = o.title - return obj - }) - - this.setState({theme_options:arr}) - },(err)=>{ - }) - }) - } addNewkey(){ let step = "step2-" + this.state.keys.length this.state.keys.push(step) @@ -492,6 +484,7 @@ export default class add extends React.Component{ { clearInterval(timer_c) this.setState({approvalLoading:false}) + Notify.success("撤销成功,请重新提交审核") } let time = this.state.timer - 1; this.setState({timer:time}) @@ -604,9 +597,10 @@ export default class add extends React.Component{
{this.onPayTypeChange(e)}} value={this.state.paytype} className="audit-obj"> + 预付款扣除 对私账户 对公账户 - 预付款扣除 +
@@ -628,10 +622,10 @@ export default class add extends React.Component{
{this.onReturn(e)}} /> -
当前正在审核中
+
审核中
- 是否确定撤回正在审批 + 提交审核会将原来审批撤回才可进行提交,是否撤回?
diff --git a/src/pages/plan/add/edit.less b/src/pages/plan/add/edit.less index 0fc8f307..0d685346 100644 --- a/src/pages/plan/add/edit.less +++ b/src/pages/plan/add/edit.less @@ -7,5 +7,5 @@ align-items: center; justify-content: center; height: 50px; - padding-bottom: 20px; + padding-bottom: 40px; } \ No newline at end of file diff --git a/src/pages/plan/add/step3.js b/src/pages/plan/add/step3.js index 9575a5e5..b76972ff 100644 --- a/src/pages/plan/add/step3.js +++ b/src/pages/plan/add/step3.js @@ -15,12 +15,6 @@ const TabPanel = Tabs.TabPanel; export default class acclist extends React.Component{ constructor(props){ super(props) - console.log(props) - - - - - this.state={ model:{ //数据模型不可少 "theme_id":"", diff --git a/src/pages/plan/key/edit.js b/src/pages/plan/key/edit.js index 32bd730a..e3fb7ccd 100644 --- a/src/pages/plan/key/edit.js +++ b/src/pages/plan/key/edit.js @@ -65,7 +65,7 @@ export default class acclist extends React.Component{ endtime:"", isCancel:false, rowIndex:-1, - paytype:1, + paytype:3, reseller:null, payment_direction:["对私账户","对公账户","预付款扣除"], recall_visible:false, @@ -140,7 +140,15 @@ export default class acclist extends React.Component{ code_batch.range = range.toString(); temp.push(req.code_batch[i]) } - + + if(req.payment_direction) + { + console.log(req.payment_direction) + let index = this.state.payment_direction.indexOf(req.payment_direction) + console.log("对应的下标",index) + this.setState({paytype: index+1}) + console.log(this.state.paytype) + } }) }) } @@ -496,6 +504,7 @@ export default class acclist extends React.Component{ { clearInterval(timer_c) this.setState({approvalLoading:false}) + Notify.success("撤销成功,请重新提交审核") } let time = this.state.timer - 1; this.setState({timer:time}) @@ -1289,9 +1298,9 @@ export default class acclist extends React.Component{
{this.onPayTypeChange(e)}} value={this.state.paytype} className="audit-obj"> - 对私账户 + 预付款扣除 + 对私账户 对公账户 - 预付款扣除
@@ -1316,7 +1325,7 @@ export default class acclist extends React.Component{
当前正在审核中
- 是否确定撤回正在审批 + 提交审核会将原来审批撤回才可进行提交,是否撤回?
From 4b7e3a550334f757ea3b04e400c4b3fef7fc2ca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Wed, 5 Jan 2022 15:19:58 +0800 Subject: [PATCH 11/50] Update list.js --- src/pages/plan/key/list.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/pages/plan/key/list.js b/src/pages/plan/key/list.js index c12ee0cb..613dd246 100644 --- a/src/pages/plan/key/list.js +++ b/src/pages/plan/key/list.js @@ -311,9 +311,12 @@ export default class acclist extends React.Component{ } tabFn(index){ this.setState({activepage:index,key_word:''}); - if(index==1||index==2){ - this.setState({distdata:[]}); - }else{ + if(index ==1){ + this.setState({activepage:1}); + } + if(index ==2){ + this.setState({activepage:2}); + } if(index==3){ this.setState({activepage:4}); @@ -332,7 +335,7 @@ export default class acclist extends React.Component{ this.getKeyList(); }, 10); - } + } //作废 From d1524f3a134f012c14e1ec1fe3ac33bad80fedbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Wed, 5 Jan 2022 16:24:08 +0800 Subject: [PATCH 12/50] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AE=A1=E6=89=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangecode/add/add.js | 2 +- src/pages/plan/key/detail/list.js | 49 +++++++++++++++++++++++++++---- src/pages/plan/key/edit.js | 3 +- 3 files changed, 47 insertions(+), 7 deletions(-) diff --git a/src/pages/exchangecode/add/add.js b/src/pages/exchangecode/add/add.js index 878743ad..a9e39887 100644 --- a/src/pages/exchangecode/add/add.js +++ b/src/pages/exchangecode/add/add.js @@ -490,7 +490,7 @@ export default class acclist extends React.Component{ addKeysBatchInfo(id,data).then((res)=>{ handelResponse(res,(req,msg)=>{ - Notify.success("创建key成功"); + Notify.success("成功发起审批"); setTimeout(()=>{ this.props.history.push('/home/key-list/'); diff --git a/src/pages/plan/key/detail/list.js b/src/pages/plan/key/detail/list.js index e3b53062..c822aa05 100644 --- a/src/pages/plan/key/detail/list.js +++ b/src/pages/plan/key/detail/list.js @@ -193,6 +193,9 @@ export default class acclist extends React.Component{ } this.getKeyCodeList(params) } + menuItemClick(e,key){ + console.log("选择菜单",key) + } render(){ const { current, pageSize } = this.state; const Column = [ @@ -202,27 +205,57 @@ export default class acclist extends React.Component{ prop:'key_code', type: "normal", width:'auto', - },{ + } + ,{ title: '归属营销计划', width:'auto', type: "normal", prop:'plan_title', name: 'plan_title', }, + { title: '状态', prop:'status', name: 'status', width:'auto', - type: "slot", + type: "normal", + }, + { + title: '总发放条数', + prop:'total', + name: 'total', + width:'auto', + type: "normal", + }, + { + title: '剩余条数', + prop:'residue', + name: 'residue', + width:'auto', + type: "normal", }, { - title: '使用量', + title: '已使用条数', name: 'usage', prop:'usage', type: "normal", width:'auto' }, + { + title: '已过期条数', + name: 'usage', + prop:'usage', + type: "normal", + width:'auto' + }, + { + title: '已作废条数', + name: 'invalid', + prop:'invalid', + type: "normal", + width:'auto' + }, { title: '更新时间', name: 'update_time', @@ -230,7 +263,13 @@ export default class acclist extends React.Component{ type: "normal", width:'auto' }, - + { + title: '操作', + name: 'opearo', + prop:'opearo', + type: "slot", + width:'auto' + } ]; const date = - {this.onEdit(e,rowData)} } >详情 + 详情
{ diff --git a/src/pages/plan/key/edit.js b/src/pages/plan/key/edit.js index 32bd730a..5792a635 100644 --- a/src/pages/plan/key/edit.js +++ b/src/pages/plan/key/edit.js @@ -105,6 +105,7 @@ export default class acclist extends React.Component{ } this.setState({pagetitle:"编辑key"}) + req.code_batch = req.code_batch ? req.code_batch :[] let temp = []; for(let i = 0;i < req.code_batch.length;i++) { @@ -622,7 +623,7 @@ export default class acclist extends React.Component{ let id = sessionStorage.getItem("key_plan_id") addKeysBatchInfo(id,data).then((res)=>{ handelResponse(res,(req,msg)=>{ - Notify.success("创建key成功"); + Notify.success("成功发起审批"); setTimeout(()=>{ window.history.back() },1000); From 73df3831b54d2ebfd6a7ad65328f5a2df5654859 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Wed, 5 Jan 2022 16:34:20 +0800 Subject: [PATCH 13/50] Update edit.js --- src/pages/plan/key/edit.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/plan/key/edit.js b/src/pages/plan/key/edit.js index e3fb7ccd..f624dbad 100644 --- a/src/pages/plan/key/edit.js +++ b/src/pages/plan/key/edit.js @@ -105,6 +105,7 @@ export default class acclist extends React.Component{ } this.setState({pagetitle:"编辑key"}) + req.code_batch = req.code_batch ? req.code_batch : [] let temp = []; for(let i = 0;i < req.code_batch.length;i++) { From acd0a5a6d2624cedd7ffca1ed52affe4a35ff030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Wed, 5 Jan 2022 16:42:27 +0800 Subject: [PATCH 14/50] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangecode/add/add.js | 2 +- src/pages/plan/key/edit.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/exchangecode/add/add.js b/src/pages/exchangecode/add/add.js index e15d59f8..e7f3e9d1 100644 --- a/src/pages/exchangecode/add/add.js +++ b/src/pages/exchangecode/add/add.js @@ -490,7 +490,7 @@ export default class acclist extends React.Component{ addKeysBatchInfo(id,data).then((res)=>{ handelResponse(res,(req,msg)=>{ - Notify.success("创建key成功"); + Notify.success("成功发起审批"); setTimeout(()=>{ this.props.history.push('/home/key-list/'); diff --git a/src/pages/plan/key/edit.js b/src/pages/plan/key/edit.js index f624dbad..ae86018b 100644 --- a/src/pages/plan/key/edit.js +++ b/src/pages/plan/key/edit.js @@ -568,7 +568,7 @@ export default class acclist extends React.Component{ } putKeyBatchDetail(id,data).then((res)=>{ handelResponse(res,(req,msg)=>{ - Notify.success("更新key成功"); + Notify.success("成功发起审批"); setTimeout(()=>{ window.history.back() },1000); @@ -601,7 +601,7 @@ export default class acclist extends React.Component{ } putKeyBatchDetail(id,data).then((res)=>{ handelResponse(res,(req,msg)=>{ - Notify.success("更新key成功"); + Notify.success("成功发起审批"); setTimeout(()=>{ window.history.back() },1000); @@ -632,7 +632,7 @@ export default class acclist extends React.Component{ let id = sessionStorage.getItem("key_plan_id") addKeysBatchInfo(id,data).then((res)=>{ handelResponse(res,(req,msg)=>{ - Notify.success("创建key成功"); + Notify.success("成功发起审批"); setTimeout(()=>{ window.history.back() },1000); From 91272446d5eb883a18db5510266e4b35b322843c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Wed, 5 Jan 2022 17:02:09 +0800 Subject: [PATCH 15/50] =?UTF-8?q?=E5=AE=A1=E6=89=B9=E6=92=A4=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/plan/add/add.js | 4 ++-- src/pages/plan/key/edit.js | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pages/plan/add/add.js b/src/pages/plan/add/add.js index 45ee8792..d15bbd74 100644 --- a/src/pages/plan/add/add.js +++ b/src/pages/plan/add/add.js @@ -382,7 +382,7 @@ export default class add extends React.Component{
- {this.onReturn(e)}} /> + { this.setState({audit_visible:false}) }} />
提交审核
@@ -395,7 +395,7 @@ export default class add extends React.Component{
- +
diff --git a/src/pages/plan/key/edit.js b/src/pages/plan/key/edit.js index ae86018b..675cbd55 100644 --- a/src/pages/plan/key/edit.js +++ b/src/pages/plan/key/edit.js @@ -1343,7 +1343,6 @@ export default class acclist extends React.Component{
- {this.setState({approvalLoading:false})}} />
撤销审批中
正在发起撤销...,请等待 {this.state.timer}秒 From 360f15f7c480710d61d27c6e1a6d59d12badf2ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Wed, 5 Jan 2022 17:07:25 +0800 Subject: [PATCH 16/50] Update list.js --- src/pages/plan/key/list.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/pages/plan/key/list.js b/src/pages/plan/key/list.js index c12ee0cb..6ae109c6 100644 --- a/src/pages/plan/key/list.js +++ b/src/pages/plan/key/list.js @@ -311,9 +311,15 @@ export default class acclist extends React.Component{ } tabFn(index){ this.setState({activepage:index,key_word:''}); - if(index==1||index==2){ - this.setState({distdata:[]}); - }else{ + if(index == 1) + { + this.setState({activepage:1}); + } + if(index == 2) + { + this.setState({activepage:2}); + } + if(index==3){ this.setState({activepage:4}); @@ -332,7 +338,7 @@ export default class acclist extends React.Component{ this.getKeyList(); }, 10); - } + } //作废 From 597dfa1cb928a40924a90077c3668c4034acdea0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Wed, 5 Jan 2022 20:42:27 +0800 Subject: [PATCH 17/50] =?UTF-8?q?=E6=9B=B4=E6=96=B0key=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/api.js | 17 ++- src/assets/enum.js | 2 + src/pages/home/home.js | 3 +- src/pages/plan/key/detail/list.js | 177 +++++++++++++++++++++++++--- src/pages/plan/key/detail/list.less | 3 + src/pages/plan/key/detail/log.js | 177 ++++++++++++++++++++++++++++ src/pages/plan/key/detail/log.less | 40 +++++++ src/pages/plan/key/list.js | 24 ++-- src/pages/plan/list/list.js | 6 +- 9 files changed, 413 insertions(+), 36 deletions(-) create mode 100644 src/pages/plan/key/detail/log.js create mode 100644 src/pages/plan/key/detail/log.less diff --git a/src/assets/api.js b/src/assets/api.js index 36243158..a6ca10c4 100644 --- a/src/assets/api.js +++ b/src/assets/api.js @@ -860,8 +860,23 @@ export const getApprovalsStatus= (id,data) => { return req('get', baseurl + "/approvals/"+id+"/status") } +//作废 +export const keyBatchCancel= (data) => { + return req('put', "http://192.168.6.98:8000" + "/key/batch_cancel",data) +} - +//作废 +export const keyCancel= (data) => { + return req('put', "http://192.168.6.98:8000" + "/key/cancel",data) +} +//标记使用 +export const keyBatchUsage= (data) => { + return req('put', "http://192.168.6.98:8000" + "/key/usage",data) +} +//获取日志 +export const getKeyLog= (data) => { + return req('get', "http://192.168.6.98:8000" + "/key/log/list",data) +} diff --git a/src/assets/enum.js b/src/assets/enum.js index 6072510a..2f0b1e12 100644 --- a/src/assets/enum.js +++ b/src/assets/enum.js @@ -103,6 +103,7 @@ const menu={ case 5:return '已暂停';break; case 6:return '已完结';break; case 7:return '已作废';break; + case 8:return '审批驳回';break; } }, keysStatusBg(params) { @@ -113,6 +114,7 @@ const menu={ case 4:return '#55aaff';break; case 6:return '#555500';break; case 7:return '#3575C7';break; + case 8:return '#e64c00';break; } } diff --git a/src/pages/home/home.js b/src/pages/home/home.js index b3e4a2b9..99fff703 100644 --- a/src/pages/home/home.js +++ b/src/pages/home/home.js @@ -52,7 +52,7 @@ import keylist from "../plan/key/list" import keyorderlist from "../plan/keyorder/keyorder" import keyedit from "../plan/key/edit.js" import keydetail from "../plan/key/detail/list.js" - +import keylog from "../plan/key/detail/log.js" import accountlist from '../system/account/list/list'; @@ -424,6 +424,7 @@ export default class App extends Component { + diff --git a/src/pages/plan/key/detail/list.js b/src/pages/plan/key/detail/list.js index c822aa05..250a1679 100644 --- a/src/pages/plan/key/detail/list.js +++ b/src/pages/plan/key/detail/list.js @@ -8,7 +8,7 @@ import Ipt from "../../../../components/input/main" import Grid from "../../../../components/gird/main.js" import TabPage from "../../../../components/tabPage/main.js" import Filterbar from "../../../../components/filterbar/main.js" -import {planIsSend,getPlanList,handelResponse,startOrStopPlan,getAllEnum,resKeyEmail,planSend,planResend,planReceive,getReseller,getkeyDetailList} from "../../../../assets/api.js" +import {getKeyLog,planIsSend,keyCancel,keyBatchUsage,keyBatchCancel,getPlanList,handelResponse,startOrStopPlan,getAllEnum,resKeyEmail,planSend,planResend,planReceive,getReseller,getkeyDetailList} from "../../../../assets/api.js" import _ from "lodash"; import menu from "../../../../assets/enum.js" @@ -49,8 +49,8 @@ export default class acclist extends React.Component{ silentTotal:0, receive_total:0, usage_total:0, - silent_total:0 - + silent_total:0, + multiple:true } } @@ -118,6 +118,19 @@ export default class acclist extends React.Component{ } //选中表格的选框 selection(selection){ + + + console.log("选择",selection) + if(selection.length > 0) + { + this.setState({multiple:false}) + } + else{ + this.setState({multiple:true}) + } + // this.setState({multiple:false}) + + this.setState({selectiondata:selection}); let grantTotal=0; let receiveTotal=0; @@ -193,9 +206,109 @@ export default class acclist extends React.Component{ } this.getKeyCodeList(params) } - menuItemClick(e,key){ - console.log("选择菜单",key) + menuItemClick(e,key,rowData){ + console.log("选择菜单",rowData) + if(key == 1) + { + let formdata={ + key:rowData.key + } + + keyCancel(formdata).then((res)=>{ + handelResponse(res,(req,msg)=>{ + + + + + },(err)=>{ + console.log(err) + }) + }) + + } + if(key == 2) + { + + let formdata={ + key:rowData.key + } + + keyBatchUsage(formdata).then((res)=>{ + handelResponse(res,(req,msg)=>{ + + },(err)=>{ + console.log(err) + }) + }) + + } + if(key == 3) + { + console.log(rowData) + this.props.history.push('/home/key-log?key='+rowData.key); + sessionStorage.setItem('pathname2','/home/key-log') + + let cur_nav = sessionStorage.getItem("breakchangenav") + if(cur_nav.length > 0 && cur_nav[0].items) + { + cur_nav[0].items.push({path:"/home/key-log",name:cur_nav[0].items[cur_nav[0].items.length - 1].name+"日志"}) + } + + console.log("当前菜单", cur_nav) + sessionStorage.setItem('breaknav',JSON.stringify(cur_nav)); + + + // let formdata={ + // key:rowData.key + // } + // getKeyLog(formdata).then((res)=>{ + // handelResponse(res,(req,msg)=>{ + + // },(err)=>{ + // console.log(err) + // }) + // }) + } + + } + multipleCancel(){ + + console.log(this.state.selectiondata) + let keys = _.map(this.state.selectiondata,(item)=>{ + return item.key + }) + + let formdata={ + keys:keys.toString() + } + + keyBatchCancel(formdata).then((res)=>{ + handelResponse(res,(req,msg)=>{ + + },(err)=>{ + console.log(err) + }) + }) + } + multipleUse(){ + let keys = _.map(this.state.selectiondata,(item)=>{ + return item.key + }) + + let formdata={ + keys:keys.toString() + } + + keyBatchUsage(formdata).then((res)=>{ + handelResponse(res,(req,msg)=>{ + + },(err)=>{ + console.log(err) + }) + }) + } + render(){ const { current, pageSize } = this.state; const Column = [ @@ -221,6 +334,13 @@ export default class acclist extends React.Component{ width:'auto', type: "normal", }, + { + title: '操作', + name: 'opearo', + prop:'opearo', + type: "slot", + width:'auto' + }, { title: '总发放条数', prop:'total', @@ -263,13 +383,7 @@ export default class acclist extends React.Component{ type: "normal", width:'auto' }, - { - title: '操作', - name: 'opearo', - prop:'opearo', - type: "slot", - width:'auto' - } + ]; const date =
-
- +
+ +
{/* */} @@ -319,7 +438,7 @@ export default class acclist extends React.Component{ isSwitch={false} page={this.state.page} ref="plan_list" - isMultiple={false} + dataCount={this.state.dataCount} pageChange={(e)=>{ this.onPageChange(e) @@ -351,7 +470,12 @@ export default class acclist extends React.Component{ } if(com == "opearo") { - let str = + let str = null + + if(rowData.status == 1) + { + + str = 详情 @@ -367,7 +491,26 @@ export default class acclist extends React.Component{ - + + } + else{ + str= + 详情 + + +
{ + }}> 更多
+
+ + this.menuItemClick(e,key,rowData)} > + 标记成已使用 + 作废 + 日志 + + +
+
+ } return str } }} diff --git a/src/pages/plan/key/detail/list.less b/src/pages/plan/key/detail/list.less index 0bae22bd..afe4f962 100644 --- a/src/pages/plan/key/detail/list.less +++ b/src/pages/plan/key/detail/list.less @@ -1,4 +1,7 @@ .code-table { border-top: 1px solid #e0e0e0; padding-bottom: 24px; +} +.zent-btn-disabled{ + background-color: #FFFFFF !important; } \ No newline at end of file diff --git a/src/pages/plan/key/detail/log.js b/src/pages/plan/key/detail/log.js new file mode 100644 index 00000000..333fe4c7 --- /dev/null +++ b/src/pages/plan/key/detail/log.js @@ -0,0 +1,177 @@ +import ReactDOM from 'react-dom'; +import React, { Component } from 'react'; +import { HashRouter as Router, Route, Link } from "react-router-dom"; +import {getQueryString} from "../../../../assets/comm.js" +import "./log.less" +import {Notify,Pop} from "zent" +import TabPage from "../../../../components/tabPage/main.js" +import Grid from "../../../../components/gird/main.js" +import {handelResponse,getKeyLog} from "../../../../assets/api.js" +import ReactJson from 'react-json-view' +import moment from "moment" +const Column = [ + { + title: '创建时间', + name: 'time', + prop:'time', + type: "slot", + width:'20%' + },{ + title: '操作描述', + name: 'message', + prop:'message', + type: "normal", + width:'20%' + }, + { + title: '详情', + name: 'opearo', + type: "slot", + prop:'opearo', + width:'50%' + } +]; + +export default class Key extends React.Component{ + constructor(props){ + super(props) + this.state={ + tabList:[{title:"日志"}], + tabactive:0, + keyDetailLog_data:[], + keyDetail_data:{}, + tableHeight:500, + page:1, + orderNo:'', + limit:10, + total:0, + } + } + componentDidMount(e){ + let data = { + page:1, + limit:10 + } + this.getKeyLogFn(data); + } + tabFn(index){ + this.getKeyLogFn(); + + } + selection(){ + + } + //获取订单日志 + getKeyLogFn(){ + let _self=this; + let {page,limit,orderNo}=this.state; + let data={ + page, + limit + } + getKeyLog(data).then(res=>{ + handelResponse(res,(response,msg)=>{ + console.log("日志",response) + + this.setState({keyDetailLog_data:response.data}) + this.setState({total:response.total}) + },(err)=>{ + Notify.error(err) + }) + }).catch(err=>{ + + }); + } + //获取详情信息 + // getDetails(data){ + // let _self=this; + // getOrderDetails(data).then(res=>{ + // handelResponse(res,(response,msg)=>{ + // const orderDetail_data=response; + // _self.setState({orderDetail_data}); + // },(err)=>{ + // Notify.error(err) + // }) + // }).catch(err=>{ + + // }); + // } + //page + pageChange(e){ + this.setState({page:e}); + setTimeout(() => { + this.getKeyLogFn(); + }, 0); + + } + //limit + countChange(e){ + this.setState({page:1,limit:e}); + setTimeout(() => { + this.getKeyLogFn(); + }, 0); + } + // componentWillMount(){ + // let href=window.location.href; + // let strindex = href.lastIndexOf("\="); + // let orderNo = href.substr(strindex + 1, href.length); + // this.setState({orderNo}); + // this.getDetails(orderNo); + // this.setState({tableHeight:window.innerHeight-430}); + // } + + render(){ + + return( +
+ + { + this.state.tabactive==0?( +
+ { + this.countChange(e) + } + } + countbarVisible={false} + isSwitch={false} + pageChange={(e)=>{ + this.pageChange(e) + + }} + + checkChange ={this.selection.bind(this)} + ComponentHandler={(com,rowData)=>{ + + if(com == "time") + { + return
{moment.unix(rowData.time).format("YYYY-MM-DD HH:mm:ss")}
+ } + if(com == "opearo") + { + return
+ { + rowData.data? :- + } + +
+ } + + }} + /> +
+ ): null + } + +
+
+ ) + } +} \ No newline at end of file diff --git a/src/pages/plan/key/detail/log.less b/src/pages/plan/key/detail/log.less new file mode 100644 index 00000000..7cf8be83 --- /dev/null +++ b/src/pages/plan/key/detail/log.less @@ -0,0 +1,40 @@ +#more{ + + .main-body{ + padding: 24px; + box-sizing: border-box; + + li{ + width: 40%; + list-style-type: none; + display: flex; + justify-content: space-between; + line-height: 42px; + font-size: 14px; + span{ + color:#626366; + // font-size: 14px; + } + font{ + color:#313233; + } + + } + .num{ + span,font{ + color:#ccc!important; + } + + } + } +} +.logOrder{ + ul{ + li{ + padding: 8px 0; + font{ + color: #313233; + } + } + } +} \ No newline at end of file diff --git a/src/pages/plan/key/list.js b/src/pages/plan/key/list.js index 613dd246..a3b005f0 100644 --- a/src/pages/plan/key/list.js +++ b/src/pages/plan/key/list.js @@ -122,7 +122,7 @@ export default class acclist extends React.Component{ dataCount:0, page:1, limit:10, - tabList:[{title:"全部"},{title:"创建中"},{title:"审核中"},{title:"进行中"},{title:"暂停中"},{title:"已完结"},{title:"已作废"}], + tabList:[{title:"全部"},{title:"创建中"},{title:"审核中"},{title:"进行中"},{title:"暂停中"},{title:"已完结"},{title:"已作废"},{title:"审批驳回"}], distdata:[], combinedValue:[], distdata2:[{id:12313123213123,name:'爱奇艺月卡兑换券',time:'2021-11-08 14:21:06至2021-11-08 15:06:04',plan:'营销计划2',belongid:3123213,send:100,record:58,used:41,dead:11,fail:12,status:'1'}], @@ -330,6 +330,9 @@ export default class acclist extends React.Component{ if(index==6){ this.setState({activepage:7}); } + if(index==7){ + this.setState({activepage:8}); + } this.setState({page:1,limit:10}) setTimeout(() => { this.getKeyList(); @@ -598,7 +601,7 @@ linkTo(row){ let str = {this.linkTo(rowData)} }>{rowData.batch_name} if(rowData.style == 4) { - str = {rowData.batch_name} + str = {rowData.batch_name} } return str @@ -615,11 +618,6 @@ linkTo(row){ } if(com == "edit") { - - - - - let str = "" let str2 = 编辑 @@ -759,12 +757,12 @@ linkTo(row){ return { - - if(item == this.state.email_list[this.state.email_radio]) - { - this.setState({email_radio:-1}) - } - + + if(item == this.state.email_list[this.state.email_radio]) + { + this.setState({email_radio:-1}) + } + }} >{item} diff --git a/src/pages/plan/list/list.js b/src/pages/plan/list/list.js index b03208dd..3ac37b62 100644 --- a/src/pages/plan/list/list.js +++ b/src/pages/plan/list/list.js @@ -23,7 +23,7 @@ export default class acclist extends React.Component{ page:1, limit:10, tabList:[{title:"营销计划列表"}], - distdata:[{title:'士大夫大师傅'}], + distdata:[], filterList:[{id:0,label:"状态", prop:"status", menuList:[{id:999,name:"全部"},{id:0,name:"创建中"},{id:2,name:"审核中"},{id:3,name:"待生效"},{id:4,name:"进行中"},{id:5,name:"暂停中"},{id:6,name:"已完结"},{id:7,name:"审批驳回"}]}, ], tableHeight:500, @@ -650,9 +650,7 @@ export default class acclist extends React.Component{ } if(com == "opearo") { - - - + let str = {this.onEdit(e,rowData)} } >编辑 From ce1c2cbf4256e9440b114afb612086e9dfee17a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Thu, 6 Jan 2022 11:14:56 +0800 Subject: [PATCH 18/50] =?UTF-8?q?=E5=85=91=E6=8D=A2=E7=A0=81=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=A2=9E=E5=8A=A0=20=E5=88=9B=E5=BB=BA=E4=B8=AD=20?= =?UTF-8?q?=E5=AE=A1=E6=89=B9=E4=B8=AD=20=E5=AE=A1=E6=89=B9=E9=A9=B3?= =?UTF-8?q?=E5=9B=9E=E4=B8=89=E7=A7=8D=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/input/main.js | 5 ++++- src/components/tabPage/main.js | 3 ++- src/pages/exchangecode/add/add.js | 20 +++++++++++++++-- src/pages/exchangecode/edit/edit.js | 2 +- src/pages/exchangecode/list/list.js | 4 ++-- src/pages/plan/add/add.js | 10 +++++---- src/pages/plan/add/edit.js | 9 ++++---- src/pages/plan/add/step2.js | 34 +++++++++++++---------------- src/pages/plan/key/edit.js | 2 +- 9 files changed, 54 insertions(+), 35 deletions(-) diff --git a/src/components/input/main.js b/src/components/input/main.js index b2c3d741..95aeb5bd 100644 --- a/src/components/input/main.js +++ b/src/components/input/main.js @@ -62,8 +62,11 @@ import classNames from 'classnames' this.setState({'errshow':false}); } } - componentWillMount(){ + componentDidMount(){ let val=this.props.value?this.props.value:''; + + console.log("当前的值",val) + if(val!=''){ this.setState({iptVal:val}); this.setState({'iptVallength':String(val).length}); diff --git a/src/components/tabPage/main.js b/src/components/tabPage/main.js index d7454277..00c23de8 100644 --- a/src/components/tabPage/main.js +++ b/src/components/tabPage/main.js @@ -12,6 +12,7 @@ import classnames from 'classnames' this.state = { activeIndex:0, tabList:props.tabs, + width: props.width ? props.width : 220, } } @@ -53,7 +54,7 @@ import classnames from 'classnames' { this.state.tabList.map((item, index) => { return( -
{this.tabChange(index)}} key={index}> +
{this.tabChange(index)}} key={index}>
{item.title}
) diff --git a/src/pages/exchangecode/add/add.js b/src/pages/exchangecode/add/add.js index e7f3e9d1..e36cd6aa 100644 --- a/src/pages/exchangecode/add/add.js +++ b/src/pages/exchangecode/add/add.js @@ -88,6 +88,19 @@ export default class acclist extends React.Component{ getKeyBatchDetail(batch_id).then((res)=>{ handelResponse(res,(req,msg)=>{ this.setState({pagetitle:"复制key"}) + console.log("key批次详情",req) + + + getReseller(req.reseller_id).then((res)=>{ + handelResponse(res,(req,msg)=>{ + this.setState({reseller:req}) + + this.setState({phone_list:req.contact_phone}) + this.setState({email_list:req.contact_email}) + + }) + }) + let model = { title:req.plan_title, batch_name:'', @@ -472,6 +485,9 @@ export default class acclist extends React.Component{ data.allow_loss = this.state.model.allow_loss; data.merge_stock = this.state.model.merge_stock; data.code_batch = this.refs.bindObj.getSelectData(); + console.log("分销商") + console.log(this.state.reseller) + data.reseller_id=this.state.reseller.id data.reseller_name=this.state.reseller.name @@ -1113,7 +1129,7 @@ export default class acclist extends React.Component{ } if(com=="quantity") { - return {this.onQuantityChange(e,rowData,rowIndex)}} /> + return {this.onQuantityChange(e,rowData,rowIndex)}} /> } if(com =="contract_price" ) { @@ -1198,7 +1214,7 @@ export default class acclist extends React.Component{
- +
diff --git a/src/pages/exchangecode/edit/edit.js b/src/pages/exchangecode/edit/edit.js index b5131984..0b055cd5 100644 --- a/src/pages/exchangecode/edit/edit.js +++ b/src/pages/exchangecode/edit/edit.js @@ -898,7 +898,7 @@ export default class exchangedit extends React.Component{ } if(com=="quantity") { - return {this.onQuantityChange(e,rowData)}} /> + return {this.onQuantityChange(e,rowData)}} /> } if(com =="contract_price" ) { diff --git a/src/pages/exchangecode/list/list.js b/src/pages/exchangecode/list/list.js index 1746f686..97097e66 100644 --- a/src/pages/exchangecode/list/list.js +++ b/src/pages/exchangecode/list/list.js @@ -117,7 +117,7 @@ export default class acclist extends React.Component{ total:0, page:1, limit:10, - tabList:[{title:"全部",index:0},{title:"未开始",index:3},{title:"进行中",index:1},{title:"暂停中",index:2},{title:"已完结",index:4},{title:"已作废",index:5}], + tabList:[{title:"全部",index:0},{title:"未开始",index:3},{title:"进行中",index:1},{title:"暂停中",index:2},{title:"已完结",index:4},{title:"已作废",index:5},{title:"创建中",index:-1},{title:"审核中",index:6},{title:"审核驳回",index:7}], combinedValue:[], DateTime:'',//数据更新时间 key_word:'', @@ -354,7 +354,7 @@ componentDidUpdate(prevProps,prevState){ const { current, pageSize } = this.state; return(
- +

{/* */} {/* */} diff --git a/src/pages/plan/add/add.js b/src/pages/plan/add/add.js index d15bbd74..757a70ab 100644 --- a/src/pages/plan/add/add.js +++ b/src/pages/plan/add/add.js @@ -34,7 +34,8 @@ export default class add extends React.Component{ step1:null, paytype:3, reseller:"", - payment_direction:["对私账户","对公账户","预付款扣除"] + payment_direction:["对私账户","对公账户","预付款扣除"], + isload:false, } } @@ -97,9 +98,9 @@ export default class add extends React.Component{ { if( await this.refs.step1.submit() == true) { - + this.setState({isload:true}) this.setState({curstep:2}) - + } else{ return; @@ -207,6 +208,7 @@ export default class add extends React.Component{ let step = "step2-" + this.state.keys.length this.state.keys.push(step) this.setState({keys:this.state.keys}) + this.setState({isload:true}) console.log(this.state.keys) } @@ -338,7 +340,7 @@ export default class add extends React.Component{ }> - {this.addNewkey()}} /> + {this.addNewkey()}} isload={this.state.isload} /> ) : null }) diff --git a/src/pages/plan/add/edit.js b/src/pages/plan/add/edit.js index e70cba57..08cb0104 100644 --- a/src/pages/plan/add/edit.js +++ b/src/pages/plan/add/edit.js @@ -42,8 +42,8 @@ export default class add extends React.Component{ payment_direction:["对私账户","对公账户","预付款扣除"], approvalLoading:false, timer:3, - theme_options:[] - + theme_options:[], + isload:false, } } @@ -197,7 +197,7 @@ export default class add extends React.Component{ { if( await this.refs.step1.submit() == true) { - + this.setState({isload:true}) this.setState({curstep:2}) } @@ -326,6 +326,7 @@ export default class add extends React.Component{ let step = "step2-" + this.state.keys.length this.state.keys.push(step) this.setState({keys:this.state.keys}) + this.setState({isload:true}) } onPhoneChange(e){ @@ -548,7 +549,7 @@ export default class add extends React.Component{ }> - {this.addNewkey()}} data={item} disabled={this.state.disabled} /> + {this.addNewkey()}} isload={this.state.isload} data={item} disabled={this.state.disabled} /> ) : null }) diff --git a/src/pages/plan/add/step2.js b/src/pages/plan/add/step2.js index 76194aca..47ace4f1 100644 --- a/src/pages/plan/add/step2.js +++ b/src/pages/plan/add/step2.js @@ -55,7 +55,7 @@ export default class acclist extends React.Component{ oldData:null, uploading:false, rowIndex:-1, - + isload:props.isload ? props.isload : false, } } @@ -68,7 +68,6 @@ export default class acclist extends React.Component{ input.focus(); - } submit(){ @@ -217,15 +216,7 @@ export default class acclist extends React.Component{ { let productlist = _.filter(this.state.tempdata,(item)=>{return item.checked == true}) let sum = 0; - - - console.log(this.state.rank) - - - - - - + _.forEach(productlist,(o)=>{ sum += parseInt( o.quantity); @@ -306,6 +297,7 @@ export default class acclist extends React.Component{ } addNewKey(){ this.props.addNewkey() + } onRestrict(e,rowdata,index){ @@ -385,6 +377,7 @@ export default class acclist extends React.Component{ }) this.setState({distdata: temp}) + this.setState({isload:true}) } @@ -436,11 +429,7 @@ export default class acclist extends React.Component{ - - - onNameChange(){ - - } + onUploadError = (type, data) => { if (type === 'overMaxAmount') { Notify.error(`最多可上传 ${data.maxAmount} 张图片`); @@ -725,6 +714,9 @@ export default class acclist extends React.Component{ + { + this.state.isload ? ( + { let model2 = this.state.model; @@ -741,9 +733,12 @@ export default class acclist extends React.Component{ value={this.state.model.batch_name} placeholder={"请输入"} labelWidth={'0px'} maxLength={12} height={'36px'} width={'400px'} alignment={'left'}/> - + ) : null + } + { + this.state.isload ? ( { let model2 = this.state.model; @@ -761,8 +756,9 @@ export default class acclist extends React.Component{ value={this.state.model.quantity} placeholder={"请输入"} labelWidth={'0px'} maxLength={5} height={'36px'} width={'400px'} alignment={'left'}/> + ) :null - + } {this.onCheckChange(e)}}> 兑换码 @@ -960,7 +956,7 @@ export default class acclist extends React.Component{ } if(com=="quantity") { - return {this.onQuantityChange(e,rowData,rowIndex)}} /> + return {this.onQuantityChange(e,rowData,rowIndex)}} /> } if(com =="contract_price" ) { diff --git a/src/pages/plan/key/edit.js b/src/pages/plan/key/edit.js index 675cbd55..5cf7ae56 100644 --- a/src/pages/plan/key/edit.js +++ b/src/pages/plan/key/edit.js @@ -1222,7 +1222,7 @@ export default class acclist extends React.Component{ } if(com=="quantity") { - return {this.onQuantityChange(e,rowData,rowIndex)}} /> + return {this.onQuantityChange(e,rowData,rowIndex)}} /> } if(com =="contract_price" ) { From ae2c5ca6426d06d4c2e8528177bef44d54628072 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Thu, 6 Jan 2022 11:15:46 +0800 Subject: [PATCH 19/50] Update main.js --- src/components/input/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/input/main.js b/src/components/input/main.js index 95aeb5bd..4e93ee0f 100644 --- a/src/components/input/main.js +++ b/src/components/input/main.js @@ -62,7 +62,7 @@ import classNames from 'classnames' this.setState({'errshow':false}); } } - componentDidMount(){ + componentWillMount(){ let val=this.props.value?this.props.value:''; console.log("当前的值",val) From 837081e53093d18f3ca870a219d4b56f5128f085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Thu, 6 Jan 2022 11:31:21 +0800 Subject: [PATCH 20/50] =?UTF-8?q?=E5=AE=A1=E6=89=B9=E9=A9=B3=E5=9B=9E?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/plan/key/list.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/pages/plan/key/list.js b/src/pages/plan/key/list.js index 6ae109c6..f451aa35 100644 --- a/src/pages/plan/key/list.js +++ b/src/pages/plan/key/list.js @@ -122,7 +122,7 @@ export default class acclist extends React.Component{ dataCount:0, page:1, limit:10, - tabList:[{title:"全部"},{title:"创建中"},{title:"审核中"},{title:"进行中"},{title:"暂停中"},{title:"已完结"},{title:"已作废"}], + tabList:[{title:"全部"},{title:"创建中"},{title:"审核中"},{title:"进行中"},{title:"暂停中"},{title:"已完结"},{title:"已作废"},{title:"审批驳回"}], distdata:[], combinedValue:[], distdata2:[{id:12313123213123,name:'爱奇艺月卡兑换券',time:'2021-11-08 14:21:06至2021-11-08 15:06:04',plan:'营销计划2',belongid:3123213,send:100,record:58,used:41,dead:11,fail:12,status:'1'}], @@ -333,6 +333,11 @@ export default class acclist extends React.Component{ if(index==6){ this.setState({activepage:7}); } + if(index == 7) + { + this.setState({activepage:8}); + } + this.setState({page:1,limit:10}) setTimeout(() => { this.getKeyList(); @@ -614,7 +619,7 @@ linkTo(row){ if(com == "status") { - return

{menu.keysStatus(rowData.status)}

+ return

{rowData.status_text}

} if(com == "edit") { From ba9ce5c55d20f8f38cbb5bf5bb999c276485b99f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Thu, 6 Jan 2022 11:44:04 +0800 Subject: [PATCH 21/50] =?UTF-8?q?=E5=AE=A1=E6=89=B9=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E7=9A=84=E5=88=86=E9=94=80=E5=95=86=E4=B8=8D?= =?UTF-8?q?=E5=AD=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangecode/edit/edit.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pages/exchangecode/edit/edit.js b/src/pages/exchangecode/edit/edit.js index 0b055cd5..07565fef 100644 --- a/src/pages/exchangecode/edit/edit.js +++ b/src/pages/exchangecode/edit/edit.js @@ -226,6 +226,12 @@ export default class exchangedit extends React.Component{ submitCodeData(){ + if(!this.state.reseller) + { + Notify.error("该兑换码对应分销商不存在") + return + } + let code_batch_id = sessionStorage.getItem("code_id") let range = [] From 3159dc7534be7492f6e031e8778ba8d07ca14710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Thu, 6 Jan 2022 11:49:02 +0800 Subject: [PATCH 22/50] =?UTF-8?q?=E7=A6=81=E7=94=A8=E5=88=86=E9=94=80?= =?UTF-8?q?=E5=95=86=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/distributor/list/list.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/distributor/list/list.js b/src/pages/distributor/list/list.js index 0a3883ac..b1d44ddd 100644 --- a/src/pages/distributor/list/list.js +++ b/src/pages/distributor/list/list.js @@ -355,7 +355,6 @@ componentDidUpdate(prevProps,prevState){ { return {this.editFn(e,rowData)}} >编辑 - {this.delFn(e,rowData)}} >删除
更多
From 2b551783db13ccc420e0bba0965f3db672af7191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Thu, 6 Jan 2022 13:37:40 +0800 Subject: [PATCH 23/50] Update add.js --- src/pages/exchangecode/add/add.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/pages/exchangecode/add/add.js b/src/pages/exchangecode/add/add.js index e36cd6aa..5ca809d3 100644 --- a/src/pages/exchangecode/add/add.js +++ b/src/pages/exchangecode/add/add.js @@ -446,11 +446,17 @@ export default class acclist extends React.Component{ } onAudit(){ + if(!this.state.reseller) + { + Notify.error("对应分销商数据不存在"); + return + } + + + if(this.state.isEdit) { let selection = this.refs.bindObj.getSelectData() - - let formdata = selection.filter((item)=>{ return !item.hasOwnProperty("disabled") }) From d7d4c848b8cb9acda57ee3583ab1dc7eadb18e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Thu, 6 Jan 2022 15:08:07 +0800 Subject: [PATCH 24/50] =?UTF-8?q?=E5=85=91=E6=8D=A2=E7=A0=81=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E6=B5=81=E7=A8=8B=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangecode/edit/edit.js | 87 +++++++++++++++++++---------- src/pages/exchangecode/list/list.js | 16 +++--- src/pages/plan/key/list.js | 25 +-------- 3 files changed, 70 insertions(+), 58 deletions(-) diff --git a/src/pages/exchangecode/edit/edit.js b/src/pages/exchangecode/edit/edit.js index 07565fef..b20f9eed 100644 --- a/src/pages/exchangecode/edit/edit.js +++ b/src/pages/exchangecode/edit/edit.js @@ -103,39 +103,70 @@ export default class exchangedit extends React.Component{ this.setState({new_product:new_ids}) - - this.setState({codeInfo:codeInfo}) - this.setState({isload:true}); - let table = _.map(codeInfo.range,(res)=>{ - res.checked = true; - return res - }); + let delete_product = req.delete_product + let payment_direction = req.payment_direction + getCodesDetail(code_batch_id).then(res=>{ + handelResponse(res,(req,msg)=>{ + codeInfo.stock = req.stock; + + + + + + this.setState({codeInfo:codeInfo}) + this.setState({isload:true}); + let table = _.map(codeInfo.range,(res)=>{ + let obj = req.code_batch_stock.find(o=>o.product_id == res.product_id); + res.usage = obj ? obj.usage : 0; + res.stock =obj ? obj.stock : res.quantity - res.usage; + res.checked = true; + return res + }); + + + this.setState({deleteProduct:delete_product}) + + this.setState({tempdata:codeInfo.range}) + + let arr = []; + + _.map(codeInfo.range,(res)=>{ + let obj = {}; + obj.key = res.product_id; + obj.text= res.product_name; + this.state.oldProduct.push(res.product_id); + arr.push(obj) + return obj; + }) + + this.setState({rankoptions:arr}) + this.setState({rank:arr}) + + + if(payment_direction) + { + let index = this.state.payment_direction.indexOf(payment_direction) + this.setState({paytype: index+1}) + } + + },(err)=>{ + + }) + }).catch(err=>{ + }); - this.setState({deleteProduct:req.delete_product}) - this.setState({tempdata:codeInfo.range}) - - let arr = []; - - _.map(codeInfo.range,(res)=>{ - let obj = {}; - obj.key = res.product_id; - obj.text= res.product_name; - this.state.oldProduct.push(res.product_id); - arr.push(obj) - return obj; - }) - - this.setState({rankoptions:arr}) - this.setState({rank:arr}) + + + + + + + + - if(req.payment_direction) - { - let index = this.state.payment_direction.indexOf(req.payment_direction) - this.setState({paytype: index+1}) - } },(err)=>{ diff --git a/src/pages/exchangecode/list/list.js b/src/pages/exchangecode/list/list.js index 97097e66..f946e846 100644 --- a/src/pages/exchangecode/list/list.js +++ b/src/pages/exchangecode/list/list.js @@ -62,6 +62,12 @@ const Column = [ type: "slot", width:'auto', + },{ + title: '状态', + name: 'status', + type: "slot", + prop:'status', + width:'auto', }, { title: '券总数(已发放)', @@ -99,13 +105,7 @@ const Column = [ type: "normal", prop:'invalid', width:'auto', - },{ - title: '状态', - name: 'status', - type: "slot", - prop:'status', - width:'auto', - }, + } ]; @@ -117,7 +117,7 @@ export default class acclist extends React.Component{ total:0, page:1, limit:10, - tabList:[{title:"全部",index:0},{title:"未开始",index:3},{title:"进行中",index:1},{title:"暂停中",index:2},{title:"已完结",index:4},{title:"已作废",index:5},{title:"创建中",index:-1},{title:"审核中",index:6},{title:"审核驳回",index:7}], + tabList:[{title:"全部",index:0},{title:"创建中",index:-1},{title:"未开始",index:3},{title:"审核中",index:6},{title:"审核驳回",index:7},{title:"进行中",index:1},{title:"暂停中",index:2},{title:"已结束",index:4},{title:"已作废",index:5}], combinedValue:[], DateTime:'',//数据更新时间 key_word:'', diff --git a/src/pages/plan/key/list.js b/src/pages/plan/key/list.js index f451aa35..f4e69a43 100644 --- a/src/pages/plan/key/list.js +++ b/src/pages/plan/key/list.js @@ -631,6 +631,7 @@ linkTo(row){ let str = "" let str2 = 编辑 + 复制 { keysIsSend(rowData.id).then((res)=>{ @@ -681,28 +682,8 @@ linkTo(row){ - - if(rowData.status >= 6 ) - { - str2 =
编辑 - - -
{ - }}> 更多
-
- - - - -
-
- } - - - - - return rowData.status >= 6 ? str2 : str + return rowData.status == 7 || rowData.status == 6 ? str2 : str } }} /> @@ -714,7 +695,7 @@ linkTo(row){ this.state.audit_visible ? (
-
+
{this.cancel(e)}} /> From 0d11052d463d7fc80094a6c4ac4838d4cdad7c26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Thu, 6 Jan 2022 16:54:01 +0800 Subject: [PATCH 25/50] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/api.js | 11 ++++++ src/pages/exchangecode/edit/edit.js | 56 ++++++++++++++++++----------- src/pages/plan/key/list.js | 14 ++++---- 3 files changed, 54 insertions(+), 27 deletions(-) diff --git a/src/assets/api.js b/src/assets/api.js index f9a268a9..7415c000 100644 --- a/src/assets/api.js +++ b/src/assets/api.js @@ -461,6 +461,17 @@ export const getCodeProduct = (batch_id,id) => { } +//获取商品库存明细 +export const getIsRequireApproval = (id,data) => { + return req('post', baseurl + "/codes/"+id+"/is_require_approval",data) +} + + + + + + + // //蓝色兄弟映射商品 export const getProductInfoSelect = (params) => { return req('get', baseurl + "/product/market/products",params) diff --git a/src/pages/exchangecode/edit/edit.js b/src/pages/exchangecode/edit/edit.js index b20f9eed..b6281de3 100644 --- a/src/pages/exchangecode/edit/edit.js +++ b/src/pages/exchangecode/edit/edit.js @@ -5,7 +5,7 @@ import Form from "../../../components/form/main" import FormItem from "../../../components/form-item/main" import {Card,Radio,Icon, Drawer, Select,Button,ImageUpload ,DateRangePicker,onUpload,Sweetalert,RadioButton,RadioGroup,Notify,Input,CombinedDateRangePicker} from "zent" import Bus from "../../../assets/eventBus.js" -import {getApprovalsStatus,getReseller,getApprovalsInfo,terminateApprovals,getProductInfoSelect,handelResponse,uploadImg,getCodeProduct,putCodeProduct,getCodesDetail,putCodes,putCodesBatch} from "../../../assets/api.js" +import {getIsRequireApproval,getApprovalsStatus,getReseller,getApprovalsInfo,terminateApprovals,getProductInfoSelect,handelResponse,uploadImg,getCodeProduct,putCodeProduct,getCodesDetail,putCodes,putCodesBatch} from "../../../assets/api.js" import _ from "lodash"; import Productform from "../product/add" import "./edit.less" @@ -56,7 +56,7 @@ export default class exchangedit extends React.Component{ paytype:3, reseller:null, payment_direction:["对私账户","对公账户","预付款扣除"], - + isAudit:false, } } @@ -254,15 +254,7 @@ export default class exchangedit extends React.Component{ } - - submitCodeData(){ - - if(!this.state.reseller) - { - Notify.error("该兑换码对应分销商不存在") - return - } - + buildData(){ let code_batch_id = sessionStorage.getItem("code_id") let range = [] @@ -311,15 +303,6 @@ export default class exchangedit extends React.Component{ let deleteProduct= _.differenceWith(this.state.oldProduct, updateIds, _.isEqual); - console.log("分销商",this.state.reseller) - - - // _.filter(deleteProduct,(item)=>{ - // this.state.new_product.indexOf(item) - // }) - - - deleteProduct = deleteProduct.filter((item)=>{return this.state.new_product.indexOf(item) < 0}) console.log(this.state.new_product) if(this.state.deleteProduct.length > 0) @@ -390,6 +373,18 @@ export default class exchangedit extends React.Component{ "update_product":updateProduct, "delete_product": deleteProduct, } + return data + } + submitCodeData(){ + + if(!this.state.reseller) + { + Notify.error("该兑换码对应分销商不存在") + return + } + + let code_batch_id = sessionStorage.getItem("code_id") + let data = this.buildData(); putCodesBatch(code_batch_id,data).then((res)=>{ handelResponse(res,(req,msg)=>{ console.log(req) @@ -423,7 +418,26 @@ export default class exchangedit extends React.Component{ Notify.error("还有图片上传中,不可提交") return } - this.setState({audit_visible:true}) + let code_batch_id = sessionStorage.getItem("code_id") + let data = this.buildData() + getIsRequireApproval(code_batch_id,data).then((res)=>{ + handelResponse(res,(req,msg)=>{ + + if(req.is_require_approval) + { + this.setState({audit_visible:true}) + } + else{ + this.submitCodeData(); + } + + + },(err)=>{ + Notify.error(err) + }) + }) + + } } diff --git a/src/pages/plan/key/list.js b/src/pages/plan/key/list.js index f4e69a43..01f2fca1 100644 --- a/src/pages/plan/key/list.js +++ b/src/pages/plan/key/list.js @@ -122,7 +122,7 @@ export default class acclist extends React.Component{ dataCount:0, page:1, limit:10, - tabList:[{title:"全部"},{title:"创建中"},{title:"审核中"},{title:"进行中"},{title:"暂停中"},{title:"已完结"},{title:"已作废"},{title:"审批驳回"}], + tabList:[{title:"全部"},{title:"创建中"},{title:"审核中"},{title:"审批驳回"},{title:"进行中"},{title:"暂停中"},{title:"已完结"},{title:"已作废"}], distdata:[], combinedValue:[], distdata2:[{id:12313123213123,name:'爱奇艺月卡兑换券',time:'2021-11-08 14:21:06至2021-11-08 15:06:04',plan:'营销计划2',belongid:3123213,send:100,record:58,used:41,dead:11,fail:12,status:'1'}], @@ -311,6 +311,8 @@ export default class acclist extends React.Component{ } tabFn(index){ this.setState({activepage:index,key_word:''}); + console.log(index) + if(index == 1) { this.setState({activepage:1}); @@ -321,21 +323,21 @@ export default class acclist extends React.Component{ } if(index==3){ - this.setState({activepage:4}); + this.setState({activepage:8}); } if(index==4){ - this.setState({activepage:5}); + this.setState({activepage:4}); } if(index==5){ - this.setState({activepage:6}); + this.setState({activepage:5}); } if(index==6){ - this.setState({activepage:7}); + this.setState({activepage:6}); } if(index == 7) { - this.setState({activepage:8}); + this.setState({activepage:7}); } this.setState({page:1,limit:10}) From 6b1eb6c8297a1d94f18513d6446434a53e410a36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Thu, 6 Jan 2022 17:06:30 +0800 Subject: [PATCH 26/50] Update edit.js --- src/pages/exchangecode/edit/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/exchangecode/edit/edit.js b/src/pages/exchangecode/edit/edit.js index b6281de3..c93fe996 100644 --- a/src/pages/exchangecode/edit/edit.js +++ b/src/pages/exchangecode/edit/edit.js @@ -591,7 +591,7 @@ export default class exchangedit extends React.Component{ onQuantityChange(e,row){ this.setState({tempdata:this.state.tempdata}) - let value = e.target.value == "" ? 0 : e.target.value; + let value = e.target.value; let rowIndex =this.state.tempdata.findIndex((o)=>{return o.product_id == row.product_id}) if(value - this.state.tempdata[rowIndex].usage < 0) { From 0987d23cdec3267bd766df59d040b46687c6a94b Mon Sep 17 00:00:00 2001 From: red-deng-deng <1924913374@qq.com> Date: Fri, 7 Jan 2022 09:53:59 +0800 Subject: [PATCH 27/50] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E6=98=A0=E5=B0=84=E5=95=86=E5=93=81=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/order/more/more.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/order/more/more.js b/src/pages/order/more/more.js index dcd948a7..da93503b 100644 --- a/src/pages/order/more/more.js +++ b/src/pages/order/more/more.js @@ -160,7 +160,7 @@ export default class order extends React.Component{
  • 映射商品 - 爱奇艺>[官方-爱奇艺-黄金会员周卡] + {orderDetail_data.map_product_name}
  • 官方价 From aa31f8b9ba55c23723506dab577a3998e24363b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Fri, 7 Jan 2022 10:03:34 +0800 Subject: [PATCH 28/50] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangecode/edit/edit.js | 196 ++++++++++++++++++---------- src/pages/exchangecode/list/list.js | 1 + 2 files changed, 130 insertions(+), 67 deletions(-) diff --git a/src/pages/exchangecode/edit/edit.js b/src/pages/exchangecode/edit/edit.js index c93fe996..d859052c 100644 --- a/src/pages/exchangecode/edit/edit.js +++ b/src/pages/exchangecode/edit/edit.js @@ -57,6 +57,8 @@ export default class exchangedit extends React.Component{ reseller:null, payment_direction:["对私账户","对公账户","预付款扣除"], isAudit:false, + approvalsStatus:false, + oldTable:[] } } @@ -70,6 +72,7 @@ export default class exchangedit extends React.Component{ let code_batch_id = sessionStorage.getItem("code_id") let approval_id = sessionStorage.getItem("approval_id") + let approval_status = sessionStorage.getItem("approval_status") if(approval_id > 0) { getApprovalsInfo(approval_id).then(res=>{ @@ -92,9 +95,25 @@ export default class exchangedit extends React.Component{ range:req.update_product } + + + if(req.new_product.length > 0) { - codeInfo.range = codeInfo.range.concat(req.new_product); + + if(approval_status == 7) + { + req.new_product = _.map(req.new_product,(item)=>{ + item.checked = false + return item + }) + + + + } + + codeInfo.range = codeInfo.range.concat(req.new_product); + } let new_ids = _.map(req.new_product,(o)=>{ @@ -109,22 +128,45 @@ export default class exchangedit extends React.Component{ handelResponse(res,(req,msg)=>{ codeInfo.stock = req.stock; + this.setState({oldTable:req.code_batch_stock}) + console.log("老数据",this.state.oldTable) + let deleteArr = [] + for(let i =0;i < delete_product.length;i++) + { + let deleteData = req.code_batch_stock.find(o=>o.product_id == delete_product[i]) + deleteData.checked = false; + deleteArr.push(deleteData) + } + + console.log("删除数组",deleteArr) this.setState({codeInfo:codeInfo}) this.setState({isload:true}); + codeInfo.range = codeInfo.range.concat(deleteArr) + + + + let table = _.map(codeInfo.range,(res)=>{ let obj = req.code_batch_stock.find(o=>o.product_id == res.product_id); + + res.usage = obj ? obj.usage : 0; res.stock =obj ? obj.stock : res.quantity - res.usage; - res.checked = true; + res.checked = res.hasOwnProperty("checked") ? res.checked : true; + if(approval_status == 7 && obj) + { + res.checked = true + } + return res }); - this.setState({deleteProduct:delete_product}) + this.setState({deleteProduct:[]}) this.setState({tempdata:codeInfo.range}) @@ -134,11 +176,17 @@ export default class exchangedit extends React.Component{ let obj = {}; obj.key = res.product_id; obj.text= res.product_name; - this.state.oldProduct.push(res.product_id); + if(new_ids.indexOf(res.product_id) < 0) + { + this.state.oldProduct.push(res.product_id); + } arr.push(obj) return obj; }) + + + this.setState({rankoptions:arr}) this.setState({rank:arr}) @@ -317,33 +365,31 @@ export default class exchangedit extends React.Component{ let temp = addProduct.filter((item)=>{ return deleteProduct.indexOf(item.product_id) > -1 }) - let tempIds = _.map(temp,(item)=>{ - return item.product_id - }) + // let tempIds = _.map(temp,(item)=>{ + // return item.product_id + // }) - if(temp.length > 0) - { + // if(temp.length > 0) + // { - addProduct = addProduct.filter((item)=>{ - return tempIds.indexOf(item.product_id) < 0 - }) + // // addProduct = addProduct.filter((item)=>{ + // // return tempIds.indexOf(item.product_id) < 0 + // // }) - console.log("新增",addProduct) - - let updateAdd =_.filter(addProduct,(item)=>{ + // // let updateAdd =_.filter(addProduct,(item)=>{ - return deleteProduct.indexOf(item.product_id) > -1 - }) + // // return deleteProduct.indexOf(item.product_id) > -1 + // // }) - updateProduct = updateProduct.concat(updateAdd); + // // updateProduct = updateProduct.concat(updateAdd); - } + // } @@ -420,62 +466,73 @@ export default class exchangedit extends React.Component{ } let code_batch_id = sessionStorage.getItem("code_id") let data = this.buildData() - getIsRequireApproval(code_batch_id,data).then((res)=>{ - handelResponse(res,(req,msg)=>{ + + let approval_id = sessionStorage.getItem("approval_id") + + if(approval_id <= 0) + { + this.setState({audit_visible:true}) + } + else{ + getApprovalsStatus(approval_id).then((res)=>{ + handelResponse(res,(req,msg)=>{ + if(req.status == 0) + { + this.setState({approvalsStatus:true}) + this.setState({recall_visible:true}) + } + if(req.status == 1) + { + Notify.error("进行中的批次不能提交审核") + + } + if(req.status == 2 || req.status == 3){ - if(req.is_require_approval) - { - this.setState({audit_visible:true}) - } - else{ - this.submitCodeData(); - } - - - },(err)=>{ - Notify.error(err) - }) - }) + getIsRequireApproval(code_batch_id,data).then((res)=>{ + handelResponse(res,(req,msg)=>{ + + if(req.is_require_approval) + { + this.setState({audit_visible:true}) + } + else{ + this.submitCodeData(); + } + },(err)=>{ + Notify.error(err) + }) + }) + + } + },(err)=>{ + Notify.error(err) + }) + }) + + } + + + + } } onConfirm(){ - let approval_id = sessionStorage.getItem("approval_id") + this.setState({audit_visible:false}) - if(approval_id <= 0) - { - this.submitCodeData(); - }else{ - - getApprovalsStatus(approval_id).then((res)=>{ - handelResponse(res,(req,msg)=>{ - if(req.status == 0) - { - this.setState({recall_visible:true}) - } - if(req.status == 1) - { - Notify.error("进行中的批次不能提交审核") - setTimeout(()=>{ - this.props.history.push('/home/key-list/'); - },2000) - - } - if(req.status == 2 || req.status == 3){ - - this.submitCodeData(); - - } - },(err)=>{ - Notify.error(err) - }) - }) - - - - } + this.submitCodeData(); + // if(approval_id <= 0) + // { + // this.submitCodeData(); + // }else{ + // if(this.state.approvalsStatus==true) + // { + // this.setState({recall_visible:true}) + // } + + // } } @@ -727,6 +784,11 @@ export default class exchangedit extends React.Component{ clearInterval(timer_c) this.setState({approvalLoading:false}) Notify.success("撤销成功,请重新提交审核") + + + + + } let time = this.state.timer - 1; this.setState({timer:time}) diff --git a/src/pages/exchangecode/list/list.js b/src/pages/exchangecode/list/list.js index f946e846..68c17d85 100644 --- a/src/pages/exchangecode/list/list.js +++ b/src/pages/exchangecode/list/list.js @@ -175,6 +175,7 @@ export default class acclist extends React.Component{ sessionStorage.setItem("code_id",rowData.id) sessionStorage.setItem('breaknav',JSON.stringify(activerou)); sessionStorage.setItem("approval_id",rowData.approval_id) + sessionStorage.setItem("approval_status",rowData.status) window.open('#/home/exchangecode-edit'); } tabFn(index){ From cc304735f00465f8c73a3b9afdda1df97898f111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Fri, 7 Jan 2022 10:15:16 +0800 Subject: [PATCH 29/50] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=85=91=E6=8D=A2?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangecode/edit/edit.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/pages/exchangecode/edit/edit.js b/src/pages/exchangecode/edit/edit.js index d859052c..9a2b26b4 100644 --- a/src/pages/exchangecode/edit/edit.js +++ b/src/pages/exchangecode/edit/edit.js @@ -171,7 +171,7 @@ export default class exchangedit extends React.Component{ this.setState({tempdata:codeInfo.range}) let arr = []; - + let temp =[]; _.map(codeInfo.range,(res)=>{ let obj = {}; obj.key = res.product_id; @@ -180,15 +180,16 @@ export default class exchangedit extends React.Component{ { this.state.oldProduct.push(res.product_id); } + if(table.find(o=>o.product_id == res.product_id).checked == true) + { + temp.push(obj) + } arr.push(obj) return obj; }) - - - this.setState({rankoptions:arr}) - this.setState({rank:arr}) + this.setState({rank:temp}) if(payment_direction) From 873108bab71046df77648846795e02cbe5d22d66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Fri, 7 Jan 2022 11:00:41 +0800 Subject: [PATCH 30/50] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/enum.js | 2 +- src/pages/exchangecode/edit/edit.js | 15 +++++++++- src/pages/exchangecode/list/list.js | 40 ++++++++++++++++++++++++--- src/pages/plan/key/list.js | 43 ++++++++++++++++++++++++++--- src/pages/plan/key/list.less | 2 +- src/pages/plan/list/list.js | 2 +- 6 files changed, 92 insertions(+), 12 deletions(-) diff --git a/src/assets/enum.js b/src/assets/enum.js index 6b0b1303..58ce64b1 100644 --- a/src/assets/enum.js +++ b/src/assets/enum.js @@ -44,7 +44,7 @@ const menu={ case 4:return '进行中';break; case 5:return '暂停中';break; case 6:return '已完结';break; - case 7:return '审批驳回';break; + case 7:return '未通过';break; } }, planStatusBg(params) { diff --git a/src/pages/exchangecode/edit/edit.js b/src/pages/exchangecode/edit/edit.js index 9a2b26b4..dd7d8022 100644 --- a/src/pages/exchangecode/edit/edit.js +++ b/src/pages/exchangecode/edit/edit.js @@ -472,7 +472,20 @@ export default class exchangedit extends React.Component{ if(approval_id <= 0) { - this.setState({audit_visible:true}) + getIsRequireApproval(code_batch_id,data).then((res)=>{ + handelResponse(res,(req,msg)=>{ + + if(req.is_require_approval) + { + this.setState({audit_visible:true}) + } + else{ + this.submitCodeData(); + } + },(err)=>{ + Notify.error(err) + }) + }) } else{ getApprovalsStatus(approval_id).then((res)=>{ diff --git a/src/pages/exchangecode/list/list.js b/src/pages/exchangecode/list/list.js index 68c17d85..2991d35e 100644 --- a/src/pages/exchangecode/list/list.js +++ b/src/pages/exchangecode/list/list.js @@ -11,7 +11,7 @@ import TabPage from "../../../components/tabPage/main.js" import Filterbar from "../../../components/filterbar/main.js" import { nowMonth, nowDay } from "../../../assets/comm.js"; import menu from "../../../assets/enum.js" -import {getCodesList,handelResponse,delCode,putCodeStatus} from "../../../assets/api.js" +import {getCodesList,handelResponse,delCode,putCodeStatus,terminateApprovals} from "../../../assets/api.js" var moment = require("moment"); let day = moment(nowDay()).format("YYYY-MM-DD"); let tomonth = moment(nowMonth()).format("YYYY-MM-DD"); @@ -60,7 +60,7 @@ const Column = [ prop: 'opearo', name: 'opearo', type: "slot", - width:'auto', + width:'150px', },{ title: '状态', @@ -117,7 +117,7 @@ export default class acclist extends React.Component{ total:0, page:1, limit:10, - tabList:[{title:"全部",index:0},{title:"创建中",index:-1},{title:"未开始",index:3},{title:"审核中",index:6},{title:"审核驳回",index:7},{title:"进行中",index:1},{title:"暂停中",index:2},{title:"已结束",index:4},{title:"已作废",index:5}], + tabList:[{title:"全部",index:0},{title:"创建中",index:-1},{title:"未开始",index:3},{title:"审核中",index:6},{title:"未通过",index:7},{title:"进行中",index:1},{title:"暂停中",index:2},{title:"已结束",index:4},{title:"已作废",index:5}], combinedValue:[], DateTime:'',//数据更新时间 key_word:'', @@ -341,6 +341,35 @@ componentDidUpdate(prevProps,prevState){ this.getCodeListFn(); } } + onReCall(e,rowData){ + + let self = this; + let approval_id = rowData.approval_id + Sweetalert.confirm({ + type:'warning', + closeBtn:true, + title:'确认操作', + content:

    该数据正在审批中,是否确认撤销审批?

    , + onConfirm:()=>{ + terminateApprovals(approval_id).then((res)=>{ + handelResponse(res,(req,msg)=>{ + Notify.success("撤销审批成功") + setTimeout(()=>{ + this.getCodeListFn(); + },3000) + + },(err)=>{ + Notify.error(err) + }) + }) + }, + onCancel: this.onCancel, + className:'questModal', + parentComponent: this + }); + } + + render(){ const date = this.editinfo(e,rowData)}>编辑:编辑 } { - rowData.status!=4 && rowData.status!=5? this.delFn(e,rowData)} >作废:作废 + rowData.status!=4 && rowData.status!=5? this.delFn(e,rowData)} >作废:作废 } + { + rowData.status == 6 ? this.onReCall(e,rowData)} >撤销审批:撤销审批 + } {/* 复制 */}
  • } diff --git a/src/pages/plan/key/list.js b/src/pages/plan/key/list.js index 01f2fca1..72f0a088 100644 --- a/src/pages/plan/key/list.js +++ b/src/pages/plan/key/list.js @@ -46,7 +46,7 @@ const Column = [ name: 'plan', type: "slot", prop:'edit', - width:'120px' + width:'170px' }, { title: '状态', @@ -122,7 +122,7 @@ export default class acclist extends React.Component{ dataCount:0, page:1, limit:10, - tabList:[{title:"全部"},{title:"创建中"},{title:"审核中"},{title:"审批驳回"},{title:"进行中"},{title:"暂停中"},{title:"已完结"},{title:"已作废"}], + tabList:[{title:"全部"},{title:"创建中"},{title:"审核中"},{title:"未通过"},{title:"进行中"},{title:"暂停中"},{title:"已完结"},{title:"已作废"}], distdata:[], combinedValue:[], distdata2:[{id:12313123213123,name:'爱奇艺月卡兑换券',time:'2021-11-08 14:21:06至2021-11-08 15:06:04',plan:'营销计划2',belongid:3123213,send:100,record:58,used:41,dead:11,fail:12,status:'1'}], @@ -626,13 +626,17 @@ linkTo(row){ if(com == "edit") { - + let str = "" let str2 = 编辑 + + + 撤销审批): + 复制 { @@ -654,8 +658,39 @@ linkTo(row){ + if(rowData.status == 2) + { + + 编辑 + this.onReCall(e,rowData)} >撤销审批): + 复制 + { + keysIsSend(rowData.id).then((res)=>{ + handelResponse(res,(req,msg)=>{ + this.setState({isEmail: req.email}) + this.setState({isSms:req.isSms}) + },(err)=>{ + Notify.error(err) + }) + }) + }}> + +
    更多
    +
    + + +
    +
    + } + + + + + + str = {this.onEditRow(e,rowData)}} >编辑 + 撤销审批 {this.onCopyRow(e,rowData)}} >复制 { @@ -685,7 +720,7 @@ linkTo(row){ - return rowData.status == 7 || rowData.status == 6 ? str2 : str + return rowData.status == 7 || rowData.status == 6 ? str2 : str } }} /> diff --git a/src/pages/plan/key/list.less b/src/pages/plan/key/list.less index 51dec9dc..dd7735b8 100644 --- a/src/pages/plan/key/list.less +++ b/src/pages/plan/key/list.less @@ -13,6 +13,6 @@ cursor: pointer; } .linkmore.disabled ,.grid-link.disabled{ - color: #000000; + color: rgb(216, 219, 221); } } \ No newline at end of file diff --git a/src/pages/plan/list/list.js b/src/pages/plan/list/list.js index b03208dd..6fdf74b3 100644 --- a/src/pages/plan/list/list.js +++ b/src/pages/plan/list/list.js @@ -24,7 +24,7 @@ export default class acclist extends React.Component{ limit:10, tabList:[{title:"营销计划列表"}], distdata:[{title:'士大夫大师傅'}], - filterList:[{id:0,label:"状态", prop:"status", menuList:[{id:999,name:"全部"},{id:0,name:"创建中"},{id:2,name:"审核中"},{id:3,name:"待生效"},{id:4,name:"进行中"},{id:5,name:"暂停中"},{id:6,name:"已完结"},{id:7,name:"审批驳回"}]}, + filterList:[{id:0,label:"状态", prop:"status", menuList:[{id:999,name:"全部"},{id:0,name:"创建中"},{id:2,name:"审核中"},{id:3,name:"待生效"},{id:4,name:"进行中"},{id:5,name:"暂停中"},{id:6,name:"已完结"},{id:7,name:"未通过"}]}, ], tableHeight:500, menuList:[{id:0,name:"状态",check:false}], From 47fa7a359d56ef14747753d1f3c60d5c3e2f814f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Fri, 7 Jan 2022 11:41:08 +0800 Subject: [PATCH 31/50] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=85=91=E6=8D=A2?= =?UTF-8?q?=E7=A0=81=E6=96=B0=E5=A2=9E=E5=AE=A1=E6=89=B9=E4=B8=8D=E9=80=89?= =?UTF-8?q?=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangecode/edit/edit.js | 5 +-- src/pages/plan/key/list.js | 68 +++++++++++++++++++++-------- 2 files changed, 51 insertions(+), 22 deletions(-) diff --git a/src/pages/exchangecode/edit/edit.js b/src/pages/exchangecode/edit/edit.js index dd7d8022..11929c6c 100644 --- a/src/pages/exchangecode/edit/edit.js +++ b/src/pages/exchangecode/edit/edit.js @@ -101,8 +101,7 @@ export default class exchangedit extends React.Component{ if(req.new_product.length > 0) { - if(approval_status == 7) - { + req.new_product = _.map(req.new_product,(item)=>{ item.checked = false return item @@ -110,7 +109,7 @@ export default class exchangedit extends React.Component{ - } + codeInfo.range = codeInfo.range.concat(req.new_product); diff --git a/src/pages/plan/key/list.js b/src/pages/plan/key/list.js index 72f0a088..4aa9125f 100644 --- a/src/pages/plan/key/list.js +++ b/src/pages/plan/key/list.js @@ -10,7 +10,7 @@ import Grid from "../../../components/gird/main.js" import TabPage from "../../../components/tabPage/main.js" import Filterbar from "../../../components/filterbar/main.js" import menu from "../../../assets/enum.js" -import {getKeyList,handelResponse,planSend,startOrStopKeybatch,resKeyEmail,planResend,putKeyEmail,cancelKey,keysIsSend,getReseller,postKeyEmail} from "../../../assets/api.js" +import {terminateApprovals,getKeyList,handelResponse,planSend,startOrStopKeybatch,resKeyEmail,planResend,putKeyEmail,cancelKey,keysIsSend,getReseller,postKeyEmail} from "../../../assets/api.js" import _ from "lodash"; const Column = [ { @@ -556,6 +556,33 @@ linkTo(row){ onEmailChange(e){ this.setState({email_radio:e.target.value}) } + onReCall(e,rowData){ + + let self = this; + let approval_id = rowData.approval_id + Sweetalert.confirm({ + type:'warning', + closeBtn:true, + title:'确认操作', + content:

    该数据正在审批中,是否确认撤销审批?

    , + onConfirm:()=>{ + terminateApprovals(approval_id).then((res)=>{ + handelResponse(res,(req,msg)=>{ + Notify.success("撤销审批成功") + setTimeout(()=>{ + this.getKeyList(); + },3000) + + },(err)=>{ + Notify.error(err) + }) + }) + }, + onCancel: this.onCancel, + className:'questModal', + parentComponent: this + }); + } render(){ @@ -626,12 +653,11 @@ linkTo(row){ if(com == "edit") { - + let str="" - - - let str = "" - let str2 = + if(rowData.status == 6 || rowData.status == 7) + { + let str = 编辑 @@ -656,14 +682,14 @@ linkTo(row){ + } - - if(rowData.status == 2) + else if(rowData.status == 2) { - - 编辑 - this.onReCall(e,rowData)} >撤销审批): - 复制 + str = + {this.onEditRow(e,rowData)}}>编辑 + this.onReCall(e,rowData)} >撤销审批 + {this.onCopyRow(e,rowData)}}>复制 { keysIsSend(rowData.id).then((res)=>{ handelResponse(res,(req,msg)=>{ @@ -675,17 +701,21 @@ linkTo(row){ }) }}> -
    更多
    +
    更多
    + + this.menuItemClick(e,key,rowData)} > + 发送密码及压缩包 + 日志 + 作废 + +
    } - - - - + else{ str = @@ -719,8 +749,8 @@ linkTo(row){ - - return rowData.status == 7 || rowData.status == 6 ? str2 : str + } + return str } }} /> From 340533453b58b7aec19b93eff757f94e0748c9a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Fri, 7 Jan 2022 11:48:07 +0800 Subject: [PATCH 32/50] Update edit.js --- src/pages/exchangecode/edit/edit.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/pages/exchangecode/edit/edit.js b/src/pages/exchangecode/edit/edit.js index 11929c6c..90db17ec 100644 --- a/src/pages/exchangecode/edit/edit.js +++ b/src/pages/exchangecode/edit/edit.js @@ -100,18 +100,11 @@ export default class exchangedit extends React.Component{ if(req.new_product.length > 0) { - - - req.new_product = _.map(req.new_product,(item)=>{ - item.checked = false - return item - }) - - - - - - codeInfo.range = codeInfo.range.concat(req.new_product); + req.new_product = _.map(req.new_product,(item)=>{ + item.checked = false + return item + }) + codeInfo.range = codeInfo.range.concat(req.new_product); } From f1486a6ba44b04003cecab23f68a18133f64803f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Fri, 7 Jan 2022 12:02:12 +0800 Subject: [PATCH 33/50] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E5=88=A4=E6=96=AD=E5=90=8E=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangecode/edit/edit.js | 7 +------ src/pages/plan/key/edit.js | 5 +---- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/pages/exchangecode/edit/edit.js b/src/pages/exchangecode/edit/edit.js index 90db17ec..ebac9251 100644 --- a/src/pages/exchangecode/edit/edit.js +++ b/src/pages/exchangecode/edit/edit.js @@ -487,12 +487,7 @@ export default class exchangedit extends React.Component{ this.setState({approvalsStatus:true}) this.setState({recall_visible:true}) } - if(req.status == 1) - { - Notify.error("进行中的批次不能提交审核") - - } - if(req.status == 2 || req.status == 3){ + if(req.status == 1 || req.status == 2 || req.status == 3){ getIsRequireApproval(code_batch_id,data).then((res)=>{ handelResponse(res,(req,msg)=>{ diff --git a/src/pages/plan/key/edit.js b/src/pages/plan/key/edit.js index 5cf7ae56..44105613 100644 --- a/src/pages/plan/key/edit.js +++ b/src/pages/plan/key/edit.js @@ -540,10 +540,7 @@ export default class acclist extends React.Component{ } if(req.status == 1) { - Notify.error("进行中的批次不能提交审核") - setTimeout(()=>{ - this.props.history.push('/home/key-list/'); - },2000) + this.setState({audit_visible:true}) } if(req.status == 2 || req.status == 3){ From e4cccec485ab71daf59d23c4829c8f6b81658065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Fri, 7 Jan 2022 13:52:41 +0800 Subject: [PATCH 34/50] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangecode/list/list.js | 7 +++++++ src/pages/plan/key/list.js | 12 +++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/pages/exchangecode/list/list.js b/src/pages/exchangecode/list/list.js index 2991d35e..b1dee573 100644 --- a/src/pages/exchangecode/list/list.js +++ b/src/pages/exchangecode/list/list.js @@ -210,6 +210,13 @@ export default class acclist extends React.Component{ } //作废 delFn(e,row){ + if(row.status == 6) + { + Notify.error("审核中的数据不允许作废"); + return; + } + + let self = this Sweetalert.confirm({ type:'warning', diff --git a/src/pages/plan/key/list.js b/src/pages/plan/key/list.js index 4aa9125f..5d4cec77 100644 --- a/src/pages/plan/key/list.js +++ b/src/pages/plan/key/list.js @@ -146,7 +146,7 @@ export default class acclist extends React.Component{ email:"", email_radio:-1, phone_radio:-1, - + menuVisible:false } } @@ -482,6 +482,12 @@ phoneChange=(e)=> { let plan_id = row.id + if(row.status == 2) + { + Notify.error("审核中的数据不允许作废"); + this.setState({menuVisible:false}) + return; + } Sweetalert.confirm({ type:'warning', @@ -690,7 +696,7 @@ linkTo(row){ {this.onEditRow(e,rowData)}}>编辑 this.onReCall(e,rowData)} >撤销审批 {this.onCopyRow(e,rowData)}}>复制 - { + { keysIsSend(rowData.id).then((res)=>{ handelResponse(res,(req,msg)=>{ this.setState({isEmail: req.email}) @@ -708,7 +714,7 @@ linkTo(row){ this.menuItemClick(e,key,rowData)} > 发送密码及压缩包 日志 - 作废 + 作废 From db5d8b879623c32250614e65bd491e630b935743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Fri, 7 Jan 2022 16:27:03 +0800 Subject: [PATCH 35/50] Update list.js --- src/pages/plan/key/list.js | 49 ++++++-------------------------------- 1 file changed, 7 insertions(+), 42 deletions(-) diff --git a/src/pages/plan/key/list.js b/src/pages/plan/key/list.js index 5d4cec77..7f6b31bc 100644 --- a/src/pages/plan/key/list.js +++ b/src/pages/plan/key/list.js @@ -132,14 +132,9 @@ export default class acclist extends React.Component{ distdata11:[], tableHeight:600, disabled:false, - email:"", - key_word:'', + email:"", + key_word:'', phone:"", - isSend:false, - isEmail : false, - isSms :false, - - phone_list:[], email_list:[], phone:"", @@ -670,17 +665,8 @@ linkTo(row){ 撤销审批): 复制 - { - - keysIsSend(rowData.id).then((res)=>{ - handelResponse(res,(req,msg)=>{ - this.setState({isEmail: req.email}) - this.setState({isSms:req.isSms}) - },(err)=>{ - Notify.error(err) - }) - }) - }}> + this.setState({ visible: v })}>
    更多
    @@ -696,16 +682,7 @@ linkTo(row){ {this.onEditRow(e,rowData)}}>编辑 this.onReCall(e,rowData)} >撤销审批 {this.onCopyRow(e,rowData)}}>复制 - { - keysIsSend(rowData.id).then((res)=>{ - handelResponse(res,(req,msg)=>{ - this.setState({isEmail: req.email}) - this.setState({isSms:req.isSms}) - },(err)=>{ - Notify.error(err) - }) - }) - }}> + this.setState({ visible: v })}>
    更多
    @@ -728,20 +705,8 @@ linkTo(row){ {this.onEditRow(e,rowData)}} >编辑 撤销审批 {this.onCopyRow(e,rowData)}} >复制 - { - - keysIsSend(rowData.id).then((res)=>{ - handelResponse(res,(req,msg)=>{ - this.setState({isEmail: req.email}) - this.setState({isSms:req.isSms}) - },(err)=>{ - Notify.error(err) - }) - }) - - - console.log("是否展开",e) - }}> + this.setState({ visible: v }) + }>
    更多
    From 195470935427dfd29f9221d14765fd5169720d60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Fri, 7 Jan 2022 17:33:06 +0800 Subject: [PATCH 36/50] =?UTF-8?q?key=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/plan/key/detail/list.js | 21 ++++++++++----------- src/pages/plan/key/detail/log.js | 12 +++++++----- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/pages/plan/key/detail/list.js b/src/pages/plan/key/detail/list.js index 250a1679..cf5c0b1a 100644 --- a/src/pages/plan/key/detail/list.js +++ b/src/pages/plan/key/detail/list.js @@ -216,10 +216,7 @@ export default class acclist extends React.Component{ keyCancel(formdata).then((res)=>{ handelResponse(res,(req,msg)=>{ - - - - + Notify.success("作废成功") },(err)=>{ console.log(err) }) @@ -235,7 +232,7 @@ export default class acclist extends React.Component{ keyBatchUsage(formdata).then((res)=>{ handelResponse(res,(req,msg)=>{ - + Notify.success("标记为使用成功") },(err)=>{ console.log(err) }) @@ -244,11 +241,13 @@ export default class acclist extends React.Component{ } if(key == 3) { - console.log(rowData) - this.props.history.push('/home/key-log?key='+rowData.key); + sessionStorage.setItem("keyCode",rowData.key) + console.log("key数据",rowData) + this.props.history.push('/home/key-log'); sessionStorage.setItem('pathname2','/home/key-log') let cur_nav = sessionStorage.getItem("breakchangenav") + if(cur_nav.length > 0 && cur_nav[0].items) { cur_nav[0].items.push({path:"/home/key-log",name:cur_nav[0].items[cur_nav[0].items.length - 1].name+"日志"}) @@ -280,12 +279,12 @@ export default class acclist extends React.Component{ }) let formdata={ - keys:keys.toString() + keys:keys } keyBatchCancel(formdata).then((res)=>{ handelResponse(res,(req,msg)=>{ - + Notify.success("批量作废成功") },(err)=>{ console.log(err) }) @@ -297,12 +296,12 @@ export default class acclist extends React.Component{ }) let formdata={ - keys:keys.toString() + keys:keys } keyBatchUsage(formdata).then((res)=>{ handelResponse(res,(req,msg)=>{ - + Notify.success("批量标记为使用成功") },(err)=>{ console.log(err) }) diff --git a/src/pages/plan/key/detail/log.js b/src/pages/plan/key/detail/log.js index 333fe4c7..1835a8b6 100644 --- a/src/pages/plan/key/detail/log.js +++ b/src/pages/plan/key/detail/log.js @@ -35,6 +35,7 @@ const Column = [ export default class Key extends React.Component{ constructor(props){ super(props) + console.log("属性",props) this.state={ tabList:[{title:"日志"}], tabactive:0, @@ -42,7 +43,7 @@ export default class Key extends React.Component{ keyDetail_data:{}, tableHeight:500, page:1, - orderNo:'', + key:'', limit:10, total:0, } @@ -50,13 +51,12 @@ export default class Key extends React.Component{ componentDidMount(e){ let data = { page:1, - limit:10 + limit:10, } this.getKeyLogFn(data); } tabFn(index){ this.getKeyLogFn(); - } selection(){ @@ -64,10 +64,12 @@ export default class Key extends React.Component{ //获取订单日志 getKeyLogFn(){ let _self=this; - let {page,limit,orderNo}=this.state; + let {page,limit}=this.state; + let data={ page, - limit + limit, + key:sessionStorage.getItem("keyCode") } getKeyLog(data).then(res=>{ handelResponse(res,(response,msg)=>{ From 2c8188aa8843e0e6f5e7cb430a18e3a4560a232c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Fri, 7 Jan 2022 17:44:38 +0800 Subject: [PATCH 37/50] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/api.js | 10 +++++----- src/pages/plan/key/detail/list.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/assets/api.js b/src/assets/api.js index 9c572173..fd00796c 100644 --- a/src/assets/api.js +++ b/src/assets/api.js @@ -847,7 +847,7 @@ export const delSystemTemplate= (id) => { //key码列表 export const getkeyDetailList= (id,data) => { - return req('get', "http://192.168.6.98:8000" + "/key/"+id,data) + return req('get', baseurl + "/key/"+id,data) } @@ -873,20 +873,20 @@ export const getApprovalsStatus= (id,data) => { //作废 export const keyBatchCancel= (data) => { - return req('put', "http://192.168.6.98:8000" + "/key/batch_cancel",data) + return req('put', baseurl + "/key/batch_cancel",data) } //作废 export const keyCancel= (data) => { - return req('put', "http://192.168.6.98:8000" + "/key/cancel",data) + return req('put', baseurl + "/key/cancel",data) } //标记使用 export const keyBatchUsage= (data) => { - return req('put', "http://192.168.6.98:8000" + "/key/usage",data) + return req('put', baseurl + "/key/usage",data) } //获取日志 export const getKeyLog= (data) => { - return req('get', "http://192.168.6.98:8000" + "/key/log/list",data) + return req('get', baseurl + "/key/log/list",data) } diff --git a/src/pages/plan/key/detail/list.js b/src/pages/plan/key/detail/list.js index cf5c0b1a..3fe63d72 100644 --- a/src/pages/plan/key/detail/list.js +++ b/src/pages/plan/key/detail/list.js @@ -331,7 +331,7 @@ export default class acclist extends React.Component{ prop:'status', name: 'status', width:'auto', - type: "normal", + type: "slot", }, { title: '操作', From 2c639a3e76f0257b527d944a5b2f327bd7a0fd75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Mon, 10 Jan 2022 10:26:07 +0800 Subject: [PATCH 38/50] =?UTF-8?q?=E6=9B=B4=E6=96=B0key=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangecode/add/add.js | 1 + src/pages/plan/add/add.js | 7 +-- src/pages/plan/key/detail/list.js | 77 +++++++++++++++++++++---------- src/pages/plan/key/list.js | 15 +++--- src/pages/plan/list/list.js | 2 +- 5 files changed, 68 insertions(+), 34 deletions(-) diff --git a/src/pages/exchangecode/add/add.js b/src/pages/exchangecode/add/add.js index 5ca809d3..4162253d 100644 --- a/src/pages/exchangecode/add/add.js +++ b/src/pages/exchangecode/add/add.js @@ -508,6 +508,7 @@ export default class acclist extends React.Component{ return } this.setState({audit_visible:false}) + let id = sessionStorage.getItem("key_plan_id") addKeysBatchInfo(id,data).then((res)=>{ handelResponse(res,(req,msg)=>{ diff --git a/src/pages/plan/add/add.js b/src/pages/plan/add/add.js index 757a70ab..a272eb0b 100644 --- a/src/pages/plan/add/add.js +++ b/src/pages/plan/add/add.js @@ -36,6 +36,7 @@ export default class add extends React.Component{ reseller:"", payment_direction:["对私账户","对公账户","预付款扣除"], isload:false, + is_audit:false } } @@ -65,8 +66,8 @@ export default class add extends React.Component{ onConfirm(e){ let plan_id = sessionStorage.getItem("plan_id") - - + this.setState({is_audit:true}) + this.setState({audit_visible:false}) let data = { "reseller_id":this.state.reseller.id, @@ -78,9 +79,9 @@ export default class add extends React.Component{ approvals(plan_id,data).then((res)=>{ handelResponse(res,(req,msg)=>{ - this.setState({audit_visible:false}) Notify.success("成功发起审批") this.props.history.push('/home/plan-list/'); + this.setState({is_audit:false}) },(err)=>{ Notify.error(err) }) diff --git a/src/pages/plan/key/detail/list.js b/src/pages/plan/key/detail/list.js index 3fe63d72..d9e7c2e8 100644 --- a/src/pages/plan/key/detail/list.js +++ b/src/pages/plan/key/detail/list.js @@ -44,12 +44,13 @@ export default class acclist extends React.Component{ selectiondata:[], plan_id:0, grantTotal:0, - receiveTotal:0, + surplusTotal:0, usageTotal:0, silentTotal:0, receive_total:0, usage_total:0, - silent_total:0, + outdateTotal:0, + invalidTotal:0, multiple:true } } @@ -133,22 +134,26 @@ export default class acclist extends React.Component{ this.setState({selectiondata:selection}); let grantTotal=0; - let receiveTotal=0; + let surplusTotal=0; let usageTotal=0; - let silentTotal=0; let receive_total=0; let usage_total=0; let silent_total=0; + let invalidTotal = 0; + let outdateTotal = 0; selection.forEach(item=>{ - grantTotal+=Number(item.grant); - receiveTotal+=Number(item.receive); + grantTotal+=Number(item.total); + surplusTotal+=Number(item.residue); usageTotal+=Number(item.usage); - silentTotal+=Number(item.silent); - receive_total+=Number(item.receive_total); + outdateTotal+=Number(item.overdue) + console.log(item.invalid) + invalidTotal+=Number(item.invalid) + + // receive_total+=Number(item.receive_total); usage_total+=Number(item.usage_total); silent_total+=Number(item.silent_total); }); - this.setState({grantTotal,receiveTotal,usageTotal,silentTotal,receive_total,usage_total,silent_total}); + this.setState({grantTotal,usageTotal,invalidTotal,outdateTotal}); } // 监听组件内部状态的变化: @@ -214,9 +219,17 @@ export default class acclist extends React.Component{ key:rowData.key } - keyCancel(formdata).then((res)=>{ + + + keyBatchUsage(formdata).then((res)=>{ handelResponse(res,(req,msg)=>{ - Notify.success("作废成功") + let data = { + page:1, + limit:10, + } + this.setState({page:1,limit:10}) + this.getKeyCodeList(data); + Notify.success("标记为使用成功") },(err)=>{ console.log(err) }) @@ -229,20 +242,25 @@ export default class acclist extends React.Component{ let formdata={ key:rowData.key } - - keyBatchUsage(formdata).then((res)=>{ + keyCancel(formdata).then((res)=>{ handelResponse(res,(req,msg)=>{ - Notify.success("标记为使用成功") + let data = { + page:1, + limit:10, + } + this.setState({page:1,limit:10}) + this.getKeyCodeList(data); + Notify.success("作废成功") },(err)=>{ console.log(err) }) }) + } if(key == 3) { - sessionStorage.setItem("keyCode",rowData.key) - console.log("key数据",rowData) + sessionStorage.setItem("keyCode",rowData.key) this.props.history.push('/home/key-log'); sessionStorage.setItem('pathname2','/home/key-log') @@ -285,8 +303,14 @@ export default class acclist extends React.Component{ keyBatchCancel(formdata).then((res)=>{ handelResponse(res,(req,msg)=>{ Notify.success("批量作废成功") + let data = { + page:1, + limit:10, + } + this.setState({page:1,limit:10}) + this.getKeyCodeList(data); },(err)=>{ - console.log(err) + Notify.error(err) }) }) } @@ -302,8 +326,14 @@ export default class acclist extends React.Component{ keyBatchUsage(formdata).then((res)=>{ handelResponse(res,(req,msg)=>{ Notify.success("批量标记为使用成功") + let data = { + page:1, + limit:10, + } + this.setState({page:1,limit:10}) + this.getKeyCodeList(data); },(err)=>{ - console.log(err) + Notify.error(err) }) }) } @@ -363,8 +393,8 @@ export default class acclist extends React.Component{ }, { title: '已过期条数', - name: 'usage', - prop:'usage', + name: 'overdue', + prop:'overdue', type: "normal", width:'auto' }, @@ -423,9 +453,8 @@ export default class acclist extends React.Component{ type="info" extraContent={} > - 已选择{this.state.selectiondata.length}发放key总数:{this.state.grantTotal},领取key总数:{this.state.receiveTotal},已使用总数:{this.state.usageTotal},沉默总数:{this.state.silentTotal},领取总价(预估):{this.state.receive_total.toFixed(4)}, - 已使用总价(预估):{this.state.usage_total.toFixed(4)}, - 沉默总价(预估):{this.state.silent_total.toFixed(4)} + 已选择{this.state.selectiondata.length}发放key总数:{this.state.grantTotal},剩余key总数:{this.state.surplusTotal},已使用总数:{this.state.usageTotal},已过期总数:{this.state.outdateTotal},已作废总数:{this.state.invalidTotal} + ):null } { menu.keyStatus(parseInt(rowData.status))}

    + return

    { rowData.status_text}

    } if(com == "opearo") { diff --git a/src/pages/plan/key/list.js b/src/pages/plan/key/list.js index 1b967545..ab9a7403 100644 --- a/src/pages/plan/key/list.js +++ b/src/pages/plan/key/list.js @@ -601,7 +601,7 @@ linkTo(row){ const { current, pageSize } = this.state; return(
    - +

    {/* */} @@ -655,14 +655,15 @@ linkTo(row){ { let str="" - + console.log("当前状态",rowData.status) if(rowData.status == 6 || rowData.status == 7) { - let str = + console.log(rowData.batch_name,rowData.status) + str = 编辑 - 撤销审批): + 撤销审批 复制 } - - else if(rowData.status == 2) + else if(rowData.status == 2) { str = {this.onEditRow(e,rowData)}}>编辑 @@ -721,6 +721,9 @@ linkTo(row){ } + + console.log(str) + return str } }} diff --git a/src/pages/plan/list/list.js b/src/pages/plan/list/list.js index 3311a4a1..a09288db 100644 --- a/src/pages/plan/list/list.js +++ b/src/pages/plan/list/list.js @@ -726,7 +726,7 @@ export default class acclist extends React.Component{

    } - + console.log("菜单",str) return str } From c430fda898465a74bff4b6d096c64be54629b591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Mon, 10 Jan 2022 10:33:55 +0800 Subject: [PATCH 39/50] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E5=A4=9A=E9=80=89=E9=83=A8=E5=88=86=E7=BB=9F=E8=AE=A1=E6=B8=85?= =?UTF-8?q?=E7=A9=BA=E6=8C=89=E9=92=AE=E7=82=B9=E5=87=BB=E5=85=A8=E9=80=89?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=9B=B4=E6=96=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/gird/main.js | 4 +++- src/pages/plan/key/detail/list.js | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/gird/main.js b/src/components/gird/main.js index af25e131..6a0bd2dd 100644 --- a/src/components/gird/main.js +++ b/src/components/gird/main.js @@ -243,7 +243,9 @@ export default class menu extends React.Component { item.checked =false return item }) - + this.setState({ + indeterminate: false + }) this.setState({tableData:tabledata}) } diff --git a/src/pages/plan/key/detail/list.js b/src/pages/plan/key/detail/list.js index d9e7c2e8..f7da30db 100644 --- a/src/pages/plan/key/detail/list.js +++ b/src/pages/plan/key/detail/list.js @@ -115,7 +115,6 @@ export default class acclist extends React.Component{ //清空 clearFn(){ this.refs.plan_list.allChecked(false) - this.setState({'selectiondata':[]}) } //选中表格的选框 selection(selection){ From 6de20f140a6372dc7d5dd79daf9b1afe01f6bc7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Mon, 10 Jan 2022 10:58:26 +0800 Subject: [PATCH 40/50] =?UTF-8?q?=E6=9B=B4=E6=96=B0key=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/api.js | 4 ++++ src/pages/plan/key/detail/list.js | 14 ++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/assets/api.js b/src/assets/api.js index fd00796c..fa93bfa5 100644 --- a/src/assets/api.js +++ b/src/assets/api.js @@ -882,6 +882,10 @@ export const keyCancel= (data) => { } //标记使用 export const keyBatchUsage= (data) => { + return req('put', baseurl + "/key/batch_usage",data) +} +//标记使用 +export const keyUsage= (data) => { return req('put', baseurl + "/key/usage",data) } //获取日志 diff --git a/src/pages/plan/key/detail/list.js b/src/pages/plan/key/detail/list.js index f7da30db..46029c8d 100644 --- a/src/pages/plan/key/detail/list.js +++ b/src/pages/plan/key/detail/list.js @@ -8,7 +8,7 @@ import Ipt from "../../../../components/input/main" import Grid from "../../../../components/gird/main.js" import TabPage from "../../../../components/tabPage/main.js" import Filterbar from "../../../../components/filterbar/main.js" -import {getKeyLog,planIsSend,keyCancel,keyBatchUsage,keyBatchCancel,getPlanList,handelResponse,startOrStopPlan,getAllEnum,resKeyEmail,planSend,planResend,planReceive,getReseller,getkeyDetailList} from "../../../../assets/api.js" +import {getKeyLog,planIsSend,keyCancel,keyUsage,keyBatchUsage,keyBatchCancel,getPlanList,handelResponse,startOrStopPlan,getAllEnum,resKeyEmail,planSend,planResend,planReceive,getReseller,getkeyDetailList} from "../../../../assets/api.js" import _ from "lodash"; import menu from "../../../../assets/enum.js" @@ -24,8 +24,7 @@ export default class acclist extends React.Component{ dataCount:0, page:1, limit:10, - // tabList:[{title:"全部",index:0},{title:"待使用",index:1},{title:"已使用",index:2},{title:"已完结",index:3},{title:"已作废",index:4}], - tabList:[{title:"key码列表",index:0}], + tabList:[{title:"全部",index:0},{title:"待使用",index:1},{title:"已使用",index:2},{title:"已完结",index:3},{title:"已作废",index:4}], distdata:[{title:'士大夫大师傅'}], filterList:[{id:0,label:"状态", prop:"status", menuList:[{id:999,name:"全部"},{id:0,name:"创建中"},{id:2,name:"审核中"},{id:3,name:"待生效"},{id:4,name:"进行中"},{id:5,name:"暂停中"},{id:6,name:"已完结"}]}, ], @@ -115,6 +114,7 @@ export default class acclist extends React.Component{ //清空 clearFn(){ this.refs.plan_list.allChecked(false) + this.setState({'selectiondata':[]}) } //选中表格的选框 selection(selection){ @@ -152,7 +152,7 @@ export default class acclist extends React.Component{ usage_total+=Number(item.usage_total); silent_total+=Number(item.silent_total); }); - this.setState({grantTotal,usageTotal,invalidTotal,outdateTotal}); + this.setState({grantTotal,usageTotal,invalidTotal,outdateTotal,surplusTotal}); } // 监听组件内部状态的变化: @@ -198,11 +198,13 @@ export default class acclist extends React.Component{ let status = e > 0 ? e : null if(!status) { - this.setState({status:e}) + this.setState({status:e}) } this.setState({search:""}) + this.setState({page:1}) + this.setState({limit:10}) let params={ page:1, limit:10, @@ -220,7 +222,7 @@ export default class acclist extends React.Component{ - keyBatchUsage(formdata).then((res)=>{ + keyUsage(formdata).then((res)=>{ handelResponse(res,(req,msg)=>{ let data = { page:1, From 31794b2162aeb28bef4b0371df183436a3937c4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Mon, 10 Jan 2022 11:00:04 +0800 Subject: [PATCH 41/50] Update list.js --- src/pages/plan/key/detail/list.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/plan/key/detail/list.js b/src/pages/plan/key/detail/list.js index 46029c8d..9fd77e83 100644 --- a/src/pages/plan/key/detail/list.js +++ b/src/pages/plan/key/detail/list.js @@ -114,7 +114,7 @@ export default class acclist extends React.Component{ //清空 clearFn(){ this.refs.plan_list.allChecked(false) - this.setState({'selectiondata':[]}) + this.setState({'selectiondata':[]}) } //选中表格的选框 selection(selection){ From 278e61ee33dbd87a196f965a7878ebb383775ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Mon, 10 Jan 2022 11:28:03 +0800 Subject: [PATCH 42/50] =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E7=9A=84=E6=B5=81=E7=A8=8B=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/plan/key/detail/list.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pages/plan/key/detail/list.js b/src/pages/plan/key/detail/list.js index 9fd77e83..70770b29 100644 --- a/src/pages/plan/key/detail/list.js +++ b/src/pages/plan/key/detail/list.js @@ -114,7 +114,9 @@ export default class acclist extends React.Component{ //清空 clearFn(){ this.refs.plan_list.allChecked(false) + this.setState({multiple:true}) this.setState({'selectiondata':[]}) + } //选中表格的选框 selection(selection){ @@ -309,6 +311,7 @@ export default class acclist extends React.Component{ limit:10, } this.setState({page:1,limit:10}) + this.clearFn(); this.getKeyCodeList(data); },(err)=>{ Notify.error(err) @@ -332,6 +335,7 @@ export default class acclist extends React.Component{ limit:10, } this.setState({page:1,limit:10}) + this.clearFn(); this.getKeyCodeList(data); },(err)=>{ Notify.error(err) From 6a5b34afffc81427020879457592d02f2347f2fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Mon, 10 Jan 2022 16:31:03 +0800 Subject: [PATCH 43/50] =?UTF-8?q?=E8=B0=83=E6=95=B4swicth=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E6=95=B0=E6=8D=AE=E6=BA=90=EF=BC=8C=E6=B8=85=E9=99=A4?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/plan/list/list.js | 43 ++++--------------------------------- 1 file changed, 4 insertions(+), 39 deletions(-) diff --git a/src/pages/plan/list/list.js b/src/pages/plan/list/list.js index a09288db..c8a2a360 100644 --- a/src/pages/plan/list/list.js +++ b/src/pages/plan/list/list.js @@ -22,12 +22,12 @@ export default class acclist extends React.Component{ dataCount:0, page:1, limit:10, - tabList:[{title:"营销计划列表"}], - distdata:[{title:'士大夫大师傅'}], - filterList:[{id:0,label:"状态", prop:"status", menuList:[{id:999,name:"全部"},{id:0,name:"创建中"},{id:2,name:"审核中"},{id:3,name:"待生效"},{id:4,name:"进行中"},{id:5,name:"暂停中"},{id:6,name:"已完结"},{id:7,name:"未通过"}]}, + tabList:[{title:"营销计划列表"}], + distdata:[], + filterList:[{id:0,label:"状态", prop:"status", menuList:[{id:999,name:"全部"},{id:0,name:"创建中"},{id:2,name:"审核中"},{id:3,name:"待生效"},{id:4,name:"进行中"},{id:5,name:"暂停中"},{id:6,name:"已完结"},{id:7,name:"未通过"}]}, ], tableHeight:500, - menuList:[{id:0,name:"状态",check:false}], + menuList:[{id:0,name:"状态",check:false}], phone_list:[], email_list:[], phone:"", @@ -96,37 +96,9 @@ export default class acclist extends React.Component{ planSend(plan_id,data).then((res)=>{ handelResponse(res,(req,msg)=>{ - - // if(this.state.isSend == false) - // { - // let data = { - // "operation": 1 - // } - - - // startOrStopPlan(plan_id,data).then((res)=>{ - // handelResponse(res,(req,msg)=>{ - // console.log(77777777777) - // let data = { - // page:this.state.page, - // limit:this.state.limit - // } - // this.getPlanList(data); - // this.setState({isSend:true}) - - // },(err)=>{ - // console.log(88888888888) - // Notify.error(err) - // }) - // }) - - - // } this.setState({audit_visible:false}) Notify.success("发送成功") },(err)=>{ - - Notify.error(err) }) }) @@ -134,9 +106,6 @@ export default class acclist extends React.Component{ } componentDidMount(e){ - - - let data = { page:1, limit:10 @@ -148,11 +117,9 @@ export default class acclist extends React.Component{ } getPlanList(data){ - let queryParams = _.omitBy(data, (value) => { return _.isNaN(value) || _.isNil(value) }) - getPlanList(queryParams).then((res)=>{ handelResponse(res,(req,msg)=>{ this.setState({distdata:req.data}) @@ -203,8 +170,6 @@ export default class acclist extends React.Component{ "operation": status ? 1 : 2 } - - if(row.status == 3) { From 814e04a2ea14c863bd55c8868594569b1c3b5eb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Mon, 10 Jan 2022 16:49:53 +0800 Subject: [PATCH 44/50] =?UTF-8?q?=E9=98=B2=E6=AD=A2key=E5=8F=91=E8=B5=B7?= =?UTF-8?q?=E5=A4=9A=E6=AC=A1=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/plan/key/detail/list.js | 20 +------------------- src/pages/plan/key/list.js | 22 ++++++---------------- 2 files changed, 7 insertions(+), 35 deletions(-) diff --git a/src/pages/plan/key/detail/list.js b/src/pages/plan/key/detail/list.js index 70770b29..8f0fd5f2 100644 --- a/src/pages/plan/key/detail/list.js +++ b/src/pages/plan/key/detail/list.js @@ -64,11 +64,7 @@ export default class acclist extends React.Component{ } componentDidMount(e){ - let data = { - page:1, - limit:10 - } - this.getKeyCodeList(data); + } componentWillMount(){ this.setState({tableHeight:window.innerHeight-430}); @@ -196,7 +192,6 @@ export default class acclist extends React.Component{ } tabFn(e){ - console.log(e) let status = e > 0 ? e : null if(!status) { @@ -222,8 +217,6 @@ export default class acclist extends React.Component{ key:rowData.key } - - keyUsage(formdata).then((res)=>{ handelResponse(res,(req,msg)=>{ let data = { @@ -277,17 +270,6 @@ export default class acclist extends React.Component{ console.log("当前菜单", cur_nav) sessionStorage.setItem('breaknav',JSON.stringify(cur_nav)); - - // let formdata={ - // key:rowData.key - // } - // getKeyLog(formdata).then((res)=>{ - // handelResponse(res,(req,msg)=>{ - - // },(err)=>{ - // console.log(err) - // }) - // }) } diff --git a/src/pages/plan/key/list.js b/src/pages/plan/key/list.js index ab9a7403..cbb3d147 100644 --- a/src/pages/plan/key/list.js +++ b/src/pages/plan/key/list.js @@ -168,13 +168,6 @@ export default class acclist extends React.Component{ Notify.error("手机号格式不正确") return; } - // if(!emailReg.test(data.email)){ - - // Notify.error("邮箱格式不正确") - // return; - - // } - postKeyEmail(key_id,data).then((res)=>{ @@ -240,7 +233,7 @@ export default class acclist extends React.Component{ } componentDidMount(){ - this.getKeyList(); + // this.getKeyList(); } @@ -336,12 +329,10 @@ export default class acclist extends React.Component{ } this.setState({page:1,limit:10}) + setTimeout(() => { this.getKeyList(); }, 10); - - - } //作废 delFn(){ @@ -387,10 +378,10 @@ export default class acclist extends React.Component{ operation: status ? 4 : 5 } startOrStopKeybatch(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].status = status; - this.setState({distdata:this.state.distdata}) + handelResponse(res,(req,msg)=>{ + let id = _.findIndex(this.state.distdata,(o)=>{return o.id == row.id}); + this.state.distdata[id].status = status; + this.setState({distdata:this.state.distdata}) Notify.success(msg); let data = { page:1, @@ -546,7 +537,6 @@ linkTo(row){ componentDidUpdate(prevProps,prevState){ // 参数分别为改变之前的数据状态对象 if(prevState.key_word!=this.state.key_word &&!this.state.key_word){ - this.getKeyList(); } From 9b4a2273875a9275116ce8786b6a2cdb0e066da9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Mon, 10 Jan 2022 17:56:27 +0800 Subject: [PATCH 45/50] =?UTF-8?q?=E7=A6=81=E7=94=A8=E5=85=91=E6=8D=A2?= =?UTF-8?q?=E7=A0=81=E5=95=86=E5=93=81=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangecode/commodity/commodity.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/exchangecode/commodity/commodity.js b/src/pages/exchangecode/commodity/commodity.js index 453b98d0..32489be3 100644 --- a/src/pages/exchangecode/commodity/commodity.js +++ b/src/pages/exchangecode/commodity/commodity.js @@ -11,6 +11,7 @@ import Filterbar from "../../../components/filterbar/main.js" import {getCodeProductList,handelResponse,delCodeProduct} from "../../../assets/api.js" import Productform from "../product/add" import _ from "lodash"; +/* this.editinfo(e,rowData)}>编辑 */ const Column = [ { title: '商品编号', @@ -291,7 +292,7 @@ export default class commoditylist extends React.Component{ if(com == "opearo") { return
    - this.editinfo(e,rowData)}>编辑 + this.deleteFn(e,rowData)}>删除
    } From 8dd666768f9d40a1367cf929f57c03c5a8ead3ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Mon, 10 Jan 2022 18:20:27 +0800 Subject: [PATCH 46/50] =?UTF-8?q?=E5=85=91=E6=8D=A2=E7=A0=81=E5=95=86?= =?UTF-8?q?=E5=93=81=E6=9A=82=E6=97=B6=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/plan/add/edit.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/pages/plan/add/edit.js b/src/pages/plan/add/edit.js index 08cb0104..c228e617 100644 --- a/src/pages/plan/add/edit.js +++ b/src/pages/plan/add/edit.js @@ -44,6 +44,7 @@ export default class add extends React.Component{ timer:3, theme_options:[], isload:false, + is_Edit:false, } } @@ -238,13 +239,8 @@ export default class add extends React.Component{ { temp.push(data) - console.log("key的数据") - console.log(temp) - } else{ - - console.log(7777) return; } @@ -262,8 +258,6 @@ export default class add extends React.Component{ await addPlanStep(plan_id,obj).then((res)=>{ handelResponse(res,(req,msg)=>{ this.setState({curstep:3}) - - console.log("第二部") sessionStorage.setItem("step2", JSON.stringify(temp)) this.setState({card_visible:true}) return; @@ -274,7 +268,6 @@ export default class add extends React.Component{ } - console.log("第三部") if(this.state.curstep == 3){ let data = this.refs.step3.submit(); @@ -297,7 +290,6 @@ export default class add extends React.Component{ getReseller(id).then((res)=>{ handelResponse(res,(req,msg)=>{ - console.log("分销商数据",req) this.setState({reseller:req}) this.setState({phone_list:req.contact_phone}) @@ -391,12 +383,20 @@ export default class add extends React.Component{ } async onEditInfo(){ + let plan_id = sessionStorage.getItem("plan_id") - if( await this.refs.step1.submit(plan_id)) + if( !this.state.is_Edit) { + console.log("是否编辑",this.state.is_Edit) + this.setState({is_Edit:true}) + if(await this.refs.step1.submit(plan_id)) + { + setTimeout(()=>{ this.props.history.push('/home/plan-list/'); + this.setState({is_Edit:false}) },1500) + } } } onConfirm(e){ From 1e352d41399ee0877acc8285c35cb87a56eb7ab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Tue, 11 Jan 2022 09:57:16 +0800 Subject: [PATCH 47/50] =?UTF-8?q?=E5=9B=9E=E9=80=80key=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/plan/key/detail/list.js | 277 ++++------------------------ src/pages/plan/key/detail/list.less | 3 - 2 files changed, 40 insertions(+), 240 deletions(-) diff --git a/src/pages/plan/key/detail/list.js b/src/pages/plan/key/detail/list.js index 8f0fd5f2..7b1474bd 100644 --- a/src/pages/plan/key/detail/list.js +++ b/src/pages/plan/key/detail/list.js @@ -8,7 +8,7 @@ import Ipt from "../../../../components/input/main" import Grid from "../../../../components/gird/main.js" import TabPage from "../../../../components/tabPage/main.js" import Filterbar from "../../../../components/filterbar/main.js" -import {getKeyLog,planIsSend,keyCancel,keyUsage,keyBatchUsage,keyBatchCancel,getPlanList,handelResponse,startOrStopPlan,getAllEnum,resKeyEmail,planSend,planResend,planReceive,getReseller,getkeyDetailList} from "../../../../assets/api.js" +import {planIsSend,getPlanList,handelResponse,startOrStopPlan,getAllEnum,resKeyEmail,planSend,planResend,planReceive,getReseller,getkeyDetailList} from "../../../../assets/api.js" import _ from "lodash"; import menu from "../../../../assets/enum.js" @@ -24,7 +24,8 @@ export default class acclist extends React.Component{ dataCount:0, page:1, limit:10, - tabList:[{title:"全部",index:0},{title:"待使用",index:1},{title:"已使用",index:2},{title:"已完结",index:3},{title:"已作废",index:4}], + // tabList:[{title:"全部",index:0},{title:"待使用",index:1},{title:"已使用",index:2},{title:"已完结",index:3},{title:"已作废",index:4}], + tabList:[{title:"key码列表",index:0}], distdata:[{title:'士大夫大师傅'}], filterList:[{id:0,label:"状态", prop:"status", menuList:[{id:999,name:"全部"},{id:0,name:"创建中"},{id:2,name:"审核中"},{id:3,name:"待生效"},{id:4,name:"进行中"},{id:5,name:"暂停中"},{id:6,name:"已完结"}]}, ], @@ -43,14 +44,13 @@ export default class acclist extends React.Component{ selectiondata:[], plan_id:0, grantTotal:0, - surplusTotal:0, + receiveTotal:0, usageTotal:0, silentTotal:0, receive_total:0, usage_total:0, - outdateTotal:0, - invalidTotal:0, - multiple:true + silent_total:0 + } } @@ -64,7 +64,11 @@ export default class acclist extends React.Component{ } componentDidMount(e){ - + let data = { + page:1, + limit:10 + } + this.getKeyCodeList(data); } componentWillMount(){ this.setState({tableHeight:window.innerHeight-430}); @@ -110,47 +114,28 @@ export default class acclist extends React.Component{ //清空 clearFn(){ this.refs.plan_list.allChecked(false) - this.setState({multiple:true}) this.setState({'selectiondata':[]}) - } //选中表格的选框 selection(selection){ - - - console.log("选择",selection) - if(selection.length > 0) - { - this.setState({multiple:false}) - } - else{ - this.setState({multiple:true}) - } - // this.setState({multiple:false}) - - this.setState({selectiondata:selection}); let grantTotal=0; - let surplusTotal=0; + let receiveTotal=0; let usageTotal=0; + let silentTotal=0; let receive_total=0; let usage_total=0; let silent_total=0; - let invalidTotal = 0; - let outdateTotal = 0; selection.forEach(item=>{ - grantTotal+=Number(item.total); - surplusTotal+=Number(item.residue); + grantTotal+=Number(item.grant); + receiveTotal+=Number(item.receive); usageTotal+=Number(item.usage); - outdateTotal+=Number(item.overdue) - console.log(item.invalid) - invalidTotal+=Number(item.invalid) - - // receive_total+=Number(item.receive_total); + silentTotal+=Number(item.silent); + receive_total+=Number(item.receive_total); usage_total+=Number(item.usage_total); silent_total+=Number(item.silent_total); }); - this.setState({grantTotal,usageTotal,invalidTotal,outdateTotal,surplusTotal}); + this.setState({grantTotal,receiveTotal,usageTotal,silentTotal,receive_total,usage_total,silent_total}); } // 监听组件内部状态的变化: @@ -192,16 +177,15 @@ export default class acclist extends React.Component{ } tabFn(e){ + console.log(e) let status = e > 0 ? e : null if(!status) { - this.setState({status:e}) + this.setState({status:e}) } this.setState({search:""}) - this.setState({page:1}) - this.setState({limit:10}) let params={ page:1, limit:10, @@ -209,122 +193,6 @@ export default class acclist extends React.Component{ } this.getKeyCodeList(params) } - menuItemClick(e,key,rowData){ - console.log("选择菜单",rowData) - if(key == 1) - { - let formdata={ - key:rowData.key - } - - keyUsage(formdata).then((res)=>{ - handelResponse(res,(req,msg)=>{ - let data = { - page:1, - limit:10, - } - this.setState({page:1,limit:10}) - this.getKeyCodeList(data); - Notify.success("标记为使用成功") - },(err)=>{ - console.log(err) - }) - }) - - } - if(key == 2) - { - - let formdata={ - key:rowData.key - } - keyCancel(formdata).then((res)=>{ - handelResponse(res,(req,msg)=>{ - let data = { - page:1, - limit:10, - } - this.setState({page:1,limit:10}) - this.getKeyCodeList(data); - Notify.success("作废成功") - },(err)=>{ - console.log(err) - }) - }) - - - } - if(key == 3) - { - sessionStorage.setItem("keyCode",rowData.key) - this.props.history.push('/home/key-log'); - sessionStorage.setItem('pathname2','/home/key-log') - - let cur_nav = sessionStorage.getItem("breakchangenav") - - if(cur_nav.length > 0 && cur_nav[0].items) - { - cur_nav[0].items.push({path:"/home/key-log",name:cur_nav[0].items[cur_nav[0].items.length - 1].name+"日志"}) - } - - console.log("当前菜单", cur_nav) - sessionStorage.setItem('breaknav',JSON.stringify(cur_nav)); - - } - - - } - multipleCancel(){ - - console.log(this.state.selectiondata) - let keys = _.map(this.state.selectiondata,(item)=>{ - return item.key - }) - - let formdata={ - keys:keys - } - - keyBatchCancel(formdata).then((res)=>{ - handelResponse(res,(req,msg)=>{ - Notify.success("批量作废成功") - let data = { - page:1, - limit:10, - } - this.setState({page:1,limit:10}) - this.clearFn(); - this.getKeyCodeList(data); - },(err)=>{ - Notify.error(err) - }) - }) - } - multipleUse(){ - let keys = _.map(this.state.selectiondata,(item)=>{ - return item.key - }) - - let formdata={ - keys:keys - } - - keyBatchUsage(formdata).then((res)=>{ - handelResponse(res,(req,msg)=>{ - Notify.success("批量标记为使用成功") - let data = { - page:1, - limit:10, - } - this.setState({page:1,limit:10}) - this.clearFn(); - this.getKeyCodeList(data); - },(err)=>{ - Notify.error(err) - }) - }) - } - render(){ const { current, pageSize } = this.state; const Column = [ @@ -334,64 +202,27 @@ export default class acclist extends React.Component{ prop:'key_code', type: "normal", width:'auto', - } - ,{ + },{ title: '归属营销计划', width:'auto', type: "normal", prop:'plan_title', name: 'plan_title', }, - - { - title: '状态', - prop:'status', - name: 'status', - width:'auto', - type: "slot", - }, - { - title: '操作', - name: 'opearo', - prop:'opearo', - type: "slot", - width:'auto' - }, - { - title: '总发放条数', - prop:'total', - name: 'total', - width:'auto', - type: "normal", - }, - { - title: '剩余条数', - prop:'residue', - name: 'residue', - width:'auto', - type: "normal", - }, + // { + // title: '状态', + // prop:'status', + // name: 'status', + // width:'auto', + // type: "slot", + // }, { - title: '已使用条数', + title: '使用量', name: 'usage', prop:'usage', type: "normal", width:'auto' }, - { - title: '已过期条数', - name: 'overdue', - prop:'overdue', - type: "normal", - width:'auto' - }, - { - title: '已作废条数', - name: 'invalid', - prop:'invalid', - type: "normal", - width:'auto' - }, { title: '更新时间', name: 'update_time', @@ -399,7 +230,7 @@ export default class acclist extends React.Component{ type: "normal", width:'auto' }, - + ]; const date =
    -
    - - +
    +
    {/* */} @@ -440,8 +266,9 @@ export default class acclist extends React.Component{ type="info" extraContent={} > - 已选择{this.state.selectiondata.length}发放key总数:{this.state.grantTotal},剩余key总数:{this.state.surplusTotal},已使用总数:{this.state.usageTotal},已过期总数:{this.state.outdateTotal},已作废总数:{this.state.invalidTotal} - + 已选择{this.state.selectiondata.length}发放key总数:{this.state.grantTotal},领取key总数:{this.state.receiveTotal},已使用总数:{this.state.usageTotal},沉默总数:{this.state.silentTotal},领取总价(预估):{this.state.receive_total.toFixed(4)}, + 已使用总价(预估):{this.state.usage_total.toFixed(4)}, + 沉默总价(预估):{this.state.silent_total.toFixed(4)} ):null } { this.onPageChange(e) @@ -481,17 +308,12 @@ export default class acclist extends React.Component{ } if(com == "status") { - return

    { rowData.status_text}

    + return

    {rowData.status_text}

    } if(com == "opearo") { - let str = null - - if(rowData.status == 1) - { - - str = - 详情 + let str = + {this.onEdit(e,rowData)} } >详情
    { @@ -506,26 +328,7 @@ export default class acclist extends React.Component{ - - } - else{ - str= - 详情 - - -
    { - }}> 更多
    -
    - - this.menuItemClick(e,key,rowData)} > - 标记成已使用 - 作废 - 日志 - - -
    -
    - } + return str } }} diff --git a/src/pages/plan/key/detail/list.less b/src/pages/plan/key/detail/list.less index afe4f962..0bae22bd 100644 --- a/src/pages/plan/key/detail/list.less +++ b/src/pages/plan/key/detail/list.less @@ -1,7 +1,4 @@ .code-table { border-top: 1px solid #e0e0e0; padding-bottom: 24px; -} -.zent-btn-disabled{ - background-color: #FFFFFF !important; } \ No newline at end of file From 8c1ac2d4d10c80535838c0ebecc6308cbe4eccbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Tue, 11 Jan 2022 10:00:31 +0800 Subject: [PATCH 48/50] =?UTF-8?q?=E6=92=A4=E5=87=BA=E5=A4=8D=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/plan/key/list.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/plan/key/list.js b/src/pages/plan/key/list.js index cbb3d147..55aa7659 100644 --- a/src/pages/plan/key/list.js +++ b/src/pages/plan/key/list.js @@ -655,7 +655,7 @@ linkTo(row){ 撤销审批 - 复制 + this.setState({ visible: v })}> @@ -671,7 +671,7 @@ linkTo(row){ str = {this.onEditRow(e,rowData)}}>编辑 this.onReCall(e,rowData)} >撤销审批 - {this.onCopyRow(e,rowData)}}>复制 + this.setState({ visible: v })}>
    更多
    @@ -694,7 +694,7 @@ linkTo(row){ str = {this.onEditRow(e,rowData)}} >编辑 撤销审批 - {this.onCopyRow(e,rowData)}} >复制 + this.setState({ visible: v }) }> From 6dfdbdf90f4155e5240ef81e27023d9584846dbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Tue, 11 Jan 2022 14:10:19 +0800 Subject: [PATCH 49/50] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B71.0.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/api.js | 2 +- src/pages/login/loginform.js | 2 +- src/pages/plan/add/edit.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/assets/api.js b/src/assets/api.js index fa93bfa5..e1d6e96c 100644 --- a/src/assets/api.js +++ b/src/assets/api.js @@ -1,7 +1,7 @@ import {Notify} from "zent" // export const baseurl = 'https://marketapi.1688sup.com' window.baseurl = 'https://marketapi.1688sup.com'; -const Version = "v1.0.3" +const Version = "v1.0.4" let baseurl; if (process.env.NODE_ENV == "test"||process.env.NODE_ENV == "development") { // 测试环境 baseurl = "http://192.168.6.75" diff --git a/src/pages/login/loginform.js b/src/pages/login/loginform.js index 2e11df5d..d6dfcd6c 100644 --- a/src/pages/login/loginform.js +++ b/src/pages/login/loginform.js @@ -144,7 +144,7 @@ function FormDom(props) { const codeyzm = () => { const xhr = new XMLHttpRequest() xhr.open('GET', window.baseurl + '/auth/login/verify') - xhr.setRequestHeader('Version','v1.0.3'); + xhr.setRequestHeader('Version','v1.0.4'); xhr.responseType = "arraybuffer"; xhr.onreadystatechange = function (response) { response.header = { diff --git a/src/pages/plan/add/edit.js b/src/pages/plan/add/edit.js index c228e617..88eb22a2 100644 --- a/src/pages/plan/add/edit.js +++ b/src/pages/plan/add/edit.js @@ -574,7 +574,7 @@ export default class add extends React.Component{ { - this.state.curstep == 3 ? ( + this.state.card_visible ? (
    From 0963854a62e09b132e3a297c7c78cf2d3e2349da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Tue, 11 Jan 2022 15:02:50 +0800 Subject: [PATCH 50/50] Update edit.js --- src/pages/plan/add/edit.js | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/pages/plan/add/edit.js b/src/pages/plan/add/edit.js index 88eb22a2..1d81d0c5 100644 --- a/src/pages/plan/add/edit.js +++ b/src/pages/plan/add/edit.js @@ -408,6 +408,9 @@ export default class add extends React.Component{ this.setState({audit_visible:false}) let approval_id = sessionStorage.getItem("approval_id") + + if(approval_id > 0) + { getApprovalsStatus(approval_id).then((res)=>{ handelResponse(res,(req,msg)=>{ if(req.status == 0) @@ -451,7 +454,27 @@ export default class add extends React.Component{ }) }) - + } + else{ + let data = + { + "reseller_id":this.state.reseller.id, + "reseller_name":this.state.reseller.name, + "company_name":this.state.reseller.company_name, + "receive_email":this.state.email_list[0], + "payment_direction":this.state.payment_direction[this.state.paytype - 1], + } + + approvals(plan_id,data).then((res)=>{ + handelResponse(res,(req,msg)=>{ + Notify.success("成功发起审批") + this.setState({audit_visible:false}) + this.props.history.push('/home/plan-list/'); + },(err)=>{ + Notify.error(err) + }) + }) + } }