瀏覽代碼

admin修改项目信息

user5 2 年之前
父節點
當前提交
1f4e906a19

+ 4 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java

@@ -675,6 +675,10 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 		projectRecords.setOffice(office);
 		projectRecords.preUpdate();
 		dao.adminUpdateProject(projectRecords);
+
+		//保存委托方联系人1
+		List<WorkClientLinkman> workClientLinkmanList = projectRecords.getWorkClientLinkmanList();
+		this.saveLinkmanInfos(projectRecords.getId(), workClientLinkmanList, 1);
 	}
 
 

+ 114 - 34
src/main/webapp/webpage/modules/ruralprojectrecords/ruralProjectRecordsAdminModify.jsp

@@ -10,7 +10,18 @@
     <link rel='stylesheet' type="text/css" href="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.css"/>
     <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/layuidown.css"/>
     <script type="text/javascript" src="${ctxStatic}/layui/layuidown.js"></script>
-	<style>
+    <style>
+        #projectDesc-error{
+            left:0;
+            top:82px;
+        }
+        .layui-layer-dialog{
+            background: red;
+        }
+        td input{
+            margin-left:-10px !important;
+            height: 42px !important;
+        }
         .disables {
             pointer-events: none;
         }
@@ -24,9 +35,16 @@
         .notForbidden{
             background-color:#3ca2e0;
         }
+        .spanzj{
+            color:red;
+            font-size: 12px;
+            padding-left: 10px;
+        }
     </style>
     <script type="text/javascript">
-		var validateForm;
+        var validateForm;
+        var isMasterClient = true;//是否是委托方
+        var clientCount = 0;
 		function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
 		  if(validateForm.form()){
               var startDate = new Date($("#startDate").val());
@@ -252,18 +270,68 @@
                 },
                 success:function(data){
                     $("#contractName").val(data.name);
+                    $("#otherDetails").val(data.otherDetails);
                     $("#contractPrice").val(data.contractPrice);
                     formatNum($("#contractPrice"));
                     $("#contractClientName").val(data.client.name);
                     $("#contractClientId").val(data.client.id);
-                    $("#constructionProjectType").val(data.constructionProjectTypeStr);
+                    $("#constructionProjectType").val(data.contractType);
                     $("#linkmanId").val(data.workClinetInfoIds);
+                    //清理之前的联系人
+                    var newClientId  = data.client.id;
+                    if(clientId != newClientId){
+                        $("#workClientLinkmanList tr").remove();
+                        //if(isMasterClient){
+                        clientCount++;
+                        setLinkMan(newClientId);
+                        isMasterClient = false;
+                        // }
+                    }
+                    // console.log("clientId------newClientId");
+                    // console.log(clientId+"------"+newClientId);
                 }
-            })
-            var newClientId  =$("#contractClientId").val();
-            if (clientId != newClientId){
-				$("#workClientLinkmanList tr").remove();
-			}
+            });
+        }
+
+        function setLinkMan(newClientId) {
+            $.ajax({
+                url:"${ctx}/ruralProject/ruralProjectRecords/getLinkManByClientId",
+                data:{"clientId":newClientId},
+                type:"post",
+                dataType:"json",
+                success:function (d) {
+                    // console.log(d);
+                    addRow('#workClientLinkmanList', workClientLinkmanRowIdx, workClientLinkmanTpl);workClientLinkmanRowIdx = workClientLinkmanRowIdx + 1;
+                    var row = workClientLinkmanRowIdx - 1 ;
+                    $("#workClientLinkmanList"+row+"_id").val(d.id);
+                    $("#workClientLinkmanList"+row+"_clientId_id").val(d.clientId);
+                    $("#workClientLinkmanList"+row+"_clientName").val(d.clientName);
+                    $("#workClientLinkmanList"+row+"_name").val(d.linkName);
+                    $("#workClientLinkmanList"+row+"_linkMobile").val(d.linkMobile);
+                    $("#workClientLinkmanList"+row+"_linkPhone").val(d.linkPhone);
+                    $("#workClientLinkmanList"+row+"_clientName").prop("readonly","readonly");
+                    $("#workClientLinkmanList"+row+"_name").prop("readonly","readonly");
+                    $("#workClientLinkmanList"+row+"_linkMobile").prop("readonly","readonly");
+                    $("#workClientLinkmanList"+row+"_linkPhone").prop("readonly","readonly");
+
+                    //按钮禁用
+                    $("#addUserButton").removeClass("disables");
+                    $("#addUserButton").removeClass("notDisables");
+                    $("#addUserButton").addClass("disables");
+                    //a标签置灰
+                    $("#aButton").removeClass("forbidden");
+                    $("#aButton").removeClass("notForbidden");
+                    $("#aButton").addClass("forbidden");
+
+                    $("#linkmanDiv").removeClass("disables");
+                    $("#linkmanDiv").removeClass("notDisables");
+                    $("#linkmanDiv").addClass("disables");
+
+                    $("#linkmanButton").removeClass("forbidden");
+                    $("#linkmanButton").removeClass("notForbidden");
+                    $("#linkmanButton").addClass("forbidden");
+                }
+            });
         }
 
         function setValuee(obj){
@@ -1003,40 +1071,52 @@
 
             <div class="form-group layui-row">
                 <div class="form-group-label"><h2><span class="require-item">*</span>委托方联系人信息</h2></div>
+                <div id="linkmanDiv" class="layui-item nav-btns" style="float: left;width: 155px">
+                    <sys:gridselect1  id="linkman" url="${ctx}/workclientinfo/workClientInfo/linkmanList"
+                                      name="linkman.id"  title="选择客户"
+                                      value="${ruralProjectRecords.workContractInfo.workClinetInfoIds}"
+                                      cssClass="form-control required" fieldLabels="联系人" fieldKeys="name"
+                                      searchLabel="联系人" searchKey="name"></sys:gridselect1>
+                </div>
                 <div class="layui-item layui-col-xs12 form-table-container">
                     <table id="contentTable" class="table table-bordered table-condensed details">
                         <thead>
-                    <tr>
-                        <th class="hide"></th>
-                        <th width="20%">委托方</th>
-                        <th width="20%">联系人姓名</th>
-                        <th width="20%">联系方式1</th>
-                        <th width="20%">联系方式2</th>
-                    </tr>
+                        <tr>
+                            <th class="hide"></th>
+                            <th width="20%"><font color="red">*</font>委托方</th>
+                            <th width="20%">联系人姓名</th>
+                            <th width="20%">联系方式1</th>
+                            <th width="20%">联系方式2</th>
+                            <th width="20%">操作</th>
+                        </tr>
                     </thead>
                         <tbody id="workClientLinkmanList">
                         </tbody>
                     </table>
                     <script type="text/template" id="workClientLinkmanTpl">//<!--
-					<tr id="workClientLinkmanList{{idx}}">
-					<td class="hide">
-						<input id="workClientLinkmanList{{idx}}_id" name="workClientLinkmanList[{{idx}}].id" type="hidden" value="{{row.id}}" class="clientId"/>
-						<input id="workClientLinkmanList{{idx}}_delFlag" name="workClientLinkmanList[{{idx}}].delFlag" type="hidden" value="0"/>
-					</td>
-					<td>
-						<input id="workClientLinkmanList{{idx}}_cid" name = "workClientLinkmanList[{{idx}}].clientId.id" type="hidden" value="{{row.clientId.id}}"/>
-						{{row.clientId.name}}
-					</td>
-					<td>
-						{{row.name}}
-					</td>
-					<td>
-						{{row.linkPhone}}
-					</td>
-					<td>
-						{{row.linkMobile}}
-					</td>
-				</tr>//-->
+            <tr id="workClientLinkmanList{{idx}}">
+                <td class="hide">
+                    <input id="workClientLinkmanList{{idx}}_id" name="workClientLinkmanList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
+                    <input id="workClientLinkmanList{{idx}}_clientId_id" name="workClientLinkmanList[{{idx}}].clientId.id" type="hidden" value="{{row.clientId.id}}"/>
+                    <input id="workClientLinkmanList{{idx}}_delFlag" name="workClientLinkmanList[{{idx}}].delFlag" type="hidden" value="0"/>
+                </td>
+                <td>
+                    <input <input style="background-color: #FFFFFF;" readonly="true" id="workClientLinkmanList{{idx}}_clientName" name="workClientLinkmanList[{{idx}}].clientId.name" type="text" value="{{row.clientId.name}}"    class="form-control "/>
+                </td>
+                <td>
+                    <input <input style="background-color: #FFFFFF;" readonly="true" id="workClientLinkmanList{{idx}}_name" name="workClientLinkmanList[{{idx}}].name" type="text" value="{{row.name}}"    class="form-control required"/>
+                </td>
+
+                <td>
+                    <input <input style="background-color: #FFFFFF;" readonly="true" id="workClientLinkmanList{{idx}}_linkPhone" name="workClientLinkmanList[{{idx}}].linkPhone" type="text" value="{{row.linkPhone}}"    class="form-control isTel"/>
+                </td>
+                <td>
+                    <input <input style="background-color: #FFFFFF;" readonly="true" id="workClientLinkmanList{{idx}}_linkMobile" name="workClientLinkmanList[{{idx}}].linkMobile" type="text" value="{{row.linkMobile}}"    class="form-control isPhone"/>
+                </td>
+                <td class="text-center op-td" >
+                    {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delEntrustRow(this, '#workClientLinkmanList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}
+                </td>
+            </tr>//-->
                     </script>
                 </div>
             </div>