Browse Source

园区重点项目添加填报数据功能

Sanmu8 1 year ago
parent
commit
10b94a779f

+ 13 - 2
src/api/portal/ARTICLE/ARTICLE.js

@@ -52,11 +52,22 @@ export function delARTICLE(id) {
   })
 }
 // 获取用户信息   用来查询列表和新增
-export function getUserInfo(id) {
+export function getUserInfo() {
   return request({
-    url: '/ARTICLE/remove/' + id,
+    url: '/getInfo',
     method: 'get'
   })
 }
 
 
+// 数据填报
+export function addDATAFILLING(data) {
+  return request({
+    url: '/DATAFILLING/add',
+    method: 'post',
+    data:data
+  })
+}
+
+
+

+ 0 - 1
src/layout/components/HeaderNotice.vue

@@ -50,7 +50,6 @@ export default {
   },
   methods: {
     goTask(){
-      console.log(this.$route.path);
       if(this.$route.path != '/task/task'){
         this.$router.push({path:'/task/task'})
       }

+ 105 - 0
src/views/ARTICLE/detail.vue

@@ -0,0 +1,105 @@
+<template>
+  <div>
+    <el-form ref="form" :model="form" label-width="120px">
+      <el-form-item label="项目名称" prop="atvName">
+        <el-input
+          v-model="form.atvName"
+          placeholder="请输入项目名称"
+          style="width: 50%"
+        ></el-input>
+      </el-form-item>
+      <el-form-item label="建设规模">
+        <el-select
+          v-model="form.scale"
+          placeholder="请选择建设规模"
+          style="width: 50%"
+        >
+          <el-option
+            v-for="item in scaleList"
+            :key="item.value + 'typeList'"
+            :label="item.label"
+            :value="item.value"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="建设内容">
+        <el-input
+          type="textarea"
+          :rows="5"
+          v-model="form.content"
+          placeholder="请输入建设内容"
+        ></el-input>
+      </el-form-item>
+      <el-form-item label="年度投资计划">
+        <el-input
+          type="number"
+          v-model="form.plan"
+          placeholder="请输入年度投资计划"
+          style="width: 50%"
+        ></el-input>
+      </el-form-item>
+      <el-form-item label="形象进度">
+        <el-input
+          v-model="form.schedule"
+          placeholder="请输入形象进度"
+          style="width: 50%"
+        ></el-input>
+      </el-form-item>
+
+      <el-table :data="tableData" style="width: 100%">
+        <el-table-column prop="date" label="日期" width="180">
+        </el-table-column>
+      </el-table>
+      
+    </el-form>
+    <div slot="footer" class="mfooter">
+      <el-button @click="$layer.close(layerid)">返 回</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import {
+  listARTICLE,
+  getARTICLE,
+  delARTICLE,
+  addARTICLE,
+  updateARTICLE,
+} from "@/api/portal/ARTICLE/ARTICLE.js";
+export default {
+  props: {
+    param: {
+      type: Object,
+      default: () => {
+        return {};
+      },
+    },
+    layerid: {
+      type: String,
+    },
+  },
+  mounted() {
+    if (this.param.id) {
+      getARTICLE(this.param.id).then((response) => {
+        this.form = response.data;
+      });
+    }
+  },
+  data() {
+    return {
+      scaleList: [
+        { label: "小型", value: 1 },
+        { label: "中型", value: 2 },
+        { label: "大型", value: 3 },
+      ],
+      // 表单参数
+      form: {},
+    };
+  },
+
+  methods() {},
+};
+</script>
+
+<style>
+</style>

+ 53 - 10
src/views/ARTICLE/enterData.vue

@@ -2,17 +2,23 @@
   <div>
     <div class="cmain">
       <el-form ref="form" :model="form" :rules="rules" label-width="100px">
-        <el-form-item label="本月投资金额" prop="">
+        <el-form-item label="年月" prop="month">
+          <el-date-picker v-model="form.month" type="month" placeholder="选择月" value-format="yyyy-MM">
+          </el-date-picker>
+        </el-form-item>
+
+        <el-form-item label="投资金额" prop="price">
           <el-input
             type="number"
-            v-model="form.name"
-            placeholder=""
+            v-model="form.price"
+            placeholder="请输入投资金额"
           ></el-input>
         </el-form-item>
-        <el-form-item label="形象进度" prop="">
+
+        <el-form-item label="形象进度" prop="schedule">
           <el-input
-            v-model="form.name"
-            placeholder=""
+            v-model="form.schedule"
+            placeholder="请输入形象进度"
           ></el-input>
         </el-form-item>
       </el-form>
@@ -25,26 +31,63 @@
 </template>
 
 <script>
+import {
+  listARTICLE,
+  getARTICLE,
+  delARTICLE,
+  addARTICLE,
+  updateARTICLE,
+  addDATAFILLING,
+} from "@/api/portal/ARTICLE/ARTICLE.js";
 export default {
   props: {
+    param: {
+      type: Object,
+      default: () => {
+        return {};
+      },
+    },
     layerid: {
       type: String,
     },
   },
+  created() {
+    // console.log(this.param.param);
+  },
   data() {
     return {
       // 表单参数
-      form: {},
+      form: {
+        articleld: this.param.param.id,
+        deptId: this.param.deptId,
+        month: "",
+        plan: this.param.param.deptId,
+        price: "",
+        schedule: "",
+      },
       rules: {
-        preview: [
-          { required: true, message: "项目情况概述不能为空", trigger: "blur" },
+        month: [
+          { required: true, message: "年月不能为空", trigger: "blur" },
+        ],
+        price: [
+          { required: true, message: "投资金额不能为空", trigger: "blur" },
+        ],
+        schedule: [
+          { required: true, message: "形象进度不能为空", trigger: "blur" },
         ],
       },
     };
   },
   methods: {
     submitForm() {
-        this.$layer.close(this.layerid);
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          addDATAFILLING(this.form).then((res) => {
+            this.$modal.msgSuccess("填报成功!");
+            this.$layer.close(this.layerid);
+          });
+        }
+      });
     },
   },
 };

+ 28 - 3
src/views/ARTICLE/index.vue

@@ -139,6 +139,13 @@
           <el-button
             size="mini"
             type="text"
+            @click="showDetail(scope.row)"
+            v-hasPermi="['business:ARTICLE:edit']"
+            >详情</el-button
+          >
+          <el-button
+            size="mini"
+            type="text"
             v-if="scope.row.status == 3"
             @click="showEnterData(scope.row)"
             v-hasPermi="['business:ARTICLE:edit']"
@@ -165,9 +172,11 @@ import {
   delARTICLE,
   addARTICLE,
   updateARTICLE,
+  getUserInfo
 } from "@/api/portal/ARTICLE/ARTICLE.js";
 import edit from "./edit.vue";
 import enterData from "./enterData.vue";
+import detail from "./detail.vue";
 export default {
   name: "ARTICLE",
   data() {
@@ -219,20 +228,36 @@ export default {
         retio: null,
         schedule: null,
       },
+      deptId:'',
     };
   },
   created() {
     this.getList();
+    this.getDeptId()
   },
   methods: {
-    showEnterData(row) {
+    getDeptId(){
+      getUserInfo().then(res=>{
+        this.deptId = res.user.deptId
+      })
+    },
+    showDetail(row){
       const id = row.id || this.ids;
       this.iframe({
-        obj: enterData,
+        obj: detail,
         param: { id: id },
+        title: "详情",
+        width: "1050px",
+        height: "80%",
+      });
+    },
+    showEnterData(param) {
+      this.iframe({
+        obj: enterData,
+        param: { param:param,deptId:this.deptId },
         title: "数据填报",
         width: "400px",
-        height: "250px",
+        height: "350px",
       });
     },
     // 多选框选中数据