Commit 1af94dfd by 杨铁龙

专项订单提取

parent d64555ed
Showing with 61 additions and 21 deletions
...@@ -50,6 +50,18 @@ export interface OrderTableListItem { ...@@ -50,6 +50,18 @@ export interface OrderTableListItem {
RefundedAmount: number; 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 { export const enum PayStatus {
UnPay = 1, UnPay = 1,
Paied, Paied,
......
import Chat from "@/customer-service/xim"; import Chat from "@/customer-service/xim";
import store from "@/store"; 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"; import { ChatStore } from "../store/model";
class OrderService {
export const generalOrder = 'general_order_info'; public generalOrder = 'general_order_info';
export const generalOrderPaymentModel = 'general_order_payment_info'; public generalOrderPaymentModel = 'general_order_payment_info';
export function openOrder(params: {
productId: number; private handler = new UniplatSdkExtender();
srcPlatform: SrcPlatform;
createdType: OperationType; public openOrder(params: {
title?: string; productId: number;
}) { srcPlatform: SrcPlatform;
const sdk = Chat.getSdk(); createdType: OperationType;
return sdk.model(generalOrder).action('addOrder').addInputs_parameter({ title?: string;
ProductId: params.productId, }) {
SrcPlatform: params.srcPlatform, const sdk = Chat.getSdk();
CreatedType: params.createdType return sdk.model(this.generalOrder).action('addOrder').addInputs_parameter({
}).execute().then(r => { ProductId: params.productId,
return store.dispatch(`${ChatStore.ns}/${ChatStore.ACTION_CREATE_NEW_CHAT_BY_CLIENT}`, { SrcPlatform: params.srcPlatform,
modelName: generalOrder, CreatedType: params.createdType
selectedListId: r.id, }).execute().then(r => {
title: params.title return store.dispatch(`${ChatStore.ns}/${ChatStore.ACTION_CREATE_NEW_CHAT_BY_CLIENT}`, {
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