|
|
|
@ -3,479 +3,351 @@ |
|
|
|
@import "./expressCompany.less"; |
|
|
|
</style> |
|
|
|
<template> |
|
|
|
<div class="search"> |
|
|
|
<Card> |
|
|
|
<Row v-show="openSearch" @keydown.enter.native="handleSearch"> |
|
|
|
<Form ref="searchForm" :model="searchForm" inline :label-width="100"> |
|
|
|
<FormItem label="名称" prop="companyName"> |
|
|
|
<Input type="text" v-model="searchForm.name" clearable placeholder="请输入快递公司名称" |
|
|
|
style="width: 200px" /> |
|
|
|
</FormItem> |
|
|
|
<FormItem style="margin-left: -35px" class="br"> |
|
|
|
<Button @click="handleSearch" type="primary" icon="ios-search">搜索</Button> |
|
|
|
<Button @click="handleReset">重置</Button> |
|
|
|
<a class="drop-down" @click="dropDown"> |
|
|
|
{{ dropDownContent }} |
|
|
|
<Icon :type="dropDownIcon"></Icon> |
|
|
|
</a> |
|
|
|
</FormItem> |
|
|
|
</Form> |
|
|
|
</Row> |
|
|
|
<Row align="middle" justify="space-between" class="operation"> |
|
|
|
<div> |
|
|
|
<Button @click="add" type="primary" icon="md-add">添加</Button> |
|
|
|
<Button @click="delAll" icon="md-trash">批量删除</Button> |
|
|
|
<Dropdown @on-click="handleDropdown"> |
|
|
|
<Button> |
|
|
|
更多操作 |
|
|
|
<Icon type="md-arrow-dropdown" /> |
|
|
|
</Button> |
|
|
|
<DropdownMenu slot="list"> |
|
|
|
<DropdownItem name="refresh">刷新</DropdownItem> |
|
|
|
<DropdownItem name="exportData">导出所选数据</DropdownItem> |
|
|
|
<DropdownItem name="exportAll">导出全部数据</DropdownItem> |
|
|
|
</DropdownMenu> |
|
|
|
</Dropdown> |
|
|
|
</div> |
|
|
|
<div class="icons"> |
|
|
|
<Tooltip content="刷新" placement="top" transfer> |
|
|
|
<Icon type="md-refresh" size="18" class="item" @click="getDataList" /> |
|
|
|
</Tooltip> |
|
|
|
<Tooltip :content="openSearch ? '关闭搜索' : '开启搜索'" placement="top" transfer> |
|
|
|
<Icon type="ios-search" size="18" class="item tip" @click="openSearch = !openSearch" /> |
|
|
|
</Tooltip> |
|
|
|
<Tooltip :content="openTip ? '关闭提示' : '开启提示'" placement="top" transfer> |
|
|
|
<Icon type="md-bulb" size="18" class="item tip" @click="openTip = !openTip" /> |
|
|
|
</Tooltip> |
|
|
|
<Tooltip content="表格密度" placement="top" transfer> |
|
|
|
<Dropdown @on-click="changeTableSize" trigger="click"> |
|
|
|
<Icon type="md-list" size="18" class="item" /> |
|
|
|
<DropdownMenu slot="list"> |
|
|
|
<DropdownItem :selected="tableSize == 'default'" name="default">默认</DropdownItem> |
|
|
|
<DropdownItem :selected="tableSize == 'large'" name="large">宽松</DropdownItem> |
|
|
|
<DropdownItem :selected="tableSize == 'small'" name="small">紧密</DropdownItem> |
|
|
|
</DropdownMenu> |
|
|
|
</Dropdown> |
|
|
|
</Tooltip> |
|
|
|
</div> |
|
|
|
</Row> |
|
|
|
<Alert show-icon v-show="openTip"> |
|
|
|
已选择 |
|
|
|
<span class="select-count">{{ selectList.length }}</span> 项 |
|
|
|
<a class="select-clear" @click="clearSelectAll">清空</a> |
|
|
|
</Alert> |
|
|
|
<Table :loading="loading" border :columns="columns" :data="data" :size="tableSize" sortable="custom" |
|
|
|
@on-sort-change="changeSort" @on-selection-change="showSelect" ref="table"></Table> |
|
|
|
<Row type="flex" justify="end" class="page"> |
|
|
|
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" |
|
|
|
@on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" |
|
|
|
size="small" show-total show-elevator show-sizer></Page> |
|
|
|
</Row> |
|
|
|
</Card> |
|
|
|
<div class="search"> |
|
|
|
<Card> |
|
|
|
<Tabs v-model="activeTab" @on-click="handleTabChange"> |
|
|
|
<TabPane label="商品管理" name="goods"> |
|
|
|
<Row @keydown.enter.native="loadGoods"> |
|
|
|
<Form :model="goodsQuery" inline :label-width="80"> |
|
|
|
<FormItem label="关键词"> |
|
|
|
<Input v-model="goodsQuery.keyword" clearable placeholder="标题/发布人" style="width: 180px" /> |
|
|
|
</FormItem> |
|
|
|
<FormItem label="学校"> |
|
|
|
<Input v-model="goodsQuery.regionId" clearable placeholder="校区ID" style="width: 160px" /> |
|
|
|
</FormItem> |
|
|
|
<FormItem label="审核"> |
|
|
|
<Select v-model="goodsQuery.auditStatus" clearable style="width: 120px"> |
|
|
|
<Option :value="0">待审核</Option> |
|
|
|
<Option :value="1">通过</Option> |
|
|
|
<Option :value="2">拒绝</Option> |
|
|
|
</Select> |
|
|
|
</FormItem> |
|
|
|
<FormItem label="上下架"> |
|
|
|
<Select v-model="goodsQuery.status" clearable style="width: 120px"> |
|
|
|
<Option :value="1">正常</Option> |
|
|
|
<Option :value="2">下架</Option> |
|
|
|
<Option :value="3">删除</Option> |
|
|
|
</Select> |
|
|
|
</FormItem> |
|
|
|
<FormItem> |
|
|
|
<Button type="primary" icon="ios-search" @click="loadGoods">搜索</Button> |
|
|
|
<Button @click="resetGoods">重置</Button> |
|
|
|
</FormItem> |
|
|
|
</Form> |
|
|
|
</Row> |
|
|
|
<Table border :loading="loading" :columns="goodsColumns" :data="goodsList"></Table> |
|
|
|
<Row type="flex" justify="end" class="page"> |
|
|
|
<Page :current="goodsQuery.pageNum" :total="goodsTotal" :page-size="goodsQuery.pageSize" |
|
|
|
@on-change="p => changePage('goods', p)" @on-page-size-change="s => changePageSize('goods', s)" |
|
|
|
:page-size-opts="[10,20,50]" size="small" show-total show-elevator show-sizer /> |
|
|
|
</Row> |
|
|
|
</TabPane> |
|
|
|
|
|
|
|
<!-- 自定义导出数据 --> |
|
|
|
<Modal v-model="exportModalVisible" :title="exportTitle" :loading="loadingExport" @on-ok="exportCustomData"> |
|
|
|
<Form ref="exportForm" :label-width="100"> |
|
|
|
<FormItem label="导出文件名"> |
|
|
|
<Input v-model="filename" /> |
|
|
|
</FormItem> |
|
|
|
<FormItem label="自定义导出列"> |
|
|
|
<CheckboxGroup v-model="chooseColumns"> |
|
|
|
<Checkbox v-for="(item, i) in exportColumns" :label="item.title" :key="i" :value="item.checked" |
|
|
|
:disabled="item.disabled"></Checkbox> |
|
|
|
</CheckboxGroup> |
|
|
|
</FormItem> |
|
|
|
</Form> |
|
|
|
</Modal> |
|
|
|
<Modal :title="充值记录明细" v-model="rechargeVisiable" :mask-closable="false" :scrollabele="true" :width="1000"> |
|
|
|
<recharge-one v-if="rechargeVisiable" ref="rechargelog"></recharge-one> |
|
|
|
<div slot="footer" v-show=rechargeVisiable> |
|
|
|
<Button type="text" @click="rechargeVisiable = false">关闭</Button> |
|
|
|
</div> |
|
|
|
</Modal> |
|
|
|
</div> |
|
|
|
<TabPane label="分类管理" name="category"> |
|
|
|
<Row class="operation"> |
|
|
|
<Button type="primary" icon="md-add" @click="openCategory()">新增分类</Button> |
|
|
|
<Button icon="md-refresh" @click="loadCategories">刷新</Button> |
|
|
|
</Row> |
|
|
|
<Table border :loading="loading" :columns="categoryColumns" :data="categoryList"></Table> |
|
|
|
</TabPane> |
|
|
|
|
|
|
|
<TabPane label="用户管理" name="user"> |
|
|
|
<Row @keydown.enter.native="loadUserLimits"> |
|
|
|
<Form :model="userQuery" inline :label-width="80"> |
|
|
|
<FormItem label="用户ID"> |
|
|
|
<Input v-model="userQuery.userId" clearable placeholder="用户ID" style="width: 220px" /> |
|
|
|
</FormItem> |
|
|
|
<FormItem> |
|
|
|
<Button type="primary" icon="ios-search" @click="loadUserLimits">搜索</Button> |
|
|
|
<Button type="warning" @click="openUserLimit()">新增风控</Button> |
|
|
|
</FormItem> |
|
|
|
</Form> |
|
|
|
</Row> |
|
|
|
<Table border :loading="loading" :columns="userColumns" :data="userLimitList"></Table> |
|
|
|
<Row type="flex" justify="end" class="page"> |
|
|
|
<Page :current="userQuery.pageNum" :total="userTotal" :page-size="userQuery.pageSize" |
|
|
|
@on-change="p => changePage('user', p)" @on-page-size-change="s => changePageSize('user', s)" |
|
|
|
:page-size-opts="[10,20,50]" size="small" show-total show-elevator show-sizer /> |
|
|
|
</Row> |
|
|
|
</TabPane> |
|
|
|
|
|
|
|
<TabPane label="举报管理" name="complaint"> |
|
|
|
<Row @keydown.enter.native="loadComplaints"> |
|
|
|
<Form :model="complaintQuery" inline :label-width="80"> |
|
|
|
<FormItem label="状态"> |
|
|
|
<Select v-model="complaintQuery.status" clearable style="width: 130px"> |
|
|
|
<Option :value="0">待处理</Option> |
|
|
|
<Option :value="1">通过</Option> |
|
|
|
<Option :value="2">驳回</Option> |
|
|
|
</Select> |
|
|
|
</FormItem> |
|
|
|
<FormItem label="类型"> |
|
|
|
<Select v-model="complaintQuery.type" clearable style="width: 130px"> |
|
|
|
<Option value="goods">商品</Option> |
|
|
|
<Option value="comment">评论</Option> |
|
|
|
<Option value="chat">聊天</Option> |
|
|
|
</Select> |
|
|
|
</FormItem> |
|
|
|
<FormItem> |
|
|
|
<Button type="primary" icon="ios-search" @click="loadComplaints">搜索</Button> |
|
|
|
</FormItem> |
|
|
|
</Form> |
|
|
|
</Row> |
|
|
|
<Table border :loading="loading" :columns="complaintColumns" :data="complaintList"></Table> |
|
|
|
<Row type="flex" justify="end" class="page"> |
|
|
|
<Page :current="complaintQuery.pageNum" :total="complaintTotal" :page-size="complaintQuery.pageSize" |
|
|
|
@on-change="p => changePage('complaint', p)" @on-page-size-change="s => changePageSize('complaint', s)" |
|
|
|
:page-size-opts="[10,20,50]" size="small" show-total show-elevator show-sizer /> |
|
|
|
</Row> |
|
|
|
</TabPane> |
|
|
|
</Tabs> |
|
|
|
</Card> |
|
|
|
|
|
|
|
<Modal v-model="categoryModal" title="分类信息" @on-ok="saveCategory"> |
|
|
|
<Form :model="categoryForm" :label-width="90"> |
|
|
|
<FormItem label="名称"><Input v-model="categoryForm.name" /></FormItem> |
|
|
|
<FormItem label="排序"><InputNumber v-model="categoryForm.sortOrder" :min="0" /></FormItem> |
|
|
|
<FormItem label="图标"><Input v-model="categoryForm.icon" /></FormItem> |
|
|
|
<FormItem label="颜色"><Input v-model="categoryForm.color" /></FormItem> |
|
|
|
<FormItem label="状态"> |
|
|
|
<i-switch v-model="categoryForm.statusBool" size="large"> |
|
|
|
<span slot="open">启用</span> |
|
|
|
<span slot="close">禁用</span> |
|
|
|
</i-switch> |
|
|
|
</FormItem> |
|
|
|
</Form> |
|
|
|
</Modal> |
|
|
|
|
|
|
|
<Modal v-model="userLimitModal" title="用户风控" @on-ok="saveUserLimit"> |
|
|
|
<Form :model="userLimitForm" :label-width="100"> |
|
|
|
<FormItem label="用户ID"><Input v-model="userLimitForm.userId" /></FormItem> |
|
|
|
<FormItem label="二手禁言"><i-switch v-model="userLimitForm.mutedBool" /></FormItem> |
|
|
|
<FormItem label="禁止发布"><i-switch v-model="userLimitForm.publishBannedBool" /></FormItem> |
|
|
|
<FormItem label="永久封禁"><i-switch v-model="userLimitForm.permanentBannedBool" /></FormItem> |
|
|
|
<FormItem label="封禁原因"><Input v-model="userLimitForm.reason" type="textarea" /></FormItem> |
|
|
|
</Form> |
|
|
|
</Modal> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { |
|
|
|
getAllLogiticsCompanyData, |
|
|
|
deleteLogiticsCompany, |
|
|
|
onLineCompany, |
|
|
|
offLineCompany |
|
|
|
} from "@/api/app"; |
|
|
|
import { |
|
|
|
shortcuts |
|
|
|
} from "@/libs/shortcuts"; |
|
|
|
// 指定导出列数据 |
|
|
|
import { |
|
|
|
exportColumn |
|
|
|
} from "./exportColumn"; |
|
|
|
import excel from "@/libs/excel"; |
|
|
|
// 充值记录 |
|
|
|
import rechargeOne from "@/views/app/business/recharge/rechargeOne.vue"; |
|
|
|
export default { |
|
|
|
name: "logiticsCompany", |
|
|
|
components: { |
|
|
|
rechargeOne |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
tableSize: "default", |
|
|
|
message: "", |
|
|
|
selectIndex: "", |
|
|
|
currentRow: {}, |
|
|
|
height: 510, |
|
|
|
showCompany: false, |
|
|
|
showType: "0", |
|
|
|
openSearch: true, |
|
|
|
openTip: true, |
|
|
|
loading: true, |
|
|
|
reading: false, |
|
|
|
loadingExport: true, |
|
|
|
exportModalVisible: false, |
|
|
|
importModalVisible: false, |
|
|
|
deployModalVisible: false, |
|
|
|
uploadfile: { |
|
|
|
name: "", |
|
|
|
}, |
|
|
|
drop: false, |
|
|
|
selectList: [], |
|
|
|
searchForm: { |
|
|
|
name:'', |
|
|
|
schoolId:'1', |
|
|
|
orderByField:'', |
|
|
|
remark:'' |
|
|
|
}, |
|
|
|
selectDate: null, |
|
|
|
options: { |
|
|
|
shortcuts: shortcuts, |
|
|
|
}, |
|
|
|
form: {}, |
|
|
|
columns: [{ |
|
|
|
type: "selection", |
|
|
|
width: 60, |
|
|
|
align: "center", |
|
|
|
fixed: "left", |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: "index", |
|
|
|
width: 60, |
|
|
|
align: "center", |
|
|
|
fixed: "left", |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "名称", |
|
|
|
key: "name", |
|
|
|
minWidth: 250 |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "排序", |
|
|
|
key: "orderByField", |
|
|
|
minWidth: 160 |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "学校id", |
|
|
|
key: "schoolId", |
|
|
|
minWidth: 150, |
|
|
|
sortable: true, |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "备注", |
|
|
|
key: "remark", |
|
|
|
minWidth: 250, |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "操作", |
|
|
|
key: "action", |
|
|
|
width: 200, |
|
|
|
align: "center", |
|
|
|
fixed: "right", |
|
|
|
render: (h, params) => { |
|
|
|
let onOrOffLine = ""; |
|
|
|
return h("div", [ |
|
|
|
onOrOffLine, |
|
|
|
h( |
|
|
|
"a", { |
|
|
|
on: { |
|
|
|
click: () => { |
|
|
|
this.edit(params.row); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
"编辑" |
|
|
|
), |
|
|
|
h("Divider", { |
|
|
|
props: { |
|
|
|
type: "vertical", |
|
|
|
}, |
|
|
|
}), |
|
|
|
h( |
|
|
|
"a", { |
|
|
|
on: { |
|
|
|
click: () => { |
|
|
|
this.remove(params.row); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
"删除" |
|
|
|
) |
|
|
|
]); |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
exportColumns: exportColumn, |
|
|
|
chooseColumns: [], |
|
|
|
filename: "公司数据", |
|
|
|
exportTitle: "确认导出", |
|
|
|
exportType: "", |
|
|
|
data: [], |
|
|
|
exportData: [], |
|
|
|
total: 0, |
|
|
|
rechargeVisiable: false, |
|
|
|
}; |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
init() { |
|
|
|
this.getDataList(); |
|
|
|
// 初始化导出列数据 |
|
|
|
let array = []; |
|
|
|
this.exportColumns.forEach((e) => { |
|
|
|
// 指定列限制权限 |
|
|
|
if ( |
|
|
|
!this.getStore("roles").includes("ROLE_ADMIN") && |
|
|
|
e.key == "mobile" |
|
|
|
) { |
|
|
|
e.title = "[无权导出] " + e.title; |
|
|
|
e.disabled = true; |
|
|
|
} else { |
|
|
|
e.disabled = false; |
|
|
|
} |
|
|
|
array.push(e.title); |
|
|
|
}); |
|
|
|
this.chooseColumns = array; |
|
|
|
}, |
|
|
|
changePage(v) { |
|
|
|
this.getDataList(); |
|
|
|
this.clearSelectAll(); |
|
|
|
}, |
|
|
|
changeTableSize(v) { |
|
|
|
this.tableSize = v; |
|
|
|
}, |
|
|
|
changePageSize(v) { |
|
|
|
this.getDataList(); |
|
|
|
}, |
|
|
|
getDataList() { |
|
|
|
// 多条件搜索用户列表 |
|
|
|
this.loading = true; |
|
|
|
|
|
|
|
}, |
|
|
|
handleSearch() { |
|
|
|
this.getDataList(); |
|
|
|
}, |
|
|
|
handleReset() { |
|
|
|
this.$refs.searchForm.resetFields(); |
|
|
|
this.selectDate = null; |
|
|
|
// 重新加载数据 |
|
|
|
this.getDataList(); |
|
|
|
}, |
|
|
|
changeSort(e) { |
|
|
|
this.getDataList(); |
|
|
|
}, |
|
|
|
handleDropdown(name) { |
|
|
|
if (name == "refresh") { |
|
|
|
this.getDataList(); |
|
|
|
} else if (name == "exportData") { |
|
|
|
if (this.selectList.length <= 0) { |
|
|
|
this.$Message.warning("您还未选择要导出的数据"); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.exportType = "part"; |
|
|
|
this.exportModalVisible = true; |
|
|
|
this.exportTitle = "确认导出 " + this.selectList.length + " 条数据"; |
|
|
|
} else if (name == "exportAll") { |
|
|
|
this.exportType = "all"; |
|
|
|
this.exportModalVisible = true; |
|
|
|
this.exportTitle = "确认导出全部 " + this.total + " 条数据"; |
|
|
|
getAllLogiticsCompanyData().then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.exportData = res.result; |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
exportCustomData() { |
|
|
|
if (this.filename == "") { |
|
|
|
this.filename = "公司数据"; |
|
|
|
} |
|
|
|
// 判断勾选导出列 |
|
|
|
let array = []; |
|
|
|
this.exportColumns.forEach((e) => { |
|
|
|
this.chooseColumns.forEach((c) => { |
|
|
|
if (e.title == c && !e.disabled) { |
|
|
|
array.push(e); |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.exportColumns = array; |
|
|
|
this.exportModalVisible = false; |
|
|
|
let title = []; |
|
|
|
let key = []; |
|
|
|
this.exportColumns.forEach((e) => { |
|
|
|
title.push(e.title); |
|
|
|
key.push(e.key); |
|
|
|
}); |
|
|
|
const params = { |
|
|
|
title: title, |
|
|
|
key: key, |
|
|
|
data: this.exportData, |
|
|
|
autoWidth: true, |
|
|
|
filename: this.filename, |
|
|
|
}; |
|
|
|
excel.export_array_to_excel(params); |
|
|
|
}, |
|
|
|
showDetail(v) { |
|
|
|
// 转换null为"" |
|
|
|
for (let attr in v) { |
|
|
|
if (v[attr] == null) { |
|
|
|
v[attr] = ""; |
|
|
|
} |
|
|
|
} |
|
|
|
let str = JSON.stringify(v); |
|
|
|
let data = JSON.parse(str); |
|
|
|
this.form = data; |
|
|
|
this.showType = "0"; |
|
|
|
this.showCompany = true; |
|
|
|
}, |
|
|
|
add() { |
|
|
|
this.showType = "2"; |
|
|
|
this.showCompany = true; |
|
|
|
}, |
|
|
|
edit(v) { |
|
|
|
// 转换null为"" |
|
|
|
for (let attr in v) { |
|
|
|
if (v[attr] == null) { |
|
|
|
v[attr] = ""; |
|
|
|
} |
|
|
|
} |
|
|
|
let str = JSON.stringify(v); |
|
|
|
let data = JSON.parse(str); |
|
|
|
this.form = data; |
|
|
|
this.showType = "1"; |
|
|
|
this.showCompany = true; |
|
|
|
}, |
|
|
|
remove(v) { |
|
|
|
this.$Modal.confirm({ |
|
|
|
title: "确认删除", |
|
|
|
content: "您确认要删除楼栋配置 " + v.name + " ?", |
|
|
|
loading: true, |
|
|
|
onOk: () => { |
|
|
|
deleteLogiticsCompany({ |
|
|
|
id: v.id, |
|
|
|
delFlag:0 |
|
|
|
}).then((res) => { |
|
|
|
this.$Modal.remove(); |
|
|
|
if (res.success) { |
|
|
|
this.clearSelectAll(); |
|
|
|
this.$Message.success("删除成功"); |
|
|
|
this.getDataList(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
}); |
|
|
|
}, |
|
|
|
dropDown() { |
|
|
|
this.drop = !this.drop; |
|
|
|
}, |
|
|
|
showSelect(e) { |
|
|
|
this.exportData = e; |
|
|
|
this.selectList = e; |
|
|
|
if (e.length === 1) { |
|
|
|
const row = e[0]; |
|
|
|
this.selectIndex = row.id; |
|
|
|
this.currentRow = row; |
|
|
|
} else { |
|
|
|
this.currentRow = {}; |
|
|
|
this.selectIndex = ""; |
|
|
|
} |
|
|
|
}, |
|
|
|
clearSelectAll() { |
|
|
|
this.$refs.table.selectAll(false); |
|
|
|
}, |
|
|
|
delAll() { |
|
|
|
if (this.selectList.length <= 0) { |
|
|
|
this.$Message.warning("您还未选择要删除的数据"); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.$Modal.confirm({ |
|
|
|
title: "确认删除", |
|
|
|
content: "您确认要删除所选的 " + this.selectList.length + " 条数据?", |
|
|
|
loading: true, |
|
|
|
onOk: () => { |
|
|
|
let ids = ""; |
|
|
|
this.selectList.forEach(function(e) { |
|
|
|
ids += e.id + ","; |
|
|
|
}); |
|
|
|
ids = ids.substring(0, ids.length - 1); |
|
|
|
deletelogiticsCompany({ |
|
|
|
ids: ids |
|
|
|
}).then((res) => { |
|
|
|
this.$Modal.remove(); |
|
|
|
if (res.success) { |
|
|
|
this.$Message.success("删除成功"); |
|
|
|
this.clearSelectAll(); |
|
|
|
this.getDataList(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
}); |
|
|
|
}, |
|
|
|
findRechargeLog(v) { |
|
|
|
this.rechargeVisiable = true; |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.rechargelog.initRecharge(v); |
|
|
|
}); |
|
|
|
}, |
|
|
|
offLine(v) { |
|
|
|
this.$Modal.confirm({ |
|
|
|
title: "确认下线", |
|
|
|
content: "您确认要使 " + v.companyName + " 下线吗?", |
|
|
|
loading: true, |
|
|
|
onOk: () => { |
|
|
|
offLineCompany({ |
|
|
|
id: v.id |
|
|
|
}).then((res) => { |
|
|
|
this.$Modal.remove(); |
|
|
|
if (res.success) { |
|
|
|
this.$Message.success("操作成功"); |
|
|
|
this.getDataList(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
}); |
|
|
|
}, |
|
|
|
onLine(v) { |
|
|
|
this.$Modal.confirm({ |
|
|
|
title: "确认上线", |
|
|
|
content: "您确认要使 " + v.companyName + " 上线吗?", |
|
|
|
loading: true, |
|
|
|
onOk: () => { |
|
|
|
onLineCompany({ |
|
|
|
id: v.id |
|
|
|
}).then((res) => { |
|
|
|
this.$Modal.remove(); |
|
|
|
if (res.success) { |
|
|
|
this.$Message.success("操作成功"); |
|
|
|
this.getDataList(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
// 计算高度 |
|
|
|
this.height = Number(document.documentElement.clientHeight - 230); |
|
|
|
this.init(); |
|
|
|
}, |
|
|
|
}; |
|
|
|
import { |
|
|
|
fishGoodsPage, |
|
|
|
fishGoodsStatus, |
|
|
|
fishCategoryList, |
|
|
|
fishCategorySave, |
|
|
|
fishCategoryDelete, |
|
|
|
fishComplaintPage, |
|
|
|
fishComplaintHandle, |
|
|
|
fishUserLimitPage, |
|
|
|
fishUserLimitSave, |
|
|
|
} from "@/api/fishMarket"; |
|
|
|
|
|
|
|
export default { |
|
|
|
name: "fishMarketAdmin", |
|
|
|
data() { |
|
|
|
return { |
|
|
|
activeTab: "goods", |
|
|
|
loading: false, |
|
|
|
goodsList: [], |
|
|
|
goodsTotal: 0, |
|
|
|
categoryList: [], |
|
|
|
userLimitList: [], |
|
|
|
userTotal: 0, |
|
|
|
complaintList: [], |
|
|
|
complaintTotal: 0, |
|
|
|
categoryModal: false, |
|
|
|
userLimitModal: false, |
|
|
|
categoryForm: {}, |
|
|
|
userLimitForm: {}, |
|
|
|
goodsQuery: { pageNum: 1, pageSize: 10 }, |
|
|
|
userQuery: { pageNum: 1, pageSize: 10 }, |
|
|
|
complaintQuery: { pageNum: 1, pageSize: 10, status: 0 }, |
|
|
|
goodsColumns: [ |
|
|
|
{ title: "标题", key: "title", minWidth: 180 }, |
|
|
|
{ title: "学校", key: "regionName", width: 130 }, |
|
|
|
{ title: "发布人", key: "userName", width: 120 }, |
|
|
|
{ title: "分类", key: "categoryName", width: 100 }, |
|
|
|
{ title: "价格", key: "price", width: 90 }, |
|
|
|
{ title: "审核", key: "auditStatus", width: 90, render: (h, p) => h("Tag", { props: { color: this.auditColor(p.row.auditStatus) } }, this.auditText(p.row.auditStatus)) }, |
|
|
|
{ title: "状态", key: "status", width: 90, render: (h, p) => h("Tag", { props: { color: p.row.status == 1 ? "green" : "red" } }, p.row.status == 1 ? "正常" : "下架") }, |
|
|
|
{ title: "举报", key: "complaintCount", width: 80 }, |
|
|
|
{ title: "浏览", key: "browseCount", width: 80 }, |
|
|
|
{ title: "发布时间", key: "createTime", minWidth: 150 }, |
|
|
|
{ title: "操作", width: 250, fixed: "right", render: (h, p) => h("div", [ |
|
|
|
h("Button", { props: { type: "success", size: "small" }, style: { marginRight: "6px" }, on: { click: () => this.handleGoods(p.row, 1, "审核通过") } }, "通过"), |
|
|
|
h("Button", { props: { type: "warning", size: "small" }, style: { marginRight: "6px" }, on: { click: () => this.handleGoods(p.row, 2, "强制下架") } }, "下架"), |
|
|
|
h("Button", { props: { type: "primary", size: "small" }, style: { marginRight: "6px" }, on: { click: () => this.handleGoods(p.row, 1, "恢复上架") } }, "恢复"), |
|
|
|
h("Button", { props: { type: "error", size: "small" }, on: { click: () => this.handleGoods(p.row, 3, "删除") } }, "删除") |
|
|
|
]) } |
|
|
|
], |
|
|
|
categoryColumns: [ |
|
|
|
{ title: "名称", key: "name" }, |
|
|
|
{ title: "排序", key: "sortOrder", width: 100 }, |
|
|
|
{ title: "图标", key: "icon", minWidth: 180 }, |
|
|
|
{ title: "颜色", key: "color", width: 100 }, |
|
|
|
{ title: "状态", key: "status", width: 90, render: (h, p) => h("Tag", { props: { color: p.row.status == 1 ? "green" : "default" } }, p.row.status == 1 ? "启用" : "禁用") }, |
|
|
|
{ title: "操作", width: 160, render: (h, p) => h("div", [ |
|
|
|
h("Button", { props: { type: "primary", size: "small" }, style: { marginRight: "8px" }, on: { click: () => this.openCategory(p.row) } }, "编辑"), |
|
|
|
h("Button", { props: { type: "error", size: "small" }, on: { click: () => this.deleteCategory(p.row) } }, "删除") |
|
|
|
]) } |
|
|
|
], |
|
|
|
userColumns: [ |
|
|
|
{ title: "用户ID", key: "userId", minWidth: 180 }, |
|
|
|
{ title: "禁言", key: "muted", width: 90, render: (h, p) => h("Tag", { props: { color: p.row.muted == 1 ? "red" : "green" } }, p.row.muted == 1 ? "是" : "否") }, |
|
|
|
{ title: "禁止发布", key: "publishBanned", width: 110 }, |
|
|
|
{ title: "永久封禁", key: "permanentBanned", width: 110 }, |
|
|
|
{ title: "原因", key: "banReason", minWidth: 200 }, |
|
|
|
{ title: "更新时间", key: "updateTime", minWidth: 150 }, |
|
|
|
{ title: "操作", width: 100, render: (h, p) => h("Button", { props: { type: "primary", size: "small" }, on: { click: () => this.openUserLimit(p.row) } }, "编辑") } |
|
|
|
], |
|
|
|
complaintColumns: [ |
|
|
|
{ title: "类型", key: "complaintType", width: 100 }, |
|
|
|
{ title: "商品ID", key: "goodsId", minWidth: 170 }, |
|
|
|
{ title: "举报人", key: "reporterName", width: 120 }, |
|
|
|
{ title: "卖家ID", key: "sellerId", minWidth: 170 }, |
|
|
|
{ title: "原因", key: "reason", minWidth: 220 }, |
|
|
|
{ title: "状态", key: "status", width: 90, render: (h, p) => h("Tag", { props: { color: p.row.status == 0 ? "orange" : (p.row.status == 1 ? "green" : "default") } }, this.complaintStatusText(p.row.status)) }, |
|
|
|
{ title: "时间", key: "createTime", minWidth: 150 }, |
|
|
|
{ title: "操作", width: 230, fixed: "right", render: (h, p) => h("div", [ |
|
|
|
h("Button", { props: { type: "success", size: "small" }, style: { marginRight: "6px" }, on: { click: () => this.handleComplaint(p.row, 1) } }, "通过"), |
|
|
|
h("Button", { props: { size: "small" }, style: { marginRight: "6px" }, on: { click: () => this.handleComplaint(p.row, 2) } }, "驳回"), |
|
|
|
h("Button", { props: { type: "error", size: "small" }, on: { click: () => this.handleComplaint(p.row, 1, true) } }, "下架封号") |
|
|
|
]) } |
|
|
|
] |
|
|
|
}; |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.loadGoods(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
handleTabChange() { |
|
|
|
if (this.activeTab == "goods") this.loadGoods(); |
|
|
|
if (this.activeTab == "category") this.loadCategories(); |
|
|
|
if (this.activeTab == "user") this.loadUserLimits(); |
|
|
|
if (this.activeTab == "complaint") this.loadComplaints(); |
|
|
|
}, |
|
|
|
loadGoods() { |
|
|
|
this.loading = true; |
|
|
|
fishGoodsPage(this.goodsQuery).then(res => { |
|
|
|
this.goodsList = this.records(res); |
|
|
|
this.goodsTotal = this.total(res); |
|
|
|
}).finally(() => this.loading = false); |
|
|
|
}, |
|
|
|
resetGoods() { |
|
|
|
this.goodsQuery = { pageNum: 1, pageSize: 10 }; |
|
|
|
this.loadGoods(); |
|
|
|
}, |
|
|
|
loadCategories() { |
|
|
|
this.loading = true; |
|
|
|
fishCategoryList({}).then(res => { |
|
|
|
this.categoryList = res.result || res || []; |
|
|
|
}).finally(() => this.loading = false); |
|
|
|
}, |
|
|
|
loadUserLimits() { |
|
|
|
this.loading = true; |
|
|
|
fishUserLimitPage(this.userQuery).then(res => { |
|
|
|
this.userLimitList = this.records(res); |
|
|
|
this.userTotal = this.total(res); |
|
|
|
}).finally(() => this.loading = false); |
|
|
|
}, |
|
|
|
loadComplaints() { |
|
|
|
this.loading = true; |
|
|
|
fishComplaintPage(this.complaintQuery).then(res => { |
|
|
|
this.complaintList = this.records(res); |
|
|
|
this.complaintTotal = this.total(res); |
|
|
|
}).finally(() => this.loading = false); |
|
|
|
}, |
|
|
|
changePage(type, page) { |
|
|
|
this[`${type}Query`].pageNum = page; |
|
|
|
this.handleTabChange(); |
|
|
|
}, |
|
|
|
changePageSize(type, size) { |
|
|
|
this[`${type}Query`].pageSize = size; |
|
|
|
this[`${type}Query`].pageNum = 1; |
|
|
|
this.handleTabChange(); |
|
|
|
}, |
|
|
|
records(res) { |
|
|
|
const data = res.result || res || {}; |
|
|
|
return data.records || data.content || []; |
|
|
|
}, |
|
|
|
total(res) { |
|
|
|
const data = res.result || res || {}; |
|
|
|
return Number(data.total || data.totalElements) || 0; |
|
|
|
}, |
|
|
|
auditText(status) { |
|
|
|
return status == 1 ? "通过" : (status == 2 ? "拒绝" : "待审"); |
|
|
|
}, |
|
|
|
auditColor(status) { |
|
|
|
return status == 1 ? "green" : (status == 2 ? "red" : "orange"); |
|
|
|
}, |
|
|
|
complaintStatusText(status) { |
|
|
|
return status == 1 ? "通过" : (status == 2 ? "驳回" : "待处理"); |
|
|
|
}, |
|
|
|
handleGoods(row, status, title) { |
|
|
|
this.$Modal.confirm({ |
|
|
|
title, |
|
|
|
render: (h) => h("Input", { props: { autofocus: true, placeholder: "请输入原因" }, on: { input: val => this.actionReason = val } }), |
|
|
|
onOk: () => { |
|
|
|
fishGoodsStatus({ goodsId: row.id, status, auditStatus: status == 1 ? 1 : row.auditStatus, reason: this.actionReason || title }).then(() => { |
|
|
|
this.$Message.success("处理成功"); |
|
|
|
this.loadGoods(); |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
openCategory(row = {}) { |
|
|
|
this.categoryForm = { ...row, statusBool: row.status !== 0 }; |
|
|
|
this.categoryModal = true; |
|
|
|
}, |
|
|
|
saveCategory() { |
|
|
|
const data = { ...this.categoryForm, status: this.categoryForm.statusBool ? 1 : 0 }; |
|
|
|
fishCategorySave(data).then(() => { |
|
|
|
this.$Message.success("保存成功"); |
|
|
|
this.loadCategories(); |
|
|
|
}); |
|
|
|
}, |
|
|
|
deleteCategory(row) { |
|
|
|
this.$Modal.confirm({ |
|
|
|
title: "删除分类", |
|
|
|
content: "确认删除该分类吗?", |
|
|
|
onOk: () => fishCategoryDelete(row.id).then(() => this.loadCategories()) |
|
|
|
}); |
|
|
|
}, |
|
|
|
openUserLimit(row = {}) { |
|
|
|
this.userLimitForm = { |
|
|
|
...row, |
|
|
|
reason: row.banReason || "", |
|
|
|
mutedBool: row.muted == 1, |
|
|
|
publishBannedBool: row.publishBanned == 1, |
|
|
|
permanentBannedBool: row.permanentBanned == 1 |
|
|
|
}; |
|
|
|
this.userLimitModal = true; |
|
|
|
}, |
|
|
|
saveUserLimit() { |
|
|
|
const data = { |
|
|
|
...this.userLimitForm, |
|
|
|
muted: this.userLimitForm.mutedBool ? 1 : 0, |
|
|
|
publishBanned: this.userLimitForm.publishBannedBool ? 1 : 0, |
|
|
|
permanentBanned: this.userLimitForm.permanentBannedBool ? 1 : 0 |
|
|
|
}; |
|
|
|
fishUserLimitSave(data).then(() => { |
|
|
|
this.$Message.success("保存成功"); |
|
|
|
this.loadUserLimits(); |
|
|
|
}); |
|
|
|
}, |
|
|
|
handleComplaint(row, status, blockUser) { |
|
|
|
fishComplaintHandle({ |
|
|
|
complaintId: row.id, |
|
|
|
status, |
|
|
|
blockUser: !!blockUser, |
|
|
|
reason: blockUser ? "举报成立,执行风控" : "", |
|
|
|
handleResult: status == 1 ? "举报通过" : "举报驳回" |
|
|
|
}).then(() => { |
|
|
|
this.$Message.success("处理成功"); |
|
|
|
this.loadComplaints(); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
</script> |