浏览代码

feat: 变更养护类别、费用标准,清单库变更

vian 4 年之前
父节点
当前提交
8b14cafdb1

+ 2 - 1
modules/pm/controllers/pm_controller.js

@@ -138,7 +138,7 @@ module.exports = {
                     const project = await projectModel.findOne({ ID: datas.projectID }, { 'property.valuation': 1, 'property.engineering_id': 1 }).lean();
                     if (project) {
                         const orgEngineeringID = project.property.engineering_id;
-                        const engineering = await engineeringModel.findOne({ valuationID: project.property.valuation, name: engineeringItem.value, feeName: feeStandardItem.value }, { _id: 1, tax_group: 1 }).lean();
+                        const engineering = await engineeringModel.findOne({ valuationID: project.property.valuation, name: engineeringItem.value, feeName: feeStandardItem.value }, { _id: 1, tax_group: 1, bill_lib: 1 }).lean();
                         if (engineering && orgEngineeringID !== engineering._id.toString()) {
                             datas.properties['property.engineeringName'] = engineeringItem.value;
                             datas.properties['property.feeStandardName'] = feeStandardItem.value;
@@ -147,6 +147,7 @@ module.exports = {
                                 // 工程专业变更,需要更改费率
                                 specialResult.newFeeLibID = engineering.tax_group[0].fee_lib.id;
                             }
+                            specialResult.billLibs = engineering.bill_lib;
                             
                         }
                     }

+ 9 - 1
web/building_saas/main/js/views/project_view.js

@@ -2782,11 +2782,19 @@ $('#property_ok').click(function () {
                             v2 = mixDatas.options.updateData['rationQuanACToRationUnit'],
                             progressiveType = mixDatas.options.updateData['progressiveType']  ;
                         optionsOprObj.updateOptions(optionsOprObj.options, {type: optionsOprObj.optionsTypes.GENERALOPTS, opt: 'rationQuanACToBillsQuan', value: v1});
-                        optionsOprObj.updateOptions(optionsOprObj.options, {type: optionsOprObj.optionsTypes.GENERALOPTS, opt: 'rationQuanACToRationUnit', value: v2});
+                        optionsOprObj.updateOptions(optionsOprObj.options, {type: option-sOprObj.optionsTypes.GENERALOPTS, opt: 'rationQuanACToRationUnit', value: v2});
                         optionsOprObj.updateOptions(optionsOprObj.options, {type: optionsOprObj.optionsTypes.GENERALOPTS, opt: 'progressiveType', value: progressiveType});
                     }
                 }
             }
+            // 改变清单库
+            if (rstData && rstData.billLibs) {
+                projectObj.project.projectInfo.engineeringInfo.bill_lib = rstData.billLibs;
+                $('#stdBillsGuidanceLibSelect').empty();
+                if ($('#zy').is(':visible')) {
+                    billsGuidance.initLibs(rstData.billLibs);
+                }
+            }
             // 需要改变费率
             if (rstData && rstData.newFeeLibID) {
                 $.bootstrapLoading.start();

+ 1 - 1
web/building_saas/main/js/views/std_billsGuidance_lib.js

@@ -1330,7 +1330,7 @@ const billsGuidance = (function () {
         }
     }
 
-    return {initViews, bindBtn, refreshWorkBook, setColumnWidthByRate, locateAtBills, bills, elfItem, overwrite};
+    return {initViews, initLibs, bindBtn, refreshWorkBook, setColumnWidthByRate, locateAtBills, bills, elfItem, overwrite};
 })();
 
 $(document).ready(function(){