浏览代码

Merge branch 'master' of http://192.168.1.41:3000/SmartCost/YangHuCost

TonyKang 5 年之前
父节点
当前提交
396cd29164
共有 31 个文件被更改,包括 738 次插入343 次删除
  1. 4 0
      modules/all_models/user.js
  2. 13 1
      modules/pm/facade/pm_facade.js
  3. 1 1
      modules/users/controllers/boot_controller.js
  4. 4 0
      modules/users/controllers/cld_controller.js
  5. 2 2
      modules/users/controllers/login_controller.js
  6. 5 3
      modules/users/controllers/user_controller.js
  7. 4 4
      modules/users/models/user_model.js
  8. 1 0
      public/scHintBox.html
  9. 5 0
      web/building_saas/css/custom.css
  10. 二进制
      web/building_saas/css/favicon.ico
  11. 二进制
      web/building_saas/img/vip.png
  12. 二进制
      web/building_saas/img/vip2.png
  13. 3 3
      web/building_saas/main/js/views/tender_price_view.js
  14. 2 2
      web/building_saas/main/js/views/zmhs_view.js
  15. 1 1
      web/building_saas/pm/js/pm_newMain.js
  16. 11 3
      web/building_saas/standard_interface/config.js
  17. 105 106
      web/building_saas/standard_interface/export/anhui_chizhou.js
  18. 13 13
      web/building_saas/standard_interface/export/anhui_maanshan.js
  19. 26 1
      web/building_saas/standard_interface/export/base.js
  20. 110 59
      web/building_saas/standard_interface/export/guangdong_zhongshan.js
  21. 16 1
      web/building_saas/standard_interface/export/view.js
  22. 24 2
      web/building_saas/standard_interface/import/anhui_maanshan.js
  23. 9 2
      web/building_saas/standard_interface/import/base.js
  24. 176 0
      web/building_saas/standard_interface/import/guangdong_zhongshan.js
  25. 7 7
      web/common/html/header.html
  26. 4 0
      web/over_write/js/shandong_2016.js
  27. 7 0
      web/over_write/js/sichuan_2013.js
  28. 4 4
      web/users/html/login-sms.html
  29. 4 4
      web/users/html/login.html
  30. 23 22
      web/users/html/user-buy.html
  31. 154 102
      web/users/js/login.js

+ 4 - 0
modules/all_models/user.js

@@ -34,6 +34,10 @@ let upgrade = mongoose.Schema({
         type:String,
         default: '',
     },
+    lock: { // 锁信息 1:借出(借用);2:销售(购买);
+        type: Number,
+        default: 0,
+    }
 }, { _id: false })
 
 const userdList = mongoose.Schema({

+ 13 - 1
modules/pm/facade/pm_facade.js

@@ -1939,9 +1939,21 @@ async function importTenderDetail(tenderData) {
     const engineering = await engineeringModel.getEngineering(tenderData.property.engineering_id);
     const mainTreeCol = await mainColLibModel.findOne({ ID: tenderData.property.colLibID });
     await projectSettingModel.create({ projectID: tenderData.ID, main_tree_col: mainTreeCol.main_tree_col, glj_col: engineering.glj_col });
+    const task = [];
     // 清单
     if (tenderData.bills && tenderData.bills.length) {
-        await billsModel.insertMany(tenderData.bills);
+        task.push(billsModel.insertMany(tenderData.bills));
+    }
+    // 暂估价材料表
+    if (tenderData.evaluationList.length) {
+        task.push(evaluateListModel.insertMany(tenderData.evaluationList));
+    }
+    // 评标材料表
+    if (tenderData.bidEvaluationList.length) {
+        task.push(bidListModel.insertMany(tenderData.bidEvaluationList));
+    }
+    if (task.length) {
+        await Promise.all(task);
     }
 }
 

+ 1 - 1
modules/users/controllers/boot_controller.js

@@ -32,7 +32,7 @@ class BootController extends BaseController {
             // 判断当前用户的是使用免费版还是专业版
             compilationVersion = await userModel.getVersionFromUpgrade(sessionUser.ssoId, compilationId);
             request.session.compilationVersion = compilationVersion.version;
-            request.session.sessionUser.compilationDeadline = compilationVersion.deadline;
+            request.session.sessionUser.compilationLock = compilationVersion.lock;
             request.session.sessionCompilation = compilationData;
             if(sessionUser.latest_used !== compilationId) userModel.updateLatestUsed(sessionUser.id,compilationId);
         }

+ 4 - 0
modules/users/controllers/cld_controller.js

@@ -88,6 +88,8 @@ class CLDController {
                     });
                     if (oneCompilationIndex !== -1) {
                         compilationList[oneCompilationIndex].isUpgrade = userUpgradeList[i].isUpgrade;
+                        compilationList[oneCompilationIndex].deadline = userUpgradeList[i].deadline;
+                        compilationList[oneCompilationIndex].lock = userUpgradeList[i].lock;
                     }
                 }
             }
@@ -110,6 +112,7 @@ class CLDController {
         let deadline = request.body.deadline || '';
         let status = parseInt(request.body.status);
         let smssend = parseInt(request.body.smssend);
+        let lock = parseInt(request.body.lock);// 0.默认、1.借出(借用)、2.销售(购买)
         try {
 
             let userModel = new UserModel();
@@ -136,6 +139,7 @@ class CLDController {
                 isUpgrade: status !== 2,
                 remark: '',
                 deadline: deadline,
+                lock: lock,
             };
 
             if (upgradeIndex === -1) {

+ 2 - 2
modules/users/controllers/login_controller.js

@@ -103,7 +103,7 @@ class LoginController {
                     // 判断当前用户的是使用免费版还是专业版
                     let compilationVersion = await userModel.getVersionFromUpgrade(sessionUser.ssoId, preferenceSetting.select_version);
                     request.session.compilationVersion = compilationVersion.version;
-                    request.session.sessionUser.compilationDeadline = compilationVersion.deadline;
+                    request.session.sessionUser.compilationLock = compilationVersion.lock;
                     request.session.sessionCompilation = compilationData;
                     if(request.session.sessionUser.latest_used !== preferenceSetting.select_version) await userModel.updateLatestUsed(request.session.sessionUser.id,preferenceSetting.select_version);
                 }
@@ -278,7 +278,7 @@ class LoginController {
                 // 判断当前用户的是使用免费版还是专业版
                 let compilationVersion = await userModel.getVersionFromUpgrade(sessionUser.ssoId, preferenceSetting.select_version);
                 request.session.compilationVersion = compilationVersion.version;
-                request.session.sessionUser.compilationDeadline = compilationVersion.deadline;
+                request.session.sessionUser.compilationLock = compilationVersion.lock;
                 request.session.sessionCompilation = compilationData;
                 if(request.session.sessionUser.latest_used !== preferenceSetting.select_version) await userModel.updateLatestUsed(request.session.sessionUser.id,preferenceSetting.select_version);
             }

+ 5 - 3
modules/users/controllers/user_controller.js

@@ -31,7 +31,7 @@ class UserController extends BaseController {
         let sessionUser = request.session.sessionUser;
 
         let userModel = new UserModel();
-        let userData = await userModel.findDataByName(sessionUser.username);
+        let userData = await userModel.findDataBySsoId(sessionUser.ssoId);
         userData = Object.keys(userData).length <= 0 ? [] : userData;
 
         let renderData = {
@@ -98,7 +98,7 @@ class UserController extends BaseController {
             // 获取当前用户信息
             let sessionUser = request.session.sessionUser;
             let userModel = new UserModel();
-            userData = await userModel.findDataByName(sessionUser.username);
+            userData = await userModel.findDataBySsoId(sessionUser.ssoId);
 
             let page = request.query.page === undefined ? 1 : request.query.page;
 
@@ -157,6 +157,8 @@ class UserController extends BaseController {
                     });
                     if (oneCompilationIndex !== -1) {
                         compilationList[oneCompilationIndex].isUpgrade = userUpgradeList[index].isUpgrade;
+                        compilationList[oneCompilationIndex].deadline = userUpgradeList[index].deadline;
+                        compilationList[oneCompilationIndex].lock = userUpgradeList[index].lock;
                     }
                 }
             }
@@ -241,7 +243,7 @@ class UserController extends BaseController {
                 let userModel = new UserModel();
                 let compilationVersion = await userModel.getVersionFromUpgrade(sessionUserData.ssoId, compilationData._id);
                 request.session.compilationVersion = compilationVersion.version;
-                request.session.sessionUser.compilationDeadline = compilationVersion.deadline;
+                request.session.sessionUser.compilationLock = compilationVersion.lock;
                 request.session.sessionCompilation = compilationData;
             }
         } catch (error) {

+ 4 - 4
modules/users/models/user_model.js

@@ -349,7 +349,7 @@ class UserModel extends BaseModel {
     async getVersionFromUpgrade(ssoId, compilationId) {
         let title = config[process.env.NODE_ENV].title?config[process.env.NODE_ENV].title:"纵横公路养护云造价";
         let version = title+'(学习版)';//'纵横公路养护造价(免费云版)'; 2019-03-28 需求修改,听说不知道多久的以后还会改回来--勿删!!!!!
-        let deadline = '';
+        let lock = 0;
         let userData = await this.findDataBySsoId(ssoId);
         if (userData.upgrade_list !== undefined) {
             let compilationInfo = userData.upgrade_list.find(function (item) {
@@ -357,12 +357,12 @@ class UserModel extends BaseModel {
             });
             if (compilationInfo !== undefined && compilationInfo.isUpgrade === true) {
                 version = title+'(专业版)';
-                if (compilationInfo.deadline !== undefined && compilationInfo.deadline !== '') {
-                    deadline = compilationInfo.deadline;
+                if (compilationInfo.lock !== undefined && compilationInfo.lock !== 0) {
+                    lock = compilationInfo.lock;
                 }
             }
         }
-        return {version: version, deadline: deadline};
+        return {version: version, lock: lock};
     }
 
     /**

+ 1 - 0
public/scHintBox.html

@@ -187,6 +187,7 @@
     };
 
     $('#hintBox_form').on('hide.bs.modal', function() {
+        $('#hintBox_caption').removeClass('export-check');
         if($.bootstrapLoading) $.bootstrapLoading.end();
         return;
     });

+ 5 - 0
web/building_saas/css/custom.css

@@ -594,4 +594,9 @@ input.text-right {
   100% {
     transform: translateX(420px);
   }
+}
+
+.export-check{
+  overflow: auto;
+  height: 400px;
 }

二进制
web/building_saas/css/favicon.ico


二进制
web/building_saas/img/vip.png


二进制
web/building_saas/img/vip2.png


+ 3 - 3
web/building_saas/main/js/views/tender_price_view.js

@@ -10,7 +10,7 @@ let tender_obj={
     tenderSetting:{
         header:[
             {headerName: "项目编码", headerWidth: 170, dataCode: "code", dataType: "String",spanRows: [2],getText:'getText.code'},
-            {headerName: "类别", headerWidth: 50, dataCode: "subType", hAlign: "center", dataType: "String",spanRows: [2],getText:'getText.subType'},
+            // {headerName: "类别", headerWidth: 50, dataCode: "subType", hAlign: "center", dataType: "String",spanRows: [2],getText:'getText.subType'},
             {headerName: "项目名称", headerWidth: 200, dataCode: "name",showHint:true, hAlign: "left", dataType: "String",spanRows: [2]},
             {headerName: "计量\n单位", headerWidth: 60, dataCode: "unit", hAlign: "center", dataType: "String",spanRows: [2]},
             {headerName: "工程量", headerWidth: 70, dataCode: "quantity", hAlign: "right", dataType: "Number",validator:"number",spanRows: [2],getText:'getText.quantity'},
@@ -29,8 +29,8 @@ let tender_obj={
             {headerName: "子目工程量\n调整系数", headerWidth: 80, dataCode: "rationQuantityCoe", hAlign: "right", dataType: "Number",spanRows: [2],validator:"number"}
         ],
         view: {
-            // lockColumns: [0,1,2,3,4,6,7,10,11]
-            lockColumns: [0,1,2,3,4,5,6,9,10]
+            // lockColumns: [0,1,2,3,4,5,6,9,10]
+            lockColumns: [0,1,2,3,4,5,8,9]
         }
     },
     tenderTreeSetting:{

+ 2 - 2
web/building_saas/main/js/views/zmhs_view.js

@@ -10,8 +10,8 @@ let zmhs_obj = {
     coeSetting: {
         header: [
             {headerName: "调整", headerWidth: 35, dataCode: "isAdjust", dataType: "String", cellType: "checkBox"},
-            {headerName: "条件", headerWidth: 180, dataCode: "name", dataType: "String", cellType: "button",getText:'forName'},
-            {headerName: "内容", headerWidth: 70, dataCode: "content", dataType: "String", hAlign: "left",getText:'forContent',cellType:'tipsCell'}
+            {headerName: "条件", headerWidth: 140, dataCode: "name", dataType: "String", cellType: "button",getText:'forName'},
+            {headerName: "内容", headerWidth: 110, dataCode: "content", dataType: "String", hAlign: "left",getText:'forContent',cellType:'tipsCell'}
         ],
         view: {
             lockColumns:[0,1,2],

+ 1 - 1
web/building_saas/pm/js/pm_newMain.js

@@ -4169,4 +4169,4 @@ if(isShow){
    let welcomeTimer = setInterval("countdown()", 1000);   
  }
  $('#welcomePage').modal('show');//是否显示欢迎页
-} 
+} 

+ 11 - 3
web/building_saas/standard_interface/config.js

@@ -64,12 +64,20 @@ const INTERFACE_CONFIG = (() => {
         [CONTROL]: '.XCGLKZJ',
       },
     },
+    '安徽@亳州': {
+      scriptName: 'anhui_maanshan.js',
+      fileSuffix: {
+        [BID_INVITATION]: '.BZGLZB',
+        [BID_SUBMISSION]: '.BZGLTB',
+        [CONTROL]: '.BZGLKZJ',
+      },
+    },
     '安徽@池州': {
       scriptName: 'anhui_chizhou.js',
       fileSuffix: {
-        [BID_INVITATION]: '.CZGLZB',
-        [BID_SUBMISSION]: '.CZLTB',
-        [CONTROL]: '.CZGLZBKZJ',
+        [BID_INVITATION]: '.czglzb',
+        [BID_SUBMISSION]: '.czgltb',
+        [CONTROL]: '.czglzbkzj',
       }
     },
     '广东@中山': {

+ 105 - 106
web/building_saas/standard_interface/export/anhui_chizhou.js

@@ -18,7 +18,6 @@ INTERFACE_EXPORT = (() => {
             },
             UTIL: {
                 getValueByKey,
-                getHan,
                 getFee,
                 generateHardwareId,
             },
@@ -31,16 +30,15 @@ INTERFACE_EXPORT = (() => {
             RationType,
         } = window.commonConstants
 
-        const GljType = gljUtil.gljType;
-
-        const { isEmptyVal, isDef } = window.commonUtil;
-
         const isBidInvitation = exportKind === BID_INVITATION; // 是否是招标
         const isBidSubmission = exportKind === BID_SUBMISSION; // 是否是投标
         const isControl = exportKind === CONTROL; // 是否是控制价
 
         let serialNo;
         let vTree;
+        const info = projectData.property && projectData.property.basicInformation || [];
+        const summary = projectData.summaryInfo[projectData.ID];
+        // const feature = tenderDetailMap[projectData.children[0].ID].property.projectFeature;
 // ------------------------------------------------------------------------------------------------------------
         // 提取字符串中的数字
         function getNum(str) {
@@ -71,95 +69,101 @@ INTERFACE_EXPORT = (() => {
             Element.call(this, nodeName, attrArr);
         }
 
-        function GongCXX(information) {
+        function GongCXX() {
             const attrs = [
-                { name: '项目编号', value: getValueByKey(information, 'projNum') },
-                { name: '项目名称', value: getValueByKey(information, '') },
-                { name: '建设单位', value: getValueByKey(information, 'constructingUnits') },
-                { name: '起始桩号', value: getValueByKey(information, 'startAndChainages') },
-                { name: '终点桩号', value: getValueByKey(information, 'startAndChainages') },
-                { name: '建设地址', value: getValueByKey(information, '') },
-                { name: '项目概况', value: getValueByKey(information, '') },
-                { name: '建设性质', value: getValueByKey(information, '') },
-                { name: '专业划分', value: getValueByKey(information, '') },
-                { name: '道路里程', value: getValueByKey(information, '') },
-                { name: '设计单位', value: getValueByKey(information, '') },
-                { name: '计税方式', value: getValueByKey(information, 'taxMode') },
-                { name: '文件类型', value: getValueByKey(information, 'projType') },
-                { name: '标准版本号', value: getValueByKey(information, '') },
-                { name: 'GUID', value: getValueByKey(information, '') }
+                { name: '项目编号', value: getValueByKey(info, 'projNum') },
+                { name: '项目名称', value: projectData.name },    // projName
+                { name: '建设单位', value: getValueByKey(info, 'constructingUnits') },
+                { name: '起始桩号', value: getValueByKey(info, 'startChainages') },
+                { name: '终点桩号', value: getValueByKey(info, 'endChainages') },
+                { name: '建设地址', value: getValueByKey(info, 'constructionAddress') },
+                { name: '项目概况', value: getValueByKey(info, 'projOverview') },
+                { name: '建设性质', value: getValueByKey(info, 'natureConstruction') },
+                { name: '专业划分', value: getValueByKey(info, 'roadGrade') },
+                { name: '道路里程', value: getValueByKey(info, 'roadDistance') },
+                { name: '设计单位', value: getValueByKey(info, 'designUnit') },
+                { name: '计税方式', value: getValueByKey(info, 'taxMode') },
+                { name: '文件类型', value: getValueByKey(info, 'projType') },
+                { name: '标准版本号', value: '1.0' },
+                { name: 'GUID', value: projectData._id }
             ];
             Element.call(this, '工程信息', attrs);
         }
-        function ZhaoBiaoXx(information) {
+        function ZhaoBiaoXX() {
             const attrs = [
-                { name: '招标人', value: getValueByKey(information, 'tendereeName') },
-                { name: '招标人纳税识别号', value: getValueByKey(information, 'tendereeTaxpayerIdentificationNo') },
-                { name: '招标法定代表人或其授权人', value: getValueByKey(information, 'tenderAuthorizer') },
-                { name: '招标法人或其授权人身份证号', value: getValueByKey(information, 'tenderAuthorizerIDNo') },
-                { name: '造价咨询人', value: getValueByKey(information, 'costConsultant') },
-                { name: '造价咨询人纳税识别号', value: getValueByKey(information, 'costConsultantTaxpayerIdentificationNo') },
-                { name: '造价咨询人法定代表人或其授权人', value: getValueByKey(information, 'consultantAuthorizer') },
-                { name: '造价咨询法人或其授权人身份证号', value: getValueByKey(information, 'consultantAuthorizerTaxpayerIdentificationNo') },
-                { name: '编制人', value: getValueByKey(information, 'tenderCompiler') },
-                { name: '编制人资格证号', value: getValueByKey(information, '') },
-                { name: '编制日期', value: getValueByKey(information, 'compilationTime'), type: TYPE.DATE},
-                { name: '复核人', value: getValueByKey(information, 'tenderExaminer') },
-                { name: '复核人资格证号', value: getValueByKey(information, '') },
-                { name: '复核日期', value: getValueByKey(information, 'reviewTime'), type: TYPE.DATE }
+                { name: '招标人', value: getValueByKey(info, 'tendereeName') },
+                { name: '招标人纳税识别号', value: getValueByKey(info, 'tendereeTaxpayerIdentificationNo') },
+                { name: '招标法定代表人或其授权人', value: getValueByKey(info, 'tenderAuthorizer') },
+                { name: '招标法人或其授权人身份证号', value: getValueByKey(info, 'tenderAuthorizerIDNo') },
+                { name: '造价咨询人', value: getValueByKey(info, 'costConsultant') },
+                { name: '造价咨询人纳税识别号', value: getValueByKey(info, 'costConsultantTaxpayerIdentificationNo') },
+                { name: '造价咨询人法定代表人或其授权人', value: getValueByKey(info, 'consultantAuthorizer') },
+                { name: '造价咨询法人或其授权人身份证号', value: getValueByKey(info, 'consultantAuthorizerTaxpayerIdentificationNo') },
+                { name: '编制人', value: getValueByKey(info, 'compileApprover') },
+                { name: '编制人资格证号', value: getValueByKey(info, 'compileCertNo') },
+                { name: '编制日期', value: getValueByKey(info, 'compileDate'), type: TYPE.DATE},
+                { name: '复核人', value: getValueByKey(info, 'reviewApprover') },
+                { name: '复核人资格证号', value: getValueByKey(info, 'reviewCertNo') },
+                { name: '复核日期', value: getValueByKey(info, 'reviewDate'), type: TYPE.DATE }
             ];
             Element.call(this, '招标信息', attrs);
         }
-        function ZhaoBiaoKzXx(information, totalCost) {
+        function ZhaoBiaoKZJ() {
             const attrs = [
-                { name: '招标人', value: getValueByKey(information, 'tendereeName') },
-                { name: '招标人纳税识别号', value: getValueByKey(information, 'tendereeTaxpayerIdentificationNo') },
-                { name: '招标法定代表人或其授权人', value: getValueByKey(information, 'tenderAuthorizer') },
-                { name: '招标法人或其授权人身份证号', value: getValueByKey(information, 'tenderAuthorizerIDNo') },
-                { name: '造价咨询人', value: getValueByKey(information, 'costConsultant') },
-                { name: '造价咨询人纳税识别号', value: getValueByKey(information, 'costConsultantTaxpayerIdentificationNo') },
-                { name: '造价咨询人法定代表人或其授权人', value: getValueByKey(information, 'consultantAuthorizer') },
-                { name: '造价咨询法人或其授权人身份证号', value: getValueByKey(information, 'consultantAuthorizerTaxpayerIdentificationNo') },
-                { name: '编制人', value: getValueByKey(information, 'tenderCompiler') },
-                { name: '编制人资格证号', value: getValueByKey(information, '') },
-                { name: '编制日期', value: getValueByKey(information, 'compilationTime'), type: TYPE.DATE},
-                { name: '复核人', value: getValueByKey(information, 'tenderExaminer') },
-                { name: '复核人资格证号', value: getValueByKey(information, '') },
-                { name: '复核日期', value: getValueByKey(information, 'reviewTime'), type: TYPE.DATE },
-                { name: '审核人', value: getValueByKey(information, 'tenderExaminer') },
-                { name: '审核人资格证号', value: getValueByKey(information, '') },
-                { name: '审核日期', value: getValueByKey(information, 'reviewTime'), type: TYPE.DATE },
-                { name: '控制价总价', value: totalCost, type: TYPE.DECIMAL },
-                { name: '工期', value: getValueByKey(information, '') },
-                { name: '质量要求', value: getValueByKey(information, '') }
+                { name: '招标人', value: getValueByKey(info, 'tendereeName') },
+                { name: '招标人纳税识别号', value: getValueByKey(info, 'tendereeTaxpayerIdentificationNo') },
+                { name: '招标法定代表人或其授权人', value: getValueByKey(info, 'tenderAuthorizer') },
+                { name: '招标法人或其授权人身份证号', value: getValueByKey(info, 'tenderAuthorizerIDNo') },
+                { name: '造价咨询人', value: getValueByKey(info, 'costConsultant') },
+                { name: '造价咨询人纳税识别号', value: getValueByKey(info, 'costConsultantTaxpayerIdentificationNo') },
+                { name: '造价咨询人法定代表人或其授权人', value: getValueByKey(info, 'consultantAuthorizer') },
+                { name: '造价咨询法人或其授权人身份证号', value: getValueByKey(info, 'consultantAuthorizerTaxpayerIdentificationNo') },
+                { name: '编制人', value: getValueByKey(info, 'compileApprover') },
+                { name: '编制人资格证号', value: getValueByKey(info, 'compileCertNo') },
+                { name: '编制日期', value: getValueByKey(info, 'compileDate'), type: TYPE.DATE},
+                { name: '复核人', value: getValueByKey(info, 'reviewApprover') },
+                { name: '复核人资格证号', value: getValueByKey(info, 'reviewCertNo') },
+                { name: '复核日期', value: getValueByKey(info, 'reviewDate'), type: TYPE.DATE },
+
+                { name: '审核人', value: getValueByKey(info, 'examineApprover') },
+                { name: '审核人资格证号', value: getValueByKey(info, 'examineCertNo') },
+                { name: '审核日期', value: getValueByKey(info, 'examineDate'), type: TYPE.DATE },
+
+                { name: '控制价总价', value: summary.totalCost, type: TYPE.DECIMAL },
+                { name: '工期', value: getValueByKey(info, 'timeLimit') },
+                { name: '质量要求', value: getValueByKey(info, 'qualityRequirements') }
             ];
             Element.call(this, '招标控制价', attrs);
         }
-        function TouBiaoXx(information, totalCost) {
+        function TouBiaoXX() {
+            let hardID = generateHardwareId();
+            let [cpuId, diskId, macId] = hardID.split(";");
+
             const attrs = [
-                { name: '投标人', value: getValueByKey(information, 'bidderName') },
-                { name: '投标人纳税识别号', value: getValueByKey(information, '') },
-                { name: '投标人法定代表或其授权人', value: getValueByKey(information, 'bidderAuthorizer') },
-                { name: '投标人法人或其授权人身份证号', value: getValueByKey(information, '') },
-                { name: '编制人', value: getValueByKey(information, 'tenderCompiler') },
-                { name: '编制人资格证号', value: getValueByKey(information, '') },
-                { name: '编制日期', value: getValueByKey(information, 'compilationTime'), type: TYPE.DATE},
-                { name: '复核人', value: getValueByKey(information, 'tenderExaminer') },
-                { name: '复核人资格证号', value: getValueByKey(information, '') },
-                { name: '复核日期', value: getValueByKey(information, 'reviewTime'), type: TYPE.DATE },
-                { name: '审核人', value: getValueByKey(information, 'tenderExaminer') },
-                { name: '审核人资格证号', value: getValueByKey(information, '') },
-                { name: '审核日期', value: getValueByKey(information, 'reviewTime'), type: TYPE.DATE },
-                { name: '投标总价', value: totalCost, type: TYPE.DECIMAL },
-                { name: '工期', value: getValueByKey(information, '') },
-                { name: '投标担保金额', value: getValueByKey(information, '') },
-                { name: '质量承诺', value: getValueByKey(information, '') },
-                { name: '投标担保方式', value: getValueByKey(information, '') },
-                { name: '造价软件品牌', value: getValueByKey(information, '') },
-                { name: '造价软件版本', value: getValueByKey(information, '') },
-                { name: '造价软件加密锁编号', value: getValueByKey(information, '') },
-                { name: '计算机硬件信息', value: getValueByKey(information, '') },
-                { name: '', value: getValueByKey(information, '') }
+                { name: '投标人', value: getValueByKey(info, 'bidderName') },
+                { name: '投标人纳税识别号', value: getValueByKey(info, 'bidderAuthorizerIDNo') },
+                { name: '投标人法定代表或其授权人', value: getValueByKey(info, 'bidderAuthorizer') },
+                { name: '投标人法人或其授权人身份证号', value: getValueByKey(info, 'bidderAuthorizerTaxpayerIdentificationNo') },
+                { name: '编制人', value: getValueByKey(info, 'compileApprover') },
+                { name: '编制人资格证号', value: getValueByKey(info, 'compileCertNo') },
+                { name: '编制日期', value: getValueByKey(info, 'compileDate'), type: TYPE.DATE},
+                { name: '复核人', value: getValueByKey(info, 'reviewApprover') },
+                { name: '复核人资格证号', value: getValueByKey(info, 'reviewCertNo') },
+                { name: '复核日期', value: getValueByKey(info, 'reviewDate'), type: TYPE.DATE },
+                { name: '审核人', value: getValueByKey(info, 'examineApprover') },
+                { name: '审核人资格证号', value: getValueByKey(info, 'examineCertNo') },
+                { name: '审核日期', value: getValueByKey(info, 'examineDate'), type: TYPE.DATE },
+
+                { name: '投标总价', value: summary.totalCost, type: TYPE.DECIMAL },
+                { name: '工期', value: getValueByKey(info, 'timeLimit') },
+                { name: '投标担保金额', value: getValueByKey(info, 'tenderGuaranteeAmount') },
+                { name: '质量承诺', value: getValueByKey(info, 'qualityCommitment') },
+                { name: '投标担保方式', value: getValueByKey(info, 'tenderGuaranteeMethod') },
+
+                { name: '造价软件品牌', value: '纵横公路云造价' },
+                { name: '造价软件版本', value: "Ver" + VERSION },
+                { name: '造价软件加密锁编号', value: userID },
+                { name: '计算机硬件信息', value: cpuId + diskId + macId }
             ];
             Element.call(this, '投标信息', attrs);
         }
@@ -282,14 +286,13 @@ INTERFACE_EXPORT = (() => {
             recursiveAddBills(AItem.nextSibling, AXMLParent);
         }
 
-        // 清单表
-        function createGCLQDB(tenderData, gongCLQDB){
-            vTree = tenderDetailMap[tenderData.ID].mainTree;
+        function createGCLQDB(Bid, gongCLQDB){
+            vTree = tenderDetailMap[Bid.ID].mainTree;
             serialNo = 0;
             recursiveAddBills(vTree.roots[0].children[0], gongCLQDB);
         };
 
-        function createJiRGXXB(tenderData, jiRGXXB){
+        function createJiRGXXB(Bid, jiRGXXB){
             let vJRG, vKind, vChild;
             let vJRGNode, vKindNode, vChildNode;
 
@@ -344,7 +347,7 @@ INTERFACE_EXPORT = (() => {
 
         }
 
-        function createZaoJHZB(tenderData, ZaoJHZB) {
+        function createZaoJHZB(Bid, ZaoJHZB) {
             const map_ZC_LB = [
                 {key: '第100章至700章清单', zc: '', lb: '1'},
                 {key: '已包含在清单合计中的材料', zc: '', lb: '2'},
@@ -399,8 +402,8 @@ INTERFACE_EXPORT = (() => {
             };
         }
 
-        function createRenCJHZ(tenderData, RenCJHZ) {
-            const pGLJs = tenderDetailMap[tenderData.ID].projectGLJ.datas.gljList;
+        function createRenCJHZ(Bid, RenCJHZ) {
+            const pGLJs = tenderDetailMap[Bid.ID].projectGLJ.datas.gljList;
             for (let i = 0; i < pGLJs.length; i++){
                 let pGLJ = pGLJs[i];
                 let attrs = [
@@ -424,16 +427,15 @@ INTERFACE_EXPORT = (() => {
             }
         }
 
-
         // 生成标段工程
-        function createGLBDGC(tenderData, gongLGCSJ, gongLGCHZ, Num){
+        function createGLBDGC(Bid, gongLGCSJ, gongLGCHZ, Num){
             let attrs0 = [
                 { name: '序号', value: Num },
-                { name: '标段名称', value: tenderData.name },
-                { name: '金额', value: projectData.summaryInfo[tenderData.ID].totalCost }
+                { name: '标段名称', value: Bid.name },
+                { name: '金额', value: projectData.summaryInfo[Bid.ID].totalCost }
             ];
 
-            const attrs1 = [{ name: '唯一标识-Guid', value: tenderData._id }];           // 公路标段工程
+            const attrs1 = [{ name: '唯一标识-Guid', value: Bid._id }];           // 公路标段工程
             const gongLBDGC = new CreateNode('公路标段工程', attrs0.concat(attrs1));
             gongLGCSJ.children.push(gongLBDGC);
             const gongCLQDB = new CreateNode('工程量清单表');
@@ -442,10 +444,10 @@ INTERFACE_EXPORT = (() => {
             const RenCJHZ = new CreateNode('人材机汇总');
             gongLBDGC.children = [gongCLQDB, jiRGXXB, ZaoJHZB, RenCJHZ];
 
-            createGCLQDB(tenderData, gongCLQDB);
-            createJiRGXXB(tenderData, jiRGXXB);
-            createZaoJHZB(tenderData, ZaoJHZB);
-            createRenCJHZ(tenderData, RenCJHZ);
+            createGCLQDB(Bid, gongCLQDB);
+            createJiRGXXB(Bid, jiRGXXB);
+            createZaoJHZB(Bid, ZaoJHZB);
+            createRenCJHZ(Bid, RenCJHZ);
 
             // 同步生成 公路工程汇总明细 数据
             const attrs2 = [{ name: '备注', value: '' }];
@@ -455,29 +457,26 @@ INTERFACE_EXPORT = (() => {
 
         // 组装主体框架数据
         function setupConstruction() {
-            const information = projectData.property && projectData.property.basicInformation || [];
-            const summaryInfo = projectData.summaryInfo[projectData.ID];
-
             const chiZGLGC = new CreateNode('池州公路工程');
-            const gongCXX = new GongCXX(information);   // 工程信息
+            const gongCXX = new GongCXX();   // 工程信息
             const zhaoTBXX = new CreateNode('招投标信息');
             const gongLGCSJ = new CreateNode('公路工程数据');
             chiZGLGC.children = [gongCXX, zhaoTBXX, gongLGCSJ];
 
             if (isBidInvitation)
-                zhaoTBXX.children.push(new ZhaoBiaoXx(information));
+                zhaoTBXX.children.push(new ZhaoBiaoXX());
             else if (isControl)
-                zhaoTBXX.children.push(new ZhaoBiaoKzXx(information, summaryInfo.totalCost));
+                zhaoTBXX.children.push(new ZhaoBiaoKZJ());
             else
-                zhaoTBXX.children.push(new TouBiaoXx(information, summaryInfo.totalCost));
+                zhaoTBXX.children.push(new TouBiaoXX());
 
             const gongLGCHZ = new CreateNode('公路工程汇总');
             gongLGCSJ.children.push(gongLGCHZ);
 
             let n = 0;
-            for (const tenderData of projectData.children) {
+            for (const Bid of projectData.children) {
                 n++;
-                createGLBDGC(tenderData, gongLGCSJ, gongLGCHZ, n);
+                createGLBDGC(Bid, gongLGCSJ, gongLGCHZ, n);
             }
             gongLGCSJ.children.push(gongLGCSJ.children.shift());
 

+ 13 - 13
web/building_saas/standard_interface/export/anhui_maanshan.js

@@ -48,7 +48,7 @@ INTERFACE_EXPORT = (() => {
     // 节点定义--------------------------------
 
     const subArea = areaKey.split('@')[1];
-
+    
     // 建设项目基本信息
     function JingJiBiao(projectName, information) {
       const taxModeMap = {
@@ -65,11 +65,11 @@ INTERFACE_EXPORT = (() => {
         { name: 'Xmmc', value: projectName }, // 项目名称
         { name: 'Bzlx', value: '清单' }, // 项目编制类型
         { name: 'Jjyj', value: '【18清单】2018部颁清单计价依据' }, // 计价依据
-        { name: 'Xmqzzh', value: getValueByKey(information, 'startAndChainages') }, // 项目起止桩号
+        { name: 'Xmqzzh', value: getValueByKey(information, 'startEndChainages') }, // 项目起止桩号
         { name: 'Jsdw', value: getValueByKey(information, 'constructingUnits') }, // 建设单位
         { name: 'Czzt', value: czzt[exportKind] }, // 操作状态:招标、投标、招标控制,即导出接口时,所选的文件类型
         { name: 'Jsfs', value: taxModeMap[getValueByKey(information, 'taxMode')] || '1', type: TYPE.INT }, // 计税方式,默认1。1=一般计税 2=简易计税
-        { name: 'Version', value: ['淮北', '铜陵'].includes(subArea) ? '1.1' : '1.0' },
+        { name: 'Version', value: ['淮北', '铜陵', '毫州'].includes(subArea) ? '1.1' : '1.0' },
       ];
       Element.call(this, 'JingJiBiao', attrs);
     }
@@ -82,10 +82,10 @@ INTERFACE_EXPORT = (() => {
         { name: 'Zxr', value: getValueByKey(information, 'costConsultant') }, // 造价咨询人
         { name: 'ZbrDb', value: getValueByKey(information, 'tenderAuthorizer') }, // 招标人法定代表人或其授权人
         { name: 'ZxrDb', value: getValueByKey(information, 'consultantAuthorizer') }, // 造价咨询人法定代表人或其授权人
-        { name: 'Bzr', value: getValueByKey(information, 'tenderCompiler') }, // 编制人
-        { name: 'Fhr', value: getValueByKey(information, 'tenderExaminer') }, // 复核人
-        { name: 'BzTime', value: getValueByKey(information, 'compilationTime'), type: TYPE.DATE }, // 编制时间
-        { name: 'FhTime', value: getValueByKey(information, 'reviewTime'), type: TYPE.DATE }, // 复核时间
+        { name: 'Bzr', value: getValueByKey(information, 'compileApprover') }, // 编制人
+        { name: 'Fhr', value: getValueByKey(information, 'reviewApprover') }, // 复核人
+        { name: 'BzTime', value: getValueByKey(information, 'compileDate'), type: TYPE.DATE }, // 编制时间
+        { name: 'FhTime', value: getValueByKey(information, 'reviewDate'), type: TYPE.DATE }, // 复核时间
       ];
       // 额外字段
       const extraMap = {
@@ -115,10 +115,10 @@ INTERFACE_EXPORT = (() => {
         { name: 'Zxr', value: getValueByKey(information, 'costConsultant') }, // 造价咨询人
         { name: 'ZbrDb', value: getValueByKey(information, 'tenderAuthorizer') }, // 招标人法定代表人或其授权人
         { name: 'ZxrDb', value: getValueByKey(information, 'consultantAuthorizer') }, // 造价咨询人法定代表人或其授权人
-        { name: 'Bzr', value: getValueByKey(information, 'tenderCompiler') }, // 编制人
-        { name: 'Fhr', value: getValueByKey(information, 'tenderExaminer') }, // 复核人
-        { name: 'BzTime', value: getValueByKey(information, 'compilationTime'), type: TYPE.DATE }, // 编制时间
-        { name: 'FhTime', value: getValueByKey(information, 'reviewTime'), type: TYPE.DATE }, // 复核时间
+        { name: 'Bzr', value: getValueByKey(information, 'compileApprover') }, // 编制人
+        { name: 'Fhr', value: getValueByKey(information, 'reviewApprover') }, // 复核人
+        { name: 'BzTime', value: getValueByKey(information, 'compileDate'), type: TYPE.DATE }, // 编制时间
+        { name: 'FhTime', value: getValueByKey(information, 'reviewDate'), type: TYPE.DATE }, // 复核时间
         { name: 'Zbkzj', value: totalCost, type: TYPE.DECIMAL }, // 控制价总价(元),取“投标报价”的金额。
       ];
       // 额外字段
@@ -148,8 +148,8 @@ INTERFACE_EXPORT = (() => {
         { name: 'Zbr', value: getValueByKey(information, 'tendereeName') }, // 招标人
         { name: 'Tbr', value: getValueByKey(information, 'bidder') }, // 投标人
         { name: 'TbrDb', value: getValueByKey(information, 'bidderAuthorizer') }, // 投标人法定代表或其授权
-        { name: 'Bzr', value: getValueByKey(information, 'tenderCompiler') }, // 编制人
-        { name: 'BzTime', value: getValueByKey(information, 'compilationTime'), type: TYPE.DATE }, // 编制时间
+        { name: 'Bzr', value: getValueByKey(information, 'compileApprover') }, // 编制人
+        { name: 'BzTime', value: getValueByKey(information, 'compileDate'), type: TYPE.DATE }, // 编制时间
         { name: 'Tbzj', value: totalCost, type: TYPE.DECIMAL }, // 控制价总价(元),取“投标报价”的金额。
       ];
       // 额外字段

+ 26 - 1
web/building_saas/standard_interface/export/base.js

@@ -57,6 +57,8 @@ const INTERFACE_EXPORT_BASE = (() => {
 
   // 缓存项 不需要的时候需要清空
   const _cache = {
+    // 错误提示列表
+    failList: [],
     // 项目数据(不包含详细数据,项目管理数据)
     projectData: {},
     // 当前导出类型,默认投标
@@ -79,6 +81,7 @@ const INTERFACE_EXPORT_BASE = (() => {
   }
   // 清空缓存项
   function clear() {
+    _cache.failList = [];
     _cache.projectData = {};
     _cache.exportKind = EXPORT_KIND.BID_SUBMISSION;
     _cache.tenderDetailMap = {};
@@ -155,6 +158,10 @@ const INTERFACE_EXPORT_BASE = (() => {
    * */
   function check(datas) {
     for (const data of datas) {
+      // 错误提示
+      if (data.fail && data.fail.hint) {
+        _cache.failList.push(data.fail);
+      }
       const isHasValue = hasValue(data.value);
       // 值统一转换成String,并且处理各类型属性空值时的默认取值
       data.value = !isHasValue ?
@@ -643,6 +650,23 @@ const INTERFACE_EXPORT_BASE = (() => {
       .join('');
   }
 
+  // 将错误提示数据进行分类处理
+  function transformFailList(failList) {
+    const grouped = _.groupBy(failList, 'type');
+    const rst = [];
+    Object
+      .entries(grouped)
+      .forEach(([type, items]) => {
+        if (type) {
+          rst.push(`<span style="font-weight: bold">${type}:</span>`);
+        }
+        items.forEach(({ hint }) => {
+          rst.push(hint);
+        });
+      });
+    return rst;
+  }
+
   const UTIL = Object.freeze({
     hasValue,
     setTimeoutSync,
@@ -668,7 +692,8 @@ const INTERFACE_EXPORT_BASE = (() => {
     getParsedData,
     setupCode,
     getHan,
-    getNowFormatTime
+    getNowFormatTime,
+    transformFailList,
   });
 
   // 开始标签

+ 110 - 59
web/building_saas/standard_interface/export/guangdong_zhongshan.js

@@ -92,6 +92,29 @@ INTERFACE_EXPORT = (() => {
     '安拆辅助费':1
   }
 
+  const RoadGradeMap = {
+    "高速公路": "0",
+    "一级公路": "1",
+    "二级公路": "2",
+    "三级公路": "3",
+    "四级公路": "4",
+    "等外公路": "5",
+    "独立桥梁": "6",
+    "独立隧道": "7"
+  }
+
+  const sectionNameMap = {
+    "清单 第100章 总则": true,
+    "清单 第200章 路基": true,
+    "清单 第300章 路面": true,
+    "第400章 桥梁、涵洞工程": true,
+    "第500章 隧道": true,
+    "第600章 交通安全设施": true,
+    "第700章 绿化及环境保护设施": true,
+    "第800章 机电工程": true,
+    "第900章 附属区房建工程":true
+  }
+
   function getBasePrice(projectGLJID, tenderProject) {
     let glj = _.find(tenderProject.projectGLJ.datas.gljList, {
       id: projectGLJID
@@ -744,9 +767,11 @@ INTERFACE_EXPORT = (() => {
       let feature = tenderProject.property.projectFeature ? tenderProject.property.projectFeature : [];
       let totalItem = null;
       let proItem = null; //暂列金额项
+      let safeItem = null;
       for (let b of bills) {
         if (b.flagsIndex && b.flagsIndex.fixed && b.flagsIndex.fixed.flag == fixedFlag.TOTAL_COST) totalItem = b;
         if (b.flagsIndex && b.flagsIndex.fixed && b.flagsIndex.fixed.flag == fixedFlag.PROVISIONAL) proItem = b;
+        if(b.code == "102-3" && b.name=="安全生产费") safeItem = b;
       }
 
       const attrs = [{
@@ -758,8 +783,11 @@ INTERFACE_EXPORT = (() => {
           value: totalItem.feesIndex && totalItem.feesIndex.common && totalItem.feesIndex.common.tenderTotalFee ? totalItem.feesIndex.common.tenderTotalFee : 0,
         },
       ];
+      //输出控制价、投标文件时,取调价后的标段总造价。
+      //输出招标文件时,取0
+      if (isBidInvitation) attrs[1].value = 0;
       Element.call(this, "EprjInfo", attrs);
-      this.children.push(new SummaryOfCost(totalItem, proItem,feature));
+      this.children.push(new SummaryOfCost(totalItem, proItem,safeItem,feature));
       this.children.push(new MakeInfo(tenderProject));
       this.children.push(new Params(tenderProject));
       this.children.push(new getBillsItems(tenderProject));
@@ -884,15 +912,29 @@ INTERFACE_EXPORT = (() => {
         }
         list.push(item);
 
+        function getCalcType(node) {
+          /*           
+          判断是否父项:
+           是父项,则取1;
+          是叶子项,则判断其下有无套定额/量价/工料机:
+                有则取1;
+                无则判断有无基数计算:
+               有则取2;
+               无则取3 */
+          if (node.children && node.children.length > 0) {
+            return 1; //是父项,则取1, 有套定额/量价/工料机,也取1
+          } else {
+            return node.data.calcBase && node.data.calcBase != "" ? 2 : 3
+          }
+        }
+
         function bill(bNode, level) {
           let data = bNode.data;
           let CostKind = 3;
           if (data.name.indexOf("安全生产费") != -1) CostKind = 1;
           if (data.name.indexOf("暂列金额") != -1) CostKind = 2;
           //1 = 工程量×综合单价;2 = 计算基数×费率;3 = 工程量×单价。
-          let CalcType = 2;
-          if (data.calcFlag == 2) CalcType = 3;
-          if (data.calcFlag == 1) CalcType = 1;
+          let CalcType = getCalcType(bNode);
           //取暂估价类型。读取造价书界面的专项暂定列。0=材料暂估价,1=工程设备暂估价,2=专业工程暂估价,没有选的输出为空。
           let ProvisionalType = "";
           if (data.specialProvisional == "材料") ProvisionalType = 0;
@@ -909,6 +951,7 @@ INTERFACE_EXPORT = (() => {
             if (data.quantityCoe["machine"]) MechRatio = data.quantityCoe["machine"];
           }
 
+          //fail: { hint: '错误提示', type: '提示所属(基本就是单位工程名称)' }
           const attrs = [{
               name: "ListCode",
               value: data.code,
@@ -995,7 +1038,7 @@ INTERFACE_EXPORT = (() => {
             },
             {
               name: "FomulaCode",
-              value: "",
+              value: ""
             },
           ];
 
@@ -1202,18 +1245,18 @@ INTERFACE_EXPORT = (() => {
           function CostStructure(item) {
             let CostStructure = new emptyElement('CostStructure');
             for (let f of cpFeeTypes) {
-              if (item.feesIndex && item.feesIndex[f.type] && itemFeeMap[f.type]) CostStructure.children.push(new CostItem(item.feesIndex[f.type]));
+              if(itemFeeMap[f.type]) CostStructure.children.push(new CostItem(item,f.type))
             }
-
-            function CostItem(fee) {
+            if (CostStructure.children.length == 0) CostStructure.children.push(new CostItem({},""))
+            function CostItem(item,type) {
               const attrs = [{
                 name: "ItemNo",
-                value: itemFeeMap[fee.fieldName],
+                value: itemFeeMap[type],
               }, {
                 name: 'Sum',
                 value: 0 //fee.tenderTotalFee
               }]
-              if (isBidSubmission) attrs[1].value = fee.tenderTotalFee;
+              if (isBidSubmission && item.feesIndex && item.feesIndex[type]) attrs[1].value = item.feesIndex[type].tenderTotalFee;
               Element.call(this, "CostItem", attrs);
             }
             return CostStructure;
@@ -1227,37 +1270,45 @@ INTERFACE_EXPORT = (() => {
     function Params(tenderProject) {
       let feature = tenderProject.property.projectFeature ? tenderProject.property.projectFeature : [];
       let featrueMap = {};
+      let baseMap = {};
       for (let f of feature) {
-        featrueMap[f.dispName] = f;
+        featrueMap[f.key] = f;
       }
+      let baseInfo = _.find(tenderProject.property.basicInformation, {
+        dispName: "基本信息",
+      });
+      for (let i of baseInfo.items) {
+        let key = i.key;
+        //if (i.dispName == "编制日期") key = "编制时间";
+        baseMap[key] = i;
+      }
+
+
       let BuildType = "";
-      if (featrueMap["建设性质"] == 0) BuildType = "新建";
-      if (featrueMap["建设性质"] == 1) BuildType = "改(扩)建";
+      if (baseMap["natureConstruction"].value == "新建") BuildType = 0;
+      if (baseMap["natureConstruction"].value == "改扩建") BuildType = 1;
       let Terrain = "";
-      if (featrueMap["地形类别"] == 0) Terrain = "平原微丘陵区";
-      if (featrueMap["地形类别"] == 1) Terrain = "山岭重丘陵区";
-      let DesignSpeed = "";
-      if (featrueMap["设计时速"] == 0) DesignSpeed = "高速公路";
-      if (featrueMap["设计时速"] == 1) DesignSpeed = "一级公路";
-      if (featrueMap["设计时速"] == 2) DesignSpeed = "二级公路";
-      if (featrueMap["设计时速"] == 3) DesignSpeed = "三级公路";
-      if (featrueMap["设计时速"] == 4) DesignSpeed = "四级公路";
+      if (baseMap["terrainCategory"].value == "平原微丘") Terrain = 0;
+      if (baseMap["terrainCategory"].value == "山岭重丘") Terrain = 1;
+      let DesignSpeed = featrueMap["designSpeed"].value;
       let Structure = "";
-      if (featrueMap["路面结构"] == 0) Structure = "沥青路面";
-      if (featrueMap["路面结构"] == 1) Structure = "水泥混凝土路面";
-      if (featrueMap["路面结构"] == 2) Structure = "其他类型路面";
+      if (featrueMap["pavementStructure"].value == "沥青路面") Structure = 0;
+      if (featrueMap["pavementStructure"].value == "水泥混凝土路面") Structure = 1;
+      if (featrueMap["pavementStructure"].value == "其他类型路面") Structure = 2;
+      let RoadGrade = "";
+      if (RoadGradeMap[baseMap["roadGrade"].value]) RoadGrade = RoadGradeMap[baseMap["roadGrade"].value];
 
       const attrs = [{
           name: "PrjArea",
-          value: featrueMap["工程所在地"] ? featrueMap["工程所在地"].value : "",
+          value: baseMap["location"] ? baseMap["location"].value : "",
         },
         {
           name: "StartPileNo",
-          value: featrueMap["起点桩号"] ? featrueMap["起点桩号"].value : "",
+          value: baseMap["startChainages"] ? baseMap["startChainages"].value : "",
         },
         {
           name: "EndPileNo",
-          value: featrueMap["终点桩号"] ? featrueMap["终点桩号"].value : "",
+          value: baseMap["endChainages"] ? baseMap["endChainages"].value : "",
         },
         {
           name: "BuildType",
@@ -1269,7 +1320,7 @@ INTERFACE_EXPORT = (() => {
         },
         {
           name: "RoadGrade",
-          value: featrueMap["公路等级"] ? featrueMap["公路等级"].value : "",
+          value: RoadGrade,
         },
         {
           name: "DesignSpeed",
@@ -1281,41 +1332,41 @@ INTERFACE_EXPORT = (() => {
         },
         {
           name: "SubgradeWidth",
-          value: featrueMap["路基宽度"] ? featrueMap["路基宽度"].value : "",
+          value: featrueMap["subgradeWidth"] ? featrueMap["subgradeWidth"].value : "",
         },
         {
           name: "RoadLength",
-          value: featrueMap["路线长度"] ? featrueMap["路线长度"].value : "",
+          value: featrueMap["roadLength"] ? featrueMap["roadLength"].value : "",
         },
         {
           name: "BridgeLength",
-          value: featrueMap["桥梁长度"] ? featrueMap["桥梁长度"].value : "",
+          value: featrueMap["bridgeLength"] ? featrueMap["bridgeLength"].value : "",
         },
         {
           name: "TunnelLength",
-          value: featrueMap["隧道长度"] ? featrueMap["隧道长度"].value : "",
+          value: featrueMap["tunnelLength"] ? featrueMap["tunnelLength"].value : "",
         },
         {
           name: "BriTunRate",
-          value: featrueMap["桥隧比"] ? featrueMap["桥隧比"].value : "",
+          value: featrueMap["briTunRate"] ? featrueMap["briTunRate"].value : "",
         },
         {
           name: "InterchangeNum",
-          value: featrueMap["互通式立交数"] ? featrueMap["互通式立交数"].value : "",
+          value: featrueMap["interchangeNum"] ? featrueMap["interchangeNum"].value : "",
         },
         {
           name: "StubLengths",
-          value: featrueMap["支线、联络线长度"] ? featrueMap["支线、联络线长度"].value : "",
+          value: featrueMap["stubLengths"] ? featrueMap["stubLengths"].value : "",
         },
         {
           name: "LaneLength",
-          value: featrueMap["辅道、连接线长度"] ? featrueMap["辅道、连接线长度"].value : "",
+          value: featrueMap["laneLength"] ? featrueMap["laneLength"].value : "",
         },
       ];
       Element.call(this, "Params", attrs);
     }
 
-    function SummaryOfCost(totalItem, proItem,feature) {
+    function SummaryOfCost(totalItem, proItem,safeItem,feature) {
       let attrs = [{
           name: "TenderSumLimit",
           value: totalItem.feesIndex && totalItem.feesIndex.common && totalItem.feesIndex.common.tenderTotalFee ? totalItem.feesIndex.common.tenderTotalFee : 0,
@@ -1330,7 +1381,7 @@ INTERFACE_EXPORT = (() => {
         },
         {
           name: "CostForHSE",
-          value: 0,
+          value: safeItem&&safeItem.feesIndex && safeItem.feesIndex.common && safeItem.feesIndex.common.tenderTotalFee ? safeItem.feesIndex.common.tenderTotalFee : 0,
         },
         {
           name: "ProvisionalSums",
@@ -1344,7 +1395,7 @@ INTERFACE_EXPORT = (() => {
       if(isBidInvitation) attrs = [] //招标
       if (isControl) attrs.splice(1, 5); //控制价
       if (isBidSubmission) { //投标文件时,读工程特征中的 招标控制价 值
-        let tenderSumLimit = _.find(feature, { "dispName": "招标控制价" }); 
+        let tenderSumLimit = _.find(feature, { "key": "tenderSumLimit" }); 
         if(tenderSumLimit) attrs[0].value = tenderSumLimit.value
       } 
       Element.call(this, "SummaryOfCost", attrs);
@@ -1357,8 +1408,8 @@ INTERFACE_EXPORT = (() => {
         dispName: "基本信息",
       });
       for (let i of baseInfo.items) {
-        let key = i.dispName;
-        if (i.dispName == "编制日期") key = "编制时间";
+        let key = i.key;
+        //if (i.dispName == "编制日期") key = "编制时间";
         baseMap[key] = i;
       }
 
@@ -1368,71 +1419,71 @@ INTERFACE_EXPORT = (() => {
         },
         {
           name: "Manage",
-          value: baseMap["建设单位"] ? baseMap["建设单位"].value : "",
+          value: baseMap["constructingUnit"] ? baseMap["constructingUnit"].value : "",
         },
         {
           name: "Designer",
-          value: baseMap["设计单位"] ? baseMap["设计单位"].value : "",
+          value: baseMap["designUnit"] ? baseMap["designUnit"].value : "",
         },
         {
           name: "Compile",
-          value: baseMap["编制单位"] ? baseMap["编制单位"].value : "",
+          value: baseMap["compileUnit"] ? baseMap["compileUnit"].value : "",
         },
         {
           name: "CompileApprover",
-          value: baseMap["编制人"] ? baseMap["编制人"].value : "",
+          value: baseMap["compileApprover"] ? baseMap["compileApprover"].value : "",
         },
         {
           name: "CompileCertNo",
-          value: baseMap["编制人证书号"] ? baseMap["编制人证书号"].value : "",
+          value: baseMap["compileCertNo"] ? baseMap["compileCertNo"].value : "",
         },
         {
           name: "CompileDate",
-          value: baseMap["编制时间"] ? baseMap["编制时间"].value : "",
+          value: baseMap["compileDate"] ? baseMap["compileDate"].value : "",
         },
         {
           name: "Review",
-          value: baseMap["复核单位"] ? baseMap["复核单位"].value : "",
+          value: baseMap["reviewUnit"] ? baseMap["reviewUnit"].value : "",
         },
         {
           name: "ReviewApprover",
-          value: baseMap["复核人"] ? baseMap["复核人"].value : "",
+          value: baseMap["reviewApprover"] ? baseMap["reviewApprover"].value : "",
         },
         {
           name: "ReviewCertNo",
-          value: baseMap["复核人证书"] ? baseMap["复核人证书"].value : "",
+          value: baseMap["reviewCertNo"] ? baseMap["reviewCertNo"].value : "",
         },
         {
           name: "ReviewDate",
-          value: baseMap["复核日期"] ? baseMap["复核日期"].value : "",
+          value: baseMap["reviewDate"] ? baseMap["reviewDate"].value : "",
         },
         {
           name: "Examine",
-          value: baseMap["审核单位"] ? baseMap["审核单位"].value : "",
+          value: baseMap["examineUnit"] ? baseMap["examineUnit"].value : "",
         },
         {
           name: "ExamineApprover",
-          value: baseMap["审核人"] ? baseMap["审核人"].value : "",
+          value: baseMap["examineApprover"] ? baseMap["examineApprover"].value : "",
         },
         {
           name: "ExamineCertNo",
-          value: baseMap["审核人证书"] ? baseMap["审核人证书"].value : "",
+          value: baseMap["examineCertNo"] ? baseMap["examineCertNo"].value : "",
         },
         {
           name: "ExamineDate",
-          value: baseMap["审核日期"] ? baseMap["审核日期"].value : "",
+          value: baseMap["examineDate"] ? baseMap["examineDate"].value : "",
         },
         {
           name: "CompileExplain",
-          value: baseMap["编制说明"] ? baseMap["编制说明"].value : "",
+          value: baseMap["compileExplain"] ? baseMap["compileExplain"].value : "",
         },
         {
           name: "ExamineExplain",
-          value: baseMap["审核说明"] ? baseMap["审核说明"].value : "",
+          value: baseMap["examineExplain"] ? baseMap["examineExplain"].value : "",
         },
         {
           name: "ProjectExplain",
-          value: baseMap["工程说明"] ? baseMap["工程说明"].value : "",
+          value: baseMap["projectExplain"] ? baseMap["projectExplain"].value : "",
         },
       ];
       if (isControl || isBidInvitation) { //招标、招标控制价文件,则以下的8、12~18则不输出
@@ -1442,7 +1493,7 @@ INTERFACE_EXPORT = (() => {
       Element.call(this, "MakeInfo", attrs);
     }
 
-    let data = new CprjInfo(projectData.name);
+    let data = new CprjInfo(projectData.name); 
     data.children.push(new SystemInfo());
     data.children.push(new CostBasis());
     let seriNo = 1;

+ 16 - 1
web/building_saas/standard_interface/export/view.js

@@ -5,11 +5,13 @@
  * @date 2019/6/5
  * @version
  */
-//导出接口相关
+
+// 导出接口相关
 const EXPORT_VIEW = (() => {
   'use strict';
 
   const _base = INTERFACE_EXPORT_BASE;
+  const _util = _base.UTIL;
   const _cache = _base.CACHE;
   // 导出数据缓存,为了自检完后,再导出的时候不需要重新运行相关提取程序。(暂时取消了自检,但还是留着这个缓存机制)
   let _exportCache = [];
@@ -23,6 +25,12 @@ const EXPORT_VIEW = (() => {
     _exportCache = [];
     _cache.clear();
   }
+  // 设置提示高度样式
+  function setHeightByInfo(infos) {
+    if (infos.length > 20) {
+      $('#hintBox_caption').addClass('export-check');
+    }
+  }
   //事件监听
   function exportListener() {
     // 导出接口
@@ -52,6 +60,12 @@ const EXPORT_VIEW = (() => {
             const requestForSummaryInfo = INTERFACE_EXPORT.requestForSummaryInfo || null;
             const projectID = projectObj.project.ID();
             const exportData = await _base.extractExportData(INTERFACE_EXPORT.entry, requestForSummaryInfo, boqType, areaKey, projectID, userID);
+            const failList = _util.transformFailList(_cache.getItem('failList'));
+            if (failList.length) {
+              // 自检提示错误,打断导出
+              setHeightByInfo(failList);
+              throw failList.join('<br/>');
+            }
             _exportCache.push(...exportData);
           }
         }
@@ -64,6 +78,7 @@ const EXPORT_VIEW = (() => {
         console.log(err);
         alert(err);
       } finally {
+        _cache.setItem('failList', []);
         pr.end();
         setTimeout(() => {
           STATE.exporting = false;

+ 24 - 2
web/building_saas/standard_interface/import/anhui_maanshan.js

@@ -31,7 +31,7 @@ INTERFACE_IMPORT = (() => {
       const info = [
         { key: 'projNum', value: getValue(projectSrc, ['_Xmbh']) },
         { key: 'projType', value: getValue(projectSrc, ['_Bzlx']) },
-        { key: 'startAndChainages', value: getValue(projectSrc, ['_Xmqzzh']) },
+        { key: 'startEndChainages', value: getValue(projectSrc, ['_Xmqzzh']) },
         { key: 'constructingUnits', value: getValue(projectSrc, ['_Jsdw']) },
         { key: 'taxMode', value: getValue(projectSrc, ['_Jsfs']) },
         { key: 'tendereeName', value: getValue(projectSrc, ['ZhaoBiaoXx', '_Zbr']) },
@@ -190,6 +190,27 @@ INTERFACE_IMPORT = (() => {
       });
     }
 
+    // 提取人材机数据(暂估材料和评标材料)
+    function setupGLJSummary(tenderSrc) {
+      function gljRefMapFunc(glj) {
+        return {
+          seq: getValue(glj, ['_Xh']),
+          code: getValue(glj, ['_Bm']),
+          name: getValue(glj, ['_Mc']),
+          specs: getValue(glj, ['_Ggxh']),
+          unit: getValue(glj, ['_Dw']),
+          quantity: getValue(glj, ['_Sl']),
+          marketPrice: getValue(glj, ['_Dj']),
+          totalPrice: getValue(glj, ['_Hj']),
+          remark: getValue(glj, ['_Bz']),
+        };
+      }
+      return {
+        evaluationList: arrayValue(tenderSrc, ['ZgCl', 'ZgClMx']).map(gljRefMapFunc),
+        bidEvaluationList: arrayValue(tenderSrc, ['JpCl', 'JpClMx']).map(gljRefMapFunc),
+      };
+    }
+
     // 提取单位工程数据
     function setupTender(midSrc, tenderSrc) {
       //const feeRateSrc = getValue(tenderSrc, ['Qfxx']);
@@ -198,7 +219,8 @@ INTERFACE_IMPORT = (() => {
         name: getValue(tenderSrc, ['_Dwgcmc']),
         feature: setupFeature(midSrc, tenderSrc),
         //feeRate: setupFeeRate(feeRateSrc),
-        bills: setupBills(billsSrc)
+        bills: setupBills(billsSrc),
+        ...setupGLJSummary(tenderSrc),
       };
     }
 

+ 9 - 2
web/building_saas/standard_interface/import/base.js

@@ -232,7 +232,7 @@ const INTERFACE_EXPORT_BASE = (() => {
       const simpleName = bills.name ? bills.name.replace(/\s/g, '') : '';
       let matched;
       if (!parent) {
-        if (/100章至第700章|100章至700章/.test(simpleName)) {
+        if (/100章至第700章|100章至700章|100章至第900章|100章至900章/.test(simpleName)) {
           matched = target.find(bills => getFlag(bills) === fixedFlag.ONE_SEVEN_BILLS);
         } else if (/包含在清单合计中的材料、工程设备、专业工程暂估/.test(simpleName)) {
           matched = target.find(bills => getFlag(bills) === fixedFlag.PROVISIONAL_TOTAL);
@@ -247,7 +247,7 @@ const INTERFACE_EXPORT_BASE = (() => {
         }
       } else {
         const parentSimpleName = parent.name ? parent.name.replace(/\s/g, '') : '';
-        if (/100章至第700章|100章至700章/.test(parentSimpleName) && /100章总则/.test(simpleName)) {
+        if (/100章至第700章|100章至700章|100章至第900章|100章至900章/.test(parentSimpleName) && /100章总则/.test(simpleName)) {
           matched = target.find(bills => getFlag(bills) === fixedFlag.ONE_HUNDRED_BILLS);
         } else if (/计日工合计/.test(parentSimpleName) && /劳务/.test(simpleName)) {
           matched = target.find(bills => getFlag(bills) === fixedFlag.LABOUR_SERVICE);
@@ -366,6 +366,13 @@ const INTERFACE_EXPORT_BASE = (() => {
       };
       delete tender.feature;
       tender.bills = handleBills(tender.bills, _.cloneDeep(templateData.bills), tender.ID,); // 必须要拷贝一份,否则多单位工程情况下,前单位工程的清单数据会被后单位工程的覆盖
+      // 给暂估材料和评标材料设置项目数据
+      const setGLJRefFunc = glj => {
+        glj.ID = uuid.v1();
+        glj.projectID = tender.ID;
+      }
+      tender.evaluationList.forEach(setGLJRefFunc);
+      tender.bidEvaluationList.forEach(setGLJRefFunc);
     });
   }
 

+ 176 - 0
web/building_saas/standard_interface/import/guangdong_zhongshan.js

@@ -0,0 +1,176 @@
+/*
+ * @Descripttion: 安徽马鞍山导入接口
+ * @Author: vian
+ * @Date: 2020-09-09 11:51:15
+ */
+
+// INTERFACE_EXPORT =,必须这么写,这样才能在导入时动态加载脚本后,覆盖前端代码
+INTERFACE_IMPORT = (() => {
+  'use strict';
+  /**
+   * 
+   * @param {String} areaKey - 地区标识,如:'安徽@马鞍山',有些地区的接口只是取值上有不同,共有一个接口脚本, 需要通过地区标识确定一些特殊处理
+   * @param {Object} xmlObj - xml经过x2js转换后的xml对象
+   * @return {Object} - 返回的格式需要统一,具体参考函数内返回的内容。返回的内容会经过一系列的统一处理形成可入库的数据。
+   */
+  const RoadGradeMap = {
+    "0": "高速公路",
+    "1": "一级公路",
+    "2": "二级公路",
+    "3": "三级公路",
+    "4": "四级公路",
+    "5": "等外公路",
+    "6": "独立桥梁",
+    "7":"独立隧道"
+  }
+  
+  async function entry(areaKey, xmlObj) {
+    const {
+      UTIL: {
+        getValue,
+        arrayValue,
+        getBool,
+        extractItemsRecur,
+      }
+    } = INTERFACE_EXPORT_BASE;
+    let info = [];
+    let tenders = [];
+    let CprjInfo = getValue(xmlObj, ['CprjInfo']);
+    let EprjInfos = arrayValue(CprjInfo, ["EprjInfo"]);
+    if (EprjInfos.length > 0) { 
+      let MakeInfo = EprjInfos[0].MakeInfo;
+      let Params = EprjInfos[0].Params;
+      let BuildType = getValue(Params, ['_BuildType']);
+      let natureConstruction = "";
+      if (BuildType == "0") natureConstruction = "新建";
+      if (BuildType == "1") natureConstruction = "改扩建";
+
+      let terrainCategory = "";
+      let Terrain = getValue(Params, ['_Terrain']);
+      if (Terrain == "0") terrainCategory = "平原微丘";
+      if (Terrain == "1") terrainCategory = "山岭重丘";
+      let RoadGrade = getValue(Params, ['_RoadGrade']);
+      let roadGrade = "";
+      if (RoadGradeMap[RoadGrade]) roadGrade = RoadGradeMap[RoadGrade];
+
+      info = [
+        { key: 'constructingUnit', value: getValue(MakeInfo, ['_Manage']) },
+        { key: 'designUnit', value: getValue(MakeInfo, ['_Designer']) },
+        { key: 'compileUnit', value: getValue(MakeInfo, ['_Compile']) },
+        { key: 'compileApprover', value: getValue(MakeInfo, ['_CompileApprover']) },
+        { key: 'compileCertNo', value: getValue(MakeInfo, ['_CompileCertNo']) },
+        { key: 'compileDate', value: getValue(MakeInfo, ['_CompileDate']) },
+        { key: 'reviewUnit', value: getValue(MakeInfo, ['_Review']) },
+        { key: 'reviewApprover', value: getValue(MakeInfo, ['_ReviewApprover']) },
+        { key: 'reviewCertNo', value: getValue(MakeInfo, ['_ReviewCertNo']) },
+        { key: 'reviewDate', value: getValue(MakeInfo, ['_ReviewDate']) },
+        { key: 'startChainages', value: getValue(Params, ['_StartPileNo'])},
+        { key: 'endChainages', value: getValue(Params, ['_EndPileNo']) },  
+        { key: 'location', value: getValue(Params, ['_PrjArea']) },  
+        { key: 'natureConstruction', value: natureConstruction },  
+        { key: 'terrainCategory', value: terrainCategory },  
+        { key: 'roadGrade', value: roadGrade },  
+
+      ]
+      for (let t of EprjInfos) { 
+        tenders.push(setupTender(t))
+      }
+
+
+    }
+
+    function setupTender(EprjInfo) { 
+      let tender = {};
+      let Params = EprjInfo.Params;
+      let SummaryOfCost = EprjInfo.SummaryOfCost;
+      tender.name = EprjInfo._Name;
+      tender.bills = [];
+      tender.bidEvaluationList = [];
+      tender.evaluationList = [];
+      let ProvisionalSums = getValue(SummaryOfCost, ['_ProvisionalSums']);
+      let Structure = getValue(Params, ['_Structure']);
+      let pavementStructure = "";
+      if (Structure == "0") pavementStructure = "沥青路面";
+      if (Structure == "1") pavementStructure = "水泥混凝土路面";
+      if (Structure == "2") pavementStructure = "其他类型路面";
+      tender.feature = [
+        { key: 'tenderSumLimit', value: getValue(SummaryOfCost, ['_TenderSumLimit'])},//招标控制价
+        { key: 'designSpeed', value: getValue(Params, ['_DesignSpeed']) },// --todo
+        { key: 'pavementStructure', value: pavementStructure},// --todo
+        { key: 'subgradeWidth', value: getValue(Params, ['_SubgradeWidth']) },
+        { key: 'roadLength', value: getValue(Params, ['_RoadLength']) },// --todo
+        { key: 'bridgeLength', value: getValue(Params, ['_BridgeLength']) },
+        { key: 'tunnelLength', value: getValue(Params, ['_TunnelLength']) },// --todo
+        { key: 'briTunRate', value: getValue(Params, ['_BriTunRate']) },// --todo
+        { key: 'interchangeNum', value: getValue(Params, ['_InterchangeNum']) },// --todo
+        { key: 'stubLengths', value: getValue(Params, ['_StubLengths']) },// --todo
+        { key: 'laneLength', value: getValue(Params, ['_LaneLength']) },// --todo
+      ]
+      const items = arrayValue(EprjInfo, ['Items', 'Item']);
+      for (let i of items) {
+        let bill = setupBills(i);
+        if (bill.name == "暂列金额(不含计日工总额)") { 
+          bill.fees = [{ fieldName: "common",tenderTotalFee:ProvisionalSums, tenderUnitFee: "0", totalFee: ProvisionalSums, unitFee: "0" }];
+          bill.calcBase = ProvisionalSums;
+          bill.calcFlag = 1;
+        } 
+        tender.bills.push(bill);
+      }
+      const BidEvaluationMainMaterial = arrayValue(EprjInfo, ['BidEvaluationMainMaterial']);
+      for (let b of BidEvaluationMainMaterial) { 
+        tender.bidEvaluationList.push(setUpBidEvaluation(b))
+      }
+      
+      return tender;
+    }
+
+
+    function setupBills(item) { 
+      let bill = {
+        code: item._ListCode,
+        name: item._ListName,
+        unit: item._Unit,
+        quantity: item._Num,
+        remark: item._Remarks,
+        jobContentText: item._Content,
+        specialProvisional: '',
+        children: []
+      }
+      if (item._ProvisionalType == '0') bill.specialProvisional = '材料';
+      if (item._ProvisionalType == '1') bill.specialProvisional = '工程设备';
+      if (item._ProvisionalType == '2') bill.specialProvisional = '工程设备';
+      let subItems = arrayValue(item, ['Item']);
+      if (subItems && subItems.length > 0) { 
+        for (let i of subItems) { 
+          bill.children.push(setupBills(i))
+        }
+      }
+      return bill;
+    }
+
+    function setUpBidEvaluation(b) { 
+      return {
+        code: b._Code,
+        name: b._Name,
+        specs: b.Specification,
+        unit: b._Unit,
+        market_price: b._Price,
+        quantity: b._Quantity,
+        remark:b._Remark
+      }
+    }
+    
+
+    return {
+      name: CprjInfo._CprjName,
+      info,
+      tenders,
+    };
+
+  }
+
+  return {
+    entry
+  };
+
+})();

+ 7 - 7
web/common/html/header.html

@@ -41,13 +41,13 @@
             </li>
             <% if (!versionName.includes('学习')) {%>
             <li class="nav-item">
-              <a href="/user/buy" target="_blank">
-                  <% if (sessionUser.compilationDeadline !== '') { %>
-                  <img src="/web/building_saas/img/vip2.png" data-toggle="tooltip" data-placement="bottom" data-original-title="年限版用户">
-                  <% } else { %>
-                  <img src="/web/building_saas/img/vip.png" data-toggle="tooltip" data-placement="bottom" data-original-title="专业版用户">
-                  <% } %>
-              </a>
+                <a href="/user/buy" target="_blank">
+                    <% if (sessionUser.compilationLock === 1) { %>
+                    <img width="38" src="/web/building_saas/img/vip2.png" data-toggle="tooltip" data-placement="bottom" data-original-title="借用">
+                    <% } else if (sessionUser.compilationLock === 2) { %>
+                    <img width="38" src="/web/building_saas/img/vip.png" data-toggle="tooltip" data-placement="bottom" data-original-title="购买">
+                    <% } %>
+                </a>
             </li>
             <% } %>
             <% if (action === 'index' && controller === 'main') {%>

+ 4 - 0
web/over_write/js/shandong_2016.js

@@ -289,6 +289,10 @@ if (typeof gljUtil !== "undefined") {
     };
     return o_sortRationGLJ(list, false, TypeMap);
   };
+
+  gljUtil.getAssUsedPrice = function(g){//山东辅助生产人工费取市场价
+    return g.marketPrice;
+  }
 }
 
 //山东工地转移费率值修改特殊处理

+ 7 - 0
web/over_write/js/sichuan_2013.js

@@ -1,3 +1,10 @@
+if (typeof gljUtil !== "undefined") {
+  gljUtil.getAssUsedPrice = function(g){//四川辅助生产人工费取市场价
+    return g.marketPrice;
+  }
+}
+
+
 if (typeof module !== 'undefined') {
   module.exports = { 
       getDefalutAssistProductionFeeRate: function () {

+ 4 - 4
web/users/html/login-sms.html

@@ -35,10 +35,10 @@
                     <strong>登录失败</strong> <span id="message"></span>
                 </div>
             </div>
-            <div class="form-group">
-                <div id="captcha-box"></div>
-            </div>
-            <div class="form-group btn-area" style="display: none;">
+            <!--<div class="form-group">-->
+                <!--<div id="captcha-box"></div>-->
+            <!--</div>-->
+            <div class="form-group btn-area">
                 <button id="login" type="button" class="btn btn-primary btn-block">登录</button>
             </div>
         </form>

+ 4 - 4
web/users/html/login.html

@@ -46,10 +46,10 @@
                     <strong>登录失败</strong> <span id="message"></span>
                 </div>
             </div>
-            <div class="form-group">
-                <div id="captcha-box"></div>
-            </div>
-            <div class="form-group btn-area" style="display: none">
+            <!--<div class="form-group">-->
+                <!--<div id="captcha-box"></div>-->
+            <!--</div>-->
+            <div class="form-group btn-area">
                 <button type="button" id="login" class="btn btn-primary btn-block">登录</button>
             </div>
             <div class="pt-1 d-flex justify-content-between">

+ 23 - 22
web/users/html/user-buy.html

@@ -75,46 +75,47 @@
                             </div>
                             <div class="col-sm-5 mb-5">
                                 <div class="card pro-version">
-                                  <div class=" card-body">
-                                    <h3 class="card-title">
-                                      专业版
-                                        <img src="/web/building_saas/img/vip.png" data-toggle="tooltip" data-placement="bottom" data-original-title="专业版用户">
-                                        <img src="/web/building_saas/img/vip2.png" data-toggle="tooltip" data-placement="bottom" data-original-title="年限版用户">
-                                    </h3>
-                                      <!--<p class="card-text">-->
-                                      <!--<ul class="pl-3">
-                                          <li>创建单位工程无限制</li>
-                                          <li>报表无水印</li>
-                                      </ul>-->
-                                      <!--</p>-->
-                                  </div>
+                                    <div class="card-body d-flex justify-content-between">
+                                        <h3 class="card-title">专业版</h3>
+                                        <div>
+                                            <div class="d-inline-block mr-3">
+                                                <img width="24" src="/web/building_saas/img/vip.png">购买
+                                            </div>
+                                            <div class="d-inline-block">
+                                                <img width="24" src="/web/building_saas/img/vip2.png">借用
+                                            </div>
+                                        </div>
+                                        <!--<p class="card-text">-->
+                                        <!--&lt;!&ndash;<ul class="pl-3">-->
+                                        <!--<li>创建单位工程无限制</li>-->
+                                        <!--<li>报表无水印</li>-->
+                                        <!--</ul>&ndash;&gt;-->
+                                        <!--</p>-->
+                                    </div>
                                     <ul class="list-group list-group-flush">
                                         <% if (compilationList.length > 0) {%>
                                         <% compilationList.forEach(function(compilation) { %>
                                         <li class="list-group-item d-flex justify-content-between">
                                             <div class="col-6">
                                                 <%= compilation.name %>
-                                                <% if (compilation.isUpgrade !== undefined && compilation.isUpgrade === true && compilation.deadline !== undefined && compilation.deadline !== '') { %>
-                                                <img src="/web/building_saas/img/vip2.png" data-toggle="tooltip" data-placement="bottom" data-original-title="年限版用户">
-                                                <% } else if (compilation.isUpgrade !== undefined && compilation.isUpgrade === true && (compilation.deadline === undefined || compilation.deadline === '')) { %>
-                                                <img src="/web/building_saas/img/vip.png" data-toggle="tooltip" data-placement="bottom" data-original-title="专业版用户">
+                                                <% if (compilation.lock !== undefined && compilation.lock === 1) { %>
+                                                <img width="38" src="/web/building_saas/img/vip2.png" data-toggle="tooltip" data-placement="bottom" data-original-title="借用">
+                                                <% } else if (compilation.lock !== undefined && compilation.lock === 2) { %>
+                                                <img width="38" src="/web/building_saas/img/vip.png" data-toggle="tooltip" data-placement="bottom" data-original-title="购买">
                                                 <% } %>
                                             </div>
                                             <div class="ml-auto text-right">
                                                 <% if (compilation.isUpgrade === undefined || compilation.isUpgrade !== true) { %>
                                                 <a href="javascript:void(0);" class="btn btn-primary btn-sm getcategory" data-upgrade="<%= compilation.isUpgrade %>" data-category="<%= compilation.categoryID %>">立即激活</a>
+                                                <% if (compilation.deadline !== undefined && compilation.deadline !== '') { %><span class="d-block text-danger">已到期:<%= compilation.deadline %></span><% } %>
                                                 <% } else { %>
                                                 <a href="javascript:void(0);" class="btn btn-outline-secondary btn-sm getcategory" data-title="<%= compilation.name %>" data-upgrade="<%= compilation.isUpgrade %>" data-category="<%= compilation.categoryID %>"><i class="fa fa-check"></i> 已激活</a>
-                                                <% if (compilation.deadline !== undefined && compilation.deadline !== '') { %><span class="d-block text-muted">期:<%= compilation.deadline %></span><% } %>
+                                                <% if (compilation.deadline !== undefined && compilation.deadline !== '') { %><span class="d-block text-muted">期:<%= compilation.deadline %></span><% } %>
                                                 <% } %>
                                             </div>
                                         </li>
                                         <% }) %>
                                         <% } %>
-                                        <!--<li class="list-group-item d-flex justify-content-between">-->
-                                        <!--重庆(2015)-->
-                                        <!--<a class="btn btn-outline-secondary btn-sm" href="activ2" data-toggle="modal" data-target="#activ2"><i class="fa fa-check"></i> 已激活</a>-->
-                                        <!--</li>-->
                                     </ul>
                                 </div>
                             </div>

+ 154 - 102
web/users/js/login.js

@@ -9,42 +9,42 @@ $(document).ready(function () {
     let referer = scUrlUtil.GetQueryString('referer');
 
     // 载入时先获取相关参数
-    $.ajax({
-        url: '/captcha',
-        type: 'get',
-        data: '',
-        timeout: 5000,
-        error: function() {
-            $("#captcha-box").html('验证码加载失败');
-        },
-        beforeSend: function() {
-            $("#captcha-box").html('正在加载验证码');
-        },
-        success: function(response) {
-            $("#captcha-box").html('');
-            if (response.success === 0) {
-                alert('验证码初始化失败!');
-                return false;
-            }
+    // $.ajax({
+    //     url: '/captcha',
+    //     type: 'get',
+    //     data: '',
+    //     timeout: 5000,
+    //     error: function() {
+    //         $("#captcha-box").html('验证码加载失败');
+    //     },
+    //     beforeSend: function() {
+    //         $("#captcha-box").html('正在加载验证码');
+    //     },
+    //     success: function(response) {
+    //         $("#captcha-box").html('');
+    //         if (response.success === 0) {
+    //             alert('验证码初始化失败!');
+    //             return false;
+    //         }
+    //
+    //         initGeetest({
+    //             // 以下配置参数来自服务端 SDK
+    //             gt: response.gt,
+    //             challenge: response.challenge,
+    //             offline: !response.success,
+    //             new_captcha: response.new_captcha,
+    //             width: '100%'
+    //         }, handler);
+    //     }
+    // });
 
-            initGeetest({
-                // 以下配置参数来自服务端 SDK
-                gt: response.gt,
-                challenge: response.challenge,
-                offline: !response.success,
-                new_captcha: response.new_captcha,
-                width: '100%'
-            }, handler);
-        }
-    });
-
-    const handler = function(captchaObj) {
-        captchaObj.appendTo('#captcha-box');
-        captchaObj.onSuccess(function () {
-            $(".btn-area").slideDown("fast");
-            // $('#login').click();
-            // captchaObj.getValidate();
-        });
+    // const handler = function(captchaObj) {
+    //     captchaObj.appendTo('#captcha-box');
+    //     captchaObj.onSuccess(function () {
+    //         $(".btn-area").slideDown("fast");
+    //         // $('#login').click();
+    //         // captchaObj.getValidate();
+    //     });
 
         $("#login").click(function () {
             if (!valid()) {
@@ -53,14 +53,14 @@ $(document).ready(function () {
             if ($('#changeLogin').attr('data-status') === 'user') {
                 let account = $("#inputEmail").val();
                 if(/^1[3456789]\d{9}$/.test(account) || /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(account)) {
-                    login(captchaObj);
+                    login();
                 } else {
                     $('#emailHelp').text('您输入的 邮箱/手机 格式不对');
                 }
             } else {
                 let account = $("#mobileLogin").val();
                 if(/^1[3456789]\d{9}$/.test(account)) {
-                    login(captchaObj);
+                    login();
                 } else {
                     $('#phoneHelp').text('您输入的 手机 格式不对');
                 }
@@ -142,7 +142,7 @@ $(document).ready(function () {
                 }
             })
         });
-    };
+    // };
 
     $("input").blur(function () {
         cleanError();
@@ -265,73 +265,125 @@ $(document).ready(function () {
     });
 });
 
-function login(captchaObj) {
-    $('#login').attr('disabled', true);
-    let geetest_challenge = $('input[name="geetest_challenge"]').val();
-    let geetest_validate = $('input[name="geetest_validate"]').val();
-    let geetest_seccode = $('input[name="geetest_seccode"]').val();
+function login() {
+    $.ajax({
+        url: '/captcha?t='+ (new Date()).getTime(),
+        type: 'get',
+        dataType: 'json',
+        timeout: 5000,
+        error: function() {
+            // $("#captcha-box").html('验证码加载失败');
+        },
+        beforeSend: function() {
+            // $("#captcha-box").html('正在加载验证码');
+        },
+        success: function(response) {
+            // $("#captcha-box").html('');
+            if (response.success === 0) {
+                alert('验证码初始化失败!');
+                return false;
+            }
 
-    const postData = {
-        geetest_challenge: geetest_challenge,
-        geetest_validate: geetest_validate,
-        geetest_seccode: geetest_seccode,
-    };
-    if ($('#changeLogin').attr('data-status') === 'user') {
-        let account = $("#inputEmail").val();
-        let pw = $("#inputPassword").val();
-        postData.account = account;
-        postData.pw = pw;
-    } else {
-        let mobile = $('#mobileLogin').val();
-        let code = $("#codeLogin").val();
-        postData.mobile = mobile;
-        postData.code = code;
-    }
+            initGeetest({
+                // 以下配置参数来自服务端 SDK
+                gt: response.gt,
+                challenge: response.challenge,
+                offline: !response.success,
+                new_captcha: response.new_captcha,
+                // width: '100%',
+                product: "bind"
+            }, function (catpchaObj) {
+                catpchaObj.onReady(function () {
+                    catpchaObj.verify();
+                }).onClose(function () {
+                }).onSuccess(function () {
+                    /* 延迟到动画结束后再alert */
+                    var lastUTC = new Date(), duration = 1100;
 
-    $.ajax({
-        url: '/login',
-        type: 'post',
-        data: postData,
-        success: function (response) {
-            if (response.error === 0) {
-                // $('#phonepass').modal('hide');
-                const url = response.last_page !== null && response.last_page !== undefined && response.last_page !== '' ?
-                    response.last_page : '/pm';
-                if (response.login_ask === 0) {
-                    location.href = url;
-                } else {
-                    response.compilation_list = response.compilation_list === undefined || response.compilation_list === '' ?
-                        null : JSON.parse(response.compilation_list);
-                    if (response.compilation_list === null || response.compilation_list.length <= 0) {
-                        location.href = url;
-                        return false;
+                    function _alert(msg) {
+                        var elapsed = new Date() - lastUTC;
+                        if (elapsed >= duration) {
+                            return alert(msg)
+                        }
+                        setTimeout(function () {
+                            alert(msg)
+                        }, duration - elapsed);
                     }
-                    console.log(response.compilation_list);
-                    setVersion(response.compilation_list);
-                    $('#ver').modal('show');
-                }
-            } else if(response.error === 2) {
-                // $('#phonepass').modal('hide');
-                // captchaObj.reset();
-                $('#check_ssoId').val(response.ssoId);
-                $('#phone').modal('show');
-                $('#login').removeAttr('disabled');
-            } else if(response.error === 3) {
-                // captchaObj.reset();
-                $('#phonepass').modal('show');
-                $('#mobileLogin').val(response.data);
-                $('#login').removeAttr('disabled');
-            } else {
-                // $('#phonepass').modal('hide');
-                let msg = response.msg !== undefined ? response.msg : '未知错误';
-                showError(msg, $("input"));
-                $('#login').removeAttr('disabled');
-                // captchaObj.reset();
-            }
-        },
-        error: function (result) {
-            showError('内部程序错误', null);
-            $('#login').removeAttr('disabled');
+
+                    var result = catpchaObj.getValidate();
+                    if (!result) {
+                        return alert('请完成验证');
+                    }
+                    $('#login').attr('disabled', true);
+                    // let geetest_challenge = $('input[name="geetest_challenge"]').val();
+                    // let geetest_validate = $('input[name="geetest_validate"]').val();
+                    // let geetest_seccode = $('input[name="geetest_seccode"]').val();
+
+                    const postData = {
+                        geetest_challenge: result.geetest_challenge,
+                        geetest_validate: result.geetest_validate,
+                        geetest_seccode: result.geetest_seccode,
+                    };
+                    if ($('#changeLogin').attr('data-status') === 'user') {
+                        let account = $("#inputEmail").val();
+                        let pw = $("#inputPassword").val();
+                        postData.account = account;
+                        postData.pw = pw;
+                    } else {
+                        let mobile = $('#mobileLogin').val();
+                        let code = $("#codeLogin").val();
+                        postData.mobile = mobile;
+                        postData.code = code;
+                    }
+
+                    $.ajax({
+                        url: '/login',
+                        type: 'post',
+                        data: postData,
+                        success: function (response) {
+                            if (response.error === 0) {
+                                // $('#phonepass').modal('hide');
+                                const url = response.last_page !== null && response.last_page !== undefined && response.last_page !== '' ?
+                                    response.last_page : '/pm';
+                                if (response.login_ask === 0) {
+                                    location.href = url;
+                                } else {
+                                    response.compilation_list = response.compilation_list === undefined || response.compilation_list === '' ?
+                                        null : JSON.parse(response.compilation_list);
+                                    if (response.compilation_list === null || response.compilation_list.length <= 0) {
+                                        location.href = url;
+                                        return false;
+                                    }
+                                    console.log(response.compilation_list);
+                                    setVersion(response.compilation_list);
+                                    $('#ver').modal('show');
+                                }
+                            } else if (response.error === 2) {
+                                // $('#phonepass').modal('hide');
+                                // captchaObj.reset();
+                                $('#check_ssoId').val(response.ssoId);
+                                $('#phone').modal('show');
+                                $('#login').removeAttr('disabled');
+                            } else if (response.error === 3) {
+                                // captchaObj.reset();
+                                $('#phonepass').modal('show');
+                                $('#mobileLogin').val(response.data);
+                                $('#login').removeAttr('disabled');
+                            } else {
+                                // $('#phonepass').modal('hide');
+                                let msg = response.msg !== undefined ? response.msg : '未知错误';
+                                showError(msg, $("input"));
+                                $('#login').removeAttr('disabled');
+                                // captchaObj.reset();
+                            }
+                        },
+                        error: function (result) {
+                            showError('内部程序错误', null);
+                            $('#login').removeAttr('disabled');
+                        }
+                    });
+                })
+            });
         }
     });
 }