|
|
@@ -32,33 +32,41 @@
|
|
|
display:inline-block;
|
|
|
width:150rpx;
|
|
|
margin-left:30rpx;
|
|
|
+ margin-right:10rpx;
|
|
|
}
|
|
|
}
|
|
|
.second-area{
|
|
|
float:left;
|
|
|
color:#646464;
|
|
|
- margin-top:5rpx;
|
|
|
+ margin-top:10rpx;
|
|
|
+ .one{
|
|
|
+ color:red;
|
|
|
+ }
|
|
|
+ .two{
|
|
|
+ color:#CCCCCC;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</style>
|
|
|
<template>
|
|
|
- <appResult :title="title?title:'成功'">
|
|
|
+ <appResult title="已完成">
|
|
|
<view class="flowers-list-box">
|
|
|
- <view class="flex title">已入库,建议修改售价:</view>
|
|
|
-<checkbox-group @change="checkboxChange">
|
|
|
- <view v-for="(res,i) in flowersList" :key="i">
|
|
|
- <view class="product-area">
|
|
|
- <view class="first-area"><text>{{res.name}}</text><input type="digit" v-model="res.autoPrice" @focus="priceFocus(i)" @input="updatePrice(res.id,res.autoPrice)"></view>
|
|
|
- <view class="second-area">
|
|
|
- <view v-if="parseFloat(res.autoPrice)!=parseFloat(Number(res.addPrice)+Number(res.cost)) && parseFloat(Number(res.autoPrice)-Number(res.cost)) > 0" class="change-add-price">
|
|
|
- <label>
|
|
|
-成本价{{parseFloat(res.cost)}},建议加价改成{{parseFloat(Number(res.autoPrice)-Number(res.cost))}}元,确认请勾选<checkbox :value="res.id" style="transform:scale(0.8)" /> </label></view>
|
|
|
+ <view class="flex title">建议修改以下花材售价:</view>
|
|
|
+ <checkbox-group @change="checkboxChange">
|
|
|
+ <view v-for="(res,i) in flowersList" :key="i">
|
|
|
+ <view class="product-area">
|
|
|
+ <view class="first-area"><text>{{res.name}}</text><input type="digit" v-model="res.autoPrice" @focus="priceFocus(i,res)" @input="modifyPrice(res)"> 元</view>
|
|
|
+ <view class="second-area">
|
|
|
+ <view class="one" v-if="parseFloat(res.autoPrice)!=parseFloat(Number(res.addPrice)+Number(res.cost)) && parseFloat(Number(res.autoPrice)-Number(res.cost)) > 0">
|
|
|
+ <label>成本 {{parseFloat(res.cost)}},加价建议改成{{parseFloat(Number(res.autoPrice)-Number(res.cost))}}元,修改请勾选<checkbox :value="res.id" style="transform:scale(0.7)" /> </label>
|
|
|
+ </view>
|
|
|
+ <view class="two" v-else>成本 {{parseFloat(res.cost)}},加价 {{parseFloat(res.addPrice)}}元</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
-</checkbox-group>
|
|
|
+ </checkbox-group>
|
|
|
</view>
|
|
|
- <button class="admin-button-com big blue" style="width:80%;margin-top:50rpx;" @click="commitChange">保存修改</button>
|
|
|
+ <button class="admin-button-com big blue" style="width:80%;margin-top:50rpx;" @click="commitChange">确认修改</button>
|
|
|
<navigator open-type="switchTab" class="flex-center goHome" @click="goBackHome" >返回首页</navigator>
|
|
|
</appResult>
|
|
|
</template>
|
|
|
@@ -92,12 +100,22 @@ export default {
|
|
|
uni.navigateBack({delta:2})
|
|
|
},
|
|
|
methods: {
|
|
|
- checkboxChange: function (e) {
|
|
|
- console.log('values',e.detail.value)
|
|
|
- this.costChangeIds = e.detail.value
|
|
|
- },
|
|
|
- priceFocus(i){
|
|
|
+ checkboxChange(e) {
|
|
|
+ console.log('values',e.detail.value)
|
|
|
+ this.costChangeIds = e.detail.value
|
|
|
+ },
|
|
|
+ priceFocus(i,res){
|
|
|
this.flowersList[i].autoPrice = ''
|
|
|
+
|
|
|
+ let id = res.id
|
|
|
+ if(parseFloat(res.autoPrice)==parseFloat(Number(res.addPrice)+Number(res.cost)) || parseFloat(Number(res.autoPrice)-Number(res.cost)) < 0){
|
|
|
+ let i = this.costChangeIds.indexOf(id)
|
|
|
+ if(i > -1){
|
|
|
+ this.costChangeIds.splice(i,1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log('this.costChangeIds',this.costChangeIds)
|
|
|
+
|
|
|
},
|
|
|
closeLayer() {
|
|
|
uni.navigateBack({delta: 3});
|
|
|
@@ -115,7 +133,18 @@ export default {
|
|
|
})
|
|
|
});
|
|
|
},
|
|
|
- updatePrice(id,price){
|
|
|
+ modifyPrice(res){
|
|
|
+ let id = res.id
|
|
|
+ let price = res.autoPrice
|
|
|
+
|
|
|
+ if(parseFloat(res.autoPrice)==parseFloat(Number(res.addPrice)+Number(res.cost)) || parseFloat(Number(res.autoPrice)-Number(res.cost)) < 0){
|
|
|
+ let i = this.costChangeIds.indexOf(id)
|
|
|
+ if(i > -1){
|
|
|
+ this.costChangeIds.splice(i,1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log('this.costChangeIds',this.costChangeIds)
|
|
|
+
|
|
|
let arr = this.productList.map((ele)=>{
|
|
|
if(ele.id == id){
|
|
|
return {id:id,price:price}
|
|
|
@@ -123,7 +152,6 @@ export default {
|
|
|
return ele
|
|
|
})
|
|
|
this.productList = arr
|
|
|
- console.log(this.productList)
|
|
|
},
|
|
|
commitChange(){
|
|
|
let that = this
|