Commit 0ac0ab1f by 胡悦

修改

1 parent bdd3bfa2
...@@ -10,6 +10,10 @@ const Constants = { ...@@ -10,6 +10,10 @@ const Constants = {
}, },
ACCOUNT_STAUS_LIST: [ ACCOUNT_STAUS_LIST: [
{ {
label: '全部',
value: ''
},
{
label: '已启用', label: '已启用',
value: 0 value: 0
}, },
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
<template> <template>
<div class="account-add"> <div class="account-add">
<h2>{{accountParams.id ? '编辑' : '新增'}}账户类型</h2> <h2>{{accountParams.id ? '编辑' : '新增'}}账户类型</h2>
<h3 class="info-title"><span class="info-icon"></span>基本信息</h3> <h3 class="info-title">
<span class="info-icon"></span>基本信息
</h3>
<el-form <el-form
:model="accountRuleForm" :model="accountRuleForm"
:rules="accountRules" :rules="accountRules"
...@@ -48,7 +50,9 @@ ...@@ -48,7 +50,9 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<h3 class="info-title"><span class="info-icon"></span>功能权限</h3> <h3 class="info-title">
<span class="info-icon"></span>功能权限
</h3>
<el-tabs <el-tabs
v-if="accountRuleForm.requestList.length != 0" v-if="accountRuleForm.requestList.length != 0"
v-show="activeName" v-show="activeName"
...@@ -66,25 +70,18 @@ ...@@ -66,25 +70,18 @@
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>所有权限</span> <span>所有权限</span>
<el-button-group style="float: right;"> <el-button-group style="float: right;">
<el-button <el-button :size="btn_size" type="primary" @click="btnClick('allTree', index)">全选</el-button>
:size="btn_size"
type="primary"
@click="btnClick('allTree', index)"
>全选</el-button
>
<el-button <el-button
:size="btn_size" :size="btn_size"
type="primary" type="primary"
@click="btnClick('cancelAllTree', index)" @click="btnClick('cancelAllTree', index)"
>全部取消</el-button >全部取消</el-button>
>
<el-button <el-button
v-if="$Common.getParams().id" v-if="$Common.getParams().id"
:size="btn_size" :size="btn_size"
type="primary" type="primary"
@click="btnClick('resetTree', index)" @click="btnClick('resetTree', index)"
>重置</el-button >重置</el-button>
>
</el-button-group> </el-button-group>
</div> </div>
<el-tree <el-tree
...@@ -98,21 +95,19 @@ ...@@ -98,21 +95,19 @@
:expand-on-click-node="false" :expand-on-click-node="false"
:render-content="renderContent" :render-content="renderContent"
@check="getCurrentNode" @check="getCurrentNode"
> ></el-tree>
</el-tree>
</el-card> </el-card>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<div class="footer-btn"> <div class="footer-btn">
<el-button :size="btn_size" v-if="!$Common.getParams().id" @click="btnClick('draft')" type="primary" <el-button
>存草稿</el-button :size="btn_size"
> v-if="!$Common.getParams().id"
<el-button :size="btn_size" @click="btnClick('save')" type="primary" @click="btnClick('draft')"
>确定</el-button type="primary"
> >存草稿</el-button>
<el-button :size="btn_size" @click="btnClick('cancel')" type="primary" <el-button :size="btn_size" @click="btnClick('save')" type="primary">确定</el-button>
>取消</el-button <el-button :size="btn_size" @click="btnClick('cancel')" type="primary">取消</el-button>
>
</div> </div>
</div> </div>
</template> </template>
...@@ -126,12 +121,8 @@ export default { ...@@ -126,12 +121,8 @@ export default {
return { return {
accountRuleForm: { accounttypeName: '', requestList: [] }, accountRuleForm: { accounttypeName: '', requestList: [] },
accountRules: { accountRules: {
accounttypeName: [ accounttypeName: [{ required: true, message: '请输入账户类型名称' }],
{ required: true, message: '请输入账户类型名称' } requestList: [{ required: true, message: '请选择登录权限' }]
],
requestList: [
{ required: true, message: '请选择登录权限' }
]
}, },
activeName: '', activeName: '',
productList: [], productList: [],
...@@ -157,8 +148,7 @@ export default { ...@@ -157,8 +148,7 @@ export default {
}, },
methods: { methods: {
// 功能权限切换 // 功能权限切换
handleClick(tab, event) { handleClick(tab, event) {},
},
// 渲染树结构 // 渲染树结构
renderContent(h, v) { renderContent(h, v) {
if (v.data.logo == 'functionValue') { if (v.data.logo == 'functionValue') {
...@@ -201,12 +191,14 @@ export default { ...@@ -201,12 +191,14 @@ export default {
if (val.length != 0) { if (val.length != 0) {
this.activeName = val[0].dictLabel this.activeName = val[0].dictLabel
const productId = [] const productId = []
console.log(this.lastList)
if (val.length > this.lastList.length) { if (val.length > this.lastList.length) {
// 添加 // 添加
productId.push(val[val.length - 1].dictValue) productId.push(val[val.length - 1].dictValue)
this.lastList = val this.lastList = val
const params = { productId } const params = { productId }
if (this.accountParams.id) params.accountTypeId = this.accountParams.id if (this.accountParams.id)
params.accountTypeId = this.accountParams.id
accountApi.findProductById(params).then(res => { accountApi.findProductById(params).then(res => {
if (res.code == '0') { if (res.code == '0') {
this.treeData.push(_.cloneDeep(res.data[0])) this.treeData.push(_.cloneDeep(res.data[0]))
...@@ -214,7 +206,9 @@ export default { ...@@ -214,7 +206,9 @@ export default {
const len = this.treeData.length - 1 const len = this.treeData.length - 1
this.$nextTick(() => { this.$nextTick(() => {
// this.$refs[`tree${len}`][0].setCheckedNodes(this.treeData[len].children) // this.$refs[`tree${len}`][0].setCheckedNodes(this.treeData[len].children)
this.$refs[`tree${len}`][0].setCheckedKeys(this.getAllId(this.treeData[len].children)) this.$refs[`tree${len}`][0].setCheckedKeys(
this.getAllId(this.treeData[len].children)
)
}) })
// } // }
} }
...@@ -241,7 +235,9 @@ export default { ...@@ -241,7 +235,9 @@ export default {
switch (type) { switch (type) {
case 'allTree': case 'allTree':
// this.$refs[`tree${index}`][0].setCheckedNodes(this.treeData[index].children) // this.$refs[`tree${index}`][0].setCheckedNodes(this.treeData[index].children)
this.$refs[`tree${index}`][0].setCheckedKeys(this.getAllId(this.treeData[index].children)) this.$refs[`tree${index}`][0].setCheckedKeys(
this.getAllId(this.treeData[index].children)
)
break break
case 'cancelAllTree': case 'cancelAllTree':
this.$refs[`tree${index}`][0].setCheckedKeys([]) this.$refs[`tree${index}`][0].setCheckedKeys([])
...@@ -258,23 +254,31 @@ export default { ...@@ -258,23 +254,31 @@ export default {
const params = { const params = {
delFlag: 1 delFlag: 1
} }
if (this.accountRuleForm.accounttypeName || this.accountRuleForm.requestList.length != 0) { if (
if (this.accountRuleForm.accounttypeName) params.accounttypeName = this.accountRuleForm.accounttypeName this.accountRuleForm.accounttypeName ||
if (this.accountRuleForm.accounttypeDetail) params.accounttypeDetail = this.accountRuleForm.accounttypeDetail this.accountRuleForm.requestList.length != 0
if (this.accountRuleForm.requestList.length != 0) params.requestList = this.getRequestList() ) {
if (this.accountRuleForm.accounttypeName)
params.accounttypeName = this.accountRuleForm.accounttypeName
if (this.accountRuleForm.accounttypeDetail)
params.accounttypeDetail = this.accountRuleForm.accounttypeDetail
if (this.accountRuleForm.requestList.length != 0)
params.requestList = this.getRequestList()
let api = 'insert' let api = 'insert'
if (this.accountParams.id) { if (this.accountParams.id) {
params.id = this.accountParams.id params.id = this.accountParams.id
api = 'update' api = 'update'
} }
accountApi[api](params).then(res => { accountApi[api](params)
.then(res => {
const { code, data } = res const { code, data } = res
if (code == '0' && data) { if (code == '0' && data) {
this.notice.okTips() this.notice.okTips()
// this.$root.close() // this.$root.close()
window.history.go(-1) window.history.go(-1)
} }
}).catch(err => { })
.catch(err => {
this.notice.errorTips(err) this.notice.errorTips(err)
}) })
} else { } else {
...@@ -295,20 +299,23 @@ export default { ...@@ -295,20 +299,23 @@ export default {
requestList, requestList,
delFlag: 0 delFlag: 0
} }
if (this.accountRuleForm.accounttypeDetail) params.accounttypeDetail = this.accountRuleForm.accounttypeDetail if (this.accountRuleForm.accounttypeDetail)
params.accounttypeDetail = this.accountRuleForm.accounttypeDetail
let api = 'insert' let api = 'insert'
if (this.accountParams.id) { if (this.accountParams.id) {
params.id = this.accountParams.id params.id = this.accountParams.id
api = 'update' api = 'update'
} }
accountApi[api](params).then(res => { accountApi[api](params)
.then(res => {
const { code, data } = res const { code, data } = res
if (code == '0' && data) { if (code == '0' && data) {
this.notice.okTips() this.notice.okTips()
// this.$root.close() // this.$root.close()
window.history.go(-1) window.history.go(-1)
} }
}).catch(err => { })
.catch(err => {
this.notice.errorTips(err) this.notice.errorTips(err)
}) })
} }
...@@ -339,10 +346,16 @@ export default { ...@@ -339,10 +346,16 @@ export default {
} }
}) })
if (!this.flag) return if (!this.flag) return
const menuIdList = checkedNodes.filter(item => item.logo === 'menu').map(i => i.id) // 全选菜单idlist const menuIdList = checkedNodes
.filter(item => item.logo === 'menu')
.map(i => i.id) // 全选菜单idlist
// const partSelectList = halfCheckedNodes.filter(item => item.logo === 'menu').map(i => i.id) // 半选菜单idlist // const partSelectList = halfCheckedNodes.filter(item => item.logo === 'menu').map(i => i.id) // 半选菜单idlist
const functionIdList = checkedNodes.filter(item => item.logo === 'function') const functionIdList = checkedNodes.filter(
const functionValueIdLists = checkedNodes.filter(item => item.logo === 'functionValue') item => item.logo === 'function'
)
const functionValueIdLists = checkedNodes.filter(
item => item.logo === 'functionValue'
)
var list = [] var list = []
/** { menuId, id, functionValue} */ /** { menuId, id, functionValue} */
if (functionValueIdLists.length !== 0) { if (functionValueIdLists.length !== 0) {
...@@ -379,7 +392,6 @@ export default { ...@@ -379,7 +392,6 @@ export default {
}, },
getProductList() { getProductList() {
dictApi.findAllDictData({ dictType: 'product' }).then(res => { dictApi.findAllDictData({ dictType: 'product' }).then(res => {
console.log(res.data)
if (res.code == '0') { if (res.code == '0') {
this.productList = res.data this.productList = res.data
} }
...@@ -408,11 +420,12 @@ export default { ...@@ -408,11 +420,12 @@ export default {
this.activeName = requestList[0].dictLabel this.activeName = requestList[0].dictLabel
const productId = requestList.map(item => item.dictValue) const productId = requestList.map(item => item.dictValue)
const params = { productId } const params = { productId }
if (this.accountParams.id) params.accountTypeId = this.accountParams.id if (this.accountParams.id)
params.accountTypeId = this.accountParams.id
accountApi.findProductById(params).then(res => { accountApi.findProductById(params).then(res => {
console.log(res.data, data.responseList)
if (res.code == '0') { if (res.code == '0') {
this.treeData = _.cloneDeep(res.data) this.treeData = _.cloneDeep(res.data)
this.lastList = _.cloneDeep(res.data)
this.treeData.forEach((i, idx) => { this.treeData.forEach((i, idx) => {
const arr = data.responseList[idx] const arr = data.responseList[idx]
const idList = arr.menuIdList.concat(arr.functionIdList) const idList = arr.menuIdList.concat(arr.functionIdList)
......
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" :size="btn_size" :id="accountTableParams.btnId">搜索</el-button>
<el-button type="primary" :size="btn_size" @click="reset">重置</el-button> <el-button type="primary" :size="btn_size" @click="reset">重置</el-button>
<el-button type="primary" :size="btn_size" :id="accountTableParams.btnId">搜索</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-col> </el-col>
...@@ -68,7 +68,9 @@ import { accountApi } from '@/api/accountManage' ...@@ -68,7 +68,9 @@ import { accountApi } from '@/api/accountManage'
export default { export default {
data() { data() {
return { return {
accountSearchForm: {}, accountSearchForm: {
delFlag: ''
},
getListApi: accountApi.getPageApi, getListApi: accountApi.getPageApi,
pageConf: { pageConf: {
pageSize: 'pageSize', pageSize: 'pageSize',
...@@ -149,7 +151,10 @@ export default { ...@@ -149,7 +151,10 @@ export default {
} }
}, },
reset() { reset() {
this.accountSearchForm = {} this.accountSearchForm = {
delFlag: ''
}
this.$refs.accountTable.refreshTable()
} }
} }
} }
......
<template> <template>
<div> <div>
<el-form :inline="true" :model="dictDataSearchForm"> <el-form :inline="true" style="text-align: right;" :model="dictDataSearchForm">
<el-form-item> <el-form-item>
<el-input <el-input
v-model="dictDataSearchForm.dictName" v-model="dictDataSearchForm.dictName"
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" :size="btn_size" :id="dictDataTableParams.btnId">搜索</el-button>
<el-button :size="btn_size" type="primary" @click="reset">重置</el-button> <el-button :size="btn_size" type="primary" @click="reset">重置</el-button>
<el-button type="primary" :size="btn_size" :id="dictDataTableParams.btnId">搜索</el-button>
<el-button type="primary" :size="btn_size" @click="btnClick('create')">新增字典数据</el-button> <el-button type="primary" :size="btn_size" @click="btnClick('create')">新增字典数据</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
......
<template> <template>
<div> <div>
<el-form :inline="true" :model="dictSearchForm"> <el-form :inline="true" style="text-align: right;" :model="dictSearchForm">
<el-form-item label="字典名称:"> <el-form-item label="字典名称:">
<el-input <el-input
v-model="dictSearchForm.dictName" v-model="dictSearchForm.dictName"
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" :size="btn_size" :id="dictTableParams.btnId">查询</el-button>
<el-button :size="btn_size" type="primary" @click="reset">重置</el-button> <el-button :size="btn_size" type="primary" @click="reset">重置</el-button>
<el-button type="primary" :size="btn_size" :id="dictTableParams.btnId">查询</el-button>
<el-button type="primary" :size="btn_size" @click="btnClick('create')">新增字典</el-button> <el-button type="primary" :size="btn_size" @click="btnClick('create')">新增字典</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -89,7 +89,9 @@ export default { ...@@ -89,7 +89,9 @@ export default {
data() { data() {
return { return {
DICTSTATUS: this.$Constants.DICT_STATUS, DICTSTATUS: this.$Constants.DICT_STATUS,
dictSearchForm: {}, dictSearchForm: {
enableStatus: ''
},
pageConf: { pageConf: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageNum: 'pageNum', pageNum: 'pageNum',
...@@ -301,7 +303,10 @@ export default { ...@@ -301,7 +303,10 @@ export default {
this.$Common.confirmDialog(tipData) this.$Common.confirmDialog(tipData)
}, },
reset() { reset() {
this.dictSearchForm = {} this.dictSearchForm = {
enableStatus: ''
}
this.$refs.dictTable.refreshTable()
} }
} }
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<el-col style="text-align: right;" :span="22"> <el-col style="text-align: right;" :span="22">
<glsx-combi-form <glsx-combi-form
ref="showSearch" ref="showSearch"
labelWidth="110px" labelWidth="120px"
:formObj="searchForm" :formObj="searchForm"
:searchSelectObj="searchSelectObj" :searchSelectObj="searchSelectObj"
:formData="searchFormData" :formData="searchFormData"
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
@changeSecond="changeOwnSecond" @changeSecond="changeOwnSecond"
></own-cus-com> ></own-cus-com>
</template> </template>
<el-button :size="btn_size" type="primary" :id="tableParams.btnId">查询</el-button>
<el-button :size="btn_size" type="primary" @click="reset">重置</el-button> <el-button :size="btn_size" type="primary" @click="reset">重置</el-button>
<el-button :size="btn_size" type="primary" :id="tableParams.btnId">查询</el-button>
</glsx-combi-form> </glsx-combi-form>
</el-col> </el-col>
</el-row> </el-row>
...@@ -113,7 +113,7 @@ export default { ...@@ -113,7 +113,7 @@ export default {
functionType: '', functionType: '',
ownedCusgroupType: '', ownedCusgroupType: '',
ownedCusGroupValues: '', ownedCusGroupValues: '',
productId: [] productId: ''
}, },
tableSearchForm: {}, tableSearchForm: {},
searchSelectObj: { searchSelectObj: {
...@@ -677,7 +677,7 @@ export default { ...@@ -677,7 +677,7 @@ export default {
functionType: '', functionType: '',
ownedCusgroupType: '', ownedCusgroupType: '',
ownedCusGroupValues: '', ownedCusGroupValues: '',
productId: [] productId: ''
} }
this.searchSelectObj = { this.searchSelectObj = {
funcOrName: { funcOrName: {
...@@ -685,6 +685,7 @@ export default { ...@@ -685,6 +685,7 @@ export default {
value: '' value: ''
} }
} }
this.$refs.functionTable.refreshTable()
} }
} }
} }
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
:formData="searchFormData" :formData="searchFormData"
:labelWidth="'120px'" :labelWidth="'120px'"
> >
<el-button :size="btn_size" type="primary" :id="tableParams.btnId">查询</el-button>
<el-button :size="btn_size" type="primary" @click="reset">重置</el-button> <el-button :size="btn_size" type="primary" @click="reset">重置</el-button>
<el-button :size="btn_size" type="primary" :id="tableParams.btnId">查询</el-button>
</glsx-combi-form> </glsx-combi-form>
</el-col> </el-col>
</el-row> </el-row>
...@@ -663,7 +663,11 @@ export default { ...@@ -663,7 +663,11 @@ export default {
this[obj.formName][obj.targetItem.name] = obj.val ? obj.val.id : '' this[obj.formName][obj.targetItem.name] = obj.val ? obj.val.id : ''
}, },
reset() { reset() {
this.searchForm = {} this.searchForm = {
productIds: [],
menuName: ''
}
this.$refs.menuTable.refreshTable()
} }
} }
} }
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
</el-col> </el-col>
<el-col style="text-align: right;" :span="12"> <el-col style="text-align: right;" :span="12">
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData"> <glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData">
<el-button :size="btn_size" type="primary" :id="tableParams.btnId">查询</el-button>
<el-button :size="btn_size" type="primary" @click="reset">重置</el-button> <el-button :size="btn_size" type="primary" @click="reset">重置</el-button>
<el-button :size="btn_size" type="primary" :id="tableParams.btnId">查询</el-button>
</glsx-combi-form> </glsx-combi-form>
</el-col> </el-col>
</el-row> </el-row>
...@@ -258,6 +258,7 @@ export default { ...@@ -258,6 +258,7 @@ export default {
}, },
reset() { reset() {
this.searchForm = {} this.searchForm = {}
this.$refs.productTable.refreshTable()
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!