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

368 lines
8.2 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="[publishedActive && 'active']" @click="setPublishedStatus">已发布</view>
  23. <view :class="[processingActive && 'active']" @click="setProcessingStatus">进行中</view>
  24. <view :class="[completedActive && 'active']" @click="setCompletedStatus">已完成</view>
  25. </view>
  26. </view>
  27. <!-- 发布订单按钮 -->
  28. <view class="publish-btn-container">
  29. <view class="publish-btn" @click="publishOrder">
  30. <uv-icon name="plus" size="20" color="#fff"></uv-icon>
  31. <text>发布订单</text>
  32. </view>
  33. </view>
  34. <!-- 已发布订单列表 -->
  35. <view v-if="showPublishedList" class="m20">
  36. <view v-if="publishedEmpty" class="re-empty">
  37. <view>暂无数据</view>
  38. </view>
  39. <view v-for="(item, index) in publishedOrders" :key="index" class="b-relative item-card mb20">
  40. <view class="m10 flex-sb">
  41. <view class="ellipsis">{{ item.title }}</view>
  42. <view class="item-time">{{ item.time }}</view>
  43. </view>
  44. <view>需求时间{{ item.requireTime }}</view>
  45. <view>计划数量{{ item.quantity }}m³</view>
  46. <view>报价{{ item.price }}/m³</view>
  47. <view class="item-status published">已发布</view>
  48. <view class="item-button" @click="viewOrder(item)">查看</view>
  49. </view>
  50. </view>
  51. <!-- 进行中订单列表 -->
  52. <view v-if="showProcessingList" class="m20">
  53. <view v-if="processingEmpty" class="re-empty">
  54. <view>暂无数据</view>
  55. </view>
  56. <view v-for="(item, index) in processingOrders" :key="index" class="b-relative item-card mb20">
  57. <view class="m10 flex-sb">
  58. <view class="ellipsis">{{ item.title }}</view>
  59. <view class="item-time">{{ item.time }}</view>
  60. </view>
  61. <view>执行司机{{ item.driver }}</view>
  62. <view>进度{{ item.progress }}</view>
  63. <view>预计完成{{ item.estimatedTime }}</view>
  64. <view class="item-status processing">进行中</view>
  65. <view class="item-button" @click="viewOrder(item)">查看</view>
  66. </view>
  67. </view>
  68. <!-- 已完成订单列表 -->
  69. <view v-if="showCompletedList" class="m20">
  70. <view v-if="completedEmpty" class="re-empty">
  71. <view>暂无数据</view>
  72. </view>
  73. <view v-for="(item, index) in completedOrders" :key="index" class="b-relative item-card mb20">
  74. <view class="m10 flex-sb">
  75. <view class="ellipsis">{{ item.title }}</view>
  76. <view class="item-time">{{ item.time }}</view>
  77. </view>
  78. <view>完成时间{{ item.completedTime }}</view>
  79. <view>执行司机{{ item.driver }}</view>
  80. <view>评价{{ item.rating }}</view>
  81. <view class="item-status completed">已完成</view>
  82. <view class="item-button" @click="viewOrder(item)">查看</view>
  83. </view>
  84. </view>
  85. </view>
  86. </template>
  87. <script>
  88. export default {
  89. name: 'EnterpriseHall',
  90. data() {
  91. return {
  92. showFilterIcon: true,
  93. showFilterText: true,
  94. searchActive: false,
  95. searchValue: '',
  96. publishedActive: true,
  97. processingActive: false,
  98. completedActive: false,
  99. showPublishedList: true,
  100. showProcessingList: false,
  101. showCompletedList: false,
  102. publishedEmpty: false,
  103. processingEmpty: false,
  104. completedEmpty: false,
  105. publishedOrders: [
  106. {
  107. id: 1,
  108. title: '长沙市雨花区建设项目混凝土需求',
  109. time: '2024-01-15 08:00',
  110. requireTime: '2024-01-16 09:00',
  111. quantity: '200',
  112. price: '350'
  113. },
  114. {
  115. id: 2,
  116. title: '长沙市岳麓区商业中心项目',
  117. time: '2024-01-15 10:00',
  118. requireTime: '2024-01-17 08:00',
  119. quantity: '150',
  120. price: '380'
  121. }
  122. ],
  123. processingOrders: [
  124. {
  125. id: 3,
  126. title: '长沙市开福区住宅项目',
  127. time: '2024-01-14 14:00',
  128. driver: '张师傅',
  129. progress: '运输中 70%',
  130. estimatedTime: '2024-01-14 18:00'
  131. }
  132. ],
  133. completedOrders: [
  134. {
  135. id: 4,
  136. title: '长沙市天心区办公楼项目',
  137. time: '2024-01-13 09:00',
  138. completedTime: '2024-01-13 17:00',
  139. driver: '李师傅',
  140. rating: '5星好评'
  141. }
  142. ]
  143. }
  144. },
  145. methods: {
  146. showFilter() {
  147. console.log('显示筛选');
  148. },
  149. onSearch() {
  150. console.log('搜索:', this.searchValue);
  151. },
  152. onInput() {
  153. this.searchActive = this.searchValue.length > 0;
  154. },
  155. setPublishedStatus() {
  156. this.publishedActive = true;
  157. this.processingActive = false;
  158. this.completedActive = false;
  159. this.showPublishedList = true;
  160. this.showProcessingList = false;
  161. this.showCompletedList = false;
  162. },
  163. setProcessingStatus() {
  164. this.publishedActive = false;
  165. this.processingActive = true;
  166. this.completedActive = false;
  167. this.showPublishedList = false;
  168. this.showProcessingList = true;
  169. this.showCompletedList = false;
  170. },
  171. setCompletedStatus() {
  172. this.publishedActive = false;
  173. this.processingActive = false;
  174. this.completedActive = true;
  175. this.showPublishedList = false;
  176. this.showProcessingList = false;
  177. this.showCompletedList = true;
  178. },
  179. viewOrder(item) {
  180. uni.navigateTo({
  181. url: `/pages_order/order/orderDetail?id=${item.id}`
  182. });
  183. },
  184. publishOrder() {
  185. uni.navigateTo({
  186. url: '/pages_order/staff/create'
  187. });
  188. },
  189. // 供外部调用的方法
  190. loadPage() {
  191. console.log('企业订单大厅页面刷新');
  192. }
  193. }
  194. }
  195. </script>
  196. <style scoped lang="scss">
  197. .content {
  198. padding: 20rpx;
  199. height: 100%;
  200. box-sizing: border-box;
  201. overflow-y: auto;
  202. }
  203. .head {
  204. background-color: #fff;
  205. padding: 20rpx;
  206. border-radius: 10rpx;
  207. margin-bottom: 20rpx;
  208. }
  209. .sticky {
  210. position: sticky;
  211. top: 0;
  212. z-index: 999;
  213. }
  214. .box-shadow-light {
  215. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
  216. }
  217. .flex {
  218. display: flex;
  219. align-items: center;
  220. }
  221. .flex-sb {
  222. display: flex;
  223. justify-content: space-between;
  224. align-items: center;
  225. }
  226. .mr5 {
  227. margin-right: 5rpx;
  228. }
  229. .search-input {
  230. flex: 1;
  231. height: 60rpx;
  232. padding: 0 20rpx;
  233. border: 1rpx solid #e0e0e0;
  234. border-radius: 30rpx;
  235. margin-left: 20rpx;
  236. font-size: 28rpx;
  237. &.active {
  238. border-color: #007AFF;
  239. }
  240. }
  241. .status {
  242. margin-top: 20rpx;
  243. gap: 30rpx;
  244. view {
  245. padding: 15rpx 25rpx;
  246. border-radius: 25rpx;
  247. font-size: 26rpx;
  248. color: #666;
  249. background-color: #f8f8f8;
  250. transition: all 0.3s;
  251. &.active {
  252. color: #007AFF;
  253. background-color: #e6f3ff;
  254. border: 1rpx solid #007AFF;
  255. }
  256. }
  257. }
  258. .publish-btn-container {
  259. padding: 0 20rpx 20rpx;
  260. }
  261. .publish-btn {
  262. display: flex;
  263. align-items: center;
  264. justify-content: center;
  265. gap: 10rpx;
  266. padding: 20rpx;
  267. background-color: #007AFF;
  268. color: #fff;
  269. border-radius: 10rpx;
  270. font-size: 28rpx;
  271. font-weight: bold;
  272. }
  273. .m20 {
  274. margin: 20rpx;
  275. }
  276. .mb20 {
  277. margin-bottom: 20rpx;
  278. }
  279. .m10 {
  280. margin: 10rpx;
  281. }
  282. .item-card {
  283. background-color: #fff;
  284. border-radius: 10rpx;
  285. padding: 20rpx;
  286. position: relative;
  287. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  288. }
  289. .ellipsis {
  290. overflow: hidden;
  291. white-space: nowrap;
  292. text-overflow: ellipsis;
  293. font-weight: bold;
  294. font-size: 30rpx;
  295. }
  296. .item-time {
  297. font-size: 24rpx;
  298. color: #999;
  299. }
  300. .item-status {
  301. position: absolute;
  302. top: 20rpx;
  303. right: 20rpx;
  304. padding: 8rpx 16rpx;
  305. border-radius: 20rpx;
  306. font-size: 22rpx;
  307. color: #fff;
  308. &.published {
  309. background-color: #ff9500;
  310. }
  311. &.processing {
  312. background-color: #007AFF;
  313. }
  314. &.completed {
  315. background-color: #34c759;
  316. }
  317. }
  318. .item-button {
  319. position: absolute;
  320. bottom: 20rpx;
  321. right: 20rpx;
  322. padding: 10rpx 20rpx;
  323. background-color: #007AFF;
  324. color: #fff;
  325. border-radius: 20rpx;
  326. font-size: 24rpx;
  327. }
  328. .re-empty {
  329. text-align: center;
  330. padding: 100rpx 0;
  331. color: #999;
  332. font-size: 28rpx;
  333. }
  334. .b-relative {
  335. position: relative;
  336. }
  337. </style>