|
|
|
|
@ -34,6 +34,7 @@
|
|
|
|
|
<el-button type="primary" @click="BatchLinkDevice()" style="margin-left: 10px;">批量关联排班</el-button>
|
|
|
|
|
<el-button type="primary" @click="openBatchNotice('check_notice')" style="margin-left: 10px;">批量设置检查须知</el-button>
|
|
|
|
|
<el-button type="primary" @click="openBatchNotice('warm_tips')" style="margin-left: 10px;">批量设置温馨提示</el-button>
|
|
|
|
|
<el-button type="warning" @click="openSyncDialog" style="margin-left: 10px;">同步项目</el-button>
|
|
|
|
|
</el-row>
|
|
|
|
|
</div>
|
|
|
|
|
<el-table ref="checkItemTableRef" :data="tableData" style="width: 100%; margin-top: 10px;" row-key="id" @sort-change="onSortChange" @selection-change="onSelectionChange">
|
|
|
|
|
@ -280,6 +281,38 @@
|
|
|
|
|
<el-button type="primary" @click="saveBatchNotice">确定</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<el-dialog v-model="syncDialogVisible" title="同步项目" width="480px" :close-on-click-modal="false">
|
|
|
|
|
<template v-if="!syncDone">
|
|
|
|
|
<el-steps :active="syncStep" align-center finish-status="success" style="margin-top: 10px;">
|
|
|
|
|
<el-step title="同步分类" />
|
|
|
|
|
<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;">
|
|
|
|
|
<div style="font-size: 28px; font-weight: 700; color: #409eff;">{{ syncResult.added }}</div>
|
|
|
|
|
<div style="color: #999; font-size: 13px;">新增项目</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="text-align: center;">
|
|
|
|
|
<div style="font-size: 28px; font-weight: 700; color: #e6a23c;">{{ syncResult.removed }}</div>
|
|
|
|
|
<div style="color: #999; font-size: 13px;">移除项目</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="text-align: center;">
|
|
|
|
|
<div style="font-size: 28px; font-weight: 700; color: #67c23a;">{{ syncResult.updated }}</div>
|
|
|
|
|
<div style="color: #999; font-size: 13px;">更新项目</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-result>
|
|
|
|
|
</template>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<el-button v-if="syncDone" type="primary" @click="syncDialogVisible = false">确定</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
@ -303,7 +336,9 @@
|
|
|
|
|
GetCheckItemRules,
|
|
|
|
|
SaveCheckItemRules,
|
|
|
|
|
DeptBatchUpdateNotice,
|
|
|
|
|
GetItemRelatedResources
|
|
|
|
|
GetItemRelatedResources,
|
|
|
|
|
DeptSyncItemClass,
|
|
|
|
|
DeptSyncCheckItem
|
|
|
|
|
} from '@/api/api.js'
|
|
|
|
|
import {
|
|
|
|
|
ElMessage,
|
|
|
|
|
@ -421,6 +456,13 @@
|
|
|
|
|
let batchNoticeTitle = ref('')
|
|
|
|
|
let batchNoticeValue = ref('')
|
|
|
|
|
|
|
|
|
|
//同步项目相关
|
|
|
|
|
let syncDialogVisible = ref(false)
|
|
|
|
|
let syncStep = ref(0)
|
|
|
|
|
let syncPercent = ref(0)
|
|
|
|
|
let syncDone = ref(false)
|
|
|
|
|
let syncResult = ref({ added: 0, removed: 0, updated: 0 })
|
|
|
|
|
|
|
|
|
|
// 计算链接对话框标题
|
|
|
|
|
const linkDialogTitle = computed(() => {
|
|
|
|
|
return isBatchLink.value ? '批量关联排班' : '关联排班'
|
|
|
|
|
@ -480,6 +522,40 @@
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//打开同步项目弹窗
|
|
|
|
|
const openSyncDialog = async () => {
|
|
|
|
|
syncDialogVisible.value = true
|
|
|
|
|
syncStep.value = 0
|
|
|
|
|
syncPercent.value = 0
|
|
|
|
|
syncDone.value = false
|
|
|
|
|
syncResult.value = { added: 0, removed: 0, updated: 0 }
|
|
|
|
|
|
|
|
|
|
// 步骤1:同步分类
|
|
|
|
|
const classRes = await DeptSyncItemClass()
|
|
|
|
|
if (!classRes.status) {
|
|
|
|
|
ElMessage.error('同步分类失败:' + (classRes.msg || '未知错误'))
|
|
|
|
|
syncDialogVisible.value = false
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
syncStep.value = 1
|
|
|
|
|
syncPercent.value = 50
|
|
|
|
|
|
|
|
|
|
// 步骤2:同步项目
|
|
|
|
|
const itemRes = await DeptSyncCheckItem()
|
|
|
|
|
if (!itemRes.status) {
|
|
|
|
|
ElMessage.error('同步项目失败:' + (itemRes.msg || '未知错误'))
|
|
|
|
|
syncDialogVisible.value = false
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
syncResult.value = itemRes.data
|
|
|
|
|
syncStep.value = 2
|
|
|
|
|
syncPercent.value = 100
|
|
|
|
|
syncDone.value = true
|
|
|
|
|
// 刷新列表
|
|
|
|
|
GetItemClassList()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//点击打开设备穿梭框
|
|
|
|
|
const LinkDeviceClick = (row) => {
|
|
|
|
|
isBatchLink.value = false
|
|
|
|
|
|