This commit is contained in:
陈裕财
2025-04-07 02:39:50 +08:00
parent 69dd66470d
commit 6ca18596ef
3 changed files with 12 additions and 36 deletions

View File

@@ -242,6 +242,7 @@ export default {
}else{
this.editForm.ktype=ktype+''
}
this.editForm.projectId=this.parent.projectId
}else{
this.editForm.parentId='0'
this.editForm.ktype='1'

View File

@@ -13,14 +13,14 @@
<mdp-table-configs :column-configs="columnConfigs" v-model="checkedColumns"/>
<el-button type="success" ref="kanbanBtn" plain @click="openKanban('kanbanDlg')" title="看板">板</el-button>
<span v-if="currOpType=='mng'">
<el-button :disabled="disBtn('addBtn') || !checkBtnQx('addBtn',menuDefId) " type="primary" @click="showAdd()" icon="plus" plain />
<el-button :disabled="disBtn('addBtn') || !checkBtnQx('addBtn',menuDefId) " type="primary" @click="showAddSub(parent)" icon="plus" plain />
<el-button :disabled="disBtn('delBtn') || !checkBtnQx('delBtn',menuDefId) || this.sels.length===0 || load.del==true" type="danger" v-loading="load.del" @click="batchDel" icon="delete" plain />
</span>
<span v-else-if="currOpType=='select' && this.multiple==true">
<el-button :disabled="disBtn('selectBtn') || this.sels.length===0" type="primary" @click="selectListConfirm" icon="check" plain />
</span>
<mdp-select-dept v-model="filters.deptid"/>
<xm-project-select v-if="!projectInfo?.id" v-model="filters.projectId" :collectId="xmCollect?.id" @change2="(p)=>project=p"/>
<xm-project-select v-if="!projectInfo?.id" v-model="filters.projectId" :collectId="xmCollect?.id" @change2="(p)=>project=p" @clear="()=>project=null"/>
<xm-user-select v-model="filters.kselfUserid" placeholder="负责人" :sel-project="project"/>
</el-space>
@@ -187,7 +187,7 @@
</mdp-lr-box>
<!--新增修改明细 XmKpi 项目或任务关键指标考核界面-->
<mdp-dialog ref="formDlg" :title="menuDefName" width="80%">
<mdp-dialog ref="formDlg" :title="menuDefName" fullscreen>
<template v-slot="{visible,data}">
<XmKpiForm ref="XmKpiForm" :xm-project="projectInfo" :parentKpi="data.parentKpi" :someOpen="true" :visible="visible" :parentOpType="currOpType" :subOpType="data.subOpType" :formData="data.formData" @close="onFormClose" @submit="afterFormSubmit" @edit-fields="afterEditFields"/>
</template>

View File

@@ -25,15 +25,13 @@
>
<template #topToolbar>
<mdp-select-dept :width="'120px'" v-model="filters.deptid" v-if="!selProject?.id"/>
<xm-project-select :width="'120px'" :isTpl="isTpl"
<xm-project-select :width="'120px'" :isTpl="isTpl" :displayLoad="true"
v-model="filters.projectId" :collect-id="xmCollect?.id"
v-if="!selProject || !selProject.id"
ref="xmProjectSelect1"
:link-iteration-id="xmIteration?xmIteration.id:null" :link-product-id="xmProduct?xmProduct.id:null"
@change3="onProjectSelected"
ref="xmProjectSelect1"
@change3="onProjectSelected"
@clear="onProjectClearSelect"
:clearable="(xmCollect?.id)||(!clearable?false:true)"
:clearable="true"
/>
</template>
<template #nodeName="{ data }">
@@ -51,7 +49,7 @@
v-model="data.kstatus"
disabled
/><span :style="{ borderRadius: '30px', color: data.initRate >= 100 ? 'green' : 'blue' }"
>{{ formatRate(data.initRate || 0) }}% </span
>{{ formatRate(data.score || 0) }}% </span
>
<div> {{ "(" + (data.childrenCnt||0) +")" }} {{ data.kpiName }}</div>
</el-space>
@@ -89,7 +87,6 @@
:visible="visible"
:parent-kpi="data.parentKpi"
:formData="data.formData"
:xm-product="xmProduct"
:xm-project="project"
subOpType="add"
@cancel="dialog.close()"
@@ -135,7 +132,7 @@ import XmKpiByDict from './XmKpiByDict.vue'
const XmKpiTreeMap = new Map()
export default {
props: ['xmCollect','selProject', 'xmProduct', 'subOpType','multiple','showConfirm','hidden','params','projectRequired','clearable','isTpl'],
props: ['xmCollect','selProject', 'subOpType','multiple','showConfirm','hidden','params','projectRequired','clearable','isTpl'],
emits:['importTemplate', 'checkChange', 'projectSelect', 'projectClear','','addTopNode','importTop','importSub','editNode','addSubNode','changePid','confirm','nodeClick'],
computed: {
@@ -157,14 +154,9 @@ export default {
return hidden
},
projectKey(){
return this.xmCollect?.id+'-'+this.xmProduct?.id+'-project-select-id'
return this.xmCollect?.id+'-'+this.selProject?.id+'-project-select-id'
}
},
watch: {
xmProduct: function () {
this.$refs.nodeTree.refresh()
},
},
},
data() {
return {
load:{init:false},
@@ -305,30 +297,13 @@ export default {
if (parent && parent.id) {
formData.projectName = parent.projectName
formData.projectId = parent.projectId
if (this.project && parent.projectId == this.project.id) {
formData.projectName = this.project.kpiName
}
} else {
if(this.selProject && this.selProject.id){
formData.projectId = this.selProject.id
formData.projectName = this.selProject.kpiName
}else if (this.project && this.project?.id) {
formData.projectId = this.project.id
formData.projectName = this.project.kpiName
} else {
this.$notify({
position: 'bottom-left',
showClose: true,
message: '请先选择一个项目',
type: 'warning'
})
return false
}
}
if(this.xmProduct && this.xmProduct.id){
formData.productId=this.xmProduct.id
formData.productName=this.xmProduct.productName
}
return true
},