fix: 健康管理代码合并到主分支。
This commit is contained in:
132
src/views/health/medicineStock/index.vue
Normal file
132
src/views/health/medicineStock/index.vue
Normal file
@@ -0,0 +1,132 @@
|
||||
<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="药品名称" style="width: 480px" prop="medicineId">
|
||||
<el-select v-model="queryParams.medicineId" width="500" placeholder="请选择药品名称" clearable>
|
||||
<el-option v-for="medicine in medicineList" :key="medicine.id" :label="medicine.shortNameBrandPackaging" :value="medicine.id" />
|
||||
</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>
|
||||
<div class="content-con" v-loading="loading" height="calc(100% - 0.65rem)">
|
||||
<el-table v-loading="loading" :data="medicineStockInList" @selection-change="handleSelectionChange" height="calc(100% - 0.65rem)">
|
||||
<el-table-column label="药品名称" align="center" prop="medicineName" />
|
||||
<el-table-column label="规格总数" align="center" prop="totalCount" />
|
||||
<el-table-column label="剩余数量" align="center" prop="leftCount" />
|
||||
<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>
|
||||
<el-pagination small background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MedicineStockIn">
|
||||
import { listMedicineRealtimeStock } 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 { medical_unit } = proxy.useDict('medical_unit')
|
||||
|
||||
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 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
|
||||
}
|
||||
})
|
||||
|
||||
const { queryParams, form, queryMedicineParams } = toRefs(data)
|
||||
|
||||
/** 查询药品入库清单列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
listMedicineRealtimeStock(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 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
|
||||
}
|
||||
|
||||
getList()
|
||||
getMedicineList()
|
||||
</script>
|
||||
Reference in New Issue
Block a user