商品分类修复:

1.详情更新,列表未更新
2.开启库存后不填写库存,保存报错
3.多规格库存数量编辑权限验证
This commit is contained in:
YeMingfei666 2024-10-15 16:53:09 +08:00
parent 982bc23d3f
commit 61c455cdb7
3 changed files with 23 additions and 14 deletions

View File

@ -1,5 +1,5 @@
<template>
<view class="page">
<view class="page min-page">
<view class="box">
<view>
<uni-forms :model="category" :rules="rules" err-show-type="toast" ref="form"
@ -649,8 +649,9 @@
infoBox.showToast(option.type === 'edit' ? '修改成功' : '添加成功')
timer = setTimeout(() => {
clearTimeout(timer)
uni.$emit('update:pageCategoryIndex')
go.back()
}, 1500);
}, 500);
// const res = await form.value.validate().then(res => {
// go.back()
// })

View File

@ -25,20 +25,18 @@
<view class="u-m-t-24 u-flex u-row-between">
<view >
<template v-if="data.childrenList.length">
<!-- <template v-if="data.childrenList.length">
<view class="u-flex color-999 u-flex u-col-center" @tap="useTypeClick">
<text class="u-font-24">{{computedUserType}} </text>
<view class="u-flex">
<uni-icons type="right" color="#999"></uni-icons>
</view>
</view>
</template>
<template v-else>
</template> -->
<view class="u-flex">
<view class="u-m-r-18 color-999">开关</view>
<my-switch v-model="isShow" @change="isShowChange"></my-switch>
</view>
</template>
</view>
<view class="u-flex no-wrap">
@ -54,6 +52,7 @@
import {
computed,
ref,
watch,
watchEffect
} from 'vue';
import mySwitch from '@/components/my-components/my-switch.vue'
@ -71,7 +70,9 @@
data: {
type: Object,
default: () => {
return {}
return {
isShow:true
}
}
},
showChecked: {
@ -79,8 +80,10 @@
default: false
}
})
let isShow=ref(props.data.isShow)
watch(()=>props.data.isShow,(newval)=>{
isShow.value=newval
})
function isShowChange(){
console.log(isShow.value);
emits('isShowChange',{...props.data,isShow:isShow.value})

View File

@ -96,14 +96,10 @@
import {
reactive, ref, watch
} from 'vue';
import {onShow} from '@dcloudio/uni-app'
import {onShow,onLoad} from '@dcloudio/uni-app'
import go from '@/commons/utils/go.js';
import myCategory from './components/category.vue'
import infoBox from "@/commons/utils/infoBox.js"
import myPagination from '@/components/my-components/my-pagination.vue'
import myModel from "@/components/my-components/my-model.vue"
import myButton from "@/components/my-components/my-button.vue"
import mySwitch from "@/components/my-components/my-switch.vue"
import {$productCategory} from '@/http/yskApi/goods.js'
@ -162,9 +158,18 @@
})
pageData.totalElements=res.totalElements
}
onShow(()=>{
onLoad(()=>{
init()
})
function watchEvent(){
uni.$off('update:pageCategoryIndex')
uni.$on('update:pageCategoryIndex',(data)=>{
init()
})
}
onShow(()=>{
watchEvent()
})
function toAddCategory(){
go.to('PAGES_CATEGORY_EDIT',{type:'add'})
}