From 81b8089d94e7f9537b8f5a00b68c95a9e858e2bf Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期一, 13 十一月 2023 12:48:41 +0800
Subject: [PATCH] #

---
 pages/business/cstmr/addCsmtr.vue |   39 ++++++++++++++++++++++++++++++++++++---
 1 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/pages/business/cstmr/addCsmtr.vue b/pages/business/cstmr/addCsmtr.vue
index d179658..09dcad1 100644
--- a/pages/business/cstmr/addCsmtr.vue
+++ b/pages/business/cstmr/addCsmtr.vue
@@ -2,8 +2,15 @@
 	<view>
 		<view class="container">
 			<uni-forms ref="baseForm" :modelValue="baseFormData">
-				<uni-forms-item label="瀹㈡埛鍚嶇О" required name="name">
+				<!-- <uni-forms-item label="瀹㈡埛鍚嶇О" required name="name">
 					<uni-easyinput v-model="baseFormData.name" placeholder="璇疯緭鍏ュ鎴峰悕绉�" />
+				</uni-forms-item> -->
+				
+				<uni-forms-item label="瀹㈡埛鍚嶇О" required name="name">
+					<view>
+						<uni-combox :candidates="names" placeholder="璇疯緭鍏ュ鎴峰悕绉�"
+						v-model="baseFormData.name" @input="cstmrSearch()"></uni-combox>
+					</view>
 				</uni-forms-item>
 				
 				<uni-forms-item label="瀹㈡埛绫诲埆" required name="cstmrType">
@@ -21,7 +28,7 @@
 				
 				<uni-forms-item label="浜у搧绫诲埆" required name="productCategory">
 					<view>
-						<uni-combox :candidates="productCategorys" placeholder="璇烽�夋嫨瀹㈡埛绫诲埆"
+						<uni-combox :candidates="productCategorys" placeholder="璇烽�夋嫨浜у搧绫诲埆"
 						v-model="baseFormData.productCategory"></uni-combox>
 					</view>
 				</uni-forms-item>
@@ -70,9 +77,12 @@
 				director: '',
 				cstmrTypeList: [],
 				directorList: [],
+				names: [],
+				nameList: [],
 				industrys: ['鍖昏嵂涓�','鍒堕�犱笟','绾虹粐涓�'],
 				productCategorys: ['绔嬩綋搴擄紙璐ф灦锛�','绔嬩綋搴擄紙闆嗘垚锛�','鍥涘悜绌挎搴�/涓ゅ悜绌挎搴�','闃佹ゼ璐ф灦/閽㈠钩鍙�','鍛ㄨ浆瀹瑰櫒','骞冲簱'],
 				baseFormData: {
+					name: '',
 					citysData: [],
 					cstmrType: '',
 					director: '',
@@ -105,7 +115,7 @@
 							errorMessage: '璇烽�夋嫨瀹㈡埛琛屼笟'
 						}]
 					},
-					productCategorys: {
+					productCategory: {
 						rules: [{
 							required: true,
 							errorMessage: '璇烽�夋嫨浜у搧绫诲埆'
@@ -178,6 +188,29 @@
 			this.autoLoad('user','')
 		},
 		methods: {
+			cstmrSearch() {
+				this.names = []
+				let _this = this
+				if(_this.baseFormData.name.length < 4) {
+					return
+				}
+				uni.request({
+					url: `${_this.baseUrl}/cstmrSearch/auth`,
+					header:{'token':uni.getStorageSync('token'),'content-type':'application/x-www-form-urlencoded',},
+					data: {condition: _this.baseFormData.name},
+					method: 'POST',
+					success(res) {
+						res = res.data
+						if (res.code === 200 && res.data.length > 0) {
+							for(let element of res.data) {
+								_this.names.push(element.name)
+								_this.nameList.push(element)
+							}
+						}
+					}
+				})
+				
+			},
 			bindPickerChange: function(e) {
 				this.cstmrTypeIndex = e.detail.value
 				this.baseFormData.cstmrType = this.cstmrTypes[e.detail.value].id

--
Gitblit v1.9.1