Commit a57d946f by 孙亚楠

d

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