瀏覽代碼

报销调整,发票红冲调整

huangguoce 2 周之前
父節點
當前提交
1de7d49217

+ 1 - 0
src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceAllController.java

@@ -1626,4 +1626,5 @@ public class WorkInvoiceAllController extends BaseController {
 		return "redirect:"+Global.getAdminPath()+"/workinvoiceAll/workInvoiceAll/?repage";
 	}
 
+
 }

+ 3 - 3
src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceAllTwoController.java

@@ -1450,12 +1450,12 @@ public class WorkInvoiceAllTwoController extends BaseController {
 	}
 
 	/**
-	 * 查看,增加,编辑开票管理表单页面
+	 *红冲页面
 	 */
 	@RequiresPermissions(value={"workinvoice:workInvoice:view","workinvoice:workInvoice:add","workinvoice:workInvoice:edit"},logical= Logical.OR)
 	@RequestMapping(value = "rcForm")
 	public String rcForm(WorkInvoice workInvoice, Model model) {
-		String view = "workInvoiceAllRcForm";
+		String view = "workInvoiceAllTwoRcForm";
 		if(StringUtils.isNotBlank(workInvoice.getId())){
 			workInvoiceService.queryDetails(workInvoice);
 		}
@@ -1475,7 +1475,7 @@ public class WorkInvoiceAllTwoController extends BaseController {
 					break;
 				}
 			}
-			view = "workInvoiceAllRcForm";
+			view = "workInvoiceAllTwoRcForm";
 		}else if("3".equals(tabId)){
 			ProcessInstance processInstance = actTaskService.getProcIns(workInvoice.getProcessInstanceId());
 			if (processInstance!=null) {

+ 14 - 34
src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceTwoController.java

@@ -1820,43 +1820,24 @@ public class WorkInvoiceTwoController extends BaseController {
 				}
 			}
 			view = "workInvoiceAllRcForm";
+			model.addAttribute("showFlag", "1");
 		}else if("3".equals(tabId)){
-			ProcessInstance processInstance = actTaskService.getProcIns(workInvoice.getProcessInstanceId());
-			if (processInstance!=null) {
-				Task taskInfok = actTaskService.getCurrentTaskInfo(processInstance);
-				Act act = new Act();
-				act.setTaskId(taskInfok.getId());
-				act.setTaskName(taskInfok.getName());
-				act.setTaskDefKey(taskInfok.getTaskDefinitionKey());
-				act.setProcDefId(taskInfok.getProcessDefinitionId());
-				act.setProcInsId(taskInfok.getProcessInstanceId());
-				act.setTask(taskInfok);
-				workInvoice.setAct(act);
-				view = "workInvoiceTwoRcForm";
-
-
-				//获取发票项目信息
-				List<WorkInvoiceProjectRelation> workInvoiceProjectRelationList = workInvoice.getWorkInvoiceProjectRelationList();
-				List<String> projectIdList = Lists.newArrayList();
-				//获取项目id并查询所有包含项目id的项目信息
-				for (WorkInvoiceProjectRelation projectInfo: workInvoiceProjectRelationList) {
-					if(StringUtils.isNotBlank(projectInfo.getProjectId())){
-						projectIdList.add(projectInfo.getProjectId());
-					}
+			List<MainDictDetail> billingContentList = DictUtils.getMainDictList("billing_content");
+			for (MainDictDetail dictDetail: billingContentList) {
+				if(workInvoice.getBillingContent().equals(dictDetail.getValue())){
+					workInvoice.setBillingContent(dictDetail.getLabel());
+					break;
 				}
-
-				if(projectIdList.size()>0){
-					//根据项目id查询项目信息中的项目类别
-					String projectSortCostInfo = ruralProjectRecordsService.getProjectSortCostInfo(projectIdList);
-					//如果项目类别中包含审定(内)即 8 则需要进行部门主任审核
-					if(null != projectSortCostInfo && projectSortCostInfo.contains("8")){
-						view = "workInvoiceExamineModify";
-					}
-				}else{
-					view = "workInvoiceNotProjectModify";
+			}
+			List<MainDictDetail> receiptTypeList = DictUtils.getMainDictList("receipt_type");
+			for (MainDictDetail dictDetail: receiptTypeList) {
+				if(workInvoice.getChargeType().equals(dictDetail.getValue())){
+					workInvoice.setChargeType(dictDetail.getLabel());
+					break;
 				}
-
 			}
+			view = "workInvoiceAllRcForm";
+			model.addAttribute("showFlag", "1");
 		}
 		if (StringUtils.isBlank(workInvoice.getId())){
 			workInvoice.setInvoiceDate(new Date());
@@ -1881,7 +1862,6 @@ public class WorkInvoiceTwoController extends BaseController {
 		workInvoice.setInvoiceState(null);
 		//清空发票列表
 		workInvoice.setWorkAccountList(null);
-		model.addAttribute("showFlag", "1");
 		model.addAttribute("workInvoice", workInvoice);
 		return "modules/workinvoice/" + view;
 	}

+ 7 - 5
src/main/webapp/WEB-INF/tags/sys/treeselectAccessoryNoParent.tag

@@ -37,7 +37,9 @@
 			return true;
 		}
 		var myUrl = "${url}";
-		if ("${title}" == "报销类别" && '${id}' != 'workAccountList1_type'){
+		console.log("${title}")
+		console.log("${id}")
+		if ("${title}" == "报销类别" &&( '${id}' != 'workAccountList1_type' &&  '${id}' != 'workAccountList1type')){
 			myUrl = "/reimbursementType/reimbursementType/treeDataByClCz"
 		}
 		// 正常打开
@@ -89,7 +91,7 @@
 						}
 
 						top.layer.close(index);
-						if ("${title}" == "报销类别" && '${id}' == 'workAccountList1_type'){
+						if ("${title}" == "报销类别" && ('${id}' == 'workAccountList1_type' || '${id}' == 'workAccountList1type')){
 							if(names.join(",") != '业务操作奖' &&  names.join(",") != "业务差旅费"){
 								if($("#${id}Name").val() == '业务操作奖' || $("#${id}Name").val() == "业务差旅费"){
 									top.layer.open({
@@ -103,15 +105,15 @@
 											// 获取所有 td
 											var tds = $('#workAccountList .op-td');
 											for (var i = tds.length - 1; i > 0; i--) {  // 注意 i > 0,从倒数第二个开始
-												var td = tds.eq(i); // 当前 td
+												var td = tds.eq(i);
 												// 找到 td 内 class="op-btn-delete" 的元素
 												var deleteBtn = td.find('.op-btn-delete');
 												// 触发 onclick
 												deleteBtn.each(function() {
 													if (this.onclick) {
-														this.onclick(); // 调用 HTML 内联 onclick
+														this.onclick();
 													} else {
-														$(this).trigger('click'); // 调用 jQuery click 事件
+														$(this).trigger('click');
 													}
 												});
 											}

+ 2 - 2
src/main/webapp/webpage/modules/workinvoice/workInvoiceAllList.jsp

@@ -830,9 +830,9 @@
 						{
 							xml += "<a href=\"${ctx}/workinvoiceAll/workInvoiceAll/delete?id=" + d.id + "\" onclick=\"return confirmx('确认要删除该发票记录吗?', this.href)\"   class=\"layui-btn layui-btn-xs layui-bg-red\"> 删除</a>";
 						}
-						if(d.redInvoice != undefined && d.redInvoice =="1")
+						if(d.redInvoice != undefined && d.redInvoice =="1" && Math.sign(d.money) !== -1)
 						{
-							xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogre('红冲', '${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/rcForm?id=" + d.id + "&tabId=1','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-red\" >红冲</a>";
+							xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogre('红冲', '${ctx}/workinvoiceTwo/workinvoiceTwo/rcForm?id=" + d.id + "&tabId=1','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-red\" >红冲</a>";
 						}
 						xml+="</div>"
                         return xml;

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

@@ -894,7 +894,7 @@
 							xml += "<a href=\"${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/delete?id=" + d.id + "\" onclick=\"return confirmx('确认要删除该发票记录吗?', this.href)\"   class=\"layui-btn layui-btn-xs layui-bg-red\"> 删除</a>";
 						}
 
-						if(d.redInvoice != undefined && d.redInvoice =="1")
+						if(d.redInvoice != undefined && d.redInvoice =="1"  && Math.sign(d.money) !== -1)
 						{
 							xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogre('红冲', '${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/rcForm?id=" + d.id + "&tabId=1','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-red\" >红冲</a>";
 						}

文件差異過大導致無法顯示
+ 1367 - 0
src/main/webapp/webpage/modules/workinvoice/workInvoiceAllTwoRcForm.jsp


+ 2 - 2
src/main/webapp/webpage/modules/workinvoice/workInvoiceTwoList.jsp

@@ -955,9 +955,9 @@
 						{
 							xml += "<a href=\"${ctx}/workinvoiceTwo/workinvoiceTwo/delete?id=" + d.id + "\" onclick=\"return confirmx('确认要删除该发票记录吗?', this.href)\"   class=\"layui-btn layui-btn-xs layui-bg-red\"> 删除</a>";
 						}
-						if(d.redInvoice != undefined && d.redInvoice =="1")
+						if(d.redInvoice != undefined && d.redInvoice =="1"  && Math.sign(d.money) !== -1)
 						{
-							xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogre('红冲', '${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/rcForm?id=" + d.id + "&tabId=1','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-red\" >红冲</a>";
+							xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogre('红冲', '${ctx}/workinvoiceTwo/workinvoiceTwo/rcForm?id=" + d.id + "&tabId=1','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-red\" >红冲</a>";
 						}
 						xml+="</div>"
 						return xml;

+ 19 - 19
src/main/webapp/webpage/modules/workreimbursement/treeForm/new/workReimbursementNewFormAdd.jsp

@@ -196,7 +196,7 @@
 
                             // 3. 替换模板中的所有占位符
                             var accessoryNoParentParsedTagHtml = accessoryNoParentTemplateHtml
-                                .replace(/__INDEX__/g, index) // 替换索引
+                                .replace(/__INDEX__/g, index+1) // 替换索引
                                 .replace(/__TYPE__/g, typeValue) // 替换type值(处理空值后)
                                 .replace(/__TYPE_NAME__/g, typeNameValue); // 替换typeName值(处理空值后)
 
@@ -211,7 +211,7 @@
 
                             // 3. 替换模板中的所有占位符
                             var reprojectParsedTagHtml = reprojectTemplateHtml
-                                .replace(/__INDEX__/g, index) // 替换行索引
+                                .replace(/__INDEX__/g, index+1) // 替换行索引
                                 .replace(/__PROJECT_ID__/g, projectId) // 替换项目ID(处理空值后)
                                 .replace(/__PROJECT_NAME__/g, projectName) // 替换项目名称(处理空值后)
                                 .replace(/__PROJECT_RADIO__/g, projectRadio); // 替换projectRadio(处理空值后)
@@ -233,7 +233,7 @@
 
                             if(flag) {
                                 const trId = 'workAccountList' + index;
-
+                                index = index+1
                                 $("#workAccountList").append("<tr id='workAccountList" + index + "' class='rowSize'>" +
                                     "<td class='hide'>" +
                                     "<input id='workAccountList" + index + "_id' name='workAccountList[" + index + "].id' type='hidden' value='" + obj.id + "'/>" +
@@ -365,9 +365,9 @@
 
             // 1. 获取后端渲染的列表字符串(注意:不要加单引号,直接获取模板渲染结果)
             var listStr = '${workReimbursement.workAccountListCount}';
-            console.log(listStr)
             if(listStr<1){
                 addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,'',true)
+                workAccountListRowIdx = workAccountListRowIdx+1
             }
         });
 
@@ -909,6 +909,7 @@
                 tpl = tpl.replace("workAccountList[0].financialSubjectss","workAccountList["+idx1+"].financialSubjectss");
                 tpl = tpl.replace("not_project_reimbursement_div","not_project_reimbursement_div\" style=\"display:none;\"");
                 tpl = tpl.replace("project_reimbursement_div\" style=\"display:none;\"","project_reimbursement_div");
+
                 bornTemplete(list, idx, tpl, row, idx1,number);
                 //将报销人和部门自动赋值
                 // if (idx==0 && flag){
@@ -1520,11 +1521,9 @@
                         top.layer.close(tempIndex);
                         // 获取所有 td
                         var tds = $('#workAccountList .op-td');
-                        for (var i = tds.length - 1; i >= 0; i--) {  // 注意 i > 0,从倒数第二个开始
+                        for (var i = tds.length - 1; i >= 0; i--) {
                             var td = tds.eq(i); // 当前 td
-                            // 找到 td 内 class="op-btn-delete" 的元素
                             var deleteBtn = td.find('.op-btn-delete');
-                            // 触发 onclick
                             deleteBtn.each(function(eleIndex,ele) {
                                 if (i == 0){
                                     delRowParentNew(ele,"#workAccountList1",true)
@@ -2442,9 +2441,9 @@
         </div>
         <div class="form-group layui-row">
             <div class="form-group-label"><h2>报销详情<span style="color: red;font-size: 14px"> (可在报销单后新增数电发票xml格式的附件获取发票信息)</span></h2></div>
-            <%--<div class="layui-item nav-btns">
+            <div class="layui-item nav-btns">
                 <a class="nav-btn nav-btn-add" onclick="addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,'',true);workAccountListRowIdx = workAccountListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增报销单</a>
-            </div>--%>
+            </div>
             <div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
                 <table id="contentTable" class="table table-bordered table-condensed can-edit no-bottom-margin details tree_table">
                     <thead>
@@ -2646,7 +2645,7 @@
                 </td>
                 <td style="vertical-align: middle; text-align:center;" class="op-td" >
                     <span class="op-btn op-btn-add" onclick="addRowInfoForm(this, '#workAccountList{{idx}}')" title="添加"><i class="fa fa-plus"></i>&nbsp;新增</span>
-                    <%--{{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRowParentNew(this, '#workAccountList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}--%>
+                    {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRowParentNew(this, '#workAccountList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}
                 </td>
                 </tr>//-->
                 </script>
@@ -2736,15 +2735,16 @@
                         reimbursementVATTaxesRowIdx = ${fn:length(workReimbursement.reimbursementVATTaxes)};
                     }
                     $(document).ready(function() {
-                        var data = ${fns:toJson(workReimbursement.createBy)};
-                        addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,data,true );
-                        workAccountListRowIdx = workAccountListRowIdx + 1;
-                        document.querySelector('.nav-btn-add').style.display = 'none';
-                    <%--    var data = ${fns:toJson(workReimbursement.reimbursementVATTaxes)};--%>
-                    <%--for (var i=0; i<data.length; i++){--%>
-                    <%--    addRow('#reimbursementVATTaxes', reimbursementVATTaxesRowIdx, reimbursementVATTaxesTpl, data[i]);--%>
-                    <%--    reimbursementVATTaxesRowIdx = reimbursementVATTaxesRowIdx + 1;--%>
-                    <%--}--%>
+                        <%--var data = ${fns:toJson(workReimbursement.createBy)};--%>
+                        <%--addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,data,true );--%>
+                        <%--workAccountListRowIdx = workAccountListRowIdx + 1;--%>
+                        var tempData = ${fns:toJson(workReimbursement.workAccountList)};
+                        if(tempData.length > 0 &&tempData[0].typeName == '业务差旅费'  ){
+                            document.querySelector('.nav-btn-add').style.display = 'block';
+                        }else{
+                            document.querySelector('.nav-btn-add').style.display = 'none';
+                        }
+
                     });
                 </script>
             </div>