Browse Source
Merge branch 'master' of http://www.qingqinkj.com/gitlab/qqkj/mmcloud/xm/xm-ui-web
master
Merge branch 'master' of http://www.qingqinkj.com/gitlab/qqkj/mmcloud/xm/xm-ui-web
master
56 changed files with 3520 additions and 2739 deletions
-
4src/api/xm/core/xmQuestion.js
-
30src/api/xm/core/xmTaskSbill.js
-
30src/api/xm/core/xmTaskWorkload.js
-
25src/router/routes_xm.js
-
66src/views/mdp/arc/tag/TagDialog.vue
-
41src/views/xm/XmOverview2.vue
-
127src/views/xm/core/components/XmItSelect.vue
-
318src/views/xm/core/components/XmIterationSelect.vue
-
119src/views/xm/core/components/XmMenuWorkload.vue
-
424src/views/xm/core/components/XmProductSelect.vue
-
357src/views/xm/core/components/XmProjectSelect.vue
-
98src/views/xm/core/components/XmTableConfig.vue
-
66src/views/xm/core/xmGroup/XmGroupDialog.vue
-
28src/views/xm/core/xmGroup/XmGroupMng.vue
-
34src/views/xm/core/xmGroup/XmGroupSelect.vue
-
14src/views/xm/core/xmIteration/XmIterationAdd.vue
-
3src/views/xm/core/xmIteration/XmIterationEdit.vue
-
13src/views/xm/core/xmIteration/XmIterationForLinkComplex.vue
-
5src/views/xm/core/xmIteration/XmIterationInfo.vue
-
51src/views/xm/core/xmIteration/XmIterationMng.vue
-
384src/views/xm/core/xmIteration/XmIterationSelect.vue
-
4src/views/xm/core/xmIterationLink/XmIterationLinkForProduct.vue
-
5src/views/xm/core/xmIterationLink/XmIterationLinkForProject.vue
-
101src/views/xm/core/xmIterationMenu/XmIterationMenuMng.vue
-
6src/views/xm/core/xmMenu/XmMenuAdd.vue
-
40src/views/xm/core/xmMenu/XmMenuEdit.vue
-
257src/views/xm/core/xmMenu/XmMenuMng.vue
-
165src/views/xm/core/xmMenu/XmMenuSelect.vue
-
23src/views/xm/core/xmProduct/XmProductForLinkComplex.vue
-
5src/views/xm/core/xmProduct/XmProductInfo.vue
-
18src/views/xm/core/xmProduct/XmProductMng.vue
-
347src/views/xm/core/xmProduct/XmProductSelect.vue
-
31src/views/xm/core/xmProductProjectLink/XmProductProjectLinkMng.vue
-
537src/views/xm/core/xmProject/XmProjectAdd.vue
-
304src/views/xm/core/xmProject/XmProjectEdit.vue
-
10src/views/xm/core/xmProject/XmProjectForLink.vue
-
22src/views/xm/core/xmProject/XmProjectForLinkComplex.vue
-
5src/views/xm/core/xmProject/XmProjectInfo.vue
-
293src/views/xm/core/xmProject/XmProjectList.vue
-
26src/views/xm/core/xmProject/XmProjectMng.vue
-
2src/views/xm/core/xmProject/XmProjectOverviewComplex.vue
-
198src/views/xm/core/xmProject/XmProjectSelect.vue
-
28src/views/xm/core/xmProjectState/XmProjectStateMng.vue
-
27src/views/xm/core/xmQuestion/XmQuestionAdd.vue
-
53src/views/xm/core/xmQuestion/XmQuestionEdit.vue
-
354src/views/xm/core/xmQuestion/XmQuestionMng.vue
-
2src/views/xm/core/xmTask/XmTaskAgileKanban.vue
-
4src/views/xm/core/xmTask/XmTaskList.vue
-
6src/views/xm/core/xmTask/XmTaskMng.vue
-
135src/views/xm/core/xmTaskSbill/SelectXmProject.vue
-
217src/views/xm/core/xmTaskSbill/XmTaskSbillEdit.vue
-
265src/views/xm/core/xmTaskSbill/XmTaskSbillMng.vue
-
174src/views/xm/core/xmTaskWorkload/XmTaskWorkloadEdit.vue
-
260src/views/xm/core/xmTaskWorkload/XmTaskWorkloadMng.vue
-
24src/views/xm/core/xmTestCase/XmTestCaseMng.vue
-
74src/views/xm/core/xmTestCaseExec/XmTestCaseExecMng.vue
@ -0,0 +1,30 @@ |
|||
import axios from '@/utils/request' |
|||
|
|||
import config from '@/common/config' |
|||
|
|||
let base = config.getCoreBasePath(); |
|||
|
|||
|
|||
/** |
|||
* 任务结算表 |
|||
*1 默认只开放普通查询,所有查询,只要上传 分页参数 {currentPage:当前页码从1开始,pageSize:每页记录数,total:总记录【数如果是0后台会自动计算总记录数非0不会自动计算】},后台都会自动按分页查询 其它 api用到再打开,没用到的api请注释掉, |
|||
*2 查询、新增、修改的参数格式 params={id:'结算单据编号 主键',title:'结算单标题',amt:'金额=工时表中结算金额之和',ctime:'创建时间',cuserid:'创建人编号',cusername:'创建人姓名',remark:'备注',branchId:'机构编号',deptid:'部门编号',cpId:'相对方编号(机构写机构号,个人写个人编号)',cpName:'相对方名称(机构写机构名称,个人写个人名称)',workload:'结算工作量=工时表中工时之和',bizMonth:'业务月份yyyy-MM',bizDate:'业务日期yyyy-MM-dd',bizFlowState:'结算流程状态',bizProcInstId:'结算流程实例',ltime:'更新时间',status:'0-待提交,1-已提交,2-已通过,3-已付款,4-已完成',fmsg:'最后审核意见',projectId:'项目编号',projectName:'项目名称'} |
|||
**/ |
|||
|
|||
//普通查询 条件之间and关系
|
|||
export const listXmTaskSbill = params => { return axios.get(`${base}/xm/core/xmTaskSbill/list`, { params: params }); }; |
|||
|
|||
//模糊查询任务结算表 条件之间or关系
|
|||
//export const listXmTaskSbillKey = params => { return axios.get(`${base}/xm/core/xmTaskSbill/listKey`, { params: params }); };
|
|||
|
|||
//删除一条任务结算表 params={id:'结算单据编号 主键'}
|
|||
export const delXmTaskSbill = params => { return axios.post(`${base}/xm/core/xmTaskSbill/del`,params); }; |
|||
|
|||
//批量删除任务结算表 params=[{id:'结算单据编号 主键'}]
|
|||
export const batchDelXmTaskSbill = params => { return axios.post(`${base}/xm/core/xmTaskSbill/batchDel`, params); }; |
|||
|
|||
//修改一条任务结算表记录
|
|||
export const editXmTaskSbill = params => { return axios.post(`${base}/xm/core/xmTaskSbill/edit`, params); }; |
|||
|
|||
//新增一条任务结算表
|
|||
export const addXmTaskSbill = params => { return axios.post(`${base}/xm/core/xmTaskSbill/add`, params); }; |
|||
@ -0,0 +1,30 @@ |
|||
import axios from '@/utils/request' |
|||
|
|||
import config from '@/common/config' |
|||
|
|||
let base = config.getCoreBasePath(); |
|||
|
|||
|
|||
/** |
|||
* 工时登记表 |
|||
*1 默认只开放普通查询,所有查询,只要上传 分页参数 {currentPage:当前页码从1开始,pageSize:每页记录数,total:总记录【数如果是0后台会自动计算总记录数非0不会自动计算】},后台都会自动按分页查询 其它 api用到再打开,没用到的api请注释掉, |
|||
*2 查询、新增、修改的参数格式 params={id:'主键 主键',userid:'员工编号',username:'姓名',ctime:'创建日期',taskId:'业务对象主键任务编号',cuserid:'创建人编号',bizDate:'业务日期yyyy-MM-dd',wstatus:'状态0-待确认,1-已确认,2-无效',remark:'备注',ttype:'任务类型-关联字典taskType',sbillId:'结算单据编号',stime:'结算提交时间',sstatus:'结算状态0-无需结算,1-待结算2-已提交3-已通过4-已结算',amt:'工时对应金额',samt:'结算金额',workload:'工时,一个task_id可多次提交,小时'} |
|||
**/ |
|||
|
|||
//普通查询 条件之间and关系
|
|||
export const listXmTaskWorkload = params => { return axios.get(`${base}/xm/core/xmTaskWorkload/list`, { params: params }); }; |
|||
|
|||
//模糊查询工时登记表 条件之间or关系
|
|||
//export const listXmTaskWorkloadKey = params => { return axios.get(`${base}/xm/core/xmTaskWorkload/listKey`, { params: params }); };
|
|||
|
|||
//删除一条工时登记表 params={id:'主键 主键'}
|
|||
export const delXmTaskWorkload = params => { return axios.post(`${base}/xm/core/xmTaskWorkload/del`,params); }; |
|||
|
|||
//批量删除工时登记表 params=[{id:'主键 主键'}]
|
|||
export const batchDelXmTaskWorkload = params => { return axios.post(`${base}/xm/core/xmTaskWorkload/batchDel`, params); }; |
|||
|
|||
//修改一条工时登记表记录
|
|||
export const editXmTaskWorkload = params => { return axios.post(`${base}/xm/core/xmTaskWorkload/edit`, params); }; |
|||
|
|||
//新增一条工时登记表
|
|||
export const addXmTaskWorkload = params => { return axios.post(`${base}/xm/core/xmTaskWorkload/add`, params); }; |
|||
@ -0,0 +1,66 @@ |
|||
<template> |
|||
<section> |
|||
<el-drawer title="选择标签" :visible.sync="visible" show-close append-to-body size="50%" @close="option=null"> |
|||
<tag-mng :jump="jump" :tagIds="tagIds" :visible="visible" @select-confirm="onSelectConfirm"></tag-mng> |
|||
</el-drawer> |
|||
</section> |
|||
</template> |
|||
|
|||
<script> |
|||
import util from '@/common/js/util'; //全局公共库 |
|||
import { |
|||
mapGetters |
|||
} from 'vuex' |
|||
import TagMng from "./TagMng.vue" |
|||
export default { |
|||
name:"tagDialog", |
|||
computed: { |
|||
...mapGetters([ |
|||
'workShop', 'userInfo' |
|||
]) |
|||
}, |
|||
// |
|||
props: ['jump', 'tagIds'], |
|||
watch: { |
|||
|
|||
}, |
|||
|
|||
data() { |
|||
return { |
|||
visible:false, |
|||
option:null/**{data:'',action:''} */, |
|||
} |
|||
}, //end data |
|||
methods: { |
|||
open(option){ |
|||
this.visible=true; |
|||
this.option=option; |
|||
}, |
|||
close(){ |
|||
this.visible=false; |
|||
this.option=null; |
|||
}, |
|||
/** |
|||
* @select-confirm |
|||
* |
|||
* |
|||
*/ |
|||
onSelectConfirm(selectTags){ |
|||
this.$emit('select-confirm',selectTags,{...this.option}) |
|||
this.visible=false; |
|||
this.option=null; |
|||
} |
|||
|
|||
}, //end methods |
|||
components: { |
|||
TagMng, |
|||
}, |
|||
mounted() { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
|||
@ -1,127 +0,0 @@ |
|||
<template> |
|||
<el-select v-model="iterationId" placeholder="迭代" @focus="focus" :clearable="clearable"> |
|||
<el-option v-for="(item,index) in xmIterations" :label="item.iterationName" :value="item.id" :key="index" ></el-option> |
|||
</el-select> |
|||
</template> |
|||
|
|||
<script> |
|||
import util from '@/common/js/util';//全局公共库 |
|||
import config from '@/common/config';//全局公共库 |
|||
import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询 |
|||
import { listXmIteration,listXmIterationWithState, delXmIteration, batchDelXmIteration,loadTasksToXmIterationState } from '@/api/xm/core/xmIteration'; |
|||
|
|||
const map={}; |
|||
|
|||
import { mapGetters } from 'vuex' |
|||
|
|||
export default { |
|||
computed: { |
|||
...mapGetters([ |
|||
'userInfo','roles' |
|||
]), |
|||
}, |
|||
props:[ 'clearable', 'value', 'productId','linkProjectId','autoSelect'], |
|||
watch:{ |
|||
productId:function(){ |
|||
this.initData(); |
|||
}, |
|||
|
|||
linkProjectId:function(){ |
|||
this.initData(); |
|||
}, |
|||
value(){ |
|||
this.iterationId=value; |
|||
}, |
|||
iterationId(){ |
|||
this.$emit("input",this.iterationId) |
|||
if(!this.iterationId){ |
|||
this.$emit("change",null) |
|||
return; |
|||
} |
|||
var iteration=this.xmIterations.find(i=>i.id==this.iterationId) |
|||
this.$emit("change",iteration) |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
load:{list:false,}, |
|||
iterationId:null, |
|||
xmIterations:null, |
|||
/**end 自定义属性请在上面加 请加备注**/ |
|||
} |
|||
},//end data |
|||
methods: { |
|||
focus(){ |
|||
if(!this.xmIterations){ |
|||
this.initData() |
|||
} |
|||
}, |
|||
|
|||
searchXmIterations(){ |
|||
this.getXmIterations(); |
|||
}, |
|||
//获取列表 XmIteration 迭代定义 |
|||
getXmIterations() { |
|||
var params={}; |
|||
if(this.productId){ |
|||
params.productId=this.productId |
|||
} |
|||
if(this.linkProjectId){ |
|||
params.linkProjectId=this.linkProjectId |
|||
} |
|||
this.load.list = true; |
|||
listXmIterationWithState(params).then((res) => { |
|||
var tips=res.data.tips; |
|||
if(tips.isOk){ |
|||
this.xmIterations = res.data.data; |
|||
if(this.productId){ |
|||
map['pd'+this.productId]=res.data.data |
|||
}else{ |
|||
map['pj'+this.linkProjectId]=res.data.data |
|||
} |
|||
|
|||
if(this.autoSelect===true&&this.xmIterations.length>0){ |
|||
var row=this.xmIterations[0]; |
|||
this.iterationId=row.id |
|||
} |
|||
}else{ |
|||
this.$notify({showClose: true, message: tips.msg, type: 'error' }); |
|||
} |
|||
this.load.list = false; |
|||
}).catch( err => this.load.list = false ); |
|||
}, |
|||
initData(){ |
|||
if(this.productId){ |
|||
var xmIterations=map['pd'+this.productId] |
|||
if(!xmIterations){ |
|||
this.getXmIterations(); |
|||
}else{ |
|||
this.xmIterations=xmIterations; |
|||
} |
|||
}else{ |
|||
if(this.linkProjectId){ |
|||
var xmIterations=map['pj'+this.linkProjectId] |
|||
if(!xmIterations){ |
|||
this.getXmIterations(); |
|||
}else{ |
|||
this.xmIterations=xmIterations; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
},//end methods |
|||
components: { |
|||
//在下面添加其它组件 |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
//this.initData(); |
|||
}); |
|||
|
|||
} |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
</style> |
|||
@ -0,0 +1,318 @@ |
|||
<template> |
|||
<section> |
|||
<el-popover style="display:inline;" |
|||
placement="bottom" |
|||
width="400" |
|||
v-model="iterationVisible" |
|||
trigger="manual" > |
|||
<el-row> |
|||
<el-table ref="table" :height="maxTableHeight" :data="xmIterations" row-key="id" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;"> |
|||
<el-table-column prop="iterationName" label="迭代" > |
|||
<template slot="header" slot-scope="scope"> |
|||
迭代 |
|||
<span style="float:right;"> |
|||
<el-button v-if="clearable!==false && editForm && editForm.id" type="text" @click="clearSelectIteration">清空</el-button> <el-button type="text" @click="close">关闭</el-button> |
|||
<el-popover |
|||
placement="top-start" |
|||
title="" |
|||
v-model="moreVisible" |
|||
width="400" |
|||
trigger="manual" > |
|||
<el-row> |
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<font class="more-label-font">迭代编号:</font><el-input v-model="filters.id" placeholder="输入迭代编号"> |
|||
</el-input> |
|||
</el-col> |
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<font class="more-label-font">上线时间:</font> |
|||
<el-date-picker |
|||
v-model="dateRangerOnline" |
|||
type="daterange" |
|||
align="right" |
|||
unlink-panels |
|||
range-separator="至" |
|||
start-placeholder="开始日期" |
|||
end-placeholder="完成日期" |
|||
value-format="yyyy-MM-dd HH:mm:ss" |
|||
:default-time="['00:00:00','23:59:59']" |
|||
:picker-options="pickerOptions" |
|||
></el-date-picker> |
|||
</el-col> |
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<font class="more-label-font">迭代名称:</font><el-input v-model="filters.key" placeholder="模糊查询"></el-input> |
|||
</el-col> |
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<el-button type="text" @click="moreVisible=false">关闭</el-button> |
|||
<el-button type="primary" icon="el-icon-search" @click="searchXmIterations">查询</el-button> |
|||
</el-col> |
|||
</el-row> |
|||
<el-button type="text" slot="reference" style="float:right;" @click="moreVisible=!moreVisible" icon="el-icon-search">更多条件</el-button> |
|||
</el-popover> |
|||
</span> |
|||
</template> |
|||
<template slot-scope="scope"> |
|||
|
|||
{{scope.row.iterationName}} <font :color="calcFinishRate(scope.row)==100?'green':'#FF8C00'">{{calcFinishRate(scope.row)}}%</font> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination layout="total, prev, 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-link title="点击选中迭代" @click="iterationVisible=!iterationVisible" type="warning" slot="reference" icon="el-icon-search"><font style="font-size:14px;"><slot name="title">{{editForm&&editForm.id?editForm.iterationName:'选择迭代'}}</slot></font></el-link> |
|||
</el-popover> |
|||
</section> |
|||
</template> |
|||
|
|||
<script> |
|||
import util from '@/common/js/util';//全局公共库 |
|||
import config from '@/common/config';//全局公共库 |
|||
import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询 |
|||
import { listXmIteration,listXmIterationWithState, delXmIteration, batchDelXmIteration,loadTasksToXmIterationState } from '@/api/xm/core/xmIteration'; |
|||
|
|||
const map=new Map(); |
|||
import { mapGetters } from 'vuex' |
|||
|
|||
export default { |
|||
computed: { |
|||
...mapGetters([ |
|||
'userInfo','roles' |
|||
]), |
|||
}, |
|||
props:['clearable', 'productId', 'linkProjectId','autoSelect'], |
|||
watch:{ |
|||
productId:function(){ |
|||
this.initData(); |
|||
}, |
|||
linkProjectId:function(){ |
|||
this.initData(); |
|||
} |
|||
}, |
|||
data() { |
|||
const beginDate = new Date(); |
|||
const endDate = new Date(); |
|||
beginDate.setTime(beginDate.getTime() - 3600 * 1000 * 24 * 7 * 4 * 12 ); |
|||
endDate.setTime(endDate.getTime() + 3600 * 1000 * 24 * 7 * 4 * 12 ); |
|||
return { |
|||
filters: { |
|||
key: '', |
|||
queryScope:'',//迭代查询范围 iterationId\branchId\compete\'' |
|||
id:'',//迭代编号 |
|||
}, |
|||
pickerOptions: util.pickerOptions('datarange'), |
|||
dateRangerOnline: [ |
|||
],//上线时间选择范围 |
|||
xmIterations: [],//查询结果 |
|||
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:[], |
|||
},//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]} |
|||
|
|||
//新增xmIteration界面初始化数据 |
|||
addForm: { |
|||
id:'',branchId:'',iterationName:'',startTime:'',endTime:'',onlineTime:'',pid:'',adminUserid:'',adminUsername:'',ctime:'',budgetCost:'',budgetWorkload:'',distBudgetCost:'',distBudgetWorkload:'',actCost:'',actWorkload:'',actStaffNum:'',seqNo:'', |
|||
}, |
|||
//编辑xmIteration界面初始化数据 |
|||
editForm: { |
|||
id:'',branchId:'',iterationName:'',startTime:'',endTime:'',onlineTime:'',pid:'',adminUserid:'',adminUsername:'',ctime:'',budgetCost:'',budgetWorkload:'',distBudgetCost:'',distBudgetWorkload:'',actCost:'',actWorkload:'',actStaffNum:'',seqNo:'', |
|||
}, |
|||
|
|||
editFormInit: { |
|||
id:'',branchId:'',iterationName:'',startTime:'',endTime:'',onlineTime:'',pid:'',adminUserid:'',adminUsername:'',ctime:'',budgetCost:'',budgetWorkload:'',distBudgetCost:'',distBudgetWorkload:'',actCost:'',actWorkload:'',actStaffNum:'',seqNo:'', |
|||
}, |
|||
/**begin 自定义属性请在下面加 请加备注**/ |
|||
maxTableHeight:300, |
|||
iterationVisible:false, |
|||
moreVisible:false, |
|||
/**end 自定义属性请在上面加 请加备注**/ |
|||
} |
|||
},//end data |
|||
methods: { |
|||
handleSizeChange(pageSize) { |
|||
this.pageInfo.pageSize=pageSize; |
|||
this.getXmIterations(); |
|||
}, |
|||
handleCurrentChange(pageNum) { |
|||
this.pageInfo.pageNum = pageNum; |
|||
this.getXmIterations(); |
|||
}, |
|||
// 表格排序 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.getXmIterations(); |
|||
}, |
|||
searchXmIterations(){ |
|||
this.pageInfo.count=true; |
|||
this.getXmIterations(); |
|||
}, |
|||
//获取列表 XmIteration 迭代定义 |
|||
getXmIterations() { |
|||
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+"%" |
|||
} |
|||
if(this.productId){ |
|||
params.productId=this.productId |
|||
} |
|||
|
|||
if(this.linkProjectId){ |
|||
params.linkProjectId=this.linkProjectId |
|||
} |
|||
|
|||
if(this.dateRangerOnline && this.dateRangerOnline.length==2){ |
|||
params.onlineTimeStart=this.dateRangerOnline[0] |
|||
params.onlineTimeEnd=this.dateRangerOnline[1] |
|||
} |
|||
this.load.list = true; |
|||
listXmIterationWithState(params).then((res) => { |
|||
var tips=res.data.tips; |
|||
if(tips.isOk){ |
|||
this.pageInfo.total = res.data.total; |
|||
this.pageInfo.count=false; |
|||
this.xmIterations = res.data.data; |
|||
if(this.productId){ |
|||
map.set(this.productId,this.xmIterations) |
|||
}else if(this.linkProjectId){ |
|||
map.set(this.linkProjectId,this.xmIterations) |
|||
} |
|||
if(this.autoSelect===true&&this.xmIterations.length>0){ |
|||
if(this.autoSelect!==false&&this.xmIterations.length>0 && this.iterationVisible==false){ |
|||
var row=this.xmIterations[0]; |
|||
this.$refs.table.setCurrentRow(row); |
|||
this.rowClick(row) |
|||
} |
|||
} |
|||
}else{ |
|||
this.$notify({showClose: true, message: tips.msg, type: 'error' }); |
|||
} |
|||
this.load.list = false; |
|||
}).catch( err => this.load.list = false ); |
|||
}, |
|||
|
|||
//选择行xmIteration |
|||
selsChange: function (sels) { |
|||
this.sels = sels; |
|||
}, |
|||
rowClick: function(row, event, column){ |
|||
var oldId=this.editForm.id |
|||
this.editForm=row |
|||
this.iterationVisible=false; |
|||
this.moreVisible=false; |
|||
if(oldId!=this.editForm.id){ |
|||
this.$emit("change",row) |
|||
} |
|||
this.$emit('row-click',row, event, column);// @row-click="rowClick" |
|||
}, |
|||
/**end 自定义函数请在上面加**/ |
|||
calcFinishRate(row){ |
|||
if(row.finishRate){ |
|||
return parseInt(row.finishRate); |
|||
}else{ |
|||
return 0; |
|||
} |
|||
}, |
|||
close(){ |
|||
this.iterationVisible=false; |
|||
this.$emit("close") |
|||
}, |
|||
initData(){ |
|||
if(this.productId){ |
|||
var xmIterations=map.get(this.productId); |
|||
if(xmIterations){ |
|||
this.xmIterations=xmIterations; |
|||
if(this.autoSelect!==false&&this.xmIterations.length>0 && this.iterationVisible==false){ |
|||
var row=this.xmIterations[0]; |
|||
this.$refs.table.setCurrentRow(row); |
|||
this.rowClick(row) |
|||
} |
|||
}else{ |
|||
this.searchXmIterations(); |
|||
} |
|||
}else if(this.linkProjectId){ |
|||
var xmIterations=map.get(this.linkProjectId); |
|||
if(xmIterations){ |
|||
this.xmIterations=xmIterations; |
|||
if(this.autoSelect!==false&&this.xmIterations.length>0 && this.iterationVisible==false){ |
|||
var row=this.xmIterations[0]; |
|||
this.$refs.table.setCurrentRow(row); |
|||
this.rowClick(row) |
|||
} |
|||
}else{ |
|||
this.searchXmIterations(); |
|||
} |
|||
}else{ |
|||
//his.searchXmIterations(); |
|||
} |
|||
}, |
|||
|
|||
|
|||
clearSelectIteration(){ |
|||
var oldId=this.editForm.id |
|||
this.editForm=this.editFormInit |
|||
this.$refs.table.setCurrentRow(); |
|||
if(oldId!=this.editForm.id){ |
|||
this.$emit("change",null) |
|||
} |
|||
this.iterationVisible=false; |
|||
this.moreVisible=false; |
|||
this.$emit('clear',null );// @row-click="rowClick" |
|||
}, |
|||
},//end methods |
|||
components: { |
|||
//在下面添加其它组件 |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.initData(); |
|||
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el); |
|||
}); |
|||
|
|||
} |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style rel="stylesheet/scss" lang="scss" scoped> |
|||
.more-label-font{ |
|||
text-align:center; |
|||
float:left; |
|||
padding-top:5px; |
|||
} |
|||
.font-class{ |
|||
color: rgba(116, 85, 85, 0.493); |
|||
} |
|||
|
|||
.align-right{ |
|||
float: right; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,119 @@ |
|||
<template> |
|||
<section> |
|||
<el-popover |
|||
placement="bottom" |
|||
width="500" |
|||
v-model="formVisible" |
|||
trigger="manual" > <el-form :model="editForm" label-width="100px" ref="editForm"> |
|||
<el-form-item label="汇总方式" prop="calcType"> |
|||
<el-radio v-model="editForm.calcType" label="3" placeholder="下级往上级汇总" :disabled="editForm.ntype!=='0'">下往上</el-radio> |
|||
<el-radio v-model="editForm.calcType" label="1" placeholder="由任务汇总" :disabled="editForm.ntype!=='0'">任务汇总</el-radio> |
|||
<el-radio v-model="editForm.calcType" label="2" placeholder="手工填报" :disabled="editForm.ntype!=='0'">手工填报</el-radio> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="工时进度" prop="mactRate" > |
|||
<el-progress style="width:50%;" :stroke-width="15" :percentage="editForm.mactRate?editForm.mactRate:0"></el-progress> |
|||
</el-form-item> |
|||
<el-form-item label="预估工期" prop="budgetHours"> |
|||
<el-input-number :disabled="editForm.calcType!=='2' " style="width:200px;" v-model="editForm.budgetHours" :precision="2" :step="8" :min="0" placeholder="预计工期(小时)"></el-input-number> h |
|||
</el-form-item> |
|||
<el-form-item label="预估工时" prop="budgetWorkload"> |
|||
<el-input-number :disabled="editForm.calcType!=='2' " style="width:200px;" v-model="editForm.budgetWorkload" :precision="2" :step="8" :min="0" placeholder="预计工时(人时)"></el-input-number> h |
|||
</el-form-item> |
|||
<el-form-item label="实际工时" prop="mactWorkload"> |
|||
<el-input-number :disabled="editForm.calcType!=='2' " style="width:200px;" v-model="editForm.mactWorkload" :precision="2" :step="8" :min="0" placeholder="实际工时(人时)"></el-input-number> h |
|||
</el-form-item> |
|||
<font color="blue" style="font-size:10px;">控制规则: |
|||
<br>下级往上汇总:指工时数据按 用户故事->特性->史诗 这样的汇总关系将数据逐级往上汇总。 |
|||
<br>由任务汇总: 指用户故事的工时数据由任务汇总。 |
|||
<br>手工填报: 指用户故事的工时数据来自手工填报,无论是否关联了任务,都不从任务汇总。 |
|||
</font> |
|||
|
|||
<el-form-item label="" class="padding"> |
|||
<el-button type="text" @click="cancel">关闭</el-button> |
|||
<el-button :disabled="editForm.calcType!=='2'" type="primary" @click="submit">确认</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-button title="点击填写工时" @click="formVisible=!formVisible" type="warning" slot="reference" icon="el-icon-edit"><font style="font-size:14px;"></font></el-button> |
|||
</el-popover> |
|||
</section> |
|||
</template> |
|||
|
|||
<script> |
|||
import util from '@/common/js/util';//全局公共库 |
|||
import config from '@/common/config';//全局公共库 |
|||
import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询 |
|||
|
|||
import { mapGetters } from 'vuex' |
|||
|
|||
export default { |
|||
computed: { |
|||
...mapGetters([ |
|||
'userInfo','roles' |
|||
]), |
|||
}, |
|||
props:['menu'], |
|||
watch:{ |
|||
menu(){ |
|||
this.editForm={...this.menu} |
|||
}, |
|||
'editForm.mactWorkload':function(val,oldVal){ |
|||
if(!this.editForm.budgetWorkload){ |
|||
return; |
|||
} |
|||
if(val==0||!val){ |
|||
return; |
|||
} |
|||
this.editForm.mactRate=Math.round(val/this.editForm.budgetWorkload*100) |
|||
if( this.editForm.mactRate>100){ |
|||
this.editForm.mactRate=100; |
|||
} |
|||
}, |
|||
'editForm.budgetWorkload':function(val,oldVal){ |
|||
if(!this.editForm.mactWorkload){ |
|||
return; |
|||
} |
|||
if(val==0||!val){ |
|||
return; |
|||
} |
|||
this.editForm.mactRate=Math.round(this.editForm.mactWorkload/val*100) |
|||
if( this.editForm.mactRate>100){ |
|||
this.editForm.mactRate=100; |
|||
} |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
editForm: { |
|||
menuId:'',menuName:'',pmenuId:'',productId:'',remark:'',status:'',online:'',demandUrl:'',codeUrl:'',designUrl:'',docUrl:'',helpUrl:'',operDocUrl:'',seqNo:'1',mmUserid:'',mmUsername:'',ntype:'0',childrenCnt:0,sinceVersion:'', |
|||
proposerId:'',proposerName:'',dlvl:'',dtype:'',priority:'',source:'',calcType:'1',mactWorkload:0,mactAmount:0,mactRate:0 |
|||
}, |
|||
formVisible:false, |
|||
} |
|||
},//end data |
|||
methods: { |
|||
cancel(){ |
|||
this.formVisible=false; |
|||
this.$emit("cancel") |
|||
}, |
|||
submit(){ |
|||
var params={mactRate:this.editForm.mactRate,menuId:this.editForm.menuId,mactWorkload:this.editForm.mactWorkload,budgetWorkload:this.editForm.budgetWorkload,budgetHours:this.editForm.budgetHours,calcType:this.editForm.calcType} |
|||
this.$emit("submit",params); |
|||
this.formVisible=false; |
|||
} |
|||
},//end methods |
|||
components: { |
|||
//在下面添加其它组件 |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.editForm={...this.menu} |
|||
}); |
|||
|
|||
} |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
</style> |
|||
@ -0,0 +1,424 @@ |
|||
<template> |
|||
<section> |
|||
<el-popover v-if="!dialog" |
|||
placement="bottom" |
|||
width="400" |
|||
trigger="manual" |
|||
v-model="productVisible"> |
|||
|
|||
<el-row > |
|||
<!--列表 XmProduct 产品表--> |
|||
<el-table ref="table" :height="maxTableHeight" :data="xmProducts" :row-class-name="tableRowClassName" @sort-change="sortChange" :highlight-current-row="true" current-row-key="id" v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;"> |
|||
<el-table-column prop="productName" label="产品名称"> |
|||
<template slot="header" slot-scope="scope"> |
|||
产品名称 |
|||
<span style="float:right;"> |
|||
<el-button type="text" @click="clearSelect">清空</el-button> |
|||
<el-button type="text" @click="close">关闭</el-button> |
|||
<el-popover |
|||
placement="top-start" |
|||
title="" |
|||
width="400" |
|||
v-model="moreVisible" |
|||
trigger="manual" > |
|||
<el-row> |
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<font class="more-label-font">产品编号:</font> |
|||
<el-input v-model="filters.id" style="width:100%;" placeholder="输入产品编号" @keyup.enter.native="searchXmProducts"> |
|||
</el-input> |
|||
</el-col> |
|||
|
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<font class="more-label-font">创建时间:</font> |
|||
<el-date-picker |
|||
v-model="dateRanger" |
|||
type="daterange" |
|||
align="right" |
|||
unlink-panels |
|||
range-separator="至" |
|||
start-placeholder="开始日期" |
|||
end-placeholder="完成日期" |
|||
value-format="yyyy-MM-dd HH:mm:ss" |
|||
:default-time="['00:00:00','23:59:59']" |
|||
:picker-options="pickerOptions" |
|||
></el-date-picker> |
|||
</el-col> |
|||
|
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<font class="more-label-font"> |
|||
产品名称: |
|||
</font> |
|||
<el-input v-model="filters.key" style="width:100%;" placeholder="输入产品名字关键字"> |
|||
</el-input> |
|||
</el-col> |
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<font class="more-label-font"> |
|||
产品经理: |
|||
</font> |
|||
<el-tag v-if="filters.pmUser" closable @click="selectFiltersPmUser" @close="clearFiltersPmUser()">{{filters.pmUser.username}}</el-tag> |
|||
<el-button v-else @click="selectFiltersPmUser()">选责任人</el-button> |
|||
<el-button @click="setFiltersPmUserAsMySelf()">我的</el-button> |
|||
</el-col> |
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<el-button type="text" @click="moreVisible=false" >关闭</el-button><el-button type="primary" @click="searchXmProducts" >查询</el-button> |
|||
</el-col> |
|||
</el-row> |
|||
<el-button type="text" slot="reference" @click="moreVisible=!moreVisible" style="float:right;">更多条件</el-button> |
|||
</el-popover> |
|||
</span> |
|||
</template> |
|||
<template slot-scope="scope"> |
|||
<font>{{scope.row.productName}}</font> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination layout="total, prev, 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> |
|||
<slot name="reference"><el-link title="产品,点击选择、清除选择" @click="productVisible=!productVisible" type="warning" slot="reference" icon="el-icon-search"><font style="font-size:14px;"><slot name="title">{{editForm && editForm.id?editForm.productName:'选择产品'}}</slot></font></el-link> </slot> |
|||
</el-popover> |
|||
<el-dialog v-if="dialog" append-to-body |
|||
v-model="productVisible"> |
|||
|
|||
<el-row > |
|||
<!--列表 XmProduct 产品表--> |
|||
<el-table ref="table" :height="maxTableHeight" :data="xmProducts" :row-class-name="tableRowClassName" @sort-change="sortChange" :highlight-current-row="true" current-row-key="id" v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;"> |
|||
<el-table-column prop="productName" label="产品名称"> |
|||
<template slot="header" slot-scope="scope"> |
|||
产品名称 |
|||
<span style="float:right;"> |
|||
<el-button type="text" @click="clearSelect">清空</el-button> |
|||
<el-button type="text" @click="close">关闭</el-button> |
|||
<el-popover |
|||
placement="top-start" |
|||
title="" |
|||
width="400" |
|||
v-model="moreVisible" |
|||
trigger="manual" > |
|||
<el-row> |
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<font class="more-label-font">产品编号:</font> |
|||
<el-input v-model="filters.id" style="width:100%;" placeholder="输入产品编号" @keyup.enter.native="searchXmProducts"> |
|||
</el-input> |
|||
</el-col> |
|||
|
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<font class="more-label-font">创建时间:</font> |
|||
<el-date-picker |
|||
v-model="dateRanger" |
|||
type="daterange" |
|||
align="right" |
|||
unlink-panels |
|||
range-separator="至" |
|||
start-placeholder="开始日期" |
|||
end-placeholder="完成日期" |
|||
value-format="yyyy-MM-dd HH:mm:ss" |
|||
:default-time="['00:00:00','23:59:59']" |
|||
:picker-options="pickerOptions" |
|||
></el-date-picker> |
|||
</el-col> |
|||
|
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<font class="more-label-font"> |
|||
产品名称: |
|||
</font> |
|||
<el-input v-model="filters.key" style="width:100%;" placeholder="输入产品名字关键字"> |
|||
</el-input> |
|||
</el-col> |
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<font class="more-label-font"> |
|||
产品经理: |
|||
</font> |
|||
<el-tag v-if="filters.pmUser" closable @click="selectFiltersPmUser" @close="clearFiltersPmUser()">{{filters.pmUser.username}}</el-tag> |
|||
<el-button v-else @click="selectFiltersPmUser()">选责任人</el-button> |
|||
<el-button @click="setFiltersPmUserAsMySelf()">我的</el-button> |
|||
</el-col> |
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<el-button type="text" @click="moreVisible=false" >关闭</el-button><el-button type="primary" @click="searchXmProducts" >查询</el-button> |
|||
</el-col> |
|||
</el-row> |
|||
<el-button type="text" slot="reference" @click="moreVisible=!moreVisible" style="float:right;">更多条件</el-button> |
|||
</el-popover> |
|||
</span> |
|||
</template> |
|||
<template slot-scope="scope"> |
|||
<font>{{scope.row.productName}}</font> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination layout="total, prev, 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-dialog> |
|||
</section> |
|||
</template> |
|||
|
|||
<script> |
|||
import util from '@/common/js/util';//全局公共库 |
|||
//import Sticky from '@/components/Sticky' // 粘性header组件 |
|||
//import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询 |
|||
import { listXmProductWithState } from '@/api/xm/core/xmProduct'; |
|||
import { mapGetters } from 'vuex' |
|||
import UsersSelect from "@/views/mdp/sys/user/UsersSelect"; |
|||
const map=new Map(); |
|||
|
|||
export default { |
|||
props:['dialog','linkProjectId','iterationId','autoSelect'], |
|||
computed: { |
|||
...mapGetters([ |
|||
'userInfo','roles' |
|||
]) |
|||
}, |
|||
watch:{ |
|||
iterationId(){ |
|||
this.initData(); |
|||
}, |
|||
|
|||
linkProjectId(){ |
|||
this.initData(); |
|||
} |
|||
}, |
|||
data() { |
|||
const beginDate = new Date(); |
|||
const endDate = new Date(); |
|||
beginDate.setTime(beginDate.getTime() - 3600 * 1000 * 24 * 7 * 4 * 12 ); |
|||
return { |
|||
filters: { |
|||
key: '', |
|||
id:'',//产品编号 |
|||
pmUser:null,//产品经理 |
|||
|
|||
}, |
|||
xmProducts: [],//查询结果 |
|||
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:{},//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]} |
|||
|
|||
//新增xmProduct界面初始化数据 |
|||
addForm: { |
|||
id:'',productName:'',branchId:'',remark:'' |
|||
}, |
|||
|
|||
//编辑xmProduct界面初始化数据 |
|||
editForm: { |
|||
id:'',productName:'',branchId:'',remark:'' |
|||
}, |
|||
selectFiltersPmUserVisible:false, |
|||
maxTableHeight:300, |
|||
dateRanger: [ ], |
|||
pickerOptions: util.pickerOptions('datarange'), |
|||
productVisible:false, |
|||
moreVisible:false, |
|||
/**begin 自定义属性请在下面加 请加备注**/ |
|||
|
|||
/**end 自定义属性请在上面加 请加备注**/ |
|||
} |
|||
},//end data |
|||
methods: { |
|||
handleSizeChange(pageSize) { |
|||
this.pageInfo.pageSize=pageSize; |
|||
this.getXmProducts(); |
|||
}, |
|||
handleCurrentChange(pageNum) { |
|||
this.pageInfo.pageNum = pageNum; |
|||
this.getXmProducts(); |
|||
}, |
|||
// 表格排序 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.getXmProducts(); |
|||
}, |
|||
searchXmProducts(){ |
|||
this.pageInfo.count=true; |
|||
this.getXmProducts(); |
|||
}, |
|||
//获取列表 XmProduct 产品表 |
|||
getXmProducts() { |
|||
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+"%" |
|||
} |
|||
if(this.linkProjectId){ |
|||
params.projectId=this.linkProjectId |
|||
} |
|||
if(this.iterationId){ |
|||
params.iterationId=this.iterationId |
|||
} |
|||
if(this.filters.id){ |
|||
params.id=this.filters.id |
|||
} |
|||
|
|||
if(this.filters.pmUser){ |
|||
params.pmUserid=this.filters.pmUser.userid |
|||
} |
|||
this.load.list = true; |
|||
listXmProductWithState(params).then((res) => { |
|||
var tips=res.data.tips; |
|||
if(tips.isOk){ |
|||
this.pageInfo.total = res.data.total; |
|||
this.pageInfo.count=false; |
|||
this.xmProducts = res.data.data; |
|||
if(this.iterationId){ |
|||
map.set(this.iterationId,this.xmProducts) |
|||
}else if(this.linkProjectId){ |
|||
map.set(this.linkProjectId,this.xmProducts) |
|||
} |
|||
if(this.autoSelect!==false&&this.xmProducts.length>0 && this.productVisible==false){ |
|||
var row=this.xmProducts[0]; |
|||
this.$refs.table.setCurrentRow(row); |
|||
this.rowClick(row); |
|||
} |
|||
}else{ |
|||
this.$notify({showClose: true, message: tips.msg, type: 'error' }); |
|||
} |
|||
this.load.list = false; |
|||
}).catch( err => this.load.list = false ); |
|||
}, |
|||
|
|||
//选择行xmProduct |
|||
selsChange: function (sels) { |
|||
this.sels = sels; |
|||
}, |
|||
|
|||
rowClick: function(row, event, column){ |
|||
this.editForm=row |
|||
this.$emit('row-click',row, event, column);// @row-click="rowClick" |
|||
this.selectedProduct(row) |
|||
this.productVisible=false; |
|||
this.moreVisible=false; |
|||
}, |
|||
selectedProduct:function(row){ |
|||
this.editForm=row |
|||
this.$emit('selected',row); |
|||
this.productVisible=false; |
|||
this.moreVisible=false; |
|||
}, |
|||
|
|||
/**begin 自定义函数请在下面加**/ |
|||
clearFiltersPmUser:function(){ |
|||
this.filters.pmUser=null; |
|||
this.searchXmProducts(); |
|||
}, |
|||
selectFiltersPmUser(){ |
|||
this.selectFiltersPmUserVisible=true; |
|||
}, |
|||
onFiltersPmUserSelected(users){ |
|||
if(users && users.length>0){ |
|||
this.filters.pmUser=users[0] |
|||
}else{ |
|||
this.filters.pmUser=null; |
|||
} |
|||
this.selectFiltersPmUserVisible=false; |
|||
this.searchXmProducts(); |
|||
}, |
|||
setFiltersPmUserAsMySelf(){ |
|||
this.filters.pmUser=this.userInfo; |
|||
this.searchXmProducts(); |
|||
}, |
|||
|
|||
tableRowClassName({row, rowIndex}) { |
|||
if (row.id == this.editForm.id) { |
|||
return 'success-row'; |
|||
} |
|||
return ''; |
|||
}, |
|||
clearSelect(){ |
|||
this.$refs.table.setCurrentRow(); |
|||
this.$emit("clear-select"); |
|||
this.selectedProduct(null); |
|||
this.productVisible=false; |
|||
this.moreVisible=false; |
|||
}, |
|||
close(){ |
|||
this.productVisible=false; |
|||
this.moreVisible=false; |
|||
this.$emit("close"); |
|||
}, |
|||
|
|||
initData(){ |
|||
|
|||
if(this.iterationId){ |
|||
var xmProducts=map.get(this.iterationId); |
|||
if(xmProducts){ |
|||
this.xmProducts=xmProducts; |
|||
if(this.productVisible==false){ |
|||
if(this.autoSelect!==false && this.xmProducts.length>0){ |
|||
var row=this.xmProducts[0]; |
|||
this.$refs.table.setCurrentRow(row); |
|||
this.rowClick(row); |
|||
} |
|||
} |
|||
}else{ |
|||
this.searchXmProducts(); |
|||
} |
|||
}else if(this.linkProjectId){ |
|||
var xmProducts=map.get(this.linkProjectId); |
|||
if(xmProducts){ |
|||
this.xmProducts=xmProducts; |
|||
if(this.productVisible==false){ |
|||
if(this.autoSelect!==false && this.xmProducts.length>0){ |
|||
var row=this.xmProducts[0]; |
|||
this.$refs.table.setCurrentRow(row); |
|||
this.rowClick(row); |
|||
} |
|||
} |
|||
}else{ |
|||
this.searchXmProducts(); |
|||
} |
|||
}else{ |
|||
this.searchXmProducts(); |
|||
} |
|||
}, |
|||
},//end methods |
|||
components: { |
|||
UsersSelect, |
|||
//在下面添加其它组件 |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el); |
|||
this.initData(); |
|||
}); |
|||
} |
|||
} |
|||
|
|||
</script> |
|||
<style scoped> |
|||
|
|||
|
|||
.more-label-font{ |
|||
text-align:center; |
|||
float:left; |
|||
padding-top:5px; |
|||
} |
|||
.align-right{ |
|||
float: right; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,357 @@ |
|||
<template> |
|||
<section> |
|||
<el-popover |
|||
placement="bottom" |
|||
width="400" |
|||
trigger="manual" |
|||
v-model="projectVisible"> |
|||
|
|||
<el-row > |
|||
<!--列表 XmProject 项目表--> |
|||
<el-table ref="table" :height="maxTableHeight" :data="xmProjects" :row-class-name="tableRowClassName" @sort-change="sortChange" :highlight-current-row="true" current-row-key="id" v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;"> |
|||
<el-table-column prop="name" label="项目名称"> |
|||
<template slot="header" slot-scope="scope"> |
|||
项目名称 |
|||
<span style="float:right;"> |
|||
<el-button type="text" @click="clearSelect">清空</el-button> |
|||
<el-button type="text" @click="close">关闭</el-button> |
|||
<el-popover |
|||
placement="top-start" |
|||
title="" |
|||
width="400" |
|||
v-model="moreVisible" |
|||
trigger="manual" > |
|||
<el-row> |
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<font class="more-label-font">项目编号:</font> |
|||
<el-input v-model="filters.id" style="width:100%;" placeholder="输入项目编号" @keyup.enter.native="searchXmProjects"> |
|||
</el-input> |
|||
</el-col> |
|||
|
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<font class="more-label-font">创建时间:</font> |
|||
<el-date-picker |
|||
v-model="dateRanger" |
|||
type="daterange" |
|||
align="right" |
|||
unlink-panels |
|||
range-separator="至" |
|||
start-placeholder="开始日期" |
|||
end-placeholder="完成日期" |
|||
value-format="yyyy-MM-dd HH:mm:ss" |
|||
:default-time="['00:00:00','23:59:59']" |
|||
:picker-options="pickerOptions" |
|||
></el-date-picker> |
|||
</el-col> |
|||
|
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<font class="more-label-font"> |
|||
项目名称: |
|||
</font> |
|||
<el-input v-model="filters.key" style="width:100%;" placeholder="输入项目名字关键字"> |
|||
</el-input> |
|||
</el-col> |
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<font class="more-label-font"> |
|||
项目经理: |
|||
</font> |
|||
<el-tag v-if="filters.pmUser" closable @click="selectFiltersPmUser" @close="clearFiltersPmUser()">{{filters.pmUser.username}}</el-tag> |
|||
<el-button v-else @click="selectFiltersPmUser()">选责任人</el-button> |
|||
<el-button @click="setFiltersPmUserAsMySelf()">我的</el-button> |
|||
</el-col> |
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<el-button type="text" @click="moreVisible=false" >关闭</el-button><el-button type="primary" @click="searchXmProjects" >查询</el-button> |
|||
</el-col> |
|||
</el-row> |
|||
<el-button type="text" slot="reference" @click="moreVisible=!moreVisible" style="float:right;">更多条件</el-button> |
|||
</el-popover> |
|||
</span> |
|||
</template> |
|||
<template slot-scope="scope"> |
|||
<font>{{scope.row.name}}</font> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination layout="total, prev, 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> |
|||
<span slot="reference" @click="projectVisible=!projectVisible"> |
|||
<slot name="reference"><el-link title="项目,点击选择、清除选择" type="warning" icon="el-icon-search"><font style="font-size:14px;"><slot name="title">{{editForm && editForm.id?editForm.name:'选择项目'}}</slot></font></el-link> </slot> |
|||
</span> |
|||
</el-popover> |
|||
<el-drawer title="选择员工" :visible.sync="selectFiltersPmUserVisible" size="60%" append-to-body> |
|||
<users-select @confirm="onFiltersPmUserSelected" ref="usersSelect"></users-select> |
|||
</el-drawer> |
|||
</section> |
|||
</template> |
|||
|
|||
<script> |
|||
import util from '@/common/js/util';//全局公共库 |
|||
//import Sticky from '@/components/Sticky' // 粘性header组件 |
|||
//import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询 |
|||
import { listXmProject } from '@/api/xm/core/xmProject'; |
|||
import { mapGetters } from 'vuex' |
|||
import UsersSelect from "@/views/mdp/sys/user/UsersSelect"; |
|||
const map=new Map(); |
|||
|
|||
export default { |
|||
props:['linkProductId','linkIterationId','autoSelect'], |
|||
computed: { |
|||
...mapGetters([ |
|||
'userInfo','roles' |
|||
]) |
|||
}, |
|||
watch:{ |
|||
linkIterationId(){ |
|||
this.initData(); |
|||
}, |
|||
|
|||
linkProductId(){ |
|||
this.initData(); |
|||
} |
|||
}, |
|||
data() { |
|||
const beginDate = new Date(); |
|||
const endDate = new Date(); |
|||
beginDate.setTime(beginDate.getTime() - 3600 * 1000 * 24 * 7 * 4 * 12 ); |
|||
return { |
|||
filters: { |
|||
key: '', |
|||
id:'',//项目编号 |
|||
pmUser:null,//项目经理 |
|||
|
|||
}, |
|||
xmProjects: [],//查询结果 |
|||
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:{},//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]} |
|||
|
|||
//新增xmProject界面初始化数据 |
|||
addForm: { |
|||
id:'',name:'',branchId:'',remark:'' |
|||
}, |
|||
|
|||
//编辑xmProject界面初始化数据 |
|||
editForm: { |
|||
id:'',name:'',branchId:'',remark:'' |
|||
}, |
|||
selectFiltersPmUserVisible:false, |
|||
maxTableHeight:300, |
|||
dateRanger: [ ], |
|||
pickerOptions: util.pickerOptions('datarange'), |
|||
projectVisible:false, |
|||
moreVisible:false, |
|||
/**begin 自定义属性请在下面加 请加备注**/ |
|||
|
|||
/**end 自定义属性请在上面加 请加备注**/ |
|||
} |
|||
},//end data |
|||
methods: { |
|||
handleSizeChange(pageSize) { |
|||
this.pageInfo.pageSize=pageSize; |
|||
this.getXmProjects(); |
|||
}, |
|||
handleCurrentChange(pageNum) { |
|||
this.pageInfo.pageNum = pageNum; |
|||
this.getXmProjects(); |
|||
}, |
|||
// 表格排序 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.getXmProjects(); |
|||
}, |
|||
searchXmProjects(){ |
|||
this.pageInfo.count=true; |
|||
this.getXmProjects(); |
|||
}, |
|||
//获取列表 XmProject 项目表 |
|||
getXmProjects() { |
|||
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+"%" |
|||
} |
|||
if(this.linkProductId){ |
|||
params.linkProductId=this.linkProductId |
|||
} |
|||
if(this.linkIterationId){ |
|||
params.linkIterationId=this.linkIterationId |
|||
} |
|||
if(this.filters.id){ |
|||
params.id=this.filters.id |
|||
} |
|||
|
|||
if(this.filters.pmUser){ |
|||
params.pmUserid=this.filters.pmUser.userid |
|||
} |
|||
this.load.list = true; |
|||
listXmProject(params).then((res) => { |
|||
var tips=res.data.tips; |
|||
if(tips.isOk){ |
|||
this.pageInfo.total = res.data.total; |
|||
this.pageInfo.count=false; |
|||
this.xmProjects = res.data.data; |
|||
if(this.linkIterationId){ |
|||
map.set(this.linkIterationId,this.xmProjects) |
|||
}else if(this.linkProductId){ |
|||
map.set(this.linkProductId,this.xmProjects) |
|||
} |
|||
if(this.autoSelect!==false&&this.xmProjects.length>0 && this.projectVisible==false){ |
|||
var row=this.xmProjects[0]; |
|||
this.$refs.table.setCurrentRow(row); |
|||
this.rowClick(row); |
|||
} |
|||
}else{ |
|||
this.$notify({showClose: true, message: tips.msg, type: 'error' }); |
|||
} |
|||
this.load.list = false; |
|||
}).catch( err => this.load.list = false ); |
|||
}, |
|||
|
|||
//选择行xmProject |
|||
selsChange: function (sels) { |
|||
this.sels = sels; |
|||
}, |
|||
|
|||
rowClick: function(row, event, column){ |
|||
this.editForm=row |
|||
this.$emit('row-click',row, event, column);// @row-click="rowClick" |
|||
this.selectedProduct(row) |
|||
this.projectVisible=false; |
|||
this.moreVisible=false; |
|||
}, |
|||
selectedProduct:function(row){ |
|||
this.editForm=row |
|||
this.$emit('selected',row); |
|||
this.projectVisible=false; |
|||
this.moreVisible=false; |
|||
}, |
|||
|
|||
/**begin 自定义函数请在下面加**/ |
|||
clearFiltersPmUser:function(){ |
|||
this.filters.pmUser=null; |
|||
this.searchXmProjects(); |
|||
}, |
|||
selectFiltersPmUser(){ |
|||
this.selectFiltersPmUserVisible=true; |
|||
}, |
|||
onFiltersPmUserSelected(users){ |
|||
if(users && users.length>0){ |
|||
this.filters.pmUser=users[0] |
|||
}else{ |
|||
this.filters.pmUser=null; |
|||
} |
|||
this.selectFiltersPmUserVisible=false; |
|||
this.searchXmProjects(); |
|||
}, |
|||
setFiltersPmUserAsMySelf(){ |
|||
this.filters.pmUser=this.userInfo; |
|||
this.searchXmProjects(); |
|||
}, |
|||
|
|||
tableRowClassName({row, rowIndex}) { |
|||
if (row.id == this.editForm.id) { |
|||
return 'success-row'; |
|||
} |
|||
return ''; |
|||
}, |
|||
clearSelect(){ |
|||
this.$refs.table.setCurrentRow(); |
|||
this.$emit("clear-select"); |
|||
this.selectedProduct(null); |
|||
this.projectVisible=false; |
|||
this.moreVisible=false; |
|||
}, |
|||
close(){ |
|||
this.projectVisible=false; |
|||
this.moreVisible=false; |
|||
this.$emit("close"); |
|||
}, |
|||
|
|||
initData(){ |
|||
|
|||
if(this.linkIterationId){ |
|||
var xmProjects=map.get(this.linkIterationId); |
|||
if(xmProjects){ |
|||
this.xmProjects=xmProjects; |
|||
if(this.projectVisible==false){ |
|||
if(this.autoSelect!==false && this.xmProjects.length>0){ |
|||
var row=this.xmProjects[0]; |
|||
this.$refs.table.setCurrentRow(row); |
|||
this.rowClick(row); |
|||
} |
|||
} |
|||
}else{ |
|||
this.searchXmProjects(); |
|||
} |
|||
}else if(this.linkProductId){ |
|||
var xmProjects=map.get(this.linkProductId); |
|||
if(xmProjects){ |
|||
this.xmProjects=xmProjects; |
|||
if(this.projectVisible==false){ |
|||
if(this.autoSelect!==false && this.xmProjects.length>0){ |
|||
var row=this.xmProjects[0]; |
|||
this.$refs.table.setCurrentRow(row); |
|||
this.rowClick(row); |
|||
} |
|||
} |
|||
}else{ |
|||
this.searchXmProjects(); |
|||
} |
|||
}else{ |
|||
this.searchXmProjects(); |
|||
} |
|||
}, |
|||
},//end methods |
|||
components: { |
|||
UsersSelect, |
|||
//在下面添加其它组件 |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el); |
|||
this.initData(); |
|||
}); |
|||
} |
|||
} |
|||
|
|||
</script> |
|||
<style scoped> |
|||
|
|||
|
|||
.more-label-font{ |
|||
text-align:center; |
|||
float:left; |
|||
padding-top:5px; |
|||
} |
|||
.align-right{ |
|||
float: right; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,98 @@ |
|||
<template> |
|||
<section> |
|||
<el-popover |
|||
placement="bottom" |
|||
width="500" |
|||
v-model="formVisible" |
|||
trigger="manual" > <el-form :model="editForm" label-width="100px" ref="editForm"> |
|||
<el-form-item :label="item.label" :prop="item.property" v-for="(item,index) in columnsConfig" :key="index"> |
|||
<el-checkbox v-model="item.isShow" @change="onCheckboxChange(item,$event)">是否显示</el-checkbox> |
|||
</el-form-item> |
|||
<el-form-item label="" class="padding"> |
|||
<el-button type="text" @click="cancel">关闭</el-button> |
|||
<el-button :disabled="editForm.calcType!=='2' && editForm.ntype==='1'" type="primary" @click="submit">确认</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-button title="点击修改表格配置" @click="showConfig" slot="reference" icon="el-icon-setting"><font style="font-size:14px;"></font></el-button> |
|||
</el-popover> |
|||
</section> |
|||
</template> |
|||
|
|||
<script> |
|||
import util from '@/common/js/util';//全局公共库 |
|||
import config from '@/common/config';//全局公共库 |
|||
import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询 |
|||
|
|||
import { mapGetters } from 'vuex' |
|||
|
|||
export default { |
|||
computed: { |
|||
...mapGetters([ |
|||
'userInfo','roles' |
|||
]), |
|||
}, |
|||
props:['table'], |
|||
watch:{ |
|||
|
|||
}, |
|||
data() { |
|||
return { |
|||
columnsConfig:[], |
|||
editForm:{}, |
|||
formVisible:false, |
|||
} |
|||
},//end data |
|||
methods: { |
|||
cancel(){ |
|||
this.formVisible=false; |
|||
this.$emit("cancel") |
|||
}, |
|||
submit(){ |
|||
this.$emit("submit"); |
|||
this.formVisible=false; |
|||
}, |
|||
showConfig(){ |
|||
if(this.columnsConfig.length>0){ |
|||
this.formVisible=true; |
|||
return; |
|||
} |
|||
if(this.table){ |
|||
var columns=this.table.$children.filter(i=>i.columnConfig&&i.columnConfig.label) |
|||
columns=columns.map((column)=>{ |
|||
if(column && column.columnConfig){ |
|||
return { |
|||
label:column.columnConfig.label, |
|||
property:column.columnConfig.property, |
|||
isShow:true, |
|||
id:column.columnConfig.id, |
|||
} |
|||
} |
|||
|
|||
}); |
|||
this.columnsConfig=columns |
|||
this.formVisible=true; |
|||
} |
|||
}, |
|||
onCheckboxChange(column,newVal){ |
|||
var doc=this.table.$el; |
|||
var eles=doc.querySelectorAll("."+column.id); |
|||
eles.forEach(i=>{ |
|||
i.style.display=newVal?"":"none"; |
|||
}) |
|||
this.table.doLayout(); |
|||
} |
|||
|
|||
},//end methods |
|||
components: { |
|||
//在下面添加其它组件 |
|||
}, |
|||
mounted() { |
|||
|
|||
|
|||
} |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
</style> |
|||
@ -0,0 +1,66 @@ |
|||
<template> |
|||
<section> |
|||
<el-drawer title="选择组员" :visible.sync="visible" show-close append-to-body size="50%" @close="option=null"> |
|||
<xm-group-select :xm-product="xmProduct" :sel-project="selProject" :isSelectSingleUser="isSelectSingleUser" :visible="visible" @user-confirm="onUserConfirm"></xm-group-select> |
|||
</el-drawer> |
|||
</section> |
|||
</template> |
|||
|
|||
<script> |
|||
import util from '@/common/js/util'; //全局公共库 |
|||
import { |
|||
mapGetters |
|||
} from 'vuex' |
|||
import XmGroupSelect from "./XmGroupSelect.vue" |
|||
export default { |
|||
name:"tagDialog", |
|||
computed: { |
|||
...mapGetters([ |
|||
'workShop', 'userInfo' |
|||
]) |
|||
}, |
|||
// |
|||
props: ['selProject', 'xmProduct','isSelectSingleUser'], |
|||
watch: { |
|||
|
|||
}, |
|||
|
|||
data() { |
|||
return { |
|||
visible:false, |
|||
option:null/**{data:'',action:''} */, |
|||
} |
|||
}, //end data |
|||
methods: { |
|||
open(option){ |
|||
this.visible=true; |
|||
this.option=option; |
|||
}, |
|||
close(){ |
|||
this.visible=false; |
|||
this.option=null; |
|||
}, |
|||
/** |
|||
* @select-confirm |
|||
* |
|||
* |
|||
*/ |
|||
onUserConfirm(users){ |
|||
this.$emit('user-confirm',users,{...this.option}) |
|||
this.visible=false; |
|||
this.option=null; |
|||
} |
|||
|
|||
}, //end methods |
|||
components: { |
|||
XmGroupSelect, |
|||
}, |
|||
mounted() { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
|||
@ -1,384 +0,0 @@ |
|||
<template> |
|||
<section> |
|||
<el-row> |
|||
<!--列表 XmIteration 迭代定义--> |
|||
<el-table ref="table" :height="maxTableHeight" :data="xmIterationTreeData" row-key="id" default-expand-all :tree-props="{children: 'children', hasChildren: 'hasChildren'}" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;"> |
|||
<el-table-column type="index" label="序号" ></el-table-column> |
|||
<el-table-column prop="iterationName" label="迭代名称" > |
|||
<template slot="header" slot-scope="scope"> |
|||
迭代名称 <el-button type="text" @click="clearSelectIteration">清空所选</el-button> <el-button type="text" @click="close">关闭</el-button> |
|||
<el-popover v-if=" !menuId && !productId" |
|||
placement="top-start" |
|||
title="" |
|||
width="400" |
|||
trigger="hover" > |
|||
<el-row> |
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<font class="more-label-font"> |
|||
迭代查询范围: |
|||
</font> |
|||
<el-select v-model="filters.queryScope" style="width:100%;" placeholder="迭代查询范围"> |
|||
<el-option :label="userInfo.branchName+'机构下所有的迭代'" value="branchId"></el-option> |
|||
<el-option label="我相关的迭代" value="compete"></el-option> |
|||
<el-option label="按迭代编号精确查找" value="iterationId"></el-option> |
|||
<el-option label="后台智能匹配" value=""></el-option> |
|||
</el-select> |
|||
</el-col> |
|||
<el-col v-if="filters.queryScope=='iterationId'" :span="24" style="padding-top:5px;"> |
|||
<el-input v-model="filters.id" style="width:100%;" placeholder="输入迭代编号" @keyup.enter.native="searchXmProducts"> |
|||
</el-input> |
|||
</el-col> |
|||
<el-col v-if="filters.queryScope!='iterationId'" :span="24" style="padding-top:5px;"> |
|||
<font class="more-label-font">上线时间:</font> |
|||
<el-date-picker |
|||
v-model="dateRangerOnline" |
|||
type="daterange" |
|||
align="right" |
|||
unlink-panels |
|||
range-separator="至" |
|||
start-placeholder="开始日期" |
|||
end-placeholder="完成日期" |
|||
value-format="yyyy-MM-dd HH:mm:ss" |
|||
:default-time="['00:00:00','23:59:59']" |
|||
:picker-options="pickerOptions" |
|||
></el-date-picker> |
|||
</el-col> |
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<font class="more-label-font">迭代名称:</font><el-input v-model="filters.key" style="width: 60%;" placeholder="模糊查询"></el-input> |
|||
</el-col> |
|||
|
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<el-tag>默认只能查询本人创建的迭代、本人作为需求责任人参与的迭代</el-tag> |
|||
</el-col> |
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<el-button type="primary" icon="el-icon-search" @click="getXmIterations">查询</el-button> |
|||
</el-col> |
|||
</el-row> |
|||
<el-button type="text" slot="reference" style="float:right;">更多条件</el-button> |
|||
</el-popover> |
|||
</template> |
|||
<template slot-scope="scope"> |
|||
|
|||
{{scope.row.iterationName}} <font :color="calcFinishRate(scope.row)==100?'green':'#FF8C00'">{{calcFinishRate(scope.row)}}%</font> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination layout="total, prev, 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 config from '@/common/config';//全局公共库 |
|||
import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询 |
|||
import { listXmIteration,listXmIterationWithState, delXmIteration, batchDelXmIteration,loadTasksToXmIterationState } from '@/api/xm/core/xmIteration'; |
|||
|
|||
|
|||
import { mapGetters } from 'vuex' |
|||
|
|||
export default { |
|||
computed: { |
|||
...mapGetters([ |
|||
'userInfo','roles' |
|||
]), |
|||
|
|||
xmIterationTreeData(){ |
|||
return this.translateDataToTree(this.xmIterations); |
|||
}, |
|||
}, |
|||
props:[ 'productId','menuId','visible','selProject','autoSelect'], |
|||
watch:{ |
|||
visible:function(visible){ |
|||
if(visible==true){ |
|||
this.clearSelectIteration(); |
|||
this.getXmIterations(); |
|||
} |
|||
}, |
|||
productId:function(){ |
|||
this.getXmIterations(); |
|||
} |
|||
}, |
|||
data() { |
|||
const beginDate = new Date(); |
|||
const endDate = new Date(); |
|||
beginDate.setTime(beginDate.getTime() - 3600 * 1000 * 24 * 7 * 4 * 12 ); |
|||
endDate.setTime(endDate.getTime() + 3600 * 1000 * 24 * 7 * 4 * 12 ); |
|||
return { |
|||
filters: { |
|||
key: '', |
|||
queryScope:'',//迭代查询范围 iterationId\branchId\compete\'' |
|||
id:'',//迭代编号 |
|||
}, |
|||
pickerOptions: util.pickerOptions('datarange'), |
|||
dateRangerOnline: [ |
|||
],//上线时间选择范围 |
|||
xmIterations: [],//查询结果 |
|||
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:[], |
|||
},//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]} |
|||
|
|||
addFormVisible: false,//新增xmIteration界面是否显示 |
|||
//新增xmIteration界面初始化数据 |
|||
addForm: { |
|||
id:'',branchId:'',iterationName:'',startTime:'',endTime:'',onlineTime:'',pid:'',adminUserid:'',adminUsername:'',ctime:'',budgetCost:'',budgetWorkload:'',distBudgetCost:'',distBudgetWorkload:'',actCost:'',actWorkload:'',actStaffNum:'',seqNo:'', |
|||
}, |
|||
|
|||
editFormVisible: false,//编辑界面是否显示 |
|||
//编辑xmIteration界面初始化数据 |
|||
editForm: { |
|||
id:'',branchId:'',iterationName:'',startTime:'',endTime:'',onlineTime:'',pid:'',adminUserid:'',adminUsername:'',ctime:'',budgetCost:'',budgetWorkload:'',distBudgetCost:'',distBudgetWorkload:'',actCost:'',actWorkload:'',actStaffNum:'',seqNo:'', |
|||
}, |
|||
editFormInit: { |
|||
id:'',branchId:'',iterationName:'',startTime:'',endTime:'',onlineTime:'',pid:'',adminUserid:'',adminUsername:'',ctime:'',budgetCost:'',budgetWorkload:'',distBudgetCost:'',distBudgetWorkload:'',actCost:'',actWorkload:'',actStaffNum:'',seqNo:'', |
|||
}, |
|||
|
|||
/**begin 自定义属性请在下面加 请加备注**/ |
|||
valueChangeRows:[], |
|||
parentIteration:null, |
|||
iterationStateVisible:false, |
|||
gstcVisible:false, |
|||
maxTableHeight:300, |
|||
ganrrColumns: { |
|||
children: 'children', |
|||
name: 'iterationName', |
|||
id: 'id', |
|||
pid: 'pid', |
|||
startDate: 'startTime', |
|||
endDate: 'endTime', |
|||
} |
|||
/**end 自定义属性请在上面加 请加备注**/ |
|||
} |
|||
},//end data |
|||
methods: { |
|||
handleSizeChange(pageSize) { |
|||
this.pageInfo.pageSize=pageSize; |
|||
this.getXmIterations(); |
|||
}, |
|||
handleCurrentChange(pageNum) { |
|||
this.pageInfo.pageNum = pageNum; |
|||
this.getXmIterations(); |
|||
}, |
|||
// 表格排序 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.getXmIterations(); |
|||
}, |
|||
searchXmIterations(){ |
|||
this.pageInfo.count=true; |
|||
this.getXmIterations(); |
|||
}, |
|||
//获取列表 XmIteration 迭代定义 |
|||
getXmIterations() { |
|||
debugger; |
|||
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+"%" |
|||
} |
|||
if(this.productId){ |
|||
params.productId=this.productId |
|||
} |
|||
if(this.menuId){ |
|||
params.menuId=this.menuId |
|||
} |
|||
if( !this.menuId && !this.productId ){ |
|||
params.queryScope=this.filters.queryScope |
|||
if(this.filters.queryScope=='iterationId'){ |
|||
if(!this.filters.id){ |
|||
this.$notify({showClose: true, message:"您选择了按迭代编号精确查找模式,请输入迭代编号", type: 'error' }); |
|||
return; |
|||
} |
|||
params.id=this.filters.id |
|||
|
|||
} |
|||
if(this.filters.queryScope=="branchId"){ |
|||
params.branchId=this.userInfo.branchId |
|||
} |
|||
|
|||
} |
|||
if(this.selProject && this.selProject.id){ |
|||
params.projectId=this.selProject.id |
|||
} |
|||
|
|||
if(this.dateRangerOnline && this.dateRangerOnline.length==2){ |
|||
params.onlineTimeStart=this.dateRangerOnline[0] |
|||
params.onlineTimeEnd=this.dateRangerOnline[1] |
|||
} |
|||
this.load.list = true; |
|||
listXmIterationWithState(params).then((res) => { |
|||
var tips=res.data.tips; |
|||
if(tips.isOk){ |
|||
this.pageInfo.total = res.data.total; |
|||
this.pageInfo.count=false; |
|||
this.xmIterations = res.data.data; |
|||
|
|||
if(this.autoSelect===true&&this.xmIterations.length>0){ |
|||
var row=this.xmIterations[0]; |
|||
this.$refs.table.setCurrentRow(row); |
|||
this.rowClick(row); |
|||
} |
|||
}else{ |
|||
this.$notify({showClose: true, message: tips.msg, type: 'error' }); |
|||
} |
|||
this.load.list = false; |
|||
}).catch( err => this.load.list = false ); |
|||
}, |
|||
|
|||
//选择行xmIteration |
|||
selsChange: function (sels) { |
|||
this.sels = sels; |
|||
}, |
|||
rowClick: function(row, event, column){ |
|||
this.editForm=row |
|||
this.$emit('row-click',row, event, column);// @row-click="rowClick" |
|||
}, |
|||
/**begin 自定义函数请在下面加**/ |
|||
|
|||
translateDataToTree(data2) { |
|||
var data=JSON.parse(JSON.stringify(data2)); |
|||
let parents = data.filter(value =>{ |
|||
//如果我的上级为空,则我是最上级 |
|||
if(value.pid == 'undefined' || value.pid == null || value.pid == ''){ |
|||
return true; |
|||
|
|||
//如果我的上级不在列表中,我作为最上级 |
|||
}else if(data.some(i=>value.pid==i.id)){ |
|||
return false; |
|||
}else { |
|||
return true |
|||
} |
|||
|
|||
}) |
|||
let children = data.filter(value =>{ |
|||
if(data.some(i=>value.pid==i.id)){ |
|||
return true; |
|||
}else{ |
|||
return false; |
|||
} |
|||
}) |
|||
let translator = (parents, children) => { |
|||
parents.forEach((parent) => { |
|||
children.forEach((current, index) => { |
|||
if (current.pid === parent.id) { |
|||
let temp = JSON.parse(JSON.stringify(children)) |
|||
temp.splice(index, 1) |
|||
translator([current], temp) |
|||
typeof parent.children !== 'undefined' ? parent.children.push(current) : parent.children = [current] |
|||
} |
|||
} |
|||
) |
|||
} |
|||
) |
|||
} |
|||
|
|||
translator(parents, children) |
|||
|
|||
return parents |
|||
}, |
|||
|
|||
clearSelectIteration(){ |
|||
this.editForm=this.editFormInit |
|||
|
|||
this.$refs.table.setCurrentRow(); |
|||
this.$emit('clear-select',null );// @row-click="rowClick" |
|||
}, |
|||
fieldChange:function(row,fieldName){ |
|||
|
|||
if(this.valueChangeRows.some(i=>i.id==row.id)){ |
|||
return; |
|||
}else{ |
|||
this.valueChangeRows.push(row) |
|||
} |
|||
}, |
|||
|
|||
formatterDate(row,column,cellValue, index){ |
|||
if(cellValue){ |
|||
return cellValue.substr(0,10); |
|||
}else{ |
|||
return cellValue; |
|||
} |
|||
}, |
|||
/**end 自定义函数请在上面加**/ |
|||
calcFinishRate(row){ |
|||
if(row.finishRate){ |
|||
return parseInt(row.finishRate); |
|||
}else{ |
|||
return 0; |
|||
} |
|||
}, |
|||
close(){ |
|||
this.$emit("close") |
|||
}, |
|||
loadTasksToXmIterationState(row){ |
|||
|
|||
this.load.edit=true; |
|||
loadTasksToXmIterationState({id:row.id}).then(res=>{ |
|||
this.load.edit=false; |
|||
var tips =res.data.tips; |
|||
if(tips.isOk){ |
|||
this.getXmIterations(); |
|||
} |
|||
this.$notify({showClose: true, message: tips.msg, type: tips.isOk?'success':'error'}); |
|||
}); |
|||
}, |
|||
},//end methods |
|||
components: { |
|||
//在下面添加其它组件 |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el); |
|||
this.getXmIterations(); |
|||
}); |
|||
|
|||
} |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style rel="stylesheet/scss" lang="scss" scoped> |
|||
.more-label-font{ |
|||
text-align:center; |
|||
float:left; |
|||
padding-top:5px; |
|||
} |
|||
.font-class{ |
|||
color: rgba(116, 85, 85, 0.493); |
|||
} |
|||
|
|||
.align-right{ |
|||
float: right; |
|||
} |
|||
</style> |
|||
@ -1,347 +0,0 @@ |
|||
<template> |
|||
<section> |
|||
<el-row > |
|||
<!--列表 XmProduct 产品表--> |
|||
<el-table ref="table" :height="maxTableHeight" :data="xmProducts" :row-class-name="tableRowClassName" @sort-change="sortChange" :highlight-current-row="true" current-row-key="id" v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;"> |
|||
|
|||
<el-table-column label="序号" type="index" width="50" > </el-table-column> |
|||
<el-table-column v-if="isSelectProduct==true" label="产品编码" prop="id" min-width="100" show-overflow-tooltip > </el-table-column> |
|||
<el-table-column prop="productName" label="产品名称" show-overflow-tooltip> |
|||
<template slot="header" slot-scope="scope"> |
|||
产品名称 <el-button type="text" @click="clearSelect">清空所选</el-button> <el-button type="text" @click="close">关闭</el-button> |
|||
<el-popover |
|||
placement="top-start" |
|||
title="" |
|||
width="400" |
|||
trigger="hover" > |
|||
<el-row> |
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<font class="more-label-font"> |
|||
产品查询范围: |
|||
</font> |
|||
<el-select v-model="filters.queryScope" style="width:100%;" placeholder="产品查询范围"> |
|||
<el-option :label="userInfo.branchName+'机构下所有的产品'" value="branchId"></el-option> |
|||
<el-option label="我相关的产品" value="compete"></el-option> |
|||
<el-option label="按产品编号精确查找" value="productId"></el-option> |
|||
<el-option label="后台智能匹配" value=""></el-option> |
|||
</el-select> |
|||
</el-col> |
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<el-input v-if="filters.queryScope=='productId'" v-model="filters.id" style="width:100%;" placeholder="输入产品编号" @keyup.enter.native="searchXmProducts"> |
|||
</el-input> |
|||
</el-col> |
|||
|
|||
<el-col v-show="!selProject&&filters.queryScope!='productId'" :span="24" style="padding-top:5px;"> |
|||
<font class="more-label-font">创建时间:</font> |
|||
<el-date-picker |
|||
v-model="dateRanger" |
|||
type="daterange" |
|||
align="right" |
|||
unlink-panels |
|||
range-separator="至" |
|||
start-placeholder="开始日期" |
|||
end-placeholder="完成日期" |
|||
value-format="yyyy-MM-dd HH:mm:ss" |
|||
:default-time="['00:00:00','23:59:59']" |
|||
:picker-options="pickerOptions" |
|||
></el-date-picker> |
|||
</el-col> |
|||
|
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<font class="more-label-font"> |
|||
产品名称: |
|||
</font> |
|||
<el-input v-model="filters.key" style="width:100%;" placeholder="输入产品名字关键字"> |
|||
</el-input> |
|||
</el-col> |
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<font class="more-label-font"> |
|||
产品经理: |
|||
</font> |
|||
<el-tag v-if="filters.pmUser" closable @click="selectFiltersPmUser" @close="clearFiltersPmUser()">{{filters.pmUser.username}}</el-tag> |
|||
<el-button v-else @click="selectFiltersPmUser()">选责任人</el-button> |
|||
<el-button @click="setFiltersPmUserAsMySelf()">我的</el-button> |
|||
</el-col> |
|||
<el-col :span="24" style="padding-top:5px;"> |
|||
<el-button type="primary" @click="searchXmProducts" >查询</el-button> |
|||
</el-col> |
|||
</el-row> |
|||
<el-button type="text" slot="reference" style="float:right;">更多条件</el-button> |
|||
</el-popover> |
|||
</template> |
|||
<template slot-scope="scope"> |
|||
<font>{{scope.row.productName}}</font> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column v-if="isSelectProduct==true" label="操作" width="100" fixed="right" > |
|||
<template slot-scope="scope"> |
|||
<el-button type="primary" @click="selectedProduct( scope.row,scope.$index)">选择</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination layout="total, prev, 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-drawer title="选择员工" :visible.sync="selectFiltersPmUserVisible" size="60%" append-to-body> |
|||
<users-select @confirm="onFiltersPmUserSelected" ref="usersSelect"></users-select> |
|||
</el-drawer> |
|||
</section> |
|||
</template> |
|||
|
|||
<script> |
|||
import util from '@/common/js/util';//全局公共库 |
|||
//import Sticky from '@/components/Sticky' // 粘性header组件 |
|||
//import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询 |
|||
import { listXmProductWithState } from '@/api/xm/core/xmProduct'; |
|||
import { mapGetters } from 'vuex' |
|||
import UsersSelect from "@/views/mdp/sys/user/UsersSelect"; |
|||
import { loadTasksToXmProductState } from '@/api/xm/core/xmProductState'; |
|||
|
|||
|
|||
export default { |
|||
props:['isSelectProduct','selProject','xmIteration','autoSelect'], |
|||
computed: { |
|||
...mapGetters([ |
|||
'userInfo','roles' |
|||
]) |
|||
}, |
|||
watch:{ |
|||
xmIteration(){ |
|||
this.getXmProducts(); |
|||
}, |
|||
|
|||
selProject(){ |
|||
this.getXmProducts(); |
|||
} |
|||
}, |
|||
data() { |
|||
const beginDate = new Date(); |
|||
const endDate = new Date(); |
|||
beginDate.setTime(beginDate.getTime() - 3600 * 1000 * 24 * 7 * 4 * 12 ); |
|||
return { |
|||
filters: { |
|||
key: '', |
|||
queryScope:'compete', |
|||
id:'',//产品编号 |
|||
pmUser:null,//产品经理 |
|||
}, |
|||
xmProducts: [],//查询结果 |
|||
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:{},//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]} |
|||
|
|||
addFormVisible: false,//新增xmProduct界面是否显示 |
|||
//新增xmProduct界面初始化数据 |
|||
addForm: { |
|||
id:'',productName:'',branchId:'',remark:'' |
|||
}, |
|||
|
|||
editFormVisible: false,//编辑界面是否显示 |
|||
//编辑xmProduct界面初始化数据 |
|||
editForm: { |
|||
id:'',productName:'',branchId:'',remark:'' |
|||
}, |
|||
iterationVisible:false, |
|||
productStateVisible:false, |
|||
selectFiltersPmUserVisible:false, |
|||
maxTableHeight:300, |
|||
dateRanger: [ ], |
|||
pickerOptions: util.pickerOptions('datarange'), |
|||
|
|||
/**begin 自定义属性请在下面加 请加备注**/ |
|||
|
|||
/**end 自定义属性请在上面加 请加备注**/ |
|||
} |
|||
},//end data |
|||
methods: { |
|||
handleSizeChange(pageSize) { |
|||
this.pageInfo.pageSize=pageSize; |
|||
this.getXmProducts(); |
|||
}, |
|||
handleCurrentChange(pageNum) { |
|||
this.pageInfo.pageNum = pageNum; |
|||
this.getXmProducts(); |
|||
}, |
|||
// 表格排序 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.getXmProducts(); |
|||
}, |
|||
searchXmProducts(){ |
|||
this.pageInfo.count=true; |
|||
this.getXmProducts(); |
|||
}, |
|||
//获取列表 XmProduct 产品表 |
|||
getXmProducts() { |
|||
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+"%" |
|||
}else{ |
|||
//params.xxx=xxxxx |
|||
} |
|||
if(this.selProject){ |
|||
params.projectId=this.selProject.id |
|||
} |
|||
if(this.xmIteration){ |
|||
params.iterationId=this.xmIteration.id |
|||
} |
|||
|
|||
params.queryScope=this.filters.queryScope |
|||
if(this.filters.queryScope=='productId'){ |
|||
if(!this.filters.id){ |
|||
this.$notify({showClose: true, message:"您选择了按产品编号精确查找模式,请输入产品编号", type: 'error' }); |
|||
return; |
|||
} |
|||
params.id=this.filters.id |
|||
|
|||
} |
|||
if(this.filters.queryScope=="branchId"){ |
|||
params.branchId=this.userInfo.branchId |
|||
params.projectId=null; |
|||
} |
|||
if(!this.selProject && !this.xmIteration && this.filters.queryScope!='productId'){ |
|||
if(this.dateRanger&&this.dateRanger.length==2){ |
|||
|
|||
params.ctimeStart=this.dateRanger[0] |
|||
params.ctimeEnd=this.dateRanger[1] |
|||
} |
|||
} |
|||
|
|||
this.load.list = true; |
|||
listXmProductWithState(params).then((res) => { |
|||
var tips=res.data.tips; |
|||
if(tips.isOk){ |
|||
this.pageInfo.total = res.data.total; |
|||
this.pageInfo.count=false; |
|||
this.xmProducts = res.data.data; |
|||
|
|||
if(this.autoSelect===true&&this.xmProducts.length>0){ |
|||
var row=this.xmProducts[0]; |
|||
this.$refs.table.setCurrentRow(row); |
|||
this.rowClick(row); |
|||
} |
|||
}else{ |
|||
this.$notify({showClose: true, message: tips.msg, type: 'error' }); |
|||
} |
|||
this.load.list = false; |
|||
}).catch( err => this.load.list = false ); |
|||
}, |
|||
|
|||
//选择行xmProduct |
|||
selsChange: function (sels) { |
|||
this.sels = sels; |
|||
}, |
|||
|
|||
rowClick: function(row, event, column){ |
|||
this.editForm=row |
|||
this.$emit('row-click',row, event, column);// @row-click="rowClick" |
|||
}, |
|||
selectedProduct:function(row){ |
|||
this.editForm=row |
|||
this.$emit('selected',row); |
|||
}, |
|||
|
|||
/**begin 自定义函数请在下面加**/ |
|||
clearFiltersPmUser:function(){ |
|||
this.filters.pmUser=null; |
|||
this.searchXmProducts(); |
|||
}, |
|||
selectFiltersPmUser(){ |
|||
this.selectFiltersPmUserVisible=true; |
|||
}, |
|||
onFiltersPmUserSelected(users){ |
|||
if(users && users.length>0){ |
|||
this.filters.pmUser=users[0] |
|||
}else{ |
|||
this.filters.pmUser=null; |
|||
} |
|||
this.selectFiltersPmUserVisible=false; |
|||
this.searchXmProducts(); |
|||
}, |
|||
setFiltersPmUserAsMySelf(){ |
|||
this.filters.pmUser=this.userInfo; |
|||
this.searchXmProducts(); |
|||
}, |
|||
|
|||
loadTasksToXmProductState: function (row) { |
|||
this.load.edit=true; |
|||
|
|||
let params = { productId: row.id }; |
|||
loadTasksToXmProductState(params).then((res) => { |
|||
this.load.edit=false; |
|||
var tips=res.data.tips; |
|||
if(tips.isOk){ |
|||
this.pageInfo.count=true; |
|||
this.getXmProducts(); |
|||
} |
|||
this.$notify({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' }); |
|||
}).catch( err => this.load.edit=false ); |
|||
}, |
|||
tableRowClassName({row, rowIndex}) { |
|||
if (row.id == this.editForm.id) { |
|||
return 'success-row'; |
|||
} |
|||
return ''; |
|||
}, |
|||
clearSelect(){ |
|||
this.$refs.table.setCurrentRow(); |
|||
this.$emit("clear-select"); |
|||
}, |
|||
close(){ |
|||
this.$emit("close"); |
|||
} |
|||
},//end methods |
|||
components: { |
|||
UsersSelect, |
|||
//在下面添加其它组件 |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el); |
|||
this.getXmProducts(); |
|||
}); |
|||
} |
|||
} |
|||
|
|||
</script> |
|||
<style scoped> |
|||
|
|||
|
|||
.more-label-font{ |
|||
text-align:center; |
|||
float:left; |
|||
padding-top:5px; |
|||
} |
|||
.align-right{ |
|||
float: right; |
|||
} |
|||
</style> |
|||
@ -1,537 +0,0 @@ |
|||
<template> |
|||
<section class="page-container padding border"> |
|||
<el-row class="page-main " :style="{overflowX:'auto',height:maxTableHeight+'px'}" ref="table"> |
|||
<!--编辑界面 XmProject xm_project--> |
|||
<el-form :model="addForm" label-width="120px" :rules="addFormRules" ref="addForm"> |
|||
<el-form-item label="项目代号" prop="code"> |
|||
<el-input v-model="addForm.code" placeholder="项目代号,不可为空" > |
|||
<template slot="append"> |
|||
<el-button type="text" @click="createProjectCode">自动生成</el-button> |
|||
</template> |
|||
</el-input> |
|||
<font color="blue" style="font-size:10px;">项目代号为合同上的项目代号,甲乙方共享;项目内部编号为 代号-四位随机码</font> |
|||
</el-form-item> |
|||
<el-form-item label="名称" prop="name"> |
|||
<el-input v-model="addForm.name" placeholder="项目名称" ></el-input> |
|||
</el-form-item> |
|||
|
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<el-form-item label="项目类型" prop="xmType"> |
|||
<el-select v-model="addForm.xmType"> |
|||
<el-option v-for="(i,index) in dicts['projectType']" :label="i.name" :value="i.id" :key="index"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="优先级" prop="priority"> |
|||
<el-select v-model="addForm.priority"> |
|||
<el-option v-for="(i,index) in dicts['priority']" :label="i.name" :value="i.id" :key="index"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-form-item label="预算控制"> |
|||
<el-form-item prop="budgetCtrl"> |
|||
<el-checkbox v-model="addForm.budgetCtrl" true-label="1" false-label="0" >总预算控制</el-checkbox> |
|||
<font style="font-size:12px;" color="blue">项目计划总预算不能大于项目总预算</font> |
|||
</el-form-item> |
|||
<el-form-item label="" prop="phaseBudgetCtrl"> |
|||
<el-checkbox v-model="addForm.phaseBudgetCtrl" true-label="1" false-label="0" >项目计划预算控制</el-checkbox> |
|||
<font style="font-size:12px;" color="blue">下级计划总预算不能大于上级计划总预算;每条计划的预算金额必须大于其关联任务的预算合计。</font> |
|||
</el-form-item> |
|||
<el-form-item label="" prop="phaseActCtrl"> |
|||
<el-checkbox v-model="addForm.phaseActCtrl" true-label="1" false-label="0" >实际金额控制</el-checkbox> |
|||
<font style="font-size:12px;" color="blue">每条计划实际金额不能大于预算金额;每条计划的预算金额必须大于其关联的任务的实际金额合计。</font> |
|||
</el-form-item> |
|||
|
|||
</el-form-item> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<el-form-item label="总控" prop="admUserid"> |
|||
<el-input readonly v-model="addForm.admUsername" @click.native="showUserVisible('admUserid')"></el-input> |
|||
<font style="font-size:12px;" color="blue"></font> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item label="项目经理" prop="pmUserid"> |
|||
<el-input readonly v-model="addForm.pmUsername" @click.native="showUserVisible('pmUserid')"></el-input> |
|||
<font style="font-size:12px;" color="blue"></font> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item label="副经理、助理" prop="assUserid"> |
|||
<el-input readonly v-model="addForm.assUsername" @click.native="showUserVisible('assUserid')"></el-input> |
|||
<font style="font-size:12px;" color="blue"></font> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-form-item label="项目预估" > |
|||
<el-tabs> |
|||
<el-tab-pane label="工作量及人力成本" name="planWorkload"> |
|||
<el-row> |
|||
<el-date-picker |
|||
v-model="dateRanger" |
|||
class="hidden-sm-and-down" |
|||
type="daterange" |
|||
align="right" |
|||
unlink-panels |
|||
range-separator="至" |
|||
start-placeholder="计划开始日期" |
|||
end-placeholder="计划完成日期" |
|||
value-format="yyyy-MM-dd HH:mm:ss" |
|||
:default-time="['00:00:00','23:59:59']" |
|||
:picker-options="pickerOptions" |
|||
></el-date-picker> |
|||
<el-input style="width:150px;" type="number" v-model="addForm.planWorkingHours" :precision="2" :step="8" :min="0" placeholder="预计工时"></el-input><el-tag>参考工时{{autoParams.planWorkingHours}}小时,工作日{{autoParams.weekday}}天</el-tag> |
|||
|
|||
</el-row> |
|||
<el-divider></el-divider> |
|||
<el-row> |
|||
<el-col :span="4">人员类型</el-col> |
|||
<el-col :span="4">人数</el-col> |
|||
<el-col :span="4">工作量</el-col> |
|||
<el-col :span="4">单价</el-col> |
|||
<el-col :span="8">总价</el-col> |
|||
|
|||
</el-row> |
|||
<el-divider></el-divider> |
|||
<el-row> |
|||
<el-col :span="4">内购</el-col> |
|||
<el-col :span="4"><el-input style="width:120px;" type="number" v-model="addForm.planIuserCnt" :precision="0" :step="1" :min="0" placeholder="内购人数"></el-input> |
|||
</el-col> |
|||
<el-col :span="4">{{autoParams.planIuserWorkload}}人时</el-col> |
|||
<el-col :span="4"><el-input style="width:120px;" type="number" v-model="addForm.planIuserPrice" :precision="0" :step="1" :min="0" placeholder="预计内部人时单价"></el-input> </el-col> |
|||
<el-col :span="8">{{this.toFixed(autoParams.planIuserAt)}}元,{{this.toFixed(autoParams.planIuserAt/10000)}} 万元</el-col> |
|||
</el-row> |
|||
<el-divider></el-divider> |
|||
<el-row> |
|||
<el-col :span="4">外购</el-col> |
|||
<el-col :span="4"><el-input style="width:120px;" type="number" v-model="addForm.planOuserCnt" :precision="0" :step="1" :min="0" placeholder="外购人数"></el-input> |
|||
</el-col> |
|||
<el-col :span="4">{{autoParams.planOuserWorkload}}人时</el-col> |
|||
<el-col :span="4"><el-input style="width:120px;" type="number" v-model="addForm.planOuserPrice" :precision="0" :step="1" :min="0" placeholder="预计外购人时单价"></el-input> </el-col> |
|||
<el-col :span="4">{{autoParams.planOuserAt }} 元 {{autoParams.planOuserAt/10000 }}万元</el-col> |
|||
|
|||
</el-row> |
|||
<el-divider></el-divider> |
|||
<el-row> |
|||
<el-col :span="4">合计</el-col> |
|||
<el-col :span="4"> {{autoParams.planOuserCnt+autoParams.planIuserCnt}} |
|||
</el-col> |
|||
<el-col :span="4">{{autoParams.planOuserWorkload+autoParams.planIuserWorkload }}人时,{{ (autoParams.planOuserWorkload+autoParams.planIuserWorkload)/8/20 }}人月 </el-col> |
|||
<el-col :span="4">平均:{{ (parseFloat2(autoParams.planOuserPrice) + parseFloat2(autoParams.planIuserPrice))/2}}元/人时</el-col> |
|||
<el-col :span="8">{{autoParams.planTotalCost}} 元,{{(autoParams.planTotalCost)/10000}} 万元</el-col> |
|||
</el-row> |
|||
|
|||
</el-tab-pane> |
|||
<el-tab-pane label="成本总览" name="planTotalCost"> |
|||
<el-row> |
|||
内购: <el-input style="width:120px;" type="number" v-model="addForm.planIuserAt" :precision="2" :step="1000" :min="0" placeholder="内部人力成本总预算"></el-input> <el-tag> {{this.toFixed(autoParams.planIuserAt/10000)}}万元</el-tag> |
|||
外购: <el-input style="width:120px;" type="number" v-model="addForm.planOuserAt" :precision="2" :step="1000" :min="0" placeholder="外购人力成本总预算"></el-input> <el-tag> {{this.toFixed(autoParams.planOuserAt/10000)}}万元</el-tag> |
|||
非人力:<el-input style="width:120px;" type="number" v-model="addForm.planNouserAt" :precision="2" :step="1000" :min="0" placeholder="人力成本总预算"></el-input> <el-tag> {{this.toFixed( autoParams.planNouserAt/10000)}}万元</el-tag> |
|||
</el-row> |
|||
<el-divider></el-divider> |
|||
<el-row> |
|||
合计: <el-input style="width:150px;" type="number" v-model="addForm.planTotalCost" :precision="2" :step="1000" :min="0" placeholder="总成本预算"></el-input> <el-tag> {{this.toFixed(autoParams.planTotalCost/10000)}}万元</el-tag> |
|||
</el-row> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="合同收入" name="contractAmt"> |
|||
<el-row> |
|||
预计收款总额:<el-input style="width:150px;" type="number" v-model="addForm.totalReceivables" :precision="2" :step="1000" :min="0" placeholder="预计总收款金额"></el-input> <el-tag> {{this.toFixed(autoParams.totalReceivables/10000)}}万</el-tag> |
|||
合同总金额 :<el-input style="width:150px;" type="number" v-model="addForm.contractAmt" :precision="2" :step="1000" :min="0" placeholder="合同总金额"></el-input> <el-tag> {{this.toFixed(autoParams.contractAmt/10000)}}万</el-tag> |
|||
</el-row> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="毛利水平" name="budgetTaxRate"> |
|||
<el-row> |
|||
税率:<el-input style="width:120px;" type="number" v-model="addForm.taxRate" :precision="2" :step="0.01" :min="0" :max="0.99" placeholder="税率"></el-input> |
|||
考核标准毛利率:<el-input style="width:120px;" type="number" v-model="addForm.budgetMarginRate" :precision="2" :step="0.01" :min="0" :max="0.99" placeholder="毛利率"></el-input> |
|||
当前毛利率为:<el-tag>{{toFixed(parseFloat2(autoParams.currentBudgetMarginRate)*100,2)}}%</el-tag> |
|||
</el-row> |
|||
</el-tab-pane> |
|||
|
|||
</el-tabs> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="项目描述" prop="description"> |
|||
<el-input type="textarea" :rows="6" v-model="addForm.description" placeholder="项目描述" ></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
</el-row> |
|||
<el-row> |
|||
<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-row> |
|||
<el-drawer append-to-body title="选择员工" :visible.sync="userSelectVisible" size="60%"> |
|||
<users-select isSingleUser=true @confirm="onUserSelected" ref="usersSelect"></users-select> |
|||
</el-drawer> |
|||
</section> |
|||
</template> |
|||
|
|||
<script> |
|||
import util from '@/common/js/util';//全局公共库 |
|||
import {sn} from '@/common/js/sequence';//全局公共库 |
|||
|
|||
import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询 |
|||
import { addXmProject,createProjectCode } from '@/api/xm/core/xmProject'; |
|||
import { mapGetters } from 'vuex'; |
|||
|
|||
import UsersSelect from "@/views/mdp/sys/user/UsersSelect"; |
|||
|
|||
export default { |
|||
computed: { |
|||
...mapGetters([ |
|||
'userInfo','roles' |
|||
]), |
|||
|
|||
autoParams:function(){ |
|||
|
|||
|
|||
var planOuserPrice=this.toFixed(this.addForm.planOuserPrice) |
|||
var planIuserPrice=this.toFixed(this.addForm.planIuserPrice) |
|||
var planOuserCnt=this.toFixed(this.addForm.planOuserCnt) |
|||
var planIuserCnt=this.toFixed(this.addForm.planIuserCnt) |
|||
var planWorkingHours=this.toFixed(this.addForm.planWorkingHours ) |
|||
var planNouserAt=this.toFixed(this.addForm.planNouserAt ) |
|||
var budgetMarginRate=this.toFixed(this.addForm.budgetMarginRate,4 ) |
|||
var taxRate=this.toFixed(this.addForm.taxRate,4) |
|||
if(planOuserPrice==null || planOuserPrice==''){ |
|||
planOuserPrice=100 |
|||
} |
|||
if(planIuserPrice==null || planIuserPrice==''){ |
|||
planIuserPrice=80 |
|||
} |
|||
if(planOuserCnt==null || planOuserCnt==''){ |
|||
planOuserCnt=0.0 |
|||
} |
|||
if(planIuserCnt==null || planIuserCnt==''){ |
|||
planIuserCnt=0.0 |
|||
} |
|||
|
|||
if(planNouserAt==null || planNouserAt==''){ |
|||
planNouserAt=0.0 |
|||
} |
|||
if(budgetMarginRate==null || budgetMarginRate==''){ |
|||
budgetMarginRate=0.4 |
|||
} |
|||
|
|||
if(planWorkingHours==null || planWorkingHours==''){ |
|||
planWorkingHours=0.0 |
|||
} |
|||
if(taxRate==null || taxRate==''){ |
|||
taxRate=0.03 |
|||
} |
|||
var autoParams={ |
|||
|
|||
} |
|||
var weekday=1; |
|||
if(this.dateRanger!=null && this.dateRanger.length>=2 ){ |
|||
weekday=this.getWeekday(new Date(this.dateRanger[0]),new Date(this.dateRanger[1])); |
|||
if(this.addForm.planWorkingHours==null || this.addForm.planWorkingHours=='' || this.addForm.planWorkingHours<=0){ |
|||
planWorkingHours=weekday * 8 |
|||
} |
|||
|
|||
} |
|||
autoParams.weekday=weekday |
|||
autoParams.planWorkingHours=planWorkingHours |
|||
autoParams.planOuserPrice=planOuserPrice |
|||
autoParams.planIuserPrice=planIuserPrice |
|||
autoParams.planOuserCnt=planOuserCnt |
|||
autoParams.planIuserCnt=planIuserCnt |
|||
autoParams.taxRate=taxRate |
|||
autoParams.planIuserWorkload= planIuserCnt*planWorkingHours |
|||
autoParams.planOuserWorkload= planOuserCnt*planWorkingHours |
|||
autoParams.planWorkload= planIuserCnt*planWorkingHours + planOuserCnt*planWorkingHours |
|||
autoParams.planOuserAt= planOuserCnt * planWorkingHours * planOuserPrice |
|||
autoParams.planIuserAt= planIuserCnt * planWorkingHours * planIuserPrice |
|||
autoParams.planNouserAt= planNouserAt |
|||
autoParams.budgetMarginRate=budgetMarginRate |
|||
autoParams.planTotalCost= autoParams.planOuserAt + autoParams.planIuserAt + autoParams.planNouserAt |
|||
autoParams.totalReceivables=autoParams.planTotalCost/(1-budgetMarginRate)/ (1-taxRate) |
|||
autoParams.contractAmt =autoParams.totalReceivables |
|||
var totalReceivables=this.addForm.totalReceivables |
|||
if(totalReceivables==null || totalReceivables=='' || isNaN(totalReceivables)){ |
|||
autoParams.currentBudgetMarginRate=-99 |
|||
}else{ |
|||
autoParams.currentBudgetMarginRate= this.toFixed(1-this.addForm.planTotalCost/(this.addForm.totalReceivables* (1-taxRate)),4) |
|||
} |
|||
|
|||
// 1.毛利率=(销售收入-销售成本)/销售收入×100%=(不含税售价-不含税进价)/不含税售价×100% |
|||
// 2.毛利率=(1-不含税进价/不含税售价)×100% |
|||
//totalReceivables=budgetMarginRate * |
|||
//budgetMarginRate=(totalReceivables* (1-taxRate)-planTotalCost)/totalReceivables* (1-taxRate)=1-planTotalCost/(totalReceivables* (1-taxRate)) |
|||
//1-budgetMarginRate = planTotalCost/(totalReceivables* (1-taxRate)) |
|||
// planTotalCost/(1-budgetMarginRate) =totalReceivables* (1-taxRate) |
|||
// totalReceivables=planTotalCost/(1-budgetMarginRate)/ (1-taxRate) |
|||
return autoParams |
|||
}, |
|||
planTotalAt:function(){ |
|||
return { |
|||
planOuserAt:this.addForm.planOuserAt, |
|||
planIuserAt:this.addForm.planIuserAt, |
|||
planNouserAt:this.addForm.planNouserAt, |
|||
} |
|||
}, |
|||
|
|||
totalReceivables:function(){ |
|||
return this.addForm.totalReceivables |
|||
} |
|||
}, |
|||
props:['visible','xmProduct'], |
|||
watch: { |
|||
'visible':function(visible) { |
|||
if(visible==true){ |
|||
} |
|||
}, |
|||
'planTotalAt':{ |
|||
handler(planTotalAt){ |
|||
this.addForm.planTotalCost=this.toFixed(this.parseFloat2(planTotalAt.planOuserAt)+this.parseFloat2(planTotalAt.planIuserAt)+this.parseFloat2(planTotalAt.planNouserAt)) |
|||
//this.addForm.totalReceivables=this.toFixed(this.parseFloat2(this.addForm.planTotalCost) * (1+0.3)) |
|||
}, |
|||
deep:true |
|||
}, |
|||
'totalReceivables':function(){ |
|||
//this.addForm.budgetMarginRate=this.toFixed((this.addForm.totalReceivables-this.addForm.planTotalCost)/this.addForm.totalReceivables,4) |
|||
}, |
|||
|
|||
autoParams(){ |
|||
this.fillPlanWorkingHoursToField() |
|||
this.fillPlanCostAtToField(); |
|||
this.fillTotalReceivablesToField(); |
|||
this.fillBudgetMarginRateToField() |
|||
}, |
|||
}, |
|||
data() { |
|||
const beginDate = new Date(); |
|||
const endDate = new Date(); |
|||
endDate.setTime(beginDate.getTime() + 3600 * 1000 * 24 * 7 * 4); |
|||
return { |
|||
filters: { |
|||
ids: [], |
|||
}, |
|||
dicts:{ |
|||
projectType:[], |
|||
priority:[], |
|||
priority:[], |
|||
projectStatus:[], |
|||
},//下拉选择框的所有静态数据 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: { |
|||
name: [{ |
|||
required: true, message: '项目名称不可为空' , trigger: 'change' |
|||
}], |
|||
|
|||
code: [{ |
|||
required: true, message: '项目代号不可为空', trigger: 'change' |
|||
}], |
|||
xmType: [{ |
|||
required: true, message: '项目类型不可为空', trigger: 'change' |
|||
}], |
|||
priority: [{ |
|||
required: true, message: '优先级不可为空', trigger: 'change' |
|||
}], |
|||
admUserid: [{ |
|||
required: true, message: '项目总控不能为空', trigger: 'change' |
|||
}], |
|||
pmUserid: [{ |
|||
required: true, message: '项目经理不能为空', trigger: 'change' |
|||
}], |
|||
}, |
|||
//编辑界面数据 XmProject xm_project |
|||
addForm: { |
|||
id:'',code:'',name:'',xmType:'',startTime:'',endTime:'',urgent:'',priority:'',description:'',createUserid:'',createUsername:'',createTime:'',assess:'',assessRemarks:'',status:'',branchId:'',planTotalCost:0,bizProcInstId:'',bizFlowState:'',taxRate:0.06,planNouserAt:0,planIuserAt:0,planOuserAt:0,locked:'',baseTime:'',baseRemark:'',baselineId:'',planWorkload:0,totalReceivables:0,budgetMarginRate:0.13,contractAmt:0,planIuserPrice:85,planOuserPrice:100,planOuserCnt:1,planIuserCnt:1,planWorkingHours:0,planIuserWorkload:0,planOuserWorkload:0,budgetCtrl:'0',admUserid:'',admUsername:'',pmUserid:'',pmUsername:'',assUserid:'',assUsername:'' |
|||
}, |
|||
/**begin 在下面加自定义属性,记得补上面的一个逗号**/ |
|||
xmGroups:[], |
|||
userSelectType: "", |
|||
userSelectVisible: false, |
|||
groupSelectVisible:false, |
|||
/**begin 在下面加自定义属性,记得补上面的一个逗号**/ |
|||
dateRanger: [ ], |
|||
pickerOptions: util.pickerOptions('datarange'), |
|||
|
|||
currUserType:'', |
|||
userSelectVisible:false, |
|||
maxTableHeight:300, |
|||
/**end 在上面加自定义属性**/ |
|||
}//end return |
|||
},//end data |
|||
methods: { |
|||
//打开用户选择 |
|||
//选择接收人 |
|||
|
|||
showProjectGroups:function(){ |
|||
this.groupSelectVisible=true; |
|||
}, |
|||
//项目团队选择 |
|||
onGroupSelected(groups){ |
|||
this.xmGroups=groups; |
|||
this.groupSelectVisible=false; |
|||
}, |
|||
|
|||
// 取消按钮点击 父组件监听@cancel="addFormVisible=false" 监听 |
|||
handleCancel:function(){ |
|||
this.$emit('cancel'); |
|||
}, |
|||
//编辑提交XmProject xm_project父组件监听@submit="afterEditSubmit" |
|||
addSubmit: function () { |
|||
if ( |
|||
this.dateRanger != null && |
|||
this.dateRanger.length == 2 |
|||
) { |
|||
this.addForm.startTime = this.dateRanger[0] |
|||
this.addForm.endTime = this.dateRanger[1] |
|||
}else{ |
|||
this.$notify({showClose: true, message: "请输入开始日期和结束日期", type: 'error' }); |
|||
return; |
|||
} |
|||
this.$refs.addForm.validate((valid) => { |
|||
if (valid) { |
|||
var msg=this.xmProduct&&this.xmProduct.id?'将自动关联产品【'+this.xmProduct.productName+'】':''; |
|||
this.$confirm('确认提交吗?'+msg, '提示', {}).then(() => { |
|||
this.load.add=true |
|||
let params = Object.assign({}, this.addForm); |
|||
if(this.xmProduct && this.xmProduct.id){ |
|||
params.links=[{productId:this.xmProduct.id}] |
|||
} |
|||
params.planIuserWorkload=this.autoParams.planIuserWorkload |
|||
params.planOuserWorkload=this.autoParams.planOuserWorkload |
|||
params.planWorkload=this.autoParams.planWorkload |
|||
addXmProject(params).then((res) => { |
|||
this.load.add=false; |
|||
var tips=res.data.tips; |
|||
if(tips.isOk){ |
|||
this.$emit('submit',res.data.data);// @submit="afterEditSubmit" |
|||
} |
|||
this.$notify({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' }); |
|||
}).catch( err =>this.load.add=false); |
|||
}); |
|||
}else{ |
|||
this.$notify({showClose: true, message: "表单检查不通过,请修改后提交", type:'error'}); |
|||
} |
|||
}); |
|||
}, |
|||
getWeekday(first, last) { |
|||
//计算工作日方法:遍历这两个日期区间的每一个日期,获取他的getDay() |
|||
|
|||
//分别获取first和last的毫秒数(时间戳) |
|||
first = first.getTime(); |
|||
last = last.getTime(); |
|||
|
|||
var count = 0; |
|||
for (var i = first; i <= last; i += 24 * 3600 * 1000) { |
|||
var d = new Date(i); |
|||
if (d.getDay() >= 1 && d.getDay() <= 5) { |
|||
count++; |
|||
} |
|||
} |
|||
return count; |
|||
}, |
|||
toFixed(floatValue,num){ |
|||
if(floatValue ==null || floatValue=='' || floatValue == undefined){ |
|||
return 0; |
|||
}else{ |
|||
if(!num){ |
|||
num=2 |
|||
} |
|||
return parseFloat(parseFloat(floatValue).toFixed(num)); |
|||
} |
|||
}, |
|||
parseFloat2(floatValue){ |
|||
if(floatValue ==null || floatValue=='' || floatValue == undefined){ |
|||
return 0; |
|||
}else{ |
|||
return parseFloat(floatValue); |
|||
} |
|||
}, |
|||
fillToField:function(){ |
|||
this.addForm=Object.assign(this.addForm,this.autoParams); |
|||
}, |
|||
fillPlanWorkingHoursToField:function(){ |
|||
this.addForm.planWorkingHours=this.toFixed(this.autoParams.planWorkingHours) |
|||
}, |
|||
|
|||
fillPlanCostAtToField:function(){ |
|||
this.addForm.planNouserAt=this.toFixed(this.autoParams.planNouserAt) |
|||
this.addForm.planOuserAt=this.toFixed(this.autoParams.planOuserAt ) |
|||
this.addForm.planIuserAt=this.toFixed(this.autoParams.planIuserAt ) |
|||
this.addForm.planTotalCost=this.toFixed(this.autoParams.planTotalCost) |
|||
|
|||
}, |
|||
|
|||
fillTotalReceivablesToField:function(){ |
|||
this.addForm.totalReceivables=this.toFixed(this.autoParams.totalReceivables ) |
|||
this.addForm.contractAmt=this.toFixed(this.autoParams.contractAmt ) |
|||
}, |
|||
fillBudgetMarginRateToField:function(){ |
|||
this.addForm.budgetMarginRate=this.toFixed(this.autoParams.budgetMarginRate,4) |
|||
}, |
|||
createProjectCode(){ |
|||
createProjectCode({}).then(res=>{ |
|||
var tips=res.data.tips; |
|||
if(tips.isOk){ |
|||
this.addForm.code=res.data.data |
|||
} |
|||
this.$notify({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' }); |
|||
}) |
|||
}, |
|||
showUserVisible(userType){ |
|||
this.currUserType=userType |
|||
this.userSelectVisible=true; |
|||
}, |
|||
//选择人员 |
|||
onUserSelected: function(users) { |
|||
this.userSelectVisible = false; |
|||
var user={userid:'',username:''}; |
|||
if(users && users.length>0){ |
|||
user=users[0] |
|||
} |
|||
|
|||
if(this.currUserType=='admUserid'){ |
|||
this.addForm.admUserid=user.userid |
|||
this.addForm.admUsername=user.username |
|||
}else if(this.currUserType=='assUserid'){ |
|||
this.addForm.assUserid=user.userid |
|||
this.addForm.assUsername=user.username |
|||
}else if(this.currUserType=='pmUserid'){ |
|||
this.addForm.pmUserid=user.userid |
|||
this.addForm.pmUsername=user.username |
|||
} |
|||
this.currUserType=""; |
|||
|
|||
}, |
|||
/**end 在上面加自定义方法**/ |
|||
},//end method |
|||
components: { |
|||
UsersSelect, |
|||
}, |
|||
mounted() { |
|||
|
|||
this.maxTableHeight=util.calcTableMaxHeight(this.$refs.table.$el); |
|||
this.addForm.pmUserid=this.userInfo.userid |
|||
this.addForm.pmUsername=this.userInfo.username |
|||
this.addForm.admUserid=this.userInfo.userid |
|||
this.addForm.admUsername=this.userInfo.username |
|||
this.addForm.assUserid=this.userInfo.userid |
|||
this.addForm.assUsername=this.userInfo.username |
|||
initSimpleDicts('all',['projectType','priority','projectStatus']).then(res=>{ |
|||
this.dicts=res.data.data; |
|||
}) |
|||
|
|||
} |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style scoped> |
|||
.line{ |
|||
float:right; |
|||
width: 100%; |
|||
height: 1px; |
|||
margin-top: -0.5em; |
|||
background:#d4c4c4; |
|||
position: relative; |
|||
text-align: center; |
|||
} |
|||
</style> |
|||
@ -1,293 +0,0 @@ |
|||
<template> |
|||
<section class="padding"> |
|||
<el-row> |
|||
<el-input v-model="filters.key" style="width:60%;" placeholder="项目名称模糊查询"> |
|||
</el-input> |
|||
<el-button @click="searchXmProjects" icon="el-icon-search"></el-button> |
|||
</el-row> |
|||
<el-row class="page-main "> |
|||
<el-table ref="table" :height="tableHeight" stripe :data="xmProjects" highlight-current-row v-loading="load.list" style="width: 100%;"> |
|||
<el-table-column type="index" label="序号" width="55" ></el-table-column> |
|||
<el-table-column prop="id" label="项目编码" min-width="80" ></el-table-column> |
|||
<el-table-column prop="name" label="项目名称" min-width="120" ></el-table-column> |
|||
<el-table-column label="操作" width="100" fixed="right"> |
|||
<template slot-scope="scope"> |
|||
<el-button-group> |
|||
<el-button type="primary" @click.stop="selectProject(scope.row)" >选中</el-button> |
|||
</el-button-group> |
|||
|
|||
<!-- <el-button style="width:100%;" slot="reference" class="see-more" type="text" icon="el-icon-more"></el-button> |
|||
</el-popover> --> |
|||
</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 Vue from 'vue' |
|||
import util from '@/common/js/util';//全局公共库 |
|||
//import Sticky from '@/components/Sticky' // 粘性header组件 |
|||
import config from "@/common/config"; //全局公共库 |
|||
//import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询 |
|||
import { listXmProject, } from '@/api/xm/core/xmProject'; |
|||
import { mapGetters } from 'vuex' |
|||
|
|||
|
|||
|
|||
export default { |
|||
computed: { |
|||
...mapGetters([ |
|||
'userInfo','roles' |
|||
]), |
|||
}, |
|||
data() { |
|||
return { |
|||
filters: { |
|||
key: '' |
|||
}, |
|||
xmProjects: [],//查询结果 |
|||
pageInfo:{//分页数据 |
|||
total:0,//服务器端收到0时,会自动计算总记录数,如果上传>0的不自动计算。 |
|||
pageSize:10,//每页数据 |
|||
count:false,//是否需要重新计算总记录数 |
|||
pageNum:1,//当前页码、从1开始计算 |
|||
orderFields:['create_time'],//排序列 如 ['sex','student_id'],必须为数据库字段 |
|||
orderDirs:['desc']//升序 asc,降序desc 如 性别 升序、学生编号降序 ['asc','desc'] |
|||
}, |
|||
load:{ list: false, edit: false, del: false, add: false },//查询中... |
|||
sels: [],//列表选中数据 |
|||
dicts:{},//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]} |
|||
|
|||
addFormVisible: false,//新增xmProject界面是否显示 |
|||
//新增xmProject界面初始化数据 |
|||
addForm: { |
|||
id:'',code:'',name:'',xmType:'',startTime:'',endTime:'',urgent:'',priority:'',description:'',createUserid:'',createUsername:'',createTime:'',assess:'',assessRemarks:'',status:'',branchId:'',planTotalCost:'',bizProcInstId:'',bizFlowState:'',planNouserAt:'',planIuserAt:'',planOuserAt:'',locked:'',baseTime:'',baseRemark:'',baselineId:'',planWorkload:'',totalReceivables:'',budgetMarginRate:'',contractAmt:'',planIuserPrice:'',budgetOuserPrice:'',planOuserCnt:'',planIuserCnt:'',planWorkingHours:'' |
|||
}, |
|||
|
|||
editFormVisible: false,//编辑界面是否显示 |
|||
tableHeight:300, |
|||
//编辑xmProject界面初始化数据 |
|||
editForm: { |
|||
id:'',code:'',name:'',xmType:'',startTime:'',endTime:'',urgent:'',priority:'',description:'',createUserid:'',createUsername:'',createTime:'',assess:'',assessRemarks:'',status:'',branchId:'',planTotalCost:'',bizProcInstId:'',bizFlowState:'',planNouserAt:'',planIuserAt:'',planOuserAt:'',locked:'',baseTime:'',baseRemark:'',baselineId:'',planWorkload:'',totalReceivables:'',budgetMarginRate:'',contractAmt:'',planIuserPrice:'',budgetOuserPrice:'',planOuserCnt:'',planIuserCnt:'',planWorkingHours:'' |
|||
}, |
|||
|
|||
|
|||
/**end 自定义属性请在上面加 请加备注**/ |
|||
} |
|||
},//end data |
|||
methods: { |
|||
handleSizeChange(pageSize) { |
|||
this.pageInfo.pageSize=pageSize; |
|||
this.getXmProjects(); |
|||
}, |
|||
handleCurrentChange(pageNum) { |
|||
this.pageInfo.pageNum = pageNum; |
|||
this.getXmProjects(); |
|||
}, |
|||
// 表格排序 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.getXmProjects(); |
|||
}, |
|||
searchXmProjects(){ |
|||
this.pageInfo.count=true; |
|||
this.getXmProjects(); |
|||
}, |
|||
//获取列表 XmProject xm_project |
|||
getXmProjects() { |
|||
let params = { |
|||
pageSize: this.pageInfo.pageSize, |
|||
pageNum: this.pageInfo.pageNum, |
|||
total: this.pageInfo.total, |
|||
count:this.pageInfo.count, |
|||
}; |
|||
|
|||
if(this.filters.key){ |
|||
params.key='%'+this.filters.key+'%' |
|||
} |
|||
this.load.list = true; |
|||
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(",") |
|||
} |
|||
params.branchId = this.userInfo.branchId; |
|||
listXmProject(params).then((res) => { |
|||
var tips=res.data.tips; |
|||
if(tips.isOk){ |
|||
console.log(res.data); |
|||
this.pageInfo.total = res.data.total; |
|||
this.pageInfo.count=false; |
|||
this.xmProjects = res.data.data; |
|||
}else{ |
|||
this.$notify({showClose: true, message: tips.msg, type: 'error' }); |
|||
} |
|||
this.load.list = false; |
|||
}).catch( err => this.load.list = false ); |
|||
}, |
|||
selectProject:function(row){ |
|||
this.editForm=row |
|||
this.$emit('project-confirm',this.editForm); |
|||
} |
|||
/**end 自定义函数请在上面加**/ |
|||
|
|||
},//end methods |
|||
components: { |
|||
|
|||
//在下面添加其它组件 |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.tableHeight = util.calcTableMaxHeight(this.$refs.table.$el); |
|||
this.showInfo = false; |
|||
this.getXmProjects(); |
|||
}); |
|||
} |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style scoped> |
|||
* >>> .sub-navbar{ |
|||
background: #fafbfc; |
|||
} |
|||
.changebtn{ |
|||
float: right; |
|||
padding: 0 10px; |
|||
display: flex; |
|||
align-items: center; |
|||
line-height: 0; |
|||
height: 100%; |
|||
} |
|||
.changebtn > button{ |
|||
padding: 0; |
|||
border: 0; |
|||
color: #333; |
|||
} |
|||
.changebtn >>> i::before{ |
|||
font-size:20px; |
|||
} |
|||
.changebtn-active{ |
|||
color: #409EFF !important; |
|||
} |
|||
.app-container{ |
|||
padding: 10px; |
|||
} |
|||
.el-menu-demo{ |
|||
border: 0 !important; |
|||
height: 50px; |
|||
background-color: #fafbfc; |
|||
} |
|||
.el-menu-demo>.el-menu-item, |
|||
.el-menu-demo>.el-submenu >>> .el-submenu__title{ |
|||
height: 100%; |
|||
line-height: 50px; |
|||
color: #909399; |
|||
} |
|||
.el-menu--horizontal>.el-menu-item:not(.is-disabled):focus, |
|||
.el-menu--horizontal>.el-menu-item:not(.is-disabled):hover, |
|||
.el-menu--horizontal>.el-submenu .el-submenu__title:hover{ |
|||
background-color: transparent; |
|||
} |
|||
.project-card{ |
|||
font-size: 12px; |
|||
color: #999; |
|||
margin: 10px 12px; |
|||
} |
|||
.project-card:hover{ |
|||
border-color: #00abfc; |
|||
} |
|||
.project-card >>> .el-card__body{ |
|||
padding: 20px 15px 10px; |
|||
} |
|||
.project-name{ |
|||
font-size: 16px; |
|||
font-weight: 700; |
|||
color: #333; |
|||
height: 24px; |
|||
} |
|||
.project-id{ |
|||
margin-top: 4px; |
|||
height: 18px; |
|||
} |
|||
.project-info{ |
|||
display: flex; |
|||
margin-top: 8px; |
|||
} |
|||
.project-info>div{ |
|||
display: flex; |
|||
flex-direction: column; |
|||
} |
|||
.info-item{ |
|||
width: 15%; |
|||
text-align: center; |
|||
} |
|||
.info-item >>> span{ |
|||
display: block; |
|||
} |
|||
.item-total{ |
|||
font-size: 18px; |
|||
color: #666; |
|||
} |
|||
.info-task{ |
|||
padding-left: 20px; |
|||
width: 70%; |
|||
border-left: 1px solid #efefef; |
|||
} |
|||
.finish-task{ |
|||
color: #00abfc !important; |
|||
} |
|||
.project-rate{ |
|||
margin: 15px 0; |
|||
} |
|||
.project-rate>.el-progress{ |
|||
display: flex; |
|||
align-items: center; |
|||
} |
|||
.project-rate >>> .el-progress-bar{ |
|||
padding-right: 0; |
|||
margin-right: 0; |
|||
} |
|||
.project-rate >>> .el-progress__text{ |
|||
margin-left: 5px; |
|||
} |
|||
.project-footer{ |
|||
display: flex; |
|||
} |
|||
.project-footer>div{ |
|||
width: 30%; |
|||
} |
|||
.project-footer>div:not(:first-child){ |
|||
width: 70%; |
|||
} |
|||
.project-period{ |
|||
text-align: right; |
|||
} |
|||
.see-more > i{ |
|||
background:#000; |
|||
} |
|||
/* 超过宽度则用...代替 */ |
|||
.truncate{ |
|||
overflow: hidden; |
|||
text-overflow: ellipsis; |
|||
white-space: nowrap; |
|||
} |
|||
[v-cloak]{ |
|||
display: none; |
|||
} |
|||
</style> |
|||
@ -1,198 +0,0 @@ |
|||
<template> |
|||
<section> |
|||
<el-row class="page-main padding-left"> |
|||
<el-table ref="table" border :height="maxTableHeight" stripe :data="xmProjects" highlight-current-row v-loading="load.list" @selection-change="selsChange" @row-click="rowClick" style="width: 100%;" > |
|||
<el-table-column type="index" label="序号" > |
|||
</el-table-column> |
|||
<el-table-column prop="name" label="项目名称" > |
|||
<template slot="header"> |
|||
项目名称 <el-button type="text" @click="clearSelect">清空所选</el-button><el-button type="text" @click="close">关闭</el-button> |
|||
</template> |
|||
<template slot-scope="scope"> |
|||
{{scope.row.name}} |
|||
<font :color="scope.row.totalProgress==100?'green':'#FF8C00'">{{parseInt(scope.row.totalProgress)}}%</font> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination layout="total, prev, 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 Vue from 'vue' |
|||
import util from '@/common/js/util';//全局公共库 |
|||
//import Sticky from '@/components/Sticky' // 粘性header组件 |
|||
import config from "@/common/config"; //全局公共库 |
|||
//import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询 |
|||
import { listXmProject, } from '@/api/xm/core/xmProject'; |
|||
import { mapGetters } from 'vuex' |
|||
|
|||
|
|||
|
|||
export default { |
|||
props:["xmIteration","xmProduct",'autoSelect'], |
|||
computed: { |
|||
...mapGetters([ |
|||
'userInfo','roles' |
|||
]), |
|||
}, |
|||
watch:{ |
|||
"xmIteration.id":function(val){ |
|||
this.getXmProjects(); |
|||
}, |
|||
"xmProduct.id":function(val){ |
|||
this.getXmProjects(); |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
filters: { |
|||
key: '' |
|||
}, |
|||
xmProjects: [],//查询结果 |
|||
pageInfo:{//分页数据 |
|||
total:0,//服务器端收到0时,会自动计算总记录数,如果上传>0的不自动计算。 |
|||
pageSize:10,//每页数据 |
|||
count:false,//是否需要重新计算总记录数 |
|||
pageNum:1,//当前页码、从1开始计算 |
|||
orderFields:['create_time'],//排序列 如 ['sex','student_id'],必须为数据库字段 |
|||
orderDirs:['desc']//升序 asc,降序desc 如 性别 升序、学生编号降序 ['asc','desc'] |
|||
}, |
|||
load:{ list: false, edit: false, del: false, add: false },//查询中... |
|||
sels: [],//列表选中数据 |
|||
dicts:{},//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]} |
|||
|
|||
addFormVisible: false,//新增xmProject界面是否显示 |
|||
//新增xmProject界面初始化数据 |
|||
addForm: { |
|||
id:'',code:'',name:'',xmType:'',startTime:'',endTime:'',urgent:'',priority:'',description:'',createUserid:'',createUsername:'',createTime:'',assess:'',assessRemarks:'',status:'',branchId:'',planTotalCost:'',bizProcInstId:'',bizFlowState:'',planNouserAt:'',planIuserAt:'',planOuserAt:'',locked:'',baseTime:'',baseRemark:'',baselineId:'',planWorkload:'',totalReceivables:'',budgetMarginRate:'',contractAmt:'',planIuserPrice:'',budgetOuserPrice:'',planOuserCnt:'',planIuserCnt:'',planWorkingHours:'' |
|||
}, |
|||
|
|||
editFormVisible: false,//编辑界面是否显示 |
|||
maxTableHeight:300, |
|||
//编辑xmProject界面初始化数据 |
|||
editForm: { |
|||
id:'',code:'',name:'',xmType:'',startTime:'',endTime:'',urgent:'',priority:'',description:'',createUserid:'',createUsername:'',createTime:'',assess:'',assessRemarks:'',status:'',branchId:'',planTotalCost:'',bizProcInstId:'',bizFlowState:'',planNouserAt:'',planIuserAt:'',planOuserAt:'',locked:'',baseTime:'',baseRemark:'',baselineId:'',planWorkload:'',totalReceivables:'',budgetMarginRate:'',contractAmt:'',planIuserPrice:'',budgetOuserPrice:'',planOuserCnt:'',planIuserCnt:'',planWorkingHours:'' |
|||
}, |
|||
|
|||
|
|||
/**end 自定义属性请在上面加 请加备注**/ |
|||
} |
|||
},//end data |
|||
methods: { |
|||
handleSizeChange(pageSize) { |
|||
this.pageInfo.pageSize=pageSize; |
|||
this.getXmProjects(); |
|||
}, |
|||
handleCurrentChange(pageNum) { |
|||
this.pageInfo.pageNum = pageNum; |
|||
this.getXmProjects(); |
|||
}, |
|||
// 表格排序 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.getXmProjects(); |
|||
}, |
|||
|
|||
//选择行xmProject |
|||
selsChange: function (sels) { |
|||
this.sels = sels; |
|||
}, |
|||
searchXmProjects(){ |
|||
this.pageInfo.count=true; |
|||
this.getXmProjects(); |
|||
}, |
|||
rowClick(row){ |
|||
this.editForm=row; |
|||
this.$emit("row-click",row); |
|||
}, |
|||
//获取列表 XmProject xm_project |
|||
getXmProjects() { |
|||
let params = { |
|||
pageSize: this.pageInfo.pageSize, |
|||
pageNum: this.pageInfo.pageNum, |
|||
total: this.pageInfo.total, |
|||
count:this.pageInfo.count, |
|||
}; |
|||
|
|||
if(this.filters.key){ |
|||
params.key='%'+this.filters.key+'%' |
|||
} |
|||
this.load.list = true; |
|||
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.xmIteration&&this.xmIteration.id){ |
|||
params.iterationId=this.xmIteration.id |
|||
} |
|||
if(this.xmProduct&&this.xmProduct.id){ |
|||
params.productId=this.xmProduct.id |
|||
} |
|||
params.branchId = this.userInfo.branchId; |
|||
listXmProject(params).then((res) => { |
|||
var tips=res.data.tips; |
|||
if(tips.isOk){ |
|||
this.pageInfo.total = res.data.total; |
|||
this.pageInfo.count=false; |
|||
this.xmProjects = res.data.data; |
|||
if(this.autoSelect===true&&this.xmProjects.length>0){ |
|||
var row=this.xmProjects[0]; |
|||
this.$refs.table.setCurrentRow(row); |
|||
this.rowClick(row); |
|||
} |
|||
}else{ |
|||
this.$notify({showClose: true, message: tips.msg, type: 'error' }); |
|||
} |
|||
this.load.list = false; |
|||
}).catch( err => this.load.list = false ); |
|||
}, |
|||
selectProject:function(row){ |
|||
this.editForm=row |
|||
this.$emit('project-confirm',this.editForm); |
|||
} |
|||
/**end 自定义函数请在上面加**/ |
|||
, |
|||
clearSelect(){ |
|||
this.$refs.table.setCurrentRow(); |
|||
this.$emit("clear-select"); |
|||
}, |
|||
close(){ |
|||
this.$emit("close"); |
|||
} |
|||
},//end methods |
|||
components: { |
|||
|
|||
//在下面添加其它组件 |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el); |
|||
this.showInfo = false; |
|||
this.getXmProjects(); |
|||
}); |
|||
} |
|||
} |
|||
|
|||
</script> |
|||
|
|||
|
|||
<style scoped> |
|||
.align-right{ |
|||
float: right; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,135 @@ |
|||
<template> |
|||
<section class="page-container padding"> |
|||
<el-row class="page-header"> |
|||
<el-input v-model="filters.key" style="width:50%;" placeholder="项目名称模糊查询" clearable> |
|||
</el-input> |
|||
<el-button type="primary" icon="el-icon-search" @click="searchXmProjects">查询</el-button> |
|||
</el-row> |
|||
<el-row> |
|||
<el-row> |
|||
<el-table ref="table" v-cloak fit border :data="xmProjects" highlight-current-row v-loading="load.list" |
|||
style="width: 100%;" :header-cell-style="{'text-align':'center'}" |
|||
:cell-style="{'text-align':'center'}"> |
|||
<el-table-column type="index" label="序号" min-width="50" ></el-table-column> |
|||
<el-table-column prop="id" label="项目编码" min-width="100" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="name" label="标题" min-width="150" ></el-table-column> |
|||
<el-table-column label="操作" min-width="80"> |
|||
<template slot-scope="scope"> |
|||
<el-button @click.stop="selectRow(scope.row)" >选择</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> |
|||
</section> |
|||
</template> |
|||
|
|||
<script> |
|||
import util from '@/common/js/util';//全局公共库 |
|||
import { getDicts,initSimpleDicts,initComplexDicts } from '@/api/mdp/meta/item';//字典表 |
|||
import { addXmTaskSbill,editXmTaskSbill } from '@/api/xm/core/xmTaskSbill'; |
|||
import { mapGetters } from 'vuex' |
|||
import {listXmProject} from "@/api/xm/core/xmProject"; |
|||
|
|||
export default { |
|||
components: { |
|||
//XmTaskSbillEdit, |
|||
}, |
|||
computed: { |
|||
...mapGetters([ 'userInfo' ]), |
|||
|
|||
}, |
|||
props:['visible'], |
|||
|
|||
watch: { |
|||
'visible':function(visible) { |
|||
if(visible==true){ |
|||
//从新打开页面时某些数据需要重新加载,可以在这里添加 |
|||
this.initData() |
|||
} |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
filters: { |
|||
key: '' |
|||
}, |
|||
load:{ list: false, edit: false, del: false, add: false },//查询中... |
|||
xmProjects:[], |
|||
pageInfo:{//分页数据 |
|||
total:0,//服务器端收到0时,会自动计算总记录数,如果上传>0的不自动计算。 |
|||
pageSize:10,//每页数据 |
|||
count:false,//是否需要重新计算总记录数 |
|||
pageNum:1,//当前页码、从1开始计算 |
|||
orderFields:['create_time'],//排序列 如 ['sex','student_id'],必须为数据库字段 |
|||
orderDirs:['desc']//升序 asc,降序desc 如 性别 升序、学生编号降序 ['asc','desc'] |
|||
}, |
|||
}//end return |
|||
},//end data |
|||
methods: { |
|||
//编辑提交XmTaskSbill 任务结算表父组件监听@submit="afterEditSubmit" |
|||
initData: function(){ |
|||
this.searchXmProjects(); |
|||
}, |
|||
/**begin 在下面加自定义方法**/ |
|||
handleSizeChange(pageSize) { |
|||
this.pageInfo.pageSize=pageSize; |
|||
this.getXmProjects(); |
|||
}, |
|||
handleCurrentChange(pageNum) { |
|||
this.pageInfo.pageNum = pageNum; |
|||
this.getXmProjects(); |
|||
}, |
|||
//获取列表 XmProject xm_project |
|||
getXmProjects(callBack) { |
|||
let params = { |
|||
pageSize: this.pageInfo.pageSize, |
|||
pageNum: this.pageInfo.pageNum, |
|||
total: this.pageInfo.total, |
|||
count:this.pageInfo.count, |
|||
}; |
|||
if(this.filters.key!==""){ |
|||
params.key= "%"+this.filters.key+"%"; |
|||
}else{ |
|||
//params.xxx=xxxxx |
|||
} |
|||
this.load.list = true; |
|||
listXmProject(params).then((res) => { |
|||
let tips=res.data.tips; |
|||
if(tips.isOk){ |
|||
console.log(res.data); |
|||
this.pageInfo.total = res.data.total; |
|||
this.pageInfo.count=false; |
|||
this.xmProjects = res.data.data; |
|||
}else{ |
|||
this.$message({ showClose: true, message: tips.msg, type: 'error' }); |
|||
} |
|||
this.load.list = false; |
|||
}).catch( err => this.load.list = false ); |
|||
}, |
|||
selectRow(row){ |
|||
let obj = { |
|||
projectId:row.id, |
|||
projectName:row.name |
|||
} |
|||
this.$emit('select',obj); |
|||
}, |
|||
searchXmProjects(){ |
|||
this.pageInfo.count=true; |
|||
this.getXmProjects(); |
|||
} |
|||
},//end method |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
//initSimpleDicts('all',['sex','gradeLvl']).then(res=>this.dicts=res.data.data); |
|||
this.initData() |
|||
}); |
|||
} |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
|||
@ -0,0 +1,217 @@ |
|||
<template> |
|||
<section class="page-container padding"> |
|||
<el-row class="page-header"> |
|||
</el-row> |
|||
<el-row class="page-main"> |
|||
<!--编辑界面 XmTaskSbill 任务结算表--> |
|||
<el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editFormRef"> |
|||
<!-- <el-form-item label="结算单据编号" prop="id"> |
|||
<el-input v-model="editForm.id" placeholder="结算单据编号"></el-input> |
|||
</el-form-item>--> |
|||
<el-form-item label="项目ID:" prop="projectId"> |
|||
<el-button v-if="!editForm.projectId" type="primary" @click="projSelVisible=true" round>选择项目</el-button> |
|||
<span v-else>{{editForm.projectId}}</span> |
|||
</el-form-item> |
|||
<el-form-item label="项目名称:" prop="projectName"> |
|||
<el-input disabled v-model="editForm.projectName" placeholder="项目名称"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="结算单标题:" prop="title"> |
|||
<el-input v-model="editForm.title" placeholder="结算单标题"></el-input> |
|||
</el-form-item> |
|||
<!-- <el-form-item label="金额=工时表中结算金额之和" prop="amt"> |
|||
<el-input v-model="editForm.amt" placeholder="金额=工时表中结算金额之和"></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="cuserid"> |
|||
<el-input v-model="editForm.cuserid" placeholder="创建人编号"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="创建人姓名" prop="cusername"> |
|||
<el-input v-model="editForm.cusername" placeholder="创建人姓名"></el-input> |
|||
</el-form-item>--> |
|||
<el-form-item label="备注:" prop="remark"> |
|||
<el-input v-model="editForm.remark" type="textarea" :autosize="{ minRows: 3}" placeholder="请输入备注" |
|||
maxlength="200" show-word-limit></el-input> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<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-form-item> |
|||
<!-- <el-form-item label="机构编号" prop="branchId"> |
|||
<el-input v-model="editForm.branchId" placeholder="机构编号"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="部门编号" prop="deptid"> |
|||
<el-input v-model="editForm.deptid" placeholder="部门编号"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="相对方编号(机构写机构号,个人写个人编号)" prop="cpId"> |
|||
<el-input v-model="editForm.cpId" placeholder="相对方编号(机构写机构号,个人写个人编号)"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="相对方名称(机构写机构名称,个人写个人名称)" prop="cpName"> |
|||
<el-input v-model="editForm.cpName" placeholder="相对方名称(机构写机构名称,个人写个人名称)"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="结算工作量=工时表中工时之和" prop="workload"> |
|||
<el-input v-model="editForm.workload" placeholder="结算工作量=工时表中工时之和"></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="bizFlowState"> |
|||
<el-input v-model="editForm.bizFlowState" placeholder="结算流程状态"></el-input> |
|||
</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="更新时间" prop="ltime"> |
|||
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.ltime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="0-待提交,1-已提交,2-已通过,3-已付款,4-已完成" prop="status"> |
|||
<el-input v-model="editForm.status" placeholder="0-待提交,1-已提交,2-已通过,3-已付款,4-已完成"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="最后审核意见" prop="fmsg"> |
|||
<el-input v-model="editForm.fmsg" placeholder="最后审核意见"></el-input> |
|||
</el-form-item>--> |
|||
</el-form> |
|||
</el-row> |
|||
|
|||
<!--新增 XmTaskSbill 任务结算表界面--> |
|||
<el-drawer title="选择项目" :visible.sync="projSelVisible" size="50%" append-to-body :close-on-click-modal="false"> |
|||
<select-xm-project :visible="projSelVisible" @select="afterProjectSelect"></select-xm-project> |
|||
</el-drawer> |
|||
</section> |
|||
</template> |
|||
|
|||
<script> |
|||
import util from '@/common/js/util';//全局公共库 |
|||
import { getDicts,initSimpleDicts,initComplexDicts } from '@/api/mdp/meta/item';//字典表 |
|||
import { addXmTaskSbill,editXmTaskSbill } from '@/api/xm/core/xmTaskSbill'; |
|||
import { mapGetters } from 'vuex'; |
|||
import SelectXmProject from "./SelectXmProject"; |
|||
|
|||
export default { |
|||
components: { |
|||
//XmTaskSbillEdit, |
|||
SelectXmProject, |
|||
|
|||
}, |
|||
computed: { |
|||
...mapGetters([ 'userInfo' ]), |
|||
|
|||
}, |
|||
props:['xmTaskSbill','visible','opType'], |
|||
|
|||
watch: { |
|||
'xmTaskSbill':function( xmTaskSbill ) { |
|||
if(xmTaskSbill){ |
|||
this.editForm = xmTaskSbill; |
|||
} |
|||
|
|||
}, |
|||
'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' } |
|||
] |
|||
}, |
|||
|
|||
//编辑界面数据 XmTaskSbill 任务结算表 |
|||
editForm: { |
|||
id:'',title:'',amt:'',ctime:'',cuserid:'',cusername:'',remark:'',branchId:'',deptid:'',cpId:'',cpName:'',workload:'',bizMonth:'',bizDate:'',bizFlowState:'',bizProcInstId:'',ltime:'',status:'',fmsg:'',projectId:'',projectName:'' |
|||
}, |
|||
/**begin 在下面加自定义属性,记得补上面的一个逗号**/ |
|||
projSelVisible:false, |
|||
}//end return |
|||
},//end data |
|||
methods: { |
|||
// 取消按钮点击 父组件监听@cancel="editFormVisible=false" 监听 |
|||
handleCancel:function(){ |
|||
this.$refs['editFormRef'].resetFields(); |
|||
this.$emit('cancel'); |
|||
}, |
|||
//编辑提交XmTaskSbill 任务结算表父组件监听@submit="afterEditSubmit" |
|||
saveSubmit: function () { |
|||
this.$refs.editFormRef.validate((valid) => { |
|||
if (valid) { |
|||
this.$confirm('确认提交吗?', '提示', {}).then(() => { |
|||
this.load.edit=true |
|||
let params = Object.assign({}, this.editForm); |
|||
|
|||
let today = new Date(); |
|||
let year = today.getFullYear(); |
|||
let m = today.getMonth() + 1; |
|||
let d = today.getDay(); |
|||
params.bizMonth = year+"-"+m; |
|||
params.bizDate = year+"-"+m+"-"+d; |
|||
|
|||
if(this.currOpType=='edit'){ |
|||
editXmTaskSbill(params).then((res) => { |
|||
this.load.edit=false |
|||
var tips=res.data.tips; |
|||
if(tips.isOk){ |
|||
this.$emit('submit');// @submit="afterEditSubmit" |
|||
} |
|||
this.$message({ showClose:true, message: tips.msg, type: tips.isOk?'success':'error' }); |
|||
}).catch( err =>this.load.edit=false); |
|||
}else{ |
|||
addXmTaskSbill(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.$message({ showClose:true, message: tips.msg, type: tips.isOk?'success':'error' }); |
|||
}).catch( err =>this.load.edit=false); |
|||
} |
|||
}); |
|||
} |
|||
}); |
|||
}, |
|||
initData: function(){ |
|||
this.currOpType=this.opType |
|||
if(this.xmTaskSbill){ |
|||
this.editForm = Object.assign({},this.xmTaskSbill); |
|||
} |
|||
|
|||
if(this.opType=='edit'){ |
|||
|
|||
}else{ |
|||
|
|||
} |
|||
}, |
|||
/**begin 在下面加自定义方法**/ |
|||
afterProjectSelect(obj){ |
|||
this.projSelVisible = false; |
|||
this.editForm.projectId = obj.projectId; |
|||
this.editForm.projectName = obj.projectName; |
|||
} |
|||
},//end method |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
//initSimpleDicts('all',['sex','gradeLvl']).then(res=>this.dicts=res.data.data); |
|||
this.initData() |
|||
}); |
|||
} |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
|||
@ -0,0 +1,265 @@ |
|||
<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="searchXmTaskSbills" icon="el-icon-search">查询</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>--> |
|||
<span style="float:right;"> |
|||
<el-button type="primary" icon="el-icon-plus" @click="showAdd" round></el-button> |
|||
</span> |
|||
</el-row> |
|||
<el-row class="padding-top"> |
|||
<!--列表 XmTaskSbill 任务结算表--> |
|||
<el-table ref="xmTaskSbillTable" :data="xmTaskSbills" :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></el-table-column>--> |
|||
<el-table-column label="序号" type="index" min-width="55" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="id" label="结算单编号" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="title" label="结算单标题" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="amt" label="金额" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="ctime" label="创建时间" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="cuserid" label="创建人编号" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="cusername" label="创建人姓名" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="remark" label="备注" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<!-- <el-table-column prop="branchId" label="机构编号" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="deptid" label="部门编号" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="cpId" label="相对方编号(机构写机构号,个人写个人编号)" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="cpName" label="相对方名称(机构写机构名称,个人写个人名称)" min-width="80" show-overflow-tooltip></el-table-column>--> |
|||
<el-table-column prop="workload" label="结算工时" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<!-- <el-table-column prop="bizMonth" label="业务月份yyyy-MM" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="bizDate" label="业务日期yyyy-MM-dd" min-width="80" show-overflow-tooltip></el-table-column>--> |
|||
<el-table-column prop="bizFlowState" label="审批状态" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="bizProcInstId" label="审批编号" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="ltime" label="更新时间" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="status" label="结算单状态" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="fmsg" label="最后审核意见" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="projectId" label="项目编号" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="projectName" label="项目名称" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column label="操作" width="120" fixed="right"> |
|||
<template scope="scope"> |
|||
<el-button type="text" @click="showEdit( scope.row,scope.$index)" icon="el-icon-edit"></el-button> |
|||
<el-button type="text" @click="handleDel(scope.row,scope.$index)" icon="el-icon-delete"></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> |
|||
<!--编辑 XmTaskSbill 任务结算表界面--> |
|||
<el-drawer title="编辑任务结算单" :visible.sync="editFormVisible" size="60%" append-to-body :close-on-click-modal="false"> |
|||
<xm-task-sbill-edit op-type="edit" :xm-task-sbill="editForm" :visible="editFormVisible" @cancel="editFormVisible=false" @submit="afterEditSubmit"></xm-task-sbill-edit> |
|||
</el-drawer> |
|||
|
|||
<!--新增 XmTaskSbill 任务结算表界面--> |
|||
<el-drawer title="新增任务结算单" :visible.sync="addFormVisible" size="60%" append-to-body :close-on-click-modal="false"> |
|||
<xm-task-sbill-edit op-type="add" :visible="addFormVisible" @cancel="addFormVisible=false" @submit="afterAddSubmit"></xm-task-sbill-edit> |
|||
</el-drawer> |
|||
</el-row> |
|||
</section> |
|||
</template> |
|||
|
|||
<script> |
|||
import util from '@/common/js/util';//全局公共库 |
|||
import config from '@/common/config';//全局公共库 |
|||
import { getDicts,initSimpleDicts,initComplexDicts } from '@/api/mdp/meta/item';//字典表 |
|||
import { listXmTaskSbill, delXmTaskSbill, batchDelXmTaskSbill } from '@/api/xm/core/xmTaskSbill'; |
|||
import XmTaskSbillEdit from './XmTaskSbillEdit';//新增修改界面 |
|||
import { mapGetters } from 'vuex' |
|||
|
|||
export default { |
|||
components: { |
|||
XmTaskSbillEdit, |
|||
}, |
|||
props:['visible'], |
|||
computed: { |
|||
...mapGetters(['userInfo']), |
|||
|
|||
}, |
|||
watch:{ |
|||
visible(val){ |
|||
if(val==true){ |
|||
this.initData(); |
|||
this.searchXmTaskSbills() |
|||
} |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
filters: { |
|||
key: '' |
|||
}, |
|||
xmTaskSbills: [],//查询结果 |
|||
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:{},//下拉选择框的所有静态数据 params={categoryId:'all',itemCodes:['sex']} 返回结果 {sex: [{id:'1',name:'男'},{id:'2',name:'女'}]} |
|||
addFormVisible: false,//新增xmTaskSbill界面是否显示 |
|||
//新增xmTaskSbill界面初始化数据 |
|||
addForm: { |
|||
id:'',title:'',amt:'',ctime:'',cuserid:'',cusername:'',remark:'',branchId:'',deptid:'',cpId:'',cpName:'',workload:'',bizMonth:'',bizDate:'',bizFlowState:'',bizProcInstId:'',ltime:'',status:'',fmsg:'',projectId:'',projectName:'' |
|||
}, |
|||
|
|||
editFormVisible: false,//编辑界面是否显示 |
|||
//编辑xmTaskSbill界面初始化数据 |
|||
editForm: { |
|||
id:'',title:'',amt:'',ctime:'',cuserid:'',cusername:'',remark:'',branchId:'',deptid:'',cpId:'',cpName:'',workload:'',bizMonth:'',bizDate:'',bizFlowState:'',bizProcInstId:'',ltime:'',status:'',fmsg:'',projectId:'',projectName:'' |
|||
}, |
|||
maxTableHeight:300, |
|||
} |
|||
},//end data |
|||
methods: { |
|||
handleSizeChange(pageSize) { |
|||
this.pageInfo.pageSize=pageSize; |
|||
this.getXmTaskSbills(); |
|||
}, |
|||
handleCurrentChange(pageNum) { |
|||
this.pageInfo.pageNum = pageNum; |
|||
this.getXmTaskSbills(); |
|||
}, |
|||
// 表格排序 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.getXmTaskSbills(); |
|||
}, |
|||
searchXmTaskSbills(){ |
|||
this.pageInfo.count=true; |
|||
this.getXmTaskSbills(); |
|||
}, |
|||
//获取列表 XmTaskSbill 任务结算表 |
|||
getXmTaskSbills() { |
|||
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; |
|||
listXmTaskSbill(params).then((res) => { |
|||
var tips=res.data.tips; |
|||
if(tips.isOk){ |
|||
this.pageInfo.total = res.data.total; |
|||
this.pageInfo.count=false; |
|||
this.xmTaskSbills = res.data.data; |
|||
}else{ |
|||
this.$message({ showClose:true, message: tips.msg, type: 'error' }); |
|||
} |
|||
this.load.list = false; |
|||
}).catch( err => this.load.list = false ); |
|||
}, |
|||
|
|||
//显示编辑界面 XmTaskSbill 任务结算表 |
|||
showEdit: function ( row,index ) { |
|||
this.editFormVisible = true; |
|||
this.editForm = Object.assign({}, row); |
|||
}, |
|||
//显示新增界面 XmTaskSbill 任务结算表 |
|||
showAdd: function () { |
|||
this.addFormVisible = true; |
|||
//this.addForm=Object.assign({}, this.editForm); |
|||
}, |
|||
afterAddSubmit(){ |
|||
this.addFormVisible=false; |
|||
this.pageInfo.count=true; |
|||
this.getXmTaskSbills(); |
|||
}, |
|||
afterEditSubmit(){ |
|||
this.editFormVisible=false; |
|||
}, |
|||
//选择行xmTaskSbill |
|||
selsChange: function (sels) { |
|||
this.sels = sels; |
|||
}, |
|||
//删除xmTaskSbill |
|||
handleDel: function (row,index) { |
|||
this.$confirm('确认删除该记录吗?', '提示', { |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.load.del=true; |
|||
let params = { id: row.id }; |
|||
delXmTaskSbill(params).then((res) => { |
|||
this.load.del=false; |
|||
var tips=res.data.tips; |
|||
if(tips.isOk){ |
|||
this.pageInfo.count=true; |
|||
this.getXmTaskSbills(); |
|||
} |
|||
this.$message({ showClose:true, message: tips.msg, type: tips.isOk?'success':'error' }); |
|||
}).catch( err => this.load.del=false ); |
|||
}); |
|||
}, |
|||
//批量删除xmTaskSbill |
|||
batchDel: function () { |
|||
|
|||
this.$confirm('确认删除选中记录吗?', '提示', { |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.load.del=true; |
|||
batchDelXmTaskSbill(this.sels).then((res) => { |
|||
this.load.del=false; |
|||
var tips=res.data.tips; |
|||
if( tips.isOk ){ |
|||
this.pageInfo.count=true; |
|||
this.getXmTaskSbills(); |
|||
} |
|||
this.$message({ 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" |
|||
}, |
|||
initData: function(){ |
|||
|
|||
}, |
|||
/**begin 自定义函数请在下面加**/ |
|||
|
|||
},//end methods |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
//initSimpleDicts('all',['sex','gradeLvl']).then(res=>this.dicts=res.data.data); |
|||
this.initData() |
|||
this.searchXmTaskSbills(); |
|||
if(this.$refs.xmTaskSbillTable){ |
|||
var clientRect=this.$refs.xmTaskSbillTable.$el.getBoundingClientRect(); |
|||
var subHeight=70/1000 * window.innerHeight; |
|||
this.maxTableHeight = window.innerHeight -clientRect.y - this.$refs.xmTaskSbillTable.$el.offsetTop-subHeight; |
|||
} |
|||
|
|||
}); |
|||
} |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style scoped> |
|||
</style> |
|||
@ -0,0 +1,174 @@ |
|||
<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"> |
|||
<!--编辑界面 XmTaskWorkload 工时登记表--> |
|||
<el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editFormRef"> |
|||
<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="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="taskId"> |
|||
<el-input v-model="editForm.taskId" placeholder="业务对象主键任务编号"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="创建人编号" prop="cuserid"> |
|||
<el-input v-model="editForm.cuserid" placeholder="创建人编号"></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="状态0-待确认,1-已确认,2-无效" prop="wstatus"> |
|||
<el-input v-model="editForm.wstatus" placeholder="状态0-待确认,1-已确认,2-无效"></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="任务类型-关联字典taskType" prop="ttype"> |
|||
<el-input v-model="editForm.ttype" placeholder="任务类型-关联字典taskType"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="主键" prop="id"> |
|||
<el-input-number v-model="editForm.id" :min="0" :max="200"></el-input-number> |
|||
</el-form-item> |
|||
<el-form-item label="结算单据编号" prop="sbillId"> |
|||
<el-input v-model="editForm.sbillId" placeholder="结算单据编号"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="结算提交时间" prop="stime"> |
|||
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.stime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="结算状态0-无需结算,1-待结算2-已提交3-已通过4-已结算" prop="sstatus"> |
|||
<el-input v-model="editForm.sstatus" placeholder="结算状态0-无需结算,1-待结算2-已提交3-已通过4-已结算"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="工时对应金额" prop="amt"> |
|||
<el-input v-model="editForm.amt" placeholder="工时对应金额"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="结算金额" prop="samt"> |
|||
<el-input v-model="editForm.samt" placeholder="结算金额"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="工时,一个task_id可多次提交,小时" prop="workload"> |
|||
<el-input v-model="editForm.workload" placeholder="工时,一个task_id可多次提交,小时"></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 { getDicts,initSimpleDicts,initComplexDicts } from '@/api/mdp/meta/item';//字典表 |
|||
import { addXmTaskWorkload,editXmTaskWorkload } from '@/api/xm/core/xmTaskWorkload'; |
|||
import { mapGetters } from 'vuex' |
|||
|
|||
export default { |
|||
name:'xmTaskWorkloadEdit', |
|||
components: { |
|||
|
|||
}, |
|||
computed: { |
|||
...mapGetters([ 'userInfo' ]), |
|||
|
|||
}, |
|||
props:['xmTaskWorkload','visible','opType'], |
|||
|
|||
watch: { |
|||
'xmTaskWorkload':function( xmTaskWorkload ) { |
|||
if(xmTaskWorkload){ |
|||
this.editForm = xmTaskWorkload; |
|||
} |
|||
|
|||
}, |
|||
'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: { |
|||
userid:'',username:'',ctime:'',taskId:'',cuserid:'',bizDate:'',wstatus:'',remark:'',ttype:'',id:'',sbillId:'',stime:'',sstatus:'',amt:'',samt:'',workload:'' |
|||
}, |
|||
maxTableHeight:300, |
|||
}//end return |
|||
},//end data |
|||
methods: { |
|||
// 取消按钮点击 父组件监听@cancel="editFormVisible=false" 监听 |
|||
handleCancel:function(){ |
|||
this.$refs['editFormRef'].resetFields(); |
|||
this.$emit('cancel'); |
|||
}, |
|||
//新增、编辑提交XmTaskWorkload 工时登记表父组件监听@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=addXmTaskWorkload |
|||
if(this.currOpType=='edit'){ |
|||
func=editXmTaskWorkload |
|||
} |
|||
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({ 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.xmTaskWorkload){ |
|||
this.editForm = Object.assign({},this.xmTaskWorkload); |
|||
} |
|||
|
|||
if(this.opType=='edit'){ |
|||
|
|||
}else{ |
|||
|
|||
} |
|||
}, |
|||
|
|||
},//end method |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
//initSimpleDicts('all',['sex','gradeLvl']).then(res=>this.dicts=res.data.data); |
|||
this.initData() |
|||
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el) |
|||
}); |
|||
} |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
|||
@ -0,0 +1,260 @@ |
|||
<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="searchXmTaskWorkloads" icon="el-icon-search">查询</el-button> |
|||
<el-button type="primary" @click="showAdd" icon="el-icon-plus"> </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> |
|||
</el-row> |
|||
<el-row class="padding-top"> |
|||
<!--列表 XmTaskWorkload 工时登记表--> |
|||
<el-table ref="xmTaskWorkloadTable" :data="xmTaskWorkloads" :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></el-table-column> |
|||
<el-table-column sortable type="index" width="55" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="userid" label="员工编号" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="username" label="姓名" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="ctime" label="创建日期" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="taskId" label="业务对象主键任务编号" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="cuserid" label="创建人编号" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="bizDate" label="业务日期yyyy-MM-dd" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="wstatus" label="状态0-待确认,1-已确认,2-无效" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="remark" label="备注" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="ttype" label="任务类型-关联字典taskType" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="id" label="主键" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="sbillId" label="结算单据编号" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="stime" label="结算提交时间" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="sstatus" label="结算状态0-无需结算,1-待结算2-已提交3-已通过4-已结算" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="amt" label="工时对应金额" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="samt" label="结算金额" min-width="80" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="workload" label="工时,一个task_id可多次提交,小时" min-width="80" show-overflow-tooltip></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"></el-button> |
|||
<el-button type="danger" @click="handleDel(scope.row,scope.$index)" icon="el-icon-delete"></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> |
|||
<!--编辑 XmTaskWorkload 工时登记表界面--> |
|||
<el-drawer title="编辑工时登记表" :visible.sync="editFormVisible" size="60%" append-to-body :close-on-click-modal="false"> |
|||
<xm-task-workload-edit op-type="edit" :xm-task-workload="editForm" :visible="editFormVisible" @cancel="editFormVisible=false" @submit="afterEditSubmit"></xm-task-workload-edit> |
|||
</el-drawer> |
|||
|
|||
<!--新增 XmTaskWorkload 工时登记表界面--> |
|||
<el-drawer title="新增工时登记表" :visible.sync="addFormVisible" size="60%" append-to-body :close-on-click-modal="false"> |
|||
<xm-task-workload-edit op-type="add" :visible="addFormVisible" @cancel="addFormVisible=false" @submit="afterAddSubmit"></xm-task-workload-edit> |
|||
</el-drawer> |
|||
</el-row> |
|||
</section> |
|||
</template> |
|||
|
|||
<script> |
|||
import util from '@/common/js/util';//全局公共库 |
|||
import config from '@/common/config';//全局公共库 |
|||
import { getDicts,initSimpleDicts,initComplexDicts } from '@/api/mdp/meta/item';//字典表 |
|||
import { listXmTaskWorkload, delXmTaskWorkload, batchDelXmTaskWorkload } from '@/api/xm/core/xmTaskWorkload'; |
|||
import XmTaskWorkloadEdit from './XmTaskWorkloadEdit';//新增修改界面 |
|||
import { mapGetters } from 'vuex' |
|||
|
|||
export default { |
|||
name:'xmTaskWorkloadMng', |
|||
components: { |
|||
XmTaskWorkloadEdit, |
|||
}, |
|||
props:['visible'], |
|||
computed: { |
|||
...mapGetters(['userInfo']), |
|||
|
|||
}, |
|||
watch:{ |
|||
visible(val){ |
|||
if(val==true){ |
|||
this.initData(); |
|||
this.searchXmTaskWorkloads() |
|||
} |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
filters: { |
|||
key: '' |
|||
}, |
|||
xmTaskWorkloads: [],//查询结果 |
|||
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,//新增xmTaskWorkload界面是否显示 |
|||
addForm: { |
|||
userid:'',username:'',ctime:'',taskId:'',cuserid:'',bizDate:'',wstatus:'',remark:'',ttype:'',id:'',sbillId:'',stime:'',sstatus:'',amt:'',samt:'',workload:'' |
|||
}, |
|||
|
|||
editFormVisible: false,//编辑界面是否显示 |
|||
editForm: { |
|||
userid:'',username:'',ctime:'',taskId:'',cuserid:'',bizDate:'',wstatus:'',remark:'',ttype:'',id:'',sbillId:'',stime:'',sstatus:'',amt:'',samt:'',workload:'' |
|||
}, |
|||
maxTableHeight:300, |
|||
} |
|||
},//end data |
|||
methods: { |
|||
handleSizeChange(pageSize) { |
|||
this.pageInfo.pageSize=pageSize; |
|||
this.getXmTaskWorkloads(); |
|||
}, |
|||
handleCurrentChange(pageNum) { |
|||
this.pageInfo.pageNum = pageNum; |
|||
this.getXmTaskWorkloads(); |
|||
}, |
|||
// 表格排序 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.getXmTaskWorkloads(); |
|||
}, |
|||
searchXmTaskWorkloads(){ |
|||
this.pageInfo.count=true; |
|||
this.getXmTaskWorkloads(); |
|||
}, |
|||
//获取列表 XmTaskWorkload 工时登记表 |
|||
getXmTaskWorkloads() { |
|||
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; |
|||
listXmTaskWorkload(params).then((res) => { |
|||
var tips=res.data.tips; |
|||
if(tips.isOk){ |
|||
this.pageInfo.total = res.data.total; |
|||
this.pageInfo.count=false; |
|||
this.xmTaskWorkloads = res.data.data; |
|||
}else{ |
|||
this.$notify({ showClose:true, message: tips.msg, type: 'error' }); |
|||
} |
|||
this.load.list = false; |
|||
}).catch( err => this.load.list = false ); |
|||
}, |
|||
|
|||
//显示编辑界面 XmTaskWorkload 工时登记表 |
|||
showEdit: function ( row,index ) { |
|||
this.editFormVisible = true; |
|||
this.editForm = Object.assign({}, row); |
|||
}, |
|||
//显示新增界面 XmTaskWorkload 工时登记表 |
|||
showAdd: function () { |
|||
this.addFormVisible = true; |
|||
//this.addForm=Object.assign({}, this.editForm); |
|||
}, |
|||
afterAddSubmit(){ |
|||
this.addFormVisible=false; |
|||
this.pageInfo.count=true; |
|||
this.getXmTaskWorkloads(); |
|||
}, |
|||
afterEditSubmit(){ |
|||
this.editFormVisible=false; |
|||
}, |
|||
//选择行xmTaskWorkload |
|||
selsChange: function (sels) { |
|||
this.sels = sels; |
|||
}, |
|||
//删除xmTaskWorkload |
|||
handleDel: function (row,index) { |
|||
this.$confirm('确认删除该记录吗?', '提示', { |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.load.del=true; |
|||
let params = { id:row.id }; |
|||
delXmTaskWorkload(params).then((res) => { |
|||
this.load.del=false; |
|||
var tips=res.data.tips; |
|||
if(tips.isOk){ |
|||
this.pageInfo.count=true; |
|||
this.getXmTaskWorkloads(); |
|||
} |
|||
this.$notify({ showClose:true, message: tips.msg, type: tips.isOk?'success':'error' }); |
|||
}).catch( err => this.load.del=false ); |
|||
}); |
|||
}, |
|||
//批量删除xmTaskWorkload |
|||
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; |
|||
batchDelXmTaskWorkload(params).then((res) => { |
|||
this.load.del=false; |
|||
var tips=res.data.tips; |
|||
if( tips.isOk ){ |
|||
this.pageInfo.count=true; |
|||
this.getXmTaskWorkloads(); |
|||
} |
|||
this.$notify({ showClose:true, message: tips.msg, type: tips.isOk?'success':'error'}); |
|||
}).catch( err => this.load.del=false ); |
|||
}); |
|||
}, |
|||
rowClick: function(row, event, column){ |
|||
this.editForm=row |
|||
this.$emit('row-click',row, event, column);// @row-click="rowClick" |
|||
}, |
|||
initData: function(){ |
|||
|
|||
}, |
|||
|
|||
},//end methods |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
//initSimpleDicts('all',['sex','gradeLvl']).then(res=>this.dicts=res.data.data); |
|||
this.initData() |
|||
this.searchXmTaskWorkloads(); |
|||
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.xmTaskWorkloadTable.$el) |
|||
|
|||
}); |
|||
} |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style scoped> |
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue