更新下发任务页面

This commit is contained in:
2026-03-04 11:27:50 +08:00
parent a67719927e
commit 4328f381cd
4 changed files with 91 additions and 113 deletions

View File

@ -1,6 +1,5 @@
<template>
<el-dialog title="任务" width="80%" :model-value="modelValue" destroy-on-close :close-on-click-modal="false"
@close="close">
<el-dialog title="任务" width="80%" :model-value="modelValue" destroy-on-close :close-on-click-modal="false" @close="close">
<el-form ref="elform" :model="listQuery" :rules="rules" :inline="true" label-position="top">
<el-form-item prop="dwmc" label="点位名称" style="width: 100%">
<el-input v-model="listQuery.dwmc" clearable style="width: 100%" />
@ -22,56 +21,32 @@
<el-button type="primary" @click="submit">保存</el-button>
</template>
</el-dialog>
<FgLoad v-model="fgVisible" @choosedUsers="hanlderChoose" />
</template>
<script setup>
import emitter from "@/utils/eventBus.js";
import FgLoad from "./fgLoad.vue";
import * as MOSTY from "@/components/MyComponents/index";
import GdMap from "@/components/Map/GdMap/index.vue";
import { qcckGet, qcckPost, qcckPut } from "@/api/qcckApi.js";
import * as rule from "@/utils/rules.js";
import { IdCard } from "@/utils/validate.js";
import {
ref,
defineExpose,
reactive,
defineProps,
getCurrentInstance,
defineEmits,
nextTick,
onMounted,
onUnmounted,
watch
} from "vue";
import { ref,reactive,defineProps,defineEmits,onMounted,onUnmounted,watch } from "vue";
const props = defineProps({
modelValue: {
type: Boolean,
required: true
},
data: { type: Object, default: {} },
dic: { type: Object, default: {} },
formData: {
type: Object,
default: {}
}
});
const fgData = ref([]);
const fgVisible = ref(false);
const emits = defineEmits(["update:modelValue","submit"]);
const { proxy } = getCurrentInstance();
const dialogFormVisible = ref(false); //表单禁用
const listQuery = ref({ gridType: 150 }); //表单
const elform = ref();
const listQuery = ref({}); //表单
const rules = reactive({
fgRwbt: [
{ required: true, message: "请输入方格任务标题", trigger: "change" }
],
fgRwnr: [{ required: true, message: "请输入方格任务内容", trigger: "blur" }],
rwRq: [{ required: true, message: "请选择任务日期", trigger: "change" }],
gridType: [
{ required: true, message: "请输入网格大小", trigger: ["change", "blur"] }
]
dwmc: [{ required: true, message: "请输入点位名称", trigger: "blur" }],
jd: [{ required: true, message: "请输入经度", trigger: ["blur",'change'] }],
wd: [{ required: true, message: "请输入纬度", trigger: ["blur",'change'] }],
});
onMounted(() => {
@ -82,33 +57,32 @@ onMounted(() => {
}
});
});
watch(
() => props.modelValue,
(val) => {
if (val) {
setTimeout(() => {
dialogFormVisible.value = true;
}, 1000);
} else {
listQuery.value = {};
fgData.value = [];
}
}
);
watch(() => props.modelValue,(val) => {
setTimeout(() => {
dialogFormVisible.value = true;
showFg()
}, 1000);
});
//选择方格
function hanlderChoose(arr) {
const jzryList = arr.map((item) => {
return {
id: item.id,
fgmc: item.mc1
};
});
fgData.value = jzryList;
}
function handleClose(idx) {
fgData.value.splice(idx, 1);
function showFg(){
setTimeout(() => {
const position = [
[Number(props.data[0].x1), Number(props.data[0].y1)],
[Number(props.data[0].x2), Number(props.data[0].y2)]
];
const obj = [{ position: position,text:props.data[0].fgmc,id:1 ,userData:props.data[0]}];
emitter.emit("echoPlane", {
fontColor: "#12fdb8",
coords: obj,
type: "rectangle",
flag: "addfg",
color: "rgba(2,20,51,0.5)",
linecolor: "#1C97FF"
});
emitter.emit("setMapCenter",{location:[Number(props.data[0].zxX), Number(props.data[0].zxY)],zoomLevel:12})
},2000)
}
//获取经纬度
function chackLat() {
listQuery.value.jd = "";
@ -122,7 +96,10 @@ const submit = () => {
close("新增成功");
};
// 关闭
const close = (val) => {
const close = () => {
listQuery.value.dwmc = "";
listQuery.value.jd = "";
listQuery.value.wd = "";
emits("update:modelValue", false);
};
onUnmounted(() => {

View File

@ -23,9 +23,9 @@
<el-form-item style="width: 48%" prop="rwmc" label="任务名称">
<el-input v-model="listQuery.rwmc" placeholder="请输入任务名称" style="width: 100%" clearable />
</el-form-item>
<el-form-item style="width: 45%" label="方格" prop="">
<div :class="fgData.length === 0 ? 'ipt mj' : 'ipt'" @click.stop="fgVisible = true">
<el-tag v-for="(tag, idx) in fgData" :key="tag.id" class="mx-1" closable :type="tag.type"
<el-form-item style="width: 45%" label="方格" prop="fgData">
<div :class="listQuery.fgData.length === 0 ? 'ipt mj' : 'ipt'" @click.stop="fgVisible = true">
<el-tag v-for="(tag, idx) in listQuery.fgData" :key="tag.id" class="mx-1" closable :type="tag.type"
@close="handleClose(idx)">
{{ tag.fgmc }}
</el-tag>
@ -56,7 +56,10 @@
</div>
</div>
<FgLoad v-model="fgVisible" @choosedUsers="hanlderChoose" :Single="true" />
<AddDw v-model="showDialog" :dic="{ D_ZDXL_FGXLRW_YJYS, D_ZDXL_FGXLRW_YJDJ, D_ZDXL_FGXLRW_RWZT }"
<AddDw
v-model="showDialog"
:data="listQuery.fgData"
:dic="{ D_ZDXL_FGXLRW_YJYS, D_ZDXL_FGXLRW_YJDJ, D_ZDXL_FGXLRW_RWZT }"
@submit="dwSubmit" />
</template>
@ -83,15 +86,14 @@ const showDialog = ref(false);
const stepActive = ref(0)
const emit = defineEmits(["updateDate"]);
const dialogForm = ref(false); //弹窗
const fgData = ref([]);
const listQuery = ref({ qcys: "#409eff" }); //表单
const listQuery = ref({ fgData: [] }); //表单
const fgVisible = ref(false);
const loading = ref(false);
const elform = ref();
const title = ref("");
const rules = reactive({
rwmc: [{ required: true, message: "请输入任务名称", trigger: "change" }],
ssbmdm: [{ required: true, message: "请选择所属部门", trigger: "change" }],
fgData: [{ required: true, message: "请选择方格", trigger: "change" }],
sblx: [{ required: true, message: "请选择任务类型", trigger: "change" }],
jd: [{ required: true, message: "请选择坐标", trigger: ["change", "blur"] }]
});
@ -151,11 +153,22 @@ function hanlderChoose(arr) {
const jzryList = arr.map((item) => {
return {
id: item.id,
fgmc: item.mc1
fgmc: item.mc1,
x1:item.x1,
y1:item.y1,
x2:item.x2,
y2:item.y2,
x11:item.x11,
y11:item.y11,
x21:item.x21,
y21:item.y21 ,
zxX:item.zxX,
zxY:item.zxY,
};
});
fgData.value = jzryList;
listQuery.value.fgData = jzryList;
}
const dwSubmit = (val) => {
pageData.tableData.push(val)
}

View File

@ -20,11 +20,10 @@
<div class="tabBox">
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight" :key="pageData.keyCount" :tableConfiger="pageData.tableConfiger"
:controlsWidth="pageData.controlsWidth" @chooseData="chooseData">
<template #sblx="{ row }">
<dict-tag :value="row.sblx" :options="D_BZ_SBLX" :tag="false" />
</template>
<template #sblxdm="{ row }">
<dict-tag :options="D_BZ_GZSBLX" :value="row.sblxdm" :tag="false" />
<template #rwzt="{ row }">
<el-table-column prop="wlq" label="未领取"/>
<el-table-column prop="ylq" label="已领取"/>
<el-table-column prop="ywc" label="已完成"/>
</template>
<!-- 操作 -->
<template #controls="{ row }">
@ -86,22 +85,11 @@ const pageData = reactive({
}, //分页
controlsWidth: 210, //操作栏宽度
tableColumn: [
{ label: "任务名称", prop: "sbmc", showOverflowTooltip: true },
{ label: "编号", prop: "sbbh", showOverflowTooltip: true },
{ label: "地址", prop: "dzmc", showOverflowTooltip: true },
{
label: "任务类型",
prop: "sblx",
showSolt: true,
showOverflowTooltip: true
},
{
label: "摄像机类型",
prop: "sblxdm",
showSolt: true,
showOverflowTooltip: true
},
{ label: "所属部门", prop: "ssbm", showOverflowTooltip: true }
{ label: "任务名称", prop: "sbmc" },
{ label: "方格编号", prop: "sbbh" },
{ label: "下发时间", prop: "xfcsj" },
{ label: "任务领取人", prop: "rwlqr" },
{ label: "任务状态", prop: "rwzt", showSolt: true },
]
});
onMounted(() => {
@ -109,7 +97,7 @@ onMounted(() => {
pageData.keyCount = data;
});
tabHeightFn();
// getDataList();
getDataList();
});
// 搜索
const onSearch = (val) => {
@ -127,16 +115,16 @@ const getDataList = () => {
...listQuery.value
};
delete pramas.daterange;
pageData.tableConfiger.loading = true;
qcckPost(pramas, "/mosty-yszx/tbYsSxt/getPageList")
.then((res) => {
pageData.tableData = res.records || [];
pageData.tableConfiger.loading = false;
pageData.total = res.total;
})
.catch(() => {
pageData.tableConfiger.loading = false;
});
// pageData.tableConfiger.loading = true;
// qcckPost(pramas, "/mosty-yszx/tbYsSxt/getPageList")
// .then((res) => {
// pageData.tableData = res.records || [];
// pageData.tableConfiger.loading = false;
// pageData.total = res.total;
// })
// .catch(() => {
// pageData.tableConfiger.loading = false;
// });
};
const changeNo = (val) => {
pageData.pageConfiger.pageNum = val;
@ -157,17 +145,14 @@ const chooseData = (val) => {
};
//批量删除
const deletList = (id) => {
proxy
.$confirm("确定要删除", "警告", { type: "warning" })
.then(() => {
qcckDelete({}, "/mosty-yszx/tbYsSxt/" + id).then(() => {
proxy.$message({ type: "success", message: "删除成功" });
getDataList();
});
})
.catch(() => {
proxy.$message.info("已取消");
});
proxy.$confirm("确定要删除", "警告", { type: "warning" }).then(() => {
// qcckDelete({}, "/mosty-yszx/tbYsSxt/" + id).then(() => {
// proxy.$message({ type: "success", message: "删除成功" });
// getDataList();
// });
}).catch(() => {
proxy.$message.info("已取消");
});
};
// 新增编辑表单
@ -188,6 +173,9 @@ const tabHeightFn = () => {
</script>
<style lang="scss" scoped>
::v-deep .el-table thead.is-group th.el-table__cell{
background: rgba(6, 42, 72, 0.8);
}
</style>
<style>
.el-loading-mask {

View File

@ -41,7 +41,7 @@
<CountModel />
</div>
<!-- 底部按钮 -->
<BottomBtn />
<!-- <BottomBtn /> -->
<div class="footBox">
<ul>
<li v-for="(item, index) in btnTatol" :key="item">