Browse Source

检验方案

master_hella_20240701
zhang_li 8 months ago
parent
commit
3369a0ee21
  1. 23
      src/api/qms/inspectionPlan/index.ts
  2. 4
      src/utils/dict.ts
  3. 141
      src/views/qms/basicDataManage/inspectionPlan/addForm.vue
  4. 10
      src/views/qms/basicDataManage/inspectionPlan/index.vue
  5. 18
      src/views/qms/basicDataManage/inspectionTemplate/addForm.vue

23
src/api/qms/inspectionPlan/index.ts

@ -1,30 +1,23 @@
import request from '@/config/axios'
// 查询采样过程列表
export const getListByTempleteCode = async (code) => {
return await request.get({ url: `/qms/inspection-process/getListByTempleteCode?code=`+code})
}
// 新增
export const inspectionTemplateCreat = async (data) => {
return await request.post({ url: `/qms/programme-template/create`,data})
export const inspectionPlanCreat = async (data) => {
return await request.post({ url: `/qms/type-template/create`,data})
}
// 编辑
export const inspectionTemplateUpdate = async (data) => {
return await request.put({ url: `/qms/programme-template/update`,data})
export const inspectionPlanUpdate = async (data) => {
return await request.put({ url: `/qms/type-template/update`,data})
}
// 删除
export const inspectionTemplateDelete = async (id) => {
return await request.delete({ url: `/qms/programme-template/delete?id=`+id})
export const inspectionPlanDelete = async (id) => {
return await request.delete({ url: `/qms/type-template/delete?id=`+id})
}
// 列表
export const inspectionTemplatePage = async (params) => {
export const inspectionPlanPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/wms/accountcalendar/senior', data })
} else {
return await request.get({ url: `/qms/programme-template/page`, params })
return await request.get({ url: `/qms/type-template/page`, params })
}
}

4
src/utils/dict.ts

@ -293,7 +293,9 @@ export enum DICT_TYPE {
INSPECTION_CHARACTERISTICS_FEATURE_TYPE = "inspection_characteristics_feature_type", // 特征类型
INSPECTION_CHARACTERISTICS_RESULT_ENTRY = "inspection_characteristics_result_entry", // 结果录入方式
INSPECTION_SEVERITY = 'inspection_severity',//检验严重性
SPLIT_RULES = "split_rules", // 拆分规则
INSPECTION_LEVEL = "inspection_level", // 检验水平字典
BASIC_AQL = "basic_aql", // aql
// ========== 业务 - mes -gaojs ==========
QUALIFY_STATUS = 'qualify_status',//质检状态

141
src/views/qms/basicDataManage/inspectionPlan/addForm.vue

@ -7,9 +7,8 @@
:vLoading="formLoading"
>
<div style="max-height: 60vh; overflow-y: auto; padding: 0px 20px">
<!-- <Form ref="formRefMain" :schema="formAllSchemasMain" :is-col="true" :rules="rules" /> -->
<el-form :model="data" label-width="auto" :rules="rules" ref="formMainRef">
<el-row>
<el-row gutter="20">
<el-col :span="12">
<el-form-item label="编码" prop="code">
<el-input v-model="data.code" placeholder="根据系统生成" :disabled="true" />
@ -25,6 +24,103 @@
<el-input v-model="data.version" placeholder="请填写版本" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检验类型编码" prop="testTypeCode" >
<div style="display: flex; width: 100%">
<el-input
v-model="data.testTypeCode"
disabled
placeholder="请选择检验类型编码"
/>
<el-button
type="info"
plain
style="width: 40px"
@click="opensearchTable('testTypeCode', null,'检验类型',SamplingProcess.allSchemas,SamplingProcessApi.getSamplingProcessPage,null,false,null,item)"
><Icon icon="ep:search"/>
</el-button>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检验模板编码" prop="programmeTemplateCode" >
<div style="display: flex; width: 100%">
<el-input
v-model="data.testTypeCode"
disabled
placeholder="请选择检验模板编码"
/>
<el-button
type="info"
plain
style="width: 40px"
@click="opensearchTable('programmeTemplateCode', null,'检验类型',SamplingProcess.allSchemas,SamplingProcessApigetSamplingProcessPage,null,false,null,item)"
><Icon icon="ep:search"/>
</el-button>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="拆分规则" prop="splitRule">
<el-select v-model="data.splitRule" placeholder="请选择拆分规则" >
<el-option
v-for="dict in getStrDictOptions( DICT_TYPE.SPLIT_RULES )"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="aql" prop="aql">
<el-select v-model="data.aql" placeholder="请选择aql" >
<el-option
v-for="dict in getStrDictOptions( DICT_TYPE.BASIC_AQL )"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检验水平" prop="inspectionLevel">
<el-select v-model="data.inspectionLevel" placeholder="请选择检验水平" >
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.INSPECTION_LEVEL )"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="生效时间" prop="effectiveDate">
<el-date-picker
v-model="data.effectiveDate"
type="datetime"
placeholder="请选择生效时间"
style="width:100%"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="失效时间" prop="expirationDate">
<el-date-picker
v-model="data.expirationDate"
type="datetime"
placeholder="请选择失效时间"
style="width:100%"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否可用" prop="available">
<el-switch v-model="data.available" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-tabs
@ -43,13 +139,6 @@
:name="item.name"
>
<div class="small-title">检验工序</div>
<!-- <Form
:ref="`formRefProcess`+index"
:schema="formAllSchemasProcess"
:is-col="true"
labelWidth="150px"
:rules="rules"
/> -->
<el-form :model="item" label-width="auto" :rules="rules" ref="formProcessRef">
<el-row :gutter="20">
<el-col :span="12">
@ -483,6 +572,7 @@ const data = ref({
code: '',
description: '',
version: '',
available:true,
process: []
})
const isYesList = [
@ -576,10 +666,28 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
formType.value = type
if (row) {
data.value = row
let list = await InspectionProcessPageApi.getListByTempleteCode(row.code)
list.forEach((item, index) => {
editableTabsValue.value = index + 1
item.name = index + 1
//
if(item.quantifyIsCapping){
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
}else{
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
}
if(item.quantifyIsLowlimit){
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
}else{
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
}
if(item.quantifyIsTarget){
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
}else{
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
}
})
data.value.process = list
} else {
@ -587,6 +695,7 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
code: '',
description: '',
version: '',
available:true,
process: []
}
}
@ -645,6 +754,7 @@ const buttonBaseClick1 = (val) => {
featureType: '',
quantifyIsCapping: '',
quantifyIsLowlimit: '',
quantifyIsTarget: '',
quantifyTarget: '',
quantifyCapping: '',
quantifyLowlimit: '',
@ -691,6 +801,7 @@ const validateForm = (formRef) => {
return false
})
}
const submitForm = async () => {
try {
const validateForm1 = await validateForm(formProcessRef.value)
@ -706,6 +817,13 @@ const submitForm = async () => {
message.error(`模板中有检验工序和检验特性未填写完全`)
return;
}
const arr = data.value.process.filter(item=>(!item.inspectionCharacteristicsBaseVO.quantifyIsCapping&&!item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit&&!item.inspectionCharacteristicsBaseVO.quantifyIsTarget&&item.inspectionCharacteristicsBaseVO.featureType == 0))
console.log(arr)
if(arr&&arr.length>0){
const str = arr.map(item=>item.description).join(',')
message.error(`${str}是否设定上线,是否设定下限,是否是定目标值至少一项为是`)
return;
}
if (formType.value == 'create') {
//
emit('submitForm', formType.value, data)
@ -730,6 +848,11 @@ if (props.footButttondata) {
//
const changeFeatureType = (e) => {
console.log(e)
// if (e) {
// rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = true
// } else {
// rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = false
// }
}
const searchTableRef = ref()
const opensearchTable = (

10
src/views/qms/basicDataManage/inspectionPlan/index.vue

@ -66,7 +66,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import AddForm from './addForm.vue'
import * as InspectionProcessPageApi from '@/api/qms/inspectionPlan'
import * as InspectionPlanApi from '@/api/qms/inspectionPlan'
defineOptions({ name: 'AgvLocationrelation' })
@ -84,7 +84,7 @@ const updataTableColumns = (val) => {
}
const { tableObject, tableMethods } = useTable({
getListApi: InspectionProcessPageApi.inspectionTemplatePage //
getListApi: InspectionPlanApi.inspectionPlanPage //
})
//
@ -149,10 +149,10 @@ const openForm = (type: string, row?: any) => {
const submitForm = async (formType,data) => {
console.log(data.value)
if (formType === 'create') {
await InspectionProcessPageApi.inspectionTemplateCreat(data.value)
await InspectionPlanApi.inspectionPlanCreat(data.value)
message.success(t('common.createSuccess'))
} else {
await InspectionProcessPageApi.inspectionTemplateUpdate(data.value)
await InspectionPlanApi.inspectionPlanUpdate(data.value)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
@ -171,7 +171,7 @@ const handleDelete = async (id: number) => {
//
await message.delConfirm()
//
await InspectionProcessPageApi.inspectionTemplateDelete(id)
await InspectionPlanApi.inspectionPlanDelete(id)
message.success(t('common.delSuccess'))
//
await getList()

18
src/views/qms/basicDataManage/inspectionTemplate/addForm.vue

@ -8,7 +8,7 @@
>
<div style="max-height: 60vh; overflow-y: auto; padding: 0px 20px">
<!-- <Form ref="formRefMain" :schema="formAllSchemasMain" :is-col="true" :rules="rules" /> -->
<el-form :model="data" label-width="auto" :rules="rules" ref="formMainRef">
<el-form :model="data" label-width="auto" :rules="rules" ref="formMainRef" gutter="20">
<el-row>
<el-col :span="12">
<el-form-item label="编码" prop="code">
@ -266,7 +266,9 @@
label="是否设定上限"
prop="inspectionCharacteristicsBaseVO.quantifyIsCapping"
>
<el-select
<el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsCapping" @change="changeIsCapping"/>
<!-- <el-select
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsCapping"
placeholder="请选择是否设定上限"
@change="changeIsCapping"
@ -277,7 +279,7 @@
:label="item.label"
:value="item.value"
/>
</el-select>
</el-select> -->
</el-form-item>
</el-col>
<el-col :span="12">
@ -295,7 +297,8 @@
label="是否设定下限"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
>
<el-select
<el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit" @change="changeLowlimit"/>
<!-- <el-select
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit"
placeholder="请选择是否设定下限"
@change="changeLowlimit"
@ -306,7 +309,7 @@
:label="item.label"
:value="item.value"
/>
</el-select>
</el-select> -->
</el-form-item>
</el-col>
<el-col :span="12">
@ -324,7 +327,8 @@
label="是否设定目标值"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
>
<el-select
<el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsTarget" @change="changeIsTarget"/>
<!-- <el-select
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsTarget"
placeholder="请选择是否设定目标值"
@change="changeIsTarget"
@ -335,7 +339,7 @@
:label="item.label"
:value="item.value"
/>
</el-select>
</el-select> -->
</el-form-item>
</el-col>
<el-col :span="12">

Loading…
Cancel
Save