From 3913b3c5c8cde03f8c92d1c738d28c4a9bae7e55 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期三, 22 十一月 2023 08:48:02 +0800
Subject: [PATCH] #

---
 pages/business/saleManage/modiSaleManage.vue |   66 ++++++++++++++++++--------------
 1 files changed, 37 insertions(+), 29 deletions(-)

diff --git a/pages/business/saleManage/modiSaleManage.vue b/pages/business/saleManage/modiSaleManage.vue
index 8062a57..b224d64 100644
--- a/pages/business/saleManage/modiSaleManage.vue
+++ b/pages/business/saleManage/modiSaleManage.vue
@@ -7,14 +7,14 @@
 				</uni-forms-item>
 				<uni-forms-item label="鐢叉柟鍗曚綅" required name="cstmrId">
 					<view @click="autoLoad('cstmr','')">
-						<uni-combox :candidates="cstmrs" placeholder="璇烽�夋嫨鐢叉柟鍗曚綅" v-model="baseFormData.cstmrId"
-							@input="autoLoad('cstmr',baseFormData.cstmrId)"></uni-combox>
+						<uni-combox :candidates="cstmrs" placeholder="璇烽�夋嫨鐢叉柟鍗曚綅" v-model="baseFormData.cstmrId$"
+							@input="autoLoad('cstmr',baseFormData.cstmrId$)"></uni-combox>
 					</view>
 				</uni-forms-item>
 				<uni-forms-item label="鎵�灞炲叕鍙�" required name="company">
 					<view @click="autoLoad('company','')">
-						<uni-combox :candidates="companies" placeholder="璇烽�夋墍灞炲叕鍙�" v-model="baseFormData.company"
-							@input="autoLoad('company',baseFormData.company)"></uni-combox>
+						<uni-combox :candidates="companies" placeholder="璇烽�夋墍灞炲叕鍙�" v-model="baseFormData.company$"
+							@input="autoLoad('company',baseFormData.company$)"></uni-combox>
 					</view>
 				</uni-forms-item>
 				<uni-forms-item label="棰勭畻閲戦(涓囧厓)" name="money" required>
@@ -28,18 +28,18 @@
 				</uni-forms-item>
 				<uni-forms-item label="璐熻矗浜�" name="director" required>
 					<view @click="autoLoad('user','')">
-						<uni-combox :candidates="directors" placeholder="璇烽�夋嫨璐熻矗浜�" v-model="baseFormData.director"
-							@input="autoLoad('user',baseFormData.director)"></uni-combox>
+						<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="orderProductTypeId" required>
 					<view @click="autoLoad('orderProductType','')">
 						<uni-combox :candidates="orderProductTypeIds" placeholder="璇烽�夋嫨浜у搧绫诲瀷" 
-						v-model="baseFormData.orderProductTypeId"
-							@input="autoLoad('orderProductType',baseFormData.orderProductTypeId)"></uni-combox>
+						v-model="baseFormData.orderProductTypeId$"
+							@input="autoLoad('orderProductType',baseFormData.orderProductTypeId$)"></uni-combox>
 					</view>
 				</uni-forms-item>
-				<uni-forms-item label="鐪佸競鍖�" name="citysData" required>
+				<uni-forms-item label="鐪佸競鍖�" name="pcd" required>
 					<uni-data-picker @change="areaChange" placeholder="璇烽�夋嫨鐪佸競鍖�" popup-title="璇烽�夋嫨鎵�鍦ㄥ湴鍖�"
 						:localdata="citysData" v-model="baseFormData.pcd">
 					</uni-data-picker>
@@ -171,28 +171,36 @@
 		onLoad: function(option) {
 			let _this = this
 			const eventChannel = this.getOpenerEventChannel();
-			eventChannel.emit('acceptDataFromOpenedPage', {data: 'data from test page'});
-			eventChannel.emit('someEvent', {data: 'data from test page for someEvent'});
-			// 鐩戝惉acceptDataFromOpenerPage浜嬩欢锛岃幏鍙栦笂涓�椤甸潰閫氳繃eventChannel浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
 			eventChannel.on('saleManage', function(data) {
 				data = data.data
-				console.log(data);
-				_this.cstmrList = [{value: data.cstmrId$,id: data.cstmrId}]
-				_this.companyList = [{name: data.company$,id: data.company}]
-				_this.directorList = [{value: data.director$,id: data.director}]
-				_this.orderProductTypeList = [{value: data.orderProductTypeId$,id: data.orderProductTypeId}]
-				data.cstmrId =  data.cstmrId$
-				data.company =  data.company$
-				data.director =  data.director$
-				data.orderProductTypeId =  data.orderProductTypeId$
-				_this.citysDataTemp = data.pcd
 				_this.id = data.id
-				_this.memoExperience = data.memoExperience
-				_this.status = data.status
-				_this.baseFormData = data
+				_this.init()
+				return
 			})
 		},
 		methods: {
+			init() {
+				let that = this
+				uni.request({
+					url: that.baseUrl + '/order/' + that.id +'/auth',
+					header: {'token' : uni.getStorageSync('token')},
+					method: 'GET',
+					success(res) {
+						res = res.data
+						for (let key in res.data) {
+							if (res.data[key] === null) {
+								res.data[key] = ''
+							}
+							if (key == 'pcd') {
+								that.citysDataTemp = res.data[key]
+								res.data[key] = res.data[key].split(',')[2]
+							}
+						}
+						that.ide = res.data.id
+						that.baseFormData = res.data
+					}
+				})
+			},
 			async getDetail() {
 				let res = await user.getDetail()
 				if (res.code === 200) {
@@ -273,22 +281,22 @@
 				var element;
 				// 鎵�灞炲叕鍙�
 				for (element of that.companyList) {
-					if (element.name == that.baseFormData.company) {
+					if (element.name == that.baseFormData.company$) {
 						that.baseFormData.company = element.id
 					}
 				}
 				for (element of that.cstmrList) {
-					if (element.value == that.baseFormData.cstmrId) {
+					if (element.value == that.baseFormData.cstmrId$) {
 						that.baseFormData.cstmrId = element.id
 					}
 				}
 				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.orderProductTypeList) {
-					if (element.value == that.baseFormData.orderProductTypeId) {
+					if (element.value == that.baseFormData.orderProductTypeId$) {
 						that.baseFormData.orderProductTypeId = element.id
 					}
 				}

--
Gitblit v1.9.1