<template>
	<view>
		<z-navbar :title="(type==0?'新建':'编辑')+'预定'" back>
			<view slot="right" @click="submit">保存</view>
		</z-navbar>
		<w-picker mode="date" startYear="2000" endYear="2100" v-model="info.alertDate" :current="true" fields="day"
			@confirm="onConfirm($event)" @cancel="onCancel" :disabled-after="false" ref="date"></w-picker>
		<z-form :model="info" :rules="rules" ref="info">
			<!-- 默认已订 -->
			<z-form-item label="预定状态" prop="orderState">
				<image slot="icon" class="common_icon" src="../../../static/icon_list.png"></image>
				<order-state v-model="info.orderState" placeholder="请选择"></order-state>
			</z-form-item>
			<z-divider></z-divider>
			<z-form-item label="客户姓名" prop="customName" showline>
				<image slot="icon" class="common_icon" src="../../../static/icon_person.png"></image>
				<z-input v-model="info.customName" placeholder="点击填写"></z-input>
			</z-form-item>
			<z-form-item label="客户电话" prop="phone" showline>
				<image slot="icon" class="common_icon" src="../../../static/icon_tel.png"></image>
				<z-input type="number" maxlength="11" v-model="info.phone" placeholder="点击填写"></z-input>
			</z-form-item>
			<z-form-item label="预定场地" prop="houseId" showline>
				<image slot="icon" class="common_icon" src="../../../static/icon_local.png"></image>
				<want-house v-model="info.houseId" @checkedDetail="houseInfoCheckedDetail" placeholder="选择预定场地">
				</want-house>
			</z-form-item>
			<!-- 只有宴会厅时显示预定类型-->
			<z-form-item label="预定类型" prop="orderTypeId" showline dynamic
				:required="info.houseInfo&&info.houseInfo.houseTypeCode=='01'?true:false"
				v-show="info.houseInfo&&info.houseInfo.houseTypeCode=='01'">
				<image slot="icon" class="common_icon" src="../../../static/icon_kuai.png"></image>
				<order-type v-model="info.orderTypeId" placeholder="预定类型"></order-type>
			</z-form-item>
			<z-form-item label="预定日期" v-show="info.houseId" prop="orderTime" showline>
				<image slot="icon" class="common_icon" src="../../../static/icon_time.png"></image>
				<date-select :houseInfo="info.houseInfo" @changeDate="changeDate" v-model="info.orderTime"
					placeholder="选择预定时间"></date-select>
			</z-form-item>
			<!-- 包房没有收费方式 预定套餐 提醒日期 总计应收 定金默认0 -->
			<z-form-item label="收费方式" prop="mainPayType" v-if="info.houseInfo&&info.houseInfo.houseTypeCode!='03'"
				showline>
				<image slot="icon" class="common_icon" src="../../../static/icon_price.png"></image>
				<payment-way :payTypes="info.payTypes" @payTypes="getPayTypes" @getMainPayTypeText="getMainPayTypeText"
					v-model="info.mainPayType" placeholder="选择收费方式"></payment-way>
			</z-form-item>
			<z-form-item label="选择套餐" prop="packageId" dynamic :required="false" showline
				v-show="info.houseInfo&&info.houseInfo.houseTypeCode!='03'">
				<image slot="icon" class="common_icon" src="../../../static/icon_dui.png"></image>
				<view class="flex-n fac fje">
					<order-package v-model="info.packageId" placeholder="选择套餐" @change="changePackage"></order-package>
					<view v-if="info.packageId" class="order_package_manage ml-20 iconfont iconbianji"
						@click="modifyPackage=true"></view>
				</view>
				<extra-item title="修改套餐" hideReal :packageId="info.packageId" v-model="info.orderPackage"
					:visible.sync="modifyPackage" @getTotal="getPackageTotal"></extra-item>
			</z-form-item>
			<z-form-item label="开餐时间" prop="eatTime" showline arrow v-show="info.packageId"
				:required="info.packageId?true:false" dynamic>
				<image slot="icon" class="common_icon" src="../../../static/icon_time.png"></image>

				<z-text v-model="eatTimeText" placeholder="选择开餐时间" @click="showEatTime=true"></z-text>
				<z-time-select :visible.sync="showEatTime" :step="10" v-model="info.eatTime"
					:start="eatTimeBegin||'07:00'" :end="eatTimeEnd||'24:00'" 	@ok="selectEatTime"></z-time-select>
			</z-form-item>
			<z-form-item label="增加项目" prop="orderExtra" arrow showline>
				<image slot="icon" class="common_icon" src="../../../static/icon_jia.png"></image>
				<z-text :value="(info.extraRealMoney||0)+'元'" placeholder="选择增加项目" @click="addItem=true"></z-text>
				<extra-item title="增加项目" :visible.sync="addItem" v-model="info.orderExtra" @getTotal="getExtraTotal">
				</extra-item>
			</z-form-item>
			<z-form-item label="订金(元）" prop="downPayment" showline :required="(info.orderState=='02')?true:false"
				dynamic>
				<image slot="icon" class="common_icon" src="../../../static/icon_money.png"></image>
				<z-input v-model="info.downPayment" type="number" placeholder="¥"></z-input>
				<!-- <z-text :value="info.downPayment||'0'" textColor="#999" placeholder="" v-else></z-text> -->
			</z-form-item>

			<template
				v-if="info.houseInfo&&info.houseInfo.houseTypeCode!='03'&&info.orderTime&&new Date(info.orderTime.split('  ')[0]).getTime()>=new Date($Date.getDayDate().date).getTime()">
				<z-divider></z-divider>
				<z-form-item height="100rpx" label="关闭提醒" showline>
					<switch :checked="switchAlert" @change="changeSwitchAlert" />
				</z-form-item>
				<z-form-item label="提醒日期" prop="alertDate" v-show="!switchAlert" arrow :required="!switchAlert" dynamic>
					<image slot="icon" class="common_icon" src="../../../static/icon_date2.png"></image>
					<z-text v-model="info.alertDate" placeholder="选择提醒日期" @click="chooseDate"></z-text>
				</z-form-item>
				<z-divider></z-divider>
			</template>
			<z-form-item bgcolor="#eee" :labelStyle="{color:'#999'}" label="总计应收(元)" showline>
				<image slot="icon" class="common_icon" src="../../../static/icon_zongji.png"></image>
				<z-text v-model="totalMoney" textColor="#999" placeholder=""></z-text>
			</z-form-item>
			<z-form-item label="顾客来源" prop="customFromId" showline v-show="info"
				:required="info.orderState=='02'?true:false" dynamic>
				<image slot="icon" class="common_icon" src="../../../static/icon_laiyuan.png"></image>
				<user-from v-model="info.customFromId" placeholder="请选择顾客来源"></user-from>
			</z-form-item>
			<z-form-item bgcolor="#eee" :labelStyle="{color:'#999'}" label="预定人员" prop="createUserName" showline
				v-if="type==1">
				<image slot="icon" class="common_icon" src="../../../static/icon_people.png"></image>
				<z-text v-model="info.createUserName" textColor="#999" placeholder=""></z-text>
			</z-form-item>
			<z-form-item bgcolor="#eee" :labelStyle="{color:'#999'}" label="预定时间" prop="createTime" showline
				v-if="type==1">
				<image slot="icon" class="common_icon" src="../../../static/icon_time.png"></image>
				<z-text v-model="info.createTime" textColor="#999" placeholder=""></z-text>
			</z-form-item>
			<z-divider></z-divider>
			<z-form-item label="备注信息" prop="remark" labelPos="top">
				<textarea class="textarea" v-model="info.remark" placeholder="请输入备注信息" maxlength="512"
					auto-height></textarea>
			</z-form-item>

		</z-form>
		<u-toast ref="uToast"></u-toast>
	</view>
</template>

<script>
	const app = getApp({
		allowDefault: true
	});
	import dateSelect from './date-select.vue';
	import wantHouse from '../../component/wantHouse/wantHouse.vue';
	import paymentWay from '../../component/paymentWay/paymentWay.vue';
	import orderPackage from '../../component/package/package.vue';
	import extraItem from '../../component/extraItem/extraItem.vue';
	import orderType from '../../component/orderType/orderType.vue';
	import orderState from '../../component/orderState/orderState.vue';
	import userFrom from '../../component/userFrom/userFrom.vue';
	export default {
		components: {
			dateSelect,
			wantHouse,
			paymentWay,
			orderPackage,
			extraItem,
			orderType,
			orderState,
			userFrom
		},
		data() {
			var validateAlertDate = (rule, value, callback) => {
				var orderTime = this.info.orderTime.split('  ');
				if (!this.switchAlert) {
					if (new Date(this.info.alertDate).getTime() > new Date(orderTime[0]).getTime())
						return {
							state: false,
							message: '提醒日期不能大于预定日期'
						};
					else if (new Date(this.info.alertDate).getTime() < new Date(this.$Date.getDayDate().date)
						.getTime()) {
						return {
							state: false,
							message: '设置的提醒日期不能小于当前日期'
						}
					} else
						return true;
				} else
					return true;
			};
			return {
				id: '',
				askId: '',
				type: 0,

				switchAlert: true,
				modifyPackage: false,
				addItem: false,
				showOrderState: false,
				startDate: '1900-01-01',
				showEatTime: false,
				orderAlertDaysBefore: 0,
				orderDefaultMoney: 0,
				downPayment: 0,
				alertDate: '',

				info: {
					customName: '',
					phone: '',
					houseId: '',
					downPayment: '',
					orderTime: '',
					houseInfo: {},
					orderTypeId: '',
					addItemContent: '',
					orderMoney: 0,
					customFromId: '',
					orderState: '02',
					extraRealMoney: '',
					alertDate: '',
					packageId: '',
					eatTime: '',
					orderExtra: {
						itemsExTree: '',
						itemsFoodTree: ''
					}
				},

				eatTimeBegin: '',
				eatTimeEnd: '',
				eatTimeText:'',
				rules: {
					customName: [{
						required: true,
						message: ''
					}],
					phone: [{
						message: ''
					}],
					houseId: [{
						required: true,
						message: ''
					}],
					orderTime: [{
						required: true,
						message: ''
					}],
					orderTypeId: [{
						message: ''
					}],
					eatTime: [{
						message: ''
					}],
					// packageId:[{
					// 		message: ''
					// }],
					customFromId: [{
						message: ''
					}],
					orderState: [{
						required: true,
						message: ''
					}],
					alertDate: [{
						validator: validateAlertDate
					}]
				}
			};
		},
		computed: {
			totalMoney() {
				var mainPayType = this.info.mainPayType;
				var payTypes = this.info.payTypes;
				var value = 0;

				console.log('mainPayType', this.info.mainPayType)
				if (this.info.mainPayType == '01' || this.info.mainPayType == '02') {
					value = Number(payTypes[0].onePrice) * Number(payTypes[0].orderCount);
				} else {
					for (var i in payTypes) {
						if (payTypes[i].payTypeCode == '01' || payTypes[i].payTypeCode == '02') {
							value += Number(payTypes[i].onePrice) * Number(payTypes[i].orderCount);
						} else {
							value += Number(payTypes[i].housePrice);
						}
					}
				}

				this.$set(this.info, 'packageNeedMoney', value);
				value += Number(this.info.extraRealMoney);
				this.$set(this.info, 'orderMoney', value);
				return value || 0;
			}
		},
		watch: {},

		onLoad(option) {
			this.type = option.type;
			this.id = option.id;
			this.getorderalertTime();
			if (this.type == 1) {

				uni.showLoading({
					mask: true,
					title: '加载中'
				});
				this.getData(option.id);
			}
			if (option.askId) {
				uni.showLoading({
					mask: true,
					title: '加载中'
				});
				this.askId = option.askId;
				this.getInfo();
			}

		},
		methods: {
			bindTimeChange: function(e) {
				this.$set(this.info, 'eatTime', e.target.value)
			},
			getInfo() {
				uni.getStorage({
					key: 'remindToOrder',
					success: (res) => {
						console.log('预定数据', res.data)
						var info = res.data;
						this.info = {
							customName: info.customName,
							phone: info.phone,
							houseId: '',
							downPayment: 0,
							orderTime: '',
							houseInfo: {},
							orderTypeId: '',
							addItemContent: '',
							orderMoney: 0,
							customFromId: info.customFromId,
							orderState: '02',
							extraRealMoney: '',
							orderExtra: {
								itemsExTree: '',
								itemsFoodTree: ''
							}
						}
						setTimeout(() => {
							for (var i in info.wantHouse) {
								if (info.wantHouse[i]) {
									this.$set(this.info, 'houseId', info.wantHouse[i].houseId);
									break;
								}
							}

						}, 0)
					},
					complete: () => {
						uni.hideLoading();
					}
				})
			},
			getData(orderId) {
				this.$axios.get('app/order/orderDetailById/' + orderId).then(res => {
					console.log(res.data)
					var info = res.data;

					info.orderTime = info.orderDate + '  ' + info.activityBeginTime + '~' + info.activityEndTime;
					this.eatTimeBegin = info.activityBeginTime;
					this.eatTimeEnd = info.activityEndTime;
					
					for (var i = 0; i < info.orderPackage.itemsExs.length; i++) {
						info.orderPackage.itemsExs[i].id = info.orderPackage.itemsExs[i].itemId;
					}
					for (var i = 0; i < info.orderPackage.itemsFoods.length; i++) {
						info.orderPackage.itemsFoods[i].id = info.orderPackage.itemsFoods[i].foodId;
					}
					info.orderPackage = {
						itemsExTree: info.orderPackage.itemsExs || [],
						itemsFoodTree: info.orderPackage.itemsFoods || []
					}
					for (var i = 0; i < info.orderExtra.itemsExs.length; i++) {
						info.orderExtra.itemsExs[i].id = info.orderExtra.itemsExs[i].itemId;
					}
					for (var i = 0; i < info.orderExtra.itemsFoods.length; i++) {
						info.orderExtra.itemsFoods[i].id = info.orderExtra.itemsFoods[i].foodId;
					}
					info.orderExtra = {
						itemsExTree: info.orderExtra.itemsExs || [],
						itemsFoodTree: info.orderExtra.itemsFoods || []
					}
					info.houseInfo = {};
					console.log('额外项目', info.orderExtra)
					if (info.alertDate) {
						this.switchAlert = false;
					} else {
						this.switchAlert = true;
					}
					// this.totalMoney=info.orderMoney;
					this.alertDate = info.alertDate;

					this.info = info;
					this.eatTimeText=this.$Date.getFormatTimeText(info.eatTime);
					console.log('hq', this.info)
					uni.hideLoading();
				}).catch(err => {
					console.log(err)
					uni.hideLoading();
					this.$refs.uToast.error(err.msg);
				})
			},
			changeDate(date) {
				console.warn(date)
				//重置开餐时间相关数据
				this.eatTimeBegin = date.startTime;
				this.eatTimeEnd = date.endTime;
				this.$set(this.info,'eatTime','');
				this.eatTimeText='';
				
				var time = new Date(new Date(date.date).getTime() - this.orderAlertDaysBefore * 24 * 60 * 60 * 1000)

				var month = time.getMonth() + 1,
					day = time.getDate();

				if (!this.switchAlert) {
					if (time.getTime() < new Date(this.$Date.getDayDate().date).getTime()) {
						this.$set(this.info, 'alertDate', null);
					} else {
						this.$set(this.info, 'alertDate', time.getFullYear() + '-' + (month < 10 ? ('0' + month) : month) +
							'-' + (
								day < 10 ? ('0' + day) : day))
					}
				}


				if (new Date(date).getTime() < new Date(this.$Date.getDayDate().date).getTime()) {
					this.switchAlert = true;
					this.$set(this.info, 'alertDate', null);
				}
				this.alertDate = this.info.alertDate;
			},
			changeSwitchAlert(e) {
				console.log(e.detail.value)
				this.switchAlert = e.detail.value;
				if (this.switchAlert) {
					this.$set(this.info, 'alertDate', null)
				} else {
					this.$set(this.info, 'alertDate', this.alertDate);
				}
			},
			houseInfoCheckedDetail(data) {
				console.log('预定场地更改', data)
				this.$set(this.info, 'houseInfo', data)
				if (this.type == 0) {
					if (data.houseTypeCode == '03') {
						this.$set(this.info, 'downPayment', 0);
					} else {
						this.$set(this.info, 'downPayment', this.orderDefaultMoney || 0);
					}
				}
				console.log('定金', this.info.downPayment)
			},
			getPayTypes(data) {
				console.log(data)
				this.$set(this.info, 'payTypes', data);
			},
			changePackage(data) {
				console.log('套餐',data)
				
				if (data) {
					this.info.packageName = data.packageName;
					this.$axios.get('app/foodPackage/foodPackageById/' + data.packageTypeCode).then(res => {
						console.log(res)
						var itemsFoodTree = [],
							itemsExTree = [];
						if (res.data) {
							for (var i in res.data.itemsFoodTree) {
								itemsFoodTree.push({
									id: res.data.itemsFoodTree[i].itemId,
									foodCount: res.data.itemsFoodTree[i].itemCount,
									foodPrice: res.data.itemsFoodTree[i].itemPrice,
									foodName: res.data.itemsFoodTree[i].itemName,
									isChange: res.data.itemsFoodTree[i].isChange || '0',
									packageId: res.data.itemsFoodTree[i].packageId,
								})
							}
							for (var i in res.data.itemsExTree) {
								itemsExTree.push({
									id: res.data.itemsExTree[i].itemId,
									itemCount: res.data.itemsExTree[i].itemCount,
									itemPrice: res.data.itemsExTree[i].itemPrice,
									itemName: res.data.itemsExTree[i].itemName,
									isChange: res.data.itemsExTree[i].isChange || '0',
									packageId: res.data.itemsExTree[i].packageId,
								})
							}

						}
						this.info.orderPackage = {
							itemsExTree: itemsExTree,
							itemsFoodTree: itemsFoodTree
						}
					}).catch(err => {
						this.$refs.uToast.error(err.msg);
					})
				}else{
					this.$set(this.info,'orderPackage',null);
					this.$set(this.info,'packageName','');
				}
			},
			getorderalertTime() {
				this.$axios.get('app/config/baseByStoreId/' + uni.getStorageSync('storeId')).then(res => {
					console.log('预定提醒前', res.data.orderAlertDaysBefore, '天')
					console.log(res.data, res.data.orderAlertDaysBefore)
					if (res.data.orderDefaultMoney.indexOf('.00') > -1 && res.data.orderDefaultMoney.indexOf(
							'.00') > -1) {
						this.orderDefaultMoney = res.data.orderDefaultMoney.substring(0, res.data.orderDefaultMoney
							.indexOf('.00'));
					} else
						this.orderDefaultMoney = res.data.orderDefaultMoney;
					this.orderAlertDaysBefore = Number(res.data.orderAlertDaysBefore) || 0;
					console.log(this.orderAlertDaysBefore)
					this.$set(this.info, 'downPayment', this.orderDefaultMoney || 0);


				}).catch(err => {
					this.$refs.uToast.error(err.msg);
				})
			},
			getPackageTotal(data) {
				console.log(data)
				this.$set(this.info, 'packageRealMoney', data.realMoney)
			},
			getExtraTotal(data) {
				console.log(data)
				this.$set(this.info, 'extraRealMoney', data.realMoney)
			},
			getMainPayTypeText(data) {
				console.log(data)
				this.$set(this.info, 'mainPayTypeText', data)
			},
			chooseDate() {
				this.$refs.date.show();
			},
			onConfirm(e) {
				console.log(e)
				this.$set(this.info, 'alertDate', e.value)
			},
			onCancel() {
				console.log(this.$refs.date.value, this.$refs.date.pickVal)
			},
			submit() {
				this.$refs.info.validate(val => {
					console.log(val)
					if (val) {
						var info = this.info;
						var orderTime = info.orderTime.split('  ');
						info.orderDate = orderTime[0];
						var activityTime = orderTime[1].split('~');
						info.activityBeginTime = activityTime[0];
						info.activityEndTime = activityTime[1];
						var orderPackage = {
							itemsExs: info.orderPackage && info.orderPackage.itemsExTree ? info.orderPackage
								.itemsExTree : [],
							itemsFoods: info.orderPackage && info.orderPackage.itemsFoodTree ? info
								.orderPackage.itemsFoodTree : []
						};
						var orderExtra = {
							itemsExs: info.orderExtra && info.orderExtra.itemsExTree ? info.orderExtra
								.itemsExTree : [],
							itemsFoods: info.orderExtra && info.orderExtra.itemsFoodTree ? info.orderExtra
								.itemsFoodTree : []
						};
						for (var i = 0; i < orderPackage.itemsExs.length; i++) {
							orderPackage.itemsExs[i].itemId = orderPackage.itemsExs[i].id;
						}
						for (var i = 0; i < orderPackage.itemsFoods.length; i++) {
							orderPackage.itemsFoods[i].foodId = orderPackage.itemsFoods[i].id;
						}
						for (var i = 0; i < orderExtra.itemsExs.length; i++) {
							orderExtra.itemsExs[i].itemId = orderExtra.itemsExs[i].id;
						}
						for (var i = 0; i < orderExtra.itemsFoods.length; i++) {
							orderExtra.itemsFoods[i].foodId = orderExtra.itemsFoods[i].id;
						}

						info.orderExtra = orderExtra;
						info.orderPackage = orderPackage;

						this.info = info;
						console.log(info)
						if (this.type == 0) {
							this.addSubmit();
						} else {
							this.editSubmit();
						}
					} else {
						this.$refs.uToast.error('表单填写有误');
					}
				})
			},
			selectEatTime(data){
				console.log('开餐时间',data)
				this.eatTimeText=data.text;
			},
			addSubmit() {
				var info = this.info;
				console.log(info)
				this.$axios.post('app/order/orderAdd', {
					"storeId": uni.getStorageSync('storeId'),
					"askId": this.askId,
					"orderDate": info.orderDate,
					"alertDate": info.houseInfo.houseTypeCode == '03' ? null : info.alertDate,
					"phone": info.phone,
					"customName": info.customName,
					"activityBeginTime": info.activityBeginTime,
					"activityEndTime": info.activityEndTime,
					"packageName": info.houseInfo.houseTypeCode == '03' ? null : info.packageName,
					"packageId": info.houseInfo.houseTypeCode == '03' ? null : info.packageId,
					"houseId": info.houseId,
					"mainPayTypeText": info.houseInfo.houseTypeCode == '03' ? null : info.mainPayTypeText,
					"mainPayType": info.houseInfo.houseTypeCode == '03' ? null : info.mainPayType,
					"payTypes": info.houseInfo.houseTypeCode == '03' ? null : info.payTypes,
					"orderState": info.orderState,
					"orderTypeId": info.orderTypeId,
					"customFromId": info.customFromId,
					"downPayment": info.downPayment,
					"orderPackage": info.houseInfo.houseTypeCode == '03' ? null : info.orderPackage,
					"orderExtra": info.orderExtra,
					"packageRealMoney": info.packageRealMoney, //套餐实收款
					"packageNeedMoney": info.packageNeedMoney, //套餐应收款
					"extraRealMoney": info.extraRealMoney || 0,
					"eatTime": info.eatTime,
					"orderMoney": info.orderMoney, //订单金额（总计应收款）
					"remark": info.remark
				}).then(res => {
					this.$refs.uToast.success('新增预定单成功！');
					if (this.askId) {
						uni.switchTab({
							url: '../index/index'
						})
					} else {
						uni.$emit('saveOrder',info.orderDate);
						uni.navigateBack({
							delta: 1
						})
					}
				}).catch(err => {
					this.$refs.uToast.error(err.msg);
				})
			},
			editSubmit() {
				var info = this.info;
				console.log(info)
				this.$axios.post('app/order/orderUpdate', {
					"id": this.id,
					"storeId": uni.getStorageSync('storeId'),
					"askId": info.askId,
					"orderDate": info.orderDate,
					"alertDate": info.houseInfo.houseTypeCode == '03' ? null : info.alertDate,
					"phone": info.phone,
					"customName": info.customName,
					"activityBeginTime": info.activityBeginTime,
					"activityEndTime": info.activityEndTime,
					"packageName": info.houseInfo.houseTypeCode == '03' ? null : info.packageName,
					"packageId": info.houseInfo.houseTypeCode == '03' ? null : info.packageId,
					"houseId": info.houseId,
					"mainPayTypeText": info.houseInfo.houseTypeCode == '03' ? null : info.mainPayTypeText,
					"mainPayType": info.houseInfo.houseTypeCode == '03' ? null : info.mainPayType,
					"payTypes": info.houseInfo.houseTypeCode == '03' ? null : info.payTypes,
					"orderState": info.orderState,
					"orderTypeId": info.orderTypeId,
					"customFromId": info.customFromId,
					"downPayment": info.downPayment,
					"orderPackage": info.houseInfo.houseTypeCode == '03' ? null : info.orderPackage,
					"orderExtra": info.orderExtra,
					"packageRealMoney": info.packageRealMoney, //套餐实收款
					"packageNeedMoney": info.packageNeedMoney, //套餐应收款
					"extraRealMoney": info.extraRealMoney || 0,
					"eatTime": info.eatTime,
					"orderMoney": info.orderMoney, //订单金额（总计应收款）
					"remark": info.remark
				}).then(res => {
					this.$refs.uToast.success('编辑预定单成功！');
					uni.$emit('saveOrder',info.orderDate);
					uni.navigateBack({
						delta: 1
					})
				}).catch(err => {
					this.$refs.uToast.error(err.msg);
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.order_package_manage {
		font-size: 34rpx;
		color: #0075FF;
		width: 34rpx;
		height: 34rpx;
	}

	.textarea {
		font-size: 28rpx;
		min-height: 80rpx;
		padding-bottom: 20rpx;
		width: 100%;
	}

	.common_icon {
		width: 58rpx;
		height: 58rpx;
		min-width: 58rpx;
		margin-right: 30rpx;
	}
</style>
