Sfoglia il codice sorgente

物料申请APP优化

wuhb 1 mese fa
parent
commit
37e7f73073
5 ha cambiato i file con 35 aggiunte e 18 eliminazioni
  1. 2 2
      api/apply/index.uts
  2. 4 4
      pages/apply/applyInfo.uvue
  3. 25 8
      pages/apply/index.uvue
  4. 2 2
      pages/index/index.uvue
  5. 2 2
      utils/request.uts

+ 2 - 2
api/apply/index.uts

@@ -71,7 +71,7 @@ export const confirmPurchaseApply = (data: UTSJSONObject | null): Promise<any> =
  * @returns 
  */
 export const getPurchaseApplyList = (pageNum: number, pageSize: number, keyword: string, status: string | null, userId: string, pendingReceive: boolean): Promise<any> => {
-	let url = `/mes/wm/purchaseApply/list?pageNum=${pageNum}&pageSize=${pageSize}&createBy=${userId}`
+	let url = `/mes/wm/purchaseApply/mobileList?pageNum=${pageNum}&pageSize=${pageSize}&applyUserId=${userId}`
 	if (keyword != null && keyword.length > 0) {
 		url += `&applyCode=${encodeURIComponent(keyword)}`
 	}
@@ -154,7 +154,7 @@ export const deleteMaterial = (itemId: string): Promise<any> => {
  */
 export const getPendingReceiveApplyCount = (userId: string): Promise<any> => {
 	return request({
-		url: `/mes/wm/purchaseApply/countPendingReceive?createBy=${userId}`,
+		url: `/mes/wm/purchaseApply/countPendingReceive?applyUserId=${userId}`,
 		method: 'GET'
 	})
 }

+ 4 - 4
pages/apply/applyInfo.uvue

@@ -155,7 +155,7 @@
         const status = val != null ? val.toString() : ''
         switch (status) {
             case '1': return '草稿'
-            case '2': return '生成出库单'
+            case '2': return '待领取'
             case '3': return '已申请采购'
             case '4': return '已申请采购/出库'
             case '5': return '已完成'
@@ -343,13 +343,13 @@
             color: #52c41a;
         }
         &.status-CANCEL {
-            color: #ff4d4f;
+            color: #c1c1c1;
         }
         &.line-status-1 {
             color: #faad14;
         }
         &.line-status-2 {
-            color: #1890ff;
+            color: #ff0000;
         }
         &.line-status-3 {
             color: #722ed1;
@@ -361,7 +361,7 @@
             color: #52c41a;
         }
         &.line-status-6 {
-            color: #ff4d4f;
+            color: #a9a9a9;
         }
         
         &.purchase-status-0 {

+ 25 - 8
pages/apply/index.uvue

@@ -95,6 +95,10 @@
                                 </view>
                             </view>
                             <view class="info-row">
+								<view class="info-item">
+								    <text class="info-label">待领取</text>
+								    <text class="info-value error">{{ getReceiveCount(item) }}</text>
+								</view>
                                 <view class="info-item">
                                     <text class="info-label">申购状态</text>
                                     <text class="info-value" :class="'purchase-status-' + getPurchaseStatus(item)">{{ getPurchaseStatusText(item) }}</text>
@@ -228,6 +232,14 @@
 	    return val != null ? val.toString() : '0'
 	}
 	
+	// 获取待领取数量
+	const getReceiveCount = (item: any | null): string => {
+	    if (item == null) return '0'
+	    const jsonItem = item as UTSJSONObject
+	    const val = jsonItem['pendingReceiveCount']
+	    return val != null ? val.toString() : '0'
+	}
+	
     // 获取已完成数量
     const getFinishedCount = (item: any | null): string => {
         if (item == null) return '0'
@@ -356,21 +368,23 @@
             url: `/pages/apply/applyInfo?id=${applyId}`
         })
     }
-
-    // 初始化
-    loadData(true)
-
+	
     // 页面显示时刷新列表
     onShow(() => {
-        loadData(true)
-        loadPendingReceiveCount()
+		if(currentUserId.length > 0){
+			loadData(true)
+			loadPendingReceiveCount()
+		}
     })
 	
 	onMounted(() => {
 		const userInfo = getUserInfo()
 		if (userInfo != null) {
-			const userName = userInfo['userName']
-			currentUserId = userName != null ? userName.toString() : ''
+			const userId = userInfo['userId']
+			currentUserId = userId != null ? userId.toString() : ''
+			console.log("currentUserId:" + currentUserId)
+			// 初始化
+			loadData(true)
 		}
 	// 获取页面参数,判断是否从index.uvue跳转过来
 		const pages = getCurrentPages()
@@ -636,6 +650,9 @@
                     &.warning {
                         color: #faad14;
                     }
+					&.error {
+					    color: #ff0000;
+					}
                     &.primary {
                         color: #007aff;
                     }

+ 2 - 2
pages/index/index.uvue

@@ -266,9 +266,9 @@ const loadReceiveList = (): void => {
 	
 	// 加载物料申请待领取 badge 数量
 	const loadApplyBadge = (): void => {
-		if (currentUserName.length === 0) return
+		if (currentUserId.length === 0) return
 		// 查询物料申请待领取数量
-		getPendingReceiveApplyCount(currentUserName).then((res: any) => {
+		getPendingReceiveApplyCount(currentUserId).then((res: any) => {
 			const result = res as UTSJSONObject
 			const count = result['data']
 			// 更新快捷功能中的物料申请 badge

+ 2 - 2
utils/request.uts

@@ -14,9 +14,9 @@ export type RequestConfig = {
 
 // 基础 URL
 // const BASE_URL = "http://192.168.2.26:83";
-// const BASE_URL = "http://192.168.189.43:83";
+const BASE_URL = "http://192.168.189.43:83";
 // const BASE_URL = "http://222.243.138.146:8150/prod-api" //测试服务器;
-const BASE_URL = "http://222.243.138.146:880/prod-api" //正式服务器;
+// const BASE_URL = "http://222.243.138.146:880/prod-api" //正式服务器;
 
 /**
  * 获取基础 URL