Commit a8b44aea by cwq0219

客户群体

1 parent 8f329008
...@@ -136,6 +136,7 @@ ...@@ -136,6 +136,7 @@
:key="subItem[item.optionId]" :key="subItem[item.optionId]"
:label="subItem[item.optionLabel]" :label="subItem[item.optionLabel]"
:value="subItem[item.optionId]" :value="subItem[item.optionId]"
:disabled="subItem.isDisabled || false"
> >
</el-option> </el-option>
</el-select> </el-select>
......
...@@ -112,10 +112,10 @@ ...@@ -112,10 +112,10 @@
></own-cus-com> ></own-cus-com>
</template> </template>
<template slot="funValueTxt"> <template slot="funValueTxt">
<div class="edit-tip">有属性值和属性文本示例1:1,奥迪;2,宝马;3,奔驰&nbsp;&nbsp;&nbsp;&nbsp;无属性文本示例:GT001,GT002,GT003</div> <div class="edit-tip">有属性值和属性文本示例1:1,奥迪;2,宝马;3,奔驰</div>
</template> </template>
<template slot="newFunValueTxt"> <template slot="newFunValueTxt">
<div :class="{'edit-tip': editForm.id }">有属性值和属性文本示例1:1,奥迪;2,宝马;3,奔驰&nbsp;&nbsp;&nbsp;&nbsp;无属性文本示例:GT001,GT002,GT003</div> <div :class="{'edit-tip': editForm.id }">有属性值和属性文本示例1:1,奥迪;2,宝马;3,奔驰</div>
</template> </template>
</glsx-combi-form> </glsx-combi-form>
</glsx-dialog> </glsx-dialog>
...@@ -254,7 +254,8 @@ export default { ...@@ -254,7 +254,8 @@ export default {
menuId: '', menuId: '',
menuName: '', menuName: '',
ownedCusgroupType: '', ownedCusgroupType: '',
ownedCusgroupValue: '' ownedCusgroupValue: '',
ownedMerchant: ''
}, },
editRule: { editRule: {
productId: [{ required: true, message: '请选择产品名称', trigger: 'change' }], productId: [{ required: true, message: '请选择产品名称', trigger: 'change' }],
...@@ -332,10 +333,11 @@ export default { ...@@ -332,10 +333,11 @@ export default {
optionsName: 'ownCusList', optionsName: 'ownCusList',
changeAttr: (value, targetItem) => { changeAttr: (value, targetItem) => {
// baseData[attrToList[form[targetItem.firstVal]]] // baseData[attrToList[form[targetItem.firstVal]]]
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupValue')].isHide = (value === 3)
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedMerchant')].isHide = (value !== 3)
this.editForm.ownedCusgroupValue = '' this.editForm.ownedCusgroupValue = ''
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupValue')].isDisabled = (value === 3) this.editForm.ownedMerchant = ''
this.editRule.ownedCusgroupValue[0].required = (value !== 3) this.editRule.ownedCusgroupValue[0].required = (value !== 3)
// this.$refs.editFormRef.$refs[this.editChildRef].validateField('ownedCusgroupValue')
if (value && (value !== 3)) { if (value && (value !== 3)) {
this.baseData.cusGroupList = this.baseData[this.attrToList[value]] this.baseData.cusGroupList = this.baseData[this.attrToList[value]]
this.getOptionsList('editFormData', false) this.getOptionsList('editFormData', false)
...@@ -347,7 +349,7 @@ export default { ...@@ -347,7 +349,7 @@ export default {
width: '240px', width: '240px',
type: 'select', type: 'select',
multiple: true, multiple: true,
isDisabled: true, // isDisabled: true,
optionList: [], optionList: [],
optionId: 'dictValue', optionId: 'dictValue',
optionLabel: 'dictLabel', optionLabel: 'dictLabel',
...@@ -496,7 +498,8 @@ export default { ...@@ -496,7 +498,8 @@ export default {
}, },
editDisable() { editDisable() {
this.editFormData[this.editFormData.findIndex(item => item.label === '产品')].isDisabled = !!this.editForm.id this.editFormData[this.editFormData.findIndex(item => item.label === '产品')].isDisabled = !!this.editForm.id
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupValue')].isDisabled = (!this.editForm.ownedCusgroupType || (this.editForm.ownedCusgroupType === 3)) this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupValue')].isHide = (!this.editForm.ownedCusgroupType || (this.editForm.ownedCusgroupType === 3))
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedMerchant')].isHide = (!this.editForm.ownedCusgroupType || (this.editForm.ownedCusgroupType !== 3))
this.editFormData[this.editFormData.findIndex(item => item.name === 'functionValue')].isDisabled = !!this.editForm.id this.editFormData[this.editFormData.findIndex(item => item.name === 'functionValue')].isDisabled = !!this.editForm.id
this.editFormData[this.editFormData.findIndex(item => item.name === 'newFunValue')].isHide = !this.editForm.id this.editFormData[this.editFormData.findIndex(item => item.name === 'newFunValue')].isHide = !this.editForm.id
this.editFormData[this.editFormData.findIndex(item => item.name === 'newFunValueTxt')].isHide = !this.editForm.id this.editFormData[this.editFormData.findIndex(item => item.name === 'newFunValueTxt')].isHide = !this.editForm.id
...@@ -504,6 +507,7 @@ export default { ...@@ -504,6 +507,7 @@ export default {
}, },
handleAdd() { handleAdd() {
this.editVisible = !this.editVisible this.editVisible = !this.editVisible
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupType')].isDisabled = this.editForm.id
this.editDisable() this.editDisable()
this.$refs.editFormRef && (this.$refs.editFormRef.$refs[this.editChildRef].clearValidate()) this.$refs.editFormRef && (this.$refs.editFormRef.$refs[this.editChildRef].clearValidate())
}, },
...@@ -516,7 +520,10 @@ export default { ...@@ -516,7 +520,10 @@ export default {
}, },
recoveryEdit(row) { recoveryEdit(row) {
if (this.editForm.ownedCusgroupType && (this.editForm.ownedCusgroupType !== 3)) { if (this.editForm.ownedCusgroupType && (this.editForm.ownedCusgroupType !== 3)) {
this.baseData.cusGroupList = this.baseData[this.attrToList[this.editForm.ownedCusgroupType]] this.baseData.cusGroupList = _.cloneDeep(this.baseData[this.attrToList[this.editForm.ownedCusgroupType]])
this.baseData.cusGroupList.forEach(item => {
this.editForm.ownedCusgroupValue.includes(item.dictValue) && (item.isDisabled = true)
})
} }
}, },
handleFunEdit(row) { handleFunEdit(row) {
...@@ -536,7 +543,8 @@ export default { ...@@ -536,7 +543,8 @@ export default {
menuId: '', menuId: '',
menuName: '', menuName: '',
ownedCusgroupType: '', ownedCusgroupType: '',
ownedCusgroupValue: '' ownedCusgroupValue: '',
ownedMerchant: ''
} }
var resetBaseNameList = ['menuTreeList', 'cusGroupList'] var resetBaseNameList = ['menuTreeList', 'cusGroupList']
resetBaseNameList.forEach(item => { resetBaseNameList.forEach(item => {
...@@ -585,7 +593,7 @@ export default { ...@@ -585,7 +593,7 @@ export default {
.edit-tip { .edit-tip {
display: block; display: block;
font-size: 8px; font-size: 8px;
color: #409EFF; color: #409eff;
margin: -14px 0 0 130px; margin: -14px 0 0 130px;
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -326,8 +326,10 @@ export default { ...@@ -326,8 +326,10 @@ export default {
optionsName: 'ownCusList', optionsName: 'ownCusList',
changeAttr: (value, targetItem) => { changeAttr: (value, targetItem) => {
// baseData[attrToList[form[targetItem.firstVal]]] // baseData[attrToList[form[targetItem.firstVal]]]
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupValue')].isHide = (value === 3)
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedMerchant')].isHide = (value !== 3)
this.editForm.ownedCusgroupValue = [] this.editForm.ownedCusgroupValue = []
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupValue')].isDisabled = (value === 3) this.editForm.ownedMerchant = ''
this.editRule.ownedCusgroupValue[0].required = (value !== 3) this.editRule.ownedCusgroupValue[0].required = (value !== 3)
this.$refs.editFormRef.$refs[this.editChildRef].validateField('ownedCusgroupValue') this.$refs.editFormRef.$refs[this.editChildRef].validateField('ownedCusgroupValue')
if (value !== 3) { if (value !== 3) {
...@@ -342,7 +344,7 @@ export default { ...@@ -342,7 +344,7 @@ export default {
type: 'select', type: 'select',
isHide: true, isHide: true,
multiple: true, multiple: true,
isDisabled: true, // isDisabled: true,
optionList: [], optionList: [],
optionId: 'dictValue', optionId: 'dictValue',
optionLabel: 'dictLabel', optionLabel: 'dictLabel',
...@@ -443,11 +445,16 @@ export default { ...@@ -443,11 +445,16 @@ export default {
this.editForm.ownedCusgroupValue = [] this.editForm.ownedCusgroupValue = []
this.editForm.ownedMerchant = '' this.editForm.ownedMerchant = ''
} }
this.baseData.cusGroupList = isSpecial ? this.baseData[this.attrToList[this.editForm.ownedCusgroupType]] : [] this.baseData.cusGroupList = isSpecial ? _.cloneDeep(this.baseData[this.attrToList[this.editForm.ownedCusgroupType]]) : []
if (this.editForm.menuCode && isSpecial && (this.editForm.ownedCusgroupType !== 3)) {
this.baseData.cusGroupList.forEach(item => {
this.editForm.ownedCusgroupValue.includes(item.dictValue) && (item.isDisabled = true)
})
}
this.getOptionsList('editFormData', false) this.getOptionsList('editFormData', false)
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupType')].isHide = !isSpecial this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupType')].isHide = !isSpecial
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupValue')].isHide = !isSpecial this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupValue')].isHide = (!isSpecial || (isSpecial && this.editForm.ownedCusgroupType === 3))
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedMerchant')].isHide = !isSpecial this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedMerchant')].isHide = (!isSpecial || (isSpecial && this.editForm.ownedCusgroupType !== 3))
this.editRule.ownedCusgroupValue[0].required = isSpecial && (this.editForm.ownedCusgroupType !== 3) this.editRule.ownedCusgroupValue[0].required = isSpecial && (this.editForm.ownedCusgroupType !== 3)
this.editRule.ownedCusgroupType[0].required = isSpecial this.editRule.ownedCusgroupType[0].required = isSpecial
}, },
...@@ -455,10 +462,15 @@ export default { ...@@ -455,10 +462,15 @@ export default {
this.editFormData[this.editFormData.findIndex(item => item.label === '产品')].isDisabled = !!this.editForm.menuCode this.editFormData[this.editFormData.findIndex(item => item.label === '产品')].isDisabled = !!this.editForm.menuCode
this.editFormData[this.editFormData.findIndex(item => item.label === '父级菜单')].isDisabled = !!this.editForm.menuCode this.editFormData[this.editFormData.findIndex(item => item.label === '父级菜单')].isDisabled = !!this.editForm.menuCode
this.editFormData[this.editFormData.findIndex(item => item.name === 'isSpecial')].isDisabled = !!this.editForm.menuCode this.editFormData[this.editFormData.findIndex(item => item.name === 'isSpecial')].isDisabled = !!this.editForm.menuCode
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupValue')].isDisabled = !!this.editForm.menuCode && !(this.editForm.ownedCusgroupType !== 3) // this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupValue')].isDisabled = !!this.editForm.menuCode && !(this.editForm.ownedCusgroupType !== 3)
if (!this.editForm.menuCode) {
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupValue')].isHide = true
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedMerchant')].isHide = true
}
}, },
handleAdd(isEdit = false) { handleAdd(isEdit = false) {
this.editVisible = !this.editVisible this.editVisible = !this.editVisible
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupType')].isDisabled = this.editForm.menuCode
this.editDisable() this.editDisable()
!isEdit && this.isMenuSpecial(false) !isEdit && this.isMenuSpecial(false)
this.$refs.editFormRef.$refs[this.editChildRef] && (this.$refs.editFormRef.$refs[this.editChildRef].clearValidate()) this.$refs.editFormRef.$refs[this.editChildRef] && (this.$refs.editFormRef.$refs[this.editChildRef].clearValidate())
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!