diff --git a/src/assets/api.js b/src/assets/api.js index 5bd1f95d..4804f30f 100644 --- a/src/assets/api.js +++ b/src/assets/api.js @@ -1,11 +1,6 @@ export const baseurl = 'http://market.api.system.com' - - - - - // 通用公用方法(get和post) const req = (method, url, params, responseType) => { if(method == "get") @@ -82,7 +77,13 @@ export const putKeyEmail = (id,params) => { return req('put', baseurl + "/keys/receive/:"+id, params) } -//销售单中的出库 + +// 兑换码管理 +//兑换码管理列表 +export const getCodesList = (params) => { + return req('get', baseurl + "/codes", params) +} + export { req } \ No newline at end of file diff --git a/src/pages/exchangecode/list/list.js b/src/pages/exchangecode/list/list.js index ce1622eb..7c300e88 100644 --- a/src/pages/exchangecode/list/list.js +++ b/src/pages/exchangecode/list/list.js @@ -10,25 +10,25 @@ 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 {getCodesList} from "../../../assets/api.js" const Column = [ { title: '兑换码-批次ID', name: 'id', prop:'id', - className: 'name', type: "normal", width:'90px' }, { title: '兑换码名称', - prop:'codename', - name: 'name', + prop:'title', + name: 'title', width:'200px', type: "solt", }, { title: '有效期', name: 'time', prop:'time', - type: "normal", + type: "slot", width:'200px' }, { @@ -40,46 +40,46 @@ const Column = [ }, { title: '归属KEY批次ID', - name: 'belongid', + name: 'key_batch_id', type: "normal", - prop:'belongid', + prop:'key_batch_id', width:'90px', }, { title: '券总数(已发放)', - name: 'send', - type: "normal", - prop:'send', + name: 'quantity', + type: "slot", + prop:'quantity', width:'120px', }, { title: '已领取', - name: 'record', + name: 'received', type: "normal", - prop:'record', + prop:'received', width:'40px', }, { title: '已使用', - name: 'used', + name: 'usage', type: "normal", - prop:'used', + prop:'usage', width:'40px', }, { title: '剩余数', - name: 'dead', + name: 'stock', type: "normal", - prop:'dead', + prop:'stock', width:'40px', },{ title: '已失效', - name: 'dead', + name: 'expired', type: "normal", - prop:'dead', + prop:'expired', width:'40px', },{ title: '已作废', - name: 'fail', + name: 'invalid', type: "normal", - prop:'fail', + prop:'invalid', width:'40px', },{ title: '状态', @@ -111,10 +111,10 @@ export default class acclist extends React.Component{ tabList:[{title:"全部"},{title:"未开始"},{title:"进行中"},{title:"暂停中"},{title:"已结束"},{title:"已作废"}], distdata:[{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'},{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'},{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'},{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'},{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:'3'},{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'},{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'},{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'},{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'},{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:'3'},{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'},{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'},{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'},{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'},{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:'3'},{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'},{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'},{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'},{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'},{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:'3'},{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'},{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'},{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'},{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'},{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:'3'},{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'},{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'},{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'},{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'},{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:'3'},{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'},{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'},{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'},{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'},{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:'3'}], 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'}], activepage:0, distdata4:[], distdata3:[], + codeList:[], distdata11:[], tableHeight:600, } @@ -191,15 +191,25 @@ export default class acclist extends React.Component{ } //点击启用/禁用 changestatus(e,row){ - console.log(row); row.status=!row.status; } //选择时间 onChangeCombinedDate(e){ this.setState({combinedValue:e}); } + //获取兑换码列表 + getCodeListFn(){ + let data={} + getCodesList(data).then(res=>{ + console.log(res); + }).catch(err=>{ + console.log('err',err); + }); + } componentWillMount(){ + let selt=this; this.setState({tableHeight:window.innerHeight-390}); + this.getCodeListFn(); } render(){ const date = -

- +

+ {/* */} {/* */}

@@ -221,7 +231,7 @@ componentWillMount(){ { this.state.activepage==0? { + + if(com == "time") + { + return {rowData.begin_time}至{rowData.end_time}; + } if(com == "codename") { return this.aboutFn(e,rowData)}>{rowData.name}; @@ -244,7 +259,7 @@ componentWillMount(){ } if(com == "status") { - return

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

+ return

{rowData.status_text}

} if(com == "opearo") { @@ -284,6 +299,11 @@ componentWillMount(){ if(com == "name") { return this.changestatus(e,rowData)}>; + } + + if(com == "quantity") + { + return

{rowData.quantity}({rowData.total_issued})

} if(com == "status") { diff --git a/src/pages/system/account/list/list.js b/src/pages/system/account/list/list.js index 154be03e..9356e908 100644 --- a/src/pages/system/account/list/list.js +++ b/src/pages/system/account/list/list.js @@ -232,6 +232,9 @@ export default class acclist extends React.Component{ } componentWillMount(){ this.setState({tableHeight:window.innerHeight-390}); + } + componentDidMount(){ + } sureFn(){ // this.setVisible(false)