Compare commits
8 Commits
27c2ed898c
...
031725de7e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
031725de7e | ||
|
|
cd3194d1a6 | ||
| 0e6eba8cf4 | |||
| 34b6ed4478 | |||
| b86c94add9 | |||
| 84286a6769 | |||
| 9fe1da209d | |||
| d57cb6cb8c |
10
.gitignore
vendored
10
.gitignore
vendored
@@ -1,10 +1,20 @@
|
||||
## ide
|
||||
**/.idea
|
||||
**/.project
|
||||
**/.classpath
|
||||
**/.factorypath
|
||||
**/.settings/
|
||||
*.iml
|
||||
rebel.xml
|
||||
.project
|
||||
.classpath
|
||||
.settings/
|
||||
.factorypath
|
||||
**/.settings/
|
||||
|
||||
## backend
|
||||
**/target
|
||||
**/bin/
|
||||
**/logs
|
||||
|
||||
## front
|
||||
|
||||
6
jeecg-boot/.gitignore
vendored
6
jeecg-boot/.gitignore
vendored
@@ -2,6 +2,12 @@
|
||||
**/.idea
|
||||
*.iml
|
||||
rebel.xml
|
||||
# VS Code/Cursor Java 扩展(Eclipse JDT)导入 Maven 时自动生成,勿提交
|
||||
.project
|
||||
.classpath
|
||||
.settings/
|
||||
.factorypath
|
||||
**/.settings/
|
||||
|
||||
## backend
|
||||
**/target
|
||||
|
||||
@@ -11,9 +11,9 @@ menu_type=VALUES(menu_type), perms=VALUES(perms), perms_type=VALUES(perms_type),
|
||||
is_route=VALUES(is_route), is_leaf=VALUES(is_leaf), hidden=VALUES(hidden), status=VALUES(status), del_flag=VALUES(del_flag),
|
||||
always_show=VALUES(always_show), keep_alive=VALUES(keep_alive), internal_or_external=VALUES(internal_or_external);
|
||||
|
||||
-- 二级菜单:物料信息
|
||||
-- 二级菜单:胶料信息
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, menu_type, perms, perms_type, sort_no, is_route, is_leaf, hidden, status, del_flag, keep_alive, internal_or_external, create_by, create_time)
|
||||
VALUES ('1860000000000000011', '1860000000000000001', '物料信息', '/mes/materialinfo', 'mes/materialinfo/index', 'MesMaterialList', 1, NULL, '1', 1, 1, 1, 0, '1', 0, 1, 0, 'admin', NOW())
|
||||
VALUES ('1860000000000000011', '1860000000000000001', '胶料信息', '/mes/materialinfo', 'mes/materialinfo/index', 'MesMaterialList', 1, NULL, '1', 1, 1, 1, 0, '1', 0, 1, 0, 'admin', NOW())
|
||||
ON DUPLICATE KEY UPDATE
|
||||
parent_id=VALUES(parent_id), name=VALUES(name), url=VALUES(url), component=VALUES(component), component_name=VALUES(component_name),
|
||||
menu_type=VALUES(menu_type), perms=VALUES(perms), perms_type=VALUES(perms_type), sort_no=VALUES(sort_no),
|
||||
|
||||
118
jeecg-boot/db/mes-xsl-inspect-maintain-item-menu-permission.sql
Normal file
118
jeecg-boot/db/mes-xsl-inspect-maintain-item-menu-permission.sql
Normal file
@@ -0,0 +1,118 @@
|
||||
-- MES 点检及保养项目:字典 + 建表 + 菜单 + 按钮 + 租户 admin 授权(可整文件一次执行)
|
||||
-- 权限前缀与 Controller、前端 v-auth 一致:mes:mes_xsl_inspect_maintain_item:*
|
||||
-- 父菜单:设备管理;修改租户改 SET @mes_tenant_id
|
||||
-- 新环境也可依赖 Flyway:V3.9.2_77__mes_xsl_inspect_maintain_item.sql
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
SELECT REPLACE(UUID(), '-', ''), 'MES点检保养项目类别', 'xslmes_im_item_category', 'inspect点检/maintain保养', 0, 'admin', NOW(), 0, 0
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_im_item_category' AND `del_flag` = 0);
|
||||
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '点检', 'inspect', 1, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_im_item_category' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'inspect');
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '保养', 'maintain', 2, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_im_item_category' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'maintain');
|
||||
|
||||
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
SELECT REPLACE(UUID(), '-', ''), 'MES点检保养项目类型', 'xslmes_im_item_type', 'mechanical机械类/electrical电气类', 0, 'admin', NOW(), 0, 0
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_im_item_type' AND `del_flag` = 0);
|
||||
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '机械类', 'mechanical', 1, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_im_item_type' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'mechanical');
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '电气类', 'electrical', 2, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_im_item_type' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'electrical');
|
||||
|
||||
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
SELECT REPLACE(UUID(), '-', ''), 'MES点检方式', 'xslmes_im_inspect_method', 'visual视觉/sight目测/hearing听觉', 0, 'admin', NOW(), 0, 0
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_im_inspect_method' AND `del_flag` = 0);
|
||||
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '视觉', 'visual', 1, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_im_inspect_method' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'visual');
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '目测', 'sight', 2, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_im_inspect_method' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'sight');
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '听觉', 'hearing', 3, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_im_inspect_method' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'hearing');
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mes_xsl_inspect_maintain_item` (
|
||||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||||
`item_name` varchar(500) NOT NULL COMMENT '项目名称(同租户未删除数据中唯一)',
|
||||
`item_code` varchar(500) NOT NULL COMMENT '项目编号(同租户未删除数据中唯一)',
|
||||
`equipment_category_id` varchar(32) NOT NULL COMMENT '设备类别主键 mes_xsl_equipment_category.id',
|
||||
`equipment_category_name` varchar(500) DEFAULT NULL COMMENT '设备类别名称冗余',
|
||||
`equipment_type_id` varchar(32) NOT NULL COMMENT '设备类型主键 mes_xsl_equipment_type.id',
|
||||
`equipment_type_name` varchar(500) DEFAULT NULL COMMENT '设备类型名称冗余',
|
||||
`equipment_part_id` varchar(32) NOT NULL COMMENT '设备部位主键 mes_xsl_equipment_part.id',
|
||||
`equipment_part_name` varchar(500) DEFAULT NULL COMMENT '设备部位名称冗余',
|
||||
`equipment_sub_part_id` varchar(32) NOT NULL COMMENT '设备小部位主键 mes_xsl_equipment_sub_part.id',
|
||||
`equipment_sub_part_name` varchar(500) DEFAULT NULL COMMENT '设备小部位名称冗余',
|
||||
`item_category` varchar(500) NOT NULL COMMENT '项目类别(字典xslmes_im_item_category:inspect点检/maintain保养)',
|
||||
`item_type` varchar(500) NOT NULL COMMENT '项目类型(字典xslmes_im_item_type:mechanical机械类/electrical电气类)',
|
||||
`inspect_method` varchar(500) NOT NULL COMMENT '点检方式(字典xslmes_im_inspect_method:visual视觉/sight目测/hearing听觉)',
|
||||
`judgment_criteria` varchar(500) NOT NULL COMMENT '判断基准',
|
||||
`maintain_cycle_days` int DEFAULT NULL COMMENT '保养周期(天)',
|
||||
`tenant_id` int DEFAULT NULL COMMENT '租户',
|
||||
`sys_org_code` varchar(500) DEFAULT NULL COMMENT '部门',
|
||||
`create_by` varchar(500) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(500) DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`del_flag` int DEFAULT '0' COMMENT '删除标记(0正常1删除)',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_mimi_tenant_name` (`tenant_id`, `item_name`),
|
||||
KEY `idx_mimi_tenant_code` (`tenant_id`, `item_code`),
|
||||
KEY `idx_mimi_category` (`equipment_category_id`),
|
||||
KEY `idx_mimi_type` (`equipment_type_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES点检及保养项目';
|
||||
|
||||
SET @mes_tenant_id = 1002;
|
||||
|
||||
SET @mes_equip_pid = (
|
||||
SELECT `id` FROM `sys_permission`
|
||||
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '设备管理'
|
||||
LIMIT 1
|
||||
);
|
||||
SET @mes_equip_pid = IFNULL(@mes_equip_pid, '1860000000000000133');
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `keep_alive`, `internal_or_external`, `create_by`, `create_time`)
|
||||
VALUES ('1860000000000000141', @mes_equip_pid, '点检及保养项目', '/xslmes/mesXslInspectMaintainItem', 'xslmes/mesXslInspectMaintainItem/MesXslInspectMaintainItemList', NULL, 1, NULL, '1', 11, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW())
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `url` = VALUES(`url`), `component` = VALUES(`component`), `component_name` = VALUES(`component_name`),
|
||||
`menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`), `sort_no` = VALUES(`sort_no`),
|
||||
`is_route` = VALUES(`is_route`), `is_leaf` = VALUES(`is_leaf`), `hidden` = VALUES(`hidden`), `status` = VALUES(`status`), `del_flag` = VALUES(`del_flag`),
|
||||
`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`), `icon` = 'ant-design:audit-outlined';
|
||||
|
||||
UPDATE `sys_permission` SET `icon` = 'ant-design:audit-outlined' WHERE `id` = '1860000000000000141' AND `del_flag` = 0;
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `status`, `del_flag`, `create_by`, `create_time`) VALUES
|
||||
('1860000000000000142', '1860000000000000141', '新增', 2, 'mes:mes_xsl_inspect_maintain_item:add', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000143', '1860000000000000141', '编辑', 2, 'mes:mes_xsl_inspect_maintain_item:edit', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000144', '1860000000000000141', '删除', 2, 'mes:mes_xsl_inspect_maintain_item:delete', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000145', '1860000000000000141', '批量删除', 2, 'mes:mes_xsl_inspect_maintain_item:deleteBatch', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000146', '1860000000000000141', '导出', 2, 'mes:mes_xsl_inspect_maintain_item:exportXls', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000147', '1860000000000000141', '导入', 2, 'mes:mes_xsl_inspect_maintain_item:importExcel', '1', '1', 0, 'admin', NOW())
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`),
|
||||
`status` = VALUES(`status`), `del_flag` = VALUES(`del_flag`);
|
||||
|
||||
INSERT INTO `sys_role_permission`(`id`, `role_id`, `permission_id`, `operate_date`, `operate_ip`)
|
||||
SELECT REPLACE(UUID(), '-', ''), r.`id`, p.`id`, NOW(), '127.0.0.1'
|
||||
FROM `sys_role` r
|
||||
CROSS JOIN `sys_permission` p
|
||||
WHERE r.`tenant_id` = @mes_tenant_id
|
||||
AND r.`role_code` = 'admin'
|
||||
AND p.`id` IN (
|
||||
'1860000000000000141',
|
||||
'1860000000000000142', '1860000000000000143', '1860000000000000144', '1860000000000000145',
|
||||
'1860000000000000146', '1860000000000000147'
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id`
|
||||
);
|
||||
@@ -0,0 +1,301 @@
|
||||
package org.jeecg.modules.xslmes.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentCategory;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentPart;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentSubPart;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentType;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslInspectMaintainItem;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentCategoryService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentPartService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentSubPartService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentTypeService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslInspectMaintainItemService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* MES 点检及保养项目
|
||||
*/
|
||||
@Tag(name = "MES点检及保养项目")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslInspectMaintainItem")
|
||||
@Slf4j
|
||||
public class MesXslInspectMaintainItemController
|
||||
extends JeecgController<MesXslInspectMaintainItem, IMesXslInspectMaintainItemService> {
|
||||
|
||||
private static final Set<String> ITEM_CATEGORY = Set.of("inspect", "maintain");
|
||||
private static final Set<String> ITEM_TYPE = Set.of("mechanical", "electrical");
|
||||
private static final Set<String> INSPECT_METHOD = Set.of("visual", "sight", "hearing");
|
||||
|
||||
@Autowired
|
||||
private IMesXslInspectMaintainItemService mesXslInspectMaintainItemService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslEquipmentCategoryService mesXslEquipmentCategoryService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslEquipmentTypeService mesXslEquipmentTypeService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslEquipmentPartService mesXslEquipmentPartService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslEquipmentSubPartService mesXslEquipmentSubPartService;
|
||||
|
||||
@Operation(summary = "MES点检及保养项目-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslInspectMaintainItem>> queryPageList(
|
||||
MesXslInspectMaintainItem model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslInspectMaintainItem> queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
Page<MesXslInspectMaintainItem> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslInspectMaintainItem> pageList = mesXslInspectMaintainItemService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES点检及保养项目-添加")
|
||||
@Operation(summary = "MES点检及保养项目-添加")
|
||||
@RequiresPermissions("mes:mes_xsl_inspect_maintain_item:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslInspectMaintainItem model) {
|
||||
//update-begin---author:jiangxh ---date:20260519 for:【MES】点检及保养项目保存前校验-----------
|
||||
String err = validateForSave(model, null);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260519 for:【MES】点检及保养项目保存前校验-----------
|
||||
mesXslInspectMaintainItemService.save(model);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES点检及保养项目-编辑")
|
||||
@Operation(summary = "MES点检及保养项目-编辑")
|
||||
@RequiresPermissions("mes:mes_xsl_inspect_maintain_item:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslInspectMaintainItem model) {
|
||||
//update-begin---author:jiangxh ---date:20260519 for:【MES】点检及保养项目保存前校验-----------
|
||||
String err = validateForSave(model, model.getId());
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260519 for:【MES】点检及保养项目保存前校验-----------
|
||||
mesXslInspectMaintainItemService.updateById(model);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES点检及保养项目-删除")
|
||||
@Operation(summary = "MES点检及保养项目-通过id删除")
|
||||
@RequiresPermissions("mes:mes_xsl_inspect_maintain_item:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mesXslInspectMaintainItemService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES点检及保养项目-批量删除")
|
||||
@Operation(summary = "MES点检及保养项目-批量删除")
|
||||
@RequiresPermissions("mes:mes_xsl_inspect_maintain_item:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
mesXslInspectMaintainItemService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES点检及保养项目-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslInspectMaintainItem> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslInspectMaintainItem entity = mesXslInspectMaintainItemService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@Operation(summary = "校验项目名称是否重复(同租户未删除数据;dataId 为编辑时当前主键)")
|
||||
@GetMapping(value = "/checkItemName")
|
||||
public Result<String> checkItemName(
|
||||
@RequestParam(name = "itemName", required = true) String itemName,
|
||||
@RequestParam(name = "dataId", required = false) String dataId) {
|
||||
if (oConvertUtils.isEmpty(itemName) || itemName.trim().isEmpty()) {
|
||||
return Result.OK("该值可用!");
|
||||
}
|
||||
MesXslInspectMaintainItem ctx = new MesXslInspectMaintainItem();
|
||||
if (mesXslInspectMaintainItemService.isItemNameDuplicated(itemName.trim(), dataId, ctx)) {
|
||||
return Result.error("项目名称不能重复");
|
||||
}
|
||||
return Result.OK("该值可用!");
|
||||
}
|
||||
|
||||
@Operation(summary = "校验项目编号是否重复(同租户未删除数据;dataId 为编辑时当前主键)")
|
||||
@GetMapping(value = "/checkItemCode")
|
||||
public Result<String> checkItemCode(
|
||||
@RequestParam(name = "itemCode", required = true) String itemCode,
|
||||
@RequestParam(name = "dataId", required = false) String dataId) {
|
||||
if (oConvertUtils.isEmpty(itemCode) || itemCode.trim().isEmpty()) {
|
||||
return Result.OK("该值可用!");
|
||||
}
|
||||
MesXslInspectMaintainItem ctx = new MesXslInspectMaintainItem();
|
||||
if (mesXslInspectMaintainItemService.isItemCodeDuplicated(itemCode.trim(), dataId, ctx)) {
|
||||
return Result.error("项目编号不能重复");
|
||||
}
|
||||
return Result.OK("该值可用!");
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_inspect_maintain_item:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslInspectMaintainItem model) {
|
||||
return super.exportXls(request, model, MesXslInspectMaintainItem.class, "MES点检及保养项目");
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_inspect_maintain_item:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesXslInspectMaintainItem.class);
|
||||
}
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260519 for:【MES】点检及保养项目保存校验:唯一性、设备关联、字典-----------
|
||||
private String validateForSave(MesXslInspectMaintainItem model, String excludeId) {
|
||||
if (model == null) {
|
||||
return "参数不能为空";
|
||||
}
|
||||
String itemName = model.getItemName();
|
||||
if (itemName != null) {
|
||||
itemName = itemName.trim();
|
||||
}
|
||||
if (oConvertUtils.isEmpty(itemName)) {
|
||||
return "项目名称不能为空";
|
||||
}
|
||||
model.setItemName(itemName);
|
||||
|
||||
String itemCode = model.getItemCode();
|
||||
if (itemCode != null) {
|
||||
itemCode = itemCode.trim();
|
||||
}
|
||||
if (oConvertUtils.isEmpty(itemCode)) {
|
||||
return "项目编号不能为空";
|
||||
}
|
||||
model.setItemCode(itemCode);
|
||||
|
||||
if (mesXslInspectMaintainItemService.isItemNameDuplicated(itemName, excludeId, model)) {
|
||||
return "项目名称不能重复";
|
||||
}
|
||||
if (mesXslInspectMaintainItemService.isItemCodeDuplicated(itemCode, excludeId, model)) {
|
||||
return "项目编号不能重复";
|
||||
}
|
||||
|
||||
if (oConvertUtils.isEmpty(model.getEquipmentCategoryId())) {
|
||||
return "请选择设备类别";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(model.getEquipmentTypeId())) {
|
||||
return "请选择设备类型";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(model.getEquipmentPartId())) {
|
||||
return "请选择设备部位";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(model.getEquipmentSubPartId())) {
|
||||
return "请选择设备小部位";
|
||||
}
|
||||
|
||||
MesXslEquipmentCategory cat = mesXslEquipmentCategoryService.getById(model.getEquipmentCategoryId());
|
||||
if (cat == null || isDeleted(cat.getDelFlag())) {
|
||||
return "设备类别不存在或已删除";
|
||||
}
|
||||
model.setEquipmentCategoryName(cat.getCategoryName());
|
||||
|
||||
MesXslEquipmentType type = mesXslEquipmentTypeService.getById(model.getEquipmentTypeId());
|
||||
if (type == null || isDeleted(type.getDelFlag())) {
|
||||
return "设备类型不存在或已删除";
|
||||
}
|
||||
if (!model.getEquipmentCategoryId().equals(type.getEquipmentCategoryId())) {
|
||||
return "设备类型与所选设备类别不匹配";
|
||||
}
|
||||
model.setEquipmentTypeName(type.getTypeName());
|
||||
|
||||
MesXslEquipmentPart part = mesXslEquipmentPartService.getById(model.getEquipmentPartId());
|
||||
if (part == null || isDeleted(part.getDelFlag())) {
|
||||
return "设备部位不存在或已删除";
|
||||
}
|
||||
if (!model.getEquipmentCategoryId().equals(part.getEquipmentCategoryId())) {
|
||||
return "设备部位与所选设备类别不匹配";
|
||||
}
|
||||
model.setEquipmentPartName(part.getPartName());
|
||||
|
||||
MesXslEquipmentSubPart sub = mesXslEquipmentSubPartService.getById(model.getEquipmentSubPartId());
|
||||
if (sub == null || isDeleted(sub.getDelFlag())) {
|
||||
return "设备小部位不存在或已删除";
|
||||
}
|
||||
if (!model.getEquipmentCategoryId().equals(sub.getEquipmentCategoryId())) {
|
||||
return "设备小部位与所选设备类别不匹配";
|
||||
}
|
||||
if (!model.getEquipmentPartId().equals(sub.getEquipmentPartId())) {
|
||||
return "设备小部位与所选设备部位不匹配";
|
||||
}
|
||||
model.setEquipmentSubPartName(sub.getSubPartName());
|
||||
|
||||
String itemCategory = model.getItemCategory();
|
||||
if (itemCategory != null) {
|
||||
itemCategory = itemCategory.trim();
|
||||
}
|
||||
if (oConvertUtils.isEmpty(itemCategory) || !ITEM_CATEGORY.contains(itemCategory)) {
|
||||
return "项目类别无效,请选择点检或保养";
|
||||
}
|
||||
model.setItemCategory(itemCategory);
|
||||
|
||||
String itemType = model.getItemType();
|
||||
if (itemType != null) {
|
||||
itemType = itemType.trim();
|
||||
}
|
||||
if (oConvertUtils.isEmpty(itemType) || !ITEM_TYPE.contains(itemType)) {
|
||||
return "项目类型无效,请选择机械类或电气类";
|
||||
}
|
||||
model.setItemType(itemType);
|
||||
|
||||
String inspectMethod = model.getInspectMethod();
|
||||
if (inspectMethod != null) {
|
||||
inspectMethod = inspectMethod.trim();
|
||||
}
|
||||
if (oConvertUtils.isEmpty(inspectMethod) || !INSPECT_METHOD.contains(inspectMethod)) {
|
||||
return "点检方式无效,请选择视觉、目测或听觉";
|
||||
}
|
||||
model.setInspectMethod(inspectMethod);
|
||||
|
||||
if (model.getJudgmentCriteria() != null) {
|
||||
model.setJudgmentCriteria(model.getJudgmentCriteria().trim());
|
||||
}
|
||||
if (oConvertUtils.isEmpty(model.getJudgmentCriteria())) {
|
||||
return "判断基准不能为空";
|
||||
}
|
||||
|
||||
if (model.getMaintainCycleDays() != null && model.getMaintainCycleDays() < 0) {
|
||||
return "保养周期(天)不能为负数";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static boolean isDeleted(Integer delFlag) {
|
||||
return delFlag != null && delFlag.equals(CommonConstant.DEL_FLAG_1);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260519 for:【MES】点检及保养项目保存校验:唯一性、设备关联、字典-----------
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
package org.jeecg.modules.xslmes.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.mes.material.entity.MesMixerMaterial;
|
||||
import org.jeecg.modules.mes.material.service.IMesMixerMaterialService;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixerMaterialSubstitute;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslMixerMaterialSubstituteService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* MES 密炼物料替代对应关系
|
||||
*/
|
||||
@Tag(name = "MES密炼物料替代对应关系")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslMixerMaterialSubstitute")
|
||||
@Slf4j
|
||||
public class MesXslMixerMaterialSubstituteController
|
||||
extends JeecgController<MesXslMixerMaterialSubstitute, IMesXslMixerMaterialSubstituteService> {
|
||||
|
||||
@Autowired
|
||||
private IMesXslMixerMaterialSubstituteService mesXslMixerMaterialSubstituteService;
|
||||
|
||||
@Autowired
|
||||
private IMesMixerMaterialService mesMixerMaterialService;
|
||||
|
||||
@Operation(summary = "MES密炼物料替代对应关系-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslMixerMaterialSubstitute>> queryPageList(
|
||||
MesXslMixerMaterialSubstitute model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||
customeRuleMap.put("mixerMaterialId", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("substituteMaterialId", QueryRuleEnum.LIKE_WITH_OR);
|
||||
QueryWrapper<MesXslMixerMaterialSubstitute> queryWrapper =
|
||||
QueryGenerator.initQueryWrapper(model, req.getParameterMap(), customeRuleMap);
|
||||
queryWrapper.orderByAsc("serial_no");
|
||||
Page<MesXslMixerMaterialSubstitute> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslMixerMaterialSubstitute> pageList = mesXslMixerMaterialSubstituteService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼物料替代对应关系-添加")
|
||||
@Operation(summary = "MES密炼物料替代对应关系-添加")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_substitute:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslMixerMaterialSubstitute model) {
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】保存前校验与物料冗余回填-----------
|
||||
String err = validateAndFillMaterials(model, false);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】保存前校验与物料冗余回填-----------
|
||||
mesXslMixerMaterialSubstituteService.saveWithSerialNo(model);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼物料替代对应关系-编辑")
|
||||
@Operation(summary = "MES密炼物料替代对应关系-编辑")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_substitute:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslMixerMaterialSubstitute model) {
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】保存前校验与物料冗余回填-----------
|
||||
String err = validateAndFillMaterials(model, true);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】保存前校验与物料冗余回填-----------
|
||||
mesXslMixerMaterialSubstituteService.updateById(model);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼物料替代对应关系-删除")
|
||||
@Operation(summary = "MES密炼物料替代对应关系-通过id删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_substitute:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mesXslMixerMaterialSubstituteService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼物料替代对应关系-批量删除")
|
||||
@Operation(summary = "MES密炼物料替代对应关系-批量删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_substitute:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
mesXslMixerMaterialSubstituteService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES密炼物料替代对应关系-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslMixerMaterialSubstitute> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslMixerMaterialSubstitute entity = mesXslMixerMaterialSubstituteService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_substitute:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslMixerMaterialSubstitute model) {
|
||||
return super.exportXls(request, model, MesXslMixerMaterialSubstitute.class, "密炼物料替代对应关系");
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_substitute:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesXslMixerMaterialSubstitute.class);
|
||||
}
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】保存前校验与物料冗余回填-----------
|
||||
private String validateAndFillMaterials(MesXslMixerMaterialSubstitute model, boolean isUpdate) {
|
||||
if (oConvertUtils.isEmpty(model.getMixerMaterialId())) {
|
||||
return "请选择密炼物料";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(model.getSubstituteMaterialId())) {
|
||||
return "请选择替代密炼物料";
|
||||
}
|
||||
if (model.getMixerMaterialId().equals(model.getSubstituteMaterialId())) {
|
||||
return "密炼物料与替代密炼物料不能相同";
|
||||
}
|
||||
|
||||
MesMixerMaterial mixerMaterial = mesMixerMaterialService.getById(model.getMixerMaterialId());
|
||||
if (mixerMaterial == null) {
|
||||
return "所选密炼物料不存在,请重新选择";
|
||||
}
|
||||
MesMixerMaterial substituteMaterial = mesMixerMaterialService.getById(model.getSubstituteMaterialId());
|
||||
if (substituteMaterial == null) {
|
||||
return "所选替代密炼物料不存在,请重新选择";
|
||||
}
|
||||
|
||||
model.setMixerMaterialCode(mixerMaterial.getMaterialCode());
|
||||
model.setMixerMaterialName(mixerMaterial.getMaterialName());
|
||||
model.setSubstituteMaterialCode(substituteMaterial.getMaterialCode());
|
||||
model.setSubstituteMaterialName(substituteMaterial.getMaterialName());
|
||||
|
||||
LambdaQueryWrapper<MesXslMixerMaterialSubstitute> dupQw = new LambdaQueryWrapper<>();
|
||||
dupQw.eq(MesXslMixerMaterialSubstitute::getMixerMaterialId, model.getMixerMaterialId())
|
||||
.eq(MesXslMixerMaterialSubstitute::getSubstituteMaterialId, model.getSubstituteMaterialId());
|
||||
if (isUpdate && oConvertUtils.isNotEmpty(model.getId())) {
|
||||
dupQw.ne(MesXslMixerMaterialSubstitute::getId, model.getId());
|
||||
}
|
||||
if (mesXslMixerMaterialSubstituteService.count(dupQw) > 0) {
|
||||
return "该密炼物料与替代密炼物料的对应关系已存在";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】保存前校验与物料冗余回填-----------
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
package org.jeecg.modules.xslmes.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.mes.material.entity.MesMaterial;
|
||||
import org.jeecg.modules.mes.material.service.IMesMaterialService;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslOpenMillParam;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslOpenMillParamService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* MES 开炼机参数维护
|
||||
*/
|
||||
@Tag(name = "MES开炼机参数维护")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslOpenMillParam")
|
||||
@Slf4j
|
||||
public class MesXslOpenMillParamController extends JeecgController<MesXslOpenMillParam, IMesXslOpenMillParamService> {
|
||||
|
||||
@Autowired
|
||||
private IMesXslOpenMillParamService mesXslOpenMillParamService;
|
||||
|
||||
@Autowired
|
||||
private IMesMaterialService mesMaterialService;
|
||||
|
||||
@Operation(summary = "MES开炼机参数维护-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslOpenMillParam>> queryPageList(
|
||||
MesXslOpenMillParam model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||
customeRuleMap.put("materialId", QueryRuleEnum.LIKE_WITH_OR);
|
||||
QueryWrapper<MesXslOpenMillParam> queryWrapper =
|
||||
QueryGenerator.initQueryWrapper(model, req.getParameterMap(), customeRuleMap);
|
||||
Page<MesXslOpenMillParam> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslOpenMillParam> pageList = mesXslOpenMillParamService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES开炼机参数维护-添加")
|
||||
@Operation(summary = "MES开炼机参数维护-添加")
|
||||
@RequiresPermissions("xslmes:mes_xsl_open_mill_param:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslOpenMillParam model) {
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【开炼机参数维护】保存前校验与胶料冗余回填-----------
|
||||
String err = validateAndFillMaterial(model);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【开炼机参数维护】保存前校验与胶料冗余回填-----------
|
||||
mesXslOpenMillParamService.save(model);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES开炼机参数维护-编辑")
|
||||
@Operation(summary = "MES开炼机参数维护-编辑")
|
||||
@RequiresPermissions("xslmes:mes_xsl_open_mill_param:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslOpenMillParam model) {
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【开炼机参数维护】保存前校验与胶料冗余回填-----------
|
||||
String err = validateAndFillMaterial(model);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【开炼机参数维护】保存前校验与胶料冗余回填-----------
|
||||
mesXslOpenMillParamService.updateById(model);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES开炼机参数维护-删除")
|
||||
@Operation(summary = "MES开炼机参数维护-通过id删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_open_mill_param:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mesXslOpenMillParamService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES开炼机参数维护-批量删除")
|
||||
@Operation(summary = "MES开炼机参数维护-批量删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_open_mill_param:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
mesXslOpenMillParamService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES开炼机参数维护-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslOpenMillParam> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslOpenMillParam entity = mesXslOpenMillParamService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_open_mill_param:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslOpenMillParam model) {
|
||||
return super.exportXls(request, model, MesXslOpenMillParam.class, "开炼机参数维护");
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_open_mill_param:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesXslOpenMillParam.class);
|
||||
}
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【开炼机参数维护】保存前校验与胶料冗余回填-----------
|
||||
private String validateAndFillMaterial(MesXslOpenMillParam model) {
|
||||
if (oConvertUtils.isEmpty(model.getMaterialId())) {
|
||||
return "请选择胶料";
|
||||
}
|
||||
MesMaterial material = mesMaterialService.getById(model.getMaterialId());
|
||||
if (material == null) {
|
||||
return "所选胶料不存在,请重新选择";
|
||||
}
|
||||
model.setMaterialName(material.getMaterialName());
|
||||
model.setMaterialCode(material.getMaterialCode());
|
||||
String timeErr = validateTimeFields(model);
|
||||
if (timeErr != null) {
|
||||
return timeErr;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private String validateTimeFields(MesXslOpenMillParam model) {
|
||||
if (isNegative(model.getR0FeedTime())) {
|
||||
return "R0进胶时间不能为负数";
|
||||
}
|
||||
if (isNegative(model.getR0RingTime())) {
|
||||
return "R0成环时间不能为负数";
|
||||
}
|
||||
if (isNegative(model.getR0BreakTime())) {
|
||||
return "R0拉断时间不能为负数";
|
||||
}
|
||||
if (isNegative(model.getR0DischargeTime())) {
|
||||
return "R0排胶时间不能为负数";
|
||||
}
|
||||
if (isNegative(model.getR1FeedTime())) {
|
||||
return "R1进胶时间不能为负数";
|
||||
}
|
||||
if (isNegative(model.getR1RingTime())) {
|
||||
return "R1成环时间不能为负数";
|
||||
}
|
||||
if (isNegative(model.getR1BreakTime())) {
|
||||
return "R1拉断时间不能为负数";
|
||||
}
|
||||
if (isNegative(model.getR1DischargeTime())) {
|
||||
return "R1排胶时间不能为负数";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static boolean isNegative(BigDecimal value) {
|
||||
return value != null && value.compareTo(BigDecimal.ZERO) < 0;
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【开炼机参数维护】保存前校验与胶料冗余回填-----------
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* MES 点检及保养项目(表 mes_xsl_inspect_maintain_item)
|
||||
*/
|
||||
@Data
|
||||
@TableName("mes_xsl_inspect_maintain_item")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES点检及保养项目")
|
||||
public class MesXslInspectMaintainItem implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Excel(name = "项目名称", width = 22)
|
||||
@Schema(description = "项目名称(同租户未删除数据中唯一)")
|
||||
private String itemName;
|
||||
|
||||
@Excel(name = "项目编号", width = 18)
|
||||
@Schema(description = "项目编号(同租户未删除数据中唯一)")
|
||||
private String itemCode;
|
||||
|
||||
@Schema(description = "设备类别主键 mes_xsl_equipment_category.id")
|
||||
private String equipmentCategoryId;
|
||||
|
||||
@Excel(name = "设备类别", width = 20)
|
||||
@Schema(description = "设备类别名称冗余")
|
||||
private String equipmentCategoryName;
|
||||
|
||||
@Schema(description = "设备类型主键 mes_xsl_equipment_type.id")
|
||||
private String equipmentTypeId;
|
||||
|
||||
@Excel(name = "设备类型", width = 20)
|
||||
@Schema(description = "设备类型名称冗余")
|
||||
private String equipmentTypeName;
|
||||
|
||||
@Schema(description = "设备部位主键 mes_xsl_equipment_part.id")
|
||||
private String equipmentPartId;
|
||||
|
||||
@Excel(name = "设备部位", width = 20)
|
||||
@Schema(description = "设备部位名称冗余")
|
||||
private String equipmentPartName;
|
||||
|
||||
@Schema(description = "设备小部位主键 mes_xsl_equipment_sub_part.id")
|
||||
private String equipmentSubPartId;
|
||||
|
||||
@Excel(name = "设备小部位", width = 20)
|
||||
@Schema(description = "设备小部位名称冗余")
|
||||
private String equipmentSubPartName;
|
||||
|
||||
@Excel(name = "项目类别", width = 12, dicCode = "xslmes_im_item_category")
|
||||
@Dict(dicCode = "xslmes_im_item_category")
|
||||
@Schema(description = "项目类别(字典xslmes_im_item_category:inspect点检/maintain保养)")
|
||||
private String itemCategory;
|
||||
|
||||
@Excel(name = "项目类型", width = 12, dicCode = "xslmes_im_item_type")
|
||||
@Dict(dicCode = "xslmes_im_item_type")
|
||||
@Schema(description = "项目类型(字典xslmes_im_item_type:mechanical机械类/electrical电气类)")
|
||||
private String itemType;
|
||||
|
||||
@Excel(name = "点检方式", width = 12, dicCode = "xslmes_im_inspect_method")
|
||||
@Dict(dicCode = "xslmes_im_inspect_method")
|
||||
@Schema(description = "点检方式(字典xslmes_im_inspect_method:visual视觉/sight目测/hearing听觉)")
|
||||
private String inspectMethod;
|
||||
|
||||
@Excel(name = "判断基准", width = 28)
|
||||
@Schema(description = "判断基准")
|
||||
private String judgmentCriteria;
|
||||
|
||||
@Excel(name = "保养周期(天)", width = 14)
|
||||
@Schema(description = "保养周期(天)")
|
||||
private Integer maintainCycleDays;
|
||||
|
||||
private Integer tenantId;
|
||||
private String sysOrgCode;
|
||||
private String createBy;
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
private String updateBy;
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* MES 密炼物料替代对应关系
|
||||
*/
|
||||
@Data
|
||||
@TableName("mes_xsl_mixer_material_substitute")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES密炼物料替代对应关系")
|
||||
public class MesXslMixerMaterialSubstitute implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Excel(name = "编号", width = 10)
|
||||
@Schema(description = "编号(租户内自动累加,从1开始)")
|
||||
private Integer serialNo;
|
||||
|
||||
@Excel(name = "密炼物料ID", width = 15, dictTable = "mes_mixer_material", dicText = "material_name", dicCode = "id")
|
||||
@Dict(dictTable = "mes_mixer_material", dicText = "material_name", dicCode = "id")
|
||||
@Schema(description = "密炼物料ID(关联 mes_mixer_material.id)")
|
||||
private String mixerMaterialId;
|
||||
|
||||
@Excel(name = "密炼物料编码", width = 15)
|
||||
@Schema(description = "密炼物料编码冗余")
|
||||
private String mixerMaterialCode;
|
||||
|
||||
@Excel(name = "密炼物料名称", width = 20)
|
||||
@Schema(description = "密炼物料名称冗余")
|
||||
private String mixerMaterialName;
|
||||
|
||||
@Excel(name = "替代密炼物料ID", width = 15, dictTable = "mes_mixer_material", dicText = "material_name", dicCode = "id")
|
||||
@Dict(dictTable = "mes_mixer_material", dicText = "material_name", dicCode = "id")
|
||||
@Schema(description = "替代密炼物料ID(关联 mes_mixer_material.id)")
|
||||
private String substituteMaterialId;
|
||||
|
||||
@Excel(name = "替代密炼物料编码", width = 15)
|
||||
@Schema(description = "替代密炼物料编码冗余")
|
||||
private String substituteMaterialCode;
|
||||
|
||||
@Excel(name = "替代密炼物料名称", width = 20)
|
||||
@Schema(description = "替代密炼物料名称冗余")
|
||||
private String substituteMaterialName;
|
||||
|
||||
@Excel(name = "创建人", width = 15)
|
||||
private String createBy;
|
||||
|
||||
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@Excel(name = "修改人", width = 15)
|
||||
private String updateBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Integer tenantId;
|
||||
|
||||
private String sysOrgCode;
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* MES 开炼机参数维护
|
||||
*/
|
||||
@Data
|
||||
@TableName("mes_xsl_open_mill_param")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES开炼机参数维护")
|
||||
public class MesXslOpenMillParam implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Excel(name = "胶料ID", width = 15, dictTable = "mes_material", dicText = "material_name", dicCode = "id")
|
||||
@Dict(dictTable = "mes_material", dicText = "material_name", dicCode = "id")
|
||||
@Schema(description = "胶料ID(关联 mes_material.id)")
|
||||
private String materialId;
|
||||
|
||||
@Excel(name = "胶料名称", width = 20)
|
||||
@Schema(description = "胶料名称冗余")
|
||||
private String materialName;
|
||||
|
||||
@Excel(name = "胶料编码", width = 15)
|
||||
@Schema(description = "胶料编码冗余")
|
||||
private String materialCode;
|
||||
|
||||
@Excel(name = "R0进胶时间(秒)", width = 14)
|
||||
@Schema(description = "R0进胶时间(秒)")
|
||||
private BigDecimal r0FeedTime;
|
||||
|
||||
@Excel(name = "R0成环时间(秒)", width = 14)
|
||||
@Schema(description = "R0成环时间(秒)")
|
||||
private BigDecimal r0RingTime;
|
||||
|
||||
@Excel(name = "R0拉断时间(秒)", width = 14)
|
||||
@Schema(description = "R0拉断时间(秒)")
|
||||
private BigDecimal r0BreakTime;
|
||||
|
||||
@Excel(name = "R0排胶时间(秒)", width = 14)
|
||||
@Schema(description = "R0排胶时间(秒)")
|
||||
private BigDecimal r0DischargeTime;
|
||||
|
||||
@Excel(name = "R1进胶时间(秒)", width = 14)
|
||||
@Schema(description = "R1进胶时间(秒)")
|
||||
private BigDecimal r1FeedTime;
|
||||
|
||||
@Excel(name = "R1成环时间(秒)", width = 14)
|
||||
@Schema(description = "R1成环时间(秒)")
|
||||
private BigDecimal r1RingTime;
|
||||
|
||||
@Excel(name = "R1拉断时间(秒)", width = 14)
|
||||
@Schema(description = "R1拉断时间(秒)")
|
||||
private BigDecimal r1BreakTime;
|
||||
|
||||
@Excel(name = "R1排胶时间(秒)", width = 14)
|
||||
@Schema(description = "R1排胶时间(秒)")
|
||||
private BigDecimal r1DischargeTime;
|
||||
|
||||
@Excel(name = "创建人", width = 15)
|
||||
private String createBy;
|
||||
|
||||
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@Excel(name = "修改人", width = 15)
|
||||
private String updateBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Integer tenantId;
|
||||
|
||||
private String sysOrgCode;
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package org.jeecg.modules.xslmes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslInspectMaintainItem;
|
||||
|
||||
/**
|
||||
* MES 点检及保养项目
|
||||
*/
|
||||
public interface MesXslInspectMaintainItemMapper extends BaseMapper<MesXslInspectMaintainItem> {}
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.jeecg.modules.xslmes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixerMaterialSubstitute;
|
||||
|
||||
/**
|
||||
* MES 密炼物料替代对应关系 Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface MesXslMixerMaterialSubstituteMapper extends BaseMapper<MesXslMixerMaterialSubstitute> {
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】查询租户内最大编号-----------
|
||||
@Select("SELECT IFNULL(MAX(serial_no), 0) FROM mes_xsl_mixer_material_substitute "
|
||||
+ "WHERE del_flag = 0 AND (#{tenantId} IS NULL OR tenant_id = #{tenantId})")
|
||||
Integer selectMaxSerialNo(@Param("tenantId") Integer tenantId);
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】查询租户内最大编号-----------
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package org.jeecg.modules.xslmes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslOpenMillParam;
|
||||
|
||||
/**
|
||||
* MES 开炼机参数维护 Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface MesXslOpenMillParamMapper extends BaseMapper<MesXslOpenMillParam> {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.xslmes.mapper.MesXslOpenMillParamMapper">
|
||||
</mapper>
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* MES XSL 业务模块(Maven 工程名:jeecg-module-xslmes)。
|
||||
* 包含:客户管理({@link org.jeecg.modules.xslmes.entity.MesXslCustomer})、工序管理({@link org.jeecg.modules.xslmes.entity.MesXslProcessOperation})、设备类别({@link org.jeecg.modules.xslmes.entity.MesXslEquipmentCategory})、设备类型({@link org.jeecg.modules.xslmes.entity.MesXslEquipmentType})、设备台账({@link org.jeecg.modules.xslmes.entity.MesXslEquipmentLedger})、设备部位({@link org.jeecg.modules.xslmes.entity.MesXslEquipmentPart})、设备小部位({@link org.jeecg.modules.xslmes.entity.MesXslEquipmentSubPart})、备品件类别({@link org.jeecg.modules.xslmes.entity.MesXslSparePartsCategory})、备品件信息({@link org.jeecg.modules.xslmes.entity.MesXslSparePart})、厂家信息({@link org.jeecg.modules.xslmes.entity.MesXslManufacturer})、停机主类型({@link org.jeecg.modules.xslmes.entity.MesXslDowntimeMainType})、停机类型({@link org.jeecg.modules.xslmes.entity.MesXslDowntimeType})等。
|
||||
* 包含:客户管理({@link org.jeecg.modules.xslmes.entity.MesXslCustomer})、工序管理({@link org.jeecg.modules.xslmes.entity.MesXslProcessOperation})、设备类别({@link org.jeecg.modules.xslmes.entity.MesXslEquipmentCategory})、设备类型({@link org.jeecg.modules.xslmes.entity.MesXslEquipmentType})、设备台账({@link org.jeecg.modules.xslmes.entity.MesXslEquipmentLedger})、设备部位({@link org.jeecg.modules.xslmes.entity.MesXslEquipmentPart})、设备小部位({@link org.jeecg.modules.xslmes.entity.MesXslEquipmentSubPart})、点检及保养项目({@link org.jeecg.modules.xslmes.entity.MesXslInspectMaintainItem})、备品件类别({@link org.jeecg.modules.xslmes.entity.MesXslSparePartsCategory})、备品件信息({@link org.jeecg.modules.xslmes.entity.MesXslSparePart})、厂家信息({@link org.jeecg.modules.xslmes.entity.MesXslManufacturer})、停机主类型({@link org.jeecg.modules.xslmes.entity.MesXslDowntimeMainType})、停机类型({@link org.jeecg.modules.xslmes.entity.MesXslDowntimeType})等。
|
||||
*/
|
||||
package org.jeecg.modules.xslmes;
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.jeecg.modules.xslmes.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslInspectMaintainItem;
|
||||
|
||||
/**
|
||||
* MES 点检及保养项目
|
||||
*/
|
||||
public interface IMesXslInspectMaintainItemService extends IService<MesXslInspectMaintainItem> {
|
||||
|
||||
boolean isItemNameDuplicated(String itemName, String excludeId, MesXslInspectMaintainItem context);
|
||||
|
||||
boolean isItemCodeDuplicated(String itemCode, String excludeId, MesXslInspectMaintainItem context);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.jeecg.modules.xslmes.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixerMaterialSubstitute;
|
||||
|
||||
/**
|
||||
* MES 密炼物料替代对应关系
|
||||
*/
|
||||
public interface IMesXslMixerMaterialSubstituteService extends IService<MesXslMixerMaterialSubstitute> {
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】新增时分配编号-----------
|
||||
/**
|
||||
* 新增保存(自动分配租户内递增编号)
|
||||
*/
|
||||
boolean saveWithSerialNo(MesXslMixerMaterialSubstitute entity);
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】新增时分配编号-----------
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package org.jeecg.modules.xslmes.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslOpenMillParam;
|
||||
|
||||
/**
|
||||
* MES 开炼机参数维护
|
||||
*/
|
||||
public interface IMesXslOpenMillParamService extends IService<MesXslOpenMillParam> {
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.config.TenantContext;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslInspectMaintainItem;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslInspectMaintainItemMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslInspectMaintainItemService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class MesXslInspectMaintainItemServiceImpl
|
||||
extends ServiceImpl<MesXslInspectMaintainItemMapper, MesXslInspectMaintainItem>
|
||||
implements IMesXslInspectMaintainItemService {
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260519 for:【MES】点检及保养项目:项目名称/编号同租户不可重复-----------
|
||||
@Override
|
||||
public boolean isItemNameDuplicated(String itemName, String excludeId, MesXslInspectMaintainItem context) {
|
||||
return isFieldDuplicated(MesXslInspectMaintainItem::getItemName, itemName, excludeId, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemCodeDuplicated(String itemCode, String excludeId, MesXslInspectMaintainItem context) {
|
||||
return isFieldDuplicated(MesXslInspectMaintainItem::getItemCode, itemCode, excludeId, context);
|
||||
}
|
||||
|
||||
private boolean isFieldDuplicated(
|
||||
com.baomidou.mybatisplus.core.toolkit.support.SFunction<MesXslInspectMaintainItem, String> column,
|
||||
String value,
|
||||
String excludeId,
|
||||
MesXslInspectMaintainItem context) {
|
||||
if (oConvertUtils.isEmpty(value)) {
|
||||
return false;
|
||||
}
|
||||
Integer tenantId = resolveTenantId(context);
|
||||
LambdaQueryWrapper<MesXslInspectMaintainItem> w = new LambdaQueryWrapper<>();
|
||||
w.eq(column, value.trim());
|
||||
w.and(
|
||||
q ->
|
||||
q.eq(MesXslInspectMaintainItem::getDelFlag, CommonConstant.DEL_FLAG_0)
|
||||
.or()
|
||||
.isNull(MesXslInspectMaintainItem::getDelFlag));
|
||||
if (oConvertUtils.isNotEmpty(excludeId)) {
|
||||
w.ne(MesXslInspectMaintainItem::getId, excludeId);
|
||||
}
|
||||
if (tenantId != null) {
|
||||
w.eq(MesXslInspectMaintainItem::getTenantId, tenantId);
|
||||
}
|
||||
return this.count(w) > 0;
|
||||
}
|
||||
|
||||
private static Integer resolveTenantId(MesXslInspectMaintainItem context) {
|
||||
if (context != null && context.getTenantId() != null) {
|
||||
return context.getTenantId();
|
||||
}
|
||||
String ts = TenantContext.getTenant();
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
try {
|
||||
ts = TokenUtils.getTenantIdByRequest(SpringContextUtils.getHttpServletRequest());
|
||||
} catch (Exception ignored) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Integer.parseInt(ts);
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260519 for:【MES】点检及保养项目:项目名称/编号同租户不可重复-----------
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixerMaterialSubstitute;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslMixerMaterialSubstituteMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslMixerMaterialSubstituteService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* MES 密炼物料替代对应关系
|
||||
*/
|
||||
@Service
|
||||
public class MesXslMixerMaterialSubstituteServiceImpl
|
||||
extends ServiceImpl<MesXslMixerMaterialSubstituteMapper, MesXslMixerMaterialSubstitute>
|
||||
implements IMesXslMixerMaterialSubstituteService {
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】新增时分配编号-----------
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean saveWithSerialNo(MesXslMixerMaterialSubstitute entity) {
|
||||
if (entity.getSerialNo() == null) {
|
||||
Integer maxSerial = baseMapper.selectMaxSerialNo(entity.getTenantId());
|
||||
entity.setSerialNo(maxSerial == null ? 1 : maxSerial + 1);
|
||||
}
|
||||
return save(entity);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】新增时分配编号-----------
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslOpenMillParam;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslOpenMillParamMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslOpenMillParamService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* MES 开炼机参数维护
|
||||
*/
|
||||
@Service
|
||||
public class MesXslOpenMillParamServiceImpl extends ServiceImpl<MesXslOpenMillParamMapper, MesXslOpenMillParam>
|
||||
implements IMesXslOpenMillParamService {
|
||||
}
|
||||
@@ -256,6 +256,21 @@ jeecg-boot/db/mes-xsl-spare-part-menu-permission.sql
|
||||
jeecg-boot/db/mes-xsl-manufacturer-menu-permission.sql
|
||||
jeecg-boot/db/mes-xsl-downtime-main-type-menu-permission.sql
|
||||
jeecg-boot/db/mes-xsl-downtime-type-menu-permission.sql
|
||||
-- author:jiangxh---date:20260519--for: 【MES】点检及保养项目(建表、字典、菜单、CRUD、设备关联选择)---
|
||||
jeecg-boot/db/mes-xsl-inspect-maintain-item-menu-permission.sql
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_77__mes_xsl_inspect_maintain_item.sql
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslInspectMaintainItem.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslInspectMaintainItemMapper.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslInspectMaintainItemService.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslInspectMaintainItemServiceImpl.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslInspectMaintainItemController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/package-info.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslInspectMaintainItem/MesXslInspectMaintainItemList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslInspectMaintainItem/MesXslInspectMaintainItem.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslInspectMaintainItem/MesXslInspectMaintainItem.api.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslInspectMaintainItem/components/MesXslInspectMaintainItemModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslInspectMaintainItem/components/MesXslEquipmentTypeFilterSelectModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslInspectMaintainItem/components/MesXslEquipmentSubPartFilterSelectModal.vue
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_70__mes_xsl_equipment_type_menu_ensure.sql
|
||||
-- author:jiangxh---date:20260518--for: 【MES】工序管理/设备类别菜单与按钮权限补全及租户授权 ---
|
||||
jeecg-boot/db/mes-xsl-process-and-category-menu-fix.sql
|
||||
@@ -309,3 +324,18 @@ jeecg-boot/db/mes-xsl-spare-part-menu-permission.sql
|
||||
jeecg-boot/db/mes-xsl-manufacturer-menu-permission.sql
|
||||
jeecg-boot/db/mes-xsl-downtime-main-type-menu-permission.sql
|
||||
jeecg-boot/db/mes-xsl-downtime-type-menu-permission.sql
|
||||
-- author:jiangxh---date:20260519--for: 【MES】点检及保养项目(建表、字典、菜单、CRUD、设备关联选择)---
|
||||
jeecg-boot/db/mes-xsl-inspect-maintain-item-menu-permission.sql
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_77__mes_xsl_inspect_maintain_item.sql
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslInspectMaintainItem.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslInspectMaintainItemMapper.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslInspectMaintainItemService.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslInspectMaintainItemServiceImpl.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslInspectMaintainItemController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/package-info.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslInspectMaintainItem/MesXslInspectMaintainItemList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslInspectMaintainItem/MesXslInspectMaintainItem.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslInspectMaintainItem/MesXslInspectMaintainItem.api.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslInspectMaintainItem/components/MesXslInspectMaintainItemModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslInspectMaintainItem/components/MesXslEquipmentTypeFilterSelectModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslInspectMaintainItem/components/MesXslEquipmentSubPartFilterSelectModal.vue
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@Slf4j
|
||||
@Tag(name = "MES-物料信息")
|
||||
@Tag(name = "MES-胶料信息")
|
||||
@RestController
|
||||
@RequestMapping("/mes/material/material")
|
||||
public class MesMaterialController extends JeecgController<MesMaterial, IMesMaterialService> {
|
||||
@@ -39,8 +39,8 @@ public class MesMaterialController extends JeecgController<MesMaterial, IMesMate
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-物料信息-添加")
|
||||
@Operation(summary = "MES-物料信息-添加")
|
||||
@AutoLog(value = "MES-胶料信息-添加")
|
||||
@Operation(summary = "MES-胶料信息-添加")
|
||||
@RequiresPermissions("mes:mes_material:add")
|
||||
@PostMapping("/add")
|
||||
public Result<String> add(@RequestBody MesMaterial model) {
|
||||
@@ -49,8 +49,8 @@ public class MesMaterialController extends JeecgController<MesMaterial, IMesMate
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-物料信息-编辑")
|
||||
@Operation(summary = "MES-物料信息-编辑")
|
||||
@AutoLog(value = "MES-胶料信息-编辑")
|
||||
@Operation(summary = "MES-胶料信息-编辑")
|
||||
@RequiresPermissions("mes:mes_material:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesMaterial model) {
|
||||
@@ -59,8 +59,8 @@ public class MesMaterialController extends JeecgController<MesMaterial, IMesMate
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-物料信息-通过id删除")
|
||||
@Operation(summary = "MES-物料信息-通过id删除")
|
||||
@AutoLog(value = "MES-胶料信息-通过id删除")
|
||||
@Operation(summary = "MES-胶料信息-通过id删除")
|
||||
@RequiresPermissions("mes:mes_material:delete")
|
||||
@DeleteMapping("/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id") String id) {
|
||||
@@ -72,8 +72,8 @@ public class MesMaterialController extends JeecgController<MesMaterial, IMesMate
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-物料信息-批量删除")
|
||||
@Operation(summary = "MES-物料信息-批量删除")
|
||||
@AutoLog(value = "MES-胶料信息-批量删除")
|
||||
@Operation(summary = "MES-胶料信息-批量删除")
|
||||
@RequiresPermissions("mes:mes_material:deleteBatch")
|
||||
@DeleteMapping("/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids") String ids) {
|
||||
@@ -94,7 +94,7 @@ public class MesMaterialController extends JeecgController<MesMaterial, IMesMate
|
||||
@RequiresPermissions("mes:mes_material:exportXls")
|
||||
@RequestMapping("/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesMaterial model) {
|
||||
return super.exportXls(request, model, MesMaterial.class, "MES物料信息");
|
||||
return super.exportXls(request, model, MesMaterial.class, "MES胶料信息");
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_material:importExcel")
|
||||
|
||||
@@ -19,7 +19,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
@TableName("mes_material")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES物料主数据")
|
||||
@Schema(description = "MES胶料主数据")
|
||||
public class MesMaterial implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -28,15 +28,15 @@ public class MesMaterial implements Serializable {
|
||||
|
||||
@Excel(name = "物料编码", width = 15)
|
||||
private String materialCode;
|
||||
@Excel(name = "物料名称", width = 20)
|
||||
@Excel(name = "胶料名称", width = 20)
|
||||
private String materialName;
|
||||
@Excel(name = "别名", width = 15)
|
||||
@Excel(name = "胶料别名", width = 15)
|
||||
private String aliasName;
|
||||
@Excel(name = "简称", width = 15)
|
||||
private String shortName;
|
||||
|
||||
@Excel(name = "分类", width = 15, dictTable = "mes_material_category", dicText = "category_name", dicCode = "id")
|
||||
@Dict(dictTable = "mes_material_category", dicText = "category_name", dicCode = "id")
|
||||
@Excel(name = "胶料类别", width = 15, dictTable = "sys_category", dicText = "name", dicCode = "id")
|
||||
@Dict(dictTable = "sys_category", dicText = "name", dicCode = "id")
|
||||
private String categoryId;
|
||||
@Excel(name = "等级", width = 12)
|
||||
private String materialGrade;
|
||||
@@ -57,16 +57,27 @@ public class MesMaterial implements Serializable {
|
||||
@Excel(name = "换算系数", width = 12)
|
||||
private BigDecimal unitConvertRate;
|
||||
|
||||
@Excel(name = "ERP编号", width = 15)
|
||||
private String erpCode;
|
||||
@Excel(name = "终炼胶保质期(天)", width = 15)
|
||||
private Integer finalShelfLifeDays;
|
||||
@Excel(name = "母炼胶保质期(天)", width = 15)
|
||||
private Integer masterShelfLifeDays;
|
||||
@Excel(name = "最小停放时间(时)", width = 15)
|
||||
private Integer minStandingHours;
|
||||
@Excel(name = "标准码", width = 15)
|
||||
private String standardCode;
|
||||
@Excel(name = "产地", width = 15)
|
||||
private String originPlace;
|
||||
@Excel(name = "供应商ID", width = 15)
|
||||
private String supplierId;
|
||||
@Excel(name = "客户ID", width = 15)
|
||||
@Excel(name = "胶料客户", width = 15, dictTable = "mes_xsl_customer", dicText = "customer_name", dicCode = "id")
|
||||
@Dict(dictTable = "mes_xsl_customer", dicText = "customer_name", dicCode = "id")
|
||||
private String customerId;
|
||||
@Excel(name = "启用状态", width = 10)
|
||||
@Excel(name = "使用状态", width = 10, replace = {"使用中_1", "停用_0"})
|
||||
private Integer enableFlag;
|
||||
@Excel(name = "是否为特种胶", width = 12, replace = {"是_1", "否_0"})
|
||||
private Integer isSpecialRubber;
|
||||
@Excel(name = "ERP同步", width = 10)
|
||||
private Integer syncFromErpFlag;
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
-- MES 物料信息改造为胶料信息:补充胶料业务字段,并更新菜单名称
|
||||
ALTER TABLE `mes_material`
|
||||
ADD COLUMN `erp_code` varchar(64) DEFAULT NULL COMMENT 'ERP编号' AFTER `customer_id`,
|
||||
ADD COLUMN `final_shelf_life_days` int DEFAULT NULL COMMENT '终炼胶保质期(天)' AFTER `erp_code`,
|
||||
ADD COLUMN `master_shelf_life_days` int DEFAULT NULL COMMENT '母炼胶保质期(天)' AFTER `final_shelf_life_days`,
|
||||
ADD COLUMN `min_standing_hours` int DEFAULT NULL COMMENT '最小停放时间(时)' AFTER `master_shelf_life_days`,
|
||||
ADD COLUMN `is_special_rubber` tinyint DEFAULT 0 COMMENT '是否为特种胶(0否1是)' AFTER `enable_flag`;
|
||||
|
||||
UPDATE `sys_permission`
|
||||
SET `name` = '胶料信息'
|
||||
WHERE `component` = 'mes/materialinfo/index';
|
||||
@@ -0,0 +1,27 @@
|
||||
-- 一级菜单:MES密炼工程(目录;子菜单可后续挂接)
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`)
|
||||
SELECT '1900000000000000800', '', 'MES密炼工程', '/xslmesMixerEngineering', 'layouts/RouteView', 1, 'MesMixerEngineeringRoot', NULL, 0, NULL, '0', 82.00, 0, 'ant-design:experiment-outlined', 0, 0, 0, 0, 'MES 密炼工程(一级目录,子菜单可后续挂接或从系统管理中调整)', 'admin', NOW(), 'admin', NOW(), 0, 0, '1', 0
|
||||
FROM DUAL
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM `sys_permission`
|
||||
WHERE `id` = '1900000000000000800'
|
||||
OR (`del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES密炼工程' AND IFNULL(`parent_id`, '') = '')
|
||||
);
|
||||
|
||||
-- admin 角色授权(幂等)
|
||||
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
|
||||
SELECT REPLACE(UUID(), '-', ''), r.id, '1900000000000000800', NULL, NOW(), '127.0.0.1'
|
||||
FROM `sys_role` r
|
||||
WHERE r.`role_code` = 'admin'
|
||||
AND EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '1900000000000000800')
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.id AND rp.`permission_id` = '1900000000000000800'
|
||||
);
|
||||
|
||||
-- 目录有子菜单时 is_leaf 必须为 0(幂等修正)
|
||||
UPDATE `sys_permission`
|
||||
SET `is_leaf` = 0, `component` = 'layouts/RouteView', `menu_type` = 0, `update_time` = NOW()
|
||||
WHERE `id` = '1900000000000000800' AND `del_flag` = 0;
|
||||
@@ -0,0 +1,49 @@
|
||||
-- 一级菜单:MES技术管理、MES能源管理(目录;子菜单可后续挂接)
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
-- MES技术管理
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`)
|
||||
SELECT '1900000000000000810', '', 'MES技术管理', '/xslmesTechManagement', 'layouts/RouteView', 1, 'MesTechManagementRoot', NULL, 0, NULL, '0', 82.50, 0, 'ant-design:tool-outlined', 0, 0, 0, 0, 'MES 技术管理(一级目录,子菜单可后续挂接或从系统管理中调整)', 'admin', NOW(), 'admin', NOW(), 0, 0, '1', 0
|
||||
FROM DUAL
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM `sys_permission`
|
||||
WHERE `id` = '1900000000000000810'
|
||||
OR (`del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES技术管理' AND IFNULL(`parent_id`, '') = '')
|
||||
);
|
||||
|
||||
-- MES能源管理
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`)
|
||||
SELECT '1900000000000000820', '', 'MES能源管理', '/xslmesEnergyManagement', 'layouts/RouteView', 1, 'MesEnergyManagementRoot', NULL, 0, NULL, '0', 83.00, 0, 'ant-design:thunderbolt-outlined', 0, 0, 0, 0, 'MES 能源管理(一级目录,子菜单可后续挂接或从系统管理中调整)', 'admin', NOW(), 'admin', NOW(), 0, 0, '1', 0
|
||||
FROM DUAL
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM `sys_permission`
|
||||
WHERE `id` = '1900000000000000820'
|
||||
OR (`del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES能源管理' AND IFNULL(`parent_id`, '') = '')
|
||||
);
|
||||
|
||||
-- admin 角色授权:MES技术管理(幂等)
|
||||
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
|
||||
SELECT REPLACE(UUID(), '-', ''), r.id, '1900000000000000810', NULL, NOW(), '127.0.0.1'
|
||||
FROM `sys_role` r
|
||||
WHERE r.`role_code` = 'admin'
|
||||
AND EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '1900000000000000810')
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.id AND rp.`permission_id` = '1900000000000000810'
|
||||
);
|
||||
|
||||
-- admin 角色授权:MES能源管理(幂等)
|
||||
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
|
||||
SELECT REPLACE(UUID(), '-', ''), r.id, '1900000000000000820', NULL, NOW(), '127.0.0.1'
|
||||
FROM `sys_role` r
|
||||
WHERE r.`role_code` = 'admin'
|
||||
AND EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '1900000000000000820')
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.id AND rp.`permission_id` = '1900000000000000820'
|
||||
);
|
||||
|
||||
-- 目录有子菜单时 is_leaf 必须为 0(幂等修正)
|
||||
UPDATE `sys_permission`
|
||||
SET `is_leaf` = 0, `component` = 'layouts/RouteView', `menu_type` = 0, `update_time` = NOW()
|
||||
WHERE `id` IN ('1900000000000000810', '1900000000000000820') AND `del_flag` = 0;
|
||||
@@ -0,0 +1,116 @@
|
||||
-- MES 点检及保养项目:字典 + 建表 + 菜单 + 按钮 + 租户 admin 授权(与 jeecg-boot/db/mes-xsl-inspect-maintain-item-menu-permission.sql 一致)
|
||||
-- 权限前缀:mes:mes_xsl_inspect_maintain_item:*;父菜单:设备管理
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
SELECT REPLACE(UUID(), '-', ''), 'MES点检保养项目类别', 'xslmes_im_item_category', 'inspect点检/maintain保养', 0, 'admin', NOW(), 0, 0
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_im_item_category' AND `del_flag` = 0);
|
||||
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '点检', 'inspect', 1, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_im_item_category' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'inspect');
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '保养', 'maintain', 2, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_im_item_category' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'maintain');
|
||||
|
||||
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
SELECT REPLACE(UUID(), '-', ''), 'MES点检保养项目类型', 'xslmes_im_item_type', 'mechanical机械类/electrical电气类', 0, 'admin', NOW(), 0, 0
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_im_item_type' AND `del_flag` = 0);
|
||||
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '机械类', 'mechanical', 1, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_im_item_type' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'mechanical');
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '电气类', 'electrical', 2, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_im_item_type' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'electrical');
|
||||
|
||||
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
SELECT REPLACE(UUID(), '-', ''), 'MES点检方式', 'xslmes_im_inspect_method', 'visual视觉/sight目测/hearing听觉', 0, 'admin', NOW(), 0, 0
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_im_inspect_method' AND `del_flag` = 0);
|
||||
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '视觉', 'visual', 1, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_im_inspect_method' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'visual');
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '目测', 'sight', 2, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_im_inspect_method' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'sight');
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '听觉', 'hearing', 3, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_im_inspect_method' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'hearing');
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mes_xsl_inspect_maintain_item` (
|
||||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||||
`item_name` varchar(500) NOT NULL COMMENT '项目名称(同租户未删除数据中唯一)',
|
||||
`item_code` varchar(500) NOT NULL COMMENT '项目编号(同租户未删除数据中唯一)',
|
||||
`equipment_category_id` varchar(32) NOT NULL COMMENT '设备类别主键 mes_xsl_equipment_category.id',
|
||||
`equipment_category_name` varchar(500) DEFAULT NULL COMMENT '设备类别名称冗余',
|
||||
`equipment_type_id` varchar(32) NOT NULL COMMENT '设备类型主键 mes_xsl_equipment_type.id',
|
||||
`equipment_type_name` varchar(500) DEFAULT NULL COMMENT '设备类型名称冗余',
|
||||
`equipment_part_id` varchar(32) NOT NULL COMMENT '设备部位主键 mes_xsl_equipment_part.id',
|
||||
`equipment_part_name` varchar(500) DEFAULT NULL COMMENT '设备部位名称冗余',
|
||||
`equipment_sub_part_id` varchar(32) NOT NULL COMMENT '设备小部位主键 mes_xsl_equipment_sub_part.id',
|
||||
`equipment_sub_part_name` varchar(500) DEFAULT NULL COMMENT '设备小部位名称冗余',
|
||||
`item_category` varchar(500) NOT NULL COMMENT '项目类别(字典xslmes_im_item_category:inspect点检/maintain保养)',
|
||||
`item_type` varchar(500) NOT NULL COMMENT '项目类型(字典xslmes_im_item_type:mechanical机械类/electrical电气类)',
|
||||
`inspect_method` varchar(500) NOT NULL COMMENT '点检方式(字典xslmes_im_inspect_method:visual视觉/sight目测/hearing听觉)',
|
||||
`judgment_criteria` varchar(500) NOT NULL COMMENT '判断基准',
|
||||
`maintain_cycle_days` int DEFAULT NULL COMMENT '保养周期(天)',
|
||||
`tenant_id` int DEFAULT NULL COMMENT '租户',
|
||||
`sys_org_code` varchar(500) DEFAULT NULL COMMENT '部门',
|
||||
`create_by` varchar(500) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(500) DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`del_flag` int DEFAULT '0' COMMENT '删除标记(0正常1删除)',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_mimi_tenant_name` (`tenant_id`, `item_name`),
|
||||
KEY `idx_mimi_tenant_code` (`tenant_id`, `item_code`),
|
||||
KEY `idx_mimi_category` (`equipment_category_id`),
|
||||
KEY `idx_mimi_type` (`equipment_type_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES点检及保养项目';
|
||||
|
||||
SET @mes_tenant_id = 1002;
|
||||
|
||||
SET @mes_equip_pid = (
|
||||
SELECT `id` FROM `sys_permission`
|
||||
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '设备管理'
|
||||
LIMIT 1
|
||||
);
|
||||
SET @mes_equip_pid = IFNULL(@mes_equip_pid, '1860000000000000133');
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `keep_alive`, `internal_or_external`, `create_by`, `create_time`)
|
||||
VALUES ('1860000000000000141', @mes_equip_pid, '点检及保养项目', '/xslmes/mesXslInspectMaintainItem', 'xslmes/mesXslInspectMaintainItem/MesXslInspectMaintainItemList', NULL, 1, NULL, '1', 11, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW())
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `url` = VALUES(`url`), `component` = VALUES(`component`), `component_name` = VALUES(`component_name`),
|
||||
`menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`), `sort_no` = VALUES(`sort_no`),
|
||||
`is_route` = VALUES(`is_route`), `is_leaf` = VALUES(`is_leaf`), `hidden` = VALUES(`hidden`), `status` = VALUES(`status`), `del_flag` = VALUES(`del_flag`),
|
||||
`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`), `icon` = 'ant-design:audit-outlined';
|
||||
|
||||
UPDATE `sys_permission` SET `icon` = 'ant-design:audit-outlined' WHERE `id` = '1860000000000000141' AND `del_flag` = 0;
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `status`, `del_flag`, `create_by`, `create_time`) VALUES
|
||||
('1860000000000000142', '1860000000000000141', '新增', 2, 'mes:mes_xsl_inspect_maintain_item:add', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000143', '1860000000000000141', '编辑', 2, 'mes:mes_xsl_inspect_maintain_item:edit', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000144', '1860000000000000141', '删除', 2, 'mes:mes_xsl_inspect_maintain_item:delete', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000145', '1860000000000000141', '批量删除', 2, 'mes:mes_xsl_inspect_maintain_item:deleteBatch', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000146', '1860000000000000141', '导出', 2, 'mes:mes_xsl_inspect_maintain_item:exportXls', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000147', '1860000000000000141', '导入', 2, 'mes:mes_xsl_inspect_maintain_item:importExcel', '1', '1', 0, 'admin', NOW())
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`),
|
||||
`status` = VALUES(`status`), `del_flag` = VALUES(`del_flag`);
|
||||
|
||||
INSERT INTO `sys_role_permission`(`id`, `role_id`, `permission_id`, `operate_date`, `operate_ip`)
|
||||
SELECT REPLACE(UUID(), '-', ''), r.`id`, p.`id`, NOW(), '127.0.0.1'
|
||||
FROM `sys_role` r
|
||||
CROSS JOIN `sys_permission` p
|
||||
WHERE r.`tenant_id` = @mes_tenant_id
|
||||
AND r.`role_code` = 'admin'
|
||||
AND p.`id` IN (
|
||||
'1860000000000000141',
|
||||
'1860000000000000142', '1860000000000000143', '1860000000000000144', '1860000000000000145',
|
||||
'1860000000000000146', '1860000000000000147'
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id`
|
||||
);
|
||||
@@ -0,0 +1,96 @@
|
||||
-- 开炼机参数维护:建表 + 菜单(挂 MES技术管理)+ admin 授权
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mes_xsl_open_mill_param` (
|
||||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||||
`material_id` varchar(32) NOT NULL COMMENT '胶料ID(关联 mes_material.id)',
|
||||
`material_name` varchar(200) DEFAULT NULL COMMENT '胶料名称冗余',
|
||||
`material_code` varchar(100) DEFAULT NULL COMMENT '胶料编码冗余',
|
||||
`r0_feed_time` decimal(10,2) DEFAULT NULL COMMENT 'R0进胶时间(秒)',
|
||||
`r0_ring_time` decimal(10,2) DEFAULT NULL COMMENT 'R0成环时间(秒)',
|
||||
`r0_break_time` decimal(10,2) DEFAULT NULL COMMENT 'R0拉断时间(秒)',
|
||||
`r0_discharge_time` decimal(10,2) DEFAULT NULL COMMENT 'R0排胶时间(秒)',
|
||||
`r1_feed_time` decimal(10,2) DEFAULT NULL COMMENT 'R1进胶时间(秒)',
|
||||
`r1_ring_time` decimal(10,2) DEFAULT NULL COMMENT 'R1成环时间(秒)',
|
||||
`r1_break_time` decimal(10,2) DEFAULT NULL COMMENT 'R1拉断时间(秒)',
|
||||
`r1_discharge_time` decimal(10,2) DEFAULT NULL COMMENT 'R1排胶时间(秒)',
|
||||
`tenant_id` int DEFAULT NULL COMMENT '租户ID',
|
||||
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '所属部门',
|
||||
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(50) DEFAULT NULL COMMENT '修改人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`del_flag` int NOT NULL DEFAULT 0 COMMENT '逻辑删除(0正常 1已删除)',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_momp_material_id` (`material_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES开炼机参数维护';
|
||||
|
||||
-- 父级目录有子菜单时必须 is_leaf=0,否则菜单管理树/侧边栏不会展开子节点
|
||||
UPDATE `sys_permission`
|
||||
SET `is_leaf` = 0, `update_time` = NOW()
|
||||
WHERE `id` = '1900000000000000810' AND `is_leaf` = 1;
|
||||
|
||||
-- 二级菜单:开炼机参数维护(父级 MES技术管理 1900000000000000810)
|
||||
INSERT INTO `sys_permission` (
|
||||
`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`,
|
||||
`menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`,
|
||||
`hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`,
|
||||
`del_flag`, `rule_flag`, `status`, `internal_or_external`
|
||||
)
|
||||
SELECT
|
||||
'177925970995501', '1900000000000000810', '开炼机参数维护', '/xslmes/mesXslOpenMillParam',
|
||||
'xslmes/mesXslOpenMillParam/MesXslOpenMillParamList', 1, 'MesXslOpenMillParamList', NULL,
|
||||
1, NULL, '0', 1.00, 0, 'ant-design:setting-outlined', 0, 1,
|
||||
0, 0, 'MES开炼机参数维护', 'admin', NOW(), 'admin', NOW(),
|
||||
0, 0, '1', 0
|
||||
FROM DUAL
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM `sys_permission`
|
||||
WHERE `id` = '177925970995501'
|
||||
OR (`del_flag` = 0 AND `menu_type` = 1 AND `name` = '开炼机参数维护' AND `parent_id` = '1900000000000000810')
|
||||
);
|
||||
|
||||
-- 按钮权限
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
SELECT '177925970995502', '177925970995501', '新增', 2, 'xslmes:mes_xsl_open_mill_param:add', '1', 1.00, 0, 1, 0, '1', 0, 'admin', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995502');
|
||||
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
SELECT '177925970995503', '177925970995501', '编辑', 2, 'xslmes:mes_xsl_open_mill_param:edit', '1', 2.00, 0, 1, 0, '1', 0, 'admin', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995503');
|
||||
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
SELECT '177925970995504', '177925970995501', '删除', 2, 'xslmes:mes_xsl_open_mill_param:delete', '1', 3.00, 0, 1, 0, '1', 0, 'admin', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995504');
|
||||
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
SELECT '177925970995505', '177925970995501', '批量删除', 2, 'xslmes:mes_xsl_open_mill_param:deleteBatch', '1', 4.00, 0, 1, 0, '1', 0, 'admin', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995505');
|
||||
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
SELECT '177925970995506', '177925970995501', '导出', 2, 'xslmes:mes_xsl_open_mill_param:exportXls', '1', 5.00, 0, 1, 0, '1', 0, 'admin', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995506');
|
||||
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
SELECT '177925970995507', '177925970995501', '导入', 2, 'xslmes:mes_xsl_open_mill_param:importExcel', '1', 6.00, 0, 1, 0, '1', 0, 'admin', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995507');
|
||||
|
||||
-- admin 角色授权
|
||||
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
|
||||
SELECT REPLACE(UUID(), '-', ''), r.id, p.id, NULL, NOW(), '127.0.0.1'
|
||||
FROM `sys_role` r
|
||||
CROSS JOIN `sys_permission` p
|
||||
WHERE r.`role_code` = 'admin'
|
||||
AND p.`id` IN (
|
||||
'177925970995501',
|
||||
'177925970995502',
|
||||
'177925970995503',
|
||||
'177925970995504',
|
||||
'177925970995505',
|
||||
'177925970995506',
|
||||
'177925970995507'
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.id AND rp.`permission_id` = p.id
|
||||
);
|
||||
@@ -0,0 +1,12 @@
|
||||
-- 修复 MES 一级目录菜单:目录节点 is_leaf 必须为 0,否则侧边栏/菜单管理树无法展开子菜单
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
UPDATE `sys_permission`
|
||||
SET
|
||||
`is_leaf` = 0,
|
||||
`component` = 'layouts/RouteView',
|
||||
`menu_type` = 0,
|
||||
`update_by` = 'admin',
|
||||
`update_time` = NOW()
|
||||
WHERE `id` IN ('1900000000000000800', '1900000000000000810', '1900000000000000820')
|
||||
AND `del_flag` = 0;
|
||||
@@ -0,0 +1,130 @@
|
||||
-- MES胶料分类(分类字典 sys_category)
|
||||
-- 前端 JCategorySelect 使用 pcode = XSLMES_RUBBER
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
-- 根节点:MES胶料分类
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000001', '0', 'MES胶料分类', 'XSLMES_RUBBER', '1', 'admin', NOW()
|
||||
FROM DUAL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER');
|
||||
|
||||
-- 胶料类别(叶子节点,顺序与业务下拉一致)
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000101', root.`id`, '胎面胶', 'XSLMES_RUBBER_TMJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_TMJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000102', root.`id`, '包布胶', 'XSLMES_RUBBER_BBJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_BBJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000103', root.`id`, '子口胶片', 'XSLMES_RUBBER_ZKKJP', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_ZKKJP');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000104', root.`id`, '三角胶', 'XSLMES_RUBBER_SJJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_SJJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000105', root.`id`, '带束层胶', 'XSLMES_RUBBER_DSJC', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_DSJC');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000106', root.`id`, '输送带胶', 'XSLMES_RUBBER_SSDJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_SSDJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000107', root.`id`, '胶糊胶', 'XSLMES_RUBBER_JHJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_JHJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000108', root.`id`, '过渡层', 'XSLMES_RUBBER_GDC', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_GDC');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000109', root.`id`, '终炼返炼', 'XSLMES_RUBBER_ZLFL', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_ZLFL');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000110', root.`id`, '塑炼胶', 'XSLMES_RUBBER_SLJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_SLJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000111', root.`id`, '注射胶', 'XSLMES_RUBBER_ZSJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_ZSJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000112', root.`id`, '胎侧胶', 'XSLMES_RUBBER_TCJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_TCJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000113', root.`id`, '缠绕胶', 'XSLMES_RUBBER_CRJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_CRJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000114', root.`id`, '骨板胶', 'XSLMES_RUBBER_GBJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_GBJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000115', root.`id`, '外层胶', 'XSLMES_RUBBER_WCJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_WCJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000116', root.`id`, '胶芯胶', 'XSLMES_RUBBER_JXJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_JXJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000117', root.`id`, '胶囊胶', 'XSLMES_RUBBER_JNJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_JNJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000118', root.`id`, '冠带条', 'XSLMES_RUBBER_GDT', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_GDT');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000119', root.`id`, '子口耐磨胶', 'XSLMES_RUBBER_ZKNMJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_ZKNMJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000120', root.`id`, '缓冲胶', 'XSLMES_RUBBER_HCJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_HCJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000121', root.`id`, '钢丝胶', 'XSLMES_RUBBER_GSJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_GSJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000122', root.`id`, '出口胎面', 'XSLMES_RUBBER_CKTM', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_CKTM');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000123', root.`id`, '帘线胶', 'XSLMES_RUBBER_LXJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_LXJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000124', root.`id`, '基部胶', 'XSLMES_RUBBER_JBJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_JBJ');
|
||||
@@ -0,0 +1,27 @@
|
||||
-- MES胶料分类:追加 5 项(已执行 V3.9.2_80 的环境增量脚本)
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000120', root.`id`, '缓冲胶', 'XSLMES_RUBBER_HCJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_HCJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000121', root.`id`, '钢丝胶', 'XSLMES_RUBBER_GSJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_GSJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000122', root.`id`, '出口胎面', 'XSLMES_RUBBER_CKTM', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_CKTM');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000123', root.`id`, '帘线胶', 'XSLMES_RUBBER_LXJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_LXJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000124', root.`id`, '基部胶', 'XSLMES_RUBBER_JBJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_JBJ');
|
||||
@@ -0,0 +1,28 @@
|
||||
-- 修复 MES胶料分类名称乱码(PowerShell 管道导入时中文被替换成 ?)
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
UPDATE `sys_category` SET `name` = 'MES胶料分类', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER';
|
||||
UPDATE `sys_category` SET `name` = '胎面胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_TMJ';
|
||||
UPDATE `sys_category` SET `name` = '包布胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_BBJ';
|
||||
UPDATE `sys_category` SET `name` = '子口胶片', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_ZKKJP';
|
||||
UPDATE `sys_category` SET `name` = '三角胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_SJJ';
|
||||
UPDATE `sys_category` SET `name` = '带束层胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_DSJC';
|
||||
UPDATE `sys_category` SET `name` = '输送带胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_SSDJ';
|
||||
UPDATE `sys_category` SET `name` = '胶糊胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_JHJ';
|
||||
UPDATE `sys_category` SET `name` = '过渡层', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_GDC';
|
||||
UPDATE `sys_category` SET `name` = '终炼返炼', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_ZLFL';
|
||||
UPDATE `sys_category` SET `name` = '塑炼胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_SLJ';
|
||||
UPDATE `sys_category` SET `name` = '注射胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_ZSJ';
|
||||
UPDATE `sys_category` SET `name` = '胎侧胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_TCJ';
|
||||
UPDATE `sys_category` SET `name` = '缠绕胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_CRJ';
|
||||
UPDATE `sys_category` SET `name` = '骨板胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_GBJ';
|
||||
UPDATE `sys_category` SET `name` = '外层胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_WCJ';
|
||||
UPDATE `sys_category` SET `name` = '胶芯胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_JXJ';
|
||||
UPDATE `sys_category` SET `name` = '胶囊胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_JNJ';
|
||||
UPDATE `sys_category` SET `name` = '冠带条', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_GDT';
|
||||
UPDATE `sys_category` SET `name` = '子口耐磨胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_ZKNMJ';
|
||||
UPDATE `sys_category` SET `name` = '缓冲胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_HCJ';
|
||||
UPDATE `sys_category` SET `name` = '钢丝胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_GSJ';
|
||||
UPDATE `sys_category` SET `name` = '出口胎面', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_CKTM';
|
||||
UPDATE `sys_category` SET `name` = '帘线胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_LXJ';
|
||||
UPDATE `sys_category` SET `name` = '基部胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_JBJ';
|
||||
@@ -0,0 +1,90 @@
|
||||
-- 密炼物料替代对应关系:建表 + 菜单(挂 MES技术管理)+ admin 授权
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mes_xsl_mixer_material_substitute` (
|
||||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||||
`serial_no` int DEFAULT NULL COMMENT '编号(租户内自动累加,从1开始)',
|
||||
`mixer_material_id` varchar(32) NOT NULL COMMENT '密炼物料ID(关联 mes_mixer_material.id)',
|
||||
`mixer_material_code` varchar(100) DEFAULT NULL COMMENT '密炼物料编码冗余',
|
||||
`mixer_material_name` varchar(200) DEFAULT NULL COMMENT '密炼物料名称冗余',
|
||||
`substitute_material_id` varchar(32) NOT NULL COMMENT '替代密炼物料ID(关联 mes_mixer_material.id)',
|
||||
`substitute_material_code` varchar(100) DEFAULT NULL COMMENT '替代密炼物料编码冗余',
|
||||
`substitute_material_name` varchar(200) DEFAULT NULL COMMENT '替代密炼物料名称冗余',
|
||||
`tenant_id` int DEFAULT NULL COMMENT '租户ID',
|
||||
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '所属部门',
|
||||
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(50) DEFAULT NULL COMMENT '修改人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`del_flag` int NOT NULL DEFAULT 0 COMMENT '逻辑删除(0正常 1已删除)',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_mxmms_mixer_material_id` (`mixer_material_id`),
|
||||
KEY `idx_mxmms_substitute_material_id` (`substitute_material_id`),
|
||||
KEY `idx_mxmms_tenant_serial` (`tenant_id`, `serial_no`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES密炼物料替代对应关系';
|
||||
|
||||
UPDATE `sys_permission`
|
||||
SET `is_leaf` = 0, `update_time` = NOW()
|
||||
WHERE `id` = '1900000000000000810' AND `is_leaf` = 1;
|
||||
|
||||
INSERT INTO `sys_permission` (
|
||||
`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`,
|
||||
`menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`,
|
||||
`hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`,
|
||||
`del_flag`, `rule_flag`, `status`, `internal_or_external`
|
||||
)
|
||||
SELECT
|
||||
'177925970995511', '1900000000000000810', '密炼物料替代对应关系', '/xslmes/mesXslMixerMaterialSubstitute',
|
||||
'xslmes/mesXslMixerMaterialSubstitute/MesXslMixerMaterialSubstituteList', 1, 'MesXslMixerMaterialSubstituteList', NULL,
|
||||
1, NULL, '0', 2.00, 0, 'ant-design:swap-outlined', 0, 1,
|
||||
0, 0, 'MES密炼物料替代对应关系', 'admin', NOW(), 'admin', NOW(),
|
||||
0, 0, '1', 0
|
||||
FROM DUAL
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM `sys_permission`
|
||||
WHERE `id` = '177925970995511'
|
||||
OR (`del_flag` = 0 AND `menu_type` = 1 AND `name` = '密炼物料替代对应关系' AND `parent_id` = '1900000000000000810')
|
||||
);
|
||||
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
SELECT '177925970995512', '177925970995511', '新增', 2, 'xslmes:mes_xsl_mixer_material_substitute:add', '1', 1.00, 0, 1, 0, '1', 0, 'admin', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995512');
|
||||
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
SELECT '177925970995513', '177925970995511', '编辑', 2, 'xslmes:mes_xsl_mixer_material_substitute:edit', '1', 2.00, 0, 1, 0, '1', 0, 'admin', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995513');
|
||||
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
SELECT '177925970995514', '177925970995511', '删除', 2, 'xslmes:mes_xsl_mixer_material_substitute:delete', '1', 3.00, 0, 1, 0, '1', 0, 'admin', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995514');
|
||||
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
SELECT '177925970995515', '177925970995511', '批量删除', 2, 'xslmes:mes_xsl_mixer_material_substitute:deleteBatch', '1', 4.00, 0, 1, 0, '1', 0, 'admin', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995515');
|
||||
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
SELECT '177925970995516', '177925970995511', '导出', 2, 'xslmes:mes_xsl_mixer_material_substitute:exportXls', '1', 5.00, 0, 1, 0, '1', 0, 'admin', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995516');
|
||||
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
SELECT '177925970995517', '177925970995511', '导入', 2, 'xslmes:mes_xsl_mixer_material_substitute:importExcel', '1', 6.00, 0, 1, 0, '1', 0, 'admin', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995517');
|
||||
|
||||
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
|
||||
SELECT REPLACE(UUID(), '-', ''), r.id, p.id, NULL, NOW(), '127.0.0.1'
|
||||
FROM `sys_role` r
|
||||
CROSS JOIN `sys_permission` p
|
||||
WHERE r.`role_code` = 'admin'
|
||||
AND p.`id` IN (
|
||||
'177925970995511',
|
||||
'177925970995512',
|
||||
'177925970995513',
|
||||
'177925970995514',
|
||||
'177925970995515',
|
||||
'177925970995516',
|
||||
'177925970995517'
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.id AND rp.`permission_id` = p.id
|
||||
);
|
||||
@@ -0,0 +1,52 @@
|
||||
-- 密炼物料替代对应关系:菜单补跑脚本(遇 1213 死锁时单独执行)
|
||||
-- 说明:建表已成功时可只跑本脚本;建议先暂停后端,逐条执行或整段执行一次
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
UPDATE `sys_permission`
|
||||
SET `is_leaf` = 0, `update_time` = NOW()
|
||||
WHERE `id` = '1900000000000000810';
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (
|
||||
`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`,
|
||||
`menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`,
|
||||
`hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`,
|
||||
`del_flag`, `rule_flag`, `status`, `internal_or_external`
|
||||
) VALUES (
|
||||
'177925970995511', '1900000000000000810', '密炼物料替代对应关系', '/xslmes/mesXslMixerMaterialSubstitute',
|
||||
'xslmes/mesXslMixerMaterialSubstitute/MesXslMixerMaterialSubstituteList', 1, 'MesXslMixerMaterialSubstituteList', NULL,
|
||||
1, NULL, '0', 2.00, 0, 'ant-design:swap-outlined', 0, 1,
|
||||
0, 0, 'MES密炼物料替代对应关系', 'admin', NOW(), 'admin', NOW(),
|
||||
0, 0, '1', 0
|
||||
);
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
VALUES ('177925970995512', '177925970995511', '新增', 2, 'xslmes:mes_xsl_mixer_material_substitute:add', '1', 1.00, 0, 1, 0, '1', 0, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
VALUES ('177925970995513', '177925970995511', '编辑', 2, 'xslmes:mes_xsl_mixer_material_substitute:edit', '1', 2.00, 0, 1, 0, '1', 0, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
VALUES ('177925970995514', '177925970995511', '删除', 2, 'xslmes:mes_xsl_mixer_material_substitute:delete', '1', 3.00, 0, 1, 0, '1', 0, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
VALUES ('177925970995515', '177925970995511', '批量删除', 2, 'xslmes:mes_xsl_mixer_material_substitute:deleteBatch', '1', 4.00, 0, 1, 0, '1', 0, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
VALUES ('177925970995516', '177925970995511', '导出', 2, 'xslmes:mes_xsl_mixer_material_substitute:exportXls', '1', 5.00, 0, 1, 0, '1', 0, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
VALUES ('177925970995517', '177925970995511', '导入', 2, 'xslmes:mes_xsl_mixer_material_substitute:importExcel', '1', 6.00, 0, 1, 0, '1', 0, 'admin', NOW());
|
||||
|
||||
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
|
||||
SELECT REPLACE(UUID(), '-', ''), r.id, p.id, NULL, NOW(), '127.0.0.1'
|
||||
FROM `sys_role` r
|
||||
CROSS JOIN `sys_permission` p
|
||||
WHERE r.`role_code` = 'admin'
|
||||
AND p.`id` IN (
|
||||
'177925970995511', '177925970995512', '177925970995513', '177925970995514',
|
||||
'177925970995515', '177925970995516', '177925970995517'
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.id AND rp.`permission_id` = p.id
|
||||
);
|
||||
@@ -7,10 +7,10 @@ VITE_PUBLIC_PATH = /
|
||||
|
||||
# 跨域代理:前缀需与 VITE_GLOB_API_URL 一致,且 rewrite 后路径需包含后端 context-path(/jeecg-boot)
|
||||
# 详见 build/vite/proxy.ts
|
||||
VITE_PROXY = [["/jeecg-boot","http://localhost:8888/jeecg-boot"],["/upload","http://localhost:3300/upload"]]
|
||||
VITE_PROXY = [["/jeecg-boot","http://localhost:8888"],["/upload","http://localhost:3300/upload"]]
|
||||
|
||||
#后台接口全路径地址(必填)
|
||||
VITE_GLOB_DOMAIN_URL=http://localhost:8888/jeecg-boot
|
||||
VITE_GLOB_DOMAIN_URL=http://localhost:8888
|
||||
|
||||
#后台接口父地址(必填),与 server.servlet.context-path 一致,避免仅去掉别名前缀后缺少 /jeecg-boot
|
||||
VITE_GLOB_API_URL=/jeecg-boot
|
||||
|
||||
@@ -13,7 +13,7 @@ VITE_BUILD_COMPRESS = 'gzip'
|
||||
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
|
||||
|
||||
#后台接口父地址(必填)
|
||||
VITE_GLOB_API_URL=/jeecgboot
|
||||
VITE_GLOB_API_URL=/jeecg-boot
|
||||
|
||||
#后台接口全路径地址(必填)
|
||||
VITE_GLOB_DOMAIN_URL=http://127.0.0.1:8888/jeecg-boot
|
||||
|
||||
@@ -1,67 +1,143 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
import { loadTreeData } from '/@/api/common/api';
|
||||
|
||||
function useStatusText(v: unknown) {
|
||||
if (v === 1) return '使用中';
|
||||
if (v === 0) return '停用';
|
||||
return '-';
|
||||
}
|
||||
|
||||
function specialRubberText(v: unknown) {
|
||||
if (v === 1) return '是';
|
||||
if (v === 0) return '否';
|
||||
return '-';
|
||||
}
|
||||
|
||||
const useStatusOptions = [
|
||||
{ label: '使用中', value: 1 },
|
||||
{ label: '停用', value: 0 },
|
||||
];
|
||||
|
||||
const specialRubberOptions = [
|
||||
{ label: '是', value: 1 },
|
||||
{ label: '否', value: 0 },
|
||||
];
|
||||
|
||||
const glueCategoryProps = {
|
||||
api: loadTreeData,
|
||||
params: { pcode: 'XSLMES_MATERIAL' },
|
||||
resultField: '',
|
||||
labelField: 'title',
|
||||
valueField: 'key',
|
||||
placeholder: '请选择胶料类别',
|
||||
};
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{ title: '物料编码', align: 'center', dataIndex: 'materialCode' },
|
||||
{ title: '物料名称', align: 'center', dataIndex: 'materialName' },
|
||||
{ title: '分类', align: 'center', dataIndex: 'categoryId_dictText' },
|
||||
{ title: '基础单位', align: 'center', dataIndex: 'baseUnitId_dictText' },
|
||||
{ title: '状态', align: 'center', dataIndex: 'enableFlag' },
|
||||
{ title: '创建时间', align: 'center', dataIndex: 'createTime' },
|
||||
{ title: '胶料名称', align: 'center', width: 160, dataIndex: 'materialName' },
|
||||
{ title: '胶料类别', align: 'center', width: 140, dataIndex: 'categoryId_dictText' },
|
||||
{ title: '胶料别名', align: 'center', width: 140, dataIndex: 'aliasName' },
|
||||
{ title: '胶料客户', align: 'center', width: 140, dataIndex: 'customerId_dictText' },
|
||||
{ title: 'ERP编号', align: 'center', width: 140, dataIndex: 'erpCode' },
|
||||
{ title: '终炼胶保质期(天)', align: 'center', width: 150, dataIndex: 'finalShelfLifeDays' },
|
||||
{ title: '母炼胶保质期(天)', align: 'center', width: 150, dataIndex: 'masterShelfLifeDays' },
|
||||
{ title: '最小停放时间(时)', align: 'center', width: 150, dataIndex: 'minStandingHours' },
|
||||
{
|
||||
title: '使用状态',
|
||||
align: 'center',
|
||||
width: 110,
|
||||
dataIndex: 'enableFlag',
|
||||
customRender: ({ text }) => useStatusText(text),
|
||||
},
|
||||
{
|
||||
title: '是否为特种胶',
|
||||
align: 'center',
|
||||
width: 120,
|
||||
dataIndex: 'isSpecialRubber',
|
||||
customRender: ({ text }) => specialRubberText(text),
|
||||
},
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{ label: '物料编码', field: 'materialCode', component: 'Input', colProps: { span: 6 } },
|
||||
{ label: '物料名称', field: 'materialName', component: 'Input', colProps: { span: 6 } },
|
||||
{ label: '胶料名称', field: 'materialName', component: 'Input', colProps: { span: 6 } },
|
||||
{
|
||||
label: '分类',
|
||||
label: '胶料类别',
|
||||
field: 'categoryId',
|
||||
component: 'ApiSelect',
|
||||
componentProps: glueCategoryProps,
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{
|
||||
label: '胶料客户',
|
||||
field: 'customerId',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: { dictCode: 'mes_material_category,category_name,id' },
|
||||
componentProps: { dictCode: 'mes_xsl_customer,customer_name,id' },
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{ label: 'ERP编号', field: 'erpCode', component: 'Input', colProps: { span: 6 } },
|
||||
{
|
||||
label: '使用状态',
|
||||
field: 'enableFlag',
|
||||
component: 'Select',
|
||||
componentProps: { options: useStatusOptions },
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{
|
||||
label: '是否为特种胶',
|
||||
field: 'isSpecialRubber',
|
||||
component: 'Select',
|
||||
componentProps: { options: specialRubberOptions },
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
];
|
||||
|
||||
export const formSchema: FormSchema[] = [
|
||||
{ label: '', field: 'id', component: 'Input', show: false },
|
||||
{ label: '物料编码', field: 'materialCode', component: 'Input', required: true },
|
||||
{ label: '物料名称', field: 'materialName', component: 'Input', required: true },
|
||||
{ label: '别名', field: 'aliasName', component: 'Input' },
|
||||
{ label: '简称', field: 'shortName', component: 'Input' },
|
||||
{ label: '胶料名称', field: 'materialName', component: 'Input', required: true },
|
||||
{
|
||||
label: '分类',
|
||||
label: '胶料类别',
|
||||
field: 'categoryId',
|
||||
component: 'JDictSelectTag',
|
||||
component: 'ApiSelect',
|
||||
required: true,
|
||||
componentProps: { dictCode: 'mes_material_category,category_name,id' },
|
||||
componentProps: glueCategoryProps,
|
||||
},
|
||||
{ label: '胶料别名', field: 'aliasName', component: 'Input' },
|
||||
{
|
||||
label: '基础单位',
|
||||
field: 'baseUnitId',
|
||||
label: '胶料客户',
|
||||
field: 'customerId',
|
||||
component: 'JDictSelectTag',
|
||||
required: true,
|
||||
componentProps: { dictCode: 'mes_unit,unit_name,id' },
|
||||
componentProps: { dictCode: 'mes_xsl_customer,customer_name,id', placeholder: '请选择胶料客户' },
|
||||
},
|
||||
{ label: 'ERP编号', field: 'erpCode', component: 'Input' },
|
||||
{
|
||||
label: '终炼胶保质期(天)',
|
||||
field: 'finalShelfLifeDays',
|
||||
component: 'InputNumber',
|
||||
componentProps: { min: 0, precision: 0 },
|
||||
},
|
||||
{
|
||||
label: '统计单位',
|
||||
field: 'statUnitId',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: { dictCode: 'mes_unit,unit_name,id' },
|
||||
label: '母炼胶保质期(天)',
|
||||
field: 'masterShelfLifeDays',
|
||||
component: 'InputNumber',
|
||||
componentProps: { min: 0, precision: 0 },
|
||||
},
|
||||
{ label: '计划价格', field: 'planPrice', component: 'InputNumber' },
|
||||
{ label: '最小库存', field: 'minStock', component: 'InputNumber' },
|
||||
{ label: '最大库存', field: 'maxStock', component: 'InputNumber' },
|
||||
{ label: '换算系数', field: 'unitConvertRate', component: 'InputNumber', defaultValue: 1 },
|
||||
{
|
||||
label: '状态',
|
||||
label: '最小停放时间(时)',
|
||||
field: 'minStandingHours',
|
||||
component: 'InputNumber',
|
||||
componentProps: { min: 0, precision: 0 },
|
||||
},
|
||||
{
|
||||
label: '使用状态',
|
||||
field: 'enableFlag',
|
||||
component: 'Select',
|
||||
defaultValue: 1,
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '启用', value: 1 },
|
||||
{ label: '停用', value: 0 },
|
||||
],
|
||||
},
|
||||
componentProps: { options: useStatusOptions },
|
||||
},
|
||||
{
|
||||
label: '是否为特种胶',
|
||||
field: 'isSpecialRubber',
|
||||
component: 'Select',
|
||||
defaultValue: 0,
|
||||
componentProps: { options: specialRubberOptions },
|
||||
},
|
||||
{ label: '备注', field: 'remark', component: 'InputTextArea' },
|
||||
];
|
||||
|
||||
@@ -33,14 +33,14 @@ import { batchDelete, deleteOne, getExportUrl, getImportUrl, list } from './MesM
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const { tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '物料信息',
|
||||
title: '胶料信息',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: true,
|
||||
formConfig: { labelWidth: 120, schemas: searchFormSchema, autoSubmitOnEnter: true, showAdvancedButton: true },
|
||||
actionColumn: { width: 120 },
|
||||
},
|
||||
exportConfig: { name: '物料信息', url: getExportUrl },
|
||||
exportConfig: { name: '胶料信息', url: getExportUrl },
|
||||
importConfig: { url: getImportUrl, success: handleSuccess },
|
||||
});
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
|
||||
@@ -30,7 +30,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
|
||||
setProps({ disabled: !data?.showFooter });
|
||||
});
|
||||
|
||||
const title = computed(() => (!unref(isUpdate) ? '新增物料' : '编辑物料'));
|
||||
const title = computed(() => (!unref(isUpdate) ? '新增胶料' : '编辑胶料'));
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/xslmes/mesXslInspectMaintainItem/list',
|
||||
checkItemName = '/xslmes/mesXslInspectMaintainItem/checkItemName',
|
||||
checkItemCode = '/xslmes/mesXslInspectMaintainItem/checkItemCode',
|
||||
save = '/xslmes/mesXslInspectMaintainItem/add',
|
||||
edit = '/xslmes/mesXslInspectMaintainItem/edit',
|
||||
deleteOne = '/xslmes/mesXslInspectMaintainItem/delete',
|
||||
deleteBatch = '/xslmes/mesXslInspectMaintainItem/deleteBatch',
|
||||
importExcel = '/xslmes/mesXslInspectMaintainItem/importExcel',
|
||||
exportXls = '/xslmes/mesXslInspectMaintainItem/exportXls',
|
||||
queryById = '/xslmes/mesXslInspectMaintainItem/queryById',
|
||||
}
|
||||
|
||||
export const getExportUrl = Api.exportXls;
|
||||
export const getImportUrl = Api.importExcel;
|
||||
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
export const queryById = (params: { id: string }) => defHttp.get({ url: Api.queryById, params });
|
||||
|
||||
export const checkItemName = (params: { itemName: string; dataId?: string }) =>
|
||||
defHttp.get(
|
||||
{ url: Api.checkItemName, params },
|
||||
{
|
||||
successMessageMode: 'none',
|
||||
errorMessageMode: 'none',
|
||||
},
|
||||
);
|
||||
|
||||
export const checkItemCode = (params: { itemCode: string; dataId?: string }) =>
|
||||
defHttp.get(
|
||||
{ url: Api.checkItemCode, params },
|
||||
{
|
||||
successMessageMode: 'none',
|
||||
errorMessageMode: 'none',
|
||||
},
|
||||
);
|
||||
|
||||
export const deleteOne = (params, handleSuccess) => {
|
||||
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
};
|
||||
|
||||
export const batchDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
const url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url, params });
|
||||
};
|
||||
@@ -0,0 +1,153 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
import { checkItemCode, checkItemName } from './MesXslInspectMaintainItem.api';
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{ title: '项目名称', align: 'center', dataIndex: 'itemName', width: 140 },
|
||||
{ title: '项目编号', align: 'center', dataIndex: 'itemCode', width: 120 },
|
||||
{ title: '设备类别', align: 'center', dataIndex: 'equipmentCategoryName', width: 120 },
|
||||
{ title: '设备类型', align: 'center', dataIndex: 'equipmentTypeName', width: 120 },
|
||||
{ title: '设备部位', align: 'center', dataIndex: 'equipmentPartName', width: 120 },
|
||||
{ title: '设备小部位', align: 'center', dataIndex: 'equipmentSubPartName', width: 120 },
|
||||
{ title: '项目类别', align: 'center', dataIndex: 'itemCategory_dictText', width: 90 },
|
||||
{ title: '项目类型', align: 'center', dataIndex: 'itemType_dictText', width: 90 },
|
||||
{ title: '点检方式', align: 'center', dataIndex: 'inspectMethod_dictText', width: 90 },
|
||||
{ title: '判断基准', align: 'center', dataIndex: 'judgmentCriteria', width: 160, ellipsis: true },
|
||||
{ title: '保养周期(天)', align: 'center', dataIndex: 'maintainCycleDays', width: 110 },
|
||||
{ title: '创建人', align: 'center', dataIndex: 'createBy', width: 100 },
|
||||
{
|
||||
title: '创建时间',
|
||||
align: 'center',
|
||||
dataIndex: 'createTime',
|
||||
width: 165,
|
||||
customRender: ({ text }) => (!text ? '' : String(text).length > 19 ? String(text).substring(0, 19) : text),
|
||||
},
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{ label: '项目名称', field: 'itemName', component: 'Input', colProps: { span: 6 } },
|
||||
{ label: '项目编号', field: 'itemCode', component: 'Input', colProps: { span: 6 } },
|
||||
{ label: '设备类别', field: 'equipmentCategoryName', component: 'Input', colProps: { span: 6 } },
|
||||
{
|
||||
label: '项目类别',
|
||||
field: 'itemCategory',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: { dictCode: 'xslmes_im_item_category' },
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
];
|
||||
|
||||
export const formSchema: FormSchema[] = [
|
||||
{ label: '', field: 'id', component: 'Input', show: false },
|
||||
{
|
||||
label: '项目名称',
|
||||
field: 'itemName',
|
||||
component: 'Input',
|
||||
componentProps: { placeholder: '同租户内未删除数据中不可重复' },
|
||||
dynamicRules: ({ model }) => [
|
||||
{ required: true, message: '请输入项目名称' },
|
||||
{
|
||||
validator: async (_rule, value) => {
|
||||
const v = value == null ? '' : String(value).trim();
|
||||
if (!v) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
try {
|
||||
await checkItemName({ itemName: v, dataId: model?.id });
|
||||
return Promise.resolve();
|
||||
} catch (e: any) {
|
||||
const msg = e?.response?.data?.message || e?.message || '项目名称不能重复';
|
||||
return Promise.reject(msg);
|
||||
}
|
||||
},
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '项目编号',
|
||||
field: 'itemCode',
|
||||
component: 'Input',
|
||||
componentProps: { placeholder: '同租户内未删除数据中不可重复' },
|
||||
dynamicRules: ({ model }) => [
|
||||
{ required: true, message: '请输入项目编号' },
|
||||
{
|
||||
validator: async (_rule, value) => {
|
||||
const v = value == null ? '' : String(value).trim();
|
||||
if (!v) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
try {
|
||||
await checkItemCode({ itemCode: v, dataId: model?.id });
|
||||
return Promise.resolve();
|
||||
} catch (e: any) {
|
||||
const msg = e?.response?.data?.message || e?.message || '项目编号不能重复';
|
||||
return Promise.reject(msg);
|
||||
}
|
||||
},
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
{ label: '', field: 'equipmentCategoryId', component: 'Input', show: false },
|
||||
{
|
||||
label: '设备类别',
|
||||
field: 'equipmentCategoryName',
|
||||
component: 'Input',
|
||||
slot: 'equipmentCategoryPicker',
|
||||
},
|
||||
{ label: '', field: 'equipmentTypeId', component: 'Input', show: false },
|
||||
{
|
||||
label: '设备类型',
|
||||
field: 'equipmentTypeName',
|
||||
component: 'Input',
|
||||
slot: 'equipmentTypePicker',
|
||||
},
|
||||
{ label: '', field: 'equipmentPartId', component: 'Input', show: false },
|
||||
{
|
||||
label: '设备部位',
|
||||
field: 'equipmentPartName',
|
||||
component: 'Input',
|
||||
slot: 'equipmentPartPicker',
|
||||
},
|
||||
{ label: '', field: 'equipmentSubPartId', component: 'Input', show: false },
|
||||
{
|
||||
label: '设备小部位',
|
||||
field: 'equipmentSubPartName',
|
||||
component: 'Input',
|
||||
slot: 'equipmentSubPartPicker',
|
||||
},
|
||||
{
|
||||
label: '项目类别',
|
||||
field: 'itemCategory',
|
||||
component: 'JDictSelectTag',
|
||||
required: true,
|
||||
componentProps: { dictCode: 'xslmes_im_item_category', placeholder: '点检/保养' },
|
||||
},
|
||||
{
|
||||
label: '项目类型',
|
||||
field: 'itemType',
|
||||
component: 'JDictSelectTag',
|
||||
required: true,
|
||||
componentProps: { dictCode: 'xslmes_im_item_type', placeholder: '机械类/电气类' },
|
||||
},
|
||||
{
|
||||
label: '点检方式',
|
||||
field: 'inspectMethod',
|
||||
component: 'JDictSelectTag',
|
||||
required: true,
|
||||
componentProps: { dictCode: 'xslmes_im_inspect_method', placeholder: '视觉/目测/听觉' },
|
||||
},
|
||||
{
|
||||
label: '判断基准',
|
||||
field: 'judgmentCriteria',
|
||||
component: 'InputTextArea',
|
||||
required: true,
|
||||
componentProps: { rows: 3, maxlength: 500, showCount: true },
|
||||
},
|
||||
{
|
||||
label: '保养周期(天)',
|
||||
field: 'maintainCycleDays',
|
||||
component: 'InputNumber',
|
||||
componentProps: { min: 0, precision: 0, style: { width: '100%' } },
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,132 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<template #tableTitle>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-auth="'mes:mes_xsl_inspect_maintain_item:add'"
|
||||
@click="handleAdd"
|
||||
preIcon="ant-design:plus-outlined"
|
||||
>
|
||||
新增
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-auth="'mes:mes_xsl_inspect_maintain_item:exportXls'"
|
||||
preIcon="ant-design:export-outlined"
|
||||
@click="onExportXls"
|
||||
>
|
||||
导出
|
||||
</a-button>
|
||||
<j-upload-button
|
||||
type="primary"
|
||||
v-auth="'mes:mes_xsl_inspect_maintain_item:importExcel'"
|
||||
preIcon="ant-design:import-outlined"
|
||||
@click="onImportXls"
|
||||
>
|
||||
导入
|
||||
</j-upload-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined" />
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button v-auth="'mes:mes_xsl_inspect_maintain_item:deleteBatch'">
|
||||
批量操作
|
||||
<Icon icon="mdi:chevron-down" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction
|
||||
:actions="[
|
||||
{ label: '编辑', onClick: handleEdit.bind(null, record), auth: 'mes:mes_xsl_inspect_maintain_item:edit' },
|
||||
]"
|
||||
:dropDownActions="getDropDownAction(record)"
|
||||
/>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<MesXslInspectMaintainItemModal @register="registerModal" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="xslmes-mesXslInspectMaintainItem" setup>
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import Icon from '/@/components/Icon';
|
||||
import MesXslInspectMaintainItemModal from './components/MesXslInspectMaintainItemModal.vue';
|
||||
import { columns, searchFormSchema } from './MesXslInspectMaintainItem.data';
|
||||
import { list, deleteOne, batchDelete, getExportUrl, getImportUrl } from './MesXslInspectMaintainItem.api';
|
||||
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
|
||||
const { tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '点检及保养项目',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: true,
|
||||
formConfig: {
|
||||
schemas: searchFormSchema,
|
||||
labelWidth: 100,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: true,
|
||||
},
|
||||
actionColumn: {
|
||||
width: 200,
|
||||
fixed: 'right',
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: '点检及保养项目',
|
||||
url: getExportUrl,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess,
|
||||
},
|
||||
});
|
||||
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
|
||||
function handleAdd() {
|
||||
openModal(true, { isUpdate: false, showFooter: true });
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
openModal(true, { record, isUpdate: true, showFooter: true });
|
||||
}
|
||||
|
||||
function handleDetail(record: Recordable) {
|
||||
openModal(true, { record, isUpdate: true, showFooter: false });
|
||||
}
|
||||
|
||||
async function handleDelete(record) {
|
||||
await deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
async function batchHandleDelete() {
|
||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||
}
|
||||
|
||||
function handleSuccess() {
|
||||
selectedRowKeys.value = [];
|
||||
reload();
|
||||
}
|
||||
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
{ label: '详情', onClick: handleDetail.bind(null, record) },
|
||||
{
|
||||
label: '删除',
|
||||
popConfirm: { title: '是否确认删除', confirm: handleDelete.bind(null, record) },
|
||||
auth: 'mes:mes_xsl_inspect_maintain_item:delete',
|
||||
},
|
||||
];
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,116 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" title="选择设备小部位" :width="960" @register="registerModal" @ok="handleOk">
|
||||
<BasicTable @register="registerTable" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { BasicTable, useTable } from '/@/components/Table';
|
||||
import { list, queryById } from '/@/views/xslmes/mesXslEquipmentSubPart/MesXslEquipmentSubPart.api';
|
||||
|
||||
const emit = defineEmits(['register', 'select']);
|
||||
|
||||
const selectedRow = ref<Recordable | null>(null);
|
||||
const filterCategoryId = ref('');
|
||||
const filterPartId = ref('');
|
||||
|
||||
function handleSelectionChange(_keys: string[], rows: Recordable[]) {
|
||||
selectedRow.value = rows?.[0] ?? null;
|
||||
}
|
||||
|
||||
function fetchSubPartPage(params: Recordable) {
|
||||
const p = { ...params };
|
||||
if (filterCategoryId.value) {
|
||||
p.equipmentCategoryId = filterCategoryId.value;
|
||||
}
|
||||
if (filterPartId.value) {
|
||||
p.equipmentPartId = filterPartId.value;
|
||||
}
|
||||
return list(p);
|
||||
}
|
||||
|
||||
const [registerTable, { reload, setProps, getSelectRowKeys, getSelectRows, setSelectedRowKeys, clearSelectedRowKeys }] =
|
||||
useTable({
|
||||
api: fetchSubPartPage,
|
||||
columns: [
|
||||
{ title: '小部位代码', dataIndex: 'subPartCode', width: 120 },
|
||||
{ title: '小部位名称', dataIndex: 'subPartName', width: 160 },
|
||||
{ title: '大部位名称', dataIndex: 'equipmentPartName', width: 140 },
|
||||
{ title: '类别名称', dataIndex: 'equipmentCategoryName', width: 140 },
|
||||
],
|
||||
rowKey: 'id',
|
||||
useSearchForm: true,
|
||||
formConfig: {
|
||||
labelWidth: 90,
|
||||
schemas: [
|
||||
{ label: '小部位代码', field: 'subPartCode', component: 'Input', colProps: { span: 8 } },
|
||||
{ label: '小部位名称', field: 'subPartName', component: 'Input', colProps: { span: 8 } },
|
||||
],
|
||||
},
|
||||
pagination: { pageSize: 10 },
|
||||
canResize: false,
|
||||
showIndexColumn: false,
|
||||
immediate: true,
|
||||
rowSelection: {
|
||||
type: 'radio',
|
||||
columnWidth: 48,
|
||||
onChange: handleSelectionChange,
|
||||
},
|
||||
clickToRowSelect: true,
|
||||
});
|
||||
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
filterCategoryId.value = data?.equipmentCategoryId ? String(data.equipmentCategoryId) : '';
|
||||
filterPartId.value = data?.equipmentPartId ? String(data.equipmentPartId) : '';
|
||||
selectedRow.value = null;
|
||||
clearSelectedRowKeys?.();
|
||||
setProps({
|
||||
rowSelection: {
|
||||
type: 'radio',
|
||||
columnWidth: 48,
|
||||
onChange: handleSelectionChange,
|
||||
},
|
||||
clickToRowSelect: true,
|
||||
});
|
||||
setModalProps({ confirmLoading: false });
|
||||
const sid = data?.equipmentSubPartId as string | undefined;
|
||||
if (sid) {
|
||||
setSelectedRowKeys?.([sid]);
|
||||
try {
|
||||
const raw = await queryById({ id: sid });
|
||||
const row = (raw as any)?.id != null ? raw : (raw as any)?.result;
|
||||
if (row) {
|
||||
selectedRow.value = row;
|
||||
}
|
||||
} catch {
|
||||
// 忽略
|
||||
}
|
||||
}
|
||||
reload();
|
||||
});
|
||||
|
||||
async function handleOk() {
|
||||
const keys = (getSelectRowKeys?.() || []) as string[];
|
||||
let row = selectedRow.value || ((getSelectRows?.() || []) as Recordable[])[0];
|
||||
if (!row && keys.length) {
|
||||
try {
|
||||
const raw = await queryById({ id: keys[0] });
|
||||
row = (raw as any)?.id != null ? raw : (raw as any)?.result;
|
||||
} catch {
|
||||
// 忽略
|
||||
}
|
||||
}
|
||||
if (!row?.id) {
|
||||
emit('select', { equipmentSubPartId: '', equipmentSubPartName: '' });
|
||||
closeModal();
|
||||
return;
|
||||
}
|
||||
emit('select', {
|
||||
equipmentSubPartId: row.id,
|
||||
equipmentSubPartName: row.subPartName || '',
|
||||
});
|
||||
closeModal();
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,110 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" title="选择设备类型" :width="960" @register="registerModal" @ok="handleOk">
|
||||
<BasicTable @register="registerTable" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { BasicTable, useTable } from '/@/components/Table';
|
||||
import { list, queryById } from '/@/views/xslmes/mesXslEquipmentType/MesXslEquipmentType.api';
|
||||
|
||||
const emit = defineEmits(['register', 'select']);
|
||||
|
||||
const selectedRow = ref<Recordable | null>(null);
|
||||
const filterCategoryId = ref('');
|
||||
|
||||
function handleSelectionChange(_keys: string[], rows: Recordable[]) {
|
||||
selectedRow.value = rows?.[0] ?? null;
|
||||
}
|
||||
|
||||
function fetchTypePage(params: Recordable) {
|
||||
const p = { ...params };
|
||||
if (filterCategoryId.value) {
|
||||
p.equipmentCategoryId = filterCategoryId.value;
|
||||
}
|
||||
return list(p);
|
||||
}
|
||||
|
||||
const [registerTable, { reload, setProps, getSelectRowKeys, getSelectRows, setSelectedRowKeys, clearSelectedRowKeys }] =
|
||||
useTable({
|
||||
api: fetchTypePage,
|
||||
columns: [
|
||||
{ title: '类型名称', dataIndex: 'typeName', width: 160 },
|
||||
{ title: '工序名称', dataIndex: 'processOperationName', width: 160 },
|
||||
{ title: '设备类别', dataIndex: 'equipmentCategoryName', width: 160 },
|
||||
],
|
||||
rowKey: 'id',
|
||||
useSearchForm: true,
|
||||
formConfig: {
|
||||
labelWidth: 90,
|
||||
schemas: [
|
||||
{ label: '类型名称', field: 'typeName', component: 'Input', colProps: { span: 8 } },
|
||||
{ label: '类别名称', field: 'equipmentCategoryName', component: 'Input', colProps: { span: 8 } },
|
||||
],
|
||||
},
|
||||
pagination: { pageSize: 10 },
|
||||
canResize: false,
|
||||
showIndexColumn: false,
|
||||
immediate: true,
|
||||
rowSelection: {
|
||||
type: 'radio',
|
||||
columnWidth: 48,
|
||||
onChange: handleSelectionChange,
|
||||
},
|
||||
clickToRowSelect: true,
|
||||
});
|
||||
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
filterCategoryId.value = data?.equipmentCategoryId ? String(data.equipmentCategoryId) : '';
|
||||
selectedRow.value = null;
|
||||
clearSelectedRowKeys?.();
|
||||
setProps({
|
||||
rowSelection: {
|
||||
type: 'radio',
|
||||
columnWidth: 48,
|
||||
onChange: handleSelectionChange,
|
||||
},
|
||||
clickToRowSelect: true,
|
||||
});
|
||||
setModalProps({ confirmLoading: false });
|
||||
const tid = data?.equipmentTypeId as string | undefined;
|
||||
if (tid) {
|
||||
setSelectedRowKeys?.([tid]);
|
||||
try {
|
||||
const raw = await queryById({ id: tid });
|
||||
const row = (raw as any)?.id != null ? raw : (raw as any)?.result;
|
||||
if (row) {
|
||||
selectedRow.value = row;
|
||||
}
|
||||
} catch {
|
||||
// 忽略
|
||||
}
|
||||
}
|
||||
reload();
|
||||
});
|
||||
|
||||
async function handleOk() {
|
||||
const keys = (getSelectRowKeys?.() || []) as string[];
|
||||
let row = selectedRow.value || ((getSelectRows?.() || []) as Recordable[])[0];
|
||||
if (!row && keys.length) {
|
||||
try {
|
||||
const raw = await queryById({ id: keys[0] });
|
||||
row = (raw as any)?.id != null ? raw : (raw as any)?.result;
|
||||
} catch {
|
||||
// 忽略
|
||||
}
|
||||
}
|
||||
if (!row?.id) {
|
||||
emit('select', { equipmentTypeId: '', equipmentTypeName: '' });
|
||||
closeModal();
|
||||
return;
|
||||
}
|
||||
emit('select', {
|
||||
equipmentTypeId: row.id,
|
||||
equipmentTypeName: row.typeName || '',
|
||||
});
|
||||
closeModal();
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,218 @@
|
||||
<template>
|
||||
<BasicModal @register="registerModal" :title="title" width="800" v-bind="$attrs" destroyOnClose @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm">
|
||||
<template #equipmentCategoryPicker="{ model, field }">
|
||||
<a-input-group compact style="display: flex; width: 100%">
|
||||
<a-input v-model:value="model[field]" read-only placeholder="请选择设备类别" style="flex: 1" />
|
||||
<a-button type="primary" :disabled="isDetail" @click="openCategorySelect">选择</a-button>
|
||||
<a-button v-if="model.equipmentCategoryId && !isDetail" @click="clearCategory">清除</a-button>
|
||||
</a-input-group>
|
||||
</template>
|
||||
<template #equipmentTypePicker="{ model, field }">
|
||||
<a-input-group compact style="display: flex; width: 100%">
|
||||
<a-input v-model:value="model[field]" read-only placeholder="请先选类别,再选类型" style="flex: 1" />
|
||||
<a-button type="primary" :disabled="isDetail || !model.equipmentCategoryId" @click="openTypeSelect">选择</a-button>
|
||||
<a-button v-if="model.equipmentTypeId && !isDetail" @click="clearType">清除</a-button>
|
||||
</a-input-group>
|
||||
</template>
|
||||
<template #equipmentPartPicker="{ model, field }">
|
||||
<a-input-group compact style="display: flex; width: 100%">
|
||||
<a-input v-model:value="model[field]" read-only placeholder="请先选类别,再选部位" style="flex: 1" />
|
||||
<a-button type="primary" :disabled="isDetail || !model.equipmentCategoryId" @click="openPartSelect">选择</a-button>
|
||||
<a-button v-if="model.equipmentPartId && !isDetail" @click="clearPart">清除</a-button>
|
||||
</a-input-group>
|
||||
</template>
|
||||
<template #equipmentSubPartPicker="{ model, field }">
|
||||
<a-input-group compact style="display: flex; width: 100%">
|
||||
<a-input v-model:value="model[field]" read-only placeholder="请先选类别与部位,再选小部位" style="flex: 1" />
|
||||
<a-button
|
||||
type="primary"
|
||||
:disabled="isDetail || !model.equipmentCategoryId || !model.equipmentPartId"
|
||||
@click="openSubPartSelect"
|
||||
>
|
||||
选择
|
||||
</a-button>
|
||||
<a-button v-if="model.equipmentSubPartId && !isDetail" @click="clearSubPart">清除</a-button>
|
||||
</a-input-group>
|
||||
</template>
|
||||
</BasicForm>
|
||||
<MesXslEquipmentCategorySelectModal @register="registerCategoryModal" @select="onCategorySelect" />
|
||||
<MesXslEquipmentTypeFilterSelectModal @register="registerTypeModal" @select="onTypeSelect" />
|
||||
<MesXslEquipmentPartSelectModal @register="registerPartModal" @select="onPartSelect" />
|
||||
<MesXslEquipmentSubPartFilterSelectModal @register="registerSubPartModal" @select="onSubPartSelect" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, unref } from 'vue';
|
||||
import { BasicModal, useModalInner, useModal } from '/@/components/Modal';
|
||||
import { BasicForm, useForm } from '/@/components/Form/index';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { formSchema } from '../MesXslInspectMaintainItem.data';
|
||||
import { saveOrUpdate } from '../MesXslInspectMaintainItem.api';
|
||||
import MesXslEquipmentCategorySelectModal from '/@/views/xslmes/mesXslEquipmentType/components/MesXslEquipmentCategorySelectModal.vue';
|
||||
import MesXslEquipmentPartSelectModal from '/@/views/xslmes/mesXslEquipmentSubPart/components/MesXslEquipmentPartSelectModal.vue';
|
||||
import MesXslEquipmentTypeFilterSelectModal from './MesXslEquipmentTypeFilterSelectModal.vue';
|
||||
import MesXslEquipmentSubPartFilterSelectModal from './MesXslEquipmentSubPartFilterSelectModal.vue';
|
||||
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const { createMessage } = useMessage();
|
||||
const isUpdate = ref(true);
|
||||
const isDetail = ref(false);
|
||||
|
||||
const [registerCategoryModal, { openModal: openCategoryModal }] = useModal();
|
||||
const [registerTypeModal, { openModal: openTypeModal }] = useModal();
|
||||
const [registerPartModal, { openModal: openPartModal }] = useModal();
|
||||
const [registerSubPartModal, { openModal: openSubPartModal }] = useModal();
|
||||
|
||||
const [registerForm, { resetFields, setFieldsValue, validate, setProps, getFieldsValue }] = useForm({
|
||||
labelWidth: 120,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
});
|
||||
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
await resetFields();
|
||||
setModalProps({ confirmLoading: false, showCancelBtn: data?.showFooter, showOkBtn: data?.showFooter });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
isDetail.value = !data?.showFooter;
|
||||
if (unref(isUpdate)) {
|
||||
await setFieldsValue({ ...data.record });
|
||||
}
|
||||
setProps({ disabled: !data?.showFooter });
|
||||
});
|
||||
|
||||
const title = computed(() =>
|
||||
!unref(isUpdate) ? '新增点检及保养项目' : unref(isDetail) ? '点检及保养项目详情' : '编辑点检及保养项目',
|
||||
);
|
||||
|
||||
function clearEquipmentCascade(from: 'category' | 'type' | 'part') {
|
||||
const patch: Recordable = {};
|
||||
if (from === 'category') {
|
||||
patch.equipmentTypeId = '';
|
||||
patch.equipmentTypeName = '';
|
||||
patch.equipmentPartId = '';
|
||||
patch.equipmentPartName = '';
|
||||
patch.equipmentSubPartId = '';
|
||||
patch.equipmentSubPartName = '';
|
||||
} else if (from === 'type') {
|
||||
patch.equipmentTypeId = '';
|
||||
patch.equipmentTypeName = '';
|
||||
} else if (from === 'part') {
|
||||
patch.equipmentPartId = '';
|
||||
patch.equipmentPartName = '';
|
||||
patch.equipmentSubPartId = '';
|
||||
patch.equipmentSubPartName = '';
|
||||
}
|
||||
setFieldsValue(patch);
|
||||
}
|
||||
|
||||
function openCategorySelect() {
|
||||
const vals = getFieldsValue();
|
||||
openCategoryModal(true, { equipmentCategoryId: vals.equipmentCategoryId });
|
||||
}
|
||||
|
||||
function clearCategory() {
|
||||
setFieldsValue({
|
||||
equipmentCategoryId: '',
|
||||
equipmentCategoryName: '',
|
||||
});
|
||||
clearEquipmentCascade('category');
|
||||
}
|
||||
|
||||
function onCategorySelect(payload: { equipmentCategoryId?: string; equipmentCategoryName?: string }) {
|
||||
setFieldsValue({
|
||||
equipmentCategoryId: payload.equipmentCategoryId || '',
|
||||
equipmentCategoryName: payload.equipmentCategoryName || '',
|
||||
});
|
||||
clearEquipmentCascade('category');
|
||||
}
|
||||
|
||||
function openTypeSelect() {
|
||||
const vals = getFieldsValue();
|
||||
if (!vals.equipmentCategoryId) {
|
||||
createMessage.warning('请先选择设备类别');
|
||||
return;
|
||||
}
|
||||
openTypeModal(true, {
|
||||
equipmentCategoryId: vals.equipmentCategoryId,
|
||||
equipmentTypeId: vals.equipmentTypeId,
|
||||
});
|
||||
}
|
||||
|
||||
function clearType() {
|
||||
clearEquipmentCascade('type');
|
||||
}
|
||||
|
||||
function onTypeSelect(payload: { equipmentTypeId?: string; equipmentTypeName?: string }) {
|
||||
setFieldsValue({
|
||||
equipmentTypeId: payload.equipmentTypeId || '',
|
||||
equipmentTypeName: payload.equipmentTypeName || '',
|
||||
});
|
||||
}
|
||||
|
||||
function openPartSelect() {
|
||||
const vals = getFieldsValue();
|
||||
if (!vals.equipmentCategoryId) {
|
||||
createMessage.warning('请先选择设备类别');
|
||||
return;
|
||||
}
|
||||
openPartModal(true, {
|
||||
equipmentCategoryId: vals.equipmentCategoryId,
|
||||
equipmentPartId: vals.equipmentPartId,
|
||||
});
|
||||
}
|
||||
|
||||
function clearPart() {
|
||||
clearEquipmentCascade('part');
|
||||
}
|
||||
|
||||
function onPartSelect(payload: { equipmentPartId?: string; equipmentPartName?: string }) {
|
||||
setFieldsValue({
|
||||
equipmentPartId: payload.equipmentPartId || '',
|
||||
equipmentPartName: payload.equipmentPartName || '',
|
||||
equipmentSubPartId: '',
|
||||
equipmentSubPartName: '',
|
||||
});
|
||||
}
|
||||
|
||||
function openSubPartSelect() {
|
||||
const vals = getFieldsValue();
|
||||
if (!vals.equipmentCategoryId) {
|
||||
createMessage.warning('请先选择设备类别');
|
||||
return;
|
||||
}
|
||||
if (!vals.equipmentPartId) {
|
||||
createMessage.warning('请先选择设备部位');
|
||||
return;
|
||||
}
|
||||
openSubPartModal(true, {
|
||||
equipmentCategoryId: vals.equipmentCategoryId,
|
||||
equipmentPartId: vals.equipmentPartId,
|
||||
equipmentSubPartId: vals.equipmentSubPartId,
|
||||
});
|
||||
}
|
||||
|
||||
function clearSubPart() {
|
||||
setFieldsValue({ equipmentSubPartId: '', equipmentSubPartName: '' });
|
||||
}
|
||||
|
||||
function onSubPartSelect(payload: { equipmentSubPartId?: string; equipmentSubPartName?: string }) {
|
||||
setFieldsValue({
|
||||
equipmentSubPartId: payload.equipmentSubPartId || '',
|
||||
equipmentSubPartName: payload.equipmentSubPartName || '',
|
||||
});
|
||||
}
|
||||
|
||||
async function handleSubmit() {
|
||||
const values = await validate();
|
||||
setModalProps({ confirmLoading: true });
|
||||
try {
|
||||
await saveOrUpdate(values, isUpdate.value);
|
||||
closeModal();
|
||||
emit('success');
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,30 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
|
||||
enum Api {
|
||||
list = '/xslmes/mesXslMixerMaterialSubstitute/list',
|
||||
save = '/xslmes/mesXslMixerMaterialSubstitute/add',
|
||||
edit = '/xslmes/mesXslMixerMaterialSubstitute/edit',
|
||||
deleteOne = '/xslmes/mesXslMixerMaterialSubstitute/delete',
|
||||
deleteBatch = '/xslmes/mesXslMixerMaterialSubstitute/deleteBatch',
|
||||
importExcel = '/xslmes/mesXslMixerMaterialSubstitute/importExcel',
|
||||
exportXls = '/xslmes/mesXslMixerMaterialSubstitute/exportXls',
|
||||
queryById = '/xslmes/mesXslMixerMaterialSubstitute/queryById',
|
||||
}
|
||||
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
export const queryById = (params) => defHttp.get({ url: Api.queryById, params });
|
||||
|
||||
export const deleteOne = (params, handleSuccess) =>
|
||||
defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
|
||||
|
||||
export const batchDelete = (params, handleSuccess) =>
|
||||
defHttp.delete({ url: Api.deleteBatch, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
|
||||
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
const url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url, params }, { successMessageMode: 'none' });
|
||||
};
|
||||
|
||||
export const getExportUrl = Api.exportXls;
|
||||
export const getImportUrl = Api.importExcel;
|
||||
@@ -0,0 +1,102 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{ title: '编号', align: 'center', dataIndex: 'serialNo', width: 80 },
|
||||
{ title: '密炼物料编码', align: 'center', dataIndex: 'mixerMaterialCode', width: 130 },
|
||||
{ title: '密炼物料名称', align: 'center', dataIndex: 'mixerMaterialName', width: 160 },
|
||||
{ title: '替代密炼物料编码', align: 'center', dataIndex: 'substituteMaterialCode', width: 140 },
|
||||
{ title: '替代密炼物料名称', align: 'center', dataIndex: 'substituteMaterialName', width: 160 },
|
||||
{ title: '创建人', align: 'center', dataIndex: 'createBy', width: 100, defaultHidden: true },
|
||||
{ title: '创建时间', align: 'center', dataIndex: 'createTime', width: 165 },
|
||||
{ title: '修改人', align: 'center', dataIndex: 'updateBy', width: 100, defaultHidden: true },
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '密炼物料',
|
||||
field: 'mixerMaterialId',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'mes_mixer_material,material_name,id',
|
||||
placeholder: '请选择密炼物料',
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{ label: '密炼物料编码', field: 'mixerMaterialCode', component: 'JInput', colProps: { span: 6 } },
|
||||
{ label: '密炼物料名称', field: 'mixerMaterialName', component: 'JInput', colProps: { span: 6 } },
|
||||
{
|
||||
label: '替代密炼物料',
|
||||
field: 'substituteMaterialId',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'mes_mixer_material,material_name,id',
|
||||
placeholder: '请选择替代密炼物料',
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{ label: '替代物料编码', field: 'substituteMaterialCode', component: 'JInput', colProps: { span: 6 } },
|
||||
{ label: '替代物料名称', field: 'substituteMaterialName', component: 'JInput', colProps: { span: 6 } },
|
||||
];
|
||||
|
||||
export const formSchema: FormSchema[] = [
|
||||
{ label: '', field: 'id', component: 'Input', show: false },
|
||||
{
|
||||
label: '编号',
|
||||
field: 'serialNo',
|
||||
component: 'InputNumber',
|
||||
componentProps: { disabled: true, placeholder: '保存后自动生成', style: { width: '100%' } },
|
||||
ifShow: ({ values }) => !!values.serialNo,
|
||||
},
|
||||
{
|
||||
label: '密炼物料',
|
||||
field: 'mixerMaterialName',
|
||||
component: 'Input',
|
||||
slot: 'mixerMaterialPicker',
|
||||
dynamicRules: () => [{ required: true, message: '请选择密炼物料' }],
|
||||
},
|
||||
{ label: '', field: 'mixerMaterialId', component: 'Input', show: false },
|
||||
{
|
||||
label: '密炼物料编码',
|
||||
field: 'mixerMaterialCode',
|
||||
component: 'Input',
|
||||
componentProps: { disabled: true, placeholder: '选择密炼物料后自动带出' },
|
||||
},
|
||||
{
|
||||
label: '替代密炼物料',
|
||||
field: 'substituteMaterialName',
|
||||
component: 'Input',
|
||||
slot: 'substituteMaterialPicker',
|
||||
dynamicRules: () => [{ required: true, message: '请选择替代密炼物料' }],
|
||||
},
|
||||
{ label: '', field: 'substituteMaterialId', component: 'Input', show: false },
|
||||
{
|
||||
label: '替代密炼物料编码',
|
||||
field: 'substituteMaterialCode',
|
||||
component: 'Input',
|
||||
componentProps: { disabled: true, placeholder: '选择替代密炼物料后自动带出' },
|
||||
},
|
||||
];
|
||||
|
||||
export const superQuerySchema = {
|
||||
serialNo: { title: '编号', order: 0, view: 'number' },
|
||||
mixerMaterialId: {
|
||||
title: '密炼物料',
|
||||
order: 1,
|
||||
view: 'sel_search',
|
||||
dictTable: 'mes_mixer_material',
|
||||
dictCode: 'id',
|
||||
dictText: 'material_name',
|
||||
},
|
||||
mixerMaterialCode: { title: '密炼物料编码', order: 2, view: 'text' },
|
||||
mixerMaterialName: { title: '密炼物料名称', order: 3, view: 'text' },
|
||||
substituteMaterialId: {
|
||||
title: '替代密炼物料',
|
||||
order: 4,
|
||||
view: 'sel_search',
|
||||
dictTable: 'mes_mixer_material',
|
||||
dictCode: 'id',
|
||||
dictText: 'material_name',
|
||||
},
|
||||
substituteMaterialCode: { title: '替代密炼物料编码', order: 5, view: 'text' },
|
||||
substituteMaterialName: { title: '替代密炼物料名称', order: 6, view: 'text' },
|
||||
};
|
||||
@@ -0,0 +1,152 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<template #tableTitle>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-auth="'xslmes:mes_xsl_mixer_material_substitute:add'"
|
||||
@click="handleAdd"
|
||||
preIcon="ant-design:plus-outlined"
|
||||
>
|
||||
新增
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-auth="'xslmes:mes_xsl_mixer_material_substitute:exportXls'"
|
||||
preIcon="ant-design:export-outlined"
|
||||
@click="onExportXls"
|
||||
>
|
||||
导出
|
||||
</a-button>
|
||||
<j-upload-button
|
||||
type="primary"
|
||||
v-auth="'xslmes:mes_xsl_mixer_material_substitute:importExcel'"
|
||||
preIcon="ant-design:import-outlined"
|
||||
@click="onImportXls"
|
||||
>
|
||||
导入
|
||||
</j-upload-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined" />
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button v-auth="'xslmes:mes_xsl_mixer_material_substitute:deleteBatch'">
|
||||
批量操作
|
||||
<Icon icon="mdi:chevron-down" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'xslmes:mes_xsl_mixer_material_substitute:edit',
|
||||
},
|
||||
]"
|
||||
:dropDownActions="getDropDownAction(record)"
|
||||
/>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<MesXslMixerMaterialSubstituteModal @register="registerModal" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="xslmes-mesXslMixerMaterialSubstitute" setup>
|
||||
import { reactive } from 'vue';
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import Icon from '/@/components/Icon';
|
||||
import MesXslMixerMaterialSubstituteModal from './components/MesXslMixerMaterialSubstituteModal.vue';
|
||||
import { columns, searchFormSchema, superQuerySchema } from './MesXslMixerMaterialSubstitute.data';
|
||||
import { list, deleteOne, batchDelete, getExportUrl, getImportUrl } from './MesXslMixerMaterialSubstitute.api';
|
||||
|
||||
const queryParam = reactive<any>({});
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
|
||||
const { tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '密炼物料替代对应关系',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: true,
|
||||
formConfig: {
|
||||
schemas: searchFormSchema,
|
||||
labelWidth: 110,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: true,
|
||||
},
|
||||
actionColumn: {
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
width: 160,
|
||||
fixed: 'right',
|
||||
slots: { customRender: 'action' },
|
||||
},
|
||||
beforeFetch: (params) => Object.assign(params, queryParam),
|
||||
},
|
||||
exportConfig: {
|
||||
name: '密炼物料替代对应关系',
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess,
|
||||
},
|
||||
});
|
||||
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).forEach((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
reload();
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
openModal(true, { isUpdate: false, showFooter: true });
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
openModal(true, { record, isUpdate: true, showFooter: true });
|
||||
}
|
||||
|
||||
function handleDetail(record: Recordable) {
|
||||
openModal(true, { record, isUpdate: true, showFooter: false });
|
||||
}
|
||||
|
||||
function handleDelete(record: Recordable) {
|
||||
deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
function batchHandleDelete() {
|
||||
batchDelete({ ids: selectedRowKeys.value.join(',') }, handleSuccess);
|
||||
}
|
||||
|
||||
function handleSuccess() {
|
||||
reload();
|
||||
selectedRowKeys.value = [];
|
||||
}
|
||||
|
||||
function getDropDownAction(record: Recordable) {
|
||||
return [
|
||||
{ label: '详情', onClick: handleDetail.bind(null, record) },
|
||||
{
|
||||
label: '删除',
|
||||
popConfirm: { title: '是否确认删除', confirm: handleDelete.bind(null, record) },
|
||||
auth: 'xslmes:mes_xsl_mixer_material_substitute:delete',
|
||||
},
|
||||
];
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,170 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="860" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm">
|
||||
<template #mixerMaterialPicker="{ model }">
|
||||
<a-input-group compact style="display: flex; width: 100%">
|
||||
<a-input
|
||||
v-model:value="model.mixerMaterialName"
|
||||
read-only
|
||||
placeholder="请点击选择密炼物料"
|
||||
style="flex: 1"
|
||||
:disabled="isDetail"
|
||||
/>
|
||||
<a-button type="primary" :disabled="isDetail" @click="openMixerSelect('mixer')">选择</a-button>
|
||||
<a-button v-if="model.mixerMaterialId && !isDetail" @click="clearMixer('mixer', model)">清除</a-button>
|
||||
</a-input-group>
|
||||
</template>
|
||||
<template #substituteMaterialPicker="{ model }">
|
||||
<a-input-group compact style="display: flex; width: 100%">
|
||||
<a-input
|
||||
v-model:value="model.substituteMaterialName"
|
||||
read-only
|
||||
placeholder="请点击选择替代密炼物料"
|
||||
style="flex: 1"
|
||||
:disabled="isDetail"
|
||||
/>
|
||||
<a-button type="primary" :disabled="isDetail" @click="openMixerSelect('substitute')">选择</a-button>
|
||||
<a-button v-if="model.substituteMaterialId && !isDetail" @click="clearMixer('substitute', model)">清除</a-button>
|
||||
</a-input-group>
|
||||
</template>
|
||||
</BasicForm>
|
||||
<MesMixerMaterialSelectModal @register="registerMixerModal" @select="onMixerSelect" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, unref } from 'vue';
|
||||
import { BasicModal, useModalInner, useModal } from '/@/components/Modal';
|
||||
import { BasicForm, useForm } from '/@/components/Form/index';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import MesMixerMaterialSelectModal from '/@/views/mes/material/modules/MesMixerMaterialSelectModal.vue';
|
||||
import { formSchema } from '../MesXslMixerMaterialSubstitute.data';
|
||||
import { saveOrUpdate } from '../MesXslMixerMaterialSubstitute.api';
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref(true);
|
||||
const isDetail = ref(false);
|
||||
const pickerTarget = ref<'mixer' | 'substitute'>('mixer');
|
||||
|
||||
const [registerForm, { setProps, resetFields, setFieldsValue, validate, getFieldsValue, scrollToField }] = useForm({
|
||||
labelWidth: 140,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
|
||||
const [registerMixerModal, { openModal: openMixerModal }] = useModal();
|
||||
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
await resetFields();
|
||||
setModalProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
isDetail.value = !data?.showFooter;
|
||||
if (unref(isUpdate)) {
|
||||
await setFieldsValue({ ...data.record });
|
||||
}
|
||||
setProps({ disabled: !data?.showFooter });
|
||||
});
|
||||
|
||||
const title = computed(() => (!unref(isUpdate) ? '新增' : unref(isDetail) ? '详情' : '编辑'));
|
||||
|
||||
function openMixerSelect(target: 'mixer' | 'substitute') {
|
||||
pickerTarget.value = target;
|
||||
const values = getFieldsValue();
|
||||
const mid = target === 'mixer' ? values?.mixerMaterialId : values?.substituteMaterialId;
|
||||
openMixerModal(true, { mixerMaterialId: mid });
|
||||
}
|
||||
|
||||
function onMixerSelect(payload: Recordable | null) {
|
||||
if (!payload) {
|
||||
return;
|
||||
}
|
||||
if (pickerTarget.value === 'mixer') {
|
||||
setFieldsValue({
|
||||
mixerMaterialId: payload.mixerMaterialId,
|
||||
mixerMaterialName: payload.materialName || '',
|
||||
mixerMaterialCode: '',
|
||||
});
|
||||
fillMaterialCode(payload.mixerMaterialId, 'mixer');
|
||||
} else {
|
||||
setFieldsValue({
|
||||
substituteMaterialId: payload.mixerMaterialId,
|
||||
substituteMaterialName: payload.materialName || '',
|
||||
substituteMaterialCode: '',
|
||||
});
|
||||
fillMaterialCode(payload.mixerMaterialId, 'substitute');
|
||||
}
|
||||
}
|
||||
|
||||
async function fillMaterialCode(id: string, target: 'mixer' | 'substitute') {
|
||||
if (!id) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const { queryById } = await import('/@/views/mes/material/MesMixerMaterial.api');
|
||||
const raw = await queryById({ id });
|
||||
const row = (raw as Recordable)?.materialCode != null ? raw : (raw as Recordable)?.result;
|
||||
if (row?.materialCode) {
|
||||
if (target === 'mixer') {
|
||||
setFieldsValue({ mixerMaterialCode: row.materialCode, mixerMaterialName: row.materialName || '' });
|
||||
} else {
|
||||
setFieldsValue({ substituteMaterialCode: row.materialCode, substituteMaterialName: row.materialName || '' });
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
function clearMixer(target: 'mixer' | 'substitute', model: Recordable) {
|
||||
if (target === 'mixer') {
|
||||
model.mixerMaterialId = '';
|
||||
model.mixerMaterialName = '';
|
||||
model.mixerMaterialCode = '';
|
||||
} else {
|
||||
model.substituteMaterialId = '';
|
||||
model.substituteMaterialName = '';
|
||||
model.substituteMaterialCode = '';
|
||||
}
|
||||
}
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const values = await validate();
|
||||
if (!values.mixerMaterialId) {
|
||||
createMessage.warning('请选择密炼物料');
|
||||
return;
|
||||
}
|
||||
if (!values.substituteMaterialId) {
|
||||
createMessage.warning('请选择替代密炼物料');
|
||||
return;
|
||||
}
|
||||
if (values.mixerMaterialId === values.substituteMaterialId) {
|
||||
createMessage.warning('密炼物料与替代密炼物料不能相同');
|
||||
return;
|
||||
}
|
||||
setModalProps({ confirmLoading: true });
|
||||
await saveOrUpdate(values, unref(isUpdate));
|
||||
createMessage.success(unref(isUpdate) ? '编辑成功' : '新增成功');
|
||||
closeModal();
|
||||
emit('success');
|
||||
} catch (e: any) {
|
||||
if (e?.errorFields) {
|
||||
const firstField = e.errorFields[0];
|
||||
if (firstField) {
|
||||
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}
|
||||
return Promise.reject(e);
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,34 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
|
||||
enum Api {
|
||||
list = '/xslmes/mesXslOpenMillParam/list',
|
||||
save = '/xslmes/mesXslOpenMillParam/add',
|
||||
edit = '/xslmes/mesXslOpenMillParam/edit',
|
||||
deleteOne = '/xslmes/mesXslOpenMillParam/delete',
|
||||
deleteBatch = '/xslmes/mesXslOpenMillParam/deleteBatch',
|
||||
importExcel = '/xslmes/mesXslOpenMillParam/importExcel',
|
||||
exportXls = '/xslmes/mesXslOpenMillParam/exportXls',
|
||||
queryById = '/xslmes/mesXslOpenMillParam/queryById',
|
||||
queryMaterialById = '/mes/material/material/queryById',
|
||||
}
|
||||
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
export const queryById = (params) => defHttp.get({ url: Api.queryById, params });
|
||||
|
||||
export const queryMaterialById = (params: { id: string }) =>
|
||||
defHttp.get({ url: Api.queryMaterialById, params }, { successMessageMode: 'none' });
|
||||
|
||||
export const deleteOne = (params, handleSuccess) =>
|
||||
defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
|
||||
|
||||
export const batchDelete = (params, handleSuccess) =>
|
||||
defHttp.delete({ url: Api.deleteBatch, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
|
||||
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
const url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url, params }, { successMessageMode: 'none' });
|
||||
};
|
||||
|
||||
export const getExportUrl = Api.exportXls;
|
||||
export const getImportUrl = Api.importExcel;
|
||||
@@ -0,0 +1,124 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{ title: '胶料名称', align: 'center', dataIndex: 'materialName', width: 160 },
|
||||
{ title: '胶料编码', align: 'center', dataIndex: 'materialCode', width: 130 },
|
||||
{ title: 'R0进胶时间(秒)', align: 'center', dataIndex: 'r0FeedTime', width: 120 },
|
||||
{ title: 'R0成环时间(秒)', align: 'center', dataIndex: 'r0RingTime', width: 120 },
|
||||
{ title: 'R0拉断时间(秒)', align: 'center', dataIndex: 'r0BreakTime', width: 120 },
|
||||
{ title: 'R0排胶时间(秒)', align: 'center', dataIndex: 'r0DischargeTime', width: 120 },
|
||||
{ title: 'R1进胶时间(秒)', align: 'center', dataIndex: 'r1FeedTime', width: 120 },
|
||||
{ title: 'R1成环时间(秒)', align: 'center', dataIndex: 'r1RingTime', width: 120 },
|
||||
{ title: 'R1拉断时间(秒)', align: 'center', dataIndex: 'r1BreakTime', width: 120 },
|
||||
{ title: 'R1排胶时间(秒)', align: 'center', dataIndex: 'r1DischargeTime', width: 120 },
|
||||
{ title: '创建人', align: 'center', dataIndex: 'createBy', width: 100, defaultHidden: true },
|
||||
{ title: '创建时间', align: 'center', dataIndex: 'createTime', width: 165 },
|
||||
{ title: '修改人', align: 'center', dataIndex: 'updateBy', width: 100, defaultHidden: true },
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '胶料',
|
||||
field: 'materialId',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'mes_material,material_name,id',
|
||||
placeholder: '请选择胶料',
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{ label: '胶料编码', field: 'materialCode', component: 'JInput', colProps: { span: 6 } },
|
||||
{ label: '胶料名称', field: 'materialName', component: 'JInput', colProps: { span: 6 } },
|
||||
];
|
||||
|
||||
export const formSchema: FormSchema[] = [
|
||||
{ label: '', field: 'id', component: 'Input', show: false },
|
||||
{
|
||||
label: '胶料',
|
||||
field: 'materialId',
|
||||
component: 'Input',
|
||||
slot: 'materialPicker',
|
||||
dynamicRules: () => [{ required: true, message: '请选择胶料' }],
|
||||
},
|
||||
{
|
||||
label: '胶料名称',
|
||||
field: 'materialName',
|
||||
component: 'Input',
|
||||
componentProps: { disabled: true, placeholder: '选择胶料后自动带出' },
|
||||
},
|
||||
{
|
||||
label: '胶料编码',
|
||||
field: 'materialCode',
|
||||
component: 'Input',
|
||||
componentProps: { disabled: true, placeholder: '选择胶料后自动带出' },
|
||||
},
|
||||
{
|
||||
label: 'R0进胶时间',
|
||||
field: 'r0FeedTime',
|
||||
component: 'InputNumber',
|
||||
componentProps: { min: 0, precision: 2, placeholder: '单位:秒', style: { width: '100%' } },
|
||||
},
|
||||
{
|
||||
label: 'R0成环时间',
|
||||
field: 'r0RingTime',
|
||||
component: 'InputNumber',
|
||||
componentProps: { min: 0, precision: 2, placeholder: '单位:秒', style: { width: '100%' } },
|
||||
},
|
||||
{
|
||||
label: 'R0拉断时间',
|
||||
field: 'r0BreakTime',
|
||||
component: 'InputNumber',
|
||||
componentProps: { min: 0, precision: 2, placeholder: '单位:秒', style: { width: '100%' } },
|
||||
},
|
||||
{
|
||||
label: 'R0排胶时间',
|
||||
field: 'r0DischargeTime',
|
||||
component: 'InputNumber',
|
||||
componentProps: { min: 0, precision: 2, placeholder: '单位:秒', style: { width: '100%' } },
|
||||
},
|
||||
{
|
||||
label: 'R1进胶时间',
|
||||
field: 'r1FeedTime',
|
||||
component: 'InputNumber',
|
||||
componentProps: { min: 0, precision: 2, placeholder: '单位:秒', style: { width: '100%' } },
|
||||
},
|
||||
{
|
||||
label: 'R1成环时间',
|
||||
field: 'r1RingTime',
|
||||
component: 'InputNumber',
|
||||
componentProps: { min: 0, precision: 2, placeholder: '单位:秒', style: { width: '100%' } },
|
||||
},
|
||||
{
|
||||
label: 'R1拉断时间',
|
||||
field: 'r1BreakTime',
|
||||
component: 'InputNumber',
|
||||
componentProps: { min: 0, precision: 2, placeholder: '单位:秒', style: { width: '100%' } },
|
||||
},
|
||||
{
|
||||
label: 'R1排胶时间',
|
||||
field: 'r1DischargeTime',
|
||||
component: 'InputNumber',
|
||||
componentProps: { min: 0, precision: 2, placeholder: '单位:秒', style: { width: '100%' } },
|
||||
},
|
||||
];
|
||||
|
||||
export const superQuerySchema = {
|
||||
materialId: {
|
||||
title: '胶料',
|
||||
order: 0,
|
||||
view: 'sel_search',
|
||||
dictTable: 'mes_material',
|
||||
dictCode: 'id',
|
||||
dictText: 'material_name',
|
||||
},
|
||||
materialCode: { title: '胶料编码', order: 1, view: 'text' },
|
||||
materialName: { title: '胶料名称', order: 2, view: 'text' },
|
||||
r0FeedTime: { title: 'R0进胶时间', order: 3, view: 'number' },
|
||||
r0RingTime: { title: 'R0成环时间', order: 4, view: 'number' },
|
||||
r0BreakTime: { title: 'R0拉断时间', order: 5, view: 'number' },
|
||||
r0DischargeTime: { title: 'R0排胶时间', order: 6, view: 'number' },
|
||||
r1FeedTime: { title: 'R1进胶时间', order: 7, view: 'number' },
|
||||
r1RingTime: { title: 'R1成环时间', order: 8, view: 'number' },
|
||||
r1BreakTime: { title: 'R1拉断时间', order: 9, view: 'number' },
|
||||
r1DischargeTime: { title: 'R1排胶时间', order: 10, view: 'number' },
|
||||
};
|
||||
@@ -0,0 +1,149 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" v-auth="'xslmes:mes_xsl_open_mill_param:add'" @click="handleAdd" preIcon="ant-design:plus-outlined">
|
||||
新增
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-auth="'xslmes:mes_xsl_open_mill_param:exportXls'"
|
||||
preIcon="ant-design:export-outlined"
|
||||
@click="onExportXls"
|
||||
>
|
||||
导出
|
||||
</a-button>
|
||||
<j-upload-button
|
||||
type="primary"
|
||||
v-auth="'xslmes:mes_xsl_open_mill_param:importExcel'"
|
||||
preIcon="ant-design:import-outlined"
|
||||
@click="onImportXls"
|
||||
>
|
||||
导入
|
||||
</j-upload-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined" />
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button v-auth="'xslmes:mes_xsl_open_mill_param:deleteBatch'">
|
||||
批量操作
|
||||
<Icon icon="mdi:chevron-down" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction
|
||||
:actions="[
|
||||
{ label: '编辑', onClick: handleEdit.bind(null, record), auth: 'xslmes:mes_xsl_open_mill_param:edit' },
|
||||
]"
|
||||
:dropDownActions="getDropDownAction(record)"
|
||||
/>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<MesXslOpenMillParamModal @register="registerModal" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="xslmes-mesXslOpenMillParam" setup>
|
||||
import { reactive } from 'vue';
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import Icon from '/@/components/Icon';
|
||||
import MesXslOpenMillParamModal from './components/MesXslOpenMillParamModal.vue';
|
||||
import { columns, searchFormSchema, superQuerySchema } from './MesXslOpenMillParam.data';
|
||||
import { list, deleteOne, batchDelete, getExportUrl, getImportUrl } from './MesXslOpenMillParam.api';
|
||||
|
||||
const queryParam = reactive<any>({});
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
|
||||
const { tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '开炼机参数维护',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: true,
|
||||
formConfig: {
|
||||
schemas: searchFormSchema,
|
||||
labelWidth: 100,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: true,
|
||||
},
|
||||
actionColumn: {
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
width: 160,
|
||||
fixed: 'right',
|
||||
slots: { customRender: 'action' },
|
||||
},
|
||||
beforeFetch: (params) => Object.assign(params, queryParam),
|
||||
},
|
||||
exportConfig: {
|
||||
name: '开炼机参数维护',
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess,
|
||||
},
|
||||
});
|
||||
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).forEach((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
reload();
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
openModal(true, { isUpdate: false, showFooter: true });
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
openModal(true, { record, isUpdate: true, showFooter: true });
|
||||
}
|
||||
|
||||
function handleDetail(record: Recordable) {
|
||||
openModal(true, { record, isUpdate: true, showFooter: false });
|
||||
}
|
||||
|
||||
function handleDelete(record: Recordable) {
|
||||
deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
function batchHandleDelete() {
|
||||
batchDelete({ ids: selectedRowKeys.value.join(',') }, handleSuccess);
|
||||
}
|
||||
|
||||
function handleSuccess() {
|
||||
reload();
|
||||
selectedRowKeys.value = [];
|
||||
}
|
||||
|
||||
function getDropDownAction(record: Recordable) {
|
||||
return [
|
||||
{ label: '详情', onClick: handleDetail.bind(null, record) },
|
||||
{
|
||||
label: '删除',
|
||||
popConfirm: { title: '是否确认删除', confirm: handleDelete.bind(null, record) },
|
||||
auth: 'xslmes:mes_xsl_open_mill_param:delete',
|
||||
},
|
||||
];
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,108 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm">
|
||||
<template #materialPicker="{ model, field }">
|
||||
<JDictSelectTag
|
||||
v-model:value="model[field]"
|
||||
dictCode="mes_material,material_name,id"
|
||||
placeholder="请选择胶料"
|
||||
:disabled="isDetail"
|
||||
@update:value="(v) => onMaterialChange(model, v)"
|
||||
/>
|
||||
</template>
|
||||
</BasicForm>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, unref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { BasicForm, useForm } from '/@/components/Form/index';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { formSchema } from '../MesXslOpenMillParam.data';
|
||||
import { saveOrUpdate, queryMaterialById } from '../MesXslOpenMillParam.api';
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref(true);
|
||||
const isDetail = ref(false);
|
||||
/** 避免弹窗初始化回显时误触发物料回填 */
|
||||
const skipMaterialChange = ref(false);
|
||||
|
||||
const [registerForm, { setProps, resetFields, setFieldsValue, validate, scrollToField }] = useForm({
|
||||
labelWidth: 130,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
skipMaterialChange.value = true;
|
||||
await resetFields();
|
||||
setModalProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
isDetail.value = !data?.showFooter;
|
||||
if (unref(isUpdate)) {
|
||||
await setFieldsValue({ ...data.record });
|
||||
}
|
||||
setProps({ disabled: !data?.showFooter });
|
||||
skipMaterialChange.value = false;
|
||||
});
|
||||
|
||||
const title = computed(() => (!unref(isUpdate) ? '新增' : unref(isDetail) ? '详情' : '编辑'));
|
||||
|
||||
async function onMaterialChange(model: Recordable, val: unknown) {
|
||||
if (skipMaterialChange.value) {
|
||||
return;
|
||||
}
|
||||
const id = val != null && val !== '' ? String(val) : '';
|
||||
if (!id) {
|
||||
model.materialName = '';
|
||||
model.materialCode = '';
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const raw = await queryMaterialById({ id });
|
||||
const row = (raw as Recordable)?.materialName != null ? raw : (raw as Recordable)?.result;
|
||||
if (row) {
|
||||
model.materialName = row.materialName ?? '';
|
||||
model.materialCode = row.materialCode ?? '';
|
||||
}
|
||||
} catch {
|
||||
model.materialName = '';
|
||||
model.materialCode = '';
|
||||
}
|
||||
}
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const values = await validate();
|
||||
if (!values.materialId) {
|
||||
createMessage.warning('请选择胶料');
|
||||
return;
|
||||
}
|
||||
setModalProps({ confirmLoading: true });
|
||||
await saveOrUpdate(values, unref(isUpdate));
|
||||
createMessage.success(unref(isUpdate) ? '编辑成功' : '新增成功');
|
||||
closeModal();
|
||||
emit('success');
|
||||
} catch (e: any) {
|
||||
if (e?.errorFields) {
|
||||
const firstField = e.errorFields[0];
|
||||
if (firstField) {
|
||||
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}
|
||||
return Promise.reject(e);
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user