From d981336138a94775fba523e26aa1f3f5ff6405f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=99=93=E8=BF=AA?= <2596750866@qq.com> Date: Thu, 10 Oct 2024 08:44:25 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E5=9F=BA=E7=A1=80=E8=B5=84=E6=96=99=20?= =?UTF-8?q?=E5=91=98=E5=B7=A5=E9=A2=86=E6=96=99=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=91=98=E5=B7=A5=E9=A2=86=E6=96=99=E5=88=97=E8=A1=A8=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E4=BF=AE=E6=94=B9=E8=A1=A8=E6=A0=BC=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=AD=97=E6=AE=B5=EF=BC=9B=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=91=98=E5=B7=A5=E9=A2=86=E6=96=99=E6=B7=BB=E5=8A=A0=E3=80=81?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E3=80=81=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=A4=9A=E9=80=89=E7=89=A9=E6=96=99?= =?UTF-8?q?=EF=BC=8C=E8=B0=83=E6=95=B4=E8=A1=A8=E6=A0=BC=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=BB=93=E6=9E=84=EF=BC=9B=20=E4=BF=AE=E6=94=B9=E5=91=98?= =?UTF-8?q?=E5=B7=A5=E9=A2=86=E6=96=99controller=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=AE=9E=E7=8E=B0=E5=A4=9A=E9=80=89?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=EF=BC=9B=20=E4=BF=AE=E6=94=B9=E5=91=98?= =?UTF-8?q?=E5=B7=A5=E9=A2=86=E6=96=99=E6=9F=A5=E8=AF=A2service=E6=96=B9?= =?UTF-8?q?=E6=B3=95=EF=BC=8C=E6=B7=BB=E5=8A=A0=E8=A7=92=E8=89=B2=E9=99=90?= =?UTF-8?q?=E5=88=B6=EF=BC=9B=20=E4=BF=AE=E6=94=B9=E5=91=98=E5=B7=A5?= =?UTF-8?q?=E9=A2=86=E6=96=99=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2mapper?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=8C=E6=96=B0=E5=A2=9E=E6=8C=89id?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2=E6=96=B9=E6=B3=95=EF=BC=9B?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E9=83=A8=E9=97=A8=E7=BB=8F=E7=90=86?= =?UTF-8?q?=E3=80=81=E9=83=A8=E9=97=A8=E4=B8=BB=E7=AE=A1=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=98=BE=E7=A4=BA=E6=95=88=E6=9E=9C=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BaseEmpRequisiteOrderController.java | 37 +++++- .../domain/Vo/BaseEmpRequisiteOrderVO.java | 2 + .../mapper/BaseEmpRequisiteOrderMapper.java | 2 + .../IBaseEmpRequisiteOrderService.java | 2 +- .../BaseEmpRequisiteOrderServiceImpl.java | 97 +++++++++++++-- .../system/BaseEmpRequisiteOrderMapper.xml | 18 ++- .../system/empRequisiteOrder/add.html | 96 ++++++++++----- .../system/empRequisiteOrder/detail.html | 2 +- .../system/empRequisiteOrder/edit.html | 2 +- .../empRequisiteOrder/empRequisiteOrder.html | 111 +++++++++++++----- ...askScjlVerify.html => taskBmjlVerify.html} | 8 +- ...askSczgVerify.html => taskBmzgVerify.html} | 8 +- 12 files changed, 291 insertions(+), 94 deletions(-) rename ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/{taskScjlVerify.html => taskBmjlVerify.html} (98%) rename ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/{taskSczgVerify.html => taskBmzgVerify.html} (98%) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseEmpRequisiteOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseEmpRequisiteOrderController.java index af5c8cc3..1fe4b1eb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseEmpRequisiteOrderController.java +++ b/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 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 list = baseEmpRequisiteOrderService.selectBaseEmpRequisiteOrderList(baseEmpRequisiteOrderVO); - ExcelUtil util = new ExcelUtil(BaseEmpRequisiteOrderVO.class); - return util.exportExcel(list, "员工领料单数据"); + if (StringUtils.isEmpty(ids)){ + List requisiteOrderVOS = empRequisiteOrderMapper.selectBaseEmpRequisiteOrderList(baseEmpRequisiteOrderVO); + ExcelUtil util = new ExcelUtil(BaseEmpRequisiteOrderVO.class); + return util.exportExcel(requisiteOrderVOS, "员工领料单数据"); + }else { + String[] requisiteIds = ids.split(","); + List requisiteOrderVOS = empRequisiteOrderMapper.selectBaseEmpRequisiteOrderByIds(requisiteIds); + ExcelUtil util = new ExcelUtil(BaseEmpRequisiteOrderVO.class); + return util.exportExcel(requisiteOrderVOS, ids); + } } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/BaseEmpRequisiteOrderVO.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/BaseEmpRequisiteOrderVO.java index 8479802f..72643077 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/BaseEmpRequisiteOrderVO.java +++ b/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; /** 创建人 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseEmpRequisiteOrderMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseEmpRequisiteOrderMapper.java index 4cb0d559..dd5436bd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseEmpRequisiteOrderMapper.java +++ b/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 selectBaseEmpRequisiteOrderByIds(String[] requisiteIds); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseEmpRequisiteOrderService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseEmpRequisiteOrderService.java index 7508dd7d..fcc9101e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseEmpRequisiteOrderService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseEmpRequisiteOrderService.java @@ -28,7 +28,7 @@ public interface IBaseEmpRequisiteOrderService * @param baseEmpRequisiteOrderVO 员工领料单 * @return 员工领料单集合 */ - public List selectBaseEmpRequisiteOrderList(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO); + public List selectBaseEmpRequisiteOrderList(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO) throws Exception; /** * 新增员工领料单 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseEmpRequisiteOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseEmpRequisiteOrderServiceImpl.java index 46735e8d..ec3ce2c7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseEmpRequisiteOrderServiceImpl.java +++ b/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 selectBaseEmpRequisiteOrderList(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO) - { + public List selectBaseEmpRequisiteOrderList(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO) throws Exception { + SysUser curUser = ShiroUtils.getSysUser(); + Long userId = curUser.getUserId(); + Set roleKeys = roleService.selectRoleKeys(userId); + List Volist = baseEmpRequisiteOrderMapper.selectBaseEmpRequisiteOrderList(baseEmpRequisiteOrderVO); + + // 获取当前登录名下可看用户列表 + Set users = baseExpenseAccountService.userLimitedList(roleKeys,curUser); + + List 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 list = (Page) baseEmpRequisiteOrderMapper.selectBaseEmpRequisiteOrderList(baseEmpRequisiteOrderVO); - Page returnList = new Page<>(); + PageHelper.startPage(pageNum, pageSize); + //PageHelper 仅对第一List分页有效 + PageInfo pageInfo = new PageInfo<>(matchedList); +// Page list = (Page) pageInfo.getList(); + List list = pageInfo.getList(); + Page 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 variables) { Set 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); } } } diff --git a/ruoyi-admin/src/main/resources/mapper/system/BaseEmpRequisiteOrderMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/BaseEmpRequisiteOrderMapper.xml index 4c9e23db..2fec934e 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/BaseEmpRequisiteOrderMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/BaseEmpRequisiteOrderMapper.xml @@ -41,17 +41,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and audit_status = #{auditStatus} and requisitie_status = #{requisitieStatus} - and requisitie_code = #{requisitieCode} - and correlation_code = #{correlationCode} + and requisitie_code like concat('%', #{requisitieCode}, '%') + and correlation_code like concat('%', #{correlationCode}, '%') and apply_user = #{applyUser} - and create_by = #{createBy} + and create_by = #{createBy} + + and create_time between #{params.beginCreateTime} and #{params.endCreateTime} + + order by audit_status asc, create_time desc + + insert into base_emp_requisite_order diff --git a/ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/add.html b/ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/add.html index f9968c03..ffd02492 100644 --- a/ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/add.html @@ -49,7 +49,7 @@
- 选择报价信息 + 选择领料信息 添加物料 @@ -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('删除 '); + actions.push('删除 '); 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
- 报价信息 + 选择领料信息
diff --git a/ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/edit.html b/ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/edit.html index 7f8ad8fd..a9bc734a 100644 --- a/ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/edit.html @@ -49,7 +49,7 @@
- 选择报价信息 + 选择领料信息 添加物料 diff --git a/ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/empRequisiteOrder.html b/ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/empRequisiteOrder.html index 76909da9..32058aea 100644 --- a/ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/empRequisiteOrder.html +++ b/ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/empRequisiteOrder.html @@ -19,14 +19,14 @@
  • - +
  • - + - - +
  •  搜索 @@ -41,7 +41,7 @@ 添加 - + 导出
  • @@ -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 '' + value + ''; + } + if(value === "未启动"){ + return '' + value + ''; + } + return '' + value + ''; + } + }, + {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: '申请人', @@ -135,31 +178,10 @@ title: '待办用户ID', visible: false }, - { - field: 'taskName', - title: '当前状态', - align: 'center', - formatter: function(value, row, index) { - if(row.auditStatus!="1"&&value != "未启动"){ - return '' + value + ''; - } - if(value === "未启动"){ - return '' + value + ''; - } - return '' + value + ''; - } - }, - {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(' 进度查看 '); } - if(row.auditStatus === "1"){ - actions.push(' 编辑 '); - } else if(row.auditStatus === "2"){ actions.push('编辑 '); } @@ -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(); + }); + }); + } + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/taskScjlVerify.html b/ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/taskBmjlVerify.html similarity index 98% rename from ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/taskScjlVerify.html rename to ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/taskBmjlVerify.html index ecf45fd2..2567b681 100644 --- a/ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/taskScjlVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/taskBmjlVerify.html @@ -70,7 +70,7 @@
    - 报价信息 + 领料信息
    @@ -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("", $.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', diff --git a/ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/taskSczgVerify.html b/ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/taskBmzgVerify.html similarity index 98% rename from ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/taskSczgVerify.html rename to ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/taskBmzgVerify.html index a58de0d3..fac569b1 100644 --- a/ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/taskSczgVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/taskBmzgVerify.html @@ -70,7 +70,7 @@
    - 报价信息 + 领料信息
    @@ -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("", $.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',