Commit a57d946f by 孙亚楠

d

parent 33e1c5fc
...@@ -12,6 +12,7 @@ module.exports = (db, DataTypes) => { ...@@ -12,6 +12,7 @@ module.exports = (db, DataTypes) => {
service_ids: { type: DataTypes.STRING, allowNull: true, defaultValue: "0", COMMENT: '服务IDs' }, service_ids: { type: DataTypes.STRING, allowNull: true, defaultValue: "0", COMMENT: '服务IDs' },
business_type: { type: DataTypes.STRING, allowNull: true, defaultValue: "", COMMENT: '经营范围' }, business_type: { type: DataTypes.STRING, allowNull: true, defaultValue: "", COMMENT: '经营范围' },
businessscope: { type: DataTypes.STRING, allowNull: true, defaultValue: "", COMMENT: '经营范围详情' }, businessscope: { type: DataTypes.STRING, allowNull: true, defaultValue: "", COMMENT: '经营范围详情' },
business_type_id: { type: DataTypes.STRING, allowNull: true, defaultValue: "", COMMENT: '经营范围ID' },
remarks: { type: DataTypes.STRING, allowNull: true, defaultValue: "", COMMENT: '备注' }, remarks: { type: DataTypes.STRING, allowNull: true, defaultValue: "", COMMENT: '备注' },
}, { }, {
paranoid: true, //假的删除 paranoid: true, //假的删除
......
...@@ -44,6 +44,8 @@ class CclueService extends ServiceBase { ...@@ -44,6 +44,8 @@ class CclueService extends ServiceBase {
id:cclueBean.id, id:cclueBean.id,
clue_type_name:clue_properties.clue_type_name, clue_type_name:clue_properties.clue_type_name,
deliver_id:clue_properties.deliver_id, deliver_id:clue_properties.deliver_id,
legal_name : clue_properties.contacts,
legal_mobile:clue_properties.contact_mobile,
}; };
await this.cschemeDao.create(scheme_properties,t); await this.cschemeDao.create(scheme_properties,t);
}); });
...@@ -173,7 +175,7 @@ class CclueService extends ServiceBase { ...@@ -173,7 +175,7 @@ class CclueService extends ServiceBase {
if(clueIds && clueIds.length>0){ if(clueIds && clueIds.length>0){
cschemeArrayList = await this.cfollowlogDao.listFollowlogsByClueIds({clueIds:clueIds}); cschemeArrayList = await this.cfollowlogDao.listFollowlogsByClueIds({clueIds:clueIds});
for (let item of cschemeArrayList) { for (let item of cschemeArrayList) {
this.handleDate(item, ["created_at"], null, null); this.handleDate(item, ["created_at","follow_date"], null, null);
if(!cschemeMap[item.clue_id]){ if(!cschemeMap[item.clue_id]){
cschemeMap[item.clue_id]=[]; cschemeMap[item.clue_id]=[];
} }
...@@ -261,21 +263,19 @@ class CclueService extends ServiceBase { ...@@ -261,21 +263,19 @@ class CclueService extends ServiceBase {
if(!cclueBean){ if(!cclueBean){
return system.getResult(null, `线索不存在`); return system.getResult(null, `线索不存在`);
} }
this.handleDate(cclueBean, ["created_at"], null, null);
//查询方案 //查询方案
let cschemeBean = await this.cschemeDao.getById(cclueBean.id) || {}; let cschemeBean = await this.cschemeDao.getById(cclueBean.id) || {};
this.handleDate(cschemeBean, ["created_at"], null, null); this.handleDate(cschemeBean, ["created_at"], null, null);
cclueBean.cschemeBean = cschemeBean; cclueBean.cscheme = cschemeBean;
cclueBean.cschemeIsShow=cschemeBean.name?true:false; cclueBean.cschemeIsShow=cschemeBean.name?true:false;
//查询跟踪记录 //查询跟踪记录
let cfollowlog = await this.cfollowlogDao.followlogsByClueIds({clue_id:cschemeBean.id}); let cfollowlog = await this.cfollowlogDao.listFollowlogsByClueIds({clue_id:cschemeBean.id});
for(let item in cfollowlog){ for(let item of cfollowlog){
for (let key in cschemeMap) { this.handleDate(item, ["created_at","follow_date"], null, null);
this.handleDate(cschemeMap[key], ["created_at"], null, null);
}
} }
cclueBean.cfollowlog=cfollowlog[cclueBean.id]||[]; cclueBean.cfollowlog=cfollowlog||[];
cclueBean.cfollowlogIsShow =cclueBean.cfollowlog.length>0?true:false; cclueBean.cfollowlogIsShow =cclueBean.cfollowlog.length>0?true:false;
return system.getResult(cclueBean); return system.getResult(cclueBean);
}catch (e) { }catch (e) {
......
...@@ -74,6 +74,7 @@ class CschemeService extends ServiceBase { ...@@ -74,6 +74,7 @@ class CschemeService extends ServiceBase {
service_ids: this.trim(params.service_ids) , service_ids: this.trim(params.service_ids) ,
business_type: this.trim(params.business_type), business_type: this.trim(params.business_type),
businessscope: this.trim(params.businessscope), businessscope: this.trim(params.businessscope),
business_type_id:this.trim(params.business_type_id) || "",
remarks: this.trim(params.remarks) || "" remarks: this.trim(params.remarks) || ""
}; };
await this.db.transaction(async t=>{ await this.db.transaction(async t=>{
......
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