瀏覽代碼

工程专业结构修改

zhangweicheng 6 年之前
父節點
當前提交
f86ef5d823

+ 1 - 0
modules/users/models/engineering_lib_model.js

@@ -94,6 +94,7 @@ class EngineeringLibModel extends BaseModel {
         if(data.glj_col){
             data.glj_col =  JSON.parse(data.glj_col);
         }
+        data.isInstall == 'true'?data.isInstall=true:data.isInstall=false;
         let result = false;
         data = this.filterLibData(data);
         try {

+ 62 - 0
web/maintain/common/css/main.css

@@ -293,4 +293,66 @@ body {
 
 .second_header{
     background: #e1e1e1;
+}
+
+.input-group-addon{
+    padding: 6px 12px;
+    font-size: 14px;
+    font-weight: 400;
+    line-height: 1;
+    color: #555;
+    text-align: center;
+    background-color: #eee;
+    border: 1px solid #ccc;
+    border-radius: 4px;
+}
+
+.input-sm{
+    height: 30px;
+    padding: 5px 10px;
+    font-size: 12px;
+    line-height: 1.5;
+    border-radius: 3px;
+}
+.btn-default{
+    color: #333;
+    background-color: #fff;
+    border-color: #ccc;
+}
+.checkbox{
+    position: relative;
+    display: block;
+    margin-top: 10px;
+    margin-bottom: 10px;
+}
+input[type=checkbox]{
+    position: absolute;
+    margin-top: 5px;
+    margin-left: -20px;
+}
+.col-md-2{
+    position: relative;
+    min-height: 1px;
+    padding-right: 15px;
+    padding-left:15px;
+    width:16.66666667%
+}
+.checkbox label, .radio label {
+    min-height: 20px;
+    padding-left: 20px;
+    margin-bottom: 0;
+    font-weight: 400;
+    cursor: pointer;
+    width: 200px;
+}
+
+.close{
+    float: right;
+    font-size: 21px;
+    font-weight: 700;
+    line-height: 1;
+    color: #000;
+    text-shadow: 0 1px 0 #fff;
+    filter: alpha(opacity=20);
+    opacity: .2;
 }

+ 2 - 2
web/maintain/main_col_lib/js/main_col_lib.js

@@ -381,14 +381,14 @@ $('#set-column').on('shown.bs.modal', function () {
     ColSettingObj.initColSetting(ColSettingObj.colSetting);
 });
 
-$('#set-glj-col').on('show.bs.modal', function () {
+/*$('#set-glj-col').on('show.bs.modal', function () {
     let glj_col_setting = JSON.parse($("#glj_col").val());
     if(glj_col_setting.showAdjustPrice){
         $('#adjustPrice_cb').prop('checked',true);
     }else {
         $('#adjustPrice_cb').prop('checked',false);
     }
-});
+});*/
 
 $('#set-glj-comf').click(function () {
 

+ 12 - 2
web/maintain/material_replace_lib/js/material_replace_edit.js

@@ -46,10 +46,20 @@ let materialOjb = {
         this.materialSheet = this.materialSpread .getSheet(0);
         sheetCommonObj.initSheet(this.materialSheet,this.materialSetting, 30);
         this.materialSheet.name('materialSheet');
-
+        this.initRightClick("materialSpread",this.materialSpread);
         this.refreshSheet();
 
     },
+    canDelete : function (sheet) {
+        let sel =  sheet.getSelections()[0];
+        console.log(sel);
+        if(sel.row === undefined || sel.row < 0) return false ;//一行都没选中时,不能删除
+
+        //选中空行时,不能删除
+        // to do
+        return true;
+    },
+
     initRightClick : function(id,spread) {
         let me = this;
         $.contextMenu({
@@ -64,7 +74,7 @@ let materialOjb = {
                     name: "删除",
                     icon: 'fa-trash-o',
                     disabled: function () {
-                        return false;
+                        return !me.canDelete(spread.getActiveSheet());
                     },
                     callback: function (key, opt) {
                        console.log();

+ 7 - 8
web/users/js/col_setting.js

@@ -321,22 +321,21 @@ $('#set-column').on('shown.bs.modal', function () {
     }
 });
 
-$('#set-glj-col').on('show.bs.modal', function () {
+$('#other_setting').on('show.bs.modal', function () {
     let glj_col_setting = JSON.parse($("#glj_col").val());
-    if(glj_col_setting.showAdjustPrice){
-        $('#adjustPrice_cb').prop('checked',true);
-    }else {
-        $('#adjustPrice_cb').prop('checked',false);
-    }
+    glj_col_setting.showAdjustPrice?$('#adjustPrice_cb').prop('checked',true): $('#adjustPrice_cb').prop('checked',false);
+    let isInstall = $("#isInstall").val() == 'true'?true:false;
+    $('#isInstall_cb').prop('checked',isInstall);
 });
 
-$('#set-glj-comf').click(function () {
-
+$('#other_setting_comf').click(function () {
     let showAdjustPrice =  $('#adjustPrice_cb').prop('checked');
+    let isInstall =  $('#isInstall_cb').prop('checked');
     let glj_col_setting = {
         showAdjustPrice :showAdjustPrice
     };
     $("#glj_col").val(JSON.stringify(glj_col_setting));
+    $("#isInstall").val(isInstall);
 });
 
 $('#col-count').change(function () {

+ 9 - 5
web/users/js/compilation.js

@@ -645,13 +645,17 @@ function confirmUpdate(selector,engineerID) {
      inputDiv.hide();
 }
 
-function deleteEngineerClick(engineerID) {
+function deleteEngineerClick(engineerID,element) {
     console.log(engineerID);
+    console.log(element);
     hintBox.infoBox('操作确认', '是否删除所选工程专业?', 2, async function () {
-        console.log(engineerID+'删除')
-    }, function () {
-        console.log('取消')
-    },['确定','取消'],false);
+        try {
+            let result  = await ajaxPost('/compilation/delete-engineer',{id:engineerID});
+            $(element).parent("td").parent("tr").remove();
+        }catch (err){
+            console.log(err);
+        }
+    }, null,['确定','取消'],false);
 }
 
 

+ 1 - 1
web/users/views/compilation/add.html

@@ -77,7 +77,7 @@
                                     <td><%= engineering.ration_lib.length %></td>
                                     <td><%= engineering.glj_lib.length %></td>
                                     <td><label><input type="checkbox"  <% if (engineering.visible) { %>checked<% } %>  onclick='engineerVisibleChange(this,"<%= engineering._id.toString()%>")'> 显示</label></td>
-                                    <td><a class="btn-link" href="/compilation/<%= section %>/<%= valuationId %>/<%= engineering._id.toString()%>">编辑</a>/<a onclick="deleteEngineerClick('<%= engineering._id.toString()%>')" class='btn btn-link btn-sm' style="padding: 0px">删除</a></td>
+                                    <td><a class="btn-link" href="/compilation/<%= section %>/<%= valuationId %>/<%= engineering._id.toString()%>">编辑</a>/<a onclick="deleteEngineerClick('<%= engineering._id.toString()%>',this)" class='btn btn-link btn-sm' style="padding: 0px">删除</a></td>
                                 </tr>
                                 <% }) %>
                             </tbody>

+ 2 - 1
web/users/views/compilation/engineering.html

@@ -125,7 +125,7 @@
                             </div>
                     </div>
                     <div class="col-md-12">
-                        <a data-toggle="modal" data-target="#set-glj-col" class="btn btn-primary btn-sm " style="margin-right:5px">人材机列</a>
+                        <a data-toggle="modal" data-target="#other_setting" class="btn btn-primary btn-sm " style="margin-right:5px">显示设置</a>
                     </div>
                     <div class="col-md-12" style="padding-top:20px">
                         <legend>计算程序/清单模板/列设置</legend>
@@ -183,6 +183,7 @@
                     </div>
                 </div>
                 <input type="hidden" name="glj_col" value="<%= gljCol %>" id="glj_col">
+                <input type="hidden" name="isInstall" value="<%= libData.isInstall %>" id="isInstall">
                 <input type="hidden" name="engineering" value="<%= libData.engineering %>" id="engineering">
                 <input type="hidden" name="section" value="<%= section %>" id="section">
                 <input type="hidden" name="id" value="<%= libData._id.toString()%>">

+ 11 - 4
web/users/views/compilation/modal.html

@@ -204,13 +204,13 @@
     </div>
 </div>
 
-<!-- 弹窗人材机列设置 -->
-<div class="modal fade" id="set-glj-col" tabindex="-1" role="dialog">
+<!-- 弹窗工程专业其它设置 -->
+<div class="modal fade" id="other_setting" tabindex="-1" role="dialog">
     <div class="modal-dialog " role="document">
         <div class="modal-content">
             <div class="modal-header">
                 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
-                <h4 class="modal-title" id="glj_tit">人材机列设置</h4>
+                <h4 class="modal-title" id="glj_tit">显示设置</h4>
             </div>
             <div class="modal-body">
                 <div class="row">
@@ -221,11 +221,18 @@
                             </label>
                         </div>
                     </div>
+                    <div class="col-md-12">
+                        <div class="checkbox">
+                            <label>
+                                <input type="checkbox" id="isInstall_cb"> 显示安装增加费
+                            </label>
+                        </div>
+                    </div>
                 </div>
             </div>
             <div class="modal-footer">
                 <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
-                <button type="button" class="btn btn-primary" data-dismiss="modal" id = "set-glj-comf">确定</button>
+                <button type="button" class="btn btn-primary" data-dismiss="modal" id = "other_setting_comf">确定</button>
             </div>
         </div>
     </div>