|
@@ -76,6 +76,9 @@
|
|
|
<el-dropdown-item v-if="permissions.projectClassification">
|
|
|
<el-link type="primary" :underline="false" @click="showClfDialog = true">分类管理</el-link>
|
|
|
</el-dropdown-item>
|
|
|
+ <el-dropdown-item v-if="user.timeType.mainProjectState == 1">
|
|
|
+ <el-link type="primary" :underline="false" @click="mainProjectDialog = true">主项目管理</el-link>
|
|
|
+ </el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
|
</el-form-item>
|
|
@@ -190,7 +193,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" :width="showColumnWidth" align="left" fixed="right" v-if="showColumnWidth != '0' || permissions.projectManagement">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button v-if="permissions.projectManagement || user.id==scope.row.creatorId" size="mini" @click="subProject(scope.row)">子项目</el-button>
|
|
|
+ <el-button v-if="(permissions.projectManagement || user.id==scope.row.creatorId) && user.timeType.mainProjectState != '1'" size="mini" @click="subProject(scope.row)">子项目</el-button>
|
|
|
<el-button size="mini" v-if="permissions.projectManagement || user.id==scope.row.inchargerId || user.id==scope.row.creatorId" type="primary" @click="handleAdd(scope.$index, scope.row)">编辑</el-button>
|
|
|
<!-- <el-button v-if="permissions.projectManagement || user.id==scope.row.creatorId" size="mini" @click="deletePro(scope.$index, scope.row)">删除</el-button> -->
|
|
|
<el-dropdown class="customdropdown" split-button size="mini" @click="finishPro(scope.row)" v-if="(permissions.projectManagement || user.id==scope.row.creatorId || user.id==scope.row.inchargerId) && scope.row.status == 1" placement="bottom-start">
|
|
@@ -231,6 +234,14 @@
|
|
|
<el-form ref="form1" :model="addForm" :rules="rules" label-width="120px">
|
|
|
<el-form-item label="项目编号" >
|
|
|
<el-input v-model="addForm.code" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目编号" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="主项目" v-if="user.timeType.mainProjectState == '1'">
|
|
|
+ <el-select v-model="addForm.projectMainId" clearable :disabled="!permissions.projectManagement && addForm.creatorId != user.id">
|
|
|
+ <el-option v-for="(item) in mainProjectList" :key="item.id" :value="item.id" :label="item.name + '\u3000' + item.code">
|
|
|
+ <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.code }}</span>
|
|
|
+ <span style="float: right;margin-left: 20px">{{ item.name }}</span>
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="项目分类">
|
|
|
<el-select v-model="addForm.category" style="width:32%;" clearable :disabled="!permissions.projectManagement && addForm.creatorId != user.id">
|
|
@@ -504,11 +515,35 @@
|
|
|
<el-button type="primary" @click="addNewClf()" >新增分类项</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+ <!-- 主项目配置 -->
|
|
|
+ <el-dialog title="主项目管理" show-header="false" v-if="mainProjectDialog" :visible.sync="mainProjectDialog" :close-on-click-modal="false" customClass="customWidth" width="800px">
|
|
|
+ <el-table :data="mainProjectList" highlight-current-row height="400" style="width: 100%;">
|
|
|
+ <el-table-column type="index" width="60" label="序号">
|
|
|
+ <template slot-scope="scope" >
|
|
|
+ {{scope.$index+1+(page-1)*size}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="code" label="编号" ></el-table-column>
|
|
|
+ <el-table-column prop="name" label="名称" ></el-table-column>
|
|
|
+ <el-table-column prop="categoryName" label="分类名称" ></el-table-column>
|
|
|
+ <el-table-column label="操作" width="150">
|
|
|
+ <template slot-scope="scope" >
|
|
|
+ <el-button size="small" type="primary" @click="addManPro(scope.row)">编辑</el-button>
|
|
|
+ <el-button size="small" type="danger" @click="deleteManPro(scope.row)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ </el-table>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="mainProjectDialog = false" >关闭</el-button>
|
|
|
+ <el-button type="primary" @click="addManPro()" >新增主项目</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
<!-- 新增/编辑 分类条目 -->
|
|
|
<el-dialog title="新增/修改分类条目" v-if="addClfDialog" :visible.sync="addClfDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
|
|
|
<el-form ref="form2" :model="addClf" :rules="rules" label-width="100px">
|
|
|
- <el-form-item label="分类名称" prop="name">
|
|
|
- <el-input v-model="addClf.name" placeholder="请输入名称" clearable></el-input>
|
|
|
+ <el-form-item label="主项目名称" prop="name">
|
|
|
+ <el-input v-model="addClf.name" placeholder="请输入主项目名称" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -516,6 +551,26 @@
|
|
|
<el-button type="primary" @click="submitClf" :loading="addLoading">提交</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+ <!-- 新增/编辑主项目 -->
|
|
|
+ <el-dialog title="新增/修改主项目" v-if="addFlgmainProjectDialog" :visible.sync="addFlgmainProjectDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
|
|
|
+ <el-form ref="form2" :model="addMainForm" :rules="rules" label-width="100px">
|
|
|
+ <el-form-item label="主项目名称" prop="name">
|
|
|
+ <el-input v-model="addMainForm.name" placeholder="请输入名称" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="主项目编号" prop="code">
|
|
|
+ <el-input v-model="addMainForm.code" placeholder="请输入编号" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="分类管理">
|
|
|
+ <el-select v-model="addMainForm.categoryId" placeholder="请选择分类" clearable >
|
|
|
+ <el-option v-for="item in baseClfList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click.native="addFlgmainProjectDialog = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="submitManPro" :loading="addLoading">提交</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
|
|
|
<el-dialog title="新增/修改成本项" v-if="addBaseItemDialog" :visible.sync="addBaseItemDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
|
|
|
<el-form ref="form2" :model="addForm" :rules="rules" label-width="100px">
|
|
@@ -703,6 +758,9 @@ a {
|
|
|
components:{projectgantt},
|
|
|
data() {
|
|
|
return {
|
|
|
+ addFlgmainProjectDialog: false,
|
|
|
+ mainProjectList: [],
|
|
|
+ mainProjectDialog: false,
|
|
|
showImportResult: false,
|
|
|
importResultMsg:null,
|
|
|
isganttshow: false,
|
|
@@ -780,7 +838,8 @@ a {
|
|
|
},
|
|
|
temaddForm: {},
|
|
|
rules: {
|
|
|
- name: [{ required: true, message: "请输入名称", trigger: "blur" }]
|
|
|
+ name: [{ required: true, message: "请输入名称", trigger: "blur" }],
|
|
|
+ code: [{ required: true, message: "请输入编号", trigger: "blur" }]
|
|
|
},
|
|
|
ause: [],
|
|
|
auseList: [],
|
|
@@ -790,6 +849,12 @@ a {
|
|
|
showClfDialog: false,
|
|
|
addClfDialog:false,
|
|
|
addClf:{name:'',id:''},
|
|
|
+ addMainForm:{
|
|
|
+ name:'',
|
|
|
+ id:'',
|
|
|
+ code: '',
|
|
|
+ categoryId: ''
|
|
|
+ },
|
|
|
statusClf:null,
|
|
|
permissionsObj: {},
|
|
|
|
|
@@ -843,6 +908,42 @@ a {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ addManPro(row) {
|
|
|
+ this.addFlgmainProjectDialog = true
|
|
|
+ if(!row) {
|
|
|
+ this.addMainForm = {
|
|
|
+ name: '',
|
|
|
+ id: '',
|
|
|
+ code: '',
|
|
|
+ categoryId: ''
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.addMainForm = {
|
|
|
+ id: row.id,
|
|
|
+ code: row.code,
|
|
|
+ name: row.name,
|
|
|
+ categoryId: row.categoryId,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取主项目
|
|
|
+ getMainProject() {
|
|
|
+ this.http.post('/project-main/list',{},res => {
|
|
|
+ if(res.code == 'ok'){
|
|
|
+ this.mainProjectList = res.data
|
|
|
+ }else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },err => {
|
|
|
+ this.$message({
|
|
|
+ message: err,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
// 批量修改自定义维度
|
|
|
checkedWudulist(e){
|
|
|
console.log(e);
|
|
@@ -1674,6 +1775,28 @@ a {
|
|
|
}
|
|
|
);
|
|
|
},
|
|
|
+ // 提交
|
|
|
+ submitManPro() {
|
|
|
+ this.http.post('/project-main/addOrMod',this.addMainForm,
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.addFlgmainProjectDialog = false;
|
|
|
+ this.getMainProject()
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
// 删除
|
|
|
deleteClf(row) {
|
|
|
this.$confirm("该操作可能造成已有数据丢失,确定要删除吗?","删除分类条目", {
|
|
@@ -1712,6 +1835,44 @@ a {
|
|
|
})
|
|
|
.catch(() => {});
|
|
|
},
|
|
|
+ // 删除主项目
|
|
|
+ deleteManPro(row) {
|
|
|
+ this.$confirm("该操作可能造成已有数据丢失,确定要删除吗?","删除主项目", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.listLoading = true;
|
|
|
+ this.http.post('/project-main/delete',{
|
|
|
+ id: row.id
|
|
|
+ },
|
|
|
+ res => {
|
|
|
+ this.listLoading = false;
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.$message({
|
|
|
+ message: "删除成功",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ this.getMainProject();
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.listLoading = false;
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
// 分类筛选
|
|
|
searchClfList(){
|
|
|
this.page = 1;
|
|
@@ -2119,7 +2280,8 @@ a {
|
|
|
chosenLeaders:[],
|
|
|
taskGpIncharge: 0,
|
|
|
category:null,
|
|
|
- creatorId: this.user.id
|
|
|
+ creatorId: this.user.id,
|
|
|
+ projectMainId: ''
|
|
|
}
|
|
|
this.projectBaseCostData = [];
|
|
|
this.auseList = [];
|
|
@@ -2163,7 +2325,8 @@ a {
|
|
|
customerId:item.customerId==0?null:item.customerId,
|
|
|
taskGpIncharge: item.taskGpIncharge,
|
|
|
category:item.category,
|
|
|
- projectDesc: item.projectDesc
|
|
|
+ projectDesc: item.projectDesc,
|
|
|
+ projectMainId: item.projectMainId
|
|
|
}
|
|
|
this.deleteVif = item.creatorId
|
|
|
console.log("handleadd",this.deleteVif,this.addForm.id)
|
|
@@ -2388,8 +2551,11 @@ a {
|
|
|
if(this.addForm.category != null) {
|
|
|
formData.append("category", this.addForm.category);
|
|
|
}
|
|
|
+ if(this.user.timeType.mainProjectState == '1') {
|
|
|
+ formData.append("projectMainId", this.addForm.projectMainId);
|
|
|
+ }
|
|
|
// formData.append("associateDegreeNames", listName)
|
|
|
- // console.log("addform",formData);
|
|
|
+ // console.log("addform",this.addForm);
|
|
|
// return
|
|
|
this.http.uploadFile(this.port.project.add,formData,
|
|
|
res => {
|
|
@@ -2525,6 +2691,7 @@ a {
|
|
|
this.getProjectBaseConfigList();
|
|
|
this.getClfConfigList()
|
|
|
this.yanjiuzx()
|
|
|
+ this.getMainProject()
|
|
|
}
|
|
|
};
|
|
|
</script>
|