weirenchun 2 anos atrás
pai
commit
3a78538860

+ 27 - 0
src/api/funds/index.js

@@ -0,0 +1,27 @@
+import fetch from '../fetch.js'
+
+export default {
+  /**
+   * 资金列表
+   * @param params
+   */
+  fundsList(params) {
+    return fetch(
+      '/blade-project-manage-v2/project-dispatch/v2/project-basic-investment-list',
+      params,
+      'get'
+    )
+  },
+  /**
+   * 新增到位资金
+   * @param params
+   */
+  fundsSaveOrUpdate(params) {
+    return fetch(
+      '/blade-project-manage-v2/project-dispatch/v2/submit-project-basic-investment',
+      params,
+      'post',
+      'json'
+    )
+  }
+}

+ 2 - 0
src/api/index.js

@@ -14,6 +14,7 @@ import dispatch from './dispatch/index.js'
 import store from './store/index.js'
 import msg from './msg/index.js'
 import contract from '@/api/contract/index.js'
+import funds from '@/api/funds/index.js'
 import role from '@/api/role/index.js'
 import resource from '@/api/resource/index.js'
 import dash from '@/api/dash/index.js'
@@ -37,6 +38,7 @@ export default {
   store,
   msg,
   contract,
+  funds,
   role,
   resource,
   dash

+ 285 - 0
src/views/funds/component/info.vue

@@ -0,0 +1,285 @@
+<template>
+  <div>
+    <div class="padding top flex flex-center flex-justify-between">
+      <span>到位资金记录</span>
+    </div>
+    <div class="ml-20 mr-20 mt-20">
+      <avue-crud
+        :option="option"
+        :data="data"
+        ref="crud"
+        v-model="form"
+        @row-del="rowDel"
+        @row-save="handleRowSave"
+        @row-update="rowUpdate"
+        @on-load="onLoad"
+      >
+        <template #fileIds-form="{ row, type }">
+          <div v-if="type === 'view'">
+            <div
+              v-for="i in form.accountInformationFileList"
+              :key="i.id"
+              class="pointer"
+            >
+              {{ i.title }}
+              <el-button text type="primary" plain>查看</el-button>
+            </div>
+          </div>
+          <div v-else-if="type === 'edit'">
+            <div
+              v-if="
+                form.accountInformationFileList &&
+                form.accountInformationFileList.length === 0
+              "
+            >
+              <div>
+                <div v-for="item in fileList" :key="item.id">
+                  {{ item.title }}
+                </div>
+              </div>
+            </div>
+            <div
+              v-for="i in form.accountInformationFileList"
+              :key="i.id"
+              class="pointer"
+            >
+              {{ i.title }}
+              <el-button text type="primary" plain>删除</el-button>
+            </div>
+          </div>
+          <div v-else>
+            <div v-for="item in fileList" :key="item.id">
+              {{ item.title }}
+            </div>
+            <div>
+              <div v-for="item in fileList" :key="item.id">
+                {{ item.originalFileName }}
+              </div>
+            </div>
+          </div>
+        </template>
+      </avue-crud>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'info',
+  components: {},
+  props: {
+    info: {
+      type: Object,
+      default: null
+    }
+  },
+  data() {
+    return {
+      id: '',
+      preList: [],
+      show: false,
+      fileList: [],
+      form: {},
+      data: [],
+      option: {
+        align: 'center',
+        menuAlign: 'center',
+        menuWidth: 250,
+        height: 480,
+        size: 'mini',
+        addBtn: true,
+        editBtn: true,
+        viewBtn: true,
+        delBtn: true,
+        refreshBtn: false,
+        columnBtn: false,
+        labelWidth: 240,
+        border: true,
+        column: [
+          {
+            label: '中央预算内投资',
+            prop: 'investmentOfCentralBudget',
+            rules: [
+              {
+                required: true,
+                message: '中央预算内投资',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '银行贷款',
+            prop: 'bankLoans',
+            type: 'number',
+            rules: [
+              {
+                required: true,
+                message: '银行贷款',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '专项债券资金',
+            prop: 'specialBondFunds',
+            type: 'number',
+            rules: [
+              {
+                required: true,
+                message: '专项债券资金',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '抗疫特别国债资金',
+            prop: 'antiEpidemicSpecialTreasuryBondFund',
+            type: 'number',
+            rules: [
+              {
+                required: true,
+                message: '抗疫特别国债资金',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '其他地方财政性建设基金',
+            prop: 'otherLocalFiscalConstructionFunds',
+            type: 'number',
+            rules: [
+              {
+                required: true,
+                message: '其他地方财政性建设基金',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '政策性开发金融工具(基金)投资',
+            prop: 'policyBasedDevelopmentFinancialInvestment',
+            type: 'number',
+            rules: [
+              {
+                required: true,
+                message: '政策性开发金融工具(基金)投资',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '省级预算内投资',
+            prop: 'investmentWithinProvincialBudget',
+            type: 'number',
+            rules: [
+              {
+                required: true,
+                message: '省级预算内投资',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '市级预算内投资',
+            prop: 'investmentWithinMunicipalBudget',
+            type: 'number',
+            rules: [
+              {
+                required: true,
+                message: '市级预算内投资',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '县级预算内投资',
+            prop: 'investmentWithinCountyLevelBudget',
+            type: 'number',
+            rules: [
+              {
+                required: true,
+                message: '县级预算内投资',
+                trigger: 'blur'
+              }
+            ]
+          }
+        ]
+      }
+    }
+  },
+  created() {
+    this.id = this.$route.query.id
+  },
+  methods: {
+    onLoad() {
+      this.$api.funds.fundsList({ projectId: this.id }).then(res => {
+        if (res.code === 200) {
+          this.data = res.data
+        }
+      })
+    },
+
+    rowUpdate(row, index, done, loading) {
+      loading()
+      const data = Object.assign(this.form, { projectId: this.id })
+      this.$api.funds.fundsSaveOrUpdate(data).then(
+        res => {
+          if (res.code === 200) {
+            this.$message.success(res.msg)
+          } else {
+            this.$message.error(res.msg)
+          }
+          done(row)
+          this.onLoad()
+        },
+        error => {
+          window.console.log(error)
+          loading()
+        }
+      )
+    },
+    handleRowSave(row, done, loading) {
+      loading()
+      const data = Object.assign(row, { projectId: this.id })
+      this.$confirm('请检查并确认所填写内容是否正确!', {
+        type: 'warning'
+      }).then(res => {
+        if (res === 'confirm') {
+          this.$api.funds.fundsSaveOrUpdate(data).then(res => {
+            if (res.code === 200) {
+              done(row)
+              this.onLoad()
+            }
+          })
+        }
+      })
+    },
+    rowDel(row, index, done) {
+      this.$confirm('请确认是否删除该条资金信息?', {
+        type: 'warning'
+      }).then(res => {
+        if (res === 'confirm') {
+          this.$api.funds.fundsRemove({ ids: row.id }).then(res => {
+            if (res.code === 200) {
+              this.$message.success(res.msg)
+              this.onLoad()
+              done(row)
+            } else {
+              this.$message.error(res.msg)
+            }
+          })
+        }
+        console.log(res)
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.top {
+  height: 35px;
+  border-radius: var(--el-card-border-radius);
+  background-color: #f5f5f3;
+}
+</style>

+ 49 - 0
src/views/funds/detail.vue

@@ -0,0 +1,49 @@
+<template>
+  <div>
+    <el-card
+      shadow="hover"
+      class="mb-20"
+      style="height: 630px; padding: 0; width: 99%"
+    >
+      <info :project-id="id" :info="detail"></info>
+    </el-card>
+  </div>
+</template>
+<route>
+{
+name: '到位资金详情',
+meta: { layout: 'empty'}
+}
+</route>
+<script>
+import info from '@/views/funds/component/info.vue'
+
+export default {
+  components: { info },
+  data() {
+    return {
+      id: '',
+      detail: null
+    }
+  },
+  created() {
+    this.id = this.$route.query.id
+    // this.getFundsList()
+  },
+  methods: {
+    // getFundsList() {
+    //   this.$api.funds.fundsList({ project: this.id }).then(res => {
+    //     if (res.code === 200) {
+    //       this.detail = res.data
+    //     }
+    //   })
+    // }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+:deep(.el-card) {
+  --el-card-padding: 0 !important;
+}
+</style>

+ 40 - 62
src/views/project/componens/info4.vue

@@ -6,7 +6,23 @@
     @edit="change"
     @save="save"
   >
+    <div
+      class="full-width text-right main-color pointer"
+      style="margin-top: -10px"
+      @click="openFundsList"
+    >
+      更多到位资金>>
+    </div>
     <el-form class="mt-20" :disabled="disabled">
+      <div class="flex">
+        <button style="margin-left: 10px">到位资金</button>
+        <button style="margin-left: 10px">筹措资金</button>
+        <div style="margin-left: 20px">
+          * 点击对应按钮,查看到位资金、筹措资金详情
+        </div>
+      </div>
+
+      <div class="body_title">政策投资: 500万元</div>
       <div class="flex flex-justify-center">
         <el-form-item class="full-width flex-child-average">
           <div class="flex flex-center full-width item">
@@ -20,12 +36,8 @@
         </el-form-item>
         <el-form-item class="full-width flex-child-average">
           <div class="flex flex-center full-width item">
-            <span class="title">地方预算内投资:</span>
-            <el-input
-              class="input"
-              placeholder="地方预算内投资"
-              v-model="form.region_invest"
-            ></el-input>
+            <span class="title">银行贷款:</span>
+            <el-input class="input" placeholder="银行贷款"></el-input>
           </div>
         </el-form-item>
       </div>
@@ -73,64 +85,26 @@
           </div>
         </el-form-item>
       </div>
+      <div class="body_title">地方预算内投资: 500万元</div>
       <div class="flex flex-justify-center">
         <el-form-item class="full-width flex-child-average">
           <div class="flex flex-center full-width item">
-            <span class="title">是否民间投资项目:</span>
-            <div class="input">
-              <el-select
-                v-model="form.social_investment"
-                placeholder="是否民间投资项目"
-                class="full-width"
-              >
-                <el-option
-                  v-for="item in yesOrNo"
-                  :key="item.label"
-                  :label="item.label"
-                  :value="item.value"
-                />
-              </el-select>
-            </div>
+            <span class="title">省级预算内投资:</span>
+            <el-input class="input" placeholder="省级预算内投资"></el-input>
           </div>
         </el-form-item>
         <el-form-item class="full-width flex-child-average">
           <div class="flex flex-center full-width item">
-            <span class="title">是否产业项目:</span>
-            <div class="input">
-              <el-select
-                v-model="form.industrial_investment"
-                placeholder="是否产业项目"
-                class="full-width"
-              >
-                <el-option
-                  v-for="item in yesOrNo"
-                  :key="item.label"
-                  :label="item.label"
-                  :value="item.value"
-                />
-              </el-select>
-            </div>
+            <span class="title">市级预算内投资:</span>
+            <el-input class="input" placeholder="市级预算内投资"></el-input>
           </div>
         </el-form-item>
       </div>
       <div class="flex flex-justify-center">
         <el-form-item class="full-width flex-child-average">
           <div class="flex flex-center full-width item">
-            <span class="title">是否获得资金支持:</span>
-            <div class="input">
-              <el-select
-                v-model="form.is_funded_project"
-                placeholder="是否获得资金支持"
-                class="full-width"
-              >
-                <el-option
-                  v-for="item in yesOrNo"
-                  :key="item.label"
-                  :label="item.label"
-                  :value="item.value"
-                />
-              </el-select>
-            </div>
+            <span class="title">县级预算内投资:</span>
+            <el-input class="input" placeholder="县级预算内投资"></el-input>
           </div>
         </el-form-item>
         <el-form-item class="full-width flex-child-average">
@@ -166,23 +140,12 @@ export default {
   },
   data() {
     return {
-      yesOrNo: [
-        {
-          label: '否',
-          value: 0
-        },
-        {
-          label: '是',
-          value: 1
-        }
-      ],
       disabled: true,
       form: {}
     }
   },
   methods: {
     save() {
-      console.log('save')
       this.$api.project.proUpdate(this.form).then(res => {
         if (res.code === 200) {
           this.$message.success(res.msg)
@@ -193,6 +156,13 @@ export default {
     },
     change(res) {
       this.disabled = res
+    },
+    openFundsList() {
+      const data = this.$router.resolve({
+        path: '/funds/detail',
+        query: { id: this.form.id }
+      })
+      window.open(data.href, '_blank')
     }
   }
 }
@@ -205,6 +175,14 @@ export default {
   text-align: right;
 }
 
+.body_title {
+  margin-left: 5%;
+  margin-top: 20px;
+  margin-bottom: 20px;
+  width: 90%;
+  text-align: left;
+}
+
 .title-textarea {
   width: 85px;
   text-align: left;

+ 96 - 73
src/views/project/componens/info6.vue

@@ -2,12 +2,12 @@
   <wt-card
     title="年度投资情况(单位:万元)"
     class="mt-10"
-    :edit-btn="false"
+    :edit-btn="true"
     @change="change"
     @save="save"
   >
     <el-form class="mt-20">
-      <div style="width: 99%; text-align: left" class="mt-20 ml-10">
+      <div style="width: 1300px; text-align: left" class="mt-20 ml-10">
         <span class="title">年份:</span>
         <el-select v-model="selectYear" @change="changeYear">
           <el-option
@@ -23,80 +23,53 @@
         <thead>
           <tr>
             <th>类型</th>
-            <th>1-2月</th>
-            <th>3月</th>
-            <th>4月</th>
-            <th>5月</th>
-            <th>6月</th>
-            <th>7月</th>
-            <th>8月</th>
-            <th>9月</th>
-            <th>10月</th>
-            <th>11月</th>
-            <th>12月</th>
-            <th>合计</th>
+            <th v-for="item in month">{{ item.month }}月</th>
           </tr>
         </thead>
         <tbody>
           <tr>
             <th>计划投资</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
+            <th v-for="item in month">
+              <el-input
+                class="th-input"
+                v-model="item.planInvestment"
+                @input="saveOrUpdate(item)"
+              >
+              </el-input>
+            </th>
           </tr>
           <tr>
             <th>累计投资</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
+            <th v-for="item in month">
+              <el-input
+                class="th-input"
+                v-model="item.totalInvestment"
+                @input="saveOrUpdate(item)"
+              >
+              </el-input>
+            </th>
           </tr>
           <tr>
             <th>计划纳统投资</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
+            <th v-for="item in month">
+              <el-input
+                class="th-input"
+                v-model="item.planNtInvestment"
+                @input="saveOrUpdate(item)"
+              >
+              </el-input>
+            </th>
           </tr>
           <tr>
             <th>累计纳统投资</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
-            <th>1</th>
+            <th v-for="item in month">
+              <el-input
+                class="th-input"
+                v-model="item.totalNtInvestment"
+                @input="saveOrUpdate(item)"
+              >
+              </el-input>
+            </th>
           </tr>
         </tbody>
       </table>
@@ -131,24 +104,65 @@ export default {
   },
   data() {
     return {
+      updateItem: {},
+      month: [
+        { month: '1-2' },
+        { month: '3' },
+        { month: '4' },
+        { month: '5' },
+        { month: '6' },
+        { month: '7' },
+        { month: '8' },
+        { month: '9' },
+        { month: '10' },
+        { month: '11' },
+        { month: '12' },
+        { month: '合计' }
+      ],
       years: [],
       years2: [],
       selectYear: new Date().getFullYear(),
-      disabled: true,
-      form: {}
+      disabled: true
     }
   },
   methods: {
     changeYear(res) {
-      this.$message.warning(res)
+      this.getList()
     },
     getList() {
-      // this.$api.project.projectAnnualInvestment(this.projectId).then(res => {
       this.$api.project
-        .projectAnnualInvestment({ projectId: 111 })
+        .projectAnnualInvestment({
+          projectId: this.projectId,
+          year: this.selectYear
+        })
         .then(res => {
           if (res.code === 200) {
-            console.log(res.data)
+            this.month.map(monthItem => {
+              const sub = res.data.find(ele => ele.month === monthItem.month)
+              if (sub) {
+                monthItem.id = sub.id
+                monthItem.createDept = sub.createDept
+                monthItem.createTime = sub.createTime
+                monthItem.createUser = sub.createUser
+                monthItem.isDeleted = sub.isDeleted
+                monthItem.planInvestment = sub.planInvestment
+                monthItem.planNtInvestment = sub.planNtInvestment
+                monthItem.projectId = sub.projectId
+                monthItem.status = sub.status
+                monthItem.totalInvestment = sub.totalInvestment
+                monthItem.totalNtInvestment = sub.totalNtInvestment
+                monthItem.updateTime = sub.updateTime
+                monthItem.updateUser = sub.updateUser
+                monthItem.year = sub.year
+              } else {
+                monthItem.planInvestment = 0
+                monthItem.planNtInvestment = 0
+                monthItem.projectId = this.projectId
+                monthItem.totalInvestment = 0
+                monthItem.totalNtInvestment = 0
+                monthItem.year = this.selectYear
+              }
+            })
           }
         })
     },
@@ -161,8 +175,8 @@ export default {
       }
       this.years.reverse()
     },
-    save() {
-      this.$api.project.submitAnnualInvestment(this.form).then(res => {
+    saveOrUpdate(item) {
+      this.$api.project.submitAnnualInvestment(item).then(res => {
         if (res.code === 200) {
           this.$message.success(res.msg)
         } else {
@@ -182,8 +196,8 @@ export default {
 }
 
 table {
-  width: 98%;
-  margin: 1%;
+  width: 1280px;
+  margin: 10px;
   margin-top: 20px;
 }
 
@@ -200,7 +214,16 @@ th {
   height: 40px;
   flex: 1;
   text-align: center;
-  line-height: 40px;
   border: 1px solid #9c9c9c;
 }
+
+.th-input {
+  height: 100%;
+  width: 100%;
+  text-align: center;
+  border: none;
+}
+:deep(.el-input__inner) {
+  text-align: center;
+}
 </style>