fix: 商品属性值添加暂时恢复name同名校验
parent
0e9fde1f8a
commit
9475ded922
|
@ -37,7 +37,7 @@
|
||||||
v-for="item2 in item.propertyOpts"
|
v-for="item2 in item.propertyOpts"
|
||||||
:key="item2.id"
|
:key="item2.id"
|
||||||
:label="item2.name"
|
:label="item2.name"
|
||||||
:value="item2.id"
|
:value="item2.name"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -57,7 +57,6 @@
|
||||||
import * as PropertyApi from '@/api/mall/product/property'
|
import * as PropertyApi from '@/api/mall/product/property'
|
||||||
import { PropertyAndValues } from '@/views/mall/product/spu/components'
|
import { PropertyAndValues } from '@/views/mall/product/spu/components'
|
||||||
import { propTypes } from '@/utils/propTypes'
|
import { propTypes } from '@/utils/propTypes'
|
||||||
import { isNumber } from '@/utils/is'
|
|
||||||
|
|
||||||
defineOptions({ name: 'ProductAttributes' })
|
defineOptions({ name: 'ProductAttributes' })
|
||||||
|
|
||||||
|
@ -123,13 +122,11 @@ const handleInputConfirm = async (index: number, propertyId: number) => {
|
||||||
if (inputValue.value) {
|
if (inputValue.value) {
|
||||||
// 重复添加校验
|
// 重复添加校验
|
||||||
// TODO @芋艿:需要测试下
|
// TODO @芋艿:需要测试下
|
||||||
if (isNumber(inputValue.value)) {
|
if (attributeList.value[index].values.find((item) => item.name === inputValue.value)) {
|
||||||
if (attributeList.value[index].values?.some((item) => item.id === inputValue.value)) {
|
message.warning('已存在相同属性值,请重试')
|
||||||
message.warning('已存在相同属性值,请重试')
|
attributeIndex.value = null
|
||||||
attributeIndex.value = null
|
inputValue.value = ''
|
||||||
inputValue.value = ''
|
return
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// 保存属性值
|
// 保存属性值
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue