From 0cd9447ee893a8490488aca6a6a073b040fcd7f6 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期三, 10 七月 2024 16:53:18 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 admin/src/components/business/OperaCategoryImportWindow.vue |   82 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 82 insertions(+), 0 deletions(-)

diff --git a/admin/src/components/business/OperaCategoryImportWindow.vue b/admin/src/components/business/OperaCategoryImportWindow.vue
new file mode 100644
index 0000000..36a6a4d
--- /dev/null
+++ b/admin/src/components/business/OperaCategoryImportWindow.vue
@@ -0,0 +1,82 @@
+<template>
+  <el-dialog
+      class="center-title"
+      :title="title"
+      width="500px"
+      top="30vh"
+      :visible.sync="visible"
+      :confirm-working="isWorking"
+      @confirm="confirm"
+  >
+    <p class="tip-warn"><i class="el-icon-warning"></i>瀵煎叆璇存槑锛�<br>
+      1.璇峰厛涓嬭浇鏂囦欢妯℃澘锛屽苟鎸夌収妯℃澘瑕佸幓濉啓琛ㄦ牸鍐呭;<br>
+    </p>
+    <el-form class="demo-form-inline" >
+      <el-form-item label="缁勭粐淇℃伅娓呭崟" required>
+        <div style="width: 100%;display: flex;align-items: center;">
+          <el-button type="primary"   @click="clickRef">鐐瑰嚮涓婁紶</el-button>
+          <el-button type="text" @click="exportTemplate">鐐瑰嚮涓嬭浇妯$増.EXCEL</el-button>
+        </div>
+        <div style="font-size: 14px; color: black;" v-if="fileName">{{fileName}}</div>
+      </el-form-item>
+    </el-form>
+    <input type="file" style="position: fixed; left: 0; top: -50px;" accept=".xlsx" ref="fileExcel" @change="result" />
+    <template   v-slot:footer>
+      <el-button @click="visible=false">杩斿洖</el-button>
+    </template>
+  </el-dialog>
+</template>
+
+<script>
+import BaseOpera from '@/components/base/BaseOpera'
+import GlobalWindow from '@/components/common/GlobalWindow'
+import {importCategoryBatch} from '@/api/business/shop'
+export default {
+  name: 'OperaShopImportWindow',
+  extends: BaseOpera,
+  // eslint-disable-next-line vue/no-unused-components
+  components: { GlobalWindow },
+  data () {
+    return {
+      importing:false,
+      fileName: '',
+    }
+  },
+  methods: {
+    open (title, companyType) {
+      this.title = title
+      this.fileName = ''
+      this.visible = true
+    },
+    // 瀵煎嚭妯℃澘
+    exportTemplate () {
+      // 鎶曚繚鐢宠
+      window.open('/template/category.xlsx')
+    },
+    clickRef () {
+      this.$refs.fileExcel.click()
+    },
+    result (e) {
+      const data = new FormData()
+      data.append('file', e.target.files[0])
+      data.append('companyType', this.companyType)
+      importCategoryBatch(data)
+        .then(res => {
+          this.$tip.apiSuccess('鍙戣捣鎵归噺涓婁紶浠诲姟鎴愬姛锛岃绋嶅悗鍒锋柊椤甸潰鏌ョ湅')
+          this.$emit('success')
+          this.visible = false
+        })
+        .catch(err => {
+          this.fileName = ''
+        })
+        .finally(() => {
+          this.$refs.fileExcel.value = null
+        })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

--
Gitblit v1.9.3