Commit f5317565 by 王昆

gsb

parent 802212bf
...@@ -596,7 +596,7 @@ class OrderCtl extends CtlBase { ...@@ -596,7 +596,7 @@ class OrderCtl extends CtlBase {
try { try {
let rs = await this.orderSve.handleStatus(pobj); let rs = await this.orderSve.handleStatus(pobj);
if (rs && rs.status === 0) { if (rs && rs.status === 0) {
this.createAccount(pobj); // this.createAccount(pobj);
} }
} catch (error) { } catch (error) {
console.log(error); console.log(error);
...@@ -604,60 +604,60 @@ class OrderCtl extends CtlBase { ...@@ -604,60 +604,60 @@ class OrderCtl extends CtlBase {
} }
} }
/** // /**
* @params 建仗 // * @params 建仗
*/ // */
async createAccount(params) { // async createAccount(params) {
try { // try {
// 查个体户 // // 查个体户
let businessmen = await this.callms("order", "queryObusinessmen", params); // let businessmen = await this.callms("order", "queryObusinessmen", params);
businessmen = businessmen.data; // businessmen = businessmen.data;
// 查个体户的交付商 // // 查个体户的交付商
var deliver = await this.callms("common", "deliverInfo", {id: params.deliver_id}); // var deliver = await this.callms("common", "deliverInfo", {id: params.deliver_id});
deliver = deliver.data; // deliver = deliver.data;
//
let user = await this.callms("common", "deliverUserInfo", {id: deliver.admin_id}) || {}; // let user = await this.callms("common", "deliverUserInfo", {id: deliver.admin_id}) || {};
user = (user.data || {}).user || {}; // user = (user.data || {}).user || {};
let data = { // let data = {
customerName: businessmen.name, // customerName: businessmen.name,
initPeriod: Number(moment().format("YYYYMM")), // initPeriod: Number(moment().format("YYYYMM")),
// initPeriod: moment().format("YYYYMM"), // // initPeriod: moment().format("YYYYMM"),
accountStandard: 1, // accountStandard: 1,
valueAddedTax: 2, // valueAddedTax: 2,
bankStatus: businessmen.is_bank ? 1 : 0, // bankStatus: businessmen.is_bank ? 1 : 0,
accountant: user.nt_user_id, // accountant: user.nt_user_id,
province: params.province, // province: params.province,
companyId: deliver.nt_company_id, // companyId: deliver.nt_company_id,
} // }
let url = settings.ntapi().createCustomer; // let url = settings.ntapi().createCustomer;
let res = await this.callApi(url, data, "建账"); // let res = await this.callApi(url, data, "建账");
console.log(res); // console.log(res);
if (!res || !res.data) { // if (!res || !res.data) {
return system.getResult(null, "建账失败"); // return system.getResult(null, "建账失败");
} // }
if (res.data) { // if (res.data) {
await this.callms("order", "createAccount", { // await this.callms("order", "createAccount", {
id: params.id, // id: params.id,
province: params.province, // province: params.province,
customer_id: res.data, // customer_id: res.data,
}); // });
//
// 异步推送建账信息 TODO 孙总统测 // // 异步推送建账信息 TODO 孙总统测
this.pushBusinessmenInfo({ // this.pushBusinessmenInfo({
order_id: businessmen.order_id, // order_id: businessmen.order_id,
company_id: deliver.nt_company_id, // company_id: deliver.nt_company_id,
customer_id: res.data, // customer_id: res.data,
name: businessmen.name, // name: businessmen.name,
credit_code: businessmen.credit_code, // credit_code: businessmen.credit_code,
businessmen:businessmen // businessmen:businessmen
}); // });
} // }
return system.getResultSuccess(); // return system.getResultSuccess();
} catch (error) { // } catch (error) {
console.log(error); // console.log(error);
return system.getResult(error); // return system.getResult(error);
} // }
} // }
/** /**
* ali客户交付 * ali客户交付
......
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