2025-07-05 12:03:00 +08:00
|
|
|
<template>
|
2025-07-19 18:53:41 +08:00
|
|
|
<el-dialog v-model="modelValue" :destroy-on-close="true" :title="title+'人员'" @close="close" :close-on-click-modal="false">
|
2025-07-05 12:03:00 +08:00
|
|
|
<FormMessage v-model="listQuery" :formList="formData" labelWidth="120px" ref="elform" :rules="rules">
|
|
|
|
|
<template #bqList>
|
|
|
|
|
<div class="marks pointer" @click="chooseMarksVisible = true">
|
|
|
|
|
<span style="color: rgb(175 178 184);padding-left: 10px;" v-if="!listQuery.bqList || listQuery.bqList.length == 0 ">请选择标签</span>
|
|
|
|
|
<span v-else >
|
|
|
|
|
<el-tag @close.stop="closeTag(idx)" type="success" closable v-for="(it,idx) in listQuery.bqList" :key="idx">{{ it.bqMc }}</el-tag >
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</FormMessage>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<div class="flex just-center">
|
|
|
|
|
<el-button @click="close">取消</el-button>
|
|
|
|
|
<el-button type="primary" @click="submitForm">确认</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<ChooseMarks v-model="chooseMarksVisible" @choosed="choosed" :roleIds="roleIds" />
|
2025-08-16 16:54:03 +08:00
|
|
|
|
2025-07-05 12:03:00 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2025-07-10 20:46:20 +08:00
|
|
|
import ChooseMarks from "@/components/ChooseList/ChooseMarks/index.vue";
|
2025-07-05 12:03:00 +08:00
|
|
|
import FormMessage from "@/components/aboutTable/FormMessage.vue";
|
|
|
|
|
import { reactive, ref } from 'vue';
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
dic:{
|
|
|
|
|
type:Object,
|
|
|
|
|
default:{}
|
|
|
|
|
},
|
2025-07-19 18:53:41 +08:00
|
|
|
modelValue:{
|
|
|
|
|
type:Boolean,
|
|
|
|
|
default:false
|
|
|
|
|
}
|
2025-07-05 12:03:00 +08:00
|
|
|
})
|
|
|
|
|
const chooseMarksVisible = ref(false)
|
|
|
|
|
const roleIds = ref([])
|
|
|
|
|
const elform = ref()
|
|
|
|
|
const emit = defineEmits(['change'])
|
|
|
|
|
const listQuery = ref({})
|
|
|
|
|
const formData = ref([
|
|
|
|
|
{ label: "姓名", prop: "xm", type: "input" ,width:'48%'},
|
|
|
|
|
{ label: "性别", prop: "xb", type: "select",options:props.dic.D_BZ_XB ,width:'48%'},
|
|
|
|
|
{ label: "身份证号", prop: "sfzh", type: "input" ,width:'48%'},
|
|
|
|
|
{ label: "户籍地", prop: "hjdz", type: "input",width:'48%' },
|
2025-07-19 18:53:41 +08:00
|
|
|
{ label: "户籍地派出所", prop: "hjdpcsdm",depMc:'hjdpcs', type: "department" ,width:'48%'},
|
2025-07-05 12:03:00 +08:00
|
|
|
{ label: "标签", prop: "bqList", type: "slot",width:'100%' },
|
|
|
|
|
{ label: "是否挑头人", prop: "sfttr", type: "select",options:props.dic.D_BZ_SF ,width:'48%'},
|
|
|
|
|
{ label: "是否响应人", prop: "sfxyr", type: "select" ,options:props.dic.D_BZ_SF,width:'48%' },
|
|
|
|
|
{ label: "所属群体", prop: "ssqt", type: "input" ,width:'48%'},
|
|
|
|
|
{ label: "微信号", prop: "wx", type: "input" ,width:'48%'},
|
|
|
|
|
{ label: "QQ", prop: "qq", type: "input" ,width:'48%'},
|
|
|
|
|
])
|
|
|
|
|
const rules = reactive({
|
|
|
|
|
xm: [{ required: true, message: "请输入姓名", trigger: "blur" }],
|
|
|
|
|
xb: [{ required: true, message: "请选择性别", trigger: "change" }],
|
|
|
|
|
sfzh: [{ required: true, message: "请输入身份证号", trigger: "blur" }],
|
|
|
|
|
hjd: [{ required: true, message: "请输入户籍地", trigger: "blur" }],
|
|
|
|
|
})
|
2025-07-05 19:37:28 +08:00
|
|
|
const title = ref('')
|
2025-07-05 19:49:14 +08:00
|
|
|
const order = ref(null)
|
|
|
|
|
const init = (type,row,index) =>{
|
2025-07-05 19:37:28 +08:00
|
|
|
title.value = type == 'add' ? '新增' :'编辑';
|
2025-07-05 19:49:14 +08:00
|
|
|
order.value = index;
|
2025-07-05 12:03:00 +08:00
|
|
|
if(row) listQuery.value = {...row};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 选择标签
|
|
|
|
|
const choosed = (val) => {
|
|
|
|
|
listQuery.value.bqList = val.map(v=>{
|
|
|
|
|
return { bqDm:v.bqDm, bqId:v.id, bqLb:v.bqLb, bqLx:v.bqLx, bqMc:v.bqMc }
|
|
|
|
|
});
|
|
|
|
|
roleIds.value = val.map(v=>v.id)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 删除数据
|
|
|
|
|
const closeTag = (idx) =>{
|
|
|
|
|
listQuery.value.bqList.splice(idx,1)
|
|
|
|
|
roleIds.value.splice(idx,1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const submitForm = () =>{
|
|
|
|
|
elform.value.submit((val)=>{
|
2025-07-05 19:49:14 +08:00
|
|
|
let obj = { data:val,type:title.value ,index:order.value}
|
|
|
|
|
emit('change',obj)
|
2025-07-19 18:53:41 +08:00
|
|
|
emit('update:modelValue',false)
|
2025-07-05 12:03:00 +08:00
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const close = () =>{
|
|
|
|
|
elform.value.reset();
|
2025-07-19 18:53:41 +08:00
|
|
|
emit('update:modelValue',false)
|
2025-07-05 12:03:00 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
defineExpose({init})
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
|
|
|
|
.marks{
|
|
|
|
|
width: 100%;
|
|
|
|
|
width: 100%;
|
|
|
|
|
min-height: 32px;
|
|
|
|
|
border: 1px solid #e9e9e9;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
}
|
2025-08-16 16:54:03 +08:00
|
|
|
</style>
|