|
@@ -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 {
|