Browse Source

优化

master
陈裕财 3 years ago
parent
commit
812bee4785
  1. 2
      src/api/xm/core/xmWorkload.js
  2. 70
      src/views/xm/core/xmQuestion/XmQuestionDetail.vue
  3. 74
      src/views/xm/core/xmTestCase/XmTestCaseDetail.vue
  4. 74
      src/views/xm/core/xmTestPlanCase/XmTestPlanCaseDetail.vue
  5. 10
      src/views/xm/core/xmWorkload/XmWorkloadList.vue
  6. 4
      src/views/xm/core/xmWorkload/XmWorkloadMng.vue
  7. 66
      src/views/xm/core/xmWorkload/XmWorkloadSimpleListForBizDate.vue

2
src/api/xm/core/xmWorkload.js

@ -56,10 +56,12 @@ export const listXmWorkloadGroupByTaskIdAndUseridToSet = params => { return axio
export const initDicts = (that) => {
var itemCodes=['taskState','taskType'];//在此添加要加载的字典 如['sex','grade','lvl']
var wlBizType=[{id:'1',name:'任务'},{id:'2',name: '缺陷'},{id:'3',name:'测试用例'},{id:'4',name:'执行用例'},{id:'5',name:'需求'}]
var wstatus=[{id:'0',name:'待确认'},{id:'1',name: '已确认'}]
var sstatus=[{id:'0',name:'无需结算'},{id:'1',name: '待结算'},{id:'2',name:'已提交'},{id:'3',name:'已通过'},{id:'4',name:'已结算'}]
that.dicts.wstatus=wstatus
that.dicts.sstatus=sstatus
that.dicts.wlBizType=wlBizType
if(itemCodes.length>0){
initSimpleDicts('all',itemCodes).then(res=>{
Object.assign(that.dicts,res.data.data)

70
src/views/xm/core/xmQuestion/XmQuestionDetail.vue

@ -0,0 +1,70 @@
<template>
<section>
<xm-question-edit v-if="xmQuestionDb" :xm-question="xmQuestionDb" :visible="showInfo"></xm-question-edit>
</section>
</template>
<script>
import util from '@/common/js/util';//
import { listXmQuestion } from '@/api/xm/core/xmQuestion';
import { mapGetters } from 'vuex';
import XmQuestionEdit from './XmQuestionEdit'
export default {
props:['xmQuestion','reload','visible'],
computed: {
...mapGetters([
'userInfo','roles'
]),
},
watch:{
visible:function(){
if(this.visible==true){
if(this.reload==true){
if(this.xmQuestion && this.xmQuestion.id){
this.getXmQuestion(this.xmQuestion.id)
}else{
this.xmQuestionDb=true
}
}
}
}
},
data() {
return {
xmQuestionDb:null,
showInfo:false,
}
},//end data
methods: {
getXmQuestion(id){
listXmQuestion({id:id}).then(res=>{
var tips = res.data.tips;
if(tips.isOk){
this.xmQuestionDb=res.data.data[0]
this.showInfo=true;
}else{
}
})
}
},//end methods
components: {
XmQuestionEdit,
//
},
mounted() {
if(this.xmQuestion && this.xmQuestion.id && this.reload==true){
this.getXmQuestion(this.xmQuestion.id)
}else if(( !this.xmQuestion ||! this.xmQuestion.id )&& this.reload==true){
this.xmQuestionDb=null;
}
}
}
</script>
<style scoped>
</style>

74
src/views/xm/core/xmTestCase/XmTestCaseDetail.vue

@ -0,0 +1,74 @@
<template>
<xm-test-case-edit v-if="xmTestCaseDb&&xmTestCaseDb.id && showInfo" :xm-test-case="xmTestCaseDb" :visible="showInfo"></xm-test-case-edit>
</template>
<script>
import { listXmTestCase } from '@/api/xm/core/xmTestCase';
import { mapGetters } from 'vuex';
export default {
props:['xmTestCase','reload','visible'],
computed: {
...mapGetters([
'userInfo','roles'
]),
},
watch:{
'visible':function(){
if(this.visible){
if(this.reload){
this.getXmTestCase(this.xmTestCase.id)
}else{
this.xmTestCaseDb=this.xmTestCase
this.showInfo=true
}
}else{
this.showInfo=false
}
}
},
data() {
return {
xmTestCaseDb:null,
showInfo:false,
}
},//end data
methods: {
getXmTestCase(id){
if(!id){
this.xmTestCaseDb=null
return;
}
listXmTestCase({id:id}).then(res=>{
var tips = res.data.tips;
if(tips.isOk){
this.xmTestCaseDb=res.data.data[0]
this.showInfo=true
}else{
}
})
}
},//end methods
components: {
XmTestCaseEdit:()=>import("./XmTestCaseEdit"),
//
},
mounted() {
if(this.reload){
this.getXmTestCase(this.xmTestCase.id)
}else{
this.xmTestCaseDb=this.xmTestCase
}
}
}
</script>
<style scoped>
</style>

74
src/views/xm/core/xmTestPlanCase/XmTestPlanCaseDetail.vue

@ -0,0 +1,74 @@
<template>
<xm-test-plan-case-edit v-if="xmTestPlanCaseDb&&xmTestPlanCaseDb.caseId && showInfo" :xm-test-case="xmTestPlanCaseDb" :visible="showInfo"></xm-test-plan-case-edit>
</template>
<script>
import { listXmTestPlanCase } from '@/api/xm/core/xmTestPlanCase';
import { mapGetters } from 'vuex';
export default {
props:['xmTestPlanCase','reload','visible'],
computed: {
...mapGetters([
'userInfo','roles'
]),
},
watch:{
'visible':function(){
if(this.visible){
if(this.reload){
this.getXmTestPlanCase(this.xmTestPlanCase.planId,this.xmTestPlanCase.caseId)
}else{
this.xmTestPlanCaseDb=this.xmTestPlanCase
this.showInfo=true
}
}else{
this.showInfo=false
}
}
},
data() {
return {
xmTestPlanCaseDb:null,
showInfo:false,
}
},//end data
methods: {
getXmTestPlanCase(planId,caseId){
if(!planId){
this.xmTestPlanCaseDb=null
return;
}
listXmTestPlanCase({planId:planId,caseId:caseId}).then(res=>{
var tips = res.data.tips;
if(tips.isOk){
this.xmTestPlanCaseDb=res.data.data[0]
this.showInfo=true
}else{
}
})
}
},//end methods
components: {
XmTestPlanCaseEdit:()=>import("./XmTestPlanCaseEdit"),
//
},
mounted() {
if(this.reload){
this.getXmTestPlanCase(this.xmTestPlanCase.planId,this.xmTestPlanCase.caseId)
}else{
this.xmTestPlanCaseDb=this.xmTestPlanCase
}
}
}
</script>
<style scoped>
</style>

10
src/views/xm/core/xmWorkload/XmWorkloadList.vue

@ -20,6 +20,11 @@
{{scope.row.wstatus==='1'?'已确认':'待确认'}}
</template>
</el-table-column>
<el-table-column prop="bizName" label="业务标题" min-width="150" show-overflow-tooltip>
<template slot-scope="scope">
<el-link @click="goToBizDetail">{{scope.row.bizName}}</el-link>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" min-width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="ttype" label="任务类型" min-width="80" show-overflow-tooltip :formatter="formatterOption"></el-table-column>
@ -325,6 +330,11 @@
this.editForm=Object.assign(this.editForm,this.val)
this.editFormBak={...this.editForm}
},
goToBizDetail(row){
if(row.bizType=='1'){
}
}
},//end methods
mounted() {

4
src/views/xm/core/xmWorkload/XmWorkloadMng.vue

@ -62,11 +62,11 @@
</span>
</template>
</el-table-column>
<el-table-column prop="taskId" label="任务" min-width="120" show-overflow-tooltip sortable fixed="left">
<el-table-column prop="bizName" label="业务" min-width="120" show-overflow-tooltip sortable fixed="left">
<template slot-scope="scope">
<span class="cell-text">
{{scope.row.taskName}}
{{scope.row.bizName}}
</span>
<span class="cell-bar">
<el-popover>

66
src/views/xm/core/xmWorkload/XmWorkloadSimpleListForBizDate.vue

@ -29,16 +29,19 @@
</el-select>
</span>
</template>
</el-table-column>
<el-table-column prop="taskState" label="任务状态" width="80" show-overflow-tooltip>
<template slot-scope="scope">
<el-tag v-for="(item,index) in formatDictsWithClass(dicts,'taskState',scope.row.taskState)" :key="index" :type="item.className">{{item.name}}</el-tag>
</template>
</el-table-column>
<el-table-column prop="bizType" label="报工类型" width="120" show-overflow-tooltip>
<template slot-scope="scope">
<mdp-select-dict-tag :disabled="true" v-model="scope.row.bizType" :dict="dicts['wlBizType']"></mdp-select-dict-tag>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" width="120" show-overflow-tooltip></el-table-column>
<el-table-column prop="taskName" label="任务" min-width="120" show-overflow-tooltip></el-table-column>
<el-table-column fixed="right" label="操作" min-width="120">
<el-table-column prop="bizName" label="报工业务" width="120" show-overflow-tooltip>
<template slot-scope="scope">
<el-link @click="openDialog(scope.row)"></el-link>
</template>
</el-table-column>
<el-table-column prop="remark" label="报工备注" width="120" show-overflow-tooltip></el-table-column>
<el-table-column fixed="right" label="操作" min-width="120">
<template slot-scope="scope">
<xm-task-sbill-select style="display:inline;" :auto-select="false" :project-id="scope.row.projectId" placeholder="结算" @row-click="batchJoinToSbill(scope.row,$event)">
<span slot="title">{{scope.row.sbillId?'结算单:'+scope.row.sbillId:'选择结算单'}}</span>
@ -50,6 +53,25 @@
</el-table>
<el-pagination 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>
</el-row>
<el-dialog title="任务明细" :visible.sync="taskDetailVisible" width="90%" top="20px" append-to-body>
<xm-task-detail :visible="taskDetailVisible" :xm-task="{id:editForm.taskId,name:editForm.bizName}" :reload="true"></xm-task-detail>
</el-dialog>
<el-dialog title="缺陷明细" :visible.sync="bugDetailVisible" width="90%" top="20px" append-to-body>
<xm-question-detail :visible="bugDetailVisible" :xm-question="{id:editForm.bugId,name:editForm.bizName}" :reload="true"></xm-question-detail>
</el-dialog>
<el-dialog title="测试用例明细" :visible.sync="caseDetailVisible" width="90%" top="20px" append-to-body>
<xm-test-case-detail :visible="caseDetailVisible" :xm-test-case="{id:editForm.caseId,name:editForm.bizName}" :reload="true"></xm-test-case-detail>
</el-dialog>
<el-dialog title="执行用例明细" :visible.sync="planCaseDetailVisible" width="90%" top="20px" append-to-body>
<xm-test-plan-case-detail :visible="planCaseDetailVisible" :xm-plan-test-case="{planId:editForm.planId,caseId:editForm.caseId,name:editForm.bizName}" :reload="true"></xm-test-plan-case-detail>
</el-dialog>
<el-dialog title="需求明细" :visible.sync="menuDetailVisible" width="90%" top="20px" append-to-body>
<xm-menu-detail :visible="menuDetailVisible" :xm-menu="{id:editForm.menuId,name:editForm.bizName}" :reload="true"></xm-menu-detail>
</el-dialog>
</section>
</template>
@ -66,7 +88,12 @@
export default {
name:'xmWorkloadSimpleListForBizDate',
components: {
XmTaskSbillSelect
XmTaskSbillSelect,
"xm-task-detail":()=>import("../xmTask/XmTaskDetail"),
"xm-question-detail":()=>import("../xmQuestion/XmQuestionMng"),
"xm-test-case-detail":()=>import("../xmTestCase/XmTestCaseDetail"),
"xm-test-plan-case-detail":()=>import("../xmTestPlanCase/XmTestPlanCaseDetail"),
"xm-menu-detail":()=>import("../xmMenu/XmMenuDetail"),
},
props:[ 'visible','wstatus','sstatus','bizDate','projectId','userid','taskId','bizMonth','detailId','sbillId'],
computed: {
@ -101,6 +128,7 @@
taskState:[],
wstatus:[],
sstatus:[],
wlBizType:[],
//sex: [{id:'1',name:''},{id:'2',name:''}]
},// params={categoryId:'all',itemCodes:['sex']} {sex: [{id:'1',name:''},{id:'2',name:''}]}
addFormVisible: false,//xmWorkload
@ -114,6 +142,11 @@
},
maxTableHeight:300,
sbillVisible:false,
taskDetailVisible:false,
bugDetailVisible:false,
caseDetailVisible:false,
planCaseDetailVisible:false,
menuDetailVisible:false,
}
},//end data
methods: {
@ -352,6 +385,19 @@
this.$notify({position:'bottom-left',showClose:true, message: tips.msg, type: tips.isOk?'success':'error'});
}).catch( err => this.load.edit=false );
},
openDialog(row){
if(row.bizType=='1'){
this.taskDetailVisible=true
}else if(row.bizType=='2'){
this.bugDetailVisible=true
}else if(this.bizType=='3'){
this.caseDetailVisible=true
}else if(this.bizType=='4'){
this.planCaseDetailVisible=true
}else if(this.bizType=='5'){
this.menuDetailVisible=true
}
}
},//end methods
mounted() {

Loading…
Cancel
Save