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 |   77 +++++++++++++++++++++++++++++---------
 1 files changed, 59 insertions(+), 18 deletions(-)

diff --git a/pages/business/saleManage/modiSaleManage.vue b/pages/business/saleManage/modiSaleManage.vue
index adc2b84..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>
@@ -79,6 +79,9 @@
 				orderProductTypeIds: [],
 				orderProductTypeList: [],
 				baseFormData: {
+					id: '',
+					memoExperience: '',
+					status: 0,
 					citysData: [],
 					cstmrType: '',
 					company: '',
@@ -149,8 +152,11 @@
 					text: '澶栭攢',
 					value: 2
 				}],
+				id: 0,
 				citysData: [],
-				citysDataTemp: ''
+				citysDataTemp: '',
+				memoExperience: '',
+				status: 0
 			}
 		},
 		onReady() {
@@ -162,7 +168,39 @@
 			this.citysData = test.citysData
 			this.getDetail()
 		},
+		onLoad: function(option) {
+			let _this = this
+			const eventChannel = this.getOpenerEventChannel();
+			eventChannel.on('saleManage', function(data) {
+				data = data.data
+				_this.id = data.id
+				_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) {
@@ -243,24 +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) {
-					console.log(that.directorList);
-					console.log(that.baseFormData.director);
-					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
 					}
 				}
@@ -276,8 +312,11 @@
 						res.remarks = ''
 					}
 					res.pcd = this.citysDataTemp
+					res.id = this.id
+					res.memoExperience = this.memoExperience
+					res.status = this.status
 					uni.request({
-						url: that.baseUrl + '/order/add/auth',
+						url: that.baseUrl + '/order/update/auth',
 						header: {
 							'token': uni.getStorageSync('token'),
 							'content-type': 'application/x-www-form-urlencoded',
@@ -287,7 +326,9 @@
 						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,

--
Gitblit v1.9.1