task.vue 5.7 KB

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