shish 4 лет назад
Родитель
Сommit
c799692b2f

+ 1 - 1
ghsApp/src/pagesOrder/detail.vue

@@ -293,7 +293,7 @@ export default {
 	methods: {
 		goRefund(){
 			if(this.detailInfo.payWay == 1){
-				this.$msg('支付宝付款暂不支持退款,请线下退款')
+				this.$msg('支付宝订单暂不支持退款,请线下退款')
 				return false
 			}
 			this.$util.pageTo({url:'/pagesOrder/refund?id='+this.option.id})

+ 1 - 1
ghsApp/src/pagesOrder/refund.vue

@@ -32,7 +32,7 @@
 			<view class="refund-label">订单金额:</view>
 			<view class="list">
 				¥{{parseFloat(orderInfo.orderPrice)||0}}
-				<text style="margin-left:25upx;font-size:25upx;color:green;" v-if="Number(orderInfo.tkPrice)>0">已退¥{{orderInfo.tkPrice}}</text>
+				<text style="margin-left:25upx;font-size:25upx;color:green;" v-if="Number(orderInfo.tkPrice)>0">已退¥{{orderInfo.tkPrice ? parseFloat(orderInfo.tkPrice) : 0}}</text>
 			</view>
 		</view>
 		<view class="flex refund-item">

+ 6 - 6
hdApp/src/admin/home/components/order-item.vue

@@ -6,12 +6,12 @@
 					<image :src="info.cover" mode="aspectFit"></image>
 				</view>
 				<view class="list-msg">
-					<view><text>收花:</text><text>{{info.receiveUserName||'--'}}</text></view>
-					<view style="margin-top:3upx;"><text>电话:</text><text>{{info.receiveMobile||'--'}}</text></view>
-					<view style="margin-top:3upx;"><text>时间:</text><text>2-23 下午</text></view>
-					<view style="margin-top:3upx;"><text>数量:</text><text>5</text></view>
-					<view style="margin-top:3upx;"><text>下单:</text><text>{{info.bookName||'--'}}</text></view>
-					<view style="margin-top:3upx;"><text>备注:</text><text>{{info.remark||'--'}}</text></view>
+					<view><text>收花:</text><text>{{info.receiveUserName||''}}</text></view>
+					<view style="margin-top:3upx;"><text>电话:</text><text>{{info.receiveMobile||''}}</text></view>
+					<view style="margin-top:3upx;"><text>时间:</text><text>{{info.addTime.substr(5,11)}}</text></view>
+					<view style="margin-top:3upx;"><text>数量:</text><text></text></view>
+					<view style="margin-top:3upx;"><text>下单:</text><text>{{info.bookName||''}}</text></view>
+					<view style="margin-top:3upx;"><text>备注:</text><text>{{info.remark||''}}</text></view>
 				</view>
 			</view>
 		</block>

+ 33 - 42
hdApp/src/admin/order/components/detail-goods.vue

@@ -3,15 +3,15 @@
 		<block v-if="!$util.isEmpty(info)">
 			<view class="list-left">
 				<view class="image">
-					<image :src="imgUrl" mode="aspectFit" style="width:140upx; height:140upx;"></image>
+					<image :src="info.smallCover" mode="aspectFit" style="width:120upx; height:120upx;"></image>
 				</view>
 				<view class="list-msg">
-					<view class="title">{{ info.name || info.title }}</view>
+					<view class="title">{{ info.name || '' }}</view>
 				</view>
 			</view>
 			<view class="list-right">
-				<view class="price">¥{{ info.price || info.unitPrice }}</view>
-				<view class="num">*{{ info.buyNum || info.num }}</view>
+				<view class="price">¥{{ info.unitPrice ? parseFloat(info.unitPrice) : 0 }}</view>
+				<view class="num">X{{ info.num||0 }}</view>
 			</view>
 		</block>
 	</view>
@@ -28,49 +28,40 @@ export default {
 	data() {
 		return {}
 	},
-	computed: {
-		imgUrl() {
-			if (this.$util.isEmpty(this.info)){
-				return ''
-			}
-			return this.info.smallCoverUrl ? this.info.smallCoverUrl : ''
-		}
-	},
-	mounted() {
-	},
-	methods: {}
+	methods: {
+
+	}
 }
 </script>
-
 <style lang="scss" scoped>
-	.list-module {
-		@include disFlex(center, space-between);
-		padding: 20upx 0;
-		border-bottom: 1px solid $borderColor;
-		.list-left {
-			@include disFlex(flex-start, space-between);
-			.image {
-				width: 140upx;
+.list-module {
+	@include disFlex(center, space-between);
+	padding: 10upx 0;
+	border-bottom: 1px solid $borderColor;
+	.list-left {
+		@include disFlex(flex-start, space-between);
+		.image {
+			width: 120upx;
+		}
+		.list-msg {
+			margin-left: 20upx;
+			.title {
+				font-size: 28upx;
+				color: $fontColor2;
+				margin-bottom: 10upx;
 			}
-			.list-msg {
-				margin-left: 20upx;
-				.title {
-					font-size: 28upx;
-					color: $fontColor2;
-					margin-bottom: 10upx;
-				}
-				.desc {
-					color: $fontColor3;
-				}
+			.desc {
+				color: $fontColor3;
 			}
 		}
-		.list-right {
-			text-align: right;
-			color: $fontColor2;
-			.price {
-				margin-bottom: 70upx;
-				color: #333;
-			}
+	}
+	.list-right {
+		text-align: right;
+		color: $fontColor2;
+		.price {
+			margin-bottom: 70upx;
+			color: #333;
 		}
 	}
-</style>
+}
+</style>

+ 67 - 0
hdApp/src/admin/order/components/detail-item.vue

@@ -0,0 +1,67 @@
+<template>
+	<view class="list-module">
+		<block v-if="!$util.isEmpty(info)">
+			<view class="list-left">
+				<view class="image">
+					<image :src="info.smallCover" mode="aspectFit" style="width:120upx; height:120upx;"></image>
+				</view>
+				<view class="list-msg">
+					<view class="title">{{ info.name || '' }}</view>
+				</view>
+			</view>
+			<view class="list-right">
+				<view class="price">¥{{ info.unitPrice ? parseFloat(info.unitPrice) : 0 }}</view>
+				<view class="num">X{{ info.num||0 }}</view>
+			</view>
+		</block>
+	</view>
+</template>
+<script>
+export default {
+	name: 'detailItem',
+	props: {
+		info: {
+			type: Object,
+			default: () => {}
+		}
+	},
+	data() {
+		return {}
+	},
+	methods: {
+
+	}
+}
+</script>
+<style lang="scss" scoped>
+.list-module {
+	@include disFlex(center, space-between);
+	padding: 10upx 0;
+	border-bottom: 1px solid $borderColor;
+	.list-left {
+		@include disFlex(flex-start, space-between);
+		.image {
+			width: 120upx;
+		}
+		.list-msg {
+			margin-left: 20upx;
+			.title {
+				font-size: 28upx;
+				color: $fontColor2;
+				margin-bottom: 10upx;
+			}
+			.desc {
+				color: $fontColor3;
+			}
+		}
+	}
+	.list-right {
+		text-align: right;
+		color: $fontColor2;
+		.price {
+			margin-bottom: 70upx;
+			color: #333;
+		}
+	}
+}
+</style>

+ 51 - 112
hdApp/src/admin/order/detail.vue

@@ -5,195 +5,134 @@
         <img :src="`${constant.imgUrl}/retail/order/bg.png`" mode="widthFix" />
       </view>
       <view class="page-top-det">
-        <view> <view class="page-status">{{ data.status | constantfilter('ORDER_STATUS') }}</view> </view>
+        <view> <view class="page-status">{{ orderInfo.status | constantfilter('ORDER_STATUS') }}</view> </view>
       </view>
     </view>
     <view class="page-det">
       <view class="module-com">
         <view class="module-tit">商品信息</view>
         <view class="module-det">
-          <block v-if="!$util.isEmpty(data.goodsInfoList)">
-            <detailGoods v-for="(items, subIndex) in data.goodsInfoList" :key="subIndex" :info="items"></detailGoods>
+          <block v-if="!$util.isEmpty(orderInfo.goodsInfoList)">
+            <detailGoods v-for="(items, subIndex) in orderInfo.goodsInfoList" :key="subIndex" :info="items"></detailGoods>
+          </block>
+          <block v-if="!$util.isEmpty(orderInfo.itemInfoList)">
+            <detailGoods v-for="(items, subIndex) in orderInfo.itemInfoList" :key="subIndex" :info="items"></detailGoods>
           </block>
         </view>
       </view>
-      <view class="module-com order-msg">
-        <view class="module-tit">订单信息</view>
+
+      <view class="module-com order-msg" v-if="!$util.isEmpty(orderInfo.receiveMobile)">
+        <view class="module-tit">收花人信息</view>
         <view class="module-det">
           <view class="order-msg-blo">
             <view class="msg-list">
               <view class="label">收花人</view>
-              <view class="value">{{ data.receiveUserName }}</view>
+              <view class="value">{{ orderInfo.receiveUserName }}</view>
             </view>
             <view class="msg-list">
               <view class="label">电话</view>
-              <view class="value">{{ data.receiveMobile }}</view>
+              <view class="value">{{ orderInfo.receiveMobile }}</view>
             </view>
             <view class="msg-list">
               <view class="label">地址</view>
-              <view class="value">{{ data.receiveFullAddress }}</view>
+              <view class="value">{{ orderInfo.receiveFullAddress }}</view>
             </view>
           </view>
           <view class="order-msg-blo">
             <view class="msg-list">
               <view class="label">送达时间</view>
-              <view v-if="data.reachDate == '0000-00-00'" class="value">-</view>
-              <view v-else class="value"><span style="margin-right:10upx;">{{data.reachDate}}</span> <span v-if="data.reachPeriod == 0">上午</span><span v-else-if="data.reachPeriod == 1">下午</span><span v-else>晚上</span></view>
+              <view v-if="orderInfo.reachDate == '0000-00-00'" class="value">-</view>
+              <view v-else class="value"><span style="margin-right:10upx;">{{orderInfo.reachDate}}</span> <span v-if="orderInfo.reachPeriod == 0">上午</span><span v-else-if="orderInfo.reachPeriod == 1">下午</span><span v-else>晚上</span></view>
             </view>
-            <view v-if="data.reachDate != '0000-00-00'" class="msg-list">
+            <view v-if="orderInfo.reachDate != '0000-00-00'" class="msg-list">
               <view class="label">贺卡</view>
-              <view class="value">{{ data.needCard == 1 ? "需要" : '不需要' }}</view>
+              <view class="value">{{ orderInfo.needCard == 1 ? "需要" : '不需要' }}</view>
             </view>
             <view class="msg-list">
               <view class="label">祝福语</view>
-              <view class="value">{{ data.cardInfo || '-' }}</view>
+              <view class="value">{{ orderInfo.cardInfo || '-' }}</view>
             </view>
           </view>
+        </view>
+      </view>
+
+      <view class="module-com order-msg">
+        <view class="module-tit">
+          <text>订单信息</text>
+          <text style="float:right;color: #3385ff;font-weight:normal;" @click.stop="goRefund()">发起退款</text>
+        </view>
+        <view class="module-det">
           <view class="order-msg-blo">
             <view class="msg-list">
               <view class="label">订单号</view>
-              <view class="value">{{ data.orderSn||'' }}</view>
+              <view class="value">{{ orderInfo.orderSn||'' }}</view>
             </view>
             <view class="msg-list">
               <view class="label">创建时间</view>
-              <view class="value">{{ data.addTime ? data.addTime.substr(5,11) : ''}}</view>
+              <view class="value">{{ orderInfo.addTime ? orderInfo.addTime.substr(5,11) : ''}}</view>
             </view>
             <view class="msg-list">
               <view class="label">运费</view>
-              <view class="value">¥{{ data.sendCost ? parseFloat(data.sendCost) : 0 }}</view>
+              <view class="value">¥{{ orderInfo.sendCost ? parseFloat(orderInfo.sendCost) : 0 }}</view>
             </view>
             <view class="msg-list">
               <view class="label">总金额</view>
-              <view class="value">¥{{ data.prePrice ? parseFloat(data.prePrice) : 0 }}</view>
+              <view class="value">¥{{ orderInfo.prePrice ? parseFloat(orderInfo.prePrice) : 0 }}</view>
             </view>
-            <view v-if="data.discountAmount > 0" class="msg-list">
+            <view v-if="orderInfo.discountAmount > 0" class="msg-list">
               <view class="label">优惠</view>
-              <view class="value">¥{{ data.discountAmount ? parseFloat(data.discountAmount) : 0 }}</view>
+              <view class="value">¥{{ orderInfo.discountAmount ? parseFloat(orderInfo.discountAmount) : 0 }}</view>
             </view>
             <view class="msg-list">
               <view class="label">实付款</view>
-              <view class="value">¥{{ data.realPrice ? parseFloat(data.realPrice) : 0 }}</view>
+              <view class="value">¥{{ orderInfo.realPrice ? parseFloat(orderInfo.realPrice) : 0 }}</view>
             </view>
           </view>
         </view>
       </view>
-      <view class="module-com coupon-wrap" v-if="data.discountAmount && data.discountAmount != '0.00' && 1==2" >
-        <view class="module-det flex-center-between">
-          <view class="app-color-3" >
-          <template v-if="data.discountType == 0">未知</template>
-          <template v-else-if="data.discountType == 1">优惠券</template>
-          <template v-else-if="data.discountType == 2">会员优惠</template>
-          <template v-else-if="data.discountType == 3">随机优惠</template>
-          <template v-else>未知</template>
-          </view>
-          <view class="app-price">-¥{{ data.discountAmount }}</view>
-        </view>
-      </view>
+
     </view>
     <view class="page-btn app-footer">
-      <view class="flex-center">
-        <span v-if="data.status == 0">应付款</span>
-        <span v-else-if="data.status == 6">已退款</span>
-        <span v-else>已付款</span>
-        <span class="app-price">
-          <span>¥</span>
-          <span class="app-size-40">{{ data.actPrice ? parseFloat(data.actPrice) : 0 }}</span>
-        </span>
+      <view class="flex-center"> </view>
+      <view class="operate-btn-wrap">
+          <button class="admin-button-com middle" style="color: #666666;border-color: #dddddd;">发货</button>
       </view>
-      <template>
-      </template>
-      <template>
-        <view class="operate-btn-wrap">
-            <button class="admin-button-com middle" style="color: #666666;border-color: #dddddd;">自取</button>
-            <button class="admin-button-com middle" style="color: #666666;border-color: #dddddd;">发货</button>
-        </view>
-      </template>
     </view>
   </view>
 </template>
 <script>
 import detailGoods from "./components/detail-goods.vue";
+import detailItem from "./components/detail-item.vue";
 import AppCoupon from "@/components/app-coupon-sel";
 import ModalModule from "@/components/plugin/modal";
 import RateModule from "@/components/plugin/rate";
-import { getDetB, freeShipping, orderUpdatePrice } from "@/api/order";
+import { getDetB} from "@/api/order";
 export default {
   name: "detail",
-  components: { detailGoods, AppCoupon, ModalModule, RateModule },
+  components: { detailGoods, AppCoupon, ModalModule, RateModule,detailItem },
   data() {
     return {
       constant: this.$constant,
-      waitPayImg: `${this.$constant.imgUrl}/retail/order/wait-pay.png`,
-      waitDeliveryImg: `${this.$constant.imgUrl}/retail/order/wait-delivery.png`,
-      data: {},
-      updatePriceModal: false,
-      form: { price: "" },
-      freeShipModal: false
+      orderInfo: {}
     };
   },
   onLoad() {
   },
   methods: {
+		goRefund(){
+			if(this.orderInfo.payWay == 1){
+				this.$msg('支付宝订单暂不支持退款,请线下退款')
+				return false
+			}
+			this.$util.pageTo({url:'/admin/order/refund?id='+this.option.id})
+		},
     init() {
-      this._getDet();
+      this.getDetailInfo();
     },
-    _getDet() {
+    getDetailInfo() {
       return getDetB({ id: this.option.id }).then(res => {
-        this.data = res.data;
+        this.orderInfo = res.data;
       });
-    },
-    // 免发货
-    freeShippingFn() {
-      this.freeShipModal = true;
-    },
-    // 免发货
-    freeShipModalClick(e) {
-      if (e.index === 0) {
-        this.modalCancel();
-      } else {
-        this.data.status = 4;
-        this.data.sendType = 1;
-        freeShipping({ id: this.data.id }).then(res => {
-          this.$msg("操作成功!");
-          this.modalCancel();
-        });
-      }
-    },
-    // 查看配送
-    seeSendFn() {
-      this.$util.pageTo({
-        url: "/admin/order/ship",
-        query: {
-          id: this.data.id,
-          pageStatus: 5
-        }
-      });
-    },
-    // 修改价格
-    updatePriceFn() {
-      this.form.price = this.data.prePrice;
-      this.updatePriceModal = true;
-    },
-    updateModalClick(e) {
-      if (e.index === 0) {
-        this.modalCancel();
-      } else {
-        orderUpdatePrice({ id: this.data.id, price: this.form.price }).then(
-          res => {
-            this.modalCancel();
-            this.$msg("修改成功!");
-            setTimeout(() => {
-              this._getDet();
-            }, 1000);
-          }
-        );
-      }
-    },
-    // 关闭弹窗
-    modalCancel() {
-      this.form.price = "";
-      this.freeShipModal = false;
-      this.updatePriceModal = false;
     }
   }
 };

+ 312 - 0
hdApp/src/admin/order/refund.vue

@@ -0,0 +1,312 @@
+<template>
+	<view class="app-content">
+		<view class="flex refund-item">
+			<view class="refund-label">退款方式:</view>
+			<view class="flex list">
+				<view class="flex" @tap="refundType=1" >
+					<view class="flex-center radioBtn" :class="refundType==1?'active':''">
+					</view>退货并退款</view>
+				<view style="margin-left: 30upx" class="flex" @tap="refundType=2">
+					<view class="flex-center radioBtn" :class="refundType==1?'':'active'">
+						</view>仅退款</view>
+			</view>
+		</view>
+		<view class="refund-item-list" v-if="refundType==1">
+			<view class="refund-label"><text></text>选择商品:</view>
+			<view>
+				<template v-if="!$util.isEmpty(goodsInfoList)">
+					<view class="list" v-for="(res,i) in goodsInfoList" :key="i">
+						<view class="flex list-title" >
+							<text class="product-name">{{res.name}}</text>
+							<text class="product-num">{{ `${parseFloat(res.num)}` }}份</text>
+							<text class="product-price">{{`${parseFloat(res.unitPrice)}`}}元/份</text>
+						</view>
+						<view class="flex list-val" style="font-size:26upx;font-weight:bold;">
+							<input type="number" placeholder="退货数" v-model="res.refundCount" placeholder-style="color:#CCCCCC" />
+							<text style="margin-left:10upx;">份</text>
+							<text style="color:green;margin-left:20upx;">可退{{Number(res.num)-Number(res.refundNum)}}份</text>
+						</view>
+					</view>
+				</template>
+				<template v-if="!$util.isEmpty(itemInfoList)">
+					<view class="list" v-for="(res,i) in itemInfoList" :key="i">
+						<view class="flex list-title" >
+							<text class="product-name">{{res.name}}</text>
+							<text class="product-num">{{ `${parseFloat(res.num)}` }}{{res.unitName}}</text>
+							<text class="product-price">{{`${parseFloat(res.unitPrice)}`}}元/{{res.unitName}}</text>
+						</view>
+						<view class="flex list-val" style="font-size:26upx;font-weight:bold;">
+							<input type="number" placeholder="退货数" v-model="res.refundCount" placeholder-style="color:#CCCCCC" />
+							<text style="margin-left:10upx;">{{res.unitName}}</text>
+							<text style="color:green;margin-left:20upx;">可退{{Number(res.num)-Number(res.refundNum)}}{{res.unitName}}</text>
+						</view>
+					</view>
+				</template>
+			</view>
+		</view>
+		<view class="flex refund-item">
+			<view class="refund-label">订单金额:</view>
+			<view class="list">
+				¥{{parseFloat(orderInfo.orderPrice)||0}}
+				<text style="margin-left:25upx;font-size:25upx;color:green;" v-if="Number(orderInfo.tkPrice)>0">已退¥{{orderInfo.tkPrice ? parseFloat(orderInfo.tkPrice) : 0}}</text>
+			</view>
+		</view>
+		<view class="flex refund-item">
+			<view class="refund-label">可退金额:</view>
+			<view class="list">¥{{coundRefundPrice}}</view>
+		</view>
+		<view class="flex refund-item">
+			<view class="refund-label"><text></text>退款金额:</view>
+			<input type="digit" v-model="refundMoney" @focus="refundMoney=''">
+		</view>
+		<view class="refund-item">
+			<view class="refund-label">备注:</view>
+			<textarea v-model="remark" />
+		</view>
+		<view class="flex-center btn-box" style="margin-bottom:50upx;margin-top:20upx;">
+			<view class="flex-center btn" @tap="cancelRefund">取消</view>
+			<view class="flex-center btn active" @tap="confirmRefund" style="margin-left: 80upx">确定</view>
+		</view>
+	</view>
+</template>
+<script>
+import { getDetail,refund } from "@/api/order/index";
+export default {
+	name: "orderDetail",
+	components: {},
+	data() {
+		return {
+			product:[],
+			goodsInfoList:[],
+			itemInfoList:[],
+			refundMoney:0,
+			refundType:1,
+			remark:'',
+			orderInfo:{},
+			coundRefundPrice:0
+		};
+	},
+	onShow() {
+	},
+	computed:{
+		refundPrice(){
+			let price = 0
+			if(!this.$util.isEmpty(this.goodsInfoList)){
+				for (const item of this.goodsInfoList) {
+					if(Number(item.refundCount)>0){
+						let currentPrice = Number(item.refundCount)*Number(item.unitPrice)
+						currentPrice.toFixed(2)
+						price = Number(price) + Number(currentPrice)
+						price.toFixed(2)
+					}
+
+				}
+			}
+			if(!this.$util.isEmpty(this.itemInfoList)){
+				for (const item of this.itemInfoList) {
+					if(Number(item.refundCount)>0){
+						let currentPrice = Number(item.refundCount)*Number(item.unitPrice)
+						currentPrice.toFixed(2)
+						price = Number(price) + Number(currentPrice)
+						price.toFixed(2)
+					}
+
+				}
+			}
+			this.refundMoney = price
+			return price
+		}
+	},
+	watch:{
+	},
+	methods: {
+		cancelRefund(){
+			uni.navigateBack({delta: 1});
+		},
+		confirmRefund(){
+			let hasError = false
+			let selectProduct = []
+			let that = this
+			if(!this.$util.isEmpty(this.goodsInfoList)){
+				this.goodsInfoList.forEach(ele=>{
+					let currentRefundCont = ele.refundCount ? Number(ele.refundCount) :0
+
+					let currentNum = ele.num ? Number(ele.num) : 0
+					let hasRefundNum = ele.refundNum ? Number(ele.refundNum) : 0
+					let couldRefundNum = Number(currentNum) - Number(hasRefundNum)
+
+					if(Number(currentRefundCont) > Number(couldRefundNum)){
+						uni.showToast({title:ele.name+'超过可退数量',icon:'none'})
+						hasError = true;
+						return false
+					}
+					if(Number(ele.refundCount)>0){
+						selectProduct.push({"productId":ele.goodsId,"num":ele.refundCount,"unitType":ele.unitType,unitName:ele.unitName,unitPrice:ele.unitPrice,property:0})
+					}
+				})
+			}
+			if(!this.$util.isEmpty(this.itemInfoList)){
+				this.itemInfoList.forEach(ele=>{
+					let currentRefundCont = ele.refundCount ? Number(ele.refundCount) :0
+
+					let currentNum = ele.num ? Number(ele.num) : 0
+					let hasRefundNum = ele.refundNum ? Number(ele.refundNum) : 0
+					let couldRefundNum = Number(currentNum) - Number(hasRefundNum)
+
+					if(Number(currentRefundCont) > Number(couldRefundNum)){
+						uni.showToast({title:ele.name+'超过可退数量',icon:'none'})
+						hasError = true;
+						return false
+					}
+					if(Number(ele.refundCount)>0){
+						selectProduct.push({"productId":ele.itemId,"num":ele.refundCount,"unitType":ele.unitType,unitName:ele.unitName,unitPrice:ele.unitPrice,property:1})
+					}
+				})
+			}
+			if(hasError){
+				return
+			}
+			if(this.$util.isEmpty(selectProduct)&&this.refundType==1){
+				uni.showToast({title:'请选择商品',icon:'none'})
+				return;
+			}
+			let refundParams = {product:JSON.stringify(selectProduct),id: this.option.id,price:this.refundMoney,remark:this.remark,refundType:this.refundType,getOriginalItem:1}
+			that.$util.confirmModal({content:'确认退款?'},() => {
+				uni.showLoading({mask:true})
+				refund(refundParams).then(res => {
+					uni.hideLoading()
+					if(res.code == 1){
+						uni.navigateTo({url:'/common/success',query:{titleType:1}})
+					}
+				})
+			})
+		},
+		async init() {
+			const res = await getDetail({ id: this.option.id})
+			this.orderInfo = res.data
+			
+			this.coundRefundPrice = Number(res.data.orderPrice) - Number(res.data.tkPrice)
+			this.coundRefundPrice = this.coundRefundPrice.toFixed(2)
+			this.coundRefundPrice = parseFloat(this.coundRefundPrice)
+
+			this.goodsInfoList = res.data.goodsInfoList.map(ele=>{
+				return {...ele,refundCount:null}
+			})
+			this.itemInfoList = res.data.itemInfoList.map(ele=>{
+				return {...ele,refundCount:null}
+			})
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.app-content{
+	height: calc(100vh - 30upx * 2);
+	padding: 30upx;
+	background: #FFFFFF;
+	font-size: 30upx;
+	.radioBtn{
+		width: 30upx;
+		height: 30upx;
+		margin-right: 10upx;
+		border: 1upx solid #ddd;
+		border-radius: 50%;
+		&.active{
+			position: relative;
+			border: 1upx solid #3385ff;
+			&:after{
+				content: '';
+				position: absolute;
+				width: 18upx;
+				height: 18upx;
+				background: #3385ff;
+				border-radius: 50%;
+			}
+		}
+	}
+	.refund-item-list{
+		display: flex;
+		padding-bottom: 30upx;
+		padding-top: 30upx;
+		border-top: 1upx solid #e6e4e4;
+		border-bottom: 1upx solid #e6e4e4;
+		.refund-label{
+			width: 200upx;
+			color:#666666;
+			font-size:26upx;
+			text{color: red;}
+		}
+		.list{
+			margin-bottom: 10upx;
+			.list-title{
+				height: 60upx;
+				padding-bottom: 20upx;
+				font-size:26upx;
+				font-weight:bold;
+				.product-name{
+					overflow: hidden;
+					text-overflow:ellipsis;
+					white-space: nowrap;
+					width:190upx;
+				}
+				.product-price{
+					overflow: hidden;
+					text-overflow:ellipsis;
+					white-space: nowrap;
+					width:130upx;
+					margin-left:10upx;
+				}
+				.product-num{
+					width:90upx;
+					overflow: hidden;
+					text-overflow:ellipsis;
+					white-space: nowrap;
+					margin-left:10upx;
+				}
+			}
+			.list-val{
+				input{
+					width: 200upx;
+					border: 1upx solid #ddd;
+					text-align: center;
+					font-weight: normal;
+				}
+			}
+		}
+	}
+	.refund-item{
+		display: flex;
+		padding: 18upx 0;
+		.refund-label{
+			width: 200upx;
+			color:#666666;
+			font-size:26upx;
+			text{
+				color: red;
+			}
+		}
+		input{
+			border: 1upx solid #ddd;
+		}
+		textarea{
+			width: calc(100% - 210upx);
+			height:150upx;
+			border: 1upx solid #ddd;
+		}
+	}
+	.btn-box{
+		.btn{
+			width: 220upx;
+			height: 90upx;
+			border: 1upx solid #666666;
+			border-radius: 10upx;
+			color:#666666;
+			&.active{
+				background: #3385ff;
+				color: #fff;
+				border: 1upx solid #3385ff;
+			}
+		}
+	}
+}
+</style>

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

@@ -1,5 +1,8 @@
 import https from "@/plugins/luch-request_0.0.7/request";
 
+//退款
+export const refund = data => {return https.post("/refund/create-order", data);};
+
 //损耗生成订单
 export const wastage = data => {
 	return https.post("/wastage/create-order", data);
@@ -76,6 +79,7 @@ export const getDetB = data => {
 	return https.get("/order/detail", data);
 };
 
+
 /** *
 	* 延期收款 --姜枫 2021.03.20
 	*/

+ 40 - 0
hdApp/src/common/pageSuccess.vue

@@ -0,0 +1,40 @@
+<template>
+  <appResult :title="title?title:'成功'">
+    <button class="admin-button-com big" @click="goBackHome">返回首页</button>
+  </appResult>
+  <!-- 这个页面在安卓端会卡住,请不要再使用 -->
+</template>
+<script>
+import appResult from "@/components/app-result";
+export default {
+  name: "pageSuccess",
+  components: {
+    appResult,
+  },
+	data() {
+		return {
+			title:'',
+		};
+	},
+	onLoad(e){
+  	this.title = e.title
+	},
+	onUnload(){
+		uni.navigateBack({delta:2})
+	},
+		methods: {
+    closeLayer() {
+		uni.navigateBack({delta: 3});
+    },
+	goBackHome() {
+      this.$util.pageTo({ url: "/admin/home/workbench", type: 4, query: { tabIndex: 0 }, })
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.admin-button-com {
+  margin-bottom: 20upx;
+  width: 100%;
+}
+</style>

+ 65 - 0
hdApp/src/common/redirect.vue

@@ -0,0 +1,65 @@
+<template>
+    <div class="app-content">
+		<!-- <div class="prompt-text">加载中 . . .</div> -->
+	</div>
+</template>
+<script>
+import { mapGetters, mapState, mapActions } from 'vuex'
+import { getWxQrCodeQuery } from '@/api/common'
+export default {
+	data() {
+		return {
+		}
+	},
+	computed: {
+		// ...mapGetters({ userInfo: 'getSelfInfo' })
+	},
+	onLoad(options) {
+		uni.showLoading({
+			title: '加载中...'
+		})
+		if (options.redirectUrl) {
+			this.compatible()
+		}
+		// this._getWxQrCodeQuery(options.scene)
+	},
+	methods: {
+		// _getWxQrCodeQuery(scene) {
+		// 	getWxQrCodeQuery({ scene: scene }).then(res => {
+		// 		uni.hideLoading()
+		// 		if (res.data.url.indexOf('https://') > -1) {
+		// 			const returnUrl = encodeURIComponent(res.data.url)
+		// 			uni.navigateTo({
+		// 				url: `/common/webview?returnUrl=${returnUrl}`
+		// 			})
+		// 		} else {
+		// 			uni.redirectTo({
+		// 				url: res.data.url
+		// 			})
+		// 		}
+		// 	}).catch((e) => {
+		// 		this.compatible()
+		// 	})
+		// },
+		// 兼容,如果小程序码或者接口返回有误时进入登录页
+		compatible() {
+			uni.hideLoading()
+			if (this.option.type == 'invite') {
+				// #ifdef H5
+				location.href = decodeURIComponent(this.option.redirectUrl)
+				// #endif
+			}
+			// uni.redirectTo({
+			// 	url: `/pages/page/login/index`
+			// })
+		}
+	}
+}
+
+</script>
+<style lang="scss" scoped>
+.prompt-text {
+	padding-top: 200upx;
+	text-align: center;
+}
+</style>

+ 47 - 0
hdApp/src/common/success.vue

@@ -0,0 +1,47 @@
+<template>
+  <appResult :title="title">
+	<button class="admin-button-com big blue" style="width:80%;margin-top:50upx;" @click="goBackHome">返回首页</button>
+  </appResult>
+</template>
+<script>
+import appResult from "@/components/app-result";
+export default {
+  name: "commonSuccess",
+  components: {
+    appResult
+  },
+	data() {
+		return {
+			title:'操作成功',
+		};
+	},
+	onShow(){
+
+	},
+	onLoad(e){
+        let titleType = e.titleType || 1
+        if(titleType == 1){
+            this.title = '操作成功'
+        }
+        if(titleType == 2){
+            this.title = '结账成功'
+        }
+        if(titleType == 3){
+            this.title = '收款成功'
+        }
+	},
+	onUnload(){
+	},
+	methods: {
+        goBackHome() {
+            this.$util.pageTo({ url: "/admin/home/workbench", type: 3, query: { tabIndex: 0 }})
+        }
+  },
+};
+</script>
+<style lang="scss" scoped>
+.admin-button-com {
+	margin-bottom: 20upx;
+	width: 100%;
+}
+</style>

+ 36 - 0
hdApp/src/common/webview.vue

@@ -0,0 +1,36 @@
+<template>
+	<web-view :src="src"></web-view>
+</template>
+
+<script>
+import { mapGetters } from 'vuex'
+// import { getSelfInfo } from '@/utils/auth'
+
+export default {
+	data() {
+		return {
+			src: '',
+			roleName: ''
+		}
+	},
+	computed: {
+		// ...mapGetters({ userInfo: 'getSelfInfo' })
+	},
+	onLoad(option) {
+	},
+	/**
+		 * 用户点击右上角分享
+		 */
+	onShareAppMessage: function(option) {
+		let shareObj = {}
+		shareObj = {
+			title: this.userInfo.nick_name + this.userInfo.role_name,
+			path: `/pages/design/designCompany/indexNew?${params}`
+		}
+		return shareObj
+	}
+}
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 1 - 0
hdApp/src/pages.json

@@ -273,6 +273,7 @@
 			"root": "admin/order",
 			"pages": [
 				{ "path": "detail", "style": { "navigationBarTitleText": "详情" } },
+				{ "path": "refund", "style": { "navigationBarTitleText": "退款" } },
 				{ "path": "ship", "style": { "navigationBarTitleText": "发货" } },
 				{ "path": "fill-form", "style": { "navigationBarTitleText": "填写收花人" } }
 			]

+ 6 - 4
hdPad/src/pages/home/components/console.vue

@@ -32,7 +32,7 @@
         <toPayWay @cancelPay="cancelPay()" @payFinish="payFinish()" @selectPayWayBack="selectPayWayBack" :orderId.sync="orderId"></toPayWay>
     </uni-popup>
 
-	<!-- 收款 -->
+	<!-- 临时收款 -->
 	<uni-popup ref="gatheringRef" background-color="#fff" type="center" :animation="false">
 		<selectPrice @confirmSelectPrice="confirmSelectPrice" @cancelSelectPrice="cancelSelectPrice"></selectPrice>
 	</uni-popup>
@@ -166,10 +166,12 @@ export default {
 			createOrder({...params,product:JSON.stringify(product)}).then(res=>{
 				uni.hideLoading()
 				if(res.code == 1){
-					console.log(res.data)
+					if(res.data.status == 1){
+						this.orderId = res.data.id
+						this.$refs.toPayRef.open('center')
+					}
 					this.$refs.settlePopRef.close()
-					this.orderId = res.data.id
-					this.$refs.toPayRef.open('center')
+					this.removeFromSaveDirect()
 				}
 			})
 		},

+ 8 - 8
hdPad/src/pages/home/components/settlePop.vue

@@ -7,14 +7,14 @@
                     <view :key="item.id" @tap="changeHasPay(item.id)" v-for="item in hasPayList" :class="[form.hasPay===item.id?'active':'']"> {{item.name}} </view>    
                 </view>
             </view>
-            <template>
-                <view class="select-item_box">
-                    <view class="title">收款方式</view>
-                    <view class="item-list_box">
-                        <view :key="item.id" @tap="changePayWay(item.id)" v-for="item in payWayList" :class="[form.payWay===item.id?'active':'']"> {{item.name}} </view>  
-                    </view>
+            
+            <view class="select-item_box" v-if="form.hasPay == 1">
+                <view class="title">收款方式</view>
+                <view class="item-list_box">
+                    <view :key="item.id" @tap="changePayWay(item.id)" v-for="item in payWayList" :class="[form.payWay===item.id?'active':'']"> {{item.name}} </view>  
                 </view>
-            </template>
+            </view>
+            
             <view class="select-item_box">
                 <view class="title">打印小票</view>
                 <view class="item-list_box">
@@ -30,7 +30,7 @@
             <view class="select-item_box">
                 <view class="title">备注:</view>
                 <view class="inpup_box">
-                    <view><input type="text" v-model="form.remark" name="remark" /></view>     
+                    <view><input type="text" v-model="form.remark" name="remark" /></view>
                 </view>
             </view>
         </view>