新增机构设置和微信通知设置相关内容

This commit is contained in:
lxd 2024-07-26 12:48:45 +08:00
parent 45e66025dc
commit 774a09aea9
8 changed files with 1237 additions and 0 deletions

View 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 })
},
}

View 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 })
},
}

View 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) // 12
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>

View 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>

View 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>

View 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>

View 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) // 12
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>

View 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>