|
|
@ -1,18 +1,18 @@ |
|
|
|
<template> |
|
|
|
<el-drawer v-model="isShowDrawer" title="详情" direction="rtl" size="80%" v-loading="detailLoading" > |
|
|
|
<template #header> |
|
|
|
<div class="font-size-18px"> |
|
|
|
{{ detailData.code }} <span class="ml-20px font-size-16px">{{ detailData.name }}</span> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<ContentWrap> |
|
|
|
<Descriptions :data="detailData" labelClassName="label-class-name" label-align="left" direction="vertical" :column="8" :schema="ItemBasic.allSchemas.detailSchema" :columns="2" width="200px"/> |
|
|
|
<div class="font-size-18px"> |
|
|
|
{{ titleValueRef }} <span class="ml-20px font-size-16px">{{ titleNameRef }}</span> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<ContentWrap v-if="!isBasic"> |
|
|
|
<Descriptions :data="detailData" labelClassName="label-class-name" label-align="left" direction="vertical" :column="8" :schema="detailSchema" :columns="2" width="200px"/> |
|
|
|
</ContentWrap> |
|
|
|
<Tabs :tabsList="tabsList" :current="current" @change="change" /> |
|
|
|
<div class="flex" v-if="current == 0"> |
|
|
|
<!-- 详情 --> |
|
|
|
<ContentWrap class="w-[73%]"> |
|
|
|
<Descriptions :data="detailData" :schema="ItemBasic.allSchemas.detailSchema" :columns="2" /> |
|
|
|
<Descriptions :data="detailData" :schema="detailSchema" :columns="2" /> |
|
|
|
</ContentWrap> |
|
|
|
<ContentWrap class="w-[27%] ml-16px"> |
|
|
|
<!-- 附件组件 --> |
|
|
@ -22,12 +22,10 @@ |
|
|
|
<!-- 变更记录组件 --> |
|
|
|
<ChangeRecord :data="changeRecordData" class="mt-20px" /> |
|
|
|
</ContentWrap> |
|
|
|
<!-- 用户导入对话框 --> |
|
|
|
<ImportForm ref="importFormRef" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|
|
|
</div> |
|
|
|
<ContentWrap v-else> |
|
|
|
<Table |
|
|
|
:columns="ItemBasic.allSchemas.tableColumns" |
|
|
|
:columns="tableColumns" |
|
|
|
:data="tableObject.tableList" |
|
|
|
:loading="tableObject.loading" |
|
|
|
:pagination="{total: tableObject.total}" |
|
|
@ -39,24 +37,70 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script lang="ts" setup> |
|
|
|
defineOptions({ name: 'Detail' }) |
|
|
|
import Annex from '@/components/Annex/src/Annex.vue' |
|
|
|
import Remarks from '@/components/Remarks/src/Remarks.vue' |
|
|
|
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
|
import ChangeRecord from '@/components/ChangeRecord/src/ChangeRecord.vue' |
|
|
|
import Tabs from '@/components/Tabs/src/Tabs.vue' |
|
|
|
import { ItemBasic } from '@/utils/disposition/tableColumns.ts' |
|
|
|
import { ItemBasicTabsList } from '@/utils/disposition/tabsList.ts' |
|
|
|
import * as ItembasicApi from '@/api/wms/itembasic' |
|
|
|
|
|
|
|
const isShowDrawer = ref(false) |
|
|
|
defineOptions({ name: 'Detail' }) |
|
|
|
|
|
|
|
const tabsList = ref(JSON.parse(JSON.stringify(ItemBasicTabsList))) |
|
|
|
tabsList.value.unshift({ |
|
|
|
label: '详情', |
|
|
|
prop: 'Detail' |
|
|
|
const props = defineProps({ |
|
|
|
// 标签参数 |
|
|
|
tabs: { |
|
|
|
type: Object, |
|
|
|
required: true, |
|
|
|
default: null |
|
|
|
}, |
|
|
|
// 是否是基础数据 展现详情顶部表单 |
|
|
|
isBasic: { |
|
|
|
type: Boolean, |
|
|
|
required: false, |
|
|
|
default: false |
|
|
|
}, |
|
|
|
// 表单,列表 相关信息 |
|
|
|
allSchemas: { |
|
|
|
type: Object, |
|
|
|
required: true, |
|
|
|
default: null |
|
|
|
}, |
|
|
|
// // 可以导入的文件类型 |
|
|
|
// accept: { |
|
|
|
// type: String, |
|
|
|
// required: false, |
|
|
|
// default:'.xlsx,.xls' |
|
|
|
// }, |
|
|
|
// // 是否更新已经存在的用户数据.默认值是1 |
|
|
|
// mode: { |
|
|
|
// type: Number, |
|
|
|
// required: false, |
|
|
|
// default: 1 |
|
|
|
// }, |
|
|
|
// url:{ |
|
|
|
// type: String, |
|
|
|
// required: false, |
|
|
|
// } |
|
|
|
}) |
|
|
|
|
|
|
|
const isShowDrawer = ref(false) |
|
|
|
const isBasic = ref(props.isBasic) |
|
|
|
const tableColumns = ref(props.allSchemas.tableColumns) |
|
|
|
const detailSchema = ref(props.allSchemas.detailSchema) |
|
|
|
|
|
|
|
const tabsList = ref(JSON.parse(JSON.stringify(props.tabs?props.tabs:''))) |
|
|
|
|
|
|
|
if (tabsList.value) { |
|
|
|
tabsList.value.unshift({ |
|
|
|
label: '详情', |
|
|
|
prop: 'Detail' |
|
|
|
}) |
|
|
|
} else { |
|
|
|
tabsList.value = [{ |
|
|
|
label: '详情', |
|
|
|
prop: 'Detail' |
|
|
|
}] |
|
|
|
} |
|
|
|
|
|
|
|
// 附件默认数据 |
|
|
|
const annexData = reactive({ |
|
|
|
annexList: [{ |
|
|
@ -166,12 +210,18 @@ const { getList } = tableMethods |
|
|
|
getList() |
|
|
|
|
|
|
|
/** 打开弹窗 */ |
|
|
|
const openDetail = async (id?: number) => { |
|
|
|
const titleNameRef = ref() |
|
|
|
const titleValueRef = ref() |
|
|
|
const openDetail = async (row: any, titleName: any, titleValue: any) => { |
|
|
|
titleNameRef.value = titleName |
|
|
|
titleValueRef.value = titleValue |
|
|
|
isShowDrawer.value = true |
|
|
|
if (id) { |
|
|
|
console.log(216, row) |
|
|
|
if (row) { |
|
|
|
detailLoading.value = true |
|
|
|
try { |
|
|
|
detailData.value = await ItembasicApi.getItembasic(id) |
|
|
|
// detailData.value = await ItembasicApi.getItembasic(id) |
|
|
|
detailData.value = row |
|
|
|
} finally { |
|
|
|
detailLoading.value = false |
|
|
|
} |
|
|
|