修改下发任务

This commit is contained in:
给我
2026-03-13 17:18:07 +08:00
parent f37b9d481d
commit 420aa58f02
4 changed files with 45 additions and 35 deletions

View File

@ -1,5 +1,6 @@
<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%" />
@ -27,8 +28,8 @@
import emitter from "@/utils/eventBus.js";
import GdMap from "@/components/Map/GdMap/index.vue";
import { qcckGet, qcckPost, qcckPut } from "@/api/qcckApi.js";
import { ref,reactive,defineProps,defineEmits,onMounted,onUnmounted,watch,getCurrentInstance } from "vue";
const { proxy } = getCurrentInstance();
import { ref, reactive, defineProps, defineEmits, onMounted, onUnmounted, watch, getCurrentInstance } from "vue";
const { proxy } = getCurrentInstance();
const props = defineProps({
modelValue: {
type: Boolean,
@ -41,13 +42,13 @@ const props = defineProps({
default: {}
}
});
const emits = defineEmits(["update:modelValue","submit"]);
const emits = defineEmits(["update:modelValue", "submit"]);
const dialogFormVisible = ref(false); //表单禁用
const listQuery = ref({}); //表单
const rules = reactive({
dwmc: [{ required: true, message: "请输入点位名称", trigger: "blur" }],
jd: [{ required: true, message: "请输入经度", trigger: ["blur",'change'] }],
wd: [{ required: true, message: "请输入纬度", trigger: ["blur",'change'] }],
jd: [{ required: true, message: "请输入经度", trigger: ["blur", 'change'] }],
wd: [{ required: true, message: "请输入纬度", trigger: ["blur", 'change'] }],
});
onMounted(() => {
@ -58,20 +59,22 @@ onMounted(() => {
}
});
});
watch(() => props.modelValue,(val) => {
watch(() => props.modelValue, (val) => {
setTimeout(() => {
dialogFormVisible.value = true;
showFg()
}, 1000);
}, 500);
},{
deep: true, immediate: true
});
function showFg(){
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]}];
const obj = [{ position: position, text: props.data[0].fgmc, id: 1, userData: props.data[0] }];
emitter.emit("echoPlane", {
fontColor: "#12fdb8",
coords: obj,
@ -80,8 +83,8 @@ function showFg(){
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)
emitter.emit("setMapCenter", { location: [Number(props.data[0].zxX), Number(props.data[0].zxY)], zoomLevel: 12 })
}, 1000)
}
//获取经纬度
@ -94,8 +97,8 @@ function chackLat() {
// 提交
const submit = () => {
if (listQuery.value.jd && listQuery.value.wd && listQuery.value.dwmc) {
emits("submit",listQuery.value);
if (listQuery.value.jd && listQuery.value.wd && listQuery.value.dwmc) {
emits("submit", listQuery.value);
close("新增成功");
} else {
proxy.$message({ type: "error", message: "请选择经纬度或者输入点位名称" });
@ -103,7 +106,8 @@ const submit = () => {
};
// 关闭
const close = () => {
listQuery.value={}
listQuery.value = {}
dialogFormVisible.value = false;
emits("update:modelValue", false);
};
onUnmounted(() => {

View File

@ -20,8 +20,8 @@
<el-step title="步骤2" />
</el-steps>
<el-form ref="elform" :model="listQuery" :rules="rules" :inline="true" label-position="top" v-if="stepActive == 0">
<el-form-item style="width: 48%" prop="rwmc" label="任务名称">
<el-input v-model="listQuery.rwmc" placeholder="请输入任务名称" style="width: 100%" clearable />
<el-form-item style="width: 48%" prop="fgRwbt" label="任务名称">
<el-input v-model="listQuery.fgRwbt" placeholder="请输入任务名称" style="width: 100%" clearable />
</el-form-item>
<el-form-item style="width: 45%" label="方格" prop="fgData">
<div :class="listQuery.fgData.length === 0 ? 'ipt mj' : 'ipt'" @click.stop="fgVisible = true">
@ -31,6 +31,9 @@
</el-tag>
</div>
</el-form-item>
<el-form-item style="width: 48%" prop="dkjgsj" label="间隔时间">
<el-input v-model="listQuery.dkjgsj" type="number" placeholder="请输入间隔时间" style="width: 100%" clearable />
</el-form-item>
<div class="center-btn"><el-button style="margin-top: 12px" @click="next">下一步</el-button></div>
</el-form>
<div class="box_main" v-if="stepActive == 1">
@ -56,7 +59,7 @@
</div>
</div>
<FgLoad v-model="fgVisible" @choosedUsers="hanlderChoose" :Single="true" />
<AddDw v-model="showDialog" :data="listQuery.fgData"
<AddDw v-model="showDialog" v-if="showDialog" :data="listQuery.fgData"
:dic="{ D_ZDXL_FGXLRW_YJYS, D_ZDXL_FGXLRW_YJDJ, D_ZDXL_FGXLRW_RWZT }" @submit="dwSubmit" />
</template>
@ -89,8 +92,9 @@ const loading = ref(false);
const elform = ref();
const title = ref("");
const rules = reactive({
rwmc: [{ required: true, message: "请输入任务名称", trigger: "change" }],
fgRwbt: [{ required: true, message: "请输入任务名称", trigger: "change" }],
fgData: [{ required: true, message: "请选择方格", trigger: "change" }],
dkjgsj: [{ required: true, message: "请输入间隔时间", trigger: "change" }],
sblx: [{ required: true, message: "请选择任务类型", trigger: "change" }],
jd: [{ required: true, message: "请选择坐标", trigger: ["change", "blur"] }]
});
@ -179,8 +183,9 @@ const submit = () => {
console.log(listQuery.value, pageData.tableData);
const pramas = {
fgRwbt: listQuery.value.rwmc,
fgRwbt: listQuery.value.fgRwbt,
fgdwId: listQuery.value.fgData[0].id,
dkjgsj:listQuery.value.dkjgsj,
bddDtos: pageData.tableData.map(item => {
return {
bddMc: item.dwmc,

View File

@ -20,11 +20,11 @@
<div class="tabBox">
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight" :tableConfiger="pageData.tableConfiger"
:controlsWidth="pageData.controlsWidth" @chooseData="chooseData">
<template #rwZt="{ row }">
<template #rwLqZt="{ row }">
<!-- <el-table-column prop="wlq" label="未领取"/>
<el-table-column prop="ylq" label="已领取"/>
<el-table-column prop="ywc" label="已完成"/> -->
<dict-tag :options="D_BZ_QWRWZT" :value="row.rwZt" :tag="false" />
<dict-tag :options="D_BZ_QWRWZT" :value="row.rwLqZt" :tag="false" />
</template>
<template #controls="{ row }">
<!-- 领取后不可再编辑领取后不可再删除 -->
@ -39,7 +39,7 @@
}"></Pages>
</div>
<!-- 编辑-新增 -->
<EditAddForm ref="editInfo" @updateDate="getDataList" :dic="{D_BZ_SBLX,D_BZ_GZSBLX}"></EditAddForm>
<EditAddForm ref="editInfo" @updateDate="getDataList" :dic="{D_BZ_QWRWZT}"></EditAddForm>
</div>
</template>
@ -52,7 +52,7 @@ import Pages from "@/components/aboutTable/Pages.vue";
import Search from "@/components/aboutTable/Search.vue";
import { reactive, ref, onMounted, getCurrentInstance, nextTick } from "vue";
const { proxy } = getCurrentInstance();
const { D_BZ_SBLX, D_BZ_GZSBLX,D_BZ_QWRWZT } = proxy.$dict("D_BZ_SBLX", "D_BZ_GZSBLX","D_BZ_QWRWZT");
const { D_BZ_QWRWZT } = proxy.$dict("D_BZ_QWRWZT");
const ids = ref([]); //多选
const searchBox = ref(); //搜索框
const listQuery = ref({});
@ -65,10 +65,11 @@ const searchConfiger = reactive([
label: "任务名称"
},
{
showType: "input",
prop: "sbbh",
placeholder: "请输入任务编号",
label: "任务编号"
showType: "select",
prop: "rwLqZt",
placeholder: "请选择任务领取状态",
label: "任务领取状态",
options: D_BZ_QWRWZT
}
]);
const pageData = reactive({
@ -89,7 +90,7 @@ const pageData = reactive({
{ label: "方格编号", prop: "fgMc" },
{ label: "下发日期", prop: "xtCjsj" },
{ label: "任务领取人", prop: "rwlqr" },
{ label: "任务状态", prop: "rwZt", showSolt: true },
{ label: "任务领取状态", prop: "rwLqZt", showSolt: true },
]
});
onMounted(() => {
@ -137,10 +138,10 @@ const chooseData = (val) => {
//批量删除
const deletList = (id) => {
proxy.$confirm("确定要删除", "警告", { type: "warning" }).then(() => {
// qcckDelete({}, "/mosty-yszx/tbYsSxt/" + id).then(() => {
// proxy.$message({ type: "success", message: "删除成功" });
// getDataList();
// });
qcckPost({id}, "/mosty-yjzl/tbZdxlFgxlrw/delZdyxlFgxlrw").then(() => {
proxy.$message({ type: "success", message: "删除成功" });
getDataList();
});
}).catch(() => {
proxy.$message.info("已取消");
});

View File

@ -3,8 +3,8 @@ const path = require("path");
function resolve(dir) {
return path.join(__dirname, dir);
}
// const serverHost = "http://118.122.165.45:35623";
const serverHost = "http://192.168.31.94:8006";
const serverHost = "http://118.122.165.45:35623";
// const serverHost = "http:// 192.168.31.79:8006";
module.exports = {
publicPath: "/",