Browse Source

重构预算与成本

master
陈裕财 4 years ago
parent
commit
d27aeffd7e
  1. 3
      src/api/xm/core/xmBudgetLabor.js
  2. 3
      src/api/xm/core/xmBudgetNlabor.js
  3. 40
      src/api/xm/core/xmProjectMBudgetCostNouser.js
  4. 39
      src/api/xm/core/xmProjectMBudgetCostUser.js
  5. 38
      src/api/xm/core/xmProjectMCostNouser.js
  6. 39
      src/api/xm/core/xmProjectMCostUser.js
  7. 2
      src/views/xm/core/xmBudgetLabor/XmBudgetLaborAdd.vue
  8. 8
      src/views/xm/core/xmBudgetLabor/XmBudgetLaborMng.vue
  9. 2
      src/views/xm/core/xmBudgetNlabor/XmBudgetNlaborAdd.vue
  10. 4
      src/views/xm/core/xmBudgetNlabor/XmBudgetNlaborMng.vue
  11. 19
      src/views/xm/core/xmCostNlabor/XmCostNlaborEdit.vue
  12. 8
      src/views/xm/core/xmCostNlabor/XmCostNlaborMng.vue
  13. 200
      src/views/xm/core/xmProjectMBudgetCostNouser/XmProjectMBudgetCostNouserAdd.vue
  14. 146
      src/views/xm/core/xmProjectMBudgetCostNouser/XmProjectMBudgetCostNouserEdit.vue
  15. 364
      src/views/xm/core/xmProjectMBudgetCostNouser/XmProjectMBudgetCostNouserMng.vue
  16. 201
      src/views/xm/core/xmProjectMBudgetCostUser/XmProjectMBudgetCostUserAdd.vue
  17. 152
      src/views/xm/core/xmProjectMBudgetCostUser/XmProjectMBudgetCostUserEdit.vue
  18. 369
      src/views/xm/core/xmProjectMBudgetCostUser/XmProjectMBudgetCostUserMng.vue
  19. 145
      src/views/xm/core/xmProjectMCostNouser/XmProjectMCostNouserAdd.vue
  20. 166
      src/views/xm/core/xmProjectMCostNouser/XmProjectMCostNouserEdit.vue
  21. 364
      src/views/xm/core/xmProjectMCostNouser/XmProjectMCostNouserMng.vue
  22. 167
      src/views/xm/core/xmProjectMCostUser/XmProjectMCostUserAdd.vue
  23. 169
      src/views/xm/core/xmProjectMCostUser/XmProjectMCostUserEdit.vue
  24. 258
      src/views/xm/core/xmProjectMCostUser/XmProjectMCostUserList.vue
  25. 363
      src/views/xm/core/xmProjectMCostUser/XmProjectMCostUserMng.vue
  26. 7
      src/views/xm/core/xmTaskExecuser/XmTaskExecuserForTask.vue
  27. 7
      src/views/xm/core/xmTaskExecuser/XmTaskExecuserMng.vue

3
src/api/xm/core/xmBudgetLabor.js

@ -21,6 +21,9 @@ export const delXmBudgetLabor = params => { return axios.post(`${base}/xm/core/x
//批量删除项目人力成本预算 params=[{id:'主键 主键'}]
export const batchDelXmBudgetLabor = params => { return axios.post(`${base}/xm/core/xmBudgetLabor/batchDel`, params); };
//批量新增项目人力成本预算 params=[{id:'主键 主键'}]
export const batchAddXmBudgetLabor = params => { return axios.post(`${base}/xm/core/xmBudgetLabor/batchAdd`, params); };
//修改一条项目人力成本预算记录
export const editXmBudgetLabor = params => { return axios.post(`${base}/xm/core/xmBudgetLabor/edit`, params); };

3
src/api/xm/core/xmBudgetNlabor.js

@ -21,6 +21,9 @@ export const delXmBudgetNlabor = params => { return axios.post(`${base}/xm/core/
//批量删除项目人力成本预算 params=[{id:'主键 主键'}]
export const batchDelXmBudgetNlabor = params => { return axios.post(`${base}/xm/core/xmBudgetNlabor/batchDel`, params); };
//批量新增项目人力成本预算 params=[{id:'主键 主键'}]
export const batchAddXmBudgetNlabor = params => { return axios.post(`${base}/xm/core/xmBudgetNlabor/batchAdd`, params); };
//修改一条项目人力成本预算记录
export const editXmBudgetNlabor = params => { return axios.post(`${base}/xm/core/xmBudgetNlabor/edit`, params); };

40
src/api/xm/core/xmProjectMBudgetCostNouser.js

@ -1,40 +0,0 @@
import axios from '@/utils/request'
import config from '@/common/config'
let base = config.getCoreBasePath();
/**
* xm_project_m_budget_cost_nouser
*1 默认只开放普通查询所有查询只要上传 分页参数 {currentPage:当前页码从1开始,pageSize:每页记录数,total:总记录数如果是0后台会自动计算总记录数非0不会自动计算}后台都会自动按分页查询 其它 api用到再打开没用到的api请注释掉
*2 查询新增修改的参数格式 params={id:'主键 主键',projectId:'项目编号',budgetCost:'预算金额',remark:'备注',subjectId:'预算科目',bizzStartDate:'费用归属周期开始日期',bizzEndDate:'费用归属周期结束日期',bizProcInstId:'当前流程实例编号',bizFlowState:'当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除',phaseId:'阶段计划',costType:'成本类型0非人力1内部人力2外购人力',bizzMonth:'费用归属月份yyyy-mm'}
**/
//普通查询 条件之间and关系
export const listXmProjectMBudgetCostNouser = params => { return axios.get(`${base}/xm/core/xmProjectMBudgetCostNouser/list`, { params: params }); };
//模糊查询xm_project_m_budget_cost_nouser 条件之间or关系
//export const listXmProjectMBudgetCostNouserKey = params => { return axios.get(`${base}/xm/core/xmProjectMBudgetCostNouser/listKey`, { params: params }); };
//删除一条xm_project_m_budget_cost_nouser params={id:'主键 主键'}
export const delXmProjectMBudgetCostNouser = params => { return axios.post(`${base}/xm/core/xmProjectMBudgetCostNouser/del`,params); };
//批量删除xm_project_m_budget_cost_nouser params=[{id:'主键 主键'}]
export const batchDelXmProjectMBudgetCostNouser = params => { return axios.post(`${base}/xm/core/xmProjectMBudgetCostNouser/batchDel`, params); };
//修改一条xm_project_m_budget_cost_nouser记录
export const editXmProjectMBudgetCostNouser = params => { return axios.post(`${base}/xm/core/xmProjectMBudgetCostNouser/edit`, params); };
//新增一条xm_project_m_budget_cost_nouser
export const addXmProjectMBudgetCostNouser = params => { return axios.post(`${base}/xm/core/xmProjectMBudgetCostNouser/add`, params); };
//批量删除xm_project_m_budget_cost_nouser params=[{id:'主键 主键'}]
export const batchAddXmProjectMBudgetCostNouser = params => { return axios.post(`${base}/xm/core/xmProjectMBudgetCostNouser/batchAdd`, params); };
//普通查询 条件之间and关系
export const listSumXmProjectMBudgetCostNouser = params => { return axios.get(`${base}/xm/core/xmProjectMBudgetCostNouser/listSum`, { params: params }); };
export const batchEdit = params => { return axios.post(`${base}/xm/core/xmProjectMBudgetCostNouser/batchEdit`, params); };

39
src/api/xm/core/xmProjectMBudgetCostUser.js

@ -1,39 +0,0 @@
import axios from '@/utils/request'
import config from '@/common/config'
let base = config.getCoreBasePath();
/**
* xm_project_m_budget_cost_user
*1 默认只开放普通查询所有查询只要上传 分页参数 {currentPage:当前页码从1开始,pageSize:每页记录数,total:总记录数如果是0后台会自动计算总记录数非0不会自动计算}后台都会自动按分页查询 其它 api用到再打开没用到的api请注释掉
*2 查询新增修改的参数格式 params={id:'主键 主键',projectId:'项目编号',userid:'项目成员编号',budgetCost:'预算金额/每月',remark:'备注',username:'用户名',subjectId:'预算科目编号',bizzStartDate:'费用归属周期开始日期',bizzEndDate:'费用归属周期结束日期',bizzMonth:'费用归属月份yyyy-mm',bizProcInstId:'当前流程实例编号',bizFlowState:'当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除',phaseId:'项目阶段',costType:'成本类型0非人力1内部人力2外购人力'}
**/
//普通查询 条件之间and关系
export const listXmProjectMBudgetCostUser = params => { return axios.get(`${base}/xm/core/xmProjectMBudgetCostUser/list`, { params: params }); };
//模糊查询xm_project_m_budget_cost_user 条件之间or关系
//export const listXmProjectMBudgetCostUserKey = params => { return axios.get(`${base}/xm/core/xmProjectMBudgetCostUser/listKey`, { params: params }); };
//删除一条xm_project_m_budget_cost_user params={id:'主键 主键'}
export const delXmProjectMBudgetCostUser = params => { return axios.post(`${base}/xm/core/xmProjectMBudgetCostUser/del`,params); };
//批量删除xm_project_m_budget_cost_user params=[{id:'主键 主键'}]
export const batchDelXmProjectMBudgetCostUser = params => { return axios.post(`${base}/xm/core/xmProjectMBudgetCostUser/batchDel`, params); };
//修改一条xm_project_m_budget_cost_user记录
export const editXmProjectMBudgetCostUser = params => { return axios.post(`${base}/xm/core/xmProjectMBudgetCostUser/edit`, params); };
//新增一条xm_project_m_budget_cost_user
export const addXmProjectMBudgetCostUser = params => { return axios.post(`${base}/xm/core/xmProjectMBudgetCostUser/add`, params); };
//批量新增
export const batchAddXmProjectMBudgetCostUser = params => { return axios.post(`${base}/xm/core/xmProjectMBudgetCostUser/batchAdd`, params); };
//普通查询 条件之间and关系
export const listSumXmProjectMBudgetCostUser = params => { return axios.get(`${base}/xm/core/xmProjectMBudgetCostUser/listSum`, { params: params }); };
export const batchEdit = params => { return axios.post(`${base}/xm/core/xmProjectMBudgetCostUser/batchEdit`, params); };

38
src/api/xm/core/xmProjectMCostNouser.js

@ -1,38 +0,0 @@
import axios from '@/utils/request'
import config from '@/common/config'
let base = config.getCoreBasePath();
/**
* xm_project_m_cost_nouser
*1 默认只开放普通查询所有查询只要上传 分页参数 {currentPage:当前页码从1开始,pageSize:每页记录数,total:总记录数如果是0后台会自动计算总记录数非0不会自动计算}后台都会自动按分页查询 其它 api用到再打开没用到的api请注释掉
*2 查询新增修改的参数格式 params={id:'主键 主键',projectId:'项目编号',userid:'用户编号',createTime:'创建时间',sendCostTime:'费用发放时间',username:'用户名称',projectName:'项目名称',remark:'备注',taskId:'任务编号',taskName:'任务名称',subjectId:'科目编号',bizzStartDate:'费用归属周期开始日期',bizzEndDate:'费用归属周期结束日期',bizProcInstId:'当前流程实例编号',bizFlowState:'当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除',phaseId:'项目计划阶段编号',actCostAmount:'实际成本金额',costType:'成本类型0非人力1内部人力2外购人力',bizMonth:'业务归属月份yyyy-mm',bizDate:'业务归属日期yyyy-mm-dd',subjectName:'科目名称',projectPhaseName:'阶段名称'}
**/
//普通查询 条件之间and关系
export const listXmProjectMCostNouser = params => { return axios.get(`${base}/xm/core/xmProjectMCostNouser/list`, { params: params }); };
//模糊查询xm_project_m_cost_nouser 条件之间or关系
//export const listXmProjectMCostNouserKey = params => { return axios.get(`${base}/xm/core/xmProjectMCostNouser/listKey`, { params: params }); };
//删除一条xm_project_m_cost_nouser params={id:'主键 主键'}
export const delXmProjectMCostNouser = params => { return axios.post(`${base}/xm/core/xmProjectMCostNouser/del`,params); };
//批量删除xm_project_m_cost_nouser params=[{id:'主键 主键'}]
export const batchDelXmProjectMCostNouser = params => { return axios.post(`${base}/xm/core/xmProjectMCostNouser/batchDel`, params); };
//修改一条xm_project_m_cost_nouser记录
export const editXmProjectMCostNouser = params => { return axios.post(`${base}/xm/core/xmProjectMCostNouser/edit`, params); };
//新增一条xm_project_m_cost_nouser
export const addXmProjectMCostNouser = params => { return axios.post(`${base}/xm/core/xmProjectMCostNouser/add`, params); };
export const listSumXmProjectMCostNouser = params => { return axios.get(`${base}/xm/core/xmProjectMCostNouser/listSum`, { params: params }); };
//批量新增
export const batchAddXmProjectMCostNouser = params => { return axios.post(`${base}/xm/core/xmProjectMCostNouser/batchAdd`, params); };
export const batchEdit = params => { return axios.post(`${base}/xm/core/xmProjectMCostNouser/batchEdit`, params); };

39
src/api/xm/core/xmProjectMCostUser.js

@ -1,39 +0,0 @@
import axios from '@/utils/request'
import config from '@/common/config'
let base = config.getCoreBasePath();
/**
* xm_project_m_cost_user
*1 默认只开放普通查询所有查询只要上传 分页参数 {currentPage:当前页码从1开始,pageSize:每页记录数,total:总记录数如果是0后台会自动计算总记录数非0不会自动计算}后台都会自动按分页查询 其它 api用到再打开没用到的api请注释掉
*2 查询新增修改的参数格式 params={id:'主键 主键',subjectId:'科目编号',projectId:'项目编号',userid:'用户编号',createTime:'创建时间',sendCostTime:'费用发放时间',username:'用户名称',projectName:'项目名称',remark:'备注',taskId:'任务编号',taskName:'任务名称',actWorkload:'实际工时',bizzStartDate:'费用归属周期开始日期',bizzEndDate:'费用归属周期结束日期',bizProcInstId:'当前流程实例编号',bizFlowState:'当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除',phaseId:'项目计划阶段编号',actCostAmount:'金额',costType:'成本类型0非人力1内部人力2外购人力',bizMonth:'业务归属月份yyyy-mm',bizDate:'业务归属日期yyyy-mm-dd',subjectName:'科目名称',projectPhaseName:'阶段名称'}
**/
//普通查询 条件之间and关系
export const listXmProjectMCostUser = params => { return axios.get(`${base}/xm/core/xmProjectMCostUser/list`, { params: params }); };
//模糊查询xm_project_m_cost_user 条件之间or关系
//export const listXmProjectMCostUserKey = params => { return axios.get(`${base}/xm/core/xmProjectMCostUser/listKey`, { params: params }); };
//删除一条xm_project_m_cost_user params={id:'主键 主键'}
export const delXmProjectMCostUser = params => { return axios.post(`${base}/xm/core/xmProjectMCostUser/del`,params); };
//批量删除xm_project_m_cost_user params=[{id:'主键 主键'}]
export const batchDelXmProjectMCostUser = params => { return axios.post(`${base}/xm/core/xmProjectMCostUser/batchDel`, params); };
//修改一条xm_project_m_cost_user记录
export const editXmProjectMCostUser = params => { return axios.post(`${base}/xm/core/xmProjectMCostUser/edit`, params); };
//新增一条xm_project_m_cost_user
export const addXmProjectMCostUser = params => { return axios.post(`${base}/xm/core/xmProjectMCostUser/add`, params); };
export const listSumXmProjectMCostUser = params => { return axios.get(`${base}/xm/core/xmProjectMCostUser/listSum`, { params: params }); };
//批量新增
export const batchAddXmProjectMCostUser = params => { return axios.post(`${base}/xm/core/xmProjectMCostUser/batchAdd`, params); };
export const batchEdit = params => { return axios.post(`${base}/xm/core/xmProjectMCostUser/batchEdit`, params); };

2
src/views/xm/core/xmBudgetLabor/XmBudgetLaborAdd.vue

@ -118,7 +118,7 @@
'editForm.subjectId':function(subjectId) {
var dicts=this.dicts.projectSubject.filter(i=>i.id==subjectId)
if(options!=null && dicts.length>0){
if( dicts!=null && dicts.length>0){
this.editForm.subjectName=dicts[0].name
}else{
this.editForm.subjectName="";

8
src/views/xm/core/xmBudgetLabor/XmBudgetLaborMng.vue

@ -33,10 +33,10 @@
<el-table-column prop="subjectId" label="预算科目" min-width="80" show-overflow-tooltip>
<template slot-scope="scope">
<div class="cell-text">
{{formaterByDicts(scope.row,'projectSubject',scope.row.subjectId)}}
{{formatDicts(dicts,'projectSubject',scope.row.subjectId)}}
</div>
<span class="cell-bar">
<el-select v-model="scope.row.subjectId" placeholder="预算科目" style="display:block;" @change="editXmMenuSomeFields(scope.row,'subjectId',$event)">
<el-select v-model="scope.row.subjectId" placeholder="预算科目" style="display:block;" @change="editSomeFields(scope.row,'subjectId',$event)">
<el-option :value="item.id" :label="item.name" v-for="(item,index) in dicts.projectSubject" :key="index"></el-option>
</el-select>
</span>
@ -85,7 +85,7 @@
<!--新增 XmBudgetLabor 项目人力成本预算界面-->
<el-drawer title="新增项目人力预算" :visible.sync="addFormVisible" size="60%" append-to-body :close-on-click-modal="false">
<xm-budget-labor-add op-type="add" :visible="addFormVisible" @cancel="addFormVisible=false" @submit="afterAddSubmit"></xm-budget-labor-add>
<xm-budget-labor-add op-type="add" :sel-project="selProject" :visible="addFormVisible" @cancel="addFormVisible=false" @submit="afterAddSubmit"></xm-budget-labor-add>
</el-drawer>
</el-row>
</section>
@ -105,7 +105,7 @@
components: {
XmBudgetLaborEdit,XmBudgetLaborAdd
},
props:['visible'],
props:['visible',"selProject"],
computed: {
...mapGetters(['userInfo']),

2
src/views/xm/core/xmBudgetNlabor/XmBudgetNlaborAdd.vue

@ -115,7 +115,7 @@
'editForm.subjectId':function(subjectId) {
var dicts=this.dicts.projectSubject.filter(i=>i.id==subjectId)
if(options!=null && dicts.length>0){
if( dicts!=null && dicts.length>0 ){
this.editForm.subjectName=dicts[0].name
}else{
this.editForm.subjectName="";

4
src/views/xm/core/xmBudgetNlabor/XmBudgetNlaborMng.vue

@ -40,10 +40,10 @@
<el-table-column prop="subjectId" label="预算科目" min-width="80" show-overflow-tooltip>
<template slot-scope="scope">
<div class="cell-text">
{{formaterByDicts(scope.row,'projectSubject',scope.row.subjectId)}}
{{formatDicts(dicts,'projectSubject',scope.row.subjectId)}}
</div>
<span class="cell-bar">
<el-select v-model="scope.row.subjectId" placeholder="预算科目" style="display:block;" @change="editXmMenuSomeFields(scope.row,'subjectId',$event)">
<el-select v-model="scope.row.subjectId" placeholder="预算科目" style="display:block;" @change="editSomeFields(scope.row,'subjectId',$event)">
<el-option :value="item.id" :label="item.name" v-for="(item,index) in dicts.projectSubject" :key="index"></el-option>
</el-select>
</span>

19
src/views/xm/core/xmCostNlabor/XmCostNlaborEdit.vue

@ -60,7 +60,7 @@
...mapGetters([ 'userInfo' ]),
},
props:['xmCostNlabor','visible','opType'],
props:['xmCostNlabor','visible','opType','selProject'],
watch: {
'xmCostNlabor':function( xmCostNlabor ) {
@ -73,7 +73,15 @@
if(visible==true){
this.initData()
}
}
},
'editForm.subjectId':function(subjectId) {
var dicts=this.dicts.projectSubject.filter(i=>i.id==subjectId)
if( dicts!=null && dicts.length>0 ){
this.editForm.subjectName=dicts[0].name
}else{
this.editForm.subjectName="";
}
}
},
data() {
return {
@ -89,7 +97,7 @@
username: [
{ required: true, message: '姓名不能为空', trigger: 'change' }
],
budgetAt: [
actAt: [
{ required: true, message: '金额不能为空', trigger: 'change' }
],
@ -149,7 +157,10 @@
if(this.opType=='edit'){
}else{
if(this.selProject && this.selProject.id){
this.editForm.projectId=this.selProject.id
this.editForm.projectName=this.selProject.name
}
}
},

8
src/views/xm/core/xmCostNlabor/XmCostNlaborMng.vue

@ -45,10 +45,10 @@
<el-table-column prop="subjectId" label="成本科目" min-width="80" show-overflow-tooltip>
<template slot-scope="scope">
<div class="cell-text">
{{formaterByDicts(scope.row,'projectSubject',scope.row.subjectId)}}
{{formatDicts(dicts,'projectSubject',scope.row.subjectId)}}
</div>
<span class="cell-bar">
<el-select v-model="scope.row.subjectId" placeholder="成本科目" style="display:block;" @change="editXmMenuSomeFields(scope.row,'subjectId',$event)">
<el-select v-model="scope.row.subjectId" placeholder="成本科目" style="display:block;" @change="editSomeFields(scope.row,'subjectId',$event)">
<el-option :value="item.id" :label="item.name" v-for="(item,index) in dicts.projectSubject" :key="index"></el-option>
</el-select>
</span>
@ -85,7 +85,7 @@
<!--新增 XmCostNlabor 项目实际人工成本费用界面-->
<el-drawer title="新增项目非人力费用" :visible.sync="addFormVisible" size="60%" append-to-body :close-on-click-modal="false">
<xm-cost-nlabor-edit op-type="add" :visible="addFormVisible" @cancel="addFormVisible=false" @submit="afterAddSubmit"></xm-cost-nlabor-edit>
<xm-cost-nlabor-edit op-type="add" :sel-project="selProject" :visible="addFormVisible" @cancel="addFormVisible=false" @submit="afterAddSubmit"></xm-cost-nlabor-edit>
</el-drawer>
</el-row>
</section>
@ -103,7 +103,7 @@
components: {
XmCostNlaborEdit,
},
props:['visible'],
props:['visible','selProject'],
computed: {
...mapGetters(['userInfo']),

200
src/views/xm/core/xmProjectMBudgetCostNouser/XmProjectMBudgetCostNouserAdd.vue

@ -1,200 +0,0 @@
<template>
<section class="page-container padding border">
<el-row>
<!--新增界面 XmProjectMBudgetCostNouser xm_project_m_budget_cost_user-->
<el-form :model="addForm" label-width="120px" :rules="addFormRules" ref="addForm">
<el-form-item label="预算总金额" prop="totalBudgetCost">
<el-input v-model="totalBudgetCost" placeholder="预算金额"></el-input>
</el-form-item>
<el-form-item label="预算金额/月" prop="budgetCost">
<el-input v-model="addForm.budgetCost" placeholder="预算金额/月"></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="addForm.remark" placeholder="备注" ></el-input>
</el-form-item>
<el-form-item label="预算科目" prop="subjectId">
<el-select placeholder="预算科目编号" v-model="addForm.subjectId">
<el-option
v-for="(item,i) in dicts.projectSubject"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="总预算平摊到下面月份" prop="bizzMonth">
<el-date-picker
v-model="bizzYear"
type="year"
value-format="yyyy"
placeholder="选择年">
</el-date-picker>
<div style="margin-top: 20px">
<el-checkbox-group v-model="bizzMonths" size="medium">
<el-checkbox-button v-for="i in bizzMonthList" :label="i" :key="i">{{i}}</el-checkbox-button>
</el-checkbox-group>
</div>
下一年{{secBizzYear}}
<div style="margin-top: 20px">
<el-checkbox-group v-model="secBizzMonths" size="medium">
<el-checkbox-button v-for="i in bizzMonthList" :label="i" :key="i">{{i}}</el-checkbox-button>
</el-checkbox-group>
</div>
</el-form-item>
<el-form-item label="成本类型" prop="costType">
<template>
<el-radio v-model="addForm.costType" label="0">非人力</el-radio>
<el-radio v-model="addForm.costType" label="1">内部人力</el-radio>
<el-radio v-model="addForm.costType" label="2">外购人力</el-radio>
</template>
</el-form-item>
<el-form-item>
<el-col :span="24" :offset="8">
<el-button @click.native="handleCancel">取消</el-button>
<el-button v-loading="load.add" type="primary" @click.native="addSubmit" :disabled="load.add==true">提交</el-button>
</el-col>
</el-form-item>
</el-form>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { addXmProjectMBudgetCostNouser,batchAddXmProjectMBudgetCostNouser } from '@/api/xm/core/xmProjectMBudgetCostNouser';
import { mapGetters } from 'vuex'
export default {
computed: {
...mapGetters([
'userInfo','roles'
]),
'allMonths': function(){
var bizzMonths=this.bizzMonths.map(i=>this.bizzYear+"-"+i);
var secBizzMonths=this.secBizzMonths.map(i=>this.secBizzYear+"-"+i);
var bizzMonthAll=bizzMonths.concat(secBizzMonths);
return bizzMonthAll;
}
},
props:['xmProjectMBudgetCostNouser','visible','selProject'],
watch: {
'xmProjectMBudgetCostNouser':function( xmProjectMBudgetCostNouser ) {
//this.addForm = xmProjectMBudgetCostNouser;
},
'visible':function(visible) {
if(visible==true){
//
}
},
'bizzYear': function(year){
this.secBizzYear=parseInt(year)+1+"";
} ,
'totalBudgetCost': function(totalBudgetCost){
if(this.allMonths.length==0){
return ;
}
this.addForm.budgetCost=totalBudgetCost/this.allMonths.length;
} ,
'addForm.subjectId':function(subjectId) {
var dicts=this.dicts.projectSubject.filter(i=>i.id==subjectId)
if(options!=null && dicts.length>0){
this.addForm.subjectName=dicts[0].name
}else{
this.addForm.subjectName="";
}
}
},
data() {
var year=new Date().getFullYear();
var secYear=parseInt(year)+1;
return {
dicts:{
projectSubject:[]
},// 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 },//...
addFormRules: {
subjectId: [
{ required: true, message: '科目不能为空', trigger: 'blur' }
],
username: [
{ required: true, message: '姓名不能为空', trigger: 'blur' }
],
budgetCost: [
{ required: true, message: '金额不能为空', trigger: 'blur' }
]
},
totalBudgetCost:0,
bizzYear:year+'',
secBizzYear:secYear+'',
bizzMonths:[],
secBizzMonths:[],
bizzMonthList:['01','02','03','04','05','06','07','08','09','10','11','12'],
// xm_project_m_budget_cost_user
addForm: {
projectId:'',userid:'',budgetCost:'',id:'',remark:'',username:'',subjectId:'',bizzStartDate:'',bizzEndDate:'',bizzMonth:'',bizProcInstId:'',bizFlowState:'0',phaseId:'',costType:'0',subjectName:''
}
/**begin 在下面加自定义属性,记得补上面的一个逗号**/
/**end 在上面加自定义属性**/
}//end return
},//end data
methods: {
// @cancel="addFormVisible=false"
handleCancel:function(){
this.$refs['addForm'].resetFields();
this.$emit('cancel');
},
//XmProjectMBudgetCostNouser xm_project_m_budget_cost_user @submit="afterAddSubmit"
addSubmit: function () {
if(this.bizzYear==null || this.bizzYear==''){
this.$notify({position:'bottom-left',showClose:true,message:"请选择需要分摊的年份", type: 'error' });
return;
}
var list=this.allMonths.map(i=>{
let params = Object.assign({}, this.addForm);
params.projectId=this.selProject.id
params.bizzMonth=i
return params;
});
this.$refs.addForm.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.add=true
batchAddXmProjectMBudgetCostNouser(list).then((res) => {
this.load.add=false
var tips=res.data.tips;
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.add=false);
});
}
});
}
/**begin 在下面加自定义方法,记得补上面的一个逗号**/
/**end 在上面加自定义方法**/
},//end method
components: {
// 'xm-project-m-budget-cost-user-edit':XmProjectMBudgetCostNouserEdit
},
mounted() {
//this.addForm=Object.assign(this.addForm, this.xmProjectMBudgetCostNouser);
initSimpleDicts( 'all',['projectSubject']).then(res=>{
this.dicts=res.data.data;
})
/**在下面写其它函数***/
}//end mounted
}
</script>
<style scoped>
</style>

146
src/views/xm/core/xmProjectMBudgetCostNouser/XmProjectMBudgetCostNouserEdit.vue

@ -1,146 +0,0 @@
<template>
<section class="page-container padding border">
<el-row>
<!--编辑界面 XmProjectMBudgetCostNouser xm_project_m_budget_cost_nouser-->
<el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editForm">
<el-form-item label="预算金额" prop="budgetCost">
<el-input v-model="editForm.budgetCost" placeholder="预算金额"></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="editForm.remark" placeholder="备注"></el-input>
</el-form-item>
<el-form-item label="预算科目" prop="subjectId">
<el-select placeholder="预算科目编号" v-model="editForm.subjectId">
<el-option
v-for="(item,i) in dicts.projectSubject"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="费用归属月份" prop="bizzMonth">
<el-input v-model="editForm.bizzMonth" placeholder="费用归属月份yyyy-mm"></el-input>
</el-form-item>
<el-form-item label="成本类型" prop="costType">
<template>
<el-radio v-model="editForm.costType" label="0">非人力</el-radio>
<el-radio v-model="editForm.costType" label="1">内部人力</el-radio>
<el-radio v-model="editForm.costType" label="2">外购人力</el-radio>
</template>
</el-form-item>
<el-form-item>
<el-col :span="24" :offset="8">
<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-col>
</el-form-item>
</el-form>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { editXmProjectMBudgetCostNouser } from '@/api/xm/core/xmProjectMBudgetCostNouser';
import { mapGetters } from 'vuex'
export default {
computed: {
...mapGetters([
'userInfo','roles'
])
},
props:['xmProjectMBudgetCostNouser','visible'],
watch: {
'xmProjectMBudgetCostNouser':function( xmProjectMBudgetCostNouser ) {
this.editForm = xmProjectMBudgetCostNouser;
},
'visible':function(visible) {
if(visible==true){
//
}
},
'editForm.subjectId':function(subjectId) {
var dicts=this.dicts.projectSubject.filter(i=>i.id==subjectId)
if(options!=null && dicts.length>0){
this.editForm.subjectName=dicts[0].name
}else{
this.editForm.subjectName="";
}
}
},
data() {
return {
dicts:{
projectSubject:[]
},// 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 },//...
editFormRules: {
subjectId: [
{ required: true, message: '科目不能为空', trigger: 'blur' }
],
username: [
{ required: true, message: '姓名不能为空', trigger: 'blur' }
],
budgetCost: [
{ required: true, message: '金额不能为空', trigger: 'blur' }
]
},
// XmProjectMBudgetCostNouser xm_project_m_budget_cost_nouser
editForm: {
projectId:'',budgetCost:'',id:'',remark:'',subjectId:'',bizzStartDate:'',bizzEndDate:'',bizProcInstId:'',bizFlowState:'',phaseId:'',costType:'',bizzMonth:'',subjectName:''
}
/**begin 在下面加自定义属性,记得补上面的一个逗号**/
/**end 在上面加自定义属性**/
}//end return
},//end data
methods: {
// @cancel="editFormVisible=false"
handleCancel:function(){
this.$refs['editForm'].resetFields();
this.$emit('cancel');
},
//XmProjectMBudgetCostNouser xm_project_m_budget_cost_nouser@submit="afterEditSubmit"
editSubmit: function () {
this.$refs.editForm.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.edit=true
let params = Object.assign({}, this.editForm);
editXmProjectMBudgetCostNouser(params).then((res) => {
this.load.edit=false
var tips=res.data.tips;
if(tips.isOk){
this.$refs['editForm'].resetFields();
this.$emit('submit');// @submit="afterEditSubmit"
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err =>this.load.edit=false);
});
}
});
}
/**begin 在下面加自定义方法,记得补上面的一个逗号**/
/**end 在上面加自定义方法**/
},//end method
components: {
// 'xm-project-m-budget-cost-nouser-edit':XmProjectMBudgetCostNouserEdit
},
mounted() {
this.editForm=Object.assign(this.editForm, this.xmProjectMBudgetCostNouser);
initSimpleDicts('all',['projectSubject']).then(res=>{
this.dicts=res.data.data;
})
}
}
</script>
<style scoped>
</style>

364
src/views/xm/core/xmProjectMBudgetCostNouser/XmProjectMBudgetCostNouserMng.vue

@ -1,364 +0,0 @@
<template>
<section class="page-container padding border">
<el-row>
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询">
<template slot="append">
<el-button type="primary" v-loading="load.list" :disabled="load.list==true" v-on:click="searchXmProjectMBudgetCostNousers" icon="el-icon-search">查询</el-button>
</template>
</el-input>
<el-button type="primary" v-if="batchEditVisible==false" @click="showAdd" icon="el-icon-plus"></el-button>
<el-button v-if="batchEditVisible==false" @click="batchEditVisible=true" icon="el-icon-edit"></el-button>
<el-button type="primary" v-if="batchEditVisible==true" @click="batchSave" icon="el-icon-finish">保存</el-button>
<el-button v-if="batchEditVisible==true" @click="noBatchEdit" icon="el-icon-back">返回</el-button>
<el-button type="danger" v-loading="load.del" @click="batchDel" :disabled="this.sels.length===0 || load.del==true" icon="el-icon-delete"></el-button>
<font class="hidden-md-and-down">
<span style="margin-left:10px;font-size:14px;">项目总预算</span><el-tag type='success'> {{selProject.planTotalCost}}</el-tag>
<span style="margin-left:10px;font-size:14px;">非人力总预算</span><el-tag type='warning'>{{selProject.planNouserAt}}</el-tag>
<span style="margin-left:10px;font-size:14px;">内部人力总预算</span><el-tag type='warning'>{{selProject.planIuserAt}}</el-tag>
<span style="margin-left:10px;font-size:14px;">外购人力总预算</span><el-tag type='warning'>{{selProject.planOuserAt}}</el-tag>
</font>
</el-row>
<el-row class="page-main ">
<!--列表 XmProjectMBudgetCostNouser xm_project_m_budget_cost_nouser-->
<el-table ref="table" :height="tableHeight" :data="xmProjectMBudgetCostNousers" show-summary @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;">
<el-table-column sortable type="selection" width="40"></el-table-column>
<el-table-column sortable type="index" width="40"></el-table-column>
<el-table-column prop="subjectId" label="预算科目编号" min-width="80" >
<template slot-scope="scope">
<el-select :disabled="batchEditVisible==false" placeholder="预算科目编号" v-model="scope.row.subjectId" @change="fieldChange(scope.row)">
<el-option
v-for="(item,i) in dicts.projectSubject"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="budgetCost" label="预算金额" min-width="80" >
<template slot-scope="scope">
<el-input v-if="batchEditVisible==true" v-model="scope.row.budgetCost" type="number" placeholder="预算金额" @change="fieldChange(scope.row)"></el-input>
<div v-else>{{scope.row.budgetCost}}</div>
</template>
</el-table-column>
<el-table-column prop="bizzMonth" label="费用月份" min-width="80" >
<template slot-scope="scope">
<el-date-picker v-if="batchEditVisible==true"
@change="fieldChange(scope.row)"
v-model="scope.row.bizzMonth"
type="month"
value-format="yyyy-MM"
placeholder="选择年月">
</el-date-picker>
<div v-else>{{scope.row.bizzMonth}}</div>
</template>
</el-table-column>
<el-table-column prop="costType" label="成本类型" min-width="80" >
<template slot-scope="scope">
<el-radio :disabled="batchEditVisible==false" @change="fieldChange(scope.row)" v-model="scope.row.costType" label="1">内部人力</el-radio>
<el-radio :disabled="batchEditVisible==false" @change="fieldChange(scope.row)" v-model="scope.row.costType" label="2">外购人力</el-radio>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" min-width="80" >
<template slot-scope="scope">
<el-input v-if="batchEditVisible==true" v-model="scope.row.remark" placeholder="备注" @change="fieldChange(scope.row)" ></el-input>
<div v-else>{{scope.row.remark}}</div>
</template>
</el-table-column>
<el-table-column prop="bizFlowState" label="当前审批状态" min-width="80" ></el-table-column>
<el-table-column label="操作" width="160" fixed="right" v-if="batchEditVisible==false">
<template slot-scope="scope">
<el-button @click="showEdit( scope.row,scope.$index)"></el-button>
<el-button type="danger" @click="handleDel(scope.row,scope.$index)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination layout="total, sizes, prev, pager, next" @current-change="handleCurrentChange" @size-change="handleSizeChange" :page-sizes="[10,20, 50, 100, 500]" :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :total="pageInfo.total" style="float:right;"></el-pagination>
<!--编辑 XmProjectMBudgetCostNouser xm_project_m_budget_cost_nouser界面-->
<el-drawer title="编辑非人力预算明细" :visible.sync="editFormVisible" size="80%" append-to-body :close-on-click-modal="false">
<xm-project-m-budget-cost-nouser-edit :xm-project-m-budget-cost-nouser="editForm" :visible="editFormVisible" @cancel="editFormVisible=false" @submit="afterEditSubmit"></xm-project-m-budget-cost-nouser-edit>
</el-drawer>
<!--新增 XmProjectMBudgetCostNouser xm_project_m_budget_cost_nouser界面-->
<el-drawer title="新增非人力预算明细" :visible.sync="addFormVisible" size="80%" append-to-body :close-on-click-modal="false">
<xm-project-m-budget-cost-nouser-add :sel-project="selProject" :xm-project-m-budget-cost-nouser="addForm" :visible="addFormVisible" @cancel="addFormVisible=false" @submit="afterAddSubmit"></xm-project-m-budget-cost-nouser-add>
</el-drawer>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
//import Sticky from '@/components/Sticky' // header
import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { listXmProjectMBudgetCostNouser, delXmProjectMBudgetCostNouser, batchDelXmProjectMBudgetCostNouser,batchEdit } from '@/api/xm/core/xmProjectMBudgetCostNouser';
import XmProjectMBudgetCostNouserAdd from './XmProjectMBudgetCostNouserAdd';//
import XmProjectMBudgetCostNouserEdit from './XmProjectMBudgetCostNouserEdit';//
import { mapGetters } from 'vuex'
export default {
computed: {
...mapGetters([
'userInfo','roles'
])
},
props:["selProject",'budgetCostNouser','fieldName','queryType','visible'],
watch:{
visible:function(visible){
if(visible==true){
this.getXmProjectMBudgetCostNousers();
}
}
},
data() {
return {
filters: {
key: ''
},
xmProjectMBudgetCostNousers: [],//
pageInfo:{//
total:0,//0>0
pageSize:10,//
count:false,//
pageNum:1,//1
orderFields:[],// ['sex','student_id']
orderDirs:[]// asc,desc ['asc','desc']
},
load:{ list: false, edit: false, del: false, add: false },//...
sels: [],//
dicts:{
projectSubject:[],
},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
addFormVisible: false,//xmProjectMBudgetCostNouser
//xmProjectMBudgetCostNouser
addForm: {
projectId:'',budgetCost:'',id:'',remark:'',subjectId:'',bizzStartDate:'',bizzEndDate:'',bizProcInstId:'',bizFlowState:'',phaseId:'',costType:'',bizzMonth:''
},
editFormVisible: false,//
//xmProjectMBudgetCostNouser
editForm: {
projectId:'',budgetCost:'',id:'',remark:'',subjectId:'',bizzStartDate:'',bizzEndDate:'',bizProcInstId:'',bizFlowState:'',phaseId:'',costType:'',bizzMonth:''
},
/**begin 自定义属性请在下面加 请加备注**/
batchEditVisible:false,
valueChangeRows:[],
tableHeight:300,
/**end 自定义属性请在上面加 请加备注**/
}
},//end data
methods: {
handleSizeChange(pageSize) {
this.pageInfo.pageSize=pageSize;
this.getXmProjectMBudgetCostNousers();
},
handleCurrentChange(pageNum) {
this.pageInfo.pageNum = pageNum;
this.getXmProjectMBudgetCostNousers();
},
// obj.order=ascending/descending, asc/desc ; obj.prop=,
sortChange( obj ){
var dir='asc';
if(obj.order=='ascending'){
dir='asc'
}else{
dir='desc';
}
if(obj.prop=='xxx'){
this.pageInfo.orderFields=['xxx'];
this.pageInfo.orderDirs=[dir];
}
this.getXmProjectMBudgetCostNousers();
},
searchXmProjectMBudgetCostNousers(){
this.pageInfo.count=true;
this.getXmProjectMBudgetCostNousers();
},
// XmProjectMBudgetCostNouser xm_project_m_budget_cost_nouser
getXmProjectMBudgetCostNousers() {
let params = {
pageSize: this.pageInfo.pageSize,
pageNum: this.pageInfo.pageNum,
total: this.pageInfo.total,
count:this.pageInfo.count
};
if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){
let orderBys=[];
for(var i=0;i<this.pageInfo.orderFields.length;i++){
orderBys.push(this.pageInfo.orderFields[i]+" "+this.pageInfo.orderDirs[i])
}
params.orderBy= orderBys.join(",")
}
if(this.filters.key!==""){
//params.xxx=this.filters.key
}else{
//params.xxx=xxxxx
}
if(this.queryType=='queryByBizzMonth'){
params.bizzMonth=this.fieldName
params.username=this.budgetCostNouser.username
params.subjectId=this.budgetCostNouser.subjectId
}else if(this.queryType=='queryByUsername'){
params.username=this.budgetCostNouser.username
params.subjectId=this.budgetCostNouser.subjectId
}else if(this.queryType=='queryBySubjectId'){
params.subjectId=this.budgetCostNouser.subjectId
}
if(this.selProject!=null && this.selProject !=undefined){
params.projectId=this.selProject.id
}
this.load.list = true;
listXmProjectMBudgetCostNouser(params).then((res) => {
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.total = res.data.total;
this.pageInfo.count=false;
this.xmProjectMBudgetCostNousers = res.data.data;
this.valueChangeRows=[];
}else{
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: 'error' });
}
this.load.list = false;
}).catch( err => this.load.list = false );
},
// XmProjectMBudgetCostNouser xm_project_m_budget_cost_nouser
showEdit: function ( row,index ) {
this.editFormVisible = true;
this.editForm = Object.assign({}, row);
},
// XmProjectMBudgetCostNouser xm_project_m_budget_cost_nouser
showAdd: function () {
this.addFormVisible = true;
//this.addForm=Object.assign({}, this.editForm);
},
afterAddSubmit(){
this.addFormVisible=false;
this.pageInfo.count=true;
this.getXmProjectMBudgetCostNousers();
},
afterEditSubmit(){
this.editFormVisible=false;
},
//xmProjectMBudgetCostNouser
selsChange: function (sels) {
this.sels = sels;
},
//xmProjectMBudgetCostNouser
handleDel: function (row,index) {
this.$confirm('确认删除该记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.load.del=true;
let params = { id: row.id };
delXmProjectMBudgetCostNouser(params).then((res) => {
this.load.del=false;
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.count=true;
this.getXmProjectMBudgetCostNousers();
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.del=false );
});
},
//xmProjectMBudgetCostNouser
batchDel: function () {
this.$confirm('确认删除选中记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.load.del=true;
batchDelXmProjectMBudgetCostNouser(this.sels).then((res) => {
this.load.del=false;
var tips=res.data.tips;
if( tips.isOk ){
this.pageInfo.count=true;
this.getXmProjectMBudgetCostNousers();
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error'});
}).catch( err => this.load.del=false );
});
},
rowClick: function(row, event, column){
this.$emit('row-click',row, event, column);// @row-click="rowClick"
},
/**begin 自定义函数请在下面加**/
batchSave:function(){
if(this.valueChangeRows.length==0){
this.$notify({position:'bottom-left',showClose:true,message:"没有改变任何数据,无需保存", type: 'success'});
return;
}else {
this.load.edit=true;
batchEdit(this.valueChangeRows).then(res=>{
this.load.edit=false;
var tips =res.data.tips;
if(tips.isOk){
this.valueChangeRows=[]
this.getXmProjectMBudgetCostNousers();
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error'});
}).catch(e=>this.load.edit=false);
}
},
noBatchEdit: function(){
this.batchEditVisible=false;
this.valueChangeRows=[];
this.getXmProjectMBudgetCostNousers();
},
getFloatValue(value,digit){
if(value==null || value=='' || value==undefined){
value=0;
}
return parseFloat(value);
},
fieldChange:function(row,fieldName){
if(this.valueChangeRows.some(i=>i.id==row.id)){
return;
}else{
this.valueChangeRows.push(row)
}
console.log(JSON.stringify(row));
},
/**end 自定义函数请在上面加**/
},//end methods
components: {
'xm-project-m-budget-cost-nouser-add':XmProjectMBudgetCostNouserAdd,
'xm-project-m-budget-cost-nouser-edit':XmProjectMBudgetCostNouserEdit,
//
},
mounted() {
this.$nextTick(() => {
this.tableHeight = util.calcTableMaxHeight(".el-table");
this.getXmProjectMBudgetCostNousers();
});
initSimpleDicts('all',['projectSubject']).then(res=>{
this.dicts=res.data.data;
})
}
}
</script>
<style scoped>
</style>

201
src/views/xm/core/xmProjectMBudgetCostUser/XmProjectMBudgetCostUserAdd.vue

@ -1,201 +0,0 @@
<template>
<section class="page-container padding border">
<el-row>
<!--新增界面 XmProjectMBudgetCostUser xm_project_m_budget_cost_user-->
<el-form :model="addForm" label-width="120px" :rules="addFormRules" ref="addForm">
<el-form-item label="用户名" prop="username">
<el-input v-model="addForm.username" placeholder="用户名" ></el-input>
</el-form-item>
<el-form-item label="预算总金额" prop="totalBudgetCost">
<el-input v-model="totalBudgetCost" placeholder="预算金额"></el-input>
</el-form-item>
<el-form-item label="预算金额/月" prop="budgetCost">
<el-input v-model="addForm.budgetCost" placeholder="预算金额/月"></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="addForm.remark" placeholder="备注" ></el-input>
</el-form-item>
<el-form-item label="预算科目" prop="subjectId">
<el-select placeholder="预算科目编号" v-model="addForm.subjectId">
<el-option
v-for="(item,i) in dicts.projectSubject"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="总预算平摊到下面月份" prop="bizzMonth">
<el-date-picker
v-model="bizzYear"
type="year"
value-format="yyyy"
placeholder="选择年">
</el-date-picker>
<div style="margin-top: 20px">
<el-checkbox-group v-model="bizzMonths" size="medium">
<el-checkbox-button v-for="i in bizzMonthList" :label="i" :key="i">{{i}}</el-checkbox-button>
</el-checkbox-group>
</div>
下一年{{secBizzYear}}
<div style="margin-top: 20px">
<el-checkbox-group v-model="secBizzMonths" size="medium">
<el-checkbox-button v-for="i in bizzMonthList" :label="i" :key="i">{{i}}</el-checkbox-button>
</el-checkbox-group>
</div>
</el-form-item>
<el-form-item label="成本类型" prop="costType">
<template>
<el-radio v-model="addForm.costType" label="1">内部人力</el-radio>
<el-radio v-model="addForm.costType" label="2">外购人力</el-radio>
</template>
</el-form-item>
<el-form-item>
<el-col :span="24" :offset="8">
<el-button @click.native="handleCancel">取消</el-button>
<el-button v-loading="load.add" type="primary" @click.native="addSubmit" :disabled="load.add==true">提交</el-button>
</el-col>
</el-form-item>
</el-form>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { addXmProjectMBudgetCostUser,batchAddXmProjectMBudgetCostUser } from '@/api/xm/core/xmProjectMBudgetCostUser';
import { mapGetters } from 'vuex'
export default {
computed: {
...mapGetters([
'userInfo','roles'
]),
'allMonths': function(){
var bizzMonths=this.bizzMonths.map(i=>this.bizzYear+"-"+i);
var secBizzMonths=this.secBizzMonths.map(i=>this.secBizzYear+"-"+i);
var bizzMonthAll=bizzMonths.concat(secBizzMonths);
return bizzMonthAll;
}
},
props:['xmProjectMBudgetCostUser','visible','selProject'],
watch: {
'xmProjectMBudgetCostUser':function( xmProjectMBudgetCostUser ) {
//this.addForm = xmProjectMBudgetCostUser;
},
'visible':function(visible) {
if(visible==true){
//
}
},
'bizzYear': function(year){
this.secBizzYear=parseInt(year)+1+"";
} ,
'totalBudgetCost': function(totalBudgetCost){
if(this.allMonths.length==0){
return ;
}
this.addForm.budgetCost=totalBudgetCost/this.allMonths.length;
},
'addForm.subjectId':function(subjectId) {
var dicts=this.dicts.projectSubject.filter(i=>i.id==subjectId)
if(options!=null && dicts.length>0){
this.addForm.subjectName=dicts[0].name
}else{
this.addForm.subjectName="";
}
}
},
data() {
var year=new Date().getFullYear();
var secYear=parseInt(year)+1;
return {
dicts:{
projectSubject:[],
},// 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 },//...
addFormRules: {
subjectId: [
{ required: true, message: '科目不能为空', trigger: 'blur' }
],
username: [
{ required: true, message: '姓名不能为空', trigger: 'blur' }
],
budgetCost: [
{ required: true, message: '金额不能为空', trigger: 'blur' }
]
},
totalBudgetCost:0,
bizzYear:year+'',
secBizzYear:secYear+'',
bizzMonths:[],
secBizzMonths:[],
bizzMonthList:['01','02','03','04','05','06','07','08','09','10','11','12'],
// xm_project_m_budget_cost_user
addForm: {
projectId:'',userid:'',budgetCost:'',id:'',remark:'',username:'',subjectId:'',bizzStartDate:'',bizzEndDate:'',bizzMonth:'',bizProcInstId:'',bizFlowState:'0',phaseId:'',costType:'1',subjectName:''
}
/**begin 在下面加自定义属性,记得补上面的一个逗号**/
/**end 在上面加自定义属性**/
}//end return
},//end data
methods: {
// @cancel="addFormVisible=false"
handleCancel:function(){
this.$refs['addForm'].resetFields();
this.$emit('cancel');
},
//XmProjectMBudgetCostUser xm_project_m_budget_cost_user @submit="afterAddSubmit"
addSubmit: function () {
if(this.bizzYear==null || this.bizzYear==''){
this.$notify({position:'bottom-left',showClose:true,message:"请选择需要分摊的年份", type: 'error' });
return;
}
var list=this.allMonths.map(i=>{
let params = Object.assign({}, this.addForm);
params.projectId=this.selProject.id
params.bizzMonth=i
return params;
});
this.$refs.addForm.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.add=true
batchAddXmProjectMBudgetCostUser(list).then((res) => {
this.load.add=false
var tips=res.data.tips;
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.add=false);
});
}
});
}
/**begin 在下面加自定义方法,记得补上面的一个逗号**/
/**end 在上面加自定义方法**/
},//end method
components: {
// 'xm-project-m-budget-cost-user-edit':XmProjectMBudgetCostUserEdit
},
mounted() {
//this.addForm=Object.assign(this.addForm, this.xmProjectMBudgetCostUser);
/**在下面写其它函数***/
initSimpleDicts('all',['projectSubject']).then(res=>{
this.dicts=res.data.data;
})
}//end mounted
}
</script>
<style scoped>
</style>

152
src/views/xm/core/xmProjectMBudgetCostUser/XmProjectMBudgetCostUserEdit.vue

@ -1,152 +0,0 @@
<template>
<section class="page-container padding border">
<el-row>
<!--编辑界面 XmProjectMBudgetCostUser xm_project_m_budget_cost_user-->
<el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editForm">
<el-form-item label="项目成员编号" prop="userid">
<el-input v-model="editForm.userid" placeholder="项目成员编号"></el-input>
</el-form-item>
<el-form-item label="用户名" prop="username">
<el-input v-model="editForm.username" placeholder="用户名"></el-input>
</el-form-item>
<el-form-item label="预算金额/每月" prop="budgetCost">
<el-input v-model="editForm.budgetCost" placeholder="预算金额/每月"></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="editForm.remark" placeholder="备注"></el-input>
</el-form-item>
<el-form-item label="预算科目" prop="subjectId">
<el-select placeholder="预算科目编号" v-model="editForm.subjectId">
<el-option
v-for="(item,i) in dicts.projectSubject"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="费用归属月份" prop="bizzMonth">
<el-input v-model="editForm.bizzMonth" placeholder="费用归属月份yyyy-mm"></el-input>
</el-form-item>
<el-form-item label="成本类型" prop="costType">
<template>
<el-radio v-model="editForm.costType" label="1">内部人力</el-radio>
<el-radio v-model="editForm.costType" label="2">外购人力</el-radio>
</template>
</el-form-item>
<el-form-item>
<el-col :span="24" :offset="8">
<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-col>
</el-form-item>
</el-form>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { editXmProjectMBudgetCostUser } from '@/api/xm/core/xmProjectMBudgetCostUser';
import { mapGetters } from 'vuex'
export default {
computed: {
...mapGetters([
'userInfo','roles'
])
},
props:['xmProjectMBudgetCostUser','visible'],
watch: {
'xmProjectMBudgetCostUser':function( xmProjectMBudgetCostUser ) {
this.editForm = xmProjectMBudgetCostUser;
},
'visible':function(visible) {
if(visible==true){
//
}
} ,
'editForm.subjectId':function(subjectId) {
console.log("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxlg" + subjectId);
var dicts=this.dicts.projectSubject.filter(i=>i.id==subjectId)
if(options!=null && dicts.length>0){
this.editForm.subjectName=dicts[0].name
}else{
this.editForm.subjectName="";
}
}
},
data() {
return {
dicts:{
projectSubject:[]
},// 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 },//...
editFormRules: {
subjectId: [
{ required: true, message: '科目不能为空', trigger: 'blur' }
],
username: [
{ required: true, message: '姓名不能为空', trigger: 'blur' }
],
budgetCost: [
{ required: true, message: '金额不能为空', trigger: 'blur' }
]
},
// XmProjectMBudgetCostUser xm_project_m_budget_cost_user
editForm: {
projectId:'',userid:'',budgetCost:'',id:'',remark:'',username:'',subjectId:'',bizzStartDate:'',bizzEndDate:'',bizzMonth:'',bizProcInstId:'',bizFlowState:'',phaseId:'',costType:'',subjectName:''
}
/**begin 在下面加自定义属性,记得补上面的一个逗号**/
/**end 在上面加自定义属性**/
}//end return
},//end data
methods: {
// @cancel="editFormVisible=false"
handleCancel:function(){
this.$refs['editForm'].resetFields();
this.$emit('cancel');
},
//XmProjectMBudgetCostUser xm_project_m_budget_cost_user@submit="afterEditSubmit"
editSubmit: function () {
this.$refs.editForm.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.edit=true
let params = Object.assign({}, this.editForm);
editXmProjectMBudgetCostUser(params).then((res) => {
this.load.edit=false
var tips=res.data.tips;
if(tips.isOk){
this.$refs['editForm'].resetFields();
this.$emit('submit');// @submit="afterEditSubmit"
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err =>this.load.edit=false);
});
}
});
}
/**begin 在下面加自定义方法,记得补上面的一个逗号**/
/**end 在上面加自定义方法**/
},//end method
components: {
// 'xm-project-m-budget-cost-user-edit':XmProjectMBudgetCostUserEdit
},
mounted() {
this.editForm=Object.assign(this.editForm, this.xmProjectMBudgetCostUser);
initSimpleDicts('all',['projectSubject']).then(res=>{
this.dicts=res.data.data;
})
}
}
</script>
<style scoped>
</style>

369
src/views/xm/core/xmProjectMBudgetCostUser/XmProjectMBudgetCostUserMng.vue

@ -1,369 +0,0 @@
<template>
<section class="page-container padding border">
<el-row>
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询">
<template slot="append">
<el-button type="primary" v-loading="load.list" :disabled="load.list==true" v-on:click="searchXmProjectMBudgetCostUsers" icon="el-icon-search">查询</el-button>
</template>
</el-input>
<el-button type="primary" v-if="batchEditVisible==false" @click="showAdd" icon="el-icon-plus"></el-button>
<el-button v-if="batchEditVisible==false" @click="batchEditVisible=true" icon="el-icon-edit"></el-button>
<el-button type="primary" v-if="batchEditVisible==true" @click="batchSave" icon="el-icon-finish">保存</el-button>
<el-button v-if="batchEditVisible==true" @click="noBatchEdit" icon="el-icon-back">返回</el-button>
<el-button type="danger" v-if="batchEditVisible==false" v-loading="load.del" @click="batchDel" :disabled="this.sels.length===0 || load.del==true" icon="el-icon-delete"></el-button>
<font class="hidden-md-and-down">
<span style="margin-left:10px;font-size:14px;">项目总预算</span><el-tag type='success'> {{selProject.planTotalCost}}</el-tag>
<span style="margin-left:10px;font-size:14px;">非人力总预算</span><el-tag type='warning'>{{selProject.planNouserAt}}</el-tag>
<span style="margin-left:10px;font-size:14px;">内部人力总预算</span><el-tag type='warning'>{{selProject.planIuserAt}}</el-tag>
<span style="margin-left:10px;font-size:14px;">外购人力总预算</span><el-tag type='warning'>{{selProject.planOuserAt}}</el-tag>
</font>
</el-row>
<el-row class="page-main ">
<!--列表 XmProjectMBudgetCostUser xm_project_m_budget_cost_user-->
<el-table ref="table" :height="tableHeight" :data="xmProjectMBudgetCostUsers" show-summary @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;">
<el-table-column sortable type="selection" width="60"></el-table-column>
<el-table-column sortable type="index" width="40"></el-table-column>
<el-table-column prop="username" label="用户名" min-width="80" >
<template slot-scope="scope">
<el-input v-if="batchEditVisible==true" v-model="scope.row.username" placeholder="用户名" @change="fieldChange(scope.row)"></el-input>
<div v-else>{{scope.row.username}}</div>
</template>
</el-table-column>
<el-table-column prop="subjectId" label="预算科目编号" min-width="80" >
<template slot-scope="scope">
<el-select :disabled="batchEditVisible==false" placeholder="预算科目编号" v-model="scope.row.subjectId" @change="fieldChange(scope.row)">
<el-option
v-for="(item,i) in dicts.projectSubject"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="budgetCost" label="预算金额" min-width="80" >
<template slot-scope="scope">
<el-input v-if="batchEditVisible==true" v-model="scope.row.budgetCost" type="number" placeholder="预算金额" @change="fieldChange(scope.row)"></el-input>
<div v-else>{{scope.row.budgetCost}}</div>
</template>
</el-table-column>
<el-table-column prop="bizzMonth" label="费用月份" min-width="80" >
<template slot-scope="scope">
<el-date-picker v-if="batchEditVisible==true" @change="fieldChange(scope.row)"
v-model="scope.row.bizzMonth"
type="month"
value-format="yyyy-MM"
placeholder="选择年月">
</el-date-picker>
<div v-else>{{scope.row.bizzMonth}}</div>
</template>
</el-table-column>
<el-table-column prop="costType" label="成本类型" min-width="80" >
<template slot-scope="scope">
<el-radio :disabled="batchEditVisible==false" @change="fieldChange(scope.row)" v-model="scope.row.costType" label="1">内部人力</el-radio>
<el-radio :disabled="batchEditVisible==false" @change="fieldChange(scope.row)" v-model="scope.row.costType" label="2">外购人力</el-radio>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" min-width="80" >
<template slot-scope="scope">
<el-input v-if="batchEditVisible==true" v-model="scope.row.remark" placeholder="备注" @change="fieldChange(scope.row)"></el-input>
<div v-else>{{scope.row.remark}}</div>
</template>
</el-table-column>
<el-table-column prop="bizFlowState" label="审批状态" min-width="80" ></el-table-column>
<el-table-column label="操作" width="160" fixed="right" v-if="batchEditVisible==false">
<template slot-scope="scope">
<el-button @click="showEdit( scope.row,scope.$index)"></el-button>
<el-button type="danger" @click="handleDel(scope.row,scope.$index)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination layout="total, sizes, prev, pager, next" @current-change="handleCurrentChange" @size-change="handleSizeChange" :page-sizes="[10,20, 50, 100, 500]" :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :total="pageInfo.total" style="float:right;"></el-pagination>
<!--编辑 XmProjectMBudgetCostUser xm_project_m_budget_cost_user界面-->
<el-drawer title="编辑人力预算明细" :visible.sync="editFormVisible" size="80%" append-to-body :close-on-click-modal="false">
<xm-project-m-budget-cost-user-edit :xm-project-m-budget-cost-user="editForm" :visible="editFormVisible" @cancel="editFormVisible=false" @submit="afterEditSubmit"></xm-project-m-budget-cost-user-edit>
</el-drawer>
<!--新增 XmProjectMBudgetCostUser xm_project_m_budget_cost_user界面-->
<el-drawer title="新增人力预算明细" :visible.sync="addFormVisible" size="80%" append-to-body :close-on-click-modal="false">
<xm-project-m-budget-cost-user-add :sel-project="selProject" :xm-project-m-budget-cost-user="addForm" :visible="addFormVisible" @cancel="addFormVisible=false" @submit="afterAddSubmit"></xm-project-m-budget-cost-user-add>
</el-drawer>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
//import Sticky from '@/components/Sticky' // header
import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { listXmProjectMBudgetCostUser, delXmProjectMBudgetCostUser, batchDelXmProjectMBudgetCostUser,batchEdit } from '@/api/xm/core/xmProjectMBudgetCostUser';
import XmProjectMBudgetCostUserAdd from './XmProjectMBudgetCostUserAdd';//
import XmProjectMBudgetCostUserEdit from './XmProjectMBudgetCostUserEdit';//
import { mapGetters } from 'vuex'
export default {
computed: {
...mapGetters([
'userInfo','roles'
])
},
props:["selProject",'budgetCostUser','fieldName','queryType','visible'],
watch:{
visible:function(visible){
if(visible==true){
this.getXmProjectMBudgetCostUsers();
}
}
},
data() {
return {
filters: {
key: ''
},
xmProjectMBudgetCostUsers: [],//
pageInfo:{//
total:0,//0>0
pageSize:10,//
count:false,//
pageNum:1,//1
orderFields:[],// ['sex','student_id']
orderDirs:[]// asc,desc ['asc','desc']
},
load:{ list: false, edit: false, del: false, add: false },//...
sels: [],//
dicts:{
projectSubject:[],
},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
addFormVisible: false,//xmProjectMBudgetCostUser
//xmProjectMBudgetCostUser
addForm: {
projectId:'',userid:'',budgetCost:'',id:'',remark:'',username:'',subjectId:'',bizzStartDate:'',bizzEndDate:'',bizzMonth:'',bizProcInstId:'',bizFlowState:'',phaseId:'',costType:''
},
editFormVisible: false,//
//xmProjectMBudgetCostUser
editForm: {
projectId:'',userid:'',budgetCost:'',id:'',remark:'',username:'',subjectId:'',bizzStartDate:'',bizzEndDate:'',bizzMonth:'',bizProcInstId:'',bizFlowState:'',phaseId:'',costType:''
},
/**begin 自定义属性请在下面加 请加备注**/
batchEditVisible:false,
valueChangeRows:[],
tableHeight:300,
/**end 自定义属性请在上面加 请加备注**/
}
},//end data
methods: {
handleSizeChange(pageSize) {
this.pageInfo.pageSize=pageSize;
this.getXmProjectMBudgetCostUsers();
},
handleCurrentChange(pageNum) {
this.pageInfo.pageNum = pageNum;
this.getXmProjectMBudgetCostUsers();
},
// obj.order=ascending/descending, asc/desc ; obj.prop=,
sortChange( obj ){
var dir='asc';
if(obj.order=='ascending'){
dir='asc'
}else{
dir='desc';
}
if(obj.prop=='xxx'){
this.pageInfo.orderFields=['xxx'];
this.pageInfo.orderDirs=[dir];
}
this.getXmProjectMBudgetCostUsers();
},
searchXmProjectMBudgetCostUsers(){
this.pageInfo.count=true;
this.getXmProjectMBudgetCostUsers();
},
// XmProjectMBudgetCostUser xm_project_m_budget_cost_user
getXmProjectMBudgetCostUsers() {
let params = {
pageSize: this.pageInfo.pageSize,
pageNum: this.pageInfo.pageNum,
total: this.pageInfo.total,
count:this.pageInfo.count
};
if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){
let orderBys=[];
for(var i=0;i<this.pageInfo.orderFields.length;i++){
orderBys.push(this.pageInfo.orderFields[i]+" "+this.pageInfo.orderDirs[i])
}
params.orderBy= orderBys.join(",")
}
if(this.filters.key!==""){
//params.xxx=this.filters.key
}else{
//params.xxx=xxxxx
}
if(this.queryType=='queryByBizzMonth'){
params.bizzMonth=this.fieldName
params.username=this.budgetCostUser.username
params.subjectId=this.budgetCostUser.subjectId
}else if(this.queryType=='queryByUsername'){
params.username=this.budgetCostUser.username
params.subjectId=this.budgetCostUser.subjectId
}else if(this.queryType=='queryBySubjectId'){
params.subjectId=this.budgetCostUser.subjectId
}
if(this.selProject!=null && this.selProject !=undefined){
params.projectId=this.selProject.id
}
this.load.list = true;
listXmProjectMBudgetCostUser(params).then((res) => {
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.total = res.data.total;
this.pageInfo.count=false;
this.xmProjectMBudgetCostUsers = res.data.data;
this.valueChangeRows=[];
}else{
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: 'error' });
}
this.load.list = false;
}).catch( err => this.load.list = false );
},
// XmProjectMBudgetCostUser xm_project_m_budget_cost_user
showEdit: function ( row,index ) {
this.editFormVisible = true;
this.editForm = Object.assign({}, row);
},
// XmProjectMBudgetCostUser xm_project_m_budget_cost_user
showAdd: function () {
this.addFormVisible = true;
//this.addForm=Object.assign({}, this.editForm);
},
afterAddSubmit(){
this.addFormVisible=false;
this.pageInfo.count=true;
this.getXmProjectMBudgetCostUsers();
},
afterEditSubmit(){
this.editFormVisible=false;
},
//xmProjectMBudgetCostUser
selsChange: function (sels) {
this.sels = sels;
},
//xmProjectMBudgetCostUser
handleDel: function (row,index) {
this.$confirm('确认删除该记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.load.del=true;
let params = { id: row.id };
delXmProjectMBudgetCostUser(params).then((res) => {
this.load.del=false;
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.count=true;
this.getXmProjectMBudgetCostUsers();
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.del=false );
});
},
//xmProjectMBudgetCostUser
batchDel: function () {
this.$confirm('确认删除选中记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.load.del=true;
batchDelXmProjectMBudgetCostUser(this.sels).then((res) => {
this.load.del=false;
var tips=res.data.tips;
if( tips.isOk ){
this.pageInfo.count=true;
this.getXmProjectMBudgetCostUsers();
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error'});
}).catch( err => this.load.del=false );
});
},
rowClick: function(row, event, column){
this.$emit('row-click',row, event, column);// @row-click="rowClick"
},
/**begin 自定义函数请在下面加**/
batchSave:function(){
if(this.valueChangeRows.length==0){
this.$notify({position:'bottom-left',showClose:true,message:"没有改变任何数据,无需保存", type: 'success'});
return;
}else {
this.load.edit=true;
batchEdit(this.valueChangeRows).then(res=>{
this.load.edit=false;
var tips =res.data.tips;
if(tips.isOk){
this.valueChangeRows=[]
this.getXmProjectMBudgetCostUsers();
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error'});
}).catch(e=>this.load.edit=false);
}
},
noBatchEdit: function(){
this.batchEditVisible=false;
this.valueChangeRows=[];
this.getXmProjectMBudgetCostUsers();
},
getFloatValue(value,digit){
if(value==null || value=='' || value==undefined){
value=0;
}
return parseFloat(value);
},
fieldChange:function(row,fieldName){
if(this.valueChangeRows.some(i=>i.id==row.id)){
return;
}else{
this.valueChangeRows.push(row)
}
console.log(JSON.stringify(row));
},
/**end 自定义函数请在上面加**/
},//end methods
components: {
'xm-project-m-budget-cost-user-add':XmProjectMBudgetCostUserAdd,
'xm-project-m-budget-cost-user-edit':XmProjectMBudgetCostUserEdit,
//
},
mounted() {
this.$nextTick(() => {
this.tableHeight = util.calcTableMaxHeight(".el-table");
this.getXmProjectMBudgetCostUsers();
});
initSimpleDicts('all',['projectSubject']).then(res=>{
this.dicts=res.data.data;
})
}
}
</script>
<style scoped>
</style>

145
src/views/xm/core/xmProjectMCostNouser/XmProjectMCostNouserAdd.vue

@ -1,145 +0,0 @@
<template>
<section class="page-container padding border">
<el-row>
<!--编辑界面 XmProjectMCostNouser xm_project_m_budget_cost_nouser-->
<el-form :model="addForm" label-width="120px" :rules="addFormRules" ref="addForm">
<el-form-item label="预算金额" prop="budgetCost">
<el-input v-model="addForm.budgetCost" placeholder="预算金额"></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="addForm.remark" placeholder="备注"></el-input>
</el-form-item>
<el-form-item label="预算科目" prop="subjectId">
<el-select placeholder="预算科目编号" v-model="addForm.subjectId">
<el-option
v-for="(item,i) in dicts.projectSubject"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="费用归属月份" prop="bizzMonth">
<el-input v-model="addForm.bizzMonth" placeholder="费用归属月份yyyy-mm"></el-input>
</el-form-item>
<el-form-item label="成本类型" prop="costType">
<template>
<el-radio v-model="addForm.costType" label="0">非人力</el-radio>
<el-radio v-model="addForm.costType" label="1">内部人力</el-radio>
<el-radio v-model="addForm.costType" label="2">外购人力</el-radio>
</template>
</el-form-item>
<el-form-item>
<el-col :span="24" :offset="8">
<el-button @click.native="handleCancel">取消</el-button>
<el-button v-loading="load.add" type="primary" @click.native="addSubmit" :disabled="load.add==true">提交</el-button>
</el-col>
</el-form-item>
</el-form>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { addXmProjectMCostNouser } from '@/api/xm/core/xmProjectMCostNouser';
import { mapGetters } from 'vuex'
export default {
computed: {
...mapGetters([
'userInfo','roles'
])
},
props:['xmProjectMCostNouser','visible'],
watch: {
'xmProjectMCostNouser':function( xmProjectMCostNouser ) {
this.addForm = xmProjectMCostNouser;
},
'visible':function(visible) {
if(visible==true){
//
}
},
'addForm.subjectId':function(subjectId) {
var dicts=this.dicts.projectSubject.filter(i=>i.id==subjectId)
if(options!=null && dicts.length>0){
this.addForm.subjectName=dicts[0].name
}else{
this.addForm.subjectName="";
}
}
},
data() {
return {
dicts:{
projectSubject:[]
},// 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 },//...
addFormRules: {
subjectId: [
{ required: true, message: '科目不能为空', trigger: 'blur' }
],
username: [
{ required: true, message: '姓名不能为空', trigger: 'blur' }
],
budgetCost: [
{ required: true, message: '金额不能为空', trigger: 'blur' }
]
},
// XmProjectMCostNouser xm_project_m_budget_cost_nouser
addForm: {
projectId:'',budgetCost:'',id:'',remark:'',subjectId:'',bizzStartDate:'',bizzEndDate:'',bizProcInstId:'',bizFlowState:'',phaseId:'',costType:'',bizzMonth:'',subjectName:''
}
/**begin 在下面加自定义属性,记得补上面的一个逗号**/
/**end 在上面加自定义属性**/
}//end return
},//end data
methods: {
// @cancel="addFormVisible=false"
handleCancel:function(){
this.$refs['addForm'].resetFields();
this.$emit('cancel');
},
//XmProjectMCostNouser xm_project_m_budget_cost_nouser@submit="afterEditSubmit"
addSubmit: function () {
this.$refs.addForm.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.add=true
let params = Object.assign({}, this.addForm);
addXmProjectMCostNouser(params).then((res) => {
this.load.add=false
var tips=res.data.tips;
if(tips.isOk){
this.$refs['addForm'].resetFields();
this.$emit('submit');// @submit="afterEditSubmit"
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err =>this.load.add=false);
});
}
});
}
/**begin 在下面加自定义方法,记得补上面的一个逗号**/
/**end 在上面加自定义方法**/
},//end method
components: {
// 'xm-project-m-budget-cost-nouser-add':XmProjectMCostNouserEdit
},
mounted() {
this.addForm=Object.assign(this.addForm, this.xmProjectMCostNouser);
initSimpleDicts('all',['projectSubject']).then(res=>{
this.dicts=res.data.data;
})
}
}
</script>
<style scoped>
</style>

166
src/views/xm/core/xmProjectMCostNouser/XmProjectMCostNouserEdit.vue

@ -1,166 +0,0 @@
<template>
<section class="page-container padding border">
<el-row>
<!--编辑界面 XmProjectMCostNouser xm_project_m_cost_nouser-->
<el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editForm">
<el-form-item label="项目编号" prop="projectId">
<el-input v-model="editForm.projectId" placeholder="项目编号"></el-input>
</el-form-item>
<el-form-item label="用户编号" prop="userid">
<el-input v-model="editForm.userid" placeholder="用户编号"></el-input>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.createTime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
<el-form-item label="费用发放时间" prop="sendCostTime">
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.sendCostTime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
<el-form-item label="用户名称" prop="username">
<el-input v-model="editForm.username" placeholder="用户名称"></el-input>
</el-form-item>
<el-form-item label="项目名称" prop="projectName">
<el-input v-model="editForm.projectName" placeholder="项目名称"></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="editForm.remark" placeholder="备注"></el-input>
</el-form-item>
<el-form-item label="主键" prop="id">
<el-input v-model="editForm.id" placeholder="主键"></el-input>
</el-form-item>
<el-form-item label="任务编号" prop="taskId">
<el-input v-model="editForm.taskId" placeholder="任务编号"></el-input>
</el-form-item>
<el-form-item label="任务名称" prop="taskName">
<el-input v-model="editForm.taskName" placeholder="任务名称"></el-input>
</el-form-item>
<el-form-item label="科目编号" prop="subjectId">
<el-input v-model="editForm.subjectId" placeholder="科目编号"></el-input>
</el-form-item>
<el-form-item label="费用归属周期开始日期" prop="bizzStartDate">
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.bizzStartDate" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
<el-form-item label="费用归属周期结束日期" prop="bizzEndDate">
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.bizzEndDate" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
<el-form-item label="当前流程实例编号" prop="bizProcInstId">
<el-input v-model="editForm.bizProcInstId" placeholder="当前流程实例编号"></el-input>
</el-form-item>
<el-form-item label="当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除" prop="bizFlowState">
<el-input v-model="editForm.bizFlowState" placeholder="当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除"></el-input>
</el-form-item>
<el-form-item label="项目计划计划编号" prop="phaseId">
<el-input v-model="editForm.phaseId" placeholder="项目计划计划编号"></el-input>
</el-form-item>
<el-form-item label="实际成本金额" prop="actCostAmount">
<el-input v-model="editForm.actCostAmount" placeholder="实际成本金额"></el-input>
</el-form-item>
<el-form-item label="成本类型0非人力1内部人力2外购人力" prop="costType">
<el-input v-model="editForm.costType" placeholder="成本类型0非人力1内部人力2外购人力"></el-input>
</el-form-item>
<el-form-item label="业务归属月份yyyy-mm" prop="bizMonth">
<el-input v-model="editForm.bizMonth" placeholder="业务归属月份yyyy-mm"></el-input>
</el-form-item>
<el-form-item label="业务归属日期yyyy-mm-dd" prop="bizDate">
<el-input v-model="editForm.bizDate" placeholder="业务归属日期yyyy-mm-dd"></el-input>
</el-form-item>
<el-form-item label="科目名称" prop="subjectName">
<el-input v-model="editForm.subjectName" placeholder="科目名称"></el-input>
</el-form-item>
<el-form-item label="计划名称" prop="projectPhaseName">
<el-input v-model="editForm.projectPhaseName" placeholder="计划名称"></el-input>
</el-form-item>
<el-form-item>
<el-col :span="24" :offset="8">
<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-col>
</el-form-item>
</el-form>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
//import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { editXmProjectMCostNouser } from '@/api/xm/core/xmProjectMCostNouser';
import { mapGetters } from 'vuex'
export default {
computed: {
...mapGetters([
'userInfo','roles'
])
},
props:['xmProjectMCostNouser','visible'],
watch: {
'xmProjectMCostNouser':function( xmProjectMCostNouser ) {
this.editForm = xmProjectMCostNouser;
},
'visible':function(visible) {
if(visible==true){
//
}
}
},
data() {
return {
dicts:{},// 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 },//...
editFormRules: {
id: [
//{ required: true, message: '', trigger: 'blur' }
]
},
// XmProjectMCostNouser xm_project_m_cost_nouser
editForm: {
projectId:'',userid:'',createTime:'',sendCostTime:'',username:'',projectName:'',remark:'',id:'',taskId:'',taskName:'',subjectId:'',bizzStartDate:'',bizzEndDate:'',bizProcInstId:'',bizFlowState:'',phaseId:'',actCostAmount:'',costType:'',bizMonth:'',bizDate:'',subjectName:'',projectPhaseName:''
}
/**begin 在下面加自定义属性,记得补上面的一个逗号**/
/**end 在上面加自定义属性**/
}//end return
},//end data
methods: {
// @cancel="editFormVisible=false"
handleCancel:function(){
this.$refs['editForm'].resetFields();
this.$emit('cancel');
},
//XmProjectMCostNouser xm_project_m_cost_nouser@submit="afterEditSubmit"
editSubmit: function () {
this.$refs.editForm.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.edit=true
let params = Object.assign({}, this.editForm);
editXmProjectMCostNouser(params).then((res) => {
this.load.edit=false
var tips=res.data.tips;
if(tips.isOk){
this.$refs['editForm'].resetFields();
this.$emit('submit');// @submit="afterEditSubmit"
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err =>this.load.edit=false);
});
}
});
}
/**begin 在下面加自定义方法,记得补上面的一个逗号**/
/**end 在上面加自定义方法**/
},//end method
components: {
// 'xm-project-m-cost-nouser-edit':XmProjectMCostNouserEdit
},
mounted() {
this.editForm=Object.assign(this.editForm, this.xmProjectMCostNouser);
}
}
</script>
<style scoped>
</style>

364
src/views/xm/core/xmProjectMCostNouser/XmProjectMCostNouserMng.vue

@ -1,364 +0,0 @@
<template>
<section class="page-container padding border">
<el-row>
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询">
<template slot="append">
<el-button type="primary" v-loading="load.list" :disabled="load.list==true" v-on:click="searchXmProjectMCostNousers" icon="el-icon-search">查询</el-button>
</template></el-input>
<el-button type="primary" v-if="batchEditVisible==false" @click="showAdd" icon="el-icon-plus"></el-button>
<el-button type="primary" v-if="batchEditVisible==false" @click="batchEditVisible=true" icon="el-icon-edit"></el-button>
<el-button type="primary" v-if="batchEditVisible==true" @click="batchSave" icon="el-icon-finish">保存</el-button>
<el-button type="primary" v-if="batchEditVisible==true" @click="noBatchEdit" icon="el-icon-back">返回</el-button>
<el-button type="danger" v-loading="load.del" @click="batchDel" :disabled="this.sels.length===0 || load.del==true" icon="el-icon-delete"></el-button>
<font class="hidden-md-and-down">
<span style="margin-left:10px;font-size:14px;">项目总成本</span><el-tag type='success'> {{selProject.planTotalCost}}</el-tag>
<span style="margin-left:10px;font-size:14px;">非人力总成本</span><el-tag type='warning'>{{selProject.planNouserAt}}</el-tag>
<span style="margin-left:10px;font-size:14px;">内部人力总成本</span><el-tag type='warning'>{{selProject.planIuserAt}}</el-tag>
<span style="margin-left:10px;font-size:14px;">外购人力总成本</span><el-tag type='warning'>{{selProject.planOuserAt}}</el-tag>
</font>
</el-row>
<el-row class="page-main ">
<!--列表 XmProjectMCostNouser xm_project_m_budget_cost_nouser-->
<el-table ref="table" :height="tableHeight" :data="xmProjectMCostNousers" show-summary @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;">
<el-table-column sortable type="selection" width="40"></el-table-column>
<el-table-column sortable type="index" width="40"></el-table-column>
<el-table-column prop="subjectId" label="成本科目编号" min-width="80" >
<template slot-scope="scope">
<el-select :disabled="batchEditVisible==false" placeholder="成本科目编号" v-model="scope.row.subjectId" @change="fieldChange(scope.row)">
<el-option
v-for="(item,i) in dicts.projectSubject"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="actCostAmount" label="成本金额" min-width="80" >
<template slot-scope="scope">
<el-input v-if="batchEditVisible==true" v-model="scope.row.actCostAmount" type="number" placeholder="成本金额" @change="fieldChange(scope.row)"></el-input>
<div v-else>{{scope.row.actCostAmount}}</div>
</template>
</el-table-column>
<el-table-column prop="bizMonth" label="费用月份" min-width="80" >
<template slot-scope="scope">
<el-date-picker v-if="batchEditVisible==true"
@change="fieldChange(scope.row)"
v-model="scope.row.bizMonth"
type="month"
value-format="yyyy-MM"
placeholder="选择年月">
</el-date-picker>
<div v-else>{{scope.row.bizMonth}}</div>
</template>
</el-table-column>
<el-table-column prop="costType" label="成本类型" min-width="80" >
<template slot-scope="scope">
<el-radio :disabled="batchEditVisible==false" @change="fieldChange(scope.row)" v-model="scope.row.costType" label="1">内部人力</el-radio>
<el-radio :disabled="batchEditVisible==false" @change="fieldChange(scope.row)" v-model="scope.row.costType" label="2">外购人力</el-radio>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" min-width="80" >
<template slot-scope="scope">
<el-input v-if="batchEditVisible==true" v-model="scope.row.remark" placeholder="备注" @change="fieldChange(scope.row)" ></el-input>
<div v-else>{{scope.row.remark}}</div>
</template>
</el-table-column>
<el-table-column prop="bizFlowState" label="当前审批状态" min-width="80" ></el-table-column>
<el-table-column label="操作" width="160" fixed="right" v-if="batchEditVisible==false">
<template slot-scope="scope">
<el-button @click="showEdit( scope.row,scope.$index)"></el-button>
<el-button type="danger" @click="handleDel(scope.row,scope.$index)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination layout="total, sizes, prev, pager, next" @current-change="handleCurrentChange" @size-change="handleSizeChange" :page-sizes="[10,20, 50, 100, 500]" :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :total="pageInfo.total" style="float:right;"></el-pagination>
<!--编辑 XmProjectMCostNouser xm_project_m_budget_cost_nouser界面-->
<el-drawer title="编辑非人力成本明细" :visible.sync="editFormVisible" size="80%" append-to-body :close-on-click-modal="false">
<xm-project-m-cost-nouser-edit :xm-project-m-cost-nouser="editForm" :visible="editFormVisible" @cancel="editFormVisible=false" @submit="afterEditSubmit"></xm-project-m-cost-nouser-edit>
</el-drawer>
<!--新增 XmProjectMCostNouser xm_project_m_budget_cost_nouser界面-->
<el-drawer title="新增非人力成本明细" :visible.sync="addFormVisible" size="80%" append-to-body :close-on-click-modal="false">
<xm-project-m-cost-nouser-add :sel-project="selProject" :xm-project-m-cost-nouser="addForm" :visible="addFormVisible" @cancel="addFormVisible=false" @submit="afterAddSubmit"></xm-project-m-cost-nouser-add>
</el-drawer>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
//import Sticky from '@/components/Sticky' // header
import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { listXmProjectMCostNouser, delXmProjectMCostNouser, batchDelXmProjectMCostNouser,batchEdit } from '@/api/xm/core/xmProjectMCostNouser';
import XmProjectMCostNouserAdd from './XmProjectMCostNouserAdd';//
import XmProjectMCostNouserEdit from './XmProjectMCostNouserEdit';//
import { mapGetters } from 'vuex'
export default {
computed: {
...mapGetters([
'userInfo','roles'
])
},
props:["selProject",'costNouser','fieldName','queryType','visible'],
watch:{
visible:function(visible){
if(visible==true){
this.getXmProjectMCostNousers();
}
}
},
data() {
return {
filters: {
key: ''
},
xmProjectMCostNousers: [],//
pageInfo:{//
total:0,//0>0
pageSize:10,//
count:false,//
pageNum:1,//1
orderFields:[],// ['sex','student_id']
orderDirs:[]// asc,desc ['asc','desc']
},
load:{ list: false, edit: false, del: false, add: false },//...
sels: [],//
dicts:{
projectSubject:[],
},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
addFormVisible: false,//xmProjectMCostNouser
//xmProjectMCostNouser
addForm: {
projectId:'',userid:'',createTime:'',sendCostTime:'',username:'',projectName:'',remark:'',id:'',taskId:'',taskName:'',subjectId:'',bizzStartDate:'',bizzEndDate:'',bizProcInstId:'',bizFlowState:'',phaseId:'',actCostAmount:'',costType:'',bizMonth:'',bizDate:'',subjectName:'',projectPhaseName:''
},
editFormVisible: false,//
//xmProjectMCostNouser
editForm: {
projectId:'',userid:'',createTime:'',sendCostTime:'',username:'',projectName:'',remark:'',id:'',taskId:'',taskName:'',subjectId:'',bizzStartDate:'',bizzEndDate:'',bizProcInstId:'',bizFlowState:'',phaseId:'',actCostAmount:'',costType:'',bizMonth:'',bizDate:'',subjectName:'',projectPhaseName:''
},
/**begin 自定义属性请在下面加 请加备注**/
batchEditVisible:false,
valueChangeRows:[],
tableHeight:300,
/**end 自定义属性请在上面加 请加备注**/
}
},//end data
methods: {
handleSizeChange(pageSize) {
this.pageInfo.pageSize=pageSize;
this.getXmProjectMCostNousers();
},
handleCurrentChange(pageNum) {
this.pageInfo.pageNum = pageNum;
this.getXmProjectMCostNousers();
},
// obj.order=ascending/descending, asc/desc ; obj.prop=,
sortChange( obj ){
var dir='asc';
if(obj.order=='ascending'){
dir='asc'
}else{
dir='desc';
}
if(obj.prop=='xxx'){
this.pageInfo.orderFields=['xxx'];
this.pageInfo.orderDirs=[dir];
}
this.getXmProjectMCostNousers();
},
searchXmProjectMCostNousers(){
this.pageInfo.count=true;
this.getXmProjectMCostNousers();
},
// XmProjectMCostNouser xm_project_m_budget_cost_nouser
getXmProjectMCostNousers() {
let params = {
pageSize: this.pageInfo.pageSize,
pageNum: this.pageInfo.pageNum,
total: this.pageInfo.total,
count:this.pageInfo.count
};
if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){
let orderBys=[];
for(var i=0;i<this.pageInfo.orderFields.length;i++){
orderBys.push(this.pageInfo.orderFields[i]+" "+this.pageInfo.orderDirs[i])
}
params.orderBy= orderBys.join(",")
}
if(this.filters.key!==""){
//params.xxx=this.filters.key
}else{
//params.xxx=xxxxx
}
if(this.queryType=='queryByBizzMonth'){
params.bizMonth=this.fieldName
params.username=this.costNouser.username
params.subjectId=this.costNouser.subjectId
}else if(this.queryType=='queryByUsername'){
params.username=this.costNouser.username
params.subjectId=this.costNouser.subjectId
}else if(this.queryType=='queryBySubjectId'){
params.subjectId=this.costNouser.subjectId
}
if(this.selProject!=null && this.selProject !=undefined){
params.projectId=this.selProject.id
}
this.load.list = true;
listXmProjectMCostNouser(params).then((res) => {
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.total = res.data.total;
this.pageInfo.count=false;
this.xmProjectMCostNousers = res.data.data;
this.valueChangeRows=[];
}else{
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: 'error' });
}
this.load.list = false;
}).catch( err => this.load.list = false );
},
// XmProjectMCostNouser xm_project_m_budget_cost_nouser
showEdit: function ( row,index ) {
this.editFormVisible = true;
this.editForm = Object.assign({}, row);
},
// XmProjectMCostNouser xm_project_m_budget_cost_nouser
showAdd: function () {
this.addFormVisible = true;
//this.addForm=Object.assign({}, this.editForm);
},
afterAddSubmit(){
this.addFormVisible=false;
this.pageInfo.count=true;
this.getXmProjectMCostNousers();
},
afterEditSubmit(){
this.editFormVisible=false;
},
//xmProjectMCostNouser
selsChange: function (sels) {
this.sels = sels;
},
//xmProjectMCostNouser
handleDel: function (row,index) {
this.$confirm('确认删除该记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.load.del=true;
let params = { id: row.id };
delXmProjectMCostNouser(params).then((res) => {
this.load.del=false;
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.count=true;
this.getXmProjectMCostNousers();
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.del=false );
});
},
//xmProjectMCostNouser
batchDel: function () {
this.$confirm('确认删除选中记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.load.del=true;
batchDelXmProjectMCostNouser(this.sels).then((res) => {
this.load.del=false;
var tips=res.data.tips;
if( tips.isOk ){
this.pageInfo.count=true;
this.getXmProjectMCostNousers();
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error'});
}).catch( err => this.load.del=false );
});
},
rowClick: function(row, event, column){
this.$emit('row-click',row, event, column);// @row-click="rowClick"
},
/**begin 自定义函数请在下面加**/
batchSave:function(){
if(this.valueChangeRows.length==0){
this.$notify({position:'bottom-left',showClose:true,message:"没有改变任何数据,无需保存", type: 'success'});
return;
}else {
this.load.edit=true;
batchEdit(this.valueChangeRows).then(res=>{
this.load.edit=false;
var tips =res.data.tips;
if(tips.isOk){
this.valueChangeRows=[]
this.getXmProjectMCostNousers();
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error'});
}).catch(e=>this.load.edit=false);
}
},
noBatchEdit: function(){
this.batchEditVisible=false;
this.valueChangeRows=[];
this.getXmProjectMCostNousers();
},
getFloatValue(value,digit){
if(value==null || value=='' || value==undefined){
value=0;
}
return parseFloat(value);
},
fieldChange:function(row,fieldName){
if(this.valueChangeRows.some(i=>i.id==row.id)){
return;
}else{
this.valueChangeRows.push(row)
}
console.log(JSON.stringify(row));
},
/**end 自定义函数请在上面加**/
},//end methods
components: {
'xm-project-m-cost-nouser-add':XmProjectMCostNouserAdd,
'xm-project-m-cost-nouser-edit':XmProjectMCostNouserEdit,
//
},
mounted() {
this.$nextTick(() => {
this.tableHeight = util.calcTableMaxHeight(".el-table");
this.getXmProjectMCostNousers();
});
initSimpleDicts('all',['projectSubject']).then(res=>{
this.dicts=res.data.data;
})
}
}
</script>
<style scoped>
</style>

167
src/views/xm/core/xmProjectMCostUser/XmProjectMCostUserAdd.vue

@ -1,167 +0,0 @@
<template>
<section class="page-container padding border">
<el-row>
<!--编辑界面 XmProjectMCostUser xm_project_m_budget_cost_user-->
<el-form :model="addForm" label-width="120px" :rules="addFormRules" ref="addForm">
<el-form-item label="项目成员编号" prop="userid">
<el-input v-model="addForm.userid" placeholder="项目成员编号"></el-input>
</el-form-item>
<el-form-item label="用户名" prop="username">
<el-input v-model="addForm.username" placeholder="用户名"></el-input>
</el-form-item>
<el-form-item label="成本科目" prop="subjectId">
<el-select placeholder="成本科目编号" v-model="addForm.subjectId">
<el-option
v-for="(item,i) in dicts.projectSubject"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="任务" prop="taskId">
<el-input v-model="addForm.taskId" placeholder="用户名"></el-input>
</el-form-item>
<el-form-item label="实际工作量" prop="actWorkload">
<el-input v-model="addForm.actWorkload" placeholder="用户名"></el-input>
</el-form-item>
<el-form-item label="成本金额" prop="actCostAmount">
<el-input v-model="addForm.actCostAmount" placeholder="成本金额"></el-input>
</el-form-item>
<el-form-item label="费用归属日期" prop="bizDate">
<el-input v-model="addForm.bizDate" placeholder="费用归属日期yyyy-mm-dd"></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="addForm.remark" placeholder="备注"></el-input>
</el-form-item>
<el-form-item label="成本类型" prop="costType">
<template>
<el-radio v-model="addForm.costType" label="1">内部人力</el-radio>
<el-radio v-model="addForm.costType" label="2">外购人力</el-radio>
</template>
</el-form-item>
<el-form-item>
<el-col :span="24" :offset="8">
<el-button @click.native="handleCancel">取消</el-button>
<el-button v-loading="load.add" type="primary" @click.native="addSubmit" :disabled="load.add==true">提交</el-button>
</el-col>
</el-form-item>
</el-form>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { addXmProjectMCostUser } from '@/api/xm/core/xmProjectMCostUser';
import { mapGetters } from 'vuex'
export default {
computed: {
...mapGetters([
'userInfo','roles'
])
},
props:['xmProjectMCostUser','visible'],
watch: {
'xmProjectMCostUser':function( xmProjectMCostUser ) {
this.addForm = xmProjectMCostUser;
},
'visible':function(visible) {
if(visible==true){
//
}
} ,
'addForm.subjectId':function(subjectId) {
console.log("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxlg" + subjectId);
var dicts=this.dicts.projectSubject.filter(i=>i.id==subjectId)
if(options!=null && dicts.length>0){
this.addForm.subjectName=dicts[0].name
}else{
this.addForm.subjectName="";
}
}
},
data() {
return {
dicts:{
projectSubject:[]
},// 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 },//...
addFormRules: {
subjectId: [
{ required: true, message: '科目不能为空', trigger: 'blur' }
],
username: [
{ required: true, message: '姓名不能为空', trigger: 'blur' }
],
actWorkload: [
{ required: true, message: '实际工作量不能为空', trigger: 'blur' }
],
taskId: [
{ required: true, message: '归属任务不能为空', trigger: 'blur' }
],
actCostAmount: [
{ required: true, message: '实际金额不能为空', trigger: 'blur' }
],
projectId: [
{ required: true, message: '归属项目不能为空', trigger: 'blur' }
]
},
// XmProjectMCostUser xm_project_m_budget_cost_user
addForm: {
subjectId:'',projectId:'',userid:'',createTime:'',sendCostTime:'',username:'',projectName:'',remark:'',id:'',taskId:'',taskName:'',actWorkload:'',bizzStartDate:'',bizzEndDate:'',bizProcInstId:'',bizFlowState:'',phaseId:'',actCostAmount:'',costType:'',bizMonth:'',bizDate:'',subjectName:'',projectPhaseName:''
}
/**begin 在下面加自定义属性,记得补上面的一个逗号**/
/**end 在上面加自定义属性**/
}//end return
},//end data
methods: {
// @cancel="addFormVisible=false"
handleCancel:function(){
this.$refs['addForm'].resetFields();
this.$emit('cancel');
},
//XmProjectMCostUser xm_project_m_budget_cost_user@submit="afterEditSubmit"
addSubmit: function () {
this.$refs.addForm.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.add=true
let params = Object.assign({}, this.addForm);
addXmProjectMCostUser(params).then((res) => {
this.load.add=false
var tips=res.data.tips;
if(tips.isOk){
this.$refs['addForm'].resetFields();
this.$emit('submit');// @submit="afterEditSubmit"
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err =>this.load.add=false);
});
}
});
}
/**begin 在下面加自定义方法,记得补上面的一个逗号**/
/**end 在上面加自定义方法**/
},//end method
components: {
// 'xm-project-m-budget-cost-user-add':XmProjectMCostUserEdit
},
mounted() {
this.addForm=Object.assign(this.addForm, this.xmProjectMCostUser);
initSimpleDicts('all',['projectSubject']).then(res=>{
this.dicts=res.data.data;
})
}
}
</script>
<style scoped>
</style>

169
src/views/xm/core/xmProjectMCostUser/XmProjectMCostUserEdit.vue

@ -1,169 +0,0 @@
<template>
<section class="page-container padding border">
<el-row>
<!--编辑界面 XmProjectMCostUser xm_project_m_cost_user-->
<el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editForm">
<el-form-item label="科目编号" prop="subjectId">
<el-input v-model="editForm.subjectId" placeholder="科目编号"></el-input>
</el-form-item>
<el-form-item label="项目编号" prop="projectId">
<el-input v-model="editForm.projectId" placeholder="项目编号"></el-input>
</el-form-item>
<el-form-item label="用户编号" prop="userid">
<el-input v-model="editForm.userid" placeholder="用户编号"></el-input>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.createTime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
<el-form-item label="费用发放时间" prop="sendCostTime">
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.sendCostTime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
<el-form-item label="用户名称" prop="username">
<el-input v-model="editForm.username" placeholder="用户名称"></el-input>
</el-form-item>
<el-form-item label="项目名称" prop="projectName">
<el-input v-model="editForm.projectName" placeholder="项目名称"></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="editForm.remark" placeholder="备注"></el-input>
</el-form-item>
<el-form-item label="主键" prop="id">
<el-input v-model="editForm.id" placeholder="主键"></el-input>
</el-form-item>
<el-form-item label="任务编号" prop="taskId">
<el-input v-model="editForm.taskId" placeholder="任务编号"></el-input>
</el-form-item>
<el-form-item label="任务名称" prop="taskName">
<el-input v-model="editForm.taskName" placeholder="任务名称"></el-input>
</el-form-item>
<el-form-item label="实际工时" prop="actWorkload">
<el-input v-model="editForm.actWorkload" placeholder="实际工时"></el-input>
</el-form-item>
<el-form-item label="费用归属周期开始日期" prop="bizzStartDate">
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.bizzStartDate" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
<el-form-item label="费用归属周期结束日期" prop="bizzEndDate">
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.bizzEndDate" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
<el-form-item label="当前流程实例编号" prop="bizProcInstId">
<el-input v-model="editForm.bizProcInstId" placeholder="当前流程实例编号"></el-input>
</el-form-item>
<el-form-item label="当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除" prop="bizFlowState">
<el-input v-model="editForm.bizFlowState" placeholder="当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除"></el-input>
</el-form-item>
<el-form-item label="项目计划计划编号" prop="phaseId">
<el-input v-model="editForm.phaseId" placeholder="项目计划计划编号"></el-input>
</el-form-item>
<el-form-item label="金额" prop="actCostAmount">
<el-input v-model="editForm.actCostAmount" placeholder="金额"></el-input>
</el-form-item>
<el-form-item label="成本类型0非人力1内部人力2外购人力" prop="costType">
<el-input v-model="editForm.costType" placeholder="成本类型0非人力1内部人力2外购人力"></el-input>
</el-form-item>
<el-form-item label="业务归属月份yyyy-mm" prop="bizMonth">
<el-input v-model="editForm.bizMonth" placeholder="业务归属月份yyyy-mm"></el-input>
</el-form-item>
<el-form-item label="业务归属日期yyyy-mm-dd" prop="bizDate">
<el-input v-model="editForm.bizDate" placeholder="业务归属日期yyyy-mm-dd"></el-input>
</el-form-item>
<el-form-item label="科目名称" prop="subjectName">
<el-input v-model="editForm.subjectName" placeholder="科目名称"></el-input>
</el-form-item>
<el-form-item label="计划名称" prop="projectPhaseName">
<el-input v-model="editForm.projectPhaseName" placeholder="计划名称"></el-input>
</el-form-item>
<el-form-item>
<el-col :span="24" :offset="8">
<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-col>
</el-form-item>
</el-form>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
//import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { editXmProjectMCostUser } from '@/api/xm/core/xmProjectMCostUser';
import { mapGetters } from 'vuex'
export default {
computed: {
...mapGetters([
'userInfo','roles'
])
},
props:['xmProjectMCostUser','visible'],
watch: {
'xmProjectMCostUser':function( xmProjectMCostUser ) {
this.editForm = xmProjectMCostUser;
},
'visible':function(visible) {
if(visible==true){
//
}
}
},
data() {
return {
dicts:{},// 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 },//...
editFormRules: {
id: [
//{ required: true, message: '', trigger: 'blur' }
]
},
// XmProjectMCostUser xm_project_m_cost_user
editForm: {
subjectId:'',projectId:'',userid:'',createTime:'',sendCostTime:'',username:'',projectName:'',remark:'',id:'',taskId:'',taskName:'',actWorkload:'',bizzStartDate:'',bizzEndDate:'',bizProcInstId:'',bizFlowState:'',phaseId:'',actCostAmount:'',costType:'',bizMonth:'',bizDate:'',subjectName:'',projectPhaseName:''
}
/**begin 在下面加自定义属性,记得补上面的一个逗号**/
/**end 在上面加自定义属性**/
}//end return
},//end data
methods: {
// @cancel="editFormVisible=false"
handleCancel:function(){
this.$refs['editForm'].resetFields();
this.$emit('cancel');
},
//XmProjectMCostUser xm_project_m_cost_user@submit="afterEditSubmit"
editSubmit: function () {
this.$refs.editForm.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.edit=true
let params = Object.assign({}, this.editForm);
editXmProjectMCostUser(params).then((res) => {
this.load.edit=false
var tips=res.data.tips;
if(tips.isOk){
this.$refs['editForm'].resetFields();
this.$emit('submit');// @submit="afterEditSubmit"
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err =>this.load.edit=false);
});
}
});
}
/**begin 在下面加自定义方法,记得补上面的一个逗号**/
/**end 在上面加自定义方法**/
},//end method
components: {
// 'xm-project-m-cost-user-edit':XmProjectMCostUserEdit
},
mounted() {
this.editForm=Object.assign(this.editForm, this.xmProjectMCostUser);
}
}
</script>
<style scoped>
</style>

258
src/views/xm/core/xmProjectMCostUser/XmProjectMCostUserList.vue

@ -1,258 +0,0 @@
<template>
<section class="page-container padding border">
<el-row>
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询"></el-input>
<el-button type="primary" v-loading="load.list" :disabled="load.list==true" v-on:click="searchXmProjectMCostUsers">查询</el-button>
</el-row>
<el-row class="page-main ">
<!--列表 XmProjectMCostUser xm_project_m_budget_cost_user-->
<el-table ref="table" :height="tableHeight" :data="xmProjectMCostUsers" show-summary @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;">
<el-table-column sortable type="selection" width="40"></el-table-column>
<el-table-column sortable type="index" width="40"></el-table-column>
<el-table-column prop="username" label="用户名" min-width="80" >
<template slot-scope="scope">
<el-input v-if="batchEditVisible==true" v-model="scope.row.username" placeholder="用户名" @change="fieldChange(scope.row)"></el-input>
<div v-else>{{scope.row.username}}</div>
</template>
</el-table-column>
<el-table-column prop="subjectId" label="成本科目编号" min-width="80" >
<template slot-scope="scope">
<el-select :disabled="batchEditVisible==false" placeholder="成本科目编号" v-model="scope.row.subjectId" @change="fieldChange(scope.row)">
<el-option
v-for="(item,i) in dicts.projectSubject"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="actCostAmount" label="成本金额" min-width="80" >
<template slot-scope="scope">
<el-input v-if="batchEditVisible==true" v-model="scope.row.actCostAmount" type="number" placeholder="成本金额" @change="fieldChange(scope.row)"></el-input>
<div v-else>{{scope.row.actCostAmount}}</div>
</template>
</el-table-column>
<el-table-column prop="bizMonth" label="费用月份" min-width="80" >
<template slot-scope="scope">
<el-date-picker v-if="batchEditVisible==true" @change="fieldChange(scope.row)"
v-model="scope.row.bizMonth"
type="month"
value-format="yyyy-MM"
placeholder="选择年月">
</el-date-picker>
<div v-else>{{scope.row.bizMonth}}</div>
</template>
</el-table-column>
<el-table-column prop="costType" label="成本类型" min-width="80" >
<template slot-scope="scope">
<el-radio :disabled="batchEditVisible==false" @change="fieldChange(scope.row)" v-model="scope.row.costType" label="1">内部人力</el-radio>
<el-radio :disabled="batchEditVisible==false" @change="fieldChange(scope.row)" v-model="scope.row.costType" label="2">外购人力</el-radio>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" min-width="80" >
<template slot-scope="scope">
<el-input v-if="batchEditVisible==true" v-model="scope.row.remark" placeholder="备注" @change="fieldChange(scope.row)"></el-input>
<div v-else>{{scope.row.remark}}</div>
</template>
</el-table-column>
<el-table-column prop="bizFlowState" label="审批状态" min-width="80" ></el-table-column>
<el-table-column label="操作" width="160" fixed="right" v-if="batchEditVisible==false">
<template slot-scope="scope">
<el-button @click="showEdit( scope.row,scope.$index)"></el-button>
<el-button type="danger" @click="handleDel(scope.row,scope.$index)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination layout="total, sizes, prev, pager, next" @current-change="handleCurrentChange" @size-change="handleSizeChange" :page-sizes="[10,20, 50, 100, 500]" :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :total="pageInfo.total" style="float:right;"></el-pagination>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
//import Sticky from '@/components/Sticky' // header
import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { listXmProjectMCostUser } from '@/api/xm/core/xmProjectMCostUser';
import { mapGetters } from 'vuex'
export default {
computed: {
...mapGetters([
'userInfo','roles'
])
},
props:['projectId','taskId','userid'],
watch:{
visible:function(visible){
if(visible==true){
this.getXmProjectMCostUsers();
}
}
},
data() {
return {
filters: {
key: ''
},
xmProjectMCostUsers: [],//
pageInfo:{//
total:0,//0>0
pageSize:10,//
count:false,//
pageNum:1,//1
orderFields:[],// ['sex','student_id']
orderDirs:[]// asc,desc ['asc','desc']
},
load:{ list: false, edit: false, del: false, add: false },//...
sels: [],//
dicts:{
projectSubject:[],
},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
addFormVisible: false,//xmProjectMCostUser
//xmProjectMCostUser
addForm: {
subjectId:'',projectId:'',userid:'',createTime:'',sendCostTime:'',username:'',projectName:'',remark:'',id:'',taskId:'',taskName:'',actWorkload:'',bizzStartDate:'',bizzEndDate:'',bizProcInstId:'',bizFlowState:'',phaseId:'',actCostAmount:'',costType:'',bizMonth:'',bizDate:'',subjectName:'',projectPhaseName:''
},
editFormVisible: false,//
//xmProjectMCostUser
editForm: {
subjectId:'',projectId:'',userid:'',createTime:'',sendCostTime:'',username:'',projectName:'',remark:'',id:'',taskId:'',taskName:'',actWorkload:'',bizzStartDate:'',bizzEndDate:'',bizProcInstId:'',bizFlowState:'',phaseId:'',actCostAmount:'',costType:'',bizMonth:'',bizDate:'',subjectName:'',projectPhaseName:''
},
tableHeight:300,
/**begin 自定义属性请在下面加 请加备注**/
/**end 自定义属性请在上面加 请加备注**/
}
},//end data
methods: {
handleSizeChange(pageSize) {
this.pageInfo.pageSize=pageSize;
this.getXmProjectMCostUsers();
},
handleCurrentChange(pageNum) {
this.pageInfo.pageNum = pageNum;
this.getXmProjectMCostUsers();
},
// obj.order=ascending/descending, asc/desc ; obj.prop=,
sortChange( obj ){
var dir='asc';
if(obj.order=='ascending'){
dir='asc'
}else{
dir='desc';
}
if(obj.prop=='xxx'){
this.pageInfo.orderFields=['xxx'];
this.pageInfo.orderDirs=[dir];
}
this.getXmProjectMCostUsers();
},
searchXmProjectMCostUsers(){
this.pageInfo.count=true;
this.getXmProjectMCostUsers();
},
// XmProjectMCostUser xm_project_m_budget_cost_user
getXmProjectMCostUsers() {
let params = {
pageSize: this.pageInfo.pageSize,
pageNum: this.pageInfo.pageNum,
total: this.pageInfo.total,
count:this.pageInfo.count
};
if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){
let orderBys=[];
for(var i=0;i<this.pageInfo.orderFields.length;i++){
orderBys.push(this.pageInfo.orderFields[i]+" "+this.pageInfo.orderDirs[i])
}
params.orderBy= orderBys.join(",")
}
if(this.filters.key!==""){
//params.xxx=this.filters.key
}else{
//params.xxx=xxxxx
}
if(this.projectId!=null && this.projectId !=undefined){
params.projectId=this.projectId
}
if(this.taskId!=null && this.taskId !=undefined){
params.taskId=this.taskId
}
if(this.userid!=null && this.userid !=undefined){
params.userid=this.userid
}
this.load.list = true;
listXmProjectMCostUser(params).then((res) => {
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.total = res.data.total;
this.pageInfo.count=false;
this.xmProjectMCostUsers = res.data.data;
}else{
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: 'error' });
}
this.load.list = false;
}).catch( err => this.load.list = false );
},
// XmProjectMCostUser xm_project_m_budget_cost_user
showEdit: function ( row,index ) {
this.editFormVisible = true;
this.editForm = Object.assign({}, row);
},
// XmProjectMCostUser xm_project_m_budget_cost_user
showAdd: function () {
this.addFormVisible = true;
//this.addForm=Object.assign({}, this.editForm);
},
afterAddSubmit(){
this.addFormVisible=false;
this.pageInfo.count=true;
this.getXmProjectMCostUsers();
},
afterEditSubmit(){
this.editFormVisible=false;
},
//xmProjectMCostUser
selsChange: function (sels) {
this.sels = sels;
},
rowClick: function(row, event, column){
this.$emit('row-click',row, event, column);// @row-click="rowClick"
},
/**begin 自定义函数请在下面加**/
/**end 自定义函数请在上面加**/
},//end methods
components: {
//
},
mounted() {
this.$nextTick(() => {
this.tableHeight = util.calcTableMaxHeight(".el-table");
this.getXmProjectMCostUsers();
});
initSimpleDicts('all',['projectSubject']).then(res=>{
this.dicts=res.data.data;
})
}
}
</script>
<style scoped>
</style>

363
src/views/xm/core/xmProjectMCostUser/XmProjectMCostUserMng.vue

@ -1,363 +0,0 @@
<template>
<section class="page-container padding border">
<el-row>
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询">
<template slot="append">
<el-button type="primary" v-loading="load.list" :disabled="load.list==true" v-on:click="searchXmProjectMCostUsers" icon="el-icon-search">查询</el-button>
</template>
</el-input>
<el-button type="primary" v-if="batchEditVisible==false" @click="showAdd" icon="el-icon-plus"></el-button>
<el-button v-if="batchEditVisible==false" @click="batchEditVisible=true" icon="el-icon-edit"></el-button>
<el-button type="primary" v-if="batchEditVisible==true" @click="batchSave" icon="el-icon-finish">保存</el-button>
<el-button v-if="batchEditVisible==true" @click="noBatchEdit" icon="el-icon-back">返回</el-button>
<el-button type="danger" v-if="batchEditVisible==false" v-loading="load.del" @click="batchDel" :disabled="this.sels.length===0 || load.del==true" icon="el-icon-delete"></el-button>
</el-row>
<el-row class="page-main ">
<!--列表 XmProjectMCostUser xm_project_m_budget_cost_user-->
<el-table ref="table" :height="tableHeight" :data="xmProjectMCostUsers" show-summary @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;">
<el-table-column sortable type="selection" width="60"></el-table-column>
<el-table-column sortable type="index" width="40"></el-table-column>
<el-table-column prop="username" label="用户名" min-width="80" >
<template slot-scope="scope">
<el-input v-if="batchEditVisible==true" v-model="scope.row.username" placeholder="用户名" @change="fieldChange(scope.row)"></el-input>
<div v-else>{{scope.row.username}}</div>
</template>
</el-table-column>
<el-table-column prop="subjectId" label="成本科目编号" min-width="80" >
<template slot-scope="scope">
<el-select :disabled="batchEditVisible==false" placeholder="成本科目编号" v-model="scope.row.subjectId" @change="fieldChange(scope.row)">
<el-option
v-for="(item,i) in dicts.projectSubject"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="actCostAmount" label="成本金额" min-width="80" >
<template slot-scope="scope">
<el-input v-if="batchEditVisible==true" v-model="scope.row.actCostAmount" type="number" placeholder="成本金额" @change="fieldChange(scope.row)"></el-input>
<div v-else>{{scope.row.actCostAmount}}</div>
</template>
</el-table-column>
<el-table-column prop="bizMonth" label="费用月份" min-width="80" >
<template slot-scope="scope">
<el-date-picker v-if="batchEditVisible==true" @change="fieldChange(scope.row)"
v-model="scope.row.bizMonth"
type="month"
value-format="yyyy-MM"
placeholder="选择年月">
</el-date-picker>
<div v-else>{{scope.row.bizMonth}}</div>
</template>
</el-table-column>
<el-table-column prop="costType" label="成本类型" min-width="80" >
<template slot-scope="scope">
<el-radio :disabled="batchEditVisible==false" @change="fieldChange(scope.row)" v-model="scope.row.costType" label="1">内部人力</el-radio>
<el-radio :disabled="batchEditVisible==false" @change="fieldChange(scope.row)" v-model="scope.row.costType" label="2">外购人力</el-radio>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" min-width="80" >
<template slot-scope="scope">
<el-input v-if="batchEditVisible==true" v-model="scope.row.remark" placeholder="备注" @change="fieldChange(scope.row)"></el-input>
<div v-else>{{scope.row.remark}}</div>
</template>
</el-table-column>
<el-table-column prop="bizFlowState" label="审批状态" min-width="80" ></el-table-column>
<el-table-column label="操作" width="160" fixed="right" v-if="batchEditVisible==false">
<template slot-scope="scope">
<el-button @click="showEdit( scope.row,scope.$index)"></el-button>
<el-button type="danger" @click="handleDel(scope.row,scope.$index)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination layout="total, sizes, prev, pager, next" @current-change="handleCurrentChange" @size-change="handleSizeChange" :page-sizes="[10,20, 50, 100, 500]" :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :total="pageInfo.total" style="float:right;"></el-pagination>
<!--编辑 XmProjectMCostUser xm_project_m_budget_cost_user界面-->
<el-drawer title="编辑人力成本明细" :visible.sync="editFormVisible" size="80%" append-to-body :close-on-click-modal="false">
<xm-project-m-cost-user-edit :xm-project-m-cost-user="editForm" :visible="editFormVisible" @cancel="editFormVisible=false" @submit="afterEditSubmit"></xm-project-m-cost-user-edit>
</el-drawer>
<!--新增 XmProjectMCostUser xm_project_m_budget_cost_user界面-->
<el-drawer title="新增人力成本明细" :visible.sync="addFormVisible" size="80%" append-to-body :close-on-click-modal="false">
<xm-project-m-cost-user-add :sel-project="selProject" :xm-project-m-cost-user="addForm" :visible="addFormVisible" @cancel="addFormVisible=false" @submit="afterAddSubmit"></xm-project-m-cost-user-add>
</el-drawer>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
//import Sticky from '@/components/Sticky' // header
import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { listXmProjectMCostUser, delXmProjectMCostUser, batchDelXmProjectMCostUser,batchEdit } from '@/api/xm/core/xmProjectMCostUser';
import XmProjectMCostUserAdd from './XmProjectMCostUserAdd';//
import XmProjectMCostUserEdit from './XmProjectMCostUserEdit';//
import { mapGetters } from 'vuex'
export default {
computed: {
...mapGetters([
'userInfo','roles'
])
},
props:["selProject",'costUser','fieldName','queryType','visible'],
watch:{
visible:function(visible){
if(visible==true){
this.getXmProjectMCostUsers();
}
}
},
data() {
return {
filters: {
key: ''
},
xmProjectMCostUsers: [],//
pageInfo:{//
total:0,//0>0
pageSize:10,//
count:false,//
pageNum:1,//1
orderFields:[],// ['sex','student_id']
orderDirs:[]// asc,desc ['asc','desc']
},
load:{ list: false, edit: false, del: false, add: false },//...
sels: [],//
dicts:{
projectSubject:[],
},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
addFormVisible: false,//xmProjectMCostUser
//xmProjectMCostUser
addForm: {
subjectId:'',projectId:'',userid:'',createTime:'',sendCostTime:'',username:'',projectName:'',remark:'',id:'',taskId:'',taskName:'',actWorkload:'',bizzStartDate:'',bizzEndDate:'',bizProcInstId:'',bizFlowState:'',phaseId:'',actCostAmount:'',costType:'',bizMonth:'',bizDate:'',subjectName:'',projectPhaseName:''
},
editFormVisible: false,//
//xmProjectMCostUser
editForm: {
subjectId:'',projectId:'',userid:'',createTime:'',sendCostTime:'',username:'',projectName:'',remark:'',id:'',taskId:'',taskName:'',actWorkload:'',bizzStartDate:'',bizzEndDate:'',bizProcInstId:'',bizFlowState:'',phaseId:'',actCostAmount:'',costType:'',bizMonth:'',bizDate:'',subjectName:'',projectPhaseName:''
},
/**begin 自定义属性请在下面加 请加备注**/
batchEditVisible:false,
valueChangeRows:[],
tableHeight:300,
/**end 自定义属性请在上面加 请加备注**/
}
},//end data
methods: {
handleSizeChange(pageSize) {
this.pageInfo.pageSize=pageSize;
this.getXmProjectMCostUsers();
},
handleCurrentChange(pageNum) {
this.pageInfo.pageNum = pageNum;
this.getXmProjectMCostUsers();
},
// obj.order=ascending/descending, asc/desc ; obj.prop=,
sortChange( obj ){
var dir='asc';
if(obj.order=='ascending'){
dir='asc'
}else{
dir='desc';
}
if(obj.prop=='xxx'){
this.pageInfo.orderFields=['xxx'];
this.pageInfo.orderDirs=[dir];
}
this.getXmProjectMCostUsers();
},
searchXmProjectMCostUsers(){
this.pageInfo.count=true;
this.getXmProjectMCostUsers();
},
// XmProjectMCostUser xm_project_m_budget_cost_user
getXmProjectMCostUsers() {
let params = {
pageSize: this.pageInfo.pageSize,
pageNum: this.pageInfo.pageNum,
total: this.pageInfo.total,
count:this.pageInfo.count
};
if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){
let orderBys=[];
for(var i=0;i<this.pageInfo.orderFields.length;i++){
orderBys.push(this.pageInfo.orderFields[i]+" "+this.pageInfo.orderDirs[i])
}
params.orderBy= orderBys.join(",")
}
if(this.filters.key!==""){
//params.xxx=this.filters.key
}else{
//params.xxx=xxxxx
}
if(this.queryType=='queryByBizzMonth'){
params.bizMonth=this.fieldName
params.username=this.costUser.username
params.subjectId=this.costUser.subjectId
}else if(this.queryType=='queryByUsername'){
params.username=this.costUser.username
params.subjectId=this.costUser.subjectId
}else if(this.queryType=='queryBySubjectId'){
params.subjectId=this.costUser.subjectId
}
if(this.selProject!=null && this.selProject !=undefined){
params.projectId=this.selProject.id
}
this.load.list = true;
listXmProjectMCostUser(params).then((res) => {
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.total = res.data.total;
this.pageInfo.count=false;
this.xmProjectMCostUsers = res.data.data;
this.valueChangeRows=[];
}else{
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: 'error' });
}
this.load.list = false;
}).catch( err => this.load.list = false );
},
// XmProjectMCostUser xm_project_m_budget_cost_user
showEdit: function ( row,index ) {
this.editFormVisible = true;
this.editForm = Object.assign({}, row);
},
// XmProjectMCostUser xm_project_m_budget_cost_user
showAdd: function () {
this.addFormVisible = true;
//this.addForm=Object.assign({}, this.editForm);
},
afterAddSubmit(){
this.addFormVisible=false;
this.pageInfo.count=true;
this.getXmProjectMCostUsers();
},
afterEditSubmit(){
this.editFormVisible=false;
},
//xmProjectMCostUser
selsChange: function (sels) {
this.sels = sels;
},
//xmProjectMCostUser
handleDel: function (row,index) {
this.$confirm('确认删除该记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.load.del=true;
let params = { id: row.id };
delXmProjectMCostUser(params).then((res) => {
this.load.del=false;
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.count=true;
this.getXmProjectMCostUsers();
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.del=false );
});
},
//xmProjectMCostUser
batchDel: function () {
this.$confirm('确认删除选中记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.load.del=true;
batchDelXmProjectMCostUser(this.sels).then((res) => {
this.load.del=false;
var tips=res.data.tips;
if( tips.isOk ){
this.pageInfo.count=true;
this.getXmProjectMCostUsers();
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error'});
}).catch( err => this.load.del=false );
});
},
rowClick: function(row, event, column){
this.$emit('row-click',row, event, column);// @row-click="rowClick"
},
/**begin 自定义函数请在下面加**/
batchSave:function(){
if(this.valueChangeRows.length==0){
this.$notify({position:'bottom-left',showClose:true,message:"没有改变任何数据,无需保存", type: 'success'});
return;
}else {
this.load.edit=true;
batchEdit(this.valueChangeRows).then(res=>{
this.load.edit=false;
var tips =res.data.tips;
if(tips.isOk){
this.valueChangeRows=[]
this.getXmProjectMCostUsers();
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error'});
}).catch(e=>this.load.edit=false);
}
},
noBatchEdit: function(){
this.batchEditVisible=false;
this.valueChangeRows=[];
this.getXmProjectMCostUsers();
},
getFloatValue(value,digit){
if(value==null || value=='' || value==undefined){
value=0;
}
return parseFloat(value);
},
fieldChange:function(row,fieldName){
if(this.valueChangeRows.some(i=>i.id==row.id)){
return;
}else{
this.valueChangeRows.push(row)
}
console.log(JSON.stringify(row));
},
/**end 自定义函数请在上面加**/
},//end methods
components: {
'xm-project-m-cost-user-add':XmProjectMCostUserAdd,
'xm-project-m-cost-user-edit':XmProjectMCostUserEdit,
//
},
mounted() {
this.$nextTick(() => {
this.tableHeight = util.calcTableMaxHeight(".el-table");
this.getXmProjectMCostUsers();
});
initSimpleDicts('all',['projectSubject']).then(res=>{
this.dicts=res.data.data;
})
}
}
</script>
<style scoped>
</style>

7
src/views/xm/core/xmTaskExecuser/XmTaskExecuserForTask.vue

@ -132,8 +132,7 @@
import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { listXmTaskExecuser,editXmTaskExecuser,leaveTask,beExecutor,settleExec, delXmTaskExecuser, batchDelXmTaskExecuser,quotePrice,becomeCandidate,toTest,testSuccess,testFail } from '@/api/xm/core/xmTaskExecuser';
import XmTaskExecuserAdd from './XmTaskExecuserAdd';//
import XmTaskExecuserEdit from './XmTaskExecuserEdit';//
import XmProjectMCostUserList from '../xmProjectMCostUser/XmProjectMCostUserList';
import XmTaskExecuserEdit from './XmTaskExecuserEdit';//
import { mapGetters } from 'vuex'
import html2canvas from 'html2canvas'
import { uploadBase64 } from '@/api/mdp/arc/image';
@ -730,9 +729,7 @@
},//end methods
components: {
'xm-task-execuser-add':XmTaskExecuserAdd,
'xm-task-execuser-edit':XmTaskExecuserEdit,
XmProjectMCostUserList,
'xm-task-execuser-edit':XmTaskExecuserEdit,
//
},
mounted() {

7
src/views/xm/core/xmTaskExecuser/XmTaskExecuserMng.vue

@ -176,8 +176,7 @@
import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { listXmTaskExecuserWithTask,editXmTaskExecuser,leaveTask,beExecutor,settleExec, delXmTaskExecuser, batchDelXmTaskExecuser,quotePrice,becomeCandidate,toTest,testSuccess,testFail } from '@/api/xm/core/xmTaskExecuser';
import XmTaskExecuserAdd from './XmTaskExecuserAdd';//
import XmTaskExecuserEdit from './XmTaskExecuserEdit';//
import XmProjectMCostUserList from '../xmProjectMCostUser/XmProjectMCostUserList';
import XmTaskExecuserEdit from './XmTaskExecuserEdit';//
import { mapGetters } from 'vuex'
import html2canvas from 'html2canvas'
import { uploadBase64 } from '@/api/mdp/arc/image';
@ -829,9 +828,7 @@
},//end methods
components: {
'xm-task-execuser-add':XmTaskExecuserAdd,
'xm-task-execuser-edit':XmTaskExecuserEdit,
XmProjectMCostUserList,XmTaskWorkloadEdit,
'xm-task-execuser-edit':XmTaskExecuserEdit, XmTaskWorkloadEdit,
//
},
mounted() {

Loading…
Cancel
Save