From 510122921ea8185e3873621337f91136ee58f017 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Fri, 11 Oct 2024 18:17:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E5=88=97=E8=A1=A8=EF=BC=8C?= =?UTF-8?q?=E5=95=86=E5=93=81=E7=BB=99=E5=88=86=E7=BB=84=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pageProduct/index/index.vue | 87 ++++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 40 deletions(-) diff --git a/pageProduct/index/index.vue b/pageProduct/index/index.vue index d63e14f..28b97cf 100644 --- a/pageProduct/index/index.vue +++ b/pageProduct/index/index.vue @@ -41,11 +41,11 @@ - + @@ -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 - + }