Commit cf94bfe5 by 胡悦

修复bug

1 parent cb6fcda2
......@@ -220,10 +220,12 @@ export default {
let api = addDictData
if (params.id) {
api = editDictData
delete params.delFlag
delete params.disabled
}
api(params).then(res => {
console.log(res)
if (res.code = 200) {
if (res.code == 200) {
this.$message({
type: 'success',
message: '操作成功!'
......
......@@ -33,6 +33,7 @@
ref="dictManage"
:tableParams="tableParams"
:getListApi="getListApi"
:beforeSearchFn="beforeSearchFn"
:searchForm="searchForm"
:hasNum="false"
>
......@@ -85,6 +86,7 @@ export default {
return {
DICTSTATUS: this.$Constants.DICT_STATUS,
searchForm: {},
searchDataForm: {},
dictionaryFormList: [
{
type: 'input',
......@@ -111,6 +113,10 @@ export default {
value: 2
}
]
},
{
type: 'daterange',
prop: 'daterange'
}
],
tableParams: {
......@@ -185,6 +191,20 @@ export default {
// 重置搜索条件
refresh() {
this.searchForm = {}
this.searchDataForm = {}
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
console.log(this.searchForm)
if (this.searchForm.daterange) {
this.searchForm.sDate = this.searchForm.daterange[0]
this.searchForm.eDate = this.searchForm.daterange[1]
delete this.searchForm.daterange
} else {
if (this.searchForm.sDate) delete this.searchForm.sDate && delete this.searchForm.eDate
}
resolve()
})
},
// 确定
handleConfirm() {
......
......@@ -142,7 +142,7 @@ export default {
{ prop: 'departmentName', label: '组织名称' },
{ prop: 'orderNum', label: '排序' },
{ prop: 'enableStatus', label: '状态' },
{ prop: 'createDate', label: '创建时间' }
{ prop: 'createdDate', label: '创建时间' }
],
page: {
pageSize: 10,
......
......@@ -141,11 +141,11 @@ export default {
label: '角色名称',
prop: 'roleName'
}, {
label: '创建时间',
prop: 'createdDate'
}, {
label: '备注',
prop: 'remark'
}, {
label: '创建时间',
prop: 'createdDate'
}
],
tableOption: {
......
......@@ -16,7 +16,6 @@
node-key="id"
@node-click="handleNodeClick"
:render-content="renderContent"
default-expand-all
>
</el-tree>
</div>
......@@ -215,7 +214,7 @@ export default {
userVisible: false,
userForm: {
account: '',
gender: 2,
gender: '2',
departmentName: '',
superiorName: '',
enableStatus: true
......@@ -230,7 +229,7 @@ export default {
{ label: '角色:', prop: 'roleId', type: 'select', options: [], key: 'roleName', value: 'roleId', filterable: true },
{ label: '邮箱:', prop: 'email', type: 'input' },
{ label: '手机:', prop: 'phoneNumber', type: 'input' },
{ label: '性别:', prop: 'gender', type: 'select', options: [{ label: '未知', value: 2 }, { label: '男', value: 0 }, { label: '女', value: 1 }] },
{ label: '性别:', prop: 'gender', type: 'select', options: [], key: 'dictLabel', value: 'dictValue' },
{ label: '状态:', prop: 'enableStatus', type: 'switch' },
{ label: '岗位:', prop: 'position', type: 'select', options: [], key: 'dictLabel', value: 'dictValue' }
],
......@@ -259,6 +258,7 @@ export default {
this.getTreeOrg()
this.getRoleList()
this.getPosti()
this.getSex()
},
methods: {
emptyData(params) {
......@@ -318,7 +318,6 @@ export default {
},
// 树节点内容区的渲染
renderContent(h, { node, data, store }) {
console.log(h, { node, data, store }, '----------')
const text = node.data.userNumber === 0 ? `${node.label}` : `${node.label}(${node.data.userNumber}人)`
return (
<span>{text}</span>
......@@ -330,9 +329,9 @@ export default {
switch (pType) {
case 'create':
this.userDialogTitle = '新增用户'
this.userRules.password = this.addRule
this.$set(this.userRules, 'password', this.addRule)
this.userForm = {
gender: 2,
gender: '2',
departmentName: '',
superiorName: '',
enableStatus: true
......@@ -342,7 +341,9 @@ export default {
break
case 'edit':
this.userDialogTitle = '编辑用户'
if (this.userRules.password) delete this.userRules.password
if (this.userRules.password) {
this.$set(this.userRules, 'password', null)
}
this.editEvent(scope)
break
case 'delete':
......@@ -357,6 +358,7 @@ export default {
this.userDialogTitle = '编辑用户'
this.userForm = JSON.parse(JSON.stringify(res.data))
this.userForm.enableStatus = res.data.enableStatus == 1 ? true : false
this.userForm.gender = this.userForm.gender + ''
console.log(this.userForm)
this.handleClose(res.data)
})
......@@ -405,7 +407,6 @@ export default {
this.filterVisible = !this.filterVisible
},
filterConfirm() {
console.log(this.$refs.tree.getCheckedKeys(false, true), this.$refs.tree.getCurrentNode())
if (this.filterDialogTitle == '选择直接上级') {
this.userForm.superiorId = this.$refs.tree.getCurrentNode().id
this.userForm.superiorName = this.$refs.tree.getCurrentNode().label
......@@ -417,28 +418,24 @@ export default {
this.closeFilter()
},
filterNode(value, data) {
console.log(value, data)
if (!value) return true
return data.label.indexOf(value) !== -1
},
// 获取上级树
getSuperUser(params) {
getSuperUser(params).then(res => {
console.log(res)
this.filterTextData = res.data
})
},
// 获取组织树
getSimpleList() {
getTreeOrg().then(res => {
console.log(res)
this.filterTextData = res.data
})
},
// 获取组织架构
getTreeOrg(params) {
getTreeOrg(params).then(res => {
console.log(res)
// this.searchForm.departmentId = res.data.id
this.treedata = res.data
})
......@@ -448,7 +445,6 @@ export default {
roleList().then(res => {
this.roleList = res.data
this.userData[5].options = res.data
console.log(this.roleList)
})
},
// 组织架构搜索
......@@ -463,8 +459,24 @@ export default {
// 岗位列表
getPosti(value) {
dictInfo('sys_position').then(res => {
console.log(res)
this.userData[this.userData.length - 1].options = res.data
const arr = []
res.data.map(item => {
if (!item.disabled) arr.push(item)
})
this.userData[this.userData.length - 1].options = arr
})
},
getSex() {
dictInfo('sys_user_sex').then(res => {
const arr = []
res.data.map(item => {
if (!item.disabled) arr.push(item)
})
this.userData.map(item => {
if (item.prop == 'gender') {
item.options = arr
}
})
})
}
}
......
......@@ -54,8 +54,7 @@ export default {
worklogFormList: [
{
type: 'daterange',
prop: 'daterange',
placeholder: '请输入字典名称'
prop: 'daterange'
}
],
tableParams: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!