diff --git a/src/assets/api.js b/src/assets/api.js index 84d062a6..1e53233e 100644 --- a/src/assets/api.js +++ b/src/assets/api.js @@ -354,6 +354,11 @@ export const keysIsSend = (id, params) => { export const cancelKey = (id, params) => { return req("put", baseurl + "/keys/cancel/" + id, params); }; +//删除草稿key批次 +export const deldraftCode = (id) => { + return req("delete", baseurl + "/plan/delete/" + id); +}; + //发送密钥邮件 export const postKeyEmail = (id, params) => { diff --git a/src/pages/exchangecode/list/list.js b/src/pages/exchangecode/list/list.js index b4b54a5b..78d342af 100644 --- a/src/pages/exchangecode/list/list.js +++ b/src/pages/exchangecode/list/list.js @@ -3,7 +3,6 @@ import React, { Component } from "react"; import { Link } from "react-router-dom"; import { Button, - Tag, Sweetalert, CombinedDateRangePicker, Notify, diff --git a/src/pages/order/list/list.js b/src/pages/order/list/list.js index 4a6ca691..9a0eb7ae 100644 --- a/src/pages/order/list/list.js +++ b/src/pages/order/list/list.js @@ -1,8 +1,8 @@ import ReactDOM from 'react-dom'; import React, { Component } from 'react'; -import { Link } from "react-router-dom"; -import { Button,Notify,Select,Alert,CombinedDateRangePicker,Sweetalert,Icon} from 'zent'; -import "./list.less" +import { Link } from "react-router-dom"; +import { Button, Notify, Select, Alert, CombinedDateRangePicker, Sweetalert, Icon } from 'zent'; +import "./list.less" import "../../../assets/comm.css" import Ipt from "../../../components/input/main" import Grid from "../../../components/gird/main.js" @@ -10,599 +10,629 @@ import TabPage from "../../../components/tabPage/main.js" import Filterbar from "../../../components/filterbar/main.js" import menu from "../../../assets/enum.js" import { nowMonth, nowDay } from "../../../assets/comm.js"; -import {getOrderList,getOrderExport,handelResponse,putOrderSuccess,putOrderCancel} from "../../../assets/api.js" +import { getOrderList, getOrderExport, handelResponse, putOrderSuccess, putOrderCancel } from "../../../assets/api.js" var moment = require("moment"); let day = moment(nowDay()).format("YYYY-MM-DD"); let tomonth = moment(nowMonth()).format("YYYY-MM-DD"); const options = [ { key: '1', - text: '查询key', + text: 'key查询' }, { key: '2', - text: '通用查询', + text: '通用查询' + }, + { + key: '3', + text: 'key批次' + }, + { + key: '4', + text: '兑换码批次ID' } ]; const Column = [ { title: '订单号', name: 'order_number', - prop:'order_number', + prop: 'order_number', type: "normal", - width:'100px' - }, { + width: '100px' + }, { title: '兑换码-批次ID', name: 'code_batch_id', - prop:'code_batch_id', + prop: 'code_batch_id', type: "normal", - width:'100px' + width: '100px' }, { title: '商品名称', - prop:'product_name', + prop: 'product_name', name: 'product_name', - width:'120px', + width: '120px', type: "normal", }, { title: '官方价格', name: 'official_price', - prop:'official_price', + prop: 'official_price', type: "normal", - width:'auto' + width: 'auto' }, { title: '合同价(成本价)', name: 'cost', type: "slot", - prop:'cost', - width:'auto' + prop: 'cost', + width: 'auto' }, { title: '分销商', name: 'reseller_name', type: "normal", - prop:'reseller_name', - width:'auto', - },{ + prop: 'reseller_name', + width: 'auto', + }, { title: '归属营销计划', name: 'plan_title', - prop:'plan_title', - width:'auto', + prop: 'plan_title', + width: 'auto', type: "normal", - }, + }, { title: '购买数量', name: 'num', type: "normal", - prop:'num', - width:'auto', + prop: 'num', + width: 'auto', }, - { + { title: '状态', name: 'statusDom', - prop:'statusDom', + prop: 'statusDom', type: "slot", - width:'auto', + width: 'auto', }, { title: '操作', prop: 'opearo', name: 'opearo', type: "slot", - width:'140px', + width: '140px', }, { title: '创建时间', name: 'create_time', - prop:'create_time', - width:'120px', + prop: 'create_time', + width: '120px', type: "normal", - }, { + }, { title: '账号', name: 'account', type: "normal", - prop:'account', - width:'auto', + prop: 'account', + width: 'auto', }, { title: '订单类型', name: 'type_text', - prop:'type_text', - width:'auto', + prop: 'type_text', + width: 'auto', type: "normal", }, { title: '折扣', name: 'discount', type: "normal", - prop:'discount', - width:'auto', + prop: 'discount', + width: 'auto', }, { title: '结算', name: 'total', - prop:'total', - width:'auto', + prop: 'total', + width: 'auto', type: "normal", }, { title: 'key', name: 'key', - prop:'key', - width:'auto', + prop: 'key', + width: 'auto', type: "normal", } ]; -export default class orderlist extends React.Component{ - constructor(props){ +export default class orderlist extends React.Component { + constructor(props) { super(props) - this.state={ - tabList:[{title:"订单列表"}], - orderList:[], - filterList:[{id:0,label:"订单状态",prop:"status",menuList:[{id:999,name:"全部"},{id:1,name:"充值中"},{id:2,name:"已完成"},{id:3,name:"充值失败"},{id:4,name:"已取消"}]}], - selectiondata:[], - menuList:[{id:0,name:"订单状态",check:false}] - ,allcheck:false, - itemcheck:false, - combinedValue:[], - tableHeight:500, - status:null, - page:1, - limit:10, - key_word:'', - officialprice:0,contractprice:0,costprice:0,totalprice:0 - } - this.onChangeCombinedDate=this.onChangeCombinedDate.bind(this); + this.state = { + tabList: [{ title: "订单列表" }], + orderList: [], + filterList: [{ id: 0, label: "订单状态", prop: "status", menuList: [{ id: 999, name: "全部" }, { id: 1, name: "充值中" }, { id: 2, name: "已完成" }, { id: 3, name: "充值失败" }, { id: 4, name: "已取消" }] }], + selectiondata: [], + menuList: [{ id: 0, name: "订单状态", check: false }] + , allcheck: false, + itemcheck: false, + combinedValue: [], + tableHeight: 500, + status: null, + page: 1, + limit: 10, + key_word: '', + officialprice: 0, contractprice: 0, costprice: 0, totalprice: 0, + placeholder:'请输入key查询' + } + this.onChangeCombinedDate = this.onChangeCombinedDate.bind(this); } //选中表格的选框 - selection(selection){ - this.setState({selectiondata:selection}); - let officialprice=0; - let contractprice=0; - let costprice=0; - let totalprice=0; - selection.forEach(item=>{ - officialprice+=Number(item.official_price); - contractprice+=Number(item.contract_price); - costprice+=Number(item.cost_price); - totalprice+=Number(item.total); + selection(selection) { + this.setState({ selectiondata: selection }); + let officialprice = 0; + let contractprice = 0; + let costprice = 0; + let totalprice = 0; + selection.forEach(item => { + officialprice += Number(item.official_price); + contractprice += Number(item.contract_price); + costprice += Number(item.cost_price); + totalprice += Number(item.total); }); - this.setState({officialprice,contractprice,costprice,totalprice}); - } - //新建订单 - clickFn(){ + this.setState({ officialprice, contractprice, costprice, totalprice }); + } + //新建订单 + clickFn() { this.props.history.push('/order-add'); - sessionStorage.setItem('pathname2','/order-add') - let activerou=[{items:[ - { - "path": "/home/order-list", - "name": "订单管理" - }, - { - "path": "/home/order-add", - "name": "新建订单" - } - ]}] - sessionStorage.setItem('breaknav',JSON.stringify(activerou)); + sessionStorage.setItem('pathname2', '/order-add') + let activerou = [{ + items: [ + { + "path": "/home/order-list", + "name": "订单管理" + }, + { + "path": "/home/order-add", + "name": "新建订单" + } + ] + }] + sessionStorage.setItem('breaknav', JSON.stringify(activerou)); } //批量作废 - batchdelFn(){ - if(this.state.selectiondata.length<1){ + batchdelFn() { + if (this.state.selectiondata.length < 1) { Notify.clear(); Notify.warn('请先勾选需作废的选项'); - }else{ + } else { Sweetalert.confirm({ - type:'warning', - closeBtn:true, - title:'确认操作', + type: 'warning', + closeBtn: true, + title: '确认操作', content:

是否作废选中【充值中】的订单?

, - onConfirm(){ + onConfirm() { alert('开始调用作废接口'); }, - onCancel(){ - + onCancel() { + }, - className:'questModal', + className: 'questModal', parentComponent: this }); } } - + //导出订单 - exportFn(){ - let _self=this; - let {key_word,key,status,option}=_self.state; - let data={} - if(this.state.combinedValue&&this.state.combinedValue[0]){ - data.begin_time=this.state.combinedValue[0]; - data.end_time=this.state.combinedValue[1]; - } - - if(status||status===0){ - data.status=status; - } - - if(option&&option.key==1){ - if(key_word){ - data.key=key_word; + exportFn() { + let _self = this; + let { key_word, key, status, option } = _self.state; + let data = {} + if (this.state.combinedValue && this.state.combinedValue[0]) { + data.begin_time = this.state.combinedValue[0]; + data.end_time = this.state.combinedValue[1]; } - } - if(option&&option.key==2){ - if(key_word){ - data.key_word=key_word; + if (status || status === 0) { + data.status = status; } - } - if(this.state.selectiondata&&this.state.selectiondata.length>0){ - let orders=this.state.selectiondata; - let orderNum=orders.map(item=>item.order_number); - data.order_numbers=orderNum.join(','); - } + if (option && option.key == 1) { + if (key_word) { + data.key = key_word; + } + } + + if (option && option.key == 2) { + if (key_word) { + data.key_word = key_word; + } + } + if (option && option.key == 3) { + if (key_word) { + data.key_batch_id = key_word; + } + } + if (option && option.key == 4) { + if (key_word) { + data.code_batch_id = key_word; + } + } + if (this.state.selectiondata && this.state.selectiondata.length > 0) { + + let orders = this.state.selectiondata; + let orderNum = orders.map(item => item.order_number); + data.order_numbers = orderNum.join(','); + } Sweetalert.confirm({ - type:'warning', - closeBtn:true, - title:'确认操作', + type: 'warning', + closeBtn: true, + title: '确认操作', content:

是否导出订单?

, - onConfirm(){ - getOrderExport(data).then(res=>{ - if(res.type=='application/json'){ - const reader = new FileReader(); //创建一个FileReader实例 - reader.readAsText(res, 'utf-8'); //读取文件,结果用字符串形式表示 - reader.onload=function(){ - const obj = JSON.parse(reader.result); - Notify.clear() - Notify.error(obj.message) + onConfirm() { + getOrderExport(data).then(res => { + if (res.type == 'application/json') { + const reader = new FileReader(); //创建一个FileReader实例 + reader.readAsText(res, 'utf-8'); //读取文件,结果用字符串形式表示 + reader.onload = function () { + const obj = JSON.parse(reader.result); + Notify.clear() + Notify.error(obj.message) + } + } else { + let bl = new Blob([res]); + let fileName = '订单管理' + _self.getnow() + ".xlsx"; //设置文件名 + var link = document.createElement('a');//创建标签 + link.href = window.URL.createObjectURL(bl); + link.download = fileName;//下载的文件名 + link.click(); + window.URL.revokeObjectURL(link.href);//清除URL } - }else{ - let bl = new Blob([res]); - let fileName = '订单管理'+_self.getnow()+ ".xlsx"; //设置文件名 - var link = document.createElement('a');//创建标签 - link.href = window.URL.createObjectURL(bl); - link.download = fileName;//下载的文件名 - link.click(); - window.URL.revokeObjectURL(link.href);//清除URL - } - }).catch(err=>{ + }).catch(err => { }); }, - - onCancel(){ - + + onCancel() { + }, - className:'questModal', + className: 'questModal', parentComponent: this }); } - //获取当前时间 - getnow() { - var now = new Date(); - var year = now.getFullYear(); - var month = - now.getMonth() + 1 <= 9 - ? "0" + (now.getMonth() + 1) - : now.getMonth() + 1; - var day = now.getDate() <= 9 ? "0" + now.getDate() : now.getDate(); - var tt = now.getHours() <= 9 ? "0" + now.getHours() : now.getHours(); - var mm = - now.getMinutes() <= 9 ? "0" + now.getMinutes() : now.getMinutes(); - var ss = - now.getSeconds() <= 9 ? "0" + now.getSeconds() : now.getSeconds(); - let datelist = [year, month, day, tt, mm, ss]; - return datelist.join(""); - } - componentWillMount(){ - this.setState({tableHeight:window.innerHeight-430}); + //获取当前时间 + getnow() { + var now = new Date(); + var year = now.getFullYear(); + var month = + now.getMonth() + 1 <= 9 + ? "0" + (now.getMonth() + 1) + : now.getMonth() + 1; + var day = now.getDate() <= 9 ? "0" + now.getDate() : now.getDate(); + var tt = now.getHours() <= 9 ? "0" + now.getHours() : now.getHours(); + var mm = + now.getMinutes() <= 9 ? "0" + now.getMinutes() : now.getMinutes(); + var ss = + now.getSeconds() <= 9 ? "0" + now.getSeconds() : now.getSeconds(); + let datelist = [year, month, day, tt, mm, ss]; + return datelist.join(""); + } + componentWillMount() { + this.setState({ tableHeight: window.innerHeight - 430 }); } //作废 - deleteFn(e,row){ - let self=this; - Sweetalert.confirm({ - type:'warning', - closeBtn:true, - title:'确认操作', - content:

是否作废[{row.order_number}]

, - onConfirm(){ - putOrderCancel(row.order_number).then(res=>{ - handelResponse(res,(response,msg)=>{ - Notify.clear(); - Notify.success(msg); - self.getOrderFn(); - },(err)=>{ - Notify.error(err) - }) - }).catch(err=>{ - }); - }, - onCancel(){ - - }, - className:'questModal', - parentComponent: this - }); + deleteFn(e, row) { + let self = this; + Sweetalert.confirm({ + type: 'warning', + closeBtn: true, + title: '确认操作', + content:

是否作废[{row.order_number}]

, + onConfirm() { + putOrderCancel(row.order_number).then(res => { + handelResponse(res, (response, msg) => { + Notify.clear(); + Notify.success(msg); + self.getOrderFn(); + }, (err) => { + Notify.error(err) + }) + }).catch(err => { + }); + }, + onCancel() { + + }, + className: 'questModal', + parentComponent: this + }); } //改为成功 - changeSuccessFn(e,row){ - let self=this; - Sweetalert.confirm({ - type:'warning', - closeBtn:true, - title:'确认操作', - content:

是否将[{row.order_number}]订单改为成功状态?

, - onConfirm(){ - putOrderSuccess(row.order_number).then(res=>{ - handelResponse(res,(response,msg)=>{ - Notify.clear(); - Notify.success(msg); - self.getOrderFn(); - },(err)=>{ - Notify.error(err) - }) - }).catch(err=>{ - }); - }, - onCancel(){ - - }, - className:'questModal', - parentComponent: this - }); - } - //详情 - moreFn(e,row){ - this.props.history.push('/home/order-addetails?oid='+row.order_number); - sessionStorage.setItem('pathname2','/home/order-addetails') - let activerou=[{items:[ - { - "path": "/home/order-list", - "name": "订单管理" + changeSuccessFn(e, row) { + let self = this; + Sweetalert.confirm({ + type: 'warning', + closeBtn: true, + title: '确认操作', + content:

是否将[{row.order_number}]订单改为成功状态?

, + onConfirm() { + putOrderSuccess(row.order_number).then(res => { + handelResponse(res, (response, msg) => { + Notify.clear(); + Notify.success(msg); + self.getOrderFn(); + }, (err) => { + Notify.error(err) + }) + }).catch(err => { + }); }, - { - "path": "/home/order-addetails", - "name": "订单详情" - } - ]}] - sessionStorage.setItem('breaknav',JSON.stringify(activerou)); + onCancel() { + + }, + className: 'questModal', + parentComponent: this + }); } - //再次充值 - againinvestFn(e,row){ + //详情 + moreFn(e, row) { + this.props.history.push('/home/order-addetails?oid=' + row.order_number); + sessionStorage.setItem('pathname2', '/home/order-addetails') + let activerou = [{ + items: [ + { + "path": "/home/order-list", + "name": "订单管理" + }, + { + "path": "/home/order-addetails", + "name": "订单详情" + } + ] + }] + sessionStorage.setItem('breaknav', JSON.stringify(activerou)); + } + //再次充值 + againinvestFn(e, row) { - } - //清空 - clearFn(){ - this.setState({'selectiondata':[]}) - this.setState({allcheck:false}) - this.setState({itemcheck:false}) - } + } + //清空 + clearFn() { + this.setState({ 'selectiondata': [] }) + this.setState({ allcheck: false }) + this.setState({ itemcheck: false }) + } - //选择时间 - onChangeCombinedDate(e){ - this.setState({combinedValue:e}); + //选择时间 + onChangeCombinedDate(e) { + this.setState({ combinedValue: e }); this.getOrderFn(e); } //page - pageChange(e){ - this.setState({page:e}); - this.setState({'selectiondata':[]}) + pageChange(e) { + this.setState({ page: e }); + this.setState({ 'selectiondata': [] }) setTimeout(() => { this.getOrderFn(); }, 0); - + } //limit - countChange(e){ - this.setState({page:1,limit:e}); - this.setState({'selectiondata':[]}) + countChange(e) { + this.setState({ page: 1, limit: e }); + this.setState({ 'selectiondata': [] }) setTimeout(() => { this.getOrderFn(); }, 0); } - //敲回车查询 - sureFn(){ - this.setState({page:1}); - setTimeout(()=>{ - this.getOrderFn(); - },300); - + //敲回车查询 + sureFn() { + this.setState({ page: 1 }); + setTimeout(() => { + this.getOrderFn(); + }, 300); + + } + + onFilterClose(prop) { + let data = {} + data[prop] = null; + this.setState(data) + } + + + //获取订单列表 + getOrderFn(time = {}) { + let _self = this; + let { page, limit, option, key_word, status } = _self.state; + let data = { page, limit } + if (this.state.combinedValue && this.state.combinedValue[0]) { + data.begin_time = this.state.combinedValue[0]; + data.end_time = this.state.combinedValue[1]; + } + if (status || status === 0) { + data.status = status; + } + if (time && time[0]) { + data.begin_time = time[0]; + data.end_time = time[1]; + } + if (time && time[0] == null && time.length > 1) { + delete data.begin_time; + delete data.end_time; + + } + if (option && option.key == 1) { + if (key_word) { + data.key = key_word; + } + } + if (option && option.key == 2) { + if (key_word) { + data.key_word = key_word; + } + } + if (option && option.key == 3) { + if (key_word) { + data.key_batch_id = key_word; + } + } + if (option && option.key == 4) { + if (key_word) { + data.code_batch_id = key_word; + } } - onFilterClose(prop){ - let data = {} - data[prop] = null; - this.setState(data) + getOrderList(data).then(res => { + handelResponse(res, (response, msg) => { + const orderList_data = response.data; + const { total } = response; + _self.setState({ orderList: orderList_data, total }); + + }, (err) => { + Notify.error(err) + }) + }).catch(err => { + }); + } + optiononChange(e) { + let placeholder; + let searchOption=Number(e?e.key:0); + switch(searchOption){ + case 1:placeholder='请输入key搜索';break; + case 2:placeholder='请输入关键字查询';break; + case 3:placeholder='请输入key批次搜索';break; + case 4:placeholder='请输入兑换码批次ID搜索';break; + default:placeholder='请输入key搜索';break } - - - //获取订单列表 - getOrderFn(time={}){ - let _self=this; - let {page,limit,option,key_word,status}=_self.state; - let data={page,limit} - if(this.state.combinedValue&&this.state.combinedValue[0]){ - data.begin_time=this.state.combinedValue[0]; - data.end_time=this.state.combinedValue[1]; + this.setState({ option: e, key_word: '',placeholder }); + return } - if(status||status===0){ - data.status=status; + componentWillMount() { + let datetime = [ + tomonth + " " + "00:00:00", + day + " " + "23:59:59" + ]; + this.setState({ combinedValue: datetime }); + this.getOrderFn(datetime); } - if(time&&time[0]){ - data.begin_time=time[0]; - data.end_time=time[1]; - } - if(time&&time[0]==null&&time.length>1){ - delete data.begin_time; - delete data.end_time; - } - if(option&&option.key==1){ - if(key_word){ - data.key=key_word; + //状态筛选 + selectedId(e, prop) { + let data = {} + if (e == 999) { + data[prop] = null; } - } - if(option&&option.key==2){ - if(key_word){ - data.key_word=key_word; + else { + data[prop] = e } - } - getOrderList(data).then(res=>{ - handelResponse(res,(response,msg)=>{ - const orderList_data=response.data; - const {total}=response; - _self.setState({orderList:orderList_data,total}); - - },(err)=>{ - Notify.error(err) - }) - }).catch(err=>{ - }); - } - optiononChange(e){ - this.setState({option:e,key_word:''}); - } - componentWillMount(){ - let datetime = [ - tomonth + " " + "00:00:00", - day + " " + "23:59:59" - ]; - this.setState({combinedValue:datetime}); - this.getOrderFn(datetime); - } - - //状态筛选 - selectedId(e,prop){ - let data ={} - if(e==999) - { - data[prop] = null; - } - else{ - data[prop] = e - } - - this.setState(data); - } - onclearFn(e){ - - } - // 监听组件内部状态的变化: -componentDidUpdate(prevProps,prevState){ - // 参数分别为改变之前的数据状态对象 - if(prevState.key_word!=this.state.key_word &&!this.state.key_word){ - this.getOrderFn(); + this.setState(data); } - if(prevState.option!=this.state.option &&!this.state.option){ - this.getOrderFn(); - this.setState({key_word:""}); + // 监听组件内部状态的变化: + componentDidUpdate(prevProps, prevState) { + // 参数分别为改变之前的数据状态对象 + if (prevState.key_word != this.state.key_word && !this.state.key_word) { + this.getOrderFn(); + } + if (prevState.option != this.state.option && !this.state.option) { + this.getOrderFn(); + this.setState({ key_word: "" }); + } + if (prevState.status != this.state.status) { + this.getOrderFn(); + } } - if(prevState.status!=this.state.status){ - this.getOrderFn(); - } -} //过滤表格枚举状态 - render(){ - - const date = + render() { + const date = const { current, pageSize } = this.state; - return( + return (
- -
-

- {/* - */} - -

-
- this.optiononChange(e)} disableSearch options={options} clearable placeholder="请选择查询分类" /> { - rowData.status==0||rowData.status==1||rowData.status==2||rowData.status==3? this.moreFn(e,rowData)}>详情:null + this.state.option ? { this.setState({ key_word: '' }) }} wordSearch={this.sureFn.bind(this)} onChange={(e) => this.setState({ key_word: e })} value={this.state.key_word} icon="search" placeholder={this.state.placeholder} countShow={false} height={'36px'} width={'260px'} alignment={'left'} /> :null } - { - rowData.status==1? this.deleteFn(e,rowData)} >作废:null - } - { - // rowData.status==3? this.againinvestFn(e,rowData)}>再次充值:null - } - { - rowData.status==1? this.changeSuccessFn(e,rowData)} >改为成功:null - } - -
- } - }} - /> - -
-
+
+ + + { this.onFilterClose(e) }} selectFn={(e, prop) => { this.selectedId(e, prop) }} filterList={this.state.filterList} menuList={this.state.menuList}> +
+ {this.state.selectiondata.length > 0 ? (清空} + > + 已选择{this.state.selectiondata.length}项,官方价金额总计¥{this.state.officialprice.toFixed(4)},合同价金额总计¥{this.state.contractprice.toFixed(4)},成本价金额总计:¥{this.state.costprice.toFixed(4)},结算价金额总计:¥{this.state.totalprice.toFixed(4)} + ) : null + } + { + this.pageChange(e) + }} + countChange={ + (e) => { + this.countChange(e) + } + } + checkChange={this.selection.bind(this)} + ComponentHandler={(com, rowData) => { + if (com == "cost") { + return {rowData.contract_price}({rowData.cost_price}) + } + if (com == "statusDom") { + return

{rowData.status_text}

+ } + if (com == "opearo") { + return
+ { + rowData.status == 0 || rowData.status == 1 || rowData.status == 2 || rowData.status == 3 ? this.moreFn(e, rowData)}>详情 : null + } + { + rowData.status == 1 ? this.deleteFn(e, rowData)} >作废 : null + } + { + // rowData.status==3? this.againinvestFn(e,rowData)}>再次充值:null + } + { + rowData.status == 1 ? this.changeSuccessFn(e, rowData)} >改为成功 : null + } + +
+ } + + }} + /> + +
+ ) } diff --git a/src/pages/order/list/list.less b/src/pages/order/list/list.less index 2674291c..501c6fe6 100644 --- a/src/pages/order/list/list.less +++ b/src/pages/order/list/list.less @@ -11,4 +11,10 @@ .orderList .distable{ margin-bottom: 10px; +} +.orderList .iptfillself { + margin-bottom: 5px; +} +.orderList .iptfillself .label { + margin-right: 20px; } \ No newline at end of file diff --git a/src/pages/plan/list/list.js b/src/pages/plan/list/list.js index 3ec3526b..4224d1a7 100644 --- a/src/pages/plan/list/list.js +++ b/src/pages/plan/list/list.js @@ -29,6 +29,7 @@ import Filterbar from "../../../components/filterbar/main.js"; import { planIsSend, planCancel, + deldraftCode, getPlanList, handelResponse, startOrStopPlan, @@ -165,7 +166,7 @@ export default class acclist extends React.Component { this.setState({ distdata: req.data }); this.setState({ dataCount: req.total }); }, - (err) => {} + (err) => { } ); }); } @@ -295,7 +296,7 @@ export default class acclist extends React.Component { } } //输入值变化 - onInputChange(e) {} + onInputChange(e) { } //营销系统名称 linkTo(row) { sessionStorage.setItem("showflag", true); @@ -319,7 +320,8 @@ export default class acclist extends React.Component { menuItemClick(e, key, row) { this.setState({ plan_id: row.id }); - if (row.status == 6 || row.status == 0) { + if (row.status == 6) { + Notify.clear(); Notify.error("该状态下的数据不允许编辑"); return; } @@ -373,6 +375,44 @@ export default class acclist extends React.Component { parentComponent: this, }); } + //删除 + if (key == 4) { + let self = this; + Sweetalert.confirm({ + type: "warning", + closeBtn: true, + 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 }); + 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); + }, + (err) => { + Notify.error(err); + } + ); + }); + }, + onCancel: this.onCancel, + className: "questModal", + parentComponent: this, + }); + } } //清空 @@ -775,7 +815,7 @@ export default class acclist extends React.Component {
-
{}}> +
{ }}> {" "} 更多 {" "}
@@ -834,19 +874,26 @@ export default class acclist extends React.Component {
{}} + style={{ paddingLeft: "2px"}} + onClick={(e) => { }} > {" "} 更多 {" "}
- + + + this.menuItemClick(e, key, rowData) + } + > + 删除 + +
); } - if (rowData.status == 6) { str = (
@@ -859,7 +906,7 @@ export default class acclist extends React.Component {
{}} + onClick={(e) => { }} > {" "} 更多 {" "} @@ -870,7 +917,6 @@ export default class acclist extends React.Component {
); } - return str; } }} diff --git a/src/pages/system/menu/menuright/menuright.less b/src/pages/system/menu/menuright/menuright.less index 23eb6d12..18f9df05 100644 --- a/src/pages/system/menu/menuright/menuright.less +++ b/src/pages/system/menu/menuright/menuright.less @@ -3,4 +3,7 @@ display: flex; justify-content: flex-end; } +} +#systemMenu .zent-card[data-zv="9.12.7"]{ + overflow: scroll; } \ No newline at end of file