Browse Source

手动生成

ops-management-platform-frontend-dev
wbc 2 months ago
parent
commit
ddabb51bbe
  1. 2
      .env
  2. 4
      src/locales/lang/zh-CN/sys.json
  3. 62
      src/views/IO/delayPatrol/waitAudit/api.ts
  4. 59
      src/views/IO/delayPatrol/waitAudit/data.ts
  5. 54
      src/views/IO/delayPatrol/waitAudit/detailDrawer.vue
  6. 291
      src/views/IO/delayPatrol/waitAudit/faultModal.vue
  7. 135
      src/views/IO/delayPatrol/waitAudit/index.vue
  8. 63
      src/views/IO/delayPatrol/waitPatrol/api.ts
  9. 106
      src/views/IO/delayPatrol/waitPatrol/data.ts
  10. 56
      src/views/IO/delayPatrol/waitPatrol/detailDrawer.vue
  11. 291
      src/views/IO/delayPatrol/waitPatrol/faultModal.vue
  12. 11
      src/views/IO/delayPatrol/waitPatrol/index.vue
  13. 2
      src/views/IO/patrol/allPatrol/index.vue
  14. 108
      src/views/IO/patrol/patroling/addModal.vue
  15. 10
      src/views/IO/patrol/patroling/api.ts
  16. 25
      src/views/IO/patrol/patroling/data.ts
  17. 51
      src/views/IO/patrol/patroling/detailDrawer.vue
  18. 8
      src/views/IO/patrol/patroling/index.vue
  19. 2
      src/views/IO/patrolReport/index.vue
  20. 15
      src/views/project/contractManage/api.ts
  21. 54
      src/views/project/contractManage/index.vue
  22. 181
      src/views/project/serviceManage/addModal.vue
  23. 23
      src/views/project/serviceManage/api.ts
  24. 27
      src/views/project/serviceManage/index.vue
  25. 8
      src/views/property/point/pointModal.vue

2
.env

@ -1,2 +1,2 @@
# spa-title # spa-title
VITE_GLOB_APP_TITLE = Plus Admin VITE_GLOB_APP_TITLE = '国研数字化运维管理平台'

4
src/locales/lang/zh-CN/sys.json

@ -65,8 +65,8 @@
"qrSignInFormTitle": "二维码登录", "qrSignInFormTitle": "二维码登录",
"signUpFormTitle": "注册", "signUpFormTitle": "注册",
"forgetFormTitle": "重置密码", "forgetFormTitle": "重置密码",
"signInTitle": "开箱即用的中后台管理系统", "signInTitle": "国研数字化运维管理平台",
"signInDesc": "输入您的个人详细信息开始使用!", "signInDesc": "",
"policy": "我同意xxx隐私政策", "policy": "我同意xxx隐私政策",
"scanSign": "扫码后点击\"确认\",即可完成登录", "scanSign": "扫码后点击\"确认\",即可完成登录",
"loginButton": "登录", "loginButton": "登录",

62
src/views/IO/delayPatrol/waitAudit/api.ts

@ -1,58 +1,40 @@
import { ID, IDS, PageQuery, commonExport } from '@/api/base';
import { defHttp } from '@/utils/http/axios'; import { defHttp } from '@/utils/http/axios';
import { Dayjs } from 'dayjs';
enum Api { enum Api {
root = '/workflow/leave', root = '/platform/routineInspectionInfo',
list = '/workflow/leave/list', list = '/platform/routineInspectionInfo/specialList',
export = '/workflow/leave/export', getSubcategoryType = '/platform/subcategoryType/list',
workOrderAdd = '/platform/workOrder/add',
getProjectInfo = '/platform/projectInfo/getNames',
} }
export interface Leave { export function list(params:any) {
id: string; return defHttp.get({ url: Api.list, params });
leaveType: string;
startDate: string;
endDate: string;
leaveDays: number;
remark: string;
processInstanceVo?: any;
dateTime?: [string, string] | [Dayjs, Dayjs];
} }
export interface Resp {
createDept: number;
createBy: number;
createTime: string;
updateBy: number;
updateTime: string;
id: string;
leaveType: string;
startDate: string;
endDate: string;
leaveDays: number;
remark?: any;
}
export function list(params?: PageQuery) { export function getInfo(id: any) {
return defHttp.get<Leave[]>({ url: Api.list, params }); return defHttp.get({ url: `${Api.root}/${id}` });
} }
export function exportExcel(data: any) { export function add(data: any) {
return commonExport(Api.export, data); return defHttp.post({ url: Api.root, data });
} }
export function getInfo(id: ID) { export function update(data: any) {
return defHttp.get<Leave>({ url: `${Api.root}/${id}` }); return defHttp.put({ url: Api.root, data });
} }
export function add(data: any) { export function removeByIds(ids: any) {
return defHttp.post<Resp>({ url: Api.root, data }); return defHttp.deleteWithMsg({ url: `${Api.root}/${ids.join(',')}` });
} }
export function update(data: any) { export function getSubcategoryType() {
return defHttp.put<Resp>({ url: Api.root, data }); return defHttp.get({ url: Api.getSubcategoryType });
} }
export function workOrderAdd(data: any) {
export function removeByIds(ids: IDS) { return defHttp.post({ url: Api.workOrderAdd, data });
return defHttp.deleteWithMsg<void>({ url: `${Api.root}/${ids.join(',')}` }); }
export function getProjectInfo() {
return defHttp.get({ url: Api.getProjectInfo });
} }

59
src/views/IO/delayPatrol/waitAudit/data.ts

@ -3,58 +3,29 @@ import { FormSchema } from '@/components/Form';
export const formSchemas: FormSchema[] = [ export const formSchemas: FormSchema[] = [
{ {
field: 'projectName', field: 'plaDate',
label: '项目名称', label: '计划日期',
component: 'Select', component: 'RangePicker',
componentProps: {
options: [
{
value: '1',
label: '2323',
},
{
value: '2',
label: '2323',
},
{
value: '3',
label: '2323',
},
],
},
}, },
{ {
field: 'ioCompany', field: 'deliverContent',
label: '运维单位', label: '交付内容',
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options: [ options:[
{ {
value: '1', value: '例行操作',
label: '2323',
}, },
{ {
value: '2', value: '调研评估',
label: '2323',
}, },
{ {
value: '3', value: '响应支持服务',
label: '2323',
}, },
], {
}, value: '优化改善',
}, },
{ ]
field: 'plaDate',
label: '计划日期',
component: 'RangePicker',
},
{
field: 'deliverContent',
label: '交付内容',
component: 'Input',
componentProps: {
placeholder: '请输入',
}, },
}, },
{ {
@ -106,11 +77,11 @@ export const columns: BasicColumn[] = [
}, },
{ {
title: '开始日期', title: '开始日期',
dataIndex: 'startDate', dataIndex: 'scheduleStartDate',
}, },
{ {
title: '结束日期', title: '结束日期',
dataIndex: 'endDate', dataIndex: 'scheduleEndDate',
}, },
{ {
title: '状态', title: '状态',

54
src/views/IO/delayPatrol/waitAudit/detailDrawer.vue

@ -11,24 +11,6 @@
> >
<a-tabs v-model:activeKey="activeKey"> <a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="1" tab="详细信息"> <a-tab-pane key="1" tab="详细信息">
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div><span class="titleLabel">所属项目</span>{{ detail.projectName }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div><span class="titleLabel">所属合同</span>{{ detail.contractName }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<div><span class="titleLabel">开始日期</span>{{ detail.startDate }}</div>
</a-col>
<a-col :span="12">
<div><span class="titleLabel">结束日期</span>{{ detail.endDate }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="24"> <a-col :span="24">
<div><span class="titleLabel">巡检部位</span>{{ detail.inspectionPart }}</div> <div><span class="titleLabel">巡检部位</span>{{ detail.inspectionPart }}</div>
@ -55,33 +37,6 @@
</a-col> </a-col>
</a-row> </a-row>
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="2" tab="处理信息">
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div><span class="titleLabel">是否异常</span>{{ detail.isUnusual }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div><span class="titleLabel">处理结果</span>{{ detail.handleResult }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div><span class="titleLabel">描述</span>{{ detail.description }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div><span class="titleLabel">处理前图片</span>{{ detail.beforeHandleImg }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div><span class="titleLabel">处理后图片</span>{{ detail.AfterHandleImg }}</div>
</a-col>
</a-row>
</a-tab-pane>
</a-tabs> </a-tabs>
</a-drawer> </a-drawer>
</div> </div>
@ -94,20 +49,11 @@
setup() { setup() {
// //
let detail = reactive({ let detail = reactive({
projectName: '',
contractName: '',
startDate: '',
endDate: '',
inspectionPart: '', inspectionPart: '',
serviceContent: '', serviceContent: '',
code: '', code: '',
deliverContent: '', deliverContent: '',
serviceProject: '', serviceProject: '',
isUnusual: '',
handleResult: '',
description: '',
beforeHandleImg: '',
AfterHandleImg: '',
}); });
// //

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

@ -0,0 +1,291 @@
<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="请选择"
:fieldNames="{
label: 'projectName',
value: 'projectName',
options: 'options',
}"
/>
</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" />
</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" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="响应时限">
<a-input v-model:value="form.responseTime" />
</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: '前端' }, { value: '后端' }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="故障小类" name="faultSubcategory">
<a-select
v-model:value="form.faultSubcategory"
:options="faultSubcategoryOptions"
:fieldNames="{
label: 'typeName',
value: 'id',
options: 'options',
}"
/>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-form-item label="所属机构" name="organizationName">
<a-input v-model:value="form.organizationName" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="故障地点" name="faultLocation">
<a-select
v-model:value="form.faultLocation"
:options="faultLocationOptions"
@change="faultLocationChange"
/>
</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>
</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" />
</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"
/>
</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" />
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-modal>
</template>
<script>
import { reactive, ref } from 'vue';
import { getInfo, getSubcategoryType, workOrderAdd,getProjectInfo } from './api';
import { message } from 'ant-design-vue';
import AMapLoader from '@amap/amap-jsapi-loader';
export default {
setup() {
const visible = ref(false);
const form = reactive({
projectName: '',
isAccident: null,
repairer: '',
responseTime: '',
responseLevel: '',
faultCategory: null,
faultSubcategory: null,
organizationName: '',
faultLocation: '',
faultDescription: '',
faultImg: null,
isDispatched: null,
maintenanceRequirement: null,
dispatchOpinion: '',
longitude: '',
latitude: '',
});
//
const projectNameOptions = ref([])
const getProjectNameOptions= async () =>{
const res = await getProjectInfo();
projectNameOptions.value = res
}
const responseLevelOptions = [
{
value: 0,
label: '常规',
},
{
value: 1,
label: '紧急',
},
{
value: 2,
label: '特级',
},
];
const maintenanceRequirementOptions = [
{
value: 1,
label: '新增',
},
];
const faultLocationOptions = [
{
value: '1',
label: 'a',
latitude: '29.8537459',
longitude: '121.5591519',
},
{
value: '2',
label: 'b',
latitude: '29.8572957 ',
longitude: '121.5611743',
},
{
value: '3',
label: 'c',
latitude: '29.8537459',
longitude: '121.5591519',
},
];
const faultLocationChange = (val) => {
const obj = faultLocationOptions.find((i) => {
return (i.value = val);
});
form.longitude = obj.longitude
form.latitude = obj.latitude
initMap(obj.longitude, obj.latitude, obj.organizationName);
};
const faultSubcategoryOptions = ref([]);
const getFaultSubcategoryOptions = async () => {
const res = await getSubcategoryType();
faultSubcategoryOptions.value = res.rows;
};
const showModal = () => {
visible.value = true;
getFaultSubcategoryOptions()
getProjectNameOptions()
};
const handleOk = () => {
let params = {};
for (let i in form) {
params[i] = form[i];
}
workOrderAdd(params).then((_) => {
message.success('操作成功');
visible.value = false;
});
};
//
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('amapContainer', {
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,
form,
showModal,
handleOk,
responseLevelOptions,
maintenanceRequirementOptions,
faultSubcategoryOptions,
faultLocationOptions,
projectNameOptions,
faultLocationChange
};
},
};
</script>
<style scoped>
/* 可选样式调整 */
.ant-modal-body {
max-width: 600px;
margin: 0 auto;
}
</style>

135
src/views/IO/delayPatrol/waitAudit/index.vue

@ -1,42 +1,17 @@
<template> <template>
<PageWrapper dense> <PageWrapper dense>
<a-row> <BasicTable @register="registerTable">
<a-col :span="4" style="margin-top: 1%"> <template #toolbar>
<a-tree <a-button type="primary" @click="handleReport">上报</a-button>
:show-line="true" </template>
:show-icon="true" <template #bodyCell="{ column, record }">
:default-expanded-keys="['0-0-0']" <template v-if="column && record && column.key === 'action'">
:tree-data="treeData" <a-button type="link" @click="handleDetail">详情</a-button>
@select="onSelect" </template>
> </template>
<template #icon><carry-out-outlined /></template> </BasicTable>
<template #title="{ dataRef }"> <detailDrawer ref="detailDrawerRef" />
<template v-if="dataRef.key === '0-0-0-1'"> <faultModal ref="faultModalRef" />
<div>multiple line title</div>
<div>multiple line title</div>
</template>
<template v-else>{{ dataRef.title }}</template>
</template>
<template #switcherIcon="{ dataRef, defaultIcon }">
<SmileTwoTone v-if="dataRef.key === '0-0-2'" />
<component :is="defaultIcon" v-else />
</template>
</a-tree>
</a-col>
<a-col :span="20">
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="handleDetail">上报</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column && record && column.key === 'action'">
<a-button type="link" @click="handleDetail">详情</a-button>
</template>
</template>
</BasicTable>
<detailDrawer ref="detailDrawerRef" />
</a-col>
</a-row>
</PageWrapper> </PageWrapper>
</template> </template>
@ -47,14 +22,14 @@
import { formSchemas, columns } from './data'; import { formSchemas, columns } from './data';
import detailDrawer from './detailDrawer.vue'; import detailDrawer from './detailDrawer.vue';
import { ref } from 'vue'; import { ref } from 'vue';
import faultModal from './faultModal.vue'
defineOptions({ name: 'waitAudit' });
defineOptions({ name: 'WaitAudit' }); const [registerTable] = useTable({
const [registerTable, { reload }] = useTable({
rowSelection: { rowSelection: {
type: 'checkbox', type: 'checkbox',
}, },
title: '待审核列表', title: '专项工作列表',
api: list, api: list,
showIndexColumn: true, showIndexColumn: true,
rowKey: 'id', rowKey: 'id',
@ -78,85 +53,15 @@
}, },
}); });
//tree
const treeData = ref([
{
title: 'parent 1',
key: '0-0',
children: [
{
title: 'parent 1-0',
key: '0-0-0',
children: [
{
title: 'leaf',
key: '0-0-0-0',
},
{
key: '0-0-0-1',
},
{
title: 'leaf',
key: '0-0-0-2',
},
],
},
{
title: 'parent 1-1',
key: '0-0-1',
children: [
{
title: 'leaf',
key: '0-0-1-0',
},
],
},
{
title: 'parent 1-2',
key: '0-0-2',
children: [
{
title: 'leaf 1',
key: '0-0-2-0',
},
{
title: 'leaf 2',
key: '0-0-2-1',
},
],
},
],
},
{
title: 'parent 2',
key: '0-1',
children: [
{
title: 'parent 2-0',
key: '0-1-0',
children: [
{
title: 'leaf',
key: '0-1-0-0',
},
{
title: 'leaf',
key: '0-1-0-1',
},
],
},
],
},
]);
const onSelect = (selectedKeys: any, info: any) => {
console.log('selected', selectedKeys, info);
reload();
};
// //
const detailDrawerRef = ref(); const detailDrawerRef = ref();
const handleDetail = () => { const handleDetail = () => {
detailDrawerRef.value.showDrawer(); detailDrawerRef.value.showDrawer();
}; };
const faultModalRef = ref();
const handleReport = () =>{
faultModalRef.value.showModal()
}
</script> </script>
<style scoped></style> <style scoped></style>

63
src/views/IO/delayPatrol/waitPatrol/api.ts

@ -1,58 +1,39 @@
import { ID, IDS, PageQuery, commonExport } from '@/api/base';
import { defHttp } from '@/utils/http/axios'; import { defHttp } from '@/utils/http/axios';
import { Dayjs } from 'dayjs';
enum Api { enum Api {
root = '/workflow/leave', root = '/platform/routineInspectionInfo',
list = '/workflow/leave/list', list = '/platform/routineInspectionInfo/list',
export = '/workflow/leave/export', getSubcategoryType = '/platform/subcategoryType/list',
workOrderAdd = '/platform/workOrder/add',
getProjectInfo = '/platform/projectInfo/getNames',
} }
export interface Leave { export function list(params:any) {
id: string; return defHttp.get({ url: Api.list, params });
leaveType: string;
startDate: string;
endDate: string;
leaveDays: number;
remark: string;
processInstanceVo?: any;
dateTime?: [string, string] | [Dayjs, Dayjs];
} }
export interface Resp {
createDept: number;
createBy: number;
createTime: string;
updateBy: number;
updateTime: string;
id: string;
leaveType: string;
startDate: string;
endDate: string;
leaveDays: number;
remark?: any;
}
export function list(params?: PageQuery) {
return defHttp.get<Leave[]>({ url: Api.list, params });
}
export function exportExcel(data: any) {
return commonExport(Api.export, data);
}
export function getInfo(id: ID) { export function getInfo(id: any) {
return defHttp.get<Leave>({ url: `${Api.root}/${id}` }); return defHttp.get({ url: `${Api.root}/${id}` });
} }
export function add(data: any) { export function add(data: any) {
return defHttp.post<Resp>({ url: Api.root, data }); return defHttp.post({ url: Api.root, data });
} }
export function update(data: any) { export function update(data: any) {
return defHttp.put<Resp>({ url: Api.root, data }); return defHttp.put({ url: Api.root, data });
} }
export function removeByIds(ids: IDS) { export function removeByIds(ids: any) {
return defHttp.deleteWithMsg<void>({ url: `${Api.root}/${ids.join(',')}` }); return defHttp.deleteWithMsg({ url: `${Api.root}/${ids.join(',')}` });
}
export function getSubcategoryType() {
return defHttp.get({ url: Api.getSubcategoryType });
}
export function workOrderAdd(data: any) {
return defHttp.post({ url: Api.workOrderAdd, data });
}
export function getProjectInfo() {
return defHttp.get({ url: Api.getProjectInfo });
} }

106
src/views/IO/delayPatrol/waitPatrol/data.ts

@ -2,60 +2,73 @@ import { BasicColumn } from '@/components/Table';
import { FormSchema } from '@/components/Form'; import { FormSchema } from '@/components/Form';
export const formSchemas: FormSchema[] = [ export const formSchemas: FormSchema[] = [
// {
// field: 'projectName',
// label: '项目名称',
// component: 'Select',
// componentProps: {
// options: [
// {
// value: '1',
// label: '2323',
// },
// {
// value: '2',
// label: '2323',
// },
// {
// value: '3',
// label: '2323',
// },
// ],
// },
// },
// {
// field: 'ioCompany',
// label: '运维单位',
// component: 'Select',
// componentProps: {
// options: [
// {
// value: '1',
// label: '2323',
// },
// {
// value: '2',
// label: '2323',
// },
// {
// value: '3',
// label: '2323',
// },
// ],
// },
// },
{ {
field: 'projectName', field: 'plaDate',
label: '项目名称', label: '计划日期',
component: 'Select', component: 'RangePicker',
componentProps: {
options: [
{
value: '1',
label: '2323',
},
{
value: '2',
label: '2323',
},
{
value: '3',
label: '2323',
},
],
},
}, },
{ {
field: 'ioCompany', field: 'deliverContent',
label: '运维单位', label: '交付内容',
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options: [ options:[
{ {
value: '1', value: '例行操作',
label: '2323',
}, },
{ {
value: '2', value: '调研评估',
label: '2323',
}, },
{ {
value: '3', value: '响应支持服务',
label: '2323',
}, },
], {
}, value: '优化改善',
}, },
{ ]
field: 'plaDate', }
label: '计划日期',
component: 'RangePicker',
},
{
field: 'deliverContent',
label: '交付内容',
component: 'Input',
componentProps: {
placeholder: '请输入',
},
}, },
{ {
field: 'serviceProject', field: 'serviceProject',
@ -106,14 +119,17 @@ export const columns: BasicColumn[] = [
}, },
{ {
title: '开始日期', title: '开始日期',
dataIndex: 'startDate', dataIndex: 'scheduleStartDate',
}, },
{ {
title: '结束日期', title: '结束日期',
dataIndex: 'endDate', dataIndex: 'scheduleEndDate',
}, },
{ {
title: '状态', title: '状态',
dataIndex: 'status', dataIndex: 'status',
customRender: ({ value }) => {
return value == 0 ? '启用' : '禁用';
},
}, },
]; ];

56
src/views/IO/delayPatrol/waitPatrol/detailDrawer.vue

@ -11,24 +11,6 @@
> >
<a-tabs v-model:activeKey="activeKey"> <a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="1" tab="详细信息"> <a-tab-pane key="1" tab="详细信息">
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div><span class="titleLabel">所属项目</span>{{ detail.projectName }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div><span class="titleLabel">所属合同</span>{{ detail.contractName }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<div><span class="titleLabel">开始日期</span>{{ detail.startDate }}</div>
</a-col>
<a-col :span="12">
<div><span class="titleLabel">结束日期</span>{{ detail.endDate }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="24"> <a-col :span="24">
<div><span class="titleLabel">巡检部位</span>{{ detail.inspectionPart }}</div> <div><span class="titleLabel">巡检部位</span>{{ detail.inspectionPart }}</div>
@ -55,33 +37,6 @@
</a-col> </a-col>
</a-row> </a-row>
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="2" tab="处理信息">
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div><span class="titleLabel">是否异常</span>{{ detail.isUnusual }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div><span class="titleLabel">处理结果</span>{{ detail.handleResult }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div><span class="titleLabel">描述</span>{{ detail.description }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div><span class="titleLabel">处理前图片</span>{{ detail.beforeHandleImg }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div><span class="titleLabel">处理后图片</span>{{ detail.AfterHandleImg }}</div>
</a-col>
</a-row>
</a-tab-pane>
</a-tabs> </a-tabs>
</a-drawer> </a-drawer>
</div> </div>
@ -89,25 +44,16 @@
<script> <script>
import { reactive, ref } from 'vue'; import { reactive, ref } from 'vue';
// import { getInfo } from './api';
export default { export default {
setup() { setup() {
// //
let detail = reactive({ let detail = reactive({
projectName: '',
contractName: '',
startDate: '',
endDate: '',
inspectionPart: '', inspectionPart: '',
serviceContent: '', serviceContent: '',
code: '', code: '',
deliverContent: '', deliverContent: '',
serviceProject: '', serviceProject: '',
isUnusual: '',
handleResult: '',
description: '',
beforeHandleImg: '',
AfterHandleImg: '',
}); });
// //

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

@ -0,0 +1,291 @@
<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="请选择"
:fieldNames="{
label: 'projectName',
value: 'projectName',
options: 'options',
}"
/>
</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" />
</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" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="响应时限">
<a-input v-model:value="form.responseTime" />
</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: '前端' }, { value: '后端' }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="故障小类" name="faultSubcategory">
<a-select
v-model:value="form.faultSubcategory"
:options="faultSubcategoryOptions"
:fieldNames="{
label: 'typeName',
value: 'id',
options: 'options',
}"
/>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-form-item label="所属机构" name="organizationName">
<a-input v-model:value="form.organizationName" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="故障地点" name="faultLocation">
<a-select
v-model:value="form.faultLocation"
:options="faultLocationOptions"
@change="faultLocationChange"
/>
</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>
</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" />
</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"
/>
</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" />
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-modal>
</template>
<script>
import { reactive, ref } from 'vue';
import { getInfo, getSubcategoryType, workOrderAdd,getProjectInfo } from './api';
import { message } from 'ant-design-vue';
import AMapLoader from '@amap/amap-jsapi-loader';
export default {
setup() {
const visible = ref(false);
const form = reactive({
projectName: '',
isAccident: null,
repairer: '',
responseTime: '',
responseLevel: '',
faultCategory: null,
faultSubcategory: null,
organizationName: '',
faultLocation: '',
faultDescription: '',
faultImg: null,
isDispatched: null,
maintenanceRequirement: null,
dispatchOpinion: '',
longitude: '',
latitude: '',
});
//
const projectNameOptions = ref([])
const getProjectNameOptions= async () =>{
const res = await getProjectInfo();
projectNameOptions.value = res
}
const responseLevelOptions = [
{
value: 0,
label: '常规',
},
{
value: 1,
label: '紧急',
},
{
value: 2,
label: '特级',
},
];
const maintenanceRequirementOptions = [
{
value: 1,
label: '新增',
},
];
const faultLocationOptions = [
{
value: '1',
label: 'a',
latitude: '29.8537459',
longitude: '121.5591519',
},
{
value: '2',
label: 'b',
latitude: '29.8572957 ',
longitude: '121.5611743',
},
{
value: '3',
label: 'c',
latitude: '29.8537459',
longitude: '121.5591519',
},
];
const faultLocationChange = (val) => {
const obj = faultLocationOptions.find((i) => {
return (i.value = val);
});
form.longitude = obj.longitude
form.latitude = obj.latitude
initMap(obj.longitude, obj.latitude, obj.organizationName);
};
const faultSubcategoryOptions = ref([]);
const getFaultSubcategoryOptions = async () => {
const res = await getSubcategoryType();
faultSubcategoryOptions.value = res.rows;
};
const showModal = () => {
visible.value = true;
getFaultSubcategoryOptions()
getProjectNameOptions()
};
const handleOk = () => {
let params = {};
for (let i in form) {
params[i] = form[i];
}
workOrderAdd(params).then((_) => {
message.success('操作成功');
visible.value = false;
});
};
//
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('amapContainer', {
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,
form,
showModal,
handleOk,
responseLevelOptions,
maintenanceRequirementOptions,
faultSubcategoryOptions,
faultLocationOptions,
projectNameOptions,
faultLocationChange
};
},
};
</script>
<style scoped>
/* 可选样式调整 */
.ant-modal-body {
max-width: 600px;
margin: 0 auto;
}
</style>

11
src/views/IO/delayPatrol/waitPatrol/index.vue

@ -2,7 +2,7 @@
<PageWrapper dense> <PageWrapper dense>
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleDetail">上报</a-button> <a-button type="primary" @click="handleReport">上报</a-button>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column && record && column.key === 'action'"> <template v-if="column && record && column.key === 'action'">
@ -11,6 +11,7 @@
</template> </template>
</BasicTable> </BasicTable>
<detailDrawer ref="detailDrawerRef" /> <detailDrawer ref="detailDrawerRef" />
<faultModal ref="faultModalRef" />
</PageWrapper> </PageWrapper>
</template> </template>
@ -21,14 +22,14 @@
import { formSchemas, columns } from './data'; import { formSchemas, columns } from './data';
import detailDrawer from './detailDrawer.vue'; import detailDrawer from './detailDrawer.vue';
import { ref } from 'vue'; import { ref } from 'vue';
import faultModal from './faultModal.vue'
defineOptions({ name: 'WaitPatrol' }); defineOptions({ name: 'WaitPatrol' });
const [registerTable] = useTable({ const [registerTable] = useTable({
rowSelection: { rowSelection: {
type: 'checkbox', type: 'checkbox',
}, },
title: '待巡检列表', title: '例行工作列表',
api: list, api: list,
showIndexColumn: true, showIndexColumn: true,
rowKey: 'id', rowKey: 'id',
@ -57,6 +58,10 @@
const handleDetail = () => { const handleDetail = () => {
detailDrawerRef.value.showDrawer(); detailDrawerRef.value.showDrawer();
}; };
const faultModalRef = ref();
const handleReport = () =>{
faultModalRef.value.showModal()
}
</script> </script>
<style scoped></style> <style scoped></style>

2
src/views/IO/patrol/allPatrol/index.vue

@ -31,7 +31,7 @@
rowSelection: { rowSelection: {
type: 'checkbox', type: 'checkbox',
}, },
title: '巡检进行', title: '全部工作',
api: list, api: list,
showIndexColumn: true, showIndexColumn: true,
rowKey: 'id', rowKey: 'id',

108
src/views/IO/patrol/patroling/addModal.vue

@ -2,7 +2,7 @@
<a-modal v-model:open="visible" :title="title" @ok="handleOk" width="80%"> <a-modal v-model:open="visible" :title="title" @ok="handleOk" width="80%">
<a-form :model="form" layout="vertical"> <a-form :model="form" layout="vertical">
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="12"> <a-col :span="deliverContent == '例行操作' ? 12 : 24">
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="合同名称" name="contractName"> <a-form-item label="合同名称" name="contractName">
@ -24,7 +24,7 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]" v-if="deliverContent == '例行操作'">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="频率" name="frequency"> <a-form-item label="频率" name="frequency">
<a-input v-model:value="form.frequency" placeholder="请输入" disabled /> <a-input v-model:value="form.frequency" placeholder="请输入" disabled />
@ -34,11 +34,12 @@
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="日期范围" name="dateRange"> <a-form-item label="日期范围" name="dateRange">
<a-range-picker v-model:value="form.dateRange" /><a-button <a-range-picker v-model:value="form.dateRange" valueFormat="YYYY-MM-DD" /><a-button
style="margin-left: 10px" style="margin-left: 10px"
type="primary" type="primary"
@click="createPlan" @click="createPlan"
:disabled="!form.dateRange||form.dateRange.length<2" :disabled="!form.dateRange || form.dateRange.length < 2"
v-if="deliverContent == '例行操作'"
>生成</a-button >生成</a-button
> >
</a-form-item> </a-form-item>
@ -63,14 +64,24 @@
<a-form-item label="巡检点位" name="pointName"> <a-form-item label="巡检点位" name="pointName">
<a-select <a-select
v-model:value="form.pointName" v-model:value="form.pointName"
:options="projectNameOptions" :options="pointNameOptions"
placeholder="请选择" placeholder="请选择"
@change="pointNameChange"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div
id="amapContainer"
style="width: 100%; height: 500px"
v-if="form.pointName"
></div>
</a-col>
</a-row>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12" v-if="deliverContent == '例行操作'">
<a-table <a-table
:dataSource="form.finishStatus" :dataSource="form.finishStatus"
:columns="finishColumns" :columns="finishColumns"
@ -91,12 +102,14 @@
<script> <script>
import { reactive, ref } from 'vue'; import { reactive, ref } from 'vue';
import { getInfo } from './api'; import { getInfo, createRoutineInspection, createSpecialInspection } from './api';
import { message } from 'ant-design-vue';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import AMapLoader from '@amap/amap-jsapi-loader';
export default { export default {
setup() { setup() {
const title = ref('生成计划'); const title = ref('生成计划');
const deliverContent = ref('');
const visible = ref(false); const visible = ref(false);
const form = reactive({ const form = reactive({
contractName: '', contractName: '',
@ -107,36 +120,66 @@
isWeekend: false, isWeekend: false,
description: '', description: '',
pointName: '', pointName: '',
serviceProject: '',
finishStatus: [], finishStatus: [],
}); });
// //
const projectNameOptions = [ const pointNameOptions = [
{ {
value: '1', value: '1',
label: 'a', label: 'a',
latitude: '29.8537459',
longitude: '121.5591519',
}, },
{ {
value: '2', value: '2',
label: 'b', label: 'b',
latitude: '29.8572957 ',
longitude: '121.5611743',
}, },
{ {
value: '3', value: '3',
label: 'c', label: 'c',
latitude: '29.8537459',
longitude: '121.5591519',
}, },
]; ];
const showModal = async (id) => { const showModal = async (id, type) => {
visible.value = true; visible.value = true;
const data = await getInfo(id); const data = await getInfo(id);
for (let i in form) { for (let i in form) {
form[i] = data[i]; form[i] = data[i];
} }
deliverContent.value = type;
console.log(deliverContent.value);
}; };
const handleOk = () => { const handleOk = () => {
console.log('Form Data:', form); let params = {};
// for (let i in form) {
visible.value = false; params[i] = form[i];
}
params.scheduleStartDate = params.dateRange[0]
params.scheduleEndDate = params.dateRange[1]
if (deliverContent.value != '例行操作') {
delete params['finishStatus']
delete params['frequency']
createRoutineInspection(params).then((_) => {
message.success('操作成功');
visible.value = false;
});
visible.value = false;
} else {
if (form.finishStatus && form.finishStatus.length > 0) {
createSpecialInspection(params).then((_) => {
message.success('操作成功');
visible.value = false;
});
} else {
message.warning('工作日标不能为空');
}
}
}; };
// //
const finishColumns = [ const finishColumns = [
@ -213,16 +256,53 @@
const deletePlan = (index) => { const deletePlan = (index) => {
form.finishStatus.splice(index, 1); form.finishStatus.splice(index, 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('amapContainer', {
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 pointNameChange = (val) => {
const obj = pointNameOptions.find((i) => {
return (i.value = val);
});
initMap(obj.longitude, obj.latitude, obj.organizationName);
};
return { return {
visible, visible,
title, title,
form, form,
showModal, showModal,
handleOk, handleOk,
projectNameOptions, pointNameOptions,
finishColumns, finishColumns,
createPlan, createPlan,
deletePlan, deletePlan,
pointNameChange,
deliverContent,
}; };
}, },
}; };

10
src/views/IO/patrol/patroling/api.ts

@ -5,6 +5,8 @@ enum Api {
list = '/platform/inspectPlanInfo/list', list = '/platform/inspectPlanInfo/list',
// export = '/workflow/leave/export', // export = '/workflow/leave/export',
getProjectInfo = '/platform/projectInfo/getNames', getProjectInfo = '/platform/projectInfo/getNames',
createRoutineInspection = '/platform/routineInspectionInfo/createRoutineInspection',
createSpecialInspection = '/platform/routineInspectionInfo/createSpecialInspection',
} }
export function list(params?: any) { export function list(params?: any) {
@ -32,3 +34,11 @@ export function update(data: any) {
export function removeByIds(ids: any) { export function removeByIds(ids: any) {
return defHttp.deleteWithMsg({ url: `${Api.root}/${ids.join(',')}` }); return defHttp.deleteWithMsg({ url: `${Api.root}/${ids.join(',')}` });
} }
export function createRoutineInspection(data: any) {
return defHttp.post({ url: Api.createRoutineInspection, data });
}
export function createSpecialInspection(data: any) {
return defHttp.post({ url: Api.createSpecialInspection, data });
}

25
src/views/IO/patrol/patroling/data.ts

@ -19,6 +19,27 @@ export const formSchemas: FormSchema[] = [
label: '计划日期', label: '计划日期',
component: 'RangePicker', component: 'RangePicker',
}, },
{
field: 'progress',
label: '完成情况',
component: 'Select',
componentProps: {
options:[
{
value:0,
label:'未完成'
},
{
value:1,
label:'进行中'
},
{
value:2,
label:'已完成'
},
]
},
},
]; ];
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
@ -42,6 +63,10 @@ export const columns: BasicColumn[] = [
title: '结束日期', title: '结束日期',
dataIndex: 'endDate', dataIndex: 'endDate',
}, },
{
title: '交付内容',
dataIndex: 'deliverContent',
},
{ {
title: '频次', title: '频次',
dataIndex: 'frequency', dataIndex: 'frequency',

51
src/views/IO/patrol/patroling/detailDrawer.vue

@ -47,6 +47,15 @@
<div><span class="titleLabel">计划描述</span>{{ detail.description }}</div> <div><span class="titleLabel">计划描述</span>{{ detail.description }}</div>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div
id="amapContainer"
style="width: 100%; height: 500px"
v-if="detail.longitude"
></div>
</a-col>
</a-row>
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="2" tab="完成情况"> <a-tab-pane key="2" tab="完成情况">
<a-table :dataSource="detail.finishStatus" :columns="finishColumns" bordered /> <a-table :dataSource="detail.finishStatus" :columns="finishColumns" bordered />
@ -59,7 +68,7 @@
<script> <script>
import { reactive, ref } from 'vue'; import { reactive, ref } from 'vue';
import { getInfo } from './api'; import { getInfo } from './api';
import AMapLoader from '@amap/amap-jsapi-loader';
export default { export default {
setup() { setup() {
// //
@ -73,6 +82,9 @@
progress: '', progress: '',
description: '', description: '',
finishStatus: [], finishStatus: [],
longitude:'',
latitude:''
}); });
const finishColumns = [ const finishColumns = [
{ {
@ -104,7 +116,17 @@
for (let i in detail) { for (let i in detail) {
detail[i] = data[i]; detail[i] = data[i];
} }
if(detail.progress==0){
detail.progress='未完成'
}else if(detail.progress==1){
detail.progress='进行中'
}else{
detail.progress='已完成'
}
visible.value = true; visible.value = true;
if(detail.longitude){
initMap(detail.longitude,detail.latitude,detail.organizationName)
}
console.log(detail); console.log(detail);
}; };
// //
@ -112,7 +134,34 @@
visible.value = false; visible.value = false;
}; };
const activeKey = ref('1'); 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('amapContainer', {
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 { return {
visible, visible,
showDrawer, showDrawer,

8
src/views/IO/patrol/patroling/index.vue

@ -5,7 +5,7 @@
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column && record && column.key === 'action'"> <template v-if="column && record && column.key === 'action'">
<a-button type="link" @click="handleDetail(record.id)">详情</a-button> <a-button type="link" @click="handleDetail(record.id)">详情</a-button>
<a-button type="link" @click="handleAdd(record.id)" v-show="record.progress == 0" <a-button type="link" @click="handleAdd(record.id,record.deliverContent)" v-show="record.progress == 0"
>生成计划</a-button >生成计划</a-button
> >
<a-button type="link" @click="handleAdd(record.id)" v-show="record.progress == 1" <a-button type="link" @click="handleAdd(record.id)" v-show="record.progress == 1"
@ -37,7 +37,7 @@
rowSelection: { rowSelection: {
type: 'checkbox', type: 'checkbox',
}, },
title: '巡检进行', title: '全部工作',
api: list, api: list,
showIndexColumn: true, showIndexColumn: true,
rowKey: 'id', rowKey: 'id',
@ -62,8 +62,8 @@
}); });
// //
const addModalRef = ref(); const addModalRef = ref();
const handleAdd = (id: any) => { const handleAdd = (id: any,deliverContent:String) => {
addModalRef.value.showModal(id); addModalRef.value.showModal(id,deliverContent);
}; };
// //
const detailDrawerRef = ref(); const detailDrawerRef = ref();

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

@ -46,7 +46,7 @@
rowSelection: { rowSelection: {
type: 'checkbox', type: 'checkbox',
}, },
title: '巡检日报', title: '工作日报',
api: list, api: list,
showIndexColumn: true, showIndexColumn: true,
rowKey: 'id', rowKey: 'id',

15
src/views/project/contractManage/api.ts

@ -8,7 +8,9 @@ enum Api {
getProjectInfo = '/platform/projectInfo/getNames', getProjectInfo = '/platform/projectInfo/getNames',
getContractType = '/platform/contractType/list', getContractType = '/platform/contractType/list',
getCategory = '/platform/catalogCategory/queryOutCategoryName', getCategory = '/platform/catalogCategory/queryOutCategoryName',
createPlans = '/platform/inspectPlanInfo/createPlans', createPlansByHands = '/platform/inspectPlanInfo/createPlansByHands ',
findLeafNodeInfos = '/platform/inspectPlanInfo/findLeafNodeInfos',
autoCreatePlans = 'platform/routineInspectionInfo/autoCreatePlans',
} }
export function list(params: any) { export function list(params: any) {
@ -48,6 +50,13 @@ export function getCategory() {
return defHttp.get({ url: Api.getCategory }); return defHttp.get({ url: Api.getCategory });
} }
export function createPlans(params: any) { export function createPlansByHands(data: any) {
return defHttp.get({ url: Api.createPlans, params }); return defHttp.post({ url: Api.createPlansByHands, data });
}
export function createPautoCreatePlanslans(data: any) {
return defHttp.post({ url: Api.autoCreatePlans, data });
}
export function findLeafNodeInfos(params: any) {
return defHttp.get({ url: Api.findLeafNodeInfos, params });
} }

54
src/views/project/contractManage/index.vue

@ -51,6 +51,7 @@
<a-select <a-select
v-model:value="serviceForm.categoryId" v-model:value="serviceForm.categoryId"
:options="categoryOptions" :options="categoryOptions"
@change="categoryIdChange"
placeholder="请选择" placeholder="请选择"
:fieldNames="{ :fieldNames="{
value: 'id', value: 'id',
@ -61,6 +62,30 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row>
<a-col :span="24">
<a-form-item label="目录名称" name="serviceProjectList">
<a-select
v-model:value="serviceForm.serviceProjectList"
mode="multiple"
:options="serviceProjectOptions"
placeholder="请选择"
:fieldNames="{
value: 'id',
label: 'serviceProject',
options: 'options',
}"
/>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="24">
<a-form-item label="自动生成" name="auto">
<a-switch v-model:checked="serviceForm.auto" />
</a-form-item>
</a-col>
</a-row>
</a-form> </a-form>
</a-modal> </a-modal>
<detailDrawer ref="detailDrawerRef" /> <detailDrawer ref="detailDrawerRef" />
@ -71,7 +96,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { PageWrapper } from '@/components/Page'; import { PageWrapper } from '@/components/Page';
import { BasicTable, useTable } from '@/components/Table'; import { BasicTable, useTable } from '@/components/Table';
import { list, removeByIds, createPlans, getCategory } from './api'; import { list, removeByIds, createPlansByHands, getCategory,findLeafNodeInfos,createPautoCreatePlanslans } from './api';
import { formSchemas, columns } from './data'; import { formSchemas, columns } from './data';
import detailDrawer from './detailDrawer.vue'; import detailDrawer from './detailDrawer.vue';
import { ref, reactive } from 'vue'; import { ref, reactive } from 'vue';
@ -128,8 +153,10 @@
// //
let serviceForm = reactive({ let serviceForm = reactive({
contractId: '', contractId: null,
categoryId: '', categoryId: null,
serviceProjectList:[],
auto:true
}); });
const serviceVisible = ref(false); const serviceVisible = ref(false);
const serviceRef = ref(); const serviceRef = ref();
@ -139,17 +166,26 @@
let params = { let params = {
contractId: serviceForm.contractId, contractId: serviceForm.contractId,
categoryId: serviceForm.categoryId, categoryId: serviceForm.categoryId,
serviceProjectList:serviceForm.serviceProjectList
}; };
createPlans(params).then((_) => { if(serviceForm.auto){
createPautoCreatePlanslans(params).then((_) => {
message.success('操作成功');
closeService();
});
}else{
createPlansByHands(params).then((_) => {
message.success('操作成功'); message.success('操作成功');
closeService(); closeService();
}); });
}
} }
}); });
}; };
const serviceRules = { const serviceRules = {
contractId: [{ required: true, message: '请选择' }], contractId: [{ required: true, message: '请选择' }],
categoryId: [{ required: true, message: '请选择' }], categoryId: [{ required: true, message: '请选择' }],
serviceProjectList:[{ required: true, message: '请选择' }]
}; };
const addService = () => { const addService = () => {
serviceVisible.value = true; serviceVisible.value = true;
@ -157,10 +193,7 @@
}; };
const closeService = () => { const closeService = () => {
serviceVisible.value = false; serviceVisible.value = false;
serviceForm = { serviceRef.value.resetFields()
contractId: '',
categoryId: '',
};
}; };
const contractOptions = ref([]); const contractOptions = ref([]);
const getContractOptions = () => { const getContractOptions = () => {
@ -175,6 +208,11 @@
categoryOptions.value = res; categoryOptions.value = res;
}); });
}; };
const serviceProjectOptions = ref([])
const categoryIdChange = async(val:any)=>{
const res = await findLeafNodeInfos({categoryId:val })
serviceProjectOptions.value = res
}
const getOptions = () => { const getOptions = () => {
getCategoryOptions(); getCategoryOptions();
getContractOptions(); getContractOptions();

181
src/views/project/serviceManage/addModal.vue

@ -1,65 +1,15 @@
<template> <template>
<a-modal v-model:open="visible" :title="title" @ok="handleOk" @cancel="closeModal" width="50%"> <a-modal v-model:open="visible" :title="title" @ok="handleOk" @cancel="closeModal" width="50%">
<a-form ref="formRef" :model="form" layout="vertical"> <a-form ref="formRef" :model="form" layout="vertical" :rules="rules">
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="大类名称" name="largeTypeName"> <a-form-item label="交付内容" name="deliverContent">
<a-select
v-model:value="form.largeTypeName"
:options="statusOptions"
placeholder="请选择"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="大类编号" name="largeTypeCode">
<a-input v-model:value="form.largeTypeCode" placeholder="请输入" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-form-item label="中类名称" name="middleTypeName">
<a-select
v-model:value="form.middleTypeName"
:options="statusOptions"
placeholder="请选择"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="中类编号" name="middleTypeCode">
<a-input v-model:value="form.middleTypeCode" placeholder="请输入" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-form-item label="小类名称" name="smallTypeName">
<a-select <a-select
v-model:value="form.smallTypeName" v-model:value="form.deliverContent"
:options="statusOptions" :options="deliverContentOptions"
placeholder="请选择" placeholder="请选择"
/> />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="小类编号" name="smallTypeCode">
<a-input v-model:value="form.smallTypeCode" placeholder="请输入" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="说明" name="description">
<a-textarea v-model:value="form.description" :rows="4" placeholder="请输入" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-form-item label="交付内容" name="deliverContent">
<a-input v-model:value="form.deliverContent" placeholder="请输入" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
@ -71,11 +21,7 @@
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="服务项目" name="serviceProject"> <a-form-item label="服务项目" name="serviceProject">
<a-select <a-input v-model:value="form.serviceProject" placeholder="请输入" />
v-model:value="form.serviceProject"
:options="statusOptions"
placeholder="请选择"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@ -97,32 +43,12 @@
<a-col :span="24"> <a-col :span="24">
<a-form-item <a-form-item
label="频率" label="频率"
:rules="[{ required: true, message: '请输入', trigger: 'change' }]" name='frequency'
> >
<a-input <a-input
v-model:value="form.frequnency.a" v-model:value="form.frequency"
placeholder="单位数量" placeholder="例如1日1次,1月一次"
style="width: 25%; margin-right: 10px"
/>
<a-select
v-model:value="form.frequnency.b"
:options="statusOptions"
placeholder="周期单位"
style="width: 25%; margin-right: 10px"
/> />
<a-input
v-model:value="form.frequnency.c"
placeholder="周期次数"
style="width: 25%; margin-right: 10px"
/>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="备注" name="remark">
<a-textarea v-model:value="form.remark" :rows="4" placeholder="请输入" />
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@ -151,60 +77,92 @@
<script> <script>
import { reactive, ref } from 'vue'; import { reactive, ref } from 'vue';
import {
getInfo,
add,
update,
} from './api';
export default { export default {
setup() { setup() {
const title = ref('新增'); const title = ref('新增');
const visible = ref(false); const visible = ref(false);
const formRef = ref(); const formRef = ref();
let form = reactive({ let form = reactive({
largeTypeName: '', deliverContent: null,
largeTypeCode: '',
middleTypeName: '',
middleTypeCode: '',
smallTypeName: '',
smallTypeCode: '',
description: '',
deliverContent: '',
code: '', code: '',
serviceProject: '', serviceProject: '',
serviceContent: '', serviceContent: '',
responseLevel: '', responseLevel: '',
frequnency: { frequency: '',
a: '',
b: '',
c: '',
},
remark: '',
responseType: '', responseType: '',
deliverType: '', deliverType: '',
deliverResult: '', deliverResult: '',
serviceCategoryId:null
}); });
// //
const statusOptions = [ const deliverContentOptions = [
{
value: '例行操作',
},
{ {
value: 0, value: '调研评估',
label: '禁用',
}, },
{ {
value: 1, value: '响应支持服务',
label: '启用', },
{
value: '优化改善',
}, },
]; ];
const showModal = (type, id) => { const showModal =async (type, id,serviceCategoryId) => {
visible.value = true;
if (type == 1) { if (type == 1) {
title.value = '新增'; title.value = '新增';
form.serviceCategoryId = serviceCategoryId
} else if (type == 2) { } else if (type == 2) {
title.value = '编辑'; title.value = '编辑';
console.log(id); const data = await getInfo(id);
for (let i in form) {
form[i] = data[i];
}
form.serviceCategoryId =serviceCategoryId
} }
visible.value = true;
}; };
const rules = {
deliverContent: [{ required: true, message: '请选择' }],
code: [{ required: true, message: '请输入' }],
serviceProject: [{ required: true, message: '请输入' }],
serviceContent: [{ required: true, message: '请输入' }],
responseLevel: [{ required: true, message: '请输入' }],
frequency: [{ required: true, message: '请输入' }],
responseType: [{ required: true, message: '请输入' }],
deliverType: [{ required: true, message: '请输入' }],
deliverResult: [{ required: true, message: '请输入' }],
};
const handleOk = () => { const handleOk = () => {
console.log('Form Data:', form); formRef.value.validate().then((valid) => {
// if (valid) {
visible.value = false; if (title.value == '新增') {
let params = {};
for (let i in form) {
params[i] = form[i];
}
add(params).then((_) => {
message.success('新增成功');
visible.value = false;
});
} else {
let params = {};
for (let i in form) {
params[i] = form[i];
}
update(params).then((_) => {
message.success('编辑成功');
visible.value = false;
});
}
}
});
}; };
const closeModal = () => { const closeModal = () => {
formRef.value.resetFields(); formRef.value.resetFields();
@ -216,9 +174,10 @@
form, form,
showModal, showModal,
handleOk, handleOk,
statusOptions, deliverContentOptions,
closeModal, closeModal,
formRef, formRef,
rules
}; };
}, },
}; };

23
src/views/project/serviceManage/api.ts

@ -8,6 +8,7 @@ enum Api {
addCategory = '/platform/catalogCategory/saveCategory', addCategory = '/platform/catalogCategory/saveCategory',
category = '/platform/catalogCategory', category = '/platform/catalogCategory',
queryAllCatalogName = '/platform/catalogCategory/queryAllCategoryName', queryAllCatalogName = '/platform/catalogCategory/queryAllCategoryName',
root='/platform/agreementInfo',
} }
export function list(params: any) { export function list(params: any) {
@ -29,16 +30,30 @@ export function downLoadTemplate() {
{ isTransformResponse: false }, { isTransformResponse: false },
); );
} }
export function addCategory(params: any) {
return defHttp.post({ url: Api.addCategory, params });
}
export function queryAllCatalogName() { export function queryAllCatalogName() {
return defHttp.get({ url: Api.queryAllCatalogName }); return defHttp.get({ url: Api.queryAllCatalogName });
} }
export function addCategory(params: any) {
return defHttp.post({ url: Api.addCategory, params });
}
export function editCategory(data: any) { export function editCategory(data: any) {
return defHttp.put({ url: Api.category, data }); return defHttp.put({ url: Api.category, data });
} }
export function removeByIds(ids: any) { export function removeCategory(ids: any) {
return defHttp.deleteWithMsg({ url: `${Api.category}/${ids.join(',')}` }); return defHttp.deleteWithMsg({ url: `${Api.category}/${ids.join(',')}` });
} }
export function add(params: any) {
return defHttp.post({ url: Api.root, params });
}
export function update(data: any) {
return defHttp.put({ url: Api.root, data });
}
export function remove(ids: any) {
return defHttp.deleteWithMsg({ url: `${Api.root}/${ids.join(',')}` });
}
export function getInfo(id: any) {
return defHttp.get({ url: `${Api.root}/${id}` });
}

27
src/views/project/serviceManage/index.vue

@ -35,8 +35,9 @@
<a-col :span="18"> <a-col :span="18">
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleAdd">新增协议</a-button> <a-button type="primary" @click="handleAdd" v-if="checkedTree.length > 0"
<a-button type="primary" @click="handleTypeAdd">新增类型</a-button> >新增协议</a-button
>
<a-upload <a-upload
name="file" name="file"
:before-upload="beforeUpload" :before-upload="beforeUpload"
@ -66,7 +67,6 @@
</template> </template>
</BasicTable> </BasicTable>
<addModal ref="addModalRef" /> <addModal ref="addModalRef" />
<addTypeModal ref="addTypeModalRef" />
<a-modal <a-modal
v-model:open="catalogVisible" v-model:open="catalogVisible"
:title="catalogTitle" :title="catalogTitle"
@ -117,12 +117,12 @@
queryAllCatalogName, queryAllCatalogName,
addCategory, addCategory,
editCategory, editCategory,
removeByIds, removeCategory,
remove,
} from './api'; } from './api';
import { formSchemas, columns } from './data'; import { formSchemas, columns } from './data';
import addModal from './addModal.vue'; import addModal from './addModal.vue';
import { ref, reactive, onMounted } from 'vue'; import { ref, reactive, onMounted } from 'vue';
import addTypeModal from './addTypeModal.vue';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import { downloadExcel } from '@/utils/file/download'; import { downloadExcel } from '@/utils/file/download';
@ -199,7 +199,7 @@
}; };
const catalogDelete = async () => { const catalogDelete = async () => {
if (checkedTree.value[0]) { if (checkedTree.value[0]) {
await removeByIds([checkedTree.value[0]]); await removeCategory([checkedTree.value[0]]);
getTree(); getTree();
} else { } else {
message.error('请选择目录'); message.error('请选择目录');
@ -247,19 +247,16 @@
// //
const addModalRef = ref(); const addModalRef = ref();
const handleAdd = () => { const handleAdd = () => {
addModalRef.value.showModal(1); addModalRef.value.showModal(1,null,checkedTree.value[0]);
}; };
const handleEdit = (id: any) => { const handleEdit = (id: any) => {
addModalRef.value.showModal(2, id); addModalRef.value.showModal(2, id,checkedTree.value[0]);
};
const handleDelete = (id: any) => {
addModalRef.value.showModal(2, id);
}; };
// const handleDelete = async (id: any) => {
const addTypeModalRef = ref(); await remove([id]);
const handleTypeAdd = () => { reload();
addTypeModalRef.value.showModal(1);
}; };
//tree //tree
const checkedTree = ref([]); const checkedTree = ref([]);
const treeData = ref([]); const treeData = ref([]);

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

@ -199,7 +199,6 @@
}; };
// //
const map = ref(null); const map = ref(null);
const initMap = async (longitude,latitude,organizationName) => { const initMap = async (longitude,latitude,organizationName) => {
try { try {
// JavaScript API // JavaScript API
@ -222,13 +221,6 @@
}); });
const markerList = [marker]; const markerList = [marker];
map.value.add(markerList); map.value.add(markerList);
// map.value.on('click', (e) => {
// const newMarker = new AMap.Marker({
// position: new AMap.LngLat(e.lnglat.lng, e.lnglat.lat),
// title: '',
// });
// map.value.add(newMarker);
// });
} catch (error) { } catch (error) {
console.error('加载高德地图失败:', error); console.error('加载高德地图失败:', error);
} }

Loading…
Cancel
Save