shish vor 16 Stunden
Ursprung
Commit
bd7228640f
1 geänderte Dateien mit 20 neuen und 1 gelöschten Zeilen
  1. 20 1
      ghs/src/views/order/list.vue

+ 20 - 1
ghs/src/views/order/list.vue

@@ -220,7 +220,7 @@
       </template>
 
 			<template #slot-export-order>
-				<el-button type="primary" size="mini" style="margin-left:10px;" @click="exportData()">导出数据</el-button>
+				<el-button type="primary" size="mini" style="margin-left:10px;" @click="exportData()">导出{{ searchTimeTypeName }}</el-button>
 			</template>
 
 			<template #slot-more-do-btn>
@@ -417,6 +417,18 @@ export default {
       totalTkPrice:0
     };
   },
+  computed: {
+    /** 当前筛选时间类型文案,导出按钮和提示共用 */
+    searchTimeTypeName() {
+      if (this.searchTimeType === 2) {
+        return '发货时间'
+      }
+      if (this.searchTimeType === 1) {
+        return '账单时间'
+      }
+      return '开单时间'
+    }
+  },
   created() {
     this.init();
   },
@@ -851,7 +863,14 @@ export default {
     handleClick(tab, e) {
       this.app.refresh(this.getListSearchParams());
     },
+		/**
+		 * 导出当前列表:区间跟开单/发货/账单类型走,须先选时间段,最长一个月。
+		 */
 		exportData(){
+			if (!this.searchTime) {
+				this.$message.warning('请选 ' + this.searchTimeTypeName + ' 和时间段')
+				return
+			}
 			this.$service.order.getOrderList(this.getListSearchParams({ pageSize: 9999999, export: 1 })).then(res => {
 				if(res.file){
 					window.location.href = res.file