Browse Source

Merge branch 'sit'

xiaodai2022 2 years ago
parent
commit
2980e7077d

File diff suppressed because it is too large
+ 10 - 0
dist/static/js/0.js


+ 42 - 0
src/views/youzan/othTransferOrderLog/columns.js

@@ -69,6 +69,16 @@ const columns = [
   //   label: "所属平台",
   //   minWidth:"100px",
   // },
+  {
+    prop: "good_name",
+    label: "商品名称",
+    minWidth: "160px",
+  },
+  {
+    prop: "reason",
+    label: "转单失败原因",
+    minWidth: "160px",
+  },
   {
     prop: "addtime",
     label: "平台下单时间",
@@ -526,6 +536,36 @@ const express_columns = [
     span: 8,
   },
 ];
+const tHeader = [
+  "记录ID",
+  "平台订单号",
+  "平台商品编码",
+  "支付类型",
+  "状态",
+  "单价",
+  "数量",
+  "订单总金额",
+  "销售订单号",
+  "线上商品单号",
+  "商品名称",
+  "转单失败原因",
+  "平台下单时间",
+];
+const filterVal = [
+  "id",
+  "tid",
+  "plat_code",
+  "pay_type",
+  "status",
+  "discount_price",
+  "num",
+  "total_fee",
+  "orderCode",
+  "skuCode",
+  "good_name",
+  "reason",
+  "addtime",
+];
 export {
   columns,
   detail_columns,
@@ -534,4 +574,6 @@ export {
   express_columns,
   pay_type_list,
   status_list,
+  tHeader,
+  filterVal,
 };

+ 59 - 1
src/views/youzan/othTransferOrderLog/index.vue

@@ -100,6 +100,7 @@
                   </el-select>
                 </el-input>
               </el-col>
+
               <el-col
                 :span="3"
                 class="fr"
@@ -114,6 +115,20 @@
                   批量删除
                 </el-button>
               </el-col>
+              <el-col
+                :span="3"
+                class="fr"
+                style="width: 90px; padding: 0 0 0 10px"
+                v-if="powers.some((i) => i == '087')"
+              >
+                <el-button
+                  type="success"
+                  :size="searchSize"
+                  @click="batchExport(selection)"
+                >
+                  订单导出
+                </el-button>
+              </el-col>
             </el-row>
           </div>
         </template>
@@ -195,7 +210,8 @@ import asyncRequest from "@/apis/service/youzan/othTransferOrderLog";
 import mixinPage from "@/mixins/elPaginationHandle";
 import { mapGetters } from "vuex";
 import resToken from "@/mixins/resToken";
-import { columns, pay_type_list, status_list } from "./columns";
+import { columns, pay_type_list, status_list, tHeader, filterVal } from "./columns";
+import { formatJson } from "@/utils/publicMethods";
 export default {
   name: "othTransferOrderLog",
   mixins: [mixinPage, resToken],
@@ -410,6 +426,48 @@ export default {
       }
       this.loading = false;
     },
+    /**
+     *  批量导出
+     * @param {Array} selection 当前选择项
+     */
+    batchExport(selection) {
+      if (!this.loading) {
+        if (selection.length == 0) {
+          this.$message.warning("请至少选择一条数据!");
+          return;
+        }
+
+        console.log(selection);
+
+        this.loading = true;
+        let data = [].concat(...selection);
+        let list = [];
+        data.forEach((item) => {
+          let model = Object.assign({}, item);
+          model.status =
+            (this.status_list.find((item) => item.value == model.status + "") || {})
+              .label || "--";
+          model.pay_type =
+            (this.pay_type_list.find((item) => item.value == model.pay_type + "") || {})
+              .label || "--";
+          list.push(model);
+        });
+        console.log(list);
+        const xlsName = `有赞转单记录批量导出`;
+        import("@/vendor/Export2Excel").then((excel) => {
+          const data = formatJson(filterVal, list);
+          excel.export_json_to_excel({
+            header: tHeader,
+            data,
+            filename: `${xlsName}`,
+          });
+          this.$message.success(`${xlsName}成功!`);
+          setTimeout(() => {
+            this.loading = false;
+          }, 500);
+        });
+      }
+    },
   },
 };
 </script>

Some files were not shown because too many files changed in this diff