|
|
@@ -2,17 +2,16 @@
|
|
|
<section>
|
|
|
<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
|
|
|
<el-form :inline="true">
|
|
|
- <el-form-item :label="$t('lable.department')" style="width: 165px">
|
|
|
- <el-cascader @change="handleCascaderChange" v-if="zhengbeiCompanysId.includes(user.companyId)" v-model="searchDepartmentId" :placeholder="$t('defaultText.pleaseChoose')" style="width: 125px"
|
|
|
- :options="option" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
|
|
|
- size="mini"></el-cascader>
|
|
|
-
|
|
|
- <vueCascader :size="'mini'" :widthStr="'125'" :clearable="true" :subject="option" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
|
|
|
+ <el-form-item label="岗位" style="width: 200px">
|
|
|
+ <el-select v-model="searchPosition" :placeholder="$t('defaultText.pleaseChoose')" clearable style="width: 160px" size="small">
|
|
|
+ <el-option v-for="option in positionList" :label="option.name" :value="option.name" :key="option.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
<el-form-item :label="user.timeType.customDegreeName + $t('guan-li')">
|
|
|
- <el-input :placeholder="$t('qing-shu-ru-guan-jian-ming-cheng')" v-model.trim="searchNameVal" clearable class="input-with-select"
|
|
|
+ <el-input :placeholder="$t('qing-shu-ru-guan-jian-ming-cheng')" v-model.trim="searchNameVal" clearable class="input-with-select" size="small"
|
|
|
style="margin-left: 50px" @keyup.enter.native="searchName()">
|
|
|
<el-button slot="append" @click="searchName()">{{ $t('sou-suo') }}</el-button>
|
|
|
</el-input>
|
|
|
@@ -47,11 +46,8 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="!zhengbeiCompanysId.includes(user.companyId)" prop="projects" :label="$t('relatedprojects')" min-width="180"
|
|
|
show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column v-if="zhengbeiCompanysId.includes(user.companyId)" :label="$t('department')" min-width="180"
|
|
|
+ <el-table-column v-if="zhengbeiCompanysId.includes(user.companyId)" label="岗位" min-width="180" prop="position"
|
|
|
show-overflow-tooltip>
|
|
|
- <template #default="{ row }">
|
|
|
- {{ getDepartmentName(row.departmentId) }}
|
|
|
- </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="rmark" :label="$t('bei-zhu')" min-width="180" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column :label="$t('operation')" width="170">
|
|
|
@@ -70,12 +66,11 @@
|
|
|
<el-input v-model="addfm.name" :placeholder="$t('peaseenterthe')" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item v-if = "zhengbeiCompanysId.includes(user.companyId)" :label="$t('department')" prop="departmentIdList">
|
|
|
- <el-cascader v-model="addfm.departmentIdList" :placeholder="$t('qing-xuan-ze-bu-men')" style="width: 100%"
|
|
|
- :options="option" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false" clearable v-if="user.userNameNeedTranslate != 1"></el-cascader>
|
|
|
-
|
|
|
- <vueCascader :size="'medium'" :widthStr="'430'" :clearable="true && user.userNameNeedTranslate != 1" :subject="option" :subjectId="addfm.departmentId" :radios="true" :distinction="'2'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" ></vueCascader>
|
|
|
-
|
|
|
+ <el-form-item v-if = "zhengbeiCompanysId.includes(user.companyId)" label="岗位" prop="departmentIdList">
|
|
|
+ <el-select v-model="addfm.positionArray" :placeholder="$t('defaultText.pleaseChoose')" multiple clearable style="width: 100%">
|
|
|
+ <el-option v-for="option in positionList" :label="option.name" :value="option.name" :key="option.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item :label="$t('bei-zhu')">
|
|
|
@@ -125,16 +120,13 @@ export default {
|
|
|
//过滤筛选结果
|
|
|
filteredSubProjectList(){
|
|
|
const list = this.subProjectList
|
|
|
- const searchDepartmentId = this.searchDepartmentId
|
|
|
let result = []
|
|
|
- if(!searchDepartmentId || !this.subProjectList){
|
|
|
+ if(!this.searchPosition || !this.subProjectList){
|
|
|
return list
|
|
|
}
|
|
|
for(const item of list){
|
|
|
- for(const id of item.departmentIdList){
|
|
|
- if(id == searchDepartmentId[searchDepartmentId.length - 1]){
|
|
|
- result.push(item)
|
|
|
- }
|
|
|
+ if (item.position && item.position.indexOf(this.searchPosition) >= 0) {
|
|
|
+ result.push(item)
|
|
|
}
|
|
|
}
|
|
|
return result
|
|
|
@@ -159,8 +151,8 @@ export default {
|
|
|
addfm: {
|
|
|
name: '',
|
|
|
rmark: '',
|
|
|
- departmentId:0,
|
|
|
- departmentIdList:[]
|
|
|
+ position:'',
|
|
|
+ positionArray:[],
|
|
|
},
|
|
|
addSubProject: false,
|
|
|
ruless: {
|
|
|
@@ -175,7 +167,7 @@ export default {
|
|
|
subProjectList: [],//子项目列表
|
|
|
subProjectListArr: [], // 备用列表
|
|
|
searchNameVal: '',
|
|
|
- searchDepartmentId:null,
|
|
|
+ searchPosition:'',
|
|
|
options: [],
|
|
|
value: '',
|
|
|
zhengbeiCompanysId:[8138,8261,8264,8268]
|
|
|
@@ -320,13 +312,35 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
+ getPositionList() {
|
|
|
+ var userCustomName = '岗位';
|
|
|
+ this.http.post('/sub-user-custom/listWithName ', {userCustomName},
|
|
|
+ res => {
|
|
|
+ this.listLoading = false;
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.positionList = res.data
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.listLoading = false;
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
getSub() {
|
|
|
this.listLoading = true;
|
|
|
this.http.post('/report-extra-degree/getAll ', { withProjects: 1 },
|
|
|
res => {
|
|
|
this.listLoading = false;
|
|
|
if (res.code == "ok") {
|
|
|
- console.log(res, '看看')
|
|
|
this.subProjectList = res.data
|
|
|
this.subProjectListArr = res.data
|
|
|
} else {
|
|
|
@@ -357,10 +371,9 @@ export default {
|
|
|
this.addfm.name = subProject.name
|
|
|
this.addfm.id = subProject.id
|
|
|
this.addfm.rmark = subProject.rmark
|
|
|
- this.addfm.departmentId = subProject.departmentId
|
|
|
- this.addfm.departmentIdList = subProject.departmentIdList
|
|
|
+ this.addfm.positionArray = subProject.position.split(",")
|
|
|
} else {
|
|
|
- this.addfm = { name: '', rmark: '' ,departmentId : null,departmentIdList:[]}
|
|
|
+ this.addfm = { name: '', rmark: '' ,positionArray:[]}
|
|
|
}
|
|
|
this.addSubProject = true;
|
|
|
},
|
|
|
@@ -407,11 +420,11 @@ export default {
|
|
|
this.$refs.form2.validate(valid => {
|
|
|
if (valid) {
|
|
|
var slp = this.addfm
|
|
|
- if(this.addfm.departmentIdList){
|
|
|
- slp.departmentId = this.addfm.departmentIdList[this.addfm.departmentIdList.length - 1]
|
|
|
+ if(this.addfm.positionArray){
|
|
|
+ slp.position = this.addfm.positionArray.join(',');
|
|
|
}
|
|
|
else{
|
|
|
- slp.departmentId = null
|
|
|
+ slp.position = ''
|
|
|
}
|
|
|
this.http.post('/report-extra-degree/addOrMod', slp,
|
|
|
res => {
|
|
|
@@ -421,7 +434,7 @@ export default {
|
|
|
message: this.$t('other.successful'),
|
|
|
type: "success"
|
|
|
});
|
|
|
- this.addfm = { name: '', rmark: '' }
|
|
|
+ this.addfm = { name: '', rmark: '',positionArray:[] }
|
|
|
this.addSubProject = false
|
|
|
this.getSub()
|
|
|
} else {
|
|
|
@@ -442,43 +455,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 获取部门列表
|
|
|
- getDepartment() {
|
|
|
- this.http.post(
|
|
|
- this.port.manage.depList,
|
|
|
- {},
|
|
|
- (res) => {
|
|
|
-
|
|
|
- if (res.code == "ok") {
|
|
|
- var list = res.data,
|
|
|
- list1 = JSON.parse(JSON.stringify(res.data));
|
|
|
- list.splice(0, 0, {
|
|
|
- id: -1,
|
|
|
- label: this.$t('lable.allStaff'),
|
|
|
- });
|
|
|
- list.push({
|
|
|
- id: 0,
|
|
|
- label: this.$t('lable.unassigned'),
|
|
|
- });
|
|
|
- this.dataRepeat = JSON.parse(JSON.stringify(list))
|
|
|
- this.option = this.changeArr(list1);
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- message: res.msg,
|
|
|
- type: "error",
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
- (error) => {
|
|
|
- this.$message({
|
|
|
- message: error,
|
|
|
- type: "error",
|
|
|
- });
|
|
|
-
|
|
|
- }
|
|
|
- );
|
|
|
- },
|
|
|
+
|
|
|
// 修改数组
|
|
|
changeArr(arr) {
|
|
|
for (var i = 0; i < arr.length; i++) {
|
|
|
@@ -497,25 +474,6 @@ export default {
|
|
|
}
|
|
|
return arr;
|
|
|
},
|
|
|
- getDepartmentName(id) {
|
|
|
- if (!id || !this.option) return null
|
|
|
- const findName = (list) => {
|
|
|
- for (let item of list) {
|
|
|
- if (item.value === id) {
|
|
|
- return item.label
|
|
|
- }
|
|
|
- if (item.children && item.children.length) {
|
|
|
- const found = findName(item.children)
|
|
|
- if (found) return found
|
|
|
- }
|
|
|
- }
|
|
|
- return null
|
|
|
- }
|
|
|
- return findName(this.option) || '未知部门'
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
},
|
|
|
|
|
|
|
|
|
@@ -523,8 +481,7 @@ export default {
|
|
|
this.getSub()
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.getDepartment();
|
|
|
-
|
|
|
+ this.getPositionList();
|
|
|
}
|
|
|
};
|
|
|
</script>
|