Browse Source

检验任务

master_hella_20240701
zhang_li 8 months ago
parent
commit
7398927cf1
  1. 26
      src/api/qms/inspectionJob/inspectionJobDetail/index.ts
  2. 48
      src/api/qms/inspectionRecord/inspectionRecordDetail/index.ts
  3. 16
      src/api/qms/inspectionRecord/inspectionRecordMain/index.ts
  4. 127
      src/views/qms/inspection/inspectionJob/addForm.vue
  5. 310
      src/views/qms/inspection/inspectionJob/detail.vue
  6. 16
      src/views/qms/inspection/inspectionJob/index.vue
  7. 310
      src/views/qms/inspection/inspectionRecord/detail.vue
  8. 18
      src/views/qms/inspection/inspectionRecord/index.vue

26
src/api/qms/inspectionJob/inspectionJobDetail/index.ts

@ -1,27 +1,5 @@
import request from '@/config/axios'
export interface InspectionJobDetailVO {
number: string
applicationDate: localdate
applicationTime: Date
requestStartTime: Date
requestEndTime: Date
finishTime: Date
supplierCode: string
materialCode: string
batch: string
requestInspectionNum: number
referenceOrderCode: string
referenceOrderRow: number
referenceCertificateCode: string
referenceCertificateRow: number
inspectionSchemeCode: string
inspectionStageCode: string
applicationPackageCode: string
inspectionLevel: string
aqlValue: number
available: string
}
// 查询检验申请列表
export const getInspectionJobDetailPage = async (params) => {
@ -44,12 +22,12 @@ export const getInspectionJobDetail = async (id: number) => {
}
// 新增检验申请
export const createInspectionJobDetail = async (data: InspectionJobDetailVO) => {
export const createInspectionJobDetail = async (data) => {
return await request.post({ url: `/qms/inspection-job-detail/create`, data })
}
// 修改检验申请
export const updateInspectionJobDetail = async (data: InspectionJobDetailVO) => {
export const updateInspectionJobDetail = async (data) => {
return await request.put({ url: `/qms/inspection-job-detail/update`, data })
}

48
src/api/qms/inspectionRecord/inspectionRecordDetail/index.ts

@ -1,65 +1,47 @@
import request from '@/config/axios'
export interface InspectionRecordDetailVO {
number: string
applicationDate: localdate
applicationTime: Date
requestStartTime: Date
requestEndTime: Date
finishTime: Date
supplierCode: string
materialCode: string
batch: string
requestInspectionNum: number
referenceOrderCode: string
referenceOrderRow: number
referenceCertificateCode: string
referenceCertificateRow: number
inspectionSchemeCode: string
inspectionStageCode: string
applicationPackageCode: string
inspectionLevel: string
aqlValue: number
available: string
}
// 查询检验申请列表
export const getInspectionRecordDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/inspection/inspection-recordord-detail/senior', data })
return await request.post({ url: '/qms/inspection-record-detail/senior', data })
} else {
return await request.get({ url: `/inspection/inspectirecordrecord-detail/page`, params })
return await request.get({ url: `/qms/inspection-record-detail/page`, params })
}
}
// 查询检验申请列表
export const getInspectionRecordDetailList = async (id: number) => {
return await request.get({ url: `/qms/inspection-record-detail/list?masterId=` + id })
}
// 查询检验申请详情
export const getInspectionRecordDetail = async (id: number) => {
return await request.get({ url: `/inspection/insperecordon-record-detail/get?id=` + id })
return await request.get({ url: `/qms/inspection-record-detail/get?id=` + id })
}
// 新增检验申请
export const createInspectionRecordDetail = async (data: InspectionRecordDetailVO) => {
return await request.post({ url: `/inspection/inrecordction-record-detail/create`, data })
export const createInspectionRecordDetail = async (data) => {
return await request.post({ url: `/qms/inspection-record-detail/create`, data })
}
// 修改检验申请
export const updateInspectionRecordDetail = async (data: InspectionRecordDetailVO) => {
return await request.put({ url: `/inspectionrecordspection-record-detail/update`, data })
export const updateInspectionRecordDetail = async (data) => {
return await request.put({ url: `/qms/inspection-record-detail/update`, data })
}
// 删除检验申请
export const deleteInspectionRecordDetail = async (id: number) => {
return await request.delete({ url: `/inspectrecord/inspection-record-detail/delete?id=` + id })
return await request.delete({ url: `/qms/inspection-record-detail/delete?id=` + id })
}
// 导出检验申请 Excel
export const exportInspectionRecordDetail = async (params) => {
return await request.download({ url: `/insprecordion/inspection-record-detail/export-excel`, params })
return await request.download({ url: `/qms/inspection-record-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/irecordection/inspection-record-detail/get-import-template' })
return request.download({ url: '/qms/inspection-record-detail/get-import-template' })
}

16
src/api/qms/inspectionRecord/inspectionRecordMain/index.ts

@ -28,38 +28,38 @@ export const getInspectionRecordMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/inspection/inspection-record-main/senior', data })
return await request.post({ url: '/qms/inspection-record-main/senior', data })
} else {
return await request.get({ url: `/inspection/inspection-record-main/page`, params })
return await request.get({ url: `/qms/inspection-record-main/page`, params })
}
}
// 查询检验申请详情
export const getInspectionRecordMain = async (id: number) => {
return await request.get({ url: `/inspection/inspection-record-main/get?id=` + id })
return await request.get({ url: `/qms/inspection-record-main/get?id=` + id })
}
// 新增检验申请
export const createInspectionRecordMain = async (data: InspectionRecordMainVO) => {
return await request.post({ url: `/inspection/inspection-record-main/create`, data })
return await request.post({ url: `/qms/inspection-record-main/create`, data })
}
// 修改检验申请
export const updateInspectionRecordMain = async (data: InspectionRecordMainVO) => {
return await request.put({ url: `/inspection/inspection-record-main/update`, data })
return await request.put({ url: `/qms/inspection-record-main/update`, data })
}
// 删除检验申请
export const deleteInspectionRecordMain = async (id: number) => {
return await request.delete({ url: `/inspection/inspection-record-main/delete?id=` + id })
return await request.delete({ url: `/qms/inspection-record-main/delete?id=` + id })
}
// 导出检验申请 Excel
export const exportInspectionRecordMain = async (params) => {
return await request.download({ url: `/inspection/inspection-record-main/export-excel`, params })
return await request.download({ url: `/qms/inspection-record-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/inspection/inspection-record-main/get-import-template' })
return request.download({ url: '/qms/inspection-record-main/get-import-template' })
}

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

@ -20,7 +20,6 @@
/>
<el-tabs
v-model="editableTabsValue"
editable
class="demo-tabs"
@edit="handleTabsEdit"
type="border-card"
@ -207,7 +206,6 @@
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1">
<el-form-item label="合格数量">
<el-input v-model="cur.qualifiedQuantity" placeholder="请输入合格数量"/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1">
@ -315,6 +313,9 @@ import { DynamicRule } from '@/views/qms/basicDataManage/dynamicRule/dynamicRule
import * as SelectedSetApi from '@/api/qms/selectedSet' //
import { SelectedSet } from '@/views/qms/basicDataManage/selectedSet/selectedSet.data' //
const { proxy } = getCurrentInstance()
const message = useMessage() //
const props = defineProps({
@ -441,6 +442,9 @@ const rules = ref({
'inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime': [
{ required: true, message: '请输入选择结束时间', trigger: 'blur' }
],
qualifiedQuantity: [
{ required: true, message: '请输入选择结束时间', trigger: 'blur' }
],
})
@ -465,30 +469,30 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
item.name = index + 1
item.inspectionJobCharacteristicsUpdateReqVO = item.inspectionJobCharacteristicsRespVO
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList=[]
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod==0) {
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
for(let i=0;i<data.value.sampleTotalAmount;i++){
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
inspectionValue:'',//
qualitativeCode:'',//
estimateCode:'',//
defectLevel:'',//
qualifiedQuantity:'',//
unqualifiedQuantity:'',//
})
}
} else {
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList=[{
inspectionValue:'',//
qualitativeCode:'',//
estimateCode:'',//
defectLevel:'',//
qualifiedQuantity:'',//
unqualifiedQuantity:'',//
}]
}
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod==0) {
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
for(let i=0;i<data.value.sampleTotalAmount;i++){
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
inspectionValue:'',//
qualitativeCode:'',//
estimateCode:'',//
defectLevel:'',//
qualifiedQuantity:'',//
unqualifiedQuantity:'',//
})
}
} else {
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList=[{
inspectionValue:'',//
qualitativeCode:'',//
estimateCode:'',//
defectLevel:'',//
qualifiedQuantity:'',//
unqualifiedQuantity:'',//
}]
}
//
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping) {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
@ -638,50 +642,45 @@ const submitForm = async () => {
const valid = await elForm.validate()
if (!valid) return
// const bol1 = await validateForm(formProcessRef.value)
// const bol2 = await validateForm(formFeaturesRef.value)
// console.log(bol2)
// if (!bol2) {
// message.error(``)
// return
// }
const bol2 = await validateForm(formFeaturesRef.value)
if (!bol2) {
message.error(`模板中有检验工序和检验特性未填写完全`)
return
}
//
let arrBol = data.value.subList.map((item, index) => {
let arr1 = []
if(item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1){
return item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{
arr1.push(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{
return !cur.qualifiedQuantity || !cur.unqualifiedQuantity
})
}))
}
if(item.samplingProcessRespVO.evaluationMode == 1){
arr1.push(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{
return !cur.estimateCode ||!cur.defectLevel
}))
}
if(item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0){
arr1.push( item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{
return !cur.inspectionValue
}))
}
if(item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1){
arr1.push(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{
return !cur.qualitativeCode
}))
}
return arr1
})
console.log(arrBol)
let isEmpty1 = arrBol.some(item=>item== true)
if (isEmpty1) {
proxy.$modal.msgError("请填写完整信息");
return;
}
return
// if (!data.value.process || data.value.process.length == 0) {
// message.error(``)
// return
// }
// const bol1 = await validateForm(formProcessRef.value)
// const bol2 = await validateForm(formFeaturesRef.value)
// if (!bol1 || !bol2) {
// message.error(``)
// return
// }
// const arr = data.value.process.filter(
// (item) =>
// !item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping &&
// !item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit &&
// !item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget &&
// item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0
// )
// console.log(arr)
// if (arr && arr.length > 0) {
// const str = arr.map((item) => item.description).join(',')
// message.error(`${str}线,,`)
// return
// }
// console.log(arrBol)
// let isEmpty1 = arrBol.filter(item=>item == true)
// arrBol.forEach(item=>{
// console.log('1q1q')
// console.log(typeof item)
// })
// setTimeout(()=>{
// console.log(arrBol.includes(true))
// },2000)
if (formType.value == 'create') {
//
emit('submitForm', formType.value, data.value)

310
src/views/qms/inspection/inspectionJob/detail.vue

@ -0,0 +1,310 @@
<template>
<div>
<el-drawer
v-model="isShowDrawer"
title="详情"
direction="rtl"
size="80%"
v-loading="detailLoading"
>
<template #header>
<div class="font-size-18px">
{{ titleValueRef }} <span class="ml-20px font-size-16px">{{ titleNameRef }}</span>
</div>
</template>
<ContentWrap v-if="!isBasic">
<Descriptions
:data="data"
labelClassName="label-class-name"
label-align="left"
direction="vertical"
:column="8"
:schema="allSchemas.detailSchema"
:columns="2"
width="200px"
/>
</ContentWrap>
<ContentWrap>
<el-tabs
v-model="editableTabsValue"
class="demo-tabs"
type="border-card"
tab-position="left"
:stretch="false"
>
<el-tab-pane
v-for="item in data.subList"
:key="item.name"
:label="item.processCode"
:name="item.name"
>
<div class="small-title">检验工序</div>
<el-form :model="item" label-width="auto" ref="formProcessRef">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="编码" prop="processCode">
<el-input v-model="item.processCode" placeholder="根据系统生成" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检验方案模板编码">
<el-input
v-model="item.inspectionCode"
placeholder="根据系统生成"
:disabled="true"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="processDescribe">
<el-input v-model="item.processDescribe" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="顺序号" prop="sequenceCode">
<el-input v-model="item.sequenceCode" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检验特性编码">
<el-input
v-model="item.inspectionCharCode"
placeholder="根据系统生成"
:disabled="true"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="small-title">检验特性</div>
<el-form :model="item" label-width="auto" ref="formFeaturesRef">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="编码">
<el-input
v-model="item.inspectionJobCharacteristicsRespVO.number"
placeholder="根据系统生成"
:disabled="true"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="inspectionJobCharacteristicsRespVO.description">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.description" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="检验方法"
prop="inspectionJobCharacteristicsRespVO.inspectionMethodCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionJobCharacteristicsRespVO.inspectionMethodName"
disabled
placeholder="请选择检验方法"
/>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="采样过程编码"
prop="inspectionJobCharacteristicsRespVO.inspectionMethod"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionJobCharacteristicsRespVO.inspectionName"
disabled
placeholder="请选择采样过程编码"
/>
</div>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item
label="动态修改规则编码"
prop="inspectionJobCharacteristicsRespVO.dynamicUpdateCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionJobCharacteristicsRespVO.dynamicUpdateName"
disabled
placeholder="请选择动态修改规则编码"
/>
</div>
</el-form-item>
</el-col> -->
<el-col :span="12">
<el-form-item
label="是否允许修改特征值"
prop="inspectionJobCharacteristicsRespVO.isCanUpdate"
>
<el-switch
v-model="item.inspectionJobCharacteristicsRespVO.isCanUpdate"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="结果录入方式"
prop="inspectionJobCharacteristicsRespVO.resultEntryMethod"
>
<el-select
v-model="item.inspectionJobCharacteristicsRespVO.resultEntryMethod"
placeholder="请选择结果录入方式"
@change="resultEntryMethodChange($event,item)"
disabled
>
<el-option
v-for="dict in getStrDictOptions(
DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY
)"
: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="inspectionJobCharacteristicsRespVO.featureType">
<el-select
v-model="item.inspectionJobCharacteristicsRespVO.featureType"
placeholder="请选择特征类型"
@change="changeFeatureType"
disabled
>
<el-option v-for="dict in getStrDictOptions( DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE )"
: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="inspectionJobCharacteristicsRespVO.inspectionStartTime">
<el-date-picker
v-model="item.inspectionJobCharacteristicsRespVO.inspectionStartTime"
type="datetime"
placeholder="请选择开始时间"
style="width: 100%"
value-format="x"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="结束时间" prop="inspectionJobCharacteristicsRespVO.inspectionEndTime">
<el-date-picker
v-model="item.inspectionJobCharacteristicsRespVO.inspectionEndTime"
type="datetime"
placeholder="请选择结束时间"
style="width: 100%"
value-format="x"
disabled
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-tab-pane>
</el-tabs>
</ContentWrap>
</el-drawer>
</div>
</template>
<script lang="ts" setup>
import * as InspectionJobDetailPageApi from '@/api/qms/inspectionJob/inspectionJobDetail'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
defineOptions({ name: 'Detail' })
const editableTabsValue = ref('1')
const message = useMessage() //
const { t } = useI18n() //
const updateKey = ref(0)
const props = defineProps({
//
allSchemas: {
type: Object,
required: true,
default: null
},
//
detailAllSchemas: {
type: Object,
required: true,
default: null
},
//
buttondataTable: {
type: Array,
required: false,
default: ()=>{
return []
}
},
})
const isShowDrawer = ref(false)
const detailLoading = ref(false)
const data = ref({
code: '',
itemCode: '',
version: '',
testTypeCode: '',
programmeTemplateCode: '',
splitRule: '',
aql: '',
inspectionLevel: '',
effectiveDate: '',
expirationDate: '',
available: 'TRUE',
subList: []
})
/** 打开弹窗 */
const formRef = ref()
const titleNameRef = ref()
const titleValueRef = ref()
const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => {
titleNameRef.value = titleName
titleValueRef.value = titleValue
isShowDrawer.value = true
if (row) {
detailLoading.value = true
try {
data.value = row
let list = []
list = await InspectionJobDetailPageApi.getInspectionJobDetailList(row.id)
list.forEach((item, index) => {
editableTabsValue.value = index + 1
item.name = index + 1
})
data.value.subList = list
} finally {
detailLoading.value = false
}
}
}
defineExpose({ openDetail }) // open
</script>
<style lang="scss">
.el-drawer__body {
background: #f5f5f5 !important;
}
::v-deep(.label-class-name) {
color: #dedede;
}
</style>
<style scoped lang="scss"></style>

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

@ -43,14 +43,23 @@
:formAllSchemas="InspectionJobMain.allSchemas"
@submitForm="submitForm"
/>
<Detail
ref="detailRef" :isBasic="false" :allSchemas="InspectionJobMain.allSchemas"
:detailAllSchemas="InspectionJobDetail.allSchemas" :detailAllSchemasRules="InspectionJobDetailRules"
:apiCreate="InspectionJobDetailApi.createInspectionJobDetail"
:apiUpdate="InspectionJobDetailApi.updateInspectionJobDetail"
:apiPage="InspectionJobDetailApi.getInspectionJobDetailPage"
:apiDelete="InspectionJobDetailApi.deleteInspectionJobDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false" :detailButtonIsShow="true"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="false" :allSchemas="InspectionJobMain.allSchemas"
<!-- <Detail ref="detailRef" :isBasic="false" :allSchemas="InspectionJobMain.allSchemas"
:detailAllSchemas="InspectionJobDetail.allSchemas" :detailAllSchemasRules="InspectionJobDetailRules"
:apiCreate="InspectionJobDetailApi.createInspectionJobDetail"
:apiUpdate="InspectionJobDetailApi.updateInspectionJobDetail"
:apiPage="InspectionJobDetailApi.getInspectionJobDetailPage"
:apiDelete="InspectionJobDetailApi.deleteInspectionJobDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false" :detailButtonIsShow="true"/>
:isShowAddBtn="false" :detailButtonIsShow="true"/> -->
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/purchase-main/import" :importTemplateData="importTemplateData"
@ -68,6 +77,7 @@
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import AddForm from './addForm.vue'
import Detail from './detail.vue'
import * as InspectionPlanApi from '@/api/qms/inspectionPlan'
//
@ -131,7 +141,7 @@
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultExportBtn(null), //
// defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //

310
src/views/qms/inspection/inspectionRecord/detail.vue

@ -0,0 +1,310 @@
<template>
<div>
<el-drawer
v-model="isShowDrawer"
title="详情"
direction="rtl"
size="80%"
v-loading="detailLoading"
>
<template #header>
<div class="font-size-18px">
{{ titleValueRef }} <span class="ml-20px font-size-16px">{{ titleNameRef }}</span>
</div>
</template>
<ContentWrap v-if="!isBasic">
<Descriptions
:data="data"
labelClassName="label-class-name"
label-align="left"
direction="vertical"
:column="8"
:schema="allSchemas.detailSchema"
:columns="2"
width="200px"
/>
</ContentWrap>
<ContentWrap>
<el-tabs
v-model="editableTabsValue"
class="demo-tabs"
type="border-card"
tab-position="left"
:stretch="false"
>
<el-tab-pane
v-for="item in data.subList"
:key="item.name"
:label="item.processCode"
:name="item.name"
>
<div class="small-title">检验工序</div>
<el-form :model="item" label-width="auto" ref="formProcessRef">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="编码" prop="processCode">
<el-input v-model="item.processCode" placeholder="根据系统生成" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检验方案模板编码">
<el-input
v-model="item.inspectionCode"
placeholder="根据系统生成"
:disabled="true"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="processDescribe">
<el-input v-model="item.processDescribe" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="顺序号" prop="sequenceCode">
<el-input v-model="item.sequenceCode" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检验特性编码">
<el-input
v-model="item.inspectionCharCode"
placeholder="根据系统生成"
:disabled="true"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="small-title">检验特性</div>
<el-form :model="item" label-width="auto" ref="formFeaturesRef">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="编码">
<el-input
v-model="item.inspectionJobCharacteristicsRespVO.number"
placeholder="根据系统生成"
:disabled="true"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="inspectionJobCharacteristicsRespVO.description">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.description" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="检验方法"
prop="inspectionJobCharacteristicsRespVO.inspectionMethodCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionJobCharacteristicsRespVO.inspectionMethodName"
disabled
placeholder="请选择检验方法"
/>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="采样过程编码"
prop="inspectionJobCharacteristicsRespVO.inspectionMethod"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionJobCharacteristicsRespVO.inspectionName"
disabled
placeholder="请选择采样过程编码"
/>
</div>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item
label="动态修改规则编码"
prop="inspectionJobCharacteristicsRespVO.dynamicUpdateCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionJobCharacteristicsRespVO.dynamicUpdateName"
disabled
placeholder="请选择动态修改规则编码"
/>
</div>
</el-form-item>
</el-col> -->
<el-col :span="12">
<el-form-item
label="是否允许修改特征值"
prop="inspectionJobCharacteristicsRespVO.isCanUpdate"
>
<el-switch
v-model="item.inspectionJobCharacteristicsRespVO.isCanUpdate"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="结果录入方式"
prop="inspectionJobCharacteristicsRespVO.resultEntryMethod"
>
<el-select
v-model="item.inspectionJobCharacteristicsRespVO.resultEntryMethod"
placeholder="请选择结果录入方式"
@change="resultEntryMethodChange($event,item)"
disabled
>
<el-option
v-for="dict in getStrDictOptions(
DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY
)"
: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="inspectionJobCharacteristicsRespVO.featureType">
<el-select
v-model="item.inspectionJobCharacteristicsRespVO.featureType"
placeholder="请选择特征类型"
@change="changeFeatureType"
disabled
>
<el-option v-for="dict in getStrDictOptions( DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE )"
: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="inspectionJobCharacteristicsRespVO.inspectionStartTime">
<el-date-picker
v-model="item.inspectionJobCharacteristicsRespVO.inspectionStartTime"
type="datetime"
placeholder="请选择开始时间"
style="width: 100%"
value-format="x"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="结束时间" prop="inspectionJobCharacteristicsRespVO.inspectionEndTime">
<el-date-picker
v-model="item.inspectionJobCharacteristicsRespVO.inspectionEndTime"
type="datetime"
placeholder="请选择结束时间"
style="width: 100%"
value-format="x"
disabled
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-tab-pane>
</el-tabs>
</ContentWrap>
</el-drawer>
</div>
</template>
<script lang="ts" setup>
import * as InspectionRecordDetailPageApi from '@/api/qms/inspectionRecord/inspectionRecordDetail'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
defineOptions({ name: 'InspectionRecordDetail' })
const editableTabsValue = ref('1')
const message = useMessage() //
const { t } = useI18n() //
const updateKey = ref(0)
const props = defineProps({
//
allSchemas: {
type: Object,
required: true,
default: null
},
//
detailAllSchemas: {
type: Object,
required: true,
default: null
},
//
buttondataTable: {
type: Array,
required: false,
default: ()=>{
return []
}
},
})
const isShowDrawer = ref(false)
const detailLoading = ref(false)
const data = ref({
code: '',
itemCode: '',
version: '',
testTypeCode: '',
programmeTemplateCode: '',
splitRule: '',
aql: '',
inspectionLevel: '',
effectiveDate: '',
expirationDate: '',
available: 'TRUE',
subList: []
})
/** 打开弹窗 */
const formRef = ref()
const titleNameRef = ref()
const titleValueRef = ref()
const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => {
titleNameRef.value = titleName
titleValueRef.value = titleValue
isShowDrawer.value = true
if (row) {
detailLoading.value = true
try {
data.value = row
let list = []
list = await InspectionRecordDetailPageApi.getInspectionRecordDetailList(row.id)
list.forEach((item, index) => {
editableTabsValue.value = index + 1
item.name = index + 1
})
data.value.subList = list
} finally {
detailLoading.value = false
}
}
}
defineExpose({ openDetail }) // open
</script>
<style lang="scss">
.el-drawer__body {
background: #f5f5f5 !important;
}
::v-deep(.label-class-name) {
color: #dedede;
}
</style>
<style scoped lang="scss"></style>

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

@ -35,17 +35,23 @@
@handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess" @submitForm="submitForm" />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="false" :allSchemas="InspectionRecordMain.allSchemas"
<!-- <Detail ref="detailRef" :isBasic="false" :allSchemas="InspectionRecordMain.allSchemas"
:detailAllSchemas="InspectionRecordDetail.allSchemas" :detailAllSchemasRules="InspectionRecordDetailRules"
:apiCreate="InspectionRecordDetailApi.createInspectionRecordDetail"
:apiUpdate="InspectionRecordDetailApi.updateInspectionRecordDetail"
:apiPage="InspectionRecordDetailApi.getInspectionRecordDetailPage"
:apiDelete="InspectionRecordDetailApi.deleteInspectionRecordDetail"
@searchTableSuccessDetail="searchTableSuccessDetail" :isShowAddBtn="false" :detailButtonIsShow="true" />
@searchTableSuccessDetail="searchTableSuccessDetail" :isShowAddBtn="false" :detailButtonIsShow="true" /> -->
<Detail
ref="detailRef" :isBasic="false" :allSchemas="InspectionRecordMain.allSchemas"
:detailAllSchemas="InspectionRecordDetail.allSchemas" :detailAllSchemasRules="InspectionRecordDetailRules"
:apiCreate="InspectionRecordDetailApi.createInspectionRecordDetail"
:apiUpdate="InspectionRecordDetailApi.updateInspectionRecordDetail"
:apiPage="InspectionRecordDetailApi.getInspectionRecordDetailPage"
:apiDelete="InspectionRecordDetailApi.deleteInspectionRecordDetail" @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>
<script setup lang="ts">
@ -55,7 +61,7 @@
import * as InspectionRecordDetailApi from '@/api/qms/inspectionRecord/inspectionRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from './detail.vue'
//
defineOptions({ name: 'InspectionRecordMain' })

Loading…
Cancel
Save