Procházet zdrojové kódy

发票添加作废功能

user5 před 4 roky
rodič
revize
2966ac4877

+ 1 - 1
src/main/webapp/webpage/modules/workinvoice/conditionWorkInvoiceAudit.jsp

@@ -215,7 +215,7 @@
 			<div class="layui-item layui-col-sm12 with-textarea">
 				<label class="layui-form-label">作废原因:</label>
 				<div class="layui-input-block">
-					<form:textarea path="remarks" readonly="true"  class="form-control" htmlEscape="false" rows="4"  maxlength="255"/>
+					<form:textarea path="cancellationRemark" readonly="true"  class="form-control" htmlEscape="false" rows="4"  maxlength="255"/>
 				</div>
 			</div>
                 <div class="layui-item layui-col-sm12 with-textarea">

+ 79 - 38
src/main/webapp/webpage/modules/workinvoice/conditionWorkInvoiceForm.jsp

@@ -10,6 +10,10 @@
 			top:80px;
 			left:0;
 		}
+		#workInvoiceProjectRelationList tr td{
+			padding-left: 0px;
+			padding-right: 0px;
+		}
 	</style>
 	<script type="text/javascript">
         var validateForm;
@@ -297,6 +301,29 @@
             var number = c+timestamp;
             $("#" +  a ).val(number);
         }
+		function addRow1(list, idx, tpl, row){
+			var idx1 = $("#workInvoiceProjectRelationList tr").length;
+			if(list == '#workInvoiceProjectRelationList'){
+				bornTemplete1(list, idx, tpl, row, idx1);
+			}
+		}
+		function bornTemplete1(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");
+					}
+				}
+			});
+		}
 	</script>
 </head>
 <body>
@@ -309,43 +336,57 @@
 
 			<div class="form-group layui-row first">
 				<div class="form-group-label"><h2>基本信息</h2></div>
-				<div class="layui-item layui-col-sm6">
-					<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="${workInvoice.project.projectName}"/>
-					</div>
-				</div>
-				<div class="layui-item layui-col-sm6">
-					<label class="layui-form-label"><span class="require-item">*</span>发票申请编号:</label>
-					<div class="layui-input-block">
-						<div class="input-group">
-							<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.number}"/>
-						</div>
-					</div>
-				</div>
-				<div class="layui-item layui-col-sm6">
-					<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="${workInvoice.project.workContractInfo.name}"/>
-					</div>
-				</div>
-				<div class="layui-item layui-col-sm6">
-					<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="${workInvoice.project.projectId}"/>
-					</div>
-				</div>
-				<div class="layui-item layui-col-sm6">
-					<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="${workInvoice.project.workContractInfo.client.name}"/>
-					</div>
-				</div>
-				<div class="layui-item layui-col-sm6">
-					<label class="layui-form-label">报告号:</label>
-					<div class="layui-input-block">
-						<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${workInvoice.project.reportData.number}"/>
-					</div>
+				<div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
+					<table id="contentTables" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+						<thead>
+						<tr>
+							<th width="200px"><font color="red">*</font>项目名称</th>
+							<th width="200px">合同名称</th>
+							<th width="200px">项目编号</th>
+							<th width="200px">委托方</th>
+							<th width="200px">报告号</th>
+						</tr>
+						</thead>
+						<tbody id="workInvoiceProjectRelationList">
+						</tbody>
+					</table>
+					<script type="text/template" id="workInvoiceProjectRelationListTpl">//<!--
+                    <tr id="workInvoiceProjectRelationList{{idx}}">
+                        <td class="hide">
+                            <input id="workInvoiceProjectRelationList{{idx}}_invoiceId" name="workInvoiceProjectRelationList[{{idx}}].invoiceId" type="hidden" value="{{row.invoiceId}}"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_projectId" name="workInvoiceProjectRelationList[{{idx}}].projectId" type="hidden" value="{{row.projectId}}"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_delFlag" name="workInvoiceProjectRelationList[{{idx}}].delFlag" type="hidden" value="0"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_projectName"   type="text" value="{{row.projectName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_workContractName"   type="text" value="{{row.workContractName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td style="text-align:center;">
+							<input id="workInvoiceProjectRelationList{{idx}}_projectNum"  type="text" value="{{row.projectNum}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_clientName"  type="text" value="{{row.clientName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_reportDataNum"  type="text" value="{{row.reportDataNum}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                    </tr>//-->
+					</script>
+					<script type="text/javascript">
+						var workInvoiceProjectRelationListRowIdx = 0, workInvoiceProjectRelationListTpl = $("#workInvoiceProjectRelationListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+						/*if($("#id").val()){
+                            workInvoiceProjectRelationListRowIdx = ${fn:length(workInvoice.workInvoiceProjectRelationList)};
+						}*/
+						$(document).ready(function() {
+							var data = ${fns:toJson(workInvoice.workInvoiceProjectRelationList)};
+							for (var i=0; i<data.length; i++){
+								addRow1('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl, data[i])
+								workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;
+							}
+						});
+					</script>
 				</div>
 			</div>
 			<div class="form-group layui-row first">
@@ -506,4 +547,4 @@
 </div>
 
 </body>
-</html>
+</html>

+ 79 - 38
src/main/webapp/webpage/modules/workinvoice/conditionWorkInvoiceModify.jsp

@@ -10,6 +10,10 @@
 			top:80px;
 			left:0;
 		}
+		#workInvoiceProjectRelationList tr td{
+			padding-left: 0px;
+			padding-right: 0px;
+		}
 	</style>
 	<script type="text/javascript">
 		var validateForm;
@@ -297,6 +301,29 @@
 			var number = c+timestamp;
 			$("#" +  a ).val(number);
 		}
+		function addRow1(list, idx, tpl, row){
+			var idx1 = $("#workInvoiceProjectRelationList tr").length;
+			if(list == '#workInvoiceProjectRelationList'){
+				bornTemplete1(list, idx, tpl, row, idx1);
+			}
+		}
+		function bornTemplete1(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");
+					}
+				}
+			});
+		}
 	</script>
 </head>
 <body>
@@ -316,43 +343,57 @@
 
 			<div class="form-group layui-row first">
 				<div class="form-group-label"><h2>基本信息</h2></div>
-				<div class="layui-item layui-col-sm6">
-					<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="${workInvoice.project.projectName}"/>
-					</div>
-				</div>
-				<div class="layui-item layui-col-sm6">
-					<label class="layui-form-label"><span class="require-item">*</span>发票申请编号:</label>
-					<div class="layui-input-block">
-						<div class="input-group">
-							<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.number}"/>
-						</div>
-					</div>
-				</div>
-				<div class="layui-item layui-col-sm6">
-					<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="${workInvoice.project.workContractInfo.name}"/>
-					</div>
-				</div>
-				<div class="layui-item layui-col-sm6">
-					<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="${workInvoice.project.projectId}"/>
-					</div>
-				</div>
-				<div class="layui-item layui-col-sm6">
-					<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="${workInvoice.project.workContractInfo.client.name}"/>
-					</div>
-				</div>
-				<div class="layui-item layui-col-sm6">
-					<label class="layui-form-label">报告号:</label>
-					<div class="layui-input-block">
-						<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${workInvoice.project.reportData.number}"/>
-					</div>
+				<div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
+					<table id="contentTables" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+						<thead>
+						<tr>
+							<th width="200px"><font color="red">*</font>项目名称</th>
+							<th width="200px">合同名称</th>
+							<th width="200px">项目编号</th>
+							<th width="200px">委托方</th>
+							<th width="200px">报告号</th>
+						</tr>
+						</thead>
+						<tbody id="workInvoiceProjectRelationList">
+						</tbody>
+					</table>
+					<script type="text/template" id="workInvoiceProjectRelationListTpl">//<!--
+                    <tr id="workInvoiceProjectRelationList{{idx}}">
+                        <td class="hide">
+                            <input id="workInvoiceProjectRelationList{{idx}}_invoiceId" name="workInvoiceProjectRelationList[{{idx}}].invoiceId" type="hidden" value="{{row.invoiceId}}"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_projectId" name="workInvoiceProjectRelationList[{{idx}}].projectId" type="hidden" value="{{row.projectId}}"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_delFlag" name="workInvoiceProjectRelationList[{{idx}}].delFlag" type="hidden" value="0"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_projectName"   type="text" value="{{row.projectName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_workContractName"   type="text" value="{{row.workContractName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td style="text-align:center;">
+							<input id="workInvoiceProjectRelationList{{idx}}_projectNum"  type="text" value="{{row.projectNum}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_clientName"  type="text" value="{{row.clientName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_reportDataNum"  type="text" value="{{row.reportDataNum}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                    </tr>//-->
+					</script>
+					<script type="text/javascript">
+						var workInvoiceProjectRelationListRowIdx = 0, workInvoiceProjectRelationListTpl = $("#workInvoiceProjectRelationListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+						/*if($("#id").val()){
+                            workInvoiceProjectRelationListRowIdx = ${fn:length(workInvoice.workInvoiceProjectRelationList)};
+						}*/
+						$(document).ready(function() {
+							var data = ${fns:toJson(workInvoice.workInvoiceProjectRelationList)};
+							for (var i=0; i<data.length; i++){
+								addRow1('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl, data[i])
+								workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;
+							}
+						});
+					</script>
 				</div>
 			</div>
 			<div class="form-group layui-row first">
@@ -513,4 +554,4 @@
 </div>
 
 </body>
-</html>
+</html>

+ 3 - 0
src/main/webapp/webpage/modules/workinvoice/workInvoiceList.jsp

@@ -816,6 +816,9 @@
                     <c:if test="${fns:getUser().id == workInvoice.createBy.id}"><c:if test="${workInvoice.invoiceState == '9' || workInvoice.invoiceState == '11' }">,"conditionCandelete":"1"</c:if></c:if>
                     <c:if test="${workInvoice.invoiceState == '2' && fns:getUser().id == workInvoice.createBy.id}">,"cancancel":"1"</c:if>
                     <c:if test="${workInvoice.invoiceState == '6' && fns:getUser().id == workInvoice.createBy.id}">,"conditionCancancel":"1"</c:if>
+					<c:if test="${workInvoice.invoiceState == '5' && fns:getUser().id == workInvoice.createBy.id}">,"cancellationFlag":"1"</c:if>
+
+					
 					<shiro:hasPermission name="workinvoice:workInvoice:alteredit">
                     <c:if test="${workInvoice.invoiceState == '5'}">,"canalter":"1"</c:if>
                     </shiro:hasPermission>