ezhizao_zx пре 1 година
родитељ
комит
1adca0c463

+ 1 - 0
components/dialog-login/dialog-login.vue

@@ -128,6 +128,7 @@
 								userInfo.value = res.data;
 								user.value.push(userInfo.value);
 								store.userInfo = res.data
+								// console.log(res)
 								uni.redirectTo({
 									url: '/pages/dashboard/index'
 								});

+ 11 - 3
pages/dashboard/index.vue

@@ -46,7 +46,7 @@
 		<view class="business-btn uni-row" v-if="showTurn" @click="handleToHandlingList">
 			<text class="label">周转</text>
 		</view>
-		<view class="business-btn uni-row" @click="handleOutsourceList">
+		<view class="business-btn uni-row" v-if="showOutSourceList" @click="handleOutsourceList">
 			<text class="label">外协验箱</text>
 		</view>
 		<view class="bottom-btn-container">
@@ -95,13 +95,15 @@
 	const showQuick = ref(false)
 	const showSizing = ref(false)
 	const showOutsourcedInspector = ref(false)
+	const showOutSourceList = ref(false)
 
 	onLoad(() => {
 		userInfo.value = store.userInfo || {
 			nickName: ""
 		};
 		store.tenantId = userInfo.value.tenantId;
-		console.log("-----------", store.userInfo.roles)
+		// console.log("-----------", store.userInfo.roles)
+		// console.log("-----permissions-----", store.userInfo)
 		if (store.userInfo.roles.some(item => item.roleId == 124) && store.userInfo.roles.length > 1) {
 			showTurn.value = true;
 			showOther.value = true;
@@ -115,6 +117,12 @@
 			showTurn.value = false;
 			showOther.value = true;
 		}
+		if (store.userInfo.permissions.some(item => item === 'business:outsource:checkBox') || store.userInfo
+			.permissions.some(item => item === "*:*:*")) {
+			showOutSourceList.value = true;
+		} else {
+			showOutSourceList.value = false;
+		}
 
 		if (store.userInfo.roles.some(item => item.roleId == 129)) {
 			showOutsourcedInspector.value = true
@@ -260,7 +268,7 @@
 			url: '/pages/handlingList/index'
 		})
 	}
-	
+
 	function handleOutsourceList() {
 		uni.navigateTo({
 			url: '/pages/outsourcedReturnCheck/index'

+ 73 - 18
pages/outsourcedReturnCheck/index.vue

@@ -11,12 +11,10 @@
 				搜索
 			</view>
 		</view>
-
 		<view class="scroll-container" style="padding-bottom:  150rpx">
 			<view v-if="listData.length == 0" style="color: #999;margin: 50% auto;">
 				<text>暂无批次</text>
 			</view>
-			<!-- 批次列表 -->
 			<view v-else v-for="(item, index) in listData" :key="index" class="list-item"
 				@click="handleToreportingForWork(item)">
 				<view class="item-info uni-row">
@@ -37,13 +35,21 @@
 				</view>
 				<view class="status-btn uni-row">
 					<view class=" uni-row">
-						<button class="reporting-tag" size="mini"
-							@click.stop="handleCarriers(item)">箱号详情</button>
-						<!-- <button class="reporting-tag" size="mini" @click="handleToreportingForWork">去报工</button> -->
+						<button class="reporting-tag" size="mini" @click.stop="handleCarriers(item)">箱号详情</button>
 					</view>
 				</view>
 			</view>
+			<uni-load-more iconType="auto" :content-text="contentText" :status="status"
+				@clickLoadMore="clickLoadMore" />
 		</view>
+		<!-- <uni-section title="外协单列表" type="line">
+			<uni-list border-full>
+				<uni-list-item v-for="(item, index) in listData" :key="index" class="list-item"
+					@click="handleToreportingForWork(item)">
+
+				</uni-list-item>
+			</uni-list>
+		</uni-section> -->
 	</view>
 </template>
 
@@ -82,18 +88,23 @@
 	const bottomStatus = ref(false) // 底部按钮显示
 	const paging = ref();
 	const reqParam = ref(null);
-	const normalStatus = ref(true)
-	const isLoding = ref(false);
+	const total = ref(0)
 	const curDayworkItem = ref({}) // 当前报工记录,回显是否显示取消周转的状态	
 	const keywords = ref(null)
-	const tempList = ref([])
-	const wasteRecyclingList = ref([]) //废品回用批次
+	const contentText = ref({
+		contentdown: '查看更多',
+		contentrefresh: '加载中',
+		contentnomore: '没有更多'
+	})
+	const status = ref("more")
 	// 在数据中定义一个变量来控制遮罩层的显示
 	const isMaskShow = ref(false);
-	const showRight = ref(null) // 抽屉
-	
+
 	const queryParams = ref({
-		
+		orderByColumn: 'createTime',
+		isAsc: 'descending',
+		pageNum: 1,
+		pageSize: 10,
 	})
 
 	onLoad(() => {
@@ -113,7 +124,7 @@
 	function reflush() {
 		getList()
 	}
-	
+
 	function handleCarriers(item) {
 		uni.navigateTo({
 			url: "/pages/outsourcedReturnCheck/carriers",
@@ -125,18 +136,64 @@
 			}
 		})
 	}
-	
+
+	function clickLoadMore() {
+		console.log('clickLoadMore')
+		loadMore()
+	}
+
+	function loadMore() {
+		console.log('loadMore')
+		if (keywords.value != null && keywords.value != '') {
+			queryParams.value.keywords = keywords.value
+		} else {
+			queryParams.value.keywords = null;
+		}
+		if ((queryParams.value.pageNum * queryParams.value.pageSize) >= total.value) {
+			status.value = 'no-more'
+			return
+		}
+		queryParams.value.pageNum = queryParams.value.pageNum + 1
+		getOutsourceOrderList(queryParams.value).then(res => {
+			if (res.code === 200) {
+				// console.log(res)
+				listData.value.push(...res.rows)
+				total.value = res.total
+				console.log(res.rows.length)
+				if (res.rows.length === 0) {
+					status.value = 'no-more'
+					queryParams.value.pageNum = queryParams.value.pageNum - 1
+				}
+				console.log(queryParams.value.pageNum)
+			} else {
+				total.value = 0
+				uni.showToast({
+					title: res.message,
+					icon: 'none'
+				})
+			}
+		}).catch(err => {
+			console.log(err)
+		})
+	}
+
 	function getList() {
 		if (keywords.value != null && keywords.value != '') {
 			queryParams.value.keywords = keywords.value
 		} else {
 			queryParams.value.keywords = null;
 		}
+		queryParams.value.pageNum = 1;
 		getOutsourceOrderList(queryParams.value).then(res => {
-			// console.log(res)
+			console.log(res)
 			if (res.code === 200) {
 				listData.value = res.rows
+				total.value = res.total
+				if (total.value > listData.value.length) {
+					status.value = 'more'
+				}
 			} else {
+				total.value = 0
 				uni.showToast({
 					title: res.message,
 					icon: 'none'
@@ -146,12 +203,10 @@
 			console.log(err)
 		})
 	}
-	
+
 	function handleSearch() {
 		getList()
 	}
-	
-	
 </script>
 
 <style lang="scss">