Bladeren bron

Merge remote-tracking branch 'origin/master'

ZaiZai 11 maanden geleden
bovenliggende
commit
61dbd3dcf7
2 gewijzigde bestanden met toevoegingen van 61 en 74 verwijderingen
  1. 8 1
      src/api/modules/project/project.js
  2. 53 73
      src/views/project/modules/project-list.vue

+ 8 - 1
src/api/modules/project/project.js

@@ -42,5 +42,12 @@ export default {
             params: { id },
         }, false)
     },
-
+    //修改项目完成情况
+    async updateProFin(form) {
+    return HcApi({
+        url: '/api/blade-attach/project/update-project-finished',
+        method: 'post',
+        data: form,
+    }, false)
+},
 }

+ 53 - 73
src/views/project/modules/project-list.vue

@@ -79,28 +79,28 @@
                                     <el-table-column prop="planRatio" label="形象进度百分比(%)" width="100" align="center" />
                                     <el-table-column prop="workProgress" label="工作计划进展计划" align="center" />
                                 </el-table>
-                                <hc-info-table class="mt-[-1px]">
+                                <hc-info-table v-if="yearData.list && yearData.list.length > 0" class="mt-[-1px]">
                                     <tr>
                                         <hc-info-table-td is-title width="130px" center>该年累计完成投资(亿元)</hc-info-table-td>
-                                        <!-- <hc-info-table-td center>{{ yearData.list[yearIndex].yearFinishInvest || "-" }}</hc-info-table-td> -->
+                                        <hc-info-table-td center>{{ yearData.list[yearIndex].yearFinishInvest || "-" }}</hc-info-table-td>
                                         <hc-info-table-td is-title width="130px" center>该年力争完成投资(亿元)</hc-info-table-td>
-                                        <!-- <hc-info-table-td center>{{ yearData.list[yearIndex]?.yearlyInvest || "-" }}</hc-info-table-td> -->
+                                        <hc-info-table-td center>{{ yearData.list[yearIndex]?.yearlyInvest || "-" }}</hc-info-table-td>
                                         <hc-info-table-td is-title width="130px" center>该年累计未完成投资(亿元)</hc-info-table-td>
-                                        <!-- <hc-info-table-td center>{{ yearData.list[yearIndex]?.yearUnfinishedInvest || "-" }}</hc-info-table-td> -->
+                                        <hc-info-table-td center>{{ yearData.list[yearIndex]?.yearUnfinishedInvest || "-" }}</hc-info-table-td>
                                     </tr>
                                 </hc-info-table>
-                                <hc-info-table class="mt-[-1px]">
+                                <hc-info-table v-if="yearData.list && yearData.list.length > 0" class="mt-[-1px]">
                                     <tr>
                                         <hc-info-table-td is-title width="30px" center>存在问题</hc-info-table-td>
-                                        <!-- <hc-info-table-td center>{{ yearData.list[yearIndex]?.questionable || '-' }}</hc-info-table-td> -->
-                                        <hc-info-table-td is-title width="30px" center>工作问题</hc-info-table-td>
-                                        <!-- <hc-info-table-td center>{{ yearData.list[yearIndex]?.workAdvise || '-' }}</hc-info-table-td> -->
+                                        <hc-info-table-td center>{{ yearData.list[yearIndex]?.questionable || '-' }}</hc-info-table-td>
+                                        <hc-info-table-td is-title width="30px" center>工作建议</hc-info-table-td>
+                                        <hc-info-table-td center>{{ yearData.list[yearIndex]?.workAdvise || '-' }}</hc-info-table-td>
                                     </tr>
                                     <tr>
                                         <hc-info-table-td is-title width="30px" center>填报单位</hc-info-table-td>
-                                        <!-- <hc-info-table-td center>{{ yearData.list[yearIndex]?.writeUnit || '-' }}</hc-info-table-td> -->
+                                        <hc-info-table-td center>{{ yearData.list[yearIndex]?.writeUnit || '-' }}</hc-info-table-td>
                                         <hc-info-table-td is-title width="30px" center>联系人</hc-info-table-td>
-                                        <!-- <hc-info-table-td center>{{ yearData.list[yearIndex]?.linkman || '-' }}</hc-info-table-td> -->
+                                        <hc-info-table-td center>{{ yearData.list[yearIndex]?.linkman || '-' }}</hc-info-table-td>
                                     </tr>
                                 </hc-info-table>
                             </hc-card-item>
@@ -119,9 +119,9 @@
                 <hc-info-table>
                     <tr>
                         <hc-info-table-td is-title width="30px" center>项目名称</hc-info-table-td>
-                        <hc-info-table-td center>成渝高速</hc-info-table-td>
+                        <hc-info-table-td center>{{ rowDetail?.name }}</hc-info-table-td>
                         <hc-info-table-td is-title width="30px" center>项目类型</hc-info-table-td>
-                        <hc-info-table-td center>高速公路</hc-info-table-td>
+                        <hc-info-table-td center>{{ rowDetail?.projectTypeName }}</hc-info-table-td>
                     </tr>
                 </hc-info-table>
                 <div class="hc-project-list-drawer-year detail">
@@ -130,12 +130,12 @@
                             <hc-card-item class="year-detail edit">
                                 <template #header>
                                     <div class="flex-1 text-center text-[14px]">
-                                        <HcDropdown v-model="yearKey" :datas="yearData" />
+                                        <HcDropdown v-model="yearKey" :datas="yearData.list" text="年" :props="{ key: 'planYear', label: 'planYear' }" @change="yearChange" />
                                     </div>
                                 </template>
-                                <el-table :data="tableYearData1" border class="w-full" :span-method="tableYearMethod1">
-                                    <el-table-column prop="quarter" label="季度" width="100" align="center" />
-                                    <el-table-column prop="month" class-name="line" width="120" align="center">
+                                <el-table v-if="yearData.list && yearData.list.length > 0" :data="yearData.list[yearIndex].list" border class="w-full" :span-method="tableYearMethod1">
+                                    <el-table-column prop="planQuarterName" label="季度" width="100" align="center" />
+                                    <el-table-column prop="planMonthName" class-name="line" width="120" align="center">
                                         <template #header>
                                             <div class="hc-table-th-line">
                                                 <span class="left">月份</span>
@@ -143,75 +143,75 @@
                                             </div>
                                         </template>
                                     </el-table-column>
-                                    <el-table-column prop="key1" label="计划完成投资额(亿元)" width="100" align="center">
+                                    <el-table-column prop="planInvestMoney" label="计划完成投资额(亿元)" width="100" align="center">
                                         <template #default="{ row }">
                                             <hc-body>
-                                                <hc-table-input v-model="row.key1" disabled />
+                                                <hc-table-input v-model="row.planInvestMoney" disabled />
                                             </hc-body>
                                         </template>
                                     </el-table-column>
-                                    <el-table-column prop="key2" label="投资完成额(亿元)" width="100" align="center">
+                                    <el-table-column prop="investMoney" label="投资完成额(亿元)" width="100" align="center">
                                         <template #default="{ row }">
                                             <hc-body>
-                                                <hc-table-input v-model="row.key2" />
+                                                <hc-table-input v-model="row.investMoney" />
                                             </hc-body>
                                         </template>
                                     </el-table-column>
-                                    <el-table-column prop="key3" label="累计投资完成额(亿元)" width="100" align="center">
+                                    <el-table-column prop="investMoneyAll" label="累计投资完成额(亿元)" width="100" align="center">
                                         <template #default="{ row }">
                                             <hc-body>
-                                                <hc-table-input v-model="row.key3" disabled />
+                                                <hc-table-input v-model="row.investMoneyAll" disabled />
                                             </hc-body>
                                         </template>
                                     </el-table-column>
-                                    <el-table-column prop="key5" label="工作计划" width="100" align="center">
+                                    <el-table-column prop="workPlan" label="工作计划" width="100" align="center">
                                         <template #default="{ row }">
                                             <hc-body>
-                                                <hc-table-input v-model="row.key5" type="textarea" disabled resize="none" />
+                                                <hc-table-input v-model="row.workPlan" type="textarea" disabled resize="none" />
                                             </hc-body>
                                         </template>
                                     </el-table-column>
-                                    <el-table-column prop="key6" label="工作计划进展情况" align="center">
+                                    <el-table-column prop="workProgress" label="工作计划进展情况" align="center">
                                         <template #default="{ row }">
                                             <hc-body>
-                                                <hc-table-input v-model="row.key6" type="textarea" resize="none" />
+                                                <hc-table-input v-model="row.workProgress" type="textarea" resize="none" :disabled="yearData.list[yearIndex].isCanFill === 1 ? false : true" />
                                             </hc-body>
                                         </template>
                                     </el-table-column>
-                                    <el-table-column prop="key7" label="累计进展情况" align="center">
+                                    <el-table-column prop="workProgress" label="累计进展情况" align="center">
                                         <template #default="{ row }">
                                             <hc-body>
-                                                <hc-table-input v-model="row.key7" type="textarea" resize="none" />
+                                                <hc-table-input v-model="row.workProgress" type="textarea" resize="none" :disabled="yearData.list[yearIndex].isCanFill === 1 ? false : true" />
                                             </hc-body>
                                         </template>
                                     </el-table-column>
-                                    <el-table-column prop="key8" label="形象进度百分比(%)" width="100" align="center">
+                                    <el-table-column prop="planRatio" label="形象进度百分比(%)" width="100" align="center">
                                         <template #default="{ row }">
                                             <hc-body>
-                                                <hc-table-input v-model="row.key8" />
+                                                <hc-table-input v-model="row.planRatio" :disabled="yearData.list[yearIndex].isCanFill === 1 ? false : true" />
                                             </hc-body>
                                         </template>
                                     </el-table-column>
                                 </el-table>
-                                <hc-info-table class="mt-[-1px]">
+                                <hc-info-table v-if="yearData.list && yearData.list.length > 0" class="mt-[-1px]">
                                     <tr>
                                         <hc-info-table-td is-title width="30px" center>存在问题</hc-info-table-td>
                                         <hc-info-table-td center>
-                                            <el-input v-model="testValue" type="textarea" resize="none" />
+                                            <el-input v-model="yearData.list[yearIndex].questionable" type="textarea" resize="none" />
                                         </hc-info-table-td>
                                         <hc-info-table-td is-title width="30px" center>工作建议</hc-info-table-td>
                                         <hc-info-table-td center>
-                                            <el-input v-model="testValue" type="textarea" resize="none" />
+                                            <el-input v-model=" yearData.list[yearIndex].workAdvise" type="textarea" resize="none" />
                                         </hc-info-table-td>
                                     </tr>
                                     <tr>
                                         <hc-info-table-td is-title width="30px" center>填报单位</hc-info-table-td>
                                         <hc-info-table-td center>
-                                            <el-input v-model="testValue" />
+                                            <el-input v-model="yearData.list[yearIndex].writeUnit " />
                                         </hc-info-table-td>
                                         <hc-info-table-td is-title width="30px" center>联系人</hc-info-table-td>
                                         <hc-info-table-td center>
-                                            <el-input v-model="testValue" />
+                                            <el-input v-model="yearData.list[yearIndex].linkman" />
                                         </hc-info-table-td>
                                     </tr>
                                 </hc-info-table>
@@ -221,7 +221,7 @@
                 </div>
                 <template #action>
                     <el-button type="info" @click="isCompletionDrawer = false">取消</el-button>
-                    <el-button type="warning" @click="isCompletionDrawer = false">保存</el-button>
+                    <el-button type="warning" :loading="saveCompleLoading" @click="saveComplete">保存</el-button>
                 </template>
             </hc-card>
         </hc-drawer>
@@ -290,7 +290,6 @@ const tableColumn = ref([
 //监听数据
 const tableData = ref(props.datas)
 watch(() => props.datas, (data) => {
-    console.log(data, 'data')
     tableData.value = data
 })
 //表格被选择
@@ -310,6 +309,7 @@ const isCompletionDrawer = ref(false)
 const completion = (row) => {
     isCompletionDrawer.value = true
     emit('completion', row)
+    getDetailData(row.id)
 }
 
 //查看
@@ -392,24 +392,7 @@ const yearChange = (_, index) => {
   
     yearIndex.value = index
 }
-//年份表格数据
-const tableYearData = ref([
-    { quarter: '一季度', month: '1月', key1: '13', key2: '1.1', key3: '11.9' },
-    { quarter: '一季度', month: '2月', key1: '13', key2: '1.2', key3: '10.7' },
-    { quarter: '一季度', month: '3月', key1: '13', key2: '1.3', key3: '9.4' },
-
-    { quarter: '二季度', month: '4月', key1: '14', key2: '1.4', key3: '1.1' },
-    { quarter: '二季度', month: '5月', key1: '14', key2: '1.5', key3: '1.2' },
-    { quarter: '二季度', month: '6月', key1: '14', key2: '1.6', key3: '1.3' },
 
-    { quarter: '三季度', month: '7月', key1: '15', key2: '1.7', key3: '1.1' },
-    { quarter: '三季度', month: '8月', key1: '15', key2: '1.8', key3: '1.2' },
-    { quarter: '三季度', month: '9月', key1: '15', key2: '1.9', key3: '1.3' },
-
-    { quarter: '四季度', month: '10月', key1: '16', key2: '2.0', key3: '1.1' },
-    { quarter: '四季度', month: '11月', key1: '16', key2: '2.1', key3: '1.2' },
-    { quarter: '四季度', month: '12月', key1: '16', key2: '2.1', key3: '1.3' },
-])
 
 //合并列或行
 const tableYearMethod = ({ rowIndex, columnIndex }) => {
@@ -417,31 +400,28 @@ const tableYearMethod = ({ rowIndex, columnIndex }) => {
 }
 
 
-//年份表格数据
-const tableYearData1 = ref([
-    { quarter: '一季度', month: '1月', key1: '13', key2: '1.1', key3: '11.9' },
-    { quarter: '一季度', month: '2月', key1: '13', key2: '1.2', key3: '10.7' },
-    { quarter: '一季度', month: '3月', key1: '13', key2: '1.3', key3: '9.4' },
-
-    { quarter: '二季度', month: '4月', key1: '14', key2: '1.4', key3: '1.1' },
-    { quarter: '二季度', month: '5月', key1: '14', key2: '1.5', key3: '1.2' },
-    { quarter: '二季度', month: '6月', key1: '14', key2: '1.6', key3: '1.3' },
-
-    { quarter: '三季度', month: '7月', key1: '15', key2: '1.7', key3: '1.1' },
-    { quarter: '三季度', month: '8月', key1: '15', key2: '1.8', key3: '1.2' },
-    { quarter: '三季度', month: '9月', key1: '15', key2: '1.9', key3: '1.3' },
-
-    { quarter: '四季度', month: '10月', key1: '16', key2: '2.0', key3: '1.1' },
-    { quarter: '四季度', month: '11月', key1: '16', key2: '2.1', key3: '1.2' },
-    { quarter: '四季度', month: '12月', key1: '16', key2: '2.1', key3: '1.3' },
-])
 
 //合并列或行
 const tableYearMethod1 = ({ rowIndex, columnIndex }) => {
     return setSpanMethod(columnIndex, rowIndex, false)
 }
+const saveCompleLoading = ref(false)
+const saveComplete = async ()=>{
+    saveCompleLoading.value = true
+        //发起请求
+        const { error, code, msg } = await mainApi.updateProFin({
+            ...yearData.value,
+    })
+    //判断状态
+    saveCompleLoading.value = false
+    if (!error && code === 200) {
+        window?.$message?.success(msg)
+     
+    } else {
+        window.$message.error(msg ?? '操作失败')
+    }
+}
 
-const testValue = ref('')
 
 const setSpanMethod = (column, row, isAllYear = true) => {
     if (column === 0) { //第一列