Commit 6412071d by zhaoxiqing

gsb

parent a767ed72
......@@ -60,7 +60,7 @@ class ActionAPI extends APIBase {
opResult = await this.saasinvoiceSve.merchantinvoicePage(action_body);
break;
case "platforminvoicePage" : //发票列表(平台)
opResult = await this.saasinvoiceSve.merchantinvoicePage(action_body);
opResult = await this.saasinvoiceSve.platforminvoicePage(action_body);
break;
......
......@@ -8,8 +8,7 @@ const moment = require('moment');
class SaasinvoiceService extends ServiceBase {
constructor() {
super("invoice", ServiceBase.getDaoName(SaasinvoiceService));
this.dictionary = system.getObject("util.dictionary");
}
async merchantinvoicePage(params) {
......@@ -27,6 +26,7 @@ class SaasinvoiceService extends ServiceBase {
for (var item of list) {
this.handleDate(item, ['updated_at', 'created_at'], 'YYYY-MM-DD HH:mm:ss');
this.handleDate(item, ['invoice_time'], 'YYYY-MM-DD');
this.dictionary.setRowName("SAAS_INTEVOICE",item,["owner_type","fee_type","invoice_type","invoice_join"]);
}
}
return system.getResultSuccess({count: total, rows: list});
......@@ -47,6 +47,7 @@ class SaasinvoiceService extends ServiceBase {
for (var item of list) {
this.handleDate(item, ['updated_at', 'created_at'], 'YYYY-MM-DD HH:mm:ss');
this.handleDate(item, ['invoice_time'], 'YYYY-MM-DD');
this.dictionary.setRowName("SAAS_INTEVOICE",item,["owner_type","fee_type","invoice_type","invoice_join"]);
}
}
return system.getResultSuccess({count: total, rows: list});
......
......@@ -2,14 +2,15 @@ const system = require("../system");
class Dictionary {
constructor() {
// 交易字典
this.SAAS_INTEVOICE = {
order_type: {"00": "未设置", "10": "平台交易", "20": "商户交易"},
acc_type: {"00": "银行", "01": "支付宝", "02": "微信"},
owner_type: {"00": "商户发票", "10": "平台发票"},
fee_type: {"00": "注册订单费用", "10": "平台转账费用", "20": "商户转账费用"},
invoice_type :{"10" : "增值税专用发票", "20":" 增值税普通发票", "30" :"普通发票"},
invoice_join : {"10":"记账联","20":"发票联","30":"抵扣联","40":"销售方次"},
};
this.SAAS_INVOICE_APPLY = {
trade_status: {"00": "成功", "01": "待处理", "02": "失败"}
}
// this.SAAS_INVOICE_APPLY = {
// trade_status: {"00": "成功", "01": "待处理", "02": "失败"}
// }
}
getDict(module, field) {
......@@ -17,13 +18,12 @@ class Dictionary {
}
// setRowName("ORDER", order, ["order_type", "acc_type", "trade_mode", "trade_status", "check_status"]);
setRowName(module, row, fields, concat) {
setRowName(module, row, fields) {
if(!module || !row || !fields || fields.length == 0) {
return;
}
concat = concat || "_";
for (let field of fields) {
row[field + concat + "name"] = this.getDict(module, field)[row[field] || ""] || "";
row[field] = this.getDict(module, field)[row[field] || ""] || "";
}
}
......
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 to comment