|
@@ -20,6 +20,7 @@
|
|
|
<el-menu-item index="1-2"><p @click="ssl(1)">项目任务报表</p></el-menu-item>
|
|
|
<el-menu-item index="1-3"><p @click="ssl(2)">项目成本报表</p></el-menu-item>
|
|
|
<el-menu-item index="1-4"><p @click="ssl(3)">项目收支平衡表</p></el-menu-item>
|
|
|
+ <el-menu-item index="1-5" v-if="user.company.packageCustomer == 1"><p @click="ssl(4)">客户项目利润表</p></el-menu-item>
|
|
|
</el-submenu>
|
|
|
</el-menu>
|
|
|
</el-col>
|
|
@@ -32,17 +33,17 @@
|
|
|
<div class="contents">
|
|
|
<div class="headine" ref="headine">
|
|
|
<h3 ref="headHe" style="padding-left: 210px">{{shuz[ins]}}</h3>
|
|
|
- <p style="float: right;margin-right: 25px;"><el-button type="primary" @click="exportExcel" size="mini">报表导出</el-button></p>
|
|
|
+ <p style="float: right;margin-right: 25px;" ><el-button type="primary" @click="exportExcel" size="mini">报表导出</el-button></p>
|
|
|
</div>
|
|
|
<div ref="staff" style="margin: 5px 0px 0px 200px; width: 84%">
|
|
|
<div class="staff">
|
|
|
<!--项目报表 -->
|
|
|
- <el-table v-show="ins == 0" border :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
|
|
|
+ <el-table v-if="ins == 0" border :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
|
|
|
<el-table-column prop="projectCode" label="项目编码" width="120"></el-table-column>
|
|
|
<el-table-column prop="projectName" label="项目名称" ></el-table-column>
|
|
|
<el-table-column prop="inchargerName" label="负责人" width="80">
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="contractAmount" label="合同金额(元)" width="150">
|
|
|
+ <el-table-column prop="contractAmount" label="合同金额(元)" width="150" align="right">
|
|
|
<template slot-scope="scope">
|
|
|
{{scope.row.contractAmount.toFixed(2)}}
|
|
|
</template>
|
|
@@ -64,19 +65,19 @@
|
|
|
</el-table>
|
|
|
|
|
|
<!-- 项目任务报表 -->
|
|
|
- <el-table v-show="ins == 1" border :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
|
|
|
+ <el-table v-if="ins == 1" border :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
|
|
|
<el-table-column prop="project_code" label="项目编码" width="120"></el-table-column>
|
|
|
<el-table-column prop="project_name" label="项目名称" width="200"></el-table-column>
|
|
|
<el-table-column prop="name" label="任务名称" width="300">
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="plan_hours" label="计划工时(h)" width="150">
|
|
|
<template slot-scope="scope">
|
|
|
- {{scope.row.plan_hours.toFixed(1)}}
|
|
|
+ {{scope.row.plan_hours == null? 0:scope.row.plan_hours.toFixed(1)}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="real_hours" label="实际工时(h)" width="150">
|
|
|
<template slot-scope="scope">
|
|
|
- {{scope.row.real_hours.toFixed(1)}}
|
|
|
+ {{scope.row.real_hours == null? 0:scope.row.real_hours.toFixed(1)}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="task_status" label="状态" width="80" >
|
|
@@ -97,80 +98,132 @@
|
|
|
</el-table>
|
|
|
|
|
|
<!--项目成本报表 -->
|
|
|
- <el-table v-show="ins == 2" border :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
|
|
|
+ <el-table v-if="ins == 2" border :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
|
|
|
<el-table-column prop="projectCode" label="项目编码" width="120"></el-table-column>
|
|
|
<el-table-column prop="projectName" label="项目名称" ></el-table-column>
|
|
|
- <el-table-column prop="feeMan" label="人工成本" width="100" >
|
|
|
+ <el-table-column prop="feeMan" label="人工成本" width="100" align="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.feeMan==null?0:scope.row.feeMan.toFixed(2)}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="feeNormal" label="一般费用" width="100" align="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.feeNormal==null?0:scope.row.feeNormal.toFixed(2)}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="feeTravel" label="差旅费用" width="100" align="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.feeTravel==null?0:scope.row.feeTravel.toFixed(2)}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="feeOutsourcing" label="外包费用" width="100" align="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.feeOutsourcing==null?0:scope.row.feeOutsourcing.toFixed(2)}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="总费用" width="100" align="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.feeMan+scope.row.feeNormal+scope.row.feeTravel+scope.row.feeOutsourcing}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <!--项目收支平衡表 -->
|
|
|
+ <el-table v-if="ins == 3" border :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
|
|
|
+ <el-table-column prop="projectCode" label="项目编码" width="120"></el-table-column>
|
|
|
+ <el-table-column prop="projectName" label="项目名称" ></el-table-column>
|
|
|
+ <el-table-column prop="contractAmount" label="合同金额" width="100" align="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.contractAmount.toFixed(2)}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="feeMan" label="人工成本" width="100" align="right">
|
|
|
<template slot-scope="scope">
|
|
|
{{scope.row.feeMan.toFixed(2)}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="feeNormal" label="一般费用" width="100">
|
|
|
+ <el-table-column prop="feeNormal" label="一般费用" width="100" align="right">
|
|
|
<template slot-scope="scope">
|
|
|
{{scope.row.feeNormal.toFixed(2)}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="feeTravel" label="差旅费用" width="100">
|
|
|
+ <el-table-column prop="feeTravel" label="差旅费用" width="100" align="right">
|
|
|
<template slot-scope="scope">
|
|
|
{{scope.row.feeTravel.toFixed(2)}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="feeOutsourcing" label="外包费用" width="100">
|
|
|
+ <el-table-column prop="feeOutsourcing" label="外包费用" width="100" align="right">
|
|
|
<template slot-scope="scope">
|
|
|
{{scope.row.feeOutsourcing.toFixed(2)}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="总费用" width="100">
|
|
|
+ <el-table-column label="总费用" width="100" align="right">
|
|
|
<template slot-scope="scope">
|
|
|
{{scope.row.feeMan+scope.row.feeNormal+scope.row.feeTravel+scope.row.feeOutsourcing}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="利润" width="100" align="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{(scope.row.contractAmount==null?0:scope.row.contractAmount) - (scope.row.feeMan+scope.row.feeNormal+scope.row.feeTravel+scope.row.feeOutsourcing)}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="利润率" width="100" align="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{(scope.row.contractAmount==null||scope.row.contractAmount==0)?'-':((scope.row.contractAmount - (scope.row.feeMan+scope.row.feeNormal+scope.row.feeTravel+scope.row.feeOutsourcing))*100/scope.row.contractAmount).toFixed(1)+"%"}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
- <!--项目收支平衡表 -->
|
|
|
- <el-table v-show="ins == 3" border :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
|
|
|
- <el-table-column prop="projectCode" label="项目编码" width="120"></el-table-column>
|
|
|
- <el-table-column prop="projectName" label="项目名称" ></el-table-column>
|
|
|
- <el-table-column prop="contractAmount" label="合同金额" width="100">
|
|
|
+ <!--客户项目报表 -->
|
|
|
+ <el-table v-if="ins == 4" border :data="list"
|
|
|
+ highlight-current-row v-loading="listLoading" :height="tableHeight"
|
|
|
+ style="width: 100%;">
|
|
|
+ <el-table-column prop="customerName" label="客户名称" ></el-table-column>
|
|
|
+ <el-table-column prop="projectNames" label="相关项目">
|
|
|
+ <template slot-scope="scope" >
|
|
|
+ <el-Link @click="expandRow(scope.row, scope.$index)">{{scope.row.projectNames}}</el-Link>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="contractAmount" label="合同金额" width="100" align="right">
|
|
|
<template slot-scope="scope">
|
|
|
{{scope.row.contractAmount.toFixed(2)}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="feeMan" label="人工成本" width="100">
|
|
|
+ <el-table-column prop="feeMan" label="人工成本" width="100" align="right">
|
|
|
<template slot-scope="scope">
|
|
|
{{scope.row.feeMan.toFixed(2)}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="feeNormal" label="一般费用" width="100">
|
|
|
+ <el-table-column prop="feeNormal" label="一般费用" width="100" align="right">
|
|
|
<template slot-scope="scope">
|
|
|
{{scope.row.feeNormal.toFixed(2)}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="feeTravel" label="差旅费用" width="100">
|
|
|
+ <el-table-column prop="feeTravel" label="差旅费用" width="100" align="right">
|
|
|
<template slot-scope="scope">
|
|
|
{{scope.row.feeTravel.toFixed(2)}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="feeOutsourcing" label="外包费用" width="100">
|
|
|
+ <el-table-column prop="feeOutsourcing" label="外包费用" width="100" align="right">
|
|
|
<template slot-scope="scope">
|
|
|
{{scope.row.feeOutsourcing.toFixed(2)}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="总费用" width="100">
|
|
|
+ <el-table-column label="总费用" width="100" align="right">
|
|
|
<template slot-scope="scope">
|
|
|
{{scope.row.feeMan+scope.row.feeNormal+scope.row.feeTravel+scope.row.feeOutsourcing}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="利润" width="100">
|
|
|
+ <el-table-column label="利润" width="100" align="right">
|
|
|
<template slot-scope="scope">
|
|
|
{{(scope.row.contractAmount==null?0:scope.row.contractAmount) - (scope.row.feeMan+scope.row.feeNormal+scope.row.feeTravel+scope.row.feeOutsourcing)}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="利润率" width="100">
|
|
|
+ <el-table-column label="利润率" width="100" align="right">
|
|
|
<template slot-scope="scope">
|
|
|
{{(scope.row.contractAmount==null||scope.row.contractAmount==0)?'-':((scope.row.contractAmount - (scope.row.feeMan+scope.row.feeNormal+scope.row.feeTravel+scope.row.feeOutsourcing))*100/scope.row.contractAmount).toFixed(1)+"%"}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
+
|
|
|
<!--工具条-->
|
|
|
<el-col :span="24" class="toolbar">
|
|
|
<el-pagination
|
|
@@ -189,7 +242,58 @@
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
+ <!--新增界面-->
|
|
|
+ <el-dialog :title="title" show-summary v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth" width="1000px">
|
|
|
+ <el-table border :data="childrenList"
|
|
|
+ highlight-current-row v-loading="listLoading" height="400"
|
|
|
+ style="width: 100%;">
|
|
|
+ <el-table-column prop="projectNames" label="相关项目">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="contractAmount" label="合同金额" width="100" align="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.contractAmount.toFixed(2)}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="feeMan" label="人工成本" width="100" align="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.feeMan.toFixed(2)}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="feeNormal" label="一般费用" width="100" align="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.feeNormal.toFixed(2)}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="feeTravel" label="差旅费用" width="100" align="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.feeTravel.toFixed(2)}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="feeOutsourcing" label="外包费用" width="100" align="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.feeOutsourcing.toFixed(2)}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="总费用" width="100" align="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.feeMan+scope.row.feeNormal+scope.row.feeTravel+scope.row.feeOutsourcing}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="利润" width="100" align="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{(scope.row.contractAmount==null?0:scope.row.contractAmount) - (scope.row.feeMan+scope.row.feeNormal+scope.row.feeTravel+scope.row.feeOutsourcing)}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="利润率" width="100" align="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{(scope.row.contractAmount==null||scope.row.contractAmount==0)?'-':((scope.row.contractAmount - (scope.row.feeMan+scope.row.feeNormal+scope.row.feeTravel+scope.row.feeOutsourcing))*100/scope.row.contractAmount).toFixed(1)+"%"}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div slot="footer" class="dialog-footer;">
|
|
|
+ <el-button @click.native="addFormVisible = false">关闭</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</section>
|
|
|
</template>
|
|
|
|
|
@@ -200,6 +304,9 @@ export default {
|
|
|
props: {},
|
|
|
data() {
|
|
|
return {
|
|
|
+ addFormVisible:false,
|
|
|
+ title:'',
|
|
|
+ childrenList:[],
|
|
|
taskTypeTxt:["任务", "里程碑", "风险"],
|
|
|
taskStatusTxt:["进行中","已完成","已撤销"],
|
|
|
statusTxt:["-","进行中","已完成","已撤销"],
|
|
@@ -217,8 +324,9 @@ export default {
|
|
|
z : null,
|
|
|
value: null,
|
|
|
dialog: false, // 单据查看展示
|
|
|
- shuz: ["项目报表","项目任务报表","项目成本报表","项目收支平衡表(利润表)"],
|
|
|
- ins: 0
|
|
|
+ shuz: ["项目报表","项目任务报表","项目成本报表","项目收支平衡表(利润表)","客户项目利润报表"],
|
|
|
+ ins: 0,
|
|
|
+ user: JSON.parse(sessionStorage.user)
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
@@ -236,8 +344,9 @@ export default {
|
|
|
this.getProjectList();
|
|
|
},
|
|
|
filters: {
|
|
|
+
|
|
|
numberToCurrency(value) {
|
|
|
- if (!value) return '0.00'
|
|
|
+ if (value == undefined || !value) return '0.00'
|
|
|
value = value.toFixed(2)
|
|
|
const intPart = Math.trunc(value)
|
|
|
const intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
|
|
@@ -251,6 +360,37 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ expandRow(row, index) {
|
|
|
+ this.title = '客户:'+row.customerName;
|
|
|
+ this.childrenList = row.children;
|
|
|
+ this.addFormVisible = true;
|
|
|
+ },
|
|
|
+ // load(tree, treeNode, resolve) {
|
|
|
+ // // setTimeout(() => {
|
|
|
+ // // resolve()
|
|
|
+ // // }, 1000)
|
|
|
+ // [
|
|
|
+ // {
|
|
|
+ // projectIds: 31,
|
|
|
+ // projectNames: '2016-05-01',
|
|
|
+ // contractAmount: 0,
|
|
|
+ // feeMan:0,
|
|
|
+ // feeNormal:0,
|
|
|
+ // feeTravel:0,
|
|
|
+ // feeOutsourcing:0,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // projectIds: 32,
|
|
|
+ // projectNames: '2016-05-01',
|
|
|
+ // contractAmount: 0,
|
|
|
+ // feeMan:0,
|
|
|
+ // feeNormal:0,
|
|
|
+ // feeTravel:0,
|
|
|
+ // feeOutsourcing:0,
|
|
|
+ // },
|
|
|
+ // ]
|
|
|
+ // },
|
|
|
+
|
|
|
//分页
|
|
|
handleCurrentChange(val) {
|
|
|
this.page = val;
|
|
@@ -270,6 +410,8 @@ export default {
|
|
|
this.getAllProjectCost();
|
|
|
} else if (this.ins == 3) {
|
|
|
this.getProjectInAndOut();
|
|
|
+ } else if (this.ins == 4) {
|
|
|
+ this.getCustomerProjectInAndOut();
|
|
|
}
|
|
|
},
|
|
|
exportExcel() {
|
|
@@ -287,6 +429,9 @@ export default {
|
|
|
} else if (this.ins == 3) {
|
|
|
fName = "项目收支平衡表.xls";
|
|
|
url += "/exportProjectInAndOut";
|
|
|
+ } else if (this.ins == 4) {
|
|
|
+ fName = "客户项目利润报表.xls";
|
|
|
+ url += "/exportCustomerProjectInAndOut";
|
|
|
}
|
|
|
this.http.post(url, {},
|
|
|
res => {
|
|
@@ -314,10 +459,36 @@ export default {
|
|
|
ssl(index) {
|
|
|
this.z = index
|
|
|
this.ins = index;
|
|
|
+ this.list = [];
|
|
|
this.page = 1;
|
|
|
this.pageSize = 20;
|
|
|
this.getList();
|
|
|
},
|
|
|
+ getCustomerProjectInAndOut() {
|
|
|
+ this.listLoading = true;
|
|
|
+ this.http.post('/project/getCustomerProjectInAndOut', {
|
|
|
+ pageIndex: this.page,
|
|
|
+ pageSize: this.size,
|
|
|
+ },
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.list = res.data.records;
|
|
|
+ this.total = res.data.total;
|
|
|
+ this.listLoading = false;
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
getProjectInAndOut() {
|
|
|
this.listLoading = true;
|
|
|
this.http.post('/project/getProjectInAndOut', {
|