Browse Source

预约配货统计

master
liupopo 1 year ago
parent
commit
42c1b09b66
  1. 127
      src/api/lpk/reserveorder.js
  2. 535
      src/views/orderreserve/allDistributionCount.vue
  3. 8
      src/views/orderreserve/distributionCount.vue
  4. 4
      src/views/orderreserve/index.vue
  5. 560
      src/views/orderreserve/subBranch.vue

127
src/api/lpk/reserveorder.js

@ -24,96 +24,71 @@ export default {
responseType: 'blob'
})
},
// 获取所有门店
getAllStore: function(data) {
// 获取各提货点配货列表
pageOfStore: function(data) {
return request({
url: '/lpkstore/getAllStore',
method: 'delete',
data: data
});
},
// 导出报表
exportExcel: function(data) {
return request({
url: '/lpksreservoorder/exportExcel',
method: 'post',
responseType: 'blob', // 表明返回服务器返回的数据类型
data: data,
headers: {
'Content-Type': 'application/json'
}
});
},
// 获取配货列表
distributionList: function(data) {
return request({
url: '/lpksreservoorder/orderListByStore',
url: '/adminapi/reserve/pageOfStore',
method: 'post',
data: data
});
},
// 导出报表
distributionExportExcel: function(data) {
return request({
url: '/lpksreservoorder/exportExcelByStore',
method: 'post',
responseType: 'blob', // 表明返回服务器返回的数据类型
data: data,
headers: {
'Content-Type': 'application/json'
}
});
},
// 获取支行汇总列表
bankOrderList: function(data) {
expExcelOfStore: function(params) {
return request({
url: '/adminapi/reserve/expExcelOfStore',
method: 'post',
data: params,
// headers: {
// "responseType": "blob" //将二进制流转换成blob对象
// },
headers: {
'Access-Control-Allow-Headers': 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild'
},
responseType: 'blob'
})
},
// 获取各支行配货列表
pageOfBank: function(data) {
return request({
url: '/lpksreservoorder/orderListByBank',
url: '/adminapi/reserve/pageOfBank',
method: 'post',
data: data
});
},
// 导出支行报表
bankOrderExportExcel: function(data) {
return request({
url: '/lpksreservoorder/exportExcelByBank',
method: 'post',
responseType: 'blob', // 表明返回服务器返回的数据类型
data: data,
headers: {
'Content-Type': 'application/json'
}
});
},
// 获取支行汇总列表
ZOrderList: function(data) {
expExcelOfBank: function(params) {
return request({
url: '/adminapi/reserve/expExcelOfBank',
method: 'post',
data: params,
// headers: {
// "responseType": "blob" //将二进制流转换成blob对象
// },
headers: {
'Access-Control-Allow-Headers': 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild'
},
responseType: 'blob'
})
},
// 获取总配货列表
pageOfAll: function(data) {
return request({
url: '/lpksreservoorder/orderListByZ',
url: '/adminapi/reserve/pageOfAll',
method: 'post',
data: data
});
},
// 导出总报表
allOrderExportExcel: function(data) {
return request({
url: '/lpksreservoorder/exportExcelByZ',
method: 'post',
responseType: 'blob', // 表明返回服务器返回的数据类型
data: data,
headers: {
'Content-Type': 'application/json'
}
});
},
expExcelOfAll: function(params) {
return request({
url: '/adminapi/reserve/expExcelOfAll',
method: 'post',
data: params,
// headers: {
// "responseType": "blob" //将二进制流转换成blob对象
// },
headers: {
'Access-Control-Allow-Headers': 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild'
},
responseType: 'blob'
})
}
}

535
src/views/orderreserve/allDistributionCount.vue

@ -1,316 +1,239 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="总配货统计" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">
{{ searchxianshitit }}
</el-button>
<div v-show="isSearchShow" class="search">
<el-form :inline="true" class="tab-header">
<el-form-item label="预约开始日期">
<el-date-picker v-model="page.params.startDate" @change="selectTime1" type="date"
placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
style="width: 200px;">
</el-date-picker>
</el-form-item>
<el-form-item label="预约结束日期">
<el-date-picker v-model="page.params.endDate" @change="selectTime2" type="date"
placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
style="width: 200px;">
</el-date-picker>
</el-form-item>
<el-form-item label="卡券类型">
<el-select v-model="page.params.cardType" filterable class="item_input" clearable
placeholder="请选择" style="width:100%" @change="cardTypeSelect">
<el-option v-for="item in cardTypeList" :key="item.text" :label="item.text"
:value="item.sid">
</el-option>
</el-select>
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" size="small" icon="el-icon-search"
@click="dosearch">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-refresh"
@click="resetQuery">重置</el-button>
</div>
</div>
</div>
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit">配货列表</div>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%" :cell-style="cell">
<!-- <el-table-column fixed width="50" type="selection" align="center" /> -->
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<!-- <el-table-column label="操作" align="center" width="120">
<div class="app-container">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="总配货统计" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">
{{ searchxianshitit }}
</el-button>
<div v-show="isSearchShow" class="search">
<el-form :inline="true" class="tab-header">
<el-form-item label="预约开始日期">
<el-date-picker v-model="page.params.startDate" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;" clearable />
</el-form-item>
<el-form-item label="预约结束日期">
<el-date-picker v-model="page.params.endDate" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;" clearable />
</el-form-item>
<el-form-item label="菜窖分类">
<el-select v-model="page.params.cardType" filterable class="item_input" clearable placeholder="请选择" style="width:100%">
<el-option v-for="item in brandList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</div>
</div>
</div>
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit">配货列表</div>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%" :cell-style="cell">
<!-- <el-table-column fixed width="50" type="selection" align="center" /> -->
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<!-- <el-table-column label="操作" align="center" width="120">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">明细</el-button>
</template>
</el-table-column> -->
<el-table-column prop="cardType" label="卡券类型" align="center" />
<el-table-column prop="reserveDate" label="预约日期" align="center" />
<el-table-column prop="goodsName" label="商品名称" align="center" />
<el-table-column prop="goodsNumber" label="数量(份)" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="page.total" :page.sync="page.current"
:limit.sync="page.size" class="pagination" @pagination="loadList" />
</div>
</div>
</div>
<!-- End 查询和其列表部分 -->
<!-- 新增修改部分组件 -->
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
</div>
<el-table-column prop="reserveDate" label="预约日期" align="center" />
<el-table-column prop="brandName" label="菜窖分类" align="center" />
<el-table-column prop="goodsName" label="商品名称" align="center" />
<el-table-column prop="goodsNumber" label="数量(份)" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="page.total" :page.sync="page.current" :limit.sync="page.size" class="pagination" @pagination="loadList" />
</div>
</div>
</div>
<!-- End 查询和其列表部分 -->
<!-- 新增修改部分组件 -->
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
</div>
</template>
<script>
import req from '@/api/order/order.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './indexInfo.vue'
import {
getBeforeDate
} from '@/utils/index'
export default {
name: 'SupplierBankInfoIndex',
components: {
ButtonBar,
Pagination,
pageye,
divAdd,
},
data() {
return {
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [{
type: 'success',
size: 'small',
icon: 'export',
btnKey: 'build',
btnLabel: '导出'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
page: {
total: 0, //
current: 1, //
size: 10, //
params: {
startDate: "",
endDate: "",
store: "",
cardType: ""
},
},
giftPackList: [],
cardTypeList: [{
text: "全部",
sid: ""
},
{
text: "家庭卡",
sid: "1"
},
{
text: "亲情卡",
sid: "2"
},
{
text: "企业卡",
sid: "3"
},
]
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.getAllStore()
// this.loadList()
},
methods: {
//绿
cell({
row,
column,
rowIndex,
columnIndex
}) {
if (columnIndex == 3) {
return 'padding: 0px'
}
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'build': //
this.doBuild()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
selectTime1(val) {
console.log('selectTime1:', val)
this.page.params.startDate = val
},
selectTime2(val) {
console.log('selectTime2:', val)
this.page.params.endDate = val
},
giftPackSelect(val) {
console.log('>>>>>>>>>giftPackSelect', val)
this.page.params.store = val
},
cardTypeSelect(val) {
console.log('>>>>>>>>>cardTypeSelect', val)
this.page.params.cardType = val
},
getAllStore() {
req.getAllStore().then((resp) => {
if (resp.success) {
this.giftPackList = resp.data
}
}).catch(() => {})
},
loadList() {
this.tableLoading = true
req.ZOrderList(this.page).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.page.total = data.total
this.dataList = data.records
} else {
// resp.code
this.dataList = []
this.page.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
//
indexMethod(index) {
var pagestart = (this.page.current - 1) * this.page.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.page.current = 1
this.loadList()
},
resetQuery() {
this.page = {
current: 1,
size: 10,
total: 0,
params: {
startDate: "",
endDate: "",
store: "",
cardType: ""
},
}
this.loadList()
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
resetState() {
this.viewState = 1
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
//
doBuild() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.allOrderExportExcel(this.page.params).then((resp) => {
loading.close()
const blob = new Blob([resp], {
type: 'application/vnd.ms-excel'
})
const fileName = '总配货明细_' + this.page.params.startDate + '.xls'
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'nonde'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
}).catch(() => {
loading.close()
})
},
}
}
import req from '@/api/lpk/reserveorder.js'
import reqMall from '@/api/adminmallapi.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import divAdd from './indexInfo.vue'
export default {
name: 'SupplierBankInfoIndex',
components: {
ButtonBar,
Pagination,
divAdd
},
data() {
return {
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [{
type: 'success',
size: 'small',
icon: 'export',
btnKey: 'build',
btnLabel: '导出'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
page: {
total: 0, //
current: 1, //
size: 10, //
params: {
startDate: '',
endDate: '',
store: '',
cardType: ''
}
},
brandList: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.initBrand()
},
methods: {
initBrand() {
reqMall.listAllBrand().then(resp => {
this.brandList = resp.data
})
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'build': //
this.doBuild()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
req.pageOfAll(this.page).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.page.total = data.total
this.dataList = data.records
} else {
// resp.code
this.dataList = []
this.page.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
//
indexMethod(index) {
var pagestart = (this.page.current - 1) * this.page.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.page.current = 1
this.loadList()
},
resetQuery() {
this.page = {
current: 1,
size: 10,
total: 0,
params: {
startDate: '',
endDate: '',
store: '',
cardType: ''
}
}
this.loadList()
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
resetState() {
this.viewState = 1
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
//
doBuild() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.expExcelOfAll(this.page.params).then((resp) => {
loading.close()
const blob = new Blob([resp], {
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
})
const fileName = '总配货明细_' + this.page.params.startDate + '.xlsx'
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'nonde'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
}).catch(() => {
loading.close()
})
}
}
}
</script>
<style scoped>
::v-deep .el-table .cell {
padding: 0px;
}
</style>
::v-deep .el-table .cell {
padding: 0px;
}
</style>

8
src/views/orderreserve/distributionCount.vue

@ -198,7 +198,7 @@
},
loadList() {
this.tableLoading = true
req.pageOfCustomer(this.page).then((resp) => {
req.pageOfStore(this.page).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
@ -261,12 +261,12 @@
background: 'rgba(0, 0, 0, 0.7)'
})
req.distributionExportExcel(this.page.params).then((resp) => {
req.expExcelOfStore(this.page.params).then((resp) => {
loading.close()
const blob = new Blob([resp], {
type: 'application/vnd.ms-excel'
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
})
const fileName = '网点配货明细_' + this.page.params.startDate + '.xls'
const fileName = '网点配货明细_' + this.page.params.startDate + '.xlsx'
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'nonde'

4
src/views/orderreserve/index.vue

@ -255,9 +255,9 @@
req.expExcelOfCustomer(this.page.params).then((resp) => {
loading.close()
const blob = new Blob([resp], {
type: 'application/vnd.ms-excel'
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
})
const fileName = '预约单明细_' + this.page.params.startDate + '.xls'
const fileName = '预约单明细_' + this.page.params.startDate + '.xlsx'
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'nonde'

560
src/views/orderreserve/subBranch.vue

@ -1,335 +1,257 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="支行配货统计" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">
{{ searchxianshitit }}
</el-button>
<div v-show="isSearchShow" class="search">
<el-form :inline="true" class="tab-header">
<el-form-item label="预约开始日期">
<el-date-picker v-model="page.params.startDate" @change="selectTime1" type="date"
placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
style="width: 200px;">
</el-date-picker>
</el-form-item>
<el-form-item label="预约结束日期">
<el-date-picker v-model="page.params.endDate" @change="selectTime2" type="date"
placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
style="width: 200px;">
</el-date-picker>
</el-form-item>
<el-form-item label="支行名称">
<el-select v-model="page.params.bankSid" filterable class="item_input" clearable
placeholder="请选择" style="width:100%" @change="bankSelect">
<el-option v-for="item in bankList" :key="item.name" :label="item.name"
:value="item.sid">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="卡券类型">
<el-select v-model="page.params.cardType" filterable class="item_input" clearable
placeholder="请选择" style="width:100%" @change="cardTypeSelect">
<el-option v-for="item in cardTypeList" :key="item.text" :label="item.text"
:value="item.sid">
</el-option>
</el-select>
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" size="small" icon="el-icon-search"
@click="dosearch">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-refresh"
@click="resetQuery">重置</el-button>
</div>
</div>
</div>
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit">配货列表</div>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%" :cell-style="cell">
<!-- <el-table-column fixed width="50" type="selection" align="center" /> -->
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<!-- <el-table-column label="操作" align="center" width="120">
<div class="app-container">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="支行配货统计" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">
{{ searchxianshitit }}
</el-button>
<div v-show="isSearchShow" class="search">
<el-form :inline="true" class="tab-header">
<el-form-item label="预约开始日期">
<el-date-picker v-model="page.params.startDate" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;" clearable />
</el-form-item>
<el-form-item label="预约结束日期">
<el-date-picker v-model="page.params.endDate" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;" clearable />
</el-form-item>
<el-form-item label="所属支行">
<el-select v-model="page.params.bankSid" filterable class="item_input" clearable placeholder="请选择" style="width:100%">
<el-option v-for="item in bankList" :key="item.sid" :label="item.name" :value="item.sid" />
</el-select>
</el-form-item>
<el-form-item label="菜窖分类">
<el-select v-model="page.params.cardType" filterable class="item_input" clearable placeholder="请选择" style="width:100%">
<el-option v-for="item in brandList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</div>
</div>
</div>
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit">支行配货列表</div>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%" :cell-style="cell">
<!-- <el-table-column fixed width="50" type="selection" align="center" /> -->
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<!-- <el-table-column label="操作" align="center" width="120">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">明细</el-button>
</template>
</el-table-column> -->
<el-table-column prop="cardType" label="卡券类型" align="center" />
<el-table-column prop="reserveDate" label="预约日期" align="center" />
<el-table-column prop="bankName" label="支行名称" align="center" />
<el-table-column prop="goodsName" label="商品名称" align="center" />
<el-table-column prop="goodsNumber" label="数量(份)" align="center" />
<el-table-column prop="address" label="支行地址" align="center" />
<el-table-column prop="linker" label="联系人" align="center" />
<el-table-column prop="linkPhone" label="联系电话" align="center" />
<el-table-column prop="reserveDate" label="预约日期" align="center" />
<el-table-column prop="bankName" label="支行名称" align="center" />
<el-table-column prop="brandName" label="菜窖分类" align="center" />
<el-table-column prop="goodsName" label="商品名称" align="center" />
<el-table-column prop="goodsNumber" label="数量(份)" align="center" />
<el-table-column prop="bankAddress" label="支行地址" align="center" />
<el-table-column prop="bankLinker" label="支行联系人" align="center" />
<el-table-column prop="bankPhone" label="支行电话" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="page.total" :page.sync="page.current"
:limit.sync="page.size" class="pagination" @pagination="loadList" />
</div>
</div>
</div>
<!-- End 查询和其列表部分 -->
<!-- 新增修改部分组件 -->
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
</div>
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="page.total" :page.sync="page.current" :limit.sync="page.size" class="pagination" @pagination="loadList" />
</div>
</div>
</div>
<!-- End 查询和其列表部分 -->
<!-- 新增修改部分组件 -->
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
</div>
</template>
<script>
import req from '@/api/order/order.js'
import req2 from '@/api/pickupPoint/pickupPoint.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './indexInfo.vue'
import {
getBeforeDate
} from '@/utils/index'
export default {
name: 'SupplierBankInfoIndex',
components: {
ButtonBar,
Pagination,
pageye,
divAdd,
},
data() {
return {
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [{
type: 'success',
size: 'small',
icon: 'export',
btnKey: 'build',
btnLabel: '导出'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
page: {
total: 0, //
current: 1, //
size: 10, //
params: {
startDate: "",
endDate: "",
bankSid: "",
cardType: ""
},
},
bankList: [],
cardTypeList: [{
text: "全部",
sid: ""
},
{
text: "家庭卡",
sid: "1"
},
{
text: "亲情卡",
sid: "2"
},
{
text: "企业卡",
sid: "3"
},
]
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.getAllStore()
// this.loadList()
},
methods: {
//绿
cell({
row,
column,
rowIndex,
columnIndex
}) {
if (columnIndex == 3) {
return 'padding: 0px'
}
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'build': //
this.doBuild()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
selectTime1(val) {
console.log('selectTime1:', val)
this.page.params.startDate = val
},
selectTime2(val) {
console.log('selectTime2:', val)
this.page.params.endDate = val
},
bankSelect(val) {
console.log('>>>>>>>>>bankSelect', val)
this.page.params.bankSid = val
},
cardTypeSelect(val) {
console.log('>>>>>>>>>cardTypeSelect', val)
this.page.params.cardType = val
},
getAllStore() {
req2.bankSelect()
.then(resp => {
console.log('>>>>>>>>>bankSelect', resp)
this.bankList = resp.data
console.log('>>>>>>>>>bankSelect', this.bankList)
})
.catch(() => {})
},
loadList() {
this.tableLoading = true
req.bankOrderList(this.page).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.page.total = data.total
this.dataList = data.records
} else {
// resp.code
this.dataList = []
this.page.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
//
indexMethod(index) {
var pagestart = (this.page.current - 1) * this.page.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.page.current = 1
this.loadList()
},
resetQuery() {
this.page = {
current: 1,
size: 10,
total: 0,
params: {
startDate: "",
endDate: "",
bankSid: "",
cardType: ""
},
}
this.loadList()
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
resetState() {
this.viewState = 1
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
import req from '@/api/lpk/reserveorder.js'
import reqBank from '@/api/lpk/bank.js'
import reqMall from '@/api/adminmallapi.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import divAdd from './indexInfo.vue'
export default {
name: 'OrderreserveSubBranch',
components: {
ButtonBar,
Pagination,
divAdd
},
data() {
return {
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [{
type: 'success',
size: 'small',
icon: 'export',
btnKey: 'build',
btnLabel: '导出'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
page: {
total: 0, //
current: 1, //
size: 10, //
params: {
startDate: '',
endDate: '',
bankSid: '',
cardType: ''
}
},
brandList: [],
bankList: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.initBank()
this.initBrand()
},
methods: {
initBank() {
reqBank.listBankAll()
.then(resp => {
this.bankList = resp.data
})
},
initBrand() {
reqMall.listAllBrand().then(resp => {
this.brandList = resp.data
})
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'build': //
this.doBuild()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
req.pageOfBank(this.page).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.page.total = data.total
this.dataList = data.records
} else {
// resp.code
this.dataList = []
this.page.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
//
doBuild() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
//
indexMethod(index) {
var pagestart = (this.page.current - 1) * this.page.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.page.current = 1
this.loadList()
},
resetQuery() {
this.page = {
current: 1,
size: 10,
total: 0,
params: {
startDate: '',
endDate: '',
bankSid: '',
cardType: ''
}
}
this.loadList()
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
resetState() {
this.viewState = 1
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
req.bankOrderExportExcel(this.page.params).then((resp) => {
loading.close()
const blob = new Blob([resp], {
type: 'application/vnd.ms-excel'
})
const fileName = '支行配货明细_' + this.page.params.startDate + '.xls'
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'nonde'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
}).catch(() => {
loading.close()
})
},
//
doBuild() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.expExcelOfBank(this.page.params).then((resp) => {
loading.close()
const blob = new Blob([resp], {
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
})
const fileName = '支行配货明细_' + this.page.params.startDate + '.xlsx'
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'nonde'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
}).catch(() => {
loading.close()
})
}
}
}
}
}
</script>
<style scoped>
::v-deep .el-table .cell {
padding: 0px;
}
</style>
::v-deep .el-table .cell {
padding: 0px;
}
</style>

Loading…
Cancel
Save