ahdevicemgt-ui/src/views/base/customer/index.vue

114 lines
3.7 KiB
Vue
Raw Normal View History

2024-08-06 19:30:29 +08:00
<template>
<!-- 往来单位管理页面 -->
<div class="app-container">
2024-08-15 18:03:14 +08:00
<PageHeader
v-if="isShowComponent !== 'Index'"
:pageContent="pageContent"
@goBack="goBack"
/>
<!-- 列表 -->
<TableModel
:formLabel="formLabel"
:columnsList="columnsList"
:request-api="queryContactUnitsListApi"
2024-08-12 18:09:14 +08:00
ref="tableRef"
2024-08-15 18:03:14 +08:00
v-if="isShowComponent === 'Index'"
>
<template slot="btn" slot-scope="{ queryParams }">
<el-button type="primary" @click="handleAddData()"
>新建</el-button
>
2024-08-15 18:03:14 +08:00
<el-button type="success" @click="isShowComponent = 'person-config'"
>人员配置</el-button
>
2024-08-12 18:09:14 +08:00
<el-button @click="handleExportData(queryParams, 'base/customer/export', '往来单位清单')"
>导出</el-button
>
</template>
<template slot="handle" slot-scope="{ data }">
<el-button
type="primary"
size="mini"
@click="handleEditData(data)"
>编辑</el-button
>
<el-button
type="danger"
size="mini"
2024-08-12 18:09:14 +08:00
@click="handleDeleteData(data.id, deleteContactUnitsApi)"
>删除</el-button
>
</template>
2024-08-12 18:09:14 +08:00
<template slot="isActive" slot-scope="{ data }">
{{ data.isActive == '1' ? '启用' : '不启用' }}
</template>
2024-08-13 18:53:03 +08:00
<template slot="phone" slot-scope="{ data }">
{{ phoneCrypto(data.phone) }}
</template>
</TableModel>
<!-- 新增以及修改时的弹框 -->
<DialogModel
:dialogConfig="dialogConfig"
@closeDialogOuter="closeDialogOuter"
>
<template slot="outerContent">
<!-- 新增以及修改数据的表单组件 -->
<FormContactUnits
@closeDialog="closeDialog"
:editParams="editParams"
/>
</template>
</DialogModel>
2024-08-15 18:03:14 +08:00
<person-config
v-if="isShowComponent === 'person-config'"
>
</person-config>
</div>
2024-08-06 19:30:29 +08:00
</template>
<script>
2024-08-15 18:03:14 +08:00
import PageHeader from '@/components/pageHeader'
2024-08-13 18:53:03 +08:00
import { columnsList, dialogConfig, formLabel } from './config'
import { commonMixin } from '../mixins/common'
import FormContactUnits from './components/form-contact-units.vue'
2024-08-15 18:03:14 +08:00
import PersonConfig from './components/person-config.vue'
2024-08-13 18:53:03 +08:00
import { deleteContactUnitsApi, queryContactUnitsListApi } from '@/api/base/customer'
export default {
name: 'ContactUnits',
mixins: [commonMixin], // 混入公共方法和数据
2024-08-15 18:03:14 +08:00
components: { FormContactUnits, PersonConfig, PageHeader },
2024-08-13 18:53:03 +08:00
methods: {
queryContactUnitsListApi,
deleteContactUnitsApi,
// 手机号脱密
/* phoneCrypto(phoneNumber) {
let reg = /^(1[3-9][0-9])\d{4}(\d{4}$)/
let isMobile = reg.test(phoneNumber)
if (isMobile) {
return phoneNumber.replace(reg, "$1****$2")
}
return phoneNumber
} */
2024-08-15 18:03:14 +08:00
goBack() {
this.isShowComponent = 'Index'
}
2024-08-13 18:53:03 +08:00
},
data() {
return {
2024-08-15 18:03:14 +08:00
isShowComponent: 'Index',
pageContent: '往来人员配置',
formLabel,
columnsList,
dialogConfig,
addDialogTitle: '新建往来单位', // 新建时弹框标题
editDialogTitle: '修改往来单位', // 修改时弹框标题
}
},
}
2024-08-06 19:30:29 +08:00
</script>