版本更新
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
<template>
|
||||
</template>
|
||||
@@ -0,0 +1,2 @@
|
||||
<template>
|
||||
</template>
|
||||
2
openhis-ui-vue3/src/views/basicmanage/bedspace/index.vue
Normal file
2
openhis-ui-vue3/src/views/basicmanage/bedspace/index.vue
Normal file
@@ -0,0 +1,2 @@
|
||||
<template>
|
||||
</template>
|
||||
@@ -0,0 +1,52 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function getList(queryParams) {
|
||||
return request({
|
||||
url: '/base-data-manage/body-structure/body',
|
||||
method: 'get',
|
||||
param: queryParams
|
||||
})
|
||||
}
|
||||
|
||||
export function addBodyStructure(data) {
|
||||
return request({
|
||||
url: '/base-data-manage/body-structure/body',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateBodyStructure(data) {
|
||||
return request({
|
||||
url: '/base-data-manage/body-structure/body',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteBodyStructure(ids) {
|
||||
return request({
|
||||
url: '/base-data-manage/body-structure/body?ids=' + ids ,
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
|
||||
export function getBodyStructureDetail(id) {
|
||||
return request({
|
||||
url: '/base-data-manage/body-structure/body?id=' + id,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
export function disableBodyStructure(id) {
|
||||
return request({
|
||||
url: '/base-data-manage/body-structure/body-inactive?id=' + id,
|
||||
method: 'put',
|
||||
})
|
||||
}
|
||||
|
||||
export function enableBodyStructure(id) {
|
||||
return request({
|
||||
url: '/base-data-manage/body-structure/body-active?id=' + id,
|
||||
method: 'put',
|
||||
})
|
||||
}
|
||||
236
openhis-ui-vue3/src/views/basicmanage/bodyStructure/index.vue
Normal file
236
openhis-ui-vue3/src/views/basicmanage/bodyStructure/index.vue
Normal file
@@ -0,0 +1,236 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd"> 新增 </el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-tooltip
|
||||
:content="selectRowIds.length == 0 ? '至少选择一条数据' : ''"
|
||||
placement="top"
|
||||
:disabled="selectRowIds.length != 0"
|
||||
>
|
||||
<el-button
|
||||
type=""
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="selectRowIds.length == 0"
|
||||
@click="handleDelete"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-tooltip>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="" plain icon="Download" @click="handleExport"> 导出 </el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="" plain icon="Refresh" @click="getPageList">刷新</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
<el-table
|
||||
ref="bodyStructureTableRef"
|
||||
v-loading="loading"
|
||||
:data="bodyStructure"
|
||||
row-key="id"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="部位名称" align="left" prop="name" />
|
||||
<el-table-column label="拼音" align="left" prop="pyStr" />
|
||||
<el-table-column label="五笔拼音" align="left" prop="wbStr" />
|
||||
<el-table-column label="状态" align="center" prop="statusEnum_enumText" />
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handelEdit(scope.row)">编辑</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="handleDisabled(scope.row.id)"
|
||||
v-if="scope.row.statusEnum == '2'"
|
||||
>停用</el-button
|
||||
>
|
||||
<el-button link type="primary" @click="handelEnable(scope.row.id)" v-else>启用</el-button>
|
||||
<el-button link type="primary" @click="handleAddInferior(scope.row)">
|
||||
添加下级
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
<!-- 添加或修改参数配置对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="600px" @close="cancel" append-to-body>
|
||||
<el-form ref="bodyStructureRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="id" prop="id" v-show="false">
|
||||
<el-input v-model="form.id" placeholder="请输入部位编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部位编号" prop="busNo" v-show="false">
|
||||
<el-input v-model="form.busNo" placeholder="请输入部位编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部位名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入部位名称" />
|
||||
</el-form-item>
|
||||
|
||||
<el-col>
|
||||
<el-form-item label="上级部位" prop="busNoParent">
|
||||
<el-tree-select
|
||||
clearable
|
||||
style="width: 100%"
|
||||
v-model="form.busNoParent"
|
||||
:data="bodyStructure"
|
||||
:props="{ value: 'busNo', label: 'name', children: 'children' }"
|
||||
value-key="id"
|
||||
check-strictly
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="BodyStructure">
|
||||
import {
|
||||
getList,
|
||||
deleteBodyStructure,
|
||||
addBodyStructure,
|
||||
updateBodyStructure,
|
||||
disableBodyStructure,
|
||||
enableBodyStructure,
|
||||
} from './components/api';
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const loading = ref(true);
|
||||
const bodyStructure = ref([]);
|
||||
const queryParams = ref({});
|
||||
const open = ref(false);
|
||||
const form = ref({
|
||||
id: undefined,
|
||||
busNo: undefined,
|
||||
name: undefined,
|
||||
statusEnum: undefined,
|
||||
busNoParent: undefined,
|
||||
});
|
||||
const bodyStructureTableRef = ref();
|
||||
const bodyStructureRef = ref();
|
||||
const selectRowIds = ref([]);
|
||||
const total = ref(0);
|
||||
const title = ref('');
|
||||
const rules = ref({
|
||||
busNo: [{ required: false, message: '请输入部位编号', trigger: 'input' }],
|
||||
name: [
|
||||
{ required: true, message: '请输入部位名称', trigger: 'change' },
|
||||
{ min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'change' },
|
||||
],
|
||||
});
|
||||
|
||||
getPageList();
|
||||
|
||||
function reset() {
|
||||
form.value.id = undefined;
|
||||
bodyStructureRef.value.resetFields();
|
||||
}
|
||||
|
||||
function getPageList() {
|
||||
loading.value = false;
|
||||
getList(queryParams.value).then((res) => {
|
||||
bodyStructure.value = res.data.records;
|
||||
total.value = res.data.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
title.value = '添加身体部位';
|
||||
open.value = true;
|
||||
reset();
|
||||
console.log(form.value);
|
||||
}
|
||||
|
||||
function handelEdit(row) {
|
||||
console.log(row.busNo);
|
||||
|
||||
title.value = '编辑部位';
|
||||
open.value = true;
|
||||
setTimeout(() => {
|
||||
form.value.id = row.id;
|
||||
form.value.busNo = row.busNo;
|
||||
form.value.name = row.name;
|
||||
form.value.statusEnum = row.statusEnum;
|
||||
form.value.busNoParent = row.busNo.split('.').length > 1 ? row.busNo.split('.')[0] : undefined;
|
||||
}, 50);
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
console.log(form.value);
|
||||
}
|
||||
|
||||
// 新增/编辑
|
||||
function submitForm() {
|
||||
proxy.$refs['bodyStructureRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.id == undefined) {
|
||||
if (form.value.busNoParent) {
|
||||
form.value.busNo = form.value.busNoParent;
|
||||
}
|
||||
addBodyStructure(form.value).then((res) => {
|
||||
proxy.$modal.msgSuccess('操作成功');
|
||||
open.value = false;
|
||||
getPageList();
|
||||
});
|
||||
} else {
|
||||
updateBodyStructure(form.value).then((res) => {
|
||||
proxy.$modal.msgSuccess('操作成功');
|
||||
open.value = false;
|
||||
getPageList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 添加下级
|
||||
function handleAddInferior(row) {
|
||||
title.value = '添加下级';
|
||||
open.value = true;
|
||||
form.value.busNoParent = row.busNo;
|
||||
}
|
||||
|
||||
// 删除
|
||||
function handleDelete() {
|
||||
loading.value = true;
|
||||
deleteBodyStructure(selectRowIds.value.join(',')).then((res) => {
|
||||
proxy.$modal.msgSuccess('操作成功');
|
||||
loading.value = false;
|
||||
getPageList();
|
||||
});
|
||||
}
|
||||
// 停用
|
||||
function handleDisabled(id) {
|
||||
disableBodyStructure(id).then((res) => {
|
||||
proxy.$modal.msgSuccess('操作成功');
|
||||
getPageList();
|
||||
});
|
||||
}
|
||||
|
||||
// 启用
|
||||
function handelEnable(id) {
|
||||
enableBodyStructure(id).then((res) => {
|
||||
proxy.$modal.msgSuccess('操作成功');
|
||||
getPageList();
|
||||
});
|
||||
}
|
||||
|
||||
function handleSelectionChange() {
|
||||
selectRowIds.value = bodyStructureTableRef.value.getSelectionRows().map((item) => item.id);
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,2 @@
|
||||
<template>
|
||||
</template>
|
||||
@@ -0,0 +1,2 @@
|
||||
<template>
|
||||
</template>
|
||||
@@ -0,0 +1,66 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-table ref="medicineRef" height="400" :data="activityList" @cell-click="clickRow" border>
|
||||
<el-table-column label="项目名称" align="center" prop="name" width="300" />
|
||||
<el-table-column label="类型" align="center" prop="typeEnum_enumText" />
|
||||
<el-table-column label="价格" align="right" prop="retailPrice">
|
||||
<template #default="scope">
|
||||
{{ scope.row.retailPrice.toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="说明" align="center" prop="descriptionText" />
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getActivityList } from './api';
|
||||
import { watch } from 'vue';
|
||||
import { throttle } from 'lodash-es';
|
||||
|
||||
const props = defineProps({
|
||||
searchKey: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(['selectRow']);
|
||||
const queryParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 50,
|
||||
itemType: props.itemType,
|
||||
});
|
||||
const activityList = ref([]);
|
||||
|
||||
// 节流函数
|
||||
const throttledGetList = throttle(
|
||||
() => {
|
||||
getList();
|
||||
},
|
||||
300,
|
||||
{ leading: true, trailing: true }
|
||||
);
|
||||
|
||||
watch(
|
||||
() => props,
|
||||
(newValue) => {
|
||||
queryParams.value.searchKey = newValue.searchKey;
|
||||
throttledGetList();
|
||||
},
|
||||
{ immdiate: true, deep: true }
|
||||
);
|
||||
|
||||
getList();
|
||||
function getList() {
|
||||
getActivityList(queryParams.value).then((res) => {
|
||||
activityList.value = res.data.records;
|
||||
});
|
||||
}
|
||||
|
||||
function clickRow(row) {
|
||||
emit('selectRow', row);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
@@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询诊疗项目列表
|
||||
export function getActivityList(queryParams) {
|
||||
return request({
|
||||
url: '/personalization/activity-device/activity-page',
|
||||
method: 'get',
|
||||
params: queryParams
|
||||
})
|
||||
}
|
||||
|
||||
// 查询诊疗用法绑定耗材项目列表
|
||||
export function getBindList(queryParams) {
|
||||
return request({
|
||||
url: '/personalization/activity-device/activity-device',
|
||||
method: 'get',
|
||||
params: queryParams
|
||||
})
|
||||
}
|
||||
|
||||
// 获取耗材列表
|
||||
export function getDeviceList(queryParams) {
|
||||
return request({
|
||||
url: '/personalization/activity-device/device-page',
|
||||
method: 'get',
|
||||
params: queryParams
|
||||
})
|
||||
}
|
||||
|
||||
// 获取耗材列表
|
||||
export function init() {
|
||||
return request({
|
||||
url: '/personalization/activity-device/init',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
// 绑定用法/诊疗
|
||||
export function bind(data) {
|
||||
return request({
|
||||
url: '/personalization/activity-device/activity-device',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除绑定
|
||||
export function deleteBind(bindId) {
|
||||
return request({
|
||||
url: '/personalization/activity-device/activity-device?bindId=' + bindId,
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 查询服务管理列表
|
||||
export function getRegistrationfeeList(query) {
|
||||
return request({
|
||||
url: '/basic-service/healthcare/healthcare-service-page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,313 @@
|
||||
<template>
|
||||
<div style="width: 100%">
|
||||
<div class="mb8">
|
||||
<el-button type="primary" plain @click="handleAddPrescription()" :disabled="buttonDisabled">
|
||||
添加绑定项目
|
||||
</el-button>
|
||||
</div>
|
||||
<el-form :model="form" :rules="rules" ref="formRef">
|
||||
<el-table
|
||||
ref="prescriptionRef"
|
||||
:data="form.consumablesList"
|
||||
row-key="patientId"
|
||||
border
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="props.loading"
|
||||
>
|
||||
<el-table-column label="项目类型" align="center" prop="type" width="150">
|
||||
<template #default="scope">
|
||||
<span v-if="!scope.row.isEdit">{{ scope.row.type_dictText }}</span>
|
||||
<el-form-item v-else :prop="`consumablesList.${scope.$index}.type`" :rules="rules.type">
|
||||
<el-select v-model="scope.row.type" placeholder="" @change="handleTypeChange">
|
||||
<el-option v-if="props.tab == 1 || props.tab == 3" label="诊疗" value="1" />
|
||||
<el-option v-if="props.tab != 3" label="耗材" value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目名" align="center" prop="name">
|
||||
<template #default="scope">
|
||||
<span v-if="!scope.row.isEdit">{{ scope.row.name }}</span>
|
||||
<el-form-item v-else :prop="`consumablesList.${scope.$index}.name`" :rules="rules.name">
|
||||
<PopoverList @search="handleSearch" :width="800" :modelValue="scope.row.name">
|
||||
<template #popover-content="{}">
|
||||
<DeviceList
|
||||
v-if="scope.row.type == '2'"
|
||||
@selectRow="(row) => selectRow(row, scope.$index)"
|
||||
:searchKey="searchKey"
|
||||
/>
|
||||
<ActivityList
|
||||
v-else
|
||||
@selectRow="(row) => selectRow(row, scope.$index)"
|
||||
:searchKey="searchKey"
|
||||
/>
|
||||
</template>
|
||||
</PopoverList>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="绑定数量" align="center" prop="quantity" width="250">
|
||||
<template #default="scope">
|
||||
<span v-if="!scope.row.isEdit">{{ scope.row.quantity }}</span>
|
||||
<el-form-item
|
||||
v-else
|
||||
:prop="`consumablesList.${scope.$index}.quantity`"
|
||||
:rules="rules.quantity"
|
||||
>
|
||||
<el-input v-model="scope.row.quantity" placeholder="" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="使用范围" align="center" prop="rangeCode" width="150">
|
||||
<template #default="scope">
|
||||
<span v-if="!scope.row.isEdit">{{ scope.row.rangeCode_dictText }}</span>
|
||||
<el-form-item
|
||||
v-else
|
||||
:prop="`consumablesList.${scope.$index}.rangeCode`"
|
||||
:rules="rules.rangeCode"
|
||||
>
|
||||
<el-input v-model="scope.row.rangeCode" placeholder="" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="范围" align="center" prop="rangeCode" width="250">
|
||||
<template #default="scope">
|
||||
<span v-if="!scope.row.isEdit">{{ scope.row.rangeCode_dictText }}</span>
|
||||
<el-form-item
|
||||
v-else
|
||||
:prop="`consumablesList.${scope.$index}.rangeCode`"
|
||||
:rules="rules.statusEnum"
|
||||
>
|
||||
<el-select v-model="scope.row.rangeCode" placeholder="">
|
||||
<el-option
|
||||
v-for="dict in use_range"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="启用状态" align="center" prop="statusEnum" width="250">
|
||||
<template #default="scope">
|
||||
<span v-if="!scope.row.isEdit">{{ scope.row.statusEnum_dictText }}</span>
|
||||
<el-form-item
|
||||
v-else
|
||||
:prop="`consumablesList.${scope.$index}.statusEnum`"
|
||||
:rules="rules.statusEnum"
|
||||
>
|
||||
<el-select v-model="scope.row.statusEnum" placeholder="" @change="handleTypeChange">
|
||||
<el-option
|
||||
v-for="item in statusOptions"
|
||||
:key="item.value"
|
||||
:label="item.info"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" fixed="right" width="250">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-if="!scope.row.isEdit"
|
||||
link
|
||||
type="primary"
|
||||
@click="handleEdit(scope.$index)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.isEdit"
|
||||
link
|
||||
type="primary"
|
||||
@click="handleSave(scope.row, scope.$index)"
|
||||
>
|
||||
保存
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.isEdit"
|
||||
link
|
||||
type="primary"
|
||||
@click="
|
||||
() => {
|
||||
form.consumablesList[scope.$index].isEdit = false;
|
||||
isAdd = true;
|
||||
if (!scope.row.id) {
|
||||
form.consumablesList.splice(scope.$index, 1);
|
||||
}
|
||||
}
|
||||
"
|
||||
>
|
||||
取消
|
||||
</el-button>
|
||||
<el-button link type="primary" @click.stop="handleDelete(scope.row, scope.$index)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, watch } from 'vue';
|
||||
import { bind, deleteBind, init } from './api';
|
||||
import PopoverList from '@/components/OpenHis/popoverList/index.vue';
|
||||
import DeviceList from './deviceList.vue';
|
||||
import ActivityList from './activityList.vue';
|
||||
|
||||
const emit = defineEmits(['refresh']);
|
||||
const total = ref(0);
|
||||
const queryParams = ref({});
|
||||
const consumablesList = ref([]);
|
||||
const searchKey = ref('');
|
||||
const rowIndex = ref(-1);
|
||||
const isAdd = ref(true);
|
||||
const rules = ref({
|
||||
name: [{ required: true, message: '请选择耗材项', trigger: 'change' }],
|
||||
quantity: [{ required: true, message: '请输入绑定数量', trigger: 'blur' }],
|
||||
rangeCode: [{ required: true, message: '请选择使用范围', trigger: 'blur' }],
|
||||
});
|
||||
const form = reactive({
|
||||
consumablesList: [],
|
||||
});
|
||||
const statusOptions = ref([]);
|
||||
|
||||
const props = defineProps({
|
||||
bindList: {
|
||||
type: Object,
|
||||
required: false,
|
||||
},
|
||||
bindInfo: {
|
||||
type: Object,
|
||||
required: false,
|
||||
},
|
||||
tab: {
|
||||
type: String,
|
||||
required: false,
|
||||
},
|
||||
loading: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
},
|
||||
});
|
||||
const buttonDisabled = computed(() => {
|
||||
return !props.bindInfo.id;
|
||||
});
|
||||
watch(
|
||||
() => props.bindList,
|
||||
(newVal) => {
|
||||
form.consumablesList = newVal.map((item) => {
|
||||
return {
|
||||
id: item.id,
|
||||
name: item.deviceName ? item.deviceName : item.activityName,
|
||||
devActId: item.devActId,
|
||||
quantity: item.quantity,
|
||||
rangeCode: item.rangeCode,
|
||||
rangeCode_dictText: item.rangeCode_dictText,
|
||||
statusEnum: item.statusEnum,
|
||||
statusEnum_dictText: item.statusEnum_enumText,
|
||||
typeCode: item.typeCode,
|
||||
typeCode_dictText: item.typeCode_dictText,
|
||||
type: item.activityName ? '1' : '2',
|
||||
type_dictText: item.activityName ? '诊疗' : '耗材',
|
||||
};
|
||||
});
|
||||
isAdd.value = true;
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
watch(
|
||||
() => props.tab,
|
||||
() => {
|
||||
form.consumablesList = [];
|
||||
isAdd.value = true;
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const { use_range } = proxy.useDict('use_range');
|
||||
function handleAddPrescription() {
|
||||
if (!isAdd.value) {
|
||||
proxy.$modal.msgWarning('请先保存当前行');
|
||||
return;
|
||||
}
|
||||
form.consumablesList.push({
|
||||
isEdit: true,
|
||||
// type: '2',
|
||||
rangeCode: '3',
|
||||
statusEnum: 2,
|
||||
});
|
||||
isAdd.value = false;
|
||||
console.log(form.consumablesList, 234567890);
|
||||
}
|
||||
|
||||
function handleEdit(index) {
|
||||
form.consumablesList[index].isEdit = true;
|
||||
}
|
||||
|
||||
function handleSave(row, index) {
|
||||
proxy.$refs['formRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
console.log(row, 'row');
|
||||
bind({
|
||||
itemNo: props.bindInfo.id,
|
||||
devActId: row.devActId,
|
||||
typeCode: props.bindInfo.typeCode,
|
||||
rangeCode: row.rangeCode,
|
||||
quantity: row.quantity,
|
||||
statusEnum: row.statusEnum,
|
||||
id: row.id ? row.id : undefined,
|
||||
devActTable: row.type == '1' ? 'wor_activity_definition' : 'adm_device_definition',
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
proxy.$modal.msgSuccess('操作成功');
|
||||
emit('refresh');
|
||||
isAdd.value = true;
|
||||
}
|
||||
});
|
||||
form.consumablesList[index].isEdit = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function handleDelete(row, index) {
|
||||
if (row.id) {
|
||||
proxy.$modal.confirm('确认删除当前绑定项目吗').then(() => {
|
||||
deleteBind(row.id).then((res) => {
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess('删除成功');
|
||||
emit('refresh');
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
form.consumablesList.splice(index, 1);
|
||||
isAdd.value = true;
|
||||
}
|
||||
}
|
||||
|
||||
function initOptions() {
|
||||
init().then((res) => {
|
||||
statusOptions.value = res.data.statusOptions;
|
||||
});
|
||||
}
|
||||
|
||||
function handleSearch(value) {
|
||||
searchKey.value = value;
|
||||
}
|
||||
|
||||
initOptions();
|
||||
function selectRow(row, index) {
|
||||
form.consumablesList[index].devActId = row.id;
|
||||
form.consumablesList[index].name = row.name;
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
@@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-table ref="medicineRef" height="400" :data="deviceList" @cell-click="clickRow" border>
|
||||
<el-table-column label="项目名称" align="center" prop="name" width="200" />
|
||||
<el-table-column label="分类" align="center" prop="categoryCode_dictText" width="150" />
|
||||
<el-table-column label="种类" align="center" prop="typeCode_dictText" />
|
||||
<el-table-column label="规格" align="center" prop="size" />
|
||||
<el-table-column label="价格" align="right" prop="retailPrice">
|
||||
<template #default="scope">
|
||||
{{ scope.row.retailPrice.toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="生产厂家" align="center" prop="supplyId_dictText" />
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getDeviceList } from './api';
|
||||
import { watch } from 'vue';
|
||||
import { throttle } from 'lodash-es';
|
||||
|
||||
const props = defineProps({
|
||||
searchKey: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(['selectRow']);
|
||||
const queryParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 50,
|
||||
itemType: props.itemType,
|
||||
});
|
||||
const deviceList = ref([]);
|
||||
|
||||
// 节流函数
|
||||
const throttledGetList = throttle(
|
||||
() => {
|
||||
getList();
|
||||
},
|
||||
300,
|
||||
{ leading: true, trailing: true }
|
||||
);
|
||||
|
||||
watch(
|
||||
() => props,
|
||||
(newValue) => {
|
||||
queryParams.value.searchKey = newValue.searchKey;
|
||||
throttledGetList();
|
||||
},
|
||||
{ immdiate: true, deep: true }
|
||||
);
|
||||
|
||||
getList();
|
||||
function getList() {
|
||||
getDeviceList(queryParams.value).then((res) => {
|
||||
deviceList.value = res.data.records;
|
||||
});
|
||||
}
|
||||
|
||||
function clickRow(row) {
|
||||
emit('selectRow', row);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
@@ -0,0 +1,123 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div style="height: 780px; display: flex; justify-content: space-between">
|
||||
<el-card style="height: 100%; width: 25%">
|
||||
<el-tabs v-model="activeTab">
|
||||
<el-tab-pane label="用法" :name="1">
|
||||
<el-table
|
||||
:data="method_code"
|
||||
border
|
||||
@cell-click="clickRow"
|
||||
highlight-current-row
|
||||
max-height="650"
|
||||
>
|
||||
<el-table-column label="项目名" align="center" prop="label" />
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="诊疗" :name="2">
|
||||
<el-input
|
||||
v-model="queryParams.searchKey"
|
||||
placeholder="请输入项目名"
|
||||
clearable
|
||||
style="width: 100%; margin-bottom: 10px"
|
||||
@keyup.enter="getList"
|
||||
>
|
||||
<template #append>
|
||||
<el-button icon="Search" @click="getList" />
|
||||
</template>
|
||||
</el-input>
|
||||
<el-table
|
||||
:data="activityList"
|
||||
border
|
||||
@cell-click="clickRow"
|
||||
highlight-current-row
|
||||
max-height="650"
|
||||
>
|
||||
<el-table-column label="项目名" align="center" prop="name" />
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="号源" :name="3">
|
||||
<el-input
|
||||
v-model="queryParamsRegistration.searchKey"
|
||||
placeholder="请输入项目名"
|
||||
clearable
|
||||
style="width: 100%; margin-bottom: 10px"
|
||||
@keyup.enter="getRegistrationList"
|
||||
>
|
||||
<template #append>
|
||||
<el-button icon="Search" @click="getRegistrationList" />
|
||||
</template>
|
||||
</el-input>
|
||||
<el-table
|
||||
:data="RegistrationfeeList"
|
||||
border
|
||||
@cell-click="clickRow"
|
||||
highlight-current-row
|
||||
max-height="650"
|
||||
>
|
||||
<el-table-column label="项目名" align="center" prop="name" />
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
<el-card style="height: 100%; width: 74%">
|
||||
<ConsumablesList
|
||||
:bindList="bindList"
|
||||
:bindInfo="bindInfo"
|
||||
:tab="activeTab"
|
||||
:loading="loading"
|
||||
@refresh="clickRow(currentRow)"
|
||||
/>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { getActivityList, getBindList, getRegistrationfeeList } from './components/api.js';
|
||||
import ConsumablesList from './components/consumablesList.vue';
|
||||
|
||||
const activityList = ref([]);
|
||||
const queryParams = ref({});
|
||||
const queryParamsRegistration = ref({});
|
||||
const bindList = ref([]);
|
||||
const bindInfo = ref({});
|
||||
const activeTab = ref(1);
|
||||
const currentRow = ref({});
|
||||
const RegistrationfeeList = ref([]);
|
||||
const loading = ref(false);
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { method_code } = proxy.useDict('method_code');
|
||||
|
||||
getList();
|
||||
getRegistrationList()
|
||||
function getList() {
|
||||
// queryParams.value.typeEnum = activeTab.value;
|
||||
getActivityList(queryParams.value).then((res) => {
|
||||
activityList.value = res.data.records;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function getRegistrationList() {
|
||||
getRegistrationfeeList(queryParamsRegistration.value).then(res => {
|
||||
RegistrationfeeList.value = res.data.records;
|
||||
})
|
||||
}
|
||||
|
||||
// 点击诊疗列表 获取绑定的耗材
|
||||
function clickRow(row) {
|
||||
loading.value = true;
|
||||
currentRow.value = row;
|
||||
bindInfo.value.id = row.value ? row.value : row.id;
|
||||
bindInfo.value.typeCode = activeTab.value;
|
||||
getBindList({ itemNo: row.value ? row.value : row.id }).then((res) => {
|
||||
bindList.value = res.data.records;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
2
openhis-ui-vue3/src/views/basicmanage/contract/index.vue
Normal file
2
openhis-ui-vue3/src/views/basicmanage/contract/index.vue
Normal file
@@ -0,0 +1,2 @@
|
||||
<template>
|
||||
</template>
|
||||
2
openhis-ui-vue3/src/views/basicmanage/customer/index.vue
Normal file
2
openhis-ui-vue3/src/views/basicmanage/customer/index.vue
Normal file
@@ -0,0 +1,2 @@
|
||||
<template>
|
||||
</template>
|
||||
2
openhis-ui-vue3/src/views/basicmanage/fee/index.vue
Normal file
2
openhis-ui-vue3/src/views/basicmanage/fee/index.vue
Normal file
@@ -0,0 +1,2 @@
|
||||
<template>
|
||||
</template>
|
||||
@@ -0,0 +1,223 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="添加频次详情"
|
||||
v-model="dialogVisible"
|
||||
width="520px"
|
||||
top="8vh"
|
||||
:close-on-click-modal="false"
|
||||
@close="resetForm"
|
||||
>
|
||||
<!-- 表单区域 -->
|
||||
<el-form
|
||||
:model="formData"
|
||||
ref="form"
|
||||
label-width="120px"
|
||||
class="freq-form"
|
||||
>
|
||||
<!-- 字典代码 -->
|
||||
<el-form-item label="字典代码">
|
||||
<el-input
|
||||
v-model="formData.rateCode"
|
||||
readonly
|
||||
class="input-readonly"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 分割线 -->
|
||||
<el-divider content-position="left">每日执行</el-divider>
|
||||
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="次数">
|
||||
<el-input-number
|
||||
v-model="formData.dayCount"
|
||||
:min="1"
|
||||
:max="99"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="间隔(天)">
|
||||
<el-input-number
|
||||
v-model="formData.dayInterval"
|
||||
:min="0"
|
||||
:max="99"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="时间点">
|
||||
<el-select v-model="formData.dayTimes" multiple placeholder="选择时间点">
|
||||
<el-option
|
||||
v-for="time in timeOptions"
|
||||
:key="time"
|
||||
:value="time"
|
||||
:label="time"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- <!– 分割线 –>-->
|
||||
<!-- <el-divider content-position="left">每周执行</el-divider>-->
|
||||
|
||||
<!-- <el-row :gutter="16">-->
|
||||
<!-- <el-col :span="12">-->
|
||||
<!-- <el-form-item label="是否启用">-->
|
||||
<!-- <el-switch-->
|
||||
<!-- v-model="formData.weekCycleFlag"-->
|
||||
<!-- :active-value="1"-->
|
||||
<!-- :inactive-value="0"-->
|
||||
<!-- active-text="是"-->
|
||||
<!-- inactive-text="否"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="12">-->
|
||||
<!-- <el-form-item label="间隔(周)">-->
|
||||
<!-- <el-input-number-->
|
||||
<!-- v-model="formData.weekInterval"-->
|
||||
<!-- :min="1"-->
|
||||
<!-- :max="52"-->
|
||||
<!-- controls-position="right"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-row>-->
|
||||
|
||||
<!-- <el-form-item label="周次数">-->
|
||||
<!-- <el-input-number-->
|
||||
<!-- v-model="formData.weekTimes"-->
|
||||
<!-- :min="1"-->
|
||||
<!-- :max="7"-->
|
||||
<!-- controls-position="right"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
<!-- 分割线 -->
|
||||
<el-divider content-position="left">周期与总计</el-divider>
|
||||
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="总次数">
|
||||
<el-input-number
|
||||
v-model="formData.totalExecutionCount"
|
||||
:min="1"
|
||||
:max="999"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="周期长度">
|
||||
<el-input-number
|
||||
v-model="formData.executionPeriod"
|
||||
:min="1"
|
||||
:max="999"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="周期单位">
|
||||
<el-select v-model="formData.executionPeriodUnit" style="width: 100%">
|
||||
<el-option label="分钟" value="minute" />
|
||||
<el-option label="天" value="day" />
|
||||
<el-option label="周" value="week" />
|
||||
<el-option label="月" value="month" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="formData.memo"
|
||||
:rows="2"
|
||||
maxlength="200"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- 底部按钮 -->
|
||||
<template #footer>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
|
||||
<style scoped>
|
||||
.freq-form {
|
||||
padding: 0 10px;
|
||||
}
|
||||
.input-readonly {
|
||||
background-color: #f5f7fa;
|
||||
color: #c0c4cc;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch, defineProps, defineEmits } from "vue";
|
||||
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: { type: Boolean, default: false },
|
||||
initialFormData: { type: Object, default: () => ({}) }
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:modelValue', 'submit'])
|
||||
|
||||
const formData = ref({
|
||||
rateCode: '',
|
||||
name: '',
|
||||
dayCount: 0,
|
||||
dayInterval: 0,
|
||||
dayTimes: [],
|
||||
weekCycleFlag: 0,
|
||||
weekInterval: 0,
|
||||
weekTimes: 0,
|
||||
continueFlag: 0,
|
||||
totalExecutionCount: 0,
|
||||
executionPeriod: 0,
|
||||
executionPeriodUnit: 'day',
|
||||
memo: ''
|
||||
});
|
||||
|
||||
|
||||
const generateTimeOptions = () => {
|
||||
const options = [];
|
||||
for (let hour = 0; hour < 24; hour++) {
|
||||
for (let minute = 0; minute <= 59; minute += 30) {
|
||||
const time = `${hour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}`;
|
||||
options.push(time);
|
||||
}
|
||||
}
|
||||
return options;
|
||||
};
|
||||
|
||||
const timeOptions = ref(generateTimeOptions());
|
||||
// 计算属性:让 el-dialog 直接绑定 v-model
|
||||
const dialogVisible = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (val) => emit('update:modelValue', val)
|
||||
})
|
||||
|
||||
function resetForm() {
|
||||
formData.value = { ...props.initialFormData }
|
||||
}
|
||||
function submitForm() {
|
||||
emit('submit', formData.value)
|
||||
dialogVisible.value = false // 关闭
|
||||
}
|
||||
watch(
|
||||
() => props.initialFormData,
|
||||
(newVal) => { formData.value = { ...newVal }; },
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 初始化
|
||||
export function getFrequencyDetailList(query) {
|
||||
return request({
|
||||
url: '/personalization/frequency/getPageList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 新增
|
||||
export function addFrequencyDetail(data) {
|
||||
return request({
|
||||
url: '/personalization/frequency/save',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 删除
|
||||
export function deleteFrequencyDetail(data) {
|
||||
return request({
|
||||
url: '/personalization/frequency/' + data,
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
|
||||
346
openhis-ui-vue3/src/views/basicmanage/frequency/index.vue
Normal file
346
openhis-ui-vue3/src/views/basicmanage/frequency/index.vue
Normal file
@@ -0,0 +1,346 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="20">
|
||||
<!--诊疗目录-->
|
||||
<el-col :span="4" :xs="24">
|
||||
<div class="head-title">频次字典</div>
|
||||
<div>
|
||||
<el-table
|
||||
ref="freTableRef"
|
||||
v-loading="loading"
|
||||
:data="frequency"
|
||||
row-key="id"
|
||||
@row-click="handleRowClick"
|
||||
>
|
||||
<el-table-column label="字典频次名称" align="left" prop="dictLabel" />
|
||||
<el-table-column label="字典频次代码" align="left" prop="dictValue" />
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="frequencyTotal > 0"
|
||||
:total="frequencyTotal"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getFrequencyList"
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="20" :xs="24">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="openDialog"
|
||||
v-hasPermi="['system:user:add']"
|
||||
>添加频次详情</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="frequencyDetail"
|
||||
>
|
||||
<!-- 定义表格列 -->
|
||||
<el-table-column
|
||||
prop="rateCode"
|
||||
label="频次代码"
|
||||
width="180">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="名称"
|
||||
width="200">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="dayCount"
|
||||
label="每天执行次数"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column-->
|
||||
<!-- prop="dayInterval"-->
|
||||
<!-- label="每次执行间隔(天数)"-->
|
||||
<!-- width="180">-->
|
||||
<!-- </el-table-column>-->
|
||||
|
||||
<el-table-column
|
||||
prop="dayTimes"
|
||||
label="执行时间点"
|
||||
width="300">
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column-->
|
||||
<!-- prop="weekCycleFlag"-->
|
||||
<!-- label="是否周期性每周执行"-->
|
||||
<!-- width="150">-->
|
||||
<!-- <template #default="scope">-->
|
||||
<!-- {{ scope.row.weekCycleFlag === 1 ? '是' : '否' }}-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
|
||||
<!-- <el-table-column-->
|
||||
<!-- prop="weekInterval"-->
|
||||
<!-- label="每周执行的间隔"-->
|
||||
<!-- width="150">-->
|
||||
<!-- </el-table-column>-->
|
||||
|
||||
<!-- <el-table-column-->
|
||||
<!-- prop="weekTimes"-->
|
||||
<!-- label="每周执行的次数"-->
|
||||
<!-- width="120">-->
|
||||
<!-- </el-table-column>-->
|
||||
|
||||
<!-- <el-table-column-->
|
||||
<!-- prop="continueFlag"-->
|
||||
<!-- label="是否为连续执行"-->
|
||||
<!-- width="150">-->
|
||||
<!-- <template #default="scope">-->
|
||||
<!-- {{ scope.row.continueFlag === 1 ? '是' : '否' }}-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
|
||||
<el-table-column
|
||||
prop="totalExecutionCount"
|
||||
label="执行总次数"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="executionPeriod"
|
||||
label="执行周期长度"
|
||||
width="150">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="executionPeriodUnit"
|
||||
label="执行周期单位"
|
||||
width="150">
|
||||
</el-table-column>
|
||||
<!-- <el-table-column-->
|
||||
<!-- prop="memo"-->
|
||||
<!-- label="备注信息"-->
|
||||
<!-- width="200">-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
width="150"
|
||||
class-name="small-padding fixed-width"
|
||||
fixed="right"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
@click="openSave(scope.row, scope.$index)"
|
||||
v-hasPermi="['system:user:edit']"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button
|
||||
type="danger"
|
||||
link
|
||||
icon="Delete"
|
||||
:disabled="scope.row.id == ''"
|
||||
@click="deleteSelectedRows(scope.row)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- <pagination-->
|
||||
<!-- v-show="frequencyDetailTotal > 0"-->
|
||||
<!-- :total="frequencyDetailTotal"-->
|
||||
<!-- v-model:page="queryDetailParams.pageNum"-->
|
||||
<!-- v-model:limit="queryDetailParams.pageSize"-->
|
||||
<!-- @pagination="getDetailList"-->
|
||||
<!-- />-->
|
||||
</el-col>
|
||||
</el-row>
|
||||
<FreForm
|
||||
v-model="dialogVisible"
|
||||
:initialFormData="showFormData"
|
||||
@submit="handleFormSubmit"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="frequency">
|
||||
import {
|
||||
addFrequencyDetail, deleteFrequencyDetail,
|
||||
getFrequencyDetailList
|
||||
} from './components/frequency.js';
|
||||
import { ElMessage } from "element-plus";
|
||||
import {
|
||||
listData
|
||||
} from "@/api/system/dict/data.js";
|
||||
import FreForm from "@/views/basicmanage/frequency/components/FreForm.vue";
|
||||
const frequency = ref([]);
|
||||
const frequencyDetail = ref([]);
|
||||
const frequencyTotal = ref(0);
|
||||
const frequencyDetailTotal = ref(0);
|
||||
const currentLeftRow = ref(null);
|
||||
let addFlag = ref(true);
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
dictType: 'rate_code',
|
||||
status : 0,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
queryDetailParams: {
|
||||
code: '',
|
||||
status : 0,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
}
|
||||
});
|
||||
const dialogVisible = ref(false);
|
||||
const showFormData = ref({}); // 真正给弹窗用的数据
|
||||
// 初始表单数据
|
||||
|
||||
const { queryParams, form, tableRules,queryDetailParams } = toRefs(data);
|
||||
|
||||
/** 获取字典列表 */
|
||||
function getFrequencyList() {
|
||||
listData(queryParams.value).then((res) => {
|
||||
if (res.code === 200) {
|
||||
frequency.value =
|
||||
res.rows.length > 0
|
||||
? res.rows.map((res) => {
|
||||
return {
|
||||
...res,
|
||||
isEditing: false, // 标记当前行是否正在编辑
|
||||
error: false, // 新增 error 字段
|
||||
};
|
||||
})
|
||||
: [];
|
||||
}
|
||||
frequencyTotal.value = res.total;
|
||||
});
|
||||
}
|
||||
function getDetailList() {
|
||||
getFrequencyDetailList(queryDetailParams.value).then((res) => {
|
||||
if (res.code === 200) {
|
||||
frequencyDetail.value =
|
||||
res.data.records.length > 0
|
||||
? res.data.records.map((record) => {
|
||||
// 将 dayTimes 字符串转换为数组
|
||||
const dayTimesArray = record.dayTimes.split(',');
|
||||
const sortedDayTimesArray = dayTimesArray.sort((a, b) => {
|
||||
const timeToMinutes = (time) => {
|
||||
const [hours, minutes] = time.split(':').map(Number);
|
||||
return hours * 60 + minutes;
|
||||
};
|
||||
return timeToMinutes(a) - timeToMinutes(b);
|
||||
});
|
||||
const sortedDayTimesString = sortedDayTimesArray.join(',');
|
||||
return {
|
||||
...record,
|
||||
dayTimes: sortedDayTimesString, // 使用排序后的字符串
|
||||
error: false, // 新增 error 字段
|
||||
};
|
||||
})
|
||||
: [];
|
||||
}
|
||||
if( res.data.records.length > 0){
|
||||
//有数据不允许添加
|
||||
addFlag.value = false;
|
||||
}else{
|
||||
addFlag.value = true;
|
||||
}
|
||||
frequencyDetailTotal.value = res.data.total;
|
||||
});
|
||||
}
|
||||
/** 节点单击事件 */
|
||||
function handleRowClick(row) {
|
||||
queryDetailParams.value.code = row.dictValue;
|
||||
currentLeftRow.value = row; // 记录当前行
|
||||
getDetailList();
|
||||
|
||||
}
|
||||
function openDialog() {
|
||||
if (!currentLeftRow?.value) {
|
||||
ElMessage.warning('请先选择一行字典数据!')
|
||||
return;
|
||||
}
|
||||
if (addFlag.value === false) {
|
||||
ElMessage.warning('已有详情!请直接修改!')
|
||||
addFlag.value = true;
|
||||
return;
|
||||
}
|
||||
//默认显示数据
|
||||
showFormData.value = {
|
||||
rateCode: currentLeftRow.value.dictValue,
|
||||
name : currentLeftRow.value.dictLabel,
|
||||
dayCount: 0,
|
||||
dayInterval: 0,
|
||||
dayTimes: [],
|
||||
weekCycleFlag: 0,
|
||||
weekInterval: 0,
|
||||
weekTimes: 0,
|
||||
continueFlag: 0,
|
||||
totalExecutionCount: 0,
|
||||
executionPeriod: 0,
|
||||
executionPeriodUnit: 'day',
|
||||
memo: ''
|
||||
};
|
||||
dialogVisible.value = true;
|
||||
}
|
||||
// 处理表单提交
|
||||
/* 保存/新增 */
|
||||
function handleFormSubmit(initialFormData) {
|
||||
|
||||
addFrequencyDetail(initialFormData).then(() => {
|
||||
getDetailList();
|
||||
ElMessage.success('保存成功');
|
||||
});
|
||||
}
|
||||
|
||||
function openSave(row) {
|
||||
//默认显示数据
|
||||
showFormData.value = { ...row };
|
||||
row.dayTimes = row.dayTimes.split(',');
|
||||
row.dayTimes.sort((a, b) => {
|
||||
// 将时间字符串转换为分钟数进行比较
|
||||
const timeToMinutes = (time) => {
|
||||
const [hours, minutes] = time.split(':').map(Number);
|
||||
return hours * 60 + minutes;
|
||||
};
|
||||
|
||||
return timeToMinutes(a) - timeToMinutes(b);
|
||||
});
|
||||
// 更新 showFormData 中的 dayTimes
|
||||
showFormData.value.dayTimes = row.dayTimes;
|
||||
|
||||
dialogVisible.value = true;
|
||||
}
|
||||
|
||||
|
||||
/* 删除 */
|
||||
function deleteSelectedRows(row) {
|
||||
deleteFrequencyDetail(row.id).then(() => {
|
||||
ElMessage.success('删除成功');
|
||||
getDetailList();
|
||||
});
|
||||
}
|
||||
|
||||
getFrequencyList();
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
.el-form--inline .el-form-item {
|
||||
display: inline-flex;
|
||||
vertical-align: middle;
|
||||
margin-right: 10px !important;
|
||||
}
|
||||
.error-border {
|
||||
border: 1px solid red;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,68 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 初始化
|
||||
export function getImplementDepartmentList(query) {
|
||||
return request({
|
||||
url: '/base-data-manage/organization/organization',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 查询诊疗目录列表
|
||||
export function getDiagnosisTreatmentList(query) {
|
||||
return request({
|
||||
url: '/base-data-manage/org-loc/org-loc',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
//查询诊疗目录详细
|
||||
export function getImplementDepartmentOne(query) {
|
||||
return request({
|
||||
url: '/data-dictionary/diagnosis-treatment/information-page',
|
||||
method: 'get',
|
||||
params: query // 确保参数正确传递
|
||||
})
|
||||
}
|
||||
|
||||
// 新增
|
||||
export function addImplementDepartment(data) {
|
||||
return request({
|
||||
url: '/base-data-manage/org-loc/org-loc',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
export function editImplementDepartment(data) {
|
||||
return request({
|
||||
url: '/base-data-manage/org-loc/org-loc',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
export function deleteImplementDepartment(data) {
|
||||
return request({
|
||||
url: '/base-data-manage/org-loc/org-loc?orgLocId=' + data.orgLocId,
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
|
||||
// 目录分类查询
|
||||
export function getDiseaseTreatmentInit() {
|
||||
return request({
|
||||
url: '/data-dictionary/diagnosis-treatment/init',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 目录分类子查询
|
||||
export function getDiseaseTreatmentInitLoc(id) {
|
||||
return request({
|
||||
url: '/data-dictionary/diagnosis-treatment/information-one?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,467 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="20">
|
||||
<!--诊疗目录-->
|
||||
<el-col :span="4" :xs="24">
|
||||
<div class="head-title">执行科室配置</div>
|
||||
<div class="head-container">
|
||||
<el-tree
|
||||
:data="organization"
|
||||
:props="{ label: 'name', children: 'children' }"
|
||||
:expand-on-click-node="true"
|
||||
:filter-node-method="filterNode"
|
||||
ref="treeRef"
|
||||
node-key="id"
|
||||
highlight-current
|
||||
check-strictly
|
||||
default-expand-all
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
<!--诊疗目录-->
|
||||
<el-col :span="20" :xs="24">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
:disabled="isAddDisable"
|
||||
@click="handleAddItem"
|
||||
v-hasPermi="['system:user:add']"
|
||||
>添加新项目</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="catagoryList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="100" align="center" />
|
||||
<el-table-column label="诊疗目录" width="150" align="center" :show-overflow-tooltip="true">
|
||||
<template #default="scope">
|
||||
<div style="display: flex; align-items: center; justify-content: center">
|
||||
<el-select
|
||||
v-model="scope.row.activityCategoryCode"
|
||||
placeholder="请选择"
|
||||
ref="dropdown"
|
||||
@change="DiagnosisTreatmentList(scope.row,scope.$index,1)"
|
||||
:class="{ 'error-border': scope.row.error }"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in catagoryDicts"
|
||||
:key="dict.value"
|
||||
:label="dict.info"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="项目名称"
|
||||
align="center"
|
||||
:show-overflow-tooltip="true"
|
||||
>
|
||||
<template #default="scope">
|
||||
<div style="display: flex; align-items: center; justify-content: center">
|
||||
<el-select
|
||||
v-model="scope.row.activityDefinitionId"
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
placeholder="请选择"
|
||||
remote-show-suffix
|
||||
:remote-method="(query) => debouncedRemoteMethod(query, scope.row)"
|
||||
:loading="loading"
|
||||
style="width: 350px"
|
||||
:class="{ 'error-border': scope.row.error }"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in scope.row.projectList"
|
||||
:key="item.value"
|
||||
:label="item.info"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="开始时间"
|
||||
align="center"
|
||||
key="startTime"
|
||||
prop="startTime"
|
||||
:show-overflow-tooltip="true"
|
||||
width="300"
|
||||
>
|
||||
<template #default="scope">
|
||||
<div style="display: flex; align-items: center; justify-content: center">
|
||||
<el-time-picker
|
||||
v-model="scope.row.startTime"
|
||||
placeholder="选择时间"
|
||||
format="HH:mm:ss"
|
||||
value-format="HH:mm:ss"
|
||||
>
|
||||
</el-time-picker>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="结束时间"
|
||||
align="center"
|
||||
key="endTime"
|
||||
prop="endTime"
|
||||
:show-overflow-tooltip="true"
|
||||
width="300"
|
||||
>
|
||||
<template #default="scope">
|
||||
<div style="display: flex; align-items: center; justify-content: center">
|
||||
<el-time-picker
|
||||
v-model="scope.row.endTime"
|
||||
placeholder="选择时间"
|
||||
format="HH:mm:ss"
|
||||
value-format="HH:mm:ss"
|
||||
>
|
||||
</el-time-picker>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
width="150"
|
||||
class-name="small-padding fixed-width"
|
||||
fixed="right"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
@click="openSaveImplementDepartment(scope.row, scope.$index)"
|
||||
v-hasPermi="['system:user:edit']"
|
||||
>保存</el-button
|
||||
>
|
||||
<el-button
|
||||
type="danger"
|
||||
link
|
||||
icon="Delete"
|
||||
:disabled="scope.row.id == ''"
|
||||
@click="deleteSelectedRows(scope.row)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="implementDepartment">
|
||||
import { ref } from 'vue';
|
||||
import {
|
||||
getImplementDepartmentList,
|
||||
getDiagnosisTreatmentList,
|
||||
getDiseaseTreatmentInit,
|
||||
getImplementDepartmentOne,
|
||||
// getDiseaseTreatmentInitLoc,
|
||||
addImplementDepartment,
|
||||
editImplementDepartment,
|
||||
deleteImplementDepartment,
|
||||
} from './components/implementDepartment';
|
||||
import { debounce } from 'lodash-es';
|
||||
const { proxy } = getCurrentInstance();
|
||||
const organization = ref([]);
|
||||
const loading = ref(true);
|
||||
const ids = ref([]); // 存储选择的行数据
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const catagoryList = ref([]);
|
||||
const projectList = ref([]);
|
||||
const catagoryDicts = ref([]);
|
||||
const isAddDisable = ref(true);
|
||||
const organizationId = ref('');
|
||||
//默认传8(诊疗)
|
||||
const distributionCategoryCode = ref('8');
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
tableRules: {
|
||||
activityCategoryCode: [{ required: true, message: '诊疗目录不能为空', trigger: 'blur' }],
|
||||
activityDefinitionId: [{ required: true, message: '项目名称不能为空', trigger: 'blur' }],
|
||||
},
|
||||
isAdding: false,
|
||||
});
|
||||
const debouncedRemoteMethod = debounce((query, row) => {
|
||||
remoteMethod(query, row);
|
||||
}, 300);
|
||||
|
||||
const { queryParams, tableRules } = toRefs(data);
|
||||
|
||||
/** 查询表格数据列表 */
|
||||
function getList() {
|
||||
let params = {
|
||||
// 科室id
|
||||
organizationId: organizationId.value,
|
||||
// 类别
|
||||
distributionCategoryCode: distributionCategoryCode.value,
|
||||
};
|
||||
getDiagnosisTreatmentList(params).then((res) => {
|
||||
console.log(res.data.records)
|
||||
loading.value = false;
|
||||
catagoryList.value = res.data.records
|
||||
catagoryList.value.map((k,index)=>{
|
||||
// if(k.activityCategoryCode){
|
||||
DiagnosisTreatmentList(k,index, 2)
|
||||
// }
|
||||
})
|
||||
total.value = res.data.total;
|
||||
});
|
||||
}
|
||||
/** 通过条件过滤节点 */
|
||||
const filterNode = (value, data) => {
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1;
|
||||
};
|
||||
|
||||
//下拉诊疗目录点击事件
|
||||
function DiagnosisTreatmentList(row,index,type) {
|
||||
let params = {
|
||||
statusEnum: 2, // 状态(包括 1:预置,2:启用,3:停用)
|
||||
...row,
|
||||
categoryCode: row.activityCategoryCode,
|
||||
pageSize:100,
|
||||
}
|
||||
if(type == 1){
|
||||
catagoryList.value[index].activityDefinitionId =''
|
||||
}else if(type == 2){
|
||||
params.searchKey = row.activityDefinitionId_dictText
|
||||
}
|
||||
getImplementDepartmentOne(params)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
projectList.value = [];
|
||||
row.name = null;
|
||||
projectList.value = res.data.records.map((item) => ({ value: item.id, info: item.name }));
|
||||
catagoryList.value[index].projectList = projectList.value
|
||||
} else {
|
||||
proxy.$modal.msgError(res.msg);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('请求失败', error);
|
||||
});
|
||||
}
|
||||
|
||||
function remoteMethod(query, row) {
|
||||
loading.value = true;
|
||||
const params = {
|
||||
statusEnum: 2,
|
||||
activityCategoryCode: row.activityCategoryCode, // 确保已选诊疗目录
|
||||
searchKey: query, // 模糊搜索关键字
|
||||
};
|
||||
getImplementDepartmentOne(params).then((res) => {
|
||||
loading.value = false;
|
||||
if (res.code === 200) {
|
||||
// 更新当前行的 projectList 数据
|
||||
row.projectList = res.data.records.map((item) => ({
|
||||
value: item.id,
|
||||
info: item.name,
|
||||
}));
|
||||
} else {
|
||||
proxy.$modal.msgError(res.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 选择条数 */
|
||||
function handleSelectionChange(selection) {
|
||||
// selectedData.value = selection.map((item) => ({ ...item })); // 存储选择的行数据
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
// 新增项目
|
||||
function handleAddItem() {
|
||||
if (data.isAdding) {
|
||||
proxy.$message.warning('请先保存当前行后再新增!');
|
||||
return;
|
||||
}
|
||||
const newRow = {
|
||||
startTime:'00:00:00',
|
||||
endTime:'23:59:59'
|
||||
};
|
||||
catagoryList.value.push(newRow);
|
||||
total.value = organization.value.length;
|
||||
data.isAdding = true; // 设置标志位为 true,表示有未保存的
|
||||
}
|
||||
// 检验 编辑或 保存数据
|
||||
function handleBlur(row, index) {
|
||||
let hasError = false;
|
||||
const fields = ['activityCategoryCode', 'activityDefinitionId', 'startTime', 'endTime'];
|
||||
|
||||
fields.forEach((field) => {
|
||||
if (!row[field]) {
|
||||
hasError = true;
|
||||
const message = tableRules.value[field]?.[0]?.message;
|
||||
if (message) {
|
||||
proxy.$message.error(message);
|
||||
} else {
|
||||
console.error(`No rule defined for field: ${field}`);
|
||||
proxy.$message.error(`No rule defined for field: ${field}`);
|
||||
}
|
||||
}
|
||||
});
|
||||
row.error = hasError;
|
||||
}
|
||||
|
||||
// 编辑或 保存当前行
|
||||
function openSaveImplementDepartment(row) {
|
||||
const params = {
|
||||
// 科室id
|
||||
organizationId: organizationId.value,
|
||||
// 类别
|
||||
distributionCategoryCode: distributionCategoryCode.value,
|
||||
...row,
|
||||
};
|
||||
let hasError = false;
|
||||
handleBlur(row);
|
||||
if (row.error) {
|
||||
hasError = true;
|
||||
}
|
||||
const startTime = params.startTime;
|
||||
const endTime = params.endTime;
|
||||
if (startTime > endTime) {
|
||||
proxy.$message.error('开始时间不能大于结束时间');
|
||||
return;
|
||||
}
|
||||
if (hasError) {
|
||||
proxy.$message.error('请填写完整信息');
|
||||
return;
|
||||
}
|
||||
if (row.id) {
|
||||
editImplementDepartment(params).then((res) => {
|
||||
data.isAdding = false; // 允许新增下一行
|
||||
proxy.$modal.msgSuccess('保存成功!');
|
||||
});
|
||||
} else {
|
||||
delete params.id;
|
||||
addImplementDepartment(params).then((res) => {
|
||||
data.isAdding = false; // 允许新增下一行
|
||||
proxy.$modal.msgSuccess('保存成功!');
|
||||
});
|
||||
}
|
||||
}
|
||||
// 删除当前所选行
|
||||
function deleteSelectedRows(row) {
|
||||
if (row.id) {
|
||||
deleteImplementDepartment({ orgLocId: row.id }).then((res) => {});
|
||||
} else {
|
||||
catagoryList.value.pop();
|
||||
}
|
||||
proxy.$modal.msgSuccess('删除成功');
|
||||
data.isAdding = false;
|
||||
getList();
|
||||
}
|
||||
/** 节点单击事件 */
|
||||
function handleNodeClick(data, node) {
|
||||
catagoryList.value.map(k=>{
|
||||
if(!k.id){
|
||||
openSaveImplementDepartment(k)
|
||||
}
|
||||
})
|
||||
// 新增按钮是否 disable
|
||||
if (node.parent === null || node.level === 1) {
|
||||
isAddDisable.value = true;
|
||||
} else {
|
||||
isAddDisable.value = false;
|
||||
}
|
||||
// 检查节点是否有子节点
|
||||
if (node.data.children && node.data.children.length > 0) {
|
||||
// proxy.$message.warning("不能选择父节点");
|
||||
return;
|
||||
}
|
||||
// 选中科室id
|
||||
organizationId.value = node.data.id;
|
||||
// 获取 右侧 table 信息
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 目录分类查询 */
|
||||
function getDiseaseTreatmentList() {
|
||||
getDiseaseTreatmentInit().then(({ data }) => {
|
||||
//分类目录初始化获取
|
||||
catagoryDicts.value = data.diagnosisCategoryOptions.sort((a, b) => {
|
||||
return parseInt(a.value) - parseInt(b.value);
|
||||
});
|
||||
});
|
||||
// 诊疗目录分类查询下拉树结d构
|
||||
loading.value = true;
|
||||
// 诊疗目录分类查询下拉树结d构
|
||||
getImplDepartList();
|
||||
}
|
||||
// 诊疗目录分类查询下拉树结d构
|
||||
function getImplDepartList() {
|
||||
getImplementDepartmentList().then((res) => {
|
||||
loading.value = false;
|
||||
if (res.code === 200) {
|
||||
if (res.data.records.length > 0) {
|
||||
organization.value = res.data.records.map((res) => {
|
||||
return {
|
||||
...res,
|
||||
isEditing: false, // 标记当前行是否正在编辑
|
||||
error: false, // 新增 error 字段
|
||||
};
|
||||
});
|
||||
} else {
|
||||
organization.value = [];
|
||||
}
|
||||
} else {
|
||||
this.$modal.msgError(res.code);
|
||||
}
|
||||
});
|
||||
}
|
||||
// 获取左侧执行科室配置目录
|
||||
getDiseaseTreatmentList();
|
||||
</script>
|
||||
<style scoped>
|
||||
.el-form--inline .el-form-item {
|
||||
display: inline-flex;
|
||||
vertical-align: middle;
|
||||
margin-right: 10px !important;
|
||||
}
|
||||
|
||||
.error-border {
|
||||
border: 1px solid red;
|
||||
}
|
||||
/* ::v-deep.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{ */
|
||||
/* background-color: #c5e1ff!important; */
|
||||
/* #d8ebff!important; */
|
||||
/* #c5e1ff!important; */
|
||||
/* #9fceff!important; */
|
||||
/* } */
|
||||
/* ::v-deep.el-tree--highlight-current{ */
|
||||
/* background-color:#f8f8f9 !important; */
|
||||
/* #ebf5ff!important; */
|
||||
/* } */
|
||||
|
||||
</style>
|
||||
2
openhis-ui-vue3/src/views/basicmanage/lisMerge/index.vue
Normal file
2
openhis-ui-vue3/src/views/basicmanage/lisMerge/index.vue
Normal file
@@ -0,0 +1,2 @@
|
||||
<template>
|
||||
</template>
|
||||
@@ -0,0 +1,148 @@
|
||||
<template>
|
||||
<div @keyup="handleKeyDown" tabindex="0" ref="tableWrapper">
|
||||
<el-table
|
||||
ref="adviceBaseRef"
|
||||
height="400"
|
||||
:data="adviceBaseList"
|
||||
highlight-current-row
|
||||
@current-change="handleCurrentChange"
|
||||
row-key="patientId"
|
||||
@cell-click="clickRow"
|
||||
>
|
||||
<el-table-column label="名称" align="center" prop="adviceName" />
|
||||
<el-table-column label="类型" align="center" prop="activityType_enumText" />
|
||||
<el-table-column label="包装单位" align="center" prop="unitCode_dictText" />
|
||||
<el-table-column label="最小单位" align="center" prop="minUnitCode_dictText" />
|
||||
<el-table-column label="规格" align="center" prop="volume" />
|
||||
<el-table-column label="用法" align="center" prop="methodCode_dictText" />
|
||||
<el-table-column label="频次" align="center" prop="rateCode_dictText" />
|
||||
<el-table-column label="单次剂量" align="center" prop="dose" />
|
||||
<el-table-column label="剂量单位" align="center" prop="doseUnitCode_dictText" />
|
||||
<el-table-column label="注射药品" align="center" prop="injectFlag_enumText" />
|
||||
<el-table-column label="皮试" align="center" prop="skinTestFlag_enumText" />
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { nextTick } from 'vue';
|
||||
import { getAdviceBaseInfo } from './api';
|
||||
import { throttle } from 'lodash-es';
|
||||
|
||||
const props = defineProps({
|
||||
adviceQueryParams: {
|
||||
type: Object,
|
||||
default: '',
|
||||
},
|
||||
patientInfo: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(['selectAdviceBase']);
|
||||
const total = ref(0);
|
||||
const adviceBaseRef = ref();
|
||||
const tableWrapper = ref();
|
||||
const currentIndex = ref(0); // 当前选中行索引
|
||||
const currentSelectRow = ref({});
|
||||
const queryParams = ref({
|
||||
pageSize: 100,
|
||||
pageNum: 1,
|
||||
});
|
||||
const adviceBaseList = ref([]);
|
||||
// 节流函数
|
||||
const throttledGetList = throttle(
|
||||
() => {
|
||||
getList();
|
||||
},
|
||||
300,
|
||||
{ leading: true, trailing: true }
|
||||
);
|
||||
watch(
|
||||
() => props.adviceQueryParams,
|
||||
(newValue) => {
|
||||
queryParams.value.searchKey = newValue.searchKey;
|
||||
queryParams.value.adviceType = newValue.adviceType;
|
||||
console.log(queryParams.value);
|
||||
throttledGetList();
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
|
||||
getList();
|
||||
function getList() {
|
||||
queryParams.value.organizationId = '1922545444781481985';
|
||||
getAdviceBaseInfo(queryParams.value).then((res) => {
|
||||
adviceBaseList.value = res.data.records;
|
||||
total.value = res.data.total;
|
||||
nextTick(() => {
|
||||
currentIndex.value = 0;
|
||||
if (adviceBaseList.value.length > 0) {
|
||||
adviceBaseRef.value.setCurrentRow(adviceBaseList.value[0]);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 处理键盘事件
|
||||
const handleKeyDown = (event) => {
|
||||
const key = event.key;
|
||||
const data = adviceBaseList.value;
|
||||
|
||||
switch (key) {
|
||||
case 'ArrowUp': // 上箭头
|
||||
event.preventDefault(); // 阻止默认滚动行为
|
||||
if (currentIndex.value > 0) {
|
||||
currentIndex.value--;
|
||||
setCurrentRow(data[currentIndex.value]);
|
||||
}
|
||||
break;
|
||||
case 'ArrowDown': // 下箭头`
|
||||
event.preventDefault();
|
||||
if (currentIndex.value < data.length - 1) {
|
||||
currentIndex.value++;
|
||||
setCurrentRow(data[currentIndex.value]);
|
||||
}
|
||||
break;
|
||||
case 'Enter': // 回车键
|
||||
// const currentRow = adviceBaseRef.value.getSelectionRows();
|
||||
event.preventDefault();
|
||||
if (currentSelectRow.value) {
|
||||
// 这里可以触发自定义逻辑,如弹窗、跳转等
|
||||
emit('selectAdviceBase', currentSelectRow.value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
// 设置选中行(带滚动)
|
||||
const setCurrentRow = (row) => {
|
||||
adviceBaseRef.value.setCurrentRow(row);
|
||||
// 滚动到选中行
|
||||
const tableBody = adviceBaseRef.value.$el.querySelector('.el-table__body-wrapper');
|
||||
const currentRowEl = adviceBaseRef.value.$el.querySelector('.current-row');
|
||||
if (tableBody && currentRowEl) {
|
||||
currentRowEl.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
|
||||
}
|
||||
};
|
||||
|
||||
// 当前行变化时更新索引
|
||||
const handleCurrentChange = (currentRow) => {
|
||||
currentIndex.value = adviceBaseList.value.findIndex((item) => item === currentRow);
|
||||
currentSelectRow.value = currentRow;
|
||||
};
|
||||
|
||||
function clickRow(row) {
|
||||
emit('selectAdviceBase', row);
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
handleKeyDown,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.popover-table-wrapper:focus {
|
||||
outline: 2px solid #409eff; /* 聚焦时的高亮效果 */
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,69 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function getOrderGroup(queryParams) {
|
||||
return request({
|
||||
url: '/personalization/order-group/order-group',
|
||||
method: 'get',
|
||||
param: queryParams
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
export function saveOrderGroup(data) {
|
||||
return request({
|
||||
url: '/personalization/order-group/order-group',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function getAdviceBaseInfo(queryParams) {
|
||||
return request({
|
||||
url: '/doctor-station/advice/advice-base-info',
|
||||
method: 'get',
|
||||
params: queryParams
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取科室列表
|
||||
*/
|
||||
export function getOrgTree() {
|
||||
return request({
|
||||
url: '/base-data-manage/organization/organization',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 添加组套获取科室列表
|
||||
*/
|
||||
export function getDepartmentList() {
|
||||
return request({
|
||||
url: '/app-common/department-list',
|
||||
method: 'get',
|
||||
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 添加组套获取使用人列表
|
||||
*/
|
||||
export function getUserPractitionerPCage(params) {
|
||||
return request({
|
||||
url: '/base-data-manage/practitioner/user-practitioner-page',
|
||||
method: 'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除组套
|
||||
*/
|
||||
export function deleteOrderGroup(params) {
|
||||
return request({
|
||||
url: '/personalization/order-group/order-group',
|
||||
method: 'delete',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,361 @@
|
||||
<template>
|
||||
<div class="main-content">
|
||||
<!-- 中间组套列表 -->
|
||||
<div class="section-card-left">
|
||||
<div class="section-header">
|
||||
<div class="actions">
|
||||
<span class="descriptions-item-label">组套名称:</span>
|
||||
<el-input
|
||||
v-model="queryParams.searchKey"
|
||||
placeholder="请输入组套名称"
|
||||
clearable
|
||||
class="search-input"
|
||||
@keydown.enter="getOrderGroupList"
|
||||
>
|
||||
<template #append>
|
||||
<el-button icon="Search" @click="getOrderGroupList" />
|
||||
</template>
|
||||
</el-input>
|
||||
<span class="descriptions-item-label">使用范围:</span>
|
||||
<el-select
|
||||
v-model="queryParams.rangeCode"
|
||||
placeholder="请选择使用范围"
|
||||
prefix-icon="el-icon-search"
|
||||
clearable
|
||||
@change="getOrderGroupList"
|
||||
class="search-input"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in use_range"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
:data="orderGroupList"
|
||||
highlight-current-row
|
||||
@current-change="handleTemplateSelect"
|
||||
style="width: 100%"
|
||||
v-loading="templateLoading"
|
||||
border
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="name" label="组套名称" min-width="180" header-align="center" />
|
||||
<el-table-column prop="rangeCode_dictText" label="使用范围" width="100" align="center" />
|
||||
<el-table-column prop="createdAt" label="创建时间" width="160" align="center">
|
||||
<template #default="{ row }">
|
||||
<!-- {{ formatDate(row.createdAt) }} -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100" fixed="right" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button type="text" @click="editTemplate(row)">编辑</el-button>
|
||||
<el-button type="text" @click="deleteTemplate(row.id)" style="color: #f56c6c">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- 右侧组套详情 -->
|
||||
<div draggable="true" class="section-card-right">
|
||||
<div class="template-detail">
|
||||
<!-- 基本信息卡片 -->
|
||||
<div class="info-card">
|
||||
<div class="card-header">
|
||||
<span>基本信息</span>
|
||||
<el-button type="primary" @click="addTemplate">新建组套</el-button>
|
||||
<el-button type="primary" @click="addTemplate">保存组套</el-button>
|
||||
</div>
|
||||
<el-form :model="currentTemplate" label-width="100px" class="info-form" :inline="true">
|
||||
<el-form-item label="组套名称">
|
||||
<el-input v-model="currentTemplate.name" ref="name" placeholder="请输入组套名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="组套类型">
|
||||
<el-select
|
||||
v-model="currentTemplate.typeEnum"
|
||||
placeholder="请选择组套类型"
|
||||
class="search-input"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in typeEnum"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="使用范围">
|
||||
<el-select
|
||||
v-model="currentTemplate.rangeCode"
|
||||
placeholder="请选择使用范围"
|
||||
class="search-input"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in use_range"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="info-card">
|
||||
<div class="card-header">
|
||||
<span>项目列表</span>
|
||||
</div>
|
||||
<div style="padding: 10px 10px">
|
||||
<Prescriptionlist :comtination="comtination" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import Prescriptionlist from './components/prescriptionlist.vue';
|
||||
import { getOrderGroup, deleteOrderGroup } from './components/api.js';
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { use_range } = proxy.useDict('use_range');
|
||||
|
||||
const currentTemplate = ref({});
|
||||
// 查询参数
|
||||
const queryParams = ref({});
|
||||
// 组套列表
|
||||
const orderGroupList = ref([]);
|
||||
const typeEnum = ref([
|
||||
{
|
||||
value: '1',
|
||||
label: '医嘱组套',
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: '诊疗组套',
|
||||
},
|
||||
]);
|
||||
const comtination = ref('');
|
||||
const templateLoading = ref(false);
|
||||
|
||||
getOrderGroupList();
|
||||
function getOrderGroupList() {
|
||||
getOrderGroup(queryParams.value).then((res) => {
|
||||
orderGroupList.value = res.data.records;
|
||||
});
|
||||
}
|
||||
|
||||
// 处理组套选择
|
||||
const handleTemplateSelect = (row) => {
|
||||
currentTemplate.value = row;
|
||||
comtination.value = row;
|
||||
};
|
||||
|
||||
// 添加组套
|
||||
const addTemplate = () => {
|
||||
currentTemplate.value = {};
|
||||
proxy.$refs.name.focus();
|
||||
};
|
||||
|
||||
// 编辑组套
|
||||
const editTemplate = () => {};
|
||||
|
||||
// 删除组套
|
||||
const deleteTemplate = (id) => {
|
||||
deleteOrderGroup({ id: id }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess('删除成功');
|
||||
}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.main-content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
padding: 30px;
|
||||
width: 100%;
|
||||
height: calc(100% - 80px);
|
||||
}
|
||||
|
||||
.section-card-left {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
|
||||
width: 35%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
padding: 10px;
|
||||
border: 1px solid #ebeef5;
|
||||
}
|
||||
|
||||
.section-card-right {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
|
||||
width: 64%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.section-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 15px 10px;
|
||||
background: #f8fafc;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
}
|
||||
|
||||
.search-area {
|
||||
padding: 10px 15px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
background: #f8fafc;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.template-detail {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
overflow-y: auto;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.info-card {
|
||||
background: #ffffff;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
|
||||
border: 1px solid #ebeef5;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 12px 15px;
|
||||
background: #f8fafc;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
font-weight: 600;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.card-header i {
|
||||
margin-right: 10px;
|
||||
color: #409eff;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.card-header span {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.add-btn {
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
.info-form {
|
||||
padding: 20px 15px 10px;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.custom-tree-node {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
.custom-tree-node i {
|
||||
margin-right: 8px;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.node-label {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.count-badge {
|
||||
background-color: #e6f7ff;
|
||||
color: #1890ff;
|
||||
border-radius: 10px;
|
||||
padding: 2px 8px;
|
||||
font-size: 14px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.tree-actions {
|
||||
visibility: hidden;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.el-tree-node__content:hover .tree-actions {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
:deep(.el-tree-node.is-current > .el-tree-node__content) {
|
||||
background-color: #ecf5ff;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
:deep(.el-tree-node__content) {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
:deep(.el-table) {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
:deep(.el-table__header) {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
:deep(.el-table__row) {
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
|
||||
:deep(.el-table__row:hover) {
|
||||
background-color: #f5f7fa !important;
|
||||
}
|
||||
|
||||
.el-button--primary {
|
||||
background: linear-gradient(135deg, #409eff, #337ecc);
|
||||
border: none;
|
||||
}
|
||||
|
||||
.el-button--primary:hover {
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.cost {
|
||||
font-weight: 600;
|
||||
color: #e53935;
|
||||
}
|
||||
|
||||
:deep(.el-tag) {
|
||||
border-radius: 12px;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
:deep(.el-input__inner) {
|
||||
border-radius: 8px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,60 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function getList(queryParams) {
|
||||
return request({
|
||||
url: '/base-data-manage/organization/organization',
|
||||
method: 'get',
|
||||
param: queryParams
|
||||
})
|
||||
}
|
||||
|
||||
export function addOrganization(data) {
|
||||
return request({
|
||||
url: '/base-data-manage/organization/organization',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateOrganization(data) {
|
||||
return request({
|
||||
url: '/base-data-manage/organization/organization',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteOrganization(orgIds) {
|
||||
return request({
|
||||
url: '/base-data-manage/organization/organization?orgIds=' + orgIds ,
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
|
||||
export function getOrgDetail(id) {
|
||||
return request({
|
||||
url: '/base-data-manage/organization/organization?orgId=' + id,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function initOrgTypeOption() {
|
||||
return request({
|
||||
url: '/base-data-manage/organization/init',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function disableOrg(id) {
|
||||
return request({
|
||||
url: '/base-data-manage/organization/organization-inactive?orgId=' + id,
|
||||
method: 'put',
|
||||
})
|
||||
}
|
||||
|
||||
export function enableOrg(id) {
|
||||
return request({
|
||||
url: '/base-data-manage/organization/organization-active?orgId=' + id,
|
||||
method: 'put',
|
||||
})
|
||||
}
|
||||
296
openhis-ui-vue3/src/views/basicmanage/organization/index.vue
Normal file
296
openhis-ui-vue3/src/views/basicmanage/organization/index.vue
Normal file
@@ -0,0 +1,296 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd"> 新增 </el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-tooltip
|
||||
:content="selectRowIds.length == 0 ? '至少选择一条数据' : ''"
|
||||
placement="top"
|
||||
:disabled="selectRowIds.length != 0"
|
||||
>
|
||||
<el-button
|
||||
type=""
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="selectRowIds.length == 0"
|
||||
@click="handleDelete"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-tooltip>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="" plain icon="Download" @click="handleExport"> 导出 </el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="" plain icon="Refresh" @click="getPageList">刷新</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
<el-table
|
||||
ref="orgTableRef"
|
||||
v-loading="loading"
|
||||
:data="organization"
|
||||
row-key="id"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="科室名称" align="left" prop="name" />
|
||||
<el-table-column label="科室类型" align="center" prop="typeEnum_dictText" />
|
||||
<el-table-column label="科室分类" align="center" prop="classEnum_dictText" />
|
||||
<el-table-column label="医保码" align="center" prop="ybNo" />
|
||||
<el-table-column label="医保名称" align="center" prop="ybName" />
|
||||
<el-table-column label="状态" align="center" prop="activeFlag_dictText" />
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handelEdit(scope.row)">编辑</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="handleDisabled(scope.row.id)"
|
||||
v-if="scope.row.activeFlag == '1'"
|
||||
>停用</el-button
|
||||
>
|
||||
<el-button link type="primary" @click="handelEnable(scope.row.id)" v-else>启用</el-button>
|
||||
<el-button link type="primary" @click="handleAddInferior(scope.row)">
|
||||
添加下级
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- <pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/> -->
|
||||
|
||||
<!-- 添加或修改参数配置对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="600px" @close="cancel" append-to-body>
|
||||
<el-form ref="orgRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="id" prop="id" v-show="false">
|
||||
<el-input v-model="form.id" placeholder="请输入科室编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="科室编号" prop="busNo" v-show="false">
|
||||
<el-input v-model="form.busNo" placeholder="请输入科室编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="科室名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入科室名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="医保码" prop="name">
|
||||
<el-input v-model="form.ybNo" placeholder="请输入医保码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="医保名称" prop="name">
|
||||
<el-input v-model="form.ybName" placeholder="请输入医保名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="科室类型" prop="typeEnum">
|
||||
<el-select
|
||||
v-model="form.typeEnum"
|
||||
placeholder="请选择科室类型"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in orgTypeOption"
|
||||
:key="item.value"
|
||||
:label="item.info"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="科室分类" prop="classEnum">
|
||||
<el-select
|
||||
v-model="form.classEnum"
|
||||
placeholder="请选择科室分类"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
:disabled="form.typeEnum != 2"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in classEnumOption"
|
||||
:key="item.value"
|
||||
:label="item.info"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-col>
|
||||
<el-form-item label="上级科室" prop="busNoParent">
|
||||
<el-tree-select
|
||||
clearable
|
||||
style="width: 100%"
|
||||
v-model="form.busNoParent"
|
||||
:data="organization"
|
||||
:props="{ value: 'busNo', label: 'name', children: 'children' }"
|
||||
value-key="id"
|
||||
check-strictly
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Organization">
|
||||
import {
|
||||
getList,
|
||||
deleteOrganization,
|
||||
addOrganization,
|
||||
updateOrganization,
|
||||
disableOrg,
|
||||
initOrgTypeOption,
|
||||
enableOrg,
|
||||
} from './components/api';
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const loading = ref(true);
|
||||
const organization = ref([]);
|
||||
const queryParams = ref({});
|
||||
const open = ref(false);
|
||||
const form = ref({
|
||||
id: undefined,
|
||||
busNo: undefined,
|
||||
name: undefined,
|
||||
typeEnum: undefined,
|
||||
busNoParent: undefined,
|
||||
});
|
||||
const orgTableRef = ref();
|
||||
const orgRef = ref();
|
||||
const orgTypeOption = ref([]);
|
||||
const classEnumOption = ref([]);
|
||||
const selectRowIds = ref([]);
|
||||
const total = ref(0);
|
||||
const title = ref('');
|
||||
const rules = ref({
|
||||
busNo: [{ required: false, message: '请输入科室编号', trigger: 'input' }],
|
||||
name: [
|
||||
{ required: true, message: '请输入科室名称', trigger: 'change' },
|
||||
{ min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'change' },
|
||||
],
|
||||
typeEnum: [{ required: true, message: '请选择科室类型', trigger: 'change' }],
|
||||
});
|
||||
|
||||
getPageList();
|
||||
initOption();
|
||||
function initOption() {
|
||||
if (orgTypeOption.value.length == 0) {
|
||||
initOrgTypeOption().then((res) => {
|
||||
orgTypeOption.value = res.data.organizationTypeOptions;
|
||||
classEnumOption.value = res.data.organizationClassOptions;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function reset() {
|
||||
form.value.id = undefined;
|
||||
orgRef.value.resetFields();
|
||||
}
|
||||
|
||||
function getPageList() {
|
||||
loading.value = false;
|
||||
getList(queryParams.value).then((res) => {
|
||||
organization.value = res.data.records;
|
||||
total.value = res.data.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
title.value = '添加药库药房';
|
||||
open.value = true;
|
||||
reset();
|
||||
console.log(form.value);
|
||||
}
|
||||
|
||||
function handelEdit(row) {
|
||||
console.log(row.busNo);
|
||||
|
||||
title.value = '编辑科室';
|
||||
open.value = true;
|
||||
setTimeout(() => {
|
||||
form.value.id = row.id;
|
||||
form.value.busNo = row.busNo;
|
||||
form.value.name = row.name;
|
||||
form.value.ybNo = row.ybNo;
|
||||
form.value.ybName = row.ybName;
|
||||
form.value.typeEnum = row.typeEnum;
|
||||
form.value.classEnum = row.classEnum;
|
||||
form.value.busNoParent = row.busNo.split('.').length > 1 ? row.busNo.split('.')[0] : undefined;
|
||||
}, 50);
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
console.log(form.value);
|
||||
}
|
||||
|
||||
// 新增/编辑
|
||||
function submitForm() {
|
||||
proxy.$refs['orgRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.id == undefined) {
|
||||
if (form.value.busNoParent) {
|
||||
form.value.busNo = form.value.busNoParent;
|
||||
}
|
||||
addOrganization(form.value).then((res) => {
|
||||
proxy.$modal.msgSuccess('操作成功');
|
||||
open.value = false;
|
||||
getPageList();
|
||||
});
|
||||
} else {
|
||||
updateOrganization(form.value).then((res) => {
|
||||
proxy.$modal.msgSuccess('操作成功');
|
||||
open.value = false;
|
||||
getPageList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 添加下级
|
||||
function handleAddInferior(row) {
|
||||
title.value = '添加下级';
|
||||
open.value = true;
|
||||
form.value.busNoParent = row.busNo;
|
||||
}
|
||||
|
||||
// 删除
|
||||
function handleDelete() {
|
||||
loading.value = true;
|
||||
deleteOrganization(selectRowIds.value.join(',')).then((res) => {
|
||||
proxy.$modal.msgSuccess('操作成功');
|
||||
loading.value = false;
|
||||
getPageList();
|
||||
});
|
||||
}
|
||||
// 停用
|
||||
function handleDisabled(id) {
|
||||
disableOrg(id).then((res) => {
|
||||
proxy.$modal.msgSuccess('操作成功');
|
||||
getPageList();
|
||||
});
|
||||
}
|
||||
|
||||
// 启用
|
||||
function handelEnable(id) {
|
||||
enableOrg(id).then((res) => {
|
||||
proxy.$modal.msgSuccess('操作成功');
|
||||
getPageList();
|
||||
});
|
||||
}
|
||||
|
||||
function handleSelectionChange() {
|
||||
selectRowIds.value = orgTableRef.value.getSelectionRows().map((item) => item.id);
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,62 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 初始化
|
||||
export function getPharmacyDepartmentList(query) {
|
||||
return request({
|
||||
url: '/base-data-manage/org-loc/org-loc',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询诊疗目录详细
|
||||
export function getPharmacyDepartmentOne(query) {
|
||||
return request({
|
||||
url: '/base-data-manage/org-loc/org-loc',
|
||||
method: 'get',
|
||||
params: query // 确保参数正确传递
|
||||
})
|
||||
}
|
||||
|
||||
// 新增
|
||||
export function addPharmacyDepartment(data) {
|
||||
return request({
|
||||
url: '/base-data-manage/org-loc/org-loc',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
export function editPharmacyDepartment(data) {
|
||||
return request({
|
||||
url: '/base-data-manage/org-loc/org-loc',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
export function deletePharmacyDepartment(data) {
|
||||
return request({
|
||||
url: '/base-data-manage/org-loc/org-loc?orgLocId=' + data.orgLocId,
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
|
||||
// 目录分类查询
|
||||
export function getDiseaseTreatmentInit(id) {
|
||||
return request({
|
||||
url: '/base-data-manage/org-loc/init/',
|
||||
method: 'get',
|
||||
params: { id } // 确保参数正确传递
|
||||
})
|
||||
}
|
||||
|
||||
// 目录分类子查询
|
||||
export function getDiseaseTreatmentInitLoc(id) {
|
||||
return request({
|
||||
url: '/base-data-manage/org-loc/loc-list?locationForm=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,387 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="20">
|
||||
<!--诊疗目录-->
|
||||
<el-col :span="4" :xs="24">
|
||||
<div class="head-title">取药科室</div>
|
||||
<div>
|
||||
<el-tree
|
||||
:data="pharmacyDepartmentOptions"
|
||||
:props="{ label: 'label', children: 'children' }"
|
||||
:expand-on-click-node="false"
|
||||
:filter-node-method="filterNode"
|
||||
ref="treeRef"
|
||||
node-key="id"
|
||||
check-strictly
|
||||
default-expand-all
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
<!--诊疗目录-->
|
||||
<el-col :span="20" :xs="24">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="openAddPharmacyDepartment"
|
||||
v-hasPermi="['system:user:add']"
|
||||
>添加新项目</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="diagnosisTreatmentList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<!-- <el-table-column type="selection" width="50" align="center" /> -->
|
||||
<el-table-column
|
||||
label="取药科室"
|
||||
align="center"
|
||||
key="name"
|
||||
prop="name"
|
||||
:show-overflow-tooltip="true"
|
||||
>
|
||||
<template #default="scope">
|
||||
<div style="display: flex; align-items: center; justify-content: center">
|
||||
<el-select
|
||||
v-model="scope.row.organizationId"
|
||||
placeholder="请选择"
|
||||
:class="{ 'error-border': scope.row.error }"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in departmentOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="药品类别"
|
||||
align="center"
|
||||
key="pyStr"
|
||||
prop="pyStr"
|
||||
:show-overflow-tooltip="true"
|
||||
width="300"
|
||||
>
|
||||
<template #default="scope">
|
||||
<div style="display: flex; align-items: center; justify-content: center">
|
||||
<el-select
|
||||
v-model="scope.row.distributionCategoryCode"
|
||||
placeholder="药品类别"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
:class="{ 'error-border': scope.row.error }"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in distribution_category_code"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="开始时间"
|
||||
align="center"
|
||||
key="wbStr"
|
||||
prop="wbStr"
|
||||
:show-overflow-tooltip="true"
|
||||
width="300"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-time-picker
|
||||
v-model="scope.row.startTime"
|
||||
placeholder="选择时间"
|
||||
format="HH:mm:ss"
|
||||
value-format="HH:mm:ss"
|
||||
>
|
||||
</el-time-picker>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="结束时间"
|
||||
align="center"
|
||||
key="categoryCode_dictText"
|
||||
prop="categoryCode_dictText"
|
||||
:show-overflow-tooltip="true"
|
||||
width="300"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-time-picker
|
||||
v-model="scope.row.endTime"
|
||||
placeholder="选择时间"
|
||||
format="HH:mm:ss"
|
||||
value-format="HH:mm:ss"
|
||||
>
|
||||
</el-time-picker>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="备注" align="center" key="typeEnum_enumText" prop="typeEnum_enumText"
|
||||
:show-overflow-tooltip="true" width="300">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.detailJson" placeholder="" />
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
width="150"
|
||||
class-name="small-padding fixed-width"
|
||||
fixed="right"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
@click="openSavePharmacyDepartment(scope.row, scope.$index)"
|
||||
v-hasPermi="['system:user:edit']"
|
||||
>保存</el-button
|
||||
>
|
||||
<el-button
|
||||
type="danger"
|
||||
link
|
||||
icon="Delete"
|
||||
:disabled="scope.row.id == ''"
|
||||
@click="deleteSelectedRows(scope.row)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="pharmacyDepartment">
|
||||
import {
|
||||
getPharmacyDepartmentList,
|
||||
getDiseaseTreatmentInit,
|
||||
getPharmacyDepartmentOne,
|
||||
getDiseaseTreatmentInitLoc,
|
||||
addPharmacyDepartment,
|
||||
editPharmacyDepartment,
|
||||
deletePharmacyDepartment,
|
||||
} from './components/pharmacyDepartment';
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { distribution_category_code } = proxy.useDict('distribution_category_code');
|
||||
import { nextTick } from 'vue';
|
||||
|
||||
const diagnosisTreatmentList = ref([]);
|
||||
const loading = ref(false);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]); // 存储选择的行数据
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref('');
|
||||
const pharmacyDepartmentOptions = ref(undefined);
|
||||
const currentCategoryEnum = ref('');
|
||||
const departmentOptions = ref([]);
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
tableRules: {
|
||||
organizationId: [{ required: true, message: '取药科室不能为空', trigger: 'blur' }],
|
||||
distributionCategoryCode: [{ required: true, message: '药品类别不能为空', trigger: 'blur' }],
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams, form, tableRules } = toRefs(data);
|
||||
|
||||
/** 通过条件过滤节点 */
|
||||
const filterNode = (value, data) => {
|
||||
if (!value) return true;
|
||||
return data.label.indexOf(value) !== -1;
|
||||
};
|
||||
|
||||
/** 目录分类查询 */
|
||||
function getDiseaseTreatmentList() {
|
||||
getDiseaseTreatmentInit().then((response) => {
|
||||
console.log(response, 'response诊疗目录分类查询下拉树结构');
|
||||
pharmacyDepartmentOptions.value = response.data.locationFormOptions;
|
||||
departmentOptions.value = response.data.departmentOptions;
|
||||
// 调用 getDiseaseInitLoc 并在 then 回调中赋值
|
||||
getDiseaseInitLoc(response.data.locationFormOptions[0].value).then((children) => {
|
||||
pharmacyDepartmentOptions.value[0].children = children;
|
||||
});
|
||||
|
||||
getDiseaseInitLoc(response.data.locationFormOptions[1].value).then((children) => {
|
||||
pharmacyDepartmentOptions.value[1].children = children;
|
||||
});
|
||||
|
||||
console.log(pharmacyDepartmentOptions.value);
|
||||
});
|
||||
}
|
||||
|
||||
function getDiseaseInitLoc(id) {
|
||||
return getDiseaseTreatmentInitLoc(id).then((response) => {
|
||||
return response.data.locationOptions;
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取绑定科室列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
getPharmacyDepartmentList(queryParams.value).then((res) => {
|
||||
loading.value = false;
|
||||
if (res.code === 200) {
|
||||
diagnosisTreatmentList.value =
|
||||
res.data.records.length > 0
|
||||
? res.data.records.map((res) => {
|
||||
return {
|
||||
...res,
|
||||
isEditing: false, // 标记当前行是否正在编辑
|
||||
error: false, // 新增 error 字段
|
||||
};
|
||||
})
|
||||
: [];
|
||||
}
|
||||
console.log(diagnosisTreatmentList.value, 'res.data');
|
||||
total.value = res.data.total;
|
||||
});
|
||||
}
|
||||
/** 节点单击事件 */
|
||||
function handleNodeClick(data, node) {
|
||||
// 检查节点是否有子节点
|
||||
if (node.data.children && node.data.children.length > 0) {
|
||||
proxy.$message.warning('不能选择父节点');
|
||||
return;
|
||||
}
|
||||
queryParams.value.defLocationId = data.value;
|
||||
currentCategoryEnum.value = data.value;
|
||||
handleQuery();
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNo = 1;
|
||||
console.log(queryParams, 'queryParams搜索');
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 选择条数 */
|
||||
function handleSelectionChange(selection) {
|
||||
console.log(selection, 'selection');
|
||||
// selectedData.value = selection.map((item) => ({ ...item })); // 存储选择的行数据
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
function openAddPharmacyDepartment() {
|
||||
if (data.isAdding) {
|
||||
proxy.$message.warning('请先保存当前行后再新增!');
|
||||
return;
|
||||
}
|
||||
const newRow = {
|
||||
id: '',
|
||||
organizationId: '',
|
||||
defLocationId: '',
|
||||
distributionCategoryCode: '',
|
||||
startTime: '00:00:00',
|
||||
endTime: '23:59:59',
|
||||
isEditing: true, // 标记当前行是否正在编辑
|
||||
error: false, // 新增 error 字段
|
||||
};
|
||||
diagnosisTreatmentList.value.push(newRow);
|
||||
total.value = diagnosisTreatmentList.value.length;
|
||||
data.isAdding = true; // 设置标志位为 true,表示有未保存的
|
||||
}
|
||||
|
||||
function handleBlur(row, index) {
|
||||
console.log(row);
|
||||
let hasError = false;
|
||||
const fields = ['organizationId', 'distributionCategoryCode'];
|
||||
|
||||
fields.forEach((field) => {
|
||||
if (!row[field]) {
|
||||
hasError = true;
|
||||
console.log(tableRules.value[field]);
|
||||
proxy.$message.error(tableRules.value[field][0].message);
|
||||
}
|
||||
});
|
||||
|
||||
console.log(hasError);
|
||||
|
||||
row.error = hasError;
|
||||
}
|
||||
|
||||
function openSavePharmacyDepartment(row) {
|
||||
console.log(row, 'row');
|
||||
let params = { ...row };
|
||||
let hasError = false;
|
||||
// this.purchaseinventoryList.forEach((row) => {
|
||||
handleBlur(row);
|
||||
if (row.error) {
|
||||
hasError = true;
|
||||
}
|
||||
// });
|
||||
|
||||
if (hasError) {
|
||||
proxy.$message.error('请填写完整信息');
|
||||
return;
|
||||
}
|
||||
if (currentCategoryEnum.value) {
|
||||
params.defLocationId = currentCategoryEnum.value;
|
||||
}
|
||||
if (row.id) {
|
||||
editPharmacyDepartment(params).then((res) => {
|
||||
data.isAdding = false; // 允许新增下一行
|
||||
proxy.$message.success('保存成功!');
|
||||
console.log(res, 'res');
|
||||
});
|
||||
} else {
|
||||
delete params.id;
|
||||
addPharmacyDepartment(params).then((res) => {
|
||||
console.log(res, 'res');
|
||||
proxy.$message.success('保存成功!');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function deleteSelectedRows(row) {
|
||||
deletePharmacyDepartment({ orgLocId: row.id }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess('删除成功');
|
||||
getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getDiseaseTreatmentList();
|
||||
</script>
|
||||
<style scoped>
|
||||
.el-form--inline .el-form-item {
|
||||
display: inline-flex;
|
||||
vertical-align: middle;
|
||||
margin-right: 10px !important;
|
||||
}
|
||||
.error-border {
|
||||
border: 1px solid red;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
import request from '@/utils/request'
|
||||
import { parseStrEmpty } from "@/utils/openhis";
|
||||
|
||||
// 查询厂商列表
|
||||
export function getSupplierList(query) {
|
||||
return request({
|
||||
url: '/data-dictionary/supplier/get-supplier-list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询厂商详细
|
||||
export function getSupplierOne(id) {
|
||||
return request({
|
||||
url: '/data-dictionary/supplier/get-supplier-detail',
|
||||
method: 'get',
|
||||
params: {id}
|
||||
})
|
||||
}
|
||||
|
||||
// 新增厂商
|
||||
export function addSupplier(data) {
|
||||
return request({
|
||||
url: '/data-dictionary/supplier/add-supplier',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改厂商
|
||||
export function editSupplier(data) {
|
||||
return request({
|
||||
url: '/data-dictionary/supplier/edit-supplier',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// // 删除厂商
|
||||
// export function delUser(userId) {
|
||||
// return request({
|
||||
// url: '/system/user/' + userId,
|
||||
// method: 'delete'
|
||||
// })
|
||||
// }
|
||||
|
||||
// 停用厂商
|
||||
export function stopSupplier(ids) {
|
||||
return request({
|
||||
url: '/data-dictionary/supplier/information-stop',
|
||||
method: 'put',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
// 启用厂商
|
||||
export function startSupplier(ids) {
|
||||
return request({
|
||||
url: '/data-dictionary/supplier/information-start',
|
||||
method: 'put',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
// 查询厂商类型
|
||||
export function getSupplierInit() {
|
||||
return request({
|
||||
url: '/data-dictionary/supplier/information-init',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询部门树结构
|
||||
export function deptTreeSelect(queryParams) {
|
||||
return request({
|
||||
url: '/base-data-manage/organization/organization',
|
||||
method: 'get',
|
||||
param: queryParams
|
||||
})
|
||||
}
|
||||
526
openhis-ui-vue3/src/views/basicmanage/supplier/index.vue
Normal file
526
openhis-ui-vue3/src/views/basicmanage/supplier/index.vue
Normal file
@@ -0,0 +1,526 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryRef"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="90px"
|
||||
>
|
||||
<el-form-item label="厂家名称:" prop="searchKey">
|
||||
<el-input
|
||||
v-model="queryParams.searchKey"
|
||||
placeholder="品名/商品名/英文品名/编码/拼音"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="厂商种类:" prop="typeEnum">
|
||||
<el-select
|
||||
v-model="queryParams.typeEnum"
|
||||
placeholder="生产商/供应商"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in supplierTypeOptions"
|
||||
:key="dict.value"
|
||||
:label="dict.info"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
>添加</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Remove"
|
||||
:disabled="multiple"
|
||||
@click="handleClose"
|
||||
>停用</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="CirclePlus"
|
||||
:disabled="multiple"
|
||||
@click="handleStart"
|
||||
>启用</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Search"
|
||||
@click="getList"
|
||||
>查询</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="CircleClose"
|
||||
@click="handleClear"
|
||||
>清空条件</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="supplierList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="编号" align="center" key="busNo" prop="busNo" />
|
||||
<el-table-column
|
||||
label="名称"
|
||||
align="center"
|
||||
key="name"
|
||||
prop="name"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="拼音助记码"
|
||||
align="center"
|
||||
key="pyStr"
|
||||
prop="pyStr"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="类型 "
|
||||
align="center"
|
||||
key="typeEnum_enumText"
|
||||
prop="typeEnum_enumText"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="地址"
|
||||
align="center"
|
||||
key="address"
|
||||
prop="address"
|
||||
width="120"
|
||||
/>
|
||||
<el-table-column
|
||||
label="联系人电话"
|
||||
align="center"
|
||||
key="phone"
|
||||
prop="phone"
|
||||
/>
|
||||
<el-table-column
|
||||
label="联系人邮箱"
|
||||
align="center"
|
||||
key="email"
|
||||
prop="email"
|
||||
width="160"
|
||||
/>
|
||||
<el-table-column
|
||||
label="活动标识"
|
||||
align="center"
|
||||
key="activeFlag_enumText"
|
||||
prop="activeFlag_enumText"
|
||||
width="160"
|
||||
/>
|
||||
<el-table-column
|
||||
label="机构"
|
||||
align="center"
|
||||
key="orgId_dictText"
|
||||
prop="orgId_dictText"
|
||||
width="160"
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
width="150"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="View"
|
||||
@click="handleView(scope.row)"
|
||||
>查看</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改用户配置对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="600px" append-to-body>
|
||||
<el-form
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
ref="supplierRef"
|
||||
label-width="110px"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input
|
||||
v-model="form.name"
|
||||
placeholder="请输入名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.id != undefined">
|
||||
<el-form-item label="编码" prop="busNo">
|
||||
<el-input
|
||||
v-model="form.busNo"
|
||||
placeholder="请输入编码"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- <el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="拼音" prop="pyStr">
|
||||
<el-input v-model="form.pyStr" maxlength="11" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="五笔码" prop="wbStr">
|
||||
<el-input v-model="form.wbStr" maxlength="11" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row> -->
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="类型" prop="typeEnum">
|
||||
<!-- <el-input v-model="form.typeEnum" maxlength="11" /> -->
|
||||
<el-select
|
||||
v-model="form.typeEnum"
|
||||
placeholder="生产商/供应商"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in supplierTypeOptions"
|
||||
:key="dict.value"
|
||||
:label="dict.info"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="地址" prop="address">
|
||||
<el-input v-model="form.address" maxlength="255" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系人电话" prop="phone">
|
||||
<el-input v-model="form.phone" maxlength="11" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系人邮箱" prop="email">
|
||||
<el-input v-model="form.email" maxlength="255" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="活动标识" prop="activeFlag">
|
||||
<el-checkbox v-model="form.activeFlag"></el-checkbox>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<!-- <el-form-item label="机构编号" prop="orgId"> -->
|
||||
<!-- <el-input v-model="form.orgId" maxlength="11" /> -->
|
||||
<el-form-item label="提供部门" prop="orgId">
|
||||
<el-tree-select
|
||||
v-model="form.orgId"
|
||||
:data="deptOptions"
|
||||
:props="{ value: 'id', label: 'name', children: 'children' }"
|
||||
value-key="id"
|
||||
placeholder="请选择提供部门"
|
||||
check-strictly
|
||||
clearable
|
||||
/>
|
||||
<!-- </el-form-item> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer v-if="title != '查看'">
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Supplier">
|
||||
import {
|
||||
getSupplierList,
|
||||
editSupplier,
|
||||
addSupplier,
|
||||
getSupplierOne,
|
||||
stopSupplier,
|
||||
startSupplier,
|
||||
getSupplierInit,
|
||||
deptTreeSelect,
|
||||
} from "./components/supplier";
|
||||
|
||||
const router = useRouter();
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_normal_disable, sys_user_sex } = proxy.useDict(
|
||||
"sys_normal_disable",
|
||||
"sys_user_sex"
|
||||
);
|
||||
|
||||
const supplierList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const supplierTypeOptions = ref(undefined);
|
||||
const deptOptions = ref(undefined); // 部门树选项
|
||||
// 是否停用
|
||||
const statusFlagOptions = ref(undefined);
|
||||
// const initPassword = ref(undefined);
|
||||
// const postOptions = ref([]);
|
||||
// const roleOptions = ref([]);
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
searchKey: undefined, // 供应商名称
|
||||
// busNo: undefined, // 编码
|
||||
typeEnum: undefined, // 状态(包括 1:预置,2:启用,3:停用)
|
||||
// sourceEnum: undefined, // 来源(包括 1:厂商/产地目录分类,2:自定义)
|
||||
},
|
||||
rules: {
|
||||
name: [{ required: true, message: "名称不能为空", trigger: "blur" }],
|
||||
typeEnum: [{ required: true, message: "类型不能为空", trigger: "blur" }],
|
||||
// address: [{ required: true, message: "地址不能为空", trigger: "blur" }],
|
||||
// phone: [{ required: true, message: "联系人电话不能为空", trigger: "blur" }],
|
||||
// email: [{ required: true, message: "联系人邮箱不能为空", trigger: "blur" },
|
||||
// { validator: validateEmail, trigger: 'blur' }
|
||||
// ],
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 验证邮箱地址是否有效*/
|
||||
function validateEmail (rule, value, callback) {
|
||||
const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
||||
if (!emailRegex.test(value)) {
|
||||
callback(new Error('请输入有效的邮箱地址'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
/** 厂商种类查询下拉树结构 */
|
||||
function getsupplierTypeList() {
|
||||
getSupplierInit().then((response) => {
|
||||
console.log(response, "response");
|
||||
supplierTypeOptions.value = response.data.supplierTypeOptions;
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询部门下拉树结构 */
|
||||
function getDeptTree() {
|
||||
console.log("查询部门下拉树结构");
|
||||
deptTreeSelect().then((response) => {
|
||||
console.log(response, "response查询部门下拉树结构");
|
||||
deptOptions.value = response.data.records;
|
||||
console.log(deptOptions.value, "部门下拉树结构");
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询厂商/产地目录列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
// queryParams.value.statusEnum = +queryParams.value.statusEnum
|
||||
console.log(queryParams.value, "queryParams.value");
|
||||
getSupplierList(queryParams.value).then((res) => {
|
||||
loading.value = false;
|
||||
console.log(res, "res", res.data.records);
|
||||
supplierList.value = res.data.records;
|
||||
console.log(supplierList.value, "supplierList.value");
|
||||
total.value = res.data.total;
|
||||
console.log(total.value, "total.value");
|
||||
});
|
||||
}
|
||||
/** 节点单击事件 */
|
||||
function handleNodeClick(data) {
|
||||
queryParams.value.sourceEnum = data.id;
|
||||
handleQuery();
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNo = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 启用按钮操作 */
|
||||
function handleStart(row) {
|
||||
const stardIds = row.id || ids.value;
|
||||
proxy.$modal
|
||||
.confirm("是否确定启用数据!")
|
||||
.then(function () {
|
||||
return startSupplier(stardIds);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("启用成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
/** 停用按钮操作 */
|
||||
function handleClose(row) {
|
||||
const stopIds = row.id || ids.value;
|
||||
proxy.$modal
|
||||
.confirm("是否确认停用数据!")
|
||||
.then(function () {
|
||||
return stopSupplier(stopIds);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("停用成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
/** 清空条件按钮操作 */
|
||||
function handleClear() {
|
||||
// queryParams.value.pageNo = 1;
|
||||
// queryParams.value.searchKey = undefined;
|
||||
// queryParams.value.statusEnum = undefined;
|
||||
// queryParams.value.sourceEnum = undefined;
|
||||
// queryParams.value.busNo = undefined;
|
||||
// 清空查询条件
|
||||
proxy.resetForm("queryRef");
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 选择条数 */
|
||||
function handleSelectionChange(selection) {
|
||||
console.log(selection, "selection");
|
||||
// selectedData.value = selection.map((item) => ({ ...item })); // 存储选择的行数据
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 重置操作表单 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: undefined,
|
||||
conditionCode: undefined,
|
||||
pyStr: undefined,
|
||||
status: undefined,
|
||||
statusEnum: undefined,
|
||||
};
|
||||
proxy.resetForm("supplierRef");
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "新增";
|
||||
}
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
console.log(row, "row");
|
||||
form.value = JSON.parse(JSON.stringify(row));
|
||||
form.value.activeFlag == 1 ? (form.value.activeFlag = true) : (form.value.activeFlag = false); //是否为活性
|
||||
// console.log(form.value.ty, "form.value");
|
||||
open.value = true;
|
||||
title.value = "厂商/产地编辑";
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["supplierRef"].validate((valid) => {
|
||||
if (valid) {
|
||||
form.value.activeFlag == true ? (form.value.activeFlag = 1) : (form.value.activeFlag = 0); //是否为活性
|
||||
console.log(form.value, "*****************");
|
||||
if (form.value.id != undefined) {
|
||||
console.log(form.value, "editSupplier");
|
||||
editSupplier(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addSupplier(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 详细按钮操作 */
|
||||
function handleView(row) {
|
||||
reset();
|
||||
title.value = "查看";
|
||||
open.value = true;
|
||||
getSupplierOne(row.id).then((response) => {
|
||||
console.log(response, "responsebbbb", row.id);
|
||||
form.value = response.data;
|
||||
});
|
||||
}
|
||||
getsupplierTypeList();
|
||||
getList();
|
||||
getDeptTree();
|
||||
</script>
|
||||
<style scoped>
|
||||
.custom-tree-node {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,2 @@
|
||||
<template>
|
||||
</template>
|
||||
90
openhis-ui-vue3/src/views/basicmanage/ward/components/api.js
Normal file
90
openhis-ui-vue3/src/views/basicmanage/ward/components/api.js
Normal file
@@ -0,0 +1,90 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 收费患者列表
|
||||
*/
|
||||
export function getList(queryParams) {
|
||||
return request({
|
||||
url: '/base-data-manage/location/location-page',
|
||||
method: 'get',
|
||||
params: queryParams
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取科室下拉列表
|
||||
*/
|
||||
export function getOrgList() {
|
||||
return request({
|
||||
url: '/base-data-manage/organization/organization',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*/
|
||||
export function init() {
|
||||
return request({
|
||||
url: '/base-data-manage/location/init',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增病区/床位/病房
|
||||
*/
|
||||
export function addLocation(data) {
|
||||
return request({
|
||||
url: '/base-data-manage/location/location',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑病区/床位/病房
|
||||
*/
|
||||
export function editLocation(data) {
|
||||
return request({
|
||||
url: '/base-data-manage/location/location',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增病区/床位/病房
|
||||
*/
|
||||
export function deleteLocation(busNo) {
|
||||
return request({
|
||||
url: '/base-data-manage/location/location?busNo=' + busNo,
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 启用病区/床位/病房
|
||||
*/
|
||||
export function enableLocation(data) {
|
||||
return request({
|
||||
url: '/base-data-manage/location/enable',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 停用病区/床位/病房
|
||||
*/
|
||||
export function unableLocation(data) {
|
||||
return request({
|
||||
url: '/base-data-manage/location/deactivate',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
541
openhis-ui-vue3/src/views/basicmanage/ward/index.vue
Normal file
541
openhis-ui-vue3/src/views/basicmanage/ward/index.vue
Normal file
@@ -0,0 +1,541 @@
|
||||
<template>
|
||||
<div style="display: flex; justify-content: space-between; height: 90vh" class="app-container">
|
||||
<el-card style="width: 30%">
|
||||
<template #header>
|
||||
<span style="vertical-align: middle">病区</span>
|
||||
</template>
|
||||
<div style="width: 100%">
|
||||
<el-button type="primary" @click="open = true" class="mb8"> 新增 </el-button>
|
||||
<el-button type="success" plain @click="handleEnableBatch('wardRef')" class="mb8">
|
||||
批量启用
|
||||
</el-button>
|
||||
<el-button type="primary" plain @click="handleUnableBatch('wardRef')" class="mb8">
|
||||
批量停用
|
||||
</el-button>
|
||||
<el-button style="float: right" @click="getWardList()" class="mb8" icon="refresh" />
|
||||
<el-table
|
||||
max-height="630"
|
||||
:data="wardList"
|
||||
@cell-click="(row) => clickRow(row, 10)"
|
||||
highlight-current-row
|
||||
ref="wardRef"
|
||||
>
|
||||
<el-table-column type="selection" :selectable="checkSelectable" width="55" />
|
||||
<el-table-column label="病区" align="center" prop="name" />
|
||||
<el-table-column label="病区号" align="center" prop="startTime">
|
||||
<template #default="scope">
|
||||
{{ getLastPartOfString(scope.row.busNo) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="statusEnum_enumText">
|
||||
<template #default="scope">
|
||||
<el-tag
|
||||
:type="
|
||||
scope.row.statusEnum === 1 || scope.row.statusEnum === 6
|
||||
? 'success'
|
||||
: scope.row.statusEnum === 2
|
||||
? 'primary'
|
||||
: 'warning'
|
||||
"
|
||||
>
|
||||
{{ scope.row.statusEnum_enumText }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="150">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" link @click.stop="handleEdit(scope.row)"> 编辑 </el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
:disabled="scope.row.statusEnum === 5"
|
||||
@click.stop="
|
||||
() => {
|
||||
handleUnable(scope.row, 10).then(() => {
|
||||
getWardList();
|
||||
});
|
||||
}
|
||||
"
|
||||
v-if="
|
||||
scope.row.statusEnum === 1 ||
|
||||
scope.row.statusEnum === 6 ||
|
||||
scope.row.statusEnum === 5
|
||||
"
|
||||
>
|
||||
停用
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
:disabled="scope.row.statusEnum === 5"
|
||||
@click.stop="
|
||||
() => {
|
||||
handleEnable(scope.row).then(() => {
|
||||
getWardList();
|
||||
});
|
||||
}
|
||||
"
|
||||
v-else-if="scope.row.statusEnum === 2"
|
||||
>
|
||||
启用
|
||||
</el-button>
|
||||
<el-button type="danger" link @click="handleDelete(scope.row)"> 删除 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
<div style="width: 69%; height: 100%; padding-bottom: 20px">
|
||||
<el-card style="margin-bottom: 20px">
|
||||
<template #header>
|
||||
<span style="vertical-align: middle">病房</span>
|
||||
</template>
|
||||
<el-button type="success" plain @click="handleEnableBatch('hourseRef')">批量启用</el-button>
|
||||
<el-button type="primary" plain @click="handleUnableBatch('hourseRef')">批量停用</el-button>
|
||||
<el-table
|
||||
height="280"
|
||||
:data="houseList"
|
||||
@cell-click="(row) => clickRow(row, 8)"
|
||||
highlight-current-row
|
||||
v-loading="loading"
|
||||
ref="hourseRef"
|
||||
>
|
||||
<el-table-column type="selection" :selectable="checkSelectable" width="55" />
|
||||
<el-table-column label="病房" align="center" prop="name" />
|
||||
<el-table-column label="病房号" align="center" prop="busNo">
|
||||
<template #default="scope">
|
||||
{{ getLastPartOfString(scope.row.busNo) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="statusEnum_enumText">
|
||||
<template #default="scope">
|
||||
<el-tag
|
||||
:type="
|
||||
scope.row.statusEnum === 1 || scope.row.statusEnum === 6
|
||||
? 'success'
|
||||
: scope.row.statusEnum === 2
|
||||
? 'primary'
|
||||
: 'warning'
|
||||
"
|
||||
>
|
||||
{{ scope.row.statusEnum_enumText }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" link @click.stop="handleEdit(scope.row, 4)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
:disabled="scope.row.statusEnum === 5"
|
||||
@click.stop="
|
||||
() => {
|
||||
handleUnable(scope.row).then(() => {
|
||||
clickRow(houseRow, 10);
|
||||
});
|
||||
}
|
||||
"
|
||||
v-if="
|
||||
scope.row.statusEnum === 1 ||
|
||||
scope.row.statusEnum === 6 ||
|
||||
scope.row.statusEnum === 5
|
||||
"
|
||||
>
|
||||
停用
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
:disabled="scope.row.statusEnum === 5"
|
||||
@click.stop="
|
||||
() => {
|
||||
handleEnable(scope.row).then(() => {
|
||||
clickRow(houseRow, 10);
|
||||
});
|
||||
}
|
||||
"
|
||||
v-else-if="scope.row.statusEnum === 2"
|
||||
>
|
||||
启用
|
||||
</el-button>
|
||||
<el-button type="danger" link @click="handleDelete(scope.row)"> 删除 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<template #header>
|
||||
<span style="vertical-align: middle">床位</span>
|
||||
</template>
|
||||
<el-button type="success" plain @click="handleEnableBatch('bedRef')">批量启用</el-button>
|
||||
<el-button type="primary" plain @click="handleUnableBatch('bedRef')">批量停用</el-button>
|
||||
<el-table ref="bedRef" height="270" :data="bedList" v-loading="loading" width="">
|
||||
<el-table-column type="selection" :selectable="checkSelectable" width="55" />
|
||||
<el-table-column label="病床" align="center" prop="name" />
|
||||
<el-table-column label="病床号" align="center" prop="busNo">
|
||||
<template #default="scope">
|
||||
{{ getLastPartOfString(scope.row.busNo) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="statusEnum_enumText">
|
||||
<template #default="scope">
|
||||
<el-tag
|
||||
:type="
|
||||
scope.row.statusEnum === 1 || scope.row.statusEnum === 6
|
||||
? 'success'
|
||||
: scope.row.statusEnum === 2
|
||||
? 'primary'
|
||||
: 'warning'
|
||||
"
|
||||
>{{ scope.row.statusEnum_enumText }}</el-tag
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" link @click.stop="handleEdit(scope.row, 10)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
:disabled="scope.row.statusEnum === 5"
|
||||
@click.stop="
|
||||
() => {
|
||||
handleUnable(scope.row, 10).then(() => {
|
||||
clickRow(bedRow, 8);
|
||||
});
|
||||
}
|
||||
"
|
||||
v-if="
|
||||
scope.row.statusEnum === 1 ||
|
||||
scope.row.statusEnum === 6 ||
|
||||
scope.row.statusEnum === 5
|
||||
"
|
||||
>
|
||||
停用
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
:disabled="scope.row.statusEnum === 5"
|
||||
@click.stop="
|
||||
() => {
|
||||
handleEnable(scope.row, 10).then(() => {
|
||||
clickRow(bedRow, 8);
|
||||
});
|
||||
}
|
||||
"
|
||||
v-else-if="scope.row.statusEnum === 2"
|
||||
>
|
||||
启用
|
||||
</el-button>
|
||||
<el-button type="danger" link @click="handleDelete(scope.row)"> 删除 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
<el-dialog :title="title" v-model="open" width="600px" @close="cancel" append-to-body>
|
||||
<el-form ref="orgRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="id" prop="id" v-show="false">
|
||||
<el-input v-model="form.id" placeholder="请输入科室编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="科室编号" prop="busNo" v-show="false">
|
||||
<el-input v-model="form.busNo" placeholder="请输入科室编号" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="type + '分类'" prop="formEnum">
|
||||
<el-radio-group v-model="form.formEnum" @change="handleRadioChange" :disabled="isEdit">
|
||||
<el-radio :label="4">病区</el-radio>
|
||||
<el-radio :label="10">病房</el-radio>
|
||||
<el-radio :label="8">床位</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item :label="type + '名称'" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入科室名称" />
|
||||
</el-form-item>
|
||||
<el-col>
|
||||
<el-form-item :label="upLabel" prop="busNoParent">
|
||||
<template v-if="form.formEnum == 4">
|
||||
<el-tree-select
|
||||
clearable
|
||||
style="width: 100%"
|
||||
v-model="form.busNoParent"
|
||||
filterable
|
||||
:data="organization"
|
||||
:props="{
|
||||
value: 'id',
|
||||
label: 'name',
|
||||
children: 'children',
|
||||
}"
|
||||
value-key="id"
|
||||
check-strictly
|
||||
placeholder="请选择上级科室/病区/床位"
|
||||
/>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-select
|
||||
v-model="form.busNoParent"
|
||||
placeholder="请选择上级科室/病区/床位"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in wardListOption"
|
||||
:key="item.busNo"
|
||||
:label="item.name"
|
||||
:value="item.busNo"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Ward">
|
||||
import {
|
||||
getList,
|
||||
addLocation,
|
||||
getOrgList,
|
||||
deleteLocation,
|
||||
editLocation,
|
||||
unableLocation,
|
||||
enableLocation,
|
||||
} from './components/api';
|
||||
const { proxy } = getCurrentInstance();
|
||||
const queryParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 50,
|
||||
formEnum: 4,
|
||||
// locationFormList: [4],
|
||||
});
|
||||
const type = ref('病区');
|
||||
const wardList = ref([]);
|
||||
const bedList = ref([]);
|
||||
const houseList = ref([]);
|
||||
const wardListOption = ref([]);
|
||||
const organization = ref([]);
|
||||
const loading = ref(false);
|
||||
const isEdit = ref(false);
|
||||
const open = ref(false);
|
||||
const bedRow = ref({});
|
||||
const houseRow = ref({});
|
||||
const form = reactive({
|
||||
formEnum: 4,
|
||||
});
|
||||
const upLabel = ref('关联科室');
|
||||
const title = ref('新增');
|
||||
const rules = ref({
|
||||
name: [
|
||||
{ required: true, message: '请输入科室名称', trigger: 'blur' },
|
||||
{ min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' },
|
||||
],
|
||||
busNoParent: [
|
||||
{
|
||||
required: form.formEnum != 4,
|
||||
message: '请选择上级' + type.value,
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
});
|
||||
/**
|
||||
* 病区列表
|
||||
*/
|
||||
function getWardList() {
|
||||
queryParams.value.formEnum = 4;
|
||||
getList(queryParams.value).then((res) => {
|
||||
wardList.value = res.data.records;
|
||||
});
|
||||
}
|
||||
|
||||
function init() {
|
||||
getOrgList().then((res) => {
|
||||
organization.value = res.data.records;
|
||||
});
|
||||
}
|
||||
|
||||
function handleRadioChange(val) {
|
||||
if (val == 4) {
|
||||
type.value = '病区';
|
||||
upLabel.value = '关联科室';
|
||||
return;
|
||||
} else if (val == 10) {
|
||||
type.value = '病房';
|
||||
upLabel.value = '所属病区';
|
||||
queryParams.value.formEnum = 4;
|
||||
} else {
|
||||
type.value = '床位';
|
||||
upLabel.value = '所属病房';
|
||||
queryParams.value.formEnum = 10;
|
||||
}
|
||||
getList(queryParams.value).then((res) => {
|
||||
wardListOption.value = res.data.records;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 点击患者列表行 获取处方列表
|
||||
*/
|
||||
function clickRow(row, val) {
|
||||
loading.value = true;
|
||||
queryParams.value.formEnum = val;
|
||||
queryParams.value.busNo = row.busNo;
|
||||
bedList.value = [];
|
||||
getList(queryParams.value).then((res) => {
|
||||
if (val == 10) {
|
||||
houseList.value = res.data.records;
|
||||
houseRow.value = row;
|
||||
} else if (val == 8) {
|
||||
bedRow.value = row;
|
||||
bedList.value = res.data.records;
|
||||
}
|
||||
setTimeout(() => {
|
||||
queryParams.value.busNo = undefined;
|
||||
loading.value = false;
|
||||
}, 100);
|
||||
});
|
||||
}
|
||||
|
||||
function checkSelectable(row, index) {
|
||||
return row.statusEnum !== 5;
|
||||
}
|
||||
|
||||
function handleEnable(row) {
|
||||
return enableLocation([row.id]).then((res) => {
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess('启用成功');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function handleUnable(row) {
|
||||
return unableLocation([row.id]).then((res) => {
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess('停用成功');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function handleEnableBatch(tableRef) {
|
||||
let list = proxy.$refs[tableRef].getSelectionRows().map((item) => {
|
||||
return item.id;
|
||||
});
|
||||
if (list.length == 0) {
|
||||
proxy.$modal.msgError('请选择要启用的数据');
|
||||
return;
|
||||
}
|
||||
enableLocation(list).then((res) => {
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function handleUnableBatch(tableRef) {
|
||||
let list = proxy.$refs[tableRef].getSelectionRows().map((item) => {
|
||||
return item.id;
|
||||
});
|
||||
if (list.length == 0) {
|
||||
proxy.$modal.msgError('请选择要停用的数据');
|
||||
return;
|
||||
}
|
||||
unableLocation(list).then((res) => {
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function submitForm() {
|
||||
if (form.busNoParent) {
|
||||
if (form.formEnum == 4) {
|
||||
form.organizationId = form.busNoParent;
|
||||
} else {
|
||||
form.busNo = form.busNoParent;
|
||||
}
|
||||
}
|
||||
console.log(form);
|
||||
if (!isEdit.value) {
|
||||
addLocation(form).then((res) => {
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess('操作成功');
|
||||
cancel();
|
||||
getWardList();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
editLocation(form).then((res) => {
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess('操作成功');
|
||||
cancel();
|
||||
getWardList();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function handleDelete(row) {
|
||||
deleteLocation(row.busNo).then((res) => {
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess('删除成功');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getLastPartOfString(str) {
|
||||
const parts = str.split('.');
|
||||
return parts.pop();
|
||||
}
|
||||
|
||||
function handleEdit(row, val) {
|
||||
form.id = row.id;
|
||||
form.name = row.name;
|
||||
form.formEnum = row.formEnum;
|
||||
form.busNo = row.busNo;
|
||||
if (row.organizationId) {
|
||||
form.busNoParent = row.organizationId;
|
||||
} else {
|
||||
form.busNoParent = row.busNo.split('.').slice(0, -1).join('.');
|
||||
}
|
||||
isEdit.value = true;
|
||||
title.value = '编辑';
|
||||
if (val) {
|
||||
queryParams.value.formEnum = val;
|
||||
getList(queryParams.value).then((res) => {
|
||||
wardListOption.value = res.data.records;
|
||||
});
|
||||
}
|
||||
open.value = true;
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
form.id = undefined;
|
||||
form.name = '';
|
||||
form.formEnum = 4;
|
||||
form.busNo = '';
|
||||
form.busNoParent = '';
|
||||
form.organizationId = '';
|
||||
isEdit.value = false;
|
||||
title.value = '新增';
|
||||
}
|
||||
|
||||
init();
|
||||
getWardList();
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
@@ -0,0 +1,66 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 新增
|
||||
export function addWarehouse(data) {
|
||||
return request({
|
||||
url: '/base-data-manage/location/location',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询菜单列表
|
||||
export function getList(query) {
|
||||
return request({
|
||||
url: '/base-data-manage/location/location-page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
export function init() {
|
||||
return request({
|
||||
url: '/base-data-manage/location/init',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
export function updateWarehouse(data) {
|
||||
return request({
|
||||
url: '/base-data-manage/location/location',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
export function deleteWarehouse(data) {
|
||||
return request({
|
||||
url: '/base-data-manage/location/location?locationId=' + data.locationId,
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 启用病区/床位/病房
|
||||
*/
|
||||
export function enableLocation(data) {
|
||||
return request({
|
||||
url: '/base-data-manage/location/enable',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 停用病区/床位/病房
|
||||
*/
|
||||
export function unableLocation(data) {
|
||||
return request({
|
||||
url: '/base-data-manage/location/deactivate',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,323 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true">
|
||||
<el-form-item label="" prop="searchKey">
|
||||
<el-input
|
||||
v-model="queryParams.searchKey"
|
||||
placeholder="仓库名称"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd"> 新增 </el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-tooltip
|
||||
:content="selectRowIds.length == 0 ? '至少选择一条数据' : ''"
|
||||
placement="top"
|
||||
:disabled="selectRowIds.length != 0"
|
||||
>
|
||||
<el-button
|
||||
type=""
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="selectRowIds.length == 0"
|
||||
@click="handleDelete"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-tooltip>
|
||||
</el-col> -->
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="" plain icon="Download" @click="handleExport">
|
||||
导出
|
||||
</el-button>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button type="" plain icon="Refresh" @click="getPageList">刷新</el-button>
|
||||
</el-col>
|
||||
<!-- <right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar> -->
|
||||
</el-row>
|
||||
<el-table
|
||||
ref="orgTableRef"
|
||||
v-loading="loading"
|
||||
:data="organization"
|
||||
row-key="id"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="仓库名称" align="left" prop="name" />
|
||||
<el-table-column label="仓库类型" align="center" prop="formEnum_enumText" />
|
||||
<!-- <el-table-column
|
||||
label="存放药品类型"
|
||||
align="center"
|
||||
prop="classEnum_dictText"
|
||||
/> -->
|
||||
<el-table-column label="是否使用" align="center" prop="operationalEnum_enumText" />
|
||||
<el-table-column label="停用状态" align="center" prop="statusEnum_enumText" />
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handelEdit(scope.row)">编辑</el-button>
|
||||
<!-- <el-button
|
||||
type="primary"
|
||||
link
|
||||
@click.stop="handleUnable(scope.row, 10)"
|
||||
v-if="scope.row.statusEnum === 1 || scope.row.statusEnum === 6"
|
||||
>
|
||||
停用
|
||||
</el-button>
|
||||
<el-button type="primary" link @click.stop="handleEnable(scope.row, 10)" v-else>
|
||||
启用
|
||||
</el-button> -->
|
||||
<el-button
|
||||
type="danger"
|
||||
link
|
||||
icon="Delete"
|
||||
:disabled="scope.row.busNo == ''"
|
||||
@click="handelDelete(scope.row)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改参数配置对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="600px" @close="cancel" append-to-body>
|
||||
<el-form ref="orgRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="id" prop="busNo" v-show="false">
|
||||
<el-input v-model="form.id" placeholder="请输入科室编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="formEnum">
|
||||
<el-select
|
||||
v-model="form.formEnum"
|
||||
placeholder="请选择类型"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
:disabled="editShow"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in warehous_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Organization">
|
||||
import {
|
||||
getList,
|
||||
addWarehouse,
|
||||
updateWarehouse,
|
||||
deleteWarehouse,
|
||||
enableLocation,
|
||||
unableLocation,
|
||||
// disableOrg,
|
||||
init,
|
||||
// enableOrg,
|
||||
} from './components/api';
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const loading = ref(true);
|
||||
const organization = ref([]);
|
||||
const queryParams = ref({
|
||||
locationFormList: [11, 16],
|
||||
});
|
||||
const open = ref(false);
|
||||
const form = ref({
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
formEnum: undefined,
|
||||
});
|
||||
const orgTableRef = ref();
|
||||
const orgRef = ref();
|
||||
const orgTypeOption = ref([]);
|
||||
const classEnumOption = ref([]);
|
||||
const selectRowIds = ref([]);
|
||||
const total = ref(0);
|
||||
const title = ref('');
|
||||
const editShow = ref(false);
|
||||
const { warehous_type } = proxy.useDict('warehous_type');
|
||||
const rules = ref({
|
||||
busNo: [{ required: false, message: '请输入科室编号', trigger: 'change' }],
|
||||
name: [
|
||||
{ required: true, message: '请输入仓库名称', trigger: 'change' },
|
||||
{ min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'change' },
|
||||
],
|
||||
formEnum: [{ required: true, message: '请选择仓库类型', trigger: 'change' }],
|
||||
});
|
||||
|
||||
getPageList();
|
||||
initOption();
|
||||
function initOption() {
|
||||
if (orgTypeOption.value.length == 0) {
|
||||
init().then((res) => {
|
||||
orgTypeOption.value = res.data.organizationTypeOptions;
|
||||
classEnumOption.value = res.data.organizationClassOptions;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
formEnum: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNo = 1;
|
||||
getPageList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm('queryRef');
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
function handleEnable(row) {
|
||||
enableLocation([row.id]).then((res) => {
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess('启用成功');
|
||||
handleQuery();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function handleUnable(row) {
|
||||
unableLocation([row.id]).then((res) => {
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess('停用成功');
|
||||
handleQuery();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getPageList() {
|
||||
loading.value = true;
|
||||
getList(queryParams.value).then((res) => {
|
||||
organization.value = res.data.records.map((record) => {
|
||||
return {
|
||||
...record,
|
||||
formEnum: record.formEnum.toString(), // 确保 formEnum 是字符串
|
||||
};
|
||||
});
|
||||
total.value = res.data.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
title.value = '添加药库药房';
|
||||
open.value = true;
|
||||
editShow.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
function handelEdit(row) {
|
||||
console.log(warehous_type);
|
||||
title.value = '编辑药库药房';
|
||||
open.value = true;
|
||||
editShow.value = true;
|
||||
setTimeout(() => {
|
||||
form.value.id = row.id;
|
||||
form.value.name = row.name;
|
||||
form.value.formEnum = row.formEnum.toString();
|
||||
}, 10);
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
console.log(form.value);
|
||||
}
|
||||
|
||||
// 新增/编辑
|
||||
function submitForm() {
|
||||
proxy.$refs['orgRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.busNoParent) {
|
||||
form.value.busNo = form.value.busNoParent;
|
||||
}
|
||||
if (form.value.id == undefined) {
|
||||
addWarehouse(form.value).then((res) => {
|
||||
proxy.$modal.msgSuccess('操作成功');
|
||||
open.value = false;
|
||||
getPageList();
|
||||
});
|
||||
} else {
|
||||
alert('456789');
|
||||
updateWarehouse(form.value).then((res) => {
|
||||
proxy.$modal.msgSuccess('操作成功');
|
||||
open.value = false;
|
||||
getPageList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 删除
|
||||
function handelDelete(data) {
|
||||
loading.value = true;
|
||||
deleteWarehouse({ locationId: data.id }).then((res) => {
|
||||
proxy.$modal.msgSuccess('操作成功');
|
||||
loading.value = false;
|
||||
getPageList();
|
||||
});
|
||||
}
|
||||
// // 停用
|
||||
// function handleDisabled(id) {
|
||||
// disableOrg(id).then((res) => {
|
||||
// proxy.$modal.msgSuccess("操作成功");
|
||||
// getPageList();
|
||||
// });
|
||||
// }
|
||||
|
||||
// // 启用
|
||||
// function handelEnable(id) {
|
||||
// enableOrg(id).then((res) => {
|
||||
// proxy.$modal.msgSuccess("操作成功");
|
||||
// getPageList();
|
||||
// });
|
||||
// }
|
||||
|
||||
function handleSelectionChange() {
|
||||
selectRowIds.value = orgTableRef.value.getSelectionRows().map((item) => item.id);
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user