'use strict'; /** * * * @author Mai * @date * @version */ const parseInfo = ['deal_info', 'construction_unit', 'tech_param', 'decimal', 'precision', 'deal_param', 'display', 'pay_account', 'shenpi', 'bid_info', 'ledger_check', 'fun_rela', 'over_range_check']; const arrayInfo = ['chapter']; const defaultInfo = { // 合同信息 deal_info: { buildName: '', // 建设项目名称 dealCode: '', // 合同编号 dealName: '', // 合同名称 projectType: '', // 工程类别 dealType: '', // 合同类别 finalCode: '', // 结算书编号 budgetApprovalCode: '', // 概算批复编号 }, // 参建单位 construction_unit: { // 建设 build: { company: '', // 单位名称 corporation: '', // 法人代表 date: '', // 签订日期 }, // 代建 sub_build: { company: '', corporation: '', date: '', }, // 承包 contract1: { company: '', corporation: '', date: '', management: '', }, contract2: { company: '', corporation: '', date: '', }, // 监理 supervision1: { company: '', corporation: '', date: '', }, supervision2: { company: '', corporation: '', date: '', }, // 检测 detect: { company: '', corporation: '', date: '', }, // 审计 audit: { company: '', corporation: '', date: '', } }, // 技术参数 tech_param: { loadLevel: 0, // 公路等级 loadLength: 0, // 长度 startPeg: '', // 起始桩号 endPeg: '', // 终止桩号 laneCount: 0, // 车道数 dealPeriod: '', // 合同工期 startDate: '', // 开工日期 planEndDate: '', // 计划完工日期 realStartDate: '', // 实际开工日期 realEndDate: '', // 实际完工日期 structureScale: '', // 构造物规模 mainContent: '', // 主要工作内容 }, // 中标信息 bid_info: { controlPrice: 0, // 业主控制价 bidPrice: 0, // 中标价 bidStartDate: '', // 开标日期 bidType: '公开招标', // 招标方式 dealCalcType: '单价合同', // 合同计价方式 bidYuPrice: 0, // 招标清单预算 }, // 小数位数 decimal: { up: 2, qty: 3, tp: 0, pay: false, payTp: 0, extra: false, extraTp: 0, }, precision: { t: { unit: 't', value: 3 }, km: { unit: 'km', value: 3 }, m: { unit: 'm', value: 3 }, m2: { unit: 'm2', value: 2 }, m3: { unit: 'm3', value: 2 }, kg: { unit: 'kg', value: 2 }, ge: { unit: '个', value: 0 }, tai: { unit: '台', value: 0 }, tao: { unit: '套', value: 0 }, ke: { unit: '棵', value: 0 }, zu: { unit: '组', value: 0 }, xitong: { unit: '系统', value: 0 }, other: { value: 3 }, }, // 合同参数 deal_param: { contractPrice: 0, // 签约合同价 zanLiePrice: 0, // 暂列金额 startAdvance: 0, // 开工预付款 materialAdvance: 0, // 材料预付款 safeAdvance: 0, // 安全生产预付款 dustAdvance: 0, // 扬尘污染预付款 }, // 显示设置 display: { ledger: { deal: false, dgnQty: false, clQty: false, ancillaryGcl: false, }, exMemo: true, thousandth: false, stage: { realComplete: false, correct: true, priceDiff: false, }, dayMode: false, }, chapter: [ {code: '100', name: '总则'}, {code: '200', name: '路基'}, {code: '300', name: '路面'}, {code: '400', name: '桥梁、涵洞'}, {code: '500', name: '隧道'}, {code: '600', name: '安全设施及预埋管线'}, {code: '700', name: '绿化及环境保护'}, {code: '800', name: '机电工程'}, {code: '900', name: '房建工程'}, {code: '1000', name: '收费系统'}, {code: '1100', name: '通信系统'}, {code: '1200', name: '消防系统'}, {code: '1300', name: '供配电及照明系统'}, ], // 付款账号 pay_account: { project: { // 工程款 name: '', // 开户名称 bank: '', // 开户银行 account: '', // 开户账号 rate: '', // 分账划拨比例 contact: '', // 联系人 phone: '', // 联系电话 num: '', // 行号 }, worker: { // 农民工 name: '', bank: '', account: '', rate: '', contact: '', phone: '', num: '', }, }, shenpi: { advance: 1, ledger: 1, revise: 1, stage: 1, settle: 1, change: 1, material: 1, phasePay: 1, }, ledger_check: { same_code: true, sibling: true, over: true, banMinusChangeBills: true, }, fun_rela: { hintOver: true, repel: false, stage_change: { minusNoValue: true, }, sum_load: { ignoreParent: false, }, stage_rela: { show: false, }, }, over_range_check: { field: 'tz', // 'deal', 'both', percent: 100, billsWithPos: 'pos', // 'bills', 'both', }, }; const gclDefaultInfo = (function () { const result = JSON.parse(JSON.stringify(defaultInfo)); result.display.ledger.deal = true; result.over_range_check = { field: 'deal', percent: 100, billsWithPos: 'bills'}; return result; })(defaultInfo); const tzDefaultInfo = (function () { const result = JSON.parse(JSON.stringify(defaultInfo)); result.over_range_check = { field: 'tz', percent: 100, billsWithPos: 'both'}; return result; })(defaultInfo); const paymentDefaultInfo = (function () { const result = {}; result.deal_info = JSON.parse(JSON.stringify(defaultInfo.deal_info)); result.construction_unit = JSON.parse(JSON.stringify(defaultInfo.construction_unit)); result.tech_param = JSON.parse(JSON.stringify(defaultInfo.tech_param)); result.pay_account = JSON.parse(JSON.stringify(defaultInfo.pay_account)); return result; })(defaultInfo); const transOverRangeCheck = function(helper, check) { const result = {}; result.coe = helper.div(check.percent, 100); result.checkTz = check.field === 'tz' || check.field === 'both'; result.checkDeal = check.field === 'deal' || check.field === 'both'; result.hasPosCheckBills = check.billsWithPos === 'bills' || check.billsWithPos === 'both'; result.hasPosCheckPos = check.billsWithPos === 'pos' || check.billsWithPos === 'both'; return result; }; module.exports = { parseInfo, arrayInfo, defaultInfo, gclDefaultInfo, tzDefaultInfo, paymentDefaultInfo, transOverRangeCheck, };