|
|
@ -4,24 +4,44 @@ |
|
|
placement="bottom" |
|
|
placement="bottom" |
|
|
width="400" |
|
|
width="400" |
|
|
trigger="manual" |
|
|
trigger="manual" |
|
|
v-model="productVisible"> |
|
|
|
|
|
|
|
|
v-model="productVisible" |
|
|
|
|
|
> |
|
|
<el-row> |
|
|
<el-row> |
|
|
<el-button type="text" icon="el-icon-refresh" @click="refreshSelect" title="重新从后台刷新数据回来">刷新</el-button> |
|
|
|
|
|
<el-button v-if="editForm && editForm.id" type="text" icon="el-icon-circle-close" @click="clearSelect" title="清空当前选中的产品">清除选中</el-button> |
|
|
|
|
|
|
|
|
<el-button |
|
|
|
|
|
type="text" |
|
|
|
|
|
icon="el-icon-refresh" |
|
|
|
|
|
@click="refreshSelect" |
|
|
|
|
|
title="重新从后台刷新数据回来" |
|
|
|
|
|
>刷新</el-button |
|
|
|
|
|
> |
|
|
|
|
|
<el-button |
|
|
|
|
|
v-if="editForm && editForm.id" |
|
|
|
|
|
type="text" |
|
|
|
|
|
icon="el-icon-circle-close" |
|
|
|
|
|
@click="clearSelect" |
|
|
|
|
|
title="清空当前选中的产品" |
|
|
|
|
|
>清除选中</el-button |
|
|
|
|
|
> |
|
|
<el-popover |
|
|
<el-popover |
|
|
placement="top-start" |
|
|
placement="top-start" |
|
|
title="" |
|
|
title="" |
|
|
width="400" |
|
|
width="400" |
|
|
v-model="moreVisible" |
|
|
v-model="moreVisible" |
|
|
trigger="manual" > |
|
|
|
|
|
|
|
|
trigger="manual" |
|
|
|
|
|
> |
|
|
<el-row> |
|
|
<el-row> |
|
|
<el-col :span="24" style="padding-top:5px;"> |
|
|
|
|
|
|
|
|
<el-col :span="24" style="padding-top: 5px"> |
|
|
<font class="more-label-font">产品编号:</font> |
|
|
<font class="more-label-font">产品编号:</font> |
|
|
<el-input v-model="filters.id" style="width:100%;" placeholder="输入产品编号" @keyup.enter.native="searchXmProducts"> |
|
|
|
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="filters.id" |
|
|
|
|
|
style="width: 100%" |
|
|
|
|
|
placeholder="输入产品编号" |
|
|
|
|
|
@keyup.enter.native="searchXmProducts" |
|
|
|
|
|
> |
|
|
</el-input> |
|
|
</el-input> |
|
|
</el-col> |
|
|
</el-col> |
|
|
|
|
|
|
|
|
<el-col :span="24" style="padding-top:5px;"> |
|
|
|
|
|
|
|
|
<el-col :span="24" style="padding-top: 5px"> |
|
|
<font class="more-label-font">创建时间:</font> |
|
|
<font class="more-label-font">创建时间:</font> |
|
|
<el-date-picker |
|
|
<el-date-picker |
|
|
v-model="dateRanger" |
|
|
v-model="dateRanger" |
|
|
@ -37,81 +57,171 @@ |
|
|
></el-date-picker> |
|
|
></el-date-picker> |
|
|
</el-col> |
|
|
</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-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-input> |
|
|
</el-col> |
|
|
</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-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-button @click="setFiltersPmUserAsMySelf()">我的</el-button> |
|
|
</el-col> |
|
|
</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 :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-col> |
|
|
</el-row> |
|
|
</el-row> |
|
|
<el-button type="text" slot="reference" @click="moreVisible=!moreVisible">更多条件</el-button> |
|
|
|
|
|
|
|
|
<el-button |
|
|
|
|
|
type="text" |
|
|
|
|
|
slot="reference" |
|
|
|
|
|
@click="moreVisible = !moreVisible" |
|
|
|
|
|
>更多条件</el-button |
|
|
|
|
|
> |
|
|
</el-popover> |
|
|
</el-popover> |
|
|
<el-button style="float:right;" type="text" @click="close" icon="el-icon-close" title="关闭当前窗口">关闭</el-button> |
|
|
|
|
|
|
|
|
<el-button |
|
|
|
|
|
style="float: right" |
|
|
|
|
|
type="text" |
|
|
|
|
|
@click="close" |
|
|
|
|
|
icon="el-icon-close" |
|
|
|
|
|
title="关闭当前窗口" |
|
|
|
|
|
>关闭</el-button |
|
|
|
|
|
> |
|
|
</el-row> |
|
|
</el-row> |
|
|
<el-row v-if="load.list==false && (!xmProducts ||xmProducts.length==0)"> |
|
|
|
|
|
|
|
|
<el-row |
|
|
|
|
|
v-if="load.list == false && (!xmProducts || xmProducts.length == 0)" |
|
|
|
|
|
> |
|
|
<el-row v-if="linkProjectId"> |
|
|
<el-row v-if="linkProjectId"> |
|
|
<el-row>没有查到与项目【{{linkProjectId}}】关联的产品,您可以尝试 |
|
|
|
|
|
<el-button type="text" icon="el-icon-refresh" @click="refreshSelect" title="重新从后台刷新数据回来">刷新</el-button> |
|
|
|
|
|
重新从后台加载,或者<el-button @click="addProductVisible=true" icon="el-icon-plus" type="text">创建产品</el-button> ,并自动关联项目【{{linkProjectId}}】,或者到【项目->关联产品->加入更多产品到项目】手动关联一个已存在的产品。 |
|
|
|
|
|
|
|
|
<el-row |
|
|
|
|
|
>没有查到与项目【{{ |
|
|
|
|
|
linkProjectId |
|
|
|
|
|
}}】关联的产品,您可以尝试 |
|
|
|
|
|
<el-button |
|
|
|
|
|
type="text" |
|
|
|
|
|
icon="el-icon-refresh" |
|
|
|
|
|
@click="refreshSelect" |
|
|
|
|
|
title="重新从后台刷新数据回来" |
|
|
|
|
|
>刷新</el-button |
|
|
|
|
|
> 重新从后台加载,或者<el-button |
|
|
|
|
|
@click="addProductVisible = true" |
|
|
|
|
|
icon="el-icon-plus" |
|
|
|
|
|
type="text" |
|
|
|
|
|
>创建产品</el-button |
|
|
|
|
|
> |
|
|
|
|
|
,并自动关联项目【{{ |
|
|
|
|
|
linkProjectId |
|
|
|
|
|
}}】,或者到【项目->关联产品->加入更多产品到项目】手动关联一个已存在的产品。 |
|
|
</el-row> |
|
|
</el-row> |
|
|
</el-row> |
|
|
</el-row> |
|
|
<el-row v-else> |
|
|
<el-row v-else> |
|
|
<el-row>没有查到相关产品,您可以尝试 |
|
|
|
|
|
<el-button type="text" icon="el-icon-refresh" @click="refreshSelect" title="重新从后台刷新数据回来">刷新</el-button> |
|
|
|
|
|
重新从后台加载,或者<el-button @click="addProductVisible=true" icon="el-icon-plus" type="text">创建产品</el-button> |
|
|
|
|
|
|
|
|
<el-row |
|
|
|
|
|
>没有查到相关产品,您可以尝试 |
|
|
|
|
|
<el-button |
|
|
|
|
|
type="text" |
|
|
|
|
|
icon="el-icon-refresh" |
|
|
|
|
|
@click="refreshSelect" |
|
|
|
|
|
title="重新从后台刷新数据回来" |
|
|
|
|
|
>刷新</el-button |
|
|
|
|
|
> 重新从后台加载,或者<el-button |
|
|
|
|
|
@click="addProductVisible = true" |
|
|
|
|
|
icon="el-icon-plus" |
|
|
|
|
|
type="text" |
|
|
|
|
|
>创建产品</el-button |
|
|
|
|
|
> |
|
|
</el-row> |
|
|
</el-row> |
|
|
</el-row> |
|
|
</el-row> |
|
|
<el-dialog append-to-body :visible.sync="addProductVisible" width="70%"> |
|
|
<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> |
|
|
|
|
|
|
|
|
<xm-product-add |
|
|
|
|
|
:sel-project="{ id: linkProjectId, name: '' }" |
|
|
|
|
|
@cancel="addProductVisible = false" |
|
|
|
|
|
@submit="afterAddSubmit" |
|
|
|
|
|
> |
|
|
|
|
|
</xm-product-add> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
</el-row> |
|
|
</el-row> |
|
|
<el-row> |
|
|
<el-row> |
|
|
<!--列表 XmProduct 产品表--> |
|
|
<!--列表 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 |
|
|
|
|
|
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="产品名称"> |
|
|
<el-table-column prop="productName" label="产品名称"> |
|
|
<template slot="header" slot-scope="scope"> |
|
|
|
|
|
产品名称 |
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
<template slot="header" slot-scope="scope"> 产品名称 </template> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<font>{{ scope.row.productName }}</font> |
|
|
<font>{{ scope.row.productName }}</font> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
</el-table> |
|
|
</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-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-row> |
|
|
<slot name="reference"><el-link title="产品,点击选择、清除选择" @click="referenceClick" type="warning" slot="reference" v-loading="load.list" icon="el-icon-search"><font style="font-size:14px;"><slot name="title">{{editForm && editForm.id?editForm.productName:'选择产品'}}</slot></font></el-link> </slot> |
|
|
|
|
|
|
|
|
<slot name="reference" |
|
|
|
|
|
><el-link |
|
|
|
|
|
title="产品,点击选择、清除选择" |
|
|
|
|
|
@click="referenceClick" |
|
|
|
|
|
type="warning" |
|
|
|
|
|
slot="reference" |
|
|
|
|
|
v-loading="load.list" |
|
|
|
|
|
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-popover> |
|
|
</section> |
|
|
</section> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import util from '@/common/js/util';//全局公共库 |
|
|
|
|
|
|
|
|
import util from "@/common/js/util"; //全局公共库 |
|
|
//import Sticky from '@/components/Sticky' // 粘性header组件 |
|
|
//import Sticky from '@/components/Sticky' // 粘性header组件 |
|
|
//import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询 |
|
|
//import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询 |
|
|
import { listXmProductWithState } from '@/api/xm/core/xmProduct'; |
|
|
|
|
|
import { mapGetters } from 'vuex' |
|
|
|
|
|
|
|
|
import { listXmProductWithState } from "@/api/xm/core/xmProduct"; |
|
|
|
|
|
import { mapGetters } from "vuex"; |
|
|
import UsersSelect from "@/views/mdp/sys/user/UsersSelect"; |
|
|
import UsersSelect from "@/views/mdp/sys/user/UsersSelect"; |
|
|
import XmProductAdd from '../xmProduct/XmProductAdd.vue'; |
|
|
|
|
|
|
|
|
import XmProductAdd from "../xmProduct/XmProductAdd.vue"; |
|
|
const map = new Map(); |
|
|
const map = new Map(); |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
props:['dialog','linkProjectId','iterationId','autoSelect'], |
|
|
|
|
|
|
|
|
props: ["dialog", "linkProjectId", "iterationId", "autoSelect"], |
|
|
computed: { |
|
|
computed: { |
|
|
...mapGetters([ |
|
|
|
|
|
'userInfo','roles' |
|
|
|
|
|
]) |
|
|
|
|
|
|
|
|
...mapGetters(["userInfo", "roles"]), |
|
|
}, |
|
|
}, |
|
|
watch: { |
|
|
watch: { |
|
|
iterationId() { |
|
|
iterationId() { |
|
|
@ -120,7 +230,7 @@ |
|
|
|
|
|
|
|
|
linkProjectId() { |
|
|
linkProjectId() { |
|
|
this.initData(); |
|
|
this.initData(); |
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
const beginDate = new Date(); |
|
|
const beginDate = new Date(); |
|
|
@ -128,19 +238,19 @@ |
|
|
beginDate.setTime(beginDate.getTime() - 3600 * 1000 * 24 * 7 * 4 * 12); |
|
|
beginDate.setTime(beginDate.getTime() - 3600 * 1000 * 24 * 7 * 4 * 12); |
|
|
return { |
|
|
return { |
|
|
filters: { |
|
|
filters: { |
|
|
key: '', |
|
|
|
|
|
id:'',//产品编号 |
|
|
|
|
|
|
|
|
key: "", |
|
|
|
|
|
id: "", //产品编号 |
|
|
pmUser: null, //产品经理 |
|
|
pmUser: null, //产品经理 |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
xmProducts: [], //查询结果 |
|
|
xmProducts: [], //查询结果 |
|
|
pageInfo:{//分页数据 |
|
|
|
|
|
|
|
|
pageInfo: { |
|
|
|
|
|
//分页数据 |
|
|
total: 0, //服务器端收到0时,会自动计算总记录数,如果上传>0的不自动计算。 |
|
|
total: 0, //服务器端收到0时,会自动计算总记录数,如果上传>0的不自动计算。 |
|
|
pageSize: 10, //每页数据 |
|
|
pageSize: 10, //每页数据 |
|
|
count: false, //是否需要重新计算总记录数 |
|
|
count: false, //是否需要重新计算总记录数 |
|
|
pageNum: 1, //当前页码、从1开始计算 |
|
|
pageNum: 1, //当前页码、从1开始计算 |
|
|
orderFields: [], //排序列 如 ['sex','student_id'],必须为数据库字段 |
|
|
orderFields: [], //排序列 如 ['sex','student_id'],必须为数据库字段 |
|
|
orderDirs:[]//升序 asc,降序desc 如 性别 升序、学生编号降序 ['asc','desc'] |
|
|
|
|
|
|
|
|
orderDirs: [], //升序 asc,降序desc 如 性别 升序、学生编号降序 ['asc','desc'] |
|
|
}, |
|
|
}, |
|
|
load: { list: false, edit: false, del: false, add: false }, //查询中... |
|
|
load: { list: false, edit: false, del: false, add: false }, //查询中... |
|
|
sels: [], //列表选中数据 |
|
|
sels: [], //列表选中数据 |
|
|
@ -148,17 +258,23 @@ |
|
|
|
|
|
|
|
|
//新增xmProduct界面初始化数据 |
|
|
//新增xmProduct界面初始化数据 |
|
|
addForm: { |
|
|
addForm: { |
|
|
id:'',productName:'',branchId:'',remark:'' |
|
|
|
|
|
|
|
|
id: "", |
|
|
|
|
|
productName: "", |
|
|
|
|
|
branchId: "", |
|
|
|
|
|
remark: "", |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
//编辑xmProduct界面初始化数据 |
|
|
//编辑xmProduct界面初始化数据 |
|
|
editForm: { |
|
|
editForm: { |
|
|
id:'',productName:'',branchId:'',remark:'' |
|
|
|
|
|
|
|
|
id: "", |
|
|
|
|
|
productName: "", |
|
|
|
|
|
branchId: "", |
|
|
|
|
|
remark: "", |
|
|
}, |
|
|
}, |
|
|
selectFiltersPmUserVisible: false, |
|
|
selectFiltersPmUserVisible: false, |
|
|
maxTableHeight: 300, |
|
|
maxTableHeight: 300, |
|
|
dateRanger: [], |
|
|
dateRanger: [], |
|
|
pickerOptions: util.getPickerOptions('datarange'), |
|
|
|
|
|
|
|
|
pickerOptions: util.getPickerOptions("datarange"), |
|
|
productVisible: false, |
|
|
productVisible: false, |
|
|
moreVisible: false, |
|
|
moreVisible: false, |
|
|
hadInit: false, |
|
|
hadInit: false, |
|
|
@ -166,7 +282,7 @@ |
|
|
/**begin 自定义属性请在下面加 请加备注**/ |
|
|
/**begin 自定义属性请在下面加 请加备注**/ |
|
|
|
|
|
|
|
|
/**end 自定义属性请在上面加 请加备注**/ |
|
|
/**end 自定义属性请在上面加 请加备注**/ |
|
|
} |
|
|
|
|
|
|
|
|
}; |
|
|
}, //end data |
|
|
}, //end data |
|
|
methods: { |
|
|
methods: { |
|
|
handleSizeChange(pageSize) { |
|
|
handleSizeChange(pageSize) { |
|
|
@ -179,14 +295,14 @@ |
|
|
}, |
|
|
}, |
|
|
// 表格排序 obj.order=ascending/descending,需转化为 asc/desc ; obj.prop=表格中的排序字段,字段驼峰命名 |
|
|
// 表格排序 obj.order=ascending/descending,需转化为 asc/desc ; obj.prop=表格中的排序字段,字段驼峰命名 |
|
|
sortChange(obj) { |
|
|
sortChange(obj) { |
|
|
var dir='asc'; |
|
|
|
|
|
if(obj.order=='ascending'){ |
|
|
|
|
|
dir='asc' |
|
|
|
|
|
|
|
|
var dir = "asc"; |
|
|
|
|
|
if (obj.order == "ascending") { |
|
|
|
|
|
dir = "asc"; |
|
|
} else { |
|
|
} 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.pageInfo.orderDirs = [dir]; |
|
|
} |
|
|
} |
|
|
this.getXmProducts(); |
|
|
this.getXmProducts(); |
|
|
@ -201,55 +317,71 @@ |
|
|
pageSize: this.pageInfo.pageSize, |
|
|
pageSize: this.pageInfo.pageSize, |
|
|
pageNum: this.pageInfo.pageNum, |
|
|
pageNum: this.pageInfo.pageNum, |
|
|
total: this.pageInfo.total, |
|
|
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 = []; |
|
|
let orderBys = []; |
|
|
for (var i = 0; i < this.pageInfo.orderFields.length; i++) { |
|
|
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 !== "") { |
|
|
if (this.filters.key !== "") { |
|
|
params.key="%"+this.filters.key+"%" |
|
|
|
|
|
|
|
|
params.key = "%" + this.filters.key + "%"; |
|
|
} |
|
|
} |
|
|
if (this.linkProjectId) { |
|
|
if (this.linkProjectId) { |
|
|
params.linkProjectId=this.linkProjectId |
|
|
|
|
|
|
|
|
params.linkProjectId = this.linkProjectId; |
|
|
} |
|
|
} |
|
|
if (this.linkIterationId) { |
|
|
if (this.linkIterationId) { |
|
|
params.linkIterationId=this.linkIterationId |
|
|
|
|
|
|
|
|
params.linkIterationId = this.linkIterationId; |
|
|
} |
|
|
} |
|
|
if (this.filters.id) { |
|
|
if (this.filters.id) { |
|
|
params.id=this.filters.id |
|
|
|
|
|
|
|
|
params.id = this.filters.id; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (this.filters.pmUser) { |
|
|
if (this.filters.pmUser) { |
|
|
params.pmUserid=this.filters.pmUser.userid |
|
|
|
|
|
|
|
|
params.pmUserid = this.filters.pmUser.userid; |
|
|
} |
|
|
} |
|
|
this.load.list = true; |
|
|
this.load.list = true; |
|
|
listXmProductWithState(params).then((res) => { |
|
|
|
|
|
|
|
|
listXmProductWithState(params) |
|
|
|
|
|
.then((res) => { |
|
|
var tips = res.data.tips; |
|
|
var tips = res.data.tips; |
|
|
if (tips.isOk) { |
|
|
if (tips.isOk) { |
|
|
this.pageInfo.total = res.data.total; |
|
|
this.pageInfo.total = res.data.total; |
|
|
this.pageInfo.count = false; |
|
|
this.pageInfo.count = false; |
|
|
this.xmProducts = res.data.data; |
|
|
this.xmProducts = res.data.data; |
|
|
if (this.iterationId) { |
|
|
if (this.iterationId) { |
|
|
map.set(this.iterationId,this.xmProducts) |
|
|
|
|
|
|
|
|
map.set(this.iterationId, this.xmProducts); |
|
|
} else if (this.linkProjectId) { |
|
|
} else if (this.linkProjectId) { |
|
|
map.set(this.linkProjectId,this.xmProducts) |
|
|
|
|
|
|
|
|
map.set(this.linkProjectId, this.xmProducts); |
|
|
} |
|
|
} |
|
|
if(this.autoSelect!==false&&this.xmProducts.length>0 && this.productVisible==false){ |
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
|
this.autoSelect !== false && |
|
|
|
|
|
this.xmProducts.length > 0 && |
|
|
|
|
|
this.productVisible == false |
|
|
|
|
|
) { |
|
|
var row = this.xmProducts[0]; |
|
|
var row = this.xmProducts[0]; |
|
|
this.$refs.table.setCurrentRow(row); |
|
|
this.$refs.table.setCurrentRow(row); |
|
|
this.rowClick(row); |
|
|
this.rowClick(row); |
|
|
} else { |
|
|
} else { |
|
|
this.editForm=null |
|
|
|
|
|
|
|
|
this.editForm = null; |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} 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; |
|
|
this.load.list = false; |
|
|
}).catch( err => this.load.list = false ); |
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
.catch((err) => (this.load.list = false)); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
//选择行xmProduct |
|
|
//选择行xmProduct |
|
|
@ -258,15 +390,15 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
rowClick: function (row, event, column) { |
|
|
rowClick: function (row, event, column) { |
|
|
this.editForm=row |
|
|
|
|
|
this.$emit('row-click',row, event, column);// @row-click="rowClick" |
|
|
|
|
|
this.selectedProduct(row) |
|
|
|
|
|
|
|
|
this.editForm = row; |
|
|
|
|
|
this.$emit("row-click", row, event, column); // @row-click="rowClick" |
|
|
|
|
|
this.selectedProduct(row); |
|
|
this.productVisible = false; |
|
|
this.productVisible = false; |
|
|
this.moreVisible = false; |
|
|
this.moreVisible = false; |
|
|
}, |
|
|
}, |
|
|
selectedProduct: function (row) { |
|
|
selectedProduct: function (row) { |
|
|
this.editForm=row |
|
|
|
|
|
this.$emit('selected',row); |
|
|
|
|
|
|
|
|
this.editForm = row; |
|
|
|
|
|
this.$emit("selected", row); |
|
|
this.productVisible = false; |
|
|
this.productVisible = false; |
|
|
this.moreVisible = false; |
|
|
this.moreVisible = false; |
|
|
}, |
|
|
}, |
|
|
@ -281,7 +413,7 @@ |
|
|
}, |
|
|
}, |
|
|
onFiltersPmUserSelected(users) { |
|
|
onFiltersPmUserSelected(users) { |
|
|
if (users && users.length > 0) { |
|
|
if (users && users.length > 0) { |
|
|
this.filters.pmUser=users[0] |
|
|
|
|
|
|
|
|
this.filters.pmUser = users[0]; |
|
|
} else { |
|
|
} else { |
|
|
this.filters.pmUser = null; |
|
|
this.filters.pmUser = null; |
|
|
} |
|
|
} |
|
|
@ -295,9 +427,9 @@ |
|
|
|
|
|
|
|
|
tableRowClassName({ row, rowIndex }) { |
|
|
tableRowClassName({ row, rowIndex }) { |
|
|
if (row && this.editForm && row.id == this.editForm.id) { |
|
|
if (row && this.editForm && row.id == this.editForm.id) { |
|
|
return 'success-row'; |
|
|
|
|
|
|
|
|
return "success-row"; |
|
|
} |
|
|
} |
|
|
return ''; |
|
|
|
|
|
|
|
|
return ""; |
|
|
}, |
|
|
}, |
|
|
clearSelect() { |
|
|
clearSelect() { |
|
|
this.$refs.table.setCurrentRow(); |
|
|
this.$refs.table.setCurrentRow(); |
|
|
@ -361,25 +493,29 @@ |
|
|
listXmProductWithState({ id: this.editForm.id }).then((res) => { |
|
|
listXmProductWithState({ id: this.editForm.id }).then((res) => { |
|
|
var tips = res.data.tips; |
|
|
var tips = res.data.tips; |
|
|
if (tips.isOk && rea.data.data && res.data.data.length > 0) { |
|
|
if (tips.isOk && rea.data.data && res.data.data.length > 0) { |
|
|
Object.assign(this.editForm,res.data.data[0]) |
|
|
|
|
|
this.rowClick(this.editForm) |
|
|
|
|
|
|
|
|
Object.assign(this.editForm, res.data.data[0]); |
|
|
|
|
|
this.rowClick(this.editForm); |
|
|
} |
|
|
} |
|
|
}) |
|
|
|
|
|
|
|
|
}); |
|
|
}, |
|
|
}, |
|
|
afterAddSubmit(row) { |
|
|
afterAddSubmit(row) { |
|
|
this.xmProducts.push(row) |
|
|
|
|
|
|
|
|
this.xmProducts.push(row); |
|
|
if (this.iterationId) { |
|
|
if (this.iterationId) { |
|
|
map.set(this.iterationId,this.xmProducts) |
|
|
|
|
|
|
|
|
map.set(this.iterationId, this.xmProducts); |
|
|
} else if (this.linkProjectId) { |
|
|
} else if (this.linkProjectId) { |
|
|
map.set(this.linkProjectId,this.xmProducts) |
|
|
|
|
|
|
|
|
map.set(this.linkProjectId, this.xmProducts); |
|
|
} |
|
|
} |
|
|
if(this.autoSelect!==false&&this.xmProducts.length>0 && this.productVisible==false){ |
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
|
this.autoSelect !== false && |
|
|
|
|
|
this.xmProducts.length > 0 && |
|
|
|
|
|
this.productVisible == false |
|
|
|
|
|
) { |
|
|
var row = this.xmProducts[0]; |
|
|
var row = this.xmProducts[0]; |
|
|
this.$refs.table.setCurrentRow(row); |
|
|
this.$refs.table.setCurrentRow(row); |
|
|
this.rowClick(row); |
|
|
this.rowClick(row); |
|
|
} |
|
|
} |
|
|
this.addProductVisible = false; |
|
|
this.addProductVisible = false; |
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, //end methods |
|
|
}, //end methods |
|
|
components: { |
|
|
components: { |
|
|
UsersSelect, |
|
|
UsersSelect, |
|
|
@ -393,15 +529,11 @@ |
|
|
this.initData(); |
|
|
this.initData(); |
|
|
this.hadInit = true; |
|
|
this.hadInit = true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
}; |
|
|
</script> |
|
|
</script> |
|
|
<style scoped> |
|
|
<style scoped> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.more-label-font { |
|
|
.more-label-font { |
|
|
text-align: center; |
|
|
text-align: center; |
|
|
float: left; |
|
|
float: left; |
|
|
|