shish 3 anni fa
parent
commit
bf7f4187ed

+ 8 - 0
ghsApp/src/api/refund/index.js

@@ -1,5 +1,13 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
+export const rejectRefund = data => {
+	return https.post('/refund/refund-waste', data)
+}
+
+export const passRefund = data => {
+	return https.get('/refund/pass', data)
+}
+
 export const refundWaste = data => {
 	return https.post('/refund/refund-waste', data)
 }

+ 43 - 9
ghsApp/src/pagesOrder/refundDetail.vue

@@ -25,11 +25,7 @@
 			<view class="list">{{ info.status==0?'待审核':info.status==1?'已通过':info.status==2?'已驳回':info.status==3 ? '已取消':'' }}</view>
 		</view>
 		<view class=" refund-item">
-			<view class="refund-label">客户备注:</view>
-			<view class="list">{{info.hdRemark?info.hdRemark:''}}</view>
-		</view>
-		<view class=" refund-item">
-			<view class="refund-label">我的备注:</view>
+			<view class="refund-label">备注信息:</view>
 			<view class="list">{{info.remark?info.remark:''}}</view>
 		</view>
 
@@ -56,10 +52,21 @@
 		<view style="text-align:center;">
 			<button class="admin-button-com big default" style="margin:30upx auto 10upx auto;width:50%;" @click="goBack()">返回</button>
 		</view>
+
+		<uni-popup ref="rejectRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
+			<view style="padding:30upx;">
+				<textarea v-model="rejectReason" style="border:1upx solid #cccccc;height:140upx;" placeholder="驳回原因..."></textarea>
+				<view style="text-align:center;">
+					<button class="admin-button-com big default" style="margin:30upx auto 10upx auto;width:45%;" @click="cancelReject()">取消</button>
+					<button class="admin-button-com big blue" style="margin:30upx auto 10upx 20upx;width:45%;" @click="confirmReject()">确认</button>
+				</view>
+			</view>
+		</uni-popup>
+
 	</view>
 </template>
 <script>
-import { refundDetail } from "@/api/refund";
+import { refundDetail,passRefund,rejectRefund } from "@/api/refund";
 export default {
 	data() {
 		return {
@@ -67,17 +74,44 @@ export default {
 			refundPrice:0,
 			refundType:1,
 			remark:'',
-			info:[]
+			info:[],
+			rejectReason:''
 		};
 	},
 	onShow() {
 	},
 	methods: {
+		cancelReject(){
+			this.$refs.rejectRef.close()
+		},
 		reject(){
-
+			this.$refs.rejectRef.open('center')
+		},
+		confirmReject(){
+			let that = this
+			this.$util.confirmModal({content:'确认驳回?'},() => {
+				uni.showLoading({mask:true})
+				rejectRefund({id: this.option.id,rejectReason:this.rejectReason}).then(res=>{
+					uni.hideLoading()
+					if(res.code == 1){
+						that.$msg('操作成功')
+						that.init()
+					}
+				})
+			})
 		},
 		pass(){
-
+			let that = this
+			this.$util.confirmModal({content:'确认通过?'},() => {
+				uni.showLoading({mask:true})
+				passRefund({id: this.option.id}).then(res=>{
+					uni.hideLoading()
+					if(res.code == 1){
+						that.$msg('操作成功')
+						that.init()
+					}
+				})
+			})
 		},
 		showBig(index){
 			if(this.info.bigImgList && !this.$util.isEmpty(this.info.bigImgList)){

+ 5 - 3
hdApp/src/pagesPurchase/refund.vue

@@ -178,7 +178,7 @@ export default {
 				id:this.option.id,
 				product:JSON.stringify(product),
 				price:this.refundMoney,
-				hdRemark:this.remark,
+				remark:this.remark,
 				refundType:this.refundType,
 				getOriginalItem:1,
 				imgList:imgData
@@ -187,8 +187,10 @@ export default {
 				uni.showLoading({title: "提交中",mask:true})
 				createRefund(refundParams).then(res => {
 					if(res.code == 1){
-						//uni.hideLoading()
-						//this.$util.pageTo({url: '/pagesOrder/refundSuccess?id='+res.data.id,type:2})
+						that.$msg('操作成功')
+						setTimeout(function(){
+							that.$util.pageTo({url: '/pagesPurchase/refundDetail?id='+res.data.id,type:2})
+						},1200)
 					}
 				})
 			})

+ 3 - 3
hdApp/src/pagesPurchase/refundDetail.vue

@@ -5,7 +5,7 @@
       <view class="module-com content-box proInfo">
         <view class="commodity-view">
           <view class="infoAEdit">
-            <text>申请退款花材</text>
+            <text>退货花材</text>
           </view>
           <view class="commodity-list">
             <view v-for="(s, idx) in refundData.itemList" :key="idx" class="commodity-item">
@@ -64,7 +64,7 @@
     <view class="app-footer">
       <view class="flex-center"> </view>
       <view class="operate-btn-wrap">
-        <button class="admin-button-com middle" @click.stop="cancelFn(refundData.info)" v-if="refundData.info.status == 0">取消申请</button>
+        <button class="admin-button-com middle" style="margin-right:30upx;" @click.stop="cancelFn(refundData.info)" v-if="refundData.info.status == 0">取消申请</button>
       </view>
     </view>
 
@@ -322,7 +322,7 @@ export default {
   justify-content: flex-end;
   & .admin-button-com {
     padding: 0;
-    margin-right: 15upx;
+    margin-right:20upx;
     width: 140upx;
     height: 70upx;
     line-height: 70upx;