|
@@ -84,6 +84,14 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view class="detail-price_box" style="font-size: 28upx;" v-else>0</view>
|
|
<view class="detail-price_box" style="font-size: 28upx;" v-else>0</view>
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
|
|
+
|
|
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
|
|
+ <div class="tui-title">售价允许低于成本</div>
|
|
|
|
|
+ <view class="detail-price_box">
|
|
|
|
|
+ <switch style="transform:scale(0.7,0.7)" :checked="lessCostCould == 0 ? false : true" @change="lessChangeFn" />
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </tui-list-cell>
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -112,7 +120,8 @@ export default {
|
|
|
settlePrice:0,
|
|
settlePrice:0,
|
|
|
sendCost:0,
|
|
sendCost:0,
|
|
|
packCost:0,
|
|
packCost:0,
|
|
|
- addSelectItem:1
|
|
|
|
|
|
|
+ addSelectItem:1,
|
|
|
|
|
+ lessCostCould:0
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
onLoad(){
|
|
onLoad(){
|
|
@@ -158,6 +167,9 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ lessChangeFn(e){
|
|
|
|
|
+ this.lessCostCould = e.detail.value == true ? 1 : 0;
|
|
|
|
|
+ },
|
|
|
usePrice(info,flag){
|
|
usePrice(info,flag){
|
|
|
if(info.product && !this.$util.isEmpty(info.product)){
|
|
if(info.product && !this.$util.isEmpty(info.product)){
|
|
|
info.product.forEach((item,idx,array) => {
|
|
info.product.forEach((item,idx,array) => {
|
|
@@ -220,6 +232,7 @@ export default {
|
|
|
let product = []
|
|
let product = []
|
|
|
let hasError = false
|
|
let hasError = false
|
|
|
let that = this
|
|
let that = this
|
|
|
|
|
+ let hasLessCostPrice = false
|
|
|
if (this.detailInfo && this.detailInfo.product) {
|
|
if (this.detailInfo && this.detailInfo.product) {
|
|
|
for (const item of this.detailInfo.product) {
|
|
for (const item of this.detailInfo.product) {
|
|
|
if(item.currentHdPrice.length <= 0){
|
|
if(item.currentHdPrice.length <= 0){
|
|
@@ -237,8 +250,15 @@ export default {
|
|
|
let productId = item.productId || 0
|
|
let productId = item.productId || 0
|
|
|
let unitType =
|
|
let unitType =
|
|
|
product = [...product,{productId,price,num}]
|
|
product = [...product,{productId,price,num}]
|
|
|
|
|
+ if(Number(item.cost)>Number(item.currentHdPrice)){
|
|
|
|
|
+ hasLessCostPrice = true
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ if(hasLessCostPrice == true && this.lessCostCould == 0){
|
|
|
|
|
+ this.$msg('有售价低于成本,请打开允许设置')
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
if(hasError == true){
|
|
if(hasError == true){
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|