修复商品编辑时,修改上下架保存因提交参数里skulist的上下架值并未跟总体走导致的商品列表数据不同步问题
This commit is contained in:
@@ -33,7 +33,8 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<uni-forms-item ref="fileItem" label="图片" required showRequired>
|
<uni-forms-item ref="fileItem" label="图片" required showRequired>
|
||||||
<my-upload-file ref="refFile" :images="FormData.images" :imageStyles="imageStyles"></my-upload-file>
|
<my-upload-file ref="refFile" :images="FormData.images"
|
||||||
|
:imageStyles="imageStyles"></my-upload-file>
|
||||||
<view class="u-m-t-16 color-999 u-font-24">
|
<view class="u-m-t-16 color-999 u-font-24">
|
||||||
注:第一张图为商品封面图,图片尺寸为750x750
|
注:第一张图为商品封面图,图片尺寸为750x750
|
||||||
</view>
|
</view>
|
||||||
@@ -423,13 +424,13 @@
|
|||||||
<template v-if="FormData.isStock">
|
<template v-if="FormData.isStock">
|
||||||
<view class="u-relative">
|
<view class="u-relative">
|
||||||
<uni-forms-item label="库存数量">
|
<uni-forms-item label="库存数量">
|
||||||
<uni-easyinput
|
<uni-easyinput @blur="priceFormat(FormData,'stockNumber')"
|
||||||
@blur="priceFormat(FormData,'stockNumber')"
|
:paddingNone="inputPaddingNone" :disabled="disabledStock"
|
||||||
:paddingNone="inputPaddingNone" :disabled="disabledStock"
|
|
||||||
:placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
:placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||||
v-model="FormData.stockNumber" type="digit" placeholder="请输入库存数量" />
|
v-model="FormData.stockNumber" type="digit" placeholder="请输入库存数量" />
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<view class="u-absolute position-all" v-if="disabledStock" @click="canEditGoodsStock(true)">
|
<view class="u-absolute position-all" v-if="disabledStock"
|
||||||
|
@click="canEditGoodsStock(true)">
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -440,13 +441,13 @@
|
|||||||
<my-switch v-model="FormData.isHot"></my-switch>
|
<my-switch v-model="FormData.isHot"></my-switch>
|
||||||
</view>
|
</view>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="">
|
<!-- <uni-forms-item label="">
|
||||||
<view class="u-flex u-row-between">
|
<view class="u-flex u-row-between">
|
||||||
<view class="label-title">标签打印</view>
|
<view class="label-title">标签打印</view>
|
||||||
<my-switch v-model="FormData.enableLabel"></my-switch>
|
<my-switch v-model="FormData.enableLabel"></my-switch>
|
||||||
</view>
|
</view>
|
||||||
<view class="color-999 u-m-t-16 u-font-24">开启后: 收银完成后会自动打印对应数量的标签数</view>
|
<view class="color-999 u-m-t-16 u-font-24">开启后: 收银完成后会自动打印对应数量的标签数</view>
|
||||||
</uni-forms-item>
|
</uni-forms-item> -->
|
||||||
<uni-forms-item label="打包费">
|
<uni-forms-item label="打包费">
|
||||||
<uni-easyinput @blur="priceFormat(FormData,'packFee')"
|
<uni-easyinput @blur="priceFormat(FormData,'packFee')"
|
||||||
:paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
|
:paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
|
||||||
@@ -575,11 +576,11 @@
|
|||||||
watch,
|
watch,
|
||||||
nextTick
|
nextTick
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
const imageStyles=reactive({
|
const imageStyles = reactive({
|
||||||
width:82,
|
width: 82,
|
||||||
height:82,
|
height: 82,
|
||||||
border:{
|
border: {
|
||||||
radius:'4px'
|
radius: '4px'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
async function upDateGoods(par) {
|
async function upDateGoods(par) {
|
||||||
@@ -1394,7 +1395,7 @@
|
|||||||
if (suit <= 0) {
|
if (suit <= 0) {
|
||||||
return infoBox.showToast('起售数量不能小于0!')
|
return infoBox.showToast('起售数量不能小于0!')
|
||||||
}
|
}
|
||||||
if(stockNumber===''){
|
if (stockNumber === '') {
|
||||||
return infoBox.showToast('请输入库存数量!')
|
return infoBox.showToast('请输入库存数量!')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1413,9 +1414,20 @@
|
|||||||
//编辑
|
//编辑
|
||||||
if (option.type === 'edit') {
|
if (option.type === 'edit') {
|
||||||
return $updateProduct(submitData).then(res => {
|
return $updateProduct(submitData).then(res => {
|
||||||
infoBox.showSuccessToast('更新成功')
|
$updateProductData([{
|
||||||
settimeoutBack(1500)
|
id: FormData.id,
|
||||||
|
isSku: 0,
|
||||||
|
shopId: uni.getStorageSync('shopId'),
|
||||||
|
key: 'grounding',
|
||||||
|
value: FormData.isGrounding
|
||||||
|
}]).then(() => {
|
||||||
|
infoBox.showSuccessToast('更新成功')
|
||||||
|
settimeoutBack(1500)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
submitData.selectSpec =
|
submitData.selectSpec =
|
||||||
$addProduct(submitData).then(res => {
|
$addProduct(submitData).then(res => {
|
||||||
@@ -1483,7 +1495,7 @@
|
|||||||
uni.setStorageSync('guige', FormData.specificationsGroup)
|
uni.setStorageSync('guige', FormData.specificationsGroup)
|
||||||
go.to('PAGES_PRODUCT_GUIGE_CHOOSE', {
|
go.to('PAGES_PRODUCT_GUIGE_CHOOSE', {
|
||||||
emitName: 'emitspecificationsSave',
|
emitName: 'emitspecificationsSave',
|
||||||
type:option.type,
|
type: option.type,
|
||||||
productId: option.productId
|
productId: option.productId
|
||||||
})
|
})
|
||||||
// go.to('PAGES_PRODUCT_GUIGE_ADD', {
|
// go.to('PAGES_PRODUCT_GUIGE_ADD', {
|
||||||
@@ -1628,6 +1640,9 @@
|
|||||||
onReady(() => {
|
onReady(() => {
|
||||||
Forms.value && Forms.value.setRules(rules)
|
Forms.value && Forms.value.setRules(rules)
|
||||||
})
|
})
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
clearTimeout(timer)
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
page {
|
page {
|
||||||
@@ -1647,10 +1662,12 @@
|
|||||||
// /* #endif */
|
// /* #endif */
|
||||||
// z-index: 999;
|
// z-index: 999;
|
||||||
}
|
}
|
||||||
::v-deep .uni-forms-item--border{
|
|
||||||
|
::v-deep .uni-forms-item--border {
|
||||||
padding-top: 12px;
|
padding-top: 12px;
|
||||||
padding-bottom: 12px;
|
padding-bottom: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stick-bottom {
|
.stick-bottom {
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
@@ -1708,6 +1725,7 @@
|
|||||||
.box {
|
.box {
|
||||||
margin-top: 32rpx;
|
margin-top: 32rpx;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
|
|
||||||
.block {
|
.block {
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
border-radius: 8rpx 18rpx 8rpx 18rpx;
|
border-radius: 8rpx 18rpx 8rpx 18rpx;
|
||||||
|
|||||||
Reference in New Issue
Block a user