123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451 |
- <template>
- <view class="auditItemDetails">
- <view class="top-box">
- <view class="icon-wrap">
- <image src="../../static/chahexiang-bg.png"></image>
- <text>查核项</text>
- </view>
- <image class="img-tuli" @click="goLegendDetails(detail.checkItemId)" src="../../static/tuli.png"></image>
- <view class="title-wrap">
- <text>{{detail.checkItemName}}</text>
- <text>{{detail.checkPointName}}</text>
- </view>
- <view class="children">
- <view class="child">
- <text>{{detail.deptName || '--'}}</text>
- <text>查核单位</text>
- </view>
- <view class="child">
- <text>{{detail.checkModelName || '--'}}</text>
- <text>查核方式</text>
- </view>
- <view class="child">
- <text>{{detail.lastResult || '--'}}</text>
- <text>上次结果</text>
- </view>
- <view class="child">
- <text>{{situationsCenter.currentSelectedSituation.systemSituationType == 2 ? detail.checkResultName :detail.checkResult || '--'}}</text>
- <text>本次结果</text>
- </view>
- </view>
- </view>
- <view class="bottom-box" v-for="(item, index) in detail.checkResultRequestList" :key="index">
- <view class="box-item">
- <view>查核结果</view>
- <view>{{item.checkResultDescribe}}</view>
- </view>
- <view class="box-item">
- <view>查核时间</view>
- <view>{{detail.completeTimeStr}}</view>
- </view>
- <view class="box-item">
- <view>图片展示</view>
- <view class="img-wrap">
- <image @click="previewHandle(i,item.checkResultUrl)" mode="widthFix" v-for="(img, i) in getArr(item.checkResultUrl)" :key="i" :src="img"></image>
- </view>
- </view>
- </view>
- <view class="bottomMenuGroup" v-if="ifShowBotBtn">
- <view class="menuBtn" @click="goToPrevPage">
- <image class="threeLineMenuIcon" src="/static/threeLineMenu.png"></image>
- </view>
- <view class="prevBtn" @click="switchItem(-1)">上一项</view>
- <view class="nextBtn" @click="switchItem(1)">下一项</view>
- </view>
- <view class="bottomBtn" @click="goToPrevPage" v-if="ifImprover">{{bottomBtnText}}</view>
- </view>
- </template>
- <script>
- /**
- * 查核项详情
- */
- // #ifdef APP
- const pictureModule = uni.requireNativePlugin("Wlake-PictureView")
- const modal = uni.requireNativePlugin('modal');
- // #endif
- import { mapState } from "vuex";
- import {
- _goBackFresh
- } from '../../utils/compatible.js';
- export default {
- data() {
- return {
- detail: {
- checkPointName: '',
- deptName: '',
- checkModelName: '',
- lastResult: '',
- checkResult: '',
- checkItemName: '',
- checkResultRequestList: [],
- checkPointId: ''
- },
- ifShowBotBtn: false,
- itemBelongGroup: [],
- itemId: '',
- ifImprover: true,
- bottomBtnText: '返回改善任务详情',
- };
- },
- computed: {
- ...mapState({
- situationsCenter: state => state.situationsCenter
- }),
- },
- onLoad: function({
- id,
- checkPointId,
- isZichaDucha,
- improveType
- }) {
-
-
- const pages = getCurrentPages();
- const reversedPageList = pages.reverse();
-
- if (reversedPageList && reversedPageList[1].route == 'pages/checkMainPoints/checkMainPoints') {
- this.bottomBtnText = '返回查核任务列表'
- }
- const roleNum = uni.getStorageSync('nowPermission');
- if (roleNum == 3) this.ifShowBotBtn = true;
- if (roleNum == 3) this.ifImprover = false;
- this.checkPointId = checkPointId;
- this.itemId = id;
- this.isZichaDucha = isZichaDucha;
- this.improveType = improveType;
-
- this.loadItemDetail(id);
- if (improveType == 0) {
- this.situationsCenter.currentSelectedSituation.systemSituationType=1;
- }
- else{
- this.situationsCenter.currentSelectedSituation.systemSituationType=2;
- }
- //只有查核展示底部按钮
- if (roleNum == 3) {
- //接收来自上个页面所传过来的数据
- const eventChannel = this.getOpenerEventChannel();
- eventChannel.on('acceptDataFromOpenerPage', (data) => {
- this.itemBelongGroup = data.data[0].responseList.map((item, index) => {
- return ({
- index: index,
- id: item['id'],
- })
- });
- //重新导航进页面,删除缓存并设置最新数据
- uni.removeStorageSync('itemBelongGroup');
- uni.setStorageSync('itemBelongGroup', this.itemBelongGroup);
- });
- //手动刷新页面,获取本地缓存
- const itemBelongGroup = uni.getStorageSync('itemBelongGroup');
- this.itemBelongGroup = itemBelongGroup;
- }
- },
- methods: {
- /**
- * @param {number} index
- * @param {string} imgUrls
- */
- previewHandle(index,imgUrls) {
- const picList = imgUrls ? imgUrls.split(',') : [] ;
- // #ifdef APP
- pictureModule.PictureViewerMain({
- 'listPic': picList,
- 'position':index, // 0 开始算 最大值为 listPic 数组数量 减一
- },
- (ret) => {
- // modal.toast({
- // message: ret,
- // duration: 1.5
- // });
- });
- // #endif
- },
- getArr(value) {
- return value ? value.split(',') : [];
- },
- goLegendDetails(checkItemId) {
- //跳转到图例详情
- uni.navigateTo({
- url: `/pages/legendDetails/legendDetails?checkItemId=${checkItemId}&checkPointId=${this.checkPointId}`
- });
- },
- dispatch(key, data) {
- return this.$store.dispatch({
- type: 'checkList/commActions',
- key,
- data
- });
- },
- goToPrevPage() {
- // _goBackFresh('pages/checkMainPoints/checkMainPoints');
- uni.navigateBack({
- delta: 1
- });
- },
- loadItemDetail(id) {
- if(this.isZichaDucha){
- //自查督查
- this.$store.dispatch({
- type: 'mainPointsDetail/commActions',
- payload:{
- key:'zichaduchaCheckTaskDetail',
- data:{
- id: id,
- improveType:this.improveType
- }
- }
- }).then((data)=>{
- if(data){
- this.detail = data;
- this.itemId = id;
- }
- })
- }else{
- this.dispatch('checkTaskDetail', {
- id,
- improveType:this.improveType
- }).then((data) => {
- if (data) {
- this.detail = data;
- this.itemId = id;
-
- }
- });
- }
- },
- switchItem(num) {
- let currentIndex = this.detail.checkDetailIds.findIndex(t => t == this.itemId);
- if (currentIndex - 1 == -1 && num < 0) {
- //当前项为第一个时且操作是点击上一项
- uni.showToast({
- title: '已经没有上一项',
- duration: 2000,
- icon: 'none'
- });
- return;
- }
- if (currentIndex + 1 > this.detail.checkDetailIds.length - 1 && num > 0) {
- //当前项为第一个时且操作是点击下一项
- uni.showToast({
- title: '已经没有下一项',
- duration: 2000,
- icon: 'none'
- });
- return;
- }
- let needItemId = num > 0 ? this.detail.checkDetailIds[currentIndex + 1] : this.detail.checkDetailIds[
- currentIndex - 1];
- if (needItemId) {
- this.loadItemDetail(needItemId);
- }
- }
- }
- }
- </script>
- <style lang="less" scoped>
- .auditItemDetails {
- .bottomBtn {
- position: fixed;
- bottom: 0;
- width: 100%;
- height: 75rpx;
- line-height: 75rpx;
- text-align: center;
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #FFFFFF;
- background: #3377FF;
- }
- .top-box {
- position: relative;
- padding-bottom: 37.5rpx;
- background-color: #fff;
- .icon-wrap {
- position: relative;
- overflow: hidden;
- width: 125rpx;
- height: 37.5rpx;
- image {
- width: 100%;
- height: 100%;
- }
- text {
- position: absolute;
- top: 0;
- left: 25rpx;
- font-size: 20rpx;
- line-height: 37.5rpx;
- color: #fff;
- }
- }
- .img-tuli {
- position: absolute;
- top: 25rpx;
- right: 25rpx;
- width: 40rpx;
- height: 40rpx;
- }
- .title-wrap {
- display: flex;
- flex-direction: column;
- padding: 25rpx 31.25rpx;
- text {
- font-size: 25rpx;
- line-height: 37.5rpx;
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
- &:last-child {
- padding-top: 4.37rpx;
- font-size: 17.5rpx;
- line-height: 26.25rpx;
- color: #7A8599;
- }
- }
- }
- .children {
- display: flex;
- flex-direction: row;
- align-items: center;
- margin-top: 10.62rpx;
- .child {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- flex: 1;
- width: 25%;
- border-right: 1px solid #DADEE6;
- text {
- width: 100%;
- text-align: center;
- font-weight: 500;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- &:last-child {
- font-size: 17.5rpx;
- line-height: 26.25rpx;
- color: #7A8599;
- font-weight: 400;
- }
- }
- &:last-child {
- border-right: 0;
- }
- }
- }
- }
- .bottom-box {
- margin-top: 15rpx;
- padding: 0 25rpx;
- background-color: #fff;
- .box-item {
- display: flex;
- flex-direction: row;
- border-bottom: 0.62rpx solid #DADEE6;
- padding: 26.25rpx 0;
- &:last-child {
- border-bottom: 0;
- }
- >view {
- width: 100%;
- &:first-child {
- width: 175rpx;
- white-space: nowrap;
- color: #525866;
- }
- &.img-wrap {
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- image {
- margin-bottom: 12.5rpx;
- width:160rpx;
- &:nth-child(2n) {
- margin-left: 12.5rpx;
- }
- }
- }
- }
- }
- }
- .bottomMenuGroup {
- position: fixed;
- bottom: 0;
- width: 100%;
- height: 75rpx;
- display: flex;
- flex-direction: row;
- background: #FFFFFF;
- border-top: 0.62rpx solid #DADEE6;
- .menuBtn {
- display: flex;
- width: 75rpx;
- height: 75rpx;
- justify-content: center;
- align-items: center;
- border-right: 0.62rpx solid #DADEE6;
- .threeLineMenuIcon {
- width: 26.25rpx;
- height: 21.25rpx;
- }
- }
- .prevBtn {
- border-right: 0.62rpx solid #DADEE6;
- }
- .prevBtn,
- .nextBtn {
- display: flex;
- flex: 1;
- justify-content: center;
- height: 75rpx;
- line-height: 75rpx;
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #3377FF;
- }
- }
- }
- </style>
|