使用药品,日期展示修改

This commit is contained in:
2025-10-13 13:32:23 +08:00
parent 9c200ba2f5
commit fa3629fbe7
8 changed files with 247 additions and 178 deletions

View File

@@ -19,7 +19,10 @@
</el-form-item>
<el-form-item label="使用名称" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入使用名称" clearable @keyup.enter="handleQuery" />
<el-select v-model="queryParams.name" placeholder="请选择使用药品名称" clearable filterable style="width: 100%"
@keyup.enter="handleQuery">
<el-option v-for="item in medicines" :key="item.value" :label="item.label" :value="item.label" />
</el-select>
</el-form-item>
<el-form-item label="使用类型" prop="useType">
@@ -78,7 +81,7 @@
<!-- 分页 -->
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize" :page-sizes="[20, 50, 100, 200, 500, 1000, 2000]" @pagination="getList" />
<!-- 详情弹窗保持不变 -->
<el-dialog :title="title" v-model="open" width="680px" top="8vh" append-to-body :close-on-click-modal="false"
class="usage-detail-dialog">
@@ -137,6 +140,7 @@
</template>
<script setup name="Usage">
import { listMedicine} from "@/api/biosafety/medicine"
import { listUsageInfo, getUsageInfo } from '@/api/biosafety/usageInfo'
import { listUnit } from '@/api/biosafety/unit'
import { listUsage } from '@/api/biosafety/usage'
@@ -170,6 +174,7 @@ const { queryParams, form, rules } = toRefs(data)
const units = ref([])
const usages = ref([])
const medicines = ref([])
/* 获取单位 */
function getUnit() {
@@ -177,6 +182,13 @@ function getUnit() {
units.value = res.rows.map(item => ({ value: item.id, label: item.name }))
})
}
/* 获取药品信息 */
function getMedicineOptions() {
listMedicine().then(res => {
medicines.value = res.rows.map(item => ({ value: item.id, label: item.name }))
})
}
/* 获取使用方法 */
function getUsageOptions() {
listUsage().then(res => {
@@ -266,6 +278,7 @@ function handleExport() {
/* 初始化 */
getList()
getUnit()
getMedicineOptions()
getUsageOptions()
</script>