Browse Source

优化

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

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

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

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

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

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

@ -29,7 +29,7 @@
</el-table-column>
<el-table-column label="操作" width="100" fixed="right">
<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>
</el-table-column>
</el-table>
@ -42,7 +42,7 @@
import util from '@/common/js/util';//
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'
export default {
@ -169,94 +169,9 @@ export default {
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
selsChange: function (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){
this.editForm=row
@ -267,6 +182,14 @@ export default {
},
toRptDetail(row){
this.$router.push({
name:'rptHisDetail',
query:{
id:row.id
}
})
},
},//end methods
mounted() {
this.$nextTick(() => {

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

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

Loading…
Cancel
Save