Browse Source

merge fix

scorpio 2 years ago
parent
commit
6ce1ecf0f6

+ 2 - 2
src/api/inspect/index.js

@@ -20,8 +20,8 @@ export default {
    * @param params
    * @returns {Promise | Promise<unknown>}
    */
-  removeList (params) {
-    return fetch('/blade-project-manage-v2/companyfilefolder/v2/remove', params, 'post')
+  report (params) {
+    return fetch('/blade-project-manage-v2/report/v2/save', params, 'post')
   }
 
 }

+ 11 - 4
src/views/home/component/dash.vue

@@ -41,7 +41,10 @@
                @refresh-change="refreshChange"
                @on-load="onLoad">
       <template #menu="{row}">
-        <el-button icon="Upload" type='primary' text @click="track(row.id)">项目上报</el-button>
+        <el-button icon="Upload" type='primary' text @click="track(row)"> {{
+            row.isReport === 1 ? "已上报" : "项目上报"
+          }}
+        </el-button>
       </template>
     </avue-crud>
     <!--    新增-->
@@ -283,7 +286,7 @@ export default {
     }
   },
   created () {
-    // this.getTypeList()
+    this.getTypeList()
     this.$bus.on('serach', (res) => {
       this.onLoad(res)
     })
@@ -390,13 +393,17 @@ export default {
         }
       })
     },
-    track (id) {
+    track (res) {
+      if (res.isReport === 1) {
+        this.$message.error('该项目已经上报')
+        return
+      }
       this.$confirm('是否确定进行项目上报', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        const data = { id, isReport: 1 }
+        const data = { id: res.id, isReport: 1 }
         this.$api.project.proUpdate(data).then(res => {
           if (res.code === 200) {
             console.log(res)

+ 55 - 4
src/views/home/component/inspect/Inspect1.vue

@@ -1,22 +1,32 @@
 <template>
   <div class='flex flex-justify-start flex-align-center flex-col'>
-    <span class='full-width text-left'>{{ info.dictValue }}</span>
+    <span class='full-width text-left mt-20'>{{ info.dictValue }}</span>
     <div style='width: 95%;' class='mt-20'>
       <avue-crud
           :option="option"
           :data="data"
           ref="crud"
           v-model="form"
+          :table-loading="loading"
           :before-open="beforeOpen"
           @row-del="rowDel"
           @row-save="rowSave"
           @row-update="rowUpdate">
+        <template #menu="{row}">
+          <el-button text type='primary' icon='el-icon-plus' @click='report(row)'>上报</el-button>
+        </template>
       </avue-crud>
     </div>
   </div>
 </template>
 
 <script>
+import option1 from '@/views/home/component/inspect/option1.js'
+import option2 from '@/views/home/component/inspect/option2.js'
+import option3 from '@/views/home/component/inspect/option3.js'
+import option4 from '@/views/home/component/inspect/option4.js'
+import option5 from '@/views/home/component/inspect/option5.js'
+
 export default {
   name: 'Inspect1',
   props: {
@@ -25,8 +35,19 @@ export default {
       default: null
     }
   },
+  watch: {
+    info: {
+      handler (val) {
+        if (val) {
+          this.changeColum(val.dictKey)
+        }
+      },
+      immediate: true
+    }
+  },
   data () {
     return {
+      loading: false,
       form: {},
       data: [],
       projectId: '',
@@ -37,7 +58,6 @@ export default {
       option: {
         align: 'center',
         menuAlign: 'center',
-        menuWidth: 180,
         addBtn: true,
         refreshBtn: false,
         columnBtn: false,
@@ -85,12 +105,42 @@ export default {
     this.onLoad()
   },
   methods: {
+    changeColum (key) {
+      if (key === '1') {
+        this.option = option1
+      } else if (key === '2') {
+        this.option = option2
+      } else if (key === '3') {
+        this.option = option3
+      } else if (key === '4') {
+        this.option = option4
+      } else if (key === '5') {
+        this.option = option5
+      }
+    },
     add () {
       this.$refs.crud.rowAdd()
     },
+    report (row) {
+      this.$confirm('是否确定进行上报操作?', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.loading = true
+        this.$api.inspect.report({ projectInspectorId: row.id }).then(res => {
+          this.loading = false
+          if (res.code === 200) {
+            this.onLoad()
+          } else {
+            this.$message.error(res.msg)
+          }
+        })
+      })
+    },
     onLoad () {
       const data = {
-        projectInfoId: this.projectId,
+        projectId: this.projectId,
         status: this.info.dictKey
       }
       this.loading = true
@@ -111,7 +161,8 @@ export default {
     },
     rowSave (row, done, loading) {
       const data = {
-        projectId: this.projectId
+        projectId: this.projectId,
+        status: this.info.dictKey
       }
       this.$api.inspect.submint(Object.assign(row, data)).then((res) => {
         if (res.code === 200) {

+ 43 - 0
src/views/home/component/inspect/option1.js

@@ -0,0 +1,43 @@
+export default {
+  align: 'center',
+  menuAlign: 'center',
+  addBtn: true,
+  refreshBtn: false,
+  columnBtn: false,
+  labelWidth: 140,
+  border: true,
+  column: [
+    {
+      label: '工作推进情况描述',
+      prop: 'description',
+      span: 24,
+      type: 'textarea'
+    },
+    {
+      label: '填报时间',
+      prop: 'createTime',
+      display: false
+    },
+    {
+      label: '是否已经上报',
+      prop: 'isReport',
+      type: 'select',
+      display: false,
+      dicData: [
+        {
+          label: '否',
+          value: 0
+        },
+        {
+          label: '是',
+          value: 1
+        }
+      ]
+    },
+    {
+      label: '上报时间',
+      prop: 'reportTime',
+      display: false
+    }
+  ]
+}

+ 53 - 0
src/views/home/component/inspect/option2.js

@@ -0,0 +1,53 @@
+export default {
+  align: 'center',
+  menuAlign: 'center',
+  addBtn: true,
+  refreshBtn: false,
+  columnBtn: false,
+  labelWidth: 140,
+  border: true,
+  column: [
+    {
+      label: '存在的问题',
+      prop: 'description',
+      span: 24,
+      type: 'textarea'
+    },
+    {
+      label: '填报时间',
+      prop: 'createTime',
+      display: false
+    },
+    {
+      label: '是否已经上报',
+      prop: 'isReport',
+      type: 'select',
+      display: false,
+      dicData: [
+        {
+          label: '否',
+          value: 0
+        },
+        {
+          label: '是',
+          value: 1
+        }
+      ]
+    },
+    {
+      label: '上报时间',
+      prop: 'reportTime',
+      display: false
+    },
+    {
+      label: '整改情况',
+      prop: 'reportTime',
+      display: false
+    },
+    {
+      label: '整改完成时间',
+      prop: 'reportTime',
+      display: false
+    }
+  ]
+}

+ 43 - 0
src/views/home/component/inspect/option3.js

@@ -0,0 +1,43 @@
+export default {
+  align: 'center',
+  menuAlign: 'center',
+  addBtn: true,
+  refreshBtn: false,
+  columnBtn: false,
+  labelWidth: 140,
+  border: true,
+  column: [
+    {
+      label: '工作建议',
+      prop: 'description',
+      span: 24,
+      type: 'textarea'
+    },
+    {
+      label: '填报时间',
+      prop: 'createTime',
+      display: false
+    },
+    {
+      label: '是否已经上报',
+      prop: 'isReport',
+      type: 'select',
+      display: false,
+      dicData: [
+        {
+          label: '否',
+          value: 0
+        },
+        {
+          label: '是',
+          value: 1
+        }
+      ]
+    },
+    {
+      label: '上报时间',
+      prop: 'reportTime',
+      display: false
+    }
+  ]
+}

+ 43 - 0
src/views/home/component/inspect/option4.js

@@ -0,0 +1,43 @@
+export default {
+  align: 'center',
+  menuAlign: 'center',
+  addBtn: true,
+  refreshBtn: false,
+  columnBtn: false,
+  labelWidth: 140,
+  border: true,
+  column: [
+    {
+      label: '问题描述',
+      prop: 'description',
+      span: 24,
+      type: 'textarea'
+    },
+    {
+      label: '填报时间',
+      prop: 'createTime',
+      display: false
+    },
+    {
+      label: '是否已经上报',
+      prop: 'isReport',
+      type: 'select',
+      display: false,
+      dicData: [
+        {
+          label: '否',
+          value: 0
+        },
+        {
+          label: '是',
+          value: 1
+        }
+      ]
+    },
+    {
+      label: '上报时间',
+      prop: 'reportTime',
+      display: false
+    }
+  ]
+}

+ 43 - 0
src/views/home/component/inspect/option5.js

@@ -0,0 +1,43 @@
+export default {
+  align: 'center',
+  menuAlign: 'center',
+  addBtn: true,
+  refreshBtn: false,
+  columnBtn: false,
+  labelWidth: 140,
+  border: true,
+  column: [
+    {
+      label: '问题描述',
+      prop: 'description',
+      span: 24,
+      type: 'textarea'
+    },
+    {
+      label: '填报时间',
+      prop: 'createTime',
+      display: false
+    },
+    {
+      label: '是否已经上报',
+      prop: 'isReport',
+      type: 'select',
+      display: false,
+      dicData: [
+        {
+          label: '否',
+          value: 0
+        },
+        {
+          label: '是',
+          value: 1
+        }
+      ]
+    },
+    {
+      label: '上报时间',
+      prop: 'reportTime',
+      display: false
+    }
+  ]
+}

+ 22 - 23
src/views/home/pro_detail.vue

@@ -7,29 +7,28 @@
       <basic-container>
         <basic-tab :tabs='tabs' @change='change'></basic-tab>
       </basic-container>
-      <basic-container style='margin-top: 0'>
-        <div v-if='currentTab.value === 1'>
-          <div v-for='(item,index) in resultList' :key='item.id'>
-            <a :href='`#header`+(index+1)'>
-              <div class='full-width' :id="`header`+(index+1)">
-                <params1 v-if='item.dictKey === "1" ' :info='item'/>
-              </div>
-            </a>
-          </div>
-        </div>
-        <div v-else-if='currentTab.value === 2'>
-          <div v-for='(item,index) in resultList' :key='item.id'>
-            <a :href='`#header`+(index+1)'>
-              <div class='full-width' :id="`header`+(index+1)">
-                <inspect1 v-if='item.dictKey === "1" ' :info='item'/>
-              </div>
-            </a>
-          </div>
-        </div>
-        <div v-else-if='currentTab.value === 3'>
-          tab3
-        </div>
-      </basic-container>
+
+      <div v-if='currentTab.value === 1'>
+        <basic-container v-for='(item,index) in resultList' :key='item.id'>
+          <a :href='`#header`+(index+1)'>
+            <div class='full-width' :id="`header`+(index+1)">
+              <params1 v-if='item.dictKey === "1" ' :info='item'/>
+            </div>
+          </a>
+        </basic-container>
+      </div>
+      <div v-else-if='currentTab.value === 2'>
+        <basic-container v-for='(item,index) in resultList' :key='item.id'>
+          <a :href='`#header`+(index+1)'>
+            <div class='full-width' :id="`header`+(index+1)">
+              <inspect1 :info='item'/>
+            </div>
+          </a>
+        </basic-container>
+      </div>
+      <div v-else-if='currentTab.value === 3'>
+        tab3
+      </div>
     </div>
   </div>
 </template>