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

308 lines
6.9 KiB

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