Commit 0d1fb809 by chehuidong

bh

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