Browse Source

优化

master
陈裕财 3 years ago
parent
commit
5c3a59fd00
  1. 2
      src/views/xm/rpt/CompsCard.vue
  2. 5
      src/views/xm/rpt/CompsSet.vue
  3. 101
      src/views/xm/rpt/his/rptDataSelect.vue
  4. 6
      src/views/xm/rpt/index.vue

2
src/views/xm/rpt/CompsCard.vue

@ -200,7 +200,7 @@ export default {
this.$message.error("还没制作报告,请先制作报告") this.$message.error("还没制作报告,请先制作报告")
return; return;
} }
this.xmRptData.rptName=this.xmRptConfig.name
this.xmRptData.rptName=this.xmRptConfig.name+"-"+util.getDate()
this.createRptDataVisible=true this.createRptDataVisible=true
}, },

5
src/views/xm/rpt/CompsSet.vue

@ -186,6 +186,7 @@ export default {
}, },
mounted(){ mounted(){
store.dispatch("toggleSideBar",false)
//this.comps.forEach(k=>k.id=k.id?k.id:k.compId) //this.comps.forEach(k=>k.id=k.id?k.id:k.compId)
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el) this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el)
if(this.category){ if(this.category){
@ -200,11 +201,11 @@ export default {
}else if(this.xmProduct && this.xmProduct.id){ }else if(this.xmProduct && this.xmProduct.id){
this.filters.category="产品级" this.filters.category="产品级"
}else{ }else{
this.filters.category="企业级"
store.dispatch("toggleSideBar",false)
this.filters.category="企业级"
} }
} }
} }
} }
</script> </script>

101
src/views/xm/rpt/his/rptDataSelect.vue

@ -29,7 +29,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" width="100" fixed="right"> <el-table-column label="操作" width="100" fixed="right">
<template scope="scope"> <template scope="scope">
<el-button type="primary" @click="$emit('select',scope.row)" icon="el-icon-edit" plain>选择</el-button>
<el-button type="primary" @click="toRptDetail(scope.row)" icon="el-icon-s-data" plain>选择</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -42,7 +42,7 @@
import util from '@/common/js/util';// import util from '@/common/js/util';//
import config from '@/common/config';// import config from '@/common/config';//
import { initDicts,listXmRptData, delXmRptData, batchDelXmRptData,editSomeFieldsXmRptData } from '@/api/xm/core/xmRptData';
import { initDicts,listXmRptData } from '@/api/xm/core/xmRptData';
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
export default { export default {
@ -168,96 +168,11 @@ export default {
} }
this.load.list = false; this.load.list = false;
}).catch( err => this.load.list = false ); }).catch( err => this.load.list = false );
},
// XmRptData xm_rpt_data
showEdit: function ( row,index ) {
this.editFormVisible = true;
this.editForm = Object.assign({}, row);
},
// XmRptData xm_rpt_data
showAdd: function () {
this.addFormVisible = true;
//this.addForm=Object.assign({}, this.editForm);
},
afterAddSubmit(){
this.addFormVisible=false;
this.pageInfo.count=true;
this.getXmRptDatas();
},
afterEditSubmit(){
this.editFormVisible=false;
},
},
//xmRptData //xmRptData
selsChange: function (sels) { selsChange: function (sels) {
this.sels = sels; this.sels = sels;
},
//xmRptData
handleDel: function (row,index) {
this.$confirm('确认删除该记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.load.del=true;
let params = { id:row.id };
delXmRptData(params).then((res) => {
this.load.del=false;
var tips=res.data.tips;
if(tips.isOk){
this.searchXmRptDatas();
}
this.$notify({ position:'bottom-left', showClose:true, message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.del=false );
});
},
//xmRptData
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;
batchDelXmRptData(params).then((res) => {
this.load.del=false;
var tips=res.data.tips;
if( tips.isOk ){
this.searchXmRptDatas();
}
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: tips.isOk?'success':'error'});
}).catch( err => this.load.del=false );
});
},
editSomeFields(row,fieldName,$event){
let params={};
if(this.sels.length>0){
if(!this.sels.some(k=> k.id==row.id)){
this.$notify({position:'bottom-left',showClose:true,message:'请编辑选中的行',type:'warning'})
Object.assign(this.editForm,this.editFormBak)
return;
}
params['ids']=this.sels.map(i=>i.id)
}else{
params['ids']=[row].map(i=>i.id)
}
params[fieldName]=$event
var func = editSomeFieldsXmRptData
func(params).then(res=>{
let tips = res.data.tips;
if(tips.isOk){
if(this.sels.length>0){
this.searchXmRptDatas();
}
this.editFormBak=[...this.editForm]
}else{
Object.assign(this.editForm,this.editFormBak)
this.$notify({position:'bottom-left',showClose:true,message:tips.msg,type:tips.isOk?'success':'error'})
}
}).catch((e)=>Object.assign(this.editForm,this.editFormBak))
},
},
rowClick: function(row, event, column){ rowClick: function(row, event, column){
this.editForm=row this.editForm=row
this.editFormBak={...row}; this.editFormBak={...row};
@ -267,6 +182,14 @@ export default {
}, },
toRptDetail(row){
this.$router.push({
name:'rptHisDetail',
query:{
id:row.id
}
})
},
},//end methods },//end methods
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {

6
src/views/xm/rpt/index.vue

@ -6,13 +6,11 @@
</section> </section>
</template> </template>
<script>
import NProgress from 'nprogress' // progress bar
<script>
import compsCard from './CompsCard' import compsCard from './CompsCard'
import compsSet from './CompsSet' import compsSet from './CompsSet'
import { mapGetters } from 'vuex'
import dayjs from 'dayjs'
import { mapGetters } from 'vuex'
export default { export default {
props:['xmProduct','xmIteration','xmProject','xmTestCasedb','xmTestPlan','category'], props:['xmProduct','xmIteration','xmProject','xmTestCasedb','xmTestPlan','category'],

Loading…
Cancel
Save