|
|
@ -11,7 +11,10 @@ |
|
|
|
:wrapperCol="{ style: { width: '100%', 'margin-right': '10px' } }" |
|
|
|
:wrapperCol="{ style: { width: '100%', 'margin-right': '10px' } }" |
|
|
|
:model="state.modelRef" |
|
|
|
:model="state.modelRef" |
|
|
|
> |
|
|
|
> |
|
|
|
<AFormItem label="医检" name="destinationPresetId" :rules="{ required: true, whitespace: true, message: '医检不能为空', validateTrigger: 'blur' }"> |
|
|
|
<AFormItem v-show="false" label="终点行key" name="destinationPresetRowKeyRef"> |
|
|
|
|
|
|
|
<Input v-model:value="state.modelRef.destinationPresetRowKeyRef" :disabled="true"/> |
|
|
|
|
|
|
|
</AFormItem> |
|
|
|
|
|
|
|
<AFormItem label="终点" name="destinationPresetId" :rules="{ required: true, whitespace: true, message: '医检不能为空', validateTrigger: 'blur' }"> |
|
|
|
<ASelect v-model:value="state.modelRef.destinationPresetId" |
|
|
|
<ASelect v-model:value="state.modelRef.destinationPresetId" |
|
|
|
:options="state.options.orgList" |
|
|
|
:options="state.options.orgList" |
|
|
|
:style="{ width:'30%' }" |
|
|
|
:style="{ width:'30%' }" |
|
|
@ -53,6 +56,7 @@ |
|
|
|
import { buildUUID } from '/@/utils/uuid'; |
|
|
|
import { buildUUID } from '/@/utils/uuid'; |
|
|
|
import { MapTask } from '/@/api/platform/common/entity/mapTask'; |
|
|
|
import { MapTask } from '/@/api/platform/common/entity/mapTask'; |
|
|
|
import { MapTaskPreset } from '/@/api/platform/common/entity/mapTaskPreset'; |
|
|
|
import { MapTaskPreset } from '/@/api/platform/common/entity/mapTaskPreset'; |
|
|
|
|
|
|
|
import { useI18n } from '/@/hooks/web/useI18n'; |
|
|
|
|
|
|
|
|
|
|
|
/** 类型规范统一声明定义区域 */ |
|
|
|
/** 类型规范统一声明定义区域 */ |
|
|
|
type OptionsType = { |
|
|
|
type OptionsType = { |
|
|
@ -71,17 +75,19 @@ |
|
|
|
currentEditRowRef: null, |
|
|
|
currentEditRowRef: null, |
|
|
|
taskPresetRow: null, |
|
|
|
taskPresetRow: null, |
|
|
|
modelRef: { |
|
|
|
modelRef: { |
|
|
|
destinationPresetId: '' |
|
|
|
destinationPresetRowKeyRef: '', |
|
|
|
|
|
|
|
destinationPresetId: '', |
|
|
|
}, |
|
|
|
}, |
|
|
|
options: { |
|
|
|
options: { |
|
|
|
courierUserId: '', |
|
|
|
courierUserId: '', |
|
|
|
orgList: null |
|
|
|
orgList: null |
|
|
|
} |
|
|
|
}, |
|
|
|
}); |
|
|
|
}); |
|
|
|
const AForm = Form; |
|
|
|
const AForm = Form; |
|
|
|
const AFormItem = Form.Item; |
|
|
|
const AFormItem = Form.Item; |
|
|
|
const ASelect = Select; |
|
|
|
const ASelect = Select; |
|
|
|
const formElRef = ref(); |
|
|
|
const formElRef = ref(); |
|
|
|
|
|
|
|
const { t } = useI18n(); |
|
|
|
const emit = defineEmits(['success', 'register']); |
|
|
|
const emit = defineEmits(['success', 'register']); |
|
|
|
const { notification } = useMessage(); |
|
|
|
const { notification } = useMessage(); |
|
|
|
const [registerModal, { setModalProps, closeModal }] = useModalInner(async data => { |
|
|
|
const [registerModal, { setModalProps, closeModal }] = useModalInner(async data => { |
|
|
@ -122,11 +128,14 @@ |
|
|
|
setColumns(taskPresetChildColumns.map(item => |
|
|
|
setColumns(taskPresetChildColumns.map(item => |
|
|
|
columns.find(e => e.dataIndex == item.dataIndex) || item |
|
|
|
columns.find(e => e.dataIndex == item.dataIndex) || item |
|
|
|
)); |
|
|
|
)); |
|
|
|
const mapTaskPresetData = cloneDeep(state.taskPresetRow?.mapTaskPreset || []); |
|
|
|
setTableData((state.taskPresetRow?.mapTaskPreset || []).map(item => omit(item, 'key'))); |
|
|
|
|
|
|
|
const mapTaskPresetData = getDataSource(); |
|
|
|
// 提取交接最终到达上级医检医院 |
|
|
|
// 提取交接最终到达上级医检医院 |
|
|
|
const lastElement = mapTaskPresetData[mapTaskPresetData.length - 1]; |
|
|
|
const last = mapTaskPresetData[mapTaskPresetData.length - 1]; |
|
|
|
lastElement && (state.modelRef.destinationPresetId = lastElement.destinationPresetId); |
|
|
|
if (last) { |
|
|
|
setTableData(mapTaskPresetData.map(item => omit(item, 'key'))); |
|
|
|
state.modelRef.destinationPresetRowKeyRef = last.key; |
|
|
|
|
|
|
|
state.modelRef.destinationPresetId = last.destinationPresetId; |
|
|
|
|
|
|
|
} |
|
|
|
// 尾部:设置处理后的最终配置数据 |
|
|
|
// 尾部:设置处理后的最终配置数据 |
|
|
|
setModalProps(props); |
|
|
|
setModalProps(props); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -155,8 +164,8 @@ |
|
|
|
getDataSource().push({ |
|
|
|
getDataSource().push({ |
|
|
|
name: '', |
|
|
|
name: '', |
|
|
|
courierUserId: '', |
|
|
|
courierUserId: '', |
|
|
|
orginPresetName: '等待收样员设置!', |
|
|
|
orginPresetName: t('component.aMapDesigner.taskPositionTip'), |
|
|
|
destinationPresetName: '等待收样员设置!', |
|
|
|
destinationPresetName: t('component.aMapDesigner.taskPositionTip'), |
|
|
|
fileId: [], |
|
|
|
fileId: [], |
|
|
|
key: buildUUID() |
|
|
|
key: buildUUID() |
|
|
|
} as MapTaskPreset); |
|
|
|
} as MapTaskPreset); |
|
|
@ -246,9 +255,9 @@ |
|
|
|
// 清除旧的上级医检医院 |
|
|
|
// 清除旧的上级医检医院 |
|
|
|
mapTaskPresetData.forEach(item => { |
|
|
|
mapTaskPresetData.forEach(item => { |
|
|
|
validateData.push(item.onValid?.() || Promise.resolve(true)); |
|
|
|
validateData.push(item.onValid?.() || Promise.resolve(true)); |
|
|
|
if(state.options.orgList?.findIndex(e => e.value == item.destinationPresetId) != -1) { |
|
|
|
if(item.key == state.modelRef.destinationPresetRowKeyRef) { |
|
|
|
item.destinationPresetId = ''; |
|
|
|
item.destinationPresetId = ''; |
|
|
|
item.destinationPresetName = '等待收样员设置!'; |
|
|
|
item.destinationPresetName = t('component.aMapDesigner.taskPositionTip'); |
|
|
|
item.destinationPresetLng = ''; |
|
|
|
item.destinationPresetLng = ''; |
|
|
|
item.destinationPresetLat = ''; |
|
|
|
item.destinationPresetLat = ''; |
|
|
|
} |
|
|
|
} |
|
|
@ -259,13 +268,13 @@ |
|
|
|
duration: 2 |
|
|
|
duration: 2 |
|
|
|
}); |
|
|
|
}); |
|
|
|
// 自动设置交接最终到达上级医检医院 |
|
|
|
// 自动设置交接最终到达上级医检医院 |
|
|
|
const lastElement = mapTaskPresetData[mapTaskPresetData.length - 1] as MapTaskPreset; |
|
|
|
const last = mapTaskPresetData[mapTaskPresetData.length - 1] as MapTaskPreset; |
|
|
|
const option = state.options.orgList?.find(item => item.value == formData.destinationPresetId); |
|
|
|
const option = state.options.orgList?.find(item => item.value == formData.destinationPresetId); |
|
|
|
if (option && lastElement) { |
|
|
|
if (option && last) { |
|
|
|
lastElement.destinationPresetId = option.value; |
|
|
|
last.destinationPresetId = option.value; |
|
|
|
lastElement.destinationPresetName = option.label; |
|
|
|
last.destinationPresetName = option.label; |
|
|
|
lastElement.destinationPresetLng = option.mapLng; |
|
|
|
last.destinationPresetLng = option.mapLng; |
|
|
|
lastElement.destinationPresetLat = option.mapLat; |
|
|
|
last.destinationPresetLat = option.mapLat; |
|
|
|
} |
|
|
|
} |
|
|
|
mapTaskPresetData.forEach((item, index)=> item.sort = add(index, 1)); |
|
|
|
mapTaskPresetData.forEach((item, index)=> item.sort = add(index, 1)); |
|
|
|
(state.taskPresetRow ?? Object()).mapTaskPreset = mapTaskPresetData as MapTaskPreset[]; |
|
|
|
(state.taskPresetRow ?? Object()).mapTaskPreset = mapTaskPresetData as MapTaskPreset[]; |
|
|
|