auditItemDetails.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. <template>
  2. <view class="auditItemDetails">
  3. <view class="top-box">
  4. <view class="icon-wrap">
  5. <image src="../../static/chahexiang-bg.png"></image>
  6. <text>查核项</text>
  7. </view>
  8. <image class="img-tuli"
  9. @click="goLegendDetails(detail.checkItemId)"
  10. src="../../static/tuli.png"></image>
  11. <view class="title-wrap">
  12. <text>{{detail.checkItemName}}</text>
  13. <text>{{detail.checkPointName}}</text>
  14. </view>
  15. <view class="children">
  16. <view class="child">
  17. <text>{{detail.deptName || '--'}}</text>
  18. <text>查核单位</text>
  19. </view>
  20. <view class="child">
  21. <text>{{detail.checkModelName || '--'}}</text>
  22. <text>查核方式</text>
  23. </view>
  24. <view class="child">
  25. <text>{{detail.lastResult || '--'}}</text>
  26. <text>上次结果</text>
  27. </view>
  28. <view class="child">
  29. <text>{{detail.checkResult || '--'}}</text>
  30. <text>本次结果</text>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="bottom-box"
  35. v-for="(item, index) in detail.checkResultRequestList"
  36. :key="index">
  37. <view class="box-item">
  38. <view>查核结果</view>
  39. <view>{{item.checkResultDescribe}}</view>
  40. </view>
  41. <view class="box-item">
  42. <view>查核时间</view>
  43. <view>{{detail.completeTimeStr}}</view>
  44. </view>
  45. <view class="box-item">
  46. <view>图片展示</view>
  47. <view class="img-wrap">
  48. <image mode="widthFix"
  49. v-for="(img, i) in getArr(item.checkResultUrl)"
  50. :key="i"
  51. :src="img"></image>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="bottomMenuGroup" v-if="ifShowBotBtn">
  56. <view class="menuBtn" @click="goToPrevPage">
  57. <image class="threeLineMenuIcon" src="/static/threeLineMenu.png" ></image>
  58. </view>
  59. <view class="prevBtn" @click="switchItem(-1)">上一项</view>
  60. <view class="nextBtn" @click="switchItem(1)">下一项</view>
  61. </view>
  62. <view class="bottomBtn" @click="goToPrevPage" v-if="ifImprover">返回改善任务详情</view>
  63. </view>
  64. </template>
  65. <script>
  66. /**
  67. * 查核项详情
  68. */
  69. export default {
  70. data() {
  71. return {
  72. detail: {
  73. checkPointName: '',
  74. deptName: '',
  75. checkModelName: '',
  76. lastResult: '',
  77. checkResult: '',
  78. checkItemName: '',
  79. checkResultRequestList: [],
  80. checkPointId: ''
  81. },
  82. ifShowBotBtn:false,
  83. itemBelongGroup:[],
  84. itemId:'',
  85. ifImprover:true
  86. };
  87. },
  88. onLoad: function ({id, checkPointId}) {
  89. const roleNum = uni.getStorageSync('nowPermission');
  90. if(roleNum==3)this.ifShowBotBtn = true;
  91. if(roleNum==3)this.ifImprover = false;
  92. this.checkPointId = checkPointId;
  93. this.itemId = id;
  94. this.loadItemDetail(id);
  95. //只有查核展示底部按钮
  96. if(roleNum==3){
  97. //接收来自上个页面所传过来的数据
  98. const eventChannel = this.getOpenerEventChannel();
  99. eventChannel.on('acceptDataFromOpenerPage', (data)=>{
  100. // console.log({data});
  101. this.itemBelongGroup =data.data[0].responseList.map((item,index)=>{
  102. return({
  103. index:index,
  104. id:item['id'],
  105. })
  106. });
  107. //重新导航进页面,删除缓存并设置最新数据
  108. uni.removeStorageSync('itemBelongGroup');
  109. uni.setStorageSync('itemBelongGroup',this.itemBelongGroup);
  110. });
  111. //手动刷新页面,获取本地缓存
  112. const itemBelongGroup = uni.getStorageSync('itemBelongGroup');
  113. this.itemBelongGroup = itemBelongGroup;
  114. }
  115. },
  116. methods: {
  117. getArr(value) {
  118. return value ? value.split(',') : [];
  119. },
  120. goLegendDetails(checkItemId) {
  121. //跳转到图例详情
  122. uni.navigateTo({
  123. url: `/pages/legendDetails/legendDetails?checkItemId=${checkItemId}&checkPointId=${this.checkPointId}`
  124. });
  125. },
  126. dispatch(key, data) {
  127. return this.$store.dispatch({type: 'checkList/commActions', key, data});
  128. },
  129. goToPrevPage(){
  130. window.history.back();
  131. },
  132. loadItemDetail(id){
  133. this.dispatch('checkTaskDetail', {id}).then((data)=>{
  134. if(data) {
  135. this.detail = data;
  136. this.itemId = id;
  137. }
  138. });
  139. },
  140. switchItem(num){
  141. let current = this.itemBelongGroup.filter(item=>{
  142. return item.id == this.itemId;
  143. });
  144. if(num<0){
  145. if(current[0].index==0){
  146. uni.showToast({
  147. title: '已经没有上一项',
  148. duration: 2000,
  149. icon:'none'
  150. });
  151. return;
  152. }
  153. }
  154. if(num>0){
  155. if(current[0].index==this.itemBelongGroup.length-1){
  156. uni.showToast({
  157. title: '已经没有下一项',
  158. duration: 2000,
  159. icon:'none'
  160. });
  161. return;
  162. }
  163. }
  164. let needItemIndex = num>0?current[0].index+1:current[0].index-1;
  165. let needItemId = this.itemBelongGroup[needItemIndex].id;
  166. this.loadItemDetail(needItemId);
  167. }
  168. }
  169. }
  170. </script>
  171. <style lang="less">
  172. .auditItemDetails {
  173. .bottomBtn {
  174. position: fixed;
  175. bottom: 0;
  176. width: 100%;
  177. height: 75rpx;
  178. line-height: 75rpx;
  179. text-align: center;
  180. font-size: 22.5rpx;
  181. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  182. font-weight: 400;
  183. color: #FFFFFF;
  184. background: #3377FF;
  185. }
  186. .top-box {
  187. position: relative;
  188. margin-top: 15rpx;
  189. padding-bottom: 37.5rpx;
  190. background-color: #fff;
  191. .icon-wrap {
  192. position: relative;
  193. overflow: hidden;
  194. width: 125rpx;
  195. height: 37.5rpx;
  196. image {
  197. width: 100%;
  198. height: 100%;
  199. }
  200. text {
  201. position: absolute;
  202. top: 0;
  203. left: 25rpx;
  204. font-size: 20rpx;
  205. line-height: 37.5rpx;
  206. color: #fff;
  207. }
  208. }
  209. .img-tuli {
  210. position: absolute;
  211. top: 25rpx;
  212. right: 25rpx;
  213. width: 40rpx;
  214. height: 40rpx;
  215. }
  216. .title-wrap {
  217. display: flex;
  218. flex-direction: column;
  219. padding: 25rpx 31.25rpx;
  220. text {
  221. font-size: 25rpx;
  222. line-height: 37.5rpx;
  223. &:last-child {
  224. padding-top: 4.37rpx;
  225. font-size: 17.5rpx;
  226. line-height: 26.25rpx;
  227. color: #7A8599;
  228. }
  229. }
  230. }
  231. .children {
  232. display: flex;
  233. flex-direction: row;
  234. align-items: center;
  235. margin-top: 10.62rpx;
  236. .child {
  237. display: flex;
  238. flex-direction: column;
  239. justify-content: center;
  240. align-items: center;
  241. flex: 1;
  242. border-right: 1px solid #DADEE6;
  243. text {
  244. font-weight: 500;
  245. &:last-child {
  246. font-size: 17.5rpx;
  247. line-height: 26.25rpx;
  248. color: #7A8599;
  249. font-weight: 400;
  250. }
  251. }
  252. &:last-child {
  253. border-right: 0;
  254. }
  255. }
  256. }
  257. }
  258. .bottom-box {
  259. margin-top: 15rpx;
  260. padding: 0 25rpx;
  261. background-color: #fff;
  262. .box-item {
  263. display: flex;
  264. flex-direction: row;
  265. border-bottom: 0.62rpx solid #DADEE6;
  266. padding: 26.25rpx 0;
  267. &:last-child {
  268. border-bottom: 0;
  269. }
  270. >view {
  271. width: 100%;
  272. &:first-child {
  273. width: 175rpx;
  274. white-space: nowrap;
  275. color: #525866;
  276. }
  277. &.img-wrap {
  278. display: flex;
  279. flex-direction: row;
  280. flex-wrap: wrap;
  281. image {
  282. margin-bottom: 12.5rpx;
  283. width: calc(50% - 12.5rpx);
  284. &:nth-child(2n) {
  285. margin-left: 12.5rpx;
  286. }
  287. }
  288. }
  289. }
  290. }
  291. }
  292. .bottomMenuGroup {
  293. position: fixed;
  294. bottom: 0;
  295. width: 100%;
  296. height: 75rpx;
  297. display: flex;
  298. flex-direction: row;
  299. background: #FFFFFF;
  300. border-top:0.62rpx solid #DADEE6;
  301. .menuBtn {
  302. display: flex;
  303. width: 75rpx;
  304. height: 75rpx;
  305. justify-content: center;
  306. align-items: center;
  307. border-right: 0.62rpx solid #DADEE6;
  308. .threeLineMenuIcon {
  309. width: 26.25rpx;
  310. height: 21.25rpx;
  311. }
  312. }
  313. .prevBtn {
  314. border-right: 0.62rpx solid #DADEE6;
  315. }
  316. .prevBtn,.nextBtn {
  317. display: flex;
  318. flex: 1;
  319. justify-content: center;
  320. height:75rpx;
  321. line-height:75rpx;
  322. font-size: 22.5rpx;
  323. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  324. font-weight: 400;
  325. color: #3377FF;
  326. }
  327. }
  328. }
  329. </style>