Commit efbe6848 by 胡悦

合并

2 parents 2505c9c2 b025d0fb
......@@ -10,7 +10,9 @@
"dependencies": {
"axios": "^0.18.0",
"glsx-vue-common": "^1.2.1",
"blueimp-md5": "^2.10.0",
"glsx-vue-components": "^1.0.13",
"js-md5": "^0.7.3",
"node-sass": "^4.9.3",
"sass-loader": "^7.1.0",
"vee-validate": "^2.1.7",
......
import {
GlAxios
} from 'glsx-vue-common'
const path = '/glsx.accounts.admin.merchant.'
const __sGetList = `${path}search`
const __sDetail = `${path}detail`
const __sPersonal = `${path}personal`
const __sGroup = `${path}group`
const __sSaveMerchant = `${path}create`
const __sLevel = `${path}group.level`
// 获取商户列表(根据条件获取商户列表)
const getList = {
p: [__sGetList],
req: params => GlAxios.get(__sGetList, {
params
})
const methods = {
Search: `${path}search`,
Detail: `${path}detail`,
Personal: `${path}personal`,
Group: `${path}group`,
Create: `${path}create`,
GroupLevel: `${path}group.level`
}
// 获取商户详情(通过商户id获取商户详情)
const merchantDetail = {
p: [__sDetail],
req: params => GlAxios.get(__sDetail, {
params
})
}
// 获取员工信息(通过商户id获取员工信息)
const merchantPersonal = {
p: [__sPersonal],
req: params => GlAxios.get(__sPersonal, {
params
})
}
// 获取分组信息(通过商户id获取分组信息)
const merchantGroup = {
p: [__sGroup],
req: params => GlAxios.get(__sGroup, {
params
})
}
// 新增商户
const saveMerchant = {
p: [__sSaveMerchant],
req: params => GlAxios.get(__sSaveMerchant, {
params
})
}
// 根据分组跟商户查询父子商户
const merchantGroupLevel = {
p: [__sLevel],
req: params => GlAxios.get(__sLevel, {
params
})
}
export {
getList,
merchantDetail,
merchantPersonal,
merchantGroup,
saveMerchant,
merchantGroupLevel
methods
}
import {
getBusinessList
} from './businessManagement'
GlAxios
} from 'glsx-vue-common'
import { sign } from './sign'
import {
getList,
merchantDetail,
merchantPersonal,
merchantGroup,
saveMerchant,
merchantGroupLevel
methods as bizMethods
} from './bussinessListApi'
const request = {
req: params => {
const url = process.env.NODE_ENV === 'production' ? 'router' : params.methods
return GlAxios.get(url, { 'params': sign(params) })
}
}
export {
getBusinessList,
getList,
merchantDetail,
merchantPersonal,
merchantGroup,
saveMerchant,
merchantGroupLevel
bizMethods,
request
}
import MD5 from 'js-md5'
const sign = params => {
const secret = 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
const keys = Object.keys(params).sort()
var str = []
keys.forEach(e => {
str.push(e + params[e])
})
params.sign = MD5(secret + str.join('') + secret)
return params
}
export {
sign
}
......@@ -35,7 +35,19 @@ Vue.use(VeeValidate, {
var mixin = {
data() {
return {
flag: true
flag: true,
// paramsTrans: '',
/**
* 定义一个事件传输总线
* 提示:页面与子组件间的参数都可以用之来互相传递
* 如:
* this.$root.eventBus.$emit('params', {id:123});
*
this.$root.eventBus.$on('params', (params)=>{
console.log(params);
});
*/
eventBus: new Vue()
}
},
mounted() {
......@@ -86,21 +98,10 @@ var mixin = {
})
}
}
},
data() {
return {
/**
* 定义一个事件传输总线
* 提示:页面与子组件间的参数都可以用之来互相传递
* 如:
* this.$root.eventBus.$emit('params', {id:123});
*
this.$root.eventBus.$on('params', (params)=>{
console.log(params);
});
*/
eventBus: new Vue()
}
// getParamsTrans() {
// console.log(this.paramsTrans)
// return this.paramsTrans
// }
}
}
const URL = ' http://192.168.3.171:7300/mock/5be17454f31545347559d499/config'
......
......@@ -3,7 +3,7 @@
<gl-breadcrumb separator='/'>
<gl-breadcrumb-item><a href='#' @click='back'>商户列表</a></gl-breadcrumb-item>
<gl-breadcrumb-item>商户详情</gl-breadcrumb-item>
<gl-breadcrumb-item>{{name}}</gl-breadcrumb-item>
<gl-breadcrumb-item>{{List[0].value}}</gl-breadcrumb-item>
</gl-breadcrumb>
<!-- <gl-button type='text' @click='back'>商户列表</gl-button>
<span>\ 商户详情 \{{name}}</span> -->
......@@ -36,7 +36,7 @@
<script>
import VueAMap from 'vue-amap'
import Vue from 'vue'
import { merchantPersonal } from '@/api/index'
import { merchantDetail } from '@/api/index'
import notice from '@/common/notice'
const amapManager = new VueAMap.AMapManager()
VueAMap.initAMapApiLoader({
......@@ -49,28 +49,36 @@ export default {
data() {
const _this = this
return {
name: '',
merchantId: '',
activeName: 'first',
merchantInfo: {},
List: [
{
name: 'merchantName',
label: '商户名称',
value: '深圳市安卓讯航科技有限公司'
}, {
name: 'merchantId',
label: '商户号',
value: '44186213'
}, {
name: 'address',
label: '商户地址',
value: '广东省深圳市南山区科兴科学园C3单元'
}, {
name: 'merchantChannelName',
label: '商户渠道',
value: '自有渠道'
}, {
name: 'contactor',
label: '联系人',
value: '彭裕'
}, {
name: 'createTime',
label: '注册时间',
value: '2018-03-16'
}, {
name: 'contactPhone',
label: '联系电话',
value: '15999682114'
}, {
......@@ -78,9 +86,11 @@ export default {
value: '深圳市安卓讯航科技有限公司',
isMap: true
}, {
name: 'phone',
label: '服务电话',
value: '0755-88888888'
}, {
name: 'email',
label: '邮箱',
value: 'GLSX@didihu.com'
}, {
......@@ -129,11 +139,16 @@ export default {
}
}
},
watch: {
merchantId(val) {
this.getStaffList()
}
},
mounted() {
console.log(this)
this.$root.eventBus.$on('params', (params) => {
console.log(params)
this.name = params.name
if (params.merchantId !== this.merchantId) {
this.merchantId = params.merchantId
}
})
// setTimeout(() => {
// const theme = new this.$Theme()
......@@ -168,13 +183,28 @@ export default {
handleClick(tab, event) {
console.log(tab, event)
},
// 员工信息-接口
// 员工信息-接口--start
getStaffList() {
merchantPersonal.req().then(res => {
notice.okTips(res)
merchantDetail.req({ merchantId: this.merchantId }).then(res => {
this.merchantInfo = res
this.assignStaffInfo()
notice.okTips()
}).catch(err => {
notice.errorTips(err)
})
},
assignStaffInfo() {
console.log(this.merchantInfo)
for (var i in this.List) {
if (this.List[i].isMap) {
console.log('000')
this.point = [this.merchantInfo.lng, this.merchantId.lat]
} else if (this.List[i].isImg) {
console.log('000')
} else {
this.List[i].value = this.merchantInfo[this.List[i].name]
}
}
}
}
}
......
......@@ -44,7 +44,7 @@
<script>
import SearchDialog from './SearchDialog'
import AddDialog from './AddDialog'
import { getList, saveMerchant } from '@/api/bussinessListApi'
import { bizMethods, request } from '@/api'
import notice from '@/common/notice'
export default {
name: 'businessList',
......@@ -128,8 +128,8 @@ export default {
label: '详情',
type: 'text',
callback: (index, rows) => {
const url = encodeURI(`../../customer/businessDetails.html?id=${rows[index].merchantId}&name=${rows[index].merchantName}`)
location.href = url
this.$root.to(['商户数据平台', '商户数据平台', '商户数据平台', '业务管理', '商户详情'], { merchantId: rows[index].merchantId })
// this.$root.getParamsTrans()
}
}]
}
......@@ -150,7 +150,8 @@ export default {
// 接口请求-start
getList() {
const params = this.getParams()
getList.req(params).then(res => {
params.methods = bizMethods.Search
request.req(params).then(res => {
this.ListTableData.data = res.merchants
this.total = res.pagination.totalCount
this.reset(this.merchantSearch)
......@@ -161,7 +162,7 @@ export default {
})
},
saveMerchant() {
saveMerchant.req(this.merchantForm).then(res => {
request.req(this.merchantForm).then(res => {
notice.okTips()
this.reset(this.merchantForm)
}).catch(err => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!