diff --git a/src/assets/api.js b/src/assets/api.js index c809bd56..7bd25f1b 100644 --- a/src/assets/api.js +++ b/src/assets/api.js @@ -835,6 +835,10 @@ export const delSystemTemplate= (id) => { +//key码列表 +export const getkeyDetailList= (id,data) => { + return req('get', baseurl + "/key/"+id,data) +} diff --git a/src/components/gird/main.css b/src/components/gird/main.css index 9cca838d..7f3fb4b4 100644 --- a/src/components/gird/main.css +++ b/src/components/gird/main.css @@ -97,6 +97,8 @@ border-top: 1px solid #ddd; display: inline-flex; word-break:break-all; + padding-top: 10px; + padding-bottom: 10px; } .th-td-total { diff --git a/src/pages/plan/key/detail/list.js b/src/pages/plan/key/detail/list.js index 80890f58..df97e6bf 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} 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" import common from "../../../../assets/comm.js" @@ -123,19 +123,20 @@ export default class acclist extends React.Component{ page:1, limit:10 } - this.getPlanList(data); + this.getKeyCodeList(data); } componentWillMount(){ this.setState({tableHeight:window.innerHeight-430}); } - getPlanList(data){ + getKeyCodeList(data){ let queryParams = _.omitBy(data, (value) => { return _.isNaN(value) || _.isNil(value) }) + let id = sessionStorage.getItem("key_batch_id") - getPlanList(queryParams).then((res)=>{ + getkeyDetailList(id,queryParams).then((res)=>{ handelResponse(res,(req,msg)=>{ this.setState({distdata:req.data}) this.setState({dataCount:req.total}) @@ -266,16 +267,16 @@ export default class acclist extends React.Component{ } //营销系统名称 linkTo(row){ - sessionStorage.setItem('showflag',true); - let arr=[{pagetitle:'编辑',items:[{path:'/home/key-list',name:'营销计划管理'}, - {path:'/home/key-list',name:row.title+'key列表'} - ]}] - sessionStorage.setItem("plan_item",JSON.stringify(row)) - sessionStorage.setItem('breaknav',JSON.stringify(arr)); - sessionStorage.setItem('linkshowname',"营销计划管理"); - sessionStorage.setItem("key_plan_id",row.id) - sessionStorage.setItem("key_plan_status",row.status) - this.props.history.push('/home/key-list'); + // sessionStorage.setItem('showflag',true); + // let arr=[{pagetitle:'编辑',items:[{path:'/home/key-list',name:'营销计划管理'}, + // {path:'/home/key-list',name:row.title+'key列表'} + // ]}] + // sessionStorage.setItem("plan_item",JSON.stringify(row)) + // sessionStorage.setItem('breaknav',JSON.stringify(arr)); + // sessionStorage.setItem('linkshowname',"营销计划管理"); + // sessionStorage.setItem("key_plan_id",row.id) + // sessionStorage.setItem("key_plan_status",row.status) + // this.props.history.push('/home/key-list'); } menuItemClick(e,key,row){ @@ -550,32 +551,33 @@ export default class acclist extends React.Component{ const Column = [ { title: 'key码', - name: 'key', - prop:'key', - type: "slot", + name: 'key_code', + prop:'key_code', + type: "normal", width:'auto', },{ title: '归属营销计划', width:'auto', type: "normal", - prop:'switch' + prop:'plan_title', + name: 'plan_title', }, { title: '状态', - prop:'reseller_name', - name: 'reseller_name', - width:'auto', - type: "normal", - }, { - title: '剩余条数', - name: 'status', prop:'status', + name: 'status', + width:'auto', type: "slot", + }, { + title: '使用量', + name: 'usage', + prop:'usage', + type: "normal", width:'auto' }, { title: '更新时间', - name: 'creator_name', - prop:'creator_name', + name: 'update_time', + prop:'update_time', type: "normal", width:'auto' }, @@ -598,9 +600,6 @@ export default class acclist extends React.Component{ onChange={this.onChangeCombinedDate} /> return( - - -
diff --git a/src/pages/plan/key/list.js b/src/pages/plan/key/list.js index dae991fc..3fc4d816 100644 --- a/src/pages/plan/key/list.js +++ b/src/pages/plan/key/list.js @@ -23,9 +23,9 @@ const Column = [ }, { title: '批次名称', - name: 'batch_name', - prop:'batch_name', - type: "normal", + name: 'link', + prop:'link', + type: "slot", width:'100px' }, { @@ -552,6 +552,21 @@ onChangeCombinedDate(e){ this.setState({combinedValue:e}); this.getKeyList(e); } +linkTo(row){ + // sessionStorage.setItem('showflag',true); + let arr=[{pagetitle:'编辑',items:[{path:'/home/key-list',name:'营销计划管理'}, + {path:'/home/key-list',name:row.plan_title+'key列表'}, + {path:'/home/key-detail',name:row.batch_name+'key码列表'} + ]}] + sessionStorage.setItem("plan_item",JSON.stringify(row)) + sessionStorage.setItem('breaknav',JSON.stringify(arr)); + sessionStorage.setItem('linkshowname',"营销计划管理"); + sessionStorage.setItem("key_batch_id",row.id) + this.props.history.push('/home/key-detail'); +} + + + // 监听组件内部状态的变化: componentDidUpdate(prevProps,prevState){ // 参数分别为改变之前的数据状态对象 @@ -606,6 +621,13 @@ onChangeCombinedDate(e){ }} ComponentHandler={(com,rowData)=>{ + + if(com == "link"){ + + return {this.linkTo(rowData)} }>{rowData.batch_name} + + } + if(com == "switch") { return = 6 ? true :false } onChange={(e)=>{this.onSwitchChange(e,rowData)}}>;