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
VITE_GLOB_APP_TITLE = Plus Admin
VITE_GLOB_APP_TITLE = '国研数字化运维管理平台'

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

@ -65,8 +65,8 @@
"qrSignInFormTitle": "二维码登录",
"signUpFormTitle": "注册",
"forgetFormTitle": "重置密码",
"signInTitle": "开箱即用的中后台管理系统",
"signInDesc": "输入您的个人详细信息开始使用!",
"signInTitle": "国研数字化运维管理平台",
"signInDesc": "",
"policy": "我同意xxx隐私政策",
"scanSign": "扫码后点击\"确认\",即可完成登录",
"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 { Dayjs } from 'dayjs';
enum Api {
root = '/workflow/leave',
list = '/workflow/leave/list',
export = '/workflow/leave/export',
root = '/platform/routineInspectionInfo',
list = '/platform/routineInspectionInfo/specialList',
getSubcategoryType = '/platform/subcategoryType/list',
workOrderAdd = '/platform/workOrder/add',
getProjectInfo = '/platform/projectInfo/getNames',
}
export interface Leave {
id: string;
leaveType: string;
startDate: string;
endDate: string;
leaveDays: number;
remark: string;
processInstanceVo?: any;
dateTime?: [string, string] | [Dayjs, Dayjs];
export function list(params:any) {
return defHttp.get({ url: Api.list, params });
}
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 getInfo(id: any) {
return defHttp.get({ url: `${Api.root}/${id}` });
}
export function exportExcel(data: any) {
return commonExport(Api.export, data);
export function add(data: any) {
return defHttp.post({ url: Api.root, data });
}
export function getInfo(id: ID) {
return defHttp.get<Leave>({ url: `${Api.root}/${id}` });
export function update(data: any) {
return defHttp.put({ url: Api.root, data });
}
export function add(data: any) {
return defHttp.post<Resp>({ url: Api.root, data });
export function removeByIds(ids: any) {
return defHttp.deleteWithMsg({ url: `${Api.root}/${ids.join(',')}` });
}
export function update(data: any) {
return defHttp.put<Resp>({ url: Api.root, data });
export function getSubcategoryType() {
return defHttp.get({ url: Api.getSubcategoryType });
}
export function removeByIds(ids: IDS) {
return defHttp.deleteWithMsg<void>({ url: `${Api.root}/${ids.join(',')}` });
export function workOrderAdd(data: any) {
return defHttp.post({ url: Api.workOrderAdd, data });
}
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[] = [
{
field: 'projectName',
label: '项目名称',
component: 'Select',
componentProps: {
options: [
{
value: '1',
label: '2323',
},
{
value: '2',
label: '2323',
},
{
value: '3',
label: '2323',
},
],
},
field: 'plaDate',
label: '计划日期',
component: 'RangePicker',
},
{
field: 'ioCompany',
label: '运维单位',
field: 'deliverContent',
label: '交付内容',
component: 'Select',
componentProps: {
options: [
options:[
{
value: '1',
label: '2323',
value: '例行操作',
},
{
value: '2',
label: '2323',
value: '调研评估',
},
{
value: '3',
label: '2323',
value: '响应支持服务',
},
],
},
},
{
field: 'plaDate',
label: '计划日期',
component: 'RangePicker',
},
{
field: 'deliverContent',
label: '交付内容',
component: 'Input',
componentProps: {
placeholder: '请输入',
{
value: '优化改善',
},
]
},
},
{
@ -106,11 +77,11 @@ export const columns: BasicColumn[] = [
},
{
title: '开始日期',
dataIndex: 'startDate',
dataIndex: 'scheduleStartDate',
},
{
title: '结束日期',
dataIndex: 'endDate',
dataIndex: 'scheduleEndDate',
},
{
title: '状态',

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

@ -11,24 +11,6 @@
>
<a-tabs v-model:activeKey="activeKey">
<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-col :span="24">
<div><span class="titleLabel">巡检部位</span>{{ detail.inspectionPart }}</div>
@ -55,33 +37,6 @@
</a-col>
</a-row>
</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-drawer>
</div>
@ -94,20 +49,11 @@
setup() {
//
let detail = reactive({
projectName: '',
contractName: '',
startDate: '',
endDate: '',
inspectionPart: '',
serviceContent: '',
code: '',
deliverContent: '',
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>
<PageWrapper dense>
<a-row>
<a-col :span="4" style="margin-top: 1%">
<a-tree
:show-line="true"
:show-icon="true"
:default-expanded-keys="['0-0-0']"
:tree-data="treeData"
@select="onSelect"
>
<template #icon><carry-out-outlined /></template>
<template #title="{ dataRef }">
<template v-if="dataRef.key === '0-0-0-1'">
<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>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="handleReport">上报</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" />
<faultModal ref="faultModalRef" />
</PageWrapper>
</template>
@ -47,14 +22,14 @@
import { formSchemas, columns } from './data';
import detailDrawer from './detailDrawer.vue';
import { ref } from 'vue';
import faultModal from './faultModal.vue'
defineOptions({ name: 'waitAudit' });
defineOptions({ name: 'WaitAudit' });
const [registerTable, { reload }] = useTable({
const [registerTable] = useTable({
rowSelection: {
type: 'checkbox',
},
title: '待审核列表',
title: '专项工作列表',
api: list,
showIndexColumn: true,
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 handleDetail = () => {
detailDrawerRef.value.showDrawer();
};
const faultModalRef = ref();
const handleReport = () =>{
faultModalRef.value.showModal()
}
</script>
<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 { Dayjs } from 'dayjs';
enum Api {
root = '/workflow/leave',
list = '/workflow/leave/list',
export = '/workflow/leave/export',
root = '/platform/routineInspectionInfo',
list = '/platform/routineInspectionInfo/list',
getSubcategoryType = '/platform/subcategoryType/list',
workOrderAdd = '/platform/workOrder/add',
getProjectInfo = '/platform/projectInfo/getNames',
}
export interface Leave {
id: string;
leaveType: string;
startDate: string;
endDate: string;
leaveDays: number;
remark: string;
processInstanceVo?: any;
dateTime?: [string, string] | [Dayjs, Dayjs];
export function list(params:any) {
return defHttp.get({ url: Api.list, params });
}
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) {
return defHttp.get<Leave>({ url: `${Api.root}/${id}` });
export function getInfo(id: any) {
return defHttp.get({ url: `${Api.root}/${id}` });
}
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) {
return defHttp.put<Resp>({ url: Api.root, data });
return defHttp.put({ url: Api.root, data });
}
export function removeByIds(ids: IDS) {
return defHttp.deleteWithMsg<void>({ url: `${Api.root}/${ids.join(',')}` });
export function removeByIds(ids: any) {
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';
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',
label: '项目名称',
component: 'Select',
componentProps: {
options: [
{
value: '1',
label: '2323',
},
{
value: '2',
label: '2323',
},
{
value: '3',
label: '2323',
},
],
},
field: 'plaDate',
label: '计划日期',
component: 'RangePicker',
},
{
field: 'ioCompany',
label: '运维单位',
field: 'deliverContent',
label: '交付内容',
component: 'Select',
componentProps: {
options: [
options:[
{
value: '1',
label: '2323',
value: '例行操作',
},
{
value: '2',
label: '2323',
value: '调研评估',
},
{
value: '3',
label: '2323',
value: '响应支持服务',
},
],
},
},
{
field: 'plaDate',
label: '计划日期',
component: 'RangePicker',
},
{
field: 'deliverContent',
label: '交付内容',
component: 'Input',
componentProps: {
placeholder: '请输入',
},
{
value: '优化改善',
},
]
}
},
{
field: 'serviceProject',
@ -106,14 +119,17 @@ export const columns: BasicColumn[] = [
},
{
title: '开始日期',
dataIndex: 'startDate',
dataIndex: 'scheduleStartDate',
},
{
title: '结束日期',
dataIndex: 'endDate',
dataIndex: 'scheduleEndDate',
},
{
title: '状态',
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-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-col :span="24">
<div><span class="titleLabel">巡检部位</span>{{ detail.inspectionPart }}</div>
@ -55,33 +37,6 @@
</a-col>
</a-row>
</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-drawer>
</div>
@ -89,25 +44,16 @@
<script>
import { reactive, ref } from 'vue';
// import { getInfo } from './api';
export default {
setup() {
//
let detail = reactive({
projectName: '',
contractName: '',
startDate: '',
endDate: '',
inspectionPart: '',
serviceContent: '',
code: '',
deliverContent: '',
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>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="handleDetail">上报</a-button>
<a-button type="primary" @click="handleReport">上报</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column && record && column.key === 'action'">
@ -11,6 +11,7 @@
</template>
</BasicTable>
<detailDrawer ref="detailDrawerRef" />
<faultModal ref="faultModalRef" />
</PageWrapper>
</template>
@ -21,14 +22,14 @@
import { formSchemas, columns } from './data';
import detailDrawer from './detailDrawer.vue';
import { ref } from 'vue';
import faultModal from './faultModal.vue'
defineOptions({ name: 'WaitPatrol' });
const [registerTable] = useTable({
rowSelection: {
type: 'checkbox',
},
title: '待巡检列表',
title: '例行工作列表',
api: list,
showIndexColumn: true,
rowKey: 'id',
@ -57,6 +58,10 @@
const handleDetail = () => {
detailDrawerRef.value.showDrawer();
};
const faultModalRef = ref();
const handleReport = () =>{
faultModalRef.value.showModal()
}
</script>
<style scoped></style>

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

@ -31,7 +31,7 @@
rowSelection: {
type: 'checkbox',
},
title: '巡检进行',
title: '全部工作',
api: list,
showIndexColumn: true,
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-form :model="form" layout="vertical">
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-col :span="deliverContent == '例行操作' ? 12 : 24">
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="合同名称" name="contractName">
@ -24,7 +24,7 @@
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-row :gutter="[16, 16]" v-if="deliverContent == '例行操作'">
<a-col :span="24">
<a-form-item label="频率" name="frequency">
<a-input v-model:value="form.frequency" placeholder="请输入" disabled />
@ -34,11 +34,12 @@
<a-row :gutter="[16, 16]">
<a-col :span="24">
<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"
type="primary"
@click="createPlan"
:disabled="!form.dateRange||form.dateRange.length<2"
:disabled="!form.dateRange || form.dateRange.length < 2"
v-if="deliverContent == '例行操作'"
>生成</a-button
>
</a-form-item>
@ -63,14 +64,24 @@
<a-form-item label="巡检点位" name="pointName">
<a-select
v-model:value="form.pointName"
:options="projectNameOptions"
:options="pointNameOptions"
placeholder="请选择"
@change="pointNameChange"
/>
</a-form-item>
</a-col>
</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 :span="12">
<a-col :span="12" v-if="deliverContent == '例行操作'">
<a-table
:dataSource="form.finishStatus"
:columns="finishColumns"
@ -91,12 +102,14 @@
<script>
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 AMapLoader from '@amap/amap-jsapi-loader';
export default {
setup() {
const title = ref('生成计划');
const deliverContent = ref('');
const visible = ref(false);
const form = reactive({
contractName: '',
@ -107,36 +120,66 @@
isWeekend: false,
description: '',
pointName: '',
serviceProject: '',
finishStatus: [],
});
//
const projectNameOptions = [
const pointNameOptions = [
{
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 showModal = async (id) => {
const showModal = async (id, type) => {
visible.value = true;
const data = await getInfo(id);
for (let i in form) {
form[i] = data[i];
}
deliverContent.value = type;
console.log(deliverContent.value);
};
const handleOk = () => {
console.log('Form Data:', form);
//
visible.value = false;
let params = {};
for (let i in form) {
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 = [
@ -213,16 +256,53 @@
const deletePlan = (index) => {
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 {
visible,
title,
form,
showModal,
handleOk,
projectNameOptions,
pointNameOptions,
finishColumns,
createPlan,
deletePlan,
pointNameChange,
deliverContent,
};
},
};

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

@ -5,6 +5,8 @@ enum Api {
list = '/platform/inspectPlanInfo/list',
// export = '/workflow/leave/export',
getProjectInfo = '/platform/projectInfo/getNames',
createRoutineInspection = '/platform/routineInspectionInfo/createRoutineInspection',
createSpecialInspection = '/platform/routineInspectionInfo/createSpecialInspection',
}
export function list(params?: any) {
@ -32,3 +34,11 @@ export function update(data: any) {
export function removeByIds(ids: any) {
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: '计划日期',
component: 'RangePicker',
},
{
field: 'progress',
label: '完成情况',
component: 'Select',
componentProps: {
options:[
{
value:0,
label:'未完成'
},
{
value:1,
label:'进行中'
},
{
value:2,
label:'已完成'
},
]
},
},
];
export const columns: BasicColumn[] = [
@ -42,6 +63,10 @@ export const columns: BasicColumn[] = [
title: '结束日期',
dataIndex: 'endDate',
},
{
title: '交付内容',
dataIndex: 'deliverContent',
},
{
title: '频次',
dataIndex: 'frequency',

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

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

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

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

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

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

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

@ -8,7 +8,9 @@ enum Api {
getProjectInfo = '/platform/projectInfo/getNames',
getContractType = '/platform/contractType/list',
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) {
@ -48,6 +50,13 @@ export function getCategory() {
return defHttp.get({ url: Api.getCategory });
}
export function createPlans(params: any) {
return defHttp.get({ url: Api.createPlans, params });
export function createPlansByHands(data: any) {
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
v-model:value="serviceForm.categoryId"
:options="categoryOptions"
@change="categoryIdChange"
placeholder="请选择"
:fieldNames="{
value: 'id',
@ -61,6 +62,30 @@
</a-form-item>
</a-col>
</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-modal>
<detailDrawer ref="detailDrawerRef" />
@ -71,7 +96,7 @@
<script setup lang="ts">
import { PageWrapper } from '@/components/Page';
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 detailDrawer from './detailDrawer.vue';
import { ref, reactive } from 'vue';
@ -128,8 +153,10 @@
//
let serviceForm = reactive({
contractId: '',
categoryId: '',
contractId: null,
categoryId: null,
serviceProjectList:[],
auto:true
});
const serviceVisible = ref(false);
const serviceRef = ref();
@ -139,17 +166,26 @@
let params = {
contractId: serviceForm.contractId,
categoryId: serviceForm.categoryId,
serviceProjectList:serviceForm.serviceProjectList
};
createPlans(params).then((_) => {
if(serviceForm.auto){
createPautoCreatePlanslans(params).then((_) => {
message.success('操作成功');
closeService();
});
}else{
createPlansByHands(params).then((_) => {
message.success('操作成功');
closeService();
});
}
}
});
};
const serviceRules = {
contractId: [{ required: true, message: '请选择' }],
categoryId: [{ required: true, message: '请选择' }],
serviceProjectList:[{ required: true, message: '请选择' }]
};
const addService = () => {
serviceVisible.value = true;
@ -157,10 +193,7 @@
};
const closeService = () => {
serviceVisible.value = false;
serviceForm = {
contractId: '',
categoryId: '',
};
serviceRef.value.resetFields()
};
const contractOptions = ref([]);
const getContractOptions = () => {
@ -175,6 +208,11 @@
categoryOptions.value = res;
});
};
const serviceProjectOptions = ref([])
const categoryIdChange = async(val:any)=>{
const res = await findLeafNodeInfos({categoryId:val })
serviceProjectOptions.value = res
}
const getOptions = () => {
getCategoryOptions();
getContractOptions();

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

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

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

@ -8,6 +8,7 @@ enum Api {
addCategory = '/platform/catalogCategory/saveCategory',
category = '/platform/catalogCategory',
queryAllCatalogName = '/platform/catalogCategory/queryAllCategoryName',
root='/platform/agreementInfo',
}
export function list(params: any) {
@ -29,16 +30,30 @@ export function downLoadTemplate() {
{ isTransformResponse: false },
);
}
export function addCategory(params: any) {
return defHttp.post({ url: Api.addCategory, params });
}
export function queryAllCatalogName() {
return defHttp.get({ url: Api.queryAllCatalogName });
}
export function addCategory(params: any) {
return defHttp.post({ url: Api.addCategory, params });
}
export function editCategory(data: any) {
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(',')}` });
}
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">
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="handleAdd">新增协议</a-button>
<a-button type="primary" @click="handleTypeAdd">新增类型</a-button>
<a-button type="primary" @click="handleAdd" v-if="checkedTree.length > 0"
>新增协议</a-button
>
<a-upload
name="file"
:before-upload="beforeUpload"
@ -66,7 +67,6 @@
</template>
</BasicTable>
<addModal ref="addModalRef" />
<addTypeModal ref="addTypeModalRef" />
<a-modal
v-model:open="catalogVisible"
:title="catalogTitle"
@ -117,12 +117,12 @@
queryAllCatalogName,
addCategory,
editCategory,
removeByIds,
removeCategory,
remove,
} from './api';
import { formSchemas, columns } from './data';
import addModal from './addModal.vue';
import { ref, reactive, onMounted } from 'vue';
import addTypeModal from './addTypeModal.vue';
import { message } from 'ant-design-vue';
import { downloadExcel } from '@/utils/file/download';
@ -199,7 +199,7 @@
};
const catalogDelete = async () => {
if (checkedTree.value[0]) {
await removeByIds([checkedTree.value[0]]);
await removeCategory([checkedTree.value[0]]);
getTree();
} else {
message.error('请选择目录');
@ -247,19 +247,16 @@
//
const addModalRef = ref();
const handleAdd = () => {
addModalRef.value.showModal(1);
addModalRef.value.showModal(1,null,checkedTree.value[0]);
};
const handleEdit = (id: any) => {
addModalRef.value.showModal(2, id);
};
const handleDelete = (id: any) => {
addModalRef.value.showModal(2, id);
addModalRef.value.showModal(2, id,checkedTree.value[0]);
};
//
const addTypeModalRef = ref();
const handleTypeAdd = () => {
addTypeModalRef.value.showModal(1);
const handleDelete = async (id: any) => {
await remove([id]);
reload();
};
//tree
const checkedTree = ref([]);
const treeData = ref([]);

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

@ -199,7 +199,6 @@
};
//
const map = ref(null);
const initMap = async (longitude,latitude,organizationName) => {
try {
// JavaScript API
@ -222,13 +221,6 @@
});
const markerList = [marker];
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) {
console.error('加载高德地图失败:', error);
}

Loading…
Cancel
Save