Commit bb6d3603 by 前端

Merge branch 'v3.12.0' into 'master'

合并V3.12.0

See merge request !99
2 parents 66bed187 f3bf3093
......@@ -12,7 +12,7 @@
"dayjs": "^1.10.7",
"el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5",
"glsx-common": "^1.4.6",
"glsx-common": "^2.1.0",
"glsx-components": "^1.5.2",
"lodash": "^4.17.21",
"qrcodejs2": "^0.0.2",
......
<template>
<div v-if="provinceView">
<el-form ref="provinceForm" :model="provinceForm" :inline="inline" class="province" label-width="154px">
<el-form-item :label="provinceLabel">
<el-form ref="provinceForm" :model="provinceForm" :inline="inline" class="province" label-width="154px" >
<el-form-item :label="provinceLabel" >
<el-select size="small" v-model="provinceForm.provinceName" clearable placeholder="选择省份" @clear="selectProvince" class="select-padding" :style="{ width: subdistrict == 2 ? '52%' : '33.33%' }">
<el-option v-for="(item, index) in AllData" :key="'province' + index" :label="item.name" :value="item.name" @click.native="selectProvince(item)"></el-option>
</el-select>
......@@ -12,7 +12,7 @@
<el-option v-for="(item, index) in townList" :key="'town' + index" :label="item.name" :value="item.name" @click.native="selectTown(item)"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="detailAddressLabel">
<el-form-item :label="detailAddressLabel" >
<el-input size="small" v-if="mapView" readonly placeholder="请选择详细地址" v-model="provinceForm.fullAddress" class="map-input">
<el-button size="small" slot="append" @click="hanleSelectMap" icon="gl-icon-location">
<!-- <img src="@/assets/map.png" alt="" class="map-icon" /> -->
......@@ -111,7 +111,7 @@ export default {
mapHeight: 380,
dialogMapVisible: false,
// 暂存地址表单
addressData: {}
addressData: {},
}
},
mounted() {
......@@ -201,7 +201,6 @@ export default {
}
},
selectProvince(val) {
console.log(val)
this.provinceForm.provinceName = val ? val.name : ''
this.provinceForm.fullAddress = ''
this.provinceForm.cityName = ''
......@@ -303,7 +302,6 @@ export default {
}
// 判断省市是否匹配
// 如果只展示省市
console.log(this.provinceForm.provinceName, provincename, '12121212')
if (this.provinceForm.provinceName && !this.provinceForm.townName) {
if (this.provinceForm.provinceName !== provincename || this.provinceForm.cityName !== cityname) {
this.$message.error('您选择的地址错误,请重新选择')
......
......@@ -11,14 +11,15 @@
let cfg = require('./conf.js')
import { Http } from 'glsx-common'
let timeout = 30000 //超时时间
export const fetchConfig = function(isEnv = false) {
if (isEnv) {
let { request } = cfg
Object.assign(request, { timeout })
return Promise.resolve(cfg)
}
return new Http().get('https://oss-config.test.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/config')
export const fetchConfig = function(common) {
// if (isEnv) {
// let { request } = cfg
// Object.assign(request, { timeout })
// return Promise.resolve(cfg)
// }
let params = { moduleName: 'setting', mockUrl: 'https://oss-config.test.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/config',httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } }
return common.utils.getConfig(params)
// return new Http().get('https://oss-config.test.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/config')
// return new Http().get('http://config-center-backend.test.glsx.com/glsxAdmin/config?moduleUrl=setting-kyq').then(res => res.data)
}
export const config = {
......
......@@ -27,7 +27,7 @@ let routes = []
let router = null
let instance = null
export async function bootstrap({ name, id, history, common, messenger, globalState, routerBase }) {
const { response, request, sign, secret, request_common, request_config, request_car, sign_common } = await fetchConfig()
const { response, request, sign, secret, request_common, request_config, request_car, sign_common } = await fetchConfig(common)
console.log(request)
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
......@@ -66,4 +66,4 @@ function subscribe({ messenger }) {
messenger.subscribe(v => {
console.log(`监听到子应用${v.from}发来消息:`, v)
})
}
\ No newline at end of file
}
......@@ -6,7 +6,7 @@
</div>
<div class="account-body scrm-box-f">
<div class="form-title">企业基本信息</div>
<base-info ref="baseInfoForm" :brandData="brandData" :accountAddForm="accountAddForm" :businessScopeCustomize="businessScopeCustomize" :businessOption="businessOption"></base-info>
<base-info ref="baseInfoForm" :provinceErr="provinceErr" :brandData="brandData" :accountAddForm="accountAddForm" :businessScopeCustomize="businessScopeCustomize" :businessOption="businessOption"></base-info>
</div>
<div class="account-body scrm-box-f">
<div class="form-title">账户信息</div>
......@@ -102,7 +102,6 @@ export default {
}
}
const validateAccountInfo = (rule, value, callback) => {
console.log(value)
if (value.length == 11 && !isNaN(value)) {
callback(new Error('登录账户名不可为 11 位纯数字'))
} else {
......@@ -233,9 +232,9 @@ export default {
},
//下一步
handleNext() {
console.log(2222)
this.loading = true
const pm1 = new Promise((resolve, reject) => {
this.$refs.baseInfoForm.$refs.baseForm.validate(valid => {
if (valid) resolve()
else {
......@@ -307,8 +306,28 @@ export default {
if (params.businessType) {
params.businessType = params.businessType.join(',')
}
// const merchantBrandList = this.$refs.baseInfoForm.$refs.brandListTree.getMerchantBrandList()
// params.merchantBrandListJson = JSON.stringify(merchantBrandList)
// 判断主营品牌
const merchantBrandList = this.$refs.baseInfoForm.$refs.brandListTree.getMerchantBrandList()
if (!merchantBrandList?.length){
this.loading = false
this.$message({
message: '请选择主营品牌',
type: 'error'
})
return
}
params.merchantBrandListJson = JSON.stringify(merchantBrandList)
// 判断省市地址填写
if (!params.provinceName || !params.cityName || !params.merchantAddress){
this.loading = false
this.$message({
message: '请选择省市地址',
type: 'error'
})
return
}
params.isloginName ? (params.isloginName = 1) : (params.isloginName = 0)
params.merchantAccountLevel = this.accountDetail.merchantAccountLevel
params.status = 1
......@@ -326,7 +345,6 @@ export default {
merchant = 'saveMerchant'
}
document.querySelector('#app').scrollTop = 0
console.log(params)
Promise.all([pm1, pm2]).then(() => {
this.$apis.store[merchant](params).then(res => {
if (res) {
......@@ -343,6 +361,8 @@ export default {
this.$refs.productForm.findMenuFunTreeByMerId(para, this.accounttypeId)
}
this.twoMerchantDetail(this.parentId)
}else{
this.loading = false
}
})
})
......
......@@ -30,8 +30,12 @@
<div class="bottom-spe">
<el-row>
<el-col :span="12">
<ProvinceCity ref="provinceForm" :subdistrict="subdistrict" @selectProvince="selectProvince" @selectCity="selectCity" :detailAddressLabel="detailAddressLabel" @selectAddressByMap="selectAddressByMap"></ProvinceCity>
</el-col>
<div class="province-sty">
<span class="province-icon">*</span>
<ProvinceCity ref="provinceForm" :subdistrict="subdistrict" @selectProvince="selectProvince" @selectCity="selectCity" :detailAddressLabel="detailAddressLabel" @selectAddressByMap="selectAddressByMap"></ProvinceCity>
</div>
<!-- <div class="province-txt">请选择省市地址</div>-->
</el-col>
<el-col :span="12">
<el-form-item label="驻店联系方式:">
<el-input maxlength="11" size="small" v-model="accountAddForm.residentContact" placeholder="请输入驻店联系人"></el-input>
......@@ -49,9 +53,12 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="主营品牌:">
<select-brand :brandListTree="brandListTree" @clickBrand="clickBrand" ref="brandListTree"></select-brand>
</el-form-item>
<div class="province-sty">
<span class="province-icon">*</span>
<el-form-item label="主营品牌:">
<select-brand :brandListTree="brandListTree" @clickBrand="clickBrand" ref="brandListTree"></select-brand>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row>
......@@ -98,6 +105,7 @@ export default {
SelectBrand
},
props: {
// provinceErr:{},
accountAddForm: {
type: Object
},
......@@ -151,7 +159,7 @@ export default {
{ required: true, message: '请输入联系电话', trigger: 'blur' },
{ validator: validatePhone, trigger: 'blur' }
],
residentPhone: [{ validator: validatePhoneTwo, trigger: 'blur' }]
residentPhone: [{ validator: validatePhoneTwo, trigger: 'blur' }],
},
brandListTree: [],
provinceCode: '',
......@@ -171,8 +179,6 @@ export default {
checkBrandList() {
// let merchantBrandMain = chant.filter(item => item)
// this.$set(this.accountAddForm, 'merchantBrandMain', merchantBrandMain)
console.log(this.accountAddForm.merchantBrandMain)
console.log(222222222)
if (!this.accountAddForm.merchantBrandMain) {
this.accountAddForm.merchantBrandMain = []
}
......@@ -505,4 +511,25 @@ export default {
}
}
}
.province-sty{
display: flex;
//position: relative;
.province-icon{
color: #f56c6c;
position: absolute;
margin-left: 72px;
margin-top: 8px;
}
//div{
// margin-left: -154px;
//}
}
.province-txt{
color: #f56c6c;
font-size: 12px;
line-height: 1;
padding-top: 4px;
margin-left: 154px;
margin-top: -20px;
}
</style>
......@@ -315,13 +315,33 @@ export default {
params.businessType = params.businessType.join(',')
}
params.merchantBrandMain = ''
// params.merchantBrand = this.$refs.baseInfoForm.$refs.brandTree.getCheckedKeys().join(',')
params.isloginName ? (params.isloginName = 1) : (params.isloginName = 0)
let businessScopeCustomize = this.businessScopeCustomize.map(item => item.name)
params.businessScopeCustomize = businessScopeCustomize.join(',')
params.merchantFiles = JSON.stringify(params.merchantFiles)
const merchantBrandList = this.$refs.baseInfoForm.$refs.brandListTree.getMerchantBrandList()
if (!merchantBrandList?.length){
this.loading = false
this.$message({
message: '请选择主营品牌',
type: 'error'
})
return
}
params.merchantBrandListJson = JSON.stringify(merchantBrandList)
// 判断省市地址填写
if (!params.provinceName || !params.cityName || !params.merchantAddress){
this.loading = false
this.$message({
message: '请选择省市地址',
type: 'error'
})
return
}
Promise.all([pm1, pm2]).then(() => {
this.$apis.store.updateMerchant(params).then(res => {
if (res) {
......
......@@ -133,6 +133,7 @@ export default {
}
]
},
buttonList: [
{
type: 'GLButton',
......
......@@ -12,7 +12,13 @@
<div class="information-title">修改企业信息</div>
<div class="information-form-box">
<el-form ref="baseForm" :model="infoForm" class="account-body-form" label-width="154px" :rules="baseFormRules">
<Province ref="provinceForm" :subdistrict="subdistrict" @selectProvince="selectProvince" @selectCity="selectCity" @selectAddressByMap="selectAddressByMap" :detailAddressLabel="detailAddressLabel"></Province>
<div class="province-sty">
<span class="province-icon">*</span>
<Province ref="provinceForm" :subdistrict="subdistrict" @selectProvince="selectProvince"
@selectCity="selectCity" @selectAddressByMap="selectAddressByMap"
:detailAddressLabel="detailAddressLabel"></Province>
</div>
<!-- <el-form-item size="small" label="商户地址:" class="map-row">
<Province ref="provinceForm" :subdistrict="subdistrict" @selectProvince="selectProvince" @selectCity="selectCity"></Province>
<el-input class="input-width" v-model="infoForm.merchantAddress" placeholder="请选择商户地址" readonly="readonly"></el-input>
......@@ -20,17 +26,26 @@
</el-form-item> -->
<el-form-item size="small" label="经营业务类型:" class="bussiness-type">
<el-checkbox-group v-model="infoForm.businessType">
<el-checkbox :label="item.dictValue" v-for="item in businessType" :key="item.dictValue" :disabled="item.dictValue <= 6">{{ item.dictLabel }}</el-checkbox>
<el-checkbox :label="item.dictValue" v-for="item in businessType" :key="item.dictValue"
:disabled="item.dictValue <= 6">{{ item.dictLabel }}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item size="small" label="营业时间:" class="time-row">
<el-time-picker size="small" value-format="HH:mm:ss" is-range v-model="infoForm.bussinessTime" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围"></el-time-picker>
<el-time-picker size="small" value-format="HH:mm:ss" is-range v-model="infoForm.bussinessTime"
range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间"
placeholder="选择时间范围"></el-time-picker>
</el-form-item>
<el-form-item size="small" label="驻店电话:" style="position: relative" prop="residentPhone">
<el-input v-model="infoForm.residentPhone" class="phone-input" maxlength="13" placeholder="此电话会在小程序上显示,请填写真实有效的电话或手机号"></el-input>
<el-input v-model="infoForm.residentPhone" class="phone-input" maxlength="13"
placeholder="此电话会在小程序上显示,请填写真实有效的电话或手机号"></el-input>
<div @click="showTelDia" class="show-address">显示位置</div>
</el-form-item>
<el-form-item size="small" label="主营品牌:" style="height: 500px">
<el-form-item size="small" style="height: 500px">
<div slot="label">
<span class="province-icon">*</span>
主营品牌:
</div>
<select-brand :brandListTree="brandListTree" @clickBrand="clickBrand" ref="brandListTree"></select-brand>
</el-form-item>
</el-form>
......@@ -61,6 +76,7 @@ import util from '@/utils/util'
import SelectBrand from './selectBrand.vue'
import TelPosition from './telPosition.vue'
import Province from '@/components/province-city/index.vue'
export default {
name: 'EditInfo',
components: {
......@@ -103,7 +119,7 @@ export default {
brandListTree: [],
isFirstBrand: false,
baseFormRules: {
residentPhone: [{ validator: validatePhoneTwo, trigger: 'blur' }]
residentPhone: [{validator: validatePhoneTwo, trigger: 'blur'}]
},
addressData: {}
}
......@@ -130,9 +146,28 @@ export default {
})
},
async getUserInfo() {
this.businessType = await this.$apis.store.findAllDictData({ dictType: 'business_type' })
const infoForm = await this.$apis.store.findMerchantBaseInfo({ merchantId: this.$globalState.session.merchantId })
const { merchantAddress, provinceName, residentPhone, cityName, provinceCode, cityCode, lng, lat, id, merchantName, businessType, bussinessTime, bussinessBegintime, bussinessEndtime, channelId, merchantNo, merchantBrandMain, merchantBrandName } = infoForm
this.businessType = await this.$apis.store.findAllDictData({dictType: 'business_type'})
const infoForm = await this.$apis.store.findMerchantBaseInfo({merchantId: this.$globalState.session.merchantId})
const {
merchantAddress,
provinceName,
residentPhone,
cityName,
provinceCode,
cityCode,
lng,
lat,
id,
merchantName,
businessType,
bussinessTime,
bussinessBegintime,
bussinessEndtime,
channelId,
merchantNo,
merchantBrandMain,
merchantBrandName
} = infoForm
this.infoForm = {
merchantAddress,
lng,
......@@ -265,7 +300,7 @@ export default {
// 通过地图选择省市和详细地址
selectAddressByMap(val) {
console.log(val)
const { provinceName, cityName, fullAddress, lat, lng } = val
const {provinceName, cityName, fullAddress, lat, lng} = val
this.infoForm.merchantAddress = fullAddress
this.infoForm.provinceName = provinceName
this.infoForm.cityName = cityName
......@@ -291,13 +326,22 @@ export default {
}
params.merchantBrandMain = ''
// 获取省市信息
const { provinceName, provinceCode, cityName, cityCode } = this.$refs.provinceForm.provinceForm
const {provinceName, provinceCode, cityName, cityCode} = this.$refs.provinceForm.provinceForm
if (!params.provinceCode) {
params.provinceName = provinceName
params.provinceCode = provinceCode
params.cityName = cityName
params.cityCode = cityCode
}
// 判断省市地址填写
if (!params.provinceName || !params.cityName || !params.merchantAddress) {
this.$message({
message: '请选择省市地址',
type: 'error'
})
return
}
if (params.bussinessTime) {
params.bussinessBegintime = params.bussinessTime[0]
params.bussinessEndtime = params.bussinessTime[1]
......@@ -306,13 +350,22 @@ export default {
params.bussinessEndtime = ''
}
delete params.stores
params.businessType = params.businessType.join(',')
params.businessType = typeof params.businessType == 'string' ? params.businessType : params.businessType.join(',')
//merchantBrandMain 品牌id
const merchantBrandList = this.$refs.brandListTree.getMerchantBrandList()
if (!merchantBrandList?.length) {
this.loading = false
this.$message({
message: '请选择主营品牌',
type: 'error'
})
return
}
params.merchantBrandListJson = JSON.stringify(merchantBrandList)
this.$apis.store.updateMerchant(params).then(res => {
if (res) {
this.$router.push({ path: '/baseInfo/index' })
this.$router.push({path: '/baseInfo/index'})
}
})
},
......@@ -329,6 +382,7 @@ export default {
border-radius: 2px;
min-height: calc(100% - 80px);
margin-bottom: 20px;
.information-title {
height: 58px;
line-height: 58px;
......@@ -338,17 +392,21 @@ export default {
padding-left: 20px;
border-bottom: 1px solid #dcdfe6;
}
.information-form-box {
// width: 50%;
padding-top: 30px;
.map-row {
/deep/ .el-form-item__content {
display: flex;
}
.el-input {
margin-right: 10px;
}
}
.time-row {
/deep/ .el-input__inner {
width: 100%;
......@@ -356,6 +414,7 @@ export default {
}
}
}
.show-address {
position: absolute;
right: -66px;
......@@ -365,27 +424,48 @@ export default {
color: #5850ff;
cursor: pointer;
}
.input-width {
// min-width: 200px;
flex: 1;
}
/deep/ {
.el-form-item {
margin-bottom: 20px !important;
}
.el-form-item__content {
width: 432px;
}
.tree-box {
border: 1px solid #e5e5e5;
}
.el-checkbox:last-of-type {
margin-right: 7px;
}
}
.bussiness-type {
/deep/ .el-form-item__content {
min-width: 1000px;
}
}
.province-icon {
color: #f56c6c;
}
.province-sty {
display: flex;
//position: relative;
.province-icon {
color: #f56c6c;
position: absolute;
margin-left: 72px;
margin-top: 12px;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!