质量模块首次提交

master
Yangwl 2 months ago
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,211 @@
export interface DefectDetailVO {
/**
*
*/
defectDetailId: string | number;
/**
*
*/
defectCode: number;
/**
*
*/
defectDesc: string;
/**
*
*/
defectType: string;
/**
*
*/
sort: string;
/**
*
*/
operation: string;
/**
*
*/
defectLevel: string;
/**
* 0 1
*/
status: string;
/**
* 1 0
*/
isFlag: string;
/**
*
*/
attr1: string;
/**
*
*/
attr2: string;
/**
*
*/
attr3: string;
/**
*
*/
attr4: string;
}
export interface DefectDetailForm extends BaseEntity {
/**
*
*/
defectDetailId?: string | number;
/**
*
*/
defectCode?: number;
/**
*
*/
defectDesc?: string;
/**
*
*/
defectType?: string;
/**
*
*/
sort?: string;
/**
*
*/
operation?: string;
/**
*
*/
defectLevel?: string;
/**
* 0 1
*/
status?: string;
/**
* 1 0
*/
isFlag?: string;
/**
*
*/
attr1?: string;
/**
*
*/
attr2?: string;
/**
*
*/
attr3?: string;
/**
*
*/
attr4?: string;
}
export interface DefectDetailQuery extends PageQuery {
/**
*
*/
defectDetailId?: string | number;
/**
*
*/
defectCode?: number;
/**
*
*/
defectDesc?: string;
/**
*
*/
defectType?: string;
/**
*
*/
sort?: string;
/**
*
*/
operation?: string;
/**
*
*/
defectLevel?: string;
/**
* 0 1
*/
status?: string;
/**
* 1 0
*/
isFlag?: string;
/**
*
*/
attr1?: string;
/**
*
*/
attr2?: string;
/**
*
*/
attr3?: string;
/**
*
*/
attr4?: string;
/**
*
*/
params?: any;
}

@ -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,76 @@
export interface DefectInfoVO {
/**
*
*/
defectName: string;
/**
*
*/
defectType: number;
/**
* 0 1
*/
status: string;
/**
*
*/
operation: string;
}
export interface DefectInfoForm extends BaseEntity {
/**
*
*/
defectName?: string;
/**
*
*/
defectType?: number;
/**
* 0 1
*/
status?: string;
/**
*
*/
operation?: string;
}
export interface DefectInfoQuery extends PageQuery {
/**
*
*/
defectName?: string;
/**
*
*/
defectType?: number;
/**
* 0 1
*/
status?: string;
/**
*
*/
operation?: string;
/**
*
*/
params?: any;
}

@ -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,346 @@
export interface InspectionItemsVO {
/**
*
*/
inspectionItemId: string | number;
/**
*
*/
itemDesc: string;
/**
*
*/
itemDesc: string;
/**
* 0/1
*/
propertyCode: number;
/**
* 0/1
*/
propertyCode: number;
/**
*
*/
inspectionMode: string;
/**
*
*/
inspectionMode: string;
/**
* /
*/
inspectionTool: string;
/**
* /
*/
inspectionTool: string;
/**
*
*/
upperLimit: number;
/**
*
*/
upperLimit: number;
/**
*
*/
lowerLimit: number;
/**
*
*/
lowerLimit: number;
/**
* 1 0
*/
isFlag: string;
/**
*
*/
attr1: string;
/**
*
*/
attr2: string;
/**
*
*/
attr3: string;
/**
*
*/
attr4: string;
/**
*
*/
createBy: string;
/**
*
*/
createTime: string;
}
export interface InspectionItemsForm extends BaseEntity {
/**
*
*/
inspectionItemId?: string | number;
/**
*
*/
inspectionItemId?: string | number;
/**
*
*/
tenantId?: string | number;
/**
*
*/
itemDesc?: string;
/**
*
*/
itemDesc?: string;
/**
* 0/1
*/
propertyCode?: number;
/**
* 0/1
*/
propertyCode?: number;
/**
*
*/
inspectionMode?: string;
/**
*
*/
inspectionMode?: string;
/**
* /
*/
inspectionTool?: string;
/**
* /
*/
inspectionTool?: string;
/**
*
*/
upperLimit?: number;
/**
*
*/
upperLimit?: number;
/**
*
*/
lowerLimit?: number;
/**
*
*/
lowerLimit?: number;
/**
* 1 0
*/
isFlag?: string;
/**
* 1 0
*/
isFlag?: string;
/**
*
*/
attr1?: string;
/**
*
*/
attr1?: string;
/**
*
*/
attr2?: string;
/**
*
*/
attr2?: string;
/**
*
*/
attr3?: string;
/**
*
*/
attr3?: string;
/**
*
*/
attr4?: string;
/**
*
*/
attr4?: string;
/**
*
*/
createBy?: string;
/**
*
*/
updateBy?: string;
/**
*
*/
updateTime?: string;
}
export interface InspectionItemsQuery extends PageQuery {
/**
*
*/
inspectionItemId?: string | number;
/**
*
*/
itemDesc?: string;
/**
*
*/
itemDesc?: string;
/**
* 0/1
*/
propertyCode?: number;
/**
* 0/1
*/
propertyCode?: number;
/**
*
*/
inspectionMode?: string;
/**
*
*/
inspectionMode?: string;
/**
* /
*/
inspectionTool?: string;
/**
* /
*/
inspectionTool?: string;
/**
*
*/
upperLimit?: number;
/**
*
*/
lowerLimit?: number;
/**
* 1 0
*/
isFlag?: string;
/**
*
*/
attr1?: string;
/**
*
*/
attr2?: string;
/**
*
*/
attr3?: string;
/**
*
*/
attr4?: string;
/**
*
*/
createBy?: string;
/**
*
*/
createTime?: string;
/**
*
*/
params?: any;
}

@ -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,327 @@
<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="defectDesc">
<el-input v-model="queryParams.defectDesc" 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="hover">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button v-hasPermi="['system:dict:add']" type="primary" plain icon="Plus" @click="handleAdd"></el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:dict:edit']" type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()"></el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:dict:remove']" type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()">
删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:dict:export']" type="warning" plain icon="Download" @click="handleExport"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Close" @click="handleClose"></el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" :data="defectDetailList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="病疵编码" align="center" prop="defectCode" v-if="columns[1].visible"/>
<el-table-column label="病疵描述" align="center" prop="defectDesc" v-if="columns[2].visible"/>
<el-table-column label="病疵类型" align="center" prop="defectType" v-if="columns[3].visible"/>
<el-table-column label="半部件类型" align="center" prop="attr1" v-if="columns[5].visible"/>
<el-table-column label="备注" align="center" prop="remark" v-if="columns[6].visible"/>
<el-table-column label="状态" align="center" prop="status" v-if="columns[7].visible">
<template #default="scope">
<dict-tag :options="defect_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:defectDetail:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['qms:defectDetail:remove']"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" :total="total" @pagination="getList" />
</el-card>
<!-- 添加或修改参数配置对话框 -->
<el-dialog v-model="dialog.visible" :title="dialog.title" width="500px" append-to-body>
<el-form ref="defectDetailFormRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="类型" prop="defectType">
<el-input v-model="form.defectType" :disabled="true" />
</el-form-item>
<el-form-item label="病疵编码" prop="defectCode">
<el-input v-model="form.defectCode" placeholder="请输入病疵编码" />
</el-form-item>
<el-form-item label="病疵描述" prop="defectDesc">
<el-input v-model="form.defectDesc" placeholder="请输入病疵描述" />
</el-form-item>
<el-form-item label="所属工序" prop="listClass">
<el-select v-model="form.listClass">
<el-option
v-for="item in listClassOptions"
:key="item.value"
:label="item.label + '(' + item.value + ')'"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="半部件类型" prop="listClass">
<el-select v-model="form.HComponenType">
<el-option
v-for="item in HComponenTypelist"
:key="item.value"
:label="item.label + '(' + item.value + ')'"
:value="item.value"
></el-option>
</el-select>
</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 type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="DefectDetail" lang="ts">
import { listDefectDetail, getDefectDetail, delDefectDetail, addDefectDetail, updateDefectDetail } from '@/api/qms/defectDetail';
import { DefectDetailVO, DefectDetailQuery, DefectDetailForm } from '@/api/qms/defectDetail/types';
import { getType } from '@/api/system/dict/type';
import { getDefectInfo } from '@/api/qms/defectInfo';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { defect_status } = toRefs<any>(proxy?.useDict('defect_status'));
const defectDetailList = ref<DefectDetailVO[]>([]);
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 defaultDefectType = ref('');
const queryFormRef = ref<ElFormInstance>();
const defectDetailFormRef = ref<ElFormInstance>();
const route = useRoute();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
/** 查询病疵详细 */
const getTypes = async (defectId: string | number) => {
const { data } = await getDefectInfo(defectId);
console.log(data.defectType)
queryParams.value.defectType = data.defectType;
defaultDefectType.value = data.defectType;
getList();
};
const HComponenTypelist = [
{ value: 'bead', label: '胎圈' }, //
{ value: 'sidewall', label: '侧壁' }, //
{ value: 'tread', label: '胎面' }, //
{ value: 'innerLiner', label: '内衬层' }, //
{ value: 'belt', label: '带束层' }, //
{ value: 'ply', label: '胎体层' }, //
{ value: 'capPlies', label: '胎面带层' }, //
{ value: 'rim', label: '轮辋' }, //
{ value: 'valve', label: '气门芯' }, //
{ value: 'rubber', label: '橡胶原料' } //
];
//
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: DefectDetailForm = {
defectDetailId: undefined,
defectCode: undefined,
defectDesc: undefined,
defectType: undefined,
sort: undefined,
operation: undefined,
defectLevel: undefined,
status: undefined,
isFlag: undefined,
attr1: undefined,
attr2: undefined,
attr3: undefined,
attr4: undefined,
}
const data = reactive<PageData<DefectDetailForm, DefectDetailQuery>>({
form: {...initFormData},
queryParams: {
pageNum: 1,
pageSize: 10,
defectDetailId: undefined,
defectCode: undefined,
defectDesc: undefined,
defectType: undefined,
sort: undefined,
operation: undefined,
defectLevel: undefined,
status: undefined,
isFlag: undefined,
attr1: undefined,
attr2: undefined,
attr3: undefined,
attr4: undefined,
params: {
}
},
rules: {
defectDetailId: [
{ required: true, message: "主键标识不能为空", trigger: "blur" }
],
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询病疵详细列表 */
const getList = async () => {
loading.value = true;
const res = await listDefectDetail(queryParams.value);
defectDetailList.value = res.rows;
total.value = res.total;
loading.value = false;
}
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
}
/** 表单重置 */
const reset = () => {
form.value = {...initFormData};
defectDetailFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
}
/** 多选框选中数据 */
const handleSelectionChange = (selection: DefectDetailVO[]) => {
ids.value = selection.map(item => item.defectDetailId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
const handleAdd = () => {
reset();
form.value.defectType = queryParams.value.defectType;
dialog.visible = true;
dialog.title = "添加病疵详细";
}
/** 修改按钮操作 */
const handleUpdate = async (row?: DefectDetailVO) => {
reset();
const _defectDetailId = row?.defectDetailId || ids.value[0]
const res = await getDefectDetail(_defectDetailId);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = "修改病疵详细";
}
/** 提交按钮 */
const submitForm = () => {
defectDetailFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.defectDetailId) {
await updateDefectDetail(form.value).finally(() => buttonLoading.value = false);
} else {
await addDefectDetail(form.value).finally(() => buttonLoading.value = false);
}
proxy?.$modal.msgSuccess("操作成功");
dialog.visible = false;
await getList();
}
});
}
/** 删除按钮操作 */
const handleDelete = async (row?: DefectDetailVO) => {
const _defectDetailIds = row?.defectDetailId || ids.value;
await proxy?.$modal.confirm('是否确认删除病疵详细编号为"' + _defectDetailIds + '"的数据项?').finally(() => loading.value = false);
await delDefectDetail(_defectDetailIds);
proxy?.$modal.msgSuccess("删除成功");
await getList();
}
//
const showAttr1Column = computed(() => {
return defectDetailList.value.some(row => row.defectType === 'BZP_DEFECT');
});
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download('qms/defectDetail/export', {
...queryParams.value
}, `defectDetail_${new Date().getTime()}.xlsx`)
}
onMounted(() => {
getTypes(route.params && (route.params.defectId as string));
getList();
});
</script>

@ -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,349 @@
<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="ruleName">
<el-input v-model="queryParams.ruleName" placeholder="请输入规则名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="规则类型" prop="ruleType">
<el-select v-model="queryParams.ruleType" placeholder="请选择规则类型" clearable >
<el-option v-for="dict in rule_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item label="检验方式" prop="ruleMode">
<el-select v-model="queryParams.ruleMode" placeholder="请选择检验方式" clearable >
<el-option v-for="dict in rule_mode" :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:inspectionRules:add']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['qms:inspectionRules:edit']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['qms:inspectionRules:remove']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['qms:inspectionRules: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="inspectionRulesList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="规则名称" align="center" prop="ruleName" v-if="columns[2].visible"/>
<el-table-column label="规则类型" align="center" prop="ruleType" v-if="columns[3].visible">
<template #default="scope">
<dict-tag :options="rule_type" :value="scope.row.ruleType"/>
</template>
</el-table-column>
<el-table-column label="检验方式" align="center" prop="ruleMode" v-if="columns[4].visible">
<template #default="scope">
<dict-tag :options="rule_mode" :value="scope.row.ruleMode"/>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status" v-if="columns[5].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[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:inspectionRules:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['qms:inspectionRules: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="900px" :style="{ height: '500px' }" append-to-body>
<el-row :gutter="20">
<!-- 左边部分表单内容 -->
<el-col :span="12">
<el-form ref="inspectionRulesFormRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="规则名称" prop="ruleName">
<el-input v-model="form.ruleName" placeholder="请输入规则名称" />
</el-form-item>
<el-form-item label="规则类型" prop="ruleType">
<el-radio-group v-model="form.ruleType">
<el-radio
v-for="dict in rule_type"
:key="dict.value"
:value="dict.value"
>{{ dict.label }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="检验方式" prop="ruleMode">
<el-radio-group v-model="form.ruleMode">
<el-radio
v-for="dict in rule_mode"
:key="dict.value"
:value="dict.value"
>{{ dict.label }}</el-radio>
</el-radio-group>
</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-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" type="textarea" />
</el-form-item>
</el-form>
</el-col>
<!-- 右边部分动态添加检验项目 -->
<el-col :span="12">
<div style="margin-bottom: 10px;">
<el-button type="primary" @click="addInspectionItem"></el-button>
<el-button type="danger" @click="removeSelectedItems"></el-button>
</div>
<el-table :data="inspectionItems" border style="width: 100%">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column label="序号" type="index" width="80"></el-table-column>
<el-table-column label="检验项目">
<template #default="{ row }">
<el-input v-model="row.name" placeholder="请输入检验项目" />
</template>
</el-table-column>
<el-table-column label="检验顺序" width="120">
<template #default="{ row }">
<el-input v-model="row.order" placeholder="请输入顺序" />
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
<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="InspectionRules" lang="ts">
import { listInspectionRules, getInspectionRules, delInspectionRules, addInspectionRules, updateInspectionRules } from '@/api/qms/inspectionRules';
import { InspectionRulesVO, InspectionRulesQuery, InspectionRulesForm } from '@/api/qms/inspectionRules/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { enable_status, rule_type, rule_mode } = toRefs<any>(proxy?.useDict('enable_status', 'rule_type', 'rule_mode'));
const inspectionRulesList = ref<InspectionRulesVO[]>([]);
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 inspectionRulesFormRef = ref<ElFormInstance>();
const inspectionItems = 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 },
]);
const initFormData: InspectionRulesForm = {
ruleId: undefined,
ruleName: undefined,
ruleType: undefined,
ruleMode: undefined,
status: undefined,
remark: undefined,
}
const data = reactive<PageData<InspectionRulesForm, InspectionRulesQuery>>({
form: {...initFormData},
queryParams: {
pageNum: 1,
pageSize: 10,
ruleName: undefined,
ruleType: undefined,
ruleMode: undefined,
status: undefined,
params: {
}
},
rules: {
ruleName: [
{ required: true, message: "规则名称不能为空", trigger: "blur" }
],
ruleType: [
{ required: true, message: "规则类型不能为空", trigger: "change" }
],
ruleMode: [
{ required: true, message: "检验方式不能为空", trigger: "change" }
],
status: [
{ required: true, message: "状态不能为空", trigger: "change" }
],
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询检验规则列表 */
const getList = async () => {
loading.value = true;
const res = await listInspectionRules(queryParams.value);
inspectionRulesList.value = res.rows;
total.value = res.total;
loading.value = false;
}
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
}
/** 表单重置 */
const reset = () => {
form.value = {...initFormData};
inspectionRulesFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
}
/** 多选框选中数据 */
const handleSelectionChange = (selection: InspectionRulesVO[]) => {
ids.value = selection.map(item => item.ruleId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = "添加检验规则";
}
/** 修改按钮操作 */
const handleUpdate = async (row?: InspectionRulesVO) => {
reset();
const _ruleId = row?.ruleId || ids.value[0]
const res = await getInspectionRules(_ruleId);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = "修改检验规则";
}
/** 提交按钮 */
const submitForm = () => {
inspectionRulesFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.ruleId) {
await updateInspectionRules(form.value).finally(() => buttonLoading.value = false);
} else {
await addInspectionRules(form.value).finally(() => buttonLoading.value = false);
}
proxy?.$modal.msgSuccess("操作成功");
dialog.visible = false;
await getList();
}
});
}
/** 删除按钮操作 */
const handleDelete = async (row?: InspectionRulesVO) => {
const _ruleIds = row?.ruleId || ids.value;
await proxy?.$modal.confirm('是否确认删除检验规则编号为"' + _ruleIds + '"的数据项?').finally(() => loading.value = false);
await delInspectionRules(_ruleIds);
proxy?.$modal.msgSuccess("删除成功");
await getList();
}
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download('qms/inspectionRules/export', {
...queryParams.value
}, `inspectionRules_${new Date().getTime()}.xlsx`)
}
//
const addInspectionItem = () =>{
this.inspectionItems.push({ name: "" });
}
//
const removeInspectionItem = (index) => {
this.inspectionItems.splice(index, 1);
}
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…
Cancel
Save