|
@@ -0,0 +1,126 @@
|
|
|
+<!-- -->
|
|
|
+<template>
|
|
|
+ <div class="medicineManage">
|
|
|
+ <searchAdd isButtom="查询" :inline="true" @event="eventFun">
|
|
|
+ <template #searchConter>
|
|
|
+ <el-form-item label="日期">
|
|
|
+ <el-date-picker v-model="data.datePicker" type="daterange" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
|
|
|
+ start-placeholder="开始时间" end-placeholder="结束时间" clearable style="width: 200px;" @change="changeTime"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="品种">
|
|
|
+ <el-select v-model="data.initParam.productId" placeholder="品种" clearable @clear="data.initParam.productId=null">
|
|
|
+ <el-option :label="item.name" :value="item.id" v-for="item,index in data.prodOptions" :key="index"/>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="购货单位">
|
|
|
+ <el-select v-model="data.initParam.receivingUnit" filterable remote reserve-keyword placeholder="购货单位"
|
|
|
+ :remote-method="remoteMethod" :loading="loading" @click="click2" clearable style="width: 200px;">
|
|
|
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </searchAdd>
|
|
|
+ <bg istitle="基本信息">
|
|
|
+ <template #bg>
|
|
|
+ <tables ref="TableRef" :requestApi="salesList" :columns="columns" :initParam="data.initParam">
|
|
|
+ <template #right="{ row }">
|
|
|
+ <el-button link type="primary" size="small">查看</el-button>
|
|
|
+ <el-button link type="danger" size="small" @click="filesFn">上传</el-button>
|
|
|
+ </template>
|
|
|
+ </tables>
|
|
|
+ </template>
|
|
|
+ </bg>
|
|
|
+ <files ref="FilesRef"></files>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+import { reactive, ref, onMounted,nextTick} from 'vue'
|
|
|
+import { medicineList,prodList,stockunit,salesList} from "@/api";
|
|
|
+
|
|
|
+import tables from "@/components/table.vue";
|
|
|
+import files from "@/components/files.vue";
|
|
|
+import searchAdd from "@/components/searchAdd.vue";
|
|
|
+import bg from '@/components/bg.vue'
|
|
|
+const TableRef = ref()
|
|
|
+const FilesRef = ref()
|
|
|
+
|
|
|
+//函数
|
|
|
+const filesFn = async ()=>{
|
|
|
+ FilesRef.value.showDrawer()
|
|
|
+}
|
|
|
+const loading = ref(false)
|
|
|
+interface ListItem {
|
|
|
+ value: string
|
|
|
+ label: string
|
|
|
+}
|
|
|
+const list = ref<ListItem[]>([])
|
|
|
+const options = ref<ListItem[]>([])
|
|
|
+ const click2 = async ()=>{options.value = list.value }
|
|
|
+onMounted(async() => {
|
|
|
+ prodListApi()
|
|
|
+ const result:any = await stockunit({type:2,name:''})
|
|
|
+ let arr = result.data?.list || []
|
|
|
+ list.value = arr.map((item:any) => {
|
|
|
+ return { value: item, label: item}
|
|
|
+ })
|
|
|
+})
|
|
|
+//品名
|
|
|
+const prodListApi = async ()=>{
|
|
|
+ const result:any = await prodList({"page": 1,"pageSize": 99999})
|
|
|
+ data.prodOptions = result.data?.list
|
|
|
+}
|
|
|
+const remoteMethod = async(query: string) => {
|
|
|
+ if (query) {
|
|
|
+ loading.value = true
|
|
|
+ setTimeout(() => {
|
|
|
+ loading.value = false
|
|
|
+ options.value = list.value.filter((item:any) => {
|
|
|
+ return item.label.toLowerCase().includes(query.toLowerCase())
|
|
|
+ })
|
|
|
+ }, 200)
|
|
|
+ } else {
|
|
|
+ options.value = []
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+// 渲染表格
|
|
|
+const columns: any = [
|
|
|
+ { prop: 'date', label: '名称', width: 120 },
|
|
|
+ { prop: 'receiving_unit', label: '批号', width: 120},
|
|
|
+ { prop: 'product_name', label: '失效日期', width: 120},
|
|
|
+ { prop: 'enterprise_name', label: '生产日期', width: 120},
|
|
|
+ { prop: 'spec_name', label: '批准文号', width: 120},
|
|
|
+ { prop: 'dosage_form_name', label: '生产企业', width: 120},
|
|
|
+ { prop: 'batch_number', label: '规格(剂/粒/支)', width: 150},
|
|
|
+ { prop: 'unit_name', label: '单位', width: 120},
|
|
|
+ { prop: 'quantity', label: '剂型', width: 120},
|
|
|
+ { prop: 'unit_price', label: '批签发合格编号', width: 150},
|
|
|
+ { prop: 'operation', label: '图片', fixed: 'right', 'min-width': 150 }
|
|
|
+]
|
|
|
+
|
|
|
+//请求参数
|
|
|
+const data:any = reactive({
|
|
|
+ datePicker: [],//时间选择
|
|
|
+ prodOptions:[],
|
|
|
+ initParam: {
|
|
|
+ "endDate": "",
|
|
|
+ "startDate": "",
|
|
|
+ "productId":null,
|
|
|
+ "receivingUnit": ""
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+//函数
|
|
|
+const changeTime = async () => {
|
|
|
+ if(data.datePicker){data.initParam.startDate = data.datePicker[0];data.initParam.endDate = data.datePicker[1]}
|
|
|
+ else {data.initParam.startDate='';data.initParam.endDate = ''}
|
|
|
+}
|
|
|
+//搜索
|
|
|
+const eventFun = async ()=>{
|
|
|
+ nextTick(() => {
|
|
|
+ TableRef.value?.getTableList()
|
|
|
+ })
|
|
|
+}
|
|
|
+</script>
|