YangJian0701 1 year ago
parent
commit
e3fbc2db3d

+ 2 - 0
src/api/index.ts

@@ -6,6 +6,8 @@ export * from './module/sellManage'
 
 export * from './module/storageOrderGoods'
 export * from './module/essentialinfo'
+export * from './module/transmitReceive'
+
 
 
 

+ 4 - 12
src/api/module/storageInquire.ts

@@ -1,20 +1,12 @@
 
 import $http from '@/utils/index'
 
-// 公司列表树
-export const stockList = (params: any) => $http.post('/stock-template/inventory/list', params)
+// 库存查询-列表
+export const stockStatList = (params: any) => $http.post('/stock/stat/list', params)
 
 
-// 公司列表树-添加
-// export const postTree = (params: any) => $http.post('/dept', params)
+// 库存查询-导出
+export const stockStatexcel = (params: any) => $http.post('/stock/stat/excel', params)
 
-// // 公司列表树-删除
-// export const deleteTree = (params: any) => $http.delete('/dept', params)
-
-// // 公司列表树-编辑
-// export const putTree = (params: any) => $http.put('/dept', params)
-
-// // 公司列表树-进入
-// export const postEnter = (params: any) => $http.post('/dept/enter', params)
 
 

+ 14 - 0
src/api/module/transmitReceive.ts

@@ -0,0 +1,14 @@
+
+import $http from '@/utils/index'
+
+
+
+// 收发记录-列表
+export const inventoryList = (params: any) => $http.post('/stock-template/inventory/list', params)
+// // 品种
+// export const prodList = (params: any) => $http.post('/product/list', params)
+// //购货单位
+// export const stockunit = (params: any) => $http.post('/stock/unit/list', params)
+
+
+

+ 47 - 0
src/components/Autocomplete.vue

@@ -0,0 +1,47 @@
+<!--  -->
+<template>
+    <el-autocomplete v-model="state1" :fetch-suggestions="querySearch" clearable class="inline-input w-50"
+        placeholder="Please Input" @select="handleSelect" style="width: 200px;" @change="handleSelect"/>
+</template>
+
+<script setup lang="ts">
+import { ref } from 'vue'
+const state1 = ref('')
+const props = defineProps({
+    initParam: {
+        type: Array,
+        default: () => [
+            { value: 'vue', link: 'https://github.com/vuejs/vue' },
+            { value: 'element', link: 'https://github.com/ElemeFE/element' },
+            { value: 'cooking', link: 'https://github.com/ElemeFE/cooking' },
+            { value: 'mint-ui', link: 'https://github.com/ElemeFE/mint-ui' },
+            { value: 'vuex', link: 'https://github.com/vuejs/vuex' },
+            { value: 'vue-router', link: 'https://github.com/vuejs/vue-router' },
+            { value: 'babel', link: 'https://github.com/babel/babel' },
+        ]
+    }
+})
+interface RestaurantItem {
+    value: string
+    link: string
+}
+const querySearch = (queryString: string, cb: any) => {
+    const results = queryString
+        ? props.initParam.filter(createFilter(queryString))
+        : props.initParam
+    cb(results)
+}
+const createFilter = (queryString: string) => {
+    return (restaurant: RestaurantItem) => {
+        return (
+            restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
+        )
+    }
+}
+const handleSelect = (item: RestaurantItem) => {
+    console.log('item',item)
+}
+</script>
+<style lang="scss">
+/* @import url(); 引入css类 */
+</style>

+ 27 - 0
src/utils/download.js

@@ -0,0 +1,27 @@
+/**
+ * @author yxm 
+ * @description  导出文件流
+ * @param { String } content 文件流
+ * @param { String } paraName 文件名+后缀名
+*/
+export function getContentExport(content, paraName) {
+    if (!content) {
+      return;
+    }
+    const blob = new Blob([content]);
+    if ("download" in document.createElement("a")) {
+      // 非IE下载
+      const elink = document.createElement("a");
+      elink.download = paraName;
+      elink.style.display = "none";
+      elink.href = URL.createObjectURL(blob);
+      document.body.appendChild(elink);
+      elink.click();
+      URL.revokeObjectURL(elink.href); // 释放URL 对象
+      document.body.removeChild(elink);
+    } else {
+      // IE10+下载
+      navigator.msSaveBlob(blob, file);
+    }
+    console.log('操作成功')
+}

+ 1 - 0
src/views/salesmanagement/sellManage/index.vue

@@ -114,6 +114,7 @@ const changeTime = async () => {
 }
 //搜索
 const eventFun = async ()=>{
+    console.log('提交')
     nextTick(() => {
         TableRef.value?.getTableList()
     })

+ 150 - 51
src/views/stockcontrol/storageInquire/index.vue

@@ -1,33 +1,38 @@
 <!--  -->
 <template>
     <div class="storageInquire">
-        <searchAdd isButtom="查询" :inline="true" :labelWidth="labelWidth" @event="eventFn">
+        <searchAdd isButtom="查询" @event="eventFun">
             <template #searchConter>
-                <el-form-item label="疫苗名称" :label-width="labelWidth">
-                    <el-input v-model="formInline.user" placeholder="疫苗名称" clearable style="width: 150px;" />
+                <el-form-item label="疫苗名称">
+                    <el-select v-model.number="initParam.productId" filterable remote reserve-keyword placeholder="疫苗名称"
+                        :remote-method="remoteMethod1" :loading="loading" clearable style="width: 200px;"
+                        @clear="initParam.productId = null" @click="click1">
+                        <el-option v-for="item in options1" :key="item.value" :label="item.label" :value="item.value" />
+                    </el-select>
                 </el-form-item>
-                <el-form-item label="生产企业" :label-width="labelWidth">
-                    <el-select v-model="formInline.region" placeholder="Activity zone" style="width: 150px;">
-                        <el-option label="Zone one" value="shanghai" />
-                        <el-option label="Zone two" value="beijing" />
+                <el-form-item label="生产企业">
+                    <el-select v-model.number="initParam.enterpriseId" filterable remote reserve-keyword placeholder="购货单位"
+                        :remote-method="remoteMethod2" :loading="loading" clearable @clear="initParam.enterpriseId = null"
+                        @click="click2" style="width: 200px;">
+                        <el-option v-for="item in options2" :key="item.value" :label="item.label" :value="item.value" />
                     </el-select>
                 </el-form-item>
-                <el-form-item label="疫苗批号" :label-width="labelWidth">
-                    <el-input v-model="formInline.user" placeholder="疫苗批号" clearable style="width: 150px;" />
+                <el-form-item label="疫苗批号">
+                    <el-input v-model="initParam.batchNumber" placeholder="疫苗批号" clearable style="width: 200px;" />
                 </el-form-item>
-                <el-form-item label="疫苗效期" :label-width="labelWidth">
-                    <el-date-picker v-model="formInline.date" type="daterange" placeholder="疫苗效期" clearable
-                        style="width: 200px;" />
+                <el-form-item label="疫苗效期">
+                    <el-date-picker v-model="data.datepick" type="daterange" placeholder="出/入库日期" clearable
+                        start-placeholder="开始" end-placeholder="结束" value-format="YYYY-MM-DD" style="width: 200px;"
+                        @change="changFun" />
                 </el-form-item>
             </template>
         </searchAdd>
         <bg istitle="库存统计列表">
             <template #btn>
-                <el-button round :icon="Download">下载</el-button>
-                <el-button round :icon="Tickets">打印</el-button>
+                <el-button type="primary" :icon="Download" @click="downloadExcel">导出</el-button>
             </template>
             <template #bg>
-                <tables ref="TableRef" :requestApi="stockList" :columns="columns" :initParam="initParam">
+                <tables ref="TableRef" :requestApi="stockStatList" :columns="columns" :initParam="initParam">
                     <template #T_State="{ row }">
                         <div style="width: 10px;height: 10px;border-radius: 50%;background: red;"></div>
                     </template>
@@ -43,61 +48,155 @@
 
 <script setup lang="ts">
 import searchAdd from "@/components/searchAdd.vue";
-import { stockList } from "@/api/index";
+import { getContentExport } from '@/utils/download.js'
+import {
+    stockStatList,
+    stockStatexcel,
+    productList,//疫苗名称
+    enterpriseList,//生产企业
+} from "@/api";
 import tables from "@/components/table.vue";
 import bg from '@/components/bg.vue'
-import { Download, Tickets } from '@element-plus/icons-vue'
-import { reactive, ref } from "vue";
+import { Download } from '@element-plus/icons-vue'
+import { reactive, ref, onMounted } from "vue";
 const TableRef = ref()
-const formInline = reactive({
-    user: '',
-    region: '',
-    date: '',
-})
-const labelWidth = ref('90px')
+const loading = ref(false)
+import axios from "axios";
+//函数
+const downloadExcel = async () => {
+    axios.post('http://192.168.11.77:8110/api/stock/stat/excel', initParam, { responseType: 'blob' }).then(response => {
+        const url = window.URL.createObjectURL(new Blob([response.data]));
+        const link = document.createElement('a');
+        link.style.display = 'none'
+        link.href = url;
+         const filename = 'filename.xlsx';
+         link.setAttribute("download", decodeURI(filename));// 指定下载后的文件名,防跳转
+        document.body.appendChild(link);
+        link.click();
+        document.body.removeChild(link);
+      }).catch(error => {
+        // 处理错误
+        console.error(error);
+      });
+    return
+
+
+    // const fileStream = result.data; // 从响应中获取文件流数据
+    // // 创建 Blob 对象
+    // const blob = new Blob([fileStream], { type: 'application/octet-stream' });
+    // // 创建链接元素
+    // const linkElement = document.createElement('a');
+    // linkElement.href = window.URL.createObjectURL(blob);
+    // linkElement.download = 'filename.xlsx'; // 指定下载时显示的文件名及格式(根据实际情况修改)
+
+    // // 触发点击事件开始下载
+    // linkElement.click();
+}
 // 渲染表格
 const columns: any = [
     { type: 'index', label: '编号', width: 80, },
-    { prop: 'T_D_name', label: '疫苗名称', width: 150 },
-    { prop: 'T_D_name', label: '生产企业', width: 150 },
-    { prop: 'T_D_name', label: '批准文号', width: 150 },
-    { prop: 'T_D_name', label: '批签发合格编号', width: 200, },
-    { prop: 'T_D_name', label: '规格(剂/支或粒)', width: 150, },
-    { prop: 'T_D_name', label: '生产日期', width: 150 },
-    { prop: 'T_D_name', label: '疫苗批号', width: 150 },
-    { prop: 'T_D_name', label: '疫苗效期', width: 150 },
-    { prop: 'T_State', label: '类型', name: 'T_State', width: 80 },
-    { prop: 'T_D_name', label: '收入数量', width: 150 },
-    { prop: 'T_D_name', label: '发出数量', width: 150 },
-    { prop: 'T_D_name', label: '结余数量', width: 150 },
-    { prop: 'T_D_name', label: '单位', width: 150 },
-    { prop: 'T_D_name', label: '剂型', width: 150 },
-    { prop: 'T_D_name', label: '领苗人', width: 150 },
-    { prop: 'T_D_name', label: '发货单位', width: 150 },
-    { prop: 'T_D_name', label: '收货单位', width: 150 },
-    { prop: 'T_D_name', label: '入/出库日期', width: 150, },
-    { prop: 'operation', label: '操作', fixed: 'right', 'min-width': 200 }
+    { prop: 'product_name', label: '疫苗名称', width: 150 },
+    { prop: 'enterprise_name', label: '生产企业', 'min-width': 150 },
+    { prop: 'spec_name', label: '规格(剂/支或粒)', width: 150 },
+    { prop: 'dosage_form_name', label: '剂型', width: 100, },
+    { prop: 'unit_name', label: '单位', width: 100, },
+    { prop: 'balance', label: '数量', width: 100 },
+    { prop: 'purchase_unit_price', label: '购进单价', width: 150 },
+    { prop: 'sales_unit_price', label: '销售单价', width: 150 },
+    { prop: 'batch_number', label: '批号', name: 'T_State' },
+    { prop: 'expiry_date', label: '效期', width: 150 },
+    { prop: 'approval_number', label: '批准文号', width: 150 },
+    { prop: 'qualification_number', label: '批签发编号', width: 150 },
 ]
+const data = reactive({
+    datepick: ''
+})
+interface RuleForm {
+    batchNumber: string,
+    enterpriseId?: any,
+    endDate: string,
+    startDate: string,
+    productId?: any,
+}
 //请求参数
-const initParam = { 
-    "page": 1,
-    "pageSize": 10,
+const initParam = reactive<RuleForm>({
     "batchNumber": "",
-    "enterpriseId": 0,
+    "enterpriseId": null,
     "endDate": "",
     "startDate": "",
-    "productId": 1,
-    "sendReceiveUnit":"贵阳"
-}
+    "productId": null,
+})
 
 /**
  * 
  * @param val 子传值
  */
-const eventFn = (val: any) => {
+const eventFun = (val: any) => {
     console.log('/', val);
     TableRef.value?.getTableList()
 }
+onMounted(async () => {
+    const result1: any = await productList({ age: 1, pageSize: 999 })//疫苗名称
+    const result2: any = await enterpriseList({ age: 1, pageSize: 999 })//生产企业
+
+    list1.value = findMap(result1.data.list, 'obj')
+    list2.value = findMap(result2.data.list, 'obj')
+})
+//函数
+const changFun = async (e: any) => {
+    if (e) { initParam.startDate = e[0]; initParam.endDate = e[1] }
+    else { initParam.startDate = ""; initParam.endDate = "" }
+}
+interface ListItem {
+    value: string
+    label: string
+}
+//函数
+const click1 = async () => { options1.value = list1.value }
+const click2 = async () => { options2.value = list2.value }
+
+const list1 = ref<ListItem[]>([])//疫苗名称
+const list2 = ref<ListItem[]>([])//生产企业
+
+//函数
+const findMap = (arr: any, obj: any) => {
+    return arr.map((item: any) => {
+        return { value: obj == 'obj' ? item.id : item, label: obj == 'obj' ? item.name : item }
+    })
+}
+
+
+const options1 = ref<ListItem[]>([])
+const options2 = ref<ListItem[]>([])
+
+const remoteMethod1 = async (query: string) => {
+    if (query) {
+        loading.value = true
+        setTimeout(() => {
+            loading.value = false
+            options1.value = list1.value.filter((item: any) => {
+                return item.label.toLowerCase().includes(query.toLowerCase())
+            })
+        }, 200)
+    } else {
+        options1.value = []
+    }
+}
+const remoteMethod2 = async (query: string) => {
+    if (query) {
+        loading.value = true
+        setTimeout(() => {
+            loading.value = false
+            options2.value = list2.value.filter((item: any) => {
+                console.log('第一个', query, item)
+                return item.label.toLowerCase().includes(query.toLowerCase())
+            })
+        }, 200)
+    } else {
+        options2.value = []
+    }
+}
+
 </script>
 <style lang="scss">
 /* @import url(); 引入css类 */

+ 176 - 71
src/views/stockcontrol/transmitReceive/index.vue

@@ -1,31 +1,31 @@
 <!--  -->
 <template>
     <div class="storagePut">
-        <searchAdd isButtom="查询">
+        <searchAdd isButtom="查询" @event="userListApi()">
             <template #searchConter>
                 <el-form-item label="疫苗名称">
-                    <el-input v-model="formInline.user" placeholder="疫苗名称" clearable style="width: 150px;" />
+                    <el-select v-model.number="initParam.productId" filterable remote reserve-keyword placeholder="疫苗名称"
+                        :remote-method="remoteMethod1" :loading="loading" clearable style="width: 200px;" @clear="initParam.productId=null" @click="click1">
+                        <el-option v-for="item in options1" :key="item.value" :label="item.label" :value="item.value" />
+                    </el-select>
                 </el-form-item>
                 <el-form-item label="生产企业">
-                    <el-select v-model="formInline.region" placeholder="生产企业" clearable style="width: 150px;">
-                        <el-option label="Zone one" value="shanghai" />
-                        <el-option label="Zone two" value="beijing" />
+                    <el-select v-model.number="initParam.enterpriseId" filterable remote reserve-keyword placeholder="购货单位"
+                        :remote-method="remoteMethod2" :loading="loading" clearable @clear="initParam.enterpriseId=null" @click="click2" style="width: 200px;">
+                        <el-option v-for="item in options2" :key="item.value" :label="item.label" :value="item.value" />
                     </el-select>
                 </el-form-item>
                 <el-form-item label="疫苗批号">
-                    <el-select v-model="formInline.region" placeholder="疫苗批号" clearable style="width: 150px;">
-                        <el-option label="Zone one" value="shanghai" />
-                        <el-option label="Zone two" value="beijing" />
-                    </el-select>
+                    <el-input v-model="initParam.batchNumber" placeholder="疫苗批号" clearable style="width: 200px;" />
                 </el-form-item>
                 <el-form-item label="出/入库日期">
-                    <el-date-picker v-model="formInline.date" type="date" placeholder="出/入库日期" clearable
-                        style="width: 150px;" />
+                    <el-date-picker v-model="data.datepick" type="daterange" placeholder="出/入库日期" clearable value-format="YYYY-MM-DD"
+                        style="width: 200px;" @change="changFun" />
                 </el-form-item>
-                <el-form-item label="发货(收货单位)">
-                    <el-select v-model="formInline.region" placeholder="发货(收货单位)" clearable style="width: 150px;">
-                        <el-option label="Zone one" value="shanghai" />
-                        <el-option label="Zone two" value="beijing" />
+                <el-form-item label="收发单位">
+                    <el-select v-model="initParam.sendReceiveUnit" filterable remote reserve-keyword placeholder="收发单位"
+                        :remote-method="remoteMethod3" :loading="loading" clearable @click="click3" style="width: 200px;">
+                        <el-option v-for="item in options3" :key="item.value" :label="item.label" :value="item.value" />
                     </el-select>
                 </el-form-item>
             </template>
@@ -36,12 +36,15 @@
                 <el-button el-button type="primary" icon="Tickets">打印</el-button>
             </template>
             <template #bg>
-                <el-table ref="multipleTableRef" :data="tableData" style="width: 100%"
-                    @selection-change="handleSelectionChange">
+                <el-table ref="multipleTableRef" :data="data.tableData" style="width: 100%"
+                    @selection-change="handleSelectionChange" :row-key="(row: any) => { return row.id }">
                     <template v-for="(item, i) in columns" :key="i">
-                        <el-table-column :type="item.type" width="55" v-if="item.type" align="center" fixed="left"/>
-                        <el-table-column :property="item.prop" v-if="item.prop" :label="item.label" align="center" :width="item.width" show-overflow-tooltip>
-                            <template #default="scope" v-if="item.prop == 'operation'" fixed="right">
+                        <el-table-column :type="item.type" width="55" v-if="item.type" :reserve-selection="true"
+                            align="center" fixed />
+                        <el-table-column :property="item.prop" v-if="item.prop" :label="item.label" align="center" :width="item.width">
+                        </el-table-column>
+                        <el-table-column v-if="item.prop == 'operation'" :label="item.label" fixed="right" min-width="200">
+                            <template #default="scope">
                                 <el-button text size="small" type="primary">编辑</el-button>
                                 <el-button text size="small" type="danger">删除</el-button>
                             </template>
@@ -49,9 +52,8 @@
                     </template>
                 </el-table>
                 <div style="margin-top: 20px;">
-                    <el-pagination v-model:current-page="data.initParam.pageNum" v-model:page-size="data.initParam.pageSize"
-                    layout="prev, pager, next" :total="50"
-                    @size-change="handleSizeChange" @current-change="handleCurrentChange" />
+                    <el-pagination v-model:current-page="initParam.page" v-model:page-size="initParam.pageSize"
+                    layout="prev, pager, next" :total="data.total" @current-change="handleCurrentChange" />
                 </div>
             </template>
         </bg>
@@ -59,60 +61,87 @@
 </template>
 
 <script setup lang="ts">
-
-
-import { userList } from "@/api";
-import { reactive, ref } from "vue";
-import tables from "@/components/table.vue";
+import {
+    inventoryList,
+    productList,//疫苗名称
+    enterpriseList,//生产企业
+    stockunit,//收发货单位
+} from "@/api";
+import { reactive, ref, onMounted } from "vue";
 import searchAdd from "@/components/searchAdd.vue";
 import bg from '@/components/bg.vue'
-import scanCode from './scanCode.vue'
-import Labour from './Labour.vue'
-
-const tableData: User[] = [
-    {
-        date: '2016-05-03',
-        name: 'Tom',
-        address: 'No. 189, Grove St, Los Angeles',
-    },
-    {
-        date: '2016-05-02',
-        name: 'Tom',
-        address: 'No. 189, Grove St, Los Angeles',
-    },]
-
-const formInline = reactive({
-    user: '',
-    region: '',
-    date: '',
+import { ElTable } from 'element-plus'
+const loading = ref(false)
+
+interface RuleForm {
+    page: number,
+    pageSize: number,
+    batchNumber: string,
+    enterpriseId?: any,
+    endDate: string,
+    startDate: string,
+    productId?: any,
+    sendReceiveUnit: string,
+}
+const initParam = reactive<RuleForm>({//请求参数
+        "page": 1,
+        "pageSize": 5,
+        "batchNumber": "",
+        "enterpriseId": null,
+        "endDate": "",
+        "startDate": "",
+        "productId":null,
+        "sendReceiveUnit": ""
 })
-const datas = reactive({
-    input: ''
+const data: any = reactive({
+    tableData: [],
+    
+    datepick:'',
+    total: 0,
+    str: ''
 })
+
+
+//函数
+const changFun = async (e:any)=>{
+    if(e){initParam.startDate=e[0];initParam.endDate=e[1]}
+    else {initParam.startDate="";initParam.endDate=""}
+}
+
+
 // 渲染表格
 const columns: any = [
     { type: 'selection', width: '60px', fixed: 'left' },
-    { prop: 'date', label: '疫苗名称', width: '120px' },
-    { prop: 'date', label: '生产企业', width: '120px' },
-    { prop: 'date', label: '批准文号', width: '120px' },
-    { prop: 'name', label: '批签发合格编号', width: '150px' },
-    { prop: 'address', label: '规格(剂/支或粒)', width: '150px' },
-    { prop: 'address', label: '生产日期', width: '120px' },
-    // { prop: 'nickName', label: '疫苗批号', width: 100 },
-    // { prop: 'username', label: '疫苗效期', width: 100 },
-    // { prop: 'username', label: '数量', width: 100 },
-    // { prop: 'username', label: '单位', width: 80 },
-    // { prop: 'username', label: '剂型', width: 100 },
-    // { prop: 'username', label: '领苗人', width: 100 },
-    // { prop: 'username', label: '发货单位', width: 200 },
-    // { prop: 'username', label: '入库日期', width: 100 },
-    { prop: 'operation', label: '操作', fixed: 'right', 'min-width': 200 }
+    { prop: 'product_name', label: '疫苗名称', width: '120px' },
+    { prop: 'enterprise_name', label: '生产企业', width: '120px' },
+    { prop: 'approval_number', label: '批准文号', width: '120px' },
+    { prop: 'batch_number', label: '疫苗批号', width: 100 },
+    { prop: 'expiry_date', label: '疫苗效期', width: 120 },
+    { prop: 'total_in', label: '收入数量', width: 100 },
+    { prop: 'total_out', label: '发出数量', width: 80 },
+    { prop: 'balance', label: '结余数量', width: 100 },
+    { prop: 'unit_name', label: '单位', width: 80 },
+    { prop: 'dosage_form_name', label: '剂型', width: 100 },
+    { prop: 'operator', label: '经办人', width: 100 },
+    { prop: 'forwarding_unit', label: '发货单位', width: 150 },
+    { prop: 'receiving_unit', label: '收货单位', width:150 },
+    { prop: 'date', label: '日期', width:120},
+    { prop: 'operation', label: '操作', fixed: 'right'}
 ]
+const userListApi = async () => {
+    const result: any = await inventoryList(initParam)
+    console.log('输入',result)
+    data.tableData = result.data.list || []
+    data.total = result.data.count
+}
+userListApi()
+
+interface User {
+    date: string
+    name: string
+    address: string
+}
 
-const data = reactive({
-    initParam: { username: '',pageNum:1,pageSize: 10 },//请求参数
-    str: ''
-})
 const multipleTableRef = ref<InstanceType<typeof ElTable>>()
 const multipleSelection = ref<User[]>([])
 const handleSelectionChange = (val: User[]) => {
@@ -120,9 +149,85 @@ const handleSelectionChange = (val: User[]) => {
     console.log('选中', multipleSelection.value);
 }
 
-//翻页
-const handleSizeChange = async ()=>{}
-const handleCurrentChange = async ()=>{}
+const handleCurrentChange = async (page: any) => {
+    initParam.page = page
+    userListApi()
+}
+
+interface ListItem {
+    value: string
+    label: string
+}
+onMounted(async () => {
+    const result1: any = await productList({ age: 1, pageSize: 999 })//疫苗名称
+    const result2: any = await enterpriseList({ age: 1, pageSize: 999 })//生产企业
+    const result3: any = await stockunit({ type: 3 })//收发货单位
+
+    list1.value = findMap(result1.data.list,'obj')
+    list2.value = findMap(result2.data.list,'obj')
+    list3.value = findMap(result3.data.list,'map')
+})
+//函数
+const click1 = async ()=>{options1.value = list1.value  }
+const click2 = async ()=>{options2.value = list2.value }
+const click3 = async ()=>{options3.value = list3.value}
+
+const list1 = ref<ListItem[]>([])//疫苗名称
+const list2 = ref<ListItem[]>([])//生产企业
+const list3 = ref<ListItem[]>([])//收发货单位
+
+//函数
+const findMap = (arr: any,obj: any) => {
+    return arr.map((item: any) => {
+        return { value: obj=='obj'?item.id:item, label:obj=='obj'?item.name:item }
+    })
+}
+
+
+const options1 = ref<ListItem[]>([])
+const options2 = ref<ListItem[]>([])
+const options3 = ref<ListItem[]>([])
+
+const remoteMethod1 = async (query: string) => {
+    if (query) {
+        loading.value = true
+        setTimeout(() => {
+            loading.value = false
+            options1.value = list1.value.filter((item: any) => {
+                return item.label.toLowerCase().includes(query.toLowerCase())
+            })
+        }, 200)
+    } else {
+        options1.value = []
+    }
+}
+const remoteMethod2 = async (query: string) => {
+    if (query) {
+        loading.value = true
+        setTimeout(() => {
+            loading.value = false
+            options2.value = list2.value.filter((item: any) => {
+                console.log('第一个',query,item)
+                return item.label.toLowerCase().includes(query.toLowerCase())
+            })
+        }, 200)
+    } else {
+        options2.value = []
+    }
+}
+const remoteMethod3 = async (query: string) => {
+    if (query) {
+        loading.value = true
+        setTimeout(() => {
+            loading.value = false
+            options3.value = list3.value.filter((item: any) => {
+                return item.label.toLowerCase().includes(query.toLowerCase())
+            })
+        }, 200)
+    } else {
+        options3.value = []
+    }
+}
 </script>
 <style lang="scss">
 .storagePut {

+ 1 - 1
tsconfig.json

@@ -34,7 +34,7 @@
     "src/**/*.vue",
     "tests/**/*.ts",
     "tests/**/*.tsx"
-, "env.d.ts", "src/plugins/eventBus.js"  ],
+, "env.d.ts", "src/plugins/eventBus.js", "src/utils/download.js"  ],
   "exclude": [
     "node_modules"
   ]