123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337 |
- <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>{{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 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">返回改善任务详情</view>
- </view>
- </template>
- <script>
- /**
- * 查核项详情
- */
- export default {
- data() {
- return {
- detail: {
- checkPointName: '',
- deptName: '',
- checkModelName: '',
- lastResult: '',
- checkResult: '',
- checkItemName: '',
- checkResultRequestList: [],
- checkPointId: ''
- },
- ifShowBotBtn:false,
- itemBelongGroup:[],
- itemId:'',
- ifImprover:true
- };
- },
- onLoad: function ({id, checkPointId}) {
- const roleNum = uni.getStorageSync('nowPermission');
- if(roleNum==3)this.ifShowBotBtn = true;
- if(roleNum==3)this.ifImprover = false;
- this.checkPointId = checkPointId;
- this.itemId = id;
- this.loadItemDetail(id);
-
- //只有查核展示底部按钮
- if(roleNum==3){
- //接收来自上个页面所传过来的数据
- const eventChannel = this.getOpenerEventChannel();
- eventChannel.on('acceptDataFromOpenerPage', (data)=>{
- // console.log({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: {
- 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(){
- window.history.back();
- },
- loadItemDetail(id){
- this.dispatch('checkTaskDetail', {id}).then((data)=>{
- if(data) {
- this.detail = data;
- this.itemId = id;
- }
- });
- },
- switchItem(num){
- let current = this.itemBelongGroup.filter(item=>{
- return item.id == this.itemId;
- });
- if(num<0){
- if(current[0].index==0){
- uni.showToast({
- title: '已经没有上一项',
- duration: 2000,
- icon:'none'
- });
- return;
- }
- }
- if(num>0){
- if(current[0].index==this.itemBelongGroup.length-1){
- uni.showToast({
- title: '已经没有下一项',
- duration: 2000,
- icon:'none'
- });
- return;
- }
- }
- let needItemIndex = num>0?current[0].index+1:current[0].index-1;
- let needItemId = this.itemBelongGroup[needItemIndex].id;
- this.loadItemDetail(needItemId);
- }
- }
- }
- </script>
- <style lang="less">
- .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;
- margin-top: 15rpx;
- 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;
- &: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;
- border-right: 1px solid #DADEE6;
- text {
- font-weight: 500;
- &: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: calc(50% - 12.5rpx);
- &: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>
|