diff --git a/src/pages/plan/list/list.js b/src/pages/plan/list/list.js index b2c658c2..c8dd01de 100644 --- a/src/pages/plan/list/list.js +++ b/src/pages/plan/list/list.js @@ -1,7 +1,7 @@ /* 营销计划列表 */ -import React from 'react'; -import { Button, Alert } from 'zent'; -import './list.less'; +import React from "react" +import { Button, Alert } from "zent" +import "./list.less" import { Input, RadioGroup, @@ -17,12 +17,12 @@ import { Menu, Sweetalert, Pop -} from 'zent'; -import '@/assets/comm.css'; -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'; +} from "zent" +import "@/assets/comm.css" +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, planCancel, @@ -33,156 +33,156 @@ import { planSend, getReseller, dingTaskQuery -} from '@/assets/api.js'; -import omitBy from 'lodash/omitBy'; -import isNaN from 'lodash/isNaN'; -import isNil from 'lodash/isNil'; -import findIndex from 'lodash/findIndex'; -import menu from '@/assets/enum.js'; -var QRCode = require('qrcode.react'); +} from "@/assets/api.js" +import omitBy from "lodash/omitBy" +import isNaN from "lodash/isNaN" +import isNil from "lodash/isNil" +import findIndex from "lodash/findIndex" +import menu from "@/assets/enum.js" +var QRCode = require("qrcode.react") const Column = [ { - title: '营销计划名称', - name: 'title', - prop: 'title', - type: 'slot', - width: 'auto' + title: "营销计划名称", + name: "title", + prop: "title", + type: "slot", + width: "auto" }, { - title: '启用', - width: 'auto', - type: 'slot', - prop: 'switch' + title: "启用", + width: "auto", + type: "slot", + prop: "switch" }, { - title: '分销商', - prop: 'reseller_name', - name: 'reseller_name', - width: 'auto', - type: 'normal' + title: "分销商", + prop: "reseller_name", + name: "reseller_name", + width: "auto", + type: "normal" }, { - title: '状态', - name: 'status', - prop: 'status', - type: 'slot', - width: 'auto' + title: "状态", + name: "status", + prop: "status", + type: "slot", + width: "auto" }, { - title: '创建人', - name: 'creator_name', - prop: 'creator_name', - type: 'normal', - width: 'auto' + title: "创建人", + name: "creator_name", + prop: "creator_name", + type: "normal", + width: "auto" }, { - title: '时间范围', - type: 'slot', - prop: 'dates', - width: '260px' + title: "时间范围", + type: "slot", + prop: "dates", + width: "260px" }, { - title: '操作', - prop: 'opearo', - name: 'opearo', - type: 'slot', - width: '240px' + title: "操作", + prop: "opearo", + name: "opearo", + type: "slot", + width: "240px" }, { - title: '发放key码总数', - name: 'grant', - type: 'normal', - prop: 'grant', - width: 'auto' + title: "发放key码总数", + name: "grant", + type: "normal", + prop: "grant", + width: "auto" }, { - title: '领取key总数', - name: 'receive', - type: 'normal', - prop: 'receive', - width: 'auto' + title: "领取key总数", + name: "receive", + type: "normal", + prop: "receive", + width: "auto" }, { - title: '使用key码总数', - name: 'usage', - type: 'normal', - prop: 'usage', - width: 'auto' + title: "使用key码总数", + name: "usage", + type: "normal", + prop: "usage", + width: "auto" }, { - title: '失效key码总数', - name: 'overdue', - type: 'normal', - prop: 'overdue', - width: 'auto' + title: "失效key码总数", + name: "overdue", + type: "normal", + prop: "overdue", + width: "auto" }, { - title: '作废key码总数', - name: 'invalid', - type: 'normal', - prop: 'invalid', - width: 'auto' + title: "作废key码总数", + name: "invalid", + type: "normal", + prop: "invalid", + width: "auto" }, { - title: '可用key码总数', - name: 'silent', - type: 'normal', - prop: 'silent', - width: 'auto' + title: "可用key码总数", + name: "silent", + type: "normal", + prop: "silent", + width: "auto" }, { - title: '完结key码总数', - name: 'end', - type: 'normal', - prop: 'end', - width: 'auto' + title: "完结key码总数", + name: "end", + type: "normal", + prop: "end", + width: "auto" }, { - title: '更新时间', - name: 'update_time', - type: 'normal', - prop: 'update_time', - width: '140px' + title: "更新时间", + name: "update_time", + type: "normal", + prop: "update_time", + width: "140px" } -]; +] export default class acclist extends React.Component { constructor(props) { - super(props); + super(props) this.state = { dataCount: 0, page: 1, limit: 10, - tabList: [{ title: '营销计划列表' }], + tabList: [{ title: "营销计划列表" }], distdata: [], filterList: [ { id: 0, - label: '状态', - prop: 'status', + 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: '未通过' }, - { id: 8, name: '已作废' } + { id: 999, name: "全部" }, + { id: 0, name: "创建中" }, + { id: 2, name: "审核中" }, + { id: 3, name: "待生效" }, + { id: 4, name: "进行中" }, + { id: 5, name: "暂停中" }, + { id: 6, name: "已完结" }, + { id: 7, name: "未通过" }, + { id: 8, name: "已作废" } ] } ], tableHeight: 500, - menuList: [{ id: 0, name: '状态', check: false }], + menuList: [{ id: 0, name: "状态", check: false }], phone_list: [], email_list: [], - phone: '', - email: '', + phone: "", + email: "", email_radio: -1, phone_radio: -1, - key_word: '', + key_word: "", audit_visible: false, cur_item: null, @@ -197,26 +197,23 @@ export default class acclist extends React.Component { silent_total: 0, isSend: true, isCancel: false - }; + } } clickFn() { - let link = window.location.href.replace( - window.location.hash, - '#/home/plan-create' - ); - sessionStorage.setItem('KeyPcType', '3'); - window.open(link, '_blank'); + let link = window.location.href.replace(window.location.hash, "#/home/plan-create") + sessionStorage.setItem("KeyPcType", "3") + window.open(link, "_blank") } //分页 onPageChange(e) { - this.setState({ page: e }); + this.setState({ page: e }) setTimeout(() => { - this.getpageFn(); - }, 0); + this.getpageFn() + }, 0) } send(e) { - let phoneReg = new RegExp('^[1][3,4,5,6,7,8,9][0-9]{9}$'); - let plan_id = this.state.plan_id; + let phoneReg = new RegExp("^[1][3,4,5,6,7,8,9][0-9]{9}$") + let plan_id = this.state.plan_id let data = { phone: this.state.phone_radio > -1 @@ -226,60 +223,60 @@ export default class acclist extends React.Component { this.state.email_radio > -1 ? this.state.email_list[this.state.email_radio] : this.state.email - }; + } if (!phoneReg.test(data.phone)) { - Notify.error('手机号格式不正确'); - return; + Notify.error("手机号格式不正确") + return } planSend(plan_id, data).then((res) => { handelResponse( res, (req, msg) => { - this.setState({ audit_visible: false }); - Notify.success('发送成功'); + this.setState({ audit_visible: false }) + Notify.success("发送成功") }, (err) => { - Notify.error(err); + Notify.error(err) } - ); - }); + ) + }) } componentDidMount(e) { let data = { page: 1, limit: 10 - }; - this.getPlanList(data); + } + this.getPlanList(data) } componentWillMount() { - this.setState({ tableHeight: window.innerHeight - 430 }); + this.setState({ tableHeight: window.innerHeight - 430 }) } getPlanList(data) { let queryParams = omitBy(data, (value) => { - return isNaN(value) || isNil(value); - }); + return isNaN(value) || isNil(value) + }) getPlanList(queryParams).then((res) => { handelResponse( res, (req, msg) => { - this.setState({ distdata: req.data }); - this.setState({ dataCount: req.total }); + this.setState({ distdata: req.data }) + this.setState({ dataCount: req.total }) }, (err) => {} - ); - }); + ) + }) } onCountChange(e) { this.setState({ page: 1, limit: e - }); + }) setTimeout(() => { - this.getpageFn(); - }, 200); + this.getpageFn() + }, 200) } getpageFn() { let data = { @@ -287,150 +284,150 @@ export default class acclist extends React.Component { limit: this.state.limit, status: this.state.status, key_word: this.state.key_word - }; - if (data.key_word === '') { - delete data.key_word; } - this.getPlanList(data); + if (data.key_word === "") { + delete data.key_word + } + this.getPlanList(data) } //切换siwtch onSwitchChange(status, row) { Sweetalert.confirm({ - type: 'warning', + type: "warning", closeBtn: true, - title: '确认操作', + title: "确认操作", content: (

- 是否改变{row.open == 1 ? '关闭' : '开启'} + 是否改变{row.open == 1 ? "关闭" : "开启"} [{row.title}]的状态?

), onConfirm: () => { - this.changeState(status, row); + this.changeState(status, row) }, onCancel: this.onCancel, - className: 'questModal', + className: "questModal", parentComponent: this - }); + }) } cancel(e) { - this.setState({ audit_visible: false }); + this.setState({ audit_visible: false }) } //修改状态 changeState(status, row) { - let self = this; + let self = this let data = { operation: status ? 1 : 2 - }; + } if (row.status == 3) { - this.setState({ plan_id: row.id }); + this.setState({ plan_id: row.id }) planIsSend(row.id).then((res) => { handelResponse(res, (req, msg) => { if (req.is_send == false) { - this.setState({ cur_item: row }); + this.setState({ cur_item: row }) getReseller(row.reseller_id).then((res) => { handelResponse( res, (req, msg) => { - this.setState({ phone_list: req.contact_phone }); - this.setState({ email_list: req.contact_email }); - this.setState({ isSend: false }); - this.setState({ audit_visible: true }); + this.setState({ phone_list: req.contact_phone }) + this.setState({ email_list: req.contact_email }) + this.setState({ isSend: false }) + this.setState({ audit_visible: true }) }, (err) => { - Notify.error(err); + Notify.error(err) } - ); - }); + ) + }) } else { startOrStopPlan(row.id, data).then((res) => { handelResponse( res, (req, msg) => { let id = findIndex(this.state.distdata, (o) => { - return o.id == row.id; - }); - this.state.distdata[id].open = status ? 2 : 1; - this.setState({ distdata: this.state.distdata }); + return o.id == row.id + }) + this.state.distdata[id].open = status ? 2 : 1 + this.setState({ distdata: this.state.distdata }) let data = { page: this.state.page, limit: this.state.limit, status: this.state.status, key_word: this.state.key_word - }; - self.getPlanList(data); - Notify.success('更改状态成功'); + } + self.getPlanList(data) + Notify.success("更改状态成功") }, (err) => { - Notify.error(err); + Notify.error(err) } - ); - }); + ) + }) } - }); - }); + }) + }) } else { startOrStopPlan(row.id, data).then((res) => { handelResponse( res, (req, msg) => { let id = findIndex(this.state.distdata, (o) => { - return o.id == row.id; - }); - this.state.distdata[id].open = status ? 2 : 1; - this.setState({ distdata: this.state.distdata }); + return o.id == row.id + }) + this.state.distdata[id].open = status ? 2 : 1 + this.setState({ distdata: this.state.distdata }) let data = { page: this.state.page, limit: this.state.limit, status: this.state.status, key_word: this.state.key_word - }; - self.getPlanList(data); - Notify.success('更改状态成功'); + } + self.getPlanList(data) + Notify.success("更改状态成功") }, (err) => { - Notify.error(err); + Notify.error(err) } - ); - }); + ) + }) } } //输入值变化 onInputChange(e) {} //营销系统名称 linkTo(row) { - sessionStorage.setItem('showflag', true); + sessionStorage.setItem("showflag", true) let arr = [ { - pagetitle: '编辑', + pagetitle: "编辑", items: [ - { path: '/home/key-list', name: '营销计划管理' }, - { path: '/home/key-list', name: row.title + 'key列表' } + { path: "/home/key-list", name: "营销计划管理" }, + { path: "/home/key-list", name: row.title + "key列表" } ] } - ]; - sessionStorage.setItem('plan_item', JSON.stringify(row)); - sessionStorage.setItem('knockGold_effectDate', JSON.stringify(row)); - sessionStorage.setItem('redPackets_effectDate', 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); + ] + sessionStorage.setItem("plan_item", JSON.stringify(row)) + sessionStorage.setItem("knockGold_effectDate", JSON.stringify(row)) + sessionStorage.setItem("redPackets_effectDate", 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) // sessionStorage.setItem( // "datetime", // JSON.stringify([row.begin_time, row.end_time]) // ); // this.props.history.push('/home/key-list'); - window.open('#/home/key-list'); + window.open("#/home/key-list") } menuItemClick(key, row) { - this.setState({ plan_id: row.id }); + this.setState({ plan_id: row.id }) if (row.status == 6) { - Notify.clear(); - Notify.error('该状态下的数据不允许编辑'); - return; + Notify.clear() + Notify.error("该状态下的数据不允许编辑") + return } if (key == 1) { @@ -438,114 +435,114 @@ export default class acclist extends React.Component { handelResponse( res, (req, msg) => { - this.setState({ phone_list: req.contact_phone }); - this.setState({ email_list: req.contact_email }); - this.setState({ audit_visible: true }); + this.setState({ phone_list: req.contact_phone }) + this.setState({ email_list: req.contact_email }) + this.setState({ audit_visible: true }) }, (err) => { - Notify.error(err); + Notify.error(err) } - ); - }); + ) + }) } if (key == 3) { - let self = this; + let self = this Sweetalert.confirm({ - type: 'warning', + type: "warning", closeBtn: true, - title: '确认操作', + title: "确认操作", content:

是否确定作废[{row.title}]?

, onConfirm: () => { - self.setState({ isCancel: true }); + self.setState({ isCancel: true }) planCancel(row.id).then((res) => { - self.setState({ isCancel: false }); + self.setState({ isCancel: false }) handelResponse( res, (req, msg) => { - Notify.success('作废成功'); - self.setState({ page: 1 }); - self.setState({ limit: 10 }); + Notify.success("作废成功") + self.setState({ page: 1 }) + self.setState({ limit: 10 }) let data = { page: 1, limit: 10 - }; - self.getPlanList(data); + } + self.getPlanList(data) }, (err) => { - Notify.error(err); + Notify.error(err) } - ); - }); + ) + }) }, onCancel: this.onCancel, - className: 'questModal', + className: "questModal", parentComponent: this - }); + }) } //删除 if (key == 4) { - let self = this; + let self = this Sweetalert.confirm({ - type: 'warning', + type: "warning", closeBtn: true, - title: '确认操作', + title: "确认操作", content:

是否确定删除[{row.title}]?

, onConfirm: () => { deldraftCode(row.id).then((res) => { handelResponse( res, (req, msg) => { - Notify.success(msg); - self.setState({ page: 1 }); - self.setState({ limit: 10 }); + Notify.success(msg) + self.setState({ page: 1 }) + self.setState({ limit: 10 }) let data = { page: 1, limit: 10, status: this.state.status, key_word: this.state.key_word - }; - if (data.key_word === '') { - delete data.key_word; } - self.getPlanList(data); + if (data.key_word === "") { + delete data.key_word + } + self.getPlanList(data) }, (err) => { - Notify.error(err); + Notify.error(err) } - ); - }); + ) + }) }, onCancel: this.onCancel, - className: 'questModal', + className: "questModal", parentComponent: this - }); + }) } } //清空 clearFn() { - this.refs.plan_list.allChecked(false); - this.setState({ selectiondata: [] }); + this.refs.plan_list.allChecked(false) + this.setState({ selectiondata: [] }) } //选中表格的选框 selection(selection) { - this.setState({ selectiondata: selection }); - let grantTotal = 0; - let receiveTotal = 0; - let usageTotal = 0; - let silentTotal = 0; - let receive_total = 0; - let usage_total = 0; - let silent_total = 0; + this.setState({ selectiondata: selection }) + let grantTotal = 0 + let receiveTotal = 0 + let usageTotal = 0 + let silentTotal = 0 + let receive_total = 0 + let usage_total = 0 + let silent_total = 0 selection.forEach((item) => { - grantTotal += Number(item.grant); - receiveTotal += Number(item.receive); - usageTotal += Number(item.usage); - silentTotal += Number(item.silent); - receive_total += Number(item.receive_total); - usage_total += Number(item.usage_total); - silent_total += Number(item.silent_total); - }); + grantTotal += Number(item.grant) + receiveTotal += Number(item.receive) + usageTotal += Number(item.usage) + 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, receiveTotal, @@ -554,128 +551,119 @@ export default class acclist extends React.Component { receive_total, usage_total, silent_total - }); + }) } onFilter(e, prop) { - this.setState({ page: 1 }); - this.setState({ limit: 10 }); + this.setState({ page: 1 }) + this.setState({ limit: 10 }) let data = { page: 1, limit: 10, key_word: this.state.key_word - }; - data[prop] = e; - if (e == 999) { - delete data[prop]; - } else { - let params = {}; - params[prop] = e; - this.setState(params); } - this.getPlanList(data); + data[prop] = e + if (e == 999) { + delete data[prop] + } else { + let params = {} + params[prop] = e + this.setState(params) + } + this.getPlanList(data) } phoneChange = (e) => { - this.setState({ phone: e.target.value }); - }; + this.setState({ phone: e.target.value }) + } emailChange = (e) => { - this.setState({ email: e.target.value }); - }; + this.setState({ email: e.target.value }) + } // 监听组件内部状态的变化: componentDidUpdate(prevProps, prevState) { // 参数分别为改变之前的数据状态对象 - if ( - prevState.key_word != this.state.key_word && - prevState.status != this.state.status - ) { - this.iptsureFn(); + if (prevState.key_word != this.state.key_word && prevState.status != this.state.status) { + this.iptsureFn() } } iptsureFn(e) { - this.setState({ page: 1 }); - this.setState({ limit: 10 }); + this.setState({ page: 1 }) + this.setState({ limit: 10 }) let data = { page: 1, limit: 10, status: this.state.status, key_word: this.state.key_word - }; - this.getPlanList(data); + } + this.getPlanList(data) } onPhoneChange(e) { - this.setState({ phone_radio: e.target.value }); + this.setState({ phone_radio: e.target.value }) } onEmailChange(e) { - this.setState({ email_radio: e.target.value }); + this.setState({ email_radio: e.target.value }) } onEdit(e, row) { - sessionStorage.setItem('showflag', true); + sessionStorage.setItem("showflag", true) let editarr = [ { - pagetitle: '编辑', + pagetitle: "编辑", items: [ - { path: '/home/key-list', name: '营销计划管理' }, - { path: '/home/key-list', name: '编辑:' + row.title } + { path: "/home/key-list", name: "营销计划管理" }, + { path: "/home/key-list", name: "编辑:" + row.title } ] } - ]; - sessionStorage.setItem('breakchangenav', JSON.stringify(editarr)); + ] + sessionStorage.setItem("breakchangenav", JSON.stringify(editarr)) if (row.status == 6) { - Notify.clear(); - Notify.error('不可编辑'); - return; + Notify.clear() + Notify.error("不可编辑") + return } - 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' - ); - sessionStorage.setItem('KeyPcType', '1'); - window.open(link, '_blank'); + 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") + sessionStorage.setItem("KeyPcType", "1") + window.open(link, "_blank") } // 一键复制 onCopy(e, row) { - sessionStorage.setItem('showflag', true); + sessionStorage.setItem("showflag", true) let editarr = [ { - pagetitle: '复制', + pagetitle: "复制", items: [ - { path: '/home/key-list', name: '营销计划管理' }, - { path: '/home/key-list', name: '复制:' + row.title } + { path: "/home/key-list", name: "营销计划管理" }, + { path: "/home/key-list", name: "复制:" + row.title } ] } - ]; - sessionStorage.setItem('breakchangenav', JSON.stringify(editarr)); + ] + sessionStorage.setItem("breakchangenav", JSON.stringify(editarr)) - sessionStorage.setItem('plan_id_copy', row.id); - sessionStorage.setItem('plan_status', row.status); - sessionStorage.setItem('approval_id', row.approval_id); - sessionStorage.setItem('copy_count_golod', row.copy_count); - let link = window.location.href.replace( - window.location.hash, - '#/home/plan-edit-copy' - ); - sessionStorage.setItem('KeyPcType', '2'); - window.open(link, '_blank'); + sessionStorage.setItem("plan_id_copy", row.id) + sessionStorage.setItem("plan_status", row.status) + sessionStorage.setItem("approval_id", row.approval_id) + sessionStorage.setItem("copy_count_golod", row.copy_count) + let link = window.location.href.replace(window.location.hash, "#/home/plan-edit-copy") + sessionStorage.setItem("KeyPcType", "2") + window.open(link, "_blank") } onFilterClose(prop) { - let data = {}; - data[prop] = null; - this.setState(data); - this.setState({ page: 1 }); - this.setState({ limit: 10 }); + let data = {} + data[prop] = null + this.setState(data) + this.setState({ page: 1 }) + this.setState({ limit: 10 }) let params = { page: 1, limit: 10, key_word: this.state.key_word - }; - this.getPlanList(params); + } + this.getPlanList(params) } // 预览 currPreview(rowData) { @@ -688,23 +676,21 @@ export default class acclist extends React.Component { rowData.status === 7 ) { // el.color = "#ccc"; - return 预览; + return 预览 } else { return ( - }> - {' '} - this.currPreviewBtn(rowData.href)}> + }> + {" "} + this.currPreviewBtn(rowData.href)}> 预览 - {' '} + {" "} - ); + ) } } currPreviewBtn(link) { - window.open(link, '_blank'); + window.open(link, "_blank") } // { id: 0, name: "创建中" }, @@ -721,42 +707,45 @@ export default class acclist extends React.Component { if ([0, 2, 3, 4, 5, 7].includes(rowData.status)) { return ( { - this.onEdit(e, rowData); - }}> + this.onEdit(e, rowData) + }} + > 编辑 - ); + ) } else { - return 编辑; + return 编辑 } case 2: if ([3, 4, 5, 6, 8].includes(rowData.status)) { return ( { - this.onCopy(e, rowData); - }}> + this.onCopy(e, rowData) + }} + > 复制 - ); + ) } else { - return 复制; + return 复制 } case 3: if (rowData.status === 0 || rowData.status === 7) { return ( this.menuItemClick(4, rowData)}> + onClick={() => this.menuItemClick(4, rowData)} + > 删除 - ); + ) } if ([3, 4, 5].includes(rowData.status) && rowData.old_status !== 1) { @@ -764,28 +753,29 @@ export default class acclist extends React.Component { this.setState({ visible: v })}> + onVisibleChange={(v) => this.setState({ visible: v })} + > -
- 更多 +
+ 更多
this.menuItemClick(key, rowData)}> - 发送密码及压缩包 - + 发送密码及压缩包 + 日志 - 作废11 + 作废 - ); + ) } else { - return 更多; + return 更多 } default: - return; + return } } @@ -795,25 +785,22 @@ export default class acclist extends React.Component { handelResponse( res, (req, msg) => { - Notify.success(msg); - this.getpageFn(); + Notify.success(msg) + this.getpageFn() }, (err) => { - Notify.error(err); + Notify.error(err) } - ); - }); + ) + }) } render() { return ( -
+
-
- {/* */} @@ -821,42 +808,44 @@ export default class acclist extends React.Component { onChange={(e) => this.setState({ key_word: e })} value={this.state.key_word} wordSearch={this.iptsureFn.bind(this)} - icon='search' - placeholder={'请输入营销计划名称、分销商名称查询'} + icon="search" + placeholder={"请输入营销计划名称、分销商名称查询"} countShow={false} - height={'36px'} - width={'260px'} + height={"36px"} + width={"260px"} onClearItem={(e) => { - this.setState({ key_word: '' }); + this.setState({ key_word: "" }) let data = { page: 1, limit: 10 - }; - this.getPlanList(data); + } + this.getPlanList(data) }} - alignment={'left'} + alignment={"left"} />
{ - this.onFilter(e, prop); + this.onFilter(e, prop) }} onClose={(e) => { - this.onFilterClose(e); - }}> + this.onFilterClose(e) + }} + >
{this.state.selectiondata.length > 0 ? ( + - }> + } + > 已选择 - + {this.state.selectiondata.length} 发放key总数:{this.state.grantTotal},领取key总数: @@ -868,191 +857,191 @@ export default class acclist extends React.Component { ) : null} { - this.onPageChange(e); + this.onPageChange(e) }} countChange={(e) => { - this.onCountChange(e); + this.onCountChange(e) }} checkChange={this.selection.bind(this)} ComponentHandler={(com, rowData) => { - if (com == 'dates') { + if (com == "dates") { return ( {rowData.begin_time} 至 {rowData.end_time} - ); + ) } - if (com == 'title') { + if (com == "title") { return ( { - this.linkTo(rowData); - }}> + this.linkTo(rowData) + }} + > {rowData.title} - ); + ) } - if (com == 'switch') { + if (com == "switch") { return ( { - this.onSwitchChange(e, rowData); - }}> - ); + this.onSwitchChange(e, rowData) + }} + > + ) } - if (com == 'status') { + if (com == "status") { return ( -

+

+ background: menu.planStatusBg(parseInt(rowData.status)) + }} + > {rowData.status_text}

- ); + ) } - if (com == 'opearo') { + if (com == "opearo") { return (
{this.opearoEl(1, rowData)} {this.opearoEl(2, rowData)} - - {this.currPreview(rowData)} - + {this.currPreview(rowData)} {rowData.approval_id && rowData.status === 2 ? ( { - this.dingTask(rowData.approval_id); - }}> + this.dingTask(rowData.approval_id) + }} + > 钉钉审批查询 ) : ( - 钉钉审批查询 + 钉钉审批查询 )} {this.opearoEl(3, rowData)}
- ); + ) } }} /> {this.state.audit_visible ? (
-
-
+
+
{ - this.cancel(e); + this.cancel(e) }} /> -
发送
-
- 是否立即发送key以及解压密码? -
-
+
发送
+
是否立即发送key以及解压密码?
+
接收手机号
-
+
{ - this.onPhoneChange(e); - }}> + 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 }); + if (item == this.state.phone_list[this.state.phone_radio]) { + this.setState({ phone_radio: -1 }) } - }}> + }} + > {item} - ); + ) })}
-
+
接收邮箱
-
+
{ - this.onEmailChange(e); - }}> + 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 }); + if (item == this.state.email_list[this.state.email_radio]) { + this.setState({ email_radio: -1 }) } - }}> + }} + > {item} - ); + ) })}
-
+
-1}> + disabled={this.state.phone_radio > -1} + >
-
+
-1}> + disabled={this.state.email_radio > -1} + >
-
+
@@ -1062,6 +1051,6 @@ export default class acclist extends React.Component {
- ); + ) } }