|
@@ -8,13 +8,10 @@
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
|
<view style="margin-left:150upx;">
|
|
<view style="margin-left:150upx;">
|
|
|
|
|
+ <view class="flex title" v-if="info.status == 3"> 入库前请确认售价: </view>
|
|
|
|
|
+ <view class="flex title" v-else> 确认售价: </view>
|
|
|
<view class="flex title">
|
|
<view class="flex title">
|
|
|
- 确认销售价:
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="flex title">
|
|
|
|
|
- <text style="font-size:30upx;font-weight:bold;color:red;">
|
|
|
|
|
- 红色进货价,<text style="color:blue;">蓝色成本价</text>
|
|
|
|
|
- </text>
|
|
|
|
|
|
|
+ <text style="font-size:30upx;font-weight:normal;"> 红色进货价,蓝色成本价 </text>
|
|
|
</view>
|
|
</view>
|
|
|
<checkbox-group @change="checkboxChange">
|
|
<checkbox-group @change="checkboxChange">
|
|
|
<view v-for="(res,i) in flowersList" :key="i">
|
|
<view v-for="(res,i) in flowersList" :key="i">
|
|
@@ -30,10 +27,14 @@
|
|
|
</view>
|
|
</view>
|
|
|
</checkbox-group>
|
|
</checkbox-group>
|
|
|
</view>
|
|
</view>
|
|
|
- <button class="admin-button-com big blue" style="width:40vh;margin-top:50upx;" @click="commitChange">确认修改</button>
|
|
|
|
|
|
|
+ <template v-if="!$util.isEmpty(info)">
|
|
|
|
|
+ <button v-if="info.status == 3" class="admin-button-com big blue" style="width:55vw;margin-top:50upx;" @click="commitChange">确认入库</button>
|
|
|
|
|
+ <button v-if="info.status != 3" class="admin-button-com big blue" style="width:55vw;margin-top:50upx;" @click="commitChange">确认改价</button>
|
|
|
|
|
+ <button v-if="info.status == 3" class="admin-button-com big default" style="width:55vw;margin-top:30upx;" @click="goBackFn">稍后入库</button>
|
|
|
|
|
+ </template>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
- <button class="admin-button-com big default" style="width:40vh;margin-top:30upx;" @click="goBackFn">返回</button>
|
|
|
|
|
|
|
+ <button class="admin-button-com big default" style="width:55vw;margin-top:30upx;" @click="goBackFn">返回</button>
|
|
|
|
|
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -41,7 +42,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
import { getAllProductDataApi,batchChangePrice } from "@/api/product";
|
|
import { getAllProductDataApi,batchChangePrice } from "@/api/product";
|
|
|
-import { getCgItemList } from "@/api/purchase";
|
|
|
|
|
|
|
+import { getCgItemList,getPurchaseDetailApi } from "@/api/purchase";
|
|
|
export default {
|
|
export default {
|
|
|
name: "pageSuccess",
|
|
name: "pageSuccess",
|
|
|
data() {
|
|
data() {
|
|
@@ -50,7 +51,8 @@ export default {
|
|
|
flowersList:[],
|
|
flowersList:[],
|
|
|
productList:[],
|
|
productList:[],
|
|
|
itemPriceList:[],
|
|
itemPriceList:[],
|
|
|
- status:0
|
|
|
|
|
|
|
+ status:0,
|
|
|
|
|
+ info:{}
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
onShow(){
|
|
onShow(){
|
|
@@ -58,6 +60,14 @@ export default {
|
|
|
},
|
|
},
|
|
|
onLoad(){
|
|
onLoad(){
|
|
|
this.status = this.option.status ? Number(this.option.status) : 0
|
|
this.status = this.option.status ? Number(this.option.status) : 0
|
|
|
|
|
+
|
|
|
|
|
+ let that = this
|
|
|
|
|
+ let orderSn = this.option.orderSn ? this.option.orderSn : ''
|
|
|
|
|
+ getPurchaseDetailApi(orderSn).then(res=>{
|
|
|
|
|
+ if(res.code == 1){
|
|
|
|
|
+ that.info = res.data
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
priceFocus(i,res){
|
|
priceFocus(i,res){
|
|
@@ -97,7 +107,7 @@ export default {
|
|
|
that.flowersList = res.data.list;
|
|
that.flowersList = res.data.list;
|
|
|
that.productList = [];
|
|
that.productList = [];
|
|
|
that.flowersList.forEach(function(item){
|
|
that.flowersList.forEach(function(item){
|
|
|
- that.productList.push({id:item.id,price:parseFloat(item.autoPrice),skPrice:parseFloat(item.autoSkPrice),skMore:item.skMore})
|
|
|
|
|
|
|
+ that.productList.push({id:item.id,price:parseFloat(item.autoPrice),skPrice:parseFloat(item.autoSkPrice),skMore:item.skMore,name:item.name})
|
|
|
})
|
|
})
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -109,12 +119,13 @@ export default {
|
|
|
let id = res.id
|
|
let id = res.id
|
|
|
let price = res.autoPrice
|
|
let price = res.autoPrice
|
|
|
let skMore = res.skMore
|
|
let skMore = res.skMore
|
|
|
|
|
+ let name = res.name
|
|
|
let skPrice = Number(res.autoPrice)+Number(skMore)
|
|
let skPrice = Number(res.autoPrice)+Number(skMore)
|
|
|
skPrice = parseFloat(skPrice.toFixed(2))
|
|
skPrice = parseFloat(skPrice.toFixed(2))
|
|
|
this.flowersList[i].autoSkPrice = skPrice
|
|
this.flowersList[i].autoSkPrice = skPrice
|
|
|
let arr = this.productList.map((ele)=>{
|
|
let arr = this.productList.map((ele)=>{
|
|
|
if(ele.id == id){
|
|
if(ele.id == id){
|
|
|
- return {id:id,price:price,skPrice:skPrice,skMore:skMore}
|
|
|
|
|
|
|
+ return {id:id,price:price,skPrice:skPrice,skMore:skMore,name:name}
|
|
|
}
|
|
}
|
|
|
return ele
|
|
return ele
|
|
|
})
|
|
})
|
|
@@ -125,9 +136,10 @@ export default {
|
|
|
let price = res.autoPrice
|
|
let price = res.autoPrice
|
|
|
let skPrice = res.autoSkPrice
|
|
let skPrice = res.autoSkPrice
|
|
|
let skMore = res.skMore
|
|
let skMore = res.skMore
|
|
|
|
|
+ let name = res.name
|
|
|
let arr = this.productList.map((ele)=>{
|
|
let arr = this.productList.map((ele)=>{
|
|
|
if(ele.id == id){
|
|
if(ele.id == id){
|
|
|
- return {id:id,price:price,skPrice:skPrice,skMore:skMore}
|
|
|
|
|
|
|
+ return {id:id,price:price,skPrice:skPrice,skMore:skMore,name:name}
|
|
|
}
|
|
}
|
|
|
return ele
|
|
return ele
|
|
|
})
|
|
})
|
|
@@ -135,7 +147,26 @@ export default {
|
|
|
},
|
|
},
|
|
|
commitChange(){
|
|
commitChange(){
|
|
|
let that = this
|
|
let that = this
|
|
|
- this.$util.confirmModal({content:'确认修改?'},() => {
|
|
|
|
|
|
|
+ let hasError = false
|
|
|
|
|
+ let errorHint = ''
|
|
|
|
|
+ this.productList.forEach(function(item){
|
|
|
|
|
+ if(that.$util.isMoney(item.price) == false){
|
|
|
|
|
+ let name = item.name
|
|
|
|
|
+ errorHint = '请填写'+name+'的花店价'
|
|
|
|
|
+ hasError = true
|
|
|
|
|
+ }
|
|
|
|
|
+ if(that.$util.isMoney(item.skPrice) == false){
|
|
|
|
|
+ let name = item.name
|
|
|
|
|
+ errorHint = '请填写'+name+'的个人价'
|
|
|
|
|
+ hasError = true
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ if(hasError){
|
|
|
|
|
+ this.$msg(errorHint)
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.$util.confirmModal({content:'确认提交?'},() => {
|
|
|
that.commitModify()
|
|
that.commitModify()
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
@@ -144,7 +175,7 @@ export default {
|
|
|
let targetId = this.option.id ||0
|
|
let targetId = this.option.id ||0
|
|
|
batchChangePrice({data:JSON.stringify(this.productList),changeType:'cg',targetId:targetId}).then(res => {
|
|
batchChangePrice({data:JSON.stringify(this.productList),changeType:'cg',targetId:targetId}).then(res => {
|
|
|
if(res.code == 1){
|
|
if(res.code == 1){
|
|
|
- that.$msg('修改成功')
|
|
|
|
|
|
|
+ that.$msg(res.msg)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|