Browse Source

检验任务,记录模板,方案添加变革记录和详情

hella_online_20240904
zhang_li 3 months ago
parent
commit
8d9769078d
  1. 2
      src/components/Detail/src/Detail.vue
  2. 342
      src/views/qms/inspectionJob/detail.vue
  3. 25
      src/views/qms/inspectionJob/index.vue
  4. 759
      src/views/qms/inspectionRecord/detail.vue
  5. 28
      src/views/qms/inspectionRecord/index.vue
  6. 764
      src/views/qms/inspectionRecordFirst/detail.vue
  7. 476
      src/views/qms/inspectionRecordFirst/index.vue
  8. 430
      src/views/qms/inspectionScheme/detail.vue
  9. 20
      src/views/qms/inspectionScheme/index.vue
  10. 46
      src/views/qms/inspectionScheme/inspectionScheme.data.ts
  11. 423
      src/views/qms/inspectionTemplate/detail.vue
  12. 16
      src/views/qms/inspectionTemplate/index.vue

2
src/components/Detail/src/Detail.vue

@ -44,6 +44,8 @@
:schema="allSchemas.detailSchema"
:columns="2"
/>
<!-- 检验工序用到插槽 -->
<slot v-if="isBasic && !tabsExtend" :data="detailData" name="basicBottom" :key="detailData.id"></slot>
<!-- 单表切换tabs 展现table -->
<Table
v-if="isBasic && tabsExtend"

342
src/views/qms/inspectionJob/detail.vue

@ -1,104 +1,165 @@
<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.processDescribe" :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="描述" 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-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.samplingProcessCode">
<div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.samplingProcessName" disabled placeholder="请选择采样过程编码" />
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="样品份数" prop="inspectionJobCharacteristicsRespVO.sampleQty">
<div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.sampleQty" disabled placeholder="请输入样品份数" />
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="每份样品量" prop="inspectionJobCharacteristicsRespVO.samplePieceSize">
<div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.samplePieceSize" 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-row>
</el-form>
</el-tab-pane>
</el-tabs>
</ContentWrap>
</el-drawer>
<div style="margin-top: 20px">
<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.processDescribe"
: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="描述" 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-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.samplingProcessCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionJobCharacteristicsRespVO.samplingProcessName"
disabled
placeholder="请选择采样过程编码"
/>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="样品份数" prop="inspectionJobCharacteristicsRespVO.sampleQty">
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionJobCharacteristicsRespVO.sampleQty"
disabled
placeholder="请输入样品份数"
/>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="每份样品量"
prop="inspectionJobCharacteristicsRespVO.samplePieceSize"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionJobCharacteristicsRespVO.samplePieceSize"
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-row>
</el-form>
</el-tab-pane>
</el-tabs>
</div>
</template>
@ -108,79 +169,26 @@ 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: {
data: {
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
})
console.log(props.data)
const data = ref(props.data.data)
const editableTabsValue = ref('1')
onMounted(async () => {
let list = []
list = await InspectionJobDetailPageApi.getInspectionJobDetailList(data.value.id)
list.forEach((item, index) => {
editableTabsValue.value = index + 1
item.name = index + 1
})
data.value.subList = list
})
</script>
<style lang="scss">
.el-drawer__body {

25
src/views/qms/inspectionJob/index.vue

@ -61,21 +61,12 @@
@submitForm="submitForm"
@close="getList"
/>
<!-- 详情 -->
<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="true" :allSchemas="InspectionJobMain.allSchemas">
<template #basicBottom="data">
<DetailView :data="data" />
</template>
</Detail>
<!-- 包装信息 -->
<ListTable
ref="listTableRef"
@ -120,7 +111,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import ListTable from '@/components/ListTable/src/ListTable.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import AddForm from './addForm.vue'
import Detail from './detail.vue'
import DetailView from './detail.vue'
import { getReportUrl } from '@/utils/systemParam'
import { useUserStore } from '@/store/modules/user'
import { formatDate } from '@/utils/formatTime'
@ -347,7 +338,7 @@ const checkQualityReport = async (row) => {
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicInspectionJobMain')
detailRef.value.openDetail(row, titleName, titleValue, 'jobInspectionMain')
}
//

759
src/views/qms/inspectionRecord/detail.vue

@ -1,123 +1,112 @@
<template>
<div>
<el-drawer
v-model="isShowDrawer"
title="详情"
direction="rtl"
size="80%"
v-loading="detailLoading"
<div style="margin-top: 20px">
<el-tabs
v-model="editableTabsValue"
class="demo-tabs"
type="border-card"
tab-position="left"
:stretch="false"
>
<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.processDescribe"
: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="描述" 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-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.inspectionRecordCharacteristicsRespVO.number"
placeholder="根据系统生成"
:disabled="true"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="inspectionRecordCharacteristicsRespVO.description">
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.description" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="检验方法"
prop="inspectionRecordCharacteristicsRespVO.inspectionMethodCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionRecordCharacteristicsRespVO.inspectionMethodName"
disabled
placeholder="请输入检验方法"
/>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="采样过程"
prop="inspectionRecordCharacteristicsRespVO.inspectionMethod"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionRecordCharacteristicsRespVO.samplingProcessName"
disabled
placeholder="请输入采样过程"
/>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="采样过程编码" prop="inspectionRecordCharacteristicsRespVO.samplingProcessCode">
<div style="display: flex; width: 100%">
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.samplingProcessName" disabled placeholder="请选择采样过程编码" />
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="样品份数" prop="inspectionRecordCharacteristicsRespVO.sampleQty">
<div style="display: flex; width: 100%">
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.sampleQty" disabled placeholder="请输入样品份数" />
</div>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-tab-pane
v-for="item in data.subList"
:key="item.name"
:label="item.processDescribe"
: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="描述" 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-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.inspectionRecordCharacteristicsRespVO.number"
placeholder="根据系统生成"
:disabled="true"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="inspectionRecordCharacteristicsRespVO.description">
<el-input
v-model="item.inspectionRecordCharacteristicsRespVO.description"
:disabled="true"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="检验方法"
prop="inspectionRecordCharacteristicsRespVO.inspectionMethodCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionRecordCharacteristicsRespVO.inspectionMethodName"
disabled
placeholder="请输入检验方法"
/>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="采样过程"
prop="inspectionRecordCharacteristicsRespVO.inspectionMethod"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionRecordCharacteristicsRespVO.samplingProcessName"
disabled
placeholder="请输入采样过程"
/>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="采样过程编码"
prop="inspectionRecordCharacteristicsRespVO.samplingProcessCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionRecordCharacteristicsRespVO.samplingProcessName"
disabled
placeholder="请选择采样过程编码"
/>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="样品份数" prop="inspectionRecordCharacteristicsRespVO.sampleQty">
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionRecordCharacteristicsRespVO.sampleQty"
disabled
placeholder="请输入样品份数"
/>
</div>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item
label="动态修改规则编码"
prop="inspectionRecordCharacteristicsRespVO.dynamicUpdateCode"
@ -131,181 +120,317 @@
</div>
</el-form-item>
</el-col> -->
<el-col :span="12">
<el-form-item
label="是否允许修改特征值"
prop="inspectionRecordCharacteristicsRespVO.isCanUpdate"
>
<el-switch
v-model="item.inspectionRecordCharacteristicsRespVO.isCanUpdate"
<el-col :span="12">
<el-form-item
label="是否允许修改特征值"
prop="inspectionRecordCharacteristicsRespVO.isCanUpdate"
>
<el-switch
v-model="item.inspectionRecordCharacteristicsRespVO.isCanUpdate"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="结果录入方式"
prop="inspectionRecordCharacteristicsRespVO.resultEntryMethod"
>
<el-select
v-model="item.inspectionRecordCharacteristicsRespVO.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="inspectionRecordCharacteristicsRespVO.featureType"
>
<el-select
v-model="item.inspectionRecordCharacteristicsRespVO.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="inspectionRecordCharacteristicsRespVO.inspectionStartTime"
>
<el-date-picker
v-model="item.inspectionRecordCharacteristicsRespVO.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="inspectionRecordCharacteristicsRespVO.inspectionEndTime"
>
<el-date-picker
v-model="item.inspectionRecordCharacteristicsRespVO.inspectionEndTime"
type="datetime"
placeholder="请选择结束时间"
style="width: 100%"
value-format="x"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="计量单位"
prop="inspectionRecordCharacteristicsRespVO.quantifyUom"
v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0"
>
<el-select
v-model="item.inspectionRecordCharacteristicsRespVO.quantifyUom"
placeholder="请选择计量单位"
disabled
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.UOM)"
: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="inspectionRecordCharacteristicsRespVO.quantifyDecimal"
v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0"
>
<el-input
v-model="item.inspectionRecordCharacteristicsRespVO.quantifyDecimal"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0">
<el-form-item
label="是否设定上限"
prop="inspectionCharacteristicsBaseVO.quantifyIsCapping"
>
<el-switch
v-model="item.inspectionRecordCharacteristicsRespVO.quantifyIsCapping"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0">
<el-form-item
prop="inspectionRecordCharacteristicsRespVO.quantifyIsLowlimit"
label="是否设定下限"
>
<el-switch
v-model="item.inspectionRecordCharacteristicsRespVO.quantifyIsLowlimit"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
prop="inspectionRecordCharacteristicsRespVO.quantifyIsTarget"
label="是否设定目标值"
v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0"
>
<el-switch
v-model="item.inspectionRecordCharacteristicsRespVO.quantifyIsTarget"
disabled
/>
</el-form-item>
</el-col>
<el-col
:span="12"
v-if="
item.inspectionRecordCharacteristicsRespVO.featureType == 0 &&
item.inspectionRecordCharacteristicsRespVO.quantifyIsCapping
"
>
<el-form-item
label="上限值"
prop="inspectionRecordCharacteristicsRespVO.quantifyCapping"
>
<el-input
v-model="item.inspectionRecordCharacteristicsRespVO.quantifyCapping"
type="number"
disabled
/>
</el-form-item>
</el-col>
<el-col
:span="12"
v-if="
item.inspectionRecordCharacteristicsRespVO.featureType == 0 &&
item.inspectionRecordCharacteristicsRespVO.quantifyIsLowlimit
"
>
<el-form-item
label="下限值"
prop="inspectionRecordCharacteristicsRespVO.quantifyLowlimit"
>
<el-input
v-model="item.inspectionRecordCharacteristicsRespVO.quantifyLowlimit"
type="number"
disabled
/>
</el-form-item>
</el-col>
<el-col
:span="12"
v-if="
item.inspectionRecordCharacteristicsRespVO.featureType == 0 &&
item.inspectionRecordCharacteristicsRespVO.quantifyIsTarget
"
>
<el-form-item
label="目标值"
prop="inspectionRecordCharacteristicsRespVO.quantifyTarget"
>
<el-input
v-model="item.inspectionRecordCharacteristicsRespVO.quantifyTarget"
type="number"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="评估代码">
<el-select
v-model="item.inspectionRecordCharacteristicsRespVO.estimateCode"
placeholder="请选择评估代码"
disabled
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.EVALUATION_CODE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
disabled
/>
</el-select>
</el-form-item>
</el-col>
<el-col
:span="24"
v-for="(cur, i) in item.inspectionRecordCharacteristicsRespVO
.recordInspectionQuantifyList"
:key="i"
style="
border: 1px solid #dedede;
border-radius: 4px;
padding-top: 16px;
margin-bottom: 10px;
"
>
<el-row>
<!-- 汇总录入的时候显示 -->
<el-col
:span="12"
v-if="item.inspectionRecordCharacteristicsRespVO.resultEntryMethod == 1"
>
<el-form-item label="合格数量">
<el-input
v-model="cur.qualifiedQuantity"
placeholder="请输入合格数量"
type="number"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="结果录入方式"
prop="inspectionRecordCharacteristicsRespVO.resultEntryMethod"
>
<el-select
v-model="item.inspectionRecordCharacteristicsRespVO.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="inspectionRecordCharacteristicsRespVO.featureType">
<el-select
v-model="item.inspectionRecordCharacteristicsRespVO.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="inspectionRecordCharacteristicsRespVO.inspectionStartTime">
<el-date-picker
v-model="item.inspectionRecordCharacteristicsRespVO.inspectionStartTime"
type="datetime"
placeholder="请选择开始时间"
style="width: 100%"
value-format="x"
<el-col
:span="12"
v-if="item.inspectionRecordCharacteristicsRespVO.resultEntryMethod == 1"
>
<el-form-item label="不合格数量">
<el-input
v-model="cur.unqualifiedQuantity"
type="number"
placeholder="请输入不合格数量"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="结束时间" prop="inspectionRecordCharacteristicsRespVO.inspectionEndTime">
<el-date-picker
v-model="item.inspectionRecordCharacteristicsRespVO.inspectionEndTime"
type="datetime"
placeholder="请选择结束时间"
style="width: 100%"
value-format="x"
<el-col
:span="12"
v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '0'"
>
<el-form-item label="检验值">
<el-input
v-model="cur.inspectionValue"
placeholder="请输入检验值"
type="number"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="计量单位" prop="inspectionRecordCharacteristicsRespVO.quantifyUom" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0" >
<el-select v-model="item.inspectionRecordCharacteristicsRespVO.quantifyUom" placeholder="请选择计量单位" disabled >
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.UOM)"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
<el-col
:span="12"
v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '1'"
>
<el-form-item label="选定集">
<el-select v-model="cur.qualitativeCode" placeholder="请选择选定集" disabled>
<el-option
v-for="dict in item.selectedProjectRespVOList"
:key="dict.dictionaryValue"
:label="dict.dictionaryLabel"
:value="dict.dictionaryValue"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="小数位" prop="inspectionRecordCharacteristicsRespVO.quantifyDecimal" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0" >
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.quantifyDecimal" disabled/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0">
<el-form-item label="是否设定上限" prop="inspectionCharacteristicsBaseVO.quantifyIsCapping" >
<el-switch v-model="item.inspectionRecordCharacteristicsRespVO.quantifyIsCapping" disabled/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0">
<el-form-item prop="inspectionRecordCharacteristicsRespVO.quantifyIsLowlimit" label="是否设定下限" >
<el-switch v-model="item.inspectionRecordCharacteristicsRespVO.quantifyIsLowlimit" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="inspectionRecordCharacteristicsRespVO.quantifyIsTarget" label="是否设定目标值" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0" >
<el-switch v-model="item.inspectionRecordCharacteristicsRespVO.quantifyIsTarget" disabled/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0 && item.inspectionRecordCharacteristicsRespVO.quantifyIsCapping">
<el-form-item label="上限值" prop="inspectionRecordCharacteristicsRespVO.quantifyCapping" >
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.quantifyCapping" type="number" disabled/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0 && item.inspectionRecordCharacteristicsRespVO.quantifyIsLowlimit">
<el-form-item label="下限值" prop="inspectionRecordCharacteristicsRespVO.quantifyLowlimit" >
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.quantifyLowlimit" type="number" disabled/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0 && item.inspectionRecordCharacteristicsRespVO.quantifyIsTarget">
<el-form-item label="目标值" prop="inspectionRecordCharacteristicsRespVO.quantifyTarget" >
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.quantifyTarget" type="number" disabled/>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="评估代码">
<el-select v-model="item.inspectionRecordCharacteristicsRespVO.estimateCode" placeholder="请选择评估代码" disabled>
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.EVALUATION_CODE)" :key="dict.value" :label="dict.label" :value="dict.value" disabled/>
<el-col
:span="12"
v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '1'"
>
<el-form-item label="缺陷级别">
<el-select v-model="cur.defectLevel" placeholder="请选择缺陷级别" disabled>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.DEFECT_LEVEL)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24" v-for="(cur, i) in item.inspectionRecordCharacteristicsRespVO.recordInspectionQuantifyList" :key="i" style="border: 1px solid #dedede; border-radius: 4px; padding-top: 16px; margin-bottom: 10px;">
<el-row>
<!-- 汇总录入的时候显示 -->
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.resultEntryMethod == 1">
<el-form-item label="合格数量">
<el-input v-model="cur.qualifiedQuantity" placeholder="请输入合格数量" type="number" disabled/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.resultEntryMethod == 1">
<el-form-item label="不合格数量">
<el-input v-model="cur.unqualifiedQuantity" type="number" placeholder="请输入不合格数量" disabled/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '0'">
<el-form-item label="检验值">
<el-input v-model="cur.inspectionValue" placeholder="请输入检验值" type="number" disabled/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '1'">
<el-form-item label="选定集">
<el-select
v-model="cur.qualitativeCode"
placeholder="请选择选定集"
disabled
>
<el-option
v-for="dict in item.selectedProjectRespVOList"
:key="dict.dictionaryValue"
:label="dict.dictionaryLabel"
:value="dict.dictionaryValue"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '1'" >
<el-form-item label="缺陷级别">
<el-select v-model="cur.defectLevel" placeholder="请选择缺陷级别" disabled>
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.DEFECT_LEVEL)" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-col>
</el-row>
</el-form>
</el-tab-pane>
</el-tabs>
</ContentWrap>
</el-drawer>
</el-col>
</el-row>
</el-form>
</el-tab-pane>
</el-tabs>
</div>
</template>
@ -315,80 +440,30 @@ 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: {
data: {
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
item.inspectionRecordCharacteristicsRespVO.recordInspectionQuantifyList = item.inspectionRecordCharacteristicsRespVO.featureType == 1 ? item.inspectionRecordCharacteristicsRespVO.qualitativeRespVOList : item.inspectionRecordCharacteristicsRespVO.quantifyRespVOList
})
data.value.subList = list
} finally {
detailLoading.value = false
}
}
}
defineExpose({ openDetail }) // open
})
console.log(props.data)
const data = ref(props.data.data)
const editableTabsValue = ref('1')
onMounted(async () => {
let list = []
list = await InspectionRecordDetailPageApi.getInspectionRecordDetailList(data.value.id)
list.forEach((item, index) => {
editableTabsValue.value = index + 1
item.name = index + 1
item.inspectionRecordCharacteristicsRespVO.recordInspectionQuantifyList =
item.inspectionRecordCharacteristicsRespVO.featureType == 1
? item.inspectionRecordCharacteristicsRespVO.qualitativeRespVOList
: item.inspectionRecordCharacteristicsRespVO.quantifyRespVOList
})
data.value.subList = list
})
</script>
<style lang="scss">
.el-drawer__body {

28
src/views/qms/inspectionRecord/index.vue

@ -68,20 +68,12 @@
@submitForm="submitFormExecute"
/>
<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"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="InspectionRecordMain.allSchemas">
<template #basicBottom="data">
<DetailView :data="data" />
</template>
</Detail>
<!-- 包装信息 -->
<ListTable
ref="listTableRef"
@ -123,7 +115,7 @@ import ListTable from '@/components/ListTable/src/ListTable.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import UseAddForm from './useAddForm.vue'
import AddForm from './addForm.vue'
import Detail from './detail.vue'
import DetailView from './detail.vue'
import * as InspectionJobMainApi from '@/api/qms/inspectionJob/inspectionJobMain'
import { getReportUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime'
@ -245,7 +237,7 @@ const isShowPackageBtn = (row, val) => {
const butttondata = (row) => {
return [
// defaultButtons.mainListOrderCOMPLETEBtn({ hide: isShowMainButton(row, ['INCOMPLETE']) }), //
defaultButtons.mainApplyDecisionBtn({
// hide: isShowMainButton(row, null),
hasPermi: 'qms:inspection-recode-main:edit'
@ -255,7 +247,7 @@ const butttondata = (row) => {
hide: isShowMainButton(row, 'publish'),
hasPermi: 'qms:inspection-recode-main:pub'
}), //
defaultButtons.mainListCloseBtn({
defaultButtons.mainListCloseBtn({
hide: isShowMainButton(row, 'publish'),
hasPermi: 'qms:inspection-recode-main:close'
}), //
@ -347,7 +339,7 @@ const openUseForm = async (type: string, row?: any) => {
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicInspectionRecordMain')
detailRef.value.openDetail(row, titleName, titleValue, 'recordInspectionMain')
}
/** 删除按钮操作 */

764
src/views/qms/inspectionRecordFirst/detail.vue

@ -1,123 +1,112 @@
<template>
<div>
<el-drawer
v-model="isShowDrawer"
title="详情"
direction="rtl"
size="80%"
v-loading="detailLoading"
<div style="margin-top: 20px">
<el-tabs
v-model="editableTabsValue"
class="demo-tabs"
type="border-card"
tab-position="left"
:stretch="false"
>
<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.processDescribe"
: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="描述" 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-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.inspectionRecordCharacteristicsRespVO.number"
placeholder="根据系统生成"
:disabled="true"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="inspectionRecordCharacteristicsRespVO.description">
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.description" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="检验方法"
prop="inspectionRecordCharacteristicsRespVO.inspectionMethodCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionRecordCharacteristicsRespVO.inspectionMethodName"
disabled
placeholder="请输入检验方法"
/>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="采样过程"
prop="inspectionRecordCharacteristicsRespVO.inspectionMethod"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionRecordCharacteristicsRespVO.samplingProcessName"
disabled
placeholder="请输入采样过程"
/>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="采样过程编码" prop="inspectionRecordCharacteristicsRespVO.samplingProcessCode">
<div style="display: flex; width: 100%">
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.samplingProcessName" disabled placeholder="请选择采样过程编码" />
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="样品份数" prop="inspectionRecordCharacteristicsRespVO.sampleQty">
<div style="display: flex; width: 100%">
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.sampleQty" disabled placeholder="请输入样品份数" />
</div>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-tab-pane
v-for="item in data.subList"
:key="item.name"
:label="item.processDescribe"
: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="描述" 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-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.inspectionRecordCharacteristicsRespVO.number"
placeholder="根据系统生成"
:disabled="true"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="inspectionRecordCharacteristicsRespVO.description">
<el-input
v-model="item.inspectionRecordCharacteristicsRespVO.description"
:disabled="true"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="检验方法"
prop="inspectionRecordCharacteristicsRespVO.inspectionMethodCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionRecordCharacteristicsRespVO.inspectionMethodName"
disabled
placeholder="请输入检验方法"
/>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="采样过程"
prop="inspectionRecordCharacteristicsRespVO.inspectionMethod"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionRecordCharacteristicsRespVO.samplingProcessName"
disabled
placeholder="请输入采样过程"
/>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="采样过程编码"
prop="inspectionRecordCharacteristicsRespVO.samplingProcessCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionRecordCharacteristicsRespVO.samplingProcessName"
disabled
placeholder="请选择采样过程编码"
/>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="样品份数" prop="inspectionRecordCharacteristicsRespVO.sampleQty">
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionRecordCharacteristicsRespVO.sampleQty"
disabled
placeholder="请输入样品份数"
/>
</div>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item
label="动态修改规则编码"
prop="inspectionRecordCharacteristicsRespVO.dynamicUpdateCode"
@ -131,186 +120,317 @@
</div>
</el-form-item>
</el-col> -->
<el-col :span="12">
<el-form-item
label="是否允许修改特征值"
prop="inspectionRecordCharacteristicsRespVO.isCanUpdate"
>
<el-switch
v-model="item.inspectionRecordCharacteristicsRespVO.isCanUpdate"
<el-col :span="12">
<el-form-item
label="是否允许修改特征值"
prop="inspectionRecordCharacteristicsRespVO.isCanUpdate"
>
<el-switch
v-model="item.inspectionRecordCharacteristicsRespVO.isCanUpdate"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="结果录入方式"
prop="inspectionRecordCharacteristicsRespVO.resultEntryMethod"
>
<el-select
v-model="item.inspectionRecordCharacteristicsRespVO.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="inspectionRecordCharacteristicsRespVO.featureType"
>
<el-select
v-model="item.inspectionRecordCharacteristicsRespVO.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="inspectionRecordCharacteristicsRespVO.inspectionStartTime"
>
<el-date-picker
v-model="item.inspectionRecordCharacteristicsRespVO.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="inspectionRecordCharacteristicsRespVO.inspectionEndTime"
>
<el-date-picker
v-model="item.inspectionRecordCharacteristicsRespVO.inspectionEndTime"
type="datetime"
placeholder="请选择结束时间"
style="width: 100%"
value-format="x"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="计量单位"
prop="inspectionRecordCharacteristicsRespVO.quantifyUom"
v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0"
>
<el-select
v-model="item.inspectionRecordCharacteristicsRespVO.quantifyUom"
placeholder="请选择计量单位"
disabled
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.UOM)"
: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="inspectionRecordCharacteristicsRespVO.quantifyDecimal"
v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0"
>
<el-input
v-model="item.inspectionRecordCharacteristicsRespVO.quantifyDecimal"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0">
<el-form-item
label="是否设定上限"
prop="inspectionCharacteristicsBaseVO.quantifyIsCapping"
>
<el-switch
v-model="item.inspectionRecordCharacteristicsRespVO.quantifyIsCapping"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0">
<el-form-item
prop="inspectionRecordCharacteristicsRespVO.quantifyIsLowlimit"
label="是否设定下限"
>
<el-switch
v-model="item.inspectionRecordCharacteristicsRespVO.quantifyIsLowlimit"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
prop="inspectionRecordCharacteristicsRespVO.quantifyIsTarget"
label="是否设定目标值"
v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0"
>
<el-switch
v-model="item.inspectionRecordCharacteristicsRespVO.quantifyIsTarget"
disabled
/>
</el-form-item>
</el-col>
<el-col
:span="12"
v-if="
item.inspectionRecordCharacteristicsRespVO.featureType == 0 &&
item.inspectionRecordCharacteristicsRespVO.quantifyIsCapping
"
>
<el-form-item
label="上限值"
prop="inspectionRecordCharacteristicsRespVO.quantifyCapping"
>
<el-input
v-model="item.inspectionRecordCharacteristicsRespVO.quantifyCapping"
type="number"
disabled
/>
</el-form-item>
</el-col>
<el-col
:span="12"
v-if="
item.inspectionRecordCharacteristicsRespVO.featureType == 0 &&
item.inspectionRecordCharacteristicsRespVO.quantifyIsLowlimit
"
>
<el-form-item
label="下限值"
prop="inspectionRecordCharacteristicsRespVO.quantifyLowlimit"
>
<el-input
v-model="item.inspectionRecordCharacteristicsRespVO.quantifyLowlimit"
type="number"
disabled
/>
</el-form-item>
</el-col>
<el-col
:span="12"
v-if="
item.inspectionRecordCharacteristicsRespVO.featureType == 0 &&
item.inspectionRecordCharacteristicsRespVO.quantifyIsTarget
"
>
<el-form-item
label="目标值"
prop="inspectionRecordCharacteristicsRespVO.quantifyTarget"
>
<el-input
v-model="item.inspectionRecordCharacteristicsRespVO.quantifyTarget"
type="number"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="评估代码">
<el-select
v-model="item.inspectionRecordCharacteristicsRespVO.estimateCode"
placeholder="请选择评估代码"
disabled
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.EVALUATION_CODE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
disabled
/>
</el-select>
</el-form-item>
</el-col>
<el-col
:span="24"
v-for="(cur, i) in item.inspectionRecordCharacteristicsRespVO
.recordInspectionQuantifyList"
:key="i"
style="
border: 1px solid #dedede;
border-radius: 4px;
padding-top: 16px;
margin-bottom: 10px;
"
>
<el-row>
<!-- 汇总录入的时候显示 -->
<el-col
:span="12"
v-if="item.inspectionRecordCharacteristicsRespVO.resultEntryMethod == 1"
>
<el-form-item label="合格数量">
<el-input
v-model="cur.qualifiedQuantity"
placeholder="请输入合格数量"
type="number"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="结果录入方式"
prop="inspectionRecordCharacteristicsRespVO.resultEntryMethod"
>
<el-select
v-model="item.inspectionRecordCharacteristicsRespVO.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="inspectionRecordCharacteristicsRespVO.featureType">
<el-select
v-model="item.inspectionRecordCharacteristicsRespVO.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="inspectionRecordCharacteristicsRespVO.inspectionStartTime">
<el-date-picker
v-model="item.inspectionRecordCharacteristicsRespVO.inspectionStartTime"
type="datetime"
placeholder="请选择开始时间"
style="width: 100%"
value-format="x"
<el-col
:span="12"
v-if="item.inspectionRecordCharacteristicsRespVO.resultEntryMethod == 1"
>
<el-form-item label="不合格数量">
<el-input
v-model="cur.unqualifiedQuantity"
type="number"
placeholder="请输入不合格数量"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="结束时间" prop="inspectionRecordCharacteristicsRespVO.inspectionEndTime">
<el-date-picker
v-model="item.inspectionRecordCharacteristicsRespVO.inspectionEndTime"
type="datetime"
placeholder="请选择结束时间"
style="width: 100%"
value-format="x"
<el-col
:span="12"
v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '0'"
>
<el-form-item label="检验值">
<el-input
v-model="cur.inspectionValue"
placeholder="请输入检验值"
type="number"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="计量单位" prop="inspectionRecordCharacteristicsRespVO.quantifyUom" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0" >
<el-select v-model="item.inspectionRecordCharacteristicsRespVO.quantifyUom" placeholder="请选择计量单位" disabled >
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.UOM)"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
<el-col
:span="12"
v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '1'"
>
<el-form-item label="选定集">
<el-select v-model="cur.qualitativeCode" placeholder="请选择选定集" disabled>
<el-option
v-for="dict in item.selectedProjectRespVOList"
:key="dict.dictionaryValue"
:label="dict.dictionaryLabel"
:value="dict.dictionaryValue"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="小数位" prop="inspectionRecordCharacteristicsRespVO.quantifyDecimal" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0" >
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.quantifyDecimal" disabled/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0">
<el-form-item label="是否设定上限" prop="inspectionCharacteristicsBaseVO.quantifyIsCapping" >
<el-switch v-model="item.inspectionRecordCharacteristicsRespVO.quantifyIsCapping" disabled/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0">
<el-form-item prop="inspectionRecordCharacteristicsRespVO.quantifyIsLowlimit" label="是否设定下限" >
<el-switch v-model="item.inspectionRecordCharacteristicsRespVO.quantifyIsLowlimit" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="inspectionRecordCharacteristicsRespVO.quantifyIsTarget" label="是否设定目标值" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0" >
<el-switch v-model="item.inspectionRecordCharacteristicsRespVO.quantifyIsTarget" disabled/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0 && item.inspectionRecordCharacteristicsRespVO.quantifyIsCapping">
<el-form-item label="上限值" prop="inspectionRecordCharacteristicsRespVO.quantifyCapping" >
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.quantifyCapping" type="number" disabled/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0 && item.inspectionRecordCharacteristicsRespVO.quantifyIsLowlimit">
<el-form-item label="下限值" prop="inspectionRecordCharacteristicsRespVO.quantifyLowlimit" >
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.quantifyLowlimit" type="number" disabled/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0 && item.inspectionRecordCharacteristicsRespVO.quantifyIsTarget">
<el-form-item label="目标值" prop="inspectionRecordCharacteristicsRespVO.quantifyTarget" >
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.quantifyTarget" type="number" disabled/>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="评估代码">
<el-select v-model="item.inspectionRecordCharacteristicsRespVO.estimateCode" placeholder="请选择评估代码" disabled>
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.EVALUATION_CODE)" :key="dict.value" :label="dict.label" :value="dict.value" disabled/>
<el-col
:span="12"
v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '1'"
>
<el-form-item label="缺陷级别">
<el-select v-model="cur.defectLevel" placeholder="请选择缺陷级别" disabled>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.DEFECT_LEVEL)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24" v-for="(cur, i) in item.inspectionRecordCharacteristicsRespVO.recordInspectionQuantifyList" :key="i" style="border: 1px solid #dedede; border-radius: 4px; padding-top: 16px; margin-bottom: 10px;">
<el-row>
<!-- 汇总录入的时候显示 -->
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.resultEntryMethod == 1">
<el-form-item label="合格数量">
<el-input v-model="cur.qualifiedQuantity" placeholder="请输入合格数量" type="number" disabled/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.resultEntryMethod == 1">
<el-form-item label="不合格数量">
<el-input v-model="cur.unqualifiedQuantity" type="number" placeholder="请输入不合格数量" disabled/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '0'">
<el-form-item label="检验值">
<el-input v-model="cur.inspectionValue" placeholder="请输入检验值" type="number" disabled/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '1'">
<el-form-item label="选定集">
<el-select
v-model="cur.qualitativeCode"
placeholder="请选择选定集"
disabled
>
<el-option
v-for="dict in item.selectedProjectRespVOList"
:key="dict.dictionaryValue"
:label="dict.dictionaryLabel"
:value="dict.dictionaryValue"
/>
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '1'" >
<el-form-item label="缺陷级别">
<el-select v-model="cur.defectLevel" placeholder="请选择缺陷级别" disabled>
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.DEFECT_LEVEL)" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
</el-col> -->
<el-col :span="12">
<el-form-item label="备注">
<el-input v-model="cur.remark" placeholder="" type="number" disabled/>
</el-form-item>
</el-col>
</el-row>
</el-col>
</el-row>
</el-form>
</el-tab-pane>
</el-tabs>
</ContentWrap>
</el-drawer>
</el-col>
</el-row>
</el-form>
</el-tab-pane>
</el-tabs>
</div>
</template>
@ -320,80 +440,30 @@ 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: {
data: {
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
item.inspectionRecordCharacteristicsRespVO.recordInspectionQuantifyList = item.inspectionRecordCharacteristicsRespVO.featureType == 1 ? item.inspectionRecordCharacteristicsRespVO.qualitativeRespVOList : item.inspectionRecordCharacteristicsRespVO.quantifyRespVOList
})
data.value.subList = list
} finally {
detailLoading.value = false
}
}
}
defineExpose({ openDetail }) // open
})
console.log(props.data)
const data = ref(props.data.data)
const editableTabsValue = ref('1')
onMounted(async () => {
let list = []
list = await InspectionRecordDetailPageApi.getInspectionRecordDetailList(data.value.id)
list.forEach((item, index) => {
editableTabsValue.value = index + 1
item.name = index + 1
item.inspectionRecordCharacteristicsRespVO.recordInspectionQuantifyList =
item.inspectionRecordCharacteristicsRespVO.featureType == 1
? item.inspectionRecordCharacteristicsRespVO.qualitativeRespVOList
: item.inspectionRecordCharacteristicsRespVO.quantifyRespVOList
})
data.value.subList = list
})
</script>
<style lang="scss">
.el-drawer__body {

476
src/views/qms/inspectionRecordFirst/index.vue

@ -1,35 +1,53 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="InspectionRecordMain.allSchemas.searchSchema" @search="setSearchParams"
@reset="setSearchParams"
/>
<Search
:schema="InspectionRecordMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick"
:allSchemas="InspectionRecordMain.allSchemas" />
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="InspectionRecordMain.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{
<Table
v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort">
<template #number="{row}">
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
<ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
<!-- 新增 -->
<AddForm
<AddForm
ref="basicFormRef"
basicFormWidth="80"
:formAllSchemasFeatures="InspectionTemplateFeatures.allSchemas"
@ -39,145 +57,175 @@
@submitForm="submitForm"
/>
<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"
/>
<!-- 包装信息 --> <ListTable ref="listTableRef" titleName="包装信息" :allSchemas="InspectionRecordMain.allSchemas"
:detailAllSchemas="InspectionRecordPackage.allSchemas" :detailAllSchemasRules="InspectionRecordPackageRules"
:list="list"/>
<el-dialog
v-model="showQualityReport"
:title="t('质检明细')"
:append-to-body="false"
destroy-on-close
fullscreen
>
<iframe :height="reportHeight" width="100%" :src="qualityReport" frameborder="0"></iframe>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="InspectionRecordMain.allSchemas">
<template #basicBottom="data">
<DetailView :data="data" />
</template>
</Detail>
<!-- 包装信息 -->
<ListTable
ref="listTableRef"
titleName="包装信息"
:allSchemas="InspectionRecordMain.allSchemas"
:detailAllSchemas="InspectionRecordPackage.allSchemas"
:detailAllSchemasRules="InspectionRecordPackageRules"
:list="list"
/>
<el-dialog
v-model="showQualityReport"
:title="t('质检明细')"
:append-to-body="false"
destroy-on-close
fullscreen
>
<iframe :height="reportHeight" width="100%" :src="qualityReport" frameborder="0"></iframe>
</el-dialog>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { InspectionRecordMain, InspectionRecordMainRules, InspectionRecordDetail, InspectionRecordDetailRules,InspectionRecordPackage, InspectionRecordPackageRules} from './inspectionRecordFirstMain.data'
// import { InspectionJobPackage,InspectionJobPackageRules} from '../inspectionJob/inspectionJobMain.data'
import * as InspectionRecordMainApi from '@/api/qms/inspectionRecord/inspectionRecordMain'
import * as InspectionRecordDetailApi from '@/api/qms/inspectionRecord/inspectionRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import ListTable from '@/components/ListTable/src/ListTable.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import AddForm from '../inspectionRecordFirst/addForm.vue'
import Detail from './detail.vue'
import { getReportUrl } from '@/utils/systemParam'
import download from '@/utils/download'
import {
InspectionRecordMain,
InspectionRecordMainRules,
InspectionRecordDetail,
InspectionRecordDetailRules,
InspectionRecordPackage,
InspectionRecordPackageRules
} from './inspectionRecordFirstMain.data'
// import { InspectionJobPackage,InspectionJobPackageRules} from '../inspectionJob/inspectionJobMain.data'
import * as InspectionRecordMainApi from '@/api/qms/inspectionRecord/inspectionRecordMain'
import * as InspectionRecordDetailApi from '@/api/qms/inspectionRecord/inspectionRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import ListTable from '@/components/ListTable/src/ListTable.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import AddForm from '../inspectionRecordFirst/addForm.vue'
import DetailView from './detail.vue'
import { getReportUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime'
import { InspectionTemplateMain,InspectionTemplateProcess,InspectionTemplateFeatures,InspectionTemplateRules } from '../inspectionTemplate/inspectionTemplate.data'
import {
InspectionTemplateMain,
InspectionTemplateProcess,
InspectionTemplateFeatures,
InspectionTemplateRules
} from '../inspectionTemplate/inspectionTemplate.data'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import { usePageLoading } from '@/hooks/web/usePageLoading'
const { loadStart, loadDone } = usePageLoading()
//
defineOptions({ name: 'InspectionRecordMain' })
//
defineOptions({ name: 'InspectionRecordMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(InspectionRecordMain.allSchemas.tableColumns)
if(routeName.value=='InspectRecordMain'){
tableColumns.value = tableColumns.value.filter(item=>{
return item.label!='操作'
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(InspectionRecordMain.allSchemas.tableColumns)
if (routeName.value == 'InspectRecordMain') {
tableColumns.value = tableColumns.value.filter((item) => {
return item.label != '操作'
})
}
//
const updataTableColumns = (val) => {
if (routeName.value == 'InspectRecordMain') {
tableColumns.value = val.filter((item) => {
return item.label != '操作'
})
} else {
tableColumns.value = val
}
//
const updataTableColumns = (val) => {
if(routeName.value=='InspectRecordMain'){
tableColumns.value = val.filter(item=>{
return item.label!='操作'
})
}else{
tableColumns.value = val
}
}
}
//
const { tableObject, tableMethods } = useTable({
getListApi: InspectionRecordMainApi.getInspectionRecordMainPage //
})
//
const { tableObject, tableMethods } = useTable({
getListApi: InspectionRecordMainApi.getInspectionRecordMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const { getList, setSearchParams } = tableMethods
//
let HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
//
let HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null) //
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
if (val == 'add') {
//
openForm('create')
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
const isShowMainButton = (row, val) => {
return row.isPublished
}
const isShowMainButton = (row, val) => {
return row.isPublished
}
// -
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({ hide: isShowMainButton(row, 'publish'),hasPermi: 'wms:inspection-recode-first-main:update' }), //
defaultButtons.mainListDeleteBtn({ hide: isShowMainButton(row, 'publish'),hasPermi: 'wms:inspection-recode-first-main:delete' }), //
defaultButtons.mainListOrderPubBtn({ hide: isShowMainButton(row, 'publish'), hasPermi: 'qms:inspection-recode-first-main:pub' }), //
defaultButtons.mainExport({ hide: !row.isPublished }),//
defaultButtons.mainListPlanCheckQualityReportBtn({}) //
]
}
// -
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({
hide: isShowMainButton(row, 'publish'),
hasPermi: 'wms:inspection-recode-first-main:update'
}), //
defaultButtons.mainListDeleteBtn({
hide: isShowMainButton(row, 'publish'),
hasPermi: 'wms:inspection-recode-first-main:delete'
}), //
defaultButtons.mainListOrderPubBtn({
hide: isShowMainButton(row, 'publish'),
hasPermi: 'qms:inspection-recode-first-main:pub'
}), //
defaultButtons.mainExport({ hide: !row.isPublished }), //
defaultButtons.mainListPlanCheckQualityReportBtn({}) //
]
}
const listTableRef = ref()
const list = ref([])
const useDecisionList = getStrDictOptions(DICT_TYPE.USAGE_DECISION)
// const useDecisionList = InspectionRecordMain.allSchemas.formSchema.filter(item=>item.field == "useDecision")
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
}else if (val == 'delete') { //
handleDelete(row.id)
}else if (val == 'mainOrderPub') { //
handleOrderPub(row)
}else if (val == 'mainPlanCheckQualityReport') {
const listTableRef = ref()
const list = ref([])
const useDecisionList = getStrDictOptions(DICT_TYPE.USAGE_DECISION)
// const useDecisionList = InspectionRecordMain.allSchemas.formSchema.filter(item=>item.field == "useDecision")
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'delete') {
//
handleDelete(row.id)
} else if (val == 'mainOrderPub') {
//
handleOrderPub(row)
} else if (val == 'mainPlanCheckQualityReport') {
//
checkQualityReport(row)
} else if (val == 'mainExport') {
//
handleMainExport(row)
}
}
}
//
//
const reportHeight = ref(window.innerHeight - 120)
const showQualityReport = ref(false)
const qualityReport = ref('')
@ -185,51 +233,50 @@ const checkQualityReport = async (row) => {
showQualityReport.value = true
qualityReport.value = getReportUrl() + '/purchasereceiptReport?asnNumber=' + row.asnNumber
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = async (type : string, row ?: number) => {
tableData.value = [] //
basicFormRef.value.open(type, row)
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = async (type: string, row?: number) => {
tableData.value = [] //
basicFormRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row : any, titleName : any, titleValue : any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicInspectionRecordMain')
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'recordInspectionMain')
}
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
try {
//
await message.delConfirm()
//
await InspectionRecordMainApi.deleteInspectionRecordMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch { }
}
/** 发布按钮操作 */
const handleOrderPub = async (row : object) => {
try {
//
await message.confirm(t('common.confirmPublish'))
//
await InspectionRecordMainApi.publishInspectionRecordMain(row.id)
message.success(t('common.publishSuccess'))
//
await getList()
} catch { }
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await InspectionRecordMainApi.deleteInspectionRecordMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 发布按钮操作 */
const handleOrderPub = async (row: object) => {
try {
//
await message.confirm(t('common.confirmPublish'))
//
await InspectionRecordMainApi.publishInspectionRecordMain(row.id)
message.success(t('common.publishSuccess'))
//
await getList()
} catch {}
}
/** 列表导出按钮操作 */
const handleMainExport = async (row: any) => {
try {
await message.exportConfirm()
//
loadStart()
//
loadStart()
tableObject.params.number = row.number
const excelTitle = ref(route.meta.title)
const data = await InspectionRecordMainApi.exportInspectionRecordMain(tableObject.params)
@ -240,72 +287,71 @@ const handleMainExport = async (row: any) => {
}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
loadStart()
const excelTitle = ref(route.meta.title)
const data = await InspectionRecordMainApi.exportFirstInspectionRecordMain(tableObject.params)
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
loadStart()
const excelTitle = ref(route.meta.title)
const data = await InspectionRecordMainApi.exportFirstInspectionRecordMain(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
loadDone()
}
} catch {
} finally {
loadDone()
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
InspectionRecordDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
/**
* tableForm方法
*/
const tableFormKeys = {}
InspectionRecordDetail.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
// //
const submitForm = async (formType, data) => {
// data.subList = tableData.value //
try {
basicFormRef.value.formLoading = true
if (formType === 'create') {
await InspectionRecordMainApi.createInspectionRecordMain(data)
message.success(t('common.createSuccess'))
}else {
await InspectionRecordMainApi.updateInspectionRecordFirstMain(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
//
getList()
} finally {
basicFormRef.value.formLoading = false
const submitForm = async (formType, data) => {
// data.subList = tableData.value //
try {
basicFormRef.value.formLoading = true
if (formType === 'create') {
await InspectionRecordMainApi.createInspectionRecordMain(data)
message.success(t('common.createSuccess'))
} else {
await InspectionRecordMainApi.updateInspectionRecordFirstMain(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
//
getList()
} finally {
basicFormRef.value.formLoading = false
}
//
}
//
const searchFormClick = (searchData) => {
searchData.filters.push({
action: "==",
column: "inspectionType",
value: "11"
})
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
action: '==',
column: 'inspectionType',
value: '11'
})
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
/** 初始化 **/
onMounted(async () => {
tableObject.params = {
available: 'TRUE',
inspectionType:'11'
}
getList()
})
tableObject.params = {
available: 'TRUE',
inspectionType: '11'
}
getList()
})
</script>

430
src/views/qms/inspectionScheme/detail.vue

@ -0,0 +1,430 @@
<template>
<div class="main-body">
<div class="left">
<div
class="tabs-label"
:class="element.name == editableTabsValue ? 'active' : ''"
v-for="(element, index) in data.process"
:key="index"
@click.stop="chooseTabs(element, index)"
>
<span>{{ element.description }}</span>
</div>
</div>
<div class="right">
<div v-for="(item, index) in data.process" :key="index">
<div v-show="item.name == editableTabsValue">
<div class="small-title">检验工序</div>
<el-form :model="item" label-width="auto" :rules="rules" ref="formProcessRef">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="编码" prop="code">
<el-input v-model="item.code" 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="description">
<el-input v-model="item.description" :disabled="true"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="顺序号" prop="sequenceCode">
<el-input v-model="item.sequenceCode" disabled />
</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" :rules="rules" ref="formFeaturesRef">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="编码">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.code"
placeholder="根据系统生成"
:disabled="true"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="inspectionCharacteristicsBaseVO.description">
<el-input v-model="item.inspectionCharacteristicsBaseVO.description" disabled/>
</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.inspectionMethodCode"
placeholder="请选择检验方法"
disabled
/>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="检验方法描述"
prop="inspectionCharacteristicsBaseVO.inspectionMethodName"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.inspectionMethodName"
disabled
placeholder="请选择检验方法"
/>
</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.samplingProcessCode"
placeholder="请选择采样过程"
disabled
/>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="采样过程描述"
prop="inspectionCharacteristicsBaseVO.inspectionMethodName"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.inspectionMethodName"
disabled
placeholder="请选择采样过程描述"
/>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="是否允许修改特征值"
prop="inspectionCharacteristicsBaseVO.isCanUpdate"
>
<el-switch v-model="item.inspectionCharacteristicsBaseVO.isCanUpdate" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="结果录入方式"
prop="inspectionCharacteristicsBaseVO.resultEntryMethod"
>
<el-select
v-model="item.inspectionCharacteristicsBaseVO.resultEntryMethod"
placeholder="请选择结果录入方式"
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="inspectionCharacteristicsBaseVO.featureType">
<!-- <el-input v-model="item.featureType" /> -->
<el-select
v-model="item.inspectionCharacteristicsBaseVO.featureType"
placeholder="请选择特征类型"
@change="changeFeatureType($event, item)"
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" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
<el-form-item label="计量单位" prop="inspectionCharacteristicsBaseVO.quantifyUom">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyUom"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
<el-form-item label="小数位" prop="inspectionCharacteristicsBaseVO.quantifyDecimal">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyDecimal"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
<el-form-item
label="是否设定上限"
prop="inspectionCharacteristicsBaseVO.quantifyIsCapping"
>
<el-switch
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsCapping"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
<el-form-item
prop="inspectionCharacteristicsBaseVO.quantifyIsLowlimit"
label="是否设定下限"
>
<el-switch
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
<el-form-item
prop="inspectionCharacteristicsBaseVO.quantifyIsTarget"
label="是否设定目标值"
>
<el-switch
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsTarget"
disabled
/>
</el-form-item>
</el-col>
<el-col
:span="12"
v-if="
item.inspectionCharacteristicsBaseVO.featureType == 0 &&
item.inspectionCharacteristicsBaseVO.quantifyIsCapping
"
>
<el-form-item label="上限值" prop="inspectionCharacteristicsBaseVO.quantifyCapping">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyCapping"
disabled
type="number"
/>
</el-form-item>
</el-col>
<el-col
:span="12"
v-if="
item.inspectionCharacteristicsBaseVO.featureType == 0 &&
item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit
"
>
<el-form-item
label="下限值"
prop="inspectionCharacteristicsBaseVO.quantifyLowlimit"
>
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyLowlimit"
disabled
type="number"
/>
</el-form-item>
</el-col>
<el-col
:span="12"
v-if="
item.inspectionCharacteristicsBaseVO.featureType == 0 &&
item.inspectionCharacteristicsBaseVO.quantifyIsTarget
"
>
<el-form-item label="目标值" prop="inspectionCharacteristicsBaseVO.quantifyTarget">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyTarget"
disabled
type="number"
/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 1">
<el-form-item
label="选定集"
prop="inspectionCharacteristicsBaseVO.quantifyQuantifyCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyQuantifyCode"
placeholder="请选择选定集"
disabled
/>
</div>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 1">
<el-form-item
label="选定集描述"
prop="inspectionCharacteristicsBaseVO.quantifyQuantifyName"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyQuantifyName"
disabled
placeholder="请选择选定集描述"
/>
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
</div>
</div>
</template>
<script lang="ts" setup>
import * as InspectionProcessPageApi from '@/api/qms/inspectionTemplate'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const props = defineProps({
data: {
type: Object,
required: true,
default: null
}
})
console.log(props.data)
const data = ref(props.data.data)
const editableTabsValue = ref('1')
onMounted(async () => {
data.value.process = []
let list = []
if (data.value.content) {
list = JSON.parse(data.value.content)
} else {
list = await InspectionProcessPageApi.getListByTempleteCode(data.value.programmeTemplateCode)
}
console.log(99, data.value)
console.log(99, list)
editableTabsValue.value = '1'
let arr = []
list.forEach((item, index) => {
let obj = {
inspectionCode: item.inspectionCode,
description: item.description,
inspectionCharCode: item.inspectionCharCode,
sequenceCode: item.sequenceCode,
name: String(index + 1),
inspectionCharacteristicsBaseVO: {
description: item.inspectionCharacteristicsBaseVO.description,
featureType: item.inspectionCharacteristicsBaseVO.featureType,
inspectionMethodCode: item.inspectionCharacteristicsBaseVO.inspectionMethodCode,
inspectionMethodName: item.inspectionCharacteristicsBaseVO.inspectionMethodName,
samplingProcessCode: item.inspectionCharacteristicsBaseVO.samplingProcessCode,
isCanUpdate: item.inspectionCharacteristicsBaseVO.isCanUpdate,
isDestructionInspection: item.inspectionCharacteristicsBaseVO.isDestructionInspection,
quantifyCapping: item.inspectionCharacteristicsBaseVO.quantifyCapping,
quantifyDecimal: item.inspectionCharacteristicsBaseVO.quantifyDecimal,
quantifyIsCapping: item.inspectionCharacteristicsBaseVO.quantifyIsCapping,
quantifyIsLowlimit: item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit,
quantifyIsTarget: item.inspectionCharacteristicsBaseVO.quantifyIsTarget,
quantifyLowlimit: item.inspectionCharacteristicsBaseVO.quantifyLowlimit,
quantifyQuantifyCode: item.inspectionCharacteristicsBaseVO.quantifyQuantifyCode,
quantifyQuantifyName: item.inspectionCharacteristicsBaseVO.quantifyQuantifyName,
quantifyTarget: item.inspectionCharacteristicsBaseVO.quantifyTarget,
quantifyUom: item.inspectionCharacteristicsBaseVO.quantifyUom,
resultEntryMethod: item.inspectionCharacteristicsBaseVO.resultEntryMethod,
samplingProcessCode: item.inspectionCharacteristicsBaseVO.samplingProcessCode,
samplingProcessName: item.inspectionCharacteristicsBaseVO.samplingProcessName
}
}
data.value.process.push(obj)
})
})
const chooseTabs = (element, index) => {
if (element.name == editableTabsValue.value) return
editableTabsValue.value = element.name
}
console.log(data.value.process)
</script>
<style scoped lang="scss">
.small-title {
font-weight: bold;
padding: 0px 10px 10px;
color: #1a8bfc;
font-size: 16px;
}
.main-body {
display: flex;
margin-top: 20px;
.left {
width: 200px;
background: rgb(245, 247, 250);
border: 1px solid rgb(220, 223, 230);
min-height: 60px;
position: relative;
padding: 6px 0px;
font-size: 14px;
.plus-icon {
cursor: pointer;
position: absolute;
right: 0px;
top: 0px;
border: 1px solid rgb(220, 223, 230);
background: rgb(245, 247, 250);
display: flex;
align-items: center;
justify-items: center;
padding: 1px;
}
}
}
.tabs-label {
padding: 4px 20px 4px 20px;
min-height: 30px;
justify-content: flex-end;
display: flex;
align-items: center;
cursor: pointer;
word-break: break-all;
}
.active {
background: white;
}
.right {
border: 1px solid rgb(220, 223, 230);
flex: 1;
width: 0px;
padding: 20px;
}
</style>

20
src/views/qms/inspectionScheme/index.vue

@ -32,9 +32,9 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #reqCode="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.reqCode)">
<span>{{ row.reqCode }}</span>
<template #code="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
@ -50,13 +50,18 @@
<AddForm
ref="basicFormRef"
basicFormWidth="80"
:formAllSchemasFeatures="InspectionTemplateFeatures.allSchemas"
:formAllSchemasProcess="InspectionTemplateProcess.allSchemas"
:formAllSchemasMain="InspectionTemplateMain.allSchemas"
:formAllSchemasMain="InspectionSchemeMain.allSchemas"
:rules="InspectionTemplateRules"
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="InspectionSchemeMain.allSchemas">
<template #basicBottom="data">
<DetailView :data="data" />
</template>
</Detail>
<!-- 导入 -->
<ImportForm
ref="importFormRef"
@ -80,6 +85,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import AddForm from './addForm.vue'
import DetailView from './detail.vue'
import * as InspectionSchemeApi from '@/api/qms/inspectionScheme'
import ImportForm from '../../../components/ImportForm/src/ImportForm.vue'
import * as SampleCodeApi from '@/api/qms/sampleCode'
@ -248,7 +254,7 @@ const submitForm = async (formType, data) => {
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicAgvLocationrelation')
detailRef.value.openDetail(row, titleName, titleValue, 'basicInspectionScheme')
}
/** 删除按钮操作 */

46
src/views/qms/inspectionScheme/inspectionScheme.data.ts

@ -45,25 +45,26 @@ export const InspectionSchemeMain = useCrudSchemas(
}
},
{
label: '物料名称',
field: 'itemName',
label: '物料编码',
field: 'itemCode',
sort: 'custom',
table: {
width: 200
width: 150
},
isSearch: true
},
{
label: '物料编码',
field: 'itemCode',
label: '物料名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
width: 200
},
isSearch: true
},
{
label: '描述',
label: '方案描述',
field: 'description',
sort: 'custom',
table: {
@ -79,7 +80,7 @@ export const InspectionSchemeMain = useCrudSchemas(
}
},
{
label: '检验类型编码',
label: '检验类型',
field: 'inspectionType',
dictType: DICT_TYPE.INSPECTION_TYPE,
dictClass: 'string',
@ -97,37 +98,15 @@ export const InspectionSchemeMain = useCrudSchemas(
width: 175
}
},
{
label: '拆分规则',
field: 'splitRule',
label: '动态修改规则',
field: 'dynamicUpdateCode',
sort: 'custom',
dictType: DICT_TYPE.SPLIT_RULES,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
table: {
width: 175
}
},
{
label: 'aql',
field: 'aql',
sort: 'custom',
dictType: DICT_TYPE.BASIC_AQL,
dictClass: 'string',
table: {
width: 150
}
},
{
label: '检验水平',
field: 'inspectionLevel',
sort: 'custom',
dictType: DICT_TYPE.INSPECTION_LEVEL,
dictClass: 'string',
table: {
width: 150
},
isSearch: true
},
{
label: '每份样品量',
field: 'samplePieceSize',
@ -136,6 +115,7 @@ export const InspectionSchemeMain = useCrudSchemas(
width: 140
}
},
{
label: '生效时间',
field: 'effectiveDate',

423
src/views/qms/inspectionTemplate/detail.vue

@ -0,0 +1,423 @@
<template>
<div class="main-body">
<div class="left">
<div
class="tabs-label"
:class="element.name == editableTabsValue ? 'active' : ''"
v-for="(element, index) in data.process"
:key="index"
@click.stop="chooseTabs(element, index)"
>
<span>{{ element.description }}</span>
</div>
</div>
<div class="right">
<div v-for="(item, index) in data.process" :key="index">
<div v-show="item.name == editableTabsValue">
<div class="small-title">检验工序</div>
<el-form :model="item" label-width="auto" :rules="rules" ref="formProcessRef">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="编码" prop="code">
<el-input v-model="item.code" 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="description">
<el-input v-model="item.description" :disabled="true"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="顺序号" prop="sequenceCode">
<el-input v-model="item.sequenceCode" disabled />
</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" :rules="rules" ref="formFeaturesRef">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="编码">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.code"
placeholder="根据系统生成"
:disabled="true"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="inspectionCharacteristicsBaseVO.description">
<el-input v-model="item.inspectionCharacteristicsBaseVO.description" disabled/>
</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.inspectionMethodCode"
placeholder="请选择检验方法"
disabled
/>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="检验方法描述"
prop="inspectionCharacteristicsBaseVO.inspectionMethodName"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.inspectionMethodName"
disabled
placeholder="请选择检验方法"
/>
</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.samplingProcessCode"
placeholder="请选择采样过程"
disabled
/>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="采样过程描述"
prop="inspectionCharacteristicsBaseVO.inspectionMethodName"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.inspectionMethodName"
disabled
placeholder="请选择采样过程描述"
/>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="是否允许修改特征值"
prop="inspectionCharacteristicsBaseVO.isCanUpdate"
>
<el-switch v-model="item.inspectionCharacteristicsBaseVO.isCanUpdate" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="结果录入方式"
prop="inspectionCharacteristicsBaseVO.resultEntryMethod"
>
<el-select
v-model="item.inspectionCharacteristicsBaseVO.resultEntryMethod"
placeholder="请选择结果录入方式"
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="inspectionCharacteristicsBaseVO.featureType">
<!-- <el-input v-model="item.featureType" /> -->
<el-select
v-model="item.inspectionCharacteristicsBaseVO.featureType"
placeholder="请选择特征类型"
@change="changeFeatureType($event, item)"
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" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
<el-form-item label="计量单位" prop="inspectionCharacteristicsBaseVO.quantifyUom">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyUom"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
<el-form-item label="小数位" prop="inspectionCharacteristicsBaseVO.quantifyDecimal">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyDecimal"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
<el-form-item
label="是否设定上限"
prop="inspectionCharacteristicsBaseVO.quantifyIsCapping"
>
<el-switch
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsCapping"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
<el-form-item
prop="inspectionCharacteristicsBaseVO.quantifyIsLowlimit"
label="是否设定下限"
>
<el-switch
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
<el-form-item
prop="inspectionCharacteristicsBaseVO.quantifyIsTarget"
label="是否设定目标值"
>
<el-switch
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsTarget"
disabled
/>
</el-form-item>
</el-col>
<el-col
:span="12"
v-if="
item.inspectionCharacteristicsBaseVO.featureType == 0 &&
item.inspectionCharacteristicsBaseVO.quantifyIsCapping
"
>
<el-form-item label="上限值" prop="inspectionCharacteristicsBaseVO.quantifyCapping">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyCapping"
disabled
type="number"
/>
</el-form-item>
</el-col>
<el-col
:span="12"
v-if="
item.inspectionCharacteristicsBaseVO.featureType == 0 &&
item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit
"
>
<el-form-item
label="下限值"
prop="inspectionCharacteristicsBaseVO.quantifyLowlimit"
>
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyLowlimit"
disabled
type="number"
/>
</el-form-item>
</el-col>
<el-col
:span="12"
v-if="
item.inspectionCharacteristicsBaseVO.featureType == 0 &&
item.inspectionCharacteristicsBaseVO.quantifyIsTarget
"
>
<el-form-item label="目标值" prop="inspectionCharacteristicsBaseVO.quantifyTarget">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyTarget"
disabled
type="number"
/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 1">
<el-form-item
label="选定集"
prop="inspectionCharacteristicsBaseVO.quantifyQuantifyCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyQuantifyCode"
placeholder="请选择选定集"
disabled
/>
</div>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 1">
<el-form-item
label="选定集描述"
prop="inspectionCharacteristicsBaseVO.quantifyQuantifyName"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyQuantifyName"
disabled
placeholder="请选择选定集描述"
/>
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
</div>
</div>
</template>
<script lang="ts" setup>
import * as InspectionProcessPageApi from '@/api/qms/inspectionTemplate'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const props = defineProps({
data: {
type: Object,
required: true,
default: null
}
})
console.log(props.data)
const data = ref(props.data.data)
const editableTabsValue = ref('1')
onMounted(async () => {
data.value.process = []
let list = await InspectionProcessPageApi.getListByTempleteCode(data.value.code)
editableTabsValue.value = '1'
let arr = []
list.forEach((item, index) => {
let obj = {
inspectionCode: item.inspectionCode,
description: item.description,
inspectionCharCode: item.inspectionCharCode,
sequenceCode: item.sequenceCode,
name: String(index + 1),
inspectionCharacteristicsBaseVO: {
description: item.inspectionCharacteristicsBaseVO.description,
featureType: item.inspectionCharacteristicsBaseVO.featureType,
inspectionMethodCode: item.inspectionCharacteristicsBaseVO.inspectionMethodCode,
inspectionMethodName: item.inspectionCharacteristicsBaseVO.inspectionMethodName,
samplingProcessCode: item.inspectionCharacteristicsBaseVO.samplingProcessCode,
isCanUpdate: item.inspectionCharacteristicsBaseVO.isCanUpdate,
isDestructionInspection: item.inspectionCharacteristicsBaseVO.isDestructionInspection,
quantifyCapping: item.inspectionCharacteristicsBaseVO.quantifyCapping,
quantifyDecimal: item.inspectionCharacteristicsBaseVO.quantifyDecimal,
quantifyIsCapping: item.inspectionCharacteristicsBaseVO.quantifyIsCapping,
quantifyIsLowlimit: item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit,
quantifyIsTarget: item.inspectionCharacteristicsBaseVO.quantifyIsTarget,
quantifyLowlimit: item.inspectionCharacteristicsBaseVO.quantifyLowlimit,
quantifyQuantifyCode: item.inspectionCharacteristicsBaseVO.quantifyQuantifyCode,
quantifyQuantifyName: item.inspectionCharacteristicsBaseVO.quantifyQuantifyName,
quantifyTarget: item.inspectionCharacteristicsBaseVO.quantifyTarget,
quantifyUom: item.inspectionCharacteristicsBaseVO.quantifyUom,
resultEntryMethod: item.inspectionCharacteristicsBaseVO.resultEntryMethod,
samplingProcessCode: item.inspectionCharacteristicsBaseVO.samplingProcessCode,
samplingProcessName: item.inspectionCharacteristicsBaseVO.samplingProcessName
}
}
data.value.process.push(obj)
})
})
const chooseTabs = (element, index) => {
if (element.name == editableTabsValue.value) return
editableTabsValue.value = element.name
}
console.log(data.value.process)
</script>
<style scoped lang="scss">
.small-title {
font-weight: bold;
padding: 0px 10px 10px;
color: #1a8bfc;
font-size: 16px;
}
.main-body {
display: flex;
margin-top: 20px;
.left {
width: 200px;
background: rgb(245, 247, 250);
border: 1px solid rgb(220, 223, 230);
min-height: 60px;
position: relative;
padding: 6px 0px;
font-size: 14px;
.plus-icon {
cursor: pointer;
position: absolute;
right: 0px;
top: 0px;
border: 1px solid rgb(220, 223, 230);
background: rgb(245, 247, 250);
display: flex;
align-items: center;
justify-items: center;
padding: 1px;
}
}
}
.tabs-label {
padding: 4px 20px 4px 20px;
min-height: 30px;
justify-content: flex-end;
display: flex;
align-items: center;
cursor: pointer;
word-break: break-all;
}
.active {
background: white;
}
.right {
border: 1px solid rgb(220, 223, 230);
flex: 1;
width: 0px;
padding: 20px;
}
</style>

16
src/views/qms/inspectionTemplate/index.vue

@ -32,9 +32,9 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #reqCode="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.reqCode)">
<span>{{ row.reqCode }}</span>
<template #code="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
@ -57,8 +57,11 @@
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="InspectionTemplateMain.allSchemas" />
<Detail ref="detailRef" :isBasic="true" :allSchemas="InspectionTemplateMain.allSchemas">
<template #basicBottom="data">
<DetailView :data="data" />
</template>
</Detail>
<!-- 导入 -->
<ImportForm
ref="importFormRef"
@ -84,6 +87,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import AddForm from './addForm.vue'
import DetailView from './detail.vue'
import * as InspectionProcessPageApi from '@/api/qms/inspectionTemplate'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
@ -235,7 +239,7 @@ const submitForm = async (formType, data) => {
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicAgvLocationrelation')
detailRef.value.openDetail(row, titleName, titleValue, 'basicProgrammeTemplate')
}
/** 删除按钮操作 */

Loading…
Cancel
Save