Browse Source

成绩查询

ops-management-platform-frontend-dev
wbc 2 weeks ago
parent
commit
9ceded234d
  1. 98
      src/views/IO/delayPatrol/waitAudit/faultModal.vue
  2. 99
      src/views/IO/delayPatrol/waitPatrol/faultModal.vue
  3. 6
      src/views/IO/patrol/patroling/data.ts
  4. 21
      src/views/IO/workOrder/orderSend/api.ts
  5. 3
      src/views/IO/workOrder/orderSend/data.ts
  6. 260
      src/views/IO/workOrder/orderSend/faultModal.vue
  7. 1
      src/views/IO/workOrder/orderSend/index.vue
  8. 2
      src/views/analysis/faultNum/data.ts
  9. 2
      src/views/analysis/resAndFix/data.ts
  10. 121
      src/views/project/IOCheck/checkManage/addModal.vue
  11. 55
      src/views/project/IOCheck/checkManage/api.ts
  12. 8
      src/views/project/IOCheck/checkManage/data.ts
  13. 18
      src/views/project/IOCheck/checkManage/index.vue
  14. 109
      src/views/project/IOCheck/checkRating/addModal.vue
  15. 75
      src/views/project/IOCheck/checkRating/api.ts
  16. 87
      src/views/project/IOCheck/checkRating/checkConfig.vue
  17. 12
      src/views/project/IOCheck/checkRating/data.ts
  18. 35
      src/views/project/IOCheck/checkRating/index.vue
  19. 87
      src/views/project/IOCheck/checkRating/ratingModal.vue
  20. 23
      src/views/project/IOCheck/ratingSearch/api.ts
  21. 30
      src/views/project/IOCheck/ratingSearch/data.ts
  22. 40
      src/views/project/IOCheck/ratingSearch/detailDrawer.vue
  23. 42
      src/views/project/IOCheck/ratingSearch/index.vue
  24. 4
      src/views/project/contractManage/addModal.vue
  25. 74
      src/views/property/point/pointModal.vue

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

@ -1,6 +1,6 @@
<template>
<a-modal v-model:open="visible" title="工单上报" @ok="handleOk" width="70%">
<a-form :model="form" layout="vertical">
<a-modal v-model:open="visible" title="工单上报" @ok="handleOk" width="70%" @cancel="closeModal">
<a-form :model="form" layout="vertical" ref="formRef" :rules="rules">
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="所属项目" name="projectName">
@ -52,12 +52,12 @@
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-form-item label="响应级别">
<a-form-item label="响应级别" name="responseLevel">
<a-select v-model:value="form.responseLevel" :options="responseLevelOptions" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="响应时限">
<a-form-item label="响应时限" name="responseTime">
<a-input v-model:value="form.responseTime" />
</a-form-item>
</a-col>
@ -164,7 +164,14 @@
<script>
import { reactive, ref } from 'vue';
import { getInfo, getSubcategoryType, workOrderAdd,getProjectInfo,getOrganizationType,getContractNamesByProjectName} from './api';
import {
getInfo,
getSubcategoryType,
workOrderAdd,
getProjectInfo,
getOrganizationType,
getContractNamesByProjectName,
} from './api';
import { message } from 'ant-design-vue';
import AMapLoader from '@amap/amap-jsapi-loader';
export default {
@ -172,7 +179,7 @@
const visible = ref(false);
const form = reactive({
projectName: '',
contractName:null,
contractName: null,
isAccident: null,
repairer: '',
responseTime: '',
@ -190,21 +197,21 @@
latitude: '',
});
//
const projectNameOptions = ref([])
const getProjectNameOptions= async () =>{
const projectNameOptions = ref([]);
const getProjectNameOptions = async () => {
const res = await getProjectInfo();
projectNameOptions.value = res
}
const projectNameChange = async(val) =>{
const res = await getContractNamesByProjectName({projectName:val})
contractNameOptions.value = res
}
const contractNameOptions = ref([])
const organizationNameOptions = ref([])
const getOrganizationNameOptions= async () =>{
projectNameOptions.value = res;
};
const projectNameChange = async (val) => {
const res = await getContractNamesByProjectName({ projectName: val });
contractNameOptions.value = res;
};
const contractNameOptions = ref([]);
const organizationNameOptions = ref([]);
const getOrganizationNameOptions = async () => {
const res = await getOrganizationType();
organizationNameOptions.value = res.rows
}
organizationNameOptions.value = res.rows;
};
const responseLevelOptions = [
{
value: 0,
@ -249,8 +256,8 @@
const obj = faultLocationOptions.find((i) => {
return (i.value = val);
});
form.longitude = obj.longitude
form.latitude = obj.latitude
form.longitude = obj.longitude;
form.latitude = obj.latitude;
initMap(obj.longitude, obj.latitude, obj.organizationName);
};
const faultSubcategoryOptions = ref([]);
@ -260,19 +267,23 @@
};
const showModal = () => {
visible.value = true;
getFaultSubcategoryOptions()
getProjectNameOptions()
getOrganizationNameOptions()
getFaultSubcategoryOptions();
getProjectNameOptions();
getOrganizationNameOptions();
};
const handleOk = () => {
let params = {};
for (let i in form) {
params[i] = form[i];
}
workOrderAdd(params).then((_) => {
message.success('操作成功');
visible.value = false;
formRef.value.validate().then((valid) => {
if (valid) {
let params = {};
for (let i in form) {
params[i] = form[i];
}
workOrderAdd(params).then((_) => {
message.success('操作成功');
closeModal()
});
}
});
};
//
@ -303,6 +314,26 @@
console.error('加载高德地图失败:', error);
}
};
const closeModal = () => {
formRef.value.resetFields();
visible.value = false;
map.value.destroy()
};
const formRef = ref();
const rules = {
projectName: [{ required: true, message: '请选择' }],
contractName: [{ required: true, message: '请选择' }],
isAccident: [{ required: true, message: '请选择' }],
repairer: [{ required: true, message: '请输入' }],
faultLocation: [{ required: true, message: '请输入' }],
organizationName: [{ required: true, message: '请选择' }],
responseTime: [{ required: true, message: '请输入' }],
responseLevel: [{ required: true, message: '请选择' }],
faultCategory: [{ required: true, message: '请选择' }],
faultSubcategory: [{ required: true, message: '请选择' }],
faultDescription:[{ required: true, message: '请输入' }],
isDispatched: [{ required: true, message: '请选择' }],
};
return {
visible,
form,
@ -316,7 +347,10 @@
contractNameOptions,
organizationNameOptions,
faultLocationChange,
projectNameChange
projectNameChange,
closeModal,
formRef,
rules,
};
},
};

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

@ -1,6 +1,6 @@
<template>
<a-modal v-model:open="visible" title="工单上报" @ok="handleOk" width="70%">
<a-form :model="form" layout="vertical">
<a-modal v-model:open="visible" title="工单上报" @ok="handleOk" width="70%" @cancel="closeModal">
<a-form :model="form" layout="vertical" ref="formRef" :rules="rules">
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="所属项目" name="projectName">
@ -52,12 +52,12 @@
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-form-item label="响应级别">
<a-form-item label="响应级别" name="responseLevel">
<a-select v-model:value="form.responseLevel" :options="responseLevelOptions" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="响应时限">
<a-form-item label="响应时限" name="responseTime">
<a-input v-model:value="form.responseTime" />
</a-form-item>
</a-col>
@ -164,7 +164,14 @@
<script>
import { reactive, ref } from 'vue';
import { getInfo, getSubcategoryType, workOrderAdd,getProjectInfo,getOrganizationType,getContractNamesByProjectName} from './api';
import {
getInfo,
getSubcategoryType,
workOrderAdd,
getProjectInfo,
getOrganizationType,
getContractNamesByProjectName,
} from './api';
import { message } from 'ant-design-vue';
import AMapLoader from '@amap/amap-jsapi-loader';
export default {
@ -172,7 +179,7 @@
const visible = ref(false);
const form = reactive({
projectName: '',
contractName:null,
contractName: null,
isAccident: null,
repairer: '',
responseTime: '',
@ -190,22 +197,21 @@
latitude: '',
});
//
const projectNameOptions = ref([])
const getProjectNameOptions= async () =>{
const projectNameOptions = ref([]);
const getProjectNameOptions = async () => {
const res = await getProjectInfo();
projectNameOptions.value = res
}
const projectNameChange = async(val) =>{
const res = await getContractNamesByProjectName({projectName:val})
contractNameOptions.value = res
}
const contractNameOptions = ref([])
const organizationNameOptions = ref([])
const getOrganizationNameOptions= async () =>{
projectNameOptions.value = res;
};
const projectNameChange = async (val) => {
const res = await getContractNamesByProjectName({ projectName: val });
contractNameOptions.value = res;
};
const contractNameOptions = ref([]);
const organizationNameOptions = ref([]);
const getOrganizationNameOptions = async () => {
const res = await getOrganizationType();
organizationNameOptions.value = res.rows
}
organizationNameOptions.value = res.rows;
};
const responseLevelOptions = [
{
value: 0,
@ -250,8 +256,8 @@
const obj = faultLocationOptions.find((i) => {
return (i.value = val);
});
form.longitude = obj.longitude
form.latitude = obj.latitude
form.longitude = obj.longitude;
form.latitude = obj.latitude;
initMap(obj.longitude, obj.latitude, obj.organizationName);
};
const faultSubcategoryOptions = ref([]);
@ -261,19 +267,23 @@
};
const showModal = () => {
visible.value = true;
getFaultSubcategoryOptions()
getProjectNameOptions()
getOrganizationNameOptions()
getFaultSubcategoryOptions();
getProjectNameOptions();
getOrganizationNameOptions();
};
const handleOk = () => {
let params = {};
for (let i in form) {
params[i] = form[i];
}
workOrderAdd(params).then((_) => {
message.success('操作成功');
visible.value = false;
formRef.value.validate().then((valid) => {
if (valid) {
let params = {};
for (let i in form) {
params[i] = form[i];
}
workOrderAdd(params).then((_) => {
message.success('操作成功');
closeModal()
});
}
});
};
//
@ -304,6 +314,26 @@
console.error('加载高德地图失败:', error);
}
};
const closeModal = () => {
formRef.value.resetFields();
visible.value = false;
map.value.destroy()
};
const formRef = ref();
const rules = {
projectName: [{ required: true, message: '请选择' }],
contractName: [{ required: true, message: '请选择' }],
isAccident: [{ required: true, message: '请选择' }],
repairer: [{ required: true, message: '请输入' }],
faultLocation: [{ required: true, message: '请输入' }],
organizationName: [{ required: true, message: '请选择' }],
responseTime: [{ required: true, message: '请输入' }],
responseLevel: [{ required: true, message: '请选择' }],
faultCategory: [{ required: true, message: '请选择' }],
faultSubcategory: [{ required: true, message: '请选择' }],
faultDescription:[{ required: true, message: '请输入' }],
isDispatched: [{ required: true, message: '请选择' }],
};
return {
visible,
form,
@ -317,7 +347,10 @@
contractNameOptions,
organizationNameOptions,
faultLocationChange,
projectNameChange
projectNameChange,
closeModal,
formRef,
rules,
};
},
};

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

@ -15,9 +15,13 @@ export const formSchemas: FormSchema[] = [
componentProps: {},
},
{
field: 'plaDate',
field: '[startDate, endDate]',
label: '计划日期',
component: 'RangePicker',
componentProps: {
format: 'YYYY-MM-DD',
valueFormat:'YYYY-MM-DD'
},
},
{
field: 'progress',

21
src/views/IO/workOrder/orderSend/api.ts

@ -5,6 +5,11 @@ enum Api {
root = '/platform/workOrder',
list = '/platform/workOrder/list',
export = '/workflow/leave/export',
getSubcategoryType = '/platform/subcategoryType/list',
workOrderAdd = '/platform/workOrder/add',
getProjectInfo = '/platform/projectInfo/getNames',
getOrganizationType = '/platform/organizationType/list',
getContractNamesByProjectName = '/platform/contractInfo/getContractNamesByProjectName',
}
export function list(params?: PageQuery) {
@ -30,3 +35,19 @@ export function update(data: any) {
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 });
}
export function getOrganizationType() {
return defHttp.get({ url: Api.getOrganizationType });
}
export function getContractNamesByProjectName(data:any) {
return defHttp.post({ url: Api.getContractNamesByProjectName,data });
}

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

@ -89,5 +89,8 @@ export const columns: BasicColumn[] = [
{
title: '当前状态',
dataIndex: 'status',
customRender: ({ value }) => {
return value == 0 ? '启用' : '禁用';
},
},
];

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

@ -1,6 +1,6 @@
<template>
<a-modal v-model:open="visible" title="工单上报" @ok="handleOk" width="70%">
<a-form :model="form" layout="vertical">
<a-modal v-model:open="visible" title="工单上报" @ok="handleOk" width="70%" @cancel="closeModal">
<a-form :model="form" layout="vertical" ref="formRef" :rules="rules">
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="所属项目" name="projectName">
@ -8,6 +8,29 @@
v-model:value="form.projectName"
:options="projectNameOptions"
placeholder="请选择"
@change="projectNameChange"
:fieldNames="{
label: 'projectName',
value: 'projectName',
options: 'options',
}"
/>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="所属合同" name="contractName">
<a-select
v-model:value="form.contractName"
:options="contractNameOptions"
placeholder="请选择"
:disabled="!form.projectName"
:fieldNames="{
label: 'contractName',
value: 'contractName',
options: 'options',
}"
/>
</a-form-item>
</a-col>
@ -23,23 +46,19 @@
</a-col>
<a-col :span="12">
<a-form-item label="报修人员" name="repairer">
<a-input v-model:value="form.repairer" placeholder="请输入" />
<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"
placeholder="请选择"
/>
<a-form-item label="响应级别" name="responseLevel">
<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" placeholder="请输入" />
<a-form-item label="响应时限" name="responseTime">
<a-input v-model:value="form.responseTime" />
</a-form-item>
</a-col>
</a-row>
@ -48,8 +67,7 @@
<a-form-item label="故障大类" name="faultCategory">
<a-select
v-model:value="form.faultCategory"
:options="[{ value: '前端' }]"
placeholder="请选择"
:options="[{ value: '前端' }, { value: '后端' }]"
/>
</a-form-item>
</a-col>
@ -58,31 +76,48 @@
<a-select
v-model:value="form.faultSubcategory"
:options="faultSubcategoryOptions"
placeholder="请选择"
: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="institution">
<a-form-item label="所属机构" name="organizationName">
<a-select
v-model:value="form.institution"
:options="institutionOptions"
placeholder="请选择"
v-model:value="form.organizationName"
:options="organizationNameOptions"
:fieldNames="{
label: 'organizationName',
value: 'organizationName',
options: 'options',
}"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="故障地点" name="faultLocation">
<a-input v-model:value="form.faultLocation" placeholder="请输入" />
<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" placeholder="请输入" />
<a-textarea v-model:value="form.faultDescription" :rows="4" />
</a-form-item>
</a-col>
</a-row>
@ -112,7 +147,6 @@
<a-select
v-model:value="form.maintenanceRequirement"
:options="maintenanceRequirementOptions"
placeholder="请选择"
/>
</a-form-item>
</a-col>
@ -120,43 +154,64 @@
<a-row :gutter="[16, 16]" v-if="form.isDispatched == 1">
<a-col :span="24">
<a-form-item label="派遣意见" name="dispatchOpinion">
<a-textarea v-model:value="form.dispatchOpinion" :rows="4" placeholder="请输入" />
<a-textarea v-model:value="form.dispatchOpinion" :rows="4" />
</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-form>
</a-modal>
</template>
<script>
import { reactive, ref } from 'vue';
import {
getInfo,
getSubcategoryType,
workOrderAdd,
getProjectInfo,
getOrganizationType,
getContractNamesByProjectName,
} 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: '',
contractName: null,
isAccident: null,
repairer: '',
responseTime: '',
responseLevel: '',
faultCategory: '',
faultSubcategory: '',
institution: '',
faultCategory: null,
faultSubcategory: null,
organizationName: '',
faultLocation: '',
faultDescription: '',
faultImg: [],
faultImg: null,
isDispatched: null,
maintenanceRequirement: '',
maintenanceRequirement: null,
dispatchOpinion: '',
longitude: '',
latitude: '',
});
//
const projectNameOptions = ref([]);
const getProjectNameOptions = async () => {
const res = await getProjectInfo();
projectNameOptions.value = res;
};
const projectNameChange = async (val) => {
const res = await getContractNamesByProjectName({ projectName: val });
contractNameOptions.value = res;
};
const contractNameOptions = ref([]);
const organizationNameOptions = ref([]);
const getOrganizationNameOptions = async () => {
const res = await getOrganizationType();
organizationNameOptions.value = res.rows;
};
const responseLevelOptions = [
{
value: 0,
@ -172,114 +227,113 @@
},
];
const maintenanceRequirementOptions = [
{
value: 0,
label: '常规',
},
{
value: 1,
label: '紧急',
},
{
value: 2,
label: '特级',
},
];
const institutionOptions = [
{
value: 0,
label: '常规',
},
{
value: 1,
label: '紧急',
},
{
value: 2,
label: '特级',
label: '新增',
},
];
const faultSubcategoryOptions = [
{
value: 0,
label: '常规',
},
{
value: 1,
label: '紧急',
},
{
value: 2,
label: '特级',
},
];
const projectNameOptions = [
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;
initMap();
getFaultSubcategoryOptions();
getProjectNameOptions();
getOrganizationNameOptions();
};
const handleOk = () => {
console.log('Form Data:', form);
//
visible.value = false;
formRef.value.validate().then((valid) => {
if (valid) {
let params = {};
for (let i in form) {
params[i] = form[i];
}
workOrderAdd(params).then((_) => {
message.success('操作成功');
closeModal()
});
}
});
};
//
const map = ref(null);
const initMap = async () => {
const initMap = async (longitude, latitude, organizationName) => {
try {
// JavaScript API
await AMapLoader.load({
key: '786a2e7cc6d4be5ba1d6174a0aa10f2b', // API Key
key: '786a2e7cc6d4be5ba1d6174a0aa10f2b',
version: '2.0',
plugins: [], //
plugins: [],
});
//
map.value = new AMap.Map('amapContainer', {
zoom: 7,
center: [116.397428, 39.90923], //
zoom: 17,
center: [longitude, latitude],
});
//
const marker = new AMap.Marker({
position: new AMap.LngLat(122, 30),
title: '点位1',
});
const marker1 = new AMap.Marker({
position: new AMap.LngLat(120, 28),
title: '点位2',
position: new AMap.LngLat(longitude, latitude),
title: organizationName,
});
const markerList = [marker, marker1];
const markerList = [marker];
map.value.add(markerList);
// marker.setMap(map.value);
// marker1.setMap(map.value);
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);
}
};
const closeModal = () => {
formRef.value.resetFields();
visible.value = false;
map.value.destroy()
};
const formRef = ref();
const rules = {
projectName: [{ required: true, message: '请选择' }],
contractName: [{ required: true, message: '请选择' }],
isAccident: [{ required: true, message: '请选择' }],
repairer: [{ required: true, message: '请输入' }],
faultLocation: [{ required: true, message: '请输入' }],
organizationName: [{ required: true, message: '请选择' }],
responseTime: [{ required: true, message: '请输入' }],
responseLevel: [{ required: true, message: '请选择' }],
faultCategory: [{ required: true, message: '请选择' }],
faultSubcategory: [{ required: true, message: '请选择' }],
faultDescription:[{ required: true, message: '请输入' }],
isDispatched: [{ required: true, message: '请选择' }],
};
return {
visible,
form,
@ -287,10 +341,16 @@
handleOk,
responseLevelOptions,
maintenanceRequirementOptions,
institutionOptions,
faultSubcategoryOptions,
faultLocationOptions,
projectNameOptions,
map,
contractNameOptions,
organizationNameOptions,
faultLocationChange,
projectNameChange,
closeModal,
formRef,
rules,
};
},
};

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

@ -3,7 +3,6 @@
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="showFaultModal">故障上报</a-button>
<a-button type="primary" @click="showFaultModal">批量上报</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column && record && column.key === 'action'">

2
src/views/analysis/faultNum/data.ts

@ -33,7 +33,7 @@ export const formSchemas: FormSchema[] = [
export const columns: BasicColumn[] = [
{
title: '运维单位',
dataIndex: 'ioUnit',
dataIndex: 'ioCompany',
},
{
title: '故障原因',

2
src/views/analysis/resAndFix/data.ts

@ -37,7 +37,7 @@ export const columns: BasicColumn[] = [
},
{
title: '运维单位',
dataIndex: 'ioUnit',
dataIndex: 'ioCompany',
},
{
title: '故障总数量',

121
src/views/project/IOCheck/checkManage/addModal.vue

@ -1,18 +1,23 @@
<template>
<a-modal v-model:open="visible" :title="title" @ok="handleOk" width="50%">
<a-form :model="form" layout="vertical">
<a-modal v-model:open="visible" :title="title" @ok="handleOk" width="50%" @cancel="closeModal">
<a-form :model="form" layout="vertical" ref="formRef" :rules="rules">
<a-row :gutter="[16, 16]">
<a-col :span="12">
<!-- <a-col :span="12">
<a-form-item label="类型" name="type">
<a-select v-model:value="form.type" :options="statusOptions" placeholder="请选择" />
</a-form-item>
</a-col>
<a-col :span="12">
</a-col> -->
<a-col :span="24">
<a-form-item label="考核类型" name="checkType">
<a-select
v-model:value="form.checkType"
:options="statusOptions"
:options="checkTypeOptions"
placeholder="请选择"
:fieldNames="{
label: 'name',
value: 'name',
options: 'options',
}"
/>
</a-form-item>
</a-col>
@ -22,8 +27,13 @@
<a-form-item label="评分大类" name="largeRating">
<a-select
v-model:value="form.largeRating"
:options="statusOptions"
:options="largeRatingOptions"
placeholder="请选择"
:fieldNames="{
label: 'name',
value: 'name',
options: 'options',
}"
/>
</a-form-item>
</a-col>
@ -44,8 +54,8 @@
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="扣分标准" name="subStandards">
<a-textarea v-model:value="form.subStandards" :rows="4" placeholder="请输入" />
<a-form-item label="扣分标准" name="standards">
<a-textarea v-model:value="form.standards" :rows="4" placeholder="请输入" />
</a-form-item>
</a-col>
</a-row>
@ -55,53 +65,102 @@
<script>
import { reactive, ref } from 'vue';
import {
getInfo,
add,
update,
getCheckType,
getLargeRatingType
} from './api';
import { message } from 'ant-design-vue';
export default {
setup() {
const title = ref('新增');
const visible = ref(false);
const form = reactive({
type: '',
checkType: '',
largeRating: '',
// type: '',
checkType: null,
largeRating: null,
smallRating: '',
rating: '',
subStandards: '',
standards: '',
id:null
});
//
const statusOptions = [
{
value: 0,
label: '禁用',
},
{
value: 1,
label: '启用',
},
];
const showModal = (type, id) => {
const checkTypeOptions = ref([])
const largeRatingOptions = ref([])
const getCheckTypeOptions = async() =>{
const res = await getCheckType()
checkTypeOptions.value = res.rows
}
const getLrgeRatingOptions = async() =>{
const res = await getLargeRatingType()
largeRatingOptions.value = res.rows
}
const showModal = async(type, id) => {
visible.value = true;
getCheckTypeOptions()
getLrgeRatingOptions()
if (type == 1) {
title.value = '新增';
} else if (type == 2) {
title.value = '编辑';
console.log(id);
const data = await getInfo(id);
for (let i in form) {
form[i] = data[i];
}
}
visible.value = true;
};
const handleOk = () => {
console.log('Form Data:', form);
//
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('新增成功');
closeModal()
});
} else {
let params = {};
for (let i in form) {
params[i] = form[i];
}
update(params).then((_) => {
message.success('编辑成功');
closeModal()
});
}
}
});
};
const formRef = ref()
const rules = {
standards: '',
checkType: [{ required: true, message: '请选择' }],
largeRating: [{ required: true, message: '请选择' }],
smallRating: [{ required: true, message: '请输入' }],
rating: [{ required: true, message: '请输入' }],
standards: [{ required: true, message: '请输入' }],
};
const closeModal = () => {
formRef.value.resetFields();
visible.value = false;
};
return {
visible,
title,
form,
showModal,
handleOk,
statusOptions,
formRef,
rules,
closeModal,
checkTypeOptions,
largeRatingOptions
};
},
};

55
src/views/project/IOCheck/checkManage/api.ts

@ -1,58 +1,45 @@
import { ID, IDS, PageQuery, commonExport } from '@/api/base';
import { commonExport } from '@/api/base';
import { defHttp } from '@/utils/http/axios';
import { Dayjs } from 'dayjs';
enum Api {
root = '/workflow/leave',
list = '/workflow/leave/list',
root = '/platform/management',
list = '/platform/management/list',
export = '/workflow/leave/export',
getCheckType = '/platform/checkType/list',
getLargeRatingType = '/platform/largeRatingType/list',
}
export interface Leave {
id: string;
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 list(params?: any) {
return defHttp.get({ 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) {
export function removeByIds(ids: any) {
return defHttp.deleteWithMsg<void>({ url: `${Api.root}/${ids.join(',')}` });
}
export function getCheckType() {
return defHttp.get({ url: Api.getCheckType });
}
export function getLargeRatingType() {
return defHttp.get({ url: Api.getLargeRatingType });
}

8
src/views/project/IOCheck/checkManage/data.ts

@ -27,12 +27,12 @@ export const formSchemas: FormSchema[] = [
export const columns: BasicColumn[] = [
{
title: '类型',
dataIndex: 'type',
title: '考核类型',
dataIndex: 'checkType',
},
{
title: '评分大类',
dataIndex: 'langeRating',
dataIndex: 'largeRating',
},
{
title: '评分小类',
@ -44,7 +44,7 @@ export const columns: BasicColumn[] = [
},
{
title: '扣分标准',
dataIndex: 'subStandards',
dataIndex: 'standards',
},
{
title: '创建日期',

18
src/views/project/IOCheck/checkManage/index.vue

@ -9,7 +9,14 @@
<template #bodyCell="{ column, record }">
<template v-if="column && record && column.key === 'action'">
<a-button type="link" @click="handleEdit(record.id)">编辑</a-button>
<a-button type="link" @click="handleDelete(record.id)">删除</a-button>
<a-popconfirm
title="确定要删除吗?"
ok-text="是"
cancel-text="否"
@confirm="handleDelete(record.id)"
>
<a-button type="link">删除</a-button>
</a-popconfirm>
</template>
</template>
</BasicTable>
@ -20,14 +27,14 @@
<script setup lang="ts">
import { PageWrapper } from '@/components/Page';
import { BasicTable, useTable } from '@/components/Table';
import { list } from './api';
import { list,removeByIds} from './api';
import { formSchemas, columns } from './data';
import addModal from './addModal.vue';
import { ref } from 'vue';
defineOptions({ name: 'CheckManage' });
const [registerTable] = useTable({
const [registerTable,{reload}] = useTable({
rowSelection: {
type: 'checkbox',
},
@ -62,8 +69,9 @@
const handleEdit = (id: any) => {
addModalRef.value.showModal(2, id);
};
const handleDelete = (id: any) => {
addModalRef.value.showModal(2, id);
const handleDelete = async (id: any) => {
await removeByIds([id]);
reload();
};
</script>

109
src/views/project/IOCheck/checkRating/addModal.vue

@ -1,10 +1,10 @@
<template>
<a-modal v-model:open="visible" :title="title" @ok="handleOk" width="30%">
<a-form :model="form" layout="vertical">
<a-modal v-model:open="visible" :title="title" @ok="handleOk" width="30%" @cancel="closeModal">
<a-form :model="form" layout="vertical" ref="formRef" :rules="rules">
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="运维单位" name="ioUnit">
<a-select v-model:value="form.ioUnit" :options="statusOptions" placeholder="请选择" />
<a-form-item label="运维单位" name="ioCompany">
<a-select v-model:value="form.ioCompany" :options="ioCompanyOptions" placeholder="请选择" />
</a-form-item>
</a-col>
</a-row>
@ -13,8 +13,13 @@
<a-form-item label="考核项目" name="checkProject">
<a-select
v-model:value="form.checkProject"
:options="statusOptions"
:options="checkProjectOptions"
placeholder="请选择"
:fieldNames="{
label: 'projectName',
value: 'projectName',
options: 'options',
}"
/>
</a-form-item>
</a-col>
@ -22,7 +27,7 @@
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="考核时间" name="checkTime">
<a-date-picker v-model:value="form.checkTime" placeholder="请选择" type="month" />
<a-date-picker v-model:value="form.checkTime" placeholder="请选择" picker="month" valueFormat="YYYY-MM" format="YYYY-MM"/>
</a-form-item>
</a-col>
</a-row>
@ -39,41 +44,91 @@
<script>
import { reactive, ref } from 'vue';
import {
getInfo,
add,
update,
getProjectInfo,
getIoCompanyNames
} from './api';
import { message } from 'ant-design-vue';
export default {
setup() {
const title = ref('新增');
const visible = ref(false);
const form = reactive({
ioUnit: '',
checkProject: '',
ioCompany: null,
checkProject: null,
checkTime: '',
checkName: '',
id:null
});
//
const statusOptions = [
{
value: 0,
label: '禁用',
},
{
value: 1,
label: '启用',
},
];
const showModal = (type, id) => {
const ioCompanyOptions = ref([])
const checkProjectOptions = ref([])
const getIoCompanyOptions = async() =>{
const res = await getIoCompanyNames()
ioCompanyOptions.value = res.map(i=>{
return {
value:i
}
})
}
const getCheckProjectOptions = async() =>{
const res = await getProjectInfo()
checkProjectOptions.value = res
}
const showModal = async(type, id) => {
visible.value = true;
getIoCompanyOptions()
getCheckProjectOptions()
if (type == 1) {
title.value = '新增';
} else if (type == 2) {
title.value = '编辑';
console.log(id);
const data = await getInfo(id);
for (let i in form) {
form[i] = data[i];
}
}
visible.value = true;
};
const handleOk = () => {
console.log('Form Data:', form);
//
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('新增成功');
closeModal()
});
} else {
let params = {};
for (let i in form) {
params[i] = form[i];
}
update(params).then((_) => {
message.success('编辑成功');
closeModal()
});
}
}
});
};
const formRef = ref()
const rules = {
standards: '',
checkType: [{ required: true, message: '请选择' }],
largeRating: [{ required: true, message: '请选择' }],
smallRating: [{ required: true, message: '请输入' }],
rating: [{ required: true, message: '请输入' }],
standards: [{ required: true, message: '请输入' }],
};
const closeModal = () => {
formRef.value.resetFields();
visible.value = false;
};
@ -83,7 +138,11 @@
form,
showModal,
handleOk,
statusOptions,
formRef,
rules,
closeModal,
checkProjectOptions,
ioCompanyOptions
};
},
};

75
src/views/project/IOCheck/checkRating/api.ts

@ -1,58 +1,65 @@
import { ID, IDS, PageQuery, commonExport } from '@/api/base';
import { commonExport } from '@/api/base';
import { defHttp } from '@/utils/http/axios';
import { Dayjs } from 'dayjs';
enum Api {
root = '/workflow/leave',
list = '/workflow/leave/list',
root = '/platform/evaluationInfo',
list = '/platform/evaluationInfo/list',
export = '/workflow/leave/export',
getProjectInfo = '/platform/projectInfo/getNames',
getIoCompanyNames = '/platform/inspectPlanInfo/getIoCompanyNames',
queryByFlag = '/platform/evaluationTemplate/queryByFlag',
batchEdit = '/platform/evaluationTemplate/batchEdit',
getEvaluationTemplate = '/platform/evaluationTemplate/getTree',
addBySelect = '/platform/evaluationInfo/addBySelect',
}
export interface Leave {
id: string;
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 list(params?: any) {
return defHttp.get({ 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) {
export function removeByIds(ids: any) {
return defHttp.deleteWithMsg<void>({ url: `${Api.root}/${ids.join(',')}` });
}
export function getProjectInfo() {
return defHttp.get({ url: Api.getProjectInfo });
}
export function getIoCompanyNames() {
return defHttp.get({ url: Api.getIoCompanyNames });
}
export function queryByFlag(params?: any) {
return defHttp.get({ url: Api.queryByFlag, params });
}
export function batchEdit(data: any) {
return defHttp.put({ url: Api.batchEdit, data });
}
export function getEvaluationTemplate() {
return defHttp.get({ url: Api.getEvaluationTemplate});
}
export function addBySelect(data: any) {
return defHttp.post({ url: Api.addBySelect, data });
}

87
src/views/project/IOCheck/checkRating/checkConfig.vue

@ -0,0 +1,87 @@
<template>
<a-modal
v-model:open="visible"
title="配置考核项"
@ok="handleOk"
width="80%"
@cancel="closeModal"
>
<div>
<a-tree
v-model:checkedKeys="checkedTree"
checkable
:tree-data="treeData"
@check="onCheck"
v-if="treeData.length"
:defaultExpandAll="true"
:fieldNames="{
children: 'children',
title: 'name',
key: 'id',
disabled: 'disabled',
}"
>
</a-tree>
</div>
</a-modal>
</template>
<script>
import { reactive, ref } from 'vue';
import { getEvaluationTemplate,addBySelect } from './api';
import { message } from 'ant-design-vue';
export default {
setup() {
const visible = ref(false);
const treeData = ref([]);
const checkedTree = ref([]);
const flag = ref('');
const onCheck = (checkedKeysValue, info) => {
console.log(checkedKeysValue, info);
};
const handleOk = () => {
if(checkedTree.value&&checkedTree.value.length>0){
const params = {
flag:flag.value,
checkList:checkedTree.value
}
addBySelect(params).then(_=>{
message.success('操作成功')
closeModal()
})
}else{
message.warning('请勾选配置项')
}
};
const showModal = async (id) => {
visible.value = true;
const res = await getEvaluationTemplate();
treeData.value = res.tree;
flag.value = id;
};
const closeModal = () => {
checkedTree.value = [];
visible.value = false;
};
return {
visible,
treeData,
checkedTree,
onCheck,
handleOk,
showModal,
closeModal,
flag,
};
},
};
</script>
<style scoped>
/* 可选样式调整 */
.ant-modal-body {
max-width: 600px;
margin: 0 auto;
}
</style>

12
src/views/project/IOCheck/checkRating/data.ts

@ -7,8 +7,9 @@ export const formSchemas: FormSchema[] = [
label: '考核时间',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
format: 'YYYY-MM',
valueFormat: 'YYYY-MM',
picker:'month'
},
},
];
@ -16,7 +17,7 @@ export const formSchemas: FormSchema[] = [
export const columns: BasicColumn[] = [
{
title: '运维单位',
dataIndex: 'ioUnit',
dataIndex: 'ioCompany',
},
{
title: '考核项目',
@ -33,5 +34,10 @@ export const columns: BasicColumn[] = [
{
title: '考核得分',
dataIndex: 'checkRating',
customRender:({value}) =>{
if(!value){
return '暂未评分'
}
}
},
];

35
src/views/project/IOCheck/checkRating/index.vue

@ -3,35 +3,42 @@
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="handleAdd">新增</a-button>
<a-button type="primary" @click="handleAdd">考核项编辑</a-button>
<a-button type="primary" @click="handleRating(1, 2)">评分</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column && record && column.key === 'action'">
<a-button type="link" @click="handleEdit(record.id)">编辑</a-button>
<a-button type="link" @click="handleDelete(record.id)">删除</a-button>
<a-button type="primary" @click="handleRating(1, record.id)">评分</a-button>
<a-button type="primary" @click="handleRating(2, record.id)">查看评分</a-button>
<a-popconfirm
title="确定要删除吗?"
ok-text="是"
cancel-text="否"
@confirm="handleDelete(record.id)"
>
<a-button type="link">删除</a-button>
</a-popconfirm>
<a-button type="link" @click="handleRating(1, record.id)">评分</a-button>
<a-button type="link" @click="handleRating(2, record.id)">查看评分</a-button>
<a-button type="link" v-if="!record.checkRating" @click="handleCheckConfig(record.id)">配置考核项</a-button>
</template>
</template>
</BasicTable>
<addModal ref="addModalRef" />
<ratingModal ref="ratingModalRef" />
<checkConfig ref="checkConfigRef" />
</PageWrapper>
</template>
<script setup lang="ts">
import { PageWrapper } from '@/components/Page';
import { BasicTable, useTable } from '@/components/Table';
import { list } from './api';
import { list,removeByIds} from './api';
import { formSchemas, columns } from './data';
import addModal from './addModal.vue';
import { ref } from 'vue';
import ratingModal from './ratingModal.vue';
import checkConfig from './checkConfig.vue';
defineOptions({ name: 'CheckRating' });
const [registerTable] = useTable({
const [registerTable,{reload}] = useTable({
rowSelection: {
type: 'checkbox',
},
@ -52,7 +59,7 @@
},
columns: columns,
actionColumn: {
width: 200,
width: 400,
title: '操作',
key: 'action',
fixed: 'right',
@ -66,14 +73,20 @@
const handleEdit = (id: any) => {
addModalRef.value.showModal(2, id);
};
const handleDelete = (id: any) => {
addModalRef.value.showModal(2, id);
const handleDelete = async (id: any) => {
await removeByIds([id]);
reload();
};
//
const ratingModalRef = ref();
const handleRating = (type: Number, id: any) => {
ratingModalRef.value.showModal(type, id);
};
//
const checkConfigRef = ref()
const handleCheckConfig= (id:any) => {
checkConfigRef.value.showModal(id);
};
</script>
<style scoped></style>

87
src/views/project/IOCheck/checkRating/ratingModal.vue

@ -1,5 +1,5 @@
<template>
<a-modal v-model:open="visible" :title="title" @ok="handleOk" width="50%">
<a-modal v-model:open="visible" :title="title" @ok="handleOk" width="80%">
<a-table :dataSource="dataSource" :columns="columns" bordered>
<template #summary>
<a-table-summary-row>
@ -11,19 +11,19 @@
<a-typography-text />
</a-table-summary-cell>
<a-table-summary-cell>
<a-typography-text type="danger">{{ totals.sumRating }}</a-typography-text>
<a-typography-text>{{ totals.sumRating }}</a-typography-text>
</a-table-summary-cell>
<a-table-summary-cell>
<a-typography-text>{{ totals.subRating }}</a-typography-text>
</a-table-summary-cell>
<a-table-summary-cell>
<a-typography-text type="danger">{{ totals.currentRating }}</a-typography-text>
<a-typography-text type="danger">{{ totals.subRating }}</a-typography-text>
</a-table-summary-cell>
</a-table-summary-row>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column && record && column.key === 'subRating'">
<a-input v-model:value="record.subRating" />
<a-input v-model:value="record.subRating" :disabled="title=='评分详情'"/>
</template>
<template v-if="column && record && column.key === 'remark'" >
<a-input v-model:value="record.remark" :disabled="title=='评分详情'"/>
</template>
</template>
</a-table>
@ -32,13 +32,17 @@
<script>
import { computed, ref } from 'vue';
import {
queryByFlag,
batchEdit,
} from './api';
import { message } from 'ant-design-vue';
export default {
setup() {
const title = ref('详情');
const visible = ref(false);
const rowSpanMap = ref([]);
const columns = [
{
title: '评分大类',
@ -57,8 +61,8 @@
},
{
title: '扣分标准',
dataIndex: 'subStandards',
key: 'subStandards',
dataIndex: 'standards',
key: 'standards',
},
{
title: '总分',
@ -76,48 +80,7 @@
key: 'remark',
},
];
const dataSource = ref([
{
largeRating: '1',
smallRating: '2',
subStandards: 'ss',
sumRating: 100,
subRating: 7,
remark: '天上飞',
},
{
largeRating: '1',
smallRating: '4',
subStandards: 'ssfdf',
sumRating: 92,
subRating: 9,
remark: '郭德纲',
},
{
largeRating: '24',
smallRating: '4',
subStandards: 'ssfdf',
sumRating: 92,
subRating: 9,
remark: 'dsd',
},
{
largeRating: '24',
smallRating: '4',
subStandards: 'ssfdf',
sumRating: 92,
subRating: 7,
remark: '周杰伦',
},
{
largeRating: '24',
smallRating: '4',
subStandards: 'ssfdf',
sumRating: 92,
subRating: 4,
remark: '时候多',
},
]);
const dataSource = ref([]);
const getRowSpanMap = () => {
const spans = [];
let k = 0; //
@ -144,7 +107,7 @@
rowSpanMap.value = spans;
};
getRowSpanMap();
//
const totals = computed(() => {
let sumRating = 0;
@ -161,14 +124,22 @@
currentRating,
};
});
const showModal = (type, id) => {
const showModal = async(type, id) => {
visible.value = true;
if (type == 1) {
console.log(id);
visible.value = true;
title.value = '评分';
} else if (type == 2) {
title.value = '评分详情';
}
const data = await queryByFlag({flag:id});
dataSource.value = data
getRowSpanMap();
};
const handleOk = () => {
console.log('submit');
batchEdit(dataSource.value).then(_=>{
message.success('操作成功')
visible.value = false
})
};
return {
visible,

23
src/views/project/IOCheck/ratingSearch/api.ts

@ -1,13 +1,19 @@
import { ID, IDS, PageQuery, commonExport } from '@/api/base';
import { commonExport } from '@/api/base';
import { defHttp } from '@/utils/http/axios';
enum Api {
root = '/workflow/leave',
list = '/workflow/leave/list',
root = '/platform/evaluationInfo',
list = '/platform/evaluationInfo/listForScore',
export = '/workflow/leave/export',
getProjectInfo = '/platform/projectInfo/getNames',
}
export function list(params?: PageQuery) {
export function list(params?: any) {
return defHttp.get({ url: Api.list, params });
}
@ -15,7 +21,7 @@ export function exportExcel(data: any) {
return commonExport(Api.export, data);
}
export function getInfo(id: ID) {
export function getInfo(id: any) {
return defHttp.get({ url: `${Api.root}/${id}` });
}
@ -27,6 +33,9 @@ export function update(data: any) {
return defHttp.put({ url: Api.root, data });
}
export function removeByIds(ids: IDS) {
return defHttp.deleteWithMsg({ url: `${Api.root}/${ids.join(',')}` });
export function removeByIds(ids: any) {
return defHttp.deleteWithMsg<void>({ url: `${Api.root}/${ids.join(',')}` });
}
export function getProjectInfo() {
return defHttp.get({ url: Api.getProjectInfo });
}

30
src/views/project/IOCheck/ratingSearch/data.ts

@ -3,24 +3,10 @@ import { FormSchema } from '@/components/Form';
export const formSchemas: FormSchema[] = [
{
field: 'projectName',
field: 'checkProject',
label: '项目名称',
component: 'Select',
componentProps: {
options: [
{
value: '1',
label: '2323',
},
{
value: '2',
label: '2323',
},
{
value: '3',
label: '2323',
},
],
},
},
{
@ -28,8 +14,9 @@ export const formSchemas: FormSchema[] = [
label: '考核时间',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
format: 'YYYY-MM',
valueFormat: 'YYYY-MM',
picker:'month'
},
},
];
@ -37,7 +24,7 @@ export const formSchemas: FormSchema[] = [
export const columns: BasicColumn[] = [
{
title: '运维单位',
dataIndex: 'ioUnit',
dataIndex: 'ioCompany',
},
{
title: '考核项目',
@ -49,6 +36,11 @@ export const columns: BasicColumn[] = [
},
{
title: '分值',
dataIndex: 'rating',
dataIndex: 'checkRating',
customRender:({value}) =>{
if(!value){
return '暂未评分'
}
}
},
];

40
src/views/project/IOCheck/ratingSearch/detailDrawer.vue

@ -2,7 +2,7 @@
<div>
<!-- 抽屉组件 -->
<a-drawer
title="详情"
title="折线图"
placement="right"
:closable="true"
:open="visible"
@ -15,7 +15,7 @@
</template>
<script>
import { ref } from 'vue';
import { reactive, ref } from 'vue';
import { useECharts } from '@/hooks/web/useECharts';
// import { getInfo } from './api';
@ -23,22 +23,14 @@
setup() {
//
const chartRef = ref();
const { setOptions } = useECharts(chartRef);
const visible = ref(false);
const showDrawer = () => {
visible.value = true;
console.log('11');
setOptions(options);
};
//
const onClose = () => {
visible.value = false;
};
const options = {
const options = reactive({
title: {
text: '成绩查询',
},
tooltip: {
trigger: 'axis',
},
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
@ -48,10 +40,28 @@
},
series: [
{
data: [150, 230, 224, 218, 135, 147, 260],
data: [],
type: 'line',
},
],
});
const visible = ref(false);
const showDrawer = (data) => {
visible.value = true;
console.log(data);
let xline = [];
let yline = [];
data.forEach((i) => {
xline.push(i.ioCompany);
yline.push(i.checkRating);
});
options.xAxis.data = xline;
options.series[0].data = yline;
setOptions(options);
};
//
const onClose = () => {
visible.value = false;
};
return {

42
src/views/project/IOCheck/ratingSearch/index.vue

@ -3,12 +3,7 @@
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="handleDetail">导出</a-button>
<a-button type="link" @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>
<a-button type="primary" @click="handleDetail" v-if="getDataSource().length>0">折线图</a-button>
</template>
</BasicTable>
<detailDrawer ref="detailDrawerRef" />
@ -18,14 +13,17 @@
<script setup lang="ts">
import { PageWrapper } from '@/components/Page';
import { BasicTable, useTable } from '@/components/Table';
import { list } from './api';
import { list,getProjectInfo } from './api';
import { formSchemas, columns } from './data';
import detailDrawer from './detailDrawer.vue';
import { ref } from 'vue';
import { ref} from 'vue';
defineOptions({ name: 'RatingSearch' });
const [registerTable] = useTable({
// const newFormSchemas: any = computed(() => {
// return formSchemas;
// });
const [registerTable,{getDataSource}] = useTable({
rowSelection: {
type: 'checkbox',
},
@ -44,19 +42,29 @@
lg: 6,
},
},
immediate:false,
columns: columns,
actionColumn: {
width: 200,
title: '操作',
key: 'action',
fixed: 'right',
},
});
//
const detailDrawerRef = ref();
const handleDetail = () => {
detailDrawerRef.value.showDrawer();
const data = getDataSource()
detailDrawerRef.value.showDrawer(data);
};
const projectOptions = ref([]);
const getProjectOptions = async () => {
const res = await getProjectInfo();
res.forEach((i: any) => {
i.value = i.projectName;
i.label = i.projectName;
});
projectOptions.value = res;
formSchemas[0].componentProps.options = projectOptions.value;
};
const getOptions = () => {
getProjectOptions();
};
getOptions();
</script>
<style scoped></style>

4
src/views/project/contractManage/addModal.vue

@ -276,7 +276,7 @@
params.endDate = params.contractDuration[1];
add(params).then((_) => {
message.success('新增成功');
visible.value = false;
closeModal()
});
} else {
let params = {};
@ -287,7 +287,7 @@
params.endDate = params.contractDuration[1];
update(params).then((_) => {
message.success('编辑成功');
visible.value = false;
closeModal()
});
}
}

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

@ -1,6 +1,6 @@
<template>
<a-modal v-model:open="visible" title="工单上报" @ok="handleOk" width="70%">
<a-form :model="form" layout="vertical">
<a-modal v-model:open="visible" title="工单上报" @ok="handleOk" width="70%" @cancel="closeModal">
<a-form :model="form" layout="vertical" ref="formRef" :rules="rules">
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="所属项目" name="projectName">
@ -24,7 +24,7 @@
/>
</a-form-item>
</a-col>
</a-row>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="12">
<a-form-item label="是否事故" name="isAccident">
@ -142,7 +142,7 @@
<script>
import { reactive, ref } from 'vue';
import { getInfo, getSubcategoryType, workOrderAdd,getContractNamesByProjectName } from './api';
import { getInfo, getSubcategoryType, workOrderAdd, getContractNamesByProjectName } from './api';
import { message } from 'ant-design-vue';
import AMapLoader from '@amap/amap-jsapi-loader';
export default {
@ -150,7 +150,7 @@
const visible = ref(false);
const form = reactive({
projectName: '',
contractName:null,
contractName: null,
isAccident: null,
repairer: '',
responseTime: '',
@ -165,7 +165,7 @@
maintenanceRequirement: null,
dispatchOpinion: '',
longitude: '',
latitude: '',
latitude: '',
});
//
const responseLevelOptions = [
@ -189,7 +189,7 @@
},
];
const faultSubcategoryOptions = ref([]);
const contractNameOptions = ref([])
const contractNameOptions = ref([]);
const getOptions = async () => {
const res = await getSubcategoryType();
faultSubcategoryOptions.value = res.rows;
@ -197,34 +197,37 @@
getOptions();
const showModal = async (id) => {
visible.value = true;
const data = await getInfo(id);
for (let i in form) {
form[i] = data[i];
}
const res = await getContractNamesByProjectName({projectName:form.projectName})
contractNameOptions.value = res
initMap(form.longitude,form.latitude,form.organizationName);
const res = await getContractNamesByProjectName({ projectName: form.projectName });
contractNameOptions.value = res;
initMap(form.longitude, form.latitude, form.organizationName);
};
const handleOk = () => {
let params = {};
for (let i in form) {
params[i] = form[i];
}
workOrderAdd(params).then((_) => {
message.success('操作成功');
visible.value = false;
formRef.value.validate().then((valid) => {
if (valid) {
let params = {};
for (let i in form) {
params[i] = form[i];
}
workOrderAdd(params).then((_) => {
message.success('操作成功');
closeModal();
});
}
});
//
};
//
const map = ref(null);
const initMap = async (longitude,latitude,organizationName) => {
const initMap = async (longitude, latitude, organizationName) => {
try {
// JavaScript API
await AMapLoader.load({
key: '786a2e7cc6d4be5ba1d6174a0aa10f2b',
key: '786a2e7cc6d4be5ba1d6174a0aa10f2b',
version: '2.0',
plugins: [],
});
@ -232,7 +235,7 @@
//
map.value = new AMap.Map('amapContainer', {
zoom: 17,
center: [longitude, latitude],
center: [longitude, latitude],
});
//
@ -246,6 +249,26 @@
console.error('加载高德地图失败:', error);
}
};
const closeModal = () => {
formRef.value.resetFields();
visible.value = false;
map.value.destroy();
};
const formRef = ref();
const rules = {
projectName: [{ required: true, message: '请选择' }],
contractName: [{ required: true, message: '请选择' }],
isAccident: [{ required: true, message: '请选择' }],
repairer: [{ required: true, message: '请输入' }],
faultLocation: [{ required: true, message: '请输入' }],
organizationName: [{ required: true, message: '请选择' }],
responseTime: [{ required: true, message: '请输入' }],
responseLevel: [{ required: true, message: '请选择' }],
faultCategory: [{ required: true, message: '请选择' }],
faultSubcategory: [{ required: true, message: '请选择' }],
faultDescription: [{ required: true, message: '请输入' }],
isDispatched: [{ required: true, message: '请选择' }],
};
return {
visible,
form,
@ -254,7 +277,10 @@
responseLevelOptions,
maintenanceRequirementOptions,
faultSubcategoryOptions,
contractNameOptions
contractNameOptions,
closeModal,
formRef,
rules,
};
},
};

Loading…
Cancel
Save