<template> <div class="detail-real-box"> <el-form :model="allData.form" :rules="allData.rules" ref="userRef" label-width="80px"> <el-row> <el-col :span="24"> <el-form-item label="接收人" prop="nextTaskApproveUserId"> <el-select filterable v-model="allData.form.nextTaskApproveUserId" placeholder="选择接收人" @change='personchange'> <el-option v-for="dict in allpeople" :key="dict.userId" :label="dict.nickName" :value="dict.userId" /> </el-select> </el-form-item> </el-col> </el-row> <div class="dialog-footer"> <el-button @click="closebg" size="small" class="cancel">取 消</el-button> <el-button type="primary" size="small" @click="confirms">提 交</el-button> </div> </el-form> </div> </template> <script setup> import { getImageUrl, removeAaary } from "@/utils/ruoyi"; import { useRouter } from "vue-router"; const router = useRouter(); const { proxy } = getCurrentInstance(); import moment from "moment"; import useUserStore from "@/store/modules/user"; const appStore = useUserStore(); import bus from "@/utils"; import { deviceCaseadd } from "@/api/cockpit"; import { listUser, } from "@/api/system/user"; const weatherpop = ref(false); const deptOptions = ref(undefined); const allpeople = ref([]); //所有人 const props = defineProps({ pointfeature: { type: Object, default: {}, }, }); const allData = reactive({ pickerOptionsEnd: { disabledDate: (time) => { return ( time.getTime() < new Date().getTime() ) }, }, form: { nextTaskApproveUserId: "", submitUserId: appStore.userInfo.userId, alarmId: '', }, rules: { nextTaskApproveUserId: [ { required: true, message: '不能为空', trigger: 'blur' }, ], }, }); // 获得所有人的接口 function getallpeople () { let params = { pageNum: 1, pageSize: 9999 } listUser(params).then( (res) => { allpeople.value = res.data } ); } // 调度确认的按钮 function confirms () { proxy.$refs["userRef"].validate((valid) => { if (valid) { console.log('allData.form', allData.form); allData.form.alarmId = props.pointfeature.id console.log('allData.form', props.pointfeature); let newform = { ...allData.form, ...props.pointfeature } deviceCaseadd(newform).then(res => { if (res.code == 200) { proxy.$modal.msgSuccess("任务下发成功!"); bus.emit("closerwxf"); allData.loading = false // 更新列表 } else { proxy.$modal.msgSuccess(res.msg); } }) } else { console.log('error submit!!'); return false; } }) } // 关闭弹框 function closebg () { bus.emit("closerwxf"); allData.loading = false } onMounted(() => { console.log('appStore', appStore.userInfo.userId); getallpeople() }); </script> <style lang="scss" scoped> // //@import "@/assets/styles/floodControlDrainage.scss"; //@import "@/assets/styles/cockpit.scss"; @import "@/assets/styles/map-detail.scss"; .detail-real-box { flex-direction: column; } ::v-deep .el-textarea__inner { background-color: #042c52 !important; box-shadow: none; } ::v-deep .el-button { color: #fefeff; background: #0f53db; border: none; } .dialog-footer { text-align: right; margin-top: 10px; } ::v-deep .el-table { height: 200px; } ::v-deep .el-tree__empty-block { min-height: 0; } ::v-deep .el-tree { background: transparent; } ::v-deep .el-tree-node__content:hover { background-color: #274470; color: #fff; } .custom-body { overflow-y: auto !important; } ::v-deep .el-input__inner { color: #fff; } ::v-deep .el-textarea__inner { color: #fff; } </style>