|
@@ -51,7 +51,7 @@
|
|
<el-form-item>
|
|
<el-form-item>
|
|
<div style="color:#999;font-size:13px;">共{{total}}人</div>
|
|
<div style="color:#999;font-size:13px;">共{{total}}人</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item style="float:right;" v-if="permissions.structureExport">
|
|
|
|
|
|
+ <el-form-item style="float:right;" v-if="permissions.structureCustomConfig">
|
|
<el-link type="primary" :underline="false" @click="customConfigShow">自定义配置</el-link>
|
|
<el-link type="primary" :underline="false" @click="customConfigShow">自定义配置</el-link>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item style="float:right;" v-if="permissions.structureExport">
|
|
<el-form-item style="float:right;" v-if="permissions.structureExport">
|
|
@@ -258,8 +258,8 @@
|
|
:options="option" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader>
|
|
:options="option" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="直属上级">
|
|
<el-form-item label="直属上级">
|
|
- <el-select v-model="insertForm.superiorId" placeholder="请选择角色" style="width: 100%" filterable>
|
|
|
|
- <el-option v-for="item in users" :label="item.name" :value="item.id" :key="item.id">
|
|
|
|
|
|
+ <el-select v-model="insertForm.superiorId" placeholder="请选择" style="width: 100%" filterable clearable>
|
|
|
|
+ <el-option v-for="item in users" :label="item.name" :value="item.id" :key="item.id" :disabled="item.id == insertForm.id">
|
|
<span style="float: left">{{item.name}}</span>
|
|
<span style="float: left">{{item.name}}</span>
|
|
<span style="float: right; color: #8492a6; font-size: 13px">{{item.departmentName}}</span>
|
|
<span style="float: right; color: #8492a6; font-size: 13px">{{item.departmentName}}</span>
|
|
</el-option>
|
|
</el-option>
|
|
@@ -340,6 +340,14 @@
|
|
:props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false"
|
|
:props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false"
|
|
clearable></el-cascader>
|
|
clearable></el-cascader>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item label="直属上级">
|
|
|
|
+ <el-select v-model="insertForm.superiorId" placeholder="请选择" style="width: 100%" filterable clearable>
|
|
|
|
+ <el-option v-for="item in users" :label="item.name" :value="item.id" :key="item.id" :disabled="item.id == insertForm.id">
|
|
|
|
+ <span style="float: left">{{item.name}}</span>
|
|
|
|
+ <span style="float: right; color: #8492a6; font-size: 13px">{{item.departmentName}}</span>
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button @click="dialogVisible1=false">取消</el-button>
|
|
<el-button @click="dialogVisible1=false">取消</el-button>
|
|
@@ -461,15 +469,18 @@
|
|
<el-input size="medium" v-model="item.name" placeholder="请输入自定义配置项名称" style="width:200px;margin-right:20px" maxlength="8"></el-input>
|
|
<el-input size="medium" v-model="item.name" placeholder="请输入自定义配置项名称" style="width:200px;margin-right:20px" maxlength="8"></el-input>
|
|
<el-radio size="medium" :disabled="!item.name" v-model="item.type" :label="0" style="margin-right:10px;margin-left:10px">下拉</el-radio>
|
|
<el-radio size="medium" :disabled="!item.name" v-model="item.type" :label="0" style="margin-right:10px;margin-left:10px">下拉</el-radio>
|
|
<el-radio size="medium" :disabled="!item.name" v-model="item.type" :label="1">输入</el-radio>
|
|
<el-radio size="medium" :disabled="!item.name" v-model="item.type" :label="1">输入</el-radio>
|
|
- <span style="display:inline-block;width:100px"><el-button v-if="cusItemTypes[index] == 0" type="primary" size="small" @click="getConfigItemBtn(item)">配置选项</el-button></span>
|
|
|
|
- <el-button type="danger" size="small" @click="customConfigDelete(item,index)" style="">删除</el-button>
|
|
|
|
|
|
+ <span style="display:inline-block;">
|
|
|
|
+ <el-button v-if="cusItemTypes[index] == 0" type="primary" size="small" @click="getConfigItemBtn(item)">配置选项</el-button>
|
|
|
|
+ <span v-if="!item.id && item.name && item.type == 0" style="color:#999;font-size:13px">保存后可配置选项</span>
|
|
|
|
+ </span>
|
|
|
|
+ <el-button style="margin-left:20px" type="danger" size="small" v-if="item.id" @click="customConfigDelete(item,index)">删除</el-button>
|
|
</p>
|
|
</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button type="primary" @click="customConfigDialog = false" >关闭</el-button>
|
|
<el-button type="primary" @click="customConfigDialog = false" >关闭</el-button>
|
|
- <el-button type="primary" @click="customConfigListAdd" :disabled="customConfigList.length >= 5">新增</el-button>
|
|
|
|
- <el-button type="primary" @click="customConfigListSave" >保存</el-button>
|
|
|
|
|
|
+ <!-- <el-button type="primary" @click="customConfigListAdd" :disabled="customConfigList.length >= 5">新增</el-button> -->
|
|
|
|
+ <el-button type="primary" @click="customConfigListSave" :loading="saveBtnLoading">保存</el-button>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@@ -691,7 +702,8 @@
|
|
tableLoading: false,
|
|
tableLoading: false,
|
|
|
|
|
|
suoying: ['plate1','plate2','plate3','plate4','plate5'],
|
|
suoying: ['plate1','plate2','plate3','plate4','plate5'],
|
|
- insertFormPlates: []
|
|
|
|
|
|
+ insertFormPlates: [],
|
|
|
|
+ saveBtnLoading: false
|
|
};
|
|
};
|
|
},
|
|
},
|
|
filters: {
|
|
filters: {
|
|
@@ -747,21 +759,21 @@
|
|
let lists = JSON.parse(JSON.stringify(res.data))
|
|
let lists = JSON.parse(JSON.stringify(res.data))
|
|
this.userCustomConfig = JSON.parse(JSON.stringify(res.data))
|
|
this.userCustomConfig = JSON.parse(JSON.stringify(res.data))
|
|
// let lists = res.data
|
|
// let lists = res.data
|
|
- this.customConfigList = res.data
|
|
|
|
- // this.customConfigList = [
|
|
|
|
- // { name: '', id: null, type: 1, companyId: null },
|
|
|
|
- // { name: '', id: null, type: 1, companyId: null },
|
|
|
|
- // { name: '', id: null, type: 1, companyId: null },
|
|
|
|
- // { name: '', id: null, type: 1, companyId: null },
|
|
|
|
- // { name: '', id: null, type: 1, companyId: null },
|
|
|
|
- // ]
|
|
|
|
- // for(let i in lists){
|
|
|
|
- // this.$set(this.customConfigList[i],'name',lists[i].name)
|
|
|
|
- // this.$set(this.customConfigList[i],'id',lists[i].id)
|
|
|
|
- // this.$set(this.customConfigList[i],'type',lists[i].type)
|
|
|
|
- // this.$set(this.customConfigList[i],'companyId',lists[i].companyId)
|
|
|
|
- // }
|
|
|
|
- console.log('customConfigList',this.customConfigList);
|
|
|
|
|
|
+ // this.customConfigList = res.data
|
|
|
|
+ this.customConfigList = [
|
|
|
|
+ { name: '', id: null, type: 1, companyId: null },
|
|
|
|
+ { name: '', id: null, type: 1, companyId: null },
|
|
|
|
+ { name: '', id: null, type: 1, companyId: null },
|
|
|
|
+ { name: '', id: null, type: 1, companyId: null },
|
|
|
|
+ { name: '', id: null, type: 1, companyId: null },
|
|
|
|
+ ]
|
|
|
|
+ for(let i in lists){
|
|
|
|
+ this.$set(this.customConfigList[i],'name',lists[i].name)
|
|
|
|
+ this.$set(this.customConfigList[i],'id',lists[i].id)
|
|
|
|
+ this.$set(this.customConfigList[i],'type',lists[i].type)
|
|
|
|
+ this.$set(this.customConfigList[i],'companyId',lists[i].companyId)
|
|
|
|
+ }
|
|
|
|
+ // console.log('customConfigList',this.customConfigList);
|
|
this.cusItemTypes = []
|
|
this.cusItemTypes = []
|
|
for(let j in this.customConfigList){
|
|
for(let j in this.customConfigList){
|
|
if(this.customConfigList[j].type == null || this.customConfigList[j].type == 0){
|
|
if(this.customConfigList[j].type == null || this.customConfigList[j].type == 0){
|
|
@@ -793,30 +805,28 @@
|
|
// }
|
|
// }
|
|
// jsonStr = jsonStr.substring(0,jsonStr.length - 1)
|
|
// jsonStr = jsonStr.substring(0,jsonStr.length - 1)
|
|
// let jsonStr = []
|
|
// let jsonStr = []
|
|
- for(let i in this.customConfigList){
|
|
|
|
- let text = this.customConfigList[i].name.trim()
|
|
|
|
- if(!text){
|
|
|
|
- this.customConfigList.splice(i,1)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ this.saveBtnLoading = true
|
|
|
|
+ let parameter = this.customConfigList.filter(item => item.name.trim() != '')
|
|
|
|
|
|
this.http.post('/user-custom/addOrMod',{
|
|
this.http.post('/user-custom/addOrMod',{
|
|
- json: JSON.stringify(this.customConfigList)
|
|
|
|
|
|
+ json: JSON.stringify(parameter)
|
|
},res => {
|
|
},res => {
|
|
if(res.code == 'ok'){
|
|
if(res.code == 'ok'){
|
|
this.getCustomConfigList()
|
|
this.getCustomConfigList()
|
|
- this.customConfigDialog = false
|
|
|
|
|
|
+ this.saveBtnLoading = false
|
|
this.$message({
|
|
this.$message({
|
|
message: '保存成功',
|
|
message: '保存成功',
|
|
type: 'success'
|
|
type: 'success'
|
|
})
|
|
})
|
|
}else {
|
|
}else {
|
|
|
|
+ this.saveBtnLoading = false
|
|
this.$message({
|
|
this.$message({
|
|
message: res.msg,
|
|
message: res.msg,
|
|
type: 'error'
|
|
type: 'error'
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},err => {
|
|
},err => {
|
|
|
|
+ this.saveBtnLoading = false
|
|
this.$message({
|
|
this.$message({
|
|
message: err,
|
|
message: err,
|
|
type: 'error'
|
|
type: 'error'
|
|
@@ -946,8 +956,8 @@
|
|
}
|
|
}
|
|
this.$nextTick(()=>{
|
|
this.$nextTick(()=>{
|
|
// let opt = this.users[0].plateMap[this.userCustomConfig[0].name]
|
|
// let opt = this.users[0].plateMap[this.userCustomConfig[0].name]
|
|
- console.log('userCustomConfig',this.userCustomConfig);
|
|
|
|
- console.log('insertForm',this.insertForm);
|
|
|
|
|
|
+ // console.log('userCustomConfig',this.userCustomConfig);
|
|
|
|
+ // console.log('insertForm',this.insertForm);
|
|
})
|
|
})
|
|
}else {
|
|
}else {
|
|
this.$message({
|
|
this.$message({
|
|
@@ -962,12 +972,12 @@
|
|
})
|
|
})
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- customConfigListAdd(){
|
|
|
|
- this.customConfigList.push({
|
|
|
|
- name: '',
|
|
|
|
- type: 1
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
|
|
+ // customConfigListAdd(){
|
|
|
|
+ // this.customConfigList.push({
|
|
|
|
+ // name: '',
|
|
|
|
+ // type: 1
|
|
|
|
+ // })
|
|
|
|
+ // },
|
|
// 批量修改部门
|
|
// 批量修改部门
|
|
handleSelectionZzjg(e){
|
|
handleSelectionZzjg(e){
|
|
// if (e.length == 0) {
|
|
// if (e.length == 0) {
|
|
@@ -1587,7 +1597,7 @@
|
|
this.title = "新增人员"
|
|
this.title = "新增人员"
|
|
this.getUserCustomConfig()
|
|
this.getUserCustomConfig()
|
|
// this.insertForm.plateMap['定义测试文本'] = '测试文本'
|
|
// this.insertForm.plateMap['定义测试文本'] = '测试文本'
|
|
- console.log('insertForm123',this.insertForm);
|
|
|
|
|
|
+ // console.log('insertForm',this.insertForm);
|
|
}
|
|
}
|
|
this.dialogVisible = true;
|
|
this.dialogVisible = true;
|
|
},
|
|
},
|
|
@@ -1646,7 +1656,7 @@
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
|
|
- console.log(form, 'form')
|
|
|
|
|
|
+ // console.log(form, 'form')
|
|
|
|
|
|
if (this.insertForm.id != null) {
|
|
if (this.insertForm.id != null) {
|
|
form.id = this.insertForm.id;
|
|
form.id = this.insertForm.id;
|
|
@@ -1778,20 +1788,54 @@
|
|
for(var i in arr1) {
|
|
for(var i in arr1) {
|
|
array1.push(parseInt(arr1[i]))
|
|
array1.push(parseInt(arr1[i]))
|
|
}
|
|
}
|
|
|
|
+ this.http.post('/user/getUserInfo', {
|
|
|
|
+ userId: list1.id
|
|
|
|
+ },
|
|
|
|
+ res => {
|
|
|
|
+ if (res.code == "ok") {
|
|
|
|
+ this.insertForm = {
|
|
|
|
+ id: res.data.id,
|
|
|
|
+ name: res.data.name,
|
|
|
|
+ phone: res.data.phone,
|
|
|
|
+ roleId: res.data.roleId,
|
|
|
|
+ monthCost:res.data.monthCost,
|
|
|
|
+ cost: res.data.cost,
|
|
|
|
+ departmentId: array1.reverse(),
|
|
|
|
+ salaryType: res.data.salaryType,
|
|
|
|
+ costApplyDate: res.data.costApplyDate,
|
|
|
|
+ inductionDate: res.data.inductionDate,
|
|
|
|
+ position: res.data.position,
|
|
|
|
+ certJson: res.data.certList,
|
|
|
|
+ plateMap: {},
|
|
|
|
+ superiorId: res.data.superiorId,
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: res.msg,
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ }},
|
|
|
|
+ error => {
|
|
|
|
+ this.listLoading = false;
|
|
|
|
+ this.$message({
|
|
|
|
+ message: error,
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ });
|
|
// console.log(list1)
|
|
// console.log(list1)
|
|
- this.insertForm = {
|
|
|
|
- id: list1.id,
|
|
|
|
- name: list1.name,
|
|
|
|
- phone: list1.phone,
|
|
|
|
- roleId: list1.roleId,
|
|
|
|
- monthCost:list1.monthCost,
|
|
|
|
- cost: list1.cost,
|
|
|
|
- departmentId: array1.reverse(),
|
|
|
|
- salaryType: list1.salaryType,
|
|
|
|
- name: list1.name,
|
|
|
|
- position: list1.position,
|
|
|
|
- certJson: list1.certJson
|
|
|
|
- };
|
|
|
|
|
|
+ // this.insertForm = {
|
|
|
|
+ // id: list1.id,
|
|
|
|
+ // name: list1.name,
|
|
|
|
+ // phone: list1.phone,
|
|
|
|
+ // roleId: list1.roleId,
|
|
|
|
+ // monthCost:list1.monthCost,
|
|
|
|
+ // cost: list1.cost,
|
|
|
|
+ // departmentId: array1.reverse(),
|
|
|
|
+ // salaryType: list1.salaryType,
|
|
|
|
+ // name: list1.name,
|
|
|
|
+ // position: list1.position,
|
|
|
|
+ // certJson: list1.certJson
|
|
|
|
+ // };
|
|
this.dialogVisible1 = true;
|
|
this.dialogVisible1 = true;
|
|
},
|
|
},
|
|
|
|
|
|
@@ -1817,10 +1861,11 @@
|
|
if (this.insertForm.costApplyDate != null) {
|
|
if (this.insertForm.costApplyDate != null) {
|
|
form.costApplyDate = this.insertForm.costApplyDate;
|
|
form.costApplyDate = this.insertForm.costApplyDate;
|
|
}
|
|
}
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ if (this.insertForm.superiorId){
|
|
|
|
+ form.superiorId = this.insertForm.superiorId
|
|
|
|
+ }
|
|
|
|
|
|
- this.http.post( this.port.manage.insert, form,
|
|
|
|
|
|
+ this.http.post( this.port.manage.insert, form,
|
|
res => {
|
|
res => {
|
|
this.submitLoading = false;
|
|
this.submitLoading = false;
|
|
if (res.code == "ok") {
|
|
if (res.code == "ok") {
|
|
@@ -1846,6 +1891,10 @@
|
|
type: "error"
|
|
type: "error"
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
},
|
|
},
|
|
|
|
|
|
// 获取部门列表
|
|
// 获取部门列表
|
|
@@ -2238,7 +2287,7 @@
|
|
});
|
|
});
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
- console.log('error submit!!');
|
|
|
|
|
|
+ // console.log('error submit!!');
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
});
|
|
});
|