From ccf28d1fed1aa2e5437dbe64b5133ba1cbde6ec7 Mon Sep 17 00:00:00 2001
From: renkang <8417338+k94314517@user.noreply.gitee.com>
Date: 星期五, 03 一月 2025 15:30:52 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 h5/pages/operation/device.vue |   58 ++++++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 48 insertions(+), 10 deletions(-)

diff --git a/h5/pages/operation/device.vue b/h5/pages/operation/device.vue
index 80b70b1..414be7b 100644
--- a/h5/pages/operation/device.vue
+++ b/h5/pages/operation/device.vue
@@ -5,8 +5,8 @@
 				<view class="la"><text class="red">*</text>閫夋嫨璁惧</view>
 				<view class="line">
 					<view class="sel_wrap" @click="showModal = true">
-						<view class="left" :class="param.deviceName ? '' : 'placeholder9'">
-							{{ param.deviceName ? param.deviceName : '璇烽�夋嫨璁惧' }}
+						<view class="left" :class="(param.deviceName || param.deviceCode) ? '' : 'placeholder9'">
+							{{ (param.deviceName || param.deviceCode) ? param.deviceName ? `[${param.deviceCode}] ` + param.deviceName : `[${param.deviceCode}]` : '璇烽�夋嫨璁惧' }}
 						</view>
 						<u-icon name="arrow-right" color="#999999" size="17"></u-icon>
 					</view>
@@ -83,7 +83,8 @@
 	import {
 		uploadUrl,
 		ywDevicePost,
-		ywDeviceCreate
+		ywDeviceCreate,
+		getPointRecordByCode
 	} from '@/api'
 	import dayjs from 'dayjs';
 	import {
@@ -118,14 +119,37 @@
 				} = this
 
 				if (!param.deviceId) return this.showToast('璇峰厛閫夋嫨瑕佺淮鎶ょ殑璁惧')
+				this.handleP()
+			},
+			handleP() {
+				const {
+					param, 
+					fileList
+				} = this
 				ywDeviceCreate({
 					...param,
 					userId: uni.getStorageSync('userInfo').id,
 					dealDate: dayjs().format('YYYY-MM-DD HH:mm:ss'),
 					multifileList: fileList
 				}).then(res => {
-					this.showToast('鎻愪氦鎴愬姛')
-					uni.navigateBack()
+					if (param.status != 0) {
+						uni.showModal({
+							title: '娓╅Θ鎻愮ず',
+							content: '璁惧杩愮淮缁撴灉寮傚父锛屾槸鍚﹀墠寰�鎻愪氦宸ュ崟?',
+							success: function(res) {
+								if (res.confirm) {
+									uni.redirectTo({
+										url: '/pages/workOrder/edit'
+									})
+								} else if (res.cancel) {
+									uni.navigateBack()
+								}
+							}
+						});
+					}else{
+						this.showToast('鎻愪氦鎴愬姛')
+						uni.navigateBack()
+					}
 				})
 			},
 			getDevice() {
@@ -145,6 +169,7 @@
 				} = this
 				if (!activeDevice.id) return this.showToast('璇峰厛閫夋嫨璁惧')
 				this.$set(this.param, 'deviceId', activeDevice.id)
+				this.$set(this.param, 'deviceCode', activeDevice.code)
 				this.$set(this.param, 'deviceName', activeDevice.name)
 				this.showModal = false
 			},
@@ -261,8 +286,19 @@
 							},
 							(decodeText, decodeResult) => {
 								if (decodeText) { //杩欓噷decodeText灏辨槸閫氳繃鎵弿浜岀淮鐮佸緱鍒扮殑鍐呭
-									this.action(decodeText) //瀵逛簩缁寸爜閫昏緫澶勭悊
-									this.stopScan(); //鍏抽棴鎵爜鍔熻兘
+									this.$set(this.param, 'deviceCode', decodeText)
+									this.stopScan(); //鍏抽棴鎵爜鍔熻兘
+									getPointRecordByCode({
+										// taskId: this.id,
+										pointCode: decodeText
+									}).then(ress => {
+										if (ress.data) {
+											console.log('ress', ress.data);
+										} else {
+											this.showToast('鏈尮閰嶅埌宸℃鐐�,璇烽噸鏂版壂鎻�')
+										}
+									})
+									
 								}
 							},
 							(err) => {
@@ -408,11 +444,12 @@
 	}
 
 	.sub_btn {
-		position: fixed;
-		bottom: 68rpx;
-		left: 40rpx;
+		// position: fixed;
+		// bottom: 68rpx;
+		// left: 40rpx;
 		width: 670rpx;
 		height: 88rpx;
+		margin-top: 80rpx;
 		background: $primaryColor;
 		box-shadow: 0rpx 8rpx 20rpx 0rpx rgba(0, 104, 255, 0.3);
 		border-radius: 44rpx;
@@ -457,6 +494,7 @@
 
 		.modal_list {
 			height: calc(100% - 360rpx);
+			margin-bottom: -20rpx;
 
 			.item {
 				display: flex;

--
Gitblit v1.9.3