123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- <template>
- <view class="gradingControl">
- <scroll-view scroll-y @scrolltolower="scrollGet" class="for-max-box">
- <img class="null-img" v-if="!dataList[0]" src="@/pages_manage/images/null-data-1.png">
- <view class="for-box" v-for="(item,index) in dataList" :key="index" @click="tableButton(item)">
- <view class="for-box-left">
- <view class="for-name-box">
- <view>{{item.name}}</view>
- <view :class="item.status == 1?'colorA':'colorB'">{{item.status == 1?'已执行':'未执行'}}</view>
- </view>
- <view class="for-dept-box">{{item.deptName}}</view>
- <view class="for-type-box">
- <view>{{item.typeName}}</view>
- <view>{{item.levelName}}</view>
- </view>
- </view>
- <view class="for-box-right">
- <img src="@/pages_manage/images/icon_04.png">
- </view>
- </view>
- <view class="get-data-null-p" v-if="getDataType">- 没有更多数据 -</view>
- </scroll-view>
- </view>
- </template>
- <script>
- import {
- laboratoryGradeManageList,
- } from '@/pages_manage/api/index.js'
- export default {
- name: "gradingControl",
- data() {
- return {
- // 查询参数
- queryParams: {
- page: 1,
- pageSize: 10,
- name: "",
- deptId: null,
- typeId: null,
- levelId: null,
- },
- getDataType: false,
- //列表数据
- dataList: [],
- }
- },
- onLoad(option) {
-
- },
- onShow() {
- this.getList();
- },
- methods: {
- //滚动加载事件
- scrollGet() {
- let self = this;
- if (self.total / self.queryParams.pageSize <= self.queryParams.page) {
- this.$set(this, 'getDataType', true);
- } else {
- this.queryParams.page += 1;
- this.$nextTick(() => {
- this.getList();
- })
- }
- },
- //获取分级管控列表
- async getList() {
- let self = this;
- let obj = JSON.parse(JSON.stringify(this.queryParams));
- obj.executionUserId = uni.getStorageSync('userId')
- const {
- data
- } = await laboratoryGradeManageList(obj);
- if (data.code == 200) {
- if (self.queryParams.page == 1) {
- this.dataList = data.data.records;
- this.total = data.data.total;
- if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
- this.$set(this, 'getDataType', true);
- }
- } else {
- this.dataList = [...this.dataList, ...data.data.records]
- this.total = data.data.total;
- if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
- this.$set(this, 'getDataType', true);
- }
- }
- }
- },
- tableButton(item) {
- uni.navigateTo({
- url: '/pages_manage/views/gradingControl/infoPage?infoData=' + encodeURIComponent(JSON.stringify(item))
- });
- },
- }
- }
- </script>
- <style lang="stylus" scoped>
- .gradingControl {
- height: 100%;
- display: flex;
- flex-direction: column;
- .for-max-box {
- flex: 1;
- overflow-y scroll;
- .null-img {
- display block;
- width: 276rpx;
- height: 321rpx;
- position absolute;
- top: 200rpx;
- left: 274rpx;
- }
- .for-box:nth-child(1) {
- border-top: none;
- }
- .for-box {
- display: flex;
- padding: 10px;
- border-top: 4rpx solid #dedede;
- overflow hidden;
- background #ffffff;
- view {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- font-size: 32rpx;
- color: #333;
- line-height: 60rpx;
- }
- .for-box-left {
- flex: 1;
- .for-name-box {
- display: flex;
- view:nth-child(1) {
- flex: 1;
- font-size: 36rpx;
- }
- view:nth-child(2) {
- width: 100rpx;
- margin-left: 20rpx;
- }
- .colorA {
- color: #0183FA;
- }
- .colorB {
- color: #999;
- }
- }
- .for-dept-box {}
- .for-type-box {
- display: flex;
- view {
- flex: 1;
- }
- }
- }
- .for-box-right {
- img {
- margin-top: 80rpx;
- width: 12rpx;
- height: 24rpx;
- }
- }
- }
- .get-data-null-p {
- text-align: center;
- line-height: 80rpx;
- padding-bottom: 40px;
- color: #999;
- }
- }
- }
- </style>
|