Переглянути джерело

自定义栏位修改后刷新显示栏位

zhuliu 9 місяців тому
батько
коміт
31276da4c3

+ 7 - 2
src/views/components/drawer/Field.vue

@@ -202,7 +202,8 @@ export default {
       btnLoading: false,
       loading: false,
       optionLoading: false,
-      tableData: []
+      tableData: [],
+      change:false,
     }
   },
   mounted() {
@@ -243,11 +244,12 @@ export default {
       this.projectId = id
       this.drawer = true
       this.searchOption.projectId = this.projectId
+      this.change = false
       this.getList()
     },
     close() {
       this.drawer = false
-      this.$emit('close',this.projectId)
+      this.$emit('close',this.projectId,this.change)
     },
     close2() {
       this.lockOption = false
@@ -477,6 +479,7 @@ export default {
             this.$api.updateCustomField(this.ruleForm).then(response => {
               this.$message.success('编辑成功')
               this.btnLoading = false
+              this.change = true
               this.getList()
               this.cancel()
             }).catch(error => {
@@ -486,6 +489,7 @@ export default {
             this.$api.addCustomField(this.ruleForm).then(response => {
               this.$message.success('新增成功')
               this.btnLoading = false
+              this.change = true
               this.getList()
               this.cancel()
             }).catch(error => {
@@ -511,6 +515,7 @@ export default {
         this.$api.deleteCustomField(ids).then(response => {
           this.$message.success('删除成功')
           this.loading = false
+          this.change = true
           this.getList()
         }).catch(error => {
           this.loading = false

+ 13 - 1
src/views/project/patentCollection/index.vue

@@ -212,7 +212,7 @@
       </el-container>
     </el-container>
 
-    <Field-Drawer ref="FieldDrawer"></Field-Drawer>
+    <Field-Drawer ref="FieldDrawer" @close="closeFieldDrawer"></Field-Drawer>
     <field ref="field" type="patent" :projectId="projectId" @getFieldList="getFieldList"></field>
     <!-- 报告文档 -->
     <reportFileDrawer ref="reportFileDrawer"></reportFileDrawer>
@@ -639,6 +639,18 @@ export default {
       }
       this.$refs.FieldDrawer.open(this.projectId)
     },
+    //关闭自定义栏位弹窗
+    async closeFieldDrawer(projectId,change){
+      if(change){
+        this.customList = await this.$commonJS.getCustomField('patent', { projectId: this.projectId, taskId: this.taskId })
+        this.getColumn()
+        this.$refs.customFields.getAllCountColumns()
+        setTimeout(()=>{
+          this.$refs.customFields.refreshOptions(1)
+        },500)
+        
+      }
+    },
     //获取显示栏位
     getFieldList(data) {
       this.customList = []