阿拉蕾 1 rok pred
rodič
commit
3ad6ebef86

+ 1 - 1
package.json

@@ -1,7 +1,7 @@
 {
   "name": "fs",
   "version": "1.1.0",
-  "description": "云联融智医药管理系统",
+  "description": "润天智慧云医数字DTC客户服务管理系统",
   "author": "FS",
   "license": "MIT",
   "scripts": {

+ 8 - 2
src/api/store/storeProduct.js

@@ -17,7 +17,7 @@ export function getStoreProduct(productId) {
   })
 }
 
- 
+
 export function addOrEdit(data) {
   return request({
     url: '/store/storeProduct/addOrEdit',
@@ -26,7 +26,13 @@ export function addOrEdit(data) {
   })
 }
 
- 
+export function importTemplate() {
+  return request({
+    url: '/store/storeProduct/importTemplate',
+    method: 'get'
+  })
+}
+
 
 // 删除商品
 export function delStoreProduct(productId) {

+ 1 - 1
src/layout/components/Sidebar/Logo.vue

@@ -26,7 +26,7 @@ export default {
   },
   data() {
     return {
-      title: '云联融智云医',
+      title: '润天智慧云医',
       logo: logoImg
     }
   }

+ 5 - 5
src/views/login.vue

@@ -1,9 +1,9 @@
 <template>
    <div class="login" id="loginBox">
     <div class="login-con">
-        <div class="title">云联融智客户服务管理系统</div>
+        <div class="title">润天智慧云医数字DTC客户服务管理系统</div>
         <el-form   ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
-      
+
         <el-form-item prop="username">
           <el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
             <svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
@@ -51,7 +51,7 @@
     </div>
     <!--  底部  -->
     <div class="el-login-footer">
-      <span>Copyright © 2023 <a href="https://beian.miit.gov.cn/" target="_blank">渝ICP备190140XX号-7</a></span>
+      <span>Copyright © 2023 <a href="https://beian.miit.gov.cn/" target="_blank">渝ICP备19014022号-7</a></span>
     </div>
   </div>
 </template>
@@ -96,14 +96,14 @@ export default {
     }
   },
   mounted () {
-    
+
   },
   created() {
     this.getCode();
     this.getCookie();
   },
   methods: {
-       
+
     getCode() {
       getCodeImg().then(res => {
         this.codeUrl = "data:image/gif;base64," + res.img;

+ 81 - 5
src/views/store/storeProduct/index.vue

@@ -83,7 +83,16 @@
           v-hasPermi="['store:storeProduct:remove']"
         >删除</el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="info"
+          plain
+          icon="el-icon-upload2"
+          size="mini"
+          @click="handleImport"
 
+        >导入</el-button>
+      </el-col>
       <el-col :span="1.5">
         <el-button
           type="warning"
@@ -247,7 +256,7 @@
                 </div>
               </el-form-item>
             </el-col>
-            
+
              <el-col :span="24" v-if="createBnt">
               <el-form-item>
                 <el-button type="primary" size="small" icon="md-add" @click="addBtn" class="mr15">添加新规格</el-button>
@@ -275,7 +284,7 @@
               <!-- 多规格表格-->
               <el-col :span="24">
                 <el-form-item label="商品属性:" class="labeltop">
-                  
+
                   <el-table :data="manyFormValidate" size="small" style="width: 90%;">
                     <el-table-column type="myindex" v-for="(item,index) in form.header" :key="index"  :width="item.minWidth" :label="item.title" :property="item.slot" align="center">
                       <template slot-scope="scope">
@@ -299,7 +308,7 @@
               </el-col>
             </el-col>
           </el-col>
-          
+
           <!-- 单规格表格-->
           <el-col :xl="23" :lg="24" :md="24" :sm="24" :xs="24" v-if="form.specType === 0">
             <el-form-item >
@@ -494,16 +503,44 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+      <el-upload
+        ref="upload"
+        :limit="1"
+        accept=".xlsx, .xls"
+        :headers="upload.headers"
+        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :disabled="upload.isUploading"
+        :on-progress="handleFileUploadProgress"
+        :on-success="handleFileSuccess"
+        :auto-upload="false"
+        drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+        <div class="el-upload__tip text-center" slot="tip">
+          <div class="el-upload__tip" slot="tip">
+       <!--     <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的数据 -->
+          </div>
+          <span>仅允许导入xls、xlsx格式文件。</span>
+          <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
+        </div>
+      </el-upload>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFileForm">确 定</el-button>
+        <el-button @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
 
   </div>
 </template>
 
 <script>
-import {genFormatAttr, listStoreProduct, getStoreProduct, delStoreProduct, addOrEdit, exportStoreProduct } from "@/api/store/storeProduct";
+import {genFormatAttr, listStoreProduct, getStoreProduct, delStoreProduct, addOrEdit, exportStoreProduct,importTemplate } from "@/api/store/storeProduct";
 import { getAllStoreProductCategory } from "@/api/store/storeProductCategory";
 import { getAllStoreProductRule } from "@/api/store/storeProductRule";
 import { getAllShippingTemplates } from "@/api/store/shippingTemplates";
-
+import { getToken } from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import Editor from '@/components/Editor/wang';
@@ -527,6 +564,20 @@ export default {
   },
   data() {
     return {
+      upload: {
+        // 是否显示弹出层
+        open: false,
+        // 弹出层标题
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/store/storeProduct/importData"
+      },
       productTuiCateOptions:[],
       showIput: false,
       createBnt:true,
@@ -668,6 +719,31 @@ export default {
     this.getList();
   },
   methods: {
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
+      this.getList();
+    },
+    handleImport() {
+      this.upload.title = "商品导入";
+      this.upload.open = true;
+    },
+    importTemplate() {
+      importTemplate().then(response => {
+        this.download(response.msg);
+      });
+    },
     // 删除表格中的属性
     delAttrTable (index) {
       this.manyFormValidate.splice(index, 1);

+ 2 - 2
vue.config.js

@@ -6,14 +6,14 @@ const defaultSettings = require('./src/settings.js')
 const CompressionWebpackPlugin = require('compression-webpack-plugin')
 // 定义压缩文件类型 压缩JS大小
 const productionGzipExtensions = ['js', 'css']
- 
+
 
 
 function resolve(dir) {
   return path.join(__dirname, dir)
 }
 
-const name = defaultSettings.title || '云联融智医药管理系统' // 标题
+const name = defaultSettings.title || '润天智慧云医' // 标题
 
 const port = process.env.port || process.env.npm_config_port || 80 // 端口