|
|
|
@ -5,45 +5,10 @@ |
|
|
|
<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.companyName" clearable placeholder="请输入线路名称" |
|
|
|
style="width: 200px" /> |
|
|
|
</FormItem> |
|
|
|
<FormItem label="出发站" prop="contacts"> |
|
|
|
<Input type="text" v-model="searchForm.contacts" clearable placeholder="请输入出发站" |
|
|
|
style="width: 200px" /> |
|
|
|
</FormItem> |
|
|
|
<FormItem label="到达站" prop="mobile"> |
|
|
|
<Input type="text" v-model="searchForm.mobile" 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> |
|
|
|
@ -67,68 +32,33 @@ |
|
|
|
</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> |
|
|
|
<Table :loading="loading" border :columns="columns" :data="data" :size="tableSize" |
|
|
|
ref="table"></Table> |
|
|
|
<Row type="flex" justify="end" class="page"> |
|
|
|
<Page :current="searchForm.pageNum" :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> |
|
|
|
<Modal :title="站点维护" v-model="Visiable" :mask-closable="false" :scrollabele="true" :width="1000"> |
|
|
|
<logistics-address v-if="Visiable" ref="dialog"></logistics-address> |
|
|
|
<Modal :title="商品列表" v-model="Visiable" :mask-closable="false" :scrollabele="true" :width="1500"> |
|
|
|
<goodsList ref="goodsPage" v-if="Visiable"></goodsList> |
|
|
|
<div slot="footer" v-show=Visiable> |
|
|
|
<Button type="text" @click="Visiable = false">关闭</Button> |
|
|
|
</div> |
|
|
|
</Modal> |
|
|
|
<!-- 自定义导出数据 --> |
|
|
|
<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> |
|
|
|
|
|
|
|
<addEdit :data="form" :type="showType" v-model="showCompany" @on-submit="getDataList" /> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { |
|
|
|
getAllLogiticsCompanyData, |
|
|
|
deleteLogisticsRoute, |
|
|
|
getLogisticsRoutePageList |
|
|
|
getADList |
|
|
|
} from "@/api/app"; |
|
|
|
import { |
|
|
|
shortcuts |
|
|
|
} from "@/libs/shortcuts"; |
|
|
|
// 指定导出列数据 |
|
|
|
import { |
|
|
|
exportColumn |
|
|
|
} from "./exportColumn"; |
|
|
|
import excel from "@/libs/excel"; |
|
|
|
import addEdit from "@/views/app/business/lineManage/addEdit.vue"; |
|
|
|
import logisticsAddress from "@/views/app/business/lineManage/logisticsAddress.vue"; |
|
|
|
// 充值记录 |
|
|
|
import rechargeOne from "@/views/app/business/recharge/rechargeOne.vue"; |
|
|
|
import goodsList from "./dictManage.vue"; |
|
|
|
export default { |
|
|
|
name: "lineManage", |
|
|
|
components: { |
|
|
|
addEdit, |
|
|
|
logisticsAddress, |
|
|
|
rechargeOne |
|
|
|
goodsList, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
@ -151,23 +81,13 @@ |
|
|
|
drop: false, |
|
|
|
selectList: [], |
|
|
|
searchForm: { |
|
|
|
circuitName: "", |
|
|
|
pageNum: 1, |
|
|
|
pageSize: 10, |
|
|
|
goStation:'', |
|
|
|
arrivalStation:'' |
|
|
|
pageNum:1, |
|
|
|
pageSize:100, |
|
|
|
regionId:JSON.parse(this.getStore("user")).departmentId, |
|
|
|
}, |
|
|
|
selectDate: null, |
|
|
|
options: { |
|
|
|
shortcuts: shortcuts, |
|
|
|
}, |
|
|
|
form: {}, |
|
|
|
columns: [{ |
|
|
|
type: "selection", |
|
|
|
width: 60, |
|
|
|
align: "center", |
|
|
|
fixed: "left", |
|
|
|
}, |
|
|
|
columns: [ |
|
|
|
{ |
|
|
|
type: "index", |
|
|
|
width: 60, |
|
|
|
@ -175,38 +95,73 @@ |
|
|
|
fixed: "left", |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "线路名称", |
|
|
|
key: "circuitName", |
|
|
|
title: "放置位置", |
|
|
|
key: "position", |
|
|
|
minWidth: 100, |
|
|
|
sortable: true, |
|
|
|
fixed: "left", |
|
|
|
render: (h, params) => { |
|
|
|
let re = "" |
|
|
|
if (params.row.position == 'home_top') { |
|
|
|
re = "首页顶部大广告位"; |
|
|
|
} else if (params.row.position == 'home_center_left_top') { |
|
|
|
re = "首页中位左上"; |
|
|
|
} else if (params.row.position == 'home_center_left_bottom') { |
|
|
|
re = "首页中位左下"; |
|
|
|
} else if (params.row.position == 'home_center_right_top') { |
|
|
|
re = "首页中位右上"; |
|
|
|
} else if (params.row.position == 'home_center_right_bottom') { |
|
|
|
re = "首页中位右下"; |
|
|
|
} |
|
|
|
return h( |
|
|
|
"a", { |
|
|
|
on: { |
|
|
|
click: () => { |
|
|
|
this.showDetail(params.row); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
params.row.circuitName |
|
|
|
"div", |
|
|
|
re |
|
|
|
); |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "出发站", |
|
|
|
key: "goStation", |
|
|
|
title: "商家名称", |
|
|
|
key: "merchantName", |
|
|
|
minWidth: 150, |
|
|
|
sortable: true, |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "到达站", |
|
|
|
key: "arrivalStation", |
|
|
|
title: "商家主图", |
|
|
|
key: "merchantImage", |
|
|
|
minWidth: 250, |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "保费规则", |
|
|
|
key: "premiumRules", |
|
|
|
title: "广告图片", |
|
|
|
key: "adImage", |
|
|
|
width: 100, |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "广告标题", |
|
|
|
key: "title", |
|
|
|
width: 100, |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "排序值", |
|
|
|
key: "sortOrder", |
|
|
|
width: 100, |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "状态", |
|
|
|
key: "status", |
|
|
|
width: 100, |
|
|
|
render: (h, params) => { |
|
|
|
let re = "" |
|
|
|
if (params.row.status == 0) { |
|
|
|
re = "下架"; |
|
|
|
} else if (params.row.status == 1) { |
|
|
|
re = "上架"; |
|
|
|
} |
|
|
|
return h( |
|
|
|
"div", |
|
|
|
re |
|
|
|
); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "广告关联商品列表", |
|
|
|
key: "productList", |
|
|
|
width: 100, |
|
|
|
}, |
|
|
|
{ |
|
|
|
@ -214,23 +169,8 @@ |
|
|
|
key: "action", |
|
|
|
width: 200, |
|
|
|
align: "center", |
|
|
|
fixed: "right", |
|
|
|
render: (h, params) => { |
|
|
|
return h("div", [h( |
|
|
|
"a", { |
|
|
|
on: { |
|
|
|
click: () => { |
|
|
|
this.findAllRecord(params.row); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
"站点维护" |
|
|
|
), |
|
|
|
h("Divider", { |
|
|
|
props: { |
|
|
|
type: "vertical", |
|
|
|
}, |
|
|
|
}), |
|
|
|
return h("div", [ |
|
|
|
h( |
|
|
|
"a", { |
|
|
|
on: { |
|
|
|
@ -240,31 +180,12 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
"编辑" |
|
|
|
), |
|
|
|
h("Divider", { |
|
|
|
props: { |
|
|
|
type: "vertical", |
|
|
|
}, |
|
|
|
}), |
|
|
|
h( |
|
|
|
"a", { |
|
|
|
on: { |
|
|
|
click: () => { |
|
|
|
this.remove(params.row); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
"删除" |
|
|
|
), |
|
|
|
) |
|
|
|
]); |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
exportColumns: exportColumn, |
|
|
|
chooseColumns: [], |
|
|
|
filename: "公司数据", |
|
|
|
exportTitle: "确认导出", |
|
|
|
exportType: "", |
|
|
|
data: [], |
|
|
|
exportData: [], |
|
|
|
total: 0, |
|
|
|
@ -275,36 +196,6 @@ |
|
|
|
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; |
|
|
|
}, |
|
|
|
findAllRecord(v) { |
|
|
|
this.Visiable = true; |
|
|
|
console.log(v) |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.dialog.initRecharge(v); |
|
|
|
}); |
|
|
|
}, |
|
|
|
findRechargeLog(v) { |
|
|
|
this.rechargeVisiable = true; |
|
|
|
console.log(v) |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.rechargelog.initRecharge(v); |
|
|
|
}); |
|
|
|
}, |
|
|
|
changePage(v) { |
|
|
|
this.searchForm.pageNum = v; |
|
|
|
@ -318,102 +209,23 @@ |
|
|
|
this.searchForm.pageSize = v; |
|
|
|
this.getDataList(); |
|
|
|
}, |
|
|
|
selectDateRange(v) { |
|
|
|
if (v) { |
|
|
|
this.searchForm.startDate = v[0]; |
|
|
|
this.searchForm.endDate = v[1]; |
|
|
|
} |
|
|
|
}, |
|
|
|
getDataList() { |
|
|
|
// 线路列表 |
|
|
|
this.loading = true; |
|
|
|
getLogisticsRoutePageList(this.searchForm).then((res) => { |
|
|
|
getADList(this.searchForm).then((res) => { |
|
|
|
this.loading = false; |
|
|
|
if (res.code == 200) { |
|
|
|
this.data = res.result.records; |
|
|
|
this.total = res.result.total; |
|
|
|
if (this.data.length == 0 && this.searchForm.pageNum > 1) { |
|
|
|
this.searchForm.pageNum -= 1; |
|
|
|
this.getDataList(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
handleSearch() { |
|
|
|
this.searchForm.pageNum = 1; |
|
|
|
this.searchForm.pageSize = 10; |
|
|
|
this.getDataList(); |
|
|
|
}, |
|
|
|
handleReset() { |
|
|
|
this.$refs.searchForm.resetFields(); |
|
|
|
this.searchForm.pageNum = 1; |
|
|
|
this.searchForm.pageSize = 10; |
|
|
|
this.selectDate = null; |
|
|
|
this.searchForm.startDate = ""; |
|
|
|
this.searchForm.endDate = ""; |
|
|
|
this.searchForm.pageSize = 100; |
|
|
|
// 重新加载数据 |
|
|
|
this.getDataList(); |
|
|
|
}, |
|
|
|
changeSort(e) { |
|
|
|
this.searchForm.sort = e.key; |
|
|
|
this.searchForm.order = e.order; |
|
|
|
if (e.order == "normal") { |
|
|
|
this.searchForm.order = ""; |
|
|
|
} |
|
|
|
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) { |
|
|
|
@ -445,75 +257,11 @@ |
|
|
|
this.showType = "1"; |
|
|
|
this.showCompany = true; |
|
|
|
}, |
|
|
|
remove(v) { |
|
|
|
this.$Modal.confirm({ |
|
|
|
title: "确认删除", |
|
|
|
content: "您确认要删除该线路吗?", |
|
|
|
loading: true, |
|
|
|
onOk: () => { |
|
|
|
deleteLogisticsRoute({ |
|
|
|
id: v.id |
|
|
|
}).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); |
|
|
|
deleteLogisticsRoute({ |
|
|
|
ids: ids |
|
|
|
}).then((res) => { |
|
|
|
this.$Modal.remove(); |
|
|
|
if (res.success) { |
|
|
|
this.$Message.success("删除成功"); |
|
|
|
this.clearSelectAll(); |
|
|
|
this.getDataList(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
// 计算高度 |
|
|
|
this.height = Number(document.documentElement.clientHeight - 230); |
|
|
|
this.init(); |
|
|
|
}, |
|
|
|
}; |
|
|
|
|