feat:默认选择第一个sku

This commit is contained in:
dzc committed 2025-07-21 16:56:56 +08:00
1 parent 01bb4e446a
commit c08d5b72c0
1 file changed
+5 -2
@@ -2,7 +2,7 @@
<template>
<el-form ref="formRef" :model="formData" :rules="rules" label-width="120px" :disabled="isDetail">
<el-form-item label="配送方式" prop="deliveryTypes">
<el-checkbox-group v-model="formData.deliveryTypes" class="w-80">
<el-checkbox-group disabled v-model="formData.deliveryTypes" class="w-80">
<el-checkbox
v-for="dict in getIntDictOptions(DICT_TYPE.TRADE_DELIVERY_TYPE)"
:key="dict.value"
@@ -50,7 +50,7 @@ const props = defineProps({
})
const formRef = ref() // 表单 Ref
const formData = reactive<Spu>({
deliveryTypes: [], // 配送方式
deliveryTypes: [3], // 配送方式
deliveryTemplateId: undefined // 运费模版
})
const rules = reactive({
@@ -66,6 +66,9 @@ watch(
return
}
copyValueToTarget(formData, data)
if(formData.deliveryTypes?.length != 1 || !formData.deliveryTypes?.includes(3)){
formData.deliveryTypes = [3]
}
},
{
immediate: true