diff --git a/.env.development b/.env.development index 5be9756..09279ca 100644 --- a/.env.development +++ b/.env.development @@ -4,7 +4,7 @@ VITE_PUBLIC_PATH = / # 本地开发代理,可以解决跨域及多地址代理 # 如果接口地址匹配到,则会转发到http://localhost:3000,防止本地出现跨域问题 # 可以有多个,注意多个不能换行,否则代理将会失效 -VITE_PROXY = [["/api","http://localhost:9999"],["/upload","http://localhost:9999/system_proxy/system/file/upload"]] +VITE_PROXY = [["/api","http://192.168.3.10:9999"],["/upload","http://192.168.3.10:9999/system_proxy/system/file/upload"]] # 是否删除console.log VITE_DROP_CONSOLE = false diff --git a/src/api/platform/common/entity/mapLogistic.ts b/src/api/platform/common/entity/mapLogistic.ts index 04b944a..7f03b18 100644 --- a/src/api/platform/common/entity/mapLogistic.ts +++ b/src/api/platform/common/entity/mapLogistic.ts @@ -25,10 +25,6 @@ export interface MapLogistic extends Partial { sendOrderTaskType: string; sendOrderLng: Nullable; sendOrderLat: Nullable; - fileId: string | string[]; - estimateTime: string; - requireTime: string; - batchCode?: string; version?: number; mapTask: MapTask[]; mapLogisticPoint: MapLogisticPoint[]; diff --git a/src/api/platform/common/entity/mapTask.ts b/src/api/platform/common/entity/mapTask.ts index bb39532..2044a11 100644 --- a/src/api/platform/common/entity/mapTask.ts +++ b/src/api/platform/common/entity/mapTask.ts @@ -27,6 +27,7 @@ export interface MapTask extends Partial { orgLat?: number; courierUserId?: string; fileId: string | string[]; + receiptFileId: string | string[]; estimateTime?: string; requireTime?: string; batchCode?: string; diff --git a/src/api/platform/common/entity/mapTaskPreset.ts b/src/api/platform/common/entity/mapTaskPreset.ts index 4352c50..5d88818 100644 --- a/src/api/platform/common/entity/mapTaskPreset.ts +++ b/src/api/platform/common/entity/mapTaskPreset.ts @@ -26,6 +26,7 @@ export interface MapTaskPreset extends Partial { courierUserId: string; key?: string; fileId: string | string[]; + receiptFileId: string | string[]; estimateTime?: string; requireTime?: string; batchCode?: string; diff --git a/src/components/AMap/src/AMapDesigner/index.vue b/src/components/AMap/src/AMapDesigner/index.vue index 56cb6e0..b3ce78c 100644 --- a/src/components/AMap/src/AMapDesigner/index.vue +++ b/src/components/AMap/src/AMapDesigner/index.vue @@ -54,18 +54,6 @@ @select="handleCourierUserData" /> - - -
@@ -475,6 +463,13 @@ }; eventSource.onmessage = function (ev) { + try { + let { data } = ev; + let mapLogistic = JSON.parse(data); + let courierUser = mapState.courierUserList.find(item => item.value == mapLogistic?.courierUserId); + courierUser && (courierUser.mapLat = mapLogistic.courierLat); + courierUser && (courierUser.mapLng = mapLogistic.courierLng); + } catch (e) {} console.info(ev); }; @@ -538,6 +533,7 @@ orgId: '', orgName: t('component.aMapDesigner.taskPositionTip'), sort: 1, + receiptFileId: [], fileId: [], key: buildUUID() }); @@ -555,6 +551,7 @@ Object.assign(mapTask, { orgId: '', orgName: t('component.aMapDesigner.taskPositionTip'), + receiptFileId: [], fileId: [] }); // 重新在头部添加任务并且重新排序 @@ -717,12 +714,13 @@ nextTick(() => { mapState.mapData = cloneDeep(merge(defaultMapData(), options)); // 处理数据格式转换 - isString(mapState.mapData.fileId) && (mapState.mapData.fileId ? (mapState.mapData.fileId = mapState.mapData.fileId.split(',')) : []); mapState.mapData.mapTask.forEach(item => { isString(item.fileId) && (item.fileId ? (item.fileId = item.fileId.split(',')) : []); + isString(item.receiptFileId) && (item.receiptFileId ? (item.receiptFileId = item.receiptFileId.split(',')) : []); if (~~item.taskType == 1) { item?.mapTaskPreset?.forEach(childItem => { isString(childItem.fileId) && (childItem.fileId ? (childItem.fileId = childItem.fileId.split(',')) : []); + isString(item.receiptFileId) && (item.receiptFileId ? (item.receiptFileId = item.receiptFileId.split(',')) : []); }); } }); @@ -735,7 +733,6 @@ async function getMapDataJson() { await formElRef.value.validate(); const mapData = toRaw(mapState.mapData); - isArray(mapData.fileId) && (mapData.fileId = mapData.fileId.join(',')); mapData.mapTask.forEach(item => { const hospital = item.hospitalId && mapState.hospitalList.find(e => e.value == item.hospitalId), org = item.orgId && mapState.orgList.find(e => e.value == item.orgId); @@ -751,8 +748,12 @@ orgLat: org.mapLat }); isArray(item.fileId) && (item.fileId = item.fileId.join(',')); + isArray(item.receiptFileId) && (item.receiptFileId = item.receiptFileId.join(',')); if (~~item.taskType == 1) { - item?.mapTaskPreset?.forEach(childItem => isArray(childItem.fileId) && (childItem.fileId = childItem.fileId.join(','))); + item?.mapTaskPreset?.forEach(childItem => { + isArray(childItem.fileId) && (childItem.fileId = childItem.fileId.join(',')); + isArray(item.receiptFileId) && (item.receiptFileId = item.receiptFileId.join(',')); + }); } }); return Promise.resolve(cloneDeep(mapState.mapData)); diff --git a/src/components/AMap/src/amap.data.tsx b/src/components/AMap/src/amap.data.tsx index 181d8ea..e42bb7b 100644 --- a/src/components/AMap/src/amap.data.tsx +++ b/src/components/AMap/src/amap.data.tsx @@ -69,6 +69,22 @@ export const taskOrdinaryColumns: BasicColumn[] = [ editRow: true, editComponent: 'Select', }, + { + title: '上传单据文件', + dataIndex: 'receiptFileId', + editRow: true, + editComponent: 'Upload', + editComponentProps: { + multiple: true, + maxSize: 20, + maxNumber: 10, + showUploadSaveBtn: true, + showPreviewNumber: false, + emptyHidePreview: true, + api: commonUpload, + accept: ['image/*'] + } + }, { title: '上传文件', dataIndex: 'fileId', @@ -117,6 +133,22 @@ export const taskPresetColumns: BasicColumn[] = [ title: '目的地预设点', dataIndex: 'orgName', }, + { + title: '上传单据文件', + dataIndex: 'receiptFileId', + editRow: true, + editComponent: 'Upload', + editComponentProps: { + multiple: true, + maxSize: 20, + maxNumber: 10, + showUploadSaveBtn: true, + showPreviewNumber: false, + emptyHidePreview: true, + api: commonUpload, + accept: ['image/*'] + } + }, { title: '上传文件', dataIndex: 'fileId', @@ -169,6 +201,22 @@ export const taskPresetChildColumns: BasicColumn[] = [ title: '目的地预设点', dataIndex: 'destinationPresetName' }, + { + title: '上传单据文件', + dataIndex: 'receiptFileId', + editRow: true, + editComponent: 'Upload', + editComponentProps: { + multiple: true, + maxSize: 20, + maxNumber: 10, + showUploadSaveBtn: true, + showPreviewNumber: false, + emptyHidePreview: true, + api: commonUpload, + accept: ['image/*'] + } + }, { title: '上传文件', dataIndex: 'fileId', diff --git a/src/components/AMap/src/components/MapTaskModal.vue b/src/components/AMap/src/components/MapTaskModal.vue index 29d89f1..dd201f3 100644 --- a/src/components/AMap/src/components/MapTaskModal.vue +++ b/src/components/AMap/src/components/MapTaskModal.vue @@ -232,6 +232,7 @@ orgId: '', orgName: t('component.aMapDesigner.taskPositionTip'), fileId: [], + receiptFileId: [], key: buildUUID() } as MapTask); } @@ -256,6 +257,7 @@ orgId: '', orgName: t('component.aMapDesigner.taskPositionTip'), fileId: [], + receiptFileId: [], key: buildUUID() } as MapTask); } diff --git a/src/components/AMap/src/components/MapTaskPresetModal.vue b/src/components/AMap/src/components/MapTaskPresetModal.vue index cb22d59..2142cf5 100644 --- a/src/components/AMap/src/components/MapTaskPresetModal.vue +++ b/src/components/AMap/src/components/MapTaskPresetModal.vue @@ -167,6 +167,7 @@ orginPresetName: t('component.aMapDesigner.taskPositionTip'), destinationPresetName: t('component.aMapDesigner.taskPositionTip'), fileId: [], + receiptFileId: [], key: buildUUID() } as MapTaskPreset); } diff --git a/src/views/common/mapLogistic/mapLogistic.data.ts b/src/views/common/mapLogistic/mapLogistic.data.ts index a70ba9f..588e195 100644 --- a/src/views/common/mapLogistic/mapLogistic.data.ts +++ b/src/views/common/mapLogistic/mapLogistic.data.ts @@ -31,10 +31,6 @@ export const columns: BasicColumn[] = [ title: '发单起点纬度值', dataIndex: 'sendOrderLat', }, - { - title: '报告单批次码', - dataIndex: 'batchCode', - }, ]; export const searchFormSchema: FormSchema[] = [ @@ -46,14 +42,5 @@ export const searchFormSchema: FormSchema[] = [ placeholder: '请输入地图名称', }, colProps: { span: 8 }, - }, - { - field: 'batchCode', - label: '报告单批次码', - component: 'Input', - componentProps: { - placeholder: '请输入报告单批次码', - }, - colProps: { span: 8 } } ];