Jelajahi Sumber

Merge remote-tracking branch 'origin/master'

[user3] 4 tahun lalu
induk
melakukan
3efb58da9e

+ 2 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectRecordsController.java

@@ -160,6 +160,8 @@ public class RuralCostProjectRecordsController extends BaseController {
 		}else {
 		    projectRecords.setCreateBy(UserUtils.getUser());
 		    projectRecords.setCreateDate(new Date());
+			projectRecords.setLeaderIds(UserUtils.getUser().getId());
+			projectRecords.setLeaderNameStr(UserUtils.getUser().getName());
         }
 		model.addAttribute("ruralProjectRecords", projectRecords);
 		return "modules/ruralprojectrecords/cost/ruralCostProjectRecordsForm";

+ 2 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectRecordsController.java

@@ -151,6 +151,8 @@ public class RuralProjectRecordsController extends BaseController {
 		}else {
 		    projectRecords.setCreateBy(UserUtils.getUser());
 		    projectRecords.setCreateDate(new Date());
+			projectRecords.setLeaderIds(UserUtils.getUser().getId());
+			projectRecords.setLeaderNameStr(UserUtils.getUser().getName());
         }
 		model.addAttribute("ruralProjectRecords", projectRecords);
 		return "modules/ruralprojectrecords/ruralProjectRecordsForm";

+ 9 - 0
src/main/java/com/jeeplus/modules/workclientinfo/entity/WorkClientInfo.java

@@ -68,6 +68,7 @@ public class WorkClientInfo extends DataEntity<WorkClientInfo> {
 	private String createId;     //创建人id
 
 	private String jobTypeStr;
+	private Integer jobTypeShow;
 
 	public String getUnitIntroduction() {
 		return unitIntroduction;
@@ -541,4 +542,12 @@ public class WorkClientInfo extends DataEntity<WorkClientInfo> {
 	public void setCreateId(String createId) {
 		this.createId = createId;
 	}
+
+	public Integer getJobTypeShow() {
+		return jobTypeShow;
+	}
+
+	public void setJobTypeShow(Integer jobTypeShow) {
+		this.jobTypeShow = jobTypeShow;
+	}
 }

+ 1 - 0
src/main/java/com/jeeplus/modules/workclientinfo/web/WorkClientInfoController.java

@@ -120,6 +120,7 @@ public class WorkClientInfoController extends BaseController {
 			area.setId("9AF3266E03384019BFE935DD9F35332F");
 			area.setName("南京");
 			workClientInfo1.setArea(area);
+			workClientInfo1.setJobTypeShow(workClientInfo.getJobTypeShow());
 			model.addAttribute("workClientInfo", workClientInfo1);
 			return "modules/workclientinfo/workClientInfoForm";
 		}

+ 2 - 2
src/main/webapp/WEB-INF/tags/sys/inquireselectUser.tag

@@ -88,8 +88,8 @@
 							top.layer.msg("不能进行多选,请重新选择。", {icon: 0});
 							return false;
 						}*/
-						$("#${id}Id").val(ids.join(",").replace(/u_/ig,""));
-						$("#${id}Name").val(names.join(","));
+						$("#${id}Id").val(ids.join(",").replace(/u_/ig,"")).change();
+						$("#${id}Name").val(names.join(",")).change();
 						$("#${id}officeId").val(officeIds.join(","));
 						console.log(officeIds)
 						$("#${id}Name").focus();

+ 111 - 22
src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralCostProjectRecordsForm.jsp

@@ -802,9 +802,8 @@
                 <div class="layui-item layui-col-sm6 lw7">
                     <label class="layui-form-label"><span class="require-item">*</span>项目负责人:</label>
                     <div class="layui-input-block  with-icon">
-                        <form:input path="createBy.name" htmlEscape="false"  readonly="true"  class="form-control  layui-input"/>
-<%--                        <sys:inquireselectUser id="master" name="projectLeaders" value="${ruralProjectRecords.leaderIds}" labelName="leaderNameStr" labelValue="${ruralProjectRecords.leaderNameStr}"--%>
-<%--                                        title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control required layui-input" allowClear="true" notAllowSelectParent="true"/>--%>
+                        <sys:treeselect id="master" name="projectLeaders" value="${ruralProjectRecords.leaderIds}" labelName="leaderNameStr" labelValue="${ruralProjectRecords.leaderNameStr}"
+                                        title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control required layui-input" allowClear="true" notAllowSelectParent="true"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw7">
@@ -977,8 +976,8 @@
                 </div>
                 <div id="addUserButton" class="layui-item nav-btns" style="float: left;">
                     <a id="aButton" href="javascript:void(0)"
-                       onclick="openBill2('新增客户管理', '${ctx}/workclientinfo/workClientInfo/form?param=2','95%','95%',false,'inputForm')"
-                       class="nav-btn nav-btn-add"><i class="fa fa-plus"></i> 新增客户</a>
+                       onclick="openBill2('新增委托方管理', '${ctx}/workclientinfo/workClientInfo/form?param=2&jobTypeShow=1','95%','95%',false,'inputForm')"
+                       class="nav-btn nav-btn-add"><i class="fa fa-plus"></i> 新增委托方信息</a>
                 </div>
 
                 <div class="layui-item layui-col-xs12 form-table-container" style="padding:0px">
@@ -1039,9 +1038,15 @@
 
             <div class="form-group layui-row">
                 <div class="form-group-label"><h2>施工方信息</h2></div>
+                <div class="layui-item nav-btns" style="float: left;width: 155px">
+                    <sys:gridselectConstruction url="${ctx}/workclientinfo/workClientInfo/clientInfolist" id="constructionOrgList" title="选择施工单位"
+                                                cssClass="form-control required" fieldLabels="${fns:urlEncode('客户编号')}" fieldKeys="name" searchLabel="${fns:urlEncode('客户名称')}" searchKey="name"></sys:gridselectConstruction>
+                </div>
+
                 <div class="layui-item nav-btns">
-                    <sys:gridselectClientLink url="${ctx}/workclientinfo/workClientInfo/clientInfolist" id="constructionOrgList"   title="选择施工单位"
-                                              cssClass="form-control required" fieldLabels="${fns:urlEncode('客户编号')}" fieldKeys="name"  searchLabel="${fns:urlEncode('客户名称')}" searchKey="name"></sys:gridselectClientLink>
+                    <a href="javascript:void(0)"
+                       onclick="openBill3('新增施工方信息', '${ctx}/workclientinfo/workClientInfo/form?param=2&jobTypeShow=3','95%','95%',false,'inputForm')"
+                       class="nav-btn nav-btn-add"><i class="fa fa-plus"></i> 新增施工方信息</a>
                 </div>
                 <div class="layui-item layui-col-xs12 form-table-container">
                     <table id="contentTable2" class="table table-bordered table-condensed details">
@@ -1061,22 +1066,23 @@
                     <script type="text/template" id="workConstructionLinkmanTpl">//<!--
 					<tr id="workConstructionLinkmanList{{idx}}">
 					<td class="hide">
-						<input id="workConstructionLinkmanList{{idx}}_id" name="workConstructionLinkmanList[{{idx}}].id" type="hidden" value="{{row.id}}" class="linkmanId"/>
-						<input id="workConstructionLinkmanList{{idx}}_delFlag" name="workConstructionLinkmanList[{{idx}}].delFlag" type="hidden" value="0"/>
-					</td>
-					<td style="text-align: center">
-						<input id="workConstructionLinkmanList{{idx}}_cid" name = "workConstructionLinkmanList[{{idx}}].clientId.id" type="hidden" value="{{row.clientId.id}}"/>
-						{{row.clientId.name}}
-					</td>
-					<td style="text-align: center">
-						{{row.name }}
-					</td>
-					<td style="text-align: center">
-						{{row.linkPhone}}
-					</td>
-					<td style="text-align: center">
-						{{row.linkMobile}}
+                        <input id="workConstructionLinkmanList{{idx}}_id" name="workConstructionLinkmanList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
+                        <input id="workConstructionLinkmanList{{idx}}_clientId_id" name="workConstructionLinkmanList[{{idx}}].clientId.id" type="hidden" value="{{row.clientId.id}}"/>
+                        <input id="workConstructionLinkmanList{{idx}}_delFlag" name="workConstructionLinkmanList[{{idx}}].delFlag" type="hidden" value="0"/>
 					</td>
+                    <td>
+                        <input <input style="background-color: #FFFFFF;" readonly="true" id="workConstructionLinkmanList{{idx}}_clientName" name="workConstructionLinkmanList[{{idx}}].clientId.name" type="text" value="{{row.clientId.name}}"    class="form-control "/>
+                    </td>
+                    <td>
+                        <input <input style="background-color: #FFFFFF;" readonly="true" id="workConstructionLinkmanList{{idx}}_name" name="workConstructionLinkmanList[{{idx}}].name" type="text" value="{{row.name}}"    class="form-control required"/>
+                    </td>
+
+                    <td>
+                        <input <input style="background-color: #FFFFFF;" readonly="true" id="workConstructionLinkmanList{{idx}}_linkPhone" name="workConstructionLinkmanList[{{idx}}].linkPhone" type="text" value="{{row.linkPhone}}"    class="form-control isTel"/>
+                    </td>
+                    <td>
+                        <input <input style="background-color: #FFFFFF;" readonly="true" id="workConstructionLinkmanList{{idx}}_linkMobile" name="workConstructionLinkmanList[{{idx}}].linkMobile" type="text" value="{{row.linkMobile}}"    class="form-control isPhone"/>
+                    </td>
 					<td class="text-center" width="10">
 						{{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workConstructionLinkmanList{{idx}}')" title="删除"><i class="fa fa-trash"></i>&nbsp;删除</span>{{/delBtn}}
 					</td>
@@ -1243,5 +1249,88 @@
         </form:form>
     </div>
 </div>
+<script>
+    function openBill3(title,url,width,height,target,formId){
+
+        var frameIndex = parent.layer.getFrameIndex(window.name);
+        var urls = url+"&index="+frameIndex;
+        if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+            width='auto';
+            height='auto';
+        }else{//如果是PC端,根据用户设置的width和height显示。
+
+        }
+        top.layer.open({
+            type: 2,
+            area: [width, height],
+            title: title,
+            skin:"two-btns",
+            maxmin: false, //开启最大化最小化按钮
+            content: urls ,
+            btn: ['确定','关闭'],
+            yes: function(index, layero){
+                var body = top.layer.getChildFrame('body', index);
+                var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                var inputForm = body.find('#inputForm');
+                var top_iframe;
+                if(target){
+                    top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                }else{
+                    top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                }
+                inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                inputForm.attr("action","${ctx}/ruralProject/ruralProjectRecords/linkManSave");//表单提交成功后,从服务器返回的url在当前tab中展示
+                var $document = iframeWin.contentWindow.document;
+
+                formSubmit3($document,formId,index);
+            },
+            cancel: function(index){
+            }
+        });
+
+
+        function formSubmit3($document,inputForm,index){
+            var validateForm = $($document.getElementById(inputForm)).validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $($document.getElementById("#messageBox")).text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+            if(validateForm.form()){
+                $($document.getElementById(inputForm)).ajaxSubmit({
+                    success:function(data) {
+                        var d = data;
+                        if(d.msg == "false"){
+                            parent.layer.msg("保存客户信息异常!",{icon:2});
+                            return false;
+                        }
+
+                        addRow("#workConstructionLinkmanList",workConstructionLinkmanRowIdx,workConstructionLinkmanTpl);
+                        workConstructionLinkmanRowIdx=workConstructionLinkmanRowIdx+1;
+                        var row = workClientLinkmanRowIdx;
+
+                        $("#"+"workConstructionLinkmanList"+row+"_id").val(d.id);
+                        $("#"+"workConstructionLinkmanList"+row+"_clientId_id").val(d.clientId);
+                        $("#"+"workConstructionLinkmanList"+row+"_clientName").val(d.clientName);
+                        $("#"+"workConstructionLinkmanList"+row+"_name").val(d.linkName);
+                        $("#"+"workConstructionLinkmanList"+row+"_linkMobile").val(d.linkMobile);
+                        $("#"+"workConstructionLinkmanList"+row+"_linkPhone").val(d.linkPhone);
+                        parent.layer.msg(d.str,{icon:1});
+                        top.layer.close(index)
+                    }
+                });
+            }
+        }
+    }
+</script>
 </body>
 </html>

+ 112 - 23
src/main/webapp/webpage/modules/ruralprojectrecords/ruralProjectRecordsForm.jsp

@@ -823,9 +823,8 @@
                 <div class="layui-item layui-col-sm6 lw7">
                     <label class="layui-form-label"><span class="require-item">*</span>项目负责人:</label>
                     <div class="layui-input-block  with-icon">
-                        <form:input path="createBy.name" htmlEscape="false"  readonly="true"  class="form-control  layui-input"/>
-<%--                        <sys:inquireselectUser id="master" name="projectLeaders" value="${ruralProjectRecords.leaderIds}" labelName="leaderNameStr" labelValue="${ruralProjectRecords.leaderNameStr}"--%>
-<%--                                         title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control required layui-input" allowClear="true" notAllowSelectParent="true"/>--%>
+                        <sys:inquireselectUser id="master" name="projectLeaders" value="${ruralProjectRecords.leaderIds}" labelName="leaderNameStr" labelValue="${ruralProjectRecords.leaderNameStr}"
+                                         title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control required layui-input" allowClear="true" notAllowSelectParent="true"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw7">
@@ -989,8 +988,8 @@
                 </div>
                 <div id="addUserButton" class="layui-item nav-btns" style="float: left;">
                     <a id="aButton" href="javascript:void(0)"
-                       onclick="openBill2('新增客户管理', '${ctx}/workclientinfo/workClientInfo/form?param=2','95%','95%',false,'inputForm')"
-                       class="nav-btn nav-btn-add"><i class="fa fa-plus"></i> 新增客户</a>
+                       onclick="openBill2('新增委托方管理', '${ctx}/workclientinfo/workClientInfo/form?param=2&jobTypeShow=1','95%','95%',false,'inputForm')"
+                       class="nav-btn nav-btn-add"><i class="fa fa-plus"></i> 新增委托方信息</a>
                 </div>
 
                 <div class="layui-item layui-col-xs12 form-table-container" style="padding:0px">
@@ -1051,9 +1050,14 @@
 
             <div class="form-group layui-row">
                 <div class="form-group-label"><h2>施工方信息</h2></div>
-                <div class="layui-item nav-btns">
-                    <sys:gridselectClientLink url="${ctx}/workclientinfo/workClientInfo/clientInfolist" id="constructionOrgList"   title="选择施工单位"
-                                              cssClass="form-control required" fieldLabels="${fns:urlEncode('客户编号')}" fieldKeys="name"  searchLabel="${fns:urlEncode('客户名称')}" searchKey="name"></sys:gridselectClientLink>
+                <div class="layui-item nav-btns" style="float: left;width: 155px">
+                    <sys:gridselectConstruction url="${ctx}/workclientinfo/workClientInfo/clientInfolist" id="constructionOrgList" title="选择施工单位"
+                                                cssClass="form-control required" fieldLabels="${fns:urlEncode('客户编号')}" fieldKeys="name" searchLabel="${fns:urlEncode('客户名称')}" searchKey="name"></sys:gridselectConstruction>
+                </div>
+                <div class="layui-item nav-btns" >
+                    <a href="javascript:void(0)"
+                       onclick="openBill3('新增施工方信息', '${ctx}/workclientinfo/workClientInfo/form?param=2&jobTypeShow=3','95%','95%',false,'inputForm')"
+                       class="nav-btn nav-btn-add"><i class="fa fa-plus"></i> 新增施工方信息</a>
                 </div>
                 <div class="layui-item layui-col-xs12 form-table-container">
                     <table id="contentTable2" class="table table-bordered table-condensed details">
@@ -1073,22 +1077,24 @@
                     <script type="text/template" id="workConstructionLinkmanTpl">//<!--
 					<tr id="workConstructionLinkmanList{{idx}}">
 					<td class="hide">
-						<input id="workConstructionLinkmanList{{idx}}_id" name="workConstructionLinkmanList[{{idx}}].id" type="hidden" value="{{row.id}}" class="linkmanId"/>
-						<input id="workConstructionLinkmanList{{idx}}_delFlag" name="workConstructionLinkmanList[{{idx}}].delFlag" type="hidden" value="0"/>
-					</td>
-					<td style="text-align: center">
-						<input id="workConstructionLinkmanList{{idx}}_cid" name = "workConstructionLinkmanList[{{idx}}].clientId.id" type="hidden" value="{{row.clientId.id}}"/>
-						{{row.clientId.name}}
-					</td>
-					<td style="text-align: center">
-						{{row.name }}
-					</td>
-					<td style="text-align: center">
-						{{row.linkPhone}}
-					</td>
-					<td style="text-align: center">
-						{{row.linkMobile}}
+                        <input id="workConstructionLinkmanList{{idx}}_id" name="workConstructionLinkmanList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
+                        <input id="workConstructionLinkmanList{{idx}}_clientId_id" name="workConstructionLinkmanList[{{idx}}].clientId.id" type="hidden" value="{{row.clientId.id}}"/>
+                        <input id="workConstructionLinkmanList{{idx}}_delFlag" name="workConstructionLinkmanList[{{idx}}].delFlag" type="hidden" value="0"/>
 					</td>
+                    <td>
+                        <input <input style="background-color: #FFFFFF;" readonly="true" id="workConstructionLinkmanList{{idx}}_clientName" name="workConstructionLinkmanList[{{idx}}].clientId.name" type="text" value="{{row.clientId.name}}"    class="form-control "/>
+                    </td>
+                    <td>
+                        <input <input style="background-color: #FFFFFF;" readonly="true" id="workConstructionLinkmanList{{idx}}_name" name="workConstructionLinkmanList[{{idx}}].name" type="text" value="{{row.name}}"    class="form-control required"/>
+                    </td>
+
+                    <td>
+                        <input <input style="background-color: #FFFFFF;" readonly="true" id="workConstructionLinkmanList{{idx}}_linkPhone" name="workConstructionLinkmanList[{{idx}}].linkPhone" type="text" value="{{row.linkPhone}}"    class="form-control isTel"/>
+                    </td>
+                    <td>
+                        <input <input style="background-color: #FFFFFF;" readonly="true" id="workConstructionLinkmanList{{idx}}_linkMobile" name="workConstructionLinkmanList[{{idx}}].linkMobile" type="text" value="{{row.linkMobile}}"    class="form-control isPhone"/>
+                    </td>
+
 					<td class="text-center" width="10">
 						{{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workConstructionLinkmanList{{idx}}')" title="删除"><i class="fa fa-trash"></i>&nbsp;删除</span>{{/delBtn}}
 					</td>
@@ -1255,5 +1261,88 @@
         </form:form>
     </div>
 </div>
+<script>
+    function openBill3(title,url,width,height,target,formId){
+
+        var frameIndex = parent.layer.getFrameIndex(window.name);
+        var urls = url+"&index="+frameIndex;
+        if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+            width='auto';
+            height='auto';
+        }else{//如果是PC端,根据用户设置的width和height显示。
+
+        }
+        top.layer.open({
+            type: 2,
+            area: [width, height],
+            title: title,
+            skin:"two-btns",
+            maxmin: false, //开启最大化最小化按钮
+            content: urls ,
+            btn: ['确定','关闭'],
+            yes: function(index, layero){
+                var body = top.layer.getChildFrame('body', index);
+                var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                var inputForm = body.find('#inputForm');
+                var top_iframe;
+                if(target){
+                    top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                }else{
+                    top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                }
+                inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                inputForm.attr("action","${ctx}/ruralProject/ruralProjectRecords/linkManSave");//表单提交成功后,从服务器返回的url在当前tab中展示
+                var $document = iframeWin.contentWindow.document;
+
+                formSubmit3($document,formId,index);
+            },
+            cancel: function(index){
+            }
+        });
+
+
+        function formSubmit3($document,inputForm,index){
+            var validateForm = $($document.getElementById(inputForm)).validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $($document.getElementById("#messageBox")).text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+            if(validateForm.form()){
+                $($document.getElementById(inputForm)).ajaxSubmit({
+                    success:function(data) {
+                        var d = data;
+                        if(d.msg == "false"){
+                            parent.layer.msg("保存客户信息异常!",{icon:2});
+                            return false;
+                        }
+
+                        addRow("#workConstructionLinkmanList",workConstructionLinkmanRowIdx,workConstructionLinkmanTpl);
+                        workConstructionLinkmanRowIdx=workConstructionLinkmanRowIdx+1;
+                        var row = workClientLinkmanRowIdx;
+
+                        $("#"+"workConstructionLinkmanList"+row+"_id").val(d.id);
+                        $("#"+"workConstructionLinkmanList"+row+"_clientId_id").val(d.clientId);
+                        $("#"+"workConstructionLinkmanList"+row+"_clientName").val(d.clientName);
+                        $("#"+"workConstructionLinkmanList"+row+"_name").val(d.linkName);
+                        $("#"+"workConstructionLinkmanList"+row+"_linkMobile").val(d.linkMobile);
+                        $("#"+"workConstructionLinkmanList"+row+"_linkPhone").val(d.linkPhone);
+                        parent.layer.msg(d.str,{icon:1});
+                        top.layer.close(index)
+                    }
+                });
+            }
+        }
+    }
+</script>
 </body>
 </html>

+ 2 - 2
src/main/webapp/webpage/modules/ruralprojectrecords/ruralProjectRecordsModify.jsp

@@ -1030,8 +1030,8 @@
             <div class="form-group layui-row">
                 <div class="form-group-label"><h2>施工方信息</h2></div>
                 <div class="layui-item nav-btns">
-                    <sys:gridselectClientLink url="${ctx}/workclientinfo/workClientInfo/clientInfolist" id="constructionOrgList"   title="选择施工单位"
-                                              cssClass="form-control required" fieldLabels="客户编号" fieldKeys="name"  searchLabel="客户名称" searchKey="name"></sys:gridselectClientLink>
+                    <sys:gridselectConstruction url="${ctx}/workclientinfo/workClientInfo/clientInfolist" id="constructionOrgList"   title="选择施工单位"
+                                              cssClass="form-control required" fieldLabels="客户编号" fieldKeys="name"  searchLabel="客户名称" searchKey="name"></sys:gridselectConstruction>
                 </div>
                 <div class="layui-item layui-col-xs12 form-table-container">
                     <table id="contentTable2" class="table table-bordered table-condensed details">

+ 26 - 7
src/main/webapp/webpage/modules/workclientinfo/workClientInfoForm.jsp

@@ -450,6 +450,7 @@
                    onkeydown="if(event.keyCode==13)return false;" action="${ctx}/workclientinfo/workClientInfo/save"
                    method="post" class="form-horizontal">
             <form:hidden path="id"/>
+            <form:hidden path="jobTypeShow"/>
             <input type="hidden" id="jobTypeStr" name="jobTypeStr" value="">
             <div class="form-group layui-row first">
                 <div class="form-group-label"><h2>基本信息</h2></div>
@@ -997,15 +998,33 @@
                                     }
                                 }
                                 if(0 == showDataList.length){
-                                    var newData = {
-                                        "name": newDataList[0].name,
-                                        "value": newDataList[0].value,
-                                        "selected": true
+                                    var jobTypeShow = $("#jobTypeShow").val();
+                                    if(undefined != jobTypeShow && null != jobTypeShow && '' != jobTypeShow){
+                                        for (i in newDataList) {
+                                            if (newDataList[i].value == jobTypeShow) {
+                                                var newData = {
+                                                    "name": newDataList[i].name,
+                                                    "value": newDataList[i].value,
+                                                    "selected": true
+
+                                                }
+                                                lists.push(newDataList[i].value);
+                                                showList.push(newData);
+                                                data.splice(i,1,newData);
+                                            }
+                                        }
+                                    }else{
 
+                                        var newData = {
+                                            "name": newDataList[0].name,
+                                            "value": newDataList[0].value,
+                                            "selected": true
+
+                                        }
+                                        lists.push(newDataList[0].value);
+                                        showList.push(newData);
+                                        data.splice(0,1,newData);
                                     }
-                                    lists.push(newDataList[0].value);
-                                    showList.push(newData);
-                                    data.splice(0,1,newData);
                                 }
 
                                 $("#jobTypeStr").val(lists);