Commit f3bf3093 by 徐忆琳

Merge branch 'xuyl_dev_v3.12.0' into 'v3.12.0'

修改页面添加校验

See merge request !98
2 parents 1b1ccc42 24c0a094
......@@ -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!