mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-08-01 03:34:07 +08:00
Merge remote-tracking branch 'yudao/master' into dev-to-dev
This commit is contained in:
@@ -443,14 +443,15 @@ const generateTableData = (propertyList: any[]) => {
|
||||
*/
|
||||
const validateData = (propertyList: any[]) => {
|
||||
const skuPropertyIds: number[] = []
|
||||
formData.value!.skus!.forEach((sku) =>
|
||||
sku.properties
|
||||
?.map((property) => property.propertyId)
|
||||
?.forEach((propertyId) => {
|
||||
if (skuPropertyIds.indexOf(propertyId!) === -1) {
|
||||
skuPropertyIds.push(propertyId!)
|
||||
}
|
||||
})
|
||||
formData.value!.skus!.forEach(
|
||||
(sku) =>
|
||||
sku.properties
|
||||
?.map((property) => property.propertyId)
|
||||
?.forEach((propertyId) => {
|
||||
if (skuPropertyIds.indexOf(propertyId!) === -1) {
|
||||
skuPropertyIds.push(propertyId!)
|
||||
}
|
||||
})
|
||||
)
|
||||
const propertyIds = propertyList.map((item) => item.id)
|
||||
return skuPropertyIds.length === propertyIds.length
|
||||
|
@@ -134,11 +134,7 @@ const open = async (type: string, id?: number) => {
|
||||
const data = (await CombinationActivityApi.getCombinationActivity(
|
||||
id
|
||||
)) as CombinationActivityApi.CombinationActivityVO
|
||||
await getSpuDetails(
|
||||
data.spuId!,
|
||||
data.products?.map((sku) => sku.skuId),
|
||||
data.products
|
||||
)
|
||||
await getSpuDetails(data.spuId!, data.products?.map((sku) => sku.skuId), data.products)
|
||||
formRef.value.setValues(data)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
|
@@ -98,9 +98,10 @@ const handleDelete = (id: number) => {
|
||||
tableMethods.delList(id, false)
|
||||
}
|
||||
|
||||
// TODO @puhui999:要不还是使用原生的 element plus 做。感觉 crud schema 复杂界面,做起来麻烦
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
/*
|
||||
/**
|
||||
TODO
|
||||
后面准备封装成一个函数来操作 tableColumns 重新排列:比如说需求是表单上商品选择是在后面的而列表展示的时候需要调到位置。
|
||||
封装效果支持批量操作,给出 field 和需要插入的位置,例:[{field:'spuId',index: 1}] 效果为把 field 为 spuId 的 column 移动到第一个位置
|
||||
|
@@ -50,8 +50,10 @@ const spuData = ref<Spu[]>([]) // spu 详情数据列表
|
||||
const skuListRef = ref() // 商品属性列表Ref
|
||||
const spuPropertyList = ref<SpuProperty<T>[]>([]) // spuId 对应的 sku 的属性列表
|
||||
const expandRowKeys = ref<number[]>() // 控制展开行需要设置 row-key 属性才能使用,该属性为展开行的 keys 数组。
|
||||
|
||||
/**
|
||||
* 获取所有 sku 活动配置
|
||||
*
|
||||
* @param extendedAttribute 在 sku 上扩展的属性,例:秒杀活动 sku 扩展属性 productConfig 请参考 seckillActivity.ts
|
||||
*/
|
||||
const getSkuConfigs = (extendedAttribute: string) => {
|
||||
|
@@ -144,11 +144,7 @@ const open = async (type: string, id?: number) => {
|
||||
const data = (await SeckillActivityApi.getSeckillActivity(
|
||||
id
|
||||
)) as SeckillActivityApi.SeckillActivityVO
|
||||
await getSpuDetails(
|
||||
data.spuId!,
|
||||
data.products?.map((sku) => sku.skuId),
|
||||
data.products
|
||||
)
|
||||
await getSpuDetails(data.spuId!, data.products?.map((sku) => sku.skuId), data.products)
|
||||
formRef.value.setValues(data)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
|
@@ -12,7 +12,7 @@
|
||||
<el-select class="!w-280px" v-model="queryParams.status" clearable placeholder="全部">
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.TRADE_ORDER_STATUS)"
|
||||
:key="(dict.value as string)"
|
||||
:key="dict.value as string"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
@@ -27,7 +27,7 @@
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.PAY_CHANNEL_CODE_TYPE)"
|
||||
:key="(dict.value as string)"
|
||||
:key="dict.value as string"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
@@ -48,7 +48,7 @@
|
||||
<el-select class="!w-280px" v-model="queryParams.terminal" clearable placeholder="全部">
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.TERMINAL)"
|
||||
:key="(dict.value as string)"
|
||||
:key="dict.value as string"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
@@ -58,7 +58,7 @@
|
||||
<el-select class="!w-280px" v-model="queryParams.type" clearable placeholder="全部">
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.TRADE_ORDER_TYPE)"
|
||||
:key="(dict.value as string)"
|
||||
:key="dict.value as string"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
|
Reference in New Issue
Block a user