Browse Source

优化

master
陈裕财 4 years ago
parent
commit
0295d29228
  1. 26
      src/views/xm/core/components/XmProductSelect.vue
  2. 28
      src/views/xm/core/components/XmProjectSelect.vue
  3. 713
      src/views/xm/core/xmIteration/XmIterationMng.vue

26
src/views/xm/core/components/XmProductSelect.vue

@ -20,8 +20,13 @@
icon="el-icon-circle-close"
@click="clearSelect"
title="清空当前选中的产品"
>清除选中</el-button
>&nbsp;&nbsp;
>清除选中&nbsp;&nbsp;</el-button
>
<el-button
@click="addProductVisible = true"
icon="el-icon-plus"
type="text"
>创建产品</el-button>&nbsp;&nbsp;
<el-popover
placement="top-start"
title=""
@ -146,14 +151,6 @@
>
</el-row>
</el-row>
<el-dialog append-to-body :visible.sync="addProductVisible" width="70%">
<xm-product-add
:sel-project="{ id: linkProjectId, name: '' }"
@cancel="addProductVisible = false"
@submit="afterAddSubmit"
>
</xm-product-add>
</el-dialog>
</el-row>
<el-row>
<!--列表 XmProduct 产品表-->
@ -205,6 +202,15 @@
>
</slot>
</el-popover>
<el-dialog append-to-body :visible.sync="addProductVisible" width="70%">
<xm-product-add
:sel-project="{ id: linkProjectId, name: '' }"
@cancel="addProductVisible = false"
@submit="afterAddSubmit"
>
</xm-product-add>
</el-dialog>
</section>
</template>

28
src/views/xm/core/components/XmProjectSelect.vue

@ -20,8 +20,13 @@
icon="el-icon-circle-close"
@click="clearSelect"
title="清空当前选中的项目"
>清除选中</el-button
>&nbsp;&nbsp;
>清除选中&nbsp;&nbsp;</el-button
>
<el-button
@click="addProjectVisible = true"
icon="el-icon-plus"
type="text"
>创建项目</el-button>
<el-popover
placement="top-start"
title=""
@ -148,15 +153,6 @@
>
</el-row>
</el-row>
<el-dialog append-to-body :visible.sync="addProjectVisible" width="70%">
<xm-project-add
:op-type="'add'"
:xm-product="{ id: linkProductId, name: '' }"
@cancel="addProjectVisible = false"
@submit="afterAddSubmit"
>
</xm-project-add>
</el-dialog>
</el-row>
<el-row>
<!--列表 XmProject 项目表-->
@ -220,6 +216,16 @@
ref="usersSelect"
></users-select>
</el-drawer>
<el-dialog append-to-body :visible.sync="addProjectVisible" width="70%" top="20px">
<xm-project-add
:op-type="'add'"
:xm-product="{ id: linkProductId, name: '' }"
@cancel="addProjectVisible = false"
@submit="afterAddSubmit"
>
</xm-project-add>
</el-dialog>
</section>
</template>

713
src/views/xm/core/xmIteration/XmIterationMng.vue

@ -1,27 +1,67 @@
<template>
<section class="padding">
<el-row>
<el-input v-if="filters.queryScope=='iterationId'" v-model="filters.id" style="width:20%;" placeholder="输入迭代编号" @keyup.enter.native="searchXmProducts"> </el-input>
<el-date-picker v-if="filters.queryScope!='iterationId'" v-model="dateRangerOnline" type="daterange" align="right" unlink-panels range-separator=""
start-placeholder="上线日期" end-placeholder="上线日期" value-format="yyyy-MM-dd HH:mm:ss"
<xm-product-select
v-if="!xmProduct || !xmProduct.id"
ref="xmProductSelect1"
style="display: inline"
:auto-select="true"
:link-project-id="selProject ? selProject.id : null"
@row-click="onProductSelected"
@clear="onProductClearSelect"
></xm-product-select>
<el-input
v-if="filters.queryScope == 'iterationId'"
v-model="filters.id"
style="width: 20%"
placeholder="输入迭代编号"
@keyup.enter.native="searchXmProducts"
>
</el-input>
<el-date-picker
v-if="filters.queryScope != 'iterationId'"
v-model="dateRangerOnline"
type="daterange"
align="right"
unlink-panels
range-separator="至"
start-placeholder="上线日期"
end-placeholder="上线日期"
value-format="yyyy-MM-dd HH:mm:ss"
class="hidden-md-and-down"
:default-time="['00:00:00','23:59:59']" :picker-options="pickerOptions">
:default-time="['00:00:00', '23:59:59']"
:picker-options="pickerOptions"
>
</el-date-picker>
<el-input v-model="filters.key" style="width: 15%;" placeholder="模糊查询">
<el-input v-model="filters.key" style="width: 15%" placeholder="模糊查询">
</el-input>
<el-button type="primary" v-loading="load.list" :disabled="load.list==true" v-on:click="searchXmIterations" icon="el-icon-search"></el-button>
<el-popover
placement="top-start"
title=""
width="400"
trigger="click" >
<el-divider content-position="left"><strong>查询条件</strong></el-divider>
<el-button
type="primary"
v-loading="load.list"
:disabled="load.list == true"
v-on:click="searchXmIterations"
icon="el-icon-search"
></el-button>
<el-popover placement="top-start" title="" width="400" trigger="click">
<el-divider content-position="left"
><strong>查询条件</strong></el-divider
>
<el-row>
<el-col :span="24" style="padding-top:5px;">
<el-input v-if="filters.queryScope=='iterationId'" v-model="filters.id" style="width:100%;" placeholder="输入产品编号" @keyup.enter.native="searchXmProducts">
<el-col :span="24" style="padding-top: 5px">
<el-input
v-if="filters.queryScope == 'iterationId'"
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;">
<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"
@ -36,115 +76,272 @@
: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 :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:10px;">
<el-button type="primary" icon="el-icon-search" @click="getXmIterations">查询</el-button>
<el-col :span="24" style="padding-top: 10px">
<el-button
type="primary"
icon="el-icon-search"
@click="getXmIterations"
>查询</el-button
>
</el-col>
</el-row>
<el-button slot="reference" icon="el-icon-more"></el-button>
</el-popover>
<span style="float:right;">
<el-button type="primary" @click="showAdd" icon="el-icon-plus" round>迭代计划</el-button>
<span style="float: right">
<el-button type="primary" @click="showAdd" icon="el-icon-plus" round
>迭代计划</el-button
>
</span>
</el-row>
<el-row>
<!--列表 XmIteration 迭代定义-->
<el-table ref="table" :height="maxTableHeight" v-if="!gstcVisible" :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="selection" aria-disabled width="55"></el-table-column>
<el-table
ref="table"
:height="maxTableHeight"
v-if="!gstcVisible"
: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="selection"
aria-disabled
width="55"
></el-table-column>
<el-table-column prop="iterationName" label="迭代名称" min-width="260">
<template slot-scope="scope">
<el-link type="primary" @click="intoInfo( scope.row,scope.$index)"> {{scope.row.seqNo}} &nbsp;&nbsp;{{scope.row.iterationName}} </el-link>
<el-link type="primary" @click="intoInfo(scope.row, scope.$index)">
{{ scope.row.seqNo }} &nbsp;&nbsp;{{ scope.row.iterationName }}
</el-link>
</template>
</el-table-column>
<el-table-column prop="finishRate" label="总进度" min-width="80">
<template slot-scope="scope">
<font ><el-tag :type="scope.row.finishRate>=100?'success':'warning'">{{scope.row.finishRate}}%</el-tag>
<el-tooltip content="点击统计进度,由任务汇总"><el-button type="text" icon="el-icon-video-play" @click.stop="loadTasksToXmIterationState( scope.row)"></el-button></el-tooltip>
<font
><el-tag
:type="scope.row.finishRate >= 100 ? 'success' : 'warning'"
>{{ scope.row.finishRate }}%</el-tag
>
<el-tooltip content="点击统计进度,由任务汇总"
><el-button
type="text"
icon="el-icon-video-play"
@click.stop="loadTasksToXmIterationState(scope.row)"
></el-button
></el-tooltip>
</font>
</template>
</el-table-column>
<el-table-column prop="startTime" label="开始时间" min-width="80" :formatter="formatterDate" show-overflow-tooltip></el-table-column>
<el-table-column prop="endTime" label="结束时间" min-width="80" :formatter="formatterDate" show-overflow-tooltip></el-table-column>
<el-table-column prop="onlineTime" label="上线时间" min-width="80" :formatter="formatterDate" show-overflow-tooltip></el-table-column>
<el-table-column prop="adminUsername" label="负责人姓名" min-width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="distBudgetWorkload" label="已分配工作量" min-width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="actWorkload" label="实际工作量" min-width="80" show-overflow-tooltip></el-table-column>
<el-table-column
prop="startTime"
label="开始时间"
min-width="80"
:formatter="formatterDate"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="endTime"
label="结束时间"
min-width="80"
:formatter="formatterDate"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="onlineTime"
label="上线时间"
min-width="80"
:formatter="formatterDate"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="adminUsername"
label="负责人姓名"
min-width="80"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="distBudgetWorkload"
label="已分配工作量"
min-width="80"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="actWorkload"
label="实际工作量"
min-width="80"
show-overflow-tooltip
></el-table-column>
<el-table-column label="操作" width="150" fixed="right">
<template slot-scope="scope">
<el-button v-if="menukey=='myFocus'" type="primary" @click.stop="focusOrUnfocus(scope.row)" >取消关注</el-button>
<el-button v-else type="text" @click.stop="focusOrUnfocus(scope.row)" >关注</el-button>
<el-button type="danger" @click="handleDel(scope.row,scope.$index)" icon="el-icon-delete"></el-button>
<el-button
v-if="menukey == 'myFocus'"
type="primary"
@click.stop="focusOrUnfocus(scope.row)"
>取消关注</el-button
>
<el-button
v-else
type="text"
@click.stop="focusOrUnfocus(scope.row)"
>关注</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 v-if="!gstcVisible" 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>
<xm-gantt v-if="gstcVisible" :tree-data="xmIterationTreeData" :project-phase="{startTime: '2020-06-01', endTime: '2020-12-30'}" :columns="ganrrColumns" :useRealTime="false"></xm-gantt>
<el-pagination
v-if="!gstcVisible"
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>
<xm-gantt
v-if="gstcVisible"
:tree-data="xmIterationTreeData"
:project-phase="{ startTime: '2020-06-01', endTime: '2020-12-30' }"
:columns="ganrrColumns"
:useRealTime="false"
></xm-gantt>
<!--编辑 XmIteration 迭代定义界面-->
<el-drawer title="编辑迭代定义" :visible.sync="editFormVisible" size="50%" append-to-body :close-on-click-modal="false">
<xm-iteration-edit :xm-iteration="editForm" :visible="editFormVisible" @cancel="editFormVisible=false" @submit="afterEditSubmit"></xm-iteration-edit>
<el-drawer
title="编辑迭代定义"
:visible.sync="editFormVisible"
size="50%"
append-to-body
:close-on-click-modal="false"
>
<xm-iteration-edit
:xm-iteration="editForm"
:visible="editFormVisible"
@cancel="editFormVisible = false"
@submit="afterEditSubmit"
></xm-iteration-edit>
</el-drawer>
<!--新增 XmIteration 迭代定义界面-->
<el-drawer title="新增迭代定义" :visible.sync="addFormVisible" size="50%" append-to-body :close-on-click-modal="false">
<xm-iteration-add :xm-product="xmProduct" :sel-project="selProject" :xm-iteration="addForm" :parent-iteration="parentIteration" :visible="addFormVisible" @cancel="addFormVisible=false" @submit="afterAddSubmit"></xm-iteration-add>
<el-drawer
title="新增迭代定义"
:visible.sync="addFormVisible"
size="50%"
append-to-body
:close-on-click-modal="false"
>
<xm-iteration-add
:xm-product="xmProduct"
:sel-project="selProject"
:xm-iteration="addForm"
:parent-iteration="parentIteration"
:visible="addFormVisible"
@cancel="addFormVisible = false"
@submit="afterAddSubmit"
></xm-iteration-add>
</el-drawer>
<!--新增 XmIteration 迭代定义界面-->
<el-drawer title="迭代报告" :visible.sync="iterationStateVisible" fullscreen append-to-body :close-on-click-modal="false">
<xm-iteration-state-mng :xm-iteration="editForm" :visible="iterationStateVisible" @cancel="iterationStateVisible=false"></xm-iteration-state-mng>
<el-drawer
title="迭代报告"
:visible.sync="iterationStateVisible"
fullscreen
append-to-body
:close-on-click-modal="false"
>
<xm-iteration-state-mng
:xm-iteration="editForm"
:visible="iterationStateVisible"
@cancel="iterationStateVisible = false"
></xm-iteration-state-mng>
</el-drawer>
<el-drawer title="迭代报告" :visible.sync="iterationSelectVisible" fullscreen append-to-body :close-on-click-modal="false">
<xm-iteration-select @row-click="onXmIterationSelect"></xm-iteration-select>
<el-drawer
title="迭代报告"
:visible.sync="iterationSelectVisible"
fullscreen
append-to-body
:close-on-click-modal="false"
>
<xm-iteration-select
@row-click="onXmIterationSelect"
></xm-iteration-select>
</el-drawer>
</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 { addXmIterationLink,delXmIterationLink } from '@/api/xm/core/xmIterationLink';
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 {
addXmIterationLink,
delXmIterationLink,
} from "@/api/xm/core/xmIterationLink";
import XmIterationAdd from './XmIterationAdd';//
import XmIterationEdit from './XmIterationEdit';//
import XmIterationStateMng from '../xmIterationState/XmIterationStateMng';//
import XmGantt from '../components/xm-gantt';
import XmIterationAdd from "./XmIterationAdd"; //
import XmIterationEdit from "./XmIterationEdit"; //
import XmIterationStateMng from "../xmIterationState/XmIterationStateMng"; //
import XmGantt from "../components/xm-gantt";
import { mapGetters } from 'vuex'
import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect.vue';
import { addUserFocus , delUserFocus } from '@/api/mdp/sys/userFocus';
import { mapGetters } from "vuex";
import XmIterationSelect from "@/views/xm/core/components/XmIterationSelect.vue";
import XmProductSelect from "@/views/xm/core/components/XmProductSelect.vue";
import { addUserFocus, delUserFocus } from "@/api/mdp/sys/userFocus";
export default {
computed: {
...mapGetters([
'userInfo','roles'
]),
...mapGetters(["userInfo", "roles"]),
xmIterationTreeData() {
return this.xmIterations
return this.xmIterations;
},
},
props:['xmProduct','selProject','menuId','visible'],
props: ["xmProduct", "selProject", "menuId", "visible"],
watch: {
visible: function (visible) {
this.filters.xmProduct=this.xmProduct
if (visible == true) {
this.getXmIterations();
}
},
xmProduct: function () {
this.filters.xmProduct=this.xmProduct
this.getXmIterations();
},
selProject: function () {
this.getXmIterations();
}
},
},
data() {
const beginDate = new Date();
@ -153,22 +350,22 @@ import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect.vue'
endDate.setTime(endDate.getTime() + 3600 * 1000 * 24 * 7 * 4 * 12);
return {
filters: {
key: '',
queryScope:'',// iterationId\branchId\compete\''
id:'',//
key: "",
queryScope: "", // iterationId\branchId\compete\''
id: "", //
},
pickerOptions: util.getPickerOptions('datarange'),
pickerOptions: util.getPickerOptions("datarange"),
dateRanger: [], //
dateRangerOnline: [
],//线
dateRangerOnline: [], //线
xmIterations: [], //
pageInfo:{//
pageInfo: {
//
total: 0, //0>0
pageSize: 10, //
count: false, //
pageNum: 1, //1
orderFields: [], // ['sex','student_id']
orderDirs:[]// asc,desc ['asc','desc']
orderDirs: [], // asc,desc ['asc','desc']
},
load: { list: false, edit: false, del: false, add: false }, //...
sels: [], //
@ -179,16 +376,73 @@ import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect.vue'
addFormVisible: false, //xmIteration
//xmIteration
addForm: {
id:'',branchId:'',iterationName:'',startTime:'',endTime:'',onlineTime:'',pid:'',adminUserid:'',adminUsername:'',ctime:'',budgetCost:'',budgetWorkload:'',seqNo:'',istatus:'',cuserid:'',cusername:'',remark:'',iphase:'',isTpl:'',productId:''
id: "",
branchId: "",
iterationName: "",
startTime: "",
endTime: "",
onlineTime: "",
pid: "",
adminUserid: "",
adminUsername: "",
ctime: "",
budgetCost: "",
budgetWorkload: "",
seqNo: "",
istatus: "",
cuserid: "",
cusername: "",
remark: "",
iphase: "",
isTpl: "",
productId: "",
},
editFormVisible: false, //
//xmIteration
editForm: {
id:'',branchId:'',iterationName:'',startTime:'',endTime:'',onlineTime:'',pid:'',adminUserid:'',adminUsername:'',ctime:'',budgetCost:'',budgetWorkload:'',seqNo:'',istatus:'',cuserid:'',cusername:'',remark:'',iphase:'',isTpl:'',productId:''
id: "",
branchId: "",
iterationName: "",
startTime: "",
endTime: "",
onlineTime: "",
pid: "",
adminUserid: "",
adminUsername: "",
ctime: "",
budgetCost: "",
budgetWorkload: "",
seqNo: "",
istatus: "",
cuserid: "",
cusername: "",
remark: "",
iphase: "",
isTpl: "",
productId: "",
},
editFormInit: {
id:'',branchId:'',iterationName:'',startTime:'',endTime:'',onlineTime:'',pid:'',adminUserid:'',adminUsername:'',ctime:'',budgetCost:'',budgetWorkload:'',seqNo:'',istatus:'',cuserid:'',cusername:'',remark:'',iphase:'',isTpl:'',productId:''
id: "",
branchId: "",
iterationName: "",
startTime: "",
endTime: "",
onlineTime: "",
pid: "",
adminUserid: "",
adminUsername: "",
ctime: "",
budgetCost: "",
budgetWorkload: "",
seqNo: "",
istatus: "",
cuserid: "",
cusername: "",
remark: "",
iphase: "",
isTpl: "",
productId: "",
},
/**begin 自定义属性请在下面加 请加备注**/
@ -199,16 +453,16 @@ import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect.vue'
gstcVisible: false,
maxTableHeight: 300,
ganrrColumns: {
children: 'children',
name: 'iterationName',
id: 'id',
pid: 'pid',
startDate: 'startTime',
endDate: 'endTime',
},
menukey:'unFocus',
children: "children",
name: "iterationName",
id: "id",
pid: "pid",
startDate: "startTime",
endDate: "endTime",
},
menukey: "unFocus",
/**end 自定义属性请在上面加 请加备注**/
}
};
}, //end data
methods: {
handleSizeChange(pageSize) {
@ -221,14 +475,14 @@ import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect.vue'
},
// obj.order=ascending/descending, asc/desc ; obj.prop=,
sortChange(obj) {
var dir='asc';
if(obj.order=='ascending'){
dir='asc'
var dir = "asc";
if (obj.order == "ascending") {
dir = "asc";
} else {
dir='desc';
dir = "desc";
}
if(obj.prop=='xxx'){
this.pageInfo.orderFields=['xxx'];
if (obj.prop == "xxx") {
this.pageInfo.orderFields = ["xxx"];
this.pageInfo.orderDirs = [dir];
}
this.getXmIterations();
@ -243,59 +497,79 @@ import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect.vue'
pageSize: this.pageInfo.pageSize,
pageNum: this.pageInfo.pageNum,
total: this.pageInfo.total,
count:this.pageInfo.count
count: this.pageInfo.count,
};
if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){
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])
orderBys.push(
this.pageInfo.orderFields[i] + " " + this.pageInfo.orderDirs[i]
);
}
params.orderBy= orderBys.join(",")
params.orderBy = orderBys.join(",");
}
if (this.filters.key) {
params.key= "%"+this.filters.key+"%"
params.key = "%" + this.filters.key + "%";
}
if(this.xmProduct){
params.productId=this.xmProduct.id
if (this.filters.xmProduct) {
params.productId = this.filters.xmProduct.id;
}
if (this.selProject) {
params.linkProjectId=this.selProject.id
params.linkProjectId = this.selProject.id;
}
if (this.menuId) {
params.menuId=this.menuId
params.menuId = this.menuId;
}
if( !this.menuId && !this.xmProduct && !this.selProject){
params.queryScope=this.filters.queryScope
if(this.filters.queryScope=='iterationId'){
if (!this.menuId && !this.filters.xmProduct && !this.selProject) {
params.queryScope = this.filters.queryScope;
if (this.filters.queryScope == "iterationId") {
if (!this.filters.id) {
this.$notify({position:'bottom-left',showClose:true,message:"您选择了按迭代编号精确查找模式,请输入迭代编号", type: 'error' });
this.$notify({
position: "bottom-left",
showClose: true,
message: "您选择了按迭代编号精确查找模式,请输入迭代编号",
type: "error",
});
return;
}
params.id=this.filters.id
params.id = this.filters.id;
}
if (this.filters.queryScope == "branchId") {
params.branchId=this.userInfo.branchId
params.branchId = this.userInfo.branchId;
}
}
if(this.filters.queryScope!="iterationId" && this.dateRangerOnline && this.dateRangerOnline.length==2){
params.onlineTimeStart=this.dateRangerOnline[0]
params.onlineTimeEnd=this.dateRangerOnline[1]
if (
this.filters.queryScope != "iterationId" &&
this.dateRangerOnline &&
this.dateRangerOnline.length == 2
) {
params.onlineTimeStart = this.dateRangerOnline[0];
params.onlineTimeEnd = this.dateRangerOnline[1];
}
this.load.list = true;
listXmIterationWithState(params).then((res) => {
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;
} else {
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: 'error' });
this.$notify({
position: "bottom-left",
showClose: true,
message: tips.msg,
type: "error",
});
}
this.load.list = false;
}).catch( err => this.load.list = false );
})
.catch((err) => (this.load.list = false));
},
// XmIteration
@ -305,16 +579,21 @@ import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect.vue'
},
// XmIteration
showAdd: function () {
if(!this.roles.some(i=>i.roleid=='iterationAdmin')){
this.$notify({position:'bottom-left',showClose:true,message: "只有迭代管理员可以新增迭代", type: 'error' });
if (!this.roles.some((i) => i.roleid == "iterationAdmin")) {
this.$notify({
position: "bottom-left",
showClose: true,
message: "只有迭代管理员可以新增迭代",
type: "error",
});
return;
}
this.parentIteration=null
this.parentIteration = null;
this.addFormVisible = true;
//this.addForm=Object.assign({}, this.editForm);
},
showSubAdd: function (row) {
this.parentIteration=row
this.parentIteration = row;
this.addFormVisible = true;
//this.addForm=Object.assign({}, this.editForm);
},
@ -330,8 +609,11 @@ import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect.vue'
//info
intoInfo(row) {
this.editForm = row;
localStorage.setItem("xm-iteration-info-route",JSON.stringify(row))
this.$router.push({ name:'XmIterationInfoRoute', query: {id:row.id} })
localStorage.setItem("xm-iteration-info-route", JSON.stringify(row));
this.$router.push({
name: "XmIterationInfoRoute",
query: { id: row.id },
});
//this.showInfo = true;
},
//xmIteration
@ -340,78 +622,105 @@ import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect.vue'
},
//xmIteration
handleDel: function (row, index) {
if(!this.roles.some(i=>i.roleid=='iterationAdmin')){
this.$notify({position:'bottom-left',showClose:true,message: "只有迭代管理员可以删除迭代", type: 'error' });
if (!this.roles.some((i) => i.roleid == "iterationAdmin")) {
this.$notify({
position: "bottom-left",
showClose: true,
message: "只有迭代管理员可以删除迭代",
type: "error",
});
return;
}
this.$confirm('确认删除该记录吗?', '提示', {
type: 'warning'
this.$confirm("确认删除该记录吗?", "提示", {
type: "warning",
}).then(() => {
this.load.del = true;
let params = { id: row.id };
delXmIteration(params).then((res) => {
delXmIteration(params)
.then((res) => {
this.load.del = false;
var tips = res.data.tips;
if (tips.isOk) {
this.pageInfo.count = true;
this.getXmIterations();
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.del=false );
this.$notify({
position: "bottom-left",
showClose: true,
message: tips.msg,
type: tips.isOk ? "success" : "error",
});
})
.catch((err) => (this.load.del = false));
});
},
//xmIteration
batchDel: function () {
if(!this.roles.some(i=>i.roleid=='iterationAdmin')){
this.$notify({position:'bottom-left',showClose:true,message: "只有迭代管理员可以删除迭代", type: 'error' });
if (!this.roles.some((i) => i.roleid == "iterationAdmin")) {
this.$notify({
position: "bottom-left",
showClose: true,
message: "只有迭代管理员可以删除迭代",
type: "error",
});
return;
}
this.$confirm('确认删除选中记录吗?', '提示', {
type: 'warning'
this.$confirm("确认删除选中记录吗?", "提示", {
type: "warning",
}).then(() => {
this.load.del = true;
batchDelXmIteration(this.sels).then((res) => {
batchDelXmIteration(this.sels)
.then((res) => {
this.load.del = false;
var tips = res.data.tips;
if (tips.isOk) {
this.pageInfo.count = true;
this.getXmIterations();
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error'});
}).catch( err => this.load.del=false );
this.$notify({
position: "bottom-left",
showClose: true,
message: tips.msg,
type: tips.isOk ? "success" : "error",
});
})
.catch((err) => (this.load.del = false));
});
},
rowClick: function (row, event, column) {
this.editForm=row
this.$emit('row-click',row, event, column);// @row-click="rowClick"
this.editForm = row;
this.$emit("row-click", row, event, column); // @row-click="rowClick"
},
clearSelectIteration() {
this.editForm=this.editFormInit
this.$emit('clear-select',null );// @row-click="rowClick"
this.editForm = this.editFormInit;
this.$emit("clear-select", null); // @row-click="rowClick"
},
fieldChange: function (row, fieldName) {
if(this.valueChangeRows.some(i=>i.id==row.id)){
if (this.valueChangeRows.some((i) => i.id == row.id)) {
return;
} else {
this.valueChangeRows.push(row)
this.valueChangeRows.push(row);
}
},
loadTasksToXmIterationState(row) {
this.load.edit = true;
loadTasksToXmIterationState({id:row.id}).then(res=>{
loadTasksToXmIterationState({ id: row.id }).then((res) => {
this.load.edit = false;
var tips = res.data.tips;
if (tips.isOk) {
this.getXmIterations();
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error'});
this.$notify({
position: "bottom-left",
showClose: true,
message: tips.msg,
type: tips.isOk ? "success" : "error",
});
});
},
showIterationState(row) {
this.editForm=row
this.editForm = row;
this.iterationStateVisible = true;
},
formatterDate(row, column, cellValue, index) {
@ -424,60 +733,123 @@ import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect.vue'
onXmIterationSelect: function (row) {
var xmIteration = row;
var xmProduct = this.xmProduct;
this.$confirm('确认将产品【'+xmProduct.productName+'】加入迭代计划【'+xmIteration.iterationName+'】吗?', '提示', {
type: 'warning'
}).then(()=>{
addXmIterationLink({iterationId:xmIteration.id,productId:xmProduct.id}).then(res=>{
this.$confirm(
"确认将产品【" +
xmProduct.productName +
"】加入迭代计划【" +
xmIteration.iterationName +
"】吗?",
"提示",
{
type: "warning",
}
).then(() => {
addXmIterationLink({
iterationId: xmIteration.id,
productId: xmProduct.id,
}).then((res) => {
var tips = res.data.tips;
if (tips.isOk) {
this.getXmIterations();
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error'});
})
})
this.$notify({
position: "bottom-left",
showClose: true,
message: tips.msg,
type: tips.isOk ? "success" : "error",
});
});
});
},
doDelXmIterationLink(row) {
var xmIteration = row;
var xmProduct = this.xmProduct;
this.$confirm('确认将产品【'+xmProduct.productName+'】与迭代【'+xmIteration.iterationName+'】进行脱钩吗?脱钩后,产品与迭代互相查看不到对方信息。', '提示', {
type: 'warning'
}).then(()=>{
delXmIterationLink({iterationId:xmIteration.id,productId:xmProduct.id}).then(res=>{
this.$confirm(
"确认将产品【" +
xmProduct.productName +
"】与迭代【" +
xmIteration.iterationName +
"】进行脱钩吗?脱钩后,产品与迭代互相查看不到对方信息。",
"提示",
{
type: "warning",
}
).then(() => {
delXmIterationLink({
iterationId: xmIteration.id,
productId: xmProduct.id,
}).then((res) => {
var tips = res.data.tips;
if (tips.isOk) {
this.getXmIterations();
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error'});
})
})
this.$notify({
position: "bottom-left",
showClose: true,
message: tips.msg,
type: tips.isOk ? "success" : "error",
});
});
});
},
focusOrUnfocus: function (row) {
if (this.menukey == "myFocus") {
delUserFocus({pbizId:row.productId,focusType:'6',bizId:row.id,bizName:row.iterationName}).then(res=>{
delUserFocus({
pbizId: row.productId,
focusType: "6",
bizId: row.id,
bizName: row.iterationName,
}).then((res) => {
var tips = res.data.tips;
if (tips.isOk) {
this.getXmIterations();
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' });
})
this.$notify({
position: "bottom-left",
showClose: true,
message: tips.msg,
type: tips.isOk ? "success" : "error",
});
});
} else {
addUserFocus({pbizId:row.productId,focusType:'6',bizId:row.id,bizName:row.iterationName}).then(res=>{
addUserFocus({
pbizId: row.productId,
focusType: "6",
bizId: row.id,
bizName: row.iterationName,
}).then((res) => {
var tips = res.data.tips;
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' });
})
this.$notify({
position: "bottom-left",
showClose: true,
message: tips.msg,
type: tips.isOk ? "success" : "error",
});
});
}
},
onProductSelected(row){
this.filters.xmProduct=row
this.searchXmIterations()
},
onProductClearSelect(){
this.filters.xmProduct=null;
this.searchXmIterations()
}
}, //end methods
components: {
'xm-iteration-add':XmIterationAdd,
'xm-iteration-edit':XmIterationEdit,
XmIterationStateMng,XmGantt,
"xm-iteration-add": XmIterationAdd,
"xm-iteration-edit": XmIterationEdit,
XmIterationStateMng,
XmGantt,
XmIterationSelect,
XmProductSelect,
//
},
mounted() {
this.$nextTick(() => {
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el);
this.filters.xmProduct=this.xmProduct
this.getXmIterations();
});
// console.log(this.dateRanger,this.dateRangerOnline);
@ -488,9 +860,8 @@ import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect.vue'
}
});
**/
}
}
},
};
</script>
<style scoped>

Loading…
Cancel
Save