This commit is contained in:
weipengfei 2024-05-09 14:42:24 +08:00
parent 61694fc119
commit 7712e2432d
7 changed files with 17 additions and 30 deletions

View File

@ -67,7 +67,7 @@ export function productDetailApi(mer_id, id, data) {
* @description 批发商品列表 * @description 批发商品列表
*/ */
export function saleStoreListApi(data) { export function saleStoreListApi(data) {
return request.get(`product/spu/lst`, { params: data }) return request.get(`/goods/goods/lists`, { params: data })
} }
/** /**

View File

@ -11,7 +11,7 @@ export function cartCreateApi(data) {
* @description 购物列表 * @description 购物列表
*/ */
export function cartListApi(data) { export function cartListApi(data) {
return request.get(`user/cart/lst`, { params: data }) return request.get(`/order/cart/list`, { params: data })
} }
/** /**

View File

@ -8,7 +8,7 @@ const routes = [
path: '/', path: '/',
name: 'layout', name: 'layout',
component: layout, component: layout,
redirect: '/home', redirect: '/saleHome',
meta: { title: '里海收银系统' }, meta: { title: '里海收银系统' },
children: [ children: [
{ {

View File

@ -16,7 +16,7 @@ const getCategoryList = () => {
active.value = -1; active.value = -1;
}); });
}; };
getCategoryList(); // getCategoryList();
const changeActive = (index=-1, idnexc=-1) => { const changeActive = (index=-1, idnexc=-1) => {
sactive.value = index; sactive.value = index;

View File

@ -40,16 +40,16 @@ const getList = () => {
costPrice.value = 0; costPrice.value = 0;
discounts.value = 0; discounts.value = 0;
cartListApi({ cartListApi({
staff_id: userStore.userInfo.service.service_id, // staff_id: userStore.userInfo.service.service_id,
sale_type: 2, sale_type: 2,
}).then((res) => { }).then((res) => {
if (res.data?.list?.length > 0) { // if (res.data?.list?.length > 0) {
list.value = res.data.list[0].list; // list.value = res.data.list[0].list;
list.value.forEach((item) => { // list.value.forEach((item) => {
allPrice.value += item.productAttr.price * item.cart_num; // allPrice.value += item.productAttr.price * item.cart_num;
}); // });
costPrice.value = allPrice.value; // costPrice.value = allPrice.value;
} else list.value = []; // } else list.value = [];
}); });
}; };
getList(); getList();

View File

@ -101,10 +101,10 @@ onUnmounted(() => {
:key="index" :key="index"
@click="changeItem(item)" @click="changeItem(item)"
> >
<el-image loading="lazy" :src="item.image"></el-image> <el-image loading="lazy" :src="item.imgs"></el-image>
<div class="shop-name">{{ item.store_name }}</div> <div class="shop-name">{{ item.name }}</div>
<div class="shop-price"> <div class="shop-price">
¥<span>{{ item.price }}</span> ¥<span>{{ item.sell }}/{{item.unit_name}}</span>
</div> </div>
<div class="no-stock" v-if="item.stock == 0"> <div class="no-stock" v-if="item.stock == 0">
<div> <div>

View File

@ -28,9 +28,6 @@ const where = ref({
}); });
const getStoreList = (data = {}, reload = false) => { const getStoreList = (data = {}, reload = false) => {
where.value = { where.value = {
staff_id: userStore.userInfo.service.service_id,
sale_type: 2,
mer_type: 1,
...where.value, ...where.value,
...data, ...data,
}; };
@ -40,18 +37,8 @@ const getStoreList = (data = {}, reload = false) => {
loadEnd.value = false; loadEnd.value = false;
} }
saleStoreListApi(where.value).then((res) => { saleStoreListApi(where.value).then((res) => {
if (res.data?.list?.length < where.value.limit) loadEnd.value = true; if (res.data?.lists?.length < where.value.limit) loadEnd.value = true;
let list = res.data.list.map((item) => { storeList.value = storeList.value.concat(res.data.lists);
Object.keys(item.sku).forEach(key=>{
if(item.sku[key].wholesale_price)item.sku[key].price = item.sku[key].wholesale_price;
})
item.attrValue.forEach(t => {
if(t.wholesale_price)t.price = t.wholesale_price;
});
item.attr = Object.keys(item.sku);
return item;
});
storeList.value = storeList.value.concat(list);
if ( if (
data.bar_code && data.bar_code &&
storeList.value.length == 1 && storeList.value.length == 1 &&