Commit efbe6848 by 胡悦

合并

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