Commit 7a4de30b by 杨铁龙

合并OrderPayItem interface

parents 6bf59166 c8d4a66c
Showing with 39 additions and 20 deletions
...@@ -54,12 +54,12 @@ export interface OrderTableListItem { ...@@ -54,12 +54,12 @@ export interface OrderTableListItem {
export const orderPredict = { export const orderPredict = {
id: "ID", id: "ID",
v: 'uniplat_version', v: "uniplat_version",
no: 'OrderDocNo', no: "OrderDocNo",
title: "ProductId#product.OuterName", title: "ProductId#product.OuterName",
status: "Status", status: "Status",
time: "CreatedDate", time: "CreatedDate",
createTime: 'CreatedDate', createTime: "CreatedDate",
PayAmount: "PayAmount", PayAmount: "PayAmount",
PaidAmount: "PaidAmount", PaidAmount: "PaidAmount",
RefundAmount: "RefundAmount", RefundAmount: "RefundAmount",
...@@ -113,6 +113,8 @@ export interface OrderPayItem { ...@@ -113,6 +113,8 @@ export interface OrderPayItem {
type: string; type: string;
desc: string; desc: string;
agent: string; agent: string;
createdTime: string;
actions?: any[];
} }
export const orderPayItemPredict = { export const orderPayItemPredict = {
...@@ -128,6 +130,7 @@ export const orderPayItemPredict = { ...@@ -128,6 +130,7 @@ export const orderPayItemPredict = {
title: "ItemName", title: "ItemName",
deadLine: "PaymentDueDate", deadLine: "PaymentDueDate",
value: "Amount", value: "Amount",
createdTime: "CreatedDate"
} }
export const enum ChatOpenDirection { export const enum ChatOpenDirection {
......
...@@ -72,16 +72,34 @@ class OrderService { ...@@ -72,16 +72,34 @@ class OrderService {
); );
} }
public getPayments(id: number) { /**
* 获取订单支付记录
* @param id 订单id
* @param withActions 是否获取行数据中action条目
*/
public getPayments(id: number, withActions = false) {
return this.getSdk() return this.getSdk()
.model(orderService.generalOrderPaymentModel) .model(orderService.generalOrderPaymentModel)
.list() .list()
.addPrefilter({ OrderId: id }) .addPrefilter({ OrderId: id })
.query({ pageIndex: 1, item_size: 100 }) .query({ pageIndex: 1, item_size: 100 })
.then((r) => this.handler.buildRows<OrderPayItem>( .then((r) => {
r.pageData.rows, if (r && r.pageData && r.pageData.rows) {
orderPayItemPredict const items = this.handler.buildRows<OrderPayItem>(
)); r.pageData.rows,
orderPayItemPredict
);
if (withActions) {
for (let i = 0; i < r.pageData.rows.length; i++) {
items[i].actions = r.pageData.rows[i].actions;
}
}
return items;
}
return [];
});
} }
public getPayment(id: string | number) { public getPayment(id: string | number) {
...@@ -98,7 +116,9 @@ class OrderService { ...@@ -98,7 +116,9 @@ class OrderService {
return this.getSdk() return this.getSdk()
.model(orderService.generalOrderPaymentModel) .model(orderService.generalOrderPaymentModel)
.action("addImages") .action("addImages")
.updateInitialParams({ selected_list: [{ v, id: payment as number }] }) .updateInitialParams({
selected_list: [{ v, id: payment as number }],
})
.addInputs_parameter({ images: path }) .addInputs_parameter({ images: path })
.execute(); .execute();
} }
...@@ -109,17 +129,13 @@ class OrderService { ...@@ -109,17 +129,13 @@ class OrderService {
.list() .list()
.addPrefilter({ PaymentId: payment }) .addPrefilter({ PaymentId: payment })
.query({ item_size: 10, pageIndex: 1 }) .query({ item_size: 10, pageIndex: 1 })
.then( .then((r) =>
(r) => this.handler.buildRows<UploadImageItem>(r.pageData.rows, {
this.handler.buildRows<UploadImageItem>( time: "CreatedDate",
r.pageData.rows, fileSize: "FileSize",
{ fileName: "FileName",
time: "CreatedDate", url: "Url",
fileSize: "FileSize", })
fileName: "FileName",
url: "Url",
}
)
); );
} }
......
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