|
@@ -21,8 +21,8 @@
|
|
|
<view class="product-area">
|
|
<view class="product-area">
|
|
|
<view class="first-area">
|
|
<view class="first-area">
|
|
|
<text class="name">{{res.name}}</text>
|
|
<text class="name">{{res.name}}</text>
|
|
|
- <text class="cost">¥{{costList[res.id]?parseFloat(costList[res.id]):0}}</text>
|
|
|
|
|
- <text class="cgPrice">¥{{res.cost?parseFloat(res.cost):0}}</text>
|
|
|
|
|
|
|
+ <text class="cg-cost">¥{{cgPriceList[res.id]?parseFloat(cgPriceList[res.id]):0}}</text>
|
|
|
|
|
+ <text class="cost-price">¥{{res.cost?parseFloat(res.cost):0}}</text>
|
|
|
<input type="digit" v-model="res.autoPrice" placeholder="花店价" @focus="priceFocus(i,res)" @input="modifyPrice(i,res)" />
|
|
<input type="digit" v-model="res.autoPrice" placeholder="花店价" @focus="priceFocus(i,res)" @input="modifyPrice(i,res)" />
|
|
|
<input type="digit" v-model="res.autoSkPrice" placeholder="散客价" @focus="skPriceFocus(i,res)" @input="modifySkPrice(res)" />
|
|
<input type="digit" v-model="res.autoSkPrice" placeholder="散客价" @focus="skPriceFocus(i,res)" @input="modifySkPrice(res)" />
|
|
|
</view>
|
|
</view>
|
|
@@ -40,28 +40,25 @@
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
-import { getAllProductDataApi,batchChangePrice } from "@/api/product/index";
|
|
|
|
|
|
|
+import { getAllProductDataApi,batchChangePrice } from "@/api/product";
|
|
|
|
|
+import { getCgItemList } from "@/api/purchase";
|
|
|
export default {
|
|
export default {
|
|
|
name: "pageSuccess",
|
|
name: "pageSuccess",
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- flowersItemInfo:'',
|
|
|
|
|
|
|
+ cgItemList:[],
|
|
|
flowersList:[],
|
|
flowersList:[],
|
|
|
productList:[],
|
|
productList:[],
|
|
|
- costList:[],
|
|
|
|
|
|
|
+ cgPriceList:[],
|
|
|
status:0
|
|
status:0
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
onShow(){
|
|
onShow(){
|
|
|
- this.flowersItemInfo = uni.getStorageSync('flowersItemInfo');
|
|
|
|
|
this.getList();
|
|
this.getList();
|
|
|
},
|
|
},
|
|
|
onLoad(){
|
|
onLoad(){
|
|
|
this.status = this.option.status ? Number(this.option.status) : 0
|
|
this.status = this.option.status ? Number(this.option.status) : 0
|
|
|
},
|
|
},
|
|
|
- onUnload(){
|
|
|
|
|
- uni.removeStorageSync('flowersItemInfo');
|
|
|
|
|
- },
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
priceFocus(i,res){
|
|
priceFocus(i,res){
|
|
|
this.flowersList[i].autoPrice = ''
|
|
this.flowersList[i].autoPrice = ''
|
|
@@ -86,17 +83,27 @@ export default {
|
|
|
getList(){
|
|
getList(){
|
|
|
let productIdArr = '';
|
|
let productIdArr = '';
|
|
|
let that = this
|
|
let that = this
|
|
|
- this.flowersItemInfo.forEach((ele)=>{
|
|
|
|
|
- productIdArr += ele.productId+','
|
|
|
|
|
- this.costList[ele.productId] = ele.itemPrice
|
|
|
|
|
|
|
+ getCgItemList({id:this.option.id}).then(res=>{
|
|
|
|
|
+ if(res.code == 1){
|
|
|
|
|
+ let list = res.data.list
|
|
|
|
|
+ if(!this.$util.isEmpty(list)){
|
|
|
|
|
+
|
|
|
|
|
+ list.forEach((ele)=>{
|
|
|
|
|
+ productIdArr += ele.productId+','
|
|
|
|
|
+ that.cgPriceList[ele.productId] = ele.bigPrice
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ getAllProductDataApi({ids : productIdArr.substring(0, productIdArr.lastIndexOf(',')),}).then((res)=>{
|
|
|
|
|
+ that.flowersList = res.data.list;
|
|
|
|
|
+ that.productList = [];
|
|
|
|
|
+ that.flowersList.forEach(function(item){
|
|
|
|
|
+ that.productList.push({id:item.id,price:parseFloat(item.autoPrice),skPrice:parseFloat(item.autoSkPrice),skMore:item.skMore})
|
|
|
|
|
+ })
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
- getAllProductDataApi({ids : productIdArr.substring(0, productIdArr.lastIndexOf(',')),}).then((res)=>{
|
|
|
|
|
- that.flowersList = res.data.list;
|
|
|
|
|
- that.productList = [];
|
|
|
|
|
- that.flowersList.forEach(function(item){
|
|
|
|
|
- that.productList.push({id:item.id,price:parseFloat(item.autoPrice),skPrice:parseFloat(item.autoSkPrice),skMore:item.skMore})
|
|
|
|
|
- })
|
|
|
|
|
- });
|
|
|
|
|
},
|
|
},
|
|
|
modifyPrice(i,res){
|
|
modifyPrice(i,res){
|
|
|
let id = res.id
|
|
let id = res.id
|
|
@@ -174,7 +181,7 @@ export default {
|
|
|
font-weight:bold;
|
|
font-weight:bold;
|
|
|
font-size:28upx;
|
|
font-size:28upx;
|
|
|
}
|
|
}
|
|
|
- .cost{
|
|
|
|
|
|
|
+ .cg-cost{
|
|
|
font-weight:bold;
|
|
font-weight:bold;
|
|
|
font-size:28upx;
|
|
font-size:28upx;
|
|
|
color:red;
|
|
color:red;
|
|
@@ -182,7 +189,7 @@ export default {
|
|
|
left:505upx;
|
|
left:505upx;
|
|
|
top:5upx;
|
|
top:5upx;
|
|
|
}
|
|
}
|
|
|
- .cgPrice{
|
|
|
|
|
|
|
+ .cost-price{
|
|
|
font-weight:bold;
|
|
font-weight:bold;
|
|
|
font-size:28upx;
|
|
font-size:28upx;
|
|
|
color:blue;
|
|
color:blue;
|