Commit 0d1fb809 by chehuidong

bh

parent d3051cd6
......@@ -619,12 +619,14 @@ export default {
},
methods: {
spentChange(v, item) {
axios.post('platform/user/update', {
...item,
cost: v,
}).then(() => {
this.getList()
})
axios
.post('platform/user/update', {
...item,
cost: v,
})
.then(() => {
this.getList()
})
},
cellClass({ row }) {
if (row.authAuditFlag === 1) {
......@@ -640,12 +642,6 @@ export default {
},
authorization(item, e) {
e && e.stopPropagation()
axios.post('sysDeviceInfo/auditApply', {
id: item.id,
}).then((res) => {
this.$message.success(res.message)
this.getList()
})
},
authorizationDel(item, e) {
e && e.stopPropagation()
......@@ -654,23 +650,10 @@ export default {
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
axios.post('sysDeviceInfo/delApply', {
id: item.id,
}).then((res) => {
this.$message.success(res.message)
this.getList()
})
})
.then(() => {})
.catch(() => {})
},
getRoleList(userId) {
axios.post('sysDeviceInfo/getList', { userId }).then(
(res) => {
this.details = res.data
},
)
},
resetPwd(e, row) {
e && e.stopPropagation()
this.$confirm('确认要重置密码?', '提示', {
......@@ -679,25 +662,27 @@ export default {
type: 'warning',
})
.then(() => {
axios.post('platform/user/resetPassword/' + row.id).then(
(res) => {
axios
.post('platform/user/resetPassword/' + row.id)
.then((res) => {
this.$alert(
'重置成功\n\r 新密码为:' +
res.data.passWord,
)
},
)
})
})
.catch(() => {})
},
enableChange(val, row) {
axios.post('platform/user/setEnableStatus', {
enable: val,
userId: row.id,
}).then((res) => {
this.$message.success(res.message)
this.getList()
})
axios
.post('platform/user/setEnableStatus', {
enable: val,
userId: row.id,
})
.then((res) => {
this.$message.success(res.message)
this.getList()
})
},
bindChange(row) {
if (!this.roleShow('lock_device')) {
......@@ -705,13 +690,15 @@ export default {
return
}
axios.post('platform/user/setBindingStatus', {
bindStatus: !row.bindStatus,
userId: row.id,
}).then((res) => {
this.$message.success(res.message)
this.getList()
})
axios
.post('platform/user/setBindingStatus', {
bindStatus: !row.bindStatus,
userId: row.id,
})
.then((res) => {
this.$message.success(res.message)
this.getList()
})
},
setempNo(id) {
for (const iterator of this.employee) {
......@@ -729,7 +716,6 @@ export default {
currentTabFn(val) {
if (val.row) {
this.formId = val.row.id
this.getRoleList(val.row.id)
}
},
// 修改新增
......@@ -743,35 +729,37 @@ export default {
if (!this.formId) {
return this.$message('请勾选至少一条记录')
}
axios.get('platform/user/axios.get', {
id: v.id,
}).then((res) => {
const funcRoleIds = []
const dataRoleIds = []
if (res.data.roleIds) {
const roleIds =
res?.data?.roleIds.split(',') || []
for (const iterator of roleIds) {
const item = this.roleList.find(
(item) => item.id === iterator,
)
if (item) {
if (item.type === 'FUNCTION_ROLE') {
funcRoleIds.push(Number(iterator))
} else {
dataRoleIds.push(Number(iterator))
axios
.get('platform/user/axios.get', {
id: v.id,
})
.then((res) => {
const funcRoleIds = []
const dataRoleIds = []
if (res.data.roleIds) {
const roleIds =
res?.data?.roleIds.split(',') || []
for (const iterator of roleIds) {
const item = this.roleList.find(
(item) => item.id === iterator,
)
if (item) {
if (item.type === 'FUNCTION_ROLE') {
funcRoleIds.push(Number(iterator))
} else {
dataRoleIds.push(Number(iterator))
}
}
}
}
}
this.addcurrencyform = {
...res.data,
funcRoleIds,
dataRoleIds,
}
this.dialogVisible = true
})
this.addcurrencyform = {
...res.data,
funcRoleIds,
dataRoleIds,
}
this.dialogVisible = true
})
} else {
this.addcurrencyform = JSON.parse(
JSON.stringify(this.addcurrencyform2),
......@@ -801,33 +789,22 @@ export default {
getList() {
const { pageSize, currentPage } =
this.paginationOptions
axios.post('platform/user/list_page', {
pageSize,
currentPage,
...this.searchForm,
}).then((res) => {
if (res.code === 200) {
this.sourceData = res.data.records
this.paginationOptions.total = res.data.total
if (this.sourceData.length > 0) {
this.$nextTick(() => {
let row
if (this.formId) {
row = this.sourceData.find(
(item) => item.id === this.formId,
)
} else {
row = this.sourceData[0]
}
this.getRoleList(row.id)
axios
.post('platform/user/list_page', {
pageSize,
currentPage,
...this.searchForm,
})
.then((res) => {
if (res.code === 200) {
this.sourceData = res.data.records
this.paginationOptions.total = res.data.total
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true,
})
}
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true,
})
}
})
})
},
// 修改
......@@ -916,21 +893,23 @@ export default {
type: 'warning',
})
.then(() => {
axios.get('platform/user/delete', {
ids: ids,
}).then((res) => {
if (res.code === 200) {
this.$message({
type: 'success',
message: '删除成功!',
})
this.getList(this.currentPage)
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true,
})
}
})
axios
.get('platform/user/delete', {
ids: ids,
})
.then((res) => {
if (res.code === 200) {
this.$message({
type: 'success',
message: '删除成功!',
})
this.getList(this.currentPage)
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true,
})
}
})
})
.catch(() => {})
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment