修复线上营销计划删除草稿状态,订单查询

This commit is contained in:
许红梅 2022-05-20 10:39:47 +08:00
parent 59d4cabb79
commit 604e5ad9e3
6 changed files with 537 additions and 448 deletions

View File

@ -354,6 +354,11 @@ export const keysIsSend = (id, params) => {
export const cancelKey = (id, params) => { export const cancelKey = (id, params) => {
return req("put", baseurl + "/keys/cancel/" + 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) => { export const postKeyEmail = (id, params) => {

View File

@ -3,7 +3,6 @@ import React, { Component } from "react";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import { import {
Button, Button,
Tag,
Sweetalert, Sweetalert,
CombinedDateRangePicker, CombinedDateRangePicker,
Notify, Notify,

View File

@ -17,11 +17,19 @@ let tomonth = moment(nowMonth()).format("YYYY-MM-DD");
const options = [ const options = [
{ {
key: '1', key: '1',
text: '查询key', text: 'key查询'
}, },
{ {
key: '2', key: '2',
text: '通用查询', text: '通用查询'
},
{
key: '3',
text: 'key批次'
},
{
key: '4',
text: '兑换码批次ID'
} }
]; ];
const Column = [ const Column = [
@ -152,7 +160,8 @@ export default class orderlist extends React.Component{
page: 1, page: 1,
limit: 10, limit: 10,
key_word: '', key_word: '',
officialprice:0,contractprice:0,costprice:0,totalprice:0 officialprice: 0, contractprice: 0, costprice: 0, totalprice: 0,
placeholder:'请输入key查询'
} }
this.onChangeCombinedDate = this.onChangeCombinedDate.bind(this); this.onChangeCombinedDate = this.onChangeCombinedDate.bind(this);
} }
@ -175,7 +184,8 @@ export default class orderlist extends React.Component{
clickFn() { clickFn() {
this.props.history.push('/order-add'); this.props.history.push('/order-add');
sessionStorage.setItem('pathname2', '/order-add') sessionStorage.setItem('pathname2', '/order-add')
let activerou=[{items:[ let activerou = [{
items: [
{ {
"path": "/home/order-list", "path": "/home/order-list",
"name": "订单管理" "name": "订单管理"
@ -184,7 +194,8 @@ export default class orderlist extends React.Component{
"path": "/home/order-add", "path": "/home/order-add",
"name": "新建订单" "name": "新建订单"
} }
]}] ]
}]
sessionStorage.setItem('breaknav', JSON.stringify(activerou)); sessionStorage.setItem('breaknav', JSON.stringify(activerou));
} }
//批量作废 //批量作废
@ -235,6 +246,16 @@ export default class orderlist extends React.Component{
data.key_word = 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) { if (this.state.selectiondata && this.state.selectiondata.length > 0) {
let orders = this.state.selectiondata; let orders = this.state.selectiondata;
@ -356,7 +377,8 @@ export default class orderlist extends React.Component{
moreFn(e, row) { moreFn(e, row) {
this.props.history.push('/home/order-addetails?oid=' + row.order_number); this.props.history.push('/home/order-addetails?oid=' + row.order_number);
sessionStorage.setItem('pathname2', '/home/order-addetails') sessionStorage.setItem('pathname2', '/home/order-addetails')
let activerou=[{items:[ let activerou = [{
items: [
{ {
"path": "/home/order-list", "path": "/home/order-list",
"name": "订单管理" "name": "订单管理"
@ -365,7 +387,8 @@ export default class orderlist extends React.Component{
"path": "/home/order-addetails", "path": "/home/order-addetails",
"name": "订单详情" "name": "订单详情"
} }
]}] ]
}]
sessionStorage.setItem('breaknav', JSON.stringify(activerou)); sessionStorage.setItem('breaknav', JSON.stringify(activerou));
} }
//再次充值 //再次充值
@ -448,6 +471,16 @@ export default class orderlist extends React.Component{
data.key_word = 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;
}
}
getOrderList(data).then(res => { getOrderList(data).then(res => {
handelResponse(res, (response, msg) => { handelResponse(res, (response, msg) => {
@ -462,7 +495,17 @@ export default class orderlist extends React.Component{
}); });
} }
optiononChange(e) { optiononChange(e) {
this.setState({option:e,key_word:''}); 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
}
this.setState({ option: e, key_word: '',placeholder });
return
} }
componentWillMount() { componentWillMount() {
let datetime = [ let datetime = [
@ -476,8 +519,7 @@ export default class orderlist extends React.Component{
//状态筛选 //状态筛选
selectedId(e, prop) { selectedId(e, prop) {
let data = {} let data = {}
if(e==999) if (e == 999) {
{
data[prop] = null; data[prop] = null;
} }
else { else {
@ -485,9 +527,6 @@ export default class orderlist extends React.Component{
} }
this.setState(data); this.setState(data);
}
onclearFn(e){
} }
// 监听组件内部状态的变化: // 监听组件内部状态的变化:
componentDidUpdate(prevProps, prevState) { componentDidUpdate(prevProps, prevState) {
@ -505,7 +544,6 @@ componentDidUpdate(prevProps,prevState){
} }
//过滤表格枚举状态 //过滤表格枚举状态
render() { render() {
const date = <CombinedDateRangePicker const date = <CombinedDateRangePicker
className="zent-datepicker-demo" className="zent-datepicker-demo"
value={this.state.combinedValue} value={this.state.combinedValue}
@ -524,16 +562,12 @@ componentDidUpdate(prevProps,prevState){
<TabPage tabs={this.state.tabList} slot={date}> <TabPage tabs={this.state.tabList} slot={date}>
<div className="distable dflexj"> <div className="distable dflexj">
<p> <p>
{/* <Button type="primary" icon="plus" onClick={this.clickFn.bind(this)}></Button>
<Button type="danger" onClick={this.batchdelFn.bind(this)}>批量作废</Button> */}
<Button type="default" icon="download" onClick={this.exportFn.bind(this)}>导出订单</Button> <Button type="default" icon="download" onClick={this.exportFn.bind(this)}>导出订单</Button>
</p> </p>
<div className="dfleac"> <div className="dfleac">
<Select width="180px" value={this.state.option} onChange={(e) => this.optiononChange(e)} disableSearch options={options} clearable placeholder="请选择查询分类" /> <Select width="180px" value={this.state.option} onChange={(e) => this.optiononChange(e)} disableSearch options={options} clearable placeholder="请选择查询分类" />
{/* <Button type="info">批量操作</Button> */}
{ {
this.state.option?this.state.option.key=='1'? <Ipt labelWidth={0} onClearItem={(e)=>{this.setState({key_word:''})}} wordSearch={this.sureFn.bind(this)} onChange={(e)=>this.setState({key_word:e})} value={this.state.key_word} icon="search" placeholder={"请输入key进行搜索"} countShow={false} height={'36px'} width={'260px'} alignment={'left'}/>: this.state.option ? <Ipt labelWidth={0} onClearItem={(e) => { 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
<Ipt labelWidth={0} onClearItem={(e)=>{this.setState({key_word:''})}} wordSearch={this.sureFn.bind(this)} onChange={(e)=>this.setState({key_word:e})} value={this.state.key_word} icon="search" placeholder={"请输入关键字进行搜索"} countShow={false} height={'36px'} width={'260px'} alignment={'left'}/>:null
} }
</div> </div>
@ -570,17 +604,13 @@ componentDidUpdate(prevProps,prevState){
} }
checkChange={this.selection.bind(this)} checkChange={this.selection.bind(this)}
ComponentHandler={(com, rowData) => { ComponentHandler={(com, rowData) => {
if(com == "cost") if (com == "cost") {
{
return <span>{rowData.contract_price}({rowData.cost_price})</span> return <span>{rowData.contract_price}({rowData.cost_price})</span>
} }
if(com == "statusDom") if (com == "statusDom") {
{
return <p className="dflexa" ><span><font className="icon" style={{ background: menu.orderStatusBg(parseInt(rowData.status)) }}></font>{rowData.status_text}</span></p> return <p className="dflexa" ><span><font className="icon" style={{ background: menu.orderStatusBg(parseInt(rowData.status)) }}></font>{rowData.status_text}</span></p>
} }
if(com == "opearo") if (com == "opearo") {
{
return <div> return <div>
{ {
rowData.status == 0 || rowData.status == 1 || rowData.status == 2 || rowData.status == 3 ? <span className="grid-link" onClick={(e) => this.moreFn(e, rowData)}>详情</span> : null rowData.status == 0 || rowData.status == 1 || rowData.status == 2 || rowData.status == 3 ? <span className="grid-link" onClick={(e) => this.moreFn(e, rowData)}>详情</span> : null

View File

@ -12,3 +12,9 @@
.orderList .distable{ .orderList .distable{
margin-bottom: 10px; margin-bottom: 10px;
} }
.orderList .iptfillself {
margin-bottom: 5px;
}
.orderList .iptfillself .label {
margin-right: 20px;
}

View File

@ -29,6 +29,7 @@ import Filterbar from "../../../components/filterbar/main.js";
import { import {
planIsSend, planIsSend,
planCancel, planCancel,
deldraftCode,
getPlanList, getPlanList,
handelResponse, handelResponse,
startOrStopPlan, startOrStopPlan,
@ -319,7 +320,8 @@ export default class acclist extends React.Component {
menuItemClick(e, key, row) { menuItemClick(e, key, row) {
this.setState({ plan_id: row.id }); this.setState({ plan_id: row.id });
if (row.status == 6 || row.status == 0) { if (row.status == 6) {
Notify.clear();
Notify.error("该状态下的数据不允许编辑"); Notify.error("该状态下的数据不允许编辑");
return; return;
} }
@ -373,6 +375,44 @@ export default class acclist extends React.Component {
parentComponent: this, parentComponent: this,
}); });
} }
//删除
if (key == 4) {
let self = this;
Sweetalert.confirm({
type: "warning",
closeBtn: true,
title: "确认操作",
content: <p>是否确定删除[{row.title}]</p>,
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,
});
}
} }
//清空 //清空
@ -834,19 +874,26 @@ export default class acclist extends React.Component {
<DropdownClickTrigger> <DropdownClickTrigger>
<div <div
className="linkmore" className="linkmore"
style={{ paddingLeft: "2px", color: "#d8dbdd" }} style={{ paddingLeft: "2px"}}
onClick={(e) => { }} onClick={(e) => { }}
> >
{" "} {" "}
更多 <Icon type={"down"} />{" "} 更多 <Icon type={"down"} />{" "}
</div> </div>
</DropdownClickTrigger> </DropdownClickTrigger>
<DropdownContent></DropdownContent> <DropdownContent>
<Menu
onClick={(e, key) =>
this.menuItemClick(e, key, rowData)
}
>
<MenuItem key="4">删除</MenuItem>
</Menu>
</DropdownContent>
</Dropdown> </Dropdown>
</div> </div>
); );
} }
if (rowData.status == 6) { if (rowData.status == 6) {
str = ( str = (
<div> <div>
@ -870,7 +917,6 @@ export default class acclist extends React.Component {
</div> </div>
); );
} }
return str; return str;
} }
}} }}

View File

@ -4,3 +4,6 @@
justify-content: flex-end; justify-content: flex-end;
} }
} }
#systemMenu .zent-card[data-zv="9.12.7"]{
overflow: scroll;
}