- 修改订单展示

- 增加实付金额修改功能
This commit is contained in:
sin
2019-03-29 17:13:46 +08:00
parent 509d379855
commit 3cbe0ba3b6
5 changed files with 281 additions and 94 deletions

View File

@@ -1,5 +1,5 @@
import { message } from 'antd';
import { orderPage, updateOrderItem } from '../../services/order';
import { orderPage, updateOrderItem, updateOrderItemPayAmount } from '../../services/order';
export default {
namespace: 'orderList',
@@ -13,11 +13,26 @@ export default {
},
dataSource: [],
},
payAmountVisible: false,
payAmount: 0,
orderId: 0,
orderItemId: 0,
searchParams: {},
},
effects: {
*queryPage({ payload }, { call, put }) {
const response = yield call(orderPage, payload);
yield put({
type: 'changeSearchParams',
payload: {
searchParams: {
...payload,
},
},
});
message.info('查询成功!', response);
const { total, orders } = response.data;
yield put({
@@ -45,6 +60,23 @@ export default {
},
});
},
*updatePayAmount({ payload }, { call, put }) {
const { searchParams, params } = payload;
yield call(updateOrderItemPayAmount, params);
yield put({
type: 'changePayAmountVisible',
payload: {
payAmountVisible: false,
},
});
yield put({
type: 'queryPage',
payload: {
...searchParams,
},
});
},
},
reducers: {
@@ -55,5 +87,17 @@ export default {
list,
};
},
changePayAmountVisible(state, { payload }) {
return {
...state,
...payload,
};
},
changeSearchParams(state, { payload }) {
return {
...state,
...payload,
};
},
},
};