|
@@ -176,12 +176,17 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<el-form-item label="已关联机构:">
|
|
<el-form-item label="已关联机构:">
|
|
- <el-button size="mini" type="primary">关联机构</el-button>
|
|
|
|
|
|
+ <el-button size="mini" type="primary" @click="onChooseAssClub">关联机构</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-form-item>
|
|
- <associated-club-list :selection="false" :control="true">
|
|
|
|
- <template #control>
|
|
|
|
- <el-button size="mini" type="danger">删除</el-button>
|
|
|
|
|
|
+ <associated-club-list
|
|
|
|
+ :selection="false"
|
|
|
|
+ :control="true"
|
|
|
|
+ :list="filterSelectAssClubList"
|
|
|
|
+ @filter="onFilterSelectAssClubList"
|
|
|
|
+ >
|
|
|
|
+ <template #control="{ row }">
|
|
|
|
+ <el-button size="mini" type="danger" @click="onAssClubListRemove(row)">删除</el-button>
|
|
</template>
|
|
</template>
|
|
</associated-club-list>
|
|
</associated-club-list>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -207,11 +212,19 @@
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 关联机构 -->
|
|
<!-- 关联机构 -->
|
|
- <el-dialog title="添加关联机构" :visible.sync="dialogClubVisible" width="30%" :show-close="false">
|
|
|
|
- <associated-club-list :selection="true" :control="false" />
|
|
|
|
|
|
+ <el-dialog title="添加关联机构" :visible.sync="assClubListVisible" width="30%" :show-close="false">
|
|
|
|
+ <associated-club-list
|
|
|
|
+ v-if="assClubListVisible"
|
|
|
|
+ :selection="true"
|
|
|
|
+ :control="false"
|
|
|
|
+ height="280"
|
|
|
|
+ :list="assClubList"
|
|
|
|
+ @filter="onFilterAssClubList"
|
|
|
|
+ @selected="onAssClubListChange"
|
|
|
|
+ />
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
- <el-button type="primary" size="mini" @click="dialogClubVisible = false">取 消</el-button>
|
|
|
|
- <el-button type="primary" size="mini" @click="dialogClubVisible = false">确 定</el-button>
|
|
|
|
|
|
+ <el-button type="primary" size="mini" @click="onAssClubListCancel">取 消</el-button>
|
|
|
|
+ <el-button type="primary" size="mini" @click="onAssClubListConfirm">确 定</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</div>
|
|
</div>
|
|
@@ -222,7 +235,7 @@ import SimpleAMap from '@/components/SimpleAMap'
|
|
import UploadImage from '@/components/UploadImage'
|
|
import UploadImage from '@/components/UploadImage'
|
|
import { AssociatedClubList } from '@/views/components/index'
|
|
import { AssociatedClubList } from '@/views/components/index'
|
|
import { mapGetters } from 'vuex'
|
|
import { mapGetters } from 'vuex'
|
|
-import { saveBrandAuth, getAuthFormData } from '@/api/auth'
|
|
|
|
|
|
+import { saveBrandAuth, getAuthFormData, fecthAuthList } from '@/api/auth'
|
|
import { getAddress } from '@/api/common'
|
|
import { getAddress } from '@/api/common'
|
|
import { isPoint, isMobile, isNumber } from '@/utils/validate'
|
|
import { isPoint, isMobile, isNumber } from '@/utils/validate'
|
|
import { formatDate } from '@/utils'
|
|
import { formatDate } from '@/utils'
|
|
@@ -274,13 +287,12 @@ export default {
|
|
value: [],
|
|
value: [],
|
|
options: [],
|
|
options: [],
|
|
|
|
|
|
- dialogClubVisible: true,
|
|
|
|
|
|
+ assClubListVisible: false,
|
|
|
|
|
|
authId: '',
|
|
authId: '',
|
|
disabled: false,
|
|
disabled: false,
|
|
area: '',
|
|
area: '',
|
|
formData: {
|
|
formData: {
|
|
- relationId: '',
|
|
|
|
authParty: '',
|
|
authParty: '',
|
|
address: [],
|
|
address: [],
|
|
fullAddress: '',
|
|
fullAddress: '',
|
|
@@ -303,7 +315,10 @@ export default {
|
|
authImage: '',
|
|
authImage: '',
|
|
// 新增运营人字段
|
|
// 新增运营人字段
|
|
linkMan: '',
|
|
linkMan: '',
|
|
- linkMobile: ''
|
|
|
|
|
|
+ linkMobile: '',
|
|
|
|
+ // 机构关联
|
|
|
|
+ relationId: '',
|
|
|
|
+ relationName: ''
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
authParty: [{ required: true, message: '机构名称不能为空', trigger: ['blur', 'change'] }],
|
|
authParty: [{ required: true, message: '机构名称不能为空', trigger: ['blur', 'change'] }],
|
|
@@ -335,7 +350,17 @@ export default {
|
|
validatorFields: {
|
|
validatorFields: {
|
|
authImageLogoWidth: 100,
|
|
authImageLogoWidth: 100,
|
|
authImageLogoHeight: 100
|
|
authImageLogoHeight: 100
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ // 关联机构相关
|
|
|
|
+ assClubQuery: {
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: 1000,
|
|
|
|
+ authParty: ''
|
|
|
|
+ },
|
|
|
|
+ assClubList: [], // 关联机构列表
|
|
|
|
+ selectAssClubList: [], // 当前选中关联机构列表
|
|
|
|
+ selectAssClubListAll: [], // 全部选中关联机构列表
|
|
|
|
+ filterSelectAssClubList: [] // 筛选后的关联机构列表
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -376,9 +401,67 @@ export default {
|
|
this.editType = this.$route.query.type || 'add'
|
|
this.editType = this.$route.query.type || 'add'
|
|
this.authId = this.$route.query.id
|
|
this.authId = this.$route.query.id
|
|
this.initFormData()
|
|
this.initFormData()
|
|
- this.fetchAuthTempUsed()
|
|
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 关联机构选择
|
|
|
|
+ onChooseAssClub() {
|
|
|
|
+ this.fetchAssClubList()
|
|
|
|
+ this.assClubListVisible = true
|
|
|
|
+ },
|
|
|
|
+ // 获取关联机构列表
|
|
|
|
+ async fetchAssClubList() {
|
|
|
|
+ try {
|
|
|
|
+ const excludeId = this.selectAssClubListAll.map((item) => item.authId)
|
|
|
|
+ if (this.authId) {
|
|
|
|
+ excludeId.push(parseInt(this.authId))
|
|
|
|
+ }
|
|
|
|
+ const res = await fecthAuthList(this.assClubQuery)
|
|
|
|
+ this.assClubList = res.data.list.filter((item) => !excludeId.includes(item.authId))
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.log(error)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 关联机构列表筛选
|
|
|
|
+ onFilterAssClubList(query) {
|
|
|
|
+ this.assClubQuery.authParty = query.authParty
|
|
|
|
+ this.fetchAssClubList()
|
|
|
|
+ },
|
|
|
|
+ // 关联机构列表选中
|
|
|
|
+ onAssClubListChange(value) {
|
|
|
|
+ this.selectAssClubList = value
|
|
|
|
+ },
|
|
|
|
+ // 关联机构选中列表确认
|
|
|
|
+ onAssClubListConfirm() {
|
|
|
|
+ this.selectAssClubListAll = [...this.selectAssClubListAll, ...this.selectAssClubList]
|
|
|
|
+ this.filterSelectAssClubList = this.selectAssClubListAll
|
|
|
|
+ this.assClubQuery.authParty = ''
|
|
|
|
+ this.assClubList = []
|
|
|
|
+ this.assClubListVisible = false
|
|
|
|
+ },
|
|
|
|
+ // 关联机构选中列表取消
|
|
|
|
+ onAssClubListCancel() {
|
|
|
|
+ this.selectAssClubList = []
|
|
|
|
+ this.filterSelectAssClubList = this.selectAssClubListAll
|
|
|
|
+ this.assClubQuery.authParty = ''
|
|
|
|
+ this.assClubList = []
|
|
|
|
+ this.assClubListVisible = false
|
|
|
|
+ },
|
|
|
|
+ // 已关联机构列表筛选
|
|
|
|
+ onFilterSelectAssClubList(query) {
|
|
|
|
+ if (query.authParty) {
|
|
|
|
+ this.filterSelectAssClubList = this.selectAssClubListAll.filter((item) =>
|
|
|
|
+ new RegExp(query.authParty, 'ig').test(item.authParty)
|
|
|
|
+ )
|
|
|
|
+ } else {
|
|
|
|
+ this.filterSelectAssClubList = this.selectAssClubListAll
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 已关联机构列表删除
|
|
|
|
+ onAssClubListRemove(row) {
|
|
|
|
+ this.selectAssClubListAll = this.selectAssClubListAll.filter((item) => item.authId !== row.authId)
|
|
|
|
+ this.filterSelectAssClubList = this.selectAssClubListAll
|
|
|
|
+ },
|
|
|
|
+
|
|
// 地图定位
|
|
// 地图定位
|
|
initMap() {
|
|
initMap() {
|
|
this.dialogMapVisible = true
|
|
this.dialogMapVisible = true
|
|
@@ -418,6 +501,7 @@ export default {
|
|
this.formData.logo = res.data.logo || ''
|
|
this.formData.logo = res.data.logo || ''
|
|
this.formData.banner = res.data.bannerList.length || ''
|
|
this.formData.banner = res.data.bannerList.length || ''
|
|
this.formData.relationId = res.data.relationId
|
|
this.formData.relationId = res.data.relationId
|
|
|
|
+ this.formData.relationName = res.data.relationName
|
|
|
|
|
|
this.formData.customFlag = res.data.customFlag
|
|
this.formData.customFlag = res.data.customFlag
|
|
this.formData.remarks = res.data.remarks
|
|
this.formData.remarks = res.data.remarks
|
|
@@ -464,6 +548,12 @@ export default {
|
|
// 运营人相关
|
|
// 运营人相关
|
|
this.formData.linkMan = res.data.linkMan
|
|
this.formData.linkMan = res.data.linkMan
|
|
this.formData.linkMobile = res.data.linkMobile
|
|
this.formData.linkMobile = res.data.linkMobile
|
|
|
|
+
|
|
|
|
+ // 关联机构列表
|
|
|
|
+ if (res.data.releationClubList) {
|
|
|
|
+ this.selectAssClubListAll = res.data.releationClubList
|
|
|
|
+ this.filterSelectAssClubList = this.selectAssClubListAll
|
|
|
|
+ }
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
@@ -520,7 +610,9 @@ export default {
|
|
authImageLogo,
|
|
authImageLogo,
|
|
authImage,
|
|
authImage,
|
|
linkMan,
|
|
linkMan,
|
|
- linkMobile
|
|
|
|
|
|
+ linkMobile,
|
|
|
|
+ relationId: this.selectAssClubListAll.map((item) => item.authId).join(','),
|
|
|
|
+ relationName: this.selectAssClubListAll.map((item) => item.authParty).join(',')
|
|
}
|
|
}
|
|
|
|
|
|
data.bannerList = this.bannerList.map((item) => (item.response ? item.response.data : item.url))
|
|
data.bannerList = this.bannerList.map((item) => (item.response ? item.response.data : item.url))
|