Kaynağa Gözat

建设,施工,监理,设计添加和比对增加联系人类型

user7 5 yıl önce
ebeveyn
işleme
cb0adcbd4a

+ 2 - 0
src/main/java/com/jeeplus/modules/workclientinfo/dao/WorkClientBankDao.java

@@ -18,4 +18,6 @@ import java.util.List;
 public interface WorkClientBankDao extends CrudDao<WorkClientBank> {
 
     List<WorkClientBank> findListByClient(WorkClientBank workClientBank);
+    //根据客户信息表id查出来对应的银行信息
+    List<WorkClientBank> getLinkBank(WorkClientBank workClientBank);
 }

+ 8 - 2
src/main/java/com/jeeplus/modules/workclientinfo/service/WorkClientInfoService.java

@@ -720,12 +720,18 @@ public class WorkClientInfoService extends CrudService<WorkClientInfoDao, WorkCl
         WorkClientInfo work=workClientInfoDao.findWorkClientInfo(workClientInfo);
         //根据客户信息表id查出来对应的联系人信息
         WorkClientLinkman workLink=new WorkClientLinkman();
-        workLink.getClientId().setId(work.getId());
+        WorkClientInfo infoId=new WorkClientInfo();
+        infoId.setId(work.getId());
+        workLink.setClientId(infoId);
         List<WorkClientLinkman> workmManList=workClientLinkmanDao.getLinkMan(workLink);
         work.setWorkClientLinkmanList(workmManList);
+        //根据客户信息表id查出来对应的银行信息
+        WorkClientBank workClientBank=new WorkClientBank();
+        workClientBank.setClientId(infoId);
+        List<WorkClientBank> workmBankList=workClientBankDao.getLinkBank(workClientBank);
+        work.setWorkClientBankList(workmBankList);
         //根据客户信息表查出来对应的联系人类型
         List<Map> jopType=workClientInfoDao.getJopType(work);
-
         return work;
 
     }

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

@@ -108,6 +108,22 @@ public class WorkClientInfoController extends BaseController {
 		return "modules/workclientinfo/workClientInfoForm";
 	}
 
+	@RequiresPermissions(value={"workclientinfo:workClientInfo:view","workclientinfo:workClientInfo:add","workclientinfo:workClientInfo:edit"},logical=Logical.OR)
+	@RequestMapping(value = "type")
+	public String type(WorkClientInfo workClientInfo, Model model) {
+		model.addAttribute("workClientInfo", workClientInfo);
+		return "modules/workclientinfo/workClientInfoFormType";
+	}
+
+	/**
+	 * 增加联系人类型
+	 */
+	@RequestMapping(value = "formType")
+	public String formType(WorkClientInfo workClientInfo,String param, Model model) {
+		model.addAttribute("workClientInfo", workClientInfo);
+		model.addAttribute("type",param);
+		return "modules/workclientinfo/workClientTypeForm";
+	}
     /**
      * 查看,增加,编辑客户管理表单页面
      */

+ 8 - 1
src/main/resources/mappings/modules/workclientinfo/WorkClientBankDao.xml

@@ -155,5 +155,12 @@
 	<select id="findUniqueByProperty" resultType="WorkClientBank" statementType="STATEMENT">
 		select * FROM work_client_bank  where ${propertyName} = '${value}'
 	</select>
-	
+
+	<select id="getLinkBank" resultType="WorkClientBank" >
+		SELECT
+		<include refid="workClientBankColumns"/>
+		FROM work_client_bank a
+		<include refid="workClientBankJoins"/>
+		WHERE a.client_id = #{clientId.id}
+	</select>
 </mapper>

+ 2 - 2
src/main/resources/mappings/modules/workclientinfo/WorkClientLinkmanDao.xml

@@ -334,9 +334,9 @@
 		<include refid="workClientLinkmanJoins"/>
 		WHERE
 		a.del_flag = #{DEL_FLAG_NORMAL}
-		<if test="clientId.id != null and clientId.id != ''">
+		and
 		a.client_id = #{clientId.id}
-		</if>
+
 
 	</select>
 </mapper>

+ 73 - 2
src/main/webapp/webpage/modules/projectrecord/projectRecordsForm.jsp

@@ -475,6 +475,49 @@
 
         }
 
+        /*设计类型*/
+        function openBuild(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}/project/projectRecords/linkManSave");*///表单提交成功后,从服务器返回的url在当前tab中展示
+                    inputForm.attr("action","${ctx}/workclientinfo/workClientInfo/save")
+                    var $document = iframeWin.contentWindow.document;
+
+                    formSubmit2($document,formId,index);
+
+                },
+                cancel: function(index){
+                }
+            });
+
+
+        }
+
         function formSubmit2($document,inputForm,index){
             var validateForm = $($document.getElementById(inputForm)).validate({
                 submitHandler: function(form){
@@ -816,8 +859,8 @@
                 </div>
                 <div class="layui-item nav-btns" style="float: left;">
                     <a 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="openBuild('新增客户管理', '${ctx}/workclientinfo/workClientInfo/formType?param=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">
@@ -845,6 +888,8 @@
                 <td>
                     <input readonly="true" id="workClientLinkmanList{{idx}}_clientName" name="workClientLinkmanList[{{idx}}].clientId.name" type="text" value="{{row.clientId.name}}"    class="form-control "/>
                 </td>
+
+
                 <td>
                     <input readonly="true" id="workClientLinkmanList{{idx}}_name" name="workClientLinkmanList[{{idx}}].name" type="text" value="{{row.name}}"    class="form-control required"/>
                 </td>
@@ -884,6 +929,12 @@
                     <sys:gridselectClientBuild url="${ctx}/workclientinfo/workClientInfo/clientInfoBuild" id="buildOrgList"   title="选择建设单位"
                                               cssClass="form-control required" fieldLabels="${fns:urlEncode('客户编号')}" fieldKeys="name"  searchLabel="${fns:urlEncode('客户名称')}" searchKey="name">
                     </sys:gridselectClientBuild>
+
+                </div>
+                <div class="layui-item nav-btns" style="float:left; margin-top: -39px;margin-left: 155px;" >
+                    <a href="javascript:void(0)"
+                       onclick="openBuild('新增建设方', '${ctx}/workclientinfo/workClientInfo/formType?param=2','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="contentTableBuild" class="table table-bordered table-condensed details">
@@ -891,6 +942,7 @@
                         <tr>
                             <th class="hide"></th>
                             <th style="text-align: center" width="20%">建设方单位名称</th>
+                            <th style="text-align: center" width="20%">统一社会信用代码</th>
                             <th style="text-align: center" width="20%">联系人姓名</th>
                             <th style="text-align: center" width="20%">联系方式1</th>
                             <th style="text-align: center" width="20%">联系方式2</th>
@@ -910,6 +962,9 @@
 						<input id="workBuildLinkmanList{{idx}}_cid" name = "workBuildLinkmanList[{{idx}}].clientId.id" type="hidden" value="{{row.clientId.id}}"/>
 						{{row.clientId.name}}
 					</td>
+					 <td style="text-align: center">
+						{{row.clientId.uscCode}}
+					</td>
 					<td style="text-align: center">
 						{{row.name }}
 					</td>
@@ -956,6 +1011,12 @@
                     <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>
+                <div class="layui-item nav-btns" style="float:left; margin-top: -39px;margin-left: 155px;">
+                    <a href="javascript:void(0)"
+                       onclick="openBuild('新增施工方', '${ctx}/workclientinfo/workClientInfo/formType?param=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">
                         <thead>
@@ -1026,6 +1087,11 @@
                     <sys:gridselectClientSuper url="${ctx}/workclientinfo/workClientInfo/clientInfoSuper" id="superOrgList"   title="选择施工单位"
                                               cssClass="form-control required" fieldLabels="${fns:urlEncode('客户编号')}" fieldKeys="name"  searchLabel="${fns:urlEncode('客户名称')}" searchKey="name"></sys:gridselectClientSuper>
                 </div>
+                <div class="layui-item nav-btns" style="float:left; margin-top: -39px;margin-left: 155px;">
+                    <a href="javascript:void(0)"
+                       onclick="openBuild('新增监理方', '${ctx}/workclientinfo/workClientInfo/formType?param=2','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="contentTableSuper" class="table table-bordered table-condensed details">
                         <thead>
@@ -1097,6 +1163,11 @@
                     <sys:gridselectClientDesign url="${ctx}/workclientinfo/workClientInfo/clientInfoDesign" id="designOrgList"   title="选择设计单位"
                                               cssClass="form-control required" fieldLabels="${fns:urlEncode('客户编号')}" fieldKeys="name"  searchLabel="${fns:urlEncode('客户名称')}" searchKey="name"></sys:gridselectClientDesign>
                 </div>
+                <div class="layui-item nav-btns" style="float:left; margin-top: -39px;margin-left: 155px;">
+                    <a href="javascript:void(0)"
+                       onclick="openBuild('新增设计方', '${ctx}/workclientinfo/workClientInfo/formType?param=5','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="contentTableDesign" class="table table-bordered table-condensed details">
                         <thead>

+ 4 - 1
src/main/webapp/webpage/modules/sys/gridselectClientBuild.jsp

@@ -31,7 +31,8 @@
                 var label2 = $(this).parent().parent().parent().find(".codelabel2").html();
                 var label3 = $(this).parent().parent().parent().find(".codelabel3").html();
                 var label4 = $(this).parent().parent().parent().find(".codelabel4").html();
-                var data=  {'clientId':{'id':label,'name':label4},'id':id,'name':label1,'linkPhone':label2,'linkMobile':label3};
+                var label5 = $(this).parent().parent().parent().find(".codelabel5").html();
+                var data=  {'clientId':{'id':label,'name':label4,'uscCode':label5},'id':id,'name':label1,'linkPhone':label2,'linkMobile':label3};
                 arr.push(data);
 			})
             return arr;
@@ -87,6 +88,7 @@
 						<th width="50"><input type="checkbox" class="i-checks"></th>
 						<th style="display:none">建设方编号</th>
 						<th width="25%">建设方名称</th>
+						<th width="25%">统一社会信用代码</th>
 						<th width="25%">联系人</th>
 						<th width="25%">联系电话</th>
 						<th width="25%">手机号</th>
@@ -101,6 +103,7 @@
 							<td> <input type="checkbox" id="${fns:getValue(linkman, 'id')}" class="i-checks"></td>
 							<td title="${fns:getValue(obj, 'id')}" class="codelabel" style="display:none">${fns:getValue(obj, 'id')}</td>
 								<td title="${fns:getValue(obj, 'name')}" class="codelabel4">${fns:getValue(obj, 'name')}</td>
+								<td title="${fns:getValue(obj, 'uscCode')}" class="codelabel5">${fns:getValue(obj, 'uscCode')}</td>
 								<td title="${fns:getValue(linkman, 'name')}" class="codelabel1">${fns:getValue(linkman, 'name')}</td>
 								<td class="codelabel2">${fns:getValue(linkman, 'linkPhone')}</td>
 								<td class="codelabel3">${fns:getValue(linkman, 'linkMobile')}</td>

+ 16 - 14
src/main/webapp/webpage/modules/workclientinfo/workClientInfoForm.jsp

@@ -203,7 +203,8 @@
                             "name":name,
                             "uscCode":uscCode},
                         success:function(data){
-                            if(data.code==="false"){
+                            console.log(data);
+                            if(data.code=="false"){
                                 exitName=false
                                 $("#uscPh").html("该客户已存在");
                             }else {
@@ -310,7 +311,8 @@
                     "name":name,
                     "uscCode":uscCode},
                 success:function(data){
-                    if(data==="false"){
+
+                    if(data=="false"){
                         exitName=false
                         $("#ph").html("该客户已存在");
                     }else {
@@ -430,9 +432,9 @@
                 <div class="layui-item layui-col-sm6 lw7">
                     <label class="layui-form-label double-line"><span class="require-item">*</span>拥有统一社会信用代码:</label>
                     <div class="layui-input-block">&nbsp;&nbsp;
-                        <form:radiobutton class="usccClass i-checks" path="hasUscc" value="1" label="是" checked="true" />
+                        <form:radiobutton id="hasUscc" class="usccClass i-checks" path="hasUscc" value="1" label="是" checked="true" />
                         &nbsp;&nbsp;
-                        <form:radiobutton class="usccClass i-checks" path="hasUscc" value="2" label="否" />
+                        <form:radiobutton id="hasUscc" class="usccClass i-checks" path="hasUscc" value="2" label="否" />
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw7" id="search">
@@ -449,7 +451,7 @@
                 <div class="layui-item layui-col-sm6 lw7">
                     <label class="layui-form-label double-line"><span class="require-item">*</span>客户编号:</label>
                     <div class="layui-input-block">
-                        <form:input path="number" htmlEscape="false" class="form-control layui-input" readonly="true"/>
+                        <form:input path="number" id="number" htmlEscape="false" class="form-control layui-input" readonly="true"/>
                     </div>
                 </div>
 
@@ -474,7 +476,7 @@
                 <div class="layui-item layui-col-sm6 lw7">
                     <label class="layui-form-label"><span class="require-item">*</span>所在行业:</label>
                     <div class="layui-input-block">
-                        <form:select path="companyIndustry" class="form-control simple-select required">
+                        <form:select path="companyIndustry" id="companyIndustry" class="form-control simple-select required">
                             <form:option value="" label="--请选择行业--"/>
                             <form:options items="${fns:getMainDictList('company_industry')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
                         </form:select>
@@ -492,26 +494,26 @@
                 <div class="layui-item layui-col-sm6 lw7">
                     <label class="layui-form-label">法人代表:</label>
                     <div class="layui-input-block">
-                        <form:input path="lawerPresint" htmlEscape="false" class="form-control layui-input"/>
+                        <form:input path="lawerPresint" id="lawerPresint" htmlEscape="false" class="form-control layui-input"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw7">
                     <label class="layui-form-label">邮政编码:</label>
                     <div class="layui-input-block">
-                        <form:input path="zipCode" htmlEscape="false" minlength="6" maxlength="6"
+                        <form:input path="zipCode" id="zipCode" htmlEscape="false" minlength="6" maxlength="6"
                                     class="form-control digits layui-input"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw7">
                     <label class="layui-form-label">传真:</label>
                     <div class="layui-input-block">
-                        <form:input path="fax" htmlEscape="false" class="form-control isTel layui-input"/>
+                        <form:input path="fax"  id="fax" htmlEscape="false" class="form-control isTel layui-input"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw7">
                     <label class="layui-form-label"><span class="require-item">*</span>客户类型:</label>
                     <div class="layui-input-block">
-                        <form:select path="clientType" class="form-control simple-select required">
+                        <form:select path="clientType" id="clientType" class="form-control simple-select required">
                             <form:option value="" label="--请选择客户类型--"/>
                             <form:options items="${fns:getMainDictList('client_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
                         </form:select>
@@ -520,14 +522,14 @@
                 <div class="layui-item layui-col-sm6 lw7">
                     <label class="layui-form-label"><span class="require-item">*</span>公司电话:</label>
                     <div class="layui-input-block">
-                        <form:input path="telephone" htmlEscape="false"
+                        <form:input path="telephone" id="telephone" htmlEscape="false"
                                     class="form-control isTel required layui-input"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw7">
                     <label class="layui-form-label">公司网址:</label>
                     <div class="layui-input-block">
-                        <form:input path="companyUrl" htmlEscape="false" class="form-control isUrl layui-input"/>
+                        <form:input path="companyUrl" id="companyUrl" htmlEscape="false" class="form-control isUrl layui-input"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw7">
@@ -540,14 +542,14 @@
                 <div class="layui-item layui-col-sm12 lw7">
                     <label class="layui-form-label"><span class="require-item">*</span>注册地址:</label>
                     <div class="layui-input-block">
-                        <form:input path="registerAddress" htmlEscape="false"
+                        <form:input path="registerAddress" id="registerAddress" htmlEscape="false"
                                     class="form-control required layui-input"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm12 lw7">
                     <label class="layui-form-label">详细地址:</label>
                     <div class="layui-input-block">
-                        <form:input path="address" htmlEscape="false" class="form-control layui-input"/>
+                        <form:input path="address" id="address" htmlEscape="false" class="form-control layui-input"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm12 lw7">

+ 741 - 0
src/main/webapp/webpage/modules/workclientinfo/workClientInfoFormType.jsp

@@ -0,0 +1,741 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<%
+    String param = request.getParameter("param");
+
+%>
+<html>
+<head>
+    <title>客户信息管理</title>
+    <meta name="decorator" content="default"/>
+    <script src="${ctxStatic}/layer-v2.3/layui/xmSelect.js" charset="utf-8"></script>
+
+    <link href="${ctxStatic}/bootstrap-select-1.12.4/css/bootstrap-select.min.css" rel="stylesheet" />
+    <style>
+        #companyType-error{
+            left:0;
+            top:40px;
+        }
+        #clientType-error{
+            left:0;
+            top:40px;
+        }
+        #companyIndustry-error{
+            left:0;
+            top:40px;
+        }
+    </style>
+    <script src="${ctxStatic}/bootstrap-select-1.12.4/js/bootstrap-select.min.js"></script>
+    <script type="text/javascript">
+        var validateForm;
+        var exitName = true;
+        function doSubmit(){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            if(validateForm.form()){
+                var jobTypeStr = $("#jobTypeStr").val();
+                if (jobTypeStr == null || "" == jobTypeStr) {
+                    parent.layer.msg("请选择联系人类型!", {icon: 5});
+                    return false;
+                }
+                var tableObj = document.getElementById('contentTable').rows[1];
+                if (tableObj == null) {
+                    parent.layer.msg("请填写联系人信息!", {icon: 5});
+                    return false;
+                }
+                if(!exitName){
+                    return false;
+                }
+                $("#inputForm").submit();
+                return true;
+            }else {
+                parent.layer.msg("信息未填写完整!", {icon: 5});
+            }
+
+            return false;
+        }
+        $(document).ready(function() {
+            contentDetailTypeShow();
+            checkContentKeyUp('unitIntroduction',500);
+            $.validator.messages["orUnicode"] = true;
+            $.validator.methods["orUnicode"] = function( value, element ) {
+                return this.optional( element ) || /^[a-z0-9A-Z\-]*$/.test( value );
+            }
+            $.validator.messages["fax"] = true;
+            $.validator.methods["fax"] = function( value, element ) {
+                return this.optional( element ) || /^[0-9\-]*$/.test( value );
+            }
+            $.validator.messages["telephone"] = true;
+            $.validator.methods["telephone"] = function( value, element ) {
+                return this.optional( element ) || /^[0-9\-]*$/.test( value );
+            }
+            $.validator.messages["ourBank"] = true;
+            $.validator.methods["ourBank"] = function( value, element ) {
+                return this.optional( element ) || /^[\u4e00-\u9fa5]*$/.test( value );
+            }
+            $.validator.messages["taxId"] = true;
+            $.validator.methods["taxId"] = function( value, element ) {
+                return this.optional( element ) || /^[a-z0-9A-Z]*$/.test( value );
+            }
+
+            jQuery.validator.addMethod("isUscCode", function(value, element) {
+                if (this.optional(element)){
+                    return true;
+                }
+                var uscCode = /^((\w{15})|(\w{18})|(\w{20}))$/;
+                return uscCode.test(value);
+            }, "请填写正确的统一社会信用代码");
+
+            validateForm = $("#inputForm").validate({
+                rules:{
+                    orUnicode:{
+                        orUnicode:true
+                    },
+                    zipCode:{
+                        digits:true
+                    },
+                    email:{
+                        email:true
+                    },
+                    fax:{
+                        fax:true
+                    },
+                    telephone:{
+                        telephone:true
+                    },
+                    taxId:{
+                        taxId:true
+                    }
+                    <%--uscCode:{remote: "${ctx}/workclientinfo/workClientInfo/checkUscCode?oldUscCode=" + encodeURIComponent($("#oldUscCode").val())}--%>
+                },
+                messages:{
+                    orUnicode:{
+                        orUnicode:"仅允许输入数字、大写拉丁字母、符号“-”"
+                    },
+                    zipCode:{
+                        required:"必须输入数字"
+                    },
+                    email:{
+                        email:"请输入合法的邮箱地址"
+                    },
+                    fax:{
+                        fax:"仅允许输入数字、符号“-”"
+                    },
+                    telephone:{
+                        telephone:"仅允许输入数字、符号“-”"
+                    },
+                    taxId:{
+                        taxId:"仅允许输入数字、大写拉丁字母"
+                    }
+                    // uscCode:{remote:"重复的统一社会信用代码"}
+                },
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $("#messageBox").text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+            $("#attachment_btn").click(function () {
+                $("#attachment_file").click();
+            });
+            $('input[name="hasUscc"]').on('ifChecked', function(event){
+                disUscc(event.target.defaultValue);
+            });
+            disUscc($('input[name="hasUscc"]:checked').val());
+            if($("#uscCode").val()!=null&&$("#uscCode").val()!='') {
+                $("#inputForm").validate().element($("#uscCode"));
+            }
+            // $("#name").blur(function(){
+            //     checkName();
+            // })
+            $("#name").on("change",function(){
+                    var id = $("#id").val();
+                    var name = $("#name").val();
+                    var uscCode = $("#uscCode").val();
+                    $.ajax({
+                        url:"${ctx}/workclientinfo/workClientInfo/checkClient",
+                        type:"post",
+                        data:{"id":id,
+                            "name":name,
+                            "uscCode":uscCode},
+                        success:function(data){
+                            if(data==="false"){
+                                exitName=false
+                                $("#ph").html("该客户已存在");
+                            }else {
+                                exitName=true
+                                $("#ph").html('');
+                            }
+                        }
+                    });
+                }
+            )
+            <%--var arr="${workClientInfo.clientType}".split(',');--%>
+            // $('#clientType').selectpicker('val',arr);
+
+            /*新增代码传送统一社会信用代码*/
+            /*$("#uscCode").on("change",function(){
+                    var id = $("#id").val();
+                    var name = $("#name").val();
+                    var uscCode = $("#uscCode").val();
+                    $.ajax({
+                        url:"${ctx}/workclientinfo/workClientInfo/checkClientUscCode",
+                        type:"post",
+                        data:{"id":id,
+                            "name":name,
+                            "uscCode":uscCode},
+                        success:function(data){
+                            console.log(data);
+                            if(data.code=="false"){
+                                exitName=false
+                                $("#uscPh").html("该客户已存在");
+                            }else {
+                                exitName=true
+                                $("#uscPh").html('');
+                            }
+                        }
+                    });
+                }
+            )*/
+            dismissDiv();
+
+        });
+
+        function testOurBank(value){
+            if(!/^[\u4e00-\u9fa5]*$/.test( value )){
+                parent.layer.msg("开户银行必须输入汉字",{icon:6});
+            }
+        }
+
+        /**
+         * 只允许输入数字
+         * @param value
+         */
+        function testBankNumber(value){
+            if(!/^\d*$/.test( value )){
+                parent.layer.msg("开户帐号必须输入数字",{icon:6});
+            }
+        }
+        function addRow(list, idx, tpl, row){
+            var idx1 = $("#workClientBankList tr").length;
+            if(list == '#workClientBankList'){
+                bornTemplete(list, idx, tpl, row, idx1);
+            }
+            var idx2 = $("#workClientLinkmanList tr").length;
+            if(list == '#workClientLinkmanList'){
+                bornTemplete(list, idx, tpl, row, idx2);
+            }
+        }
+        function bornTemplete(list, idx, tpl, row, idx1){
+            $(list).append(Mustache.render(tpl, {
+                idx: idx, delBtn: true, row: row,
+                order:idx1 + 1
+            }));
+            $(list+idx).find("select").each(function(){
+                $(this).val($(this).attr("data-value"));
+            });
+            $(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
+                var ss = $(this).attr("data-value").split(',');
+                for (var i=0; i<ss.length; i++){
+                    if($(this).val() == ss[i]){
+                        $(this).attr("checked","checked");
+                    }
+                }
+            });
+        }
+        function delRow(obj, prefix){
+            var id = $(prefix+"_id");
+            var delFlag = $(prefix+"_delFlag");
+            if (id.val() == ""){
+                $(obj).parent().parent().remove();
+            }else if(delFlag.val() == "0"){
+                delFlag.val("1");
+                $(obj).html("&divide;").attr("title", "撤回删除");
+                $(obj).parent().parent().addClass("error");
+                $(obj).parent().parent().addClass("hide");
+            }else if(delFlag.val() == "1"){
+                delFlag.val("0");
+                $(obj).html("&times;").attr("title", "删除");
+                $(obj).parent().parent().removeClass("error");
+            }
+
+        }
+        function urlRedict(file,attach){
+            parent.layer.confirm('确定删除吗?', {
+                btn: ['确认', '取消'] //可以无限个按钮
+            }, function(index, layero){
+                var index1 = parent.layer.load(0, {shade: false});
+                $.post("${ctx}/workfullmanage/workFullManage/deleteFile",
+                    {"file":file,"attach":attach},
+                    function(result){
+                        var d = JSON.parse(result);
+                        if(d.str){
+                            location.reload();
+                            parent.layer.msg("删除成功!!!",{icon:6});
+                            parent.layer.close(index1);
+                            parent.layer.close(index);
+                        }
+                    });
+            }, function(index){
+                parent.layer.close(index)
+            });
+
+        }
+
+        function checkName() {
+            var id = $("#id").val();
+            var name = $("#name").val();
+            var uscCode = $("#uscCode").val();
+            $.ajax({
+                url:"${ctx}/workclientinfo/workClientInfo/checkClient",
+                type:"post",
+                data:{"id":id,
+                    "name":name,
+                    "uscCode":uscCode},
+                success:function(data){
+
+                    if(data=="false"){
+                        exitName=false
+                        $("#ph").html("该客户已存在");
+                    }else {
+                        exitName=true
+                        $("#ph").html('');
+                    }
+                }
+            });
+        }
+
+        function insertTitle(tValue){
+            var list = "${workClientInfo.workAttachments}";
+            var size = (list.split('url')).length-1;
+            var files = $("#attachment_file")[0].files;
+            for(var i = 0;i<files.length;i++) {
+                var file = files[i];
+                var attachmentId = "";
+                var attachmentFlag = "5";
+                console.log(file);
+                var timestamp = new Date().getTime();
+
+                var storeAs = "attachment-file/workClientInfo/" + timestamp + "/" + file['name'];
+                var uploadPath = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/" + storeAs;
+                /*将这段字符串存到数据库即可*/
+                var divId = "_attachment";
+                $("#addFile" + divId).show();
+                multipartUploadWithSts(storeAs, file, attachmentId, attachmentFlag, uploadPath, divId, size);
+            }
+        }
+
+        function disUscc(hasUscc) {
+            if("2"==hasUscc){
+                $(".companyType_uscCode").hide();
+                /*$('input[name="uscCode"]').attr("class","form-control");*/
+                $('input[name="uscCode"]').val("");
+            }else {
+                $(".companyType_uscCode").show();
+                /*$('input[name="uscCode"]').attr("class","form-control required isUscCode layui-input");*/
+            }
+        }
+
+        // 模糊查询下拉框
+        function fuzzyQuery(){
+            var keyword = $("#name").val();
+            if (keyword == null || keyword === "") {
+                return;
+            }
+            $.post(
+                "${ctx}/workclientinfo/workClientInfo/enterpriseSearchByName",
+                {"keyword": keyword},
+                function (result) {
+                    if (result == null) {
+                        return;
+                    }
+                    var json = eval(result.data.items);
+                    //如果精准查询,只有一条数据,则不显示模糊查询div,直接赋值
+                    if (json.length == 1) {
+                        var id = json[0].id;
+                        $.getJSON(
+                            "${ctx}/workclientinfo/workClientInfo/enterpriseTicketInfo",
+                            {"id": id},
+                            function (data) {
+                                $("#name").val(data.ENTNAME).change();
+                                $("#uscCode").val(data.TAXNUMBER);
+                                $("#registerAddress").val(data.OPLOC);
+                            }
+                        );
+                        return;
+                    }
+                    var html = "<ul>";
+                    for (var i = 0; i < json.length; i++) {
+                        html += "<li value=" + json[i].id + ">" + json[i].entname + "</li>";
+                    }
+                    html += "</ul>";
+                    $("#fuzzyQuerySelect").show().html(html);
+
+                    //鼠标移动到某行上改变颜色
+                    $("li").bind("mouseover", function () {
+                        $(this).css("background-color", "grey");
+                    });
+                    $("li").bind("mouseout", function () {
+                        $(this).css("background-color", "white");
+                    });
+                    //单击某行
+                    $("li").bind("click", function () {
+                        $("#fuzzyQuerySelect").hide();
+                        var id = $(this).val();
+                        $.getJSON(
+                            "${ctx}/workclientinfo/workClientInfo/enterpriseTicketInfo",
+                            {"id": id},
+                            function (data) {
+                                $("#name").val(data.ENTNAME).change();
+                                $("#uscCode").val(data.TAXNUMBER);
+                                $("#registerAddress").val(data.OPLOC);
+                            }
+                        );
+
+                    });
+                }, "json");
+        }
+
+
+    </script>
+
+</head>
+<body>
+<div class="single-form">
+    <div class="container">
+        <input type="hidden" value="${param.param}" id="param">
+        <form:form id="inputForm" modelAttribute="workClientInfo" enctype="multipart/form-data"
+                   onkeydown="if(event.keyCode==13)return false;" action="${ctx}/workclientinfo/workClientInfo/save"
+                   method="post" class="form-horizontal">
+            <form:hidden path="id"/>
+            <input type="hidden" id="jobTypeStr" name="jobTypeStr" value="">
+            <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 double-line"><span class="require-item">*</span>拥有统一社会信用代码:</label>
+                    <div class="layui-input-block">&nbsp;&nbsp;
+                        <form:radiobutton id="hasUscc" disabled="true" class="usccClass i-checks" path="hasUscc" value="1" label="是" checked="true" />
+                        &nbsp;&nbsp;
+                        <form:radiobutton id="hasUscc" disabled="true" class="usccClass i-checks" path="hasUscc" value="2" label="否" />
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label"><span class="require-item">*</span>客户名称:</label>
+                    <div class="layui-input-block">
+                        <input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workClientInfo.name}"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label double-line"><span class="require-item">*</span>客户编号:</label>
+                    <div class="layui-input-block">
+                        <form:input path="number"  id="number" htmlEscape="false" class="form-control layui-input" readonly="true"/>
+                    </div>
+                </div>
+
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label double-line"><span class="require-item">*</span>统一社会信用代码:</label>
+                    <div class="layui-input-block">
+                        <input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workClientInfo.uscCode}"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label"><span class="require-item">*</span>所在行业:</label>
+                    <div class="layui-input-block">
+                        <input htmlEscape="false" readonly="true" class="form-control layui-input" value="${fns:getMainDictLabel(workClientInfo.companyIndustry, 'company_industry', '')}"/>
+                    </div>
+                </div>
+                <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">
+                        <input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workClientInfo.area.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" class="form-control layui-input" value="${workClientInfo.lawerPresint}"/>
+                    </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" class="form-control layui-input" value="${workClientInfo.zipCode}"/>
+                    </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" class="form-control layui-input" value="${workClientInfo.fax}"/>
+                    </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" class="form-control layui-input" value="<c:set value="${fn:split(workClientInfo.clientType, ',') }" var="clientTypes" /><c:forEach items="${clientTypes}" var="cType" varStatus="status">${fns:getMainDictLabel(cType, 'client_type', '')}<c:if test="${!status.last}">, </c:if></c:forEach>"/>
+                    </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" class="form-control layui-input" value="${workClientInfo.telephone}"/>
+                    </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" class="form-control layui-input" value="${workClientInfo.companyUrl}"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label"><span class="require-item">*</span>联系人类型:</label>
+                    <div class="layui-input-block">
+                        <div id="jobType" class="xm-select-demo" tabindex="0" contenteditable="true"></div>
+                    </div>
+                </div>
+
+                <div class="layui-item layui-col-sm12 lw7">
+                    <label class="layui-form-label"><span class="require-item">*</span>注册地址:</label>
+                    <div class="layui-input-block">
+                        <form:input readonly="true" path="registerAddress" id="registerAddress" htmlEscape="false"
+                                    class="form-control required layui-input"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm12 lw7">
+                    <label class="layui-form-label">详细地址:</label>
+                    <div class="layui-input-block">
+                        <form:input readonly="true" path="address" id="address" htmlEscape="false" class="form-control layui-input"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm12 lw7">
+                    <label class="layui-form-label"><span class="require-item">*</span>开户行信息:</label>
+                    <div class="layui-input-block">
+
+                        <table id="bankinfo" class="table table-bordered table-condensed details">
+                            <thead>
+                            <tr>
+                                <th width="80px">序号</th>
+                                <th ><font color="red">*</font>开户银行</th>
+                                <th width="400px;"><font color="red">*</font>开户账号</th>
+
+                            </tr>
+                            </thead>
+                            <tbody id="workClientBankList">
+                            <c:forEach items="${workClientInfo.workClientBankList}" var="workClientBank" varStatus="status">
+                                <tr>
+                                    <td>${status.index + 1}</td>
+                                    <td>${workClientBank.ourBank}</td>
+                                    <td>${workClientBank.bankNumber}</td>
+                                </tr>
+                            </c:forEach>
+                            <c:if test="${bankSize == 0}">
+                                <tr>
+                                    <td colspan="3">暂无数据</td>
+                                </tr>
+                            </c:if>
+                            </tbody>
+                        </table>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm12 with-textarea lw7">
+                    <label class="layui-form-label">单位简介:</label>
+                    <div class="layui-input-block">
+                        <textarea htmlEscape="false" rows="4" readonly="true" maxlength="1000" class="form-control" >${workClientInfo.unitIntroduction}</textarea>
+                    </div>
+                </div>
+            </div>
+
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>联系人信息</h2></div>
+                <div class="layui-item layui-col-xs12 form-table-container" >
+                    <table id="contentTable" class="table table-bordered table-condensed no-bottom-margin details">
+                        <thead>
+                        <tr>
+                            <th class="hide"></th>
+                            <th width="150px"><font color="red">*</font>联系人姓名</th>
+                            <th >部门</th>
+                            <th width="150px">职务</th>
+                            <th width="150px">QQ</th>
+                            <th width="150px">联系方式1</th>
+                            <th width="150px">联系方式2</th>
+                            <th width="150px">E-mail</th>
+                        </tr>
+                        </thead>
+                        <tbody id="workClientLinkmanList">
+                        <c:forEach items="${workClientInfo.workClientLinkmanList}" var="workClientLinkman" varStatus="status">
+                            <tr>
+                                <td class="hide">${status.index + 1}</td>
+                                <td >${workClientLinkman.name}</td>
+                                <td >${workClientLinkman.office}</td>
+                                <td >${workClientLinkman.position}</td>
+                                <td >${workClientLinkman.qq}</td>
+                                <td >${workClientLinkman.linkPhone}</td>
+                                <td >${workClientLinkman.linkMobile}</td>
+                                <td >${workClientLinkman.email}</td>
+                            </tr>
+                        </c:forEach>
+                        <c:if test="${linkManSize == 0}">
+                            <tr>
+                                <td colspan="8">暂无数据</td>
+                            </tr>
+                        </c:if>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>附件信息</h2></div>
+                <div class="layui-item nav-btns">
+                    <a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i>&nbsp;添加附件</a>
+                </div>
+                <div id="addFile_attachment" style="display: none" class="upload-progress">
+                    <span id="fileName_attachment"></span>
+                    <b><span id="baifenbi_attachment"></span></b>
+                    <div class="progress">
+                            <%--进度条--%>
+                        <div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
+                        </div>
+                    </div>
+                </div>
+                <input id="attachment_file" type="file" name="attachment_file" multiple="multiple"
+                       style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
+                <span id="attachment_title"></span>
+                <div class="layui-item layui-col-xs12" style="padding:0 16px;">
+                    <table id="upTable" class="table table-bordered table-condensed details">
+                        <thead>
+                        <tr>
+                                <%-- <th>序号</th>--%>
+                            <th>文件</th>
+                            <th>上传人</th>
+                            <th>上传时间</th>
+                            <th width="150px">操作</th>
+                        </tr>
+                        </thead>
+                        <tbody id="file_attachment">
+                        <c:forEach items="${workClientInfo.workAttachments}" var="workClientAttachment"
+                                   varStatus="status">
+                            <tr>
+                                    <%-- <td>${status.index + 1}</td>--%>
+                                <c:choose>
+                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                             or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                             or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                             or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                             or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                        <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                    </c:when>
+                                    <c:otherwise>
+                                        <c:choose>
+                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                <td><a class="attention-info" href="javascript:void(0)"
+                                                       onclick="preview('预览','${workClientAttachment.url}','90%','90%','1')">${workClientAttachment.attachmentName}</a>
+                                                </td>
+                                            </c:when>
+                                            <c:otherwise>
+                                                <td><a class="attention-info" href="javascript:void(0)"
+                                                       onclick="preview('预览','${workClientAttachment.url}','90%','90%')">${workClientAttachment.attachmentName}</a>
+                                                </td>
+                                            </c:otherwise>
+                                        </c:choose>
+                                    </c:otherwise>
+                                </c:choose>
+                                <td>${workClientAttachment.createBy.name}</td>
+                                <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
+                                <td class="op-td">
+                                    <div class="op-btn-box">
+                                        <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent(encodeURIComponent('${workClientAttachment.url}'));"
+                                           class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                        <c:if test="${workClientAttachment.createBy.id eq fns:getUser().id}">
+                                            <a href="javascript:void(0)"
+                                               onclick="deleteFileFromAliyun(this,'${ctx}/sys/workattachment/deleteFileFromAliyun?url=${workClientAttachment.url}&id=${workClientAttachment.id}&type=2','addFile')"
+                                               class="op-btn op-btn-delete"><i class="fa fa-trash"></i>&nbsp;删除</a>
+                                        </c:if>
+                                    </div>
+                                </td>
+                            </tr>
+                        </c:forEach>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+            <div class="form-group layui-row page-end"></div>
+        </form:form>
+    </div>
+</div>
+
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+<script>
+    function contentDetailTypeShow() {
+        $.ajax({
+            type:'post',
+            url:'${ctx}/workclientinfo/workClientInfo/getJobType',
+            data:{
+                "type":2
+            },
+            success:function(data){
+                if(data.success) {
+                    var data = data.body.list;
+                    var newDataList = data;
+                    var showList = [];
+                    $.ajax({
+                        type:'post',
+                        url:'${ctx}/workclientinfo/workClientInfo/getJobTypeById',
+                        data:{
+                            "id":$("#id").val()
+                        },
+                        success:function(dataListById){
+                            if(dataListById.success) {
+                                var showDataList = dataListById.body.list;
+
+                                for (i in newDataList) {
+                                    for (j in showDataList) {
+                                        if (newDataList[i].value == showDataList[j].value) {
+                                            var newData = {
+                                                "name": newDataList[i].name,
+                                                "value": newDataList[i].value,
+                                                "selected": true
+                                            }
+                                            showList.push(newData);
+                                            data.splice(i,1,newData);
+                                        }
+                                    }
+                                }
+                                xmSelect.render({
+                                    el: '#jobType',
+                                    language: 'zn',
+                                    data:data
+                                })
+                            }
+                        }
+                    })
+                }
+            }
+        })
+    }
+
+    var jobType = xmSelect.render({
+        el: '#jobType',
+        language: 'zn',
+        data: [
+        ]
+    })
+
+
+    document.getElementById('jobType').onblur=function(){
+        var list = [];
+        //获取当前多选选中的值
+        var selectArr = jobType.getValue();
+        for (var i in selectArr){
+            list.push(selectArr[i].value);
+        }
+        $("#jobTypeStr").val(list);
+        console.log(list);
+    }
+</script>
+</body>
+</html>

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1031 - 0
src/main/webapp/webpage/modules/workclientinfo/workClientTypeForm.jsp