60 lines
1.3 KiB
JavaScript
60 lines
1.3 KiB
JavaScript
'use strict';
|
|
module.exports = {
|
|
/**
|
|
* 获取报价单详情
|
|
* @url client/enquiry/sheet/pub/getDetail 前端调用的url参数地址
|
|
* data 请求参数
|
|
* @param {String} params1 参数1
|
|
*/
|
|
main: async (event) => {
|
|
let { data = {}, userInfo, util, filterResponse, originalParam } = event;
|
|
let { customUtil, uniID, config, pubFun, vk, db, _ } = util;
|
|
let { uid, _id } = data;
|
|
let res = { code: 0, msg: "" };
|
|
// 业务逻辑开始-----------------------------------------------------------
|
|
let dbName = "jjx-enquiry-sheet";
|
|
res.data = await vk.baseDao.selects({
|
|
dbName,
|
|
getOne: true,
|
|
getMain: true,
|
|
whereJson: {
|
|
_id: _id
|
|
},
|
|
foreignDB: [
|
|
{
|
|
dbName:"uni-id-users",
|
|
localKey:"userId",
|
|
foreignKey:"_id",
|
|
as:"user",
|
|
limit:1, // limit=1则以对象形式返回
|
|
fieldJson:{
|
|
_id: true,
|
|
company: {
|
|
companyName: true,
|
|
mobile: true,
|
|
},
|
|
person: {
|
|
personName: true,
|
|
mobile: true,
|
|
},
|
|
businessCard: true,
|
|
accountType: true,
|
|
},
|
|
},
|
|
{
|
|
dbName: "jjx-enquiry-quote",
|
|
localKey: "_id",
|
|
foreignKey: "sheetId",
|
|
as: "quoteList",
|
|
limit: 500, // limit=1则以对象形式返回
|
|
}
|
|
]
|
|
});
|
|
|
|
|
|
|
|
// 业务逻辑结束-----------------------------------------------------------
|
|
return res;
|
|
}
|
|
}
|