Merge remote-tracking branch 'origin/0.8.X' into 0.8.X

This commit is contained in:
朱昊天
2026-07-09 14:18:04 +08:00
40 changed files with 2508 additions and 4368 deletions

View File

@@ -4,6 +4,7 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
import com.klp.common.core.controller.BaseController;
import com.klp.common.core.domain.R;
import com.klp.system.domain.bo.OperPerformanceQuery;
import com.klp.system.domain.vo.OperMenuGroupVO;
import com.klp.system.domain.vo.OperModuleStatVO;
import com.klp.system.domain.vo.OperPersonVO;
import com.klp.system.domain.vo.OperSummaryVO;
@@ -55,4 +56,13 @@ public class OperPerformanceController extends BaseController {
public R<List<OperModuleStatVO>> module(OperPerformanceQuery query) {
return R.ok(operLogService.selectModuleRanking(query));
}
/**
* 按菜单分组绩效统计oper_page 匹配一级菜单 path
*/
@SaCheckPermission("monitor:performance:list")
@GetMapping("/menuGroup")
public R<List<OperMenuGroupVO>> menuGroup(OperPerformanceQuery query) {
return R.ok(operLogService.selectMenuGroupPerformance(query));
}
}

View File

@@ -99,7 +99,7 @@ public class WmsInspectionItemTemplateController extends BaseController {
}
// 根据待检项查询详细信息
@PostMapping("/getInfoByInspectionItem")
@GetMapping("/getInfoByInspectionItem")
public R<List<WmsCheckItemVo>> getInfoByInspectionItem(@RequestParam String inspectionItemIds) {
return R.ok(iWmsInspectionItemTemplateService.getInfoByInspectionItem(inspectionItemIds));
}

View File

@@ -78,6 +78,11 @@ public class PerfAppraisalDetail extends BaseEntity {
*/
@TableLogic
private Integer delFlag;
/**
* 量化指标
*/
private String quantitativeIndicator;
/**
* 备注
*/

View File

@@ -7,7 +7,6 @@ import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* 车间考核参数配置对象 perf_dept_config
@@ -68,16 +67,14 @@ public class PerfDeptConfig extends BaseEntity {
*/
private Date month;
/**
*
* 备注
*/
private String remark;
/**
*
* 删除标志0=正常 1=已删除)
*/
private Date createdAt;
/**
*
*/
private Date updatedAt;
@TableLogic
private Integer delFlag;
}

View File

@@ -83,6 +83,11 @@ public class PerfAppraisalDetailBo extends BaseEntity {
*/
private String scoreRule;
/**
* 量化指标
*/
private String quantitativeIndicator;
/**
* 备注
*/

View File

@@ -7,7 +7,6 @@ import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* 车间考核参数配置业务对象 perf_dept_config
@@ -80,15 +79,5 @@ public class PerfDeptConfigBo extends BaseEntity {
*/
private String remark;
/**
*
*/
private Date createdAt;
/**
*
*/
private Date updatedAt;
}

View File

@@ -98,6 +98,12 @@ public class PerfAppraisalDetailVo {
@ExcelProperty(value = "评分规则(从模板快照)")
private String scoreRule;
/**
* 量化指标
*/
@ExcelProperty(value = "量化指标")
private String quantitativeIndicator;
/**
* 备注
*/

View File

@@ -94,17 +94,5 @@ public class PerfDeptConfigVo {
@ExcelProperty(value = "")
private String remark;
/**
*
*/
@ExcelProperty(value = "")
private Date createdAt;
/**
*
*/
@ExcelProperty(value = "")
private Date updatedAt;
}

View File

@@ -73,6 +73,8 @@ public class PerfAppraisalDetailServiceImpl implements IPerfAppraisalDetailServi
lqw.eq(bo.getPenalty() != null, PerfAppraisalDetail::getPenalty, bo.getPenalty());
lqw.eq(StringUtils.isNotBlank(bo.getScoreFormula()), PerfAppraisalDetail::getScoreFormula, bo.getScoreFormula());
lqw.eq(StringUtils.isNotBlank(bo.getScoreRule()), PerfAppraisalDetail::getScoreRule, bo.getScoreRule());
// 量化指标
lqw.eq(StringUtils.isNotBlank(bo.getQuantitativeIndicator()), PerfAppraisalDetail::getQuantitativeIndicator, bo.getQuantitativeIndicator());
return lqw;
}

View File

@@ -71,8 +71,6 @@ public class PerfDeptConfigServiceImpl implements IPerfDeptConfigService {
lqw.eq(bo.getSalaryMode() != null, PerfDeptConfig::getSalaryMode, bo.getSalaryMode());
lqw.eq(bo.getBaseDivisor() != null, PerfDeptConfig::getBaseDivisor, bo.getBaseDivisor());
lqw.eq(bo.getMonth() != null, PerfDeptConfig::getMonth, bo.getMonth());
lqw.eq(bo.getCreatedAt() != null, PerfDeptConfig::getCreatedAt, bo.getCreatedAt());
lqw.eq(bo.getUpdatedAt() != null, PerfDeptConfig::getUpdatedAt, bo.getUpdatedAt());
return lqw;
}

View File

@@ -19,6 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="scoreFormula" column="score_formula"/>
<result property="scoreRule" column="score_rule"/>
<result property="delFlag" column="del_flag"/>
<result property="quantitativeIndicator" column="quantitative_indicator"/>
<result property="remark" column="remark"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>

View File

@@ -17,8 +17,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="baseDivisor" column="base_divisor"/>
<result property="month" column="month"/>
<result property="remark" column="remark"/>
<result property="createdAt" column="created_at"/>
<result property="updatedAt" column="updated_at"/>
<result property="delFlag" column="del_flag"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
</resultMap>

View File

@@ -40,4 +40,9 @@ public class OperPerformanceQuery implements Serializable {
* 模块标题
*/
private String title;
/**
* oper_page 路径前缀(用于按一级菜单过滤,如 /wip
*/
private String operPagePrefix;
}

View File

@@ -0,0 +1,44 @@
package com.klp.system.domain.vo;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* 菜单分组绩效统计 VO按一级菜单 oper_page 归类)
*
* @author Reasonix
*/
@Data
@NoArgsConstructor
public class OperMenuGroupVO implements Serializable {
private static final long serialVersionUID = 1L;
/** 菜单名称(驾驶舱、生产管控……) */
private String menuName;
/** 菜单路由路径前缀post、wip…… */
private String menuPath;
/** 该分类操作总次数 */
private Long totalCount;
/** 成功次数 */
private Long successCount;
/** 失败次数 */
private Long failCount;
/** 成功率 (%) */
private Double successRate;
/** 使用人数 */
private Long personCount;
/** 该分类下的模块明细列表 */
private List<OperModuleStatVO> modules = new ArrayList<>();
}

View File

@@ -16,6 +16,11 @@ public class OperModuleStatVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 所属菜单分组(菜单名称,如"驾驶舱"
*/
private String menuGroup;
/**
* 模块标题
*/

View File

@@ -35,4 +35,9 @@ public interface SysOperLogMapper extends BaseMapperPlus<SysOperLogMapper, SysOp
* 全局概览统计
*/
OperSummaryVO selectGlobalSummary(OperPerformanceQuery query);
/**
* 按菜单分组+模块明细统计oper_page 匹配一级菜单)
*/
List<OperModuleStatVO> selectMenuGroupDetail(OperPerformanceQuery query);
}

View File

@@ -4,6 +4,7 @@ import com.klp.common.core.domain.PageQuery;
import com.klp.common.core.page.TableDataInfo;
import com.klp.system.domain.SysOperLog;
import com.klp.system.domain.bo.OperPerformanceQuery;
import com.klp.system.domain.vo.OperMenuGroupVO;
import com.klp.system.domain.vo.OperModuleStatVO;
import com.klp.system.domain.vo.OperPersonVO;
import com.klp.system.domain.vo.OperSummaryVO;
@@ -69,4 +70,9 @@ public interface ISysOperLogService {
* 模块使用排行
*/
List<OperModuleStatVO> selectModuleRanking(OperPerformanceQuery query);
/**
* 按菜单分组绩效统计oper_page 匹配一级菜单 path
*/
List<OperMenuGroupVO> selectMenuGroupPerformance(OperPerformanceQuery query);
}

View File

@@ -11,6 +11,7 @@ import com.klp.common.utils.StringUtils;
import com.klp.common.utils.ip.AddressUtils;
import com.klp.system.domain.SysOperLog;
import com.klp.system.domain.bo.OperPerformanceQuery;
import com.klp.system.domain.vo.OperMenuGroupVO;
import com.klp.system.domain.vo.OperModuleStatVO;
import com.klp.system.domain.vo.OperPersonVO;
import com.klp.system.domain.vo.OperSummaryVO;
@@ -151,6 +152,86 @@ public class SysOperLogServiceImpl implements ISysOperLogService {
return baseMapper.selectModuleSummary(query);
}
@Override
public List<OperMenuGroupVO> selectMenuGroupPerformance(OperPerformanceQuery query) {
// 1. 查询原始数据(按 menu_group + title 双维度聚合)
List<OperModuleStatVO> rawList = baseMapper.selectMenuGroupDetail(query);
if (rawList == null || rawList.isEmpty()) {
return Collections.emptyList();
}
// 2. 按 menuGroup 分组
Map<String, List<OperModuleStatVO>> groupMap = rawList.stream()
.collect(Collectors.groupingBy(
m -> m.getMenuGroup() != null ? m.getMenuGroup() : "其他",
LinkedHashMap::new,
Collectors.toList()
));
// 3. 固定顺序
List<String> orderNames = java.util.Arrays.asList(
"驾驶舱", "生产管控", "数字仓储", "质量管理",
"销售中心", "生产辅助", "科学排产", "文件夹", "其他"
);
// path 前缀映射
Map<String, String> nameToPath = new LinkedHashMap<>();
nameToPath.put("驾驶舱", "post");
nameToPath.put("生产管控", "wip");
nameToPath.put("数字仓储", "stock");
nameToPath.put("质量管理", "quality");
nameToPath.put("销售中心", "crm");
nameToPath.put("生产辅助", "helper");
nameToPath.put("科学排产", "aps");
nameToPath.put("文件夹", "file");
nameToPath.put("其他", "");
// 4. 构建 VO 列表
List<OperMenuGroupVO> result = new ArrayList<>();
for (String name : orderNames) {
List<OperModuleStatVO> modules = groupMap.get(name);
if (modules == null || modules.isEmpty()) {
continue; // 没有数据的分类不展示
}
OperMenuGroupVO vo = new OperMenuGroupVO();
vo.setMenuName(name);
vo.setMenuPath(nameToPath.getOrDefault(name, ""));
// 汇总该分类的总量
long total = modules.stream().mapToLong(m -> m.getTotalCount() != null ? m.getTotalCount() : 0).sum();
long success = modules.stream()
.mapToLong(m -> Math.round((m.getTotalCount() != null ? m.getTotalCount() : 0)
* (m.getSuccessRate() != null ? m.getSuccessRate() : 0) / 100.0))
.sum();
long fail = total - success;
long persons = modules.stream()
.mapToLong(m -> m.getPersonCount() != null ? m.getPersonCount() : 0).sum();
// 去重人数更合理:取各模块人数最大值作为估算(无法精确去重)
long distinctPersons = modules.stream()
.mapToLong(m -> m.getPersonCount() != null ? m.getPersonCount() : 0)
.max().orElse(0);
// 用 distinct 人数更合理,取模块中最大人数(保守估计)
// 实际跨模块可能有重复,这里用最大模块人数作为下限
vo.setTotalCount(total);
vo.setSuccessCount(success);
vo.setFailCount(fail);
vo.setSuccessRate(total > 0 ? Math.round(success * 10000.0 / total) / 100.0 : 0.0);
vo.setPersonCount(distinctPersons);
// 模块明细按 totalCount 降序排列
modules.sort((a, b) -> {
long ta = a.getTotalCount() != null ? a.getTotalCount() : 0;
long tb = b.getTotalCount() != null ? b.getTotalCount() : 0;
return Long.compare(tb, ta);
});
vo.setModules(modules);
result.add(vo);
}
return result;
}
@Override
public List<OperPersonVO> selectPersonPerformance(OperPerformanceQuery query) {
// 1. 查询人员汇总

View File

@@ -40,6 +40,7 @@
</resultMap>
<resultMap type="com.klp.system.domain.vo.OperModuleStatVO" id="OperModuleStatResult">
<result property="menuGroup" column="menu_group"/>
<result property="operName" column="oper_name"/>
<result property="title" column="title"/>
<result property="totalCount" column="total_count"/>
@@ -90,6 +91,9 @@
<if test="title != null and title != ''">
AND l.title LIKE CONCAT('%', #{title}, '%')
</if>
<if test="operPagePrefix != null and operPagePrefix != ''">
AND l.oper_page LIKE CONCAT(#{operPagePrefix}, '%')
</if>
</where>
GROUP BY l.title
ORDER BY total_count DESC
@@ -126,6 +130,9 @@
<if test="title != null and title != ''">
AND l.title LIKE CONCAT('%', #{title}, '%')
</if>
<if test="operPagePrefix != null and operPagePrefix != ''">
AND l.oper_page LIKE CONCAT(#{operPagePrefix}, '%')
</if>
</where>
GROUP BY l.oper_name, l.dept_name
ORDER BY total_count DESC
@@ -159,6 +166,9 @@
<if test="title != null and title != ''">
AND l.title LIKE CONCAT('%', #{title}, '%')
</if>
<if test="operPagePrefix != null and operPagePrefix != ''">
AND l.oper_page LIKE CONCAT(#{operPagePrefix}, '%')
</if>
</where>
GROUP BY l.oper_name, l.title
ORDER BY l.oper_name, total_count DESC
@@ -190,7 +200,57 @@
<if test="title != null and title != ''">
AND l.title LIKE CONCAT('%', #{title}, '%')
</if>
<if test="operPagePrefix != null and operPagePrefix != ''">
AND l.oper_page LIKE CONCAT(#{operPagePrefix}, '%')
</if>
</where>
</select>
<!-- 按菜单分组+模块明细统计(基于 oper_page 匹配一级菜单 path -->
<select id="selectMenuGroupDetail" parameterType="com.klp.system.domain.bo.OperPerformanceQuery" resultMap="OperModuleStatResult">
SELECT
CASE
WHEN l.oper_page LIKE '/post%' THEN '驾驶舱'
WHEN l.oper_page LIKE '/wip%' THEN '生产管控'
WHEN l.oper_page LIKE '/stock%' THEN '数字仓储'
WHEN l.oper_page LIKE '/quality%' THEN '质量管理'
WHEN l.oper_page LIKE '/crm%' THEN '销售中心'
WHEN l.oper_page LIKE '/helper%' THEN '生产辅助'
WHEN l.oper_page LIKE '/aps%' THEN '科学排产'
WHEN l.oper_page LIKE '/file%' THEN '文件夹'
ELSE '其他'
END AS menu_group,
l.title,
COUNT(1) AS total_count,
SUM(CASE WHEN l.business_type = 1 THEN 1 ELSE 0 END) AS add_count,
SUM(CASE WHEN l.business_type = 2 THEN 1 ELSE 0 END) AS edit_count,
SUM(CASE WHEN l.business_type = 3 THEN 1 ELSE 0 END) AS delete_count,
SUM(CASE WHEN l.business_type = 0 THEN 1 ELSE 0 END) AS other_count,
ROUND(SUM(CASE WHEN l.status = 0 THEN 1 ELSE 0 END) * 100.0 / COUNT(1), 2) AS success_rate,
COUNT(DISTINCT l.oper_name) AS person_count
FROM sys_oper_log l
<where>
<if test="beginTime != null and beginTime != ''">
AND l.oper_time &gt;= #{beginTime}
</if>
<if test="endTime != null and endTime != ''">
AND l.oper_time &lt;= #{endTime}
</if>
<if test="deptName != null and deptName != ''">
AND l.dept_name LIKE CONCAT('%', #{deptName}, '%')
</if>
<if test="operName != null and operName != ''">
AND l.oper_name LIKE CONCAT('%', #{operName}, '%')
</if>
<if test="title != null and title != ''">
AND l.title LIKE CONCAT('%', #{title}, '%')
</if>
<if test="operPagePrefix != null and operPagePrefix != ''">
AND l.oper_page LIKE CONCAT(#{operPagePrefix}, '%')
</if>
</where>
GROUP BY menu_group, l.title
ORDER BY FIELD(menu_group, '驾驶舱','生产管控','数字仓储','质量管理','销售中心','生产辅助','科学排产','文件夹','其他'), total_count DESC
</select>
</mapper>

View File

@@ -0,0 +1,64 @@
import request from '@/utils/request'
// 查询检化验申请单列表
export function listInspectionApplication(query) {
return request({
url: '/wms/inspectionApplication/list',
method: 'get',
params: query
})
}
// 查询检化验申请单详细
export function getInspectionApplication(applicationId) {
return request({
url: '/wms/inspectionApplication/' + applicationId,
method: 'get'
})
}
// 新增检化验申请单
export function addInspectionApplication(data) {
return request({
url: '/wms/inspectionApplication',
method: 'post',
data: data
})
}
// 修改检化验申请单
export function updateInspectionApplication(data) {
return request({
url: '/wms/inspectionApplication',
method: 'put',
data: data
})
}
// 删除检化验申请单
export function delInspectionApplication(applicationIds) {
return request({
url: '/wms/inspectionApplication/' + applicationIds,
method: 'delete'
})
}
// ====== 批量保存检验数据(审批通过后填写) ======
// 批量保存物理检验数据
export function batchSavePhysicalData(data) {
return request({
url: '/wms/inspectionApplication/batchSavePhysical',
method: 'post',
data: data
})
}
// 批量保存化学检验数据
export function batchSaveChemicalData(data) {
return request({
url: '/wms/inspectionApplication/batchSaveChemical',
method: 'post',
data: data
})
}

View File

@@ -47,7 +47,7 @@ export function delInspectionItemTemplate(templateId) {
export function getInfoByInspectionItem(inspectionItemIds) {
return request({
url: '/qc/inspectionItemTemplate/getInfoByInspectionItem',
method: 'post',
method: 'get',
params: {
inspectionItemIds
}

View File

@@ -26,3 +26,12 @@ export function getModuleRanking(params) {
params: params
})
}
// 按菜单分组绩效统计oper_page 匹配一级菜单)
export function getMenuGroup(params) {
return request({
url: '/monitor/performance/menuGroup',
method: 'get',
params: params
})
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,229 +0,0 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="60px">
<el-form-item label="任务名称" prop="taskName">
<el-input
v-model="queryParams.taskName"
placeholder="请输入任务名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 上方任务列表表格 -->
<div class="mb10">
<div class="table-title">检验历史列表</div>
<KLPTable ref="historyTable" height="300px" highlight-current-row v-loading="loading" :data="checkTaskList" @row-click="handleRowClick" row-class-name="tableRowClassName">
<el-table-column label="任务名称" align="center" prop="taskName" />
<el-table-column label="钢卷号" align="center" prop="currentCoilNo" />
<el-table-column label="工段" align="center" prop="workshopSection" />
<el-table-column label="工序" align="center" prop="process" />
<el-table-column label="机组" align="center" prop="unitGroup" />
<el-table-column label="检验结果" align="center" prop="inspectionResult">
<template slot-scope="scope">
<span>
<span v-if="scope.row.inspectionResult == 0" style="color: grey;">未检验</span>
<span v-else-if="scope.row.inspectionResult == 1" style="color: #67C23A;">合格</span>
<span v-else-if="scope.row.inspectionResult == 2" style="color: #FF4949;">不合格</span>
<span v-else style="color: grey;">未知</span>
</span>
</template>
</el-table-column>
<el-table-column label="检验类型" align="center" prop="inspectionType" />
<el-table-column label="备注" align="center" prop="remark" />
</KLPTable>
</div>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 下方检测详情表格 -->
<div class="detail-section">
<div class="table-title">检测详情</div>
<div v-if="selectedTask && detailData.itemList && detailData.itemList.length > 0">
<KLPTable v-loading="loading" :data="detailData.itemList" style="margin-top: 10px;">
<el-table-column label="检查项" align="center" prop="itemName">
<template slot-scope="scope">
<el-tag type="info">{{ scope.row.itemName }}</el-tag>
</template>
</el-table-column>
<el-table-column label="定性定量" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.qualitativeQuantitative !== undefined" :type="scope.row.qualitativeQuantitative === 0 ? 'primary' : 'warning'">
{{ scope.row.qualitativeQuantitative === 0 ? '定性' : '定量' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="标准目标" align="center">
<template slot-scope="scope">
{{ scope.row.standardTarget }} {{ scope.row.unit || '' }}
</template>
</el-table-column>
<el-table-column label="目标上限" align="center">
<template slot-scope="scope">
{{ scope.row.targetUpper }} {{ scope.row.unit || '' }}
</template>
</el-table-column>
<el-table-column label="目标下限" align="center">
<template slot-scope="scope">
{{ scope.row.targetLower }} {{ scope.row.unit || '' }}
</template>
</el-table-column>
<el-table-column label="实测值" align="center">
<template slot-scope="scope">
{{ scope.row.actualMeasure }} {{ scope.row.unit || '' }}
</template>
</el-table-column>
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<span>
<span v-if="scope.row.status == 0" style="color: gray;">未检测</span>
<span v-else-if="scope.row.status == 1" style="color: #67C23A;">通过</span>
<span v-else-if="scope.row.status == 2" style="color: #FF4949;">不通过</span>
<span v-else style="color: gray;">未知</span>
</span>
</template>
</el-table-column>
</KLPTable>
</div>
<div v-else class="empty-tip">
<el-empty description="请选择一个检验历史任务查看详情"></el-empty>
</div>
</div>
</div>
</template>
<script>
import { listHistoryCheckTask, getCheckTask } from '@/api/mes/qc/checkTask'
export default {
name: 'CheckTaskHistory',
data() {
return {
loading: true,
showSearch: true,
total: 0,
checkTaskList: [],
queryParams: {
pageNum: 1,
pageSize: 20,
taskName: undefined,
},
detailData: {},
// 当前选中的任务(单选)
selectedTask: null,
}
},
mounted() {
this.getList()
},
methods: {
getList() {
this.loading = true
listHistoryCheckTask(this.queryParams).then(response => {
this.checkTaskList = response.rows.map(item => ({
...item,
verifyTarget: JSON.parse(item.verifyTarget),
entryCoilNo: item.coilList?.[0]?.entryCoilNo || '',
currentCoilNo: item.coilList?.[0]?.currentCoilNo || '',
weight: item.coilList?.[0]?.netWeight || 0,
}))
this.total = response.total
this.loading = false
})
},
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
resetQuery() {
this.resetForm('queryForm')
this.handleQuery()
},
// 点击行选中任务
handleRowClick(row) {
if (this.selectedTask && this.selectedTask.taskId === row.taskId) {
// 点击当前选中行,取消选中
this.selectedTask = null
this.detailData = {}
} else {
// 选中新行
this.selectedTask = row
this.loadTaskDetail(row.taskId)
}
},
// 表格行样式
tableRowClassName({row, rowIndex}) {
return this.selectedTask && this.selectedTask.taskId === row.taskId ? 'current-row' : ''
},
// 加载任务详情
loadTaskDetail(taskId) {
this.loading = true
getCheckTask(taskId).then(response => {
this.detailData = response.data
}).finally(() => {
this.loading = false
})
},
handleExport() {
this.download('qc/checkTask/export', {
...this.queryParams
}, `checkTask_${new Date().getTime()}.xlsx`)
}
},
// 添加样式
computed: {
styles() {
return {
mb10: { marginBottom: '10px' },
detailSection: {
marginTop: '20px',
border: '1px solid #e6e6e6',
borderRadius: '4px',
padding: '10px'
},
tableTitle: {
fontSize: '16px',
fontWeight: 'bold',
marginBottom: '10px',
color: '#333'
},
emptyTip: {
textAlign: 'center',
padding: '40px 0',
backgroundColor: '#fafafa',
borderRadius: '4px'
}
}
}
}
}
</script>

View File

@@ -1,402 +0,0 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="检验项目名称" prop="itemName">
<el-input
v-model="queryParams.itemName"
placeholder="请输入检验项目名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="标准值" prop="standardValue">
<el-input
v-model="queryParams.standardValue"
placeholder="请输入标准值"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="上限" prop="upperLimit">
<el-input
v-model="queryParams.upperLimit"
placeholder="请输入上限"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="下限" prop="lowerLimit">
<el-input
v-model="queryParams.lowerLimit"
placeholder="请输入下限"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="单位" prop="unit">
<el-input
v-model="queryParams.unit"
placeholder="请输入单位"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="检验值" prop="inspectValue">
<el-input
v-model="queryParams.inspectValue"
placeholder="请输入检验值"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="是否合格" prop="isQualified">
<el-input
v-model="queryParams.isQualified"
placeholder="请输入是否合格"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="判定结果" prop="judgeResult">
<el-input
v-model="queryParams.judgeResult"
placeholder="请输入判定结果"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="检验人" prop="inspectUser">
<el-input
v-model="queryParams.inspectUser"
placeholder="请输入检验人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="检验时间" prop="inspectTime">
<el-date-picker clearable
v-model="queryParams.inspectTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择检验时间">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="inspectionItemList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="明细ID" align="center" prop="itemId" v-if="false"/>
<el-table-column label="检验项目名称" align="center" prop="itemName" />
<el-table-column label="标准值" align="center" prop="standardValue" />
<el-table-column label="上限" align="center" prop="upperLimit" />
<el-table-column label="下限" align="center" prop="lowerLimit" />
<el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="定性/定量" align="center" prop="itemType" />
<el-table-column label="检验值" align="center" prop="inspectValue" />
<el-table-column label="是否合格" align="center" prop="isQualified" />
<el-table-column label="判定结果" align="center" prop="judgeResult" />
<el-table-column label="检验人" align="center" prop="inspectUser" />
<el-table-column label="检验时间" align="center" prop="inspectTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.inspectTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改检验任务项目+结果对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="检验项目名称" prop="itemName">
<el-input v-model="form.itemName" placeholder="请输入检验项目名称" />
</el-form-item>
<el-form-item label="标准值" prop="standardValue">
<el-input v-model="form.standardValue" placeholder="请输入标准值" />
</el-form-item>
<el-form-item label="上限" prop="upperLimit">
<el-input v-model="form.upperLimit" placeholder="请输入上限" />
</el-form-item>
<el-form-item label="下限" prop="lowerLimit">
<el-input v-model="form.lowerLimit" placeholder="请输入下限" />
</el-form-item>
<el-form-item label="单位" prop="unit">
<el-input v-model="form.unit" placeholder="请输入单位" />
</el-form-item>
<el-form-item label="检验值" prop="inspectValue">
<el-input v-model="form.inspectValue" placeholder="请输入检验值" />
</el-form-item>
<el-form-item label="是否合格" prop="isQualified">
<el-input v-model="form.isQualified" placeholder="请输入是否合格" />
</el-form-item>
<el-form-item label="判定结果" prop="judgeResult">
<el-input v-model="form.judgeResult" placeholder="请输入判定结果" />
</el-form-item>
<el-form-item label="检验人" prop="inspectUser">
<el-input v-model="form.inspectUser" placeholder="请输入检验人" />
</el-form-item>
<el-form-item label="检验时间" prop="inspectTime">
<el-date-picker clearable
v-model="form.inspectTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择检验时间">
</el-date-picker>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listInspectionItem, getInspectionItem, delInspectionItem, addInspectionItem, updateInspectionItem } from "@/api/mes/qc/inspectionItem";
export default {
name: "InspectionItem",
data() {
return {
// 按钮loading
buttonLoading: false,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 检验任务项目+结果表格数据
inspectionItemList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
itemName: undefined,
standardValue: undefined,
upperLimit: undefined,
lowerLimit: undefined,
unit: undefined,
itemType: undefined,
inspectValue: undefined,
isQualified: undefined,
judgeResult: undefined,
inspectUser: undefined,
inspectTime: undefined,
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询检验任务项目+结果列表 */
getList() {
this.loading = true;
listInspectionItem(this.queryParams).then(response => {
this.inspectionItemList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
itemId: undefined,
taskId: undefined,
itemName: undefined,
standardValue: undefined,
upperLimit: undefined,
lowerLimit: undefined,
unit: undefined,
itemType: undefined,
inspectValue: undefined,
isQualified: undefined,
judgeResult: undefined,
inspectUser: undefined,
inspectTime: undefined,
remark: undefined,
delFlag: undefined,
createTime: undefined,
createBy: undefined,
updateTime: undefined,
updateBy: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.itemId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加检验任务项目+结果";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
const itemId = row.itemId || this.ids
getInspectionItem(itemId).then(response => {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = "修改检验任务项目+结果";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.itemId != null) {
updateInspectionItem(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addInspectionItem(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const itemIds = row.itemId || this.ids;
this.$modal.confirm('是否确认删除检验任务项目+结果编号为"' + itemIds + '"的数据项?').then(() => {
this.loading = true;
return delInspectionItem(itemIds);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
/** 导出按钮操作 */
handleExport() {
this.download('qc/inspectionItem/export', {
...this.queryParams
}, `inspectionItem_${new Date().getTime()}.xlsx`)
}
}
};
</script>

File diff suppressed because it is too large Load Diff

View File

@@ -3,14 +3,14 @@
<div v-loading="filterLoading" style="margin-bottom: 16px; min-height: 50px;">
<div style="display: flex; align-items: center; margin-bottom: 6px;">
<span style="font-size: 13px; color: #909399; white-space: nowrap; margin-right: 12px; width: 68px; text-align: right;">所属单位</span>
<el-radio-group v-model="selectedCompany" size="small" @change="handleCompanyChange">
<el-radio-group v-model="selectedCompany" size="small" :disabled="mainLoading" @change="handleCompanyChange">
<el-radio-button label="">全部</el-radio-button>
<el-radio-button v-for="company in companyOptions" :key="company" :label="company">{{ company }}</el-radio-button>
</el-radio-group>
</div>
<div style="display: flex; align-items: center; margin-bottom: 6px;">
<span style="font-size: 13px; color: #909399; white-space: nowrap; margin-right: 12px; width: 68px; text-align: right;">方案名称</span>
<el-radio-group v-model="selectedScheme" size="small" @change="handleSchemeChange">
<el-radio-group v-model="selectedScheme" size="small" :disabled="mainLoading" @change="handleSchemeChange">
<el-radio-button label="">全部</el-radio-button>
<el-radio-button v-for="scheme in schemeOptions" :key="scheme" :label="scheme">{{ scheme }}</el-radio-button>
</el-radio-group>
@@ -42,6 +42,9 @@
<el-table v-loading="mainLoading" :data="mainList" border stripe class="dynamic-table" fit max-height="calc(100vh - 260px)">
<el-table-column label="日期" align="center" width="150" fixed="left">
<template slot="header">
<span class="required-mark">日期</span>
</template>
<template slot-scope="scope">
<el-date-picker
v-model="scope.row.inspectionDate"
@@ -113,30 +116,6 @@
/>
</div>
<el-empty v-else description="请先选择所属单位和检验方案" />
<el-dialog :title="'新增检验记录'" :visible.sync="addMainDialogVisible" width="600px" append-to-body>
<el-form ref="addMainForm" :model="addMainFormData" label-width="100px">
<el-form-item label="样品名称" prop="sampleName">
<el-input v-model="addMainFormData.sampleName" placeholder="请输入样品名称" />
</el-form-item>
<el-form-item label="样品编号" prop="sampleNo">
<el-input v-model="addMainFormData.sampleNo" placeholder="请输入样品编号" />
</el-form-item>
<el-form-item label="来样编号" prop="batchNo">
<el-input v-model="addMainFormData.batchNo" placeholder="请输入来样编号" />
</el-form-item>
<el-form-item label="检验日期" prop="inspectionDate">
<el-date-picker v-model="addMainFormData.inspectionDate" type="date" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择检验日期" style="width:100%" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="addMainFormData.remark" type="textarea" placeholder="请输入备注" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="addMainDialogVisible = false">取消</el-button>
<el-button type="primary" @click="submitAddMain">确定</el-button>
</div>
</el-dialog>
</div>
</template>
@@ -151,7 +130,6 @@ export default {
return {
filterLoading: false,
mainLoading: false,
addMainDialogVisible: false,
templateList: [],
cascadeData: {},
companyOptions: [],
@@ -166,14 +144,7 @@ export default {
pageNum: 1,
pageSize: 1000
},
dateRange: [],
addMainFormData: {
sampleName: '',
sampleNo: '',
batchNo: '',
inspectionDate: '',
remark: ''
}
dateRange: []
}
},
created() {
@@ -247,6 +218,7 @@ export default {
},
handleCompanyChange() {
if (this.mainLoading) return
this.selectedScheme = ''
if (this.selectedCompany) {
this.schemeOptions = this.cascadeData[this.selectedCompany] || []
@@ -262,6 +234,7 @@ export default {
},
handleSchemeChange() {
if (this.mainLoading) return
if (!this.selectedScheme) {
this.currentTemplate = null
this.mainList = []
@@ -365,31 +338,39 @@ export default {
},
handleAddMain() {
this.addMainFormData = {
const itemMap = {}
if (this.checkItems.length > 0) {
this.checkItems.forEach(item => {
itemMap[item.itemName] = {
detailId: undefined,
mainId: undefined,
itemName: item.itemName,
itemValue: '',
itemUnit: item.unit,
upperLimit: item.targetUpper,
lowerLimit: item.targetLower,
rangeDesc: ''
}
})
}
const newRow = {
_isNew: true,
_items: itemMap,
_originalItems: JSON.parse(JSON.stringify(itemMap)),
inspectionDate: '',
sampleName: '',
sampleNo: '',
batchNo: '',
inspectionDate: '',
remark: ''
}
this.addMainDialogVisible = true
},
submitAddMain() {
const data = {
...this.addMainFormData,
templateId: this.currentTemplate.templateId
}
addInspectionMain(data).then(() => {
this.$message.success('新增成功')
this.addMainDialogVisible = false
this.getMainList()
}).catch(() => {
this.$message.error('新增失败')
})
this.mainList.unshift(newRow)
},
handleSaveMain(row) {
if (!row.inspectionDate) {
this.$message.warning('请选择检验日期')
return
}
row._saving = true
const detailList = this.checkItems.map(checkItem => {
const itemData = row._items[checkItem.itemName]
@@ -405,38 +386,20 @@ export default {
rangeDesc: itemData.rangeDesc || ''
}
}).filter(Boolean)
updateInspectionMain({
mainId: row.mainId,
const requestData = {
sampleName: row.sampleName,
sampleNo: row.sampleNo,
batchNo: row.batchNo,
inspectionDate: row.inspectionDate,
remark: row.remark,
templateId: this.currentTemplate.templateId,
detailList: detailList
}).then(() => {
}
const isNew = row._isNew || !row.mainId
const apiCall = isNew ? addInspectionMain(requestData) : updateInspectionMain({ ...requestData, mainId: row.mainId })
apiCall.then(() => {
this.$message.success('保存成功')
return listInspectionDetail({ mainId: row.mainId, pageNum: 1, pageSize: 9999 })
}).then(response => {
const details = response.rows || []
if (this.checkItems.length > 0) {
this.checkItems.forEach(item => {
const found = details.find(d => d.itemName === item.itemName)
if (found) {
row._items[item.itemName] = {
detailId: found.detailId,
mainId: found.mainId,
itemName: found.itemName,
itemValue: found.itemValue || '',
itemUnit: found.itemUnit || item.unit,
upperLimit: found.upperLimit,
lowerLimit: found.lowerLimit,
rangeDesc: found.rangeDesc
}
}
})
}
row._originalItems = JSON.parse(JSON.stringify(row._items))
row._saving = false
this.getMainList()
}).catch(() => {
this.$message.error('保存失败')
row._saving = false
@@ -515,4 +478,10 @@ export default {
::v-deep .dynamic-table .el-table__body-wrapper {
overflow-x: auto;
}
.required-mark::before {
content: '*';
color: #f56c6c;
margin-right: 4px;
}
</style>

View File

@@ -1,299 +0,0 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="检查项名称" prop="itemName">
<el-input
v-model="queryParams.itemName"
placeholder="请输入检查项名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<KLPTable v-loading="loading" :data="checkItemList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="主键" align="center" prop="itemId" v-if="true"/> -->
<el-table-column label="检查项名称" align="center" prop="itemName" />
<el-table-column label="标准目标" align="center" prop="standardTarget" />
<el-table-column label="目标上限" align="center" prop="targetUpper" />
<el-table-column label="目标下限" align="center" prop="targetLower" />
<el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="定性定量" align="center" prop="qualitativeQuantitative">
<template slot-scope="scope">
{{ scope.row.qualitativeQuantitative === 0 ? '定性' : '定量' }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</KLPTable>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改检查项对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="检查项名称" prop="itemName">
<el-input v-model="form.itemName" placeholder="请输入检查项名称" />
</el-form-item>
<el-form-item label="标准目标" prop="standardTarget">
<el-input v-model.number="form.standardTarget" type="number" step="0.01" placeholder="请输入标准目标" />
</el-form-item>
<el-form-item label="目标上限" prop="targetUpper">
<el-input v-model.number="form.targetUpper" type="number" step="0.01" placeholder="请输入目标上限" />
</el-form-item>
<el-form-item label="目标下限" prop="targetLower">
<el-input v-model.number="form.targetLower" type="number" step="0.01" placeholder="请输入目标下限" />
</el-form-item>
<el-form-item label="单位" prop="unit">
<el-input v-model="form.unit" placeholder="请输入单位" />
</el-form-item>
<el-form-item label="定性定量" prop="qualitativeQuantitative">
<el-radio-group v-model="form.qualitativeQuantitative">
<el-radio :label="0">定性</el-radio>
<el-radio :label="1">定量</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listCheckItem, getCheckItem, delCheckItem, addCheckItem, updateCheckItem } from "@/api/mes/qc/checkItem";
export default {
name: "CheckItem",
data() {
return {
// 按钮loading
buttonLoading: false,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 检查项表格数据
checkItemList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 20,
itemName: undefined,
standardTarget: undefined,
targetUpper: undefined,
targetLower: undefined,
unit: undefined,
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询检查项列表 */
getList() {
this.loading = true;
listCheckItem(this.queryParams).then(response => {
this.checkItemList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
itemId: undefined,
itemName: undefined,
standardTarget: undefined,
targetUpper: undefined,
targetLower: undefined,
unit: undefined,
qualitativeQuantitative: 0,
createBy: undefined,
createTime: undefined,
updateBy: undefined,
updateTime: undefined,
delFlag: undefined,
remark: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.itemId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加检查项";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
const itemId = row.itemId || this.ids
getCheckItem(itemId).then(response => {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = "修改检查项";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.itemId != null) {
updateCheckItem(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addCheckItem(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const itemIds = row.itemId || this.ids;
this.$modal.confirm('是否确认删除检查项编号为"' + itemIds + '"的数据项?').then(() => {
this.loading = true;
return delCheckItem(itemIds);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
/** 导出按钮操作 */
handleExport() {
this.download('qc/checkItem/export', {
...this.queryParams
}, `checkItem_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@@ -1,405 +0,0 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="60px">
<el-form-item label="任务名称" prop="taskName">
<el-input v-model="queryParams.taskName" placeholder="请输入任务名称" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="!selectedTask"
@click="handleUpdate">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="!selectedTask"
@click="handleDelete">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 上方任务列表表格 -->
<div class="mb10">
<div class="table-title">待检任务列表</div>
<KLPTable ref="checkTaskTable" height="300px" highlight-current-row v-loading="loading" :data="checkTaskList" @row-click="handleRowClick">
<el-table-column label="任务名称" align="center" prop="taskName" />
<el-table-column label="校验目标" align="center" prop="verifyTarget" />
<el-table-column label="工段" align="center" prop="workshopSection" />
<el-table-column label="工序" align="center" prop="process" />
<el-table-column label="机组" align="center" prop="unitGroup" />
<el-table-column label="检验结果" align="center">
<template slot-scope="scope">
<el-tag
:type="scope.row.inspectionResult == 1 ? 'success' : (scope.row.inspectionResult == 2 ? 'danger' : 'info')">
<span v-if="scope.row.inspectionResult == 0">未检验</span>
<span v-else-if="scope.row.inspectionResult == 1">合格</span>
<span v-else-if="scope.row.inspectionResult == 2">不合格</span>
<span v-else>未知</span>
</el-tag>
</template>
</el-table-column>
<el-table-column label="检验类型" align="center" prop="inspectionType" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</KLPTable>
</div>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 下方检测详情表格 -->
<div class="detail-section">
<div class="table-title">检测详情</div>
<div v-if="selectedTask && detailData.itemList && detailData.itemList.length > 0">
<KLPTable v-loading="detailLoading" :data="detailData.itemList" style="margin-top: 10px;">
<el-table-column label="检查项" align="center" prop="itemName">
<template slot-scope="scope">
<el-tag type="info">{{ scope.row.itemName }}</el-tag>
</template>
</el-table-column>
<el-table-column label="定性定量" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.qualitativeQuantitative !== undefined"
:type="scope.row.qualitativeQuantitative === 0 ? 'primary' : 'warning'">
{{ scope.row.qualitativeQuantitative === 0 ? '定性' : '定量' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="标准目标" align="center">
<template slot-scope="scope">
{{ scope.row.standardTarget }} {{ scope.row.unit || '' }}
</template>
</el-table-column>
<el-table-column label="目标上限" align="center">
<template slot-scope="scope">
{{ scope.row.targetUpper }} {{ scope.row.unit || '' }}
</template>
</el-table-column>
<el-table-column label="目标下限" align="center">
<template slot-scope="scope">
{{ scope.row.targetLower }} {{ scope.row.unit || '' }}
</template>
</el-table-column>
<el-table-column label="实测值" align="center">
<template slot-scope="scope">
{{ scope.row.actualMeasure }} {{ scope.row.unit || '' }}
</template>
</el-table-column>
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<el-tag :type="scope.row.status == 1 ? 'success' : (scope.row.status == 2 ? 'danger' : 'info')">
<span v-if="scope.row.status == 0">未检测</span>
<span v-else-if="scope.row.status == 1">通过</span>
<span v-else-if="scope.row.status == 2">不通过</span>
<span v-else>未知</span>
</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button v-if="scope.row.status == 0" size="mini" type="success"
@click="changeItemStatus(detailData.taskId, scope.row.itemId, 1)">通过</el-button>
<el-button v-if="scope.row.status == 0" size="mini" type="danger" style="margin-left: 8px;"
@click="changeItemStatus(detailData.taskId, scope.row.itemId, 2)">不通过</el-button>
</template>
</el-table-column>
</KLPTable>
</div>
<div v-else class="empty-tip">
<el-empty description="请选择一个待检任务查看详情"></el-empty>
</div>
</div>
<!-- 添加或修改检查任务对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="任务名称" prop="taskName">
<el-input v-model="form.taskName" placeholder="请输入任务名称" />
</el-form-item>
<el-form-item label="检查项" prop="itemId">
<CheckItemSelect v-model="form.itemId" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="校验目标" prop="verifyTarget">
<el-input v-model="form.verifyTarget" type="textarea" placeholder="请输入校验目标(JSON格式)" />
</el-form-item>
<el-form-item label="工段" prop="workshopSection">
<el-input v-model="form.workshopSection" placeholder="请输入工段" />
</el-form-item>
<el-form-item label="工序" prop="process">
<el-input v-model="form.process" placeholder="请输入工序" />
</el-form-item>
<el-form-item label="机组" prop="unitGroup">
<el-input v-model="form.unitGroup" placeholder="请输入机组" />
</el-form-item>
<el-form-item label="检验结果" prop="inspectionResult">
<el-select v-model="form.inspectionResult" placeholder="请选择检验结果">
<el-option label="未检验" :value="0" />
<el-option label="合格" :value="1" />
<el-option label="不合格" :value="2" />
</el-select>
</el-form-item>
<el-form-item label="检验类型" prop="inspectionType">
<el-input v-model="form.inspectionType" placeholder="请输入检验类型" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listCheckTask, getCheckTask, delCheckTask, addCheckTask, updateCheckTask } from '@/api/mes/qc/checkTask'
import { updateCheckTaskItemStatus } from '@/api/mes/qc/checkTaskItem'
import CheckItemSelect from '@/components/KLPService/CheckItemSelect/index'
export default {
name: 'CheckTask',
data() {
return {
// 按钮loading
buttonLoading: false,
// 遮罩层
loading: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 检查任务表格数据
checkTaskList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 20,
taskName: undefined,
},
// 表单参数
form: {
verifyTarget: undefined,
workshopSection: undefined,
process: undefined,
unitGroup: undefined,
inspectionResult: 0,
inspectionType: undefined
},
// 表单校验
rules: {
},
detailData: {},
// 选中的任务(当前选择的行)
selectedTask: null
};
},
created() {
console.log(this.$refs.checkTaskTable, '初始化表格数据')
this.getList();
},
components: {
CheckItemSelect
},
methods: {
/** 查询检查任务列表 */
getList() {
this.loading = true;
listCheckTask(this.queryParams).then(response => {
this.checkTaskList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
taskId: undefined,
taskName: undefined,
itemId: [],
createBy: undefined,
createTime: undefined,
updateBy: undefined,
updateTime: undefined,
delFlag: undefined,
remark: undefined,
verifyTarget: undefined,
workshopSection: undefined,
process: undefined,
unitGroup: undefined,
inspectionResult: 0,
inspectionType: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 点击行选中任务 */
handleRowClick(row) {
// 否则选中当前行
this.selectedTask = row
this.loadTaskDetail(row.taskId)
},
// 加载任务详情
loadTaskDetail(taskId) {
this.detailLoading = true
console.log(taskId, '加载任务详情')
getCheckTask(taskId)
.then(response => {
this.detailData = response.data
this.detailLoading = false
})
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加检查任务";
},
/** 修改按钮操作 */
handleUpdate() {
this.loading = true;
this.reset();
getCheckTask(this.selectedTask.taskId).then(response => {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = "修改检查任务";
});
},
/** 详情按钮操作 */
handleDetail(row) {
this.loading = true
getCheckTask(row.taskId).then(response => {
this.detailData = response.data
}).finally(() => {
this.loading = false
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.taskId != null) {
updateCheckTask(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addCheckTask(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const taskId = row ? row.taskId : this.selectedTask.taskId;
this.$modal.confirm('是否确认删除检查任务编号为"' + taskId + '"的数据项?').then(() => {
this.loading = true;
return delCheckTask(taskId);
}).then(() => {
this.loading = false;
this.getList();
// 重置选中状态和详情数据
this.selectedTask = null;
this.detailData = {};
this.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
/** 导出按钮操作 */
handleExport() {
this.download('qc/checkTask/export', {
...this.queryParams
}, `checkTask_${new Date().getTime()}.xlsx`)
},
/** 修改检查项状态 */
changeItemStatus(checkTaskId, checkItemId, status) {
this.$modal.confirm('确定要将该检查项状态修改为' + (status === 1 ? '通过' : '不通过') + '吗?').then(() => {
// 调用新接口
return updateCheckTaskItemStatus({ checkTaskId, checkItemId, status })
}).then(() => {
this.$modal.msgSuccess('状态修改成功')
// 重新拉取详情
getCheckTask(this.detailData.taskId).then(response => {
this.detailData = response.data
})
})
},
},
// 添加样式
computed: {
styles() {
return {
mb10: { marginBottom: '10px' },
detailSection: {
marginTop: '20px',
border: '1px solid #e6e6e6',
borderRadius: '4px',
padding: '10px'
},
tableTitle: {
fontSize: '16px',
fontWeight: 'bold',
marginBottom: '10px',
color: '#333'
},
emptyTip: {
textAlign: 'center',
padding: '40px 0',
backgroundColor: '#fafafa',
borderRadius: '4px'
}
}
}
},
};
</script>

View File

@@ -1,467 +0,0 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="60px">
<el-form-item label="任务名称" prop="taskName">
<el-input v-model="queryParams.taskName" placeholder="请输入任务名称" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="机组" prop="unitGroup">
<el-input v-model="queryParams.unitGroup" placeholder="请输入机组" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="工段" prop="workshopSection">
<el-input v-model="queryParams.workshopSection" placeholder="请输入工段" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="工序" prop="process">
<el-input v-model="queryParams.process" placeholder="请输入工序" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="!selectedTask"
@click="handleUpdate">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 上方任务列表表格 -->
<div class="mb10">
<KLPTable ref="checkTaskTable" height="300px" highlight-current-row v-loading="loading" :data="checkTaskList"
@row-click="handleRowClick">
<el-table-column label="任务名称" align="center" prop="taskName" />
<el-table-column label="工段" align="center" prop="workshopSection" />
<el-table-column label="工序" align="center" prop="process" />
<el-table-column label="机组" align="center" prop="unitGroup" />
<el-table-column label="样品编码" align="center" prop="verifyTarget.sampleId" />
<el-table-column label="物料编码" align="center" prop="verifyTarget.materialId" />
<el-table-column label="物料名称" align="center" prop="verifyTarget.materialName" />
<el-table-column label="供应商" align="center" prop="verifyTarget.vendor" />
<el-table-column label="规格型号" align="center" prop="verifyTarget.specificationModel" />
<el-table-column label="检验结果" align="center">
<template slot-scope="scope">
<span>
<span v-if="scope.row.inspectionResult == 0" style="color: grey;">未检验</span>
<span v-else-if="scope.row.inspectionResult == 1" style="color: #67C23A;">合格</span>
<span v-else-if="scope.row.inspectionResult == 2" style="color: #FF4949;">不合格</span>
<span v-else style="color: grey;">未知</span>
</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleAccept(scope.row)">合格</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleReject(scope.row)">不合格</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</KLPTable>
</div>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 下方检测详情表格 -->
<div class="detail-section">
<div class="table-title">检测详情</div>
<div v-if="selectedTask && detailData.itemList && detailData.itemList.length > 0">
<KLPTable v-loading="detailLoading" :data="detailData.itemList" style="margin-top: 10px;">
<el-table-column label="检查项" align="center" prop="itemName">
<template slot-scope="scope">
<el-tag type="info">{{ scope.row.itemName }}</el-tag>
</template>
</el-table-column>
<el-table-column label="定性定量" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.qualitativeQuantitative !== undefined"
:type="scope.row.qualitativeQuantitative === 0 ? 'primary' : 'warning'">
{{ scope.row.qualitativeQuantitative === 0 ? '定性' : '定量' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="标准目标" align="center" prop="standardTarget"></el-table-column>
<el-table-column label="目标上限" align="center" prop="targetUpper"></el-table-column>
<el-table-column label="目标下限" align="center" prop="targetLower"></el-table-column>
<el-table-column label="实测值" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.actualMeasure" placeholder="请输入实测值" clearable
@blur="handleBlur(scope.row)" />
</template>
</el-table-column>
<el-table-column label="单位" align="center" prop="unit"></el-table-column>
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<span>
<span v-if="scope.row.status == 0" style="color: gray;">未检测</span>
<span v-else-if="scope.row.status == 1" style="color: #67C23A;">通过</span>
<span v-else-if="scope.row.status == 2" style="color: #FF4949;">不通过</span>
<span v-else style="color: gray;">未知</span>
</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button v-if="scope.row.status == 0" size="mini" type="text" style="color: #67C23A;"
@click="changeItemStatus(detailData.taskId, scope.row.itemId, 1)">通过</el-button>
<el-button v-if="scope.row.status == 0" size="mini" type="text" style="margin-left: 8px; color: #FF4949;"
@click="changeItemStatus(detailData.taskId, scope.row.itemId, 2)">不通过</el-button>
</template>
</el-table-column>
</KLPTable>
</div>
<div v-else class="empty-tip">
<el-empty description="请选择一个待检任务查看详情"></el-empty>
</div>
</div>
<!-- 添加或修改检查任务对话框 -->
<el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="任务名称" prop="taskName">
<el-input v-model="form.taskName" placeholder="请输入任务名称" />
</el-form-item>
<el-form-item label="检查项" prop="itemId" v-if="!form.taskId">
<CheckItemSelect v-model="form.itemId" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="样品编号" prop="verifyTarget.sampleId">
<el-input v-model="form.verifyTarget.sampleId" placeholder="请输入样品编号" />
</el-form-item>
<el-form-item label="物料编码" prop="verifyTarget.materialId">
<el-input v-model="form.verifyTarget.materialId" placeholder="请输入物料编码" />
</el-form-item>
<el-form-item label="物料名称" prop="verifyTarget.materialName">
<el-input v-model="form.verifyTarget.materialName" placeholder="请输入物料名称" />
</el-form-item>
<el-form-item label="供应商" prop="verifyTarget.vendor">
<el-input v-model="form.verifyTarget.vendor" placeholder="请输入供应商" />
</el-form-item>
<el-form-item label="规格型号" prop="verifyTarget.specificationModel">
<el-input v-model="form.verifyTarget.specificationModel" placeholder="请输入规格型号" />
</el-form-item>
<el-form-item label="工段" prop="workshopSection">
<el-input v-model="form.workshopSection" placeholder="请输入工段" />
</el-form-item>
<el-form-item label="工序" prop="process">
<el-input v-model="form.process" placeholder="请输入工序" />
</el-form-item>
<el-form-item label="机组" prop="unitGroup">
<el-input v-model="form.unitGroup" placeholder="请输入机组" />
</el-form-item>
<el-form-item label="检验结果" prop="inspectionResult">
<el-select v-model="form.inspectionResult" placeholder="请选择检验结果">
<el-option label="未检验" :value="0" />
<el-option label="合格" :value="1" />
<el-option label="不合格" :value="2" />
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listCheckTask, getCheckTask, delCheckTask, addCheckTask, updateCheckTask } from '@/api/mes/qc/checkTask'
import { updateCheckTaskItemStatus, updateCheckTaskItem } from '@/api/mes/qc/checkTaskItem'
import CheckItemSelect from '@/components/KLPService/CheckItemSelect/index'
export default {
name: 'CheckTask',
data() {
return {
// 按钮loading
buttonLoading: false,
// 遮罩层
loading: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 检查任务表格数据
checkTaskList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 20,
taskName: undefined,
unitGroup: undefined,
workshopSection: undefined,
process: undefined,
inspectionType: 'auxiliary'
},
// 表单参数
form: {
verifyTarget: {
sampleId: undefined,
materialId: undefined,
materialName: undefined,
vendor: undefined,
specificationModel: undefined
},
workshopSection: undefined,
process: undefined,
unitGroup: undefined,
inspectionResult: 0,
inspectionType: 'auxiliary'
},
// 表单校验
rules: {
},
detailData: {},
// 选中的任务(当前选择的行)
selectedTask: null
};
},
created() {
console.log(this.$refs.checkTaskTable, '初始化表格数据')
this.getList();
},
components: {
CheckItemSelect
},
methods: {
/** 查询检查任务列表 */
getList() {
this.loading = true;
listCheckTask(this.queryParams).then(response => {
this.checkTaskList = response.rows.map(item => ({
...item,
verifyTarget: JSON.parse(item.verifyTarget)
}));
this.total = response.total;
this.loading = false;
});
},
handleBlur(row) {
updateCheckTaskItem({...row, itemId: row.checkTaskItemId}).then(response => {
this.$message({
message: '更新成功',
type: 'success'
})
})
},
handleAccept(row) {
updateCheckTask({ taskId: row.taskId, inspectionResult: 1 }).then(response => {
this.$message({
message: '更新成功',
type: 'success'
})
this.getList()
})
},
handleReject(row) {
updateCheckTask({ taskId: row.taskId, inspectionResult: 2 }).then(response => {
this.$message({
message: '更新成功',
type: 'success'
})
this.getList()
})
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
taskId: undefined,
taskName: undefined,
itemId: [],
createBy: undefined,
createTime: undefined,
updateBy: undefined,
updateTime: undefined,
delFlag: undefined,
remark: undefined,
verifyTarget: {
sampleId: undefined,
materialId: undefined,
materialName: undefined,
vendor: undefined,
specificationModel: undefined
},
workshopSection: undefined,
process: undefined,
unitGroup: undefined,
inspectionResult: 0,
inspectionType: 'auxiliary',
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 点击行选中任务 */
handleRowClick(row) {
// 否则选中当前行
this.selectedTask = row
this.loadTaskDetail(row.taskId)
},
// 加载任务详情
loadTaskDetail(taskId) {
this.detailLoading = true
console.log(taskId, '加载任务详情')
getCheckTask(taskId)
.then(response => {
this.detailData = response.data
this.detailLoading = false
})
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加检查任务";
},
/** 修改按钮操作 */
handleUpdate() {
this.loading = true;
this.reset();
getCheckTask(this.selectedTask.taskId).then(response => {
this.loading = false;
this.form = {
...response.data,
verifyTarget: JSON.parse(response.data.verifyTarget)
};
this.open = true;
this.title = "修改检查任务";
});
},
/** 详情按钮操作 */
handleDetail(row) {
this.loading = true
getCheckTask(row.taskId).then(response => {
this.detailData = response.data
}).finally(() => {
this.loading = false
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
// 对象转json
const payload = {
...this.form,
verifyTarget: JSON.stringify(this.form.verifyTarget)
}
if (this.form.taskId != null) {
updateCheckTask(payload).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addCheckTask(payload).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const taskId = row ? row.taskId : this.selectedTask.taskId;
this.$modal.confirm('是否确认删除检查任务编号为"' + taskId + '"的数据项?').then(() => {
this.loading = true;
return delCheckTask(taskId);
}).then(() => {
this.loading = false;
this.getList();
// 重置选中状态和详情数据
this.selectedTask = null;
this.detailData = {};
this.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
/** 导出按钮操作 */
handleExport() {
this.download('qc/checkTask/export', {
...this.queryParams
}, `checkTask_${new Date().getTime()}.xlsx`)
},
/** 修改检查项状态 */
changeItemStatus(checkTaskId, checkItemId, status) {
this.$modal.confirm('确定要将该检查项状态修改为' + (status === 1 ? '通过' : '不通过') + '吗?').then(() => {
// 调用新接口
return updateCheckTaskItemStatus({ checkTaskId, checkItemId, status })
}).then(() => {
this.$modal.msgSuccess('状态修改成功')
// 重新拉取详情
getCheckTask(this.detailData.taskId).then(response => {
this.detailData = response.data
})
})
},
},
// 添加样式
computed: {
styles() {
return {
mb10: { marginBottom: '10px' },
detailSection: {
marginTop: '20px',
border: '1px solid #e6e6e6',
borderRadius: '4px',
padding: '10px'
},
tableTitle: {
fontSize: '16px',
fontWeight: 'bold',
marginBottom: '10px',
color: '#333'
},
emptyTip: {
textAlign: 'center',
padding: '40px 0',
backgroundColor: '#fafafa',
borderRadius: '4px'
}
}
}
},
};
</script>

View File

@@ -1,443 +0,0 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="60px">
<el-form-item label="任务名称" prop="taskName">
<el-input v-model="queryParams.taskName" placeholder="请输入任务名称" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="机组" prop="unitGroup">
<el-input v-model="queryParams.unitGroup" placeholder="请输入机组" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="工段" prop="workshopSection">
<el-input v-model="queryParams.workshopSection" placeholder="请输入工段" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="工序" prop="process">
<el-input v-model="queryParams.process" placeholder="请输入工序" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="!selectedTask"
@click="handleUpdate">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 上方任务列表表格 -->
<div class="mb10">
<KLPTable ref="checkTaskTable" height="300px" highlight-current-row v-loading="loading" :data="checkTaskList"
@row-click="handleRowClick">
<el-table-column label="任务名称" align="center" prop="taskName" />
<el-table-column label="样品编号" align="center" prop="verifyTarget.sampleId" />
<el-table-column label="工段" align="center" prop="workshopSection" />
<el-table-column label="工序" align="center" prop="process" />
<el-table-column label="机组" align="center" prop="unitGroup" />
<el-table-column label="检验结果" align="center">
<template slot-scope="scope">
<span>
<span v-if="scope.row.inspectionResult == 0" style="color: grey;">未检验</span>
<span v-else-if="scope.row.inspectionResult == 1" style="color: #67C23A;">合格</span>
<span v-else-if="scope.row.inspectionResult == 2" style="color: #FF4949;">不合格</span>
<span v-else style="color: grey;">未知</span>
</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleAccept(scope.row)">合格</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleReject(scope.row)">不合格</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</KLPTable>
</div>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 下方检测详情表格 -->
<div class="detail-section">
<div class="table-title">检测详情</div>
<div v-if="selectedTask && detailData.itemList && detailData.itemList.length > 0">
<KLPTable v-loading="detailLoading" :data="detailData.itemList" style="margin-top: 10px;">
<el-table-column label="检查项" align="center" prop="itemName">
<template slot-scope="scope">
<el-tag type="info">{{ scope.row.itemName }}</el-tag>
</template>
</el-table-column>
<el-table-column label="定性定量" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.qualitativeQuantitative !== undefined"
:type="scope.row.qualitativeQuantitative === 0 ? 'primary' : 'warning'">
{{ scope.row.qualitativeQuantitative === 0 ? '定性' : '定量' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="标准目标" align="center" prop="standardTarget"></el-table-column>
<el-table-column label="目标上限" align="center" prop="targetUpper"></el-table-column>
<el-table-column label="目标下限" align="center" prop="targetLower"></el-table-column>
<el-table-column label="实测值" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.actualMeasure" placeholder="请输入实测值" clearable
@blur="handleBlur(scope.row)" />
</template>
</el-table-column>
<el-table-column label="单位" align="center" prop="unit"></el-table-column>
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<span>
<span v-if="scope.row.status == 0" style="color: gray;">未检测</span>
<span v-else-if="scope.row.status == 1" style="color: #67C23A;">通过</span>
<span v-else-if="scope.row.status == 2" style="color: #FF4949;">不通过</span>
<span v-else style="color: gray;">未知</span>
</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button v-if="scope.row.status == 0" size="mini" type="text" style="color: #67C23A;"
@click="changeItemStatus(detailData.taskId, scope.row.itemId, 1)">通过</el-button>
<el-button v-if="scope.row.status == 0" size="mini" type="text" style="margin-left: 8px; color: #FF4949;"
@click="changeItemStatus(detailData.taskId, scope.row.itemId, 2)">不通过</el-button>
</template>
</el-table-column>
</KLPTable>
</div>
<div v-else class="empty-tip">
<el-empty description="请选择一个待检任务查看详情"></el-empty>
</div>
</div>
<!-- 添加或修改检查任务对话框 -->
<el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="任务名称" prop="taskName">
<el-input v-model="form.taskName" placeholder="请输入任务名称" />
</el-form-item>
<el-form-item label="检查项" prop="itemId" v-if="!form.taskId">
<CheckItemSelect v-model="form.itemId" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="样品编号">
<el-input v-model="form.verifyTarget.sampleId" placeholder="请输入样品编号" />
</el-form-item>
<el-form-item label="工段" prop="workshopSection">
<el-input v-model="form.workshopSection" placeholder="请输入工段" />
</el-form-item>
<el-form-item label="工序" prop="process">
<el-input v-model="form.process" placeholder="请输入工序" />
</el-form-item>
<el-form-item label="机组" prop="unitGroup">
<el-input v-model="form.unitGroup" placeholder="请输入机组" />
</el-form-item>
<el-form-item label="检验结果" prop="inspectionResult">
<el-select v-model="form.inspectionResult" placeholder="请选择检验结果">
<el-option label="未检验" :value="0" />
<el-option label="合格" :value="1" />
<el-option label="不合格" :value="2" />
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listCheckTask, getCheckTask, delCheckTask, addCheckTask, updateCheckTask } from '@/api/mes/qc/checkTask'
import { updateCheckTaskItemStatus, updateCheckTaskItem } from '@/api/mes/qc/checkTaskItem'
import CheckItemSelect from '@/components/KLPService/CheckItemSelect/index'
export default {
name: 'CheckTask',
data() {
return {
// 按钮loading
buttonLoading: false,
// 遮罩层
loading: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 检查任务表格数据
checkTaskList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 20,
taskName: undefined,
unitGroup: undefined,
workshopSection: undefined,
process: undefined,
inspectionType: 'lab'
},
// 表单参数
form: {
verifyTarget: {
sampleId: undefined
},
workshopSection: undefined,
process: undefined,
unitGroup: undefined,
inspectionResult: 0,
inspectionType: 'lab'
},
// 表单校验
rules: {
},
detailData: {},
// 选中的任务(当前选择的行)
selectedTask: null
};
},
created() {
console.log(this.$refs.checkTaskTable, '初始化表格数据')
this.getList();
},
components: {
CheckItemSelect
},
methods: {
/** 查询检查任务列表 */
getList() {
this.loading = true;
listCheckTask(this.queryParams).then(response => {
this.checkTaskList = response.rows.map(item => ({
...item,
verifyTarget: JSON.parse(item.verifyTarget)
}));
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
handleBlur(row) {
updateCheckTaskItem({...row, itemId: row.checkTaskItemId}).then(response => {
this.$message({
message: '更新成功',
type: 'success'
})
})
},
handleAccept(row) {
updateCheckTask({ taskId: row.taskId, inspectionResult: 1 }).then(response => {
this.$message({
message: '更新成功',
type: 'success'
})
this.getList()
})
},
handleReject(row) {
updateCheckTask({ taskId: row.taskId, inspectionResult: 2 }).then(response => {
this.$message({
message: '更新成功',
type: 'success'
})
this.getList()
})
},
// 表单重置
reset() {
this.form = {
taskId: undefined,
taskName: undefined,
itemId: [],
createBy: undefined,
createTime: undefined,
updateBy: undefined,
updateTime: undefined,
delFlag: undefined,
remark: undefined,
verifyTarget: {
sampleId: undefined
},
workshopSection: undefined,
process: undefined,
unitGroup: undefined,
inspectionResult: 0,
inspectionType: 'lab',
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 点击行选中任务 */
handleRowClick(row) {
// 否则选中当前行
this.selectedTask = row
this.loadTaskDetail(row.taskId)
},
// 加载任务详情
loadTaskDetail(taskId) {
this.detailLoading = true
console.log(taskId, '加载任务详情')
getCheckTask(taskId)
.then(response => {
this.detailData = response.data
this.detailLoading = false
})
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加检查任务";
},
/** 修改按钮操作 */
handleUpdate() {
this.loading = true;
this.reset();
getCheckTask(this.selectedTask.taskId).then(response => {
this.loading = false;
this.form = {
...response.data,
verifyTarget: JSON.parse(response.data.verifyTarget)
};
this.open = true;
this.title = "修改检查任务";
});
},
/** 详情按钮操作 */
handleDetail(row) {
this.loading = true
getCheckTask(row.taskId).then(response => {
this.detailData = response.data
}).finally(() => {
this.loading = false
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
// 对象转json
const payload = {
...this.form,
verifyTarget: JSON.stringify(this.form.verifyTarget)
}
if (this.form.taskId != null) {
updateCheckTask(payload).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addCheckTask(payload).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const taskId = row ? row.taskId : this.selectedTask.taskId;
this.$modal.confirm('是否确认删除检查任务编号为"' + taskId + '"的数据项?').then(() => {
this.loading = true;
return delCheckTask(taskId);
}).then(() => {
this.loading = false;
this.getList();
// 重置选中状态和详情数据
this.selectedTask = null;
this.detailData = {};
this.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
/** 导出按钮操作 */
handleExport() {
this.download('qc/checkTask/export', {
...this.queryParams
}, `checkTask_${new Date().getTime()}.xlsx`)
},
/** 修改检查项状态 */
changeItemStatus(checkTaskId, checkItemId, status) {
this.$modal.confirm('确定要将该检查项状态修改为' + (status === 1 ? '通过' : '不通过') + '吗?').then(() => {
// 调用新接口
return updateCheckTaskItemStatus({ checkTaskId, checkItemId, status })
}).then(() => {
this.$modal.msgSuccess('状态修改成功')
// 重新拉取详情
getCheckTask(this.detailData.taskId).then(response => {
this.detailData = response.data
})
})
},
},
// 添加样式
computed: {
styles() {
return {
mb10: { marginBottom: '10px' },
detailSection: {
marginTop: '20px',
border: '1px solid #e6e6e6',
borderRadius: '4px',
padding: '10px'
},
tableTitle: {
fontSize: '16px',
fontWeight: 'bold',
marginBottom: '10px',
color: '#333'
},
emptyTip: {
textAlign: 'center',
padding: '40px 0',
backgroundColor: '#fafafa',
borderRadius: '4px'
}
}
}
},
};
</script>

View File

@@ -1,493 +0,0 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="60px">
<el-form-item label="任务名称" prop="taskName">
<el-input v-model="queryParams.taskName" placeholder="请输入任务名称" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="机组" prop="unitGroup">
<el-input v-model="queryParams.unitGroup" placeholder="请输入机组" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="工段" prop="workshopSection">
<el-input v-model="queryParams.workshopSection" placeholder="请输入工段" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="工序" prop="process">
<el-input v-model="queryParams.process" placeholder="请输入工序" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="!selectedTask"
@click="handleUpdate">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 上方任务列表表格 -->
<div class="mb10">
<KLPTable ref="checkTaskTable" height="300px" highlight-current-row v-loading="loading" :data="checkTaskList"
@row-click="handleRowClick">
<el-table-column label="任务名称" align="center" prop="taskName" />
<el-table-column label="钢卷号" align="center" prop="currentCoilNo" />
<el-table-column label="工段" align="center" prop="workshopSection" />
<el-table-column label="工序" align="center" prop="process" />
<el-table-column label="机组" align="center" prop="unitGroup" />
<!-- <el-table-column label="钢卷号" align="center" prop="verifyTarget.coilId" /> -->
<el-table-column label="原料卷号" align="center" prop="entryCoilNo" />
<el-table-column label="厂家" align="center" prop="verifyTarget.vendor" />
<el-table-column label="宽度" align="center" prop="verifyTarget.width" />
<el-table-column label="厚度" align="center" prop="verifyTarget.thickness" />
<el-table-column label="重量" align="center" prop="weight" />
<el-table-column label="检验结果" align="center">
<template slot-scope="scope">
<span>
<span v-if="scope.row.inspectionResult == 0" style="color: grey;">未检验</span>
<span v-else-if="scope.row.inspectionResult == 1" style="color: #67C23A;">合格</span>
<span v-else-if="scope.row.inspectionResult == 2" style="color: #FF4949;">不合格</span>
<span v-else style="color: grey;">未知</span>
</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleAccept(scope.row)">合格</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleReject(scope.row)">不合格</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</KLPTable>
</div>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 下方检测详情表格 -->
<div class="detail-section">
<div class="table-title">检测详情</div>
<div v-if="selectedTask && detailData.itemList && detailData.itemList.length > 0">
<KLPTable v-loading="detailLoading" :data="detailData.itemList" style="margin-top: 10px;">
<el-table-column label="检查项" align="center" prop="itemName">
<template slot-scope="scope">
<el-tag type="info">{{ scope.row.itemName }}</el-tag>
</template>
</el-table-column>
<el-table-column label="定性定量" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.qualitativeQuantitative !== undefined"
:type="scope.row.qualitativeQuantitative === 0 ? 'primary' : 'warning'">
{{ scope.row.qualitativeQuantitative === 0 ? '定性' : '定量' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="标准目标" align="center" prop="standardTarget"></el-table-column>
<el-table-column label="目标上限" align="center" prop="targetUpper"></el-table-column>
<el-table-column label="目标下限" align="center" prop="targetLower"></el-table-column>
<el-table-column label="实测值" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.actualMeasure" placeholder="请输入实测值" clearable
@blur="handleBlur(scope.row)" />
</template>
</el-table-column>
<el-table-column label="单位" align="center" prop="unit"></el-table-column>
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<span>
<span v-if="scope.row.status == 0" style="color: gray;">未检测</span>
<span v-else-if="scope.row.status == 1" style="color: #67C23A;">通过</span>
<span v-else-if="scope.row.status == 2" style="color: #FF4949;">不通过</span>
<span v-else style="color: gray;">未知</span>
</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button v-if="scope.row.status == 0" size="mini" type="text" style="color: #67C23A;"
@click="changeItemStatus(detailData.taskId, scope.row.itemId, 1)">通过</el-button>
<el-button v-if="scope.row.status == 0" size="mini" type="text" style="margin-left: 8px; color: #FF4949;"
@click="changeItemStatus(detailData.taskId, scope.row.itemId, 2)">不通过</el-button>
</template>
</el-table-column>
</KLPTable>
</div>
<div v-else class="empty-tip">
<el-empty description="请选择一个待检任务查看详情"></el-empty>
</div>
</div>
<!-- 添加或修改检查任务对话框 -->
<el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="任务名称" prop="taskName">
<el-input v-model="form.taskName" placeholder="请输入任务名称" />
</el-form-item>
<el-form-item label="检查项" prop="itemId" v-if="!form.taskId">
<CheckItemSelect v-model="form.itemId" />
</el-form-item>
<el-form-item label="钢卷号">
<coil-selector v-model="form.coilIds" @select="handleCoilChange" :filters="{ selectType: 'raw_material', itemType: 'raw_material' }"></coil-selector>
<!-- <el-input v-model="form.verifyTarget.coilId" placeholder="请输入钢卷号" /> -->
</el-form-item>
<!-- <el-form-item label="原料卷号">
<el-input v-model="form.verifyTarget.rawCoilId" placeholder="请输入原料卷号" />
</el-form-item>
<el-form-item label="厂家">
<el-input v-model="form.verifyTarget.factory" placeholder="请输入厂家" />
</el-form-item>
<el-form-item label="厚度">
<el-input v-model="form.verifyTarget.thickness" placeholder="请输入厚度" />
</el-form-item>
<el-form-item label="宽度">
<el-input v-model="form.verifyTarget.width" placeholder="请输入宽度" />
</el-form-item>
<el-form-item label="重量">
<el-input v-model="form.verifyTarget.weight" placeholder="请输入重量" />
</el-form-item> -->
<el-form-item label="工段" prop="workshopSection">
<el-input v-model="form.workshopSection" placeholder="请输入工段" />
</el-form-item>
<el-form-item label="工序" prop="process">
<el-input v-model="form.process" placeholder="请输入工序" />
</el-form-item>
<el-form-item label="机组" prop="unitGroup">
<el-input v-model="form.unitGroup" placeholder="请输入机组" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<!-- <el-form-item label="检验结果" prop="inspectionResult">
<el-select v-model="form.inspectionResult" placeholder="请选择检验结果">
<el-option label="未检验" :value="0" />
<el-option label="合格" :value="1" />
<el-option label="不合格" :value="2" />
</el-select>
</el-form-item> -->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listCheckTask, getCheckTask, delCheckTask, addCheckTask, updateCheckTask } from '@/api/mes/qc/checkTask'
import { updateCheckTaskItemStatus, updateCheckTaskItem } from '@/api/mes/qc/checkTaskItem'
import CheckItemSelect from '@/components/KLPService/CheckItemSelect/index'
import CoilSelector from '@/components/CoilSelector/index.vue'
export default {
name: 'CheckTask',
data() {
return {
// 按钮loading
buttonLoading: false,
// 遮罩层
loading: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 检查任务表格数据
checkTaskList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 20,
taskName: undefined,
unitGroup: undefined,
workshopSection: undefined,
process: undefined,
inspectionType: 'raw'
},
// 表单参数
form: {
verifyTarget: {
coilId: undefined,
rawCoilId: undefined,
factory: undefined,
thickness: undefined,
width: undefined,
weight: undefined
},
workshopSection: undefined,
process: undefined,
unitGroup: undefined,
inspectionResult: 0,
inspectionType: 'raw'
},
// 表单校验
rules: {
},
detailData: {},
// 选中的任务(当前选择的行)
selectedTask: null
};
},
created() {
console.log(this.$refs.checkTaskTable, '初始化表格数据')
this.getList();
},
components: {
CheckItemSelect,
CoilSelector
},
methods: {
/** 查询检查任务列表 */
getList() {
this.loading = true;
listCheckTask(this.queryParams).then(response => {
this.checkTaskList = response.rows.map(item => ({
...item,
verifyTarget: JSON.parse(item.verifyTarget),
entryCoilNo: item.coilList?.[0]?.entryCoilNo || '',
currentCoilNo: item.coilList?.[0]?.currentCoilNo || '',
weight: item.coilList?.[0]?.netWeight || 0,
}));
this.total = response.total;
this.loading = false;
});
},
handleCoilChange(coil) {
const [thickness, width] = coil.specification?.split('*') || []
console.log(thickness, width, coil.netWeight)
this.form.verifyTarget = {
coilId: coil.coilId,
rawCoilId: coil.rawCoilId,
factory: coil.manufacturer,
thickness: thickness,
width: width,
weight: coil.netWeight,
}
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
handleBlur(row) {
updateCheckTaskItem({...row, itemId: row.checkTaskItemId}).then(response => {
this.$message({
message: '更新成功',
type: 'success'
})
})
},
handleAccept(row) {
updateCheckTask({ taskId: row.taskId, inspectionResult: 1 }).then(response => {
this.$message({
message: '更新成功',
type: 'success'
})
this.getList()
})
},
handleReject(row) {
updateCheckTask({ taskId: row.taskId, inspectionResult: 2 }).then(response => {
this.$message({
message: '更新成功',
type: 'success'
})
this.getList()
})
},
// 表单重置
reset() {
this.form = {
taskId: undefined,
taskName: undefined,
itemId: [],
createBy: undefined,
createTime: undefined,
updateBy: undefined,
updateTime: undefined,
delFlag: undefined,
remark: undefined,
verifyTarget: {
coilId: undefined,
rawCoilId: undefined,
factory: undefined,
thickness: undefined,
width: undefined,
weight: undefined
},
workshopSection: undefined,
process: undefined,
unitGroup: undefined,
inspectionResult: 0,
inspectionType: 'raw',
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 点击行选中任务 */
handleRowClick(row) {
// 否则选中当前行
this.selectedTask = row
this.loadTaskDetail(row.taskId)
},
// 加载任务详情
loadTaskDetail(taskId) {
this.detailLoading = true
console.log(taskId, '加载任务详情')
getCheckTask(taskId)
.then(response => {
this.detailData = response.data
this.detailLoading = false
})
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加检查任务";
},
/** 修改按钮操作 */
handleUpdate() {
this.loading = true;
this.reset();
getCheckTask(this.selectedTask.taskId).then(response => {
this.loading = false;
this.form = {
...response.data,
verifyTarget: JSON.parse(response.data.verifyTarget)
};
this.open = true;
this.title = "修改检查任务";
});
},
/** 详情按钮操作 */
handleDetail(row) {
this.loading = true
getCheckTask(row.taskId).then(response => {
this.detailData = response.data
}).finally(() => {
this.loading = false
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
// 对象转json
const payload = {
...this.form,
itemId: this.form.itemId.split(','),
verifyTarget: JSON.stringify(this.form.verifyTarget)
}
if (this.form.taskId != null) {
updateCheckTask(payload).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addCheckTask(payload).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const taskId = row ? row.taskId : this.selectedTask.taskId;
this.$modal.confirm('是否确认删除检查任务编号为"' + taskId + '"的数据项?').then(() => {
this.loading = true;
return delCheckTask(taskId);
}).then(() => {
this.loading = false;
this.getList();
// 重置选中状态和详情数据
this.selectedTask = null;
this.detailData = {};
this.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
/** 导出按钮操作 */
handleExport() {
this.download('qc/checkTask/export', {
...this.queryParams
}, `checkTask_${new Date().getTime()}.xlsx`)
},
/** 修改检查项状态 */
changeItemStatus(checkTaskId, checkItemId, status) {
this.$modal.confirm('确定要将该检查项状态修改为' + (status === 1 ? '通过' : '不通过') + '吗?').then(() => {
// 调用新接口
return updateCheckTaskItemStatus({ checkTaskId, checkItemId, status })
}).then(() => {
this.$modal.msgSuccess('状态修改成功')
// 重新拉取详情
getCheckTask(this.detailData.taskId).then(response => {
this.detailData = response.data
})
})
},
},
// 添加样式
computed: {
styles() {
return {
mb10: { marginBottom: '10px' },
detailSection: {
marginTop: '20px',
border: '1px solid #e6e6e6',
borderRadius: '4px',
padding: '10px'
},
tableTitle: {
fontSize: '16px',
fontWeight: 'bold',
marginBottom: '10px',
color: '#333'
},
emptyTip: {
textAlign: 'center',
padding: '40px 0',
backgroundColor: '#fafafa',
borderRadius: '4px'
}
}
}
},
};
</script>

View File

@@ -1,451 +0,0 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="60px">
<el-form-item label="任务名称" prop="taskName">
<el-input v-model="queryParams.taskName" placeholder="请输入任务名称" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="机组" prop="unitGroup">
<el-input v-model="queryParams.unitGroup" placeholder="请输入机组" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="工段" prop="workshopSection">
<el-input v-model="queryParams.workshopSection" placeholder="请输入工段" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="工序" prop="process">
<el-input v-model="queryParams.process" placeholder="请输入工序" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="!selectedTask"
@click="handleUpdate">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 上方任务列表表格 -->
<div class="mb10">
<KLPTable ref="checkTaskTable" height="300px" highlight-current-row v-loading="loading" :data="checkTaskList"
@row-click="handleRowClick">
<el-table-column label="任务名称" align="center" prop="taskName" />
<el-table-column label="钢卷号" align="center" prop="coilList[0].currentCoilNo" />
<el-table-column label="工段" align="center" prop="workshopSection" />
<el-table-column label="工序" align="center" prop="process" />
<el-table-column label="机组" align="center" prop="unitGroup" />
<el-table-column label="检验结果" align="center">
<template slot-scope="scope">
<span>
<span v-if="scope.row.inspectionResult == 0" style="color: grey;">未检验</span>
<span v-else-if="scope.row.inspectionResult == 1" style="color: #67C23A;">合格</span>
<span v-else-if="scope.row.inspectionResult == 2" style="color: #FF4949;">不合格</span>
<span v-else style="color: grey;">未知</span>
</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleAccept(scope.row)">合格</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleReject(scope.row)">不合格</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</KLPTable>
</div>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 下方检测详情表格 -->
<div class="detail-section">
<div class="table-title">检测详情</div>
<div v-if="selectedTask && detailData.itemList && detailData.itemList.length > 0">
<KLPTable v-loading="detailLoading" :data="detailData.itemList" style="margin-top: 10px;">
<el-table-column label="检查项" align="center" prop="itemName">
<template slot-scope="scope">
<el-tag type="info">{{ scope.row.itemName }}</el-tag>
</template>
</el-table-column>
<el-table-column label="定性定量" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.qualitativeQuantitative !== undefined"
:type="scope.row.qualitativeQuantitative === 0 ? 'primary' : 'warning'">
{{ scope.row.qualitativeQuantitative === 0 ? '定性' : '定量' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="标准目标" align="center" prop="standardTarget"></el-table-column>
<el-table-column label="目标上限" align="center" prop="targetUpper"></el-table-column>
<el-table-column label="目标下限" align="center" prop="targetLower"></el-table-column>
<el-table-column label="实测值" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.actualMeasure" placeholder="请输入实测值" clearable
@blur="handleBlur(scope.row)" />
</template>
</el-table-column>
<el-table-column label="单位" align="center" prop="unit"></el-table-column>
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<span>
<span v-if="scope.row.status == 0" style="color: gray;">未检测</span>
<span v-else-if="scope.row.status == 1" style="color: #67C23A;">通过</span>
<span v-else-if="scope.row.status == 2" style="color: #FF4949;">不通过</span>
<span v-else style="color: gray;">未知</span>
</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button v-if="scope.row.status == 0" size="mini" type="text" style="color: #67C23A;"
@click="changeItemStatus(detailData.taskId, scope.row.itemId, 1)">通过</el-button>
<el-button v-if="scope.row.status == 0" size="mini" type="text" style="margin-left: 8px; color: #FF4949;"
@click="changeItemStatus(detailData.taskId, scope.row.itemId, 2)">不通过</el-button>
</template>
</el-table-column>
</KLPTable>
</div>
<div v-else class="empty-tip">
<el-empty description="请选择一个待检任务查看详情"></el-empty>
</div>
</div>
<!-- 添加或修改检查任务对话框 -->
<el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="任务名称" prop="taskName">
<el-input v-model="form.taskName" placeholder="请输入任务名称" />
</el-form-item>
<el-form-item label="钢卷号">
<!-- <el-input v-model="form.verifyTarget.coilId" placeholder="请输入钢卷号" /> -->
<coil-selector v-model="form.coilIds" @select="handleCoilChange"></coil-selector>
</el-form-item>
<el-form-item label="检查项" prop="itemId" v-if="!form.taskId">
<CheckItemSelect v-model="form.itemId" />
</el-form-item>
<el-form-item label="工段" prop="workshopSection">
<el-input v-model="form.workshopSection" placeholder="请输入工段" />
</el-form-item>
<el-form-item label="工序" prop="process">
<el-input v-model="form.process" placeholder="请输入工序" />
</el-form-item>
<el-form-item label="机组" prop="unitGroup">
<el-input v-model="form.unitGroup" placeholder="请输入机组" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<!-- <el-form-item label="检验结果" prop="inspectionResult">
<el-select v-model="form.inspectionResult" placeholder="请选择检验结果">
<el-option label="未检验" :value="0" />
<el-option label="合格" :value="1" />
<el-option label="不合格" :value="2" />
</el-select>
</el-form-item> -->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listCheckTask, getCheckTask, delCheckTask, addCheckTask, updateCheckTask } from '@/api/mes/qc/checkTask'
import { updateCheckTaskItemStatus, updateCheckTaskItem } from '@/api/mes/qc/checkTaskItem'
import CheckItemSelect from '@/components/KLPService/CheckItemSelect/index'
import CoilSelector from '@/components/CoilSelector/index.vue'
export default {
name: 'CheckTask',
data() {
return {
// 按钮loading
buttonLoading: false,
// 遮罩层
loading: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 检查任务表格数据
checkTaskList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 20,
taskName: undefined,
unitGroup: undefined,
workshopSection: undefined,
process: undefined,
inspectionType: 'section'
},
// 表单参数
form: {
verifyTarget: {
coilId: undefined
},
workshopSection: undefined,
process: undefined,
unitGroup: undefined,
inspectionResult: 0,
inspectionType: 'section'
},
// 表单校验
rules: {
},
detailData: {},
// 选中的任务(当前选择的行)
selectedTask: null
};
},
created() {
console.log(this.$refs.checkTaskTable, '初始化表格数据')
this.getList();
},
components: {
CheckItemSelect,
CoilSelector
},
methods: {
/** 查询检查任务列表 */
getList() {
this.loading = true;
listCheckTask(this.queryParams).then(response => {
this.checkTaskList = response.rows.map(item => ({
...item,
verifyTarget: JSON.parse(item.verifyTarget)
}));
this.total = response.total;
this.loading = false;
});
},
handleCoilChange(coil) {
this.form.verifyTarget.coilId = coil.coilId
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
handleBlur(row) {
updateCheckTaskItem({ ...row, itemId: row.checkTaskItemId }).then(response => {
this.$message({
message: '更新成功',
type: 'success'
})
})
},
handleAccept(row) {
updateCheckTask({ taskId: row.taskId, inspectionResult: 1 }).then(response => {
this.$message({
message: '更新成功',
type: 'success'
})
this.getList()
})
},
handleReject(row) {
updateCheckTask({ taskId: row.taskId, inspectionResult: 2 }).then(response => {
this.$message({
message: '更新成功',
type: 'success'
})
this.getList()
})
},
// 表单重置
reset() {
this.form = {
taskId: undefined,
taskName: undefined,
itemId: [],
createBy: undefined,
createTime: undefined,
updateBy: undefined,
updateTime: undefined,
delFlag: undefined,
remark: undefined,
verifyTarget: {
coilId: undefined
},
workshopSection: undefined,
process: undefined,
unitGroup: undefined,
inspectionResult: 0,
inspectionType: 'section',
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 点击行选中任务 */
handleRowClick(row) {
// 否则选中当前行
this.selectedTask = row
this.loadTaskDetail(row.taskId)
},
// 加载任务详情
loadTaskDetail(taskId) {
this.detailLoading = true
console.log(taskId, '加载任务详情')
getCheckTask(taskId)
.then(response => {
this.detailData = response.data
this.detailLoading = false
})
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加检查任务";
},
/** 修改按钮操作 */
handleUpdate() {
this.loading = true;
this.reset();
getCheckTask(this.selectedTask.taskId).then(response => {
this.loading = false;
this.form = {
...response.data,
verifyTarget: JSON.parse(response.data.verifyTarget)
};
this.open = true;
this.title = "修改检查任务";
});
},
/** 详情按钮操作 */
handleDetail(row) {
this.loading = true
getCheckTask(row.taskId).then(response => {
this.detailData = response.data
}).finally(() => {
this.loading = false
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
// 对象转json
const payload = {
...this.form,
itemId: this.form.itemId.split(','),
verifyTarget: JSON.stringify(this.form.verifyTarget)
}
if (this.form.taskId != null) {
updateCheckTask(payload).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addCheckTask(payload).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const taskId = row ? row.taskId : this.selectedTask.taskId;
this.$modal.confirm('是否确认删除检查任务编号为"' + taskId + '"的数据项?').then(() => {
this.loading = true;
return delCheckTask(taskId);
}).then(() => {
this.loading = false;
this.getList();
// 重置选中状态和详情数据
this.selectedTask = null;
this.detailData = {};
this.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
/** 导出按钮操作 */
handleExport() {
this.download('qc/checkTask/export', {
...this.queryParams
}, `checkTask_${new Date().getTime()}.xlsx`)
},
/** 修改检查项状态 */
changeItemStatus(checkTaskId, checkItemId, status) {
this.$modal.confirm('确定要将该检查项状态修改为' + (status === 1 ? '通过' : '不通过') + '吗?').then(() => {
// 调用新接口
return updateCheckTaskItemStatus({ checkTaskId, checkItemId, status })
}).then(() => {
this.$modal.msgSuccess('状态修改成功')
// 重新拉取详情
getCheckTask(this.detailData.taskId).then(response => {
this.detailData = response.data
})
})
},
},
// 添加样式
computed: {
styles() {
return {
mb10: { marginBottom: '10px' },
detailSection: {
marginTop: '20px',
border: '1px solid #e6e6e6',
borderRadius: '4px',
padding: '10px'
},
tableTitle: {
fontSize: '16px',
fontWeight: 'bold',
marginBottom: '10px',
color: '#333'
},
emptyTip: {
textAlign: 'center',
padding: '40px 0',
backgroundColor: '#fafafa',
borderRadius: '4px'
}
}
}
},
};
</script>

View File

@@ -77,6 +77,70 @@
</div>
</div>
<!-- ========== 菜单分类总览8大模块 + 其他 ========== -->
<div class="perf-menu-section">
<el-row :gutter="16" class="perf-row">
<el-col :span="24">
<div class="perf-panel">
<div class="panel-hd">
各模块操作量对比
<span class="panel-hint">点击柱子可按分类筛选下方图表</span>
</div>
<div class="panel-bd"><div ref="menuGroupChartRef" class="chart-box" /></div>
</div>
</el-col>
</el-row>
<!-- 分类折叠详情 -->
<div class="perf-panel perf-collapse-panel" v-if="menuGroupData.length">
<div class="panel-hd">分类模块明细</div>
<div class="panel-bd" style="padding: 8px 12px">
<el-collapse v-model="activeMenuGroups" accordion>
<el-collapse-item
v-for="(group, idx) in menuGroupData"
:key="group.menuName"
:name="group.menuName"
>
<template slot="title">
<div class="collapse-title">
<span class="collapse-tag" :style="{ background: menuColors[idx % menuColors.length] }">{{ group.menuName }}</span>
<span class="collapse-stat">操作 {{ group.totalCount }} </span>
<span class="collapse-stat">成功率 {{ group.successRate }}%</span>
<span class="collapse-stat"> {{ group.personCount }} </span>
</div>
</template>
<el-table :data="group.modules" border size="small" max-height="360">
<el-table-column prop="title" label="模块名称" min-width="140" show-overflow-tooltip />
<el-table-column prop="totalCount" label="操作次数" width="90" align="center" sortable />
<el-table-column prop="addCount" label="新增" width="60" align="center" />
<el-table-column prop="editCount" label="修改" width="60" align="center" />
<el-table-column prop="deleteCount" label="删除" width="60" align="center" />
<el-table-column prop="otherCount" label="其它" width="60" align="center" />
<el-table-column prop="successRate" label="成功率%" width="85" align="center" />
<el-table-column prop="personCount" label="使用人数" width="80" align="center" />
</el-table>
</el-collapse-item>
</el-collapse>
</div>
</div>
</div>
<!-- 当前分类筛选提示 -->
<div class="perf-filter-tag" v-if="selectedMenuGroup">
<el-tag
:color="selectedMenuGroup.color"
size="medium"
closable
@close="handleClearMenuFilter"
effect="dark"
style="color:#fff;border:none"
>
<i class="el-icon-s-data" style="margin-right:4px" />
{{ selectedMenuGroup.menuName }}
</el-tag>
<span class="filter-suffix"> 以下图表仅显示该分类数据</span>
</div>
<!-- ========== 图表区 两行每行两栏高度统一 ========== -->
<div class="perf-charts">
<!-- Row 1 -->
@@ -176,16 +240,30 @@
</template>
<script>
import { getSummary, getPersonList, getModuleRanking } from "@/api/monitor/performance";
import { getSummary, getPersonList, getModuleRanking, getMenuGroup } from "@/api/monitor/performance";
import * as echarts from "echarts";
// 默认近一个月日期范围
function defaultDateRange() {
const end = new Date();
const start = new Date();
start.setDate(start.getDate() - 30);
const fmt = d => {
const y = d.getFullYear();
const m = String(d.getMonth() + 1).padStart(2, "0");
const day = String(d.getDate()).padStart(2, "0");
return y + "-" + m + "-" + day;
};
return [fmt(start), fmt(end)];
}
export default {
name: "Performance",
data() {
return {
loading: false,
filterForm: {
dateRange: [],
dateRange: defaultDateRange(),
deptName: "",
operName: "",
title: ""
@@ -193,10 +271,19 @@ export default {
summaryData: {},
personList: [],
moduleRanking: [],
menuGroupData: [],
activeMenuGroups: [],
selectedMenuGroup: null,
personBarChart: null,
moduleOpsChart: null,
modulePersonDetailChart: null,
businessPieChart: null
businessPieChart: null,
menuGroupChart: null,
// 9种分类配色
menuColors: [
"#5470C6", "#91CC75", "#FAC858", "#EE6666", "#73C0DE",
"#FC8452", "#9A60B4", "#3BA272", "#C0C4CC"
]
};
},
mounted() {
@@ -217,20 +304,25 @@ export default {
if (this.filterForm.deptName) p.deptName = this.filterForm.deptName;
if (this.filterForm.operName) p.operName = this.filterForm.operName;
if (this.filterForm.title) p.title = this.filterForm.title;
if (this.selectedMenuGroup && this.selectedMenuGroup.menuPath) {
p.operPagePrefix = "/" + this.selectedMenuGroup.menuPath;
}
return p;
},
async handleQuery() {
this.loading = true;
try {
const params = this.buildParams();
const [sr, pr, mr] = await Promise.all([
const [sr, pr, mr, mgr] = await Promise.all([
getSummary(params),
getPersonList(params),
getModuleRanking(params)
getModuleRanking(params),
getMenuGroup(params)
]);
this.summaryData = sr.data || {};
this.personList = pr.data || [];
this.moduleRanking = mr.data || [];
this.menuGroupData = mgr.data || [];
this.$nextTick(() => this.renderCharts());
} catch (e) {
console.error("加载绩效数据失败", e);
@@ -239,21 +331,109 @@ export default {
}
},
handleReset() {
this.filterForm = { dateRange: [], deptName: "", operName: "", title: "" };
this.filterForm = { dateRange: defaultDateRange(), deptName: "", operName: "", title: "" };
this.selectedMenuGroup = null;
this.handleQuery();
},
handleClearMenuFilter() {
this.selectedMenuGroup = null;
this.handleQuery();
},
renderCharts() {
this.renderMenuGroupChart();
this.renderModuleOps();
this.renderModulePersonDetail();
this.renderPersonBar();
this.renderPie();
},
/* ---- 菜单分类对比柱状图 ---- */
renderMenuGroupChart() {
if (!this.$refs.menuGroupChartRef) return;
if (!this.menuGroupChart) this.menuGroupChart = echarts.init(this.$refs.menuGroupChartRef);
if (!this.menuGroupData.length) {
this.menuGroupChart.clear();
return;
}
const names = this.menuGroupData.map(g => g.menuName);
const totals = this.menuGroupData.map(g => g.totalCount);
const colors = this.menuColors;
this.menuGroupChart.setOption({
tooltip: {
trigger: "axis",
axisPointer: { type: "shadow" },
formatter: function (ps) {
const g = ps[0];
return "<b>" + g.name + "</b><br/>操作总量: <b>" + g.value + " 次</b>";
}
},
grid: { left: 0, right: 24, bottom: 24, top: 8, containLabel: true },
xAxis: {
type: "category",
data: names,
axisLabel: { fontSize: 12 }
},
yAxis: { type: "value" },
series: [{
type: "bar",
data: totals.map((v, i) => ({
value: v,
itemStyle: {
borderRadius: [4, 4, 0, 0],
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: colors[i % colors.length] },
{ offset: 1, color: colors[i % colors.length] + "88" }
])
}
})),
barWidth: "55%",
label: { show: true, position: "top", fontSize: 11 }
}]
}, true);
// 绑定点击事件(点击整列区域即可筛选,不限于柱子本身)
this.menuGroupChart.off("click");
const handleSelect = (idx) => {
const group = this.menuGroupData[idx];
if (!group) return;
if (this.selectedMenuGroup && this.selectedMenuGroup.menuName === group.menuName) {
this.selectedMenuGroup = null;
} else {
this.selectedMenuGroup = {
menuName: group.menuName,
menuPath: group.menuPath,
color: this.menuColors[idx % this.menuColors.length]
};
}
this.handleQuery();
};
// 点击柱子本身
this.menuGroupChart.on("click", (params) => {
if (params.componentType === "series" && params.dataIndex != null) {
handleSelect(params.dataIndex);
}
});
// 点击柱子之间的空白区域:通过像素坐标反查 dataIndex
this.menuGroupChart.getZr().off("click");
this.menuGroupChart.getZr().on("click", (e) => {
// 只处理鼠标左键
if (e.target || !this.menuGroupChart) return;
const pointInGrid = this.menuGroupChart.convertFromPixel({ seriesIndex: 0 }, [e.offsetX, e.offsetY]);
if (pointInGrid && pointInGrid[0] != null && pointInGrid[1] != null) {
const idx = Math.round(pointInGrid[0]);
if (idx >= 0 && idx < this.menuGroupData.length) {
handleSelect(idx);
}
}
});
},
/* ---- 模块操作次数排行 ---- */
renderModuleOps() {
if (!this.$refs.moduleOpsChartRef) return;
if (!this.moduleOpsChart) this.moduleOpsChart = echarts.init(this.$refs.moduleOpsChartRef);
const top = this.moduleRanking.slice(0, 10);
if (!top.length) { this.moduleOpsChart.clear(); return; }
this.moduleOpsChart.setOption({
tooltip: { trigger: "axis", axisPointer: { type: "shadow" } },
grid: { left: 0, right: 24, bottom: 24, top: 8, containLabel: true },
@@ -286,7 +466,7 @@ export default {
const tops = Object.entries(map)
.map(([t, pm]) => ({ title: t, personMap: pm, total: Object.values(pm).reduce((s, c) => s + c, 0) }))
.sort((a, b) => b.total - a.total).slice(0, 6);
if (!tops.length) return;
if (!tops.length) { this.modulePersonDetailChart.clear(); return; }
const allSet = new Set();
const others = [];
@@ -318,6 +498,7 @@ export default {
if (!this.$refs.personBarChartRef) return;
if (!this.personBarChart) this.personBarChart = echarts.init(this.$refs.personBarChartRef);
const top = this.personList.slice(0, 15);
if (!top.length) { this.personBarChart.clear(); return; }
this.personBarChart.setOption({
tooltip: { trigger: "axis", axisPointer: { type: "shadow" } },
grid: { left: 0, right: 24, bottom: 24, top: 8, containLabel: true },
@@ -343,6 +524,7 @@ export default {
let a = 0, e = 0, d = 0, o = 0;
this.personList.forEach(p => { a += p.addCount || 0; e += p.editCount || 0; d += p.deleteCount || 0; o += p.otherCount || 0; });
const data = [{ value: a, name: "新增" }, { value: e, name: "修改" }, { value: d, name: "删除" }, { value: o, name: "其它" }].filter(x => x.value > 0);
if (!data.length) { this.businessPieChart.clear(); return; }
this.businessPieChart.setOption({
tooltip: { trigger: "item", formatter: "{b}: {c} ({d}%)" },
legend: { orient: "vertical", left: 8, top: "center", textStyle: { fontSize: 12 } },
@@ -358,10 +540,10 @@ export default {
},
handleResize() {
[this.personBarChart, this.moduleOpsChart, this.modulePersonDetailChart, this.businessPieChart].forEach(c => c && c.resize());
[this.personBarChart, this.moduleOpsChart, this.modulePersonDetailChart, this.businessPieChart, this.menuGroupChart].forEach(c => c && c.resize());
},
disposeCharts() {
[this.personBarChart, this.moduleOpsChart, this.modulePersonDetailChart, this.businessPieChart].forEach(c => c && c.dispose());
[this.personBarChart, this.moduleOpsChart, this.modulePersonDetailChart, this.businessPieChart, this.menuGroupChart].forEach(c => c && c.dispose());
},
handleExport() {
this.download("monitor/operlog/export", { ...this.buildParams() }, `performance_${new Date().getTime()}.xlsx`);
@@ -444,6 +626,12 @@ export default {
background: #fafbfc;
overflow: hidden;
}
.panel-hint {
float: right;
font-size: 12px;
font-weight: 400;
color: #86909c;
}
.panel-bd {
flex: 1;
padding: 12px 8px 8px;
@@ -454,6 +642,53 @@ export default {
height: 340px;
}
// ===================== 菜单分类区域 =====================
.perf-menu-section {
margin-bottom: 14px;
}
.perf-filter-tag {
margin-bottom: 14px;
display: flex;
align-items: center;
gap: 10px;
}
.filter-suffix {
font-size: 13px;
color: #86909c;
}
.perf-collapse-panel {
margin-top: 0;
}
.collapse-title {
display: flex;
align-items: center;
gap: 16px;
width: 100%;
}
.collapse-tag {
display: inline-block;
padding: 2px 10px;
border-radius: 4px;
color: #fff;
font-size: 13px;
font-weight: 600;
min-width: 72px;
text-align: center;
}
.collapse-stat {
font-size: 13px;
color: #4e5969;
font-weight: 400;
}
.perf-collapse-panel ::v-deep .el-collapse-item__header {
padding: 0 16px;
font-weight: 500;
}
.perf-collapse-panel ::v-deep .el-collapse-item__content {
padding: 0;
}
// ===================== 表格区 =====================
.perf-table { margin-top: 14px; }
.perf-table .perf-panel .panel-bd { padding: 0; }

View File

@@ -617,12 +617,30 @@ export default {
};
// 递归展平为一维数组,缩进体现层级
const flattenTree = (nodes, level = 0, result = []) => {
const flattenTree = (nodes, level = 0, parentPath = '', result = []) => {
nodes.forEach(node => {
const prefix = '\u3000'.repeat(level); // 全角空格缩进
const ownPath = node.path || '';
// 计算完整路由地址(仅菜单类型 C 有效)
let fullPath = '';
if (node.menuType === 'C') {
if (node.isFrame === '0') {
// 外链:完整路由就是自身路径
fullPath = ownPath;
} else {
// 内部路由:父路径 + 自身路径
const parent = parentPath ? (parentPath.endsWith('/') ? parentPath : parentPath + '/') : '';
fullPath = '/' + parent + ownPath;
}
}
// 目录(M)的路径作为子节点的父路径
const currentParentPath = node.menuType === 'M' ? ownPath : parentPath;
result.push({
menuName: prefix + node.menuName,
menuType: menuTypeMap[node.menuType] || node.menuType,
path: ownPath,
fullPath: fullPath,
icon: node.icon || '',
orderNum: node.orderNum,
perms: node.perms || '',
@@ -631,7 +649,7 @@ export default {
createTime: node.createTime || ''
});
if (node.children && node.children.length > 0) {
flattenTree(node.children, level + 1, result);
flattenTree(node.children, level + 1, currentParentPath, result);
}
});
return result;
@@ -647,19 +665,21 @@ export default {
// 构建 Excel 数据
const wsData = [
['菜单名称', '菜单类型', '图标', '排序', '权限标识', '组件路径', '状态', '创建时间'],
['菜单名称', '菜单类型', '路由地址', '完整路由地址', '图标', '排序', '权限标识', '组件路径', '状态', '创建时间'],
...flatData.map(item => [
item.menuName, item.menuType, item.icon,
item.orderNum, item.perms, item.component,
item.status, item.createTime
item.menuName, item.menuType, item.path,
item.fullPath, item.icon, item.orderNum,
item.perms, item.component, item.status,
item.createTime
])
];
const ws = XLSX.utils.aoa_to_sheet(wsData);
ws['!cols'] = [
{ wch: 30 }, { wch: 10 }, { wch: 12 },
{ wch: 8 }, { wch: 25 }, { wch: 30 },
{ wch: 8 }, { wch: 20 }
{ wch: 30 }, { wch: 10 }, { wch: 22 },
{ wch: 30 }, { wch: 12 }, { wch: 8 },
{ wch: 25 }, { wch: 30 }, { wch: 8 },
{ wch: 20 }
];
const wb = XLSX.utils.book_new();

View File

@@ -135,6 +135,14 @@
<el-button type="info" plain icon="el-icon-download" size="mini" @click="handleExportAllProps">导出全部</el-button>
</el-col>
<el-col :span="1.5" v-hasPermi="['wms.export.abnormalCoil']">
<el-button icon="el-icon-download" size="mini" @click="handleAbnormalExportSingle">单行异常导出</el-button>
</el-col>
<el-col :span="1.5" v-hasPermi="['wms.export.abnormalCoil']">
<el-button icon="el-icon-download" size="mini" @click="handleAbnormalExportMulti">多行异常导出</el-button>
</el-col>
<el-col :span="1.5" v-if="showOrderBy">
<el-checkbox v-model="queryParams.orderBy" v-loading="loading" @change="getList"
label="orderBy">按实际库区排序</el-checkbox>
@@ -2336,6 +2344,24 @@ export default {
}, 'coil.xlsx')
}
},
/** 单行异常导出 — 每个钢卷一行,附带异常信息 */
handleAbnormalExportSingle() {
const { orderBy, ...query } = this.queryParams;
query.selectType = query.itemType;
this.download('wms/materialCoil/exportAbnormal', {
...query,
abnormalExportCount: 1,
}, `abnormalCoil_${new Date().getTime()}.xlsx`)
},
/** 多行异常导出 — 每个异常记录一行,附带异常信息 */
handleAbnormalExportMulti() {
const { orderBy, ...query } = this.queryParams;
query.selectType = query.itemType;
this.download('wms/materialCoil/exportAbnormal', {
...query,
abnormalExportCount: 0,
}, `abnormalCoil_${new Date().getTime()}.xlsx`)
},
async handleNewExportProps(row) {
this.loading = true
let coilIds = ''

View File

@@ -23,6 +23,11 @@
<el-form-item>
<el-button type="primary" @click="getList">查询</el-button>
<el-button @click="resetQuery">重置</el-button>
<el-button size="small" plain @click="quickQualityAll">全选模式</el-button>
<el-button size="small" plain @click="quickQualityAB">AB模式</el-button>
<el-button size="small" plain @click="quickQualityCD">CD模式</el-button>
<el-button size="small" plain @click="quickQualityO">O模式</el-button>
<el-button size="small" plain @click="quickQualityCDO">CDO模式</el-button>
</el-form-item>
</el-form>
</el-row>
@@ -627,6 +632,28 @@ export default {
this.queryParams = { warehouseIds: Object.keys(this.warehouseMap), qualityStatusCsv: 'A+,A,A-,B+,B,B-' };
this.getList();
},
// 快捷品质筛选
quickQualityAll() {
this.queryParams.qualityStatusCsv = '';
this.getList();
},
quickQualityAB() {
this.queryParams.qualityStatusCsv = 'A+,A,A-,B+,B,B-';
this.getList();
},
quickQualityCD() {
this.queryParams.qualityStatusCsv = 'C+,C,C-,D+,D,D-';
this.getList();
},
quickQualityO() {
this.queryParams.qualityStatusCsv = 'O';
this.getList();
},
quickQualityCDO() {
this.queryParams.qualityStatusCsv = 'C+,C,C-,D+,D,D-,O';
this.getList();
},
},
};
</script>

View File

@@ -296,9 +296,17 @@
<el-table-column label="排产单号" prop="scheduleNo" min-width="140" show-overflow-tooltip />
<el-table-column label="生产日期" prop="prodDate" width="110" align="center" show-overflow-tooltip />
<el-table-column label="工序步骤" prop="stepName" width="120" align="center" show-overflow-tooltip />
<el-table-column label="排产状态" prop="scheduleStatus" width="90" align="center">
<el-table-column label="排产状态" width="115" align="center">
<template slot-scope="scope">
<span class="aps-status-tag" :class="'status-' + (scope.row.scheduleStatus || 1)">{{ statusMap[scope.row.scheduleStatus] || '未知' }}</span>
<el-select
v-model="scope.row.scheduleStatus"
size="mini"
:loading="scope.row._statusLoading"
@change="val => handleInlineStatusChange(scope.row, val)"
@click.stop.native
>
<el-option v-for="(label, val) in statusMap" :key="val" :label="label" :value="Number(val)" />
</el-select>
</template>
</el-table-column>
<el-table-column label="规格" prop="spec" min-width="120" show-overflow-tooltip />
@@ -404,7 +412,7 @@
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="工序类型">
<el-select v-model="editForm.actionId" placeholder="请选择工序类型" clearable filterable style="width:100%">
<el-select v-model="editForm.actionId" placeholder="请选择工序类型" clearable filterable disabled style="width:100%">
<el-option v-for="p in processOptions" :key="p.actionId" :label="p.name" :value="p.actionId" />
</el-select>
</el-form-item>
@@ -660,7 +668,7 @@ export default {
// 待审核
pendingScheduleList: [],
summaryText: '',
statusMap: { 1: '待审核', 2: '已接收', 3: '已驳回' },
statusMap: { 1: '待审核', 2: '已接收', 3: '已驳回', 4: '已排产' },
processOptions: PROCESSES,
// 已接收
@@ -943,12 +951,21 @@ export default {
})
},
// 表格内快捷修改排产状态
handleInlineStatusChange(row, val) {
this.$set(row, '_statusLoading', true)
updateScheduleItem({ scheduleId: row.scheduleId, scheduleStatus: val }).then(() => {
this.$modal.msgSuccess('状态已更新')
}).catch(() => {
this.$modal.msgError('状态更新失败')
this.queryScheduled()
}).finally(() => {
this.$set(row, '_statusLoading', false)
})
},
handleEditScheduled(row) {
this.editForm = { ...this.getEmptyEditForm(), ...row }
// 确保 actionId 为数字类型以匹配下拉选项
if (this.editForm.actionId != null && typeof this.editForm.actionId !== 'number') {
this.editForm.actionId = Number(this.editForm.actionId)
}
// 确保 scheduleStatus 为数字类型以匹配下拉选项
if (this.editForm.scheduleStatus != null && typeof this.editForm.scheduleStatus !== 'number') {
this.editForm.scheduleStatus = Number(this.editForm.scheduleStatus)
@@ -1229,6 +1246,7 @@ export default {
&.status-1 { background: #fff3e0; color: #e67e22; }
&.status-2 { background: #e8f5e9; color: #388e3c; }
&.status-3 { background: #fdecea; color: #e74c3c; }
&.status-4 { background: #e3f2fd; color: #1976d2; }
}
// 产需单信息表

View File

@@ -67,6 +67,11 @@ const TAB_LIST = [
{ key: 'inventoryCheck', label: '盘库流程', icon: 'el-icon-s-check' },
{ key: 'productionSchedule', label: '排产流程', icon: 'el-icon-s-order' },
{ key: 'equipmentRepair', label: '设备维修流程', icon: 'el-icon-s-tools' },
{ key: 'batchTransfer', label: '批量调拨流程', icon: 'el-icon-sort' },
{ key: 'delivery', label: '发货流程', icon: 'el-icon-s-promotion' },
{ key: 'inspection', label: '检验流程', icon: 'el-icon-document-checked' },
{ key: 'qualityReview', label: '质量评审流程', icon: 'el-icon-s-check' },
{ key: 'receiving', label: '收货流程', icon: 'el-icon-download' },
]
const NODE_EVENT_CONFIG = {
@@ -116,17 +121,16 @@ const NODE_EVENT_CONFIG = {
{ id: 'N', label: '执行处理差异', handler: 'handleOpen', params: { componentPath: 'wms/post/InvCount/execute' } },
],
productionSchedule: [
{ id: 'A', label: '创建需单', handler: 'handleOpen', params: { componentPath: 'wms/post/aps/requirement' } },
{ id: 'B', label: '选择合同', handler: 'handleOpen', params: { componentPath: 'wms/post/aps/order' } },
{ id: 'A', label: '创建需单', handler: 'handleOpen', params: { componentPath: 'wms/post/aps/requirement' } },
{ id: 'B', label: '绑定销售订单', handler: 'handleOpen', params: { componentPath: 'wms/post/aps/order' } },
{ id: 'C', label: '自动获取需求明细', handler: 'handleOpen', params: { componentPath: 'wms/post/aps/requirement' } },
{ id: 'D', label: '调整需求明细', handler: 'handleOpen', params: { componentPath: 'wms/post/aps/requirement' } },
{ id: 'E', label: '提交审批', handler: 'handleOpen', params: { componentPath: 'wms/post/aps/schedule' } },
{ id: 'H', label: '转化为排产单', handler: 'handleOpen', params: { componentPath: 'wms/post/aps/schedule' } },
{ id: 'I', label: '排产', handler: 'handleOpen', params: { componentPath: 'wms/post/aps/schedule' } },
{ id: 'J', label: '再次提交审批', handler: 'handleOpen', params: { componentPath: 'wms/post/aps/schedule' } },
{ id: 'M', label: '提交给车间', handler: 'handleOpen', params: { componentPath: 'wms/post/aps/schedule' } },
{ id: 'N', label: '车间绑定钢卷', handler: 'handleOpen', params: { componentPath: 'wms/post/aps/compare' } },
{ id: 'O', label: '执行生产', handler: 'handleOpen', params: { componentPath: 'wms/post/aps/schedule' } },
{ id: 'E', label: '下发产需单', handler: 'handleOpen', params: { componentPath: 'wms/post/aps/requirement' } },
{ id: 'H', label: '选择工艺路线', handler: 'handleOpen', params: { componentPath: 'wms/post/aps/schedule' } },
{ id: 'I', label: '自动生成排产', handler: 'handleOpen', params: { componentPath: 'wms/post/aps/schedule' } },
{ id: 'J', label: '已排产明细管理', handler: 'handleOpen', params: { componentPath: 'wms/post/aps/schedule' } },
{ id: 'K', label: '按工序绑定钢卷', handler: 'handleOpen', params: { componentPath: 'wms/post/aps/compare' } },
{ id: 'L', label: '执行生产', handler: 'handleOpen', params: { componentPath: 'wms/post/aps/schedule' } },
],
equipmentRepair: [
{ id: 'A', label: '创建维修计划', handler: 'handleOpen', params: { componentPath: 'wms/post/eqp/index' } },
@@ -134,6 +138,56 @@ const NODE_EVENT_CONFIG = {
{ id: 'B', label: '提交审批', handler: 'handleOpen', params: { componentPath: 'wms/post/eqp/approval' } },
{ id: 'E', label: '逐设备维修记录', handler: 'handleOpen', params: { componentPath: 'wms/post/eqp/execute' } },
],
batchTransfer: [
{ id: 'A', label: '创建调拨单', handler: 'handleOpen', params: { componentPath: 'wms/move/batch' } },
{ id: 'B', label: '添加调拨明细', handler: 'handleOpen', params: { componentPath: 'wms/move/batch' } },
{ id: 'C', label: '提交审批', handler: 'handleOpen', params: { componentPath: 'wms/move/batch' } },
{ id: 'E', label: '执行调拨', handler: 'handleOpen', params: { componentPath: 'wms/move/record' } },
{ id: 'G', label: '调拨后处理', handler: 'handleOpen', params: { componentPath: 'wms/move/record' } },
],
delivery: [
{ id: 'A', label: '创建发货计划', handler: 'handleOpen', params: { componentPath: 'wms/delivery/plan/index' } },
{ id: 'A2', label: '编排订单明细', handler: 'handleOpen', params: { componentPath: 'wms/delivery/plan/index' } },
{ id: 'B', label: '查看可用库存', handler: 'handleOpen', params: { componentPath: 'wms/delivery/canuse/index' } },
{ id: 'D', label: '配卷/发货绑定', handler: 'handleOpen', params: { componentPath: 'wms/delivery/plan/index' } },
{ id: 'F', label: '分级调整', handler: 'handleOpen', params: { componentPath: 'wms/delivery/grading/index' } },
{ id: 'G', label: '创建发货单/运单', handler: 'handleOpen', params: { componentPath: 'wms/delivery/waybill/index' } },
{ id: 'H', label: '打印发货单', handler: 'handleOpen', params: { componentPath: 'wms/delivery/bills/index' } },
{ id: 'J', label: '批量发货', handler: 'handleOpen', params: { componentPath: 'wms/delivery/bills/index' } },
{ id: 'K', label: '单卷发货', handler: 'handleOpen', params: { componentPath: 'wms/coil/do/ship' } },
{ id: 'L', label: '发货记录', handler: 'handleOpen', params: { componentPath: 'wms/delivery/record/index' } },
{ id: 'M', label: '生产发货看板', handler: 'handleOpen', params: { componentPath: 'micro/pages/zinc/components/Shipping' } },
{ id: 'N', label: '发货报表统计', handler: 'handleOpen', params: { componentPath: 'wms/delivery/report/index' } },
],
inspection: [
{ id: 'A', label: '维护检验方案模板', handler: 'handleOpen', params: { componentPath: 'mes/qc/template/index' } },
{ id: 'B', label: '取样/检验数据录入', handler: 'handleOpen', params: { componentPath: 'mes/qc/inspectionSample/index' } },
{ id: 'D', label: '常规检验录入', handler: 'handleOpen', params: { componentPath: 'mes/qc/inspectionSample/index' } },
{ id: 'E', label: '拉伸检验(专项)', handler: 'handleOpen', params: { componentPath: 'mes/qc/inspectionTensile/index' } },
{ id: 'H', label: '生成质量证明书', handler: 'handleOpen', params: { componentPath: 'mes/qc/certificate/book' } },
{ id: 'I', label: '触发质量评审', handler: 'handleOpen', params: { componentPath: 'mes/qc/qualityReview/index' } },
],
qualityReview: [
{ id: 'A', label: '创建质量评审单', handler: 'handleOpen', params: { componentPath: 'mes/qc/qualityReview/index' } },
{ id: 'B', label: '选择问题钢卷', handler: 'handleOpen', params: { componentPath: 'mes/qc/qualityReview/index' } },
{ id: 'C', label: '填写缺陷及改判信息', handler: 'handleOpen', params: { componentPath: 'mes/qc/qualityReview/index' } },
{ id: 'D', label: '品质部评审意见', handler: 'handleOpen', params: { componentPath: 'mes/qc/qualityReview/index' } },
{ id: 'E', label: '提交送审', handler: 'handleOpen', params: { componentPath: 'mes/qc/qualityReview/index' } },
{ id: 'F', label: '领导审批', handler: 'handleOpen', params: { componentPath: 'mes/qc/qualityReview/index' } },
{ id: 'H', label: '查看驳回原因', handler: 'handleOpen', params: { componentPath: 'mes/qc/qualityReview/index' } },
],
receiving: [
{ id: 'A', label: '创建收货计划', handler: 'handleOpen', params: { componentPath: 'wms/receive/plan/index' } },
{ id: 'B', label: '导入钢卷', handler: 'handleOpen', params: { componentPath: 'wms/receive/plan/index' } },
{ id: 'C', label: '待收货列表', handler: 'handleOpen', params: { componentPath: 'wms/receive/detail/index' } },
{ id: 'E', label: '确认收货', handler: 'handleOpen', params: { componentPath: 'wms/receive/detail/index' } },
{ id: 'I', label: '收货报表统计', handler: 'handleOpen', params: { componentPath: 'wms/receive/report/index' } },
],
}
const DIAGRAMS = {
@@ -253,28 +307,22 @@ graph TD
productionSchedule: `
graph TD
A["<b>创建需单</b><br/>填写基本信息"]:::p1
A --> B["<b>选择合同</b><br/>可选一个或多个合同"]:::p2
A["<b>创建需单</b><br/>填写基本信息<br/>产需单号/生产日期/订货单位"]:::p1
A --> B["<b>绑定销售订单</b><br/>选择关联合同订单"]:::p2
B --> C["<b>自动获取需求明细</b><br/>从所选合同提取"]:::p3
C --> D["<b>调整需求明细</b><br/>可编辑/修改/补充"]:::p4
D --> E["<b>提交审批</b>"]:::p5
E --> F{"审批"}:::dec
F -->|不通过| G["<b>退回修改</b>"]:::p4
D --> E["<b>下发产需单</b><br/>提交到车间待审核"]:::p5
E --> F{"车间审核"}:::dec
F -->|驳回| G["<b>退回修改</b>"]:::p4
G --> D
F -->|通过| H["<b>转化为排产单</b>"]:::p6
F -->|接收| H["<b>选择工艺路线</b><br/>为每条明细配置<br/>工艺+工序步骤"]:::p6
H --> I["<b>排产</b><br/>可再次编辑"]:::p7
I --> J["<b>再次提交审批</b>"]:::p5
J --> K{"审批"}:::dec
K -->|不通过| L["<b>退回修改</b>"]:::p7
L --> I
K -->|通过| M["<b>提交给车间</b>"]:::p8
M --> N["<b>车间绑定钢卷</b><br/>每个排产计划<br/>绑定一个或多个钢卷"]:::p9
N --> O["<b>执行生产</b>"]:::p10
O --> P(["<b>排产完结</b>"]):::pend
H --> I["<b>自动生成排产</b><br/>按工序步骤分组"]:::p7
I --> J["<b>已排产明细管理</b><br/>按步骤查看/编辑<br/>内联修改排产状态"]:::p7
J --> K["<b>按工序绑定钢卷</b><br/>将现存钢卷绑定到<br/>对应的排产明细"]:::p8
K --> L["<b>执行生产</b>"]:::p9
L --> M(["<b>排产完结</b>"]):::pend
classDef p1 fill:#409eff,stroke:#337ecc,color:#fff,stroke-width:2px
classDef p2 fill:#e6fffa,stroke:#13c2c2,color:#303133,stroke-width:2px
@@ -285,7 +333,6 @@ graph TD
classDef p7 fill:#fff0f6,stroke:#eb2f96,color:#303133,stroke-width:2px
classDef p8 fill:#f6ffed,stroke:#52c41a,color:#303133,stroke-width:2px
classDef p9 fill:#f0f5ff,stroke:#597ef7,color:#303133,stroke-width:2px
classDef p10 fill:#fffbe6,stroke:#fadb14,color:#303133,stroke-width:2px
classDef dec fill:#f9f0ff,stroke:#722ed1,color:#303133,stroke-width:2px
classDef pend fill:#dcf7e8,stroke:#52c41a,color:#303133,stroke-width:2px,rx:10,ry:10
linkStyle default stroke:#bfbfbf,stroke-width:2px
@@ -315,6 +362,148 @@ graph TD
classDef eend fill:#dcf7e8,stroke:#52c41a,color:#303133,stroke-width:2px,rx:10,ry:10
linkStyle default stroke:#bfbfbf,stroke-width:2px
`,
batchTransfer: `
graph TD
A["<b>创建调拨单</b><br/>填写调拨单号/名称<br/>选择调拨类型/时间"]:::m1
A --> B["<b>添加调拨明细</b><br/>选择钢卷或批量导入<br/>填写调拨前后属性"]:::m2
B --> C["<b>提交审批</b>"]:::m3
C --> D{"审批"}:::dec
D -->|通过| E["<b>执行调拨</b><br/>批量/单条执行<br/>实际移动钢卷库区"]:::m4
D -->|驳回| F["<b>退回修改</b>"]:::m5
F --> B
E --> G["<b>调拨后处理</b><br/>可重贴标签<br/>记录调拨备注"]:::m6
G --> H(["调拨归档<br/>库存已更新"]):::mend
classDef m1 fill:#409eff,stroke:#337ecc,color:#fff,stroke-width:2px
classDef m2 fill:#e6fffa,stroke:#13c2c2,color:#303133,stroke-width:2px
classDef m3 fill:#f0f5ff,stroke:#597ef7,color:#303133,stroke-width:2px
classDef m4 fill:#fff7e6,stroke:#fa8c16,color:#303133,stroke-width:2px
classDef m5 fill:#fff1f0,stroke:#f5222d,color:#303133,stroke-width:2px
classDef m6 fill:#e6f7ff,stroke:#1890ff,color:#303133,stroke-width:2px
classDef dec fill:#f9f0ff,stroke:#722ed1,color:#303133,stroke-width:2px
classDef mend fill:#dcf7e8,stroke:#52c41a,color:#303133,stroke-width:2px,rx:10,ry:10
linkStyle default stroke:#bfbfbf,stroke-width:2px
`,
delivery: `
graph TD
A["<b>创建发货计划</b><br/>填写计划名称/日期"]:::d1
A --> A2["<b>编排订单明细</b><br/>添加关联合同订单"]:::d2
A2 --> B["<b>查看可用库存</b><br/>可配钢卷<br/><i>仅显示合格品</i>"]:::d3
B --> C{"质量校验<br/><i>系统自动过滤</i>"}:::dec
C -->|合格| D["<b>配卷/发货绑定</b><br/>选择钢卷绑定到计划"]:::d4
C -->|不合格| E["<b>锁定不可发货</b><br/>可分级调整或处理缺陷"]:::d5
E --> F["<b>分级调整</b><br/>手动调整等级(后备)"]:::d6
F --> B
D --> G["<b>创建发货单/运单</b><br/>填写车牌/收货单位/负责人"]:::d7
G --> H["<b>打印发货单</b><br/>选择打印模板"]:::d8
H --> I{"出库方式"}:::dec
I -->|批量出库| J["<b>批量发货</b><br/>整单确认出库"]:::d9
I -->|单卷出库| K["<b>单卷发货</b><br/>逐卷扫码出库"]:::d10
J --> L["<b>发货记录</b><br/>操作日志可追溯"]:::d11
K --> L
L --> M["<b>生产发货看板</b><br/>配卷情况/发货记录"]:::d12
M --> N["<b>发货报表统计</b>"]:::d13
N --> O(["发货完结"]):::dend
classDef d1 fill:#409eff,stroke:#337ecc,color:#fff,stroke-width:2px
classDef d2 fill:#e6fffa,stroke:#13c2c2,color:#303133,stroke-width:2px
classDef d3 fill:#fff7e6,stroke:#fa8c16,color:#303133,stroke-width:2px
classDef d4 fill:#f6ffed,stroke:#52c41a,color:#303133,stroke-width:2px
classDef d5 fill:#fff1f0,stroke:#f5222d,color:#303133,stroke-width:2px
classDef d6 fill:#fffbe6,stroke:#fadb14,color:#303133,stroke-width:2px
classDef d7 fill:#e6f7ff,stroke:#1890ff,color:#303133,stroke-width:2px
classDef d8 fill:#f0f5ff,stroke:#597ef7,color:#303133,stroke-width:2px
classDef d9 fill:#f6ffed,stroke:#52c41a,color:#303133,stroke-width:2px
classDef d10 fill:#fff0f6,stroke:#eb2f96,color:#303133,stroke-width:2px
classDef d11 fill:#e6f7ff,stroke:#1890ff,color:#303133,stroke-width:2px
classDef d12 fill:#fffbe6,stroke:#fadb14,color:#303133,stroke-width:2px
classDef d13 fill:#f0f5ff,stroke:#597ef7,color:#303133,stroke-width:2px
classDef dec fill:#f9f0ff,stroke:#722ed1,color:#303133,stroke-width:2px
classDef dend fill:#dcf7e8,stroke:#52c41a,color:#303133,stroke-width:2px,rx:10,ry:10
linkStyle default stroke:#bfbfbf,stroke-width:2px
`,
inspection: `
graph TD
A["<b>维护检验方案模板</b><br/>定义检验项/单位/标准"]:::i1
A --> B["<b>取样/检验数据录入</b><br/>选择方案模板<br/>动态生成检验项表格"]:::i2
B --> C{"检验项类型"}:::dec
C -->|常规项| D["<b>常规检验录入</b><br/>直接在模板表格<br/>填写检测数据"]:::i3
C -->|拉伸试验| E["<b>拉伸检验(专项)</b><br/>独立试验记录<br/>管理明细数据"]:::i4
D --> F["<b>汇总检验结果</b>"]:::i5
E --> F
F --> G{"判定"}:::dec
G -->|合格| H["<b>生成质量证明书</b><br/>汇总全部检验数据"]:::i6
G -->|不合格| I["<b>触发质量评审</b><br/>进入评审流程"]:::i7
H --> J(["检验归档"]):::iend
classDef i1 fill:#409eff,stroke:#337ecc,color:#fff,stroke-width:2px
classDef i2 fill:#e6fffa,stroke:#13c2c2,color:#303133,stroke-width:2px
classDef i3 fill:#fff7e6,stroke:#fa8c16,color:#303133,stroke-width:2px
classDef i4 fill:#f0f5ff,stroke:#597ef7,color:#303133,stroke-width:2px
classDef i5 fill:#fffbe6,stroke:#fadb14,color:#303133,stroke-width:2px
classDef i6 fill:#f6ffed,stroke:#52c41a,color:#303133,stroke-width:2px
classDef i7 fill:#fff1f0,stroke:#f5222d,color:#303133,stroke-width:2px
classDef dec fill:#f9f0ff,stroke:#722ed1,color:#303133,stroke-width:2px
classDef iend fill:#dcf7e8,stroke:#52c41a,color:#303133,stroke-width:2px,rx:10,ry:10
linkStyle default stroke:#bfbfbf,stroke-width:2px
`,
qualityReview: `
graph TD
A["<b>创建质量评审单</b><br/>填写产品名称/传递部门<br/>选择日期"]:::q1
A --> B["<b>选择问题钢卷</b><br/>仅O级钢卷可被选中<br/>可多选"]:::q2
B --> C["<b>填写缺陷及改判信息</b><br/>缺陷描述/改判后等级<br/>改判后目标库区"]:::q3
C --> D["<b>品质部评审意见</b><br/>填写评审意见/签字"]:::q4
D --> E["<b>提交送审</b>"]:::q5
E --> F{"领导审批"}:::dec
F -->|通过| G["<b>执行改判</b><br/>自动更新钢卷质量状态<br/>移动钢卷到目标库区"]:::q6
F -->|驳回| H["<b>查看驳回原因</b><br/>修改后重新提交"]:::q7
H --> C
G --> I["生成审批记录<br/>流程归档"]:::q8
I --> J(["评审完结"]):::qend
classDef q1 fill:#409eff,stroke:#337ecc,color:#fff,stroke-width:2px
classDef q2 fill:#e6fffa,stroke:#13c2c2,color:#303133,stroke-width:2px
classDef q3 fill:#fff7e6,stroke:#fa8c16,color:#303133,stroke-width:2px
classDef q4 fill:#f0f5ff,stroke:#597ef7,color:#303133,stroke-width:2px
classDef q5 fill:#e6f7ff,stroke:#1890ff,color:#303133,stroke-width:2px
classDef q6 fill:#f6ffed,stroke:#52c41a,color:#303133,stroke-width:2px
classDef q7 fill:#fff1f0,stroke:#f5222d,color:#303133,stroke-width:2px
classDef q8 fill:#fffbe6,stroke:#fadb14,color:#303133,stroke-width:2px
classDef dec fill:#f9f0ff,stroke:#722ed1,color:#303133,stroke-width:2px
classDef qend fill:#dcf7e8,stroke:#52c41a,color:#303133,stroke-width:2px,rx:10,ry:10
linkStyle default stroke:#bfbfbf,stroke-width:2px
`,
receiving: `
graph TD
A["<b>创建收货计划</b><br/>填写计划名称/日期"]:::r1
A --> B["<b>导入钢卷</b><br/>批量导入原料钢卷<br/>记录卷号/规格/重量"]:::r2
B --> C["<b>待收货列表</b><br/>查看待收货钢卷"]:::r3
C --> D{"验收决定"}:::dec
D -->|签收| E["<b>确认收货</b><br/>选择实际库区<br/>钢卷入库/库存更新"]:::r4
D -->|拒签| F["<b>拒签处理</b><br/>钢卷不入库<br/>标记为已取消"]:::r5
E --> G["已入库完成"]:::r6
F --> H["已拒签/取消"]:::r7
G --> I["<b>收货报表统计</b>"]:::r8
H --> I
I --> J(["收货完结"]):::rend
classDef r1 fill:#409eff,stroke:#337ecc,color:#fff,stroke-width:2px
classDef r2 fill:#e6fffa,stroke:#13c2c2,color:#303133,stroke-width:2px
classDef r3 fill:#fff7e6,stroke:#fa8c16,color:#303133,stroke-width:2px
classDef r4 fill:#f6ffed,stroke:#52c41a,color:#303133,stroke-width:2px
classDef r5 fill:#fff1f0,stroke:#f5222d,color:#303133,stroke-width:2px
classDef r6 fill:#e6f7ff,stroke:#1890ff,color:#303133,stroke-width:2px
classDef r7 fill:#fffbe6,stroke:#fadb14,color:#303133,stroke-width:2px
classDef r8 fill:#f0f5ff,stroke:#597ef7,color:#303133,stroke-width:2px
classDef dec fill:#f9f0ff,stroke:#722ed1,color:#303133,stroke-width:2px
classDef rend fill:#dcf7e8,stroke:#52c41a,color:#303133,stroke-width:2px,rx:10,ry:10
linkStyle default stroke:#bfbfbf,stroke-width:2px
`,
}

View File

@@ -52,6 +52,5 @@ public class WmsFurnaceBo extends BaseEntity {
/**
* 批量操作ID
*/
@NotNull(message = "主键不能为空", groups = {com.klp.common.core.validate.EditGroup.class})
private Long[] furnaceIds;
}