فهرست منبع

fix 自定义突破

scorpio 2 سال پیش
والد
کامیت
ead8d20322
3فایلهای تغییر یافته به همراه28 افزوده شده و 3 حذف شده
  1. 20 1
      src/views/home/component/dispatch.vue
  2. 6 0
      src/views/home/component/inspect/Inspect1.vue
  3. 2 2
      src/views/home/pro_detail.vue

+ 20 - 1
src/views/home/component/dispatch.vue

@@ -16,6 +16,7 @@
               @click="exportFile"
             />
             <base-button
+              v-if="projectInfo.can_update"
               class="ml-10"
               :title="btnTitle"
               icon="upload"
@@ -50,7 +51,13 @@
           @row-del="rowDel"
         >
           <template #menu="{ row }">
-            <el-button icon="Upload" type="primary" text @click="openFile(row)">
+            <el-button
+              v-if="projectInfo.can_update"
+              icon="Upload"
+              type="primary"
+              text
+              @click="openFile(row)"
+            >
               上传
             </el-button>
             <el-button
@@ -89,6 +96,7 @@
           <div class="flex flex-center">
             <base-button
               type="0"
+              v-if="projectInfo.can_update"
               title="上传"
               icon="upload"
               @click="
@@ -138,6 +146,10 @@ export default {
   name: 'dispatch',
   components: { BasicContainer, baseButton },
   props: {
+    projectInfo: {
+      type: Object,
+      default: {}
+    },
     year: {
       type: Number,
       default: 0
@@ -148,6 +160,12 @@ export default {
     }
   },
   watch: {
+    projectInfo: {
+      handler(val) {
+        this.option.delBtn = val.can_update
+      },
+      immediate: true
+    },
     year: {
       handler(val) {
         if (val) {
@@ -263,6 +281,7 @@ export default {
         if (res.code === 200) {
           this.progress = res.data.processDescribe
           this.info = res.data
+          console.log(this.info)
         } else {
           this.$message.error(res.msg)
         }

+ 6 - 0
src/views/home/component/inspect/Inspect1.vue

@@ -43,6 +43,10 @@ import option5 from '@/views/home/component/inspect/option5.js'
 export default {
   name: 'Inspect1',
   props: {
+    projectInfo: {
+      type: Object,
+      default: {}
+    },
     info: {
       type: Object,
       default: null
@@ -130,6 +134,8 @@ export default {
       } else if (key === '5') {
         this.option = option5
       }
+      this.option.addBtn = this.projectInfo.can_update
+      console.log(this.option.addBtn)
     },
     add() {
       this.$refs.crud.rowAdd()

+ 2 - 2
src/views/home/pro_detail.vue

@@ -35,13 +35,13 @@
       <div v-else-if="currentTab.value === 2">
         <basic-container v-for="(item, index) in resultList" :key="item.id">
           <div class="full-width" :id="`header` + (index + 1)">
-            <inspect1 :info="item" />
+            <inspect1 :info="item" :projectInfo="data" />
           </div>
         </basic-container>
       </div>
       <div v-else-if="currentTab.value === 3">
         <div class="full-width">
-          <dispatch :year="year" :month="month" />
+          <dispatch :projectInfo="data" :year="year" :month="month" />
         </div>
       </div>
     </div>