From e6a02c8b09a796e436a501e9b87d19e25c34c9d1 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期日, 07 四月 2024 15:53:37 +0800
Subject: [PATCH] #

---
 pages/business/cstmr/modiCsmter.vue |   71 ++++++++++++++++++++++++-----------
 1 files changed, 49 insertions(+), 22 deletions(-)

diff --git a/pages/business/cstmr/modiCsmter.vue b/pages/business/cstmr/modiCsmter.vue
index e32513b..c51fd77 100644
--- a/pages/business/cstmr/modiCsmter.vue
+++ b/pages/business/cstmr/modiCsmter.vue
@@ -19,17 +19,19 @@
 						v-model="baseFormData.cstmrType$" @input="autoLoad('cstmrType',baseFormData.cstmrType$)"></uni-combox>
 					</view>
 				</uni-forms-item>
-				<uni-forms-item label="瀹㈡埛琛屼笟" required name="industry">
-					<view >
-						<uni-combox :candidates="industrys" placeholder="璇烽�夋嫨瀹㈡埛琛屼笟"
-						v-model="baseFormData.industry"></uni-combox>
+				<uni-forms-item label="瀹㈡埛琛屼笟" name="industry" required>
+					<view @click="autoLoad('customerIndustryName','')">
+						<uni-combox :candidates="industrys" placeholder="璇烽�夋嫨瀹㈡埛琛屼笟" 
+						v-model="baseFormData.industry"
+							@input="autoLoad('customerIndustryName',baseFormData.industry)"></uni-combox>
 					</view>
 				</uni-forms-item>
 				
-				<uni-forms-item label="浜у搧绫诲埆" required name="productCategory">
-					<view>
-						<uni-combox :candidates="productCategorys" placeholder="璇烽�夋嫨浜у搧绫诲埆"
-						v-model="baseFormData.productCategory"></uni-combox>
+				<uni-forms-item label="浜у搧绫诲瀷" name="productCategory" required>
+					<view @click="autoLoad('orderProductType','')">
+						<uni-combox :candidates="productCategorys" placeholder="璇烽�夋嫨浜у搧绫诲瀷" 
+						v-model="baseFormData.productCategory"
+							@input="autoLoad('orderProductType',baseFormData.orderProductTypeId)"></uni-combox>
 					</view>
 				</uni-forms-item>
 				
@@ -45,17 +47,18 @@
 				</uni-forms-item>
 				
 				
-				<!-- <uni-forms-item label="璐熻矗浜�" required name="director">
-					<view @click="autoLoad('user','')">
-						<uni-combox :candidates="directors" placeholder="璇烽�夋嫨璐熻矗浜�"
-						v-model="baseFormData.director" @input="autoLoad('user',baseFormData.director)"></uni-combox>
-					</view>
-				</uni-forms-item> -->
+				
 				<uni-forms-item label="瀹㈡埛鑱旂郴浜�" required name="contacts">
 					<uni-easyinput v-model="baseFormData.contacts" placeholder="璇疯緭鍏ュ鎴疯仈绯讳汉" />
 				</uni-forms-item>
 				<uni-forms-item label="鐢佃瘽" required name="tel">
 					<uni-easyinput v-model="baseFormData.tel" placeholder="璇疯緭鍏ュ鎴风數璇�" />
+				</uni-forms-item>
+				<uni-forms-item label="璐熻矗浜�"  name="director">
+					<view @click="autoLoad('user','')">
+						<uni-combox :candidates="directors" placeholder="璇烽�夋嫨璐熻矗浜�"
+						v-model="baseFormData.director$" @input="autoLoad('user',baseFormData.director$)"></uni-combox>
+					</view>
 				</uni-forms-item>
 				<uni-forms-item label="澶囨敞" name="remarks">
 					<uni-easyinput type="textarea" v-model="baseFormData.remarks" placeholder="璇疯緭鍏ュ娉�" />
@@ -80,8 +83,10 @@
 				directorList: [],
 				names: [],
 				nameList: [],
-				industrys: ['鍖昏嵂涓�','鍒堕�犱笟','绾虹粐涓�'],
-				productCategorys: ['绔嬩綋搴擄紙璐ф灦锛�','绔嬩綋搴擄紙闆嗘垚锛�','鍥涘悜绌挎搴�/涓ゅ悜绌挎搴�','闃佹ゼ璐ф灦/閽㈠钩鍙�','鍛ㄨ浆瀹瑰櫒','骞冲簱'],
+				industrys: [],
+				industryList: [],
+				productCategorys: [],
+				productCategoryList: [],
 				baseFormData: {
 					name: '',
 					citysData: [],
@@ -149,7 +154,7 @@
 					},
 					director: {
 						rules: [{
-							required: true,
+							required: false,
 							errorMessage: '璇疯緭鍏ヨ礋璐d汉',
 						}]
 					},
@@ -253,8 +258,6 @@
 				this.baseFormData.cstmrType = this.cstmrTypes[e.detail.value].id
 			},
 			areaChange(e) {
-				console.log(e);
-				console.log(this.baseFormData.pcd$);
 				this.citysDataTemp = e.detail.value[0].value + ',' + e.detail.value[1].value + ',' + e.detail.value[2].value
 			},
 			autoLoad(type,condition) {
@@ -262,6 +265,7 @@
 				that.cstmrTypes = []
 				that.directors = []
 				that.directorList = []
+				that.industrys = []
 				var a = that.baseUrl + '/' + type + 'Query/auth'
 				uni.request({
 					url: that.baseUrl + '/' + type + 'Query' +'/auth',
@@ -286,7 +290,20 @@
 								}
 								return
 							}
-							
+							if (type == 'orderProductType') {
+								for (element of res.data) {
+									that.productCategorys.push(element.value)
+									that.productCategoryList.push(element)
+								}
+								return
+							}
+							if (type == 'customerIndustryName') {
+								for (element of res.data) {
+									that.industrys.push(element.value)
+									that.industryList.push(element)
+								}
+								return
+							}
 						}
 					}
 				})
@@ -296,13 +313,23 @@
 				let that = this
 				var element;
 				for (element of that.directorList) {
-					if(element.value == that.baseFormData.director) {
+					if(element.value == that.baseFormData.director$) {
 						that.baseFormData.director = element.id
 					}
 				}
 				for (element of that.cstmrTypeList) {
 					if(element.value == that.baseFormData.cstmrType$) {
 						that.baseFormData.cstmrType = element.id
+					}
+				}
+				for (element of that.productCategoryList) {
+					if(element.value == that.baseFormData.productCategory) {
+						that.baseFormData.productCategory = element.id
+					}
+				}
+				for (element of that.industryList) {
+					if(element.value == that.baseFormData.industry) {
+						that.baseFormData.industry = element.id
 					}
 				}
 				this.$refs.baseForm.validate().then(res=>{
@@ -325,7 +352,7 @@
 						success(result) {
 							var res = result.data
 							if (res.code === 200) {
-								uni.navigateBack()
+								uni.navigateBack({delta:2})
 							} else if (res.code === 403) {
 								uni.showToast({title: res.msg, icon: "none", position: 'top'})
 								setTimeout(() => {

--
Gitblit v1.9.1