Browse Source

阶段概览

master
chentaiyu 5 years ago
parent
commit
d10b9e4150
  1. 2
      src/views/xm/core/xmMenu/XmMenuOverview.vue
  2. 160
      src/views/xm/core/xmProjectPhase/XmProjectPhaseEdit.vue
  3. 611
      src/views/xm/core/xmProjectPhase/XmProjectPhaseOverview.vue

2
src/views/xm/core/xmMenu/XmMenuOverview.vue

@ -34,7 +34,7 @@
</el-row> </el-row>
</el-row> </el-row>
<el-row style="margin-bottom:18px"> <el-row style="margin-bottom:18px">
<el-col :span="12" @click="">
<el-col :span="8" @click="">
<div class="item"> <div class="item">
<div class="icon" style="background-color: rgb(79, 140, 255);"> <div class="icon" style="background-color: rgb(79, 140, 255);">
<i class="el-icon-right"></i> <i class="el-icon-right"></i>

160
src/views/xm/core/xmProjectPhase/XmProjectPhaseEdit.vue

@ -1,34 +1,34 @@
<template> <template>
<section class="page-container border padding"> <section class="page-container border padding">
<el-row class="page-main page-height-90"> <el-row class="page-main page-height-90">
<el-tabs> <el-tabs>
<el-tab-pane label="阶段计划详情"> <el-tab-pane label="阶段计划详情">
<!--新增界面 XmProjectPhase xm_project_phase-->
<!--新增界面 XmProjectPhase xm_project_phase-->
<el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editForm"> <el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editForm">
<el-row class="border padding"> <el-row class="border padding">
<el-form-item label="阶段名称" prop="phaseName"> <el-form-item label="阶段名称" prop="phaseName">
<el-input v-model="editForm.phaseName" placeholder="阶段名称" ></el-input> <el-input v-model="editForm.phaseName" placeholder="阶段名称" ></el-input>
</el-form-item>
<el-form-item label="序号" prop="seqNo">
<el-input v-model="editForm.seqNo" style="width:50%;" placeholder="排序序号,值越小越靠前,如1.0,2.0等"></el-input>
</el-form-item>
<el-form-item label="序号" prop="seqNo">
<el-input v-model="editForm.seqNo" style="width:50%;" placeholder="排序序号,值越小越靠前,如1.0,2.0等"></el-input>
<el-checkbox true-label="1" false-label="0" v-model="editForm.milestone">标记为里程碑</el-checkbox> <el-checkbox true-label="1" false-label="0" v-model="editForm.milestone">标记为里程碑</el-checkbox>
</el-form-item>
<el-form-item label="任务类型" prop="taskType">
</el-form-item>
<el-form-item label="任务类型" prop="taskType">
<el-select v-model="editForm.taskType"> <el-select v-model="editForm.taskType">
<el-option v-for="i in this.options.taskType" :label="i.optionName" :key="i.optionValue" :value="i.optionValue"></el-option> <el-option v-for="i in this.options.taskType" :label="i.optionName" :key="i.optionValue" :value="i.optionValue"></el-option>
</el-select> </el-select>
</el-form-item>
<el-form-item label="计划类型" prop="planType">
</el-form-item>
<el-form-item label="计划类型" prop="planType">
<el-select v-model="editForm.planType"> <el-select v-model="editForm.planType">
<el-option v-for="i in this.options.planType" :label="i.optionName" :key="i.optionValue" :value="i.optionValue"></el-option> <el-option v-for="i in this.options.planType" :label="i.optionName" :key="i.optionValue" :value="i.optionValue"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input type="textarea" rows="4" v-model="editForm.remark" placeholder="备注" ></el-input> <el-input type="textarea" rows="4" v-model="editForm.remark" placeholder="备注" ></el-input>
</el-form-item>
</el-form-item>
</el-row> </el-row>
<el-tabs v-model="activeName" class="border padding"> <el-tabs v-model="activeName" class="border padding">
<el-tab-pane label="工作量及人力成本" name="phaseBudgetWorkload"> <el-tab-pane label="工作量及人力成本" name="phaseBudgetWorkload">
@ -39,7 +39,7 @@
</el-row> </el-row>
<el-row class="padding-20 border"> <el-row class="padding-20 border">
预计时间<el-date-picker 预计时间<el-date-picker
v-model="dateRanger"
v-model="dateRanger"
type="daterange" type="daterange"
align="right" align="right"
unlink-panels unlink-panels
@ -49,35 +49,35 @@
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
:default-time="['00:00:00','23:59:59']" :default-time="['00:00:00','23:59:59']"
:picker-options="pickerOptions" :picker-options="pickerOptions"
></el-date-picker>
></el-date-picker>
预估工期<el-input style="width:100px;" type="number" v-model="editForm.phaseBudgetHours" :precision="2" :step="8" :min="0" placeholder="预计工时"></el-input>小时 预估工期<el-input style="width:100px;" type="number" v-model="editForm.phaseBudgetHours" :precision="2" :step="8" :min="0" placeholder="预计工时"></el-input>小时
<div class="tips"><font>工时{{autoParams.phaseBudgetHours}}小时,工作日{{autoParams.weekday}}</font></div> <div class="tips"><font>工时{{autoParams.phaseBudgetHours}}小时,工作日{{autoParams.weekday}}</font></div>
</el-row>
</el-row>
<el-row class="padding-20 border"> <el-row class="padding-20 border">
<el-col :span="4">人员类型</el-col> <el-col :span="4">人员类型</el-col>
<el-col :span="4">人数</el-col> <el-col :span="4">人数</el-col>
<el-col :span="4">工作量(人时)</el-col> <el-col :span="4">工作量(人时)</el-col>
<el-col :span="4">单价(/人时)</el-col> <el-col :span="4">单价(/人时)</el-col>
<el-col :span="8">总价()</el-col> <el-col :span="8">总价()</el-col>
</el-row>
</el-row>
<el-row class="padding-20 border"> <el-row class="padding-20 border">
<el-col :span="4">内购</el-col> <el-col :span="4">内购</el-col>
<el-col :span="4"><el-input style="width:100px;" type="number" v-model="editForm.phaseBudgetInnerUserCnt" :precision="0" :step="1" :min="0" placeholder="内购人数"></el-input>
<el-col :span="4"><el-input style="width:100px;" type="number" v-model="editForm.phaseBudgetInnerUserCnt" :precision="0" :step="1" :min="0" placeholder="内购人数"></el-input>
</el-col> </el-col>
<el-col :span="4">{{autoParams.phaseBudgetInnerUserWorkload}}人时</el-col> <el-col :span="4">{{autoParams.phaseBudgetInnerUserWorkload}}人时</el-col>
<el-col :span="4"><el-input style="width:100px;" type="number" v-model="editForm.phaseBudgetInnerUserPrice" :precision="0" :step="1" :min="0" placeholder="预计内部人时单价"></el-input> </el-col> <el-col :span="4"><el-input style="width:100px;" type="number" v-model="editForm.phaseBudgetInnerUserPrice" :precision="0" :step="1" :min="0" placeholder="预计内部人时单价"></el-input> </el-col>
<el-col :span="8">{{this.toFixed(autoParams.phaseBudgetInnerUserAt)}},{{this.toFixed(autoParams.phaseBudgetInnerUserAt/10000)}} 万元</el-col> <el-col :span="8">{{this.toFixed(autoParams.phaseBudgetInnerUserAt)}},{{this.toFixed(autoParams.phaseBudgetInnerUserAt/10000)}} 万元</el-col>
</el-row>
</el-row>
<el-row class="padding-20 border"> <el-row class="padding-20 border">
<el-col :span="4">外购</el-col> <el-col :span="4">外购</el-col>
<el-col :span="4"><el-input style="width:100px;" type="number" v-model="editForm.phaseBudgetOutUserCnt" :precision="0" :step="1" :min="0" placeholder="外购人数"></el-input>
<el-col :span="4"><el-input style="width:100px;" type="number" v-model="editForm.phaseBudgetOutUserCnt" :precision="0" :step="1" :min="0" placeholder="外购人数"></el-input>
</el-col> </el-col>
<el-col :span="4">{{autoParams.phaseBudgetOutUserWorkload}}人时</el-col> <el-col :span="4">{{autoParams.phaseBudgetOutUserWorkload}}人时</el-col>
<el-col :span="4"><el-input style="width:100px;" type="number" v-model="editForm.phaseBudgetOutUserPrice" :precision="0" :step="1" :min="0" placeholder="预计外购人时单价"></el-input> </el-col> <el-col :span="4"><el-input style="width:100px;" type="number" v-model="editForm.phaseBudgetOutUserPrice" :precision="0" :step="1" :min="0" placeholder="预计外购人时单价"></el-input> </el-col>
<el-col :span="4">{{autoParams.phaseBudgetOutUserAt }} {{autoParams.phaseBudgetOutUserAt/10000 }}万元</el-col> <el-col :span="4">{{autoParams.phaseBudgetOutUserAt }} {{autoParams.phaseBudgetOutUserAt/10000 }}万元</el-col>
</el-row >
</el-row >
<el-row class="padding-20 border"> <el-row class="padding-20 border">
<el-col :span="4">合计</el-col> <el-col :span="4">合计</el-col>
<el-col :span="4"> {{autoParams.phaseBudgetOutUserCnt+autoParams.phaseBudgetInnerUserCnt}} <el-col :span="4"> {{autoParams.phaseBudgetOutUserCnt+autoParams.phaseBudgetInnerUserCnt}}
@ -85,52 +85,52 @@
<el-col :span="4">{{autoParams.phaseBudgetOutUserWorkload+autoParams.phaseBudgetInnerUserWorkload }}人时,{{ (autoParams.phaseBudgetOutUserWorkload+autoParams.phaseBudgetInnerUserWorkload)/8/20 }}人月 </el-col> <el-col :span="4">{{autoParams.phaseBudgetOutUserWorkload+autoParams.phaseBudgetInnerUserWorkload }}人时,{{ (autoParams.phaseBudgetOutUserWorkload+autoParams.phaseBudgetInnerUserWorkload)/8/20 }}人月 </el-col>
<el-col :span="4">{{ (parseFloat2(autoParams.phaseBudgetOutUserPrice) + parseFloat2(autoParams.phaseBudgetInnerUserPrice))/2}}/人时</el-col> <el-col :span="4">{{ (parseFloat2(autoParams.phaseBudgetOutUserPrice) + parseFloat2(autoParams.phaseBudgetInnerUserPrice))/2}}/人时</el-col>
<el-col :span="8">{{autoParams.phaseBudgetTotalCost}} {{(autoParams.phaseBudgetTotalCost)/10000}} 万元</el-col> <el-col :span="8">{{autoParams.phaseBudgetTotalCost}} {{(autoParams.phaseBudgetTotalCost)/10000}} 万元</el-col>
</el-row>
</el-row>
<el-row class="padding-20 border"> <el-row class="padding-20 border">
总计 {{parseFloat2(editForm.phaseBudgetInnerUserAt)+parseFloat2(editForm.phaseBudgetOutUserAt)+parseFloat2(editForm.phaseBudgetNouserAt)}} <el-tag>{{this.toFixed(autoParams.phaseBudgetTotalCost/10000)}}万元</el-tag> 总计 {{parseFloat2(editForm.phaseBudgetInnerUserAt)+parseFloat2(editForm.phaseBudgetOutUserAt)+parseFloat2(editForm.phaseBudgetNouserAt)}} <el-tag>{{this.toFixed(autoParams.phaseBudgetTotalCost/10000)}}万元</el-tag>
</el-row> </el-row>
</el-row> </el-row>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane v-if="activeName=='phaseBudgetWorkload'" label="收起" name=""> <el-tab-pane v-if="activeName=='phaseBudgetWorkload'" label="收起" name="">
</el-tab-pane> </el-tab-pane>
</el-tabs>
</el-tabs>
</el-form> </el-form>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="阶段计划概览">
<el-tab-pane label="阶段计划概览" lazy>
<xm-project-phase-overview :xm-project-phase="xmProjectPhase"></xm-project-phase-overview> <xm-project-phase-overview :xm-project-phase="xmProjectPhase"></xm-project-phase-overview>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</el-row> </el-row>
<el-row class="page-bottom"> <el-row class="page-bottom">
<el-button @click.native="handleCancel">取消</el-button>
<el-button v-loading="load.edit" type="primary" @click.native="editSubmit" :disabled="load.edit==true">提交</el-button>
<el-button @click.native="handleCancel">取消</el-button>
<el-button v-loading="load.edit" type="primary" @click.native="editSubmit" :disabled="load.edit==true">提交</el-button>
</el-row> </el-row>
</section> </section>
</template> </template>
<script> <script>
import util from '@/common/js/util';// import util from '@/common/js/util';//
import { listOption } from '@/api/mdp/meta/itemOption';//
import { listOption } from '@/api/mdp/meta/itemOption';//
import { editXmProjectPhase } from '@/api/xm/core/xmProjectPhase'; import { editXmProjectPhase } from '@/api/xm/core/xmProjectPhase';
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import XmProjectPhaseOverview from './XmProjectPhaseOverview';// import XmProjectPhaseOverview from './XmProjectPhaseOverview';//
export default {
export default {
computed: { computed: {
...mapGetters([ ...mapGetters([
'userInfo','roles' 'userInfo','roles'
]), ]),
autoParams:function(){ autoParams:function(){
var phaseBudgetOutUserPrice=this.toFixed(this.editForm.phaseBudgetOutUserPrice) var phaseBudgetOutUserPrice=this.toFixed(this.editForm.phaseBudgetOutUserPrice)
var phaseBudgetInnerUserPrice=this.toFixed(this.editForm.phaseBudgetInnerUserPrice) var phaseBudgetInnerUserPrice=this.toFixed(this.editForm.phaseBudgetInnerUserPrice)
var phaseBudgetOutUserCnt=this.toFixed(this.editForm.phaseBudgetOutUserCnt) var phaseBudgetOutUserCnt=this.toFixed(this.editForm.phaseBudgetOutUserCnt)
var phaseBudgetInnerUserCnt=this.toFixed(this.editForm.phaseBudgetInnerUserCnt) var phaseBudgetInnerUserCnt=this.toFixed(this.editForm.phaseBudgetInnerUserCnt)
var phaseBudgetHours=this.toFixed(this.editForm.phaseBudgetHours ) var phaseBudgetHours=this.toFixed(this.editForm.phaseBudgetHours )
var phaseBudgetNouserAt=this.toFixed(this.editForm.phaseBudgetNouserAt )
var phaseBudgetNouserAt=this.toFixed(this.editForm.phaseBudgetNouserAt )
if(phaseBudgetOutUserPrice==null || phaseBudgetOutUserPrice==''){ if(phaseBudgetOutUserPrice==null || phaseBudgetOutUserPrice==''){
phaseBudgetOutUserPrice=100 phaseBudgetOutUserPrice=100
} }
@ -143,29 +143,29 @@
if(phaseBudgetInnerUserCnt==null || phaseBudgetInnerUserCnt==''){ if(phaseBudgetInnerUserCnt==null || phaseBudgetInnerUserCnt==''){
phaseBudgetInnerUserCnt=0.0 phaseBudgetInnerUserCnt=0.0
} }
if(phaseBudgetNouserAt==null || phaseBudgetNouserAt==''){ if(phaseBudgetNouserAt==null || phaseBudgetNouserAt==''){
phaseBudgetNouserAt=0.0 phaseBudgetNouserAt=0.0
}
}
if(phaseBudgetHours==null || phaseBudgetHours==''){ if(phaseBudgetHours==null || phaseBudgetHours==''){
phaseBudgetHours=0.0 phaseBudgetHours=0.0
}
var autoParams={
}
var autoParams={
}
}
var weekday=1; var weekday=1;
if(this.dateRanger!=null && this.dateRanger.length>=2 ){ if(this.dateRanger!=null && this.dateRanger.length>=2 ){
weekday=this.getWeekday(new Date(this.dateRanger[0]),new Date(this.dateRanger[1]));
phaseBudgetHours=weekday * 8
}
weekday=this.getWeekday(new Date(this.dateRanger[0]),new Date(this.dateRanger[1]));
phaseBudgetHours=weekday * 8
}
autoParams.weekday=weekday autoParams.weekday=weekday
autoParams.phaseBudgetHours=phaseBudgetHours autoParams.phaseBudgetHours=phaseBudgetHours
autoParams.phaseBudgetOutUserPrice=phaseBudgetOutUserPrice autoParams.phaseBudgetOutUserPrice=phaseBudgetOutUserPrice
autoParams.phaseBudgetInnerUserPrice=phaseBudgetInnerUserPrice autoParams.phaseBudgetInnerUserPrice=phaseBudgetInnerUserPrice
autoParams.phaseBudgetOutUserCnt=phaseBudgetOutUserCnt autoParams.phaseBudgetOutUserCnt=phaseBudgetOutUserCnt
autoParams.phaseBudgetInnerUserCnt=phaseBudgetInnerUserCnt
autoParams.phaseBudgetInnerUserCnt=phaseBudgetInnerUserCnt
autoParams.phaseBudgetInnerUserWorkload= phaseBudgetInnerUserCnt*phaseBudgetHours autoParams.phaseBudgetInnerUserWorkload= phaseBudgetInnerUserCnt*phaseBudgetHours
autoParams.phaseBudgetOutUserWorkload= phaseBudgetOutUserCnt*phaseBudgetHours autoParams.phaseBudgetOutUserWorkload= phaseBudgetOutUserCnt*phaseBudgetHours
autoParams.phaseBudgetWorkload= phaseBudgetInnerUserCnt*phaseBudgetHours + phaseBudgetOutUserCnt*phaseBudgetHours autoParams.phaseBudgetWorkload= phaseBudgetInnerUserCnt*phaseBudgetHours + phaseBudgetOutUserCnt*phaseBudgetHours
@ -179,10 +179,10 @@
props:['xmProjectPhase','visible','parentProjectPhase'], props:['xmProjectPhase','visible','parentProjectPhase'],
watch: { watch: {
'xmProjectPhase':function( xmProjectPhase ) { 'xmProjectPhase':function( xmProjectPhase ) {
this.editForm = xmProjectPhase;
this.editForm = xmProjectPhase;
this.dateRanger=[this.editForm.beginDate,this.editForm.endDate] this.dateRanger=[this.editForm.beginDate,this.editForm.endDate]
}, },
'visible':function(visible) {
'visible':function(visible) {
if(visible==true){ if(visible==true){
// //
} }
@ -197,12 +197,12 @@
const endDate = new Date(); const endDate = new Date();
endDate.setTime(beginDate.getTime() + 3600 * 1000 * 24 * 7 * 4); endDate.setTime(beginDate.getTime() + 3600 * 1000 * 24 * 7 * 4);
return { return {
options:{},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
options:{},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
load:{ list: false, add: false, del: false, edit: false },//... load:{ list: false, add: false, del: false, edit: false },//...
editFormRules: { editFormRules: {
id: [ id: [
//{ required: true, message: '', trigger: 'blur' } //{ required: true, message: '', trigger: 'blur' }
],
],
phaseName: [ phaseName: [
{ required: true, message: '阶段名称不能为空', trigger: 'blur' } { required: true, message: '阶段名称不能为空', trigger: 'blur' }
], ],
@ -220,9 +220,9 @@
// xm_project_phase // xm_project_phase
editForm: { editForm: {
id:'',phaseName:'',remark:'',parentPhaseId:'',branchId:'',taskType:'kf',planType:'m1',projectId:'',beginDate:'',endDate:'',phaseBudgetHours:'',phaseBudgetStaffNu:'',ctime:'',phaseBudgetNouserAt:'',phaseBudgetInnerUserAt:'',phaseBudgetOutUserAt:'',projectBaselineId:'',bizProcInstId:'',bizFlowState:'',phaseBudgetWorkload:'',totalActWorkload:'',totalActNouserAt:'',totalActInerUserAt:'',totalActOutUserAt:'',planType:'',taskType:'',seqNo:'1',phaseBudgetInnerUserCnt:'',phaseBudgetOutUserCnt:'',phaseBudgetInnerUserPrice:80,phaseBudgetOutUserPrice:100,phaseBudgetInnerUserWorkload:0,phaseBudgetOutUserWorkload:0 id:'',phaseName:'',remark:'',parentPhaseId:'',branchId:'',taskType:'kf',planType:'m1',projectId:'',beginDate:'',endDate:'',phaseBudgetHours:'',phaseBudgetStaffNu:'',ctime:'',phaseBudgetNouserAt:'',phaseBudgetInnerUserAt:'',phaseBudgetOutUserAt:'',projectBaselineId:'',bizProcInstId:'',bizFlowState:'',phaseBudgetWorkload:'',totalActWorkload:'',totalActNouserAt:'',totalActInerUserAt:'',totalActOutUserAt:'',planType:'',taskType:'',seqNo:'1',phaseBudgetInnerUserCnt:'',phaseBudgetOutUserCnt:'',phaseBudgetInnerUserPrice:80,phaseBudgetOutUserPrice:100,phaseBudgetInnerUserWorkload:0,phaseBudgetOutUserWorkload:0
},
dateRanger: [
],
},
dateRanger: [
],
/**begin 在下面加自定义属性,记得补上面的一个逗号**/ /**begin 在下面加自定义属性,记得补上面的一个逗号**/
pickerOptions: util.pickerOptions('datarange'), pickerOptions: util.pickerOptions('datarange'),
activeName:'', activeName:'',
@ -238,11 +238,11 @@
}, },
//XmProjectPhase xm_project_phase @submit="aftereditSubmit" //XmProjectPhase xm_project_phase @submit="aftereditSubmit"
editSubmit: function () { editSubmit: function () {
if ( if (
this.dateRanger != null && this.dateRanger != null &&
this.dateRanger.length == 2 this.dateRanger.length == 2
) {
) {
if(this.dateRanger[0]){ if(this.dateRanger[0]){
if(this.dateRanger[0].length<=10){ if(this.dateRanger[0].length<=10){
this.editForm.beginDate = this.dateRanger[0] + " 00:00:00"; this.editForm.beginDate = this.dateRanger[0] + " 00:00:00";
@ -257,43 +257,43 @@
this.editForm.endDate = this.dateRanger[1] this.editForm.endDate = this.dateRanger[1]
} }
} }
}else{ }else{
this.$message({showClose: true, message: "请输入开始日期和结束日期", type: 'error' });
this.$message({showClose: true, message: "请输入开始日期和结束日期", type: 'error' });
return; return;
} }
if(!this.editForm.phaseBudgetInnerUserCnt){ if(!this.editForm.phaseBudgetInnerUserCnt){
this.$message({showClose: true, message: "内购人员数不能为空", type: 'error' });
this.$message({showClose: true, message: "内购人员数不能为空", type: 'error' });
return; return;
} }
if(!this.editForm.phaseBudgetHours){ if(!this.editForm.phaseBudgetHours){
this.$message({showClose: true, message: "工期不能为空", type: 'error' });
this.$message({showClose: true, message: "工期不能为空", type: 'error' });
return; return;
} }
if(!this.editForm.phaseBudgetInnerUserPrice){ if(!this.editForm.phaseBudgetInnerUserPrice){
this.$message({showClose: true, message: "内购单价不能为空", type: 'error' });
this.$message({showClose: true, message: "内购单价不能为空", type: 'error' });
return; return;
} }
this.$refs.editForm.validate((valid) => { this.$refs.editForm.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.edit=true this.load.edit=true
let params = Object.assign({}, this.editForm);
let params = Object.assign({}, this.editForm);
if(!params.phaseBudgetInnerUserAt){ if(!params.phaseBudgetInnerUserAt){
params.phaseBudgetInnerUserAt= this.parseFloat2(params.phaseBudgetInnerUserCnt) * this.parseFloat2(params.phaseBudgetInnerUserPrice) * this.parseFloat2(params.phaseBudgetHours) params.phaseBudgetInnerUserAt= this.parseFloat2(params.phaseBudgetInnerUserCnt) * this.parseFloat2(params.phaseBudgetInnerUserPrice) * this.parseFloat2(params.phaseBudgetHours)
} }
if( !params.phaseBudgetOutUserAt ){ if( !params.phaseBudgetOutUserAt ){
params.phaseBudgetOutUserAt= this.parseFloat2(params.phaseBudgetOutUserCnt) * this.parseFloat2(params.phaseBudgetOutUserPrice) * this.parseFloat2(params.phaseBudgetHours) params.phaseBudgetOutUserAt= this.parseFloat2(params.phaseBudgetOutUserCnt) * this.parseFloat2(params.phaseBudgetOutUserPrice) * this.parseFloat2(params.phaseBudgetHours)
}
params.phaseBudgetInnerUserWorkload= this.parseFloat2(params.phaseBudgetInnerUserCnt) * this.parseFloat2(params.phaseBudgetHours)
params.phaseBudgetOutUserWorkload= this.parseFloat2(params.phaseBudgetOutUserCnt) * this.parseFloat2(params.phaseBudgetHours)
params.phaseBudgetWorkload= this.parseFloat2(params.phaseBudgetInnerUserWorkload) + this.parseFloat2(params.phaseBudgetOutUserWorkload)
}
params.phaseBudgetInnerUserWorkload= this.parseFloat2(params.phaseBudgetInnerUserCnt) * this.parseFloat2(params.phaseBudgetHours)
params.phaseBudgetOutUserWorkload= this.parseFloat2(params.phaseBudgetOutUserCnt) * this.parseFloat2(params.phaseBudgetHours)
params.phaseBudgetWorkload= this.parseFloat2(params.phaseBudgetInnerUserWorkload) + this.parseFloat2(params.phaseBudgetOutUserWorkload)
if( !params.phaseBudgetStaffNu ){ if( !params.phaseBudgetStaffNu ){
params.phaseBudgetStaffNu= this.parseFloat2(params.phaseBudgetOutUserCnt) + this.parseFloat2(params.phaseBudgetInnerUserCnt) params.phaseBudgetStaffNu= this.parseFloat2(params.phaseBudgetOutUserCnt) + this.parseFloat2(params.phaseBudgetInnerUserCnt)
}
}
editXmProjectPhase(params).then((res) => { editXmProjectPhase(params).then((res) => {
this.load.edit=false this.load.edit=false
var tips=res.data.tips; var tips=res.data.tips;
@ -301,12 +301,12 @@
//this.$refs['editForm'].resetFields(); //this.$refs['editForm'].resetFields();
this.$emit('submit');// @submit="aftereditSubmit" this.$emit('submit');// @submit="aftereditSubmit"
} }
this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.edit=false); }).catch( err => this.load.edit=false);
}); });
} }
}); });
},
},
getWeekday(first, last) { getWeekday(first, last) {
//getDay() //getDay()
@ -322,7 +322,7 @@
} }
} }
return count; return count;
},
},
toFixed(floatValue,num){ toFixed(floatValue,num){
if(floatValue ==null || floatValue=='' || floatValue == undefined){ if(floatValue ==null || floatValue=='' || floatValue == undefined){
return 0; return 0;
@ -346,7 +346,7 @@
fillphaseBudgetHoursToField:function(){ fillphaseBudgetHoursToField:function(){
this.editForm.phaseBudgetHours=this.toFixed(this.autoParams.phaseBudgetHours) this.editForm.phaseBudgetHours=this.toFixed(this.autoParams.phaseBudgetHours)
}, },
fillphaseBudgetCostAtToField:function(){ fillphaseBudgetCostAtToField:function(){
this.editForm.phaseBudgetNouserAt=this.toFixed(this.autoParams.phaseBudgetNouserAt) this.editForm.phaseBudgetNouserAt=this.toFixed(this.autoParams.phaseBudgetNouserAt)
this.editForm.phaseBudgetOutUserAt=this.toFixed(this.autoParams.phaseBudgetOutUserAt ) this.editForm.phaseBudgetOutUserAt=this.toFixed(this.autoParams.phaseBudgetOutUserAt )
@ -355,14 +355,14 @@
}, },
/**end 在上面加自定义方法**/ /**end 在上面加自定义方法**/
},//end method },//end method
components: {
components: {
XmProjectPhaseOverview, XmProjectPhaseOverview,
// 'xm-project-phase-edit':XmProjectPhaseEdit // 'xm-project-phase-edit':XmProjectPhaseEdit
}, },
mounted() { mounted() {
this.editForm=Object.assign(this.editForm, this.xmProjectPhase);
this.editForm=Object.assign(this.editForm, this.xmProjectPhase);
/**在下面写其它函数***/ /**在下面写其它函数***/
this.dateRanger=[this.editForm.beginDate,this.editForm.endDate] this.dateRanger=[this.editForm.beginDate,this.editForm.endDate]
listOption([{categoryId:'all',itemCode:'planType'},{categoryId:'all',itemCode:'taskType'}]).then(res=>{ listOption([{categoryId:'all',itemCode:'planType'},{categoryId:'all',itemCode:'taskType'}]).then(res=>{
@ -373,11 +373,11 @@
</script> </script>
<style scoped>
<style scoped>
.padding-20{ .padding-20{
padding-left: 10px; padding-left: 10px;
padding-right: 10px; padding-right: 10px;
padding-top: 20px; padding-top: 20px;
padding-bottom: 20px; padding-bottom: 20px;
} }
</style>
</style>

611
src/views/xm/core/xmProjectPhase/XmProjectPhaseOverview.vue

@ -1,51 +1,576 @@
<template> <template>
<section>
</section>
<section>
<el-row class="page-main page-height-75" style="overflow-x: hidden;">
<el-row style="margin-bottom:10px">
<el-card class="box-card" style="padding:0px ;height:100px">
<div>
<el-row style="padding:10px">
<el-steps :active="this.xmProjectPhase.phaseStatus" finish-status="success" align-center>
<el-step title="初始"></el-step>
<el-step title="执行中"></el-step>
<el-step title="完工"></el-step>
<el-step title="关闭"></el-step>
<el-step title="删除中"></el-step>
<el-step title="已删除"></el-step>
<el-step title="暂停"></el-step>
</el-steps>
</el-row>
</div>
</el-card>
</el-row>
<el-row :gutter="10" style="margin-bottom:10px">
<el-col :span="12" >
<el-card class="box-card" style="padding:0px ;height:425px">
<div slot="header" class="clearfix">
<span>阶段信息</span>
</div>
<el-row style="margin-bottom:18px">
<el-row>
<span v-text="this.xmProjectPhase.mngUsername"></span>
</el-row>
<el-row>
<span>阶段管理员</span>
</el-row>
</el-row>
<el-row style="margin-bottom:18px">
<el-col :span="8" @click="">
<div class="item">
<div class="icon" style="background-color: rgb(79, 140, 255);">
<i class="el-icon-right"></i>
</div>
<div class="info">
<div v-text="this.xmProjectPhase.taskCnt"></div>
<div class="title">总任务量</div>
</div>
</div>
</el-col>
<el-col :span="8">
<div class="item">
<div class="icon" style="background-color: rgb(255, 153, 51);">
<i class="el-icon-loading"></i>
</div>
<div class="info">
<div v-text="notStart">
</div>
<div class="title">待完成</div>
</div>
</div>
</el-col>
<el-col :span="8">
<div class="item">
<div class="icon" style="background-color: rgb(0, 153, 51);">
<i class="el-icon-check"></i>
</div>
<div class="info">
<div v-text="this.xmProjectPhase.finishTaskCnt" >
</div>
<div class="title">已完成</div>
</div>
</div>
</el-col>
</el-row>
<el-row style="margin-bottom:18px">
<div class="item">
<div class="icon2" style="background-color: rgb(204, 204, 204);">
<i class="el-icon-date"></i>
</div>
<div class="info">
<div v-text="phaseBeginDate+'~'+phaseEndDate">
</div>
<div class="title">阶段计划周期</div>
</div>
</div>
</el-row>
<el-row style="margin-bottom:18px">
<div class="item">
<div class="icon2" style="background-color: rgb(204, 204, 204);">
<i class="el-icon-star-off"></i>
</div>
<div class="info">
<div class="title"> 创建时间 {{this.phaseCreateDate}}</div>
</div>
</div>
</el-row>
<el-row style="margin-bottom:18px">
<div class="item">
<div class="icon2" style="background-color: rgb(204, 204, 204);">
<i class="el-icon-refresh"></i>
</div>
<div class="info">
<div class="title"> 关联迭代数 {{(this.xmProjectPhase.iterationCnt)}} </div>
</div>
</div>
</el-row>
<el-row style="margin-bottom:18px">
<div class="item">
<div class="icon2" style="background-color: rgb(204, 204, 204);">
<i class="el-icon-alarm-clock"></i>
</div>
<div>
<div class="progress-item">
<el-progress :percentage="taskProgress"></el-progress>
<div class="title">任务进度</div>
</div>
</div>
</div>
</el-row>
</el-card>
</el-col>
<el-col :span="12" >
<el-card class="box-card" style="padding:0px ;height:425px">
<div slot="header" class="clearfix">
<span>阶段工时</span>
</div>
<div>
<el-row style="padding:25px;">
<div class="item">
<el-col :span="8">
<div>
<div style="text-align:center;">
<span style="font-size:24px;" v-text="this.xmProjectPhase.phaseBudgetWorkload"></span>
<span style="font-size:5px;">h</span>
</div>
<div style="text-align:center;font-size:5px;">预估工时</div>
</div>
</el-col>
<el-col :span="8">
<div>
<div style="text-align:center;">
<span style="font-size:24px;" v-text="this.xmProjectPhase.phaseActWorkload"></span>
<span style="font-size:5px;">h</span>
</div>
<div style="text-align:center;font-size:5px;">登记工时</div>
</div>
</el-col>
<el-col :span="8">
<div>
<div style="text-align:center;">
<span style="font-size:24px;" v-text="workloadProgress"></span>
<span style="font-size:5px;">%</span>
</div>
<div style="text-align:center;font-size:5px;">工时进度</div>
</div>
</el-col>
</div>
</el-row>
<el-row style="padding:25px;">
<div class="item">
<el-col :span="8">
<div>
<div style="text-align:center;">
<span style="font-size:24px;" v-text="remainWorkload"></span>
<span style="font-size:5px;">h</span>
</div>
<div style="text-align:center;font-size:5px;">剩余工时</div>
</div>
</el-col>
<el-col :span="8">
<div>
<div style="text-align:center;">
<span style="font-size:24px;" v-text="deviation"></span>
<span style="font-size:5px;">h</span>
</div>
<div style="text-align:center;font-size:5px;">预估偏差</div>
</div>
</el-col>
<el-col :span="8">
<div>
<div style="text-align:center;">
<span style="font-size:24px;" v-text="deviationRate"></span>
<span style="font-size:5px;">%</span>
</div>
<div style="text-align:center;font-size:5px;">预估偏差率</div>
</div>
</el-col>
</div>
</el-row>
<el-row>
<span style="margin-left:20px;">项目预计进度</span>
<el-progress style="width: 90%;margin-left:20px;margin-top: 10px;margin-bottom: 20px;" :text-inside="true" :stroke-width="24" :percentage="planProgress"></el-progress>
</el-row>
<el-row>
<span style="margin-left:20px;">项目实际进度</span>
<el-progress style="width: 90%;margin-left:20px;margin-top: 10px;" :text-inside="true" :stroke-width="24" :percentage="realProgress"></el-progress>
</el-row>
</div>
</el-card>
</el-col>
</el-row>
<el-row :gutter="10" style="margin-bottom:10px">
<el-col :span="12" >
<el-card class="box-card" style="height:425px">
<div slot="header" class="clearfix">
<span>总预算情况</span>
</div>
<div style="'100%'">
<div id="costPieChart" :style="{width: '100%', height: '300px'}"></div>
</div>
</el-card>
</el-col>
<el-col :span="12" >
<el-card class="box-card" style="height:425px">
<div slot="header" class="clearfix">
<span>工作量分布</span>
</div>
<div>
<div id="workloadPie" :style="{width: '100%', height: '300px'}"></div>
</div>
</el-card>
</el-col>
</el-row>
</el-row>
</section>
</template> </template>
<script> <script>
import util from '@/common/js/util';//
//import { listOption } from '@/api/mdp/meta/itemOption';//
import { mapGetters } from 'vuex'
export default {
computed: {
...mapGetters([
'userInfo','roles'
])
},
props:['xmProjectPhase'],
watch: {
},
data() {
return {
options:{},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
load:{ list: false, edit: false, del: false, add: false },//...
/**begin 在下面加自定义属性,记得补上面的一个逗号**/
/**end 在上面加自定义属性**/
}//end return
},//end data
methods: {
},//end method
components: {
},
mounted() {
}//end mounted
}
import util from '@/common/js/util';//
//import { listOption } from '@/api/mdp/meta/itemOption';//
import { mapGetters } from 'vuex'
export default {
computed: {
...mapGetters(['userInfo','roles']),
notStart: function() {
return this.xmProjectPhase.taskCnt-this.xmProjectPhase.finishTaskCnt;
},
taskProgress: function (){
if(this.xmProjectPhase.taskCnt){
return Math.round(this.xmProjectPhase.finishTaskCnt/this.xmProjectPhase.taskCnt*100);
}else{
return 0;
};
},
phaseBeginDate: function (){
if(this.xmProjectPhase.beginDate){
return this.xmProjectPhase.beginDate.substring(0,10);
} else{
return '暂无';
}
},
phaseEndDate: function (){
if(this.xmProjectPhase.endDate){
return this.xmProjectPhase.endDate.substring(0,10);
} else{
return '暂无';
}
},
phaseCreateDate: function (){
if(this.xmProjectPhase.ctime){
return this.xmProjectPhase.ctime.substring(0,10);
} else{
return '暂无';
}
},
workloadProgress:function (){
return Math.round(this.xmProjectPhase.phaseActWorkload/this.xmProjectPhase.phaseBudgetWorkload*100);
},
deviation:function (){
let now = new Date();
let startTime = new Date(this.xmProjectPhase.beginDate);
let endTime = new Date(this.xmProjectPhase.endDate);
if(now<=endTime){
let allDays=endTime-startTime;
return this.xmProjectPhase.phaseBudgetWorkload - Math.round((now-startTime)/allDays*this.xmProjectPhase.phaseBudgetWorkload)
}else{
return this.xmProjectPhase.phaseActWorkload - this.xmProjectPhase.phaseBudgetWorkload;
}
},
deviationRate:function (){
return Math.round(this.deviation/this.xmProjectPhase.phaseBudgetWorkload*100);
},
remainWorkload:function (){
return this.xmProjectPhase.phaseBudgetWorkload - this.xmProjectPhase.phaseActWorkload;
},
planProgress:function (){
let now = new Date();
let startTime = new Date(this.xmProjectPhase.beginDate);
let endTime = new Date(this.xmProjectPhase.endDate);
if(now<=endTime){
let allDays=endTime-startTime;
return Math.round((now-startTime)/allDays*100)
}else{
return 100;
}
},
realProgress:function (){
if(this.xmProjectPhase.phaseActWorkload < this.xmProjectPhase.phaseBudgetWorkload){
return Math.round(this.xmProjectPhase.phaseActWorkload/this.xmProjectPhase.phaseBudgetWorkload*100)
}else{
return 100;
}
},
xmProjectPhaseCpd(){
return this.xmProjectPhase
},
},
props:['xmProjectPhase'],
watch:{
xmProjectPhaseCpd:function(){
this.drawCostPie();
this.drawWorkloadPie();
}
},
data() {
return {
};
},
methods:{
drawCostPie() {
let costPieChart = this.$echarts.init(document.getElementById("costPieChart"));
let option = {
tooltip: {
trigger: 'item',
formatter: '{b} : {c} ({d}%)'
},
legend: {
orient: 'vertical',
left: 'left',
},
series: [
{
center:['55%','40%'],//
type: 'pie',
radius: '50%',//
label:{ //
normal:{
show:true,
position:'outer', //:
textStyle : {
fontWeight : 100 ,
fontSize: document.body.clientWidth / 120, //
color: "#000000"
},
formatter:'{b}\n{c}({d}%)',//bname,c:value,d:
alignTo:'edge',
margin:10
}
},
data: [
{value: this.xmProjectPhase.phaseBudgetNouserAt,
itemStyle: {
normal:{
color: '#5470C6'
}
},
name: '非人力'},
{value: this.xmProjectPhase.phaseBudgetInnerUserAt,
itemStyle: {
normal:{
color: '#73C0DE'
}
},
name: '内部人力'},
{value: this.xmProjectPhase.phaseBudgetOutUserAt,
itemStyle: {
normal:{
color: '#99CCFF'
}
},
name: '外购人力'},
],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
};
//
costPieChart.setOption(option);
},
drawWorkloadPie() {
let workloadPie = this.$echarts.init(document.getElementById("workloadPie"));
let option = {
tooltip: {
trigger: 'item',
formatter: '{b} : {c} ({d}%)'
},
legend: {
orient: 'vertical',
left: 'left',
},
series: [
{
center:['55%','40%'],//
type: 'pie',
radius: '50%',//
label:{ //
normal:{
show:true,
position:'outer', //:
textStyle : {
fontWeight : 100 ,
fontSize: document.body.clientWidth / 120, //
color: "#000000"
},
formatter:'{b}\n{c}({d}%)',//bname,c:value,d:
alignTo:'edge',
margin:10
}
},
data: [
{value: this.xmProjectPhase.phaseBudgetInnerUserWorkload,
itemStyle: {
normal:{
color: '#5470C6'
}
},
name: '内部人力'},
{value: this.xmProjectPhase.phaseBudgetOutUserWorkload,
itemStyle: {
normal:{
color: '#73C0DE'
}
},
name: '外购人力'},
],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
};
//
workloadPie.setOption(option);
},
},
mounted() {
this.$nextTick(() => {
});
this.drawCostPie();
this.drawWorkloadPie();
},
};
</script> </script>
<style scoped>
<style scoped lang="scss">
.container {
margin: 10px;
}
.header {
display: flex;
justify-content: flex-start;
padding: 10px;
span {
padding-right: 15px;
}
}
.col {
margin-bottom: 20px;
}
.icon {
color: #fff;
height: 30px;
width: 30px;
border-radius: 15px;
text-align: center;
line-height: 30px;
font-size: 20px;
display: inline-block;
margin-right: 5px;
}
.icon2 {
color: #000000;
height: 30px;
width: 30px;
border-radius: 15px;
text-align: center;
line-height: 30px;
font-size: 20px;
display: inline-block;
margin-right: 5px;
margin-left: 5px;
}
.item {
display: flex;
justify-content: flex-start;
position: relative;
.progress-item{
position:absolute; width:80%;
}
}
.card-font {
color: #000000;
font-size: 12px;
.el-col {
margin-bottom: 20px;
}
}
.calendar-header {
display: flex;
justify-content: space-between;
.cal-header-boxs {
flex: 1;
display: flex;
justify-content: flex-end;
.cal-header-box {
padding: 5px;
height: 45px;
margin-left: 10px;
}
.box-icon {
text-align: center;
}
.box-info {
text-align: center;
font-size: 12px;
color: #000000;
}
}
}
.el-tag:hover {
cursor: pointer;
}
.value {
cursor: pointer;
}
.reference {
margin-top: 10px;
font-size: 12px;
}
.click {
background: #e9f7ff;
}
.calendar-box {
display: flex;
justify-content: flex-start;
}
</style>
</style>
<style>
.app-container{
padding: 20px;
padding-bottom: 0;
}
</style>
Loading…
Cancel
Save