Browse Source

检验模版、检验方案

master_hella_20240701
songguoqiang 8 months ago
parent
commit
6f6ab7c742
  1. 2
      src/api/qms/inspectionPlan/index.ts
  2. 2
      src/api/qms/inspectionTemplate/index.ts
  3. 346
      src/views/qms/basicDataManage/inspectionPlan/addForm.vue
  4. 4
      src/views/qms/basicDataManage/inspectionPlan/index.vue
  5. 5
      src/views/qms/basicDataManage/inspectionPlan/inspectionPlan.data.ts
  6. 12
      src/views/qms/basicDataManage/inspectionTemplate/inspectionTemplate.data.ts

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

@ -16,7 +16,7 @@ export const inspectionPlanPage = async (params) => {
if (params.isSearch) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
const data = {...params} const data = {...params}
return request.post({ url: '/wms/accountcalendar/senior', data }) return request.post({ url: '/qms/type-template/senior', data })
} else { } else {
return await request.get({ url: `/qms/type-template/page`, params }) return await request.get({ url: `/qms/type-template/page`, params })
} }

2
src/api/qms/inspectionTemplate/index.ts

@ -23,7 +23,7 @@ export const inspectionTemplatePage = async (params) => {
if (params.isSearch) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
const data = {...params} const data = {...params}
return request.post({ url: '/wms/accountcalendar/senior', data }) return request.post({ url: '/qms/programme-template/senior', data })
} else { } else {
return await request.get({ url: `/qms/programme-template/page`, params }) return await request.get({ url: `/qms/programme-template/page`, params })
} }

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

@ -18,7 +18,7 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="物料编码" prop="itemCode"> <el-form-item label="物料编码" prop="itemCode">
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input v-model="data.itemName" disabled placeholder="请选择物料编码" /> <el-input v-model="data.itemName" disabled placeholder="请选择物料" />
<el-button <el-button
type="info" type="info"
plain plain
@ -81,12 +81,12 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="检验模板编码" prop="programmeTemplateCode"> <el-form-item label="检验模板" prop="programmeTemplateCode">
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input <el-input
v-model="data.programmeTemplateName" v-model="data.programmeTemplateName"
disabled disabled
placeholder="请选择检验模板编码" placeholder="请选择检验模板"
/> />
<el-button <el-button
type="info" type="info"
@ -96,7 +96,7 @@
opensearchTable( opensearchTable(
'programmeTemplateCode', 'programmeTemplateCode',
null, null,
'检验模板编码', '检验模板',
InspectionTemplateMain.allSchemas, InspectionTemplateMain.allSchemas,
InspectionTemplateApi.inspectionTemplatePage, InspectionTemplateApi.inspectionTemplatePage,
null, null,
@ -110,6 +110,42 @@
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="动态修改规则" prop="dynamicUpdateCode">
<div style="display: flex; width: 100%">
<el-input
v-model="data.dynamicUpdateName"
disabled
placeholder="请选择动态修改规则"
/>
<el-button
type="info"
plain
style="width: 40px"
@click="
opensearchTable(
'dynamicUpdateCode',
null,
'动态修改规则',
DynamicRule.allSchemas,
DynamicRuleApi.getDynamicRulePage,
[
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
false,
'main',
data
)
"
><Icon icon="ep:search"
/></el-button>
</div>
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="拆分规则" prop="splitRule"> <el-form-item label="拆分规则" prop="splitRule">
<el-select v-model="data.splitRule" placeholder="请选择拆分规则"> <el-select v-model="data.splitRule" placeholder="请选择拆分规则">
@ -190,6 +226,42 @@
:label="item.description" :label="item.description"
:name="item.name" :name="item.name"
> >
<!-- <el-col :span="12">
<el-form-item label="动态修改规则" prop="dynamicUpdateCode">
<div style="display: flex; width: 100%">
<el-input
v-model="data.dynamicUpdateName"
disabled
placeholder="请选择动态修改规则"
/>
<el-button
type="info"
plain
style="width: 40px"
@click="
opensearchTable(
'dynamicUpdateCode',
null,
'动态修改规则',
DynamicRule.allSchemas,
DynamicRuleApi.getDynamicRulePage,
[
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
false,
'main',
data
)
"
><Icon icon="ep:search"
/></el-button>
</div>
</el-form-item>
</el-col> -->
<div class="small-title">检验工序</div> <div class="small-title">检验工序</div>
<el-form :model="item" label-width="auto" :rules="rules" ref="formProcessRef"> <el-form :model="item" label-width="auto" :rules="rules" ref="formProcessRef">
<el-row :gutter="20"> <el-row :gutter="20">
@ -246,122 +318,83 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
label="检验方法" label="检验方法"
prop="inspectionCharacteristicsBaseVO.inspectionMethodCode" prop="inspectionCharacteristicsBaseVO.inspectionMethodCode"
> >
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input <el-input
v-model="item.inspectionCharacteristicsBaseVO.inspectionMethodName" v-model="item.inspectionCharacteristicsBaseVO.inspectionMethodName"
disabled disabled
placeholder="请选择检验方法" placeholder="请选择检验方法"
/> />
<el-button <el-button
type="info" type="info"
plain plain
style="width: 40px" style="width: 40px"
@click=" @click="
opensearchTable( opensearchTable(
'inspectionMethodCode', 'inspectionMethodCode',
null, null,
'检验方法', '检验方法',
InspectionMethod.allSchemas, InspectionMethod.allSchemas,
InspectionMethodApi.getInspectionMethodPage, InspectionMethodApi.getInspectionMethodPage,
[ [
{ {
key: 'available', key: 'available',
value: 'TRUE', value: 'TRUE',
isMainValue: false isMainValue: false
} }
], ],
false, false,
'features', 'features',
item item
) )
" "
><Icon icon="ep:search" ><Icon icon="ep:search"
/></el-button> /></el-button>
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
label="采样过程编码" label="采样过程"
prop="inspectionCharacteristicsBaseVO.inspectionMethod" prop="inspectionCharacteristicsBaseVO.samplingProcessCode"
> >
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input <el-input
v-model="item.inspectionCharacteristicsBaseVO.inspectionName" v-model="item.inspectionCharacteristicsBaseVO.samplingProcessName"
disabled disabled
placeholder="请选择采样过程编码" placeholder="请选择采样过程"
/> />
<el-button <el-button
type="info" type="info"
plain plain
style="width: 40px" style="width: 40px"
@click=" @click="
opensearchTable( opensearchTable(
'inspectionMethod', 'samplingProcessCode',
null, null,
'采样过程编码', '采样过程',
SamplingProcess.allSchemas, SamplingProcess.allSchemas,
SamplingProcessApi.getSamplingProcessPage, SamplingProcessApi.getSamplingProcessPage,
[ [
{ {
key: 'available', key: 'available',
value: 'TRUE', value: 'TRUE',
isMainValue: false isMainValue: false
} }
], ],
false, false,
'features', 'features',
item item
) )
" "
><Icon icon="ep:search" ><Icon icon="ep:search"
/></el-button> /></el-button>
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item
label="动态修改规则编码"
prop="inspectionCharacteristicsBaseVO.dynamicUpdateCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.dynamicUpdateName"
disabled
placeholder="请选择动态修改规则编码"
/>
<el-button
type="info"
plain
style="width: 40px"
@click="
opensearchTable(
'dynamicUpdateCode',
null,
'动态修改规则编码',
DynamicRule.allSchemas,
DynamicRuleApi.getDynamicRulePage,
[
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
false,
'features',
item
)
"
><Icon icon="ep:search"
/></el-button>
</div>
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
label="是否允许修改特征值" label="是否允许修改特征值"
@ -515,7 +548,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
label="选择集编码" label="选择集"
prop="inspectionCharacteristicsBaseVO.quantifyQuantifyCode" prop="inspectionCharacteristicsBaseVO.quantifyQuantifyCode"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 1" v-if="item.inspectionCharacteristicsBaseVO.featureType == 1"
> >
@ -523,7 +556,7 @@
<el-input <el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyQuantifyCode" v-model="item.inspectionCharacteristicsBaseVO.quantifyQuantifyCode"
disabled disabled
placeholder="请选择选择集编码" placeholder="请选择选择集"
/> />
<el-button <el-button
type="info" type="info"
@ -533,16 +566,16 @@
opensearchTable( opensearchTable(
'quantifyQuantifyCode', 'quantifyQuantifyCode',
null, null,
'选择集编码', '选择集',
SelectedSet.allSchemas, SelectedSet.allSchemas,
SelectedSetApi.getSelectedSetPage, SelectedSetApi.getSelectedSetPage,
[ [
{ {
key: 'available', key: 'available',
value: 'TRUE', value: 'TRUE',
isMainValue: false isMainValue: false
} }
], ],
false, false,
null, null,
item item
@ -662,6 +695,7 @@ const data = ref({
effectiveDate: '', effectiveDate: '',
expirationDate: '', expirationDate: '',
available: 'TRUE', available: 'TRUE',
dynamicUpdateCode: '',
process: [] process: []
}) })
@ -676,11 +710,11 @@ if (props.basicFormWidth) {
dialogWidth.value = props.isBusiness ? '60%' : '40%' dialogWidth.value = props.isBusiness ? '60%' : '40%'
} }
const rules = ref({ const rules = ref({
itemCode: [{ required: true, message: '请选择物料编码', trigger: 'blur' }], itemCode: [{ required: true, message: '请选择物料', trigger: 'blur' }],
version: [{ required: true, message: '请填写版本', trigger: 'blur' }], version: [{ required: true, message: '请填写版本', trigger: 'blur' }],
testTypeCode: [{ required: true, message: '请选择检验类型编码', trigger: ['blur', 'change'] }], testTypeCode: [{ required: true, message: '请选择检验类型', trigger: ['blur', 'change'] }],
programmeTemplateCode: [ programmeTemplateCode: [
{ required: true, message: '请选择检验模板编码', trigger: ['blur', 'change'] } { required: true, message: '请选择检验模板', trigger: ['blur', 'change'] }
], ],
splitRule: [{ required: true, message: '请选择拆分规则', trigger: ['blur', 'change'] }], splitRule: [{ required: true, message: '请选择拆分规则', trigger: ['blur', 'change'] }],
aql: [{ required: true, message: '请选择aql', trigger: ['blur', 'change'] }], aql: [{ required: true, message: '请选择aql', trigger: ['blur', 'change'] }],
@ -691,13 +725,13 @@ const rules = ref({
{ required: true, message: '请填写描述', trigger: ['blur', 'change'] } { required: true, message: '请填写描述', trigger: ['blur', 'change'] }
], ],
'inspectionCharacteristicsBaseVO.inspectionMethodCode': [ 'inspectionCharacteristicsBaseVO.inspectionMethodCode': [
{ required: true, message: '请选择检验方法编码', trigger: 'blur' } { required: true, message: '请选择检验方法', trigger: 'blur' }
], ],
'inspectionCharacteristicsBaseVO.dynamicUpdateCode': [ 'inspectionCharacteristicsBaseVO.samplingProcessCode': [
{ required: true, message: '请选择采样过程编码', trigger: ['blur', 'change'] } { required: true, message: '请选择采样过程', trigger: ['blur', 'change'] }
], ],
'inspectionCharacteristicsBaseVO.inspectionMethod': [ dynamicUpdateCode: [
{ required: true, message: '请选择动态修改规则编码', trigger: ['blur', 'change'] } { required: true, message: '请选择动态修改规则', trigger: ['blur', 'change'] }
], ],
'inspectionCharacteristicsBaseVO.resultEntryMethod': [ 'inspectionCharacteristicsBaseVO.resultEntryMethod': [
{ required: true, message: '请选择结果录入方式', trigger: ['blur', 'change'] } { required: true, message: '请选择结果录入方式', trigger: ['blur', 'change'] }
@ -721,7 +755,7 @@ const rules = ref({
{ required: true, message: '请输入小数位', trigger: 'blur' } { required: true, message: '请输入小数位', trigger: 'blur' }
], ],
'inspectionCharacteristicsBaseVO.quantifyQuantifyCode': [ 'inspectionCharacteristicsBaseVO.quantifyQuantifyCode': [
{ required: true, message: '请输入选择集编码', trigger: 'blur' } { required: true, message: '请输入选择集', trigger: 'blur' }
] ]
}) })
/** 打开弹窗 */ /** 打开弹窗 */
@ -777,6 +811,7 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
effectiveDate: '', effectiveDate: '',
expirationDate: '', expirationDate: '',
available: 'TRUE', available: 'TRUE',
dynamicUpdateCode:'',
process: [] process: []
} }
} }
@ -823,6 +858,7 @@ const buttonBaseClick1 = (val) => {
name: newTabName, name: newTabName,
inspectionCode: '', inspectionCode: '',
sequenceCode: '', sequenceCode: '',
dynamicUpdateCode:'',
inspectionCharCode: '', inspectionCharCode: '',
inspectionCharacteristicsBaseVO: { inspectionCharacteristicsBaseVO: {
describe: '', describe: '',
@ -1020,23 +1056,30 @@ const opensearchTable = (
// //
// val row // val row
const searchTableSuccess = async (formField, searchField, val, type, row) => { const searchTableSuccess = async (formField, searchField, val, type, row) => {
if(type == 'features'){ if (type == 'features') {
row.inspectionCharacteristicsBaseVO[formField] = val[0].code row.inspectionCharacteristicsBaseVO[formField] = val[0].code
if(formField == 'inspectionMethodCode'){ if (formField == 'inspectionMethodCode') {
row.inspectionCharacteristicsBaseVO.inspectionMethodName = val[0].description row.inspectionCharacteristicsBaseVO.inspectionMethodName = val[0].description
}else if(formField == 'dynamicUpdateCode'){
row.inspectionCharacteristicsBaseVO.dynamicUpdateName = val[0].description
}else if(formField == 'inspectionMethod'){
row.inspectionCharacteristicsBaseVO.inspectionName = val[0].description
} }
} else if(type == 'main'){ // else if(formField == 'dynamicUpdateCode'){
// row.inspectionCharacteristicsBaseVO.dynamicUpdateName = val[0].description
// }
else if (formField == 'samplingProcessCode') {
row.inspectionCharacteristicsBaseVO.samplingProcessName = val[0].description
} else if (formField == 'quantifyQuantifyCode') {
row.inspectionCharacteristicsBaseVO.quantifyQuantifyName = val[0].description
}
} else if (type == 'main') {
data.value[formField] = val[0].code data.value[formField] = val[0].code
if(formField == 'itemCode'){ if (formField == 'itemCode') {
data.value.itemName = val[0].name data.value.itemName = val[0].name
}else if(formField == 'testTypeCode'){ } else if (formField == 'testTypeCode') {
data.value.testTypeName = val[0].description data.value.testTypeName = val[0].description
}else if(formField == 'programmeTemplateCode'){ } else if (formField == 'programmeTemplateCode') {
data.value.programmeTemplateName = val[0].description data.value.programmeTemplateName = val[0].description
data.value['dynamicUpdateCode'] = val[0].dynamicUpdateCode
data.value.dynamicUpdateName = val[0].dynamicUpdateName
} }
if (formField == 'programmeTemplateCode') { if (formField == 'programmeTemplateCode') {
let list = await InspectionProcessPageApi.getListByTempleteCode(val[0].code) let list = await InspectionProcessPageApi.getListByTempleteCode(val[0].code)
@ -1062,6 +1105,11 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => {
}) })
data.value.process = list data.value.process = list
} }
if (formField == 'dynamicUpdateCode') {
data.value[formField] = val[0].code
data.value.dynamicUpdateName = val[0].description
}
} }
// emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row) // emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row)

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

@ -135,6 +135,9 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const basicFormRef = ref()
const openForm = (type: string, row?: any) => { const openForm = (type: string, row?: any) => {
// if(type=='add'){//
// InspectionTemplateMain.allSchemas.formSchema.find(item => item.field == 'programmeTemplateCode').componentProps.disabled = true//
// }
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
} }
@ -151,6 +154,7 @@ const submitForm = async (formType,data) => {
} }
const data1 = { const data1 = {
id: data.id, id: data.id,
dynamicUpdateCode:data.dynamicUpdateCode,
code: data.code, code: data.code,
itemCode: data.itemCode, itemCode: data.itemCode,
version: data.version, version: data.version,

5
src/views/qms/basicDataManage/inspectionPlan/inspectionPlan.data.ts

@ -77,6 +77,7 @@ export const InspectionPlanMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 220, width: 220,
fixed: 'left' fixed: 'left'
}, },
isSearch:true,
form:{ form:{
componentProps:{ componentProps:{
disabled:true, disabled:true,
@ -90,7 +91,8 @@ export const InspectionPlanMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
} },
isSearch:true,
},{ },{
label: '版本', label: '版本',
field: 'version', field: 'version',
@ -139,6 +141,7 @@ export const InspectionPlanMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
}, },
isSearch:true,
},{ },{
label: '生效时间', label: '生效时间',
field: 'effectiveDate', field: 'effectiveDate',

12
src/views/qms/basicDataManage/inspectionTemplate/inspectionTemplate.data.ts

@ -73,6 +73,7 @@ export const InspectionTemplateMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '编码', label: '编码',
field: 'code', field: 'code',
sort: 'custom', sort: 'custom',
isSearch:true,
form:{ form:{
componentProps:{ componentProps:{
disabled:true, disabled:true,
@ -127,7 +128,12 @@ export const InspectionTemplateProcess = useCrudSchemas(reactive<CrudSchema[]>([
label: '检验特性编码', label: '检验特性编码',
field: 'inspectionCharCode', field: 'inspectionCharCode',
sort: 'custom', sort: 'custom',
} },
{
label: '动态修改规则编码',
field: 'dynamicUpdateCode',
sort: 'custom',
},
])) ]))
export const InspectionTemplateFeatures= useCrudSchemas(reactive<CrudSchema[]>([ export const InspectionTemplateFeatures= useCrudSchemas(reactive<CrudSchema[]>([
{ {
@ -153,10 +159,6 @@ export const InspectionTemplateFeatures= useCrudSchemas(reactive<CrudSchema[]>([
label: '采样过程编码', label: '采样过程编码',
field: 'inspectionMethod', field: 'inspectionMethod',
sort: 'custom', sort: 'custom',
},{
label: '动态修改规则编码',
field: 'dynamicUpdateCode',
sort: 'custom',
},{ },{
label: '是否允许修改特征值', label: '是否允许修改特征值',
field: 'isCanUpdate', field: 'isCanUpdate',

Loading…
Cancel
Save