From cdb09e07c477931c8d7f7139945e66fd5fc01cce Mon Sep 17 00:00:00 2001
From: yangan <yangan0921@163.com>
Date: 星期一, 27 五月 2024 09:02:40 +0800
Subject: [PATCH] feat:客户创建日计划

---
 pages/loadUnload-page/selectTarget/selectTarget.vue |  150 +++++++++++++++++++++++++++++--------------------
 1 files changed, 89 insertions(+), 61 deletions(-)

diff --git a/pages/loadUnload-page/selectTarget/selectTarget.vue b/pages/loadUnload-page/selectTarget/selectTarget.vue
index f21f595..2e35e55 100644
--- a/pages/loadUnload-page/selectTarget/selectTarget.vue
+++ b/pages/loadUnload-page/selectTarget/selectTarget.vue
@@ -5,7 +5,7 @@
 			:borderBottom="false"
 			:model="dataForm"
 			ref="uForm">
-			<u-form-item label="鐓ゅ満"
+			<u-form-item label="浠撳簱"
 				prop="firstClass"
 				:borderBottom="false">
 				<u-cell-group>
@@ -17,7 +17,7 @@
 							size="30"></u-icon></u-cell>
 				</u-cell-group>
 			</u-form-item>
-			<u-form-item label="鐓や粨"
+			<!-- <u-form-item label="鐓や粨"
 				prop="secondClass"
 				:borderBottom="false">
 				<u-cell-group>
@@ -44,7 +44,7 @@
 						</view>
 					</u-cell>
 				</u-cell-group>
-			</u-form-item>
+			</u-form-item> -->
 		</u--form>
 		<view class="coal-name"
 			v-show="coalList.length!==0">
@@ -63,7 +63,7 @@
 		<view style="margin-top: 20rpx;">
 			<u-button type="primary"
 				shape="circle"
-				text="鎻愪氦"
+				text="鏌ョ湅璇ヤ粨搴撴敹鍙戝崟"
 				@click.stop="formHandle"></u-button>
 		</view>
 		<!-- 鐓ゅ満 -->
@@ -74,19 +74,19 @@
 			@close='firstClassClose'
 			@select="firstClassSelectClick"></u-action-sheet>
 		<!-- 鐓や粨 -->
-		<u-action-sheet :actions="secondClassActionsList"
+		<!-- <u-action-sheet :actions="secondClassActionsList"
 			:show="secondClassShow"
 			cancelText='鍙栨秷'
 			:closeOnClickOverlay='true'
 			@close='secondClassClose'
-			@select="secondClassSelectClick"></u-action-sheet>
+			@select="secondClassSelectClick"></u-action-sheet> -->
 		<!--纾呭崟绫诲瀷 -->
-		<u-action-sheet :actions="orderTypeList"
+		<!-- <u-action-sheet :actions="orderTypeList"
 			:show="orderTypeShow"
 			cancelText='鍙栨秷'
 			:closeOnClickOverlay='true'
 			@close='orderTypeClose'
-			@select="orderTypeSelectClick"></u-action-sheet>
+			@select="orderTypeSelectClick"></u-action-sheet> -->
 	</view>
 </template>
 
@@ -97,7 +97,8 @@
 				dataForm: {
 					firstClass: "",
 					secondClass: "",
-					orderType: ''
+					orderType: '',
+					bunkerId:""
 				},
 				index: '',
 				// 鐓ゅ満鎿嶄綔鑿滃崟
@@ -138,10 +139,20 @@
 				uni.showLoading({
 					title: "鍔犺浇涓�"
 				})
-				this.$reqGet('getDeptIdFiled').then(res => {
+				this.$reqGet('getWarehouseList').then(res => {
 					uni.hideLoading()
 					if (res.code === 0) {
-						this.firstClassActionsList = res.data
+						this.firstClassActionsList = res.data;
+						if(res.data.length === 1){
+							this.dataForm.bunkerId = res.data[0].id;
+							this.dataForm.firstClass = res.data[0].name;
+							setTimeout(()=>{
+								uni.navigateTo({
+						   url: `/pages/loadUnload-page/loadUnload-detail/loadUnload-detail?bunkerId=${this.dataForm.bunkerId}`
+					})
+							},300)
+					
+						}
 					} else {
 						this.$u.toast('鍔犺浇澶辫触')
 					}
@@ -156,64 +167,81 @@
 				this.firstClassShow = false
 			},
 			firstClassSelectClick(val) {
-				this.dataForm.firstClass = val.name
-				this.getFiledIdCoalBunker(val.id)
+				this.dataForm.firstClass = val.name;
+				this.dataForm.bunkerId= val.id;
 				this.filedId = val.id
 			},
 			// 鑾峰彇鐓や粨
-			getFiledIdCoalBunker(filedId) {
-				this.$reqGet('getFiledIdCoalBunker', { filedId, }).then(res => {
-					this.secondClassActionsList = res.data
-				})
-			},
+			// getFiledIdCoalBunker(filedId) {
+			// 	this.$reqGet('getFiledIdCoalBunker', { filedId, }).then(res => {
+			// 		this.secondClassActionsList = res.data
+			// 	})
+			// },
 			//鐓や粨鑿滃崟
-			secondClassSelect() {
-				this.secondClassShow = true
-			},
-			secondClassClose() {
-				this.secondClassShow = false
-			},
-			secondClassSelectClick(val) {
-				this.dataForm.secondClass = val.name
-				this.coalList = this.secondClassActionsList.find(v => v.id === val.id).coalNames.split(',').map(v => {
-					return {
-						name: v,
-						id: Math.floor(Math.random() * 100) + 1,
-						checked: false
-					}
-				})
-			},
-			orderTypeSelect() {
-				this.orderTypeShow = true
-			},
-			orderTypeClose() {
-				this.orderTypeShow = false
-			},
-			orderTypeSelectClick(val) {
-				this.orderTypeShow = false
-				this.dataForm.orderType = val.name
-				this.isOrderType = ''
-			},
-			cleanOrderType() {
-				this.dataForm.orderType = null
-				this.isOrderType = '璇烽�夋嫨'
-				this.orderTypeShow = false
-			},
-			checkboxChange(e) {
-				this.selectedCoal = e
-			},
+			// secondClassSelect() {
+			// 	this.secondClassShow = true
+			// },
+			// secondClassClose() {
+			// 	this.secondClassShow = false
+			// },
+			// secondClassSelectClick(val) {
+			// 	this.dataForm.secondClass = val.name
+			// 	this.coalList = this.secondClassActionsList.find(v => v.id === val.id).coalNames.split(',').map(v => {
+			// 		return {
+			// 			name: v,
+			// 			id: Math.floor(Math.random() * 100) + 1,
+			// 			checked: false
+			// 		}
+			// 	})
+			// },
+			// orderTypeSelect() {
+			// 	this.orderTypeShow = true
+			// },
+			// orderTypeClose() {
+			// 	this.orderTypeShow = false
+			// },
+			// orderTypeSelectClick(val) {
+			// 	this.orderTypeShow = false
+			// 	this.dataForm.orderType = val.name
+			// 	this.isOrderType = ''
+			// },
+			// cleanOrderType() {
+			// 	this.dataForm.orderType = null
+			// 	this.isOrderType = '璇烽�夋嫨'
+			// 	this.orderTypeShow = false
+			// },
+			// checkboxChange(e) {
+			// 	this.selectedCoal = e
+			// },
 			formHandle() {
-				if (!this.dataForm.firstClass || !this.dataForm.secondClass) return this.$u.toast('璇烽�夋嫨鐓ゅ満鎴栬�呯叅浠�')
-				if (this.selectedCoal.length === 0) return this.$u.toast('璇烽�夋嫨鐓ょ')
-				this.$reqPost('updateUser', Object.assign(this.userInfo, {
-					responsibilityCoal: this.selectedCoal.join(),
-					filedId: this.filedId
-				}), 'json').then(res => {
-					uni.navigateTo({
-						url: `/pages/loadUnload-page/loadUnload-detail/loadUnload-detail?orderType=${this.dataForm.orderType}`
+				if (!this.dataForm.firstClass) return this.$u.toast('璇烽�夋嫨鐓ゅ満鎴栬�呯叅浠�');
+				this.$nextTick(()=>{
+ 					uni.navigateTo({
+						url: `/pages/loadUnload-page/loadUnload-detail/loadUnload-detail?bunkerId=${this.dataForm.bunkerId}`
 					})
 				})
+			   
 			}
+		},
+		onShow(){
+			uni.showLoading({
+					title: "鍔犺浇涓�"
+				})
+				this.$reqGet('getWarehouseList').then(res => {
+					uni.hideLoading()
+					if (res.code === 0) {
+						this.firstClassActionsList = res.data;
+						if(res.data.length === 1){
+							this.dataForm.bunkerId = res.data[0].id;
+							this.dataForm.firstClass = res.data[0].name;
+					
+						}
+					} else {
+						this.$u.toast('鍔犺浇澶辫触')
+					}
+				}).then(() => {
+					this.getUserInfo()
+				})
 		}
 	}
 </script>

--
Gitblit v1.9.1