|
|
@@ -1,7 +1,98 @@
|
|
|
<!-- 会员机构管理-子机构管理-子机构变更审核 -->
|
|
|
<template>
|
|
|
- <app-view></app-view>
|
|
|
+ <app-view>
|
|
|
+ <template #header>
|
|
|
+ <app-filter :option="filterOption" />
|
|
|
+ </template>
|
|
|
+ <app-table :data="dataList" :columns="tableColumns" :loading="loading">
|
|
|
+ <!-- 操作 -->
|
|
|
+ <template #operate="{ row }">
|
|
|
+ <app-operation size="small" :data-list="getActionButtons()"
|
|
|
+ @click="(code: string) => openComponent(code, row)" circle />
|
|
|
+ </template>
|
|
|
+ <template #footer>
|
|
|
+ <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"
|
|
|
+ @change="onSearch" />
|
|
|
+ </template>
|
|
|
+ </app-table>
|
|
|
+ <component :is="componentMap.get(componentId)" v-bind="{ record }" @closed="closeComponent"
|
|
|
+ v-if="componentId" />
|
|
|
+ </app-view>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
+import { shallowRef } from 'vue'
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
+import { formatDate } from '@/filters'
|
|
|
+import { getUserInfoTypeName } from '@/constants/member'
|
|
|
+import { useEnum } from '@/hooks/enum'
|
|
|
+import { useRequest } from '@/hooks/request'
|
|
|
+import { useDataFilter } from '@/hooks/datatable-v2'
|
|
|
+import { useOperation } from '@/hooks/operation'
|
|
|
+import { queryOrganSonAudit } from '@/services/api/member'
|
|
|
+import AppTable from '@pc/components/base/table/index.vue'
|
|
|
+import AppFilter from '@pc/components/base/table-filter-v2/index.vue'
|
|
|
+import AppPagination from '@pc/components/base/pagination/index.vue'
|
|
|
+import AppOperation from '@pc/components/base/operation/index.vue'
|
|
|
+import { i18n } from '@/stores'
|
|
|
+
|
|
|
+const { global: { t } } = i18n
|
|
|
+
|
|
|
+// 机构状态
|
|
|
+const areastatusEnum = useEnum('areastatus')
|
|
|
+// 机构类型
|
|
|
+const usertype2Enum = useEnum('usertype2')
|
|
|
+// 类型
|
|
|
+const subarealevelEnum = useEnum('subarealevel')
|
|
|
+
|
|
|
+const { componentMap, componentId, record, openComponent, closeComponent, getActionButtons } = useOperation<Model.OrganSonRsp>({
|
|
|
+ onClose: () => onSearch()
|
|
|
+})
|
|
|
+
|
|
|
+const { dataList, total, pageSize, pageIndex, loading, run } = useRequest(queryOrganSonAudit, {
|
|
|
+ params: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ accountstatus: 2
|
|
|
+ },
|
|
|
+ onError: (err) => {
|
|
|
+ ElMessage.error(err)
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
+ { field: 'userid', label: '机构代码' },
|
|
|
+ { field: 'accountname', label: '机构名称' },
|
|
|
+ { field: 'parentname', label: '所属机构' },
|
|
|
+ { field: 'memberusername', label: '所属会员' },
|
|
|
+ { field: 'accountstatus', label: '机构状态', formatValue: (val) => areastatusEnum.getEnumTypeName(val) },
|
|
|
+ { field: 'usertype', label: '机构类型', formatValue: (val) => usertype2Enum.getEnumTypeName(val) },
|
|
|
+ { field: 'userinfotype', label: '所有者类型', formatValue: (val) => getUserInfoTypeName(val) },
|
|
|
+ { field: 'userName', label: '操作员' },
|
|
|
+ { field: 'modifytime', label: '最后更新时间', formatValue: (val) => formatDate(val) },
|
|
|
+ { field: 'operate', label: 'common.operate', fixed: 'right' }
|
|
|
+])
|
|
|
+
|
|
|
+const { filterOption, getQueryParams, resetFilters } = useDataFilter<Model.OrganSonAuditReq>({
|
|
|
+ filters: [
|
|
|
+ {
|
|
|
+ field: 'accountname',
|
|
|
+ label: '机构'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'subarealevel',
|
|
|
+ label: '类型',
|
|
|
+ options: () => subarealevelEnum.getEnumOptions()
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ buttons: [
|
|
|
+ { label: t('operation.search'), className: 'el-button--primary', onClick: () => onSearch() },
|
|
|
+ { label: t('operation.reset'), className: 'el-button--primary', validateEvent: false, onClick: () => resetFilters() }
|
|
|
+ ]
|
|
|
+})
|
|
|
+
|
|
|
+const onSearch = (clear = false) => {
|
|
|
+ const qs = getQueryParams(clear)
|
|
|
+ run(qs)
|
|
|
+}
|
|
|
</script>
|