From 4522ab3fe8bd45ee753ef187448c1e884bbc601f Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Thu, 18 Apr 2024 11:09:27 +0800
Subject: [PATCH] Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/jczz_web

---
 src/views/article/components/discussionManageChild.vue |   77 ++++++++++++++++++++++++++++++++------
 1 files changed, 64 insertions(+), 13 deletions(-)

diff --git a/src/views/article/components/discussionManageChild.vue b/src/views/article/components/discussionManageChild.vue
index ec2efbf..3adc6a6 100644
--- a/src/views/article/components/discussionManageChild.vue
+++ b/src/views/article/components/discussionManageChild.vue
@@ -4,6 +4,9 @@
       @close="handleClose" @open="opens">
       <avue-form ref="DisCussFrom" :option="option" v-model="froms" @submit="handleSubmit"></avue-form>
     </el-dialog>
+
+    <userList ref="userList" @selectPersonList="selectPersonList"></userList>
+
   </div>
 </template>
 
@@ -27,6 +30,8 @@
   import {
     getDictionary
   } from '@/api/system/dict'
+  import userList from "./userList.vue";
+
 
   // import {
   //   getList as getHouseholdList,
@@ -39,6 +44,9 @@
 
   let formData = {}
   export default {
+    components: {
+      userList
+    },
     data() {
       return {
         dialogVisibles: false,
@@ -132,6 +140,28 @@
               value: 0
             },
             {
+              label: '票数公开',
+              prop: 'voteNumberPublic',
+              type: 'radio',
+              button: true,
+              row: true,
+              span: 12,
+              offset: 8,
+              dicData: [{
+                label: '不需要',
+                value: 0
+              }, {
+                label: '需要',
+                value: 1
+              }],
+              rules: [{
+                required: true,
+                message: "请选择是否票数公开",
+                trigger: "blur",
+              }, ],
+              value: 0
+            },
+            {
               label: '指定用户',
               prop: 'appointUser',
               type: 'radio',
@@ -156,9 +186,9 @@
             {
               display: false,
               label: "选择用户",
-              prop: "userIds",
+              prop: "userName",
               tags: true,
-              type: "tree",
+              type: "input",
               multiple: true,
               span: 12,
               offset: 8,
@@ -166,16 +196,25 @@
               hide: true,
               row: true,
               // dicUrl: `/api/blade-system/user/getUserlnfoByDistrictlds?districtlds={{}}`,
-              props: {
-                label: 'name',
-                value: 'id',
-              },
-              dicData: [],
+              // props: {
+              //   label: 'name',
+              //   value: 'id',
+              // },
+              // dicData: [],
               rules: [{
                 required: true,
                 message: '请输入姓名',
                 trigger: 'blur'
               }],
+              focus: ({
+                value,
+                column
+              }) => {
+                // this.$message.success('focus事件查看控制台')
+                // console.log('获取焦点', value, column)
+                // this.$refs.userList && this.$refs.userList.resetForm()
+                this.$refs.userList.show(this.discussion.articleRange)
+              },
             },
 
             {
@@ -202,17 +241,19 @@
           openFlag: 0,
           voteRestrictions: 1,
           signatureFlag: 1,
+          voteNumberPublic: 1,
           appointUser: 0,
 
         },
         dialogVisibles: false,
         articleId: '',
         discussion: {},
-        id: ""
+        id: "",
+        personList: [],
       }
     },
     created() {
-      this.getUserList()
+      // this.getUserList()
     },
 
     mounted() {
@@ -222,9 +263,10 @@
     watch: {
       'froms.appointUser': {
         handler(newData) {
-          const column = this.findObject(this.option.column, "userIds")
+          const column = this.findObject(this.option.column, "userName")
           if (newData == 1) {
             column.display = true
+            // this.$refs.userList.show()
           } else {
             column.display = false
           }
@@ -242,10 +284,18 @@
       }
     },
     methods: {
+      selectPersonList(personList) {
+        console.log(personList, "++++++++++++")
+        this.personList = personList
+        let nameList = personList.map(e => {
+          return e.name
+        })
+        this.froms.userName = nameList.join(",")
+      },
       getuserInfoByDistrictId() {
         getUserlnfoByDistrictlds(this.discussion.articleRange).then(res => {
           const column = this.findObject(this.option.column, "userIds")
-          column.dicData = res.data.data
+          column.dicData = res.data.data.records
         })
       },
       getUserList() {
@@ -257,7 +307,8 @@
       handleSubmit(form, done) {
         form.articleId = this.articleId
         form.eventType = 1
-        form.userIds = JSON.stringify(form.userIds)
+        form.userIds = this.personList.map(e => e.id).join(",")
+        // form.userIds = JSON.stringify(form.userIds)
         if (form.appointUser == 0) {
           form.userIds = ''
         }
@@ -353,7 +404,7 @@
               this.froms.userIds = JSON.parse(this.froms.userIds)
             }
           }
-          this.getuserInfoByDistrictId()
+          // this.getuserInfoByDistrictId()
 
         })
       },

--
Gitblit v1.9.3