This commit is contained in:
liupopo
2024-01-15 14:06:53 +08:00
commit 19049bd439
457 changed files with 24246 additions and 0 deletions

252
src/views/404.vue Normal file
View File

@@ -0,0 +1,252 @@
<template>
<div class="wscn-http404-container">
<div class="wscn-http404">
<div class="pic-404">
<img
class="pic-404__parent"
src="@/assets/404_images/404.png"
alt="404"
/>
<img
class="pic-404__child left"
src="@/assets/404_images/404_cloud.png"
alt="404"
/>
<img
class="pic-404__child mid"
src="@/assets/404_images/404_cloud.png"
alt="404"
/>
<img
class="pic-404__child right"
src="@/assets/404_images/404_cloud.png"
alt="404"
/>
</div>
<div class="bullshit">
<div class="bullshit__oops">OOPS!</div>
<div class="bullshit__info">
All rights reserved
<a
style="color: #20a0ff"
href="https://wallstreetcn.com"
target="_blank"
>wallstreetcn</a
>
</div>
<div class="bullshit__headline">{{ message }}</div>
<div class="bullshit__info">
Please check that the URL you entered is correct, or click the button
below to return to the homepage.
</div>
<a href="" class="bullshit__return-home">Back to home</a>
</div>
</div>
</div>
</template>
<script>
export default {
name: "Page404",
computed: {
message() {
return "The webmaster said that you can not enter this page...";
},
},
};
</script>
<style lang="scss" scoped>
.wscn-http404-container {
transform: translate(-50%, -50%);
position: absolute;
top: 40%;
left: 50%;
}
.wscn-http404 {
position: relative;
width: 1200px;
padding: 0 50px;
overflow: hidden;
.pic-404 {
position: relative;
float: left;
width: 600px;
overflow: hidden;
&__parent {
width: 100%;
}
&__child {
position: absolute;
&.left {
width: 80px;
top: 17px;
left: 220px;
opacity: 0;
animation-name: cloudLeft;
animation-duration: 2s;
animation-timing-function: linear;
animation-fill-mode: forwards;
animation-delay: 1s;
}
&.mid {
width: 46px;
top: 10px;
left: 420px;
opacity: 0;
animation-name: cloudMid;
animation-duration: 2s;
animation-timing-function: linear;
animation-fill-mode: forwards;
animation-delay: 1.2s;
}
&.right {
width: 62px;
top: 100px;
left: 500px;
opacity: 0;
animation-name: cloudRight;
animation-duration: 2s;
animation-timing-function: linear;
animation-fill-mode: forwards;
animation-delay: 1s;
}
@keyframes cloudLeft {
0% {
top: 17px;
left: 220px;
opacity: 0;
}
20% {
top: 33px;
left: 188px;
opacity: 1;
}
80% {
top: 81px;
left: 92px;
opacity: 1;
}
100% {
top: 97px;
left: 60px;
opacity: 0;
}
}
@keyframes cloudMid {
0% {
top: 10px;
left: 420px;
opacity: 0;
}
20% {
top: 40px;
left: 360px;
opacity: 1;
}
70% {
top: 130px;
left: 180px;
opacity: 1;
}
100% {
top: 160px;
left: 120px;
opacity: 0;
}
}
@keyframes cloudRight {
0% {
top: 100px;
left: 500px;
opacity: 0;
}
20% {
top: 120px;
left: 460px;
opacity: 1;
}
80% {
top: 180px;
left: 340px;
opacity: 1;
}
100% {
top: 200px;
left: 300px;
opacity: 0;
}
}
}
}
.bullshit {
position: relative;
float: left;
width: 300px;
padding: 30px 0;
overflow: hidden;
&__oops {
font-size: 32px;
font-weight: bold;
line-height: 40px;
color: #1482f0;
opacity: 0;
margin-bottom: 20px;
animation-name: slideUp;
animation-duration: 0.5s;
animation-fill-mode: forwards;
}
&__headline {
font-size: 20px;
line-height: 24px;
color: #222;
font-weight: bold;
opacity: 0;
margin-bottom: 10px;
animation-name: slideUp;
animation-duration: 0.5s;
animation-delay: 0.1s;
animation-fill-mode: forwards;
}
&__info {
font-size: 13px;
line-height: 21px;
color: grey;
opacity: 0;
margin-bottom: 30px;
animation-name: slideUp;
animation-duration: 0.5s;
animation-delay: 0.2s;
animation-fill-mode: forwards;
}
&__return-home {
display: block;
float: left;
width: 110px;
height: 36px;
background: #1482f0;
border-radius: 100px;
text-align: center;
color: #ffffff;
opacity: 0;
font-size: 14px;
line-height: 36px;
cursor: pointer;
animation-name: slideUp;
animation-duration: 0.5s;
animation-delay: 0.3s;
animation-fill-mode: forwards;
}
@keyframes slideUp {
0% {
transform: translateY(60px);
opacity: 0;
}
100% {
transform: translateY(0);
opacity: 1;
}
}
}
}
</style>

43
src/views/Home/Home.vue Normal file
View File

@@ -0,0 +1,43 @@
<template>
<div class="imgDemo">
<!--<el-button type="primary" @click="getToken()">token</el-button>
<div style="width: 200px;">{{token}}</div>-->
</div>
</template>
<script>
import {login1} from '@/api/system/user/login.js'
export default {
name: '',
data() {
return {
token:''
}
},
methods:{
// getToken(){
// let params = {
// password: "329653",
// roleSid: "",
// token: "",
// userName: "15097329653",
// verifyCode: ""
// }
// login1(params).then(res => {
// this.token = res.data.token
// window.sessionStorage.setItem('token', res.data.token)
// })
// }
}
}
</script>
<style lang="scss" scoped>
.imgDemo {
width: 100%;
height: 100%;
background: radial-gradient(#fff,#f5f7f4, #fff);
}
canvas {
}
</style>

View File

@@ -0,0 +1,308 @@
<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-input v-model="queryParams.params.serialNumber" placeholder="" clearable />
</el-form-item>
<!-- <el-form-item label="卡片状态">
<el-select v-model="queryParams.params.state" placeholder="请选择">
<el-option v-for="(item,i) in stateList" :key="i" :label="item.name"
:value="item.sid">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所属支行">
<el-select v-model="queryParams.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>
<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%" :row-style="{height: '40px'}">
<!-- <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="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
<el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button>
</template>
</el-table-column> -->
<el-table-column prop="serialNumber" label="卡券序列号" align="center" />
<el-table-column prop="code" label="提货编码" align="center" />
<el-table-column prop="createTime" label="发行时间" align="center" />
<el-table-column prop="stateValue" label="卡券状态" align="center" />
<el-table-column prop="bindDate" label="绑定时间" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
</div>
</div>
</div>
</div>
</template>
<script>
import req from '@/api/cardManage/cardManage.js'
import req2 from '@/api/pickupPoint/pickupPoint.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
export default {
name: 'SupplierBankInfoIndex',
components: {
ButtonBar,
Pagination,
pageye,
},
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: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
serialNumber: '',
state: '',
bankSid:""
}
},
bankList: [],
stateList: [{
name: "全部",
sid: ""
}, {
name: "未绑定用户",
sid: "2"
},
{
name: "未提货",
sid: "3"
},
{
name: "部分提货",
sid: "4"
},
{
name: "提货完成",
sid: "5"
}
],
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
// this.getBankList()
},
methods: {
getBankList() {
req2.bankSelect()
.then(resp => {
console.log('>>>>>>>>>getBankList', resp.data)
this.bankList = resp.data
})
.catch(() => {})
},
bankSelect(val) {
console.log('>>>>>>>>>bankSelect', val)
this.page.params.bankSid = val
},
// 搜索条件效果
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.empCardStatisticsList(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// 根据resp.code进行异常情况处理
this.dataList = []
this.queryParams.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
// 序号
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
serialNumber: '',
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选记录?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.brandDelBySids(row.id).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// 根据resp.code进行异常情况处理
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
resetState() {
this.viewState = 1
},
// 导出
doBuild() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.empCardStatisticsListExport(this.queryParams.params).then((resp) => {
loading.close()
const blob = new Blob([resp], {
type: 'application/vnd.ms-excel'
})
const fileName = '企业卡明细.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()
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,308 @@
<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-input v-model="queryParams.params.serialNumber" placeholder="" clearable />
</el-form-item>
<!-- <el-form-item label="卡片状态">
<el-select v-model="queryParams.params.state" placeholder="请选择">
<el-option v-for="(item,i) in stateList" :key="i" :label="item.name"
:value="item.sid">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所属支行">
<el-select v-model="queryParams.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>
<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%" :row-style="{height: '40px'}">
<!-- <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="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
<el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button>
</template>
</el-table-column> -->
<el-table-column prop="serialNumber" label="卡券序列号" align="center" />
<el-table-column prop="code" label="提货编码" align="center" />
<el-table-column prop="createTime" label="发行时间" align="center" />
<el-table-column prop="stateValue" label="卡券状态" align="center" />
<el-table-column prop="bindDate" label="绑定时间" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
</div>
</div>
</div>
</div>
</template>
<script>
import req from '@/api/cardManage/cardManage.js'
import req2 from '@/api/pickupPoint/pickupPoint.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
export default {
name: 'SupplierBankInfoIndex',
components: {
ButtonBar,
Pagination,
pageye,
},
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: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
serialNumber: '',
state: '',
bankSid:""
}
},
bankList: [],
stateList: [{
name: "全部",
sid: ""
}, {
name: "未绑定用户",
sid: "2"
},
{
name: "未提货",
sid: "3"
},
{
name: "部分提货",
sid: "4"
},
{
name: "提货完成",
sid: "5"
}
],
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
// this.getBankList()
},
methods: {
getBankList() {
req2.bankSelect()
.then(resp => {
console.log('>>>>>>>>>getBankList', resp.data)
this.bankList = resp.data
})
.catch(() => {})
},
bankSelect(val) {
console.log('>>>>>>>>>bankSelect', val)
this.page.params.bankSid = val
},
// 搜索条件效果
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.empCardGiftStatisticsList(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// 根据resp.code进行异常情况处理
this.dataList = []
this.queryParams.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
// 序号
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
serialNumber: '',
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选记录?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.brandDelBySids(row.id).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// 根据resp.code进行异常情况处理
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
resetState() {
this.viewState = 1
},
// 导出
doBuild() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.empCardStatisticsListExport(this.queryParams.params).then((resp) => {
loading.close()
const blob = new Blob([resp], {
type: 'application/vnd.ms-excel'
})
const fileName = '企业卡明细.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()
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,308 @@
<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-input v-model="queryParams.params.serialNumber" placeholder="" clearable />
</el-form-item>
<!-- <el-form-item label="卡片状态">
<el-select v-model="queryParams.params.state" placeholder="请选择">
<el-option v-for="(item,i) in stateList" :key="i" :label="item.name"
:value="item.sid">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所属支行">
<el-select v-model="queryParams.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>
<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%" :row-style="{height: '40px'}">
<!-- <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="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
<el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button>
</template>
</el-table-column> -->
<el-table-column prop="serialNumber" label="卡券序列号" align="center" />
<el-table-column prop="code" label="提货编码" align="center" />
<el-table-column prop="createTime" label="发行时间" align="center" />
<el-table-column prop="stateValue" label="卡券状态" align="center" />
<el-table-column prop="bindDate" label="绑定时间" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
</div>
</div>
</div>
</div>
</template>
<script>
import req from '@/api/cardManage/cardManage.js'
import req2 from '@/api/pickupPoint/pickupPoint.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
export default {
name: 'SupplierBankInfoIndex',
components: {
ButtonBar,
Pagination,
pageye,
},
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: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
serialNumber: '',
state: '',
bankSid:""
}
},
bankList: [],
stateList: [{
name: "全部",
sid: ""
}, {
name: "未绑定用户",
sid: "2"
},
{
name: "未提货",
sid: "3"
},
{
name: "部分提货",
sid: "4"
},
{
name: "提货完成",
sid: "5"
}
],
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
// this.getBankList()
},
methods: {
getBankList() {
req2.bankSelect()
.then(resp => {
console.log('>>>>>>>>>getBankList', resp.data)
this.bankList = resp.data
})
.catch(() => {})
},
bankSelect(val) {
console.log('>>>>>>>>>bankSelect', val)
this.page.params.bankSid = val
},
// 搜索条件效果
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.listPage(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// 根据resp.code进行异常情况处理
this.dataList = []
this.queryParams.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
// 序号
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
serialNumber: '',
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选记录?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.brandDelBySids(row.id).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// 根据resp.code进行异常情况处理
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
resetState() {
this.viewState = 1
},
// 导出
doBuild() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.exportExcel(this.queryParams.params).then((resp) => {
loading.close()
const blob = new Blob([resp], {
type: 'application/vnd.ms-excel'
})
const fileName = '提货卡明细.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()
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,271 @@
<template>
<div>
<div class="tab-header webtop">
<!-- 标题 -->
<div>商品信息</div>
<!-- start 添加修改按钮 -->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
<!-- end 添加修改按钮 -->
<!-- end 详情按钮 -->
</div>
<div class="listconadd">
<el-card class="box-card">
<div class="item">
<span class="item_text">名称</span>
<el-input v-model="formobj.name" placeholder="" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">编码</span>
<el-input v-model="formobj.code" placeholder="" class="item_input" clearable
oninput="value=value.replace(/[^A-Za-z0-9]/g, '')" />
</div>
<div class="item">
<span class="item_text">条码</span>
<el-input v-model="formobj.barcode" placeholder="" class="item_input" clearable
oninput="value=value.replace(/[^0-9]/g,'')" />
</div>
<div class="item">
<span class="item_text">价格 (/)</span>
<el-input v-model="formobj.price" placeholder="" class="item_input" clearable
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
</div>
<div class="item">
<span class="item_text">商品单位</span>
<el-input v-model="formobj.specificationUnit" placeholder="例如:斤/瓶/袋/箱/盒" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">规格 (/)</span>
<el-input v-model="formobj.weight" placeholder="例如30" class="item_input" clearable oninput="value=value.replace(/[^0-9]/g,'')" />
</div>
<div class="item">
<span class="item_text">规格单位</span>
<el-input v-model="formobj.unitName" placeholder="例如:份" :readonly="true" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">规格描述</span>
<el-input v-model="formobj.remarks" placeholder="例如一份30斤" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">商品简介</span>
<el-input v-model="formobj.content" placeholder="商品简介" class="item_input" clearable />
</div>
<div class="item" style="margin-bottom: 100px;margin-top: 100px;">
<span class="item_text">图片</span>
<upload style="margin-top: 20px;" class="item_input" ref="uploadImg2" v-model="imgList" :limit="1"
@change="backData" bucket="map" :class="{ hide: hideUploadBtn }"
:upload-data="{ type: '0001' }"></upload>
</div>
<div>
<span class="item_text">商品详情</span>
<editor :height="300" :minHeight="100" :value="formobj.appContent" @input="editinput"></editor>
</div>
</el-card>
</div>
</div>
</template>
<script>
import req from '@/api/commodity/commodity.js'
import upload from '@/components/uploadFile/upload_yanchejianchaTuBiao.vue'
import Editor from '@/components/Editor'
export default {
components: {
upload,
Editor
},
data() {
return {
imgList: [
],
submitdisabled: false,
formobj: {
sid: "",
name: '',
code: '',
barcode: '',
price: "",
unitName: "份",
specificationUnit:"",
weight:"",
remarks: "",
content: "",
picUrl: "",
appContent: ''
},
hideUploadBtn: false,
}
},
methods: {
backData(value) {
console.log("backData》》》》", value)
console.log("imgList", this.imgList)
if (this.imgList.length > 0) {
this.formobj.picUrl = this.imgList[0].url
} else {
this.formobj.picUrl = ""
}
this.hideUploadBtn = this.imgList.length != 0;
console.log("this.hideUploadBtn", this.hideUploadBtn)
},
saveOrUpdate() {
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
req.saveGoods(this.formobj)
.then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn('true')
} else {
// 根据resp.code进行异常情况处理
}
})
.catch(() => {})
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.imgList = []
this.formobj = {
sid: "",
name: '',
code: '',
barcode: '',
price: "",
unitName: "份",
specificationUnit:"",
weight:"",
remarks: "",
content: "",
picUrl: "",
appContent: ''
}
this.$emit('doback')
},
showAdd() {
console.log(this.imgList, 88888888)
},
showEdit(row) {
req.goodsInit(row.sid)
.then(resp => {
if (resp.success) {
this.formobj = resp.data
this.imgList = []
if (resp.data.picUrl != '')
this.imgList.push({
url: resp.data.picUrl
})
this.hideUploadBtn = this.imgList.length != 0;
console.log("this.hideUploadBtn", this.hideUploadBtn)
}
})
.catch(e => {
this.formobj = row
this.imgList = []
if (resp.data.picUrl != '')
this.imgList.push({
url: formobj.picUrl
})
this.hideUploadBtn = this.imgList.length != 0;
console.log("this.hideUploadBtn", this.hideUploadBtn)
})
},
editinput(text) {
this.formobj.appContent = text
}
}
}
</script>
<style lang="scss" scoped>
// 隐藏上传组件
::v-deep .hide {
.el-upload--picture-card {
display: none !important;
}
}
.box-card {
margin-left: 60px;
margin-right: 60px;
min-width: 70%;
margin-top: 20px;
.item {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 15px;
height: 40px;
line-height: 40px;
.item_text {
flex: 0.8;
font-size: 18px;
text-align: right;
}
.item_input {
flex: 4;
font-size: 16px;
margin-left: 10px;
margin-right: 80px;
}
.item_left_input {
width: 20%;
}
.item_left_text {
height: 30px;
margin-left: 20px;
line-height: 30px;
color: #018AD2;
padding: 0px 15px;
border: 1.5px solid #018AD2;
border-radius: 5px;
}
.item_right {
flex: 1;
justify-items: center;
.item_right_list_text {
font-size: 16px;
}
.item_right_list_delect {
color: #5E94FF;
margin-left: 20px;
font-size: 16px;
text-decoration: underline;
}
}
}
}
</style>

View File

@@ -0,0 +1,301 @@
<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-input v-model="queryParams.params.name" placeholder="" clearable />
</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%">
<!-- <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="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
<!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> -->
</template>
</el-table-column>
<el-table-column label="小程序自选商品" align="center" width="140">
<template slot-scope="scope">
<el-switch
v-model="scope.row.useTo"
active-text=""
inactive-text=""
active-value="1"
inactive-value="2"
@change="enableChange1(scope.row.sid,scope.row.useTo)"
/>
</template>
</el-table-column>
<el-table-column label="小程序是否上架" align="center" width="140">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isAppletGrounding"
active-text="上架"
inactive-text="下架"
active-value="1"
inactive-value="2"
@change="enableChange2(scope.row.sid,scope.row.isAppletGrounding)"
/>
</template>
</el-table-column>
<el-table-column prop="name" label="商品名称" align="center" />
<el-table-column label="商品图片" align="center">
<template slot-scope="scope">
<el-popover placement="left" trigger="click" width="300">
<img :src="scope.row.picUrl" width="100%" />
<img slot="reference" :src="scope.row.picUrl" :alt="scope.row.picUrl"
style="max-height: 70px;max-width: 70px; padding: 5px" />
</el-popover>
<!-- <span v-for="(item,index) in scope.row.picUrl" :key="index">
<el-popover placement="left" trigger="click" width="300">
<img :src="item.url" width="100%" />
<img slot="reference" :src="item.url" :alt="item.url"
style="max-height: 70px;max-width: 70px; padding: 5px" />
</el-popover>
</span> -->
</template>
</el-table-column>
<el-table-column prop="code" label="商品编码" align="center" />
<el-table-column prop="barcode" label="商品条码" align="center" />
<el-table-column prop="price" label="单价" align="center" />
<el-table-column prop="unitName" label="标准单位" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
:limit.sync="queryParams.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/commodity/commodity.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './commodityAdd.vue'
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: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
},
sids: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
},
methods: {
// 搜索条件效果
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
req.goodsListPage(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// 根据resp.code进行异常情况处理
this.dataList = []
this.queryParams.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
// 序号
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
name: '',
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选商品?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.deleteGoods(row.sid).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// 根据resp.code进行异常情况处理
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
resetState() {
this.viewState = 1
},
enableChange1(sid, state) {
console.log('sid', sid)
console.log('state', state)
req.updateAppletUseTo(sid, state).then((resp) => {
if (resp.success) {
this.$message({
type: 'success',
message: '状态已更新',
showClose: true
})
} else { // 根据resp.code进行异常情况处理
}
}).catch(e => {
console.log(e)
})
},
enableChange2(sid, state) {
console.log('sid', sid)
console.log('state', state)
req.updateIsEnable(sid, state).then((resp) => {
if (resp.success) {
this.$message({
type: 'success',
message: '状态已更新',
showClose: true
})
} else { // 根据resp.code进行异常情况处理
}
}).catch(e => {
console.log(e)
})
}
}
}
</script>
<style scoped>
</style>

51
src/views/index.vue Normal file
View File

@@ -0,0 +1,51 @@
<template>
<div class="imgDemo">
<!--<el-button type="primary" @click="getToken()">token</el-button>
<div style="width: 200px;">{{token}}</div>-->
</div>
</template>
<script>
import {login1} from '@/api/system/user/login.js'
export default {
name: '',
data() {
return {
token1:'',
token2:''
}
},
created() {
this.token1 = window.sessionStorage.getItem('tokenName');
this.token2 = window.sessionStorage.getItem('tokenValue');
console.log("tokenName2222", this.token1)
console.log("tokenValue222222", this.token2)
},
methods:{
// getToken(){
// let params = {
// password: "329653",
// roleSid: "",
// token: "",
// userName: "15097329653",
// verifyCode: ""
// }
// login1(params).then(res => {
// this.token = res.data.token
// window.sessionStorage.setItem('token', res.data.token)
// })
// }
}
}
</script>
<style lang="scss" scoped>
.imgDemo {
width: 100%;
height: 100%;
background: radial-gradient(#fff,#f5f7f4, #fff);
}
canvas {
}
</style>

279
src/views/login/login.vue Normal file
View File

@@ -0,0 +1,279 @@
<template>
<div class="login">
<div class="logoTitle" style="margin-left: 50px;margin-top: 50px;">
<!-- <img src="../../assets/loginImg/shgf.png"
style="width: 50px;height: 50px; margin-right: 10px;" /><span>汇融惠享</span>
<p class="title" style="margin-top: 5px;">汇融惠享管理平台</p> -->
</div>
<div class="main">
<div class="content">
<el-form ref="loginForm" :model="loginForm" class="login-form">
<h3 class="title1">用户登录</h3>
<el-form-item>
<el-input v-model="loginForm.userName" autocomplete="off" placeholder="请输入账号" prefix-icon="el-icon-user">
</el-input>
</el-form-item>
<el-form-item>
<el-input v-model="loginForm.password" autocomplete="off" placeholder="请输入密码" prefix-icon="el-icon-lock"
show-password>
</el-input>
<!-- <span class="nopsw register" @click="forgetPwd = true">忘记密码 </span> -->
</el-form-item>
<el-form-item v-show="showMsg" style="margin-bottom:0;">
<span class="text-danger">提示用户名或密码错误请重试</span>
</el-form-item>
<el-form-item>
<el-button type="primary" class="login-btn" v-loading="loading" @click="login"> </el-button>
<!-- <el-popover placement="top" width="400" trigger="click" v-model="loginCode" @show="codeShow">
<imgCodeRole @login="login" ref="imgCodeRole"></imgCodeRole>
<el-button slot="reference" type="primary" class="login-btn" v-loading="loading"> </el-button>
</el-popover> -->
<!--<router-link :to="{name: 'registUser'}" target="_blank" tag="a" class="register fl">个人注册</router-link>
<router-link :to="{name: 'registOrg'}" target="_blank" tag="a" class="register fr">单位注册</router-link>-->
</el-form-item>
</el-form>
</div>
</div>
<el-dialog title="忘记密码" :visible.sync="forgetPwd">
<el-form :model="nopassword">
<el-form-item label="手机号">
<el-input v-model="nopassword.userPhone" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="用户名">
<el-input v-model="nopassword.userName" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="forgetPwd = false"> </el-button>
<el-button type="primary" @click="reGetPwd()"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
doLogin,
getUserById,
imgCode
} from '@/api/user.js'
import user from '@/api/User/login.js'
import {
setToken,
getToken,
setSession
} from '@/utils/auth'
import imgCodeRole from '@/components/imgCodeRole/index.vue'
import qs from 'qs'
export default {
components: {
imgCodeRole
},
data() {
return {
loginForm: {
userName: '',
password: '',
},
imgCode: '',
loading: false,
loginCode: false,
showMsg: false,
forgetPwd: false,
nopassword: {
userPhone: '',
userName: '',
},
}
},
methods: {
login() {
console.log(66);
doLogin(this.loginForm).then((response) => {
if (response.code == 200) {
this.$router.push({
path: '/index'
})
this.loading = true
// this.getUserInfo(response.data.loginId)
window.sessionStorage.setItem('tokenName', response.data.tokenName)
window.sessionStorage.setItem('tokenValue', response.data.tokenValue)
}
}).catch(() => {
this.loading = true
})
},
getUserInfo(id) {
getUserById(id).then((response) => {
if (response.code == 200) {
console.log(" response", response)
let user = response.data
// 结果存入缓存
window.sessionStorage.setItem('staffSid', user.staffSid)
window.sessionStorage.setItem('sid', user.sid)
window.sessionStorage.setItem('userName', user.userName)
}
}).catch(() => {
})
},
codeShow() {
if (this.loginForm.password == '' || this.loginForm.userName == '') {
this.loginCode = false
this.showMsg = true
return
}
this.$refs.imgCodeRole.getCodeImage()
},
reGetPwd() {
user.reGetPwd(this.nopassword).then((res) => {})
},
},
}
</script>
<style lang="scss">
.login {
position: relative;
width: 100%;
height: 100%;
background-size: 100% 100%;
background-image: url(../../assets/home/bj.jpg);
background-position: center;
overflow: hidden;
.logoTitle {
margin: 30px;
img {
width: 70px;
}
span {
font-size: 40px;
color: #191919;
}
.title {
font-size: 25px;
font-family: Source Han Sans CN;
font-weight: 500;
color: #191919;
margin: 0;
}
}
.main {
width: 30%;
/*height: 640px;*/
background: #ffffff;
box-shadow: 0px 13px 12px 0px rgba(0, 0, 0, 0.15);
opacity: 0.8;
border-radius: 20px;
position: absolute;
right: 15%;
top:35%;
.content {
position: relative;
/*.title-h3{
width: 100%;
text-align: center;
color: #FFFFFF;
font-size: 30px;
margin: 0;
position: absolute;
top: -65px;
}*/
}
}
}
.login-form {
padding: 30px 50px;
.title1 {
margin: 0px auto 30px auto;
text-align: center;
font-size: 20px;
color: #191919;
font-size: 23px;
font-weight: 500;
}
.el-input {
border: none;
background-color: transparent;
}
.code {
position: absolute;
top: 3px;
right: 5px;
width: 35%;
height: 35px;
cursor: pointer;
z-index: 9;
}
.nopsw {
position: absolute;
bottom: -30px;
right: 5px;
color: #018ad2;
font-size: 15px;
line-height: 30px;
}
.register {
color: #EE640C;
}
.register:hover,
.nopsw:hover {
cursor: pointer;
}
.btn-eye {
cursor: pointer;
}
.text-danger {
color: #f56c6c;
}
.login-btn {
margin: 10px 0 10px 0;
width: 100%;
background-color: #EE640C;
border: 0;
}
.login-btn:hover {
background-color: #EE640C;
border: 0;
}
.el-input--prefix .el-input__inner {
border: 1px solid #EE640C;
background: transparent;
color: #333 !important;
}
.el-form-item {
margin-bottom: 40px;
}
.el-loading-mask {
background-color: rgba(255, 255, 255, 0.6);
}
}
</style>

View File

@@ -0,0 +1,282 @@
<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-input v-model="queryParams.params.name" placeholder="" clearable />
</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%">
<!-- <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="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toDetail(scope.row)">详情</el-button>
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
<!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> -->
</template>
</el-table-column>
<el-table-column label="是否上架" align="center" width="140">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isGrounding"
active-text="上架"
inactive-text="下架"
active-value="1"
inactive-value="0"
@change="enableChange(scope.row.sid,scope.row.isGrounding)"
/>
</template>
</el-table-column>
<el-table-column prop="name" label="礼包名称" align="center" />
<el-table-column label="礼包图片" align="center">
<template slot-scope="scope">
<el-popover placement="left" trigger="click" width="300">
<img :src="scope.row.iconUrl" width="100%" />
<img slot="reference" :src="scope.row.iconUrl" :alt="scope.row.iconUrl"
style="max-height: 70px;max-width: 70px; padding: 5px" />
</el-popover>
<!-- <span v-for="(item,index) in scope.row.picUrl" :key="index">
<el-popover placement="left" trigger="click" width="300">
<img :src="item.url" width="100%" />
<img slot="reference" :src="item.url" :alt="item.url"
style="max-height: 70px;max-width: 70px; padding: 5px" />
</el-popover>
</span> -->
</template>
</el-table-column>
<el-table-column prop="dateStart" label="起始日期" align="center" />
<el-table-column prop="dateEnd" label="终止日期" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
</div>
</div>
</div>
<!-- End 查询和其列表部分 -->
<!-- 新增修改部分组件 -->
<divAdd v-show="viewState == 2|| viewState ==3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
<divInfo v-show="viewState == 4" ref="divInfo" @doback="resetState" @reloadlist="loadList" />
</div>
</template>
<script>
import req from '@/api/marketingCard/marketingCard.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './appletAdd.vue'
import divInfo from './appletInfo.vue'
export default {
name: 'SupplierBankInfoIndex',
components: {
ButtonBar,
Pagination,
pageye,
divAdd,
divInfo
},
data() {
return {
btndisabled: false,
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
},
sids: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
},
methods: {
// 搜索条件效果
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
req.appletGiftBagListPage(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// 根据resp.code进行异常情况处理
this.dataList = []
this.queryParams.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
// 序号
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
name: '',
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
toDetail(row) {
this.viewState = 4
this.$refs['divInfo'].showAdd(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选记录?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.deleteBag(row.sid).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// 根据resp.code进行异常情况处理
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
resetState() {
this.viewState = 1
},
enableChange(sid, state) {
console.log('sid', sid)
console.log('state', state)
req.updateAppletgiftbagState(sid, state).then((resp) => {
if (resp.success) {
this.$message({
type: 'success',
message: '状态已更新',
showClose: true
})
} else { // 根据resp.code进行异常情况处理
}
}).catch(e => {
console.log(e)
})
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,524 @@
<template>
<div>
<div class="tab-header webtop">
<!-- 标题 -->
<div>礼包信息</div>
<!-- start 添加修改按钮 -->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
<!-- end 添加修改按钮 -->
<!-- end 详情按钮 -->
</div>
<div class="listconadd">
<el-form ref="dataForm" :model="formobj" label-position="top" label-width="190px" class="formadd">
<div class="title" style="display: flex;align-items: center;justify-content: space-between;height:40px">
<div>主体信息</div>
</div>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">礼包名称</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<el-input v-model="formobj.name" placeholder="" class="addinputw" style="width:100%"
clearable />
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<!-- <span slot="label">礼包金额</span> -->
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<!-- <span slot="label">{{formobj.price}}</span> -->
<!-- <el-input v-model="formobj.boundaryPrice" placeholder="" class="addinputw"
style="width:100%" clearable
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" /> -->
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">礼包总价格</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.price}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">优惠后价格</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<!-- <span slot="label">{{formobj.price}}</span> -->
<el-input v-model="formobj.preferentialPrice" placeholder="" class="addinputw"
style="width:100%" clearable
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">起始日期</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<el-date-picker v-model="formobj.dateStart" type="date" style="width:100%"
value-format="yyyy-MM-dd" placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">终止日期</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<el-date-picker v-model="formobj.dateEnd" type="date" style="width:100%"
value-format="yyyy-MM-dd" placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">备注信息</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<el-input v-model="formobj.remarks" placeholder="" class="addinputw" style="width:100%"
type="textarea" :rows="8" clearable />
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">礼包图片</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<upload style="margin-top: 20px;margin-bottom: 20px;" class="addinputw" ref="uploadImg2"
v-model="imgList" :limit="1" @change="backData" bucket="map"
:upload-data="{ type: '0001' }" :class="{ hide: hideUploadBtn }"></upload>
</el-form-item>
</el-col>
</el-row>
<el-collapse v-model="activeNames" style="margin-top: 20px;">
<el-collapse-item name="1">
<template slot="title">
商品列表<span class="span" @click.stop="add()">添加</span>
</template>
<el-table v-loading="listLoading" :data="formobj.goods" border style="width: 100%;"
:row-style="{height: '40px'}">
<!-- <el-table-column type="selection" align="center" width="50"/> -->
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center" />
<el-table-column label="操作" wid align="center" width="150">
<template slot-scope="scope">
<el-button type="primary" size="mini"
@click="doGoodsDel(scope.row.goodsSid)">删除</el-button>
</template>
</el-table-column>
<el-table-column label="商品名称" prop="name" align="center" />
<el-table-column label="份数" prop="goodsNumber" align="center" />
<el-table-column label="价格(元/斤)" prop="price" align="center" />
<el-table-column label="商品单位" prop="specificationUnit" align="center" />
<el-table-column label="规格(斤份)" prop="weight" align="center" />
<el-table-column label="小计" prop="subtotal" align="center" />
</el-table>
</el-collapse-item>
</el-collapse>
</el-form>
</div>
<el-dialog title="添加商品" :visible.sync="editDialog" width="30%" @close='handleCancle'>
<table class="e-table" cellspacing="0">
<tr>
<td>商品名称</td>
<td> <!-- @change="changeParentSid" -->
<el-select v-model="GiftBagGood.goodsSid" filterable clearable placeholder="请选择"
style="width:100%" @change="goodsSelect">
<el-option v-for="item in goods" :key="item.sid" :label="item.name" :value="item.sid">
</el-option>
</el-select>
</td>
</tr>
<tr>
<td>份数</td>
<td>
<el-input v-model="GiftBagGood.goodsNumber" style="width:100%"
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" @input="input"></el-input>
</td>
</tr>
<tr>
<td>价格(/)</td>
<td>
<!-- <span style="width:100%">{{GiftBagGood.price}}</span> -->
<el-input v-model="GiftBagGood.price" style="width:100%"
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')"></el-input>
</td>
</tr>
<tr>
<td>商品单位</td>
<td>
<span style="width:100%">{{GiftBagGood.specificationUnit}}</span>
<!-- <el-input v-model="GiftBagGood.unitName" style="width:100%"></el-input> -->
</td>
</tr>
<tr>
<td>规格(斤份)</td> <!-- // 一份多少斤 -->
<td>
<span style="width:100%">{{GiftBagGood.weight}}</span>
<!-- <el-input v-model="GiftBagGood.unitName" style="width:100%"></el-input> -->
</td>
</tr>
<tr>
<td>小计</td> <!-- // 份数*份单价 -->
<td>
<span style="width:100%">{{GiftBagGood.subtotal}}</span>
<!-- <el-input v-model="GiftBagGood.unitName" style="width:100%"></el-input> -->
</td>
</tr>
</table>
<div style="margin-top: 20px; text-align: center;">
<el-button type="primary" @click="save()"> </el-button>
<el-button @click="handleCancle"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import req from '@/api/marketingCard/marketingCard.js'
import upload from '@/components/uploadFile/upload_yanchejianchaTuBiao.vue'
export default {
components: {
upload
},
data() {
return {
editDialog: false,
listLoading: false,
activeNames: ['1'],
imgList: [],
submitdisabled: false,
formobj: {
sid: "",
name: '',
dateStart: '',
dateEnd: '',
preferentialPrice: "",
boundary: "",
remarks: "",
iconUrl: "",
goods: []
},
GiftBagGood: {
goodsSid: "",
goodsNumber: "",
name: "",
unitName: "",
price: "",
specificationUnit: "",
weight: "",
subtotal: "0.00"
},
goods: [],
hideUploadBtn: false,
}
},
created() {
this.getGoodList()
},
methods: {
doGoodsDel(sid) {
console.log("doGoodsDel》》》》", sid)
this.$confirm("是否确定删除此商品?", '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const index = this.formobj.goods.findIndex((item) => item.goodsSid === sid)
console.log("index》》》》", index)
this.formobj.goods.splice(index, 1)
this.countPrice()
})
},
save() {
console.log("save》》》》", this.GiftBagGood)
if (!this.GiftBagGood.goodsSid) {
this.$message({
showClose: true,
type: 'warning',
message: '请选择商品'
})
return
}
if (!this.GiftBagGood.goodsNumber) {
this.$message({
showClose: true,
type: 'warning',
message: '请输入数量'
})
return
}
const choose = this.formobj.goods.filter((item) => item.goodsSid == this.GiftBagGood.goodsSid)
console.log(">>>>>>>>>addCangku", choose)
if (choose.length == 0) {
this.formobj.goods.push(this.GiftBagGood)
this.GiftBagGood = {
goodsSid: "",
goodsNumber: "",
name: "",
unitName: "",
price: "",
specificationUnit: "",
weight: "",
subtotal: "0.00"
}
this.editDialog = false
this.countPrice()
} else {
this.$message({
showClose: true,
type: 'error',
message: "请勿重复添加商品!"
})
return
}
},
countPrice() {
let num = 0
for (var i = 0; i < this.formobj.goods.length; i++) {
var item = this.formobj.goods[i]
num += Number(item.subtotal)
}
console.log("num", num);
this.formobj.price = Number(num).toFixed(2)
this.formobj.preferentialPrice = Number(num).toFixed(2)
},
handleCancle() {
this.GiftBagGood = {
goodsSid: "",
goodsNumber: "",
name: "",
unitName: "",
price: "",
specificationUnit: "",
weight: "",
subtotal: "0.00"
}
this.editDialog = false
},
input(val) {
console.log("input》》》》", val)
this.GiftBagGood.goodsNumber = val
this.GiftBagGood.subtotal = this.GiftBagGood.goodsNumber * this.GiftBagGood.price * this.GiftBagGood.weight
},
add() {
this.editDialog = true
},
getGoodList() {
req.getGoods().then(resp => {
console.log("getGoods》》》》", resp)
this.goods = resp.data
}).catch(() => {})
},
goodsSelect(val) {
console.log("goodsSelect》》》》", val)
const choose = this.goods.filter((item) => item.sid === val)
this.GiftBagGood.goodsSid = choose[0].sid
this.GiftBagGood.name = choose[0].name
this.GiftBagGood.unitName = choose[0].unitName
this.GiftBagGood.price = choose[0].price
this.GiftBagGood.specificationUnit = choose[0].specificationUnit
this.GiftBagGood.weight = choose[0].weight
},
indexMethod(index) {
return index + 1
},
backData(value) {
console.log("backData》》》》", value)
console.log("imgList", this.imgList)
if (this.imgList.length > 0) {
this.formobj.iconUrl = this.imgList[0].url
} else {
this.formobj.iconUrl = ""
}
this.hideUploadBtn = this.imgList.length != 0;
console.log("this.hideUploadBtn", this.hideUploadBtn)
},
saveOrUpdate() {
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
this.submitdisabled = true
req.saveAppletGiftBag(this.formobj)
.then(resp => {
if (resp.success) {
this.submitdisabled = false
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn('true')
} else {
this.submitdisabled = false
// 根据resp.code进行异常情况处理
}
})
.catch(() => {
this.submitdisabled = false
})
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.imgList = []
this.formobj = {
sid: "",
name: '',
dateStart: '',
dateEnd: '',
boundaryPrice: "",
boundary: "",
remarks: "",
iconUrl: "",
goods: []
}
this.$emit('doback')
},
showAdd() {
},
showEdit(row) {
req.AppletGiftBagInit(row.sid)
.then(resp => {
if (resp.success) {
this.formobj = resp.data
this.imgList = []
if (resp.data.iconUrl != '')
this.imgList.push({
url: resp.data.iconUrl
})
this.hideUploadBtn = this.imgList.length != 0;
console.log("this.hideUploadBtn", this.hideUploadBtn)
}
})
.catch(e => {
this.formobj = row
this.imgList = []
if (resp.data.iconUrl != '')
this.imgList.push({
url: formobj.iconUrl
})
this.hideUploadBtn = this.imgList.length != 0;
console.log("this.hideUploadBtn", this.hideUploadBtn)
})
}
}
}
</script>
<style lang="scss" scoped>
// 隐藏上传组件
::v-deep .hide {
.el-upload--picture-card {
display: none !important;
}
}
.trightb {
display: flex;
align-items: center;
text-align: center;
justify-content: center;
}
.trightb_item {
padding-top: 5px;
}
.span {
margin-left: 50px;
font-size: 15px;
font-weight: 400;
}
::v-deep .el-collapse-item__header {
height: 40px;
padding: 10px;
font-weight: bold;
font-size: 20px;
text-align: left;
color: #ffffff;
background-color: #0294d7;
}
::v-deep .el-collapse-item__content {
padding-bottom: 0;
}
</style>

View File

@@ -0,0 +1,245 @@
<template>
<div>
<div class="tab-header webtop">
<!-- 标题 -->
<div>礼包信息</div>
<!-- start 添加修改按钮 -->
<div>
<!-- <el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button> -->
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
<!-- end 添加修改按钮 -->
<!-- end 详情按钮 -->
</div>
<div class="listconadd">
<el-form ref="dataForm" :model="formobj" label-position="top" label-width="190px" class="formadd">
<div class="title" style="display: flex;align-items: center;justify-content: space-between;height:40px">
<div>主体信息</div>
</div>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">礼包名称</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.name}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<!-- <span slot="label">边界金额</span> -->
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<!-- <span slot="label">{{formobj.boundaryPrice}}</span> -->
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">礼包总价格</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.price}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">优惠后价格</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.preferentialPrice}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">起始日期</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.dateStart}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">终止日期</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.dateEnd}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">备注信息</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.remarks}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">礼包图片</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<img :src="formobj.iconUrl" />
</el-form-item>
</el-col>
</el-row>
<el-collapse v-model="activeNames" style="margin-top: 20px;">
<el-collapse-item name="1" title="商品列表">
<!-- <template slot="title">
商品列表<span class="span" @click.stop="add()">添加</span>
</template> -->
<el-table v-loading="listLoading" :data="formobj.goods" border style="width: 100%;"
:row-style="{height: '40px'}">
<!-- <el-table-column type="selection" align="center" width="50"/> -->
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center" />
<!-- <el-table-column label="操作" wid align="center" width="150">
<template slot-scope="scope">
<el-button type="primary" size="mini"
@click="doGoodsDel(scope.row.goodsSid)">删除</el-button>
</template>
</el-table-column> -->
<el-table-column label="商品名称" prop="name" align="center" />
<el-table-column label="份数" prop="goodsNumber" align="center" />
<el-table-column label="价格(元/斤)" prop="price" align="center" />
<el-table-column label="商品单位" prop="specificationUnit" align="center" />
<el-table-column label="规格(斤份)" prop="weight" align="center" />
<el-table-column label="小计" prop="subtotal" align="center" />
</el-table>
</el-collapse-item>
</el-collapse>
</el-form>
</div>
</div>
</template>
<script>
import req from '@/api/marketingCard/marketingCard.js'
export default {
data() {
return {
listLoading: false,
activeNames: ['1'],
submitdisabled: false,
formobj: {
sid: "",
name: '',
dateStart: '',
dateEnd: '',
boundaryPrice: "",
boundary: "",
remarks: "",
iconUrl: "",
goods: []
},
}
},
methods: {
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.imgList = []
this.formobj = {
sid: "",
name: '',
dateStart: '',
dateEnd: '',
boundaryPrice: "",
boundary: "",
remarks: "",
iconUrl: "",
goods: []
}
this.$emit('doback')
},
indexMethod(index) {
return index + 1
},
showAdd(row) {
console.log("showAdd》》》》", row)
req.AppletGiftBagInit(row.sid)
.then(resp => {
if (resp.success) {
this.formobj = resp.data
this.imgList = []
this.imgList.push({
url: resp.data.iconUrl
})
}
})
.catch(e => {
this.formobj = row
this.imgList = []
this.imgList.push({
url: formobj.iconUrl
})
})
},
}
}
</script>
<style scoped>
.trightb {
display: flex;
align-items: center;
text-align: center;
justify-content: center;
}
.trightb_item {
padding-top: 5px;
}
.span {
margin-left: 50px;
font-size: 15px;
font-weight: 400;
}
/deep/.el-collapse-item__header {
height: 40px;
padding: 10px;
font-weight: bold;
font-size: 20px;
text-align: left;
color: #ffffff;
background-color: #0294d7;
}
/deep/.el-collapse-item__content {
padding-bottom: 0;
}
</style>

View File

@@ -0,0 +1,231 @@
<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-input v-model="listQuery.params.number" placeholder="" clearable />
</el-form-item>
<el-form-item label="卡片状态">
<el-select v-model="listQuery.params.state" placeholder="请选择">
<el-option v-for="(item,i) in stateList" :key="i" :label="item.name"
: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%" :row-style="{height: '40px'}">
<!-- <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="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
<el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button>
</template>
</el-table-column> -->
<el-table-column prop="serialNumber" label="序列号" align="center"/>
<el-table-column prop="code" label="提货码" align="center"/>
<el-table-column prop="codeKey" label="提货密码" align="center"/>
<el-table-column prop="state" label="卡片状态" align="center"/>
<el-table-column prop="customerMobile" label="绑定网点" align="center"/>
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="listQuery.total" :page.sync="listQuery.current"
:limit.sync="listQuery.size" class="pagination" @pagination="loadList" />
</div>
</div>
</div>
</div>
</template>
<script>
import req from '@/api/marketingCard/marketingCard.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
export default {
name: 'SupplierBankInfoIndex',
components: {
ButtonBar,
Pagination,
pageye,
},
data() {
return {
btndisabled: false,
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
listQuery: {
current: 1,
size: 10,
total: 0,
params: {
number: '',
state: '',
}
},
sids: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
},
methods: {
// 搜索条件效果
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
req.bankListPage(this.listQuery).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.listQuery.total = data.total
this.dataList = data.records
} else {
// 根据resp.code进行异常情况处理
this.dataList = []
this.listQuery.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
// 序号
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.listQuery.current = 1
this.loadList()
},
resetQuery() {
this.listQuery = {
current: 1,
size: 10,
total: 0,
params: {
number: '',
state: '',
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选网点?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.deleteBank(row.sid).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// 根据resp.code进行异常情况处理
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
resetState() {
this.viewState = 1
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,576 @@
<template>
<div>
<el-tabs v-model="activeName" class="my-tabs" type="card" @tab-click="handleClick" style="margin-top: 20px;">
<el-tab-pane label="企业卡记录" name="roleList">
<div class="main-content">
<div class="container" v-show="viewState == 1">
<div class="tab-header">
<el-form :inline="true" :model="page.params" class="demo-form-inline">
<el-row :gutter="20">
<el-col :span="21">
<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-button type="primary" @click="getPageList()"> </el-button>
</el-col>
</el-row>
</el-form>
</div>
<el-table :data="tableData" border style="width: 100%; margin-top: 20px;"
:row-style="{height: '40px'}">
<el-table-column label="序号" width="70px" type="index" :index="indexMethod" align="center">
</el-table-column>
<el-table-column label="操作" width="150px" align="center">
<template slot-scope="scope">
<!-- <el-button type="primary" size="mini" @click="editRow(scope.row)">
发放
</el-button> -->
<el-button type="primary" size="mini" @click="showRow(scope.row)">
明细
</el-button>
</template>
</el-table-column>
<el-table-column prop="startNumber" label="序列起始号" align="center">
</el-table-column>
<el-table-column prop="endNumber" label="序列结束号" align="center">
</el-table-column>
<el-table-column prop="buildDate" label="发行时间" align="center">
</el-table-column>
<el-table-column prop="countNumber" label="发行总数" align="center">
</el-table-column>
<el-table-column prop="bagName" label="绑定礼包" align="center">
</el-table-column>
<!-- <el-table-column prop="bagName" label="发放数量" align="center">
</el-table-column> -->
</el-table>
<pagination :total="page.total" :page.sync="page.current" :limit.sync="page.size"
@pagination="getPageList" style="padding-bottom: 100px;" />
</div>
<div class="container" v-show="viewState == 2">
<div class="tab-header">
<el-form :inline="true" :model="listQuery.params" class="demo-form-inline">
<el-row :gutter="20">
<el-col :span="20">
<el-form-item label="卡片序列号">
<el-input v-model="listQuery.params.number" placeholder="" clearable />
</el-form-item>
<el-form-item label="卡片状态">
<el-select v-model="listQuery.params.state" placeholder="请选择">
<el-option v-for="(item,i) in stateList" :key="i" :label="item.name"
:value="item.sid">
</el-option>
</el-select>
</el-form-item>
<el-button type="primary" @click="getPageList2()"> </el-button>
<el-button type="primary" @click="returnView()"> </el-button>
</el-col>
<el-col :span="4">
<el-form-item style="float: right;">
<div
style="display: flex;flex-direction: row;align-items: center;justify-content: space-between;">
<el-button type="primary" @click="exportExcel()">导出Excel</el-button>
<el-button type="primary" @click="downloadQR()"
style="margin-left: 10px;">下载二维码</el-button>
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-table :data="tableData2" border style="width: 100%; margin-top: 20px;"
:row-style="{height: '40px'}">
<el-table-column label="序号" width="70px" type="index" :index="indexMethod2" align="center">
</el-table-column>
<!-- <el-table-column label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="editRow(scope.row)">
明细
</el-button>
</template>
</el-table-column> -->
<el-table-column prop="serialNumber" label="序列号" align="center">
</el-table-column>
<el-table-column prop="code" label="卡号" align="center">
</el-table-column>
<el-table-column prop="codeKey" label="秘钥" align="center">
</el-table-column>
<el-table-column prop="state" label="卡片状态" align="center">
</el-table-column>
<!-- <el-table-column prop="name" label="发放时间" align="center">
</el-table-column>
<el-table-column prop="buildDate" label="发放网点" align="center">
</el-table-column> -->
</el-table>
<pagination :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size"
@pagination="getPageList2" style="padding-bottom: 100px;" />
</div>
</div>
</el-tab-pane>
<el-tab-pane label="发行企业卡" name="addrole">
<div class="listconadd">
<el-card class="box-card">
<div class="item">
<span class="item_text">区域编码</span>
<el-input v-model="formobj.cardArea" placeholder="" class="item_input"
oninput="value=value.replace(/[^0-9]/g,'')" maxlength="2" clearable />
</div>
<div class="item">
<span class="item_text">券卡数量</span>
<el-input v-model="formobj.num" placeholder="" class="item_input"
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" clearable />
</div>
<div class="item">
<span class="item_text">选择礼包</span>
<el-select v-model="formobj.giftbagSid" filterable class="item_input" clearable
placeholder="请选择" style="width:100%" @change="giftPackSelect">
<el-option v-for="item in giftPackList" :key="item.sid" :label="item.name"
:value="item.sid">
</el-option>
</el-select>
</div>
<div
style="width: 100%;display: flex;flex-direction: row;justify-content: center;margin-top: 20px;">
<span
style="background: #018AD2; color: #fff;padding: 5px 15px;border-radius: 5px;font-size: 16px;"
@click="saveOrUpdate" >发行</span>
</div>
</el-card>
</div>
</el-tab-pane>
</el-tabs>
<el-dialog title="发放信息" :visible.sync="editDialog" width="30%" :before-close="banClose">
<table class="e-table" cellspacing="0">
<tr>
<td>起始序列号</td>
<td> <!-- @change="changeParentSid" -->
<el-input v-model="from.start" style="width:100%" oninput="value=value.replace(/[^0-9]/g,'')"
@input="input1"></el-input>
</td>
</tr>
<tr>
<td>结束序列号</td>
<td>
<el-input v-model="from.end" style="width:100%" oninput="value=value.replace(/[^0-9]/g,'')"
@input="input2"></el-input>
</td>
</tr>
<tr>
<td>发放网点</td>
<td>
<el-select v-model="from.bankSid" filterable clearable placeholder="请选择" style="width:100%"
@change="bankSelect">
<el-option v-for="item in bankList" :key="item.sid" :label="item.name" :value="item.sid">
</el-option>
</el-select>
</td>
</tr>
</table>
<div style="margin-top: 20px; text-align: center;">
<el-button type="primary" @click="save()"> </el-button>
<el-button @click="banClose"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import req from '@/api/corporateCardSet/corporateCardSet.js'
export default {
data() {
return {
viewState: 1,
page: {
total: 0, // 默认数据总数
current: 1, // 默认开始页面
size: 10, // 每页的数据条数
params: {
startDate: '',
endDate: '',
},
},
tableData: [],
tableData2: [],
listQuery: {
total: 0, // 默认数据总数
current: 1, // 默认开始页面
size: 10, // 每页的数据条数
params: {
sid: "",
number: '',
state: '',
},
},
activeName: 'roleList',
formobj: {
cardArea: "",
num: '',
giftbagSid: ""
},
giftPackList: [],
stateList: [{
name: "全部",
sid: ""
}, {
name: "未绑定",
sid: "1"
}, {
name: "已绑定用户",
sid: "2"
}],
recordId: '',
editDialog: false,
from: {
start: "",
end: "",
bankSid: ""
},
bankList: []
}
},
created() {
this.getPageList()
this.getBankList()
},
methods: {
// 序号
indexMethod(index) {
var pagestart = (this.page.current - 1) * this.page.size
var pageindex = index + 1 + pagestart
return pageindex
},
// 序号
indexMethod2(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
handleClick(tab, event) {
this.viewState = 1
this.listQuery = {
total: 0, // 默认数据总数
current: 1, // 默认开始页面
size: 10, // 每页的数据条数
params: {
sid: "",
number: '',
state: '',
},
}
if (tab.name == 'addrole') {
this.giftBagList()
} else {
this.getPageList()
}
},
pagination(val) { // 分页
this.page.current = val.pageNum
this.page.size = val.pageSize
this.getPageList(this.page)
},
pagination2(val) { // 分页
this.listQuery.current = val.pageNum
this.listQuery.size = val.pageSize
this.getPageList2(this.listQuery)
},
selectTime1(val) {
console.log('selectTime1:', val)
this.page.params.startDate = val
},
selectTime2(val) {
console.log('selectTime2:', val)
this.page.params.endDate = val
},
getPageList() {
req.recordListPage(this.page)
.then(resp => {
console.log('>>>>>>>>>getPageList', resp.data)
this.tableData = resp.data.records
this.page.total = resp.data.total
})
.catch(() => {})
},
getPageList2() {
req.recordDetails(this.listQuery)
.then(resp => {
console.log('>>>>>>>>>recordDetails', resp.data)
this.tableData2 = resp.data.records
this.recordId = resp.data.records[0].recordId
this.listQuery.total = resp.data.total
})
.catch(() => {
})
},
editRow(row) {
this.editDialog = true
},
showRow(row) {
this.listQuery.params.sid = row.sid
this.viewState = 2
req.recordDetails(this.listQuery)
.then(resp => {
console.log('>>>>>>>>>recordDetails', resp.data)
this.tableData2 = resp.data.records
this.recordId = resp.data.records[0].recordId
this.listQuery.total = resp.data.total
})
.catch(() => {
})
},
returnView() {
this.tableData2 = []
this.viewState = 1
this.listQuery = {
total: 0, // 默认数据总数
current: 1, // 默认开始页面
size: 10, // 每页的数据条数
params: {
sid: "",
number: '',
state: '',
},
}
},
exportExcel() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
this.listQuery.params.serialNumber = '',
this.listQuery.params.state = '',
req.exportExcel(this.listQuery.params).then((resp) => {
loading.close()
const blob = new Blob([resp], {
type: 'application/vnd.ms-excel'
})
const fileName = '企业卡明细列表(批次号_' + this.recordId + ').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()
})
},
downloadQR() {
this.$message({
showClose: true,
type: 'success',
message: '功能暂未完善...'
})
},
giftBagList() {
req.giftBagList()
.then(resp => {
console.log('>>>>>>>>>giftBagList', resp.data)
this.giftPackList = resp.data
})
.catch(() => {})
},
giftPackSelect(val) {
console.log('>>>>>>>>>giftPackSelect', val)
this.formobj.giftbagSid = val
},
saveOrUpdate() {
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
req.generateCard(this.formobj)
.then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn('true')
} else {
// 根据resp.code进行异常情况处理
}
})
.catch(() => {})
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.formobj = {
cardArea: "",
num: '',
giftbagSid: ""
}
this.$emit('doback')
},
getBankList() {
req.bankList()
.then(resp => {
console.log('>>>>>>>>>getBankList', resp.data)
this.bankList = resp.data
})
.catch(() => {})
},
input1(val) {
console.log("input1》》》》", val)
},
input2(val) {
console.log("input2》》》》", val)
},
bankSelect(val) {
console.log("bankSelect》》》》", val)
const choose = this.bankList.filter((item) => item.sid === val)
this.from.bankSid = choose[0].sid
},
save() {
console.log("save》》》》", this.from)
req.cardGrant(this.from)
.then(resp => {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.editDialog = false
this.from = {
start: "",
end: "",
bankSid: ""
}
this.getPageList()
})
.catch(() => {})
},
banClose() {
this.from = {
start: "",
end: "",
bankSid: ""
}
this.editDialog = false
},
}
}
</script>
<style lang="scss">
.box-card {
margin-left: 60px;
margin-right: 60px;
min-width: 70%;
margin-top: 20px;
margin-bottom: 50px;
.item {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 15px;
height: 40px;
line-height: 40px;
.item_text {
flex: 0.8;
font-size: 18px;
text-align: right;
}
.item_input {
flex: 4;
font-size: 16px;
margin-left: 10px;
margin-right: 80px;
}
.item_left_input {
width: 20%;
}
.item_left_text {
height: 30px;
margin-left: 20px;
line-height: 30px;
color: #018AD2;
padding: 0px 15px;
border: 1.5px solid #018AD2;
border-radius: 5px;
}
.item_right {
flex: 1;
justify-items: center;
.item_right_list_text {
font-size: 16px;
}
.item_right_list_delect {
color: #5E94FF;
margin-left: 20px;
font-size: 16px;
text-decoration: underline;
}
}
}
}
</style>

View File

@@ -0,0 +1,237 @@
<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="queryParams.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-select v-model="queryParams.params.bankSid" placeholder="请选择">
<el-option v-for="(item,i) in stateList" :key="i" :label="item.name"
: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%" :row-style="{height: '40px'}">
<!-- <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="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
<el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button>
</template>
</el-table-column> -->
<el-table-column prop="address" label="发放时间" align="center" />
<el-table-column prop="name" label="起始序列号" align="center" />
<el-table-column prop="shortName" label="结束序列号" align="center" />
<el-table-column prop="linker" label="发放数量" align="center" />
<el-table-column prop="linkPhone" label="发放网点" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
</div>
</div>
</div>
</div>
</template>
<script>
import req from '@/api/marketingCard/marketingCard.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
export default {
name: 'SupplierBankInfoIndex',
components: {
ButtonBar,
Pagination,
pageye,
},
data() {
return {
btndisabled: false,
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
date: '',
bankSid:""
}
},
sids: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
},
methods: {
// 搜索条件效果
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
req.bankListPage(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// 根据resp.code进行异常情况处理
this.dataList = []
this.queryParams.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
// 序号
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
date: '',
bankSid:""
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选网点?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.deleteBank(row.sid).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// 根据resp.code进行异常情况处理
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
resetState() {
this.viewState = 1
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,284 @@
<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-input v-model="queryParams.params.name" placeholder="" clearable />
</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%">
<!-- <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="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toDetail(scope.row)">详情</el-button>
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
<!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> -->
</template>
</el-table-column>
<el-table-column label="是否上架" align="center" width="140">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isGrounding"
active-text="上架"
inactive-text="下架"
active-value="1"
inactive-value="0"
@change="enableChange(scope.row.sid,scope.row.isGrounding)"
/>
</template>
</el-table-column>
<el-table-column prop="name" label="礼包名称" align="center" />
<el-table-column label="礼包图片" align="center">
<template slot-scope="scope">
<el-popover placement="left" trigger="click" width="300">
<img :src="scope.row.iconUrl" width="100%" />
<img slot="reference" :src="scope.row.iconUrl" :alt="scope.row.iconUrl"
style="max-height: 70px;max-width: 70px; padding: 5px" />
</el-popover>
<!-- <span v-for="(item,index) in scope.row.picUrl" :key="index">
<el-popover placement="left" trigger="click" width="300">
<img :src="item.url" width="100%" />
<img slot="reference" :src="item.url" :alt="item.url"
style="max-height: 70px;max-width: 70px; padding: 5px" />
</el-popover>
</span> -->
</template>
</el-table-column>
<el-table-column prop="boundaryPrice" label="边界金额" align="center" />
<el-table-column prop="dateStart" label="起始日期" align="center" />
<el-table-column prop="dateEnd" label="终止日期" align="center" />
<el-table-column prop="boundary" label="发放条件" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
</div>
</div>
</div>
<!-- End 查询和其列表部分 -->
<!-- 新增修改部分组件 -->
<divAdd v-show="viewState == 2|| viewState ==3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
<divInfo v-show="viewState == 4" ref="divInfo" @doback="resetState" @reloadlist="loadList" />
</div>
</template>
<script>
import req from '@/api/marketingCard/marketingCard.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './indexAdd.vue'
import divInfo from './indexInfo.vue'
export default {
name: 'SupplierBankInfoIndex',
components: {
ButtonBar,
Pagination,
pageye,
divAdd,
divInfo
},
data() {
return {
btndisabled: false,
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
},
sids: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
},
methods: {
// 搜索条件效果
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
req.giftBagListPage(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// 根据resp.code进行异常情况处理
this.dataList = []
this.queryParams.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
// 序号
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
name: '',
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
toDetail(row) {
this.viewState = 4
this.$refs['divInfo'].showAdd(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选记录?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.deleteBag(row.sid).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// 根据resp.code进行异常情况处理
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
resetState() {
this.viewState = 1
},
enableChange(sid, state) {
console.log('sid', sid)
console.log('state', state)
req.updateIsEnable(sid, state).then((resp) => {
if (resp.success) {
this.$message({
type: 'success',
message: '状态已更新',
showClose: true
})
} else { // 根据resp.code进行异常情况处理
}
}).catch(e => {
console.log(e)
})
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,465 @@
<template>
<div>
<div class="tab-header webtop">
<!-- 标题 -->
<div>礼包信息</div>
<!-- start 添加修改按钮 -->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
<!-- end 添加修改按钮 -->
<!-- end 详情按钮 -->
</div>
<div class="listconadd">
<el-form ref="dataForm" :model="formobj" label-position="top" label-width="190px" class="formadd">
<div class="title" style="display: flex;align-items: center;justify-content: space-between;height:40px">
<div>主体信息</div>
</div>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">礼包名称</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<el-input v-model="formobj.name" placeholder="" class="addinputw" style="width:100%"
clearable />
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">边界金额</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<el-input v-model="formobj.boundaryPrice" placeholder="" class="addinputw"
style="width:100%" clearable
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">起始日期</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<el-date-picker v-model="formobj.dateStart" type="date" style="width:100%"
value-format="yyyy-MM-dd" placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">终止日期</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<el-date-picker v-model="formobj.dateEnd" type="date" style="width:100%"
value-format="yyyy-MM-dd" placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">发放条件</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<el-input v-model="formobj.boundary" placeholder="" class="addinputw" style="width:100%"
clearable />
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label"></span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span></span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">备注信息</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<el-input v-model="formobj.remarks" placeholder="" class="addinputw" style="width:100%"
type="textarea" :rows="8" clearable />
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">礼包图片</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<upload style="margin-top: 20px;margin-bottom: 20px;" class="addinputw" ref="uploadImg2"
v-model="imgList" :limit="1" @change="backData" bucket="map"
:upload-data="{ type: '0001' }" :class="{ hide: hideUploadBtn }"></upload>
</el-form-item>
</el-col>
</el-row>
<el-collapse v-model="activeNames" style="margin-top: 20px;">
<el-collapse-item name="1">
<template slot="title">
商品列表<span class="span" @click.stop="add()">添加</span>
</template>
<el-table v-loading="listLoading" :data="formobj.goods" border style="width: 100%;"
:row-style="{height: '40px'}">
<!-- <el-table-column type="selection" align="center" width="50"/> -->
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center" />
<el-table-column label="操作" wid align="center" width="150">
<template slot-scope="scope">
<el-button type="primary" size="mini"
@click="doGoodsDel(scope.row.goodsSid)">删除</el-button>
</template>
</el-table-column>
<el-table-column label="商品名称" prop="name" align="center" />
<el-table-column label="商品数量" prop="goodsNumber" align="center" />
<el-table-column label="商品价格" prop="price" align="center" />
<el-table-column label="商品单位" prop="unitName" align="center" />
</el-table>
</el-collapse-item>
</el-collapse>
</el-form>
</div>
<el-dialog title="添加商品" :visible.sync="editDialog" width="30%" @close='handleCancle'>
<table class="e-table" cellspacing="0">
<tr>
<td>商品名称</td>
<td> <!-- @change="changeParentSid" -->
<el-select v-model="GiftBagGood.goodsSid" filterable clearable placeholder="请选择"
style="width:100%" @change="goodsSelect">
<el-option v-for="item in goods" :key="item.sid" :label="item.name" :value="item.sid">
</el-option>
</el-select>
</td>
</tr>
<tr>
<td>商品数量</td>
<td>
<el-input v-model="GiftBagGood.goodsNumber" style="width:100%"
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" @input="input"></el-input>
</td>
</tr>
<tr>
<td>商品价格</td>
<td>
<span style="width:100%">{{GiftBagGood.price}}</span>
<!-- <el-input v-model="" style="width:100%"></el-input> -->
</td>
</tr>
<tr>
<td>商品单位</td>
<td>
<span style="width:100%">{{GiftBagGood.unitName}}</span>
<!-- <el-input v-model="GiftBagGood.unitName" style="width:100%"></el-input> -->
</td>
</tr>
</table>
<div style="margin-top: 20px; text-align: center;">
<el-button type="primary" @click="save()"> </el-button>
<el-button @click="handleCancle"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import req from '@/api/marketingCard/marketingCard.js'
import upload from '@/components/uploadFile/upload_yanchejianchaTuBiao.vue'
export default {
components: {
upload
},
data() {
return {
editDialog: false,
listLoading: false,
activeNames: ['1'],
imgList: [],
submitdisabled: false,
formobj: {
sid: "",
name: '',
dateStart: '',
dateEnd: '',
boundaryPrice: "",
boundary: "",
remarks: "",
iconUrl: "",
goods: []
},
GiftBagGood: {
goodsSid: "",
goodsNumber: "",
name: "",
unitName: "",
price: "",
},
goods: [],
hideUploadBtn: false,
}
},
created() {
this.getGoodList()
},
methods: {
doGoodsDel(sid) {
console.log("doGoodsDel》》》》", sid)
this.$confirm("是否确定删除此商品?", '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const index = this.formobj.goods.findIndex((item) => item.goodsSid === sid)
console.log("index》》》》", index)
this.formobj.goods.splice(index, 1)
})
},
save() {
console.log("save》》》》", this.GiftBagGood)
if (!this.GiftBagGood.goodsSid) {
this.$message({
showClose: true,
type: 'warning',
message: '请选择商品'
})
return
}
if (!this.GiftBagGood.goodsNumber) {
this.$message({
showClose: true,
type: 'warning',
message: '请输入数量'
})
return
}
const choose = this.formobj.goods.filter((item) => item.goodsSid == this.GiftBagGood.goodsSid)
console.log(">>>>>>>>>addCangku", choose)
if (choose.length == 0) {
this.formobj.goods.push(this.GiftBagGood)
this.GiftBagGood = {
goodsSid: "",
goodsNumber: "",
name: "",
unitName: "",
price: "",
}
this.editDialog = false
} else {
this.$message({
showClose: true,
type: 'error',
message: "请勿重复添加商品!"
})
return
}
},
handleCancle(){
this.GiftBagGood = {
goodsSid: "",
goodsNumber: "",
name: "",
unitName: "",
price: "",
}
this.editDialog = false
},
input(val) {
console.log("input》》》》", val)
this.GiftBagGood.goodsNumber = val
},
add() {
this.editDialog = true
},
getGoodList() {
req.getGoods().then(resp => {
console.log("getGoods》》》》", resp)
this.goods = resp.data
}).catch(() => {})
},
goodsSelect(val) {
console.log("goodsSelect》》》》", val)
const choose = this.goods.filter((item) => item.sid === val)
this.GiftBagGood.goodsSid = choose[0].sid
this.GiftBagGood.name = choose[0].name
this.GiftBagGood.unitName = choose[0].unitName
this.GiftBagGood.price = choose[0].price
},
indexMethod(index) {
return index + 1
},
backData(value) {
console.log("backData》》》》", value)
console.log("imgList", this.imgList)
if (this.imgList.length > 0) {
this.formobj.iconUrl = this.imgList[0].url
} else {
this.formobj.iconUrl = ""
}
this.hideUploadBtn = this.imgList.length != 0;
console.log("this.hideUploadBtn", this.hideUploadBtn)
},
saveOrUpdate() {
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
this.submitdisabled = true
req.saveGiftBag(this.formobj)
.then(resp => {
if (resp.success) {
this.submitdisabled = false
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn('true')
} else {
this.submitdisabled = false
// 根据resp.code进行异常情况处理
}
})
.catch(() => {
this.submitdisabled = false
})
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.imgList = []
this.formobj = {
sid: "",
name: '',
dateStart: '',
dateEnd: '',
boundaryPrice: "",
boundary: "",
remarks: "",
iconUrl: "",
goods: []
}
this.$emit('doback')
},
showAdd() {
},
showEdit(row) {
req.giftBagInit(row.sid)
.then(resp => {
if (resp.success) {
this.formobj = resp.data
this.imgList = []
if (resp.data.iconUrl != '')
this.imgList.push({
url: resp.data.iconUrl
})
this.hideUploadBtn = this.imgList.length != 0;
console.log("this.hideUploadBtn", this.hideUploadBtn)
}
})
.catch(e => {
this.formobj = row
this.imgList = []
if (resp.data.iconUrl != '')
this.imgList.push({
url: formobj.iconUrl
})
this.hideUploadBtn = this.imgList.length != 0;
console.log("this.hideUploadBtn", this.hideUploadBtn)
})
}
}
}
</script>
<style lang="scss" scoped>
// 隐藏上传组件
::v-deep .hide {
.el-upload--picture-card {
display: none !important;
}
}
.trightb {
display: flex;
align-items: center;
text-align: center;
justify-content: center;
}
.trightb_item {
padding-top: 5px;
}
.span {
margin-left: 50px;
font-size: 15px;
font-weight: 400;
}
::v-deep .el-collapse-item__header {
height: 40px;
padding: 10px;
font-weight: bold;
font-size: 20px;
text-align: left;
color: #ffffff;
background-color: #0294d7;
}
::v-deep .el-collapse-item__content {
padding-bottom: 0;
}
</style>

View File

@@ -0,0 +1,242 @@
<template>
<div>
<div class="tab-header webtop">
<!-- 标题 -->
<div>礼包信息</div>
<!-- start 添加修改按钮 -->
<div>
<!-- <el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button> -->
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
<!-- end 添加修改按钮 -->
<!-- end 详情按钮 -->
</div>
<div class="listconadd">
<el-form ref="dataForm" :model="formobj" label-position="top" label-width="190px" class="formadd">
<div class="title" style="display: flex;align-items: center;justify-content: space-between;height:40px">
<div>主体信息</div>
</div>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">礼包名称</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.name}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">边界金额</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.boundaryPrice}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">起始日期</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.dateStart}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">终止日期</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.dateEnd}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">发放条件</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.boundary}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label"></span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span></span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">备注信息</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.remarks}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">礼包图片</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<img :src="formobj.iconUrl" />
</el-form-item>
</el-col>
</el-row>
<el-collapse v-model="activeNames" style="margin-top: 20px;">
<el-collapse-item name="1" title="商品列表">
<!-- <template slot="title">
商品列表<span class="span" @click.stop="add()">添加</span>
</template> -->
<el-table v-loading="listLoading" :data="formobj.goods" border style="width: 100%;"
:row-style="{height: '40px'}">
<!-- <el-table-column type="selection" align="center" width="50"/> -->
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center" />
<!-- <el-table-column label="操作" wid align="center" width="150">
<template slot-scope="scope">
<el-button type="primary" size="mini"
@click="doGoodsDel(scope.row.goodsSid)">删除</el-button>
</template>
</el-table-column> -->
<el-table-column label="商品名称" prop="name" align="center" />
<el-table-column label="商品数量" prop="goodsNumber" align="center" />
<el-table-column label="商品价格" prop="price" align="center" />
<el-table-column label="商品单位" prop="unitName" align="center" />
</el-table>
</el-collapse-item>
</el-collapse>
</el-form>
</div>
</div>
</template>
<script>
import req from '@/api/marketingCard/marketingCard.js'
export default {
data() {
return {
listLoading: false,
activeNames: ['1'],
submitdisabled: false,
formobj: {
sid: "",
name: '',
dateStart: '',
dateEnd: '',
boundaryPrice: "",
boundary: "",
remarks: "",
iconUrl: "",
goods: []
},
}
},
methods: {
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.imgList = []
this.formobj = {
sid: "",
name: '',
dateStart: '',
dateEnd: '',
boundaryPrice: "",
boundary: "",
remarks: "",
iconUrl: "",
goods: []
}
this.$emit('doback')
},
indexMethod(index) {
return index + 1
},
showAdd(row) {
console.log("showAdd》》》》", row)
req.giftBagInit(row.sid)
.then(resp => {
if (resp.success) {
this.formobj = resp.data
this.imgList = []
this.imgList.push({
url: resp.data.iconUrl
})
}
})
.catch(e => {
this.formobj = row
this.imgList = []
this.imgList.push({
url: formobj.iconUrl
})
})
},
}
}
</script>
<style scoped>
.trightb {
display: flex;
align-items: center;
text-align: center;
justify-content: center;
}
.trightb_item {
padding-top: 5px;
}
.span {
margin-left: 50px;
font-size: 15px;
font-weight: 400;
}
/deep/.el-collapse-item__header {
height: 40px;
padding: 10px;
font-weight: bold;
font-size: 20px;
text-align: left;
color: #ffffff;
background-color: #0294d7;
}
/deep/.el-collapse-item__content {
padding-bottom: 0;
}
</style>

View File

@@ -0,0 +1,162 @@
<template>
<div>
<div class="tab-header webtop">
<!-- 标题 -->
<div>提货卡管理</div>
<!-- start 添加修改按钮 -->
<div>
<el-button type="primary" size="small" @click="saveOrUpdate">发行</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
<!-- end 添加修改按钮 -->
<!-- end 详情按钮 -->
</div>
<div class="listconadd">
<el-card class="box-card">
<div class="item">
<span class="item_text">券卡数量</span>
<el-input v-model="formobj.num" placeholder="" class="item_input"
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" clearable />
</div>
<div class="item">
<span class="item_text">选择礼包</span>
<el-select v-model="formobj.bagSid" filterable class="item_input" clearable placeholder="请选择"
style="width:100%" @change="giftPackSelect">
<el-option v-for="item in giftPackList" :key="item.sid" :label="item.name" :value="item.sid">
</el-option>
</el-select>
</div>
</el-card>
</div>
</div>
</template>
<script>
import req from '@/api/marketingCard/marketingCard.js'
export default {
data() {
return {
formobj: {
num: '',
bagSid: ""
},
giftPackList: []
}
},
created() {
this.giftBagList()
},
methods: {
giftBagList(){
req.giftBagList()
.then(resp => {
console.log('>>>>>>>>>giftBagList', resp.data)
this.giftPackList = resp.data
})
.catch(() => {})
},
giftPackSelect(val) {
console.log('>>>>>>>>>giftPackSelect', val)
this.formobj.bagSid = val
},
saveOrUpdate() {
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
req.generateCard(this.formobj)
.then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn('true')
} else {
// 根据resp.code进行异常情况处理
}
})
.catch(() => {})
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.imgList = []
this.formobj = {
num: '',
bagSid: ""
}
this.$emit('doback')
},
}
}
</script>
<style lang="scss">
.box-card {
margin-left: 60px;
margin-right: 60px;
min-width: 70%;
margin-top: 20px;
.item {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 15px;
height: 40px;
line-height: 40px;
.item_text {
flex: 0.8;
font-size: 18px;
text-align: right;
}
.item_input {
flex: 4;
font-size: 16px;
margin-left: 10px;
margin-right: 80px;
}
.item_left_input {
width: 20%;
}
.item_left_text {
height: 30px;
margin-left: 20px;
line-height: 30px;
color: #018AD2;
padding: 0px 15px;
border: 1.5px solid #018AD2;
border-radius: 5px;
}
.item_right {
flex: 1;
justify-items: center;
.item_right_list_text {
font-size: 16px;
}
.item_right_list_delect {
color: #5E94FF;
margin-left: 20px;
font-size: 16px;
text-decoration: underline;
}
}
}
}
</style>

View File

@@ -0,0 +1,826 @@
<template>
<div>
<el-tabs v-model="activeName" class="my-tabs" type="card" @tab-click="handleClick" style="margin-top: 20px;">
<el-tab-pane label="个人卡记录" name="roleList">
<div class="main-content">
<div class="container" v-show="viewState == 1">
<div class="tab-header">
<el-form :inline="true" :model="page.params" class="demo-form-inline">
<el-row :gutter="20">
<el-col :span="21">
<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-button type="primary" @click="getPageList()"> </el-button>
</el-col>
</el-row>
</el-form>
</div>
<el-table :data="tableData" border style="width: 100%; margin-top: 20px;"
:row-style="{height: '40px'}">
<el-table-column label="序号" width="70px" type="index" :index="indexMethod" align="center">
</el-table-column>
<el-table-column label="操作" width="150px" align="center">
<template slot-scope="scope">
<!-- <el-button type="primary" size="mini" @click="editRow(scope.row)">
发放
</el-button> -->
<el-button type="primary" size="mini" @click="showRow(scope.row.sid)">
明细
</el-button>
</template>
</el-table-column>
<el-table-column prop="startNumber" label="序列起始号" align="center">
</el-table-column>
<el-table-column prop="endNumber" label="序列结束号" align="center">
</el-table-column>
<el-table-column prop="buildDate" label="发行时间" align="center">
</el-table-column>
<el-table-column prop="countNumber" label="发行总数" align="center">
</el-table-column>
<el-table-column prop="bagName" label="绑定礼包" align="center">
</el-table-column>
<!-- <el-table-column prop="bagName" label="发放数量" align="center">
</el-table-column> -->
</el-table>
<pagination :total="page.total" :page.sync="page.current" :limit.sync="page.size"
@pagination="getPageList" style="padding-bottom: 100px;" />
</div>
<div class="container" v-show="viewState == 2">
<div class="tab-header">
<el-form :inline="true" :model="listQuery.params" class="demo-form-inline">
<el-row :gutter="20">
<el-col :span="20">
<el-form-item label="卡片序列号">
<el-input v-model="listQuery.params.number" placeholder="" clearable />
</el-form-item>
<el-form-item label="卡片状态">
<el-select v-model="listQuery.params.state" placeholder="请选择">
<el-option v-for="(item,i) in stateList" :key="i" :label="item.name"
:value="item.sid">
</el-option>
</el-select>
</el-form-item>
<el-button type="primary" @click="getPageList2()"> </el-button>
<el-button type="primary" @click="returnView()"> </el-button>
</el-col>
<el-col :span="4">
<el-form-item style="float: right;">
<div
style="display: flex;flex-direction: row;align-items: center;justify-content: space-between;">
<el-button type="primary" @click="exportExcel()">导出Excel</el-button>
<el-button type="primary" @click="downloadQR()"
style="margin-left: 10px;">下载二维码</el-button>
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-table :data="tableData2" border style="width: 100%; margin-top: 20px;"
:row-style="{height: '40px'}">
<el-table-column label="序号" width="70px" type="index" :index="indexMethod2" align="center">
</el-table-column>
<el-table-column label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button type="primary" :disabled="scope.row.customerSid!=''||scope.row.state=='已作废'" size="mini" @click="delectItem(scope.row)">
作废
</el-button>
</template>
</el-table-column>
<el-table-column prop="serialNumber" label="序列号" align="center">
</el-table-column>
<el-table-column prop="code" label="提货码" align="center">
</el-table-column>
<el-table-column prop="codeKey" label="提货密码" align="center">
</el-table-column>
<el-table-column prop="state" label="卡片状态" align="center">
</el-table-column>
<el-table-column prop="buildDate" label="发放时间" align="center">
</el-table-column>
<el-table-column prop="name" label="发放支行" align="center">
</el-table-column>
</el-table>
<pagination :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size"
@pagination="getPageList2" style="padding-bottom: 100px;" />
</div>
</div>
</el-tab-pane>
<el-tab-pane label="发行个人卡" name="addrole">
<div class="listconadd">
<el-card class="box-card">
<div class="item">
<span class="item_text">区域编码</span>
<el-input v-model="formobj.cardArea" placeholder="" class="item_input"
oninput="value=value.replace(/[^0-9]/g,'')" maxlength="2" clearable />
</div>
<div class="item">
<span class="item_text">券卡数量</span>
<el-input v-model="formobj.num" placeholder="" class="item_input"
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" clearable />
</div>
<div class="item">
<span class="item_text">选择礼包</span>
<el-select v-model="formobj.bagSid" filterable class="item_input" clearable
placeholder="请选择" style="width:100%" @change="giftPackSelect">
<el-option v-for="item in giftPackList" :key="item.sid" :label="item.name"
:value="item.sid">
</el-option>
</el-select>
</div>
<div
style="width: 100%;display: flex;flex-direction: row;justify-content: center;margin-top: 20px;">
<!-- <span
style="background: #018AD2; color: #fff;padding: 5px 15px;border-radius: 5px;font-size: 16px;"
@click="saveOrUpdate">发行</span> -->
<el-button type="primary" size="small" :disabled="submitdisabled"
@click="saveOrUpdate">发行</el-button>
</div>
</el-card>
</div>
</el-tab-pane>
<el-tab-pane label="批量发行" name="batch">
<div class="listconadd">
<el-card class="box-card">
<!-- <div class="item">
<div class="item_text">
<span class="item_text2" @click="handleDownload">下载模版</span>
</div>
<span class="item_input"></span>
</div> -->
<div class="item">
<span class="item_text">起始日期</span>
<el-date-picker v-model="batchInfo.startDate" @change="selectbatchInfo1" type="date"
placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" class="item_input">
</el-date-picker>
</div>
<div class="item">
<span class="item_text">终止日期</span>
<el-date-picker v-model="batchInfo.endDate" @change="selectbatchInfo2" type="date"
placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" class="item_input"
:picker-options="pickerOptions">
</el-date-picker>
</div>
<div class="item" style="margin-top: 30px;">
<span class="item_text">导入数据</span>
<div class="item_input">
<el-upload ref="upload" class="upload-demo" :action="updateAction"
:on-success="handleSuccess" :on-remove="handleRemove" :file-list="uploadFileList"
accept=".xls,.xlsx" name="file" :auto-upload="false" :multiple="false" :limit="1"
:data="batchInfo">
<span v-if="batchInfo.startDate==''&& batchInfo.endDate==''"
style="color: #999;">请先选择日期</span>
<el-button slot="trigger" v-if="batchInfo.startDate!=''&& batchInfo.endDate!=''"
size="small" type="primary">选取文件</el-button>
<el-button style="margin-left: 10px;" size="small" type="success"
v-if="batchInfo.startDate!=''&& batchInfo.endDate!=''"
@click="submitUpload">导入</el-button>
</el-upload>
<!-- <span style="color: #018AD2; border-bottom: 1px #018AD2 solid;" @click="importFile">{{batchInfo.urlName}}</span> -->
</div>
</div>
<div class="item" v-show="result!=''">
<span class="item_text"></span>
<span class="item_input">{{result}}</span>
</div>
<!-- <div
style="width: 100%;display: flex;flex-direction: row;justify-content: center;margin-top: 20px;">
<span
style="background: #018AD2; color: #fff;padding: 5px 15px;border-radius: 5px;font-size: 16px;"
@click="confirmImport">确定</span>
</div> -->
</el-card>
</div>
</el-tab-pane>
</el-tabs>
<el-dialog title="发放信息" :visible.sync="editDialog" width="30%" :before-close="banClose">
<table class="e-table" cellspacing="0">
<tr>
<td>起始序列号</td>
<td> <!-- @change="changeParentSid" -->
<el-input v-model="from.start" style="width:100%" oninput="value=value.replace(/[^0-9]/g,'')"
@input="input1"></el-input>
</td>
</tr>
<tr>
<td>结束序列号</td>
<td>
<el-input v-model="from.end" style="width:100%" oninput="value=value.replace(/[^0-9]/g,'')"
@input="input2"></el-input>
</td>
</tr>
<tr>
<td>发放支行</td>
<td>
<el-select v-model="from.bankSid" filterable clearable placeholder="请选择" style="width:100%"
@change="bankSelect">
<el-option v-for="item in bankList" :key="item.sid" :label="item.name" :value="item.sid">
</el-option>
</el-select>
</td>
</tr>
</table>
<div style="margin-top: 20px; text-align: center;">
<el-button type="primary" @click="save()"> </el-button>
<el-button @click="banClose"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import req from '@/api/marketingCard/marketingCard.js'
export default {
data() {
return {
pickerOptions: {
disabledDate(v) {
return v.getTime() < new Date().getTime() - 86400000; // - 86400000是否包括当天
}
},
viewState: 1,
submitdisabled: false,
page: {
total: 0, // 默认数据总数
current: 1, // 默认开始页面
size: 10, // 每页的数据条数
params: {
startDate: '',
endDate: '',
},
},
tableData: [],
tableData2: [],
listQuery: {
total: 0, // 默认数据总数
current: 1, // 默认开始页面
size: 10, // 每页的数据条数
params: {
sid: "",
number: '',
state: '',
},
},
activeName: 'roleList',
formobj: {
cardArea: "",
num: '',
bagSid: ""
},
giftPackList: [],
stateList: [{
name: "全部",
sid: ""
}, {
name: "未发放",
sid: "1"
}, {
name: "未绑定用户",
sid: "2"
},
{
name: "未提货",
sid: "3"
},
{
name: "部分提货",
sid: "4"
},
{
name: "提货完成",
sid: "5"
}
],
recordId: '',
editDialog: false,
from: {
start: "",
end: "",
bankSid: ""
},
bankList: [],
batchInfo: {
startDate: "",
endDate: "",
},
updateAction: process.env.VUE_APP_BASE_API + '/lpkgiftcard/getExcelInfo2',
uploadFileList: [],
result: "",
}
},
created() {
this.getPageList()
this.getBankList()
},
methods: {
// 序号
indexMethod(index) {
var pagestart = (this.page.current - 1) * this.page.size
var pageindex = index + 1 + pagestart
console.log("pageindex",pageindex);
return pageindex
},
// 序号
indexMethod2(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
console.log("pageindex2",pageindex);
return pageindex
},
//下载模版
handleDownload() {
var a = document.createElement("a"); //创建一个<a></a>标签
a.href = "./云菜窖.xls";
//给a标签的href属性值加上地址注意这里是绝对路径不用加 点.
a.download = "云菜窖.xls";
//设置下载文件文件名,这里加上.xlsx指定文件类型pdf文件就指定.fpd即可
a.style.display = "none"; // 障眼法藏起来a标签
document.body.appendChild(a);
// 将a标签追加到文档对象中
a.click(); //模拟点击了a标签会触发a标签的href的读取浏览器就会自动下载了
a.remove(); // 一次性的用完就删除a标签
},
handleClick(tab, event) {
this.viewState = 1
this.listQuery = {
total: 0, // 默认数据总数
current: 1, // 默认开始页面
size: 10, // 每页的数据条数
params: {
sid: "",
number: '',
state: '',
},
}
if (tab.name == 'addrole') {
this.giftBagList()
} else if (tab.name == 'roleList') {
this.getPageList()
}
},
pagination(val) { // 分页
this.page.current = val.pageNum
this.page.size = val.pageSize
this.getPageList(this.page)
},
pagination2(val) { // 分页
this.listQuery.current = val.pageNum
this.listQuery.size = val.pageSize
this.getPageList2(this.listQuery)
},
selectTime1(val) {
console.log('selectTime1:', val)
this.page.params.startDate = val
},
selectTime2(val) {
console.log('selectTime2:', val)
this.page.params.endDate = val
},
selectbatchInfo1(val) {
console.log('selectbatchInfo1:', val)
if(!this.batchInfo.endDate){
this.batchInfo.startDate = val
}else{
if(new Date(this.batchInfo.startDate).getTime()>new Date(this.batchInfo.endDate).getTime()){
this.$message({
showClose: true,
type: 'error',
message: '起始日期不能大于结束日期'
})
this.batchInfo.startDate=''
}else{
this.batchInfo.startDate = val
}
}
},
selectbatchInfo2(val) {
console.log('selectbatchInfo2:', val)
if(!this.batchInfo.startDate){
this.batchInfo.endDate = val
}else{
if(new Date(this.batchInfo.startDate).getTime()>new Date(this.batchInfo.endDate).getTime()){
this.$message({
showClose: true,
type: 'error',
message: '起始日期不能大于结束日期'
})
this.batchInfo.endDate=''
}else{
this.batchInfo.endDate = val
}
}
// this.batchInfo.endDate = val
},
getPageList() {
req.recordListPage(this.page)
.then(resp => {
console.log('>>>>>>>>>getPageList', resp.data)
this.tableData = resp.data.records
this.page.total = resp.data.total
})
.catch(() => {})
},
getPageList2() {
req.recordDetails(this.listQuery)
.then(resp => {
console.log('>>>>>>>>>recordDetails', resp.data)
this.tableData2 = resp.data.records
this.recordId = resp.data.records[0].recordId
this.listQuery.total = resp.data.total
})
.catch(() => {
})
},
editRow(row) {
this.editDialog = true
},
showRow(sid) {
this.listQuery.params.sid =sid
this.viewState = 2
req.recordDetails(this.listQuery)
.then(resp => {
console.log('>>>>>>>>>recordDetails', resp.data)
this.tableData2 = resp.data.records
this.recordId = resp.data.records[0].recordId
this.listQuery.total = resp.data.total
})
.catch(() => {
})
},
returnView() {
this.tableData2 = []
this.viewState = 1
this.listQuery = {
total: 0, // 默认数据总数
current: 1, // 默认开始页面
size: 10, // 每页的数据条数
params: {
sid: "",
number: '',
state: '',
},
}
},
exportExcel() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
this.listQuery.params.number = '',
this.listQuery.params.state = '',
req.exportExcel(this.listQuery.params).then((resp) => {
loading.close()
const blob = new Blob([resp], {
type: 'application/vnd.ms-excel'
})
const fileName = '个人卡明细列表(批次号_' + this.recordId + ').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()
})
},
downloadQR() {
this.$message({
showClose: true,
type: 'success',
message: '功能暂未完善...'
})
},
giftBagList() {
req.giftBagList()
.then(resp => {
console.log('>>>>>>>>>giftBagList', resp.data)
this.giftPackList = resp.data
})
.catch(() => {})
},
giftPackSelect(val) {
console.log('>>>>>>>>>giftPackSelect', val)
this.formobj.bagSid = val
},
saveOrUpdate() {
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
this.submitdisabled = true
req.generateCard(this.formobj)
.then(resp => {
if (resp.success) {
this.submitdisabled = false
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn('true')
} else {
this.submitdisabled = false
// 根据resp.code进行异常情况处理
}
})
.catch(() => {
this.submitdisabled = false
})
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.formobj = {
cardArea: "",
num: '',
bagSid: ""
}
this.$emit('doback')
},
getBankList() {
req.bankList()
.then(resp => {
console.log('>>>>>>>>>getBankList', resp.data)
this.bankList = resp.data
})
.catch(() => {})
},
input1(val) {
console.log("input1》》》》", val)
},
input2(val) {
console.log("input2》》》》", val)
},
bankSelect(val) {
console.log("bankSelect》》》》", val)
const choose = this.bankList.filter((item) => item.sid === val)
this.from.bankSid = choose[0].sid
},
save() {
console.log("save》》》》", this.from)
req.cardGrant(this.from)
.then(resp => {
if(resp.success){
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
}
this.editDialog = false
this.from = {
start: "",
end: "",
bankSid: ""
}
this.getPageList()
})
.catch(() => {})
},
banClose() {
this.from = {
start: "",
end: "",
bankSid: ""
}
this.editDialog = false
},
handleSuccess(resp, file, fileList) {
console.log("resp", resp);
if (resp.success) {
this.$message({
showClose: true,
type: "success",
message: resp.msg
})
} else {
this.$message({
showClose: true,
type: "error",
message: resp.msg
})
}
this.result = resp.msg
// console.log('handleSuccess----', resp)
// const _this = this
// const upfile = {
// fileTypeId: 6, // '文件类型: 1=帐户余额;2=应收账款;3=库存货值;4=在途货值;5=预付款;',
// fileTypeName: '报表文件', // '文件类型名: 1=帐户余额;2=应收账款;3=库存货值;4=在途货值;5=预付款',
// fileSrcName: resp.data.sourceFileName, // '原文件名',
// filePath: resp.data.filePath, // '文件的相对路径',
// fullUrl: resp.data.fullUrl, // '文件完整的访问URL',
// fileuid: file.uid // '文件完整的访问URL',
// }
// _this.reportFileList.push(upfile)
},
handleRemove(file, fileList) {
},
submitUpload() {
this.$refs.upload.submit()
},
delectItem(row){
console.log("row", row);
const tip = '请确认是否作废所选卡券?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.cancelCard(row.sid).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.showRow(this.listQuery.params.sid)
} else {
// 根据resp.code进行异常情况处理
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
}
}
}
</script>
<style lang="scss">
.box-card {
margin-left: 60px;
margin-right: 60px;
min-width: 70%;
margin-top: 20px;
margin-bottom: 50px;
.item {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 15px;
height: 40px;
line-height: 40px;
.item_text {
flex: 0.8;
font-size: 18px;
text-align: right;
.item_text2 {
margin-right: 10px;
padding: 10px 15px;
font-size: 16px;
text-align: right;
background: #018AD2;
border-radius: 5px;
color: #fff;
}
}
.item_input {
flex: 4;
font-size: 16px;
margin-left: 10px;
margin-right: 80px;
}
.item_left_input {
width: 20%;
}
.item_left_text {
height: 30px;
margin-left: 20px;
line-height: 30px;
color: #018AD2;
padding: 0px 15px;
border: 1.5px solid #018AD2;
border-radius: 5px;
}
.item_right {
flex: 1;
justify-items: center;
.item_right_list_text {
font-size: 16px;
}
.item_right_list_delect {
color: #5E94FF;
margin-left: 20px;
font-size: 16px;
text-decoration: underline;
}
}
}
}
</style>

230
src/views/network/index.vue Normal file
View File

@@ -0,0 +1,230 @@
<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-input v-model="queryParams.params.name" placeholder="" clearable />
</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%" :row-style="{height: '40px'}">
<!-- <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="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
<el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button>
</template>
</el-table-column>
<el-table-column prop="name" label="支行名称" align="center" />
<el-table-column prop="shortName" label="支行简称" align="center" />
<el-table-column prop="linker" label="联系人" align="center" />
<el-table-column prop="linkPhone" label="联系电话" align="center" />
<el-table-column prop="address" label="支行地址" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
</div>
</div>
</div>
<!-- 新增修改部分组件 -->
<divAdd v-show="viewState == 2|| viewState ==3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
</div>
</template>
<script>
import req from '@/api/network/network.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './indexAdd.vue'
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: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
name: '',
}
},
sids: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
},
methods: {
// 搜索条件效果
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
req.bankListPage(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// 根据resp.code进行异常情况处理
this.dataList = []
this.queryParams.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
// 序号
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
name: '',
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选支行?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.deleteBank(row.sid).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// 根据resp.code进行异常情况处理
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
resetState() {
this.viewState = 1
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,197 @@
<template>
<div>
<div class="tab-header webtop">
<!-- 标题 -->
<div>网点信息</div>
<!-- start 添加修改按钮 -->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
<!-- end 添加修改按钮 -->
<!-- end 详情按钮 -->
</div>
<div class="listconadd">
<el-card class="box-card">
<div class="item">
<span class="item_text">名称</span>
<el-input v-model="formobj.name" placeholder="" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">简称</span>
<el-input v-model="formobj.shortName" placeholder="" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">联系人</span>
<el-input v-model="formobj.linker" placeholder="" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">电话</span>
<el-input v-model="formobj.linkPhone" placeholder="" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">地址</span>
<el-input v-model="formobj.address" placeholder="" class="item_input" clearable />
</div>
</el-card>
</div>
</div>
</template>
<script>
import req from '@/api/network/network.js'
export default {
data() {
return {
submitdisabled: false,
formobj: {
sid: "",
name: '',
shortName: '',
linker: '',
linkPhone: "",
address: "",
}
}
},
methods: {
saveOrUpdate() {
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
if(this.formobj.sid){
req.updateBank(this.formobj)
.then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn('true')
} else {
// 根据resp.code进行异常情况处理
}
})
.catch(() => {})
}else{
req.saveBank(this.formobj)
.then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn('true')
} else {
// 根据resp.code进行异常情况处理
}
})
.catch(() => {})
}
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.imgList = []
this.formobj = {
sid: "",
name: '',
shortName: '',
linker: '',
linkPhone: "",
address: "",
}
this.$emit('doback')
},
showAdd() {
},
showEdit(row) {
req.bankInit(row.sid)
.then(resp => {
if (resp.success) {
this.formobj = resp.data
}
})
.catch(e => {
this.formobj = row
})
}
}
}
</script>
<style lang="scss">
.box-card {
margin-left: 60px;
margin-right: 60px;
min-width: 70%;
margin-top: 20px;
.item {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 15px;
height: 40px;
line-height: 40px;
.item_text {
flex: 0.8;
font-size: 18px;
text-align: right;
}
.item_input {
flex: 4;
font-size: 16px;
margin-left: 10px;
margin-right: 80px;
}
.item_left_input {
width: 20%;
}
.item_left_text {
height: 30px;
margin-left: 20px;
line-height: 30px;
color: #018AD2;
padding: 0px 15px;
border: 1.5px solid #018AD2;
border-radius: 5px;
}
.item_right {
flex: 1;
justify-items: center;
.item_right_list_text {
font-size: 16px;
}
.item_right_list_delect {
color: #5E94FF;
margin-left: 20px;
font-size: 16px;
text-decoration: underline;
}
}
}
}
</style>

View File

@@ -0,0 +1,283 @@
<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>
<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>
</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: ""
},
},
giftPackList: []
}
},
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
},
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: ""
},
}
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()
})
},
}
}
</script>
<style scoped>
::v-deep .el-table .cell {
padding: 0px;
}
</style>

View File

@@ -0,0 +1,334 @@
<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.store" filterable class="item_input" clearable
placeholder="请选择" style="width:100%" @change="giftPackSelect">
<el-option v-for="item in giftPackList" :key="item.text" :label="item.text"
:value="item.text">
</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">
<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="store" 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 label="商品明细" align="center">
<template slot-scope="scope">
<div v-for="(item,index) in scope.row.goods" style="width: 100%;height: 100%;">
<div style="width: 100%;padding:10px"
:style="{'border-bottom':(index!=scope.row.goods.length-1?'1px solid #DFE6EC':'none')}">
{{item}}</div>
</div>
</template>
</el-table-column> -->
</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: "",
store: "",
bankSid: ""
},
},
giftPackList: [],
bankList: [],
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.getAllStore()
this.loadList()
this.getBankList()
},
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
},
getBankList() {
req2.bankSelect()
.then(resp => {
console.log('>>>>>>>>>getBankList', resp.data)
this.bankList = resp.data
})
.catch(() => {})
},
bankSelect(val) {
console.log('>>>>>>>>>bankSelect', val)
this.page.params.bankSid = val
},
getAllStore() {
req.getAllStore().then((resp) => {
if (resp.success) {
this.giftPackList = resp.data
}
}).catch(() => {})
},
loadList() {
this.tableLoading = true
req.distributionList(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: "",
bankSid: ""
},
}
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.distributionExportExcel(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()
})
},
}
}
</script>
<style scoped>
::v-deep .el-table .cell {
padding: 0px;
}
</style>

306
src/views/order/index.vue Normal file
View File

@@ -0,0 +1,306 @@
<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.store" filterable class="item_input" clearable
placeholder="请选择" style="width:100%" @change="giftPackSelect">
<el-option v-for="item in giftPackList" :key="item.text" :label="item.text"
:value="item.text">
</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%">
<!-- <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="store" label="提货地点" align="center" />
<el-table-column prop="serialNumber" label="卡券序列号" align="center" />
<el-table-column prop="bagName" label="礼包类型" align="center" />
<el-table-column prop="userName" label="用户名称" align="center" />
<el-table-column prop="userPhone" 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 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: "",
store: "",
bankSid:""
},
},
giftPackList: [],
bankList: [],
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.getAllStore()
this.loadList()
this.getBankList()
},
methods: {
// 搜索条件效果
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
},
getBankList() {
req2.bankSelect()
.then(resp => {
console.log('>>>>>>>>>getBankList', resp.data)
this.bankList = resp.data
})
.catch(() => {})
},
bankSelect(val) {
console.log('>>>>>>>>>bankSelect', val)
this.page.params.bankSid = val
},
getAllStore() {
req.getAllStore().then((resp) => {
if (resp.success) {
this.giftPackList = resp.data
}
}).catch(() => {})
},
loadList() {
this.tableLoading = true
req.orderList(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: "",
bankSid:""
},
}
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.exportExcel(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()
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,194 @@
<template>
<div>
<div class="tab-header webtop">
<!-- 标题 -->
<div>预约明细</div>
<!-- start 添加修改按钮 -->
<div>
<!-- <el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button> -->
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
<!-- end 添加修改按钮 -->
<!-- end 详情按钮 -->
</div>
<div class="listconadd">
<el-form ref="dataForm" :model="formobj" label-position="top" label-width="190px" class="formadd">
<div class="title" style="display: flex;align-items: center;justify-content: space-between;height:40px">
<div>主体信息</div>
</div>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">提货卡号</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.code}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">礼包类型</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.bagName}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">预约时间</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.reserveDate}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">提货门店</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.store}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">用户名称</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.userName}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">联系电话</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.userPhone}}</span>
</el-form-item>
</el-col>
</el-row>
<el-collapse v-model="activeNames" style="margin-top: 20px;">
<el-collapse-item name="1" title="商品列表">
<!-- <template slot="title">
商品列表<span class="span" @click.stop="add()">添加</span>
</template> -->
<el-table v-loading="listLoading" :data="formobj.goodsVo" border style="width: 100%;"
:row-style="{height: '40px'}">
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center" />
<!-- <el-table-column label="操作" wid align="center" width="150">
<template slot-scope="scope">
<el-button type="primary" size="mini"
@click="doGoodsDel(scope.row.goodsSid)">删除</el-button>
</template>
</el-table-column> -->
<el-table-column label="商品名称" prop="goodName" align="center" />
<el-table-column label="商品数量" prop="num" align="center" />
</el-table>
</el-collapse-item>
</el-collapse>
</el-form>
</div>
</div>
</template>
<script>
import req from '@/api/order/order.js'
export default {
data() {
return {
listLoading: false,
activeNames: ['1'],
submitdisabled: false,
formobj: {
sid: "",
code: '',
bagName: '',
reserveDate: '',
store: "",
userName: "",
userPhone: "",
goodsVo: []
},
}
},
methods: {
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.formobj = {
sid: "",
code: '',
bagName: '',
reserveDate: '',
store: "",
userName: "",
userPhone: "",
goodsVo: []
}
this.$emit('doback')
},
indexMethod(index) {
return index + 1
},
showEdit(row) {
console.log("showAdd》》》》", row)
this.formobj = row
},
}
}
</script>
<style scoped>
.trightb {
display: flex;
align-items: center;
text-align: center;
justify-content: center;
}
.trightb_item {
padding-top: 5px;
}
.span {
margin-left: 50px;
font-size: 15px;
font-weight: 400;
}
/deep/.el-collapse-item__header {
height: 40px;
padding: 10px;
font-weight: bold;
font-size: 20px;
text-align: left;
color: #ffffff;
background-color: #0294d7;
}
/deep/.el-collapse-item__content {
padding-bottom: 0;
}
</style>

View File

@@ -0,0 +1,302 @@
<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>
<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>
</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: ""
},
},
bankList: []
}
},
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
},
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: ""
},
}
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.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()
})
},
}
}
</script>
<style scoped>
::v-deep .el-table .cell {
padding: 0px;
}
</style>

View File

@@ -0,0 +1,249 @@
<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-input v-model="queryParams.params.name" placeholder="" clearable />
</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%"
:row-style="{height: '40px'}">
<!-- <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="100">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
<!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> -->
</template>
</el-table-column>
<el-table-column label="是否禁用" align="center" width="140">
<template slot-scope="scope">
<el-switch v-model="scope.row.isEnable" active-text="可用" inactive-text="禁用"
active-value="1" inactive-value="0"
@change="enableChange(scope.row.sid,scope.row.isEnable)" />
</template>
</el-table-column>
<el-table-column prop="name" label="提货点名称" align="center" width="250" />
<el-table-column prop="phone" label="联系电话" align="center" width="150" />
<el-table-column prop="address" label="提货点地址" align="center" />
<el-table-column prop="bankName" label="所属支行" width="250" align="center" />
<el-table-column prop="businessHours" label="营业时间" align="center" width="200" />
<el-table-column prop="sort" label="排序" align="center" width="80" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
</div>
</div>
</div>
<!-- 新增修改部分组件 -->
<divAdd v-show="viewState == 2|| viewState ==3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
</div>
</template>
<script>
import req from '@/api/pickupPoint/pickupPoint.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
// import pageye from '@/components/pagination/pageye'
import divAdd from './indexAdd.vue'
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: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
},
sids: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
},
methods: {
// 搜索条件效果
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
req.storeListPage(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// 根据resp.code进行异常情况处理
this.dataList = []
this.queryParams.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
// 序号
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选提货点?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.deleteStore(row.sid).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// 根据resp.code进行异常情况处理
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
resetState() {
this.viewState = 1
},
enableChange(sid, state) {
console.log('sid', sid)
console.log('state', state)
req.updateIsEnable(sid, state).then((resp) => {
if (resp.success) {
this.$message({
type: 'success',
message: '状态已更新',
showClose: true
})
} else { // 根据resp.code进行异常情况处理
}
}).catch(e => {
console.log(e)
})
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,218 @@
<template>
<div>
<div class="tab-header webtop">
<!-- 标题 -->
<div>提货点信息</div>
<!-- start 添加修改按钮 -->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
<!-- end 添加修改按钮 -->
<!-- end 详情按钮 -->
</div>
<div class="listconadd">
<el-card class="box-card">
<div class="item">
<span class="item_text">名称</span>
<el-input v-model="formobj.name" placeholder="" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">地址</span>
<el-input v-model="formobj.address" placeholder="" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">联系人</span>
<el-input v-model="formobj.linker" placeholder="" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">电话</span>
<el-input v-model="formobj.phone" placeholder="" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">营业时间</span>
<el-input v-model="formobj.businessHours" placeholder="" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">排序</span>
<el-input v-model="formobj.sort" placeholder="" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">经纬度</span>
<el-input v-model="formobj.lonAndLat" placeholder="经纬度,以逗号分隔" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">所属支行</span>
<el-select v-model="formobj.bankName" 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>
</div>
</el-card>
</div>
</div>
</template>
<script>
import req from '@/api/pickupPoint/pickupPoint.js'
export default {
data() {
return {
submitdisabled: false,
formobj: {
sid: '',
name: '',
address: '',
phone: '',
businessHours: '',
sort: 0,
linker: '',
picUrl: '',
lonAndLat: '',
bankName: "",
bankSid: ""
},
bankList: []
}
},
created() {
req.bankSelect()
.then(resp => {
console.log('>>>>>>>>>bankSelect', resp)
this.bankList = resp.data
console.log('>>>>>>>>>bankSelect', this.bankList)
})
.catch(() => {})
},
methods: {
saveOrUpdate() {
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
req.saveStore(this.formobj)
.then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn('true')
} else {
// 根据resp.code进行异常情况处理
}
})
.catch(() => {})
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.imgList = []
this.formobj = {
sid: '',
name: '',
address: '',
phone: '',
businessHours: '',
sort: 0,
linker: '',
picUrl: '',
lonAndLat: '',
bankName: "",
bankSid: ""
}
this.$emit('doback')
},
showAdd() {
},
showEdit(row) {
req.storeInit(row.sid)
.then(resp => {
if (resp.success) {
this.formobj = resp.data
}
})
.catch(e => {
this.formobj = row
})
},
bankSelect(val) {
this.formobj.bankSid = val
}
}
}
</script>
<style lang="scss">
.box-card {
margin-left: 60px;
margin-right: 60px;
min-width: 70%;
margin-top: 20px;
.item {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 15px;
height: 40px;
line-height: 40px;
.item_text {
flex: 0.8;
font-size: 18px;
text-align: right;
}
.item_input {
flex: 4;
font-size: 16px;
margin-left: 10px;
margin-right: 80px;
}
.item_left_input {
width: 20%;
}
.item_left_text {
height: 30px;
margin-left: 20px;
line-height: 30px;
color: #018AD2;
padding: 0px 15px;
border: 1.5px solid #018AD2;
border-radius: 5px;
}
.item_right {
flex: 1;
justify-items: center;
.item_right_list_text {
font-size: 16px;
}
.item_right_list_delect {
color: #5E94FF;
margin-left: 20px;
font-size: 16px;
text-decoration: underline;
}
}
}
}
</style>

View File

@@ -0,0 +1,56 @@
<template>
<div class="main-content">
<!-- <div class="container">
<div class="tab-header">
<el-form :inline="true" :model="page.params" class="demo-form-inline">
<el-row :gutter="20">
<el-col :span="21">
<el-form-item label="起始序列号">
<el-input v-model="page.params.startnum" placeholder="" clearable />
</el-form-item>
<el-form-item label="结束序列号">
<el-input v-model="page.params.endnum" placeholder="" clearable />
</el-form-item>
<el-button type="primary" @click="getPageList()"> </el-button>
</el-col>
</el-row>
</el-form>
</div>
-->
<div style="margin-top: 20px; width: 100%;height: 100%;">
<iframe :src="spUrl" id="ysOpenDevice" width="100%" height="100%" allowfullscreen>
</iframe>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'SupplierBankInfoIndex',
data() {
return {
page:{
params:{
startnum:"",
endnum:""
}
},
spUrl:process.env.VUE_APP_REPORT_URL+ "/jmreport/view/905306587114299392",
}
},
created() {
console.log("aaaaaa",process.env.VUE_APP_REPORT_URL)
},
methods: {
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,370 @@
<template>
<div id="container">
<el-row :gutter="12">
<el-col :offset="8" :span="8">
<el-card shadow="always">
<div slot="header" class="clearfix">
<span>简单实例</span>
</div>
<div>
<el-form label-width="80px">
<el-form-item label="菜名">
<el-input v-model="formData.name"></el-input>
</el-form-item>
<el-form-item label="条形码">
<el-input v-model="formData.code"></el-input>
</el-form-item>
<el-form-item label="页数">
<el-input-number v-model="formData.number" controls-position="right" :min="1" :max="10">
</el-input-number>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="print">生成打印文件</el-button>
</el-form-item>
</el-form>
</div>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
import PrintTemplate from 'print-template'
export default {
name: 'SupplierBankInfoIndex',
data() {
return {
template: null,
formData: {
number: 1,
name: '泡菜肉丝',
code: 'PCRS11886622'
}
}
},
created() {
this.initPrintTemplate()
},
methods: {
initPrintTemplate() {
this.template = new PrintTemplate()
this.template.push({
name: 'printTemplate',
size: [210, 297], // a4 或 [221,291]
fixed: [
{
type: 'text',
fontWeight: 400,
x: 88,
y: 3,
default: '汇融惠享礼包卡',
fontSize: '5', // 字体大小
fontFamily: '微软雅黑', // 字体类型 默认 '微软雅黑'
fontWeight: null, // 字体宽度
fontStyle: 'normal', // 字体样式 normal / 斜体
maxWidth: null, // 最大换行宽度
orientation: 'l', // 方向 默认 l 横向 / p 竖向
color: 'red' // 字体颜色 (1.2.8版本新增)
},
// 1号
{
type: 'line',
x: 10,
y: 12,
length: 90,
color: 'blue', // 线段颜色 (1.2.8版本新增)
orientation: 'l', // 方向 默认 l 横向 / p 竖向
},
{
type: 'line',
x: 10,
y: 12,
length: 40,
color: 'red', // 线段颜色 (1.2.8版本新增)
orientation: 'p', // 方向 默认 l 横向 / p 竖向
},
{
type: 'line',
x: 10,
y: 52,
length: 90,
color: 'blue', // 线段颜色 (1.2.8版本新增)
orientation: 'l', // 方向 默认 l 横向 / p 竖向
},
{
type: 'line',
x: 100,
y: 12,
length: 40,
color: 'red', // 线段颜色 (1.2.8版本新增)
orientation: 'p', // 方向 默认 l 横向 / p 竖向
},
{
type: 'line',
x: 10,
y: 20,
length: 90,
color: 'blue', // 线段颜色 (1.2.8版本新增)
orientation: 'l', // 方向 默认 l 横向 / p 竖向
},
{
type: 'line',
x: 32,
y: 20,
length: 14,
color: 'blue', // 线段颜色 (1.2.8版本新增)
orientation: 'p', // 方向 默认 l 横向 / p 竖向
},
{
type: 'line',
x: 10,
y: 34,
length: 90,
color: 'blue', // 线段颜色 (1.2.8版本新增)
orientation: 'l', // 方向 默认 l 横向 / p 竖向
},
{
type: 'text', // 类型 文本 line / text / image / barcode / qrcode
// default: '家庭菜窖-白菜券', // 默认值 \n 换行 或设置maxWidth大小
x: 30, // x
y: 14, // y
fontSize: '5', // 字体大小
fontFamily: '微软雅黑', // 字体类型 默认 '微软雅黑'
fontWeight: null, // 字体宽度
fontStyle: 'normal', // 字体样式 normal / 斜体
maxWidth: null, // 最大换行宽度
orientation: 'l', // 方向 默认 l 横向 / p 竖向
color: 'red' // 字体颜色 (1.2.8版本新增)
},
{
type: 'text', // 类型 文本 line / text / image / barcode / qrcode
default: '手机提货:\n扫描下方\n 二维码', // 默认值 \n 换行 或设置maxWidth大小
x: 14, // x
y: 23, // y
fontSize: '3', // 字体大小
fontFamily: '微软雅黑', // 字体类型 默认 '微软雅黑'
fontWeight: null, // 字体宽度
fontStyle: 'normal', // 字体样式 normal / 斜体
maxWidth: null, // 最大换行宽度
orientation: 'l', // 方向 默认 l 横向 / p 竖向
color: 'red' // 字体颜色 (1.2.8版本新增)
},
{
type: 'text', // 类型 文本 line / text / image / barcode / qrcode
default: '提货券使用说明:\n· 本券概不挂失,不兑换现金\n· 本券提货编码和提货密码为兑换的唯一凭证\n· 手机扫描二维码可查询券卡状态', // 默认值 \n 换行 或设置maxWidth大小
x: 35, // x
y: 21, // y
fontSize: '3', // 字体大小
fontFamily: '微软雅黑', // 字体类型 默认 '微软雅黑'
fontWeight: null, // 字体宽度
fontStyle: 'normal', // 字体样式 normal / 斜体
maxWidth: null, // 最大换行宽度
orientation: 'l', // 方向 默认 l 横向 / p 竖向
color: 'red' // 字体颜色 (1.2.8版本新增)
},
{
type: 'text', // 类型 文本 line / text / image / barcode / qrcode
default: '提货编码', // 默认值 \n 换行 或设置maxWidth大小
x: 12, // x
y: 37, // y
fontSize: '3', // 字体大小
fontFamily: '微软雅黑', // 字体类型 默认 '微软雅黑'
fontWeight: null, // 字体宽度
fontStyle: 'normal', // 字体样式 normal / 斜体
maxWidth: null, // 最大换行宽度
orientation: 'p', // 方向 默认 l 横向 / p 竖向
color: 'red' // 字体颜色 (1.2.8版本新增)
},
// 2号
{
type: 'line',
x: 110,
y: 12,
length: 90,
color: 'green', // 线段颜色 (1.2.8版本新增)
orientation: 'l', // 方向 默认 l 横向 / p 竖向
},
{
type: 'line',
x: 110,
y: 12,
length: 40,
color: 'orange', // 线段颜色 (1.2.8版本新增)
orientation: 'p', // 方向 默认 l 横向 / p 竖向
},
{
type: 'line',
x: 110,
y: 52,
length: 90,
color: 'green', // 线段颜色 (1.2.8版本新增)
orientation: 'l', // 方向 默认 l 横向 / p 竖向
},
{
type: 'line',
x: 200,
y: 12,
length: 40,
color: 'orange', // 线段颜色 (1.2.8版本新增)
orientation: 'p', // 方向 默认 l 横向 / p 竖向
},
// {
// type: 'line',
// x: 2,
// y: 12,
// orientation: 'p', // l 横向 / p 竖向
// length: 110
// },
// {
// type: 'line',
// x: 74,
// y: 12,
// orientation: 'p',
// length: 110
// },
// {
// type: 'text',
// x: 10,
// y: 30,
// fontSize: 3,
// default: '菜名'
// },
// {
// type: 'line',
// x: 25,
// y: 27,
// orientation: 'p',
// length: 8
// },
// {
// type: 'line',
// x: 2,
// y: 35,
// length: 72
// },
// {
// type: 'line',
// x: 2,
// y: 27,
// length: 72
// },
// {
// type: 'text',
// x: 10,
// y: 50,
// fontSize: 3,
// default: '二维码'
// },
// {
// type: 'line',
// x: 25,
// y: 35,
// orientation: 'p',
// length: 30
// },
// {
// type: 'line',
// x: 2,
// y: 65,
// length: 72
// },
// {
// type: 'line',
// x: 2,
// y: 122,
// length: 72
// },
// {
// type: 'text',
// fontSize: 3.8,
// fontWeight: 700,
// x: 33,
// y: 5,
// default: '标题'
// },
// {
// type: 'qrcode',
// x: 30,
// y: 38,
// width: 18,
// default: 'https://supervise.yxtsoft.com/lpkapi?code=20231130110815671089'
// }
],
data: {
name: {
type: 'text',
x: 30, // x
y: 14, // y
fontSize: '5', // 字体大小
},
name2: {
type: 'text',
x: 17, // x
y: 48, // y
fontSize: '3', // 字体大小
},
code: {
x: 16,
y: 35,
type: 'qrcode',
default: 'https://supervise.yxtsoft.com/lpkapi?code=20231130110815671089',
width: 13
}
}
})
},
print() {
let printData = []
let printUrl = null
for (let index = 0; index < this.formData.number; index++) {
printData.push({
code: " ",
name: "家庭菜窖-白菜券",
name2: "222222"
})
}
this.template.print('printTemplate', printData).then(printPdf => {
if (printPdf) {
this.$message.success('生成成功')
printUrl = printPdf.output('bloburi', {
filename: '打印文件'
})
window.open(printUrl, '_blank')
} else {
this.$message.warring('生成失败')
}
})
}
}
}
</script>
<style scoped>
#container {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>

56
src/views/print/index.vue Normal file
View File

@@ -0,0 +1,56 @@
<template>
<div class="main-content">
<!-- <div class="container">
<div class="tab-header">
<el-form :inline="true" :model="page.params" class="demo-form-inline">
<el-row :gutter="20">
<el-col :span="21">
<el-form-item label="起始序列号">
<el-input v-model="page.params.startnum" placeholder="" clearable />
</el-form-item>
<el-form-item label="结束序列号">
<el-input v-model="page.params.endnum" placeholder="" clearable />
</el-form-item>
<el-button type="primary" @click="getPageList()"> </el-button>
</el-col>
</el-row>
</el-form>
</div>
-->
<div style="margin-top: 20px; width: 100%;height: 100%;">
<iframe :src="spUrl" id="ysOpenDevice" width="100%" height="100%" allowfullscreen>
</iframe>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'SupplierBankInfoIndex',
data() {
return {
page:{
params:{
startnum:"",
endnum:""
}
},
spUrl:process.env.VUE_APP_REPORT_URL+ "/jmreport/view/892282842138808320",
}
},
created() {
console.log("aaaaaa",process.env.VUE_APP_REPORT_URL)
},
methods: {
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,8 @@
<template>
</template>
<script>
</script>
<style>
</style>

View File

@@ -0,0 +1,8 @@
<template>
</template>
<script>
</script>
<style>
</style>

View File

@@ -0,0 +1,8 @@
<template>
</template>
<script>
</script>
<style>
</style>

View File

@@ -0,0 +1,230 @@
<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-input v-model="queryParams.params.realName" placeholder="" clearable />
</el-form-item>
<el-form-item label="手机号码">
<el-input v-model="queryParams.params.mobile" placeholder="" clearable />
</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%" :row-style="{height: '40px'}">
<!-- <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="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
<el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button>
</template>
</el-table-column> -->
<el-table-column prop="realName" label="用户名称" align="center" />
<el-table-column prop="nick" label="昵称" align="center" />
<el-table-column prop="mobile" label="手机号码" align="center" />
<el-table-column prop="createTime" label="创建时间" align="center" />
<el-table-column prop="wxMpOpenid" label="OpenId" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
</div>
</div>
</div>
</div>
</template>
<script>
import req from '@/api/userInfo/userInfo.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
export default {
name: 'SupplierBankInfoIndex',
components: {
ButtonBar,
Pagination,
pageye,
},
data() {
return {
btndisabled: false,
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [
// {
// type: 'primary',
// size: 'small',
// icon: 'plus',
// btnKey: 'toAdd',
// btnLabel: '新增'
// },
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
realName: '',
mobile: '',
}
},
sids: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
},
methods: {
// 搜索条件效果
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
req.customerListPage(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// 根据resp.code进行异常情况处理
this.dataList = []
this.queryParams.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
// 序号
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
name: '',
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选记录?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.brandDelBySids(row.id).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// 根据resp.code进行异常情况处理
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
resetState() {
this.viewState = 1
}
}
}
</script>
<style scoped>
</style>