Commit 7de07c63 authored by 扫地僧's avatar 扫地僧

半成品

parent 178f14ed
...@@ -13,8 +13,8 @@ module.exports = { ...@@ -13,8 +13,8 @@ module.exports = {
proxyTable: {}, proxyTable: {},
// Various Dev Server settings // Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST // host: 'localhost', // can be overwritten by process.env.HOST
// host: '192.168.1.100', // can be overwritten by process.env.HOST host: '192.168.1.112', // can be overwritten by process.env.HOST
port: 9527, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined port: 9527, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: true, autoOpenBrowser: true,
errorOverlay: true, errorOverlay: true,
......
import request from './request' import request from './request'
import qs from 'qs' import qs from 'qs'
export function getAdvertList(data) { export function advertList(data) {
return request({ return request({
url: '/advert/getAdvertList', url: '/advert/advertList',
method: 'post', method: 'post',
data:qs.stringify(data) data:qs.stringify(data)
}) })
......
...@@ -37,6 +37,15 @@ export function queryAllSysRole() { ...@@ -37,6 +37,15 @@ export function queryAllSysRole() {
}) })
} }
// 选择管理员
export function queryAllShopAdmin() {
return request({
url: '/sysRole/queryAllSysRole',
method: 'post',
})
}
// --------user---end----------- // --------user---end-----------
......
...@@ -54,18 +54,18 @@ export const asyncRouterMap = [ ...@@ -54,18 +54,18 @@ export const asyncRouterMap = [
// 商家管理 // 店铺管理
{ {
path: '/store', path: '/store',
alwaysShow:true, alwaysShow:true,
component: Layout, component: Layout,
redirect: '/store/storeList', redirect: '/store/storeList',
meta: { meta: {
title: '商家管理', title: '店铺管理',
icon: 'cheliang' icon: 'cheliang'
}, },
children: [ children: [
{ path: 'storeList', component: _import('store/storeList'), name: 'store_storeList', meta: { title: '商家列表' }} { path: 'storeList', component: _import('store/storeList'), name: 'store_storeList', meta: { title: '店铺列表' }}
] ]
}, },
...@@ -84,14 +84,14 @@ export const asyncRouterMap = [ ...@@ -84,14 +84,14 @@ export const asyncRouterMap = [
] ]
}, },
// 店铺管理 // 店铺管理
{ {
path: '/administrators', path: '/administrators',
alwaysShow:true, alwaysShow:true,
component: Layout, component: Layout,
redirect: '/administrators/administratorstList', redirect: '/administrators/administratorstList',
meta: { meta: {
title: '店铺管理', title: '店铺管理',
icon: 'cheliang' icon: 'cheliang'
}, },
children: [ children: [
......
...@@ -11,9 +11,26 @@ ...@@ -11,9 +11,26 @@
<el-row :gutter="15"> <el-row :gutter="15">
<el-col :span="4"> <el-col :span="4">
<el-col class="input-name" :span="7">管理员名称</el-col> <el-col class="input-name" :span="7">管理员名称</el-col>
<el-col :span="17"><el-input placeholder="请输入关键字" v-model="seacherParam.repairWorkerName" @keyup.enter.native="seachFun"></el-input></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>
<!-- <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="请选择">
<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-row> </el-row>
</el-card> </el-card>
<el-card> <el-card>
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
...@@ -26,19 +43,32 @@ ...@@ -26,19 +43,32 @@
<el-table empty-text="暂无数据" :stripe="true" :data="dataOption" v-loading="!dataOption"> <el-table empty-text="暂无数据" :stripe="true" :data="dataOption" v-loading="!dataOption">
<el-table-column prop="repairWorkerName" label="姓名"></el-table-column> <el-table-column prop="administratorsName" label="姓名"></el-table-column>
<el-table-column label="性别"> <!-- <el-table-column label="性别">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row.sex===1?'男':'女'}}</span> <span>{{scope.row.sex===1?'男':'女'}}</span>
</template> </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>
<el-table-column prop="repairWorkerPhone" label="电话"></el-table-column>
<el-table-column prop="repairWorkerIdCard" label="身份证号"></el-table-column>
<el-table-column label="创建时间"> <el-table-column label="创建时间">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{fattTime(scope.row.createTime)}}</span> <span>{{fattTime(scope.row.createTime)}}</span>
</template> </template>
</el-table-column> </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="操作"> <el-table-column label="操作">
<template slot-scope="scope"> <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" circle class="table-icon" @click="check(scope.row)"><i class="iconfont icon-chakan"></i></el-button>
...@@ -73,40 +103,65 @@ ...@@ -73,40 +103,65 @@
<div class="dialog-body-content"> <div class="dialog-body-content">
<el-row :gutter="15"> <el-row :gutter="15">
<el-col :span="8" class="content-left"><label>姓名</label></el-col> <el-col :span="8" class="content-left"><label>名称</label></el-col>
<el-col :span="16" class="content-right"> <el-col :span="16" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入姓名" v-model="dialogBindData.repairWorkerName"></el-input> <el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入管理员名称" v-model="dialogBindData.administratorsName"></el-input>
<span v-else>{{dialogBindData.repairWorkerName}}</span> <span v-else>{{dialogBindData.administratorsName}}</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="15"> <!-- <el-row :gutter="15" v-if="dialogType===3">
<el-col :span="8" class="content-left"><label>性别</label></el-col> <el-col :span="8" class="content-left"><label>审核状态</label></el-col>
<el-col :span="16" class="content-right"> <el-col :span="16" class="content-right">
<el-radio-group v-if="dialogType===1 || dialogType===2" v-model="dialogBindData.sex"> <el-radio-group v-if="dialogType===1 || dialogType===2" v-model="dialogBindData.isAuditing">
<el-radio size="small" :label="1"></el-radio> <el-radio size="small" :label="1">已审核</el-radio>
<el-radio size="small" :label="0"></el-radio> <el-radio size="small" :label="0">未审核</el-radio>
</el-radio-group> </el-radio-group>
<span v-else>{{dialogBindData.sex===1?"男":"女"}}</span> <span v-else>{{dialogBindData.isAuditing===1?"已审核":"未审核"}}</span>
</el-col> </el-col>
</el-row> </el-row> -->
<el-row :gutter="15"> <el-row :gutter="15">
<el-col :span="8" class="content-left"><label>电话</label></el-col> <el-col :span="8" class="content-left"><label>电话</label></el-col>
<el-col :span="16" class="content-right"> <el-col :span="16" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入电话号码" v-model="dialogBindData.repairWorkerPhone"></el-input> <el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入电话号码" v-model="dialogBindData.contactNumber"></el-input>
<span v-else>{{dialogBindData.repairWorkerPhone}}</span> <span v-else>{{dialogBindData.contactNumber}}</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="15"> <el-row :gutter="15">
<el-col :span="8" class="content-left"><label>身份证号</label></el-col> <el-col :span="8" class="content-left"><label>微信</label></el-col>
<el-col :span="16" class="content-right"> <el-col :span="16" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入身份证号" v-model="dialogBindData.repairWorkerIdCard"></el-input> <el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入微信号" v-model="dialogBindData.wechat"></el-input>
<span v-else>{{dialogBindData.repairWorkerIdCard}}</span> <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">
<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-col>
</el-row> </el-row>
...@@ -126,12 +181,22 @@ ...@@ -126,12 +181,22 @@
import * as admin from "../../api/administrators"; import * as admin from "../../api/administrators";
import * as common from "../../api/common"; import * as common from "../../api/common";
import { fattCreateTime } from "../../utils/fattTime"; import { fattCreateTime } from "../../utils/fattTime";
import UpLoadImg from "@/components/UpLoadImg";
export default { export default {
components: { UpLoadImg },
data() { data() {
return { return {
seacherParam: { seacherParam: {
repairWorkerName: "" administratorsName: "",
isAuditing:""
}, },
//审核状态 选择数据项
isAuditingData: [
{ code: "0", name: "未审核" },
{ code: "1", name: "已审核" }
],
// 表格数据 // 表格数据
dataOption: null, dataOption: null,
// 分页数据 // 分页数据
...@@ -144,10 +209,13 @@ export default { ...@@ -144,10 +209,13 @@ export default {
dialogBindData: { dialogBindData: {
repairWorkerId: "", administratorsName: "",
repairWorkerName: "", contactNumber: "",
sex: 1, wechat: "",
repairWorkerPhone: "", qq:"",
qrCode:"",
isAuditing:1,
createTime: "",
repairWorkerIdCard: "" repairWorkerIdCard: ""
}, },
// 是否提交 // 是否提交
...@@ -224,13 +292,9 @@ export default { ...@@ -224,13 +292,9 @@ export default {
} }
}, },
submmitFun() { submmitFun() {
// if (this.dialogType === 1) {
// alert(`添加${JSON.stringify(this.dialogBindData)}`);
// } else {
// alert(`编辑${JSON.stringify(this.dialogBindData)}`);
// }
// 发送添加请求 // 发送添加请求
const isSubmitActive = this.dialogBindData.repairWorkerName&&this.dialogBindData.repairWorkerPhone&&this.dialogBindData.repairWorkerIdCard; const isSubmitActive = this.dialogBindData.administratorsName&&this.dialogBindData.contactNumber&&this.dialogBindData.wechat&&this.dialogBindData.qq&&this.dialogBindData.qrCode;
if (isSubmitActive) { if (isSubmitActive) {
this.submmitSuccess = true; this.submmitSuccess = true;
admin.addOrEditAdministrators(this.dialogBindData).then(res => { admin.addOrEditAdministrators(this.dialogBindData).then(res => {
...@@ -305,7 +369,13 @@ export default { ...@@ -305,7 +369,13 @@ export default {
}); });
} }
}); });
} },
handleImgLoad(url) {
this.dialogBindData.qrCode = url;
},
}, },
computed: { computed: {
// 激活重置按钮 // 激活重置按钮
......
...@@ -9,11 +9,40 @@ ...@@ -9,11 +9,40 @@
</div> </div>
</div> </div>
<el-row :gutter="15"> <el-row :gutter="15">
<el-col :span="4">
<el-col class="input-name" :span="7">维修工名称</el-col> <el-col :xl="4" :lg="6" :md="6" :sm="8">
<el-col :span="17"><el-input placeholder="请输入关键字" v-model="seacherParam.repairWorkerName" @keyup.enter.native="seachFun"></el-input></el-col> <el-col class="input-name" :span="7">活动名称</el-col>
<el-col :span="17"><el-input placeholder="请输入关键字" v-model="seacherParam.advertTitle" @keyup.enter.native="seachFun"></el-input></el-col>
</el-col>
<el-col :span="4" :lg="6" :md="6" :sm="8">
<el-col class="input-name" :span="7">启用状态</el-col>
<el-col :span="17" style="line-height:40px">
<el-select v-model="seacherParam.isAvailable" placeholder="请选择">
<el-option
v-for="item in isAvailableData"
:key="item.code"
:label="item.name"
:value="item.code">
</el-option>
</el-select>
</el-col>
</el-col> </el-col>
</el-row>
<!-- <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.censorStatus" placeholder="请选择">
<el-option
v-for="item in censorStatusData"
:key="item.code"
:label="item.name"
:value="item.code">
</el-option>
</el-select>
</el-col>
</el-col> -->
</el-row>
</el-card> </el-card>
<el-card> <el-card>
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
...@@ -25,52 +54,90 @@ ...@@ -25,52 +54,90 @@
<div class="table-wrapper"> <div class="table-wrapper">
<el-table empty-text="暂无数据" :stripe="true" :data="dataOption" v-loading="!dataOption"> <el-table empty-text="暂无数据" :stripe="true" :data="dataOption" v-loading="!dataOption">
<el-table-column prop="repairWorkerName" label="姓名"></el-table-column>
<el-table-column label="性别"> <el-table-column label="活动标题">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row.sex===1?'男':'女'}}</span> <span>{{`${scope.row.advertTitle}-${scope.row.advertTitle}` || '暂无数据'}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="repairWorkerPhone" label="电话"></el-table-column> <el-table-column prop="linkUrl" label="链接地址"></el-table-column>
<el-table-column prop="repairWorkerIdCard" label="身份证号"></el-table-column> <el-table-column label="启用状态">
<el-table-column label="创建时间">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{fattTime(scope.row.createTime)}}</span> <span>{{scope.row.isAvailable==1?'已启用':'未启用'}}</span>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="memo" label="备注"></el-table-column> --> <!-- <el-table-column label="审核状态">
<!-- <el-table-column label="启用状态">
<template slot-scope="scope"> <template slot-scope="scope">
<span> <span>{{viewCensorStatus(scope.row.censorStatus)}}</span>
<el-switch
v-model="scope.row.isVailable"
:active-value="1"
:inactive-value="0"
@change="handleIsVailable(scope.row)">
</el-switch>
</span>
</template> </template>
</el-table-column> --> </el-table-column> -->
<el-table-column label="创建时间">
<template slot-scope="scope">
<span>{{scope.row.createTime?fattTime(scope.row.createTime):'暂无数据'}}</span>
</template>
</el-table-column>
<!-- <el-table-column prop="memo" label="备注"></el-table-column> -->
<el-table-column label="操作"> <el-table-column label="操作">
<template slot-scope="scope"> <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" 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.isAvailable===0" type="primary" icon="el-icon-edit" circle class="table-icon" @click="edit(scope.row)"></el-button>
<!-- <el-popover <!-- <el-popover
v-if="scope.row.censorStatus!=1"
placement="top" placement="top"
width="160" trigger="hover"
v-model="scope.row.delState"> width="240"
<p style="margin-bottom:10px;font-weight:700;">确认删除吗?</p> v-model="scope.row.delState1">
<p style="margin-bottom:10px;font-weight:700;">审核</p>
<div style="padding:10px 0;">
<template>
<el-radio v-model="censorStatus" :label="1">已审核</el-radio>
<el-radio v-model="censorStatus" :label="2">未通过</el-radio>
</template>
</div>
<div style="text-align: right; margin: 0"> <div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="scope.row.delState = false">取消</el-button> <el-button size="mini" type="text" @click="scope.row.delState1 = false">取消</el-button>
<el-button type="primary" size="mini" @click="del(scope.row)">确定</el-button> <el-button type="primary" size="mini" @click="handleCensor(scope.row)">确定</el-button>
</div> </div>
<el-button slot="reference" type="warning" circle icon="el-icon-delete" class="table-icon popver-btn"></el-button> <el-button slot="reference" type="warning" circle icon="el-icon-setting" class="table-icon popver-btn"></el-button>
</el-popover> --> </el-popover> -->
<el-popover
v-if="scope.row.censorStatus==1&&scope.row.isAvailable==0"
placement="top"
width="160"
trigger="hover"
v-model="scope.row.delState2">
<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.delState2 = false">取消</el-button>
<el-button type="primary" size="mini" @click="handleUserState(scope.row)">确定</el-button>
</div>
<el-button slot="reference" type="success" icon="el-icon-circle-check-outline
" circle class="table-icon popver-btn"></el-button>
</el-popover>
<el-popover
v-if="scope.row.censorStatus==1&&scope.row.isAvailable==1"
placement="top"
width="160"
trigger="hover"
v-model="scope.row.delState2">
<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.delState2 = false">取消</el-button>
<el-button type="primary" size="mini" @click="handleUserState(scope.row)">确定</el-button>
</div>
<el-button slot="reference" type="warning" icon="el-icon-circle-close-outline" circle class="table-icon popver-btn"></el-button>
</el-popover>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -97,57 +164,125 @@ ...@@ -97,57 +164,125 @@
<el-dialog <el-dialog
:title="dialogTitle" :title="dialogTitle"
:visible.sync="dialogState" :visible.sync="dialogState"
width="30%" :width="dialogType==3?'100%':'80%'"
:fullscreen="dialogType==3"
:before-close="handleClose"> :before-close="handleClose">
<div class="dialog-body-content"> <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.repairWorkerName"></el-input>
<span v-else>{{dialogBindData.repairWorkerName}}</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-radio-group v-if="dialogType===1 || dialogType===2" v-model="dialogBindData.sex">
<el-radio size="small" :label="1"></el-radio>
<el-radio size="small" :label="0"></el-radio>
</el-radio-group>
<span v-else>{{dialogBindData.sex===1?"男":"女"}}</span>
</el-col>
</el-row>
<el-row :gutter="15"> <el-row :gutter="12">
<el-col :span="8" class="content-left"><label>电话</label></el-col>
<el-col :span="16" class="content-right"> <el-col :span="dialogType==3?12:8">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入电话号码" v-model="dialogBindData.repairWorkerPhone"></el-input> <h1 class="food-title">活动信息</h1>
<span v-else>{{dialogBindData.repairWorkerPhone}}</span>
<!-- <el-row :gutter="15">
<el-col :span="6" class="content-left"><label>类型</label></el-col>
<el-col :span="18" class="content-right" style="width:330px">
<el-radio-group v-if="dialogType===1 || dialogType===2" v-model="dialogBindData.advertType">
<el-radio size="small" :label="1">活动广告</el-radio>
<el-radio size="small" :label="2">系统公告</el-radio>
<el-radio size="small" :label="3">新闻资讯</el-radio>
</el-radio-group>
<span v-else>{{viewAdverType(dialogBindData.advertType)}}</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="请输入活动名称" resize="none" v-model="dialogBindData.advertName"></el-input>
<span v-else>{{dialogBindData.advertName}}</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="3" placeholder="请输入活动标题" resize="none" v-model="dialogBindData.advertTitle"></el-input>
<span v-else>{{dialogBindData.advertTitle}}</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="3" placeholder="请输入活动副标题" resize="none" v-model="dialogBindData.advertSubtitle"></el-input>
<span v-else>{{dialogBindData.advertSubtitle}}</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.linkUrl"></el-input>
<span v-else>{{dialogBindData.linkUrl}}</span>
</el-col>
</el-row> -->
<!-- <el-row :gutter="15" v-if="dialogBindData.advertType!==2">
<el-col :span="6" class="content-left"><label>图片</label></el-col>
<el-col :span="18" class="content-right">
<tailor
width="246"
height="144"
imageType='banner'
resPath="advertImg"
:type="dialogType"
@emitSuccess="handleImgLoad"
:viewUrl="this.dialogBindData.advertPicUrl"
v-if="dialogType===1 || dialogType===2">
</tailor>
<img v-else :src="this.dialogBindData.advertPicUrl" width="216" height="144">
</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">
<up-load-img
ref="imgComponent"
v-if="dialogType===1 || dialogType===2"
width="246"
height="144"
resPath="advertImg"
:type="dialogType"
:viewUrl="this.dialogBindData.advertPicUrl"
@emitSuccess="handleImgLoad">
</up-load-img>
<img @click="magnify(dialogBindData.advertPicUrl)" v-else :src="dialogBindData.advertPicUrl" width="246" height="144">
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="15"> <!-- <el-row :gutter="15">
<el-col :span="8" class="content-left"><label>身份证号</label></el-col> <el-col :span="6" class="content-left"><label>二级链接</label></el-col>
<el-col :span="16" class="content-right"> <el-col :span="18" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入身份证号" v-model="dialogBindData.repairWorkerIdCard"></el-input> <el-input v-if="dialogType===1 || dialogType===2" size="small" type="text" placeholder="请输入二级链接" resize="none" v-model="dialogBindData.linkUrl"></el-input>
<span v-else>{{dialogBindData.repairWorkerIdCard}}</span> <span v-else>{{dialogBindData.linkUrl}}</span>
</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-col> </el-col>
</el-row>
<!-- <el-row :gutter="15"> <el-col :span="dialogType==3?12:16">
<el-col :span="8" class="content-left"><label>备注</label></el-col> <h1 class="food-title">活动详情</h1>
<el-col :span="16" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" type="textarea" rows="3" placeholder="请输入备注" resize="none" v-model="dialogBindData.memo"></el-input> <tinymce v-if="dialogType===1 || dialogType===2" :height="400" v-model="dialogBindData.advertContent" :hasImageLoad="1" resPath="adverImg"></tinymce>
<span v-else>{{dialogBindData.memo || "暂无备注"}}</span>
<template v-else>
信息展示
<view-page :data="dialogBindData"></view-page>
</template>
</el-col> </el-col>
</el-row> -->
</el-row>
</div> </div>
<div class="btns-wrapper"> <div class="btns-wrapper">
...@@ -160,15 +295,40 @@ ...@@ -160,15 +295,40 @@
</template> </template>
<script> <script>
import * as repair from "../../api/repair"; import UpLoadImg from "@/components/UpLoadImg";
import Tinymce from "@/components/Tinymce";
import ViewPage from "./components/ViewPage";
import cropper from "./components/cropper";
// import tailor from "./components/tailor";
import * as adver from "../../api/adver";
import * as common from "../../api/common"; import * as common from "../../api/common";
import { fattCreateTime } from "../../utils/fattTime"; import { fattCreateTime } from "../../utils/fattTime";
export default { export default {
components: { Tinymce, UpLoadImg, ViewPage, cropper },
data() { data() {
return { return {
seacherParam: { seacherParam: {
repairWorkerName: "" advertType: 1,
menuType: "1",
advertTitle: "",
advertName: "",
isAvailable: null,
censorStatus: null
}, },
isAvailableData: [
{ code: 1, name: "已启用" },
{ code: 0, name: "未启用" }
],
censorStatusData: [
{ code: 0, name: "待审核" },
{ code: 1, name: "已审核" },
{ code: 2, name: "未通过" }
],
advertTypeData: [
{ code: 1, name: "活动广告" },
{ code: 2, name: "系统公告" },
{ code: 3, name: "新闻资讯" }
],
// 表格数据 // 表格数据
dataOption: null, dataOption: null,
// 分页数据 // 分页数据
...@@ -195,14 +355,19 @@ export default { ...@@ -195,14 +355,19 @@ export default {
// visitReasonId:"1001" // visitReasonId:"1001"
dialogBindData: { dialogBindData: {
repairWorkerId: "", advertId: "",
repairWorkerName: "", advertType: 1,
sex: 1, advertName: "",
repairWorkerPhone: "", advertTitle: "",
repairWorkerIdCard: "" advertSubtitle: "",
advertContent: "",
advertPicUrl: "",
linkUrl: ""
// linkUrl:""
}, },
// 是否提交 // 是否提交
submmitSuccess: false submmitSuccess: false,
censorStatus: 1
}; };
}, },
...@@ -213,7 +378,7 @@ export default { ...@@ -213,7 +378,7 @@ export default {
methods: { methods: {
seachFun() { seachFun() {
this.$seach this.$seach
.submmit(this, repair.getRepairWorkerList) .submmit(this, adver.advertList)
.then(res => { .then(res => {
this.dataOption = res.data.data; this.dataOption = res.data.data;
// 初始化分页数据 // 初始化分页数据
...@@ -281,10 +446,34 @@ export default { ...@@ -281,10 +446,34 @@ export default {
// alert(`编辑${JSON.stringify(this.dialogBindData)}`); // alert(`编辑${JSON.stringify(this.dialogBindData)}`);
// } // }
// 发送添加请求 // 发送添加请求
const isSubmitActive = this.dialogBindData.repairWorkerName&&this.dialogBindData.repairWorkerPhone&&this.dialogBindData.repairWorkerIdCard; const param = {
advertId: this.dialogBindData.advertId,
advertType: 1,
// advertName: this.dialogBindData.advertName,
advertTitle: this.dialogBindData.advertTitle,
// advertSubtitle: this.dialogBindData.advertSubtitle,
advertContent: this.dialogBindData.advertContent,
advertPicUrl:
this.dialogBindData.advertType == 2
? null
: this.dialogBindData.advertPicUrl,
censorStatus: 1,
isAvailable: 1,
linkUrl: this.dialogBindData.linkUrl
};
const isSubmitActive =
param.advertType &&
// param.advertName &&
param.advertTitle &&
// param.advertSubtitle &&
(param.advertPicUrl === null
? true
: this.dialogBindData.advertPicUrl) &&
param.advertContent;
if (isSubmitActive) { if (isSubmitActive) {
this.submmitSuccess = true; this.submmitSuccess = true;
repair.addOrEditRepairWorker(this.dialogBindData).then(res => { adver.addOrEditAdvert(param).then(res => {
this.getList(() => { this.getList(() => {
this.$message({ this.$message({
message: this.dialogType === 1 ? "添加成功" : "编辑成功", message: this.dialogType === 1 ? "添加成功" : "编辑成功",
...@@ -305,12 +494,17 @@ export default { ...@@ -305,12 +494,17 @@ export default {
handleClose() { handleClose() {
this.dialogState = false; this.dialogState = false;
for (const key in this.dialogBindData) { for (const key in this.dialogBindData) {
if (key === "sex") { if (key === "advertType") {
this.dialogBindData[key] = 1; this.dialogBindData[key] = 1;
} else { } else {
this.dialogBindData[key] = ""; this.dialogBindData[key] = "";
} }
} }
this.$refs.imgComponent ? this.$refs.imgComponent.clearImg() : "";
// 销毁富文本编辑器的dom对象
setTimeout(() => {
this.dialogType = 0;
}, 500);
}, },
// 分页处理 // 分页处理
handleSizeChange(val) { handleSizeChange(val) {
...@@ -325,16 +519,26 @@ export default { ...@@ -325,16 +519,26 @@ export default {
}, },
// 获取表格数据 // 获取表格数据
getList(cb) { getList(cb) {
repair let param = {
.getRepairWorkerList({ pageNo: this.pageNo, pageSize: this.pageSize }) pageNo: this.pageNo,
.then(res => { pageSize: this.pageSize,
// 初始话表格数据 advertType: 1,
this.dataOption = res.data.data; menuType: "1"
// 初始化分页数据 };
this.rowCount = res.data.rowCount; // 组装搜索参数
this.pageSize = res.data.pageSize; for (const key in this.seacherParam) {
cb ? cb() : ""; if (this.seacherParam[key] === 0 || this.seacherParam[key]) {
}); param[key] = this.seacherParam[key];
}
}
adver.advertList(param).then(res => {
// 初始话表格数据
this.dataOption = res.data.data;
// 初始化分页数据
this.rowCount = res.data.rowCount;
this.pageSize = res.data.pageSize;
cb ? cb() : "";
});
}, },
// 格式化时间 // 格式化时间
...@@ -343,12 +547,12 @@ export default { ...@@ -343,12 +547,12 @@ export default {
}, },
// 改变启用状态 // 改变启用状态
handleIsVailable(data) { handleIsVailable(data) {
console.log(data.isVailable); console.log(data.isAvailable);
const param = { const param = {
visitReasonId: data.visitReasonId, advertId: data.advertId,
isVailable: data.isVailable ? 0 : 1 isAvailable: data.isAvailable ? 1 : 0
}; };
visitor.addOrEditVisitReason(param).then(res => { adver.addOrEditAdvert(param).then(res => {
if (res.data.code === "1") { if (res.data.code === "1") {
this.$message({ this.$message({
message: "设置成功", message: "设置成功",
...@@ -356,13 +560,82 @@ export default { ...@@ -356,13 +560,82 @@ export default {
}); });
} }
}); });
},
// 显示活动类型
viewAdverType(code) {
if (code === 1) {
return "活动广告";
}
if (code === 2) {
return "系统公告";
} else {
return "新闻资讯";
}
},
// 上传图片成功
handleImgLoad(data) {
this.dialogBindData.advertPicUrl = data.url;
},
viewCensorStatus(code) {
if (code == 0) {
return "待审核";
} else if (code == 1) {
return "已审核";
} else {
return "未通过";
}
},
// 审核函数
handleCensor(data) {
const param = {
advertId: data.advertId,
censorStatus: this.censorStatus
};
adver.addOrEditAdvert(param).then(res => {
if (res.data.code === "1") {
this.getList(() => {
this.$message({
message: "审核完成",
type: "success"
});
this.submmitSuccess = false;
});
}
});
},
// 启用停用
handleUserState(data) {
const param = {
advertId: data.advertId,
isAvailable: data.isAvailable == 1 ? 0 : 1
};
adver.addOrEditAdvert(param).then(res => {
if (res.data.code === "1") {
this.getList(() => {
this.$message({
message: "设置成功",
type: "success"
});
this.submmitSuccess = false;
});
}
});
} }
}, },
computed: { computed: {
// 激活重置按钮 // 激活重置按钮
isActiveReset() { isActiveReset() {
for (const key in this.seacherParam) { for (const key in this.seacherParam) {
if (this.seacherParam[key]) { if (key === "advertType") {
this.seacherParam[key] = 1;
} else if (key === "menuType") {
this.seacherParam[key] = "1";
} else if (
this.seacherParam[key] === 0 ||
this.seacherParam[key] ||
this.seacherParam[key] === 1 ||
this.seacherParam[key] === "1"
) {
return false; return false;
} }
} }
...@@ -383,6 +656,24 @@ export default { ...@@ -383,6 +656,24 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.food-title {
font-size: 14px;
&::before {
content: "1";
background: #3a8ee6;
color: transparent;
margin-right: 10px;
}
}
.food-title {
font-size: 14px;
&::before {
content: "1";
background: #3a8ee6;
color: transparent;
margin-right: 10px;
}
}
.dialog-body-content { .dialog-body-content {
.el-row { .el-row {
margin-top: 14px; margin-top: 14px;
...@@ -410,3 +701,4 @@ export default { ...@@ -410,3 +701,4 @@ export default {
} }
} }
</style> </style>
<template>
<div class="view-page">
<div class="phone-bg">
<img :src="require('../../../../static/images/phone-bg.png')" alt="">
</div>
<div class="page-infro">
<!-- <el-carousel height="202px" indicator-position="none">
<el-carousel-item v-for="(item,index) in imageArr" :key="index">
<div class="bannerImg"><img :src="item" alt=""></div>
</el-carousel-item>
</el-carousel> -->
<!-- <div class="bannerImg">
<img :src="data.advertPicUrl" alt="" height="202">
</div> -->
<div class="text-infro" v-html="data.advertContent"></div>
</div>
</div>
</template>
<script>
export default {
props:["data"],
data(){
return {
imageArr:[]
}
},
beforeMount(){
const data = this.data;
// let arr = [];
// for(const key in data){
// if(key.indexOf('dishesPicUrl')>-1 && data[key]){
// arr.push(data[key])
// }
// }
// this.imageArr = arr
}
}
</script>
<style lang="scss" scoped>
.view-page{
position: relative;
.phone-bg{
width: 360px;
img{
width: 100%;
}
}
.page-infro{
background:#fff;
position: absolute;
top:110px;
left: 30px;
width:304px;
height: 540px;
overflow-x: hidden;
overflow-y: auto;
.bannerImg{
width: 100%;
height: 202px;
img{
width: 100%;
height: 100%;
}
}
.text-infro{
padding: 0 15px;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="uploadimg-container" :style="{width:width+'px'}">
<el-upload class="uploader-component" :style="styleObj" action="" :show-file-list="false" :before-upload="uploadFile">
<img :style="styleObj" v-if="(type||imageUrl)&&viewUrl" :src="viewUrl || imageUrl" class="avatar">
<i v-else :style="styleObj" class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<div class="tip">宽/高:{{`${width}*${height}`}}</div>
</div>
</template>
<script>
import axios from "axios";
export default {
props: ["width", "height", "resPath", "type", "viewUrl", "imageType", "idx"],
data() {
return {
imageUrl: "",
param: { resPath: this.resPath },
styleObj: {
width: this.width + "px",
height: this.height + "px",
lineHeight: this.height + "px"
}
};
},
mounted() {},
updated() {},
methods: {
uploadFile(file) {
const upLoadUrl = process.env.BASE_API + "/upload/uploadFile";
let formData = new FormData();
formData.append("files", file);
formData.append("resPath", this.resPath);
// 限制图片上传比例
// if (this.imageType === "banner") {
// console.log(this.imageType);
// formData.append("imageType", this.imageType);
// }
const fileSize = file.size / 1024 / 1024;
if (fileSize > 2) {
this.$message({
message: "上传图片不能大于2M",
type: "warning"
});
} else {
axios.post(upLoadUrl, formData).then(res => {
if (res.data.code == 1) {
this.imageUrl = res.data.data;
if (this.idx === undefined) {
this.$emit("emitSuccess", res.data.data);
} else {
const param = {
url: res.data.data,
idx: this.idx
};
this.$emit("emitSuccess", param);
}
this.$message({
message: "上传成功",
type: "success"
});
} else {
this.$message({
message: res.data.msg,
type: "warning"
});
}
});
}
},
clearImg() {
this.imageUrl = "";
}
}
};
</script>
<style lang="scss" scoped>
.uploadimg-container {
position: relative;
overflow: hidden;
display: inline-block;
.uploader-component {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
width: 178px;
height: 178px;
transition: all 0.3s;
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
transition: all 0.3s;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
&:hover {
border-color: #409eff;
.avatar-uploader-icon {
font-size: 28px;
color: #409eff;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
& + .tip {
left: 10px;
opacity: 1;
}
}
}
.tip {
position: absolute;
left: -140px;
opacity: 0;
top: 0;
width: 131px;
color: #fff;
text-shadow: 2px 2px 2px rgba($color: #000000, $alpha: 1);
font-weight: 700;
cursor: pointer;
transition: all 0.3s;
&:hover {
left: 10px;
opacity: 1;
}
}
}
</style>
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
<el-row :gutter="15" v-if="this.dialogBindData.flag!=='1'"> <el-row :gutter="15" v-if="this.dialogBindData.flag!=='1'">
<el-col :span="8" class="content-left"><label>用户角色</label></el-col> <el-col :span="8" class="content-left"><label>用户角色</label></el-col>
<el-col :span="16" class="content-right"> <el-col :span="16" class="content-right">
<el-select size="small" v-if="dialogType===1 || dialogType===2" placeholder="请选择人员" v-model="dialogBindData.sysRole"> <el-select size="small" v-if="dialogType===1 || dialogType===2" placeholder="请选择角色" v-model="dialogBindData.sysRole">
<el-option <el-option
v-for="item in chooseRole" v-for="item in chooseRole"
:key="item.roleId" :key="item.roleId"
...@@ -116,11 +116,11 @@ ...@@ -116,11 +116,11 @@
</el-row> </el-row>
<el-row :gutter="15"> <el-row :gutter="15">
<el-col :span="8" class="content-left"><label>所属部门</label></el-col> <el-col :span="8" class="content-left"><label>店铺管理员</label></el-col>
<el-col :span="16" class="content-right"> <el-col :span="16" class="content-right">
<el-select size="small" v-if="dialogType===1 || dialogType===2" placeholder="请选择部门" v-model="dialogBindData.deptId" @change="getSectionsByDeptId"> <el-select size="small" v-if="dialogType===1 || dialogType===2" placeholder="请选择店铺管理员" v-model="dialogBindData.deptId" @change="getSectionsByDeptId">
<el-option <el-option
v-for="item in deptDatas" v-for="item in shopAdminsData"
:key="item.deptId" :key="item.deptId"
:label="item.deptName" :label="item.deptName"
:value="item.deptId"> :value="item.deptId">
...@@ -130,25 +130,11 @@ ...@@ -130,25 +130,11 @@
</el-col> </el-col>
</el-row> </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-select size="small" v-if="dialogType===1 || dialogType===2" placeholder="请选择部门" v-model="dialogBindData.sectionId">
<el-option
v-for="item in sectionDatas"
:key="item.sectionId"
:label="item.sectionName"
:value="item.sectionId">
</el-option>
</el-select>
<span v-else>{{viewSectionName(dialogBindData.sectionId)}}</span>
</el-col>
</el-row>
<el-row :gutter="15"> <el-row :gutter="15">
<el-col :span="8" class="content-left"><label>用户名</label></el-col> <el-col :span="8" class="content-left"><label>用户名</label></el-col>
<el-col :span="16" class="content-right"> <el-col :span="16" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入用户名" v-model="dialogBindData.userName"></el-input> <el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入用户名" v-model="dialogBindData.userName"></el-input>
<span v-else>{{dialogBindData.userName}}</span> <span v-else>{{dialogBindData.userName}}</span>
</el-col> </el-col>
</el-row> </el-row>
...@@ -156,7 +142,7 @@ ...@@ -156,7 +142,7 @@
<el-row :gutter="15"> <el-row :gutter="15">
<el-col :span="8" class="content-left"><label>真实姓名</label></el-col> <el-col :span="8" class="content-left"><label>真实姓名</label></el-col>
<el-col :span="16" class="content-right"> <el-col :span="16" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入用户名" v-model="dialogBindData.realName"></el-input> <el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入真实姓名" v-model="dialogBindData.realName"></el-input>
<span v-else>{{dialogBindData.realName}}</span> <span v-else>{{dialogBindData.realName}}</span>
</el-col> </el-col>
</el-row> </el-row>
...@@ -219,6 +205,7 @@ ...@@ -219,6 +205,7 @@
</template> </template>
<script> <script>
import axios from 'axios';
import elDragDialog from "@/directive/el-dragDialog"; import elDragDialog from "@/directive/el-dragDialog";
import * as system from "../../api/system"; import * as system from "../../api/system";
import { fattCreateTime } from "../../utils/fattTime"; import { fattCreateTime } from "../../utils/fattTime";
...@@ -248,11 +235,12 @@ export default { ...@@ -248,11 +235,12 @@ export default {
mobilePhone: "", mobilePhone: "",
isAvailable: 1, isAvailable: 1,
sysRole: "", sysRole: "",
deptId: "", flag: ""
flag: "",
sectionName: "",
sectionId: ""
}, },
//店铺管理员下拉数据
shopAdminsData:null,
// 是否提交 // 是否提交
submmitSuccess: false, submmitSuccess: false,
// 角色选择数据 // 角色选择数据
...@@ -337,7 +325,10 @@ export default { ...@@ -337,7 +325,10 @@ export default {
// }, // },
add() { add() {
this.dialogType = 1; this.dialogType = 1;
this.getRoleList(() => { // this.getRoleList(() => {
// this.dialogState = true;
// });
this.getRoleAndUserData(() => {
this.dialogState = true; this.dialogState = true;
}); });
}, },
...@@ -412,7 +403,7 @@ export default { ...@@ -412,7 +403,7 @@ export default {
} else { } else {
this.submmitSuccess = true; this.submmitSuccess = true;
system.addOrEditSysUser(this.dialogBindData).then(res => { system.addOrEditSysUser(this.dialogBindData).then(res => {
debugger debugger;
if (res.data.code == 1) { if (res.data.code == 1) {
this.getList(() => { this.getList(() => {
this.$message({ this.$message({
...@@ -496,6 +487,27 @@ export default { ...@@ -496,6 +487,27 @@ export default {
cb ? cb() : ""; cb ? cb() : "";
}); });
}, },
//获取角色和管理员下拉数据
getRoleAndUserData(cb) {
axios
.all([
//方法一
system.queryAllSysRole().then(res => {
this.chooseRole = res.data;
}),
//方法二
system.queryAllShopAdmin().then(res => {
this.shopAdminsData = res.data;
})
])
.then(
axios.spread((acct, perms)=> {
cb ? cb() : "";
})
);
},
// 格式化时间 // 格式化时间
fattTime(time) { fattTime(time) {
return fattCreateTime(time); return fattCreateTime(time);
......
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