Browse Source

[feat]基础信息: 新增报销单,添加报销类别表中的列字段的成本类型字段的值,来决定本列的成本小类的字段的下拉列表的选项,更换查询语句,修改查询对象。 新增一个类型为成本类型字段code值为'costType',创建一个根据此code在sys_actegory表中的子项分类的接口。

dev
zhangsiqi 6 months ago
parent
commit
cbed4629ca
  1. 25
      ruoyi-admin/src/main/java/com/ruoyi/system/CategoryController.java
  2. 10
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseExpenseAccountController.java
  3. 26
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java
  4. 18
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java
  5. 12
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseExpenseAccount.java
  6. 12
      ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountMapper.xml
  7. 114
      ruoyi-admin/src/main/resources/templates/system/baseExpense/add.html
  8. 8
      ruoyi-admin/src/main/resources/templates/system/baseExpense/baseExpense.html
  9. 114
      ruoyi-admin/src/main/resources/templates/system/baseExpense/edit.html
  10. 71
      ruoyi-admin/src/main/resources/templates/system/baseExpenseChild/baseExpenseChild.html

25
ruoyi-admin/src/main/java/com/ruoyi/system/CategoryController.java

@ -0,0 +1,25 @@
package com.ruoyi.system;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.framework.web.service.CategoryService;
import com.ruoyi.system.domain.SysCategory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping("/system/category")
public class CategoryController extends BaseController {
@Autowired
private CategoryService categoryService;
@RequestMapping("getChildCode")
@ResponseBody
public List<SysCategory> getChildCode(String code) {
return categoryService.getChildByCode(code);
}
}

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

@ -5,11 +5,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.BaseExpenseAccount;
@ -84,7 +80,7 @@ public class BaseExpenseAccountController extends BaseController
@Log(title = "报销单", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(BaseExpenseAccount baseExpenseAccount)
public AjaxResult addSave(@RequestBody BaseExpenseAccount baseExpenseAccount)
{
return toAjax(baseExpenseAccountService.insertBaseExpenseAccount(baseExpenseAccount));
}
@ -107,7 +103,7 @@ public class BaseExpenseAccountController extends BaseController
@Log(title = "报销单", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(BaseExpenseAccount baseExpenseAccount)
public AjaxResult editSave(@RequestBody BaseExpenseAccount baseExpenseAccount)
{
return toAjax(baseExpenseAccountService.updateBaseExpenseAccount(baseExpenseAccount));
}

26
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java

@ -38,6 +38,7 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
* 客户报价信息Controller
@ -68,6 +69,8 @@ public class SysCustomerQuoteController extends BaseController
@Autowired
private RuntimeService runtimeService;
@Autowired
private ISysUserService sysUserService;
@Autowired
private IProcessService processService;
@ -90,16 +93,33 @@ public class SysCustomerQuoteController extends BaseController
@ResponseBody
public TableDataInfo list(SysCustomerQuoteVo sysCustomerQuoteVo)
{
try {
SysUser curUser = ShiroUtils.getSysUser();
Long userId = curUser.getUserId();
Set<String> roleKeys = roleService.selectRoleKeys(userId);
startPage();
List<SysCustomerQuoteVo> list = sysCustomerQuoteService.selectSysCustomerQuoteList(sysCustomerQuoteVo);
String loginName = ShiroUtils.getLoginName();
List<SysUser> sysUserlist = sysUserService.selectRoleToUserList("ywyRole");
sysUserlist.add(curUser);
if (roleKeys.contains("ywjlRole")) {
List<SysUser> findUser = sysUserlist.stream().filter(item -> (item.getDeptId().equals(curUser.getDeptId()))).collect(Collectors.toList());
Set<String> user = findUser.stream().map(SysUser::getLoginName).collect(Collectors.toSet());
startPage();
List<SysCustomerQuoteVo> list2 = list.stream().filter(item -> user.contains(item.getApplyUser())).collect(Collectors.toList());
return getDataTable(list2);
}
// 业务员角色只能看到自己创建的数据
if (roleKeys.contains("ywyRole")) {
sysCustomerQuoteVo.setCreateBy(curUser.getLoginName());
}
sysCustomerQuoteVo.setApplyUser(curUser.getLoginName());
startPage();
List<SysCustomerQuoteVo> list = sysCustomerQuoteService.selectSysCustomerQuoteList(sysCustomerQuoteVo);
List<SysCustomerQuoteVo> list2 = sysCustomerQuoteService.selectSysCustomerQuoteList(sysCustomerQuoteVo);
return getDataTable(list2);
}
return getDataTable(list);
}catch(NullPointerException e){
throw new NullPointerException("当前用户没有申请客户报价信息");
}
}
/**

18
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java

@ -25,6 +25,7 @@ import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.system.domain.*;
import com.ruoyi.system.domain.exportDto.SysSalesFinishDto;
import com.ruoyi.system.domain.exportDto.SysSalesOrderDto;
import com.ruoyi.system.mapper.SysSalesOrderMapper;
import com.ruoyi.system.service.*;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
@ -85,6 +86,9 @@ public class SysSalesOrderController extends BaseController
@Autowired
private ISysMakeOrderService sysMakeOrderService;
@Autowired
private SysSalesOrderMapper sysSalesOrderMapper;
@RequiresPermissions("system:salesOrder:view")
@GetMapping()
public String salesOrder(ModelMap mmap)
@ -110,6 +114,14 @@ public class SysSalesOrderController extends BaseController
Set<String> roleKeys = roleService.selectRoleKeys(userId);
List<SysUser> sysUserlist = sysUserService.selectRoleToUserList("ywyRole");
sysUserlist.add(curUser);
if (curUser.getUserName().contains("admin")) {
SysSalesOrderVo sysSalesOrderVo2 = new SysSalesOrderVo();
startPage();
List<SysSalesOrderVo> list2 = sysSalesOrderService.selectSysSalesOrderList(sysSalesOrderVo2);
return getDataTable(list2);
}
//如果主管审批,查看当前自己部门的审核
//如果经理审计需要查询自己部门下所有业务员的提交的订单,以及自身的提交的订单
if (roleKeys.contains("ywjlRole")) {
List<SysUser> findUser = sysUserlist.stream().filter(item -> (item.getDeptId().equals(curUser.getDeptId()))).collect(Collectors.toList());
Set<String> user = findUser.stream().map(SysUser::getLoginName).collect(Collectors.toSet());
@ -119,10 +131,10 @@ public class SysSalesOrderController extends BaseController
}
// 业务员角色只能看到自己创建的数据
if (roleKeys.contains("ywyRole")) {
sysSalesOrderVo.setApplyUser(curUser.getUserName());
sysSalesOrderVo.setApplyUser(curUser.getLoginName());
startPage();
list = sysSalesOrderService.selectSysSalesOrderList(sysSalesOrderVo);
return getDataTable(list);
List<SysSalesOrderVo> list2 = sysSalesOrderService.selectSysSalesOrderList(sysSalesOrderVo);
return getDataTable(list2);
}
return getDataTable(list);
}catch(NullPointerException e){

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

@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import java.util.List;
/**
* 报销单对象 base_emp_expense_account
*
@ -80,6 +82,16 @@ public class BaseExpenseAccount extends BaseEntity
private String del_flag;
private List<BaseExpenseAccountChild> expenseAccountChildList;
public List<BaseExpenseAccountChild> getExpenseAccountChildList() {
return expenseAccountChildList;
}
public void setExpenseAccountChildList(List<BaseExpenseAccountChild> expenseAccountChildList) {
this.expenseAccountChildList = expenseAccountChildList;
}
public String getDel_flag() {
return del_flag;
}

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

@ -55,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<insert id="insertBaseExpenseAccount" parameterType="BaseExpenseAccount" useGeneratedKeys="true" keyProperty="expenseId">
insert into base_emp_expense_account
insert into base_expense_account
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="auditStatus != null">audit_status,</if>
<if test="managerAuditStatus != null">manager_audit_status,</if>
@ -103,7 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert>
<update id="updateBaseExpenseAccount" parameterType="BaseExpenseAccount">
update base_emp_expense_account
update base_expense_account
<trim prefix="SET" suffixOverrides=",">
<if test="auditStatus != null">audit_status = #{auditStatus},</if>
<if test="managerAuditStatus != null">manager_audit_status = #{managerAuditStatus},</if>
@ -130,22 +130,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteBaseExpenseAccountById" parameterType="Long">
delete from base_emp_expense_account where expense_id = #{expenseId}
delete from base_expense_account where expense_id = #{expenseId}
</delete>
<delete id="deleteBaseExpenseAccountByIds" parameterType="String">
delete from base_emp_expense_account where expense_id in
delete from base_expense_account where expense_id in
<foreach item="expenseId" collection="array" open="(" separator="," close=")">
#{expenseId}
</foreach>
</delete>
<update id="cancelBaseExpenseAccountById" parameterType="Long">
update base_emp_expense_account set del_flag = '1' where expense_id = #{expenseId}
update base_expense_account set del_flag = '1' where expense_id = #{expenseId}
</update>
<update id="restoreBaseExpenseAccountById" parameterType="Long">
update base_emp_expense_account set del_flag = '0' where expense_id = #{expenseId}
update base_expense_account set del_flag = '0' where expense_id = #{expenseId}
</update>
</mapper>

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

@ -90,6 +90,9 @@
<script th:inline="javascript">
var prefix = ctx + "system/baseExpense"
$("#form-baseExpense-add").validate({focusCleanup: true});
var costTypeDatas = [[${@category.getChildByCode('costType')}]];
var $table = $("#bootstrap-sub-table-expense");
var costTypes;
$(function() {
$.ajax({
url: prefix + "/getId",
@ -103,8 +106,9 @@
}
}
});
})
var $table = $("#bootstrap-sub-table-expense");
// 假设此函数返回供应商列表
});
//获取子表信息
$(function() {
var options = {
@ -114,15 +118,23 @@
model: "报销单数据",
columns: [
{checkbox: true},
{title: '主键',field: '',visible: false,
{title: '主键',field: 'index',align: 'center',visible: false,
formatter: function (value, row, index) {
return index;
}
},
{title: '报销单分项子表',field: 'expenseChildId',visible: false},
{title: '关联报销单号',field: 'quoteId',visible: false},
{title: '成本类型',field: 'costType',},
{title: '成本小类',field: 'costSmallType',},
{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',options:{maxlength:100}}},
{title: '金额',field: 'amounts',editable: {type:'text',options:{maxlength:100}}},
{title: '报销时间',field: 'expenseTime',editable:{type:'date'}},
@ -132,7 +144,7 @@
{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> ');
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + index + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join('');
}
}
@ -145,31 +157,87 @@
index:1,
row: {
expenseChildId:'',
costType: "<select name='costType' class='form-control'>"+ "<option value=''>所有</option>" + "</select>",
costSmallType:"<select name='costSmallType' class='form-control'>"+ "\"<option value=''>所有</option>\"" +"</select>",
purpose:'<input name="purpose" class="form-control" type="text">' ,
amounts: '<input name="amounts" class="form-control" type="text">',
expenseTime: '<div class="input-group date">\n' +
'<input name="expenseTime" class="form-control" placeholder="yyyy-MM-dd" type="date"></div>',
evectionCode:'<input name="evectionCode" class="form-control" type="text">' ,
purcahseCode:'<input name="purcahseCode" class="form-control" type="text">',
outsourceCode: '<input name="outsourceCode" class="form-control" type="text">',
costType: "",
costSmallType:"",
purpose:'' ,
amounts: '',
expenseTime: '',
evectionCode:'' ,
purcahseCode:'',
outsourceCode: '',
}
})
layer.close(index);
}
/* 删除指定表格行 */
function removeRow(id){
$table.bootstrapTable('remove', {
field: 'id',
values: id
})
}
function removeRow(index){$table.bootstrapTable('remove', {field: 'index',values: index})};
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-baseExpense-add').serialize());
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 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>';
});
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});
}
</script>
</body>
</html>

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

@ -54,13 +54,14 @@
</li>
<li>
<label>成本类型:</label>
<select name="financeAuditStatus">
<select name="costType" th:with="childList=${@category.getChildByCode('costType')}">
<option value="">所有</option>
<option th:each="chilld: ${childList}" th:value="${chilld.code}" th:text="${chilld.name}"></option>
</select>
</li>
<li>
<label>成本小类:</label>
<select name="financeAuditStatus">
<select name="costSamllType">
<option value="">所有</option>
</select>
</li>
@ -99,13 +100,14 @@
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var costTypeDatas = [[${@category.getChildByCode('costType')}]];
var editFlag = [[${@permission.hasPermi('system:baseExpense:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:baseExpense:remove')}]];
var cancelFlag = [[${@permission.hasPermi('system:baseExpense:cancel')}]];
var restoreFlag = [[${@permission.hasPermi('system:baseExpense:restore')}]];
var prefix = ctx + "system/baseExpense";
$(function() {
var costTypeDatas = [[${@category.getChildByCode('costType')}]];
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",

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

@ -37,7 +37,6 @@
<input name="expenseMethod" th:field="*{expenseMethod}" class="form-control" type="text">
</div>
</div>
<div class="form-row" id="expanseType">
<div class="form-group">
<label class="col-sm-3 control-label">供应商ID:</label>
<div class="col-sm-8">
@ -69,9 +68,6 @@
<input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text">
</div>
</div>
</div>
</form>
<div class="container">
<div class="form-row">
@ -90,6 +86,7 @@
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "system/baseExpense"
var costTypeDatas = [[${@category.getChildByCode('costType')}]];
$("#form-baseExpense-add").validate({focusCleanup: true});
$(function(){
$.ajax({
@ -128,8 +125,16 @@
},
{title: '报销单分项子表',field: 'expenseChildId',visible: false},
{title: '关联报销单号',field: 'quoteId',visible: false},
{title: '成本类型',field: 'costType',},
{title: '成本小类',field: 'costSmallType',},
{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',options:{maxlength:100}}},
{title: '金额',field: 'amounts',editable: {type:'text',options:{maxlength:100}}},
{title: '报销时间',field: 'expenseTime',editable:{type:'date'}},
@ -152,15 +157,14 @@
index:1,
row: {
expenseChildId:'',
costType: "<select name='costType' class='form-control'>"+ "<option value=''>所有</option>" + "</select>",
costSmallType:"<select name='costSmallType' class='form-control'>"+ "\"<option value=''>所有</option>\"" +"</select>",
purpose:'<input name="purpose" class="form-control" type="text">' ,
amounts: '<input name="amounts" class="form-control" type="text">',
expenseTime: '<div class="input-group date">\n' +
'<input name="expenseTime" class="form-control" placeholder="yyyy-MM-dd" type="date"></div>',
evectionCode:'<input name="evectionCode" class="form-control" type="text">' ,
purcahseCode:'<input name="purcahseCode" class="form-control" type="text">',
outsourceCode: '<input name="outsourceCode" class="form-control" type="text">',
costType: "",
costSmallType:"",
purpose:'' ,
amounts: '',
expenseTime: '',
evectionCode:'' ,
purcahseCode:'',
outsourceCode: '',
}
})
layer.close(index);
@ -175,9 +179,87 @@
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-baseExpense-edit').serialize());
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);
}
}
}
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 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>' ;
});
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});
}
</script>
</body>
</html>

71
ruoyi-admin/src/main/resources/templates/system/baseExpenseChild/baseExpenseChild.html

@ -17,8 +17,7 @@
<li>
<label>成本类型:</label>
<select name="cost type">
<option value="">所有</option>
<option value="-1">代码生成请选择字典属性</option>
<option value="" th:with="">所有</option>
</select>
</li>
<li>
@ -92,57 +91,20 @@
restoreUrl: prefix + "/restore/{id}",
exportUrl: prefix + "/export",
modalName: "报销单分类子",
columns: [{
checkbox: true
},
{
title: '报销单分项子表',
field: 'expenseChildId',
visible: false
},
{
title: '关联报销单号',
field: 'quoteId',
},
{
title: '成本类型',
field: 'cost type',
},
{
title: '成本小类',
field: 'costSmallType',
},
{
title: '用途',
field: 'purpose',
},
{
title: '金额',
field: 'amounts',
},
{
title: '报销时间',
field: 'expenseTime',
},
{
title: '出差单号',
field: 'evectionCode',
},
{
title: '采购单号',
field: 'purcahseCode',
},
{
title: '委外单号',
field: 'outsourceCode',
},
{
title: '备注',
field: 'remark',
},
{
title: '操作',
align: 'center',
columns: [
{checkbox: true},
{title: '报销单分项子表',field: 'expenseChildId',visible: false},
{title: '关联报销单号',field: 'quoteId',},
{title: '成本类型',field: 'cosType',},
{title: '成本小类',field: 'costSmallType',},
{title: '用途',field: 'purpose',},
{title: '金额',field: 'amounts',},
{title: '报销时间',field: 'expenseTime',},
{title: '出差单号',field: 'evectionCode',},
{title: '采购单号',field: 'purcahseCode',},
{title: '委外单号',field: 'outsourceCode',},
{title: '备注',field: 'remark',},
{title: '操作',align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.expenseChildId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
@ -154,7 +116,8 @@
}
return actions.join('');
}
}]
}
]
};
$.table.init(options);
});

Loading…
Cancel
Save