|
|
|
@ -4,9 +4,16 @@
|
|
|
|
|
v-model="visible"
|
|
|
|
|
width="35%"
|
|
|
|
|
class="x-dialog"
|
|
|
|
|
destroy-on-close
|
|
|
|
|
:destroy-on-close="true"
|
|
|
|
|
@closed="handlerClose()"
|
|
|
|
|
>
|
|
|
|
|
<el-form class="dialog-data" :model="form" ref="formRef" label-width="78px">
|
|
|
|
|
<el-form
|
|
|
|
|
class="dialog-data"
|
|
|
|
|
:model="form"
|
|
|
|
|
:rules="rules"
|
|
|
|
|
ref="formRef"
|
|
|
|
|
label-width="88px"
|
|
|
|
|
>
|
|
|
|
|
<el-form-item label="工单地址:" prop="address">
|
|
|
|
|
<div class="map">
|
|
|
|
|
<MarsMap
|
|
|
|
@ -40,34 +47,94 @@
|
|
|
|
|
</div>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="工单类型:" prop="gdType">
|
|
|
|
|
<el-radio-group v-model="form.gdType">
|
|
|
|
|
<el-radio :value="dict.value" v-for="dict in gdlx">{{
|
|
|
|
|
<el-radio-group v-model="form.gdType" @change="changeType()">
|
|
|
|
|
<el-radio :value="parseInt(dict.value)" v-for="dict in dict.gdlx">{{
|
|
|
|
|
dict.label
|
|
|
|
|
}}</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="简要描述:" prop="gdms">
|
|
|
|
|
<el-select v-model="form.gdms" placeholder="请选择" clearable>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in gdms"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
|
|
|
|
|
<section v-if="id">
|
|
|
|
|
<el-form-item label="倒伏类型:" prop="dflx" v-if="form.gdType == 0">
|
|
|
|
|
<el-checkbox-group v-model="form.dflx">
|
|
|
|
|
<el-checkbox
|
|
|
|
|
v-for="dict in dict.dflx"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-checkbox-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="工单照片:" prop="gdtp">
|
|
|
|
|
<ImageUpload v-model="form.gdtp"></ImageUpload>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="工单等级:" prop="gdLevel">
|
|
|
|
|
<el-radio-group v-model="form.gdLevel">
|
|
|
|
|
<el-radio :value="parseInt(dict.value)" v-for="dict in dict.gdlevel">{{
|
|
|
|
|
dict.label
|
|
|
|
|
}}</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="处置方案:" prop="clfa">
|
|
|
|
|
<el-select v-model="form.clfa" placeholder="请选择" clearable>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in dict.clfa"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="派遣人数:" prop="pqrs">
|
|
|
|
|
<el-input v-model="form.pqrs" placeholder="请输入" clearable>
|
|
|
|
|
<template #suffix>
|
|
|
|
|
<span>人</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="派遣车辆:" prop="pqcl">
|
|
|
|
|
<el-input v-model="form.pqcl" placeholder="请输入" clearable>
|
|
|
|
|
<template #suffix>
|
|
|
|
|
<span>辆</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="资源协调:" prop="zyxt">
|
|
|
|
|
<el-checkbox-group v-model="form.zyxt">
|
|
|
|
|
<el-checkbox
|
|
|
|
|
v-for="dict in dict.zyxt"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-checkbox-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section v-else>
|
|
|
|
|
<el-form-item label="简要描述:" prop="gdms">
|
|
|
|
|
<el-select v-model="form.gdms" placeholder="请选择" clearable>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in dict.gdms"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="parseInt(dict.value)"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="选派人员:" prop="zzjg">
|
|
|
|
|
<el-cascader
|
|
|
|
|
v-model="form.zzjg"
|
|
|
|
|
:options="deptList"
|
|
|
|
|
:props="cascaderProps"
|
|
|
|
|
@change="handleChange"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="选派人员:" prop="pqrs">
|
|
|
|
|
<el-cascader
|
|
|
|
|
v-model="form.pqrs"
|
|
|
|
|
:options="deptList"
|
|
|
|
|
:props="cascaderProps"
|
|
|
|
|
@expand-change="handleChange"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</section>
|
|
|
|
|
</el-form>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<div class="dialog-footer">
|
|
|
|
|
<el-button @click="visible = false" icon="CloseBold">取消</el-button>
|
|
|
|
|
<el-button @click="handlerClose()" icon="CloseBold">取消</el-button>
|
|
|
|
|
<el-button type="primary" icon="Select" @click="confirm()"
|
|
|
|
|
>确定</el-button
|
|
|
|
|
>
|
|
|
|
@ -77,21 +144,29 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
import { addyj, updateyj } from "@/api/emergency-rescue";
|
|
|
|
|
import {
|
|
|
|
|
addyj,
|
|
|
|
|
updateyj,
|
|
|
|
|
getDetListById,
|
|
|
|
|
getyjById,
|
|
|
|
|
} from "@/api/emergency-rescue";
|
|
|
|
|
import MarsMap from "@/components/mars-work/mars-map.vue";
|
|
|
|
|
import mapOptions from "@/components/mars-work/mapOptions";
|
|
|
|
|
import markerIcon from "@/assets/images/map-marker.png";
|
|
|
|
|
import { gaodeAddress, gaodePOI } from "@/utils/common.js";
|
|
|
|
|
import { deptTreeSelect } from "@/api/system/user";
|
|
|
|
|
import { onMounted } from "vue";
|
|
|
|
|
import { onMounted, onBeforeUnmount } from "vue";
|
|
|
|
|
import useUserStore from "@/store/modules/user";
|
|
|
|
|
// import { nextTick } from "vue/types/umd";
|
|
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
|
const { gdlx, gdms } = proxy.useDict("gdlx", "gdms");
|
|
|
|
|
|
|
|
|
|
const userStore = useUserStore();
|
|
|
|
|
const deptList = ref([]);
|
|
|
|
|
const gaodePOIList = ref([]);
|
|
|
|
|
const currentId = ref(0);
|
|
|
|
|
const cascaderProps = {
|
|
|
|
|
value: "id",
|
|
|
|
|
value: "deptId",
|
|
|
|
|
label: "deptName",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
@ -99,6 +174,20 @@ const props = defineProps({
|
|
|
|
|
type: String,
|
|
|
|
|
default: "",
|
|
|
|
|
},
|
|
|
|
|
dict:{
|
|
|
|
|
type:Object,
|
|
|
|
|
default:{
|
|
|
|
|
gdlx:[],
|
|
|
|
|
dflx:[],
|
|
|
|
|
gdlevel:[],
|
|
|
|
|
clfa:[],
|
|
|
|
|
zyxt:[],
|
|
|
|
|
gdms:[],
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
id: {
|
|
|
|
|
type: Number,
|
|
|
|
|
},
|
|
|
|
|
modelValue: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: false,
|
|
|
|
@ -122,7 +211,7 @@ const data = reactive({
|
|
|
|
|
createId: undefined, //创建者id
|
|
|
|
|
createTime: undefined, //创建时间
|
|
|
|
|
deptId: undefined, //部门id
|
|
|
|
|
dflx: undefined, //倒伏类型
|
|
|
|
|
dflx: [], //倒伏类型
|
|
|
|
|
gdLevel: undefined, //工单等级
|
|
|
|
|
gdType: undefined, //工单类型
|
|
|
|
|
gdms: undefined, //工单描述
|
|
|
|
@ -133,9 +222,24 @@ const data = reactive({
|
|
|
|
|
pqrs: undefined, //派遣人数
|
|
|
|
|
reason: undefined, //退单原因
|
|
|
|
|
status: undefined, //状态 0:待勘察,1:待派发,2:已退单.3:待处理,4:已完成
|
|
|
|
|
zyxt: undefined, //资源协调
|
|
|
|
|
zyxt: [], //资源协调
|
|
|
|
|
zzjg: [],
|
|
|
|
|
},
|
|
|
|
|
rules: {
|
|
|
|
|
address: [{ required: true, message: "请填写工单地址", trigger: "blur" }],
|
|
|
|
|
gdType: [{ required: true, message: "请选择工单类型", trigger: "change" }],
|
|
|
|
|
gdms: [{ required: true, message: "请选择简要描述", trigger: "change" }],
|
|
|
|
|
zzjg: [{ required: true, message: "请选择选派人员", trigger: "change" }],
|
|
|
|
|
|
|
|
|
|
dflx: [{ required: true, message: "请选择倒伏类型", trigger: "change" }],
|
|
|
|
|
gdtp: [{ required: true, message: "请上传工单照片", trigger: "change" }],
|
|
|
|
|
gdLevel: [{ required: true, message: "请选择工单等级", trigger: "change" }],
|
|
|
|
|
|
|
|
|
|
clfa: [{ required: true, message: "请选择处置方案", trigger: "change" }],
|
|
|
|
|
pqrs: [{ required: true, message: "请填写派遣人数", trigger: "change" }],
|
|
|
|
|
pqcl: [{ required: true, message: "请填写派遣车辆", trigger: "change" }],
|
|
|
|
|
zyxt: [{ required: true, message: "请选择资源协调", trigger: "change" }],
|
|
|
|
|
},
|
|
|
|
|
rules: {},
|
|
|
|
|
});
|
|
|
|
|
const { queryParams, form, rules } = toRefs(data);
|
|
|
|
|
const visible = ref(props.modelValue);
|
|
|
|
@ -154,23 +258,80 @@ onMounted(() => {
|
|
|
|
|
getDeptTree();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const changeType = () => {
|
|
|
|
|
form.value.dflx = [];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 提交
|
|
|
|
|
*/
|
|
|
|
|
const confirm = () => {
|
|
|
|
|
proxy.$refs["formRef"].validate(async (valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
form.value.zzjg = form.value.zzjg.join();
|
|
|
|
|
form.value.dflx = form.value.dflx.join();
|
|
|
|
|
form.value.zyxt = form.value.zyxt.join();
|
|
|
|
|
if (form.value.id) {
|
|
|
|
|
await updateyj(form.value);
|
|
|
|
|
proxy.$modal.msgSuccess(`${props.title}成功`);
|
|
|
|
|
} else {
|
|
|
|
|
await addyj(form.value);
|
|
|
|
|
proxy.$modal.msgSuccess("新增成功");
|
|
|
|
|
}
|
|
|
|
|
emit("confirm");
|
|
|
|
|
visible.value = false;
|
|
|
|
|
try {
|
|
|
|
|
emit("confirm");
|
|
|
|
|
handlerClose();
|
|
|
|
|
} catch {
|
|
|
|
|
form.value.zzjg = form.value.zzjg.split(",");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取详情
|
|
|
|
|
*/
|
|
|
|
|
const getInfo = async (val) => {
|
|
|
|
|
if (!props.id || !visible.value) return;
|
|
|
|
|
console.log(props.id, visible.value);
|
|
|
|
|
const res = await getyjById(props.id);
|
|
|
|
|
res.data.zzjg = res.data.zzjg.split(",").map((item) => parseInt(item));
|
|
|
|
|
|
|
|
|
|
res.data.zyxt = filterArray(res.data.zyxt);
|
|
|
|
|
res.data.dflx = filterArray(res.data.dflx);
|
|
|
|
|
|
|
|
|
|
form.value = res.data;
|
|
|
|
|
if (form.value.lat && form.value.lon && mapData) {
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
handleMapClick(form.value.lat, form.value.lon);
|
|
|
|
|
mapData.flyToGraphic(mapLayer.marker, { radius: 300 });
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const filterArray = (data) => {
|
|
|
|
|
if (data) {
|
|
|
|
|
return data.split(",");
|
|
|
|
|
} else {
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
const handlerClose = () => {
|
|
|
|
|
proxy.resetForm("formRef");
|
|
|
|
|
visible.value = false;
|
|
|
|
|
gaodePOIList.value = [];
|
|
|
|
|
if (mapData) {
|
|
|
|
|
mapData.destroy();
|
|
|
|
|
mapData = null;
|
|
|
|
|
mapLayer.marker?.clear();
|
|
|
|
|
entity = null;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 地址搜索
|
|
|
|
|
*/
|
|
|
|
@ -197,18 +358,21 @@ const handleCograph = (item) => {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
/**
|
|
|
|
|
* 级联变化
|
|
|
|
|
* 级联取人员deptID
|
|
|
|
|
*/
|
|
|
|
|
const handleChange = (value) => {};
|
|
|
|
|
const getDeptTree = async () => {
|
|
|
|
|
const res = await deptTreeSelect();
|
|
|
|
|
deptList.value = res.data;
|
|
|
|
|
console.log(deptList.value);
|
|
|
|
|
const handleChange = (value) => {
|
|
|
|
|
form.value.deptId = value[value.length - 1];
|
|
|
|
|
console.log(form.value.deptId);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取系统组织架构
|
|
|
|
|
*/
|
|
|
|
|
const getDeptTree = async () => {
|
|
|
|
|
const res = await getDetListById({
|
|
|
|
|
deptId: userStore.deptId,
|
|
|
|
|
});
|
|
|
|
|
deptList.value = res;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取地图配置
|
|
|
|
@ -241,14 +405,9 @@ const marsOnload = (map) => {
|
|
|
|
|
const latitude = Cesium.Math.toDegrees(cartographic.latitude);
|
|
|
|
|
const res = await gaodeAddress(`${longitude},${latitude}`);
|
|
|
|
|
form.value.address = res.formatted_address;
|
|
|
|
|
|
|
|
|
|
handleMapClick(longitude, latitude);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (form.value.longitude && form.value.latitude) {
|
|
|
|
|
handleMapClick(form.value.longitude, form.value.latitude);
|
|
|
|
|
map.flyToGraphic(mapLayer.marker, { radius: 300 });
|
|
|
|
|
}
|
|
|
|
|
getInfo();
|
|
|
|
|
};
|
|
|
|
|
/**
|
|
|
|
|
* @description: 处理地图点击
|
|
|
|
@ -258,6 +417,9 @@ const marsOnload = (map) => {
|
|
|
|
|
* @returns
|
|
|
|
|
*/
|
|
|
|
|
const handleMapClick = (longitude, latitude) => {
|
|
|
|
|
if (!isPositiveDecimal(longitude)) longitude = parseFloat(longitude);
|
|
|
|
|
if (!isPositiveDecimal(latitude)) latitude = parseFloat(latitude);
|
|
|
|
|
console.log(entity, "sss");
|
|
|
|
|
if (entity) {
|
|
|
|
|
entity.position = [longitude, latitude];
|
|
|
|
|
} else {
|
|
|
|
@ -277,15 +439,11 @@ const handleMapClick = (longitude, latitude) => {
|
|
|
|
|
form.value.lon = latitude; //经度
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onUnmounted(() => {
|
|
|
|
|
if (mapData) {
|
|
|
|
|
mapData.destroy();
|
|
|
|
|
mapData = null;
|
|
|
|
|
}
|
|
|
|
|
mapLayer.marker?.clear();
|
|
|
|
|
mapLayer = null;
|
|
|
|
|
entity = null;
|
|
|
|
|
});
|
|
|
|
|
const isPositiveDecimal = (num) => {
|
|
|
|
|
return typeof num === "number" && num >= 0 && !Number.isInteger(num);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onBeforeUnmount(() => {});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|