Browse Source

[feat]: 修改:报销管理新增报销单修改编辑,审核页面调整,将部门,用户,是否是委外/采购采销,供应商ID,对公收款方,对公收款账户,对公开户行 等字段设置为必填选择。编辑页面获取供应商编号回显是修改回显获取方法。报销单查询新增条件查询子表的出差单号,委外单号,采购单号对应的子表关联报销单号的列表信息。

dev
zhangsiqi 3 months ago
parent
commit
178cb9aad5
  1. 38
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseExpenseAccountController.java
  2. 1
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseExpenseAccount.java
  3. 10
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseExpenseAccountChild.java
  4. 2
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseExpenseAccountMapper.java
  5. 4
      ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseExpenseAccountService.java
  6. 10
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExpenseAccountServiceImpl.java
  7. 12
      ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountMapper.xml
  8. 209
      ruoyi-admin/src/main/resources/templates/system/baseExpense/add.html
  9. 42
      ruoyi-admin/src/main/resources/templates/system/baseExpense/baseExpense.html
  10. 64
      ruoyi-admin/src/main/resources/templates/system/baseExpense/detail.html
  11. 530
      ruoyi-admin/src/main/resources/templates/system/baseExpense/edit.html
  12. 82
      ruoyi-admin/src/main/resources/templates/system/baseExpense/taskBxjlVerify.html
  13. 79
      ruoyi-admin/src/main/resources/templates/system/baseExpense/taskBxzgVerify.html
  14. 79
      ruoyi-admin/src/main/resources/templates/system/baseExpense/taskCwVerify.html
  15. 118
      ruoyi-admin/src/main/resources/templates/system/baseExpense/taskFzjlVerify.html
  16. 47
      ruoyi-admin/src/main/resources/templates/system/baseExpense/taskModifyApply.html
  17. 101
      ruoyi-admin/src/main/resources/templates/system/baseExpense/taskZozjVerify.html

38
ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseExpenseAccountController.java

@ -2,8 +2,12 @@ package com.ruoyi.system.controller;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSON;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.process.general.service.IProcessService;
@ -92,6 +96,30 @@ public class BaseExpenseAccountController extends BaseController
public TableDataInfo list(BaseExpenseAccountVo baseExpenseAccount)
{
startPage();
// SysUser curUser = ShiroUtils.getSysUser();
// String loginName = ShiroUtils.getLoginName();
// Long userId = curUser.getUserId();
// Set<String> roleKeys = roleService.selectRoleKeys(userId);
// List<SysUser> sysUserlist = sysUserService.selectRoleToUserList("ywyRole");
// sysUserlist.add(curUser);
// //如果当前登录人的角色中包含下面其中之一,包含角色为(总经理、财务经理、财务主管、财务、 超级管理)可以查看所有的报销信息
// if(roleKeys.contains("zjlRole") || roleKeys.contains("zozjRole") || roleKeys.contains("fzjlRole") ||
// roleKeys.contains("cwyRole") || roleKeys.contains("cwjlRole") || roleKeys.contains("cwzgRole") ||
// roleKeys.contains("admin")){
// List<BaseExpenseAccountVo> list = baseExpenseAccountService.selectBaseExpenseAccountList(baseExpenseAccount);
// return getDataTable(list);
// }else if(roleKeys.contains(",")) {
// //部门主管查询部门的所有,查看对应部门下的所有报销单
// List<BaseExpenseAccountVo> list = baseExpenseAccountService.selectBaseExpenseAccountList(baseExpenseAccount);
// List<SysUser> findUser = sysUserlist.stream().filter(item -> (item.getDeptId().equals(curUser.getDeptId()))).collect(Collectors.toList());
// List<String> user = findUser.stream().map(SysUser::getLoginName).collect(Collectors.toList());
// return getDataTable(list);
// }
// if (roleKeys.contains("jlRole")) {
// List<SysUser> findUser = sysUserlist.stream().filter(item -> (item.getDeptId().equals(curUser.getDeptId()))).collect(Collectors.toList());
// List<String> user = findUser.stream().map(SysUser::getLoginName).collect(Collectors.toList());
//// String userStr = String.join(",", user);
// }
List<BaseExpenseAccountVo> list = baseExpenseAccountService.selectBaseExpenseAccountList(baseExpenseAccount);
return getDataTable(list);
}
@ -103,7 +131,7 @@ public class BaseExpenseAccountController extends BaseController
@Log(title = "报销单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(BaseExpenseAccount baseExpenseAccount)
public AjaxResult export(BaseExpenseAccountVo baseExpenseAccount)
{
List<BaseExpenseAccountVo> list = baseExpenseAccountService.selectBaseExpenseAccountList(baseExpenseAccount);
ExcelUtil<BaseExpenseAccountVo> util = new ExcelUtil<BaseExpenseAccountVo>(BaseExpenseAccountVo.class);
@ -221,7 +249,7 @@ public class BaseExpenseAccountController extends BaseController
if (processIsFinish) {
// 审核通过
baseExpenseAccountVo.setAuditStatus("1");
baseExpenseAccountVo.setFinanceAuditStatus("1");
baseExpenseAccountVo.setFinanceAuditStatus("0");
baseExpenseAccountVo.setManagerAuditStatus("1");
// 提交
if("submit".equals(instanceType)){
@ -274,4 +302,10 @@ public class BaseExpenseAccountController extends BaseController
public AjaxResult getId(){
return AjaxResult.success(baseExpenseAccountService.getId());
}
@RequestMapping("/getExpenseUser")
@ResponseBody
public AjaxResult getExpenseCode() throws Exception {
return AjaxResult.success(sysUserService.selectUserAll());
}
}

1
ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseExpenseAccount.java

@ -101,6 +101,7 @@ public class BaseExpenseAccount extends BaseEntity
/** 申请人 */
private String applyTitle;
/** 申请时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date applyTime;

10
ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseExpenseAccountChild.java

@ -60,6 +60,8 @@ public class BaseExpenseAccountChild extends BaseEntity
/** 删除状态 */
private String delFlag;
private Integer index;
public void setExpenseChildId(Long expenseChildId)
{
this.expenseChildId = expenseChildId;
@ -160,6 +162,14 @@ public class BaseExpenseAccountChild extends BaseEntity
return delFlag;
}
public Integer getIndex() {
return index;
}
public void setIndex(Integer index) {
this.index = index;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

2
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseExpenseAccountMapper.java

@ -26,7 +26,7 @@ public interface BaseExpenseAccountMapper
* @param baseExpenseAccount 报销单
* @return 报销单集合
*/
public List<BaseExpenseAccountVo> selectBaseExpenseAccountList(BaseExpenseAccount baseExpenseAccount);
public List<BaseExpenseAccountVo> selectBaseExpenseAccountList(BaseExpenseAccountVo baseExpenseAccount);
/**
* 新增报销单

4
ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseExpenseAccountService.java

@ -28,7 +28,9 @@ public interface IBaseExpenseAccountService
* @param baseExpenseAccount 报销单
* @return 报销单集合
*/
public List<BaseExpenseAccountVo> selectBaseExpenseAccountList(BaseExpenseAccount baseExpenseAccount);
// public List<BaseExpenseAccountVo> selectBaseExpenseAccountList(BaseExpenseAccount baseExpenseAccount);
public List<BaseExpenseAccountVo> selectBaseExpenseAccountList(BaseExpenseAccountVo baseExpenseAccount);
/**
* 新增报销单

10
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExpenseAccountServiceImpl.java

@ -7,7 +7,6 @@ import java.util.Set;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableSupport;
@ -78,7 +77,12 @@ public class BaseExpenseAccountServiceImpl implements IBaseExpenseAccountService
@Override
public BaseExpenseAccountVo selectBaseExpenseAccountById(Long expenseId)
{
return baseExpenseAccountMapper.selectBaseExpenseAccountById(expenseId);
BaseExpenseAccountVo baseExpenseAccountVo = baseExpenseAccountMapper.selectBaseExpenseAccountById(expenseId);
SysUser sysUser2 = userMapper.selectUserByLoginName(baseExpenseAccountVo.getApplyUser());
if (sysUser2!=null){
baseExpenseAccountVo.setApplyUserName(sysUser2.getUserName());
}
return baseExpenseAccountVo;
}
/**
@ -88,7 +92,7 @@ public class BaseExpenseAccountServiceImpl implements IBaseExpenseAccountService
* @return 报销单
*/
@Override
public List<BaseExpenseAccountVo> selectBaseExpenseAccountList(BaseExpenseAccount baseExpenseAccount)
public List<BaseExpenseAccountVo> selectBaseExpenseAccountList(BaseExpenseAccountVo baseExpenseAccount)
{
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();

12
ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountMapper.xml

@ -49,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from base_expense_account
</sql>
<select id="selectBaseExpenseAccountList" parameterType="BaseExpenseAccount" resultMap="BaseExpenseAccountResult">
<select id="selectBaseExpenseAccountList" parameterType="BaseExpenseAccountVo" resultMap="BaseExpenseAccountResult">
select b.expense_id, b.audit_status, b.manager_audit_status, b.finance_audit_status,
b.expense_code, b.deptName, b.postName, b.fullName, b.expense_method, b.is_purchase_outsource,
b.supplier_code, b.corporate_payee, b.corporate_receiving_account, b.public_account_banks,
@ -79,13 +79,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="applyUser != null and applyUser != ''"> and b.apply_user = #{applyUser}</if>
<if test="applyTime != null "> and b.apply_time = #{applyTime}</if>
<if test="keyword != null and keyword != ''"> and b.expense_code like concat('%',#{keyword},'%')</if>
<if test="params.costType != null">and
or expense_code in (
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
and b.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if>
<if test="params.costType != null">
and expense_code in (
select expense_code
from ck_equipCodeChild
<where>
<if test="params.costType != null">and cost_type = #{params.costType}</if>
<if test="params.costSmallType != null">and cost_small_type = #{params.costTypeName}</if>
<if test="params.evectionCode != null">and evection_code like concat('%',#{params.evectionCode},'%') </if>
<if test="params.outsourceCode != null">and outsource_code like concat('%',#{params.outsourceCode},'%') </if>
<if test="params.purchaseCode != null">and purchase_code like concat('%',#{params.purchaseCode},'%') </if>
</where>
)
</if>

209
ruoyi-admin/src/main/resources/templates/system/baseExpense/add.html

@ -2,24 +2,18 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增报销单')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: select2-css" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: bootstrap-editable-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-baseExpense-add">
<div class="form-group" hidden>
<label class="col-sm-6 control-label">报销单编号:</label>
<div class="col-sm-6">
<input name="expenseCode" class="form-control" type="text">
</div>
</div>
<div class="col-xs-12 mt-5">
<div class="col-xs-12">
<div class="col-xs-4">
<label class="col-sm-6 control-label">部门:</label>
<label class="col-sm-6 control-label is-required">部门:</label>
<div class="col-sm-6">
<input name="deptName" class="form-control" type="text" readonly>
<input name="deptName" class="form-control" type="text" readonly required>
</div>
</div>
<div class="col-xs-4">
@ -29,77 +23,78 @@
</div>
</div>
<div class="col-xs-4">
<label class="col-sm-6 control-label">姓名:</label>
<label class="col-sm-6 control-label is-required">姓名:</label>
<div class="col-sm-6">
<input name="fullName" class="form-control" type="text" readonly>
<input name="fullName" class="form-control" type="text" readonly required>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">报销方式:</label>
<label class="col-sm-6 control-label is-required">报销方式:</label>
<div class="col-sm-6">
<select id="add_expenseMethod" name="expenseMethod" onchange="handleExpenseMethod(this)" class="form-control" th:with="dictList=${@dict.getType('sys_base_expense_method')}">
<select id="add_expenseMethod" name="expenseMethod" onchange="handleExpenseMethod(this)" class="form-control" th:with="dictList=${@dict.getType('sys_base_expense_method')}" required>
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div id="add_expenseMethodModal" class="container" style="display: none">
<div class="form-group">
<label class="col-sm-6 control-label">是否是委外/采购采销:</label>
<div class="col-xs-6">
<label class="col-sm-6 control-label is-required">是否是委外/采购采销:</label>
<div class="col-sm-6">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" required>
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">供应商ID:</label>
<div class="col-xs-6">
<label class="col-sm-6 control-label is-required">供应商ID:</label>
<div class="col-sm-6">
<select id="supplierCode" name="supplierCode" class="form-control">
<select id="supplierCode" name="supplierCode" class="form-control" required>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款方:</label>
<div class="col-xs-6">
<label class="col-sm-6 control-label is-required">对公收款方:</label>
<div class="col-sm-6">
<input name="corporatePayee" class="form-control" type="text">
<input name="corporatePayee" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款账户:</label>
<div class="col-xs-6">
<label class="col-sm-6 control-label is-required">对公收款账户:</label>
<div class="col-sm-6">
<input name="corporateReceivingAccount" class="form-control" type="text">
<input name="corporateReceivingAccount" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公开户行:</label>
<div class="col-xs-6">
<label class="col-sm-6 control-label is-required">对公开户行:</label>
<div class="col-sm-6">
<input name="publicAccountBanks" class="form-control" type="text">
<input name="publicAccountBanks" class="form-control" type="text" required>
</div>
</div>
</div>
<input type="hidden" name="expenseDetailList" id="expenseDetailList">
</form>
<!-- <div class="container">-->
<!-- <div class="form-row">-->
<!-- <div class="btn-group-sm" id="toolbar" role="group">-->
<!-- <span style="color: black;font-size:17px;font-weight: bold" >报销分类信息</span>-->
<!-- <a class="btn btn-success" onclick="insertRow()">-->
<!-- <span class="fa fa-plus"></span> 添加报销-->
<!-- </a>-->
<!-- <a class="btn btn-danger" onclick="removeRow()">-->
<!-- <span class="fa fa-remove"></span> 删除报销-->
<!-- </a>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="col-sm-12 select-table table-striped">-->
<!-- <table id="bootstrap-sub-table-expense"></table>-->
<!-- </div>-->
<!-- </div>-->
<div class="container">
<div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group">
<span style="color: black;font-size:17px;font-weight: bold" >报销分类信息</span>
<a class="btn btn-success" onclick="insertRow()">
<span class="fa fa-plus"></span> 添加报销
</a>
<a class="btn btn-danger" onclick="removeRow()">
<span class="fa fa-remove"></span> 删除报销
</a>
</div>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-expense"></table>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript">
var prefix = ctx + "system/baseExpense";
@ -116,55 +111,37 @@
model: "报销单数据",
columns: [
{checkbox: true},
{title: '主键',field: 'index',align: 'center',visible: false,
{title: '序号',field: 'index',align: 'center',visible: false,
formatter: function (value, row, index) {
return index;
return $.table.serialNumber(index);
}
},
{title: '报销单分项子表',field: 'expenseChildId',visible: false},
{title: '关联报销单号',field: 'expenseCode',visible: false},
{title: '成本类型',field: 'costType',
formatter:function (value, row, index) {
return costTypeFormatter(value,row,index);
}
formatter:function (value, row, index) {return costTypeFormatter(value,row,index);}
},
{title: '成本小类',field:'costSmallType',
formatter:function(value, row, index){
return getCostSmallType(value,row,index)
}
},
{title: '用途',field: 'purpose',
editable:{
type:'text',
mode:'inline',
}
formatter:function(value, row, index){return getCostSmallType(value,row,index)}
},
{title: '用途',field: 'purpose', editable:{type:'text', mode:'inline',}},
{title: '金额',field: 'amounts',
editable:{
type:'text',
mode:'inline',
}
},
{title: '报销时间',field: 'expenseTime',editable:{
type:'date',
mode:'inline'
}
},
{title: '出差单号',field: 'evectionCode',editable:{
type:'text',
mode:'inline',
}
},
{title: '采购单号',field: 'purcahseCode',editable:{
type:'text',
mode:'inline',
}
editable:{type:'text', mode:'inline',
validate: function(value, row){
//金额可以为最多两位小数点
var reg = /^[0-9]+([.]{1}[0-9]{1,2})?$/;
if(value == '') {
return '请输入金额';
}
if(!reg.test(value)){
return '金额只能为数字,最多保留小数点后两位';
}
}}
},
{title: '委外单号',field: 'outsourceCode',editable:{
type:'text',
mode:'inline',
}
}
{title: '报销时间',field: 'expenseTime', editable: {type: 'date',title: '报销时间', placement: 'left',}},
{title: '出差单号',field: 'evectionCode',editable:{type:'text', mode:'inline',}},
{title: '采购单号',field: 'purchaseCode',editable:{type:'text', mode:'inline',}},
{title: '委外单号',field: 'outsourceCode',editable:{type:'text', mode:'inline',}}
],
};
$.table.init(options);
@ -223,14 +200,15 @@
$("input[name='corporateReceivingAccount']").val(data.bankAccount);
$("input[name='publicAccountBanks']").val(data.depositBank);
});
// function costTypeFormatter(value,row,index){
// var costType = $.common.selectArrayValue(costTypeDatas,value);
// return costType;
// }
function removeRow(id){
$("#bootstrap-sub-table-modify").bootstrapTable('remove', {
field: 'id',
values: id
})
}
function insertRow() {
$table.bootstrapTable('insertRow', {
index:1,
index:0,
row: {
expenseChildId:'',
costType: "",
@ -239,33 +217,32 @@
amounts: '',
expenseTime: '',
evectionCode:'' ,
purcahseCode:'',
purchaseCode:'',
outsourceCode: '',
}
})
}
/* 删除指定表格行 */
// function submitHandler() {
// if ($.validate.form()) {
// var formData = $('#form-baseExpense-add').serializeArray();
// var tableData = $table.bootstrapTable('getData');
// var rows = tableData.length;
// if(rows==0){
// $.modal.alertWarning("子表数据不能为空!");
// }else{
// formData.push({"name": "expenseAccountChildList", "value": tableData});
// var jsonData = $.common.formDataToJson(formData);
// $.operate.saveJson(prefix + "/add", jsonData);
// }
// }
// }
//暂时去掉子表数据进行提交
function submitHandler() {
if ($.validate.form()) {
var formData = $('#form-baseExpense-add').serialize();
$.operate.save(prefix + "/add", formData);
var tableData = $("#bootstrap-sub-table-expense").bootstrapTable('getData');
var formData = $("#form-baseExpense-add").serializeArray();
var rows = tableData.length;
if(rows==0){
$.modal.alertWarning("子表数据不能为空!");
}else {
for (var i = 0; i < rows; i++) {
tableData[i].expenseCode = $("input[name='expenseCode']").val();
//检测每行的成本类型和成本小类是否为空,金额是否为空,并列出第几行的什么每次参数列
if (tableData[i].costType == "" || tableData[i].costSmallType == "" || tableData[i].amounts == "") {
$.modal.alertWarning("第" + (i + 1) + "行成本类型、成本小类、金额不能为空!");
return;
}
}
formData.push({"name": "expenseAccountChildList", "value": tableData});
var jsonData = $.common.formDataToJson(formData);
$.operate.saveJson(prefix + "/add", jsonData);
}
}
}
@ -314,13 +291,13 @@
}
}
function removeRow(){
var ids = $.table.selectColumns("id");
var ids = $.table.selectColumns("index");
if (ids.length == 0) {
$.modal.alertWarning("请至少选择一条记录");
return;
}
$("#bootstrap-sub-table-1").bootstrapTable('remove', {
field: 'id',
$("#bootstrap-sub-table-expense").bootstrapTable('remove', {
field: 'index',
values: ids
})
}
@ -345,6 +322,12 @@
}
});
}
$("input[name='expenseTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

42
ruoyi-admin/src/main/resources/templates/system/baseExpense/baseExpense.html

@ -12,21 +12,23 @@
<ul>
<li>
<label>报销单号:</label>
<input type="text" name="expenseCode"/>
<input type="text" name="expenseCode" />
</li>
<li>
<label>报销人:</label>
<select name="applyUser" >
<option value="">所有</option>
</select>
<select name="applyUser"></select>
</li>
<li>
<label>生产单号:</label>
<input name="expenseCode" type="text"/>
<label>出差单号:</label>
<input name="params[evectionCode]" type="text"/>
</li>
<li>
<label>出差单号:</label>
<input name="expenseCode" type="text"/>
<label>采购单号:</label>
<input name="params[purchaseCode]" type="text"/>
</li>
<li>
<label>委外单号:</label>
<input name="params[outsourceCode]" type="text"/>
</li>
<li>
<label>上级审核状态:</label>
@ -111,6 +113,7 @@
var auditStatusData = [[${@dict.getType('auditStatus')}]];
var expenseMethodData = [[${@dict.getType('sys_base_expense_method')}]];
var prefix = ctx + "system/baseExpense";
$(function() {
var options = {
url: prefix + "/list",
@ -218,6 +221,7 @@
}
};
$.table.init(options);
selectUserAll();
});
function onCostTypeChange(element) {
var costType = element.value;
@ -229,16 +233,30 @@
success: function (result) {
console.log(result);
costSamllTypes = result;
var selectHtml = '';
var selectHtml = '<option value="">所有</option>';
costSamllTypes.forEach(function (child) {
selectHtml += '<option value="' + child.code + '">' + child.name + '</option>';
});
$("#costSmallType").append(selectHtml);
$("#costSmallType").html(selectHtml);
}
});
}
function selectUserAll(){
$.ajax({
url: prefix + '/getExpenseUser',
type: 'post',
async: false,
success: function (result) {
userList = result.data;
var selectUser = $("select[name='applyUser']");
var selectHtml = '<option value="">所有</option>';
userList.forEach(function (user) {
selectHtml += '<option value="' + user.loginName + '">' + user.userName + '</option>';
});
selectUser.html(selectHtml);
}
});
}
</script>
</body>
</html>

64
ruoyi-admin/src/main/resources/templates/system/baseExpense/detail.html

@ -38,36 +38,35 @@
</div>
</div>
<div id="detail_expenseMethodModal" class="container" style="display: none">
<div class="form-group">
<label class="col-sm-6 control-label">是否是委外/采购采销:</label>
<div class="col-sm-6">
<div class="col-xs-6">
<label class="col-sm-3 control-label">是否是委外/采购采销:</label>
<div class="col-sm-8">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled>
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">供应商ID:</label>
<div class="col-sm-6">
<select id="supplierCode" name="supplierCode" class="form-control" disabled>
</select>
<div class="col-xs-6">
<label class="col-sm-3 control-label">供应商ID:</label>
<div class="col-sm-8">
<input id="supplierCode" name="supplierCode" th:field="*{supplierCode}" class="form-control" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款方:</label>
<div class="col-sm-6">
<div class="col-xs-6">
<label class="col-sm-3 control-label">对公收款方:</label>
<div class="col-sm-8">
<input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款账户:</label>
<div class="col-sm-6">
<div class="col-xs-6">
<label class="col-sm-3 control-label">对公收款账户:</label>
<div class="col-sm-8">
<input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公开户行:</label>
<div class="col-sm-6">
<div class="col-xs-6">
<label class="col-sm-3 control-label">对公开户行:</label>
<div class="col-sm-8">
<input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text" disabled>
</div>
</div>
@ -223,31 +222,6 @@
// 更新行数据
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow});
}
// 假设此函数返回供应商列表
$("#supplierCode").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择供应商",
ajax: {
url: '/system/supplier/getSupplier',
dataType: 'json',
method: "post",
delay: 250,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.rows;
for(let i in resultList){
var option = resultList[i];
option.id = resultList[i]["supplierCode"];
option.text = resultList[i]["supplierCode"];
options.push(option);
}
}
return {results: options};
}
}
});
function handleExpenseMethod(expenseMethodSelect) {
//获取页面元素中的下拉框选中的值
var expenseMethod = $("#detail_expenseMethod").val();
@ -257,12 +231,6 @@
$("#detail_expenseMethodModal").hide();
}
}
$('#supplierCode').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='corporatePayee']").val(data.supplierName);
$("input[name='corporateReceivingAccount']").val(data.bankAccount);
$("input[name='publicAccountBanks']").val(data.depositBank);
});
</script>
</body>
</html>

530
ruoyi-admin/src/main/resources/templates/system/baseExpense/edit.html

@ -1,303 +1,307 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改报销单')" />
<th:block th:include="include :: header('总经理/总助审核')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: select2-css" />
<th:block th:include="include :: bootstrap-editable-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-baseExpense-edit" th:object="${baseExpenseAccount}">
<input name="expenseId" th:field="*{expenseId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">报销单编号:</label>
<div class="col-sm-8">
<input name="expenseCode" th:field="*{expenseCode}" class="form-control" type="text">
</div>
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-baseExpense-zozj" th:object="${baseExpenseAccount}">
<input name="expenseId" th:field="*{expenseId}" type="hidden">
<input name="expenseCode" th:field="*{expenseCode}" type="hidden">
<input name="instanceId" th:field="*{instanceId}" type="hidden">
<!--驳回调整允许更新内容-->
<div class="form-group">
<label class="col-sm-3 control-label">标题:</label>
<div class="col-sm-8">
<input name="title" th:field="*{applyTitle}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">部门:</label>
<div class="col-sm-8">
<input name="deptName" th:field="*{deptName}" class="form-control" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">岗位:</label>
<div class="col-sm-8">
<input name="postName" th:field="*{postName}" class="form-control"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">姓名:</label>
<div class="col-sm-8">
<input name="fullName" th:field="*{fullName}" class="form-control"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">报销方式:</label>
<div class="col-sm-6">
<select id="edit_expenseMethod" name="expenseMethod" th:field="*{expenseMethod}" onchange="handleExpenseMethod(this)"
class="form-control"
th:with="dictList=${@dict.getType('sys_base_expense_method')}">
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">部门:</label>
</div>
<div id="edit_expenseMethodModal" class="container" style="display: none">
<div class="col-xs-6">
<label class="col-sm-3 control-label">是否是委外/采购采销:</label>
<div class="col-sm-8">
<input name="deptName" th:field="*{deptName}" class="form-control" type="text">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}">
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">岗位:</label>
<div class="col-xs-6">
<label class="col-sm-3 control-label">供应商ID</label>
<div class="col-sm-8">
<input name="postName" th:field="*{postName}" class="form-control" type="text">
<select id="supplierCode" name="supplierCode" class="form-control"></select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">姓名:</label>
<div class="col-xs-6">
<label class="col-sm-3 control-label">对公收款方</label>
<div class="col-sm-8">
<input name="fullName" th:field="*{fullName}" class="form-control" type="text">
<input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">报销方式:</label>
<div class="col-sm-6">
<select id="add_expenseMethod" name="expenseMethod" onchange="handleExpenseMethod(this)" class="form-control" th:with="dictList=${@dict.getType('sys_base_expense_method')}">
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
<div class="col-xs-6">
<label class="col-sm-3 control-label">对公收款账户:</label>
<div class="col-sm-8">
<input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text">
</div>
</div>
<div id="add_expenseMethodModal" class="container" style="display: none">
<div class="form-group">
<label class="col-sm-6 control-label">是否是委外/采购采销:</label>
<div class="col-sm-6">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}">
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">供应商ID:</label>
<div class="col-sm-6">
<select id="supplierCode" name="supplierCode" class="form-control">
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款方:</label>
<div class="col-sm-6">
<input name="corporatePayee" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款账户:</label>
<div class="col-sm-6">
<input name="corporateReceivingAccount" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公开户行:</label>
<div class="col-sm-6">
<input name="publicAccountBanks" class="form-control" type="text">
</div>
<div class="col-xs-6">
<label class="col-sm-3 control-label">对公开户行:</label>
<div class="col-sm-8">
<input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text">
</div>
</div>
</form>
<div class="container">
<div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group">
<span style="color: black;font-size:17px;font-weight: bold" >报销分类信息</span>
<a class="btn btn-success" onclick="insertRow()">
<span class="fa fa-plus"></span> 添加报销
</a>
</div>
<input type="hidden" name="expenseDetailList" id="expenseDetailList">
</div>
</form>
<div class="container">
<div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group">
<span>选择报销分类信息</span>
<a class="btn btn-success" onclick="insertRow()">
<span class="fa fa-plus"></span> 添加报销
</a>
<a class="btn btn-danger" onclick="removeRow()">
<span class="fa fa-remove"></span> 删除报销
</a>
</div>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-expense"></table>
<table id="bootstrap-sub-table-expense-edit"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript">
var prefix = ctx + "system/baseExpense"
var costTypeDatas = [[${@category.getChildByCode('costType')}]];
var supplier = [[${formData.supplierCode}]];
$("#form-baseExpense-add").validate({focusCleanup: true});
$(function(){
$.ajax({
url: prefix + "/getId",
type: "post",
dataType: "json",
success: function(result) {
if (result.code == 0) {
$("input[name='expenseCode']").val(result.data);
} else {
$.modal.msgError(result.msg);
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:src="@{/js/activiti.js}"></script>
<script th:inline="javascript">
var prefix = ctx + "system/baseExpense";
var costTypeDatas = [[${@category.getChildByCode('costType')}]];
var taskId = [[${taskId}]];
var baseExpense = [[${baseExpenseAccount}]];
var $table = $("#bootstrap-sub-table-expense-edit");
$("#form-baseExpense-edit").validate({focusCleanup: true});
$(function() {
var options = {
id:'bootstrap-sub-table-expense-edit',
url: ctx + "system/expenseChild/list",
queryParams: function(params) {return {expenseCode: $("#expenseCode").val()};},
sidePagination: "client",
pagination: true,
showColumns: false,
showSearch: false,
showRefresh:false,
showToggle:false,
model: "报销单数据",
columns: [
{checkbox: true},
{title:'主键',field: 'index',align: 'center',
formatter: function (value, row, index) {
var index = index + 1;
return index;
}
}
});
})
var $table = $("#bootstrap-sub-table-expense");
//获取子表信息
$(function() {
var options = {
id:'bootstrap-sub-table-expense',
url: ctx + "system/expenseChild/list",
queryParams: function(params) {
return {
expenseCode: $("#expenseCode").val()
};
},
pagination: false,
sidePagination: "client",
model: "报销单数据",
editable: true,
columns: [
{checkbox: true},
{title: '主键',field: 'index',visible: false,
formatter: function (value, row, index) {
return index;
}
},
{title: '报销单分项子表',field: 'expenseChildId',visible: false},
{title: '关联报销单号',field: 'expenseCode',visible: false},
{title: '成本类型',field: 'costType',
formatter:function (value, row, index) {
return costTypeFormatter(value,row,index);
}
},
{title: '成本小类',field: 'costSmallType',
formatter:function(value, row, index){
return getCostSmallType(value,row,index)
}
},
{title: '用途',field: 'purpose',editable:{type:'text',mode:'inline'}},
{title: '金额',field: 'amounts',editable: {type:'text',mode:'inline'}},
{title: '报销时间',field: 'expenseTime',editable:{type:'date',mode:'inline',}},
{title: '出差单号',field: 'evectionCode',editable: {type:'text',mode:'inline'}},
{title: '采购单号',field: 'purcahseCode',editable: {type:'text',mode:'inline',}},
{title: '委外单号',field: 'outsourceCode',editable: {type:'text',mode:'inline',}},
{title: '操作', align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.index + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join('');
}
}
],
};
$.table.init(options);
// 假设此函数返回供应商列表
$("#supplierCode").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择供应商",
ajax: {
url: '/system/supplier/getSupplier',
dataType: 'json',
method: "post",
delay: 250,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.rows;
for(let i in resultList){
var option = resultList[i];
option.id = resultList[i]["supplierCode"];
option.text = resultList[i]["supplierCode"];
options.push(option);
}
}
return {
results: options
};
{title: '报销单分项子表',field: 'expenseChildId',visible: false},
{title: '关联报销单号',field: 'expenseCode',visible: false},
{title: '成本类型',field: 'costType',
formatter:function (value, row, index) {return costTypeFormatter(value,row,index);}
},
{title: '成本小类',field:'costSmallType',
formatter:function(value, row, index){return getCostSmallType(value,row,index)}
},
{title: '用途',field: 'purpose', editable:{type:'text', mode:'inline',}},
{title: '金额',field: 'amounts', editable:{type:'text', mode:'inline',}},
{title: '报销时间',field: 'expenseTime', editable: {type: 'date',title: '报销时间', placement: 'left',}},
{title: '出差单号',field: 'evectionCode',editable:{type:'text', mode:'inline',}},
{title: '采购单号',field: 'purchaseCode',editable:{type:'text', mode:'inline',}},
{title: '委外单号',field: 'outsourceCode',editable:{type:'text', mode:'inline',}},
{title: '操作', align: 'center',
formatter: function (value, row, index) {
return '<a class="btn btn-danger btn-xs" onclick="removeRow(\'' + row.index + '\')"><i class="fa fa-remove"></i>删除</a>';
}
}
});
$("#supplierCode").val(supplier);
],
};
$.table.init(options);
handleExpenseMethod(this);
loadSupplierCodes();
});
function removeRow(index) {
// 使用索引值移除行
$('#bootstrap-sub-table-expense-edit').bootstrapTable('remove', {
field: 'index',
values: index
});
function handleExpenseMethod(expenseMethodSelect) {
//获取页面元素中的下拉框选中的值
var expenseMethod = $("#add_expenseMethod option:selected").val();
if (expenseMethod === '1') {
$("#add_expenseMethodModal").show();
} else {
$("#add_expenseMethodModal").hide();
}
}
$('#supplierCode').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='corporatePayee']").val(data.supplierName);
$("input[name='corporateReceivingAccount']").val(data.bankAccount);
$("input[name='publicAccountBanks']").val(data.depositBank);
}
// 列中获取成本类型的下拉改变数据
function onCostTypeChange(selectElement, rowIndex) {
var newSupplierId = $(selectElement).val();
var tableData = $table.bootstrapTable('getData');
var newRow = tableData[rowIndex]; // 获取当前行数据
newRow.costType = newSupplierId; // 更新供应商ID
// 重新渲染成本小类的设备名称列
// 更新行数据
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow});
}
// 自定义供应商名称列的格式化函数
function costTypeFormatter(value, row, index) {
var selectHtml = '<select class="form-control" onchange="onCostTypeChange(this, ' + index + ')">';
costTypeDatas.forEach(function (child) {
selectHtml += '<option value="' + child.code + '"' + (value === child.code ? ' selected' : '') + '>' + child.name + '</option>' ;
});
function insertRow() {
$table.bootstrapTable('insertRow', {
index:1,
row: {
expenseChildId:'',
costType: "",
costSmallType:"",
purpose:'' ,
amounts: '',
expenseTime: '',
evectionCode:'' ,
purcahseCode:'',
outsourceCode: '',
}
})
layer.close(index);
}
/* 删除指定表格行 */
function removeRow(id){
$table.bootstrapTable('remove', {
field: 'id',
values: id
})
}
function submitHandler() {
if ($.validate.form()) {
var formData = $('#form-baseExpense-edit').serializeArray();
var tableData = $table.bootstrapTable('getData');
var rows = tableData.length;
if(rows==0){
$.modal.alertWarning("子表数据不能为空!");
}else{
formData.push({"name": "expenseAccountChildList", "value": tableData});
var jsonData = $.common.formDataToJson(formData);
$.operate.saveJson(prefix + "/edit", jsonData);
}
selectHtml += '</select>';
return selectHtml;
}
// 自定义设备名称列的格式化函数,依赖于供应商列的选择
function getCostSmallType(value, row, index) {
var selectHtml = '<select class="form-control" onchange="onCostSmallTypeChange(this, ' + index + ')">';
// 假设此函数根据供应商ID返回设备列表
var costSamllTypes = [];
$.ajax({
url: ctx + 'system/category/getChildCode',
type: 'post',
data: {code: row.costType},
async: false,
success: function (result) {
console.log(result);
costSamllTypes = result;
}
}
// 列中获取成本类型的下拉改变数据
function onCostTypeChange(selectElement, rowIndex) {
var newSupplierId = $(selectElement).val();
var tableData = $table.bootstrapTable('getData');
var newRow = tableData[rowIndex]; // 获取当前行数据
newRow.costType = newSupplierId; // 更新供应商ID
// 重新渲染成本小类的设备名称列
// 更新行数据
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow});
}
// 自定义供应商名称列的格式化函数
function costTypeFormatter(value, row, index) {
var selectHtml = '<select class="form-control" onchange="onCostTypeChange(this, ' + index + ')">';
costTypeDatas.forEach(function (child) {
selectHtml += '<option value="' + child.code + '"' + (value === child.code ? ' selected' : '') + '>' + child.name + '</option>' ;
});
if (costSamllTypes) {
costSamllTypes.forEach(function (child) {
selectHtml += '<option value="' + child.code + '"' + (value === child.code ? ' selected' : '') + '>' + child.name + '</option>';
});
selectHtml += '</select>';
return selectHtml;
}
// 自定义设备名称列的格式化函数,依赖于供应商列的选择
function getCostSmallType(value, row, index) {
var selectHtml = '<select class="form-control" onchange="onCostSmallTypeChange(this, ' + index + ')">';
// 假设此函数根据供应商ID返回设备列表
var costSamllTypes = [];
$.ajax({
url: ctx + 'system/category/getChildCode',
type: 'post',
data: {code: row.costType},
async: false,
success: function (result) {
console.log(result);
costSamllTypes = result;
}
});
if (costSamllTypes) {
costSamllTypes.forEach(function (child) {
selectHtml += '<option value="' + child.code + '"' + (value === child.code ? ' selected' : '') + '>' + child.name + '</option>';
});
selectHtml += '</select>';
return selectHtml;
}
}
function onCostSmallTypeChange(selectElement, rowIndex) {
var newCostSmallType = $(selectElement).val();
var tableData = $table.bootstrapTable('getData');
var newRow = tableData[rowIndex]; // 获取当前行数据
newRow.costSmallType = newCostSmallType;
// 重新渲染当前行的设备名称列
// 更新行数据
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow});
}
// 假设此函数返回供应商列表
function handleExpenseMethod(expenseMethodSelect) {
//获取页面元素中的下拉框选中的值
var expenseMethod = $("#edit_expenseMethod option:selected").val();
if (expenseMethod === '1') {
$("#edit_expenseMethodModal").show();
} else {
$("#edit_expenseMethodModal").hide();
}
}
function getSelections(){
$.ajax({
url: ctx + "system/requisitioning/getEmpUserName",
type: "get",
dataType: "json",
success: function (data) {
$("input[name='deptName']").val(data.deptName);
$("input[name='fullName']").val(data.userName);
$("input[name='postName']").val(data.postName);
}
});
}
function onCostSmallTypeChange(selectElement, rowIndex) {
var newCostSmallType = $(selectElement).val();
var tableData = $table.bootstrapTable('getData');
var newRow = tableData[rowIndex]; // 获取当前行数据
newRow.costSmallType = newCostSmallType;
// 重新渲染当前行的设备名称列
// 更新行数据
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow});
$("input[name='expenseTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
function submitHandler() {
if ($.validate.form()) {
var tableData = $("#bootstrap-sub-table-expense-edit").bootstrapTable('getData');
var formData = $("#form-baseExpense-add").serializeArray();
var rows = tableData.length;
if(rows==0){
$.modal.alertWarning("子表数据不能为空!");
}else{
formData.push({"name": "expenseAccountChildList", "value": tableData});
var jsonData = $.common.formDataToJson(formData);
$.operate.saveJson(prefix + "/edit", jsonData);
}
}
</script>
}
function loadSupplierCodes() {
var url = ctx + 'system/supplier/getSupplier';
$.ajax({
type: 'post', // 请求类型
url: url, // 后端接口URL
dataType: 'json', // 预期服务器返回的数据类型
success: function(data) {
if (data.rows && Array.isArray(data.rows)) {
var selectElement = $('#supplierCode'); // 获取仓库编号下拉框元素
// 清空下拉框现有选项
selectElement.empty();
// 添加默认选项(如果需要)编辑时不需要添加默认选项
selectElement.append('<option value="">所有</option>');
// 遍历返回的数据,添加为下拉框的选项
$.each(data.rows, function(index, item) {
// 仓库ID
selectElement.append('<option value="' + item.supplierCode + '">' + item.supplierCode + '</option>');
});
selectElement.val(baseExpense.supplierCode);
} else {
$.modal.alertWarning("数据为空");
}
}
});
}
$('#supplierCode').on('change',function (e) {
$.ajax({
type: 'post', // 请求类型
url: ctx + 'system/supplier/getSupplierName', // 后端接口URL
dataType: 'json', // 预期服务器返回的数据类型
data:{
supplierCode: $('#supplierCode option:selected').val(),
},
success: function(data) {
var expenseAccount = data[0];
$("input[name='corporatePayee']").val(expenseAccount.supplierName);
$("input[name='corporateReceivingAccount']").val(expenseAccount.bankAccount);
$("input[name='publicAccountBanks']").val(expenseAccount.depositBank);
},
});
});
</script>
</body>
</html>

82
ruoyi-admin/src/main/resources/templates/system/baseExpense/taskBxjlVerify.html

@ -9,6 +9,7 @@
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-baseExpense-bxjl" th:object="${formData}">
<input name="expenseId" th:field="*{expenseId}" type="hidden">
<input name="expenseCode" th:field="*{expenseCode}" type="hidden">
<input name="taskId" th:field="*{taskId}" type="hidden">
<input name="taskName" th:field="*{taskName}" type="hidden">
<input name="instanceId" th:field="*{instanceId}" type="hidden">
@ -35,12 +36,6 @@
<input name="title" th:field="*{applyTitle}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group" hidden="hidden">
<label class="col-sm-3 control-label">报销单号:</label>
<div class="col-sm-8">
<input name="expenseCode" th:field="*{expenseCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">部门:</label>
<div class="col-sm-8">
@ -59,7 +54,7 @@
<input name="fullName" th:field="*{fullName}" class="form-control" disabled>
</div>
</div>
<div class="form-group">
<div class="col-xs-12">
<label class="col-sm-6 control-label">报销方式:</label>
<div class="col-sm-6">
<select id="bxjl_expenseMethod" name="expenseMethod" th:field="*{expenseMethod}" onchange="handleExpenseMethod(this)"
@ -70,37 +65,36 @@
</div>
</div>
<div id="bxjl_expenseMethodModal" class="container" style="display: none">
<div class="form-group">
<label class="col-sm-6 control-label">是否是委外/采购采销:</label>
<div class="col-sm-6">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}">
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">是否是委外/采购采销:</label>
<div class="col-sm-8">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled required>
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">供应商ID:</label>
<div class="col-sm-6">
<select id="supplierCode" name="supplierCode" class="form-control" disabled>
</select>
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">供应商ID:</label>
<div class="col-sm-8">
<input id="supplierCode" name="supplierCode" th:field="*{supplierCode}" class="form-control" disabled required>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款方:</label>
<div class="col-sm-6">
<input name="corporatePayee" class="form-control" type="text" disabled>
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">对公收款方:</label>
<div class="col-sm-8">
<input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text" disabled required>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款账户:</label>
<div class="col-sm-6">
<input name="corporateReceivingAccount" class="form-control" type="text" disabled>
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">对公收款账户:</label>
<div class="col-sm-8">
<input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text" disabled required>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公开户行:</label>
<div class="col-sm-6">
<input name="publicAccountBanks" class="form-control" type="text" disabled>
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">对公开户行:</label>
<div class="col-sm-8">
<input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text" disabled required>
</div>
</div>
</div>
@ -137,6 +131,7 @@
var prefix = ctx + "system/baseExpense";
var costTypeDatas = [[${@category.getChildByCode('costType')}]];
var taskId = [[${taskId}]];
var $table = $("#bootstrap-sub-table-expense-bxjl");
$("#form-baseExpense-bxjl").validate({focusCleanup: true});
$(function() {
var options = {
@ -236,31 +231,6 @@
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow});
}
// 假设此函数返回供应商列表
$("#supplierCode").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择供应商",
ajax: {
url: '/system/supplier/getSupplier',
dataType: 'json',
method: "post",
delay: 250,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.rows;
for(let i in resultList){
var option = resultList[i];
option.id = resultList[i]["supplierCode"];
option.text = resultList[i]["supplierCode"];
options.push(option);
}
}
return {results: options};
}
}
});
function handleExpenseMethod(expenseMethodSelect) {
//获取页面元素中的下拉框选中的值
var expenseMethod = $("#bxjl_expenseMethod option:selected").val();
@ -270,12 +240,6 @@
$("#bxjl_expenseMethodModal").hide();
}
}
$('#supplierCode').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='corporatePayee']").val(data.supplierName);
$("input[name='corporateReceivingAccount']").val(data.bankAccount);
$("input[name='publicAccountBanks']").val(data.depositBank);
});
function submitHandler() {
if ($.validate.form()) {
if ($('textarea[name="comment"]').val()) {

79
ruoyi-admin/src/main/resources/templates/system/baseExpense/taskBxzgVerify.html

@ -9,6 +9,7 @@
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-baseExpense-bxzg" th:object="${formData}">
<input name="expenseId" th:field="*{expenseId}" type="hidden">
<input name="expenseCode" th:field="*{expenseCode}" type="hidden">
<input name="taskId" th:field="*{taskId}" type="hidden">
<input name="taskName" th:field="*{taskName}" type="hidden">
<input name="instanceId" th:field="*{instanceId}" type="hidden">
@ -35,12 +36,6 @@
<input name="title" th:field="*{applyTitle}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group" hidden="hidden">
<label class="col-sm-3 control-label">报销单号:</label>
<div class="col-sm-8">
<input name="expenseCode" th:field="*{expenseCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">部门:</label>
<div class="col-sm-8">
@ -70,37 +65,36 @@
</div>
</div>
<div id="bxjl_expenseMethodModal" class="container" style="display: none">
<div class="form-group">
<label class="col-sm-6 control-label">是否是委外/采购采销:</label>
<div class="col-sm-6">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled>
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">是否是委外/采购采销:</label>
<div class="col-sm-8">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled required>
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">供应商ID:</label>
<div class="col-sm-6">
<select id="supplierCode" name="supplierCode" class="form-control" disabled>
</select>
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">供应商ID:</label>
<div class="col-sm-8">
<input id="supplierCode" name="supplierCode" th:field="*{supplierCode}" class="form-control" disabled required>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款方:</label>
<div class="col-sm-6">
<input name="corporatePayee" class="form-control" type="text" disabled>
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">对公收款方:</label>
<div class="col-sm-8">
<input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text" disabled required>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款账户:</label>
<div class="col-sm-6">
<input name="corporateReceivingAccount" class="form-control" type="text" disabled>
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">对公收款账户:</label>
<div class="col-sm-8">
<input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text" disabled required>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公开户行:</label>
<div class="col-sm-6">
<input name="publicAccountBanks" class="form-control" type="text" disabled>
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">对公开户行:</label>
<div class="col-sm-8">
<input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text" disabled required>
</div>
</div>
</div>
@ -140,6 +134,7 @@
var prefix = ctx + "system/baseExpense";
var costTypeDatas = [[${@category.getChildByCode('costType')}]];
var taskId = [[${taskId}]];
var $table = $("#bootstrap-sub-table-expense-bxzg");
$("#form-baseExpense-bxzg").validate({focusCleanup: true});
$(function() {
var options = {
@ -239,30 +234,6 @@
}
// 假设此函数返回供应商列表
$("#supplierCode").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择供应商",
ajax: {
url: '/system/supplier/getSupplier',
dataType: 'json',
method: "post",
delay: 250,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.rows;
for(let i in resultList){
var option = resultList[i];
option.id = resultList[i]["supplierCode"];
option.text = resultList[i]["supplierCode"];
options.push(option);
}
}
return {results: options};
}
}
});
function handleExpenseMethod(expenseMethodSelect) {
//获取页面元素中的下拉框选中的值
var expenseMethod = $("#bxzg_expenseMethod option:selected").val();
@ -272,12 +243,6 @@
$("#bxzg_expenseMethodModal").hide();
}
}
$('#supplierCode').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='corporatePayee']").val(data.supplierName);
$("input[name='corporateReceivingAccount']").val(data.bankAccount);
$("input[name='publicAccountBanks']").val(data.depositBank);
});
function submitHandler() {
if ($.validate.form()) {
if ($('textarea[name="comment"]').val()) {

79
ruoyi-admin/src/main/resources/templates/system/baseExpense/taskCwVerify.html

@ -9,6 +9,7 @@
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-baseExpense-cw" th:object="${formData}">
<input name="expenseId" th:field="*{expenseId}" type="hidden">
<input name="expenseCode" th:field="*{expenseCode}" type="hidden">
<input name="taskId" th:field="*{taskId}" type="hidden">
<input name="taskName" th:field="*{taskName}" type="hidden">
<input name="instanceId" th:field="*{instanceId}" type="hidden">
@ -35,12 +36,6 @@
<input name="title" th:field="*{applyTitle}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group" hidden="hidden">
<label class="col-sm-3 control-label">报销单号:</label>
<div class="col-sm-8">
<input name="expenseCode" th:field="*{expenseCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">部门:</label>
<div class="col-sm-8">
@ -68,37 +63,36 @@
</div>
</div>
<div id="cw_expenseMethodModal" class="container" style="display: none">
<div class="form-group">
<label class="col-sm-6 control-label">是否是委外/采购采销:</label>
<div class="col-sm-6">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}">
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">是否是委外/采购采销:</label>
<div class="col-sm-8">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled required>
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">供应商ID:</label>
<div class="col-sm-6">
<select id="supplierCode" name="supplierCode" class="form-control">
</select>
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">供应商ID:</label>
<div class="col-sm-8">
<input id="supplierCode" name="supplierCode" th:field="*{supplierCode}" class="form-control" disabled required>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款方:</label>
<div class="col-sm-6">
<input name="corporatePayee" class="form-control" type="text">
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">对公收款方:</label>
<div class="col-sm-8">
<input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text" disabled required>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款账户:</label>
<div class="col-sm-6">
<input name="corporateReceivingAccount" class="form-control" type="text">
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">对公收款账户:</label>
<div class="col-sm-8">
<input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text" disabled required>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公开户行:</label>
<div class="col-sm-6">
<input name="publicAccountBanks" class="form-control" type="text">
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">对公开户行:</label>
<div class="col-sm-8">
<input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text" disabled required>
</div>
</div>
</div>
@ -135,6 +129,7 @@
var prefix = ctx + "system/baseExpense";
var costTypeDatas = [[${@category.getChildByCode('costType')}]];
var taskId = [[${taskId}]];
var $table = $("#bootstrap-sub-table-expense-cw");
$("#form-baseExpense-cw").validate({focusCleanup: true});
$(function() {
var options = {
@ -234,30 +229,6 @@
}
// 假设此函数返回供应商列表
$("#supplierCode").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择供应商",
ajax: {
url: '/system/supplier/getSupplier',
dataType: 'json',
method: "post",
delay: 250,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.rows;
for(let i in resultList){
var option = resultList[i];
option.id = resultList[i]["supplierCode"];
option.text = resultList[i]["supplierCode"];
options.push(option);
}
}
return {results: options};
}
}
});
function handleExpenseMethod(expenseMethodSelect) {
//获取页面元素中的下拉框选中的值
var expenseMethod = $("#cw_expenseMethod option:selected").val();
@ -267,12 +238,6 @@
$("#cw_expenseMethodModal").hide();
}
}
$('#supplierCode').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='corporatePayee']").val(data.supplierName);
$("input[name='corporateReceivingAccount']").val(data.bankAccount);
$("input[name='publicAccountBanks']").val(data.depositBank);
});
function submitHandler() {
if ($.validate.form()) {
if ($('textarea[name="comment"]').val()) {

118
ruoyi-admin/src/main/resources/templates/system/baseExpense/taskFzjlVerify.html

@ -55,8 +55,8 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">报销方式:</label>
<div class="col-sm-6">
<label class="col-sm-3 control-label">报销方式:</label>
<div class="col-sm-8">
<select id="fzjl_expenseMethod" name="expenseMethod" th:field="*{expenseMethod}" onchange="handleExpenseMethod(this)"
class="form-control"
th:with="dictList=${@dict.getType('sys_base_expense_method')}" disabled>
@ -65,57 +65,56 @@
</div>
</div>
<div id="fzjl_expenseMethodModal" class="container" style="display: none">
<div class="form-group">
<label class="col-sm-6 control-label">是否是委外/采购采销:</label>
<div class="col-sm-6">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled>
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">是否是委外/采购采销:</label>
<div class="col-sm-8">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled required>
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">供应商ID:</label>
<div class="col-sm-6">
<select id="supplierCode" name="supplierCode" class="form-control" disabled>
</select>
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">供应商ID:</label>
<div class="col-sm-8">
<input id="supplierCode" name="supplierCode" th:field="*{supplierCode}" class="form-control" disabled required>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款方:</label>
<div class="col-sm-6">
<input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text" disabled>
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">对公收款方:</label>
<div class="col-sm-8">
<input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text" disabled required>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款账户:</label>
<div class="col-sm-6">
<input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text" disabled>
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">对公收款账户:</label>
<div class="col-sm-8">
<input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text" disabled required>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公开户行:</label>
<div class="col-sm-6">
<input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text" disabled>
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">对公开户行:</label>
<div class="col-sm-8">
<input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text" disabled required>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required" for="fzjlVerifyApproved">审批意见:</label>
<div class="col-sm-6">
<div class="col-sm-8">
<select name="p_B_fzjlVerifyApproved" id="fzjlVerifyApproved" class="form-control" required>
<option value=""></option>
<option value="true">同意</option>
<option value="false">拒绝</option>
</select>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">批注:</label>
<div class="col-sm-6">
<textarea name="comment" class="form-control"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">批注:</label>
<div class="col-sm-8">
<textarea name="comment" class="form-control" width="30%"></textarea>
</div>
</div>
</form>
<div class="container">
<div class="form-row">
@ -138,8 +137,9 @@
var prefix = ctx + "system/baseExpense";
var costTypeDatas = [[${@category.getChildByCode('costType')}]];
var taskId = [[${taskId}]];
var baseExpense = [[${formData}]];
var $table = $("#bootstrap-sub-table-expense-fzjl");
$("#form-baseExpense-fzjl").validate({focusCleanup: true});
$(function() {
var options = {
id:'bootstrap-sub-table-expense-fzjl',
@ -178,6 +178,31 @@
};
$.table.init(options);
handleExpenseMethod(this);
$("#supplierCode").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择供应商",
ajax: {
url: '/system/supplier/getSupplier',
dataType: 'json',
method: "post",
delay: 250,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.rows;
for(let i in resultList){
var option = resultList[i];
option.id = resultList[i]["supplierCode"];
option.text = resultList[i]["supplierCode"];
options.push(option);
}
}
return {results: options};
},
}
});
$("#supplierCode").select2("val", baseExpense.supplierCode).trigger("change");
});
// 列中获取成本类型的下拉改变数据
@ -236,30 +261,7 @@
}
// 假设此函数返回供应商列表
$("#supplierCode").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择供应商",
ajax: {
url: '/system/supplier/getSupplier',
dataType: 'json',
method: "post",
delay: 250,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.rows;
for(let i in resultList){
var option = resultList[i];
option.id = resultList[i]["supplierCode"];
option.text = resultList[i]["supplierCode"];
options.push(option);
}
}
return {results: options};
}
}
});
function handleExpenseMethod(expenseMethodSelect) {
//获取页面元素中的下拉框选中的值
var expenseMethod = $("#fzjl_expenseMethod option:selected").val();
@ -269,12 +271,6 @@
$("#fzjl_expenseMethodModal").hide();
}
}
$('#supplierCode').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='corporatePayee']").val(data.supplierName);
$("input[name='corporateReceivingAccount']").val(data.bankAccount);
$("input[name='publicAccountBanks']").val(data.depositBank);
});
function submitHandler() {
if ($.validate.form()) {
if ($('textarea[name="comment"]').val()) {

47
ruoyi-admin/src/main/resources/templates/system/baseExpense/taskModifyApply.html

@ -60,43 +60,42 @@
<div class="col-sm-6">
<select id="modify_expenseMethod" name="expenseMethod" th:field="*{expenseMethod}" onchange="handleExpenseMethod(this)"
class="form-control"
th:with="dictList=${@dict.getType('sys_base_expense_method')}" disabled>
th:with="dictList=${@dict.getType('sys_base_expense_method')}">
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div id="modify_expenseMethodModal" class="container" style="display: none">
<div class="form-group">
<label class="col-sm-6 control-label">是否是委外/采购采销:</label>
<div class="col-sm-6">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled>
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">是否是委外/采购采销:</label>
<div class="col-sm-8">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}">
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">供应商ID:</label>
<div class="col-sm-6">
<select id="supplierCode" name="supplierCode" class="form-control" disabled>
</select>
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">供应商ID:</label>
<div class="col-sm-8">
<input id="supplierCode" name="supplierCode" th:field="*{supplierCode}" class="form-control">
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款方:</label>
<div class="col-sm-6">
<input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text" disabled>
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">对公收款方:</label>
<div class="col-sm-8">
<input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款账户:</label>
<div class="col-sm-6">
<input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text" disabled>
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">对公收款账户:</label>
<div class="col-sm-8">
<input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公开户行:</label>
<div class="col-sm-6">
<input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text" disabled>
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">对公开户行:</label>
<div class="col-sm-8">
<input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text" >
</div>
</div>
</div>
@ -139,6 +138,7 @@
var prefix = ctx + "system/baseExpense";
var costTypeDatas = [[${@category.getChildByCode('costType')}]];
var taskId = [[${taskId}]];
var $table = $("#bootstrap-sub-table-expense-modify");
$("#form-baseExpense-modify").validate({focusCleanup: true});
@ -204,9 +204,6 @@
}
})
}
function removeRow(id){
$table.bootstrapTable('remove', {field: 'id', values: id})
}
// 列中获取成本类型的下拉改变数据
function onCostTypeChange(selectElement, rowIndex) {
var newSupplierId = $(selectElement).val();

101
ruoyi-admin/src/main/resources/templates/system/baseExpense/taskZozjVerify.html

@ -7,7 +7,7 @@
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-baseExpense-fzjl" th:object="${formData}">
<form class="form-horizontal m" id="form-baseExpense-zozj" th:object="${formData}">
<input name="expenseId" th:field="*{expenseId}" type="hidden">
<input name="expenseCode" th:field="*{expenseCode}" type="hidden">
<input name="taskId" th:field="*{taskId}" type="hidden">
@ -66,37 +66,36 @@
</div>
</div>
<div id="zozj_expenseMethodModal" class="container" style="display: none">
<div class="form-group">
<label class="col-sm-6 control-label">是否是委外/采购采销:</label>
<div class="col-sm-6">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled>
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">是否是委外/采购采销:</label>
<div class="col-sm-8">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled required>
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">供应商ID:</label>
<div class="col-sm-6">
<select id="supplierCode" name="supplierCode" class="form-control" disabled>
</select>
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">供应商ID:</label>
<div class="col-sm-8">
<input id="supplierCode" name="supplierCode" th:field="*{supplierCode}" class="form-control" disabled required>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款方:</label>
<div class="col-sm-6">
<input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text" disabled>
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">对公收款方:</label>
<div class="col-sm-8">
<input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text" disabled required>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款账户:</label>
<div class="col-sm-6">
<input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text" disabled>
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">对公收款账户:</label>
<div class="col-sm-8">
<input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text" disabled required>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公开户行:</label>
<div class="col-sm-6">
<input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text" disabled>
<div class="col-xs-6">
<label class="col-sm-3 control-label is-required">对公开户行:</label>
<div class="col-sm-8">
<input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text" disabled required>
</div>
</div>
</div>
@ -139,6 +138,8 @@
var prefix = ctx + "system/baseExpense";
var costTypeDatas = [[${@category.getChildByCode('costType')}]];
var taskId = [[${taskId}]];
var baseExpense = [[${formData}]];
var $table = $("#bootstrap-sub-table-expense-zozj");
$("#form-baseExpense-zozj").validate({focusCleanup: true});
$(function() {
@ -179,6 +180,31 @@
};
$.table.init(options);
handleExpenseMethod(this);
$("#supplierCode").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择供应商",
ajax: {
url: '/system/supplier/getSupplier',
dataType: 'json',
method: "post",
delay: 250,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.rows;
for(let i in resultList){
var option = resultList[i];
option.id = resultList[i]["supplierCode"];
option.text = resultList[i]["supplierCode"];
options.push(option);
}
}
return {results: options};
},
}
});
$("#supplierCode").select2("val", baseExpense.supplierCode).trigger("change");
});
// 列中获取成本类型的下拉改变数据
function onCostTypeChange(selectElement, rowIndex) {
@ -235,31 +261,6 @@
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow});
}
// 假设此函数返回供应商列表
$("#supplierCode").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择供应商",
ajax: {
url: '/system/supplier/getSupplier',
dataType: 'json',
method: "post",
delay: 250,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.rows;
for(let i in resultList){
var option = resultList[i];
option.id = resultList[i]["supplierCode"];
option.text = resultList[i]["supplierCode"];
options.push(option);
}
}
return {results: options};
}
}
});
function handleExpenseMethod(expenseMethodSelect) {
//获取页面元素中的下拉框选中的值
var expenseMethod = $("#zozj_expenseMethod option:selected").val();
@ -269,12 +270,6 @@
$("#zozj_expenseMethodModal").hide();
}
}
$('#supplierCode').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='corporatePayee']").val(data.supplierName);
$("input[name='corporateReceivingAccount']").val(data.bankAccount);
$("input[name='publicAccountBanks']").val(data.depositBank);
});
function submitHandler() {
if ($.validate.form()) {
if ($('textarea[name="comment"]').val()) {

Loading…
Cancel
Save