增加修改分组名称,增加分组商品编辑权限验证
This commit is contained in:
parent
79255c2c94
commit
01610734c7
|
|
@ -118,7 +118,7 @@
|
|||
tbProductGroupPost
|
||||
} from "@/http/yskApi/shop.js"
|
||||
|
||||
|
||||
import {hasPermission} from '@/commons/utils/hasPermission.js';
|
||||
|
||||
import {
|
||||
returnAllCategory
|
||||
|
|
@ -260,6 +260,10 @@
|
|||
}
|
||||
|
||||
async function save() {
|
||||
const res=await hasPermission('允许修改分组')
|
||||
if(!res){
|
||||
return
|
||||
}
|
||||
console.log(pageData.goodsList);
|
||||
await tbProductGroupPut({
|
||||
...option,
|
||||
|
|
@ -275,7 +279,11 @@
|
|||
}
|
||||
|
||||
//删除商品
|
||||
function goodsDel(index) {
|
||||
async function goodsDel(index) {
|
||||
const res=await hasPermission('允许修改分组')
|
||||
if(!res){
|
||||
return
|
||||
}
|
||||
const goods = pageData.bindGoodsList[index]
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-36">
|
||||
<view>修改排序:</view>
|
||||
<view>修改分组名称:</view>
|
||||
<view class="u-m-t-38">
|
||||
<view class="u-m-b-32">
|
||||
<view class="u-m-t-16">
|
||||
<up-input v-model="sort">
|
||||
<up-input v-model="name">
|
||||
</up-input>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -59,7 +59,7 @@
|
|||
item: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
sort:''
|
||||
name:''
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
@ -74,10 +74,10 @@
|
|||
note: ''
|
||||
})
|
||||
let popShow = ref(props.show)
|
||||
let sort=ref('')
|
||||
let name=ref('')
|
||||
|
||||
watch(()=>props.item.sort,(newval)=>{
|
||||
sort.value=newval
|
||||
watch(()=>props.item.name,(newval)=>{
|
||||
name.value=newval
|
||||
})
|
||||
|
||||
watch(() => props.show, (newval) => {
|
||||
|
|
@ -105,7 +105,7 @@
|
|||
function save() {
|
||||
emits('save', {
|
||||
...data.value,
|
||||
sort:sort.value
|
||||
name:name.value
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
<view class="u-m-b-32" v-for="(item,index) in pageData.list" :key="index">
|
||||
<my-category @del="categoryDel" @useTypeClick="categoryUseTypeClick"
|
||||
@editName="popupShow($event,'name',true)"
|
||||
@editSort="popupShow($event,'sort',true)" @edit="actionsShow" @radioClick="goodsRadioClick"
|
||||
@isShowChange="isSHowChange" :index="index" :data="item" :showChecked="showChecked"
|
||||
:showDetail="pageData.showGoodsDetail"></my-category>
|
||||
|
|
@ -23,6 +24,7 @@
|
|||
</view>
|
||||
|
||||
<edit-sort @save="updataGroup" :item="popup.selData" v-model:show="popup.sort.show"></edit-sort>
|
||||
<edit-name @save="updataGroup" :item="popup.selData" v-model:show="popup.name.show"></edit-name>
|
||||
|
||||
<up-action-sheet :round="10" @select="actionSelect" @close="actionsHide" cancelText="取消" :actions="actions.list"
|
||||
:show="actions.show"></up-action-sheet>
|
||||
|
|
@ -41,6 +43,7 @@
|
|||
import myCategory from './components/category.vue'
|
||||
import infoBox from "@/commons/utils/infoBox.js"
|
||||
import editSort from './components/edit-sort.vue';
|
||||
import editName from './components/edit-name.vue';
|
||||
import {
|
||||
tbProductGroupGet,
|
||||
tbProductGroupDelete,
|
||||
|
|
@ -100,6 +103,9 @@
|
|||
},
|
||||
sort: {
|
||||
show: false
|
||||
},
|
||||
name:{
|
||||
show: false
|
||||
}
|
||||
})
|
||||
|
||||
|
|
@ -112,6 +118,7 @@
|
|||
console.log(e);
|
||||
const res = await $productCategory.update(e)
|
||||
popup.sort.show = false;
|
||||
popup.name.show = false;
|
||||
pageData.list[popup.selIndex] = e
|
||||
infoBox.showToast('更新成功')
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue