Files
sgxt_web/src/views/backOfficeSystem/ExcavationResearch/ZdryFjyp/model.vue

68 lines
2.3 KiB
Vue
Raw Normal View History

2025-07-03 21:15:39 +08:00
<template>
2025-07-04 10:09:13 +08:00
<el-dialog v-model="modelValue" title="提交" width="500px" @close="handleClose">
2025-07-03 21:15:39 +08:00
<el-form :model="listQuery" ref="formValidate" :rules="rules">
2025-07-04 10:09:13 +08:00
<el-form-item prop="sfGz" label="是否关注" v-if="props.type == '是否关注'">
<MOSTY.Select filterable v-model="listQuery.sfGz" :dictEnum="props.dic.D_BZ_SF" width="100%" clearable placeholder="请选择是否布控"/>
</el-form-item>
<el-form-item prop="sfZzdry" label="是否移交管控" v-if="props.type == '移交管控'">
<MOSTY.Select filterable v-model="listQuery.sfZzdry" :dictEnum="props.dic.D_BZ_SF" width="100%" clearable placeholder="请选择是否布控"/>
2025-07-03 21:15:39 +08:00
</el-form-item>
</el-form>
<template #footer>
<div class="tc">
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="submitForm">确定</el-button>
</div>
</template>
</el-dialog>
</template>
<script setup>
import { ElMessage } from "element-plus";
import { qcckPost } from "@/api/qcckApi.js";
import * as MOSTY from "@/components/MyComponents/index";
import { ref ,defineProps,defineEmits, reactive} from 'vue';
const props = defineProps({
modelValue:{
type:Boolean,
default:false
},
ids:{
type:Array,
default:[]
},
type:String,
dic:Object
})
const emits = defineEmits(["update:modelValue",'getDepValue']);
const formValidate = ref()
const rules = reactive({
2025-07-04 10:09:13 +08:00
sfGz: [{ required: true, message: "请选择是否关注", trigger: "change" }],
sfZzdry: [{ required: true, message: "请选择是否移交管控", trigger: "change" }],
2025-07-03 21:15:39 +08:00
})
const listQuery = ref({});
const submitForm = () =>{
formValidate.value.validate((valid) => {
if (!valid) return false;
let params = { ids:props.ids, ...listQuery.value }
let url = ''
2025-07-04 10:09:13 +08:00
if( props.type == '是否关注') url = '/mosty-gsxt/tbGsxtRqfjRy/updateBySfgz'
if( props.type == '移交管控') url = '/mosty-gsxt/tbGsxtRqfjRy/updateByYjgk'
2025-07-03 21:15:39 +08:00
qcckPost(params,url).then(res=>{
ElMessage.success("成功");
emits('update:modelValue',false)
emits('change')
})
})
}
const handleClose = () =>{
emits('update:modelValue',false)
formValidate.value.resetFields();
}
</script>
<style lang="scss" scoped>
</style>