Browse Source

新增订单核销

master
朱耘稷 4 years ago
parent
commit
64fa9925ff
  1. 63
      pages/orderAdmin/AdminOrder/index.vue
  2. 63
      pages/orderAdmin/AdminOrderList/index.vue
  3. 3
      utils/index.js

63
pages/orderAdmin/AdminOrder/index.vue

@ -135,7 +135,9 @@
v-if="orderInfo.pay_type === 'offline' && orderInfo.paid === 0" v-if="orderInfo.pay_type === 'offline' && orderInfo.paid === 0"
@click="offlinePay" @click="offlinePay"
>确认付款</view> >确认付款</view>
<view class="bnt delivery" v-if="types == 1" @click="goGoodsDeliver(orderInfo)">去发货</view> <view class="bnt delivery" v-if="title=='未发货' && types == 1" @click="goGoodsDeliver(orderInfo)">去发货</view>
<view class="bnt quick" v-if="title=='待核销' && types == 1" @click="storeCancellation(0)">快速核销</view>
<view class="bnt delivery" v-if="title=='待核销' && types == 1" @click="storeCancellation(1)">立即核销</view>
</view> </view>
<PriceChange <PriceChange
:change="change" :change="change"
@ -156,6 +158,7 @@ import {
setOfflinePay, setOfflinePay,
setOrderRefund setOrderRefund
} from "@/api/admin"; } from "@/api/admin";
import {orderVerific} from "@/api/order";
import { required, num } from "@/utils/validate"; import { required, num } from "@/utils/validate";
import { validatorDefaultCatch } from "@/utils/dialog"; import { validatorDefaultCatch } from "@/utils/dialog";
import { copyClipboard } from "@/utils"; import { copyClipboard } from "@/utils";
@ -190,7 +193,7 @@ export default {
} }
} }
}, },
mounted: function() { onShow: function() {
this.order_id = this.$yroute.query.oid; this.order_id = this.$yroute.query.oid;
this.getIndex(); this.getIndex();
}, },
@ -349,7 +352,63 @@ export default {
}); });
} }
); );
},
storeCancellation(index) {
const that = this;
that.check = true;
if (index == 0) {
uni.showModal({
title: "确定核销订单?",
content: "注意:请务必核对核销码的与客户正确性",
success(res) {
if (res.confirm) {
uni.showLoading({
title: "查询中"
});
orderVerific(that.orderInfo.verifyCode, 1)
.then(res => {
console.log(res)
uni.hideLoading();
that.iShidden = false;
uni.showToast({
title: res.msg,
icon: 'none',
duration: 1000
});
//
setTimeout(function() {
uni.navigateBack({
delta: 1, //
success: function() {
console.log('成功!')
}
})
}, 1000);
})
.catch((err) => {
console.log(err)
uni.hideLoading();
uni.showToast({
title: err.data.msg,
icon: "none",
duration: 2000
});
});
}
}
});
} else {
that.$yrouter.push({
path: '/pages/orderAdmin/OrderCancellation/index'
})
}
} }
} }
}; };
</script> </script>
<style lang="less">
.quick {
background: #F25555;
}
</style>

63
pages/orderAdmin/AdminOrderList/index.vue

@ -31,7 +31,7 @@
<view class="money"> <view class="money">
<view class="x-money">{{ val.productInfo.price }}</view> <view class="x-money">{{ val.productInfo.price }}</view>
<view class="num">x{{ val.cartNum }}</view> <view class="num">x{{ val.cartNum }}</view>
<view class="y-money">{{ val.productInfo.otPrice }}</view> <view class="y-money" v-if="val.productInfo.otPrice">{{ val.productInfo.otPrice }}</view>
</view> </view>
</view> </view>
</view> </view>
@ -54,7 +54,9 @@
<view class="bnt" @click="modify(item, 0)" v-if="where.status == 0">一键改价</view> <view class="bnt" @click="modify(item, 0)" v-if="where.status == 0">一键改价</view>
<view class="bnt" @click="modify(item, 0)" v-if="where.status == -3 && item.refundStatus === 1">立即退款</view> <view class="bnt" @click="modify(item, 0)" v-if="where.status == -3 && item.refundStatus === 1">立即退款</view>
<view class="bnt cancel" v-if="item.pay_type === 'offline' && item.paid === 0" @click="offlinePay(item)">确认付款</view> <view class="bnt cancel" v-if="item.pay_type === 'offline' && item.paid === 0" @click="offlinePay(item)">确认付款</view>
<view class="bnt" v-if="where.status == 1" @click="goGoodsDeliver(item)">去发货</view> <view class="bnt" v-if="where.status == 1 && item._status._title=='未发货'" @click="goGoodsDeliver(item)">去发货</view>
<view class="bnt cancel" v-if="item._status._title=='待核销' && where.status == 1" @click="storeCancellation(0,item.verifyCode)">快速核销</view>
<view class="bnt" v-if="item._status._title=='待核销' && where.status == 1" @click="storeCancellation(1,item.verifyCode)">立即核销</view>
</view> </view>
</view> </view>
</view> </view>
@ -75,6 +77,7 @@
setOfflinePay, setOfflinePay,
setOrderRefund setOrderRefund
} from "@/api/admin"; } from "@/api/admin";
import {orderVerific} from "@/api/order";
import { import {
required, required,
num num
@ -119,7 +122,7 @@
this.getIndex(); this.getIndex();
} }
}, },
mounted: function() { onShow: function() {
let that = this; let that = this;
that.where.status = that.$yroute.query.types; that.where.status = that.$yroute.query.types;
that.current = ""; that.current = "";
@ -318,10 +321,64 @@
}); });
} }
); );
},
storeCancellation(index,verifyCode) {
const that = this;
that.check = true;
if (index == 0) {
uni.showModal({
title: "确定核销订单?",
content: "注意:请务必核对核销码的与客户正确性",
success(res) {
if (res.confirm) {
uni.showLoading({
title: "查询中"
});
orderVerific(verifyCode, 1)
.then(res => {
console.log(res)
uni.hideLoading();
that.iShidden = false;
uni.showToast({
title: res.msg,
icon: 'none',
duration: 1000
});
//
setTimeout(function() {
uni.navigateBack({
delta: 1, //
success: function() {
console.log('成功!')
}
})
}, 1000);
})
.catch((err) => {
console.log(err)
uni.hideLoading();
uni.showToast({
title: err.data.msg,
icon: "none",
duration: 2000
});
});
}
}
});
} else {
that.$yrouter.push({
path: '/pages/orderAdmin/OrderCancellation/index'
})
}
} }
} }
}; };
</script> </script>
<style lang="less"> <style lang="less">
.quick {
background: #F25555;
}
</style> </style>

3
utils/index.js

@ -215,6 +215,9 @@ export const login = () => {
console.log(redirect) console.log(redirect)
if (redirect) { if (redirect) {
redirect = redirect.split('/pages')[1] redirect = redirect.split('/pages')[1]
if(!redirect){
redirect="/Loading/index";
}
reLaunch({ reLaunch({
path: '/pages' + redirect, path: '/pages' + redirect,
}); });

Loading…
Cancel
Save