任务下发
This commit is contained in:
@ -2,8 +2,8 @@
|
||||
<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%" />
|
||||
<el-form-item prop="bxdMc" label="点位名称" style="width: 100%">
|
||||
<el-input v-model="listQuery.bxdMc" clearable style="width: 100%" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="jd" label="选择必巡点" style="width: 100%">
|
||||
<div class="latlng">
|
||||
@ -46,7 +46,7 @@ const emits = defineEmits(["update:modelValue", "submit"]);
|
||||
const dialogFormVisible = ref(false); //表单禁用
|
||||
const listQuery = ref({}); //表单
|
||||
const rules = reactive({
|
||||
dwmc: [{ required: true, message: "请输入点位名称", trigger: "blur" }],
|
||||
bxdMc: [{ required: true, message: "请输入点位名称", trigger: "blur" }],
|
||||
jd: [{ required: true, message: "请输入经度", trigger: ["blur", 'change'] }],
|
||||
wd: [{ required: true, message: "请输入纬度", trigger: ["blur", 'change'] }],
|
||||
});
|
||||
@ -96,8 +96,7 @@ function chackLat() {
|
||||
|
||||
// 提交
|
||||
const submit = () => {
|
||||
|
||||
if (listQuery.value.jd && listQuery.value.wd && listQuery.value.dwmc) {
|
||||
if (listQuery.value.jd && listQuery.value.wd && listQuery.value.bxdMc) {
|
||||
emits("submit", listQuery.value);
|
||||
close("新增成功");
|
||||
} else {
|
||||
|
||||
@ -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="fgRwbt" label="任务名称">
|
||||
<el-input v-model="listQuery.fgRwbt" placeholder="请输入任务名称" style="width: 100%" clearable />
|
||||
<el-form-item style="width: 48%" prop="fgRwmc" label="任务名称">
|
||||
<el-input v-model="listQuery.fgRwmc" 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">
|
||||
@ -37,16 +37,10 @@
|
||||
<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">
|
||||
<el-button style="margin: 12px 0 10px 0;" @click="addDw">新增点位</el-button>
|
||||
<el-button style="margin: 12px 0 10px 0;" @click="addDw" v-if="openType!=='detail'">新增点位</el-button>
|
||||
<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>
|
||||
<!-- 操作 -->
|
||||
<template #controls="{ row, index }">
|
||||
<el-button @click="deletList(index)" type="danger" size="small">删除</el-button>
|
||||
@ -54,7 +48,7 @@
|
||||
</MyTable>
|
||||
<div class="center-btn">
|
||||
<el-button style="margin-top: 12px" @click="stepActive--; pageData.tableData = []">上一步</el-button>
|
||||
<el-button style="margin-top: 12px" @click="submit">提交</el-button>
|
||||
<el-button style="margin-top: 12px" @click="submit" v-if="openType!=='detail'">提交</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -91,8 +85,9 @@ const fgVisible = ref(false);
|
||||
const loading = ref(false);
|
||||
const elform = ref();
|
||||
const title = ref("");
|
||||
const openType=ref("")
|
||||
const rules = reactive({
|
||||
fgRwbt: [{ required: true, message: "请输入任务名称", trigger: "change" }],
|
||||
fgRwmc: [{ required: true, message: "请输入任务名称", trigger: "change" }],
|
||||
fgData: [{ required: true, message: "请选择方格", trigger: "change" }],
|
||||
dkjgsj: [{ required: true, message: "请输入间隔时间", trigger: "change" }],
|
||||
sblx: [{ required: true, message: "请选择任务类型", trigger: "change" }],
|
||||
@ -113,7 +108,7 @@ const pageData = reactive({
|
||||
}, //分页
|
||||
controlsWidth: 210, //操作栏宽度
|
||||
tableColumn: [
|
||||
{ label: "点位名称", prop: "dwmc", showOverflowTooltip: true },
|
||||
{ label: "点位名称", prop: "bxdMc", showOverflowTooltip: true },
|
||||
{ label: "经度", prop: "jd", showOverflowTooltip: true },
|
||||
{ label: "维度", prop: "wd", showOverflowTooltip: true },
|
||||
]
|
||||
@ -124,19 +119,27 @@ onMounted(() => {
|
||||
// 初始化数据
|
||||
const init = (type, row) => {
|
||||
dialogForm.value = true;
|
||||
openType.value = type;
|
||||
title.value = row ? "编辑任务" : "新增任务";
|
||||
if (row) getDataById(row);
|
||||
if (row) {
|
||||
getDataById(row);
|
||||
} else {
|
||||
stepActive.value = 0;
|
||||
listQuery.value = { fgData: [] };
|
||||
pageData.tableData = [];
|
||||
}
|
||||
};
|
||||
// 根据id查询详情
|
||||
const getDataById = (row) => {
|
||||
qcckGet({}, "/mosty-yszx/tbYsSxt/" + row.id).then(async (res) => {
|
||||
qcckGet({ fgrwid: row.id }, "/mosty-yjzl/tbZdyrw/getFgrwXq").then(async (res) => {
|
||||
listQuery.value = res;
|
||||
if (res.jd && res.wd)
|
||||
emitter.emit("addPointArea", {
|
||||
coords: [res],
|
||||
icon: require("@/assets/point/sp.png"),
|
||||
flag: "jczGzy"
|
||||
});
|
||||
listQuery.value.fgData = [{...res.fgxx,
|
||||
fgmc: res.fgmc,
|
||||
id: res.fgId,
|
||||
}]
|
||||
console.log(listQuery.value.fgData ,'listQuery.value.fgData ');
|
||||
|
||||
pageData.tableData=res.bxds
|
||||
});
|
||||
};
|
||||
const next = () => {
|
||||
@ -183,18 +186,18 @@ const submit = () => {
|
||||
console.log(listQuery.value, pageData.tableData);
|
||||
|
||||
const pramas = {
|
||||
fgRwbt: listQuery.value.fgRwbt,
|
||||
fgdwId: listQuery.value.fgData[0].id,
|
||||
dkjgsj:listQuery.value.dkjgsj,
|
||||
bddDtos: pageData.tableData.map(item => {
|
||||
fgRwmc: listQuery.value.fgRwmc,
|
||||
fgId: listQuery.value.fgData[0].id,
|
||||
dkjgsj: listQuery.value.dkjgsj,
|
||||
dtoList: pageData.tableData.map(item => {
|
||||
return {
|
||||
bddMc: item.dwmc,
|
||||
bxdMc: item.bxdMc,
|
||||
jd: item.jd,
|
||||
wd: item.wd
|
||||
}
|
||||
})
|
||||
}
|
||||
qcckPost(pramas, "/mosty-yjzl/tbZdxlFgxlrw/addZdyxlFgxlrw")
|
||||
qcckPost(pramas, "/mosty-yjzl/tbZdyrw/addTbZdyrw")
|
||||
.then((res) => {
|
||||
proxy.$message({ type: "success", message: "新增成功" });
|
||||
close();
|
||||
|
||||
@ -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 #rwLqZt="{ row }">
|
||||
<template #fgrwzt="{ 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.rwLqZt" :tag="false" />
|
||||
<dict-tag :options="D_BZ_QWRWZT" :value="row.fgrwzt" :tag="false" />
|
||||
</template>
|
||||
<template #controls="{ row }">
|
||||
<!-- 领取后不可再编辑,领取后不可再删除 -->
|
||||
@ -86,11 +86,12 @@ const pageData = reactive({
|
||||
}, //分页
|
||||
controlsWidth: 210, //操作栏宽度
|
||||
tableColumn: [
|
||||
{ label: "任务名称", prop: "fgRwbt" },
|
||||
{ label: "方格编号", prop: "fgMc" },
|
||||
{ label: "下发日期", prop: "xtCjsj" },
|
||||
{ label: "任务领取人", prop: "rwlqr" },
|
||||
{ label: "任务领取状态", prop: "rwLqZt", showSolt: true },
|
||||
{ label: "任务名称", prop: "fgRwmc" },
|
||||
{ label: "方格编号", prop: "fgmc" },
|
||||
{ label: "下发日期", prop: "xfrq" },
|
||||
{ label: "下发部门", prop: "xfbm" },
|
||||
{ label: "任务领取人", prop: "fgrwlqr" },
|
||||
{ label: "任务领取状态", prop: "fgrwzt", showSolt: true },
|
||||
]
|
||||
});
|
||||
onMounted(() => {
|
||||
@ -108,11 +109,10 @@ const getDataList = () => {
|
||||
let pramas = {
|
||||
pageSize: pageData.pageConfiger.pageSize,
|
||||
pageCurrent: pageData.pageConfiger.pageNum,
|
||||
rwlx: 3,
|
||||
...listQuery.value
|
||||
};
|
||||
pageData.tableConfiger.loading = true;
|
||||
qcckGet(pramas, "/mosty-yjzl/tbZdxlFgxlrw/selectPage")
|
||||
qcckGet(pramas, "/mosty-yjzl/tbZdyrw/selectList")
|
||||
.then((res) => {
|
||||
pageData.tableData = res.records || [];
|
||||
pageData.tableConfiger.loading = false;
|
||||
|
||||
Reference in New Issue
Block a user