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/allocation/allocation.vue |   40 +++++++++++++++++++++++++---------------
 1 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/minipro_standard/pages/allocation/allocation.vue b/minipro_standard/pages/allocation/allocation.vue
index 43ad353..86e5f83 100644
--- a/minipro_standard/pages/allocation/allocation.vue
+++ b/minipro_standard/pages/allocation/allocation.vue
@@ -60,7 +60,9 @@
 			<button class="fp_footer_submit" @click="submit">纭</button>
 		</view>
 		<!-- 閫夋嫨鏃ユ湡 -->
-		<u-calendar :show="timeShow" @close="timeShow = false" @confirm="timeConfirm"></u-calendar>
+		<!-- <u-calendar :show="timeShow" @close="timeShow = false" @confirm="timeConfirm"></u-calendar> -->
+		<l-calendar :lunar="false" v-model="timeShow" @change="timeConfirm" :isRange="true" activeBgColor="#305ED5"
+			rangeColor="#305ED5" rangeBgColor="rgba(48, 80, 213, 0.1)"></l-calendar>
 		<!-- 閫夋嫨璁惧 -->
 		<u-picker :show="show1" :columns="equipment" @confirm="confirm" @cancel="show1 = false" keyName="text"></u-picker>
 	</view>
@@ -105,22 +107,12 @@
 				this.form.equipmentId = val.value[0].id
 				this.form.equipmentName = val.value[0].text
 				this.personnelData = []
-				getFindAll({
-					deviceId: this.form.equipmentId
-				}).then(res => {
-					if (res.code === 200 && res.data && res.data.length !== 0) {
-						this.form.personnelId = []
-						let arr = []
-						res.data.forEach((item) => {
-							arr.push({ text: item.dmodel.name + '-' + item.umodel.name, id: item.userId })
-						})
-						this.personnelData = arr
-					}
-					this.show1 = false
-				})	
+				this.getUser()
 			},
 			timeConfirm(val) {
-				this.form.startTime = val[0]
+				// this.form.startTime = val[0]
+				this.listData.startDate = val.startDate
+				this.listData.endDate = val.endDate
 				this.timeShow = false
 			},
 			// 鎻愪氦鍒嗛厤
@@ -153,9 +145,27 @@
 							res.data.forEach((element) => {
 								arr.push({ text: element.code + '-' + element.name, id: element.id, checked: false })
 							})
+							this.form.equipmentId = arr[0].id
+							this.form.equipmentName = arr[0].text
+							this.getUser()
 							this.equipment.push(arr)
 						}
 					})
+			},
+			getUser() {
+				getFindAll({
+					deviceId: this.form.equipmentId
+				}).then(res => {
+					if (res.code === 200 && res.data && res.data.length !== 0) {
+						this.form.personnelId = []
+						let arr = []
+						res.data.forEach((item) => {
+							arr.push({ text: item.dmodel.name + '-' + item.umodel.name, id: item.userId })
+						})
+						this.personnelData = arr
+					}
+					this.show1 = false
+				})	
 			}
 		}
 	}

--
Gitblit v1.9.3