Commit a7fdefcf authored by 燕南天's avatar 燕南天

前后台项目完善

parent b359f2cf
......@@ -3,12 +3,12 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
<title>xule_pro</title>
<title>娱乐汇</title>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
<script type="text/javascript">document.documentElement.style.fontSize = document.documentElement.clientWidth / 750*100 + 'px'; </script>
<script type="text/javascript">document.documentElement.style.fontSize = document.documentElement.clientWidth / 750*100*0.9 + 'px'; </script>
</body>
</html>
......@@ -5,7 +5,7 @@
</swiper-slide>
<div class="swiper-pagination swiper-pagination-bullets" slot="pagination"></div>
</swiper>
</swiper>
</template>
<script>
......@@ -17,6 +17,9 @@ export default {
pagination: {
el: ".swiper-pagination",
clickable: true
},
autoplay:{
delay:2500
}
}
};
......
......@@ -26,7 +26,7 @@ export default {
@r:100rem;
.list-item{
display: flex;
justify-content: space-between;
// justify-content: space-between;
box-sizing: border-box;
padding: 30/@r;
border-bottom: solid 1px #dedede;
......@@ -42,6 +42,7 @@ export default {
}
.item-infro{
width: 540/@r;
margin-left: 20/@r;
.name{
font-size: 32/@r;
color: #333;
......
......@@ -18,11 +18,11 @@ export default {
<style lang="less" scoped>
@r:100rem;
.staff-item{
width: 220/@r;
height: 280/@r;
width: 240/@r;
height: 300/@r;
position: relative;
margin-bottom: 15/@r;
margin-left: 15/@r;
margin-bottom: 20/@r;
margin-left: 20/@r;
box-shadow: 2px 2px 2px rgba(0,0,0,.2);
&:nth-child(3n+1){
margin-left: 0;
......
......@@ -125,6 +125,7 @@ export default {
.staff-wrapper {
display: flex;
flex-wrap: wrap;
// justify-content: space-between
padding: 0 30 / @r;
}
</style>
......
......@@ -3,7 +3,14 @@
<c-header title="商家详情"></c-header>
<div class="shop-main-infro">
<div class="img" :style="{'background-image':`url(${shopData.storeHomePic})`}"></div>
<swiper :options="swiperOption">
<swiper-slide v-for="(item,index) in shopImgs" :key="index">
<div class="img" :style="{'background-image':`url(${item})`}"></div>
</swiper-slide>
<div class="swiper-pagination" slot="pagination"></div>
</swiper>
<div class="infro-wrapper">
<div class="shop-name">{{shopData.storeName}}</div>
<div class="infro"><i class="iconfont icon-shijian"></i> {{shopData.storeBusinessTimeStart}}-{{shopData.storeBusinessTimeEnd}} <i class="iconfont icon-xiaofei"></i>{{shopData.consumeInterval}}</div>
......@@ -57,6 +64,16 @@ export default {
components:{CHeader,SInfroContent,NoData},
data(){
return {
swiperOption: {
pagination: {
el: ".swiper-pagination",
clickable: true,
type: 'fraction'
},
autoplay:{
delay:2500
}
},
shopData:{
storeName:'',
province:'',
......@@ -65,7 +82,9 @@ export default {
storePosition:'',
storeDetails:''
},
workerData:[]
workerData:[],
shopImgs:[]
}
},
beforeMount(){
......@@ -77,6 +96,7 @@ export default {
const param = {storeId:id}
shopDetails.storeDetails(param).then(res=>{
this.shopData = res.data
this.buildShopImg()
shopDetails.searchWorkerResult(param).then(res=>{
this.workerData = res.data
})
......@@ -84,6 +104,10 @@ export default {
},
toWorkerDetails(id){
this.$router.push({ path:`/workerDetails/${id}`})
},
buildShopImg(){
this.shopImgs = this.shopData.storePic?this.shopData.storePic.split(','):[]
// this.shopImgs.unshift(this.shopData.storeHomePic)
}
}
}
......@@ -107,7 +131,7 @@ export default {
bottom: 0;
padding: 10/@r 30/@r;
background: rgba(0, 0, 0, .5);
z-index: 10000;
.shop-name{
font-size: 36/@r;
color: #fff;
......@@ -145,13 +169,13 @@ export default {
.employee-item{
border-radius: 10/@r;
overflow: hidden;
width: 330/@r;
height: 400/@r;
width: 370/@r;
height: 450/@r;
background: #f0f0f0;
margin-bottom: 30/@r;
position: relative;
.img{
height: 250/@r;
height: 300/@r;
background: rgba(222,75,75,.5) ;
background-color: #dedede;
background-size:cover;
......@@ -207,6 +231,22 @@ export default {
}
}
.swiper-pagination-fraction{
font-size: 40/@r;
// font-weight: 700;
width: inherit;
color: #fff;
background: rgba(0, 0,0, .3);
padding: 10/@r 40/@r;
border-radius: 40/@r;
right: 20/@r;
top: 20/@r;
left: inherit;
bottom: inherit;
.swiper-pagination-current{
color: #de4b4b!important;
font-weight: 700!important;
}
}
</style>
......@@ -2,7 +2,12 @@
<div class="page-wrapper">
<c-header title="人员详情"></c-header>
<div class="worker-details" id="scrollContainer">
<div class="img" :style="{'background-image':`url(${workerData.workerHomePic})`}"></div>
<swiper :options="swiperOption">
<swiper-slide v-for="(item,index) in workerImgs" :key="index">
<div class="img" :style="{'background-image':`url(${item})`}"></div>
</swiper-slide>
<div class="swiper-pagination" slot="pagination"></div>
</swiper>
<div class="infro">
<div class="name">{{workerData.workerName}}<span class="clicks"><i class="iconfont icon-xinaixin"></i>{{workerData.clicks}}</span></div>
......@@ -64,11 +69,22 @@ export default {
components:{CHeader},
data(){
return {
swiperOption: {
pagination: {
el: ".swiper-pagination",
clickable: true,
type: 'fraction'
},
autoplay:{
delay:2500
}
},
workerData:{
workerName:'',
workerHomePic:'',
workerResume:''
}
},
workerImgs:[]
}
},
mounted(){
......@@ -85,12 +101,13 @@ export default {
}
workerDetails.workerDetails(param).then(res=>{
this.workerData = res.data
this.buildWorkerImg()
})
},
handleScroll(){
buildWorkerImg(){
this.workerImgs = this.workerData.workerPic?this.workerData.workerPic.split(','):[]
// this.workerImgs.unshift(this.workerData.workerHomePic)
},
toStoreDetails(id){
......@@ -242,6 +259,22 @@ export default {
}
}
}
.swiper-pagination-fraction{
font-size: 40/@r;
// font-weight: 700;
width: inherit;
color: #fff;
background: rgba(0, 0,0, .3);
padding: 10/@r 40/@r;
border-radius: 40/@r;
right: 40/@r;
left: inherit;
.swiper-pagination-current{
color: #de4b4b!important;
font-weight: 700!important;
}
}
</style>
......@@ -15,11 +15,11 @@ export default {
<style lang="less" scoped>
@r:100rem;
.staff-item{
width: 220/@r;
height: 280/@r;
width: 240/@r;
height: 300/@r;
position: relative;
margin-bottom: 15/@r;
margin-left: 15/@r;
margin-bottom: 20/@r;
margin-left: 20/@r;
box-shadow: 2px 2px 2px rgba(0,0,0,.2);
&:nth-child(3n+1){
margin-left: 0;
......
......@@ -68,5 +68,7 @@ export default {
.nodata-wrapper{
padding-top: 200/@r;
}
</style>
......@@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<!-- 激活chrome frame内核插件 -->
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<title>内部资讯管理系统</title>
<title>娱乐汇管理系统</title>
<!-- <link rel="stylesheet" type="text/css" href="http://at.alicdn.com/t/font_674196_89pa9pmfyd0cz0k9.css"> -->
</head>
<body>
......
<template>
<div class="model-container">
<el-card shadow="never">
<div slot="header" class="clearfix">
<span><i class="iconfont icon-sousuo"></i>快捷搜索</span>
<div class="btns-wrapper-right">
<el-button type="primary" plain @click="seachFun">确定</el-button>
<el-button type="warning" plain @click="resetFun" :disabled="isActiveReset">重置</el-button>
</div>
</div>
<el-row :gutter="15">
<el-col :span="4">
<el-col class="input-name" :span="7">管理员名称</el-col>
<el-col :span="17"><el-input placeholder="请输入关键字" v-model="seacherParam.administratorsName" @keyup.enter.native="seachFun"></el-input></el-col>
</el-col>
<div class="model-container">
<el-card shadow="never">
<div slot="header" class="clearfix">
<span>
<i class="iconfont icon-sousuo"></i>快捷搜索</span>
<div class="btns-wrapper-right">
<el-button type="primary" plain @click="seachFun">确定</el-button>
<el-button type="warning" plain @click="resetFun" :disabled="isActiveReset">重置</el-button>
</div>
</div>
<el-row :gutter="15">
<el-col :span="4">
<el-col class="input-name" :span="7">管理员名称</el-col>
<el-col :span="17">
<el-input placeholder="请输入关键字" v-model="seacherParam.administratorsName" @keyup.enter.native="seachFun"></el-input>
</el-col>
</el-col>
<!-- <el-col :xl="4" :lg="6" :md="6" :sm="8" id="visReason">
<!-- <el-col :xl="4" :lg="6" :md="6" :sm="8" id="visReason">
<el-col class="input-name" :xl="7" :lg="7" :md="7" :sm="7">审核状态</el-col>
<el-col :xl="17" :lg="17" :md="17" :sm="17">
<el-select v-model="seacherParam.isAuditing" placeholder="请选择">
......@@ -28,88 +31,77 @@
</el-col>
</el-col> -->
</el-row>
</el-row>
</el-card>
<el-card>
<div slot="header" class="clearfix">
<!-- <span><i class="iconfont icon-sousuo"></i>表格数据</span> -->
<div class="btns-wrapper-left">
<el-button type="primary" plain @click="add">新增</el-button>
</div>
</div>
<div class="table-wrapper">
<el-table empty-text="暂无数据" :stripe="true" :data="dataOption" v-loading="!dataOption">
</el-card>
<el-card>
<div slot="header" class="clearfix">
<!-- <span><i class="iconfont icon-sousuo"></i>表格数据</span> -->
<div class="btns-wrapper-left">
<el-button type="primary" plain @click="add">新增</el-button>
</div>
</div>
<div class="table-wrapper">
<el-table empty-text="暂无数据" :stripe="true" :data="dataOption" v-loading="!dataOption">
<el-table-column prop="administratorsName" label="姓名"></el-table-column>
<!-- <el-table-column label="性别">
<el-table-column prop="administratorsName" label="姓名"></el-table-column>
<!-- <el-table-column label="性别">
<template slot-scope="scope">
<span>{{scope.row.sex===1?'男':'女'}}</span>
</template>
</el-table-column> -->
<el-table-column prop="contactNumber" label="联系电话"></el-table-column>
<el-table-column prop="wechat" label="微信"></el-table-column>
<el-table-column prop="qq" label="qq"></el-table-column>
<!-- <el-table-column prop="qrCode" label="二维码"></el-table-column> -->
<el-table-column label="二维码">
<template slot-scope="scope">
<img :src="scope.row.qrCode" style="width:80px;height:80px;"/>
</template>
</el-table-column>
<el-table-column prop="contactNumber" label="联系电话"></el-table-column>
<el-table-column prop="wechat" label="微信"></el-table-column>
<el-table-column prop="qq" label="qq"></el-table-column>
<!-- <el-table-column prop="qrCode" label="二维码"></el-table-column> -->
<el-table-column label="二维码">
<template slot-scope="scope">
<img :src="scope.row.qrCode" style="width:80px;height:80px;" />
</template>
</el-table-column>
<el-table-column label="创建时间">
<template slot-scope="scope">
<span>{{fattTime(scope.row.createTime)}}</span>
</template>
</el-table-column>
<!-- <el-table-column label="审核状态">
<el-table-column label="创建时间">
<template slot-scope="scope">
<span>{{fattTime(scope.row.createTime)}}</span>
</template>
</el-table-column>
<!-- <el-table-column label="审核状态">
<template slot-scope="scope">
<span>{{scope.row.isAuditing===1?'已审核':'未审核'}}</span>
</template>
</el-table-column> -->
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="primary" circle class="table-icon" @click="check(scope.row)"><i class="iconfont icon-chakan"></i></el-button>
<el-button type="primary" icon="el-icon-edit" circle class="table-icon" @click="edit(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页处理 -->
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pageNo"
:page-sizes="[10, 20, 30]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="rowCount">
</el-pagination>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="primary" circle class="table-icon" @click="check(scope.row)">
<i class="iconfont icon-chakan"></i>
</el-button>
<el-button type="primary" icon="el-icon-edit" circle class="table-icon" @click="edit(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页处理 -->
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageNo" :page-sizes="[10, 20, 30]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="rowCount">
</el-pagination>
</div>
</div>
</el-card>
</el-card>
<!-- 添加dialog -->
<!-- 添加dialog -->
<!-- 查看,编辑dialog -->
<el-dialog
:title="dialogTitle"
:visible.sync="dialogState"
width="30%"
:before-close="handleClose">
<div class="dialog-body-content">
<el-row :gutter="15">
<el-col :span="8" class="content-left"><label>名称</label></el-col>
<el-col :span="16" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入管理员名称" v-model="dialogBindData.administratorsName"></el-input>
<span v-else>{{dialogBindData.administratorsName}}</span>
</el-col>
</el-row>
<!-- 查看,编辑dialog -->
<el-dialog :title="dialogTitle" :visible.sync="dialogState" width="30%" :before-close="handleClose">
<div class="dialog-body-content">
<el-row :gutter="15">
<el-col :span="8" class="content-left">
<label>名称</label>
</el-col>
<el-col :span="16" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入管理员名称" v-model="dialogBindData.administratorsName"></el-input>
<span v-else>{{dialogBindData.administratorsName}}</span>
</el-col>
</el-row>
<!-- <el-row :gutter="15" v-if="dialogType===3">
<el-col :span="8" class="content-left"><label>审核状态</label></el-col>
......@@ -122,59 +114,57 @@
</el-col>
</el-row> -->
<el-row :gutter="15">
<el-col :span="8" class="content-left">
<label>电话</label>
</el-col>
<el-col :span="16" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入电话号码" v-model="dialogBindData.contactNumber"></el-input>
<span v-else>{{dialogBindData.contactNumber}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="8" class="content-left"><label>电话</label></el-col>
<el-col :span="16" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入电话号码" v-model="dialogBindData.contactNumber"></el-input>
<span v-else>{{dialogBindData.contactNumber}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="8" class="content-left">
<label>微信</label>
</el-col>
<el-col :span="16" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入微信号" v-model="dialogBindData.wechat"></el-input>
<span v-else>{{dialogBindData.wechat}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="8" class="content-left">
<label>QQ</label>
</el-col>
<el-col :span="16" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入QQ" v-model="dialogBindData.qq"></el-input>
<span v-else>{{dialogBindData.qq}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="8" class="content-left"><label>微信</label></el-col>
<el-col :span="16" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入微信号" v-model="dialogBindData.wechat"></el-input>
<span v-else>{{dialogBindData.wechat}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="8" class="content-left">
<label>二维码</label>
</el-col>
<el-col :span="16" class="content-right">
<up-load-img ref="imgComponent" v-if="dialogType===1 || dialogType===2" width="120" height="120" resPath="qrCode" :type="dialogType===2" :viewUrl="this.dialogBindData.qrCode" @emitSuccess="handleImgLoad">
</up-load-img>
<img @click="magnify(dialogBindData.qrCode)" v-else :src="dialogBindData.qrCode" width="120" height="120">
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="8" class="content-left"><label>QQ</label></el-col>
<el-col :span="16" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入QQ" v-model="dialogBindData.qq"></el-input>
<span v-else>{{dialogBindData.qq}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="8" class="content-left"><label>二维码</label></el-col>
<el-col :span="16" class="content-right">
<up-load-img
ref="imgComponent"
v-if="dialogType===1 || dialogType===2"
width="120"
height="120"
resPath="qrCode"
:type="dialogType===2"
:viewUrl="this.dialogBindData.qrCode"
@emitSuccess="handleImgLoad">
</up-load-img>
<img @click="magnify(dialogBindData.qrCode)" v-else :src="dialogBindData.qrCode" width="120" height="120">
</el-col>
</el-row>
</div>
<div class="btns-wrapper">
<el-button size="small" @click="handleClose" :disabled="dialogType===3"><i class="iconfont icon-quxiao"></i>取消</el-button>
<el-button v-if="!submmitSuccess" type="primary" size="small" @click="submmitFun" :disabled="dialogType===3"><i class="iconfont icon-tijiao"></i>提交</el-button>
<el-button v-else :loading="true" type="primary" size="small" :disabled="true">提交</el-button>
</div>
</el-dialog>
</div>
</div>
<div class="btns-wrapper">
<el-button size="small" @click="handleClose" :disabled="dialogType===3">
<i class="iconfont icon-quxiao"></i>取消</el-button>
<el-button v-if="!submmitSuccess" type="primary" size="small" @click="submmitFun" :disabled="dialogType===3">
<i class="iconfont icon-tijiao"></i>提交</el-button>
<el-button v-else :loading="true" type="primary" size="small" :disabled="true">提交</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
......@@ -188,14 +178,14 @@ export default {
return {
seacherParam: {
administratorsName: "",
isAuditing:""
isAuditing: ""
},
//审核状态 选择数据项
isAuditingData: [
{ code: "0", name: "未审核" },
{ code: "1", name: "已审核" }
],
isAuditingData: [
{ code: "0", name: "未审核" },
{ code: "1", name: "已审核" }
],
// 表格数据
dataOption: null,
......@@ -206,15 +196,14 @@ export default {
// ---------------------------------------查看和编辑dialog--------------------------------
dialogState: false,
dialogType: 1, // 1--增加 2--编辑 3--查看
dialogBindData: {
administratorsName: "",
contactNumber: "",
wechat: "",
qq:"",
qrCode:"",
isAuditing:1,
qq: "",
qrCode: "",
isAuditing: 1,
createTime: "",
repairWorkerIdCard: ""
},
......@@ -292,9 +281,13 @@ export default {
}
},
submmitFun() {
// 发送添加请求
const isSubmitActive = this.dialogBindData.administratorsName&&this.dialogBindData.contactNumber&&this.dialogBindData.wechat&&this.dialogBindData.qq&&this.dialogBindData.qrCode;
const isSubmitActive =
this.dialogBindData.administratorsName &&
this.dialogBindData.contactNumber &&
this.dialogBindData.wechat &&
this.dialogBindData.qq &&
this.dialogBindData.qrCode;
if (isSubmitActive) {
this.submmitSuccess = true;
admin.addOrEditAdministrators(this.dialogBindData).then(res => {
......@@ -372,10 +365,7 @@ export default {
},
handleImgLoad(url) {
this.dialogBindData.qrCode = url;
},
}
},
computed: {
// 激活重置按钮
......
......@@ -330,17 +330,31 @@ export default {
isAvailable: 1,
linkUrl: this.dialogBindData.linkUrl
};
this.submmitSuccess = true;
adver.addOrEditAdvert(param).then(res => {
this.getList(() => {
this.$message({
message: this.dialogType === 1 ? "添加成功" : "编辑成功",
type: "success"
let submitParam =
param.advertTitle&&
param.advertPicUrl&&
param.advertContent
if(!!submitParam){
this.submmitSuccess = true;
adver.addOrEditAdvert(param).then(res => {
this.getList(() => {
this.$message({
message: this.dialogType === 1 ? "添加成功" : "编辑成功",
type: "success"
});
this.submmitSuccess = false;
this.handleClose();
});
this.submmitSuccess = false;
this.handleClose();
});
});
}else{
this.$message({
message: "请完善信息",
type: "warning"
});
}
},
//关闭弹框
handleClose() {
......
......@@ -2,7 +2,7 @@
<div class="login-container" :style="{backgroundImage:'url(' + bgImg + ')' }">
<el-form class="login-form" autoComplete="on" :model="loginForm" :rules="loginRules" ref="loginForm" label-position="left">
<div class="title-container">
<h3 class="title">内部资讯管理系统</h3>
<h3 class="title">娱乐汇管理系统</h3>
</div>
<el-form-item prop="username">
<span class="svg-container svg-container_login">
......
<template>
<div class="model-container">
<el-card shadow="never">
<div slot="header" class="clearfix">
<span><i class="iconfont icon-sousuo"></i>快捷搜索</span>
<div class="btns-wrapper-right">
<el-button type="primary" plain @click="seachFun">确定</el-button>
<el-button type="warning" plain @click="resetFun" :disabled="isActiveReset">重置</el-button>
<div class="model-container">
<el-card shadow="never">
<div slot="header" class="clearfix">
<span>
<i class="iconfont icon-sousuo"></i>快捷搜索</span>
<div class="btns-wrapper-right">
<el-button type="primary" plain @click="seachFun">确定</el-button>
<el-button type="warning" plain @click="resetFun" :disabled="isActiveReset">重置</el-button>
</div>
</div>
<el-row :gutter="15">
<el-col :span="4">
<el-col class="input-name" :span="7">店铺名称</el-col>
<el-col :span="17">
<el-input placeholder="请输入关键字" v-model="seacherParam.storeName" @keyup.enter.native="seachFun"></el-input>
</el-col>
</el-col>
<el-col :span="4">
<el-col class="input-name" :span="7">是否审核</el-col>
<el-col :span="17" style="line-height:40px">
<el-select v-model="seacherParam.isAuditing" placeholder="请选择">
<el-option v-for="item in isAuditingData" :key="item.code" :label="item.name" :value="item.code">
</el-option>
</el-select>
</el-col>
</el-col>
<el-col :span="4">
<el-col class="input-name" :span="7">是否展示</el-col>
<el-col :span="17" style="line-height:40px">
<el-select v-model="seacherParam.isShopping" placeholder="请选择">
<el-option v-for="item in isShoppingData" :key="item.code" :label="item.name" :value="item.code">
</el-option>
</el-select>
</el-col>
</el-col>
</el-row>
</el-card>
<el-card>
<div slot="header" class="clearfix">
<!-- <span><i class="iconfont icon-sousuo"></i>表格数据</span> -->
<div class="btns-wrapper-left">
<el-button type="primary" plain @click="add">新增</el-button>
<el-button v-if="isAdmin==1" type="success" plain @click="allShowFun" :disabled="!tableItemIDS.length">批量显示</el-button>
<el-button v-if="isAdmin==1" type="danger" plain @click="allSFun" :disabled="!tableItemIDS.length">批量审核</el-button>
</div>
</div>
<div class="table-wrapper">
<el-table empty-text="暂无数据" :stripe="true" :data="dataOption" v-loading="!dataOption" @selection-change="handleSelectionChange">
<el-table-column v-if="isAdmin==1" type="selection" width="55"></el-table-column>
<el-table-column prop="serialNumber" label="推荐序号" sortable></el-table-column>
<el-table-column prop="storeName" label="店铺名称"></el-table-column>
<el-table-column prop="contactNumber" label="联系电话"></el-table-column>
<el-table-column prop="contacts" label="联系人"></el-table-column>
<el-table-column prop="qq" label="QQ"></el-table-column>
<el-table-column prop="wechat" label="微信"></el-table-column>
<el-table-column prop="province" label="省份"></el-table-column>
<el-table-column prop="cityName" label="市区"></el-table-column>
<el-table-column prop="county" label="区县"></el-table-column>
<el-table-column prop="storePosition" label="位置"></el-table-column>
<el-table-column label="营业时间">
<template slot-scope="scope">
<span>{{scope.row.storeBusinessTimeStart}}{{scope.row.storeBusinessTimeEnd}}</span>
</template>
</el-table-column>
<el-table-column prop="consumeInterval" label="消费区间"></el-table-column>
<!-- <el-table-column prop="isShopping" label="消费区间"></el-table-column> -->
<el-table-column label="是否展示" v-if="isAdmin==1">
<template slot-scope="scope">
<span>
<el-switch v-model="scope.row.isShopping" :active-value="1" :inactive-value="0" @change="handleIsVailable(scope.row)">
</el-switch>
</span>
</template>
</el-table-column>
<el-table-column label="到期时间">
<template slot-scope="scope">
<span>{{fattTime(scope.row.matureTime)}}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button type="primary" circle class="table-icon" @click="check(scope.row)">
<i class="iconfont icon-chakan"></i>
</el-button>
<el-button type="primary" icon="el-icon-edit" circle class="table-icon" @click="edit(scope.row)"></el-button>
<!-- 推荐 -->
<el-button v-if="scope.row.isAuditing==1 && scope.row.isShopping==1" type="success" circle class="table-icon" @click="handleRecommendFun(scope.row)">
<i class="iconfont icon-tijiao"></i>
</el-button>
<!-- 删除 -->
<el-popover placement="top" width="160" v-model="scope.row.delState">
<p style="margin-bottom:10px;font-weight:700;">确认删除吗?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="scope.row.delState = false">取消</el-button>
<el-button type="primary" size="mini" @click="del(scope.row)">确定</el-button>
</div>
</div>
<el-row :gutter="15">
<el-col :span="4">
<el-col class="input-name" :span="7">店铺名称</el-col>
<el-col :span="17"><el-input placeholder="请输入关键字" v-model="seacherParam.storeName" @keyup.enter.native="seachFun"></el-input></el-col>
</el-col>
<el-col :span="4">
<el-col class="input-name":span="7">是否审核</el-col>
<el-col :span="17" style="line-height:40px">
<el-select v-model="seacherParam.isAuditing" placeholder="请选择">
<el-option
v-for="item in isAuditingData"
:key="item.code"
:label="item.name"
:value="item.code">
</el-option>
</el-select>
</el-col>
</el-col>
<el-col :span="4">
<el-col class="input-name":span="7">是否展示</el-col>
<el-col :span="17" style="line-height:40px">
<el-select v-model="seacherParam.isShopping" placeholder="请选择">
<el-option
v-for="item in isShoppingData"
:key="item.code"
:label="item.name"
:value="item.code">
</el-option>
</el-select>
</el-col>
</el-col>
</el-row>
</el-card>
<el-card>
<div slot="header" class="clearfix">
<!-- <span><i class="iconfont icon-sousuo"></i>表格数据</span> -->
<div class="btns-wrapper-left">
<el-button type="primary" plain @click="add">新增</el-button>
<el-button type="success" plain @click="allShowFun" :disabled="!tableItemIDS.length">批量显示</el-button>
<el-button type="danger" plain @click="allSFun" :disabled="!tableItemIDS.length">批量审核</el-button>
<el-button slot="reference" type="danger" circle icon="el-icon-delete" class="table-icon popver-btn"></el-button>
</el-popover>
<!-- 审核 -->
<el-popover v-if="scope.row.isAuditing!=1&&isAdmin==1" placement="top" width="160" v-model="scope.row.delState1">
<p style="margin-bottom:10px;font-weight:700;">确认通过审核吗?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="scope.row.delState1 = false">取消</el-button>
<el-button type="primary" size="mini" @click="handleAuditFun(scope.row)">通过</el-button>
</div>
</div>
<div class="table-wrapper">
<el-table empty-text="暂无数据" :stripe="true" :data="dataOption" v-loading="!dataOption" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="serialNumber" label="推荐序号" sortable></el-table-column>
<el-table-column prop="storeName" label="店铺名称"></el-table-column>
<el-table-column prop="contactNumber" label="联系电话"></el-table-column>
<el-table-column prop="contacts" label="联系人"></el-table-column>
<el-table-column prop="qq" label="QQ"></el-table-column>
<el-table-column prop="wechat" label="微信"></el-table-column>
<el-table-column prop="province" label="省份"></el-table-column>
<el-table-column prop="cityName" label="市区"></el-table-column>
<el-table-column prop="county" label="区县"></el-table-column>
<el-table-column prop="storePosition" label="位置"></el-table-column>
<el-table-column label="营业时间">
<template slot-scope="scope">
<span>{{scope.row.storeBusinessTimeStart}}{{scope.row.storeBusinessTimeEnd}}</span>
</template>
</el-table-column>
<el-table-column prop="consumeInterval" label="消费区间"></el-table-column>
<!-- <el-table-column prop="isShopping" label="消费区间"></el-table-column> -->
<el-table-column label="是否展示" v-if="isAdmin==1">
<template slot-scope="scope">
<span>
<el-switch
v-model="scope.row.isShopping"
:active-value="1"
:inactive-value="0"
@change="handleIsVailable(scope.row)">
</el-switch>
</span>
</template>
</el-table-column>
<el-table-column label="到期时间">
<template slot-scope="scope">
<span>{{fattTime(scope.row.matureTime)}}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button type="primary" circle class="table-icon" @click="check(scope.row)"><i class="iconfont icon-chakan"></i></el-button>
<el-button type="primary" icon="el-icon-edit" circle class="table-icon" @click="edit(scope.row)"></el-button>
<!-- 推荐 -->
<el-button v-if="scope.row.isAuditing==1 && scope.row.isShopping==1" type="success" circle class="table-icon" @click="handleRecommendFun(scope.row)"><i class="iconfont icon-tijiao"></i></el-button>
<!-- 删除 -->
<el-popover
placement="top"
width="160"
v-model="scope.row.delState">
<p style="margin-bottom:10px;font-weight:700;">确认删除吗?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="scope.row.delState = false">取消</el-button>
<el-button type="primary" size="mini" @click="del(scope.row)">确定</el-button>
</div>
<el-button slot="reference" type="danger" circle icon="el-icon-delete" class="table-icon popver-btn"></el-button>
</el-popover>
<!-- 审核 -->
<el-popover
v-if="scope.row.isAuditing!=1&&isAdmin==1"
placement="top"
width="160"
v-model="scope.row.delState1">
<p style="margin-bottom:10px;font-weight:700;">确认通过审核吗?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="scope.row.delState1 = false">取消</el-button>
<el-button type="primary" size="mini" @click="handleAuditFun(scope.row)">通过</el-button>
</div>
<el-button slot="reference" type="warning" circle icon="el-icon-setting" class="table-icon popver-btn"></el-button>
</el-popover>
</template>
</el-table-column>
</el-table>
<!-- 分页处理 -->
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pageNo"
:page-sizes="[10, 20, 30]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="rowCount">
</el-pagination>
</div>
</el-card>
<!-- 添加dialog -->
<el-dialog
:title="dialogTitle"
:visible.sync="dialogState"
width="100%"
:fullscreen="true"
:before-close="handleClose">
<div class="dialog-body-content">
<el-row :gutter="12">
<el-col :span="8">
<h1 class="food-title">店铺信息</h1>
<el-row :gutter="15">
<el-col :span="3" class="content-left"><label>店铺名称</label></el-col>
<el-col :span="21" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入店铺名称" v-model="dialogBindData.storeName"></el-input>
<span v-else>{{dialogBindData.storeName}}</span>
</el-col>
</el-row>
<el-button slot="reference" type="warning" circle icon="el-icon-setting" class="table-icon popver-btn"></el-button>
</el-popover>
</template>
</el-table-column>
</el-table>
<el-row :gutter="15">
<el-col :span="3" class="content-left"><label>店铺简介</label></el-col>
<el-col :span="21" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" type="textarea" :rows="2" placeholder="请输入店铺简介" v-model="dialogBindData.brief"></el-input>
<span v-else>{{dialogBindData.brief}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="3" class="content-left"><label>管理员</label></el-col>
<el-col :span="21" class="content-right">
<el-select v-if="dialogType===1 || dialogType===2" v-model="dialogBindData.administratorsId" placeholder="请选择">
<el-option
v-for="item in managerData"
:key="item.administratorsId"
:label="item.administratorsName"
:value="item.administratorsId">
</el-option>
</el-select>
<span v-else>{{dialogBindData.administratorsName}}</span>
</el-col>
</el-row>
<!-- 分页处理 -->
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageNo" :page-sizes="[10, 20, 30]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="rowCount">
</el-pagination>
<el-row :gutter="15">
<el-col :span="3" class="content-left"><label>联系电话</label></el-col>
<el-col :span="21" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入联系电话" v-model="dialogBindData.contactNumber"></el-input>
<span v-else>{{dialogBindData.contactNumber}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="3" class="content-left"><label>联系人</label></el-col>
<el-col :span="21" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入联系人" v-model="dialogBindData.contacts"></el-input>
<span v-else>{{dialogBindData.contacts}}</span>
</el-col>
</el-row>
</div>
</el-card>
<!-- 添加dialog -->
<el-dialog :title="dialogTitle" :visible.sync="dialogState" width="100%" :fullscreen="true" :before-close="handleClose">
<div class="dialog-body-content">
<el-row :gutter="15">
<el-col :span="3" class="content-left"><label>QQ</label></el-col>
<el-col :span="21" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入QQ" v-model="dialogBindData.qq"></el-input>
<span v-else>{{dialogBindData.qq}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="3" class="content-left"><label>微信</label></el-col>
<el-col :span="21" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入微信" v-model="dialogBindData.wechat"></el-input>
<span v-else>{{dialogBindData.wechat}}</span>
</el-col>
</el-row>
<!-- 地址的三级联动 -->
<el-row :gutter="15">
<el-col :span="3" class="content-left"><label>店铺位置</label></el-col>
<el-col :span="21" class="content-right" style="width:500px">
<el-row :gutter="15" v-if="dialogType===1 || dialogType===2">
<el-col :span="8">
<el-select v-model="dialogBindData.provinceId" placeholder="请选择省、市" @change="choosePFun">
<el-option
v-for="item in posPData"
:key="item.codeP"
:label="item.name"
:value="item.codeP">
</el-option>
</el-select>
</el-col>
<el-col :span="8">
<el-select v-model="dialogBindData.cityId" placeholder="请选择市、区" @change="chooseCFun" :disabled="!posCData">
<el-option
v-for="item in posCData"
:key="item.codeC"
:label="item.name"
:value="item.codeC">
</el-option>
</el-select>
</el-col>
<el-col :span="8">
<el-select v-model="dialogBindData.countyId" placeholder="请选择区、县" :disabled="!posAData">
<el-option
v-for="item in posAData"
:key="item.codeA"
:label="item.name"
:value="item.codeA">
</el-option>
</el-select>
</el-col>
</el-row>
<span v-else>{{dialogBindData.province+'-'+dialogBindData.cityName+'-'+dialogBindData.county}}</span>
</el-col>
</el-row>
<el-row :gutter="12">
<el-col :span="8">
<h1 class="food-title">店铺信息</h1>
<el-row :gutter="15">
<el-col :span="3" class="content-left">
<label>店铺名称</label>
</el-col>
<el-col :span="21" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入店铺名称" v-model="dialogBindData.storeName"></el-input>
<span v-else>{{dialogBindData.storeName}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="3" class="content-left">
<label>店铺简介</label>
</el-col>
<el-col :span="21" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" type="textarea" :rows="2" placeholder="请输入店铺简介" v-model="dialogBindData.brief"></el-input>
<span v-else>{{dialogBindData.brief}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="3" class="content-left">
<label>管理员</label>
</el-col>
<el-col :span="21" class="content-right">
<el-select v-if="dialogType===1 || dialogType===2" v-model="dialogBindData.administratorsId" placeholder="请选择">
<el-option v-for="item in managerData" :key="item.administratorsId" :label="item.administratorsName" :value="item.administratorsId">
</el-option>
</el-select>
<span v-else>{{dialogBindData.administratorsName}}</span>
</el-col>
</el-row>
<!-- 位置添加 -->
<el-row :gutter="15">
<el-col :span="3" class="content-left"><label>街道</label></el-col>
<el-col :span="21" class="content-right" style="width:500px">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入位置" v-model="dialogBindData.storePosition"></el-input>
<span v-else>{{dialogBindData.storePosition}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="3" class="content-left">
<label>联系电话</label>
</el-col>
<el-col :span="21" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入联系电话" v-model="dialogBindData.contactNumber"></el-input>
<span v-else>{{dialogBindData.contactNumber}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="3" class="content-left">
<label>联系人</label>
</el-col>
<el-col :span="21" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入联系人" v-model="dialogBindData.contacts"></el-input>
<span v-else>{{dialogBindData.contacts}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="3" class="content-left">
<label>QQ</label>
</el-col>
<el-col :span="21" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入QQ" v-model="dialogBindData.qq"></el-input>
<span v-else>{{dialogBindData.qq}}</span>
</el-col>
</el-row>
<!-- 营业时间 -->
<el-row :gutter="15">
<el-col :span="3" class="content-left"><label>营业时间</label></el-col>
<el-col :span="21" v-if="dialogType===1 || dialogType===2" class="content-right" style="width:500px">
<div class="start-end-time">
<el-input placeholder="请输入开始时间" style="width:200px;" v-model="dialogBindData.storeBusinessTimeStart"></el-input>
<span></span>
<el-input placeholder="请输入结束时间" style="width:200px;" v-model="dialogBindData.storeBusinessTimeEnd"></el-input>
</div>
</el-col>
<span v-else>{{dialogBindData.storeBusinessTimeStart}}至{{dialogBindData.storeBusinessTimeEnd}}</span>
</el-row>
<!-- 到期时间 -->
<el-row :gutter="15">
<el-col :span="3" class="content-left"><label>到期时间</label></el-col>
<el-col :span="21" v-if="dialogType===1 || dialogType===2" class="content-right" style="width:500px">
<el-date-picker
v-model="dialogBindData.matureTime"
type="datetime"
placeholder="选择到期时间">
</el-date-picker>
</el-col>
<span v-else>{{dialogBindData.matureTime}}</span>
</el-row>
<el-row :gutter="15">
<el-col :span="3" class="content-left">
<label>微信</label>
</el-col>
<el-col :span="21" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入微信" v-model="dialogBindData.wechat"></el-input>
<span v-else>{{dialogBindData.wechat}}</span>
</el-col>
</el-row>
<!-- 地址的三级联动 -->
<el-row :gutter="15">
<el-col :span="3" class="content-left">
<label>店铺位置</label>
</el-col>
<el-col :span="21" class="content-right" style="width:500px">
<el-row :gutter="15" v-if="dialogType===1 || dialogType===2">
<el-col :span="8">
<el-select v-model="dialogBindData.provinceId" placeholder="请选择省、市" @change="choosePFun">
<el-option v-for="item in posPData" :key="item.codeP" :label="item.name" :value="item.codeP">
</el-option>
</el-select>
</el-col>
<el-col :span="8">
<el-select v-model="dialogBindData.cityId" placeholder="请选择市、区" @change="chooseCFun" :disabled="!posCData">
<el-option v-for="item in posCData" :key="item.codeC" :label="item.name" :value="item.codeC">
</el-option>
</el-select>
</el-col>
<el-col :span="8">
<el-select v-model="dialogBindData.countyId" placeholder="请选择区、县" :disabled="!posAData">
<el-option v-for="item in posAData" :key="item.codeA" :label="item.name" :value="item.codeA">
</el-option>
</el-select>
</el-col>
</el-row>
<span v-else>{{dialogBindData.province+'-'+dialogBindData.cityName+'-'+dialogBindData.county}}</span>
</el-col>
</el-row>
<!-- 位置添加 -->
<el-row :gutter="15">
<el-col :span="3" class="content-left">
<label>街道</label>
</el-col>
<el-col :span="21" class="content-right" style="width:500px">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入位置" v-model="dialogBindData.storePosition"></el-input>
<span v-else>{{dialogBindData.storePosition}}</span>
</el-col>
</el-row>
<!-- 营业时间 -->
<el-row :gutter="15">
<el-col :span="3" class="content-left">
<label>营业时间</label>
</el-col>
<el-col :span="21" v-if="dialogType===1 || dialogType===2" class="content-right" style="width:500px">
<div class="start-end-time">
<el-input placeholder="请输入开始时间" style="width:200px;" v-model="dialogBindData.storeBusinessTimeStart"></el-input>
<span></span>
<el-input placeholder="请输入结束时间" style="width:200px;" v-model="dialogBindData.storeBusinessTimeEnd"></el-input>
</div>
</el-col>
<span v-else>{{dialogBindData.storeBusinessTimeStart}}至{{dialogBindData.storeBusinessTimeEnd}}</span>
</el-row>
<el-row :gutter="15">
<el-col :span="3" class="content-left"><label>消费区间</label></el-col>
<el-col :span="21" v-if="dialogType===1 || dialogType===2" class="content-right" style="width:500px">
<div class="start-end-time">
<el-input placeholder="请输入最小金额" style="width:200px;" v-model="minPrice"></el-input>
<span></span>
<el-input placeholder="请输入最大金额" style="width:200px;" v-model="maxPrice"></el-input>
</div>
</el-col>
<span v-else>{{dialogBindData.consumeInterval}}</span>
</el-row>
<!-- 到期时间 -->
<el-row :gutter="15">
<el-col :span="3" class="content-left">
<label>到期时间</label>
</el-col>
<el-col :span="21" v-if="dialogType===1 || dialogType===2" class="content-right" style="width:500px">
<el-date-picker v-model="dialogBindData.matureTime" type="datetime" placeholder="选择到期时间">
</el-date-picker>
</el-col>
<span v-else>{{dialogBindData.matureTime}}</span>
</el-row>
<el-row :gutter="15">
<el-col :span="3" class="content-left">
<label>消费区间</label>
</el-col>
<el-col :span="21" v-if="dialogType===1 || dialogType===2" class="content-right" style="width:500px">
<div class="start-end-time">
<el-input placeholder="请输入最小金额" style="width:200px;" v-model="minPrice"></el-input>
<span></span>
<el-input placeholder="请输入最大金额" style="width:200px;" v-model="maxPrice"></el-input>
</div>
</el-col>
<span v-else>{{dialogBindData.consumeInterval}}</span>
</el-row>
<!-- <el-row :gutter="15">
<!-- <el-row :gutter="15">
<el-col :span="6" class="content-left"><label>二级链接</label></el-col>
<el-col :span="18" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" type="text" placeholder="请输入二级链接" resize="none" v-model="dialogBindData.linkUrl"></el-input>
......@@ -371,86 +313,96 @@
</el-col>
</el-row> -->
<!-- <el-input v-if="dialogType===1 || dialogType===2" size="small" type="textarea" rows="3" placeholder="请输入备注" resize="none" v-model="dialogBindData.memo"></el-input> -->
<!-- <el-input v-if="dialogType===1 || dialogType===2" size="small" type="textarea" rows="3" placeholder="请输入备注" resize="none" v-model="dialogBindData.memo"></el-input> -->
</el-col>
</el-col>
<el-col :span="6">
<h1 class="food-title">店铺图片</h1>
<el-col :span="6">
<h1 class="food-title">店铺图片</h1>
<el-row :gutter="15">
<el-col :span="4" class="content-left"><label>二维码</label></el-col>
<el-col :span="20" class="content-right">
<up-load-img
ref="imgComponent"
v-if="dialogType===1 || dialogType===2"
width="200"
height="200"
resPath="advertImg"
:type="dialogType"
:viewUrl="this.dialogBindData.qrCode"
@emitSuccess="handleImgLoad">
</up-load-img>
<img v-else :src="dialogBindData.qrCode" width="200" height="200">
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="4" class="content-left"><label>店铺主图</label></el-col>
<el-col :span="20" class="content-right">
<up-load-img
ref="imgComponent"
v-if="dialogType===1 || dialogType===2"
width="270"
height="160"
resPath="advertImg"
:type="dialogType"
:viewUrl="this.dialogBindData.storeHomePic"
@emitSuccess="handleImgLoad1">
</up-load-img>
<img v-else :src="dialogBindData.storeHomePic" width="270" height="160">
</el-col>
</el-row>
</el-col>
<el-col :span="10">
<h1 class="food-title">店铺详情</h1>
<tinymce v-if="dialogType===1 || dialogType===2" :height="400" v-model="dialogBindData.storeDetails" :hasImageLoad="1" resPath="adverImg"></tinymce>
<template v-else>
信息展示
<view-page :data="dialogBindData"></view-page>
</template>
</el-col>
<el-row :gutter="15">
<el-col :span="4" class="content-left">
<label>二维码</label>
</el-col>
<el-col :span="20" class="content-right">
<up-load-img ref="imgComponent1" v-if="dialogType===1 || dialogType===2" width="200" height="200" resPath="storeEWM" :type="dialogType" :viewUrl="this.dialogBindData.qrCode" @emitSuccess="handleImgLoad">
</up-load-img>
<img v-else :src="dialogBindData.qrCode" width="200" height="200">
</el-col>
</el-row>
</el-row>
<el-row :gutter="15">
<el-col :span="4" class="content-left">
<label>店铺主图</label>
</el-col>
<el-col :span="20" class="content-right">
<up-load-img ref="imgComponent2" v-if="dialogType===1 || dialogType===2" width="270" height="160" resPath="storeMianImg" :type="dialogType" :viewUrl="this.dialogBindData.storeHomePic" @emitSuccess="handleImgLoad1">
</up-load-img>
<img v-else :src="dialogBindData.storeHomePic" width="270" height="160">
</el-col>
</el-row>
</div>
<div class="btns-wrapper">
<el-button size="small" @click="handleClose" :disabled="dialogType===3"><i class="iconfont icon-quxiao"></i>取消</el-button>
<el-button v-if="!submmitSuccess" type="primary" size="small" @click="submmitFun" :disabled="dialogType===3"><i class="iconfont icon-tijiao"></i>提交</el-button>
<el-button v-else :loading="true" type="primary" size="small" :disabled="true">提交</el-button>
</div>
</el-dialog>
</div>
<el-row :gutter="15">
<el-col :span="4" class="content-left">
<label>店铺详图</label>
</el-col>
<el-col :span="20">
<up-load-img ref="imgComponent3" v-if="dialogType===1 || dialogType===2" width="134" height="80" resPath="storeDImg" :type="dialogType" :viewUrl="dImg1" @emitSuccess="handleImgLoad3">
</up-load-img>
<img v-else :src="dImg1" width="134" height="80">
<up-load-img ref="imgComponent4" v-if="dialogType===1 || dialogType===2" width="134" height="80" resPath="storeDImg" :type="dialogType" :viewUrl="dImg2" @emitSuccess="handleImgLoad4">
</up-load-img>
<img v-else :src="dImg2" width="134" height="80">
<up-load-img ref="imgComponent5" v-if="dialogType===1 || dialogType===2" width="134" height="80" resPath="storeDImg" :type="dialogType" :viewUrl="dImg3" @emitSuccess="handleImgLoad5">
</up-load-img>
<img v-else :src="dImg3" width="134" height="80">
<up-load-img ref="imgComponent6" v-if="dialogType===1 || dialogType===2" width="134" height="80" resPath="storeDImg" :type="dialogType" :viewUrl="dImg4" @emitSuccess="handleImgLoad6">
</up-load-img>
<img v-else :src="dImg4" width="134" height="80">
<up-load-img ref="imgComponent7" v-if="dialogType===1 || dialogType===2" width="134" height="80" resPath="storeDImg" :type="dialogType" :viewUrl="dImg5" @emitSuccess="handleImgLoad7">
</up-load-img>
<img v-else :src="dImg5" width="134" height="80">
</el-col>
</el-row>
</el-col>
<el-col :span="10">
<h1 class="food-title">店铺详情</h1>
<tinymce v-if="dialogType===1 || dialogType===2" :height="400" v-model="dialogBindData.storeDetails" :hasImageLoad="1" resPath="adverImg"></tinymce>
<template v-else>
信息展示
<view-page :data="dialogBindData"></view-page>
</template>
</el-col>
</el-row>
</div>
<div class="btns-wrapper">
<el-button size="small" @click="handleClose" :disabled="dialogType===3">
<i class="iconfont icon-quxiao"></i>取消</el-button>
<el-button v-if="!submmitSuccess" type="primary" size="small" @click="submmitFun" :disabled="dialogType===3">
<i class="iconfont icon-tijiao"></i>提交</el-button>
<el-button v-else :loading="true" type="primary" size="small" :disabled="true">提交</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import axios from 'axios';
import axios from "axios";
import UpLoadImg from "@/components/UpLoadImg";
import Tinymce from "@/components/Tinymce";
import ViewPage from "./components/ViewPage";
import * as cookie from '@/utils/auth'
import * as cookie from "@/utils/auth";
import * as Utils from "../../utils/index.js";
import * as store from "../../api/store";
import * as common from "../../api/common";
......@@ -462,16 +414,16 @@ export default {
return {
seacherParam: {
storeName: "",
isAuditing:''
isAuditing: ""
},
isAuditingData:[
{name:'审核通过',code:'1'},
{name:'未审核',code:'0'}
isAuditingData: [
{ name: "审核通过", code: "1" },
{ name: "未审核", code: "0" }
],
isShoppingData:[
{name:'已展示',code:1},
{name:'未展示',code:0}
isShoppingData: [
{ name: "已展示", code: 1 },
{ name: "未展示", code: 0 }
],
// 表格数据
dataOption: null,
......@@ -486,7 +438,7 @@ export default {
dialogBindData: {
storeId: "",
storeName: "",
brief:'',
brief: "",
contactNumber: "",
contacts: "",
qq: "",
......@@ -508,8 +460,8 @@ export default {
cityId: "",
countyId: "",
administratorsId:'',
administratorsName:''
administratorsId: "",
administratorsName: ""
},
// 是否提交
submmitSuccess: false,
......@@ -529,26 +481,30 @@ export default {
// 店铺管理员
managerData: null,
// 全选的id
tableItemIDS:'',
tableItemIDS: "",
// 登陆角色
isAdmin:'0'
isAdmin: "0",
dImg1: "",
dImg2: "",
dImg3: "",
dImg4: "",
dImg5: ""
};
},
beforeMount() {
this.isAdmin = this.getCookAdminType()
this.isAdmin = this.getCookAdminType();
this.getList();
},
mounted() {},
methods: {
// 登陆角色
getCookAdminType(){
let adminType = cookie.getUserInfro()
return JSON.parse(adminType).isAdmin
getCookAdminType() {
let adminType = cookie.getUserInfro();
return JSON.parse(adminType).isAdmin;
},
seachFun() {
this.$seach
......@@ -577,14 +533,11 @@ export default {
},
add() {
this.dialogType = 1;
axios.all([
this.getPList(),
this.getStoreAdministrators()
]).then((s,f)=>{
this.dialogState = true;
})
axios
.all([this.getPList(), this.getStoreAdministrators()])
.then((s, f) => {
this.dialogState = true;
});
},
del(data) {
store
......@@ -608,13 +561,14 @@ export default {
this.dialogType = 2;
const Cparam = { codeP: data.provinceId };
const Aparam = { codeC: data.cityId };
this.getPList(() => {
this.getCList(Cparam, () => {
this.getAList(Aparam, () => {
this.getStoreAdministrators(()=>{
this.getStoreAdministrators(() => {
this.reBindData(data);
this.dialogState = true;
})
});
});
});
});
......@@ -632,9 +586,25 @@ export default {
const prices = data.consumeInterval;
this.minPrice = prices.split("-")[0];
this.maxPrice = prices.split("-")[1];
const dImgArr = data.storePic ? data.storePic.split(",") : [];
if (dImgArr[0]) {
this.dImg1 = dImgArr[0];
}
if (dImgArr[1]) {
this.dImg2 = dImgArr[1];
}
if (dImgArr[2]) {
this.dImg3 = dImgArr[2];
}
if (dImgArr[3]) {
this.dImg4 = dImgArr[3];
}
if (dImgArr[4]) {
this.dImg5 = dImgArr[4];
}
},
submmitFun() {
// window.location.href = 'http://localhost:9527/#/worker/workerList'
const param = Utils.deepClone(this.dialogBindData);
......@@ -656,23 +626,59 @@ export default {
3
);
param.matureTime = this.fattTime(this.dialogBindData.matureTime);
param.administratorsName = this.buildManagerName(this.managerData,this.dialogBindData.administratorsId)
if(this.dialogType==1){
param.serialNumber = 99
param.administratorsName = this.buildManagerName(
this.managerData,
this.dialogBindData.administratorsId
);
if (this.dialogType == 1) {
param.serialNumber = 99;
}
this.submmitSuccess = true;
store.addOrEditStore(param).then(res => {
this.getList(() => {
this.$message({
message: this.dialogType === 1 ? "添加成功" : "编辑成功",
type: "success"
param.storePic = this.buildStorePic();
let submitParam =
param.administratorsId &&
param.administratorsName &&
param.brief &&
param.cityId &&
param.cityName &&
param.consumeInterval &&
param.contactNumber &&
param.contacts &&
param.county &&
param.countyId &&
param.matureTime &&
param.province &&
param.provinceId &&
param.qq &&
param.qrCode &&
param.storeBusinessTimeEnd &&
param.storeBusinessTimeStart &&
param.storeDetails &&
param.storeHomePic &&
param.storeName &&
param.storePic.length &&
param.storePosition &&
param.wechat;
if (!!submitParam) {
this.submmitSuccess = true;
store.addOrEditStore(param).then(res => {
this.getList(() => {
this.$message({
message: this.dialogType === 1 ? "添加成功" : "编辑成功",
type: "success"
});
this.submmitSuccess = false;
this.handleClose();
});
this.submmitSuccess = false;
this.handleClose();
});
});
} else {
this.$message({
message: "请完善信息",
type: "warning"
});
}
},
//关闭弹框
handleClose() {
......@@ -694,6 +700,26 @@ export default {
// 消费区间
this.minPrice = "";
this.maxPrice = "";
this.dImg1 = "";
this.dImg2 = "";
this.dImg3 = "";
this.dImg4 = "";
this.dImg5 = "";
this.$refs.imgComponent1.clearImg();
this.$refs.imgComponent2.clearImg();
this.$refs.imgComponent3.clearImg();
this.$refs.imgComponent4.clearImg();
this.$refs.imgComponent5.clearImg();
this.$refs.imgComponent6.clearImg();
this.$refs.imgComponent7.clearImg();
// 销毁富文本编辑器的dom对象
setTimeout(() => {
this.dialogType = 0;
}, 200);
},
// 分页处理
handleSizeChange(val) {
......@@ -713,7 +739,7 @@ export default {
.then(res => {
// 初始话表格数据
this.dataOption = res.data.data;
// 初始化分页数据
this.rowCount = res.data.rowCount;
this.pageSize = res.data.pageSize;
......@@ -722,11 +748,11 @@ export default {
},
// 管理员下拉
getStoreAdministrators(cb){
store.getStoreAdministrators().then(res=>{
getStoreAdministrators(cb) {
store.getStoreAdministrators().then(res => {
this.managerData = res.data.data;
cb ? cb() : "";
})
});
},
// 格式化时间
......@@ -814,6 +840,23 @@ export default {
this.dialogBindData.storeHomePic = url;
},
// 详情上传回调方法
handleImgLoad3(url) {
this.dImg1 = url;
},
handleImgLoad4(url) {
this.dImg2 = url;
},
handleImgLoad5(url) {
this.dImg3 = url;
},
handleImgLoad6(url) {
this.dImg4 = url;
},
handleImgLoad7(url) {
this.dImg5 = url;
},
// 获取省、市
getPList(cb) {
this.posCData = null;
......@@ -873,7 +916,7 @@ export default {
},
// 组装管理员名称
buildManagerName(data,code){
buildManagerName(data, code) {
for (let idx in data) {
if (data[idx].administratorsId == code) {
return data[idx].administratorsName;
......@@ -881,6 +924,25 @@ export default {
}
},
buildStorePic() {
let arr = [];
if (this.dImg1) {
arr.push(this.dImg1);
}
if (this.dImg2) {
arr.push(this.dImg2);
}
if (this.dImg3) {
arr.push(this.dImg3);
}
if (this.dImg4) {
arr.push(this.dImg4);
}
if (this.dImg5) {
arr.push(this.dImg5);
}
return arr.join(",");
},
handleSelectionChange(val) {
const filterId = val => {
......@@ -895,31 +957,30 @@ export default {
}
};
this.tableItemIDS = filterId(val).join(",");
console.log(this.tableItemIDS)
console.log(this.tableItemIDS);
},
// 全部审核
allSFun(){
allSFun() {
const param = {
storeIds:this.tableItemIDS
}
storeIds: this.tableItemIDS
};
store.batchStores(param).then(res=>{
this.getList()
})
store.batchStores(param).then(res => {
this.getList();
});
},
allShowFun(){
allShowFun() {
const param = {
storeIds:this.tableItemIDS
}
debugger
store.batchStoreShop(param).then(res=>{
this.getList()
})
storeIds: this.tableItemIDS
};
debugger;
store.batchStoreShop(param).then(res => {
this.getList();
});
}
},
computed: {
// 激活重置按钮
......
<template>
<div class="model-container">
<el-card shadow="never">
<div slot="header" class="clearfix">
<span><i class="iconfont icon-sousuo"></i>快捷搜索</span>
<div class="btns-wrapper-right">
<el-button type="primary" plain @click="seachFun">确定</el-button>
<el-button type="warning" plain @click="resetFun" :disabled="isActiveReset">重置</el-button>
<div class="model-container">
<el-card shadow="never">
<div slot="header" class="clearfix">
<span>
<i class="iconfont icon-sousuo"></i>快捷搜索</span>
<div class="btns-wrapper-right">
<el-button type="primary" plain @click="seachFun">确定</el-button>
<el-button type="warning" plain @click="resetFun" :disabled="isActiveReset">重置</el-button>
</div>
</div>
<el-row :gutter="15">
<el-col :span="4">
<el-col class="input-name" :span="7">员工姓名</el-col>
<el-col :span="17">
<el-input placeholder="请输入关键字" v-model="seacherParam.workerName" @keyup.enter.native="seachFun"></el-input>
</el-col>
</el-col>
<el-col :span="4">
<el-col class="input-name" :span="7">所属店铺</el-col>
<el-col :span="17" style="line-height:40px">
<el-select v-model="seacherParam.storeId" placeholder="请选择">
<el-option v-for="item in ownStoreData" :key="item.storeId" :label="item.storeName" :value="item.storeId">
</el-option>
</el-select>
</el-col>
</el-col>
<el-col :span="4">
<el-col class="input-name" :span="7">是否审核</el-col>
<el-col :span="17" style="line-height:40px">
<el-select v-model="seacherParam.isAuditing" placeholder="请选择">
<el-option v-for="item in isAuditingData" :key="item.code" :label="item.name" :value="item.code">
</el-option>
</el-select>
</el-col>
</el-col>
<el-col :span="4">
<el-col class="input-name" :span="7">是否展示</el-col>
<el-col :span="17" style="line-height:40px">
<el-select v-model="seacherParam.isShopping" placeholder="请选择">
<el-option v-for="item in isShoppingData" :key="item.code" :label="item.name" :value="item.code">
</el-option>
</el-select>
</el-col>
</el-col>
</el-row>
</el-card>
<el-card>
<div slot="header" class="clearfix">
<!-- <span><i class="iconfont icon-sousuo"></i>表格数据</span> -->
<div class="btns-wrapper-left">
<el-button type="primary" plain @click="add">新增</el-button>
<el-button v-if="isAdmin==1" type="success" plain @click="allShowFun" :disabled="!tableItemIDS.length">批量显示</el-button>
<el-button v-if="isAdmin==1" type="danger" plain @click="allSFun" :disabled="!tableItemIDS.length">批量审核</el-button>
</div>
</div>
<div class="table-wrapper">
<el-table empty-text="暂无数据" :stripe="true" :data="dataOption" v-loading="!dataOption" @selection-change="handleSelectionChange">
<el-table-column v-if="isAdmin==1" type="selection" width="55"></el-table-column>
<el-table-column prop="serialNumber" label="推荐序号" sortable></el-table-column>
<el-table-column prop="workerNumber" label="工号"></el-table-column>
<el-table-column prop="workerName" label="姓名"></el-table-column>
<el-table-column label="性别">
<template slot-scope="scope">
<span>{{scope.row.workerSex===1?'男':'女'}}</span>
</template>
</el-table-column>
<el-table-column prop="workerAge" label="年龄"></el-table-column>
<el-table-column prop="workerBirthday" label="生日"></el-table-column>
<el-table-column prop="workerAncestral" label="祖籍"></el-table-column>
<el-table-column prop="workerHeight" label="身高"></el-table-column>
<el-table-column prop="workerWeight" label="体重"></el-table-column>
<el-table-column prop="workerBust" label="胸围"></el-table-column>
<el-table-column prop="workerWaist" label="腰围"></el-table-column>
<el-table-column prop="workerHipline" label="臀围"></el-table-column>
<!-- <el-table-column prop="workerResume" label="个人简介"></el-table-column> -->
<el-table-column label="到期时间">
<template slot-scope="scope">
<span>{{fattTime(scope.row.matureTime)}}</span>
</template>
</el-table-column>
<el-table-column label="是否展示">
<template slot-scope="scope">
<span>
<el-switch v-model="scope.row.isShopping" :active-value="1" :inactive-value="0" @change="handleIsVailable(scope.row)">
</el-switch>
</span>
</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button type="primary" circle class="table-icon" @click="check(scope.row)">
<i class="iconfont icon-chakan"></i>
</el-button>
<el-button type="primary" icon="el-icon-edit" circle class="table-icon" @click="edit(scope.row)"></el-button>
<!-- 推荐 -->
<el-button v-if="scope.row.isAuditing==1 && scope.row.isShopping==1" type="success" circle class="table-icon" @click="handleRecommendFun(scope.row)">
<i class="iconfont icon-tijiao"></i>
</el-button>
<!-- 删除 -->
<el-popover placement="top" width="160" v-model="scope.row.delState">
<p style="margin-bottom:10px;font-weight:700;">确认删除吗?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="scope.row.delState = false">取消</el-button>
<el-button type="primary" size="mini" @click="del(scope.row)">确定</el-button>
</div>
</div>
<el-row :gutter="15">
<el-col :span="4">
<el-col class="input-name" :span="7">员工姓名</el-col>
<el-col :span="17"><el-input placeholder="请输入关键字" v-model="seacherParam.workerName" @keyup.enter.native="seachFun"></el-input></el-col>
</el-col>
<el-col :span="4">
<el-col class="input-name":span="7">所属店铺</el-col>
<el-col :span="17" style="line-height:40px">
<el-select v-model="seacherParam.storeId" placeholder="请选择">
<el-option
v-for="item in ownStoreData"
:key="item.storeId"
:label="item.storeName"
:value="item.storeId">
</el-option>
</el-select>
</el-col>
</el-col>
<el-col :span="4">
<el-col class="input-name":span="7">是否审核</el-col>
<el-col :span="17" style="line-height:40px">
<el-select v-model="seacherParam.isAuditing" placeholder="请选择">
<el-option
v-for="item in isAuditingData"
:key="item.code"
:label="item.name"
:value="item.code">
</el-option>
</el-select>
</el-col>
</el-col>
<el-col :span="4">
<el-col class="input-name":span="7">是否展示</el-col>
<el-col :span="17" style="line-height:40px">
<el-select v-model="seacherParam.isShopping" placeholder="请选择">
<el-option
v-for="item in isShoppingData"
:key="item.code"
:label="item.name"
:value="item.code">
</el-option>
</el-select>
</el-col>
</el-col>
</el-row>
</el-card>
<el-card>
<div slot="header" class="clearfix">
<!-- <span><i class="iconfont icon-sousuo"></i>表格数据</span> -->
<div class="btns-wrapper-left">
<el-button type="primary" plain @click="add">新增</el-button>
<el-button type="success" plain @click="allShowFun" :disabled="!tableItemIDS.length">批量显示</el-button>
<el-button type="danger" plain @click="allSFun" :disabled="!tableItemIDS.length">批量审核</el-button>
<el-button slot="reference" type="danger" circle icon="el-icon-delete" class="table-icon popver-btn"></el-button>
</el-popover>
<!-- 审核 -->
<el-popover v-if="scope.row.isAuditing!=1&&isAdmin==1" placement="top" width="160" v-model="scope.row.delState1">
<p style="margin-bottom:10px;font-weight:700;">确认通过审核吗?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="scope.row.delState1 = false">取消</el-button>
<el-button type="primary" size="mini" @click="handleAuditFun(scope.row)">通过</el-button>
</div>
</div>
<div class="table-wrapper">
<el-table empty-text="暂无数据" :stripe="true" :data="dataOption" v-loading="!dataOption" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="serialNumber" label="推荐序号" sortable></el-table-column>
<el-table-column prop="workerNumber" label="工号"></el-table-column>
<el-table-column prop="workerName" label="姓名"></el-table-column>
<el-table-column label="性别">
<template slot-scope="scope">
<span>{{scope.row.workerSex===1?'男':'女'}}</span>
</template>
</el-table-column>
<el-table-column prop="workerAge" label="年龄"></el-table-column>
<el-table-column prop="workerBirthday" label="生日"></el-table-column>
<el-table-column prop="workerAncestral" label="祖籍"></el-table-column>
<el-table-column prop="workerHeight" label="身高"></el-table-column>
<el-table-column prop="workerWeight" label="体重"></el-table-column>
<el-table-column prop="workerBust" label="胸围"></el-table-column>
<el-table-column prop="workerWaist" label="腰围"></el-table-column>
<el-table-column prop="workerHipline" label="臀围"></el-table-column>
<!-- <el-table-column prop="workerResume" label="个人简介"></el-table-column> -->
<el-table-column label="到期时间">
<template slot-scope="scope">
<span>{{fattTime(scope.row.matureTime)}}</span>
</template>
</el-table-column>
<el-table-column label="是否展示">
<template slot-scope="scope">
<span>
<el-switch
v-model="scope.row.isShopping"
:active-value="1"
:inactive-value="0"
@change="handleIsVailable(scope.row)">
</el-switch>
</span>
</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button type="primary" circle class="table-icon" @click="check(scope.row)"><i class="iconfont icon-chakan"></i></el-button>
<el-button type="primary" icon="el-icon-edit" circle class="table-icon" @click="edit(scope.row)"></el-button>
<!-- 推荐 -->
<el-button v-if="scope.row.isAuditing==1 && scope.row.isShopping==1" type="success" circle class="table-icon" @click="handleRecommendFun(scope.row)"><i class="iconfont icon-tijiao"></i></el-button>
<!-- 删除 -->
<el-popover
placement="top"
width="160"
v-model="scope.row.delState">
<p style="margin-bottom:10px;font-weight:700;">确认删除吗?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="scope.row.delState = false">取消</el-button>
<el-button type="primary" size="mini" @click="del(scope.row)">确定</el-button>
</div>
<el-button slot="reference" type="danger" circle icon="el-icon-delete" class="table-icon popver-btn"></el-button>
</el-popover>
<!-- 审核 -->
<el-popover
v-if="scope.row.isAuditing!=1&&isAdmin==1"
placement="top"
width="160"
v-model="scope.row.delState1">
<p style="margin-bottom:10px;font-weight:700;">确认通过审核吗?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="scope.row.delState1 = false">取消</el-button>
<el-button type="primary" size="mini" @click="handleAuditFun(scope.row)">通过</el-button>
</div>
<el-button slot="reference" type="warning" circle icon="el-icon-setting" class="table-icon popver-btn"></el-button>
</el-popover>
</template>
</el-table-column>
</el-table>
<!-- 分页处理 -->
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pageNo"
:page-sizes="[10, 20, 30]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="rowCount">
</el-pagination>
</div>
</el-card>
<!-- 添加dialog -->
<!-- 查看,编辑dialog -->
<!-- 查看,编辑dialog -->
<el-dialog
:title="dialogTitle"
:visible.sync="dialogState"
width="100%"
:fullscreen="true"
:before-close="handleClose">
<div class="dialog-body-content">
<el-row :gutter="12">
<el-col :span="8">
<h1 class="food-title">员工信息</h1>
<el-row :gutter="15">
<el-col :span="6" class="content-left"><label>姓名</label></el-col>
<el-col :span="18" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入员工姓名" v-model="dialogBindData.workerName"></el-input>
<span v-else>{{dialogBindData.workerName}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="6" class="content-left"><label>简介</label></el-col>
<el-col :span="18" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" type="textarea" :rows="2" placeholder="请输入员工简介" v-model="dialogBindData.brief"></el-input>
<span v-else>{{dialogBindData.brief}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="6" class="content-left"><label>性别</label></el-col>
<el-col :span="18" class="content-right">
<template v-if="dialogType===1 || dialogType===2">
<el-radio v-model="dialogBindData.workerSex" :label="1"></el-radio>
<el-radio v-model="dialogBindData.workerSex" :label="0"></el-radio>
</template>
<span v-else>{{dialogBindData.workerSex==1?'男':'女'}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="6" class="content-left"><label>年龄</label></el-col>
<el-col :span="18" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入员工年龄" v-model="dialogBindData.workerAge"></el-input>
<span v-else>{{dialogBindData.workerAge}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="6" class="content-left"><label>生日</label></el-col>
<el-col :span="18" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入员工生日" v-model="dialogBindData.workerBirthday"></el-input>
<span v-else>{{dialogBindData.workerBirthday}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="6" class="content-left"><label>祖籍</label></el-col>
<el-col :span="18" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入员工祖籍" v-model="dialogBindData.workerAncestral"></el-input>
<span v-else>{{dialogBindData.workerAncestral}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="6" class="content-left"><label>身高</label></el-col>
<el-col :span="18" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入员工身高" v-model="dialogBindData.workerHeight"></el-input>
<span v-else>{{dialogBindData.workerHeight}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="6" class="content-left"><label>体重</label></el-col>
<el-col :span="18" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入员工体重" v-model="dialogBindData.workerWeight"></el-input>
<span v-else>{{dialogBindData.workerWeight}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="6" class="content-left"><label>胸围</label></el-col>
<el-col :span="18" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入员工胸围" v-model="dialogBindData.workerBust"></el-input>
<span v-else>{{dialogBindData.workerBust}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="6" class="content-left"><label>腰围</label></el-col>
<el-col :span="18" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入员工腰围" v-model="dialogBindData.workerWaist"></el-input>
<span v-else>{{dialogBindData.workerWaist}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="6" class="content-left"><label>臀围</label></el-col>
<el-col :span="18" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入员工臀围" v-model="dialogBindData.workerHipline"></el-input>
<span v-else>{{dialogBindData.workerHipline}}</span>
</el-col>
</el-row>
</el-col>
<el-col :span="6">
<h1 class="food-title">其他信息</h1>
<el-row :gutter="15">
<el-col :span="4" class="content-left"><label>员工主图</label></el-col>
<el-col :span="20" class="content-right">
<up-load-img
ref="imgComponent"
v-if="dialogType===1 || dialogType===2"
width="270"
height="160"
resPath="workerHomePic"
:type="dialogType"
:viewUrl="this.dialogBindData.workerHomePic"
@emitSuccess="handleImgLoad">
</up-load-img>
<img v-else :src="dialogBindData.workerHomePic" width="270" height="160">
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="4" class="content-left"><label>编号</label></el-col>
<el-col :span="20" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入员工编号" v-model="dialogBindData.workerNumber"></el-input>
<span v-else>{{dialogBindData.workerNumber}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="4" class="content-left"><label>所属店铺</label></el-col>
<el-col :span="20" class="content-right">
<el-select v-if="dialogType===1 || dialogType===2" v-model="dialogBindData.storeId" placeholder="请选择">
<el-option
v-for="item in storeData"
:key="item.storeId"
:label="item.storeName"
:value="item.storeId">
</el-option>
</el-select>
<span v-else>{{dialogBindData.storeName}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="4" class="content-left"><label>到期时间</label></el-col>
<el-col :span="20" class="content-right">
<el-date-picker
v-if="dialogType===1 || dialogType===2"
v-model="dialogBindData.matureTime"
type="datetime"
placeholder="选择到期时间">
</el-date-picker>
<span v-else>{{dialogBindData.matureTime}}</span>
</el-col>
</el-row>
</el-col>
<el-col :span="10">
<h1 class="food-title">员工详情</h1>
<tinymce v-if="dialogType===1 || dialogType===2" :height="400" v-model="dialogBindData.workerResume" :hasImageLoad="1" resPath="workerResume"></tinymce>
<template v-else>
<view-page :data="dialogBindData"></view-page>
</template>
</el-col>
</el-row>
<el-button slot="reference" type="warning" circle icon="el-icon-setting" class="table-icon popver-btn"></el-button>
</el-popover>
</template>
</el-table-column>
</el-table>
</div>
<div class="btns-wrapper">
<el-button size="small" @click="handleClose" :disabled="dialogType===3"><i class="iconfont icon-quxiao"></i>取消</el-button>
<el-button v-if="!submmitSuccess" type="primary" size="small" @click="submmitFun" :disabled="dialogType===3"><i class="iconfont icon-tijiao"></i>提交</el-button>
<el-button v-else :loading="true" type="primary" size="small" :disabled="true">提交</el-button>
</div>
</el-dialog>
</div>
<!-- 分页处理 -->
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageNo" :page-sizes="[10, 20, 30]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="rowCount">
</el-pagination>
</div>
</el-card>
<!-- 添加dialog -->
<!-- 查看,编辑dialog -->
<!-- 查看,编辑dialog -->
<el-dialog :title="dialogTitle" :visible.sync="dialogState" width="100%" :fullscreen="true" :before-close="handleClose">
<div class="dialog-body-content">
<el-row :gutter="12">
<el-col :span="8">
<h1 class="food-title">员工信息</h1>
<el-row :gutter="15">
<el-col :span="6" class="content-left">
<label>姓名</label>
</el-col>
<el-col :span="18" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入员工姓名" v-model="dialogBindData.workerName"></el-input>
<span v-else>{{dialogBindData.workerName}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="6" class="content-left">
<label>简介</label>
</el-col>
<el-col :span="18" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" type="textarea" :rows="2" placeholder="请输入员工简介" v-model="dialogBindData.brief"></el-input>
<span v-else>{{dialogBindData.brief}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="6" class="content-left">
<label>性别</label>
</el-col>
<el-col :span="18" class="content-right">
<template v-if="dialogType===1 || dialogType===2">
<el-radio v-model="dialogBindData.workerSex" :label="1"></el-radio>
<el-radio v-model="dialogBindData.workerSex" :label="0"></el-radio>
</template>
<span v-else>{{dialogBindData.workerSex==1?'男':'女'}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="6" class="content-left">
<label>年龄</label>
</el-col>
<el-col :span="18" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入员工年龄" v-model="dialogBindData.workerAge"></el-input>
<span v-else>{{dialogBindData.workerAge}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="6" class="content-left">
<label>生日</label>
</el-col>
<el-col :span="18" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入员工生日" v-model="dialogBindData.workerBirthday"></el-input>
<span v-else>{{dialogBindData.workerBirthday}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="6" class="content-left">
<label>祖籍</label>
</el-col>
<el-col :span="18" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入员工祖籍" v-model="dialogBindData.workerAncestral"></el-input>
<span v-else>{{dialogBindData.workerAncestral}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="6" class="content-left">
<label>身高</label>
</el-col>
<el-col :span="18" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入员工身高" v-model="dialogBindData.workerHeight"></el-input>
<span v-else>{{dialogBindData.workerHeight}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="6" class="content-left">
<label>体重</label>
</el-col>
<el-col :span="18" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入员工体重" v-model="dialogBindData.workerWeight"></el-input>
<span v-else>{{dialogBindData.workerWeight}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="6" class="content-left">
<label>胸围</label>
</el-col>
<el-col :span="18" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入员工胸围" v-model="dialogBindData.workerBust"></el-input>
<span v-else>{{dialogBindData.workerBust}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="6" class="content-left">
<label>腰围</label>
</el-col>
<el-col :span="18" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入员工腰围" v-model="dialogBindData.workerWaist"></el-input>
<span v-else>{{dialogBindData.workerWaist}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="6" class="content-left">
<label>臀围</label>
</el-col>
<el-col :span="18" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入员工臀围" v-model="dialogBindData.workerHipline"></el-input>
<span v-else>{{dialogBindData.workerHipline}}</span>
</el-col>
</el-row>
</el-col>
<el-col :span="6">
<h1 class="food-title">其他信息</h1>
<el-row :gutter="15">
<el-col :span="4" class="content-left">
<label>员工主图</label>
</el-col>
<el-col :span="20" class="content-right">
<up-load-img ref="imgComponent" v-if="dialogType===1 || dialogType===2" width="270" height="160" resPath="workerHomePic" :type="dialogType" :viewUrl="this.dialogBindData.workerHomePic" @emitSuccess="handleImgLoad">
</up-load-img>
<img v-else :src="dialogBindData.workerHomePic" width="270" height="160">
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="4" class="content-left">
<label>员工详图</label>
</el-col>
<el-col :span="20">
<up-load-img ref="imgComponent1" v-if="dialogType===1 || dialogType===2" width="134" height="80" resPath="workerDPic" :type="dialogType" :viewUrl="dImg1" @emitSuccess="handleImgLoad1">
</up-load-img>
<img v-else :src="dImg1" width="134" height="80">
<up-load-img ref="imgComponent2" v-if="dialogType===1 || dialogType===2" width="134" height="80" resPath="workerDPic" :type="dialogType" :viewUrl="dImg2" @emitSuccess="handleImgLoad2">
</up-load-img>
<img v-else :src="dImg2" width="134" height="80">
<up-load-img ref="imgComponent3" v-if="dialogType===1 || dialogType===2" width="134" height="80" resPath="workerDPic" :type="dialogType" :viewUrl="dImg3" @emitSuccess="handleImgLoad3">
</up-load-img>
<img v-else :src="dImg3" width="134" height="80">
<up-load-img ref="imgComponent4" v-if="dialogType===1 || dialogType===2" width="134" height="80" resPath="workerDPic" :type="dialogType" :viewUrl="dImg4" @emitSuccess="handleImgLoad4">
</up-load-img>
<img v-else :src="dImg4" width="134" height="80">
<up-load-img ref="imgComponent5" v-if="dialogType===1 || dialogType===2" width="134" height="80" resPath="workerDPic" :type="dialogType" :viewUrl="dImg5" @emitSuccess="handleImgLoad5">
</up-load-img>
<img v-else :src="dImg5" width="134" height="80">
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="4" class="content-left">
<label>编号</label>
</el-col>
<el-col :span="20" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入员工编号" v-model="dialogBindData.workerNumber"></el-input>
<span v-else>{{dialogBindData.workerNumber}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="4" class="content-left">
<label>所属店铺</label>
</el-col>
<el-col :span="20" class="content-right">
<el-select v-if="dialogType===1 || dialogType===2" v-model="dialogBindData.storeId" placeholder="请选择">
<el-option v-for="item in storeData" :key="item.storeId" :label="item.storeName" :value="item.storeId">
</el-option>
</el-select>
<span v-else>{{dialogBindData.storeName}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="4" class="content-left">
<label>到期时间</label>
</el-col>
<el-col :span="20" class="content-right">
<el-date-picker v-if="dialogType===1 || dialogType===2" v-model="dialogBindData.matureTime" type="datetime" placeholder="选择到期时间">
</el-date-picker>
<span v-else>{{dialogBindData.matureTime}}</span>
</el-col>
</el-row>
</el-col>
<el-col :span="10">
<h1 class="food-title">员工详情</h1>
<tinymce v-if="dialogType===1 || dialogType===2" :height="400" v-model="dialogBindData.workerResume" :hasImageLoad="1" resPath="workerResume"></tinymce>
<template v-else>
<view-page :data="dialogBindData"></view-page>
</template>
</el-col>
</el-row>
</div>
<div class="btns-wrapper">
<el-button size="small" @click="handleClose" :disabled="dialogType===3">
<i class="iconfont icon-quxiao"></i>取消</el-button>
<el-button v-if="!submmitSuccess" type="primary" size="small" @click="submmitFun" :disabled="dialogType===3">
<i class="iconfont icon-tijiao"></i>提交</el-button>
<el-button v-else :loading="true" type="primary" size="small" :disabled="true">提交</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import UpLoadImg from "@/components/UpLoadImg";
import Tinymce from "@/components/Tinymce";
import ViewPage from "./components/ViewPage";
import * as cookie from '@/utils/auth'
import * as cookie from "@/utils/auth";
import * as Utils from "../../utils/index.js";
import * as worker from "../../api/worker";
import * as common from "../../api/common";
......@@ -396,21 +381,21 @@ export default {
return {
seacherParam: {
workerName: "",
isAuditing:'',
isShopping:'',
storeId:""
isAuditing: "",
isShopping: "",
storeId: ""
},
isAuditingData:[
{code:'1',name:'已审核'},
{code:'0',name:'未审核'}
isAuditingData: [
{ code: "1", name: "已审核" },
{ code: "0", name: "未审核" }
],
isShoppingData:[
{code:1,name:'已展示'},
{code:0,name:'未展示'}
isShoppingData: [
{ code: 1, name: "已展示" },
{ code: 0, name: "未展示" }
],
ownStoreData:null,
ownStoreData: null,
// 表格数据
dataOption: null,
......@@ -426,7 +411,7 @@ export default {
workerId: "",
workerNumber: "",
workerName: "",
brief:'',
brief: "",
workerSex: 1,
workerAge: "",
workerBirthday: "",
......@@ -439,7 +424,7 @@ export default {
workerResume: "",
matureTime: "",
workerHomePic:'',
workerHomePic: "",
storeId: "",
storeName: ""
......@@ -450,28 +435,29 @@ export default {
// 店铺的下拉
storeData: null,
tableItemIDS: "",
tableItemIDS:'',
isAdmin:'0'
isAdmin: "0",
dImg1: "",
dImg2: "",
dImg3: "",
dImg4: "",
dImg5: ""
};
},
beforeMount() {
this.isAdmin = this.getCookAdminType()
worker.getStores().then(res=>{
this.ownStoreData = res.data.data
this.isAdmin = this.getCookAdminType();
worker.getStores().then(res => {
this.ownStoreData = res.data.data;
this.getList();
})
});
},
mounted() {},
methods: {
getCookAdminType(){
let adminType = cookie.getUserInfro()
return JSON.parse(adminType).isAdmin
getCookAdminType() {
let adminType = cookie.getUserInfro();
return JSON.parse(adminType).isAdmin;
},
seachFun() {
this.$seach
......@@ -540,6 +526,23 @@ export default {
for (const key in this.dialogBindData) {
this.dialogBindData[key] = data[key];
}
const dImgArr = data.workerPic ? data.workerPic.split(",") : [];
if (dImgArr[0]) {
this.dImg1 = dImgArr[0];
}
if (dImgArr[1]) {
this.dImg2 = dImgArr[1];
}
if (dImgArr[2]) {
this.dImg3 = dImgArr[2];
}
if (dImgArr[3]) {
this.dImg4 = dImgArr[3];
}
if (dImgArr[4]) {
this.dImg5 = dImgArr[4];
}
},
submmitFun() {
const param = Utils.deepClone(this.dialogBindData);
......@@ -549,21 +552,71 @@ export default {
);
param.matureTime = this.fattTime(this.dialogBindData.matureTime);
if(this.dialogType==1){
param.serialNumber = 99
if (this.dialogType == 1) {
param.serialNumber = 99;
}
this.submmitSuccess = true;
worker.addOrEditWorker(param).then(res => {
this.getList(() => {
this.$message({
message: this.dialogType === 1 ? "添加成功" : "编辑成功",
type: "success"
param.workerPic = this.buildWorkerPic();
let submitParam =
param.brief &&
param.matureTime &&
param.storeId &&
param.storeName &&
param.workerAge &&
param.workerAncestral &&
param.workerBirthday &&
param.workerBust &&
param.workerHeight &&
param.workerHipline &&
param.workerHomePic &&
param.workerName &&
param.workerNumber &&
param.workerPic.length &&
param.workerResume &&
(param.workerSex == 1 || param.workerSex == 0) &&
param.workerWaist &&
param.workerWeight;
if (!!submitParam) {
this.submmitSuccess = true;
worker.addOrEditWorker(param).then(res => {
this.getList(() => {
this.$message({
message: this.dialogType === 1 ? "添加成功" : "编辑成功",
type: "success"
});
this.submmitSuccess = false;
this.handleClose();
});
this.submmitSuccess = false;
this.handleClose();
});
});
} else {
this.$message({
message: "请完善信息",
type: "warning"
});
}
},
buildWorkerPic() {
let arr = [];
if (this.dImg1) {
arr.push(this.dImg1);
}
if (this.dImg2) {
arr.push(this.dImg2);
}
if (this.dImg3) {
arr.push(this.dImg3);
}
if (this.dImg4) {
arr.push(this.dImg4);
}
if (this.dImg5) {
arr.push(this.dImg5);
}
return arr.join(",");
},
//关闭弹框
handleClose() {
......@@ -575,6 +628,24 @@ export default {
this.dialogBindData[key] = "";
}
}
this.dImg1 = "";
this.dImg2 = "";
this.dImg3 = "";
this.dImg4 = "";
this.dImg5 = "";
this.$refs.imgComponent.clearImg();
this.$refs.imgComponent1.clearImg();
this.$refs.imgComponent2.clearImg();
this.$refs.imgComponent3.clearImg();
this.$refs.imgComponent4.clearImg();
this.$refs.imgComponent5.clearImg();
// 销毁富文本编辑器的dom对象
setTimeout(() => {
this.dialogType = 0;
}, 500);
},
// 分页处理
handleSizeChange(val) {
......@@ -690,6 +761,26 @@ export default {
this.dialogBindData.workerHomePic = url;
},
handleImgLoad1(url) {
this.dImg1 = url;
},
handleImgLoad2(url) {
this.dImg2 = url;
},
handleImgLoad3(url) {
this.dImg3 = url;
},
handleImgLoad4(url) {
this.dImg4 = url;
},
handleImgLoad5(url) {
this.dImg5 = url;
},
// 组装店铺的名称
buildStoreName(data, code) {
for (let idx in data) {
......@@ -712,28 +803,28 @@ export default {
}
};
this.tableItemIDS = filterId(val).join(",");
console.log(this.tableItemIDS)
console.log(this.tableItemIDS);
},
// 全部审核
allSFun(){
allSFun() {
const param = {
workerIds:this.tableItemIDS
}
workerIds: this.tableItemIDS
};
worker.batchWorkers(param).then(res=>{
this.getList()
})
worker.batchWorkers(param).then(res => {
this.getList();
});
},
allShowFun(){
allShowFun() {
const param = {
workerIds:this.tableItemIDS
}
worker.batchWorkerShop(param).then(res=>{
this.getList()
})
workerIds: this.tableItemIDS
};
worker.batchWorkerShop(param).then(res => {
this.getList();
});
}
},
computed: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment