From 1ec5082629e81b7876939c9deed40526332b8254 Mon Sep 17 00:00:00 2001 From: red-deng-deng <1924913374@qq.com> Date: Mon, 22 Nov 2021 20:47:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=94=E8=B0=83=E8=AE=A2=E5=8D=95=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E6=88=90=E5=8A=9F=E5=92=8C=E4=BD=9C=E5=BA=9F=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/api.js | 10 +++++++ src/pages/order/list/list.js | 53 ++++++++++++++++++++++++++++++------ 2 files changed, 55 insertions(+), 8 deletions(-) diff --git a/src/assets/api.js b/src/assets/api.js index bd6ce26d..974a457c 100644 --- a/src/assets/api.js +++ b/src/assets/api.js @@ -214,6 +214,16 @@ export const getOrderDetails = (id) => { export const getOrderExport = (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) +} + // 分销商管理 //分销商管理列表 diff --git a/src/pages/order/list/list.js b/src/pages/order/list/list.js index 75255a58..dfd45de2 100644 --- a/src/pages/order/list/list.js +++ b/src/pages/order/list/list.js @@ -9,7 +9,7 @@ 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 {getOrderList,handelResponse,getOrderExport} from "../../../assets/api.js" +import {getOrderList,handelResponse,getOrderExport,putOrderSuccess,putOrderCancel} from "../../../assets/api.js" const Column = [ { title: '订单号', @@ -162,7 +162,7 @@ export default class orderlist extends React.Component{ type:'warning', closeBtn:true, title:'确认操作', - content:
是否作废选中【充值中】的订单?
, + content:是否作废[充值中]的订单?
, onConfirm(){ alert('开始调用作废接口'); }, @@ -218,22 +218,59 @@ export default class orderlist extends React.Component{ //作废 deleteFn(e,row){ - window.time='2021-11-15 15:02:02' + let self=this; Sweetalert.confirm({ type:'warning', closeBtn:true, title:'确认操作', - content:是否作废【渲染订单号】订单?
, + content:是否作废[{row.order_number}]?
, onConfirm(){ - alert('开始调用作废接口'); + putOrderCancel(row.order_number).then(res=>{ + handelResponse(res,(response,msg)=>{ + Notify.clear(); + Notify.success(msg); + self.getOrderFn(); + },(err)=>{ + + }) + }).catch(err=>{ + }); }, onCancel(){ - console.log('点击了取消按钮'); + }, 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)=>{ + + }) + }).catch(err=>{ + }); + }, + onCancel(){ + + }, + className:'questModal', + parentComponent: this + }); + } //详情 moreFn(e,row){ this.props.history.push('/home/order-addetails?oid='+row.order_number); @@ -351,7 +388,7 @@ componentDidUpdate(prevProps,prevState){- +
{/* */} @@ -408,7 +445,7 @@ componentDidUpdate(prevProps,prevState){ rowData.status==3? this.againinvestFn(e,rowData)}>再次充值:null } { - rowData.status==3? this.deleteFn(e,rowData)} >改为成功:null + rowData.status==3? this.changeSuccessFn(e,rowData)} >改为成功:null }