混凝土运输管理微信小程序、替班
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

220 lines
5.3 KiB

1 week ago
  1. <template>
  2. <view class="content">
  3. <view class="head flex-sb sticky box-shadow-light">
  4. <view class="flex" @click="seacher">
  5. <view class="mr5"><uni-icons type="search" size="18"/></view>
  6. <view v-if="+seacht===0" style="font-size: 28rpx;">筛选</view>
  7. <input v-model="input" :class="{'active':+seacht===1}" maxlength="10"
  8. class="search-input" type="text" confirm-type="search" @confirm="loadPage"/>
  9. </view>
  10. <view class="flex status">
  11. <view :class="{ 'active': +status===0 }" @click="status=0;this.loadPage()">待接单</view>
  12. <view :class="{ 'active': +status===1 }" @click="status=1;this.loadPage()">进行中</view>
  13. <view :class="{ 'active': +status===2 }" @click="status=2;this.loadPage()">已完成</view>
  14. </view>
  15. </view>
  16. <view class="m20" v-if="+status===0">
  17. <view class="re-empty" v-if="waits.length<1">
  18. <view>暂无数据</view>
  19. </view>
  20. <view v-for="e in waits" class="b-relative item-card mb20">
  21. <view class="m10 flex-sb">
  22. <view class="ellipsis">{{e.address}}</view>
  23. <view class="item-time">{{ $timeUtils.formatTime(e.create_time) }}</view>
  24. </view>
  25. <view>到场时间{{$timeUtils.formatTime2Day(e.in_time)}}</view>
  26. <view>计划数量{{e.mi}}m³/</view>
  27. <view class="item-button" @click="clickDetail(e.id)">查看</view>
  28. </view>
  29. </view>
  30. <view class="m20" v-if="+status===1">
  31. <view class="re-empty" v-if="runns.length<1">
  32. <view>暂无数据</view>
  33. </view>
  34. <view v-for="e in runns" class="b-relative item-card mb20">
  35. <view class="m10 flex-sb">
  36. <view class="ellipsis">{{e.address}}</view>
  37. <view class="item-time">{{ $timeUtils.formatTime(e.create_time) }}</view>
  38. </view>
  39. <view>到场时间{{$timeUtils.formatTime2Day(e.in_time)}}</view>
  40. <view>计划数量{{e.mi}}m³/</view>
  41. <view class="item-button" @click="clickDetail(e.id)">查看</view>
  42. </view>
  43. </view>
  44. <view class="m20" v-if="+status===2">
  45. <view class="re-empty" v-if="endes.length<1">
  46. <view>暂无数据</view>
  47. </view>
  48. <view v-for="e in endes" class="b-relative item-card mb20">
  49. <view class="m10 flex-sb">
  50. <view class="ellipsis">{{e.address}}</view>
  51. <view class="item-time">{{ $timeUtils.formatTime(e.create_time) }}</view>
  52. </view>
  53. <view>到场时间{{$timeUtils.formatTime2Day(e.in_time)}}</view>
  54. <view>计划数量{{e.mi}}m³/</view>
  55. <view class="item-button btn1" @click="clickDetail(e.id)">查看</view>
  56. <view class="item-button btn2" @click="clickStep(e.id)">进度</view>
  57. </view>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. export default {
  63. data() {
  64. return {
  65. status: 0,
  66. seacht: 0,
  67. waits: [],
  68. runns: [],
  69. endes: [],
  70. input: ''
  71. }
  72. },
  73. mounted() {
  74. this.seacht = 0
  75. this.loadPage()
  76. },
  77. methods: {
  78. clickDetail(id){ uni.navigateTo({ url: `/pages/user/orderd?id=${id}` }) },
  79. clickStep(id){ uni.navigateTo({ url: `/pages/user/steps?id=${id}` }) },
  80. seacher() { this.seacht = 1 },
  81. loadPage(){
  82. this.seacht = 0
  83. uni.showLoading({})
  84. let uri = "/api/order/enter";
  85. let useridp = "";
  86. if(uni.getStorageSync("role")==="1"){
  87. useridp = uni.getStorageSync("userid")
  88. } else if(uni.getStorageSync("role")==="2"){
  89. } else {
  90. uri = "/api/order/all";
  91. }
  92. this.$httpGet(uri, {
  93. status: this.status,
  94. seo: this.input,
  95. useridp: useridp,
  96. enter_id: uni.getStorageSync("enter_id")
  97. }, (res) => {
  98. console.log('[/order/enter]', res);
  99. uni.hideLoading({})
  100. this.waits = []
  101. this.runns = []
  102. this.endes = []
  103. if(res.data){
  104. if (+this.status === 0){
  105. this.waits = this.$utils.toArray(res.data)
  106. } else if (+this.status === 1){
  107. this.runns = this.$utils.toArray(res.data)
  108. } else if (+this.status === 2){
  109. this.endes = this.$utils.toArray(res.data)
  110. }
  111. }
  112. })
  113. },
  114. }
  115. }
  116. </script>
  117. <style>
  118. page {
  119. background-color: #f5f5f5;
  120. }
  121. .search-input{
  122. font-size: 28rpx;
  123. margin-top: 10rpx;
  124. line-height: 32rpx;
  125. border-bottom: 2rpx solid #999;
  126. width: 0;
  127. transition: .3s ease-in-out;
  128. }
  129. .active{
  130. width: 70%;
  131. padding-left: 10rpx;
  132. }
  133. .head{
  134. height: 60rpx;
  135. line-height: 60rpx;
  136. padding: 0 40rpx;
  137. background-color: #fff;
  138. }
  139. .status{
  140. font-size: 28rpx;
  141. font-weight: 400;
  142. color: #9e9e9e;
  143. padding: 20rpx 0 12rpx;
  144. }
  145. .status view{
  146. padding-right: 5rpx;
  147. margin-right: 5rpx;
  148. border-right: 2rpx solid #9e9e9e;
  149. width: 88rpx;
  150. height: 28rpx;
  151. line-height: 28rpx;
  152. transition: .3s ease-in-out;
  153. }
  154. .status view:last-child{
  155. padding-right: 0;
  156. margin-right: 0;
  157. border-right: none;
  158. }
  159. .status .active{
  160. color: #f40000;
  161. font-weight: 600;
  162. text-decoration-line: underline;
  163. }
  164. .item-card{
  165. width: calc(100vw - 60rpx);
  166. height: calc(236rpx - 60rpx);
  167. background: #ffffff;
  168. padding: 30rpx;
  169. font-size: 24rpx;
  170. line-height: 42rpx;
  171. color: #333333;
  172. }
  173. .item-button{
  174. position: absolute;
  175. left: 533rpx;
  176. top: 134.42rpx;
  177. width: 182rpx;
  178. height: 52rpx;
  179. line-height: 52rpx;
  180. border-radius: 8rpx;
  181. opacity: 1;
  182. box-sizing: border-box;
  183. border: 2rpx solid #F70303;
  184. font-size: 28rpx;
  185. font-weight: normal;
  186. text-align: center;
  187. letter-spacing: 0px;
  188. color: #F70303;
  189. }
  190. .btn1{
  191. left: 463rpx;
  192. width: 122rpx;
  193. }
  194. .btn2{
  195. left: 603rpx;
  196. width: 122rpx;
  197. }
  198. .item-time{
  199. color: #aaa;
  200. width: 160rpx;
  201. text-align: right;
  202. }
  203. </style>