Commit 3a7eb9bb by 匡雅琴

修改

1 parent cb4f2da0
<template> <template>
<div> <div>
<el-form ref="provinceForm" :model="provinceForm" label-width="80px" inline="true" class="province"> <el-form ref="provinceForm" :model="provinceForm" label-width="80px" inline="true" class="province">
<el-select v-model="provinceForm.provinceName" placeholder="选择省份" @change="selectProvince"> <el-select v-model="provinceForm.provinceName" placeholder="选择省份" @change="selectProvince" class="select-padding">
<el-option v-for="item in AllData" :key="item.provinceCode" :label="item.provinceName" :value="item.provinceName" @click.native="selectProvince(item)"></el-option> <el-option v-for="item in AllData" :key="item.provinceCode" :label="item.provinceName" :value="item.provinceName" @click.native="selectProvince(item)"></el-option>
</el-select> </el-select>
<el-select v-model="provinceForm.cityName" placeholder="选择您所在的市" style="width:250px" @change="selectCity"> <el-select v-model="provinceForm.cityName" placeholder="选择您所在的市" style="width:250px" @change="selectCity" class="select-padding">
<el-option v-for="item in cityList" :key="item.cityCode" :label="item.cityName" :value="item.cityName" @click.native="selectCity(item)"></el-option> <el-option v-for="item in cityList" :key="item.cityCode" :label="item.cityName" :value="item.cityName" @click.native="selectCity(item)"></el-option>
</el-select> </el-select>
</el-form> </el-form>
...@@ -29,18 +29,28 @@ export default { ...@@ -29,18 +29,28 @@ export default {
} }
} }
}, },
inject: ['provinceEditAccount'],
mounted() { mounted() {
// 初始化 // 初始化
this.getProvinceList() this.getProvinceList()
console.log(this.provinceEditAccount, '====')
// if (this.province.provinceName) {
// console.log('++++')
// this.init(this.province.provinceName, this.province.cityName)
// }
}, },
methods: { methods: {
init(provinceName, cityName) { init(provinceName, cityName) {
console.log(provinceName, cityName)
console.log(111111)
console.log(this.AllData)
this.provinceForm = { this.provinceForm = {
provinceName: provinceName, provinceName: provinceName,
cityName: cityName cityName: cityName
} }
this.AllData.map(item => { this.AllData.map(item => {
if (provinceName == item.provinceName) { if (provinceName == item.provinceName) {
console.log(111111)
this.cityList = item.cityInfoList this.cityList = item.cityInfoList
this.provinceForm.provinceCode = item.provinceCode this.provinceForm.provinceCode = item.provinceCode
this.cityList.map(itm => { this.cityList.map(itm => {
...@@ -53,9 +63,11 @@ export default { ...@@ -53,9 +63,11 @@ export default {
}, },
async getProvinceList() { async getProvinceList() {
const { provinceInfoList: provinceList } = await this.provinceList const { provinceInfoList: provinceList } = await this.provinceList
// this.AllData = provinceList this.AllData = provinceList
this.$set(this, 'AllData', provinceList) // this.$set(this, 'AllData', provinceList)
console.log(this.AllData) if (this.provinceEditAccount) {
this.init(this.provinceEditAccount.provinceName, this.provinceEditAccount.cityName)
}
}, },
// 选择省 // 选择省
selectProvince(val) { selectProvince(val) {
...@@ -76,4 +88,7 @@ export default { ...@@ -76,4 +88,7 @@ export default {
.province { .province {
display: inline-flex; display: inline-flex;
} }
.select-padding {
margin-right: 10px;
}
</style> </style>
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
let cfg = require('./conf.js') let cfg = require('./conf.js')
import { Http } from 'glsx-common' import { Http } from 'glsx-common'
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
export const fetchConfig = function (isEnv = true) { export const fetchConfig = function(isEnv = false) {
// if (isEnv) { if (isEnv) {
// let { request } = cfg let { request } = cfg
// Object.assign(request, { timeout }) Object.assign(request, { timeout })
// return Promise.resolve(cfg) return Promise.resolve(cfg)
// } }
// return new Http().get('https://oss-config.test.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/config') // return new Http().get('https://oss-config.test.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/config')
return new Http().get('http://oss-config.dev.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/config') return new Http().get('http://oss-config.dev.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/config')
} }
......
...@@ -211,11 +211,9 @@ export default { ...@@ -211,11 +211,9 @@ export default {
checkBrandList(chant) { checkBrandList(chant) {
let merchantBrandMain = chant.filter(item => item) let merchantBrandMain = chant.filter(item => item)
this.$set(this.accountAddForm, 'merchantBrandMain', merchantBrandMain) this.$set(this.accountAddForm, 'merchantBrandMain', merchantBrandMain)
console.log(this.accountAddForm.merchantBrandMain)
if (!this.accountAddForm.merchantBrandMain) { if (!this.accountAddForm.merchantBrandMain) {
this.accountAddForm.merchantBrandMain = [] this.accountAddForm.merchantBrandMain = []
} }
console.log(this.accountAddForm.merchantBrandMain)
this.$refs.brandListTree.getCheckList(this.accountAddForm.merchantBrandMain) this.$refs.brandListTree.getCheckList(this.accountAddForm.merchantBrandMain)
}, },
checkBusinessType(type) { checkBusinessType(type) {
...@@ -275,12 +273,20 @@ export default { ...@@ -275,12 +273,20 @@ export default {
// 截取省市 // 截取省市
var provinceIdx = address.indexOf('省') var provinceIdx = address.indexOf('省')
var cityIdx = address.indexOf('市') var cityIdx = address.indexOf('市')
// provinceIdx == -1 ? (provinceIdx = 0) : provinceIdx
var province = address.slice(0, provinceIdx) var province = address.slice(0, provinceIdx)
var city = address.slice(provinceIdx + 1, cityIdx) var city = address.slice(provinceIdx + 1, cityIdx)
// 如果没有省
if (provinceIdx == -1) {
provinceIdx = 0
city = address.slice(provinceIdx, cityIdx)
province = city
}
// 判断省市是否匹配 // 判断省市是否匹配
if (this.accountAddForm.provinceName) { if (this.accountAddForm.provinceName) {
if (this.accountAddForm.provinceName !== province && this.accountAddForm.cityName !== city) { if (this.accountAddForm.provinceName !== province || this.accountAddForm.cityName !== city) {
this.$message.error('您选择的地址错误,请重新选择') this.$message.error('您选择的地址错误,请重新选择')
this.accountAddForm.merchantAddress = ''
return return
} }
} }
...@@ -298,7 +304,9 @@ export default { ...@@ -298,7 +304,9 @@ export default {
}, },
// 获取省 // 获取省
getProvince(provinceName, provinceCode) { getProvince(provinceName, provinceCode) {
this.accountAddForm.merchantAddress = '' this.$set(this.accountAddForm, 'merchantAddress', '')
// 强制更新 merchantAddress
this.$forceUpdate()
this.accountAddForm.provinceName = provinceName this.accountAddForm.provinceName = provinceName
this.accountAddForm.provinceCode = provinceCode this.accountAddForm.provinceCode = provinceCode
}, },
......
...@@ -72,7 +72,6 @@ export default { ...@@ -72,7 +72,6 @@ export default {
}, },
methods: { methods: {
handleClik(tab, event) { handleClik(tab, event) {
console.log(tab, event)
const tabId = tab.name const tabId = tab.name
const productTab = this.tabMenu.find(i => i.accounttypeId == tabId) const productTab = this.tabMenu.find(i => i.accounttypeId == tabId)
this.productTab = productTab.productsArr[0] ? productTab.productsArr[0].productId : '' this.productTab = productTab.productsArr[0] ? productTab.productsArr[0].productId : ''
...@@ -81,7 +80,6 @@ export default { ...@@ -81,7 +80,6 @@ export default {
this.$parent.editStatus = true this.$parent.editStatus = true
this.productTab = data.length != 0 ? data[data.length - 1].productId : '' this.productTab = data.length != 0 ? data[data.length - 1].productId : ''
const { tabName, tabMenu, productTab } = this const { tabName, tabMenu, productTab } = this
console.log(tabName, data)
// 设置全选 // 设置全选
var arr = tabMenu.find(i => i.accounttypeId == tabName).products.find(j => j.productId == productTab).merchantProTreeResponses var arr = tabMenu.find(i => i.accounttypeId == tabName).products.find(j => j.productId == productTab).merchantProTreeResponses
this.$refs[`tree_${tabName}_${productTab}`][0].setCheckedKeys(this.getAllId(arr)) this.$refs[`tree_${tabName}_${productTab}`][0].setCheckedKeys(this.getAllId(arr))
...@@ -108,7 +106,6 @@ export default { ...@@ -108,7 +106,6 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.addStyle() this.addStyle()
}) })
console.log(this.tabMenu)
this.accountTypes = tabMenu.map(item => { this.accountTypes = tabMenu.map(item => {
return { return {
products: null, products: null,
...@@ -128,7 +125,6 @@ export default { ...@@ -128,7 +125,6 @@ export default {
account = 'accountTypeSearchRequest' account = 'accountTypeSearchRequest'
} }
this.$apis.store[account](params).then(res => { this.$apis.store[account](params).then(res => {
console.log(res)
let tabMenu = res let tabMenu = res
this.accountList = tabMenu.map(item => { this.accountList = tabMenu.map(item => {
return { return {
...@@ -140,8 +136,6 @@ export default { ...@@ -140,8 +136,6 @@ export default {
// productId: '' // productId: ''
} }
}) })
console.log(this.accountList)
this.accountTypes = tabMenu.map(item => { this.accountTypes = tabMenu.map(item => {
return { return {
products: null, products: null,
...@@ -160,9 +154,7 @@ export default { ...@@ -160,9 +154,7 @@ export default {
this.$apis.store.findPermissionsByMerId(params).then(res => { this.$apis.store.findPermissionsByMerId(params).then(res => {
this.tabMenu_x = util.deepClone(res) this.tabMenu_x = util.deepClone(res)
res.forEach(item => { res.forEach(item => {
console.log(item)
this.accountList.forEach(itm => { this.accountList.forEach(itm => {
console.log(itm)
if (item.accounttypeId == itm.accounttypeId) { if (item.accounttypeId == itm.accounttypeId) {
this.tabMenu.push(itm) this.tabMenu.push(itm)
item.products.forEach(i => { item.products.forEach(i => {
...@@ -192,7 +184,6 @@ export default { ...@@ -192,7 +184,6 @@ export default {
this.accountList = util.deepClone(this.tabMenu_s) this.accountList = util.deepClone(this.tabMenu_s)
this.tabMenu_x.forEach(item => { this.tabMenu_x.forEach(item => {
this.accountList.forEach(itm => { this.accountList.forEach(itm => {
console.log(itm)
if (item.accounttypeId == itm.accounttypeId) { if (item.accounttypeId == itm.accounttypeId) {
this.tabMenu.push(itm) this.tabMenu.push(itm)
item.products.forEach(i => { item.products.forEach(i => {
...@@ -244,7 +235,6 @@ export default { ...@@ -244,7 +235,6 @@ export default {
this.uniteChildSame(currentObj, true) this.uniteChildSame(currentObj, true)
} else { } else {
// 未选中 处理子节点全部未选中 // 未选中 处理子节点全部未选中
console.log(currentObj)
if (currentObj.children !== null) { if (currentObj.children !== null) {
if (currentObj.children.length !== 0) { if (currentObj.children.length !== 0) {
this.uniteChildSame(currentObj, false) this.uniteChildSame(currentObj, false)
...@@ -290,7 +280,6 @@ export default { ...@@ -290,7 +280,6 @@ export default {
uniteChildSame(treeList, isSelected) { uniteChildSame(treeList, isSelected) {
const tree_ref = `tree_${this.tabName}_${this.productTab}` const tree_ref = `tree_${this.tabName}_${this.productTab}`
this.$refs[tree_ref][0].setChecked(treeList.id, isSelected) this.$refs[tree_ref][0].setChecked(treeList.id, isSelected)
console.log(treeList)
if (treeList.children !== null) { if (treeList.children !== null) {
for (let i = 0; i < treeList.children.length; i++) { for (let i = 0; i < treeList.children.length; i++) {
this.uniteChildSame(treeList.children[i], isSelected) this.uniteChildSame(treeList.children[i], isSelected)
...@@ -327,7 +316,6 @@ export default { ...@@ -327,7 +316,6 @@ export default {
let productList = [] let productList = []
item.productsArr.forEach(itm => { item.productsArr.forEach(itm => {
const checkedNodes = this.$refs[`tree_${item.accounttypeId}_${itm.productId}`] ? this.$refs[`tree_${item.accounttypeId}_${itm.productId}`][0].getCheckedNodes() : [] const checkedNodes = this.$refs[`tree_${item.accounttypeId}_${itm.productId}`] ? this.$refs[`tree_${item.accounttypeId}_${itm.productId}`][0].getCheckedNodes() : []
console.log(checkedNodes)
const menuIdList = checkedNodes const menuIdList = checkedNodes
// .filter((item) => item.logo === "menu") // .filter((item) => item.logo === "menu")
.filter(item => item.logo !== 'function' && item.logo !== 'functionValue' && item.logo !== 'neglect') .filter(item => item.logo !== 'function' && item.logo !== 'functionValue' && item.logo !== 'neglect')
...@@ -359,7 +347,6 @@ export default { ...@@ -359,7 +347,6 @@ export default {
}) })
}) })
} }
console.log(menuIdList, functionIdList, functionValueIdLists, list)
if (this.roleType) { if (this.roleType) {
productList.push({ productList.push({
productId: itm.productId, productId: itm.productId,
...@@ -388,7 +375,6 @@ export default { ...@@ -388,7 +375,6 @@ export default {
} }
} }
}) })
console.log(this.accountTypes)
return this.accountTypes return this.accountTypes
} }
}, },
......
...@@ -136,6 +136,16 @@ ...@@ -136,6 +136,16 @@
<span class="itemName">主营品牌:</span> <span class="itemName">主营品牌:</span>
<span class="itemValue">{{ firstPageObj.merchantBrandName || '-' }}</span> <span class="itemValue">{{ firstPageObj.merchantBrandName || '-' }}</span>
</el-col> </el-col>
<el-col :span="12" class="flexCol">
<span class="itemName">驻店电话:</span>
<span class="itemValue">{{ firstPageObj.residentPhone || '-' }}</span>
</el-col>
</el-row>
<el-row>
<el-col :span="12" class="flexCol">
<span class="itemName">营业时间:</span>
<span class="itemValue">{{ firstPageObj.bussinessBegintime ? firstPageObj.bussinessBegintime + '-' + firstPageObj.bussinessEndtime : '-' }}</span>
</el-col>
</el-row> </el-row>
</div> </div>
</div> </div>
...@@ -348,7 +358,7 @@ export default { ...@@ -348,7 +358,7 @@ export default {
}, },
//将后台返回数据中数值为空的字段全部替换为“-” //将后台返回数据中数值为空的字段全部替换为“-”
formateNullFieldData(initialData) { formateNullFieldData(initialData) {
const isEmpty = function (val) { const isEmpty = function(val) {
if (!String(val) || String(val) === 'null') { if (!String(val) || String(val) === 'null') {
return '-' return '-'
} }
...@@ -356,7 +366,7 @@ export default { ...@@ -356,7 +366,7 @@ export default {
} }
var that = this var that = this
if (initialData instanceof Array) { if (initialData instanceof Array) {
initialData.forEach(function (val, key, array) { initialData.forEach(function(val, key, array) {
array[key] = that.formateNullFieldData(val) array[key] = that.formateNullFieldData(val)
}) })
} else if (initialData instanceof Object) { } else if (initialData instanceof Object) {
...@@ -404,7 +414,6 @@ export default { ...@@ -404,7 +414,6 @@ export default {
findMenuFunTreeByMerId() { findMenuFunTreeByMerId() {
this.$apis.merchant.findMenuFunTreeByMerId({ id: this.merchantId }).then(res => { this.$apis.merchant.findMenuFunTreeByMerId({ id: this.merchantId }).then(res => {
if (res) { if (res) {
console.log(res, '功能树的信息')
this.powerDataArray = res this.powerDataArray = res
this.handlerTreeDom() this.handlerTreeDom()
} }
...@@ -451,7 +460,6 @@ export default { ...@@ -451,7 +460,6 @@ export default {
}) })
) )
this.merchantProTreeResponsesArray = this.toContiuneTree(this.merchantProTreeResponsesArray, 0, maxval) this.merchantProTreeResponsesArray = this.toContiuneTree(this.merchantProTreeResponsesArray, 0, maxval)
console.log(this.merchantProTreeResponsesArray)
this.maxval = maxval - 1 this.maxval = maxval - 1
this.$nextTick(() => { this.$nextTick(() => {
this.changeTreeClass(maxval) this.changeTreeClass(maxval)
...@@ -499,11 +507,8 @@ export default { ...@@ -499,11 +507,8 @@ export default {
// param.pageNum=this.$refs.subMerchantTable.page.pageNum // param.pageNum=this.$refs.subMerchantTable.page.pageNum
this.$apis.merchant.getSecondTable(param).then(res => { this.$apis.merchant.getSecondTable(param).then(res => {
if (res) { if (res) {
console.log('2', res)
let data = this.formateNullFieldData(res) let data = this.formateNullFieldData(res)
this.subMerchantTableList = data this.subMerchantTableList = data
this.subMerchantTableTotal = res.length this.subMerchantTableTotal = res.length
} }
// total > 50?calc(100vh - '199px'): calc(100vh - '152px') // total > 50?calc(100vh - '199px'): calc(100vh - '152px')
...@@ -549,7 +554,6 @@ export default { ...@@ -549,7 +554,6 @@ export default {
this.getFirstInfo() this.getFirstInfo()
this.findMenuFunTreeByMerId() this.findMenuFunTreeByMerId()
this.getSecondInfo() this.getSecondInfo()
this.getSecondTree() this.getSecondTree()
}, },
......
...@@ -173,6 +173,11 @@ export default { ...@@ -173,6 +173,11 @@ export default {
} }
} }
}, },
provide() {
return {
provinceEditAccount: this.accountAddForm
}
},
watch: { watch: {
filterText(val) { filterText(val) {
this.$refs.brandTree.filter(val) this.$refs.brandTree.filter(val)
...@@ -432,7 +437,6 @@ export default { ...@@ -432,7 +437,6 @@ export default {
merchantBrandMain merchantBrandMain
}) })
// 省市回显 // 省市回显
this.$refs.baseInfoForm.init(this.accountAddForm.provinceName, this.accountAddForm.cityName)
merchantBrandMain = merchantBrandMain.replaceAll(';', ',').split(',') merchantBrandMain = merchantBrandMain.replaceAll(';', ',').split(',')
this.$refs.baseInfoForm.checkBrandList(merchantBrandMain) this.$refs.baseInfoForm.checkBrandList(merchantBrandMain)
this.$refs.baseInfoForm.checkBusinessType(businessType) this.$refs.baseInfoForm.checkBusinessType(businessType)
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
<el-input v-model="infoForm.residentPhone" placeholder="此电话会在小程序上显示,请填写真实有效的电话或手机号"></el-input> <el-input v-model="infoForm.residentPhone" placeholder="此电话会在小程序上显示,请填写真实有效的电话或手机号"></el-input>
<div @click="showTelDia" class="show-address">显示位置</div> <div @click="showTelDia" class="show-address">显示位置</div>
</el-form-item> </el-form-item>
<!-- <div @click="showTelDia" class="show-address">显示位置</div> -->
<el-form-item size="small" label="主营品牌" style="height: 500px"> <el-form-item size="small" label="主营品牌" style="height: 500px">
<select-brand :brandListTree="brandListTree" ref="brandListTree"></select-brand> <select-brand :brandListTree="brandListTree" ref="brandListTree"></select-brand>
</el-form-item> </el-form-item>
...@@ -123,7 +122,6 @@ export default { ...@@ -123,7 +122,6 @@ export default {
}) })
}) })
this.brandListTree = brandListTree this.brandListTree = brandListTree
if (!this.infoForm.merchantBrandMain) { if (!this.infoForm.merchantBrandMain) {
this.infoForm.merchantBrandMain = [] this.infoForm.merchantBrandMain = []
} else { } else {
...@@ -160,8 +158,9 @@ export default { ...@@ -160,8 +158,9 @@ export default {
var city = address.slice(provinceIdx + 1, cityIdx) var city = address.slice(provinceIdx + 1, cityIdx)
// 判断省市是否匹配 // 判断省市是否匹配
if (this.infoForm.provinceName) { if (this.infoForm.provinceName) {
if (this.infoForm.provinceName !== province && this.infoForm.cityName !== city) { if (this.infoForm.provinceName !== province || this.infoForm.cityName !== city) {
this.$message.error('您选择的地址错误,请重新选择') this.$message.error('您选择的地址错误,请重新选择')
this.infoForm.merchantAddress = ''
return return
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!