diff --git a/pageProduct/add-Product/add-Product.vue b/pageProduct/add-Product/add-Product.vue index dcac0f8..faeecc9 100644 --- a/pageProduct/add-Product/add-Product.vue +++ b/pageProduct/add-Product/add-Product.vue @@ -217,7 +217,7 @@ - + --> - + @@ -418,11 +418,17 @@ 注:关闭则不计算出入库数据 @@ -588,10 +594,10 @@ if (!res) { return } - await upDateGoods({ - key: 'pauseSale', - value: FormData.isPauseSale ? 0 : 1 - }) + // await upDateGoods({ + // key: 'pauseSale', + // value: FormData.isPauseSale ? 0 : 1 + // }) FormData.isPauseSale = FormData.isPauseSale ? 0 : 1 } @@ -604,10 +610,10 @@ if (!res) { return } - await upDateGoods({ - key: 'grounding', - value: FormData.isGrounding ? 0 : 1 - }) + // await upDateGoods({ + // key: 'grounding', + // value: FormData.isGrounding ? 0 : 1 + // }) FormData.isGrounding = FormData.isGrounding ? 0 : 1 } @@ -857,7 +863,7 @@ title: '删除成功' }) setTimeout(() => { - uni.$emit('del:productIndex',option.productId) + uni.$emit('del:productIndex', option.productId) go.back() }, 500) }) @@ -1327,10 +1333,12 @@ } const skuSnap = [] let submitSkuList = skuList.list || [] - if(option.type=='edit'){ - submitSkuList=submitSkuList.map(v=>{ - return{ - ...v,productId:FormData.id,shopId:uni.getStorageSync('shopId') + if (option.type == 'edit') { + submitSkuList = submitSkuList.map(v => { + return { + ...v, + productId: FormData.id, + shopId: uni.getStorageSync('shopId') } }) } @@ -1366,18 +1374,22 @@ const lowPrice = submitSkuList[0] ? submitSkuList[0].salePrice : FormData.salePrice // const lowPrice = submitSkuList[0] ? submitSkuList[0].salePrice : FormData.salePrice const suit = submitSkuList[0] ? submitSkuList[0].suit : 0 - if(typeEnum=='normal'){ - if(lowPrice===''){ + const stockNumber = FormData.stockNumber + if (typeEnum == 'normal') { + if (lowPrice === '') { return infoBox.showToast('请输入售价') } - if(lowPrice===''){ + if (lowPrice === '') { return infoBox.showToast('请输入售价') } - if(suit<=0){ + if (suit <= 0) { return infoBox.showToast('起售数量不能小于0!') } + if(stockNumber===''){ + return infoBox.showToast('请输入库存数量!') + } } - + const submitData = { ...FormData, images: images, @@ -1462,6 +1474,7 @@ uni.setStorageSync('guige', FormData.specificationsGroup) go.to('PAGES_PRODUCT_GUIGE_CHOOSE', { emitName: 'emitspecificationsSave', + type:option.type, productId: option.productId }) // go.to('PAGES_PRODUCT_GUIGE_ADD', { @@ -1566,11 +1579,12 @@ // 允许修改商品库存 let disabledStock = ref(false) - async function canEditGoodsStock() { + async function canEditGoodsStock(tips = false) { + console.log(tips); if (option.type === 'edit') { const res = await hasPermission({ text: '允许修改商品库存', - tips: false + tips: tips }) disabledStock.value = !res } diff --git a/pageProduct/add-specifications/choose-specifications.vue b/pageProduct/add-specifications/choose-specifications.vue index d2d4298..1577f25 100644 --- a/pageProduct/add-specifications/choose-specifications.vue +++ b/pageProduct/add-specifications/choose-specifications.vue @@ -90,12 +90,17 @@ :placeholderStyle="placeholderStyle" :inputBorder="inputBorder" v-model="item.skus.suit" type="digit" placeholder="请输入起售数量" /> - - - + + + + + + + + { + canEditGoodsStock() + }) + onLoad(opt => { + Object.assign(option,opt) getTbProductSpec() const obj = uni.getStorageSync('guige') if (obj && JSON.stringify(obj) !== '{}') {