|
|
@ -28,7 +28,16 @@ |
|
|
|
<Tabs ref="tabRef" :tabsList="tabsList" :current="current" @change="change" /> |
|
|
|
<div class="flex"> |
|
|
|
<!-- 详情 --> |
|
|
|
<ContentWrap class="w-[100%]" v-show="tabsList[current].label!=annexAliasLabel&&tabsList[current].label!='备注'&&tabsList[current].label!='变更记录'&&!annexTableData.some(item=>item.label==tabsList[current].label)"> <!-- 列表头部 --> |
|
|
|
<ContentWrap |
|
|
|
class="w-[100%]" |
|
|
|
v-show=" |
|
|
|
tabsList[current].label != annexAliasLabel && |
|
|
|
tabsList[current].label != '备注' && |
|
|
|
tabsList[current].label != '变更记录' && |
|
|
|
!annexTableData.some((item) => item.label == tabsList[current].label) |
|
|
|
" |
|
|
|
> |
|
|
|
<!-- 列表头部 --> |
|
|
|
<TableHead |
|
|
|
v-if="!isBasic" |
|
|
|
:HeadButttondata="HeadButttondata" |
|
|
@ -71,8 +80,15 @@ |
|
|
|
v-model:pageSize="tableObjectRef.pageSize" |
|
|
|
v-model:currentPage="tableObjectRef.currentPage" |
|
|
|
> |
|
|
|
<template #photos="{ row }"> |
|
|
|
<div v-for="(item,index) in row.photos.split(',')" :key="index" style="color:#409eff ; cursor: pointer;" @click="openImage(item)">{{ item }}</div> </template> |
|
|
|
<template #photos="{ row }"> |
|
|
|
<div |
|
|
|
v-for="(item, index) in row.photos.split(',')" |
|
|
|
:key="index" |
|
|
|
style="color: #409eff; cursor: pointer" |
|
|
|
@click="openImage(item)" |
|
|
|
>{{ item }}</div |
|
|
|
> |
|
|
|
</template> |
|
|
|
<template #action="{ row }"> |
|
|
|
<ButtonBase |
|
|
|
:Butttondata="buttondata" |
|
|
@ -97,21 +113,31 @@ |
|
|
|
</DetailTable> |
|
|
|
</ContentWrap> |
|
|
|
<!-- other附件组件:如质检明细 --> |
|
|
|
<div v-for="(annexItem ,index) in annexTableData" :key="index" v-show="annexItem.label==tabsList[current].label" class="w-[100%]" :style="{height:annexItem.hasSubDetail?'100%':remarkHeight+'px'}"> |
|
|
|
<ContentWrap class="w-[100%]"> |
|
|
|
<ElScrollbar ref="scrollbar" :style="{height:annexItem.hasSubDetail?'100%':(remarkHeight-40)+'px'}"> |
|
|
|
<Annex v-show="tabsList[current].label==annexItem.label" |
|
|
|
:annexData="annexItem" |
|
|
|
@handleAnnexSuccess="updateAnnexTableHandle" |
|
|
|
@deleteAnnexSuccess="updateAnnexTableHandle" |
|
|
|
:upData="{...remarksData.data,tableName:annexItem.tableName}" |
|
|
|
/> |
|
|
|
<div |
|
|
|
v-for="(annexItem, index) in annexTableData" |
|
|
|
:key="index" |
|
|
|
v-show="annexItem.label == tabsList[current].label" |
|
|
|
class="w-[100%]" |
|
|
|
:style="{ height: annexItem.hasSubDetail ? '100%' : remarkHeight + 'px' }" |
|
|
|
> |
|
|
|
<ContentWrap class="w-[100%]"> |
|
|
|
<ElScrollbar |
|
|
|
ref="scrollbar" |
|
|
|
:style="{ height: annexItem.hasSubDetail ? '100%' : remarkHeight - 40 + 'px' }" |
|
|
|
> |
|
|
|
<Annex |
|
|
|
v-show="tabsList[current].label == annexItem.label" |
|
|
|
:annexData="annexItem" |
|
|
|
@handleAnnexSuccess="updateAnnexTableHandle" |
|
|
|
@deleteAnnexSuccess="updateAnnexTableHandle" |
|
|
|
:upData="{ ...remarksData.data, tableName: annexItem.tableName }" |
|
|
|
/> |
|
|
|
</ElScrollbar> |
|
|
|
</ContentWrap> |
|
|
|
</ContentWrap> |
|
|
|
<ContentWrap class="w-[100%]" v-if="annexItem.subDetailTableData"> |
|
|
|
<Table |
|
|
|
<Table |
|
|
|
v-if="!isBasic && fromeWhere != 'countPlan'" |
|
|
|
:align="annexItem.align?annexItem.align:'center'" |
|
|
|
:align="annexItem.align ? annexItem.align : 'center'" |
|
|
|
:columns="annexItem.subDetailTableData.tableColumns" |
|
|
|
:data="annexItem.subDetailTableData.tableList" |
|
|
|
:loading="annexItem.subDetailTableData.loading" |
|
|
@ -119,30 +145,44 @@ |
|
|
|
v-model:pageSize="tableObjectRef.pageSize" |
|
|
|
v-model:currentPage="tableObjectRef.currentPage" |
|
|
|
/> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
</ContentWrap> |
|
|
|
</div> |
|
|
|
<!-- 附件/备注/变更记录 --> |
|
|
|
<ContentWrap class="w-[100%]" v-show="tabsList[current].label==annexAliasLabel||tabsList[current].label=='备注'||tabsList[current].label=='变更记录'" :style="{height:remarkHeight+'px'}"> |
|
|
|
<ContentWrap |
|
|
|
class="w-[100%]" |
|
|
|
v-show=" |
|
|
|
tabsList[current].label == annexAliasLabel || |
|
|
|
tabsList[current].label == '备注' || |
|
|
|
tabsList[current].label == '变更记录' |
|
|
|
" |
|
|
|
:style="{ height: remarkHeight + 'px' }" |
|
|
|
> |
|
|
|
<!-- 附件组件 --> |
|
|
|
<ElScrollbar ref="scrollbar" :style="{height:(remarkHeight-40)+'px'}"> |
|
|
|
<Annex v-show="tabsList[current].label==annexAliasLabel" |
|
|
|
:annexData="annexData" |
|
|
|
@handleAnnexSuccess="handleAnnexSuccess" |
|
|
|
@deleteAnnexSuccess="deleteAnnexSuccess" |
|
|
|
:upData="remarksData.data" |
|
|
|
:key="count" |
|
|
|
/> |
|
|
|
<ElScrollbar ref="scrollbar" :style="{ height: remarkHeight - 40 + 'px' }"> |
|
|
|
<Annex |
|
|
|
v-show="tabsList[current].label == annexAliasLabel" |
|
|
|
:annexData="annexData" |
|
|
|
@handleAnnexSuccess="handleAnnexSuccess" |
|
|
|
@deleteAnnexSuccess="deleteAnnexSuccess" |
|
|
|
:upData="remarksData.data" |
|
|
|
:key="count" |
|
|
|
/> |
|
|
|
<!-- 备注组件 --> |
|
|
|
<Remarks v-show="tabsList[current].label=='备注'" |
|
|
|
<Remarks |
|
|
|
v-show="tabsList[current].label == '备注'" |
|
|
|
:remarksData="remarksData" |
|
|
|
class="mt-20px" |
|
|
|
@remarksSubmitScuess="remarksSubmitScuess" |
|
|
|
:key="count" |
|
|
|
/> |
|
|
|
<!-- 变更记录组件 --> |
|
|
|
<ChangeRecord v-show="tabsList[current].label=='变更记录'" :changeRecordData="changeRecordData" class="mt-20px" :key="count"/> |
|
|
|
</ElScrollbar> |
|
|
|
<ChangeRecord |
|
|
|
v-show="tabsList[current].label == '变更记录'" |
|
|
|
:changeRecordData="changeRecordData" |
|
|
|
class="mt-20px" |
|
|
|
:key="count" |
|
|
|
/> |
|
|
|
</ElScrollbar> |
|
|
|
</ContentWrap> |
|
|
|
</div> |
|
|
|
</el-drawer> |
|
|
@ -173,7 +213,6 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script lang="ts" setup> |
|
|
|
|
|
|
|
import Annex from '@/components/Annex/src/Annex.vue' |
|
|
|
import Remarks from '@/components/Remarks/src/Remarks.vue' |
|
|
|
import ChangeRecord from '@/components/ChangeRecord/src/ChangeRecord.vue' |
|
|
@ -185,7 +224,7 @@ import BasicForm from '@/components/BasicForm/src/BasicForm.vue' |
|
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
|
import DetailTable from '@/components/DetailTable/src/DetailTable.vue' |
|
|
|
import { SearchTable } from '@/components/SearchTable' |
|
|
|
import {defaultFreshBtn} from "@/utils/disposition/defaultButtons"; |
|
|
|
import { defaultFreshBtn } from '@/utils/disposition/defaultButtons' |
|
|
|
|
|
|
|
defineOptions({ name: 'Detail' }) |
|
|
|
|
|
|
@ -209,7 +248,7 @@ const props = defineProps({ |
|
|
|
annexTable: { |
|
|
|
type: Array, |
|
|
|
required: false, |
|
|
|
default: ()=>[] |
|
|
|
default: () => [] |
|
|
|
}, |
|
|
|
//展示附件组件的tab标签 |
|
|
|
annexAliasLabel: { |
|
|
@ -305,7 +344,7 @@ const props = defineProps({ |
|
|
|
buttondataTable: { |
|
|
|
type: Array, |
|
|
|
required: false, |
|
|
|
default: ()=>{ |
|
|
|
default: () => { |
|
|
|
return [] |
|
|
|
} |
|
|
|
}, |
|
|
@ -322,38 +361,38 @@ const props = defineProps({ |
|
|
|
default: null |
|
|
|
}, |
|
|
|
// 子列表 筛选 展示与隐藏 ,默认展示 |
|
|
|
detailButtonIsShowFilter:{ |
|
|
|
detailButtonIsShowFilter: { |
|
|
|
type: Boolean, |
|
|
|
required: false, |
|
|
|
default: true |
|
|
|
}, |
|
|
|
// 子列表 新增 展示与隐藏 ,默认展示 |
|
|
|
detailButtonIsShowAdd:{ |
|
|
|
detailButtonIsShowAdd: { |
|
|
|
type: Boolean, |
|
|
|
required: false, |
|
|
|
default: true |
|
|
|
default: false |
|
|
|
}, |
|
|
|
// 子列表 编辑 展示与隐藏 ,默认展示 |
|
|
|
detailButtonIsShowEdit:{ |
|
|
|
detailButtonIsShowEdit: { |
|
|
|
type: Boolean, |
|
|
|
required: false, |
|
|
|
default: true |
|
|
|
default: false |
|
|
|
}, |
|
|
|
// 子列表 删除 展示与隐藏 ,默认展示 |
|
|
|
detailButtonIsShowDelete:{ |
|
|
|
detailButtonIsShowDelete: { |
|
|
|
type: Boolean, |
|
|
|
required: false, |
|
|
|
default: true |
|
|
|
default: false |
|
|
|
}, |
|
|
|
//是否直接展示搜索表单 |
|
|
|
isOpenSearchTable:{ |
|
|
|
isOpenSearchTable: { |
|
|
|
type: Boolean, |
|
|
|
required: false, |
|
|
|
default: false |
|
|
|
}, |
|
|
|
//扩展其他按钮 |
|
|
|
otherHeadButttonData:{ |
|
|
|
type:Array, |
|
|
|
otherHeadButttonData: { |
|
|
|
type: Array, |
|
|
|
required: false, |
|
|
|
default: () => [] |
|
|
|
} |
|
|
@ -381,39 +420,43 @@ if (props.isBasic == true) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const otherList = [...props.annexTable,{ |
|
|
|
label:props.annexAliasLabel, |
|
|
|
prop:'Annex' |
|
|
|
},{ |
|
|
|
label:'备注', |
|
|
|
prop:'Remarks' |
|
|
|
},{ |
|
|
|
label:'变更记录', |
|
|
|
prop:'ChangeRecord' |
|
|
|
}] |
|
|
|
tabsList.value = [...tabsList?.value,...otherList] |
|
|
|
|
|
|
|
if (!tabsList.value || tabsList.value && tabsList.value.length == otherList.length) { |
|
|
|
const otherList = [ |
|
|
|
...props.annexTable, |
|
|
|
{ |
|
|
|
label: props.annexAliasLabel, |
|
|
|
prop: 'Annex' |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '备注', |
|
|
|
prop: 'Remarks' |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '变更记录', |
|
|
|
prop: 'ChangeRecord' |
|
|
|
} |
|
|
|
] |
|
|
|
tabsList.value = [...tabsList?.value, ...otherList] |
|
|
|
|
|
|
|
if (!tabsList.value || (tabsList.value && tabsList.value.length == otherList.length)) { |
|
|
|
tabsList.value.unshift({ |
|
|
|
label: '明细', |
|
|
|
prop: 'Detail' |
|
|
|
label: '明细', |
|
|
|
prop: 'Detail' |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// Tabs |
|
|
|
// Tabs |
|
|
|
const tabRef = ref() |
|
|
|
//滚动条 |
|
|
|
const scrollbar = ref() |
|
|
|
const scrollbar = ref() |
|
|
|
//附件 备注 变更记录 高度计算 |
|
|
|
const remarkHeight = computed(() => { |
|
|
|
const remarkHeight = computed(() => { |
|
|
|
const tab = unref(tabRef) |
|
|
|
const tabTop = tab?.$el.getBoundingClientRect().top |
|
|
|
const tabHeight = tab?.$el.getBoundingClientRect().height |
|
|
|
const height = window.innerHeight - (tabTop) - (tabHeight) - 60 |
|
|
|
const height = window.innerHeight - tabTop - tabHeight - 60 |
|
|
|
return height |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// 附件默认数据 |
|
|
|
const annexData = reactive({ |
|
|
|
annexList: [] |
|
|
@ -442,31 +485,31 @@ const getFileList = async () => { |
|
|
|
} |
|
|
|
} |
|
|
|
// 获取其他附件列表篇 |
|
|
|
const getAnnexFileList = async (row:id) => { |
|
|
|
const getAnnexFileList = async (row: id) => { |
|
|
|
props.annexTable?.forEach(async (item) => { |
|
|
|
let requstData = {...remarksData.data,tableName: item?.tableName} |
|
|
|
let requstData = { ...remarksData.data, tableName: item?.tableName } |
|
|
|
const annexList = await FileApi.getFileList(requstData) |
|
|
|
const annexData = annexTableData.value.find(annex=>annex.label === item.label) |
|
|
|
if(annexData){ |
|
|
|
const annexData = annexTableData.value.find((annex) => annex.label === item.label) |
|
|
|
if (annexData) { |
|
|
|
annexData.annexList = annexList |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
annexTableData.value.push({ |
|
|
|
align:item.align, |
|
|
|
align: item.align, |
|
|
|
label: item.label, |
|
|
|
tableName: item?.tableName || '', |
|
|
|
annexList, |
|
|
|
hasSubDetail:item.hasSubDetail||false, |
|
|
|
subDetailTableData:item.subDetailTableData |
|
|
|
hasSubDetail: item.hasSubDetail || false, |
|
|
|
subDetailTableData: item.subDetailTableData |
|
|
|
}) |
|
|
|
if(item?.subDetailTableData){ |
|
|
|
const { tableObject:subTableObject, tableMethods:subTableMethods } = useTable({ |
|
|
|
if (item?.subDetailTableData) { |
|
|
|
const { tableObject: subTableObject, tableMethods: subTableMethods } = useTable({ |
|
|
|
getListApi: item.subDetailTableData.getSubList // 分页接口 |
|
|
|
}) |
|
|
|
const {getList:getSubList} = subTableMethods |
|
|
|
subTableObject.params= {} |
|
|
|
item.subDetailTableData.queryParams.forEach(queryItem => { |
|
|
|
const { getList: getSubList } = subTableMethods |
|
|
|
subTableObject.params = {} |
|
|
|
item.subDetailTableData.queryParams.forEach((queryItem) => { |
|
|
|
subTableObject.params[queryItem.queryField] = row[queryItem.rowField] |
|
|
|
}); |
|
|
|
}) |
|
|
|
await getSubList() |
|
|
|
item.subDetailTableData.tableList = subTableObject.tableList |
|
|
|
annexItem.subDetailTableData.tableList |
|
|
@ -485,7 +528,7 @@ const deleteAnnexSuccess = async () => { |
|
|
|
getChangeRecordList() |
|
|
|
} |
|
|
|
/** 追加的附件 */ |
|
|
|
const updateAnnexTableHandle = () => { |
|
|
|
const updateAnnexTableHandle = () => { |
|
|
|
getAnnexFileList(detailData.value) |
|
|
|
getChangeRecordList() |
|
|
|
} |
|
|
@ -495,11 +538,10 @@ const current = ref(0) |
|
|
|
const change = (item, index) => { |
|
|
|
current.value = index |
|
|
|
emit('changeTabs', item) |
|
|
|
if(otherList.find(other=>other.label==item.label)){ |
|
|
|
if (otherList.find((other) => other.label == item.label)) { |
|
|
|
// 附件/备注/变更记录 -- 点击回到顶部 |
|
|
|
scrollbar.value.scrollTo({ top: 0}); |
|
|
|
scrollbar.value.scrollTo({ top: 0 }) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//主表所需的参数 |
|
|
@ -532,8 +574,11 @@ const initModel = (schema: FormSchema[], formModel: Recordable) => { |
|
|
|
const searchTableRef = ref() |
|
|
|
// 如果需要直接打开表格数据表单数据 |
|
|
|
const searchTableFormModel = ref<Recordable>({}) |
|
|
|
if(props.isOpenSearchTable){ |
|
|
|
searchTableFormModel.value = initModel(props.detailAllSchemas.formSchema, unref(searchTableFormModel)) |
|
|
|
if (props.isOpenSearchTable) { |
|
|
|
searchTableFormModel.value = initModel( |
|
|
|
props.detailAllSchemas.formSchema, |
|
|
|
unref(searchTableFormModel) |
|
|
|
) |
|
|
|
} |
|
|
|
const searchTableFormType = ref('') // 表单的类型:create - 新增;update - 修改 |
|
|
|
|
|
|
@ -541,7 +586,7 @@ const searchTableFormType = ref('') // 表单的类型:create - 新增;updat |
|
|
|
const formRef = ref() |
|
|
|
const titleNameRef = ref() |
|
|
|
const titleValueRef = ref() |
|
|
|
const count =ref(0) |
|
|
|
const count = ref(0) |
|
|
|
const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => { |
|
|
|
titleNameRef.value = titleName |
|
|
|
titleValueRef.value = titleValue |
|
|
@ -576,9 +621,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: |
|
|
|
let detailButtonAdd: any = [] |
|
|
|
if (props.detailButtonIsShowFilter) { |
|
|
|
// 筛选 |
|
|
|
detailButtonFilter = [ |
|
|
|
defaultButtons.defaultFilterBtn(null) |
|
|
|
] |
|
|
|
detailButtonFilter = [defaultButtons.defaultFilterBtn(null)] |
|
|
|
} |
|
|
|
if (props.detailButtonIsShowAdd) { |
|
|
|
// 新增 |
|
|
@ -588,10 +631,8 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: |
|
|
|
}) |
|
|
|
] |
|
|
|
} |
|
|
|
let detailButtonRefresh = [ |
|
|
|
defaultButtons.defaultFreshBtn(null) |
|
|
|
] |
|
|
|
HeadButttondata.value = [...detailButtonFilter,...detailButtonAdd,...detailButtonRefresh] |
|
|
|
let detailButtonRefresh = [defaultButtons.defaultFreshBtn(null)] |
|
|
|
HeadButttondata.value = [...detailButtonFilter, ...detailButtonAdd, ...detailButtonRefresh] |
|
|
|
|
|
|
|
// 针对特殊处理 当业务是任务的 只显示筛选 正常情况下应在业务页面设置 后期再作优化 |
|
|
|
if (routeName.value.indexOf('Job') > -1) { |
|
|
@ -599,7 +640,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: |
|
|
|
defaultButtons.defaultFilterBtn(null) // 筛选 |
|
|
|
] |
|
|
|
} |
|
|
|
HeadButttondata.value = [...HeadButttondata.value,...props.otherHeadButttonData] |
|
|
|
HeadButttondata.value = [...HeadButttondata.value, ...props.otherHeadButttonData] |
|
|
|
let detailButtonEdit: any = [] |
|
|
|
let detailButtonDelete: any = [] |
|
|
|
if (props.detailButtonIsShowEdit) { |
|
|
@ -618,8 +659,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: |
|
|
|
}) |
|
|
|
] |
|
|
|
} |
|
|
|
buttondata.value = [...detailButtonEdit,...detailButtonDelete,...props.buttondataTable] |
|
|
|
|
|
|
|
buttondata.value = [...detailButtonEdit, ...detailButtonDelete, ...props.buttondataTable] |
|
|
|
} finally { |
|
|
|
detailLoading.value = false |
|
|
|
} |
|
|
@ -675,7 +715,7 @@ const { getList } = tableMethodsRef.value |
|
|
|
const buttonBaseClick = (val, item) => { |
|
|
|
if (val == 'add') { |
|
|
|
// 新增 |
|
|
|
if(props.isOpenSearchTable){ |
|
|
|
if (props.isOpenSearchTable) { |
|
|
|
searchTableFormType.value = 'create' |
|
|
|
// 如果需要直接打开表格数据 |
|
|
|
searchTableFormModel.value = Object.assign(unref(searchTableFormModel), { |
|
|
@ -684,15 +724,17 @@ const buttonBaseClick = (val, item) => { |
|
|
|
}) |
|
|
|
const item = props.detailAllSchemas.formSchema[0] |
|
|
|
opensearchTable( |
|
|
|
item.field, item?.componentProps?.searchField, |
|
|
|
item?.componentProps?.searchTitle, |
|
|
|
item?.componentProps?.searchAllSchemas, |
|
|
|
item?.componentProps?.searchPage, |
|
|
|
item?.componentProps?.searchCondition, |
|
|
|
item?.componentProps?.multiple, |
|
|
|
undefined,undefined |
|
|
|
item.field, |
|
|
|
item?.componentProps?.searchField, |
|
|
|
item?.componentProps?.searchTitle, |
|
|
|
item?.componentProps?.searchAllSchemas, |
|
|
|
item?.componentProps?.searchPage, |
|
|
|
item?.componentProps?.searchCondition, |
|
|
|
item?.componentProps?.multiple, |
|
|
|
undefined, |
|
|
|
undefined |
|
|
|
) |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
openForm('create') |
|
|
|
} |
|
|
|
} else if (val == 'import') { |
|
|
@ -709,7 +751,7 @@ const buttonBaseClick = (val, item) => { |
|
|
|
} else { |
|
|
|
// 其他按钮 |
|
|
|
console.log('其他按钮', item) |
|
|
|
emit('buttonBaseClick',val, item) |
|
|
|
emit('buttonBaseClick', val, item) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -729,13 +771,13 @@ const opensearchTable = ( |
|
|
|
// 判断查询条件中,是否存在指向主表的数据 |
|
|
|
if (searchCondition && searchCondition.length > 0) { |
|
|
|
// 转换筛选条件所需 |
|
|
|
for (var i=0; i< searchCondition.length; i++ ) { |
|
|
|
for (var i = 0; i < searchCondition.length; i++) { |
|
|
|
// 查询条件为主表某字段,需要赋值主表数据,数据来源是详情的,赋值需要从row中获取 |
|
|
|
if (searchCondition[i].isMainValue) { |
|
|
|
_searchCondition[searchCondition[i].key] = detailData |
|
|
|
? detailData.value[searchCondition[i].value] |
|
|
|
: '' |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
_searchCondition[searchCondition[i].key] = searchCondition[i].value |
|
|
|
} |
|
|
|
} |
|
|
@ -762,29 +804,31 @@ const opensearchTable = ( |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'edit') { |
|
|
|
// 编辑 |
|
|
|
if(props.isOpenSearchTable){ |
|
|
|
if (props.isOpenSearchTable) { |
|
|
|
searchTableFormType.value = 'update' |
|
|
|
if (row?.id || row?.masterId) { |
|
|
|
searchTableFormModel.value = Object.assign(unref(searchTableFormModel), row) |
|
|
|
} |
|
|
|
const item = props.detailAllSchemas.formSchema[0] |
|
|
|
opensearchTable( |
|
|
|
item.field, item?.componentProps?.searchField, |
|
|
|
item?.componentProps?.searchTitle, |
|
|
|
item?.componentProps?.searchAllSchemas, |
|
|
|
item?.componentProps?.searchPage, |
|
|
|
item?.componentProps?.searchCondition, |
|
|
|
item?.componentProps?.multiple, |
|
|
|
undefined,undefined |
|
|
|
item.field, |
|
|
|
item?.componentProps?.searchField, |
|
|
|
item?.componentProps?.searchTitle, |
|
|
|
item?.componentProps?.searchAllSchemas, |
|
|
|
item?.componentProps?.searchPage, |
|
|
|
item?.componentProps?.searchCondition, |
|
|
|
item?.componentProps?.multiple, |
|
|
|
undefined, |
|
|
|
undefined |
|
|
|
) |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
openForm('update', row) |
|
|
|
} |
|
|
|
} else if (val == 'delete') { |
|
|
|
// 删除 |
|
|
|
handleDelete(row.id) |
|
|
|
} else { |
|
|
|
emit('tableFormButton',val, row) |
|
|
|
emit('tableFormButton', val, row) |
|
|
|
} |
|
|
|
} |
|
|
|
/** 添加/修改操作 */ |
|
|
@ -815,10 +859,9 @@ const submitForm = async (formType, data) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const searchTableSuccess1 = (formField, searchField, val, formRef) => { |
|
|
|
searchTableFormModel.value[formField] = val.map(item=>item[searchField]).join(',') |
|
|
|
submitForm(searchTableFormType.value,searchTableFormModel.value) |
|
|
|
searchTableFormModel.value[formField] = val.map((item) => item[searchField]).join(',') |
|
|
|
submitForm(searchTableFormType.value, searchTableFormModel.value) |
|
|
|
emit('searchTableSuccessDetail', formField, searchField, val, formRef) |
|
|
|
} |
|
|
|
// 查询页面返回 |
|
|
@ -885,7 +928,7 @@ const selectChangeDetail = (field, val) => { |
|
|
|
emit('selectChangeDetail', field, val) |
|
|
|
} |
|
|
|
// 打开图片 |
|
|
|
const openImage=(item)=>{ |
|
|
|
const openImage = (item) => { |
|
|
|
emit('openImage', item) |
|
|
|
} |
|
|
|
/** |
|
|
@ -893,22 +936,22 @@ const openImage=(item)=>{ |
|
|
|
* @param field 当前操作字段 |
|
|
|
* @param cur 改变后值 |
|
|
|
*/ |
|
|
|
const detailBasicFormOnChange = (field, cur) => { |
|
|
|
const detailBasicFormOnChange = (field, cur) => { |
|
|
|
emit('detailBasicFormOnChange', field, cur) |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 监听失焦事件 |
|
|
|
* @param field 当前操作字段 |
|
|
|
* @param e |
|
|
|
* @param e |
|
|
|
*/ |
|
|
|
const onBlur = (field, e) => { |
|
|
|
const onBlur = (field, e) => { |
|
|
|
emit('onBlur', field, e) |
|
|
|
} |
|
|
|
|
|
|
|
// 日期改变事件 |
|
|
|
const formFormDateChange = (field, val,row, index) => { |
|
|
|
emit('formFormDateChange', field, val,row, index) |
|
|
|
const formFormDateChange = (field, val, row, index) => { |
|
|
|
emit('formFormDateChange', field, val, row, index) |
|
|
|
} |
|
|
|
//监视属性 |
|
|
|
watch( |
|
|
@ -920,7 +963,7 @@ watch( |
|
|
|
tableObject.params.schedulingCode = masterParmas.value.schedulingCode |
|
|
|
detailAllSchemasRef.value = props.detailAllSchemas |
|
|
|
if (props.tableObjectExtend) { |
|
|
|
props.tableObjectExtend.forEach(item => { |
|
|
|
props.tableObjectExtend.forEach((item) => { |
|
|
|
tableObject.params[item.key] = item.value |
|
|
|
}) |
|
|
|
} |
|
|
|