wsx 11 kuukautta sitten
vanhempi
commit
05fd654be1

+ 12 - 1
api/myTicket/index.js

@@ -143,4 +143,15 @@ export async function deviceListQrCode(params) {
 		return data.data
 	}
 	return Promise.reject(new Error(data.message))
-}
+}
+
+// 维修工单获取数据不对,用pc端的接口
+export async function getRepairList(params) {
+	const data = await get(Vue.prototype.apiUrl + `/eam/workorder/getWorkOrderList`, params)
+	console.log(data)
+	if (data.code == 0) {
+		return data.data
+	}
+	return Promise.reject(new Error(data.message))
+}
+

+ 2 - 2
pages/home/components/navigation.vue

@@ -84,8 +84,8 @@
 			},
 
 			async getCount() {
-				const res = await getTodoList({}, false)
-				this.workList[0].badge = res.count
+				// const res = await getTodoList({}, false)
+				// this.workList[0].badge = res.count
 				const messageCount = await getUnreadNotifyMessageCountAPI()
 				this.workList[2].badge = Number(messageCount)
 			}

+ 12 - 2
pages/home/home.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="">
+	<view class="ss">
 		<!-- 头 -->
 		<uni-nav-bar fixed="true" statusBar="true" right-icon="scan" title="首页" @clickLeft="back"
 			@clickRight="HandlScanCode"></uni-nav-bar>
@@ -434,14 +434,24 @@
 	}
 </script>
 
+<style>
+	page {
+		background-color: #f0f0f0;
+	}
+</style>
+
 <style lang="scss" scoped>
+	// /deep/.uni-page-wrapper{
+	// 	background-color: pink;
+	// }
+
 	/deep/.uni-table {
 		min-width: auto !important;
 		border-radius: 0;
 	}
 
 	page {
-		background-color: $page-bg;
+		background-color: #f0f0f0;
 	}
 
 	.container {

+ 1 - 0
pages/home/myTicket/myTicket.vue

@@ -522,6 +522,7 @@
 				}
 
 				isEnd = false
+				console.log(params);
 				getWorkOrderList(params)
 					.then(res => {
 						if (res.list?.length > 0 && params.type === this.tabList[this.activeIndex].workOrderType) {

+ 50 - 18
pages/home/wt/message/message.vue

@@ -67,6 +67,7 @@
 			</uni-list>
 
 		</view>
+		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
 
@@ -76,7 +77,7 @@
 		updateNotifyMessageReadByIdAPI
 	} from '@/api/wt/index.js'
 
-	let [page, isEnd] = [1, false]
+	// let [page, isEnd] = [1, false]
 	export default {
 
 		data() {
@@ -92,23 +93,38 @@
 				messageStatus: {
 					0: '已读',
 					1: '未读'
-				}
+				},
+				page: 1,
+				size: 10,
+				isEnd: false,
+				userInfo: ''
 			}
 		},
 		onReachBottom() {
-			if (isEnd) return
-			page++
+			console.log(this.isEnd, this.page);
 			this.getList()
 		},
 		onShow() {
-			page = 1
-			this.getList()
+			this.doSearch();
+		},
+		onLoad() {
+			this.userInfo = uni.getStorageSync("userInfo")
+			console.log(this.userInfo);
 		},
 		methods: {
+			doSearch() {
+				this.isEnd = false;
+				this.page = 1;
+				this.list = []
+				this.getList();
+			},
 			//已读操作
 			async handleRead(item) {
-				await updateNotifyMessageReadByIdAPI([item.id]);
-				this.getList()
+				const res = await updateNotifyMessageReadByIdAPI([item.id]);
+				if (res.code == 0) {
+					this.list.find(data => item.id === data.id).readStatus = 1
+				}
+				// this.getList()
 			},
 			toggleChecked() {
 				this.checkShow = !this.checkShow
@@ -124,23 +140,39 @@
 					this.list.filter(i => i.messageStatus == 1).map(i => i.id),
 					0
 				)
-				page = 1
+				this.page = 1
 				this.getList()
 			},
 			//获取我的消息列表数据
 			async getList() {
-				let userInfo = wx.getStorageSync("userInfo");
-				const params = {
-					pageNum: page,
-					size: 8,
-					userId: userInfo.userId
+
+				if (this.isEnd) {
+					this.$refs.uToast.show({
+						message: "暂无更多数据",
+						duration: 1000
+					})
+					return
+				}
+
+				uni.showLoading({
+					title: '加载中'
+				})
+
+				let params = {
+					pageNum: this.page,
+					size: this.size,
+					userId: this.userInfo.userId
 				}
+				console.log(params);
 				let res = await notifyMessagePageAPI(params)
-				if (params.page === 1) {
-					this.list = []
+				if (params.pageNum === 1) {
+					this.list = res.list
+				} else {
+					this.list.push(...res.list)
 				}
-				this.list.push(...res.list)
-				isEnd = this.list.length >= res.count
+				this.page += 1
+				this.isEnd = this.list.length >= res.count;
+
 			},
 			handleTo(e) {
 				console.log(e)

+ 1 - 1
pages/maintenance/detail/detail.vue

@@ -11,7 +11,7 @@
 						<text class="kd-content">{{ worksheetInfo.code }}</text>
 					</view>
 					<view class="kd-cell">
-						<text class="kd-label">计划名称</text>
+						<text class="kd-label">保养名称</text>
 						<text class="kd-content">{{ worksheetInfo.planName }}</text>
 					</view>
 					<view class="kd-cell">

+ 0 - 3
pages/salesServiceManagement/accessory/index.vue

@@ -165,9 +165,6 @@
 				tableList: [],
 				searchVal: ''
 			}
-		},
-		created() {
-
 		},
 		onShow() {
 			this.doSearch();

+ 19 - 19
pages/salesServiceManagement/demandList/index.vue

@@ -183,25 +183,25 @@
 						label: '创建时间:',
 						prop: 'createTime',
 					}],
-					[{
-						label: '审核人:',
-						prop: 'approvalUserName'
-					}, {
-						label: '状态:',
-						prop: 'demandStatus',
-						formatter: (row) => {
-							let cellValue = row.demandStatus;
-							return cellValue == 0 ?
-								'待审核' :
-								cellValue == 2 ?
-								'已拒绝' :
-								cellValue == 1 ?
-								'已通过' :
-								cellValue == 3 ?
-								'已撤回' :
-								'';
-						}
-					}],
+					// [{
+					// 	label: '审核人:',
+					// 	prop: 'approvalUserName'
+					// }, {
+					// 	label: '状态:',
+					// 	prop: 'demandStatus',
+					// 	formatter: (row) => {
+					// 		let cellValue = row.demandStatus;
+					// 		return cellValue == 0 ?
+					// 			'待审核' :
+					// 			cellValue == 2 ?
+					// 			'已拒绝' :
+					// 			cellValue == 1 ?
+					// 			'已通过' :
+					// 			cellValue == 3 ?
+					// 			'已撤回' :
+					// 			'';
+					// 	}
+					// }],
 					[{
 						label: '操作:',
 						prop: 'action',