HD_wangm há 4 meses atrás
pai
commit
21f8d75303
2 ficheiros alterados com 104 adições e 2 exclusões
  1. 21 0
      pages.json
  2. 83 2
      pages/order/index.uvue

+ 21 - 0
pages.json

@@ -99,6 +99,27 @@
 				"navigationBarTitleText": "接单",
 				"navigationStyle": "#custom"
 			}
+		},
+		{
+			"path": "pages/order/detail/suspendIndex",
+			"style": {
+				"navigationBarTitleText": "挂起",
+				"navigationStyle": "#custom"
+			}
+		},
+		{
+			"path": "pages/order/detail/approveIndex",
+			"style": {
+				"navigationBarTitleText": "审批",
+				"navigationStyle": "#custom"
+			}
+		},
+		{
+			"path": "pages/order/detail/resumeIndex",
+			"style": {
+				"navigationBarTitleText": "恢复",
+				"navigationStyle": "#custom"
+			}
 		}
 	],
 	"globalStyle": {

+ 83 - 2
pages/order/index.uvue

@@ -40,7 +40,7 @@
                             <text class="item-title">{{ getOrderType(item) }}</text>
                             <text class="detail-link">类型 ›</text> -->
 							<text class="item-title">{{ getWorkOrderProjectNo(item) }}-{{ getPcsDeviceName(item) }}{{ getOrderType(item) }}</text>
-							<text class="info-value">{{ getWorkOrderStatus(item) }}</text>
+							<text class="status-tag" :class="getStatusClass(item)">{{ getWorkOrderStatus(item) }}</text>
                         </view>
 						<view class="info-row">
 							<view class="info-label">
@@ -318,6 +318,16 @@ import { getDictDataByType } from '../../api/dict/index'
 	    const dictItem = statusDictList.value.find(dict => dict.dictValue == rawStatus)
 	    return dictItem!=null ? dictItem.dictLabel : rawStatus
 	}
+	
+	const getStatusClass = (item: any | null): string => {
+		if (item == null) return ''
+		const orderInfoItem = item as acceptOrderInfo
+		const rawStatus = orderInfoItem.workOrderStatus
+		if (rawStatus==null) return ''
+		// const status = rawStatus
+		// 返回对应的状态类名
+		return `status-${rawStatus}`
+	}
 
     // 切换状态
     const switchStatus = (status: string): void => {
@@ -373,11 +383,16 @@ import { getDictDataByType } from '../../api/dict/index'
 			uni.navigateTo({
 			    url: `/pages/order/detail/suspendIndex?id=${orderItem.id}&orderType=${orderItem.orderType}`
 			})
-		}  else if(currentStatus.value === 'to_approve') {
+		} else if(currentStatus.value === 'to_approve') {
 			// 跳转到待审批页面
 			uni.navigateTo({
 			    url: `/pages/order/detail/approveIndex?id=${orderItem.id}&orderType=${orderItem.orderType}`
 			})
+		} else if(currentStatus.value === 'suspended') {
+			// 跳转到恢复页面
+			uni.navigateTo({
+			    url: `/pages/order/detail/resumeIndex?id=${orderItem.id}&orderType=${orderItem.orderType}`
+			})
 		}
 
     }
@@ -598,4 +613,70 @@ import { getDictDataByType } from '../../api/dict/index'
   font-size: 26rpx;
   color: #666;
 }
+
+.status-tag {
+	padding: 8rpx 20rpx;
+	border-radius: 20rpx;
+	font-size: 24rpx;
+	// font-weight: 50rpx;
+	white-space: nowrap;
+	margin-left: 20rpx;
+	border: 1rpx solid;
+}
+
+/* 待接单 */
+.status-assigned {
+	background-color: #ebf5ff;
+	color: #409eff;
+	border-color: #d8ebff;
+}
+
+
+/* 待结单 */
+.status-to_finish {
+	background-color: #fff7e6;
+	color: #fa8c16;
+	border-color: #ffd591;
+	// background-color: #fff2f0;
+	// color: #ff4d4f;
+	// border-color: #ffccc7;
+}
+
+/* 待审批 */
+.status-to_approve {
+	background-color: #fff7e6;
+	color: #fa8c16;
+	border-color: #ffd591;
+	// background-color: #f6ffed;
+	// color: #52c41a;
+	// border-color: #b7eb8f;
+}
+
+/* 已挂起 */
+.status-suspended {
+	background-color: #fff2f0;
+	color: #ff4d4f;
+	border-color: #ffccc7;
+}
+
+/* 已完成 */
+.status-completed {
+	background-color: #f0f9eb;
+	color: #5cb87a;
+	border-color: #c2e7b0;
+}
+
+/* 待下发 */
+.status-to_issue {
+	background-color: #f4f4f5;
+	color: #909399;
+	border-color: #e9e9eb;
+}
+
+/* 已归档 */
+.status-archived {
+	background-color: #f0f9eb;
+	color: #5cb87a;
+	border-color: #c2e7b0;
+}
 </style>