|
@@ -11,7 +11,7 @@
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
|
<view style="width:690upx;overflow:hidden;padding-left:30upx;">
|
|
<view style="width:690upx;overflow:hidden;padding-left:30upx;">
|
|
|
- <view class="flex title" v-if="info.status == 3" style="color:#063a86;font-weight:bold;">售价不低于平均成本就有利润</view>
|
|
|
|
|
|
|
+ <view class="flex title" v-if="info.status == 3" style="color:#063a86;font-weight:bold;">售价不低于平均成本即有利润</view>
|
|
|
<view class="flex title" v-else> 确认售价: </view>
|
|
<view class="flex title" v-else> 确认售价: </view>
|
|
|
<view class="flex title">
|
|
<view class="flex title">
|
|
|
<text style="font-size:24upx;font-weight:normal;color:#CCCCCC;">
|
|
<text style="font-size:24upx;font-weight:normal;color:#CCCCCC;">
|
|
@@ -40,35 +40,18 @@
|
|
|
<text style="color:green;margin-left:9upx;font-weight:normal;">...</text>
|
|
<text style="color:green;margin-left:9upx;font-weight:normal;">...</text>
|
|
|
</text>
|
|
</text>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="price-input-row">
|
|
|
|
|
|
|
+ <view
|
|
|
|
|
+ class="price-input-row"
|
|
|
|
|
+ :class="{'has-cancel-limit': Number(res.limitBuy) > 0}"
|
|
|
|
|
+ >
|
|
|
<input type="digit" v-model="res.suggestHjPrice" @focus="clearHjPrice(i)" placeholder="大客价" class="price-input" />
|
|
<input type="digit" v-model="res.suggestHjPrice" @focus="clearHjPrice(i)" placeholder="大客价" class="price-input" />
|
|
|
<input type="digit" v-model="res.suggestPrice" @focus="clearPrice(i)" @input="linkChange(i)" placeholder="批发价" class="price-input price-input-main" />
|
|
<input type="digit" v-model="res.suggestPrice" @focus="clearPrice(i)" @input="linkChange(i)" placeholder="批发价" class="price-input price-input-main" />
|
|
|
<input type="digit" v-model="res.suggestSkPrice" @focus="clearSkPrice(i)" placeholder="零售价" class="price-input" />
|
|
<input type="digit" v-model="res.suggestSkPrice" @focus="clearSkPrice(i)" placeholder="零售价" class="price-input" />
|
|
|
- </view>
|
|
|
|
|
- <view class="cancel-action-row" v-if="hasCancelAction(res)">
|
|
|
|
|
<view
|
|
<view
|
|
|
v-if="Number(res.limitBuy) > 0"
|
|
v-if="Number(res.limitBuy) > 0"
|
|
|
class="cancel-limit-btn"
|
|
class="cancel-limit-btn"
|
|
|
@click.stop="cancelLimitBuyFn(i)"
|
|
@click.stop="cancelLimitBuyFn(i)"
|
|
|
>取消限购</view>
|
|
>取消限购</view>
|
|
|
- <view
|
|
|
|
|
- v-if="hasFullOff(res)"
|
|
|
|
|
- class="cancel-action-btn"
|
|
|
|
|
- @click.stop="cancelFullOff(i)"
|
|
|
|
|
- >取消满减</view>
|
|
|
|
|
- <text
|
|
|
|
|
- v-if="hasFullOff(res)"
|
|
|
|
|
- class="action-tip full-off-tip"
|
|
|
|
|
- >满{{ res.reachNum }}↓{{ res.reachNumDiscount ? parseFloat(res.reachNumDiscount) : 0 }}</text>
|
|
|
|
|
- <view
|
|
|
|
|
- v-if="Number(res.discountPrice) > 0"
|
|
|
|
|
- class="cancel-action-btn"
|
|
|
|
|
- @click.stop="cancelDiscountFn(i)"
|
|
|
|
|
- >取消特价</view>
|
|
|
|
|
- <text
|
|
|
|
|
- v-if="Number(res.discountPrice) > 0"
|
|
|
|
|
- class="action-tip discount-tip"
|
|
|
|
|
- >特价{{ res.discountPrice ? parseFloat(res.discountPrice) : 0 }}</text>
|
|
|
|
|
<text
|
|
<text
|
|
|
v-if="Number(res.limitBuy) > 0"
|
|
v-if="Number(res.limitBuy) > 0"
|
|
|
class="limit-buy-tip"
|
|
class="limit-buy-tip"
|
|
@@ -76,10 +59,9 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view class="item-remark-row" v-if="res.itemRemark">
|
|
<view class="item-remark-row" v-if="res.itemRemark">
|
|
|
<view class="item-remark-content">
|
|
<view class="item-remark-content">
|
|
|
- <text class="item-remark-label">备注</text>
|
|
|
|
|
<text class="item-remark-text">{{ res.itemRemark }}</text>
|
|
<text class="item-remark-text">{{ res.itemRemark }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
- <text class="item-remark-cancel" @click.stop="clearItemRemarkFn(i)">清除备注</text>
|
|
|
|
|
|
|
+ <text class="item-remark-cancel" @click.stop="clearItemRemarkFn(i)">删除备注</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -109,7 +91,7 @@
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
-import { getAllProductDataApi,batchChangePrice,cancelDiscountPrice,cancelFullOffFn } from "@/api/product";
|
|
|
|
|
|
|
+import { getAllProductDataApi,batchChangePrice } from "@/api/product";
|
|
|
import { getCgItemList,getPurchaseDetailApi,confirmPutIn,saveCgPrice } from "@/api/purchase";
|
|
import { getCgItemList,getPurchaseDetailApi,confirmPutIn,saveCgPrice } from "@/api/purchase";
|
|
|
import { cancelLimitBuy, clearItemRemark } from "@/api/item";
|
|
import { cancelLimitBuy, clearItemRemark } from "@/api/item";
|
|
|
import { IMGHOST } from '@/config'
|
|
import { IMGHOST } from '@/config'
|
|
@@ -136,12 +118,6 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- hasFullOff(item) {
|
|
|
|
|
- return item && Number(item.reachNum) > 0 && Number(item.reachNumDiscount) > 0
|
|
|
|
|
- },
|
|
|
|
|
- hasCancelAction(item) {
|
|
|
|
|
- return Number(item.limitBuy) > 0 || Number(item.discountPrice) > 0 || this.hasFullOff(item)
|
|
|
|
|
- },
|
|
|
|
|
linkChange(i){
|
|
linkChange(i){
|
|
|
if(this.flowersList[i].suggestPrice && Number(this.flowersList[i].suggestPrice)>0){
|
|
if(this.flowersList[i].suggestPrice && Number(this.flowersList[i].suggestPrice)>0){
|
|
|
let skMore = this.flowersList[i].skMore ? Number(this.flowersList[i].skMore) : 0
|
|
let skMore = this.flowersList[i].skMore ? Number(this.flowersList[i].skMore) : 0
|
|
@@ -310,63 +286,6 @@ export default {
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- cancelFullOff(index){
|
|
|
|
|
- const item = this.flowersList[index]
|
|
|
|
|
- if (!this.hasFullOff(item)) {
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- const productId = item.productId
|
|
|
|
|
- if (!productId) {
|
|
|
|
|
- this.$msg('花材信息缺失')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- this.$util.confirmModal({ content: '确认取消满减?' }, () => {
|
|
|
|
|
- let pendingMsg = ''
|
|
|
|
|
- uni.showLoading({ mask: true })
|
|
|
|
|
- cancelFullOffFn({ id: productId }).then(res => {
|
|
|
|
|
- if (res.code == 1) {
|
|
|
|
|
- this.$set(this.flowersList[index], 'reachNum', 0)
|
|
|
|
|
- this.$set(this.flowersList[index], 'reachNumDiscount', 0)
|
|
|
|
|
- pendingMsg = res.msg || '取消成功'
|
|
|
|
|
- }
|
|
|
|
|
- }).finally(() => {
|
|
|
|
|
- uni.hideLoading()
|
|
|
|
|
- if (pendingMsg) {
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- this.$msg(pendingMsg)
|
|
|
|
|
- }, 100)
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- cancelDiscountFn(index){
|
|
|
|
|
- const item = this.flowersList[index]
|
|
|
|
|
- if (!item || Number(item.discountPrice) <= 0) {
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- const productId = item.productId
|
|
|
|
|
- if (!productId) {
|
|
|
|
|
- this.$msg('花材信息缺失')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- this.$util.confirmModal({ content: '确认取消特价?' }, () => {
|
|
|
|
|
- let pendingMsg = ''
|
|
|
|
|
- uni.showLoading({ mask: true })
|
|
|
|
|
- cancelDiscountPrice({ id: productId }).then(res => {
|
|
|
|
|
- if (res.code == 1) {
|
|
|
|
|
- this.$set(this.flowersList[index], 'discountPrice', 0)
|
|
|
|
|
- pendingMsg = res.msg || '取消成功'
|
|
|
|
|
- }
|
|
|
|
|
- }).finally(() => {
|
|
|
|
|
- uni.hideLoading()
|
|
|
|
|
- if (pendingMsg) {
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- this.$msg(pendingMsg)
|
|
|
|
|
- }, 100)
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
savePrice(){
|
|
savePrice(){
|
|
|
let that = this
|
|
let that = this
|
|
|
let hasError = false
|
|
let hasError = false
|
|
@@ -527,10 +446,8 @@ export default {
|
|
|
/* #else */
|
|
/* #else */
|
|
|
// 苹果微信小程序 iOS WebKit 特殊修复
|
|
// 苹果微信小程序 iOS WebKit 特殊修复
|
|
|
-webkit-appearance: none;
|
|
-webkit-appearance: none;
|
|
|
- appearance: none;
|
|
|
|
|
-webkit-tap-highlight-color: transparent;
|
|
-webkit-tap-highlight-color: transparent;
|
|
|
-webkit-user-select: none;
|
|
-webkit-user-select: none;
|
|
|
- user-select: none;
|
|
|
|
|
/* #endif */
|
|
/* #endif */
|
|
|
/* #endif */
|
|
/* #endif */
|
|
|
}
|
|
}
|
|
@@ -544,10 +461,10 @@ export default {
|
|
|
overflow:hidden;
|
|
overflow:hidden;
|
|
|
.price-input{
|
|
.price-input{
|
|
|
flex-shrink:0;
|
|
flex-shrink:0;
|
|
|
- width:125upx;
|
|
|
|
|
|
|
+ width:150upx;
|
|
|
height:60upx;
|
|
height:60upx;
|
|
|
margin-left:5upx;
|
|
margin-left:5upx;
|
|
|
- margin-right:30upx;
|
|
|
|
|
|
|
+ margin-right:50upx;
|
|
|
border:1upx solid #cccccc;
|
|
border:1upx solid #cccccc;
|
|
|
text-align:center;
|
|
text-align:center;
|
|
|
font-size:32upx;
|
|
font-size:32upx;
|
|
@@ -556,28 +473,25 @@ export default {
|
|
|
/* #ifdef APP-PLUS */
|
|
/* #ifdef APP-PLUS */
|
|
|
/* #else */
|
|
/* #else */
|
|
|
-webkit-appearance: none;
|
|
-webkit-appearance: none;
|
|
|
- appearance: none;
|
|
|
|
|
-webkit-tap-highlight-color: transparent;
|
|
-webkit-tap-highlight-color: transparent;
|
|
|
-webkit-user-select: none;
|
|
-webkit-user-select: none;
|
|
|
- user-select: none;
|
|
|
|
|
/* #endif */
|
|
/* #endif */
|
|
|
/* #endif */
|
|
/* #endif */
|
|
|
}
|
|
}
|
|
|
|
|
+ .price-input:last-of-type{
|
|
|
|
|
+ margin-right:0;
|
|
|
|
|
+ }
|
|
|
.price-input-main{
|
|
.price-input-main{
|
|
|
border:1upx solid #3385FF;
|
|
border:1upx solid #3385FF;
|
|
|
color:#3385FF;
|
|
color:#3385FF;
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- .cancel-action-row{
|
|
|
|
|
- display:flex;
|
|
|
|
|
- flex-direction:row;
|
|
|
|
|
- flex-wrap:nowrap;
|
|
|
|
|
- align-items:center;
|
|
|
|
|
- margin:10upx 0;
|
|
|
|
|
- width:100%;
|
|
|
|
|
|
|
+ &.has-cancel-limit{
|
|
|
|
|
+ padding-right:72upx;
|
|
|
|
|
+ }
|
|
|
.cancel-limit-btn{
|
|
.cancel-limit-btn{
|
|
|
flex-shrink:0;
|
|
flex-shrink:0;
|
|
|
padding:0 10upx;
|
|
padding:0 10upx;
|
|
|
|
|
+ margin-left:15upx;
|
|
|
height:60upx;
|
|
height:60upx;
|
|
|
line-height:60upx;
|
|
line-height:60upx;
|
|
|
font-size:24upx;
|
|
font-size:24upx;
|
|
@@ -587,37 +501,17 @@ export default {
|
|
|
border-radius:6upx;
|
|
border-radius:6upx;
|
|
|
white-space:nowrap;
|
|
white-space:nowrap;
|
|
|
}
|
|
}
|
|
|
- .cancel-action-btn{
|
|
|
|
|
- flex-shrink:0;
|
|
|
|
|
- padding:0 10upx;
|
|
|
|
|
- margin-left:8upx;
|
|
|
|
|
- height:60upx;
|
|
|
|
|
- line-height:60upx;
|
|
|
|
|
- font-size:24upx;
|
|
|
|
|
- font-weight:bold;
|
|
|
|
|
- color:#ffffff;
|
|
|
|
|
- background:#d70021;
|
|
|
|
|
- border-radius:6upx;
|
|
|
|
|
- white-space:nowrap;
|
|
|
|
|
- }
|
|
|
|
|
.limit-buy-tip{
|
|
.limit-buy-tip{
|
|
|
- flex-shrink:0;
|
|
|
|
|
- margin-left:8upx;
|
|
|
|
|
|
|
+ position:absolute;
|
|
|
|
|
+ right:0;
|
|
|
|
|
+ top:0;
|
|
|
height:60upx;
|
|
height:60upx;
|
|
|
line-height:60upx;
|
|
line-height:60upx;
|
|
|
color:#ff4d4f;
|
|
color:#ff4d4f;
|
|
|
font-size:24upx;
|
|
font-size:24upx;
|
|
|
font-weight:bold;
|
|
font-weight:bold;
|
|
|
white-space:nowrap;
|
|
white-space:nowrap;
|
|
|
- }
|
|
|
|
|
- .action-tip{
|
|
|
|
|
- flex-shrink:0;
|
|
|
|
|
- margin-left:8upx;
|
|
|
|
|
- height:60upx;
|
|
|
|
|
- line-height:60upx;
|
|
|
|
|
- color:#ff0025;
|
|
|
|
|
- font-size:24upx;
|
|
|
|
|
- white-space:nowrap;
|
|
|
|
|
|
|
+ z-index:1;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -639,15 +533,8 @@ export default {
|
|
|
min-width: 0;
|
|
min-width: 0;
|
|
|
margin-right: 16upx;
|
|
margin-right: 16upx;
|
|
|
}
|
|
}
|
|
|
- .item-remark-label {
|
|
|
|
|
- font-size: 28upx;
|
|
|
|
|
- font-weight: bold;
|
|
|
|
|
- color: #ff8c3a;
|
|
|
|
|
- margin-right: 10upx;
|
|
|
|
|
- flex-shrink: 0;
|
|
|
|
|
- }
|
|
|
|
|
.item-remark-text {
|
|
.item-remark-text {
|
|
|
- font-size: 30upx;
|
|
|
|
|
|
|
+ font-size: 26upx;
|
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
|
color: #ff2842;
|
|
color: #ff2842;
|
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
@@ -657,7 +544,7 @@ export default {
|
|
|
min-width: 0;
|
|
min-width: 0;
|
|
|
}
|
|
}
|
|
|
.item-remark-cancel {
|
|
.item-remark-cancel {
|
|
|
- font-size: 24upx;
|
|
|
|
|
|
|
+ font-size: 26upx;
|
|
|
color: #999;
|
|
color: #999;
|
|
|
flex-shrink: 0;
|
|
flex-shrink: 0;
|
|
|
padding: 6upx 0 6upx 10upx;
|
|
padding: 6upx 0 6upx 10upx;
|