|
@@ -59,16 +59,9 @@
|
|
</view>
|
|
</view>
|
|
<view class="btn">
|
|
<view class="btn">
|
|
<button type="default" size="mini" @tap.stop="toView(item,'order')">详细信息</button>
|
|
<button type="default" size="mini" @tap.stop="toView(item,'order')">详细信息</button>
|
|
- <button v-if="item.status=='0'||item.status=='1'" size="mini"
|
|
|
|
- @tap.stop="toCancel(item)">取消订单</button>
|
|
|
|
- <button v-if="item.status=='0'" size="mini" @tap.stop="toPay(item)">支付</button>
|
|
|
|
<button v-if="item.status=='2'||item.status=='3'||item.status=='2-'" size="mini"
|
|
<button v-if="item.status=='2'||item.status=='3'||item.status=='2-'" size="mini"
|
|
@tap.stop="toLogi(item)">查看物流</button>
|
|
@tap.stop="toLogi(item)">查看物流</button>
|
|
- <button v-if="item.status=='2'&&item.is_afterSale!=true" size="mini"
|
|
|
|
- @tap.stop="toConfirm(item)">确认收货</button>
|
|
|
|
- <button v-if="item.status=='2'||item.status=='2-'&&item.is_afterSale!=true" size="mini"
|
|
|
|
- @tap.stop="toReject(item)">拒收</button>
|
|
|
|
- <button v-if="item.status=='3'" size="mini" @tap.stop="toAfter(item)">申请售后</button>
|
|
|
|
|
|
+ <button v-if="item.is_afterSale==true" size="mini" @tap.stop="toHandle(item)">售后处理</button>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="is_bottom" v-if="is_bottom">
|
|
<view class="is_bottom" v-if="is_bottom">
|
|
@@ -94,6 +87,31 @@
|
|
<button type="primary" @click="onSubmit" size="mini">确定</button>
|
|
<button type="primary" @click="onSubmit" size="mini">确定</button>
|
|
<button type="primary" @click="dialogClose" size="mini">取消</button>
|
|
<button type="primary" @click="dialogClose" size="mini">取消</button>
|
|
</view>
|
|
</view>
|
|
|
|
+ </view><view class="dialog_1" v-else-if="dialog.type=='2'">
|
|
|
|
+ <uni-forms ref="form" :modelValue="afterInfo" :rules="rules" label-width="auto">
|
|
|
|
+ <uni-forms-item label="售后类型" name="zhType">
|
|
|
|
+ <uni-easyinput disabled type="text" v-model="afterInfo.zhType" placeholder="请输入售后类型" />
|
|
|
|
+ </uni-forms-item>
|
|
|
|
+ <uni-forms-item label="售后状态" name="zhStatus">
|
|
|
|
+ <uni-easyinput disabled type="text" v-model="afterInfo.zhStatus" placeholder="请输入售后状态" />
|
|
|
|
+ </uni-forms-item>
|
|
|
|
+ <uni-forms-item label="申请理由" name="zhReason">
|
|
|
|
+ <uni-easyinput disabled type="text" v-model="afterInfo.zhReason" placeholder="请输入申请理由" />
|
|
|
|
+ </uni-forms-item>
|
|
|
|
+ <uni-forms-item label="退款金额" name="money">
|
|
|
|
+ <uni-easyinput disabled type="text" v-model="afterInfo.money" placeholder="请输入退款金额" />
|
|
|
|
+ </uni-forms-item>
|
|
|
|
+ <uni-forms-item label="售后申请时间" name="apply_time">
|
|
|
|
+ <uni-easyinput disabled type="text" v-model="afterInfo.apply_time" placeholder="请输入售后申请时间" />
|
|
|
|
+ </uni-forms-item>
|
|
|
|
+ <uni-forms-item label="申请售后描述" name="customer_name">
|
|
|
|
+ <uni-easyinput disabled type="text" v-model="afterInfo.customer_name" placeholder="请输入申请售后描述" />
|
|
|
|
+ </uni-forms-item>
|
|
|
|
+ </uni-forms>
|
|
|
|
+ <view class="btn">
|
|
|
|
+ <button type="primary" @click="toAgree(true)" size="mini">同意</button>
|
|
|
|
+ <button type="primary" @click="toAgree(false)" size="mini">不同意</button>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -112,6 +130,7 @@
|
|
id: '',
|
|
id: '',
|
|
searchInfo: {},
|
|
searchInfo: {},
|
|
list: [],
|
|
list: [],
|
|
|
|
+ afterInfo:{},
|
|
total: 0,
|
|
total: 0,
|
|
skip: 0,
|
|
skip: 0,
|
|
limit: 6,
|
|
limit: 6,
|
|
@@ -121,6 +140,12 @@
|
|
scrollTop: 0,
|
|
scrollTop: 0,
|
|
// 字典表
|
|
// 字典表
|
|
statusList: [],
|
|
statusList: [],
|
|
|
|
+ // 售后类型
|
|
|
|
+ typeList:[],
|
|
|
|
+ // 售后状态
|
|
|
|
+ astatusList:[],
|
|
|
|
+ // 理由
|
|
|
|
+ reasonList:[],
|
|
status_name: "",
|
|
status_name: "",
|
|
// 条件弹出框
|
|
// 条件弹出框
|
|
dialog: {
|
|
dialog: {
|
|
@@ -251,6 +276,69 @@
|
|
type: '1'
|
|
type: '1'
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ // 售后处理
|
|
|
|
+ async toHandle(e){
|
|
|
|
+ const that = this;
|
|
|
|
+ let res = await that.$api(`/groupAfterSale`, 'GET', {
|
|
|
|
+ order:e._id,
|
|
|
|
+ customer:e.customer._id
|
|
|
|
+ }, 'group')
|
|
|
|
+ if (res.errcode == '0') {
|
|
|
|
+ for (let val of res.data) {
|
|
|
|
+ let type = that.typeList.find(i => i.value == val.type)
|
|
|
|
+ if (type) val.zhType = type.label;
|
|
|
|
+ let status = that.astatusList.find(i => i.value == val.status)
|
|
|
|
+ if (status) val.zhStatus = status.label;
|
|
|
|
+ let reason = that.reasonList.find(i => i.value == val.reason)
|
|
|
|
+ if (reason) val.zhReason = reason.label;
|
|
|
|
+ }
|
|
|
|
+ that.$set(that, `afterInfo`, res.data[0]);
|
|
|
|
+ }
|
|
|
|
+ that.$set(that, `dialog`, {
|
|
|
|
+ show: true,
|
|
|
|
+ type: '2'
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 售后同意
|
|
|
|
+ async toAgree(e){
|
|
|
|
+ const that = this;
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '确定处理该订单吗?',
|
|
|
|
+ success: async function(res) {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ let arr = await that.$api(`/groupAfterSale/${that.afterInfo._id}`, 'POST', {
|
|
|
|
+ leader_suggest: e
|
|
|
|
+ }, 'group')
|
|
|
|
+ if (arr.errcode == '0') {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '处理完成',
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ that.$set(that, `dialog`, {
|
|
|
|
+ show: false,
|
|
|
|
+ type: '2'
|
|
|
|
+ })
|
|
|
|
+ that.$set(that, `afterInfo`, {})
|
|
|
|
+ that.clearPage();
|
|
|
|
+ that.search();
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: arr.errmsg,
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ that.$set(that, `dialog`, {
|
|
|
|
+ show: false,
|
|
|
|
+ type: '2'
|
|
|
|
+ })
|
|
|
|
+ that.$set(that, `afterInfo`, {})
|
|
|
|
+ that.clearPage();
|
|
|
|
+ that.search();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
// 状态选择
|
|
// 状态选择
|
|
statusChange(e) {
|
|
statusChange(e) {
|
|
const that = this;
|
|
const that = this;
|
|
@@ -288,120 +376,6 @@
|
|
url: `/pagesMy/dough/info?id=${item._id}`
|
|
url: `/pagesMy/dough/info?id=${item._id}`
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 取消订单-未支付||取消订单-已支付
|
|
|
|
- toCancel(e) {
|
|
|
|
- const that = this;
|
|
|
|
- uni.showModal({
|
|
|
|
- title: '提示',
|
|
|
|
- content: '确定取消订单吗?',
|
|
|
|
- success: async function(res) {
|
|
|
|
- if (res.confirm) {
|
|
|
|
- if (e.status == '0') {
|
|
|
|
- const arr = await that.$api(`/orderDeal/cancel`, 'POST', {
|
|
|
|
- order_id: e._id
|
|
|
|
- }, 'group');
|
|
|
|
- if (arr.errcode == '0') {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: '申请取消订单完成',
|
|
|
|
- icon: 'none'
|
|
|
|
- })
|
|
|
|
- that.clearPage();
|
|
|
|
- that.search();
|
|
|
|
- } else {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: arr.errmsg,
|
|
|
|
- icon: 'none'
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- if (e.is_afterSale != true) {
|
|
|
|
- let arr = await that.$api(`/groupAfterSale`, 'POST', {
|
|
|
|
- order: e._id,
|
|
|
|
- type: '4'
|
|
|
|
- }, 'group')
|
|
|
|
- if (arr.errcode == '0') {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: '申请取消订单完成',
|
|
|
|
- icon: 'none'
|
|
|
|
- })
|
|
|
|
- that.clearPage();
|
|
|
|
- that.search();
|
|
|
|
- } else {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: arr.errmsg,
|
|
|
|
- icon: 'none'
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: `该订单有售后处理中`,
|
|
|
|
- icon: 'none'
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- // 支付
|
|
|
|
- async toPay(e) {
|
|
|
|
- const that = this;
|
|
|
|
- let system = that.system;
|
|
|
|
- if (system.uniPlatform == "mp-weixin") {
|
|
|
|
- uni.showLoading({
|
|
|
|
- title: '加载中'
|
|
|
|
- })
|
|
|
|
- // 支付信息
|
|
|
|
- let p2 = await that.$api('/orderDeal/pay', 'POST', {
|
|
|
|
- order_id: e._id,
|
|
|
|
- }, 'group')
|
|
|
|
- if (p2.errcode == '0' && p2.data.paySign) {
|
|
|
|
- uni.requestPayment({
|
|
|
|
- "provider": "wxpay",
|
|
|
|
- ...p2.data,
|
|
|
|
- success: function(res) {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: '支付成功',
|
|
|
|
- icon: 'none'
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- fail: function(err) {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: `支付失败`,
|
|
|
|
- icon: 'none'
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- complete: function() {
|
|
|
|
- uni.hideLoading();
|
|
|
|
- that.clearPage();
|
|
|
|
- that.search()
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: p2.errmsg || '错误信息',
|
|
|
|
- icon: 'none'
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- } else if (res.data.uniPlatform == "app") {
|
|
|
|
- // app支付
|
|
|
|
- uni.requestPayment({
|
|
|
|
- provider: 'alipay',
|
|
|
|
- orderInfo: 'orderInfo',
|
|
|
|
- success: function(res) {
|
|
|
|
- console.log('success:' + JSON.stringify(res));
|
|
|
|
- },
|
|
|
|
- fail: function(err) {
|
|
|
|
- console.log('fail:' + JSON.stringify(err));
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: `平台不支持支付`,
|
|
|
|
- icon: 'none'
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
// 查看物流
|
|
// 查看物流
|
|
toLogi(e) {
|
|
toLogi(e) {
|
|
const that = this;
|
|
const that = this;
|
|
@@ -410,71 +384,6 @@
|
|
url: `/pagesMy/logistics/index?id=${e._id}&type=${'groupOrder'}`
|
|
url: `/pagesMy/logistics/index?id=${e._id}&type=${'groupOrder'}`
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 确认收货
|
|
|
|
- async toConfirm(e) {
|
|
|
|
- const that = this;
|
|
|
|
- uni.showModal({
|
|
|
|
- title: '提示',
|
|
|
|
- content: '确定确认收货吗?',
|
|
|
|
- success: async function(res) {
|
|
|
|
- if (res.confirm) {
|
|
|
|
- const arr = await that.$api(`/groupOrder/${e._id}`, 'POST', {
|
|
|
|
- status: '3'
|
|
|
|
- }, 'group');
|
|
|
|
- if (arr.errcode == '0') {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: '确认收货成功',
|
|
|
|
- icon: 'none'
|
|
|
|
- })
|
|
|
|
- that.clearPage();
|
|
|
|
- that.search();
|
|
|
|
- } else {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: arr.errmsg,
|
|
|
|
- icon: 'none'
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- // 拒收
|
|
|
|
- async toReject(e) {
|
|
|
|
- const that = this;
|
|
|
|
- uni.showModal({
|
|
|
|
- title: '提示',
|
|
|
|
- content: '确定拒收快递吗?',
|
|
|
|
- success: async function(res) {
|
|
|
|
- if (res.confirm) {
|
|
|
|
- let arr = await that.$api(`/groupAfterSale`, 'POST', {
|
|
|
|
- order: e._id,
|
|
|
|
- type: '5'
|
|
|
|
- }, 'group')
|
|
|
|
- if (arr.errcode == '0') {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: '拒收申请完成',
|
|
|
|
- icon: 'none'
|
|
|
|
- })
|
|
|
|
- that.clearPage();
|
|
|
|
- that.search();
|
|
|
|
- } else {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: arr.errmsg,
|
|
|
|
- icon: 'none'
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- // 申请售后
|
|
|
|
- toAfter(e) {
|
|
|
|
- const that = this;
|
|
|
|
- that.clearPage();
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url: `/pagesMy/order/service?id=${e._id}&status=${'-3'}`
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
// 查询其他信息
|
|
// 查询其他信息
|
|
async searchOther() {
|
|
async searchOther() {
|
|
const that = this;
|
|
const that = this;
|
|
@@ -484,6 +393,18 @@
|
|
code: 'order_process'
|
|
code: 'order_process'
|
|
})
|
|
})
|
|
if (res.errcode == '0') that.$set(that, `statusList`, res.data);
|
|
if (res.errcode == '0') that.$set(that, `statusList`, res.data);
|
|
|
|
+ res = await that.$api(`/dictData`, 'GET', {
|
|
|
|
+ code: "afterSale_type"
|
|
|
|
+ });
|
|
|
|
+ if (res.errcode == '0') that.$set(that, `typeList`, res.data)
|
|
|
|
+ res = await that.$api(`/dictData`, 'GET', {
|
|
|
|
+ code: "afterSale_status"
|
|
|
|
+ });
|
|
|
|
+ if (res.errcode == '0') that.$set(that, `astatusList`, res.data)
|
|
|
|
+ res = await that.$api(`/dictData`, 'GET', {
|
|
|
|
+ code: "afterSale_reason"
|
|
|
|
+ });
|
|
|
|
+ if (res.errcode == '0') that.$set(that, `reasonList`, res.data)
|
|
},
|
|
},
|
|
// 清空列表
|
|
// 清空列表
|
|
clearPage() {
|
|
clearPage() {
|