Sfoglia il codice sorgente

团餐订单页面增加子订单的展开合起功能;
团餐设置页面增加判断值,企业设置只有午餐数据;

郭鹏飞 10 mesi fa
parent
commit
447af1cc0c
2 ha cambiato i file con 55 aggiunte e 30 eliminazioni
  1. 31 13
      pages/groupMeal/orders/order-alist.vue
  2. 24 17
      pages/groupMeal/users/settings.vue

+ 31 - 13
pages/groupMeal/orders/order-alist.vue

@@ -74,16 +74,21 @@
 									<u-checkbox :name="item.orderId" shape="circle" v-model="item.checked"></u-checkbox>
 									<u-checkbox :name="item.orderId" shape="circle" v-model="item.checked"></u-checkbox>
 								</view>
 								</view>
 							</view>
 							</view>
-							<view class="order-card" v-for="(eItem, ei) in item.merchantPackageOrderDTOS" :key="ei">
-								<u-image width="84rpx" height="84rpx" border-radius="12rpx" :src="eItem.productImage && `${$config.apiUrl}/${eItem.productImage.split(',')[0]}`" mode="aspectFill"></u-image>
-								<view class="order-info">
-									<view class="order-title">{{ eItem.packageName }}</view>
-									<view class="order-line">
-										<view class="leader-name">{{ eItem.dishName }}</view>
-										<view class="quantity-tag">{{ eItem.numberUserCount }}份</view>
+							
+							<ListExpand :items="item.merchantPackageOrderDTOS">
+								<template v-slot:="{ items }">
+									<view class="order-card" v-for="(eItem, ei) in items" :key="ei">
+										<u-image width="84rpx" height="84rpx" border-radius="12rpx" :src="eItem.productImage && `${$config.apiUrl}/${eItem.productImage.split(',')[0]}`" mode="aspectFill"></u-image>
+										<view class="order-info">
+											<view class="order-title">{{ eItem.packageName }}</view>
+											<view class="order-line">
+												<view class="leader-name">{{ eItem.dishName }}</view>
+												<view class="quantity-tag">{{ eItem.numberUserCount }}份</view>
+											</view>
+										</view>
 									</view>
 									</view>
-								</view>
-							</view>
+								</template>
+							</ListExpand>
 						</view>
 						</view>
 					</u-checkbox-group>
 					</u-checkbox-group>
 				</template>
 				</template>
@@ -113,11 +118,13 @@
 <script>
 <script>
 import Modal from '@/components/modal/index.vue';
 import Modal from '@/components/modal/index.vue';
 import Tabbar from '@/pages/groupMeal/tabbar/index.vue';
 import Tabbar from '@/pages/groupMeal/tabbar/index.vue';
+import ListExpand from '@/components/list-scroll-view/list-expand.vue';
 import ListScrollView from '@/components/list-scroll-view/index.vue';
 import ListScrollView from '@/components/list-scroll-view/index.vue';
 export default {
 export default {
 	components: {
 	components: {
 		Modal,
 		Modal,
 		Tabbar,
 		Tabbar,
+		ListExpand,
 		ListScrollView
 		ListScrollView
 	},
 	},
 	data() {
 	data() {
@@ -174,14 +181,12 @@ export default {
 		},
 		},
 		toggleManageMode() {
 		toggleManageMode() {
 			this.isManaging = !this.isManaging;
 			this.isManaging = !this.isManaging;
-			this.selectedOrders = [];
-			this.isAllSelected = false;
+			this.onClearSel();
 		},
 		},
 		onTabChange(e) {
 		onTabChange(e) {
 			this.currentStatusTab = e;
 			this.currentStatusTab = e;
 			// 清除已选数据
 			// 清除已选数据
-			this.selectedOrders = [];
-			this.isAllSelected = false;
+			this.onClearSel();
 			// 关闭批量
 			// 关闭批量
 			this.isManaging = false;
 			this.isManaging = false;
 			// 触发更新
 			// 触发更新
@@ -210,6 +215,11 @@ export default {
 				item.checked = e.value;
 				item.checked = e.value;
 			});
 			});
 		},
 		},
+		// 完成某种操作后,清空数据
+		onClearSel() {
+			this.selectedOrders = []; 
+			this.isAllSelected = false;
+		},
 		handleBatchAction() {
 		handleBatchAction() {
 			if (this.selectedOrders.length === 0) {
 			if (this.selectedOrders.length === 0) {
 				this.$tip.toast("请先选择订单")
 				this.$tip.toast("请先选择订单")
@@ -223,6 +233,13 @@ export default {
 				this.$http.get('/groupmeal/merchantPackageOrder/orderReady', {params}).then(res => {
 				this.$http.get('/groupmeal/merchantPackageOrder/orderReady', {params}).then(res => {
 					if (res.data.code === 200) {
 					if (res.data.code === 200) {
 						this.$tip.success(res.data.message);
 						this.$tip.success(res.data.message);
+						// 触发更新
+						this.isManaging = false;
+						this.currentStatusTab = 1;
+						this.onClearSel();
+						this.$nextTick(() => {
+							this.$refs.listScroll.downCallback();
+						});
 					} else {
 					} else {
 						this.$tip.error(res.data.message);
 						this.$tip.error(res.data.message);
 					}
 					}
@@ -352,6 +369,7 @@ export default {
 					display: flex;
 					display: flex;
 					align-items: center;
 					align-items: center;
 					.leader-name {
 					.leader-name {
+						flex: 1;
 						font-weight: 400;
 						font-weight: 400;
 						font-size: 22rpx;
 						font-size: 22rpx;
 						color: #8A91A8;
 						color: #8A91A8;

+ 24 - 17
pages/groupMeal/users/settings.vue

@@ -3,23 +3,25 @@
 		<u-navbar title="团餐设置" :autoBack="true" :placeholder="true" :border-bottom="false"></u-navbar>
 		<u-navbar title="团餐设置" :autoBack="true" :placeholder="true" :border-bottom="false"></u-navbar>
 		
 		
 		<u-form :model="form" :rules="rules" ref="formRef" labelPosition="left" labelWidth="auto">
 		<u-form :model="form" :rules="rules" ref="formRef" labelPosition="left" labelWidth="auto">
-			<view class="meal-section" v-for="(meal, index) in form.mealTimes" :key="index">
-				<view class="section-title">{{ meal.name }}</view>
+			<template v-for="(meal, index) in form.mealTimes">
+				<view class="meal-section" :key="index" v-if="isGroup(meal)">
+					<view class="section-title">{{ meal.name }}</view>
+					
+					<u-form-item :label="`拼团最低起送量`" :prop="`mealTimes.${index}.minGroupSize`" borderBottom :required="isEdited(index)">
+						<u-input v-model="meal.minGroupSize" type="number" placeholder="输入数量" height="41" inputAlign="right"></u-input>
+					</u-form-item>
+					
+					<u-form-item :label="`开团时间`" :prop="`mealTimes.${index}.startTime`" borderBottom :required="isEdited(index)">
+						<u-input v-model="meal.startTime" :clearable="false" placeholder="去设置" height="41" inputAlign="right" @click="openTimePicker(index, 'startTime')"></u-input>
+						<u-icon slot="right" name="arrow-right"></u-icon>
+					</u-form-item>
 				
 				
-				<u-form-item :label="`拼团最低起送量`" :prop="`mealTimes.${index}.minGroupSize`" borderBottom :required="isEdited(index)">
-					<u-input v-model="meal.minGroupSize" type="number" placeholder="输入数量" height="41" inputAlign="right"></u-input>
-				</u-form-item>
-				
-				<u-form-item :label="`开团时间`" :prop="`mealTimes.${index}.startTime`" borderBottom :required="isEdited(index)">
-					<u-input v-model="meal.startTime" :clearable="false" placeholder="去设置" height="41" inputAlign="right" @click="openTimePicker(index, 'startTime')"></u-input>
-					<u-icon slot="right" name="arrow-right"></u-icon>
-				</u-form-item>
-
-				<u-form-item :label="`闭团时间`" :prop="`mealTimes.${index}.endTime`" @click="openTimePicker(index, 'endTime')" :required="isEdited(index)">
-					<u-input v-model="meal.endTime" :clearable="false" placeholder="去设置" height="41" inputAlign="right" @click="openTimePicker(index, 'endTime')"></u-input>
-					<u-icon slot="right" name="arrow-right"></u-icon>
-				</u-form-item>
-			</view>
+					<u-form-item :label="`闭团时间`" :prop="`mealTimes.${index}.endTime`" @click="openTimePicker(index, 'endTime')" :required="isEdited(index)">
+						<u-input v-model="meal.endTime" :clearable="false" placeholder="去设置" height="41" inputAlign="right" @click="openTimePicker(index, 'endTime')"></u-input>
+						<u-icon slot="right" name="arrow-right"></u-icon>
+					</u-form-item>
+				</view>
+			</template>
 		</u-form>
 		</u-form>
 
 
 		<view class="footer-bar">
 		<view class="footer-bar">
@@ -110,13 +112,18 @@ export default {
 								id: item.category,  
 								id: item.category,  
 								startTime: item.strStartTime, 
 								startTime: item.strStartTime, 
 								endTime: item.strEndTime,
 								endTime: item.strEndTime,
-								minGroupSize: item.minGroupSize,
+								minGroupSize: item.minGroupSize + '',
 							});
 							});
 						}
 						}
 					});
 					});
 				}
 				}
 			});
 			});
 		},
 		},
+		isGroup(e) {
+			let flag = true;
+			if (this.query.isEnterprise == 2 && e.id != 2) flag = false;
+			return flag;
+		},
 		// 判断一个餐次区块是否被编辑过
 		// 判断一个餐次区块是否被编辑过
 		isEdited(index) {
 		isEdited(index) {
 			const meal = this.form.mealTimes[index];
 			const meal = this.form.mealTimes[index];