瀏覽代碼

1. 修改信息:用户可以维护档案信息,(form中记录会重复暂未修复)
2. 项目登记:无合同状态下,添加联系人,暂存项目及显示所添加的项目运行正常。
送审功能暂未修复(登记时没有项目设置Office)。

user4 5 年之前
父節點
當前提交
cbe083eb2c

+ 16 - 3
src/main/java/com/jeeplus/modules/projectrecord/service/ProjectRecordsService.java

@@ -36,6 +36,7 @@ import com.jeeplus.modules.workactivity.service.WorkActivityProcessService;
 import com.jeeplus.modules.workactivitymenu.entity.WorkActivityMenu;
 import com.jeeplus.modules.workactivitymenu.entity.WorkActivityMenu;
 import com.jeeplus.modules.workactivitymenu.service.WorkActivityMenuService;
 import com.jeeplus.modules.workactivitymenu.service.WorkActivityMenuService;
 import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
 import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
+import com.jeeplus.modules.workclientinfo.dao.WorkClientInfoDao;
 import com.jeeplus.modules.workclientinfo.dao.WorkClientLinkmanDao;
 import com.jeeplus.modules.workclientinfo.dao.WorkClientLinkmanDao;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
@@ -57,6 +58,7 @@ import org.activiti.engine.history.HistoricTaskInstanceQuery;
 import org.activiti.engine.runtime.ProcessInstance;
 import org.activiti.engine.runtime.ProcessInstance;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.java_websocket.WebSocket;
 import org.java_websocket.WebSocket;
+import org.openxmlformats.schemas.drawingml.x2006.main.CTOfficeArtExtension;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Propagation;
@@ -229,17 +231,24 @@ public class ProjectRecordsService extends CrudService<ProjectRecordsDao, Projec
 		long t1 = System.currentTimeMillis();
 		long t1 = System.currentTimeMillis();
 
 
 		WorkContractInfo workContractInfo = null;
 		WorkContractInfo workContractInfo = null;
+		WorkClientInfo workClientInfo = new WorkClientInfo();
 		Office company= new Office();
 		Office company= new Office();
 		Office office =  new Office();
 		Office office =  new Office();
         if(StringUtils.isNotBlank((projectRecords.getWorkContractInfo().getId()))){
         if(StringUtils.isNotBlank((projectRecords.getWorkContractInfo().getId()))){
             //有合同状态
             //有合同状态
 			workContractInfo = workContractInfoDao.get(projectRecords.getWorkContractInfo().getId());
 			workContractInfo = workContractInfoDao.get(projectRecords.getWorkContractInfo().getId());
 			company.setId(workContractInfo.getCompanyId());
 			company.setId(workContractInfo.getCompanyId());
-			projectRecords.setCompany(company);
 			office.setId(workContractInfo.getChargeCompany());
 			office.setId(workContractInfo.getChargeCompany());
-			projectRecords.setOffice(office);
+        }else{
+        	//无合同
+			WorkClientLinkman workClientLinkman = projectRecords.getWorkClientLinkmanList().get(0);
+			workClientInfo = workClientInfoService.get(workClientLinkman.getClientId());
+			company.setId(workClientInfo.getCompanyId());
+			office.setId(workClientInfo.getOfficeId());
+		}
+		projectRecords.setCompany(company);
+		projectRecords.setOffice(office);
 
 
-        }
         Integer oldStatus = projectRecords.getProjectStatus();
         Integer oldStatus = projectRecords.getProjectStatus();
         projectRecords.setProjectStatus(projectStatus.getValue());
         projectRecords.setProjectStatus(projectStatus.getValue());
         User createBy = projectRecords.getCreateBy();
         User createBy = projectRecords.getCreateBy();
@@ -396,6 +405,10 @@ public class ProjectRecordsService extends CrudService<ProjectRecordsDao, Projec
 	 */
 	 */
 	public void queryLinkmanInfos(ProjectRecords projectRecords) {
 	public void queryLinkmanInfos(ProjectRecords projectRecords) {
 		List<WorkClientLinkman> clientLinkmanList = workClientLinkmanDao.queryProjectLinkmans(projectRecords.getId(), 1);
 		List<WorkClientLinkman> clientLinkmanList = workClientLinkmanDao.queryProjectLinkmans(projectRecords.getId(), 1);
+		for(WorkClientLinkman linkman :clientLinkmanList){
+			WorkClientInfo clientInfo = workClientInfoService.get(linkman.getClientId().getId());
+			linkman.setClientId(clientInfo);
+		}
 		projectRecords.setWorkClientLinkmanList(clientLinkmanList);
 		projectRecords.setWorkClientLinkmanList(clientLinkmanList);
 		List<WorkClientLinkman> constructionLinkmanList = workClientLinkmanDao.queryProjectLinkmans(projectRecords.getId(), 0);
 		List<WorkClientLinkman> constructionLinkmanList = workClientLinkmanDao.queryProjectLinkmans(projectRecords.getId(), 0);
 		projectRecords.setWorkConstructionLinkmanList(constructionLinkmanList);
 		projectRecords.setWorkConstructionLinkmanList(constructionLinkmanList);

+ 10 - 5
src/main/java/com/jeeplus/modules/projectrecord/web/ProjectRecordsController.java

@@ -590,21 +590,26 @@ public class ProjectRecordsController extends BaseController {
      */
      */
     @RequestMapping(value = "linkManSave")
     @RequestMapping(value = "linkManSave")
     @ResponseBody
     @ResponseBody
-    public WorkClientLinkman linkManSave(WorkClientInfo workClientInfo,
+    public Object linkManSave(WorkClientInfo workClientInfo,
                                                Model model, RedirectAttributes redirectAttributes,
                                                Model model, RedirectAttributes redirectAttributes,
                                                HttpServletRequest request
                                                HttpServletRequest request
     ) throws Exception{
     ) throws Exception{
-        WorkClientLinkman linkman = new WorkClientLinkman();
+    	Map<String,Object> map = new HashMap<>();
         try {
         try {
             //保存当前人的公司
             //保存当前人的公司
             workClientInfo.setCompanyId(UserUtils.getSelectCompany().getId());
             workClientInfo.setCompanyId(UserUtils.getSelectCompany().getId());
             workClientInfo.setOfficeId(UserUtils.getSelectOffice().getId());
             workClientInfo.setOfficeId(UserUtils.getSelectOffice().getId());
             workClientInfoService.save(workClientInfo);//保存
             workClientInfoService.save(workClientInfo);//保存
-
-            linkman = workClientInfo.getWorkClientLinkmanList().get(0);
+			WorkClientLinkman linkman = workClientInfo.getWorkClientLinkmanList().get(0);
+			map.put("id",linkman.getId());
+			map.put("clientId",workClientInfo.getId());
+			map.put("clientName",workClientInfo.getName());
+			map.put("linkName",linkman.getName());
+			map.put("linkMobile",linkman.getLinkMobile());
+			map.put("linkPhone",linkman.getLinkPhone());
         }catch (Exception e){
         }catch (Exception e){
             e.printStackTrace();
             e.printStackTrace();
         }
         }
-        return  linkman;
+		return map;
     }
     }
 }
 }

+ 53 - 40
src/main/webapp/webpage/modules/projectrecord/projectRecordsForm.jsp

@@ -5,7 +5,7 @@
     <title>项目管理</title>
     <title>项目管理</title>
     <meta name="decorator" content="default"/>
     <meta name="decorator" content="default"/>
     <script type="text/javascript" src="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.js"></script>
     <script type="text/javascript" src="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.js"></script>
-    <script type="text/javascript" src="${ctxStatic}/static/iCheck/icheck.min.js"></script>
+    <script type="text/javascript" src="${ctxStatic}/iCheck/icheck.min.js"></script>
     <link rel='stylesheet' type="text/css" href="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.css"/>
     <link rel='stylesheet' type="text/css" href="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.css"/>
     <style>
     <style>
         #projectDesc-error{
         #projectDesc-error{
@@ -263,6 +263,7 @@
                     var $document = iframeWin.contentWindow.document;
                     var $document = iframeWin.contentWindow.document;
 
 
                     formSubmit2($document,formId,index);
                     formSubmit2($document,formId,index);
+
                 },
                 },
                 cancel: function(index){
                 cancel: function(index){
                 }
                 }
@@ -271,39 +272,47 @@
 
 
         }
         }
 
 
-        function formSubmit2($document, inputForm, index) {
+        function formSubmit2($document,inputForm,index){
             var validateForm = $($document.getElementById(inputForm)).validate({
             var validateForm = $($document.getElementById(inputForm)).validate({
-                submitHandler: function (form) {
+                submitHandler: function(form){
                     loading('正在提交,请稍等...');
                     loading('正在提交,请稍等...');
                     form.submit();
                     form.submit();
                 },
                 },
                 errorContainer: "#messageBox",
                 errorContainer: "#messageBox",
-                errorPlacement: function (error, element) {
+                errorPlacement: function(error, element) {
                     $($document.getElementById("#messageBox")).text("输入有误,请先更正。");
                     $($document.getElementById("#messageBox")).text("输入有误,请先更正。");
-                    if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
                         error.appendTo(element.parent().parent());
                         error.appendTo(element.parent().parent());
                     } else {
                     } else {
                         error.insertAfter(element);
                         error.insertAfter(element);
                     }
                     }
                 }
                 }
             });
             });
-            if (validateForm.form()) {
+            if(validateForm.form()){
                 $($document.getElementById(inputForm)).ajaxSubmit({
                 $($document.getElementById(inputForm)).ajaxSubmit({
-                    success: function (data) {
+                    success:function(data) {
                         var d = data;
                         var d = data;
-                        if (d.msg == "false") {
-                            parent.layer.msg("保存客户信息异常!", {icon: 2});
+                        if(d.msg == "false"){
+                            parent.layer.msg("保存客户信息异常!",{icon:2});
                             return false;
                             return false;
                         }
                         }
-                        addRow('#workClientLinkmanList', workClientLinkmanRowIdx, workClientLinkmanRowIdx);
-                        workClientLinkmanRowIdx = workClientLinkmanRowIdx + 1;
-                        var row = workClientLinkmanRowIdx - 1;
-                        $("#" + "workClientLinkmanList" + row + "_id").val(d.id);
-                        $("#" + "workClientLinkmanList" + row + "_office").val(d.office);
-                        $("#" + "workClientLinkmanList" + row + "_name").val(d.name);
-                        $("#" + "workClientLinkmanList" + row + "_linkPhone").val(d.linkPhone);
-                        $("#" + "workClientLinkmanList" + row + "_linkMobile").val(d.linkMobile);
-                        parent.layer.msg(d.str, {icon: 1});
+                        console.log("-------success-----");
+                        addRow('#workClientLinkmanList', workClientLinkmanRowIdx, workClientLinkmanTpl);workClientLinkmanRowIdx = workClientLinkmanRowIdx + 1;
+                        var row = workClientLinkmanRowIdx - 1 ;
+
+                        $("#"+"workClientLinkmanList"+row+"_id").val(d.id);
+                        $("#"+"workClientLinkmanList"+row+"_clientId_id").val(d.clientId);
+                        console.log("------------")
+                        console.log(d.clientId);
+                        console.log("+++++++++++++++");
+                        console.log($("#"+"workClientLinkmanList"+row+"_clientId.id").val());
+
+                        $("#"+"workClientLinkmanList"+row+"_clientName").val(d.clientName);
+                        $("#"+"workClientLinkmanList"+row+"_name").val(d.linkName);
+                        $("#"+"workClientLinkmanList"+row+"_linkMobile").val(d.linkMobile);
+                        $("#"+"workClientLinkmanList"+row+"_linkPhone").val(d.linkPhone);
+                        $("#contractClientName").val(d.clientName);
+                        parent.layer.msg(d.str,{icon:1});
                         top.layer.close(index)
                         top.layer.close(index)
                     }
                     }
                 });
                 });
@@ -320,16 +329,18 @@
             <form:hidden path="workContractInfo.client.id" id="contractClientId" value="${workContractInfo.client.id}"/>
             <form:hidden path="workContractInfo.client.id" id="contractClientId" value="${workContractInfo.client.id}"/>
 
 
             <div class="form-group layui-row first">
             <div class="form-group layui-row first">
-                <div class="form-group-label"><h2>项目合同信息</h2></div>
-                <div class="layui-item layui-col-sm6 lw7">
-                    <label class="layui-form-label">合同情况:</label>
-                    <div class="layui-input-block">
-                        <input type="radio" class="i-checks" name="ext" checked id="ext" value="0">
-                        <label for="ext">有合同</label>
-                        <input type="radio" class="i-checks" name="ext" id="ext1" value="1">
-                        <label for="ext1">无合同</label>
-                    </div>
-                </div>
+               <div class="form-group layui-row">
+                   <div class="form-group-label"><h2>项目合同信息</h2></div>
+                   <div class="layui-item layui-col-sm6 lw7">
+                       <label class="layui-form-label">合同情况:</label>
+                       <div class="layui-input-block">
+                           <input type="radio" class="i-checks" name="ext" checked id="ext" value="0">
+                           <label for="ext">有合同</label>
+                           <input type="radio" class="i-checks" name="ext" id="ext1" value="1">
+                           <label for="ext1">无合同</label>
+                       </div>
+                   </div>
+               </div>
                 <div id="divv">
                 <div id="divv">
                     <div class="layui-item layui-col-sm12 lw7" id="d1">
                     <div class="layui-item layui-col-sm12 lw7" id="d1">
                         <label class="layui-form-label"><span class="require-item">*</span>选择合同:</label>
                         <label class="layui-form-label"><span class="require-item">*</span>选择合同:</label>
@@ -350,17 +361,17 @@
                             <input htmlEscape="false"  readonly="true" id="contractPrice"  class="form-control layui-input" value="${projectRecords.workContractInfo.contractPrice}" onchange="formatNum(this);"/>
                             <input htmlEscape="false"  readonly="true" id="contractPrice"  class="form-control layui-input" value="${projectRecords.workContractInfo.contractPrice}" onchange="formatNum(this);"/>
                         </div>
                         </div>
                     </div>
                     </div>
-                    <div class="layui-item layui-col-sm6 lw7">
-                        <label class="layui-form-label">主委托方:</label>
-                        <div class="layui-input-block">
-                            <input htmlEscape="false"  readonly="true" id="contractClientName" name="workContractInfo.client.name" class="form-control layui-input" value="${projectRecords.workContractInfo.client.name}"/>
-                        </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">主委托方:</label>
+                    <div class="layui-input-block">
+                        <input htmlEscape="false"  readonly="true" id="contractClientName" name="workContractInfo.client.name" class="form-control layui-input" value="${projectRecords.workContractInfo.client.name}"/>
                     </div>
                     </div>
-                    <div class="layui-item layui-col-sm6 lw7">
-                        <label class="layui-form-label">工程分类:</label>
-                        <div class="layui-input-block">
-                            <input htmlEscape="false"  readonly="true" id="constructionProjectType"  class="form-control layui-input" value="${projectRecords.workContractInfo.constructionProjectTypeStr}"/>
-                        </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">工程分类:</label>
+                    <div class="layui-input-block">
+                        <input htmlEscape="false"  readonly="true" id="constructionProjectType"  class="form-control layui-input" value="${projectRecords.workContractInfo.constructionProjectTypeStr}"/>
                     </div>
                     </div>
                 </div>
                 </div>
             </div>
             </div>
@@ -493,10 +504,11 @@
                                 <tr id="workClientInfoList${index.index}">
                                 <tr id="workClientInfoList${index.index}">
                                     <td class="hide">
                                     <td class="hide">
                                         <input id="workClientLinkmanList${index.index}_id" name="workClientLinkmanList[${index.index}].id" type="hidden" value="${casePeopleNorm.id}" class="clientInfoId"/>
                                         <input id="workClientLinkmanList${index.index}_id" name="workClientLinkmanList[${index.index}].id" type="hidden" value="${casePeopleNorm.id}" class="clientInfoId"/>
+                                        <input id="workClientLinkmanList${index.index}_clientId_id" name="workClientLinkmanList[${index.index}].clientId.id" type="hidden" value="${casePeopleNorm.clientId.id}" class="clientInfoId"/>
                                         <input id="workClientLinkmanList${index.index}_delFlag" name="workClientLinkmanList[${index.index}].delFlag" type="hidden" value="0"/>
                                         <input id="workClientLinkmanList${index.index}_delFlag" name="workClientLinkmanList[${index.index}].delFlag" type="hidden" value="0"/>
                                     </td>
                                     </td>
                                     <td>
                                     <td>
-                                        <input id="workClientLinkmanList${index.index}_office" name="workClientLinkmanList[${index.index}].office" type="text" value="${casePeopleNorm.office}" readonly="true"   class="form-control "/>
+                                        <input id="workClientLinkmanList${index.index}_clientName" name="workClientLinkmanList[${index.index}].clientId.name" type="text" value="${casePeopleNorm.clientId.name}" readonly="true"   class="form-control "/>
                                     </td>
                                     </td>
                                     <td>
                                     <td>
                                         <input id="workClientLinkmanList${index.index}_name" name="workClientLinkmanList[${index.index}].name" type="text" value="${casePeopleNorm.name}" readonly="true"   class="form-control "/>
                                         <input id="workClientLinkmanList${index.index}_name" name="workClientLinkmanList[${index.index}].name" type="text" value="${casePeopleNorm.name}" readonly="true"   class="form-control "/>
@@ -519,10 +531,11 @@
             <tr id="workClientLinkmanList{{idx}}">
             <tr id="workClientLinkmanList{{idx}}">
                 <td class="hide">
                 <td class="hide">
                     <input id="workClientLinkmanList{{idx}}_id" name="workClientLinkmanList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
                     <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"/>
                     <input id="workClientLinkmanList{{idx}}_delFlag" name="workClientLinkmanList[{{idx}}].delFlag" type="hidden" value="0"/>
                 </td>
                 </td>
                 <td>
                 <td>
-                    <input id="workClientLinkmanList{{idx}}_office" name="workClientLinkmanList[{{idx}}].office" type="text" value="{{row.office}}"    class="form-control "/>
+                    <input id="workClientLinkmanList{{idx}}_clientName" name="workClientLinkmanList[{{idx}}].clientId.name" type="text" value="{{row.clientId.name}}"    class="form-control "/>
                 </td>
                 </td>
                 <td>
                 <td>
                     <input id="workClientLinkmanList{{idx}}_name" name="workClientLinkmanList[{{idx}}].name" type="text" value="{{row.name}}"    class="form-control required"/>
                     <input id="workClientLinkmanList{{idx}}_name" name="workClientLinkmanList[{{idx}}].name" type="text" value="{{row.name}}"    class="form-control required"/>

+ 5 - 2
src/main/webapp/webpage/modules/workclientinfo/workClientInfoForm.jsp

@@ -153,9 +153,12 @@
 
 
             //模糊查询
             //模糊查询
             $("#name").on("keyup",function () {
             $("#name").on("keyup",function () {
-                var keyword = $(this).val();
+                var keyword = $(this).val().trim();
                 if (keyword != null && "" !== keyword) {
                 if (keyword != null && "" !== keyword) {
-                    fuzzyQuery(keyword);
+                    setTimeout(function(){
+                        fuzzyQuery(keyword);
+                    }, 1500);//延时1秒,
+
                 }
                 }
             });
             });
         });
         });

+ 2 - 2
src/main/webapp/webpage/modules/workcontractinfo/workContractInfoFormEdit.jsp

@@ -300,8 +300,8 @@
                         $("#clientId").val(d.id);
                         $("#clientId").val(d.id);
                         $("#clientName").val(d.name);
                         $("#clientName").val(d.name);
                         addRow('#workClientInfoList', workClientInfoListRowIdx, workClientInfoListTpl);workClientInfoListRowIdx = workClientInfoListRowIdx + 1;
                         addRow('#workClientInfoList', workClientInfoListRowIdx, workClientInfoListTpl);workClientInfoListRowIdx = workClientInfoListRowIdx + 1;
-                        console.log("---------"+data.companyType+"---------"+data.companyIndustry+"---------"+data.areaName);
-                        console.log("---------"+workClientInfoListRowIdx+"---------"+workClientInfoListTpl);
+                        // console.log("---------"+data.companyType+"---------"+data.companyIndustry+"---------"+data.areaName);
+                        // console.log("---------"+workClientInfoListRowIdx+"---------"+workClientInfoListTpl);
                         var row = workClientInfoListRowIdx - 1 ;
                         var row = workClientInfoListRowIdx - 1 ;
                         $("#"+"workClientInfoList"+row+"_id").val(d.id);
                         $("#"+"workClientInfoList"+row+"_id").val(d.id);
                         $("#"+"workClientInfoList"+row+"_name").val(d.name);
                         $("#"+"workClientInfoList"+row+"_name").val(d.name);