2025-06-27
This commit is contained in:
@@ -85,3 +85,17 @@ export async function groupTypeUsers(params) {
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入用户
|
||||
* @param file excel文件
|
||||
*/
|
||||
export async function importUsers(file) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
const res = await request.post('/organization/user/import', formData);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
@@ -117,15 +117,15 @@
|
||||
</template>
|
||||
<template v-slot:cityName="{ row }">
|
||||
{{ row.cityName[0] }}
|
||||
<el-button
|
||||
<el-link
|
||||
size="mini"
|
||||
v-if="row.cityName.length > 1"
|
||||
type="primary"
|
||||
class="ele-btn-icon"
|
||||
@click="showAllCityName(row)"
|
||||
>
|
||||
查看所有
|
||||
</el-button>
|
||||
查看所有>>
|
||||
</el-link>
|
||||
</template>
|
||||
<!-- 状态列 -->
|
||||
<template v-slot:title="{ row }">
|
||||
@@ -192,7 +192,9 @@
|
||||
>
|
||||
<el-row style="padding-bottom: 20px">
|
||||
<template v-for="(item, index) in cityNames">
|
||||
<el-tag :key="index" type="info">{{ item }}</el-tag>
|
||||
<el-tag :key="index" type="info" style="margin-bottom: 10px">{{
|
||||
item
|
||||
}}</el-tag>
|
||||
</template>
|
||||
</el-row>
|
||||
</ele-modal>
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { importUsers } from '@/api/system/user';
|
||||
import { importUsers } from '@/api/organization/user';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
|
||||
@@ -22,14 +22,14 @@
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<!--<el-button
|
||||
<el-button
|
||||
size="small"
|
||||
icon="el-icon-upload2"
|
||||
class="ele-btn-icon"
|
||||
@click="openImport"
|
||||
>
|
||||
导入
|
||||
</el-button>-->
|
||||
</el-button>
|
||||
</template>
|
||||
<!-- 用户名列 -->
|
||||
<template v-slot:nickname="{ row }">
|
||||
|
||||
@@ -48,14 +48,42 @@
|
||||
<template v-slot:showBiz="{ row }">
|
||||
<template v-if="row.userType === 1">所有门店</template>
|
||||
<template v-else>
|
||||
{{ objFirstValue(row.selectBiz) }}
|
||||
<el-link
|
||||
size="mini"
|
||||
v-if="Object.keys(row.selectBiz).length > 1"
|
||||
type="primary"
|
||||
class="ele-btn-icon"
|
||||
@click="showAllBizName(row)"
|
||||
>
|
||||
查看所有>>
|
||||
</el-link>
|
||||
<!--
|
||||
<template v-for="(item, index) in row.selectBiz">
|
||||
<el-tag style="margin: 5px" :key="index" type="warning">{{
|
||||
item
|
||||
}}</el-tag>
|
||||
</template>
|
||||
-->
|
||||
</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
<ele-modal
|
||||
width="800px"
|
||||
:visible.sync="showBizName"
|
||||
:append-to-body="true"
|
||||
:close-on-click-modal="true"
|
||||
custom-class="ele-dialog-form"
|
||||
title="推广范围"
|
||||
>
|
||||
<el-row style="padding-bottom: 20px">
|
||||
<template v-for="(item, index) in bizNames">
|
||||
<el-tag :key="index" type="info" style="margin-bottom: 10px">{{
|
||||
item
|
||||
}}</el-tag>
|
||||
</template>
|
||||
</el-row>
|
||||
</ele-modal>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -140,7 +168,9 @@
|
||||
current: null,
|
||||
// 是否显示编辑弹窗
|
||||
showEdit: false,
|
||||
productId: 0
|
||||
productId: 0,
|
||||
showBizName: false,
|
||||
bizNames: {}
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
@@ -170,6 +200,14 @@
|
||||
},
|
||||
handleCarChange(carInfo) {
|
||||
this.where.selectedCar = carInfo;
|
||||
},
|
||||
showAllBizName(row) {
|
||||
this.showBizName = true;
|
||||
this.bizNames = row.selectBiz;
|
||||
},
|
||||
objFirstValue(myObject) {
|
||||
const keys = Object.keys(myObject);
|
||||
return keys.length > 0 ? myObject[keys[0]] : null;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
Reference in New Issue
Block a user