|
|
@@ -1,61 +1,62 @@
|
|
|
<style lang="scss" scoped>
|
|
|
- .admin-button-com {
|
|
|
- margin-bottom: 20px;
|
|
|
- width: 100%;
|
|
|
- }
|
|
|
- .flowers-list-box{
|
|
|
- width: 100%;
|
|
|
- .title{
|
|
|
- height: 80rpx;
|
|
|
- border-top: 1px solid #dcdcdc;
|
|
|
- font-size: 28rpx;
|
|
|
- font-weight: 700;
|
|
|
- }
|
|
|
- .flex-space{
|
|
|
- width:500rpx;
|
|
|
+.admin-button-com {
|
|
|
+ margin-bottom: 20px;
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+.goHome{
|
|
|
+ width: 80%;
|
|
|
+ height: 80rpx;
|
|
|
+ color: #FFFFFF;
|
|
|
+ margin-top: 50rpx;
|
|
|
+ background: #3385FF;
|
|
|
+ border-radius: 10rpx;
|
|
|
+ font-size:30rpx;
|
|
|
+}
|
|
|
+.title{
|
|
|
+ font-weight:700;
|
|
|
+ margin-bottom:30rpx;
|
|
|
+}
|
|
|
+.product-area{
|
|
|
+ width:600rpx;
|
|
|
+ height:120rpx;
|
|
|
+ .first-area{
|
|
|
+ text{
|
|
|
+ width:270rpx;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow:ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+ display:inline-block;
|
|
|
}
|
|
|
- .flowers-list{
|
|
|
- padding: 15rpx 0;
|
|
|
- .flowers-name{width: 150rpx}
|
|
|
- .flowers-val{
|
|
|
- input{
|
|
|
- width: 160rpx;
|
|
|
- height: 50rpx;
|
|
|
- padding: 0 20rpx;
|
|
|
- margin-right: 20rpx;
|
|
|
- border: 1px solid #d4d4d4;
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
- }
|
|
|
- .flowers-btn{
|
|
|
- width: 100rpx;
|
|
|
- height: 50rpx;
|
|
|
- color: #FFFFFF;
|
|
|
- background: #6699ff;
|
|
|
- border-radius: 10rpx;
|
|
|
- }
|
|
|
+ input{
|
|
|
+ border:1rpx solid #cccccc;
|
|
|
+ display:inline-block;
|
|
|
+ width:150rpx;
|
|
|
+ margin-left:30rpx;
|
|
|
}
|
|
|
}
|
|
|
- .goHome{
|
|
|
- width: 80%;
|
|
|
- height: 80rpx;
|
|
|
- color: #FFFFFF;
|
|
|
- margin-top: 50rpx;
|
|
|
- background: #3385FF;
|
|
|
- border-radius: 10rpx;
|
|
|
- font-size:30rpx;
|
|
|
+ .second-area{
|
|
|
+ float:left;
|
|
|
+ color:#646464;
|
|
|
+ margin-top:5rpx;
|
|
|
}
|
|
|
+}
|
|
|
</style>
|
|
|
<template>
|
|
|
<appResult :title="title?title:'成功'">
|
|
|
<view class="flowers-list-box">
|
|
|
- <view class="flex title">采购已入库,建议修改售价:</view>
|
|
|
- <view class="flex-space flowers-list" v-for="(res,i) in flowersList" :key="i">
|
|
|
- <view class="ov-1x flowers-name">{{res.name}}</view>
|
|
|
- <view class="flex flowers-val">
|
|
|
- <input type="digit" v-model="res.autoPrice" @focus="priceFocus(i)" @input="updatePrice(res.id,res.autoPrice)"> 元
|
|
|
+ <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>
|
|
|
</view>
|
|
|
</view>
|
|
|
+</checkbox-group>
|
|
|
</view>
|
|
|
<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>
|
|
|
@@ -76,6 +77,7 @@ export default {
|
|
|
flowersItemInfo:'',
|
|
|
flowersList:[],
|
|
|
productList:[],
|
|
|
+ costChangeIds:[]
|
|
|
};
|
|
|
},
|
|
|
onShow(){
|
|
|
@@ -90,6 +92,10 @@ export default {
|
|
|
uni.navigateBack({delta:2})
|
|
|
},
|
|
|
methods: {
|
|
|
+ checkboxChange: function (e) {
|
|
|
+ console.log('values',e.detail.value)
|
|
|
+ this.costChangeIds = e.detail.value
|
|
|
+ },
|
|
|
priceFocus(i){
|
|
|
this.flowersList[i].autoPrice = ''
|
|
|
},
|
|
|
@@ -121,7 +127,7 @@ export default {
|
|
|
},
|
|
|
commitChange(){
|
|
|
let that = this
|
|
|
- batchUpdatePrice({data:JSON.stringify(this.productList),type:'price'}).then(res => {
|
|
|
+ batchUpdatePrice({data:JSON.stringify(this.productList),type:'price',costChangeIds:JSON.stringify(this.costChangeIds)}).then(res => {
|
|
|
uni.showToast({title:res.msg})
|
|
|
if(res.code == 1){
|
|
|
setTimeout(function(){
|