✨ 运单详情编辑打卡记录支持地图选点定打卡地址

打卡地址改为只读输入框,点击弹出地图选址(复用 address-map-picker,
与空港、港口、维修记录等处同一套),确定后回填地址与经纬度。
地址与经纬度成套更新——只回填地址会让坐标停留在司机打卡时的旧点上。
经纬度输入框保留,仍可手工微调。
This commit is contained in:
2026-10-06 13:55:57 +08:00
parent 360147e46a
commit 8ad53894b9
@@ -2835,8 +2835,11 @@
<el-form-item label="打卡地址">
<el-input
v-model="waybillPunchEditForm.address"
readonly
maxlength="500"
placeholder="请输入"
placeholder="点击选择地图地址"
:suffix-icon="Location"
@click="waybillPunchAddressMapVisible = true"
/>
</el-form-item>
</el-col>
@@ -2931,6 +2934,14 @@
</template>
</el-dialog>
<address-map-picker
v-model="waybillPunchAddressMapVisible"
:address="waybillPunchEditForm.address"
:longitude="waybillPunchEditForm.longitude"
:latitude="waybillPunchEditForm.latitude"
@confirm="handleWaybillPunchAddressMapConfirm"
/>
<el-dialog
v-model="attachmentDocumentPreviewVisible"
:title="attachmentPreviewFile.name || '附件预览'"
@@ -3668,6 +3679,7 @@ import {
trackVehicle,
} from '@/api/business/waybill-manage';
import VoucherExecutionDetail from './voucher-execution-detail.vue';
import AddressMapPicker from '@/components/address-map-picker/main.vue';
import { getList as getDriverList } from '@/api/transportCapacity/driver';
import {
fetchDriversByCarrierOrganizations,
@@ -3874,6 +3886,7 @@ export default {
ElImageViewer,
OpenFileViewer,
VoucherExecutionDetail,
AddressMapPicker,
},
name: 'WaybillManagePage',
props: {
@@ -3981,6 +3994,7 @@ export default {
remark: '',
photos: [],
},
waybillPunchAddressMapVisible: false,
waybillRouteChangeBox: false,
waybillRouteChangeTab: 'change',
waybillRouteChangeRows: [],
@@ -5876,8 +5890,30 @@ export default {
.filter(photo => photo?.url)
.map(photo => ({ url: photo.url, type: photo.voucherType || photo.type || '' })),
};
this.waybillPunchAddressMapVisible = false;
this.waybillPunchRecordEditDialog.visible = true;
},
// 地图选点回填:地址与经纬度必须成套,只回填地址会让坐标停留在旧点上
handleWaybillPunchAddressMapConfirm(payload) {
const selection = typeof payload === 'string' ? { address: payload } : payload || {};
if (selection.address) {
this.waybillPunchEditForm.address = selection.address;
}
if (
selection.longitude !== undefined &&
selection.longitude !== null &&
selection.longitude !== ''
) {
this.waybillPunchEditForm.longitude = Number(selection.longitude).toFixed(6);
}
if (
selection.latitude !== undefined &&
selection.latitude !== null &&
selection.latitude !== ''
) {
this.waybillPunchEditForm.latitude = Number(selection.latitude).toFixed(6);
}
},
beforeWaybillPunchPhotoUpload(file) {
const validType = ['image/jpeg', 'image/png', 'image/jpg', 'image/bmp'].includes(file.type);
if (!validType) {