|
|
@@ -1,10 +1,30 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
- <el-form-item label="手机号" prop="mobile">
|
|
|
+ <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="90px">
|
|
|
+ <el-form-item label="租户">
|
|
|
+ <inline-tenant-selector
|
|
|
+ mode="admin"
|
|
|
+ :key="tenantSelectorKey"
|
|
|
+ @change="handleTenantChange"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="黑名单级别" prop="businessType">
|
|
|
+ <el-select
|
|
|
+ v-model="queryParams.businessType"
|
|
|
+ placeholder="请选择黑名单级别"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ style="width: 160px"
|
|
|
+ >
|
|
|
+ <el-option label="平台封禁" value="11" />
|
|
|
+ <el-option label="租户级" value="12" />
|
|
|
+ <el-option label="线路级" value="13" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="手机号" prop="targetValue">
|
|
|
<el-input
|
|
|
- style="width: 220px"
|
|
|
- v-model="queryParams.mobile"
|
|
|
+ style="width: 220px"
|
|
|
+ v-model="queryParams.targetValue"
|
|
|
placeholder="请输入手机号"
|
|
|
clearable
|
|
|
size="small"
|
|
|
@@ -12,13 +32,9 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="状态" prop="status">
|
|
|
- <el-select style="width: 220px" v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
|
|
|
- <el-option
|
|
|
- v-for="dict in statusOptions"
|
|
|
- :key="dict.dictValue"
|
|
|
- :label="dict.dictLabel"
|
|
|
- :value="dict.dictValue"
|
|
|
- />
|
|
|
+ <el-select style="width: 220px" v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
|
|
|
+ <el-option label="生效" :value="1" />
|
|
|
+ <el-option label="失效" :value="0" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
@@ -34,7 +50,7 @@
|
|
|
icon="el-icon-plus"
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
- v-hasPermi="['platform:companyVoiceBlacklist:add']"
|
|
|
+ v-hasPermi="['company:companyVoiceBlacklist:add']"
|
|
|
>新增</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
@@ -43,8 +59,8 @@
|
|
|
icon="el-icon-edit"
|
|
|
size="mini"
|
|
|
:disabled="single"
|
|
|
- @click="handleUpdate"
|
|
|
- v-hasPermi="['platform:companyVoiceBlacklist:edit']"
|
|
|
+ @click="handleUpdate()"
|
|
|
+ v-hasPermi="['company:companyVoiceBlacklist:edit']"
|
|
|
>修改</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
@@ -53,8 +69,8 @@
|
|
|
icon="el-icon-delete"
|
|
|
size="mini"
|
|
|
:disabled="multiple"
|
|
|
- @click="handleDelete"
|
|
|
- v-hasPermi="['platform:companyVoiceBlacklist:remove']"
|
|
|
+ @click="handleDelete()"
|
|
|
+ v-hasPermi="['company:companyVoiceBlacklist:remove']"
|
|
|
>删除</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
@@ -62,69 +78,110 @@
|
|
|
type="warning"
|
|
|
icon="el-icon-download"
|
|
|
size="mini"
|
|
|
+ :loading="exportLoading"
|
|
|
@click="handleExport"
|
|
|
- v-hasPermi="['platform:companyVoiceBlacklist:export']"
|
|
|
+ v-hasPermi="['company:companyVoiceBlacklist:export']"
|
|
|
>导出</el-button>
|
|
|
</el-col>
|
|
|
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-table height="500" border v-loading="loading" :data="companyVoiceBlacklistList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table
|
|
|
+ height="500"
|
|
|
+ border
|
|
|
+ v-loading="loading"
|
|
|
+ :data="companyVoiceBlacklistList"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ >
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
- <el-table-column label="ID" align="center" prop="blacklistId" />
|
|
|
- <el-table-column label="手机号" align="center" prop="mobile" />
|
|
|
- <el-table-column label="状态" align="center" prop="status" >
|
|
|
+ <el-table-column label="ID" align="center" prop="id" width="80" />
|
|
|
+ <el-table-column label="租户" align="center" prop="companyName" min-width="140" show-overflow-tooltip />
|
|
|
+ <el-table-column label="黑名单级别" align="center" prop="businessType" width="110">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-tag prop="status" v-for="(item, index) in statusOptions" :type="scope.row.status==1?'success':'danger'" v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
|
|
|
+ <span v-if="scope.row.businessType === '11'">平台封禁</span>
|
|
|
+ <span v-else-if="scope.row.businessType === '12'">租户级</span>
|
|
|
+ <span v-else-if="scope.row.businessType === '13'">线路级</span>
|
|
|
+ <span v-else>{{ scope.row.businessType || '-' }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="创建时间" align="center" prop="createTime" />
|
|
|
- <el-table-column label="更新时间" align="center" prop="updateTime" />
|
|
|
- <el-table-column label="备注" align="center" prop="remark" />
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <el-table-column label="手机号" align="center" prop="targetValue" min-width="160" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.targetValue || '-' }}</span>
|
|
|
+ <el-button
|
|
|
+ v-if="scope.row.targetType === 1 && scope.row.id"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-zoom-in"
|
|
|
+ size="mini"
|
|
|
+ style="margin-left: 8px"
|
|
|
+ @click="handlePhone(scope.row)"
|
|
|
+ v-hasPermi="['company:companyVoiceBlacklist:queryPhone']"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="状态" align="center" prop="status" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag :type="scope.row.status === 1 ? 'success' : 'danger'" size="mini">
|
|
|
+ {{ scope.row.status === 1 ? '生效' : '失效' }}
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="创建人" align="center" prop="createBy" width="120" />
|
|
|
+ <el-table-column label="创建时间" align="center" prop="createTime" width="160" />
|
|
|
+ <el-table-column label="更新人" align="center" prop="updateBy" width="120" />
|
|
|
+ <el-table-column label="更新时间" align="center" prop="updateTime" width="160" />
|
|
|
+ <el-table-column label="备注" align="center" prop="remark" min-width="120" show-overflow-tooltip />
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="160">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
- v-hasPermi="['platform:companyVoiceBlacklist:edit']"
|
|
|
+ v-hasPermi="['company:companyVoiceBlacklist:edit']"
|
|
|
>修改</el-button>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
- v-hasPermi="['platform:companyVoiceBlacklist:remove']"
|
|
|
+ v-hasPermi="['company:companyVoiceBlacklist:remove']"
|
|
|
>删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
-
|
|
|
+
|
|
|
<pagination
|
|
|
- v-show="total>0"
|
|
|
+ v-show="total > 0"
|
|
|
:total="total"
|
|
|
:page.sync="queryParams.pageNum"
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
@pagination="getList"
|
|
|
/>
|
|
|
|
|
|
- <!-- 添加或修改黑名单对话框 -->
|
|
|
- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
- <el-form-item label="手机号" prop="mobile">
|
|
|
- <el-input v-model="form.mobile" placeholder="请输入手机号" />
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="560px" append-to-body>
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
|
|
+ <el-form-item label="黑名单级别" prop="businessType">
|
|
|
+ <el-select v-model="form.businessType" placeholder="请选择黑名单级别" style="width: 100%">
|
|
|
+ <el-option v-if="!isTenantMode" label="平台封禁" value="11" />
|
|
|
+ <el-option v-if="isTenantMode" label="租户级" value="12" />
|
|
|
+ <el-option v-if="isTenantMode" label="线路级" value="13" />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
- <!-- <el-form-item label="企业ID" prop="companyId">
|
|
|
- <el-input v-model="form.companyId" placeholder="请输入企业ID" />
|
|
|
- </el-form-item> -->
|
|
|
- <el-form-item label="状态">
|
|
|
- <el-radio-group v-model="form.status">
|
|
|
- <el-radio v-for="dict in statusOptions" :label="dict.dictValue">{{dict.dictLabel}}</el-radio>
|
|
|
+ <el-form-item label="手机号" prop="targetValue">
|
|
|
+ <el-input
|
|
|
+ v-model="form.targetValue"
|
|
|
+ :placeholder="form.id ? '不填写则不修改手机号' : '请输入手机号'"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="状态" prop="status">
|
|
|
+ <el-radio-group v-model="form.status">
|
|
|
+ <el-radio :label="1">生效</el-radio>
|
|
|
+ <el-radio :label="0">失效</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="备注">
|
|
|
- <el-input type="textarea" v-model="form.remark" placeholder="请输入备注" />
|
|
|
+ <el-form-item label="备注" prop="remark">
|
|
|
+ <el-input type="textarea" v-model="form.remark" placeholder="请输入备注" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
@@ -136,167 +193,258 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listCompanyVoiceBlacklist, getCompanyVoiceBlacklist, delCompanyVoiceBlacklist, addCompanyVoiceBlacklist, updateCompanyVoiceBlacklist, exportCompanyVoiceBlacklist } from "@/api/company/companyVoiceBlacklist";
|
|
|
+import {
|
|
|
+ listCompanyVoiceBlacklist,
|
|
|
+ getCompanyVoiceBlacklist,
|
|
|
+ delCompanyVoiceBlacklist,
|
|
|
+ addCompanyVoiceBlacklist,
|
|
|
+ updateCompanyVoiceBlacklist,
|
|
|
+ exportCompanyVoiceBlacklist,
|
|
|
+ queryCompanyVoiceBlacklistPhone
|
|
|
+} from '@/api/company/companyVoiceBlacklist'
|
|
|
+import { listCompanyOptions } from '@/api/admin/sysCompany'
|
|
|
+import InlineTenantSelector from '@/components/InlineTenantSelector'
|
|
|
|
|
|
export default {
|
|
|
- name: "CompanyVoiceBlacklist",
|
|
|
+ name: 'CompanyVoiceBlacklist',
|
|
|
+ components: { InlineTenantSelector },
|
|
|
data() {
|
|
|
return {
|
|
|
- statusOptions:[],
|
|
|
- // 遮罩层
|
|
|
+ tenantOptions: [],
|
|
|
+ tenantSelectorKey: 0,
|
|
|
loading: true,
|
|
|
- // 选中数组
|
|
|
+ exportLoading: false,
|
|
|
ids: [],
|
|
|
- // 非单个禁用
|
|
|
single: true,
|
|
|
- // 非多个禁用
|
|
|
multiple: true,
|
|
|
- // 显示搜索条件
|
|
|
showSearch: true,
|
|
|
- // 总条数
|
|
|
total: 0,
|
|
|
- // 黑名单表格数据
|
|
|
companyVoiceBlacklistList: [],
|
|
|
- // 弹出层标题
|
|
|
- title: "",
|
|
|
- // 是否显示弹出层
|
|
|
+ title: '',
|
|
|
open: false,
|
|
|
- // 查询参数
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
- mobile: null,
|
|
|
- companyId: null,
|
|
|
- status: null,
|
|
|
+ businessType: null,
|
|
|
+ targetType: 1,
|
|
|
+ targetValue: null,
|
|
|
+ status: null
|
|
|
},
|
|
|
- // 表单参数
|
|
|
form: {},
|
|
|
- // 表单校验
|
|
|
rules: {
|
|
|
- mobile: [
|
|
|
- { required: true, message: "手机号不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
+ targetValue: [
|
|
|
+ {
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ if (!this.form.id && !value) {
|
|
|
+ callback(new Error('手机号不能为空'))
|
|
|
+ } else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ]
|
|
|
}
|
|
|
- };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ isTenantMode() {
|
|
|
+ return !!this.$tenantId
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
- this.getDicts("sys_company_status").then((response) => {
|
|
|
- this.statusOptions = response.data;
|
|
|
- });
|
|
|
- this.getList();
|
|
|
+ this.loadTenantOptions()
|
|
|
+ this.getList()
|
|
|
},
|
|
|
methods: {
|
|
|
- /** 查询黑名单列表 */
|
|
|
+ loadTenantOptions() {
|
|
|
+ listCompanyOptions().then(response => {
|
|
|
+ this.tenantOptions = response.data || []
|
|
|
+ })
|
|
|
+ },
|
|
|
+ resolveTenantName(tenantId) {
|
|
|
+ if (tenantId == null) {
|
|
|
+ return this.isTenantMode ? this.resolveTenantName(this.$tenantId) : '平台'
|
|
|
+ }
|
|
|
+ const tenant = this.tenantOptions.find(item => item.id === tenantId)
|
|
|
+ return tenant ? (tenant.tenantName || tenant.companyName || String(tenantId)) : String(tenantId)
|
|
|
+ },
|
|
|
getList() {
|
|
|
- this.loading = true;
|
|
|
- listCompanyVoiceBlacklist(this.queryParams).then(response => {
|
|
|
- this.companyVoiceBlacklistList = response.rows;
|
|
|
- this.total = response.total;
|
|
|
- this.loading = false;
|
|
|
- });
|
|
|
+ this.loading = true
|
|
|
+ listCompanyVoiceBlacklist(this.$withTenant({ ...this.queryParams })).then(response => {
|
|
|
+ const tenantName = this.isTenantMode ? this.resolveTenantName(this.$tenantId) : '平台'
|
|
|
+ this.companyVoiceBlacklistList = (response.rows || []).map(row => ({
|
|
|
+ ...row,
|
|
|
+ companyName: this.isTenantMode ? tenantName : (row.companyId != null ? this.resolveTenantName(row.companyId) : '平台')
|
|
|
+ }))
|
|
|
+ this.total = response.total || 0
|
|
|
+ this.loading = false
|
|
|
+ }).catch(() => {
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
},
|
|
|
- // 取消按钮
|
|
|
cancel() {
|
|
|
- this.open = false;
|
|
|
- this.reset();
|
|
|
+ this.open = false
|
|
|
+ this.reset()
|
|
|
},
|
|
|
- // 表单重置
|
|
|
reset() {
|
|
|
this.form = {
|
|
|
- blacklistId: null,
|
|
|
- mobile: null,
|
|
|
+ id: null,
|
|
|
companyId: null,
|
|
|
- status: "1",
|
|
|
- remark: null,
|
|
|
- createTime: null,
|
|
|
- updateTime: null
|
|
|
- };
|
|
|
- this.resetForm("form");
|
|
|
+ businessType: this.isTenantMode ? '12' : '11',
|
|
|
+ targetType: 1,
|
|
|
+ targetValue: null,
|
|
|
+ status: 1,
|
|
|
+ remark: null
|
|
|
+ }
|
|
|
+ this.resetForm('form')
|
|
|
+ },
|
|
|
+ handleTenantChange() {
|
|
|
+ this.queryParams.pageNum = 1
|
|
|
+ this.queryParams.businessType = null
|
|
|
+ this.getList()
|
|
|
},
|
|
|
- /** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
|
- this.queryParams.pageNum = 1;
|
|
|
- this.getList();
|
|
|
+ this.queryParams.pageNum = 1
|
|
|
+ this.getList()
|
|
|
},
|
|
|
- /** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
- this.resetForm("queryForm");
|
|
|
- this.handleQuery();
|
|
|
+ this.resetForm('queryForm')
|
|
|
+ this.queryParams.targetType = 1
|
|
|
+ this.queryParams.businessType = null
|
|
|
+ this.$store.dispatch('tenant/setTenantId', null)
|
|
|
+ this.tenantSelectorKey++
|
|
|
+ this.handleQuery()
|
|
|
},
|
|
|
- // 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map(item => item.blacklistId)
|
|
|
- this.single = selection.length!==1
|
|
|
+ this.ids = selection.map(item => item.id)
|
|
|
+ this.single = selection.length !== 1
|
|
|
this.multiple = !selection.length
|
|
|
},
|
|
|
- /** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
|
- this.reset();
|
|
|
- this.open = true;
|
|
|
- this.title = "添加黑名单";
|
|
|
+ this.reset()
|
|
|
+ this.form.businessType = this.isTenantMode ? '12' : '11'
|
|
|
+ this.open = true
|
|
|
+ this.title = '添加黑名单'
|
|
|
},
|
|
|
- /** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
- this.reset();
|
|
|
- const blacklistId = row.blacklistId || this.ids
|
|
|
- getCompanyVoiceBlacklist(blacklistId).then(response => {
|
|
|
- this.form = response.data;
|
|
|
- this.form.status = response.data.status.toString();
|
|
|
- this.open = true;
|
|
|
- this.title = "修改黑名单";
|
|
|
- });
|
|
|
+ this.reset()
|
|
|
+ const id = row && row.id != null ? row.id : this.ids[0]
|
|
|
+ if (!id) {
|
|
|
+ this.msgWarning('请选择要修改的数据')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ getCompanyVoiceBlacklist(id, this.$withTenant({})).then(response => {
|
|
|
+ const data = response.data || {}
|
|
|
+ this.form = {
|
|
|
+ id: data.id,
|
|
|
+ companyId: data.companyId,
|
|
|
+ businessType: data.businessType || '12',
|
|
|
+ targetType: data.targetType != null ? data.targetType : 1,
|
|
|
+ targetValue: null,
|
|
|
+ status: data.status != null ? data.status : 1,
|
|
|
+ remark: data.remark
|
|
|
+ }
|
|
|
+ this.open = true
|
|
|
+ this.title = '修改黑名单'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleSubmitSuccess(msg) {
|
|
|
+ this.open = false
|
|
|
+ this.reset()
|
|
|
+ this.msgSuccess(msg)
|
|
|
+ this.getList()
|
|
|
},
|
|
|
- /** 提交按钮 */
|
|
|
submitForm() {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
- if (valid) {
|
|
|
- if (this.form.blacklistId != null) {
|
|
|
- updateCompanyVoiceBlacklist(this.form).then(response => {
|
|
|
- if (response.code === 200) {
|
|
|
- this.msgSuccess("修改成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- addCompanyVoiceBlacklist(this.form).then(response => {
|
|
|
- if (response.code === 200) {
|
|
|
- this.msgSuccess("新增成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- }
|
|
|
- });
|
|
|
+ this.$refs.form.validate(valid => {
|
|
|
+ if (!valid) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const payload = {
|
|
|
+ id: this.form.id,
|
|
|
+ companyId: this.form.companyId,
|
|
|
+ businessType: this.form.businessType || '12',
|
|
|
+ targetType: this.form.targetType != null ? this.form.targetType : 1,
|
|
|
+ status: this.form.status,
|
|
|
+ remark: this.form.remark
|
|
|
+ }
|
|
|
+ if (payload.businessType === '11') {
|
|
|
+ payload.companyId = null
|
|
|
+ }
|
|
|
+ if (this.form.targetValue) {
|
|
|
+ payload.targetValue = this.form.targetValue
|
|
|
+ }
|
|
|
+ if (payload.id != null) {
|
|
|
+ updateCompanyVoiceBlacklist(payload, this.$withTenant({})).then(res => {
|
|
|
+ if (!res || Number(res.code) === 200) {
|
|
|
+ this.handleSubmitSuccess((res && res.msg) || '修改成功')
|
|
|
+ } else {
|
|
|
+ this.msgError(res.msg || '修改失败')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ if (!payload.targetValue) {
|
|
|
+ this.msgError('手机号不能为空')
|
|
|
+ return
|
|
|
}
|
|
|
+ addCompanyVoiceBlacklist(payload, this.$withTenant({})).then(res => {
|
|
|
+ if (!res || Number(res.code) === 200) {
|
|
|
+ this.handleSubmitSuccess((res && res.msg) || '新增成功')
|
|
|
+ } else {
|
|
|
+ this.msgError(res.msg || '新增失败')
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
- /** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
- const blacklistIds = row.blacklistId || this.ids;
|
|
|
- this.$confirm('是否确认删除黑名单编号为"' + blacklistIds + '"的数据项?', "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(function() {
|
|
|
- return delCompanyVoiceBlacklist(blacklistIds);
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.msgSuccess("删除成功");
|
|
|
- }).catch(function() {});
|
|
|
+ const ids = row && row.id != null ? row.id : this.ids.join(',')
|
|
|
+ if (!ids) {
|
|
|
+ this.msgWarning('请选择要删除的数据')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$confirm('是否确认删除黑名单编号为"' + ids + '"的数据项?', '警告', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ return delCompanyVoiceBlacklist(ids, this.$withTenant({}))
|
|
|
+ }).then(() => {
|
|
|
+ this.getList()
|
|
|
+ this.msgSuccess('删除成功')
|
|
|
+ }).catch(() => {})
|
|
|
},
|
|
|
- /** 导出按钮操作 */
|
|
|
handleExport() {
|
|
|
- const queryParams = this.queryParams;
|
|
|
- this.$confirm('是否确认导出所有黑名单数据项?', "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(function() {
|
|
|
- return exportCompanyVoiceBlacklist(queryParams);
|
|
|
- }).then(response => {
|
|
|
- this.download(response.msg);
|
|
|
- }).catch(function() {});
|
|
|
+ this.$confirm('是否确认导出当前筛选条件下的黑名单数据?', '警告', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.exportLoading = true
|
|
|
+ const params = this.$withTenant({ ...this.queryParams })
|
|
|
+ delete params.pageNum
|
|
|
+ delete params.pageSize
|
|
|
+ return exportCompanyVoiceBlacklist(params)
|
|
|
+ }).then(response => {
|
|
|
+ this.download(response.msg)
|
|
|
+ this.exportLoading = false
|
|
|
+ }).catch(() => {
|
|
|
+ this.exportLoading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handlePhone(row) {
|
|
|
+ if (!row || !row.id) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ queryCompanyVoiceBlacklistPhone(row.id, this.$withTenant({})).then(res => {
|
|
|
+ const mobile = (res && res.mobile) || (res && res.data && res.data.mobile)
|
|
|
+ if (mobile) {
|
|
|
+ this.$alert(mobile, '手机号', { confirmButtonText: '确定' })
|
|
|
+ } else {
|
|
|
+ this.msgError((res && res.msg) || '获取手机号失败')
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
-};
|
|
|
+}
|
|
|
</script>
|