|
|
|
|
@ -14,6 +14,7 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-button @click="GetList()" style="margin-left: 10px;">查询</el-button>
|
|
|
|
|
<el-button v-if="isAdmin" type="primary" @click="add()" style="margin-left: 10px;">添加科室</el-button>
|
|
|
|
|
<el-button v-if="isAdmin" type="warning" @click="openSyncDialog" style="margin-left: 10px;">从HIS同步科室</el-button>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-checkbox v-model="searchInfo.only_execute" @change="GetList" style="margin-left: 15px;">只显示存在排班的科室</el-checkbox>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
@ -164,6 +165,57 @@
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<el-dialog v-model="syncDialogVisible" title="从HIS同步科室" width="480px" :close-on-click-modal="false">
|
|
|
|
|
<template v-if="!syncDone">
|
|
|
|
|
<div v-if="syncLoading" style="text-align: center; padding: 12px 0; color: #303133; font-size: 15px; font-weight: 500;">
|
|
|
|
|
<el-icon class="is-loading" style="vertical-align: middle; margin-right: 4px;">
|
|
|
|
|
<Loading />
|
|
|
|
|
</el-icon>
|
|
|
|
|
{{ syncLoadingText }}
|
|
|
|
|
</div>
|
|
|
|
|
<el-steps :active="syncStep" align-center finish-status="success" style="margin-top: 10px;">
|
|
|
|
|
<el-step title="同步科室" />
|
|
|
|
|
</el-steps>
|
|
|
|
|
<el-progress :percentage="syncPercent" :stroke-width="14" style="margin-top: 24px;" />
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<el-result icon="success" title="同步完成">
|
|
|
|
|
<template #extra>
|
|
|
|
|
<div style="display: flex; justify-content: space-around; padding: 12px 0;">
|
|
|
|
|
<div style="text-align: center; flex: 1;">
|
|
|
|
|
<div style="font-size: 26px; font-weight: 700; color: #409eff;">{{ syncResult.added }}</div>
|
|
|
|
|
<div style="color: #999; font-size: 13px;">新增</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="width: 1px; background: #e8e8e8; margin: 0 8px;"></div>
|
|
|
|
|
<div style="text-align: center; flex: 1;">
|
|
|
|
|
<div style="font-size: 26px; font-weight: 700; color: #e6a23c;">{{ syncResult.removed }}</div>
|
|
|
|
|
<div style="color: #999; font-size: 13px;">移除</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="width: 1px; background: #e8e8e8; margin: 0 8px;"></div>
|
|
|
|
|
<div style="text-align: center; flex: 1;">
|
|
|
|
|
<div style="font-size: 26px; font-weight: 700; color: #67c23a;">{{ syncResult.updated }}</div>
|
|
|
|
|
<div style="color: #999; font-size: 13px;">更新</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="display: flex; justify-content: space-around; padding: 4px 0 12px;">
|
|
|
|
|
<div style="text-align: center; flex: 1;">
|
|
|
|
|
<div style="font-size: 26px; font-weight: 700; color: #00aaff;">{{ syncResult.enabled }}</div>
|
|
|
|
|
<div style="color: #999; font-size: 13px;">启用</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="width: 1px; background: #e8e8e8; margin: 0 8px;"></div>
|
|
|
|
|
<div style="text-align: center; flex: 1;">
|
|
|
|
|
<div style="font-size: 26px; font-weight: 700; color: #f56c6c;">{{ syncResult.disabled }}</div>
|
|
|
|
|
<div style="color: #999; font-size: 13px;">停用</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="flex: 1;"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-result>
|
|
|
|
|
</template>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<el-button v-if="syncDone" type="primary" @click="syncDialogVisible = false; GetList()">确定</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
@ -181,9 +233,13 @@
|
|
|
|
|
GetDepartmentChildren,
|
|
|
|
|
GetLeafDepartmentList,
|
|
|
|
|
SaveDepartmentChildren,
|
|
|
|
|
GetHasScheduleTopDepartments
|
|
|
|
|
GetHasScheduleTopDepartments,
|
|
|
|
|
DeptSyncDepartment
|
|
|
|
|
} from '@/api/api.js'
|
|
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
|
|
import {
|
|
|
|
|
Loading
|
|
|
|
|
} from '@element-plus/icons-vue'
|
|
|
|
|
import DepartmentResourcesSave from '@/components/Yewu/DepartmentResourcesSave.vue'
|
|
|
|
|
let loginUserinfo = ref(null)
|
|
|
|
|
if (sessionStorage.getItem("LoginUserInfo")) {
|
|
|
|
|
@ -397,6 +453,15 @@ let topScheduleDepts = ref([])
|
|
|
|
|
let leafDepartmentList = ref([]);
|
|
|
|
|
let selectedChildren = ref([]);
|
|
|
|
|
|
|
|
|
|
//同步科室相关
|
|
|
|
|
let syncDialogVisible = ref(false)
|
|
|
|
|
let syncStep = ref(0)
|
|
|
|
|
let syncPercent = ref(0)
|
|
|
|
|
let syncDone = ref(false)
|
|
|
|
|
let syncLoading = ref(false)
|
|
|
|
|
let syncLoadingText = ref('')
|
|
|
|
|
let syncResult = ref({ added: 0, removed: 0, updated: 0, enabled: 0, disabled: 0 })
|
|
|
|
|
|
|
|
|
|
const openLinkDialog = (row) => {
|
|
|
|
|
currentLinkDepartment.value = row
|
|
|
|
|
selectedChildren.value = []
|
|
|
|
|
@ -443,6 +508,32 @@ let topScheduleDepts = ref([])
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//打开同步科室弹窗
|
|
|
|
|
const openSyncDialog = async () => {
|
|
|
|
|
syncDialogVisible.value = true
|
|
|
|
|
syncStep.value = 0
|
|
|
|
|
syncPercent.value = 0
|
|
|
|
|
syncDone.value = false
|
|
|
|
|
syncLoading.value = false
|
|
|
|
|
syncResult.value = { added: 0, removed: 0, updated: 0, enabled: 0, disabled: 0 }
|
|
|
|
|
|
|
|
|
|
syncLoadingText.value = '正在同步科室...'
|
|
|
|
|
syncLoading.value = true
|
|
|
|
|
const res = await DeptSyncDepartment()
|
|
|
|
|
syncLoading.value = false
|
|
|
|
|
|
|
|
|
|
if (!res.status) {
|
|
|
|
|
ElMessage.error('同步科室失败:' + (res.msg || '未知错误'))
|
|
|
|
|
syncDialogVisible.value = false
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
syncResult.value = res.data
|
|
|
|
|
syncStep.value = 1
|
|
|
|
|
syncPercent.value = 100
|
|
|
|
|
syncDone.value = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const loadTopScheduleDepts = () => {
|
|
|
|
|
GetHasScheduleTopDepartments({
|
|
|
|
|
department_id: departmentInfo.value.id
|
|
|
|
|
|