Browse Source

[feat] 工程管理

修改开发修改后端查询集合接口:关联审批数据和代办人数据
修改开发修改单前端列表页面:引入流程实例ID等字段;引入工作流插件
新增前端开发修改单详情页面
开发修改单前端页面新增详情按钮
新增打开开发修改单详情弹窗后端接口
新增修改保存开发修改单详情弹窗后端接口
dev
liuxiaoxu 4 months ago
parent
commit
da04301d75
  1. 51
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpDevelopModifyorderController.java
  2. 4
      ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpDevelopModifyorderMapper.java
  3. 9
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpDevelopModifyorderService.java
  4. 73
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpDevelopModifyorderServiceImpl.java
  5. 23
      ruoyi-admin/src/main/resources/mapper/erp/ErpDevelopModifyorderMapper.xml
  6. 2
      ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/add.html
  7. 2
      ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/confirm.html
  8. 803
      ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/detail.html
  9. 129
      ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/developModifyOrder.html
  10. 2
      ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/edit.html

51
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpDevelopModifyorderController.java

@ -89,10 +89,10 @@ public class ErpDevelopModifyorderController extends BaseController
@RequiresPermissions("erp:developModifyOrder:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(ErpDevelopModifyorder erpDevelopModifyorder)
public TableDataInfo list(ErpDevelopModifyorderVo erpDevelopModifyorderVo)
{
startPage();
List<ErpDevelopModifyorder> list = erpDevelopModifyorderService.selectErpDevelopModifyorderList(erpDevelopModifyorder);
List<ErpDevelopModifyorderVo> list = erpDevelopModifyorderService.selectErpDevelopModifyorderList(erpDevelopModifyorderVo);
return getDataTable(list);
}
@ -114,10 +114,10 @@ public class ErpDevelopModifyorderController extends BaseController
@Log(title = "开发修改单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(ErpDevelopModifyorder erpDevelopModifyorder)
public AjaxResult export(ErpDevelopModifyorderVo erpDevelopModifyorderVo)
{
List<ErpDevelopModifyorder> list = erpDevelopModifyorderService.selectErpDevelopModifyorderList(erpDevelopModifyorder);
ExcelUtil<ErpDevelopModifyorder> util = new ExcelUtil<ErpDevelopModifyorder>(ErpDevelopModifyorder.class);
List<ErpDevelopModifyorderVo> list = erpDevelopModifyorderService.selectErpDevelopModifyorderList(erpDevelopModifyorderVo);
ExcelUtil<ErpDevelopModifyorderVo> util = new ExcelUtil<ErpDevelopModifyorderVo>(ErpDevelopModifyorderVo.class);
return util.exportExcel(list, "开发修改单数据");
}
@ -333,6 +333,35 @@ public class ErpDevelopModifyorderController extends BaseController
}
/**
* 查看开发修改单详情
* */
@Log(title = "开发修改单", businessType = BusinessType.OTHER)
@GetMapping("/detail/{developOrderId}")
public String detail(@PathVariable("developOrderId") Long developOrderId, ModelMap mmap){
ErpDevelopModifyorder erpDevelopModifyorder = erpDevelopModifyorderService.selectErpDevelopModifyorderById(developOrderId);
mmap.put("erpDevelopModifyorder",erpDevelopModifyorder);
mmap.put("beforeUpdateRemark", erpDevelopModifyorder.getBeforeUpdateRemark());
mmap.put("afterUpdateRemark", erpDevelopModifyorder.getAfterUpdateRemark());
return prefix+ "/detail";
}
/**
* 修改保存开发修改单详情
*/
@Log(title = "开发修改单", businessType = BusinessType.UPDATE)
@PostMapping("/detail")
@ResponseBody
public AjaxResult detailSave(@RequestBody ErpDevelopModifyorder erpDevelopModifyorder)
{
return toAjax(erpDevelopModifyorderService.detailErpDevelopModifyorder(erpDevelopModifyorder));
}
/**相关人员确认*/
@GetMapping("/confirm/{developOrderId}")
public String confrimDetail(@PathVariable("developOrderId") Long developOrderId, ModelMap mmap)
@ -350,17 +379,7 @@ public class ErpDevelopModifyorderController extends BaseController
return prefix + "/pickAdd";
}
/**
* 查看开发修改单详情
* */
@RequiresPermissions("erp:developModifyOrder:detail")
@Log(title = "开发修改单", businessType = BusinessType.OTHER)
@GetMapping("/detail/{developOrderId}")
public String detail(@PathVariable("developOrderId") Long developOrderId, ModelMap mmap){
ErpDevelopModifyorder erpDevelopModifyorder = erpDevelopModifyorderService.selectErpDevelopModifyorderById(developOrderId);
mmap.put("erpDevelopModifyorder",erpDevelopModifyorder);
return prefix+ "/detail";
}
/**
* 删除开发修改单
*/

4
ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpDevelopModifyorderMapper.java

@ -23,10 +23,10 @@ public interface ErpDevelopModifyorderMapper
/**
* 查询开发修改单列表
*
* @param erpDevelopModifyorder 开发修改单
* @param erpDevelopModifyorderVo 开发修改单
* @return 开发修改单集合
*/
public List<ErpDevelopModifyorder> selectErpDevelopModifyorderList(ErpDevelopModifyorder erpDevelopModifyorder);
public List<ErpDevelopModifyorderVo> selectErpDevelopModifyorderList(ErpDevelopModifyorderVo erpDevelopModifyorderVo);
/**
* 新增开发修改单

9
ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpDevelopModifyorderService.java

@ -26,10 +26,10 @@ public interface IErpDevelopModifyorderService
/**
* 查询开发修改单列表
*
* @param erpDevelopModifyorder 开发修改单
* @param erpDevelopModifyorderVo 开发修改单
* @return 开发修改单集合
*/
public List<ErpDevelopModifyorder> selectErpDevelopModifyorderList(ErpDevelopModifyorder erpDevelopModifyorder);
public List<ErpDevelopModifyorderVo> selectErpDevelopModifyorderList(ErpDevelopModifyorderVo erpDevelopModifyorderVo);
/**
* 新增开发修改单
@ -94,4 +94,9 @@ public interface IErpDevelopModifyorderService
* 根据开发修改单号查询开发修改详情物料信息
* */
List<ErpDevelopModifyorderDetail> selectDevelopModifyDetailMaterialByCode(String developOrderCode);
/**
* 修改保存开发修改单详情
* */
int detailErpDevelopModifyorder(ErpDevelopModifyorder erpDevelopModifyorder);
}

73
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpDevelopModifyorderServiceImpl.java

@ -2,10 +2,14 @@ package com.ruoyi.erp.service.impl;
import java.util.*;
import com.github.pagehelper.Page;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableSupport;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.erp.domain.ErpDevelopModifyorderDetail;
import com.ruoyi.erp.domain.vo.ErpDevelopModifyorderMaterialVo;
import com.ruoyi.erp.domain.vo.ErpDevelopModifyorderVo;
@ -13,10 +17,13 @@ import com.ruoyi.erp.mapper.ErpDevelopModifyorderDetailMapper;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper;
import com.ruoyi.sales.domain.SalesAftersalesNotice;
import com.ruoyi.sales.domain.VO.SalesAftersalesNoticeVO;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.ISysRoleService;
import org.activiti.engine.TaskService;
import org.activiti.engine.impl.persistence.entity.TaskEntityImpl;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.erp.mapper.ErpDevelopModifyorderMapper;
@ -74,13 +81,64 @@ public class ErpDevelopModifyorderServiceImpl implements IErpDevelopModifyorderS
/**
* 查询开发修改单列表
*
* @param erpDevelopModifyorder 开发修改单
* @param erpDevelopModifyorderVo 开发修改单Vo
* @return 开发修改单
*/
@Override
public List<ErpDevelopModifyorder> selectErpDevelopModifyorderList(ErpDevelopModifyorder erpDevelopModifyorder)
public List<ErpDevelopModifyorderVo> selectErpDevelopModifyorderList(ErpDevelopModifyorderVo erpDevelopModifyorderVo)
{
return erpDevelopModifyorderMapper.selectErpDevelopModifyorderList(erpDevelopModifyorder);
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
// PageHelper 仅对第一个 List 分页
Page<ErpDevelopModifyorderVo> list = (Page<ErpDevelopModifyorderVo>) erpDevelopModifyorderMapper.selectErpDevelopModifyorderList(erpDevelopModifyorderVo);
Page<ErpDevelopModifyorderVo> returnList = new Page<>();
for (ErpDevelopModifyorderVo tempErpDevelopModifyorderVo: list) {
SysUser sysUser = userMapper.selectUserByLoginName(tempErpDevelopModifyorderVo.getCreateBy());
if (sysUser != null) {
tempErpDevelopModifyorderVo.setCreateUserName(sysUser.getUserName());
}
SysUser sysUser2 = userMapper.selectUserByLoginName(tempErpDevelopModifyorderVo.getApplyUser());
if (sysUser2 != null) {
tempErpDevelopModifyorderVo.setApplyUserName(sysUser2.getUserName());
}
String instanceId = tempErpDevelopModifyorderVo.getInstanceId();
// 当前环节
if (StringUtils.isNotBlank(instanceId)) {
List<Task> taskList = taskService.createTaskQuery()
.processInstanceId(instanceId)
// .singleResult();
.list(); // 例如请假会签,会同时拥有多个任务
if (!org.springframework.util.CollectionUtils.isEmpty(taskList)) {
TaskEntityImpl task = (TaskEntityImpl) taskList.get(0);
String taskId = task.getId();
tempErpDevelopModifyorderVo.setTaskId(taskId);
// 设置待办用户
List<String> todoUserList = todoItemMapper.selectUndealTodoUserList(taskId);
if(!org.springframework.util.CollectionUtils.isEmpty(taskList)){
tempErpDevelopModifyorderVo.setTodoUserId(String.join(",",todoUserList));
}
if (task.getSuspensionState() == 2) {
tempErpDevelopModifyorderVo.setTaskName("已挂起");
tempErpDevelopModifyorderVo.setSuspendState("2");
} else {
tempErpDevelopModifyorderVo.setTaskName(task.getName());
tempErpDevelopModifyorderVo.setSuspendState("1");
}
} else {
// 已办结或者已撤销
tempErpDevelopModifyorderVo.setTaskName("已结束");
}
} else {
tempErpDevelopModifyorderVo.setTaskName("未启动");
}
returnList.add(tempErpDevelopModifyorderVo);
}
returnList.setTotal(org.springframework.util.CollectionUtils.isEmpty(list) ? 0 : list.getTotal());
returnList.setPageNum(pageNum);
returnList.setPageSize(pageSize);
return returnList;
}
/**
@ -237,6 +295,15 @@ public class ErpDevelopModifyorderServiceImpl implements IErpDevelopModifyorderS
}
/**
* 修改保存开发修改单详情
* */
@Override
public int detailErpDevelopModifyorder(ErpDevelopModifyorder erpDevelopModifyorder) {
return 1;
}
/**
* 创建售后单审核流程
* @param applyTitle

23
ruoyi-admin/src/main/resources/mapper/erp/ErpDevelopModifyorderMapper.xml

@ -45,21 +45,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectErpDevelopModifyorderVo">
select develop_order_id, develop_order_code, make_no, material_no, purchase_storage_status, quality_status, audit_status, complete_status, finsh_status, use_status, material_name, material_type, material_photo_url, material_unit, material_brand, material_describe, material_process_method, user_id, update_finish_time, before_update_remark, after_update_remark, create_by, create_time, user_name, update_by, update_time, remark, instance_id, instance_type, submit_instance_id, apply_title, apply_time, apply_user, cancel_instance_id, restore_instance_id from erp_develop_modifyorder
</sql>
</sql>
<select id="selectErpDevelopModifyorderList" parameterType="ErpDevelopModifyorder" resultMap="ErpDevelopModifyorderResult">
select edm.develop_order_id, edm.develop_order_code, edm.material_no, edm.purchase_storage_status, edm.quality_status, edm.audit_status, edm.complete_status, edm.finsh_status, edm.use_status, edm.material_name, edm.material_type, edm.material_photo_url, edm.material_unit, edm.material_brand, edm.material_describe, edm.material_process_method, edm.user_id, edm.create_by, edm.create_time, edm.update_by, edm.update_time, edm.remark,su.user_name
from erp_develop_modifyorder edm
left join sys_user su on su.user_id = edm.user_id
<select id="selectErpDevelopModifyorderList" parameterType="ErpDevelopModifyorderVo" resultMap="ErpDevelopModifyorderResult">
<include refid="selectErpDevelopModifyorderVo"/>
<where>
<if test="developOrderCode != null and developOrderCode != ''"> and edm.develop_order_code = #{developOrderCode}</if>
<if test="materialNo != null and materialNo != ''"> and edm.material_no = #{materialNo}</if>
<if test="auditStatus != null and auditStatus != ''"> and edm.audit_status = #{auditStatus}</if>
<if test="finshStatus != null and finshStatus != ''"> and edm.finsh_status = #{finshStatus}</if>
<if test="materialName != null and materialName != ''"> and edm.material_name like concat('%', #{materialName}, '%')</if>
<if test="userId != null "> and edm.user_id = #{userId}</if>
<if test="createTime != null "> and edm.create_time = #{createTime}</if>
<if test="developOrderCode != null and developOrderCode != ''"> and develop_order_code = #{developOrderCode}</if>
<if test="materialNo != null and materialNo != ''"> and material_no = #{materialNo}</if>
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if>
<if test="finshStatus != null and finshStatus != ''"> and finsh_status = #{finshStatus}</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
</where>
</select>

2
ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/add.html

@ -28,7 +28,7 @@
<div class="container">
<div class="form-row my-5"> <!-- 添加my-4类 -->
<div class="btn-group-sm" role="group">
<span>选择开发修改物料</span>
<span>选择开发修改物料</span>
<a class="btn btn-success" onclick="insertDevelopModify()">
<i class="fa fa-plus"></i> 添加修改物料
</a>

2
ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/confirm.html

@ -44,7 +44,7 @@
<div class="container">
<div class="form-row">
<div class="btn-group-sm" role="group">
<span>选择开发修改物料</span>
<span>选择开发修改物料</span>
<a class="btn btn-success" onclick="insertRow()">
<i class="fa fa-plus"></i> 添加修改物料
</a>

803
ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/detail.html

@ -1,7 +1,7 @@
<!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 :: select2-css" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: bootstrap-editable-css" />
@ -9,314 +9,492 @@
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-developModifyOrder-detail" th:object="${erpDevelopModifyorder}">
<input name="developOrderId" th:field="*{developOrderId}" type="hidden">
<input id="developOrderId" name="developOrderId" th:field="*{developOrderId}" type="text" hidden>
<input id="developOrderCode" name="developOrderCode" th:field="*{developOrderCode}" type="text" hidden>
<div class="form-group">
<label class="col-sm-3 control-label">开发修改单号:</label>
<label class="col-sm-4 control-label is-required">生产单号:</label>
<div class="col-sm-8">
<input name="developOderCode" th:field="*{developOderCode}" class="form-control" type="text">
<select class="form-control" th:field="*{makeNo}" id="makeNo" name="makeNo" required disabled>
<!-- 这里动态生成生产单号选项 -->
</select>
</div>
</div>
<div class="container">
<div class="row">
<div class="form-group">
<label class="col-sm-3 control-label is-required">生产单号:</label>
<div class="col-sm-8">
<select id="makeNo" name="developOderCode" class="form-control" type="text" required>
<option value="">请选择</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">修改完成时间:</label>
<div class="input-group date">
<input name="updateInfoTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
<div class="form-group">
<label class="col-sm-5 control-label is-required">修改完成时间:</label>
<div class="col-sm-7">
<div class="input-group date">
<input name="updateFinishTime" th:value="${#dates.format(erpDevelopModifyorder.updateFinishTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" disabled>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</form>
<div class="container">
<div class="form-row">
<div class="btn-group-sm" role="group">
<span>选择开发修改单物料</span>
<a class="btn btn-success" onclick="insertRow()">
<i class="fa fa-plus"></i> 添加修改物料
</a>
<div class="form-row my-5"> <!-- 添加my-4类 -->
<div class="btn-group-sm" role="group">
<span>选择开发修改物料</span>
</div>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-developModify"></table>
<table id="bootstrap-table-developModify"></table>
</div>
</div>
</div>
<div class="container">
<div class="form-row">
<div class="btn-group-sm" role="group">
<span>选择采购物料</span>
<a class="btn btn-success" onclick="insertRow2()">
<i class="fa fa-plus"></i> 添加修改物料
</a>
<div class="form-group">
<label class="col-sm-4 control-label is-required">修改前说明:</label>
<div class="col-sm-6">
<textarea id="beforeUpdateRemark" name="beforeUpdateRemark" class="form-control" required disabled>[[*{beforeUpdateRemark}]]</textarea>
</div>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-material"></table>
<div class="form-group">
<label class="col-sm-4 control-label is-required">修改后说明:</label>
<div class="col-sm-6">
<textarea id="afterUpdateRemark" name="afterUpdateRemark" class="form-control" required disabled>[[*{afterUpdateRemark}]]</textarea>
</div>
</div>
</div>
<div class="container">
<div class="form-row">
<div class="btn-group-sm" role="group">
<span>选择通知人</span>
<a class="btn btn-success" onclick="insertRow3()">
<i class="fa fa-plus"></i> 添加通知人
</a>
<div class="btn-group-sm" role="group">
<span>选择采购物料</span>
</div>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-biztoitem"></table>
<table id="bootstrap-table-purchase"></table>
</div>
</div>
</div>
<!-- <div class="container">-->
<!-- <div class="form-row">-->
<!-- <div class="btn-group-sm" role="group">-->
<!-- <span>选择通知人</span>-->
<!-- <a class="btn btn-success" onclick="insertBiztoitem()">-->
<!-- <i class="fa fa-plus"></i> 添加通知人-->
<!-- </a>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="row">-->
<!-- <div class="col-sm-12 select-table table-striped">-->
<!-- <table id="bootstrap-table-biztoitem"></table>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: bootstrap-table-editable-js" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: select2-js" />
<script th:inline="javascript">
var prefix = ctx + "erp/developModifyOrder";
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var levelDatas = [[${@dict.getType('bomLevel')}]];
var bomLevelSelectDatas = [[${@dict.getTypeSelect('bomLevel')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
var userName = [[${@permission.getPrincipalProperty('userName')}]];
var prefix = ctx + "erp/developModifyOrder";
$("#form-developModifyOrder-detail").validate({
focusCleanup: true
$("#form-developModifyOrder-detail").validate({ focusCleanup: true});
$("input[name='updateFinishTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$(function () {
$("#makeNo").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择生产单号",
ajax: {
url: ctx + "/system/makeorder/getAllMakeNos",
dataType: 'json',
type: "POST",
delay: 250,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.data;
console.log(resultList);
for(var i= 0, len=resultList.length;i<len;i++){
var option = resultList[i];
option.id = resultList[i]["makeNo"];
option.text = resultList[i]["makeNo"];
options.push(option);
}
}
return {
results: options
};
// 新增提交
function submitHandler() {
// 获取表单数据
const developModifyOrderData = $("#form-developModifyOrder-detail").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
var beforeUpdateRemark = $("#beforeUpdateRemark").val();
var afterUpdateRemark = $("#afterUpdateRemark").val();
// 开发修改物料
var developModifyTable = $('#bootstrap-table-developModify').bootstrapTable('getData');
// 采购修改物料
var purchaseTable = $('#bootstrap-table-purchase').bootstrapTable('getData');
// 将表数据转换成与developModifyOrderData格式一致的数组
var developModifyMaterialDataList = developModifyTable.map(function(item) {
// 根据实际字段名调整
return {
"materialNo": item.materialNo,
"materialName": item.materialName,
"materialType": item.materialType,
"materialPhotourl": item.materialPhotourl,
"materialDescribe": item.materialDescribe,
"materialBrand": item.materialBrand,
"materialUnit": item.materialUnit,
"materialProcessMethod": item.materialProcessMethod,
// ...其他字段
};
});
// 将表数据转换成与developModifyOrderData格式一致的数组
var purchaseMaterialDataList = purchaseTable.map(function(item) {
// 根据实际字段名调整
return {
"developOrderDetailId":item.developOrderDetailId,
"materialNo": item.materialNo,
"materialName": item.materialName,
"materialType": item.materialType,
"materialPhotourl": item.materialPhotourl,
"materialDescribe": item.materialDescribe,
"materialBrand": item.materialBrand,
"materialUnit": item.materialUnit,
"materialProcessMethod": item.materialProcessMethod,
"bomId":item.bomId,
"materialNum":item.materialNum
// ...其他字段
};
});
const combinedData = Object.assign({}, developModifyOrderData, {
developModifyorderMaterialVoList: developModifyMaterialDataList,
developModifyorderDetailList:purchaseMaterialDataList,
beforeUpdateRemark:beforeUpdateRemark,
afterUpdateRemark:afterUpdateRemark
});
// 合并表单数据和表格数据
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/detail", jsonData);
}
/*加载所有的关联生产单号*/
loadAllMakeNos();
/*加载所有的关联生产单号*/
function loadAllMakeNos(){
var url = ctx + 'system/makeorder/getAllMakeNos';
$.ajax({
type:'GET',//请求类型
url:url,//后端接口url
dataType:'json', //预期服务器返回数据类型
success: function (data){
if (data && Array.isArray(data)){
var selectElement = $('#makeNo'); //获取生产编号下拉框元素
//清空下拉框现有选项
selectElement.empty();
//遍历返回的数据,添加下拉框的选项
$.each(data,function (index,item){
//赋值遍历数据中的makeNo到下拉框中
selectElement.append('<option value="'+item.makeNo+'">'+item.makeNo+'</option>');
})
}else {
$.modal.error("数据为空");
}
}
});
})
}
// 点击选择物料按钮
function insertDevelopModify() {
var selectedMakeNo = $("#makeNo").val();
if (!selectedMakeNo) {
$.modal.alertWarning("请先选择生产单号。");
return;
}
var encodedMakeNo = encodeURIComponent(selectedMakeNo);
var url = prefix + '/developModifyMaterialSelect?makeNo=' + encodedMakeNo;
var options = {
id: "bootstrap-sub-table-developModify",
// url: prefix + "/getDevelopModifyOrderList",
title: '选择物料',
url: url,
callBack: developModifyDoSubmit
};
$.modal.openOptions(options);
}
//物料信息展示列表
$(function() {
var options = {
id:'bootstrap-table-developModify',
url: prefix+'/getDevelopModifyMaterialById',
queryParams: developModifyQueryParams,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
columns: [
{checkbox: true},
{field: 'index',align: 'center', title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
return columnIndex + $.table.serialNumber(index);
}
pagination: false, // 设置不分页
modalName: "选择物料",
columns: [{
checkbox: true
},
{
title: '料号',
field: 'materialNo',
},
{title: '物料索引id',field: 'materialId',align: 'center',visible: false},
{title: '料号',field: 'materialCode',align: 'center'},
{title: '物料名称',field: 'materialName',align: 'center'},
{title: '图片',field: 'photoUrl',
formatter: function(value, row, index) {
if(value == null || value == ""){
value = "";
return "<img src='' herf='' />";
}
return $.table.imageView(value);
}
{
title: '图片',
field: 'materialPhotourl',
},
{title: '物料类型',field: 'materialType',align: 'center',
{
title: '物料名称',
field: 'materialName',
},
{
title: '物料类型',
field: 'materialType',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{ title: '描述',field: 'describe',align: 'center'},
{title: '品牌',field: 'brand',align: 'center'},
{ title: '单位',field: 'unit',align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(sysUnitClassDatas, value);
}
{
title: '品牌',
field: 'materialBrand',
},
{
title: '描述',
field: 'materialDescribe',
},
{
title: '单位',
field: 'materialUnit',
},
{title: '半成品类型',field: 'processMethod',align: 'center',
{
field: 'materialProcessMethod',
align: 'center',
title: '物料加工方式',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{ title: '对外售价',field: 'materialSole',},
{title: '国内税率',field: 'countTax',align: 'center',},
{ title: '美元汇率',field: 'usdTax', align: 'center',},
{field: 'materialNum',align: 'center',title: '物料的数量',},
{ title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',},
{title: '物料的不含税单价(美元)',field: 'materialNoUsd',align: 'center',},
{title: '修改详情',align: 'center',
formatter:function formatterForm(value, row, index) {
// 这里的代码会为每行生成一个表单
var form = $('<form></form>').append(
$('<input/>', { type: 'text', value: row.name, name: 'name', placeholder: 'Name' }),
$('<input/>', { type: 'email', value: row.email, name: 'email', placeholder: 'Email' }),
$('<button/>', { type: 'submit' }).text('Submit')
);
form.on('submit', function(e) {
e.preventDefault(); // 阻止表单默认提交行为
var formData = form.serializeArray(); // 序列化表单数据为数组
console.log(formData); // 在控制台输出表单数据
// 这里可以添加代码处理表单提交,例如发送到服务器等
});
return form; // 返回生成的表单HTML
}},
]
};
$.table.init(options);
})
function developModifyQueryParams(params) {
var curParams = {
// 传递参数查询参数
developOrderId: $("#developOrderId").val()
};
console.log(curParams);
return curParams;
}
var option1 = {
id: "bootstrap-sub-table-material",
// url: prefix + "/list",
function developModifyDoSubmit(index, layero,uniqueId){
console.log(uniqueId);
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-developModifyMaterialSelect-table').bootstrapTable('getSelections')[0];
//判断是否重复
var rows = $("#bootstrap-table-developModify").bootstrapTable('getData').length;
if (rows > 0){
$.modal.alertError("每次只能修改一条物料!");
return;
}
// for(var i=0;i<rows;i++){
// var data = $("#bootstrap-table-developModify").bootstrapTable('getData')[i];
// if(data.materialNo==rowData.materialNo){
// $.modal.alertError("不能选择已添加过的相同物料");
// return;
// }
// }
console.log("rowData: "+rowData);
$("#bootstrap-table-developModify").bootstrapTable('insertRow', {
index:1,
row: {
materialNo:rowData.materialCode,
materialPhotourl:rowData.photoUrl,
materialName: rowData.materialName,
materialType: rowData.materialType,
materialDescribe: rowData.describe,
materialBrand: rowData.brand,
materialUnit: rowData.unit,
materialProcessMethod: rowData.processMethod,
}
})
layer.close(index);
}
// 逻辑删除前端的一行数据
function removeDevelopModify(materialNo){
$("#bootstrap-table-developModify").bootstrapTable('remove', {
field: 'materialNo',
values: materialNo
})
}
// 点击选择采购物料按钮
function insertPurchase() {
var url = prefix + '/purchaseMaterialSelect';
var options = {
title: '选择物料',
url: url,
callBack: purchaseDoSubmit
};
$.modal.openOptions(options);
}
// 选择采购物料
$(function(){
var options = {
id: 'bootstrap-table-purchase',
url: prefix+'/getDevelopModifyDetailMaterialByCode',
queryParams: purchaseQueryParams,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
modalName: "bom",
uniqueId: "id",
pagination: false, // 设置不分页
sidePagination: "client",
detailView: true,
height: $(window).height() - 100,
//指定父id列
onExpandRow : function(index, row, $detail) {
$detail.html('<table class="table-container" id="all_level_table_'+row.id+'"></table>').find('table');
// 多阶
initAllLevelTable(index,row,$detail);
// $.table.bootstrapTable('resetView');
initChildTable(index, row, $detail);
},
columns: [
{checkbox: false},
{title: 'bom号',field: 'bomNo', },
{title: '关联料号',field: 'materialNo', },
{field: 'photoUrl',title: '图片',formatter: function(value, row, index) {return $.table.imageView(value);}},
{title: '物料名称',field: 'materialName', },
{field: 'materialType',title: '物料类型',formatter: function(value, row, index) { return $.table.selectCategoryLabel(materialTypeDatas, value);}},
{field: 'processMethod', title: '半成品类型',formatter: function(value, row, index) {return $.table.selectDictLabel(processMethodDatas, value);}},
{field: 'unit',title: '单位',},
{ title: '品牌',field: 'brand', },
{title: '描述',field: 'describe'},
{field: 'num',title: '订单数量',},
{field: 'parentId',title: '父级id',visible:false},
{title: '操作',align: 'center',
{
field: 'developOrderDetailId',
title: '主键id',
visible: false
},
{
field: 'bomId',
title: 'bom主键Id',
},
{
field: 'materialNo',
align: 'center',
title: '料号'
},
{
field: 'materialName',
align: 'center',
title: '物料名称',
},
{
field: 'materialType',
align: 'center',
title: '物料类型',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="remove(\'' + row.id + '\')"><i class="fa fa-eye"></i> 删除</a> ');
return actions.join('');
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
}]
};
$.table.init(option1);
var option2 = {
id: "bootstrap-sub-table-biztoitem",
// url: prefix + "/list",
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
modalName: "通知人",
detailView: true,
height: $(window).height() - 100,
//指定父id列
columns: [
{checkbox: false},
{title: '通知人',field: 'item', },
{title: '确认时间',field: 'materialNo', },
{title: '操作',align: 'center',
},
{
field: 'materialUnit',
align: 'center',
title: '单位',
formatter: function(value, row, index) {
return $.table.selectDictLabel(sysUnitClassDatas, value);
}
},
{
field: 'materialBrand',
align: 'center',
title: '品牌'
},
{
field: 'materialDescribe',
align: 'center',
title: '描述'
},
{
field: 'materialProcessMethod',
align: 'center',
title: '物料加工方式',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="remove(\'' + row.id + '\')"><i class="fa fa-eye"></i> 删除</a> ');
return actions.join('');
return $.table.selectDictLabel(processMethodDatas, value);
}
}]
},
{
field: 'materialNum',
align: 'center',
title: '订单数量',
},
]
};
$.table.init(option2);
$.table.init(options);
})
initAllLevelTable = function(index, row, $detail) {
$("#"+"all_level_table_"+row.id).bootstrapTable({
url: prefix + "/allLevelList",
initChildTable = function(index, row, $detail) {
var parentRow = row;
var parentRowIndex = index;
var childTableId = 'child_table_' + index;
var childFormTableId = 'child_form_table_' + index;
var childTableFormId = 'child_table_form_' + index;
// $detail.html('<form id="'+childTableFormId+'"><table id="'+childTableId+'"></table><table id="'+childFormTableId+'"></table></form>');
$detail.html('<table id="' + childTableId + '"></table><table id="' + childFormTableId + '"></table>');
// BOM展示
$('#' + childTableId).bootstrapTable({
url: ctx + "erp/bom/allLevelList",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {
parentId: row.id
queryParams: {
parentId: parentRow.bomId
},
columns: [{
field: 'id',
title: '主键id'
title: '主键id',
visible: false
},
{
field: 'level',
title: '层',
formatter: function(value, row, index) {
title: '层',
formatter: function (value, row, index) {
return $.table.selectDictLabel(levelDatas, value);
}
},
{
field: 'bomNo',
title: 'bom号',
formatter:function (value,row,index){
if (value == null || value == ''){
title: 'BOM号',
formatter: function (value, row, index) {
if (value == null || value == '') {
return '/';
}else{
} else {
return value
}
}
},
{
field: 'photoUrl',
title: '图片',
formatter: function(value, row, index) {
return $.table.imageView(value);
}
},
{
field: 'materialNo',
title: '料号',
formatter: function (value,row,index){
if (value == null || value == ''){
formatter: function (value, row, index) {
if (value == null || value == '') {
return '/';
}else{
} else {
return value
}
}
},
{
field: 'photoUrl',
title: '图片',
formatter: function (value, row, index) {
return $.table.imageView(value);
}
},
{
field: 'materialName',
title: '物料名称',
formatter: function (value,row,index){
if (value == null || value == ''){
formatter: function (value, row, index) {
if (value == null || value == '') {
return '/';
}else{
} else {
return value
}
}
@ -324,29 +502,28 @@
{
field: 'materialType',
title: '物料类型',
formatter: function(value, row, index) {
formatter: function (value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
field: 'describe',
title: '描述',
formatter: function (value,row,index){
if (value == null || value == ''){
formatter: function (value, row, index) {
if (value == null || value == '') {
return '/';
}else{
} else {
return value
}
}
},
{
field: 'brand',
title: '品牌',
formatter: function (value,row,index){
if (value == null || value == ''){
formatter: function (value, row, index) {
if (value == null || value == '') {
return '/';
}else{
} else {
return value
}
}
@ -354,21 +531,37 @@
{
field: 'unit',
title: '单位',
formatter: function (value,row,index){
if (value == null || value == ''){
formatter: function (value, row, index) {
if (value == null || value == '') {
return '/';
}else{
} else {
return value
}
}
},
{
field: 'processMethod',
title: '加工方式',
formatter: function (value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
field: 'warehouseDept',
align: 'center',
title: '入库部门', visible: false,
formatter: function (value, row, index) {
return $.table.selectDictLabel(warehouseDates, value);
}
},
{
field: 'useNum',
title: '用量',
formatter: function (value,row,index){
if (value == null || value == ''){
formatter: function (value, row, index) {
if (value == null || value == '') {
return '/';
}else{
} else {
return value
}
}
@ -376,18 +569,28 @@
{
field: 'lossRate',
title: '损耗率',
formatter: function (value,row,index){
if (value == null || value == ''){
return "/";
}
return value + "%";
}
// formatter: function (value,row,index){
// if (value == null || value == ''){
// return '/';
// }else{
// return value + "%";
// }
// }
},
{
field: 'processMethod',
title: '半成品类型',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
field: 'materialNum',
title: '订单用量',
formatter: function (value, row, index) {
// 获取父行的materialNum值,如果不存在则为0
var materialNum = parentRow.materialNum || 0;
// 获取当前行的useNum值,如果不存在则为0
var useNum = row.useNum || 0;
// 计算结果
var result = materialNum * useNum;
// 如果result为0且materialNum或useNum为null/undefined,则返回空字符串
return (materialNum === 0 || useNum === 0) && (parentRow.materialNum === null || row.useNum === null) ? '' : result;
}
},
{
@ -399,126 +602,72 @@
field: 'sortNo',
title: '排序',
visible: false
}]
});
};
initChildSonTable = function(index, row, $detail) {
var childSonTable = $detail.html('<table style="table-layout:fixed"></table>').find('table');
$(childSonTable).bootstrapTable({
url: prefix + "/subList",
method: 'post',
detailView: true,
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {parentId: row.id},
onExpandRow : function(index, row, $detail) {initChildSonTable(index, row, $detail);},
columns: [
{field: 'id',title: '主键id'},
{field: 'level',title: '层级',formatter: function(value, row, index) {return $.table.selectDictLabel(levelDatas, value);}},
{field: 'bomNo',title: 'bom号',formatter:function (value,row,index){if (value == null || value == ''){return '/'; }else{ return value;}}},
{field: 'photoUrl',title: '图片',formatter:function (value,row,index){if (value == null || value == ''){ return '/';}else{return $.table.imageView(value);}}},
{field: 'materialNo',title: '料号',},
{field: 'materialName',title: '物料名称',},
{field: 'materialType',title: '物料类型',formatter: function(value, row, index) {return $.table.selectCategoryLabel(materialTypeDatas, value);}},
{field: 'describe',title: '描述',},
{field: 'brand',title: '品牌',},
{field: 'unit',title: '单位',},
{field: 'lossRate',title: '损耗率(%)',formatter:function (value,row,index){return value + '%';}},
{field: 'processMethod',title: '半成品类型',formatter: function(value, row, index) {return $.table.selectDictLabel(processMethodDatas, value);}},
{field: 'useNum',title: '订单用量',},
{field: 'parentId',title: '父级id',visible: false,},
]
});
}
}],
// 当所有数据被加载时触发
onLoadSuccess: function (data) {
function insertRow() {
var url = ctx + "system/makeorder/selectMakeorder";
var options = {
title: '选择生产物料',
url: url,
data: {
"materialType": $("#makeNo").val()
},
callBack: doSubmit
};
$.modal.openOptions(options);
});
}
function insertRow2() {
var url = ctx + "erp/material/select";
var options = {
title: '选择料号',
url: url,
callBack: doSubmit2
function purchaseQueryParams(params) {
var curParams = {
// 传递参数查询参数
developOrderCode: $("#developOrderCode").val()
};
$.modal.openOptions(options);
console.log(curParams);
return curParams;
}
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];
var totalNum = $("#bootstrap-sub-table-developModify").bootstrapTable('getData').length;
console.log("rowData: "+rowData);
$("#bootstrap-sub-table-developModify").bootstrapTable('insertRow',{
index: 1,
row: {
id:rowData.id,
bomNo:rowData.bomNo,
materialNo: rowData.materialNo,
materialName: rowData.materialName,
materialType: rowData.materialType,
describe: rowData.describe,
processMethod: rowData.processMethod,
unit: rowData.unit,
brand: rowData.brand,
level: "1",
lossRate:'',
useNum:''
}
})
layer.close(index);
}
function doSubmit2(index, layero,uniqueId){
function purchaseDoSubmit(index, layero,uniqueId){
console.log(uniqueId);
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0];
var totalNum = $("#bootstrap-sub-table-material").bootstrapTable('getData').length;
var rowData = iframeWin.$('#bootstrap-purchaseMaterialSelect-table').bootstrapTable('getSelections')[0];
//判断是否重复
var rows = $("#bootstrap-table-purchase").bootstrapTable('getData').length;
if (rows > 0){
$.modal.alertError("每次只能修改一条物料!");
return;
}
// for(var i=0;i<rows;i++){
// var data = $("#bootstrap-table-developModify").bootstrapTable('getData')[i];
// if(data.materialNo==rowData.materialNo){
// $.modal.alertError("不能选择已添加过的相同物料");
// return;
// }
// }
console.log("rowData: "+rowData);
$("#bootstrap-sub-table-material").bootstrapTable('insertRow',{
index: 1,
$("#bootstrap-table-purchase").bootstrapTable('insertRow', {
index:1,
row: {
id:rowData.id,
bomNo:rowData.bomNo,
materialNo: rowData.materialNo,
bomId:rowData.bomId,
materialNo:rowData.materialNo,
materialPhotourl:rowData.materialPhotourl,
materialName: rowData.materialName,
materialType: rowData.materialType,
describe: rowData.describe,
processMethod: rowData.processMethod,
unit: rowData.unit,
brand: rowData.brand,
level: "1",
lossRate:'',
useNum:''
materialDescribe: rowData.describe,
materialBrand: rowData.brand,
materialUnit: rowData.unit,
materialProcessMethod:rowData.processMethod,
materialNum:'0'
}
})
layer.close(index);
}
function remove(id){
$("#bootstrap-sub-table-developModify").bootstrapTable('remove', {
field: 'id',
values: id
})
}
function removeRow(id){
$("#bootstrap-sub-table-material").bootstrapTable('remove', {
field: 'id',
values: id
// 逻辑删除前端的一行数据
function removePurchase(materialNo){
$("#bootstrap-table-purchase").bootstrapTable('remove', {
field: 'materialNo',
values: materialNo
})
}
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/detail", $('#form-developModifyOrder-detail').serialize());
}
}
</script>
</body>
</html>

129
ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/developModifyOrder.html

@ -66,6 +66,7 @@
</div>
</div>
<th:block th:include="include :: footer" />
<script th:src="@{/js/activiti.js}"></script>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('erp:developModifyOrder:edit')}]];
var detailFlag = [[${@permission.hasPermi('erp:developModifyOrder:detail')}]];
@ -83,6 +84,9 @@
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
var prefix = ctx + "erp/developModifyOrder";
$(function() {
var options = {
@ -98,7 +102,68 @@
columns: [
{checkbox: true},
{title: '开发修改单ID',field: 'developOrderId',visible: false},
{title: '审核状态',field: 'auditStatus',
{
field: 'instanceId',
title: '流程实例ID',
visible: false
},
{
field: 'submitInstanceId',
title: '流程提交实例ID',
visible: false
},
{
field: 'cancelInstanceId',
title: '流程作废实例ID',
visible: false
},
{
field: 'restoreInstanceId',
title: '流程恢复实例ID',
visible: false
},
{
field: 'instanceTypeName',
title: '流程实例类型',
visible: false
},
{
field: 'applyUser',
title: '申请人ID',
visible: false
},
{
field: 'applyUserName',
title: '<span style="color: red;">申请人</span>',
formatter: function(value, row, index) {
return '<span style="color: red;">' + (value ? value : "-") + '</span>';
}
},
{
field: 'applyTime',
title: '申请时间'
},
{
field: 'taskId',
title: '当前任务ID',
visible: false
},
{
field: 'todoUserId',
title: '待办用户ID',
visible: false
},
{
field: 'taskName',
title: '当前任务名称',
align: 'center',
formatter: function(value, row, index) {
return '<span class="badge badge-primary">' + value + '</span>';
}
},
{
title: '审核状态',
field: 'auditStatus',
formatter: function (value, row, index) {
return $.table.selectDictLabel(auditStatusDatas, value);
}
@ -113,7 +178,7 @@
return $.table.selectDictLabel(completeStatusDatas, value);
}
},
{title: '开发修改单号',field: 'developOderCode',},
{title: '开发修改单号',field: 'developOrderCode',},
{title: '采购入库状态',field: 'purchaseStorageStatus',
formatter: function (value, row, index) {
return $.table.selectDictLabel(purchaseStorageStatusDatas, value);
@ -145,21 +210,51 @@
{title: '录入时间',field: 'createTime',},
{title: '更新人',field: 'updateBy',},
{title: '上次更新时间',field: 'updateTime',},
{title: '操作',align: 'center',
// {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.developOrderId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
// actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.developOrderId + '\')"><i class="fa fa-edit"></i>详情</a> ');
// actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="readConfirm(\'' + row.developOrderId + '\')"><i class="fa fa-window-restore"></i>确认</a> ');
// actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="pickingOrder(\'' + row.developOrderId + '\')"><i class="fa fa-window-restore"></i>领料</a> ');
// if(row.delFlag == '0'){
// actions.push('<a class="btn btn-danger btn-xs ' + cancelFlag + '" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i>作废</a> ');
// }else{
// actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.id + '\')"><i class="fa fa-window-restore"></i>恢复</a> ');
// }
// if(row.auditStatus == '2' && row.purchaseStorageStatus == '3' ||row.purchaseStorageStatus == '4'){
// actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="readConfirm(\'' + row.developOrderId + '\')"><i class="fa fa-window-restore"></i>确认</a> ');
// }
// return actions.join('');
// }
// }
{
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.developOrderId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.developOrderId + '\')"><i class="fa fa-edit"></i>详情</a> ');
actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="readConfirm(\'' + row.developOrderId + '\')"><i class="fa fa-window-restore"></i>确认</a> ');
actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="pickingOrder(\'' + row.developOrderId + '\')"><i class="fa fa-window-restore"></i>领料</a> ');
if(row.delFlag == '0'){
actions.push('<a class="btn btn-danger btn-xs ' + cancelFlag + '" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i>作废</a> ');
}else{
actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.id + '\')"><i class="fa fa-window-restore"></i>恢复</a> ');
// 审核状态-审核通过
if(row.auditStatus=="1"){
// 编辑
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.developOrderId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
}
if(row.auditStatus == '2' && row.purchaseStorageStatus == '3' ||row.purchaseStorageStatus == '4'){
actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="readConfirm(\'' + row.developOrderId + '\')"><i class="fa fa-window-restore"></i>确认</a> ');
// 有流程实例id
if (row.instanceId) {
// 有待办人展示审批按钮,
if (row.todoUserId) {
var todoUserIdList = row.todoUserId.split(",");
if(todoUserIdList.includes(loginName) || loginName == 'admin'){
var nodeName = row.taskName=='驳回调整'?' 调整申请':' 审批';
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="showVerifyDialog(\'' + prefix + '\',\'' + row.taskId + '\', \'' + row.taskName+"-"+"申请" + '\')"><i class="fa fa-edit"></i> '+nodeName+'</a> ');
}
}
// 审批历史
actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="showHistoryDialog(\'' + row.instanceId + '\')"><i class="fa fa-list"></i> 审批历史</a> ');
// 进度查看
actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="showProcessImgDialog(\'' + row.instanceId + '\')"><i class="fa fa-image"></i> 进度查看</a> ');
}
// 详情
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="detail(\'' + row.developOrderId + '\')"><i class="fa fa-edit"></i>详情</a> ');
return actions.join('');
}
}
@ -167,6 +262,14 @@
};
$.table.init(options);
});
//开发修改单详情
function detail(developOrderId){
var url = prefix + '/detail/' +developOrderId;
$.modal.open("详情",url);
}
function readConfirm(developOrderId){
var options = {
title: '相关人员确认',

2
ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/edit.html

@ -34,7 +34,7 @@
<div class="container">
<div class="form-row my-5"> <!-- 添加my-4类 -->
<div class="btn-group-sm" role="group">
<span>选择开发修改物料</span>
<span>选择开发修改物料</span>
<a class="btn btn-success" onclick="insertDevelopModify()">
<i class="fa fa-plus"></i> 添加修改物料
</a>

Loading…
Cancel
Save