Quellcode durchsuchen

部门计划预算修改

duy vor 2 Jahren
Ursprung
Commit
2e2dc1f361

+ 36 - 0
src/api/modules/program/project.js

@@ -0,0 +1,36 @@
+import {httpApi} from "../../request/httpApi";
+
+export default {
+    //分页获取计划列表
+    async getPage(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-control/projectCostBudget/page',
+            method: 'get',
+            params: form
+        }, msg);
+    },
+    //单个详情
+    async getPlanByProjectId(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-control/projectCostBudget/getPlanByProjectId',
+            method: 'get',
+            params: form
+        }, msg);
+    },
+    //新增年度经营预算
+    async addAnnualBudget(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-control/annualBudget/addAnnualBudget',
+            method: 'post',
+            data: form
+        }, msg);
+    },
+    //编辑
+    async updateAnnualBudget(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-control/annualBudget/updateAnnualBudget',
+            method: 'post',
+            data: form
+        }, msg);
+    },
+}

+ 20 - 0
src/api/modules/program/section.js

@@ -0,0 +1,20 @@
+import {httpApi} from "../../request/httpApi";
+
+export default {
+    //分页获取计划列表
+    async getPage(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-control/departmentMonthPlan/getPage',
+            method: 'get',
+            params: form
+        }, msg);
+    },
+ //获取部门列表/blade-control/departmentMonthPlan/getDepartmentDict
+    async getDepartmentDict(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-control/departmentMonthPlan/getDepartmentDict',
+            method: 'get',
+            params: form
+        }, msg);
+    },
+}

+ 9 - 1
src/api/modules/project/project-contract.js

@@ -33,13 +33,21 @@ export default {
             params: form
         }, msg);
     },
-    //获取合同回款里程碑
+    //获取合同回款里程碑根据合同id
     async getListByContractId(form, msg = true) {
         return httpApi({
             url: '/api/blade-control/contractReturnedInfo/getListByContractId',
             method: 'get',
             params: form
         }, msg);
+    },
+    //获取合同回款里程碑根据项目id
+    async getListByProjectId(form, msg = true) {
+        return httpApi({
+            url: '/api//blade-control/contractReturnedInfo/getListByProjectId',
+            method: 'get',
+            params: form
+        }, msg);
     },
       //新增合同
     async addContractInfo(form, msg = true) {

+ 1 - 1
src/router/modules/base.js

@@ -29,7 +29,7 @@ export default [
             {
                 path: '/home/admin',
                 name: 'home-admin',
-                meta: {title: '领导权限', isAuth: true},
+                meta: {title: '领导权限'},
                 component: () => import('~src/views/home/index/admin.vue')
             },
             //审批管理

+ 162 - 64
src/views/program/project/form.vue

@@ -1,52 +1,59 @@
 <template>
-    <HcCard actionUi="text-center" title="焦作至唐河高速公路方城至唐河段">
+    <HcCard actionUi="text-center" :title="detailData?.projectName">
         <template #extra>
             <HcNewSwitch :datas="tabTab" :keys="tabKey" @change="tabChange" :round="false"/>
         </template>
         <template #search>
             <div class="hc-program-project-form-radio-group">
                 <el-radio-group v-model="radioType" size="large">
-                    <el-radio-button label="key1">市场部</el-radio-button>
-                    <el-radio-button label="key2">实施部</el-radio-button>
-                    <el-radio-button label="key3">研发部</el-radio-button>
-                    <el-radio-button label="key4">维护部</el-radio-button>
-                    <el-radio-button label="key5">管理支出</el-radio-button>
-                    <el-radio-button label="key6">外包劳务</el-radio-button>
+                    <el-radio-button label="1">市场部</el-radio-button>
+                    <el-radio-button label="2">实施部</el-radio-button>
+                    <el-radio-button label="3">研发部</el-radio-button>
+                    <el-radio-button label="4">维护部</el-radio-button>
+                    <el-radio-button label="5">管理支出</el-radio-button>
+                    <el-radio-button label="6">外包劳务</el-radio-button>
                 </el-radio-group>
             </div>
         </template>
         <HcTable :isIndex="false" :column="tableColumn" :datas="tableData" :row-style="tableRowStyle">
-            <template #key4="{row,index}">
-                <el-select v-model="row.key4" v-if="row.isEdit">
+            <template #planTaskType="{row,index}">
+                <el-select v-model="row.planTaskType" v-if="row.isEdit">
                     <el-option label="选项1" value="选项1"/>
                     <el-option label="选项2" value="选项2"/>
                 </el-select>
-                <span v-else>{{row.key4}}</span>
+                <span v-else>{{row.planTaskType}}</span>
             </template>
-            <template #key5="{row,index}">
-                <el-input v-model="row.key5" v-if="row.isEdit"/>
-                <span v-else>{{row.key5}}</span>
+            <template #planTaskDesc="{row,index}">
+                <el-input v-model="row.planTaskDesc" v-if="row.isEdit"/>
+                <span v-else>{{row.planTaskDesc}}</span>
             </template>
-            <template #key6="{row,index}">
-                <el-input v-model="row.key6" v-if="row.isEdit"/>
-                <span v-else>{{row.key6}}</span>
+            <template #planTarget="{row,index}">
+                <el-input v-model="row.planTarget" v-if="row.isEdit"/>
+                <span v-else>{{row.planTarget}}</span>
             </template>
             <template #key7="{row,index}">
-                <HcDatePicker :dates="betweenTime" @change="betweenTimeUpdate" v-if="row.isEdit"/>
-                <span v-else>{{row.key7}}</span>
+                <HcDatePicker :dates="row?.betweenTime" @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>
+             
+      
             </template>
-            <template #key8="{row,index}">
-                <el-input v-model="row.key8" v-if="row.isEdit"/>
-                <span v-else>{{row.key8}}</span>
+            <template #planDays="{row,index}">
+                <el-input v-model="row.planDays" v-if="row.isEdit"/>
+                <span v-else>{{row.planDays}}</span>
             </template>
-            <template #key9="{row,index}">
+            <!-- <template #key9="{row,index}">
                 <el-input v-model="row.key9" v-if="row.isEdit"/>
                 <span v-else>{{row.key9}}</span>
-            </template>
+            </template> -->
             <template #action="{row,index}">
                 <el-button size="small" type="success" v-if="row.isEdit" @click="row.isEdit = false">保存</el-button>
                 <el-button size="small" type="primary" v-else @click="row.isEdit = true">编辑</el-button>
-                <el-button size="small" type="warning" @click="relatedModalShow">关联回款</el-button>
+                <el-button size="small" type="warning" @click="relatedModalShow(row)">关联回款</el-button>
                 <el-button size="small" type="danger" @click="subplanModalShow(row)">分解子计划</el-button>
             </template>
         </HcTable>
@@ -70,23 +77,28 @@
                   @save="subplanSaveClick"
         >
             <HcTable :isIndex="false" :column="tableSubplanColumn" :datas="tableSubplanData">
-                <template #key4="{row,index}">
-                    <el-select v-model="row.key4">
+                <template #planTaskType="{row,index}">
+                    <el-select v-model="row.planTaskType">
                         <el-option label="选项1" value="选项1"/>
                         <el-option label="选项2" value="选项2"/>
                     </el-select>
                 </template>
-                <template #key5="{row,index}">
-                    <el-input v-model="row.key5"/>
+                <template #planTaskDesc="{row,index}">
+                    <el-input v-model="row.planTaskDesc"/>
                 </template>
-                <template #key6="{row,index}">
-                    <el-input v-model="row.key6"/>
+                <template #planTarget="{row,index}">
+                    <el-input v-model="row.planTarget"/>
                 </template>
                 <template #key7="{row,index}">
-                    <HcDatePicker :dates="betweenTime" @change="betweenTimeUpdate"/>
+                    <HcDatePicker :dates="[row.planStartTime,row.planEndTime]" @change="subbetweenTimeUpdate($event,row)" v-if="true"/>
+                    <span v-else>
+                        <span >{{row.planStartTime?row.planStartTime:''}}</span>
+                        <span  v-if="row.planEndTime">~</span>
+                        <span >{{row.planEndTime?row.planEndTime:''}}</span>
+                    </span>
                 </template>
-                <template #key8="{row,index}">
-                    <el-input v-model="row.key8"/>
+                <template #planDays="{row,index}">
+                    <el-input v-model="row.planDays"/>
                 </template>
                 <template #key9="{row,index}">
                     <el-input v-model="row.key9"/>
@@ -108,13 +120,58 @@
 </template>
 
 <script setup>
-import {ref} from "vue";
-import {useRouter} from 'vue-router'
 
+import {useRouter, useRoute} 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"
+
+//初始变量
 const router = useRouter()
+const useRoutes = useRoute()
+const dataId = ref(useRoutes?.query?.id ?? '')
+const dataType = ref(useRoutes?.query?.type ?? '')
+//缓存页面被激活时
+onActivated(() => {
+    dataId.value = useRoutes?.query?.id ?? ''
+    dataType.value = useRoutes?.query?.type ?? ''
+   
+    if(dataType.value!=='add'){
+        getPlanByProjectId()
+    
+    }else if(dataType.value=='add'){
+  
+    }
+
+ 
+})
+
+const detailData=ref({})
+const constructionData=ref([])
+const buildData=ref([])
+const supervisorUnitData=ref([])
+//获取详情
+const getPlanByProjectId=async()=>{
+    const {error, code, data} = await projectApi.getPlanByProjectId({id: dataId.value})
+    if (!error && code === 200) {
+        console.log(getObjValue(data),'详情');
+        detailData.value=getObjValue(data)
+        constructionData.value=detailData.value?.constructUnit||[]
+        buildData.value=detailData.value?.buildDatatUnit||[]
+        supervisorUnitData.value=detailData.value?.supervisorUnit||[]
+        tabKey.value='construction'
+        radioType.value=1
+     
+        // milestoneData.value=getArrValue(data)
+       
 
+    } else {
+        // milestoneData.value=[]
+    }
+}
 //类型tab数据和相关处理
-const tabKey = ref('construction')
+const tabKey = ref('')
 const tabTab = ref([
     {key: 'construction', name: '施工单位成本'},
     {key: 'supervision', name: '监理单位成本'},
@@ -124,22 +181,37 @@ const tabChange = ({key}) => {
     tabKey.value = key
 }
 
-const radioType = ref('key1')
-
-
+const radioType = ref('')
+//深度监听
+watch(() => [
+radioType.value,
+tabKey.value
+], ([radioType]) => {
+    console.log(radioType,'radioType');
+    if(tabKey.value==='construction'){
+        console.log(constructionData.value[radioType],'constructionData.value');
+        tableData.value=constructionData.value[radioType]
+    }else if(tabKey.value==='build'){
+        console.log(buildData.value[radioType],'buildData.value');
+        tableData.value=buildData.value[radioType]
+    }else if(tabKey.value==='supervision'){
+        console.log(supervisorUnitData.value[radioType],'supervisorUnitData.value');
+        tableData.value=supervisorUnitData.value[radioType]
+    }
+}, {deep: true})
 //表格
 const tableColumn = [
-    {key: 'key1', name: '项目环节', width: '160', align: 'center'},
-    {key: 'key2', name: '预算类型', width: '160', align: 'center'},
-    {key: 'key3', name: '任务明细', width: '160', align: 'center'},
-    {key: 'key4', name: '任务类型', width: '160',  align: 'center'},
-    {key: 'key5', name: '任务描述', minWidth: '200',  align: 'center', isTooltip: true},
-    {key: 'key6', name: '完成指标', minWidth: '200', align: 'center', isTooltip: true},
+    {key: 'projectProcessValue', name: '项目环节', width: '160', align: 'center'},
+    {key: 'budgetTypeValue', name: '预算类型', width: '160', align: 'center'},
+    {key: 'taskDetailValue', name: '任务明细', width: '160', align: 'center'},
+    {key: 'planTaskType', name: '任务类型', width: '160',  align: 'center'},
+    {key: 'planTaskDesc', name: '任务描述', minWidth: '200',  align: 'center', isTooltip: true},
+    {key: 'planTarget', name: '完成指标', minWidth: '200', align: 'center', isTooltip: true},
     {key: 'key7', name: '计划起止日期', width: '280', align: 'center'},
-    {key: 'key8', name: '预计工作量(小数/整数/天)', width: '160', align: 'center'},
-    {key: 'key9', name: '投入岗位类型(日单价)', width: '160', align: 'center'},
-    {key: 'key10', name: '投入人员数量', width: '160', align: 'center'},
-    {key: 'key11', name: '关联回款里程碑', minWidth: '200', isTooltip: true},
+    {key: 'planDays', name: '预计工作量(小数/整数/天)', width: '160', align: 'center'},
+    {key: 'postType', name: '投入岗位类型(日单价)', width: '160', align: 'center'},
+    {key: 'staffCount', name: '投入人员数量', width: '160', align: 'center'},
+    {key: 'returnedValue', name: '关联回款里程碑', minWidth: '200', isTooltip: true},
     {key: 'action', name: '操作', width: '280', align: 'center', fixed: 'right'},
 ]
 const tableData = ref([
@@ -153,13 +225,13 @@ const tableData = ref([
 
 //表格行样式
 const tableRowStyle = ({row, rowIndex}) => {
-    if (row.id === 2) {
+    if (row.taskFinishedStatus === 1) {
         return {
             'background-color': '#E99D42',
             '--el-fill-color-lighter': '#E99D42',
             '--el-table-row-hover-bg-color': '#E99D42'
         }
-    } else if (row.id === 4 || row.id === 5) {
+    } else if (row.taskFinishedStatus === 2 ) {
         return {
             'background-color': '#7e9559',
             '--el-fill-color-lighter': '#7e9559',
@@ -170,25 +242,38 @@ const tableRowStyle = ({row, rowIndex}) => {
 
 //日期时间被选择
 const betweenTime = ref(null)
-const betweenTimeUpdate = ({arr, query}) => {
+const betweenTimeUpdate = ({arr, query},item) => {
+    betweenTime.value = arr
     betweenTime.value = arr
+    item.planStartDate=arr[0]
+    item.planEndtDate=arr[1]
+    item.betweenTime=arr
+}
+//日期时间被选择
+const subbetweenTime = ref(null)
+const subbetweenTimeUpdate = ({arr, query},item) => {
+    console.log(item,'item');
+    item.planStartTime=arr[0]
+    item.planEndTime=arr[1]
+    item.subbetweenTime=arr
 }
-
 
 const subplanModal = ref(false)
 const subplanModalShow = (row) => {
+    console.log(row,'row');
     subplanModal.value = true
+    tableSubplanData.value=row?.childrenList||[]
 }
 //表格
 const tableSubplanColumn = [
-    {key: 'key1', name: '项目环节', width: '160', align: 'center'},
-    {key: 'key2', name: '预算类型', width: '160', align: 'center'},
-    {key: 'key3', name: '任务明细', width: '160', align: 'center'},
-    {key: 'key4', name: '任务类型', width: '160',  align: 'center'},
-    {key: 'key5', name: '任务描述', minWidth: '200',  align: 'center', isTooltip: true},
-    {key: 'key6', name: '完成指标', minWidth: '200', align: 'center', isTooltip: true},
+    {key: 'projectProcessValue', name: '项目环节', width: '160', align: 'center'},
+    {key: 'budgetTypeValue', name: '预算类型', width: '160', align: 'center'},
+    {key: 'taskDetailValue', name: '任务明细', width: '160', align: 'center'},
+    {key: 'planTaskType', name: '任务类型', width: '160',  align: 'center'},
+    {key: 'planTaskDesc', name: '任务描述', minWidth: '200',  align: 'center', isTooltip: true},
+    {key: 'planTarget', name: '完成指标', minWidth: '200', align: 'center', isTooltip: true},
     {key: 'key7', name: '计划起止日期', width: '280', align: 'center'},
-    {key: 'key8', name: '预计工作量(小数/整数/天)', width: '160', align: 'center'},
+    {key: 'planDays', name: '预计工作量(小数/整数/天)', width: '160', align: 'center'},
 ]
 const tableSubplanData = ref([
     {id: 1, key1: 'xx', key2: 'xx', key3: 'xx', key4: 'xx', key5: 'xx', key6: 'xx', key7: 'xx', key8: 'xx', key9: 'xx', key10: 'xx'},
@@ -212,13 +297,14 @@ const subplanSaveClick = () => {
 const relatedModal = ref(false)
 const relatedModalShow = (row) => {
     relatedModal.value = true
+    getListByProjectId(row.projectId)
 }
 //表格
 const tableRelatedColumn = [
-    {key: 'key1', name: '回款条件', minWidth: '260'},
-    {key: 'key2', name: '应收回款时间', width: '160', align: 'center'},
-    {key: 'key3', name: '应收回款金额(元)', width: '160', align: 'center'},
-    {key: 'key4', name: '催款执行人', width: '160',  align: 'center'},
+    {key: 'returnedCondition', name: '回款条件', minWidth: '260'},
+    {key: 'shouldReturnedTime', name: '应收回款时间', width: '160', align: 'center'},
+    {key: 'shouldReturnedMoney', name: '应收回款金额(元)', width: '160', align: 'center'},
+    {key: 'reminderUserName', name: '催款执行人', width: '160',  align: 'center'},
     {key: 'action', name: '操作', width: '130', align: 'center'},
 ]
 const tableRelatedData = ref([
@@ -229,6 +315,18 @@ const tableRelatedData = ref([
     {id: 5, key1: 'xx', key2: 'xx', key3: 'xx', key4: 'xx', key5: 'xx', key6: 'xx', key7: 'xx', key8: 'xx', key9: 'xx', key10: 'xx'},
     {id: 6, key1: 'xx', key2: 'xx', key3: 'xx', key4: 'xx', key5: 'xx', key6: 'xx', key7: 'xx', key8: 'xx', key9: 'xx', key10: 'xx'},
 ])
+//合同里程碑
+
+const getListByProjectId=async(projectId)=>{
+    const {error, code, data} = await contractApi.getListByProjectId({projectId})
+    if (!error && code === 200) {
+        tableRelatedData.value=getArrValue(data)
+       
+
+    } else {
+        tableRelatedData.value=[]
+    }
+}
 
 const relatedCloseClick = () => {
     relatedModal.value = false

+ 31 - 15
src/views/program/project/index.vue

@@ -2,17 +2,17 @@
     <HcCard>
         <template #header>
             <div class="w-36">
-                <el-select v-model="searchForm.planType" block clearable placeholder="项目类型" size="large">
+                <el-select v-model="searchForm.projectType" block clearable placeholder="项目类型" size="large">
                     <el-option v-for="item in planType" :label="item.name" :value="item.key"/>
                 </el-select>
             </div>
             <div class="w-36 ml-2">
-                <el-select v-model="searchForm.department" block clearable placeholder="服务类型" size="large">
+                <el-select v-model="searchForm.projectServerType" block clearable placeholder="服务类型" size="large">
                     <el-option v-for="item in department" :label="item.name" :value="item.key"/>
                 </el-select>
             </div>
             <div class="w-56 ml-2">
-                <el-input v-model="searchForm.queryValue" clearable placeholder="请输入项目名称查询" @keyup="keyUpEvent" size="large"/>
+                <el-input v-model="searchForm.name" clearable placeholder="请输入项目名称查询" @keyup="keyUpEvent" size="large"/>
             </div>
             <div class="ml-4">
                 <el-button size="large" type="primary" @click="searchClick">
@@ -28,8 +28,8 @@
             </div>
         </template>
         <HcTable :isIndex="false" :column="tableColumn" :datas="tableData" :loading="tableLoading">
-            <template #key1="{row}">
-                <span class="text-blue" @click="rowNameClick(row)">{{row.key1}}</span>
+            <template #name="{row}">
+                <span class="text-blue" @click="rowNameClick(row)">{{row.name}}</span>
             </template>
         </HcTable>
         <template #action>
@@ -39,11 +39,17 @@
 </template>
 
 <script setup>
-import {ref} from "vue";
+
 import {useRouter} from 'vue-router'
+import {ref,onMounted,onActivated} from "vue";
+import projectApi from '~api/program/project.js';
+import {getArrValue} from "js-fast-way"
 
 const router = useRouter()
+onActivated(()=>{
+    getTableData()
 
+})
 //计划类型
 const planType = ref([
     {name: '临时计划', key: '1'},
@@ -60,7 +66,7 @@ const department = ref([
 
 //搜索表单
 const searchForm = ref({
-    planType: null, startTime: null, endTime: null, department: null, queryValue: '',
+   
     current: 1, size: 20, total: 0
 })
 
@@ -93,11 +99,11 @@ const pageChange = ({current, size}) => {
 //获取数据
 const tableLoading = ref(false)
 const tableColumn = [
-    {key: 'key', name: '项目编号', width: '100'},
-    {key: 'key1', name: '项目名称'},
-    {key: 'key2', name: '项目类型'},
-    {key: 'key3', name: '项目服务类型'},
-    {key: 'key4', name: '项目进程'},
+    {key: 'number', name: '项目编号', width: '100'},
+    {key: 'name', name: '项目名称'},
+    {key: 'projectTypeValue', name: '项目类型'},
+    {key: 'projectServerTypeValue', name: '项目服务类型'},
+    {key: 'currentProcessName', name: '项目进程'},
 ]
 const tableData = ref([
     {id: 1, key: 'JH-01', key1: '2023年5月度计划', key2: '高速公路', key3: '软件合同', key4: '产品-研发'},
@@ -105,8 +111,17 @@ const tableData = ref([
     {id: 3, key: 'JH-01', key1: '2023年5月度计划', key2: '高速公路', key3: '软件合同', key4: '产品-研发'},
 ])
 
-const getTableData = () => {
-
+const getTableData = async() => {
+    tableLoading.value = true
+    const {error, code, data} = await projectApi.getPage(searchForm.value)
+    tableLoading.value = false
+    if (!error && code === 200) {
+        tableData.value = getArrValue(data)
+        searchForm.value.total = data['total'] || 0
+    } else {
+        tableData.value = []
+        searchForm.value.total = 0
+    }
 }
 
 //编辑预算
@@ -114,7 +129,8 @@ const rowNameClick = (row) => {
     router.push({
         name: 'program-project-form',
         query: {
-            id: row.id
+            id: row.id,
+            type:'edit'
         }
     })
 }

+ 43 - 16
src/views/program/section/index.vue

@@ -7,11 +7,11 @@
                 </el-select>
             </div>
             <div class="w-36 ml-4">
-                <el-date-picker class="block" v-model="searchForm.startTime" type="month" value-format="YYYY-MM" placeholder="开始日期" clearable size="large"/>
+                <el-date-picker class="block" v-model="searchForm.planStartDate" type="month" value-format="YYYY-MM" placeholder="开始日期" clearable size="large"/>
             </div>
             <div class="mx-2">~</div>
             <div class="w-36">
-                <el-date-picker class="block" v-model="searchForm.endTime" type="month" value-format="YYYY-MM" placeholder="结束日期" clearable size="large"/>
+                <el-date-picker class="block" v-model="searchForm.planEndDate" type="month" value-format="YYYY-MM" placeholder="结束日期" clearable size="large"/>
             </div>
             <div class="ml-4">
                 <el-button size="large" type="primary" @click="searchClick">
@@ -33,14 +33,22 @@
             </el-button>
         </template>
         <HcTable :column="tableColumn" :datas="tableData" :loading="tableLoading">
-            <template #key1="{row}">
-                <span class="text-blue" @click="rowNameClick(row)">{{row.key1}}</span>
+            <template #planName="{row}">
+                <span class="text-blue" @click="rowNameClick(row)">{{row.planName}}</span>
             </template>
-            <template #key4="{row}">
-                <span>{{row.key4}}条</span>
+            <template #key2="{row}">
+                <span >{{row.planStartDate?row.planStartDate:''}}</span>
+                <span  v-if="row.planStartDate">~</span>
+                <span >{{row.planStartDate?row.planStartDate:''}}</span>
             </template>
-            <template #key5="{row}">
-                <span>{{row.key5}}条</span>
+            <template #planTotal="{row}">
+                <span>{{row.planTotal}}条</span>
+            </template>
+            <template #finishPlanTotal="{row}">
+                <span>{{row.finishPlanTotal}}条</span>
+            </template>
+            <template #beginPlanTotal="{row}">
+                <span>{{row.beginPlanTotal}}条</span>
             </template>
             <template #action="{row,index}">
                 <el-button size="small" type="primary" @click="editRowClick(row)">编辑</el-button>
@@ -71,11 +79,16 @@
 </template>
 
 <script setup>
-import {ref} from "vue";
+import {ref,onMounted,onActivated} from "vue";
 import {useRouter} from 'vue-router'
+import {getArrValue} from "js-fast-way"
+import sectionApi from '~api/program/section.js';
 
 const router = useRouter()
+onActivated(()=>{
+    getTableData()
 
+})
 //选择部门
 const department = ref([
     {name: '研发部门', key: '1'},
@@ -110,12 +123,12 @@ const pageChange = ({current, size}) => {
 //获取数据
 const tableLoading = ref(false)
 const tableColumn = [
-    {key: 'key1', name: '计划名称'},
+    {key: 'planName', name: '计划名称'},
     {key: 'key2', name: '计划起止日期', width: '220', align: 'center'},
-    {key: 'key3', name: '计划数量', width: '120', align: 'center'},
-    {key: 'key4', name: '已完成计划', width: '120', align: 'center'},
-    {key: 'key5', name: '未完成计划', width: '120', align: 'center'},
-    {key: 'key6', name: '计划制定人', width: '120', align: 'center'},
+    {key: 'planTotal', name: '计划数量', width: '120', align: 'center'},
+    {key: 'finishPlanTotal', name: '已完成计划', width: '120', align: 'center'},
+    {key: 'beginPlanTotal', name: '未完成计划', width: '120', align: 'center'},
+    {key: 'planDesigner', name: '计划制定人', width: '120', align: 'center'},
     {key: 'action', name: '操作', width: '160', align: 'center'},
 ]
 const tableData = ref([
@@ -124,8 +137,17 @@ const tableData = ref([
     {id: 3, key1: '2023年5月度计划', key2: '2022-07-01~2027-04-12', key3: '36', key4: '30', key5: '6', key6: '张三'},
 ])
 
-const getTableData = () => {
-
+const getTableData = async() => {
+    tableLoading.value = true
+    const {error, code, data} = await sectionApi.getPage(searchForm.value)
+    tableLoading.value = false
+    if (!error && code === 200) {
+        tableData.value = getArrValue(data)
+        searchForm.value.total = data['total'] || 0
+    } else {
+        tableData.value = []
+        searchForm.value.total = 0
+    }
 }
 
 //表格名称被点击
@@ -137,6 +159,11 @@ const rowNameClick = (row) => {
 const addRowClick = () => {
     monthModal.value = true
 }
+//获取所属部门列表
+const getDepartmentDict=()=>{
+    
+}
+
 
 //选择月份
 const monthModal = ref(false)

+ 1 - 1
src/views/project/contract/index.vue

@@ -43,7 +43,7 @@
                 <span class="text-blue" @click="rowNameTap(row)">{{row.name}}</span>
             </template>
             <template #key4="{row}">
-                <span class="text-blue text-hover">{{row.startTime+'~'+row.endTime}}</span>
+                <span >{{row.startTime+'~'+row.endTime}}</span>
             </template>
             <template #action="{row,index}">
                 <el-button plain size="small" type="primary" @click="editRowClick(row)">编辑</el-button>

+ 3 - 3
src/views/project/cost/form.vue

@@ -270,9 +270,9 @@ const getBudgetStatsById=async()=>{
     if (!error && code === 200) {
         formBaseModel.value=getObjValue(data)
         tableData.value= formBaseModel.value.constructUnit.length>0?formBaseModel.value.constructUnit:originTableData.value
-        constructUnitData.value=formBaseModel.value.constructUnit
-        bulidUnitData.value=formBaseModel.value.buildUnit
-        supervisorUnitData.value=formBaseModel.value.supervisorUnit
+        constructUnitData.value=formBaseModel.value.constructUnit||[]
+        bulidUnitData.value=formBaseModel.value.buildUnit||[]
+        supervisorUnitData.value=formBaseModel.value.supervisorUnit||[]
 
     } else {
         formBaseModel.value={}