更新订单列表详情,更新商品管理,更新代客下单
This commit is contained in:
@@ -8,7 +8,8 @@
|
||||
<view class="input-wrapper">
|
||||
<view class="input-main">
|
||||
<view class="u-flex u-p-r-30 u-font-28" @click="onCategoryShowChange(true)">
|
||||
<text class="u-m-r-10 u-line-1" style="max-width: 100rpx;">{{pageData.categoryName||'分类' }}</text>
|
||||
<text class="u-m-r-10 u-line-1"
|
||||
style="max-width: 100rpx;">{{pageData.categoryName||'分类' }}</text>
|
||||
<up-icon name="arrow-down" size="16"></up-icon>
|
||||
</view>
|
||||
<uni-easyinput clearable class='jeepay-search' :inputBorder="false"
|
||||
@@ -40,8 +41,10 @@
|
||||
<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 @changeClick="goodsChangeClick" @radioClick="goodsRadioClick" :index="index" :data="item"
|
||||
@del="goodsDel" :showChecked="showChecked" :showDetail="pageData.showGoodsDetail"></my-goods>
|
||||
<my-goods @changePrice="changePriceShow" @changeClick="goodsChangeClick"
|
||||
@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">
|
||||
@@ -53,9 +56,8 @@
|
||||
</view>
|
||||
|
||||
<my-control ref="control" :categoryShow="pageData.categoryShow" :categoryName="pageData.categoryName"
|
||||
@categoryChange="categoryIdChange" @offShelf="offShelf" @allCheckedChange="allCheckedChange"
|
||||
@controlChange="controlChange" @toggleCategory="toggleCategory"
|
||||
:bottom="pageData.componentBottom"></my-control>
|
||||
@offShelf="offShelf" @allCheckedChange="allCheckedChange" @controlChange="controlChange"
|
||||
@toggleCategory="toggleCategory" :bottom="pageData.componentBottom"></my-control>
|
||||
<!-- <my-category ref="category" @change="onCategoryShowChange" @cateClick="cateClick"
|
||||
:bottom="pageData.componentBottom+100"></my-category> -->
|
||||
<!-- 下架弹窗 -->
|
||||
@@ -113,7 +115,19 @@
|
||||
</my-model>
|
||||
|
||||
<!-- 分类 -->
|
||||
<my-category v-model:isShow="pageData.categoryShow" @confirm="setCategory"></my-category>
|
||||
<my-category v-model:isShow="pageData.categoryShow" @confirm="setCategory"></my-category>
|
||||
<!-- 修改价格弹窗 -->
|
||||
<edit-price :category="pageData.categoryList" v-model:show="popup.price.show" @save="changePriceConfirm"
|
||||
:goods="pageData.selGoods"></edit-price>
|
||||
<!-- 修改库存弹窗 -->
|
||||
<edit-stock :category="pageData.categoryList" v-model:show="popup.stock.show" @save="changeStockConfirm"
|
||||
:goods="pageData.selGoods"></edit-stock>
|
||||
<!-- 规格弹窗 -->
|
||||
<edit-guige @isGroundingChange="isGroundingChange" v-model:show="popup.guige.show"
|
||||
:goods="popup.guige.data"></edit-guige>
|
||||
<!-- 报损 -->
|
||||
<baosun-vue :category="pageData.categoryList" v-model:show="popup.baosun.show"
|
||||
:goods="pageData.selGoods"></baosun-vue>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
@@ -136,14 +150,25 @@
|
||||
import myControl from './components/control.vue'
|
||||
import myCategory from './components/category.vue'
|
||||
import infoBox from "@/commons/utils/infoBox.js"
|
||||
import editPrice from './components/edit-price.vue';
|
||||
import editGuige from './components/edit-guige.vue';
|
||||
import editStock from './components/edit-stock.vue';
|
||||
import baosunVue from './components/baosun.vue';
|
||||
import {
|
||||
$tbProduct,
|
||||
$upProSort,
|
||||
$updateProduct,
|
||||
$getProductDetail,
|
||||
$delProduct,
|
||||
$updateProductStatus
|
||||
$tbShopCategory,
|
||||
$updateProductStatus,
|
||||
$tbProductV2,
|
||||
$updateProductData
|
||||
} from "@/http/yskApi/goods.js"
|
||||
import {
|
||||
returnAllCategory
|
||||
} from '@/pageProduct/util.js'
|
||||
|
||||
const pageData = reactive({
|
||||
modelDesc: '是否下架',
|
||||
stateCurrent: 0,
|
||||
@@ -154,6 +179,7 @@
|
||||
},
|
||||
showGoodsDetail: false,
|
||||
selGoodsIndex: '',
|
||||
selGoods: {},
|
||||
totalElements: 0,
|
||||
totalPage: 0,
|
||||
goodsList: [],
|
||||
@@ -164,24 +190,179 @@
|
||||
name: ''
|
||||
},
|
||||
category: '',
|
||||
categoryList: [], //分类列表
|
||||
categoryShow: false,
|
||||
categoryName: '',
|
||||
hasAjax: false
|
||||
})
|
||||
watch(()=>pageData.query.categoryId,(newval)=>{
|
||||
watch(() => pageData.query.categoryId, (newval) => {
|
||||
getGoodsList()
|
||||
})
|
||||
|
||||
const popup = reactive({
|
||||
price: {
|
||||
show: false
|
||||
},
|
||||
guige: {
|
||||
show: false,
|
||||
data: {},
|
||||
goodsIndex: '',
|
||||
guigeIndex: '',
|
||||
},
|
||||
stock: {
|
||||
show: false
|
||||
},
|
||||
baosun: {
|
||||
show: false
|
||||
}
|
||||
})
|
||||
|
||||
//报损弹窗展示
|
||||
function baosunShow(index) {
|
||||
pageData.selGoodsIndex = index
|
||||
const goods = pageData.goodsList[index]
|
||||
pageData.selGoods = goods
|
||||
popup.baosun.show = true
|
||||
}
|
||||
|
||||
// 修改价格弹窗展示
|
||||
function changePriceShow(index) {
|
||||
pageData.selGoodsIndex = index
|
||||
const goods = pageData.goodsList[index]
|
||||
goods.skuList = goods.skuList.map(v => {
|
||||
return {
|
||||
...v,
|
||||
_lowPrice: v.lowPrice
|
||||
}
|
||||
})
|
||||
const lowPrice = goods.lowPrice.replace('¥', '') * 1
|
||||
pageData.selGoods = {
|
||||
...goods,
|
||||
lowPrice,
|
||||
_lowPrice: lowPrice
|
||||
}
|
||||
popup.price.show = true
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
async function changePriceConfirm(goods) {
|
||||
let goodsArr = []
|
||||
if (goods.typeEnum == '单规格') {
|
||||
goodsArr = [{
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
isSku: false,
|
||||
id: goods.id,
|
||||
key: 'salePrice',
|
||||
value: goods.lowPrice
|
||||
}]
|
||||
} else {
|
||||
goodsArr = goods.skuList.map(v => {
|
||||
return {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
isSku: true,
|
||||
id: v.id,
|
||||
key: 'salePrice',
|
||||
value: v.lowPrice
|
||||
}
|
||||
})
|
||||
}
|
||||
const res = await $updateProductData(goodsArr)
|
||||
popup.price.show = false
|
||||
getGoodsList()
|
||||
}
|
||||
|
||||
|
||||
// 修改库存弹窗展示
|
||||
function changeStockShow(index) {
|
||||
pageData.selGoodsIndex = index
|
||||
const goods = pageData.goodsList[index]
|
||||
goods.skuList = goods.skuList.map(v => {
|
||||
return {
|
||||
...v,
|
||||
_stockNumber: v.stockNumber
|
||||
}
|
||||
})
|
||||
const stockNumber = goods.stockNumber
|
||||
pageData.selGoods = {
|
||||
...goods,
|
||||
stockNumber,
|
||||
_stockNumber: stockNumber
|
||||
}
|
||||
popup.stock.show = true
|
||||
}
|
||||
async function changeStockConfirm(goods) {
|
||||
let goodsArr = []
|
||||
// if (goods.typeEnum == '单规格') {
|
||||
// goodsArr = [{
|
||||
// shopId: uni.getStorageSync('shopId'),
|
||||
// isSku: false,
|
||||
// id: goods.id,
|
||||
// key: 'stockNumber',
|
||||
// value: goods.stockNumber
|
||||
// }]
|
||||
// } else {
|
||||
// goodsArr = goods.skuList.map(v => {
|
||||
// return {
|
||||
// shopId: uni.getStorageSync('shopId'),
|
||||
// isSku: true,
|
||||
// id: v.id,
|
||||
// key: 'stockNumber',
|
||||
// value: v.stockNumber
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
goodsArr = [{
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
isSku: false,
|
||||
id: goods.id,
|
||||
key: 'stockNumber',
|
||||
value: goods.stockNumber
|
||||
}]
|
||||
const res = await $updateProductData(goodsArr)
|
||||
popup.stock.show = false
|
||||
getGoodsList()
|
||||
}
|
||||
|
||||
//修改规格上下架,售罄
|
||||
function editGuigeShow(goodsIndex, guigeIndex) {
|
||||
console.log(goodsIndex, guigeIndex);
|
||||
const goodsGuige = pageData.goodsList[goodsIndex].skuList[guigeIndex]
|
||||
popup.guige.data = goodsGuige
|
||||
popup.guige.goodsIndex = goodsIndex
|
||||
popup.guige.guigeIndex = guigeIndex
|
||||
popup.guige.show = true
|
||||
}
|
||||
|
||||
function isGroundingChange(e) {
|
||||
const {
|
||||
goodsIndex,
|
||||
guigeIndex
|
||||
} = popup.guige
|
||||
pageData.goodsList[goodsIndex].skuList[guigeIndex].isGrounding = e
|
||||
}
|
||||
|
||||
function isPauseSaleChange(e) {
|
||||
const {
|
||||
goodsIndex,
|
||||
guigeIndex
|
||||
} = popup.guige
|
||||
pageData.goodsList[goodsIndex].skuList[guigeIndex].isPauseSale = e
|
||||
}
|
||||
|
||||
function onCategoryShowChange(show) {
|
||||
console.log(show);
|
||||
pageData.categoryShow = show
|
||||
}
|
||||
function setCategory(category){
|
||||
|
||||
function setCategory(category) {
|
||||
pageData.query.categoryId = category.id
|
||||
pageData.categoryName = category.name
|
||||
}
|
||||
|
||||
function getGoodsList() {
|
||||
$tbProduct(pageData.query).then(res => {
|
||||
$tbProductV2(pageData.query).then(res => {
|
||||
pageData.hasAjax = true
|
||||
console.log(res);
|
||||
pageData.goodsList = res.content.map(v => {
|
||||
@@ -198,9 +379,18 @@
|
||||
onShow(() => {
|
||||
getGoodsList()
|
||||
})
|
||||
onLoad(() => {
|
||||
$tbShopCategory({
|
||||
page: 0,
|
||||
size: 200
|
||||
}).then(res => {
|
||||
pageData.categoryList = returnAllCategory(res.content)
|
||||
console.log(pageData.categoryList);
|
||||
})
|
||||
})
|
||||
|
||||
const tabsList = ['简洁', '详情']
|
||||
const statesTabsList = ['全部', '已售罄','在售中', '已下架']
|
||||
const statesTabsList = ['全部', '已售罄', '在售中', '已下架']
|
||||
const control = ref(null)
|
||||
const model = ref(null)
|
||||
const goodsStockModel = ref(null)
|
||||
|
||||
Reference in New Issue
Block a user