Browse Source

[fix]

基础资料 员工领料
修改员工领料列表页面,修改表格显示字段;
修改员工领料添加、编辑、详情页面,添加多选物料,调整表格显示结构;
修改员工领料controller导出接口,实现多选导出;
修改员工领料查询service方法,添加角色限制;
修改员工领料列表查询mapper方法,新增按id列表查询方法;
修改部门经理、部门主管审批页面显示效果;
dev
王晓迪 2 months ago
parent
commit
d981336138
  1. 37
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseEmpRequisiteOrderController.java
  2. 2
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/BaseEmpRequisiteOrderVO.java
  3. 2
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseEmpRequisiteOrderMapper.java
  4. 2
      ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseEmpRequisiteOrderService.java
  5. 97
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseEmpRequisiteOrderServiceImpl.java
  6. 18
      ruoyi-admin/src/main/resources/mapper/system/BaseEmpRequisiteOrderMapper.xml
  7. 96
      ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/add.html
  8. 2
      ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/detail.html
  9. 2
      ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/edit.html
  10. 111
      ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/empRequisiteOrder.html
  11. 8
      ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/taskBmjlVerify.html
  12. 8
      ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/taskBmzgVerify.html

37
ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseEmpRequisiteOrderController.java

@ -2,10 +2,19 @@ package com.ruoyi.system.controller;
import java.util.HashMap;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.system.domain.OutsourceQuoteChild;
import com.ruoyi.system.domain.Vo.BaseEmpRequisiteOrderVO;
import com.ruoyi.system.domain.Vo.BaseRequisitioningOrderVo;
import com.ruoyi.system.domain.Vo.OutsourceQuoteVO;
import com.ruoyi.system.mapper.BaseEmpRequisiteOrderMapper;
import com.ruoyi.system.service.IBaseExpenseAccountService;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.warehouse.domain.WarehouseOutOrder;
import com.ruoyi.warehouse.service.IWarehouseOutOrderService;
import org.activiti.engine.RuntimeService;
@ -17,6 +26,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.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
@ -45,6 +55,9 @@ public class BaseEmpRequisiteOrderController extends BaseController
@Autowired
private IBaseEmpRequisiteOrderService baseEmpRequisiteOrderService;
@Autowired
private BaseEmpRequisiteOrderMapper empRequisiteOrderMapper;
@Autowired
private TaskService taskService;
@ -57,6 +70,12 @@ public class BaseEmpRequisiteOrderController extends BaseController
@Autowired
private IWarehouseOutOrderService warehouseOutOrderService;
@Autowired
private ISysRoleService roleService;
@Autowired
private IBaseExpenseAccountService baseExpenseAccountService;
@RequiresPermissions("system:empRequisiteOrder:view")
@GetMapping()
public String empRequisiteOrder()
@ -70,8 +89,7 @@ public class BaseEmpRequisiteOrderController extends BaseController
@RequiresPermissions("system:empRequisiteOrder:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO)
{
public TableDataInfo list(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO) throws Exception {
startPage();
List<BaseEmpRequisiteOrderVO> list = baseEmpRequisiteOrderService.selectBaseEmpRequisiteOrderList(baseEmpRequisiteOrderVO);
return getDataTable(list);
@ -84,11 +102,18 @@ public class BaseEmpRequisiteOrderController extends BaseController
@Log(title = "员工领料单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO)
public AjaxResult export(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO,String ids)
{
List<BaseEmpRequisiteOrderVO> list = baseEmpRequisiteOrderService.selectBaseEmpRequisiteOrderList(baseEmpRequisiteOrderVO);
ExcelUtil<BaseEmpRequisiteOrderVO> util = new ExcelUtil<BaseEmpRequisiteOrderVO>(BaseEmpRequisiteOrderVO.class);
return util.exportExcel(list, "员工领料单数据");
if (StringUtils.isEmpty(ids)){
List<BaseEmpRequisiteOrderVO> requisiteOrderVOS = empRequisiteOrderMapper.selectBaseEmpRequisiteOrderList(baseEmpRequisiteOrderVO);
ExcelUtil<BaseEmpRequisiteOrderVO> util = new ExcelUtil<BaseEmpRequisiteOrderVO>(BaseEmpRequisiteOrderVO.class);
return util.exportExcel(requisiteOrderVOS, "员工领料单数据");
}else {
String[] requisiteIds = ids.split(",");
List<BaseEmpRequisiteOrderVO> requisiteOrderVOS = empRequisiteOrderMapper.selectBaseEmpRequisiteOrderByIds(requisiteIds);
ExcelUtil<BaseEmpRequisiteOrderVO> util = new ExcelUtil<BaseEmpRequisiteOrderVO>(BaseEmpRequisiteOrderVO.class);
return util.exportExcel(requisiteOrderVOS, ids);
}
}
/**

2
ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/BaseEmpRequisiteOrderVO.java

@ -15,6 +15,8 @@ public class BaseEmpRequisiteOrderVO extends BaseEmpRequisiteOrder {
private String taskId;
/** 任务名称 */
private String taskName;
// 当前任务状态
private String taskStatus;
/** 办理时间 */
private Date doneTime;
/** 创建人 */

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

@ -75,4 +75,6 @@ public interface BaseEmpRequisiteOrderMapper
* @return 结果
*/
public int restoreBaseEmpRequisiteOrderById(Long requisiteId);
public List<BaseEmpRequisiteOrderVO> selectBaseEmpRequisiteOrderByIds(String[] requisiteIds);
}

2
ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseEmpRequisiteOrderService.java

@ -28,7 +28,7 @@ public interface IBaseEmpRequisiteOrderService
* @param baseEmpRequisiteOrderVO 员工领料单
* @return 员工领料单集合
*/
public List<BaseEmpRequisiteOrderVO> selectBaseEmpRequisiteOrderList(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO);
public List<BaseEmpRequisiteOrderVO> selectBaseEmpRequisiteOrderList(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO) throws Exception;
/**
* 新增员工领料单

97
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseEmpRequisiteOrderServiceImpl.java

@ -6,8 +6,11 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableSupport;
@ -20,9 +23,11 @@ import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper;
import com.ruoyi.system.domain.BaseEmpRequisiteOrderChild;
import com.ruoyi.system.domain.BaseRequisitioningOrderChild;
import com.ruoyi.system.domain.Vo.BaseEmpRequisiteOrderVO;
import com.ruoyi.system.domain.Vo.BaseRequisitioningOrderVo;
import com.ruoyi.system.domain.Vo.OutsourceQuoteVO;
import com.ruoyi.system.mapper.BaseEmpRequisiteOrderChildMapper;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.IBaseExpenseAccountService;
import com.ruoyi.system.service.ISysUserService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
@ -75,6 +80,9 @@ public class BaseEmpRequisiteOrderServiceImpl implements IBaseEmpRequisiteOrderS
@Autowired
private IProcessService processService;
@Autowired
private IBaseExpenseAccountService baseExpenseAccountService;
/**
* 查询员工领料单
*
@ -99,15 +107,28 @@ public class BaseEmpRequisiteOrderServiceImpl implements IBaseEmpRequisiteOrderS
* @return 员工领料单
*/
@Override
public List<BaseEmpRequisiteOrderVO> selectBaseEmpRequisiteOrderList(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO)
{
public List<BaseEmpRequisiteOrderVO> selectBaseEmpRequisiteOrderList(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO) throws Exception {
SysUser curUser = ShiroUtils.getSysUser();
Long userId = curUser.getUserId();
Set<String> roleKeys = roleService.selectRoleKeys(userId);
List<BaseEmpRequisiteOrderVO> Volist = baseEmpRequisiteOrderMapper.selectBaseEmpRequisiteOrderList(baseEmpRequisiteOrderVO);
// 获取当前登录名下可看用户列表
Set<String> users = baseExpenseAccountService.userLimitedList(roleKeys,curUser);
List<BaseEmpRequisiteOrderVO> matchedList = Volist.stream()
.filter(empRequisiteOrderVO -> users.contains(empRequisiteOrderVO.getApplyUser()))
.collect(Collectors.toList());
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
// PageHelper 仅对第一个 List 分页
Page<BaseEmpRequisiteOrderVO> list = (Page<BaseEmpRequisiteOrderVO>) baseEmpRequisiteOrderMapper.selectBaseEmpRequisiteOrderList(baseEmpRequisiteOrderVO);
Page<BaseEmpRequisiteOrderVO> returnList = new Page<>();
PageHelper.startPage(pageNum, pageSize);
//PageHelper 仅对第一List分页有效
PageInfo<BaseEmpRequisiteOrderVO> pageInfo = new PageInfo<>(matchedList);
// Page<BaseRequisitioningOrderVo> list = (Page<BaseRequisitioningOrderVo>) pageInfo.getList();
List<BaseEmpRequisiteOrderVO> list = pageInfo.getList();
Page<BaseEmpRequisiteOrderVO> returnList = new Page<>();
for (BaseEmpRequisiteOrderVO tempRequisiteVO: list) {
SysUser sysUser = userMapper.selectUserByLoginName(tempRequisiteVO.getCreateBy());
if (sysUser != null) {
@ -147,9 +168,15 @@ public class BaseEmpRequisiteOrderServiceImpl implements IBaseEmpRequisiteOrderS
} else {
tempRequisiteVO.setTaskName("未启动");
}
tempRequisiteVO.setTaskStatus(tempRequisiteVO.getTaskName());
if(tempRequisiteVO.getAuditStatus()!=null && tempRequisiteVO.getAuditStatus().equals("1")){
tempRequisiteVO.setTaskStatus("审核通过");
}else if(tempRequisiteVO.getAuditStatus()!=null && tempRequisiteVO.getAuditStatus().equals("2")){
tempRequisiteVO.setTaskStatus("审核拒绝");
}
returnList.add(tempRequisiteVO);
}
returnList.setTotal(org.springframework.util.CollectionUtils.isEmpty(list) ? 0 : list.getTotal());
returnList.setTotal(org.springframework.util.CollectionUtils.isEmpty(list) ? 0 : list.size());
returnList.setPageNum(pageNum);
returnList.setPageSize(pageSize);
return returnList;
@ -193,10 +220,10 @@ public class BaseEmpRequisiteOrderServiceImpl implements IBaseEmpRequisiteOrderS
baseEmpRequisiteOrderVO.setMaterialAmount(Long.valueOf(childList.size()));
}
// baseEmpRequisiteOrderVO.setUseStatus("1");
baseEmpRequisiteOrderVO.setRequisitieStatus("0");
baseEmpRequisiteOrderVO.setMaterialSum(materialSum);
baseEmpRequisiteOrderVO.setRmbSum(materialRmbSum);
baseEmpRequisiteOrderVO.setNoRmbSum(materialNoRmbSum);
System.out.println(baseEmpRequisiteOrderVO);
return baseEmpRequisiteOrderMapper.insertBaseEmpRequisiteOrder(baseEmpRequisiteOrderVO);
}
@ -317,7 +344,7 @@ public class BaseEmpRequisiteOrderServiceImpl implements IBaseEmpRequisiteOrderS
updateBaseEmpRequisiteOrder(baseEmpRequisiteOrderVO);
}
// 启动流程
String applyTitle = user.getUserName()+"发起了委外报价提交审批-"+DateUtils.dateTimeNow();
String applyTitle = user.getUserName()+"发起了员工领料提交审批-"+DateUtils.dateTimeNow();
String instanceType = "submit";
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,baseEmpRequisiteOrderVO, user);
String processInstanceId = processInstance.getProcessInstanceId();
@ -335,7 +362,7 @@ public class BaseEmpRequisiteOrderServiceImpl implements IBaseEmpRequisiteOrderS
/**
* 创建委外报价审核流程
* 创建员工领料审核流程
* @param applyTitle
* @param instanceType
* @param user
@ -362,9 +389,53 @@ public class BaseEmpRequisiteOrderServiceImpl implements IBaseEmpRequisiteOrderS
* */
private void buildAuthority(SysUser user, Map<String, Object> variables) {
Set<String> roleKeys = roleService.selectRoleKeys(user.getUserId());
// 角色不同审核人不同
if(roleKeys.contains("scyRole")){
variables.put("authority",1);
variables.put("authority",1);
//判断领料人的角色,进入相应的逻辑,设置节点审批人变量
if(roleKeys.contains("ywyRole") || roleKeys.contains("ywjlRole") || roleKeys.contains("ywzgRole")){
// 业务经理
variables.put("bmjlRole","ywjlRole");
// 业务主管
variables.put("bmzgRole","ywzgRole");
}else if(roleKeys.contains("cgyRole") || roleKeys.contains("cgjlRole") || roleKeys.contains("cgzgRole")){
// 采购经理
variables.put("bmjlRole","cgjlRole");
// 采购主管
variables.put("bmzgRole","cgzgRole");
}else if(roleKeys.contains("wwyRole") || roleKeys.contains("wwjlRole") || roleKeys.contains("wwzgRole")){
// 委外经理
variables.put("bmjlRole","wwjlRole");
// 委外主管
variables.put("bmzgRole","wwzgRole");
}else if (roleKeys.contains("gcwyRole") || roleKeys.contains("gcjlRole") || roleKeys.contains("gczgRole")){
// 工程经理
variables.put("bmjlRole","gcjlRole");
// 工程主管
variables.put("bmzgRole","gczgRole");
} else if (roleKeys.contains("scyRole") || roleKeys.contains("scjlRole") || roleKeys.contains("sczgRole")){
// 生产经理
variables.put("bmjlRole","scjlRole");
// 生产主管
variables.put("bmzgRole","sczgRole");
}else if (roleKeys.contains("shgcsRole") || roleKeys.contains("shjlRole") || roleKeys.contains("shzgRole")){
// 售后经理
variables.put("bmjlRole","shjlRole");
// 售后主管
variables.put("bmzgRole","shzgRole");
}else if(roleKeys.contains("cgyyRole") || roleKeys.contains("ckjlRole") || roleKeys.contains("ckzgRole")){
variables.put("bmjlRole","ckjlRole");
// 仓库主管
variables.put("bmzgRole","ckzgRole");
}else if (roleKeys.contains("cwRole") || roleKeys.contains("cwjlRole")|| roleKeys.contains("cwzgRole")){
variables.put("bmjlRole","cwjlRole");
// 财务主管
variables.put("bmzgRole","cwzgRole");
}else{
variables.put("authority",2);
}
if(roleKeys.contains("admin")){
// 角色包含业务经理、采购经理、工程经理、生产经理
variables.put("authority",2);
}
}
}

18
ruoyi-admin/src/main/resources/mapper/system/BaseEmpRequisiteOrderMapper.xml

@ -41,17 +41,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if>
<if test="requisitieStatus != null and requisitieStatus != ''"> and requisitie_status = #{requisitieStatus}</if>
<if test="requisitieCode != null and requisitieCode != ''"> and requisitie_code = #{requisitieCode}</if>
<if test="correlationCode != null and correlationCode != ''"> and correlation_code = #{correlationCode}</if>
<if test="requisitieCode != null and requisitieCode != ''"> and requisitie_code like concat('%', #{requisitieCode}, '%')</if>
<if test="correlationCode != null and correlationCode != ''"> and correlation_code like concat('%', #{correlationCode}, '%')</if>
<if test="applyUser != null and applyUser != ''"> and apply_user = #{applyUser}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
and create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if>
</where>
order by audit_status asc, create_time desc
</select>
<select id="selectBaseEmpRequisiteOrderById" parameterType="Long" resultMap="BaseEmpRequisiteOrderResult">
<include refid="selectBaseEmpRequisiteOrderVo"/>
where requisite_id = #{requisiteId}
</select>
<select id="selectBaseEmpRequisiteOrderByIds" parameterType="Long" resultMap="BaseEmpRequisiteOrderResult">
<include refid="selectBaseEmpRequisiteOrderVo"/>
where requisite_id in
<foreach item="requisiteId" collection="array" open="(" separator="," close=")">
#{requisiteId}
</foreach>
</select>
<insert id="insertBaseEmpRequisiteOrder" parameterType="BaseEmpRequisiteOrderVO" useGeneratedKeys="true" keyProperty="requisiteId">
insert into base_emp_requisite_order

96
ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/add.html

@ -49,7 +49,7 @@
<div class="container">
<div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group">
<span>选择报价信息</span>
<span>选择领料信息</span>
<a class="btn btn-success" onclick="insertRow()">
<i class="fa fa-plus"></i> 添加物料
</a>
@ -81,7 +81,7 @@
id:'bootstrap-sub-table-empRequisitionChild',
pagination: false,
sidePagination: "client",
model: "物料报价信息",
model: "物料信息",
columns: [
{checkbox: true},
{field: 'index',align: 'center', title: "序号",
@ -151,7 +151,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.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.materialCode + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join('');
}
}
@ -164,34 +164,68 @@
$.table.init(options);
});
function doSubmit(index, layero,uniqueId){
console.log(uniqueId);
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0];
console.log("rowData: "+JSON.stringify(rowData));
$("#bootstrap-sub-table-empRequisitionChild").bootstrapTable('insertRow', {
index:1,
row: {
materialId:rowData.id,
materialCode: rowData.materialNo,
materialName: rowData.materialName,
materialType: rowData.materialType,
describe: rowData.describe,
brand: rowData.brand,
unit: rowData.unit,
processMethod: rowData.processMethod,
photoUrl: rowData.photoUrl,
materialModel: rowData.materialModel,
specification: rowData.specification,
materialNum: "",
materialRmb: 0,
materialNoRmb: 0,
materialNoRmbSum: 0,
materialRmbSum: 0,
remark: ""
}
})
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections');
//判断是否重复
var data = $("#bootstrap-sub-table-empRequisitionChild").bootstrapTable('getData');
var rows = data.length;
if(rows>0){
for(var i=0;i<rows;i++){
for(var j=0;j<rowData.length;j++){
if(data[i].materialCode===rowData[j].materialNo){
$.modal.alertError("不能选择已添加过的相同物料");
rowData.split(j,1);
break;
}
}
};
}
for(i=0;i<rowData.length;i++){
insertTable(rowData[i]);
}
layer.close(index);
}
function insertTable(rowData){
var quoteData;
// 获取报价信息
// $.ajax({
// url: '/system/customerQuote/queryLatestRecentQuotation',
// type: 'GET',
// data: {
// materialNo: rowData.materialNo,
// customerCode: ""
// },
// success: function(data) {
// quoteData = data;
// console.log(data);
// },
// error: function(jqXHR, textStatus, errorThrown) {
// console.error('Error:', textStatus, errorThrown);
// $('#result').text('An error occurred while fetching the data.');
// }
// });
var newRow = {
materialId:rowData.id,
materialCode: rowData.materialNo,
materialName: rowData.materialName,
materialType: rowData.materialType,
describe: rowData.describe,
brand: rowData.brand,
unit: rowData.unit,
processMethod: rowData.processMethod,
photoUrl: rowData.photoUrl,
materialModel: rowData.materialModel,
specification: rowData.specification,
materialNum: "",
materialRmb: 0,
materialNoRmb: 0,
materialNoRmbSum: 0,
materialRmbSum: 0,
remark: ""
};
$("#bootstrap-sub-table-empRequisitionChild").bootstrapTable('append', newRow);
}
function insertRow() {
var url = ctx + "erp/material/select";
var options = {
@ -202,10 +236,10 @@
$.modal.openOptions(options);
}
/* 删除指定表格行 */
function removeRow(id){
function removeRow(materialCode){
$("#bootstrap-sub-table-empRequisitionChild").bootstrapTable('remove', {
field: 'id',
values: id
field: 'materialCode',
values: materialCode
})
}

2
ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/detail.html

@ -49,7 +49,7 @@
<div class="container">
<div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group">
<span>报价信息</span>
<span>选择领料信息</span>
</div>
</div>
<div class="row">

2
ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/edit.html

@ -49,7 +49,7 @@
<div class="container">
<div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group">
<span>选择报价信息</span>
<span>选择领料信息</span>
<a class="btn btn-success" onclick="insertRow()">
<i class="fa fa-plus"></i> 添加物料
</a>

111
ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/empRequisiteOrder.html

@ -19,14 +19,14 @@
<input type="text" name="correlationCode"/>
</li>
<li>
<label>领料</label>
<label>领料</label>
<input type="text" name="applyUser"/>
</li>
<li>
<label>录入时间:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime1]"/>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime1]"/>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
@ -41,7 +41,7 @@
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:empRequisiteOrder:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:empRequisiteOrder:export">
<a class="btn btn-warning" onclick="exportExcel()" shiro:hasPermission="system:empRequisiteOrder:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
@ -80,6 +80,7 @@
fixedRightNumber: 1, // 冻结右列个数
sortable: true, // 是否启用排序
sortStable: true,
showFooter: true,
modalName: "员工领料单",
columns: [
{checkbox: true},
@ -114,6 +115,48 @@
title: '申请人ID',
visible: false
},
{
field: 'taskName',
title: '当前任务名称',
visible: false
},
{
field: 'taskStatus',
title: '当前状态',
align: 'center',
formatter: function(value, row, index) {
if(row.auditStatus!="1"&&value != "未启动"){
return '<span class="badge badge-danger">' + value + '</span>';
}
if(value === "未启动"){
return '<span class="badge badge-primary">' + value + '</span>';
}
return '<span class="badge badge-primary">' + value + '</span>';
}
},
{title: '领料单号',field: 'requisitieCode',},
{title: '关联订单号',field: 'correlationCode',},
{title: '物料合计',field: 'materialAmount',
footerFormatter: function (value) {
var sum = 0;
for (var i in value) {
sum += parseFloat(value[i].materialAmount)|| 0;
}
return "物料合计: " + sum.toFixed(2);
}
},
{title: '数量总计',field: 'materialSum',
footerFormatter: function (value) {
var sum = 0;
for (var i in value) {
sum += parseFloat(value[i].materialSum)|| 0;
}
return "数量总计: " + sum.toFixed(2);
}
},
{title: '领料状态',field: 'requisitieStatus',
formatter: function(value, row, index) {return $.table.selectDictLabel(requisitieStatusDatas, value);}
},
{
field: 'applyUserName',
title: '<span style="color: red;">申请人</span>',
@ -135,31 +178,10 @@
title: '待办用户ID',
visible: false
},
{
field: 'taskName',
title: '当前状态',
align: 'center',
formatter: function(value, row, index) {
if(row.auditStatus!="1"&&value != "未启动"){
return '<span class="badge badge-danger">' + value + '</span>';
}
if(value === "未启动"){
return '<span class="badge badge-primary">' + value + '</span>';
}
return '<span class="badge badge-primary">' + value + '</span>';
}
},
{title: '审核状态',field: 'auditStatus',
{title: '审核状态',field: 'auditStatus',visible: false,
formatter: function(value, row, index) {return $.table.selectDictLabel(auditStatusDatas, value);}
},
{title: '领料状态',field: 'requisitieStatus',
formatter: function(value, row, index) {return $.table.selectDictLabel(requisitieStatusDatas, value);}
},
{title: '领料单号',field: 'requisitieCode',},
{title: '领料员',field: 'createBy',},
{title: '关联订单号',field: 'correlationCode',},
{title: '物料合计',field: 'materialAmount', },
{title: '数量总计',field: 'materialSum',},
{title: '不含税总价(RMB)',field: 'noRmbSum',visible: false},
{title: '含税总价(RMB)',field: 'rmbSum',visible: false},
{title: '申请人',field: 'applyUser',visible: false},
@ -190,9 +212,6 @@
// 进度查看
actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="showProcessImgDialog(\'' + row.instanceId + '\')"><i class="fa fa-image"></i> 进度查看</a> ');
}
if(row.auditStatus === "1"){
actions.push('<a class="btn btn-default btn-xs" disabled href="javascript:void(0)"><i class="fa fa-edit"></i> 编辑</a> ');
}
else if(row.auditStatus === "2"){
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.requisiteId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
}
@ -200,10 +219,42 @@
return actions.join('');
}
}
]
],
rowStyle: function (row, index) {
if (row.auditStatus=="0") {
// 如果审核状态为待审核,则设置为红色
return {css:{"color":"red"}};
}
// 否则使用默认样式
return {};
}
};
$.table.init(options);
});
function exportExcel() {
var ids = $.table.selectColumns("requisiteId");
var codes = $.table.selectColumns("requisitieCode");
var dataParam = $("#formId").serializeArray();
let tipMsg = "确定导出当前所有数据吗?";
if ($.common.isNotEmpty(ids)) {
tipMsg = `确定导出 ${codes} 数据吗?`;
dataParam.push({ "name": "ids", "value": ids });
}
$.modal.confirm(tipMsg, function () {
$.modal.loading("正在导出数据,请稍后...");
$.post( prefix + "/export", dataParam, function (result) {
if (result.code === web_status.SUCCESS) {
window.location.href = ctx + "common/download?fileName="+ encodeURI(result.msg) + "&delete=" + true;
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
});
});
}
</script>
</body>
</html>

8
ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/taskScjlVerify.html → ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/taskBmjlVerify.html

@ -70,7 +70,7 @@
<div class="container">
<div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group">
<span>报价信息</span>
<span>领料信息</span>
</div>
</div>
<div class="row">
@ -104,7 +104,7 @@
data: [[${formData.baseEmpRequisiteOrderChildList}]],
columns: [
{checkbox: true},
{field: 'index',align: 'center', title: "序号",
{field: 'index',align: 'center', title: "序号",visible: false,
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
return columnIndex + $.table.serialNumber(index);
@ -123,8 +123,8 @@
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{title: '型号',field: 'materialModel',align: 'center'},
{title: '规格',field: 'specification',align: 'center'},
{title: '型号',field: 'materialModel',align: 'center',visible: false},
{title: '规格',field: 'specification',align: 'center',visible: false},
{ title: '描述',field: 'describe',align: 'center'},
{title: '品牌',field: 'brand',align: 'center'},
{ title: '单位',field: 'unit',align: 'center',

8
ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/taskSczgVerify.html → ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/taskBmzgVerify.html

@ -70,7 +70,7 @@
<div class="container">
<div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group">
<span>报价信息</span>
<span>领料信息</span>
</div>
</div>
<div class="row">
@ -105,7 +105,7 @@
data: [[${formData.baseEmpRequisiteOrderChildList}]],
columns: [
{checkbox: true},
{field: 'index',align: 'center', title: "序号",
{field: 'index',align: 'center', title: "序号",visible: false,
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
return columnIndex + $.table.serialNumber(index);
@ -124,8 +124,8 @@
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{title: '型号',field: 'materialModel',align: 'center'},
{title: '规格',field: 'specification',align: 'center'},
{title: '型号',field: 'materialModel',align: 'center',visible: false},
{title: '规格',field: 'specification',align: 'center',visible: false},
{ title: '描述',field: 'describe',align: 'center'},
{title: '品牌',field: 'brand',align: 'center'},
{ title: '单位',field: 'unit',align: 'center',
Loading…
Cancel
Save