Browse Source

检验任务和检验记录添加包装

master_hella_20240701
zhang_li 8 months ago
parent
commit
f8bfda3315
  1. 6
      src/api/qms/inspectionJob/inspectionJobPackage/index.ts
  2. 3
      src/components/listTable/index.ts
  3. 40
      src/components/listTable/src/ListTable.vue
  4. 1
      src/locales/en-US.ts
  5. 1
      src/locales/zh-CN.ts
  6. 12
      src/utils/disposition/defaultButtons.ts
  7. 389
      src/views/qms/inspection/inspectionJob/addForm.vue
  8. 61
      src/views/qms/inspection/inspectionJob/index.vue
  9. 65
      src/views/qms/inspection/inspectionJob/inspectionJobMain.data.ts
  10. 10
      src/views/qms/inspection/inspectionRecord/index.vue

6
src/api/qms/inspectionJob/inspectionJobPackage/index.ts

@ -0,0 +1,6 @@
import request from '@/config/axios'
//查询检验申请列表
export const getInspectionJobPackageList = async (id: number) => {
return await request.get({ url: `/qms/inspection-job-package/list?masterId=` + id })
}

3
src/components/listTable/index.ts

@ -0,0 +1,3 @@
import ListTable from './src/ListTable.vue'
export { ListTable }

40
src/components/listTable/src/ListTable.vue

@ -0,0 +1,40 @@
<template>
<div>
<Dialog v-model="isPackageShow" :title="dialogTitle" :width="width?width:'900px'" v-loading="packageLoading">
<Table
ref="searchTableRef"
:columns="columns"
:data="allList"
:reserveSelection="true"
row-key="id"
/>
</Dialog>
</div>
</template>
<script lang="ts" setup>
const isPackageShow = ref(false)
const packageLoading = ref(false)
const dialogTitle = ref()
const message = useMessage() //
const columns = ref()
const allList = ref()
//
const props = defineProps({
width: {
type: String,
required: false
},
})
const openPackage = async (row?: any, titleName?: any,tableColumns?: any,list?: any) => {
isPackageShow.value = true
if (titleName) {
dialogTitle.value = titleName
}
columns.value = tableColumns.filter(item => (item.field !== 'action'))
allList.value = list
}
defineExpose({ openPackage }) // open
</script>

1
src/locales/en-US.ts

@ -296,6 +296,7 @@ export default {
delete: 'Delete', delete: 'Delete',
edit: 'Edit', edit: 'Edit',
update: 'Update', update: 'Update',
execute: 'Execute',
preview: 'Preview', preview: 'Preview',
more: 'More', more: 'More',
sync: 'Sync', sync: 'Sync',

1
src/locales/zh-CN.ts

@ -297,6 +297,7 @@ export default {
edit: '编辑', edit: '编辑',
update: '编辑', update: '编辑',
preview: '预览', preview: '预览',
execute: '执行',
more: '更多', more: '更多',
sync: '同步', sync: '同步',
save: '保存', save: '保存',

12
src/utils/disposition/defaultButtons.ts

@ -691,6 +691,18 @@ export function mainListJobExeBtn(option:any) {
hasPermi: '' hasPermi: ''
}) })
} }
// 主列表-包装按钮
export function mainListPackageBtn(option:any) {
return __defaultBtnOption(option,{
label: '包装',
name: 'mainPackage',
hide: false,
type: 'primary',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 主列表-打印 // 主列表-打印
export function mainListPointBtn(option:any) { export function mainListPointBtn(option:any) {
return __defaultBtnOption(option,{ return __defaultBtnOption(option,{

389
src/views/qms/inspection/inspectionJob/addForm.vue

@ -27,7 +27,7 @@
:stretch="false" :stretch="false"
> >
<el-tab-pane <el-tab-pane
v-for="(item,index) in data.subList" v-for="item in data.subList"
:key="item.name" :key="item.name"
:label="item.processCode" :label="item.processCode"
:name="item.name" :name="item.name"
@ -37,7 +37,11 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="编码" prop="processCode"> <el-form-item label="编码" prop="processCode">
<el-input v-model="item.processCode" placeholder="根据系统生成" :disabled="true" /> <el-input
v-model="item.processCode"
placeholder="根据系统生成"
:disabled="true"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -51,12 +55,12 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="描述" prop="processDescribe"> <el-form-item label="描述" prop="processDescribe">
<el-input v-model="item.processDescribe" :disabled="true" /> <el-input v-model="item.processDescribe" :disabled="true" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="顺序号" prop="sequenceCode"> <el-form-item label="顺序号" prop="sequenceCode">
<el-input v-model="item.sequenceCode" :disabled="true" /> <el-input v-model="item.sequenceCode" :disabled="true" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -83,39 +87,45 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="描述" prop="inspectionJobCharacteristicsUpdateReqVO.description"> <el-form-item
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.description" :disabled="true" /> label="描述"
prop="inspectionJobCharacteristicsUpdateReqVO.description"
>
<el-input
v-model="item.inspectionJobCharacteristicsUpdateReqVO.description"
:disabled="true"
/>
</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="inspectionJobCharacteristicsUpdateReqVO.inspectionMethodCode" prop="inspectionJobCharacteristicsUpdateReqVO.inspectionMethodCode"
> >
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input <el-input
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionMethodName" v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionMethodName"
disabled disabled
placeholder="请选择检验方法" placeholder="请选择检验方法"
/> />
</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="inspectionJobCharacteristicsUpdateReqVO.inspectionMethod" prop="inspectionJobCharacteristicsUpdateReqVO.inspectionMethod"
> >
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input <el-input
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionName" v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionName"
disabled disabled
placeholder="请选择采样过程编码" placeholder="请选择采样过程编码"
/> />
</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="inspectionJobCharacteristicsUpdateReqVO.dynamicUpdateCode" prop="inspectionJobCharacteristicsUpdateReqVO.dynamicUpdateCode"
@ -148,7 +158,7 @@
<el-select <el-select
v-model="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod" v-model="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod"
placeholder="请选择结果录入方式" placeholder="请选择结果录入方式"
@change="resultEntryMethodChange($event,item)" @change="resultEntryMethodChange($event, item)"
disabled disabled
> >
<el-option <el-option
@ -163,14 +173,20 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="特征类型" prop="inspectionJobCharacteristicsUpdateReqVO.featureType"> <el-form-item
label="特征类型"
prop="inspectionJobCharacteristicsUpdateReqVO.featureType"
>
<el-select <el-select
v-model="item.inspectionJobCharacteristicsUpdateReqVO.featureType" v-model="item.inspectionJobCharacteristicsUpdateReqVO.featureType"
placeholder="请选择特征类型" placeholder="请选择特征类型"
@change="changeFeatureType" @change="changeFeatureType"
disabled disabled
> >
<el-option v-for="dict in getStrDictOptions( DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE )" <el-option
v-for="dict in getStrDictOptions(
DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE
)"
:key="dict.value" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"
@ -179,7 +195,10 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="开始时间" prop="inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime"> <el-form-item
label="开始时间"
prop="inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime"
>
<el-date-picker <el-date-picker
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime" v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime"
type="datetime" type="datetime"
@ -190,7 +209,10 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="结束时间" prop="inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime"> <el-form-item
label="结束时间"
prop="inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime"
>
<el-date-picker <el-date-picker
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime" v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime"
type="datetime" type="datetime"
@ -200,17 +222,37 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" style="border: 1px solid #dedede ;border-radius: 4px ;padding-top: 16px;margin-bottom: 10px" v-for="(cur,i) in data.subList[index].inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList" :key="i"> <el-col
:span="24"
style="
border: 1px solid #dedede;
border-radius: 4px;
padding-top: 16px;
margin-bottom: 10px;
"
v-for="(cur, i) in item.inspectionJobCharacteristicsUpdateReqVO
.recordInspectionQuantifyList"
:key="i"
>
<el-row> <el-row>
<!-- 汇总录入的时候显示 --> <!-- 汇总录入的时候显示 -->
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1"> <el-col
:span="12"
v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1"
>
<el-form-item label="合格数量"> <el-form-item label="合格数量">
<el-input v-model="cur.qualifiedQuantity" placeholder="请输入合格数量"/> <el-input v-model="cur.qualifiedQuantity" placeholder="请输入合格数量" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1"> <el-col
:span="12"
v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1"
>
<el-form-item label="不合格数量"> <el-form-item label="不合格数量">
<el-input v-model="cur.unqualifiedQuantity" placeholder="请输入不合格数量"/> <el-input
v-model="cur.unqualifiedQuantity"
placeholder="请输入不合格数量"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 手动评估的时候显示 --> <!-- 手动评估的时候显示 -->
@ -219,43 +261,54 @@
<el-select <el-select
v-model="cur.estimateCode" v-model="cur.estimateCode"
placeholder="请选择评估代码" placeholder="请选择评估代码"
@change="changeFeatureType"> @change="changeFeatureType"
<el-option v-for="dict in getStrDictOptions( DICT_TYPE.EVALUATION_CODE  )" >
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.EVALUATION_CODE)"
:key="dict.value" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value"/> :value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0"> <el-col
:span="12"
v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0"
>
<el-form-item label="检验值" prop="inspectionValue"> <el-form-item label="检验值" prop="inspectionValue">
<el-input v-model="cur.inspectionValue" placeholder="请输入检验值"/> <el-input v-model="cur.inspectionValue" placeholder="请输入检验值" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1"> <el-col
:span="12"
v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1"
>
<el-form-item label="选定集" prop="qualitativeCode"> <el-form-item label="选定集" prop="qualitativeCode">
<el-select <el-select
v-model="cur.qualitativeCode" v-model="cur.qualitativeCode"
placeholder="请选择选定集" placeholder="请选择选定集"
@change="changeQualitativeCode($event,item,cur)"> @change="changeQualitativeCode($event, item, cur)"
<el-option v-for="dict in item.selectedProjectRespVOList" >
<el-option
v-for="dict in item.selectedProjectRespVOList"
:key="dict.dictionaryValue" :key="dict.dictionaryValue"
:label="dict.dictionaryLabel" :label="dict.dictionaryLabel"
:value="dict.dictionaryValue"/> :value="dict.dictionaryValue"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.samplingProcessRespVO.evaluationMode == 1"> <el-col :span="12" v-if="item.samplingProcessRespVO.evaluationMode == 1">
<el-form-item label="缺陷级别"> <el-form-item label="缺陷级别">
<el-select <el-select v-model="cur.defectLevel" placeholder="请选择缺陷级别" disabled>
v-model="cur.defectLevel" <el-option
placeholder="请选择缺陷级别" v-for="dict in getStrDictOptions(DICT_TYPE.DEFECT_LEVEL)"
disabled>
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.DEFECT_LEVEL)"
:key="dict.value" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value"/> :value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -313,7 +366,6 @@ import { DynamicRule } from '@/views/qms/basicDataManage/dynamicRule/dynamicRule
import * as SelectedSetApi from '@/api/qms/selectedSet' // import * as SelectedSetApi from '@/api/qms/selectedSet' //
import { SelectedSet } from '@/views/qms/basicDataManage/selectedSet/selectedSet.data' // import { SelectedSet } from '@/views/qms/basicDataManage/selectedSet/selectedSet.data' //
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const message = useMessage() // const message = useMessage() //
@ -354,12 +406,12 @@ const props = defineProps({
required: true, required: true,
default: null default: null
}, },
// rules // rules
rules: { rules: {
type: Object, type: Object,
required: true, required: true,
default: null default: null
}, }
}) })
const { t } = useI18n() // const { t } = useI18n() //
@ -400,7 +452,7 @@ if (props.basicFormWidth) {
} }
const rules = ref({ const rules = ref({
...props.rules, ...props.rules,
'inspectionJobCharacteristicsUpdateReqVO.description': [ 'inspectionJobCharacteristicsUpdateReqVO.description': [
{ required: true, message: '请填写描述', trigger: ['blur', 'change'] } { required: true, message: '请填写描述', trigger: ['blur', 'change'] }
], ],
'inspectionJobCharacteristicsUpdateReqVO.inspectionMethodCode': [ 'inspectionJobCharacteristicsUpdateReqVO.inspectionMethodCode': [
@ -437,22 +489,17 @@ const rules = ref({
{ required: true, message: '请输入选择集编码', trigger: 'change' } { required: true, message: '请输入选择集编码', trigger: 'change' }
], ],
'inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime': [ 'inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime': [
{ required: true, message: '请输入选择开始时间', trigger: 'change'} { required: true, message: '请输入选择开始时间', trigger: 'change' }
], ],
'inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime': [ 'inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime': [
{ required: true, message: '请输入选择结束时间', trigger: 'blur' } { required: true, message: '请输入选择结束时间', trigger: 'blur' }
], ],
qualifiedQuantity: [ qualifiedQuantity: [{ required: true, message: '请输入选择结束时间', trigger: 'blur' }]
{ required: true, message: '请输入选择结束时间', trigger: 'blur' }
],
}) })
/** 打开弹窗 */ /** 打开弹窗 */
let tabIndex = 1 let tabIndex = 1
const open = async (type: string, row?: any, masterParmas?: any, titleName?: any) => { const open = async (type: string, row?: any, masterParmas?: any, titleName?: any) => {
dialogVisible.value = true
if (titleName) { if (titleName) {
dialogTitle.value = t('action.' + titleName) dialogTitle.value = t('action.' + titleName)
} else { } else {
@ -468,30 +515,32 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
editableTabsValue.value = index + 1 editableTabsValue.value = index + 1
item.name = index + 1 item.name = index + 1
item.inspectionJobCharacteristicsUpdateReqVO = item.inspectionJobCharacteristicsRespVO item.inspectionJobCharacteristicsUpdateReqVO = item.inspectionJobCharacteristicsRespVO
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList=[] item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = []
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod==0) {
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
for(let i=0;i<data.value.sampleTotalAmount;i++){ if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 0) {
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
inspectionValue:'',// for (let i = 0; i < data.value.sampleTotalAmount; i++) {
qualitativeCode:'',// item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
estimateCode:'',// inspectionValue: '', //
defectLevel:'',// qualitativeCode: '', //
qualifiedQuantity:'',// estimateCode: '', //
unqualifiedQuantity:'',// defectLevel: '', //
}) qualifiedQuantity: '', //
} unqualifiedQuantity: '' //
})
}
} else { } else {
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList=[{ item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [
inspectionValue:'',// {
qualitativeCode:'',// inspectionValue: '', //
estimateCode:'',// qualitativeCode: '', //
defectLevel:'',// estimateCode: '', //
qualifiedQuantity:'',// defectLevel: '', //
unqualifiedQuantity:'',// qualifiedQuantity: '', //
}] unqualifiedQuantity: '' //
}
]
} }
// //
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping) { if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping) {
@ -511,7 +560,11 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
} }
}) })
data.value.subList = list data.value.subList = list
formMainRef.value.setValues(row)
dialogVisible.value = true
nextTick(() => {
formMainRef.value.setValues(row)
})
} else { } else {
data.value = { data.value = {
code: '', code: '',
@ -528,7 +581,7 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
subList: [] subList: []
} }
} }
dialogVisible.value = true
tabIndex = data.value.subList.length + 1 tabIndex = data.value.subList.length + 1
} }
defineExpose({ open, dialogVisible, formLoading }) // open defineExpose({ open, dialogVisible, formLoading }) // open
@ -633,51 +686,66 @@ const validateForm = (formRef) => {
const submitForm = async () => { const submitForm = async () => {
try { try {
console.log(data.value.subList) console.log(data.value.subList)
// const validateForm1 = await validateForm(formMainRef.value) // const validateForm1 = await validateForm(formMainRef.value)
const elForm = unref(formMainRef)?.getElFormRef() const elForm = unref(formMainRef)?.getElFormRef()
// //
if (!elForm) return if (!elForm) return
const valid = await elForm.validate() const valid = await elForm.validate()
if (!valid) return if (!valid) return
// const bol1 = await validateForm(formProcessRef.value) // const bol1 = await validateForm(formProcessRef.value)
const bol2 = await validateForm(formFeaturesRef.value) const bol2 = await validateForm(formFeaturesRef.value)
if (!bol2) { if (!bol2) {
message.error(`模板中有检验工序和检验特性未填写完全`) message.error(`模板中有检验工序和检验特性未填写完全`)
return return
} }
// //
let arrBol = data.value.subList.map((item, index) => { let arrBol = data.value.subList.map((item, index) => {
let arr1 = [] let arr1 = []
if(item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1){ if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) {
arr1.push(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{ arr1.push(
return !cur.qualifiedQuantity || !cur.unqualifiedQuantity item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
})) (cur, key) => {
return !cur.qualifiedQuantity || !cur.unqualifiedQuantity
}
)
)
} }
if(item.samplingProcessRespVO.evaluationMode == 1){ if (item.samplingProcessRespVO.evaluationMode == 1) {
arr1.push(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{ arr1.push(
return !cur.estimateCode ||!cur.defectLevel item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
})) (cur, key) => {
return !cur.estimateCode || !cur.defectLevel
}
)
)
} }
if(item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0){ if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0) {
arr1.push( item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{ arr1.push(
return !cur.inspectionValue item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
})) (cur, key) => {
return !cur.inspectionValue
}
)
)
} }
if(item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1){ if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1) {
arr1.push(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{ arr1.push(
return !cur.qualitativeCode item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
})) (cur, key) => {
return !cur.qualitativeCode
}
)
)
} }
return arr1 return arr1
}) })
// console.log(arrBol) // console.log(arrBol)
// let isEmpty1 = arrBol.filter(item=>item == true) // let isEmpty1 = arrBol.filter(item=>item == true)
// arrBol.forEach(item=>{ // arrBol.forEach(item=>{
// console.log('1q1q') // console.log('1q1q')
// console.log(typeof item) // console.log(typeof item)
// }) // })
// setTimeout(()=>{ // setTimeout(()=>{
// console.log(arrBol.includes(true)) // console.log(arrBol.includes(true))
// },2000) // },2000)
@ -789,22 +857,22 @@ 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.inspectionJobCharacteristicsUpdateReqVO[formField] = val[0].code row.inspectionJobCharacteristicsUpdateReqVO[formField] = val[0].code
if(formField == 'inspectionMethodCode'){ if (formField == 'inspectionMethodCode') {
row.inspectionJobCharacteristicsUpdateReqVO.inspectionMethodName = val[0].description row.inspectionJobCharacteristicsUpdateReqVO.inspectionMethodName = val[0].description
}else if(formField == 'dynamicUpdateCode'){ } else if (formField == 'dynamicUpdateCode') {
row.inspectionJobCharacteristicsUpdateReqVO.dynamicUpdateName = val[0].description row.inspectionJobCharacteristicsUpdateReqVO.dynamicUpdateName = val[0].description
}else if(formField == 'inspectionMethod'){ } else if (formField == 'inspectionMethod') {
row.inspectionJobCharacteristicsUpdateReqVO.inspectionName = val[0].description row.inspectionJobCharacteristicsUpdateReqVO.inspectionName = val[0].description
} }
} else if(type == 'main'){ } 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
} }
if (formField == 'programmeTemplateCode') { if (formField == 'programmeTemplateCode') {
@ -821,7 +889,8 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => {
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit) { if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit) {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = true rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = true
} else { } else {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = false rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required =
false
} }
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget) { if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget) {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = true rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = true
@ -836,36 +905,38 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => {
// emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row) // emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row)
} }
// //
const resultEntryMethodChange = (e,item) => { const resultEntryMethodChange = (e, item) => {
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList =[] item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = []
if (e==0) { if (e == 0) {
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
for(let i=0;i<data.value.sampleTotalAmount;i++){ for (let i = 0; i < data.value.sampleTotalAmount; i++) {
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
inspectionValue:'',// inspectionValue: '', //
qualitativeCode:'',// qualitativeCode: '', //
estimateCode:'',// estimateCode: '', //
defectLevel:'',// defectLevel: '', //
qualifiedQuantity:'',// qualifiedQuantity: '', //
unqualifiedQuantity:'',// unqualifiedQuantity: '' //
}) })
} }
} else { } else {
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList=[{ item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [
inspectionValue:'',// {
qualitativeCode:'',// inspectionValue: '', //
estimateCode:'',// qualitativeCode: '', //
defectLevel:'',// estimateCode: '', //
qualifiedQuantity:'',// defectLevel: '', //
unqualifiedQuantity:'',// qualifiedQuantity: '', //
}] unqualifiedQuantity: '' //
}
]
} }
console.log(222,item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList) console.log(222, item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList)
} }
// //
const changeQualitativeCode= (e,item,cur)=>{ const changeQualitativeCode = (e, item, cur) => {
let obj = item.selectedProjectRespVOList.find(cur=>cur.dictionaryValue==e) let obj = item.selectedProjectRespVOList.find((cur) => cur.dictionaryValue == e)
console.log(obj) console.log(obj)
cur.defectLevel = obj.defectLevel cur.defectLevel = obj.defectLevel
} }

61
src/views/qms/inspection/inspectionJob/index.vue

@ -27,12 +27,6 @@
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<!-- <BasicForm ref="formRef" @success="getList" :rules="InspectionJobMainRules"
:formAllSchemas="InspectionJobMain.allSchemas" :tableAllSchemas="InspectionJobDetail.allSchemas"
:tableFormRules="InspectionJobDetailRules" :tableData="tableData"
:apiUpdate="InspectionJobMainApi.updateInspectionJobMain" :apiCreate="InspectionJobMainApi.createInspectionJobMain"
:isBusiness="true" @handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess" @submitForm="submitForm" /> -->
<AddForm <AddForm
ref="basicFormRef" ref="basicFormRef"
basicFormWidth="80" basicFormWidth="80"
@ -43,6 +37,7 @@
:formAllSchemas="InspectionJobMain.allSchemas" :formAllSchemas="InspectionJobMain.allSchemas"
@submitForm="submitForm" @submitForm="submitForm"
/> />
<!-- 详情 -->
<Detail <Detail
ref="detailRef" :isBasic="false" :allSchemas="InspectionJobMain.allSchemas" ref="detailRef" :isBasic="false" :allSchemas="InspectionJobMain.allSchemas"
:detailAllSchemas="InspectionJobDetail.allSchemas" :detailAllSchemasRules="InspectionJobDetailRules" :detailAllSchemas="InspectionJobDetail.allSchemas" :detailAllSchemasRules="InspectionJobDetailRules"
@ -52,33 +47,23 @@
:apiDelete="InspectionJobDetailApi.deleteInspectionJobDetail" @searchTableSuccessDetail="searchTableSuccessDetail" :apiDelete="InspectionJobDetailApi.deleteInspectionJobDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false" :detailButtonIsShow="true" :isShowAddBtn="false" :detailButtonIsShow="true"
/> />
<!-- 详情 --> <!-- 包装信息 -->
<!-- <Detail ref="detailRef" :isBasic="false" :allSchemas="InspectionJobMain.allSchemas" <listTable ref="listTableRef" titleName="包装信息"/>
:detailAllSchemas="InspectionJobDetail.allSchemas" :detailAllSchemasRules="InspectionJobDetailRules"
:apiCreate="InspectionJobDetailApi.createInspectionJobDetail"
:apiUpdate="InspectionJobDetailApi.updateInspectionJobDetail"
:apiPage="InspectionJobDetailApi.getInspectionJobDetailPage"
:apiDelete="InspectionJobDetailApi.deleteInspectionJobDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false" :detailButtonIsShow="true"/> -->
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/purchase-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" :isShowOut="true" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { InspectionJobMain, InspectionJobMainRules, InspectionJobDetail, InspectionJobDetailRules } from './inspectionJobMain.data' import { InspectionJobMain, InspectionJobMainRules, InspectionJobDetail, InspectionJobDetailRules,InspectionJobPackage} from './inspectionJobMain.data'
import { InspectionTemplateMain,InspectionTemplateProcess,InspectionTemplateFeatures,InspectionTemplateRules } from '../../basicDataManage/inspectionTemplate/inspectionTemplate.data' import { InspectionTemplateMain,InspectionTemplateProcess,InspectionTemplateFeatures,InspectionTemplateRules } from '../../basicDataManage/inspectionTemplate/inspectionTemplate.data'
import * as InspectionJobMainApi from '@/api/qms/inspectionJob/inspectionJobMain' import * as InspectionJobMainApi from '@/api/qms/inspectionJob/inspectionJobMain'
import * as InspectionJobDetailApi from '@/api/qms/inspectionJob/inspectionJobDetail' import * as InspectionJobDetailApi from '@/api/qms/inspectionJob/inspectionJobDetail'
import * as InspectionJobPackageApi from '@/api/qms/inspectionJob/inspectionJobPackage'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import listTable from '@/components/listTable/src/listTable.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import AddForm from './addForm.vue' import AddForm from './addForm.vue'
import Detail from './detail.vue' import Detail from './detail.vue'
import * as InspectionPlanApi from '@/api/qms/inspectionPlan'
// //
defineOptions({ name: 'InspectionJobMain' }) defineOptions({ name: 'InspectionJobMain' })
@ -140,19 +125,9 @@
// //
const HeadButttondata = [ const HeadButttondata = [
// defaultButtons.defaultAddBtn(null), //
// defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
] ]
// //
@ -187,13 +162,17 @@
defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-job-main:close'}), // defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-job-main:close'}), //
// defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2'])}), // // defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2'])}), // defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListPackageBtn({hide:isShowMainButton(row,['2'])}), //
] ]
} }
const listTableRef = ref()
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'mainJobExe') { // if (val == 'mainJobExe') { //
execute('execute', row) execute('execute', row)
}else if (val == 'mainPackage') { //
const list = await InspectionJobPackageApi.getInspectionJobPackageList(row.id)
listTableRef.value.openPackage(row,'包装信息',InspectionJobPackage.allSchemas.tableColumns,list)
} }
else if (val == 'mainJobClo') { // else if (val == 'mainJobClo') { //
handleDelete(row.id) handleDelete(row.id)
@ -256,14 +235,6 @@
}) })
const tableData = ref([]) const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
// //
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
@ -291,16 +262,6 @@
importFormRef.value.open() importFormRef.value.open()
} }
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '采购订单主导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
// //
const searchFormClick = (searchData) => { const searchFormClick = (searchData) => {

65
src/views/qms/inspection/inspectionJob/inspectionJobMain.data.ts

@ -318,17 +318,17 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
{ // {
label: '使用决策', // label: '使用决策',
field: 'usageDecision', // field: 'usageDecision',
sort: 'custom', // sort: 'custom',
isSearch: false, // isSearch: false,
dictType: DICT_TYPE.USAGE_DECISION, // dictType: DICT_TYPE.USAGE_DECISION,
form:{ // form:{
componentProps:{ // componentProps:{
} // }
} // }
}, // },
{ {
label: '是否可用', label: '是否可用',
field: 'available', field: 'available',
@ -363,11 +363,11 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
//表单校验 //表单校验
export const InspectionJobMainRules = reactive({ export const InspectionJobMainRules = reactive({
usageDecision: [required], // usageDecision: [required],
}) })
/** /**
* @returns {Array} * @returns {Array}
*/ */
export const InspectionJobDetail = useCrudSchemas(reactive<CrudSchema[]>([ export const InspectionJobDetail = useCrudSchemas(reactive<CrudSchema[]>([
{ {
@ -458,3 +458,42 @@ export const InspectionJobDetailRules = reactive({
sequenceCode: [required], sequenceCode: [required],
available: [required], available: [required],
}) })
/**
* @returns {Array}
*/
export const InspectionJobPackage = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编码',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '包装号',
field: 'packageCode',
sort: 'custom',
isSearch: true,
},
{
label: '包装规格',
field: 'packageSpecificationCode',
sort: 'custom',
isSearch: true,
},
{
label: '数量',
field: 'amount',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '计量单位',
field: 'measuringUnit',
sort: 'custom',
isSearch: true,
},
]))

10
src/views/qms/inspection/inspectionRecord/index.vue

@ -51,15 +51,19 @@
:apiDelete="InspectionRecordDetailApi.deleteInspectionRecordDetail" @searchTableSuccessDetail="searchTableSuccessDetail" :apiDelete="InspectionRecordDetailApi.deleteInspectionRecordDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false" :detailButtonIsShow="true" :isShowAddBtn="false" :detailButtonIsShow="true"
/> />
<!-- 导入 --> <!-- 包装信息 -->
<listTable ref="listTableRef" titleName="包装信息"/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { InspectionRecordMain, InspectionRecordMainRules, InspectionRecordDetail, InspectionRecordDetailRules } from './inspectionRecordMain.data' import { InspectionRecordMain, InspectionRecordMainRules, InspectionRecordDetail, InspectionRecordDetailRules } from './inspectionRecordMain.data'
import { InspectionJobPackage} from './inspectionJobMain.data'
import * as InspectionRecordMainApi from '@/api/qms/inspectionRecord/inspectionRecordMain' import * as InspectionRecordMainApi from '@/api/qms/inspectionRecord/inspectionRecordMain'
import * as InspectionRecordDetailApi from '@/api/qms/inspectionRecord/inspectionRecordDetail' import * as InspectionRecordDetailApi from '@/api/qms/inspectionRecord/inspectionRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as InspectionJobPackageApi from '@/api/qms/inspectionJob/inspectionJobPackage'
import listTable from '@/components/listTable/src/listTable.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import Detail from './detail.vue' import Detail from './detail.vue'
@ -172,10 +176,14 @@
] ]
} }
const listTableRef = ref()
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') { //
openForm('update', row) openForm('update', row)
}else if (val == 'mainPackage') { //
const list = await InspectionJobPackageApi.getInspectionJobPackageList(row.id)
listTableRef.value.openPackage(row,'包装信息',InspectionJobPackage.allSchemas.tableColumns,list)
} }
else if (val == 'delete') { // else if (val == 'delete') { //
handleDelete(row.id) handleDelete(row.id)

Loading…
Cancel
Save