|
|
@ -1,7 +1,6 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<BasicModal v-bind="$attrs" |
|
|
|
<BasicModal v-bind="$attrs" |
|
|
|
:width="720" |
|
|
|
:width="920" |
|
|
|
:height="600" |
|
|
|
|
|
|
|
@register="registerModal" |
|
|
|
@register="registerModal" |
|
|
|
@ok="handleSubmit" |
|
|
|
@ok="handleSubmit" |
|
|
|
> |
|
|
|
> |
|
|
@ -16,14 +15,20 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</BasicTable> |
|
|
|
</BasicTable> |
|
|
|
<BasicTable @register="schemeRegisterTable"> |
|
|
|
<BasicTable @register="schemeRegisterTable"> |
|
|
|
<template #action="{ record }"> |
|
|
|
<template #toolbar> |
|
|
|
|
|
|
|
<a-button type="primary" |
|
|
|
|
|
|
|
@click="handleMutualTaskAdd()" |
|
|
|
|
|
|
|
>新增任务</a-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<template #action="{ record, column }"> |
|
|
|
<TableAction :actions="[ |
|
|
|
<TableAction :actions="[ |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: '预览路线方案', |
|
|
|
label: '设置为交接任务', |
|
|
|
icon: 'fa6-regular:pen-to-square', |
|
|
|
icon: 'fa6-regular:pen-to-square', |
|
|
|
onClick: handlePathPreview.bind(null, record) |
|
|
|
onClick: handlePathPreview.bind(null, record) |
|
|
|
}]" |
|
|
|
}]" |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
<TableAction :actions="createMutualActions(record, column)"/> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</BasicTable> |
|
|
|
</BasicTable> |
|
|
|
</BasicModal> |
|
|
|
</BasicModal> |
|
|
@ -32,7 +37,7 @@ |
|
|
|
import { reactive } from 'vue'; |
|
|
|
import { reactive } from 'vue'; |
|
|
|
import { BasicModal, ModalProps, useModalInner } from '/@/components/Modal'; |
|
|
|
import { BasicModal, ModalProps, useModalInner } from '/@/components/Modal'; |
|
|
|
import { BasicTable, useTable, EditRecordRow, BasicColumn, ActionItem, TableAction } from '/@/components/Table'; |
|
|
|
import { BasicTable, useTable, EditRecordRow, BasicColumn, ActionItem, TableAction } from '/@/components/Table'; |
|
|
|
import { formTaskColumns, formSchemeColumns, largeHospitalMapList, smallHospitalMapList, } from './map.data'; |
|
|
|
import { formTaskColumns, formMutualTaskColumns, largeHospitalMapList, smallHospitalMapList, } from './map.data'; |
|
|
|
import { buildUUID } from '/@/utils/uuid'; |
|
|
|
import { buildUUID } from '/@/utils/uuid'; |
|
|
|
import { add, divide } from 'lodash-es'; |
|
|
|
import { add, divide } from 'lodash-es'; |
|
|
|
|
|
|
|
|
|
|
@ -49,6 +54,10 @@ |
|
|
|
currentEditKeyRef: '', |
|
|
|
currentEditKeyRef: '', |
|
|
|
formData: {} |
|
|
|
formData: {} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
const mutualState = reactive<WindowState>({ |
|
|
|
|
|
|
|
currentEditKeyRef: '', |
|
|
|
|
|
|
|
formData: {} |
|
|
|
|
|
|
|
}); |
|
|
|
const emit = defineEmits(['success', 'register']); |
|
|
|
const emit = defineEmits(['success', 'register']); |
|
|
|
const [registerModal, { setModalProps, closeModal }] = useModalInner(async data => { |
|
|
|
const [registerModal, { setModalProps, closeModal }] = useModalInner(async data => { |
|
|
|
driving = data.driving; |
|
|
|
driving = data.driving; |
|
|
@ -59,6 +68,7 @@ |
|
|
|
setModalProps(props); |
|
|
|
setModalProps(props); |
|
|
|
}); |
|
|
|
}); |
|
|
|
const [registerTable, { reload, getDataSource }] = useTable({ |
|
|
|
const [registerTable, { reload, getDataSource }] = useTable({ |
|
|
|
|
|
|
|
title: '任务设置', |
|
|
|
columns: formTaskColumns, |
|
|
|
columns: formTaskColumns, |
|
|
|
pagination: { |
|
|
|
pagination: { |
|
|
|
pageSize: 3, |
|
|
|
pageSize: 3, |
|
|
@ -77,9 +87,13 @@ |
|
|
|
slots: { customRender: 'action' }, |
|
|
|
slots: { customRender: 'action' }, |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
const [schemeRegisterTable, { reload: schemeReload, setProps }] = useTable({ |
|
|
|
const [schemeRegisterTable, { reload: schemeReload, getDataSource: getMutualDataSource, setProps }] = useTable({ |
|
|
|
columns: formSchemeColumns, |
|
|
|
title: '交接任务设置', |
|
|
|
pagination: false, |
|
|
|
columns: formMutualTaskColumns, |
|
|
|
|
|
|
|
pagination: { |
|
|
|
|
|
|
|
pageSize: 3, |
|
|
|
|
|
|
|
showSizeChanger: false |
|
|
|
|
|
|
|
}, |
|
|
|
striped: false, |
|
|
|
striped: false, |
|
|
|
useSearchForm: false, |
|
|
|
useSearchForm: false, |
|
|
|
showTableSetting: false, |
|
|
|
showTableSetting: false, |
|
|
@ -102,6 +116,39 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 处理任务新增 */ |
|
|
|
|
|
|
|
function handleMutualTaskAdd() { |
|
|
|
|
|
|
|
getMutualDataSource().push({ |
|
|
|
|
|
|
|
smallHospitalId: '', |
|
|
|
|
|
|
|
largeHospitalId: '' |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function createMutualActions(record: EditRecordRow, column: BasicColumn): ActionItem[] { |
|
|
|
|
|
|
|
if (!record.editable) { |
|
|
|
|
|
|
|
return [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: '编辑', |
|
|
|
|
|
|
|
disabled: mutualState.currentEditKeyRef ? mutualState.currentEditKeyRef !== record.key : false, |
|
|
|
|
|
|
|
onClick: handleMutualEdit.bind(null, record), |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: '保存', |
|
|
|
|
|
|
|
onClick: handleMutualSave.bind(null, record, column) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: '取消', |
|
|
|
|
|
|
|
popConfirm: { |
|
|
|
|
|
|
|
title: '是否取消编辑', |
|
|
|
|
|
|
|
confirm: handleMutualCancel.bind(null, record, column) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 创建操作列 */ |
|
|
|
/** 创建操作列 */ |
|
|
|
function createActions(record: EditRecordRow, column: BasicColumn): ActionItem[] { |
|
|
|
function createActions(record: EditRecordRow, column: BasicColumn): ActionItem[] { |
|
|
|
if (!record.editable) { |
|
|
|
if (!record.editable) { |
|
|
@ -147,6 +194,26 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function handleMutualEdit(record: EditRecordRow) { |
|
|
|
|
|
|
|
mutualState.currentEditKeyRef = record.key; |
|
|
|
|
|
|
|
record.onEdit?.(true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function handleMutualCancel(record: EditRecordRow) { |
|
|
|
|
|
|
|
mutualState.currentEditKeyRef = ''; |
|
|
|
|
|
|
|
record.onEdit?.(false, false); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function handleMutualSave(record: EditRecordRow) { |
|
|
|
|
|
|
|
const valid = await record.onValid?.(); |
|
|
|
|
|
|
|
if (valid) { |
|
|
|
|
|
|
|
const pass = await record.onEdit?.(false, true); |
|
|
|
|
|
|
|
pass && (mutualState.currentEditKeyRef = ''); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 智能计算方案 */ |
|
|
|
/** 智能计算方案 */ |
|
|
|
function computeScheme() { |
|
|
|
function computeScheme() { |
|
|
|
const scheme = []; |
|
|
|
const scheme = []; |
|
|
|