Commit bea721ae by cwq0219

产品管理

1 parent 1708bc26
...@@ -149,8 +149,8 @@ export default { ...@@ -149,8 +149,8 @@ export default {
.el-input.el-input--suffix.rotate .el-input__suffix .el-icon-arrow-down { .el-input.el-input--suffix.rotate .el-input__suffix .el-icon-arrow-down {
transform: rotate(-180deg); transform: rotate(-180deg);
} }
/* .select-tree { .select-tree {
max-height: 350px; max-height: 400px;
overflow-y: scroll; overflow-y: scroll;
} */ }
</style> </style>
\ No newline at end of file \ No newline at end of file
import App from './index.vue' import App from './index.vue'
import base from '@/base' import base from '@/base'
import GlsxVueCommon from 'glsx-vue-common' import GlsxVueCommon from 'glsx-vue-common'
import notice from '@/common/notice'
base.getConfig().then(data => { base.getConfig().then(data => {
const { vue, config } = data const { vue, config } = data
vue.use(GlsxVueCommon, config) vue.use(GlsxVueCommon, config)
vue.prototype.notice = notice
base.render(App) base.render(App)
}) })
...@@ -157,17 +157,7 @@ export default { ...@@ -157,17 +157,7 @@ export default {
nameLabel: 'parentName', nameLabel: 'parentName',
addHtml: 'menuTree', addHtml: 'menuTree',
formName: 'searchForm' formName: 'searchForm'
}, }, {
// {
// label: '商户账户类型',
// name: '',
// type: 'select',
// optionList: [],
// optionId: 'dictValue',
// optionLabel: 'dictLabel',
// optionsName: 'accounTypetList'
// },
{
label: '所属客户群体', label: '所属客户群体',
name: 'ownCus', name: 'ownCus',
firstVal: 'ownedCusgroupType', firstVal: 'ownedCusgroupType',
...@@ -264,11 +254,9 @@ export default { ...@@ -264,11 +254,9 @@ export default {
optionLabel: 'dictLabel', optionLabel: 'dictLabel',
optionsName: 'productList', optionsName: 'productList',
changeAttr: (value, targetItem) => { changeAttr: (value, targetItem) => {
baseApi.getMenuTree({ productId: value }).then(res => {
this.baseData.menuTreeList = res.data
this.editForm.menuId = '' this.editForm.menuId = ''
this.editForm.menuName = '' this.editForm.menuName = ''
}) this.getMenuTree(value)
} }
}, { }, {
label: '菜单', label: '菜单',
...@@ -311,7 +299,7 @@ export default { ...@@ -311,7 +299,7 @@ export default {
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupValue')].isDisabled = (value === 3) this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupValue')].isDisabled = (value === 3)
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 && (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)
} }
...@@ -474,10 +462,10 @@ export default { ...@@ -474,10 +462,10 @@ 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 === 3) 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 === '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.editRule.ownedCusgroupValue[0].required = (this.editForm.ownedCusgroupType !== 3) this.editRule.ownedCusgroupValue[0].required = (!this.editForm.ownedCusgroupType || this.editForm.ownedCusgroupType !== 3)
// this.$refs.editFormRef.$refs[this.editChildRef].validateField('ownedCusgroupValue') // this.$refs.editFormRef.$refs[this.editChildRef].validateField('ownedCusgroupValue')
}, },
handleAdd() { handleAdd() {
...@@ -485,23 +473,43 @@ export default { ...@@ -485,23 +473,43 @@ export default {
this.editDisable() this.editDisable()
this.$refs.editFormRef && (this.$refs.editFormRef.$refs[this.editChildRef].clearValidate()) this.$refs.editFormRef && (this.$refs.editFormRef.$refs[this.editChildRef].clearValidate())
}, },
recoveryEdit(row) { getMenuTree(productId) {
baseApi.getMenuTree({ productId: row.productId }).then(res => { baseApi.getMenuTree({ productId: productId }).then(res => {
this.baseData.menuTreeList = res.data this.baseData.menuTreeList = res.data
this.editForm.menuId = '' this.baseData.menuTreeList.unshift({
this.editForm.menuName = '' id: ' ',
menuName: '无(表示顶级菜单)',
childlist: []
}) })
this.getOptionsList('editFormData', false)
})
},
recoveryEdit(row) {
if (this.editForm.ownedCusgroupType && (this.editForm.ownedCusgroupType !== 3)) {
this.baseData.cusGroupList = this.baseData[this.attrToList[this.editForm.ownedCusgroupType]]
}
this.getMenuTree(row.productId)
}, },
handleFunEdit(row) { handleFunEdit(row) {
this.editForm = _.cloneDeep(row) this.editForm = _.cloneDeep(row)
if (this.editForm.ownedCusgroupValue) { if (this.editForm.ownedCusgroupValue) {
this.editForm.ownedCusgroupValue = this.editForm.ownedCusgroupValue.split(',').map(item => +item) this.editForm.ownedCusgroupValue = this.editForm.ownedCusgroupValue.split(',').map(item => +item)
} }
recoveryEdit(row) this.recoveryEdit(row)
this.handleAdd() this.handleAdd()
}, },
handleClose() { handleClose() {
this.editForm = {} this.editForm = {
productId: '',
menuId: '',
menuName: '',
ownedCusgroupValue: ''
}
var resetBaseNameList = ['menuTreeList', 'cusGroupList']
resetBaseNameList.forEach(item => {
this.baseData[item] = []
})
this.getOptionsList('editFormData', false)
this.$refs.editFormRef.$refs[this.editChildRef].clearValidate() this.$refs.editFormRef.$refs[this.editChildRef].clearValidate()
this.handleAdd() this.handleAdd()
}, },
......
// import App from './index.vue' // import App from './index.vue'
import base from '@/base' import base from '@/base'
import GlsxVueCommon from 'glsx-vue-common' import GlsxVueCommon from 'glsx-vue-common'
import notice from '@/common/notice'
const Apps = require.context('./', false, /\.vue$/) const Apps = require.context('./', false, /\.vue$/)
Apps.keys().map(item => { Apps.keys().map(item => {
console.log(item)
base.getConfig().then(data => { base.getConfig().then(data => {
const { const {
vue, vue,
config config
} = data } = data
vue.use(GlsxVueCommon, config) vue.use(GlsxVueCommon, config)
vue.prototype.notice = notice
base.render(Apps(item).default) base.render(Apps(item).default)
}) })
}) })
......
...@@ -109,7 +109,6 @@ ...@@ -109,7 +109,6 @@
<script> <script>
import _ from 'lodash' import _ from 'lodash'
import { Util } from '@/common/util'
import SelectTree from '../components/SelectTree' import SelectTree from '../components/SelectTree'
import { menuApi, baseApi } from '@/api/productManage' import { menuApi, baseApi } from '@/api/productManage'
export default { export default {
...@@ -182,10 +181,7 @@ export default { ...@@ -182,10 +181,7 @@ export default {
prop: 'productName' prop: 'productName'
}, { }, {
label: '更新时间', label: '更新时间',
prop: 'updatedTime', prop: 'updatedTime'
formatter: cellValue => {
return cellValue.updatedTime ? Util.dateFormate(cellValue.updatedTime, 'YYYY-MM-DD HH:mm:ss') : ''
}
}] }]
}, },
// 弹窗 // 弹窗
...@@ -235,11 +231,9 @@ export default { ...@@ -235,11 +231,9 @@ export default {
optionLabel: 'dictLabel', optionLabel: 'dictLabel',
optionsName: 'productList', optionsName: 'productList',
changeAttr: (value, targetItem) => { changeAttr: (value, targetItem) => {
baseApi.getMenuTree({ productId: value }).then(res => {
this.baseData.menuTreeList = res.data
this.editForm.parentId = '' this.editForm.parentId = ''
this.editForm.parentName = '' this.editForm.parentName = ''
}) this.getMenuTree(value)
} }
}, { }, {
label: '菜单类型', label: '菜单类型',
...@@ -382,15 +376,6 @@ export default { ...@@ -382,15 +376,6 @@ export default {
this.getOptionsList('searchFormData') this.getOptionsList('searchFormData')
this.getOptionsList('editFormData', false) this.getOptionsList('editFormData', false)
}) })
baseApi.getMenuTree().then(res => {
// console.log(res.data)
this.baseData.menuTreeList = res.data
this.baseData.menuTreeList.unshift({
id: ' ',
menuName: '无(表示顶级菜单)',
childlist: []
})
})
}, },
methods: { methods: {
...@@ -416,8 +401,18 @@ export default { ...@@ -416,8 +401,18 @@ export default {
resolve(this.tableSearchForm) resolve(this.tableSearchForm)
}) })
}, },
getMenuTree(productId) {
baseApi.getMenuTree({ productId: productId }).then(res => {
this.baseData.menuTreeList = res.data
this.baseData.menuTreeList.unshift({
id: ' ',
menuName: '无(表示顶级菜单)',
childlist: []
})
this.getOptionsList('editFormData', false)
})
},
isMenuSpecial(flag = true) { isMenuSpecial(flag = true) {
console.log(flag)
this.editForm.ownedCusgroupType = '' this.editForm.ownedCusgroupType = ''
this.editForm.ownedCusgroupValue = [] this.editForm.ownedCusgroupValue = []
this.editForm.ownedMerchant = '' this.editForm.ownedMerchant = ''
...@@ -469,6 +464,11 @@ export default { ...@@ -469,6 +464,11 @@ export default {
ownedCusgroupValue: [], ownedCusgroupValue: [],
ownedMerchant: '' ownedMerchant: ''
} }
var resetBaseNameList = ['menuTreeList', 'cusGroupList']
resetBaseNameList.forEach(item => {
this.baseData[item] = []
})
this.getOptionsList('editFormData', false)
this.$refs.editFormRef.$refs[this.editChildRef].clearValidate() this.$refs.editFormRef.$refs[this.editChildRef].clearValidate()
this.handleAdd() this.handleAdd()
}, },
......
// import App from './index.vue' // import App from './index.vue'
import base from '@/base' import base from '@/base'
import GlsxVueCommon from 'glsx-vue-common' import GlsxVueCommon from 'glsx-vue-common'
import notice from '@/common/notice'
const Apps = require.context('./', false, /\.vue$/) const Apps = require.context('./', false, /\.vue$/)
...@@ -12,7 +11,6 @@ Apps.keys().map(item => { ...@@ -12,7 +11,6 @@ Apps.keys().map(item => {
config config
} = data } = data
vue.use(GlsxVueCommon, config) vue.use(GlsxVueCommon, config)
vue.prototype.notice = notice
base.render(Apps(item).default) base.render(Apps(item).default)
}) })
}) })
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!