|
@@ -3,6 +3,7 @@
|
|
|
<template #header>
|
|
|
<el-input v-model="text" class="w-50 m-2" style="width: 160px" placeholder="请输入关键字" clearable />
|
|
|
<el-button type="primary" icon="Search" @click="qeryDeptDict" style="margin-left: 5px">查询</el-button>
|
|
|
+ <el-button type="primary" icon="Plus" @click="addDeptInfo" style="margin-left: 5px">新增科室</el-button>
|
|
|
<!-- <el-button type="primary" icon="Download" @click="exportData" style="margin-left: 5px">导出</el-button> -->
|
|
|
</template>
|
|
|
<template #main>
|
|
@@ -11,7 +12,7 @@
|
|
|
<el-table-column type="index" label="序号" width="50" fixed />
|
|
|
<el-table-column prop="delFlag" label="停用" width="50" fixed>
|
|
|
<template #default="scope">
|
|
|
- <span v-if="scope.row.delFlag === '1'" style="color:#d12920;">停用</span>
|
|
|
+ <span v-if="scope.row.delFlag === '1'" style="color:#d12020;">停用</span>
|
|
|
<span v-else></span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -24,13 +25,13 @@
|
|
|
<el-table-column prop="mzFlag" label="门诊开放">
|
|
|
<template #default="scope">
|
|
|
<span v-if="scope.row.mzFlag === '1'" style="color:#007175;">是</span>
|
|
|
- <span v-else></span>
|
|
|
+ <span v-else style="color:#d12020;">否</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="yjFlag" label="医技上线">
|
|
|
<template #default="scope">
|
|
|
<span v-if="scope.row.yjFlag === '1'" style="color:#007175;">是</span>
|
|
|
- <span v-else></span>
|
|
|
+ <span v-else style="color:#d12020;">否</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="xnhDeptCode" label="新农合科室编码" width="100" />
|
|
@@ -39,25 +40,30 @@
|
|
|
<el-table-column prop="ghChargeFlag" label="收取挂号费">
|
|
|
<template #default="scope">
|
|
|
<span v-if="scope.row.ghChargeFlag === '1'" style="color:#007175;">是</span>
|
|
|
- <span v-else></span>
|
|
|
+ <span v-else style="color:#d12020;">否</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="supplyFlag" label="用药方式执行科室" width="120">
|
|
|
<template #default="scope">
|
|
|
<span v-if="scope.row.supplyFlag === '1'" style="color:#007175;">是</span>
|
|
|
- <span v-else></span>
|
|
|
+ <span v-else style="color:#d12020;">否</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="ghjzFlag" label="门诊挂号就诊" width="100">
|
|
|
<template #default="scope">
|
|
|
<span v-if="scope.row.ghjzFlag === '1'" style="color:#007175;">是</span>
|
|
|
- <span v-else></span>
|
|
|
+ <span v-else style="color:#d12020;">否</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="officePos" label="就诊地点" width="280" />
|
|
|
- <el-table-column label="操作" fixed="right" width="150" align="center" header-align="center">
|
|
|
+ <el-table-column label="操作" fixed="right" width="200" align="center" header-align="center">
|
|
|
<template #default="scope">
|
|
|
<el-button type="primary" size="small" @click="handleEdit(scope.row)">编辑</el-button>
|
|
|
+ <el-button :type="scope.row.delFlag === '1' ? 'primary' : 'warning'" size="small"
|
|
|
+ @click="handleStop(scope.row)">
|
|
|
+ <span v-if="scope.row.delFlag === '1'">启用</span>
|
|
|
+ <span v-else>停用</span>
|
|
|
+ </el-button>
|
|
|
<el-button type="danger" size="small" @click="handleDelete(scope.row)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -68,8 +74,9 @@
|
|
|
</el-pagination>
|
|
|
</template>
|
|
|
</page-layer>
|
|
|
- <el-dialog v-model="showDeptEdit" :close-on-click-modal="false" :title="deptTitle" width="70%">
|
|
|
- <DeptInformation :deptDetail="deptDetail" />
|
|
|
+ <el-dialog v-model="showDeptEdit" :close-on-click-modal="false" :close-on-press-escape="false" :title="deptTitle"
|
|
|
+ width="70%" destroy-on-close>
|
|
|
+ <DeptInformation :deptDetail="deptDetail" @closeDeptEditFor="closeDeptEditAdd" />
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
<script setup name="DeptDict">
|
|
@@ -77,7 +84,7 @@ import { ref, reactive, onMounted, nextTick } from 'vue'
|
|
|
import PageLayer from '@/layout/PageLayer.vue'
|
|
|
import store from '@/store'
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
-import { selectDeptDict, selectDeptDictByCode } from '@/api/dictionary/personnel/deptDict.js'
|
|
|
+import { selectDeptDict, selectDeptDictByCode, updateDeptStopOrUsed, delDeptDictByCode } from '@/api/dictionary/personnel/deptDict.js'
|
|
|
import DeptInformation from '@/views/dictionary/personnel/DeptInformation.vue'
|
|
|
|
|
|
const windowSize = store.state.app.windowSize;
|
|
@@ -110,6 +117,12 @@ const qeryDeptDict = () => {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+// 新增科室字典
|
|
|
+const addDeptInfo = () => {
|
|
|
+ deptDetail.value = {}
|
|
|
+ showDeptEdit.value = true
|
|
|
+}
|
|
|
+
|
|
|
const handleEdit = (row) => {
|
|
|
selectDeptDictByCode(row.code).then((res) => {
|
|
|
deptTitle.value = '编辑科室信息'
|
|
@@ -119,15 +132,71 @@ const handleEdit = (row) => {
|
|
|
}
|
|
|
|
|
|
const handleDelete = (row) => {
|
|
|
- console.log(row);
|
|
|
- ElMessage({
|
|
|
- type: "warning",
|
|
|
- message: "功能更新中,请等待。。。",
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- return
|
|
|
+ let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
|
|
|
+ ElMessageBox.confirm(title, {
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ type: 'warning',
|
|
|
+ distinguishCancelAndClose: true,
|
|
|
+ dangerouslyUseHTMLString: true
|
|
|
+ }).then(() => {
|
|
|
+ delDeptDictByCode(row.code).then((res) => {
|
|
|
+ ElMessage({
|
|
|
+ type: "warning",
|
|
|
+ message: res.cg,
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ qeryDeptDict()
|
|
|
+ return
|
|
|
+ })
|
|
|
+ }).catch((action) => {
|
|
|
+ if (action === 'cancel') {
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+const handleStop = (row) => {
|
|
|
+ let delFlag
|
|
|
+ let title
|
|
|
+ if ('1' === row.delFlag) {
|
|
|
+ delFlag = '0'
|
|
|
+ title = '请确认是否启用<span style="color:#d12020;">' + row.name + '</span>?'
|
|
|
+ } else {
|
|
|
+ delFlag = '1'
|
|
|
+ title = '请确认是否停用<span style="color:#d12020;">' + row.name + '</span>?'
|
|
|
+ }
|
|
|
+
|
|
|
+ ElMessageBox.confirm(title, {
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ type: 'warning',
|
|
|
+ distinguishCancelAndClose: true,
|
|
|
+ dangerouslyUseHTMLString: true
|
|
|
+ }).then(() => {
|
|
|
+ updateDeptStopOrUsed(row.code, delFlag).then((res) => {
|
|
|
+ ElMessage({
|
|
|
+ type: "warning",
|
|
|
+ message: res.cg,
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ qeryDeptDict()
|
|
|
+ return
|
|
|
+ })
|
|
|
+ }).catch((action) => {
|
|
|
+ if (action === 'cancel') {
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const closeDeptEditAdd = () => {
|
|
|
+ showDeptEdit.value = false
|
|
|
|
|
|
+ qeryDeptDict()
|
|
|
}
|
|
|
|
|
|
</script>
|