Commit cbf27501 authored by 张伯涛's avatar 张伯涛

修改

parent 379a5b30
......@@ -58,6 +58,14 @@ export function updateUser(data) {
}
})
}
// 查数据字典
export function getDicts(params) {
return request({
url: '/system/dict/type/getDictByTypeStrings',
method: 'get',
params
})
}
// 删除用户
export function delUser(userId) {
......
......@@ -238,7 +238,8 @@
<div>Start Date</div>
</template>
<template slot-scope="scope">
{{ scope.row.nltStartDate || '-' }}
<span v-if="scope.row.nltStartDate">{{ scope.row.nltStartDate.substring(0,10) }}</span>
<span v-else>{{ '-' }}</span>
</template>
</el-table-column>
<el-table-column align="center" width="70" prop="flag">
......@@ -329,7 +330,14 @@
<div class="labelName">班组</div>
<div class="labelName">Group</div>
</div>
<el-input v-model.trim="form.nltBz" show-word-limit :maxlength="20" placeholder="请输入班组" />
<el-select v-model="form.nltBz" style="width: 100%" placeholder="请选择班组">
<el-option
v-for="dict in shiftOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
......@@ -472,8 +480,8 @@
<div class="labelName">Dept</div>
</div>
<treeSelect
class="userTree"
v-model="form.deptId"
class="userTree"
:disable-branch-nodes="false"
:default-expand-level="1"
:options="deptOptions"
......@@ -572,6 +580,7 @@
</template>
<script>
import {
getDicts,
listUser,
getUser,
delUser,
......@@ -637,6 +646,7 @@ export default {
}
}
return {
shiftOptions: [], // 班次数组
confirmLoading: false,
deptTreeData: [],
pwdTypeMap: {
......@@ -701,6 +711,7 @@ export default {
deptChildren: [],
// 表单参数
form: {
deptId: '',
roleList: [],
nltStartDate: '',
nltPosition: '',
......@@ -748,7 +759,7 @@ export default {
userType: '',
allowLogin: '',
flag: '',
deptId: '',
deptId: undefined,
name: ''
},
// 表单校验
......@@ -839,14 +850,29 @@ export default {
this.getList()
this.getRoleSelect()
this.getTreeSelect()
this.getDictDetails()
// this.getConfigKey('sys.user.initPassword').then(response => {
// this.initPassword = response.msg
// })
},
methods: {
handleCheckChange(data) {
console.log('check', data)
this.form.deptId = data.id
getDictDetails() {
const params = {
dictTypes: 'shift'
}
getDicts(params).then(res => {
if (res.code === 200) {
res.data.forEach(item => {
if (item.dictLabel === 'Day') {
item.dictLabel = '白班'
this.shiftOptions.push(item)
} else if (item.dictLabel === 'Night') {
item.dictLabel = '夜班'
this.shiftOptions.push(item)
}
})
}
})
},
changeValue() {
this.$refs.form.validateField('id')
......@@ -932,7 +958,7 @@ export default {
reset() {
this.form = {
userId: '',
deptId: '',
deptId: undefined,
phone: '',
username: '',
userType: '',
......@@ -1021,9 +1047,6 @@ export default {
this.$set(this.form, 'roleList', response.data.roleIds.split(',').map(num => { return Number(num) }))
}
console.log('详情', this.form)
// if (this.form.deptId) {
// this.form.deptId = this.form.deptId.split(',')
// }
this.title = '修改'
})
// this.getChildrenDept(userId)
......@@ -1068,7 +1091,6 @@ export default {
this.$refs['form'].validate(valid => {
if (valid) {
this.confirmLoading = true
// this.form.deptId = this.form.deptId.join(',')
if (this.form.businessId !== undefined) {
console.log('form', this.form)
updateUser(this.form).then(response => {
......
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