质量模块首次提交
parent
01fbb635bb
commit
07e8a453d0
@ -0,0 +1,77 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { DefectDetailVO, DefectDetailForm, DefectDetailQuery } from '@/api/qms/defectDetail/types';
|
||||
|
||||
/**
|
||||
* 查询病疵详细列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listDefectDetail = (query?: DefectDetailQuery): AxiosPromise<DefectDetailVO[]> => {
|
||||
return request({
|
||||
url: '/qms/defectDetail/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询病疵详细详细
|
||||
* @param defectDetailId
|
||||
*/
|
||||
export const getDefectDetail = (defectDetailId: string | number): AxiosPromise<DefectDetailVO> => {
|
||||
return request({
|
||||
url: '/qms/defectDetail/' + defectDetailId,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增病疵详细
|
||||
* @param data
|
||||
*/
|
||||
export const addDefectDetail = (data: DefectDetailForm) => {
|
||||
return request({
|
||||
url: '/qms/defectDetail',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改病疵详细
|
||||
* @param data
|
||||
*/
|
||||
export const updateDefectDetail = (data: DefectDetailForm) => {
|
||||
return request({
|
||||
url: '/qms/defectDetail',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除病疵详细
|
||||
* @param defectDetailId
|
||||
*/
|
||||
export const delDefectDetail = (defectDetailId: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/qms/defectDetail/' + defectDetailId,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 下拉框查询病疵详细列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export function getQcDefectDetailList (query) {
|
||||
return request({
|
||||
url: '/qms/defectDetail/getQcDefectDetailList',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
@ -0,0 +1,77 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { DefectInfoVO, DefectInfoForm, DefectInfoQuery } from '@/api/qms/defectInfo/types';
|
||||
|
||||
/**
|
||||
* 查询病疵信息列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listDefectInfo = (query?: DefectInfoQuery): AxiosPromise<DefectInfoVO[]> => {
|
||||
return request({
|
||||
url: '/qms/defectInfo/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询病疵信息详细
|
||||
* @param defectId
|
||||
*/
|
||||
export const getDefectInfo = (defectId: string | number): AxiosPromise<DefectInfoVO> => {
|
||||
return request({
|
||||
url: '/qms/defectInfo/' + defectId,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增病疵信息
|
||||
* @param data
|
||||
*/
|
||||
export const addDefectInfo = (data: DefectInfoForm) => {
|
||||
return request({
|
||||
url: '/qms/defectInfo',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改病疵信息
|
||||
* @param data
|
||||
*/
|
||||
export const updateDefectInfo = (data: DefectInfoForm) => {
|
||||
return request({
|
||||
url: '/qms/defectInfo',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除病疵信息
|
||||
* @param defectId
|
||||
*/
|
||||
export const delDefectInfo = (defectId: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/qms/defectInfo/' + defectId,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 下拉框查询病疵信息列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export function getQcDefectInfoList (query) {
|
||||
return request({
|
||||
url: '/qms/defectInfo/getQcDefectInfoList',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
@ -0,0 +1,77 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { DynamicStandardVO, DynamicStandardForm, DynamicStandardQuery } from '@/api/qms/dynamicStandard/types';
|
||||
|
||||
/**
|
||||
* 查询动均质检标准维护列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listDynamicStandard = (query?: DynamicStandardQuery): AxiosPromise<DynamicStandardVO[]> => {
|
||||
return request({
|
||||
url: '/qms/dynamicStandard/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询动均质检标准维护详细
|
||||
* @param standardId
|
||||
*/
|
||||
export const getDynamicStandard = (standardId: string | number): AxiosPromise<DynamicStandardVO> => {
|
||||
return request({
|
||||
url: '/qms/dynamicStandard/' + standardId,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增动均质检标准维护
|
||||
* @param data
|
||||
*/
|
||||
export const addDynamicStandard = (data: DynamicStandardForm) => {
|
||||
return request({
|
||||
url: '/qms/dynamicStandard',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改动均质检标准维护
|
||||
* @param data
|
||||
*/
|
||||
export const updateDynamicStandard = (data: DynamicStandardForm) => {
|
||||
return request({
|
||||
url: '/qms/dynamicStandard',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除动均质检标准维护
|
||||
* @param standardId
|
||||
*/
|
||||
export const delDynamicStandard = (standardId: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/qms/dynamicStandard/' + standardId,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 下拉框查询动均质检标准维护列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export function getQcDynamicStandardList (query) {
|
||||
return request({
|
||||
url: '/qms/dynamicStandard/getQcDynamicStandardList',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
@ -0,0 +1,116 @@
|
||||
export interface DynamicStandardVO {
|
||||
/**
|
||||
* 规格编码
|
||||
*/
|
||||
speCode: string;
|
||||
|
||||
/**
|
||||
* 规格名称
|
||||
*/
|
||||
speName: string;
|
||||
|
||||
/**
|
||||
* 动平衡质检标准
|
||||
*/
|
||||
dynamicStandard: string;
|
||||
|
||||
/**
|
||||
* X光质检标准
|
||||
*/
|
||||
xrayStandard: string;
|
||||
|
||||
/**
|
||||
* 均匀性质检标准
|
||||
*/
|
||||
uniformityStandard: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DynamicStandardForm extends BaseEntity {
|
||||
/**
|
||||
* 主键标识
|
||||
*/
|
||||
standardId?: string | number;
|
||||
|
||||
/**
|
||||
* 规格编码
|
||||
*/
|
||||
speCode?: string;
|
||||
|
||||
/**
|
||||
* 规格名称
|
||||
*/
|
||||
speName?: string;
|
||||
|
||||
/**
|
||||
* 动平衡质检标准
|
||||
*/
|
||||
dynamicStandard?: string;
|
||||
|
||||
/**
|
||||
* X光质检标准
|
||||
*/
|
||||
xrayStandard?: string;
|
||||
|
||||
/**
|
||||
* 均匀性质检标准
|
||||
*/
|
||||
uniformityStandard?: string;
|
||||
|
||||
/**
|
||||
* 预留字段
|
||||
*/
|
||||
attr1?: string;
|
||||
|
||||
/**
|
||||
* 预留字段
|
||||
*/
|
||||
attr2?: string;
|
||||
|
||||
/**
|
||||
* 预留字段
|
||||
*/
|
||||
attr3?: string;
|
||||
|
||||
/**
|
||||
* 预留字段
|
||||
*/
|
||||
attr4?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DynamicStandardQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 规格编码
|
||||
*/
|
||||
speCode?: string;
|
||||
|
||||
/**
|
||||
* 规格名称
|
||||
*/
|
||||
speName?: string;
|
||||
|
||||
/**
|
||||
* 动平衡质检标准
|
||||
*/
|
||||
dynamicStandard?: string;
|
||||
|
||||
/**
|
||||
* X光质检标准
|
||||
*/
|
||||
xrayStandard?: string;
|
||||
|
||||
/**
|
||||
* 均匀性质检标准
|
||||
*/
|
||||
uniformityStandard?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,77 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { GradeInfoVO, GradeInfoForm, GradeInfoQuery } from '@/api/qms/gradeInfo/types';
|
||||
|
||||
/**
|
||||
* 查询品级信息列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listGradeInfo = (query?: GradeInfoQuery): AxiosPromise<GradeInfoVO[]> => {
|
||||
return request({
|
||||
url: '/qms/gradeInfo/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询品级信息详细
|
||||
* @param gradeId
|
||||
*/
|
||||
export const getGradeInfo = (gradeId: string | number): AxiosPromise<GradeInfoVO> => {
|
||||
return request({
|
||||
url: '/qms/gradeInfo/' + gradeId,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增品级信息
|
||||
* @param data
|
||||
*/
|
||||
export const addGradeInfo = (data: GradeInfoForm) => {
|
||||
return request({
|
||||
url: '/qms/gradeInfo',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改品级信息
|
||||
* @param data
|
||||
*/
|
||||
export const updateGradeInfo = (data: GradeInfoForm) => {
|
||||
return request({
|
||||
url: '/qms/gradeInfo',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除品级信息
|
||||
* @param gradeId
|
||||
*/
|
||||
export const delGradeInfo = (gradeId: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/qms/gradeInfo/' + gradeId,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 下拉框查询品级信息列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export function getQcGradeInfoList (query) {
|
||||
return request({
|
||||
url: '/qms/gradeInfo/getQcGradeInfoList',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
@ -0,0 +1,126 @@
|
||||
export interface GradeInfoVO {
|
||||
/**
|
||||
* 品级编码
|
||||
*/
|
||||
gradeCode: string;
|
||||
|
||||
/**
|
||||
* 品级名称
|
||||
*/
|
||||
gradeName: string;
|
||||
|
||||
/**
|
||||
* 工序编码
|
||||
*/
|
||||
operationCode: string;
|
||||
|
||||
/**
|
||||
* 工序名称
|
||||
*/
|
||||
operationName: string;
|
||||
|
||||
/**
|
||||
* 车间/工程
|
||||
*/
|
||||
workshop: string;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
sort: number;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
status: string;
|
||||
|
||||
}
|
||||
|
||||
export interface GradeInfoForm extends BaseEntity {
|
||||
/**
|
||||
* 品级主键
|
||||
*/
|
||||
gradeId?: string | number;
|
||||
|
||||
/**
|
||||
* 品级编码
|
||||
*/
|
||||
gradeCode?: string;
|
||||
|
||||
/**
|
||||
* 品级名称
|
||||
*/
|
||||
gradeName?: string;
|
||||
|
||||
/**
|
||||
* 工序编码
|
||||
*/
|
||||
operationCode?: string;
|
||||
|
||||
/**
|
||||
* 工序名称
|
||||
*/
|
||||
operationName?: string;
|
||||
|
||||
/**
|
||||
* 车间/工程
|
||||
*/
|
||||
workshop?: string;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
sort?: number;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface GradeInfoQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 品级编码
|
||||
*/
|
||||
gradeCode?: string;
|
||||
|
||||
/**
|
||||
* 品级名称
|
||||
*/
|
||||
gradeName?: string;
|
||||
|
||||
/**
|
||||
* 工序编码
|
||||
*/
|
||||
operationCode?: string;
|
||||
|
||||
/**
|
||||
* 工序名称
|
||||
*/
|
||||
operationName?: string;
|
||||
|
||||
/**
|
||||
* 车间/工程
|
||||
*/
|
||||
workshop?: string;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
sort?: number;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,77 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { InspectionItemsVO, InspectionItemsForm, InspectionItemsQuery } from '@/api/qms/inspectionItems/types';
|
||||
|
||||
/**
|
||||
* 查询检验项目基础列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listInspectionItems = (query?: InspectionItemsQuery): AxiosPromise<InspectionItemsVO[]> => {
|
||||
return request({
|
||||
url: '/qms/inspectionItems/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询检验项目基础详细
|
||||
* @param inspectionItemId
|
||||
*/
|
||||
export const getInspectionItems = (inspectionItemId: string | number): AxiosPromise<InspectionItemsVO> => {
|
||||
return request({
|
||||
url: '/qms/inspectionItems/' + inspectionItemId,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增检验项目基础
|
||||
* @param data
|
||||
*/
|
||||
export const addInspectionItems = (data: InspectionItemsForm) => {
|
||||
return request({
|
||||
url: '/qms/inspectionItems',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改检验项目基础
|
||||
* @param data
|
||||
*/
|
||||
export const updateInspectionItems = (data: InspectionItemsForm) => {
|
||||
return request({
|
||||
url: '/qms/inspectionItems',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除检验项目基础
|
||||
* @param inspectionItemId
|
||||
*/
|
||||
export const delInspectionItems = (inspectionItemId: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/qms/inspectionItems/' + inspectionItemId,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 下拉框查询检验项目基础列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export function getQcInspectionItemsList (query) {
|
||||
return request({
|
||||
url: '/qms/inspectionItems/getQcInspectionItemsList',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
@ -0,0 +1,77 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { InspectionRulesVO, InspectionRulesForm, InspectionRulesQuery } from '@/api/qms/inspectionRules/types';
|
||||
|
||||
/**
|
||||
* 查询检验规则列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listInspectionRules = (query?: InspectionRulesQuery): AxiosPromise<InspectionRulesVO[]> => {
|
||||
return request({
|
||||
url: '/qms/inspectionRules/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询检验规则详细
|
||||
* @param ruleId
|
||||
*/
|
||||
export const getInspectionRules = (ruleId: string | number): AxiosPromise<InspectionRulesVO> => {
|
||||
return request({
|
||||
url: '/qms/inspectionRules/' + ruleId,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增检验规则
|
||||
* @param data
|
||||
*/
|
||||
export const addInspectionRules = (data: InspectionRulesForm) => {
|
||||
return request({
|
||||
url: '/qms/inspectionRules',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改检验规则
|
||||
* @param data
|
||||
*/
|
||||
export const updateInspectionRules = (data: InspectionRulesForm) => {
|
||||
return request({
|
||||
url: '/qms/inspectionRules',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除检验规则
|
||||
* @param ruleId
|
||||
*/
|
||||
export const delInspectionRules = (ruleId: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/qms/inspectionRules/' + ruleId,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 下拉框查询检验规则列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export function getQcInspectionRulesList (query) {
|
||||
return request({
|
||||
url: '/qms/inspectionRules/getQcInspectionRulesList',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
@ -0,0 +1,91 @@
|
||||
export interface InspectionRulesVO {
|
||||
/**
|
||||
* 规则名称
|
||||
*/
|
||||
ruleName: string;
|
||||
|
||||
/**
|
||||
* 规则类型
|
||||
*/
|
||||
ruleType: string;
|
||||
|
||||
/**
|
||||
* 检验方式
|
||||
*/
|
||||
ruleMode: string;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
status: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface InspectionRulesForm extends BaseEntity {
|
||||
/**
|
||||
* 检验规则主键
|
||||
*/
|
||||
ruleId?: string | number;
|
||||
|
||||
/**
|
||||
* 规则名称
|
||||
*/
|
||||
ruleName?: string;
|
||||
|
||||
/**
|
||||
* 规则类型
|
||||
*/
|
||||
ruleType?: string;
|
||||
|
||||
/**
|
||||
* 检验方式
|
||||
*/
|
||||
ruleMode?: string;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface InspectionRulesQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 规则名称
|
||||
*/
|
||||
ruleName?: string;
|
||||
|
||||
/**
|
||||
* 规则类型
|
||||
*/
|
||||
ruleType?: string;
|
||||
|
||||
/**
|
||||
* 检验方式
|
||||
*/
|
||||
ruleMode?: string;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,77 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { LevelInfoVO, LevelInfoForm, LevelInfoQuery } from '@/api/qms/levelInfo/types';
|
||||
|
||||
/**
|
||||
* 查询层级信息列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listLevelInfo = (query?: LevelInfoQuery): AxiosPromise<LevelInfoVO[]> => {
|
||||
return request({
|
||||
url: '/qms/levelInfo/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询层级信息详细
|
||||
* @param levelId
|
||||
*/
|
||||
export const getLevelInfo = (levelId: string | number): AxiosPromise<LevelInfoVO> => {
|
||||
return request({
|
||||
url: '/qms/levelInfo/' + levelId,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增层级信息
|
||||
* @param data
|
||||
*/
|
||||
export const addLevelInfo = (data: LevelInfoForm) => {
|
||||
return request({
|
||||
url: '/qms/levelInfo',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改层级信息
|
||||
* @param data
|
||||
*/
|
||||
export const updateLevelInfo = (data: LevelInfoForm) => {
|
||||
return request({
|
||||
url: '/qms/levelInfo',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除层级信息
|
||||
* @param levelId
|
||||
*/
|
||||
export const delLevelInfo = (levelId: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/qms/levelInfo/' + levelId,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 下拉框查询层级信息列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export function getQcLevelInfoList (query) {
|
||||
return request({
|
||||
url: '/qms/levelInfo/getQcLevelInfoList',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
@ -0,0 +1,91 @@
|
||||
export interface LevelInfoVO {
|
||||
/**
|
||||
* 等级主键
|
||||
*/
|
||||
levelId: string | number;
|
||||
|
||||
/**
|
||||
* 等级编码
|
||||
*/
|
||||
levelCode: string;
|
||||
|
||||
/**
|
||||
* 等级名称
|
||||
*/
|
||||
levelName: string;
|
||||
|
||||
/**
|
||||
* 工序编码
|
||||
*/
|
||||
operationCode: string;
|
||||
|
||||
/**
|
||||
* 工序名称
|
||||
*/
|
||||
operationName: string;
|
||||
|
||||
}
|
||||
|
||||
export interface LevelInfoForm extends BaseEntity {
|
||||
/**
|
||||
* 等级主键
|
||||
*/
|
||||
levelId?: string | number;
|
||||
|
||||
/**
|
||||
* 等级编码
|
||||
*/
|
||||
levelCode?: string;
|
||||
|
||||
/**
|
||||
* 等级名称
|
||||
*/
|
||||
levelName?: string;
|
||||
|
||||
/**
|
||||
* 工序编码
|
||||
*/
|
||||
operationCode?: string;
|
||||
|
||||
/**
|
||||
* 工序名称
|
||||
*/
|
||||
operationName?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface LevelInfoQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 等级主键
|
||||
*/
|
||||
levelId?: string | number;
|
||||
|
||||
/**
|
||||
* 等级编码
|
||||
*/
|
||||
levelCode?: string;
|
||||
|
||||
/**
|
||||
* 等级名称
|
||||
*/
|
||||
levelName?: string;
|
||||
|
||||
/**
|
||||
* 工序编码
|
||||
*/
|
||||
operationCode?: string;
|
||||
|
||||
/**
|
||||
* 工序名称
|
||||
*/
|
||||
operationName?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,77 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { RevisionInfoVO, RevisionInfoForm, RevisionInfoQuery } from '@/api/qms/revisionInfo/types';
|
||||
|
||||
/**
|
||||
* 查询改判原因信息列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listRevisionInfo = (query?: RevisionInfoQuery): AxiosPromise<RevisionInfoVO[]> => {
|
||||
return request({
|
||||
url: '/qms/revisionInfo/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询改判原因信息详细
|
||||
* @param revisionId
|
||||
*/
|
||||
export const getRevisionInfo = (revisionId: string | number): AxiosPromise<RevisionInfoVO> => {
|
||||
return request({
|
||||
url: '/qms/revisionInfo/' + revisionId,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增改判原因信息
|
||||
* @param data
|
||||
*/
|
||||
export const addRevisionInfo = (data: RevisionInfoForm) => {
|
||||
return request({
|
||||
url: '/qms/revisionInfo',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改改判原因信息
|
||||
* @param data
|
||||
*/
|
||||
export const updateRevisionInfo = (data: RevisionInfoForm) => {
|
||||
return request({
|
||||
url: '/qms/revisionInfo',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除改判原因信息
|
||||
* @param revisionId
|
||||
*/
|
||||
export const delRevisionInfo = (revisionId: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/qms/revisionInfo/' + revisionId,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 下拉框查询改判原因信息列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export function getQcRevisionInfoList (query) {
|
||||
return request({
|
||||
url: '/qms/revisionInfo/getQcRevisionInfoList',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
@ -0,0 +1,46 @@
|
||||
export interface RevisionInfoVO {
|
||||
/**
|
||||
* 原因编码
|
||||
*/
|
||||
revisionCode: string;
|
||||
|
||||
/**
|
||||
* 原因描述
|
||||
*/
|
||||
revisionDesc: string;
|
||||
|
||||
}
|
||||
|
||||
export interface RevisionInfoForm extends BaseEntity {
|
||||
/**
|
||||
* 原因编码
|
||||
*/
|
||||
revisionCode?: string;
|
||||
|
||||
/**
|
||||
* 原因描述
|
||||
*/
|
||||
revisionDesc?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface RevisionInfoQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 原因编码
|
||||
*/
|
||||
revisionCode?: string;
|
||||
|
||||
/**
|
||||
* 原因描述
|
||||
*/
|
||||
revisionDesc?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,77 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { RimInfoVO, RimInfoForm, RimInfoQuery } from '@/api/qms/rimInfo/types';
|
||||
|
||||
/**
|
||||
* 查询轮辋信息列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listRimInfo = (query?: RimInfoQuery): AxiosPromise<RimInfoVO[]> => {
|
||||
return request({
|
||||
url: '/qms/rimInfo/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询轮辋信息详细
|
||||
* @param rimId
|
||||
*/
|
||||
export const getRimInfo = (rimId: string | number): AxiosPromise<RimInfoVO> => {
|
||||
return request({
|
||||
url: '/qms/rimInfo/' + rimId,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增轮辋信息
|
||||
* @param data
|
||||
*/
|
||||
export const addRimInfo = (data: RimInfoForm) => {
|
||||
return request({
|
||||
url: '/qms/rimInfo',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改轮辋信息
|
||||
* @param data
|
||||
*/
|
||||
export const updateRimInfo = (data: RimInfoForm) => {
|
||||
return request({
|
||||
url: '/qms/rimInfo',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除轮辋信息
|
||||
* @param rimId
|
||||
*/
|
||||
export const delRimInfo = (rimId: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/qms/rimInfo/' + rimId,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 下拉框查询轮辋信息列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export function getQcRimInfoList (query) {
|
||||
return request({
|
||||
url: '/qms/rimInfo/getQcRimInfoList',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
@ -0,0 +1,76 @@
|
||||
export interface RimInfoVO {
|
||||
/**
|
||||
* 轮辋编码
|
||||
*/
|
||||
rimCode: string;
|
||||
|
||||
/**
|
||||
* 轮辋名称
|
||||
*/
|
||||
rimName: string;
|
||||
|
||||
/**
|
||||
* 轮辋直径
|
||||
*/
|
||||
rimDiameter: number;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface RimInfoForm extends BaseEntity {
|
||||
/**
|
||||
* 轮辋主键
|
||||
*/
|
||||
rimId?: string | number;
|
||||
|
||||
/**
|
||||
* 轮辋编码
|
||||
*/
|
||||
rimCode?: string;
|
||||
|
||||
/**
|
||||
* 轮辋名称
|
||||
*/
|
||||
rimName?: string;
|
||||
|
||||
/**
|
||||
* 轮辋直径
|
||||
*/
|
||||
rimDiameter?: number;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface RimInfoQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 轮辋编码
|
||||
*/
|
||||
rimCode?: string;
|
||||
|
||||
/**
|
||||
* 轮辋名称
|
||||
*/
|
||||
rimName?: string;
|
||||
|
||||
/**
|
||||
* 轮辋直径
|
||||
*/
|
||||
rimDiameter?: number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,274 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="病疵名称" prop="defectName">
|
||||
<el-input v-model="queryParams.defectName" placeholder="请输入病疵名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="病疵类型" prop="defectType">
|
||||
<el-input v-model="queryParams.defectType" placeholder="请输入病疵类型" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-input v-model="queryParams.status" placeholder="请输入状态" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工序" prop="operation">
|
||||
<el-input v-model="queryParams.operation" placeholder="请输入工序" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['qms:defectInfo:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['qms:defectInfo:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['qms:defectInfo:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['qms:defectInfo:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="true" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="defectInfoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="病疵名称" align="center" prop="defectName" v-if="columns[1].visible"/>
|
||||
<el-table-column label="病疵类型" align="center" prop="defectType" v-if="columns[2].visible">
|
||||
<template #default="scope">
|
||||
<router-link :to="'/qms/defect-data/index/' + scope.row.defectId" class="link-type">
|
||||
<span>{{ scope.row.defectType }}</span>
|
||||
</router-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status" v-if="columns[3].visible">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="defect_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column label="工序" align="center" prop="operation" v-if="columns[4].visible"/>-->
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['qms:defectInfo:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['qms:defectInfo:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改病疵信息对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="defectInfoFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="病疵名称" prop="defectName">
|
||||
<el-input v-model="form.defectName" placeholder="请输入病疵名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="病疵类型" prop="defectType">
|
||||
<el-input v-model="form.defectType" placeholder="请输入病疵类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工序" prop="operation">
|
||||
<el-input v-model="form.operation" placeholder="请输入工序" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="DefectInfo" lang="ts">
|
||||
import { listDefectInfo, getDefectInfo, delDefectInfo, addDefectInfo, updateDefectInfo } from '@/api/qms/defectInfo';
|
||||
import { DefectInfoVO, DefectInfoQuery, DefectInfoForm } from '@/api/qms/defectInfo/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { defect_status } = toRefs<any>(proxy?.useDict('defect_status'));
|
||||
const defectInfoList = ref<DefectInfoVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const defectInfoFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
// 列显隐信息
|
||||
const columns = ref<FieldOption[]>([
|
||||
{ key: 0, label: `主键标识`, visible: true },
|
||||
{ key: 1, label: `病疵名称`, visible: true },
|
||||
{ key: 2, label: `病疵类型`, visible: true },
|
||||
{ key: 3, label: `状态`, visible: true },
|
||||
{ key: 4, label: `工序`, visible: true },
|
||||
{ key: 5, label: `是否删除`, visible: true },
|
||||
{ key: 6, label: `预留字段`, visible: true },
|
||||
{ key: 7, label: `预留字段`, visible: true },
|
||||
{ key: 8, label: `预留字段`, visible: true },
|
||||
{ key: 9, label: `预留字段`, visible: true },
|
||||
{ key: 10, label: `创建者`, visible: true },
|
||||
{ key: 11, label: `创建时间`, visible: true },
|
||||
{ key: 12, label: `更新者`, visible: true },
|
||||
{ key: 13, label: `更新时间`, visible: true },
|
||||
]);
|
||||
|
||||
const initFormData: DefectInfoForm = {
|
||||
defectName: undefined,
|
||||
defectType: undefined,
|
||||
status: undefined,
|
||||
operation: undefined,
|
||||
}
|
||||
const data = reactive<PageData<DefectInfoForm, DefectInfoQuery>>({
|
||||
form: {...initFormData},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
defectName: undefined,
|
||||
defectType: undefined,
|
||||
status: undefined,
|
||||
operation: undefined,
|
||||
params: {
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
defectName: [
|
||||
{ required: true, message: "病疵名称不能为空", trigger: "blur" }
|
||||
],
|
||||
defectType: [
|
||||
{ required: true, message: "病疵类型不能为空", trigger: "blur" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "状态不能为空", trigger: "blur" }
|
||||
],
|
||||
operation: [
|
||||
{ required: true, message: "工序不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询病疵信息列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listDefectInfo(queryParams.value);
|
||||
defectInfoList.value = res.data;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
}
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = {...initFormData};
|
||||
defectInfoFormRef.value?.resetFields();
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: DefectInfoVO[]) => {
|
||||
ids.value = selection.map(item => item.defectId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = "添加病疵信息";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: DefectInfoVO) => {
|
||||
reset();
|
||||
const _defectId = row?.defectId || ids.value[0]
|
||||
const res = await getDefectInfo(_defectId);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = "修改病疵信息";
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
defectInfoFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.defectId) {
|
||||
await updateDefectInfo(form.value).finally(() => buttonLoading.value = false);
|
||||
} else {
|
||||
await addDefectInfo(form.value).finally(() => buttonLoading.value = false);
|
||||
}
|
||||
proxy?.$modal.msgSuccess("操作成功");
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: DefectInfoVO) => {
|
||||
const _defectIds = row?.defectId || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除病疵信息编号为"' + _defectIds + '"的数据项?').finally(() => loading.value = false);
|
||||
await delDefectInfo(_defectIds);
|
||||
proxy?.$modal.msgSuccess("删除成功");
|
||||
await getList();
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download('qms/defectInfo/export', {
|
||||
...queryParams.value
|
||||
}, `defectInfo_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
@ -0,0 +1,273 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="规格编码" prop="speCode">
|
||||
<el-input v-model="queryParams.speCode" placeholder="请输入规格编码" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="规格名称" prop="speName">
|
||||
<el-input v-model="queryParams.speName" placeholder="请输入规格名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="动平衡质检标准" prop="dynamicStandard">
|
||||
<el-input v-model="queryParams.dynamicStandard" placeholder="请输入动平衡质检标准" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="X光质检标准" prop="xrayStandard">
|
||||
<el-input v-model="queryParams.xrayStandard" placeholder="请输入X光质检标准" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="均匀性质检标准" prop="uniformityStandard">
|
||||
<el-input v-model="queryParams.uniformityStandard" placeholder="请输入均匀性质检标准" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['qms:dynamicStandard:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['qms:dynamicStandard:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['qms:dynamicStandard:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['qms:dynamicStandard:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="true" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="dynamicStandardList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="规格编码" align="center" prop="speCode" v-if="columns[2].visible"/>
|
||||
<el-table-column label="规格名称" align="center" prop="speName" v-if="columns[3].visible"/>
|
||||
<el-table-column label="动平衡质检标准" align="center" prop="dynamicStandard" v-if="columns[4].visible"/>
|
||||
<el-table-column label="X光质检标准" align="center" prop="xrayStandard" v-if="columns[5].visible"/>
|
||||
<el-table-column label="均匀性质检标准" align="center" prop="uniformityStandard" v-if="columns[6].visible"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['qms:dynamicStandard:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['qms:dynamicStandard:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改动均质检标准维护对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="dynamicStandardFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="规格编码" prop="speCode">
|
||||
<el-input v-model="form.speCode" placeholder="请输入规格编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="规格名称" prop="speName">
|
||||
<el-input v-model="form.speName" placeholder="请输入规格名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="动平衡质检标准" prop="dynamicStandard">
|
||||
<el-input v-model="form.dynamicStandard" placeholder="请输入动平衡质检标准" />
|
||||
</el-form-item>
|
||||
<el-form-item label="X光质检标准" prop="xrayStandard">
|
||||
<el-input v-model="form.xrayStandard" placeholder="请输入X光质检标准" />
|
||||
</el-form-item>
|
||||
<el-form-item label="均匀性质检标准" prop="uniformityStandard">
|
||||
<el-input v-model="form.uniformityStandard" placeholder="请输入均匀性质检标准" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="DynamicStandard" lang="ts">
|
||||
import { listDynamicStandard, getDynamicStandard, delDynamicStandard, addDynamicStandard, updateDynamicStandard } from '@/api/qms/dynamicStandard';
|
||||
import { DynamicStandardVO, DynamicStandardQuery, DynamicStandardForm } from '@/api/qms/dynamicStandard/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const dynamicStandardList = ref<DynamicStandardVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const dynamicStandardFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
// 列显隐信息
|
||||
const columns = ref<FieldOption[]>([
|
||||
{ key: 0, label: `主键标识`, visible: true },
|
||||
{ key: 1, label: `租户号`, visible: true },
|
||||
{ key: 2, label: `规格编码`, visible: true },
|
||||
{ key: 3, label: `规格名称`, visible: true },
|
||||
{ key: 4, label: `动平衡质检标准`, visible: true },
|
||||
{ key: 5, label: `X光质检标准`, visible: true },
|
||||
{ key: 6, label: `均匀性质检标准`, visible: true },
|
||||
{ key: 7, label: `预留字段`, visible: true },
|
||||
{ key: 8, label: `预留字段`, visible: true },
|
||||
{ key: 9, label: `预留字段`, visible: true },
|
||||
{ key: 10, label: `预留字段`, visible: true },
|
||||
{ key: 11, label: `创建部门`, visible: true },
|
||||
{ key: 12, label: `创建人`, visible: true },
|
||||
{ key: 13, label: `创建时间`, visible: true },
|
||||
{ key: 14, label: `更新人`, visible: true },
|
||||
{ key: 15, label: `更新时间`, visible: true },
|
||||
]);
|
||||
|
||||
const initFormData: DynamicStandardForm = {
|
||||
standardId: undefined,
|
||||
speCode: undefined,
|
||||
speName: undefined,
|
||||
dynamicStandard: undefined,
|
||||
xrayStandard: undefined,
|
||||
uniformityStandard: undefined,
|
||||
attr1: undefined,
|
||||
attr2: undefined,
|
||||
attr3: undefined,
|
||||
attr4: undefined,
|
||||
}
|
||||
const data = reactive<PageData<DynamicStandardForm, DynamicStandardQuery>>({
|
||||
form: {...initFormData},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
speCode: undefined,
|
||||
speName: undefined,
|
||||
dynamicStandard: undefined,
|
||||
xrayStandard: undefined,
|
||||
uniformityStandard: undefined,
|
||||
params: {
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
speCode: [
|
||||
{ required: true, message: "规格编码不能为空", trigger: "blur" }
|
||||
],
|
||||
speName: [
|
||||
{ required: true, message: "规格名称不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询动均质检标准维护列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listDynamicStandard(queryParams.value);
|
||||
dynamicStandardList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
}
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = {...initFormData};
|
||||
dynamicStandardFormRef.value?.resetFields();
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: DynamicStandardVO[]) => {
|
||||
ids.value = selection.map(item => item.standardId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = "添加动均质检标准维护";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: DynamicStandardVO) => {
|
||||
reset();
|
||||
const _standardId = row?.standardId || ids.value[0]
|
||||
const res = await getDynamicStandard(_standardId);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = "修改动均质检标准维护";
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
dynamicStandardFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.standardId) {
|
||||
await updateDynamicStandard(form.value).finally(() => buttonLoading.value = false);
|
||||
} else {
|
||||
await addDynamicStandard(form.value).finally(() => buttonLoading.value = false);
|
||||
}
|
||||
proxy?.$modal.msgSuccess("操作成功");
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: DynamicStandardVO) => {
|
||||
const _standardIds = row?.standardId || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除动均质检标准维护编号为"' + _standardIds + '"的数据项?').finally(() => loading.value = false);
|
||||
await delDynamicStandard(_standardIds);
|
||||
proxy?.$modal.msgSuccess("删除成功");
|
||||
await getList();
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download('qms/dynamicStandard/export', {
|
||||
...queryParams.value
|
||||
}, `dynamicStandard_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
@ -0,0 +1,317 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="品级编码" prop="gradeCode">
|
||||
<el-input v-model="queryParams.gradeCode" placeholder="请输入品级编码" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="品级名称" prop="gradeName">
|
||||
<el-input v-model="queryParams.gradeName" placeholder="请输入品级名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工序编码" prop="operationCode">
|
||||
<el-input v-model="queryParams.operationCode" placeholder="请输入工序编码" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工序名称" prop="operationName">
|
||||
<el-input v-model="queryParams.operationName" placeholder="请输入工序名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="车间/工程" prop="workshop" label-width="100px" >
|
||||
<el-select v-model="queryParams.workshop" placeholder="请输入车间/工程" clearable>
|
||||
<el-option v-for="dict in workshop_engineering" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable >
|
||||
<el-option v-for="dict in enable_status" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['qms:gradeInfo:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['qms:gradeInfo:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['qms:gradeInfo:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['qms:gradeInfo:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="true" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="gradeInfoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="品级编码" align="center" prop="gradeCode" v-if="columns[2].visible"/>
|
||||
<el-table-column label="品级名称" align="center" prop="gradeName" v-if="columns[3].visible"/>
|
||||
<el-table-column label="工序编码" align="center" prop="operationCode" v-if="columns[4].visible"/>
|
||||
<el-table-column label="工序名称" align="center" prop="operationName" v-if="columns[5].visible"/>
|
||||
<el-table-column label="车间/工程" align="center" prop="workshop" v-if="columns[6].visible">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="workshop_engineering" :value="scope.row.workshop"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="排序" align="center" prop="sort" v-if="columns[7].visible"/>
|
||||
<el-table-column label="状态" align="center" prop="status" v-if="columns[8].visible">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="enable_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['qms:gradeInfo:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['qms:gradeInfo:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改品级信息对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="gradeInfoFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="品级编码" prop="gradeCode">
|
||||
<el-input v-model="form.gradeCode" placeholder="请输入品级编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="品级名称" prop="gradeName">
|
||||
<el-input v-model="form.gradeName" placeholder="请输入品级名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工序编码" prop="operationCode">
|
||||
<el-input v-model="form.operationCode" placeholder="请输入工序编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工序名称" prop="operationName">
|
||||
<el-input v-model="form.operationName" placeholder="请输入工序名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="车间/工程" prop="workshop">
|
||||
<el-select v-model="form.workshop" placeholder="车间/工程">
|
||||
<el-option v-for="item in workshop_engineering" :key="item.id" :value="item.value" :label="item.label"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input-number v-model="form.sort" placeholder="请输入排序" :min="1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="form.status" placeholder="请选择状态">
|
||||
<el-option
|
||||
v-for="dict in enable_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="GradeInfo" lang="ts">
|
||||
import { listGradeInfo, getGradeInfo, delGradeInfo, addGradeInfo, updateGradeInfo } from '@/api/qms/gradeInfo';
|
||||
import { GradeInfoVO, GradeInfoQuery, GradeInfoForm } from '@/api/qms/gradeInfo/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { enable_status,workshop_engineering } = toRefs<any>(proxy?.useDict('enable_status','workshop_engineering'));
|
||||
|
||||
const gradeInfoList = ref<GradeInfoVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const gradeInfoFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
// 列显隐信息
|
||||
const columns = ref<FieldOption[]>([
|
||||
{ key: 0, label: `品级主键`, visible: true },
|
||||
{ key: 1, label: `租户号`, visible: true },
|
||||
{ key: 2, label: `品级编码`, visible: true },
|
||||
{ key: 3, label: `品级名称`, visible: true },
|
||||
{ key: 4, label: `工序编码`, visible: true },
|
||||
{ key: 5, label: `工序名称`, visible: true },
|
||||
{ key: 6, label: `车间/工程`, visible: true },
|
||||
{ key: 7, label: `排序`, visible: true },
|
||||
{ key: 8, label: `状态`, visible: true },
|
||||
{ key: 9, label: `预留字段`, visible: true },
|
||||
{ key: 10, label: `预留字段`, visible: true },
|
||||
{ key: 11, label: `预留字段`, visible: true },
|
||||
{ key: 12, label: `创建部门`, visible: true },
|
||||
{ key: 13, label: `创建人`, visible: true },
|
||||
{ key: 14, label: `创建时间`, visible: true },
|
||||
{ key: 15, label: `更新人`, visible: true },
|
||||
{ key: 16, label: `更新时间`, visible: true },
|
||||
]);
|
||||
|
||||
const initFormData: GradeInfoForm = {
|
||||
gradeId: undefined,
|
||||
gradeCode: undefined,
|
||||
gradeName: undefined,
|
||||
operationCode: undefined,
|
||||
operationName: undefined,
|
||||
workshop: undefined,
|
||||
sort: undefined,
|
||||
status: '1',
|
||||
}
|
||||
const data = reactive<PageData<GradeInfoForm, GradeInfoQuery>>({
|
||||
form: {...initFormData},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
gradeCode: undefined,
|
||||
gradeName: undefined,
|
||||
operationCode: undefined,
|
||||
operationName: undefined,
|
||||
workshop: undefined,
|
||||
sort: undefined,
|
||||
status: undefined,
|
||||
params: {
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
|
||||
gradeCode: [
|
||||
{ required: true, message: "品级编码不能为空", trigger: "blur" }
|
||||
],
|
||||
gradeName: [
|
||||
{ required: true, message: "品级名称不能为空", trigger: "blur" }
|
||||
],
|
||||
workshop: [
|
||||
{ required: true, message: "车间/工程不能为空", trigger: "blur" }
|
||||
],
|
||||
sort: [
|
||||
{ required: true, message: "排序不能为空", trigger: "blur" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "状态不能为空", trigger: "change" }
|
||||
],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询品级信息列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listGradeInfo(queryParams.value);
|
||||
gradeInfoList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
}
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = {...initFormData};
|
||||
gradeInfoFormRef.value?.resetFields();
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: GradeInfoVO[]) => {
|
||||
ids.value = selection.map(item => item.gradeId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = "添加品级信息";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: GradeInfoVO) => {
|
||||
reset();
|
||||
const _gradeId = row?.gradeId || ids.value[0]
|
||||
const res = await getGradeInfo(_gradeId);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = "修改品级信息";
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
gradeInfoFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.gradeId) {
|
||||
await updateGradeInfo(form.value).finally(() => buttonLoading.value = false);
|
||||
} else {
|
||||
await addGradeInfo(form.value).finally(() => buttonLoading.value = false);
|
||||
}
|
||||
proxy?.$modal.msgSuccess("操作成功");
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: GradeInfoVO) => {
|
||||
const _gradeIds = row?.gradeId || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除品级信息编号为"' + _gradeIds + '"的数据项?').finally(() => loading.value = false);
|
||||
await delGradeInfo(_gradeIds);
|
||||
proxy?.$modal.msgSuccess("删除成功");
|
||||
await getList();
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download('qms/gradeInfo/export', {
|
||||
...queryParams.value
|
||||
}, `gradeInfo_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
@ -0,0 +1,309 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="项目名称" prop="itemDesc">
|
||||
<el-input v-model="queryParams.itemDesc" placeholder="请输入项目名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目属性" prop="propertyCode">
|
||||
<el-select v-model="queryParams.propertyCode" placeholder="请选择项目属性" clearable >
|
||||
<el-option v-for="dict in inspection_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="检验工具" prop="inspectionTool">
|
||||
<el-input v-model="queryParams.inspectionTool" placeholder="请输入检验工具" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable >
|
||||
<el-option v-for="dict in enable_status" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['qms:inspectionItems:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['qms:inspectionItems:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['qms:inspectionItems:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['qms:inspectionItems:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="true" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="inspectionItemsList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="项目名称" align="center" prop="itemDesc" v-if="columns[2].visible"/>
|
||||
<el-table-column label="项目属性" align="center" prop="propertyCode" v-if="columns[3].visible">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="inspection_type" :value="scope.row.propertyCode"/>
|
||||
</template>
|
||||
</el-table-column>>
|
||||
<el-table-column label="检验工具/设备" align="center" prop="inspectionTool" v-if="columns[5].visible"/>
|
||||
<el-table-column label="标准值" align="center" prop="attr1" v-if="columns[6].visible"/>
|
||||
<el-table-column label="上限值" align="center" prop="upperLimit" v-if="columns[6].visible"/>
|
||||
<el-table-column label="下限值" align="center" prop="lowerLimit" v-if="columns[7].visible"/>
|
||||
<el-table-column label="状态" align="center" prop="status" v-if="columns[8].visible">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="enable_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['qms:inspectionItems:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['qms:inspectionItems:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改检验项目对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="inspectionItemsFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
|
||||
<el-form-item label="项目名称" prop="itemDesc">
|
||||
<el-input v-model="form.itemDesc" placeholder="请输入项目名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目属性" prop="propertyCode">
|
||||
<el-radio-group v-model="form.propertyCode">
|
||||
<el-radio
|
||||
v-for="dict in inspection_type"
|
||||
:key="dict.value"
|
||||
:value="dict.value"
|
||||
>{{dict.label}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="检验工具" prop="inspectionTool">
|
||||
<el-input v-model="form.inspectionTool" placeholder="请输入检验工具/设备" />
|
||||
</el-form-item>
|
||||
<el-form-item label="标准值" v-if="form.propertyCode === '1'" prop="attr1">
|
||||
<el-input-number v-model="form.attr1" placeholder="请输入上限值" :min="0" :precision="2" :step="0.01"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="上限值" v-if="form.propertyCode === '1'" prop="upperLimit">
|
||||
<el-input-number v-model="form.upperLimit" placeholder="请输入上限值" :min="0" :precision="2" :step="0.01"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="下限值" v-if="form.propertyCode === '1'" prop="lowerLimit">
|
||||
<el-input-number v-model="form.lowerLimit" placeholder="请输入下限值" :min="0" :precision="2" :step="0.01"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
v-for="dict in enable_status"
|
||||
:key="dict.value"
|
||||
:value="dict.value"
|
||||
>{{dict.label}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="InspectionItems" lang="ts">
|
||||
import { listInspectionItems, getInspectionItems, delInspectionItems, addInspectionItems, updateInspectionItems } from '@/api/qms/inspectionItems';
|
||||
import { InspectionItemsVO, InspectionItemsQuery, InspectionItemsForm } from '@/api/qms/inspectionItems/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { enable_status,inspection_type } = toRefs<any>(proxy?.useDict('enable_status','inspection_type'));
|
||||
|
||||
const inspectionItemsList = ref<InspectionItemsVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const inspectionItemsFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
// 列显隐信息
|
||||
const columns = ref<FieldOption[]>([
|
||||
{ key: 0, label: `检验项目主键`, visible: true },
|
||||
{ key: 1, label: `租户编号`, visible: true },
|
||||
{ key: 2, label: `项目名称`, visible: true },
|
||||
{ key: 3, label: `检验规则属性编码`, visible: true },
|
||||
{ key: 4, label: `检验方式`, visible: true },
|
||||
{ key: 5, label: `检验工具/设备`, visible: true },
|
||||
{ key: 6, label: `上限值`, visible: true },
|
||||
{ key: 7, label: `下限值`, visible: true },
|
||||
{ key: 8, label: `状态`, visible: true },
|
||||
{ key: 9, label: `是否标识`, visible: true },
|
||||
{ key: 10, label: `预留字段`, visible: true },
|
||||
{ key: 11, label: `预留字段`, visible: true },
|
||||
{ key: 12, label: `预留字段`, visible: true },
|
||||
{ key: 13, label: `预留字段`, visible: true },
|
||||
{ key: 14, label: `创建人`, visible: true },
|
||||
{ key: 15, label: `创建时间`, visible: true },
|
||||
{ key: 16, label: `更新人`, visible: true },
|
||||
{ key: 17, label: `更新时间`, visible: true },
|
||||
]);
|
||||
|
||||
const initFormData: InspectionItemsForm = {
|
||||
inspectionItemId: undefined,
|
||||
itemDesc: undefined,
|
||||
propertyCode: undefined,
|
||||
inspectionMode: undefined,
|
||||
inspectionTool: undefined,
|
||||
upperLimit: undefined,
|
||||
lowerLimit: undefined,
|
||||
status: undefined,
|
||||
}
|
||||
const data = reactive<PageData<InspectionItemsForm, InspectionItemsQuery>>({
|
||||
form: {...initFormData},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
itemDesc: undefined,
|
||||
propertyCode: undefined,
|
||||
inspectionMode: undefined,
|
||||
inspectionTool: undefined,
|
||||
upperLimit: undefined,
|
||||
lowerLimit: undefined,
|
||||
status: undefined,
|
||||
params: {
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
itemDesc: [
|
||||
{ required: true, message: "项目名称不能为空", trigger: "blur" }
|
||||
],
|
||||
propertyCode: [
|
||||
{ required: true, message: "检验规则属性编码不能为空", trigger: "blur" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "状态不能为空", trigger: "change" }
|
||||
],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询检验项目列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listInspectionItems(queryParams.value);
|
||||
inspectionItemsList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
}
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = {...initFormData};
|
||||
inspectionItemsFormRef.value?.resetFields();
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: InspectionItemsVO[]) => {
|
||||
ids.value = selection.map(item => item.inspectionItemId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = "添加检验项目";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: InspectionItemsVO) => {
|
||||
reset();
|
||||
const _inspectionItemId = row?.inspectionItemId || ids.value[0]
|
||||
const res = await getInspectionItems(_inspectionItemId);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = "修改检验项目";
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
inspectionItemsFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.inspectionItemId) {
|
||||
await updateInspectionItems(form.value).finally(() => buttonLoading.value = false);
|
||||
} else {
|
||||
await addInspectionItems(form.value).finally(() => buttonLoading.value = false);
|
||||
}
|
||||
proxy?.$modal.msgSuccess("操作成功");
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: InspectionItemsVO) => {
|
||||
const _inspectionItemIds = row?.inspectionItemId || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除检验项目编号为"' + _inspectionItemIds + '"的数据项?').finally(() => loading.value = false);
|
||||
await delInspectionItems(_inspectionItemIds);
|
||||
proxy?.$modal.msgSuccess("删除成功");
|
||||
await getList();
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download('qms/inspectionItems/export', {
|
||||
...queryParams.value
|
||||
}, `inspectionItems_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
@ -0,0 +1,305 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="等级编码" prop="levelCode">
|
||||
<el-input v-model="queryParams.levelCode" placeholder="请输入等级编码" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="等级名称" prop="levelName">
|
||||
<el-input v-model="queryParams.levelName" placeholder="请输入等级名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工序编码" prop="operationCode">
|
||||
<el-input v-model="queryParams.operationCode" placeholder="请输入工序编码" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工序名称" prop="operationName">
|
||||
<el-input v-model="queryParams.operationName" placeholder="请输入工序名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="车间" prop="workshop">
|
||||
<el-input v-model="queryParams.workshop" placeholder="请输入车间" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable >
|
||||
<el-option v-for="dict in enable_status" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['qms:levelInfo:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['qms:levelInfo:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['qms:levelInfo:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['qms:levelInfo:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="true" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="levelInfoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="等级编码" align="center" prop="levelCode" v-if="columns[2].visible"/>
|
||||
<el-table-column label="等级名称" align="center" prop="levelName" v-if="columns[3].visible"/>
|
||||
<el-table-column label="工序编码" align="center" prop="operationCode" v-if="columns[4].visible"/>
|
||||
<el-table-column label="工序名称" align="center" prop="operationName" v-if="columns[5].visible"/>
|
||||
<el-table-column label="车间" align="center" prop="workshop" v-if="columns[6].visible"/>
|
||||
<el-table-column label="状态" align="center" prop="status" v-if="columns[10].visible">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="enable_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" v-if="columns[11].visible"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['qms:levelInfo:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['qms:levelInfo:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改层级信息对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="levelInfoFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="等级编码" prop="levelCode">
|
||||
<el-input v-model="form.levelCode" placeholder="请输入等级编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="等级名称" prop="levelName">
|
||||
<el-input v-model="form.levelName" placeholder="请输入等级名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工序编码" prop="operationCode">
|
||||
<el-input v-model="form.operationCode" placeholder="请输入工序编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工序名称" prop="operationName">
|
||||
<el-input v-model="form.operationName" placeholder="请输入工序名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="车间" prop="workshop">
|
||||
<el-input v-model="form.workshop" placeholder="请输入车间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="form.status" placeholder="请选择状态">
|
||||
<el-option
|
||||
v-for="dict in enable_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="LevelInfo" lang="ts">
|
||||
import { listLevelInfo, getLevelInfo, delLevelInfo, addLevelInfo, updateLevelInfo } from '@/api/qms/levelInfo';
|
||||
import { LevelInfoVO, LevelInfoQuery, LevelInfoForm } from '@/api/qms/levelInfo/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { enable_status } = toRefs<any>(proxy?.useDict('enable_status'));
|
||||
|
||||
const levelInfoList = ref<LevelInfoVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const levelInfoFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
// 列显隐信息
|
||||
const columns = ref<FieldOption[]>([
|
||||
{ key: 0, label: `等级主键`, visible: true },
|
||||
{ key: 1, label: `租户号`, visible: true },
|
||||
{ key: 2, label: `等级编码`, visible: true },
|
||||
{ key: 3, label: `等级名称`, visible: true },
|
||||
{ key: 4, label: `工序编码`, visible: true },
|
||||
{ key: 5, label: `工序名称`, visible: true },
|
||||
{ key: 6, label: `车间`, visible: true },
|
||||
{ key: 7, label: `预留字段`, visible: true },
|
||||
{ key: 8, label: `预留字段`, visible: true },
|
||||
{ key: 9, label: `预留字段`, visible: true },
|
||||
{ key: 10, label: `状态`, visible: true },
|
||||
{ key: 11, label: `备注`, visible: true },
|
||||
{ key: 12, label: `创建部门`, visible: true },
|
||||
{ key: 13, label: `创建人`, visible: true },
|
||||
{ key: 14, label: `创建时间`, visible: true },
|
||||
{ key: 15, label: `更新人`, visible: true },
|
||||
{ key: 16, label: `更新时间`, visible: true },
|
||||
]);
|
||||
|
||||
const initFormData: LevelInfoForm = {
|
||||
levelId: undefined,
|
||||
levelCode: undefined,
|
||||
levelName: undefined,
|
||||
operationCode: undefined,
|
||||
operationName: undefined,
|
||||
workshop: undefined,
|
||||
status: '1',
|
||||
remark: undefined,
|
||||
}
|
||||
const data = reactive<PageData<LevelInfoForm, LevelInfoQuery>>({
|
||||
form: {...initFormData},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
levelId: undefined,
|
||||
levelCode: undefined,
|
||||
levelName: undefined,
|
||||
operationCode: undefined,
|
||||
operationName: undefined,
|
||||
workshop: undefined,
|
||||
status: undefined,
|
||||
params: {
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
levelCode: [
|
||||
{ required: true, message: "等级编码不能为空", trigger: "blur" }
|
||||
],
|
||||
levelName: [
|
||||
{ required: true, message: "等级名称不能为空", trigger: "blur" }
|
||||
],
|
||||
workshop: [
|
||||
{ required: true, message: "车间不能为空", trigger: "blur" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "状态不能为空", trigger: "change" }
|
||||
],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询层级信息列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listLevelInfo(queryParams.value);
|
||||
levelInfoList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
}
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = {...initFormData};
|
||||
levelInfoFormRef.value?.resetFields();
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: LevelInfoVO[]) => {
|
||||
ids.value = selection.map(item => item.levelId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = "添加层级信息";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: LevelInfoVO) => {
|
||||
reset();
|
||||
const _levelId = row?.levelId || ids.value[0]
|
||||
const res = await getLevelInfo(_levelId);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = "修改层级信息";
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
levelInfoFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.levelId) {
|
||||
await updateLevelInfo(form.value).finally(() => buttonLoading.value = false);
|
||||
} else {
|
||||
await addLevelInfo(form.value).finally(() => buttonLoading.value = false);
|
||||
}
|
||||
proxy?.$modal.msgSuccess("操作成功");
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: LevelInfoVO) => {
|
||||
const _levelIds = row?.levelId || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除层级信息编号为"' + _levelIds + '"的数据项?').finally(() => loading.value = false);
|
||||
await delLevelInfo(_levelIds);
|
||||
proxy?.$modal.msgSuccess("删除成功");
|
||||
await getList();
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download('qms/levelInfo/export', {
|
||||
...queryParams.value
|
||||
}, `levelInfo_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
@ -0,0 +1,238 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="原因编码" prop="revisionCode">
|
||||
<el-input v-model="queryParams.revisionCode" placeholder="请输入原因编码" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="原因描述" prop="revisionDesc">
|
||||
<el-input v-model="queryParams.revisionDesc" placeholder="请输入原因描述" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['qms:revisionInfo:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['qms:revisionInfo:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['qms:revisionInfo:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['qms:revisionInfo:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="true" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="revisionInfoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="原因编码" align="center" prop="revisionCode" v-if="columns[2].visible"/>
|
||||
<el-table-column label="原因描述" align="center" prop="revisionDesc" v-if="columns[3].visible"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['qms:revisionInfo:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['qms:revisionInfo:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改改判原因信息对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="revisionInfoFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="原因编码" prop="revisionCode">
|
||||
<el-input v-model="form.revisionCode" placeholder="请输入原因编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="原因描述" prop="revisionDesc">
|
||||
<el-input v-model="form.revisionDesc" placeholder="请输入原因描述" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="RevisionInfo" lang="ts">
|
||||
import { listRevisionInfo, getRevisionInfo, delRevisionInfo, addRevisionInfo, updateRevisionInfo } from '@/api/qms/revisionInfo';
|
||||
import { RevisionInfoVO, RevisionInfoQuery, RevisionInfoForm } from '@/api/qms/revisionInfo/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const revisionInfoList = ref<RevisionInfoVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const revisionInfoFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
// 列显隐信息
|
||||
const columns = ref<FieldOption[]>([
|
||||
{ key: 0, label: `主键标识`, visible: true },
|
||||
{ key: 1, label: `租户号`, visible: true },
|
||||
{ key: 2, label: `原因编码`, visible: true },
|
||||
{ key: 3, label: `原因描述`, visible: true },
|
||||
{ key: 4, label: `预留字段`, visible: true },
|
||||
{ key: 5, label: `预留字段`, visible: true },
|
||||
{ key: 6, label: `预留字段`, visible: true },
|
||||
{ key: 7, label: `预留字段`, visible: true },
|
||||
{ key: 8, label: `创建部门`, visible: true },
|
||||
{ key: 9, label: `创建人`, visible: true },
|
||||
{ key: 10, label: `创建时间`, visible: true },
|
||||
{ key: 11, label: `更新人`, visible: true },
|
||||
{ key: 12, label: `更新时间`, visible: true },
|
||||
]);
|
||||
|
||||
const initFormData: RevisionInfoForm = {
|
||||
revisionCode: undefined,
|
||||
revisionDesc: undefined,
|
||||
}
|
||||
const data = reactive<PageData<RevisionInfoForm, RevisionInfoQuery>>({
|
||||
form: {...initFormData},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
revisionCode: undefined,
|
||||
revisionDesc: undefined,
|
||||
params: {
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
revisionCode: [
|
||||
{ required: true, message: "原因编码不能为空", trigger: "blur" }
|
||||
],
|
||||
revisionDesc: [
|
||||
{ required: true, message: "原因描述不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询改判原因信息列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listRevisionInfo(queryParams.value);
|
||||
revisionInfoList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
}
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = {...initFormData};
|
||||
revisionInfoFormRef.value?.resetFields();
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: RevisionInfoVO[]) => {
|
||||
ids.value = selection.map(item => item.revisionId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = "添加改判原因信息";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: RevisionInfoVO) => {
|
||||
reset();
|
||||
const _revisionId = row?.revisionId || ids.value[0]
|
||||
const res = await getRevisionInfo(_revisionId);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = "修改改判原因信息";
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
revisionInfoFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.revisionId) {
|
||||
await updateRevisionInfo(form.value).finally(() => buttonLoading.value = false);
|
||||
} else {
|
||||
await addRevisionInfo(form.value).finally(() => buttonLoading.value = false);
|
||||
}
|
||||
proxy?.$modal.msgSuccess("操作成功");
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: RevisionInfoVO) => {
|
||||
const _revisionIds = row?.revisionId || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除改判原因信息编号为"' + _revisionIds + '"的数据项?').finally(() => loading.value = false);
|
||||
await delRevisionInfo(_revisionIds);
|
||||
proxy?.$modal.msgSuccess("删除成功");
|
||||
await getList();
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download('qms/revisionInfo/export', {
|
||||
...queryParams.value
|
||||
}, `revisionInfo_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
@ -0,0 +1,259 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="轮辋编码" prop="rimCode">
|
||||
<el-input v-model="queryParams.rimCode" placeholder="请输入轮辋编码" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="轮辋名称" prop="rimName">
|
||||
<el-input v-model="queryParams.rimName" placeholder="请输入轮辋名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="轮辋直径" prop="rimDiameter">
|
||||
<el-input v-model="queryParams.rimDiameter" placeholder="请输入轮辋直径" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['qms:rimInfo:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['qms:rimInfo:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['qms:rimInfo:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['qms:rimInfo:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="true" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="rimInfoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="轮辋编码" align="center" prop="rimCode" v-if="columns[2].visible"/>
|
||||
<el-table-column label="轮辋名称" align="center" prop="rimName" v-if="columns[3].visible"/>
|
||||
<el-table-column label="轮辋直径" align="center" prop="rimDiameter" v-if="columns[4].visible"/>
|
||||
<el-table-column label="备注" align="center" prop="remark" v-if="columns[5].visible"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['qms:rimInfo:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['qms:rimInfo:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改轮辋信息对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="rimInfoFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="轮辋编码" prop="rimCode">
|
||||
<el-input v-model="form.rimCode" placeholder="请输入轮辋编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="轮辋名称" prop="rimName">
|
||||
<el-input v-model="form.rimName" placeholder="请输入轮辋名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="轮辋直径" prop="rimDiameter">
|
||||
<el-input-number v-model="form.rimDiameter" placeholder="请输入轮辋直径" :min="0" :precision="2" :step="0.01" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="RimInfo" lang="ts">
|
||||
import { listRimInfo, getRimInfo, delRimInfo, addRimInfo, updateRimInfo } from '@/api/qms/rimInfo';
|
||||
import { RimInfoVO, RimInfoQuery, RimInfoForm } from '@/api/qms/rimInfo/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const rimInfoList = ref<RimInfoVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const rimInfoFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
// 列显隐信息
|
||||
const columns = ref<FieldOption[]>([
|
||||
{ key: 0, label: `轮辋主键`, visible: true },
|
||||
{ key: 1, label: `租户号`, visible: true },
|
||||
{ key: 2, label: `轮辋编码`, visible: true },
|
||||
{ key: 3, label: `轮辋名称`, visible: true },
|
||||
{ key: 4, label: `轮辋直径`, visible: true },
|
||||
{ key: 5, label: `备注`, visible: true },
|
||||
{ key: 6, label: `预留字段`, visible: true },
|
||||
{ key: 7, label: `预留字段`, visible: true },
|
||||
{ key: 8, label: `预留字段`, visible: true },
|
||||
{ key: 9, label: `创建人`, visible: true },
|
||||
{ key: 10, label: `创建时间`, visible: true },
|
||||
{ key: 11, label: `更新人`, visible: true },
|
||||
{ key: 12, label: `更新时间`, visible: true },
|
||||
]);
|
||||
|
||||
const initFormData: RimInfoForm = {
|
||||
rimId: undefined,
|
||||
rimCode: undefined,
|
||||
rimName: undefined,
|
||||
rimDiameter: undefined,
|
||||
remark: undefined,
|
||||
}
|
||||
const data = reactive<PageData<RimInfoForm, RimInfoQuery>>({
|
||||
form: {...initFormData},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
rimCode: undefined,
|
||||
rimName: undefined,
|
||||
rimDiameter: undefined,
|
||||
params: {
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
rimId: [
|
||||
{ required: true, message: "轮辋主键不能为空", trigger: "blur" }
|
||||
],
|
||||
rimCode: [
|
||||
{ required: true, message: "轮辋编码不能为空", trigger: "blur" }
|
||||
],
|
||||
rimName: [
|
||||
{ required: true, message: "轮辋名称不能为空", trigger: "blur" }
|
||||
],
|
||||
rimDiameter: [
|
||||
{ required: true, message: "轮辋直径不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询轮辋信息列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listRimInfo(queryParams.value);
|
||||
rimInfoList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
}
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = {...initFormData};
|
||||
rimInfoFormRef.value?.resetFields();
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: RimInfoVO[]) => {
|
||||
ids.value = selection.map(item => item.rimId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = "添加轮辋信息";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: RimInfoVO) => {
|
||||
reset();
|
||||
const _rimId = row?.rimId || ids.value[0]
|
||||
const res = await getRimInfo(_rimId);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = "修改轮辋信息";
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
rimInfoFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.rimId) {
|
||||
await updateRimInfo(form.value).finally(() => buttonLoading.value = false);
|
||||
} else {
|
||||
await addRimInfo(form.value).finally(() => buttonLoading.value = false);
|
||||
}
|
||||
proxy?.$modal.msgSuccess("操作成功");
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: RimInfoVO) => {
|
||||
const _rimIds = row?.rimId || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除轮辋信息编号为"' + _rimIds + '"的数据项?').finally(() => loading.value = false);
|
||||
await delRimInfo(_rimIds);
|
||||
proxy?.$modal.msgSuccess("删除成功");
|
||||
await getList();
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download('qms/rimInfo/export', {
|
||||
...queryParams.value
|
||||
}, `rimInfo_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
Loading…
Reference in New Issue