Browse Source

报修系统完善

xiaoxin 2 years ago
parent
commit
98582756a3

+ 2 - 2
pages.json

@@ -210,7 +210,7 @@
 				"path": "offer/offer",
 				"style": {
 					"navigationBarTitleText": "报价",
-					"disableScroll": true,
+					// "disableScroll": true,
 					"navigationBarBackgroundColor": "#6FB6B8",
 					"navigationBarTextStyle": "white",
 					"backgroundColorTop": "#6FB6B8",
@@ -230,7 +230,7 @@
 				"path": "repairRecord/repairRecord",
 				"style": {
 					"navigationBarTitleText": "维修记录",
-					"disableScroll": true,
+					// "disableScroll": true,
 					"navigationBarBackgroundColor": "#6FB6B8",
 					"navigationBarTextStyle": "white",
 					"backgroundColorTop": "#6FB6B8",

+ 6 - 6
pagesRepairs/addressBook/addressBook.vue

@@ -7,10 +7,10 @@
 			<input type="text" v-model="keyWord" placeholder="请输入搜索内容" />
 		</view>
 
-		<view class="title" v-if="list.length">外部维修成员({{ list.length }})</view>
+		<view class="title" v-if="list2.length">外部维修成员({{ list2.length }})</view>
 
 		<!-- 每一个外部维修成员区域 -->
-		<view class="box" v-for="item in list" :key="item.id" @click="handleEdit(item)">
+		<view class="box" v-for="item in list2" :key="item.id" @click="handleEdit(item)">
 			<img src="../../static/images/repairsImg/photo.png" />
 			<view class="item_info">
 				<view class="info_msg">
@@ -23,9 +23,9 @@
 			<view class="item_type color_type3" v-if="item.state === 2">停止接单</view>
 		</view>
 
-		<view class="title" v-if="list2.length">内部维修成员({{ list2.length }})</view>
+		<view class="title" v-if="list.length">内部维修成员({{ list.length }})</view>
 		<!-- 每一个内部维修成员区域 -->
-		<view class="box" v-for="item in list2" :key="item.id" @click="handleEdit(item)">
+		<view class="box" v-for="item in list" :key="item.id" @click="handleEdit(item)">
 			<img src="../../static/images/repairsImg/photo.png" />
 			<view class="item_info">
 				<view class="info_msg">
@@ -56,9 +56,9 @@ export default {
 			schoolId: '',
 			// 用户id
 			userId: '',
-			// 外部维修成员数组
-			list: [],
 			// 内部维修成员数组
+			list: [],
+			// 外部维修成员数组
 			list2: []
 		}
 	},

+ 1 - 1
pagesRepairs/help/help.vue

@@ -109,11 +109,11 @@ export default {
 		})
 	},
 	onLoad(options) {
+		this.recordId = options.id
 		if (options.type) {
 			this.type = options.type
 			this.getHelpData()
 		}
-		this.recordId = options.id
 		uni.$on('addCheckList', this.addCheckList)
 	},
 	methods: {

+ 3 - 3
pagesRepairs/home/home.vue

@@ -214,12 +214,12 @@ export default {
 		if (this.btns.includes('表格编辑')) {
 			this.getWatchClass()
 		}
-		if (this.btns.includes('首页分段器')) {
+		if (this.btns.includes('表格编辑')) {
 			this.getTeamCount()
 		} else {
 			this.getCount()
 		}
-		// 获取表数据
+		// 获取表数据
 		this.getWatchData()
 	},
 	methods: {
@@ -667,4 +667,4 @@ export default {
 		}
 	}
 }
-</style>
+</style>

+ 38 - 15
pagesRepairs/management/management.vue

@@ -88,9 +88,10 @@
 						<text>{{ item.reportTime }}</text>
 					</view>
 					<view class="time_type" v-if="item.state === '待接单'">待接单</view>
+					<view class="time_type" v-if="item.state === '待处理'">待处理</view>
 					<view class="time_type color_type" v-if="item.state === '维修中'">维修中</view>
-					<view class="time_type color_type" v-if="item.state === '协作审核'">协作审核</view>
-					<view class="time_type color_type" v-if="item.state === '转单审核'">转单审核</view>
+					<view class="time_type color_type" v-if="item.state === '协作审核'">协作审核</view>
+					<view class="time_type color_type" v-if="item.state === '转单审核'">转单审核</view>
 					<view class="time_type color_type2" v-if="item.state === '待审核'">待审核</view>
 					<view class="time_type color_type3" v-if="item.state === '已完成'">已完成</view>
 					<view class="time_type" v-if="item.state === '待确认'">待确认</view>
@@ -190,7 +191,13 @@
 					<!-- 延时按钮 -->
 					<view class="btn_box type" v-if="(item.state === '待接单' || item.state === '维修中') && btns.includes('延时')" @click.stop="handleDelay(item)">延时</view>
 					<!-- 接单按钮 -->
-					<!-- <view class="btn_box type" v-if="item.state === '待接单' && btns.includes('接单')" @click.stop="handleOrderReceiving(item)">接单</view> -->
+					<view
+						class="btn_box type"
+						v-if="item.state === '待接单' && btns.includes('接单') && (!btns.includes('首页分段器') || current === 1)"
+						@click.stop="handleOrderReceiving(item)"
+					>
+						接单
+					</view>
 					<!-- 转单按钮 -->
 					<view class="btn_box type2" v-if="item.state === '待接单' && btns.includes('转单')" @click.stop="handleTransferOrder(item)">转单</view>
 					<!-- 派单按钮 -->
@@ -202,9 +209,9 @@
 					<!-- 审核按钮 -->
 					<view class="btn_box type" v-if="(item.state === '协作审核' || item.state === '转单审核') && btns.includes('审核')" @click.stop="handleAudit(item)">审核</view>
 					<!-- 改价按钮 -->
-					<view class="btn_box type" v-if="item.state === '待确认'" @click.stop="handleChangeOffer(item)">改价</view>
+					<view class="btn_box type" v-if="item.state === '待处理'" @click.stop="handleChangeOffer(item)">改价</view>
 					<!-- 留言按钮 -->
-					<view class="btn_box type2" v-if="item.state === '待确认'" @click.stop="handleLeaveWords">留言</view>
+					<view class="btn_box type2" v-if="item.state === '待处理'" @click.stop="handleLeaveWords(item)">留言</view>
 				</view>
 			</view>
 
@@ -466,14 +473,26 @@ export default {
 			}
 		},
 		// 留言弹窗确定按钮回调
-		handleLeaveWordsConfirm() {
+		async handleLeaveWordsConfirm() {
 			if (this.leaveWords) {
-				uni.showToast({
-					title: '留言成功',
-					icon: 'success',
-					mask: true
+				const res = await this.$myRequest_repairs({
+					url: '/repairRecord/mobileReply',
+					method: 'post',
+					data: {
+						recordId: this.orderId,
+						userId: this.userId,
+						content: this.leaveWords
+					}
 				})
-				this.$refs.popup_leaveWords.close()
+				// console.log(res)
+				if (res.code === '200') {
+					uni.showToast({
+						title: '留言成功',
+						icon: 'success',
+						mask: true
+					})
+					this.$refs.popup_leaveWords.close()
+				}
 			} else {
 				uni.showToast({
 					title: '请输入留言内容',
@@ -603,7 +622,6 @@ export default {
 		onClickItem(e) {
 			if (this.current != e.currentIndex) {
 				this.current = e.currentIndex
-				console.log(this.current)
 				this.state = 1
 				this.dataList = []
 				this.currentPage = 1
@@ -619,7 +637,8 @@ export default {
 			}
 		},
 		// 留言按钮回调
-		handleLeaveWords() {
+		handleLeaveWords(item) {
+			this.orderId = item.id
 			this.$refs.popup_leaveWords.open('center')
 		},
 		// 延时按钮回调
@@ -820,9 +839,9 @@ export default {
 				justify-content: space-between;
 				align-items: center;
 				padding: 0 30rpx;
-				height: 79rpx;
 
 				.time_msg {
+					width: 500rpx;
 					color: #808080;
 
 					text {
@@ -831,8 +850,12 @@ export default {
 				}
 
 				.time_type {
+					flex: 1;
+					box-sizing: border-box;
+					padding-left: 10rpx;
 					font-size: 32rpx;
 					color: #ff5733;
+					line-height: 60rpx;
 				}
 
 				.color_type {
@@ -851,7 +874,6 @@ export default {
 
 			.item_box {
 				display: flex;
-				align-items: center;
 				padding: 0 30rpx;
 				line-height: 60rpx;
 
@@ -861,6 +883,7 @@ export default {
 				}
 
 				.box_value {
+					flex: 1;
 					display: flex;
 					align-items: center;
 					margin-right: auto;

+ 3 - 3
pagesRepairs/myRepairs/myRepairs.vue

@@ -24,8 +24,8 @@
 					</view>
 					<view class="time_type" v-if="item.state === '待接单'">待接单</view>
 					<view class="time_type color_type" v-if="item.state === '维修中'">维修中</view>
-					<view class="time_type color_type" v-if="item.state === '转单审核'">转单审核</view>
-					<view class="time_type color_type" v-if="item.state === '协作审核'">协作审核</view>
+					<view class="time_type color_type" v-if="item.state === '转单审核'">转单审核</view>
+					<view class="time_type color_type" v-if="item.state === '协作审核'">协作审核</view>
 					<view class="time_type" v-if="item.state === '待确认'">待确认</view>
 					<view class="time_type color_type2" v-if="item.state === '已完成'">已完成</view>
 					<view class="time_type" v-if="item.state === '已取消'">已取消</view>
@@ -118,7 +118,7 @@
 				<view class="item_btn" v-if="item.state !== '已取消' && item.state !== '已关单'">
 					<view
 						class="btn_box type"
-						v-if="item.state === '待接单' || item.state === '维修中' || item.state === '转单审核' || item.state === '协作审核'"
+						v-if="item.state === '待接单' || item.state === '维修中' || item.state === '转单审核' || item.state === '协作审核'"
 						@click.stop="handleExpedite(item.id)"
 					>
 						催单

+ 14 - 10
pagesRepairs/offer/offer.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="container">
+	<scroll-view class="container" :scroll-y="isScroll">
 		<view class="title">关联耗材</view>
 
 		<!-- 每一个耗材盒子区域 -->
@@ -23,6 +23,7 @@
 						v-model="item.price"
 						placeholder="请输入耗材单价"
 						placeholderStyle="font-size:16px"
+						@focus="handleFocus"
 						@blur="handleChangePrice($event, item)"
 					></uni-easyinput>
 				</view>
@@ -56,7 +57,7 @@
 		</view>
 
 		<view class="btn" @click="handleSub">确认提交</view>
-	</view>
+	</scroll-view>
 </template>
 
 <script>
@@ -70,7 +71,9 @@ export default {
 			// 耗材列表
 			goodList: [],
 			// 订单信息
-			info: {}
+			info: {},
+			// 是否允许页面滚动
+			isScroll: true
 		}
 	},
 	computed: {
@@ -88,13 +91,11 @@ export default {
 		}
 	},
 	onLoad(options) {
-		// console.log(options)
 		this.info = JSON.parse(decodeURIComponent(options.info))
-		// console.log(this.info)
-		this.worker = this.info.maintenancerName
-		this.phone = this.info.maintenancerPhone
+		this.worker = this.info.maintenancerName || ''
+		this.phone = this.info.maintenancerPhone || ''
 		if (options.type) {
-			this.goodList = this.info.goodsList
+			this.goodList = this.info.goodsList || []
 			uni.setNavigationBarTitle({
 				title: '改价'
 			})
@@ -108,6 +109,7 @@ export default {
 	methods: {
 		// 单价输入框输入回调
 		handleChangePrice(e, item) {
+			this.isScroll = true
 			// 验证输入单价格式 只能是数字,小数点最多两位
 			const reg = /(^[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/
 
@@ -119,6 +121,10 @@ export default {
 				item.price = 0
 			}
 		},
+		// 价格输入框聚焦回调
+		handleFocus() {
+			this.isScroll = false
+		},
 		// 确认提交按钮回调
 		handleSub() {
 			if (!this.goodList.length) {
@@ -207,8 +213,6 @@ export default {
 	box-sizing: border-box;
 	padding: 0 30rpx;
 	width: 100vw;
-	height: 100vh;
-	overflow-y: auto;
 
 	.title {
 		height: 109rpx;

+ 1 - 0
pagesRepairs/pending/pending.vue

@@ -410,6 +410,7 @@ export default {
 				}
 
 				.box_value {
+					flex: 1;
 					max-width: calc(100% - 160rpx);
 					display: flex;
 					align-items: center;

+ 4 - 3
pagesRepairs/repairDetails/repairDetails.vue

@@ -17,8 +17,8 @@
 			<view class="time_type color_type2" v-if="detailInfo.state === '已完成'">已完成</view>
 			<view class="time_type" v-if="detailInfo.state === '已取消'">已取消</view>
 			<view class="time_type color_type3" v-if="detailInfo.state === '已关单'">已关单</view>
-			<view class="time_type color_type" v-if="detailInfo.state === '转单审核'">转单审核</view>
-			<view class="time_type color_type" v-if="detailInfo.state === '协作审核'">协作审核</view>
+			<view class="time_type color_type" v-if="detailInfo.state === '转单审核'">转单审核</view>
+			<view class="time_type color_type" v-if="detailInfo.state === '协作审核'">协作审核</view>
 		</view>
 
 		<view class="box">
@@ -255,7 +255,7 @@ export default {
 
 	.box {
 		display: flex;
-		height: 60rpx;
+		line-height: 60rpx;
 		font-size: 28rpx;
 
 		.box_key {
@@ -263,6 +263,7 @@ export default {
 		}
 
 		.box_value {
+			flex: 1;
 			display: flex;
 
 			img {

+ 12 - 6
pagesRepairs/repairRecord/repairRecord.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="container">
+	<scroll-view class="container" :scroll-y="isScroll">
 		<view class="title">维修日期</view>
 		<uni-datetime-picker disabled placeholder="请选择日期" type="date" v-model="repairDate" />
 		<view class="title">维修内容</view>
@@ -51,6 +51,7 @@
 						v-model="item.price"
 						placeholder="请输入耗材单价"
 						placeholderStyle="font-size:16px"
+						@focus="handleFocus"
 						@blur="handleChangePrice($event, item)"
 					></uni-easyinput>
 				</view>
@@ -111,7 +112,7 @@
 			canvas-id="zipCanvas"
 		></canvas>
 		<!--画布结束-->
-	</view>
+	</scroll-view>
 </template>
 
 <script>
@@ -159,7 +160,9 @@ export default {
 			// 定时器标识
 			timer: null,
 			// 订单详情信息
-			info: {}
+			info: {},
+			// 是否允许页面滚动
+			isScroll: true
 		}
 	},
 	computed: {
@@ -193,8 +196,9 @@ export default {
 			let today = new Date()
 			this.repairDate = `${today.getFullYear()}-${(today.getMonth() + 1).toString().padStart(2, 0)}-${today.getDate().toString().padStart(2, 0)}`
 		},
-		// 单价输入框输入回调
+		// 单价输入框输入回调 (失去焦点)
 		handleChangePrice(e, item) {
+			this.isScroll = true
 			// 验证输入单价格式 只能是数字,小数点最多两位
 			const reg = /(^[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/
 
@@ -206,6 +210,10 @@ export default {
 				item.price = 0
 			}
 		},
+		// 价格输入框聚焦回调
+		handleFocus() {
+			this.isScroll = false
+		},
 		// 全局自定义事件
 		addConsumable(e) {
 			// console.log(e)
@@ -471,8 +479,6 @@ export default {
 	box-sizing: border-box;
 	padding: 0 30rpx;
 	width: 100%;
-	height: 100vh;
-	overflow-y: auto;
 
 	.title {
 		display: flex;

+ 1 - 1
pagesRepairs/transferOrder/transferOrder.vue

@@ -82,11 +82,11 @@ export default {
 		})
 	},
 	onLoad(options) {
+		this.recordId = options.id
 		if (options.type) {
 			this.type = options.type
 			this.getData()
 		}
-		this.recordId = options.id
 	},
 	methods: {
 		// 获取转单审核详细数据