From ca2200ba53b236e8902b706c444375408c782f07 Mon Sep 17 00:00:00 2001
From: Mr.Zhang <710666463@qq.com>
Date: 星期一, 18 九月 2023 15:58:45 +0800
Subject: [PATCH] 09-18 小程序

---
 minipro_standard/pages_adjust/pages/spotCheck/spotCheck.vue |  175 +++++++++++++++++++++++-----------------------------------
 1 files changed, 70 insertions(+), 105 deletions(-)

diff --git a/minipro_standard/pages_adjust/pages/spotCheck/spotCheck.vue b/minipro_standard/pages_adjust/pages/spotCheck/spotCheck.vue
index 1720d0b..9646e39 100644
--- a/minipro_standard/pages_adjust/pages/spotCheck/spotCheck.vue
+++ b/minipro_standard/pages_adjust/pages/spotCheck/spotCheck.vue
@@ -25,7 +25,7 @@
 						</div>
 					</div>
 					<div class="tl_list_item" v-if="item.type === ''">
-						<div class="tl_list_item_label">灞炴�у��</div>
+						<div class="tl_list_item_label">灞炴�у��1</div>
 						<div class="tl_list_item_go">
 							<input type="text" v-model="item.num" placeholder="璇疯緭鍏�" />
 						</div>
@@ -34,7 +34,8 @@
 						<div class="tl_list_item_label">灞炴�у��</div>
 						<div class="tl_list_item_go">
 							<u-radio-group v-model="item.num" placement="row" @change="radioSelect">
-								<u-radio v-for="(item1, i) in item.data" :key="i" activeColor="#4275FC" :name="item1" :label="item1">
+								<u-radio v-for="(item1, i) in item.data" :key="i" activeColor="#4275FC" :name="item1"
+									:label="item1">
 								</u-radio>
 							</u-radio-group>
 						</div>
@@ -42,7 +43,7 @@
 					<div class="tl_list_item" v-else-if="item.type === 1">
 						<div class="tl_list_item_label">灞炴�у��</div>
 						<div class="tl_list_item_go">
-							<u-checkbox-group v-model="item.num" placement="row" >
+							<u-checkbox-group v-model="item.num" placement="row">
 								<u-checkbox v-for="(item1, i) in item.data" :key="i" :label="item1" :name="item1">
 								</u-checkbox>
 							</u-checkbox-group>
@@ -53,15 +54,13 @@
 						<div class="tl_list_item_go">
 							<input type="text" v-model="item.num" :placeholder="item.tips" />
 						</div>
-					</div><div class="tl_list_item" v-else-if="item.type === 3">
+					</div>
+					<div class="tl_list_item" v-else-if="item.type === 3">
 						<div class="tl_list_item_label">灞炴�у��</div>
-						<div class="tl_list_item_go">
-							<u--input v-model="item.num" :placeholder="item.tips"
-							    placeholder="璇疯緭鍏ュ唴瀹�"
-									type="digit"
-							    border="surround"
-							  ></u--input>
-							<input   />
+						<div class="tl_list_item_go">
+							<input v-model="item.num" type="digit" :placeholder="item.tips" />
+							<!-- <u--input v-model="item.num" :placeholder="item.tips" type="digit"
+								border="surround"></u--input> -->
 						</div>
 					</div>
 					<div class="tl_list_item" @click="openTimer(index)" v-else-if="item.type === 4">
@@ -74,64 +73,6 @@
 				</div>
 			</u-swipe-action-item>
 		</u-swipe-action>
-		<!-- <van-swipe-cell v-for="(item, index) in formList" :key="index">
-			<div class="tl_list">
-				<div class="tl_list_item" @click="open(index)">
-					<div class="tl_list_item_label">鐢熶骇灞炴��</div>
-					<div class="tl_list_item_go">
-						<span
-							:style="item.attributeName ? 'color: #000;' : ''">{{ item.attributeName ? item.attributeName : '璇烽�夋嫨'}}</span>
-						<van-icon name="arrow" color="#999999" />
-					</div>
-				</div>
-				<div class="tl_list_item" v-if="item.type === ''">
-					<div class="tl_list_item_label">灞炴�у��</div>
-					<div class="tl_list_item_go">
-						<input type="text" v-model="item.num" placeholder="璇疯緭鍏�" />
-					</div>
-				</div>
-				<div class="tl_list_item" v-else-if="item.type === 0">
-					<div class="tl_list_item_label">灞炴�у��</div>
-					<div class="tl_list_item_go">
-						<u-radio-group v-model="item.num" placement="row">
-							<u-radio v-for="(item1, i) in item.data" :key="i" activeColor="#4275FC" :label="item1">
-							</u-radio>
-						</u-radio-group>
-					</div>
-				</div>
-				<div class="tl_list_item" v-else-if="item.type === 1">
-					<div class="tl_list_item_label">灞炴�у��</div>
-					<div class="tl_list_item_go">
-						<u-checkbox-group v-model="item.num" placement="row">
-							<u-checkbox v-for="(item1, i) in item.data" :key="i" :label="item1" :name="item1">
-							</u-checkbox>
-						</u-checkbox-group>
-					</div>
-				</div>
-				<div class="tl_list_item" v-else-if="item.type === 2">
-					<div class="tl_list_item_label">灞炴�у��</div>
-					<div class="tl_list_item_go">
-						<input type="text" v-model="item.num" :placeholder="item.tips" />
-					</div>
-				</div>
-				<div class="tl_list_item" v-else-if="item.type === 3">
-					<div class="tl_list_item_label">灞炴�у��</div>
-					<div class="tl_list_item_go">
-						<input type="text" v-model="item.num" :placeholder="item.tips" />
-					</div>
-				</div>
-				<div class="tl_list_item" @click="openTimer(index)" v-else-if="item.type === 4">
-					<div class="tl_list_item_label">灞炴�у��</div>
-					<div class="tl_list_item_go">
-						<span :style="item.num ? 'color: #000;' : ''">{{item.num ? item.num : item.tips}}</span>
-						<u-icon name="arrow" color="#999999" />
-					</div>
-				</div>
-			</div>
-			<template #right>
-				<van-button square style="height: 100%;" type="danger" text="鍒犻櫎" @click="dele(index)" />
-			</template>
-		</van-swipe-cell> -->
 
 		<div class="tl_zw"></div>
 		<div class="tl_footer">
@@ -139,6 +80,8 @@
 		</div>
 		<u-picker :show="show" :columns="[gzqjData]" title="閫夋嫨鐢熶骇灞炴��" @confirm="gzqjConfirm" @cancel="show=false">
 		</u-picker>
+		<u-datetime-picker :show="timer" v-model="value1" @cancel="timer=false" @confirm="onConfirm" mode="datetime">
+		</u-datetime-picker>
 	</view>
 </template>
 
@@ -159,9 +102,14 @@
 		data() {
 			return {
 				options1: [{
-					text: '鍒犻櫎'
+					text: '鍒犻櫎',
+					style: {
+						backgroundColor: '#f00',
+					}
 				}],
+				value1: Number(new Date()),
 				show: false,
+				timer: false,
 				index: '',
 				workOrderId: '',
 				info: {},
@@ -223,6 +171,11 @@
 				this.index = index
 				this.show = true
 			},
+			// 鎵撳紑鏃ユ湡鎻掍欢
+			openTimer(index) {
+				this.index = index
+				this.timer = true
+			},
 			gzqjConfirm({
 				value
 			}) {
@@ -270,35 +223,44 @@
 					return
 				}
 				this.formList.splice(index, 1)
-			},
-			radioSelect(v) {
-				console.log(v);
+			},
+			onConfirm(value) {
+				console.log(value);
+				this.formList.forEach((item, index) => {
+					if (this.index === index) {
+						item.num = setTimeO(new Date(value.value), '-')
+					}
+				})
+				this.timer = false;
+			},
+			radioSelect(v) {
+				console.log(v);
 			},
 			submit() {
-				let isOpen = true
-				let attrList = []
-				
-				this.formList.forEach(item => {
+				let isOpen = true
+				let attrList = []
+
+				this.formList.forEach(item => {
 					console.log('-------', item);
-					if (item.type === 1) {
+					if (item.type === 1) {
 						if (item.attribute === '' || item.num.length === 0) {
-							isOpen = false
+							isOpen = false
 							return
-						} else {
-							attrList.push({
-								val: item.num.join(' '),
-								attrId: item.attribute
-							})
+						} else {
+							attrList.push({
+								val: item.num.join(' '),
+								attrId: item.attribute
+							})
 						}
-					} else {
+					} else {
 						if (item.attribute === '' || item.num === '') {
-							isOpen = false
+							isOpen = false
 							return
-						} else {
-							attrList.push({
-								val: item.num,
-								attrId: item.attribute
-							})
+						} else {
+							attrList.push({
+								val: item.num,
+								attrId: item.attribute
+							})
 						}
 					}
 				})
@@ -306,13 +268,13 @@
 					uni.$u.toast('璇峰皢淇℃伅濉啓瀹屾暣')
 					return
 				}
-				
+
 				createDJ({
 					attrList: attrList,
 					id: this.workOrderId
 				}).then(res => {
-					if (res.code === 200) {
-						uni.$emit('spotAdd')
+					if (res.code === 200) {
+						uni.$emit('spotAdd')
 						uni.$u.toast('鍒涘缓鎴愬姛')
 						setTimeout(() => {
 							uni.navigateBack()
@@ -379,7 +341,7 @@
 			flex-direction: column;
 			background: white;
 			padding: 0 30rpx;
-			margin-bottom: 20rpx;
+			// margin-bottom: 20rpx;
 
 			.tl_list_item {
 				min-height: 98rpx;
@@ -394,7 +356,7 @@
 
 				.tl_list_item_label {
 					font-size: 30rpx;
-					font-weight: 400;
+					font-weight: 400;
 					flex-shrink: 1;
 					color: #222222;
 				}
@@ -402,8 +364,9 @@
 				.tl_list_item_go {
 					display: flex;
 					align-items: center;
-					flex: 1;
+					flex: 1;
 					justify-content: flex-end;
+
 					input {
 						text-align: right;
 						width: 450rpx;
@@ -454,13 +417,15 @@
 				justify-content: center;
 			}
 		}
-	}
-	/deep/ .u-checkbox-group {
-		flex-wrap: wrap;
-		max-width: 100%;
-	}
-	/deep/ .u-radio-group {
-		flex-wrap: wrap;
-		max-width: 100%;
+	}
+
+	/deep/ .u-checkbox-group {
+		flex-wrap: wrap;
+		max-width: 100%;
+	}
+
+	/deep/ .u-radio-group {
+		flex-wrap: wrap;
+		max-width: 100%;
 	}
 </style>

--
Gitblit v1.9.3