From 244d89b41c0e0e995d38f635a126a0959b9ba25b Mon Sep 17 00:00:00 2001
From: wjt <1797368093@qq.com>
Date: 星期二, 25 六月 2024 18:16:42 +0800
Subject: [PATCH] 问题处理

---
 policy/policyApply/policyApply.vue |  108 ++++++++++++++++++++++++++++-------------------------
 1 files changed, 57 insertions(+), 51 deletions(-)

diff --git a/policy/policyApply/policyApply.vue b/policy/policyApply/policyApply.vue
index 399b8f0..99e8728 100644
--- a/policy/policyApply/policyApply.vue
+++ b/policy/policyApply/policyApply.vue
@@ -6,16 +6,17 @@
 					<view class="form-label require">
 						鎵ф硶涓婚
 					</view>
-					<input type="text" placeholder="璇疯緭鍏�" v-model="form.enforceReason"/>
+					<input type="text" placeholder="璇疯緭鍏�" v-model.trim="form.enforceReason"/>
 				</view>
 				<view class="form-item">
 					<view class="form-label require">
 						鎵ф硶瀵硅薄
 					</view>
-					<view class="input">
-						<input type="text"  placeholder="璇疯緭鍏�" v-model="form.companyName"/>
-						<!-- <u-icon name="arrow-right"></u-icon> -->
-						<u-text text='鎼滅储' type="primary" @click="search"></u-text>
+					<view class="input" @click="search">
+
+						<input type="text" style="width: 80%;" disabled  placeholder="璇疯緭鍏�" :value="form.companyName"/>
+						<u-icon name="arrow-right"></u-icon>
+						<!-- <u-text text='鎼滅储' type="primary" style="width: 20%;" @click="search"></u-text> -->
 					</view>
 				</view>
 				<view class="form-item">
@@ -23,7 +24,7 @@
 						鎵ф硶鏃堕棿
 					</view>
 					<view class="input" @click="showTimeFun">
-						<input type="text" placeholder="璇疯緭鍏�" disabled v-model="form.planTimeStr"/>
+						<input type="text" placeholder="璇疯緭鍏�" disabled v-model.trim="form.planTimeStr"/>
 						<u-icon name="arrow-right"></u-icon>
 					</view>
 				</view>
@@ -32,7 +33,7 @@
 						鎵ф硶绫诲瀷
 					</view>
 					<view class="input">
-						<input type="text" placeholder="璇疯緭鍏�" v-model="form.enforceTypeName" disabled/>
+						<input type="text" placeholder="璇疯緭鍏�" v-model.trim="form.enforceTypeName" disabled/>
 						<u-icon name="arrow-right"></u-icon>
 					</view>
 				</view>
@@ -41,7 +42,7 @@
 						鎵ф硶鍐呭
 					</view>
 					<view class="back">
-						<u--textarea :height="120" v-model="form.enforceContent" placeholder="璇疯緭鍏�" count maxlength="500"></u--textarea>
+						<u--textarea :height="120" v-model.trim="form.enforceContent" placeholder="璇疯緭鍏�" count maxlength="500"></u--textarea>
 					</view>
 				</view>
 			</view>
@@ -52,13 +53,13 @@
 					<view class="form-label">
 						鎵ф硶浜哄憳
 					</view>
-					<input type="text" placeholder="璇疯緭鍏�" v-model="form.applyUser" disabled/>
+					<input type="text" placeholder="璇疯緭鍏�" v-model.trim="form.applyUser" disabled/>
 				</view>
 				<view class="form-item">
 					<view class="form-label">
 						鎵ф硶閮ㄩ棬
 					</view>
-					<input type="text" placeholder="璇疯緭鍏�" v-model="form.applyDeptName" disabled/>
+					<input type="text" placeholder="璇疯緭鍏�" v-model.trim="form.applyDeptName" disabled/>
 				</view>
 				<view class="form-item sui" style="align-items: flex-start;" @click="openPer">
 					<view class="form-label require ">
@@ -122,24 +123,17 @@
 		</u-form> -->
 <!-- 		<u-button @click="submitApply">鎻愪氦鐢宠</u-button>
 		<u-button @click="applyRecord">鐢宠璁板綍</u-button> -->
-		<u-picker :show="show" @close="show = false" @confirm="confirmSearch" @cancel="show = false" :columns="columns" keyName="companyName"></u-picker>
-		<!-- <u-datetime-picker
-			:show="showTime"
-			@close="showTime = false"
-			@cancel="showTime = false"
-			@confirm="confirmTime"
-			:minDate="minDate"
-			v-model="currentTime"
-			@change="changeValue"
-			mode="datetime"
-			ref="datetimePicker"
-			></u-datetime-picker> -->
+		<!-- <u-picker :show="show"   @close="show = false" :immediateChange="true" @confirm="confirmSearch" @cancel="show = false" :columns="columns" keyName="companyName">
+		
+			
+		</u-picker> -->
+		<perPicker ref="perPicker" :immediateChange="true" @confirm="confirmSearch" @cancel="show = false" :columns="columns" keyName="companyName"></perPicker>
 			 <yt-dateTimePicker
 			      ref="myPicker"
 			      @submit="confirmTime"
-			      :start-year="year"
-			      :end-year="endYear"
 			      :time-init="timeInit"
+				  :start-year="year"
+				  :startMonth="month"
 			      :time-hide="[true, true, true, true, false, false]"
 			    />
 			<u-picker :show="showType" @close="showType = false" @confirm="confirmType" @cancel="showType = false" :columns="columnsType" keyName="dictLabel"></u-picker>
@@ -152,11 +146,13 @@
 	import { getInfo } from '@/api/auth.js'
 	import { getDicts } from '@/api/data'
 	import perPage from './perPage'
+	import perPicker from './perPicker'
 	import YtDateTimePicker from "uni_modules/yt-dateTimePicker/components/yt-dateTimePicker/yt-dateTimePicker.vue"
 	export default {
 		components: {
 			YtDateTimePicker,
-			perPage
+			perPage,
+			perPicker
 		},
 		data() {
 			return {
@@ -170,7 +166,8 @@
 					planTimeStr: '',
 					peers: [],
 					orderStatus: 1,
-					enforceContent: ""
+					enforceContent: "",
+					companyName: ""
 				},
 				show: false,
 				columns: [],
@@ -181,14 +178,18 @@
 				year: '',
 				endYear: '',
 				timeInit: '',
-				list: []
+				list: [],
+				startTime: "",
+				month: ''
 			}
 		},
 		onLoad() {
 			this.year = new Date().getFullYear()
+			this.month = new Date().getMonth() + 1
 			this.endYear = this.year + 5
 			this.minDate = new Date().valueOf()
-			this.timeInit = this.$u.timeFormat(new Date(), 'yyyy-mm-dd')
+			this.timeInit = this.$u.timeFormat(new Date(), 'yyyy-mm-dd hh:MM')
+			this.startTime =this.$u.timeFormat(new Date(), 'yyyy-mm-dd hh:MM')
 			this.getInfo()
 			this.getDicts()
 			this.enforceList()
@@ -233,11 +234,11 @@
 				return options;
 			},
 			authFile() {
-				if(!this.form.enforceReason){
+				if(!this.form.enforceReason || !this.form.enforceReason.replace(/\s+/g, "")){
 					return '璇峰~鍐欎富棰�'
 				}
-				if(!this.form.companyName){
-					return '璇峰~鍐欑‘璁ゆ墽娉曞璞�'
+				if(!this.form.companyName || !this.form.companyName.replace(/\s+/g, "")){
+					return '璇烽�夋嫨鎵ф硶瀵硅薄'
 				}
 				if(!this.form.companyId) {
 					return '璇风偣鍑绘悳绱㈢‘璁ゆ墽娉曞璞�'
@@ -248,11 +249,12 @@
 				if(!this.form.enforceTypeName){
 					return '璇烽�夋嫨鎵ф硶绫诲瀷'
 				}
-				if(!this.form.enforceContent) {
+				console.log(!this.form.enforceContent.replace(/\s+/g, ""))
+				if(!this.form.enforceContent || !this.form.enforceContent.replace(/\s+/g, "")) {
 					return '璇峰~鍐欐墽娉曞唴瀹�'
 				}
 				if(!this.form.peers.length){
-					return '璇锋坊鍔犲悓琛屼汉'
+					return '璇烽�夋嫨闅忚浜哄憳'
 				}
 				return ''
 			},
@@ -283,35 +285,38 @@
 				})
 			},
 			search() {
-				companyList({companyName: this.form.companyName}).then(val => {
-					if(val.data.code == 200){
-						if(!val.data.rows.length || !val.data.rows){
-							uni.showToast({
-								title: '娌℃湁绗﹀悎鐨勬暟鎹紝璇锋鏌ヨ緭鍏ョ殑鎵ф硶瀵硅薄',
-								icon: 'none',
-								duration: 3000
-							})
-						} else {
-							this.columns = [val.data.rows]
-							this.show = true
-						}
+				// companyList({companyName: this.form.companyName}).then(val => {
+				// 	if(val.data.code == 200){
+				// 		if(!val.data.rows.length || !val.data.rows){
+				// 			uni.showToast({
+				// 				title: '娌℃湁绗﹀悎鐨勬暟鎹紝璇锋鏌ヨ緭鍏ョ殑鎵ф硶瀵硅薄',
+				// 				icon: 'none',
+				// 				duration: 3000
+				// 			})
+				// 		} else {
+							
+				// 		}
 						
-					}
-				})
+				// 	}
+				// })
+				
+				this.$refs.perPicker.open()
 			},
 			confirmSearch(e){
-				const value =	this.columns[0].find(item => item.companyName == e.value[0].companyName)
-				this.form.companyName = e.value[0].companyName
+				let value = e
+				// const value =	this.columns[0].find(item => item.companyName == e.value[0].companyName)
+				this.form.companyName = e.companyName
 				this.form.companyCode = value.companyCode
 				this.form.companyId	 = value.companyId	
 				this.form.companyPhone = value.companyPhone
 				this.form.companyUser = value.companyUser
 				this.form.companyAddress = value.companyAddress
-				this.show = false
+				console.log(this.form.companyName)
 			},
 			confirmTime(e) {
 				this.form.planTime = e.year + '-' + e.month+ '-' + + e.day + ' ' + e.hour + ":" + "00:00"
-				this.form.planTimeStr = e.year + '-' + e.month+ '-' + + e.day + ' ' + e.hour
+				this.form.planTimeStr = e.year + '-' + e.month+ '-' + + e.day + ' ' + e.hour + ":" + "00"
+				this.timeInit = this.$u.timeFormat(new Date(this.form.planTimeStr), 'yyyy-mm-dd hh:MM')
 			},
 			showTimeFun() {
 				// this.showTime = true
@@ -333,6 +338,7 @@
 				this.$refs.perpage.open(this.list)
 			},
 			selectValue(value) {
+				this.form.peers = []
 				this.list.forEach(item => {
 					if(value.includes(item.userId)) {
 						this.form.peers.push({

--
Gitblit v1.9.1