|
|
@ -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" /> |
|
|
@ -16,15 +30,32 @@ |
|
|
|
<!-- 详情 --> |
|
|
|
<ContentWrap class="w-[100%]"> |
|
|
|
<!-- 列表头部 --> |
|
|
|
<TableHead v-if="!isBasic" :HeadButttondata="HeadButttondata" :number="masterParmas.maintenanceNumber" |
|
|
|
@button-base-click="buttonBaseClick" :routeName="routeName" @searchFormClick="searchFormClick" |
|
|
|
:allSchemas="detailAllSchemas" /> |
|
|
|
<TableHead |
|
|
|
v-if="!isBasic" |
|
|
|
:HeadButttondata="HeadButttondata" |
|
|
|
:number="masterParmas.maintenanceNumber" |
|
|
|
@button-base-click="buttonBaseClick" |
|
|
|
:routeName="routeName" |
|
|
|
@searchFormClick="searchFormClick" |
|
|
|
:allSchemas="detailAllSchemas" |
|
|
|
/> |
|
|
|
<!-- 默认单表展现 --> |
|
|
|
<Descriptions v-if="isBasic && !tabsExtend" :data="detailData" :schema="allSchemas.detailSchema" :columns="2" /> |
|
|
|
<Descriptions |
|
|
|
v-if="isBasic && !tabsExtend" |
|
|
|
:data="detailData" |
|
|
|
:schema="allSchemas.detailSchema" |
|
|
|
:columns="2" |
|
|
|
/> |
|
|
|
<!-- 单表切换tabs 展现table --> |
|
|
|
<Table v-if="isBasic && tabsExtend" :columns="detailAllSchemasRef.tableColumns" :data="tableObjectRef.tableList" |
|
|
|
:loading="tableObjectRef.loading" :pagination="{ total: tableObjectRef.total }" |
|
|
|
v-model:pageSize="tableObjectRef.pageSize" v-model:currentPage="tableObjectRef.currentPage"> |
|
|
|
<Table |
|
|
|
v-if="isBasic && tabsExtend" |
|
|
|
:columns="detailAllSchemasRef.tableColumns" |
|
|
|
:data="tableObjectRef.tableList" |
|
|
|
:loading="tableObjectRef.loading" |
|
|
|
:pagination="{ total: tableObjectRef.total }" |
|
|
|
v-model:pageSize="tableObjectRef.pageSize" |
|
|
|
v-model:currentPage="tableObjectRef.currentPage" |
|
|
|
> |
|
|
|
<!-- <template #action="{ row }"> |
|
|
|
<ButtonBase |
|
|
|
:Butttondata="buttondata" |
|
|
@ -32,34 +63,68 @@ |
|
|
|
/> |
|
|
|
</template> --> |
|
|
|
</Table> |
|
|
|
<Table v-if="!isBasic && fromeWhere != 'countPlan'" :columns="detailAllSchemasRef.tableColumns" |
|
|
|
:data="tableObjectRef.tableList" :loading="tableObjectRef.loading" |
|
|
|
:pagination="{ total: tableObjectRef.total }" v-model:pageSize="tableObjectRef.pageSize" |
|
|
|
v-model:currentPage="tableObjectRef.currentPage"> |
|
|
|
<Table |
|
|
|
v-if="!isBasic && fromeWhere != 'countPlan'" |
|
|
|
:columns="detailAllSchemasRef.tableColumns" |
|
|
|
:data="tableObjectRef.tableList" |
|
|
|
:loading="tableObjectRef.loading" |
|
|
|
:pagination="{ total: tableObjectRef.total }" |
|
|
|
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> |
|
|
|
<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" @button-base-click="buttonTableClick($event, row)" /> |
|
|
|
<ButtonBase |
|
|
|
:Butttondata="buttondata" |
|
|
|
@button-base-click="buttonTableClick($event, row)" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</Table> |
|
|
|
<DetailTable v-if="!isBasic && fromeWhere == 'countPlan' && isShowDrawer" |
|
|
|
:columns="detailAllSchemasRef.tableColumns" :data="tableObjectRef.tableList" :allList="allList" |
|
|
|
:countScopeType="countScopeType" :key="updateKey"> |
|
|
|
<DetailTable |
|
|
|
v-if="!isBasic && fromeWhere == 'countPlan' && isShowDrawer" |
|
|
|
:columns="detailAllSchemasRef.tableColumns" |
|
|
|
:data="tableObjectRef.tableList" |
|
|
|
:allList="allList" |
|
|
|
:countScopeType="countScopeType" |
|
|
|
:key="updateKey" |
|
|
|
> |
|
|
|
<template #action="{ row }"> |
|
|
|
<ButtonBase :Butttondata="buttondata" @button-base-click="buttonTableClick($event, row)" /> |
|
|
|
<ButtonBase |
|
|
|
:Butttondata="buttondata" |
|
|
|
@button-base-click="buttonTableClick($event, row)" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</DetailTable> |
|
|
|
</ContentWrap> |
|
|
|
</div> |
|
|
|
</el-drawer> |
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
|
<BasicForm ref="formRef" @success="submitForm" :rules="detailAllSchemasRules" :formAllSchemas="detailAllSchemas" |
|
|
|
:isBusiness="false" :apiUpdate="apiUpdate" :apiCreate="apiCreate" :fromeWhere="fromeWhere" :isDetail="true" |
|
|
|
@searchTableSuccess="searchTableSuccess" :detailData="detailData" @submitForm="submitForm" |
|
|
|
@selectChangeDetail="selectChangeDetail" :formTypeDetail="formTypeDetail" :countPlanAllList="countPlanAllList" |
|
|
|
:isSearchTableItem="isSearchTableItem" /> |
|
|
|
<BasicForm |
|
|
|
ref="formRef" |
|
|
|
@success="submitForm" |
|
|
|
:rules="detailAllSchemasRules" |
|
|
|
:formAllSchemas="detailAllSchemas" |
|
|
|
:isBusiness="false" |
|
|
|
:apiUpdate="apiUpdate" |
|
|
|
:apiCreate="apiCreate" |
|
|
|
:fromeWhere="fromeWhere" |
|
|
|
:isDetail="true" |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
:detailData="detailData" |
|
|
|
@submitForm="submitForm" |
|
|
|
@selectChangeDetail="selectChangeDetail" |
|
|
|
:formTypeDetail="formTypeDetail" |
|
|
|
:countPlanAllList="countPlanAllList" |
|
|
|
:isSearchTableItem="isSearchTableItem" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
@ -283,11 +348,11 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: |
|
|
|
setBeiJian() |
|
|
|
|
|
|
|
let detailButtonAdd: any = [] |
|
|
|
detailButtonAdd = props.isShowAddBtn ? [ |
|
|
|
detailButtonAdd = props.isShowAddBtn?[ |
|
|
|
defaultButtons.defaultAddBtn({ |
|
|
|
hide: isShowMainButton(row, ['1']) |
|
|
|
}) |
|
|
|
] : [] |
|
|
|
]:[] |
|
|
|
HeadButttondata.value = [...detailButtonAdd] |
|
|
|
// 动态显示操作列按钮 |
|
|
|
if (!props.detailButtonIsShow) { |
|
|
@ -374,8 +439,8 @@ const buttonBaseClick = (val, item) => { |
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
console.log(val) |
|
|
|
console.log(row) |
|
|
|
console.log(val) |
|
|
|
console.log(row) |
|
|
|
if (val == 'edit') { |
|
|
|
// 编辑 |
|
|
|
openForm('update', row) |
|
|
@ -397,7 +462,7 @@ const openForm = async (type: string, row?: number) => { |
|
|
|
let isChargePeoples = false |
|
|
|
let isItemNUmbersTrue = false |
|
|
|
isTrue = detailAllSchemasRef.value.tableColumns.some((item) => item.field == 'maintenances') |
|
|
|
isChargePeoples = detailAllSchemasRef.value.tableColumns.some( |
|
|
|
isChargePeoples = detailAllSchemasRef.value.tableColumns.some( |
|
|
|
(item) => item.field == 'chargePeoples' |
|
|
|
) |
|
|
|
isItemNUmbersTrue = detailAllSchemasRef.value.tableColumns.some( |
|
|
@ -408,7 +473,7 @@ const openForm = async (type: string, row?: number) => { |
|
|
|
row.maintenances = row.maintenances.split(',').map(Number) |
|
|
|
} |
|
|
|
} |
|
|
|
if (isChargePeoples) { |
|
|
|
if(isChargePeoples) { |
|
|
|
if (row.chargePeoples && isString(row.chargePeoples)) { |
|
|
|
row.chargePeoples = row.chargePeoples.split(',').map(Number) |
|
|
|
} |
|
|
@ -453,7 +518,7 @@ const handleDelete = async (id: number) => { |
|
|
|
await getList() |
|
|
|
updateKey.value += 1 |
|
|
|
setBeiJian() |
|
|
|
} catch { } |
|
|
|
} catch {} |
|
|
|
} |
|
|
|
// 筛选提交 |
|
|
|
const searchFormClick = async (searchData) => { |
|
|
|