From 0bf196996db772956926856f9ad02d1b6d5de90a Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 17 二月 2025 10:38:47 +0800
Subject: [PATCH] 1.实验室资质联调 2.分页查询修改
---
src/api/structural/laboratory.js | 2
src/main.js | 1
src/views/structural/capabilityAndLaboratory/laboratory/index.vue | 58 +++++++++++++++++++---------
src/views/structural/capabilityAndLaboratory/capability/index.vue | 6 +++
4 files changed, 47 insertions(+), 20 deletions(-)
diff --git a/src/api/structural/laboratory.js b/src/api/structural/laboratory.js
index f722e44..86ea252 100644
--- a/src/api/structural/laboratory.js
+++ b/src/api/structural/laboratory.js
@@ -13,7 +13,7 @@
return request({
url: '/certification/addCertificationDetail',
method: 'post',
- params: query
+ data: query
})
}
// 鍒犻櫎璧勮川鏄庣粏鍒楄〃
diff --git a/src/main.js b/src/main.js
index 2be086c..5d36f6c 100644
--- a/src/main.js
+++ b/src/main.js
@@ -51,6 +51,7 @@
Vue.prototype.HaveJson = (val) => {
return JSON.parse(JSON.stringify(val))
}
+Vue.prototype.javaApi = process.env.VUE_APP_BASE_API
// 鍏ㄥ眬缁勪欢鎸傝浇
Vue.component('DictTag', DictTag)
diff --git a/src/views/structural/capabilityAndLaboratory/capability/index.vue b/src/views/structural/capabilityAndLaboratory/capability/index.vue
index e23cb5b..24b4578 100644
--- a/src/views/structural/capabilityAndLaboratory/capability/index.vue
+++ b/src/views/structural/capabilityAndLaboratory/capability/index.vue
@@ -46,11 +46,13 @@
<!-- 妫�楠岄」鐩弬鏁拌〃鏍�-->
<div class="table" v-if="radio===0">
<lims-table :tableData="tableData" :column="column"
+ @pagination="pagination"
:page="page" :tableLoading="tableLoading"></lims-table>
</div>
<!-- 妫�楠屽璞¤〃鏍�-->
<div class="table" v-if="radio===1">
<lims-table :tableData="testObjectTableData" :column="testObjectColumn"
+ @pagination="pagination"
:page="testObjectPage" :tableLoading="tableLoading"></lims-table>
</div>
</div>
@@ -461,6 +463,10 @@
this.resetForm('itemParameterForm')
this.refreshTable()
},
+ pagination (page) {
+ this.page.size = page.pageNum.limit
+ this.refreshTable()
+ },
// 妫�楠岄」鐩弬鏁版柊澧�
openAdd() {
if (this.radio === 0) {
diff --git a/src/views/structural/capabilityAndLaboratory/laboratory/index.vue b/src/views/structural/capabilityAndLaboratory/laboratory/index.vue
index f825b53..8d66a13 100644
--- a/src/views/structural/capabilityAndLaboratory/laboratory/index.vue
+++ b/src/views/structural/capabilityAndLaboratory/laboratory/index.vue
@@ -32,13 +32,14 @@
<div v-if="radio===0">
<lims-table :tableData="tableData" :column="column"
:isSelection="true" :handleSelectionChange="handleSelectionChange"
+ @pagination="pagination"
:page="page" :tableLoading="tableLoading"></lims-table>
</div>
<div class="table" v-if="radio===1" v-loading="pageLoading" @scroll="scrollFn">
<el-row :gutter="16">
- <el-col :span="6" v-for="(m,i) in list" :key="i" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" style="margin-bottom: 16px;">
+ <el-col :span="8" v-for="(m,i) in list" :key="i" :xs="24" :sm="12" :md="8" :lg="8" :xl="6" style="margin-bottom: 16px;">
<div class="table-item">
- <el-image style="width: 102px;height: 102px;margin-right: 20px;border-radius: 16px;" :src="process.env.VUE_APP_BASE_API+'/img/'+m.imageUrl">
+ <el-image style="width: 102px;height: 102px;margin-right: 20px;border-radius: 16px;" :src="javaApi +'/img/'+m.imageUrl">
<div slot="error" class="image-error" style="width: 100px;
height: 100px;
border-radius: 16px;
@@ -184,7 +185,7 @@
page: {
total:0,
size:10,
- current:0
+ current:1
},
tableLoading: false,
qualificationsList:[],
@@ -214,19 +215,19 @@
},
methods: {
selectorSwitch(radio) {
- if(radio === '1'){
+ if(radio === 1){
this.list = [];
this.refreshTable();
}
},
refreshTable() {
- if (this.radio === '0') {
+ if (this.radio === 0) {
this.tableLoading = true;
- getCertificationDetail({...this.page,...this.queryParams,}).then(res => {
+ getCertificationDetail({...this.page,...this.queryParams}).then(res => {
this.tableLoading = false
if (res.code === 200) {
- this.tableData = res.data
- this.page.total = res.total
+ this.tableData = res.data.records
+ this.page.total = res.data.total
}
}).catch(err => {
this.tableLoading = false
@@ -241,15 +242,13 @@
window.addEventListener("scroll", this.throttle(this.scrollFn, 20000));
}
getCertificationDetail({
- page: {
- current: this.currentPage,
- size: this.pageSize
- },
- entity: this.queryParams
+ current: this.currentPage,
+ size: this.pageSize,
+ ...this.queryParams
}).then(res => {
if(res.code===200){
- this.total = res.data.body.total
- let list = res.data.body.records;
+ this.total = res.data.total
+ let list = res.data.records;
if(list.length===0){
this.finishLoding = true;
}else{
@@ -272,14 +271,25 @@
},
// 閲嶇疆
refresh() {
- this.queryParams.name = ''
- this.page.size = 10
- this.page.current = 1
- this.refreshTable()
+ if(this.radio === 0){
+ this.queryParams.name = ''
+ this.page.size = 10
+ this.page.current = 1
+ this.refreshTable()
+ } else {
+ this.finishLoding = false;
+ this.currentPage= 1;
+ this.list=[];
+ this.refreshTable()
+ }
},
// 琛ㄦ牸澶氶��
handleSelectionChange (selection) {
this.selection = selection;
+ },
+ pagination (page) {
+ this.page.size = page.pageNum.limit
+ this.refreshTable()
},
// 璧勮川鏄庣粏鎵归噺鍒犻櫎
handleDel(){
@@ -406,4 +416,14 @@
line-height: 40px;
margin-bottom: 10px;
}
+.table-item{
+ border-radius: 8px 8px 8px 8px;
+ box-shadow: 4px 4px 8px 0px rgba(51,51,51,0.04);
+ border: 1px solid #EEEEEE;
+ box-sizing: border-box;
+ padding: 14px 12px;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
</style>
--
Gitblit v1.9.3