浏览代码

完成园区重点项目-草稿状态下的保存、审核,并添加列表查询条件

Sanmu8 1 年之前
父节点
当前提交
297faf6456

+ 15 - 0
src/api/portal/ARTICLE/ARTICLE.js

@@ -60,6 +60,13 @@ export function getUserInfo() {
 }
 
 
+// 查看填报详情
+export function getPriceInfo(id) {
+  return request({
+    url: '/ARTICLE/getPriceInfo/'+id,
+    method: 'get',
+  })
+}
 // 数据填报
 export function addDATAFILLING(data) {
   return request({
@@ -68,6 +75,14 @@ export function addDATAFILLING(data) {
     data:data
   })
 }
+// 修改提交审核
+export function audit(data) {
+  return request({
+    url: '/ARTICLE/audit',
+    method: 'post',
+    data:data
+  })
+}
 
 
 

+ 2 - 1
src/views/ARTICLE/detail.vue

@@ -56,6 +56,7 @@ import {
   delARTICLE,
   addARTICLE,
   updateARTICLE,
+  getPriceInfo
 } from "@/api/portal/ARTICLE/ARTICLE.js";
 export default {
   props: {
@@ -71,7 +72,7 @@ export default {
   },
   mounted() {
     if (this.param.id) {
-      getARTICLE(this.param.id).then((response) => {
+      getPriceInfo(this.param.id).then((response) => {
         this.form = response.data;
         console.log(this.form);
       });

+ 45 - 19
src/views/ARTICLE/edit.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="cmain">
-    <el-form ref="form" :model="form" :rules="rules">
+    <el-form ref="form" :model="form" :rules="rules" label-width="150px">
       <el-form-item label="项目名称" prop="atvName">
         <el-input
           v-model="form.atvName"
@@ -27,10 +27,10 @@
           type="textarea"
           :rows="5"
           v-model="form.content"
-          placeholder="请输入建设内容(万)"
+          placeholder="请输入建设内容"
         ></el-input>
       </el-form-item>
-      <el-form-item label="年度投资计划" prop="plan">
+      <el-form-item label="年度投资计划(万)" prop="plan">
         <el-input
           type="number"
           v-model="form.plan"
@@ -61,6 +61,7 @@ import {
   delARTICLE,
   addARTICLE,
   updateARTICLE,
+  audit
 } from "@/api/portal/ARTICLE/ARTICLE.js";
 export default {
   data() {
@@ -121,10 +122,6 @@ export default {
     if (this.param.id) {
       getARTICLE(this.param.id).then((response) => {
         this.form = response.data;
-        this.form.content = response.data.content.replace(
-          new RegExp("/profile/upload/", "g"),
-          this.baseUrl + "/profile/upload/"
-        );
       });
     }
   },
@@ -134,29 +131,58 @@ export default {
       this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.form.id != null) {
-            updateARTICLE(this.form).then((response) => {
-              this.$modal.msgSuccess("修改成功");
-              this.$layer.close(this.layerid);
-              this.$parent.getList();
-            });
-          } else {
             if (type == 0) {
-              this.form.status = 0
-              addARTICLE(this.form).then((response) => {
-                this.$modal.msgSuccess("保存成功");
+              updateARTICLE(this.form).then((response) => {
+                this.$modal.msgSuccess("修改成功");
                 this.$layer.close(this.layerid);
                 this.$parent.getList();
               });
             } else if (type == 1) {
-              this.form.status = 1
-              addARTICLE(this.form).then((response) => {
-                this.$modal.msgSuccess("提交审核成功");
+              this.form.status = 1;
+              audit(this.form).then((response) => {
+                this.$modal.msgSuccess("提交成功");
                 this.$layer.close(this.layerid);
                 this.$parent.getList();
               });
             }
+          } else {
+            this.form.status = 1;
+            addARTICLE(this.form).then((response) => {
+              this.$modal.msgSuccess("提交审核成功");
+              this.$layer.close(this.layerid);
+              this.$parent.getList();
+            });
           }
         }
+
+        // if (valid) {
+        //   if (this.form.id != null) {
+        //     console.log("修改内容");
+        //     updateARTICLE(this.form).then((response) => {
+        //       this.$modal.msgSuccess("修改成功");
+        //       this.$layer.close(this.layerid);
+        //       this.$parent.getList();
+        //     });
+        //   } else {
+        //     if (type == 0) {
+        //       console.log("草稿保存");
+        //       this.form.status = 0;
+        //       addARTICLE(this.form).then((response) => {
+        //         this.$modal.msgSuccess("保存成功");
+        //         this.$layer.close(this.layerid);
+        //         this.$parent.getList();
+        //       });
+        //     } else if (type == 1) {
+        //       console.log("草稿提交审核");
+        //       this.form.status = 1;
+        //       addARTICLE(this.form).then((response) => {
+        //         this.$modal.msgSuccess("提交审核成功");
+        //         this.$layer.close(this.layerid);
+        //         this.$parent.getList();
+        //       });
+        //     }
+        //   }
+        // }
       });
     },
   },

+ 5 - 4
src/views/ARTICLE/enterData.vue

@@ -1,9 +1,9 @@
 <template>
   <div>
     <div class="cmain">
-      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
-        <el-form-item label="年月" prop="month">
-          <el-date-picker v-model="form.month" type="month" placeholder="选择" value-format="yyyy-MM">
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+        <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>
 
@@ -61,7 +61,7 @@ export default {
         articleId: this.param.param.id,
         deptId: this.param.deptId,
         month: "",
-        plan: this.param.param.deptId,
+        plan: this.param.param.plan,
         price: "",
         schedule: "",
       },
@@ -84,6 +84,7 @@ export default {
         if (valid) {
           addDATAFILLING(this.form).then((res) => {
             this.$modal.msgSuccess("填报成功!");
+            this.$parent.getList()
             this.$layer.close(this.layerid);
           });
         }

+ 63 - 11
src/views/ARTICLE/index.vue

@@ -8,12 +8,40 @@
       v-show="showSearch"
       label-width="68px"
     >
-      <el-form-item label="项目名称" prop="atvName">
+      <el-form-item label="项目名称">
         <el-input
           v-model="queryParams.atvName"
           placeholder="请输入项目名称"
         ></el-input>
       </el-form-item>
+
+      <el-form-item label="项目名称">
+        <el-select v-model="queryParams.scale" placeholder="请选择建设规模">
+          <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="年度计划投资" label-width="120px">
+        <el-input
+          style="width: 130px"
+          v-model="queryParams.least"
+          type="number"
+          placeholder="最小查询范围"
+        ></el-input>
+        <div class="ec-input-range-divider"></div>
+        <el-input
+          style="width: 130px"
+          type="number"
+          v-model="queryParams.most"
+          placeholder="最大查询范围"
+        ></el-input>
+      </el-form-item>
+
       <el-form-item>
         <el-button
           type="primary"
@@ -93,7 +121,11 @@
       </el-table-column>
       <el-table-column label="年度投资完成百分比" align="center" prop="retio">
         <template slot-scope="scope">
-          {{ scope.row.retio }}
+          {{
+            scope.row.retio
+              ? scope.row.retio.toFixed(2) * 100 + "%"
+              : scope.row.retio
+          }}
         </template>
       </el-table-column>
       <el-table-column label="形象进度" align="center" prop="schedule">
@@ -172,7 +204,7 @@ import {
   delARTICLE,
   addARTICLE,
   updateARTICLE,
-  getUserInfo
+  getUserInfo,
 } from "@/api/portal/ARTICLE/ARTICLE.js";
 import edit from "./edit.vue";
 import enterData from "./enterData.vue";
@@ -181,6 +213,11 @@ export default {
   name: "ARTICLE",
   data() {
     return {
+      scaleList: [
+        { label: "小型", value: 1 },
+        { label: "中型", value: 2 },
+        { label: "大型", value: 3 },
+      ],
       statusList: [
         { label: "已保存", value: 0 },
         { label: "审核中", value: 1 },
@@ -227,21 +264,23 @@ export default {
         reality: null,
         retio: null,
         schedule: null,
+        least:null,
+        most:null
       },
-      deptId:'',
+      deptId: "",
     };
   },
   created() {
     this.getList();
-    this.getDeptId()
+    this.getDeptId();
   },
   methods: {
-    getDeptId(){
-      getUserInfo().then(res=>{
-        this.deptId = res.user.deptId
-      })
+    getDeptId() {
+      getUserInfo().then((res) => {
+        this.deptId = res.user.deptId;
+      });
     },
-    showDetail(row){
+    showDetail(row) {
       const id = row.id || this.ids;
       this.iframe({
         obj: detail,
@@ -254,7 +293,7 @@ export default {
     showEnterData(param) {
       this.iframe({
         obj: enterData,
-        param: { param:param,deptId:this.deptId },
+        param: { param: param, deptId: this.deptId },
         title: "数据填报",
         width: "500px",
         height: "350px",
@@ -287,6 +326,8 @@ export default {
     },
     /** 重置按钮操作 */
     resetQuery() {
+      this.queryParams.least = null
+      this.queryParams.most = null
       this.resetForm("queryForm");
       this.handleQuery();
     },
@@ -337,3 +378,14 @@ export default {
   },
 };
 </script>
+
+<style scoped>
+.ec-input-range-divider {
+  display: inline-block;
+  width: 7px;
+  height: 1px;
+  background: #c0c4cc;
+  margin-bottom: 4px;
+  margin: 0 5px;
+}
+</style>