1
This commit is contained in:
+54
-10
@@ -1,4 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const dbName = require('../../../../../dao/config.js')
|
||||
module.exports = {
|
||||
/**
|
||||
* 同意合作
|
||||
@@ -40,25 +42,62 @@ module.exports = {
|
||||
status: 1
|
||||
}
|
||||
})
|
||||
|
||||
// 获取商品信息
|
||||
const productTitle = quote.productList.map(item => {
|
||||
return item.name
|
||||
}).join("/")
|
||||
|
||||
|
||||
|
||||
if (!quote) {
|
||||
return {
|
||||
code: -1,
|
||||
msg: '请刷新页面'
|
||||
}
|
||||
}
|
||||
// 获取乙方信息
|
||||
const quoteUser = await vk.baseDao.select({
|
||||
dbName: dbName.user,
|
||||
getMain: true,
|
||||
getOne: true,
|
||||
whereJson: {
|
||||
_id: quote.userId
|
||||
}
|
||||
})
|
||||
|
||||
// 获取商品信息
|
||||
const productTitle = quote.productList.map(item => {
|
||||
return item.name
|
||||
}).join("/")
|
||||
|
||||
|
||||
// 获取询价单信息
|
||||
const sheet = await vk.baseDao.selects({
|
||||
dbName: dbName.enquirySheet,
|
||||
whereJson: {_id: quote.sheetId},
|
||||
getMain: true,
|
||||
getOne: true
|
||||
})
|
||||
|
||||
const fadadaContractId = vk.pubfn.createOrderNo("E", 20)
|
||||
// 上传合同模板并填充
|
||||
// if(sheet.signMethod == 0 && sheet.contractType == 0) {
|
||||
// pubFun.fadada('generate_contract.api', {
|
||||
// template_id: '20231120',
|
||||
// contract_id: fadadaContractId,
|
||||
// parameter_map: JSON.stringify({
|
||||
// jiaName: userInfo.accountType == 1?userInfo.person.personName: userInfo.company.companyName,
|
||||
// jiaDate: '',
|
||||
// jiaPhone: '',
|
||||
// yiName: userInfo.accountType == 1?userInfo.person.personName: userInfo.company.companyName,
|
||||
// yiDate: '',
|
||||
// yiPhone: '',
|
||||
// sellerSupplement: '',
|
||||
// }),
|
||||
// })
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// 新增合同记录
|
||||
const contractId = await vk.baseDao.add({
|
||||
dbName: 'jjx-contract',
|
||||
dataJson: {
|
||||
fadadaContractId: vk.pubfn.createOrderNo("E", 20),
|
||||
|
||||
fadadaContractId: fadadaContractId,
|
||||
contractBase: '', // 原始合同
|
||||
contractHistory: [], // 历史合同
|
||||
contractFinal: '', // 归档合同
|
||||
@@ -71,10 +110,15 @@ module.exports = {
|
||||
productTitle,
|
||||
tradeMethod: quote.tradeMethod,
|
||||
partyCount: 2,
|
||||
signCount: 0
|
||||
signCount: 0,
|
||||
contractType: sheet.contractType,
|
||||
signMethod: sheet.signMethod,
|
||||
sellerSupplement: sheet.sellerSupplement,
|
||||
}
|
||||
})
|
||||
|
||||
// 上传合同模板
|
||||
|
||||
//新增 用户与合同的关联记录
|
||||
await vk.daoCenter.userContractDao.adds([
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user