feat:【订单管理】已支付,充值失败的订单,新增按钮重试退款、手动退款“
This commit is contained in:
parent
3346611a49
commit
413e23864b
File diff suppressed because it is too large
Load Diff
|
@ -5,190 +5,32 @@ import {
|
|||
Select,
|
||||
Alert,
|
||||
CombinedDateRangePicker,
|
||||
Sweetalert
|
||||
Sweetalert,
|
||||
Dialog
|
||||
} from "zent"
|
||||
import "./list.less"
|
||||
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 menu from "../../../assets/enum.js"
|
||||
import { nowMonth, nowDay } from "../../../assets/comm.js"
|
||||
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 menu from "@/assets/enum.js"
|
||||
import { nowMonth, nowDay } from "@/assets/comm.js"
|
||||
import { filterList, Column, options, rules } from "./utils"
|
||||
import Form from "@/components/form/main"
|
||||
import FormItem from "@/components/form-item/main"
|
||||
import {
|
||||
getOrderList,
|
||||
getOrderExport,
|
||||
handelResponse,
|
||||
putOrderSuccess,
|
||||
putOrderCancel
|
||||
} from "../../../assets/api.js"
|
||||
putOrderCancel,
|
||||
refund,
|
||||
handlerRefund
|
||||
} 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查询"
|
||||
},
|
||||
{
|
||||
key: "2",
|
||||
text: "通用查询"
|
||||
},
|
||||
{
|
||||
key: "3",
|
||||
text: "key批次"
|
||||
},
|
||||
{
|
||||
key: "4",
|
||||
text: "兑换码批次ID"
|
||||
},
|
||||
{
|
||||
key: "5",
|
||||
text: "平台批次号"
|
||||
}
|
||||
]
|
||||
const Column = [
|
||||
{
|
||||
title: "订单号",
|
||||
name: "order_number",
|
||||
prop: "order_number",
|
||||
type: "normal",
|
||||
width: "150px"
|
||||
},
|
||||
{
|
||||
title: "兑换码-批次ID",
|
||||
name: "code_batch_id",
|
||||
prop: "code_batch_id",
|
||||
type: "normal",
|
||||
width: "80px"
|
||||
},
|
||||
{
|
||||
title: "商品名称",
|
||||
prop: "product_name",
|
||||
name: "product_name",
|
||||
width: "120px",
|
||||
type: "normal"
|
||||
},
|
||||
{
|
||||
title: "官方价格",
|
||||
name: "official_price",
|
||||
prop: "official_price",
|
||||
type: "normal",
|
||||
width: "80px"
|
||||
},
|
||||
{
|
||||
title: "合同价(成本价)",
|
||||
name: "cost",
|
||||
type: "slot",
|
||||
prop: "cost",
|
||||
width: "120px"
|
||||
},
|
||||
{
|
||||
title: "分销商",
|
||||
name: "reseller_name",
|
||||
type: "normal",
|
||||
prop: "reseller_name",
|
||||
width: "auto"
|
||||
},
|
||||
{
|
||||
title: "归属key批次",
|
||||
name: "key_batch_id",
|
||||
prop: "key_batch_id",
|
||||
width: "80px",
|
||||
type: "normal"
|
||||
},
|
||||
{
|
||||
title: "归属营销计划",
|
||||
name: "plan_title",
|
||||
prop: "plan_title",
|
||||
width: "auto",
|
||||
type: "normal"
|
||||
},
|
||||
{
|
||||
title: "购买数量",
|
||||
name: "num",
|
||||
type: "normal",
|
||||
prop: "num",
|
||||
width: "50px"
|
||||
},
|
||||
{
|
||||
title: "订单状态",
|
||||
name: "statusDom",
|
||||
prop: "statusDom",
|
||||
type: "slot",
|
||||
width: "80px"
|
||||
},
|
||||
{
|
||||
title: "支付状态",
|
||||
name: "pay_status",
|
||||
prop: "pay_status",
|
||||
type: "slot",
|
||||
width: "80px"
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
prop: "opearo",
|
||||
name: "opearo",
|
||||
type: "slot",
|
||||
width: "140px"
|
||||
},
|
||||
{
|
||||
title: "平台批次号",
|
||||
name: "channel_activity_id",
|
||||
type: "slot",
|
||||
prop: "channel_activity_id",
|
||||
width: "auto"
|
||||
},
|
||||
{
|
||||
title: "创建时间",
|
||||
name: "create_time",
|
||||
prop: "create_time",
|
||||
width: "130px",
|
||||
type: "normal"
|
||||
},
|
||||
{
|
||||
title: "账号",
|
||||
name: "account",
|
||||
type: "normal",
|
||||
prop: "account",
|
||||
width: "auto"
|
||||
},
|
||||
{
|
||||
title: "商品类型",
|
||||
name: "product_type",
|
||||
prop: "product_type",
|
||||
width: "50px",
|
||||
type: "slot"
|
||||
},
|
||||
{
|
||||
title: "订单类型",
|
||||
name: "order_type",
|
||||
prop: "order_type",
|
||||
width: "50px",
|
||||
type: "slot"
|
||||
},
|
||||
{
|
||||
title: "减扣价(元)",
|
||||
name: "discount_amount",
|
||||
prop: "discount_amount",
|
||||
type: "normal",
|
||||
width: "80px"
|
||||
},
|
||||
{
|
||||
title: "结算价(元)",
|
||||
name: "pay_amount",
|
||||
prop: "pay_amount",
|
||||
type: "normal",
|
||||
width: "80px"
|
||||
},
|
||||
{
|
||||
title: "key",
|
||||
name: "key",
|
||||
prop: "key",
|
||||
width: "140px",
|
||||
type: "normal"
|
||||
}
|
||||
]
|
||||
|
||||
export default class orderlist extends React.Component {
|
||||
constructor(props) {
|
||||
|
@ -197,33 +39,7 @@ export default class orderlist extends React.Component {
|
|||
orderType: "",
|
||||
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: "直充-已取消" },
|
||||
{ id: 111, name: "立减金-待领取" },
|
||||
{ id: 222, name: "立减金-已领取" },
|
||||
{ id: 5, name: "立减金-已过期" }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
label: "支付状态",
|
||||
prop: "pay_status",
|
||||
menuList: [
|
||||
{ id: 1, name: "待支付" },
|
||||
{ id: 2, name: "已支付" },
|
||||
{ id: 3, name: "已退款" }
|
||||
]
|
||||
}
|
||||
],
|
||||
filterList: filterList,
|
||||
|
||||
selectiondata: [],
|
||||
menuList: [
|
||||
|
@ -243,7 +59,11 @@ export default class orderlist extends React.Component {
|
|||
contractprice: 0,
|
||||
costprice: 0,
|
||||
totalprice: 0,
|
||||
placeholder: "请输入key查询"
|
||||
placeholder: "请输入key查询",
|
||||
visible: false /* 手动退款提示款 */,
|
||||
model: {
|
||||
account: ""
|
||||
}
|
||||
}
|
||||
this.onChangeCombinedDate = this.onChangeCombinedDate.bind(this)
|
||||
}
|
||||
|
@ -303,6 +123,48 @@ export default class orderlist extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
/* 手动退款 */
|
||||
handlerRefundFunction() {
|
||||
if (this.refs.form.validator()) {
|
||||
handlerRefund(this.state.orderNumber, {
|
||||
refund_account: this.state.model.account
|
||||
})
|
||||
.then((res) => {
|
||||
handelResponse(
|
||||
res,
|
||||
(response, msg) => {
|
||||
Notify.clear()
|
||||
Notify.success(msg)
|
||||
this.setState({ visible: false })
|
||||
},
|
||||
(err) => {
|
||||
Notify.error(err)
|
||||
}
|
||||
)
|
||||
})
|
||||
.catch((err) => {})
|
||||
}
|
||||
}
|
||||
|
||||
/* 重试退款 */
|
||||
refundFunction(orderNumber) {
|
||||
refund(orderNumber)
|
||||
.then((res) => {
|
||||
handelResponse(
|
||||
res,
|
||||
(response, msg) => {
|
||||
console.log(msg)
|
||||
Notify.clear()
|
||||
Notify.success(msg)
|
||||
},
|
||||
(err) => {
|
||||
Notify.error(err)
|
||||
}
|
||||
)
|
||||
})
|
||||
.catch((err) => {})
|
||||
}
|
||||
|
||||
//导出订单
|
||||
exportFn() {
|
||||
let _self = this
|
||||
|
@ -894,12 +756,99 @@ export default class orderlist extends React.Component {
|
|||
改为成功
|
||||
</span>
|
||||
) : null}
|
||||
{rowData.status == 3 ? (
|
||||
<>
|
||||
<span
|
||||
className='grid-link'
|
||||
onClick={() =>
|
||||
this.refundFunction(rowData.order_number)
|
||||
}>
|
||||
重试退款
|
||||
</span>
|
||||
<span
|
||||
className='grid-link'
|
||||
onClick={(e) => {
|
||||
this.setState({
|
||||
orderNumber: rowData.order_number,
|
||||
visible: true
|
||||
})
|
||||
}}>
|
||||
手动退款
|
||||
</span>
|
||||
</>
|
||||
) : null}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Dialog
|
||||
visible={this.state.visible}
|
||||
className='questModal'
|
||||
onClose={() => this.setState({ visible: false })}
|
||||
title='退款'>
|
||||
<Form
|
||||
model={this.state.model}
|
||||
className='form'
|
||||
rules={rules}
|
||||
ref='form'>
|
||||
<FormItem
|
||||
labelname='退款账号'
|
||||
id='account'
|
||||
prop='account'
|
||||
labelwidth='80px'>
|
||||
<Ipt
|
||||
onChange={(value) => {
|
||||
const model = this.state.model
|
||||
model.account = value
|
||||
this.setState({ model })
|
||||
}}
|
||||
onClearItem={() => {
|
||||
const model = this.state.model
|
||||
model.account = ""
|
||||
this.setState({ model })
|
||||
}}
|
||||
value={this.state.model.account}
|
||||
placeholder={""}
|
||||
labelWidth={"0px"}
|
||||
maxLength={40}
|
||||
height={"36px"}
|
||||
unit=''
|
||||
countShow={false}
|
||||
width={"300px"}
|
||||
alignment={"left"}
|
||||
/>
|
||||
</FormItem>
|
||||
<FormItem labelname='' id='account-none' prop='account'>
|
||||
<Ipt
|
||||
onChange={(value) => {}}
|
||||
onClearItem={() => {}}
|
||||
value={this.state.model.account}
|
||||
placeholder={""}
|
||||
labelWidth={"0px"}
|
||||
maxLength={40}
|
||||
height={"36px"}
|
||||
unit=''
|
||||
countShow={false}
|
||||
width={"520px"}
|
||||
alignment={"left"}
|
||||
/>
|
||||
</FormItem>
|
||||
</Form>
|
||||
<p className='dflexajce'>
|
||||
<Button onClick={() => this.setState({ visible: false })}>
|
||||
取消
|
||||
</Button>
|
||||
<Button
|
||||
type='primary'
|
||||
onClick={() => this.handlerRefundFunction()}
|
||||
htmlType='submit'>
|
||||
提交
|
||||
</Button>
|
||||
</p>
|
||||
</Dialog>
|
||||
</TabPage>
|
||||
</div>
|
||||
)
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
|
||||
#dislist .zent-datepicker-trigger{
|
||||
#dislist .zent-datepicker-trigger {
|
||||
background: #f5f6f7;
|
||||
border: none;
|
||||
}
|
||||
|
@ -7,22 +6,36 @@
|
|||
|
||||
.orderList .zent-select-v2[data-zv="9.11.0"] {
|
||||
margin-top: -8px;
|
||||
margin-right:-20px;
|
||||
border:0;
|
||||
margin-right: -20px;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.orderList .distable{
|
||||
.orderList .distable {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.orderList .iptfillself {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.orderList .iptfillself .label {
|
||||
margin-right: 20px;
|
||||
}
|
||||
.orderList .zent-select-v2[data-zv="9.12.7"]{
|
||||
border-top:0;
|
||||
border-left:0;
|
||||
border-right:0;
|
||||
|
||||
.orderList .zent-select-v2[data-zv="9.12.7"] {
|
||||
border-top: 0;
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
#account-none {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.form {
|
||||
margin: 20px 0 50px;
|
||||
}
|
||||
|
||||
.form-compontent {
|
||||
padding: 0
|
||||
}
|
|
@ -0,0 +1,197 @@
|
|||
export const Column = [
|
||||
{
|
||||
title: "订单号",
|
||||
name: "order_number",
|
||||
prop: "order_number",
|
||||
type: "normal",
|
||||
width: "150px"
|
||||
},
|
||||
{
|
||||
title: "兑换码-批次ID",
|
||||
name: "code_batch_id",
|
||||
prop: "code_batch_id",
|
||||
type: "normal",
|
||||
width: "80px"
|
||||
},
|
||||
{
|
||||
title: "商品名称",
|
||||
prop: "product_name",
|
||||
name: "product_name",
|
||||
width: "120px",
|
||||
type: "normal"
|
||||
},
|
||||
{
|
||||
title: "官方价格",
|
||||
name: "official_price",
|
||||
prop: "official_price",
|
||||
type: "normal",
|
||||
width: "80px"
|
||||
},
|
||||
{
|
||||
title: "合同价(成本价)",
|
||||
name: "cost",
|
||||
type: "slot",
|
||||
prop: "cost",
|
||||
width: "120px"
|
||||
},
|
||||
{
|
||||
title: "分销商",
|
||||
name: "reseller_name",
|
||||
type: "normal",
|
||||
prop: "reseller_name",
|
||||
width: "auto"
|
||||
},
|
||||
{
|
||||
title: "归属key批次",
|
||||
name: "key_batch_id",
|
||||
prop: "key_batch_id",
|
||||
width: "80px",
|
||||
type: "normal"
|
||||
},
|
||||
{
|
||||
title: "归属营销计划",
|
||||
name: "plan_title",
|
||||
prop: "plan_title",
|
||||
width: "auto",
|
||||
type: "normal"
|
||||
},
|
||||
{
|
||||
title: "购买数量",
|
||||
name: "num",
|
||||
type: "normal",
|
||||
prop: "num",
|
||||
width: "50px"
|
||||
},
|
||||
{
|
||||
title: "订单状态",
|
||||
name: "statusDom",
|
||||
prop: "statusDom",
|
||||
type: "slot",
|
||||
width: "80px"
|
||||
},
|
||||
{
|
||||
title: "支付状态",
|
||||
name: "pay_status",
|
||||
prop: "pay_status",
|
||||
type: "slot",
|
||||
width: "80px"
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
prop: "opearo",
|
||||
name: "opearo",
|
||||
type: "slot",
|
||||
width: "160px"
|
||||
},
|
||||
{
|
||||
title: "平台批次号",
|
||||
name: "channel_activity_id",
|
||||
type: "slot",
|
||||
prop: "channel_activity_id",
|
||||
width: "auto"
|
||||
},
|
||||
{
|
||||
title: "创建时间",
|
||||
name: "create_time",
|
||||
prop: "create_time",
|
||||
width: "130px",
|
||||
type: "normal"
|
||||
},
|
||||
{
|
||||
title: "账号",
|
||||
name: "account",
|
||||
type: "normal",
|
||||
prop: "account",
|
||||
width: "auto"
|
||||
},
|
||||
{
|
||||
title: "商品类型",
|
||||
name: "product_type",
|
||||
prop: "product_type",
|
||||
width: "50px",
|
||||
type: "slot"
|
||||
},
|
||||
{
|
||||
title: "订单类型",
|
||||
name: "order_type",
|
||||
prop: "order_type",
|
||||
width: "50px",
|
||||
type: "slot"
|
||||
},
|
||||
{
|
||||
title: "减扣价(元)",
|
||||
name: "discount_amount",
|
||||
prop: "discount_amount",
|
||||
type: "normal",
|
||||
width: "80px"
|
||||
},
|
||||
{
|
||||
title: "结算价(元)",
|
||||
name: "pay_amount",
|
||||
prop: "pay_amount",
|
||||
type: "normal",
|
||||
width: "80px"
|
||||
},
|
||||
{
|
||||
title: "key",
|
||||
name: "key",
|
||||
prop: "key",
|
||||
width: "140px",
|
||||
type: "normal"
|
||||
}
|
||||
]
|
||||
|
||||
export const options = [
|
||||
{
|
||||
key: "1",
|
||||
text: "key查询"
|
||||
},
|
||||
{
|
||||
key: "2",
|
||||
text: "通用查询"
|
||||
},
|
||||
{
|
||||
key: "3",
|
||||
text: "key批次"
|
||||
},
|
||||
{
|
||||
key: "4",
|
||||
text: "兑换码批次ID"
|
||||
},
|
||||
{
|
||||
key: "5",
|
||||
text: "平台批次号"
|
||||
}
|
||||
]
|
||||
|
||||
export const filterList = [
|
||||
{
|
||||
id: 0,
|
||||
label: "订单状态",
|
||||
prop: "status",
|
||||
menuList: [
|
||||
{ id: 999, name: "全部" },
|
||||
{ id: 1, name: "直充-充值中" },
|
||||
{ id: 2, name: "直充-已完成" },
|
||||
{ id: 3, name: "直充-充值失败" },
|
||||
{ id: 4, name: "直充-已取消" },
|
||||
{ id: 111, name: "立减金-待领取" },
|
||||
{ id: 222, name: "立减金-已领取" },
|
||||
{ id: 5, name: "立减金-已过期" }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
label: "支付状态",
|
||||
prop: "pay_status",
|
||||
menuList: [
|
||||
{ id: 1, name: "待支付" },
|
||||
{ id: 2, name: "已支付" },
|
||||
{ id: 3, name: "已退款" }
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
export const rules = {
|
||||
account: [{ type: "required", message: "请输入账号" }]
|
||||
}
|
Loading…
Reference in New Issue