|
15 | 15 | </el-col>
|
16 | 16 | <el-col :span="12">
|
17 | 17 | <el-form-item label="商品分类" prop="categoryId">
|
18 |
| - <el-tree-select |
| 18 | + <el-cascader |
19 | 19 | v-model="formData.categoryId"
|
20 |
| - :data="categoryList" |
| 20 | + :options="categoryList" |
21 | 21 | :props="defaultProps"
|
22 |
| - check-strictly |
23 | 22 | class="w-1/1"
|
24 |
| - node-key="id" |
| 23 | + clearable |
25 | 24 | placeholder="请选择商品分类"
|
26 |
| - @change="categoryNodeClick" |
| 25 | + filterable |
27 | 26 | />
|
28 | 27 | </el-form-item>
|
29 | 28 | </el-col>
|
|
74 | 73 | :value="item.id"
|
75 | 74 | />
|
76 | 75 | </el-select>
|
77 |
| - <!-- TODO 可能情况:善品录入后选择运费发现下拉选择中没有对应的模版 这里需不需要做添加运费模版后选择的功能 --> |
78 |
| - <!-- <el-button class="ml-20px">运费模板</el-button>--> |
79 | 76 | </el-form-item>
|
80 | 77 | </el-col>
|
81 | 78 | <el-col :span="12">
|
|
102 | 99 | <el-form-item label="分销类型" props="subCommissionType">
|
103 | 100 | <el-radio-group v-model="formData.subCommissionType" @change="changeSubCommissionType">
|
104 | 101 | <el-radio :label="false">默认设置</el-radio>
|
105 |
| - <el-radio :label="true" class="radio">自行设置</el-radio> |
| 102 | + <el-radio :label="true" class="radio">单独设置</el-radio> |
106 | 103 | </el-radio-group>
|
107 | 104 | </el-form-item>
|
108 | 105 | </el-col>
|
|
117 | 114 | />
|
118 | 115 | </el-form-item>
|
119 | 116 | <el-form-item v-if="formData.specType" label="商品属性">
|
120 |
| - <el-button class="mb-10px mr-15px" @click="attributesAddFormRef.open">添加规格</el-button> |
| 117 | + <el-button class="mb-10px mr-15px" @click="attributesAddFormRef.open">添加属性</el-button> |
121 | 118 | <ProductAttributes :propertyList="propertyList" @success="generateSkus" />
|
122 | 119 | </el-form-item>
|
123 | 120 | <template v-if="formData.specType && propertyList.length > 0">
|
|
139 | 136 |
|
140 | 137 | <!-- 情况二:详情 -->
|
141 | 138 | <Descriptions v-if="isDetail" :data="formData" :schema="allSchemas.detailSchema">
|
142 |
| - <template #categoryId="{ row }"> {{ categoryString(row.categoryId) }}</template> |
| 139 | + <template #categoryId="{ row }"> {{ formatCategoryName(row.categoryId) }}</template> |
143 | 140 | <template #brandId="{ row }">
|
144 | 141 | {{ brandList.find((item) => item.id === row.brandId)?.name }}
|
145 | 142 | </template>
|
|
150 | 147 | {{ row.specType ? '多规格' : '单规格' }}
|
151 | 148 | </template>
|
152 | 149 | <template #subCommissionType="{ row }">
|
153 |
| - {{ row.subCommissionType ? '自行设置' : '默认设置' }} |
| 150 | + {{ row.subCommissionType ? '单独设置' : '默认设置' }} |
154 | 151 | </template>
|
155 | 152 | <template #picUrl="{ row }">
|
156 | 153 | <el-image :src="row.picUrl" class="h-60px w-60px" @click="imagePreview(row.picUrl)" />
|
@@ -206,17 +203,17 @@ const ruleConfig: RuleConfig[] = [
|
206 | 203 | {
|
207 | 204 | name: 'price',
|
208 | 205 | rule: (arg) => arg >= 0.01,
|
209 |
| - message: '商品销售价格必须大于等于 0.01 !!!' |
| 206 | + message: '商品销售价格必须大于等于 0.01 元!!!' |
210 | 207 | },
|
211 | 208 | {
|
212 | 209 | name: 'marketPrice',
|
213 | 210 | rule: (arg) => arg >= 0.01,
|
214 |
| - message: '商品市场价格必须大于等于 0.01 !!!' |
| 211 | + message: '商品市场价格必须大于等于 0.01 元!!!' |
215 | 212 | },
|
216 | 213 | {
|
217 | 214 | name: 'costPrice',
|
218 | 215 | rule: (arg) => arg >= 0.01,
|
219 |
| - message: '商品成本价格必须大于等于 0.01 !!!' |
| 216 | + message: '商品成本价格必须大于等于 0.01 元!!!' |
220 | 217 | }
|
221 | 218 | ]
|
222 | 219 |
|
@@ -359,23 +356,11 @@ const onChangeSpec = () => {
|
359 | 356 | }
|
360 | 357 |
|
361 | 358 | const categoryList = ref([]) // 分类树
|
362 |
| -/** |
363 |
| - * 选择分类时触发校验 |
364 |
| - */ |
365 |
| -const categoryNodeClick = () => { |
366 |
| - if (!checkSelectedNode(categoryList.value, formData.categoryId)) { |
367 |
| - formData.categoryId = null |
368 |
| - message.warning('必须选择二级及以下节点!!') |
369 |
| - } |
370 |
| -} |
371 |
| -/** |
372 |
| - * 获取分类的节点的完整结构 |
373 |
| - * |
374 |
| - * @param categoryId 分类id |
375 |
| - */ |
376 |
| -const categoryString = (categoryId) => { |
| 359 | +/** 获取分类的节点的完整结构 */ |
| 360 | +const formatCategoryName = (categoryId) => { |
377 | 361 | return treeToString(categoryList.value, categoryId)
|
378 | 362 | }
|
| 363 | +
|
379 | 364 | const brandList = ref([]) // 精简商品品牌列表
|
380 | 365 | const deliveryTemplateList = ref([]) // 运费模版
|
381 | 366 | onMounted(async () => {
|
|
0 commit comments