Quellcode durchsuchen

经销商订单实现导出功能、增减经销商筛选条件

guanglong vor 3 Jahren
Ursprung
Commit
6e3b089206

+ 8 - 2
src/api/admin/salesite.js

@@ -11,6 +11,14 @@ export function listSaleSite(urlParams, data) {
   })
 }
 
+// 查询所有经销商列表
+export function listAllSaleSite() {
+  return request({
+    url: '/api/v1/mp/admin/salesite/listAll',
+    method: 'post'
+  })
+}
+
 export function getSaleSiteDetail(channelId) {
   return request({
     url: '/api/v1/mp/admin/salesite/detail',
@@ -48,5 +56,3 @@ export function updateSaleSiteStatus(data) {
     data: data
   })
 }
-
-

+ 13 - 2
src/api/business/order.js

@@ -20,7 +20,7 @@ export function companyList(data) {
 }
 
 // 经销商盲票组列表
-export function channelList(data) {
+export function boxList(data) {
   return request({
     url: '/api/v1/mp/admin/channel/order/item/list',
     method: 'post',
@@ -108,4 +108,15 @@ export function deliverOrderExport(data) {
     method: 'post',
     data
   })
-}
+}
+
+
+// 经销商订单导出
+export function channelOrderExport(data) {
+  return request({
+    url: '/api/v1/mp/admin/channel/order/export',
+    method: 'post',
+    timeout: 15 * 60 * 1000,
+    data
+  })
+}

+ 91 - 5
src/views/order/channel/index.vue

@@ -27,6 +27,28 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item label="经销商" >
+        <el-select
+          v-model="queryParams.channelId"
+          placeholder="请选择经销商"
+          style="width: 100%;"
+          filterable
+          clearable
+          :filter-method="dataFilter"
+          @change="handleQuery"
+        >
+          <el-option
+            v-for="(item, index) in siteList"
+            :key="item.channelId"
+            :label="item.name"
+            :value="item.channelId">
+            <div>
+              <span style="float: left;">{{item.name}} </span>
+              <span style="float: right;">{{item.mobile}}</span>
+            </div>
+          </el-option>
+        </el-select>
+      </el-form-item>
       <!-- <el-form-item label="经销商">
         <el-select
           v-model="queryParams.channelId"
@@ -71,7 +93,18 @@
         >
       </el-form-item>
     </el-form>
-    <el-row :gutter="10">
+    <el-row :gutter="10" style="margin-bottom: 15px;">
+      <el-col :span="1.5">
+        <el-button
+          type="infor"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleOrderExport"
+          v-hasPermi="['order:channel:export']"
+          >导出订单</el-button
+        >
+      </el-col>
       <right-toolbar
         :showSearch.sync="showSearch"
         @queryTable="getList"
@@ -194,7 +227,8 @@
   </div>
 </template>
 <script>
-import { getOrderList, companyList, channelList } from "@/api/business/order";
+import { getOrderList, companyList, boxList, channelOrderExport} from "@/api/business/order";
+import { listAllSaleSite} from "@/api/admin/salesite";
 import { publicFileGetUrl } from "@/api/common";
 import SendGoods from "./components/SendGoods";
 export default {
@@ -235,8 +269,13 @@ export default {
       goodsInfo: {},
       // 盲票组下拉列表
       boxData: [],
+      siteList:[],
+      siteCopyList:[],
     };
   },
+  mounted() {
+    this.getSaleSiteList()
+  },
   created() {
     this.getList();
   },
@@ -273,12 +312,35 @@ export default {
     },
 
     // 盲票组列表
-    getChannelList(row) {
-      channelList({ orderId: row.orderId }).then((res) => {
+    getBoxList(row) {
+      boxList({ orderId: row.orderId }).then((res) => {
         this.boxData = res.data;
       });
     },
 
+    // 获取经销商下拉列表
+    getSaleSiteList(){
+      listAllSaleSite({}).then(response => {
+         this.siteList = response.data || [];
+         this.siteCopyList = response.data || [];
+      });
+    },
+
+
+    dataFilter(val) {
+      this.value = val;
+      if (val) { //val存在
+        this.siteList = this.siteCopyList.filter((item) => {
+          if (!!~item.mobile.indexOf(val) || !!~item.mobile.toUpperCase().indexOf(val.toUpperCase())
+                 || !!~item.name.indexOf(val) || !!~item.name.indexOf(val)) {
+             return true
+          }
+        })
+      } else { //val为空时,还原数组
+        this.siteList = this.siteCopyList;
+      }
+    },
+
     //搜索
     handleQuery() {
       this.getList();
@@ -327,7 +389,7 @@ export default {
     toGoods(row) {
       this.goodsShow = true;
       this.goodsInfo = row;
-      this.getChannelList(row);
+      this.getBoxList(row);
     },
 
     // 关闭发货弹框
@@ -335,6 +397,30 @@ export default {
       this.goodsShow = false;
       this.getList();
     },
+
+    // 导出订单
+    handleOrderExport() {
+      this.$confirm("是否确认导出订单?", "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          this.vloading = this.$loading({
+            lock: true,
+            text: "正在导出订单.....",
+            background: "rgba(0, 0, 0, 0.7)",
+          });
+          return channelOrderExport(this.queryParams);
+        })
+        .then((response) => {
+          this.vloading.close();
+          this.download(response.msg);
+        })
+        .catch(() => {
+          this.vloading.close();
+        });
+    },
   },
 };
 </script>

+ 1 - 1
src/views/order/deliver/index.vue

@@ -69,7 +69,7 @@
         <el-button
           type="infor"
           plain
-          icon="el-icon-printer"
+          icon="el-icon-download"
           size="small"
           @click="handleExportDraw"
           v-hasPermi="['order:deliver:export']"