Commit cebc6e7e by 胡悦

tijiao

1 parent 43fe8b4d
...@@ -6,7 +6,8 @@ const methods = { ...@@ -6,7 +6,8 @@ const methods = {
SearchChildList: `${path}group.search.param`, // 子商户根据商户号或者商户名搜索商户列表 SearchChildList: `${path}group.search.param`, // 子商户根据商户号或者商户名搜索商户列表
SearchList: `${path}group.search.parampar`, // 父商户根据商户号或者商户名搜索商户列表 SearchList: `${path}group.search.parampar`, // 父商户根据商户号或者商户名搜索商户列表
GetTree: `${path}group.merchant.tree`, GetTree: `${path}group.merchant.tree`,
GroupSearchMerchant: `${path}group.search.merchant` GroupSearchMerchant: `${path}group.search.merchant`,
GroupModifyLevel: `${path}group.modify.merchant.level`
} }
export { export {
methods methods
......
...@@ -62,8 +62,8 @@ ...@@ -62,8 +62,8 @@
<gl-upload <gl-upload
v-if="isEdit" v-if="isEdit"
class="upload-demo" class="upload-demo"
name="file" name="files"
action="http://192.168.3.217:9220/file/upstring" :action="uploadAction"
:limit="2" :limit="2"
:before-upload="beforeUpload" :before-upload="beforeUpload"
:on-success="handleSuccess" :on-success="handleSuccess"
...@@ -80,12 +80,13 @@ ...@@ -80,12 +80,13 @@
style="width: 50%;" style="width: 50%;"
v-model="merchantInfo.merchantChannelName" v-model="merchantInfo.merchantChannelName"
placeholder="请选择渠道" placeholder="请选择渠道"
@change="handleMerchantChannel"
> >
<gl-option <gl-option
v-for="item in channelList" v-for="item in channelList"
:key="item.confId" :key="item.confId"
:label="item.confKey" :label="item.confKey"
:value="item.confId" :value="item.confKey"
> >
</gl-option> </gl-option>
</gl-select> </gl-select>
...@@ -395,7 +396,10 @@ export default { ...@@ -395,7 +396,10 @@ export default {
// this.uploadAction = `${ // this.uploadAction = `${
// this.$get_session_common_config().axios.fileUploadURL // this.$get_session_common_config().axios.fileUploadURL
// }/gps/common/uploadFile` // }/gps/common/uploadFile`
// this.uploadAction = 'http://192.168.3.217:9220/file/upstring' // this.uploadAction = 'http://192.168.2.109:8085/customer/gfs.test.glsx.com.cn'
// this.uploadAction = 'https://jsonplaceholder.typicode.com/posts/'
console.log(this.$get_session_common_config())
this.uploadAction = 'http://192.168.3.217:9220/file/upstring'
this.$root.eventBus.$on('params', (params) => { this.$root.eventBus.$on('params', (params) => {
this.activeName = 'first' this.activeName = 'first'
this.isVisible = false this.isVisible = false
...@@ -428,7 +432,9 @@ export default { ...@@ -428,7 +432,9 @@ export default {
if (!isCancel && this.isEdit) { if (!isCancel && this.isEdit) {
console.log('调保存接口--') console.log('调保存接口--')
console.log(this.merchantInfo) console.log(this.merchantInfo)
const params = this.merchantInfo const params = this.$deep_clone(this.merchantInfo)
// params.merchantChannel = params.merchantId
delete params.merchantChannelName
params.method = bizMethods.MerchantModify params.method = bizMethods.MerchantModify
console.log(params) console.log(params)
request.req(params).then(res => { request.req(params).then(res => {
...@@ -441,11 +447,11 @@ export default { ...@@ -441,11 +447,11 @@ export default {
if (isCancel) { if (isCancel) {
this.merchantInfo = JSON.parse(JSON.stringify(this.tempMerchantInfo)) this.merchantInfo = JSON.parse(JSON.stringify(this.tempMerchantInfo))
if (!this.merchantInfo.lng && !this.merchantInfo.lat) { if (!this.merchantInfo.lng && !this.merchantInfo.lat) {
amapManager._map.remove(marker) marker && amapManager._map.remove(marker)
this.hasLocation = false this.hasLocation = false
this.List[10].value = '无位置信息' this.List[10].value = '无位置信息'
} else { } else {
this.getAddress(this.merchantInfo.lng, this.merchantInfo.lat) // this.getAddress(this.merchantInfo.lng, this.merchantInfo.lat)
} }
} }
this.isEdit = !this.isEdit this.isEdit = !this.isEdit
...@@ -460,6 +466,10 @@ export default { ...@@ -460,6 +466,10 @@ export default {
notice.errorTips(err) notice.errorTips(err)
}) })
}, },
// 选择-商户渠道
handleMerchantChannel(item) {
this.merchantInfo.merchantChannel = this.channelList[this.channelList.findIndex(i => i.confKey === item)].confId
},
// 切换tab // 切换tab
handleClick(tab, event) { handleClick(tab, event) {
switch (tab.name) { switch (tab.name) {
...@@ -483,6 +493,7 @@ export default { ...@@ -483,6 +493,7 @@ export default {
params.method = bizMethods.Detail params.method = bizMethods.Detail
request.req(params).then(res => { request.req(params).then(res => {
this.merchantInfo = res this.merchantInfo = res
console.log(this.merchantInfo)
// this.merchantInfo.lng = '' // this.merchantInfo.lng = ''
// this.merchantInfo.lat = '' // this.merchantInfo.lat = ''
this.assignBasicInfo() this.assignBasicInfo()
...@@ -590,6 +601,7 @@ export default { ...@@ -590,6 +601,7 @@ export default {
// 图片上传 // 图片上传
// 上传附件,限制用户上传的附件格式和大小 // 上传附件,限制用户上传的附件格式和大小
beforeUpload(file) { beforeUpload(file) {
console.log(file)
const fileType = ['image/jpeg', 'image/jpg', 'image/gif', 'image/png'] const fileType = ['image/jpeg', 'image/jpg', 'image/gif', 'image/png']
const isFileType = fileType.includes(file.type) const isFileType = fileType.includes(file.type)
const isLT20M = file.size / 1024 / 1024 < 20 const isLT20M = file.size / 1024 / 1024 < 20
...@@ -598,6 +610,7 @@ export default { ...@@ -598,6 +610,7 @@ export default {
return isLT20M return isLT20M
}, },
handleSuccess(res, file, fileList) { handleSuccess(res, file, fileList) {
console.log(file)
this.fileList = [{ name: file.name, url: file.response.data }] this.fileList = [{ name: file.name, url: file.response.data }]
this.merchantInfo.merchantPortrait = file.response.data this.merchantInfo.merchantPortrait = file.response.data
}, },
......
...@@ -68,10 +68,10 @@ ...@@ -68,10 +68,10 @@
remote remote
clearable clearable
@change="changeMerchant" @change="changeMerchant"
:remote-method="remoteMerchantList" :remote-method="remoteList"
:loading="treeLoading"> :loading="loading">
<gl-option <gl-option
v-for="item in businessTreeList" v-for="item in businessList"
:key="item.merchantId" :key="item.merchantId"
:label="item.merchantName" :label="item.merchantName"
:value="item.merchantId"> :value="item.merchantId">
...@@ -185,7 +185,7 @@ ...@@ -185,7 +185,7 @@
:addDialogVisible="addDialogVisible" :addDialogVisible="addDialogVisible"
@addData="handleAddData" @addData="handleAddData"
></add-business> ></add-business>
<!-- <gl-dialog <gl-dialog
title="编辑商户" title="编辑商户"
:visible.sync="merchantDialogVisible"> :visible.sync="merchantDialogVisible">
<gl-form :model="merchantInfo"> <gl-form :model="merchantInfo">
...@@ -203,17 +203,12 @@ ...@@ -203,17 +203,12 @@
<gl-form-item <gl-form-item
label="父商户:" label="父商户:"
:label-width="formLabelWidth" :label-width="formLabelWidth"
prop="parentMerchantId"
> >
<gl-select <gl-select
v-model="merchantInfo.parentMerchantName" v-model="merchantInfo.parentMerchantName"
filterable filterable
remote remote
clearable clearable
name="merchantId"
placeholder="请输入商户名称/商户号"
data-vv-as="商户名称/商户号"
v-validate="'required'"
@change="changeMerchant" @change="changeMerchant"
:remote-method="remoteList" :remote-method="remoteList"
:loading="loading" :loading="loading"
...@@ -222,7 +217,7 @@ ...@@ -222,7 +217,7 @@
v-for="item in businessList" v-for="item in businessList"
:key="item.merchantId" :key="item.merchantId"
:label="item.merchantName" :label="item.merchantName"
:value="item.merchantName" :value="item.merchantId"
> >
</gl-option> </gl-option>
</gl-select> </gl-select>
...@@ -238,7 +233,7 @@ ...@@ -238,7 +233,7 @@
@click="submitMerchant" @click="submitMerchant"
>确 定</gl-button> >确 定</gl-button>
</div> </div>
</gl-dialog> --> </gl-dialog>
</div> </div>
</template> </template>
...@@ -379,12 +374,13 @@ export default { ...@@ -379,12 +374,13 @@ export default {
children: 'list', children: 'list',
label: 'merchantName' label: 'merchantName'
}, },
businessTreeList: [], businessList: [],
treeLoading: false, loading: false,
searchResult: {}, // 搜索结果的对象 searchResult: {}, // 搜索结果的对象
allTree: [], allTree: [],
target: [], target: [],
lastSearch: '' lastSearch: '',
parentMerchantList: []
} }
}, },
created() { created() {
...@@ -519,6 +515,7 @@ export default { ...@@ -519,6 +515,7 @@ export default {
// 编辑商户 // 编辑商户
editMerchat(row) { editMerchat(row) {
this.merchantInfo = { this.merchantInfo = {
merchantId: row.merchantId,
merchantName: row.merchantName, merchantName: row.merchantName,
merchantTypeName: row.merchantTypeName, merchantTypeName: row.merchantTypeName,
parentMerchantId: row.parentMerchantId, parentMerchantId: row.parentMerchantId,
...@@ -531,38 +528,48 @@ export default { ...@@ -531,38 +528,48 @@ export default {
this.merchantDialogVisible = !this.merchantDialogVisible this.merchantDialogVisible = !this.merchantDialogVisible
}, },
submitMerchant() { submitMerchant() {
console.log(this.merchantInfo)
console.log(this.businessList)
const params = {}
params.groupId = this.groupId
params.merchantId = this.merchantInfo.merchantId
params.parentMerchantId = this.merchantInfo.parentMerchantName
// params.merchantType = this.merchantInfo.merchantType
params.method = groupDetailMethods.GroupModifyLevel
request.req(params).then(res => {
console.log(res)
})
// 调用接口 // 调用接口
this.merchantDialogVisible = !this.merchantDialogVisible // this.merchantDialogVisible = !this.merchantDialogVisible
}, },
// 树操作 // 树操作
// 父商户搜索 // 父商户搜索
remoteMerchantList(query) { remoteList(query) {
if (query !== '') { if (query !== '') {
this.treeLoading = true this.loading = true
const params = {} const params = {}
params.groupId = this.groupId params.groupId = this.groupId
params.searchWrod = query params.searchWrod = query
params.method = groupDetailMethods.GroupSearchMerchant params.method = groupDetailMethods.GroupSearchMerchant
request.req(params).then(res => { request.req(params).then(res => {
console.log(res) console.log(res)
this.treeLoading = false this.loading = false
this.businessTreeList = res.merchantParams this.businessList = res.merchantParams
}).catch(err => { }).catch(err => {
notice.errorTips(err) notice.errorTips(err)
}) })
} else { } else {
this.businessTreeList = [] this.businessList = []
} }
}, },
changeMerchant(val) { changeMerchant(val) {
if (val) { if (val) {
this.businessTreeList.forEach(item => { // this.businessList.forEach(item => {
if (item.merchantId === val && item.merchantType !== null) { // if (item.merchantId === val && item.merchantType !== null) {
this.merchantInfo.merchantType = item.merchantType // this.merchantInfo.merchantType = item.merchantType
this.disabledMerchant = true // }
} // })
}) this.businessList = []
this.businessTreeList = []
} }
}, },
// 查询 // 查询
...@@ -582,6 +589,7 @@ export default { ...@@ -582,6 +589,7 @@ export default {
}, },
cycle(arr, target) { cycle(arr, target) {
this.$nextTick(() => { this.$nextTick(() => {
console.log(this.target)
arr.forEach(i => { arr.forEach(i => {
if (i.node.key === target.key && target.level === this.target.length) { if (i.node.key === target.key && target.level === this.target.length) {
const top = i.$el.offsetTop const top = i.$el.offsetTop
...@@ -589,6 +597,7 @@ export default { ...@@ -589,6 +597,7 @@ export default {
setTimeout(() => { setTimeout(() => {
this.$set(this.$refs.tree.$el, 'scrollTop', top - i.$el.offsetHeight / 2) this.$set(this.$refs.tree.$el, 'scrollTop', top - i.$el.offsetHeight / 2)
// #f5f7fa // #f5f7fa
console.log(i.$el)
i.$el.children[0].style['background-color'] = '#eee' i.$el.children[0].style['background-color'] = '#eee'
this.lastSearch = i.$el.children[0] this.lastSearch = i.$el.children[0]
}, 200) }, 200)
...@@ -610,6 +619,7 @@ export default { ...@@ -610,6 +619,7 @@ export default {
}) })
}, },
searchParent(e) { searchParent(e) {
this.target = []
if (e.level !== 1) { if (e.level !== 1) {
this.$set(e.parent, 'expanded', true) this.$set(e.parent, 'expanded', true)
this.searchParent(e.parent) this.searchParent(e.parent)
...@@ -626,6 +636,14 @@ export default { ...@@ -626,6 +636,14 @@ export default {
<span>{node.data.merchantTypeName}</span> <span>{node.data.merchantTypeName}</span>
</span>) </span>)
} }
// remoteList() {
// },
// changeParentMerchant(val) {
// if (val) {
// this.parentMerchantList = []
// }
// }
} }
} }
</script> </script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!