浏览代码

发票/发票管理/财务发票管理 的开票人选项新增

[user3] 3 年之前
父节点
当前提交
534e11b520

+ 27 - 0
src/main/java/com/jeeplus/modules/workinvoice/entity/WorkInvoice.java

@@ -98,6 +98,9 @@ public class WorkInvoice extends ActEntity<WorkInvoice> {
 	private Date receiptBeginDate ;	//收款开始时间
 	private Date receiptEndDate ;	//收款结束时间
 
+	private String newDrawer;    		//开票人状态
+	private String newDrawerId;    		//开票人id
+	private String newDrawerName;    	//开票人名称
 	@Override
 	@ExcelField(title="经办人", fieldType=User.class, value="createBy.name", align=2, sort=7)
 	public User getCreateBy() {
@@ -672,4 +675,28 @@ public class WorkInvoice extends ActEntity<WorkInvoice> {
 	public void setReceiptEndDate(Date receiptEndDate) {
 		this.receiptEndDate = receiptEndDate;
 	}
+
+	public String getNewDrawerId() {
+		return newDrawerId;
+	}
+
+	public void setNewDrawerId(String newDrawerId) {
+		this.newDrawerId = newDrawerId;
+	}
+
+	public String getNewDrawerName() {
+		return newDrawerName;
+	}
+
+	public void setNewDrawerName(String newDrawerName) {
+		this.newDrawerName = newDrawerName;
+	}
+
+	public String getNewDrawer() {
+		return newDrawer;
+	}
+
+	public void setNewDrawer(String newDrawer) {
+		this.newDrawer = newDrawer;
+	}
 }

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

@@ -306,7 +306,11 @@ public class WorkInvoiceAllController extends BaseController {
 					break;
 				}
 			}
-			view = "workInvoiceView";
+			if(StringUtils.isNotBlank(workInvoice.getNewDrawerId()) && workInvoice.getNewDrawerId() != ""){
+				view = "workInvoiceView2";
+			}else {
+				view = "workInvoiceView";
+			}
 		}else if("3".equals(tabId)){
 			List<MainDictDetail> billingContentList = DictUtils.getMainDictList("billing_content");
 			for (MainDictDetail dictDetail: billingContentList) {
@@ -392,6 +396,19 @@ public class WorkInvoiceAllController extends BaseController {
 	 */
 	@RequestMapping(value = "save")
 	public String save(WorkInvoice workInvoice, Model model, RedirectAttributes redirectAttributes) throws Exception{
+		//设置空值,对应不同选项
+		if(workInvoice.getNewDrawer().equals("2")){
+			workInvoice.setClient(new WorkClientInfo());
+			workInvoice.setOrUnicode("");
+			workInvoice.setAddress("");
+			workInvoice.setTelephone("");
+			workInvoice.setBank("");
+			workInvoice.setBankNumber("");
+		}else if(workInvoice.getNewDrawer().equals("1")){
+			workInvoice.setNewDrawerId("");
+			workInvoice.setNewDrawerName("");
+		}
+
 		if (!beanValidator(model, workInvoice)){
 			return form(workInvoice, model);
 		}
@@ -613,6 +630,19 @@ public class WorkInvoiceAllController extends BaseController {
 	 */
 	@RequestMapping(value = "store")
 	public String store(WorkInvoice workInvoice, Model model, RedirectAttributes redirectAttributes) throws Exception{
+//设置空值,对应不同选项
+		if(workInvoice.getNewDrawer().equals("2")){
+			workInvoice.setClient(new WorkClientInfo());
+			workInvoice.setOrUnicode("");
+			workInvoice.setAddress("");
+			workInvoice.setTelephone("");
+			workInvoice.setBank("");
+			workInvoice.setBankNumber("");
+		}else if(workInvoice.getNewDrawer().equals("1")){
+			workInvoice.setNewDrawerId("");
+			workInvoice.setNewDrawerName("");
+		}
+
 		if (!beanValidator(model, workInvoice)){
 			return form(workInvoice, model);
 		}

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

@@ -359,6 +359,19 @@ public class WorkInvoiceAllTwoController extends BaseController {
 	 */
 	@RequestMapping(value = "save")
 	public String save(WorkInvoice workInvoice, Model model, RedirectAttributes redirectAttributes) throws Exception{
+		//设置空值,对应不同选项
+		if(workInvoice.getNewDrawer().equals("2")){
+			workInvoice.setClient(new WorkClientInfo());
+			workInvoice.setOrUnicode("");
+			workInvoice.setAddress("");
+			workInvoice.setTelephone("");
+			workInvoice.setBank("");
+			workInvoice.setBankNumber("");
+		}else if(workInvoice.getNewDrawer().equals("1")){
+			workInvoice.setNewDrawerId("");
+			workInvoice.setNewDrawerName("");
+		}
+
 		if (!beanValidator(model, workInvoice)){
 			return form(workInvoice, model);
 		}
@@ -580,6 +593,19 @@ public class WorkInvoiceAllTwoController extends BaseController {
 	 */
 	@RequestMapping(value = "store")
 	public String store(WorkInvoice workInvoice, Model model, RedirectAttributes redirectAttributes) throws Exception{
+		//设置空值,对应不同选项
+		if(workInvoice.getNewDrawer().equals("2")){
+			workInvoice.setClient(new WorkClientInfo());
+			workInvoice.setOrUnicode("");
+			workInvoice.setAddress("");
+			workInvoice.setTelephone("");
+			workInvoice.setBank("");
+			workInvoice.setBankNumber("");
+		}else if(workInvoice.getNewDrawer().equals("1")){
+			workInvoice.setNewDrawerId("");
+			workInvoice.setNewDrawerName("");
+		}
+
 		if (!beanValidator(model, workInvoice)){
 			return form(workInvoice, model);
 		}

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

@@ -354,6 +354,13 @@ public class WorkInvoiceTwoController extends BaseController {
 			//workInvoice.setInvoiceNumber( (int)((Math.random()*9+1)*100000));
 			workInvoice.setInvoiceDate(new Date());
 		}
+		//可能有问题,是否需要判断vew*
+//		if(StringUtils.isNotBlank(workInvoice.getNewDrawerId()) && workInvoice.getNewDrawerId() != ""){
+//			view = "workInvoiceTwoForm3";
+//		}else {
+//			view = "workInvoiceTwoForm2";
+//		}
+
 		model.addAttribute("workInvoice", workInvoice);
 		return "modules/workinvoice/" + view;
 	}
@@ -392,6 +399,21 @@ public class WorkInvoiceTwoController extends BaseController {
 	 */
 	@RequestMapping(value = "save")
 	public String save(WorkInvoice workInvoice, Model model, RedirectAttributes redirectAttributes) throws Exception{
+		//设置空值,对应不同选项
+		if(workInvoice.getNewDrawer().equals("2")){
+			workInvoice.setClient(new WorkClientInfo());
+			workInvoice.setOrUnicode("");
+			workInvoice.setAddress("");
+			workInvoice.setTelephone("");
+			workInvoice.setBank("");
+			workInvoice.setBankNumber("");
+		}else if(workInvoice.getNewDrawer().equals("1")){
+			workInvoice.setNewDrawerId("");
+			workInvoice.setNewDrawerName("");
+		}
+
+
+
 		if (!beanValidator(model, workInvoice)){
 			return form(workInvoice, model);
 		}
@@ -637,6 +659,18 @@ public class WorkInvoiceTwoController extends BaseController {
 	 */
 	@RequestMapping(value = "store")
 	public String store(WorkInvoice workInvoice, Model model, RedirectAttributes redirectAttributes) throws Exception{
+		//设置空值,对应不同选项
+		if(workInvoice.getNewDrawer().equals("2")){
+			workInvoice.setClient(new WorkClientInfo());
+			workInvoice.setOrUnicode("");
+			workInvoice.setAddress("");
+			workInvoice.setTelephone("");
+			workInvoice.setBank("");
+			workInvoice.setBankNumber("");
+		}else if(workInvoice.getNewDrawer().equals("1")){
+			workInvoice.setNewDrawerId("");
+			workInvoice.setNewDrawerName("");
+		}
 		if (!beanValidator(model, workInvoice)){
 			return form(workInvoice, model);
 		}

+ 25 - 4
src/main/resources/mappings/modules/workinvoice/WorkInvoiceDao.xml

@@ -64,7 +64,10 @@
 		a.cancellation_remark as "cancellationRemark",
 		a.account_checking_user_id as "accountCheckingUserId",
 		a.area_id as "area.id",
-		acu.name as "accountCheckingUserName"
+		acu.name as "accountCheckingUserName",
+		a.new_drawer_id as "newDrawerId",
+		(select name from sys_user where id = a.new_drawer_id) as "newDrawerName",
+		a.new_drawer as "newDrawer"
 	</sql>
 
 	<sql id="workInvoiceJoins">
@@ -521,6 +524,18 @@
 				<if test="dbName == 'mssql'">'%'+#{widNumber}+'%'</if>
 				<if test="dbName == 'mysql'">concat('%',#{widNumber},'%')</if>
 			</if>
+		    <if test="newDrawerId != null and newDrawerId != ''">
+				and new_drawer_id like
+				<if test="dbName == 'oracle'">'%'||#{newDrawerId}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{newDrawerId}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{newDrawerId},'%')</if>
+			</if>
+			<if test="newDrawer != null and newDrawer != ''">
+				and new_drawer like
+				<if test="dbName == 'oracle'">'%'||#{newDrawer}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{newDrawer}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{newDrawer},'%')</if>
+			</if>
 			${sqlMap.dsf}
 		</where>
 		<choose>
@@ -1239,7 +1254,9 @@
 			cancellation_remark,
 			account_checking_user_id,
 			area_id,
-			area_parent_id
+			area_parent_id,
+			new_drawer_id,
+			new_drawer
 		) VALUES (
 			#{id},
 			#{number},
@@ -1281,7 +1298,9 @@
 			#{cancellationRemark},
 			#{accountCheckingUserId},
 			#{area.id},
-			(select parent_ids from sys_area where id = #{area.id})
+			(select parent_ids from sys_area where id = #{area.id}),
+		    #{newDrawerId},
+		    #{newDrawer}
 		)
 	</insert>
 
@@ -1322,7 +1341,9 @@
 			cancellation_remark = #{cancellationRemark},
 			account_checking_user_id = #{accountCheckingUserId},
 			area_id = #{area.id},
-			area_parent_id = (select parent_ids from sys_area where id = #{area.id})
+			area_parent_id = (select parent_ids from sys_area where id = #{area.id}),
+			new_drawer_id = #{newDrawerId},
+			new_drawer = #{newDrawer}
 		WHERE id = #{id}
 	</update>
 	<update id="updateDate">

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

@@ -89,6 +89,18 @@
 				$(".contractType").show();
 				$("#contractTypeDoc").attr("class","form-control judgment");
 			}
+
+			var newDrawerRadio = '${workInvoice.newDrawer}';//后端获取值
+			if(undefined == newDrawerRadio || null == newDrawerRadio || '' == newDrawerRadio || newDrawerRadio == "1"){
+				document.getElementsByName("newDrawer")[0].checked = true;
+				$(".count2").hide();
+				$(".count1").show();
+			}else{
+				document.getElementsByName("newDrawer")[1].checked = true;
+				$(".count1").hide();
+				$(".count2").show();
+			}
+
 			layui.use(['form', 'layer'], function () {
 				var form = layui.form;
 				form.on("radio(invoiceType)", function(event){
@@ -110,6 +122,20 @@
 						$("#telephone").attr("class","form-control isTel layui-input");
 					}
 				});
+
+				form.on('radio(newDrawerRadio)',function (event) {
+					var radioVal = $(this).val();
+					console.log(radioVal);
+					if(radioVal == 1 || radioVal == 1){
+						$(".count2").hide();
+						$(".count1").show();
+					}else if(radioVal == 2 || radioVal == 2){
+						$(".count1").hide();
+						$(".count2").show();
+					}
+					form.render();
+				})
+
 				form.on('select(billingContent)', function(data){
 					if(data.value == 8){
 						$(".contractType").show();
@@ -816,6 +842,14 @@
 					</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 type="radio" name="newDrawer" lay-filter="newDrawerRadio" title="企业开票" value="1">
+						<input type="radio" name="newDrawer" lay-filter="newDrawerRadio" title="个人开票" value="2">
+					</div>
+				</div>
+				<div class="layui-form-item count1">
+				<div class="layui-item layui-col-sm6">
 					<label class="layui-form-label double-line"><span class="require-item">*</span>实际开票单位:</label>
 					<div class="layui-input-block with-icon">
 						<sys:gridselect url="${ctx}/workinvoice/workInvoice/selectclient" id="client" name="client.id"  value="${workInvoice.client.id}"  title="选择开票单位" labelName="workInvoice.client.name" cssStyle="background-color: #fff"
@@ -852,7 +886,16 @@
 						<form:input id="bankNumber" path="bankNumber" htmlEscape="false" placeholder="请输入银行账号"  onkeyup="this.value=this.value.replace(/[^\d-]/g,'')" class="form-control layui-input"/>
 					</div>
 				</div>
-
+				</div>
+				<div class="layui-form-item count2">
+					<div class="layui-item layui-col-sm6">
+						<label class="layui-form-label"><span class="require-item">*</span>姓名:</label>
+						<div class="layui-input-block  with-icon">
+							<sys:treeselect id="newDrawer" name="newDrawerId" value="${workInvoice.newDrawerId}" labelName="newDrawerName" labelValue="${workInvoice.newDrawerName}"
+											cssStyle="background-color: #fff" title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control judgment layui-input" allowClear="true" notAllowSelectParent="true"/>
+						</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 readOnlyFFF">

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

@@ -89,6 +89,18 @@
 				$(".contractType").show();
 				$("#contractTypeDoc").attr("class","form-control judgment");
 			}
+
+			var newDrawerRadio = '${workInvoice.newDrawer}';//后端获取值
+			if(undefined == newDrawerRadio || null == newDrawerRadio || '' == newDrawerRadio || newDrawerRadio == "1"){
+				document.getElementsByName("newDrawer")[0].checked = true;
+				$(".count2").hide();
+				$(".count1").show();
+			}else{
+				document.getElementsByName("newDrawer")[1].checked = true;
+				$(".count1").hide();
+				$(".count2").show();
+			}
+
 			layui.use(['form', 'layer'], function () {
 				var form = layui.form;
 				form.on("radio(invoiceType)", function(event){
@@ -111,6 +123,19 @@
 					}
 				});
 
+				form.on('radio(newDrawerRadio)',function (event) {
+					var radioVal = $(this).val();
+					console.log(radioVal);
+					if(radioVal == 1 || radioVal == 1){
+						$(".count2").hide();
+						$(".count1").show();
+					}else if(radioVal == 2 || radioVal == 2){
+						$(".count1").hide();
+						$(".count2").show();
+					}
+					form.render();
+				})
+
 				form.on('select(billingContent)', function(data){
 					if(data.value == 8){
 						$(".contractType").show();
@@ -786,6 +811,14 @@
 					</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 type="radio" name="newDrawer" lay-filter="newDrawerRadio" title="企业开票" value="1">
+						<input type="radio" name="newDrawer" lay-filter="newDrawerRadio" title="个人开票" value="2">
+					</div>
+				</div>
+				<div class="layui-form-item count1">
+				<div class="layui-item layui-col-sm6">
 					<label class="layui-form-label double-line"><span class="require-item">*</span>实际开票单位:</label>
 					<div class="layui-input-block with-icon">
 						<sys:gridselect url="${ctx}/workinvoice/workInvoice/selectclient" id="client" name="client.id"  value="${workInvoice.client.id}"  title="选择开票单位" labelName="workInvoice.client.name" cssStyle="background-color: #fff"
@@ -822,7 +855,16 @@
 						<form:input id="bankNumber" path="bankNumber" htmlEscape="false" placeholder="请输入银行账号" onkeyup="this.value=this.value.replace(/[^\d-]/g,'')" class="form-control layui-input"/>
 					</div>
 				</div>
-
+				</div>
+				<div class="layui-form-item count2">
+					<div class="layui-item layui-col-sm6">
+						<label class="layui-form-label"><span class="require-item">*</span>姓名:</label>
+						<div class="layui-input-block  with-icon">
+							<sys:treeselect id="newDrawer" name="newDrawerId" value="${workInvoice.newDrawerId}" labelName="newDrawerName" labelValue="${workInvoice.newDrawerName}"
+											cssStyle="background-color: #fff" title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control judgment layui-input" allowClear="true" notAllowSelectParent="true"/>
+						</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 readOnlyFFF">

+ 44 - 0
src/main/webapp/webpage/modules/workinvoice/workInvoiceTwoForm.jsp

@@ -90,8 +90,21 @@
 				$(".contractType").show();
 				$("#contractTypeDoc").attr("class","form-control judgment");
 			}
+
+			var newDrawerRadio = '${workInvoice.newDrawer}';//后端获取值
+			if(undefined == newDrawerRadio || null == newDrawerRadio || '' == newDrawerRadio || newDrawerRadio == "1"){
+				document.getElementsByName("newDrawer")[0].checked = true;
+				$(".count2").hide();
+				$(".count1").show();
+			}else{
+				document.getElementsByName("newDrawer")[1].checked = true;
+				$(".count1").hide();
+				$(".count2").show();
+			}
+
 			layui.use(['form', 'layer'], function () {
 				var form = layui.form;
+
 				form.on("radio(invoiceType)", function(event){
 					var radioVal = $(this).val();
 					//专票必填
@@ -112,6 +125,18 @@
 					}
 				});
 
+				form.on('radio(newDrawerRadio)',function (event) {
+					var radioVal = $(this).val();
+					if(radioVal == 1 || radioVal == 1){
+						$(".count2").hide();
+						$(".count1").show();
+					}else if(radioVal == 2 || radioVal == 2){
+						$(".count1").hide();
+						$(".count2").show();
+					}
+					form.render();
+				})
+
 				form.on('select(billingContent)', function(data){
 					if(data.value == 8){
 						$(".contractType").show();
@@ -121,6 +146,7 @@
 						$("#contractTypeDoc").attr("class","form-control");
 					}
 				});
+
 			});
             /*$('#money').keyup(function(){
                 var c=$(this);
@@ -820,6 +846,14 @@
 					</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 type="radio" name="newDrawer" lay-filter="newDrawerRadio" title="企业开票" value="1">
+						<input type="radio" name="newDrawer" lay-filter="newDrawerRadio" title="个人开票" value="2">
+					</div>
+				</div>
+				<div class="layui-form-item count1">
+				<div class="layui-item layui-col-sm6">
 					<label class="layui-form-label double-line"><span class="require-item">*</span>实际开票单位:</label>
 					<div class="layui-input-block with-icon">
 						<sys:gridselect url="${ctx}/workinvoiceTwo/workinvoiceTwo/selectclient" id="client" name="client.id"  value="${workInvoice.client.id}"  title="选择开票单位" labelName="workInvoice.client.name" cssStyle="background-color: #fff"
@@ -856,6 +890,16 @@
 						<form:input id="bankNumber" path="bankNumber" htmlEscape="false" placeholder="请输入银行账号" onkeyup="this.value=this.value.replace(/[^\d-]/g,'')"  class="form-control layui-input"/>
 					</div>
 				</div>
+				</div>
+				<div class="layui-form-item count2">
+					<div class="layui-item layui-col-sm6">
+						<label class="layui-form-label"><span class="require-item">*</span>姓名:</label>
+						<div class="layui-input-block  with-icon">
+							<sys:treeselect id="newDrawer" name="newDrawerId" value="${workInvoice.newDrawerId}" labelName="newDrawerName" labelValue="${workInvoice.newDrawerName}"
+											cssStyle="background-color: #fff" title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control judgment layui-input" allowClear="true" notAllowSelectParent="true"/>
+						</div>
+					</div>
+				</div>
 
 				<div class="layui-item layui-col-sm6">
 					<label class="layui-form-label"><span class="require-item">*</span>收款类型:</label>