|
@@ -0,0 +1,214 @@
|
|
|
+<template>
|
|
|
+ <div id="index">
|
|
|
+ <van-row>
|
|
|
+ <van-col span="24" class="main animate__animated animate__backInRight">
|
|
|
+ <van-col span="24" class="one">
|
|
|
+ <van-col span="20" class="one_1">
|
|
|
+ <van-field v-model="searchForm.name" placeholder="请输入实验室名称" @blur="toInput" />
|
|
|
+ </van-col>
|
|
|
+ <van-col span="4" class="one_2">
|
|
|
+ <van-button size="small" @click="toChange">筛选</van-button>
|
|
|
+ </van-col>
|
|
|
+ </van-col>
|
|
|
+ <van-col span="24" class="two">
|
|
|
+ <van-col span="24" class="list" v-for="i in list" :key="i._id" @click="toView(i)">
|
|
|
+ <van-col span="24" class="name">
|
|
|
+ {{ i.name }}
|
|
|
+ </van-col>
|
|
|
+ <van-col span="24" class="other">
|
|
|
+ <van-col span="24" class="other_1">
|
|
|
+ <span>实验室主任:</span>
|
|
|
+ <span>{{ i.chief_name || '暂无' }}</span>
|
|
|
+ </van-col>
|
|
|
+ <van-col span="24" class="other_1">
|
|
|
+ <span>实验室联系人:</span>
|
|
|
+ <span>{{ i.lab_person || '暂无' }}</span>
|
|
|
+ </van-col>
|
|
|
+ <van-col span="24" class="other_1">
|
|
|
+ <span>实验室联系电话:</span>
|
|
|
+ <span>{{ i.lab_phone || '暂无' }}</span>
|
|
|
+ </van-col>
|
|
|
+ </van-col>
|
|
|
+ </van-col>
|
|
|
+ </van-col>
|
|
|
+ <van-col span="24" class="thr">
|
|
|
+ <cPage :total="total" @search="search">
|
|
|
+ <template v-slot:info>
|
|
|
+ <van-col span="24">第一部分</van-col>
|
|
|
+ </template>
|
|
|
+ </cPage>
|
|
|
+ </van-col>
|
|
|
+ </van-col>
|
|
|
+ </van-row>
|
|
|
+ <cPopup :popupInfo="popupInfo">
|
|
|
+ <template v-slot:info>
|
|
|
+ <van-col span="24" class="popup_one" v-if="popupInfo.type == '1'">
|
|
|
+ <van-form @submit="btSearch" label-width="6em">
|
|
|
+ <van-cell-group>
|
|
|
+ <van-field v-model="searchForm.chief_name" name="chief_name" label="实验室主任" placeholder="实验室主任" />
|
|
|
+ <van-field v-model="searchForm.lab_person" name="lab_person" label="实验室联系人" placeholder="实验室联系人" />
|
|
|
+ <van-field name="status" label="状态">
|
|
|
+ <template #input>
|
|
|
+ <van-radio-group v-model="searchForm.status" direction="horizontal">
|
|
|
+ <van-radio v-for="i in statusList" :key="i.dict_value" :name="i.dict_value">{{ i.dict_label }}</van-radio>
|
|
|
+ </van-radio-group>
|
|
|
+ </template>
|
|
|
+ </van-field>
|
|
|
+ </van-cell-group>
|
|
|
+ <div class="btn">
|
|
|
+ <van-button size="small" type="primary" native-type="submit"> 提交查询 </van-button>
|
|
|
+ <van-button size="small" type="danger" @click="toReset()"> 重置查询 </van-button>
|
|
|
+ </div>
|
|
|
+ </van-form>
|
|
|
+ </van-col>
|
|
|
+ </template>
|
|
|
+ </cPopup>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+// 基础
|
|
|
+// 基础
|
|
|
+import _ from 'lodash';
|
|
|
+import type { Ref } from 'vue';
|
|
|
+import { ref, getCurrentInstance, onMounted } from 'vue';
|
|
|
+import { useRouter } from 'vue-router';
|
|
|
+
|
|
|
+// 接口
|
|
|
+import { BasicStore } from '@common/src/stores/basic/basic';
|
|
|
+import { DictDataStore } from '@common/src/stores/users/sysdictdata'; // 字典表
|
|
|
+import type { IQueryResult } from '@/util/types.util';
|
|
|
+const basic = BasicStore();
|
|
|
+const dictAxios = DictDataStore();
|
|
|
+
|
|
|
+// 基本设置
|
|
|
+const { proxy } = getCurrentInstance() as any;
|
|
|
+// 路由
|
|
|
+const router = useRouter();
|
|
|
+
|
|
|
+const list: Ref<any> = ref([]);
|
|
|
+const total: Ref<any> = ref(0);
|
|
|
+const skip = 0;
|
|
|
+const limit: number = proxy.$limit;
|
|
|
+const searchForm: Ref<any> = ref({}); // 查询
|
|
|
+
|
|
|
+// 字典表
|
|
|
+const statusList: Ref<any> = ref([]);
|
|
|
+
|
|
|
+// 弹出层
|
|
|
+const popupInfo: Ref<any> = ref({ show: false, type: '1', title: '筛选' });
|
|
|
+
|
|
|
+// 请求
|
|
|
+onMounted(async () => {
|
|
|
+ // 查询其他信息
|
|
|
+ await searchOther();
|
|
|
+ // 查询列表
|
|
|
+ await search({ skip, limit });
|
|
|
+});
|
|
|
+const search = async (e: { skip: number; limit: number }) => {
|
|
|
+ const condition = _.cloneDeep(searchForm.value);
|
|
|
+ const info = { skip: e.skip, limit: e.limit, ...condition };
|
|
|
+ const res: IQueryResult = await basic.query(info);
|
|
|
+ if (res.errcode == 0) {
|
|
|
+ list.value = res.data as [];
|
|
|
+ total.value = res.total;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+// 名称查询
|
|
|
+const toInput = () => {
|
|
|
+ search({ skip, limit });
|
|
|
+};
|
|
|
+// 筛选
|
|
|
+const toChange = () => {
|
|
|
+ popupInfo.value = { show: true, type: '1', title: '筛选' };
|
|
|
+};
|
|
|
+// 查询
|
|
|
+const btSearch = (query) => {
|
|
|
+ searchForm.value = query;
|
|
|
+ toClose();
|
|
|
+ search({ skip, limit });
|
|
|
+};
|
|
|
+// 重置查询
|
|
|
+const toReset = () => {
|
|
|
+ searchForm.value = {};
|
|
|
+ toClose();
|
|
|
+ search({ skip, limit });
|
|
|
+};
|
|
|
+// 关闭弹框
|
|
|
+const toClose = () => {
|
|
|
+ popupInfo.value = { show: false, type: '1', title: '筛选' };
|
|
|
+};
|
|
|
+const toView = (e) => {
|
|
|
+ router.push({ path: '/laboratory/info/detail', query: { id: e._id } });
|
|
|
+};
|
|
|
+// 查询其他信息
|
|
|
+const searchOther = async () => {
|
|
|
+ let res: IQueryResult;
|
|
|
+ // 状态
|
|
|
+ res = await dictAxios.query({ dict_type: 'label_status' });
|
|
|
+ if (res.errcode == '0') statusList.value = res.data as [];
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style scoped lang="scss">
|
|
|
+.main {
|
|
|
+ height: 100vh;
|
|
|
+ overflow: hidden;
|
|
|
+ .one {
|
|
|
+ display: flex;
|
|
|
+ padding: 10px;
|
|
|
+ height: 9vh;
|
|
|
+ .one_1 {
|
|
|
+ .van-cell {
|
|
|
+ padding: 5px;
|
|
|
+ border: 1px solid#ff0000;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .one_2 {
|
|
|
+ .van-button {
|
|
|
+ width: 100%;
|
|
|
+ height: 5.4vh;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .two {
|
|
|
+ height: 85vh;
|
|
|
+ overflow-y: auto;
|
|
|
+ padding: 0 10px;
|
|
|
+ .list {
|
|
|
+ border: 1px solid #f1f1f1;
|
|
|
+ margin: 0 0 10px 0;
|
|
|
+ padding: 10px;
|
|
|
+ border-radius: 5px;
|
|
|
+ .name {
|
|
|
+ font-size: 16px;
|
|
|
+ margin: 0 0 5px 0;
|
|
|
+ font-family: monospace;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ .other {
|
|
|
+ .other_1 {
|
|
|
+ font-size: 14px;
|
|
|
+ margin: 0 0 5px 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .thr {
|
|
|
+ height: 6vh;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+}
|
|
|
+.popup_one {
|
|
|
+ .van-field {
|
|
|
+ padding: 5px 0;
|
|
|
+ }
|
|
|
+ .btn {
|
|
|
+ text-align: center;
|
|
|
+ margin: 10px 0;
|
|
|
+ .van-button {
|
|
|
+ margin: 0 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|