Commit c6089085 authored by FangYuePeng's avatar FangYuePeng

修复单位用户和单位数据问题,用户和企业没有对应起来.(设置修改单位管理员在用户管理中数据没有对应起来)

parent 597d0205
...@@ -91,3 +91,7 @@ export function listCourseAll(query) { ...@@ -91,3 +91,7 @@ export function listCourseAll(query) {
params: query params: query
}) })
} }
...@@ -1588,7 +1588,6 @@ export default { ...@@ -1588,7 +1588,6 @@ export default {
businessId: data.businessId businessId: data.businessId
} }
downloadZip(params).then(response => { downloadZip(params).then(response => {
const blob = new Blob([response]) const blob = new Blob([response])
const downloadElement = document.createElement('a') const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)// 创建下载的链接 const href = window.URL.createObjectURL(blob)// 创建下载的链接
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</el-form-item> </el-form-item>
<el-form-item prop="unitName" label="单位管理员账号"> <el-form-item prop="unitName" label="单位管理员账号">
<el-input <el-input
v-model="queryParams.unitNumber" v-model="queryParams.userId"
placeholder="单位管理员账号" placeholder="单位管理员账号"
clearable clearable
:maxlength="255" :maxlength="255"
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
<!-- </el-table-column>--> <!-- </el-table-column>-->
<el-table-column label="单位管理员账号" width="150" prop="unitNumber" :show-overflow-tooltip="true"> <el-table-column label="单位管理员账号" width="150" prop="unitNumber" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.unitNumber || '-' }} {{ scope.row.username || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="备注" width="520" prop="exitId" :show-overflow-tooltip="true">--> <!-- <el-table-column label="备注" width="520" prop="exitId" :show-overflow-tooltip="true">-->
...@@ -157,12 +157,12 @@ ...@@ -157,12 +157,12 @@
<el-input v-model.trim="form.unitName" :maxlength="30" placeholder="请输入单位名称" /> <el-input v-model.trim="form.unitName" :maxlength="30" placeholder="请输入单位名称" />
</el-form-item> </el-form-item>
<el-form-item label="单位管理员" prop="unitNumber"> <el-form-item label="单位管理员" prop="unitNumber">
<el-select v-model="form.unitNumber" filterable style="width: 100%" clearable placeholder="请选择管理员账号"> <el-select v-model="form.userId" filterable style="width: 100%" clearable placeholder="请选择管理员账号">
<el-option <el-option
v-for="(item,index) in userList" v-for="(item,index) in userList"
:key="index" :key="index"
:label="item.username" :label="item.username"
:value="item.username" :value="item.businessId"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -185,7 +185,6 @@ ...@@ -185,7 +185,6 @@
<el-button class="cancelBtn" @click="cancel">取 消</el-button> <el-button class="cancelBtn" @click="cancel">取 消</el-button>
<el-button class="submitBtn" type="primary" @click="submitForm">确 定</el-button> <el-button class="submitBtn" type="primary" @click="submitForm">确 定</el-button>
</div> </div>
</el-dialog> </el-dialog>
...@@ -202,7 +201,7 @@ import { ...@@ -202,7 +201,7 @@ import {
exportSysUnit, listUserAll exportSysUnit, listUserAll
} from '@/api/sysUnit' } from '@/api/sysUnit'
import commonField from '@/utils/commonField' import commonField from '@/utils/commonField'
import { listUser } from '@/api/system/user'
export default { export default {
name: 'SysUnit', name: 'SysUnit',
data() { data() {
...@@ -464,6 +463,6 @@ export default { ...@@ -464,6 +463,6 @@ export default {
text-align: right; text-align: right;
line-height: 1; line-height: 1;
font-size: 12px; font-size: 12px;
color: red; color: #0033ff;
} }
</style> </style>
...@@ -451,9 +451,10 @@ import { getListRole } from '@/api/system/role' ...@@ -451,9 +451,10 @@ import { getListRole } from '@/api/system/role'
import { getDataCache, setDataCache } from '@/assets/js/filterData' import { getDataCache, setDataCache } from '@/assets/js/filterData'
import commonField from '@/utils/commonField' import commonField from '@/utils/commonField'
import ElImageViewer from 'element-ui/packages/image/src/image-viewer' import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
import { listUnitAll } from '@/api/sysUnit' import { getSysUnit, listUnitAll, updateSysUnit } from '@/api/sysUnit'
export default { export default {
name: 'User', name: 'User',
// eslint-disable-next-line vue/no-unused-components
components: { TreeSelect, ElImageViewer }, components: { TreeSelect, ElImageViewer },
data() { data() {
const trueGroupName = (rule, value, callback) => { const trueGroupName = (rule, value, callback) => {
...@@ -484,6 +485,8 @@ export default { ...@@ -484,6 +485,8 @@ export default {
value: '3' value: '3'
} }
], ],
//新增id
newId:'',
deptList: [], deptList: [],
initialImgPreviewIndex: 0, // 预览打开看到的图片下标 initialImgPreviewIndex: 0, // 预览打开看到的图片下标
imagePreviewUrls: [], // 预览图片的下标 imagePreviewUrls: [], // 预览图片的下标
...@@ -932,12 +935,66 @@ export default { ...@@ -932,12 +935,66 @@ export default {
this.open = false this.open = false
this.getList() this.getList()
}) })
// 获取单位信息
getSysUnit(this.form.deptId).then(res => {
var u = res.data
var unit = {
remarks: u.remarks,
createBy: u.createBy,
createDate: u.createDate,
updateBy: u.updateBy,
updateDate: u.updateDate,
delFlag: u.delFlag,
flag: u.flag,
businessId: u.businessId,
unitType: u.unitType,
unitName: u.unitName,
username: this.form.username,
userId: this.form.businessId,
exitId: u.exitId,
creteName: u.creteName,
updateName: u.updateName
}
console.log("unit",unit)
updateSysUnit(unit).then(r => {
if (r.code === 200) {
console.log('chengg')
}
})
})
} else { } else {
addUser(this.form).then(response => { addUser(this.form).then(response => {
this.newId = response.data.businessId
this.$message({ this.$message({
message: '新增成功', type: 'success' message: '新增成功', type: 'success'
}) })
this.open = false this.open = false
// 获取单位信息
getSysUnit(this.form.deptId).then(res => {
var u = res.data
var unit = {
remarks: u.remarks,
createBy: u.createBy,
createDate: u.createDate,
updateBy: u.updateBy,
updateDate: u.updateDate,
delFlag: u.delFlag,
flag: u.flag,
businessId: u.businessId,
unitType: u.unitType,
unitName: u.unitName,
unitNumber: this.form.username,
userId: this.newId,
exitId: u.exitId,
creteName: u.creteName,
updateName: u.updateName
}
updateSysUnit(unit).then(r => {
if (r.code === 200) {
console.log('chengg')
}
})
})
this.getList() this.getList()
}) })
} }
...@@ -1084,6 +1141,7 @@ export default { ...@@ -1084,6 +1141,7 @@ export default {
handlePreview(file) { handlePreview(file) {
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
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