linwei
2024-01-10 c3f74a89ea1f6a03858c4a8e42e5ceedee807273
src/views/article/components/discussionManageChild.vue
@@ -7,6 +7,8 @@
</template>
<script>
import { getPersonPublicSelect } from "@/api/public"
import {
    getListPd,
    getDetailPd,
@@ -172,101 +174,30 @@
                    },],
                    value: 0
                },
                {
                    display: false,
                    label: "选择用户",
                    prop: "userIds",
                    hide: true,
                    type: "table",
                    display: false,
                    type: 'select',
                    span: 6,
                    // labelWidth: 120,
                    searchSpan: 4,
                    search: true,
                    children: {
                        border: true,
                        height: 400,
                        searchShow: true,
                        searchMenuSpan: 6,
                        submitText: "确定",
                        column: [{
                            label: "姓名",
                            prop: "name",
                            search: true,
                            searchSpan: 4,
                            rules: [{
                                required: true,
                                message: "请输入姓名",
                                trigger: "blur",
                            },],
                        },
                        {
                            label: "联系方式",
                            prop: "phoneNumber",
                            search: true,
                            searchSpan: 4,
                            rules: [{
                                required: true,
                                message: "请输入联系方式",
                                trigger: "blur",
                            },],
                        },
                        {
                            label: "地址",
                            search: true,
                            searchSpan: 8,
                            prop: "currentAddress",
                            display: false
                        },
                        ],
                    },
                    page: {
                        pageSize: 10,
                        currentPage: 1,
                        total: 0
                    },
                    formatter: (row) => {
                        // this.form.phoneNumber =  row.phoneNumber
                        return row.name
                    },
                    onLoad: ({
                        page,
                        value,
                        data
                    }, callback) => {
                        //首次加载去查询对应的值
                        if (value) {
                            getHouseholdDetail(value).then(res => {
                                var resData = res.data.data
                                // 查询对应行数据
                                callback(resData)
                                return
                            })
                        }
                        if (page) {
                            this.loading = true
                            var params = {
                                ...data,
                                townStreetCode: "361102005"
                            }
                            getHouseholdList(page.currentPage, page.pageSize, Object.assign(params)).then(res => {
                                const resData = res.data.data
                                var total = resData.total
                                var data = resData.records
                                this.loading = false
                                this.selectionClear()
                                //分页查询信息
                                callback({
                                    total: total,
                                    data: data
                                })
                            })
                        }
                    },
                    remote: true,
                    hide: true,
                    dicUrl: "",
                    props: {
                        label: 'name',
                        value: 'id'
                    }
                        value: 'id',
                    },
                    dicData: [],
                    rules: [
                        {
                            required: true,
                            message: '请输入姓名',
                            trigger: 'blur'
                        }
                    ],
                },
                {
                    label: "截止时间",
                    span: 6,
@@ -291,9 +222,14 @@
            discussion: {},
        }
    },
    created () {
        this.getUserList()
    },
    mounted () {
    },
    watch: {
        'disCussFrom.appointUser': {
            handler (newData) {
@@ -304,20 +240,6 @@
                    column.display = false
                }
            },
        },
        "disCussFrom.userIds": {
            // form是表单或者表格绑定的数据集,v-model='form'
            handler (val) {
                this.$nextTick(() => {
                    console.log(this.$refs, 66666)
                    // getHouseholdDetail(val).then(res => {
                    //   const data = res.data.data
                    //   this.form.phoneNumber = data.phoneNumber
                    //   this.form.currentAddress = data.currentAddress
                    // })
                })
            },
            immediate: true,
        },
    },
    computed: {
@@ -331,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
@@ -350,6 +278,7 @@
            )
        },
        init (data) {
            this.$refs.DisCussFrom && this.$refs.DisCussFrom.resetForm()
            this.dialogVisibles = true
            this.disCussFrom = {}
            this.discussion = data
@@ -373,7 +302,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
                })
            })
        }
    }
@@ -384,4 +321,4 @@
.el-pagination {
    margin-top: 20px;
}
</style>
</style>