Commit 2d72407f by 王昆

dgd

parent 0b2f5368
......@@ -63,7 +63,9 @@ class ActionAPI extends APIBase {
case "saveSaasInvoice": // 保存saasInvoice 信息
opResult = await this.saasinvoiceSve.saveSaasInvoice(action_body);
break;
case "saasInvoiceInfo": // 保存saasInvoiceInfo 信息
opResult = await this.saasinvoiceapplySve.saasInvoiceInfo(action_body);
break;
case "merchantinvoicePage" : //发票列表(商户)
opResult = await this.saasinvoiceSve.merchantinvoicePage(action_body);
break;
......
......@@ -131,6 +131,45 @@ class SaasinvoiceapplyService extends ServiceBase {
return system.getResultSuccess(invoice);
}
/**
* fn:发票详情
* @param {*} params
*/
async saasInvoiceInfo(params){
if(!params.id){
return system.getResult(null,`参数错误 发票${params.id}不存在`);
}
try {
let saasInvoiceApply =await this.dao.getById(params.id);
if(!saasInvoiceApply){
return system.getResult(null,`参数错误 发票${params.id}不存在`);
}
// 费用类型 00注册订单费用 10平台转账费用 20商户转账费用
if(saasInvoiceApply.fee_type == "00"){
saasInvoiceApply.fee_type_name = "注册订单费用";
}else if(saasInvoiceApply.fee_type == "10"){
saasInvoiceApply.fee_type_name = "平台转账费用";
}else if(this.saasinvoiceDao.fee_type == "20"){
saasInvoiceApply.fee_type_name = "商户转账费用";
}
// 发票类型 10 增值税专用发票 20 增值税普通发票 30 普通发票
if(saasInvoiceApply.invoice_type == "10"){
saasInvoiceApply.invoice_type_name = "增值税专用发票";
}else if(saasInvoiceApply.invoice_type == "20"){
saasInvoiceApply.invoice_type_name = "增值税普通发票";
}else if(this.saasinvoiceDao.invoice_type == "30"){
saasInvoiceApply.invoice_type_name = "普通发票";
}
this.handleDate(saasInvoiceApply, ['updated_at', 'created_at'], 'YYYY-MM-DD HH:mm:ss');
let saasInvoice =await this.saasinvoiceDao.getById(params.id) || null;
saasInvoiceApply.saasInvoice = saasInvoice;
return system.getResult(saasInvoiceApply);
} catch (error) {
console.log(error);
return system.getResult(null,`系统错误`);
}
}
}
module.exports = SaasinvoiceapplyService;
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