Commit 448c86e5 by 赵庆

gsb

parent fdca4c62
...@@ -26,52 +26,36 @@ class EntcompanyCtl extends CtlBase { ...@@ -26,52 +26,36 @@ class EntcompanyCtl extends CtlBase {
async signSave(queryobj, qobj, req) { async signSave(queryobj, qobj, req) {
try { try {
var rtn = null; var entcompany = await this.buildCompeny(qobj);
var dkcompany = await this.buildCompeny(qobj); if (entcompany.id) {
if (dkcompany.id) {
//修改 //修改
await dkcompany.save(); await entcompany.save();
} else { } else {
//新增 //新增
dkcompany = await this.service.create(dkcompany); entcompany = await this.service.create(entcompany);
} }
var rs; var rs = {code:1};
var eseal = await this.esealSve.findOne({ var eseal = await this.esealSve.findOne({
nameA: dkcompany.sealName nameA: entcompany.sealName
}); });
if (eseal) { if (!eseal) {
dkcompany.sealId = eseal.sealId;
await dkcompany.save();
} else {
// var accountId = "740b19e0799a4d7abacfa1a31fb72b1e"; // 测试 // var accountId = "740b19e0799a4d7abacfa1a31fb72b1e"; // 测试
// var accountId = "f50d8f8cdd8d4bcda6b1aaad1d4b14bf"; // 生产 // var accountId = "f50d8f8cdd8d4bcda6b1aaad1d4b14bf"; // 生产
var accountId = settings.apiconfig.companyAccountId(); // 生产 var accountId = settings.apiconfig.companyAccountId(); // 生产
var aliasName = dkcompany.sealName + "-alias"; var aliasName = entcompany.sealName + "-alias";
rs = await this.utilesignbaoSve.creatEntSignet(accountId, aliasName, dkcompany.sealName, "", "", "dkcompanyCtl"); rs = await this.utilesignbaoSve.creatEntSignet(accountId, aliasName, entcompany.sealName, "", "", "entcompanyCtl");
if (rs && rs.code == 1) { if (rs && rs.code == 1) {
dkcompany.sealId = rs.data.sealId; entcompany.sealId = rs.data.sealId;
await dkcompany.save(); await entcompany.save();
await this.esealSve.create({ await this.esealSve.create({
nameA: dkcompany.sealName, nameA: entcompany.sealName,
sealId: dkcompany.sealId, sealId: entcompany.sealId,
}); });
} else { } else {
} }
} }
// if(isCreateSealKey || !dkcompany.sealFileKey) {
// // 创建企业印章fileKey
// // var accountId = "740b19e0799a4d7abacfa1a31fb72b1e"; // 测试
// var accountId = "f50d8f8cdd8d4bcda6b1aaad1d4b14bf"; // 生产
// var aliasName = dkcompany.id + "-" + uuidv4();
// var rs = await this.utilesignbaoSve.createEntSeal(dkcompany.sealUrl, accountId, aliasName, "dkcompanyCtl");
// if(rs.code == 1) {
// dkcompany.sealFileKey = rs.data.fileKey;
// dkcompany.sealId = rs.data.sealId;
// await dkcompany.save();
// }
// }
return system.getResult2(rs, null); return system.getResult2(rs, null);
} catch (e) { } catch (e) {
console.log("-----------------------------e"); console.log("-----------------------------e");
...@@ -81,21 +65,25 @@ class EntcompanyCtl extends CtlBase { ...@@ -81,21 +65,25 @@ class EntcompanyCtl extends CtlBase {
} }
async buildCompeny(qobj) { async buildCompeny(qobj) {
var dkcompany = null; var entcompany = null;
if (qobj.id) { if (qobj.id) {
dkcompany = await this.service.findById(qobj.id); entcompany = await this.service.findById(qobj.id);
// dkcompany.isCreateSealKey = dkcompany.sealUrl != qobj.sealUrl; // entcompany.isCreateSealKey = dkcompany.sealUrl != qobj.sealUrl;
} else { } else {
dkcompany = {}; entcompany = {};
} }
dkcompany.name = qobj.name; entcompany.name = qobj.name;
dkcompany.legal = qobj.legal || ""; entcompany.legal = qobj.legal || "";
dkcompany.contactMobile = qobj.contactMobile || ""; entcompany.contactName = qobj.contactName || "";
dkcompany.addr = qobj.addr || ""; entcompany.contactMobile = qobj.contactMobile || "";
dkcompany.owner_id = qobj.owner_id; entcompany.addr = qobj.addr || "";
dkcompany.sealName = qobj.sealName || ""; entcompany.owner_id = qobj.owner_id;
return dkcompany; entcompany.sealName = qobj.sealName || "";
entcompany.bankAccount = qobj.bankAccount || "";
entcompany.bankName = qobj.bankName || "";
entcompany.bankNo = qobj.bankNo || "";
return entcompany;
} }
async mySignList(queryobj, qobj, req) { async mySignList(queryobj, qobj, req) {
......
...@@ -107,35 +107,36 @@ class EntcontractCtl extends CtlBase { ...@@ -107,35 +107,36 @@ class EntcontractCtl extends CtlBase {
async myList(queryobj, obj, req) { async myList(queryobj, obj, req) {
var params = obj.search || {}; var params = obj.search || {};
if (!req.session.user.isAdmin) {
var ownerIds = null;
if (!req.session.myIds || req.session.myIds.length == 0) {
ownerIds = [req.session.user.id];
} else {
ownerIds = req.session.myIds;
}
var ownerIds = null; var ecompanyIds = await this.ecompanySve.findIdsByOwnerIds(ownerIds);
if (!req.session.myIds || req.session.myIds.length == 0) { if (!ecompanyIds || ecompanyIds.length == 0) {
ownerIds = [req.session.user.id];
} else {
ownerIds = req.session.myIds;
}
var ecompanyIds = await this.ecompanySve.findIdsByOwnerIds(ownerIds);
if (!ecompanyIds || ecompanyIds.length == 0) {
return system.getResult2({count: 0, rows: []});
}
var ecompanyId = params.ecompany_id;
if (ecompanyId) {
delete params.ecompany_id;
}
if (ecompanyId) {
if (ecompanyIds.indexOf(ecompanyId) == -1) {
return system.getResult2({count: 0, rows: []}); return system.getResult2({count: 0, rows: []});
}
var ecompanyId = params.ecompany_id;
if (ecompanyId) {
delete params.ecompany_id;
}
if (ecompanyId) {
if (ecompanyIds.indexOf(ecompanyId) == -1) {
return system.getResult2({count: 0, rows: []});
} else {
params.ecompanyIds = [ecompanyId];
}
} else { } else {
params.ecompanyIds = [ecompanyId]; params.ecompanyIds = ecompanyIds;
} }
} else {
params.ecompanyIds = ecompanyIds;
}
params.eflowstatusList = ['2']; params.eflowstatusList = ['2'];
this.doTimeCondition(params, ["signBegin", "signEnd"]); this.doTimeCondition(params, ["signBegin", "signEnd"]);
}
try { try {
var page = await this.service.listByCondition(params); var page = await this.service.listByCondition(params);
return system.getResult2(page); return system.getResult2(page);
......
...@@ -10,14 +10,13 @@ class EnttemplateCtl extends CtlBase { ...@@ -10,14 +10,13 @@ class EnttemplateCtl extends CtlBase {
super(CtlBase.getServiceName(EnttemplateCtl)); super(CtlBase.getServiceName(EnttemplateCtl));
this.utilesignbaoSve = system.getObject("service.utilesignbaoSve"); this.utilesignbaoSve = system.getObject("service.utilesignbaoSve");
this.econtractSve = system.getObject("service.econtractSve"); this.entcontractSve = system.getObject("service.entcontractSve");
this.ecompanySve = system.getObject("service.ecompanySve"); this.entcompanySve = system.getObject("service.entcompanySve");
this.ecompanymainSve = system.getObject("service.ecompanymainSve"); this.DKaggreementService = system.getObject("service.dkaggreementSve");
this.wxSve = system.getObject("service.wxSve");
this.excelClient = system.getObject("util.excelClient"); this.excelClient = system.getObject("util.excelClient");
} }
async findReadyContracts(q, obj, req) { async findReadyContracts(q, obj, req) {
obj = obj || {}; obj = obj || {};
obj.userId = req.session.user.id; obj.userId = req.session.user.id;
...@@ -27,7 +26,7 @@ class EnttemplateCtl extends CtlBase { ...@@ -27,7 +26,7 @@ class EnttemplateCtl extends CtlBase {
return system.getResult2([]); return system.getResult2([]);
} }
let sinedCompanyIds = await this.econtractSve.findUserSinedCompanyIds(Number(obj.eaccount_id)); let sinedCompanyIds = await this.entcontractSve.findUserSinedCompanyIds(Number(obj.eaccount_id));
if (sinedCompanyIds.indexOf(Number(obj.ecompany_id)) != -1) { if (sinedCompanyIds.indexOf(Number(obj.ecompany_id)) != -1) {
return system.getResult2([]); return system.getResult2([]);
} }
...@@ -47,9 +46,9 @@ class EnttemplateCtl extends CtlBase { ...@@ -47,9 +46,9 @@ class EnttemplateCtl extends CtlBase {
} }
} }
async getListByName(queryobj, qobj, req){ async getListByName(queryobj, qobj, req) {
var name = this.trim(qobj.name); var name = this.trim(qobj.name);
if(!name) { if (!name) {
return system.getResult2([]) return system.getResult2([])
} }
...@@ -94,7 +93,8 @@ class EnttemplateCtl extends CtlBase { ...@@ -94,7 +93,8 @@ class EnttemplateCtl extends CtlBase {
async mySignList(queryobj, qobj, req) { async mySignList(queryobj, qobj, req) {
var params = qobj.search; var params = qobj.search;
try {
if (!req.session.user.isAdmin) {
var ownerIds = null; var ownerIds = null;
if (!req.session.myIds || req.session.myIds.length == 0) { if (!req.session.myIds || req.session.myIds.length == 0) {
ownerIds = [req.session.user.id]; ownerIds = [req.session.user.id];
...@@ -102,7 +102,7 @@ class EnttemplateCtl extends CtlBase { ...@@ -102,7 +102,7 @@ class EnttemplateCtl extends CtlBase {
ownerIds = req.session.myIds; ownerIds = req.session.myIds;
} }
var ecompanyIds = await this.ecompanySve.findIdsByOwnerIds(ownerIds); var ecompanyIds = await this.entcompanySve.findIdsByOwnerIds(ownerIds);
if (!ecompanyIds || ecompanyIds.length == 0) { if (!ecompanyIds || ecompanyIds.length == 0) {
return system.getResult2({ return system.getResult2({
count: 0, count: 0,
...@@ -126,7 +126,8 @@ class EnttemplateCtl extends CtlBase { ...@@ -126,7 +126,8 @@ class EnttemplateCtl extends CtlBase {
} else { } else {
params.ecompanyIds = ecompanyIds; params.ecompanyIds = ecompanyIds;
} }
}
try {
var page = await this.service.signPage(params); var page = await this.service.signPage(params);
return system.getResult2(page); return system.getResult2(page);
} catch (e) { } catch (e) {
...@@ -147,7 +148,7 @@ class EnttemplateCtl extends CtlBase { ...@@ -147,7 +148,7 @@ class EnttemplateCtl extends CtlBase {
ownerIds = req.session.myIds; ownerIds = req.session.myIds;
} }
var ecompanyIds = await this.ecompanySve.findIdsByOwnerIds(ownerIds); var ecompanyIds = await this.entcompanySve.findIdsByOwnerIds(ownerIds);
if (!ecompanyIds || ecompanyIds.length == 0) { if (!ecompanyIds || ecompanyIds.length == 0) {
return system.getErrResult2("无数据"); return system.getErrResult2("无数据");
} }
...@@ -187,7 +188,6 @@ class EnttemplateCtl extends CtlBase { ...@@ -187,7 +188,6 @@ class EnttemplateCtl extends CtlBase {
} }
async info(queryobj, qobj, req) { async info(queryobj, qobj, req) {
console.log("dddddddddss");
var id = Number(qobj.id); var id = Number(qobj.id);
try { try {
var info = await this.service.getInfo(id); var info = await this.service.getInfo(id);
...@@ -195,10 +195,10 @@ class EnttemplateCtl extends CtlBase { ...@@ -195,10 +195,10 @@ class EnttemplateCtl extends CtlBase {
if (info.created_at) { if (info.created_at) {
info.created_at = moment(info.created_at).format("YYYY-MM-DD HH:mm:ss"); info.created_at = moment(info.created_at).format("YYYY-MM-DD HH:mm:ss");
} }
var ecompany = await this.ecompanySve.getCompany(info.entcompany_id) || {}; var entcompany = await this.entcompanySve.getCompany(info.entcompany_id) || {};
info.ecompany = ecompany || {}; info.entcompany = entcompany || {};
if (ecompany) { if (entcompany) {
info.ecompanyName = ecompany.name; info.entcompanyName = entcompany.name;
} }
} }
return system.getResult2(info); return system.getResult2(info);
...@@ -215,53 +215,30 @@ class EnttemplateCtl extends CtlBase { ...@@ -215,53 +215,30 @@ class EnttemplateCtl extends CtlBase {
if (id) { if (id) {
template = await this.service.findById(id); template = await this.service.findById(id);
} }
console.log(qobj) var ecompany = await this.entcompanySve.findById(qobj.entcompany_id);
// var ecompany = await this.ecompanySve.findById(qobj.entcompany_id);
if (template) { //修改 if (template) { //修改
template.name = qobj.name; template.name = qobj.name;
template.entcompany_id = qobj.entcompany_id; template.entcompany_id = qobj.entcompany_id;
template.codeurl = qobj.codeurl;
template.remark = qobj.remark || ""; template.remark = qobj.remark || "";
template.aggreement_id = qobj.aggreement_id; template.aggreement_id = qobj.aggreement_id;
template.placeholderkey = qobj.placeholderkey || "";
await template.save(); await template.save();
} else { //新增 } else { //新增
template = {}; template = {};
template.name = qobj.name || ecompany.name; template.name = qobj.name || ecompany.name;
template.entcompany_id = qobj.entcompany_id; template.entcompany_id = qobj.entcompany_id;
template.aggreement_id = qobj.aggreement_id; template.aggreement_id = qobj.aggreement_id;
template.codeurl = qobj.codeurl;
template.remark = qobj.remark || ""; template.remark = qobj.remark || "";
template.placeholderkey = qobj.placeholderkey || "";
template = await this.service.create(template); template = await this.service.create(template);
} }
// 调用e签宝接口生成template if (qobj.aggreement_id) {
if (template.filepath && ecompany.name) { var agg = await this.DKaggreementService.findOne({id: qobj.aggreement_id});
try { template.codeurl = agg.dataValues.filepath;
let templateRs = await this.utilesignbaoSve.createEntTemplate(template.filepath, ecompany.name, "etemplateCtl"); template.templateid = agg.dataValues.templateid;
template.save();
logCtl.info({
optitle: "e签宝===>保存模板信息template",
op: "app/base/controller/impl/etemplateCtl/mysave",
content: "参数:filepath=" + template.filepath + ";name=" + template.name + "; result : " + JSON.stringify(templateRs),
clientIp: ""
});
if (templateRs && templateRs.code == 1 && templateRs.data) {
template.filekey = templateRs.data.fileKey;
template.templateid = templateRs.data.templateId;
await template.save();
} else {
console.log("======================12222222222222222222222222222222222222222222222222222222222222222222222222====================");
}
} catch (e) {
console.error(e);
}
} }
template.qrcodeurl = await this.wxSve.makeQrWithScene("wxf616c0a459d66081", template.id);
template.save();
return system.getResult2(template, null); return system.getResult2(template, null);
} catch (e) { } catch (e) {
console.log("-----------------------------e"); console.log("-----------------------------e");
...@@ -272,4 +249,5 @@ class EnttemplateCtl extends CtlBase { ...@@ -272,4 +249,5 @@ class EnttemplateCtl extends CtlBase {
} }
} }
} }
module.exports = EnttemplateCtl; module.exports = EnttemplateCtl;
\ No newline at end of file
...@@ -13,7 +13,7 @@ class EntcompanyDao extends Dao { ...@@ -13,7 +13,7 @@ class EntcompanyDao extends Dao {
} }
attrs = attrs || "*"; attrs = attrs || "*";
var sql = "SELECT " + attrs + " FROM c_dkcompany where id IN (:ids) "; var sql = "SELECT " + attrs + " FROM c_entcompany where id IN (:ids) ";
var list = await this.customQuery(sql, {ids: ids}); var list = await this.customQuery(sql, {ids: ids});
if (!list || list.length == 0) { if (!list || list.length == 0) {
return result; return result;
...@@ -32,7 +32,7 @@ class EntcompanyDao extends Dao { ...@@ -32,7 +32,7 @@ class EntcompanyDao extends Dao {
return result; return result;
} }
var sql = "SELECT id FROM c_dkcompany WHERE name LIKE :name "; var sql = "SELECT id FROM c_entcompany WHERE name LIKE :name ";
var list = await this.customQuery(sql, {name: "%" + name + "%"}); var list = await this.customQuery(sql, {name: "%" + name + "%"});
if (list) { if (list) {
...@@ -48,7 +48,7 @@ class EntcompanyDao extends Dao { ...@@ -48,7 +48,7 @@ class EntcompanyDao extends Dao {
if (!ownerIds || ownerIds.length == 0) { if (!ownerIds || ownerIds.length == 0) {
return result; return result;
} }
var sql = "SELECT name FROM c_dkcompany WHERE owner_id IN (:ownerIds) "; var sql = "SELECT name FROM c_entcompany WHERE owner_id IN (:ownerIds) ";
var list = await this.customQuery(sql, {ownerIds: ownerIds}); var list = await this.customQuery(sql, {ownerIds: ownerIds});
if (!list || list.length == 0) { if (!list || list.length == 0) {
return result; return result;
...@@ -65,7 +65,7 @@ class EntcompanyDao extends Dao { ...@@ -65,7 +65,7 @@ class EntcompanyDao extends Dao {
if (!ownerIds || ownerIds.length == 0) { if (!ownerIds || ownerIds.length == 0) {
return result; return result;
} }
var sql = "SELECT id FROM c_dkcompany WHERE owner_id IN (:ownerIds) "; var sql = "SELECT id FROM c_entcompany WHERE owner_id IN (:ownerIds) ";
var list = await this.customQuery(sql, {ownerIds: ownerIds}); var list = await this.customQuery(sql, {ownerIds: ownerIds});
if (!list || list.length == 0) { if (!list || list.length == 0) {
return result; return result;
...@@ -85,7 +85,7 @@ class EntcompanyDao extends Dao { ...@@ -85,7 +85,7 @@ class EntcompanyDao extends Dao {
} }
attrs = attrs || "*"; attrs = attrs || "*";
var sql = "SELECT " + attrs + " FROM c_dkcompany where name IN (:names) WHERE deleted_at IS NULL "; var sql = "SELECT " + attrs + " FROM c_entcompany where name IN (:names) WHERE deleted_at IS NULL ";
var list = await this.customQuery(sql, {names: names}); var list = await this.customQuery(sql, {names: names});
if (!list || list.length == 0) { if (!list || list.length == 0) {
return result; return result;
...@@ -101,7 +101,7 @@ class EntcompanyDao extends Dao { ...@@ -101,7 +101,7 @@ class EntcompanyDao extends Dao {
if (!name) { if (!name) {
return []; return [];
} }
var sql = "SELECT id, name FROM `c_dkcompany` WHERE name LIKE :queryLike AND deleted_at IS NULL "; var sql = "SELECT id, name FROM `c_entcompany` WHERE name LIKE :queryLike AND deleted_at IS NULL ";
if (ownerIds && ownerIds.length > 0) { if (ownerIds && ownerIds.length > 0) {
sql = sql + " AND owner_id IN (:ownerIds) "; sql = sql + " AND owner_id IN (:ownerIds) ";
......
...@@ -11,7 +11,7 @@ class EnttemplateDao extends Dao{ ...@@ -11,7 +11,7 @@ class EnttemplateDao extends Dao{
return result; return result;
} }
var sql = "SELECT id FROM `c_dktemplate` WHERE NAME LIKE :nameLike"; var sql = "SELECT id FROM `c_enttemplate` WHERE NAME LIKE :nameLike";
var list = await this.customQuery(sql, {nameLike: "%" + name + "%"}); var list = await this.customQuery(sql, {nameLike: "%" + name + "%"});
if(!list || list.length == 0) { if(!list || list.length == 0) {
return result; return result;
...@@ -30,7 +30,7 @@ class EnttemplateDao extends Dao{ ...@@ -30,7 +30,7 @@ class EnttemplateDao extends Dao{
} }
attrs = attrs || "*"; attrs = attrs || "*";
var sql = "SELECT " + attrs + " FROM c_dktemplate where id IN (:ids) "; var sql = "SELECT " + attrs + " FROM c_enttemplate where id IN (:ids) ";
var list = await this.customQuery(sql, {ids:ids}); var list = await this.customQuery(sql, {ids:ids});
if(!list || list.length == 0) { if(!list || list.length == 0) {
return result; return result;
......
...@@ -11,6 +11,9 @@ module.exports = (db, DataTypes) => { ...@@ -11,6 +11,9 @@ module.exports = (db, DataTypes) => {
contactMobile: DataTypes.STRING, contactMobile: DataTypes.STRING,
addr: DataTypes.STRING, addr: DataTypes.STRING,
owner_id: DataTypes.STRING, owner_id: DataTypes.STRING,
bankAccount : DataTypes.STRING,
bankName : DataTypes.STRING,
bankNo : DataTypes.STRING
}, { }, {
paranoid: true, //假的删除 paranoid: true, //假的删除
......
...@@ -5,7 +5,7 @@ module.exports = (db, DataTypes) => { ...@@ -5,7 +5,7 @@ module.exports = (db, DataTypes) => {
name: DataTypes.STRING, name: DataTypes.STRING,
codeurl:DataTypes.STRING, codeurl:DataTypes.STRING,
remark:DataTypes.STRING, remark:DataTypes.STRING,
placeholderkey:DataTypes.STRING, templateid:DataTypes.STRING,
},{ },{
paranoid: true,//假的删除 paranoid: true,//假的删除
underscored: true, underscored: true,
......
...@@ -5,7 +5,7 @@ const moment = require("moment"); ...@@ -5,7 +5,7 @@ const moment = require("moment");
class EntcompanyService extends ServiceBase { class EntcompanyService extends ServiceBase {
constructor(){ constructor(){
super(ServiceBase.getDaoName(EntcompanyService)); super(ServiceBase.getDaoName(EntcompanyService));
this.dktemplateDao = system.getObject("db.dktemplateDao"); this.enttemplateDao = system.getObject("db.enttemplateDao");
this.userDao = system.getObject("db.userDao"); this.userDao = system.getObject("db.userDao");
} }
...@@ -62,7 +62,13 @@ class EntcompanyService extends ServiceBase { ...@@ -62,7 +62,13 @@ class EntcompanyService extends ServiceBase {
where: { id: id }, attrs, raw: true where: { id: id }, attrs, raw: true
}); });
} }
async getCompany(id) {
var attrs = ["id", "name"];
return await this.dao.model.findOne({
where: { id: id }, attrs, raw: true
});
}
async setOwner(rows) { async setOwner(rows) {
if (!rows || rows.length == 0) { if (!rows || rows.length == 0) {
return; return;
......
...@@ -327,7 +327,7 @@ class EntcontractService extends ServiceBase { ...@@ -327,7 +327,7 @@ class EntcontractService extends ServiceBase {
["id", 'desc'] ["id", 'desc']
]; ];
var attributes = [`id`, `fileurl`, `eflowstatus`, `eflowstatusname`, `completed_at`, `end_at`, `user_id`, `usereaccount_id`, `entcompany_id`, `enttemplate_id`]; var attributes = [`id`, `name`,`fileurl`, `eflowstatus`, `eflowstatusname`, `completed_at`, `end_at`, `user_id`, `usereaccount_id`, `entcompany_id`, `enttemplate_id`];
var page = await this.getPageList(currentPage, pageSize, where, orderby, attributes); var page = await this.getPageList(currentPage, pageSize, where, orderby, attributes);
if (page && page.rows) { if (page && page.rows) {
...@@ -336,7 +336,7 @@ class EntcontractService extends ServiceBase { ...@@ -336,7 +336,7 @@ class EntcontractService extends ServiceBase {
} }
await this.setEaccount(page.rows); await this.setEaccount(page.rows);
await this.setCompany(page.rows); await this.setCompany(page.rows);
await this.setEtemplate(page.rows); // await this.setEtemplate(page.rows);
} }
return page; return page;
} }
......
...@@ -3,10 +3,9 @@ const ServiceBase=require("../sve.base"); ...@@ -3,10 +3,9 @@ const ServiceBase=require("../sve.base");
class EnttemplateService extends ServiceBase{ class EnttemplateService extends ServiceBase{
constructor(){ constructor(){
super(ServiceBase.getDaoName(EnttemplateService)); super(ServiceBase.getDaoName(EnttemplateService));
//this.appDao=system.getObject("db.appDao");
this.ecompanyDao = system.getObject("db.ecompanyDao"); this.ecompanyDao = system.getObject("db.entcompanyDao");
this.ecompanymainDao = system.getObject("db.ecompanymainDao"); this.dkaggreementDao = system.getObject("db.dkaggreementDao");
} }
async signPage(params) { async signPage(params) {
...@@ -19,13 +18,11 @@ class EnttemplateService extends ServiceBase{ ...@@ -19,13 +18,11 @@ class EnttemplateService extends ServiceBase{
[this.db.Op.like]: "%" + params.name + "%" [this.db.Op.like]: "%" + params.name + "%"
}; };
} }
if (params.ecompanyIds) {
if(params.ecompanyIds) {
where.entcompany_id = { where.entcompany_id = {
[this.db.Op.in]: params.ecompanyIds [this.db.Op.in]: params.ecompanyIds
}; };
} }
if (params.entcompany_id) { if (params.entcompany_id) {
where.entcompany_id = params.entcompany_id; where.entcompany_id = params.entcompany_id;
} }
...@@ -40,6 +37,7 @@ class EnttemplateService extends ServiceBase{ ...@@ -40,6 +37,7 @@ class EnttemplateService extends ServiceBase{
this.handleDate(row, ["created_at" , "updated_at"]); this.handleDate(row, ["created_at" , "updated_at"]);
} }
await this.setCompany(page.rows); await this.setCompany(page.rows);
await this.setAggreement(page.rows);
} }
return page; return page;
} }
...@@ -59,26 +57,23 @@ class EnttemplateService extends ServiceBase{ ...@@ -59,26 +57,23 @@ class EnttemplateService extends ServiceBase{
} }
var companyMap = await this.ecompanyDao.findMapByIds(companyIds, " id, name "); var companyMap = await this.ecompanyDao.findMapByIds(companyIds, " id, name ");
for (var item of list) { for (var item of list) {
item.ecompany = companyMap["id_" + (item.entcompany_id || 0)]; item.entcompany = companyMap["id_" + (item.entcompany_id || 0)];
} }
} }
async setAggreement(list) {
if (!list || list.length == 0) {
return;
}
var aggreementIds = [];
for (var item of list) {
aggreementIds.push(item.aggreement_id || 0);
}
// async setMain(list) { var aggreementMap = await this.dkaggreementDao.findMapByIds(aggreementIds);
// if (!list || list.length == 0) { for (var item of list) {
// return; item.entaggreement = aggreementMap["id_" + (item.aggreement_id || 0)];
// } }
// }
// var ids = [];
// for (var item of list) {
// if(item.ecompanyMainId) {
// ids.push(item.ecompanyMainId);
// }
// }
// var mainMap = await this.ecompanymainDao.findMapByIds(ids);
// for (var item of list) {
// item.ecompanyMain = mainMap[item.ecompanyMainId] || {};
// }
// }
async getInfo(id) { async getInfo(id) {
var attrs = ["id", "name", "ecompanyMainId", "mainId", "nameA", "templateid", "filekey", "filepath", "qrcodeurl", var attrs = ["id", "name", "ecompanyMainId", "mainId", "nameA", "templateid", "filekey", "filepath", "qrcodeurl",
......
...@@ -52,6 +52,8 @@ ...@@ -52,6 +52,8 @@
show-overflow-tooltip></el-table-column> show-overflow-tooltip></el-table-column>
<el-table-column prop="legal" label="法人" :formatter="onColFormater" <el-table-column prop="legal" label="法人" :formatter="onColFormater"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="contactName" label="联系人" :formatter="onColFormater"
align="center"></el-table-column>
<el-table-column prop="contactMobile" label="电话" :formatter="onColFormater" <el-table-column prop="contactMobile" label="电话" :formatter="onColFormater"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="owner.nickName" label="所属人" :formatter="onColFormater" <el-table-column prop="owner.nickName" label="所属人" :formatter="onColFormater"
...@@ -113,6 +115,10 @@ ...@@ -113,6 +115,10 @@
<el-input v-model="entcompany.legal" placeholder="请输入法人姓名" maxlength="30" style="width:468px;" <el-input v-model="entcompany.legal" placeholder="请输入法人姓名" maxlength="30" style="width:468px;"
clearable></el-input> clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="联系人:" prop="legal">
<el-input v-model="entcompany.contactName" placeholder="请输入法人姓名" maxlength="30" style="width:468px;"
clearable></el-input>
</el-form-item>
<el-form-item label="联系电话:" prop="contactMobile"> <el-form-item label="联系电话:" prop="contactMobile">
<el-input v-model="entcompany.contactMobile" placeholder="请输入联系电话" maxlength="200" style="width:468px;" <el-input v-model="entcompany.contactMobile" placeholder="请输入联系电话" maxlength="200" style="width:468px;"
clearable></el-input> clearable></el-input>
...@@ -125,6 +131,18 @@ ...@@ -125,6 +131,18 @@
<el-input v-model="entcompany.sealName" placeholder="请输入公章名称" maxlength="100" <el-input v-model="entcompany.sealName" placeholder="请输入公章名称" maxlength="100"
style="width:468px;" clearable></el-input> style="width:468px;" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="账户名称:" prop="bankAccount">
<el-input v-model="entcompany.bankAccount" placeholder="请输入账户名称" maxlength="100"
style="width:468px;" clearable></el-input>
</el-form-item>
<el-form-item label="开户行:" prop="bankName">
<el-input v-model="entcompany.bankName" placeholder="请输入开户行地址" maxlength="100"
style="width:468px;" clearable></el-input>
</el-form-item>
<el-form-item label="账号:" prop="bankNo">
<el-input v-model="entcompany.bankNo" placeholder="请输入账号" maxlength="100"
style="width:468px;" clearable></el-input>
</el-form-item>
<el-form-item label="归属人员:" prop="owner_id"> <el-form-item label="归属人员:" prop="owner_id">
<el-select <el-select
......
...@@ -30,6 +30,10 @@ ...@@ -30,6 +30,10 @@
{ required: true, message: '请输入法人姓名', trigger: 'blur' }, { required: true, message: '请输入法人姓名', trigger: 'blur' },
{ validator: validMethod, trigger: 'blur' } { validator: validMethod, trigger: 'blur' }
], ],
contactName : [
{ required: true, message: '请输入联系人姓名', trigger: 'blur' },
{ validator: validMethod, trigger: 'blur' }
],
addr : [ addr : [
{ required: true, message: '请输入联系地址', trigger: 'blur' }, { required: true, message: '请输入联系地址', trigger: 'blur' },
{ validator: validMethod, trigger: 'blur' } { validator: validMethod, trigger: 'blur' }
...@@ -42,11 +46,18 @@ ...@@ -42,11 +46,18 @@
{ required: true, message: '请输入公章名称', trigger: 'blur' }, { required: true, message: '请输入公章名称', trigger: 'blur' },
{ validator: validMethod, trigger: 'blur' } { validator: validMethod, trigger: 'blur' }
], ],
/* bankAccount: [
sealUrl : [ { required: true, message: '请输入账户名称', trigger: 'blur' },
{ required: true, message: '请上传企业公章', trigger: 'blur' }, { validator: validMethod, trigger: 'blur' }
],
bankName: [
{ required: true, message: '请输入开户行地址', trigger: 'blur' },
{ validator: validMethod, trigger: 'blur' } { validator: validMethod, trigger: 'blur' }
],*/ ],
bankNo: [
{ required: true, message: '请输入银行账号', trigger: 'blur' },
{ validator: validMethod, trigger: 'blur' }
],
owner_id: [ owner_id: [
{ required: true, message: '请选择客户归属人员', trigger: 'blur' }, { required: true, message: '请选择客户归属人员', trigger: 'blur' },
{ validator: validMethod, trigger: 'blur' } { validator: validMethod, trigger: 'blur' }
......
...@@ -31,6 +31,10 @@ ...@@ -31,6 +31,10 @@
<div> <div>
<div style="line-height: 36px;padding-bottom: 20px;"> <div style="line-height: 36px;padding-bottom: 20px;">
<span style="float:left;color:#2F2F2F;font-size: 14px;">共{{search.total}}条记录</span> <span style="float:left;color:#2F2F2F;font-size: 14px;">共{{search.total}}条记录</span>
<!-- <el-button @click="openEdit()"-->
<!-- style="float:right;width:100px;height:36px;color: #FFFFFF;font-weight: 400;border-radius: 4px;font-size: 14px;background-color: #59C1A6;padding-top:11px">-->
<!-- 新增企业-->
<!-- </el-button>-->
</div> </div>
<div> <div>
<el-table <el-table
...@@ -48,6 +52,8 @@ ...@@ -48,6 +52,8 @@
show-overflow-tooltip></el-table-column> show-overflow-tooltip></el-table-column>
<el-table-column prop="legal" label="法人" :formatter="onColFormater" <el-table-column prop="legal" label="法人" :formatter="onColFormater"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="contactName" label="联系人" :formatter="onColFormater"
align="center"></el-table-column>
<el-table-column prop="contactMobile" label="电话" :formatter="onColFormater" <el-table-column prop="contactMobile" label="电话" :formatter="onColFormater"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="owner.nickName" label="所属人" :formatter="onColFormater" <el-table-column prop="owner.nickName" label="所属人" :formatter="onColFormater"
...@@ -56,6 +62,11 @@ ...@@ -56,6 +62,11 @@
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="sealId" label="公章id" :formatter="onColFormater" align="center" <el-table-column prop="sealId" label="公章id" :formatter="onColFormater" align="center"
show-overflow-tooltip></el-table-column> show-overflow-tooltip></el-table-column>
<!-- <el-table-column label="公章图片" >
<template slot-scope="scope" align="center">
<a :href="scope.row.sealUrl" target="_blank" style="float:left;text-decoration: none;color:#59C1A6;font-size: 14px;margin-left: 10px;">查看公章</a>
</template>
</el-table-column> -->
<el-table-column prop="addr" label="联系地址" :formatter="onColFormater" align="center" <el-table-column prop="addr" label="联系地址" :formatter="onColFormater" align="center"
show-overflow-tooltip></el-table-column> show-overflow-tooltip></el-table-column>
<el-table-column prop="created_at" label="创建日期" :formatter="onColFormater" <el-table-column prop="created_at" label="创建日期" :formatter="onColFormater"
...@@ -104,9 +115,12 @@ ...@@ -104,9 +115,12 @@
<el-input v-model="entcompany.legal" placeholder="请输入法人姓名" maxlength="30" style="width:468px;" <el-input v-model="entcompany.legal" placeholder="请输入法人姓名" maxlength="30" style="width:468px;"
clearable></el-input> clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="联系人:" prop="legal">
<el-input v-model="entcompany.contactName" placeholder="请输入法人姓名" maxlength="30" style="width:468px;"
clearable></el-input>
</el-form-item>
<el-form-item label="联系电话:" prop="contactMobile"> <el-form-item label="联系电话:" prop="contactMobile">
<el-input v-model="entcompany.contactMobile" placeholder="请输入联系电话" maxlength="200" <el-input v-model="entcompany.contactMobile" placeholder="请输入联系电话" maxlength="200" style="width:468px;"
style="width:468px;"
clearable></el-input> clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="联系地址:" prop="addr"> <el-form-item label="联系地址:" prop="addr">
...@@ -117,6 +131,18 @@ ...@@ -117,6 +131,18 @@
<el-input v-model="entcompany.sealName" placeholder="请输入公章名称" maxlength="100" <el-input v-model="entcompany.sealName" placeholder="请输入公章名称" maxlength="100"
style="width:468px;" clearable></el-input> style="width:468px;" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="账户名称:" prop="bankAccount">
<el-input v-model="entcompany.bankAccount" placeholder="请输入账户名称" maxlength="100"
style="width:468px;" clearable></el-input>
</el-form-item>
<el-form-item label="开户行:" prop="bankName">
<el-input v-model="entcompany.bankName" placeholder="请输入开户行地址" maxlength="100"
style="width:468px;" clearable></el-input>
</el-form-item>
<el-form-item label="账号:" prop="bankNo">
<el-input v-model="entcompany.bankNo" placeholder="请输入账号" maxlength="100"
style="width:468px;" clearable></el-input>
</el-form-item>
<el-form-item label="归属人员:" prop="owner_id"> <el-form-item label="归属人员:" prop="owner_id">
<el-select <el-select
...@@ -140,6 +166,9 @@ ...@@ -140,6 +166,9 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item label="企业公章:" prop="sealUrl" >
<gsb-upload2 ref="upload3" v-model="dkcompany.sealUrl" ></gsb-upload3>
</el-form-item> -->
</el-form> </el-form>
<div style="margin-left: 200px;"> <div style="margin-left: 200px;">
......
...@@ -30,6 +30,10 @@ ...@@ -30,6 +30,10 @@
{ required: true, message: '请输入法人姓名', trigger: 'blur' }, { required: true, message: '请输入法人姓名', trigger: 'blur' },
{ validator: validMethod, trigger: 'blur' } { validator: validMethod, trigger: 'blur' }
], ],
contactName : [
{ required: true, message: '请输入联系人姓名', trigger: 'blur' },
{ validator: validMethod, trigger: 'blur' }
],
addr : [ addr : [
{ required: true, message: '请输入联系地址', trigger: 'blur' }, { required: true, message: '请输入联系地址', trigger: 'blur' },
{ validator: validMethod, trigger: 'blur' } { validator: validMethod, trigger: 'blur' }
...@@ -42,11 +46,18 @@ ...@@ -42,11 +46,18 @@
{ required: true, message: '请输入公章名称', trigger: 'blur' }, { required: true, message: '请输入公章名称', trigger: 'blur' },
{ validator: validMethod, trigger: 'blur' } { validator: validMethod, trigger: 'blur' }
], ],
/* bankAccount: [
sealUrl : [ { required: true, message: '请输入账户名称', trigger: 'blur' },
{ required: true, message: '请上传企业公章', trigger: 'blur' }, { validator: validMethod, trigger: 'blur' }
],
bankName: [
{ required: true, message: '请输入开户行地址', trigger: 'blur' },
{ validator: validMethod, trigger: 'blur' } { validator: validMethod, trigger: 'blur' }
],*/ ],
bankNo: [
{ required: true, message: '请输入银行账号', trigger: 'blur' },
{ validator: validMethod, trigger: 'blur' }
],
owner_id: [ owner_id: [
{ required: true, message: '请选择客户归属人员', trigger: 'blur' }, { required: true, message: '请选择客户归属人员', trigger: 'blur' },
{ validator: validMethod, trigger: 'blur' } { validator: validMethod, trigger: 'blur' }
......
...@@ -90,8 +90,8 @@ ...@@ -90,8 +90,8 @@
row-style="height:50px;" > row-style="height:50px;" >
<el-table-column prop="id" label="id" :formatter="onColFormater" align="center" ></el-table-column> <el-table-column prop="id" label="id" :formatter="onColFormater" align="center" ></el-table-column>
<el-table-column prop="ecompany.name" label="公司名称" :formatter="onColFormater" align="center" show-overflow-tooltip ></el-table-column> <el-table-column prop="name" label="公司名称" :formatter="onColFormater" align="center" show-overflow-tooltip ></el-table-column>
<el-table-column prop="template.nameA" label="签约主体" :formatter="onColFormater" align="center" show-overflow-tooltip ></el-table-column> <!-- <el-table-column prop="template.nameA" label="签约主体" :formatter="onColFormater" align="center" show-overflow-tooltip ></el-table-column>-->
<el-table-column prop="eaccount.userName" label="姓名" :formatter="onColFormater" align="center" ></el-table-column> <el-table-column prop="eaccount.userName" label="姓名" :formatter="onColFormater" align="center" ></el-table-column>
<el-table-column prop="eaccount.mobile" label="手机号" :formatter="onColFormater" align="center" show-overflow-tooltip ></el-table-column> <el-table-column prop="eaccount.mobile" label="手机号" :formatter="onColFormater" align="center" show-overflow-tooltip ></el-table-column>
<el-table-column prop="eaccount.personsSign" label="身份证" :formatter="onColFormater" align="center" ></el-table-column> <el-table-column prop="eaccount.personsSign" label="身份证" :formatter="onColFormater" align="center" ></el-table-column>
......
...@@ -90,8 +90,8 @@ ...@@ -90,8 +90,8 @@
row-style="height:50px;" > row-style="height:50px;" >
<el-table-column prop="id" label="id" :formatter="onColFormater" align="center" ></el-table-column> <el-table-column prop="id" label="id" :formatter="onColFormater" align="center" ></el-table-column>
<el-table-column prop="ecompany.name" label="公司名称" :formatter="onColFormater" align="center" show-overflow-tooltip ></el-table-column> <el-table-column prop="name" label="公司名称" :formatter="onColFormater" align="center" show-overflow-tooltip ></el-table-column>
<el-table-column prop="template.nameA" label="签约主体" :formatter="onColFormater" align="center" show-overflow-tooltip ></el-table-column> <!-- <el-table-column prop="template.nameA" label="签约主体" :formatter="onColFormater" align="center" show-overflow-tooltip ></el-table-column>-->
<el-table-column prop="eaccount.userName" label="姓名" :formatter="onColFormater" align="center" ></el-table-column> <el-table-column prop="eaccount.userName" label="姓名" :formatter="onColFormater" align="center" ></el-table-column>
<el-table-column prop="eaccount.mobile" label="手机号" :formatter="onColFormater" align="center" show-overflow-tooltip ></el-table-column> <el-table-column prop="eaccount.mobile" label="手机号" :formatter="onColFormater" align="center" show-overflow-tooltip ></el-table-column>
<el-table-column prop="eaccount.personsSign" label="身份证" :formatter="onColFormater" align="center" ></el-table-column> <el-table-column prop="eaccount.personsSign" label="身份证" :formatter="onColFormater" align="center" ></el-table-column>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<div style="float:left;"> <div style="float:left;">
<span style="color:2F2F2F;font-size: 14px;" >所属公司: </span> <span style="color:2F2F2F;font-size: 14px;" >所属公司: </span>
<el-select <el-select
v-model="search.ecompanyName" v-model="search.dkcompanyName"
filterable filterable
remote remote
clearable clearable
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
<div> <div>
<div style="line-height: 36px;padding-bottom: 20px;"> <div style="line-height: 36px;padding-bottom: 20px;">
<span style="float:left;color:#2F2F2F;font-size: 14px;">共{{search.total}}条记录</span> <span style="float:left;color:#2F2F2F;font-size: 14px;">共{{search.total}}条记录</span>
<!-- <el-button @click="exportList()" style="float:right;width:110px;height:36px;color: #FFFFFF;font-weight: 400;border-radius: 4px;font-size: 14px;background-color: #59C1A6;padding-top:11px">导出二维码</el-button>-->
<el-button @click="openEdit()" style="float:right;width:100px;height:36px;color: #FFFFFF;font-weight: 400;border-radius: 4px;font-size: 14px;background-color: #59C1A6;padding-top:11px">新增模板</el-button> <el-button @click="openEdit()" style="float:right;width:100px;height:36px;color: #FFFFFF;font-weight: 400;border-radius: 4px;font-size: 14px;background-color: #59C1A6;padding-top:11px">新增模板</el-button>
</div> </div>
<div> <div>
...@@ -57,21 +56,13 @@ ...@@ -57,21 +56,13 @@
row-style="height:50px;" > row-style="height:50px;" >
<el-table-column prop="id" label="序号" :formatter="onColFormater" width="80" align="center" ></el-table-column> <el-table-column prop="id" label="序号" :formatter="onColFormater" width="80" align="center" ></el-table-column>
<el-table-column prop="name" label="模板名称" :formatter="onColFormater" align="center" ></el-table-column> <el-table-column prop="name" label="模板名称" :formatter="onColFormater" align="center" ></el-table-column>
<el-table-column prop="ecompany.name" label="公司名称" :formatter="onColFormater" align="center" ></el-table-column> <el-table-column prop="entcompany.name" label="公司名称" :formatter="onColFormater" align="center" ></el-table-column>
<!-- <el-table-column prop="ecompanyMain.alias" label="签约主体" :formatter="onColFormater" align="center" ></el-table-column>--> <el-table-column prop="entaggreement.name" label="协议名称" :formatter="onColFormater" align="center" show-overflow-tooltip></el-table-column>
<!-- <el-table-column label="二维码" >--> <el-table-column label="签约协议" >
<!-- <template slot-scope="scope" >-->
<!-- <a v-if="scope.row.qrcodeurl" :href="scope.row.qrcodeurl" target="_blank" style="text-decoration: none;color:#59C1A6;font-size: 14px;">二维码</a>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="模板文件" >
<template slot-scope="scope" > <template slot-scope="scope" >
<a v-if="scope.row.codeurl" :href="scope.row.codeurl" target="_blank" style="text-decoration: none;color:#59C1A6;font-size: 14px;">查看</a> <a v-if="scope.row.codeurl" :href="scope.row.codeurl" target="_blank" style="float:left;text-decoration: none;color:#59C1A6;font-size: 14px;margin-left: 10px;">查看</a>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="filekey" label="模板key" :formatter="onColFormater" align="center" show-overflow-tooltip></el-table-column>-->
<el-table-column prop="created_at" label="创建日期" :formatter="onColFormater" align="center" ></el-table-column>
<el-table-column prop="updated_at" label="修改日期" :formatter="onColFormater" align="center" ></el-table-column> <el-table-column prop="updated_at" label="修改日期" :formatter="onColFormater" align="center" ></el-table-column>
<el-table-column label="操作" align="center" > <el-table-column label="操作" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -101,19 +92,19 @@ ...@@ -101,19 +92,19 @@
<span style="margin-left:9px;margin-top:-3px;;width:72px; height:25px; font-size:18px; font-family:PingFangSC-Regular; font-weight:400; color:rgba(51,51,51,1); line-height:25px;">{{editTitle}}模板</span> <span style="margin-left:9px;margin-top:-3px;;width:72px; height:25px; font-size:18px; font-family:PingFangSC-Regular; font-weight:400; color:rgba(51,51,51,1); line-height:25px;">{{editTitle}}模板</span>
<div style="width: 862px; height: 1px;background-color: #E3E3E3;margin: 17px 20px 0px -20px"></div> <div style="width: 862px; height: 1px;background-color: #E3E3E3;margin: 17px 20px 0px -20px"></div>
</div> </div>
<el-form :model="etemplate" :rules="rules" ref="etemplate" label-width="100px" label="right" style="padding:0px 100px;" > <el-form :model="enttemplate" :rules="rules" ref="enttemplate" label-width="100px" label="right" style="padding:0px 100px;" >
<div style="0px 10px; line-height: 15px;padding-bottom:40px;"> <div style="0px 10px; line-height: 15px;padding-bottom:40px;">
<div style="width:2px;height:15px;float: left;background-color: #54C4A7"> <div style="width:2px;height:15px;float: left;background-color: #54C4A7">
</div> </div>
<span style="font-size:15px;color: #333333;float: left;font-weight:bold;margin-left: 7px;">模板信息</span> <span style="font-size:15px;color: #333333;float: left;font-weight:bold;margin-left: 7px;">模板信息</span>
</div> </div>
<el-form-item label="模板名称:" prop="name" > <el-form-item label="模板名称:" prop="name" >
<el-input v-model="etemplate.name" placeholder="请输入模板名称:例如韵达、沐冉" maxlength="50" style="width:468px;" clearable ></el-input> <el-input v-model="enttemplate.name" placeholder="请输入模板名称:例如韵达、沐冉" maxlength="50" style="width:468px;" clearable ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="所属公司:" prop="ecompanyName"> <el-form-item label="所属公司:" prop="entcompanyName">
<el-select <el-select
v-model="etemplate.ecompanyName" v-model="enttemplate.entcompanyName"
filterable filterable
remote remote
clearable clearable
...@@ -133,29 +124,15 @@ ...@@ -133,29 +124,15 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item label="签约主体:" prop="ecompanyMainId" >--> <el-form-item label="选择协议:" prop="aggreement_id" >
<!-- <el-select v-model="etemplate.ecompanyMainId" style="width:468px;" filterable placeholder="请选择">--> <el-select v-model="enttemplate.aggreement_id" >
<!-- <el-option--> <el-option v-for="item in aggreements" :key="item.id" :label="item.name" :value="item.id">
<!-- v-for="item in mainList"--> </el-option>
<!-- :key="item.id"--> </el-select>
<!-- :label="item.alias"-->
<!-- :value="item.id">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- &lt;!&ndash; <el-input v-model="etemplate.nameA" placeholder="请输入签约主体" maxlength="50" style="width:468px;" clearable ></el-input> &ndash;&gt;-->
<!-- </el-form-item>-->
<el-form-item label="签约协议:" prop="codeurl">
<gsb-upload3 ref="upload3" v-model="uploadResult" @uploadsuccess="uploadsuccess" :fileList="fileList" filetype="pdf"></gsb-upload3>
</el-form-item> </el-form-item>
<el-form-item label="备注信息:" prop="remark" > <el-form-item label="备注信息:" prop="remark" >
<el-input type="textarea" v-model="etemplate.remark" placeholder="请输入备注信息" maxlength="50" style="width:468px;" clearable ></el-input> <el-input type="textarea" v-model="enttemplate.remark" placeholder="请输入备注信息" maxlength="50" style="width:468px;" clearable ></el-input>
</el-form-item>
<el-form-item label="模板参数:" prop="placeholderkey" >
<el-input v-model="etemplate.placeholderkey" placeholder="请输入模板参数" maxlength="255" style="width:468px;" showlist="true" :file-list="fileList" clearable ></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="margin-left: 200px;"> <div style="margin-left: 200px;">
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
}; };
return { return {
etemplate: {isEnabled:true}, enttemplate: {},
editTitle: "新增", editTitle: "新增",
showEdit: false, showEdit: false,
saveLoading: false, saveLoading: false,
...@@ -20,8 +20,7 @@ ...@@ -20,8 +20,7 @@
nameMap2:[], nameMap2:[],
uploadResult: null, uploadResult: null,
fileList:[], fileList:[],
aggreements: [],
mainList:[],
search: { search: {
list: [], list: [],
currentPage: 1, currentPage: 1,
...@@ -30,12 +29,16 @@ ...@@ -30,12 +29,16 @@
name:'', name:'',
}, },
rules: { rules: {
ecompanyName : [ name : [
{ required: true, message: '请输入模板名称', trigger: 'blur' },
{ validator: validMethod, trigger: 'blur' }
],
entcompanyName : [
{ required: true, message: '请输入公司名称', trigger: 'blur' }, { required: true, message: '请输入公司名称', trigger: 'blur' },
{ validator: validMethod, trigger: 'blur' } { validator: validMethod, trigger: 'blur' }
], ],
codeurl: [ aggreement_id: [
{ required: true, message: '请上传签约协议', trigger: 'blur' }, { required: true, message: '请选择签约协议', trigger: 'blur' },
], ],
a : [], a : [],
}, },
...@@ -43,7 +46,7 @@ ...@@ -43,7 +46,7 @@
}, },
mounted: function () { mounted: function () {
this.resetSearch(true); this.resetSearch(true);
this.getMainList(); this.getAggreementList();
}, },
created: function () {}, created: function () {},
methods: { methods: {
...@@ -70,13 +73,11 @@ ...@@ -70,13 +73,11 @@
this.search.total = 0; this.search.total = 0;
this.getList(); this.getList();
}, },
getMainList() { getAggreementList() {
var self = this; var self = this;
this.$root.postReq("/web/ecompanymainCtl/all", { this.$root.postReq("/web/dkaggreementCtl/aggreements", {}).then(function (d) {
}).then(function (d) {
if (d.status == 0) { if (d.status == 0) {
self.mainList = d.data || []; self.aggreements = d.data;
} else {
} }
}); });
}, },
...@@ -120,7 +121,7 @@ ...@@ -120,7 +121,7 @@
onColFormater(row, column, cellValue, index) { onColFormater(row, column, cellValue, index) {
return cellValue || "---"; return cellValue || "---";
}, },
getEtemplate(id) { getEnttemplate(id) {
var self = this; var self = this;
self.$root.postReq("/web/enttemplateCtl/info", { self.$root.postReq("/web/enttemplateCtl/info", {
id: id, id: id,
...@@ -129,11 +130,11 @@ ...@@ -129,11 +130,11 @@
if(d.data) { if(d.data) {
d.data.isEnabled = d.data.isEnabled ? true : false; d.data.isEnabled = d.data.isEnabled ? true : false;
} }
self.etemplate = d.data; self.enttemplate = d.data;
if(self.etemplate.codeurl) { if(self.enttemplate.filepath) {
self.fileList = [{ self.fileList = [{
name: "模板文件", name: "模板文件",
url: self.etemplate.codeurl, url: self.enttemplate.filepath,
}]; }];
} else { } else {
self.uploadResult = null; self.uploadResult = null;
...@@ -150,10 +151,10 @@ ...@@ -150,10 +151,10 @@
this.clearUpload(); this.clearUpload();
if(id) { if(id) {
this.editTitle = "修改"; this.editTitle = "修改";
this.getEtemplate(id); this.getEnttemplate(id);
} else { } else {
this.editTitle = "修改"; this.editTitle = "修改";
this.etemplate = {isEnabled:true}; this.enttemplate = {isEnabled:true};
} }
this.showEdit = true; this.showEdit = true;
}, },
...@@ -168,7 +169,7 @@ ...@@ -168,7 +169,7 @@
validfileds(rule, value, callback) { validfileds(rule, value, callback) {
var self = this; var self = this;
if(rule.field == "ecompanyName") { if(rule.field == "ecompanyName") {
if(!self.etemplate.entcompany_id) { if(!self.enttemplate.dkcompany_id) {
return callback(new Error("请重新选择公司名称")); return callback(new Error("请重新选择公司名称"));
} }
} }
...@@ -182,12 +183,12 @@ ...@@ -182,12 +183,12 @@
nameChange2(val) { nameChange2(val) {
var self = this; var self = this;
var item = self.nameMap2[val]; var item = self.nameMap2[val];
self.etemplate.entcompany_id = (item || {}).id || ""; self.enttemplate.entcompany_id = (item || {}).id || "";
}, },
getCompanyNames(query) { getCompanyNames(query) {
var self = this; var self = this;
self.nameLoading = true; self.nameLoading = true;
self.$root.postReq("/web/ecompanyCtl/suggest", { self.$root.postReq("/web/entcompanyCtl/suggest", {
name: query name: query
}).then(function (d) { }).then(function (d) {
self.nameLoading = false; self.nameLoading = false;
...@@ -204,7 +205,7 @@ ...@@ -204,7 +205,7 @@
getCompanyNames2(query) { getCompanyNames2(query) {
var self = this; var self = this;
self.nameLoading2 = true; self.nameLoading2 = true;
self.$root.postReq("/web/ecompanyCtl/suggest", { self.$root.postReq("/web/entcompanyCtl/suggest", {
name: query name: query
}).then(function (d) { }).then(function (d) {
self.nameLoading2 = false; self.nameLoading2 = false;
...@@ -222,7 +223,7 @@ ...@@ -222,7 +223,7 @@
clearUpload() { clearUpload() {
var self = this; var self = this;
self.uploadResult = null; self.uploadResult = null;
self.etemplate.codeurl = ""; self.enttemplate.filepath = "";
if(self.$refs.upload3 && self.$refs.upload3.$refs && self.$refs.upload3.$refs.upload) { if(self.$refs.upload3 && self.$refs.upload3.$refs && self.$refs.upload3.$refs.upload) {
self.$refs.upload3.$refs.upload.clearFiles(); self.$refs.upload3.$refs.upload.clearFiles();
} }
...@@ -232,18 +233,18 @@ ...@@ -232,18 +233,18 @@
this.$message.warning("上传失败"); this.$message.warning("上传失败");
return; return;
} }
this.etemplate.codeurl = v[0].url; this.enttemplate.filepath = v[0].url;
}, },
saveTemplate() { saveTemplate() {
var self = this; var self = this;
self.$refs.etemplate.validate((valid) => { self.$refs.enttemplate.validate((valid) => {
if (valid) { if (valid) {
self.saveLoading = true; self.saveLoading = true;
setTimeout(() => { setTimeout(() => {
self.saveLoading = false; self.saveLoading = false;
}, 15000); }, 15000);
self.$root.postReq("/web/enttemplateCtl/mysave", self.etemplate).then(function (d) { self.$root.postReq("/web/enttemplateCtl/mysave", self.enttemplate).then(function (d) {
if (d.status == 0) { if (d.status == 0) {
self.$message.success(`保存成功`); self.$message.success(`保存成功`);
self.showEdit = false; self.showEdit = false;
...@@ -263,5 +264,5 @@ ...@@ -263,5 +264,5 @@
}); });
}, },
}, },
vname: "gsb-ecompanyadmin" vname: "gsb-enttemplateadmin"
} }
\ No newline at end of file
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
row-style="height:50px;" > row-style="height:50px;" >
<el-table-column prop="id" label="序号" :formatter="onColFormater" width="80" align="center" ></el-table-column> <el-table-column prop="id" label="序号" :formatter="onColFormater" width="80" align="center" ></el-table-column>
<el-table-column prop="name" label="模板名称" :formatter="onColFormater" align="center" ></el-table-column> <el-table-column prop="name" label="模板名称" :formatter="onColFormater" align="center" ></el-table-column>
<el-table-column prop="ecompany.name" label="公司名称" :formatter="onColFormater" align="center" ></el-table-column> <el-table-column prop="entcompany.name" label="公司名称" :formatter="onColFormater" align="center" ></el-table-column>
<!-- <el-table-column prop="ecompanyMain.alias" label="签约主体" :formatter="onColFormater" align="center" ></el-table-column>--> <!-- <el-table-column prop="ecompanyMain.alias" label="签约主体" :formatter="onColFormater" align="center" ></el-table-column>-->
<!-- <el-table-column label="二维码" >--> <!-- <el-table-column label="二维码" >-->
<!-- <template slot-scope="scope" >--> <!-- <template slot-scope="scope" >-->
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
<el-form-item label="所属公司:" prop="ecompanyName"> <el-form-item label="所属公司:" prop="ecompanyName">
<el-select <el-select
v-model="etemplate.ecompanyName" v-model="etemplate.entcompanyName"
filterable filterable
remote remote
clearable clearable
......
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