shish 3 лет назад
Родитель
Сommit
1da0878e45

+ 1 - 1
hdApp/src/admin/changePrice/list.vue

@@ -65,7 +65,7 @@ import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import ItemComponent from "./components/Item";
 import productMins from "@/mixins/product";
 import { mapGetters } from "vuex";
-import { batchChangePrice,generatePriceTable } from '@/api/product/index'
+import { batchChangePrice,generatePriceTable } from '@/api/product'
 export default {
 	name: "item_list",
 	components: {

+ 4 - 0
hdApp/src/api/purchase/index.js

@@ -1,5 +1,9 @@
 import https from "@/plugins/luch-request_0.0.7/request";
 
+export const getCgItemInfo = data => {
+	return https.get("/cg-item/get-cg-item-info", data);
+};
+
 export const getDetail = data => {
 	return https.get("/purchase/detail", data);
 };

+ 7 - 3
hdApp/src/pagesPurchase/addCgConfirm.vue

@@ -163,10 +163,14 @@ export default {
 				content: '确认提交?',
 				success: function (res) {
 					if (res.confirm) {
+						uni.showLoading({mask:true})
 						addVirtualCg(options).then(res => {
-							that.removeFromSaveDirect()
-							let url = '/pagesPurchase/addCgResult'
-							uni.redirectTo({url: url})
+							uni.hideLoading()
+							if(res.code == 1){
+								let id = res.data.id ? res.data.id : 0
+								that.removeFromSaveDirect()
+								that.$util.pageTo({url: '/pagesPurchase/particulars?id='+id,type:2})
+							}
 						});
 					}
 				}

+ 154 - 6
hdApp/src/pagesPurchase/particulars.vue

@@ -4,14 +4,40 @@
       <view class="top-view"> </view>
       <view class="result-view">
         <view :class="['iconfont', 'iconchenggong']"></view>
-        <view class="result-title">支付成功</view>
+        <view class="result-title">采购成功</view>
 
-        <button class="admin-button-com big" @click="goDetail">订单详情</button>
-        <button v-if="ghsCgScene!=''" class="admin-button-com big" style="margin-top:20upx;" @click="goHome">返回首页</button>
-        <button v-else class="admin-button-com big" style="margin-top:20upx;" @click="goBack">返回</button>
+				<template v-if="onlyCg == 0">
+					<view style="margin-left:150upx;">
+						<view class="flex title">
+							确认销售价:
+						</view>
+						<view class="flex title">
+							<text style="font-size:28upx;font-weight:bold;color:red;">
+								红色为进货价,请填写大单位销售价
+							</text>
+						</view>
+						<checkbox-group>
+							<view v-for="(res,i) in flowersList" :key="i">
+								<view class="product-area">
+									<view class="first-area">
+										<text class="name">{{res.name}}</text>
+										<text class="cg-cost" v-if="res.xhUnitType == 0">¥{{res.xhUnitPrice ? parseFloat(res.xhUnitPrice) : 0}}</text>
+										<input type="digit" v-model="res.changePrice" placeholder="价格" />
+									</view>
+								</view>
+							</view>
+						</checkbox-group>
+					</view>
+
+					<button class="admin-button-com big blue" style="width:45vh;margin-top:50upx;" @click="commit">确认修改</button>
+
+				</template>
+
+        <button v-if="ghsCgScene!=''" class="admin-button-com big" style="width:40vh;margin-top:20upx;" @click="goHome">返回首页</button>
+        <button v-else class="admin-button-com big" style="width:45vh;margin-top:20upx;" @click="goBack">返回</button>
 
         <view style="margin-top:20upx;">
-          <view style="font-size:28upx;">微信下拉,最近使用小程序,搜索“花掌柜”(绿色图标)并打开,可再次买花</view>
+          <view style="font-size:28upx;">再次买花请打开微信下拉,最近使用小程序搜索“花掌柜”</view>
           <view style="margin-bottom:30upx;margin-top:15upx;">
             <image class="image" :src="`${constant.imgUrl}/cg/hd_cg_route.png`" mode="widthFix"></image>
           </view>
@@ -22,13 +48,17 @@
   </view>
 </template>
 <script>
+import { getCgItemInfo } from "@/api/purchase";
+import { batchChangePrice } from '@/api/product'
 export default {
   name: "AppResult",
   data() {
     return {
       hasInit:false,
       ghsCgScene:'',
-      fromCg:0
+      fromCg:0,
+      flowersList:[],
+      onlyCg:1
     }
   },
   onLoad () {
@@ -46,6 +76,8 @@ export default {
       this.fromCg = ghsCgOption.fromCg
     }
 
+    this.getCgItemFn()
+
   },
   onShow () {
     if(this.hasInit == false){
@@ -53,6 +85,52 @@ export default {
     }
   },
   methods: {
+    commit(){
+      let that = this
+      let hasError = false
+      let name = ''
+      this.flowersList.forEach((ele)=>{
+        if(this.$util.isMoney(ele.changePrice) == false || Number(ele.changePrice)<0){
+          hasError = true
+          name = ele.name
+        }
+      })
+      if(hasError){
+        this.$msg('请填写 '+name+' 价格')
+        return false
+      }
+      that.$util.confirmModal({content:'确认修改?'},() => {
+        that.commitChange()
+			})
+    },
+    commitChange(){
+      let arr = this.flowersList.map((ele)=>{
+        return {id:ele.productId,price:ele.changePrice}
+      })
+      let that = this
+      uni.showLoading({mask:true})
+      batchChangePrice({data:JSON.stringify(arr)}).then(res=>{
+        if(res.code == 1){
+          that.$msg('修改成功')
+        }
+      })
+    },
+    getCgItemFn(){
+      let id = this.option.id ? this.option.id : 0
+      let that = this
+      getCgItemInfo({id:id}).then(res=>{
+        if(res.code == 1){
+          that.onlyCg = res.data.onlyCg
+          let list = res.data.list ? res.data.list : []
+          if(!this.$util.isEmpty(list)){
+            let arr = list.map((ele)=>{
+              return {...ele,changePrice:''}
+            })
+            that.flowersList = arr
+          }
+        }
+      })
+    },
     goBack(){
       uni.navigateBack()
     },
@@ -70,6 +148,76 @@ export default {
 };
 </script>
 <style lang="scss" scoped>
+.go-back{
+	width: 80%;
+	height: 80upx;
+	color: #FFFFFF;
+	margin-top: 50upx;
+	background: #3385FF;
+	border-radius: 10upx;
+	font-size:30upx;
+}
+.title{
+	font-weight:700;
+	margin-bottom:30upx;
+	font-size:30upx;
+}
+.product-area{
+	width:730upx;
+	height:90upx;
+	display:flex;
+	align-items:center;
+	.first-area{
+		border-bottom:1upx solid #e4e2e2;
+		position:relative;
+    width:550upx;
+		.name{
+			width:280upx;
+			overflow: hidden;
+			text-overflow:ellipsis;
+			white-space: nowrap;
+			display:inline-block;
+			font-weight:bold;
+			font-size:28upx;
+		}
+		.cg-cost{
+			font-weight:bold;
+			font-size:27upx;
+			color:red;
+			position:absolute;
+			left:480upx;
+			top:8upx;
+		}
+		.cost-price{
+			font-weight:bold;
+			font-size:27upx;
+			color:blue;
+			position:absolute;
+			left:515upx;
+			top:18upx;
+		}
+		input{
+			border:1upx solid #cccccc;
+			display:inline-block;
+			width:135upx;
+			margin-left:10upx;
+			margin-right:30upx;
+			text-align:center;
+			font-size:30upx;
+		}
+	}
+	.second-area{
+		float:left;
+		color:#646464;
+		margin-top:10upx;
+		.one{
+			color:red;
+		}
+		.two{
+			color:#CCCCCC;
+		}
+	}
+}
 .billing_box_bg {
   position: relative;
   padding: 30upx 30upx;