Commit c6089085 authored by FangYuePeng's avatar FangYuePeng

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

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