parent
10807b0c6f
commit
2bcaaf2027
@ -0,0 +1,67 @@
|
||||
import { message } from 'antd';
|
||||
import { orderItems, getOrderRecipientInfo, orderDeliver } from '../../services/order';
|
||||
|
||||
export default {
|
||||
namespace: 'orderDelivery',
|
||||
|
||||
state: {
|
||||
orderId: null,
|
||||
visible: false,
|
||||
list: [],
|
||||
orderRecipient: {},
|
||||
selectedRowKeys: [],
|
||||
},
|
||||
|
||||
effects: {
|
||||
*getOrderItems({ payload }, { call, put }) {
|
||||
const response1 = yield call(orderItems, payload);
|
||||
const response2 = yield call(getOrderRecipientInfo, payload);
|
||||
|
||||
yield put({
|
||||
type: 'getOrderItemsSuccess',
|
||||
payload: {
|
||||
list: response1.data,
|
||||
orderRecipient: response2.data,
|
||||
},
|
||||
});
|
||||
},
|
||||
*deliver({ payload }, { call, put }) {
|
||||
const { code } = yield call(orderDeliver, payload);
|
||||
if (code === 0) {
|
||||
message.info('发货成功!');
|
||||
yield put({
|
||||
type: 'changeVisible',
|
||||
payload: {
|
||||
visible: false,
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
reducers: {
|
||||
getOrderItemsSuccess(state, { payload }) {
|
||||
const { list, orderRecipient } = payload;
|
||||
return {
|
||||
...state,
|
||||
list,
|
||||
orderRecipient,
|
||||
};
|
||||
},
|
||||
changeVisible(state, { payload }) {
|
||||
const { visible, orderId } = payload;
|
||||
return {
|
||||
...state,
|
||||
visible,
|
||||
orderId,
|
||||
};
|
||||
},
|
||||
changeSelectedRowKeys(state, { payload }) {
|
||||
const { selectedRowKeys } = payload;
|
||||
return {
|
||||
...state,
|
||||
selectedRowKeys,
|
||||
};
|
||||
},
|
||||
},
|
||||
};
|
||||
@ -0,0 +1,9 @@
|
||||
@import '~antd/lib/style/themes/default.less';
|
||||
@import '~@/utils/utils.less';
|
||||
|
||||
.goodImg {
|
||||
@size: 100px;
|
||||
|
||||
width: @size;
|
||||
height: @size;
|
||||
}
|
||||
@ -1,49 +1,9 @@
|
||||
@import '~antd/lib/style/themes/default.less';
|
||||
@import '~@/utils/utils.less';
|
||||
|
||||
.tableList {
|
||||
.tableListOperator {
|
||||
margin-bottom: 16px;
|
||||
button {
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tableListForm {
|
||||
:global {
|
||||
.ant-form-item {
|
||||
display: flex;
|
||||
margin-right: 0;
|
||||
margin-bottom: 24px;
|
||||
> .ant-form-item-label {
|
||||
width: auto;
|
||||
padding-right: 8px;
|
||||
line-height: 32px;
|
||||
}
|
||||
.ant-form-item-control {
|
||||
line-height: 32px;
|
||||
}
|
||||
}
|
||||
.ant-form-item-control-wrapper {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
.submitButtons {
|
||||
display: block;
|
||||
margin-bottom: 24px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: @screen-lg) {
|
||||
.tableListForm :global(.ant-form-item) {
|
||||
margin-right: 24px;
|
||||
}
|
||||
}
|
||||
.goodImg {
|
||||
@size: 100;
|
||||
|
||||
@media screen and (max-width: @screen-md) {
|
||||
.tableListForm :global(.ant-form-item) {
|
||||
margin-right: 8px;
|
||||
}
|
||||
width: @size;
|
||||
height: @size;
|
||||
}
|
||||
|
||||
Loading…
Reference in new issue