完善系统管理
This commit is contained in:
@@ -30,7 +30,7 @@ export function userAdd(data) {
|
||||
// 初始化 用户
|
||||
export function initUserInfo(data) {
|
||||
return request({
|
||||
url: '/wms/apiadmin/sysstaffinfo/fetchBySid/' + data.sid,
|
||||
url: '/wms/apiadmin/sysstaffinfo/fetchBySid/' + data.sid + "/" + data.defaultDeptSid,
|
||||
method: 'get',
|
||||
data: data,
|
||||
headers: {
|
||||
@@ -92,7 +92,7 @@ export function userSingle(data) {
|
||||
// 单条用户的角色列表
|
||||
export function setRole(data) {
|
||||
return request({
|
||||
url: '/wms/apiadmin/sysrole/listAllByUserSid/' + data.sid + "/" + data.orgsid,
|
||||
url: '/wms/apiadmin/sysrole/listAllByUserSid/' + data.sid + "/" + data.orgSid,
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-upload ref="imgUpload" v-loading="loadding" class="avatar-uploader" :headers="accessToken"
|
||||
:action="uploadFile" accept=".jpg,.jpeg,.png,.bmp,.pdf,.JPG,.JPEG,.BMP" list-type="picture-card"
|
||||
:file-list="files" :on-remove="removeImage" :on-preview="handlePictureCardPreview"
|
||||
:on-progress="uploadProgrees"
|
||||
:on-error="uploadError" :on-success="uploadImgSuccess_FuJian">
|
||||
<i class="el-icon-plus avatar-uploader-icon"/>
|
||||
<el-upload ref="imgUpload" v-loading="loadding" class="avatar-uploader" :headers="accessToken" :action="uploadFile"
|
||||
accept=".jpg,.jpeg,.png,.bmp,.pdf,.JPG,.JPEG,.BMP" list-type="picture-card" :file-list="files"
|
||||
:on-remove="removeImage" :on-preview="handlePictureCardPreview" :on-progress="uploadProgrees"
|
||||
:on-error="uploadError" :on-success="uploadImgSuccess_FuJian">
|
||||
<i class="el-icon-plus avatar-uploader-icon" />
|
||||
</el-upload>
|
||||
<el-dialog :visible.sync="dialogVisible" :append-to-body="true" title="查看图片">
|
||||
<img width="100%" :src="dialogImageUrl" alt="">
|
||||
@@ -14,9 +13,15 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { uploadFile } from '@/api/portal/Upload.js'
|
||||
import { getStorage } from '@/utils/auth.js' //token
|
||||
import { mapGetters } from 'vuex'
|
||||
import {
|
||||
uploadFile
|
||||
} from '@/api/portal/Upload.js'
|
||||
import {
|
||||
getStorage
|
||||
} from '@/utils/auth.js' //token
|
||||
import {
|
||||
mapGetters
|
||||
} from 'vuex'
|
||||
|
||||
export default {
|
||||
model: {
|
||||
@@ -43,8 +48,7 @@
|
||||
},
|
||||
accept: {
|
||||
type: String,
|
||||
default:
|
||||
'.jpg,.jpeg,.png,.bmp,.pdf,.JPG,.JPEG,.BMP,.PDF,.xls,.docx,.xlsx,.ppt,.pptx'
|
||||
default: '.jpg,.jpeg,.png,.bmp,.pdf,.JPG,.JPEG,.BMP,.PDF,.xls,.docx,.xlsx,.ppt,.pptx'
|
||||
},
|
||||
// 文件名称
|
||||
name: {
|
||||
@@ -160,7 +164,7 @@
|
||||
imgFiles.push(o.url)
|
||||
})
|
||||
this.$emit('fileChange', this.files)
|
||||
this.$emit('change', this.files)
|
||||
this.$emit('change', this.files)
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
console.log('file:' + JSON.stringify(file))
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<div class="span-sty">品牌Logo</div>
|
||||
<el-form-item>
|
||||
<upload-img ref="uploadImg" class="addinputw addinputInfo" v-model="imgList" :limit="1" bucket="map"
|
||||
:upload-data="{ type: '0001' }" :class="{ hide: hideUploadBtn }" @change="backData" />
|
||||
:upload-data="{ type: '0001' }" :class="{'hide': hideUploadBtn}" @change="backData" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
},
|
||||
hideUploadBtn: false,
|
||||
hideUploadBtn: true,
|
||||
hideUploadBtn2: false,
|
||||
rules: {
|
||||
brandName: [{
|
||||
@@ -156,14 +156,14 @@
|
||||
this.formobj.letter = val
|
||||
},
|
||||
backData(value) {
|
||||
console.log('imgList', this.imgList)
|
||||
console.log('value', value)
|
||||
|
||||
if (this.imgList.length > 0) {
|
||||
this.formobj.image = this.imgList[0].url
|
||||
if (value.length > 0) {
|
||||
this.formobj.image = value[0].url
|
||||
} else {
|
||||
this.formobj.image = ''
|
||||
}
|
||||
this.hideUploadBtn = this.imgList.length != 0
|
||||
this.hideUploadBtn = value.length == 1
|
||||
console.log('this.hideUploadBtn', this.hideUploadBtn)
|
||||
},
|
||||
|
||||
@@ -238,7 +238,7 @@
|
||||
},
|
||||
showAdd() {
|
||||
console.log("this.imgList", this.imgList)
|
||||
this.hideUploadBtn = this.imgList.length != 0
|
||||
this.hideUploadBtn = this.imgList.length == 1
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
@@ -260,7 +260,7 @@
|
||||
})
|
||||
}
|
||||
|
||||
this.hideUploadBtn = this.imgList.length != 0
|
||||
this.hideUploadBtn = this.imgList.length == 1
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
@@ -277,6 +277,10 @@
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
/deep/.hide .el-upload--picture-card {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.must {
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@
|
||||
<el-option hidden :key="form.psid" :label="form.pname" :value="form.pname"></el-option>
|
||||
<el-tree :data="treedata" ref="Tree" show-checkbox accordion node-key="sid"
|
||||
:default-checked-keys="checkedId" :default-expand-all='true' :check-strictly='true'
|
||||
:props="defaultProps" @check-change="checkchange" @node-click="departmentClick">
|
||||
:props="defaultProps" @check-change="checkchange">
|
||||
</el-tree>
|
||||
</el-select>
|
||||
</td>
|
||||
@@ -399,8 +399,8 @@
|
||||
this.form.psid = '0'
|
||||
this.form.pname = '顶级菜单'
|
||||
} else {
|
||||
this.form.psid = data.sid
|
||||
this.form.pname = data.name
|
||||
this.form.psid = data.psid
|
||||
this.form.pname = data.pname
|
||||
}
|
||||
let arr = []
|
||||
arr = [data.sid];
|
||||
@@ -477,7 +477,7 @@
|
||||
// this.form.psid = row.sid || 0
|
||||
this.form.sourceName = 'wms'
|
||||
this.form.sourceSid = 'd936f1ba-03c3-11ec-bf08-48452053aa33'
|
||||
this.form.pname = ''
|
||||
this.form.pname = '顶级菜单'
|
||||
this.form.psid = '0'
|
||||
// this.sourceMenus()
|
||||
} else {
|
||||
|
||||
@@ -442,8 +442,8 @@
|
||||
this.roleForm.roleSid = []
|
||||
this.roleDialog = true
|
||||
this.roleForm.sid = row.sid
|
||||
this.roleForm.userSid = window.sessionStorage.getItem('userSid')
|
||||
this.roleForm.orgsid = window.sessionStorage.getItem('orgSid')
|
||||
this.roleForm.userSid = row.sid
|
||||
this.roleForm.orgSid = window.sessionStorage.getItem('orgSid')
|
||||
setRole(this.roleForm).then(res => {
|
||||
this.roleList = res.data
|
||||
for (let i = 0; i < res.data.length; i++) {
|
||||
@@ -499,6 +499,38 @@
|
||||
},
|
||||
save() {
|
||||
this.form.orgSid = this.form.orgSid == '' ? window.sessionStorage.getItem('orgSid') : this.form.orgSid
|
||||
|
||||
if (this.form.userName == '') {
|
||||
this.$message({
|
||||
message: '账号不能为空',
|
||||
type: 'warning'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.form.name == '') {
|
||||
this.$message({
|
||||
message: '姓名不能为空',
|
||||
type: 'warning'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (this.form.sysStaffOrg.orgSid == '' || this.form.sysStaffOrg.orgName == '') {
|
||||
this.$message({
|
||||
message: '部门不能为空',
|
||||
type: 'warning'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (this.form.sysUserRoles.length == 0) {
|
||||
this.$message({
|
||||
message: '角色不能为空',
|
||||
type: 'warning'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
userUpdata(this.form).then(res => {
|
||||
if (res.code == '200') {
|
||||
this.$message({
|
||||
@@ -528,6 +560,7 @@
|
||||
},
|
||||
// 修改用户信息
|
||||
userinfoChange(row) {
|
||||
row.defaultDeptSid = window.sessionStorage.getItem('defaultDeptSid')
|
||||
initUserInfo(row).then(res => {
|
||||
if (res.code == '200') {
|
||||
this.editDialog = true
|
||||
|
||||
Reference in New Issue
Block a user