feat:订单列表增加立减金核销状态voucher_status

This commit is contained in:
Apple 2022-12-27 14:40:03 +08:00
parent 8f921eaed9
commit c69a2a5b7f
3 changed files with 45 additions and 11 deletions

View File

@ -51,6 +51,8 @@ const menu = {
return "#43A65D" return "#43A65D"
case 3: case 3:
return "#DC4F40" return "#DC4F40"
case 333:
return "transparent"
} }
}, },
//计划任务状态 //计划任务状态

View File

@ -44,7 +44,8 @@ export default class orderlist extends React.Component {
selectiondata: [], selectiondata: [],
menuList: [ menuList: [
{ id: 0, name: "订单状态", check: false }, { id: 0, name: "订单状态", check: false },
{ id: 1, name: "支付状态", check: false } { id: 1, name: "支付状态", check: false },
{ id: 3, name: "核销状态", check: false }
], ],
allcheck: false, allcheck: false,
itemcheck: false, itemcheck: false,
@ -52,6 +53,7 @@ export default class orderlist extends React.Component {
tableHeight: 500, tableHeight: 500,
status: null, status: null,
pay_status: null, pay_status: null,
voucher_status:null,
page: 1, page: 1,
limit: 10, limit: 10,
key_word: "", key_word: "",
@ -168,7 +170,7 @@ export default class orderlist extends React.Component {
//导出订单 //导出订单
exportFn() { exportFn() {
let _self = this; let _self = this;
let { key_word, status, option, orderType, pay_status } = _self.state; let { key_word, status, option, orderType, pay_status,voucher_status } = _self.state;
let data = {}; let data = {};
if (orderType && status) { if (orderType && status) {
//区分立减金和商品 //区分立减金和商品
@ -186,6 +188,9 @@ export default class orderlist extends React.Component {
if (pay_status?.length) { if (pay_status?.length) {
data.pay_status = pay_status?.join(","); data.pay_status = pay_status?.join(",");
} }
if (voucher_status?.length) {
data.voucher_status = voucher_status?.join(",");
}
if (option && option.key == 1) { if (option && option.key == 1) {
if (key_word) { if (key_word) {
@ -259,11 +264,11 @@ export default class orderlist extends React.Component {
var year = now.getFullYear(); var year = now.getFullYear();
var month = var month =
now.getMonth() + 1 <= 9 ? "0" + (now.getMonth() + 1) : now.getMonth() + 1; now.getMonth() + 1 <= 9 ? "0" + (now.getMonth() + 1) : now.getMonth() + 1;
var day = now.getDate() <= 9 ? "0" + now.getDate() : now.getDate(); var day = now.getDate() <= 9 ? "0" + now.getDate() : now.getDate();
var tt = now.getHours() <= 9 ? "0" + now.getHours() : now.getHours(); var tt = now.getHours() <= 9 ? "0" + now.getHours() : now.getHours();
var mm = now.getMinutes() <= 9 ? "0" + now.getMinutes() : now.getMinutes(); var mm = now.getMinutes() <= 9 ? "0" + now.getMinutes() : now.getMinutes();
var ss = now.getSeconds() <= 9 ? "0" + now.getSeconds() : now.getSeconds(); var ss = now.getSeconds() <= 9 ? "0" + now.getSeconds() : now.getSeconds();
let datelist = [year, month, day, tt, mm, ss]; let datelist = [year, month, day, tt, mm, ss];
return datelist.join(""); return datelist.join("");
} }
componentWillMount() { componentWillMount() {
@ -409,7 +414,7 @@ export default class orderlist extends React.Component {
//获取订单列表 //获取订单列表
getOrderFn(time = {}) { getOrderFn(time = {}) {
let _self = this; let _self = this;
let { page, limit, option, key_word, status, orderType, pay_status } = let { page, limit, option, key_word, status, orderType, pay_status,voucher_status } =
_self.state; _self.state;
let data = { page, limit }; let data = { page, limit };
if (orderType) { if (orderType) {
@ -462,7 +467,9 @@ export default class orderlist extends React.Component {
if (pay_status?.length) { if (pay_status?.length) {
data.pay_status = pay_status?.join(","); data.pay_status = pay_status?.join(",");
} }
if (voucher_status?.length) {
data.voucher_status = voucher_status?.join(",");
}
getOrderList(data) getOrderList(data)
.then((res) => { .then((res) => {
handelResponse( handelResponse(
@ -579,7 +586,11 @@ export default class orderlist extends React.Component {
if (prevState.pay_status != this.state.pay_status) { if (prevState.pay_status != this.state.pay_status) {
this.getOrderFn(); this.getOrderFn();
} }
if (prevState.voucher_status != this.state.voucher_status) {
this.getOrderFn();
}
} }
//过滤表格枚举状态 //过滤表格枚举状态
render() { render() {
const date = ( const date = (
@ -753,9 +764,19 @@ export default class orderlist extends React.Component {
if (com == "usage_status") { if (com == "usage_status") {
return ( return (
<span>
<p className='dflexa'>
<span>
<font
className='icon'
style={{
background: menu.orderStatusBg(
parseInt(rowData.orderVoucher?rowData.orderVoucher.status:333)
)
}}></font>
{this.usageFunction(rowData.orderVoucher?.status)} {this.usageFunction(rowData.orderVoucher?.status)}
</span> </span>
</p>
); );
} }

View File

@ -203,6 +203,17 @@ export const filterList = [
{ id: 2, name: "已支付" }, { id: 2, name: "已支付" },
{ id: 3, name: "已退款" } { id: 3, name: "已退款" }
] ]
},
{
id: 3,
label: "核销状态",
prop: "voucher_status",
menuList: [
{ id: 1, name: "未核销" },
{ id: 2, name: "已核销" },
{ id: 3, name: "已过期" },
{ id: 4, name: "已退款" }
]
} }
]; ];