Browse Source

任务结算

master
chentaiyu 4 years ago
parent
commit
31ab63fe1e
  1. 2
      src/api/xm/core/xmTaskWorkload.js
  2. 3
      src/router/routes_xm.js
  3. 21
      src/views/xm/core/xmTaskSbill/SelectTaskWorkload.vue
  4. 4
      src/views/xm/core/xmTaskSbill/XmTaskSbillEdit.vue
  5. 1
      src/views/xm/core/xmTaskSbill/XmTaskSbillMng.vue
  6. 317
      src/views/xm/core/xmTaskWorkload/XmTaskSbillSelect.vue
  7. 128
      src/views/xm/core/xmTaskWorkload/XmTaskWorkloadMng.vue

2
src/api/xm/core/xmTaskWorkload.js

@ -31,3 +31,5 @@ export const addXmTaskWorkload = params => { return axios.post(`${base}/xm/core/
//普通查询 条件之间and关系
export const listByProject = params => { return axios.get(`${base}/xm/core/xmTaskWorkload/listByProject`, { params: params }); };
export const editWorkloadToSbill = params => { return axios.post(`${base}/xm/core/xmTaskWorkload/editWorkloadToSbill`, params); };

3
src/router/routes_xm.js

@ -162,7 +162,8 @@ export default {
},
//leaf: true,//只有一个节点
children: [
{ path: 'xmTaskSbill/XmTaskSbillMng', component: _import('xm/core/xmTaskSbill/XmTaskSbillMng'), name: 'XmTaskSbilllMng', meta: { title: '任务结算',icon:'task' }},
{ path: 'xmTaskSbill/XmTaskSbillMng', component: _import('xm/core/xmTaskSbill/XmTaskSbillMng'), name: 'XmTaskSbilllMng', meta: { title: '任务结算'}},
{ path: 'xmTaskWorkload/XmTaskWorkloadMng', component: _import('xm/core/xmTaskWorkload/XmTaskWorkloadMng'), name: 'XmTaskWorkloadMng', meta: { title: '工时列表'}},
]
}
]

21
src/views/xm/core/xmTaskSbill/SelectTaskWorkload.vue

@ -1,7 +1,7 @@
<template>
<section class="page-container border padding">
<el-row>
<el-input v-model="filters.key" style="width: 30%;" placeholder="模糊查询任务ID/名称/员工ID/员工名称"></el-input>
<el-input v-model="filters.key" style="width: 30%;" placeholder="模糊查询:/员工ID/员工名称"></el-input>
<el-button v-loading="load.list" :disabled="load.list==true" @click="searchXmTaskWorkloads" icon="el-icon-search">查询</el-button>
</el-row>
<el-row class="padding-top">
@ -40,8 +40,18 @@
<span v-else>-</span>
</template>
</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="amt" label="工时金额" min-width="80" show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="scope.row.amt">{{scope.row.amt}}</span>
<span v-else>0</span>
</template>
</el-table-column>
<el-table-column prop="samt" label="结算金额" min-width="80" show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="scope.row.samt">{{scope.row.samt}}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column prop="workload" label="工时" min-width="80" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="180" fixed="right">
<template scope="scope">
@ -135,7 +145,8 @@ export default {
pageNum: this.pageInfo.pageNum,
total: this.pageInfo.total,
count:this.pageInfo.count,
projectId:this.xmTaskSbill.projectId
projectId:this.xmTaskSbill.projectId,
toSbill:true
};
if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){
let orderBys=[];
@ -149,7 +160,7 @@ export default {
}
this.load.list = true;
listByProject(params).then((res) => {
listXmTaskWorkload(params).then((res) => {
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.total = res.data.total;

4
src/views/xm/core/xmTaskSbill/XmTaskSbillEdit.vue

@ -203,11 +203,11 @@
this.editForm.projectName = obj.projectName;
},
onProjectRowClick(obj){
this.$set(this.editForm, "projectI", obj[0].projectId);
this.$set(this.editForm, "projectId", obj[0].projectId);
this.$set(this.editForm, "projectName", obj[0].projectName);
},
onProjectClear(){
this.$set(this.editForm, "projectI", null);
this.$set(this.editForm, "projectId", null);
this.$set(this.editForm, "projectName", null);
}
},//end method

1
src/views/xm/core/xmTaskSbill/XmTaskSbillMng.vue

@ -308,6 +308,7 @@
this.changeXmTaskSbill(this.thisBillRow);
//xmTaskWokload
this.changeXmTaskWorkload(row,this.thisBillRow);
this.getXmTaskSbills();
},
changeXmTaskSbill(data){
let params = Object.assign({}, data);

317
src/views/xm/core/xmTaskWorkload/XmTaskSbillSelect.vue

@ -0,0 +1,317 @@
<template>
<section>
<el-popover
placement="bottom"
width="400"
trigger="manual"
v-model="sbillVisible">
<el-row >
<!--列表 XmTaskSbill 结算表-->
<el-table ref="table" :height="maxTableHeight" :data="xmTaskSbills" :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>&nbsp;&nbsp;
<el-button type="text" @click="close">关闭</el-button>&nbsp;&nbsp;
<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="searchXmTaskSbills">
</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="searchXmTaskSbills" ></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.title}}</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="referenceClick">
<slot name="reference"><el-link title="结算单,点击选择、清除选择" type="warning" icon="el-icon-search"><span style="font-size:14px;"><slot name="title">{{editForm && editForm.id?editForm.title:'选择结算单'}}</slot></span></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 { mapGetters } from 'vuex'
import UsersSelect from "@/views/mdp/sys/user/UsersSelect";
import {listXmTaskSbill} from "@/api/xm/core/xmTaskSbill";
export default {
props:['autoSelect','projectId'],
computed: {
...mapGetters([
'userInfo','roles'
])
},
watch:{
projectId(){
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,//
},
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:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
//xmTaskSbills
editForm: {
id:'',title:''
},
selectFiltersPmUserVisible:false,
maxTableHeight:300,
dateRanger: [ ],
pickerOptions: util.pickerOptions('datarange'),
sbillVisible:false,
moreVisible:false,
hadInit:false,
}
},//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 ){
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.getXmTaskSbills();
},
searchXmTaskSbills(){
this.pageInfo.count=true;
this.getXmTaskSbills();
},
// XmTaskSbill
getXmTaskSbills() {
console.log(JSON.stringify(this.dateRanger));
let params = {
pageSize: this.pageInfo.pageSize,
pageNum: this.pageInfo.pageNum,
total: this.pageInfo.total,
count:this.pageInfo.count,
projectId: this.projectId,
status:'0'
};
if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){
let orderBys=[];
for(let 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.filters.id){
params.id = this.filters.id;
}
if(this.filters.pmUser){
params.cuserid = this.filters.pmUser.userid;
}
if(this.dateRanger){
params.startTime = this.dateRanger[0];
params.endTime = this.dateRanger[1];
}
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.$notify({ showClose:true, message: tips.msg, type: 'error' });
}
this.load.list = false;
}).catch( err => this.load.list = false );
},
//xmTaskSbill
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.selectedXmTaskSbill(row)
this.sbillVisible=false;
this.moreVisible=false;
},
selectedXmTaskSbill:function(row){
this.editForm=row
this.$emit('selected',row);
this.sbillVisible=false;
this.moreVisible=false;
},
/**begin 自定义函数请在下面加**/
clearFiltersPmUser:function(){
this.filters.pmUser=null;
this.searchXmTaskSbills();
},
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.searchXmTaskSbills();
},
setFiltersPmUserAsMySelf(){
this.filters.pmUser=this.userInfo;
this.searchXmTaskSbills();
},
tableRowClassName({row, rowIndex}) {
if (row && this.editForm && row.id == this.editForm.id) {
return 'success-row';
}
return '';
},
clearSelect(){
this.$refs.table.setCurrentRow();
this.$emit("clear-select");
this.selectedXmTaskSbill(null);
this.sbillVisible=false;
this.moreVisible=false;
},
close(){
this.sbillVisible=false;
this.moreVisible=false;
this.$emit("close");
},
initData(){
this.searchXmTaskSbills();
},
referenceClick(){
if(!this.hadInit){
this.initData();
this.hadInit=true;
}
this.sbillVisible=!this.sbillVisible;
}
},//end methods
components: {
UsersSelect,
//
},
mounted() {
this.$nextTick(() => {
if(this.$refs.table){
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el);
}
if(this.autoSelect!==false){
this.initData();
this.hadInit=true;
}
});
}
}
</script>
<style scoped>
.more-label-font{
text-align:center;
float:left;
padding-top:5px;
}
.align-right{
float: right;
}
</style>

128
src/views/xm/core/xmTaskWorkload/XmTaskWorkloadMng.vue

@ -1,41 +1,76 @@
<template>
<section class="page-container border padding">
<el-row>
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询"></el-input>
<xm-project-select style="display:inline;" ref="xmProjectSelect" :auto-select="false" @row-click="onProjectConfirm" @clear-select="clearProject"></xm-project-select>
<el-input v-model="filters.key" style="width: 30%;" clearable placeholder="模糊查询:员工ID/员工名称/项目ID/任务编号"></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-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 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%;" :header-cell-style="{'text-align':'center'}"
:cell-style="{'text-align':'center'}">
<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="id" 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="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="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 prop="rworkload" label="剩余工时(同一天取最后日期更新到task表rworkload中)" 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="projectId" label="归属项目" min-width="80" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="180" fixed="right">
<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>
<template slot-scope="scope">
<span v-if="scope.row.remark">{{scope.row.remark}}</span>
<span v-else>-</span>
</template>
</el-table-column>
<!-- <el-table-column prop="ttype" label="任务类型-关联字典taskType" 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="toSbill" label="结算" min-width="80" show-overflow-tooltip>
<template slot-scope="scope">
<span class="cell-bar">
<xm-task-sbill-select style="display:inline;" :auto-select="false" :project-id="scope.row.projectId" placeholder="结算" @row-click="editXmWorkloadSomeFields(scope.row,$event)"></xm-task-sbill-select>
</span>
</template>
</el-table-column>
<el-table-column prop="sstatus" label="结算状态" min-width="80" show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="scope.row.sstatus=='0'">无需结算</span>
<span v-else-if="scope.row.sstatus=='1'">待结算</span>
<span v-else-if="scope.row.sstatus=='2'">已提交</span>
<span v-else-if="scope.row.sstatus=='3'">已通过</span>
<span v-else-if="scope.row.sstatus=='4'">已结算</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column prop="amt" label="工时金额" min-width="80" show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="scope.row.amt">{{scope.row.amt}}</span>
<span v-else>0</span>
</template>
</el-table-column>
<el-table-column prop="samt" label="结算金额" min-width="80" show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="scope.row.samt">{{scope.row.samt}}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column prop="workload" label="工时" min-width="80" show-overflow-tooltip></el-table-column>
<!-- <el-table-column prop="rworkload" label="剩余工时(同一天取最后日期更新到task表rworkload中)" 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 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-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>
@ -60,11 +95,16 @@
import { listXmTaskWorkload, delXmTaskWorkload, batchDelXmTaskWorkload } from '@/api/xm/core/xmTaskWorkload';
import XmTaskWorkloadEdit from './XmTaskWorkloadEdit';//
import { mapGetters } from 'vuex'
import XmProjectSelect from "../components/XmProjectSelect";
import XmTaskSbillSelect from "./XmTaskSbillSelect";
import {editWorkloadToSbill} from "../../../../api/xm/core/xmTaskWorkload";
export default {
name:'xmTaskWorkloadMng',
components: {
XmTaskWorkloadEdit,
XmProjectSelect,
XmTaskSbillSelect,
},
props:['visible'],
computed: {
@ -108,6 +148,7 @@
userid:'',username:'',ctime:'',taskId:'',cuserid:'',bizDate:'',wstatus:'',remark:'',ttype:'',id:'',sbillId:'',stime:'',sstatus:'',amt:'',samt:'',workload:'',rworkload:'',cusername:'',projectId:''
},
maxTableHeight:300,
selProject:'',
}
},//end data
methods: {
@ -147,7 +188,8 @@
pageSize: this.pageInfo.pageSize,
pageNum: this.pageInfo.pageNum,
total: this.pageInfo.total,
count:this.pageInfo.count
count:this.pageInfo.count,
toSbill:true
};
if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){
let orderBys=[];
@ -157,8 +199,11 @@
params.orderBy= orderBys.join(",")
}
if(this.filters.key){
params.key=this.filters.key
params.key= "%" + this.filters.key + "%"
}
if(this.selProject){
params.projectId= this.selProject;
}
this.load.list = true;
listXmTaskWorkload(params).then((res) => {
@ -241,10 +286,41 @@
this.editForm=row
this.$emit('row-click',row, event, column);// @row-click="rowClick"
},
initData: function(){
initData: function(){
},
},
onProjectConfirm(obj){
this.selProject = obj.projectId;
this.getXmTaskWorkloads();
},
clearProject(){
this.selProject = null;
this.getXmTaskWorkloads();
},
editXmWorkloadSomeFields(workload,row,fieldName,$event){
let params={
projectId:row.projectId
};
if(this.sels.length>0){
if(!this.sels.some(k=>k.projectId==row.projectId)){
this.$notify({showClose:true,message:'存在不同项目的工时单,请重新选择',type:'warning'})
return;
}
params.ids=this.sels.map(i=>i.id);
}else{
params.ids = [workload.id];
}
params.sbillId = row.id;
editWorkloadToSbill(params).then(res=>{
let tips = res.data.tips;
if(tips.isOk){
this.getXmTaskWorkloads();
}else{
this.$notify({showClose:true,message:tips.msg,type:tips.isOk?'success':'error'})
}
})
},
},//end methods
mounted() {
this.$nextTick(() => {

Loading…
Cancel
Save