This commit is contained in:
2025-07-03 17:47:01 +08:00
parent 1d3534bcb9
commit a72b8782bc
6 changed files with 534 additions and 1066 deletions

View File

@ -10,6 +10,14 @@
<el-form-item prop="uid" label="选择民警" v-if="props.type == '指定分配'">
<MOSTY.Other @click="chooseUserVisible = true" readonly v-model="listQuery.uidMc" width="100%" clearable placeholder="请选择选择民警"/>
</el-form-item>
<el-form-item prop="bqList" label="添加标签" v-if="props.type == '添加标签'">
<div @click="chooseMarksVisible = true" style="border: 1px solid #e1e1e1;border-radius: 4px;" class="ww100 pl10 pointer">
<span v-if="!listQuery.bqList || listQuery.bqList.length == 0" style="color: #e7e7e7;">请选择添加标签</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>
</el-form-item>
</el-form>
<template #footer>
<div class="tc">
@ -19,11 +27,13 @@
</template>
</el-dialog>
<ChooseUser v-model="chooseUserVisible" @choosedUsers="handleUserSelected" :roleIds="roleIds" />
<ChooseMarks v-model="chooseMarksVisible" @choosed="choosed" :roleIds="roleIds" />
</template>
<script setup>
import ChooseUser from "@/components/MyComponents/ChooseUser/index.vue";
import ChooseMarks from "@/components/MyComponents/ChooseMarks/index.vue";
import { ElMessage } from "element-plus";
import { qcckPost } from "@/api/qcckApi.js";
import * as MOSTY from "@/components/MyComponents/index";
@ -41,6 +51,7 @@ const props = defineProps({
dic:Object
})
const chooseUserVisible = ref(false)
const chooseMarksVisible = ref(false)
const roleIds = ref([])
const emits = defineEmits(["update:modelValue",'getDepValue']);
const formValidate = ref()
@ -48,25 +59,41 @@ const rules = reactive({
fxDj: [{ required: true, message: "请选择风险等级", trigger: "change" }],
ssbmdm: [{ required: true, message: "请选择所属部门", trigger: "change" }],
uid: [{ required: true, message: "请选择民警", trigger: "change" }],
bqList: [{ required: true, message: "请选择标签", trigger: "change" }],
})
const listQuery = ref({});
// 选择民警
const handleUserSelected = (val) => {
listQuery.value.uid = val[0].id;
listQuery.value.uidMc = val[0].userName;
roleIds.value = [val[0].id]
}
// 选择标签
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 = () =>{
formValidate.value.validate((valid) => {
if (!valid) return false;
let params = { ids:props.ids, ...listQuery.value }
let url = ''
if( props.type == '警种变更') '/mosty-gsxt/tbGsxtRqfjRy/updateByBm'
if( props.type == '指定分配') '/mosty-gsxt/tbGsxtRqfjRy/updateByMj'
if( props.type == '级别变更') '/mosty-gsxt/tbGsxtRqfjRy/updateByFxDj'
if( props.type == '警种变更') url = '/mosty-gsxt/tbGsxtRqfjRy/updateByBm'
if( props.type == '指定分配') url = '/mosty-gsxt/tbGsxtRqfjRy/updateByMj'
if( props.type == '级别变更') url = '/mosty-gsxt/tbGsxtRqfjRy/updateByFxDj'
if( props.type == '添加标签') url = '/mosty-gsxt/tbGsxtRqfjRy/updateAddBq'
qcckPost(params,url).then(res=>{
ElMessage.success("修改成功");
ElMessage.success("成功");
emits('update:modelValue',false)
emits('change')
})
@ -74,6 +101,7 @@ const submitForm = () =>{
}
const handleClose = () =>{
roleIds.value = []
emits('update:modelValue',false)
formValidate.value.resetFields();
}

View File

@ -127,7 +127,7 @@ const checkData = reactive({
hasChoose: ["警情"],
list: ["警情","人力情报","线索","民警处置文本", "交通事故"],
});
const btnsList = reactive(['级别变更','警种变更','指定分配','添加标签','批量导入','导出','批量删除'])
const btnsList = reactive(['级别变更','警种变更','指定分配','添加标签','导出','批量删除'])
const chooselx = ref('')
const isShow = ref(false)
@ -171,7 +171,7 @@ const pageData = reactive({
{ label: "现住地址", prop: "ryXzdz" ,showOverflowTooltip:true},
{ label: "附件照片", prop: "ryFjZp" ,showOverflowTooltip:true},
{ label: "管辖单位", prop: "gxDwDm" ,showOverflowTooltip:true},
{ label: "户籍地址", prop: "ssbm",showOverflowTooltip:true},
{ label: "责任部门", prop: "ssbm",showOverflowTooltip:true},
{ label: "风险等级", prop: "fxDj",showOverflowTooltip:true, showSolt: true },
{ label: "风险类别", prop: "fxLb",showOverflowTooltip:true, showSolt: true },
{ label: "是否关注", prop: "sfGz",showOverflowTooltip:true, showSolt: true },
@ -243,7 +243,16 @@ const chooseDataBottom = (val) =>{
const chooseType = (val)=>{
if(ids.value.length == 0) return ElMessage.warning("请选择对应的数据");
chooselx.value = val;
isShow.value = true;
switch(val){
case '级别变更':
case '警种变更':
case '指定分配':
case '添加标签':
isShow.value = true;
break;
case '批量删除':
break;
}
}
const tabHeightFn = () => {