混凝土运输管理微信小程序、替班
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.

307 lines
6.8 KiB

2 weeks ago
  1. <template>
  2. <view class="content">
  3. <!-- 顶部搜索和筛选 -->
  4. <view class="head flex-sb sticky box-shadow-light">
  5. <view class="flex" @click="showFilter">
  6. <view class="mr5">
  7. <uv-icon v-if="showFilterIcon" name="funnel" size="24" color="#666"></uv-icon>
  8. </view>
  9. <view v-if="showFilterText" style="font-size:28rpx">筛选</view>
  10. <input
  11. :class="['search-input', searchActive && 'active']"
  12. maxlength="10"
  13. type="text"
  14. confirm-type="search"
  15. @confirm="onSearch"
  16. v-model="searchValue"
  17. @input="onInput"
  18. placeholder="搜索订单"
  19. />
  20. </view>
  21. <view class="flex status">
  22. <view :class="[pendingActive && 'active']" @click="setPendingStatus">待接单</view>
  23. <view :class="[processingActive && 'active']" @click="setProcessingStatus">进行中</view>
  24. <view :class="[completedActive && 'active']" @click="setCompletedStatus">已完成</view>
  25. </view>
  26. </view>
  27. <!-- 待接单列表 -->
  28. <view v-if="showPendingList" class="m20">
  29. <view v-if="pendingEmpty" class="re-empty">
  30. <view>暂无数据</view>
  31. </view>
  32. <view v-for="(item, index) in pendingOrders" :key="index" class="b-relative item-card mb20">
  33. <view class="m10 flex-sb">
  34. <view class="ellipsis">{{ item.title }}</view>
  35. <view class="item-time">{{ item.time }}</view>
  36. </view>
  37. <view>到场时间{{ item.arrivalTime }}</view>
  38. <view>计划数量{{ item.quantity }}m³/</view>
  39. <view class="item-button" @click="viewOrder(item)">查看</view>
  40. </view>
  41. </view>
  42. <!-- 进行中列表 -->
  43. <view v-if="showProcessingList" class="m20">
  44. <view v-if="processingEmpty" class="re-empty">
  45. <view>暂无数据</view>
  46. </view>
  47. <view v-for="(item, index) in processingOrders" :key="index" class="b-relative item-card mb20">
  48. <view class="m10 flex-sb">
  49. <view class="ellipsis">{{ item.title }}</view>
  50. <view class="item-time">{{ item.time }}</view>
  51. </view>
  52. <view>进度{{ item.progress }}</view>
  53. <view>预计完成{{ item.estimatedTime }}</view>
  54. <view class="item-button" @click="viewOrder(item)">查看</view>
  55. </view>
  56. </view>
  57. <!-- 已完成列表 -->
  58. <view v-if="showCompletedList" class="m20">
  59. <view v-if="completedEmpty" class="re-empty">
  60. <view>暂无数据</view>
  61. </view>
  62. <view v-for="(item, index) in completedOrders" :key="index" class="b-relative item-card mb20">
  63. <view class="m10 flex-sb">
  64. <view class="ellipsis">{{ item.title }}</view>
  65. <view class="item-time">{{ item.time }}</view>
  66. </view>
  67. <view>完成时间{{ item.completedTime }}</view>
  68. <view>评价{{ item.rating }}</view>
  69. <view class="item-button" @click="viewOrder(item)">查看</view>
  70. </view>
  71. </view>
  72. </view>
  73. </template>
  74. <script>
  75. import navbar from '@/components/base/navbar.vue'
  76. export default {
  77. name: 'StaffHall',
  78. components: {
  79. navbar
  80. },
  81. data() {
  82. return {
  83. showFilterIcon: true,
  84. showFilterText: true,
  85. searchActive: false,
  86. searchValue: '',
  87. pendingActive: true,
  88. processingActive: false,
  89. completedActive: false,
  90. showPendingList: true,
  91. showProcessingList: false,
  92. showCompletedList: false,
  93. pendingEmpty: false,
  94. processingEmpty: false,
  95. completedEmpty: false,
  96. pendingOrders: [
  97. {
  98. id: 1,
  99. title: '长沙市雨花区建设项目',
  100. time: '2024-01-15 08:00',
  101. arrivalTime: '2024-01-15 09:00',
  102. quantity: '50'
  103. },
  104. {
  105. id: 2,
  106. title: '长沙市岳麓区商业中心',
  107. time: '2024-01-15 10:00',
  108. arrivalTime: '2024-01-15 11:00',
  109. quantity: '30'
  110. }
  111. ],
  112. processingOrders: [
  113. {
  114. id: 3,
  115. title: '长沙市开福区住宅项目',
  116. time: '2024-01-14 14:00',
  117. progress: '进行中 60%',
  118. estimatedTime: '2024-01-14 18:00'
  119. }
  120. ],
  121. completedOrders: [
  122. {
  123. id: 4,
  124. title: '长沙市天心区办公楼',
  125. time: '2024-01-13 09:00',
  126. completedTime: '2024-01-13 17:00',
  127. rating: '5星好评'
  128. }
  129. ]
  130. }
  131. },
  132. methods: {
  133. showFilter() {
  134. console.log('显示筛选');
  135. },
  136. onSearch() {
  137. console.log('搜索:', this.searchValue);
  138. },
  139. onInput() {
  140. this.searchActive = this.searchValue.length > 0;
  141. },
  142. setPendingStatus() {
  143. this.pendingActive = true;
  144. this.processingActive = false;
  145. this.completedActive = false;
  146. this.showPendingList = true;
  147. this.showProcessingList = false;
  148. this.showCompletedList = false;
  149. },
  150. setProcessingStatus() {
  151. this.pendingActive = false;
  152. this.processingActive = true;
  153. this.completedActive = false;
  154. this.showPendingList = false;
  155. this.showProcessingList = true;
  156. this.showCompletedList = false;
  157. },
  158. setCompletedStatus() {
  159. this.pendingActive = false;
  160. this.processingActive = false;
  161. this.completedActive = true;
  162. this.showPendingList = false;
  163. this.showProcessingList = false;
  164. this.showCompletedList = true;
  165. },
  166. viewOrder(item) {
  167. uni.navigateTo({
  168. url: `/pages_order/order/orderDetail?id=${item.id}`
  169. });
  170. }
  171. }
  172. }
  173. </script>
  174. <style scoped lang="scss">
  175. .content {
  176. padding: 20rpx;
  177. min-height: 100vh;
  178. background-color: #f5f5f5;
  179. }
  180. .head {
  181. background-color: #fff;
  182. padding: 20rpx;
  183. border-radius: 10rpx;
  184. margin-bottom: 20rpx;
  185. }
  186. .sticky {
  187. position: sticky;
  188. top: 0;
  189. z-index: 999;
  190. }
  191. .box-shadow-light {
  192. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
  193. }
  194. .flex {
  195. display: flex;
  196. align-items: center;
  197. }
  198. .flex-sb {
  199. display: flex;
  200. justify-content: space-between;
  201. align-items: center;
  202. }
  203. .mr5 {
  204. margin-right: 5rpx;
  205. }
  206. .search-input {
  207. flex: 1;
  208. height: 60rpx;
  209. padding: 0 20rpx;
  210. border: 1rpx solid #e0e0e0;
  211. border-radius: 30rpx;
  212. margin-left: 20rpx;
  213. font-size: 28rpx;
  214. &.active {
  215. border-color: #007AFF;
  216. }
  217. }
  218. .status {
  219. margin-top: 20rpx;
  220. gap: 30rpx;
  221. view {
  222. padding: 15rpx 25rpx;
  223. border-radius: 25rpx;
  224. font-size: 26rpx;
  225. color: #666;
  226. background-color: #f0f0f0;
  227. transition: all 0.3s;
  228. &.active {
  229. background-color: #007AFF;
  230. color: #fff;
  231. }
  232. }
  233. }
  234. .m20 {
  235. margin: 20rpx 0;
  236. }
  237. .m10 {
  238. margin: 10rpx 0;
  239. }
  240. .mb20 {
  241. margin-bottom: 20rpx;
  242. }
  243. .b-relative {
  244. position: relative;
  245. }
  246. .item-card {
  247. background-color: #fff;
  248. border-radius: 10rpx;
  249. padding: 30rpx;
  250. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
  251. font-size: 28rpx;
  252. line-height: 1.6;
  253. }
  254. .ellipsis {
  255. overflow: hidden;
  256. white-space: nowrap;
  257. text-overflow: ellipsis;
  258. flex: 1;
  259. font-weight: bold;
  260. color: #333;
  261. }
  262. .item-time {
  263. font-size: 24rpx;
  264. color: #999;
  265. }
  266. .item-button {
  267. position: absolute;
  268. right: 30rpx;
  269. bottom: 30rpx;
  270. background-color: #007AFF;
  271. color: #fff;
  272. padding: 15rpx 25rpx;
  273. border-radius: 25rpx;
  274. font-size: 26rpx;
  275. }
  276. .re-empty {
  277. text-align: center;
  278. padding: 100rpx 0;
  279. color: #999;
  280. font-size: 28rpx;
  281. }
  282. </style>