|
@@ -19,14 +19,25 @@
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item >
|
|
|
- <span style="margin-left:10px;margin-right:10px;color:#606266;">状态</span>
|
|
|
- <el-select v-model="status" style="width:120px;" placeholder="请选择" @change="searchList">
|
|
|
+ <span style="margin-left:5px;margin-right:5px;color:#606266;">状态</span>
|
|
|
+ <el-select v-model="status" style="width:110px;" placeholder="请选择" @change="searchList">
|
|
|
<el-option label="全部" value=0 ></el-option>
|
|
|
<el-option label="进行中" value=1 ></el-option>
|
|
|
<el-option label="已完成" value=2 ></el-option>
|
|
|
<el-option label="已撤销" value=3 ></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <!-- 分类筛选 -->
|
|
|
+ <el-form-item >
|
|
|
+ <span style="margin-left:5px;margin-right:5px;color:#606266;">分类</span>
|
|
|
+ <el-select v-model="statusClf" style="width:110px;" placeholder="请选择" clearable @change="searchClfList">
|
|
|
+ <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-item style="float:right;" v-if="user.company.packageProject == 1 && (user.role == 1||user.role == 2||user.role == 5)">
|
|
|
+ <el-link type="primary" :underline="false" @click="showClfDialog = true">分类</el-link>
|
|
|
+ </el-form-item>
|
|
|
<!-- 项目成本基线条目 -->
|
|
|
<el-form-item style="float:right;" v-if="user.company.packageProject == 1 && (user.role == 1||user.role == 2||user.role == 5)">
|
|
|
<el-link type="primary" :underline="false" @click="showBaseCostItemDialog">基线成本项</el-link>
|
|
@@ -64,7 +75,8 @@
|
|
|
{{scope.$index+1+(page-1)*size}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="projectCode" label="项目编号" sortable width="150"></el-table-column>
|
|
|
+ <el-table-column prop="projectCode" label="项目编号" sortable width="120"></el-table-column>
|
|
|
+ <el-table-column prop="categoryName" label="项目分类" sortable width="120"></el-table-column>
|
|
|
<el-table-column prop="projectName" label="项目名称" width="250" sortable>
|
|
|
<template slot-scope="scope">
|
|
|
<!-- <div class="kans">
|
|
@@ -174,6 +186,11 @@
|
|
|
<el-form-item label="项目编号" >
|
|
|
<el-input v-model="addForm.code" :disabled="user.role==0" placeholder="请输入项目编号" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="项目分类">
|
|
|
+ <el-select v-model="addForm.category" clearable>
|
|
|
+ <el-option v-for="(item) in baseClfList" :key="item.id" :value="item.id" :label="item.name"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="项目名称" prop="name">
|
|
|
<el-input v-model="addForm.name" :disabled="user.role==0" placeholder="请输入项目名称" clearable></el-input>
|
|
|
</el-form-item>
|
|
@@ -408,6 +425,40 @@
|
|
|
<el-button type="primary" @click="addNewBaseItem()" >新增成本项</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+ <!-- 分类条目配置 -->
|
|
|
+ <el-dialog title="分类条目配置" show-header="false" v-if="showClfDialog" :visible.sync="showClfDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
|
|
|
+ <el-table :data="baseClfList" 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="name" label="名称" ></el-table-column>
|
|
|
+ <el-table-column label="操作" width="150">
|
|
|
+ <template slot-scope="scope" >
|
|
|
+ <el-button size="small" type="primary" @click="addNewClf(scope.row)">编辑</el-button>
|
|
|
+ <el-button size="small" type="danger" @click="deleteClf(scope.row)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ </el-table>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="showClfDialog = false" >关闭</el-button>
|
|
|
+ <el-button type="primary" @click="addNewClf()" >新增成本项</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>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click.native="addClfDialog = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="submitClf" :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">
|
|
@@ -609,7 +660,11 @@ a {
|
|
|
ause: [],
|
|
|
auseList: [],
|
|
|
yonghuUser: [],
|
|
|
- filterText: ''
|
|
|
+ filterText: '',
|
|
|
+ showClfDialog: false,
|
|
|
+ addClfDialog:false,
|
|
|
+ addClf:{name:'',id:''},
|
|
|
+ statusClf:null
|
|
|
};
|
|
|
},
|
|
|
// 过滤器
|
|
@@ -1163,6 +1218,106 @@ a {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ // 获取分类条目
|
|
|
+ getClfConfigList() {
|
|
|
+ this.http.get('/project-category/list',
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.baseClfList = res.data;
|
|
|
+ console.log("获取分类条目",res.data);
|
|
|
+ this.$forceUpdate();
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+
|
|
|
+ },
|
|
|
+ // 新增/编辑 分类条目
|
|
|
+ addNewClf(row) {
|
|
|
+ this.addClfDialog = true;
|
|
|
+ if (row == null) {
|
|
|
+ this.addClf = {}
|
|
|
+ } else {
|
|
|
+ this.addClf = row;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 提交
|
|
|
+ submitClf() {
|
|
|
+ this.http.post('/project-category/addOrMod',this.addClf,
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.addClfDialog = false;
|
|
|
+ this.baseClfList = res.data;
|
|
|
+ // this.$forceUpdate();
|
|
|
+ console.log(res.data);
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
+ // 删除
|
|
|
+ deleteClf(row) {
|
|
|
+ this.$confirm("该操作可能造成已有数据丢失,确定要删除吗?","删除分类条目", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.listLoading = true;
|
|
|
+ this.http.post('/project-category/delete',{
|
|
|
+ id: row.id
|
|
|
+ },
|
|
|
+ res => {
|
|
|
+ this.listLoading = false;
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.$message({
|
|
|
+ message: "删除成功",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ this.getClfConfigList();
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.listLoading = false;
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
+ // 分类筛选
|
|
|
+ searchClfList(){
|
|
|
+ this.page = 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
|
|
|
|
|
|
getProjectBaseConfigList() {
|
|
@@ -1477,7 +1632,9 @@ a {
|
|
|
pageSize: this.size,
|
|
|
keyword:this.keyword,
|
|
|
searchField: this.searchField,
|
|
|
- status: this.status
|
|
|
+ status: this.status,
|
|
|
+ category: this.statusClf
|
|
|
+ //
|
|
|
},
|
|
|
res => {
|
|
|
this.listLoading = false;
|
|
@@ -1496,6 +1653,7 @@ a {
|
|
|
}
|
|
|
this.list = list;
|
|
|
this.total = res.data.total;
|
|
|
+ console.log("列表",res.data);
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message: res.msg,
|
|
@@ -1528,6 +1686,7 @@ a {
|
|
|
notifyUserNames:'',
|
|
|
chosenLeaders:[],
|
|
|
taskGpIncharge: 0,
|
|
|
+ category:null
|
|
|
}
|
|
|
this.projectBaseCostData = [];
|
|
|
this.auseList = [];
|
|
@@ -1569,9 +1728,10 @@ a {
|
|
|
baseRisk2: item.baseRisk2,
|
|
|
baseOutsourcing: item.baseOutsourcing,
|
|
|
customerId:item.customerId==0?null:item.customerId,
|
|
|
- taskGpIncharge: item.taskGpIncharge
|
|
|
+ taskGpIncharge: item.taskGpIncharge,
|
|
|
+ category:item.category
|
|
|
}
|
|
|
- console.log(item.associateDegrees)
|
|
|
+ console.log("handleadd",item)
|
|
|
if(item.associateDegrees != null && item.associateDegrees != 'null' && item.associateDegrees != '') {
|
|
|
var spli = item.associateDegrees.split(',')
|
|
|
var sl = []
|
|
@@ -1786,7 +1946,13 @@ a {
|
|
|
formData.append("taskGpIncharge", this.addForm.taskGpIncharge)
|
|
|
//日报审核人
|
|
|
formData.append("auditUserIds", JSON.stringify(this.addForm.auditUserIds));
|
|
|
-
|
|
|
+
|
|
|
+ if(this.addForm.category != null) {
|
|
|
+ formData.append("category", this.addForm.category);
|
|
|
+ }
|
|
|
+ // formData.append("associateDegreeNames", listName)
|
|
|
+ // console.log("addform",formData);
|
|
|
+ // return
|
|
|
this.http.uploadFile(this.port.project.add,formData,
|
|
|
res => {
|
|
|
this.addLoading = false;
|
|
@@ -1917,6 +2083,7 @@ a {
|
|
|
this.getUsers();
|
|
|
this.getCustomerList();
|
|
|
this.getProjectBaseConfigList();
|
|
|
+ this.getClfConfigList()
|
|
|
this.yanjiuzx()
|
|
|
}
|
|
|
};
|