123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519 |
- <!-- 计划详情 -->
- <template>
- <view class="planDetail">
- <view class="header">
- <img class="header-bg" src="@/pages_safetyCheck/images/img_banner@1x.png">
- <view class="tabTitle">
- <view class="tabTitle_li" @tap="tabClick(index)" :key="index" v-for="(item,index) in tabText">
- <view class="tabTitle_text">
- <img :src="item.img">
- <view
- :id="curTab==index && curTab==0?'fontColor-A':(curTab==index && curTab==1?'fontColor-B':'')">
- {{item.name}}
- </view>
- <view>{{item.title}}</view>
- </view>
- <view class="line"></view>
- <view :class="{on:curTab==index}" class="tabTitle_across">
- <img src="@/pages_safetyCheck/images/img_xyzc_bg@1x.png">
- </view>
- </view>
- </view>
- </view>
- <!-- 列表部分 -->
- <scroll-view scroll-y @scrolltolower="scrollGet" class="for-max-box">
- <view class="list">
- <view class="list-li" @click="planClick(item)" v-for="(item,index) in dataList">
- <img src="@/pages_safetyCheck/images/icon_aqjc_jh@1x.png">
- <view>{{item.planTitle}}</view>
- <img src="@/pages_safetyCheck/images/icon_wd_gd@1x.png">
- </view>
- </view>
- <view class="get-data-p" v-if="!getDataType">
- <img class="get-data-img" src="@/pages_safetyCheck/images/icon_aqjc_sl.png">
- <view class="get-data-text">上拉加载</view>
- </view>
- <view class="get-data-null-p" v-if="getDataType">- 没有更多数据 -</view>
- </scroll-view>
- <!-- 弹窗部分 -->
- <view class="shade" v-if="dialogVisible">
- <view class="null-box" @click="dialogClose()"></view>
- <view class="shade_n">
- <view class="title">
- <view>检查批次</view>
- <img src="@/pages_safetyCheck/images/icon_06.png">
- </view>
- <view class="batch">
- <view class="batch-li" @click="batchClick(item)" v-for="(item,index) in batchList.checkPlanSetVoList">
- <view class="batch-li-l">
- <text>{{item.checkName}}</text>
- <text>开始检查日期:{{item.checkStartTime}}</text>
- </view>
- <view class="batch-li-r">检查进度{{item.checkSetProgress}}%
- <img src="@/pages_safetyCheck/images/icon_wd_gd@1x.png">
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- config
- } from '@/api/request/config.js'
- import {
- securityAppCheckPlanTitleList,
- } from '@/pages_safetyCheck/api/index.js'
- export default {
- name: "planDetail",
- components: {
- },
- data() {
- return {
- baseUrl: config.base_url,
- pageType: 0,
- tabText: [{
- name: '校级检查',
- title: '学校检查计划',
- img: require('@/pages_safetyCheck/images/icon_aqjc_xjjc@1x.png'),
- },
- {
- name: '学院自查',
- title: '学院自查计划',
- img: require('@/pages_safetyCheck/images/icon_aqjc_xxzc@1x.png'),
- },
- // {
- // name: '现场检查',
- // title: '检查隐患草稿',
- // img: require('@/pages_safetyCheck/images/icon_aqjc_xcjc@1x.png'),
- // },
- {
- name: '随手拍',
- title: '隐患上报整改',
- img: require('@/pages_safetyCheck/images/icon_aqjc_ssp@1x.png'),
- },
- ],
- //校级/院级
- curTab: 0,
- queryParams: {
- page: 1,
- pageSize: 20,
- checkCategory:1,//1校院巡查 2学院自查
- },
- total: 0,
- dataList: [],
- getDataType: false,
- dialogVisible: false,
- batchList: [],
- batchData:{},
- }
- },
- onLoad(option) {
- },
- onShow() {
- },
- mounted() {
- 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();
- })
- }
- },
- //顶部tab点击
- tabClick(index) {
- this.$set(this.queryParams, 'page', 1);
- this.$set(this, 'total', 0);
-
- if (this.curTab != index) {
- this.$set(this, 'dataList', []);
- if (index == 0) {
- //校级检查
- this.$set(this, 'curTab', index);
- this.$set(this.queryParams, 'checkCategory', 1);
- this.getList()
- } else if (index == 1) {
- //学院自查
- this.$set(this, 'curTab', index);
- this.$set(this.queryParams, 'checkCategory', 2);
- this.getList()
- } else if (index == 2) {
- //随手拍
- uni.navigateTo({
- url: "/pages_safetyCheck/views/snapshotManage/snapshotList",
- });
- }
- }
- },
- //检查批次点击
- batchClick(row) {
- this.$set(this.batchData,'checkPlanSetVoList',row);
- this.$nextTick(()=>{
- uni.navigateTo({
- url: '/pages_safetyCheck/views/inspectManage/inspectList?infoData=' + encodeURIComponent(JSON.stringify(this.batchData))
- });
- })
- },
- planClick(row) {
- if(row.checkPlanSetVoList.length>1){
- this.$set(this,'batchData',{
- planId:row.planId,
- planTitle:row.planTitle,
- checkCategory:row.checkCategory,
- checkTypeName:row.checkTypeName,
- crossCheck:row.crossCheck,
- });
- this.$set(this, 'batchList', row);
- this.dialogVisible = true;
- }else{
- //如果只有1个检查批次不弹窗
- this.$set(this,'batchData',{
- planId:row.planId,
- planTitle:row.planTitle,
- checkCategory:row.checkCategory,
- checkTypeName:row.checkTypeName,
- crossCheck:row.crossCheck,
- checkPlanSetVoList:row.checkPlanSetVoList[0]
- });
- this.$nextTick(()=>{
- uni.navigateTo({
- url: '/pages_safetyCheck/views/inspectManage/inspectList?infoData=' + encodeURIComponent(JSON.stringify(this.batchData))
- });
- })
- }
- },
- dialogClose() {
- this.dialogVisible = false;
- },
- async getList() {
- let self = this;
- const {
- data
- } = await securityAppCheckPlanTitleList(this.queryParams);
- 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);
- }
- }
- }
- },
- }
- }
- </script>
- <style lang="stylus" scoped>
- .planDetail {
- height: 100%;
- display: flex;
- flex-direction: column;
- .header {
- width: 100%;
- height: 482rpx;
- // position: fixed;
- // top: 0rpx;
- // z-index: 100;
- .header-bg {
- width: 750rpx;
- height: 310rpx;
- position: absolute;
- }
- .tabTitle {
- width: 690rpx;
- height: 242rpx;
- background: #FFFFFF;
- border-radius: 20rpx 20rpx 20rpx 20rpx;
- display flex;
- justify-content: flex-start;
- align-items: center;
- position: absolute;
- left: 30rpx;
- top: 208rpx;
- .tabTitle_li {
- height: 242rpx;
- flex: 1;
- position: relative;
- text-align center;
- .line {
- width: 2rpx;
- height: 20rpx;
- background: #D8D8D8;
- border-radius: 0rpx 0rpx 0rpx 0rpx;
- position: absolute;
- top: 40%;
- }
- .tabTitle_text {
- display: flex;
- justify-content: center;
- flex-direction: column;
- align-items: center;
- >img {
- width: 82rpx;
- height: 82rpx;
- margin-top: 44rpx;
- }
- >view:nth-of-type(1) {
- font-size: 30rpx;
- color: #333333;
- line-height: 40rpx;
- text-align: left;
- margin-top: 8rpx;
- }
- >view:nth-of-type(2) {
- font-size: 24rpx;
- color: #666666;
- line-height: 30rpx;
- text-align: left;
- margin-top: 6rpx;
- }
- position: relative;
- &.on {}
- }
- .tabTitle_across {
- /* width: 50rpx;
- height: 4rpx;
- background: #0183FA;
- border-radius: 2rpx; */
- margin-left: 38%;
- margin-top: 37rpx;
- display none;
- >img {
- width: 40rpx;
- height: 26rpx;
- }
- &.on {
- display block;
- }
- }
- }
- }
- }
- .for-max-box {
- flex: 1;
- overflow-y scroll;
- .list {
- width: 690rpx;
- margin-left: 30rpx;
- background: #FFFFFF;
- border-radius: 20rpx 20rpx 20rpx 20rpx;
- .list-li:nth-child(1) {
- border-top: none;
- }
- .list-li {
- border-top: 1rpx dashed #E0E0E0;
- height: 80rpx;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- padding: 0 30rpx;
- box-sizing: border-box;
- >view:nth-of-type(1) {
- flex: 1;
- font-size: 28rpx;
- color: #333333;
- line-height: 39rpx;
- text-align: left;
- margin: 0 52rpx 0 20rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- >img:nth-of-type(1) {
- width: 42rpx;
- height: 42rpx;
- }
- >img:nth-of-type(2) {
- width: 24rpx;
- height: 24rpx;
- }
- }
- }
- .get-data-p {
- height: 100rpx;
- text-align: center;
- .get-data-img {
- width: 30rpx;
- height: 30rpx;
- margin: 0 auto;
- margin-top: 15rpx;
- }
- .get-data-text {
- text-align: center;
- }
- }
- .get-data-null-p {
- height: 100rpx;
- line-height: 100rpx;
- text-align: center;
- }
- }
- .shade {
- height: 100%;
- width: 100%;
- position: fixed;
- display: flex;
- flex-direction: column;
- z-index: 200;
- background: rgba(0, 0, 0, 0.2);
- .null-box {
- flex: 1;
- }
- .shade_n {
- position: absolute;
- bottom: 0;
- left: 0;
- width: 750rpx;
- height: 466rpx;
- background: #FFFFFF;
- border-radius: 20rpx 20rpx 0rpx 0rpx;
- overflow-y: auto;
- .title {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0 50rpx 0 284rpx;
- box-sizing: border-box;
- border-bottom: 1rpx solid #E0E0E0;
- >view {
- font-size: 30rpx;
- color: #3D3D3D;
- line-height: 90rpx;
- text-align: left;
- }
- >img {
- width: 24rpx;
- height: 12rpx;
- }
- }
- .batch {
- padding: 0 30rpx;
- box-sizing: border-box;
- .batch-li {
- display: flex;
- justify-content: space-between;
- align-items: center;
- border-bottom: 1rpx solid #E0E0E0;
- padding: 20rpx 0 16rpx 0rpx;
- box-sizing: border-box;
- .batch-li-l {
- >text:nth-of-type(1) {
- display: block;
- font-size: 30rpx;
- color: #333333;
- line-height: 42rpx;
- text-align: left;
- }
- >text:nth-of-type(2) {
- display: block;
- font-size: 28rpx;
- color: #666666;
- line-height: 39rpx;
- text-align: left;
- margin-top: 6rpx;
- }
- }
- .batch-li-r {
- font-size: 28rpx;
- color: #666666;
- line-height: 39rpx;
- text-align: left;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- >img {
- width: 24rpx;
- height: 24rpx;
- margin-left: 9rpx;
- }
- }
- }
- }
- }
- }
- #fontColor-A {
- color: #0040C1;
- }
- #fontColor-B {
- color: #009519;
- }
- #bgColor-A {
- color: #0183FA;
- background: rgba(1, 131, 250, 0.2);
- }
- #bgColor-B {
- color: #16B531;
- background: rgba(22, 181, 49, 0.2);
- }
- }
- </style>
|