Browse Source

feat: 添加批量设置定额默认工作内容

zhangweicheng 3 years ago
parent
commit
3b776c3e63

+ 1 - 0
modules/all_models/stdRation_ration.js

@@ -55,6 +55,7 @@ const rationItemSchema = new Schema({
         type: Array,
         default: []
     },
+    jobContentText:String,//默认的工作内容
     isDeleted: {type: Boolean, default: false}
 });
 

+ 25 - 0
web/maintain/ration_repository/dinge.html

@@ -603,6 +603,31 @@
                 </div>
             </div>
         </div>
+    <!-- 设置默认工作内容 -->
+    <div class="modal fade" id="set-job-content-dialog" data-backdrop="static">
+        <div class="modal-dialog" role="document">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <h5 class="modal-title">设置默认工作内容</h5>
+                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+                        <span aria-hidden="true">&times;</span>
+                    </button>
+                </div>
+                <div class="modal-body">
+                    <form>
+                        <div class="form-group">
+                            <input type="text" class="form-control" placeholder="输入工作内容" id="default-job-content" autofocus="autofocus">
+                        </div>
+                    </form>
+                </div>
+                <div class="modal-footer">
+                    <a href="javascript:void(0);" class="btn btn-primary" data-dismiss="modal" id="set-job-content-confirm">确定</a>
+                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
+                </div>
+            </div>
+        </div>
+    </div>
+
         <%include ../../common/html/uploadImg.html %>
         <!--弹出html填写帮助-->
         <!--弹出html填写帮助-->

+ 1 - 0
web/maintain/ration_repository/js/ration.js

@@ -78,6 +78,7 @@ let rationOprObj = {
             {headerName:"显示名称(以%s表示参数)",headerWidth:240,dataCode:"caption", dataType: "String"},
             {headerName:"取费专业",headerWidth:70,dataCode:"feeType", dataType: "Number", hAlign: "center"},
             {headerName:"管理费费率(%)",headerWidth:100,dataCode:"manageFeeRate", dataType: "String", hAlign: "center"},
+            {headerName:"工作内容",headerWidth:130,dataCode:"jobContentText", dataType: "String"},
         ],
         view:{
             comboBox:[

+ 31 - 0
web/maintain/ration_repository/js/section_tree.js

@@ -256,6 +256,17 @@ let sectionTreeObj = {
                                 callback: function (key, opt) {
                                     $('#set-rate-dialog').modal('show');
                                 }
+                            },
+                            "setJobContent": {
+                                name: "设置工作内容",
+                                disabled: function () {
+                                    const section = me.cache[target.row];
+                                    return locked || !section;
+                                },
+                                icon: "fa-pencil-square-o",
+                                callback: function (key, opt) {
+                                    $('#set-job-content-dialog').modal('show');
+                                }
                             }
                         }
                     };
@@ -401,6 +412,26 @@ let sectionTreeObj = {
                 $.bootstrapLoading.end();
             });
         });
+
+           // 设置默认工作内容,设置给其下所有定额
+           $('#set-job-content-confirm').click(function () {
+            $.bootstrapLoading.start();
+            const jobContentText = $('#default-job-content').val();
+            const section = me.tree.selected;
+            const sectionList = me.getSectionLeafList(section);
+            const postData = {
+                rationRepId: pageOprObj.rationLibId,
+                sectionList,
+                updateData: { jobContentText: jobContentText }
+            };
+            $('#default-job-content').val('');
+            CommonAjax.post('/rationRepository/api/updateRationBySection', postData, function () {
+                me.initSelection(section);
+                $.bootstrapLoading.end();
+            }, function () {
+                $.bootstrapLoading.end();
+            });
+        });
     },
 
     insert: function () {