From ab701df859cd79ae036f8cc86268137d2c8da8ee Mon Sep 17 00:00:00 2001
From: guanqb <18720758508@163.com>
Date: Thu, 22 Feb 2024 18:00:56 +0800
Subject: [PATCH] 消防自查导出、消防自查和场所检查增加场所类别字段

---
 src/views/article/components/discussionManageChild.vue |  111 +++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 87 insertions(+), 24 deletions(-)

diff --git a/src/views/article/components/discussionManageChild.vue b/src/views/article/components/discussionManageChild.vue
index e6cd35e..8e3f361 100644
--- a/src/views/article/components/discussionManageChild.vue
+++ b/src/views/article/components/discussionManageChild.vue
@@ -1,14 +1,16 @@
 <template>
-
   <div>
-    <el-dialog title="" append-to-body :visible.sync="dialogVisibles" width="80%" :before-close="handleClose">
+    <el-dialog title="" append-to-body :visible.sync="dialogVisibles" width="50%" :before-close="handleClose">
       <avue-form ref="DisCussFrom" :option="option" v-model="disCussFrom" @submit="handleSubmit"></avue-form>
     </el-dialog>
   </div>
-
 </template>
 
 <script>
+  import {
+    getPersonPublicSelect
+  } from "@/api/public"
+
   import {
     getListPd,
     getDetailPd,
@@ -28,6 +30,13 @@
   import {
     getDictionary
   } from '@/api/system/dict'
+
+  import {
+    getList as getHouseholdList,
+    getDetatils as getHouseholdDetail
+  } from "@/api/userHouse/list/houseHold"
+
+
 
   export default {
     data() {
@@ -78,27 +87,13 @@
           searchMenuSpan: 3,
           menuWidth: 500,
           column: [{
-              label: 'ID',
-              prop: 'id',
-              searchSpan: 4,
-              display: false,
-            },
-            {
-              label: '标题',
-              prop: 'title',
-              searchSpan: 4,
-            },
-            {
-              label: '参与人数',
-              prop: 'topsCount',
-              searchSpan: 4,
-              display: false,
-            },
-            {
               label: '开启投票',
               prop: 'openFlag',
               type: 'radio',
               button: true,
+              row: true,
+              span: 6,
+              offset: 8,
               value: 0,
               dicData: [{
                 label: '开启',
@@ -117,6 +112,9 @@
               prop: 'voteRestrictions',
               type: 'radio',
               button: true,
+              row: true,
+              span: 12,
+              offset: 8,
               dicData: [{
                 label: '一人一票',
                 value: 0
@@ -135,6 +133,9 @@
               prop: 'signatureFlag',
               type: 'radio',
               button: true,
+              row: true,
+              span: 6,
+              offset: 8,
               dicData: [{
                 label: '不需要',
                 value: 0
@@ -148,11 +149,15 @@
                 trigger: "blur",
               }, ],
               value: 0
-            }, {
+            },
+            {
               label: '指定用户',
               prop: 'appointUser',
               type: 'radio',
               button: true,
+              row: true,
+              span: 12,
+              offset: 8,
               dicData: [{
                 label: '不限制',
                 value: 0
@@ -167,8 +172,35 @@
               }, ],
               value: 0
             },
+
+            {
+              display: false,
+              label: "选择用户",
+              prop: "userIds",
+              type: 'select',
+              span: 6,
+              offset: 8,
+              remote: true,
+              hide: true,
+              row: true,
+              dicUrl: "",
+              props: {
+                label: 'name',
+                value: 'id',
+              },
+              dicData: [],
+              rules: [{
+                required: true,
+                message: '请输入姓名',
+                trigger: 'blur'
+              }],
+            },
+
             {
               label: "截止时间",
+              span: 6,
+              offset: 8,
+              row: true,
               prop: "endTime",
               type: "datetime",
               format: "yyyy-MM-dd hh:mm:ss",
@@ -190,8 +222,25 @@
         discussion: {},
       }
     },
+    created() {
+      this.getUserList()
+    },
+
     mounted() {
 
+    },
+
+    watch: {
+      'disCussFrom.appointUser': {
+        handler(newData) {
+          const column = this.findObject(this.option.column, "userIds")
+          if (newData == 1) {
+            column.display = true
+          } else {
+            column.display = false
+          }
+        },
+      },
     },
     computed: {
       ...mapGetters(["permission"]),
@@ -204,6 +253,12 @@
       }
     },
     methods: {
+      getUserList() {
+        let dicUrl = `/api/blade-household/household/selectHouseholdList?searchKey={{key}}&limit=20`
+        const column = this.findObject(this.option.column, "userIds")
+        column.dicUrl = dicUrl
+      },
+
       handleSubmit(row, done) {
         row.articleId = this.articleId
         row.eventType = 1
@@ -223,6 +278,7 @@
         )
       },
       init(data) {
+        this.$refs.DisCussFrom && this.$refs.DisCussFrom.resetForm()
         this.dialogVisibles = true
         this.disCussFrom = {}
         this.discussion = data
@@ -232,7 +288,6 @@
 
       handleClose() {
         this.dialogVisibles = false
-        this.disCussFrom = {}
         this.$refs.DisCussFrom && this.$refs.DisCussFrom.resetForm()
 
         console.log(this.$refs, 90999)
@@ -247,7 +302,15 @@
           const data = res.data.data
           this.page.total = data.total
           this.disCussFrom = data.records[0]
-          this.loading = false
+          if (this.disCussFrom.userIds) {
+            getPersonPublicSelect({
+              id: this.disCussFrom.userIds
+            }).then(res => {
+              const column = this.findObject(this.option.column, "userIds")
+              column.dicData = res.data.data
+              this.loading = false
+            })
+          }
         })
       }
     }
@@ -258,4 +321,4 @@
   .el-pagination {
     margin-top: 20px;
   }
-</style>
+</style>
\ No newline at end of file

--
Gitblit v1.9.3