shuishen
2024-01-16 f100ef511bfd5cb27e553a41abcb8fbd7dcc3fe4
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="60%" :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() {
@@ -77,28 +86,26 @@
          addBtn: false,
          searchMenuSpan: 3,
          menuWidth: 500,
          column: [{
              label: 'ID',
              prop: 'id',
              searchSpan: 4,
              display: false,
            },
            {
              label: '标题',
              prop: 'title',
              searchSpan: 4,
            },
          column: [
            //   {
            //     label: '标题',
            //     prop: 'title',
            //     searchSpan: 4,
            //     span: 6,
            // },
            {
              label: '参与人数',
              prop: 'topsCount',
              searchSpan: 4,
              display: false,
              span: 6,
            },
            {
              label: '开启投票',
              prop: 'openFlag',
              type: 'radio',
              button: true,
              span: 6,
              value: 0,
              dicData: [{
                label: '开启',
@@ -117,6 +124,7 @@
              prop: 'voteRestrictions',
              type: 'radio',
              button: true,
              span: 6,
              dicData: [{
                label: '一人一票',
                value: 0
@@ -135,6 +143,7 @@
              prop: 'signatureFlag',
              type: 'radio',
              button: true,
              span: 6,
              dicData: [{
                label: '不需要',
                value: 0
@@ -153,6 +162,7 @@
              prop: 'appointUser',
              type: 'radio',
              button: true,
              span: 6,
              dicData: [{
                label: '不限制',
                value: 0
@@ -167,8 +177,31 @@
              }, ],
              value: 0
            },
            {
              display: false,
              label: "选择用户",
              prop: "userIds",
              type: 'select',
              span: 6,
              remote: true,
              hide: true,
              dicUrl: "",
              props: {
                label: 'name',
                value: 'id',
              },
              dicData: [],
              rules: [{
                required: true,
                message: '请输入姓名',
                trigger: 'blur'
              }],
            },
            {
              label: "截止时间",
              span: 6,
              prop: "endTime",
              type: "datetime",
              format: "yyyy-MM-dd hh:mm:ss",
@@ -190,8 +223,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 +254,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 +279,7 @@
        )
      },
      init(data) {
        this.$refs.DisCussFrom && this.$refs.DisCussFrom.resetForm()
        this.dialogVisibles = true
        this.disCussFrom = {}
        this.discussion = data
@@ -232,7 +289,6 @@
      handleClose() {
        this.dialogVisibles = false
        this.disCussFrom = {}
        this.$refs.DisCussFrom && this.$refs.DisCussFrom.resetForm()
        console.log(this.$refs, 90999)
@@ -247,7 +303,15 @@
          const data = res.data.data
          this.page.total = data.total
          this.disCussFrom = data.records[0]
          this.loading = false
          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 +322,4 @@
  .el-pagination {
    margin-top: 20px;
  }
</style>
</style>