|
@@ -345,7 +345,7 @@ import { useRoute, useRouter } from 'vue-router'
|
|
|
import { onActivated, ref, watch } from 'vue'
|
|
|
import projectApi from '~api/program/project.js'
|
|
|
import contractApi from '~api/project/project-contract.js'
|
|
|
-import { getArrValue, getObjValue } from 'js-fast-way'
|
|
|
+import { deepClone, getArrValue, getObjValue } from 'js-fast-way'
|
|
|
import { getTaskType, getuserList } from '~api/other'
|
|
|
import { useAppStore } from '~src/store'
|
|
|
const useAppState = useAppStore()
|
|
@@ -537,10 +537,10 @@ const subbetweenTimeUpdate = ({ arr }, item) => {
|
|
|
const subplanModal = ref(false)
|
|
|
const subPlanItem = ref({})
|
|
|
const subplanModalShow = (row) => {
|
|
|
- console.log(row, 'row')
|
|
|
- subPlanItem.value = row
|
|
|
+ const rows = deepClone(row)
|
|
|
+ subPlanItem.value = rows
|
|
|
subplanModal.value = true
|
|
|
- tableSubplanData.value = row?.childrenList || []
|
|
|
+ tableSubplanData.value = getArrValue(rows?.childrenList)
|
|
|
|
|
|
}
|
|
|
//表格
|
|
@@ -560,17 +560,7 @@ const tableSubplanData = ref([
|
|
|
])
|
|
|
|
|
|
const subplanCloseClick = () => {
|
|
|
- const arr = tableSubplanData.value
|
|
|
- for (let i = arr.length - 1; i >= 0; i--) {
|
|
|
- if (!arr[i].planTaskType || !arr[i].planTaskDesc || !arr[i].planTarget || !arr[i].planStartTime || !arr[i].planEndTime || !arr[i].planDays) {
|
|
|
- arr.splice(i, 1)
|
|
|
- }
|
|
|
- }
|
|
|
- // tableSubplanData.value = tableSubplanData.value.filter((item)=>Number(item?.planDays) < 30)
|
|
|
- // subPlanItem.value.childrenList = tableSubplanData.value.filter((item)=>Number(item?.planDays) < 30)
|
|
|
subplanModal.value = false
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
const addplan = ()=>{
|
|
@@ -578,7 +568,7 @@ const addplan = ()=>{
|
|
|
projectProcessValue:subPlanItem.value?.projectProcessValue,
|
|
|
budgetTypeValue:subPlanItem.value?.budgetTypeValue,
|
|
|
taskDetailValue:subPlanItem.value?.taskDetailValue,
|
|
|
- planTaskType:subPlanItem.value?.planTaskType,
|
|
|
+ planTaskTypeValue:subPlanItem.value?.planTaskTypeValue,
|
|
|
isEdit:false,
|
|
|
|
|
|
|
|
@@ -614,6 +604,9 @@ const getWorkDays = async (row)=>{
|
|
|
})
|
|
|
if (!error && code === 200) {
|
|
|
row.planDays = data
|
|
|
+ } else {
|
|
|
+ row.planStartTime = ''
|
|
|
+ row.planEndTime = ''
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -654,7 +647,6 @@ const updateMainPlanClick = async (row)=>{
|
|
|
const updateChildPlanLoading = ref(false)
|
|
|
//编辑子计划传入父级
|
|
|
const updateChildPlanClick = async ()=>{
|
|
|
- // subPlanItem.value.childrenList = tableSubplanData.value
|
|
|
updateChildPlanLoading.value = true
|
|
|
const { error, code, data, msg } = await projectApi.updateChildrenPlan(
|
|
|
subPlanItem.value,
|