Browse Source

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

hella_online_20240904
zhang_li 2 months ago
parent
commit
8d9769078d
  1. 2
      src/components/Detail/src/Detail.vue
  2. 188
      src/views/qms/inspectionJob/detail.vue
  3. 23
      src/views/qms/inspectionJob/index.vue
  4. 351
      src/views/qms/inspectionRecord/detail.vue
  5. 24
      src/views/qms/inspectionRecord/index.vue
  6. 356
      src/views/qms/inspectionRecordFirst/detail.vue
  7. 300
      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" :schema="allSchemas.detailSchema"
:columns="2" :columns="2"
/> />
<!-- 检验工序用到插槽 -->
<slot v-if="isBasic && !tabsExtend" :data="detailData" name="basicBottom" :key="detailData.id"></slot>
<!-- 单表切换tabs 展现table --> <!-- 单表切换tabs 展现table -->
<Table <Table
v-if="isBasic && tabsExtend" v-if="isBasic && tabsExtend"

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

@ -1,17 +1,18 @@
<template> <template>
<div> <div style="margin-top: 20px">
<el-drawer v-model="isShowDrawer" title="详情" direction="rtl" size="80%" v-loading="detailLoading"> <el-tabs
<template #header> v-model="editableTabsValue"
<div class="font-size-18px"> class="demo-tabs"
{{ titleValueRef }} <span class="ml-20px font-size-16px">{{ titleNameRef }}</span> type="border-card"
</div> tab-position="left"
</template> :stretch="false"
<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" /> <el-tab-pane
</ContentWrap> v-for="item in data.subList"
<ContentWrap> :key="item.name"
<el-tabs v-model="editableTabsValue" class="demo-tabs" type="border-card" tab-position="left" :stretch="false"> :label="item.processDescribe"
<el-tab-pane v-for="item in data.subList" :key="item.name" :label="item.processDescribe" :name="item.name"> :name="item.name"
>
<div class="small-title">检验工序</div> <div class="small-title">检验工序</div>
<el-form :model="item" label-width="auto" ref="formProcessRef"> <el-form :model="item" label-width="auto" ref="formProcessRef">
<el-row :gutter="20"> <el-row :gutter="20">
@ -37,59 +38,121 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="编码"> <el-form-item label="编码">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.number" placeholder="根据系统生成" :disabled="true" /> <el-input
v-model="item.inspectionJobCharacteristicsRespVO.number"
placeholder="根据系统生成"
:disabled="true"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="描述" prop="inspectionJobCharacteristicsRespVO.description"> <el-form-item label="描述" prop="inspectionJobCharacteristicsRespVO.description">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.description" :disabled="true" /> <el-input
v-model="item.inspectionJobCharacteristicsRespVO.description"
:disabled="true"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="检验方法" prop="inspectionJobCharacteristicsRespVO.inspectionMethodCode"> <el-form-item
label="检验方法"
prop="inspectionJobCharacteristicsRespVO.inspectionMethodCode"
>
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.inspectionMethodName" disabled placeholder="请选择检验方法" /> <el-input
v-model="item.inspectionJobCharacteristicsRespVO.inspectionMethodName"
disabled
placeholder="请选择检验方法"
/>
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="采样过程编码" prop="inspectionJobCharacteristicsRespVO.samplingProcessCode"> <el-form-item
label="采样过程编码"
prop="inspectionJobCharacteristicsRespVO.samplingProcessCode"
>
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.samplingProcessName" disabled placeholder="请选择采样过程编码" /> <el-input
v-model="item.inspectionJobCharacteristicsRespVO.samplingProcessName"
disabled
placeholder="请选择采样过程编码"
/>
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="样品份数" prop="inspectionJobCharacteristicsRespVO.sampleQty"> <el-form-item label="样品份数" prop="inspectionJobCharacteristicsRespVO.sampleQty">
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.sampleQty" disabled placeholder="请输入样品份数" /> <el-input
v-model="item.inspectionJobCharacteristicsRespVO.sampleQty"
disabled
placeholder="请输入样品份数"
/>
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="每份样品量" prop="inspectionJobCharacteristicsRespVO.samplePieceSize"> <el-form-item
label="每份样品量"
prop="inspectionJobCharacteristicsRespVO.samplePieceSize"
>
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.samplePieceSize" disabled placeholder="请输入每份样品量" /> <el-input
v-model="item.inspectionJobCharacteristicsRespVO.samplePieceSize"
disabled
placeholder="请输入每份样品量"
/>
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="是否允许修改特征值" prop="inspectionJobCharacteristicsRespVO.isCanUpdate"> <el-form-item
label="是否允许修改特征值"
prop="inspectionJobCharacteristicsRespVO.isCanUpdate"
>
<el-switch v-model="item.inspectionJobCharacteristicsRespVO.isCanUpdate" disabled /> <el-switch v-model="item.inspectionJobCharacteristicsRespVO.isCanUpdate" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="结果录入方式" prop="inspectionJobCharacteristicsRespVO.resultEntryMethod"> <el-form-item
<el-select v-model="item.inspectionJobCharacteristicsRespVO.resultEntryMethod" placeholder="请选择结果录入方式" @change="resultEntryMethodChange($event,item)" disabled> label="结果录入方式"
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY)" :key="dict.value" :label="dict.label" :value="dict.value" /> 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-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="特征类型" prop="inspectionJobCharacteristicsRespVO.featureType"> <el-form-item label="特征类型" prop="inspectionJobCharacteristicsRespVO.featureType">
<el-select v-model="item.inspectionJobCharacteristicsRespVO.featureType" placeholder="请选择特征类型" @change="changeFeatureType" disabled> <el-select
<el-option v-for="dict in getStrDictOptions( DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE )" :key="dict.value" :label="dict.label" :value="dict.value" /> 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-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -97,8 +160,6 @@
</el-form> </el-form>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</ContentWrap>
</el-drawer>
</div> </div>
</template> </template>
@ -108,79 +169,26 @@ import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
defineOptions({ name: 'Detail' }) defineOptions({ name: 'Detail' })
const editableTabsValue = ref('1')
const message = useMessage() //
const { t } = useI18n() //
const updateKey = ref(0)
const props = defineProps({ const props = defineProps({
// data: {
allSchemas: {
type: Object, type: Object,
required: true, required: true,
default: null 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: []
}) })
console.log(props.data)
const data = ref(props.data.data)
const editableTabsValue = ref('1')
/** 打开弹窗 */ onMounted(async () => {
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 = [] let list = []
list = await InspectionJobDetailPageApi.getInspectionJobDetailList(row.id) list = await InspectionJobDetailPageApi.getInspectionJobDetailList(data.value.id)
list.forEach((item, index) => { list.forEach((item, index) => {
editableTabsValue.value = index + 1 editableTabsValue.value = index + 1
item.name = index + 1 item.name = index + 1
}) })
data.value.subList = list data.value.subList = list
} finally { })
detailLoading.value = false
}
}
}
defineExpose({ openDetail }) // open
</script> </script>
<style lang="scss"> <style lang="scss">
.el-drawer__body { .el-drawer__body {

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

@ -62,20 +62,11 @@
@close="getList" @close="getList"
/> />
<!-- 详情 --> <!-- 详情 -->
<Detail <Detail ref="detailRef" :isBasic="true" :allSchemas="InspectionJobMain.allSchemas">
ref="detailRef" <template #basicBottom="data">
:isBasic="false" <DetailView :data="data" />
:allSchemas="InspectionJobMain.allSchemas" </template>
:detailAllSchemas="InspectionJobDetail.allSchemas" </Detail>
:detailAllSchemasRules="InspectionJobDetailRules"
:apiCreate="InspectionJobDetailApi.createInspectionJobDetail"
:apiUpdate="InspectionJobDetailApi.updateInspectionJobDetail"
:apiPage="InspectionJobDetailApi.getInspectionJobDetailPage"
:apiDelete="InspectionJobDetailApi.deleteInspectionJobDetail"
@searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false"
:detailButtonIsShow="true"
/>
<!-- 包装信息 --> <!-- 包装信息 -->
<ListTable <ListTable
ref="listTableRef" ref="listTableRef"
@ -120,7 +111,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import ListTable from '@/components/ListTable/src/ListTable.vue' import ListTable from '@/components/ListTable/src/ListTable.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import AddForm from './addForm.vue' import AddForm from './addForm.vue'
import Detail from './detail.vue' import DetailView from './detail.vue'
import { getReportUrl } from '@/utils/systemParam' import { getReportUrl } from '@/utils/systemParam'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
@ -347,7 +338,7 @@ const checkQualityReport = async (row) => {
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicInspectionJobMain') detailRef.value.openDetail(row, titleName, titleValue, 'jobInspectionMain')
} }
// //

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

@ -1,30 +1,5 @@
<template> <template>
<div> <div style="margin-top: 20px">
<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 <el-tabs
v-model="editableTabsValue" v-model="editableTabsValue"
class="demo-tabs" class="demo-tabs"
@ -72,7 +47,10 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="描述" prop="inspectionRecordCharacteristicsRespVO.description"> <el-form-item label="描述" prop="inspectionRecordCharacteristicsRespVO.description">
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.description" :disabled="true" /> <el-input
v-model="item.inspectionRecordCharacteristicsRespVO.description"
:disabled="true"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -104,16 +82,27 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="采样过程编码" prop="inspectionRecordCharacteristicsRespVO.samplingProcessCode"> <el-form-item
label="采样过程编码"
prop="inspectionRecordCharacteristicsRespVO.samplingProcessCode"
>
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.samplingProcessName" disabled placeholder="请选择采样过程编码" /> <el-input
v-model="item.inspectionRecordCharacteristicsRespVO.samplingProcessName"
disabled
placeholder="请选择采样过程编码"
/>
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="样品份数" prop="inspectionRecordCharacteristicsRespVO.sampleQty"> <el-form-item label="样品份数" prop="inspectionRecordCharacteristicsRespVO.sampleQty">
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.sampleQty" disabled placeholder="请输入样品份数" /> <el-input
v-model="item.inspectionRecordCharacteristicsRespVO.sampleQty"
disabled
placeholder="请输入样品份数"
/>
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -150,7 +139,7 @@
<el-select <el-select
v-model="item.inspectionRecordCharacteristicsRespVO.resultEntryMethod" v-model="item.inspectionRecordCharacteristicsRespVO.resultEntryMethod"
placeholder="请选择结果录入方式" placeholder="请选择结果录入方式"
@change="resultEntryMethodChange($event,item)" @change="resultEntryMethodChange($event, item)"
disabled disabled
> >
<el-option <el-option
@ -165,14 +154,20 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="特征类型" prop="inspectionRecordCharacteristicsRespVO.featureType"> <el-form-item
label="特征类型"
prop="inspectionRecordCharacteristicsRespVO.featureType"
>
<el-select <el-select
v-model="item.inspectionRecordCharacteristicsRespVO.featureType" v-model="item.inspectionRecordCharacteristicsRespVO.featureType"
placeholder="请选择特征类型" placeholder="请选择特征类型"
@change="changeFeatureType" @change="changeFeatureType"
disabled disabled
> >
<el-option v-for="dict in getStrDictOptions( DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE )" <el-option
v-for="dict in getStrDictOptions(
DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE
)"
:key="dict.value" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"
@ -181,7 +176,10 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="开始时间" prop="inspectionRecordCharacteristicsRespVO.inspectionStartTime"> <el-form-item
label="开始时间"
prop="inspectionRecordCharacteristicsRespVO.inspectionStartTime"
>
<el-date-picker <el-date-picker
v-model="item.inspectionRecordCharacteristicsRespVO.inspectionStartTime" v-model="item.inspectionRecordCharacteristicsRespVO.inspectionStartTime"
type="datetime" type="datetime"
@ -193,7 +191,10 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="结束时间" prop="inspectionRecordCharacteristicsRespVO.inspectionEndTime"> <el-form-item
label="结束时间"
prop="inspectionRecordCharacteristicsRespVO.inspectionEndTime"
>
<el-date-picker <el-date-picker
v-model="item.inspectionRecordCharacteristicsRespVO.inspectionEndTime" v-model="item.inspectionRecordCharacteristicsRespVO.inspectionEndTime"
type="datetime" type="datetime"
@ -205,82 +206,201 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="计量单位" prop="inspectionRecordCharacteristicsRespVO.quantifyUom" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0" > <el-form-item
<el-select v-model="item.inspectionRecordCharacteristicsRespVO.quantifyUom" placeholder="请选择计量单位" disabled > label="计量单位"
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.UOM)" 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" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" /> :value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="小数位" prop="inspectionRecordCharacteristicsRespVO.quantifyDecimal" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0" > <el-form-item
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.quantifyDecimal" disabled/> label="小数位"
prop="inspectionRecordCharacteristicsRespVO.quantifyDecimal"
v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0"
>
<el-input
v-model="item.inspectionRecordCharacteristicsRespVO.quantifyDecimal"
disabled
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0"> <el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0">
<el-form-item label="是否设定上限" prop="inspectionCharacteristicsBaseVO.quantifyIsCapping" > <el-form-item
<el-switch v-model="item.inspectionRecordCharacteristicsRespVO.quantifyIsCapping" disabled/> label="是否设定上限"
prop="inspectionCharacteristicsBaseVO.quantifyIsCapping"
>
<el-switch
v-model="item.inspectionRecordCharacteristicsRespVO.quantifyIsCapping"
disabled
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0"> <el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0">
<el-form-item prop="inspectionRecordCharacteristicsRespVO.quantifyIsLowlimit" label="是否设定下限" > <el-form-item
<el-switch v-model="item.inspectionRecordCharacteristicsRespVO.quantifyIsLowlimit" disabled/> prop="inspectionRecordCharacteristicsRespVO.quantifyIsLowlimit"
label="是否设定下限"
>
<el-switch
v-model="item.inspectionRecordCharacteristicsRespVO.quantifyIsLowlimit"
disabled
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item prop="inspectionRecordCharacteristicsRespVO.quantifyIsTarget" label="是否设定目标值" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0" > <el-form-item
<el-switch v-model="item.inspectionRecordCharacteristicsRespVO.quantifyIsTarget" disabled/> prop="inspectionRecordCharacteristicsRespVO.quantifyIsTarget"
label="是否设定目标值"
v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0"
>
<el-switch
v-model="item.inspectionRecordCharacteristicsRespVO.quantifyIsTarget"
disabled
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0 && item.inspectionRecordCharacteristicsRespVO.quantifyIsCapping"> <el-col
<el-form-item label="上限值" prop="inspectionRecordCharacteristicsRespVO.quantifyCapping" > :span="12"
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.quantifyCapping" type="number" disabled/> 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-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0 && item.inspectionRecordCharacteristicsRespVO.quantifyIsLowlimit"> <el-col
<el-form-item label="下限值" prop="inspectionRecordCharacteristicsRespVO.quantifyLowlimit" > :span="12"
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.quantifyLowlimit" type="number" disabled/> 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-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0 && item.inspectionRecordCharacteristicsRespVO.quantifyIsTarget"> <el-col
<el-form-item label="目标值" prop="inspectionRecordCharacteristicsRespVO.quantifyTarget" > :span="12"
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.quantifyTarget" type="number" disabled/> 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-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12">
<el-form-item label="评估代码"> <el-form-item label="评估代码">
<el-select v-model="item.inspectionRecordCharacteristicsRespVO.estimateCode" placeholder="请选择评估代码" disabled> <el-select
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.EVALUATION_CODE)" :key="dict.value" :label="dict.label" :value="dict.value" disabled/> 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-select>
</el-form-item> </el-form-item>
</el-col> </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-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-row>
<!-- 汇总录入的时候显示 --> <!-- 汇总录入的时候显示 -->
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.resultEntryMethod == 1"> <el-col
:span="12"
v-if="item.inspectionRecordCharacteristicsRespVO.resultEntryMethod == 1"
>
<el-form-item label="合格数量"> <el-form-item label="合格数量">
<el-input v-model="cur.qualifiedQuantity" placeholder="请输入合格数量" type="number" disabled/> <el-input
v-model="cur.qualifiedQuantity"
placeholder="请输入合格数量"
type="number"
disabled
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.resultEntryMethod == 1"> <el-col
:span="12"
v-if="item.inspectionRecordCharacteristicsRespVO.resultEntryMethod == 1"
>
<el-form-item label="不合格数量"> <el-form-item label="不合格数量">
<el-input v-model="cur.unqualifiedQuantity" type="number" placeholder="请输入不合格数量" disabled/> <el-input
v-model="cur.unqualifiedQuantity"
type="number"
placeholder="请输入不合格数量"
disabled
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '0'"> <el-col
:span="12"
v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '0'"
>
<el-form-item label="检验值"> <el-form-item label="检验值">
<el-input v-model="cur.inspectionValue" placeholder="请输入检验值" type="number" disabled/> <el-input
v-model="cur.inspectionValue"
placeholder="请输入检验值"
type="number"
disabled
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '1'"> <el-col
<el-form-item label="选定集"> :span="12"
<el-select v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '1'"
v-model="cur.qualitativeCode"
placeholder="请选择选定集"
disabled
> >
<el-form-item label="选定集">
<el-select v-model="cur.qualitativeCode" placeholder="请选择选定集" disabled>
<el-option <el-option
v-for="dict in item.selectedProjectRespVOList" v-for="dict in item.selectedProjectRespVOList"
:key="dict.dictionaryValue" :key="dict.dictionaryValue"
@ -290,10 +410,18 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '1'" > <el-col
:span="12"
v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '1'"
>
<el-form-item label="缺陷级别"> <el-form-item label="缺陷级别">
<el-select v-model="cur.defectLevel" placeholder="请选择缺陷级别" disabled> <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-option
v-for="dict in getStrDictOptions(DICT_TYPE.DEFECT_LEVEL)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -303,9 +431,6 @@
</el-form> </el-form>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</ContentWrap>
</el-drawer>
</div> </div>
</template> </template>
@ -315,80 +440,30 @@ import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
defineOptions({ name: 'InspectionRecordDetail' }) defineOptions({ name: 'InspectionRecordDetail' })
const editableTabsValue = ref('1')
const message = useMessage() //
const { t } = useI18n() //
const updateKey = ref(0)
const props = defineProps({ const props = defineProps({
// data: {
allSchemas: {
type: Object, type: Object,
required: true, required: true,
default: null 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: []
}) })
console.log(props.data)
const data = ref(props.data.data)
const editableTabsValue = ref('1')
/** 打开弹窗 */ onMounted(async () => {
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 = [] let list = []
list = await InspectionRecordDetailPageApi.getInspectionRecordDetailList(row.id) list = await InspectionRecordDetailPageApi.getInspectionRecordDetailList(data.value.id)
list.forEach((item, index) => { list.forEach((item, index) => {
editableTabsValue.value = index + 1 editableTabsValue.value = index + 1
item.name = index + 1 item.name = index + 1
item.inspectionRecordCharacteristicsRespVO.recordInspectionQuantifyList = item.inspectionRecordCharacteristicsRespVO.featureType == 1 ? item.inspectionRecordCharacteristicsRespVO.qualitativeRespVOList : item.inspectionRecordCharacteristicsRespVO.quantifyRespVOList item.inspectionRecordCharacteristicsRespVO.recordInspectionQuantifyList =
item.inspectionRecordCharacteristicsRespVO.featureType == 1
? item.inspectionRecordCharacteristicsRespVO.qualitativeRespVOList
: item.inspectionRecordCharacteristicsRespVO.quantifyRespVOList
}) })
data.value.subList = list data.value.subList = list
} finally { })
detailLoading.value = false
}
}
}
defineExpose({ openDetail }) // open
</script> </script>
<style lang="scss"> <style lang="scss">
.el-drawer__body { .el-drawer__body {

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

@ -68,20 +68,12 @@
@submitForm="submitFormExecute" @submitForm="submitFormExecute"
/> />
<Detail <!-- 详情 -->
ref="detailRef" <Detail ref="detailRef" :isBasic="true" :allSchemas="InspectionRecordMain.allSchemas">
:isBasic="false" <template #basicBottom="data">
:allSchemas="InspectionRecordMain.allSchemas" <DetailView :data="data" />
:detailAllSchemas="InspectionRecordDetail.allSchemas" </template>
:detailAllSchemasRules="InspectionRecordDetailRules" </Detail>
:apiCreate="InspectionRecordDetailApi.createInspectionRecordDetail"
:apiUpdate="InspectionRecordDetailApi.updateInspectionRecordDetail"
:apiPage="InspectionRecordDetailApi.getInspectionRecordDetailPage"
:apiDelete="InspectionRecordDetailApi.deleteInspectionRecordDetail"
@searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false"
:detailButtonIsShow="true"
/>
<!-- 包装信息 --> <!-- 包装信息 -->
<ListTable <ListTable
ref="listTableRef" ref="listTableRef"
@ -123,7 +115,7 @@ import ListTable from '@/components/ListTable/src/ListTable.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import UseAddForm from './useAddForm.vue' import UseAddForm from './useAddForm.vue'
import AddForm from './addForm.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 * as InspectionJobMainApi from '@/api/qms/inspectionJob/inspectionJobMain'
import { getReportUrl } from '@/utils/systemParam' import { getReportUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
@ -347,7 +339,7 @@ const openUseForm = async (type: string, row?: any) => {
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicInspectionRecordMain') detailRef.value.openDetail(row, titleName, titleValue, 'recordInspectionMain')
} }
/** 删除按钮操作 */ /** 删除按钮操作 */

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

@ -1,30 +1,5 @@
<template> <template>
<div> <div style="margin-top: 20px">
<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 <el-tabs
v-model="editableTabsValue" v-model="editableTabsValue"
class="demo-tabs" class="demo-tabs"
@ -72,7 +47,10 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="描述" prop="inspectionRecordCharacteristicsRespVO.description"> <el-form-item label="描述" prop="inspectionRecordCharacteristicsRespVO.description">
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.description" :disabled="true" /> <el-input
v-model="item.inspectionRecordCharacteristicsRespVO.description"
:disabled="true"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -104,16 +82,27 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="采样过程编码" prop="inspectionRecordCharacteristicsRespVO.samplingProcessCode"> <el-form-item
label="采样过程编码"
prop="inspectionRecordCharacteristicsRespVO.samplingProcessCode"
>
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.samplingProcessName" disabled placeholder="请选择采样过程编码" /> <el-input
v-model="item.inspectionRecordCharacteristicsRespVO.samplingProcessName"
disabled
placeholder="请选择采样过程编码"
/>
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="样品份数" prop="inspectionRecordCharacteristicsRespVO.sampleQty"> <el-form-item label="样品份数" prop="inspectionRecordCharacteristicsRespVO.sampleQty">
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.sampleQty" disabled placeholder="请输入样品份数" /> <el-input
v-model="item.inspectionRecordCharacteristicsRespVO.sampleQty"
disabled
placeholder="请输入样品份数"
/>
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -150,7 +139,7 @@
<el-select <el-select
v-model="item.inspectionRecordCharacteristicsRespVO.resultEntryMethod" v-model="item.inspectionRecordCharacteristicsRespVO.resultEntryMethod"
placeholder="请选择结果录入方式" placeholder="请选择结果录入方式"
@change="resultEntryMethodChange($event,item)" @change="resultEntryMethodChange($event, item)"
disabled disabled
> >
<el-option <el-option
@ -165,14 +154,20 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="特征类型" prop="inspectionRecordCharacteristicsRespVO.featureType"> <el-form-item
label="特征类型"
prop="inspectionRecordCharacteristicsRespVO.featureType"
>
<el-select <el-select
v-model="item.inspectionRecordCharacteristicsRespVO.featureType" v-model="item.inspectionRecordCharacteristicsRespVO.featureType"
placeholder="请选择特征类型" placeholder="请选择特征类型"
@change="changeFeatureType" @change="changeFeatureType"
disabled disabled
> >
<el-option v-for="dict in getStrDictOptions( DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE )" <el-option
v-for="dict in getStrDictOptions(
DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE
)"
:key="dict.value" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"
@ -181,7 +176,10 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="开始时间" prop="inspectionRecordCharacteristicsRespVO.inspectionStartTime"> <el-form-item
label="开始时间"
prop="inspectionRecordCharacteristicsRespVO.inspectionStartTime"
>
<el-date-picker <el-date-picker
v-model="item.inspectionRecordCharacteristicsRespVO.inspectionStartTime" v-model="item.inspectionRecordCharacteristicsRespVO.inspectionStartTime"
type="datetime" type="datetime"
@ -193,7 +191,10 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="结束时间" prop="inspectionRecordCharacteristicsRespVO.inspectionEndTime"> <el-form-item
label="结束时间"
prop="inspectionRecordCharacteristicsRespVO.inspectionEndTime"
>
<el-date-picker <el-date-picker
v-model="item.inspectionRecordCharacteristicsRespVO.inspectionEndTime" v-model="item.inspectionRecordCharacteristicsRespVO.inspectionEndTime"
type="datetime" type="datetime"
@ -205,82 +206,201 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="计量单位" prop="inspectionRecordCharacteristicsRespVO.quantifyUom" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0" > <el-form-item
<el-select v-model="item.inspectionRecordCharacteristicsRespVO.quantifyUom" placeholder="请选择计量单位" disabled > label="计量单位"
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.UOM)" 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" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" /> :value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="小数位" prop="inspectionRecordCharacteristicsRespVO.quantifyDecimal" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0" > <el-form-item
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.quantifyDecimal" disabled/> label="小数位"
prop="inspectionRecordCharacteristicsRespVO.quantifyDecimal"
v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0"
>
<el-input
v-model="item.inspectionRecordCharacteristicsRespVO.quantifyDecimal"
disabled
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0"> <el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0">
<el-form-item label="是否设定上限" prop="inspectionCharacteristicsBaseVO.quantifyIsCapping" > <el-form-item
<el-switch v-model="item.inspectionRecordCharacteristicsRespVO.quantifyIsCapping" disabled/> label="是否设定上限"
prop="inspectionCharacteristicsBaseVO.quantifyIsCapping"
>
<el-switch
v-model="item.inspectionRecordCharacteristicsRespVO.quantifyIsCapping"
disabled
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0"> <el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0">
<el-form-item prop="inspectionRecordCharacteristicsRespVO.quantifyIsLowlimit" label="是否设定下限" > <el-form-item
<el-switch v-model="item.inspectionRecordCharacteristicsRespVO.quantifyIsLowlimit" disabled/> prop="inspectionRecordCharacteristicsRespVO.quantifyIsLowlimit"
label="是否设定下限"
>
<el-switch
v-model="item.inspectionRecordCharacteristicsRespVO.quantifyIsLowlimit"
disabled
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item prop="inspectionRecordCharacteristicsRespVO.quantifyIsTarget" label="是否设定目标值" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0" > <el-form-item
<el-switch v-model="item.inspectionRecordCharacteristicsRespVO.quantifyIsTarget" disabled/> prop="inspectionRecordCharacteristicsRespVO.quantifyIsTarget"
label="是否设定目标值"
v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0"
>
<el-switch
v-model="item.inspectionRecordCharacteristicsRespVO.quantifyIsTarget"
disabled
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0 && item.inspectionRecordCharacteristicsRespVO.quantifyIsCapping"> <el-col
<el-form-item label="上限值" prop="inspectionRecordCharacteristicsRespVO.quantifyCapping" > :span="12"
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.quantifyCapping" type="number" disabled/> 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-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0 && item.inspectionRecordCharacteristicsRespVO.quantifyIsLowlimit"> <el-col
<el-form-item label="下限值" prop="inspectionRecordCharacteristicsRespVO.quantifyLowlimit" > :span="12"
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.quantifyLowlimit" type="number" disabled/> 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-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == 0 && item.inspectionRecordCharacteristicsRespVO.quantifyIsTarget"> <el-col
<el-form-item label="目标值" prop="inspectionRecordCharacteristicsRespVO.quantifyTarget" > :span="12"
<el-input v-model="item.inspectionRecordCharacteristicsRespVO.quantifyTarget" type="number" disabled/> 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-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12">
<el-form-item label="评估代码"> <el-form-item label="评估代码">
<el-select v-model="item.inspectionRecordCharacteristicsRespVO.estimateCode" placeholder="请选择评估代码" disabled> <el-select
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.EVALUATION_CODE)" :key="dict.value" :label="dict.label" :value="dict.value" disabled/> 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-select>
</el-form-item> </el-form-item>
</el-col> </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-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-row>
<!-- 汇总录入的时候显示 --> <!-- 汇总录入的时候显示 -->
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.resultEntryMethod == 1"> <el-col
:span="12"
v-if="item.inspectionRecordCharacteristicsRespVO.resultEntryMethod == 1"
>
<el-form-item label="合格数量"> <el-form-item label="合格数量">
<el-input v-model="cur.qualifiedQuantity" placeholder="请输入合格数量" type="number" disabled/> <el-input
v-model="cur.qualifiedQuantity"
placeholder="请输入合格数量"
type="number"
disabled
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.resultEntryMethod == 1"> <el-col
:span="12"
v-if="item.inspectionRecordCharacteristicsRespVO.resultEntryMethod == 1"
>
<el-form-item label="不合格数量"> <el-form-item label="不合格数量">
<el-input v-model="cur.unqualifiedQuantity" type="number" placeholder="请输入不合格数量" disabled/> <el-input
v-model="cur.unqualifiedQuantity"
type="number"
placeholder="请输入不合格数量"
disabled
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '0'"> <el-col
:span="12"
v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '0'"
>
<el-form-item label="检验值"> <el-form-item label="检验值">
<el-input v-model="cur.inspectionValue" placeholder="请输入检验值" type="number" disabled/> <el-input
v-model="cur.inspectionValue"
placeholder="请输入检验值"
type="number"
disabled
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '1'"> <el-col
<el-form-item label="选定集"> :span="12"
<el-select v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '1'"
v-model="cur.qualitativeCode"
placeholder="请选择选定集"
disabled
> >
<el-form-item label="选定集">
<el-select v-model="cur.qualitativeCode" placeholder="请选择选定集" disabled>
<el-option <el-option
v-for="dict in item.selectedProjectRespVOList" v-for="dict in item.selectedProjectRespVOList"
:key="dict.dictionaryValue" :key="dict.dictionaryValue"
@ -290,17 +410,20 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '1'" > <el-col
:span="12"
v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '1'"
>
<el-form-item label="缺陷级别"> <el-form-item label="缺陷级别">
<el-select v-model="cur.defectLevel" placeholder="请选择缺陷级别" disabled> <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-option
v-for="dict in getStrDictOptions(DICT_TYPE.DEFECT_LEVEL)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </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-col>
</el-row> </el-row>
</el-col> </el-col>
@ -308,9 +431,6 @@
</el-form> </el-form>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</ContentWrap>
</el-drawer>
</div> </div>
</template> </template>
@ -320,80 +440,30 @@ import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
defineOptions({ name: 'InspectionRecordDetail' }) defineOptions({ name: 'InspectionRecordDetail' })
const editableTabsValue = ref('1')
const message = useMessage() //
const { t } = useI18n() //
const updateKey = ref(0)
const props = defineProps({ const props = defineProps({
// data: {
allSchemas: {
type: Object,
required: true,
default: null
},
//
detailAllSchemas: {
type: Object, type: Object,
required: true, required: true,
default: null default: null
},
//
buttondataTable: {
type: Array,
required: false,
default: ()=>{
return []
} }
},
}) })
const isShowDrawer = ref(false) console.log(props.data)
const detailLoading = ref(false) const data = ref(props.data.data)
const data = ref({ const editableTabsValue = ref('1')
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 onMounted(async () => {
if (row) {
detailLoading.value = true
try {
data.value = row
let list = [] let list = []
list = await InspectionRecordDetailPageApi.getInspectionRecordDetailList(row.id) list = await InspectionRecordDetailPageApi.getInspectionRecordDetailList(data.value.id)
list.forEach((item, index) => { list.forEach((item, index) => {
editableTabsValue.value = index + 1 editableTabsValue.value = index + 1
item.name = index + 1 item.name = index + 1
item.inspectionRecordCharacteristicsRespVO.recordInspectionQuantifyList = item.inspectionRecordCharacteristicsRespVO.featureType == 1 ? item.inspectionRecordCharacteristicsRespVO.qualitativeRespVOList : item.inspectionRecordCharacteristicsRespVO.quantifyRespVOList item.inspectionRecordCharacteristicsRespVO.recordInspectionQuantifyList =
item.inspectionRecordCharacteristicsRespVO.featureType == 1
? item.inspectionRecordCharacteristicsRespVO.qualitativeRespVOList
: item.inspectionRecordCharacteristicsRespVO.quantifyRespVOList
}) })
data.value.subList = list data.value.subList = list
} finally { })
detailLoading.value = false
}
}
}
defineExpose({ openDetail }) // open
</script> </script>
<style lang="scss"> <style lang="scss">
.el-drawer__body { .el-drawer__body {

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

@ -1,29 +1,47 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="InspectionRecordMain.allSchemas.searchSchema" @search="setSearchParams" <Search
:schema="InspectionRecordMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams" @reset="setSearchParams"
/> />
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName" <TableHead
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" :HeadButttondata="HeadButttondata"
:allSchemas="InspectionRecordMain.allSchemas" /> @button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="InspectionRecordMain.allSchemas"
/>
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <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 total: tableObject.total
}" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage" }"
v-model:sort="tableObject.sort"> v-model:pageSize="tableObject.pageSize"
<template #number="{row}"> v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> <el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span> <span>{{ row.number }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -39,18 +57,21 @@
@submitForm="submitForm" @submitForm="submitForm"
/> />
<Detail <!-- 详情 -->
ref="detailRef" :isBasic="false" :allSchemas="InspectionRecordMain.allSchemas" <Detail ref="detailRef" :isBasic="true" :allSchemas="InspectionRecordMain.allSchemas">
:detailAllSchemas="InspectionRecordDetail.allSchemas" :detailAllSchemasRules="InspectionRecordDetailRules" <template #basicBottom="data">
:apiCreate="InspectionRecordDetailApi.createInspectionRecordDetail" <DetailView :data="data" />
:apiUpdate="InspectionRecordDetailApi.updateInspectionRecordDetail" </template>
:apiPage="InspectionRecordDetailApi.getInspectionRecordDetailPage" </Detail>
:apiDelete="InspectionRecordDetailApi.deleteInspectionRecordDetail" @searchTableSuccessDetail="searchTableSuccessDetail" <!-- 包装信息 -->
:isShowAddBtn="false" :detailButtonIsShow="true" <ListTable
ref="listTableRef"
titleName="包装信息"
:allSchemas="InspectionRecordMain.allSchemas"
:detailAllSchemas="InspectionRecordPackage.allSchemas"
:detailAllSchemasRules="InspectionRecordPackageRules"
:list="list"
/> />
<!-- 包装信息 --> <ListTable ref="listTableRef" titleName="包装信息" :allSchemas="InspectionRecordMain.allSchemas"
:detailAllSchemas="InspectionRecordPackage.allSchemas" :detailAllSchemasRules="InspectionRecordPackageRules"
:list="list"/>
<el-dialog <el-dialog
v-model="showQualityReport" v-model="showQualityReport"
:title="t('质检明细')" :title="t('质检明细')"
@ -63,113 +84,140 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { InspectionRecordMain, InspectionRecordMainRules, InspectionRecordDetail, InspectionRecordDetailRules,InspectionRecordPackage, InspectionRecordPackageRules} from './inspectionRecordFirstMain.data' import {
// import { InspectionJobPackage,InspectionJobPackageRules} from '../inspectionJob/inspectionJobMain.data' InspectionRecordMain,
import * as InspectionRecordMainApi from '@/api/qms/inspectionRecord/inspectionRecordMain' InspectionRecordMainRules,
import * as InspectionRecordDetailApi from '@/api/qms/inspectionRecord/inspectionRecordDetail' InspectionRecordDetail,
import * as defaultButtons from '@/utils/disposition/defaultButtons' InspectionRecordDetailRules,
import ListTable from '@/components/ListTable/src/ListTable.vue' InspectionRecordPackage,
import TableHead from '@/components/TableHead/src/TableHead.vue' InspectionRecordPackageRules
import AddForm from '../inspectionRecordFirst/addForm.vue' } from './inspectionRecordFirstMain.data'
import Detail from './detail.vue' // import { InspectionJobPackage,InspectionJobPackageRules} from '../inspectionJob/inspectionJobMain.data'
import { getReportUrl } from '@/utils/systemParam' 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 { 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 { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import { usePageLoading } from '@/hooks/web/usePageLoading' import { usePageLoading } from '@/hooks/web/usePageLoading'
const { loadStart, loadDone } = usePageLoading() const { loadStart, loadDone } = usePageLoading()
// //
defineOptions({ name: 'InspectionRecordMain' }) defineOptions({ name: 'InspectionRecordMain' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(InspectionRecordMain.allSchemas.tableColumns) const tableColumns = ref(InspectionRecordMain.allSchemas.tableColumns)
if(routeName.value=='InspectRecordMain'){ if (routeName.value == 'InspectRecordMain') {
tableColumns.value = tableColumns.value.filter(item=>{ tableColumns.value = tableColumns.value.filter((item) => {
return item.label!='操作' return item.label != '操作'
}) })
} }
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
if(routeName.value=='InspectRecordMain'){ if (routeName.value == 'InspectRecordMain') {
tableColumns.value = val.filter(item=>{ tableColumns.value = val.filter((item) => {
return item.label!='操作' return item.label != '操作'
}) })
}else{ } else {
tableColumns.value = val tableColumns.value = val
} }
} }
// //
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: InspectionRecordMainApi.getInspectionRecordMainPage // getListApi: InspectionRecordMainApi.getInspectionRecordMainPage //
}) })
// //
const { getList, setSearchParams } = tableMethods const { getList, setSearchParams } = tableMethods
// //
let HeadButttondata = [ let HeadButttondata = [
defaultButtons.defaultAddBtn(null), // defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultExportBtn(null), // defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null) //
] ]
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') {
//
openForm('create') openForm('create')
} else if (val == 'import') { // } else if (val == 'import') {
//
handleImport() handleImport()
} else if (val == 'export') { // } else if (val == 'export') {
//
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') {
//
getList() getList()
} else if (val == 'filtrate') { // } else if (val == 'filtrate') {
} else { // //
} else {
//
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
const isShowMainButton = (row, val) => { const isShowMainButton = (row, val) => {
return row.isPublished return row.isPublished
} }
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListEditBtn({ hide: isShowMainButton(row, 'publish'),hasPermi: 'wms:inspection-recode-first-main:update' }), // defaultButtons.mainListEditBtn({
defaultButtons.mainListDeleteBtn({ hide: isShowMainButton(row, 'publish'),hasPermi: 'wms:inspection-recode-first-main:delete' }), // hide: isShowMainButton(row, 'publish'),
defaultButtons.mainListOrderPubBtn({ hide: isShowMainButton(row, 'publish'), hasPermi: 'qms:inspection-recode-first-main:pub' }), // hasPermi: 'wms:inspection-recode-first-main:update'
defaultButtons.mainExport({ hide: !row.isPublished }),// }), //
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({}) // defaultButtons.mainListPlanCheckQualityReportBtn({}) //
] ]
} }
const listTableRef = ref() const listTableRef = ref()
const list = ref([]) const list = ref([])
const useDecisionList = getStrDictOptions(DICT_TYPE.USAGE_DECISION) const useDecisionList = getStrDictOptions(DICT_TYPE.USAGE_DECISION)
// const useDecisionList = InspectionRecordMain.allSchemas.formSchema.filter(item=>item.field == "useDecision") // const useDecisionList = InspectionRecordMain.allSchemas.formSchema.filter(item=>item.field == "useDecision")
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') {
//
openForm('update', row) openForm('update', row)
}else if (val == 'delete') { // } else if (val == 'delete') {
//
handleDelete(row.id) handleDelete(row.id)
}else if (val == 'mainOrderPub') { // } else if (val == 'mainOrderPub') {
//
handleOrderPub(row) handleOrderPub(row)
}else if (val == 'mainPlanCheckQualityReport') { } else if (val == 'mainPlanCheckQualityReport') {
// //
checkQualityReport(row) checkQualityReport(row)
} else if (val == 'mainExport') { } else if (val == 'mainExport') {
@ -177,7 +225,7 @@ const buttonBaseClick = (val, item) => {
handleMainExport(row) handleMainExport(row)
} }
} }
// //
const reportHeight = ref(window.innerHeight - 120) const reportHeight = ref(window.innerHeight - 120)
const showQualityReport = ref(false) const showQualityReport = ref(false)
const qualityReport = ref('') const qualityReport = ref('')
@ -185,21 +233,21 @@ const checkQualityReport = async (row) => {
showQualityReport.value = true showQualityReport.value = true
qualityReport.value = getReportUrl() + '/purchasereceiptReport?asnNumber=' + row.asnNumber qualityReport.value = getReportUrl() + '/purchasereceiptReport?asnNumber=' + row.asnNumber
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const basicFormRef = ref()
const openForm = async (type : string, row ?: number) => { const openForm = async (type: string, row?: number) => {
tableData.value = [] // tableData.value = [] //
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
} }
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row : any, titleName : any, titleValue : any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicInspectionRecordMain') detailRef.value.openDetail(row, titleName, titleValue, 'recordInspectionMain')
} }
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = async (id : number) => { const handleDelete = async (id: number) => {
try { try {
// //
await message.delConfirm() await message.delConfirm()
@ -208,10 +256,10 @@ const checkQualityReport = async (row) => {
message.success(t('common.delSuccess')) message.success(t('common.delSuccess'))
// //
await getList() await getList()
} catch { } } catch {}
} }
/** 发布按钮操作 */ /** 发布按钮操作 */
const handleOrderPub = async (row : object) => { const handleOrderPub = async (row: object) => {
try { try {
// //
await message.confirm(t('common.confirmPublish')) await message.confirm(t('common.confirmPublish'))
@ -220,9 +268,8 @@ const checkQualityReport = async (row) => {
message.success(t('common.publishSuccess')) message.success(t('common.publishSuccess'))
// //
await getList() await getList()
} catch { } } catch {}
} }
/** 列表导出按钮操作 */ /** 列表导出按钮操作 */
const handleMainExport = async (row: any) => { const handleMainExport = async (row: any) => {
@ -240,9 +287,8 @@ const handleMainExport = async (row: any) => {
} }
} }
/** 导出按钮操作 */
/** 导出按钮操作 */ const handleExport = async () => {
const handleExport = async () => {
try { try {
// //
await message.exportConfirm() await message.exportConfirm()
@ -255,26 +301,26 @@ const handleMainExport = async (row: any) => {
} finally { } finally {
loadDone() loadDone()
} }
} }
/** /**
* tableForm方法 * tableForm方法
*/ */
const tableFormKeys = {} const tableFormKeys = {}
InspectionRecordDetail.allSchemas.tableFormColumns.forEach(item => { InspectionRecordDetail.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : '' tableFormKeys[item.field] = item.default ? item.default : ''
}) })
const tableData = ref([]) const tableData = ref([])
// // // //
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
// data.subList = tableData.value // // data.subList = tableData.value //
try { try {
basicFormRef.value.formLoading = true basicFormRef.value.formLoading = true
if (formType === 'create') { if (formType === 'create') {
await InspectionRecordMainApi.createInspectionRecordMain(data) await InspectionRecordMainApi.createInspectionRecordMain(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
}else { } else {
await InspectionRecordMainApi.updateInspectionRecordFirstMain(data) await InspectionRecordMainApi.updateInspectionRecordFirstMain(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
@ -285,27 +331,27 @@ const handleMainExport = async (row: any) => {
} finally { } finally {
basicFormRef.value.formLoading = false basicFormRef.value.formLoading = false
} }
} }
// //
const searchFormClick = (searchData) => { const searchFormClick = (searchData) => {
searchData.filters.push({ searchData.filters.push({
action: "==", action: '==',
column: "inspectionType", column: 'inspectionType',
value: "11" value: '11'
}) })
tableObject.params = { tableObject.params = {
isSearch: true, isSearch: true,
filters: searchData.filters filters: searchData.filters
} }
getList() // getList() //
} }
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
tableObject.params = { tableObject.params = {
available: 'TRUE', available: 'TRUE',
inspectionType:'11' inspectionType: '11'
} }
getList() getList()
}) })
</script> </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:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #reqCode="{ row }"> <template #code="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.reqCode)"> <el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.reqCode }}</span> <span>{{ row.code }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
@ -50,13 +50,18 @@
<AddForm <AddForm
ref="basicFormRef" ref="basicFormRef"
basicFormWidth="80" basicFormWidth="80"
:formAllSchemasFeatures="InspectionTemplateFeatures.allSchemas" :formAllSchemasMain="InspectionSchemeMain.allSchemas"
:formAllSchemasProcess="InspectionTemplateProcess.allSchemas"
:formAllSchemasMain="InspectionTemplateMain.allSchemas"
:rules="InspectionTemplateRules" :rules="InspectionTemplateRules"
@submitForm="submitForm" @submitForm="submitForm"
/> />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="InspectionSchemeMain.allSchemas">
<template #basicBottom="data">
<DetailView :data="data" />
</template>
</Detail>
<!-- 导入 --> <!-- 导入 -->
<ImportForm <ImportForm
ref="importFormRef" ref="importFormRef"
@ -80,6 +85,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
import AddForm from './addForm.vue' import AddForm from './addForm.vue'
import DetailView from './detail.vue'
import * as InspectionSchemeApi from '@/api/qms/inspectionScheme' import * as InspectionSchemeApi from '@/api/qms/inspectionScheme'
import ImportForm from '../../../components/ImportForm/src/ImportForm.vue' import ImportForm from '../../../components/ImportForm/src/ImportForm.vue'
import * as SampleCodeApi from '@/api/qms/sampleCode' import * as SampleCodeApi from '@/api/qms/sampleCode'
@ -248,7 +254,7 @@ const submitForm = async (formType, data) => {
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { 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: '物料名称', label: '物料编码',
field: 'itemName', field: 'itemCode',
sort: 'custom', sort: 'custom',
table: { table: {
width: 200 width: 150
}, },
isSearch: true isSearch: true
}, },
{ {
label: '物料编码', label: '物料名称',
field: 'itemCode', field: 'itemName',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 200
}, },
isSearch: true isSearch: true
}, },
{ {
label: '描述', label: '方案描述',
field: 'description', field: 'description',
sort: 'custom', sort: 'custom',
table: { table: {
@ -79,7 +80,7 @@ export const InspectionSchemeMain = useCrudSchemas(
} }
}, },
{ {
label: '检验类型编码', label: '检验类型',
field: 'inspectionType', field: 'inspectionType',
dictType: DICT_TYPE.INSPECTION_TYPE, dictType: DICT_TYPE.INSPECTION_TYPE,
dictClass: 'string', dictClass: 'string',
@ -97,37 +98,15 @@ export const InspectionSchemeMain = useCrudSchemas(
width: 175 width: 175
} }
}, },
{ {
label: '拆分规则', label: '动态修改规则',
field: 'splitRule', field: 'dynamicUpdateCode',
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.SPLIT_RULES,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
table: { table: {
width: 175 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: '每份样品量', label: '每份样品量',
field: 'samplePieceSize', field: 'samplePieceSize',
@ -136,6 +115,7 @@ export const InspectionSchemeMain = useCrudSchemas(
width: 140 width: 140
} }
}, },
{ {
label: '生效时间', label: '生效时间',
field: 'effectiveDate', 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:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #reqCode="{ row }"> <template #code="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.reqCode)"> <el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.reqCode }}</span> <span>{{ row.code }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
@ -57,8 +57,11 @@
@submitForm="submitForm" @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 <ImportForm
ref="importFormRef" ref="importFormRef"
@ -84,6 +87,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
import AddForm from './addForm.vue' import AddForm from './addForm.vue'
import DetailView from './detail.vue'
import * as InspectionProcessPageApi from '@/api/qms/inspectionTemplate' import * as InspectionProcessPageApi from '@/api/qms/inspectionTemplate'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading' import { usePageLoading } from '@/hooks/web/usePageLoading'
@ -235,7 +239,7 @@ const submitForm = async (formType, data) => {
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { 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