Browse Source

检验模版、检验方案

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

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

@ -135,6 +135,9 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */
const basicFormRef = ref()
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)
}
@ -151,6 +154,7 @@ const submitForm = async (formType,data) => {
}
const data1 = {
id: data.id,
dynamicUpdateCode:data.dynamicUpdateCode,
code: data.code,
itemCode: data.itemCode,
version: data.version,

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

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

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

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

Loading…
Cancel
Save