Commit a10a1d7e by chenwq

地图样式。loading

1 parent 8f29722d
......@@ -369,7 +369,7 @@ export default {
width: 136px !important;
}
.gl-form-page .el-form .province-textarea .el-textarea {
width: 432px !important;
width: 580px !important;
}
.province-textarea {
position: relative;
......
......@@ -3,19 +3,21 @@
<div class="edit-zone shop edit-box">
<div class="container edit-container all-page">
<p class="page-title">基础信息</p>
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :isWatch="isWatch" :labelWidth="defaultLabelWidth" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="map" slot-scope="scope" class="flex">
<span class="province-icon">*</span>
<Province ref="provinceForm" :subdistrict="subdistrict" :provinceLabel="scope.scope.labelName" :inline="scope.scope.inline" @selectProvince="selectProvince" @selectCity="selectCity" @selectAddressByMap="selectAddressByMap" :detailAddressLabel="detailAddressLabel"></Province>
</div>
<div slot="business" slot-scope="scope" class="business">
<el-select v-model="editForm[scope.scope.name]" multiple filterable placeholder="请选择" @change="handleMutiSelctChange">
<el-option-group v-for="group in baseData.sceneList" :key="group.sceneCode" :label="group.name">
<el-option v-for="item in group.productList" :key="item.productCode" :label="item.productName" :value="item.productCode"></el-option>
</el-option-group>
</el-select>
</div>
</glsx-combi-form>
<div v-loading="loading">
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :isWatch="isWatch" :labelWidth="defaultLabelWidth" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="map" slot-scope="scope" class="flex">
<span class="province-icon">*</span>
<Province ref="provinceForm" :subdistrict="subdistrict" :provinceLabel="scope.scope.labelName" :inline="scope.scope.inline" @selectProvince="selectProvince" @selectCity="selectCity" @selectAddressByMap="selectAddressByMap" :detailAddressLabel="detailAddressLabel"></Province>
</div>
<div slot="business" slot-scope="scope" class="business">
<el-select v-model="editForm[scope.scope.name]" multiple filterable collapse-tags placeholder="请选择" @change="handleMutiSelctChange">
<el-option-group v-for="group in baseData.sceneList" :key="group.sceneCode" :label="group.name">
<el-option v-for="item in group.productList" :key="item.productCode" :label="item.productName" :value="item.productCode"></el-option>
</el-option-group>
</el-select>
</div>
</glsx-combi-form>
</div>
</div>
<GLFooter class="m-t-20">
<el-button @click="handleCancel" size="medium">取消</el-button>
......@@ -39,6 +41,7 @@ export default {
editType: 'add',
id: ''
},
loading: false,
editStatus: false,
editForm: {
shopMerchantId: '',
......@@ -96,7 +99,7 @@ export default {
label: '联系人',
name: 'contactName',
type: 'input',
maxlength: 20
maxlength: 10
},
{
label: '联系电话',
......@@ -207,34 +210,40 @@ export default {
oldPhone: this.routeInfo.merchantInfo?.phone,
oldMerchantName: this.routeInfo.merchantInfo.shopMerchantName || ''
}
this.$apis.customer.getMerchantInfo({ merchantId: this.routeInfo.merchantInfo.shopMerchantId }).then(res => {
this.editForm.provinceCode = res.provinceCode
this.editForm.provinceName = res.provinceName
this.editForm.cityCode = res.cityCode
this.editForm.cityName = res.cityName
this.editForm.latitude = res.lat
this.editForm.longitude = res.lng
this.editForm.merchantAddress = res.merchantAddress
const merchantBrandList = res.brandTreeList || []
this.editForm.merchantBrandList = []
this.editForm.merchantBrandIds = ''
merchantBrandList.forEach(item => {
this.editForm.merchantBrandList.push({
merchantFirstBrandDetail: {
id: item.id,
name: item.name
},
merchantSecondBrandDetailList: item.subList
this.loading = true
this.$apis.customer
.getMerchantInfo({ merchantId: this.routeInfo.merchantInfo.shopMerchantId })
.then(res => {
this.editForm.provinceCode = res.provinceCode
this.editForm.provinceName = res.provinceName
this.editForm.cityCode = res.cityCode
this.editForm.cityName = res.cityName
this.editForm.latitude = res.lat
this.editForm.longitude = res.lng
this.editForm.merchantAddress = res.merchantAddress
const merchantBrandList = res.brandTreeList || []
this.editForm.merchantBrandList = []
this.editForm.merchantBrandIds = ''
merchantBrandList.forEach(item => {
this.editForm.merchantBrandList.push({
merchantFirstBrandDetail: {
id: item.id,
name: item.name
},
merchantSecondBrandDetailList: item.subList
})
this.editForm.merchantBrandIds = this.editForm.merchantBrandIds + (this.editForm.merchantBrandIds ? ',' : '') + item.subList.map(k => k.id).join(',')
})
this.editForm.merchantBrandIds = this.editForm.merchantBrandIds.split(',')
this.$refs.editFormRef.brandList()
this.$refs.provinceForm && this.$refs.provinceForm.init(this.editForm)
this.$nextTick(() => {
this.editStatus = false
})
this.editForm.merchantBrandIds = this.editForm.merchantBrandIds + (this.editForm.merchantBrandIds ? ',' : '') + item.subList.map(k => k.id).join(',')
})
this.editForm.merchantBrandIds = this.editForm.merchantBrandIds.split(',')
this.$refs.editFormRef.brandList()
this.$refs.provinceForm && this.$refs.provinceForm.init(this.editForm)
this.$nextTick(() => {
this.editStatus = false
.finally(() => {
this.loading = false
})
})
},
hasDuplicate(arr1, arr2) {
const set1 = new Set(arr1)
......@@ -265,7 +274,6 @@ export default {
return
}
if (!this.editForm.merchantBrandList?.length) {
this.loading = false
this.$message({
message: '请选择主营品牌',
type: 'error'
......@@ -290,15 +298,20 @@ export default {
})
.then(() => {
const apiName = this.routeInfo.editType == 'edit' ? 'updateMerchant' : 'createMerchant'
this.$apis.customer[apiName](params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
this.loading = true
this.$apis.customer[apiName](params)
.then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.cancelJump()
}
})
.finally(() => {
this.loading = false
})
if (res.code == '0') {
this.cancelJump()
}
})
})
.catch(() => { })
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!