task.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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.expectedStartDate}}</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. uni.scanCode({
  100. success: function (res) {
  101. scanCode(res.result).then((res)=>{
  102. console.log(res)
  103. if(checklistId!==res.data.goafChecklistId){
  104. uni.showToast({
  105. icon:'none',
  106. title:"任务跟二维码不否"
  107. })
  108. return
  109. }
  110. uni.navigateTo({
  111. url:'/pages/task/taskList/taskList'
  112. })
  113. })
  114. },
  115. fail(){
  116. uni.showToast({
  117. icon:'none',
  118. title:"扫码失败!"
  119. })
  120. }
  121. })
  122. }
  123. }
  124. }
  125. </script>
  126. <style lang="scss" scoped>
  127. .task-page{
  128. background-color: #F3F5FB;
  129. .title{
  130. font-family: 'Source Han Sans CN';
  131. font-style: normal;
  132. font-weight: 700;
  133. font-size: 36rpx;
  134. line-height: 54rpx;
  135. color: #212121;
  136. padding-left: 32rpx;
  137. display: flex;
  138. justify-content: space-between;
  139. align-items: center;
  140. .iconfont{
  141. font-size: 42rpx;
  142. line-height: 1;
  143. padding: 12rpx 32rpx;
  144. font-weight: normal;
  145. color: #333;
  146. }
  147. }
  148. .info{
  149. padding: 0 32rpx;
  150. margin: 20rpx 0;
  151. background: #FFFFFF;
  152. border-radius: 32rpx 32rpx 0px 0px;
  153. .item{
  154. border-bottom: 1rpx solid #EFF1F3;
  155. padding: 40rpx 32rpx;
  156. .name{
  157. font-size: 28rpx;
  158. color: #999999;
  159. line-height: 1;
  160. }
  161. .cont{
  162. font-size: 30rpx;
  163. color: #212121;
  164. line-height: 1.5;
  165. padding-top: 12rpx;
  166. }
  167. &:last-child{
  168. border-bottom:none;
  169. }
  170. }
  171. }
  172. .status{
  173. background: #FFFFFF;
  174. border-radius: 32rpx 32rpx 0px 0px;
  175. padding: 48rpx 32rpx;
  176. .head{
  177. color: #212121;
  178. font-size: 34rpx;
  179. line-height:1;
  180. font-weight: 700;
  181. padding-bottom: 20rpx;
  182. }
  183. h3{
  184. color: #424242;
  185. padding: 10rpx 10rpx;
  186. background-color: #EFF1F3;
  187. line-height: 1;
  188. margin-bottom: 10rpx;
  189. }
  190. ul{
  191. list-style: decimal;
  192. }
  193. .icon-empty{
  194. display: block;
  195. width: 160rpx;
  196. margin: 64rpx auto 0;
  197. }
  198. p{
  199. font-size: 28rpx;
  200. line-height: 1.8;
  201. color: #666;
  202. text-align: center;
  203. }
  204. .flow-head{
  205. display: flex;
  206. justify-content: space-between;
  207. align-items: center;
  208. font-family: 'Abhaya Libre';
  209. font-style: normal;
  210. font-weight: 400;
  211. font-size: 24rpx;
  212. line-height: 48rpx;
  213. padding: 30rpx 0 24rpx 0;
  214. .flow-status{
  215. color: #27DFA8;
  216. &.error{
  217. color: #F54545;
  218. }
  219. }
  220. .flow-time{
  221. color: #999999;
  222. }
  223. }
  224. .desc{
  225. font-family: 'SF Pro Text';
  226. font-style: normal;
  227. font-weight: 500;
  228. font-size: 30rpx;
  229. line-height: 42rpx;
  230. color: #434343;
  231. padding-bottom: 24rpx;
  232. }
  233. .attach{
  234. display: flex;
  235. flex-wrap: wrap;
  236. .attach-item{
  237. width: 224rpx;
  238. overflow: hidden;
  239. margin-right: 7rpx;
  240. margin-bottom: 20rpx;
  241. &:nth-child(3n){
  242. margin-right: 0;
  243. }
  244. .image{
  245. display: block;
  246. width: 224rpx;
  247. border-radius: 8px;
  248. }
  249. }
  250. }
  251. }
  252. .add{
  253. display: block;
  254. width: 96rpx;
  255. position: fixed;
  256. bottom: 186rpx;
  257. right: 32rpx;
  258. }
  259. }
  260. </style>