中台处理
This commit is contained in:
parent
4641b04b65
commit
087ce92cbf
@ -60,3 +60,13 @@ export function getCodeImg() {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 单点登录
|
||||||
|
export function loginVerificationApi(data) {
|
||||||
|
return request({
|
||||||
|
url: 'backendApi/store/loginVerification',
|
||||||
|
method: 'post',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -3,28 +3,50 @@ import store from './store'
|
|||||||
import { Message } from 'element-ui'
|
import { Message } from 'element-ui'
|
||||||
import NProgress from 'nprogress'
|
import NProgress from 'nprogress'
|
||||||
import 'nprogress/nprogress.css'
|
import 'nprogress/nprogress.css'
|
||||||
import { getToken } from '@/utils/auth'
|
import {getToken, removeToken, setToken} from '@/utils/auth'
|
||||||
import { isRelogin } from '@/utils/request'
|
import { isRelogin } from '@/utils/request'
|
||||||
|
import { loginVerificationApi } from '@/api/login'
|
||||||
|
// import BigNumber from 'bignumber.js';
|
||||||
|
|
||||||
NProgress.configure({ showSpinner: false })
|
NProgress.configure({ showSpinner: false })
|
||||||
|
|
||||||
const whiteList = ['/login', '/auth-redirect']
|
const whiteList = ['/login', '/auth-redirect']
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach(async (to, from, next) => {
|
||||||
NProgress.start()
|
NProgress.start()
|
||||||
|
console.log(to,from,next)
|
||||||
|
if (to.query.entrance) {
|
||||||
|
try {
|
||||||
|
const res = await loginVerificationApi(to.query.entrance);
|
||||||
|
if (res.data.token) {
|
||||||
|
setToken(res.data.token);
|
||||||
|
to.meta.title = "系统首页";
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error("An error occurred:", error);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (getToken()) {
|
if (getToken()) {
|
||||||
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
|
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
|
||||||
/* has token*/
|
/* has token*/
|
||||||
if (to.path === '/login') {
|
if (to.path === '/login') {
|
||||||
|
|
||||||
next({ path: '/' })
|
next({ path: '/' })
|
||||||
NProgress.done()
|
NProgress.done()
|
||||||
} else {
|
}else {
|
||||||
|
console.log("111113",store.getters.roles)
|
||||||
|
|
||||||
if (store.getters.roles.length === 0) {
|
if (store.getters.roles.length === 0) {
|
||||||
|
console.log("111114")
|
||||||
isRelogin.show = true
|
isRelogin.show = true
|
||||||
// 判断当前用户是否已拉取完user_info信息
|
// 判断当前用户是否已拉取完user_info信息
|
||||||
store.dispatch('GetInfo').then(() => {
|
store.dispatch('GetInfo').then(() => {
|
||||||
|
console.log("111116")
|
||||||
|
|
||||||
isRelogin.show = false
|
isRelogin.show = false
|
||||||
store.dispatch('GenerateRoutes').then(accessRoutes => {
|
store.dispatch('GenerateRoutes').then(accessRoutes => {
|
||||||
|
console.log("111117")
|
||||||
|
|
||||||
// 根据roles权限生成可访问的路由表
|
// 根据roles权限生成可访问的路由表
|
||||||
router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
||||||
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
|
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
|
||||||
|
@ -46,6 +46,11 @@ export const constantRoutes = [
|
|||||||
component: () => import('@/views/login'),
|
component: () => import('@/views/login'),
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// path: '/jumpInTheMiddleOffice',
|
||||||
|
// component: () => import('@/views/index'),
|
||||||
|
// hidden: true
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
path: '/404',
|
path: '/404',
|
||||||
component: () => import('@/views/error/404'),
|
component: () => import('@/views/error/404'),
|
||||||
@ -56,6 +61,20 @@ export const constantRoutes = [
|
|||||||
component: () => import('@/views/error/401'),
|
component: () => import('@/views/error/401'),
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// path: '/jumpInTheMiddleOffice',
|
||||||
|
// component: Layout,
|
||||||
|
// redirect: 'index',
|
||||||
|
// children: [
|
||||||
|
// {
|
||||||
|
// path: 'index',
|
||||||
|
// component: () => import('@/views/index'),
|
||||||
|
// name: 'Index',
|
||||||
|
// meta: { title: '系统首页', icon: 'dashboard', affix: true }
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// },
|
||||||
|
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
@ -201,7 +220,7 @@ Router.prototype.push = function push(location) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default new Router({
|
export default new Router({
|
||||||
// mode: 'history', // 去掉url中的#
|
mode: 'history', // 去掉url中的#
|
||||||
scrollBehavior: () => ({ y: 0 }),
|
scrollBehavior: () => ({ y: 0 }),
|
||||||
routes: constantRoutes
|
routes: constantRoutes
|
||||||
})
|
})
|
||||||
|
@ -81,6 +81,8 @@ const user = {
|
|||||||
GetInfo({ commit, state }) {
|
GetInfo({ commit, state }) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
getInfo().then(res => {
|
getInfo().then(res => {
|
||||||
|
console.log("22222223")
|
||||||
|
|
||||||
const user = res.data.accountInfo
|
const user = res.data.accountInfo
|
||||||
const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/avatar.png") : process.env.VUE_APP_BASE_API + user.avatar;
|
const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/avatar.png") : process.env.VUE_APP_BASE_API + user.avatar;
|
||||||
if (res.data.roles && res.data.roles.length > 0) { // 验证返回的roles是否是一个非空数组
|
if (res.data.roles && res.data.roles.length > 0) { // 验证返回的roles是否是一个非空数组
|
||||||
@ -96,9 +98,10 @@ const user = {
|
|||||||
commit('SET_STORE_ID', user.storeId)
|
commit('SET_STORE_ID', user.storeId)
|
||||||
commit('SET_STORE_NAME', user.storeName)
|
commit('SET_STORE_NAME', user.storeName)
|
||||||
resolve(res)
|
resolve(res)
|
||||||
}).catch(error => {
|
|
||||||
reject(error)
|
|
||||||
})
|
})
|
||||||
|
// .catch(error => {
|
||||||
|
// reject(error)
|
||||||
|
// })
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ export function setToken(token) {
|
|||||||
return Cookies.set(TokenKey, token)
|
return Cookies.set(TokenKey, token)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function removeToken() {
|
export function removeToken() {
|
||||||
return Cookies.remove(TokenKey)
|
return Cookies.remove(TokenKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,17 +91,22 @@ export default {
|
|||||||
this.goodsSum = 0
|
this.goodsSum = 0
|
||||||
let dataList = res.data
|
let dataList = res.data
|
||||||
if (this.goodsRadio === '7天' && dataList.length >= 7) {
|
if (this.goodsRadio === '7天' && dataList.length >= 7) {
|
||||||
dataList = dataList.slice(0, 7);
|
// dataList = dataList.slice(0, 7);
|
||||||
|
dataList = dataList.slice(-7);
|
||||||
} else if (this.goodsRadio === '15天' && dataList.length >= 15) {
|
} else if (this.goodsRadio === '15天' && dataList.length >= 15) {
|
||||||
dataList = dataList.slice(0, 15);
|
// dataList = dataList.slice(0, 15);
|
||||||
|
dataList = dataList.slice(-15);
|
||||||
} else if (this.goodsRadio === '30天' && dataList.length >= 30) {
|
} else if (this.goodsRadio === '30天' && dataList.length >= 30) {
|
||||||
dataList = dataList.slice(0, 30);
|
// dataList = dataList.slice(0, 30);
|
||||||
|
dataList = dataList.slice(-30);
|
||||||
}
|
}
|
||||||
|
|
||||||
dataList.forEach(element => {
|
dataList.forEach(element => {
|
||||||
this.goodsTimeDate.push(parseTime(element.sales_day,'{y}-{m}-{d}'));
|
this.goodsTimeDate.push(parseTime(element.sales_day,'{y}-{m}-{d}'));
|
||||||
this.goodsDate.push(element.total_sales);
|
this.goodsDate.push(element.total_sales);
|
||||||
this.goodsSum+=element.total_sales
|
this.goodsSum+=element.total_sales
|
||||||
|
this.goodsSum = parseFloat(this.goodsSum.toFixed(2));
|
||||||
|
|
||||||
});
|
});
|
||||||
this.initChart()
|
this.initChart()
|
||||||
this.goodsLoading = false
|
this.goodsLoading = false
|
||||||
@ -120,17 +125,22 @@ export default {
|
|||||||
this.cardSum = 0
|
this.cardSum = 0
|
||||||
let dataList = res.data
|
let dataList = res.data
|
||||||
if (this.cardRadio === '7天' && dataList.length >= 7) {
|
if (this.cardRadio === '7天' && dataList.length >= 7) {
|
||||||
dataList = dataList.slice(0, 7);
|
dataList = dataList.slice(-7);
|
||||||
|
// dataList = dataList.slice(0, 7);
|
||||||
} else if (this.cardRadio === '15天' && dataList.length >= 15) {
|
} else if (this.cardRadio === '15天' && dataList.length >= 15) {
|
||||||
dataList = dataList.slice(0, 15);
|
dataList = dataList.slice(-15);
|
||||||
|
// dataList = dataList.slice(0, 15);
|
||||||
} else if (this.cardRadio === '30天' && dataList.length >= 30) {
|
} else if (this.cardRadio === '30天' && dataList.length >= 30) {
|
||||||
dataList = dataList.slice(0, 30);
|
dataList = dataList.slice(-30);
|
||||||
|
// dataList = dataList.slice(0, 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
dataList.forEach(element => {
|
dataList.forEach(element => {
|
||||||
this.cardTimeDate.push(parseTime(element.sales_day,'{y}-{m}-{d}'));
|
this.cardTimeDate.push(parseTime(element.sales_day,'{y}-{m}-{d}'));
|
||||||
this.cardDate.push(element.total_sales);
|
this.cardDate.push(element.total_sales);
|
||||||
this.cardSum+=element.total_sales
|
this.cardSum+=element.total_sales
|
||||||
|
this.cardSum = parseFloat(this.cardSum.toFixed(2));
|
||||||
|
|
||||||
});
|
});
|
||||||
this.getTunFuelCardSales()
|
this.getTunFuelCardSales()
|
||||||
// this.changeLabel();
|
// this.changeLabel();
|
||||||
@ -146,11 +156,14 @@ export default {
|
|||||||
// this.cardSum = 0
|
// this.cardSum = 0
|
||||||
let dataList = res.data
|
let dataList = res.data
|
||||||
if (this.cardRadio === '7天' && dataList.length >= 7) {
|
if (this.cardRadio === '7天' && dataList.length >= 7) {
|
||||||
dataList = dataList.slice(0, 7);
|
// dataList = dataList.slice(0, 7);
|
||||||
|
dataList = dataList.slice(- 7);
|
||||||
} else if (this.cardRadio === '15天' && dataList.length >= 15) {
|
} else if (this.cardRadio === '15天' && dataList.length >= 15) {
|
||||||
dataList = dataList.slice(0, 15);
|
// dataList = dataList.slice(0, 15);
|
||||||
|
dataList = dataList.slice(-15);
|
||||||
} else if (this.cardRadio === '30天' && dataList.length >= 30) {
|
} else if (this.cardRadio === '30天' && dataList.length >= 30) {
|
||||||
dataList = dataList.slice(0, 30);
|
// dataList = dataList.slice(0, 30);
|
||||||
|
dataList = dataList.slice(- 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
dataList.forEach(element => {
|
dataList.forEach(element => {
|
||||||
|
@ -92,17 +92,25 @@ export default {
|
|||||||
this.sum = 0
|
this.sum = 0
|
||||||
let dataList = res.data
|
let dataList = res.data
|
||||||
if (this.radio === '7天' && dataList.length >= 7) {
|
if (this.radio === '7天' && dataList.length >= 7) {
|
||||||
dataList = dataList.slice(0, 7);
|
// dataList = dataList.slice(0, 7);
|
||||||
|
dataList = dataList.slice(-7);
|
||||||
|
|
||||||
} else if (this.radio === '15天' && dataList.length >= 15) {
|
} else if (this.radio === '15天' && dataList.length >= 15) {
|
||||||
dataList = dataList.slice(0, 15);
|
// dataList = dataList.slice(0, 15);
|
||||||
|
dataList = dataList.slice(-15);
|
||||||
|
|
||||||
} else if (this.radio === '30天' && dataList.length >= 30) {
|
} else if (this.radio === '30天' && dataList.length >= 30) {
|
||||||
dataList = dataList.slice(0, 30);
|
// dataList = dataList.slice(0, 30);
|
||||||
|
dataList = dataList.slice(-30);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dataList.forEach(element => {
|
dataList.forEach(element => {
|
||||||
this.timeDate.push(parseTime(element.sales_day,'{y}-{m}-{d}'));
|
this.timeDate.push(parseTime(element.sales_day,'{y}-{m}-{d}'));
|
||||||
this.oilDate.push(element.total_sales);
|
this.oilDate.push(element.total_sales);
|
||||||
this.sum+=element.total_sales
|
this.sum+=element.total_sales
|
||||||
|
this.sum = parseFloat(this.sum.toFixed(2));
|
||||||
|
|
||||||
});
|
});
|
||||||
this.initChart()
|
this.initChart()
|
||||||
// this.changeLabel();
|
// this.changeLabel();
|
||||||
@ -130,14 +138,21 @@ export default {
|
|||||||
|
|
||||||
changeLabel() {
|
changeLabel() {
|
||||||
if (this.radio === '7天' && this.timeDate.length >= 7) {
|
if (this.radio === '7天' && this.timeDate.length >= 7) {
|
||||||
this.timeDate = this.timeDate.slice(0, 7);
|
// this.timeDate = this.timeDate.slice(0, 7);
|
||||||
this.oilDate = this.oilDate.slice(0, 7);
|
// this.oilDate = this.oilDate.slice(0, 7);
|
||||||
|
|
||||||
|
this.timeDate = this.timeDate.slice(-7);
|
||||||
|
this.oilDate = this.oilDate.slice(-7);
|
||||||
} else if (this.radio === '15天' && this.timeDate.length >= 15) {
|
} else if (this.radio === '15天' && this.timeDate.length >= 15) {
|
||||||
this.timeDate = this.timeDate.slice(0, 15);
|
// this.timeDate = this.timeDate.slice(0, 15);
|
||||||
this.oilDate = this.oilDate.slice(0, 15);
|
// this.oilDate = this.oilDate.slice(0, 15);
|
||||||
|
this.timeDate = this.timeDate.slice(-15);
|
||||||
|
this.oilDate = this.oilDate.slice(-15);
|
||||||
} else if (this.radio === '30天' && this.timeDate.length >= 30) {
|
} else if (this.radio === '30天' && this.timeDate.length >= 30) {
|
||||||
this.timeDate = this.timeDate.slice(0, 30);
|
// this.timeDate = this.timeDate.slice(0, 30);
|
||||||
this.oilDate = this.oilDate.slice(0, 30);
|
// this.oilDate = this.oilDate.slice(0, 30);
|
||||||
|
this.timeDate = this.timeDate.slice(-30);
|
||||||
|
this.oilDate = this.oilDate.slice(-30);
|
||||||
}
|
}
|
||||||
this.initChart()
|
this.initChart()
|
||||||
},
|
},
|
||||||
|
@ -1131,7 +1131,7 @@ export default {
|
|||||||
|
|
||||||
// 点击按钮处理
|
// 点击按钮处理
|
||||||
handleIsopenSelect() {
|
handleIsopenSelect() {
|
||||||
// this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
},
|
},
|
||||||
// 上传封面
|
// 上传封面
|
||||||
handleUploadSuccessCover(file) {
|
handleUploadSuccessCover(file) {
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@riophae/vue-treeselect": "0.4.0",
|
"@riophae/vue-treeselect": "0.4.0",
|
||||||
"axios": "0.24.0",
|
"axios": "0.24.0",
|
||||||
|
"bignumber.js": "^9.1.2",
|
||||||
"clipboard": "2.0.8",
|
"clipboard": "2.0.8",
|
||||||
"core-js": "3.25.3",
|
"core-js": "3.25.3",
|
||||||
"echarts": "4.9.0",
|
"echarts": "4.9.0",
|
||||||
|
18
fuintAdmin_zt/src/api/payConfig/merchantconfig.js
Normal file
18
fuintAdmin_zt/src/api/payConfig/merchantconfig.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询商户列表
|
||||||
|
export function listMerchant() {
|
||||||
|
return request({
|
||||||
|
url: '/api/merchantConfig/list',
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改商户使用状态
|
||||||
|
export function editMerchant(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/merchantConfig',
|
||||||
|
method: 'put',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
52
fuintAdmin_zt/src/api/payConfig/oilconfig.js
Normal file
52
fuintAdmin_zt/src/api/payConfig/oilconfig.js
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询支付规则列表
|
||||||
|
export function listOilConfig() {
|
||||||
|
return request({
|
||||||
|
url: '/api/oilConfig/list',
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 是否开启支付规则
|
||||||
|
export function isOpenOilConfig(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/oilConfig/isOpen',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据id查询支付配置信息
|
||||||
|
export function oilConfigInfo(id) {
|
||||||
|
return request({
|
||||||
|
url: '/api/oilConfig/info/'+id,
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加支付配置信息
|
||||||
|
export function addOilConfig(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/oilConfig',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改支付配置信息
|
||||||
|
export function editOilConfig(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/oilConfig',
|
||||||
|
method: 'put',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除支付配置信息
|
||||||
|
export function delOilConfig(id) {
|
||||||
|
return request({
|
||||||
|
url: '/api/oilConfig/'+id,
|
||||||
|
method: 'delete',
|
||||||
|
})
|
||||||
|
}
|
@ -50,3 +50,32 @@ export function delStaff(id) {
|
|||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 查找店铺信息
|
||||||
|
export function getStoreInfo(id) {
|
||||||
|
return request({
|
||||||
|
url: '/backendApi/store/info/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 修改店铺信息
|
||||||
|
export function editStoreInfoApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/backendApi/store/editStoreInfo',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改店铺信息
|
||||||
|
export function singleSignOnApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/backendApi/store/singleSignOn',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
78
fuintAdmin_zt/src/api/staff/user/user.js
Normal file
78
fuintAdmin_zt/src/api/staff/user/user.js
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询会员列表
|
||||||
|
export function listUser(query) {
|
||||||
|
return request({
|
||||||
|
url: '/business/userManager/user/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询会员统计列表
|
||||||
|
export function listUserStatistic(query) {
|
||||||
|
return request({
|
||||||
|
url: '/business/userManager/userStatistic/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询会员列表
|
||||||
|
export function listStatistic(query) {
|
||||||
|
return request({
|
||||||
|
url: '/business/userManager/user/statistic',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询会员详细
|
||||||
|
export function getUser(id) {
|
||||||
|
return request({
|
||||||
|
url: '/business/userManager/user/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 根据手机号查询会员详细
|
||||||
|
export function getUserMobile(data) {
|
||||||
|
return request({
|
||||||
|
url: '/business/userManager/user/mobile' ,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增会员
|
||||||
|
export function addUser(data) {
|
||||||
|
return request({
|
||||||
|
url: '/business/userManager/user',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改会员
|
||||||
|
export function updateUser(data) {
|
||||||
|
return request({
|
||||||
|
url: '/business/userManager/user',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除会员
|
||||||
|
export function delUser(id) {
|
||||||
|
return request({
|
||||||
|
url: '/business/userManager/user/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//下载示例文件
|
||||||
|
export function exportUsers() {
|
||||||
|
return request({
|
||||||
|
url: '/excel/export',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
@ -9,7 +9,7 @@ export function listUser(query) {
|
|||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 查询用户列表
|
// 查询用户列表?? 获取部门信息
|
||||||
export function Userlist(id) {
|
export function Userlist(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/dept/'+id,
|
url: '/system/dept/'+id,
|
||||||
@ -17,12 +17,11 @@ export function Userlist(id) {
|
|||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 查询用户列表
|
// 查询校色列表
|
||||||
export function jklist(id) {
|
export function jklist() {
|
||||||
return request({
|
return request({
|
||||||
url: '/backendApi/duty/list',
|
url: '/backendApi/duty/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,10 +53,17 @@ export function updateUser(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 删除用户
|
// 删除用户
|
||||||
|
// export function delUser(userId) {
|
||||||
|
// return request({
|
||||||
|
// url: '/system/user/' + userId,
|
||||||
|
// method: 'delete'
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
|
||||||
export function delUser(userId) {
|
export function delUser(userId) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/user/' + userId,
|
url: '/backendApi/account/delete/' + userId,
|
||||||
method: 'delete'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import router from './router'
|
import router from './router'
|
||||||
import store from './store'
|
import store from '@/store'
|
||||||
import { Message } from 'element-ui'
|
import { Message } from 'element-ui'
|
||||||
import NProgress from 'nprogress'
|
import NProgress from 'nprogress'
|
||||||
import 'nprogress/nprogress.css'
|
import 'nprogress/nprogress.css'
|
||||||
@ -12,6 +12,14 @@ const whiteList = ['/login', '/auth-redirect']
|
|||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
NProgress.start()
|
NProgress.start()
|
||||||
|
// this.$store.commit('token/setToken', 'your_token_value');
|
||||||
|
// const currentToken = this.$store.state.token.token;
|
||||||
|
// 调用 mutations 更新 token
|
||||||
|
// store.commit('setToken', '');
|
||||||
|
|
||||||
|
// 读取状态
|
||||||
|
// const currentToken = store.state.token;
|
||||||
|
// console.log('Current Token:', currentToken.token);
|
||||||
if (getToken()) {
|
if (getToken()) {
|
||||||
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
|
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
|
||||||
/* has token*/
|
/* has token*/
|
||||||
|
@ -5,6 +5,7 @@ import user from './modules/user'
|
|||||||
import tagsView from './modules/tagsView'
|
import tagsView from './modules/tagsView'
|
||||||
import permission from './modules/permission'
|
import permission from './modules/permission'
|
||||||
import settings from './modules/settings'
|
import settings from './modules/settings'
|
||||||
|
import token from './modules/token'
|
||||||
import getters from './getters'
|
import getters from './getters'
|
||||||
|
|
||||||
Vue.use(Vuex)
|
Vue.use(Vuex)
|
||||||
@ -15,7 +16,8 @@ const store = new Vuex.Store({
|
|||||||
user,
|
user,
|
||||||
tagsView,
|
tagsView,
|
||||||
permission,
|
permission,
|
||||||
settings
|
settings,
|
||||||
|
token
|
||||||
},
|
},
|
||||||
|
|
||||||
getters
|
getters
|
||||||
|
29
fuintAdmin_zt/src/store/modules/token.js
Normal file
29
fuintAdmin_zt/src/store/modules/token.js
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
|
||||||
|
const token = {
|
||||||
|
state: {
|
||||||
|
token:''
|
||||||
|
},
|
||||||
|
|
||||||
|
mutations: {
|
||||||
|
setToken: (state, token) => {
|
||||||
|
state.token = token;
|
||||||
|
},
|
||||||
|
getToken: (state, token) => {
|
||||||
|
state.token = token;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
actions: {
|
||||||
|
async setTokenAsync({ commit }, token) {
|
||||||
|
// 这里可以进行异步操作,例如 API 调用等
|
||||||
|
// 假设你在这里调用了异步 API 获取 token
|
||||||
|
const response = await api.getToken();
|
||||||
|
const fetchedToken = response.data.token;
|
||||||
|
|
||||||
|
// 提交 mutation 更新 token
|
||||||
|
commit('setToken', fetchedToken);
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default token
|
@ -1,18 +1,62 @@
|
|||||||
|
// import Cookies from 'js-cookie'
|
||||||
|
|
||||||
|
// const TokenKey = 'Access-Token-Admin'
|
||||||
|
// const UserKey = 'User-Id'
|
||||||
|
|
||||||
|
// export function getToken() {
|
||||||
|
// return Cookies.get(TokenKey)
|
||||||
|
// }
|
||||||
|
|
||||||
|
// export function setToken(token) {
|
||||||
|
// return Cookies.set(TokenKey, token)
|
||||||
|
// }
|
||||||
|
|
||||||
|
// export function removeToken() {
|
||||||
|
// return Cookies.remove(TokenKey)
|
||||||
|
// }
|
||||||
|
|
||||||
|
// export function getUserId() {
|
||||||
|
// return Cookies.get(UserKey)
|
||||||
|
// }
|
||||||
|
|
||||||
|
// export function setUserId(userId) {
|
||||||
|
// return Cookies.set(UserKey, userId)
|
||||||
|
// }
|
||||||
|
|
||||||
|
// export function removeUserId() {
|
||||||
|
// return Cookies.remove(UserKey)
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import store from '@/store/index'
|
||||||
|
|
||||||
import Cookies from 'js-cookie'
|
import Cookies from 'js-cookie'
|
||||||
|
|
||||||
const TokenKey = 'Access-Token'
|
const TokenKey = 'Access-Token-Admin'
|
||||||
const UserKey = 'User-Id'
|
const UserKey = 'User-Id'
|
||||||
|
|
||||||
export function getToken() {
|
export function getToken() {
|
||||||
return Cookies.get(TokenKey)
|
let token
|
||||||
|
if( store) {
|
||||||
|
// console.log("store",store.state.token.token)
|
||||||
|
|
||||||
|
token = store.state.token.token
|
||||||
|
}
|
||||||
|
return token
|
||||||
|
// const currentToken = store.state.token;
|
||||||
|
// console.log('Current Token:', currentToken.token);
|
||||||
|
// console.log("111111111",currentToken)
|
||||||
|
// return Cookies.get(TokenKey)
|
||||||
|
// return store.state.token
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setToken(token) {
|
export function setToken(token) {
|
||||||
return Cookies.set(TokenKey, token)
|
return store.commit('setToken', token);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function removeToken() {
|
export function removeToken() {
|
||||||
return Cookies.remove(TokenKey)
|
return store.state.token = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getUserId() {
|
export function getUserId() {
|
||||||
@ -26,4 +70,3 @@ export function setUserId(userId) {
|
|||||||
export function removeUserId() {
|
export function removeUserId() {
|
||||||
return Cookies.remove(UserKey)
|
return Cookies.remove(UserKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,9 @@
|
|||||||
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="支付配置" name="second">
|
<el-tab-pane label="支付配置" name="second">
|
||||||
<peizhi></peizhi>
|
<!-- <peizhi></peizhi>
|
||||||
|
-->
|
||||||
|
<payment></payment>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="员工管理" name="staff">
|
<el-tab-pane label="员工管理" name="staff">
|
||||||
<staff></staff>
|
<staff></staff>
|
||||||
@ -24,7 +26,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import peizhi from '../components/Service/peizhi'
|
// import peizhi from '../components/Service/peizhi'
|
||||||
|
import payment from '../components/Service/payment'
|
||||||
import staff from '../components/Service/staff'
|
import staff from '../components/Service/staff'
|
||||||
import jcindex from '../components/Service/index'
|
import jcindex from '../components/Service/index'
|
||||||
export default {
|
export default {
|
||||||
@ -35,8 +38,10 @@
|
|||||||
activeName: 'first'
|
activeName: 'first'
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// peizhi
|
||||||
components:{
|
components:{
|
||||||
jcindex, peizhi,staff,
|
jcindex,staff,payment,
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.id = this.$route.query.id
|
this.id = this.$route.query.id
|
||||||
|
@ -2,25 +2,25 @@
|
|||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-card >
|
<el-card >
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-form ref="form" :model="form" label-width="40px">
|
<el-form ref="queryParams" :model="queryParams" label-width="40px">
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
|
|
||||||
<el-form-item label="名称">
|
<el-form-item label="名称">
|
||||||
<el-input v-model="form.name"></el-input>
|
<el-input v-model="queryParams.storeName"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
|
|
||||||
<el-form-item label="状态">
|
<el-form-item label="状态">
|
||||||
<el-select v-model="form.region" placeholder="店铺状态">
|
<el-select v-model="queryParams.status" placeholder="店铺状态">
|
||||||
<el-option label="店铺状态一" value="shanghai"></el-option>
|
<el-option label="启用" value="qy"></el-option>
|
||||||
<el-option label="店铺状态二" value="beijing"></el-option>
|
<el-option label="禁用" value="jy"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4">
|
<!-- <el-col :span="4">
|
||||||
|
|
||||||
<el-form-item label="套餐">
|
<el-form-item label="套餐">
|
||||||
<el-select v-model="form.region" placeholder="店铺套餐">
|
<el-select v-model="form.region" placeholder="店铺套餐">
|
||||||
@ -29,8 +29,8 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-col>
|
</el-col> -->
|
||||||
<el-col :span="6">
|
<!-- <el-col :span="6">
|
||||||
|
|
||||||
<el-form-item label="时间">
|
<el-form-item label="时间">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
@ -42,9 +42,10 @@
|
|||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-col>
|
</el-col> -->
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
<el-button type="primary" icon="el-icon-search">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" @click="getlist()">搜索</el-button>
|
||||||
|
<el-button type="" icon="el-icon-refresh" @click="res()">重置</el-button>
|
||||||
|
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -65,7 +66,7 @@
|
|||||||
<el-tag type="success">{{items.status=='qy'?'启用':'禁用'}}</el-tag>
|
<el-tag type="success">{{items.status=='qy'?'启用':'禁用'}}</el-tag>
|
||||||
<div class="disper-box">
|
<div class="disper-box">
|
||||||
<div class="box-img">
|
<div class="box-img">
|
||||||
<!-- <img src="../../assets/images/wl.png" style="width: 96px;height: 96px">-->
|
<img :src="imagePath + items.logo" style="width: 96px;height: 96px">
|
||||||
</div>
|
</div>
|
||||||
<div >
|
<div >
|
||||||
<div class="title">{{items.name || ''}}</div>
|
<div class="title">{{items.name || ''}}</div>
|
||||||
@ -75,11 +76,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="box-hui">
|
<div class="box-hui">
|
||||||
<div>联系人:</div>
|
<div>联系人:</div>
|
||||||
<div>{{items.leaderName || '暂无'}}</div>
|
<div>{{items.contact || '暂无'}}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-hui">
|
<div class="box-hui">
|
||||||
<div>联系电话:</div>
|
<div>联系电话:</div>
|
||||||
<div>{{items.leaderPhone || '暂无'}}</div>
|
<div>{{items.phone || '暂无'}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -123,9 +124,13 @@
|
|||||||
resource: '',
|
resource: '',
|
||||||
desc: ''
|
desc: ''
|
||||||
},
|
},
|
||||||
|
imagePath: process.env.VUE_APP_SERVER_URL,
|
||||||
|
|
||||||
arrlist:[],
|
arrlist:[],
|
||||||
value1:'',
|
value1:'',
|
||||||
queryParams: {
|
queryParams: {
|
||||||
|
storeName: '',
|
||||||
|
status: '',
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
|
||||||
@ -142,6 +147,17 @@
|
|||||||
this.arrlist = res.data.records
|
this.arrlist = res.data.records
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
res() {
|
||||||
|
this.queryParams= {
|
||||||
|
storeName: '',
|
||||||
|
status: '',
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
this.getlist()
|
||||||
|
},
|
||||||
godetails(id){
|
godetails(id){
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path:'/Service/details',
|
path:'/Service/details',
|
||||||
|
@ -107,7 +107,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="创建时间" align="center" prop="createDate" v-if="columns[3].visible" width="160">
|
<el-table-column label="创建时间" align="center" prop="createDate" v-if="columns[3].visible" width="160">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.createDate) }}</span>
|
<span>{{ scope.row.createTime }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
@ -203,43 +203,50 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<!-- 添加或修改用户配置对话框 -->
|
<!-- 添加或修改用户配置对话框 class="common-dialog" -->
|
||||||
<el-dialog :title="title" :visible.sync="open" class="common-dialog" width="600px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body :close-on-click-modal="false" >
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="用户名" prop="accountName">
|
<el-form-item label="用户名" prop="accountName">
|
||||||
<el-input v-model="form.accountName" placeholder="请输入用户名" maxlength="50" />
|
<el-input v-model="form.accountName" placeholder="请输入用户名" maxlength="50" autocomplete="off" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
|
||||||
|
<template v-if="title == '新增用户'">
|
||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item v-if="form.id == undefined" label="登录密码" prop="password">
|
<el-form-item v-if="form.id == undefined" label="登录密码" prop="password">
|
||||||
<el-input v-model="form.password" placeholder="请输入登录密码" maxlength="30" show-password/>
|
<el-input v-model="form.password" placeholder="请输入登录密码" maxlength="30" show-password autocomplete="off"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item v-if="form.id == undefined" label="确认密码" prop="password1">
|
<el-form-item v-if="form.id == undefined" label="确认密码" prop="password1">
|
||||||
<el-input v-model="form.password1" placeholder="请输入确认密码" type="password" maxlength="30" show-password/>
|
<el-input v-model="form.password1" placeholder="请输入确认密码" type="password" maxlength="30" show-password autocomplete="off"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="真实姓名" prop="realName">
|
<el-form-item label="真实姓名" prop="realName">
|
||||||
<el-input v-model="form.realName" placeholder="请输入真实姓名" maxlength="30" />
|
<el-input v-model="form.realName" placeholder="请输入真实姓名" maxlength="30" autocomplete="off"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="状态">
|
<el-form-item label="状态">
|
||||||
<el-radio-group v-model="form.accountStatus">
|
<el-radio-group v-model="form.accountStatus" @change="$forceUpdate()">
|
||||||
<el-radio :key="1" :label="1" :value="1">启用</el-radio>
|
<el-radio :key=1 :label=1 :value=1>启用</el-radio>
|
||||||
<el-radio :key="0" :label="0" :value="0">禁用</el-radio>
|
<el-radio :key=0 :label=0 :value=0>禁用</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -247,12 +254,12 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="分配角色">
|
<el-form-item label="分配角色">
|
||||||
<el-select v-model="form.roleIds" @change="$forceUpdate()" placeholder="请选择角色">
|
<el-select v-model="form.roleIds" @change="$forceUpdate(),getCodeByRole($event)" placeholder="请选择角色">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in rolelist"
|
v-for="item in rolelist"
|
||||||
:key="item.dutyId"
|
:key="item.id"
|
||||||
:label="item.dutyName"
|
:label="item.name"
|
||||||
:value="item.dutyId"
|
:value="item.id"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
@ -268,7 +275,7 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 用户导入对话框 -->
|
<!-- 用户导入对话框 -->
|
||||||
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body :close-on-click-modal="false">
|
||||||
<el-upload
|
<el-upload
|
||||||
ref="upload"
|
ref="upload"
|
||||||
:limit="1"
|
:limit="1"
|
||||||
@ -385,7 +392,16 @@
|
|||||||
// 角色选项
|
// 角色选项
|
||||||
roleOptions: [],
|
roleOptions: [],
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {
|
||||||
|
accountName:'',
|
||||||
|
password:'',
|
||||||
|
accountStatus:'1',
|
||||||
|
roleIds:[],
|
||||||
|
deptId:'',
|
||||||
|
code:'',
|
||||||
|
},
|
||||||
|
deptType:'',
|
||||||
|
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
checkStrictly : 'true',
|
checkStrictly : 'true',
|
||||||
children: "childrens",
|
children: "childrens",
|
||||||
@ -411,10 +427,10 @@
|
|||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
userName: undefined,
|
userName: '',
|
||||||
phonenumber: undefined,
|
phonenumber: '',
|
||||||
status: undefined,
|
status: '',
|
||||||
deptId: undefined
|
deptId: ''
|
||||||
},
|
},
|
||||||
// 列信息
|
// 列信息
|
||||||
columns: [
|
columns: [
|
||||||
@ -520,12 +536,17 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
activecilck(data){
|
activecilck(data){
|
||||||
// console.log('点树',data)
|
console.log('点树',data)
|
||||||
|
|
||||||
|
// 点击树之后
|
||||||
|
this.queryParams.deptId = data.id
|
||||||
|
this.deptType = data.deptType
|
||||||
|
// 新增节点
|
||||||
if(this.activeName == 'info'){
|
if(this.activeName == 'info'){
|
||||||
this.appedit(data.id,data.label)
|
this.appedit(data.id,data.label)
|
||||||
}
|
}
|
||||||
|
// 用户请求
|
||||||
if(this.activeName == 'list'){
|
if(this.activeName == 'list'){
|
||||||
this.queryParams.deptId = data.id
|
|
||||||
this.getList();
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -537,7 +558,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleChange(value) {
|
handleChange(value) {
|
||||||
// console.log(value);
|
console.log(value);
|
||||||
},
|
},
|
||||||
handleChanges(value) {
|
handleChanges(value) {
|
||||||
// console.log('层级',value,this.cascader);
|
// console.log('层级',value,this.cascader);
|
||||||
@ -599,19 +620,48 @@
|
|||||||
//树形页操作
|
//树形页操作
|
||||||
//新增树
|
//新增树
|
||||||
append(data) {
|
append(data) {
|
||||||
// console.log('新增',data)
|
console.log('新增',data)
|
||||||
|
// 清除表单
|
||||||
|
this.cleanRuleForm()
|
||||||
this.activeName = 'info'
|
this.activeName = 'info'
|
||||||
this.pdinfo = 1
|
this.pdinfo = 1
|
||||||
|
|
||||||
|
this.addNode(data.id,data.label)
|
||||||
// console.log(this.pdinfo)
|
// console.log(this.pdinfo)
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
|
// 新增树
|
||||||
|
},
|
||||||
|
cleanRuleForm() {
|
||||||
|
this.ruleForm= {
|
||||||
|
parentId:'',
|
||||||
|
deptType:'1',
|
||||||
|
status:'qy',
|
||||||
|
leader_name:'',
|
||||||
|
leader_phone:'',
|
||||||
|
// parentName:'请先选择父级节点',
|
||||||
|
deptName: '',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 新增数据
|
||||||
|
addNode(id,label) {
|
||||||
|
// 默认类型
|
||||||
|
let _this = this
|
||||||
|
// _this.ruleForm.deptType = '1'
|
||||||
|
// 点击树获取部门信息
|
||||||
|
Userlist(id).then(res=>{
|
||||||
|
this.parentName = res.data.parentName
|
||||||
|
this.ruleForm.parentId = res.data.parentId
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
//修改树
|
//修改树
|
||||||
appedit(id,label) {
|
appedit(id,label) {
|
||||||
this.pdinfo = 2
|
this.pdinfo = 2
|
||||||
|
// 点击树获取部门信息
|
||||||
Userlist(id).then(res=>{
|
Userlist(id).then(res=>{
|
||||||
let ancestors = res.data.ancestors.slice(2).toString();
|
let ancestors = res.data.ancestors.slice(2).toString();
|
||||||
// console.log('Userlist:',res)
|
console.log('Userlist:',res)
|
||||||
this.parentName = res.data.parentName
|
this.parentName = res.data.parentName
|
||||||
this.ruleForm.parentId = res.data.parentId
|
this.ruleForm.parentId = res.data.parentId
|
||||||
this.ruleForm.status = res.data.status
|
this.ruleForm.status = res.data.status
|
||||||
@ -677,18 +727,27 @@
|
|||||||
</span>);
|
</span>);
|
||||||
},
|
},
|
||||||
/** 查询用户列表 */
|
/** 查询用户列表 */
|
||||||
getList() {
|
async getList() {
|
||||||
|
console.log("123123123",this.form)
|
||||||
|
await deptTreeSelect().then(response => {
|
||||||
|
this.Thetree = response.data
|
||||||
|
if(this.Thetree.length>0 && !this.queryParams.deptId) {
|
||||||
|
this.queryParams.deptId = this.Thetree[0].id
|
||||||
|
this.form.deptType = this.Thetree[0].deptType
|
||||||
|
console.log("this.Thetree",this.Thetree[0])
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
// this.addDateRange(this.queryParams, this.dateRange)
|
||||||
|
listUser(this.queryParams).then(response => {
|
||||||
this.userList = response.data.records;
|
this.userList = response.data.records;
|
||||||
// console.log(response.data)
|
this.total = response.data.total;
|
||||||
this.total = response.data.total;
|
this.total = response.data.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
deptTreeSelect().then(response => {
|
|
||||||
this.Thetree = response.data
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
},
|
||||||
// getStaffList() {
|
// getStaffList() {
|
||||||
@ -724,13 +783,32 @@
|
|||||||
// 用户状态修改
|
// 用户状态修改
|
||||||
handleStatusChange(row) {
|
handleStatusChange(row) {
|
||||||
let text = row.status === "0" ? "启用" : "停用";
|
let text = row.status === "0" ? "启用" : "停用";
|
||||||
this.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?').then(function () {
|
this.$modal.confirm('确认要"' + text + '""' + row.realName + '"用户吗?').then(function () {
|
||||||
return changeUserStatus(row.userId, row.status);
|
return changeUserStatus(row.userId, row.status);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$modal.msgSuccess(text + "成功");
|
this.$modal.msgSuccess(text + "成功");
|
||||||
}).catch(function () {
|
}).catch(function () {
|
||||||
row.status = row.status === "0" ? "1" : "0";
|
row.status = row.status === "0" ? "1" : "0";
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// scope.row.accountStatus
|
||||||
|
|
||||||
|
// this.$confirm('确认要"' + text + '""' + row.realName + '"用户吗?', '提示', {
|
||||||
|
// confirmButtonText: '确定',
|
||||||
|
// cancelButtonText: '取消',
|
||||||
|
// type: 'warning'
|
||||||
|
// }).then(() => {
|
||||||
|
// changeUserStatus(row.userId, row.status).then(res=>{
|
||||||
|
// this.$message({
|
||||||
|
// type: 'success',
|
||||||
|
// message: text+'成功!'
|
||||||
|
// });
|
||||||
|
// })
|
||||||
|
// }).catch(() => {
|
||||||
|
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
@ -763,10 +841,13 @@
|
|||||||
status: "0",
|
status: "0",
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
postIds: [],
|
postIds: [],
|
||||||
roleIds: []
|
// roleIds: []
|
||||||
|
roleIds: ''
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.queryParams.pageNum = 1;
|
this.queryParams.pageNum = 1;
|
||||||
@ -782,7 +863,8 @@
|
|||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.userId);
|
// this.ids = selection.map(item => item.userId);
|
||||||
|
this.ids = selection.map(item => item.acctId);
|
||||||
this.single = selection.length != 1;
|
this.single = selection.length != 1;
|
||||||
this.multiple = !selection.length;
|
this.multiple = !selection.length;
|
||||||
},
|
},
|
||||||
@ -802,22 +884,38 @@
|
|||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.open = true
|
this.open = true
|
||||||
|
this.title = "新增用户"
|
||||||
|
this.resetForm()
|
||||||
|
|
||||||
|
console.log("this.form",this.form)
|
||||||
|
|
||||||
jklist().then(res=>{
|
jklist().then(res=>{
|
||||||
console.log(res)
|
this.rolelist = res.data.content
|
||||||
this.rolelist = res.data.records
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
resetForm () {
|
||||||
|
this.form= {
|
||||||
|
accountName:'',
|
||||||
|
password:'',
|
||||||
|
accountStatus:1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
// console.log(row)
|
console.log('修改用户信息',row)
|
||||||
|
this.title = '修改用户信息'
|
||||||
const app = this;
|
const app = this;
|
||||||
app.reset();
|
app.reset();
|
||||||
app.open = true;
|
app.open = true;
|
||||||
app.form = row
|
app.form = row
|
||||||
|
|
||||||
|
app.form.roleIds = Number(app.form.roleIds);
|
||||||
|
|
||||||
|
app.form.password1 = row.password
|
||||||
jklist().then(res=>{
|
jklist().then(res=>{
|
||||||
console.log(res)
|
console.log(res)
|
||||||
this.rolelist = res.data.records
|
this.rolelist = res.data.content
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@ -825,7 +923,7 @@
|
|||||||
},
|
},
|
||||||
/** 重置密码按钮操作 */
|
/** 重置密码按钮操作 */
|
||||||
handleResetPwd(row) {
|
handleResetPwd(row) {
|
||||||
this.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
|
this.$prompt('请输入"' + row.realName + '"的新密码', "提示", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
closeOnClickModal: false,
|
closeOnClickModal: false,
|
||||||
@ -847,7 +945,7 @@
|
|||||||
submitForm: function () {
|
submitForm: function () {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.form.roleIds = [this.form.roleIds]
|
// this.form.roleIds = [this.form.roleIds]
|
||||||
if (this.form.userId !== undefined) {
|
if (this.form.userId !== undefined) {
|
||||||
updateUser(this.form).then(response => {
|
updateUser(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
@ -855,6 +953,8 @@
|
|||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
this.form.deptId = this.queryParams.deptId
|
||||||
|
this.form.deptType = this.deptType
|
||||||
addUser(this.form).then(response => {
|
addUser(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
@ -864,10 +964,22 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getCodeByRole(value) {
|
||||||
|
console.log("value",value)
|
||||||
|
this.rolelist.forEach(res => {
|
||||||
|
if (res.id == value) {
|
||||||
|
this.form.code = res.code
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log("value22",this.form.code)
|
||||||
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const userIds = row.userId || this.ids;
|
// const userIds = row.userId || this.ids;
|
||||||
this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function () {
|
const userIds = row.acctId || this.ids;
|
||||||
|
// this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function () {
|
||||||
|
this.$modal.confirm('是否确认删除"' + row.realName + '"的数据项?').then(function () {
|
||||||
return delUser(userIds);
|
return delUser(userIds);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
|
@ -10,55 +10,230 @@
|
|||||||
<!-- <img src="../../assets/images/wl.png" style="width: 96px; height: 96px">-->
|
<!-- <img src="../../assets/images/wl.png" style="width: 96px; height: 96px">-->
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<div class="block"><el-avatar shape="square" :size="96" :src="squareUrl"></el-avatar></div>
|
<div class="block">
|
||||||
|
<el-avatar shape="square" :size="96" :key="fullImagePath" :src="fullImagePath">
|
||||||
|
|
||||||
|
</el-avatar>
|
||||||
|
</div>
|
||||||
<div style="width: 100%">
|
<div style="width: 100%">
|
||||||
<div class="dis-box" style="align-items: center;cursor: pointer;margin-bottom: 20px">
|
<div class="dis-box" style="align-items: center;cursor: pointer;margin-bottom: 20px">
|
||||||
<div class="title">{{from.name}}</div>
|
<div class="title">{{from.name}}</div>
|
||||||
<div class="lansiez">编辑油站</div>
|
<div class="lansiez" @click="editInfo()">编辑油站</div>
|
||||||
|
<div class="lansiez" @click="enterThePetrolStation()">进入油站</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="wrap-box">
|
<div class="wrap-box">
|
||||||
<div class="threebox">
|
<div class="threebox">
|
||||||
<div>油站状态:</div>
|
<div>油站状态:</div>
|
||||||
<div> <el-tag type="success">正常</el-tag></div>
|
<div v-if="from.status === 'qy'">
|
||||||
|
<el-tag type="success">正常</el-tag>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<el-tag type="danger">停用</el-tag>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="threebox">
|
||||||
|
<div>油站联系人:</div>
|
||||||
|
<div>{{ seeFrom.contact }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="threebox">
|
||||||
|
<div>油站联系方式:</div>
|
||||||
|
<div>{{ seeFrom.phone }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="threebox">
|
<div class="threebox">
|
||||||
<div>油站ID:</div>
|
<div>油站ID:</div>
|
||||||
<div>999</div>
|
<div>{{ seeFrom.id }}</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="threebox">-->
|
|
||||||
<!-- <div>所属用户:</div>-->
|
|
||||||
<!-- <div class="lansiez">编辑</div>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<div class="threebox">
|
<div class="threebox">
|
||||||
<div>油站创建时间:</div>
|
<div>油站创建时间:</div>
|
||||||
<div>2023</div>
|
<div>{{ parseTime(seeFrom.createTime) }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="threebox">
|
<div class="threebox">
|
||||||
<div>套餐到期时间:</div>
|
<div>套餐到期时间:</div>
|
||||||
<div>3023</div>
|
<div>{{ from.expirationTime?parseTime(seeFrom.expirationTime):"--" }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="threebox">
|
<div class="threebox">
|
||||||
<div>所属套餐:</div>
|
<div>地址:</div>
|
||||||
<div>vip</div>
|
<div>{{ seeFrom.address }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="threebox">
|
|
||||||
<div>最后登录时间:</div>
|
|
||||||
<div>2023</div>
|
|
||||||
</div>
|
|
||||||
<div class="threebox">
|
|
||||||
<div>所属区域:</div>
|
|
||||||
<div>山东</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="bottom-box2">
|
||||||
|
|
||||||
|
<div style="height: 200px;">
|
||||||
|
<span class="demonstration" >营业执照</span>
|
||||||
|
<el-image :src="imagePath+from.license" style="margin-top: 10px;"></el-image>
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom-box">
|
|
||||||
|
<div style="height: 200px; margin-left: 100px;">
|
||||||
|
<span class="demonstration">门头照</span>
|
||||||
|
<el-image :src="imagePath+from.doorstepPhoto[0]" style="margin-top: 10px;"></el-image>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="bottom-box">
|
||||||
<div class="bott-box"><el-tag type="info">返回</el-tag></div>
|
<div class="bott-box"><el-tag type="info">返回</el-tag></div>
|
||||||
<div class="bott-box"><el-tag>保存</el-tag></div>
|
<div class="bott-box"><el-tag>保存</el-tag></div>
|
||||||
<div class="bott-box"><el-tag type="danger">删除油站</el-tag></div>
|
<div class="bott-box"><el-tag type="danger">删除油站</el-tag></div>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
<el-dialog title="编辑油站" :visible.sync="editDialog" width="900px" style="padding-right: 10px;">
|
||||||
|
<el-form :model="from" ref="form" :rules="rules">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="10">
|
||||||
|
<el-form-item label="油站名称" prop="name" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="from.name" autocomplete="off" style="width:220px"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="油站联系人" prop="contact" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="from.contact" autocomplete="off" style="width:220px"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="10">
|
||||||
|
<el-form-item label="上传头像" prop="name" :label-width="formLabelWidth">
|
||||||
|
<el-upload
|
||||||
|
:action="uploadAction"
|
||||||
|
list-type="picture-card"
|
||||||
|
:class="{hide:hideUpload}"
|
||||||
|
:file-list="uploadFiles"
|
||||||
|
:auto-upload="true"
|
||||||
|
:show-file-list="false"
|
||||||
|
:headers="uploadHeader"
|
||||||
|
:on-success="handleUploadSuccessLogo">
|
||||||
|
<img
|
||||||
|
v-if="this.from.logo"
|
||||||
|
:src="imagePath + this.from.logo"
|
||||||
|
class="list-img"
|
||||||
|
/>
|
||||||
|
<i v-if="!this.from.logo" class="el-icon-plus"></i>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="10">
|
||||||
|
<el-form-item label="联系电话" prop="phone" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="from.phone" autocomplete="off" style="width:220px"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="10">
|
||||||
|
<el-form-item label="套餐到期时间" prop="expirationTime" :label-width="formLabelWidth">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="from.expirationTime"
|
||||||
|
type="date"
|
||||||
|
style="width:220px"
|
||||||
|
placeholder="选择日期">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="10">
|
||||||
|
<el-form-item label="店铺地址" prop="address" :label-width="formLabelWidth">
|
||||||
|
<el-input
|
||||||
|
style="width:220px"
|
||||||
|
|
||||||
|
type="textarea"
|
||||||
|
:rows="2"
|
||||||
|
placeholder="请输入地址"
|
||||||
|
v-model="from.address">
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="10">
|
||||||
|
<el-form-item label="油站状态" prop="status" :label-width="formLabelWidth">
|
||||||
|
<el-switch
|
||||||
|
v-model="from.status"
|
||||||
|
@change="getswitch"
|
||||||
|
active-value="qy"
|
||||||
|
inactive-value="jy"
|
||||||
|
></el-switch>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="上传营业执照" prop="name" :label-width="formLabelWidth">
|
||||||
|
<el-upload
|
||||||
|
:action="uploadAction"
|
||||||
|
list-type="picture-card"
|
||||||
|
:class="{hide:hideUpload}"
|
||||||
|
:file-list="uploadFiles"
|
||||||
|
:auto-upload="true"
|
||||||
|
:show-file-list="false"
|
||||||
|
:headers="uploadHeader"
|
||||||
|
:on-success="handleUploadSuccessLicence">
|
||||||
|
<img
|
||||||
|
v-if="this.from.license"
|
||||||
|
:src="imagePath + this.from.license"
|
||||||
|
class="list-img"
|
||||||
|
/>
|
||||||
|
<i v-if="!this.from.license" class="el-icon-plus"></i>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
|
||||||
|
<el-col :span="18">
|
||||||
|
<el-form-item label="上传门头照" prop="name" :label-width="formLabelWidth">
|
||||||
|
<el-upload
|
||||||
|
:action="uploadAction"
|
||||||
|
list-type="picture-card"
|
||||||
|
:class="{hide:hideUpload}"
|
||||||
|
|
||||||
|
:file-list="uploadImages"
|
||||||
|
:headers="uploadHeader"
|
||||||
|
:auto-upload="true"
|
||||||
|
:on-preview="handlePictureCardPreview"
|
||||||
|
:on-success="handleUploadSuccessGift"
|
||||||
|
style="height: 100px;"
|
||||||
|
:on-remove="handleRemove"
|
||||||
|
:before-upload="beforeUpload"
|
||||||
|
>
|
||||||
|
<i class="el-icon-plus"></i>
|
||||||
|
</el-upload>
|
||||||
|
<el-dialog :visible.sync="dialogVisible">
|
||||||
|
<img width="100%" :src="dialogImageUrl" alt="">
|
||||||
|
</el-dialog>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="editDialog = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click=" edit">确 定</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
<el-dialog title="收货地址" :visible.sync="dialogFormVisible">
|
<el-dialog title="收货地址" :visible.sync="dialogFormVisible">
|
||||||
<el-form :model="form">
|
<el-form :model="form">
|
||||||
@ -81,17 +256,74 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Storelist, Storedetails } from "@/api/service/service";
|
import { Storelist, Storedetails,getStoreInfo,editStoreInfoApi,singleSignOnApi } from "@/api/service/service";
|
||||||
|
import { parseTime } from "@/utils/fuint";
|
||||||
|
import BigNumber from 'bignumber.js';
|
||||||
|
import { getToken } from '@/utils/auth'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'index',
|
name: 'index',
|
||||||
props: ["id"],
|
props: ["id"],
|
||||||
data(){
|
data(){
|
||||||
return{
|
return{
|
||||||
from:{},
|
dataForm:{coverImage:''},
|
||||||
|
// 上传地址
|
||||||
|
uploadAction: process.env.VUE_APP_SERVER_URL + 'backendApi/file/upload',
|
||||||
|
uploadHeader: { 'Access-Token' : getToken() },
|
||||||
|
// 隐藏上传
|
||||||
|
hideUpload: false,
|
||||||
|
// 上传文件列表
|
||||||
|
uploadFiles: [
|
||||||
|
{
|
||||||
|
name:"nihao",
|
||||||
|
url:'http://localhost:8008/static/uploadImages/20231103/ffbbe7d3ee1441fdaf706802fa0f176a.png'}
|
||||||
|
],
|
||||||
|
imagePath: process.env.VUE_APP_SERVER_URL,
|
||||||
|
|
||||||
|
// 多文件上传
|
||||||
|
uploadImages: [],
|
||||||
|
dialogImageUrl: "",
|
||||||
|
dialogVisible: false,
|
||||||
|
hideUpload: false,
|
||||||
|
|
||||||
|
from:{
|
||||||
|
name: '',
|
||||||
|
status:'',
|
||||||
|
expirationTime:'',
|
||||||
|
address:'',
|
||||||
|
contact:'',
|
||||||
|
phone:'',
|
||||||
|
logo:'',
|
||||||
|
license:'',
|
||||||
|
doorstepPhoto:[],
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
seeFrom:{
|
||||||
|
name: '',
|
||||||
|
status:'',
|
||||||
|
expirationTime:'',
|
||||||
|
address:'',
|
||||||
|
contact:'',
|
||||||
|
phone:'',
|
||||||
|
logo:'',
|
||||||
|
license:'',
|
||||||
|
doorstepPhoto:[],
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
squareUrl: "https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png",
|
squareUrl: "https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png",
|
||||||
dialogFormVisible: false,
|
dialogFormVisible: false,
|
||||||
|
editDialog: false,
|
||||||
|
baseUrl: process.env.VUE_APP_SERVER_URL,
|
||||||
form: {
|
form: {
|
||||||
name: '',
|
name: '',
|
||||||
|
status:'',
|
||||||
|
expirationTime:'',
|
||||||
|
address:'',
|
||||||
|
contact:'',
|
||||||
|
phone:'',
|
||||||
region: '',
|
region: '',
|
||||||
date1: '',
|
date1: '',
|
||||||
date2: '',
|
date2: '',
|
||||||
@ -100,24 +332,173 @@
|
|||||||
resource: '',
|
resource: '',
|
||||||
desc: ''
|
desc: ''
|
||||||
},
|
},
|
||||||
formLabelWidth: '120px'
|
formLabelWidth: '120px',
|
||||||
|
|
||||||
|
|
||||||
|
rules: {
|
||||||
|
name: [
|
||||||
|
{ required: true, message: '油站名称不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
contact: [
|
||||||
|
{ required: true, message: '油站联系人不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
phone: [
|
||||||
|
{ required: true, message: '联系人电话不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
|
||||||
|
expirationTime: [
|
||||||
|
{ type: 'date', required: true, message: '请选择套餐到期时间', trigger: 'change' }
|
||||||
|
],
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
fullImagePath() {
|
||||||
|
return this.imagePath + this.from.logo;
|
||||||
|
}
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
},
|
||||||
|
created() {
|
||||||
this.getindex()
|
this.getindex()
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
editInfo() {
|
||||||
|
this.editDialog = true
|
||||||
|
},
|
||||||
|
// 修改
|
||||||
|
edit: function () {
|
||||||
|
this.$refs["form"].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.from.expirationTime = Date.parse(this.from.expirationTime);
|
||||||
|
this.from.doorstepPhoto = JSON.stringify(this.from.doorstepPhoto);
|
||||||
|
// this.from.expirationTime = new Date(this.from.expirationTime).toLocaleString('en-US', { timeZone: 'UTC' });
|
||||||
|
|
||||||
|
editStoreInfoApi(this.from).then(res=>{
|
||||||
|
if(res.code = 200){
|
||||||
|
|
||||||
|
}
|
||||||
|
this.getindex()
|
||||||
|
})
|
||||||
|
this.editDialog = false
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
getindex(){
|
getindex(){
|
||||||
if(this.id){
|
if(this.id){
|
||||||
Storedetails(this.id).then(res=>{
|
Storedetails(this.id).then(res=>{
|
||||||
console.log('详情',res)
|
if (res.code == 200) {
|
||||||
this.from = res.data
|
this.from = res.data
|
||||||
|
this.seeFrom = res.data
|
||||||
|
this.uploadImages = []
|
||||||
|
if (res.data.doorstepPhoto) {
|
||||||
|
this.from.doorstepPhoto = JSON.parse(res.data.doorstepPhoto);
|
||||||
|
this.from.doorstepPhoto.forEach(res=> {
|
||||||
|
let newImage = {
|
||||||
|
url: this.baseUrl+res,
|
||||||
|
fileName: res
|
||||||
|
}
|
||||||
|
this.uploadImages.push(newImage);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.$forceUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
}else {
|
}else {
|
||||||
console.log('没有id',this.id)
|
console.log('没有id',this.id)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
enterThePetrolStation() {
|
||||||
|
|
||||||
|
let number = new BigNumber(this.id)
|
||||||
|
number = number.plus(1.4)
|
||||||
|
number = number.times(2.1);
|
||||||
|
|
||||||
|
// let id = (this.id + 1.4) * 2.1
|
||||||
|
singleSignOnApi(number.toString()).then(res=>{
|
||||||
|
window.open('http://localhost:82/index?entrance='+number.toString())
|
||||||
|
// '_blank');
|
||||||
|
|
||||||
|
})
|
||||||
|
// 在token+入
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 上传封面
|
||||||
|
handleUploadSuccessLogo(file) {
|
||||||
|
this.from.logo = file.data.fileName;
|
||||||
|
},
|
||||||
|
handleUploadSuccessLicence(file) {
|
||||||
|
this.from.license = file.data.fileName;
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 上传门头照
|
||||||
|
// 上传详情图
|
||||||
|
handleUploadSuccessGift(file) {
|
||||||
|
let newImage = {
|
||||||
|
url: process.env.VUE_APP_SERVER_URL + file.data.fileName,
|
||||||
|
fileName: file.data.fileName
|
||||||
|
}
|
||||||
|
if (this.uploadImages == undefined) {
|
||||||
|
this.uploadImages = [];
|
||||||
|
|
||||||
|
}
|
||||||
|
this.uploadImages.push(newImage);
|
||||||
|
this.from.doorstepPhoto.push(file.data.fileName);
|
||||||
|
this.$forceUpdate()
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
handleRemove(file, fileList) {
|
||||||
|
this.$forceUpdate()
|
||||||
|
|
||||||
|
this.hideUpload = true
|
||||||
|
console.log("qweqweqe",this.hideUpload)
|
||||||
|
this.uploadImages.forEach((image, index) => {
|
||||||
|
if (file.url === image.url) {
|
||||||
|
this.uploadImages.splice(index, 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.from.doorstepPhoto.forEach((image, index) => {
|
||||||
|
if (file.fileName == image) {
|
||||||
|
this.from.doorstepPhoto.splice(index, 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handlePictureCardPreview(file) {
|
||||||
|
console.log(file);
|
||||||
|
this.dialogImageUrl = file.url;
|
||||||
|
this.dialogVisible = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
beforeUpload(file) {
|
||||||
|
this.hideUpload = true
|
||||||
|
|
||||||
|
// Check if the number of files exceeds 3
|
||||||
|
if (this.uploadImages.length >= 3) {
|
||||||
|
this.$message.warning('You can only upload up to three images.');
|
||||||
|
return false; // Cancel upload
|
||||||
|
}
|
||||||
|
return true; // Continue with the upload
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
getswitch(value) {
|
||||||
|
console.log(value)
|
||||||
},
|
},
|
||||||
handleClick(tab, event) {
|
handleClick(tab, event) {
|
||||||
console.log(tab, event);
|
console.log(tab, event);
|
||||||
@ -167,6 +548,22 @@
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.bottom-box2{
|
||||||
|
width: 1400px;
|
||||||
|
/* position: absolute;
|
||||||
|
bottom: 0px; */
|
||||||
|
margin-top: 30px;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
height: 350px;
|
||||||
|
background: rgb(255, 255, 255);
|
||||||
|
/* background-color: #006cff; */
|
||||||
|
display: flex;
|
||||||
|
/* align-items: center; */
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
.bottom-box{
|
.bottom-box{
|
||||||
width: 1600px;
|
width: 1600px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -185,4 +582,47 @@
|
|||||||
.block{
|
.block{
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* 上传头像 */
|
||||||
|
.list-img{
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.d-dialog >>> .el-upload--picture-card {
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
line-height: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.d-dialog >>> .avatar-uploader .el-upload {
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
.d-dialog >>> .el-upload-list--picture-card .el-upload-list__item {
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
.common-dialog >>> .el-upload--picture-card {
|
||||||
|
width: 60px;
|
||||||
|
height: 50px;
|
||||||
|
line-height: 60px;
|
||||||
|
}
|
||||||
|
.hide {
|
||||||
|
/deep/.el-upload--picture-card {
|
||||||
|
display: none !important;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* //去掉过渡动画,不然删除操作的时候,布局会闪一下。 */
|
||||||
|
|
||||||
|
/deep/ .el-upload-list__item {
|
||||||
|
transition: none !important
|
||||||
|
|
||||||
|
}
|
||||||
</style>
|
</style>
|
430
fuintAdmin_zt/src/views/components/Service/payment.vue
Normal file
430
fuintAdmin_zt/src/views/components/Service/payment.vue
Normal file
@ -0,0 +1,430 @@
|
|||||||
|
<template>
|
||||||
|
<div class="box-centenr">
|
||||||
|
<div style="width: 100%;display: flex">
|
||||||
|
<el-alert
|
||||||
|
title="说明"
|
||||||
|
type="error"
|
||||||
|
description="为了保证加油站商户日常在线支付业务的稳定性,油客里里目前支持多通道支付
|
||||||
|
可以有效的避免单支付通道带来不稳定性,从而造成油站不能正常支付问题
|
||||||
|
加油站一旦出现不能正常支付的情况,可以随时手工切换支付通道,来保证加油站支付收款业务"
|
||||||
|
:closable="false"
|
||||||
|
>
|
||||||
|
</el-alert>
|
||||||
|
|
||||||
|
<div style="width: 150%;display: flex;justify-content: right">
|
||||||
|
<div class="mingc">功能状态</div>
|
||||||
|
<el-switch
|
||||||
|
v-model="value1"
|
||||||
|
@change="changeStatus1"
|
||||||
|
>
|
||||||
|
</el-switch>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="content-box">
|
||||||
|
<!-- <el-card class="box-card" shadow="hover" v-for="(item,index) in 10" :key="index">-->
|
||||||
|
<!-- <div slot="header" class="clearfix">-->
|
||||||
|
<!-- <span>卡片名称</span>-->
|
||||||
|
<!-- <el-button style="float: right; padding: 3px 0" type="text">切换为当前通道</el-button>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- <div>商户编号:1861975</div>-->
|
||||||
|
<!-- </el-card>-->
|
||||||
|
<el-card class="box-card" shadow="hover" v-for="item in merchantList" :key="item.id">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>{{ item.merchantName }}</span>
|
||||||
|
<el-button v-if="item.isUse=='0'"
|
||||||
|
@click="editStatus(item,1)"
|
||||||
|
style="float: right; padding: 3px 0" type="text">切换为当前通道</el-button>
|
||||||
|
<el-tag v-else effect="dark" type="success" style="float: right">当前使用中</el-tag>
|
||||||
|
</div>
|
||||||
|
<div>商户编号:{{ item.mchntCd }}</div>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
<el-divider></el-divider>
|
||||||
|
<div class="cont-box">
|
||||||
|
<div style="width: 40%">
|
||||||
|
<el-alert
|
||||||
|
title="使用说明"
|
||||||
|
type="error"
|
||||||
|
description="添加/编辑对应的规则->规则配置正常->发布规则->规则生效
|
||||||
|
注意:功能状态启用且通道规则发布生效后当前功能才有效,否则使用系统单商户号模式"
|
||||||
|
:closable="false"
|
||||||
|
>
|
||||||
|
</el-alert>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="display: flex;align-items: center">
|
||||||
|
<div class="mingc">规则周期</div>
|
||||||
|
<el-radio-group v-model="labelPosition" @input="ruleCycle == labelPosition" size="small">
|
||||||
|
<el-radio-button label="permanent">永久</el-radio-button>
|
||||||
|
<el-radio-button label="singleDay">单日</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
<div class="mingc">功能状态</div>
|
||||||
|
<el-switch
|
||||||
|
v-model="value"
|
||||||
|
@change="changeStatus"
|
||||||
|
>
|
||||||
|
</el-switch>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="cont-box" >
|
||||||
|
<div><el-button type="primary" icon="el-icon-plus" @click="addOil">添加规则</el-button></div>
|
||||||
|
<div><el-button type="success" icon="el-icon-s-promotion" @click="open">发布规则</el-button></div>
|
||||||
|
</div>
|
||||||
|
<div class="hangbox" v-for="(item,index) in oilConfigList" :key="item.id">
|
||||||
|
<div>{{index + 1}}.通道</div>
|
||||||
|
<div class="jiaong">{{ item.merchantName }}</div>
|
||||||
|
<div> 商户号 </div>
|
||||||
|
<div class="jiaong">{{ item.mchntCd }}</div>
|
||||||
|
<!-- <div> 交易满 </div>-->
|
||||||
|
<div> 交易占比 </div>
|
||||||
|
<div class="jiaong"> {{ item.proportion }} </div>
|
||||||
|
<div style="margin-right: 20px"> %更换支付通道 </div>
|
||||||
|
<!-- <div class="jiaong"> 参与次数不固定次数 </div>-->
|
||||||
|
|
||||||
|
<el-button type="primary" icon="el-icon-edit" @click="editOilConfig(item.id)">编辑</el-button>
|
||||||
|
<el-button type="danger" icon="el-icon-close" @click="deleteOilConfig(item.id)">删除</el-button>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="hangbox" v-for="(item,index) in 3" :key="index">-->
|
||||||
|
<!-- <div>{{index + 1}}.通道</div>-->
|
||||||
|
<!-- <div class="jiaong"> 名称 </div>-->
|
||||||
|
<!-- <div> 商户号 </div>-->
|
||||||
|
<!-- <div class="jiaong"> 1231213213212</div>-->
|
||||||
|
<!--<!– <div> 交易满 </div>–>-->
|
||||||
|
<!-- <div> 交易占比 </div>-->
|
||||||
|
<!-- <div class="jiaong"> 2 </div>-->
|
||||||
|
<!-- <div> %更换支付通道 参与次数 </div>-->
|
||||||
|
<!-- <div class="jiaong"> 不固定次数 </div>-->
|
||||||
|
|
||||||
|
<!-- <el-button type="primary" icon="el-icon-edit">编辑</el-button>-->
|
||||||
|
<!-- <el-button type="danger" icon="el-icon-close">删除</el-button>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<div class="hsize">注:规则按照顺序进行处理并自动更换支付通道,新增或变更规则后需要发布当前规则才生效,发布生效后的规则将从序号1的配置生效</div>
|
||||||
|
|
||||||
|
<!-- 编辑通道规则-->
|
||||||
|
<el-dialog title="编辑通道规则" :visible.sync="dialogFormVisible"
|
||||||
|
width="30%">
|
||||||
|
<el-form :model="form" ref="form">
|
||||||
|
|
||||||
|
<el-form-item label="支付通道" :label-width="formLabelWidth" width="300px">
|
||||||
|
<el-select v-model="form.merchConfigId"
|
||||||
|
@change="changeMerch"
|
||||||
|
:disabled="isDis" placeholder="请选择商户信息">
|
||||||
|
<el-option v-for="item in merchantList" :key="item.id"
|
||||||
|
:label="item.merchantName"
|
||||||
|
:value="item.id"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="商户号" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="form.mchntCd" disabled autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="交易占比" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="form.proportion" autocomplete="off">
|
||||||
|
<template slot="append">%</template>
|
||||||
|
</el-input>
|
||||||
|
<div>交易占比满足规则后切换到下一个支付通道</div>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="参与次数" :label-width="formLabelWidth">-->
|
||||||
|
<!-- <el-radio-group v-model="form.resource" >-->
|
||||||
|
<!-- <el-radio label="不固定次数"></el-radio>-->
|
||||||
|
<!-- <el-radio label="固定次数"></el-radio>-->
|
||||||
|
<!-- </el-radio-group>-->
|
||||||
|
<!-- <div>是否限制当前配置在生效期间内的参与次数</div>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
|
||||||
|
<!-- <el-form-item label="排序" :label-width="formLabelWidth">-->
|
||||||
|
<!-- <el-input-number v-model="form.num" controls-position="right" :min="1" :max="100"></el-input-number>-->
|
||||||
|
<!-- <div>数值越大顺序越在前</div>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="clearOil">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submitOilConfig">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {editMerchant, listMerchant} from "@/api/payConfig/merchantconfig";
|
||||||
|
import {
|
||||||
|
addOilConfig,
|
||||||
|
delOilConfig,
|
||||||
|
editOilConfig,
|
||||||
|
isOpenOilConfig,
|
||||||
|
listOilConfig,
|
||||||
|
oilConfigInfo
|
||||||
|
} from "@/api/payConfig/oilconfig";
|
||||||
|
import {addUser, getUserMobile, updateUser} from "@/api/staff/user/user";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'peizhi',
|
||||||
|
data(){
|
||||||
|
return{
|
||||||
|
// 是否禁用
|
||||||
|
isDis:false,
|
||||||
|
// 商户配置信息
|
||||||
|
merchantList:[],
|
||||||
|
// 商品规则配置信息
|
||||||
|
oilConfigList:[],
|
||||||
|
// 规则周期
|
||||||
|
ruleCycle:"singleDay",
|
||||||
|
form: {
|
||||||
|
name: '',
|
||||||
|
region: '',
|
||||||
|
date1: '',
|
||||||
|
date2: '',
|
||||||
|
num: 1,
|
||||||
|
delivery: false,
|
||||||
|
type: [],
|
||||||
|
resource: '',
|
||||||
|
desc: ''
|
||||||
|
},
|
||||||
|
formLabelWidth: '70px',
|
||||||
|
dialogFormVisible:false,
|
||||||
|
value:false,
|
||||||
|
value1:true,
|
||||||
|
labelPosition: 'singleDay',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
// 删除支付配置信息
|
||||||
|
deleteOilConfig(id){
|
||||||
|
this.$confirm('确认删除此通道规则吗?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
delOilConfig(id).then( response => {
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '规则数据删除成功'
|
||||||
|
});
|
||||||
|
this.getList();
|
||||||
|
this.value1 = true;
|
||||||
|
this.changeStatus1();
|
||||||
|
})
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
// 添加商户信息
|
||||||
|
addOil(){
|
||||||
|
this.dialogFormVisible = true;
|
||||||
|
this.form = {
|
||||||
|
name: '',
|
||||||
|
region: '',
|
||||||
|
date1: '',
|
||||||
|
date2: '',
|
||||||
|
num: 1,
|
||||||
|
delivery: false,
|
||||||
|
type: [],
|
||||||
|
resource: '',
|
||||||
|
desc: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 选择下拉商户信息
|
||||||
|
changeMerch(val){
|
||||||
|
this.merchantList.forEach(item => {
|
||||||
|
if (item.id == val){
|
||||||
|
this.form.mchntCd = item.mchntCd
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 提交按钮
|
||||||
|
submitOilConfig(){
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id) {
|
||||||
|
editOilConfig(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改会员成功");
|
||||||
|
this.getList();
|
||||||
|
this.dialogFormVisible = false;
|
||||||
|
this.isDis = false;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addOilConfig(this.form).then( response => {
|
||||||
|
if (response.data==0){
|
||||||
|
this.$modal.msgError("已存在当前通道商户号的规则");
|
||||||
|
}else {
|
||||||
|
this.$modal.msgSuccess("新增会员成功");
|
||||||
|
this.getList();
|
||||||
|
this.dialogFormVisible = false;
|
||||||
|
this.isDis = false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
clearOil(){
|
||||||
|
this.dialogFormVisible = false;
|
||||||
|
this.isDis = false;
|
||||||
|
},
|
||||||
|
// 修改支付配置信息
|
||||||
|
editOilConfig(id){
|
||||||
|
this.isDis = true;
|
||||||
|
this.dialogFormVisible = true;
|
||||||
|
oilConfigInfo(id).then( response => {
|
||||||
|
this.form = response.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 修改启用状态
|
||||||
|
changeStatus(){
|
||||||
|
if (this.value){
|
||||||
|
isOpenOilConfig({isOpen:1,ruleCycle:this.ruleCycle}).then( response => {
|
||||||
|
if (response.data!=1){
|
||||||
|
this.$message({
|
||||||
|
type: 'error',
|
||||||
|
message: '支付通道切换失败,请确保交易占比相加满足百分之百'
|
||||||
|
});
|
||||||
|
this.value = false;
|
||||||
|
this.value1 = true;
|
||||||
|
}else {
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '发布成功!'
|
||||||
|
});
|
||||||
|
this.value1 = false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else {
|
||||||
|
isOpenOilConfig({isOpen:0,ruleCycle:this.ruleCycle}).then( response => {
|
||||||
|
this.value1 = true;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
changeStatus1(){
|
||||||
|
if (this.value1){
|
||||||
|
isOpenOilConfig({isOpen:0,ruleCycle:this.ruleCycle}).then( response => {
|
||||||
|
this.value = false;
|
||||||
|
})
|
||||||
|
}else {
|
||||||
|
isOpenOilConfig({isOpen:1,ruleCycle:this.ruleCycle}).then( response => {
|
||||||
|
if (response.data!=1){
|
||||||
|
this.$message({
|
||||||
|
type: 'error',
|
||||||
|
message: '支付通道切换失败,请确保交易占比相加满足百分之百'
|
||||||
|
});
|
||||||
|
this.value = false;
|
||||||
|
this.value1 = true;
|
||||||
|
}else {
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '发布成功!'
|
||||||
|
});
|
||||||
|
this.value = true;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 修改商户使用状态
|
||||||
|
editStatus(data,isUse){
|
||||||
|
this.$confirm('确定将当前支付配置切换为商户号('+data.mchntCd+')吗?切换后实时生效!', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
data.isUse = isUse
|
||||||
|
editMerchant(data).then( response => {
|
||||||
|
this.getList();
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '支付通道切换成功,已实时切换为商户号('+data.mchntCd+')'
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
// 获取商户列表信息
|
||||||
|
getList(){
|
||||||
|
listMerchant().then( response => {
|
||||||
|
this.merchantList = response.data;
|
||||||
|
this.merchantList.forEach(item => {
|
||||||
|
if (item.isOpenRule == "1"){
|
||||||
|
this.value1 = false;
|
||||||
|
this.value = true;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
listOilConfig().then( response => {
|
||||||
|
this.oilConfigList = response.data;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
open() {
|
||||||
|
this.$confirm('此操作会发布件, 是否继续?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.value1 = false;
|
||||||
|
this.changeStatus1()
|
||||||
|
}).catch(() => {
|
||||||
|
this.$message({
|
||||||
|
type: 'info',
|
||||||
|
message: '已取消发布'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.box-centenr{
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
.content-box{
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
.box-card{
|
||||||
|
width: 24%;
|
||||||
|
margin-right: 15px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
.cont-box{
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin: 20px 0px;
|
||||||
|
}
|
||||||
|
.hangbox{
|
||||||
|
width: 100%;
|
||||||
|
border-bottom: 1px solid #f4f5f6;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 15px 0px;
|
||||||
|
}
|
||||||
|
.jiaong{
|
||||||
|
text-align: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 5px 20px;
|
||||||
|
background: #F2F6FC;
|
||||||
|
color: #409EFF;
|
||||||
|
font-weight: bold;
|
||||||
|
margin: 0px 5px;
|
||||||
|
border-radius: 4px;
|
||||||
|
|
||||||
|
}
|
||||||
|
.mingc{
|
||||||
|
margin: 0px 10px;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
.hsize{
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
@ -210,7 +210,7 @@
|
|||||||
GROUP BY
|
GROUP BY
|
||||||
date_range.date
|
date_range.date
|
||||||
ORDER BY
|
ORDER BY
|
||||||
date_range.date;
|
date_range.date
|
||||||
</select>
|
</select>
|
||||||
<!-- COUNT(*) AS count-->
|
<!-- COUNT(*) AS count-->
|
||||||
<!-- -- and store_id = #{storeId}-->
|
<!-- -- and store_id = #{storeId}-->
|
||||||
|
@ -9,6 +9,7 @@ import com.fuint.common.service.MerchantService;
|
|||||||
import com.fuint.common.service.SettingService;
|
import com.fuint.common.service.SettingService;
|
||||||
import com.fuint.business.store.service.StoreService;
|
import com.fuint.business.store.service.StoreService;
|
||||||
import com.fuint.common.util.CommonUtil;
|
import com.fuint.common.util.CommonUtil;
|
||||||
|
import com.fuint.common.util.RedisUtil;
|
||||||
import com.fuint.common.util.TokenUtil;
|
import com.fuint.common.util.TokenUtil;
|
||||||
import com.fuint.framework.exception.BusinessCheckException;
|
import com.fuint.framework.exception.BusinessCheckException;
|
||||||
import com.fuint.framework.pagination.PaginationRequest;
|
import com.fuint.framework.pagination.PaginationRequest;
|
||||||
@ -21,11 +22,15 @@ import com.fuint.utils.StringUtil;
|
|||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 店铺管理类controller
|
* 店铺管理类controller
|
||||||
@ -293,4 +298,37 @@ public class BackendStoreController extends BaseController {
|
|||||||
StoreDto storeInfo = storeService.queryStoreDtoById(id);
|
StoreDto storeInfo = storeService.queryStoreDtoById(id);
|
||||||
return getSuccessResult(storeInfo);
|
return getSuccessResult(storeInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改店铺信息
|
||||||
|
* @return
|
||||||
|
* @throws BusinessCheckException
|
||||||
|
*/
|
||||||
|
@PostMapping("editStoreInfo")
|
||||||
|
public ResponseObject editStoreInfo( @RequestBody MtStore mtStore) throws BusinessCheckException {
|
||||||
|
|
||||||
|
return getSuccessResult( storeService.editStoreInfo(mtStore));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public RedisTemplate redisTemplate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单点登陆时使用
|
||||||
|
*
|
||||||
|
* singleSignOn
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("singleSignOn")
|
||||||
|
public ResponseObject singleSignOn(@RequestBody String flag) {
|
||||||
|
redisTemplate.opsForValue().set(flag,flag,300, TimeUnit.SECONDS);
|
||||||
|
// Object codeInRedis = redisTemplate.opsForValue().get(flag);
|
||||||
|
Boolean aBoolean = redisTemplate.hasKey(flag);
|
||||||
|
return getSuccessResult(aBoolean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("loginVerification")
|
||||||
|
public ResponseObject loginVerification(@RequestBody String flag) {
|
||||||
|
return getSuccessResult(storeService.loginVerification(flag));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ import java.io.Serializable;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.fuint.repository.model.base.BaseEntity;
|
import com.fuint.repository.model.base.BaseEntity;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
@ -82,4 +83,7 @@ public class MtStore extends BaseEntity implements Serializable {
|
|||||||
|
|
||||||
@ApiModelProperty("门头照")
|
@ApiModelProperty("门头照")
|
||||||
private String doorstepPhoto;
|
private String doorstepPhoto;
|
||||||
|
@ApiModelProperty("服务到期时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
|
private Date expirationTime;
|
||||||
}
|
}
|
||||||
|
@ -23,4 +23,7 @@ public interface MtStoreMapper extends BaseMapper<MtStore> {
|
|||||||
|
|
||||||
List<StoreDistanceBean> queryByDistance(@Param("merchantId") Integer merchantId, @Param("keyword") String keyword, @Param("latitude") String latitude, @Param("longitude") String longitude);
|
List<StoreDistanceBean> queryByDistance(@Param("merchantId") Integer merchantId, @Param("keyword") String keyword, @Param("latitude") String latitude, @Param("longitude") String longitude);
|
||||||
|
|
||||||
|
int editStoreInfo(@Param("mtStore") MtStore mtStore);
|
||||||
|
|
||||||
|
// getAccountByRole
|
||||||
}
|
}
|
||||||
|
@ -25,4 +25,18 @@
|
|||||||
</if>
|
</if>
|
||||||
ORDER BY distance LIMIT 0,1000
|
ORDER BY distance LIMIT 0,1000
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<update id="editStoreInfo">
|
||||||
|
update mt_store
|
||||||
|
<set>
|
||||||
|
<if test="mtStore.name != null">name =#{mtStore.name}</if>
|
||||||
|
<if test="mtStore.address != null">address =#{mtStore.address}</if>
|
||||||
|
<if test="mtStore.expirationTime != null">expiration_time = #{vexpirationTime}</if>
|
||||||
|
<if test="mtStore.status != null"> status=#{mtStore.status}</if>
|
||||||
|
<if test="mtStore.logo != null"> logo=#{mtStore.logo}</if>
|
||||||
|
</set>
|
||||||
|
where id = #{mtStore.id}
|
||||||
|
|
||||||
|
</update>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -100,4 +100,8 @@ public interface StoreService extends IService<MtStore> {
|
|||||||
* @return
|
* @return
|
||||||
* */
|
* */
|
||||||
List<MtStore> queryByDistance(String merchantNo, String keyword, String latitude, String longitude) throws BusinessCheckException;
|
List<MtStore> queryByDistance(String merchantNo, String keyword, String latitude, String longitude) throws BusinessCheckException;
|
||||||
|
|
||||||
|
boolean editStoreInfo(MtStore mtStore);
|
||||||
|
|
||||||
|
Map<String,Object> loginVerification(String flag);
|
||||||
}
|
}
|
||||||
|
@ -1,30 +1,40 @@
|
|||||||
package com.fuint.business.store.service.impl;
|
package com.fuint.business.store.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.fuint.business.store.service.StoreService;
|
import com.fuint.business.store.service.StoreService;
|
||||||
|
import com.fuint.common.dto.AccountInfo;
|
||||||
import com.fuint.common.dto.StoreDto;
|
import com.fuint.common.dto.StoreDto;
|
||||||
import com.fuint.common.enums.StatusEnum;
|
import com.fuint.common.enums.StatusEnum;
|
||||||
import com.fuint.common.enums.YesOrNoEnum;
|
import com.fuint.common.enums.YesOrNoEnum;
|
||||||
import com.fuint.common.service.MerchantService;
|
import com.fuint.common.service.MerchantService;
|
||||||
|
import com.fuint.common.util.TokenUtil;
|
||||||
import com.fuint.framework.annoation.OperationServiceLog;
|
import com.fuint.framework.annoation.OperationServiceLog;
|
||||||
import com.fuint.framework.exception.BusinessCheckException;
|
import com.fuint.framework.exception.BusinessCheckException;
|
||||||
import com.fuint.framework.pagination.PaginationRequest;
|
import com.fuint.framework.pagination.PaginationRequest;
|
||||||
import com.fuint.framework.pagination.PaginationResponse;
|
import com.fuint.framework.pagination.PaginationResponse;
|
||||||
|
import com.fuint.module.backendApi.response.LoginResponse;
|
||||||
import com.fuint.repository.bean.StoreDistanceBean;
|
import com.fuint.repository.bean.StoreDistanceBean;
|
||||||
import com.fuint.repository.mapper.MtMerchantMapper;
|
import com.fuint.repository.mapper.MtMerchantMapper;
|
||||||
import com.fuint.business.store.mapper.MtStoreMapper;
|
import com.fuint.business.store.mapper.MtStoreMapper;
|
||||||
|
import com.fuint.repository.mapper.TAccountMapper;
|
||||||
import com.fuint.repository.model.MtMerchant;
|
import com.fuint.repository.model.MtMerchant;
|
||||||
import com.fuint.business.store.entity.MtStore;
|
import com.fuint.business.store.entity.MtStore;
|
||||||
|
import com.fuint.repository.model.TAccount;
|
||||||
import com.fuint.utils.StringUtil;
|
import com.fuint.utils.StringUtil;
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.apache.shiro.SecurityUtils;
|
||||||
|
import org.apache.shiro.authc.UsernamePasswordToken;
|
||||||
|
import org.apache.shiro.subject.Subject;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.domain.PageImpl;
|
import org.springframework.data.domain.PageImpl;
|
||||||
import org.springframework.data.domain.PageRequest;
|
import org.springframework.data.domain.PageRequest;
|
||||||
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@ -335,4 +345,101 @@ public class StoreServiceImpl extends ServiceImpl<MtStoreMapper, MtStore> implem
|
|||||||
|
|
||||||
return dataList;
|
return dataList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean editStoreInfo(MtStore mtStore) {
|
||||||
|
return mtStoreMapper.updateById(mtStore)>0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public RedisTemplate redisTemplate;
|
||||||
|
@Autowired
|
||||||
|
TAccountMapper tAccountMapper;
|
||||||
|
@Override
|
||||||
|
public Map<String,Object> loginVerification(String flag) {
|
||||||
|
Map<String,Object> res = new HashMap<>();
|
||||||
|
if (ObjectUtil.isEmpty(flag)){
|
||||||
|
res.put(flag,false);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
// if (redisTemplate.hasKey(flag)) {
|
||||||
|
if (true) {
|
||||||
|
|
||||||
|
|
||||||
|
// BigDecimal bigDecimal = new BigDecimal(flag);
|
||||||
|
// BigDecimal multiply = bigDecimal.divide(new BigDecimal("2.1")).multiply(new BigDecimal("1.4"));
|
||||||
|
|
||||||
|
// 使用 intValue() 将 BigDecimal 转换为整数
|
||||||
|
// int i = multiply.intValue();
|
||||||
|
// 找到站长的
|
||||||
|
Map<String, Object> param = new HashMap();
|
||||||
|
param.put("role_ids", 12);
|
||||||
|
List<TAccount> accountList = tAccountMapper.selectByMap(param);
|
||||||
|
|
||||||
|
if (accountList != null && accountList.size() > 0) {
|
||||||
|
AccountInfo accountByName = getAccountByName(accountList.get(0));
|
||||||
|
|
||||||
|
Subject subject = SecurityUtils.getSubject();
|
||||||
|
UsernamePasswordToken info = new UsernamePasswordToken(accountByName.getAccountName(), "111111");
|
||||||
|
// subject.login(info);
|
||||||
|
String token = TokenUtil.generateToken("user-agent", accountByName.getId());
|
||||||
|
accountByName.setToken(token);
|
||||||
|
TokenUtil.saveAccountToken(accountByName);
|
||||||
|
LoginResponse response = new LoginResponse();
|
||||||
|
response.setLogin(true);
|
||||||
|
response.setToken(token);
|
||||||
|
response.setTokenCreatedTime(new Date());
|
||||||
|
res.put("flag",true);
|
||||||
|
res.put("token",token);
|
||||||
|
}else {
|
||||||
|
res.put("flag",true);
|
||||||
|
res.put("token",null);
|
||||||
|
res.put("info","用户不存在");
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
// mtStoreMapper.getAccountByRole(12);
|
||||||
|
// 生成token
|
||||||
|
|
||||||
|
// 返回token
|
||||||
|
|
||||||
|
|
||||||
|
// redisTemplate.delete(flag);
|
||||||
|
return res;
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理
|
||||||
|
public AccountInfo getAccountByName(TAccount account) {
|
||||||
|
AccountInfo accountInfo = new AccountInfo();
|
||||||
|
// TAccount account = accountList.get(0);
|
||||||
|
accountInfo.setId(account.getAcctId());
|
||||||
|
accountInfo.setAccountName(account.getAccountName());
|
||||||
|
accountInfo.setRealName(account.getRealName());
|
||||||
|
accountInfo.setRoleIds(account.getRoleIds());
|
||||||
|
accountInfo.setStaffId(account.getStaffId());
|
||||||
|
accountInfo.setStoreId(account.getStoreId());
|
||||||
|
accountInfo.setMerchantId(account.getMerchantId());
|
||||||
|
accountInfo.setDeptId(account.getDeptId());
|
||||||
|
if (account.getMerchantId() != null && account.getMerchantId() > 0) {
|
||||||
|
MtMerchant mtMerchant = mtMerchantMapper.selectById(account.getMerchantId());
|
||||||
|
if (mtMerchant != null) {
|
||||||
|
accountInfo.setMerchantName(mtMerchant.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (account.getStoreId() != null && account.getStoreId() >= 0) {
|
||||||
|
MtStore mtStore = mtStoreMapper.selectById(account.getStoreId());
|
||||||
|
if (mtStore != null) {
|
||||||
|
accountInfo.setStoreName(mtStore.getName());
|
||||||
|
accountInfo.setChainStoreId(mtStore.getChainStoreId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return accountInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -65,6 +65,7 @@ public class WebConfig extends WebMvcConfigurationSupport {
|
|||||||
.excludePathPatterns("/clientApi/captcha/**")
|
.excludePathPatterns("/clientApi/captcha/**")
|
||||||
.excludePathPatterns("/backendApi/captcha/**")
|
.excludePathPatterns("/backendApi/captcha/**")
|
||||||
.excludePathPatterns("/backendApi/userCoupon/exportList")
|
.excludePathPatterns("/backendApi/userCoupon/exportList")
|
||||||
|
.excludePathPatterns("/backendApi/store/loginVerification")
|
||||||
.excludePathPatterns("/backendApi/login/**");
|
.excludePathPatterns("/backendApi/login/**");
|
||||||
|
|
||||||
// 客户端拦截
|
// 客户端拦截
|
||||||
|
@ -30,11 +30,23 @@ public class RoleDto {
|
|||||||
* */
|
* */
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
|
|
||||||
|
private String code;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态 : A 有效 D 无效
|
* 状态 : A 有效 D 无效
|
||||||
*/
|
*/
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
@ -140,11 +140,29 @@ public class StoreDto implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
private String doorstepPhoto;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 最后操作人
|
* 最后操作人
|
||||||
*/
|
*/
|
||||||
private String operator;
|
private String operator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务到期时间
|
||||||
|
*/
|
||||||
|
private Date expirationTime;
|
||||||
|
|
||||||
|
public Date getExpirationTime() {
|
||||||
|
return expirationTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExpirationTime(Date expirationTime) {
|
||||||
|
this.expirationTime = expirationTime;
|
||||||
|
}
|
||||||
|
|
||||||
public Integer getId(){
|
public Integer getId(){
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -307,4 +325,12 @@ public class StoreDto implements Serializable {
|
|||||||
public void setOperator(String operator){
|
public void setOperator(String operator){
|
||||||
this.operator=operator;
|
this.operator=operator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDoorstepPhoto() {
|
||||||
|
return doorstepPhoto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDoorstepPhoto(String doorstepPhoto) {
|
||||||
|
this.doorstepPhoto = doorstepPhoto;
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,5 +1,6 @@
|
|||||||
package com.fuint.common.service.impl;
|
package com.fuint.common.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
@ -136,7 +137,10 @@ public class AccountServiceImpl extends ServiceImpl<TAccountMapper, TAccount> im
|
|||||||
@Override
|
@Override
|
||||||
public IPage<TAccount> listAccount(com.baomidou.mybatisplus.extension.plugins.pagination.Page page, TAccount accountInfo) {
|
public IPage<TAccount> listAccount(com.baomidou.mybatisplus.extension.plugins.pagination.Page page, TAccount accountInfo) {
|
||||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
SysDept sysDept = deptService.selectDeptById(nowAccountInfo.getDeptId());
|
if (ObjectUtil.isEmpty(accountInfo) || ObjectUtil.isEmpty(accountInfo.getDeptId()) ) {
|
||||||
|
accountInfo.setDeptId(nowAccountInfo.getDeptId());
|
||||||
|
}
|
||||||
|
SysDept sysDept = deptService.selectDeptById(accountInfo.getDeptId());
|
||||||
IPage<TAccount> tAccountIPage = baseMapper.listAccount(page, accountInfo, sysDept.getAncestors());
|
IPage<TAccount> tAccountIPage = baseMapper.listAccount(page, accountInfo, sysDept.getAncestors());
|
||||||
return tAccountIPage;
|
return tAccountIPage;
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,7 @@ public class ShiroConfig {
|
|||||||
filterMap.put("/business/storeInformation/store/recentlyStore","anon");
|
filterMap.put("/business/storeInformation/store/recentlyStore","anon");
|
||||||
//会员扫码进入小程序后根据id获取店铺信息
|
//会员扫码进入小程序后根据id获取店铺信息
|
||||||
filterMap.put("/business/storeInformation/store/queryStoreById","anon");
|
filterMap.put("/business/storeInformation/store/queryStoreById","anon");
|
||||||
|
filterMap.put("/backendApi/store/loginVerification","anon");
|
||||||
//小程序支付回调地址
|
//小程序支付回调地址
|
||||||
filterMap.put("/api/fyPay/notify","anon");
|
filterMap.put("/api/fyPay/notify","anon");
|
||||||
filterMap.put("/**","commonFilter");
|
filterMap.put("/**","commonFilter");
|
||||||
|
@ -96,6 +96,7 @@ public class BackendDutyController extends BaseController {
|
|||||||
String type = AdminRoleEnum.getName(tDuty.getDutyType());
|
String type = AdminRoleEnum.getName(tDuty.getDutyType());
|
||||||
dto.setType(type);
|
dto.setType(type);
|
||||||
dto.setStatus(tDuty.getStatus());
|
dto.setStatus(tDuty.getStatus());
|
||||||
|
dto.setCode(tDuty.getCode());
|
||||||
content.add(dto);
|
content.add(dto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,5 +45,8 @@ public class TDuty extends BaseEntity implements Serializable {
|
|||||||
@ApiModelProperty("角色类型")
|
@ApiModelProperty("角色类型")
|
||||||
private String dutyType;
|
private String dutyType;
|
||||||
|
|
||||||
|
@ApiModelProperty("角色编码")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.fuint.system.user.controller;
|
package com.fuint.system.user.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.fuint.common.dto.AccountDto;
|
import com.fuint.common.dto.AccountDto;
|
||||||
@ -7,6 +8,8 @@ import com.fuint.common.dto.AccountInfo;
|
|||||||
import com.fuint.common.dto.RoleDto;
|
import com.fuint.common.dto.RoleDto;
|
||||||
import com.fuint.common.enums.StatusEnum;
|
import com.fuint.common.enums.StatusEnum;
|
||||||
import com.fuint.common.service.AccountService;
|
import com.fuint.common.service.AccountService;
|
||||||
|
import com.fuint.repository.mapper.TAccountDutyMapper;
|
||||||
|
import com.fuint.repository.model.TAccountDuty;
|
||||||
import com.fuint.system.role.service.DutyService;
|
import com.fuint.system.role.service.DutyService;
|
||||||
import com.fuint.common.service.MerchantService;
|
import com.fuint.common.service.MerchantService;
|
||||||
import com.fuint.business.store.service.StoreService;
|
import com.fuint.business.store.service.StoreService;
|
||||||
@ -25,6 +28,8 @@ import io.swagger.annotations.ApiOperation;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -162,6 +167,13 @@ public class BackendAccountController extends BaseController {
|
|||||||
return getSuccessResult(result);
|
return getSuccessResult(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
TAccountDutyMapper tAccountDutyMapper;
|
||||||
/**
|
/**
|
||||||
* 新增账户
|
* 新增账户
|
||||||
*
|
*
|
||||||
@ -171,7 +183,7 @@ public class BackendAccountController extends BaseController {
|
|||||||
@ApiOperation(value = "新增账户")
|
@ApiOperation(value = "新增账户")
|
||||||
@RequestMapping(value = "/doCreate", method = RequestMethod.POST)
|
@RequestMapping(value = "/doCreate", method = RequestMethod.POST)
|
||||||
@CrossOrigin
|
@CrossOrigin
|
||||||
@Transactional
|
// @Transactional
|
||||||
public ResponseObject doCreate(HttpServletRequest request, @RequestBody Map<String, Object> param) {
|
public ResponseObject doCreate(HttpServletRequest request, @RequestBody Map<String, Object> param) {
|
||||||
String token = request.getHeader("Access-Token");
|
String token = request.getHeader("Access-Token");
|
||||||
AccountInfo loginAccount = TokenUtil.getAccountInfoByToken(token);
|
AccountInfo loginAccount = TokenUtil.getAccountInfoByToken(token);
|
||||||
@ -180,14 +192,27 @@ public class BackendAccountController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// List<Integer> roleIds = (List) param.get("roleIds");
|
// List<Integer> roleIds = (List) param.get("roleIds");
|
||||||
|
String roleId = param.get("roleIds").toString();
|
||||||
String accountName = param.get("accountName").toString();
|
String accountName = param.get("accountName").toString();
|
||||||
String accountStatus = param.get("accountStatus").toString();
|
String accountStatus = param.get("accountStatus").toString();
|
||||||
String realName = param.get("realName").toString();
|
String realName = param.get("realName").toString();
|
||||||
String password = param.get("password").toString();
|
String password = param.get("password").toString();
|
||||||
String roleIds = param.get("roleIds").toString();
|
|
||||||
|
// String roleIds = param.get("roleIds").toString();
|
||||||
String storeId = param.get("storeId") == null ? "0" : param.get("storeId").toString();
|
String storeId = param.get("storeId") == null ? "0" : param.get("storeId").toString();
|
||||||
String merchantId = param.get("merchantId") == null ? "0" : param.get("merchantId").toString();
|
String merchantId = param.get("merchantId") == null ? "0" : param.get("merchantId").toString();
|
||||||
String staffId = param.get("staffId") == null ? "0" : param.get("staffId").toString();
|
String staffId = param.get("staffId") == null ? "0" : param.get("staffId").toString();
|
||||||
|
String deptId = param.get("deptId") == null ? "0" : param.get("deptId").toString();
|
||||||
|
|
||||||
|
// 获取角色code
|
||||||
|
String code = param.get("code") == null ? "0" : param.get("code").toString();
|
||||||
|
// 所属的连锁店类型
|
||||||
|
String deptType = param.get("deptType") == null ? "0" : param.get("deptType").toString();
|
||||||
|
|
||||||
|
if (!"3".equals(deptType) && "z001".equals(code) ) {
|
||||||
|
return getFailureResult(201, "用户角色与组织架构不匹配");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
AccountInfo accountInfo = tAccountService.getAccountByName(accountName);
|
AccountInfo accountInfo = tAccountService.getAccountByName(accountName);
|
||||||
if (accountInfo != null) {
|
if (accountInfo != null) {
|
||||||
@ -195,19 +220,32 @@ public class BackendAccountController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<TDuty> duties = new ArrayList<>();
|
List<TDuty> duties = new ArrayList<>();
|
||||||
// todo
|
String[] ids = new String[1];
|
||||||
|
ids[0] = roleId;
|
||||||
|
duties = tDutyService.findDatasByIds(ids);
|
||||||
|
if (ObjectUtil.isEmpty(duties)) {
|
||||||
|
return getFailureResult(201, "您分配的角色不存在");
|
||||||
|
}
|
||||||
|
|
||||||
// if (roleIds.size() > 0) {
|
// if (roleIds.size() > 0) {
|
||||||
// Integer[] roles = roleIds.toArray(new Integer[roleIds.size()]);
|
// Integer[] roles = roleIds.toArray(new Integer[roleIds.size()]);
|
||||||
// String[] ids = new String[roles.length];
|
// String[] ids = new String[roles.length];
|
||||||
// for (int i = 0; i < roles.length; i++) {
|
//// for (int i = 0; i < roles.length; i++) {
|
||||||
// ids[i] = roles[i].toString();
|
//// ids[i] = roles[i].toString();
|
||||||
// }
|
//// }
|
||||||
// duties = tDutyService.findDatasByIds(ids);
|
// duties = tDutyService.findDatasByIds(ids);
|
||||||
// if (duties.size() < roleIds.size()) {
|
// if (duties.size() < roleIds.size()) {
|
||||||
// return getFailureResult(201, "您分配的角色不存在");
|
// return getFailureResult(201, "您分配的角色不存在");
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
// 查询角色是否存在
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TAccount tAccount = new TAccount();
|
TAccount tAccount = new TAccount();
|
||||||
tAccount.setAccountKey(CommonUtil.createAccountKey());
|
tAccount.setAccountKey(CommonUtil.createAccountKey());
|
||||||
tAccount.setRealName(realName);
|
tAccount.setRealName(realName);
|
||||||
@ -221,6 +259,9 @@ public class BackendAccountController extends BaseController {
|
|||||||
tAccount.setStaffId(Integer.parseInt(staffId));
|
tAccount.setStaffId(Integer.parseInt(staffId));
|
||||||
|
|
||||||
tAccountService.createAccountInfo(tAccount, duties);
|
tAccountService.createAccountInfo(tAccount, duties);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return getSuccessResult(true);
|
return getSuccessResult(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,9 @@
|
|||||||
FROM
|
FROM
|
||||||
`t_account` ta
|
`t_account` ta
|
||||||
left join sys_dept sd on sd.dept_id = ta.dept_id
|
left join sys_dept sd on sd.dept_id = ta.dept_id
|
||||||
|
|
||||||
|
|
||||||
|
where account_status != -1
|
||||||
<if test="accountInfo.realName != null and accountInfo.realName != ''">
|
<if test="accountInfo.realName != null and accountInfo.realName != ''">
|
||||||
AND ta.real_name = like concat('%',#{accountInfo.realName},'%')
|
AND ta.real_name = like concat('%',#{accountInfo.realName},'%')
|
||||||
</if>
|
</if>
|
||||||
@ -17,6 +20,7 @@
|
|||||||
<if test="ancestors != null and ancestors!=''">
|
<if test="ancestors != null and ancestors!=''">
|
||||||
AND sd.ancestors like concat (#{ancestors},'%')
|
AND sd.ancestors like concat (#{ancestors},'%')
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
order by create_time desc
|
order by create_time desc
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
Loading…
Reference in New Issue
Block a user