Browse Source

详情地图

ops-management-platform-frontend-dev
wbc 1 week ago
parent
commit
b1ba449885
  1. 33
      src/api/common/index.ts
  2. 68
      src/views/IO/delayPatrol/waitAudit/faultModal.vue
  3. 68
      src/views/IO/delayPatrol/waitPatrol/faultModal.vue
  4. 2
      src/views/IO/patrolReport/index.vue
  5. 8
      src/views/IO/patrolReport/patrolReportdata.ts
  6. 12
      src/views/IO/patrolReport/reportModal.vue
  7. 173
      src/views/IO/workOrder/delayAudit/auditModal.vue
  8. 185
      src/views/IO/workOrder/delayAudit/detailDrawer.vue
  9. 247
      src/views/IO/workOrder/delayAudit/faultModal.vue
  10. 28
      src/views/IO/workOrder/delayAudit/index.vue
  11. 173
      src/views/IO/workOrder/orderAudit/auditModal.vue
  12. 14
      src/views/IO/workOrder/orderAudit/data.ts
  13. 160
      src/views/IO/workOrder/orderAudit/detailDrawer.vue
  14. 240
      src/views/IO/workOrder/orderAudit/faultModal.vue
  15. 28
      src/views/IO/workOrder/orderAudit/index.vue
  16. 93
      src/views/IO/workOrder/orderSearch/data.ts
  17. 46
      src/views/IO/workOrder/orderSearch/detailDrawer.vue
  18. 68
      src/views/IO/workOrder/orderSearch/faultModal.vue
  19. 29
      src/views/IO/workOrder/orderSearch/index.vue
  20. 14
      src/views/IO/workOrder/orderSend/data.ts
  21. 46
      src/views/IO/workOrder/orderSend/detailDrawer.vue
  22. 68
      src/views/IO/workOrder/orderSend/faultModal.vue
  23. 28
      src/views/IO/workOrder/orderSend/index.vue
  24. 148
      src/views/IO/workOrder/orderSend/sendModal.vue
  25. 12
      src/views/analysis/type/data.ts
  26. 108
      src/views/property/point/addModal.vue
  27. 3
      src/views/property/point/index.vue
  28. 30
      src/views/property/point/pointModal.vue

33
src/api/common/index.ts

@ -0,0 +1,33 @@
import { defHttp } from '@/utils/http/axios';
enum Api {
getSubcategoryType = '/platform/subcategoryType/list',
getProjectInfo = '/platform/projectInfo/getNames',
getOrganizationType = '/platform/organizationType/list',
getContractNamesByProjectName = '/platform/contractInfo/getContractNamesByProjectName',
queryPointNames = '/platform/pointInfo/queryPointNames ',
}
export function getSubcategoryType() {
return defHttp.get({ url: Api.getSubcategoryType });
}
export function getProjectInfo() {
return defHttp.get({ url: Api.getProjectInfo });
}
export function getOrganizationType() {
return defHttp.get({ url: Api.getOrganizationType });
}
export function getContractNamesByProjectName(data:any) {
return defHttp.post({ url: Api.getContractNamesByProjectName,data });
}
export function queryPointNames() {
return defHttp.get({ url: Api.queryPointNames });
}

68
src/views/IO/delayPatrol/waitAudit/faultModal.vue

@ -39,8 +39,8 @@
<a-col :span="12">
<a-form-item label="是否事故" name="isAccident">
<a-radio-group v-model:value="form.isAccident">
<a-radio :value="1"></a-radio>
<a-radio :value="0"></a-radio>
<a-radio value="是"></a-radio>
<a-radio value="否"></a-radio>
</a-radio-group>
</a-form-item>
</a-col>
@ -78,7 +78,7 @@
:options="faultSubcategoryOptions"
:fieldNames="{
label: 'typeName',
value: 'id',
value: 'typeName',
options: 'options',
}"
/>
@ -105,13 +105,18 @@
v-model:value="form.faultLocation"
:options="faultLocationOptions"
@change="faultLocationChange"
:fieldNames="{
label: 'pointName',
value: 'pointName',
options: 'options',
}"
/>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div id="amapContainer" style="width: 100%; height: 500px"></div>
<div id="waitAuditMap" style="width: 100%; height: 500px"></div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
@ -132,15 +137,15 @@
>
<a-button type="primary"> 上传 </a-button>
</a-upload>
</a-form-item>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-form-item label="是否派遣" name="isDispatched">
<a-radio-group v-model:value="form.isDispatched">
<a-radio :value="1"></a-radio>
<a-radio :value="0"></a-radio>
<a-radio value="是"></a-radio>
<a-radio value="否"></a-radio>
</a-radio-group>
</a-form-item>
</a-col>
@ -178,6 +183,7 @@
import AMapLoader from '@amap/amap-jsapi-loader';
import { getToken } from '@/utils/auth';
import { useGlobSetting } from '@/hooks/setting';
import {queryPointNames} from '@/api/common/index'
export default {
setup() {
const visible = ref(false);
@ -218,51 +224,44 @@
};
const responseLevelOptions = [
{
value: 0,
label: '常规',
value: '常规',
},
{
value: 1,
label: '紧急',
value: '紧急',
},
{
value: 2,
label: '特级',
value: '特级',
},
];
const maintenanceRequirementOptions = [
{
value: 1,
label: '新增',
value: '修复',
},
{
value: '新增',
},
];
const faultLocationOptions = [
{
value: '1',
label: 'a',
latitude: '29.8537459',
longitude: '121.5591519',
value: '拆除',
},
{
value: '2',
label: 'b',
latitude: '29.8572957 ',
longitude: '121.5611743',
value: '清除',
},
{
value: '3',
label: 'c',
latitude: '29.8537459',
longitude: '121.5591519',
value: '其他',
},
];
const faultLocationOptions = ref([])
const getFaultLocationOptions = async() =>{
const res = await queryPointNames()
faultLocationOptions.value = res
}
const faultLocationChange = (val) => {
const obj = faultLocationOptions.find((i) => {
return (i.value = val);
const obj = faultLocationOptions.value.find((i) => {
return (i.pointName = val);
});
form.longitude = obj.longitude;
form.latitude = obj.latitude;
initMap(obj.longitude, obj.latitude, obj.organizationName);
initMap(obj.longitude, obj.latitude, obj.pointName);
};
const faultSubcategoryOptions = ref([]);
const getFaultSubcategoryOptions = async () => {
@ -274,6 +273,7 @@
getFaultSubcategoryOptions();
getProjectNameOptions();
getOrganizationNameOptions();
getFaultLocationOptions()
};
const handleOk = () => {
@ -302,7 +302,7 @@
});
//
map.value = new AMap.Map('amapContainer', {
map.value = new AMap.Map('waitAuditMap', {
zoom: 17,
center: [longitude, latitude],
});
@ -320,7 +320,7 @@
};
const closeModal = () => {
formRef.value.resetFields();
fileLists.value=[]
fileLists.value = [];
visible.value = false;
map.value?.destroy();
};

68
src/views/IO/delayPatrol/waitPatrol/faultModal.vue

@ -39,8 +39,8 @@
<a-col :span="12">
<a-form-item label="是否事故" name="isAccident">
<a-radio-group v-model:value="form.isAccident">
<a-radio :value="1"></a-radio>
<a-radio :value="0"></a-radio>
<a-radio value="是"></a-radio>
<a-radio value="否"></a-radio>
</a-radio-group>
</a-form-item>
</a-col>
@ -78,7 +78,7 @@
:options="faultSubcategoryOptions"
:fieldNames="{
label: 'typeName',
value: 'id',
value: 'typeName',
options: 'options',
}"
/>
@ -105,13 +105,18 @@
v-model:value="form.faultLocation"
:options="faultLocationOptions"
@change="faultLocationChange"
:fieldNames="{
label: 'pointName',
value: 'pointName',
options: 'options',
}"
/>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div id="amapContainer" style="width: 100%; height: 500px"></div>
<div id="waitPatrolMap" style="width: 100%; height: 500px"></div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
@ -132,15 +137,15 @@
>
<a-button type="primary"> 上传 </a-button>
</a-upload>
</a-form-item>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-form-item label="是否派遣" name="isDispatched">
<a-radio-group v-model:value="form.isDispatched">
<a-radio :value="1"></a-radio>
<a-radio :value="0"></a-radio>
<a-radio value="是"></a-radio>
<a-radio value="否"></a-radio>
</a-radio-group>
</a-form-item>
</a-col>
@ -178,6 +183,7 @@
import AMapLoader from '@amap/amap-jsapi-loader';
import { getToken } from '@/utils/auth';
import { useGlobSetting } from '@/hooks/setting';
import {queryPointNames} from '@/api/common/index'
export default {
setup() {
const visible = ref(false);
@ -218,51 +224,44 @@
};
const responseLevelOptions = [
{
value: 0,
label: '常规',
value: '常规',
},
{
value: 1,
label: '紧急',
value: '紧急',
},
{
value: 2,
label: '特级',
value: '特级',
},
];
const maintenanceRequirementOptions = [
{
value: 1,
label: '新增',
value: '修复',
},
{
value: '新增',
},
];
const faultLocationOptions = [
{
value: '1',
label: 'a',
latitude: '29.8537459',
longitude: '121.5591519',
value: '拆除',
},
{
value: '2',
label: 'b',
latitude: '29.8572957 ',
longitude: '121.5611743',
value: '清除',
},
{
value: '3',
label: 'c',
latitude: '29.8537459',
longitude: '121.5591519',
value: '其他',
},
];
const faultLocationOptions = ref([])
const getFaultLocationOptions = async() =>{
const res = await queryPointNames()
faultLocationOptions.value = res
}
const faultLocationChange = (val) => {
const obj = faultLocationOptions.find((i) => {
return (i.value = val);
const obj = faultLocationOptions.value.find((i) => {
return (i.pointName = val);
});
form.longitude = obj.longitude;
form.latitude = obj.latitude;
initMap(obj.longitude, obj.latitude, obj.organizationName);
initMap(obj.longitude, obj.latitude, obj.pointName);
};
const faultSubcategoryOptions = ref([]);
const getFaultSubcategoryOptions = async () => {
@ -274,6 +273,7 @@
getFaultSubcategoryOptions();
getProjectNameOptions();
getOrganizationNameOptions();
getFaultLocationOptions()
};
const handleOk = () => {
@ -302,7 +302,7 @@
});
//
map.value = new AMap.Map('amapContainer', {
map.value = new AMap.Map('waitPatrolMap', {
zoom: 17,
center: [longitude, latitude],
});
@ -320,7 +320,7 @@
};
const closeModal = () => {
formRef.value.resetFields();
fileLists.value=[]
fileLists.value = [];
visible.value = false;
map.value?.destroy();
};

2
src/views/IO/patrolReport/index.vue

@ -23,7 +23,7 @@
</template>
</template>
</BasicTable>
<reportModal ref="reportModalRef" />
<reportModal ref="reportModalRef" @success="reload()" />
<detailDrawer ref="detailDrawerRef" />
</PageWrapper>
</template>

8
src/views/IO/patrolReport/patrolReportdata.ts

@ -30,10 +30,10 @@ export const columns: BasicColumn[] = [
title: '巡检部位',
dataIndex: 'inspectionPart',
},
{
title: '类型',
dataIndex: 'type',
},
// {
// title: '类型',
// dataIndex: 'type',
// },
{
title: '巡检时间',
dataIndex: 'inspectionTime',

12
src/views/IO/patrolReport/reportModal.vue

@ -102,7 +102,7 @@
import { getToken } from '@/utils/auth';
import { useGlobSetting } from '@/hooks/setting';
export default {
setup() {
setup(props,{emit}) {
const title = ref('新增');
const formRef = ref();
// const attachmentList = ref([]);
@ -165,6 +165,8 @@
};
//
const showModal = async (type, id) => {
visible.value = true;
getProjectOptions()
if (type == 1) {
title.value = '新增';
} else if (type == 2) {
@ -192,8 +194,7 @@
})
}
}
visible.value = true;
getProjectOptions()
};
const handleOk = () => {
@ -207,7 +208,9 @@
delete params.id
add(params).then((_) => {
message.success('新增成功');
emit('success')
closeModal()
});
} else {
let params = {};
@ -216,7 +219,8 @@
}
update(params).then((_) => {
message.success('编辑成功');
closeModal()
emit('success')
closeModal()
});
}
}

173
src/views/IO/workOrder/delayAudit/auditModal.vue

@ -0,0 +1,173 @@
<template>
<a-modal v-model:open="visible" :title="title" @ok="handleOk" width="50%" @cancel="closeModal">
<a-form :model="form" layout="vertical" ref="formRef" :rules="rules">
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="所属项目" name="projectName">
<a-input v-model:value="form.projectName" disabled />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="所属合同" name="contractName">
<a-input v-model:value="form.contractName" disabled />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="处理结果" name="handleResult">
<a-select v-model:value="form.handleResult" :options="handleResultOptions" placeholder="请选择" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-form-item label="接单超期" name="isOrderTakingOverTime">
<a-radio-group v-model:value="form.isOrderTakingOverTime">
<a-radio :value="1"></a-radio>
<a-radio :value="0"></a-radio>
</a-radio-group>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="接单超期扣款" name="orderTakingCost">
<a-input v-model:value="form.orderTakingCost" placeholder="接单超期扣款(元/小时)" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-form-item label="处理超期" name="isHandleOverTime">
<a-radio-group v-model:value="form.isHandleOverTime">
<a-radio :value="1"></a-radio>
<a-radio :value="0"></a-radio>
</a-radio-group>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="处理超期扣款" name="handleCost">
<a-input v-model:value="form.handleCost" placeholder="处理超期扣款(元/小时)" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="其他扣款费用" name="otherCost">
<a-input v-model:value="form.otherCost" placeholder="请输入" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="其他扣款原因" name="otherCostReason">
<a-input v-model:value="form.otherCostReason" placeholder="请输入" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="审核意见" name="auditOpinion">
<a-textarea v-model:value="form.auditOpinion" :rows="4" placeholder="请输入" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="是否结案" name="closeCase">
<a-radio-group v-model:value="form.closeCase">
<a-radio :value="1"></a-radio>
<a-radio :value="0"></a-radio>
</a-radio-group>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-modal>
</template>
<script>
import { reactive, ref } from 'vue';
import { message } from 'ant-design-vue';
import { getInfo } from './api';
export default {
setup() {
const title = ref('派遣');
const visible = ref(false);
const form = reactive({
projectName: '',
contractName: '',
handleResult: null,
isOrderTakingOverTime: null,
orderTakingCost: '',
isHandleOverTime: '',
handleCost: null,
otherCost: '',
otherCostReason: '',
auditOpinion:'',
closeCase:null,
id: null,
});
//
const handleResultOptions = [
{
value: '通过',
},
{
value: '退回',
},
];
const showModal = async (id) => {
visible.value = true;
const data = await getInfo(id);
for (let i in form) {
form[i] = data[i];
}
};
const handleOk = () => {
formRef.value.validate().then((valid) => {
if (valid) {
console.log(form)
}
});
};
const closeModal = () => {
formRef.value.resetFields();
visible.value = false;
};
const formRef = ref();
const rules = {
handleResult: [{ required: true, message: '请选择' }],
isOrderTakingOverTime: [{ required: true, message: '请选择' }],
orderTakingCost: [{ required: true, message: '请输入' }],
isHandleOverTime: [{ required: true, message: '请选择' }],
handleCost: [{ required: true, message: '请输入' }],
otherCost: [{ required: true, message: '请输入' }],
otherCostReason: [{ required: true, message: '请输入' }],
auditOpinion: [{ required: true, message: '请输入' }],
closeCase: [{ required: true, message: '请选择' }],
};
return {
visible,
title,
form,
handleResultOptions,
showModal,
handleOk,
closeModal,
formRef,
rules,
};
},
};
</script>
<style scoped>
/* 可选样式调整 */
.ant-modal-body {
max-width: 600px;
margin: 0 auto;
}
</style>

185
src/views/IO/workOrder/delayAudit/detailDrawer.vue

@ -13,82 +13,79 @@
<a-tab-pane key="1" tab="详细信息">
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div>所属项目:{{ DetailDr }}</div>
<div><span class="titleLabel">所属项目</span>{{ detail.projectName }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div>所属合同:</div>
<div><span class="titleLabel">所属合同</span>{{ detail.contractName }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<div>编号:</div>
<div><span class="titleLabel">编号</span>{{ detail.id }}</div>
</a-col>
<a-col :span="12">
<div>报修人员:</div>
<div><span class="titleLabel">报修人员</span>{{ detail.repairer }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<div>状态:</div>
<div><span class="titleLabel">状态</span>{{ detail.status }}</div>
</a-col>
<a-col :span="12">
<div>待处理人:</div>
<div><span class="titleLabel">待处理人</span>{{ detail.handler }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<div>报修时间:</div>
<div><span class="titleLabel">报修时间</span>{{ detail.repairTime }}</div>
</a-col>
<a-col :span="12">
<div>是否事故:</div>
<div><span class="titleLabel">是否事故</span>{{ detail.isAccident }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<div>故障大类:</div>
<div><span class="titleLabel">故障大类</span>{{ detail.faultCategory }}</div>
</a-col>
<a-col :span="12">
<div>故障小类:</div>
<div><span class="titleLabel">故障小类</span>{{ detail.faultSubcategory }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<div>所属机构:</div>
<div><span class="titleLabel">所属机构</span>{{ detail.institution }}</div>
</a-col>
<a-col :span="12">
<div>响应级别:</div>
<div><span class="titleLabel">响应级别</span>{{ detail.responseLevel }}</div>
</a-col>
</a-row>
x
</a-tab-pane>
<a-tab-pane key="2" tab="处理信息" force-render>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div>维修人员:</div>
<div><span class="titleLabel">响应时限(小时)</span>{{ detail.responseTime }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div>修复时间:</div>
<div><span class="titleLabel">故障地址</span>{{ detail.faultLocation }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div>修复结果:</div>
<div><span class="titleLabel">故障描述</span>{{ detail.faultDescription }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div>费用情况:</div>
<div><span class="titleLabel">故障图片</span>{{ detail.faultImg }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div>处理图片:</div>
</a-col>
</a-row>
<a-col :span="24">
<div id="orderAuditDetailMap" style="width: 100%; height: 500px"></div>
</a-col>
</a-row>
</a-tab-pane>
<a-tab-pane key="3" tab="流程信息">
<div style="margin-left: 20px">
@ -120,105 +117,91 @@
</a-timeline>
</div>
</a-tab-pane>
<a-tab-pane key="4" tab="历史信息">
<a-table :dataSource="historyInfo" :columns="historyColumns" bordered>
<template #bodyCell="{ column }">
<template v-if="column.key === 'action'">
<a-button type="link">查看</a-button>
</template>
</template>
</a-table>
</a-tab-pane>
<a-tab-pane key="5" tab="延期信息">
<a-table :dataSource="delayInfo" :columns="delayColumns" bordered>
<template #bodyCell="{ column }">
<template v-if="column.key === 'action'">
<a-button type="link">查看</a-button>
</template>
</template>
</a-table>
</a-tab-pane>
</a-tabs>
</a-drawer>
</div>
</template>
<script>
import { ref } from 'vue';
import { reactive, ref } from 'vue';
import { getInfo } from './api';
import AMapLoader from '@amap/amap-jsapi-loader';
export default {
setup(props, { emit }) {
const visible = ref(false);
//
let detail = reactive({
projectName: '',
contractName: '',
id: '',
status: null,
repairer: '',
handler: '',
repairTime: '',
institution: '',
isAccident: null,
faultCategory: '',
faultSubcategory: '',
responseLevel: null,
responseTime: '',
faultLocation: '',
faultDescription: '',
faultImg: '',
longitude:'',
latitude:''
});
//
const showDrawer = () => {
const visible = ref(false);
const showDrawer = async (id) => {
visible.value = true;
const data = await getInfo(id);
for (let i in detail) {
detail[i] = data[i];
}
initMap(detail.longitude,detail.latitude,detail.faultLocation)
};
//
const onClose = () => {
visible.value = false;
map.value?.destroy()
};
const activeKey = ref('1');
const openModal = () => {
emit('openModal');
//
const map = ref(null);
const initMap = async (longitude, latitude, organizationName) => {
try {
// JavaScript API
await AMapLoader.load({
key: '786a2e7cc6d4be5ba1d6174a0aa10f2b',
version: '2.0',
plugins: [],
});
//
map.value = new AMap.Map('orderAuditDetailMap', {
zoom: 17,
center: [longitude, latitude],
});
//
const marker = new AMap.Marker({
position: new AMap.LngLat(longitude, latitude),
title: organizationName,
});
const markerList = [marker];
map.value.add(markerList);
} catch (error) {
console.error('加载高德地图失败:', error);
}
};
const historyInfo = ref([]);
const historyColumns = [
{
title: '环节',
dataIndex: 'stage',
key: 'stage',
},
{
title: '操作',
dataIndex: 'operation',
key: 'operation',
},
{
title: '操作人',
dataIndex: 'operator',
key: 'operator',
},
{
title: '详细信息',
dataIndex: 'action',
key: 'action ',
},
];
const delayInfo = ref([]);
const delayColumns = [
{
title: '申请时间',
dataIndex: 'applyTime',
key: 'applyTime',
},
{
title: '申请原因',
dataIndex: 'applyReason',
key: 'applyReason',
},
{
title: '延期时间',
dataIndex: 'delayTime',
key: 'delayTime',
},
{
title: '详细信息',
dataIndex: 'action',
key: 'action ',
},
];
return {
visible,
showDrawer,
onClose,
activeKey,
openModal,
historyInfo,
historyColumns,
delayInfo,
delayColumns,
detail,
};
},
};
@ -241,4 +224,8 @@
margin: 0 0 40px 20px;
color: red;
}
.titleLabel {
color: gray;
}
</style>

247
src/views/IO/workOrder/delayAudit/faultModal.vue

@ -1,247 +0,0 @@
<template>
<a-modal v-model:open="visible" title="工单上报" @ok="handleOk" width="70%">
<a-form :model="form" layout="vertical">
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="所属项目" name="projectName">
<a-select
v-model:value="form.projectName"
:options="projectNameOptions"
placeholder="请选择"
/>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-form-item label="是否事故" name="isAccident">
<a-radio-group v-model:value="form.isAccident">
<a-radio :value="1"></a-radio>
<a-radio :value="0"></a-radio>
</a-radio-group>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="报修人员" name="repairer">
<a-input v-model:value="form.repairer" placeholder="请输入" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-form-item label="响应级别">
<a-select
v-model:value="form.responseLevel"
:options="responseLevelOptions"
placeholder="请选择"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="响应时限">
<a-input v-model:value="form.responseTime" placeholder="请输入" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-form-item label="故障大类" name="faultCategory">
<a-select
v-model:value="form.faultCategory"
:options="[{ value: '前端' }]"
placeholder="请选择"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="故障小类" name="faultSubcategory">
<a-select
v-model:value="form.faultSubcategory"
:options="faultSubcategoryOptions"
placeholder="请选择"
/>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-form-item label="故障机构" name="institution">
<a-select
v-model:value="form.institution"
:options="institutionOptions"
placeholder="请选择"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="故障地点" name="faultLocation">
<a-input v-model:value="form.faultLocation" placeholder="请输入" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="故障描述" name="faultDescription">
<a-textarea v-model:value="form.faultDescription" :rows="4" placeholder="请输入" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="故障描述" name="faultDescription">
<a-textarea v-model:value="form.faultDescription" :rows="4" placeholder="请输入" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="故障图片" name="faultImg">
<a-upload
v-model:file-list="form.faultImg"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
>
<a-button type="primary"> 上传 </a-button>
</a-upload>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-form-item label="是否派遣" name="isDispatched">
<a-radio-group v-model:value="form.isDispatched">
<a-radio :value="1"></a-radio>
<a-radio :value="0"></a-radio>
</a-radio-group>
</a-form-item>
</a-col>
<a-col :span="12" v-if="form.isDispatched == 1">
<a-form-item label="维护要求" name="maintenanceRequirement">
<a-select
v-model:value="form.maintenanceRequirement"
:options="maintenanceRequirementOptions"
placeholder="请选择"
/>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]" v-if="form.isDispatched == 1">
<a-col :span="24">
<a-form-item label="派遣意见" name="dispatchOpinion">
<a-textarea v-model:value="form.dispatchOpinion" :rows="4" placeholder="请输入" />
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-modal>
</template>
<script>
import { reactive, ref } from 'vue';
export default {
setup() {
const visible = ref(false);
const form = reactive({
projectName: '',
isAccident: null,
repairer: '',
responseTime: '',
responseLevel: '',
faultCategory: '',
faultSubcategory: '',
institution: '',
faultLocation: '',
faultDescription: '',
faultImg: [],
isDispatched: null,
maintenanceRequirement: '',
dispatchOpinion: '',
});
//
const responseLevelOptions = [
{
value: 0,
label: '常规',
},
{
value: 1,
label: '紧急',
},
{
value: 2,
label: '特级',
},
];
const maintenanceRequirementOptions = [
{
value: 0,
label: '常规',
},
{
value: 1,
label: '紧急',
},
{
value: 2,
label: '特级',
},
];
const institutionOptions = [
{
value: 0,
label: '常规',
},
{
value: 1,
label: '紧急',
},
{
value: 2,
label: '特级',
},
];
const faultSubcategoryOptions = [
{
value: 0,
label: '常规',
},
{
value: 1,
label: '紧急',
},
{
value: 2,
label: '特级',
},
];
const showModal = () => {
visible.value = true;
};
const handleOk = () => {
console.log('Form Data:', form);
//
visible.value = false;
};
return {
visible,
form,
showModal,
handleOk,
responseLevelOptions,
maintenanceRequirementOptions,
institutionOptions,
faultSubcategoryOptions,
};
},
};
</script>
<style scoped>
/* 可选样式调整 */
.ant-modal-body {
max-width: 600px;
margin: 0 auto;
}
</style>

28
src/views/IO/workOrder/delayAudit/index.vue

@ -1,16 +1,16 @@
<template>
<PageWrapper dense>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="showFaultModal">审核</a-button>
<a-button type="primary" @click="showDrawer">详情</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column && record && column.key === 'action'"> </template>
<template v-if="column && record && column.key === 'action'">
<a-button type="link" @click="showAuditModal(record.id)">审核</a-button>
<a-button type="link" @click="showDrawer(record.id)">">详情</a-button>
</template>
</template>
</BasicTable>
<faultModal ref="falutModalRef" />
<detailDrawer ref="detailDrawerRef" @open-modal="showFaultModal" />
<auditModal ref="auditModalRef" />
<detailDrawer ref="detailDrawerRef" />
</PageWrapper>
</template>
@ -19,7 +19,7 @@
import { BasicTable, useTable } from '@/components/Table';
import { list } from './api';
import { formSchemas, columns } from './data';
import faultModal from './faultModal.vue';
import auditModal from './auditModal.vue';
import detailDrawer from './detailDrawer.vue';
import { ref } from 'vue';
@ -34,7 +34,7 @@
useSearchForm: true,
formConfig: {
schemas: formSchemas,
name: 'patroling',
name: 'delayAudit',
baseColProps: {
xs: 24,
sm: 24,
@ -51,14 +51,14 @@
},
});
//
const falutModalRef = ref();
const showFaultModal = () => {
falutModalRef.value.showModal();
const auditModalRef = ref();
const showAuditModal = (id:any) => {
auditModalRef.value.showModal(id);
};
//
const detailDrawerRef = ref();
const showDrawer = () => {
detailDrawerRef.value.showDrawer();
const showDrawer = (id:any) => {
detailDrawerRef.value.showDrawer(id);
};
//
</script>

173
src/views/IO/workOrder/orderAudit/auditModal.vue

@ -0,0 +1,173 @@
<template>
<a-modal v-model:open="visible" :title="title" @ok="handleOk" width="50%" @cancel="closeModal">
<a-form :model="form" layout="vertical" ref="formRef" :rules="rules">
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="所属项目" name="projectName">
<a-input v-model:value="form.projectName" disabled />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="所属合同" name="contractName">
<a-input v-model:value="form.contractName" disabled />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="处理结果" name="handleResult">
<a-select v-model:value="form.handleResult" :options="handleResultOptions" placeholder="请选择" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-form-item label="接单超期" name="isOrderTakingOverTime">
<a-radio-group v-model:value="form.isOrderTakingOverTime">
<a-radio value="是"></a-radio>
<a-radio value="否"></a-radio>
</a-radio-group>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="接单超期扣款" name="orderTakingCost">
<a-input v-model:value="form.orderTakingCost" placeholder="接单超期扣款(元/小时)" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-form-item label="处理超期" name="isHandleOverTime">
<a-radio-group v-model:value="form.isHandleOverTime">
<a-radio value="是"></a-radio>
<a-radio value="否"></a-radio>
</a-radio-group>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="处理超期扣款" name="handleCost">
<a-input v-model:value="form.handleCost" placeholder="处理超期扣款(元/小时)" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="其他扣款费用" name="otherCost">
<a-input v-model:value="form.otherCost" placeholder="请输入" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="其他扣款原因" name="otherCostReason">
<a-input v-model:value="form.otherCostReason" placeholder="请输入" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="审核意见" name="auditOpinion">
<a-textarea v-model:value="form.auditOpinion" :rows="4" placeholder="请输入" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="是否结案" name="closeCase">
<a-radio-group v-model:value="form.closeCase">
<a-radio :value="1"></a-radio>
<a-radio :value="0"></a-radio>
</a-radio-group>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-modal>
</template>
<script>
import { reactive, ref } from 'vue';
import { message } from 'ant-design-vue';
import { getInfo } from './api';
export default {
setup() {
const title = ref('派遣');
const visible = ref(false);
const form = reactive({
projectName: '',
contractName: '',
handleResult: null,
isOrderTakingOverTime: null,
orderTakingCost: '',
isHandleOverTime: '',
handleCost: null,
otherCost: '',
otherCostReason: '',
auditOpinion:'',
closeCase:null,
id: null,
});
//
const handleResultOptions = [
{
value: '通过',
},
{
value: '退回',
},
];
const showModal = async (id) => {
visible.value = true;
const data = await getInfo(id);
for (let i in form) {
form[i] = data[i];
}
};
const handleOk = () => {
formRef.value.validate().then((valid) => {
if (valid) {
console.log(form)
}
});
};
const closeModal = () => {
formRef.value.resetFields();
visible.value = false;
};
const formRef = ref();
const rules = {
handleResult: [{ required: true, message: '请选择' }],
isOrderTakingOverTime: [{ required: true, message: '请选择' }],
orderTakingCost: [{ required: true, message: '请输入' }],
isHandleOverTime: [{ required: true, message: '请选择' }],
handleCost: [{ required: true, message: '请输入' }],
otherCost: [{ required: true, message: '请输入' }],
otherCostReason: [{ required: true, message: '请输入' }],
auditOpinion: [{ required: true, message: '请输入' }],
closeCase: [{ required: true, message: '请选择' }],
};
return {
visible,
title,
form,
handleResultOptions,
showModal,
handleOk,
closeModal,
formRef,
rules,
};
},
};
</script>
<style scoped>
/* 可选样式调整 */
.ant-modal-body {
max-width: 600px;
margin: 0 auto;
}
</style>

14
src/views/IO/workOrder/orderAudit/data.ts

@ -27,16 +27,13 @@ export const formSchemas: FormSchema[] = [
//列表展示
const responseLevelOptions = [
{
value: 0,
label: '常规',
value: '常规',
},
{
value: 1,
label: '紧急',
value: '紧急',
},
{
value: 2,
label: '特级',
value: '特级',
},
];
@ -52,11 +49,6 @@ export const columns: BasicColumn[] = [
{
title: '响应级别',
dataIndex: 'responseLevel',
customRender({ text }) {
return responseLevelOptions.find((i) => {
return i.value == text;
})?.label;
},
},
{
title: '故障描述',

160
src/views/IO/workOrder/orderAudit/detailDrawer.vue

@ -13,80 +13,104 @@
<a-tab-pane key="1" tab="详细信息">
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div>所属项目:</div>
<div><span class="titleLabel">所属项目</span>{{ detail.projectName }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div>所属合同:</div>
<div><span class="titleLabel">所属合同</span>{{ detail.contractName }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<div>编号:</div>
<div><span class="titleLabel">编号</span>{{ detail.id }}</div>
</a-col>
<a-col :span="12">
<div>报修人员:</div>
<div><span class="titleLabel">报修人员</span>{{ detail.repairer }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<div>状态:</div>
<div><span class="titleLabel">状态</span>{{ detail.status }}</div>
</a-col>
<a-col :span="12">
<div>待处理人:</div>
<div><span class="titleLabel">待处理人</span>{{ detail.handler }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<div>报修时间:</div>
<div><span class="titleLabel">报修时间</span>{{ detail.repairTime }}</div>
</a-col>
<a-col :span="12">
<div>是否事故:</div>
<div><span class="titleLabel">是否事故</span>{{ detail.isAccident }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<div>故障大类:</div>
<div><span class="titleLabel">故障大类</span>{{ detail.faultCategory }}</div>
</a-col>
<a-col :span="12">
<div>故障小类:</div>
<div><span class="titleLabel">故障小类</span>{{ detail.faultSubcategory }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<div>所属机构:</div>
<div><span class="titleLabel">所属机构</span>{{ detail.institution }}</div>
</a-col>
<a-col :span="12">
<div>响应级别:</div>
<div><span class="titleLabel">响应级别</span>{{ detail.responseLevel }}</div>
</a-col>
</a-row>
x
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div><span class="titleLabel">响应时限(小时)</span>{{ detail.responseTime }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div><span class="titleLabel">故障地址</span>{{ detail.faultLocation }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div><span class="titleLabel">故障描述</span>{{ detail.faultDescription }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div><span class="titleLabel">故障图片</span>{{ detail.faultImg }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div id="orderAuditDetailMap" style="width: 100%; height: 500px"></div>
</a-col>
</a-row>
</a-tab-pane>
<a-tab-pane key="2" tab="处理信息" force-render>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div>维修人员:</div>
<div><span class="titleLabel">维修人员</span>{{ detail.fixPeople }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div>修复时间:</div>
<div><span class="titleLabel">修复时间</span>{{ detail.fixTime }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div>修复结果:</div>
<div><span class="titleLabel">修复结果</span>{{ detail.fixResult }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div>费用情况:</div>
<div><span class="titleLabel">费用情况</span>{{ detail.cost }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div>处理图片:</div>
<div><span class="titleLabel">处理图片</span>{{ detail.handleImg }}</div>
</a-col>
</a-row>
</a-tab-pane>
@ -144,26 +168,37 @@
</template>
<script>
import { ref } from 'vue';
import { reactive, ref } from 'vue';
import { getInfo } from './api';
import AMapLoader from '@amap/amap-jsapi-loader';
export default {
setup(props, { emit }) {
const visible = ref(false);
//
const showDrawer = () => {
visible.value = true;
};
//
const onClose = () => {
visible.value = false;
};
const activeKey = ref('1');
const openModal = () => {
emit('openModal');
};
//
let detail = reactive({
projectName: '',
contractName: '',
id: '',
status: null,
repairer: '',
handler: '',
repairTime: '',
institution: '',
isAccident: null,
faultCategory: '',
faultSubcategory: '',
responseLevel: null,
responseTime: '',
faultLocation: '',
faultDescription: '',
faultImg: '',
fixPeople: '',
fixTime: '',
fixResult: '',
cost: '',
handleImg: '',
longitude:'',
latitude:''
});
const historyInfo = ref([]);
const historyColumns = [
{
@ -210,16 +245,63 @@
key: 'action ',
},
];
//
const visible = ref(false);
const showDrawer = async (id) => {
visible.value = true;
const data = await getInfo(id);
for (let i in detail) {
detail[i] = data[i];
}
initMap(detail.longitude,detail.latitude,detail.faultLocation)
};
//
const onClose = () => {
visible.value = false;
map.value?.destroy()
};
const activeKey = ref('1');
//
const map = ref(null);
const initMap = async (longitude, latitude, organizationName) => {
try {
// JavaScript API
await AMapLoader.load({
key: '786a2e7cc6d4be5ba1d6174a0aa10f2b',
version: '2.0',
plugins: [],
});
//
map.value = new AMap.Map('orderAuditDetailMap', {
zoom: 17,
center: [longitude, latitude],
});
//
const marker = new AMap.Marker({
position: new AMap.LngLat(longitude, latitude),
title: organizationName,
});
const markerList = [marker];
map.value.add(markerList);
} catch (error) {
console.error('加载高德地图失败:', error);
}
};
return {
visible,
showDrawer,
onClose,
activeKey,
openModal,
historyInfo,
historyColumns,
delayInfo,
delayColumns,
detail,
};
},
};
@ -242,4 +324,8 @@
margin: 0 0 40px 20px;
color: red;
}
.titleLabel {
color: gray;
}
</style>

240
src/views/IO/workOrder/orderAudit/faultModal.vue

@ -1,240 +0,0 @@
<template>
<a-modal v-model:open="visible" title="工单上报" @ok="handleOk" width="70%">
<a-form :model="form" layout="vertical">
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="所属项目" name="projectName">
<a-select
v-model:value="form.projectName"
:options="projectNameOptions"
placeholder="请选择"
/>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-form-item label="是否事故" name="isAccident">
<a-radio-group v-model:value="form.isAccident">
<a-radio :value="1"></a-radio>
<a-radio :value="0"></a-radio>
</a-radio-group>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="报修人员" name="repairer">
<a-input v-model:value="form.repairer" placeholder="请输入" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-form-item label="响应级别">
<a-select
v-model:value="form.responseLevel"
:options="responseLevelOptions"
placeholder="请选择"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="响应时限">
<a-input v-model:value="form.responseTime" placeholder="请输入" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-form-item label="故障大类" name="faultCategory">
<a-select
v-model:value="form.faultCategory"
:options="[{ value: '前端' }]"
placeholder="请选择"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="故障小类" name="faultSubcategory">
<a-select
v-model:value="form.faultSubcategory"
:options="faultSubcategoryOptions"
placeholder="请选择"
/>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-form-item label="故障机构" name="institution">
<a-select
v-model:value="form.institution"
:options="institutionOptions"
placeholder="请选择"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="故障地点" name="faultLocation">
<a-input v-model:value="form.faultLocation" placeholder="请输入" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="故障描述" name="faultDescription">
<a-textarea v-model:value="form.faultDescription" :rows="4" placeholder="请输入" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="故障图片" name="faultImg">
<a-upload
v-model:file-list="form.faultImg"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
>
<a-button type="primary"> 上传 </a-button>
</a-upload>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-form-item label="是否派遣" name="isDispatched">
<a-radio-group v-model:value="form.isDispatched">
<a-radio :value="1"></a-radio>
<a-radio :value="0"></a-radio>
</a-radio-group>
</a-form-item>
</a-col>
<a-col :span="12" v-if="form.isDispatched == 1">
<a-form-item label="维护要求" name="maintenanceRequirement">
<a-select
v-model:value="form.maintenanceRequirement"
:options="maintenanceRequirementOptions"
placeholder="请选择"
/>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]" v-if="form.isDispatched == 1">
<a-col :span="24">
<a-form-item label="派遣意见" name="dispatchOpinion">
<a-textarea v-model:value="form.dispatchOpinion" :rows="4" placeholder="请输入" />
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-modal>
</template>
<script>
import { reactive, ref } from 'vue';
export default {
setup() {
const visible = ref(false);
const form = reactive({
projectName: '',
isAccident: null,
repairer: '',
responseTime: '',
responseLevel: '',
faultCategory: '',
faultSubcategory: '',
institution: '',
faultLocation: '',
faultDescription: '',
faultImg: [],
isDispatched: null,
maintenanceRequirement: '',
dispatchOpinion: '',
});
//
const responseLevelOptions = [
{
value: 0,
label: '常规',
},
{
value: 1,
label: '紧急',
},
{
value: 2,
label: '特级',
},
];
const maintenanceRequirementOptions = [
{
value: 0,
label: '常规',
},
{
value: 1,
label: '紧急',
},
{
value: 2,
label: '特级',
},
];
const institutionOptions = [
{
value: 0,
label: '常规',
},
{
value: 1,
label: '紧急',
},
{
value: 2,
label: '特级',
},
];
const faultSubcategoryOptions = [
{
value: 0,
label: '常规',
},
{
value: 1,
label: '紧急',
},
{
value: 2,
label: '特级',
},
];
const showModal = () => {
visible.value = true;
};
const handleOk = () => {
console.log('Form Data:', form);
//
visible.value = false;
};
return {
visible,
form,
showModal,
handleOk,
responseLevelOptions,
maintenanceRequirementOptions,
institutionOptions,
faultSubcategoryOptions,
};
},
};
</script>
<style scoped>
/* 可选样式调整 */
.ant-modal-body {
max-width: 600px;
margin: 0 auto;
}
</style>

28
src/views/IO/workOrder/orderAudit/index.vue

@ -1,16 +1,16 @@
<template>
<PageWrapper dense>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="showFaultModal">审核</a-button>
<a-button type="primary" @click="showDrawer">详情</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column && record && column.key === 'action'"> </template>
<template v-if="column && record && column.key === 'action'">
<a-button type="link" @click="showAuditModal(record.id)">审核</a-button>
<a-button type="link" @click="showDrawer(record.id)">">详情</a-button>
</template>
</template>
</BasicTable>
<faultModal ref="falutModalRef" />
<detailDrawer ref="detailDrawerRef" @open-modal="showFaultModal" />
<auditModal ref="auditModalRef" />
<detailDrawer ref="detailDrawerRef" />
</PageWrapper>
</template>
@ -19,7 +19,7 @@
import { BasicTable, useTable } from '@/components/Table';
import { list } from './api';
import { formSchemas, columns } from './data';
import faultModal from './faultModal.vue';
import auditModal from './auditModal.vue';
import detailDrawer from './detailDrawer.vue';
import { ref } from 'vue';
@ -34,7 +34,7 @@
useSearchForm: true,
formConfig: {
schemas: formSchemas,
name: 'patroling',
name: 'orderAudit',
baseColProps: {
xs: 24,
sm: 24,
@ -51,14 +51,14 @@
},
});
//
const falutModalRef = ref();
const showFaultModal = () => {
falutModalRef.value.showModal();
const auditModalRef = ref();
const showAuditModal = (id:any) => {
auditModalRef.value.showModal(id);
};
//
const detailDrawerRef = ref();
const showDrawer = () => {
detailDrawerRef.value.showDrawer();
const showDrawer = (id:any) => {
detailDrawerRef.value.showDrawer(id);
};
//
</script>

93
src/views/IO/workOrder/orderSearch/data.ts

@ -3,16 +3,13 @@ import { FormSchema } from '@/components/Form';
//列表展示
const responseLevelOptions = [
{
value: 0,
label: '常规',
value: '常规',
},
{
value: 1,
label: '紧急',
value: '紧急',
},
{
value: 2,
label: '特级',
value: '特级',
},
];
export const formSchemas: FormSchema[] = [
@ -22,18 +19,6 @@ export const formSchemas: FormSchema[] = [
component: 'Select',
componentProps: {
options: [
{
value: '1',
label: '2323',
},
{
value: '2',
label: '2323',
},
{
value: '3',
label: '2323',
},
],
},
},
@ -62,9 +47,6 @@ export const formSchemas: FormSchema[] = [
label: '地址',
field: 'location',
component: 'Input',
componentProps: {
placeholder: '输入天数',
},
},
{
field: 'status',
@ -73,37 +55,12 @@ export const formSchemas: FormSchema[] = [
componentProps: {
options: [
{
value: '1',
label: '2323',
},
{
value: '2',
label: '2323',
value: '0',
label: '启用',
},
{
value: '3',
label: '2323',
},
],
},
},
{
field: 'faultCategory',
label: '故障大类',
component: 'Select',
componentProps: {
options: [
{
value: '1',
label: '2323',
},
{
value: '2',
label: '2323',
},
{
value: '3',
label: '2323',
label: '禁用',
},
],
},
@ -114,39 +71,6 @@ export const formSchemas: FormSchema[] = [
component: 'Select',
componentProps: {
options: [
{
value: '1',
label: '2323',
},
{
value: '2',
label: '2323',
},
{
value: '3',
label: '2323',
},
],
},
},
{
field: 'institution',
label: '所属机构',
component: 'Select',
componentProps: {
options: [
{
value: '1',
label: '2323',
},
{
value: '2',
label: '2323',
},
{
value: '3',
label: '2323',
},
],
},
},
@ -164,11 +88,6 @@ export const columns: BasicColumn[] = [
{
title: '响应级别',
dataIndex: 'responseLevel',
customRender({ text }) {
return responseLevelOptions.find((i) => {
return i.value == text;
})?.label;
},
},
{
title: '故障描述',

46
src/views/IO/workOrder/orderSearch/detailDrawer.vue

@ -81,6 +81,11 @@
<div><span class="titleLabel">故障图片</span>{{ detail.faultImg }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div id="orderSearchDetailMap" style="width: 100%; height: 500px"></div>
</a-col>
</a-row>
</a-tab-pane>
<a-tab-pane key="2" tab="处理信息" force-render>
<a-row :gutter="[16, 16]">
@ -165,7 +170,7 @@
<script>
import { reactive, ref } from 'vue';
import { getInfo } from './api';
import AMapLoader from '@amap/amap-jsapi-loader';
export default {
setup(props, { emit }) {
//
@ -191,6 +196,8 @@
fixResult: '',
cost: '',
handleImg: '',
longitude:'',
latitude:''
});
const historyInfo = ref([]);
const historyColumns = [
@ -242,29 +249,54 @@
//
const visible = ref(false);
const showDrawer = async (id) => {
visible.value = true;
const data = await getInfo(id);
for (let i in detail) {
detail[i] = data[i];
}
visible.value = true;
console.log(detail);
initMap(detail.longitude,detail.latitude,detail.faultLocation)
};
//
const onClose = () => {
visible.value = false;
map.value?.destroy()
};
const activeKey = ref('1');
const openModal = () => {
emit('openModal');
};
//
const map = ref(null);
const initMap = async (longitude, latitude, organizationName) => {
try {
// JavaScript API
await AMapLoader.load({
key: '786a2e7cc6d4be5ba1d6174a0aa10f2b',
version: '2.0',
plugins: [],
});
//
map.value = new AMap.Map('orderSearchDetailMap', {
zoom: 17,
center: [longitude, latitude],
});
//
const marker = new AMap.Marker({
position: new AMap.LngLat(longitude, latitude),
title: organizationName,
});
const markerList = [marker];
map.value.add(markerList);
} catch (error) {
console.error('加载高德地图失败:', error);
}
};
return {
visible,
showDrawer,
onClose,
activeKey,
openModal,
historyInfo,
historyColumns,
delayInfo,

68
src/views/IO/workOrder/orderSearch/faultModal.vue

@ -39,8 +39,8 @@
<a-col :span="12">
<a-form-item label="是否事故" name="isAccident">
<a-radio-group v-model:value="form.isAccident">
<a-radio :value="1"></a-radio>
<a-radio :value="0"></a-radio>
<a-radio value="是"></a-radio>
<a-radio value="否"></a-radio>
</a-radio-group>
</a-form-item>
</a-col>
@ -78,7 +78,7 @@
:options="faultSubcategoryOptions"
:fieldNames="{
label: 'typeName',
value: 'id',
value: 'typeName',
options: 'options',
}"
/>
@ -105,13 +105,18 @@
v-model:value="form.faultLocation"
:options="faultLocationOptions"
@change="faultLocationChange"
:fieldNames="{
label: 'pointName',
value: 'pointName',
options: 'options',
}"
/>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div id="amapContainer" style="width: 100%; height: 500px"></div>
<div id="orderSearchMap" style="width: 100%; height: 500px"></div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
@ -132,15 +137,15 @@
>
<a-button type="primary"> 上传 </a-button>
</a-upload>
</a-form-item>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-form-item label="是否派遣" name="isDispatched">
<a-radio-group v-model:value="form.isDispatched">
<a-radio :value="1"></a-radio>
<a-radio :value="0"></a-radio>
<a-radio value="是"></a-radio>
<a-radio value="否"></a-radio>
</a-radio-group>
</a-form-item>
</a-col>
@ -178,6 +183,7 @@
import AMapLoader from '@amap/amap-jsapi-loader';
import { getToken } from '@/utils/auth';
import { useGlobSetting } from '@/hooks/setting';
import {queryPointNames} from '@/api/common/index'
export default {
setup() {
const visible = ref(false);
@ -218,51 +224,44 @@
};
const responseLevelOptions = [
{
value: 0,
label: '常规',
value: '常规',
},
{
value: 1,
label: '紧急',
value: '紧急',
},
{
value: 2,
label: '特级',
value: '特级',
},
];
const maintenanceRequirementOptions = [
{
value: 1,
label: '新增',
value: '修复',
},
{
value: '新增',
},
];
const faultLocationOptions = [
{
value: '1',
label: 'a',
latitude: '29.8537459',
longitude: '121.5591519',
value: '拆除',
},
{
value: '2',
label: 'b',
latitude: '29.8572957 ',
longitude: '121.5611743',
value: '清除',
},
{
value: '3',
label: 'c',
latitude: '29.8537459',
longitude: '121.5591519',
value: '其他',
},
];
const faultLocationOptions = ref([])
const getFaultLocationOptions = async() =>{
const res = await queryPointNames()
faultLocationOptions.value = res
}
const faultLocationChange = (val) => {
const obj = faultLocationOptions.find((i) => {
return (i.value = val);
const obj = faultLocationOptions.value.find((i) => {
return (i.pointName = val);
});
form.longitude = obj.longitude;
form.latitude = obj.latitude;
initMap(obj.longitude, obj.latitude, obj.organizationName);
initMap(obj.longitude, obj.latitude, obj.pointName);
};
const faultSubcategoryOptions = ref([]);
const getFaultSubcategoryOptions = async () => {
@ -274,6 +273,7 @@
getFaultSubcategoryOptions();
getProjectNameOptions();
getOrganizationNameOptions();
getFaultLocationOptions()
};
const handleOk = () => {
@ -302,7 +302,7 @@
});
//
map.value = new AMap.Map('amapContainer', {
map.value = new AMap.Map('orderSearchMap', {
zoom: 17,
center: [longitude, latitude],
});
@ -320,7 +320,7 @@
};
const closeModal = () => {
formRef.value.resetFields();
fileLists.value=[]
fileLists.value = [];
visible.value = false;
map.value?.destroy();
};

29
src/views/IO/workOrder/orderSearch/index.vue

@ -18,7 +18,7 @@
<script setup lang="ts">
import { PageWrapper } from '@/components/Page';
import { BasicTable, useTable } from '@/components/Table';
import { list } from './api';
import { list, getProjectInfo,getSubcategoryType } from './api';
import { formSchemas, columns } from './data';
import faultModal from './faultModal.vue';
import detailDrawer from './detailDrawer.vue';
@ -35,7 +35,7 @@
useSearchForm: true,
formConfig: {
schemas: formSchemas,
name: 'patroling',
name: 'orderSearch',
baseColProps: {
xs: 24,
sm: 24,
@ -61,6 +61,31 @@
const showDrawer = (id: any) => {
detailDrawerRef.value.showDrawer(id);
};
const projectOptions = ref([]);
const getProjectOptions = async () => {
const res = await getProjectInfo();
res.forEach((i: any) => {
i.value = i.projectName;
i.label = i.projectName;
});
projectOptions.value = res;
formSchemas[0].componentProps.options = projectOptions.value;
};
const faultSubcategoryOptions = ref([]);
const getFaultSubcategoryOptions = async () => {
const res = await getSubcategoryType();
faultSubcategoryOptions.value = res.rows;
faultSubcategoryOptions.value.forEach((i: any) => {
i.value = i.typeName;
i.label = i.typeName;
});
formSchemas[6].componentProps.options = projectOptions.value;
};
const getOptions = () => {
getProjectOptions();
getFaultSubcategoryOptions()
};
getOptions();
//
</script>

14
src/views/IO/workOrder/orderSend/data.ts

@ -48,16 +48,13 @@ export const formSchemas: FormSchema[] = [
//列表展示
const responseLevelOptions = [
{
value: 0,
label: '常规',
value: '常规',
},
{
value: 1,
label: '紧急',
value: '紧急',
},
{
value: 2,
label: '特级',
value: '特级',
},
];
export const columns: BasicColumn[] = [
@ -72,11 +69,6 @@ export const columns: BasicColumn[] = [
{
title: '响应级别',
dataIndex: 'responseLevel',
customRender({ text }) {
return responseLevelOptions.find((i) => {
return i.value == text;
})?.label;
},
},
{
title: '故障描述',

46
src/views/IO/workOrder/orderSend/detailDrawer.vue

@ -81,6 +81,11 @@
<div><span class="titleLabel">故障图片</span>{{ detail.faultImg }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div id="orderSendDetailMap" style="width: 100%; height: 500px"></div>
</a-col>
</a-row>
</a-tab-pane>
<a-tab-pane key="2" tab="处理信息" force-render>
<a-row :gutter="[16, 16]">
@ -165,7 +170,7 @@
<script>
import { reactive, ref } from 'vue';
import { getInfo } from './api';
import AMapLoader from '@amap/amap-jsapi-loader';
export default {
setup(props, { emit }) {
//
@ -191,6 +196,8 @@
fixResult: '',
cost: '',
handleImg: '',
longitude:'',
latitude:''
});
const historyInfo = ref([]);
const historyColumns = [
@ -242,29 +249,54 @@
//
const visible = ref(false);
const showDrawer = async (id) => {
visible.value = true;
const data = await getInfo(id);
for (let i in detail) {
detail[i] = data[i];
}
visible.value = true;
console.log(detail);
initMap(detail.longitude,detail.latitude,detail.faultLocation)
};
//
const onClose = () => {
visible.value = false;
map.value?.destroy()
};
const activeKey = ref('1');
const openModal = () => {
emit('openModal');
};
//
const map = ref(null);
const initMap = async (longitude, latitude, organizationName) => {
try {
// JavaScript API
await AMapLoader.load({
key: '786a2e7cc6d4be5ba1d6174a0aa10f2b',
version: '2.0',
plugins: [],
});
//
map.value = new AMap.Map('orderSendDetailMap', {
zoom: 17,
center: [longitude, latitude],
});
//
const marker = new AMap.Marker({
position: new AMap.LngLat(longitude, latitude),
title: organizationName,
});
const markerList = [marker];
map.value.add(markerList);
} catch (error) {
console.error('加载高德地图失败:', error);
}
};
return {
visible,
showDrawer,
onClose,
activeKey,
openModal,
historyInfo,
historyColumns,
delayInfo,

68
src/views/IO/workOrder/orderSend/faultModal.vue

@ -39,8 +39,8 @@
<a-col :span="12">
<a-form-item label="是否事故" name="isAccident">
<a-radio-group v-model:value="form.isAccident">
<a-radio :value="1"></a-radio>
<a-radio :value="0"></a-radio>
<a-radio value="是"></a-radio>
<a-radio value="否"></a-radio>
</a-radio-group>
</a-form-item>
</a-col>
@ -78,7 +78,7 @@
:options="faultSubcategoryOptions"
:fieldNames="{
label: 'typeName',
value: 'id',
value: 'typeName',
options: 'options',
}"
/>
@ -105,13 +105,18 @@
v-model:value="form.faultLocation"
:options="faultLocationOptions"
@change="faultLocationChange"
:fieldNames="{
label: 'pointName',
value: 'pointName',
options: 'options',
}"
/>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div id="amapContainer" style="width: 100%; height: 500px"></div>
<div id="orderSendMap" style="width: 100%; height: 500px"></div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
@ -132,15 +137,15 @@
>
<a-button type="primary"> 上传 </a-button>
</a-upload>
</a-form-item>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-form-item label="是否派遣" name="isDispatched">
<a-radio-group v-model:value="form.isDispatched">
<a-radio :value="1"></a-radio>
<a-radio :value="0"></a-radio>
<a-radio value="是"></a-radio>
<a-radio value="否"></a-radio>
</a-radio-group>
</a-form-item>
</a-col>
@ -178,6 +183,7 @@
import AMapLoader from '@amap/amap-jsapi-loader';
import { getToken } from '@/utils/auth';
import { useGlobSetting } from '@/hooks/setting';
import {queryPointNames} from '@/api/common/index'
export default {
setup() {
const visible = ref(false);
@ -218,51 +224,44 @@
};
const responseLevelOptions = [
{
value: 0,
label: '常规',
value: '常规',
},
{
value: 1,
label: '紧急',
value: '紧急',
},
{
value: 2,
label: '特级',
value: '特级',
},
];
const maintenanceRequirementOptions = [
{
value: 1,
label: '新增',
value: '修复',
},
{
value: '新增',
},
];
const faultLocationOptions = [
{
value: '1',
label: 'a',
latitude: '29.8537459',
longitude: '121.5591519',
value: '拆除',
},
{
value: '2',
label: 'b',
latitude: '29.8572957 ',
longitude: '121.5611743',
value: '清除',
},
{
value: '3',
label: 'c',
latitude: '29.8537459',
longitude: '121.5591519',
value: '其他',
},
];
const faultLocationOptions = ref([])
const getFaultLocationOptions = async() =>{
const res = await queryPointNames()
faultLocationOptions.value = res
}
const faultLocationChange = (val) => {
const obj = faultLocationOptions.find((i) => {
return (i.value = val);
const obj = faultLocationOptions.value.find((i) => {
return (i.pointName = val);
});
form.longitude = obj.longitude;
form.latitude = obj.latitude;
initMap(obj.longitude, obj.latitude, obj.organizationName);
initMap(obj.longitude, obj.latitude, obj.pointName);
};
const faultSubcategoryOptions = ref([]);
const getFaultSubcategoryOptions = async () => {
@ -274,6 +273,7 @@
getFaultSubcategoryOptions();
getProjectNameOptions();
getOrganizationNameOptions();
getFaultLocationOptions()
};
const handleOk = () => {
@ -302,7 +302,7 @@
});
//
map.value = new AMap.Map('amapContainer', {
map.value = new AMap.Map('orderSendMap', {
zoom: 17,
center: [longitude, latitude],
});
@ -320,7 +320,7 @@
};
const closeModal = () => {
formRef.value.resetFields();
fileLists.value=[]
fileLists.value = [];
visible.value = false;
map.value?.destroy();
};

28
src/views/IO/workOrder/orderSend/index.vue

@ -6,22 +6,25 @@
</template>
<template #bodyCell="{ column, record }">
<template v-if="column && record && column.key === 'action'">
<a-button type="link" @click="showSendModal(record.id)">派遣</a-button>
<a-button type="link" @click="showDrawer(record.id)">详情</a-button>
</template>
</template>
</BasicTable>
<faultModal ref="faultModalRef" />
<detailDrawer ref="detailDrawerRef" @open-modal="showFaultModal" />
<detailDrawer ref="detailDrawerRef" />
<sendModal ref="sendModalRef"/>
</PageWrapper>
</template>
<script setup lang="ts">
import { PageWrapper } from '@/components/Page';
import { BasicTable, useTable } from '@/components/Table';
import { list } from './api';
import { list,getProjectInfo} from './api';
import { formSchemas, columns } from './data';
import faultModal from './faultModal.vue';
import detailDrawer from './detailDrawer.vue';
import sendModal from './sendModal.vue';
import { ref } from 'vue';
const [registerTable] = useTable({
@ -35,7 +38,7 @@
useSearchForm: true,
formConfig: {
schemas: formSchemas,
name: 'patroling',
name: 'orderSend',
baseColProps: {
xs: 24,
sm: 24,
@ -56,12 +59,29 @@
const showFaultModal = () => {
faultModalRef.value.showModal();
};
const sendModalRef = ref()
const showSendModal = (id:any) => {
sendModalRef.value.showModal(id);
};
//
const detailDrawerRef = ref();
const showDrawer = (id: any) => {
detailDrawerRef.value.showDrawer(id);
};
const projectOptions = ref([]);
const getProjectOptions = async () => {
const res = await getProjectInfo();
res.forEach((i: any) => {
i.value = i.projectName;
i.label = i.projectName;
});
projectOptions.value = res;
formSchemas[0].componentProps.options = projectOptions.value;
};
const getOptions = () => {
getProjectOptions();
};
getOptions();
//
</script>

148
src/views/IO/workOrder/orderSend/sendModal.vue

@ -0,0 +1,148 @@
<template>
<a-modal v-model:open="visible" :title="title" @ok="handleOk" width="50%" @cancel="closeModal">
<a-form :model="form" layout="vertical" ref="formRef" :rules="rules">
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="所属项目" name="projectName">
<a-input v-model:value="form.projectName" disabled />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="所属合同" name="contractName">
<a-input v-model:value="form.contractName" disabled />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="操作处理" name="handle">
<a-select v-model:value="form.handle" :options="handleOptions" placeholder="请选择" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="维护要求" name="maintenanceRequirement">
<a-select
v-model:value="form.maintenanceRequirement"
:options="maintenanceRequirementOptions"
placeholder="请选择"
/>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="维护单位" name="maintenanceUnit">
<a-input v-model:value="form.maintenanceUnit" placeholder="请输入" disbaled />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="派遣意见" name="dispatchOpinion">
<a-textarea v-model:value="form.dispatchOpinion" :rows="4" placeholder="请输入" />
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-modal>
</template>
<script>
import { reactive, ref } from 'vue';
import { message } from 'ant-design-vue';
import { getInfo } from './api';
export default {
setup() {
const title = ref('派遣');
const visible = ref(false);
const form = reactive({
projectName: '',
contractName: '',
handle: null,
maintenanceRequirement: null,
maintenanceUnit: '',
dispatchOpinion: '',
id: null,
});
//
const maintenanceRequirementOptions = [
{
value: '修复',
},
{
value: '新增',
},
{
value: '拆除',
},
{
value: '清除',
},
{
value: '其他',
},
];
const handleOptions = [
{
value: '事件派遣',
},
{
value: '事件转派',
},
{
value: '事件作废',
},
];
const showModal = async (id) => {
visible.value = true;
const data = await getInfo(id);
for (let i in form) {
form[i] = data[i];
}
};
const handleOk = () => {
formRef.value.validate().then((valid) => {
if (valid) {
console.log(form)
}
});
};
const closeModal = () => {
formRef.value.resetFields();
visible.value = false;
};
const formRef = ref();
const rules = {
maintenanceRequirement: [{ required: true, message: '请选择' }],
handle: [{ required: true, message: '请选择' }],
dispatchOpinion: [{ required: true, message: '请输入' }],
maintenanceUnit: [{ required: true, message: '请输入' }],
};
return {
visible,
title,
form,
maintenanceRequirementOptions,
handleOptions,
showModal,
handleOk,
closeModal,
formRef,
rules,
};
},
};
</script>
<style scoped>
/* 可选样式调整 */
.ant-modal-body {
max-width: 600px;
margin: 0 auto;
}
</style>

12
src/views/analysis/type/data.ts

@ -34,18 +34,6 @@ export const formSchemas: FormSchema[] = [
component: 'Select',
componentProps: {
options: [
{
value: '1',
label: '2323',
},
{
value: '2',
label: '2323',
},
{
value: '3',
label: '2323',
},
],
},
},

108
src/views/property/point/addModal.vue

@ -1,5 +1,5 @@
<template>
<a-modal v-model:open="visible" :title="title" @ok="handleOk" width="50%">
<a-modal v-model:open="visible" :title="title" @ok="handleOk" width="50%" @cancel="closeModal">
<a-form :model="form" layout="vertical" ref="formRef" :rules="rules">
<a-row :gutter="[16, 16]">
<a-col :span="24">
@ -53,6 +53,11 @@
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div id="container" style="width: 100%; height: 500px" v-show="form.address"></div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="备注" name="remark">
@ -67,53 +72,52 @@
<script>
import { reactive, ref } from 'vue';
import { message } from 'ant-design-vue';
import {
getInfo,
add,
update,
getProjectInfo,
getOrganizationType
} from './api';
import AMapLoader from '@amap/amap-jsapi-loader';
import { getInfo, add, update, getProjectInfo, getOrganizationType } from './api';
export default {
setup() {
const title = ref('新增');
const visible = ref(false);
const form = reactive({
projectName: '',
organizationName: '',
projectName: null,
organizationName: null,
remark: '',
maintenanceUnit: '',
address: '',
longitude: '',
latitude: '',
pointName: '',
id:null
id: null,
});
//
//
const projectNameOptions = ref([])
const getProjectNameOptions= async () =>{
const projectNameOptions = ref([]);
const getProjectNameOptions = async () => {
const res = await getProjectInfo();
projectNameOptions.value = res
}
const organizationNameOptions = ref([])
const getOrganizationNameOptions= async () =>{
projectNameOptions.value = res;
};
const organizationNameOptions = ref([]);
const getOrganizationNameOptions = async () => {
const res = await getOrganizationType();
organizationNameOptions.value = res.rows
}
const showModal = async(type, id,projectId) => {
console.log(projectId)
organizationNameOptions.value = res.rows;
};
const showModal = async (type, id, projectId) => {
console.log(projectId);
visible.value = true;
if (type == 1) {
title.value = '新增';
initMap();
} else if (type == 2) {
title.value = '编辑';
const data = await getInfo(id);
for (let i in form) {
form[i] = data[i];
}
initMap();
}
form.projectId = projectId
getProjectNameOptions()
getOrganizationNameOptions()
form.projectId = projectId;
getProjectNameOptions();
getOrganizationNameOptions();
};
const handleOk = () => {
@ -124,7 +128,7 @@
for (let i in form) {
params[i] = form[i];
}
delete params.id
delete params.id;
add(params).then((_) => {
message.success('新增成功');
visible.value = false;
@ -146,8 +150,8 @@
formRef.value.resetFields();
visible.value = false;
};
const formRef = ref()
const rules = {
const formRef = ref();
const rules = {
projectName: [{ required: true, message: '请选择' }],
organizationName: [{ required: true, message: '请选择' }],
remark: [{ required: true, message: '请输入' }],
@ -155,6 +159,54 @@
address: [{ required: true, message: '请输入' }],
pointName: [{ required: true, message: '请输入' }],
};
//
const map = ref(null);
const currentMarker = ref(null);
const initMap = async () => {
try {
// JavaScript API
await AMapLoader.load({
key: '786a2e7cc6d4be5ba1d6174a0aa10f2b',
version: '2.0',
plugins: [],
});
//
map.value = new AMap.Map('container', {
zoom: 17,
center: form.longitude?[form.longitude, form.latitude]:['121.5645431', '29.8596452'],
});
//
if (title.value == '编辑') {
currentMarker.value = new AMap.Marker({
position: new AMap.LngLat(form.longitude, form.latitude),
title: form.address,
});
map.value.add(currentMarker.value);
}
map.value.on('click', (e) => {
if (currentMarker.value) {
map.value.remove(currentMarker.value);
currentMarker.value = null;
form.longitude = ''
form.latitude = ''
} else {
currentMarker.value = new AMap.Marker({
position: [e.lnglat.getLng(), e.lnglat.getLat()], //
title: form.address ,
});
form.longitude = e.lnglat.getLng()
form.latitude = e.lnglat.getLat()
//
map.value.add(currentMarker.value);
}
console.log(form)
});
} catch (error) {
console.error('加载高德地图失败:', error);
}
};
return {
visible,
title,
@ -165,7 +217,7 @@
organizationNameOptions,
closeModal,
formRef,
rules
rules,
};
},
};

3
src/views/property/point/index.vue

@ -60,9 +60,6 @@
defineOptions({ name: 'Point' });
const [registerTable, { reload }] = useTable({
rowSelection: {
type: 'checkbox',
},
title: '点位信息',
api: list,
showIndexColumn: true,

30
src/views/property/point/pointModal.vue

@ -68,7 +68,7 @@
:options="faultSubcategoryOptions"
:fieldNames="{
label: 'typeName',
value: 'id',
value: 'typeName',
options: 'options',
}"
/>
@ -89,7 +89,7 @@
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div id="amapContainer" style="width: 100%; height: 500px"></div>
<div id="pointContainer" style="width: 100%; height: 500px"></div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
@ -174,22 +174,30 @@
//
const responseLevelOptions = [
{
value: 0,
label: '常规',
value: '常规',
},
{
value: 1,
label: '紧急',
value: '紧急',
},
{
value: 2,
label: '特级',
value: '特级',
},
];
const maintenanceRequirementOptions = [
{
value: '修复',
},
{
value: '新增',
},
{
value: '拆除',
},
{
value: '清除',
},
{
value: 1,
label: '新增',
value: '其他',
},
];
const faultSubcategoryOptions = ref([]);
@ -237,7 +245,7 @@
});
//
map.value = new AMap.Map('amapContainer', {
map.value = new AMap.Map('pointContainer', {
zoom: 17,
center: [longitude, latitude],
});

Loading…
Cancel
Save