فهرست منبع

巡检任务安排增加多人执行和查询参数companyId改为deptId

CharlesLeocc 3 سال پیش
والد
کامیت
2f921271f1

+ 2 - 1
src/configure.ts

@@ -19,7 +19,7 @@ var AppX = {
         // "initextent": { xmin: 482088.5166666666, ymin: 3435299.4213, xmax: 509354.3765333333, ymax: 3464324.3689 },//地图初始范围
         "initextent": {xmin:null, ymin:null, xmax:  null, ymax:null},
         // "initextent": { xmin: 103.95, ymin: 31.24, xmax:  104.43, ymax:  31.48 },
-         "apiRoot": "http://112.51.249.202:1111",
+        "apiRoot": "http://112.51.249.202:1111",
         //"apiRoot":"http://192.168.2.248:1111",
         "formMakingSystemRoot": "http://192.168.2.245:8100/FormMaking",
         //本地用
@@ -38,6 +38,7 @@ var AppX = {
         "usertoken": "",
         "userMusicId": "",
         "userlevel": "",//当前用户系统权限级别
+        "companyId":"",
         "collisionDetection": false,//碰撞检测
         "handlers": {},//所有事件
         "infowindow": null,//气泡框

+ 1 - 1
src/login/js/login.js

@@ -1,5 +1,5 @@
 /* CONFIGURE START */
-var HOST_NAME = "112.51.249.202:1111";//"192.168.2.248:1111";//,//var HOST_NAME = "http://192.168.2.248:1111",
+var HOST_NAME = "112.51.249.202:1111";//"192.168.2.248:1111";//;//;//,//var HOST_NAME = "http://192.168.2.248:1111",
 SYS_ADDR = location.href.trim().toLowerCase().replace(/login\/+$/, ""),
     COOKIE_EXPIRES = 1,
     COOKIE_PATH = location.pathname.trim().toLowerCase().replace(/login\/+$/, "");

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
src/vendor/multiselect/css/bootstrap-multiselect.css


+ 1 - 1
src/vendor/multiselect/js/bootstrap-multiselect.js

@@ -416,7 +416,7 @@
             includeFilterClearBtn: true,
             preventInputChangeEvent: false,
             nonSelectedText: '请选择',
-            nSelectedText: 'selected',
+            nSelectedText: '已选择',
             allSelectedText: '全部选择',
             numberDisplayed: 3,
             disableIfEmpty: false,

+ 1 - 0
src/widgets/Header/Widget.ts

@@ -94,6 +94,7 @@ class Header extends BaseWidget {
                     var data = results.result;
                     this.AppX.appConfig.userlevel = data.userLevel;
                     this.AppX.appConfig.userId = data.id;
+                    this.AppX.appConfig.companyId = data.companyId;
                     this.userinfor = data;
                     this.domObj.find(".detail-name").text(data.realName);
                     this.domObj.find(".detail-phone").text(data.phone);

+ 9 - 2
src/widgets/MaintenancePageInfo/Widget.ts

@@ -462,7 +462,9 @@ class MaintenancePageInfo extends BaseWidget {
         formHtml = _.template(this.template.split('$$')[0])();
         dom.empty().append(formHtml);
         var precessInfo = "";
-        var workOrderState = data.workOrderState;
+        var workOrderState = "";
+        if(data&&data.workOrderState)
+            workOrderState = data.workOrderState;
         let zero = "<span state>工单上报</span>";
         let one = "<span state>派工处理回报</span>";
         let two = "<span state>抢修处理派工</span>";
@@ -473,7 +475,12 @@ class MaintenancePageInfo extends BaseWidget {
         }else{
             for(let i = 0;i < states.length; i++){
                 if(states[i] == 1){
-                    zero = zero.replace('state', "class='complete'");
+                    if(data&&data.workOrderState){
+                        zero = zero.replace('state', "class='complete'");
+                    }else{
+                        zero = zero
+                    }
+
                 }else if(states[i] == 2){
                     if(workOrderState =="4"){
                         one = one.replace('state', "class='complete'");

+ 23 - 4
src/widgets/MissionSchedule/Widget.html

@@ -88,9 +88,23 @@ $$
             <tr>
                 <th>
                     <div class="form-inline">
-                        <label for="plantype">
-                            <span style="color: red">*</span>巡检类型</label>
-                        <select class="input-sm  plantype minwidth" id="plantype" style="width: 238px;"></select>
+                        <div class="form-group">
+                            <label for="pointSelect">
+                            <input type="radio" class="input-sm radio pointSelect" checked='true' value="0" name="typeSelect" />
+                           单选</label>
+                        </div>
+                        <div class="form-group" style="margin-left: 5px;margin-right: 20px;">
+                            <label for="lineSelect">
+                            <input type="radio" class="input-sm radio lineSelect" value="1" name="typeSelect" />
+                            多选</label>
+                        </div>
+                        <label for="planpointtype">
+                            <span style="color: red">*</span>单选巡检类型</label>
+                        <select class="input-sm  planpointtype minwidth" id="planpointtype" style="width: 238px;"></select>
+                        <label for="tip" class="existTip" style="color: red;"></label>
+                        <label for="planlinetype" style="margin-left:20px">
+                            <span style="color: red">*</span>多选巡检类型</label>
+                        <select class="input-sm  planlinetype minwidth" id="planlinetype" style="width: 238px;" multiple="multiple" disabled></select>
                         <label for="tip" class="existTip" style="color: red;"></label>
                     </div>
                 </th>
@@ -140,12 +154,17 @@ $$
             </div>
             <div class="form-group">
                 <label for="user">
-                    <span style="color: red">*</span>人员</label>
+                    <span style="color: red">*</span>主要人员</label>
                     <!-- <select class="input-sm form-control  users" name='users' showname='levelName' data-live-search="true" data-max-options="2" data-style="btn-primary">
                     </select> -->
 
                 <select class="input-sm users minwidth" id="users"></select>
             </div>
+            <div class="form-group">
+                <label for="subUser">
+                    <span style="color: red">*</span>协助人员</label>
+                <select class="input-sm subUsers minwidth" id="subUsers" multiple="multiple"></select>
+            </div>
             <div class="form-group">
                 <label for="user">
                     <span style="color: red">*</span>计划完成率</label>

+ 336 - 136
src/widgets/MissionSchedule/Widget.ts

@@ -67,7 +67,7 @@ class MissionSchedule extends BaseWidget {
     dataTable_all_searchInfo = {};//巡检查询条件
     addData = {
         companyid: undefined,//公司唯一编码
-        deviceTypeId: undefined,//设备类型唯一编码
+        deviceTypeIds: undefined,//设备类型唯一编码
         intervalDays: undefined,//自定义间隔天数
         periodId: undefined,//巡检周期编码
         planBegindate: undefined,//开始时间
@@ -76,10 +76,14 @@ class MissionSchedule extends BaseWidget {
         pointInfo: undefined,
         regionId: undefined,//巡检片区编码
         userId: undefined,//用户id
+        synergyUserIds:undefined,//协同处理人ids
         description: undefined,//计划名称
         planRate: undefined,//计划完成率,
         geoType: undefined,//下发计划图形的样式类型
         gisInfo: undefined,//巡检点、巡检线的内容
+        gisInfoList:[
+
+        ],//新计划字段
         gisUrl: undefined,//管线设备信息的请求地址
         objectIds: undefined//选中管线设备的objectid集合
     }
@@ -301,7 +305,7 @@ class MissionSchedule extends BaseWidget {
     addDataReset() {
         this.addData = {
             companyid: undefined,//公司唯一编码
-            deviceTypeId: undefined,//设备类型唯一编码
+            deviceTypeIds: undefined,//设备类型唯一编码
             intervalDays: undefined,//自定义间隔天数
             periodId: undefined,//巡检周期编码
             planBegindate: undefined,//开始时间
@@ -310,10 +314,12 @@ class MissionSchedule extends BaseWidget {
             pointInfo: undefined,//
             regionId: undefined,//巡检片区编码
             userId: undefined,//用户id
+            synergyUserIds:undefined,
             description: undefined,//计划名称
             planRate: undefined,//计划完成率
             geoType: undefined,//图形样式类型
             gisInfo: undefined,//巡检点、巡检线的内容
+            gisInfoList:[],
             gisUrl: undefined,//管线设备信息的请求地址
             objectIds: undefined//选中管线设备的objectid集合
         }
@@ -345,16 +351,60 @@ class MissionSchedule extends BaseWidget {
         //部门列表
         this.domObj.find('.department').off("change").on("change", function () {
             this.getUser(selectType.single, this.domObj.find(".department").val());
+            // $('option', $('.planpointtype')).each(function(element) {
+            //     $(this).removeAttr('selected').prop('selected', false);
+            // });
+            $('option', $('.subUsers')).each(function(element) {
+                $(this).removeAttr('selected').prop('selected', false);
+            });
         }.bind(this));
-        this.domObj.find('.plantype').off("change").on("change", function () {
-            var pointType = this.domObj.find(".plantype option:selected").attr("data-type");
-            var pointTxt = this.domObj.find(".plantype option:selected").html();
-            if(pointType == "0" && pointTxt != "巡检点"){
-                this.domObj.find(".users").attr("multiple","multiple");
+        this.domObj.find(".users").off("change").on("change",function () {
+            // var subUsersOptions =this.domObj.find(".users option:not(:selected)");
+            // this.domObj.find(".subUsers").empty().append(subUsersOptions);
+            // this.domObj.find(".users").multiselect("destroy").multiselect({
+            //     maxHeight:200,
+            //     inheritClass: false
+            // });
+            var selectedUserVal = this.domObj.find(".users option:selected").val();
+                var subUsersOptions = this.domObj.find(".subUsers option");
+                for(var i=0;i<subUsersOptions.length;i++){
+                    if($(subUsersOptions[i]).val() == selectedUserVal){
+                        subUsersOptions[i].disabled = true;
+                    }else{
+                        subUsersOptions[i].disabled = false;
+                    }
+                }
+            var selectedTypeVal = this.domObj.find(".planpointtype option:selected").val();
+
+                if(selectedTypeVal == "1"){
+                    this.domObj.find(".subUsers").multiselect("destroy").multiselect({
+                        maxHeight:200,
+                        inheritClass: false
+                    }).multiselect("disable");
+                }else{
+                    this.domObj.find(".subUsers").multiselect("destroy").multiselect({
+                        maxHeight:200,
+                        inheritClass: false
+                    });
+                }
+            // var userId = this.domObj.find(".users option:selected").val();
+            // var input = $('.subUsers input[value="'+userId+'"]');
+            // var option = $('.subUsers option[value="'+userId+'"]');
+            // input.prop('disabled', true);
+            // option.prop('disabled', true);
+            // input.parent('label').parent('a').parent('li').addClass('disabled');
+        }.bind(this))
+        this.domObj.find('.planpointtype').off("change").on("change", function () {
+            var pointType = this.domObj.find(".planpointtype option:selected").attr("data-type");
+            var pointVal = this.domObj.find(".planpointtype option:selected").val();
+            if(pointType == "0" && pointVal != "1" && pointVal != "2"){//排除巡检点和巡检线多选
+                //this.domObj.find(".subUsers").attr("multiple","multiple");
+                this.domObj.find(".subUsers").multiselect("enable");
             }else{
-                this.domObj.find(".users").removeAttr("multiple");
+                //this.domObj.find(".subUsers").removeAttr("multiple");
+                this.domObj.find(".subUsers").multiselect("disable");
             }
-            $('option', $('.users')).each(function(element) {
+            $('option', $('.subUsers')).each(function(element) {
                 $(this).removeAttr('selected').prop('selected', false);
             });
             //this.domObj.find("span .multiselect-native-select").remove();
@@ -363,6 +413,70 @@ class MissionSchedule extends BaseWidget {
                 inheritClass: false
             });
         }.bind(this));
+        this.domObj.find('.planlinetype').off("change").on("change", function () {
+
+            //this.domObj.find(".users").removeAttr("multiple");
+            this.domObj.find(".subUsers").multiselect("disable");
+            $('option', $('.users')).each(function(element) {
+                $(this).removeAttr('selected').prop('selected', false);
+            });
+            //this.domObj.find("span .multiselect-native-select").remove();
+            // this.domObj.find(".users").multiselect("destroy").multiselect({
+            //     maxHeight:200,
+            //     inheritClass: false
+            // });
+        }.bind(this));
+        this.domObj.find('input[type=radio][name=typeSelect]').off("change").on("change",function () {
+            if($("input:radio[name='typeSelect']:checked").val() =="0"){//判断选中的是点类型还是线类型
+                // this.domObj.find(".planpointtype").removeAttr("disabled")
+                // this.domObj.find(".planlinetype").attr("disabled","disabled")
+                // $('.planlinetype').multiselect('disable');
+                // $('.planpointtype').multiselect('enable');
+                // $('option', $('.planlinetype')).each(function(element) {
+                //     $(this).removeAttr('selected').prop('selected', false);
+                // });
+                $('option', $('.subUsers')).each(function(element) {
+                    $(this).removeAttr('selected').prop('selected', false);
+                });
+                $('option', $('.planpointtype')).each(function(element) {
+                    $(this).removeAttr('selected').prop('selected', false);
+                });
+                $('option', $('.planlinetype')).each(function(element) {
+                    $(this).removeAttr('selected').prop('selected', false);
+                });
+                this.domObj.find(".planpointtype").multiselect("destroy").multiselect({
+                    maxHeight:200,
+                    inheritClass: false
+                }).multiselect("enable");
+                this.domObj.find(".planlinetype").multiselect("destroy").multiselect({
+                    maxHeight:200,
+                    inheritClass: false
+                }).multiselect("disable");
+            }else if($("input:radio[name='typeSelect']:checked").val() =="1"){
+                // this.domObj.find(".planlinetype").removeAttr("disabled")
+                // this.domObj.find(".planpointtype").attr("disabled","disabled")
+                // $('.planlinetype').multiselect('enable');
+                // $('.planpointtype').multiselect('disable');
+                $('option', $('.planpointtype')).each(function(element) {
+                    $(this).removeAttr('selected').prop('selected', false);
+                });
+                $('option', $('.planlinetype')).each(function(element) {
+                    $(this).removeAttr('selected').prop('selected', false);
+                });
+                this.domObj.find(".planlinetype").multiselect("destroy").multiselect({
+                    maxHeight:200,
+                    inheritClass: false
+                }).multiselect("enable");
+                this.domObj.find(".planpointtype").multiselect("destroy").multiselect({
+                    maxHeight:200,
+                    inheritClass: false
+                }).multiselect("disable");
+                this.domObj.find(".subUsers").multiselect("disable");
+                $('option', $('.subUsers')).each(function(element) {
+                    $(this).removeAttr('selected').prop('selected', false);
+                });
+            }
+        }.bind(this))
         //设置常量-巡检周期、 日期区间
         if (this.addData.planBegindate) {
             this.domObj.find('.plan_begindate').val(this.addData.planBegindate.split(" ")[0]);
@@ -398,8 +512,27 @@ class MissionSchedule extends BaseWidget {
         this.domObj.find('.btn_next_step').off("click").on("click", function () {
 
             //设置常量-巡检周期、 日期区间
+            var pointAndLineId = [];
             this.addData.companyid = parseInt(this.domObj.find('.department option:selected').val());
-            this.addData.deviceTypeId = parseInt(this.domObj.find('.plantype option:selected').data("device_type_id"));
+            if($("input:radio[name='typeSelect']:checked").val() =="0"){//选中的是点类型
+
+                var brands = $('.planpointtype option:selected');
+                $(brands).each(function(index, brand){
+                    pointAndLineId.push(Number(($(brand).attr("data-device_type_id"))));
+                    this.addData.geoType = $(brand).attr("data-type");
+                }.bind(this));
+            }else if($("input:radio[name='typeSelect']:checked").val() =="1"){
+                var brands = $('.planlinetype option:selected');
+                this.addData.geoType = "1";
+                $(brands).each(function(index, brand){
+                    pointAndLineId.push(Number($(brand).attr("data-device_type_id")));
+                }.bind(this));
+            }
+            if(pointAndLineId.length > 1){
+                this.toast.Show("暂不支持巡检类型多选");
+                return;
+            }
+            this.addData.deviceTypeIds = pointAndLineId.join(",");
             this.addData.periodId = parseInt(this.domObj.find('.periodid option:selected').val());
             this.addData.intervalDays = this.domObj.find(".periodid option:selected").attr("data-days");
             this.addData.intervalDays = parseInt((this.addData.intervalDays == "null" ? "0" : this.addData.intervalDays));
@@ -408,19 +541,24 @@ class MissionSchedule extends BaseWidget {
             this.addData.planMode = this.domObj.find(".radio:checked").val();
 
             //获取多选用户id
-            let checkContent = this.domObj.find("ul .active input[type=checkbox]");
-            if(checkContent.length ==0){
-                checkContent = this.domObj.find("ul .active input[type=radio]");
-            }
-                var checkContentVal = [];
-                for(var i=0;i<checkContent.length;i++){
-                    //checkContent[i].find("input[type=checkbox]");
-                    checkContentVal.push(checkContent[i].getAttribute("value"));
-                }
-            this.addData.userId = checkContentVal.join(",")//parseInt(this.domObj.find('.users option:selected ').val());
+            var synergyUserIdsVal = [];
+            let checkContent = this.domObj.find(".users option:selected").val();
+            let synergyUser = this.domObj.find(".subUsers option:selected");
+            $(synergyUser).each(function(index, brand){
+                synergyUserIdsVal.push($(this).val());
+            });
+
+                // for(var i=0;i<checkContent.length;i++){
+                //     //checkContent[i].find("input[type=checkbox]");
+                //     checkContentVal.push(checkContent[i].getAttribute("value"));
+                // }
+            this.addData.userId = checkContent//parseInt(this.domObj.find('.users option:selected ').val());
+            //if(checkContentVal.length >1){
+            this.addData.synergyUserIds = synergyUserIdsVal.join(",")
+            //}
             this.addData.description = this.domObj.find('.plan_name').val();
             this.addData.planRate = parseFloat(this.domObj.find('.plan_rate').val());
-            this.addData.geoType = this.domObj.find(".plantype  option:selected").attr("data-type");
+            //this.addData.geoType = $("input:radio[name='typeSelect']:checked").val()//点是0,线是1   this.domObj.find(".plantype  option:selected").attr("data-type");
             if(new Date(this.addData.planEnddate).getTime()- new Date(this.addData.planBegindate).getTime()<0){
                 this.toast.Show("计划结束时间应大于计划开始时间!");
                 return ;
@@ -454,10 +592,10 @@ class MissionSchedule extends BaseWidget {
                     return;
                 }
             }
-            if (this.addData.deviceTypeId == 1 || this.addData.deviceTypeId == 2) {
+            if (this.addData.deviceTypeIds == 1 || this.addData.deviceTypeIds == 2) {
                 this.domObj.empty().append(this.template.split('$$')[4]);
                 this.initEvent4();
-                this.getRegionInfo(this.regionid, this.addData.deviceTypeId);
+                this.getRegionInfo(this.regionid, this.addData.deviceTypeIds);
             } else {
                 this.domObj.empty().append(this.template.split('$$')[2]);//片区选择
                 this.initEvent3();
@@ -521,7 +659,7 @@ class MissionSchedule extends BaseWidget {
         this.addData.gisUrl = undefined;
         this.addData.gisInfo = undefined;
         //筛选出管线的点装置
-        if (this.addData.geoType == '0' && this.addData.deviceTypeId != '1') {
+        if (this.addData.geoType == '0' && this.addData.deviceTypeIds != '1') {
             this.domObj.find('.setTime').attr("style", "");
             this.domObj.find('.widget-planregion_deviceselect .btn_search').show();
             let date = new Date();
@@ -574,7 +712,7 @@ class MissionSchedule extends BaseWidget {
                     xjlist.push(itemselect);
                 }
             }
-            if (this.addData.deviceTypeId == "1" || this.addData.deviceTypeId == "2") {
+            if (this.addData.deviceTypeIds == "1" || this.addData.deviceTypeIds == "2") {
                 this.domObj.find(".pointlist-select").each(function () {//巡检点、巡检线选择
                     if ($(this).prop('checked') == true && _.findIndex(xjlist, function (o: any) { return o.sid == this.id }.bind(this)) == -1) {
                         let geoData = $(this).data('geometry');
@@ -635,7 +773,29 @@ class MissionSchedule extends BaseWidget {
             }
             this.loadWait.show("正在新增巡检计划,请等待...", this.domObj);
             this.addData.deptId=this.addData.companyid;
-            this.ajaxSend.sendAjax(this, this.addData, this.config.addMissionScheduleInfo, this.ajaxSend.type.post, this.addMissionScheduleInfoCallback.bind(this));
+            this.addData.gisInfoList.push({
+                "gisInfo":this.addData.gisInfo || [],
+                "gisUrl":this.addData.gisUrl,
+                "objectIds":this.addData.objectIds,
+                "regionId":this.addData.regionId,
+                "typeId":Number(this.addData.deviceTypeIds)
+            });
+            var sendData = {
+                companyId:this.AppX.appConfig.companyId,
+                deptId:this.addData.deptId,
+                description:this.addData.description,
+                deviceTypeIds:this.addData.deviceTypeIds,
+                gisInfoList:this.addData.gisInfoList,
+                intervalDays:this.addData.intervalDays,
+                periodId:this.addData.periodId,
+                planBegindate:this.addData.planBegindate,
+                planEnddate:this.addData.planEnddate,
+                planMode:this.addData.planMode,
+                planRate:JSON.stringify(this.addData.planRate),
+                synergyUserIds:this.addData.synergyUserIds || "",
+                userId:Number(this.addData.userId)
+            }
+            this.ajaxSend.sendAjax(this, sendData, this.config.addMissionScheduleInfo, this.ajaxSend.type.post, this.addMissionScheduleInfoCallback.bind(this));
         }.bind(this));
 
         //清除所有选择
@@ -675,7 +835,7 @@ class MissionSchedule extends BaseWidget {
                 geometry = geometryEngine.intersect(this.currentRegionPolygon, evt.geometry);
                 this.drawToolbar.deactivate();
                 var url = this.AppX.appConfig.gisResource.pipe.config[this.config.mapindex].url;//pipe
-                var obj = this.getDeviceType(this.addData.deviceTypeId);
+                var obj = this.getDeviceType(this.addData.deviceTypeIds);
                 var fields = this.getLayerShowFieldNames(obj.cnContactLayerName);
                 this.loadWait.show("正在查询选择" + this.current_device_type_name + "信息,请等待...", this.domObj);
                 var where = obj.sqlfilter;
@@ -787,7 +947,7 @@ class MissionSchedule extends BaseWidget {
                 }
                 this.drawToolbar.deactivate();
                 var url = this.AppX.appConfig.gisResource.pipe.config[this.config.mapindex].url;
-                var obj = this.getDeviceType(this.addData.deviceTypeId);
+                var obj = this.getDeviceType(this.addData.deviceTypeIds);
                 var fields = this.getLayerShowFieldNames(obj.cnContactLayerName);
                 this.loadWait.show("正在查询删除的选择" + this.current_device_type_name + "信息,请等待...", this.domObj);
                 var where = obj.sqlfilter;
@@ -876,7 +1036,7 @@ class MissionSchedule extends BaseWidget {
 
         //上一步 片区列表
         this.domObj.find('.btn_previous_step').off("click").on("click", function () {
-            if (this.addData.deviceTypeId == 1 || this.addData.deviceTypeId == 2) {
+            if (this.addData.deviceTypeIds == 1 || this.addData.deviceTypeIds == 2) {
                 this.domObj.empty().append(this.template.split('$$')[1]);
                 this.initEvent2();
             } else {
@@ -1050,7 +1210,7 @@ class MissionSchedule extends BaseWidget {
         let startTime = this.domObj.find("#plan_begindate").val();
         let endTime = this.domObj.find("#plan_enddate").val();
         that.dataTable_all_searchInfo = {
-            companyId: this.domObj.find(".department option:selected").val(),
+            deptId: this.domObj.find(".department option:selected").val(),
             userId: this.domObj.find(".users option:selected").val(),
             "orders[0].asc": false,
             "orders[0].column": 'CREATE_TIME',
@@ -1300,65 +1460,80 @@ class MissionSchedule extends BaseWidget {
                 strusers = "<option selected value=''>暂无巡检人员</option>"
             } else {
                 $.each(results.result.records, function (index, item) {
-                    if (this.addData.userId) {
-                        for(var i = 0;i<this.addData.userId.split(",").length;i++){
-                            var id = this.addData.userId.split(",")[i];
-                            if(item.id==id){
-                                strusers+="<option value='"+item.id+"' selected='selected'>"+item.realName+"</option>";
-                                break;
-                            }else if(i == this.addData.userId.split(",").length-1){
-                                strusers+="<option value='"+item.id+"'>"+item.realName+"</option>";
-                                break;
-                            }else{
-                                //html+="<option value='"+item.id+"'>"+item.name+"</option>";
-                                //break;
-                            }
-
-                        }
-                        // if (optionType == selectType.single && this.addData.userId == item.id) {
+                    // if (this.addData.userId) {
+                    //     for(var i = 0;i<this.addData.userId.split(",").length;i++){
+                    //         var id = this.addData.userId.split(",")[i];
+                    //         if(item.id==id){
+                    //             strusers+="<option value='"+item.id+"' selected='selected'>"+item.realName+"</option>";
+                    //             break;
+                    //         }else if(i == this.addData.userId.split(",").length-1){
+                    //             strusers+="<option value='"+item.id+"'>"+item.realName+"</option>";
+                    //             break;
+                    //         }else{
+                    //             //html+="<option value='"+item.id+"'>"+item.name+"</option>";
+                    //             //break;
+                    //         }
+
+                    //     }
+                    //     // if (optionType == selectType.single && this.addData.userId == item.id) {
+                    //     //     strusers += "<option  value='" + item.id + "'>" + item.realName + "</option>";
+                    //     // } else {
+                    //     //     strusers += "<option  value='" + item.id + "'>" + item.realName + "</option>";
+                    //     // }
+                    // } else {
+                    strusers += "<option  value='" + item.id + "'>" + item.realName + "</option>";
+                        // if (optionType == selectType.single) {
                         //     strusers += "<option  value='" + item.id + "'>" + item.realName + "</option>";
                         // } else {
                         //     strusers += "<option  value='" + item.id + "'>" + item.realName + "</option>";
                         // }
-                    } else {
-                        if (optionType == selectType.single && index == 0) {
-                            strusers += "<option  value='" + item.id + "'>" + item.realName + "</option>";
-                        } else {
-                            strusers += "<option  value='" + item.id + "'>" + item.realName + "</option>";
-                        }
-                    }
+                    //}
                 }.bind(this));
             }
 
             this.domObj.find(".users").empty().append(strusers);
-            if(optionType == selectType.single){
-                var pointType = this.domObj.find(".plantype option:selected").attr("data-type");
-                var pointTxt = this.domObj.find(".plantype option:selected").html();
-                if(pointType == "0" && pointTxt != "巡检点"){
-                    this.domObj.find(".users").attr("multiple","multiple");
-                }else{
-                    this.domObj.find(".users").removeAttr("multiple");
+
+
+            // if(optionType == selectType.single){
+            //     var pointType = this.domObj.find(".plantype option:selected").attr("data-type");
+            //     var pointTxt = this.domObj.find(".plantype option:selected").html();
+            //     if(pointType == "0" && pointTxt != "巡检点"){
+            //         this.domObj.find(".users").attr("multiple","multiple");
+            //     }else{
+            //         this.domObj.find(".users").removeAttr("multiple");
+            //     }
+
+            if (optionType == selectType.single) {
+                this.domObj.find(".subUsers").empty().append(strusers);
+                var selectedUserVal = this.domObj.find(".users option:selected").val();
+                var subUsersOptions = this.domObj.find(".subUsers option");
+                for(var i=0;i<subUsersOptions.length;i++){
+                    if($(subUsersOptions[i]).val() == selectedUserVal){
+                        subUsersOptions[i].disabled = true;
+                    }else{
+                        subUsersOptions[i].disabled = false;
+                    }
                 }
+                //var subUsersOptions = this.domObj.find(".users option:not(:selected)");
+                //this.domObj.find(".users").append(subUsersOptions);
+                //this.domObj.find(".subUsers").empty().append(subUsersOptions);
+                var selectedTypeVal = this.domObj.find(".planpointtype option:selected").val();
                 this.domObj.find(".users").multiselect("destroy").multiselect({
                     maxHeight:200,
                     inheritClass: false
                 });
-                // if (this.addData.userIds) {
-                //     for(var i = 0;i<this.addData.userIds.split(",").length;i++){
-                //         var id = this.addData.userIds.split(",")[i];
-                //        $("option[value='"+id+"']",$(".users")).prop('selected',true);
-
-                //     }
-                // }
+                if(selectedTypeVal == "1"){
+                    this.domObj.find(".subUsers").multiselect("destroy").multiselect({
+                        maxHeight:200,
+                        inheritClass: false
+                    }).multiselect("disable");
+                }else{
+                    this.domObj.find(".subUsers").multiselect("destroy").multiselect({
+                        maxHeight:200,
+                        inheritClass: false
+                    });
+                }
             }
-
-            // this.domObj.find(".users").selectpicker({
-            //     noneResultsText: "未查询到{0}",
-            //     noneSelectedText: "无选择项"
-            // });
-            // this.domObj.find(".users").selectpicker('refresh');
-            // this.domObj.find(".users").selectpicker('render');
-
         }.bind(this));
     }
 
@@ -1378,24 +1553,50 @@ class MissionSchedule extends BaseWidget {
             this.toast.Show(results.message);
             return;
         }
-        var strplantype = "";
+        var strplanpointtype = "";
+        var strplanlinetype = "";
         $.each(results.result.records, function (index, item) {
-            if (!this.addData.deviceTypeId) {
-                if (index == 0) {
-                    strplantype += "<option selected value='" + item.id + "' data-type='" + item.type + "' data-device_type_id='" + item.id + "'>" + item.name + "</option>";
-                } else {
-                    strplantype += "<option value='" + item.id + "' data-type='" + item.type + "'  data-device_type_id='" + item.id + "'>" + item.name + "</option>";
-                }
-            } else {
-                if (item.id == this.addData.deviceTypeId) {
-                    strplantype += "<option selected value='" + item.id + "' data-type='" + item.type + "' data-device_type_id='" + item.id + "'>" + item.name + "</option>";
-                } else {
-                    strplantype += "<option value='" + item.id + "' data-type='" + item.type + "'  data-device_type_id='" + item.id + "'>" + item.name + "</option>";
+            if(item.type == "0"){
+                strplanpointtype += "<option value='" + item.id + "' data-type='" + item.type + "'  data-device_type_id='" + item.id + "'>" + item.name + "</option>";
+            }else if(item.type == "1"){
+                if(item.id == 2){//巡检线为单选类型,加入到单选类型中去
+                    strplanpointtype += "<option value='" + item.id + "' data-type='" + item.type + "'  data-device_type_id='" + item.id + "'>" + item.name + "</option>";
+                }else{
+                    if(item.id != 15){//去除预埋管线
+                        strplanlinetype += "<option value='" + item.id + "' data-type='" + item.type + "'  data-device_type_id='" + item.id + "'>" + item.name + "</option>";
+                    }
                 }
+
             }
+            // if (!this.addData.deviceTypeId) {
+            //     if (index == 0) {
+            //         strplantype += "<option selected value='" + item.id + "' data-type='" + item.type + "' data-device_type_id='" + item.id + "'>" + item.name + "</option>";
+            //     } else {
+            //         strplantype += "<option value='" + item.id + "' data-type='" + item.type + "'  data-device_type_id='" + item.id + "'>" + item.name + "</option>";
+            //     }
+            // } else {
+            //     if (item.id == this.addData.deviceTypeId) {
+            //         strplantype += "<option selected value='" + item.id + "' data-type='" + item.type + "' data-device_type_id='" + item.id + "'>" + item.name + "</option>";
+            //     } else {
+            //         strplantype += "<option value='" + item.id + "' data-type='" + item.type + "'  data-device_type_id='" + item.id + "'>" + item.name + "</option>";
+            //     }
+            // }
 
         }.bind(this));
-        this.domObj.find(".plantype").empty().append(strplantype);
+        this.domObj.find(".planpointtype").empty().append(strplanpointtype);
+        this.domObj.find(".planlinetype").empty().append(strplanlinetype);
+        this.domObj.find(".planpointtype").multiselect({
+            maxHeight:200,
+            minwidth:238,
+            inheritClass: false
+
+        });
+        this.domObj.find(".planlinetype").multiselect({
+            maxHeight:200,
+            minwidth:238,
+            inheritClass: false
+
+        });
         this.getGroup(selectType.single);
     }
 
@@ -1663,7 +1864,7 @@ class MissionSchedule extends BaseWidget {
         var data = {
             current: 1,
             size: 1000,
-            pointTypeId: device_type_id
+            pointTypeIds: device_type_id
         };
         this.ajaxSend.sendAjax(this, data, this.config.getLayerId, this.ajaxSend.type.get, function (results) {
             if (results.code != 1) {
@@ -1693,43 +1894,42 @@ class MissionSchedule extends BaseWidget {
         var url = this.AppX.appConfig.gisResource.pipe.config[this.config.mapindex].url;
         if (this.deviceTypes == null)
             return;
-        var devicetype = this.getDeviceType(device_type_id);
-        if (devicetype == null) return;
-        this.loadWait.show("正在检查片区中是否有" + device_type_name + "信息,请等待...", this.domObj);
-        var where = "1=1";
-        if (devicetype.sqlfilter != null && devicetype.sqlfilter.length > 0)
-            where += " and " + devicetype.sqlfilter;
-        var param = { "where": where, "spatialRel": "esriSpatialRelContains", "returnGeometry": true, "geometryType": "esriGeometryPolygon", "geometry": JSON.stringify(polygon), "returnCountOnly": true, "returnIdsOnly": false, "f": "json" };
-        $.ajax({
-            type: "POST",
-            url: url + "/" + devicetype.contactLayerId + "/query",
-            cache: false,
-            data: param,
-            dataType: "json",
-            success: function (response) {
-                if (response.error !== undefined) {
-                    this.AppX.runtimeConfig.toast.Show("查询失败,请联系管理员");
+            var devicetype = this.getDeviceType(device_type_id);
+            if (devicetype == null) return;
+            this.loadWait.show("正在检查片区中是否有" + device_type_name + "信息,请等待...", this.domObj);
+            var where = "1=1";
+            if (devicetype.sqlfilter != null && devicetype.sqlfilter.length > 0)
+                where += " and " + devicetype.sqlfilter;
+            var param = { "where": where, "spatialRel": "esriSpatialRelContains", "returnGeometry": true, "geometryType": "esriGeometryPolygon", "geometry": JSON.stringify(polygon), "returnCountOnly": true, "returnIdsOnly": false, "f": "json" };
+            $.ajax({
+                type: "POST",
+                url: url + "/" + devicetype.contactLayerId + "/query",
+                cache: false,
+                data: param,
+                dataType: "json",
+                success: function (response) {
+                    if (response.error !== undefined) {
+                        this.AppX.runtimeConfig.toast.Show("查询失败,请联系管理员");
+                        this.loadWait.hide();
+                        return;
+                    }
+                    var count = response.count;
                     this.loadWait.hide();
-                    return;
-                }
-                var count = response.count;
-                this.loadWait.hide();
-                if (count > 0) {//下一步、设备选择
-                    this.getPlanDeviceList(polygon);
-                    this.plan_addpontype_layer.clear();
-                    var graphic = new Graphic(polygon, this.setSymbol("")[2], "");
-                    this.plan_addpontype_layer.add(graphic);
-                } else {
-                    this.toast.Show(" 抱歉,该片区内没有" + device_type_name + "信息!");
-                }
-            }.bind(this),
-            error: function (results) {
-                this.loadWait.hide();
-                this.toast.Show("查询片区巡检信息出错!");
-            }.bind(this)
-        });
-    }
-
+                    if (count > 0) {//下一步、设备选择
+                        this.getPlanDeviceList(polygon);
+                        this.plan_addpontype_layer.clear();
+                        var graphic = new Graphic(polygon, this.setSymbol("")[2], "");
+                        this.plan_addpontype_layer.add(graphic);
+                    } else {
+                        this.toast.Show(" 抱歉,该片区内没有" + device_type_name + "信息!");
+                    }
+                }.bind(this),
+                error: function (results) {
+                    this.loadWait.hide();
+                    this.toast.Show("查询片区巡检信息出错!");
+                }.bind(this)
+            });
+        }
     /**
      * @function 获取巡检片区内巡检信息
      * @param region_polygon 片区面
@@ -1737,11 +1937,11 @@ class MissionSchedule extends BaseWidget {
     getPlanDeviceList(region_polygon?) {
         var url = this.AppX.appConfig.gisResource.pipe.config[this.config.mapindex].url;
         var where = "", cfg = null;
-        if (this.addData.deviceTypeId != 1 && this.addData.deviceTypeId != 2) {
-            cfg = this.getDeviceType(this.addData.deviceTypeId);
+        if (this.addData.deviceTypeIds != 1 && this.addData.deviceTypeIds != 2) {
+            cfg = this.getDeviceType(this.addData.deviceTypeIds);
             where = cfg.where;
         }
-        switch (this.addData.deviceTypeId) {
+        switch (this.addData.deviceTypeIds) {
             default://设备巡查
                 var fields = this.getLayerShowFieldNames(cfg.cnContactLayerName);
                 this.domObj.empty().append(this.template.split('$$')[7]);
@@ -1812,7 +2012,7 @@ class MissionSchedule extends BaseWidget {
                         // } else {
 
                         // }
-                        that.checkExistPlanDeviceByLayer(dom.data("geometry"), that.addData.deviceTypeId + "", that.current_device_type_name);
+                        that.checkExistPlanDeviceByLayer(dom.data("geometry"), that.addData.deviceTypeIds + "", that.current_device_type_name);
                     }
                 })
                 //添加当前第几页,共几页
@@ -1957,7 +2157,7 @@ class MissionSchedule extends BaseWidget {
         // that.devices_selected_layers.clear();
         this.missionschedule_plandetail_polylinelayer.clear();
         //选中更新
-        var cfg = this.getDeviceType(this.addData.deviceTypeId);
+        var cfg = this.getDeviceType(this.addData.deviceTypeIds);
         var layerid = cfg.contactLayerId;
         var fields = this.getLayerShowFieldNames(cfg.cnContactLayerName);
         let columns = [];
@@ -2078,7 +2278,7 @@ class MissionSchedule extends BaseWidget {
                     if (data.length == 0) {
                         data.push("无objectId");
                     }
-                    var obj = that.getDeviceType(that.addData.deviceTypeId);
+                    var obj = that.getDeviceType(that.addData.deviceTypeIds);
                     var fields = that.getLayerShowFieldNames(obj.cnContactLayerName);
                     var where = obj.sqlfilter;
                     let fieldDate = fields.map(e => e.name);
@@ -2106,7 +2306,7 @@ class MissionSchedule extends BaseWidget {
                         results.data = [];
                         that.dataTable_current.currentData = value.features;
                         $.each(value.features, function (i, item) {
-                            var obj = that.getDeviceType(that.addData.deviceTypeId);
+                            var obj = that.getDeviceType(that.addData.deviceTypeIds);
                             var fields = that.getLayerShowFieldNames(obj.cnContactLayerName);
                             let itemdata = {};
                             for (let el of fields) {
@@ -2161,9 +2361,9 @@ class MissionSchedule extends BaseWidget {
             return;
         }
         var html_trs_data = "";
-        var confobj = this.config.deviceForOther[this.addData.deviceTypeId];
+        var confobj = this.config.deviceForOther[this.addData.deviceTypeIds];
         var content = null;
-        switch (this.addData.deviceTypeId) {
+        switch (this.addData.deviceTypeIds) {
             case 1:
             case 2://巡检线
                 results.result.records.forEach((p, itemindx) => {
@@ -2182,7 +2382,7 @@ class MissionSchedule extends BaseWidget {
                         + "' data-address='" + p.address
                         + "' data-content='" + JSON.stringify(content)
                         + "' data-name='" + p.pointName
-                        + "' data-device_type_id='" + this.addData.deviceTypeId
+                        + "' data-device_type_id='" + this.addData.deviceTypeIds
                         + "' data-regionname='" + p.regionName
                         + "' /></td><td title='" + p.deviceTypeName + "'>" + p.deviceTypeName
                         + "</td><td title='" + this.ajaxSend.verificationHelper.setNullAndUndefined(p.pointName) + "'>" + this.ajaxSend.verificationHelper.setNullAndUndefined(p.pointName)
@@ -2193,7 +2393,7 @@ class MissionSchedule extends BaseWidget {
                 });
                 break;
         }
-        this.addRegionInfoGraphic(results, this.addData.deviceTypeId);//加载到地图
+        this.addRegionInfoGraphic(results, this.addData.deviceTypeIds);//加载到地图
         this.domObj.find(".pointlist").empty().append(html_trs_data);
         // 选中行高亮------------------符号需修改--------------
         this.domObj.off("click").on('click', '.pointlist tr', (e) => {

+ 4 - 0
src/widgets/MissionSchedule/css/style.scss

@@ -10,6 +10,7 @@
         color: rgba(0, 0, 255, 0.7) !important;
         cursor: pointer;
     }
+
     .missionschedule_toolbar {
         .toolbar,
         .form-group {
@@ -104,6 +105,9 @@
         overflow-y: unset;
         .missionschedule_infoSet {
             height: calc(100% - 10px);
+            th{
+                overflow: unset;
+            }
         }
     }
     .widget-missionschedule_planadd {

+ 1 - 1
src/widgets/PlanSearch/Widget.ts

@@ -333,7 +333,7 @@ class PlanSearch extends BaseWidget {
         let startTime = this.domObj.find("#plan_begindate").val();
         let endTime = this.domObj.find("#plan_enddate").val();
         that.dataTable_all_searchInfo = {
-            companyId: this.domObj.find(".department option:selected").val(),
+            deptId: this.domObj.find(".department option:selected").val(),
             userId: this.domObj.find(".users option:selected").val(),
             regionId: this.domObj.find(".region option:selected").val(),
             childPlanState: this.domObj.find(".state option:selected").val(),