Commit 1bc32cb3 by 前端

Merge branch 'hy_dev_v2.0.0' into 'v2.0.0'

修改主营品牌和经营业务类型

See merge request !9
2 parents ee792b8f 548e3445
...@@ -299,7 +299,9 @@ export default { ...@@ -299,7 +299,9 @@ export default {
if (params.businessType) { if (params.businessType) {
params.businessType = params.businessType.join(',') params.businessType = params.businessType.join(',')
} }
params.merchantBrand = this.$refs.baseInfoForm.$refs.brandTree.getCheckedKeys().join(',') const getCheckedArr = this.$refs.baseInfoForm.$refs.brandListTree.getCheckedArr
const merchantBrandMain = getCheckedArr.map(item => item.id)
params.merchantBrandMain = merchantBrandMain.join(',')
params.isloginName ? (params.isloginName = 1) : (params.isloginName = 0) params.isloginName ? (params.isloginName = 1) : (params.isloginName = 0)
params.merchantAccountLevel = this.accountDetail.merchantAccountLevel params.merchantAccountLevel = this.accountDetail.merchantAccountLevel
params.status = 1 params.status = 1
...@@ -405,6 +407,7 @@ export default { ...@@ -405,6 +407,7 @@ export default {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.accountAddForm.parentId = this.$route.params.id this.accountAddForm.parentId = this.$route.params.id
this.$refs.baseInfoForm.checkBusinessType()
this.findMerchantDetail() this.findMerchantDetail()
this.getCarbrandTree() this.getCarbrandTree()
this.findAllDictData('business_type') this.findAllDictData('business_type')
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item label="经营业务类型"> <el-form-item label="经营业务类型">
<el-checkbox-group v-model="accountAddForm.businessType"> <el-checkbox-group v-model="accountAddForm.businessType">
<el-checkbox v-for="item in businessOption" :label="item.dictValue" :key="item">{{ item.dictLabel }}</el-checkbox> <el-checkbox v-for="item in businessType" :label="item.dictValue" :disabled="item.dictValue <= 6" :key="item">{{ item.dictLabel }}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
<!-- <div class="scrm-flex-center" v-for="(item, index) in businessScopeCustomize" :key="index"> <!-- <div class="scrm-flex-center" v-for="(item, index) in businessScopeCustomize" :key="index">
<el-input size="small" v-model="businessScopeCustomize[index].name" placeholder="请自定义营业范围,建议不超过10个"></el-input> <el-input size="small" v-model="businessScopeCustomize[index].name" placeholder="请自定义营业范围,建议不超过10个"></el-input>
...@@ -101,10 +101,11 @@ ...@@ -101,10 +101,11 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="主营品牌"> <el-form-item label="主营品牌">
<el-input size="small" v-model="filterText"></el-input> <select-brand :brandListTree="brandListTree" ref="brandListTree"></select-brand>
<!-- <el-input size="small" v-model="filterText"></el-input>
<div class="brand-tree"> <div class="brand-tree">
<el-tree :data="brandData" show-checkbox default-expand-all node-key="id" ref="brandTree" highlight-current :props="defaultProps" :filter-node-method="filterNode" @check="clickDeal"></el-tree> <el-tree :data="brandData" show-checkbox default-expand-all node-key="id" ref="brandTree" highlight-current :props="defaultProps" :filter-node-method="filterNode" @check="clickDeal"></el-tree>
</div> </div> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
...@@ -141,10 +142,12 @@ ...@@ -141,10 +142,12 @@
<script> <script>
import util from '@/utils/util' import util from '@/utils/util'
import mapView from '@/components/mapView/index' import mapView from '@/components/mapView/index'
import SelectBrand from '../../baseInfo/selectBrand.vue'
export default { export default {
name: 'base', name: 'base',
components: { components: {
mapView mapView,
SelectBrand
}, },
props: { props: {
accountAddForm: { accountAddForm: {
...@@ -187,7 +190,8 @@ export default { ...@@ -187,7 +190,8 @@ export default {
{ required: true, message: '请输入联系电话', trigger: 'blur' }, { required: true, message: '请输入联系电话', trigger: 'blur' },
{ validator: validatePhone, trigger: 'blur' } { validator: validatePhone, trigger: 'blur' }
] ]
} },
brandListTree: []
} }
}, },
watch: { watch: {
...@@ -196,6 +200,42 @@ export default { ...@@ -196,6 +200,42 @@ export default {
} }
}, },
methods: { methods: {
checkBrandList(merchantBrandMain) {
this.$set(this.accountAddForm, 'merchantBrandMain', merchantBrandMain)
if (!this.accountAddForm.merchantBrandMain) {
this.accountAddForm.merchantBrandMain = []
} else {
this.accountAddForm.merchantBrandMain = this.accountAddForm.merchantBrandMain.split(',')
}
this.$refs.brandListTree.getCheckList(this.accountAddForm.merchantBrandMain)
},
checkBusinessType(type) {
if (!type) {
this.accountAddForm.businessType = [1, 2, 3, 4, 5, 6]
} else {
const businessType = type.split(',')
this.$set(
this.accountAddForm,
'businessType',
businessType.map(item => (item = parseInt(item)))
)
}
},
async brandList() {
this.$refs.brandListTree.loading = true
this.businessType = await this.$apis.store.findAllDictData({ dictType: 'business_type' })
const brandListTree = await this.$apis.baseInfo.brandList({ needCarSeries: true })
brandListTree.forEach(item => {
let child = item.childs
child.forEach(k => {
delete k.childs
})
})
this.brandListTree = brandListTree
this.$nextTick(() => {
this.$refs.brandListTree.loading = false
})
},
hanleSelectMap() { hanleSelectMap() {
this.dialogMapVisible = true this.dialogMapVisible = true
this.$nextTick(() => { this.$nextTick(() => {
...@@ -275,7 +315,9 @@ export default { ...@@ -275,7 +315,9 @@ export default {
} }
}, },
mounted() {} mounted() {
this.brandList()
}
} }
</script> </script>
......
...@@ -141,7 +141,7 @@ export default { ...@@ -141,7 +141,7 @@ export default {
merchantAccountLevel: null, merchantAccountLevel: null,
parentId: null, parentId: null,
merchantModel: null, merchantModel: null,
businessType: [], businessScope: [],
bussinessTime: [], bussinessTime: [],
merchantFiles: [] merchantFiles: []
}, },
...@@ -309,11 +309,14 @@ export default { ...@@ -309,11 +309,14 @@ export default {
if (params.businessType) { if (params.businessType) {
params.businessType = params.businessType.join(',') params.businessType = params.businessType.join(',')
} }
params.merchantBrand = this.$refs.baseInfoForm.$refs.brandTree.getCheckedKeys().join(',') // params.merchantBrand = this.$refs.baseInfoForm.$refs.brandTree.getCheckedKeys().join(',')
params.isloginName ? (params.isloginName = 1) : (params.isloginName = 0) params.isloginName ? (params.isloginName = 1) : (params.isloginName = 0)
// let businessScopeCustomize = this.businessScopeCustomize.map(item => item.name) let businessScopeCustomize = this.businessScopeCustomize.map(item => item.name)
// params.businessScopeCustomize = businessScopeCustomize.join(',') params.businessScopeCustomize = businessScopeCustomize.join(',')
params.merchantFiles = JSON.stringify(params.merchantFiles) params.merchantFiles = JSON.stringify(params.merchantFiles)
const getCheckedArr = this.$refs.baseInfoForm.$refs.brandListTree.getCheckedArr
const merchantBrandMain = getCheckedArr.map(item => item.id)
params.merchantBrandMain = merchantBrandMain.join(',')
Promise.all([pm1, pm2]).then(() => { Promise.all([pm1, pm2]).then(() => {
this.$apis.store.updateMerchant(params).then(res => { this.$apis.store.updateMerchant(params).then(res => {
if (res) { if (res) {
...@@ -326,7 +329,7 @@ export default { ...@@ -326,7 +329,7 @@ export default {
let accountLevel = this.$apis.store.findAllDictData({ dictType: 'account_level' }) let accountLevel = this.$apis.store.findAllDictData({ dictType: 'account_level' })
let accountType = this.$apis.store.findAllDictData({ dictType: 'account_type' }) let accountType = this.$apis.store.findAllDictData({ dictType: 'account_type' })
let businessOption = this.$apis.store.findAllDictData({ let businessOption = this.$apis.store.findAllDictData({
dictType: 'business_type' dictType: 'business_scope'
}) })
await Promise.all([accountLevel, accountType, businessOption]).then(res => { await Promise.all([accountLevel, accountType, businessOption]).then(res => {
;[this.accountLevel, this.accountType, this.businessOption] = res ;[this.accountLevel, this.accountType, this.businessOption] = res
...@@ -359,27 +362,27 @@ export default { ...@@ -359,27 +362,27 @@ export default {
}) })
}, },
renderView(res) { renderView(res) {
let { isloginName, bussinessBegintime, bussinessEndtime, lat, lng, merchantAddress, merchantName, merchantAbbreviation, merchantType, merchantOrgcode, merchantLegalPerson, merchantLegalPersonPhone, residentContact, residentPhone, merchantLoginAccount, merchantLoginPassword, merchantAccountLevel, businessType, businessScopeCustomize, merchantBrand, merchantFileResponses, merchantModel, accountTypes, accountType, accounttypeId, channelId, status, parentId } = res let { isloginName, bussinessBegintime, bussinessEndtime, lat, merchantBrandMain, businessType, lng, merchantAddress, merchantName, merchantAbbreviation, merchantType, merchantOrgcode, merchantLegalPerson, merchantLegalPersonPhone, residentContact, residentPhone, merchantLoginAccount, merchantLoginPassword, merchantAccountLevel, businessScope, businessScopeCustomize, merchantBrand, merchantFileResponses, merchantModel, accountTypes, accountType, accounttypeId, channelId, status, parentId } = res
this.accountInfoForm.merchantLoginAccount = merchantLoginAccount this.accountInfoForm.merchantLoginAccount = merchantLoginAccount
this.accountInfoForm.merchantLoginPassword = merchantLoginPassword this.accountInfoForm.merchantLoginPassword = merchantLoginPassword
this.accountTypes = accountTypes this.accountTypes = accountTypes
this.accountAddForm.businessType = businessType ? businessType.split(',') : [] this.accountAddForm.businessScope = businessScope ? businessScope.split(',') : []
if (this.accountAddForm.businessType.length > 0) { if (this.accountAddForm.businessScope.length > 0) {
for (let i in this.accountAddForm.businessType) { for (let i in this.accountAddForm.businessScope) {
this.accountAddForm.businessType[i] = parseInt(this.accountAddForm.businessType[i]) this.accountAddForm.businessScope[i] = parseInt(this.accountAddForm.businessScope[i])
} }
} }
this.accountAddForm.bussinessTime = [bussinessBegintime, bussinessEndtime] this.accountAddForm.bussinessTime = [bussinessBegintime, bussinessEndtime]
// businessScopeCustomize = businessScopeCustomize ? businessScopeCustomize.split(',') : [] businessScopeCustomize = businessScopeCustomize ? businessScopeCustomize.split(',') : []
// if (businessScopeCustomize.length > 0) { if (businessScopeCustomize.length > 0) {
// this.businessScopeCustomize = businessScopeCustomize.map(item => { this.businessScopeCustomize = businessScopeCustomize.map(item => {
// return { return {
// name: item name: item
// } }
// }) })
// } else { } else {
// this.businessScopeCustomize = [{ name: '' }] this.businessScopeCustomize = [{ name: '' }]
// } }
this.accounttypeId = accountType ? accountType.split(',') : [] this.accounttypeId = accountType ? accountType.split(',') : []
if (this.accounttypeId.length > 0) { if (this.accounttypeId.length > 0) {
this.accounttypeId = this.accounttypeId.map(item => { this.accounttypeId = this.accounttypeId.map(item => {
...@@ -399,7 +402,7 @@ export default { ...@@ -399,7 +402,7 @@ export default {
for (let i in merchantBrand) { for (let i in merchantBrand) {
merchantBrand[i] = parseInt(merchantBrand[i]) merchantBrand[i] = parseInt(merchantBrand[i])
} }
this.$refs.baseInfoForm.$refs.brandTree.setCheckedKeys(merchantBrand) // this.$refs.baseInfoForm.$refs.brandTree.setCheckedKeys(merchantBrand)
this.accountAddForm = Object.assign(this.accountAddForm, { this.accountAddForm = Object.assign(this.accountAddForm, {
isloginName: isloginName ? true : false, isloginName: isloginName ? true : false,
lat, lat,
...@@ -418,8 +421,11 @@ export default { ...@@ -418,8 +421,11 @@ export default {
parentId, parentId,
channelId, channelId,
status, status,
accounttypeId: accountType accounttypeId: accountType,
merchantBrandMain
}) })
this.$refs.baseInfoForm.checkBrandList(merchantBrandMain)
this.$refs.baseInfoForm.checkBusinessType(businessType)
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.baseInfoForm.$refs.baseForm.validate() this.$refs.baseInfoForm.$refs.baseForm.validate()
this.editStatus = false this.editStatus = false
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2022-03-02 18:28:20 * @Date: 2022-03-02 18:28:20
* @LastEditTime: 2022-03-12 14:18:52 * @LastEditTime: 2022-03-14 18:24:08
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \scrm-micro-settings\src\views\approvalConfig\index.vue * @FilePath: \scrm-micro-settings\src\views\approvalConfig\index.vue
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
<div class="config-page" :style="{ 'min-height': clientHeight + 'px' }"> <div class="config-page" :style="{ 'min-height': clientHeight + 'px' }">
<div class="page-title"> <div class="page-title">
审批配置 审批配置
<!-- <GLButton type="text" class="guide-btn" @click="jumpGuide" fn="审批模板创建指引">查看创建审批模板指引</GLButton> --> <GLButton type="text" class="guide-btn" @click="jumpGuide" fn="审批模板创建指引">查看创建审批模板指引</GLButton>
<el-button type="text" class="guide-btn" @click="jumpGuide">查看创建审批模板指引></el-button> <!-- <el-button type="text" class="guide-btn" @click="jumpGuide">查看创建审批模板指引></el-button> -->
</div> </div>
<div class="config-list"> <div class="config-list">
<div class="config-item" v-for="(item, index) in configList" :key="item.id"> <div class="config-item" v-for="(item, index) in configList" :key="item.id">
...@@ -77,7 +77,6 @@ export default { ...@@ -77,7 +77,6 @@ export default {
this.getApprove() this.getApprove()
}, },
mounted() { mounted() {
this.oldConfig = util.deepClone(this.config)
this.clientHeight = document.documentElement.scrollHeight - 140 this.clientHeight = document.documentElement.scrollHeight - 140
}, },
methods: { methods: {
...@@ -85,7 +84,7 @@ export default { ...@@ -85,7 +84,7 @@ export default {
edit(index) { edit(index) {
this.configList[index].disabled = false this.configList[index].disabled = false
}, },
// 编辑 // 提交
submit(model, index) { submit(model, index) {
this.oldConfig[model] = this.config[model] this.oldConfig[model] = this.config[model]
this.configList[index].disabled = true this.configList[index].disabled = true
...@@ -109,6 +108,7 @@ export default { ...@@ -109,6 +108,7 @@ export default {
}, },
// 取消 // 取消
cancel(model, index) { cancel(model, index) {
console.log(this.oldConfig[model])
this.config[model] = this.oldConfig[model] this.config[model] = this.oldConfig[model]
this.configList[index].disabled = true this.configList[index].disabled = true
}, },
...@@ -121,6 +121,7 @@ export default { ...@@ -121,6 +121,7 @@ export default {
// const merchantId = 44209572 // const merchantId = 44209572
this.$apis.approvalConfig.getApproveDetail({ merchantId }).then(res => { this.$apis.approvalConfig.getApproveDetail({ merchantId }).then(res => {
this.config.approveTemplateId = res this.config.approveTemplateId = res
this.oldConfig = util.deepClone(this.config)
}) })
} }
} }
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2022-03-07 14:32:50 * @Date: 2022-03-07 14:32:50
* @LastEditTime: 2022-03-07 14:43:18 * @LastEditTime: 2022-03-14 21:04:10
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \scrm-micro-settings\src\views\baseInfo\editInfo.vue * @FilePath: \scrm-micro-settings\src\views\baseInfo\editInfo.vue
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
<el-input v-model="infoForm.merchantAddress" placeholder="请选择商户地址" readonly="readonly"></el-input> <el-input v-model="infoForm.merchantAddress" placeholder="请选择商户地址" readonly="readonly"></el-input>
<el-button @click="hanleSelectMap" type="primary">选择地址</el-button> <el-button @click="hanleSelectMap" type="primary">选择地址</el-button>
</el-form-item> </el-form-item>
<el-form-item size="small" label="业务类型"> <el-form-item size="small" label="经营业务类型">
<el-checkbox-group v-model="infoForm.businessType"> <el-checkbox-group v-model="infoForm.businessType">
<el-checkbox :label="item.dictValue" v-for="item in businessType" :key="item.dictValue">{{ 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-checkbox-group>
</el-form-item> </el-form-item>
<el-form-item size="small" label="营业时间" class="time-row"> <el-form-item size="small" label="营业时间" class="time-row">
...@@ -58,7 +58,7 @@ export default { ...@@ -58,7 +58,7 @@ export default {
dialogMapVisible: false, dialogMapVisible: false,
mapHeight: 450, mapHeight: 450,
infoForm: { infoForm: {
businessType: [], businessType: [1, 2, 3, 4, 5, 6],
bussinessTime: [] bussinessTime: []
}, },
businessType: [], businessType: [],
...@@ -88,10 +88,11 @@ export default { ...@@ -88,10 +88,11 @@ export default {
channelId channelId
} }
if (!businessType) { if (!businessType) {
this.infoForm.businessType = [] this.infoForm.businessType = [1, 2, 3, 4, 5, 6]
} else { } else {
const businessType = this.infoForm.businessType.split(',') const businessType = this.infoForm.businessType.split(',')
this.infoForm.businessType = businessType.map(item => (item = parseInt(item))) this.infoForm.businessType = businessType.map(item => (item = parseInt(item)))
console.log(this.infoForm.businessType)
} }
console.log(this.infoForm.businessType) console.log(this.infoForm.businessType)
const brandListTree = await this.$apis.baseInfo.brandList({ needCarSeries: true }) const brandListTree = await this.$apis.baseInfo.brandList({ needCarSeries: true })
...@@ -139,7 +140,7 @@ export default { ...@@ -139,7 +140,7 @@ export default {
if (params.bussinessTime) { if (params.bussinessTime) {
params.bussinessBegintime = params.bussinessTime[0] params.bussinessBegintime = params.bussinessTime[0]
params.bussinessEndtime = params.bussinessTime[1] params.bussinessEndtime = params.bussinessTime[1]
}else { } else {
params.bussinessBegintime = '' params.bussinessBegintime = ''
params.bussinessEndtime = '' params.bussinessEndtime = ''
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!