|
@@ -32,12 +32,12 @@
|
|
|
<span v-else>{{row.planTarget}}</span>
|
|
|
</template>
|
|
|
<template #key7="{row,index}">
|
|
|
- <HcDatePicker :dates="row?.betweenTime" @change="betweenTimeUpdate($event,row)" v-if="row.isEdit"/>
|
|
|
+ <HcDatePicker :dates="[row.planStartTime,row.planEndTime]" @change="betweenTimeUpdate($event,row)" v-if="row.isEdit"/>
|
|
|
<!-- <span v-else>{{row.key7}}</span> -->
|
|
|
<span v-else>
|
|
|
- <span >{{row.planStartDate?row.planStartDate:''}}</span>
|
|
|
- <span v-if="row.planStartDate">~</span>
|
|
|
- <span >{{row.planStartDate?row.planStartDate:''}}</span>
|
|
|
+ <span >{{row.planStartTime?row.planStartTime:''}}</span>
|
|
|
+ <span v-if="row.planEndTime">~</span>
|
|
|
+ <span >{{row.planEndTime?row.planEndTime:''}}</span>
|
|
|
</span>
|
|
|
|
|
|
|
|
@@ -62,7 +62,7 @@
|
|
|
<HcIcon name="arrow-go-back"/>
|
|
|
<span>取消并返回</span>
|
|
|
</el-button>
|
|
|
- <el-button size="large" type="primary" hc-btn>
|
|
|
+ <el-button size="large" type="primary" hc-btn @click="saveClick" :loading="saveLoaing">
|
|
|
<HcIcon name="check-double"/>
|
|
|
<span>提交保存</span>
|
|
|
</el-button>
|
|
@@ -110,8 +110,8 @@
|
|
|
<HcDialog bgColor="#ffffff" isToBody isTable :footer="false" :show="relatedModal" title="关联回款里程碑" widths="70%" @close="relatedCloseClick">
|
|
|
<HcTable :column="tableRelatedColumn" :datas="tableRelatedData">
|
|
|
<template #action="{row,index}">
|
|
|
- <el-button size="small" type="success" v-if="row.relevance" @click="row.relevance = false">取消关联</el-button>
|
|
|
- <el-button size="small" type="primary" v-else @click="row.relevance = true">关联</el-button>
|
|
|
+ <el-button size="small" type="success" v-if="row.isRelation==1" @click="relation(row,0)">取消关联</el-button>
|
|
|
+ <el-button size="small" type="primary" v-else @click="relation(row,1)">关联</el-button>
|
|
|
</template>
|
|
|
</HcTable>
|
|
|
</HcDialog>
|
|
@@ -177,8 +177,23 @@ const tabTab = ref([
|
|
|
{key: 'supervision', name: '监理单位成本'},
|
|
|
{key: 'build', name: '建设单位成本'}
|
|
|
]);
|
|
|
+const originTableData=ref([ {}])
|
|
|
+
|
|
|
const tabChange = ({key}) => {
|
|
|
tabKey.value = key
|
|
|
+ console.log(tableData.value,'tableData.value');
|
|
|
+ if(key=='supervision'){
|
|
|
+ tableData.value=supervisorUnitData.value.length>0?supervisorUnitData.value:originTableData.value
|
|
|
+ detailData.value.supervisorUnit=tableData.value
|
|
|
+ }else if(key=='construction'){
|
|
|
+ tableData.value=constructionData.value.length>0?constructionData.value:originTableData.value
|
|
|
+ detailData.value.constructUnit=tableData.value
|
|
|
+
|
|
|
+ }else if(key=='bulid'){
|
|
|
+ console.log(buildData.value,'=buildData.value');
|
|
|
+ tableData.value=buildData.value.length>0?buildData.value:originTableData.value
|
|
|
+ detailData.value.buildUnit=tableData.value
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const radioType = ref('')
|
|
@@ -243,10 +258,8 @@ const tableRowStyle = ({row, rowIndex}) => {
|
|
|
//日期时间被选择
|
|
|
const betweenTime = ref(null)
|
|
|
const betweenTimeUpdate = ({arr, query},item) => {
|
|
|
- betweenTime.value = arr
|
|
|
- betweenTime.value = arr
|
|
|
- item.planStartDate=arr[0]
|
|
|
- item.planEndtDate=arr[1]
|
|
|
+ item.planStartTime=arr[0]
|
|
|
+ item.planEndTime=arr[1]
|
|
|
item.betweenTime=arr
|
|
|
}
|
|
|
//日期时间被选择
|
|
@@ -259,10 +272,13 @@ const subbetweenTimeUpdate = ({arr, query},item) => {
|
|
|
}
|
|
|
|
|
|
const subplanModal = ref(false)
|
|
|
+const subPlanItem=ref({})
|
|
|
const subplanModalShow = (row) => {
|
|
|
console.log(row,'row');
|
|
|
+ subPlanItem.value=row
|
|
|
subplanModal.value = true
|
|
|
tableSubplanData.value=row?.childrenList||[]
|
|
|
+
|
|
|
}
|
|
|
//表格
|
|
|
const tableSubplanColumn = [
|
|
@@ -287,17 +303,39 @@ const tableSubplanData = ref([
|
|
|
const subplanCloseClick = () => {
|
|
|
subplanModal.value = false
|
|
|
}
|
|
|
-
|
|
|
+//分解子计划保存
|
|
|
const subplanSaveClick = () => {
|
|
|
+ tableData.value.forEach((ele)=>{
|
|
|
+ if(ele.id==subPlanItem.id){
|
|
|
+ ele.childrenList=tableSubplanData.value
|
|
|
+ }
|
|
|
+ })
|
|
|
+ subplanModal.value = false
|
|
|
+ // subPlanItem.value.childrenList=tableSubplanData.value
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const relatedModal = ref(false)
|
|
|
+const rePlanid=ref('')
|
|
|
const relatedModalShow = (row) => {
|
|
|
relatedModal.value = true
|
|
|
+ rePlanid.value=row.id
|
|
|
getListByProjectId(row.projectId)
|
|
|
+
|
|
|
+}
|
|
|
+//关联回款
|
|
|
+const relation=async(row,type)=>{
|
|
|
+ const {error, code, data,msg} = await projectApi.relationPlanAndReturned( {
|
|
|
+ planId:rePlanid.value,
|
|
|
+ returnedId:row.id,
|
|
|
+ type
|
|
|
+ })
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window.$message.success(msg)
|
|
|
+ getListByProjectId(row.projectId).then()
|
|
|
+ }
|
|
|
}
|
|
|
//表格
|
|
|
const tableRelatedColumn = [
|
|
@@ -317,8 +355,8 @@ const tableRelatedData = ref([
|
|
|
])
|
|
|
//合同里程碑
|
|
|
|
|
|
-const getListByProjectId=async(projectId)=>{
|
|
|
- const {error, code, data} = await contractApi.getListByProjectId({projectId})
|
|
|
+const getListByProjectId=async(projectId,planId)=>{
|
|
|
+ const {error, code, data} = await contractApi.getListByProjectId({projectId,planId:rePlanid.value})
|
|
|
if (!error && code === 200) {
|
|
|
tableRelatedData.value=getArrValue(data)
|
|
|
|
|
@@ -331,7 +369,25 @@ const getListByProjectId=async(projectId)=>{
|
|
|
const relatedCloseClick = () => {
|
|
|
relatedModal.value = false
|
|
|
}
|
|
|
+//修改合同
|
|
|
+const updatePlan=async(obj)=>{
|
|
|
+ console.log(obj,'编辑');
|
|
|
+ saveLoaing.value=true;
|
|
|
+ const {error, code, data,msg} = await projectApi.updatePlan( obj)
|
|
|
+ saveLoaing.value=false;
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window.$message.success(msg)
|
|
|
+ getPlanByProjectId()
|
|
|
+ }
|
|
|
|
|
|
+}
|
|
|
+//批量保存
|
|
|
+const saveLoaing=ref(false)
|
|
|
+const saveClick = () => {
|
|
|
+ console.log(tableData.value,'tableData.value');
|
|
|
+ console.log( detailData.value,' detailData.value');
|
|
|
+ updatePlan(detailData.value)
|
|
|
+}
|
|
|
//取消并返回
|
|
|
const goBackClick = () => {
|
|
|
router.back()
|