|
|
@@ -32,11 +32,17 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="name" :label="$t('names')" width="160" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="projectNum" :label="$t('numberofrelatedprojects')" width="160">
|
|
|
+ <el-table-column v-if="!zhengbeiCompanysId.includes(user.companyId)" prop="projectNum" :label="$t('numberofrelatedprojects')" width="160">
|
|
|
<template slot-scope="scope">{{ scope.row.projectNum + $t('ge') }}</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="projects" :label="$t('relatedprojects')" min-width="180"
|
|
|
+ <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"
|
|
|
+ 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">
|
|
|
<template slot-scope="scope">
|
|
|
@@ -53,6 +59,15 @@
|
|
|
<el-form-item :label="$t('names')" prop="name">
|
|
|
<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>
|
|
|
+
|
|
|
<el-form-item :label="$t('bei-zhu')">
|
|
|
<el-input type="textarea" :rows="4" :placeholder="$t('peaseenterthe')" v-model="addfm.rmark" clearable
|
|
|
maxlength="150" show-word-limit> </el-input>
|
|
|
@@ -102,7 +117,9 @@ export default {
|
|
|
listLoading: false,
|
|
|
addfm: {
|
|
|
name: '',
|
|
|
- rmark: ''
|
|
|
+ rmark: '',
|
|
|
+ departmentId:0,
|
|
|
+ departmentIdList:[]
|
|
|
},
|
|
|
addSubProject: false,
|
|
|
ruless: {
|
|
|
@@ -118,7 +135,8 @@ export default {
|
|
|
subProjectListArr: [], // 备用列表
|
|
|
searchNameVal: '',
|
|
|
options: [],
|
|
|
- value: ''
|
|
|
+ value: '',
|
|
|
+ zhengbeiCompanysId:[8138,8261,8264,8268]
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -280,6 +298,8 @@ export default {
|
|
|
);
|
|
|
},
|
|
|
addNewSubProject(subProject) {
|
|
|
+ console.log(this.user)
|
|
|
+ console.log(this.option)
|
|
|
// console.log(1234)
|
|
|
// if (subProject == null) {
|
|
|
// this.addForm = {projectId: this.currentProject.id, level:1}
|
|
|
@@ -291,8 +311,10 @@ 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
|
|
|
} else {
|
|
|
- this.addfm = { name: '', rmark: '' }
|
|
|
+ this.addfm = { name: '', rmark: '' ,departmentId : null,departmentIdList:[]}
|
|
|
}
|
|
|
this.addSubProject = true;
|
|
|
},
|
|
|
@@ -336,9 +358,17 @@ export default {
|
|
|
.catch(() => { });
|
|
|
},
|
|
|
submitInsertSubProject() {
|
|
|
+ console.log(this.addfm.departmentIdList)
|
|
|
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]
|
|
|
+ console.log(slp)
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ slp.departmentId = null
|
|
|
+ }
|
|
|
this.http.post('/report-extra-degree/addOrMod', slp,
|
|
|
res => {
|
|
|
this.listLoading = false;
|
|
|
@@ -368,11 +398,88 @@ 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++) {
|
|
|
+ if (arr[i].id != -1 && arr[i].id != 0) {
|
|
|
+ if (arr[i].children != null && arr[i].children.length > 0) {
|
|
|
+ arr[i].children = this.changeArr(arr[i].children);
|
|
|
+ }
|
|
|
+ arr[i].id && (arr[i].value = arr[i].id);
|
|
|
+ delete arr[i].id;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (var i in arr) {
|
|
|
+ if (arr[i].id == -1 || arr[i].id == 0) {
|
|
|
+ arr.splice(i, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ 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) || '未知部门'
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
+
|
|
|
+
|
|
|
created() {
|
|
|
this.getSub()
|
|
|
},
|
|
|
mounted() {
|
|
|
+ this.getDepartment();
|
|
|
|
|
|
}
|
|
|
};
|