shish před 1 rokem
rodič
revize
6c5c4f5a7e

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

@@ -36,3 +36,7 @@ export const refundList = data => {
 export const getRefundListByItem = data => {
 	return https.get('/refund/get-list-by-item', data)
 }
+
+export const changeRefundOption = data => {
+	return https.post('/refund/change-refund-option', data)
+}

+ 6 - 1
ghsApp/src/pagesOrder/refundDetail.vue

@@ -13,6 +13,9 @@
 				<view class="flex list-title">
 					{{res.name}} ¥{{parseFloat(res.xhUnitPrice)}}x{{res.xhNum}}{{res.xhUnitName}}=¥{{parseFloat(res.xhPrice)}}
 				</view>
+				<view class="flex list-title" v-if="res.refundOptionId!=0" style="color:#ad760d;height:auto;padding-bottom:8upx;font-size:24upx;">
+					<text>{{ res.refundOptionName }}</text>
+				</view>
 			</view>
 			</view>
 		</view>
@@ -131,6 +134,9 @@ export default {
 			this.from = this.option.from
 		}
 	},
+	onShow(){
+		this.init()
+	},
 	methods: {
 		cancelChange(){
 			this.refundAmount = ''
@@ -281,7 +287,6 @@ export default {
 				.list-title{
 					height: 60upx;
 					padding-bottom: 20upx;
-
 				}
 				.list-val{
 					input{

+ 41 - 4
ghsApp/src/pagesOrder/refundSuccess.vue

@@ -10,8 +10,12 @@
             已报损{{item.xhWasteNum}}{{item.xhUnitName}}
             </text>
           </text>
-          <button class="admin-button-com middle" style="margin:10upx auto 0 auto;" @click="beginWastage(item)" v-if="item.xhUnitType == 0">报损</button>
-          <button class="admin-button-com middle" style="margin:10upx auto 0 auto;" @click="pageTo({url:'/admin/item/detail?id='+item.productId})" v-else>去损报</button>
+          <view style="margin-top:10upx;margin-bottom:10upx;color:#ad760d;" v-if="item.refundOptionId!=0">{{ item.refundOptionName }}</view>
+          <view style="width:420upx;">
+            <button class="admin-button-com middle" style="width:200upx;" @click="beginWastage(item)" v-if="item.xhUnitType == 0">报损</button>
+            <button class="admin-button-com middle" style="width:200upx;" @click="pageTo({url:'/admin/item/detail?id='+item.productId})" v-else>去损报</button>
+            <button class="admin-button-com middle" style="margin-left:10upx;width:200upx;" @click="selOption(item)">售后原因</button>
+          </view>
         </view>
       </block>
     </view>
@@ -28,11 +32,25 @@
 		</template>
 		</modal-module>
 
+		<uni-popup ref="optionRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
+			<view style="max-height:90vh;overflow: scroll;">
+				<view style="margin-left:30upx;margin-top:19upx;font-size:27upx;font-weight:bold;">请选择:</view>
+				<view style="display:flex;padding:20upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
+					<view v-for="(item, index) in refundOption" :key="index" @tap.stop="getOption(item)" style="margin-bottom:20upx;margin-left:3upx;">
+						<view style="margin-top:8upx;margin-right:10upx;overflow: hidden;white-space: nowrap;width:auto;text-align:center;font-weight:bold;font-size:30upx;border:1upx solid black;padding:5upx 10upx 5upx 10upx;border-radius:8upx;">{{item.name}}</view>
+					</view>
+				</view>
+				<view style="text-align:center;padding:10upx 0 10upx 0;">
+          <button class="admin-button-com big blue" style="width:210upx;" @click="cancelOption()">取消选择</button>
+        </view>
+			</view>
+    </uni-popup>
+
   </appResult>
 </template>
 <script>
 import appResult from "@/components/app-result";
-import { refundDetail,refundWaste } from "@/api/refund";
+import { refundDetail,refundWaste,changeRefundOption } from "@/api/refund";
 import ModalModule from "@/components/plugin/modal"
 export default {
   name: "commonSuccess",
@@ -48,10 +66,28 @@ export default {
 			wastageItemId:0,
 			wastageShow:false,
 			wastageNum:0,
-      refundItemId:0
+      refundItemId:0,
+      refundOption:[],
+      currentInfo:{}
 		};
 	},
 	methods: {
+    selOption(info){
+      this.$refs.optionRef.open('center')
+      this.currentInfo = info
+    },
+    cancelOption(){
+      this.$refs.optionRef.close()
+    },
+		getOption(item){
+      changeRefundOption({id:this.option.id,sonId:this.currentInfo.id,optionId:item.id}).then(res=>{
+        if(res.code == 1){
+          this.$msg('修改成功')
+          this.init()
+          this.$refs.optionRef.close()
+        }
+      })
+		},
     beginWastage(item){
       this.wastageShow = true
       this.wastageNum = item.xhNum
@@ -63,6 +99,7 @@ export default {
 			refundDetail({ id: this.option.id }).then(res=>{
         that.info = res.data.info ? res.data.info : []
         that.itemList = res.data.itemList ? res.data.itemList : []
+        that.refundOption = res.data.itemRefundOption?res.data.itemRefundOption:[]
 			})
     },
     goBack() {