Commit 947f848b by 王昆

gsb

parent 366bbba8
......@@ -22,6 +22,7 @@ class InvoiceCtl extends CtlBase {
if (!params.remark) {
return system.getResult(null, "请填写审核备注");
}
params.status = Number(params.status || 0) ? "1010" : "1020";
let rs = await this.saasinvoiceSve.audit(params)
if (rs.status === 0 && !params.status) {
await this.tradeSve.cancelInvoice({saas_invoice_id: params.id});
......@@ -293,16 +294,31 @@ class InvoiceCtl extends CtlBase {
// 审核
async platformAudit(params, pobj2, req) {
try {
let id = this.trim(params.id);
if (!id) {
params.id = this.trim(params.id);
if (!params.id) {
return system.getResult(null, "发票申请不存在");
}
let status = params.status || 0;
let remark = this.trim(params.remark);
if (!remark) {
params.remark = this.trim(params.remark);
if (!params.remark) {
return system.getResult(null, "请填写审核备注");
}
return system.getResultSuccess();
params.status = Number(params.status || 0) ? "1010" : "1020";
let rs = await this.saasinvoiceSve.audit(params)
return rs;
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
// 审核
async platformHandle(params, pobj2, req) {
try {
params.id = this.trim(params.id);
if (!params.id) {
return system.getResult(null, "发票申请不存在");
}
let rs = await this.saasinvoiceSve.platformHandle(params)
return rs;
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
......
......@@ -8,7 +8,7 @@ class SaasinvoiceService extends ServiceBase {
}
async platforminvoicePage(params){
var rs = await this.callms("invoice", "platforminvoicePage", params);
let rs = await this.callms("invoice", "platforminvoicePage", params);
if (rs && rs.data && rs.data.rows) {
this.transOrderField(rs.data.rows);
}
......@@ -17,7 +17,7 @@ class SaasinvoiceService extends ServiceBase {
async platforminvoiceapplyPage(params){
var rs = await this.callms("invoice", "platforminvoiceapplyPage", params);
let rs = await this.callms("invoice", "platforminvoiceapplyPage", params);
if (rs && rs.data && rs.data.rows) {
this.transOrderField(rs.data.rows);
}
......@@ -25,22 +25,22 @@ class SaasinvoiceService extends ServiceBase {
}
async audit(params) {
var rs = await this.callms("invoice", "invoiceapplyAudit", params);
let rs = await this.callms("invoice", "invoiceapplyAudit", params);
return rs;
}
async makeout(params) {
var rs = await this.callms("invoice", "invoiceapplyMakeOut", params);
let rs = await this.callms("invoice", "invoiceapplyMakeOut", params);
return rs;
}
async invoiceapplyById(params) {
var rs = await this.callms("invoice", "invoiceapplyById", params);
let rs = await this.callms("invoice", "invoiceapplyById", params);
return rs;
}
async applyBulkSave(params){
var rs = await this.callms("invoice", "invoiceapplyBulkSave", params);
let rs = await this.callms("invoice", "invoiceapplyBulkSave", params);
return rs;
}
......@@ -54,6 +54,33 @@ class SaasinvoiceService extends ServiceBase {
}
}
async invoiceapplyStatus(params) {
let rs = await this.callms("invoice", "invoiceapplyStatus", params);
return rs;
}
async platformHandle(params){
let apply = await this.invoiceapplyById(params);
apply = apply.data;
if (!apply) {
return system.getResult(null, "发票申请不存在");
}
if (apply.status != "1010") {
return system.getResult(null, "发票状态错误,请刷新重试");
}
// TODO 总统 推送发票信息 begin
// TODO 总统 推送发票信息 end
let updateStatus = {
id: apply.id,
preStatus: "1010",
status: "1050",
};
let rs = await this.invoiceapplyStatus(updateStatus);
return rs;
}
/**
* fn:发票推送
* @param {*} params
......
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