[user3] 4 yıl önce
ebeveyn
işleme
af3df82965

+ 52 - 0
src/main/webapp/WEB-INF/tags/sys/gridselectcallprojecttss.tag

@@ -0,0 +1,52 @@
+<%@ tag language="java" pageEncoding="UTF-8"%>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<%@ attribute name="id" type="java.lang.String" required="true" description="编号"%>
+<%@ attribute name="name" type="java.lang.String" required="true" description="隐藏域名称(ID)"%>
+<%@ attribute name="value" type="java.lang.String" required="true" description="隐藏域值(ID)"%>
+<%@ attribute name="labelName" type="java.lang.String" required="true" description="输入框名称(Name)"%>
+<%@ attribute name="labelValue" type="java.lang.String" required="true" description="输入框值(Name)"%>
+<%@ attribute name="fieldLabels" type="java.lang.String" required="true" description="表格Th里显示的名字"%>
+<%@ attribute name="fieldKeys" type="java.lang.String" required="true" description="表格Td里显示的值"%>
+<%@ attribute name="searchLabel" type="java.lang.String" required="true" description="表格Td里显示的值"%>
+<%@ attribute name="searchKey" type="java.lang.String" required="true" description="表格Td里显示的值"%>
+<%@ attribute name="title" type="java.lang.String" required="true" description="选择框标题"%>
+<%@ attribute name="url" type="java.lang.String" required="true" description="数据地址"%>
+<%@ attribute name="cssClass" type="java.lang.String" required="false" description="css样式"%>
+<%@ attribute name="cssStyle" type="java.lang.String" required="false" description="css样式"%>
+<%@ attribute name="disabled" type="java.lang.String" required="false" description="是否限制选择,如果限制,设置为disabled"%>
+<script type="text/javascript">
+function searchGrid${id}(){
+	var ids =  $("#ids").val();
+	//alert(ids);
+    //$(" #id").val();
+	top.layer.open({
+	    type: 2,
+	    area: ['90%','90%'],
+	    title:"${title}",
+	    name:'friend',
+		skin:"two-btns",
+	    content: encodeURI("${url}?fieldLabels=${fieldLabels}&fieldKeys=${fieldKeys}&url=${url}&searchLabel=${searchLabel}&searchKey=${searchKey}&ids="+ids) ,
+	    btn: ['确定', '关闭'],
+	    yes: function(index, layero){
+	    	 var iframeWin = layero.find('iframe')[0].contentWindow; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+	    	 var item = iframeWin.getSelectedItem();
+
+	    	 if(item == "-1"){
+		    	 return;
+	    	 }
+	    	 $("#${id}Id").val(item.split('_item_')[0]);
+	    	 $("#${id}Name").val(item.split('_item_')[1]);
+			 top.layer.close(index);//关闭对话框。
+			setPNumber(item.split('_item_')[0],'${id}');
+		  },
+		  cancel: function(index){ 
+	       }
+	}); 
+};
+</script>
+	<input id="${id}Id" name="${name}"  type="hidden" value="${value}"/>
+	<div class="input-group" style="width: 100%">
+		<input id="${id}Name"  onclick="searchGrid${id}()" placeholder="${title}" name="${labelName }" ${allowInput?'':'readonly="readonly"'} type="text" value="${labelValue}" data-msg-required="${dataMsgRequired}"
+		class="${cssClass}" style="${cssStyle}"/>
+    </div>
+	 <label id="${id}Name-error" class="error" for="${id}Name" style="display:none"></label>

+ 12 - 9
src/main/webapp/webpage/modules/workinvoice/workInvoiceForm.jsp

@@ -156,7 +156,8 @@
                 }
             })
         }
-        function setPNumber(obj){
+        function setPNumber(obj,ids){
+        	var idx=ids.split("_")[0]
             $.ajax({
                 type:'post',
                 url:'${ctx}/workinvoice/workInvoice/getPNumber',
@@ -165,12 +166,14 @@
                 },
                 success:function(data){
                     var d = JSON.parse(data);
-                    $("#pNumber").val(d.pNumber);
-                    $("#cInfoName").val(d.cInfoName);
-                    $("#cName").val(d.cName);
-                    $("#officeName").val(d.officeName);
-                    $("#officeId").val(d.officeId);
-					$("#prdNumber").val(d.prdNumber);
+                    var workContractName="#"+idx+"_workContractName";
+                    var projectNum="#"+idx+"_projectNum";
+                    var clientName="#"+idx+"_clientName";
+                    var reportDataNum="#"+idx+"_reportDataNum";
+                    $(workContractName).val(d.workContractName);
+                    $(projectNum).val(d.projectNum);
+                    $(clientName).val(d.clientName);
+                    $(reportDataNum).val(d.reportDataNum);
 				}
                 })
         }
@@ -430,8 +433,8 @@
 							<input id="workInvoiceProjectRelationList{{idx}}_delFlag" name="workInvoiceProjectRelationList[{{idx}}].delFlag" type="hidden" value="0"/>
                         </td>
                         <td>
-                            <sys:gridselectcallprojectt url="${ctx}/workinvoice/workInvoice/selectproject" id="workInvoiceProjectRelationList{{idx}}_projectId" name="workInvoiceProjectRelationList[{{idx}}].projectId"  value="${workInvoice.project.id}"  title="选择所属项目" labelName="workInvoiceProjectRelationList[{{idx}}].projectName" cssStyle="background-color: #fff"
-													labelValue="${workInvoice.project.projectName}" cssClass="form-control required layui-input" fieldLabels="项目" fieldKeys="projectName" searchLabel="项目名称" searchKey="projectName" ></sys:gridselectcallprojectt>
+                            <sys:gridselectcallprojecttss url="${ctx}/workinvoice/workInvoice/selectproject" id="workInvoiceProjectRelationList{{idx}}_projectId" name="workInvoiceProjectRelationList[{{idx}}].projectId"  value="${workInvoice.project.id}"  title="选择所属项目" labelName="workInvoiceProjectRelationList[{{idx}}].projectName" cssStyle="background-color: #fff"
+													labelValue="${workInvoice.project.projectName}" cssClass="form-control required layui-input" fieldLabels="项目" fieldKeys="projectName" searchLabel="项目名称" searchKey="projectName" ></sys:gridselectcallprojecttss>
                         </td>
                         <td>
 							<input id="workInvoiceProjectRelationList{{idx}}_workContractName"   type="text" value="{{row.workContractName}}" maxlength="32" readonly="readonly"  class="form-control"/>