9 changed files with 1736 additions and 0 deletions
-
44src/api/xm/core/xmBudgetLabor.js
-
44src/api/xm/core/xmBudgetNlabor.js
-
44src/api/xm/core/xmCostNlabor.js
-
176src/views/xm/core/xmBudgetLabor/XmBudgetLaborEdit.vue
-
356src/views/xm/core/xmBudgetLabor/XmBudgetLaborMng.vue
-
167src/views/xm/core/xmBudgetNlabor/XmBudgetNlaborEdit.vue
-
341src/views/xm/core/xmBudgetNlabor/XmBudgetNlaborMng.vue
-
188src/views/xm/core/xmCostNlabor/XmCostNlaborEdit.vue
-
376src/views/xm/core/xmCostNlabor/XmCostNlaborMng.vue
@ -0,0 +1,44 @@ |
|||||
|
import axios from '@/utils/request' |
||||
|
|
||||
|
import { getDicts,initSimpleDicts,initComplexDicts } from '@/api/mdp/meta/item';//字典表
|
||||
|
import config from '@/common/config' |
||||
|
|
||||
|
let base = config.getCoreBasePath(); |
||||
|
|
||||
|
/**-------------------------与后端通讯接口------------------请写在下面-------------------------------------------- */ |
||||
|
/** |
||||
|
* 项目人力成本预算 |
||||
|
*1 默认只开放普通查询,所有查询,只要上传 分页参数 {pageNum:当前页码从1开始,pageSize:每页记录数,total:总记录【数如果是0后台会自动计算总记录数非0不会自动计算】},后台都会自动按分页查询 其它 api用到再打开,没用到的api请注释掉, |
||||
|
*2 查询、新增、修改的参数格式 params={id:'主键 主键',projectId:'项目编号',userid:'项目成员编号',budgetAt:'预算金额/每月',remark:'备注',username:'用户名',subjectId:'预算科目编号',bizSdate:'费用归属周期开始日期',bizEdate:'费用归属周期结束日期',bizMonth:'费用归属月份yyyy-mm',instId:'当前流程实例编号',bizFlowState:'当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除',costType:'成本类型0非人力1内部人力2外购人力',subjectName:'科目名称',branchId:'项目归属机构编号',ubranchId:'用户归属机构编号-也就是将来的结算对象'} |
||||
|
**/ |
||||
|
|
||||
|
//普通查询 条件之间and关系
|
||||
|
export const listXmBudgetLabor = params => { return axios.get(`${base}/xm/core/xmBudgetLabor/list`, { params: params }); }; |
||||
|
|
||||
|
//删除一条项目人力成本预算 params={id:'主键 主键'}
|
||||
|
export const delXmBudgetLabor = params => { return axios.post(`${base}/xm/core/xmBudgetLabor/del`,params); }; |
||||
|
|
||||
|
//批量删除项目人力成本预算 params=[{id:'主键 主键'}]
|
||||
|
export const batchDelXmBudgetLabor = params => { return axios.post(`${base}/xm/core/xmBudgetLabor/batchDel`, params); }; |
||||
|
|
||||
|
//修改一条项目人力成本预算记录
|
||||
|
export const editXmBudgetLabor = params => { return axios.post(`${base}/xm/core/xmBudgetLabor/edit`, params); }; |
||||
|
|
||||
|
//新增一条项目人力成本预算
|
||||
|
export const addXmBudgetLabor = params => { return axios.post(`${base}/xm/core/xmBudgetLabor/add`, params); }; |
||||
|
|
||||
|
//批量修改某些字段
|
||||
|
export const editSomeFieldsXmBudgetLabor = params => { return axios.post(`${base}/xm/core/xmBudgetLabor/editSomeFields`, params); }; |
||||
|
|
||||
|
|
||||
|
|
||||
|
/**-------------------------前端mng|add|edit界面公共函数---------------请写在下面----------------------------------------------- */ |
||||
|
//初始化页面上的字典
|
||||
|
export const initDicts = (that) => { |
||||
|
var itemCodes=[];//在此添加要加载的字典 如['sex','grade','lvl']
|
||||
|
if(itemCodes.length>0){ |
||||
|
initSimpleDicts('all',itemCodes).then(res=>{ |
||||
|
Object.assign(that.dicts,res.data.data) |
||||
|
}); |
||||
|
} |
||||
|
}; |
||||
@ -0,0 +1,44 @@ |
|||||
|
import axios from '@/utils/request' |
||||
|
|
||||
|
import { getDicts,initSimpleDicts,initComplexDicts } from '@/api/mdp/meta/item';//字典表
|
||||
|
import config from '@/common/config' |
||||
|
|
||||
|
let base = config.getCoreBasePath(); |
||||
|
|
||||
|
/**-------------------------与后端通讯接口------------------请写在下面-------------------------------------------- */ |
||||
|
/** |
||||
|
* 项目人力成本预算 |
||||
|
*1 默认只开放普通查询,所有查询,只要上传 分页参数 {pageNum:当前页码从1开始,pageSize:每页记录数,total:总记录【数如果是0后台会自动计算总记录数非0不会自动计算】},后台都会自动按分页查询 其它 api用到再打开,没用到的api请注释掉, |
||||
|
*2 查询、新增、修改的参数格式 params={id:'主键 主键',projectId:'项目编号',budgetAt:'预算金额',remark:'备注',subjectId:'预算科目',bizSdate:'费用归属周期开始日期',bizEdate:'费用归属周期结束日期',instId:'当前流程实例编号',bizFlowState:'当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除',costType:'成本类型0非人力1内部人力2外购人力',bizMonth:'费用归属月份yyyy-MM',subjectName:'科目名称',branchId:'项目归属企业编号'} |
||||
|
**/ |
||||
|
|
||||
|
//普通查询 条件之间and关系
|
||||
|
export const listXmBudgetNlabor = params => { return axios.get(`${base}/xm/core/xmBudgetNlabor/list`, { params: params }); }; |
||||
|
|
||||
|
//删除一条项目人力成本预算 params={id:'主键 主键'}
|
||||
|
export const delXmBudgetNlabor = params => { return axios.post(`${base}/xm/core/xmBudgetNlabor/del`,params); }; |
||||
|
|
||||
|
//批量删除项目人力成本预算 params=[{id:'主键 主键'}]
|
||||
|
export const batchDelXmBudgetNlabor = params => { return axios.post(`${base}/xm/core/xmBudgetNlabor/batchDel`, params); }; |
||||
|
|
||||
|
//修改一条项目人力成本预算记录
|
||||
|
export const editXmBudgetNlabor = params => { return axios.post(`${base}/xm/core/xmBudgetNlabor/edit`, params); }; |
||||
|
|
||||
|
//新增一条项目人力成本预算
|
||||
|
export const addXmBudgetNlabor = params => { return axios.post(`${base}/xm/core/xmBudgetNlabor/add`, params); }; |
||||
|
|
||||
|
//批量修改某些字段
|
||||
|
export const editSomeFieldsXmBudgetNlabor = params => { return axios.post(`${base}/xm/core/xmBudgetNlabor/editSomeFields`, params); }; |
||||
|
|
||||
|
|
||||
|
|
||||
|
/**-------------------------前端mng|add|edit界面公共函数---------------请写在下面----------------------------------------------- */ |
||||
|
//初始化页面上的字典
|
||||
|
export const initDicts = (that) => { |
||||
|
var itemCodes=[];//在此添加要加载的字典 如['sex','grade','lvl']
|
||||
|
if(itemCodes.length>0){ |
||||
|
initSimpleDicts('all',itemCodes).then(res=>{ |
||||
|
Object.assign(that.dicts,res.data.data) |
||||
|
}); |
||||
|
} |
||||
|
}; |
||||
@ -0,0 +1,44 @@ |
|||||
|
import axios from '@/utils/request' |
||||
|
|
||||
|
import { getDicts,initSimpleDicts,initComplexDicts } from '@/api/mdp/meta/item';//字典表
|
||||
|
import config from '@/common/config' |
||||
|
|
||||
|
let base = config.getCoreBasePath(); |
||||
|
|
||||
|
/**-------------------------与后端通讯接口------------------请写在下面-------------------------------------------- */ |
||||
|
/** |
||||
|
* 项目实际人工成本费用 |
||||
|
*1 默认只开放普通查询,所有查询,只要上传 分页参数 {pageNum:当前页码从1开始,pageSize:每页记录数,total:总记录【数如果是0后台会自动计算总记录数非0不会自动计算】},后台都会自动按分页查询 其它 api用到再打开,没用到的api请注释掉, |
||||
|
*2 查询、新增、修改的参数格式 params={id:'主键 主键',projectId:'项目编号',userid:'用户编号-费用主责人',ctime:'创建时间',sendTime:'费用发放时间',username:'用户名称',projectName:'项目名称',remark:'备注',taskId:'任务编号',taskName:'任务名称',subjectId:'科目编号',bizSdate:'费用归属周期开始日期',bizEdate:'费用归属周期结束日期',actAt:'实际成本金额',costType:'成本类型0非人力1内部人力2外购人力,此表都是非人力',bizMonth:'业务归属月份yyyy-MM',bizDate:'业务归属日期yyyy-MM-dd',subjectName:'科目名称',ubranchId:'用户归属机构',branchId:'项目归属机构'} |
||||
|
**/ |
||||
|
|
||||
|
//普通查询 条件之间and关系
|
||||
|
export const listXmCostNlabor = params => { return axios.get(`${base}/xm/core/xmCostNlabor/list`, { params: params }); }; |
||||
|
|
||||
|
//删除一条项目实际人工成本费用 params={id:'主键 主键'}
|
||||
|
export const delXmCostNlabor = params => { return axios.post(`${base}/xm/core/xmCostNlabor/del`,params); }; |
||||
|
|
||||
|
//批量删除项目实际人工成本费用 params=[{id:'主键 主键'}]
|
||||
|
export const batchDelXmCostNlabor = params => { return axios.post(`${base}/xm/core/xmCostNlabor/batchDel`, params); }; |
||||
|
|
||||
|
//修改一条项目实际人工成本费用记录
|
||||
|
export const editXmCostNlabor = params => { return axios.post(`${base}/xm/core/xmCostNlabor/edit`, params); }; |
||||
|
|
||||
|
//新增一条项目实际人工成本费用
|
||||
|
export const addXmCostNlabor = params => { return axios.post(`${base}/xm/core/xmCostNlabor/add`, params); }; |
||||
|
|
||||
|
//批量修改某些字段
|
||||
|
export const editSomeFieldsXmCostNlabor = params => { return axios.post(`${base}/xm/core/xmCostNlabor/editSomeFields`, params); }; |
||||
|
|
||||
|
|
||||
|
|
||||
|
/**-------------------------前端mng|add|edit界面公共函数---------------请写在下面----------------------------------------------- */ |
||||
|
//初始化页面上的字典
|
||||
|
export const initDicts = (that) => { |
||||
|
var itemCodes=[];//在此添加要加载的字典 如['sex','grade','lvl']
|
||||
|
if(itemCodes.length>0){ |
||||
|
initSimpleDicts('all',itemCodes).then(res=>{ |
||||
|
Object.assign(that.dicts,res.data.data) |
||||
|
}); |
||||
|
} |
||||
|
}; |
||||
@ -0,0 +1,176 @@ |
|||||
|
<template> |
||||
|
<section class="page-container padding"> |
||||
|
<el-row class="page-header"> |
||||
|
</el-row> |
||||
|
<el-row class="page-main" :style="{overflowX:'auto',height:maxTableHeight+'px'}" ref="table"> |
||||
|
<!--编辑界面 XmBudgetLabor 项目人力成本预算--> |
||||
|
<el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editFormRef"> |
||||
|
<el-form-item label="项目编号" prop="projectId"> |
||||
|
<el-input v-model="editForm.projectId" placeholder="项目编号" :maxlength="50"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="项目成员编号" prop="userid"> |
||||
|
<el-input v-model="editForm.userid" placeholder="项目成员编号" :maxlength="50"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="预算金额/每月" prop="budgetAt"> |
||||
|
<el-input v-model="editForm.budgetAt" placeholder="预算金额/每月" :maxlength="10"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="主键" prop="id"> |
||||
|
<el-input v-model="editForm.id" placeholder="主键" :maxlength="50"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="备注" prop="remark"> |
||||
|
<el-input v-model="editForm.remark" placeholder="备注" :maxlength="255"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="用户名" prop="username"> |
||||
|
<el-input v-model="editForm.username" placeholder="用户名" :maxlength="255"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="预算科目编号" prop="subjectId"> |
||||
|
<el-input v-model="editForm.subjectId" placeholder="预算科目编号" :maxlength="50"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="费用归属周期开始日期" prop="bizSdate"> |
||||
|
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.bizSdate" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="费用归属周期结束日期" prop="bizEdate"> |
||||
|
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.bizEdate" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="费用归属月份yyyy-mm" prop="bizMonth"> |
||||
|
<el-input v-model="editForm.bizMonth" placeholder="费用归属月份yyyy-mm" :maxlength="10"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="当前流程实例编号" prop="instId"> |
||||
|
<el-input v-model="editForm.instId" placeholder="当前流程实例编号" :maxlength="50"></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流程取消或者删除" :maxlength="1"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="成本类型0非人力1内部人力2外购人力" prop="costType"> |
||||
|
<el-input v-model="editForm.costType" placeholder="成本类型0非人力1内部人力2外购人力" :maxlength="1"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="科目名称" prop="subjectName"> |
||||
|
<el-input v-model="editForm.subjectName" placeholder="科目名称" :maxlength="255"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="项目归属机构编号" prop="branchId"> |
||||
|
<el-input v-model="editForm.branchId" placeholder="项目归属机构编号" :maxlength="50"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="用户归属机构编号-也就是将来的结算对象" prop="ubranchId"> |
||||
|
<el-input v-model="editForm.ubranchId" placeholder="用户归属机构编号-也就是将来的结算对象" :maxlength="50"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</el-row> |
||||
|
|
||||
|
<el-row class="page-bottom bottom-fixed"> |
||||
|
<el-button @click.native="handleCancel">取消</el-button> |
||||
|
<el-button v-loading="load.edit" type="primary" @click.native="saveSubmit" :disabled="load.edit==true">提交</el-button> |
||||
|
</el-row> |
||||
|
</section> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import util from '@/common/js/util';//全局公共库 |
||||
|
import config from "@/common/config"; //全局公共库import |
||||
|
import { initDicts, addXmBudgetLabor,editXmBudgetLabor } from '@/api/xm/core/xmBudgetLabor'; |
||||
|
import { mapGetters } from 'vuex' |
||||
|
|
||||
|
export default { |
||||
|
name:'xmBudgetLaborEdit', |
||||
|
components: { |
||||
|
|
||||
|
}, |
||||
|
computed: { |
||||
|
...mapGetters([ 'userInfo' ]), |
||||
|
|
||||
|
}, |
||||
|
props:['xmBudgetLabor','visible','opType'], |
||||
|
|
||||
|
watch: { |
||||
|
'xmBudgetLabor':function( xmBudgetLabor ) { |
||||
|
if(xmBudgetLabor){ |
||||
|
this.editForm = {...xmBudgetLabor}; |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
'visible':function(visible) { |
||||
|
if(visible==true){ |
||||
|
this.initData() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
currOpType:'add',//add/edit |
||||
|
load:{ list: false, edit: false, del: false, add: false },//查询中... |
||||
|
dicts:{},//下拉选择框的所有静态数据 params={categoryId:'all',itemCodes:['sex']} 返回结果 {sex: [{id:'1',name:'男'},{id:'2',name:'女'}]} |
||||
|
editFormRules: { |
||||
|
id: [ |
||||
|
//{ required: true, message: '主键不能为空', trigger: 'blur' } |
||||
|
] |
||||
|
}, |
||||
|
editForm: { |
||||
|
projectId:'',userid:'',budgetAt:'',id:'',remark:'',username:'',subjectId:'',bizSdate:'',bizEdate:'',bizMonth:'',instId:'',bizFlowState:'',costType:'',subjectName:'',branchId:'',ubranchId:'' |
||||
|
}, |
||||
|
maxTableHeight:300, |
||||
|
}//end return |
||||
|
},//end data |
||||
|
methods: { |
||||
|
|
||||
|
...util, |
||||
|
|
||||
|
// 取消按钮点击 父组件监听@cancel="editFormVisible=false" 监听 |
||||
|
handleCancel:function(){ |
||||
|
this.$refs['editFormRef'].resetFields(); |
||||
|
this.$emit('cancel'); |
||||
|
}, |
||||
|
//新增、编辑提交XmBudgetLabor 项目人力成本预算父组件监听@submit="afterEditSubmit" |
||||
|
saveSubmit: function () { |
||||
|
this.$refs.editFormRef.validate((valid) => { |
||||
|
if (valid) { |
||||
|
this.$confirm('确认提交吗?', '提示', {}).then(() => { |
||||
|
this.load.edit=true |
||||
|
let params = Object.assign({}, this.editForm); |
||||
|
var func=addXmBudgetLabor |
||||
|
if(this.currOpType=='edit'){ |
||||
|
func=editXmBudgetLabor |
||||
|
} |
||||
|
func(params).then((res) => { |
||||
|
this.load.edit=false |
||||
|
var tips=res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
this.editForm=res.data.data |
||||
|
this.initData() |
||||
|
this.currOpType="edit"; |
||||
|
this.$emit('submit');// @submit="afterAddSubmit" |
||||
|
} |
||||
|
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: tips.isOk?'success':'error' }); |
||||
|
}).catch( err =>this.load.edit=false); |
||||
|
}); |
||||
|
}else{ |
||||
|
this.$notify({ showClose:true, message: "表单验证不通过,请修改表单数据再提交", type: 'error' }); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
initData: function(){ |
||||
|
this.currOpType=this.opType |
||||
|
if(this.xmBudgetLabor){ |
||||
|
this.editForm = Object.assign({},this.xmBudgetLabor); |
||||
|
} |
||||
|
|
||||
|
if(this.opType=='edit'){ |
||||
|
|
||||
|
}else{ |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
},//end method |
||||
|
mounted() { |
||||
|
this.$nextTick(() => { |
||||
|
initDicts(this); |
||||
|
this.initData() |
||||
|
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el) |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,356 @@ |
|||||
|
<template> |
||||
|
<section class="page-container border padding"> |
||||
|
<el-row> |
||||
|
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询"></el-input> |
||||
|
<el-button v-loading="load.list" :disabled="load.list==true" @click="searchXmBudgetLabors" icon="el-icon-search">查询</el-button> |
||||
|
<span style="float:right;"> |
||||
|
<el-button type="primary" @click="showAdd" icon="el-icon-plus" plain> </el-button> |
||||
|
<el-button type="danger" v-loading="load.del" @click="batchDel" :disabled="this.sels.length===0 || load.del==true" icon="el-icon-delete" plain></el-button> |
||||
|
</span> |
||||
|
</el-row> |
||||
|
<el-row class="padding-top"> |
||||
|
<!--列表 XmBudgetLabor 项目人力成本预算--> |
||||
|
<el-table ref="xmBudgetLaborTable" :data="xmBudgetLabors" :height="maxTableHeight" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;"> |
||||
|
<el-table-column type="selection" width="55" show-overflow-tooltip fixed="left"></el-table-column> |
||||
|
<el-table-column sortable type="index" width="55" show-overflow-tooltip fixed="left"></el-table-column> |
||||
|
<!-- |
||||
|
<el-table-column sortable prop="username" width="55" show-overflow-tooltip fixed="left"> |
||||
|
<span class="cell-text"> {{scope.row.username}}} </span> |
||||
|
<span class="cell-bar"><el-input style="display:inline;" v-model="scope.row.username" placeholder="" @change="editSomeFields(scope.row,'username',$event)" :maxlength="22"></el-input></span> |
||||
|
</el-table-column> |
||||
|
--> |
||||
|
<el-table-column prop="id" label="主键" min-width="80" show-overflow-tooltip fixed="left"></el-table-column> |
||||
|
<el-table-column prop="projectId" label="项目编号" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.projectId}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="userid" label="项目成员编号" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.userid}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="budgetAt" label="预算金额/每月" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.budgetAt}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="remark" label="备注" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.remark}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="username" label="用户名" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.username}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="subjectId" label="预算科目编号" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.subjectId}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="bizSdate" label="费用归属周期开始日期" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.bizSdate}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="bizEdate" label="费用归属周期结束日期" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.bizEdate}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="bizMonth" label="费用归属月份yyyy-mm" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.bizMonth}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="instId" label="当前流程实例编号" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.instId}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="bizFlowState" label="当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.bizFlowState}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="costType" label="成本类型0非人力1内部人力2外购人力" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.costType}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="subjectName" label="科目名称" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.subjectName}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="branchId" label="项目归属机构编号" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.branchId}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="ubranchId" label="用户归属机构编号-也就是将来的结算对象" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.ubranchId}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="操作" width="180" fixed="right"> |
||||
|
<template scope="scope"> |
||||
|
<el-button type="primary" @click="showEdit( scope.row,scope.$index)" icon="el-icon-edit" plain></el-button> |
||||
|
<el-button type="danger" @click="handleDel(scope.row,scope.$index)" icon="el-icon-delete" plain></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> |
||||
|
<el-row> |
||||
|
<!--编辑 XmBudgetLabor 项目人力成本预算界面--> |
||||
|
<el-drawer title="编辑项目人力成本预算" :visible.sync="editFormVisible" size="60%" append-to-body :close-on-click-modal="false"> |
||||
|
<xm-budget-labor-edit op-type="edit" :xm-budget-labor="editForm" :visible="editFormVisible" @cancel="editFormVisible=false" @submit="afterEditSubmit"></xm-budget-labor-edit> |
||||
|
</el-drawer> |
||||
|
|
||||
|
<!--新增 XmBudgetLabor 项目人力成本预算界面--> |
||||
|
<el-drawer title="新增项目人力成本预算" :visible.sync="addFormVisible" size="60%" append-to-body :close-on-click-modal="false"> |
||||
|
<xm-budget-labor-edit op-type="add" :visible="addFormVisible" @cancel="addFormVisible=false" @submit="afterAddSubmit"></xm-budget-labor-edit> |
||||
|
</el-drawer> |
||||
|
</el-row> |
||||
|
</section> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import util from '@/common/js/util';//全局公共库 |
||||
|
import config from '@/common/config';//全局公共库 |
||||
|
import { initDicts,listXmBudgetLabor, delXmBudgetLabor, batchDelXmBudgetLabor,editSomeFieldsXmBudgetLabor } from '@/api/xm/core/xmBudgetLabor'; |
||||
|
import XmBudgetLaborEdit from './XmBudgetLaborEdit';//新增修改界面 |
||||
|
import { mapGetters } from 'vuex' |
||||
|
|
||||
|
export default { |
||||
|
name:'xmBudgetLaborMng', |
||||
|
components: { |
||||
|
XmBudgetLaborEdit, |
||||
|
}, |
||||
|
props:['visible'], |
||||
|
computed: { |
||||
|
...mapGetters(['userInfo']), |
||||
|
|
||||
|
}, |
||||
|
watch:{ |
||||
|
visible(val){ |
||||
|
if(val==true){ |
||||
|
this.initData(); |
||||
|
this.searchXmBudgetLabors() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
filters: { |
||||
|
key: '' |
||||
|
}, |
||||
|
xmBudgetLabors: [],//查询结果 |
||||
|
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:{ |
||||
|
//sex: [{id:'1',name:'男'},{id:'2',name:'女'}] |
||||
|
},//下拉选择框的所有静态数据 params={categoryId:'all',itemCodes:['sex']} 返回结果 {sex: [{id:'1',name:'男'},{id:'2',name:'女'}]} |
||||
|
addFormVisible: false,//新增xmBudgetLabor界面是否显示 |
||||
|
addForm: { |
||||
|
projectId:'',userid:'',budgetAt:'',id:'',remark:'',username:'',subjectId:'',bizSdate:'',bizEdate:'',bizMonth:'',instId:'',bizFlowState:'',costType:'',subjectName:'',branchId:'',ubranchId:'' |
||||
|
}, |
||||
|
|
||||
|
editFormVisible: false,//编辑界面是否显示 |
||||
|
editForm: { |
||||
|
projectId:'',userid:'',budgetAt:'',id:'',remark:'',username:'',subjectId:'',bizSdate:'',bizEdate:'',bizMonth:'',instId:'',bizFlowState:'',costType:'',subjectName:'',branchId:'',ubranchId:'' |
||||
|
}, |
||||
|
maxTableHeight:300, |
||||
|
} |
||||
|
},//end data |
||||
|
methods: { |
||||
|
|
||||
|
...util, |
||||
|
|
||||
|
handleSizeChange(pageSize) { |
||||
|
this.pageInfo.pageSize=pageSize; |
||||
|
this.getXmBudgetLabors(); |
||||
|
}, |
||||
|
handleCurrentChange(pageNum) { |
||||
|
this.pageInfo.pageNum = pageNum; |
||||
|
this.getXmBudgetLabors(); |
||||
|
}, |
||||
|
// 表格排序 obj.order=ascending/descending,需转化为 asc/desc ; obj.prop=表格中的排序字段,字段驼峰命名 |
||||
|
sortChange( obj ){ |
||||
|
if(obj.order==null){ |
||||
|
this.pageInfo.orderFields=[]; |
||||
|
this.pageInfo.orderDirs=[]; |
||||
|
}else{ |
||||
|
var dir='asc'; |
||||
|
if(obj.order=='ascending'){ |
||||
|
dir='asc' |
||||
|
}else{ |
||||
|
dir='desc'; |
||||
|
} |
||||
|
|
||||
|
this.pageInfo.orderFields=[util.toLine(obj.prop)]; |
||||
|
this.pageInfo.orderDirs=[dir]; |
||||
|
} |
||||
|
this.getXmBudgetLabors(); |
||||
|
}, |
||||
|
searchXmBudgetLabors(){ |
||||
|
this.pageInfo.count=true; |
||||
|
this.getXmBudgetLabors(); |
||||
|
}, |
||||
|
//获取列表 XmBudgetLabor 项目人力成本预算 |
||||
|
getXmBudgetLabors() { |
||||
|
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.key=this.filters.key |
||||
|
} |
||||
|
|
||||
|
this.load.list = true; |
||||
|
listXmBudgetLabor(params).then((res) => { |
||||
|
var tips=res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
this.pageInfo.total = res.data.total; |
||||
|
this.pageInfo.count=false; |
||||
|
this.xmBudgetLabors = 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 ); |
||||
|
}, |
||||
|
|
||||
|
//显示编辑界面 XmBudgetLabor 项目人力成本预算 |
||||
|
showEdit: function ( row,index ) { |
||||
|
this.editFormVisible = true; |
||||
|
this.editForm = Object.assign({}, row); |
||||
|
}, |
||||
|
//显示新增界面 XmBudgetLabor 项目人力成本预算 |
||||
|
showAdd: function () { |
||||
|
this.addFormVisible = true; |
||||
|
//this.addForm=Object.assign({}, this.editForm); |
||||
|
}, |
||||
|
afterAddSubmit(){ |
||||
|
this.addFormVisible=false; |
||||
|
this.pageInfo.count=true; |
||||
|
this.getXmBudgetLabors(); |
||||
|
}, |
||||
|
afterEditSubmit(){ |
||||
|
this.editFormVisible=false; |
||||
|
}, |
||||
|
//选择行xmBudgetLabor |
||||
|
selsChange: function (sels) { |
||||
|
this.sels = sels; |
||||
|
}, |
||||
|
//删除xmBudgetLabor |
||||
|
handleDel: function (row,index) { |
||||
|
this.$confirm('确认删除该记录吗?', '提示', { |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.load.del=true; |
||||
|
let params = { id:row.id }; |
||||
|
delXmBudgetLabor(params).then((res) => { |
||||
|
this.load.del=false; |
||||
|
var tips=res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
this.searchXmBudgetLabors(); |
||||
|
} |
||||
|
this.$notify({ position:'bottom-left', showClose:true, message: tips.msg, type: tips.isOk?'success':'error' }); |
||||
|
}).catch( err => this.load.del=false ); |
||||
|
}); |
||||
|
}, |
||||
|
//批量删除xmBudgetLabor |
||||
|
batchDel: function () { |
||||
|
if(this.sels.length<=0){ |
||||
|
return; |
||||
|
} |
||||
|
var params=this.sels.map(i=>{ |
||||
|
return { id:i.id} |
||||
|
}) |
||||
|
this.$confirm('确认删除选中记录吗?', '提示', { |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.load.del=true; |
||||
|
batchDelXmBudgetLabor(params).then((res) => { |
||||
|
this.load.del=false; |
||||
|
var tips=res.data.tips; |
||||
|
if( tips.isOk ){ |
||||
|
this.searchXmBudgetLabors(); |
||||
|
} |
||||
|
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: tips.isOk?'success':'error'}); |
||||
|
}).catch( err => this.load.del=false ); |
||||
|
}); |
||||
|
}, |
||||
|
editSomeFields(row,fieldName,$event){ |
||||
|
let params={}; |
||||
|
if(this.sels.length>0){ |
||||
|
if(!this.sels.some(k=> k.id==row.id)){ |
||||
|
this.$notify({position:'bottom-left',showClose:true,message:'请编辑选中的行',type:'warning'}) |
||||
|
Object.assign(this.editForm,this.editFormBak) |
||||
|
return; |
||||
|
} |
||||
|
params['ids']=this.sels.map(i=>i.id) |
||||
|
}else{ |
||||
|
params['ids']=[row].map(i=>i.id) |
||||
|
} |
||||
|
params[fieldName]=$event |
||||
|
var func = editSomeFieldsXmBudgetLabor |
||||
|
func(params).then(res=>{ |
||||
|
let tips = res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
if(this.sels.length>0){ |
||||
|
this.searchXmBudgetLabors(); |
||||
|
} |
||||
|
this.editFormBak=[...this.editForm] |
||||
|
}else{ |
||||
|
Object.assign(this.editForm,this.editFormBak) |
||||
|
this.$notify({position:'bottom-left',showClose:true,message:tips.msg,type:tips.isOk?'success':'error'}) |
||||
|
} |
||||
|
}).catch((e)=>Object.assign(this.editForm,this.editFormBak)) |
||||
|
}, |
||||
|
rowClick: function(row, event, column){ |
||||
|
this.editForm=row |
||||
|
this.editFormBak={...row}; |
||||
|
this.$emit('row-click',row, event, column);// @row-click="rowClick" |
||||
|
}, |
||||
|
initData: function(){ |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
},//end methods |
||||
|
mounted() { |
||||
|
this.$nextTick(() => { |
||||
|
initDicts(this); |
||||
|
this.initData() |
||||
|
this.searchXmBudgetLabors(); |
||||
|
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.xmBudgetLaborTable.$el) |
||||
|
|
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
</style> |
||||
@ -0,0 +1,167 @@ |
|||||
|
<template> |
||||
|
<section class="page-container padding"> |
||||
|
<el-row class="page-header"> |
||||
|
</el-row> |
||||
|
<el-row class="page-main" :style="{overflowX:'auto',height:maxTableHeight+'px'}" ref="table"> |
||||
|
<!--编辑界面 XmBudgetNlabor 项目人力成本预算--> |
||||
|
<el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editFormRef"> |
||||
|
<el-form-item label="主键" prop="id"> |
||||
|
<el-input v-model="editForm.id" placeholder="主键" :maxlength="50"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="项目编号" prop="projectId"> |
||||
|
<el-input v-model="editForm.projectId" placeholder="项目编号" :maxlength="50"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="预算金额" prop="budgetAt"> |
||||
|
<el-input v-model="editForm.budgetAt" placeholder="预算金额" :maxlength="10"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="备注" prop="remark"> |
||||
|
<el-input v-model="editForm.remark" placeholder="备注" :maxlength="255"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="预算科目" prop="subjectId"> |
||||
|
<el-input v-model="editForm.subjectId" placeholder="预算科目" :maxlength="50"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="费用归属周期开始日期" prop="bizSdate"> |
||||
|
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.bizSdate" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="费用归属周期结束日期" prop="bizEdate"> |
||||
|
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.bizEdate" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="当前流程实例编号" prop="instId"> |
||||
|
<el-input v-model="editForm.instId" placeholder="当前流程实例编号" :maxlength="50"></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流程取消或者删除" :maxlength="1"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="成本类型0非人力1内部人力2外购人力" prop="costType"> |
||||
|
<el-input v-model="editForm.costType" placeholder="成本类型0非人力1内部人力2外购人力" :maxlength="1"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="费用归属月份yyyy-MM" prop="bizMonth"> |
||||
|
<el-input v-model="editForm.bizMonth" placeholder="费用归属月份yyyy-MM" :maxlength="10"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="科目名称" prop="subjectName"> |
||||
|
<el-input v-model="editForm.subjectName" placeholder="科目名称" :maxlength="255"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="项目归属企业编号" prop="branchId"> |
||||
|
<el-input v-model="editForm.branchId" placeholder="项目归属企业编号" :maxlength="50"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</el-row> |
||||
|
|
||||
|
<el-row class="page-bottom bottom-fixed"> |
||||
|
<el-button @click.native="handleCancel">取消</el-button> |
||||
|
<el-button v-loading="load.edit" type="primary" @click.native="saveSubmit" :disabled="load.edit==true">提交</el-button> |
||||
|
</el-row> |
||||
|
</section> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import util from '@/common/js/util';//全局公共库 |
||||
|
import config from "@/common/config"; //全局公共库import |
||||
|
import { initDicts, addXmBudgetNlabor,editXmBudgetNlabor } from '@/api/xm/core/xmBudgetNlabor'; |
||||
|
import { mapGetters } from 'vuex' |
||||
|
|
||||
|
export default { |
||||
|
name:'xmBudgetNlaborEdit', |
||||
|
components: { |
||||
|
|
||||
|
}, |
||||
|
computed: { |
||||
|
...mapGetters([ 'userInfo' ]), |
||||
|
|
||||
|
}, |
||||
|
props:['xmBudgetNlabor','visible','opType'], |
||||
|
|
||||
|
watch: { |
||||
|
'xmBudgetNlabor':function( xmBudgetNlabor ) { |
||||
|
if(xmBudgetNlabor){ |
||||
|
this.editForm = {...xmBudgetNlabor}; |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
'visible':function(visible) { |
||||
|
if(visible==true){ |
||||
|
this.initData() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
currOpType:'add',//add/edit |
||||
|
load:{ list: false, edit: false, del: false, add: false },//查询中... |
||||
|
dicts:{},//下拉选择框的所有静态数据 params={categoryId:'all',itemCodes:['sex']} 返回结果 {sex: [{id:'1',name:'男'},{id:'2',name:'女'}]} |
||||
|
editFormRules: { |
||||
|
id: [ |
||||
|
//{ required: true, message: '主键不能为空', trigger: 'blur' } |
||||
|
] |
||||
|
}, |
||||
|
editForm: { |
||||
|
id:'',projectId:'',budgetAt:'',remark:'',subjectId:'',bizSdate:'',bizEdate:'',instId:'',bizFlowState:'',costType:'',bizMonth:'',subjectName:'',branchId:'' |
||||
|
}, |
||||
|
maxTableHeight:300, |
||||
|
}//end return |
||||
|
},//end data |
||||
|
methods: { |
||||
|
|
||||
|
...util, |
||||
|
|
||||
|
// 取消按钮点击 父组件监听@cancel="editFormVisible=false" 监听 |
||||
|
handleCancel:function(){ |
||||
|
this.$refs['editFormRef'].resetFields(); |
||||
|
this.$emit('cancel'); |
||||
|
}, |
||||
|
//新增、编辑提交XmBudgetNlabor 项目人力成本预算父组件监听@submit="afterEditSubmit" |
||||
|
saveSubmit: function () { |
||||
|
this.$refs.editFormRef.validate((valid) => { |
||||
|
if (valid) { |
||||
|
this.$confirm('确认提交吗?', '提示', {}).then(() => { |
||||
|
this.load.edit=true |
||||
|
let params = Object.assign({}, this.editForm); |
||||
|
var func=addXmBudgetNlabor |
||||
|
if(this.currOpType=='edit'){ |
||||
|
func=editXmBudgetNlabor |
||||
|
} |
||||
|
func(params).then((res) => { |
||||
|
this.load.edit=false |
||||
|
var tips=res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
this.editForm=res.data.data |
||||
|
this.initData() |
||||
|
this.currOpType="edit"; |
||||
|
this.$emit('submit');// @submit="afterAddSubmit" |
||||
|
} |
||||
|
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: tips.isOk?'success':'error' }); |
||||
|
}).catch( err =>this.load.edit=false); |
||||
|
}); |
||||
|
}else{ |
||||
|
this.$notify({ showClose:true, message: "表单验证不通过,请修改表单数据再提交", type: 'error' }); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
initData: function(){ |
||||
|
this.currOpType=this.opType |
||||
|
if(this.xmBudgetNlabor){ |
||||
|
this.editForm = Object.assign({},this.xmBudgetNlabor); |
||||
|
} |
||||
|
|
||||
|
if(this.opType=='edit'){ |
||||
|
|
||||
|
}else{ |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
},//end method |
||||
|
mounted() { |
||||
|
this.$nextTick(() => { |
||||
|
initDicts(this); |
||||
|
this.initData() |
||||
|
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el) |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,341 @@ |
|||||
|
<template> |
||||
|
<section class="page-container border padding"> |
||||
|
<el-row> |
||||
|
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询"></el-input> |
||||
|
<el-button v-loading="load.list" :disabled="load.list==true" @click="searchXmBudgetNlabors" icon="el-icon-search">查询</el-button> |
||||
|
<span style="float:right;"> |
||||
|
<el-button type="primary" @click="showAdd" icon="el-icon-plus" plain> </el-button> |
||||
|
<el-button type="danger" v-loading="load.del" @click="batchDel" :disabled="this.sels.length===0 || load.del==true" icon="el-icon-delete" plain></el-button> |
||||
|
</span> |
||||
|
</el-row> |
||||
|
<el-row class="padding-top"> |
||||
|
<!--列表 XmBudgetNlabor 项目人力成本预算--> |
||||
|
<el-table ref="xmBudgetNlaborTable" :data="xmBudgetNlabors" :height="maxTableHeight" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;"> |
||||
|
<el-table-column type="selection" width="55" show-overflow-tooltip fixed="left"></el-table-column> |
||||
|
<el-table-column sortable type="index" width="55" show-overflow-tooltip fixed="left"></el-table-column> |
||||
|
<!-- |
||||
|
<el-table-column sortable prop="username" width="55" show-overflow-tooltip fixed="left"> |
||||
|
<span class="cell-text"> {{scope.row.username}}} </span> |
||||
|
<span class="cell-bar"><el-input style="display:inline;" v-model="scope.row.username" placeholder="" @change="editSomeFields(scope.row,'username',$event)" :maxlength="22"></el-input></span> |
||||
|
</el-table-column> |
||||
|
--> |
||||
|
<el-table-column prop="id" label="主键" min-width="80" show-overflow-tooltip fixed="left"></el-table-column> |
||||
|
<el-table-column prop="projectId" label="项目编号" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.projectId}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="budgetAt" label="预算金额" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.budgetAt}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="remark" label="备注" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.remark}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="subjectId" label="预算科目" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.subjectId}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="bizSdate" label="费用归属周期开始日期" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.bizSdate}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="bizEdate" label="费用归属周期结束日期" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.bizEdate}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="instId" label="当前流程实例编号" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.instId}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="bizFlowState" label="当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.bizFlowState}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="costType" label="成本类型0非人力1内部人力2外购人力" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.costType}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="bizMonth" label="费用归属月份yyyy-MM" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.bizMonth}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="subjectName" label="科目名称" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.subjectName}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="branchId" label="项目归属企业编号" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.branchId}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="操作" width="180" fixed="right"> |
||||
|
<template scope="scope"> |
||||
|
<el-button type="primary" @click="showEdit( scope.row,scope.$index)" icon="el-icon-edit" plain></el-button> |
||||
|
<el-button type="danger" @click="handleDel(scope.row,scope.$index)" icon="el-icon-delete" plain></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> |
||||
|
<el-row> |
||||
|
<!--编辑 XmBudgetNlabor 项目人力成本预算界面--> |
||||
|
<el-drawer title="编辑项目人力成本预算" :visible.sync="editFormVisible" size="60%" append-to-body :close-on-click-modal="false"> |
||||
|
<xm-budget-nlabor-edit op-type="edit" :xm-budget-nlabor="editForm" :visible="editFormVisible" @cancel="editFormVisible=false" @submit="afterEditSubmit"></xm-budget-nlabor-edit> |
||||
|
</el-drawer> |
||||
|
|
||||
|
<!--新增 XmBudgetNlabor 项目人力成本预算界面--> |
||||
|
<el-drawer title="新增项目人力成本预算" :visible.sync="addFormVisible" size="60%" append-to-body :close-on-click-modal="false"> |
||||
|
<xm-budget-nlabor-edit op-type="add" :visible="addFormVisible" @cancel="addFormVisible=false" @submit="afterAddSubmit"></xm-budget-nlabor-edit> |
||||
|
</el-drawer> |
||||
|
</el-row> |
||||
|
</section> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import util from '@/common/js/util';//全局公共库 |
||||
|
import config from '@/common/config';//全局公共库 |
||||
|
import { initDicts,listXmBudgetNlabor, delXmBudgetNlabor, batchDelXmBudgetNlabor,editSomeFieldsXmBudgetNlabor } from '@/api/xm/core/xmBudgetNlabor'; |
||||
|
import XmBudgetNlaborEdit from './XmBudgetNlaborEdit';//新增修改界面 |
||||
|
import { mapGetters } from 'vuex' |
||||
|
|
||||
|
export default { |
||||
|
name:'xmBudgetNlaborMng', |
||||
|
components: { |
||||
|
XmBudgetNlaborEdit, |
||||
|
}, |
||||
|
props:["selProject",'xmBudgetNlabor','fieldName','queryType','visible'], |
||||
|
computed: { |
||||
|
...mapGetters(['userInfo']), |
||||
|
|
||||
|
}, |
||||
|
watch:{ |
||||
|
visible(val){ |
||||
|
if(val==true){ |
||||
|
this.initData(); |
||||
|
this.searchXmBudgetNlabors() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
filters: { |
||||
|
key: '' |
||||
|
}, |
||||
|
xmBudgetNlabors: [],//查询结果 |
||||
|
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:{ |
||||
|
//sex: [{id:'1',name:'男'},{id:'2',name:'女'}] |
||||
|
},//下拉选择框的所有静态数据 params={categoryId:'all',itemCodes:['sex']} 返回结果 {sex: [{id:'1',name:'男'},{id:'2',name:'女'}]} |
||||
|
addFormVisible: false,//新增xmBudgetNlabor界面是否显示 |
||||
|
addForm: { |
||||
|
id:'',projectId:'',budgetAt:'',remark:'',subjectId:'',bizSdate:'',bizEdate:'',instId:'',bizFlowState:'',costType:'',bizMonth:'',subjectName:'',branchId:'' |
||||
|
}, |
||||
|
|
||||
|
editFormVisible: false,//编辑界面是否显示 |
||||
|
editForm: { |
||||
|
id:'',projectId:'',budgetAt:'',remark:'',subjectId:'',bizSdate:'',bizEdate:'',instId:'',bizFlowState:'',costType:'',bizMonth:'',subjectName:'',branchId:'' |
||||
|
}, |
||||
|
maxTableHeight:300, |
||||
|
} |
||||
|
},//end data |
||||
|
methods: { |
||||
|
|
||||
|
...util, |
||||
|
|
||||
|
handleSizeChange(pageSize) { |
||||
|
this.pageInfo.pageSize=pageSize; |
||||
|
this.getXmBudgetNlabors(); |
||||
|
}, |
||||
|
handleCurrentChange(pageNum) { |
||||
|
this.pageInfo.pageNum = pageNum; |
||||
|
this.getXmBudgetNlabors(); |
||||
|
}, |
||||
|
// 表格排序 obj.order=ascending/descending,需转化为 asc/desc ; obj.prop=表格中的排序字段,字段驼峰命名 |
||||
|
sortChange( obj ){ |
||||
|
if(obj.order==null){ |
||||
|
this.pageInfo.orderFields=[]; |
||||
|
this.pageInfo.orderDirs=[]; |
||||
|
}else{ |
||||
|
var dir='asc'; |
||||
|
if(obj.order=='ascending'){ |
||||
|
dir='asc' |
||||
|
}else{ |
||||
|
dir='desc'; |
||||
|
} |
||||
|
|
||||
|
this.pageInfo.orderFields=[util.toLine(obj.prop)]; |
||||
|
this.pageInfo.orderDirs=[dir]; |
||||
|
} |
||||
|
this.getXmBudgetNlabors(); |
||||
|
}, |
||||
|
searchXmBudgetNlabors(){ |
||||
|
this.pageInfo.count=true; |
||||
|
this.getXmBudgetNlabors(); |
||||
|
}, |
||||
|
//获取列表 XmBudgetNlabor 项目人力成本预算 |
||||
|
getXmBudgetNlabors() { |
||||
|
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.key=this.filters.key |
||||
|
} |
||||
|
|
||||
|
this.load.list = true; |
||||
|
listXmBudgetNlabor(params).then((res) => { |
||||
|
var tips=res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
this.pageInfo.total = res.data.total; |
||||
|
this.pageInfo.count=false; |
||||
|
this.xmBudgetNlabors = 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 ); |
||||
|
}, |
||||
|
|
||||
|
//显示编辑界面 XmBudgetNlabor 项目人力成本预算 |
||||
|
showEdit: function ( row,index ) { |
||||
|
this.editFormVisible = true; |
||||
|
this.editForm = Object.assign({}, row); |
||||
|
}, |
||||
|
//显示新增界面 XmBudgetNlabor 项目人力成本预算 |
||||
|
showAdd: function () { |
||||
|
this.addFormVisible = true; |
||||
|
//this.addForm=Object.assign({}, this.editForm); |
||||
|
}, |
||||
|
afterAddSubmit(){ |
||||
|
this.addFormVisible=false; |
||||
|
this.pageInfo.count=true; |
||||
|
this.getXmBudgetNlabors(); |
||||
|
}, |
||||
|
afterEditSubmit(){ |
||||
|
this.editFormVisible=false; |
||||
|
}, |
||||
|
//选择行xmBudgetNlabor |
||||
|
selsChange: function (sels) { |
||||
|
this.sels = sels; |
||||
|
}, |
||||
|
//删除xmBudgetNlabor |
||||
|
handleDel: function (row,index) { |
||||
|
this.$confirm('确认删除该记录吗?', '提示', { |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.load.del=true; |
||||
|
let params = { id:row.id }; |
||||
|
delXmBudgetNlabor(params).then((res) => { |
||||
|
this.load.del=false; |
||||
|
var tips=res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
this.searchXmBudgetNlabors(); |
||||
|
} |
||||
|
this.$notify({ position:'bottom-left', showClose:true, message: tips.msg, type: tips.isOk?'success':'error' }); |
||||
|
}).catch( err => this.load.del=false ); |
||||
|
}); |
||||
|
}, |
||||
|
//批量删除xmBudgetNlabor |
||||
|
batchDel: function () { |
||||
|
if(this.sels.length<=0){ |
||||
|
return; |
||||
|
} |
||||
|
var params=this.sels.map(i=>{ |
||||
|
return { id:i.id} |
||||
|
}) |
||||
|
this.$confirm('确认删除选中记录吗?', '提示', { |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.load.del=true; |
||||
|
batchDelXmBudgetNlabor(params).then((res) => { |
||||
|
this.load.del=false; |
||||
|
var tips=res.data.tips; |
||||
|
if( tips.isOk ){ |
||||
|
this.searchXmBudgetNlabors(); |
||||
|
} |
||||
|
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: tips.isOk?'success':'error'}); |
||||
|
}).catch( err => this.load.del=false ); |
||||
|
}); |
||||
|
}, |
||||
|
editSomeFields(row,fieldName,$event){ |
||||
|
let params={}; |
||||
|
if(this.sels.length>0){ |
||||
|
if(!this.sels.some(k=> k.id==row.id)){ |
||||
|
this.$notify({position:'bottom-left',showClose:true,message:'请编辑选中的行',type:'warning'}) |
||||
|
Object.assign(this.editForm,this.editFormBak) |
||||
|
return; |
||||
|
} |
||||
|
params['ids']=this.sels.map(i=>i.id) |
||||
|
}else{ |
||||
|
params['ids']=[row].map(i=>i.id) |
||||
|
} |
||||
|
params[fieldName]=$event |
||||
|
var func = editSomeFieldsXmBudgetNlabor |
||||
|
func(params).then(res=>{ |
||||
|
let tips = res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
if(this.sels.length>0){ |
||||
|
this.searchXmBudgetNlabors(); |
||||
|
} |
||||
|
this.editFormBak=[...this.editForm] |
||||
|
}else{ |
||||
|
Object.assign(this.editForm,this.editFormBak) |
||||
|
this.$notify({position:'bottom-left',showClose:true,message:tips.msg,type:tips.isOk?'success':'error'}) |
||||
|
} |
||||
|
}).catch((e)=>Object.assign(this.editForm,this.editFormBak)) |
||||
|
}, |
||||
|
rowClick: function(row, event, column){ |
||||
|
this.editForm=row |
||||
|
this.editFormBak={...row}; |
||||
|
this.$emit('row-click',row, event, column);// @row-click="rowClick" |
||||
|
}, |
||||
|
initData: function(){ |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
},//end methods |
||||
|
mounted() { |
||||
|
this.$nextTick(() => { |
||||
|
initDicts(this); |
||||
|
this.initData() |
||||
|
this.searchXmBudgetNlabors(); |
||||
|
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.xmBudgetNlaborTable.$el) |
||||
|
|
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
</style> |
||||
@ -0,0 +1,188 @@ |
|||||
|
<template> |
||||
|
<section class="page-container padding"> |
||||
|
<el-row class="page-header"> |
||||
|
</el-row> |
||||
|
<el-row class="page-main" :style="{overflowX:'auto',height:maxTableHeight+'px'}" ref="table"> |
||||
|
<!--编辑界面 XmCostNlabor 项目实际人工成本费用--> |
||||
|
<el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editFormRef"> |
||||
|
<el-form-item label="项目编号" prop="projectId"> |
||||
|
<el-input v-model="editForm.projectId" placeholder="项目编号" :maxlength="50"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="用户编号-费用主责人" prop="userid"> |
||||
|
<el-input v-model="editForm.userid" placeholder="用户编号-费用主责人" :maxlength="50"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="创建时间" prop="ctime"> |
||||
|
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.ctime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="费用发放时间" prop="sendTime"> |
||||
|
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.sendTime" 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="用户名称" :maxlength="50"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="项目名称" prop="projectName"> |
||||
|
<el-input v-model="editForm.projectName" placeholder="项目名称" :maxlength="255"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="备注" prop="remark"> |
||||
|
<el-input v-model="editForm.remark" placeholder="备注" :maxlength="255"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="主键" prop="id"> |
||||
|
<el-input v-model="editForm.id" placeholder="主键" :maxlength="50"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="任务编号" prop="taskId"> |
||||
|
<el-input v-model="editForm.taskId" placeholder="任务编号" :maxlength="50"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="任务名称" prop="taskName"> |
||||
|
<el-input v-model="editForm.taskName" placeholder="任务名称" :maxlength="255"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="科目编号" prop="subjectId"> |
||||
|
<el-input v-model="editForm.subjectId" placeholder="科目编号" :maxlength="50"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="费用归属周期开始日期" prop="bizSdate"> |
||||
|
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.bizSdate" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="费用归属周期结束日期" prop="bizEdate"> |
||||
|
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.bizEdate" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="实际成本金额" prop="actAt"> |
||||
|
<el-input v-model="editForm.actAt" placeholder="实际成本金额" :maxlength="10"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="成本类型0非人力1内部人力2外购人力,此表都是非人力" prop="costType"> |
||||
|
<el-input v-model="editForm.costType" placeholder="成本类型0非人力1内部人力2外购人力,此表都是非人力" :maxlength="1"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="业务归属月份yyyy-MM" prop="bizMonth"> |
||||
|
<el-input v-model="editForm.bizMonth" placeholder="业务归属月份yyyy-MM" :maxlength="7"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="业务归属日期yyyy-MM-dd" prop="bizDate"> |
||||
|
<el-input v-model="editForm.bizDate" placeholder="业务归属日期yyyy-MM-dd" :maxlength="10"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="科目名称" prop="subjectName"> |
||||
|
<el-input v-model="editForm.subjectName" placeholder="科目名称" :maxlength="255"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="用户归属机构" prop="ubranchId"> |
||||
|
<el-input v-model="editForm.ubranchId" placeholder="用户归属机构" :maxlength="50"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="项目归属机构" prop="branchId"> |
||||
|
<el-input v-model="editForm.branchId" placeholder="项目归属机构" :maxlength="50"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</el-row> |
||||
|
|
||||
|
<el-row class="page-bottom bottom-fixed"> |
||||
|
<el-button @click.native="handleCancel">取消</el-button> |
||||
|
<el-button v-loading="load.edit" type="primary" @click.native="saveSubmit" :disabled="load.edit==true">提交</el-button> |
||||
|
</el-row> |
||||
|
</section> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import util from '@/common/js/util';//全局公共库 |
||||
|
import config from "@/common/config"; //全局公共库import |
||||
|
import { initDicts, addXmCostNlabor,editXmCostNlabor } from '@/api/xm/core/xmCostNlabor'; |
||||
|
import { mapGetters } from 'vuex' |
||||
|
|
||||
|
export default { |
||||
|
name:'xmCostNlaborEdit', |
||||
|
components: { |
||||
|
|
||||
|
}, |
||||
|
computed: { |
||||
|
...mapGetters([ 'userInfo' ]), |
||||
|
|
||||
|
}, |
||||
|
props:['xmCostNlabor','visible','opType'], |
||||
|
|
||||
|
watch: { |
||||
|
'xmCostNlabor':function( xmCostNlabor ) { |
||||
|
if(xmCostNlabor){ |
||||
|
this.editForm = {...xmCostNlabor}; |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
'visible':function(visible) { |
||||
|
if(visible==true){ |
||||
|
this.initData() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
currOpType:'add',//add/edit |
||||
|
load:{ list: false, edit: false, del: false, add: false },//查询中... |
||||
|
dicts:{},//下拉选择框的所有静态数据 params={categoryId:'all',itemCodes:['sex']} 返回结果 {sex: [{id:'1',name:'男'},{id:'2',name:'女'}]} |
||||
|
editFormRules: { |
||||
|
id: [ |
||||
|
//{ required: true, message: '主键不能为空', trigger: 'blur' } |
||||
|
] |
||||
|
}, |
||||
|
editForm: { |
||||
|
projectId:'',userid:'',ctime:'',sendTime:'',username:'',projectName:'',remark:'',id:'',taskId:'',taskName:'',subjectId:'',bizSdate:'',bizEdate:'',actAt:'',costType:'',bizMonth:'',bizDate:'',subjectName:'',ubranchId:'',branchId:'' |
||||
|
}, |
||||
|
maxTableHeight:300, |
||||
|
}//end return |
||||
|
},//end data |
||||
|
methods: { |
||||
|
|
||||
|
...util, |
||||
|
|
||||
|
// 取消按钮点击 父组件监听@cancel="editFormVisible=false" 监听 |
||||
|
handleCancel:function(){ |
||||
|
this.$refs['editFormRef'].resetFields(); |
||||
|
this.$emit('cancel'); |
||||
|
}, |
||||
|
//新增、编辑提交XmCostNlabor 项目实际人工成本费用父组件监听@submit="afterEditSubmit" |
||||
|
saveSubmit: function () { |
||||
|
this.$refs.editFormRef.validate((valid) => { |
||||
|
if (valid) { |
||||
|
this.$confirm('确认提交吗?', '提示', {}).then(() => { |
||||
|
this.load.edit=true |
||||
|
let params = Object.assign({}, this.editForm); |
||||
|
var func=addXmCostNlabor |
||||
|
if(this.currOpType=='edit'){ |
||||
|
func=editXmCostNlabor |
||||
|
} |
||||
|
func(params).then((res) => { |
||||
|
this.load.edit=false |
||||
|
var tips=res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
this.editForm=res.data.data |
||||
|
this.initData() |
||||
|
this.currOpType="edit"; |
||||
|
this.$emit('submit');// @submit="afterAddSubmit" |
||||
|
} |
||||
|
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: tips.isOk?'success':'error' }); |
||||
|
}).catch( err =>this.load.edit=false); |
||||
|
}); |
||||
|
}else{ |
||||
|
this.$notify({ showClose:true, message: "表单验证不通过,请修改表单数据再提交", type: 'error' }); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
initData: function(){ |
||||
|
this.currOpType=this.opType |
||||
|
if(this.xmCostNlabor){ |
||||
|
this.editForm = Object.assign({},this.xmCostNlabor); |
||||
|
} |
||||
|
|
||||
|
if(this.opType=='edit'){ |
||||
|
|
||||
|
}else{ |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
},//end method |
||||
|
mounted() { |
||||
|
this.$nextTick(() => { |
||||
|
initDicts(this); |
||||
|
this.initData() |
||||
|
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el) |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,376 @@ |
|||||
|
<template> |
||||
|
<section class="page-container border padding"> |
||||
|
<el-row> |
||||
|
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询"></el-input> |
||||
|
<el-button v-loading="load.list" :disabled="load.list==true" @click="searchXmCostNlabors" icon="el-icon-search">查询</el-button> |
||||
|
<span style="float:right;"> |
||||
|
<el-button type="primary" @click="showAdd" icon="el-icon-plus" plain> </el-button> |
||||
|
<el-button type="danger" v-loading="load.del" @click="batchDel" :disabled="this.sels.length===0 || load.del==true" icon="el-icon-delete" plain></el-button> |
||||
|
</span> |
||||
|
</el-row> |
||||
|
<el-row class="padding-top"> |
||||
|
<!--列表 XmCostNlabor 项目实际人工成本费用--> |
||||
|
<el-table ref="xmCostNlaborTable" :data="xmCostNlabors" :height="maxTableHeight" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;"> |
||||
|
<el-table-column type="selection" width="55" show-overflow-tooltip fixed="left"></el-table-column> |
||||
|
<el-table-column sortable type="index" width="55" show-overflow-tooltip fixed="left"></el-table-column> |
||||
|
<!-- |
||||
|
<el-table-column sortable prop="username" width="55" show-overflow-tooltip fixed="left"> |
||||
|
<span class="cell-text"> {{scope.row.username}}} </span> |
||||
|
<span class="cell-bar"><el-input style="display:inline;" v-model="scope.row.username" placeholder="" @change="editSomeFields(scope.row,'username',$event)" :maxlength="22"></el-input></span> |
||||
|
</el-table-column> |
||||
|
--> |
||||
|
<el-table-column prop="id" label="主键" min-width="80" show-overflow-tooltip fixed="left"></el-table-column> |
||||
|
<el-table-column prop="projectId" label="项目编号" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.projectId}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="userid" label="用户编号-费用主责人" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.userid}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="ctime" label="创建时间" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.ctime}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="sendTime" label="费用发放时间" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.sendTime}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="username" label="用户名称" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.username}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="projectName" label="项目名称" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.projectName}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="remark" label="备注" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.remark}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="taskId" label="任务编号" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.taskId}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="taskName" label="任务名称" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.taskName}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="subjectId" label="科目编号" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.subjectId}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="bizSdate" label="费用归属周期开始日期" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.bizSdate}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="bizEdate" label="费用归属周期结束日期" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.bizEdate}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="actAt" label="实际成本金额" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.actAt}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="costType" label="成本类型0非人力1内部人力2外购人力,此表都是非人力" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.costType}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="bizMonth" label="业务归属月份yyyy-MM" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.bizMonth}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="bizDate" label="业务归属日期yyyy-MM-dd" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.bizDate}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="subjectName" label="科目名称" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.subjectName}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="ubranchId" label="用户归属机构" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.ubranchId}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="branchId" label="项目归属机构" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.branchId}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="操作" width="180" fixed="right"> |
||||
|
<template scope="scope"> |
||||
|
<el-button type="primary" @click="showEdit( scope.row,scope.$index)" icon="el-icon-edit" plain></el-button> |
||||
|
<el-button type="danger" @click="handleDel(scope.row,scope.$index)" icon="el-icon-delete" plain></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> |
||||
|
<el-row> |
||||
|
<!--编辑 XmCostNlabor 项目实际人工成本费用界面--> |
||||
|
<el-drawer title="编辑项目实际人工成本费用" :visible.sync="editFormVisible" size="60%" append-to-body :close-on-click-modal="false"> |
||||
|
<xm-cost-nlabor-edit op-type="edit" :xm-cost-nlabor="editForm" :visible="editFormVisible" @cancel="editFormVisible=false" @submit="afterEditSubmit"></xm-cost-nlabor-edit> |
||||
|
</el-drawer> |
||||
|
|
||||
|
<!--新增 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> |
||||
|
</el-drawer> |
||||
|
</el-row> |
||||
|
</section> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import util from '@/common/js/util';//全局公共库 |
||||
|
import config from '@/common/config';//全局公共库 |
||||
|
import { initDicts,listXmCostNlabor, delXmCostNlabor, batchDelXmCostNlabor,editSomeFieldsXmCostNlabor } from '@/api/xm/core/xmCostNlabor'; |
||||
|
import XmCostNlaborEdit from './XmCostNlaborEdit';//新增修改界面 |
||||
|
import { mapGetters } from 'vuex' |
||||
|
|
||||
|
export default { |
||||
|
name:'xmCostNlaborMng', |
||||
|
components: { |
||||
|
XmCostNlaborEdit, |
||||
|
}, |
||||
|
props:['visible'], |
||||
|
computed: { |
||||
|
...mapGetters(['userInfo']), |
||||
|
|
||||
|
}, |
||||
|
watch:{ |
||||
|
visible(val){ |
||||
|
if(val==true){ |
||||
|
this.initData(); |
||||
|
this.searchXmCostNlabors() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
filters: { |
||||
|
key: '' |
||||
|
}, |
||||
|
xmCostNlabors: [],//查询结果 |
||||
|
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:{ |
||||
|
//sex: [{id:'1',name:'男'},{id:'2',name:'女'}] |
||||
|
},//下拉选择框的所有静态数据 params={categoryId:'all',itemCodes:['sex']} 返回结果 {sex: [{id:'1',name:'男'},{id:'2',name:'女'}]} |
||||
|
addFormVisible: false,//新增xmCostNlabor界面是否显示 |
||||
|
addForm: { |
||||
|
projectId:'',userid:'',ctime:'',sendTime:'',username:'',projectName:'',remark:'',id:'',taskId:'',taskName:'',subjectId:'',bizSdate:'',bizEdate:'',actAt:'',costType:'',bizMonth:'',bizDate:'',subjectName:'',ubranchId:'',branchId:'' |
||||
|
}, |
||||
|
|
||||
|
editFormVisible: false,//编辑界面是否显示 |
||||
|
editForm: { |
||||
|
projectId:'',userid:'',ctime:'',sendTime:'',username:'',projectName:'',remark:'',id:'',taskId:'',taskName:'',subjectId:'',bizSdate:'',bizEdate:'',actAt:'',costType:'',bizMonth:'',bizDate:'',subjectName:'',ubranchId:'',branchId:'' |
||||
|
}, |
||||
|
maxTableHeight:300, |
||||
|
} |
||||
|
},//end data |
||||
|
methods: { |
||||
|
|
||||
|
...util, |
||||
|
|
||||
|
handleSizeChange(pageSize) { |
||||
|
this.pageInfo.pageSize=pageSize; |
||||
|
this.getXmCostNlabors(); |
||||
|
}, |
||||
|
handleCurrentChange(pageNum) { |
||||
|
this.pageInfo.pageNum = pageNum; |
||||
|
this.getXmCostNlabors(); |
||||
|
}, |
||||
|
// 表格排序 obj.order=ascending/descending,需转化为 asc/desc ; obj.prop=表格中的排序字段,字段驼峰命名 |
||||
|
sortChange( obj ){ |
||||
|
if(obj.order==null){ |
||||
|
this.pageInfo.orderFields=[]; |
||||
|
this.pageInfo.orderDirs=[]; |
||||
|
}else{ |
||||
|
var dir='asc'; |
||||
|
if(obj.order=='ascending'){ |
||||
|
dir='asc' |
||||
|
}else{ |
||||
|
dir='desc'; |
||||
|
} |
||||
|
|
||||
|
this.pageInfo.orderFields=[util.toLine(obj.prop)]; |
||||
|
this.pageInfo.orderDirs=[dir]; |
||||
|
} |
||||
|
this.getXmCostNlabors(); |
||||
|
}, |
||||
|
searchXmCostNlabors(){ |
||||
|
this.pageInfo.count=true; |
||||
|
this.getXmCostNlabors(); |
||||
|
}, |
||||
|
//获取列表 XmCostNlabor 项目实际人工成本费用 |
||||
|
getXmCostNlabors() { |
||||
|
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.key=this.filters.key |
||||
|
} |
||||
|
|
||||
|
this.load.list = true; |
||||
|
listXmCostNlabor(params).then((res) => { |
||||
|
var tips=res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
this.pageInfo.total = res.data.total; |
||||
|
this.pageInfo.count=false; |
||||
|
this.xmCostNlabors = 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 ); |
||||
|
}, |
||||
|
|
||||
|
//显示编辑界面 XmCostNlabor 项目实际人工成本费用 |
||||
|
showEdit: function ( row,index ) { |
||||
|
this.editFormVisible = true; |
||||
|
this.editForm = Object.assign({}, row); |
||||
|
}, |
||||
|
//显示新增界面 XmCostNlabor 项目实际人工成本费用 |
||||
|
showAdd: function () { |
||||
|
this.addFormVisible = true; |
||||
|
//this.addForm=Object.assign({}, this.editForm); |
||||
|
}, |
||||
|
afterAddSubmit(){ |
||||
|
this.addFormVisible=false; |
||||
|
this.pageInfo.count=true; |
||||
|
this.getXmCostNlabors(); |
||||
|
}, |
||||
|
afterEditSubmit(){ |
||||
|
this.editFormVisible=false; |
||||
|
}, |
||||
|
//选择行xmCostNlabor |
||||
|
selsChange: function (sels) { |
||||
|
this.sels = sels; |
||||
|
}, |
||||
|
//删除xmCostNlabor |
||||
|
handleDel: function (row,index) { |
||||
|
this.$confirm('确认删除该记录吗?', '提示', { |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.load.del=true; |
||||
|
let params = { id:row.id }; |
||||
|
delXmCostNlabor(params).then((res) => { |
||||
|
this.load.del=false; |
||||
|
var tips=res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
this.searchXmCostNlabors(); |
||||
|
} |
||||
|
this.$notify({ position:'bottom-left', showClose:true, message: tips.msg, type: tips.isOk?'success':'error' }); |
||||
|
}).catch( err => this.load.del=false ); |
||||
|
}); |
||||
|
}, |
||||
|
//批量删除xmCostNlabor |
||||
|
batchDel: function () { |
||||
|
if(this.sels.length<=0){ |
||||
|
return; |
||||
|
} |
||||
|
var params=this.sels.map(i=>{ |
||||
|
return { id:i.id} |
||||
|
}) |
||||
|
this.$confirm('确认删除选中记录吗?', '提示', { |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.load.del=true; |
||||
|
batchDelXmCostNlabor(params).then((res) => { |
||||
|
this.load.del=false; |
||||
|
var tips=res.data.tips; |
||||
|
if( tips.isOk ){ |
||||
|
this.searchXmCostNlabors(); |
||||
|
} |
||||
|
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: tips.isOk?'success':'error'}); |
||||
|
}).catch( err => this.load.del=false ); |
||||
|
}); |
||||
|
}, |
||||
|
editSomeFields(row,fieldName,$event){ |
||||
|
let params={}; |
||||
|
if(this.sels.length>0){ |
||||
|
if(!this.sels.some(k=> k.id==row.id)){ |
||||
|
this.$notify({position:'bottom-left',showClose:true,message:'请编辑选中的行',type:'warning'}) |
||||
|
Object.assign(this.editForm,this.editFormBak) |
||||
|
return; |
||||
|
} |
||||
|
params['ids']=this.sels.map(i=>i.id) |
||||
|
}else{ |
||||
|
params['ids']=[row].map(i=>i.id) |
||||
|
} |
||||
|
params[fieldName]=$event |
||||
|
var func = editSomeFieldsXmCostNlabor |
||||
|
func(params).then(res=>{ |
||||
|
let tips = res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
if(this.sels.length>0){ |
||||
|
this.searchXmCostNlabors(); |
||||
|
} |
||||
|
this.editFormBak=[...this.editForm] |
||||
|
}else{ |
||||
|
Object.assign(this.editForm,this.editFormBak) |
||||
|
this.$notify({position:'bottom-left',showClose:true,message:tips.msg,type:tips.isOk?'success':'error'}) |
||||
|
} |
||||
|
}).catch((e)=>Object.assign(this.editForm,this.editFormBak)) |
||||
|
}, |
||||
|
rowClick: function(row, event, column){ |
||||
|
this.editForm=row |
||||
|
this.editFormBak={...row}; |
||||
|
this.$emit('row-click',row, event, column);// @row-click="rowClick" |
||||
|
}, |
||||
|
initData: function(){ |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
},//end methods |
||||
|
mounted() { |
||||
|
this.$nextTick(() => { |
||||
|
initDicts(this); |
||||
|
this.initData() |
||||
|
this.searchXmCostNlabors(); |
||||
|
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.xmCostNlaborTable.$el) |
||||
|
|
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue