huangxw 10 місяців тому
батько
коміт
3ec26c9b6a

+ 40 - 0
src/api/cdt/items/index.ts

@@ -0,0 +1,40 @@
+import request from '@/utils/request';
+import { AxiosPromise } from 'axios';
+
+/**
+ * 按检测项目树
+ * @param query
+ * @returns {*}
+ */
+
+export const itemsListByTree = (query?: any): any => {
+  return request({
+    url: '/dgtmedicine/testItemType/listByTree',
+    method: 'get',
+    params: query
+  });
+};
+/**
+ * 查询检测项目列表
+ * @param query
+ * @returns {*}
+ */
+export const itemsList = (query?: any): any => {
+  return request({
+    url: '/dgtmedicine/testItem/list',
+    method: 'get',
+    params: query
+  });
+}
+/**
+ * 查询检测执行标准列表
+ * @param query
+ * @returns {*}
+ */
+export const itemsStandardList = (query?: any): any => {
+  return request({
+    url: '/dgtmedicine/testPackage/listForBackground',
+    method: 'get',
+    params: query
+  });
+}

+ 9 - 0
src/assets/styles/element-ui.scss

@@ -151,3 +151,12 @@
 .el-message-box .el-message-box__message {
   word-break: break-word;
 }
+
+.base-tree-tabs {
+  .el-tree-node__content {
+    --el-tree-node-content-height: 36px;
+  }
+  &.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
+     color: var(--el-color-primary);
+  }
+}

+ 0 - 4
src/assets/styles/index.scss

@@ -162,10 +162,6 @@ aside {
   position: relative;
 }
 
-.pagination-container {
-  margin-top: 30px;
-}
-
 .text-center {
   text-align: center;
 }

+ 0 - 13
src/assets/styles/ruoyi.scss

@@ -159,14 +159,6 @@ h6 {
   padding-bottom: 5px;
 }
 
-/** 表格布局 **/
-.pagination-container {
-  // position: relative;
-  height: 25px;
-  margin-bottom: 10px;
-  margin-top: 15px;
-  padding: 10px 20px !important;
-}
 
 /* tree border */
 .tree-border {
@@ -177,11 +169,6 @@ h6 {
   width: 100%;
 }
 
-.pagination-container .el-pagination {
-  //right: 0;
-  //position: absolute;
-}
-
 @media (max-width: 768px) {
   .pagination-container .el-pagination > .el-pagination__jump {
     display: none !important;

+ 3 - 4
src/components/Pagination/index.vue

@@ -77,10 +77,9 @@ function handleCurrentChange(val: number) {
 
 <style lang="scss" scoped>
 .pagination-container {
-  padding: 32px 16px;
-  .el-pagination {
-    float: v-bind(float);
-  }
+  display: flex;
+  justify-content: flex-end;
+  padding: 10px 30px;
 }
 .pagination-container.hidden {
   display: none;

+ 108 - 7
src/views/cdt/items/index.vue

@@ -7,8 +7,8 @@
             </div>
             <div class="pd-16">
                 <el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="auto">
-                    <el-form-item label="会员名称" prop="cpyName">
-                        <el-input v-model="queryParams.cpyName" placeholder="搜会员名称关键字" clearable style="width: 180px" @keyup.enter="handleQuery" />
+                    <el-form-item label="检测项名称:" prop="name">
+                        <el-input v-model="queryParams.name" placeholder="请输入检测项名称关键字" clearable style="width: 180px" @keyup.enter="handleQuery" />
                     </el-form-item>
                     <el-form-item>
                         <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
@@ -16,22 +16,123 @@
                     </el-form-item>
                 </el-form>
             </div>
+            <div class="flex1 ov-hd d-flex content-border">
+                <div class="tree-wrap">
+                   <div v-show="tabActive === '1'">
+                    <el-tree ref="treeItemsRef" class="base-tree-tabs" auto-expand-parent default-expand-all node-key="id" :data="itemsData" :props="{ label: 'name' }" highlight-current @node-click="itemsClick" accordion>
+                        <template #default="{ node, data }">
+                            <span>{{ node.label }} <template v-if="!data?.children">({{ data?.itemCount || '0' }})</template></span>
+                        </template>
+                    </el-tree>
+                   </div>
+                   <div v-show="tabActive === '2'">
+                    <el-tree ref="treeStandardsRef" class="base-tree-tabs" auto-expand-parent :data="standards" node-key="id" :props="{ label: 'name' }" highlight-current @node-click="standardsClick" accordion>
+                        <template #default="{ node, data }">
+                            <span>{{ node.label }} <template v-if="!data?.children">({{ data?.itemCount || '0' }})</template></span>
+                        </template>
+                    </el-tree>
+                   </div>
+                </div>
+                <div class="flex1 ov-hd d-flex flex-cln">
+                    <div class="flex1 ov-hd">
+                        <vxe-table :loading="loading" border :data="list" min-height="0" max-height="100%">
+                            <!-- 序号 -->
+                            <vxe-column type="seq" width="60" title="序号" align="center" />
+                            <vxe-column title="检测项目" align="center" field="name" min-width="100" :formatter="colNoData" />
+                            <vxe-column title="单价(元、批次)" align="center" field="price" min-width="100" :formatter="colNoData" />
+                            <vxe-column title="备注" align="center" field="description" min-width="100" :formatter="colNoData" />
+                        </vxe-table>
+                    </div>
+                    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
+                    <div class="pd-5"></div>
+                </div>
+            </div>
         </div>
     </div>
 </template>
 <script setup name="Items" lang="ts">
+import { itemsList, itemsListByTree, itemsStandardList } from '@/api/cdt/items';
+import { colNoData } from '@/utils/noData';
 import { searchTabs } from '@/views/models/index';
+
+// 树组件
+const treeItemsRef = ref<any>();
+const treeStandardsRef = ref<any>();
 const tabActive = ref('1');
-const queryParams = ref({
-    cpyName: '',
+const queryParams = ref<any>({
+    pageNum: 1,
+    pageSize: 10,
+    name: '',
+    itemTypeId: '',
+    packageId: ''
 });
+const loading = ref(false);
+const total = ref(0);
+const list = ref<any>([]);
+const itemsData = ref<any>([]);
+const getList = async () => {
+    loading.value = true;
+    const res = await itemsList(queryParams.value);
+    if (!res || res.code !== 200) return;
+    list.value = res.rows;
+    total.value = res.total;
+    loading.value = false;
+};
 const handleQuery = () => {
-    console.log('handleQuery');
+    queryParams.value.pageNum = 1;
+    getList();
 };
 const resetQuery = () => {
-    console.log('resetQuery');
+    queryParams.value = {
+        pageNum: 1,
+        pageSize: 10,
+        name: '',
+        itemTypeId: '',
+        packageId: ''
+    };
+    // 重置树高亮
+    treeItemsRef.value?.setCurrentKey(null, true);
+    treeStandardsRef.value?.setCurrentKey(null, true);
+    handleQuery()
+};
+const getTabsTree = async () => {
+    const res = await itemsListByTree();
+    if (!res || res.code !== 200) return;
+    itemsData.value = res.data;
+};
+const itemsClick = (data: any) => {
+    if (!data.children) {
+        queryParams.value.itemTypeId = data.id;
+    }
+    handleQuery()
+};
+const standardsClick = (data: any) => {
+    if (!data.children) {
+        queryParams.value.packageId = data.id;
+    }
+    handleQuery()
+};
+// 查询执行标准列表
+const standards = ref<any>([]);
+const getStandardList = async () => {
+    const res = await itemsStandardList({ pageNum: 1, pageSize: 10000 });
+    if (!res || res.code !== 200) return;
+    standards.value = res.rows;
 };
 onMounted(() => {
-    console.log("Items mounted");
+    getTabsTree();
+    getStandardList();
+    getList();
 });
 </script>
+<style lang="scss" scoped>
+.tree-wrap {
+    width: 310px;
+    box-sizing: border-box;
+    border-right: 1px solid #ebeef5;
+    padding: 16px;
+}
+.content-border {
+    border: 1px solid var(--border-color);
+}
+</style>

+ 0 - 3
src/views/dgtmedicine/model/MemberPayLog.vue

@@ -69,9 +69,6 @@ const getList = async () => {
 /** 搜索按钮操作 */
 const handleQuery = (level?: any) => {
     queryParams.value.pageNum = 1;
-    if (level !== undefined && level !== null && level.type !== 'click') {
-        queryParams.value.vipLevel = level.type;
-    }
     getList();
 };
 

+ 0 - 3
src/views/dgtmedicine/pay-log/index.vue

@@ -98,9 +98,6 @@ const getList = async () => {
 /** 搜索按钮操作 */
 const handleQuery = (level?: any) => {
   queryParams.value.pageNum = 1;
-  if (level !== undefined && level !== null && level.type !== 'click') {
-    queryParams.value.vipLevel = level.type;
-  }
   getList();
 };