|
|
@ -1,14 +1,28 @@ |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<el-drawer v-model="isShowDrawer" title="详情" direction="rtl" size="80%" v-loading="detailLoading"> |
|
|
|
<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="detailData" labelClassName="label-class-name" label-align="left" direction="vertical" |
|
|
|
:column="8" :schema="allSchemas.detailSchema" :columns="2" width="200px" /> |
|
|
|
<Descriptions |
|
|
|
:data="detailData" |
|
|
|
labelClassName="label-class-name" |
|
|
|
label-align="left" |
|
|
|
direction="vertical" |
|
|
|
:column="8" |
|
|
|
:schema="allSchemas.detailSchema" |
|
|
|
:columns="2" |
|
|
|
width="200px" |
|
|
|
/> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<Tabs :tabsList="tabsList" :current="current" @change="change" /> |
|
|
@ -25,7 +39,12 @@ |
|
|
|
@searchFormClick="searchFormClick" |
|
|
|
:allSchemas="detailAllSchemas" |
|
|
|
/> |
|
|
|
<Descriptions v-if="isBasic" :data="detailData" :schema="allSchemas.detailSchema" :columns="2" /> |
|
|
|
<Descriptions |
|
|
|
v-if="isBasic" |
|
|
|
:data="detailData" |
|
|
|
:schema="allSchemas.detailSchema" |
|
|
|
:columns="2" |
|
|
|
/> |
|
|
|
<Table |
|
|
|
v-if="!isBasic" |
|
|
|
:columns="detailAllSchemas.tableColumns" |
|
|
@ -33,18 +52,30 @@ |
|
|
|
:loading="tableObject.loading" |
|
|
|
:pagination="{ total: tableObject.total }" |
|
|
|
v-model:pageSize="tableObject.pageSize" |
|
|
|
v-model:currentPage="tableObject.currentPage" > |
|
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
|
> |
|
|
|
<template #action="{ row }"> |
|
|
|
<ButtonBase :Butttondata="buttondata" @button-base-click="buttonTableClick($event, row)" /> |
|
|
|
<ButtonBase |
|
|
|
:Butttondata="buttondata" |
|
|
|
@button-base-click="buttonTableClick($event, row)" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</Table> |
|
|
|
</ContentWrap> |
|
|
|
<ContentWrap class="w-[27%] ml-16px"> |
|
|
|
<!-- 附件组件 --> |
|
|
|
<Annex :annexData="annexData" @handleAnnexSuccess="handleAnnexSuccess" @deleteAnnexSuccess="deleteAnnexSuccess" :upData="remarksData.data"/> |
|
|
|
<Annex |
|
|
|
:annexData="annexData" |
|
|
|
@handleAnnexSuccess="handleAnnexSuccess" |
|
|
|
@deleteAnnexSuccess="deleteAnnexSuccess" |
|
|
|
:upData="remarksData.data" |
|
|
|
/> |
|
|
|
<!-- 备注组件 --> |
|
|
|
<Remarks :remarksData="remarksData" class="mt-20px" |
|
|
|
@remarksSubmitScuess="remarksSubmitScuess" /> |
|
|
|
<Remarks |
|
|
|
:remarksData="remarksData" |
|
|
|
class="mt-20px" |
|
|
|
@remarksSubmitScuess="remarksSubmitScuess" |
|
|
|
/> |
|
|
|
<!-- 变更记录组件 --> |
|
|
|
<ChangeRecord :changeRecordData="changeRecordData" class="mt-20px" /> |
|
|
|
</ContentWrap> |
|
|
@ -147,22 +178,31 @@ const props = defineProps({ |
|
|
|
type: Array, |
|
|
|
required: false, |
|
|
|
default: null |
|
|
|
}, |
|
|
|
} |
|
|
|
}) |
|
|
|
const isShowDrawer = ref(false) |
|
|
|
const detailLoading = ref(false) |
|
|
|
const tabsList = ref(JSON.parse(JSON.stringify(props.tabs ? props.tabs : ''))) |
|
|
|
|
|
|
|
if (props.isBasic == true) { |
|
|
|
if (tabsList.value && tabsList.value.length > 0) { |
|
|
|
tabsList.value.unshift({ |
|
|
|
label: '详情', |
|
|
|
prop: 'Detail' |
|
|
|
}) |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (tabsList.value && tabsList.value.length > 0) { |
|
|
|
} else { |
|
|
|
tabsList.value = [{ |
|
|
|
tabsList.value = [ |
|
|
|
{ |
|
|
|
label: '明细', |
|
|
|
prop: 'Detail' |
|
|
|
}] |
|
|
|
} |
|
|
|
] |
|
|
|
} |
|
|
|
} |
|
|
|
if (tabsList.value) { |
|
|
|
} |
|
|
|
|
|
|
|
// 附件默认数据 |
|
|
@ -194,11 +234,9 @@ const getFileList = async () => { |
|
|
|
const handleAnnexSuccess = () => { |
|
|
|
getFileList() |
|
|
|
getChangeRecordList() |
|
|
|
|
|
|
|
} |
|
|
|
// 删除附件成功之后所走的方法 |
|
|
|
const deleteAnnexSuccess = async () => { |
|
|
|
|
|
|
|
getFileList() |
|
|
|
getChangeRecordList() |
|
|
|
} |
|
|
@ -207,13 +245,14 @@ const deleteAnnexSuccess = async () => { |
|
|
|
const current = ref(0) |
|
|
|
const change = (item, index) => { |
|
|
|
current.value = index |
|
|
|
emit('changeTabs', item) |
|
|
|
} |
|
|
|
|
|
|
|
//主表所需的参数 |
|
|
|
const masterParmas = ref({ |
|
|
|
masterId: '', //主表id |
|
|
|
number: '', //主表单据号 |
|
|
|
status: '',//主表状态 用于控制子表新增编辑按钮显示情况 |
|
|
|
status: '' //主表状态 用于控制子表新增编辑按钮显示情况 |
|
|
|
}) |
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
@ -229,7 +268,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: |
|
|
|
titleValueRef.value = titleValue |
|
|
|
remarksData.data = { |
|
|
|
tableId: row.id, |
|
|
|
tableName: tableName, |
|
|
|
tableName: tableName |
|
|
|
} |
|
|
|
// 加载明细列表 |
|
|
|
if (!props.isBasic) { |
|
|
@ -238,7 +277,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: |
|
|
|
masterParmas.value.number = row.number |
|
|
|
masterParmas.value.status = row.status |
|
|
|
tableObject.params = { |
|
|
|
masterId: row.id, |
|
|
|
masterId: row.id |
|
|
|
} |
|
|
|
getList() |
|
|
|
} |
|
|
@ -252,13 +291,19 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: |
|
|
|
getChangeRecordList() |
|
|
|
// 判断详情新增按钮是否显示 |
|
|
|
HeadButttondata.value = [ |
|
|
|
defaultButtons.defaultAddBtn({hide:isShowMainButton(row,['1','1','PLAN_PURCHASE_READY','1'])}), // 新增 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
defaultButtons.defaultAddBtn({ |
|
|
|
hide: isShowMainButton(row, ['1', '1', 'PLAN_PURCHASE_READY', '1']) |
|
|
|
}), // 新增 |
|
|
|
defaultButtons.defaultFilterBtn(null) // 筛选 |
|
|
|
] |
|
|
|
// 动态显示操作列按钮 |
|
|
|
buttondata.value = [ |
|
|
|
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1','1','PLAN_PURCHASE_READY','1'])}), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1','1','PLAN_PURCHASE_READY','1'])}), // 删除 |
|
|
|
defaultButtons.mainListEditBtn({ |
|
|
|
hide: isShowMainButton(row, ['1', '1', 'PLAN_PURCHASE_READY', '1']) |
|
|
|
}), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({ |
|
|
|
hide: isShowMainButton(row, ['1', '1', 'PLAN_PURCHASE_READY', '1']) |
|
|
|
}) // 删除 |
|
|
|
] |
|
|
|
} finally { |
|
|
|
detailLoading.value = false |
|
|
@ -286,7 +331,6 @@ const remarksSubmitScuess = async (remark) => { |
|
|
|
const getChangeRecordList = async () => { |
|
|
|
changeRecordData.changeRecordList = await RemarkApi.getChangeRecordPage(remarksData.data) |
|
|
|
} |
|
|
|
|
|
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
|
getListApi: props.apiPage // 分页接口 |
|
|
|
}) |
|
|
@ -300,22 +344,27 @@ const isShowMainButton = (row,val) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 获得表格的各种操作 |
|
|
|
const { getList } = tableMethods |
|
|
|
|
|
|
|
// 头部按钮事件 |
|
|
|
const buttonBaseClick = (val, item) => { |
|
|
|
if (val == 'add') { // 新增 |
|
|
|
if (val == 'add') { |
|
|
|
// 新增 |
|
|
|
openForm('create') |
|
|
|
} else if (val == 'import') { // 导入 |
|
|
|
} else if (val == 'import') { |
|
|
|
// 导入 |
|
|
|
handleImport() |
|
|
|
} else if (val == 'export') { // 导出 |
|
|
|
} else if (val == 'export') { |
|
|
|
// 导出 |
|
|
|
handleExport() |
|
|
|
} else if (val == 'refresh') { // 刷新 |
|
|
|
} else if (val == 'refresh') { |
|
|
|
// 刷新 |
|
|
|
getList() |
|
|
|
} else if (val == 'filtrate') { // 筛选 |
|
|
|
} else { // 其他按钮 |
|
|
|
} else if (val == 'filtrate') { |
|
|
|
// 筛选 |
|
|
|
} else { |
|
|
|
// 其他按钮 |
|
|
|
console.log('其他按钮', item) |
|
|
|
} |
|
|
|
} |
|
|
@ -327,9 +376,11 @@ const buttonBaseClick = (val, item) => { |
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'edit') { // 编辑 |
|
|
|
if (val == 'edit') { |
|
|
|
// 编辑 |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
|
} else if (val == 'delete') { |
|
|
|
// 删除 |
|
|
|
handleDelete(row.id) |
|
|
|
} |
|
|
|
} |
|
|
@ -361,9 +412,7 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
emit('searchTableSuccessDetail', formField, searchField, val, formRef) |
|
|
|
} |
|
|
|
// 传递给父类 |
|
|
|
const emit = defineEmits([ |
|
|
|
'searchTableSuccessDetail', |
|
|
|
]) |
|
|
|
const emit = defineEmits(['searchTableSuccessDetail', 'changeTabs']) |
|
|
|
/** 删除按钮操作 */ |
|
|
|
const handleDelete = async (id: number) => { |
|
|
|
try { |
|
|
@ -380,10 +429,24 @@ const handleDelete = async (id: number) => { |
|
|
|
const searchFormClick = (searchData) => { |
|
|
|
tableObject.params = { |
|
|
|
isSearch: true, |
|
|
|
filters: searchData.filters?searchData.filters:[{column: "masterId", action: "==", value: masterParmas.value.masterId}] |
|
|
|
filters: searchData.filters |
|
|
|
? searchData.filters |
|
|
|
: [{ column: 'masterId', action: '==', value: masterParmas.value.masterId }] |
|
|
|
} |
|
|
|
getList() // 刷新当前列表 |
|
|
|
} |
|
|
|
console.log(props.apiPage) |
|
|
|
//监视属性 |
|
|
|
// watch(props.apiPage, (newValue, oldValue) => { |
|
|
|
// // 回调函数形式 |
|
|
|
// console.log('求和的值变了', '变化后的值是' + newValue, '变化前的值是' + oldValue) |
|
|
|
// }) |
|
|
|
watch( |
|
|
|
() => props.apiPage, |
|
|
|
(newValue,oldValue) => { |
|
|
|
console.log('求和的值变了', '变化后的值是' + newValue, '变化前的值是' + oldValue) |
|
|
|
} |
|
|
|
) |
|
|
|
</script> |
|
|
|
<style lang="scss"> |
|
|
|
.el-drawer__body { |
|
|
|