fix: 实时库存新增,功能完善。
This commit is contained in:
@@ -42,3 +42,12 @@ export function delMedicineStockIn(id) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询药品入库清单列表
|
||||
export function listMedicineRealtimeStock(query) {
|
||||
return request({
|
||||
url: '/health/medicineStockIn/realTimeList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
@@ -38,16 +38,16 @@
|
||||
<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" />
|
||||
<el-table-column label="医院名称" align="center" prop="hospitalName" />
|
||||
<el-table-column label="科室" align="center" prop="departments" />
|
||||
<el-table-column label="大夫" align="center" width="100" prop="doctor" />
|
||||
<el-table-column label="就诊时间" align="center" prop="visitingTime" width="180"> </el-table-column>
|
||||
<el-table-column label="人员姓名" align="center" width="100" prop="personName" />
|
||||
<el-table-column label="健康档案" align="center" width="160" prop="healthRecordName" />
|
||||
<el-table-column label="医院名称" align="center" width="160" prop="hospitalName" />
|
||||
<el-table-column label="科室" align="center" width="150" prop="departments" />
|
||||
<el-table-column label="大夫" align="center" width="80" prop="doctor" />
|
||||
<el-table-column label="陪同人" align="center" width="120" prop="partner" />
|
||||
<el-table-column label="就诊时间" align="center" prop="visitingTime" width="160"> </el-table-column>
|
||||
<el-table-column label="总费用(元)" align="center" width="120" prop="totalCost" />
|
||||
<el-table-column label="诊断及开药" align="center" prop="prescribe" />
|
||||
<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">
|
||||
<el-table-column label="操作" align="center" width="180" 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">
|
||||
|
||||
@@ -47,28 +47,28 @@
|
||||
<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" />
|
||||
<el-table-column label="类型" align="center" prop="type">
|
||||
<el-table-column label="人员姓名" align="center" width="100" prop="personName" />
|
||||
<el-table-column label="档案名称" align="center" width="160" prop="name" />
|
||||
<el-table-column label="类型" align="center" width="100" prop="type">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="record_type" :value="scope.row.type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="档案状态" align="center" prop="state">
|
||||
<el-table-column label="档案状态" align="center" width="120" prop="state">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="health_record_state" :value="scope.row.state" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发生时间" align="center" prop="occurTime" width="180"> </el-table-column>
|
||||
<el-table-column label="发生原因" align="center" prop="etiology">
|
||||
<el-table-column label="发生时间" align="center" prop="occurTime" width="160"> </el-table-column>
|
||||
<el-table-column label="发生原因" align="center" width="120" prop="etiology">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="etiology" :value="scope.row.etiology" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="初期症状" align="center" prop="initialSymptoms" />
|
||||
<el-table-column label="中期症状" align="center" prop="mediumTermSymptoms" />
|
||||
<el-table-column label="后期症状" align="center" prop="laterStageSymptoms" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<!-- <el-table-column label="中期症状" align="center" prop="mediumTermSymptoms" />
|
||||
<el-table-column label="后期症状" align="center" prop="laterStageSymptoms" /> -->
|
||||
<el-table-column label="操作" align="center" width="150" 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">
|
||||
@@ -138,8 +138,9 @@
|
||||
<el-dialog :title="detailTitle" v-model="detailOpen" width="1150px" append-to-body>
|
||||
<el-radio-group v-model="activeName" style="margin-bottom: 20px">
|
||||
<el-radio-button label="first">基本信息</el-radio-button>
|
||||
<el-radio-button label="second">就医信息</el-radio-button>
|
||||
<el-radio-button label="third">用药记录</el-radio-button>
|
||||
<el-radio-button label="second">就医记录</el-radio-button>
|
||||
<el-radio-button label="third">用药明细</el-radio-button>
|
||||
<el-radio-button label="marStatic">用药统计</el-radio-button>
|
||||
<el-radio-button label="fourth">体温记录</el-radio-button>
|
||||
</el-radio-group>
|
||||
<div v-if="activeName === 'first'" class="basic-information">
|
||||
@@ -198,58 +199,71 @@
|
||||
<div class="main-con">
|
||||
<div class="content-con">
|
||||
<el-table v-loading="doctorRecordLoading" :data="doctorRecordList">
|
||||
<el-table-column label="医院名称" align="center" prop="hospitalName" />
|
||||
<el-table-column label="科室" align="center" prop="departments" />
|
||||
<el-table-column label="大夫" align="center" prop="doctor" />
|
||||
<el-table-column label="医院名称" align="center" width="180" prop="hospitalName" />
|
||||
<el-table-column label="科室" align="center" width="120px" prop="departments" />
|
||||
<el-table-column label="大夫" align="center" width="100px" prop="doctor" />
|
||||
<el-table-column label="就诊时间" align="center" prop="visitingTime" width="180"> </el-table-column>
|
||||
<el-table-column label="诊断及开药" align="center" prop="prescribe" />
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="activeName === 'marStatic'" class="basic-information">
|
||||
<div class="main-con">
|
||||
<div class="content-con">
|
||||
<el-table v-loading="doctorRecordLoading" :data="mar.marMapList">
|
||||
<el-table-column label="序号" width="50" type="index" align="center">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="药品名称" align="center" prop="time" />
|
||||
<el-table-column label="用药次数" align="center" prop="value" />
|
||||
<el-table-column label="用药总量" align="center" prop="dosage" />
|
||||
<el-table-column label="单位" align="center" prop="unit" />
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="activeName === 'third'" class="basic-information">
|
||||
<div class="main-con">
|
||||
<div class="content-con">
|
||||
<el-table v-loading="marRecordLoading" :data="marRecordList">
|
||||
<el-table-column label="用药名称" align="center" prop="name" />
|
||||
<el-table-column label="用药类型" align="center" prop="type">
|
||||
<el-table v-loading="marRecordLoading" :data="mar.tableMarList">
|
||||
<el-table-column label="序号" width="50" type="index" align="center">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="mar_type" :value="scope.row.type" />
|
||||
<span>{{ scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="用药日期" width="400" align="center" prop="time" />
|
||||
<el-table-column prop="detail" label="用药明细">
|
||||
<template #default="scope">
|
||||
<span v-html="formatMultiLineData(scope.row.detail)"></span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="药品来源" 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">
|
||||
<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>
|
||||
<el-pagination small background layout="total, prev, pager, next" :total="marTotal" @current-change="handleMarCurrentChange" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="activeName === 'fourth'" class="basic-information">
|
||||
<div class="main-con">
|
||||
<div class="content-con">
|
||||
<el-table v-loading="temperatureRecordLoading" :data="temperatureRecordList">
|
||||
<el-table-column label="测量时间" align="center" prop="measureTime" />
|
||||
<el-table-column label="体温(℃)" align="center" prop="temperature">
|
||||
<el-table v-loading="temperatureRecordLoading" :data="temp.tableList">
|
||||
<el-table-column label="序号" width="50" type="index" align="center">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.temperature < 37" style="color: #37b328">{{ scope.row.temperature }}</span>
|
||||
<span v-else-if="scope.row.temperature >= 37 && scope.row.temperature < 37.5" style="color: #ff00ff">{{ scope.row.temperature }}</span>
|
||||
<span v-else-if="scope.row.temperature >= 37.5 && scope.row.temperature < 38.5" style="color: #ff0066">{{ scope.row.temperature }}</span>
|
||||
<span v-else-if="scope.row.temperature >= 38.5 && scope.row.temperature < 39.5" style="color: #ff0000">{{ scope.row.temperature }}</span>
|
||||
<span v-else-if="scope.row.temperature >= 39.5" style="color: #990000">{{ scope.row.temperature }}</span>
|
||||
<span>{{ scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="测量日期" align="center" prop="time" />
|
||||
<el-table-column label="测量次数" align="center" prop="count" />
|
||||
<el-table-column label="最高体温(℃)" align="center" prop="max" />
|
||||
<el-table-column label="最低体温(℃)" align="center" prop="min" />
|
||||
<el-table-column label="平均体温(℃" align="center" prop="average" />
|
||||
<el-table-column prop="detail" width="300" label="测量明细">
|
||||
<template #default="scope">
|
||||
<span v-html="formatMultiLineData(scope.row.detail)"></span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination small background layout="total, prev, pager, next" :total="tempTotal" @current-change="handleTempCurrentChange" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -263,6 +277,7 @@ import { listHealthRecord, getHealthRecord, delHealthRecord, addHealthRecord, up
|
||||
import { listPerson, getPerson } from '@/api/health/person'
|
||||
import { listTemperatureRecord } from '@/api/health/temperatureRecord'
|
||||
import { listMarRecord } from '@/api/health/marRecord'
|
||||
import { getMarAnalysis, getTemperatureAnalysis } from '@/api/health/statisticAnalysis'
|
||||
import { listDoctorRecord } from '@/api/health/doctorRecord'
|
||||
import dayjs from 'dayjs'
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
@@ -270,7 +285,7 @@ import { require } from '@/utils/require'
|
||||
import { nextTick, reactive, toRefs } from 'vue'
|
||||
const { proxy } = getCurrentInstance()
|
||||
const { record_type, etiology, health_record_state } = proxy.useDict('record_type', 'etiology', 'health_record_state')
|
||||
const { mar_type, mar_place, mar_resource } = proxy.useDict('mar_type', 'mar_place', 'mar_resource')
|
||||
const { mar_type, medical_unit, mar_resource } = proxy.useDict('mar_type', 'medical_unit', 'mar_resource')
|
||||
const healthRecordList = ref([])
|
||||
const open = ref(false)
|
||||
const loading = ref(true)
|
||||
@@ -290,10 +305,12 @@ const currentId = ref('')
|
||||
const marRecordLoading = ref(false)
|
||||
const marRecordList = ref([])
|
||||
const marTotal = ref(0)
|
||||
const mar = ref({})
|
||||
|
||||
const temperatureRecordLoading = ref(false)
|
||||
const temperatureRecordList = ref([])
|
||||
const tempTotal = ref(0)
|
||||
const temp = ref({})
|
||||
|
||||
const doctorRecordLoading = ref(false)
|
||||
const doctorRecordList = ref([])
|
||||
@@ -345,6 +362,11 @@ const data = reactive({
|
||||
}
|
||||
})
|
||||
|
||||
function formatMultiLineData(data) {
|
||||
if (data != null) {
|
||||
return data.replace(/<br\/>/g, '<br/>')
|
||||
}
|
||||
}
|
||||
const handleOperate = (operate, row) => {
|
||||
switch (operate) {
|
||||
case 'view':
|
||||
@@ -499,6 +521,15 @@ const handleView = (row) => {
|
||||
marRecordList.value = res.rows
|
||||
marTotal.value = res.total
|
||||
})
|
||||
getMarAnalysis({ recordId: _id, dataType: '1', type: 1 }).then((response) => {
|
||||
loading.value = false
|
||||
mar.value = { ...response.data }
|
||||
})
|
||||
|
||||
getTemperatureAnalysis({ recordId: _id, dataType: '1', type: 1 }).then((response) => {
|
||||
loading.value = false
|
||||
temp.value = { ...response.data }
|
||||
})
|
||||
// 就医记录
|
||||
listDoctorRecord(queryDoctorRecordParams.value).then((res) => {
|
||||
doctorRecordList.value = res.rows
|
||||
|
||||
@@ -50,31 +50,31 @@
|
||||
<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" width="120" prop="personName" />
|
||||
<el-table-column label="健康档案" align="center" prop="healthRecordName" />
|
||||
<el-table-column label="健康档案" align="center" width="180" prop="healthRecordName" />
|
||||
<el-table-column label="用药名称" align="center" prop="name" />
|
||||
<el-table-column label="用药类型" align="center" prop="type">
|
||||
<el-table-column label="用药类型" align="center" width="120" prop="type">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="mar_type" :value="scope.row.type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="药品来源" width="120" align="center" prop="resource">
|
||||
<el-table-column label="药品来源" width="100" 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" width="120" prop="place">
|
||||
<el-table-column label="用药地点" align="center" width="100" 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" width="120" prop="dosage" />
|
||||
<el-table-column label="用药单位" align="center" prop="unit">
|
||||
<el-table-column label="用药剂量" align="center" width="100" prop="dosage" />
|
||||
<el-table-column label="用药单位" align="center" width="100" 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">
|
||||
<el-table-column label="操作" width="180" 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">
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
<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 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">
|
||||
@@ -15,57 +17,33 @@
|
||||
<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" height="calc(100% - 0.65rem)">
|
||||
<el-table v-loading="loading" :data="medicineStockList" @selection-change="handleSelectionChange" height="calc(100% - 0.65rem)">
|
||||
<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>
|
||||
<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>
|
||||
<!-- 添加或修改药品实时库存对话框 -->
|
||||
<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'
|
||||
<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 medicineStockList = ref([])
|
||||
const medicineStockInList = ref([])
|
||||
const open = ref(false)
|
||||
const loading = ref(true)
|
||||
const showSearch = ref(true)
|
||||
@@ -74,70 +52,47 @@ 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 medicineList = ref([])
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
medicineId: null,
|
||||
inventory: null
|
||||
quantity: null,
|
||||
productionDate: null,
|
||||
expiringDate: null,
|
||||
purchaseDate: null,
|
||||
purchasePrice: null,
|
||||
code: null,
|
||||
state: null,
|
||||
leftCount: null,
|
||||
usedCount: null,
|
||||
purchaseAddress: null
|
||||
},
|
||||
rules: {}
|
||||
queryMedicineParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 1000
|
||||
}
|
||||
})
|
||||
|
||||
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, queryMedicineParams } = toRefs(data)
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
|
||||
/** 查询药品实时库存列表 */
|
||||
/** 查询药品入库清单列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
listMedicineStock(queryParams.value).then((response) => {
|
||||
medicineStockList.value = response.rows
|
||||
listMedicineRealtimeStock(queryParams.value).then((response) => {
|
||||
medicineStockInList.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 getMedicineList() {
|
||||
listMedicineBasic(queryMedicineParams.value).then((response) => {
|
||||
medicineList.value = response.rows
|
||||
})
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
@@ -167,75 +122,11 @@ function handleSelectionChange(selection) {
|
||||
|
||||
// 查看
|
||||
const handleView = (row) => {
|
||||
title.value = '查看药品实时库存'
|
||||
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()
|
||||
getMedicineList()
|
||||
</script>
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
<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-form-item label="药品名称" style="width: 480px" 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-option v-for="medicine in medicineList" :key="medicine.id" :label="medicine.shortNameBrandPackaging" :value="medicine.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库编号" prop="code">
|
||||
@@ -37,28 +37,38 @@
|
||||
<el-table-column label="药品名称" align="center" prop="medicineName" />
|
||||
<el-table-column label="购买时间" align="center" prop="purchaseDate" width="155"> </el-table-column>
|
||||
<el-table-column label="入库数量" align="center" width="100" prop="quantity" />
|
||||
<el-table-column label="单价(元)" align="center" width="100" prop="purchasePrice" />
|
||||
<el-table-column label="总价(元)" align="center" width="100" prop="totalPrice" />
|
||||
<el-table-column label="入库编号" align="center" prop="code" />
|
||||
<el-table-column label="包装单位" align="center" width="100" prop="packageUnit">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="package_unit" :value="scope.row.packageUnit" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="单价(元)" align="center" width="100" prop="purchasePrice" />
|
||||
<el-table-column label="总价(元)" align="center" width="100" prop="totalPrice" /> -->
|
||||
<el-table-column label="入库编号" align="center" width="150" prop="code" />
|
||||
<el-table-column label="使用状态" align="center" width="100" 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="100">
|
||||
<!-- <el-table-column label="生产日期" align="center" prop="productionDate" width="100">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.productionDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="过期日期" align="center" prop="expiringDate" width="120">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.expiringDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格总数" align="center" width="100" prop="totalCount" />
|
||||
<el-table-column label="使用数量" align="center" width="100" prop="usedCount" />
|
||||
<!-- <el-table-column label="使用数量" align="center" width="100" prop="usedCount" /> -->
|
||||
<el-table-column label="剩余数量" align="center" width="100" prop="leftCount" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column label="规格单位" align="center" width="100" prop="unit">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="medical_unit" :value="scope.row.unit" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="150" 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">
|
||||
|
||||
Reference in New Issue
Block a user