山水共长天一色 3 years ago
parent
commit
21e82b7915

+ 2 - 0
fhKeeper/formulahousekeeper/timesheet/src/permissions.js

@@ -13,6 +13,7 @@ const StringUtil = {
         projectBaseline: false, // 查看成本基线 (项目里面的成本基线) //
         projectCorrection: false, // 校正成本基线 (项目里面的成本基线的编辑) //
         projectContract: false, // 查看合同金额 //
+        projectAllocate: false, // 下拨成本预算 //
 
         // 组织架构
         structurePersonnel: false, // 人员成本管理 (月成本,时薪,操作) //
@@ -123,6 +124,7 @@ const StringUtil = {
         arr[i] == '出差流程设置' ? obj.awayOfficeProcess = true : ''
         arr[i] == '管理专业证书' ? obj.structureCertificate = true : ''
         arr[i] == '查看加班成本' ? obj.reportCost = true : ''
+        arr[i] == '下拨成本预算' ? obj.projectAllocate = true : ''
     }
 
     return obj

+ 2 - 1
fhKeeper/formulahousekeeper/timesheet/src/routes.js

@@ -105,9 +105,10 @@ export const fixedRouter = [
         leaf: true,
         children: [
             { path: '/projectInside/:id', component: projectInside, name: '任务看板' },
-            { path: '/files/:id', component: projectInside, name: '任务看板' },
+            { path: '/files/:id', component: projectInside, name: '文件中心' },
             { path: '/info/:id', component: projectInside, name: '项目概览' },
             { path: '/summary/:id', component: projectInside, name: '数据统计' },
+            { path: '/costbaseline/:id', component: projectInside, name: '成本管理' },
             { path: '/earning/:id', component: projectInside, name: '挣值分析' },
         ]
     },

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/awayOffice/awayOffice.vue

@@ -539,7 +539,7 @@
             v-if="DingdingForm.projectId != null && wuduData.customDegreeActive == 1"
             style="width:300px;margin-right:30px;display:inline-block;"
             prop="degreeName">
-                <el-select style="width:100%" v-model="DingdingForm.degreeId" filterable clearable placeholder="请选择" >
+                <el-select style="width:100%" v-model="DingdingForm.degreeId" filterable clearable placeholder="请选择" :disabled="DingdingForm.projectId != null && DingdingForm.projectId != '' && wuduData.customDegreeActive == 1 ? false : true">
                     <el-option
                     v-for="item in wuduList"
                     :key="item.id"

+ 431 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/project/CostBaseline.vue

@@ -0,0 +1,431 @@
+<template>
+    <div :style="'padding:10px;background:#f7f7f7;min-height:'+tableHeight+'px;'">
+        <div style="margin: 0 auto;width:1120px;">
+            <el-row :gutter="24">
+                <el-col :span="12">
+                    <div class="box" style="min-height:180px">
+                        <div >
+                            <!-- <div class="lableTxt">总成本基线</div> -->
+                            <label class="lableTxt">总成本基线<el-link v-if="permissions.projectCorrection" @click="correctBase" style="float:right;"><i class="el-icon-edit"  ></i></el-link></label>
+                            <div class="lableCon" v-for="item in projectBaseCostData" :key="item.id">
+                                <div><span class="gray_label">{{item.baseName}}:</span></div>
+                                <div><span style="padding-right:20px;float:right;">¥{{item.baseAmount==null?'-':item.baseAmount | numberToCurrency}}</span></div>
+                            </div>
+                            <div style="height:24px">
+                            <el-link style="float:right;margin-right:10px" @click="addCostAdd" size="small" v-if="permissions.projectAllocate" type="primary">下拨成本预算</el-link>
+                            </div>
+                        </div>
+                    </div>
+                </el-col>
+                <el-col :span="12">
+                    <div class="box" style="min-height:180px;">
+                        <label class="lableTxt">当前成本基线</label>
+                            <div class="lableCon" v-for="item in nowBaseList" :key="item.id">
+                                <div><span class="gray_label">{{item.baseName}}:</span></div>
+                                <div><span style="padding-right:20px;float:right;">¥{{item.baseAmount==null?'-':item.baseAmount | numberToCurrency}}</span></div>
+                            </div>
+                            <div style="height:24px">
+                            <!-- <el-link style="float:right;margin-right:10px" @click="addCostAdd" size="small" v-if="permissions.projectAllocate" type="primary">下拨成本预算</el-link> -->
+                            </div>
+                    </div>
+                </el-col>
+                <el-col :span="24"></el-col>
+            </el-row>
+            <el-row :gutter="24">
+                <el-col :span="24">
+                    <div class="box">
+                        <el-table :data="addList" :loading="ListLoading" :default-sort="{prop:'indate',order:'descending'}">
+                            <el-table-column v-for="item in addListColumns" :key="item.id" :label="item.name" align="right" header-align="center">
+                                <template slot-scope="scope">
+                                    <span>¥{{itemListFilter(scope.row.addItemList,item.id) | numberToCurrency}}</span>
+                                    <!-- <span style="margin-right:30px">{{itemListFilter(scope.row.addItemList,item.id) == false ? '¥' + (itemListFilter(scope.row.addItemList,item.id) | numberToCurrency) : '-'}}</span> -->
+                                    <!-- <span style="margin-right:30px">{{itemListFilter(scope.row.addItemList,item.id) == false ? '-' : '¥' + itemListFilter(scope.row.addItemList,item.id) | numberToCurrency}}</span> -->
+                                </template>
+                            </el-table-column>
+                            <el-table-column label="下拨时间" prop="indate" align="center"></el-table-column>
+                            <el-table-column label="操作人员" prop="userName" align="center"></el-table-column>
+                            <el-table-column label="备注" prop="remark" align="left" header-align="center" show-overflow-tooltip></el-table-column>
+                            <el-table-column label="" align="center">
+                                <template slot-scope="scope">
+                                    <el-button size="small" @click="revert(scope.row.id)" v-if="scope.$index == 0">撤销</el-button>
+                                </template>
+                            </el-table-column>
+                        </el-table>
+                    </div>
+                </el-col>
+            </el-row>
+        </div>
+
+
+        <el-dialog title="下拨成本预算" v-if="addCostAddDialog" :visible.sync="addCostAddDialog" :close-on-click-modal="false" width="600px">
+            <el-form>
+                <el-form-item v-for="item in modBaseCostData" :key="item.id" :label="item.baseName" label-width="200px">
+                    <el-input :id="'nowBaseCost'+index" v-model="item.baseAmount" placeholder="请输入" clearable @keyup.native="restrictNumber('nowBaseCost'+index)"></el-input>
+                </el-form-item>
+                <el-form-item label="备注" label-width="200px">
+                    <el-input v-model="remark"  placeholder="请输入下拨备注" ></el-input>
+                </el-form-item>
+            </el-form>
+            <div slot="footer" class="dialog-footer">
+                <!-- <el-button @click="test">test</el-button> -->
+                <el-button @click.native="addCostAddDialog = false">取消</el-button>
+                <el-button type="primary" @click="addCostAddSure" :loading="addLoading">提交</el-button>
+            </div>
+        </el-dialog>
+        <el-dialog title="校正成本基线" v-if="correctBaseDialog" :visible.sync="correctBaseDialog" :close-on-click-modal="false" width="600px">
+            <el-form>
+                <el-form-item v-for="item in correctBaseCostData" :key="item.id" :label="item.baseName" label-width="200px">
+                    <el-input :id="'baseCost'+index" v-model="item.baseAmount" placeholder="请输入" clearable @keyup.native="restrictNumber('baseCost'+index)"></el-input>
+                </el-form-item>
+                <el-form-item label="备注" label-width="200px">
+                    <el-input v-model="remark"  placeholder="请输入校正原因" ></el-input>
+                </el-form-item>
+            </el-form>
+            <div slot="footer" class="dialog-footer">
+                <!-- <el-button @click="test">test</el-button> -->
+                <el-button @click.native="correctBaseDialog = false">取消</el-button>
+                <el-button type="primary" @click="correctBaseSure" :loading="addLoading">提交</el-button>
+            </div>
+        </el-dialog>
+    </div>
+</template>
+<script>
+    import util from "../../common/js/util";
+    export default {
+        data() {
+            return {
+                user: JSON.parse(sessionStorage.getItem('user')),
+                permissions: JSON.parse(sessionStorage.getItem("permissions")),
+                curProjectId: null,
+                addLoading: false,
+                projectBaseCostData: [],
+                modBaseCostData: [],
+                correctBaseCostData: [],
+                remark: '',
+                addCostAddDialog: false,
+                addListColumns:[],
+                ListLoading: false,
+                nowBaseList: [],
+                correctBaseDialog: false,
+                projectContractAmount: null
+            };
+        },
+        filters: {
+            numberToCurrency(value) {
+                console.log('info numberToCurrency='+value);
+                if (!value || value=='-') return '0.00'
+                value = value.toFixed(2)
+                const intPart = Math.trunc(value)
+                const intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
+                let floatPart = '.00'
+                const valueArray = value.toString().split('.')
+                if (valueArray.length === 2) { // 有小数部分
+                floatPart = valueArray[1].toString() // 取得小数部分
+                return intPartFormat + '.' + floatPart
+                }
+                return intPartFormat + floatPart
+            }
+        },
+        methods: {
+            restrictNumber(targetId) {
+                let inpu = document.getElementById(targetId);
+                inpu.value = inpu.value.replace(/[^\d.]/g, "");  //仅保留数字和"."
+                inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
+                inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
+                inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
+                if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
+                    inpu.value = parseFloat(inpu.value);
+                }
+            },
+            test(item){
+                // let list = [
+                //     {id: 5, name: 'zs'},
+                //     {id: 6, name: 'ls'},
+                //     {id: 7, name: 'ww'}
+                // ]
+                // let lid = 5
+                // let item = this.itemListFilter(list,lid)
+                console.log('test',this.addListColumns);
+            },
+            itemListFilter(emList,eId){
+                let emItem = emList.filter((em)=>{
+                    return em.baseId == eId
+                })
+                if(emItem.length == 0){
+                    return 0
+                }else{
+                    return emItem[0].baseAmount
+                }
+                
+            },
+            getProjectBaseData(projectId) {
+                this.http.post('/project-basecost/get',{
+                    projectId: projectId
+                },res => {
+                    if (res.code == "ok") {
+                        this.projectBaseCostData = res.data;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            // 撤销操作
+            revert(eId){
+                this.http.post('/project-addcost-record/revert',{
+                    id: eId
+                },res => {
+                    if(res.code == 'ok'){
+                        this.$message({
+                            message: '撤销成功',
+                            type: 'success'
+                        })
+                        this.getAddList()
+                        this.getNowBase()
+                    }else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },err => {
+                    this.$message({
+                        message: err,
+                        type: 'error'
+                    })
+                })
+            },
+            correctBase(){
+                // 校正成本基线
+                this.correctBaseCostData = JSON.parse(JSON.stringify(this.projectBaseCostData))
+                this.correctBaseDialog = true
+            },
+            addCostAdd(){
+                this.modBaseCostData = JSON.parse(JSON.stringify(this.projectBaseCostData))
+                for (let i = 0; i < this.modBaseCostData.length; i++) {
+                    this.modBaseCostData[i].baseAmount = 0
+                }
+                this.addCostAddDialog = true
+            },
+            addCostAddSure(){
+                this.addLoading = true
+                let itemList = []
+                for(let i=0; i<this.modBaseCostData.length; i++){
+                    // let itemListItem = {
+                    //     baseId: this.modBaseCostData[i].baseId,
+                    //     baseName: this.modBaseCostData[i].baseName,
+                    //     baseAmount: this.modBaseCostData[i].baseAmount
+                    // }
+                    itemList.push({
+                        baseId: this.modBaseCostData[i].baseId,
+                        baseName: this.modBaseCostData[i].baseName,
+                        baseAmount: this.modBaseCostData[i].baseAmount
+                    })
+                }
+                this.http.post('/project-addcost-record/add',{
+                    projectId: this.curProjectId,
+                    userId: this.user.id,
+                    userName: this.user.name,
+                    itemList: JSON.stringify(itemList),
+                    remark: this.remark
+                },res => {
+                    if(res.code == 'ok'){
+                        this.addLoading = false
+                        this.addCostAddDialog = false
+                        this.$message({
+                            message: '下拨成功',
+                            type: 'success'
+                        })
+                        this.remark = ''
+                        this.getAddList()
+                        this.getNowBase()
+                    }else {
+                        this.addLoading = false
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },err => {
+                    this.addLoading = false
+                    this.$message({
+                        message: err,
+                        type: 'error'
+                    })
+                })
+            },
+            correctBaseSure(){
+                //如果没有做修改,不提交数据
+                var hasChangeData = false;
+                for (var i=0;i<this.correctBaseCostData.length; i++) {
+                    var item = this.correctBaseCostData[i];
+                    var oldAmount = this.projectBaseCostData.filter(p=>p.id == item.id)[0].baseAmount;
+                    if (item.baseAmount != oldAmount) {
+                        hasChangeData = true;
+                        break;
+                    }
+                }
+                if (!hasChangeData) {
+                    this.correctBaseDialog = false;
+                    return;
+                }
+                this.http.post('/project/adjustBase', {
+                    id: this.curProjectId,
+                    contractAmount: this.projectContractAmount,
+                    baseCostData:JSON.stringify(this.correctBaseCostData),
+                    remark: this.remark
+                },
+                res => {
+                    if (res.code == "ok") {
+                        this.correctBaseDialog = false;
+                        this.$message({
+                            message: '校正成功',
+                            type: "success"
+                        });
+                        this.remark = ''
+                        this.getProjectBaseData(this.curProjectId)
+                    } else {
+                        this.$message({
+                        message: res.msg,
+                        type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            getNowBase(){
+                this.http.post('/project-currentcost/get',{
+                    companyId: this.user.companyId,
+                    projectId: this.curProjectId
+                },res => {
+                    if(res.code == 'ok'){
+                        this.nowBaseList = res.data
+                        
+                    }else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },err => {
+                    this.$message({
+                        message: err,
+                        type: 'error'
+                    })
+                })
+            },
+            getAddList(){
+                this.ListLoading = true
+                this.http.post('/project-addcost-record/getAddList',{
+                    companyId: this.user.companyId,
+                    projectId: this.curProjectId
+                },res => {
+                    if(res.code == 'ok'){
+                        this.ListLoading = false
+                        this.addList = res.data.recordList
+                        this.addListColumns = res.data.columns
+                        console.log('getaddlist',res.data);
+                    }else {
+                        this.ListLoading = false
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },err => {
+                    this.ListLoading = false
+                    this.$message({
+                        message: err,
+                        type: 'error'
+                    })
+                })
+            },
+            getProjectInfo() {
+                this.http.post('/project/detail', {
+                    id: this.curProjectId
+                },
+                res => {
+                    if (res.code == "ok") {
+                        this.projectContractAmount = res.data.contractAmount;
+                        console.log('res.data',res.data);
+                    } else {
+                        this.$message({
+                        message: res.msg,
+                        type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+        },
+        created() {
+            let height = window.innerHeight;
+            this.tableHeight = height - 160;
+            const that = this;
+            window.onresize = function temp() {
+                that.tableHeight = window.innerHeight - 160;
+            };
+        },
+        mounted() {
+            this.curProjectId = parseInt(this.$route.params.id);
+            // var _this = this;
+            // var that = this
+            console.log("mounted",this.$route.params)
+            // window.addEventListener("resize", function() {
+            //     // _this.profitChart.resize();
+            //     // that.profitChart.resize(); 
+            // });
+            this.getProjectBaseData(this.curProjectId)
+            this.getAddList()
+            this.getNowBase()
+            this.getProjectInfo()
+        }
+    };
+</script>
+<style scoped>
+.box {
+    background:#fff;
+    border: 1px solid #eeeeee;
+    border-radius:5px;
+    padding:10px;
+    margin-top:10px;
+    overflow-x: auto;
+}
+.el-row {
+    margin-top:10px;
+}
+.lableTxt {
+    color:#666;
+}
+.lableCon{
+    margin: 20px 10px;
+}
+.lableCon div:nth-child(1){
+    width: 50%;
+    float: left;
+}
+.lableCon div:nth-child(2){
+    width: 25%;
+    display: inline-block;
+}
+.gray_label {
+    color: #999;
+}
+</style>

+ 2 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/project/info.vue

@@ -61,7 +61,7 @@
                         <el-button class="el-icon-plus" @click="addMembVisible=true" size="mini"></el-button>
                     </div>
                 </div>
-                <div class="box info" style="margin-top:10px;" v-if="permissions.projectBaseline">
+                <!-- <div class="box info" style="margin-top:10px;" v-if="permissions.projectBaseline">
                     <div><label>成本基线<el-link v-if="permissions.projectCorrection" @click="showEditBase" style="float:right;"><i class="el-icon-edit"  ></i></el-link></label>
                     <el-row :gutter="10">
                         <div v-for="item in projectBaseCostData" :key="item.id">
@@ -71,7 +71,7 @@
                         </div>
                     </el-row>
                     </div>
-                </div>
+                </div> -->
                 <!--项目相关工程专业 -->
                 <div class="box info" style="margin-top:10px;" v-if="user.company.packageEngineering == 1">
                     <div><label>相关工程专业<el-link v-if="user.id == project.creatorId || user.id == project.inchargerId" @click="showEditProfession" style="float:right;"><i class="el-icon-edit"  ></i></el-link></label>
@@ -1200,7 +1200,6 @@
                 this.addForm.name = this.addForm.projectName;
                 this.modBaseCostData = JSON.parse(JSON.stringify(this.projectBaseCostData));
                 this.addBaseFormVisible = true;
-
             },
             showEdit() {
                 this.addForm = JSON.parse(JSON.stringify(this.project));

+ 63 - 8
fhKeeper/formulahousekeeper/timesheet/src/views/project/list.vue

@@ -174,7 +174,8 @@
         <el-col :span="24" class="toolbar">
             <template v-if="user.timeType.customDegreeActive && permissions.projectManagement">
                 <el-button size="small" @click="batchSetWudulistBtn1">取消</el-button>
-                <el-button size="small" type="primary" @click="batchSetWudulistBtn2">批量设置{{user.timeType.customDegreeName}}</el-button>
+                <el-button size="small" type="primary" @click="batchSetWudulistBtn2(true)">批量设置{{user.timeType.customDegreeName}}</el-button>
+                <el-button size="small" type="primary" @click="batchSetWudulistBtn2(false)">批量添加{{user.timeType.customDegreeName}}</el-button>
             </template>
             <el-pagination
                 @size-change="handleSizeChange"
@@ -413,7 +414,7 @@
         </el-dialog>
 
         <!-- 项目基线成本项配置弹出框 -->
-        <el-dialog title="项目基线成本项管理" show-header="false" v-if="showBaseConfig" :visible.sync="showBaseConfig" :close-on-click-modal="false" customClass="customWidth" width="500px">
+        <el-dialog title="项目基线成本项管理" show-header="false" v-if="showBaseConfig" :visible.sync="showBaseConfig" :close-on-click-modal="false" customClass="customWidth" width="600px">
             <el-table :data="baseCostItemList" highlight-current-row  height="400" style="width: 100%;">
             <el-table-column type="index" width="60" label="序号">
                 <template slot-scope="scope" >
@@ -421,6 +422,11 @@
                     </template>
             </el-table-column>
             <el-table-column prop="name" label="名称" ></el-table-column>
+            <el-table-column prop="alarmType" label="预警">
+                <template slot-scope="scope">
+                    <span>{{scope.row.alarmType ? "工时成本预警" : "无预警"}}</span>
+                </template>
+            </el-table-column>
             <el-table-column label="操作" width="150">
                 <template slot-scope="scope" >
                     <el-button size="small" type="primary" @click="addNewBaseItem(scope.row)">编辑</el-button>
@@ -474,6 +480,10 @@
                 <el-form-item label="成本项名称" prop="name">
                     <el-input v-model="addForm.name" placeholder="请输入名称" clearable></el-input>
                 </el-form-item>
+                <el-form-item label="预警" prop="alarmType">
+                    <el-radio v-model="addForm.alarmType" :label="0">无预警</el-radio>
+                    <el-radio v-model="addForm.alarmType" :label="1">工时成本预警</el-radio>
+                </el-form-item>
             </el-form>
             <div slot="footer" class="dialog-footer">
                 <el-button @click.native="addBaseItemDialog = false">取消</el-button>
@@ -550,7 +560,7 @@
             </div>
         </el-dialog>
 
-        <el-dialog title="批量修改" :visible.sync="checkedWuduDialog" v-if="checkedWuduDialog" width="40%">
+        <el-dialog :title="checkoradd ? '批量修改' : '批量添加'" :visible.sync="checkedWuduDialog" v-if="checkedWuduDialog" width="40%">
             <el-form model="" label-width="20%">
                 <el-form-item :label="'设置' + user.timeType.customDegreeName">
                     <el-select v-model="checkedWuduArr" value-key="id" :placeholder="'请选择' + user.timeType.customDegreeName" multiple style="width: 100%">
@@ -560,7 +570,8 @@
             </el-form>
             <div slot="footer" class="dialog-footer">
                 <el-button @click="checkedWuduDialog = false">取消</el-button>
-                <el-button type="primary" @click="batchSetWudulistBtn3">确定</el-button>
+                <el-button type="primary" @click="batchSetWudulistBtn3" v-if="checkoradd">确定</el-button>
+                <el-button type="primary" @click="batchSetWudulistBtn4" v-if="!checkoradd">确定</el-button>
             </div>
         </el-dialog>
     </section>
@@ -668,7 +679,8 @@ a {
                     taskGpIncharge: 0,
                     id: '',
                     code: '',
-                    projectDesc: ''
+                    projectDesc: '',
+                    alarmType: 0
                 },
                 temaddForm: {},
                 rules: {
@@ -686,7 +698,8 @@ a {
 
                 checkedProjectArr: [],
                 checkedWuduDialog: false,
-                checkedWuduArr: []
+                checkedWuduArr: [],
+                checkoradd: true
             };
         },
         // 过滤器
@@ -725,11 +738,12 @@ a {
                 this.$refs.projectlistOfWudulist.clearSelection()
                 this.checkedWuduArr = []
             },
-            batchSetWudulistBtn2(){
+            batchSetWudulistBtn2(e){
                 if(this.checkedProjectArr.length == 0){
                     this.$message('请选择项目')
                     return
                 }
+                this.checkoradd = e
                 this.checkedWuduDialog = true
             },
             batchSetWudulistBtn3(){
@@ -773,6 +787,47 @@ a {
                     })
                 })
             },
+            batchSetWudulistBtn4(){
+                if(this.checkedWuduArr.length == 0){
+                    this.$message('请选择' + this.user.timeType.customDegreeName)
+                    return
+                }
+                let projectIds = []
+                for(let i=0; i<this.checkedProjectArr.length; i++){
+                    projectIds.push(this.checkedProjectArr[i].id)
+                }
+                let degreeIds = []
+                let degreeNames = []
+                for(let s=0; s<this.checkedWuduArr.length; s++){
+                    degreeIds.push(this.checkedWuduArr[s].id)
+                    degreeNames.push(this.checkedWuduArr[s].name)
+                }
+                this.http.post('/project/addBatchAccoDegrees',{
+                    ids: JSON.stringify(projectIds),
+                    associateDegrees: degreeIds.toString(),
+                    associateDegreeNames: degreeNames.toString()
+                },res => {
+                    if(res.code == 'ok'){
+                        this.checkedWuduDialog = false
+                        this.batchSetWudulistBtn1()
+                        this.$message({
+                            message: '添加成功',
+                            type: 'success'
+                        })
+                        this.getList()
+                    }else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },err => {
+                    this.$message({
+                        message: err,
+                        type: 'error'
+                    })
+                })
+            },
 
 
 
@@ -1489,7 +1544,7 @@ a {
             addNewBaseItem(row) {
                 this.addBaseItemDialog = true;
                 if (row == null) {
-                    this.addForm = {}
+                    this.addForm = {alarmType: 0}
                 } else {
                     this.addForm = row;
                 }

+ 6 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/project/projectInside.vue

@@ -27,13 +27,13 @@
                 <el-container style="padding: 0px;">
                     <el-aside :style="'overflow:auto;padding-left:10px;padding-right:5px;height:'+tableHeight+'px;width:'+groupWidth+'px;'">
                         <el-input v-model="groupSearch" size="small" placeholder="搜索分组" @input="startSearchGroup" style="margin-top:10px"/>
-                        <p ><span class="heavyTxt">任务分组</span> <i class="el-icon-plus pull-right" style="color:#666;margin-right:10px;" @click="createGroup" v-if="projectCreatorId == user.id || projectInchargerId == user.id"></i></p>
+                        <p ><span class="heavyTxt">任务分组</span> <i class="el-icon-plus pull-right" style="color:#666;margin-right:10px;" @click="createGroup" v-if="projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement"></i></p>
                         <el-menu :default-active="defaultGroupId" ref="defaultMenu"  class="el-menu-vertical-demo" @select="groupChange" style="border-right:none;">
                             <el-menu-item :index="item.id" v-for="item in groupList" :key="item.id"  class="group_style">
                                 <div slot="title">
                                 <span >{{item.name}}</span>
                                 <!-- <el-button size="mini" @click="test(item)">test</el-button> -->
-                                <el-dropdown trigger="click" style="float:right;margin-right:-10px;" :disabled="user.id != item.inchargerId && user.id != projectCreatorId && user.id != projectInchargerId">
+                                <el-dropdown trigger="click" style="float:right;margin-right:-10px;" :disabled="user.id != item.inchargerId && user.id != projectCreatorId && user.id != projectInchargerId && !permissions.projectManagement">
                                     <i class="iconfont firerock-iconcaidan" ></i>
                                     <el-dropdown-menu slot="dropdown">
                                         <el-dropdown-item @click.native="copyGroup(item)" v-if="projectCreatorId == user.id || projectInchargerId == user.id">
@@ -253,6 +253,7 @@
             <el-tab-pane label="文件中心" name="files"><FileCenter ref="fileCenter"></FileCenter></el-tab-pane>
             <el-tab-pane label="项目概览" name="info"><ProjectInfo ref="projectInfo" @basecost-change="changeBase"></ProjectInfo></el-tab-pane>
             <el-tab-pane label="数据统计" name="summary"><Summary ref="summary"></Summary></el-tab-pane>
+            <el-tab-pane label="成本管理" name="costbaseline" v-if="permissions.projectBaseline"><CostBaseline ref="costbaseline"></CostBaseline></el-tab-pane>
             <el-tab-pane label="挣值分析" name="earning" v-if="user.id == currentProject.creator || user.id == currentProject.incharger_id ||permissions.projectBaseline"><Earning ref="earning"></Earning></el-tab-pane>
         </el-tabs>
 
@@ -840,6 +841,7 @@
     import ProjectInfo from './info.vue';
     import Summary from './summary.vue';
     import Earning from './earning.vue';
+    import CostBaseline from './CostBaseline.vue'
     // import editor from '@tinymce/tinymce-vue'
     // 富文本样式
     import 'quill/dist/quill.core.css'
@@ -860,6 +862,7 @@ import delete$ from 'dingtalk-jsapi/api/biz/cspace/delete';
             FileCenter,
             ProjectInfo,
             Summary,
+            CostBaseline,
             Earning,
             quillEditor // 富文本
         },
@@ -2573,6 +2576,7 @@ import delete$ from 'dingtalk-jsapi/api/biz/cspace/delete';
                 this.$refs.fileCenter.refreshPage();
                 this.$refs.projectInfo.refreshPage();
                 this.$refs.summary.refreshPage();
+                this.$refs.costbaseline.refreshPage();
                 this.$refs.earning.refreshPage();
             },
             //获取我的项目列表