分离common-api端
This commit is contained in:
@@ -62,7 +62,11 @@
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import Search from './components/search.vue';
|
||||
import GoodsSkuEdit from './components/goodsSkuEdit.vue';
|
||||
import { pageGoodsSku, removeGoodsSku, removeBatchGoodsSku } from '@/api/shop/goodsSku';
|
||||
import {
|
||||
pageGoodsSku,
|
||||
removeGoodsSku,
|
||||
removeBatchGoodsSku
|
||||
} from '@/api/shop/goodsSku';
|
||||
import type { GoodsSku, GoodsSkuParam } from '@/api/shop/goodsSku/model';
|
||||
|
||||
// 表格实例
|
||||
@@ -105,85 +109,85 @@
|
||||
dataIndex: 'id',
|
||||
key: 'id',
|
||||
align: 'center',
|
||||
width: 90,
|
||||
width: 90
|
||||
},
|
||||
{
|
||||
title: '商品ID',
|
||||
dataIndex: 'goodsId',
|
||||
key: 'goodsId',
|
||||
align: 'center',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '商品属性索引值 (attr_value|attr_value[|....])',
|
||||
dataIndex: 'sku',
|
||||
key: 'sku',
|
||||
align: 'center',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '商品图片',
|
||||
dataIndex: 'image',
|
||||
key: 'image',
|
||||
align: 'center',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '商品价格',
|
||||
dataIndex: 'price',
|
||||
key: 'price',
|
||||
align: 'center',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '市场价格',
|
||||
dataIndex: 'salePrice',
|
||||
key: 'salePrice',
|
||||
align: 'center',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '成本价',
|
||||
dataIndex: 'cost',
|
||||
key: 'cost',
|
||||
align: 'center',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '库存',
|
||||
dataIndex: 'stock',
|
||||
key: 'stock',
|
||||
align: 'center',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: 'sku编码',
|
||||
dataIndex: 'skuNo',
|
||||
key: 'skuNo',
|
||||
align: 'center',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '唯一值',
|
||||
dataIndex: 'unique',
|
||||
key: 'unique',
|
||||
align: 'center',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '重量',
|
||||
dataIndex: 'weight',
|
||||
key: 'weight',
|
||||
align: 'center',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '体积',
|
||||
dataIndex: 'volume',
|
||||
key: 'volume',
|
||||
align: 'center',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '状态, 0正常, 1异常',
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
align: 'center',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
dataIndex: 'comments',
|
||||
key: 'comments',
|
||||
align: 'center',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
|
||||
@@ -19,29 +19,12 @@
|
||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||
"
|
||||
>
|
||||
<a-form-item label="商品多规格名称" name="goodsSpecName">
|
||||
<a-form-item label="商品多规格名称" name="specValue">
|
||||
<a-input
|
||||
allow-clear
|
||||
:maxlength="100"
|
||||
placeholder="请输入商品多规格"
|
||||
v-model:value="form.goodsSpecName"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="描述" name="comments">
|
||||
<a-textarea
|
||||
:rows="4"
|
||||
:maxlength="200"
|
||||
placeholder="请输入描述"
|
||||
v-model:value="form.comments"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="排序号" name="sortNumber">
|
||||
<a-input-number
|
||||
:min="0"
|
||||
:max="9999"
|
||||
class="ele-fluid"
|
||||
placeholder="请输入排序号"
|
||||
v-model:value="form.sortNumber"
|
||||
v-model:value="form.specValue"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="状态" name="status">
|
||||
@@ -92,11 +75,10 @@
|
||||
|
||||
// 用户信息
|
||||
const form = reactive<GoodsSpec>({
|
||||
goodsSpecId: undefined,
|
||||
goodsSpecName: '',
|
||||
status: 0,
|
||||
comments: '',
|
||||
sortNumber: 100
|
||||
id: undefined,
|
||||
specName: '',
|
||||
specId: undefined,
|
||||
specValue: ''
|
||||
});
|
||||
|
||||
/* 更新visible */
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
|
||||
// 用户信息
|
||||
const form = reactive<GoodsSpecRel>({
|
||||
goodsSpecRelId: undefined,
|
||||
id: undefined,
|
||||
goodsSpecRelName: '',
|
||||
status: 0,
|
||||
comments: '',
|
||||
@@ -130,7 +130,9 @@
|
||||
const formData = {
|
||||
...form
|
||||
};
|
||||
const saveOrUpdate = isUpdate.value ? updateGoodsSpecRel : addGoodsSpecRel;
|
||||
const saveOrUpdate = isUpdate.value
|
||||
? updateGoodsSpecRel
|
||||
: addGoodsSpecRel;
|
||||
saveOrUpdate(formData)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
|
||||
@@ -42,7 +42,11 @@
|
||||
</a-card>
|
||||
|
||||
<!-- 编辑弹窗 -->
|
||||
<GoodsSpecRelEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||
<GoodsSpecRelEdit
|
||||
v-model:visible="showEdit"
|
||||
:data="current"
|
||||
@done="reload"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -58,8 +62,15 @@
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import Search from './components/search.vue';
|
||||
import GoodsSpecRelEdit from './components/goodsSpecRelEdit.vue';
|
||||
import { pageGoodsSpecRel, removeGoodsSpecRel, removeBatchGoodsSpecRel } from '@/api/shop/goodsSpecRel';
|
||||
import type { GoodsSpecRel, GoodsSpecRelParam } from '@/api/shop/goodsSpecRel/model';
|
||||
import {
|
||||
pageGoodsSpecRel,
|
||||
removeGoodsSpecRel,
|
||||
removeBatchGoodsSpecRel
|
||||
} from '@/api/shop/goodsSpecRel';
|
||||
import type {
|
||||
GoodsSpecRel,
|
||||
GoodsSpecRelParam
|
||||
} from '@/api/shop/goodsSpecRel/model';
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
removeBatchMerchant
|
||||
} from '@/api/shop/merchant';
|
||||
import type { Merchant, MerchantParam } from '@/api/shop/merchant/model';
|
||||
import { getMerchantId, openUrl } from "@/utils/common";
|
||||
import { getMerchantId } from '@/utils/common';
|
||||
import router from '@/router';
|
||||
|
||||
// 表格实例
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
import SpecEdit from './components/specEdit.vue';
|
||||
import { pageSpec, removeSpec, removeBatchSpec } from '@/api/shop/spec';
|
||||
import type { Spec, SpecParam } from '@/api/shop/spec/model';
|
||||
import { getMerchantId } from "@/utils/merchant";
|
||||
import { getMerchantId } from '@/utils/merchant';
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
@@ -77,7 +77,6 @@
|
||||
} from '@/api/shop/specValue';
|
||||
import type { SpecValue, SpecValueParam } from '@/api/shop/specValue/model';
|
||||
import { Spec } from '@/api/shop/spec/model';
|
||||
import { FormInstance } from 'ant-design-vue/es/form';
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
|
||||
Reference in New Issue
Block a user