Commit 1af94dfd by 杨铁龙

专项订单提取

parent d64555ed
Showing with 47 additions and 7 deletions
......@@ -50,6 +50,18 @@ export interface OrderTableListItem {
RefundedAmount: number;
}
export const orderTableListItemPredict = {
id: 'ID',
title: 'ProductId#product.OuterName',
status: 'Status',
time: 'CreatedDate',
PayAmount: 'PayAmount',
PaidAmount: 'PaidAmount',
RefundAmount: 'RefundAmount',
RefundedAmount: 'RefundedAmount',
chat: 'UniplatImChatId'
}
export const enum PayStatus {
UnPay = 1,
Paied,
......
import Chat from "@/customer-service/xim";
import store from "@/store";
import { OperationType, SrcPlatform } from "../model";
import { metaRow, UniplatSdkExtender } from "uniplat-sdk";
import { OperationType, OrderRowItem, OrderStatus, OrderTableListItem, orderTableListItemPredict, SrcPlatform } from "../model";
import { ChatStore } from "../store/model";
class OrderService {
export const generalOrder = 'general_order_info';
export const generalOrderPaymentModel = 'general_order_payment_info';
public generalOrder = 'general_order_info';
public generalOrderPaymentModel = 'general_order_payment_info';
export function openOrder(params: {
private handler = new UniplatSdkExtender();
public openOrder(params: {
productId: number;
srcPlatform: SrcPlatform;
createdType: OperationType;
title?: string;
}) {
}) {
const sdk = Chat.getSdk();
return sdk.model(generalOrder).action('addOrder').addInputs_parameter({
return sdk.model(this.generalOrder).action('addOrder').addInputs_parameter({
ProductId: params.productId,
SrcPlatform: params.srcPlatform,
CreatedType: params.createdType
}).execute().then(r => {
return store.dispatch(`${ChatStore.ns}/${ChatStore.ACTION_CREATE_NEW_CHAT_BY_CLIENT}`, {
modelName: generalOrder,
modelName: this.generalOrder,
selectedListId: r.id,
title: params.title
});
});
}
public updateOrderStatus(id: number | string, v: number, status: OrderStatus) {
return Chat.getSdk().model(this.generalOrder).action('editStatus')
.addInputs_parameter({
Status: status,
userType: OperationType.User
})
.updateInitialParams({ selected_list: [{ v, id: +id }] })
.execute()
}
public getOrders(index: number) {
return Chat.getSdk().model(this.generalOrder)
.list('userOrderList')
.query({ item_size: 100, pageIndex: index })
.then(r =>
this.handler.buildRows<OrderTableListItem>(r.pageData.rows, orderTableListItemPredict));
}
}
export const orderService = new OrderService();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment