Browse Source

优化

master
陈裕财 4 years ago
parent
commit
3b3c20a014
  1. 52
      src/views/xm/core/xmIteration/XmIterationForProjectComplex.vue
  2. 21
      src/views/xm/core/xmProduct/XmProductAdd.vue
  3. 24
      src/views/xm/core/xmProduct/XmProductForProjectComplex.vue

52
src/views/xm/core/xmIteration/XmIterationForProjectComplex.vue

@ -3,17 +3,31 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-tabs type="border-card" :value="showPanel" @tab-click="tabClick"> <el-tabs type="border-card" :value="showPanel" @tab-click="tabClick">
<el-tab-pane lazy @click.stop="iterationVisible=!iterationVisible" name="iterations" disabled>
<el-tab-pane lazy name="iterations" disabled>
<div slot="label"> <div slot="label">
<el-popover <el-popover
placement="right" placement="right"
width="400" width="400"
trigger="click"> trigger="click">
<xm-iteration-select :auto-select="true" :sel-project="selProject" :product-id="xmProduct?xmProduct.id:null" @row-click="onIterationRowClick" @clear-select="onIterationClearSelect"></xm-iteration-select>
<xm-iteration-select ref="xmIterationSelect" :auto-select="true" :sel-project="selProject" :product-id="xmProduct?xmProduct.id:null" @row-click="onIterationRowClick" @clear-select="onIterationClearSelect"></xm-iteration-select>
<el-link type="warning" slot="reference" icon="el-icon-search"><font style="font-size:14px;">{{xmIteration?xmIteration.iterationName:'选择迭代'}}</font></el-link> <el-link type="warning" slot="reference" icon="el-icon-search"><font style="font-size:14px;">{{xmIteration?xmIteration.iterationName:'选择迭代'}}</font></el-link>
</el-popover> </el-popover>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane lazy name="iterations" disabled>
<div slot="label">
<el-popover
placement="bottom"
width="800"
v-model="iterationAddVisible"
trigger="manual">
<xm-iteration-add :xm-product="xmProduct" :sel-project="selProject" :visible="iterationAddVisible" @cancel="iterationAddVisible=false" @submit="afterIterationAddSubmit"></xm-iteration-add>
<el-link type="warning" slot="reference" @click="iterationAddVisible=true" icon="el-icon-plus">迭代</el-link>
</el-popover>
</div>
</el-tab-pane>
<el-tab-pane label="迭代概览" lazy name="iterationOverview" v-if="xmIteration && xmIteration.id"> <el-tab-pane label="迭代概览" lazy name="iterationOverview" v-if="xmIteration && xmIteration.id">
<xm-iteration-overview v-if="xmIteration && showPanel=='iterationOverview'" :xm-iteration="xmIteration" :sel-project="selProject"></xm-iteration-overview> <xm-iteration-overview v-if="xmIteration && showPanel=='iterationOverview'" :xm-iteration="xmIteration" :sel-project="selProject"></xm-iteration-overview>
</el-tab-pane> </el-tab-pane>
@ -59,6 +73,7 @@
import XmQuestionMng from '../xmQuestion/XmQuestionMng.vue'; import XmQuestionMng from '../xmQuestion/XmQuestionMng.vue';
import XmIterationOverview from "./XmIterationOverview"; import XmIterationOverview from "./XmIterationOverview";
import XmIterationAdd from './XmIterationAdd';//
export default { export default {
computed: { computed: {
@ -128,7 +143,7 @@
moduleType : '1' // 1- 2- moduleType : '1' // 1- 2-
} }
], ],
iterationVisible:true,
iterationAddVisible:false,
/**end 自定义属性请在上面加 请加备注**/ /**end 自定义属性请在上面加 请加备注**/
} }
},//end data },//end data
@ -143,30 +158,14 @@
onIterationClearSelect(){ onIterationClearSelect(){
this.xmIteration=null; this.xmIteration=null;
}, },
tabClick(tab){
if(this.xmIteration==null || !this.xmIteration.id){
this.iterationVisible=true;
this.$notify({showClose: true, message:"请先选中左边迭代", type: 'warning' });
return;
}
if(tab.name=='iterations'){
this.iterationVisible=!this.iterationVisible;
return;
}
this.showPanel=tab.name
afterIterationAddSubmit(iteration){
this.$refs.xmIterationSelect.xmIterations.push(iteration)
this.$refs.xmIterationSelect.rowClick(iteration);
this.iterationAddVisible=false;
}, },
doDelXmIterationLink(){
this.$confirm('移出后,迭代试图将看不到该产品信息,确认将产品【'+this.xmProduct.productName+'】从迭代【'+this.xmIteration.iterationName+'】移出吗?', '提示', {}).then(() => {
var params={iterationId:this.xmIteration.id,productId:this.xmProduct.id}
delXmIterationLink(params).then(res=>{
var tips = res.data.tips;
if(tips.isOk){
this.$notify({showClose: true, message:"移出成功", type: tips.isOk?'success':'error' });
}
})
})
}
tabClick(tab){
this.showPanel=tab.name
},
},//end methods },//end methods
components: { components: {
XmIterationOverview, XmIterationOverview,
@ -178,6 +177,7 @@
XmTaskMng, XmTaskMng,
XmQuestionMng, XmQuestionMng,
XmProjectForLink, XmProjectForLink,
XmIterationAdd,
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {

21
src/views/xm/core/xmProduct/XmProductAdd.vue

@ -66,14 +66,17 @@
'userInfo','roles' 'userInfo','roles'
]) ])
}, },
props:['xmProduct','visible'],
props:['xmProduct','visible','selProject'],
watch: { watch: {
'xmProduct':function( xmProduct ) { 'xmProduct':function( xmProduct ) {
this.addForm = xmProduct; this.addForm = xmProduct;
}, },
'visible':function(visible) { 'visible':function(visible) {
if(visible==true){
//
if(visible==true){
this.addForm.pmUserid=this.userInfo.userid
this.addForm.pmUsername=this.userInfo.username
this.addForm.admUserid=this.userInfo.userid
this.addForm.admUsername=this.userInfo.username
} }
} }
}, },
@ -111,15 +114,10 @@
methods: { methods: {
// @cancel="addFormVisible=false" // @cancel="addFormVisible=false"
handleCancel:function(){ handleCancel:function(){
this.$refs['addForm'].resetFields();
this.$emit('cancel'); this.$emit('cancel');
}, },
//XmProduct @submit="afterAddSubmit" //XmProduct @submit="afterAddSubmit"
addSubmit: function () { addSubmit: function () {
if(!this.roles.some(i=>i.roleid=='productAdmin')){
this.$notify({showClose: true, message: "只有产品经理能够创建产品", type: 'error'});
return false;
}
this.$refs.addForm.validate((valid) => { this.$refs.addForm.validate((valid) => {
if (valid) { if (valid) {
@ -127,6 +125,9 @@
this.$confirm('确认提交吗?', '提示', {}).then(() => { this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.add=true this.load.add=true
let params = Object.assign({}, this.addForm); let params = Object.assign({}, this.addForm);
if(this.selProject &&this.selProject.id){
params.links=[{projectId:this.selProject.id}]
}
params.branchId=this.userInfo.branchId params.branchId=this.userInfo.branchId
addXmProduct(params).then((res) => { addXmProduct(params).then((res) => {
this.load.add=false this.load.add=false
@ -138,6 +139,8 @@
this.$notify({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' }); this.$notify({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.add=false); }).catch( err => this.load.add=false);
}); });
}else{
this.$notify({showClose: true, message: "表单检查不通过", type: 'error' });
} }
}); });
}, },
@ -188,6 +191,8 @@
this.addForm=Object.assign(this.addForm, this.xmProduct); this.addForm=Object.assign(this.addForm, this.xmProduct);
this.addForm.pmUserid=this.userInfo.userid this.addForm.pmUserid=this.userInfo.userid
this.addForm.pmUsername=this.userInfo.username this.addForm.pmUsername=this.userInfo.username
this.addForm.admUserid=this.userInfo.userid
this.addForm.admUsername=this.userInfo.username
/**在下面写其它函数***/ /**在下面写其它函数***/
}//end mounted }//end mounted

24
src/views/xm/core/xmProduct/XmProductForProjectComplex.vue

@ -9,11 +9,23 @@
placement="right" placement="right"
width="400" width="400"
trigger="click"> trigger="click">
<xm-product-select :auto-select="true" :sel-project="selProject" :xm-iteration="xmIteration" @row-click="onProductRowClick" @clear-select="onProductClearSelect"></xm-product-select>
<xm-product-select ref="xmProductSelect" :auto-select="true" :sel-project="selProject" :xm-iteration="xmIteration" @row-click="onProductRowClick" @clear-select="onProductClearSelect"></xm-product-select>
<el-link type="warning" slot="reference" icon="el-icon-search"><font style="font-size:14px;">{{xmProduct?xmProduct.productName:'选择产品'}}</font></el-link> <el-link type="warning" slot="reference" icon="el-icon-search"><font style="font-size:14px;">{{xmProduct?xmProduct.productName:'选择产品'}}</font></el-link>
</el-popover> </el-popover>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane disabled>
<div slot="label">
<el-popover
placement="bottom"
width="800"
v-model="addProductVisible"
trigger="manual">
<xm-product-add @cancel="addProductVisible=false" :sel-project="selProject" @submit="afterAddProductSubmit"></xm-product-add>
<el-link type="warning" slot="reference" @click="addProductVisible=true" icon="el-icon-plus">产品</el-link>
</el-popover>
</div>
</el-tab-pane>
<el-tab-pane label="产品概览" name="productOverview" v-if="xmProduct && xmProduct.id"> <el-tab-pane label="产品概览" name="productOverview" v-if="xmProduct && xmProduct.id">
<xm-product-overview v-if="xmProduct && showPanel=='productOverview'" :xm-product="xmProduct" :sel-project="selProject"></xm-product-overview> <xm-product-overview v-if="xmProduct && showPanel=='productOverview'" :xm-product="xmProduct" :sel-project="selProject"></xm-product-overview>
@ -62,6 +74,7 @@ import XmProductSelect from './XmProductSelect.vue';
import XmProductProjectForLink from './XmProductProjectForLink.vue'; import XmProductProjectForLink from './XmProductProjectForLink.vue';
import XmProductOverview from "./XmProductOverview"; import XmProductOverview from "./XmProductOverview";
import XmProductAdd from './XmProductAdd';//
export default { export default {
computed: { computed: {
@ -132,6 +145,7 @@ import XmProductOverview from "./XmProductOverview";
} }
], ],
productVisible:true, productVisible:true,
addProductVisible:false,
/**end 自定义属性请在上面加 请加备注**/ /**end 自定义属性请在上面加 请加备注**/
} }
},//end data },//end data
@ -142,7 +156,11 @@ import XmProductOverview from "./XmProductOverview";
this.xmProduct=xmProduct this.xmProduct=xmProduct
}, },
afterAddProductSubmit(product){
this.$refs.xmProductSelect.xmProducts.push(product)
this.$refs.xmProductSelect.rowClick(product)
this.addProductVisible=false;
},
onProductClearSelect(){ onProductClearSelect(){
this.xmProduct=null; this.xmProduct=null;
}, },
@ -166,7 +184,7 @@ import XmProductOverview from "./XmProductOverview";
XmProjectList, XmProjectList,
XmProjectForLink, XmProjectForLink,
XmProductProjectForLink, XmProductProjectForLink,
XmProductOverview,
XmProductOverview,XmProductAdd,
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {

Loading…
Cancel
Save