Browse Source

附件上传

ops-management-platform-frontend-dev
wbc 2 months ago
parent
commit
2d2b344de7
  1. 44
      src/views/IO/delayPatrol/waitAudit/faultModal.vue
  2. 44
      src/views/IO/delayPatrol/waitPatrol/faultModal.vue
  3. 12
      src/views/IO/patrolReport/detailDrawer.vue
  4. 4
      src/views/IO/patrolReport/patrolReportdata.ts
  5. 93
      src/views/IO/patrolReport/reportModal.vue
  6. 21
      src/views/IO/workOrder/orderSearch/api.ts
  7. 287
      src/views/IO/workOrder/orderSearch/faultModal.vue
  8. 44
      src/views/IO/workOrder/orderSend/faultModal.vue
  9. 70
      src/views/document/addModal.vue
  10. 9
      src/views/document/data.ts
  11. 6
      src/views/document/detailDrawer.vue
  12. 16
      src/views/document/index.vue
  13. 207
      src/views/notice/addModal.vue
  14. 9
      src/views/notice/api.ts
  15. 34
      src/views/notice/detailDrawer.vue
  16. 33
      src/views/notice/index.vue
  17. 5
      src/views/project/IOCheck/checkManage/addModal.vue
  18. 12
      src/views/project/IOCheck/checkManage/api.ts
  19. 14
      src/views/project/IOCheck/checkManage/data.ts
  20. 46
      src/views/project/IOCheck/checkManage/index.vue
  21. 63
      src/views/project/IOCheck/checkRating/addModal.vue
  22. 5
      src/views/project/IOCheck/checkRating/api.ts
  23. 29
      src/views/project/IOCheck/ratingSearch/index.vue
  24. 71
      src/views/project/contractManage/addModal.vue
  25. 6
      src/views/project/contractManage/detailDrawer.vue
  26. 99
      src/views/project/projectManage/addModal.vue
  27. 12
      src/views/project/projectManage/detailDrawer.vue
  28. 4
      src/views/project/serviceManage/addModal.vue
  29. 1
      src/views/property/meterial/addModal.vue
  30. 1
      src/views/property/point/addModal.vue
  31. 4
      src/views/property/point/index.vue
  32. 42
      src/views/property/point/pointModal.vue

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

@ -123,10 +123,12 @@
</a-row> </a-row>
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="故障图片" name="faultImg"> <a-form-item label="故障图片" name="attachments">
<a-upload <a-upload
v-model:file-list="form.faultImg" v-model:file-list="fileLists"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76" :action="`${apiUrl}/resource/oss/upload`"
:headers="headers"
@change="handleChange"
> >
<a-button type="primary"> 上传 </a-button> <a-button type="primary"> 上传 </a-button>
</a-upload> </a-upload>
@ -174,6 +176,8 @@
} from './api'; } from './api';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import AMapLoader from '@amap/amap-jsapi-loader'; import AMapLoader from '@amap/amap-jsapi-loader';
import { getToken } from '@/utils/auth';
import { useGlobSetting } from '@/hooks/setting';
export default { export default {
setup() { setup() {
const visible = ref(false); const visible = ref(false);
@ -189,7 +193,7 @@
organizationName: '', organizationName: '',
faultLocation: '', faultLocation: '',
faultDescription: '', faultDescription: '',
faultImg: null, attachments: null,
isDispatched: null, isDispatched: null,
maintenanceRequirement: null, maintenanceRequirement: null,
dispatchOpinion: '', dispatchOpinion: '',
@ -281,7 +285,7 @@
} }
workOrderAdd(params).then((_) => { workOrderAdd(params).then((_) => {
message.success('操作成功'); message.success('操作成功');
closeModal() closeModal();
}); });
} }
}); });
@ -316,8 +320,9 @@
}; };
const closeModal = () => { const closeModal = () => {
formRef.value.resetFields(); formRef.value.resetFields();
fileLists.value=[]
visible.value = false; visible.value = false;
map.value.destroy() map.value?.destroy();
}; };
const formRef = ref(); const formRef = ref();
const rules = { const rules = {
@ -334,6 +339,26 @@
faultDescription: [{ required: true, message: '请输入' }], faultDescription: [{ required: true, message: '请输入' }],
isDispatched: [{ required: true, message: '请选择' }], isDispatched: [{ required: true, message: '请选择' }],
}; };
//
const fileLists = ref([]);
const globSetting = useGlobSetting();
const { apiUrl, clientId } = globSetting;
const handleChange = (info) => {
if (info.fileList.length > 0) {
form.attachments = [];
info.fileList.forEach((i) => {
if (i.status == 'done') {
form.attachments.push({
url: i.response?.data.url || i.url,
name: i.response?.data.fileName || i.name,
});
}
});
} else {
form.attachments = null;
}
console.log(fileLists);
};
return { return {
visible, visible,
form, form,
@ -351,6 +376,13 @@
closeModal, closeModal,
formRef, formRef,
rules, rules,
apiUrl,
headers: {
Authorization: 'Bearer ' + getToken(),
clientId,
},
handleChange,
fileLists,
}; };
}, },
}; };

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

@ -123,10 +123,12 @@
</a-row> </a-row>
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="故障图片" name="faultImg"> <a-form-item label="故障图片" name="attachments">
<a-upload <a-upload
v-model:file-list="form.faultImg" v-model:file-list="fileLists"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76" :action="`${apiUrl}/resource/oss/upload`"
:headers="headers"
@change="handleChange"
> >
<a-button type="primary"> 上传 </a-button> <a-button type="primary"> 上传 </a-button>
</a-upload> </a-upload>
@ -174,6 +176,8 @@
} from './api'; } from './api';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import AMapLoader from '@amap/amap-jsapi-loader'; import AMapLoader from '@amap/amap-jsapi-loader';
import { getToken } from '@/utils/auth';
import { useGlobSetting } from '@/hooks/setting';
export default { export default {
setup() { setup() {
const visible = ref(false); const visible = ref(false);
@ -189,7 +193,7 @@
organizationName: '', organizationName: '',
faultLocation: '', faultLocation: '',
faultDescription: '', faultDescription: '',
faultImg: null, attachments: null,
isDispatched: null, isDispatched: null,
maintenanceRequirement: null, maintenanceRequirement: null,
dispatchOpinion: '', dispatchOpinion: '',
@ -281,7 +285,7 @@
} }
workOrderAdd(params).then((_) => { workOrderAdd(params).then((_) => {
message.success('操作成功'); message.success('操作成功');
closeModal() closeModal();
}); });
} }
}); });
@ -316,8 +320,9 @@
}; };
const closeModal = () => { const closeModal = () => {
formRef.value.resetFields(); formRef.value.resetFields();
fileLists.value=[]
visible.value = false; visible.value = false;
map.value.destroy() map.value?.destroy();
}; };
const formRef = ref(); const formRef = ref();
const rules = { const rules = {
@ -334,6 +339,26 @@
faultDescription: [{ required: true, message: '请输入' }], faultDescription: [{ required: true, message: '请输入' }],
isDispatched: [{ required: true, message: '请选择' }], isDispatched: [{ required: true, message: '请选择' }],
}; };
//
const fileLists = ref([]);
const globSetting = useGlobSetting();
const { apiUrl, clientId } = globSetting;
const handleChange = (info) => {
if (info.fileList.length > 0) {
form.attachments = [];
info.fileList.forEach((i) => {
if (i.status == 'done') {
form.attachments.push({
url: i.response?.data.url || i.url,
name: i.response?.data.fileName || i.name,
});
}
});
} else {
form.attachments = null;
}
console.log(fileLists);
};
return { return {
visible, visible,
form, form,
@ -351,6 +376,13 @@
closeModal, closeModal,
formRef, formRef,
rules, rules,
apiUrl,
headers: {
Authorization: 'Bearer ' + getToken(),
clientId,
},
handleChange,
fileLists,
}; };
}, },
}; };

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

@ -44,16 +44,6 @@
<div><span class="titleLabel">问题处理</span>{{ detail.problemHandleDesc }}</div> <div><span class="titleLabel">问题处理</span>{{ detail.problemHandleDesc }}</div>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div><span class="titleLabel">附件</span>{{ detail.attachment }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div><span class="titleLabel">巡检照片</span>{{ detail.inspectionPhoto }}</div>
</a-col>
</a-row>
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</a-drawer> </a-drawer>
@ -75,8 +65,6 @@
inspectionPeople: '', inspectionPeople: '',
inspectionStatus: '', inspectionStatus: '',
problemHandleDesc: '', problemHandleDesc: '',
attachment: null,
inspectionPhoto: null,
}); });
// //

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

@ -26,6 +26,10 @@ export const columns: BasicColumn[] = [
title: '巡检单位', title: '巡检单位',
dataIndex: 'inspectionUnit', dataIndex: 'inspectionUnit',
}, },
{
title: '巡检部位',
dataIndex: 'inspectionPart',
},
{ {
title: '类型', title: '类型',
dataIndex: 'type', dataIndex: 'type',

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

@ -56,10 +56,12 @@
</div> </div>
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="附件" name="attachment"> <a-form-item label="附件" name="attachments">
<a-upload <a-upload
v-model:file-list="form.attachment" v-model:file-list="fileLists"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76" :action="`${apiUrl}/resource/oss/upload`"
:headers="headers"
@change="handleChange"
> >
<a-button type="primary"> 上传 </a-button> <a-button type="primary"> 上传 </a-button>
</a-upload> </a-upload>
@ -68,10 +70,12 @@
</a-row> </a-row>
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="巡检照片" name="inspectionPhoto"> <a-form-item label="巡检照片" name="inspectionPhotos">
<a-upload <a-upload
v-model:file-list="form.inspectionPhoto" v-model:file-list="inspectionPhotoLists"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76" :action="`${apiUrl}/resource/oss/upload`"
:headers="headers"
@change="handlePhotoChange"
> >
<a-button type="primary"> 上传 </a-button> <a-button type="primary"> 上传 </a-button>
</a-upload> </a-upload>
@ -95,6 +99,8 @@
import { reactive, ref, onMounted } from 'vue'; import { reactive, ref, onMounted } from 'vue';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import { getInfo, add, update, getProjectInfo } from './api'; import { getInfo, add, update, getProjectInfo } from './api';
import { getToken } from '@/utils/auth';
import { useGlobSetting } from '@/hooks/setting';
export default { export default {
setup() { setup() {
const title = ref('新增'); const title = ref('新增');
@ -109,8 +115,8 @@
platformOnlineRate: null, platformOnlineRate: null,
problemHandleDesc: '', problemHandleDesc: '',
inspectionStatus: null, inspectionStatus: null,
attachment: null, attachments: null,
inspectionPhoto: null, inspectionPhotos: null,
id: null, id: null,
}); });
// //
@ -167,6 +173,24 @@
for (let i in form) { for (let i in form) {
form[i] = data[i]; form[i] = data[i];
} }
if(form.attachments&&form.attachments.length>0){
form.attachments.forEach(i=>{
fileLists.value.push({
url:i.url,
name:i.name,
status:'done'
})
})
}
if(form.inspectionPhotos&&form.inspectionPhotos.length>0){
form.inspectionPhotos.forEach(i=>{
inspectionPhotoLists.value.push({
url:i.url,
name:i.name,
status:'done'
})
})
}
} }
visible.value = true; visible.value = true;
getProjectOptions() getProjectOptions()
@ -180,9 +204,10 @@
for (let i in form) { for (let i in form) {
params[i] = form[i]; params[i] = form[i];
} }
delete params.id
add(params).then((_) => { add(params).then((_) => {
message.success('新增成功'); message.success('新增成功');
visible.value = false; closeModal()
}); });
} else { } else {
let params = {}; let params = {};
@ -191,13 +216,15 @@
} }
update(params).then((_) => { update(params).then((_) => {
message.success('编辑成功'); message.success('编辑成功');
visible.value = false; closeModal()
}); });
} }
} }
}); });
}; };
const closeModal = () => { const closeModal = () => {
fileLists.value = []
inspectionPhotoLists.value =[]
formRef.value.resetFields(); formRef.value.resetFields();
visible.value = false; visible.value = false;
}; };
@ -210,6 +237,43 @@
problemHandleDesc: [{ required: true, message: '请输入' }], problemHandleDesc: [{ required: true, message: '请输入' }],
inspectionStatus: [{ required: true, message: '请输入' }], inspectionStatus: [{ required: true, message: '请输入' }],
}; };
//
const fileLists = ref([]);
const inspectionPhotoLists = ref([])
const globSetting = useGlobSetting();
const { apiUrl, clientId } = globSetting;
const handleChange = (info) => {
if (info.fileList.length > 0) {
form.attachments = []
info.fileList.forEach(i=>{
if(i.status == 'done'){
form.attachments.push({
url:i.response?.data.url || i.url,
name:i.response?.data.fileName ||i.name,
})
}
})
}else{
form.attachments = null;
}
console.log(fileLists)
};
const handlePhotoChange = (info) => {
if (info.fileList.length > 0) {
form.inspectionPhotos = []
info.fileList.forEach(i=>{
if(i.status == 'done'){
form.inspectionPhotos.push({
url:i.response?.data.url || i.url,
name:i.response?.data.fileName ||i.name,
})
}
})
}else{
form.inspectionPhotos = null;
}
console.log(fileLists)
};
return { return {
visible, visible,
title, title,
@ -224,6 +288,15 @@
formRef, formRef,
rules, rules,
closeModal, closeModal,
apiUrl,
headers: {
Authorization: 'Bearer ' + getToken(),
clientId,
},
handleChange,
handlePhotoChange,
fileLists,
inspectionPhotoLists
}; };
}, },
}; };

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

@ -5,6 +5,11 @@ enum Api {
root = '/platform/workOrder', root = '/platform/workOrder',
list = '/platform/workOrder/list', list = '/platform/workOrder/list',
export = '/workflow/leave/export', 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) { export function list(params?: PageQuery) {
@ -30,3 +35,19 @@ export function update(data: any) {
export function removeByIds(ids: any) { export function removeByIds(ids: any) {
return defHttp.deleteWithMsg({ url: `${Api.root}/${ids.join(',')}` }); return defHttp.deleteWithMsg({ url: `${Api.root}/${ids.join(',')}` });
} }
export function 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 });
}

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

@ -1,6 +1,6 @@
<template> <template>
<a-modal v-model:open="visible" title="工单上报" @ok="handleOk" width="70%"> <a-modal v-model:open="visible" title="工单上报" @ok="handleOk" width="70%" @cancel="closeModal">
<a-form :model="form" layout="vertical"> <a-form :model="form" layout="vertical" ref="formRef" :rules="rules">
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="所属项目" name="projectName"> <a-form-item label="所属项目" name="projectName">
@ -8,6 +8,29 @@
v-model:value="form.projectName" v-model:value="form.projectName"
:options="projectNameOptions" :options="projectNameOptions"
placeholder="请选择" 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-form-item>
</a-col> </a-col>
@ -23,23 +46,19 @@
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-item label="报修人员" name="repairer"> <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-form-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="响应级别"> <a-form-item label="响应级别" name="responseLevel">
<a-select <a-select v-model:value="form.responseLevel" :options="responseLevelOptions" />
v-model:value="form.responseLevel"
:options="responseLevelOptions"
placeholder="请选择"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-item label="响应时限"> <a-form-item label="响应时限" name="responseTime">
<a-input v-model:value="form.responseTime" placeholder="请输入" /> <a-input v-model:value="form.responseTime" />
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@ -48,8 +67,7 @@
<a-form-item label="故障大类" name="faultCategory"> <a-form-item label="故障大类" name="faultCategory">
<a-select <a-select
v-model:value="form.faultCategory" v-model:value="form.faultCategory"
:options="[{ value: '前端' }]" :options="[{ value: '前端' }, { value: '后端' }]"
placeholder="请选择"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
@ -58,40 +76,59 @@
<a-select <a-select
v-model:value="form.faultSubcategory" v-model:value="form.faultSubcategory"
:options="faultSubcategoryOptions" :options="faultSubcategoryOptions"
placeholder="请选择" :fieldNames="{
label: 'typeName',
value: 'id',
options: 'options',
}"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="故障机构" name="institution"> <a-form-item label="所属机构" name="organizationName">
<a-select <a-select
v-model:value="form.institution" v-model:value="form.organizationName"
:options="institutionOptions" :options="organizationNameOptions"
placeholder="请选择" :fieldNames="{
label: 'organizationName',
value: 'organizationName',
options: 'options',
}"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-item label="故障地点" name="faultLocation"> <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-form-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div id="amapContainer" style="width: 100%; height: 500px"></div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="故障描述" name="faultDescription"> <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-form-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="故障图片" name="faultImg"> <a-form-item label="故障图片" name="attachments">
<a-upload <a-upload
v-model:file-list="form.faultImg" v-model:file-list="fileLists"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76" :action="`${apiUrl}/resource/oss/upload`"
:headers="headers"
@change="handleChange"
> >
<a-button type="primary"> 上传 </a-button> <a-button type="primary"> 上传 </a-button>
</a-upload> </a-upload>
@ -112,7 +149,6 @@
<a-select <a-select
v-model:value="form.maintenanceRequirement" v-model:value="form.maintenanceRequirement"
:options="maintenanceRequirementOptions" :options="maintenanceRequirementOptions"
placeholder="请选择"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
@ -120,7 +156,7 @@
<a-row :gutter="[16, 16]" v-if="form.isDispatched == 1"> <a-row :gutter="[16, 16]" v-if="form.isDispatched == 1">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="派遣意见" name="dispatchOpinion"> <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-form-item>
</a-col> </a-col>
</a-row> </a-row>
@ -130,27 +166,56 @@
<script> <script>
import { reactive, ref } from 'vue'; 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';
import { getToken } from '@/utils/auth';
import { useGlobSetting } from '@/hooks/setting';
export default { export default {
setup() { setup() {
const visible = ref(false); const visible = ref(false);
const form = reactive({ const form = reactive({
projectName: '', projectName: '',
contractName: null,
isAccident: null, isAccident: null,
repairer: '', repairer: '',
responseTime: '', responseTime: '',
responseLevel: '', responseLevel: '',
faultCategory: '', faultCategory: null,
faultSubcategory: '', faultSubcategory: null,
institution: '', organizationName: '',
faultLocation: '', faultLocation: '',
faultDescription: '', faultDescription: '',
faultImg: [], attachments: null,
isDispatched: null, isDispatched: null,
maintenanceRequirement: '', maintenanceRequirement: null,
dispatchOpinion: '', 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 = [ const responseLevelOptions = [
{ {
value: 0, value: 0,
@ -166,57 +231,134 @@
}, },
]; ];
const maintenanceRequirementOptions = [ const maintenanceRequirementOptions = [
{
value: 0,
label: '常规',
},
{
value: 1,
label: '紧急',
},
{
value: 2,
label: '特级',
},
];
const institutionOptions = [
{
value: 0,
label: '常规',
},
{ {
value: 1, value: 1,
label: '紧急', label: '新增',
},
{
value: 2,
label: '特级',
}, },
]; ];
const faultSubcategoryOptions = [ const faultLocationOptions = [
{ {
value: 0, value: '1',
label: '常规', label: 'a',
latitude: '29.8537459',
longitude: '121.5591519',
}, },
{ {
value: 1, value: '2',
label: '紧急', label: 'b',
latitude: '29.8572957 ',
longitude: '121.5611743',
}, },
{ {
value: 2, value: '3',
label: '特级', 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 = () => { const showModal = () => {
visible.value = true; visible.value = true;
getFaultSubcategoryOptions();
getProjectNameOptions();
getOrganizationNameOptions();
}; };
const handleOk = () => { const handleOk = () => {
console.log('Form Data:', form); formRef.value.validate().then((valid) => {
// if (valid) {
visible.value = false; 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) => {
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 closeModal = () => {
formRef.value.resetFields();
fileLists.value=[]
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: '请选择' }],
};
//
const fileLists = ref([]);
const globSetting = useGlobSetting();
const { apiUrl, clientId } = globSetting;
const handleChange = (info) => {
if (info.fileList.length > 0) {
form.attachments = [];
info.fileList.forEach((i) => {
if (i.status == 'done') {
form.attachments.push({
url: i.response?.data.url || i.url,
name: i.response?.data.fileName || i.name,
});
}
});
} else {
form.attachments = null;
}
console.log(fileLists);
};
return { return {
visible, visible,
form, form,
@ -224,8 +366,23 @@
handleOk, handleOk,
responseLevelOptions, responseLevelOptions,
maintenanceRequirementOptions, maintenanceRequirementOptions,
institutionOptions,
faultSubcategoryOptions, faultSubcategoryOptions,
faultLocationOptions,
projectNameOptions,
contractNameOptions,
organizationNameOptions,
faultLocationChange,
projectNameChange,
closeModal,
formRef,
rules,
apiUrl,
headers: {
Authorization: 'Bearer ' + getToken(),
clientId,
},
handleChange,
fileLists,
}; };
}, },
}; };

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

@ -123,10 +123,12 @@
</a-row> </a-row>
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="故障图片" name="faultImg"> <a-form-item label="故障图片" name="attachments">
<a-upload <a-upload
v-model:file-list="form.faultImg" v-model:file-list="fileLists"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76" :action="`${apiUrl}/resource/oss/upload`"
:headers="headers"
@change="handleChange"
> >
<a-button type="primary"> 上传 </a-button> <a-button type="primary"> 上传 </a-button>
</a-upload> </a-upload>
@ -174,6 +176,8 @@
} from './api'; } from './api';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import AMapLoader from '@amap/amap-jsapi-loader'; import AMapLoader from '@amap/amap-jsapi-loader';
import { getToken } from '@/utils/auth';
import { useGlobSetting } from '@/hooks/setting';
export default { export default {
setup() { setup() {
const visible = ref(false); const visible = ref(false);
@ -189,7 +193,7 @@
organizationName: '', organizationName: '',
faultLocation: '', faultLocation: '',
faultDescription: '', faultDescription: '',
faultImg: null, attachments: null,
isDispatched: null, isDispatched: null,
maintenanceRequirement: null, maintenanceRequirement: null,
dispatchOpinion: '', dispatchOpinion: '',
@ -281,7 +285,7 @@
} }
workOrderAdd(params).then((_) => { workOrderAdd(params).then((_) => {
message.success('操作成功'); message.success('操作成功');
closeModal() closeModal();
}); });
} }
}); });
@ -316,8 +320,9 @@
}; };
const closeModal = () => { const closeModal = () => {
formRef.value.resetFields(); formRef.value.resetFields();
fileLists.value=[]
visible.value = false; visible.value = false;
map.value.destroy() map.value?.destroy();
}; };
const formRef = ref(); const formRef = ref();
const rules = { const rules = {
@ -334,6 +339,26 @@
faultDescription: [{ required: true, message: '请输入' }], faultDescription: [{ required: true, message: '请输入' }],
isDispatched: [{ required: true, message: '请选择' }], isDispatched: [{ required: true, message: '请选择' }],
}; };
//
const fileLists = ref([]);
const globSetting = useGlobSetting();
const { apiUrl, clientId } = globSetting;
const handleChange = (info) => {
if (info.fileList.length > 0) {
form.attachments = [];
info.fileList.forEach((i) => {
if (i.status == 'done') {
form.attachments.push({
url: i.response?.data.url || i.url,
name: i.response?.data.fileName || i.name,
});
}
});
} else {
form.attachments = null;
}
console.log(fileLists);
};
return { return {
visible, visible,
form, form,
@ -351,6 +376,13 @@
closeModal, closeModal,
formRef, formRef,
rules, rules,
apiUrl,
headers: {
Authorization: 'Bearer ' + getToken(),
clientId,
},
handleChange,
fileLists,
}; };
}, },
}; };

70
src/views/document/addModal.vue

@ -34,12 +34,12 @@
</a-row> </a-row>
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="附件" name="attachment"> <a-form-item label="附件" name="attachments">
<a-upload <a-upload
:before-upload="beforeUpload" v-model:file-list="fileLists"
@change="importChange" :action="`${apiUrl}/resource/oss/upload`"
:file-list="fileLists" :headers="headers"
:maxCount="1" @change="handleChange"
> >
<a-button type="primary"> 上传 </a-button> <a-button type="primary"> 上传 </a-button>
</a-upload> </a-upload>
@ -52,8 +52,10 @@
<script> <script>
import { reactive, ref } from 'vue'; import { reactive, ref } from 'vue';
import { getInfo, getDocumentType } from './api'; import { getInfo, getDocumentType,add,update } from './api';
import { message } from 'ant-design-vue';
import { getToken } from '@/utils/auth';
import { useGlobSetting } from '@/hooks/setting';
export default { export default {
setup() { setup() {
const title = ref('新增'); const title = ref('新增');
@ -63,7 +65,7 @@
documentName: '', documentName: '',
type: '', type: '',
status: 0, status: 0,
attachment: null, attachments: null,
id: null, id: null,
}); });
// //
@ -72,8 +74,10 @@
const res = await getDocumentType(); const res = await getDocumentType();
typeOptions.value = res.rows; typeOptions.value = res.rows;
}; };
getOptions();
const showModal = async (type, id) => { const showModal = async (type, id) => {
visible.value = true;
getOptions();
if (type == 1) { if (type == 1) {
title.value = '新增'; title.value = '新增';
} else if (type == 2) { } else if (type == 2) {
@ -82,8 +86,16 @@
for (let i in form) { for (let i in form) {
form[i] = data[i]; form[i] = data[i];
} }
if(form.attachments&&form.attachments.length>0){
form.attachments.forEach(i=>{
fileLists.value.push({
url:i.url,
name:i.name,
status:'done'
})
})
}
} }
visible.value = true;
}; };
const rules = { const rules = {
documentName: [{ required: true, message: '请输入' }], documentName: [{ required: true, message: '请输入' }],
@ -96,9 +108,10 @@
for (let i in form) { for (let i in form) {
params[i] = form[i]; params[i] = form[i];
} }
delete params.id
add(params).then((_) => { add(params).then((_) => {
message.success('新增成功'); message.success('新增成功');
visible.value = false; closeModal()
}); });
} else { } else {
let params = {}; let params = {};
@ -107,7 +120,7 @@
} }
update(params).then((_) => { update(params).then((_) => {
message.success('编辑成功'); message.success('编辑成功');
visible.value = false; closeModal()
}); });
} }
} }
@ -115,16 +128,29 @@
}; };
const closeModal = () => { const closeModal = () => {
formRef.value.resetFields(); formRef.value.resetFields();
fileLists.value = []
visible.value = false; visible.value = false;
}; };
// //
//
const fileLists = ref([]); const fileLists = ref([]);
const beforeUpload = async (file) => { const globSetting = useGlobSetting();
form.attachment = file; const { apiUrl, clientId } = globSetting;
return false; const handleChange = (info) => {
}; if (info.fileList.length > 0) {
const importChange = ({ fileList }) => { form.attachments = [];
fileLists.value = fileList; info.fileList.forEach((i) => {
if (i.status == 'done') {
form.attachments.push({
url: i.response?.data.url || i.url,
name: i.response?.data.fileName || i.name,
});
}
});
} else {
form.attachments = null;
}
console.log(fileLists);
}; };
return { return {
visible, visible,
@ -136,9 +162,13 @@
formRef, formRef,
closeModal, closeModal,
rules, rules,
apiUrl,
headers: {
Authorization: 'Bearer ' + getToken(),
clientId,
},
handleChange,
fileLists, fileLists,
beforeUpload,
importChange,
}; };
}, },
}; };

9
src/views/document/data.ts

@ -2,6 +2,15 @@ import { BasicColumn } from '@/components/Table';
import { FormSchema } from '@/components/Form'; import { FormSchema } from '@/components/Form';
export const formSchemas: FormSchema[] = [ export const formSchemas: FormSchema[] = [
{
field: 'type',
label: '类别',
component: 'Select',
componentProps: {
options: [
],
},
},
{ {
field: 'documentName', field: 'documentName',
label: '文档名称', label: '文档名称',

6
src/views/document/detailDrawer.vue

@ -31,11 +31,6 @@
<div><span class="titleLabel">录入时间</span>{{ detail.createTime }}</div> <div><span class="titleLabel">录入时间</span>{{ detail.createTime }}</div>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div><span class="titleLabel">附件</span>{{ detail.attachment }}</div>
</a-col>
</a-row>
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</a-drawer> </a-drawer>
@ -54,7 +49,6 @@
type: '', type: '',
status: null, status: null,
createTime: '', createTime: '',
attachment: null,
}); });
// //

16
src/views/document/index.vue

@ -27,10 +27,10 @@
<script setup lang="ts"> <script setup lang="ts">
import { PageWrapper } from '@/components/Page'; import { PageWrapper } from '@/components/Page';
import { BasicTable, useTable } from '@/components/Table'; import { BasicTable, useTable } from '@/components/Table';
import { list, removeByIds } from './api'; import { list, removeByIds,getDocumentType} from './api';
import { formSchemas, columns } from './data'; import { formSchemas, columns } from './data';
import detailDrawer from './detailDrawer.vue'; import detailDrawer from './detailDrawer.vue';
import { ref } from 'vue'; import { ref,onMounted } from 'vue';
import addModal from './addModal.vue'; import addModal from './addModal.vue';
defineOptions({ name: 'Document' }); defineOptions({ name: 'Document' });
@ -80,6 +80,18 @@
await removeByIds([id]); await removeByIds([id]);
reload(); reload();
}; };
const getDocumentTypeOptions = async () => {
const res = await getDocumentType();
formSchemas[0].componentProps.options = res.rows;
formSchemas[0].componentProps.options .forEach((i:any)=>{
i.value = i.typeName,
i.label = i.typeName
})
};
onMounted(()=>{
getDocumentTypeOptions()
})
</script> </script>
<style scoped></style> <style scoped></style>

207
src/views/notice/addModal.vue

@ -1,6 +1,6 @@
<template> <template>
<a-modal v-model:open="visible" :title="title" @ok="handleOk" width="50%"> <a-modal v-model:open="visible" :title="title" @ok="handleOk" width="50%" @cancel="closeModal">
<a-form :model="form" layout="vertical"> <a-form :model="form" layout="vertical" :rules="rules" ref="formRef">
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="标题" name="title"> <a-form-item label="标题" name="title">
@ -9,15 +9,28 @@
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-item label="类型" name="type"> <a-form-item label="类型" name="type">
<a-select v-model:value="form.type" :options="typeOptions" placeholder="请选择" />
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="24">
<a-form-item label="项目" name="projectName">
<a-select <a-select
v-model:value="form.type" v-model:value="form.projectName"
:options="projectNameOptions" :options="projectNameOptions"
placeholder="请选择" placeholder="请选择"
:fieldNames="{
label: 'projectName',
value: 'projectName',
options: 'options',
}"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]" v-if="visible">
<a-col :span="24"> <a-col :span="24">
<div style="border: 1px solid #ccc"> <div style="border: 1px solid #ccc">
<Toolbar <Toolbar
@ -38,10 +51,12 @@
</a-row> </a-row>
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="附件" name="attachment"> <a-form-item label="附件" name="attachments">
<a-upload <a-upload
v-model:file-list="form.attachment" v-model:file-list="fileLists"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76" :action="`${apiUrl}/resource/oss/upload`"
:headers="headers"
@change="handleChange"
> >
<a-button type="primary"> 上传 </a-button> <a-button type="primary"> 上传 </a-button>
</a-upload> </a-upload>
@ -53,66 +68,148 @@
</template> </template>
<script> <script>
import { reactive, ref, shallowRef, onMounted, onBeforeUnmount } from 'vue'; import { reactive, ref, shallowRef, onMounted, onBeforeUnmount, nextTick } from 'vue';
import { Editor, Toolbar } from '@wangeditor/editor-for-vue'; import { Editor, Toolbar } from '@wangeditor/editor-for-vue';
import '@wangeditor/editor/dist/css/style.css'; import '@wangeditor/editor/dist/css/style.css';
import { getInfo, add, update, getProjectInfo } from './api';
import { message } from 'ant-design-vue';
import { getToken } from '@/utils/auth';
import { useGlobSetting } from '@/hooks/setting';
export default { export default {
components: { Editor, Toolbar }, components: { Editor, Toolbar },
setup() { setup(props, { emit }) {
const title = ref('新增'); const title = ref('新增');
const formRef = ref();
const visible = ref(false); const visible = ref(false);
const form = reactive({ const form = reactive({
title: '', title: '',
type: '', type: null,
content: '<p>hello</p>', projectName: null,
attachment: [], id: null,
content: '',
attachments: null,
}); });
// //
const projectNameOptions = [ const typeOptions = [
{
value: '1',
label: 'a',
},
{ {
value: '2', value: '通知公告',
label: 'b',
}, },
{ {
value: '3', value: '规范标准',
label: 'c',
}, },
]; ];
const showModal = (type, id) => { const projectNameOptions = ref([]);
const getProjectOptions = async () => {
const res = await getProjectInfo();
projectNameOptions.value = res;
};
const showModal = async (type, id) => {
getProjectOptions();
nextTick(() => {
visible.value = true;
});
if (type == 1) { if (type == 1) {
title.value = '新增'; title.value = '新增';
Object.assign(form, {
id: null,
title: '',
type: null,
attachments: null,
projectName: null,
content: '',
});
} else if (type == 2) { } else if (type == 2) {
title.value = '编辑'; title.value = '编辑';
console.log(id); const data = await getInfo(id);
data.content = await JSON.parse(data.content);
Object.assign(form, data);
if(form.attachments&&form.attachments.length>0){
form.attachments.forEach(i=>{
fileLists.value.push({
url:i.url,
name:i.name,
status:'done'
})
})
} }
visible.value = true;
};
}
};
const rules = {
title: [{ required: true, message: '请输入' }],
type: [{ required: true, message: '请选择' }],
projectName: [{ required: true, message: '请选择' }],
};
const handleOk = () => { const handleOk = () => {
console.log('Form Data:', form); formRef.value.validate().then((valid) => {
// if (valid) {
console.log(form);
if (title.value == '新增') {
let params = {};
for (let i in form) {
params[i] = form[i];
}
params.content = JSON.stringify(params.content);
add(params).then((_) => {
message.success('新增成功');
closeModal();
emit('success');
});
} else {
let params = {};
for (let i in form) {
params[i] = form[i];
}
params.content = JSON.stringify(params.content);
update(params).then((_) => {
message.success('编辑成功');
closeModal();
emit('success');
});
}
}
});
};
const closeModal = () => {
visible.value = false; visible.value = false;
fileLists.value =[]
}; };
// //
// shallowRef // shallowRef
const editorRef = shallowRef(); const editorRef = shallowRef();
// HTML const toolbarConfig = {
excludeKeys: [
// ajax 'insertImage', // v5+
onMounted(() => { 'insertVideo', // v5+
setTimeout(() => { 'uploadImage', //
form.content = '<p>模拟 Ajax 异步设置内容</p>'; 'uploadVideo', //
}, 1500); 'editImage', //
}); 'deleteImage', //
'viewImageLink', //
'imageWidth30', //
'imageWidth50', //
],
};
const toolbarConfig = {}; const editorConfig = {
const editorConfig = { placeholder: '请输入内容...' }; placeholder: '请输入内容...',
MENU_CONF: {
uploadImage: {
disabled: true, //
},
uploadVideo: {
disabled: true, //
},
},
hoverbarKeys: {
image: { excludeKeys: ['all'] },
video: { excludeKeys: ['all'] },
},
};
// //
onBeforeUnmount(() => { onBeforeUnmount(() => {
@ -123,8 +220,29 @@
const handleCreated = (editor) => { const handleCreated = (editor) => {
editorRef.value = editor; // editor editorRef.value = editor; // editor
console.log('所有菜单键:', editor.getAllMenuKeys());
console.log('工具栏配置:', editor.getConfig().toolbarConfig);
};
//
const fileLists = ref([]);
const globSetting = useGlobSetting();
const { apiUrl, clientId } = globSetting;
const handleChange = (info) => {
if (info.fileList.length > 0) {
form.attachments = []
info.fileList.forEach(i=>{
if(i.status == 'done'){
form.attachments.push({
url:i.response?.data.url || i.url,
name:i.response?.data.fileName ||i.name,
})
}
})
}else{
form.attachments = null;
}
console.log(fileLists)
}; };
return { return {
visible, visible,
title, title,
@ -132,11 +250,22 @@
showModal, showModal,
handleOk, handleOk,
projectNameOptions, projectNameOptions,
typeOptions,
editorRef, editorRef,
mode: 'default', mode: 'default',
toolbarConfig, toolbarConfig,
editorConfig, editorConfig,
handleCreated, handleCreated,
formRef,
rules,
closeModal,
apiUrl,
headers: {
Authorization: 'Bearer ' + getToken(),
clientId,
},
handleChange,
fileLists,
}; };
}, },
}; };

9
src/views/notice/api.ts

@ -2,9 +2,10 @@ import { ID, IDS, PageQuery, commonExport } from '@/api/base';
import { defHttp } from '@/utils/http/axios'; import { defHttp } from '@/utils/http/axios';
enum Api { enum Api {
root = '/workflow/leave', root = '/platform/noticeInfo',
list = '/workflow/leave/list', list = '/platform/noticeInfo/list',
export = '/workflow/leave/export', export = '/workflow/leave/export',
getProjectInfo = '/platform/projectInfo/getNames',
} }
export function list(params?: PageQuery) { export function list(params?: PageQuery) {
@ -30,3 +31,7 @@ export function update(data: any) {
export function removeByIds(ids: IDS) { export function removeByIds(ids: IDS) {
return defHttp.deleteWithMsg({ url: `${Api.root}/${ids.join(',')}` }); return defHttp.deleteWithMsg({ url: `${Api.root}/${ids.join(',')}` });
} }
export function getProjectInfo() {
return defHttp.get({ url: Api.getProjectInfo });
}

34
src/views/notice/detailDrawer.vue

@ -2,7 +2,7 @@
<div> <div>
<!-- 抽屉组件 --> <!-- 抽屉组件 -->
<a-drawer <a-drawer
title="合同详情" title="通知公告"
placement="right" placement="right"
:closable="true" :closable="true"
:open="visible" :open="visible"
@ -12,8 +12,8 @@
<a-tabs v-model:activeKey="activeKey"> <a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="1" tab="基本信息"> <a-tab-pane key="1" tab="基本信息">
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="24"> <a-col :span="12">
<div><span class="titleLabel">标题</span>{{ detail.title }}</div> <div style="text-align: right;font-size: large;font-weight: 600;">{{ detail.title }}</div>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
@ -37,11 +37,6 @@
<div v-html="detail.content"></div> <div v-html="detail.content"></div>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div><span class="titleLabel">附件</span>{{ detail.attachment }}</div>
</a-col>
</a-row>
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</a-drawer> </a-drawer>
@ -50,6 +45,9 @@
<script> <script>
import { reactive, ref } from 'vue'; import { reactive, ref } from 'vue';
import {
getInfo,
} from './api';
// import { getInfo } from './api'; // import { getInfo } from './api';
export default { export default {
setup() { setup() {
@ -58,23 +56,21 @@
title: '', title: '',
type: '', type: '',
handler: '', handler: '',
content: '<p>是假的是假的</p>', projectName:'',
content: '',
createTime: '', createTime: '',
attachment: [],
}); });
// //
const visible = ref(false); const visible = ref(false);
// const showDrawer = async(id) => { const showDrawer = async(id) => {
// const data = await getInfo(id) const data = await getInfo(id)
// for(let i in detail){ for(let i in detail){
// detail[i] = data[i] detail[i] = data[i]
// } }
// visible.value = true; detail.content = JSON.parse(detail.content)
// console.log(detail)
// };
const showDrawer = () => {
visible.value = true; visible.value = true;
console.log(detail)
}; };
// //
const onClose = () => { const onClose = () => {

33
src/views/notice/index.vue

@ -3,25 +3,33 @@
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleAdd">新增</a-button> <a-button type="primary" @click="handleAdd">新增</a-button>
<a-button type="link" @click="handleDetail">详情</a-button>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column && record && column.key === 'action'"> <template v-if="column && record && column.key === 'action'">
<!-- <a-button type="link" @click="handleEdit(record.id)">编辑</a-button> <template v-if="column && record && column.key === 'action'">
<a-button type="link" @click="handleDelete(record.id)">删除</a-button> --> <a-button type="link" @click="handleEdit(record.id)">编辑</a-button>
<a-button type="link" @click="handleDetail">详情</a-button> <a-popconfirm
title="确定要删除吗?"
ok-text="是"
cancel-text="否"
@confirm="handleDelete(record.id)"
>
<a-button type="link">删除</a-button>
</a-popconfirm>
</template>
<a-button type="link" @click="handleDetail(record.id)">详情</a-button>
</template> </template>
</template> </template>
</BasicTable> </BasicTable>
<detailDrawer ref="detailDrawerRef" /> <detailDrawer ref="detailDrawerRef" />
<addModal ref="addModalRef" /> <addModal ref="addModalRef" @success="reload()" />
</PageWrapper> </PageWrapper>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { PageWrapper } from '@/components/Page'; import { PageWrapper } from '@/components/Page';
import { BasicTable, useTable } from '@/components/Table'; import { BasicTable, useTable } from '@/components/Table';
import { list } from './api'; import { list,removeByIds} from './api';
import { formSchemas, columns } from './data'; import { formSchemas, columns } from './data';
import detailDrawer from './detailDrawer.vue'; import detailDrawer from './detailDrawer.vue';
import { ref } from 'vue'; import { ref } from 'vue';
@ -29,7 +37,7 @@
defineOptions({ name: 'Document' }); defineOptions({ name: 'Document' });
const [registerTable] = useTable({ const [registerTable,{reload}] = useTable({
rowSelection: { rowSelection: {
type: 'checkbox', type: 'checkbox',
}, },
@ -59,14 +67,21 @@
// //
const detailDrawerRef = ref(); const detailDrawerRef = ref();
const handleDetail = () => { const handleDetail = (id: any) => {
detailDrawerRef.value.showDrawer(); detailDrawerRef.value.showDrawer(id);
};
const handleDelete = async (id: any) => {
await removeByIds([id]);
reload();
}; };
// //
const addModalRef = ref(); const addModalRef = ref();
const handleAdd = () => { const handleAdd = () => {
addModalRef.value.showModal(1); addModalRef.value.showModal(1);
}; };
const handleEdit = (id: any) => {
addModalRef.value.showModal(2, id);
};
</script> </script>
<style scoped></style> <style scoped></style>

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

@ -74,7 +74,7 @@
} from './api'; } from './api';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
export default { export default {
setup() { setup(props,{emit}) {
const title = ref('新增'); const title = ref('新增');
const visible = ref(false); const visible = ref(false);
const form = reactive({ const form = reactive({
@ -120,9 +120,11 @@
for (let i in form) { for (let i in form) {
params[i] = form[i]; params[i] = form[i];
} }
delete params.id
add(params).then((_) => { add(params).then((_) => {
message.success('新增成功'); message.success('新增成功');
closeModal() closeModal()
emit('success')
}); });
} else { } else {
let params = {}; let params = {};
@ -132,6 +134,7 @@
update(params).then((_) => { update(params).then((_) => {
message.success('编辑成功'); message.success('编辑成功');
closeModal() closeModal()
emit('success')
}); });
} }
} }

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

@ -5,9 +5,11 @@ import { defHttp } from '@/utils/http/axios';
enum Api { enum Api {
root = '/platform/management', root = '/platform/management',
list = '/platform/management/list', list = '/platform/management/list',
export = '/workflow/leave/export', export = '/platform/management/export',
getCheckType = '/platform/checkType/list', getCheckType = '/platform/checkType/list',
getLargeRatingType = '/platform/largeRatingType/list', getLargeRatingType = '/platform/largeRatingType/list',
listUpload='/platform/management/uploadFromExcel'
} }
@ -43,3 +45,11 @@ export function getCheckType() {
export function getLargeRatingType() { export function getLargeRatingType() {
return defHttp.get({ url: Api.getLargeRatingType }); return defHttp.get({ url: Api.getLargeRatingType });
} }
export function listUpload(params: any) {
return defHttp.post({
url: Api.listUpload,
headers: { 'Content-Type': 'multipart/form-data' },
params,
});
}

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

@ -3,23 +3,11 @@ import { FormSchema } from '@/components/Form';
export const formSchemas: FormSchema[] = [ export const formSchemas: FormSchema[] = [
{ {
field: 'type', field: 'checkType',
label: '考核类型', label: '考核类型',
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options: [ options: [
{
value: '1',
label: '2323',
},
{
value: '2',
label: '2323',
},
{
value: '3',
label: '2323',
},
], ],
}, },
}, },

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

@ -3,8 +3,19 @@
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleAdd">新增</a-button> <a-button type="primary" @click="handleAdd">新增</a-button>
<a-button type="primary" @click="handleAdd">导入</a-button> <a-upload
<a-button type="primary" @click="handleAdd">导出</a-button> name="file"
:before-upload="beforeUpload"
@change="importChange"
:showUploadList="false"
>
<a-button type="primary"> 导入 </a-button>
</a-upload>
<a-button
v-auth="'system:role:export'"
@click="downloadExcel(exportExcel, '考核项管理', getForm().getFieldsValue())"
>导出</a-button
>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column && record && column.key === 'action'"> <template v-if="column && record && column.key === 'action'">
@ -20,21 +31,21 @@
</template> </template>
</template> </template>
</BasicTable> </BasicTable>
<addModal ref="addModalRef" /> <addModal ref="addModalRef" @success="reload()" />
</PageWrapper> </PageWrapper>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { PageWrapper } from '@/components/Page'; import { PageWrapper } from '@/components/Page';
import { BasicTable, useTable } from '@/components/Table'; import { BasicTable, useTable } from '@/components/Table';
import { list,removeByIds} from './api'; import { list, removeByIds, listUpload,getCheckType,exportExcel} from './api';
import { formSchemas, columns } from './data'; import { formSchemas, columns } from './data';
import addModal from './addModal.vue'; import addModal from './addModal.vue';
import { ref } from 'vue'; import { ref } from 'vue';
import { downloadExcel } from '@/utils/file/download';
defineOptions({ name: 'CheckManage' }); defineOptions({ name: 'CheckManage' });
const [registerTable,{reload}] = useTable({ const [registerTable, { reload,getForm }] = useTable({
rowSelection: { rowSelection: {
type: 'checkbox', type: 'checkbox',
}, },
@ -73,6 +84,29 @@
await removeByIds([id]); await removeByIds([id]);
reload(); reload();
}; };
//
const beforeUpload = async (file: any) => {
console.log(file);
const params = {
file: file,
};
await listUpload(params);
return false;
};
const importChange = () => {
reload();
};
const checkTypeOptions = ref([]);
const getCheckTypeOptions = async () => {
const res = await getCheckType();
checkTypeOptions.value = res.rows;
checkTypeOptions.value.forEach((i:any)=>{
i.value = i.name,
i.label = i.name
})
formSchemas[0].componentProps.options = checkTypeOptions.value
};
getCheckTypeOptions()
</script> </script>
<style scoped></style> <style scoped></style>

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

@ -4,7 +4,12 @@
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="运维单位" name="ioCompany"> <a-form-item label="运维单位" name="ioCompany">
<a-select v-model:value="form.ioCompany" :options="ioCompanyOptions" placeholder="请选择" /> <a-select
v-model:value="form.ioCompany"
:options="ioCompanyOptions"
placeholder="请选择"
:disabled="title == '编辑'"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@ -20,6 +25,7 @@
value: 'projectName', value: 'projectName',
options: 'options', options: 'options',
}" }"
:disabled="title == '编辑'"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
@ -27,7 +33,13 @@
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="考核时间" name="checkTime"> <a-form-item label="考核时间" name="checkTime">
<a-date-picker v-model:value="form.checkTime" placeholder="请选择" picker="month" valueFormat="YYYY-MM" format="YYYY-MM"/> <a-date-picker
v-model:value="form.checkTime"
placeholder="请选择"
picker="month"
valueFormat="YYYY-MM"
format="YYYY-MM"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@ -44,14 +56,10 @@
<script> <script>
import { reactive, ref } from 'vue'; import { reactive, ref } from 'vue';
import { import { getInfo, add, update, getProjectInfo, getIoCompanyNames, isScoreExits } from './api';
getInfo,
add,
update,
getProjectInfo,
getIoCompanyNames
} from './api';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import { error } from '@/utils/log';
import _default from 'pinia-plugin-persistedstate';
export default { export default {
setup() { setup() {
const title = ref('新增'); const title = ref('新增');
@ -61,27 +69,27 @@
checkProject: null, checkProject: null,
checkTime: '', checkTime: '',
checkName: '', checkName: '',
id:null id: null,
}); });
// //
const ioCompanyOptions = ref([]) const ioCompanyOptions = ref([]);
const checkProjectOptions = ref([]) const checkProjectOptions = ref([]);
const getIoCompanyOptions = async () => { const getIoCompanyOptions = async () => {
const res = await getIoCompanyNames() const res = await getIoCompanyNames();
ioCompanyOptions.value = res.map(i=>{ ioCompanyOptions.value = res.map((i) => {
return { return {
value:i value: i,
} };
}) });
} };
const getCheckProjectOptions = async () => { const getCheckProjectOptions = async () => {
const res = await getProjectInfo() const res = await getProjectInfo();
checkProjectOptions.value = res checkProjectOptions.value = res;
} };
const showModal = async (type, id) => { const showModal = async (type, id) => {
visible.value = true; visible.value = true;
getIoCompanyOptions() getIoCompanyOptions();
getCheckProjectOptions() getCheckProjectOptions();
if (type == 1) { if (type == 1) {
title.value = '新增'; title.value = '新增';
} else if (type == 2) { } else if (type == 2) {
@ -101,9 +109,10 @@
for (let i in form) { for (let i in form) {
params[i] = form[i]; params[i] = form[i];
} }
delete params.id
add(params).then((_) => { add(params).then((_) => {
message.success('新增成功'); message.success('新增成功');
closeModal() closeModal();
}); });
} else { } else {
let params = {}; let params = {};
@ -112,13 +121,13 @@
} }
update(params).then((_) => { update(params).then((_) => {
message.success('编辑成功'); message.success('编辑成功');
closeModal() closeModal();
}); });
} }
} }
}); });
}; };
const formRef = ref() const formRef = ref();
const rules = { const rules = {
standards: '', standards: '',
checkType: [{ required: true, message: '请选择' }], checkType: [{ required: true, message: '请选择' }],
@ -142,7 +151,7 @@
rules, rules,
closeModal, closeModal,
checkProjectOptions, checkProjectOptions,
ioCompanyOptions ioCompanyOptions,
}; };
}, },
}; };

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

@ -12,6 +12,7 @@ enum Api {
batchEdit = '/platform/evaluationTemplate/batchEdit', batchEdit = '/platform/evaluationTemplate/batchEdit',
getEvaluationTemplate = '/platform/evaluationTemplate/getTree', getEvaluationTemplate = '/platform/evaluationTemplate/getTree',
addBySelect = '/platform/evaluationInfo/addBySelect', addBySelect = '/platform/evaluationInfo/addBySelect',
isScoreExits = '/platform/evaluationInfo/isScoreExits',
} }
@ -63,3 +64,7 @@ export function getEvaluationTemplate() {
export function addBySelect(data: any) { export function addBySelect(data: any) {
return defHttp.post({ url: Api.addBySelect, data }); return defHttp.post({ url: Api.addBySelect, data });
} }
export function isScoreExits(params?: any) {
return defHttp.get({ url: Api.isScoreExits, params });
}

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

@ -23,6 +23,20 @@
// return formSchemas; // return formSchemas;
// }); // });
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();
const [registerTable,{getDataSource}] = useTable({ const [registerTable,{getDataSource}] = useTable({
rowSelection: { rowSelection: {
type: 'checkbox', type: 'checkbox',
@ -51,20 +65,7 @@
const data = getDataSource() const data = getDataSource()
detailDrawerRef.value.showDrawer(data); 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> </script>
<style scoped></style> <style scoped></style>

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

@ -154,12 +154,12 @@
</a-row> </a-row>
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="附件" name="attachment"> <a-form-item label="附件" name="attachments">
<a-upload <a-upload
:before-upload="beforeUpload" v-model:file-list="fileLists"
@change="importChange" :action="`${apiUrl}/resource/oss/upload`"
:file-list="fileLists" :headers="headers"
:maxCount="1" @change="handleChange"
> >
<a-button type="primary"> 上传 </a-button> <a-button type="primary"> 上传 </a-button>
</a-upload> </a-upload>
@ -182,13 +182,13 @@
getContractType, getContractType,
} from './api'; } from './api';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import { getToken } from '@/utils/auth';
import { useGlobSetting } from '@/hooks/setting';
export default { export default {
setup() { setup() {
const title = ref('新增'); const title = ref('新增');
const formRef = ref(); const formRef = ref();
const visible = ref(false); const visible = ref(false);
const fileLists = ref([]);
let form = reactive({ let form = reactive({
projectName: null, projectName: null,
contractName: '', contractName: '',
@ -205,7 +205,7 @@
partyBPerson: '', partyBPerson: '',
contractContent: '', contractContent: '',
remark: '', remark: '',
attachment: null, attachments: null,
id: null, id: null,
}); });
// //
@ -236,18 +236,19 @@
for (let i in form) { for (let i in form) {
form[i] = data[i]; form[i] = data[i];
} }
if (form.attachments && form.attachments.length > 0) {
form.attachments.forEach((i) => {
fileLists.value.push({
url: i.url,
name: i.name,
status: 'done',
});
});
}
form.contractDuration = [data.startDate, data.endDate]; form.contractDuration = [data.startDate, data.endDate];
} }
}; };
const beforeUpload = async (file) => {
console.log(file);
form.attachment = file;
return false;
};
const importChange = ({ fileList }) => {
fileLists.value = fileList;
console.log(fileList);
};
const rules = { const rules = {
projectName: [{ required: true, message: '请选择' }], projectName: [{ required: true, message: '请选择' }],
contractName: [{ required: true, message: '请输入' }], contractName: [{ required: true, message: '请输入' }],
@ -272,11 +273,12 @@
for (let i in form) { for (let i in form) {
params[i] = form[i]; params[i] = form[i];
} }
delete params.id;
params.startDate = params.contractDuration[0]; params.startDate = params.contractDuration[0];
params.endDate = params.contractDuration[1]; params.endDate = params.contractDuration[1];
add(params).then((_) => { add(params).then((_) => {
message.success('新增成功'); message.success('新增成功');
closeModal() closeModal();
}); });
} else { } else {
let params = {}; let params = {};
@ -287,7 +289,7 @@
params.endDate = params.contractDuration[1]; params.endDate = params.contractDuration[1];
update(params).then((_) => { update(params).then((_) => {
message.success('编辑成功'); message.success('编辑成功');
closeModal() closeModal();
}); });
} }
} }
@ -295,8 +297,29 @@
}; };
const closeModal = () => { const closeModal = () => {
formRef.value.resetFields(); formRef.value.resetFields();
fileLists.value = [];
visible.value = false; visible.value = false;
}; };
//
const fileLists = ref([]);
const globSetting = useGlobSetting();
const { apiUrl, clientId } = globSetting;
const handleChange = (info) => {
if (info.fileList.length > 0) {
form.attachments = [];
info.fileList.forEach((i) => {
if (i.status == 'done') {
form.attachments.push({
url: i.response?.data.url || i.url,
name: i.response?.data.fileName || i.name,
});
}
});
} else {
form.attachments = null;
}
console.log(fileLists);
};
return { return {
visible, visible,
title, title,
@ -305,15 +328,19 @@
handleOk, handleOk,
formRef, formRef,
closeModal, closeModal,
beforeUpload,
importChange,
fileLists,
projectNameOptions, projectNameOptions,
contractTypeOptions, contractTypeOptions,
districtOptions, districtOptions,
partyAOptions, partyAOptions,
partyBOptions, partyBOptions,
rules, rules,
apiUrl,
headers: {
Authorization: 'Bearer ' + getToken(),
clientId,
},
handleChange,
fileLists,
}; };
}, },
}; };

6
src/views/project/contractManage/detailDrawer.vue

@ -73,11 +73,6 @@
<div><span class="titleLabel">合同备注</span>{{ detail.remark }}</div> <div><span class="titleLabel">合同备注</span>{{ detail.remark }}</div>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div><span class="titleLabel">合同附件</span>{{ detail.attachment }}</div>
</a-col>
</a-row>
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</a-drawer> </a-drawer>
@ -106,7 +101,6 @@
// relatedContractAmount: null, // relatedContractAmount: null,
contractContent: '', contractContent: '',
remark: '', remark: '',
attachment: [],
}); });
// //

99
src/views/project/projectManage/addModal.vue

@ -75,26 +75,12 @@
</a-row> </a-row>
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="项目图标" name="icon"> <a-form-item label="附件" name="attachments">
<a-upload <a-upload
:before-upload="beforeUploadIcon" v-model:file-list="fileLists"
@change="importChangeIcon" :action="`${apiUrl}/resource/oss/upload`"
:file-list="iconLists" :headers="headers"
:maxCount="1" @change="handleChange"
>
<a-button type="primary"> 上传 </a-button>
</a-upload>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="附件" name="attachment">
<a-upload
:before-upload="beforeUpload"
@change="importChange"
:file-list="fileLists"
:maxCount="1"
> >
<a-button type="primary"> 上传 </a-button> <a-button type="primary"> 上传 </a-button>
</a-upload> </a-upload>
@ -109,7 +95,8 @@
import { reactive, ref } from 'vue'; import { reactive, ref } from 'vue';
import { getInfo, getFaultCategoryType, add, update } from './api'; import { getInfo, getFaultCategoryType, add, update } from './api';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import { getToken } from '@/utils/auth';
import { useGlobSetting } from '@/hooks/setting';
export default { export default {
setup() { setup() {
const title = ref('新增'); const title = ref('新增');
@ -125,8 +112,7 @@
handleOverTime: '', handleOverTime: '',
handleCost: '', handleCost: '',
projectContent: '', projectContent: '',
icon: null, attachments: null,
attachment: null,
id: null, id: null,
}); });
// //
@ -156,6 +142,7 @@
getOptions(); getOptions();
// //
const showModal = async (type, id) => { const showModal = async (type, id) => {
visible.value = true;
if (type == 1) { if (type == 1) {
title.value = '新增'; title.value = '新增';
} else if (type == 2) { } else if (type == 2) {
@ -164,9 +151,16 @@
for (let i in form) { for (let i in form) {
form[i] = data[i]; form[i] = data[i];
} }
console.log(id); if (form.attachments && form.attachments.length > 0) {
form.attachments.forEach((i) => {
fileLists.value.push({
url: i.url,
name: i.name,
status: 'done',
});
});
}
} }
visible.value = true;
}; };
// //
const rules = { const rules = {
@ -183,25 +177,11 @@
//modal //modal
const closeModal = () => { const closeModal = () => {
formRef.value.resetFields(); formRef.value.resetFields();
fileLists.value= []
visible.value = false; visible.value = false;
}; };
//
const fileLists = ref([]);
const beforeUpload = async (file) => {
form.attachment = file;
return false;
};
const importChange = ({ fileList }) => {
fileLists.value = fileList;
};
const iconLists = ref([]);
const beforeUploadIcon = async (file) => {
form.attachment = file;
return false;
};
const importChangeIcon = ({ fileList }) => {
iconLists.value = fileList;
};
// //
const handleOk = () => { const handleOk = () => {
formRef.value.validate().then((valid) => { formRef.value.validate().then((valid) => {
@ -211,9 +191,10 @@
for (let i in form) { for (let i in form) {
params[i] = form[i]; params[i] = form[i];
} }
delete params.id
add(params).then((_) => { add(params).then((_) => {
message.success('新增成功'); message.success('新增成功');
visible.value = false; closeModal()
}); });
} else { } else {
let params = {}; let params = {};
@ -222,13 +203,32 @@
} }
update(params).then((_) => { update(params).then((_) => {
message.success('编辑成功'); message.success('编辑成功');
visible.value = false; closeModal()
}); });
} }
} }
}); });
}; };
//
const fileLists = ref([]);
const globSetting = useGlobSetting();
const { apiUrl, clientId } = globSetting;
const handleChange = (info) => {
if (info.fileList.length > 0) {
form.attachments = [];
info.fileList.forEach((i) => {
if (i.status == 'done') {
form.attachments.push({
url: i.response?.data.url || i.url,
name: i.response?.data.fileName || i.name,
});
}
});
} else {
form.attachments = null;
}
console.log(fileLists);
};
return { return {
visible, visible,
title, title,
@ -240,12 +240,13 @@
rules, rules,
formRef, formRef,
closeModal, closeModal,
apiUrl,
headers: {
Authorization: 'Bearer ' + getToken(),
clientId,
},
handleChange,
fileLists, fileLists,
iconLists,
beforeUpload,
beforeUploadIcon,
importChange,
importChangeIcon,
}; };
}, },
}; };

12
src/views/project/projectManage/detailDrawer.vue

@ -80,16 +80,6 @@
<div><span class="titleLabel">项目概要</span>{{ detail.projectContent }}</div> <div><span class="titleLabel">项目概要</span>{{ detail.projectContent }}</div>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div><span class="titleLabel">项目图标</span>{{ detail.icon }}</div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-col :span="24">
<div><span class="titleLabel">项目附件</span>{{ detail.attachment }}</div>
</a-col>
</a-row>
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</a-drawer> </a-drawer>
@ -115,8 +105,6 @@
handleCost: '', handleCost: '',
relatedProjectAmount: null, relatedProjectAmount: null,
projectContent: '', projectContent: '',
icon: '',
attachment: [],
}); });
// //

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

@ -97,7 +97,8 @@
responseType: '', responseType: '',
deliverType: '', deliverType: '',
deliverResult: '', deliverResult: '',
serviceCategoryId:null serviceCategoryId:null,
id:null
}); });
// //
const deliverContentOptions = [ const deliverContentOptions = [
@ -147,6 +148,7 @@
for (let i in form) { for (let i in form) {
params[i] = form[i]; params[i] = form[i];
} }
delete params.id
add(params).then((_) => { add(params).then((_) => {
message.success('新增成功'); message.success('新增成功');
visible.value = false; visible.value = false;

1
src/views/property/meterial/addModal.vue

@ -111,6 +111,7 @@
for (let i in form) { for (let i in form) {
params[i] = form[i]; params[i] = form[i];
} }
delete params.id
add(params).then((_) => { add(params).then((_) => {
message.success('新增成功'); message.success('新增成功');
visible.value = false; visible.value = false;

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

@ -124,6 +124,7 @@
for (let i in form) { for (let i in form) {
params[i] = form[i]; params[i] = form[i];
} }
delete params.id
add(params).then((_) => { add(params).then((_) => {
message.success('新增成功'); message.success('新增成功');
visible.value = false; visible.value = false;

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

@ -96,10 +96,10 @@
// //
const addModalRef = ref(); const addModalRef = ref();
const handleAdd = () => { const handleAdd = () => {
addModalRef.value.showModal(1); addModalRef.value.showModal(1,null,checkedTree.value[0]);
}; };
const handleEdit = (id: any) => { const handleEdit = (id: any) => {
addModalRef.value.showModal(2, id); addModalRef.value.showModal(2, id,checkedTree.value[0]);
}; };
const handleDelete = async (id: any) => { const handleDelete = async (id: any) => {
await removeByIds([id]); await removeByIds([id]);

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

@ -101,10 +101,12 @@
</a-row> </a-row>
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="故障图片" name="faultImg"> <a-form-item label="故障图片" name="attachments">
<a-upload <a-upload
v-model:file-list="form.faultImg" v-model:file-list="fileLists"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76" :action="`${apiUrl}/resource/oss/upload`"
:headers="headers"
@change="handleChange"
> >
<a-button type="primary"> 上传 </a-button> <a-button type="primary"> 上传 </a-button>
</a-upload> </a-upload>
@ -145,6 +147,8 @@
import { getInfo, getSubcategoryType, workOrderAdd, getContractNamesByProjectName } from './api'; import { getInfo, getSubcategoryType, workOrderAdd, getContractNamesByProjectName } from './api';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import AMapLoader from '@amap/amap-jsapi-loader'; import AMapLoader from '@amap/amap-jsapi-loader';
import { getToken } from '@/utils/auth';
import { useGlobSetting } from '@/hooks/setting';
export default { export default {
setup() { setup() {
const visible = ref(false); const visible = ref(false);
@ -160,7 +164,7 @@
organizationName: '', organizationName: '',
faultLocation: '', faultLocation: '',
faultDescription: '', faultDescription: '',
faultImg: null, attachments: null,
isDispatched: null, isDispatched: null,
maintenanceRequirement: null, maintenanceRequirement: null,
dispatchOpinion: '', dispatchOpinion: '',
@ -251,8 +255,9 @@
}; };
const closeModal = () => { const closeModal = () => {
formRef.value.resetFields(); formRef.value.resetFields();
fileLists.value = []
visible.value = false; visible.value = false;
map.value.destroy(); map.value?.destroy()
}; };
const formRef = ref(); const formRef = ref();
const rules = { const rules = {
@ -269,6 +274,26 @@
faultDescription: [{ required: true, message: '请输入' }], faultDescription: [{ required: true, message: '请输入' }],
isDispatched: [{ required: true, message: '请选择' }], isDispatched: [{ required: true, message: '请选择' }],
}; };
//
const fileLists = ref([]);
const globSetting = useGlobSetting();
const { apiUrl, clientId } = globSetting;
const handleChange = (info) => {
if (info.fileList.length > 0) {
form.attachments = []
info.fileList.forEach(i=>{
if(i.status == 'done'){
form.attachments.push({
url:i.response?.data.url || i.url,
name:i.response?.data.fileName ||i.name,
})
}
})
}else{
form.attachments = null;
}
console.log(fileLists)
};
return { return {
visible, visible,
form, form,
@ -281,6 +306,13 @@
closeModal, closeModal,
formRef, formRef,
rules, rules,
apiUrl,
headers: {
Authorization: 'Bearer ' + getToken(),
clientId,
},
handleChange,
fileLists,
}; };
}, },
}; };

Loading…
Cancel
Save