新增机构设置和微信通知设置相关内容
This commit is contained in:
parent
45e66025dc
commit
774a09aea9
50
src/api/system/org/index.ts
Normal file
50
src/api/system/org/index.ts
Normal file
@ -0,0 +1,50 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 机构管理 VO
|
||||
export interface OrgVO {
|
||||
orgID: string // 机构ID
|
||||
orgName: string // 机构名称
|
||||
address: string // 机构地址
|
||||
contactTel: string // 联系电话
|
||||
contactPerson: string // 联系人姓名
|
||||
reportName: string // 报告上显示的名称:一般跟机构名称一致
|
||||
highLevelOrgID: string // 上级判读医院机构ID
|
||||
wxOpenidlist: string // 能收到微信消息提醒的微信列表,格式为:wxopenid1,wxopenid2,wxopenid3
|
||||
orgSN: string // 机构编号:通常为一个4位数的短号 用于与其他系统的对接之用
|
||||
createDate: Date // 创建时间:年月日时分秒
|
||||
highLevelOrgName: string // 上级机构的机构名称
|
||||
orgLogoUrl: string // 机构logo的URL
|
||||
}
|
||||
|
||||
// 机构管理 API
|
||||
export const OrgApi = {
|
||||
// 查询机构管理分页
|
||||
getOrgPage: async (params: any) => {
|
||||
return await request.get({ url: `/org/org/page`, params })
|
||||
},
|
||||
|
||||
// 查询机构管理详情
|
||||
getOrg: async (id: number) => {
|
||||
return await request.get({ url: `/org/org/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增机构管理
|
||||
createOrg: async (data: OrgVO) => {
|
||||
return await request.post({ url: `/org/org/create`, data })
|
||||
},
|
||||
|
||||
// 修改机构管理
|
||||
updateOrg: async (data: OrgVO) => {
|
||||
return await request.put({ url: `/org/org/update`, data })
|
||||
},
|
||||
|
||||
// 删除机构管理
|
||||
deleteOrg: async (id: number) => {
|
||||
return await request.delete({ url: `/org/org/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出机构管理 Excel
|
||||
exportOrg: async (params) => {
|
||||
return await request.download({ url: `/org/org/export-excel`, params })
|
||||
},
|
||||
}
|
45
src/api/system/wx/index.ts
Normal file
45
src/api/system/wx/index.ts
Normal file
@ -0,0 +1,45 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 微信通知管理 VO
|
||||
export interface WxVO {
|
||||
id: string // 主键
|
||||
wxUserid: string // 个人微信号的userid,唯一值,通过公众号发固定格式命令获取
|
||||
bindTel: string // 电话号码,通过公众号发固定格式命令获取
|
||||
personName: string // 微信号所属人的姓名,通过公众号发固定格式命令获取
|
||||
createDate: Date // 创建时间
|
||||
remark: string // 备注
|
||||
orgId: string // 机构ID
|
||||
}
|
||||
|
||||
// 微信通知管理 API
|
||||
export const WxApi = {
|
||||
// 查询微信通知管理分页
|
||||
getWxPage: async (params: any) => {
|
||||
return await request.get({ url: `/system/wx/page`, params })
|
||||
},
|
||||
|
||||
// 查询微信通知管理详情
|
||||
getWx: async (id: number) => {
|
||||
return await request.get({ url: `/system/wx/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增微信通知管理
|
||||
createWx: async (data: WxVO) => {
|
||||
return await request.post({ url: `/system/wx/create`, data })
|
||||
},
|
||||
|
||||
// 修改微信通知管理
|
||||
updateWx: async (data: WxVO) => {
|
||||
return await request.put({ url: `/system/wx/update`, data })
|
||||
},
|
||||
|
||||
// 删除微信通知管理
|
||||
deleteWx: async (id: number) => {
|
||||
return await request.delete({ url: `/system/wx/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出微信通知管理 Excel
|
||||
exportWx: async (params) => {
|
||||
return await request.download({ url: `/system/wx/export-excel`, params })
|
||||
},
|
||||
}
|
164
src/views/system/org/OrgForm.vue
Normal file
164
src/views/system/org/OrgForm.vue
Normal file
@ -0,0 +1,164 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="100px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-form-item label="机构编码" prop="orgID" label-width="130px">
|
||||
<el-input v-model="formData.orgID" placeholder="请输入机构编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="机构名称" prop="orgName" label-width="130px">
|
||||
<el-input v-model="formData.orgName" placeholder="请输入机构名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="机构地址" prop="address" label-width="130px">
|
||||
<el-input v-model="formData.address" placeholder="请输入机构地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话" prop="contactTel" label-width="130px">
|
||||
<el-input v-model="formData.contactTel" placeholder="请输入联系电话" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人姓名" prop="contactPerson" label-width="130px">
|
||||
<el-input v-model="formData.contactPerson" placeholder="请输入联系人姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="报告上显示名称" prop="reportName" label-width="130px">
|
||||
<el-input v-model="formData.reportName" placeholder="请输入报告上显示名称" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="上级判读医院机构ID" prop="highLevelOrgID">
|
||||
<el-input v-model="formData.highLevelOrgID" placeholder="请输入上级判读医院机构ID" />
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="能收到微信消息提醒的微信列表,格式为:wxopenid1,wxopenid2,wxopenid3" prop="wxOpenidlist">
|
||||
<el-input v-model="formData.wxOpenidlist" placeholder="请输入能收到微信消息提醒的微信列表,格式为:wxopenid1,wxopenid2,wxopenid3" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="短位机构编号" prop="orgSN" label-width="130px">
|
||||
<el-input v-model="formData.orgSN" placeholder="请输入短位机构编号" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="创建时间:年月日时分秒" prop="createDate">
|
||||
<el-date-picker
|
||||
v-model="formData.createDate"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择创建时间:年月日时分秒"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="上级机构的机构名称" prop="highLevelOrgName">
|
||||
<el-input v-model="formData.highLevelOrgName" placeholder="请输入上级机构的机构名称" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="机构logo的URL" prop="orgLogoUrl" label-width="130px">
|
||||
<el-input v-model="formData.orgLogoUrl" placeholder="请输入机构logo的URL" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { OrgApi, OrgVO } from '@/api/system/org'
|
||||
|
||||
/** 机构管理 表单 */
|
||||
defineOptions({ name: 'OrgForm' })
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
orgID: undefined,
|
||||
orgName: undefined,
|
||||
address: undefined,
|
||||
contactTel: undefined,
|
||||
contactPerson: undefined,
|
||||
reportName: undefined,
|
||||
highLevelOrgID: undefined,
|
||||
wxOpenidlist: undefined,
|
||||
orgSN: undefined,
|
||||
createDate: undefined,
|
||||
highLevelOrgName: undefined,
|
||||
orgLogoUrl: undefined,
|
||||
})
|
||||
const formRules = reactive({
|
||||
|
||||
orgID: [{ required: true, message: '请输入机构编码', trigger: 'blur' }],
|
||||
orgName: [{ required: true, message: '请输入机构名称', trigger: 'blur' }],
|
||||
contactTel: [{ required: true, message: '请输入机构联系人', trigger: 'blur' }],
|
||||
contactPerson: [{ required: true, message: '请输入机构联系电话', trigger: 'blur' }],
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await OrgApi.getOrg(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
await formRef.value.validate()
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
const re = ref()
|
||||
try {
|
||||
const data = formData.value as unknown as OrgVO
|
||||
if (formType.value === 'create') {
|
||||
re.value= await OrgApi.createOrg(data)
|
||||
if(re.value==='机构ID已经存在')
|
||||
{
|
||||
message.error(re.value)
|
||||
return
|
||||
}
|
||||
else
|
||||
{
|
||||
message.success(t('common.createSuccess'))
|
||||
}
|
||||
|
||||
} else {
|
||||
await OrgApi.updateOrg(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
orgID: undefined,
|
||||
orgName: undefined,
|
||||
address: undefined,
|
||||
contactTel: undefined,
|
||||
contactPerson: undefined,
|
||||
reportName: undefined,
|
||||
highLevelOrgID: undefined,
|
||||
wxOpenidlist: undefined,
|
||||
orgSN: undefined,
|
||||
createDate: undefined,
|
||||
highLevelOrgName: undefined,
|
||||
orgLogoUrl: undefined,
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
147
src/views/system/org/OrgSuperiorForm.vue
Normal file
147
src/views/system/org/OrgSuperiorForm.vue
Normal file
@ -0,0 +1,147 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||
<div>
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="机构名称" prop="orgName">
|
||||
<el-input
|
||||
v-model="queryParams.orgName"
|
||||
placeholder="请输入机构名称"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<p style="color: red">双击选择上级机构</p>
|
||||
</el-form-item>
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="list"
|
||||
:stripe="true"
|
||||
:show-overflow-tooltip="true"
|
||||
@row-dblclick="handleRowDbClick"
|
||||
>
|
||||
<el-table-column label="机构编码" align="center" prop="orgID" />
|
||||
<el-table-column label="机构名称" align="center" prop="orgName" />
|
||||
<el-table-column label="机构地址" align="center" prop="address" />
|
||||
<el-table-column label="联系电话" align="center" prop="contactTel" />
|
||||
<el-table-column label="联系人姓名" align="center" prop="contactPerson" />
|
||||
<el-table-column label="报告上显示名称" align="center" prop="reportName" v-if="false" />
|
||||
<el-table-column label="短位机构编号" align="center" prop="orgSN" v-if="false" />
|
||||
<el-table-column
|
||||
label="上级机构的机构名称"
|
||||
align="center"
|
||||
prop="highLevelOrgName"
|
||||
v-if="false"
|
||||
/>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
</el-form>
|
||||
</div>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { OrgApi, OrgVO } from '@/api/system/org'
|
||||
|
||||
/** 机构管理 表单 */
|
||||
defineOptions({ name: 'OrgForm' })
|
||||
|
||||
const list = ref<OrgVO[]>([]) // 列表的数据
|
||||
|
||||
const dbclickupdate = ref<OrgVO>({} as OrgVO) // 双击行要更新的数据
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
const total = ref(0) // 列表的总页数
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
orgName: undefined,
|
||||
address: undefined,
|
||||
contactTel: undefined,
|
||||
contactPerson: undefined,
|
||||
reportName: undefined,
|
||||
highLevelOrgID: undefined,
|
||||
wxOpenidlist: undefined,
|
||||
orgSN: undefined,
|
||||
createDate: [],
|
||||
highLevelOrgName: undefined,
|
||||
orgLogoUrl: undefined
|
||||
})
|
||||
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
//传递过来当前行的id
|
||||
let orgid: string = ''
|
||||
/** 打开弹窗 */
|
||||
const open = async (id: string) => {
|
||||
orgid = id
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = '设置上级机构'
|
||||
resetForm()
|
||||
getList()
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await OrgApi.getOrgPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
dbclickupdate.value = {} as OrgVO
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
// 双击行事件
|
||||
const handleRowDbClick = async (row) => {
|
||||
try {
|
||||
const data = row as unknown as OrgVO
|
||||
dbclickupdate.value.orgID = orgid
|
||||
dbclickupdate.value.highLevelOrgID = data.orgID
|
||||
dbclickupdate.value.highLevelOrgName = data.orgName
|
||||
await OrgApi.updateOrg(dbclickupdate.value)
|
||||
message.success("设置成功")
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
dialogVisible.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
174
src/views/system/org/OrgWxForm.vue
Normal file
174
src/views/system/org/OrgWxForm.vue
Normal file
@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||
<div>
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="微信号userid" prop="wxUserid" label-width="110px">
|
||||
<el-input
|
||||
v-model="queryParams.wxUserid"
|
||||
placeholder="请输入个人微信号serid"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="ClickConfirm()"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 确认
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="主键" align="center" prop="id" v-if="false" />
|
||||
<el-table-column label="微信号userid" align="center" prop="wxUserid" />
|
||||
<el-table-column label="电话号码" align="center" prop="bindTel" />
|
||||
<el-table-column label="微信号所属人的姓名" align="center" prop="personName" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="机构编码" align="center" prop="orgId" />
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
</el-form>
|
||||
</div>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { WxApi, WxVO } from '@/api/system/wx'
|
||||
import { OrgApi, OrgVO } from '@/api/system/org'
|
||||
/** 设置微信通知 表单 */
|
||||
defineOptions({ name: 'OrgWxForm' })
|
||||
|
||||
const list = ref<WxVO[]>([]) // 列表的数据
|
||||
const uporgdate=ref<OrgVO>({}as OrgVO)//确认处理的数据
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
const total = ref(0) // 列表的总页数
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
wxUserid: undefined,
|
||||
bindTel: undefined,
|
||||
personName: undefined
|
||||
})
|
||||
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
//传递过来当前行的id
|
||||
let orgid: string = ''
|
||||
/** 打开弹窗 */
|
||||
const open = async (id: string) => {
|
||||
orgid = id
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = '设置微信通知'
|
||||
resetForm()
|
||||
getList()
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await WxApi.getWxPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formRef.value?.resetFields()
|
||||
selectedRows.value=[]
|
||||
previouslySelectedRows.value=[]
|
||||
uporgdate.value={} as OrgVO
|
||||
}
|
||||
|
||||
//批量相关
|
||||
const selectedRows = ref<any[]>([]); // 存储当前选中的行
|
||||
const previouslySelectedRows = ref<any[]>([]); // 存储先前选中的行
|
||||
const handleSelectionChange = (selection) => {
|
||||
// 更新当前选中的行
|
||||
selectedRows.value = selection;
|
||||
|
||||
// 检查哪些行被取消勾选
|
||||
const unselectedRows = previouslySelectedRows.value.filter(prevRow => !selection.some(newRow => newRow.id === prevRow.id));
|
||||
|
||||
// 输出取消勾选的行
|
||||
unselectedRows.forEach(row => {
|
||||
console.log(`Row ${row.id} was unselected.`);
|
||||
// 这里可以添加你的逻辑来处理取消勾选的行
|
||||
});
|
||||
|
||||
// 更新先前选中的行为当前选中的行,以备下次比较
|
||||
previouslySelectedRows.value = selection;
|
||||
console.log(previouslySelectedRows.value)
|
||||
}
|
||||
//确认
|
||||
const ClickConfirm= async ()=>
|
||||
{
|
||||
try
|
||||
{
|
||||
if(previouslySelectedRows.value.length>0)
|
||||
{
|
||||
let wxid:string=""
|
||||
previouslySelectedRows.value.forEach((item) => {
|
||||
|
||||
wxid+= item.wxUserid+','
|
||||
});
|
||||
|
||||
console.log(wxid)
|
||||
uporgdate.value.orgID=orgid
|
||||
uporgdate.value.wxOpenidlist=wxid.replace(/,$/, '')
|
||||
await OrgApi.updateOrg(uporgdate.value)
|
||||
message.success("设置成功")
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
dialogVisible.value = false
|
||||
}
|
||||
else
|
||||
{
|
||||
message.warning("请先选择要设置的微信")
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
330
src/views/system/org/index.vue
Normal file
330
src/views/system/org/index.vue
Normal file
@ -0,0 +1,330 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="机构名称" prop="orgName">
|
||||
<el-input
|
||||
v-model="queryParams.orgName"
|
||||
placeholder="请输入机构名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="机构地址" prop="address">
|
||||
<el-input
|
||||
v-model="queryParams.address"
|
||||
placeholder="请输入机构地址"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="联系电话" prop="contactTel">
|
||||
<el-input
|
||||
v-model="queryParams.contactTel"
|
||||
placeholder="请输入联系电话"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="联系人姓名" prop="contactPerson">
|
||||
<el-input
|
||||
v-model="queryParams.contactPerson"
|
||||
placeholder="请输入联系人姓名"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="报告上显示的名称:一般跟机构名称一致" prop="reportName">
|
||||
<el-input
|
||||
v-model="queryParams.reportName"
|
||||
placeholder="请输入报告上显示的名称:一般跟机构名称一致"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="上级判读医院机构ID" prop="highLevelOrgID">
|
||||
<el-input
|
||||
v-model="queryParams.highLevelOrgID"
|
||||
placeholder="请输入上级判读医院机构ID"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="能收到微信消息提醒的微信列表,格式为:wxopenid1,wxopenid2,wxopenid3" prop="wxOpenidlist">
|
||||
<el-input
|
||||
v-model="queryParams.wxOpenidlist"
|
||||
placeholder="请输入能收到微信消息提醒的微信列表,格式为:wxopenid1,wxopenid2,wxopenid3"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="机构编号:通常为一个4位数的短号 用于与其他系统的对接之用" prop="orgSN">
|
||||
<el-input
|
||||
v-model="queryParams.orgSN"
|
||||
placeholder="请输入机构编号:通常为一个4位数的短号 用于与其他系统的对接之用"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="创建时间:年月日时分秒" prop="createDate">
|
||||
<el-date-picker
|
||||
v-model="queryParams.createDate"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="上级机构的机构名称" prop="highLevelOrgName">
|
||||
<el-input
|
||||
v-model="queryParams.highLevelOrgName"
|
||||
placeholder="请输入上级机构的机构名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="机构logo的URL" prop="orgLogoUrl">
|
||||
<el-input
|
||||
v-model="queryParams.orgLogoUrl"
|
||||
placeholder="请输入机构logo的URL"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['org:org:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['org:org:export']"
|
||||
>
|
||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="机构编码" align="center" prop="orgID" />
|
||||
<el-table-column label="机构名称" align="center" prop="orgName" width="130px"/>
|
||||
<el-table-column label="机构地址" align="center" prop="address" />
|
||||
<el-table-column label="联系电话" align="center" prop="contactTel" width="120px"/>
|
||||
<el-table-column label="联系人姓名" align="center" prop="contactPerson" width="100px"/>
|
||||
<el-table-column label="报告上显示名称" align="center" prop="reportName" width="130px"/>
|
||||
<el-table-column label="上级判读医院机构ID" align="center" prop="highLevelOrgID" v-if="false"/>
|
||||
<el-table-column label="微信提醒列表" align="center" prop="wxOpenidlist" />
|
||||
<el-table-column label="短位机构编号" align="center" prop="orgSN" width="110px"/>
|
||||
<el-table-column
|
||||
label="创建时间:年月日时分秒"
|
||||
align="center"
|
||||
prop="createDate"
|
||||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
v-if="false"
|
||||
/>
|
||||
<el-table-column label="上级机构的机构名称" align="center" prop="highLevelOrgName" />
|
||||
<el-table-column label="机构logo的URL" align="center" prop="orgLogoUrl" v-if="false"/>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', scope.row.orgID)"
|
||||
v-hasPermi="['org:org:update']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openOrgSuperiorForm(scope.row.orgID)"
|
||||
v-hasPermi="['org:org:update']"
|
||||
>
|
||||
上级机构设置
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openorgwxForm(scope.row.orgID)"
|
||||
v-hasPermi="['org:org:update']"
|
||||
>
|
||||
微信通知设置
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.orgID)"
|
||||
v-hasPermi="['org:org:delete']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<OrgForm ref="formRef" @success="getList" />
|
||||
<!-- 设置上级机构 -->
|
||||
<OrgSuperiorForm ref="formOrgSuperiorForm" @success="getList"/>
|
||||
<!-- 微信通知设置 -->
|
||||
<OrgWxForm ref="formOrgWxForm" @success="getList"/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { OrgApi, OrgVO } from '@/api/system/org'
|
||||
import OrgForm from './OrgForm.vue'
|
||||
import OrgWxForm from './OrgWxForm.vue'
|
||||
import OrgSuperiorForm from './OrgSuperiorForm.vue'
|
||||
import { getUserProfile, ProfileVO } from '@/api/system/user/profile'
|
||||
/** 机构管理 列表 */
|
||||
defineOptions({ name: 'Org' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
//当前登录人信息
|
||||
const Profilevo = ref<ProfileVO>({} as ProfileVO)
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<OrgVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
orgName: undefined,
|
||||
address: undefined,
|
||||
contactTel: undefined,
|
||||
contactPerson: undefined,
|
||||
reportName: undefined,
|
||||
highLevelOrgID: undefined,
|
||||
wxOpenidlist: undefined,
|
||||
orgSN: undefined,
|
||||
createDate: [],
|
||||
highLevelOrgName: undefined,
|
||||
orgLogoUrl: undefined,
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await OrgApi.getOrgPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
// 设置上级机构
|
||||
const formOrgSuperiorForm = ref()
|
||||
const openOrgSuperiorForm=(id:string)=>
|
||||
{
|
||||
formOrgSuperiorForm.value.open(id)
|
||||
}
|
||||
|
||||
// 设置微信通知
|
||||
const formOrgWxForm=ref()
|
||||
const openorgwxForm=(id:string)=>
|
||||
{
|
||||
formOrgWxForm.value.open(id)
|
||||
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await OrgApi.deleteOrg(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
// 导出的二次确认
|
||||
await message.exportConfirm()
|
||||
// 发起导出
|
||||
exportLoading.value = true
|
||||
const data = await OrgApi.exportOrg(queryParams)
|
||||
download.excel(data, '机构管理.xls')
|
||||
} catch {
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
//获取当前登录人信息
|
||||
const getlogininfo = async () => {
|
||||
Profilevo.value = await getUserProfile()
|
||||
}
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getlogininfo()
|
||||
getList()
|
||||
})
|
||||
</script>
|
126
src/views/system/wx/WxForm.vue
Normal file
126
src/views/system/wx/WxForm.vue
Normal file
@ -0,0 +1,126 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="100px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-form-item label="微信号userid" prop="wxUserid" label-width="130px">
|
||||
<el-input v-model="formData.wxUserid" placeholder="请输入微信号userid" />
|
||||
</el-form-item>
|
||||
<el-form-item label="电话号码" prop="bindTel" label-width="130px">
|
||||
<el-input v-model="formData.bindTel" placeholder="请输入电话号码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="微信号所属姓名" prop="personName" label-width="130px">
|
||||
<el-input v-model="formData.personName" placeholder="请输入微信号所属人的姓名" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="创建时间" prop="createDate">
|
||||
<el-date-picker
|
||||
v-model="formData.createDate"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择创建时间"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="备注" prop="remark" label-width="130px">
|
||||
<el-input v-model="formData.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="机构编码" prop="orgId" label-width="130px">
|
||||
<el-input v-model="formData.orgId" placeholder="请输入机构编码" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { WxApi, WxVO } from '@/api/system/wx'
|
||||
|
||||
/** 微信通知管理 表单 */
|
||||
defineOptions({ name: 'WxForm' })
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
wxUserid: undefined,
|
||||
bindTel: undefined,
|
||||
personName: undefined,
|
||||
createDate: undefined,
|
||||
remark: undefined,
|
||||
orgId: undefined,
|
||||
})
|
||||
const formRules = reactive({
|
||||
|
||||
wxUserid: [{ required: true, message: '请输入微信号userid', trigger: 'blur' }],
|
||||
bindTel: [{ required: true, message: '请输入电话号码', trigger: 'blur' }],
|
||||
personName: [{ required: true, message: '请输入所属人的姓名', trigger: 'blur' }],
|
||||
orgId: [{ required: true, message: '请输入机构编码', trigger: 'blur' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await WxApi.getWx(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
await formRef.value.validate()
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as WxVO
|
||||
if (formType.value === 'create') {
|
||||
await WxApi.createWx(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await WxApi.updateWx(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
wxUserid: undefined,
|
||||
bindTel: undefined,
|
||||
personName: undefined,
|
||||
createDate: undefined,
|
||||
remark: undefined,
|
||||
orgId: undefined,
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
201
src/views/system/wx/index.vue
Normal file
201
src/views/system/wx/index.vue
Normal file
@ -0,0 +1,201 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="微信号userid" prop="wxUserid" label-width="110px">
|
||||
<el-input
|
||||
v-model="queryParams.wxUserid"
|
||||
placeholder="请输入个人微信号serid"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="电话号码" prop="bindTel" label-width="110px">
|
||||
<el-input
|
||||
v-model="queryParams.bindTel"
|
||||
placeholder="请输入电话号码"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="微信号所属人姓名" prop="personName" label-width="130px">
|
||||
<el-input
|
||||
v-model="queryParams.personName"
|
||||
placeholder="请输入微信号所属人的姓名"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['system:wx:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['system:wx:export']"
|
||||
>
|
||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="主键" align="center" prop="id" v-if="false"/>
|
||||
<el-table-column label="微信号userid" align="center" prop="wxUserid" />
|
||||
<el-table-column label="电话号码" align="center" prop="bindTel" />
|
||||
<el-table-column label="微信号所属人的姓名" align="center" prop="personName" />
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createDate"
|
||||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
v-if="false"
|
||||
/>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="机构编码" align="center" prop="orgId" />
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', scope.row.id)"
|
||||
v-hasPermi="['system:wx:update']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['system:wx:delete']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<WxForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { WxApi, WxVO } from '@/api/system/wx'
|
||||
import WxForm from './WxForm.vue'
|
||||
import { fa } from 'element-plus/es/locale';
|
||||
|
||||
/** 微信通知管理 列表 */
|
||||
defineOptions({ name: 'Wx' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<WxVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
wxUserid: undefined,
|
||||
bindTel: undefined,
|
||||
personName: undefined,
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await WxApi.getWxPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await WxApi.deleteWx(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
// 导出的二次确认
|
||||
await message.exportConfirm()
|
||||
// 发起导出
|
||||
exportLoading.value = true
|
||||
const data = await WxApi.exportWx(queryParams)
|
||||
download.excel(data, '微信通知管理.xls')
|
||||
} catch {
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user