task.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <template>
  2. <view class="task-page">
  3. <div class="title">
  4. <text>{{item.taskTitle}}</text>
  5. <!-- #ifndef H5 -->
  6. <text class="icon-saoma iconfont" @click="onScanCode" v-if="item.status!==1"></text>
  7. <!-- #endif -->
  8. </div>
  9. <div class="info">
  10. <div class="item">
  11. <view class="name">执行人</view>
  12. <view class="cont">{{item.handleAccountName}}</view>
  13. </div>
  14. <div class="item">
  15. <view class="name">执行部门</view>
  16. <view class="cont">{{item.handleGroupName}}</view>
  17. </div>
  18. <div class="item">
  19. <view class="name">检查时间</view>
  20. <view class="cont">{{item.checkTime}}</view>
  21. </div>
  22. </div>
  23. <div class="status">
  24. <template v-if="item.status===0">
  25. <image class="icon-empty" src="/static/icon/empty.png" mode="widthFix"></image>
  26. <p>暂无处置信息</p>
  27. <!-- #ifdef H5 -->
  28. <image class="add" @click="add" src="/static/icon/add.png" mode="widthFix"></image>
  29. <!-- #endif -->
  30. </template>
  31. <div class="head" v-if="item.status===1">处置过程</div>
  32. <h3 v-if="checkItemPass.length>0">通过项</h3>
  33. <ul style="padding-bottom: 10px;">
  34. <li v-for="(item,index) in checkItemPass">{{item}}</li>
  35. </ul>
  36. <h3 v-if="checkItemNopass.length>0">不通过项</h3>
  37. <ul>
  38. <li v-for="(item,index) in checkItemNopass">{{item}}</li>
  39. </ul>
  40. <!-- <template v-else>
  41. <view class="flow-head">
  42. <div class="flow-status" :class="flow.status===1?'success':'error'">{{flow.status===0?'异常':(flow.status===1?'正常':'')}}</div>
  43. <view class="flow-time">{{parseTime(flow.time)}}</view>
  44. </view>
  45. <div class="desc">{{flow.desc}}</div>
  46. <div class="attach">
  47. <view class="attach-item" v-for="(attach,index) in flow.attachList" :key="'attach-'+index">
  48. <image class="image" :src="attach.url" mode="widthFix"></image>
  49. </view>
  50. </div>
  51. </template> -->
  52. </div>
  53. </view>
  54. </template>
  55. <script>
  56. import {parseTime} from '@/libs/index.js'
  57. import {scanCode} from '@/api/goaf.js'
  58. export default {
  59. data() {
  60. return {
  61. item:{
  62. title:"水位预{2号-770-32002}:采空区封堵完好,无渗水情况。"
  63. },
  64. checkItemNopass:[],
  65. checkItemPass:[]
  66. }
  67. },
  68. onLoad() {
  69. this.init()
  70. },
  71. onPullDownRefresh (){
  72. this.init()
  73. },
  74. methods: {
  75. parseTime,
  76. init(){
  77. this.getTask()
  78. },
  79. getTask(){
  80. let data=uni.getStorageSync('task-item')
  81. let checkItemPass=data.checkItemPass
  82. let checkItemNopass=data.checkItemNopass
  83. this.item=data
  84. if(checkItemPass){
  85. this.checkItemPass=checkItemPass.split('通过;')
  86. }
  87. if(checkItemNopass){
  88. this.checkItemNopass=checkItemNopass.split('不通过;')
  89. }
  90. },
  91. add(){
  92. uni.navigateTo({
  93. url:'/pages/task/taskList/taskList'
  94. })
  95. },
  96. onScanCode(){
  97. let data=uni.getStorageSync('task-item')
  98. let checklistId=data.checklistId
  99. let goafId=data.goafId;
  100. uni.scanCode({
  101. success: function (res) {
  102. scanCode(res.result).then((res)=>{
  103. goafId
  104. let qrcode_goafId=res.data.goafId;
  105. let qrcode_ChecklistId=res.data.goafChecklistId;
  106. if(checklistId===qrcode_ChecklistId&&goafId===qrcode_goafId){
  107. uni.navigateTo({
  108. url:'/pages/task/taskList/taskList'
  109. })
  110. }else{
  111. uni.showToast({
  112. icon:'none',
  113. title:"任务跟二维码不符"
  114. })
  115. }
  116. })
  117. },
  118. fail(){
  119. uni.showToast({
  120. icon:'none',
  121. title:"扫码失败!"
  122. })
  123. }
  124. })
  125. }
  126. }
  127. }
  128. </script>
  129. <style lang="scss" scoped>
  130. .task-page{
  131. background-color: #F3F5FB;
  132. .title{
  133. font-family: 'Source Han Sans CN';
  134. font-style: normal;
  135. font-weight: 700;
  136. font-size: 36rpx;
  137. line-height: 54rpx;
  138. color: #212121;
  139. padding-left: 32rpx;
  140. display: flex;
  141. justify-content: space-between;
  142. align-items: center;
  143. .iconfont{
  144. font-size: 42rpx;
  145. line-height: 1;
  146. padding: 12rpx 32rpx;
  147. font-weight: normal;
  148. color: #333;
  149. }
  150. }
  151. .info{
  152. padding: 0 32rpx;
  153. margin: 20rpx 0;
  154. background: #FFFFFF;
  155. border-radius: 32rpx 32rpx 0px 0px;
  156. .item{
  157. border-bottom: 1rpx solid #EFF1F3;
  158. padding: 40rpx 32rpx;
  159. .name{
  160. font-size: 28rpx;
  161. color: #999999;
  162. line-height: 1;
  163. }
  164. .cont{
  165. font-size: 30rpx;
  166. color: #212121;
  167. line-height: 1.5;
  168. padding-top: 12rpx;
  169. }
  170. &:last-child{
  171. border-bottom:none;
  172. }
  173. }
  174. }
  175. .status{
  176. background: #FFFFFF;
  177. border-radius: 32rpx 32rpx 0px 0px;
  178. padding: 48rpx 32rpx;
  179. .head{
  180. color: #212121;
  181. font-size: 34rpx;
  182. line-height:1;
  183. font-weight: 700;
  184. padding-bottom: 20rpx;
  185. }
  186. h3{
  187. color: #424242;
  188. padding: 10rpx 10rpx;
  189. background-color: #EFF1F3;
  190. line-height: 1;
  191. margin-bottom: 10rpx;
  192. }
  193. ul{
  194. list-style: decimal;
  195. }
  196. .icon-empty{
  197. display: block;
  198. width: 160rpx;
  199. margin: 64rpx auto 0;
  200. }
  201. p{
  202. font-size: 28rpx;
  203. line-height: 1.8;
  204. color: #666;
  205. text-align: center;
  206. }
  207. .flow-head{
  208. display: flex;
  209. justify-content: space-between;
  210. align-items: center;
  211. font-family: 'Abhaya Libre';
  212. font-style: normal;
  213. font-weight: 400;
  214. font-size: 24rpx;
  215. line-height: 48rpx;
  216. padding: 30rpx 0 24rpx 0;
  217. .flow-status{
  218. color: #27DFA8;
  219. &.error{
  220. color: #F54545;
  221. }
  222. }
  223. .flow-time{
  224. color: #999999;
  225. }
  226. }
  227. .desc{
  228. font-family: 'SF Pro Text';
  229. font-style: normal;
  230. font-weight: 500;
  231. font-size: 30rpx;
  232. line-height: 42rpx;
  233. color: #434343;
  234. padding-bottom: 24rpx;
  235. }
  236. .attach{
  237. display: flex;
  238. flex-wrap: wrap;
  239. .attach-item{
  240. width: 224rpx;
  241. overflow: hidden;
  242. margin-right: 7rpx;
  243. margin-bottom: 20rpx;
  244. &:nth-child(3n){
  245. margin-right: 0;
  246. }
  247. .image{
  248. display: block;
  249. width: 224rpx;
  250. border-radius: 8px;
  251. }
  252. }
  253. }
  254. }
  255. .add{
  256. display: block;
  257. width: 96rpx;
  258. position: fixed;
  259. bottom: 186rpx;
  260. right: 32rpx;
  261. }
  262. }
  263. </style>