|
@@ -80,8 +80,7 @@
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
import { onPath } from '@/utils/siteConfig';
|
|
import { onPath } from '@/utils/siteConfig';
|
|
|
import figure from '@/assets/images/figure.png';
|
|
import figure from '@/assets/images/figure.png';
|
|
|
-import { getDiyProductPage } from '@/api/home/diy';
|
|
|
|
|
-import { el } from 'element-plus/es/locale/index.mjs';
|
|
|
|
|
|
|
+import { getDiyProductPage, getCustomerProductPage } from '@/api/home/diy';
|
|
|
|
|
|
|
|
const props = defineProps<{
|
|
const props = defineProps<{
|
|
|
row?: any;
|
|
row?: any;
|
|
@@ -99,10 +98,21 @@ onMounted(() => {
|
|
|
|
|
|
|
|
const getDataList = () => {
|
|
const getDataList = () => {
|
|
|
original.value = [{}, {}, {}, {}, {}];
|
|
original.value = [{}, {}, {}, {}, {}];
|
|
|
|
|
+ const apiFunc = componentData.clientId && componentData.clientId !== 'undefined' ? getCustomerProductPage : getDiyProductPage;
|
|
|
|
|
+ const queryParams = {
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ pageSize: componentData.goodsType == 1 ? 20 : componentData.goodsNumber == 0 ? 9999 : componentData.goodsNumber,
|
|
|
|
|
+ customerId: ''
|
|
|
|
|
+ };
|
|
|
|
|
+ if (componentData.clientId && componentData.clientId != 'undefined') {
|
|
|
|
|
+ queryParams.customerId = componentData.clientId;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ delete queryParams.customerId;
|
|
|
|
|
+ }
|
|
|
//手动选择
|
|
//手动选择
|
|
|
if (componentData.goodsType == 1) {
|
|
if (componentData.goodsType == 1) {
|
|
|
if (componentData.goodsIds.length > 0) {
|
|
if (componentData.goodsIds.length > 0) {
|
|
|
- getDiyProductPage({ pageNum: 1, pageSize: 20, ids: componentData.goodsIds.join(',') }).then((res) => {
|
|
|
|
|
|
|
+ apiFunc({ ...queryParams, ids: componentData.goodsIds.join(',') }).then((res) => {
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
original.value = res.rows;
|
|
original.value = res.rows;
|
|
|
}
|
|
}
|
|
@@ -113,8 +123,7 @@ const getDataList = () => {
|
|
|
if (componentData.categoryIds && componentData.categoryIds.length > 0) {
|
|
if (componentData.categoryIds && componentData.categoryIds.length > 0) {
|
|
|
const categoryIds = componentData.categoryIds.map((item: any) => item[2]);
|
|
const categoryIds = componentData.categoryIds.map((item: any) => item[2]);
|
|
|
getDiyProductPage({
|
|
getDiyProductPage({
|
|
|
- pageNum: 1,
|
|
|
|
|
- pageSize: componentData.goodsNumber == 0 ? 9999 : componentData.goodsNumber,
|
|
|
|
|
|
|
+ ...queryParams,
|
|
|
categoryIds: categoryIds.join(',')
|
|
categoryIds: categoryIds.join(',')
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
@@ -128,8 +137,7 @@ const getDataList = () => {
|
|
|
//品牌查询
|
|
//品牌查询
|
|
|
if (componentData.brandIds && componentData.brandIds.length > 0) {
|
|
if (componentData.brandIds && componentData.brandIds.length > 0) {
|
|
|
getDiyProductPage({
|
|
getDiyProductPage({
|
|
|
- pageNum: 1,
|
|
|
|
|
- pageSize: componentData.goodsNumber == 0 ? 9999 : componentData.goodsNumber,
|
|
|
|
|
|
|
+ ...queryParams,
|
|
|
brandIds: componentData.brandIds.join(',')
|
|
brandIds: componentData.brandIds.join(',')
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|