generated from Leo_Ding/web-template
呼叫
This commit is contained in:
parent
c17f6794a4
commit
fffa4c28d7
@ -1,23 +1,12 @@
|
||||
<!-- AreaCascader.vue -->
|
||||
<template>
|
||||
<a-cascader
|
||||
v-model:value="modelValue"
|
||||
:options="options"
|
||||
:load-data="loadData"
|
||||
:placeholder="placeholder"
|
||||
:style="style"
|
||||
:disabled="disabled"
|
||||
:show-search="showSearch"
|
||||
:allow-clear="allowClear"
|
||||
:change-on-select="changeOnSelect"
|
||||
:field-names="fieldNames"
|
||||
@change="handleChange"
|
||||
ref="cascaderRef"
|
||||
/>
|
||||
<a-cascader v-model:value="modelValue" :options="options" :load-data="loadData" :placeholder="placeholder"
|
||||
:style="style" :disabled="disabled" :show-search="showSearch" :allow-clear="allowClear"
|
||||
:change-on-select="changeOnSelect" :field-names="fieldNames" @change="handleChange" ref="cascaderRef" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch, nextTick, defineModel, onMounted } from 'vue';
|
||||
import { ref, watch, nextTick, defineModel, onMounted,defineExpose } from 'vue';
|
||||
import apis from '@/apis';
|
||||
import { useDicsStore } from '@/store';
|
||||
|
||||
@ -54,20 +43,23 @@ watch(
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
// 🔁 监听 modelValue,实现自动回显(关键优化)
|
||||
watch(
|
||||
() => modelValue?.value,
|
||||
async (val) => {
|
||||
if (!val || !Array.isArray(val) || val.length <= 1) return;
|
||||
|
||||
// 等待组件初始化
|
||||
await nextTick();
|
||||
|
||||
// 🔍 递归查找节点
|
||||
function findNodeInOptions(options, code) {
|
||||
for (const opt of options) {
|
||||
if (opt.code === code) return opt;
|
||||
if (opt.children) {
|
||||
const found = findNodeInOptions(opt.children, code);
|
||||
if (found) return found;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
async function initData(codes){
|
||||
// 从第二级开始,逐级模拟加载
|
||||
for (let i = 1; i < val.length; i++) {
|
||||
const parentCode = val[i - 1];
|
||||
const currentCode = val[i];
|
||||
|
||||
for (let i = 1; i < codes.length; i++) {
|
||||
const parentCode = codes[i - 1];
|
||||
// const currentCode = val[i];
|
||||
// 查找当前选中的父节点
|
||||
let targetNode;
|
||||
if (i === 1) {
|
||||
@ -86,22 +78,7 @@ watch(
|
||||
// 等待加载完成
|
||||
await nextTick();
|
||||
}
|
||||
},
|
||||
{ immediate: true } // 🔥 确保编辑时能立即触发
|
||||
);
|
||||
|
||||
// 🔍 递归查找节点
|
||||
function findNodeInOptions(options, code) {
|
||||
for (const opt of options) {
|
||||
if (opt.code === code) return opt;
|
||||
if (opt.children) {
|
||||
const found = findNodeInOptions(opt.children, code);
|
||||
if (found) return found;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// 🌐 异步加载子节点
|
||||
const loadData = async (selectedOptions) => {
|
||||
const targetOption = selectedOptions[selectedOptions.length - 1];
|
||||
@ -143,4 +120,5 @@ const loadData = async (selectedOptions) => {
|
||||
const handleChange = (value, selectedOptions) => {
|
||||
emit('change', value, selectedOptions?.map(opt => opt.label) || []);
|
||||
};
|
||||
defineExpose({initData})
|
||||
</script>
|
||||
@ -33,7 +33,7 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="paltform_list">
|
||||
<div value="CALL_CENTER" class="paltform_icon">
|
||||
<div value="CALL_CENTER" class="paltform_icon" @click="handleSelect('hujiao')">
|
||||
<div class="paltform_icon_1">
|
||||
<img :src="tel" alt="" srcset="" width="76" height="76" class="img">
|
||||
</div>
|
||||
@ -45,7 +45,7 @@
|
||||
</div>
|
||||
<p>监管平台</p>
|
||||
</div>
|
||||
<div value="HOME_BED" class="paltform_icon">
|
||||
<div value="HOME_BED" class="paltform_icon" @click="handleSelect('yunying')">
|
||||
<div class="paltform_icon_1">
|
||||
<img :src="yunying" alt="" srcset="" width="76" height="76">
|
||||
</div>
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
<template>
|
||||
<a-modal :open="modal.open" :title="modal.title" :width="800" :confirm-loading="modal.confirmLoading"
|
||||
:after-close="onAfterClose" :cancel-text="cancelText" @ok="handleOk" @cancel="handleCancel">
|
||||
<a-spin tip="Loading..." :spinning="spining">
|
||||
<a-card>
|
||||
<a-form ref="formRef" :model="formData" :rules="formRules">
|
||||
<a-tabs v-model:activeKey="activeKey">
|
||||
<!-- 基本信息 -->
|
||||
@ -34,8 +36,8 @@
|
||||
{{ item.introduction }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<a-input v-model:value="formData.identityNo" placeholder="请输入证件号码" style="flex: 1;"
|
||||
@change="extractBirthDateFromIdCard" />
|
||||
<a-input v-model:value="formData.identityNo" placeholder="请输入证件号码"
|
||||
style="flex: 1;" @change="extractBirthDateFromIdCard" />
|
||||
</span>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@ -144,8 +146,8 @@
|
||||
<a-form-item label="护理等级" name="archive.nursingLevel">
|
||||
<a-select v-model:value="formData.archive.nursingLevel" placeholder="请选择护理等级"
|
||||
allow-clear>
|
||||
<a-select-option v-for="item in dicsStore.dictOptions.Care_Level" :key="item.dval"
|
||||
:value="item.dval">
|
||||
<a-select-option v-for="item in dicsStore.dictOptions.Care_Level"
|
||||
:key="item.dval" :value="item.dval">
|
||||
{{ item.introduction }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
@ -154,7 +156,8 @@
|
||||
<!-- 家庭地址 -->
|
||||
<a-col :span="12">
|
||||
<a-form-item label="家庭地址" :name="['archive', 'homeAreaCodes']">
|
||||
<AreaCascader v-model:value="formData.archive.homeAreaCodes" @change="onAreaChange" />
|
||||
<AreaCascader v-model:value="formData.archive.homeAreaCodes" @change="onAreaChange"
|
||||
ref="areaCascaderRef" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
@ -172,14 +175,16 @@
|
||||
<!-- 经度 -->
|
||||
<a-col :span="12">
|
||||
<a-form-item label="经度" name="lat">
|
||||
<a-input-number v-model:value="formData.archive.lat" placeholder="请输入经度" style="width: 100%;"/>
|
||||
<a-input-number v-model:value="formData.archive.lat" placeholder="请输入经度"
|
||||
style="width: 100%;" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<!-- 纬度 -->
|
||||
<a-col :span="12">
|
||||
<a-form-item label="纬度" name="lag">
|
||||
<a-input-number v-model:value="formData.archive.lag" placeholder="请输入纬度" style="width: 100%;"/>
|
||||
<a-input-number v-model:value="formData.archive.lag" placeholder="请输入纬度"
|
||||
style="width: 100%;" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<gx-map @handleGetLng="handleGetLng" />
|
||||
@ -221,7 +226,8 @@
|
||||
<a-form-item label="统计分类" name="statisticsCategory">
|
||||
<a-select v-model:value="formData.archive.statisticsCategory" placeholder="请选择统计分类"
|
||||
allow-clear>
|
||||
<a-select-option v-for="item in dicsStore.dictOptions.Statistical_Classification"
|
||||
<a-select-option
|
||||
v-for="item in dicsStore.dictOptions.Statistical_Classification"
|
||||
:key="item.dval" :value="item.dval">
|
||||
{{ item.introduction }}
|
||||
</a-select-option>
|
||||
@ -232,8 +238,8 @@
|
||||
<!-- 智力情况 -->
|
||||
<a-col :span="8">
|
||||
<a-form-item label="智力情况" name="intellectualSituation">
|
||||
<a-select v-model:value="formData.archive.intellectualSituation" placeholder="请选择智力情况"
|
||||
allow-clear>
|
||||
<a-select v-model:value="formData.archive.intellectualSituation"
|
||||
placeholder="请选择智力情况" allow-clear>
|
||||
<a-select-option v-for="item in dicsStore.dictOptions.Intellectual_Condition"
|
||||
:key="item.dval" :value="item.dval">
|
||||
{{ item.introduction }}
|
||||
@ -258,8 +264,8 @@
|
||||
<!-- 老人子女探望情况 -->
|
||||
<a-col :span="8">
|
||||
<a-form-item label="老人子女探望情况" name="childrenVisitStatus">
|
||||
<a-select v-model:value="formData.archive.childrenVisitStatus" placeholder="请选择老人子女探望情况"
|
||||
allow-clear>
|
||||
<a-select v-model:value="formData.archive.childrenVisitStatus"
|
||||
placeholder="请选择老人子女探望情况" allow-clear>
|
||||
<a-select-option v-for="item in dicsStore.dictOptions.Frequency_Visits"
|
||||
:key="item.dval" :value="item.dval">
|
||||
{{ item.introduction }}
|
||||
@ -273,8 +279,8 @@
|
||||
<a-form-item label="是否人户分离" name="householdResidenceSeparation">
|
||||
<a-select v-model:value="formData.archive.householdResidenceSeparation"
|
||||
placeholder="请选择是否人户分离" allow-clear>
|
||||
<a-select-option v-for="item in dicsStore.dictOptions.Separation" :key="item.dval"
|
||||
:value="item.dval">
|
||||
<a-select-option v-for="item in dicsStore.dictOptions.Separation"
|
||||
:key="item.dval" :value="item.dval">
|
||||
{{ item.introduction }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
@ -284,9 +290,10 @@
|
||||
<!-- 民族 -->
|
||||
<a-col :span="8">
|
||||
<a-form-item label="民族" name="ethnicity">
|
||||
<a-select v-model:value="formData.archive.ethnicity" placeholder="请选择民族" allow-clear>
|
||||
<a-select-option v-for="item in dicsStore.dictOptions.Ethnicity" :key="item.dval"
|
||||
:value="item.dval">
|
||||
<a-select v-model:value="formData.archive.ethnicity" placeholder="请选择民族"
|
||||
allow-clear>
|
||||
<a-select-option v-for="item in dicsStore.dictOptions.Ethnicity"
|
||||
:key="item.dval" :value="item.dval">
|
||||
{{ item.introduction }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
@ -348,7 +355,8 @@
|
||||
<!-- 宗教信仰 -->
|
||||
<a-col :span="8">
|
||||
<a-form-item label="宗教信仰" name="religion">
|
||||
<a-select v-model:value="formData.archive.religion" placeholder="请选择宗教信仰" allow-clear>
|
||||
<a-select v-model:value="formData.archive.religion" placeholder="请选择宗教信仰"
|
||||
allow-clear>
|
||||
<a-select-option v-for="item in dicsStore.dictOptions.Religious_belief"
|
||||
:key="item.dval" :value="item.dval">
|
||||
{{ item.introduction }}
|
||||
@ -360,7 +368,8 @@
|
||||
<!-- 职业情况 -->
|
||||
<a-col :span="8">
|
||||
<a-form-item label="职业情况" name="occupation">
|
||||
<a-select v-model:value="formData.archive.occupation" placeholder="请选择职业情况" allow-clear>
|
||||
<a-select v-model:value="formData.archive.occupation" placeholder="请选择职业情况"
|
||||
allow-clear>
|
||||
<a-select-option v-for="item in dicsStore.dictOptions.Employment_Status"
|
||||
:key="item.dval" :value="item.dval">
|
||||
{{ item.introduction }}
|
||||
@ -372,8 +381,8 @@
|
||||
<!-- 政治面貌 -->
|
||||
<a-col :span="8">
|
||||
<a-form-item label="政治面貌" name="politicalAffiliation">
|
||||
<a-select v-model:value="formData.archive.politicalAffiliation" placeholder="请选择政治面貌"
|
||||
allow-clear>
|
||||
<a-select v-model:value="formData.archive.politicalAffiliation"
|
||||
placeholder="请选择政治面貌" allow-clear>
|
||||
<a-select-option v-for="item in dicsStore.dictOptions.Political_affiliation"
|
||||
:key="item.dval" :value="item.dval">
|
||||
{{ item.introduction }}
|
||||
@ -397,7 +406,8 @@
|
||||
<a-col :span='8'>
|
||||
<a-form-item label="分类标签" name="labelsCode">
|
||||
<a-select v-model:value="formData.labelsCode" allowClear mode="multiple">
|
||||
<a-select-option v-for="item in dicsStore.dictOptions.Service_Recipient_Category2"
|
||||
<a-select-option
|
||||
v-for="item in dicsStore.dictOptions.Service_Recipient_Category2"
|
||||
:key="item.dval" :value="item.dval">{{
|
||||
item.introduction }}</a-select-option>
|
||||
</a-select>
|
||||
@ -436,23 +446,25 @@
|
||||
<!-- 上传资料 -->
|
||||
<a-col :span="12">
|
||||
<a-form-item label="上传资料" name="uploadedDocuments">
|
||||
<gx-upload v-model="formData.archive.idCardPhotos" accept-types=".jpg,.png,.webp,.xlsx,.docx,.doc"
|
||||
:fileNumber="10" />
|
||||
<gx-upload v-model="formData.archive.idCardPhotos"
|
||||
accept-types=".jpg,.png,.webp,.xlsx,.docx,.doc" :fileNumber="10" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</a-form>
|
||||
</a-card>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import { ref, defineProps } from 'vue'
|
||||
import { ref, defineProps, nextTick } from 'vue'
|
||||
import { config } from '@/config'
|
||||
import apis from '@/apis'
|
||||
import { useForm, useModal } from '@/hooks'
|
||||
import { useForm, useModal,useSpining } from '@/hooks'
|
||||
import { useDicsStore } from '@/store'
|
||||
import AreaCascader from '@/components/AreaCascader/index.vue'
|
||||
import { validatePhone, validateEmail, validateIdCard } from '@/utils/validate'
|
||||
@ -460,11 +472,14 @@ import { getBirthDate, spliceUrl } from '@/utils/util'
|
||||
import dayjs from 'dayjs'
|
||||
|
||||
import { message } from 'ant-design-vue'
|
||||
import { FastBackwardFilled } from '@ant-design/icons-vue'
|
||||
const emit = defineEmits(['ok'])
|
||||
const activeKey = ref('1')
|
||||
const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()
|
||||
const { formRecord, formData, formRef, formRules, resetForm } = useForm()
|
||||
const areaCascaderRef = ref()
|
||||
const cancelText = ref('取消')
|
||||
const spining=ref(false)
|
||||
formRules.value = {
|
||||
name: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
|
||||
identityType: [{ required: true, message: '请选择证件类型', trigger: 'change' }],
|
||||
@ -504,16 +519,28 @@ async function handleEdit(record = {}) {
|
||||
type: 'edit',
|
||||
title: '编辑对象'
|
||||
})
|
||||
try {
|
||||
spining.value=true
|
||||
const { data, success } = await apis.serverObj.getItem(record.id).catch()
|
||||
if (!success) {
|
||||
spining.value=false
|
||||
hideModal()
|
||||
return
|
||||
}
|
||||
formData.value = { ...data }
|
||||
formData.value.birthDate=dayjs(data.birthDate)
|
||||
formData.value.birthDate = dayjs(data.birthDate)
|
||||
formData.value.archive.idCardPhotos = data.archive.idCardPhotos ? data.archive.idCardPhotos.map(item => config('http.apiBasic') + item) : []
|
||||
formData.value.archive.uploadedDocuments = data.archive.uploadedDocuments ? data.archive.uploadedDocuments.map(item => config('http.apiBasic') + item) : []
|
||||
formData.value.governmentPurchasedServiceStartDate=[dayjs(formData.value.starGovernmentService),dayjs(formData.value.endGovernmentService)]
|
||||
formData.value.governmentPurchasedServiceStartDate = [dayjs(formData.value.starGovernmentService), dayjs(formData.value.endGovernmentService)]
|
||||
nextTick(() => {
|
||||
areaCascaderRef.value.initData(data.archive.homeAreaCodes)
|
||||
})
|
||||
spining.value=false
|
||||
} catch (error) {
|
||||
console.log(error.message)
|
||||
spining.value=false
|
||||
}
|
||||
|
||||
}
|
||||
// utils/idCard.js
|
||||
function isValidIdCard(value) {
|
||||
@ -580,11 +607,11 @@ function handleOk() {
|
||||
labels: formData.value.labelsCode ? formData.value.labelsCode.map(item => dicsStore.getDictLabel('Service_Recipient_Category2', item)) : [],
|
||||
|
||||
}
|
||||
params.archive.idCardPhotos = formData.value.archive.idCardPhotos&&formData.value.archive.idCardPhotos.length>0 ? formData.value.archive.idCardPhotos.map(item => spliceUrl(item)) : ['']
|
||||
params.archive.uploadedDocuments = formData.value.archive.uploadedDocuments&&formData.value.archive.uploadedDocuments.length>0 ? formData.value.archive.uploadedDocuments.map(item => spliceUrl(item)) : ['']
|
||||
if(formData.value.governmentPurchasedServiceStartDate&&formData.value.governmentPurchasedServiceStartDate.length>0){
|
||||
params.archive.starGovernmentService=formData.value.governmentPurchasedServiceStartDate[0]
|
||||
params.archive.endGovernmentService=formData.value.governmentPurchasedServiceStartDate[1]
|
||||
params.archive.idCardPhotos = formData.value.archive.idCardPhotos && formData.value.archive.idCardPhotos.length > 0 ? formData.value.archive.idCardPhotos.map(item => spliceUrl(item)) : ['']
|
||||
params.archive.uploadedDocuments = formData.value.archive.uploadedDocuments && formData.value.archive.uploadedDocuments.length > 0 ? formData.value.archive.uploadedDocuments.map(item => spliceUrl(item)) : ['']
|
||||
if (formData.value.governmentPurchasedServiceStartDate && formData.value.governmentPurchasedServiceStartDate.length > 0) {
|
||||
params.archive.starGovernmentService = formData.value.governmentPurchasedServiceStartDate[0]
|
||||
params.archive.endGovernmentService = formData.value.governmentPurchasedServiceStartDate[1]
|
||||
}
|
||||
// 单独封装一个同步校验函数
|
||||
if (params.identityType === '1' && !isValidIdCard(params.identityNo)) {
|
||||
@ -600,7 +627,7 @@ function handleOk() {
|
||||
break
|
||||
case 'edit':
|
||||
console.log(params)
|
||||
result = await apis.serverObj.updateItem(params.id,params).catch(() => {
|
||||
result = await apis.serverObj.updateItem(params.id, params).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
break
|
||||
@ -640,23 +667,9 @@ function onAreaHoldChange(value, labels) {
|
||||
formData.value.archive.houseAreaLabels = [...labels]
|
||||
}
|
||||
function handleGetLng(obj) {
|
||||
formData.value.lat = obj.lat
|
||||
formData.value.lag = obj.lng
|
||||
formData.value.archive.lat = obj.lat
|
||||
formData.value.archive.lag = obj.lng
|
||||
}
|
||||
// 修复自定义上传方法
|
||||
const handleCustomRequest = async (options) => {
|
||||
const { file, onProgress, onSuccess, onError } = options;
|
||||
|
||||
try {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
const { data } = await apis.common.uploadFile(formData);
|
||||
const fullUrl = config('http.apiBasic') + data;
|
||||
console.log(fullUrl)
|
||||
} catch (err) {
|
||||
message.error('上传失败');
|
||||
}
|
||||
};
|
||||
/**
|
||||
* 取消
|
||||
*/
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
<a-modal :open="modal.open" :title="modal.title" :width="800" :confirm-loading="modal.confirmLoading"
|
||||
:after-close="onAfterClose" :cancel-text="cancelText" @ok="handleOk" @cancel="handleCancel">
|
||||
<a-card>
|
||||
<a-spin tip="Loading..." :spinning="spining">
|
||||
<a-form ref="formRef" :model="formData" :rules="formRules">
|
||||
<a-row :gutter="24">
|
||||
<!-- 姓名 -->
|
||||
@ -25,7 +26,8 @@
|
||||
<div style="margin-bottom: 20px;">
|
||||
<span style="margin-right: 10px;"><span style="color: red;">*</span> 服务项目:</span>
|
||||
<!-- 显示已选项目 -->
|
||||
<a-tag v-for="item in selectedServices" :key="item.id" closable @close="handleRemove(item)">
|
||||
<a-tag v-for="item in selectedServices" :key="item.id" closable
|
||||
@close="handleRemove(item)">
|
||||
{{ item.name }}
|
||||
</a-tag>
|
||||
<a-tag @click="showModal2" color="#108ee9" style="cursor: pointer;">
|
||||
@ -44,7 +46,8 @@
|
||||
<a-col :span="12">
|
||||
<a-form-item label="服务人员" name="servicePersonId">
|
||||
<a-select v-model:value="formData.servicePersonId">
|
||||
<a-select-option v-for="item in servicePersonList" :key="item.id" :value="item.id">
|
||||
<a-select-option v-for="item in servicePersonList" :key="item.id"
|
||||
:value="item.id">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
@ -70,7 +73,7 @@
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="服务地址(如修改服务地址,请务必更新地图定位地址)" name="areaCodes">
|
||||
<AreaCascader v-model:value="formData.areaCodes" @change="onAreaChange" />
|
||||
<AreaCascader v-model:value="formData.areaCodes" @change="onAreaChange" ref="areaCascaderRef"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
@ -95,6 +98,8 @@
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
|
||||
</a-card>
|
||||
</a-modal>
|
||||
<a-modal v-model:open="modalVisible" title="选择服务项目" @ok="handleConfirm" @cancel="handleCancel2" okText="确认"
|
||||
@ -139,6 +144,8 @@ const servicePersonList = ref([])
|
||||
const gps = ref('')
|
||||
const mapVisible = ref(false)
|
||||
const stationList = ref([])
|
||||
const spining = ref(false)
|
||||
const areaCascaderRef=ref()
|
||||
formRules.value = {
|
||||
name: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
|
||||
identityType: [{ required: true, message: '请选择证件类型', trigger: 'change' }],
|
||||
@ -282,13 +289,17 @@ async function handleEdit(record = {}, type) {
|
||||
type: 'edit',
|
||||
title: '编辑对象'
|
||||
})
|
||||
try {
|
||||
spining.value = true
|
||||
formData.value.orderType = type, //线下2 线上1]
|
||||
formData.value.customerId = record.id
|
||||
formData.value.name = record.name
|
||||
formData.value.areaCodes = record.archive.homeAreaCodes
|
||||
formData.value.areaCodes = [...record.archive.homeAreaCodes]
|
||||
formData.value.areaLabels = record.archive.homeAreaLabels
|
||||
nextTick(() => {
|
||||
areaCascaderRef.value.initData(record.archive.homeAreaCodes)
|
||||
})
|
||||
if (type == '2') {
|
||||
|
||||
formData.value.detailAddress = record.archive.homeDetailAddress
|
||||
gps.value = record.region.join('') + record.archive.homeDetailAddress
|
||||
formData.value.lat = record.archive.lag
|
||||
@ -296,6 +307,11 @@ async function handleEdit(record = {}, type) {
|
||||
}
|
||||
|
||||
getServiceStation()
|
||||
spining.value = false
|
||||
} catch (error) {
|
||||
spining.value = false
|
||||
}
|
||||
|
||||
}
|
||||
async function getServiceStation() {
|
||||
try {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user