商品列表,商品给分组列表接口增加参数
This commit is contained in:
parent
07d02ada45
commit
510122921e
|
|
@ -41,11 +41,11 @@
|
|||
<view class="goods-list u-p-30">
|
||||
<template v-if="pageData.goodsList.length">
|
||||
<view class="u-m-b-32" v-for="(item,index) in pageData.goodsList" :key="index">
|
||||
<my-goods :key="item.id" @update="getGoodsList" @changePrice="changePriceShow" @changeClick="goodsChangeClick"
|
||||
@edit="toGoodsDetail"
|
||||
@editStock="changeStockShow" @guigeClick="editGuigeShow" @baosun="baosunShow"
|
||||
@radioClick="goodsRadioClick" :index="index" :data="item" @del="goodsDel"
|
||||
:showChecked="showChecked" :showDetail="pageData.showGoodsDetail"></my-goods>
|
||||
<my-goods :key="item.id" @update="getGoodsList" @changePrice="changePriceShow"
|
||||
@changeClick="goodsChangeClick" @edit="toGoodsDetail" @editStock="changeStockShow"
|
||||
@guigeClick="editGuigeShow" @baosun="baosunShow" @radioClick="goodsRadioClick" :index="index"
|
||||
:data="item" @del="goodsDel" :showChecked="showChecked"
|
||||
:showDetail="pageData.showGoodsDetail"></my-goods>
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="pageData.hasAjax&&!pageData.goodsList.length">
|
||||
|
|
@ -55,7 +55,7 @@
|
|||
<my-pagination :totalElements="pageData.totalElements" :size="pageData.query.size"
|
||||
@change="pageChange"></my-pagination>
|
||||
</template>
|
||||
|
||||
|
||||
<view style="height: 100rpx;"></view>
|
||||
</view>
|
||||
|
||||
|
|
@ -150,7 +150,9 @@
|
|||
watch
|
||||
} from 'vue';
|
||||
import go from '@/commons/utils/go.js';
|
||||
import {hasPermission} from '@/commons/utils/hasPermission.js';
|
||||
import {
|
||||
hasPermission
|
||||
} from '@/commons/utils/hasPermission.js';
|
||||
import myGoods from './components/goods.vue'
|
||||
import myControl from './components/control.vue'
|
||||
import myCategory from './components/category.vue'
|
||||
|
|
@ -191,10 +193,13 @@
|
|||
query: {
|
||||
page: 0,
|
||||
size: 10,
|
||||
createdAt: [],
|
||||
id: "",
|
||||
categoryId: '',
|
||||
name: '',
|
||||
isPauseSale:'',
|
||||
isGrounding:''
|
||||
isPauseSale: '',
|
||||
sort: "createdAt,desc",
|
||||
isGrounding: ''
|
||||
},
|
||||
category: '',
|
||||
categoryList: [], //分类列表
|
||||
|
|
@ -288,8 +293,8 @@
|
|||
|
||||
// 修改库存弹窗展示
|
||||
async function changeStockShow(index) {
|
||||
const res= await hasPermission('允许修改商品库存')
|
||||
if(!res){
|
||||
const res = await hasPermission('允许修改商品库存')
|
||||
if (!res) {
|
||||
return
|
||||
}
|
||||
pageData.selGoodsIndex = index
|
||||
|
|
@ -393,9 +398,10 @@
|
|||
pageData.totalElements = res.totalElements
|
||||
})
|
||||
}
|
||||
function watchEmitInit(){
|
||||
|
||||
function watchEmitInit() {
|
||||
uni.$off('update:productIndex')
|
||||
uni.$on('update:productIndex',(data)=>{
|
||||
uni.$on('update:productIndex', (data) => {
|
||||
getGoodsList()
|
||||
})
|
||||
}
|
||||
|
|
@ -425,6 +431,7 @@
|
|||
pageData.reportData = pageData.goodsList[index]
|
||||
reportDamage.value.open();
|
||||
}
|
||||
|
||||
function returnGoodsStockData() {
|
||||
return reactive({
|
||||
sort: 0,
|
||||
|
|
@ -472,7 +479,7 @@
|
|||
Object.assign(goodsStockData, goods)
|
||||
goodsStockModel.value.open()
|
||||
}
|
||||
|
||||
|
||||
//删除商品
|
||||
function goodsDel(index) {
|
||||
const goods = pageData.goodsList[index]
|
||||
|
|
@ -492,15 +499,15 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
function resetQuery(){
|
||||
pageData.totalElements=0;
|
||||
pageData.query.page=0;
|
||||
|
||||
function resetQuery() {
|
||||
pageData.totalElements = 0;
|
||||
pageData.query.page = 0;
|
||||
}
|
||||
|
||||
async function toGoodsDetail(id){
|
||||
const res= await hasPermission('允许修改商品')
|
||||
if(!res){
|
||||
|
||||
async function toGoodsDetail(id) {
|
||||
const res = await hasPermission('允许修改商品')
|
||||
if (!res) {
|
||||
return
|
||||
}
|
||||
go.to('PAGES_PRODUCT_ADD', {
|
||||
|
|
@ -508,30 +515,30 @@
|
|||
productId: id
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
function statesTableClick(index) {
|
||||
pageData.stateCurrent = index;
|
||||
resetQuery()
|
||||
console.log(index);
|
||||
if(index==0){
|
||||
pageData.query.isPauseSale=''
|
||||
pageData.query.isGrounding=''
|
||||
return
|
||||
if (index == 0) {
|
||||
pageData.query.isPauseSale = ''
|
||||
pageData.query.isGrounding = ''
|
||||
return
|
||||
}
|
||||
if(index==1){
|
||||
pageData.query.isPauseSale=1
|
||||
pageData.query.isGrounding=''
|
||||
return
|
||||
if (index == 1) {
|
||||
pageData.query.isPauseSale = 1
|
||||
pageData.query.isGrounding = ''
|
||||
return
|
||||
}
|
||||
if(index==2){
|
||||
pageData.query.isPauseSale=''
|
||||
pageData.query.isGrounding=1
|
||||
return
|
||||
if (index == 2) {
|
||||
pageData.query.isPauseSale = ''
|
||||
pageData.query.isGrounding = 1
|
||||
return
|
||||
}
|
||||
if(index==3){
|
||||
pageData.query.isPauseSale=''
|
||||
pageData.query.isGrounding=0
|
||||
return
|
||||
if (index == 3) {
|
||||
pageData.query.isPauseSale = ''
|
||||
pageData.query.isGrounding = 0
|
||||
return
|
||||
}
|
||||
}
|
||||
let test = ref(false)
|
||||
|
|
@ -539,7 +546,7 @@
|
|||
function tabsChange(i) {
|
||||
console.log(i);
|
||||
pageData.showGoodsDetail = i ? true : false
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue