|
@@ -184,6 +184,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column prop="departmentName" label="所属部门" width="200"></el-table-column>
|
|
|
<el-table-column prop="projectMainName" label="主项目" sortable="custom" min-width="250" v-if="user.timeType.mainProjectState == '1'">
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="inchargerName" label="项目经理" sortable="custom" min-width="150">
|
|
@@ -364,6 +365,13 @@
|
|
|
</el-select>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="所属部门">
|
|
|
+ <el-cascader v-model="addForm.deptId" :options="departmentList" placeholder="请选择部门"
|
|
|
+ :props="{ checkStrictly: true }" clearable filterable @change="cascaderChange"
|
|
|
+ ></el-cascader>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
<!-- 供应商 -->
|
|
|
<!-- <el-form-item label="供应商" v-if="user.company.packageProvider">
|
|
|
<el-select v-model="addForm.supplierId" multiple collapse-tags style="width:32%;" placeholder="请选择供应商">
|
|
@@ -1118,6 +1126,7 @@ a {
|
|
|
rowid: '',
|
|
|
phaseProjectDialog: false, // 项目阶段
|
|
|
levelList: [], // 项目级别
|
|
|
+ departmentList: []
|
|
|
};
|
|
|
},
|
|
|
// 过滤器
|
|
@@ -2924,8 +2933,10 @@ a {
|
|
|
category:null,
|
|
|
creatorId: this.user.id,
|
|
|
projectMainId: '',
|
|
|
- outputValue: ''
|
|
|
+ outputValue: '',
|
|
|
+ deptId: []
|
|
|
}
|
|
|
+
|
|
|
if(this.user.companyId == '936') {
|
|
|
this.$set(this.addForm, 'contractCode', '')
|
|
|
this.$set(this.addForm, 'warrantyStartDate', '')
|
|
@@ -2957,7 +2968,21 @@ a {
|
|
|
if (names.length > 0) {
|
|
|
names = names.substring(0, names.length -1);
|
|
|
}
|
|
|
-
|
|
|
+ var listList = JSON.parse(JSON.stringify(item)),
|
|
|
+ arrList = [],
|
|
|
+ array = [];
|
|
|
+ if (listList.deptCascade != "0" && listList.deptCascade != null) {
|
|
|
+ if (listList.deptCascade.indexOf(",") > -1) {
|
|
|
+ arrList = listList.deptCascade.split(",");
|
|
|
+ } else {
|
|
|
+ arrList = [].concat(listList.deptCascade);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (var i in arrList) {
|
|
|
+ array.push(parseInt(arrList[i]));
|
|
|
+ }
|
|
|
+ console.log(array, '转换', listList)
|
|
|
this.addForm = {
|
|
|
id: item.id,
|
|
|
name: item.projectName,
|
|
@@ -2981,8 +3006,10 @@ a {
|
|
|
projectDesc: item.projectDesc,
|
|
|
projectMainId: item.projectMainId,
|
|
|
creatorId: item.creatorId,
|
|
|
- outputValue: item.outputValue
|
|
|
+ outputValue: item.outputValue,
|
|
|
+ deptId: array.reverse()
|
|
|
}
|
|
|
+ console.log(this.addForm, '数据')
|
|
|
|
|
|
// 判断公司id是否等于936
|
|
|
if(this.user.companyId == '936') {
|
|
@@ -3286,9 +3313,11 @@ a {
|
|
|
if(this.user.companyId == '428') {
|
|
|
formData.append("projectCategorySub", this.addForm.projectCategorySub ? this.addForm.projectCategorySub : '');
|
|
|
}
|
|
|
-
|
|
|
+ if(this.addForm.deptId != null && this.addForm.deptId != '') {
|
|
|
+ formData.append("deptId", this.addForm.deptId[this.addForm.deptId.length - 1])
|
|
|
+ }
|
|
|
// formData.append("associateDegreeNames", listName)
|
|
|
- // console.log("addform",this.addForm);
|
|
|
+ console.log("addform",this.addForm);
|
|
|
// return
|
|
|
this.http.uploadFile(this.port.project.add,formData,
|
|
|
res => {
|
|
@@ -3320,7 +3349,12 @@ a {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
+ cascaderChange(e) {
|
|
|
+ // console.log(e)
|
|
|
+ // console.log(this.addForm)
|
|
|
+ // if(e.length )
|
|
|
+ console.log(e)
|
|
|
+ },
|
|
|
// 删除
|
|
|
deletePro(i, item) {
|
|
|
this.$confirm("确定要删除项目[" + item.name + "]吗?","删除项目", {
|
|
@@ -3431,7 +3465,44 @@ a {
|
|
|
|
|
|
detail(i) {
|
|
|
this.$router.push("/list/" + this.list[i].id + "/" + this.list[i].projectName);
|
|
|
- }
|
|
|
+ },
|
|
|
+ // 获取部门
|
|
|
+ getDepartmentList() {
|
|
|
+ this.http.post( this.port.manage.depList, {},
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ let dptlist = JSON.parse(JSON.stringify(res.data));
|
|
|
+ this.departmentList = this.changeArr(dptlist);
|
|
|
+ } 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;
|
|
|
+ },
|
|
|
},
|
|
|
created() {
|
|
|
let height = window.innerHeight;
|
|
@@ -3474,6 +3545,9 @@ a {
|
|
|
} else {
|
|
|
this.importanceList = [{id:1,label:'正常'},{id:2,label:'紧急'},{id:3,label:'重要'},{id:4,label:'重要且紧急'}]
|
|
|
}
|
|
|
+
|
|
|
+ // 获取部门
|
|
|
+ this.getDepartmentList()
|
|
|
|
|
|
}
|
|
|
};
|