瀏覽代碼

销售账号导入

三七 3 天之前
父節點
當前提交
15aff0c61e
共有 2 個文件被更改,包括 61 次插入32 次删除
  1. 11 9
      src/views/company/companyDept/index.vue
  2. 50 23
      src/views/company/companyUser/index.vue

+ 11 - 9
src/views/company/companyDept/index.vue

@@ -48,6 +48,8 @@
       default-expand-all
       :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
     >
+
+      <el-table-column prop="deptId" label="部门编号" width="260"></el-table-column>
       <el-table-column prop="deptName" label="部门名称" width="260"></el-table-column>
       <el-table-column prop="orderNum" label="排序" width="200"></el-table-column>
       <el-table-column prop="status" label="状态" :formatter="statusFormat" width="100"></el-table-column>
@@ -58,17 +60,17 @@
       </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
-          <el-button 
-            size="mini" 
-            type="text" 
-            icon="el-icon-edit" 
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['company:dept:edit']"
           >修改</el-button>
-          <el-button 
-            size="mini" 
-            type="text" 
-            icon="el-icon-plus" 
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-plus"
             @click="handleAdd(scope.row)"
             v-hasPermi="['company:dept:add']"
           >新增</el-button>
@@ -319,4 +321,4 @@ export default {
     }
   }
 };
-</script>
+</script>

+ 50 - 23
src/views/company/companyUser/index.vue

@@ -49,9 +49,9 @@
           <el-col :span="1.5">
             <el-button  plain type="danger" icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['company:user:remove']">删除</el-button>
           </el-col>
-          <!-- <el-col :span="1.5">
+          <el-col :span="1.5">
             <el-button  plain type="info" icon="el-icon-upload2" size="mini" @click="handleImport" v-hasPermi="['company:user:import']">导入</el-button>
-          </el-col> -->
+          </el-col>
           <el-col :span="1.5">
             <el-button  plain type="warning" icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['company:user:export']">导出</el-button>
           </el-col>
@@ -80,7 +80,7 @@
               size="mini"
               :disabled="multiple"
               @click="handerCompanyUserAreaList"
-            >批量设置销售所属区域(原有的暂用)</el-button>
+            >批量设置销售所属区域</el-button>
           </el-col>
           <el-col :span="1.5">
             <el-button
@@ -523,6 +523,33 @@
       </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">
+          </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>
@@ -639,21 +666,21 @@ export default {
         children: "children",
         label: "label",
       },
-      // // 用户导入参数
-      // upload: {
-      //   // 是否显示弹出层(用户导入)
-      //   open: false,
-      //   // 弹出层标题(用户导入)
-      //   title: "",
-      //   // 是否禁用上传
-      //   isUploading: false,
-      //   // 是否更新已经存在的用户数据
-      //   updateSupport: 0,
-      //   // 设置上传的请求头部
-      //   headers: { Authorization: "Bearer " + getToken() },
-      //   // 上传的地址
-      //   url: process.env.VUE_APP_BASE_API + "/system/user/importData",
-      // },
+      // 用户导入参数
+      upload: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/company/user/importCompanyUser",
+      },
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -1209,11 +1236,11 @@ export default {
         })
         .catch(function () {});
     },
-    // /** 导入按钮操作 */
-    // handleImport() {
-    //   this.upload.title = "用户导入";
-    //   this.upload.open = true;
-    // },
+    /** 导入按钮操作 */
+    handleImport() {
+      this.upload.title = "用户导入";
+      this.upload.open = true;
+    },
     /** 下载模板操作 */
     importTemplate() {
       importTemplate().then((response) => {