联调订单改为成功和作废接口

This commit is contained in:
red-deng-deng 2021-11-22 20:47:45 +08:00
parent 567f38adc5
commit 1ec5082629
2 changed files with 55 additions and 8 deletions

View File

@ -214,6 +214,16 @@ export const getOrderDetails = (id) => {
export const getOrderExport = (params) => { export const getOrderExport = (params) => {
return req('get', baseurl + "/order/export",params) return req('get', baseurl + "/order/export",params)
} }
//订单改为成功
export const putOrderSuccess = (id) => {
return req('put', baseurl + "/order/success/"+id)
}
//订单作废
export const putOrderCancel = (id) => {
return req('put', baseurl + "/order/cancel/"+id)
}
// 分销商管理 // 分销商管理
//分销商管理列表 //分销商管理列表

View File

@ -9,7 +9,7 @@ import Grid from "../../../components/gird/main.js"
import TabPage from "../../../components/tabPage/main.js" import TabPage from "../../../components/tabPage/main.js"
import Filterbar from "../../../components/filterbar/main.js" import Filterbar from "../../../components/filterbar/main.js"
import menu from "../../../assets/enum.js" import menu from "../../../assets/enum.js"
import {getOrderList,handelResponse,getOrderExport} from "../../../assets/api.js" import {getOrderList,handelResponse,getOrderExport,putOrderSuccess,putOrderCancel} from "../../../assets/api.js"
const Column = [ const Column = [
{ {
title: '订单号', title: '订单号',
@ -162,7 +162,7 @@ export default class orderlist extends React.Component{
type:'warning', type:'warning',
closeBtn:true, closeBtn:true,
title:'确认操作', title:'确认操作',
content: <p>是否作废选中充值中的订单</p>, content: <p>是否作废<b>[充值中]</b></p>,
onConfirm(){ onConfirm(){
alert('开始调用作废接口'); alert('开始调用作废接口');
}, },
@ -218,17 +218,54 @@ export default class orderlist extends React.Component{
//作废 //作废
deleteFn(e,row){ deleteFn(e,row){
window.time='2021-11-15 15:02:02' let self=this;
Sweetalert.confirm({ Sweetalert.confirm({
type:'warning', type:'warning',
closeBtn:true, closeBtn:true,
title:'确认操作', title:'确认操作',
content: <p>是否作废渲染订单号订单</p>, content: <p>是否作废<b>[{row.order_number}]</b></p>,
onConfirm(){ onConfirm(){
alert('开始调用作废接口'); putOrderCancel(row.order_number).then(res=>{
handelResponse(res,(response,msg)=>{
Notify.clear();
Notify.success(msg);
self.getOrderFn();
},(err)=>{
})
}).catch(err=>{
});
}, },
onCancel(){ onCancel(){
console.log('点击了取消按钮');
},
className:'questModal',
parentComponent: this
});
}
//改为成功
changeSuccessFn(e,row){
let self=this;
Sweetalert.confirm({
type:'warning',
closeBtn:true,
title:'确认操作',
content: <p>是否将<b>[{row.order_number}]</b></p>,
onConfirm(){
putOrderSuccess(row.order_number).then(res=>{
handelResponse(res,(response,msg)=>{
Notify.clear();
Notify.success(msg);
self.getOrderFn();
},(err)=>{
})
}).catch(err=>{
});
},
onCancel(){
}, },
className:'questModal', className:'questModal',
parentComponent: this parentComponent: this
@ -351,7 +388,7 @@ componentDidUpdate(prevProps,prevState){
<p> <p>
<Button type="primary" icon="plus" onClick={this.clickFn.bind(this)}>新建订单</Button> <Button type="primary" icon="plus" onClick={this.clickFn.bind(this)}>新建订单</Button>
<Button type="danger" onClick={this.batchdelFn.bind(this)}>批量作废</Button> <Button type="danger" onClick={this.batchdelFn.bind(this)}>批量作废</Button>
<Button type="info" icon="download" onClick={this.exportFn.bind(this)}>导出订单</Button> <Button type="normol" icon="download" onClick={this.exportFn.bind(this)}>导出订单</Button>
</p> </p>
{/* <Button type="info">批量操作</Button> */} {/* <Button type="info">批量操作</Button> */}
@ -408,7 +445,7 @@ componentDidUpdate(prevProps,prevState){
rowData.status==3? <span className="grid-link" onClick={(e)=>this.againinvestFn(e,rowData)}>再次充值</span>:null rowData.status==3? <span className="grid-link" onClick={(e)=>this.againinvestFn(e,rowData)}>再次充值</span>:null
} }
{ {
rowData.status==3? <span className="grid-link" onClick={(e)=>this.deleteFn(e,rowData)} >改为成功</span>:null rowData.status==3? <span className="grid-link" onClick={(e)=>this.changeSuccessFn(e,rowData)} >改为成功</span>:null
} }
</div> </div>