|
@@ -0,0 +1,590 @@
|
|
|
+<template>
|
|
|
+ <div class="layout_display_flex_y">
|
|
|
+ <div style="margin-bottom: 6px; background-color: #fff;">
|
|
|
+ <el-input v-model="text" class="w-50 m-2" style="width: 300px" placeholder="请输入编码/名称" clearable>
|
|
|
+ <template #prepend>编码/名称 </template>
|
|
|
+ </el-input>
|
|
|
+ <el-button type="primary" icon="Search" @click="queryItem" style="margin-left: 5px">查询</el-button>
|
|
|
+ <el-button type="primary" icon="Plus" @click="onAddItem" style="margin-left: 5px">新增</el-button>
|
|
|
+ <!-- <el-button type="primary" icon="Download" @click="exportData" style="margin-left: 5px">导出</el-button> -->
|
|
|
+ </div>
|
|
|
+ <div class="layout_display_flex_y">
|
|
|
+ <el-tabs class="el-tabs__fill" v-model="editableTabsValue" type="border-card" @tab-click="handleClick">
|
|
|
+ <el-tab-pane key="roomDept" label="病房科室字典" name="roomDept">
|
|
|
+ <div class="layout_display_flex_y">
|
|
|
+ <div class="layout_flex_1-y">
|
|
|
+ <el-table
|
|
|
+ :data="roomDeptData.slice(pageSizeRoom * (currentPageRoom - 1), pageSizeRoom * currentPageRoom)"
|
|
|
+ border style="width: 100%" height="100%" stripe highlight-current-row
|
|
|
+ class="roomDeptTable normal-size">
|
|
|
+ <el-table-column type="index" label="序号" width="80" />
|
|
|
+ <el-table-column prop="deptCode" label="科室编码" width="100">
|
|
|
+ <template v-slot="scope">
|
|
|
+ <div v-if="scope.row.isEdit">
|
|
|
+ <el-select v-model="scope.row.deptCode" placeholder="请选择科室" @change="deptChange(scope.row)">
|
|
|
+ <el-option v-for="option in unitData" :key="option.code" :label="option.code"
|
|
|
+ :value="option.code"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ <el-select v-model="scope.row.deptCode" disabled placeholder="请选择科室">
|
|
|
+ <el-option v-for="option in unitData" :key="option.code" :label="option.code"
|
|
|
+ :value="option.code"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="deptName" label="科室名称" width="240"></el-table-column>
|
|
|
+ <el-table-column prop="wardCode" label="病房编码" width="100"></el-table-column>
|
|
|
+ <el-table-column prop="wardName" label="病房名称" width="240"></el-table-column>
|
|
|
+ <el-table-column prop="openBedNum" label="开放床位数" width="100">
|
|
|
+ <template v-slot="scope">
|
|
|
+ <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.openBedNum"></el-input>
|
|
|
+ <span v-else>{{ scope.row.openBedNum }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="oweLimit" label="欠费底限" width="100">
|
|
|
+ <template v-slot="scope">
|
|
|
+ <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.oweLimit"></el-input>
|
|
|
+ <span v-else>{{ scope.row.oweLimit }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="deptPyCode" label="科室拼音码" width="140" />
|
|
|
+ <el-table-column prop="deptDCode" label="科室五笔码" width="140" />
|
|
|
+ <el-table-column prop="wardPyCode" label="病房拼音码" width="140" />
|
|
|
+ <el-table-column prop="wardDCode" label="病房五笔码" width="140" />
|
|
|
+ <el-table-column fixed="right" label="操作" min-width="180" width="180" center>
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button type="primary" size="small" v-if="!scope.row.isEdit"
|
|
|
+ @click="editRoomDept(scope.row)">编辑</el-button>
|
|
|
+ <el-button type="primary" size="small" v-if="scope.row.isEdit"
|
|
|
+ @click="updateRoomDept(scope.row)">保存</el-button>
|
|
|
+ <el-button type="primary" size="small" v-if="scope.row.isEdit"
|
|
|
+ @click="cancelRoomDept(scope.row)">取消
|
|
|
+ </el-button>
|
|
|
+ <el-button type="danger" size="small"
|
|
|
+ @click.prevent="deleteRoomDept(scope.row)">
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-pagination :current-page="currentPageRoom" :page-size="pageSizeRoom"
|
|
|
+ :page-sizes="[10, 15, 20, 25]" :total="roomDeptData.length"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper" style="margin-top: 5px"
|
|
|
+ @size-change="handleSizeChangeRoom" @current-change="handleCurrentChangeRoom">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane key="smallDept" label="小科室字典" name="smallDept">
|
|
|
+ <div class="layout_display_flex_y">
|
|
|
+ <div class="layout_flex_1-y">
|
|
|
+ <el-table
|
|
|
+ :data="smallDeptData.slice(pageSizeSmall * (currentPageSmall - 1), pageSizeSmall * currentPageSmall)"
|
|
|
+ border style="width: 100%" height="100%" stripe highlight-current-row
|
|
|
+ class="smallDeptTable normal-size">
|
|
|
+ <el-table-column type="index" label="序号" width="70" />
|
|
|
+ <el-table-column prop="deptId" label="科室序列" width="100" />
|
|
|
+ <el-table-column prop="dept" label="大科室" width="120">
|
|
|
+ <template v-slot="scope">
|
|
|
+ <div v-if="scope.row.isEdit">
|
|
|
+ <el-select v-model="scope.row.dept" placeholder="请选择大科室">
|
|
|
+ <el-option v-for="option in unitData" :key="option.code" :label="option.name"
|
|
|
+ :value="option.code"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ <el-select v-model="scope.row.dept" disabled placeholder="请选择大科室">
|
|
|
+ <el-option v-for="option in unitData" :key="option.code" :label="option.name"
|
|
|
+ :value="option.code"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="smallDept" label="小科室" width="280">
|
|
|
+ <template v-slot="scope">
|
|
|
+ <div v-if="scope.row.isEdit">
|
|
|
+ <el-select v-model="scope.row.smallDept" placeholder="请选择小科室">
|
|
|
+ <el-option v-for="option in unitData" :key="option.code" :label="option.name"
|
|
|
+ :value="option.code"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ <el-select v-model="scope.row.smallDept" disabled placeholder="请选择小科室">
|
|
|
+ <el-option v-for="option in unitData" :key="option.code" :label="option.name"
|
|
|
+ :value="option.code"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="wardPyCode" label="病房拼音码" width="140" />
|
|
|
+ <el-table-column prop="wardDCode" label="病房五笔码" width="140" />
|
|
|
+ <el-table-column prop="deptPyCode" label="科室拼音码" width="140" />
|
|
|
+ <el-table-column prop="deptDCode" label="科室五笔码" width="140" />
|
|
|
+ <el-table-column fixed="right" label="操作" min-width="180" width="180" center>
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button type="primary" size="small" v-if="!scope.row.isEdit"
|
|
|
+ @click="editSmallDept(scope.row)">编辑</el-button>
|
|
|
+ <el-button type="primary" size="small" v-if="scope.row.isEdit"
|
|
|
+ @click="updateSmallDept(scope.row)">保存</el-button>
|
|
|
+ <el-button type="primary" size="small" v-if="scope.row.isEdit"
|
|
|
+ @click="cancelSmallDept(scope.row)">取消
|
|
|
+ </el-button>
|
|
|
+ <el-button type="danger" size="small"
|
|
|
+ @click.prevent="deleteSmallDept(scope.row)">
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-pagination :current-page="currentPageSmall" :page-size="pageSizeSmall" :page-sizes="[10, 15, 20, 25]"
|
|
|
+ :total="smallDeptData.length" layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ style="margin-top: 5px" @size-change="handleSizeChangeSmall"
|
|
|
+ @current-change="handleCurrentChangeSmall">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script setup name="DeptRoomDict">
|
|
|
+import { ref, onMounted, nextTick } from 'vue'
|
|
|
+import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
+import {
|
|
|
+ selectRoomDept, saveRoomDept, delRoomDeptByCode,
|
|
|
+ selectSmallDept, saveSmallDept, delSmallDeptByCode, selectZdUnitCode,
|
|
|
+} from "@/api/dictionary/personnel/bed-dept-dict"
|
|
|
+
|
|
|
+const editableTabsValue = ref('roomDept')
|
|
|
+const msgTip = '编码(code)有变更,原始字典记录存在关联,请谨慎做更改,是否确认!!!'
|
|
|
+
|
|
|
+const pageSizeRoom = ref(20)
|
|
|
+const currentPageRoom = ref(1)
|
|
|
+const handleSizeChangeRoom = (val) => {
|
|
|
+ pageSizeRoom.value = val
|
|
|
+}
|
|
|
+const handleCurrentChangeRoom = (val) => {
|
|
|
+ currentPageRoom.value = val
|
|
|
+}
|
|
|
+
|
|
|
+const pageSizeSmall = ref(20)
|
|
|
+const currentPageSmall = ref(1)
|
|
|
+const handleSizeChangeSmall = (val) => {
|
|
|
+ pageSizeSmall.value = val
|
|
|
+}
|
|
|
+const handleCurrentChangeSmall = (val) => {
|
|
|
+ currentPageSmall.value = val
|
|
|
+}
|
|
|
+
|
|
|
+const roomDeptData = ref([])
|
|
|
+const smallDeptData = ref([])
|
|
|
+
|
|
|
+const text = ref('')
|
|
|
+onMounted(() => {
|
|
|
+ nextTick(() => {
|
|
|
+ queryUnitCode('')
|
|
|
+ queryRoomDept()
|
|
|
+ })
|
|
|
+})
|
|
|
+
|
|
|
+// 科室下拉数据
|
|
|
+const unitData = ref([])
|
|
|
+const queryUnitCode = (code) => {
|
|
|
+ selectZdUnitCode(code).then((res) => {
|
|
|
+ unitData.value = res
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// 病房科室下拉选改变
|
|
|
+const deptChange = async (row) => {
|
|
|
+ await nextTick()
|
|
|
+ let dataF = unitData.value.filter((item) => {
|
|
|
+ return item.code === row.deptCode
|
|
|
+ })
|
|
|
+ if (dataF) {
|
|
|
+ row.deptName = dataF[0].name
|
|
|
+ row.wardCode = dataF[0].code
|
|
|
+ row.wardName = dataF[0].name
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 查询病房科室字典
|
|
|
+const queryRoomDept = () => {
|
|
|
+ selectRoomDept(text.value)
|
|
|
+ .then((res) => {
|
|
|
+ res.forEach(row => {
|
|
|
+ // 是否标记
|
|
|
+ row['isEdit'] = false
|
|
|
+ // 是否新增
|
|
|
+ row['isAdd'] = false
|
|
|
+ })
|
|
|
+ roomDeptData.value = res
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ roomDeptData.value = []
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// 查询药品字典-药品分类字典
|
|
|
+const querySmallDept = () => {
|
|
|
+ selectSmallDept(text.value)
|
|
|
+ .then((res) => {
|
|
|
+ res.forEach(row => {
|
|
|
+ // 是否标记
|
|
|
+ row['isEdit'] = false
|
|
|
+ // 是否新增
|
|
|
+ row['isAdd'] = false
|
|
|
+ })
|
|
|
+ smallDeptData.value = res
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ smallDeptData.value = []
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// 查询
|
|
|
+const queryItem = () => {
|
|
|
+ if (editableTabsValue.value === 'roomDept') {
|
|
|
+ queryRoomDept()
|
|
|
+ } else if (editableTabsValue.value === 'smallDept') {
|
|
|
+ querySmallDept()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 新增行
|
|
|
+const onAddItem = () => {
|
|
|
+ if (editableTabsValue.value === 'roomDept') {
|
|
|
+ let count
|
|
|
+ if (roomDeptData.value.length % pageSizeRoom.value === 0) {
|
|
|
+ count = Math.ceil(roomDeptData.value.length / pageSizeRoom.value) + 1
|
|
|
+ } else {
|
|
|
+ count = Math.ceil(roomDeptData.value.length / pageSizeRoom.value)
|
|
|
+ }
|
|
|
+ currentPageRoom.value = count
|
|
|
+ roomDeptData.value.push({
|
|
|
+ deptCode: '',
|
|
|
+ deptName: '',
|
|
|
+ wardCode: '',
|
|
|
+ wardName: '',
|
|
|
+ deptPyCode: '',
|
|
|
+ deptDCode: '',
|
|
|
+ wardPyCode: '',
|
|
|
+ wardDCode: '',
|
|
|
+ openBedNum: 0,
|
|
|
+ oweLimit: 0.00,
|
|
|
+ isEdit: true,
|
|
|
+ isAdd: true,
|
|
|
+ })
|
|
|
+ const el = document.querySelector('.roomDeptTable .el-scrollbar__wrap')
|
|
|
+ const el2 = document.querySelector('.roomDeptTable .el-table__body tbody')
|
|
|
+ setTimeout(() => {
|
|
|
+ const height = el2.clientHeight - el.clientHeight
|
|
|
+ if (height > 0) {
|
|
|
+ el.scrollTop = height
|
|
|
+ }
|
|
|
+ }, 100)
|
|
|
+ } else if (editableTabsValue.value === 'smallDept') {
|
|
|
+ let count
|
|
|
+ if (smallDeptData.value.length % pageSizeSmall.value === 0) {
|
|
|
+ count = Math.ceil(smallDeptData.value.length / pageSizeSmall.value) + 1
|
|
|
+ } else {
|
|
|
+ count = Math.ceil(smallDeptData.value.length / pageSizeSmall.value)
|
|
|
+ }
|
|
|
+ currentPageSmall.value = count
|
|
|
+ smallDeptData.value.push({
|
|
|
+ dept: '',
|
|
|
+ smallDept: '',
|
|
|
+ isEdit: true,
|
|
|
+ isAdd: true,
|
|
|
+ })
|
|
|
+ const el = document.querySelector('.smallDeptTable .el-scrollbar__wrap')
|
|
|
+ const el2 = document.querySelector('.smallDeptTable .el-table__body tbody')
|
|
|
+ setTimeout(() => {
|
|
|
+ const height = el2.clientHeight - el.clientHeight
|
|
|
+ if (height > 0) {
|
|
|
+ el.scrollTop = height
|
|
|
+ }
|
|
|
+ }, 100)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 病房科室字典增删改存开始
|
|
|
+// 编辑
|
|
|
+const editRoomDept = (row) => {
|
|
|
+ // 备份原始数据
|
|
|
+ row['oldRow'] = JSON.parse(JSON.stringify(row))
|
|
|
+ row.isEdit = true
|
|
|
+}
|
|
|
+// 取消
|
|
|
+const cancelRoomDept = (row) => {
|
|
|
+ // 如果是新增的数据
|
|
|
+ if (row.isAdd) {
|
|
|
+ roomDeptData.value.splice(roomDeptData.value.length - 1, 1)
|
|
|
+ } else {
|
|
|
+ // 不是新增的数据 还原数据
|
|
|
+ for (const i in row.oldRow) {
|
|
|
+ row[i] = row.oldRow[i]
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+// 保存
|
|
|
+const updateRoomDept = (row) => {
|
|
|
+ if (!row.wardCode || !row.deptCode) {
|
|
|
+ ElMessage({
|
|
|
+ type: "warning",
|
|
|
+ message: "病房编码或科室编码不存在,请检查!",
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (row.isAdd) {
|
|
|
+ let fe = 0
|
|
|
+ for (let num in roomDeptData.value) {
|
|
|
+ if (roomDeptData.value[num].wardCode === row.wardCode && roomDeptData.value[num].deptCode === row.deptCode) {
|
|
|
+ fe++
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (fe === 2) {
|
|
|
+ ElMessage({
|
|
|
+ type: "warning",
|
|
|
+ message: "存在重复的病房科室,请核对!",
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ callSaveRoomDept(row, null, null)
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ let oldWardCode = row.oldRow.wardCode
|
|
|
+ let oldDeptCode = row.oldRow.deptCode
|
|
|
+ if (oldWardCode !== row.wardCode && oldDeptCode !== row.deptCode) {
|
|
|
+ ElMessageBox.confirm(msgTip, {
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ type: 'warning',
|
|
|
+ distinguishCancelAndClose: true,
|
|
|
+ dangerouslyUseHTMLString: true
|
|
|
+ }).then(() => {
|
|
|
+ callSaveRoomDept(row, oldWardCode, oldDeptCode)
|
|
|
+ }).catch((action) => {
|
|
|
+ if (action === 'cancel') {
|
|
|
+ queryRoomDept()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ callSaveRoomDept(row, oldWardCode, oldDeptCode)
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const callSaveRoomDept = (row, oldWardCode, oldDeptCode) => {
|
|
|
+ let title = '请确认是否保存<span style="color:#d12020;">' + row.wardName + '</span>?'
|
|
|
+ ElMessageBox.confirm(title, {
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ type: 'warning',
|
|
|
+ distinguishCancelAndClose: true,
|
|
|
+ dangerouslyUseHTMLString: true
|
|
|
+ }).then(() => {
|
|
|
+ saveRoomDept(row).then((res) => {
|
|
|
+ ElMessage({
|
|
|
+ type: "success",
|
|
|
+ message: res.cg,
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ if (oldWardCode !== null && oldDeptCode !== null && oldWardCode !== row.wardCode && oldDeptCode !== row.deptCode) {
|
|
|
+ // 删除原始数据
|
|
|
+ delRoomDeptByCode(oldWardCode, oldDeptCode).then((res) => {
|
|
|
+ queryRoomDept()
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ queryRoomDept()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch((action) => {
|
|
|
+ if (action === 'cancel') {
|
|
|
+ queryRoomDept()
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const deleteRoomDept = (row) => {
|
|
|
+ let title = '请确认是否删除<span style="color:#d12020;">' + row.wardName + '</span>?'
|
|
|
+ ElMessageBox.confirm(title, {
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ type: 'warning',
|
|
|
+ distinguishCancelAndClose: true,
|
|
|
+ dangerouslyUseHTMLString: true
|
|
|
+ }).then(() => {
|
|
|
+ delRoomDeptByCode(row.wardCode, row.deptCode).then((res) => {
|
|
|
+ ElMessage({
|
|
|
+ type: "success",
|
|
|
+ message: res.cg,
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ queryRoomDept()
|
|
|
+ })
|
|
|
+ }).catch((action) => {
|
|
|
+ if (action === 'cancel') {
|
|
|
+ queryRoomDept()
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+// 病房科室字典增删改存结束
|
|
|
+
|
|
|
+// 药品字典-药品分类字典增删改存开始
|
|
|
+// 编辑
|
|
|
+const editSmallDept = (row) => {
|
|
|
+ // 备份原始数据
|
|
|
+ row['oldRow'] = JSON.parse(JSON.stringify(row))
|
|
|
+ row.isEdit = true
|
|
|
+}
|
|
|
+// 取消
|
|
|
+const cancelSmallDept = (row) => {
|
|
|
+ // 如果是新增的数据
|
|
|
+ if (row.isAdd) {
|
|
|
+ smallDeptData.value.splice(smallDeptData.value.length - 1, 1)
|
|
|
+ } else {
|
|
|
+ // 不是新增的数据 还原数据
|
|
|
+ for (const i in row.oldRow) {
|
|
|
+ row[i] = row.oldRow[i]
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+// 保存
|
|
|
+const updateSmallDept = (row) => {
|
|
|
+ if (!row.dept || !row.smallDept) {
|
|
|
+ ElMessage({
|
|
|
+ type: "warning",
|
|
|
+ message: "大科室编码或小科室编码不存在,请检查!",
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (row.isAdd) {
|
|
|
+ callSaveSmallDept(row, null)
|
|
|
+ } else {
|
|
|
+ let oldDeptId = row.oldRow.deptId
|
|
|
+ callSaveSmallDept(row, oldDeptId)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const callSaveSmallDept = (row, oldDeptId) => {
|
|
|
+ let title = '请确认是否保存<span style="color:#d12020;">' + row.smallDept + '</span>?'
|
|
|
+ ElMessageBox.confirm(title, {
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ type: 'warning',
|
|
|
+ distinguishCancelAndClose: true,
|
|
|
+ dangerouslyUseHTMLString: true
|
|
|
+ }).then(() => {
|
|
|
+ saveSmallDept(row).then((res) => {
|
|
|
+ ElMessage({
|
|
|
+ type: "success",
|
|
|
+ message: res.cg,
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ if (oldDeptId !== null && oldDeptId !== row.deptId) {
|
|
|
+ // 删除原始数据
|
|
|
+ delSmallDeptByCode(oldDeptId).then((res) => {
|
|
|
+ querySmallDept()
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ querySmallDept()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch((action) => {
|
|
|
+ if (action === 'cancel') {
|
|
|
+ querySmallDept()
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const deleteSmallDept = (row) => {
|
|
|
+ let title = '请确认是否删除<span style="color:#d12020;">' + row.smallDept + '</span>?'
|
|
|
+ ElMessageBox.confirm(title, {
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ type: 'warning',
|
|
|
+ distinguishCancelAndClose: true,
|
|
|
+ dangerouslyUseHTMLString: true
|
|
|
+ }).then(() => {
|
|
|
+ delSmallDeptByCode(row.deptId).then((res) => {
|
|
|
+ ElMessage({
|
|
|
+ type: "success",
|
|
|
+ message: res.cg,
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ querySmallDept()
|
|
|
+ })
|
|
|
+ }).catch((action) => {
|
|
|
+ if (action === 'cancel') {
|
|
|
+ querySmallDept()
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+// 药品字典-药品分类字典增删改存结束
|
|
|
+
|
|
|
+const exportData = () => {
|
|
|
+ alert("功能建设中。。。")
|
|
|
+}
|
|
|
+
|
|
|
+const handleClick = (tab, event) => {
|
|
|
+ // 查询哪个tab页面
|
|
|
+ editableTabsValue.value = tab.props.name
|
|
|
+ if (editableTabsValue.value === 'roomDept') {
|
|
|
+ queryRoomDept()
|
|
|
+ currentPageRoom.value = 1
|
|
|
+ } else if (editableTabsValue.value === 'smallDept') {
|
|
|
+ querySmallDept()
|
|
|
+ currentPageSmall.value = 1
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+:deep(.el-dialog__body) {
|
|
|
+ padding: 0 16px;
|
|
|
+ height: calc(100% - 25px);
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.el-tabs) {
|
|
|
+ height: calc(100% - 27px);
|
|
|
+
|
|
|
+ .el-tabs__content {
|
|
|
+ padding: 5px;
|
|
|
+ height: calc(100% - 27px);
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-tab-pane {
|
|
|
+ height: calc(100% - 27px);
|
|
|
+ overflow: auto;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-table__inner-wrapper {
|
|
|
+ height: calc(100% - 10px) !important;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.el-table .warning-row) {
|
|
|
+ --el-table-tr-bg-color: #dd7694;
|
|
|
+}
|
|
|
+</style>
|