From 46f46a3ea84dac4cd0e6ff8b038e2d7b9e97380e Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期一, 28 十一月 2022 16:13:13 +0800
Subject: [PATCH] 店铺管理优化
---
src/views/systemSetting/platform/cockpitManage/index.vue | 59 ++++++++++++++++++++++++++++++++---------------------------
1 files changed, 32 insertions(+), 27 deletions(-)
diff --git a/src/views/systemSetting/platform/cockpitManage/index.vue b/src/views/systemSetting/platform/cockpitManage/index.vue
index 80b04b9..ce70c66 100644
--- a/src/views/systemSetting/platform/cockpitManage/index.vue
+++ b/src/views/systemSetting/platform/cockpitManage/index.vue
@@ -12,7 +12,9 @@
<div class="search-item">
<span>鐘舵��:</span>
<div class="option">
- <el-input v-model="searchStatus" placeholder="閫夋嫨鐘舵��"></el-input>
+ <el-select v-model="searchStatus" placeholder="閫夋嫨鐘舵��">
+ <el-option v-for="{ label, value } in statusOptions" :key="value" :label="label" :value="value"></el-option>
+ </el-select>
</div>
</div>
<div class="findBtn">
@@ -30,7 +32,6 @@
:http-request="importTable"
:show-file-list="false"
:auto-upload="true"
- multiple
:limit="1">
<el-button type="primary">瀵煎叆</el-button>
</el-upload>
@@ -135,7 +136,8 @@
import updateUser from "./updateUser";
import detailUser from "./detailUser";
import { deleteTeam, exportTeamInfo, importTeamInfo, searchTeamInfo } from "@/api/system/portal/teamConstruction";
-import {SUCCESS_CODE} from "@/utils";
+import { SUCCESS_CODE } from "@/utils";
+import {downloadFile} from "@/utils/helper";
export default {
components: { updateUser, detailUser },
@@ -143,8 +145,8 @@
data() {
return {
updateDepartmentData: null,
- searchDepartment: '',
- searchStatus: '',
+ searchDepartment: null,
+ searchStatus: null,
dialogUpdate: false,
dialogcheck: false,
tableData: [],
@@ -161,6 +163,21 @@
unsame: false,
myIdx: 0,
preMyIdx: 0,
+ file: null,
+ statusOptions: [
+ {
+ value: 2,
+ label: '鍏ㄩ儴'
+ },
+ {
+ value: 1,
+ label: '鍚敤'
+ },
+ {
+ value: 0,
+ label: '绂佺敤'
+ }
+ ],
options: [
{
value: 0,
@@ -220,11 +237,6 @@
this.updateDepartmentData = data;
},
- // 鏌ョ湅
- showViewDialog() {
- this.dialogcheck = true;
- },
-
// 娣诲姞鐣岄潰
showAddDialog() {
this.dialogAdd = true;
@@ -233,22 +245,11 @@
// 瀵煎嚭
exportTable() {
- exportTeamInfo({ current: this.currentPage, size: this.pageSize, departName: this.searchDepartment, status: this.searchStatus })
+ const status = this.searchStatus === 2 ? null : this.searchStatus;
+ exportTeamInfo({ current: this.currentPage, size: this.pageSize, departName: this.searchDepartment, status })
.then(res => {
- const blob = new Blob([res.data], { type: 'application/vnd.ms-excel' });
- const fileName = res.contentDisposition.split('=')[1];
- if (window.navigator && window.navigator.msSaveBlob) {
- navigator.msSaveBlob(blob, fileName);
- } else {
- const link = document.createElement('a');
- link.style.display = 'none';
- link.href = URL.createObjectURL(blob);
- link.setAttribute('download', decodeURI(fileName));
- document.body.appendChild(link);
- link.click();
- URL.revokeObjectURL(link.href);
- document.body.removeChild(link);
- }
+ downloadFile(res);
+ this.$message({ type: 'success', message: '鎿嶄綔鎴愬姛' });
})
.catch(err => {
this.$message({ type: 'error', message: err });
@@ -257,7 +258,9 @@
// 瀵煎叆
importTable(file) {
- importTeamInfo({ 'multipartFile': file.file })
+ const formData = new FormData();
+ formData.append('file', file.file);
+ importTeamInfo(formData)
.then(() => {
this.$message({ type: 'success', message: '鎿嶄綔鎴愬姛' });
this.getDepartmentList();
@@ -265,6 +268,7 @@
})
.catch(err => {
this.$message({ type: 'error', message: err });
+ this.$refs.uploadFile.clearFiles();
});
},
@@ -353,8 +357,9 @@
// 鑾峰彇鐢ㄦ埛鍒楄〃
getDepartmentList() {
+ const status = this.searchStatus === 2 ? null : this.searchStatus;
const searchInfo = {
- current: this.currentPage, size: this.pageSize, departName: this.searchDepartment, status: this.searchStatus
+ current: this.currentPage, size: this.pageSize, departName: this.searchDepartment, status
};
searchTeamInfo(searchInfo)
.then(({ records, total }) => {
--
Gitblit v1.8.0