zs 2 yıl önce
ebeveyn
işleme
6e8767a1c5
1 değiştirilmiş dosya ile 58 ekleme ve 22 silme
  1. 58 22
      pagesMy/order/service.vue

+ 58 - 22
pagesMy/order/service.vue

@@ -48,7 +48,7 @@
 								<view>{{thrform.type_name||'请选择售后类型'}}</view>
 							</picker>
 						</uni-forms-item>
-						<uni-forms-item label="退款金额" name="money" v-if="thrform.type=='0'||thrform.type=='1'">
+						<uni-forms-item label="退款金额" name="money" v-if="thrform.type=='1'||thrform.type=='2'">
 							<uni-easyinput type="digit" v-model="thrform.money" @input="toMoney"
 								placeholder="请输入退款金额" />
 							<view class="money">
@@ -68,7 +68,7 @@
 							<upload :list="icon" name="icon" :count="1" @uplSuc="uplSuc" @uplDel="uplDel"></upload>
 						</uni-forms-item>
 						<view class="btn">
-							<button type="primary" size="mini" @click="onSubmit('form')">提交保存</button>
+							<button type="primary" size="mini" @click="onSubmit('thrform')">提交保存</button>
 						</view>
 					</uni-forms>
 				</view>
@@ -205,7 +205,7 @@
 					that.$set(that.thrform, `type`, data.value);
 					that.$set(that.thrform, `type_name`, data.label);
 				}
-				if (data.value != '2') {
+				if (data.value != '3') {
 					if (thrform.goods_id) {
 						const arr = await that.$api(`/afterSale/cgfr`, 'POST', {
 							order_detail: that.id,
@@ -270,32 +270,68 @@
 				const that = this;
 				let status = that.status;
 				let money = that.moneyInfo.payTotal;
-				that.$refs[ref].validate().then(params => {
+				that.$refs[ref].validate().then(async params => {
 					if (status == '3') {
-						if (params.type != '2')
-							if (params.money) {
-								if (parseFloat(params.money) > parseFloat(money)) {
-									uni.showToast({
-										title: '输入金额不能超过实际支付金额',
-										icon: 'none'
-									})
-								} else {
-									params.file = that.icon;
-									params.order_detail = that.id;
-									console.log(params);
-								}
-							} else {
-								uni.showToast({
-									title: `请输入退款金额`,
-									icon: 'none',
-								});
-							}
+						that.Receip(params)
 					} else {
 						that.orderCancel(params)
 					}
 
 				})
 			},
+			// 已收到货
+			async Receip(e) {
+				const that = this;
+				e.file = that.icon;
+				e.order_detail = that.id;
+				if (e.type != '2') {
+					if (e.money) {
+						if (parseFloat(e.money) > parseFloat(money)) {
+							uni.showToast({
+								title: '输入金额不能超过实际支付金额',
+								icon: 'none'
+							})
+						} else {
+							let arr = await that.$api(`/afterSale`, 'POST', e)
+							if (arr.errcode == '0') {
+								uni.showToast({
+									title: '申请售后完成',
+									icon: 'none'
+								})
+								uni.navigateBack({
+									detail: 1
+								})
+							} else {
+								uni.showToast({
+									title: arr.errmsg,
+									icon: 'none'
+								})
+							}
+						}
+					} else {
+						uni.showToast({
+							title: `请输入退款金额`,
+							icon: 'none',
+						});
+					}
+				} else {
+					let arr = await that.$api(`/afterSale`, 'POST', e)
+					if (arr.errcode == '0') {
+						uni.showToast({
+							title: '申请售后完成',
+							icon: 'none'
+						})
+						uni.navigateBack({
+							detail: 1
+						})
+					} else {
+						uni.showToast({
+							title: arr.errmsg,
+							icon: 'none'
+						})
+					}
+				}
+			},
 			// 未收到货
 			async orderCancel(e) {
 				const that = this;