|
|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
<template>
|
|
|
|
|
<Dialog v-model="dialogVisible" :title="dialogTitle" width="1100px">
|
|
|
|
|
<Dialog v-model="dialogVisible" :title="dialogTitle" width="1500px">
|
|
|
|
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" :row-key="getRowKey">
|
|
|
|
|
<el-table-column type="index" :label="t('MoldManagement.TicketResultDialog.index')" align="center" width="70" />
|
|
|
|
|
<el-table-column :label="t('MoldManagement.TicketResultDialog.inspectionItemName')" align="center" prop="inspectionItemName" min-width="200" />
|
|
|
|
|
@ -29,6 +29,30 @@ v-else-if="scope.row.images" :src="parseFirstImage(scope.row.images)"
|
|
|
|
|
<span v-else>-</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column :label="t('EquipmentManagement.DvSubject.valueType')" align="center" prop="valueType" width="120">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-tag
|
|
|
|
|
v-if="scope.row.valueType !== undefined && scope.row.valueType !== null && String(scope.row.valueType) !== ''"
|
|
|
|
|
effect="light" :type="getTagType('value_types', scope.row.valueType)"
|
|
|
|
|
:color="getTagColor('value_types', scope.row.valueType)"
|
|
|
|
|
:style="getTagStyle('value_types', scope.row.valueType)" disable-transitions>
|
|
|
|
|
{{ getTagLabel('value_types', scope.row.valueType) }}
|
|
|
|
|
</el-tag>
|
|
|
|
|
<span v-else>-</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="输入值" align="center" min-width="150">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-input
|
|
|
|
|
v-if="String(scope.row.valueType) === '0' || String(scope.row.valueType) === '2'"
|
|
|
|
|
v-model="scope.row.textInput"
|
|
|
|
|
:disabled="String(scope.row.inspectionResult) !== '0'"
|
|
|
|
|
clearable
|
|
|
|
|
placeholder="请输入"
|
|
|
|
|
/>
|
|
|
|
|
<span v-else>-</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column :label="t('MoldManagement.TicketResultDialog.remark')" align="center" prop="remark" min-width="180" />
|
|
|
|
|
<el-table-column :label="t('MoldManagement.TicketResultDialog.operate')" align="center" min-width="220" fixed="right">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
@ -63,12 +87,18 @@ v-else-if="scope.row.images" :src="parseFirstImage(scope.row.images)"
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { TicketManagementApi, TicketResultVO } from '@/api/mold/ticketManagement'
|
|
|
|
|
import { getStrDictOptions } from '@/utils/dict'
|
|
|
|
|
import { isHexColor } from '@/utils/color'
|
|
|
|
|
import { useDictStoreWithOut } from '@/store/modules/dict'
|
|
|
|
|
|
|
|
|
|
defineOptions({ name: 'TicketResultDialog' })
|
|
|
|
|
|
|
|
|
|
const { t } = useI18n()
|
|
|
|
|
const message = useMessage()
|
|
|
|
|
|
|
|
|
|
const dictStore = useDictStoreWithOut()
|
|
|
|
|
const dictReady = ref(false)
|
|
|
|
|
|
|
|
|
|
const dialogVisible = ref(false)
|
|
|
|
|
const dialogTitle = ref('检验结果')
|
|
|
|
|
const loading = ref(false)
|
|
|
|
|
@ -82,6 +112,37 @@ const cancelReason = ref<string | undefined>(undefined)
|
|
|
|
|
const decisionMap = reactive<Record<string, '1' | '2' | undefined>>({})
|
|
|
|
|
const imageMap = reactive<Record<string, string>>({})
|
|
|
|
|
|
|
|
|
|
const getTagDict = (dictType: string, value: any) => {
|
|
|
|
|
if (!dictReady.value) return undefined
|
|
|
|
|
const v = value === '' || value === null || value === undefined ? undefined : String(value)
|
|
|
|
|
if (!v) return undefined
|
|
|
|
|
return getStrDictOptions(dictType).find((d) => d.value === v)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const getTagLabel = (dictType: string, value: any) => {
|
|
|
|
|
const found = getTagDict(dictType, value)
|
|
|
|
|
return found?.label ?? (value ?? '')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const getTagType = (dictType: string, value: any) => {
|
|
|
|
|
const found = getTagDict(dictType, value)
|
|
|
|
|
const type = found?.colorType
|
|
|
|
|
if (type + '' === 'primary' || type + '' === 'default') return '' as any
|
|
|
|
|
return (type ?? '') as any
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const getTagColor = (dictType: string, value: any) => {
|
|
|
|
|
const found = getTagDict(dictType, value)
|
|
|
|
|
if (found?.cssClass && isHexColor(found.cssClass)) return found.cssClass
|
|
|
|
|
return ''
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const getTagStyle = (dictType: string, value: any) => {
|
|
|
|
|
const color = getTagColor(dictType, value)
|
|
|
|
|
if (!color) return ''
|
|
|
|
|
return 'color: #fff'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const queryParams = reactive({
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
pageSize: 10
|
|
|
|
|
@ -101,6 +162,11 @@ const open = async (options: { managementId: number; title?: string; jobStatus?:
|
|
|
|
|
|
|
|
|
|
defineExpose({ open })
|
|
|
|
|
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
await dictStore.setDictMap()
|
|
|
|
|
dictReady.value = true
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const getList = async () => {
|
|
|
|
|
if (!managementId.value) return
|
|
|
|
|
loading.value = true
|
|
|
|
|
|