浏览代码

重点项目测试

Sanmu8 1 年之前
父节点
当前提交
5ff113d43f
共有 3 个文件被更改,包括 94 次插入43 次删除
  1. 9 0
      src/api/portal/ARTICLE/ARTICLE.js
  2. 58 24
      src/views/ARTICLE/edit.vue
  3. 27 19
      src/views/ARTICLE/index.vue

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

@@ -51,3 +51,12 @@ export function delARTICLE(id) {
     method: 'get'
   })
 }
+// 获取用户信息   用来查询列表和新增
+export function getUserInfo(id) {
+  return request({
+    url: '/ARTICLE/remove/' + id,
+    method: 'get'
+  })
+}
+
+

+ 58 - 24
src/views/ARTICLE/edit.vue

@@ -2,35 +2,54 @@
   <div class="cmain">
     <el-form ref="form" :model="form" :rules="rules" label-width="120px">
       <el-form-item label="项目名称" prop="atvName">
-        <el-input v-model="form.atvName" placeholder="请输入项目名称"></el-input>
-      </el-form-item>
-      <el-form-item label="项目情况概述" prop="preview">
-        <el-input v-model="form.preview" placeholder="请输入建设规模"></el-input>
+        <el-input
+          v-model="form.atvName"
+          placeholder="请输入项目名称"
+          style="width: 50%"
+        ></el-input>
       </el-form-item>
       <el-form-item label="建设规模" prop="scale">
-        <el-input type="number" v-model="form.scale" placeholder="请输入建设规模"></el-input>
-      </el-form-item>
-      <el-form-item label="单位" prop="unit">
-        <el-input v-model="form.unit" placeholder="请输入单位"></el-input>
+        <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="建设内容" prop="content">
-        <el-input v-model="form.content" placeholder="请输入建设内容"></el-input>
+        <el-input
+          type="textarea"
+          :rows="5"
+          v-model="form.content"
+          placeholder="请输入建设内容"
+        ></el-input>
       </el-form-item>
       <el-form-item label="年度投资计划" prop="plan">
-        <el-input type="number" v-model="form.plan" placeholder="请输入年度投资计划"></el-input>
-      </el-form-item>
-      <el-form-item label="实际完成投资额" prop="reality">
-        <el-input type="number" v-model="form.reality" placeholder="请输入实际完成投资额"></el-input>
-      </el-form-item>
-      <el-form-item label="完成百分比" prop="retio">
-        <el-input type="number" v-model="form.retio" placeholder="请输入完成百分比"></el-input>
+        <el-input
+          type="number"
+          v-model="form.plan"
+          placeholder="请输入年度投资计划"
+          style="width: 50%"
+        ></el-input>
       </el-form-item>
       <el-form-item label="形象进度" prop="schedule">
-        <el-input type="number" v-model="form.schedule" placeholder="请输入形象进度"></el-input>
+        <el-input
+          type="number"
+          v-model="form.schedule"
+          placeholder="请输入形象进度"
+          style="width: 50%"
+        ></el-input>
       </el-form-item>
     </el-form>
     <div slot="footer" class="mfooter">
-      <el-button type="primary" @click="submitForm">确 定</el-button>
+      <el-button type="primary" @click="submitForm(0)">保 存</el-button>
+      <el-button type="primary" @click="submitForm(1)">提交审核</el-button>
       <el-button @click="$layer.close(layerid)">取 消</el-button>
     </div>
   </div>
@@ -47,6 +66,11 @@ import {
 export default {
   data() {
     return {
+      scaleList: [
+        { label: "小型", value: 1 },
+        { label: "中型", value: 2 },
+        { label: "大型", value: 3 },
+      ],
       // 表单参数
       form: {},
       // 表单校验
@@ -107,7 +131,7 @@ export default {
   },
   methods: {
     /** 提交按钮 */
-    submitForm() {
+    submitForm(type) {
       this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.form.id != null) {
@@ -117,11 +141,21 @@ export default {
               this.$parent.getList();
             });
           } else {
-            addARTICLE(this.form).then((response) => {
-              this.$modal.msgSuccess("新增成功");
-              this.$layer.close(this.layerid);
-              this.$parent.getList();
-            });
+            if (type == 0) {
+              this.form.status = 0
+              addARTICLE(this.form).then((response) => {
+                this.$modal.msgSuccess("保存成功");
+                this.$layer.close(this.layerid);
+                this.$parent.getList();
+              });
+            } else if (type == 1) {
+              this.form.status = 1
+              updateARTICLE(this.form).then((response) => {
+                this.$modal.msgSuccess("提交审核成功");
+                this.$layer.close(this.layerid);
+                this.$parent.getList();
+              });
+            }
           }
         }
       });

+ 27 - 19
src/views/ARTICLE/index.vue

@@ -24,30 +24,22 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="ARTICLEList">
-      <el-table-column label="项目名称" align="center" prop="atvName">
+    <el-table :data="ARTICLEList">
+      <el-table-column label="保税区名称" align="center" prop="deptName">
         <template slot-scope="scope">
-          {{scope.row.atvName}}
+          {{scope.row.deptName}}
         </template>
       </el-table-column>
-      <el-table-column label="项目情况概述" align="center" prop="preview">
+      <el-table-column label="项目名称" align="center" prop="atvName">
         <template slot-scope="scope">
-          {{scope.row.preview}}
+          {{scope.row.atvName}}
         </template>
       </el-table-column>
       <el-table-column label="建设规模" align="center" prop="scale">
         <template slot-scope="scope">
-          {{scope.row.scale}}
-        </template>
-      </el-table-column>
-      <el-table-column label="单位" align="center" prop="unit">
-        <template slot-scope="scope">
-          {{scope.row.unit}}
-        </template>
-      </el-table-column>
-      <el-table-column label="建设内容" align="center" prop="content">
-        <template slot-scope="scope">
-          {{scope.row.content}}
+          <el-tag v-if="scope.row.scale == 1" type="success">小型</el-tag>
+          <el-tag v-else-if="scope.row.scale == 2" type="success">中型</el-tag>
+          <el-tag v-else-if="scope.row.scale == 3" type="success">大型</el-tag>
         </template>
       </el-table-column>
       <el-table-column label="年度投资计划" align="center" prop="plan">
@@ -60,7 +52,7 @@
           {{scope.row.reality}}
         </template>
       </el-table-column>
-      <el-table-column label="完成百分比" align="center" prop="retio">
+      <el-table-column label="年度投资完成百分比" align="center" prop="retio">
         <template slot-scope="scope">
           {{scope.row.retio}}
         </template>
@@ -70,6 +62,15 @@
           {{scope.row.schedule}}
         </template>
       </el-table-column>
+      <el-table-column label="项目审核状态" align="center" prop="status">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.status == 0">草稿</el-tag>
+          <el-tag v-else-if="scope.row.status == 1" type="info">审核中</el-tag>
+          <el-tag v-else-if="scope.row.status == 2" type="danger">审核拒绝</el-tag>
+          <el-tag v-else-if="scope.row.status == 3" type="success">已审核</el-tag>
+        </template>
+      </el-table-column>
+
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -78,6 +79,7 @@
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['business:ARTICLE:edit']"
+            v-if="scope.row.status == 0 || scope.row.status == 2"
           >修改</el-button>
           <el-button
             size="mini"
@@ -108,6 +110,12 @@ export default {
   name: "ARTICLE",
   data() {
     return {
+      statusList:[
+        { label:'已保存' , value:0 },
+        { label:'审核中' , value:1 },
+        { label:'审核驳回' , value:2 },
+        { label:'已审核' , value:3 },
+      ],
       // 根路径
       baseURL: process.env.VUE_APP_BASE_API,
       // 遮罩层
@@ -182,12 +190,12 @@ export default {
     },
      /** 新增按钮操作 */
      handleAdd() {
-      this.iframe({ obj: edit, param: {}, title: '添加重点项目', width: '1050px', height: '750px' });
+      this.iframe({ obj: edit, param: {}, title: '添加重点项目', width: '1050px', height: '80%' });
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
       const id = row.id || this.ids;
-      this.iframe({ obj: edit, param: { id: id }, title: '修改重点项目', width: '1050px', height: '750px' });
+      this.iframe({ obj: edit, param: { id: id }, title: '修改重点项目', width: '1050px', height: '80%' });
     },
     /** 删除按钮操作 */
     handleDelete(row) {