zhangweicheng vor 5 Jahren
Ursprung
Commit
c6558075ee

+ 10 - 8
web/building_saas/main/html/divide.html

@@ -144,25 +144,25 @@
               </div>
           </div>
           <div class="modal-footer" style="justify-content: left;padding: .3rem 1rem;">
-            <div class=" col-10" style="overflow: hidden" id="install_setting">
+            <div class=" col-6" style="overflow: hidden" id="install_setting">
               <div >
                   <!--<div class="setting_title">整个项目统一计取</div>-->
-                  <fieldset class="form-group"  style="border:1px solid #b3b3b3;padding: 15px">
+                  <fieldset class="form-group"  style="border:1px solid #b3b3b3;padding: 5px">
                       <legend class="legend" >分摊方式:</legend>
-                      <div class=" row" style="margin-left: 10px;">
-                        <div class=" col-6">
+                      <div class=" row" style="margin-left: 10px;margin-top:-10px;">
+                        <div class=" col-12">
                           <label class="form-check-label">
                             <input class="form-check-input divide_type" name="divide_type" id="divide_by_bills" value="0" type="radio">
                             按清单金额分摊
                         </label>
                         </div>
-                         <div class=" col-6">
+                         <div class=" col-12">
                           <label class="form-check-label">
                               <input class="form-check-input divide_type" name="divide_type" id="divide_by_concrete" value="1" type="radio">
                               按混凝土用量分摊
                           </label>
                         </div>
-                        <div class=" col-6">
+                        <div class=" col-12">
                           <label class="form-check-label">
                             <input class="form-check-input divide_type" name="divide_type" id="divide_by_customer" value="2" type="radio">
                             自定义分摊比例
@@ -172,8 +172,10 @@
                   </fieldset>
               </div>
           </div>
-              <button  class="btn btn-primary" id="divide_confirm" data-dismiss="modal">确定</button>
-              <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
+              <div class="col-6" style="margin-top: 30px;margin-left:60px">
+                <button  class="btn btn-primary" id="divide_confirm" data-dismiss="modal">确定</button>
+                <button type="button" class="btn btn-secondary" style="margin-left:20px" data-dismiss="modal">取消</button>
+              </div>
           </div>
       </div>
   </div>

+ 9 - 6
web/building_saas/main/js/views/divide_view.js

@@ -150,6 +150,7 @@ let divideObj = {
           if(parentMap[r.ID] && parentMap[r.ID].length > 0){
             for(let c of parentMap[r.ID]){
               setItemsPrice(c);
+              c.quantity = scMathUtil.roundForObj(c.quantity,getDecimal("ration.quantity")); 
               datas.push(c);
             }
           }
@@ -160,10 +161,12 @@ let divideObj = {
 
     function setItemsPrice(item){
       if(item.fees){
+        let pre = "bills";
+        if(item.itemType == "定额") pre = "ration";
         let commonFee = _.find(item.fees,{"fieldName":"common"})
         if (commonFee){
-          item.marketPrice = commonFee.unitFee;
-          item.marketTotalFee = commonFee.totalFee;
+          item.marketPrice =  scMathUtil.roundForObj(commonFee.unitFee,getDecimal(pre+".unitPrice"));
+          item.marketTotalFee = scMathUtil.roundForObj(commonFee.totalFee,getDecimal(pre+".totalPrice"));
         }else{
           delete item.marketPrice; 
           delete item.marketTotalFee;
@@ -588,7 +591,7 @@ let divideObj = {
       let item = divideObj.getSelectedItem();
       if(item.bills){
         for(let b of item.bills){
-          datas.push(b);
+          if(b.divideRate > 0) datas.push(b);
         }
       }
       return datas;
@@ -1257,9 +1260,9 @@ let divideObj = {
       let bNode = projectObj.project.mainTree.findNode(b.ID);
       if(!bNode) continue;
       let divideRate = scMathUtil.roundForObj(b.divideRate,3);
-      let marketUnitFee = item.marketTotalFee?scMathUtil.roundForObj(item.marketTotalFee,getDecimal("bills.totalPrice")):0;
-      let quantity = divideRate;//item.quantity?scMathUtil.roundForObj(item.quantity,3):0;
-      //quantity = scMathUtil.roundForObj(quantity*divideRate,getDecimal("ration.quantity"))//量价数量为分摊项的数量*分摊比例
+      let marketUnitFee = item.marketPrice?scMathUtil.roundForObj(item.marketPrice,getDecimal("bills.unitPrice")):0;
+      let quantity = item.quantity?scMathUtil.roundForObj(item.quantity,3):0;
+      quantity = scMathUtil.roundForObj(quantity*divideRate,getDecimal("ration.quantity"))//量价数量为分摊项的数量*分摊比例
       if(quantity > 0 && marketUnitFee > 0){
         let serialNo = 0;
         let preID = "";