Browse Source

处理打包兼容性

wuhb 2 months ago
parent
commit
ae4c7bd9bc

+ 4 - 1
api/out/index.uts

@@ -13,7 +13,10 @@ import { request } from '../../utils/request'
  * @returns 
  */
 export const getProductSalseList = (pageNum: number, pageSize: number, keyword: string, receiverUserId: string, signStatus: string): Promise<any> => {
-	let url = `/mes/wm/productsalse/myList?pageNum=${pageNum}&pageSize=${pageSize}&receiverUserId=${receiverUserId}`
+	let url = `/mes/wm/productsalse/myList?pageNum=${pageNum}&pageSize=${pageSize}`
+	if (receiverUserId != null && receiverUserId.length > 0) {
+		url += `&receiverUserId=${receiverUserId}`
+	}
 	if (keyword != null && keyword.length > 0) {
 		url += `&salseCode=${encodeURIComponent(keyword)}`
 	}

+ 1 - 1
pages/apply/applyNew.uvue

@@ -216,7 +216,7 @@
 </template>
 
 <script setup lang="uts">
-	import { ref, computed, onBeforeUnmount, onMounted } from 'vue'
+import { ref, computed, onBeforeUnmount, onMounted } from 'vue'
 import { getItemTypeListByParentId, getItemList, savePurchaseApply, confirmPurchaseApply, addMaterial, getMeasureList, deleteMaterial } from '../../api/apply/index'
 import UploadImage from '../../components/upload-image/upload-image.uvue'
 import type { UploadResponse } from '../../types/workbench'

+ 2 - 1
pages/apply/index.uvue

@@ -109,7 +109,8 @@
 </template>
 
 <script setup lang="uts">
-    import { ref, onShow } from 'vue'
+    import { ref } from 'vue'
+	import { onLoad, onShow } from '@dcloudio/uni-app';
     import { getPurchaseApplyList, getPendingReceiveApplyCount } from '../../api/apply/index'
     import { getUserInfo } from '../../utils/storage'
 

+ 2 - 1
pages/item/index.uvue

@@ -67,7 +67,8 @@
 </template>
 
 <script setup lang="uts">
-    import { ref, onShow, onMounted } from 'vue'
+    import { ref, onMounted } from 'vue'
+	import { onLoad, onShow } from '@dcloudio/uni-app';
     import { getItemList, getItemTypeListByParentId } from '../../api/apply/index'
 
     type CategoryItem = { id: string; name: string; code: string }

+ 11 - 4
pages/out/index.uvue

@@ -94,7 +94,8 @@
 </template>
 
 <script setup lang="uts">
-    import { ref, onShow, onMounted } from 'vue'
+    import { ref, onMounted } from 'vue'
+	import { onLoad, onShow } from '@dcloudio/uni-app';
     import { getProductSalseList, signReceiveAll } from '../../api/out/index'
     import { getUserInfo } from '../../utils/storage'
 
@@ -305,18 +306,24 @@
         })
     }
 
-    // 初始化
-    onMounted(() => {
+    // 初始化用户信息
+    const initUserInfo = () => {
         const userInfo = getUserInfo()
         if (userInfo != null) {
-            const userId = userInfo['userId']
+            const userId = userInfo['userId'] || userInfo['user_id'] || userInfo['userid'] || userInfo['userName']
             currentUserId = userId != null ? userId.toString() : ''
         }
+    }
+
+    // 初始化
+    onMounted(() => {
+        initUserInfo()
         loadData(true)
     })
 
     // 页面显示时刷新列表
     onShow(() => {
+        initUserInfo()
         loadData(true)
     })
 </script>

+ 2 - 1
pages/task/area-list.uvue

@@ -69,7 +69,8 @@
 </template>
 
 <script setup lang="uts">
-import { ref, onBeforeUnmount, onMounted, reactive, onShow } from 'vue' 
+import { ref, onBeforeUnmount, onMounted, reactive } from 'vue'
+import { onLoad, onShow } from '@dcloudio/uni-app';
 import type { SysDictData } from '../../types/dict'
 import {checkPermi, getUserInfo} from '../../utils/storage'
 import { getTaskInfo, updateTaskInfo } from '../../api/task/list.uts'

+ 1 - 1
pages/task/area-patrol.uvue

@@ -121,7 +121,7 @@
 </template>
 
 <script setup lang="uts">
-import { ref, computed, type UTSJSONObject } from 'vue'
+import { ref, computed} from 'vue'
 import UploadImage from '../../components/upload-image/upload-image.uvue'
 import UploadVideo from '../../components/upload-video/upload-video.uvue'
 import type { UploadResponse } from '../../types/workbench'

+ 1 - 1
pages/task/device-check.uvue

@@ -146,7 +146,7 @@
 </template>
 
 <script setup lang="uts">
-import { ref, reactive, onMounted, computed, type UTSJSONObject } from 'vue'
+import { ref, reactive, onMounted, computed} from 'vue'
 import UploadImage from '../../components/upload-image/upload-image.uvue'
 import UploadVideo from '../../components/upload-video/upload-video.uvue'
 import type { UploadResponse } from '../../types/workbench'

+ 2 - 1
pages/task/device-list.uvue

@@ -78,7 +78,8 @@
 </template>
 
 <script setup lang="uts">
-import { ref, onBeforeUnmount, onMounted, reactive, onShow } from 'vue' 
+import { ref, onBeforeUnmount, onMounted, reactive } from 'vue' 
+import { onLoad, onShow } from '@dcloudio/uni-app';
 import type { SysDictData } from '../../types/dict'
 import {checkPermi, getUserInfo} from '../../utils/storage'
 import { getTaskInfo, updateTaskInfo } from '../../api/task/list.uts'

+ 2 - 1
pages/task/index.uvue

@@ -87,7 +87,8 @@
 </template>
 
 <script setup lang="uts">
-import { ref, onBeforeUnmount, onMounted, reactive, onShow, onHide } from 'vue' 
+import { ref, onBeforeUnmount, onMounted, reactive } from 'vue' 
+import { onLoad, onShow,onHide } from '@dcloudio/uni-app';
 import type { SysDictData, DictDataResponse } from '../../types/dict'
 import {checkPermi, getUserInfo} from '../../utils/storage'
 import { getDictDataByType } from '../../api/dict/index'