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