shish пре 16 часа
родитељ
комит
9f1a8e2e16
1 измењених фајлова са 53 додато и 38 уклоњено
  1. 53 38
      hd/src/views/order/list.vue

+ 53 - 38
hd/src/views/order/list.vue

@@ -1,6 +1,6 @@
 <!--
   花掌柜 PC 端订单列表改版
-  表头字段、图1搜索、批量发货/送达,以及商品详情/跑腿/售后/打印/确认等操作(对齐 hdApp 订单接口)
+  表头字段、图1搜索、批量发货/送达;操作栏样式对齐 ghs 订单列表,低频操作收进「更多」
 -->
 <template>
 	<div class="app-list-content">
@@ -142,67 +142,57 @@
 				<span>{{ formatPayTime(scope.row.payTime) }}</span>
 			</template>
 
-			<!-- 操作列 -->
+			<!-- 操作列:主按钮对齐 ghs 订单列表;低频操作收进「更多」 -->
 			<template #slot-column-option="{scope}">
 				<div class="op-btns" @click.stop>
-					<el-button type="text" size="mini" @click="openGoodsDetail(scope.row)">商品详情</el-button>
+					<el-button size="small" type="success" @click="openGoodsDetail(scope.row)">商品详情</el-button>
 					<el-button
-						type="text"
-						size="mini"
+						size="small"
+						:type="canCallDelivery(scope.row) ? 'primary' : ''"
 						:disabled="!canCallDelivery(scope.row)"
 						@click="openCallDelivery(scope.row)"
 					>{{ expressBtnText(scope.row) }}</el-button>
 					<el-button
-						type="text"
-						size="mini"
+						size="small"
+						:type="canRefund(scope.row) ? 'primary' : ''"
 						:disabled="!canRefund(scope.row)"
 						@click="openRefund(scope.row)"
 					>发起售后</el-button>
 					<el-button
-						type="text"
-						size="mini"
+						size="small"
+						:type="isPaid(scope.row) ? 'primary' : ''"
 						:disabled="!isPaid(scope.row)"
 						@click="printA4(scope.row)"
 						style="display:none"
 					>打印A4</el-button>
 					<el-button
-						type="text"
-						size="mini"
+						size="small"
+						:type="isPaid(scope.row) ? 'primary' : ''"
 						:disabled="!isPaid(scope.row)"
 						@click="printA4Local(scope.row)"
 					>打A4</el-button>
 					<el-button
-						type="text"
-						size="mini"
+						size="small"
+						:type="isPaid(scope.row) ? 'primary' : ''"
 						:disabled="!isPaid(scope.row)"
 						@click="printGreetingCard(scope.row)"
 						style="display:none"
 					>打印贺卡</el-button>
 					<el-button
-						type="text"
-						size="mini"
-						:disabled="!canSend(scope.row)"
-						@click="confirmSend(scope.row)"
-					>确认发货</el-button>
-					<el-button
-						type="text"
-						size="mini"
-						:disabled="!canReach(scope.row)"
-						@click="confirmReach(scope.row)"
-					>确认送达</el-button>
-					<el-button
-						type="text"
-						size="mini"
-						:disabled="!canSendWork(scope.row)"
-						@click="confirmSendWork(scope.row)"
-					>制作通知</el-button>
-					<el-button
-						type="text"
-						size="mini"
+						size="small"
+						:type="isPaid(scope.row) ? 'primary' : ''"
 						:disabled="!isPaid(scope.row)"
 						@click="confirmPrintTicket(scope.row)"
 					>打小票</el-button>
-					<el-button type="text" size="mini" @click="openRefundRecord(scope.row)">售后记录</el-button>
+					<el-dropdown style="margin-left:10px;" @command="doMore($event, scope.row)">
+						<el-button type="primary" size="small">更多<i class="el-icon-arrow-down el-icon--right"></i></el-button>
+						<el-dropdown-menu slot="dropdown">
+							<el-dropdown-item command="confirmSend" :disabled="!canSend(scope.row)">确认发货</el-dropdown-item>
+							<el-dropdown-item command="confirmReach" :disabled="!canReach(scope.row)">确认送达</el-dropdown-item>
+							<el-dropdown-item command="confirmSendWork" :disabled="!canSendWork(scope.row)">制作通知</el-dropdown-item>
+							<el-dropdown-item command="refundRecord">售后记录</el-dropdown-item>
+						</el-dropdown-menu>
+					</el-dropdown>
 				</div>
 			</template>
 		</x-crud>
@@ -518,6 +508,28 @@ export default {
 				})
 				.catch(() => {});
 		},
+		/**
+		 * 「更多」下拉:确认发货 / 确认送达 / 制作通知 / 售后记录
+		 * @param {string} cmd 下拉 command
+		 * @param {object} row 当前订单行
+		 */
+		doMore(cmd, row) {
+			if (cmd === 'confirmSend') {
+				this.confirmSend(row);
+				return;
+			}
+			if (cmd === 'confirmReach') {
+				this.confirmReach(row);
+				return;
+			}
+			if (cmd === 'confirmSendWork') {
+				this.confirmSendWork(row);
+				return;
+			}
+			if (cmd === 'refundRecord') {
+				this.openRefundRecord(row);
+			}
+		},
 		/**
 		 * 确认发货:自取走 fetch,配送走 send(图6)
 		 */
@@ -698,7 +710,7 @@ export default {
 					op: {
 						visible: true,
 						props: {
-							width: 360,
+							width: 520,
 							align: 'center',
 							fixed: 'right',
 							label: '操作'
@@ -753,12 +765,15 @@ export default {
 }
 .op-btns {
 	display: flex;
-	flex-wrap: wrap;
+	flex-wrap: nowrap;
+	align-items: center;
 	justify-content: center;
 	line-height: 1.2;
 	.el-button {
-		margin: 0 2px;
-		padding: 0 4px;
+		margin: 0 4px;
+	}
+	.el-dropdown {
+		margin-left: 4px;
 	}
 }
 .ellipsis {