|
@@ -236,7 +236,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<template #action="{row,index}">
|
|
<template #action="{row,index}">
|
|
- <el-button size="small" type="success" v-if="row.isEdit" @click="getWorkDays(row)">保存</el-button>
|
|
|
|
|
|
+ <el-button size="small" type="success" v-if="row.isEdit" @click="updateMainPlanClick(row)">保存</el-button>
|
|
<el-button size="small" type="primary" v-else @click="row.isEdit = true" :disabled="row?.isShowEdit===0">编辑</el-button>
|
|
<el-button size="small" type="primary" v-else @click="row.isEdit = true" :disabled="row?.isShowEdit===0">编辑</el-button>
|
|
<el-button size="small" type="warning" @click="relatedModalShow(row)">关联回款</el-button>
|
|
<el-button size="small" type="warning" @click="relatedModalShow(row)">关联回款</el-button>
|
|
<el-button size="small" type="danger" @click="subplanModalShow(row)" :disabled="row?.isShowChildren==0">分解子计划</el-button>
|
|
<el-button size="small" type="danger" @click="subplanModalShow(row)" :disabled="row?.isShowChildren==0">分解子计划</el-button>
|
|
@@ -259,37 +259,37 @@
|
|
saveText="保存"
|
|
saveText="保存"
|
|
:show="subplanModal"
|
|
:show="subplanModal"
|
|
@close="subplanCloseClick"
|
|
@close="subplanCloseClick"
|
|
- @save="subplanSaveClick"
|
|
|
|
|
|
+ @save="updateChildPlanClick"
|
|
|
|
+
|
|
>
|
|
>
|
|
<template #extra>
|
|
<template #extra>
|
|
<el-button size="large" type="primary" @click="addplan">新增</el-button>
|
|
<el-button size="large" type="primary" @click="addplan">新增</el-button>
|
|
</template>
|
|
</template>
|
|
<HcTable :isIndex="false" :column="tableSubplanColumn" :datas="tableSubplanData">
|
|
<HcTable :isIndex="false" :column="tableSubplanColumn" :datas="tableSubplanData">
|
|
<template #planTaskType="{row,index}">
|
|
<template #planTaskType="{row,index}">
|
|
- <el-select v-model="row.planTaskType" :disabled="!row.isEdit" clearable>
|
|
|
|
|
|
+ <el-select v-model="row.planTaskType" clearable>
|
|
<el-option v-for="item in taskTypeList" :label="item.dictName" :value="item.id"/>
|
|
<el-option v-for="item in taskTypeList" :label="item.dictName" :value="item.id"/>
|
|
</el-select>
|
|
</el-select>
|
|
</template>
|
|
</template>
|
|
<template #planTaskDesc="{row,index}">
|
|
<template #planTaskDesc="{row,index}">
|
|
- <el-input v-model="row.planTaskDesc" :disabled="!row.isEdit" clearable/>
|
|
|
|
|
|
+ <el-input v-model="row.planTaskDesc" clearable/>
|
|
</template>
|
|
</template>
|
|
<template #planTarget="{row,index}">
|
|
<template #planTarget="{row,index}">
|
|
- <el-input v-model="row.planTarget" :disabled="!row.isEdit" clearable/>
|
|
|
|
|
|
+ <el-input v-model="row.planTarget" clearable/>
|
|
</template>
|
|
</template>
|
|
<template #key7="{row,index}">
|
|
<template #key7="{row,index}">
|
|
- <HcDatePicker :dates="[row.planStartTime,row.planEndTime]" @change="subbetweenTimeUpdate($event,row)" :disabled="!row.isEdit" clearable/>
|
|
|
|
|
|
+ <HcDatePicker :dates="[row.planStartTime,row.planEndTime]" @change="subbetweenTimeUpdate($event,row)" clearable/>
|
|
|
|
|
|
</template>
|
|
</template>
|
|
<template #planDays="{row,index}" >
|
|
<template #planDays="{row,index}" >
|
|
- <!-- <el-input v-model="row.planDays" disabled/> -->
|
|
|
|
- <el-input v-model="row.planDays" disabled clearable/>
|
|
|
|
|
|
+
|
|
|
|
+ <el-input v-model="row.planDays" disabled clearable />
|
|
|
|
+
|
|
</template>
|
|
</template>
|
|
<template #key9="{row,index}">
|
|
<template #key9="{row,index}">
|
|
<el-input v-model="row.key9" clearable/>
|
|
<el-input v-model="row.key9" clearable/>
|
|
</template>
|
|
</template>
|
|
<template #action="{row,index}">
|
|
<template #action="{row,index}">
|
|
- <el-button size="small" type="success" v-if="row.isEdit" @click="getWorkDays(row)">保存</el-button>
|
|
|
|
- <el-button size="small" type="primary" v-else @click="row.isEdit = true" :disabled="row?.isShowEdit===0">编辑</el-button>
|
|
|
|
<el-button size="small" type="primary" @click="delSubplan(row,index)">删除</el-button>
|
|
<el-button size="small" type="primary" @click="delSubplan(row,index)">删除</el-button>
|
|
</template>
|
|
</template>
|
|
</HcTable>
|
|
</HcTable>
|
|
@@ -558,28 +558,64 @@ const relatedModalShow = (row) => {
|
|
}
|
|
}
|
|
//保存获取工作时长
|
|
//保存获取工作时长
|
|
const getWorkDays=async(row)=>{
|
|
const getWorkDays=async(row)=>{
|
|
|
|
+
|
|
|
|
+ if(row?.planStartTime&&row?.planEndTime){
|
|
|
|
+ const {error, code, data,msg} = await projectApi.getWorkDays( {
|
|
|
|
+ startDate:row.planStartTime,
|
|
|
|
+ endDate:row.planEndTime,
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ if(data){
|
|
|
|
+ row.planDays=data
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+//编辑主计划
|
|
|
|
+const updateMainPlanClick=async(row)=>{
|
|
row.isEdit = false
|
|
row.isEdit = false
|
|
- //获取任务类型
|
|
|
|
const {planTaskType}=row
|
|
const {planTaskType}=row
|
|
taskTypeList.value.forEach((ele)=>{
|
|
taskTypeList.value.forEach((ele)=>{
|
|
if(ele.id===planTaskType){
|
|
if(ele.id===planTaskType){
|
|
row.planTaskTypeValue=ele.dictName
|
|
row.planTaskTypeValue=ele.dictName
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- if(row?.planStartTime&&row?.planEndTime){
|
|
|
|
- const {error, code, data,msg} = await projectApi.getWorkDays( {
|
|
|
|
- startDate:row.planStartTime,
|
|
|
|
- endDate:row.planEndTime,
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
- if (!error && code === 200) {
|
|
|
|
- if(data){
|
|
|
|
- row.planDays=data
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ console.log(tableData.value,'tableData');
|
|
|
|
+ const {error, code, data,msg} = await projectApi.updateMainPlan(
|
|
|
|
+ row
|
|
|
|
+ )
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ if(data){
|
|
|
|
+ row=getObjValue(data)
|
|
|
|
+ console.log(data,'data');
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+//编辑子计划传入父级
|
|
|
|
+const updateChildPlanClick=async()=>{
|
|
|
|
+ subPlanItem.value.childrenList=tableSubplanData.value
|
|
|
|
+
|
|
|
|
+ const {error, code, data,msg} = await projectApi.updateMainPlan(
|
|
|
|
+ subPlanItem.value,
|
|
|
|
+ )
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+
|
|
|
|
+ window.$message.success(msg)
|
|
|
|
+ tableData.value.forEach((ele)=>{
|
|
|
|
+ if(ele.id==subPlanItem.value.id){
|
|
|
|
+ ele.childrenList=tableSubplanData.value
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ subplanModal.value = false
|
|
|
|
+
|
|
}
|
|
}
|
|
//关联回款
|
|
//关联回款
|
|
const relation=async(row,type)=>{
|
|
const relation=async(row,type)=>{
|