fix: 新功能开发,原有功能优化。
This commit is contained in:
44
src/api/health/activity.js
Normal file
44
src/api/health/activity.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询活动记录列表
|
||||
export function listActivity(query) {
|
||||
return request({
|
||||
url: '/health/activity/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询活动记录详细
|
||||
export function getActivity(id) {
|
||||
return request({
|
||||
url: '/health/activity/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增活动记录
|
||||
export function addActivity(data) {
|
||||
return request({
|
||||
url: '/health/activity',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改活动记录
|
||||
export function updateActivity(data) {
|
||||
return request({
|
||||
url: '/health/activity',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除活动记录
|
||||
export function delActivity(id) {
|
||||
return request({
|
||||
url: '/health/activity/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
src/api/health/heightWeightRecord.js
Normal file
44
src/api/health/heightWeightRecord.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询身高体重记录列表
|
||||
export function listHeightWeightRecord(query) {
|
||||
return request({
|
||||
url: '/health/heightWeightRecord/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询身高体重记录详细
|
||||
export function getHeightWeightRecord(id) {
|
||||
return request({
|
||||
url: '/health/heightWeightRecord/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增身高体重记录
|
||||
export function addHeightWeightRecord(data) {
|
||||
return request({
|
||||
url: '/health/heightWeightRecord',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改身高体重记录
|
||||
export function updateHeightWeightRecord(data) {
|
||||
return request({
|
||||
url: '/health/heightWeightRecord',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除身高体重记录
|
||||
export function delHeightWeightRecord(id) {
|
||||
return request({
|
||||
url: '/health/heightWeightRecord/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
src/api/health/medicineBasic.js
Normal file
44
src/api/health/medicineBasic.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询药品基础信息列表
|
||||
export function listMedicineBasic(query) {
|
||||
return request({
|
||||
url: '/health/medicineBasic/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询药品基础信息详细
|
||||
export function getMedicineBasic(id) {
|
||||
return request({
|
||||
url: '/health/medicineBasic/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增药品基础信息
|
||||
export function addMedicineBasic(data) {
|
||||
return request({
|
||||
url: '/health/medicineBasic',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改药品基础信息
|
||||
export function updateMedicineBasic(data) {
|
||||
return request({
|
||||
url: '/health/medicineBasic',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除药品基础信息
|
||||
export function delMedicineBasic(id) {
|
||||
return request({
|
||||
url: '/health/medicineBasic/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
src/api/health/medicineStock.js
Normal file
44
src/api/health/medicineStock.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询药品实时库存列表
|
||||
export function listMedicineStock(query) {
|
||||
return request({
|
||||
url: '/health/medicineStock/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询药品实时库存详细
|
||||
export function getMedicineStock(id) {
|
||||
return request({
|
||||
url: '/health/medicineStock/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增药品实时库存
|
||||
export function addMedicineStock(data) {
|
||||
return request({
|
||||
url: '/health/medicineStock',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改药品实时库存
|
||||
export function updateMedicineStock(data) {
|
||||
return request({
|
||||
url: '/health/medicineStock',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除药品实时库存
|
||||
export function delMedicineStock(id) {
|
||||
return request({
|
||||
url: '/health/medicineStock/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
src/api/health/medicineStockIn.js
Normal file
44
src/api/health/medicineStockIn.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询药品入库清单列表
|
||||
export function listMedicineStockIn(query) {
|
||||
return request({
|
||||
url: '/health/medicineStockIn/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询药品入库清单详细
|
||||
export function getMedicineStockIn(id) {
|
||||
return request({
|
||||
url: '/health/medicineStockIn/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增药品入库清单
|
||||
export function addMedicineStockIn(data) {
|
||||
return request({
|
||||
url: '/health/medicineStockIn',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改药品入库清单
|
||||
export function updateMedicineStockIn(data) {
|
||||
return request({
|
||||
url: '/health/medicineStockIn',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除药品入库清单
|
||||
export function delMedicineStockIn(id) {
|
||||
return request({
|
||||
url: '/health/medicineStockIn/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询体重记录列表
|
||||
export function listWeightRecord(query) {
|
||||
return request({
|
||||
url: '/health/weightRecord/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询体重记录详细
|
||||
export function getWeightRecord(id) {
|
||||
return request({
|
||||
url: '/health/weightRecord/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增体重记录
|
||||
export function addWeightRecord(data) {
|
||||
return request({
|
||||
url: '/health/weightRecord',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改体重记录
|
||||
export function updateWeightRecord(data) {
|
||||
return request({
|
||||
url: '/health/weightRecord',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除体重记录
|
||||
export function delWeightRecord(id) {
|
||||
return request({
|
||||
url: '/health/weightRecord/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -82,7 +82,7 @@ function logout() {
|
||||
})
|
||||
.then(() => {
|
||||
userStore.logOut().then(() => {
|
||||
location.href = '/health/index'
|
||||
location.href = '/hrms/index'
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
|
||||
@@ -179,7 +179,7 @@ export const dynamicRoutes = [
|
||||
]
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory('/health/'),
|
||||
history: createWebHistory('/hrms/'),
|
||||
routes: constantRoutes,
|
||||
scrollBehavior(to, from, savedPosition) {
|
||||
if (savedPosition) {
|
||||
|
||||
@@ -92,7 +92,7 @@ service.interceptors.response.use(
|
||||
useUserStore()
|
||||
.logOut()
|
||||
.then(() => {
|
||||
location.href = '/health/index'
|
||||
location.href = '/hrms/index'
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
325
src/views/health/activity/index.vue
Normal file
325
src/views/health/activity/index.vue
Normal file
@@ -0,0 +1,325 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="search-con">
|
||||
<div class="title">查询条件</div>
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="活动名称" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入活动名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-select v-model="queryParams.type" placeholder="请选择类型" clearable>
|
||||
<el-option v-for="dict in activity_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="活动地点" prop="place">
|
||||
<el-input v-model="queryParams.place" placeholder="请输入活动地点" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="search-btn-con">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button type="info" icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main-con">
|
||||
<div class="title-con">
|
||||
<div class="title">基本信息</div>
|
||||
<div class="operate-btn-con">
|
||||
<el-button @click="handleAdd" icon="Plus" v-hasPermi="['health:activity:add']">新增</el-button>
|
||||
<el-button :disabled="multiple" icon="Delete" @click="handleDelete" v-hasPermi="['health:activity:remove']">删除</el-button>
|
||||
<el-button @click="handleExport" icon="Download" v-hasPermi="['health:activity:export']">导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-con" v-loading="loading">
|
||||
<el-table v-loading="loading" :data="activityList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="活动名称" align="center" prop="name" />
|
||||
<el-table-column label="类型" align="center" prop="type">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="activity_type" :value="scope.row.type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="活动地点" align="center" prop="place" />
|
||||
<el-table-column label="开始时间" align="center" prop="startTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结束时间" align="center" prop="endTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="成员" align="center" prop="partner" />
|
||||
<el-table-column label="总费用(元)" align="center" prop="totalCost" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<div class="ctrl-btn d-flex">
|
||||
<el-tooltip v-for="item in operateList" :key="item.id" class="item" effect="dark" :content="item.title" placement="top">
|
||||
<el-button :icon="item.icon" :v-hasPermi="item.hasPermi" circle @click="handleOperate(item.id, scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination small background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- 添加或修改活动记录对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="880px" append-to-body>
|
||||
<el-form ref="activityRef" :model="form" :inline="true" :rules="rules" label-width="120px">
|
||||
<el-form-item label="活动名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入活动名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-select v-model="form.type" placeholder="请选择类型">
|
||||
<el-option v-for="dict in activity_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="活动地点" prop="place">
|
||||
<el-input v-model="form.place" placeholder="请输入活动地点" />
|
||||
</el-form-item>
|
||||
<el-form-item label="成员" prop="partner">
|
||||
<el-input v-model="form.partner" placeholder="请输入成员" />
|
||||
</el-form-item>
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-date-picker clearable v-model="form.startTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间"> </el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束时间" prop="endTime">
|
||||
<el-date-picker clearable v-model="form.endTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间"> </el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="活动时长" prop="exerciseTime">
|
||||
<el-input v-model="form.exerciseTime" placeholder="请输入活动时长" />
|
||||
</el-form-item>
|
||||
<el-form-item label="活动量" prop="activityVolume">
|
||||
<el-input v-model="form.activityVolume" placeholder="请输入活动量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="总费用" style="width: 792px" prop="totalCost">
|
||||
<el-input v-model="form.totalCost" type="number" placeholder="请输入总费用">
|
||||
<template #suffix>元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="费用明细" style="width: 792px" prop="costDetail">
|
||||
<el-input v-model="form.costDetail" placeholder="请输入费用明细" />
|
||||
</el-form-item>
|
||||
<el-form-item label="饮食" style="width: 792px" prop="foods">
|
||||
<el-input v-model="form.foods" placeholder="请输入饮食" />
|
||||
</el-form-item>
|
||||
<el-form-item label="收获" style="width: 792px" prop="harvest">
|
||||
<el-input v-model="form.harvest" type="textarea" placeholder="请输入收获" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" style="width: 792px" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template v-if="title !== '查看活动记录'" #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="Activity">
|
||||
import { listActivity, getActivity, delActivity, addActivity, updateActivity } from '@/api/health/activity'
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import { require } from '@/utils/require'
|
||||
const { proxy } = getCurrentInstance()
|
||||
const { activity_type } = proxy.useDict('activity_type')
|
||||
|
||||
const activityList = 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 operateList = ref([
|
||||
{ id: 'view', icon: 'View', title: '查看', hasPermi: ['health:activity:query'] },
|
||||
{ id: 'edit', icon: 'Edit', title: '修改', hasPermi: ['health:activity:edit'] },
|
||||
{ id: 'delete', icon: 'Delete', title: '删除', hasPermi: ['health:activity:remove'] }
|
||||
])
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
type: null,
|
||||
place: null,
|
||||
activityVolume: null,
|
||||
startTime: null,
|
||||
endTime: null
|
||||
},
|
||||
rules: {
|
||||
name: [{ required: true, message: '活动名称不能为空', trigger: 'blur' }],
|
||||
type: [{ required: true, message: '类型不能为空', trigger: 'change' }],
|
||||
place: [{ required: true, message: '活动地点不能为空', trigger: 'blur' }],
|
||||
startTime: [{ required: true, message: '开始时间不能为空', trigger: 'blur' }],
|
||||
endTime: [{ required: true, message: '结束时间不能为空', trigger: 'blur' }],
|
||||
partner: [{ required: true, message: '成员不能为空', trigger: 'blur' }]
|
||||
}
|
||||
})
|
||||
|
||||
const handleOperate = (operate, row) => {
|
||||
switch (operate) {
|
||||
case 'view':
|
||||
handleView(row)
|
||||
break
|
||||
case 'edit':
|
||||
handleUpdate(row)
|
||||
break
|
||||
case 'delete':
|
||||
handleDelete(row)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
|
||||
/** 查询活动记录列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
listActivity(queryParams.value).then((response) => {
|
||||
activityList.value = response.rows
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
name: null,
|
||||
type: null,
|
||||
place: null,
|
||||
activityVolume: null,
|
||||
exerciseTime: null,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
harvest: null,
|
||||
foods: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
delFlag: null,
|
||||
remark: null,
|
||||
totalCost: null,
|
||||
partner: null,
|
||||
costDetail: null
|
||||
}
|
||||
proxy.resetForm('activityRef')
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm('queryRef')
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
// 分页
|
||||
const handleCurrentChange = (val) => {
|
||||
queryParams.value.pageNum = val
|
||||
getList()
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.id)
|
||||
single.value = selection.length !== 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
// 查看
|
||||
const handleView = (row) => {
|
||||
title.value = '查看活动记录'
|
||||
form.value = row
|
||||
open.value = true
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset()
|
||||
open.value = true
|
||||
title.value = '添加活动记录'
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset()
|
||||
const _id = row.id || ids.value
|
||||
getActivity(_id).then((response) => {
|
||||
form.value = response.data
|
||||
open.value = true
|
||||
title.value = '修改活动记录'
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs.activityRef.validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateActivity(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('修改成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
addActivity(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('新增成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除选中的数据项?')
|
||||
.then(function () {
|
||||
return delActivity(_ids)
|
||||
})
|
||||
.then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess('删除成功')
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download(
|
||||
'health/activity/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`activity_${new Date().getTime()}.xlsx`
|
||||
)
|
||||
}
|
||||
|
||||
getList()
|
||||
</script>
|
||||
@@ -35,8 +35,8 @@
|
||||
<el-button @click="handleExport" icon="Download" v-hasPermi="['health:doctorRecord:export']">导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-con" v-loading="loading">
|
||||
<el-table v-loading="loading" :data="doctorRecordList" @selection-change="handleSelectionChange">
|
||||
<div class="content-con" v-loading="loading" height="calc(100% - 0.65rem)">
|
||||
<el-table v-loading="loading" :data="doctorRecordList" @selection-change="handleSelectionChange" height="calc(100% - 0.65rem)">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="人员姓名" align="center" prop="personName" />
|
||||
<el-table-column label="健康档案" align="center" prop="healthRecordName" />
|
||||
|
||||
@@ -44,8 +44,8 @@
|
||||
<el-button @click="handleExport" icon="Download" v-hasPermi="['health:healthRecord:export']">导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-con" v-loading="loading">
|
||||
<el-table v-loading="loading" :data="healthRecordList" @selection-change="handleSelectionChange">
|
||||
<div class="content-con" v-loading="loading" height="calc(100% - 0.65rem)">
|
||||
<el-table v-loading="loading" :data="healthRecordList" @selection-change="handleSelectionChange" height="calc(100% - 0.65rem)">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="人员姓名" align="center" prop="personName" />
|
||||
<el-table-column label="档案名称" align="center" prop="name" />
|
||||
|
||||
@@ -21,17 +21,19 @@
|
||||
<div class="title-con">
|
||||
<div class="title">基本信息</div>
|
||||
<div class="operate-btn-con">
|
||||
<el-button @click="handleAdd" icon="Plus" v-hasPermi="['health:weightRecord:add']">新增</el-button>
|
||||
<el-button :disabled="multiple" icon="Delete" @click="handleDelete" v-hasPermi="['health:weightRecord:remove']">删除</el-button>
|
||||
<el-button @click="handleExport" icon="Download" v-hasPermi="['health:weightRecord:export']">导出</el-button>
|
||||
<el-button @click="handleAdd" icon="Plus" v-hasPermi="['health:heightWeightRecord:add']">新增</el-button>
|
||||
<el-button :disabled="multiple" icon="Delete" @click="handleDelete" v-hasPermi="['health:heightWeightRecord:remove']">删除</el-button>
|
||||
<el-button @click="handleExport" icon="Download" v-hasPermi="['health:heightWeightRecord:export']">导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-con" v-loading="loading">
|
||||
<el-table v-loading="loading" :data="weightRecordList" @selection-change="handleSelectionChange">
|
||||
<el-table v-loading="loading" :data="heightWeightRecordList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="人员姓名" align="center" prop="personName" />
|
||||
<el-table-column label="测量时间" align="center" prop="measureTime" width="180"> </el-table-column>
|
||||
<el-table-column label="体重" align="center" prop="weight" />
|
||||
<el-table-column label="身高(CM)" align="center" prop="height" />
|
||||
<el-table-column label="体重(KG)" align="center" prop="weight" />
|
||||
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<div class="ctrl-btn d-flex">
|
||||
@@ -45,9 +47,9 @@
|
||||
<el-pagination small background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- 添加或修改体重记录对话框 -->
|
||||
<!-- 添加或修改身高体重记录对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="weightRecordRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form ref="heightWeightRecordRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="人员姓名" prop="personId">
|
||||
<el-select v-model="form.personId" placeholder="请选择人员姓名" @change="handlePersonChange" clearable>
|
||||
<el-option v-for="person in personList" :key="person.id" :label="person.name" :value="person.id" />
|
||||
@@ -57,14 +59,21 @@
|
||||
<el-date-picker clearable v-model="form.measureTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择测量时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="身高" prop="height">
|
||||
<el-input v-model="form.height" type="number" placeholder="请输入身高">
|
||||
<template #suffix>CM</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="体重" prop="weight">
|
||||
<el-input v-model="form.weight" placeholder="请输入体重" />
|
||||
<el-input v-model="form.weight" type="number" placeholder="请输入体重">
|
||||
<template #suffix>KG</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template v-if="title !== '查看体重记录'" #footer>
|
||||
<template v-if="title !== '查看身高体重记录'" #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
@@ -74,15 +83,21 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="WeightRecord">
|
||||
import { listWeightRecord, getWeightRecord, delWeightRecord, addWeightRecord, updateWeightRecord } from '@/api/health/weightRecord'
|
||||
<script setup name="HeightWeightRecord">
|
||||
import {
|
||||
listHeightWeightRecord,
|
||||
getHeightWeightRecord,
|
||||
delHeightWeightRecord,
|
||||
addHeightWeightRecord,
|
||||
updateHeightWeightRecord
|
||||
} from '@/api/health/heightWeightRecord'
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import { listPerson, getPerson } from '@/api/health/person'
|
||||
import dayjs from 'dayjs'
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import { require } from '@/utils/require'
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const weightRecordList = ref([])
|
||||
const heightWeightRecordList = ref([])
|
||||
const open = ref(false)
|
||||
const loading = ref(true)
|
||||
const showSearch = ref(true)
|
||||
@@ -93,17 +108,19 @@ const total = ref(0)
|
||||
const title = ref('')
|
||||
const personList = ref([])
|
||||
const operateList = ref([
|
||||
{ id: 'view', icon: 'View', title: '查看', hasPermi: ['health:weightRecord:query'] },
|
||||
{ id: 'edit', icon: 'Edit', title: '修改', hasPermi: ['health:weightRecord:edit'] },
|
||||
{ id: 'delete', icon: 'Delete', title: '删除', hasPermi: ['health:weightRecord:remove'] }
|
||||
{ id: 'view', icon: 'View', title: '查看', hasPermi: ['health:heightWeightRecord:query'] },
|
||||
{ id: 'edit', icon: 'Edit', title: '修改', hasPermi: ['health:heightWeightRecord:edit'] },
|
||||
{ id: 'delete', icon: 'Delete', title: '删除', hasPermi: ['health:heightWeightRecord:remove'] }
|
||||
])
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
time: '',
|
||||
personId: null
|
||||
measureTime: null,
|
||||
weight: null,
|
||||
personId: null,
|
||||
height: null
|
||||
},
|
||||
queryPersonParams: {
|
||||
pageNum: 1,
|
||||
@@ -111,8 +128,7 @@ const data = reactive({
|
||||
},
|
||||
rules: {
|
||||
personId: [{ required: true, message: '人员姓名不能为空', trigger: 'blur' }],
|
||||
measureTime: [{ required: true, message: '测量时间不能为空', trigger: 'blur' }],
|
||||
weight: [{ required: true, message: '体重不能为空', trigger: 'blur' }]
|
||||
measureTime: [{ required: true, message: '测量时间不能为空', trigger: 'blur' }]
|
||||
}
|
||||
})
|
||||
|
||||
@@ -141,7 +157,7 @@ function getPersonList() {
|
||||
})
|
||||
}
|
||||
|
||||
/** 查询体重记录列表 */
|
||||
/** 查询身高体重记录列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
const timeRange = queryParams.value.time
|
||||
@@ -153,8 +169,8 @@ function getList() {
|
||||
}
|
||||
queryParams.value.startTime = st
|
||||
queryParams.value.endTime = et
|
||||
listWeightRecord(queryParams.value).then((response) => {
|
||||
weightRecordList.value = response.rows
|
||||
listHeightWeightRecord(queryParams.value).then((response) => {
|
||||
heightWeightRecordList.value = response.rows
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
@@ -178,9 +194,10 @@ function reset() {
|
||||
remark: null,
|
||||
measureTime: null,
|
||||
weight: null,
|
||||
personId: null
|
||||
personId: null,
|
||||
height: null
|
||||
}
|
||||
proxy.resetForm('weightRecordRef')
|
||||
proxy.resetForm('heightWeightRecordRef')
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
@@ -210,7 +227,7 @@ function handleSelectionChange(selection) {
|
||||
|
||||
// 查看
|
||||
const handleView = (row) => {
|
||||
title.value = '查看体重记录'
|
||||
title.value = '查看身高体重记录'
|
||||
form.value = row
|
||||
open.value = true
|
||||
}
|
||||
@@ -219,32 +236,36 @@ const handleView = (row) => {
|
||||
function handleAdd() {
|
||||
reset()
|
||||
open.value = true
|
||||
title.value = '添加体重记录'
|
||||
title.value = '添加身高体重记录'
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset()
|
||||
const _id = row.id || ids.value
|
||||
getWeightRecord(_id).then((response) => {
|
||||
getHeightWeightRecord(_id).then((response) => {
|
||||
form.value = response.data
|
||||
open.value = true
|
||||
title.value = '修改体重记录'
|
||||
title.value = '修改身高体重记录'
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs.weightRecordRef.validate((valid) => {
|
||||
proxy.$refs.heightWeightRecordRef.validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.weight == null && form.value.height == null) {
|
||||
proxy.$modal.msgError('身高体重不能同时为空')
|
||||
return
|
||||
}
|
||||
if (form.value.id != null) {
|
||||
updateWeightRecord(form.value).then((response) => {
|
||||
updateHeightWeightRecord(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('修改成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
addWeightRecord(form.value).then((response) => {
|
||||
addHeightWeightRecord(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('新增成功')
|
||||
open.value = false
|
||||
getList()
|
||||
@@ -260,7 +281,7 @@ function handleDelete(row) {
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除选中的数据项?')
|
||||
.then(function () {
|
||||
return delWeightRecord(_ids)
|
||||
return delHeightWeightRecord(_ids)
|
||||
})
|
||||
.then(() => {
|
||||
getList()
|
||||
@@ -272,11 +293,11 @@ function handleDelete(row) {
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download(
|
||||
'health/weightRecord/export',
|
||||
'health/heightWeightRecord/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`weightRecord_${new Date().getTime()}.xlsx`
|
||||
`heightWeightRecord_${new Date().getTime()}.xlsx`
|
||||
)
|
||||
}
|
||||
|
||||
@@ -44,10 +44,10 @@
|
||||
<el-button @click="handleExport" icon="Download" v-hasPermi="['health:marRecord:export']">导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-con" v-loading="loading">
|
||||
<el-table v-loading="loading" :data="marRecordList" @selection-change="handleSelectionChange">
|
||||
<div class="content-con" v-loading="loading" height="calc(100% - 0.65rem)">
|
||||
<el-table v-loading="loading" :data="marRecordList" @selection-change="handleSelectionChange" height="calc(100% - 0.65rem)">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="人员姓名" align="center" prop="personName" />
|
||||
<el-table-column label="人员姓名" align="center" width="120" prop="personName" />
|
||||
<el-table-column label="健康档案" align="center" prop="healthRecordName" />
|
||||
<el-table-column label="用药名称" align="center" prop="name" />
|
||||
<el-table-column label="用药类型" align="center" prop="type">
|
||||
@@ -55,18 +55,23 @@
|
||||
<dict-tag :options="mar_type" :value="scope.row.type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="药品来源" align="center" prop="resource">
|
||||
<el-table-column label="药品来源" width="120" align="center" prop="resource">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="mar_resource" :value="scope.row.resource" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="用药地点" align="center" prop="place">
|
||||
<el-table-column label="用药地点" align="center" width="120" prop="place">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="mar_place" :value="scope.row.place" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="用药时间" align="center" prop="dosingTime" width="180"> </el-table-column>
|
||||
<el-table-column label="用药剂量" align="center" prop="dosage" />
|
||||
<el-table-column label="用药剂量" align="center" width="120" prop="dosage" />
|
||||
<el-table-column label="用药单位" align="center" prop="unit">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="medical_unit" :value="scope.row.unit" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<div class="ctrl-btn d-flex">
|
||||
@@ -114,8 +119,17 @@
|
||||
<el-form-item label="用药时间" prop="dosingTime">
|
||||
<el-date-picker clearable v-model="form.dosingTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择用药时间"> </el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="用药剂量" prop="dosage">
|
||||
<el-input v-model="form.dosage" placeholder="请输入用药剂量" />
|
||||
<el-form-item label="用药剂量" prop="dosage"> <el-input v-model="form.dosage" placeholder="请输入用药剂量" /></el-form-item>
|
||||
<el-form-item label="用药单位" prop="unit">
|
||||
<el-select v-model="form.unit" placeholder="请选择用药单位">
|
||||
<el-option v-for="dict in medical_unit" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="含量" prop="content"> <el-input v-model="form.content" placeholder="请输入含量" /></el-form-item>
|
||||
<el-form-item label="含量单位" prop="contentUnit">
|
||||
<el-select v-model="form.contentUnit" placeholder="请选择含量单位">
|
||||
<el-option v-for="dict in content_unit" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" style="width: 792px" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||
@@ -139,7 +153,7 @@ import dayjs from 'dayjs'
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import { require } from '@/utils/require'
|
||||
const { proxy } = getCurrentInstance()
|
||||
const { mar_type, mar_place, mar_resource } = proxy.useDict('mar_type', 'mar_place', 'mar_resource')
|
||||
const { mar_type, mar_place, mar_resource, medical_unit, content_unit } = proxy.useDict('mar_type', 'mar_place', 'mar_resource', 'medical_unit', 'content_unit')
|
||||
|
||||
const marRecordList = ref([])
|
||||
const open = ref(false)
|
||||
@@ -155,6 +169,7 @@ const healthRecordList = ref([])
|
||||
const operateList = ref([
|
||||
{ id: 'view', icon: 'View', title: '查看', hasPermi: ['health:marRecord:query'] },
|
||||
{ id: 'edit', icon: 'Edit', title: '修改', hasPermi: ['health:marRecord:edit'] },
|
||||
{ id: 'copy', icon: 'Link', title: '复制', hasPermi: ['health:marRecord:edit'] },
|
||||
{ id: 'delete', icon: 'Delete', title: '删除', hasPermi: ['health:marRecord:remove'] }
|
||||
])
|
||||
const data = reactive({
|
||||
@@ -203,6 +218,9 @@ const handleOperate = (operate, row) => {
|
||||
case 'delete':
|
||||
handleDelete(row)
|
||||
break
|
||||
case 'copy':
|
||||
handleCopy(row)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
@@ -321,6 +339,18 @@ function handleUpdate(row) {
|
||||
})
|
||||
}
|
||||
|
||||
/** 复制按钮操作 */
|
||||
function handleCopy(row) {
|
||||
reset()
|
||||
const _id = row.id || ids.value
|
||||
getMarRecord(_id).then((response) => {
|
||||
form.value = response.data
|
||||
form.value.id = null
|
||||
open.value = true
|
||||
title.value = '复制用药记录'
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs.marRecordRef.validate((valid) => {
|
||||
|
||||
417
src/views/health/medicineBasic/index.vue
Normal file
417
src/views/health/medicineBasic/index.vue
Normal file
@@ -0,0 +1,417 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="search-con">
|
||||
<div class="title">查询条件</div>
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="药品名称" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入药品名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="药品编码" prop="code">
|
||||
<el-input v-model="queryParams.code" placeholder="请输入药品编码" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="治疗类型" prop="treatmentType">
|
||||
<el-select v-model="queryParams.treatmentType" placeholder="请选择治疗类型" clearable>
|
||||
<el-option v-for="dict in mar_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="药品分类" prop="classification">
|
||||
<el-select v-model="queryParams.classification" placeholder="请选择药品分类" clearable>
|
||||
<el-option v-for="dict in medicine_classification" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="类别" prop="category">
|
||||
<el-select v-model="queryParams.category" placeholder="请选择类别" clearable>
|
||||
<el-option v-for="dict in medicine_category" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="药品剂型" prop="dosageForm">
|
||||
<el-select v-model="queryParams.dosageForm" placeholder="请选择药品剂型" clearable>
|
||||
<el-option v-for="dict in dosage_form" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="品牌" prop="brand">
|
||||
<el-input v-model="queryParams.brand" placeholder="请输入品牌" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="生产厂家" prop="manufacturers">
|
||||
<el-input v-model="queryParams.manufacturers" placeholder="请输入生产厂家" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="search-btn-con">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button type="info" icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main-con">
|
||||
<div class="title-con">
|
||||
<div class="title">基本信息</div>
|
||||
<div class="operate-btn-con">
|
||||
<el-button @click="handleAdd" icon="Plus" v-hasPermi="['health:medicineBasic:add']">新增</el-button>
|
||||
<el-button :disabled="multiple" icon="Delete" @click="handleDelete" v-hasPermi="['health:medicineBasic:remove']">删除</el-button>
|
||||
<el-button @click="handleExport" icon="Download" v-hasPermi="['health:medicineBasic:export']">导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-con" v-loading="loading">
|
||||
<el-table v-loading="loading" :data="medicineBasicList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="药品名称" align="center" prop="name" />
|
||||
<el-table-column label="药品编码" align="center" prop="code" />
|
||||
<el-table-column label="治疗类型" align="center" prop="treatmentType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="mar_type" :value="scope.row.treatmentType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="药品分类" align="center" prop="classification">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="medicine_classification" :value="scope.row.classification" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="类别" align="center" prop="category">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="medicine_category" :value="scope.row.category" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="药品剂型" align="center" prop="dosageForm">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="dosage_form" :value="scope.row.dosageForm" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="品牌" align="center" prop="brand" />
|
||||
<el-table-column label="生产厂家" align="center" prop="manufacturers" />
|
||||
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<div class="ctrl-btn d-flex">
|
||||
<el-tooltip v-for="item in operateList" :key="item.id" class="item" effect="dark" :content="item.title" placement="top">
|
||||
<el-button :icon="item.icon" :v-hasPermi="item.hasPermi" circle @click="handleOperate(item.id, scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination small background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- 添加或修改药品基础信息对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="1280px" append-to-body>
|
||||
<el-form ref="medicineBasicRef" :model="form" :inline="true" :rules="rules" label-width="120px">
|
||||
<el-form-item label="药品名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入药品名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="药品编码" prop="code">
|
||||
<el-input v-model="form.code" placeholder="请输入药品编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="药品剂型" prop="dosageForm">
|
||||
<el-select v-model="form.dosageForm" placeholder="请选择药品剂型">
|
||||
<el-option v-for="dict in dosage_form" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="治疗类型" prop="treatmentType">
|
||||
<el-select v-model="form.treatmentType" placeholder="请选择治疗类型">
|
||||
<el-option v-for="dict in mar_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="药品分类" prop="classification">
|
||||
<el-select v-model="form.classification" placeholder="请选择药品分类">
|
||||
<el-option v-for="dict in medicine_classification" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="类别" prop="category">
|
||||
<el-select v-model="form.category" placeholder="请选择类别">
|
||||
<el-option v-for="dict in medicine_category" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="品牌" prop="brand">
|
||||
<el-input v-model="form.brand" placeholder="请输入品牌" />
|
||||
</el-form-item>
|
||||
<el-form-item label="药品包装" prop="packaging">
|
||||
<el-input v-model="form.packaging" placeholder="请输入药品包装" />
|
||||
</el-form-item>
|
||||
<el-form-item label="生产厂家" prop="manufacturers">
|
||||
<el-input v-model="form.manufacturers" placeholder="请输入生产厂家" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="是否进口" prop="isImport">
|
||||
<el-select v-model="form.isImport" placeholder="请选择是否进口">
|
||||
<el-option v-for="dict in is_import" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="单个规格" prop="specifications">
|
||||
<el-input v-model="form.specifications" placeholder="请输入单个规格" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单个单位" prop="unit">
|
||||
<el-select v-model="form.unit" placeholder="请选择单个单位">
|
||||
<el-option v-for="dict in medical_unit" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="含量" prop="content">
|
||||
<el-input v-model="form.content" placeholder="请输入含量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="含量单位" prop="contentUnit">
|
||||
<el-select v-model="form.contentUnit" placeholder="请选择含量单位">
|
||||
<el-option v-for="dict in content_unit" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="功能主治" style="width: 1200px" prop="indications">
|
||||
<el-input v-model="form.indications" placeholder="请输入功能主治" />
|
||||
</el-form-item>
|
||||
<el-form-item label="生产地址" style="width: 1200px" prop="address">
|
||||
<el-input v-model="form.address" placeholder="请输入生产地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="贮藏" style="width: 1200px" prop="storage">
|
||||
<el-input v-model="form.storage" placeholder="请输入贮藏" />
|
||||
</el-form-item>
|
||||
<el-form-item label="药品成分" style="width: 1200px" prop="ingredients">
|
||||
<el-input v-model="form.ingredients" placeholder="请输入药品成分" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用法用量" style="width: 1200px" prop="usage">
|
||||
<el-input v-model="form.usage" placeholder="请输入用法用量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="性状" prop="character" style="width: 1200px">
|
||||
<el-input v-model="form.character" placeholder="请输入性状" />
|
||||
</el-form-item>
|
||||
<el-form-item label="不良反应" prop="adverseReaction" style="width: 1200px">
|
||||
<el-input v-model="form.adverseReaction" type="textarea" placeholder="请输入不良反应" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" style="width: 1200px" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template v-if="title !== '查看药品基础信息'" #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="MedicineBasic">
|
||||
import { listMedicineBasic, getMedicineBasic, delMedicineBasic, addMedicineBasic, updateMedicineBasic } from '@/api/health/medicineBasic'
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import { require } from '@/utils/require'
|
||||
const { proxy } = getCurrentInstance()
|
||||
const { medicine_category, mar_type, medicine_classification, dosage_form, is_import, medical_unit, content_unit } = proxy.useDict(
|
||||
'medicine_category',
|
||||
'mar_type',
|
||||
'medicine_classification',
|
||||
'dosage_form',
|
||||
'is_import',
|
||||
'medical_unit',
|
||||
'content_unit'
|
||||
)
|
||||
|
||||
const medicineBasicList = 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 operateList = ref([
|
||||
{ id: 'view', icon: 'View', title: '查看', hasPermi: ['health:medicineBasic:query'] },
|
||||
{ id: 'edit', icon: 'Edit', title: '修改', hasPermi: ['health:medicineBasic:edit'] },
|
||||
{ id: 'delete', icon: 'Delete', title: '删除', hasPermi: ['health:medicineBasic:remove'] }
|
||||
])
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
classification: null,
|
||||
category: null,
|
||||
brand: null,
|
||||
packaging: null,
|
||||
manufacturers: null,
|
||||
treatmentType: null,
|
||||
isImport: null,
|
||||
ingredients: null,
|
||||
usage: null,
|
||||
dosageForm: null,
|
||||
code: null
|
||||
},
|
||||
rules: {
|
||||
name: [{ required: true, message: '药品名称不能为空', trigger: 'blur' }],
|
||||
classification: [{ required: true, message: '药品分类不能为空', trigger: 'change' }],
|
||||
category: [{ required: true, message: '类别不能为空', trigger: 'change' }],
|
||||
brand: [{ required: true, message: '品牌不能为空', trigger: 'blur' }],
|
||||
packaging: [{ required: true, message: '药品包装不能为空', trigger: 'blur' }],
|
||||
manufacturers: [{ required: true, message: '生产厂家不能为空', trigger: 'blur' }],
|
||||
treatmentType: [{ required: true, message: '治疗类型不能为空', trigger: 'change' }],
|
||||
dosageForm: [{ required: true, message: '药品剂型不能为空', trigger: 'change' }],
|
||||
code: [{ required: true, message: '药品编码不能为空', trigger: 'blur' }]
|
||||
}
|
||||
})
|
||||
|
||||
const handleOperate = (operate, row) => {
|
||||
switch (operate) {
|
||||
case 'view':
|
||||
handleView(row)
|
||||
break
|
||||
case 'edit':
|
||||
handleUpdate(row)
|
||||
break
|
||||
case 'delete':
|
||||
handleDelete(row)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
|
||||
/** 查询药品基础信息列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
listMedicineBasic(queryParams.value).then((response) => {
|
||||
medicineBasicList.value = response.rows
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
name: null,
|
||||
classification: null,
|
||||
category: null,
|
||||
brand: null,
|
||||
packaging: null,
|
||||
manufacturers: null,
|
||||
treatmentType: null,
|
||||
isImport: null,
|
||||
ingredients: null,
|
||||
usage: null,
|
||||
dosageForm: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
delFlag: null,
|
||||
remark: null,
|
||||
code: null,
|
||||
specifications: null,
|
||||
unit: null,
|
||||
address: null,
|
||||
adverseReaction: null,
|
||||
content: null,
|
||||
contentUnit: null,
|
||||
character: null,
|
||||
storage: null,
|
||||
indications: null
|
||||
}
|
||||
proxy.resetForm('medicineBasicRef')
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm('queryRef')
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
// 分页
|
||||
const handleCurrentChange = (val) => {
|
||||
queryParams.value.pageNum = val
|
||||
getList()
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.id)
|
||||
single.value = selection.length !== 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
// 查看
|
||||
const handleView = (row) => {
|
||||
title.value = '查看药品基础信息'
|
||||
form.value = row
|
||||
open.value = true
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset()
|
||||
open.value = true
|
||||
title.value = '添加药品基础信息'
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset()
|
||||
const _id = row.id || ids.value
|
||||
getMedicineBasic(_id).then((response) => {
|
||||
form.value = response.data
|
||||
open.value = true
|
||||
title.value = '修改药品基础信息'
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs.medicineBasicRef.validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateMedicineBasic(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('修改成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
addMedicineBasic(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('新增成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除选中的数据项?')
|
||||
.then(function () {
|
||||
return delMedicineBasic(_ids)
|
||||
})
|
||||
.then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess('删除成功')
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download(
|
||||
'health/medicineBasic/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`medicineBasic_${new Date().getTime()}.xlsx`
|
||||
)
|
||||
}
|
||||
|
||||
getList()
|
||||
</script>
|
||||
241
src/views/health/medicineStock/index.vue
Normal file
241
src/views/health/medicineStock/index.vue
Normal file
@@ -0,0 +1,241 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="search-con">
|
||||
<div class="title">查询条件</div>
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="库存" prop="inventory">
|
||||
<el-input v-model="queryParams.inventory" placeholder="请输入库存" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="search-btn-con">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button type="info" icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main-con">
|
||||
<div class="title-con">
|
||||
<div class="title">基本信息</div>
|
||||
<div class="operate-btn-con">
|
||||
<el-button @click="handleAdd" icon="Plus" v-hasPermi="['health:medicineStock:add']">新增</el-button>
|
||||
<el-button :disabled="multiple" icon="Delete" @click="handleDelete" v-hasPermi="['health:medicineStock:remove']">删除</el-button>
|
||||
<el-button @click="handleExport" icon="Download" v-hasPermi="['health:medicineStock:export']">导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-con" v-loading="loading">
|
||||
<el-table v-loading="loading" :data="medicineStockList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="药品id" align="center" prop="medicineId" />
|
||||
<el-table-column label="库存" align="center" prop="inventory" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<div class="ctrl-btn d-flex">
|
||||
<el-tooltip v-for="item in operateList" :key="item.id" class="item" effect="dark" :content="item.title" placement="top">
|
||||
<el-button :icon="item.icon" :v-hasPermi="item.hasPermi" circle @click="handleOperate(item.id, scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination small background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- 添加或修改药品实时库存对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="medicineStockRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="库存" prop="inventory">
|
||||
<el-input v-model="form.inventory" placeholder="请输入库存" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template v-if="title !== '查看药品实时库存'" #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="MedicineStock">
|
||||
import { listMedicineStock, getMedicineStock, delMedicineStock, addMedicineStock, updateMedicineStock } from '@/api/health/medicineStock'
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import { require } from '@/utils/require'
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const medicineStockList = 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 operateList = ref([
|
||||
{ id: 'view', icon: 'View', title: '查看', hasPermi: ['health:medicineStock:query'] },
|
||||
{ id: 'edit', icon: 'Edit', title: '修改', hasPermi: ['health:medicineStock:edit'] },
|
||||
{ id: 'delete', icon: 'Delete', title: '删除', hasPermi: ['health:medicineStock:remove'] }
|
||||
])
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
medicineId: null,
|
||||
inventory: null
|
||||
},
|
||||
rules: {}
|
||||
})
|
||||
|
||||
const handleOperate = (operate, row) => {
|
||||
switch (operate) {
|
||||
case 'view':
|
||||
handleView(row)
|
||||
break
|
||||
case 'edit':
|
||||
handleUpdate(row)
|
||||
break
|
||||
case 'delete':
|
||||
handleDelete(row)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
|
||||
/** 查询药品实时库存列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
listMedicineStock(queryParams.value).then((response) => {
|
||||
medicineStockList.value = response.rows
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
medicineId: null,
|
||||
inventory: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
delFlag: null,
|
||||
remark: null
|
||||
}
|
||||
proxy.resetForm('medicineStockRef')
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm('queryRef')
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
// 分页
|
||||
const handleCurrentChange = (val) => {
|
||||
queryParams.value.pageNum = val
|
||||
getList()
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.id)
|
||||
single.value = selection.length !== 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
// 查看
|
||||
const handleView = (row) => {
|
||||
title.value = '查看药品实时库存'
|
||||
form.value = row
|
||||
open.value = true
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset()
|
||||
open.value = true
|
||||
title.value = '添加药品实时库存'
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset()
|
||||
const _id = row.id || ids.value
|
||||
getMedicineStock(_id).then((response) => {
|
||||
form.value = response.data
|
||||
open.value = true
|
||||
title.value = '修改药品实时库存'
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs.medicineStockRef.validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateMedicineStock(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('修改成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
addMedicineStock(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('新增成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除选中的数据项?')
|
||||
.then(function () {
|
||||
return delMedicineStock(_ids)
|
||||
})
|
||||
.then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess('删除成功')
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download(
|
||||
'health/medicineStock/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`medicineStock_${new Date().getTime()}.xlsx`
|
||||
)
|
||||
}
|
||||
|
||||
getList()
|
||||
</script>
|
||||
363
src/views/health/medicineStockIn/index.vue
Normal file
363
src/views/health/medicineStockIn/index.vue
Normal file
@@ -0,0 +1,363 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="search-con">
|
||||
<div class="title">查询条件</div>
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="药品名称" prop="medicineId">
|
||||
<el-select v-model="queryParams.medicineId" placeholder="请选择药品名称" clearable>
|
||||
<el-option v-for="medicine in medicineList" :key="medicine.id" :label="medicine.name" :value="medicine.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库编号" prop="code">
|
||||
<el-input v-model="queryParams.code" placeholder="请输入入库编号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="使用状态" prop="state">
|
||||
<el-select v-model="queryParams.state" placeholder="请选择使用状态" clearable>
|
||||
<el-option v-for="dict in used_state" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="search-btn-con">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button type="info" icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main-con">
|
||||
<div class="title-con">
|
||||
<div class="title">基本信息</div>
|
||||
<div class="operate-btn-con">
|
||||
<el-button @click="handleAdd" icon="Plus" v-hasPermi="['health:medicineStockIn:add']">新增</el-button>
|
||||
<el-button :disabled="multiple" icon="Delete" @click="handleDelete" v-hasPermi="['health:medicineStockIn:remove']">删除</el-button>
|
||||
<el-button @click="handleExport" icon="Download" v-hasPermi="['health:medicineStockIn:export']">导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-con" v-loading="loading">
|
||||
<el-table v-loading="loading" :data="medicineStockInList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="药品名称" align="center" prop="medicineName" />
|
||||
<el-table-column label="购买时间" align="center" prop="purchaseDate" width="180"> </el-table-column>
|
||||
<el-table-column label="入库数量" align="center" prop="quantity" />
|
||||
<el-table-column label="单价" align="center" prop="purchasePrice" />
|
||||
<el-table-column label="总价" align="center" prop="totalPrice" />
|
||||
<el-table-column label="入库编号" align="center" prop="code" />
|
||||
<el-table-column label="使用状态" align="center" prop="state">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="used_state" :value="scope.row.state" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="生产日期" align="center" prop="productionDate" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.productionDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="过期日期" align="center" prop="expiringDate" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.expiringDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="剩余数量" align="center" prop="leftCount" />
|
||||
<el-table-column label="使用数量" align="center" prop="usedCount" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<div class="ctrl-btn d-flex">
|
||||
<el-tooltip v-for="item in operateList" :key="item.id" class="item" effect="dark" :content="item.title" placement="top">
|
||||
<el-button :icon="item.icon" :v-hasPermi="item.hasPermi" circle @click="handleOperate(item.id, scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination small background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- 添加或修改药品入库清单对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="880px" append-to-body>
|
||||
<el-form ref="medicineStockInRef" :inline="true" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="药品名称" prop="medicineId">
|
||||
<el-select v-model="form.medicineId" placeholder="请选择药品名称" clearable>
|
||||
<el-option v-for="medicine in medicineList" :key="medicine.id" :label="medicine.name" :value="medicine.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="购买时间" prop="purchaseDate">
|
||||
<el-date-picker clearable v-model="form.purchaseDate" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择购买时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="入库编号" prop="code">
|
||||
<el-input v-model="form.code" placeholder="请输入入库编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入库数量" prop="quantity">
|
||||
<el-input v-model="form.quantity" type="number" placeholder="请输入入库数量"> </el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="使用状态" prop="state">
|
||||
<el-select v-model="form.state" placeholder="请选择使用状态">
|
||||
<el-option v-for="dict in used_state" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="生产日期" prop="productionDate">
|
||||
<el-date-picker clearable v-model="form.productionDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择生产日期"> </el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="过期日期" prop="expiringDate">
|
||||
<el-date-picker clearable v-model="form.expiringDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择过期日期"> </el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="购买地址" prop="purchaseAddress">
|
||||
<el-input v-model="form.purchaseAddress" placeholder="请输入购买地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="药品单价" prop="purchasePrice">
|
||||
<el-input v-model="form.purchasePrice" type="number" placeholder="请输入药品单价"> </el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="药品总价" prop="totalPrice">
|
||||
<el-input v-model="form.totalPrice" type="number" placeholder="请输入药品总价"> </el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" style="width: 792px" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template v-if="title !== '查看药品入库清单'" #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="MedicineStockIn">
|
||||
import { listMedicineStockIn, getMedicineStockIn, delMedicineStockIn, addMedicineStockIn, updateMedicineStockIn } from '@/api/health/medicineStockIn'
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import { listMedicineBasic, getMedicineBasic } from '@/api/health/medicineBasic'
|
||||
import { require } from '@/utils/require'
|
||||
const { proxy } = getCurrentInstance()
|
||||
const { used_state } = proxy.useDict('used_state')
|
||||
|
||||
const medicineStockInList = 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 medicineList = ref([])
|
||||
const operateList = ref([
|
||||
{ id: 'view', icon: 'View', title: '查看', hasPermi: ['health:medicineStockIn:query'] },
|
||||
{ id: 'edit', icon: 'Edit', title: '修改', hasPermi: ['health:medicineStockIn:edit'] },
|
||||
{ id: 'delete', icon: 'Delete', title: '删除', hasPermi: ['health:medicineStockIn:remove'] }
|
||||
])
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
medicineId: null,
|
||||
quantity: null,
|
||||
productionDate: null,
|
||||
expiringDate: null,
|
||||
purchaseDate: null,
|
||||
purchasePrice: null,
|
||||
code: null,
|
||||
state: null,
|
||||
leftCount: null,
|
||||
usedCount: null,
|
||||
purchaseAddress: null
|
||||
},
|
||||
queryMedicineParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 1000
|
||||
},
|
||||
rules: {
|
||||
medicineId: [{ required: true, message: '药品名称不能为空', trigger: 'blur' }],
|
||||
quantity: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
|
||||
productionDate: [{ required: true, message: '生产日期不能为空', trigger: 'blur' }],
|
||||
expiringDate: [{ required: true, message: '过期日期不能为空', trigger: 'blur' }],
|
||||
purchaseDate: [{ required: true, message: '购买日期不能为空', trigger: 'blur' }],
|
||||
code: [{ required: true, message: '入库编号不能为空', trigger: 'blur' }],
|
||||
state: [{ required: true, message: '使用状态不能为空', trigger: 'change' }]
|
||||
}
|
||||
})
|
||||
|
||||
const handleOperate = (operate, row) => {
|
||||
switch (operate) {
|
||||
case 'view':
|
||||
handleView(row)
|
||||
break
|
||||
case 'edit':
|
||||
handleUpdate(row)
|
||||
break
|
||||
case 'delete':
|
||||
handleDelete(row)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
const { queryParams, form, rules, queryMedicineParams } = toRefs(data)
|
||||
|
||||
/** 查询药品入库清单列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
listMedicineStockIn(queryParams.value).then((response) => {
|
||||
medicineStockInList.value = response.rows
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
/** 查询药品管理列表 */
|
||||
function getMedicineList() {
|
||||
listMedicineBasic(queryMedicineParams.value).then((response) => {
|
||||
medicineList.value = response.rows
|
||||
})
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
medicineId: null,
|
||||
quantity: null,
|
||||
productionDate: null,
|
||||
expiringDate: null,
|
||||
purchaseDate: null,
|
||||
purchasePrice: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
delFlag: null,
|
||||
remark: null,
|
||||
code: null,
|
||||
state: null,
|
||||
leftCount: null,
|
||||
usedCount: null,
|
||||
purchaseAddress: null,
|
||||
totalPrice: null
|
||||
}
|
||||
proxy.resetForm('medicineStockInRef')
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm('queryRef')
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
// 分页
|
||||
const handleCurrentChange = (val) => {
|
||||
queryParams.value.pageNum = val
|
||||
getList()
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.id)
|
||||
single.value = selection.length !== 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
// 查看
|
||||
const handleView = (row) => {
|
||||
title.value = '查看药品入库清单'
|
||||
form.value = row
|
||||
open.value = true
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset()
|
||||
open.value = true
|
||||
const date = new Date()
|
||||
const year = date.getFullYear() // 年份
|
||||
let month = date.getMonth() + 1 // 月份,返回值为0-11,所以需要加1
|
||||
let day = date.getDate() // 日期
|
||||
let hour = date.getHours()
|
||||
let minute = date.getMinutes()
|
||||
let second = date.getSeconds()
|
||||
// 对月份和日期进行补零
|
||||
month = month < 10 ? '0' + month : month.toString()
|
||||
day = day < 10 ? '0' + day : day.toString()
|
||||
hour = hour < 10 ? '0' + hour : hour.toString()
|
||||
minute = minute < 10 ? '0' + minute : minute.toString()
|
||||
second = second < 10 ? '0' + second : second.toString()
|
||||
const currentDate = year + month + day + hour + minute + second
|
||||
form.value.code = currentDate
|
||||
title.value = '添加药品入库清单'
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset()
|
||||
const _id = row.id || ids.value
|
||||
getMedicineStockIn(_id).then((response) => {
|
||||
form.value = response.data
|
||||
open.value = true
|
||||
title.value = '修改药品入库清单'
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs.medicineStockInRef.validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateMedicineStockIn(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('修改成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
addMedicineStockIn(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('新增成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除选中的数据项?')
|
||||
.then(function () {
|
||||
return delMedicineStockIn(_ids)
|
||||
})
|
||||
.then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess('删除成功')
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download(
|
||||
'health/medicineStockIn/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`medicineStockIn_${new Date().getTime()}.xlsx`
|
||||
)
|
||||
}
|
||||
|
||||
getList()
|
||||
getMedicineList()
|
||||
</script>
|
||||
Reference in New Issue
Block a user