Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
S
shop-new
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
王天霸
shop-new
Commits
37efc899
提交
37efc899
authored
9月 10, 2021
作者:
huaxinzhu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
售后 接口
上级
04922129
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
340 行增加
和
25 行删除
+340
-25
retreat.js
src/api/module/retreat.js
+26
-0
index.vue
src/views/system/order/index.vue
+20
-14
edit.vue
src/views/system/retreat/edit.vue
+294
-11
没有找到文件。
src/api/module/retreat.js
浏览文件 @
37efc899
...
...
@@ -91,3 +91,29 @@ export function getASOrderDetail(query) {
})
}
// 售后 同意类操作
export
function
agreeRefundData
(
data
)
{
return
request
({
url
:
'/system/retreat/refundAgree'
,
method
:
'post'
,
data
:
data
})
}
// 售后 拒绝类 操作
export
function
refuseRefundData
(
data
)
{
return
request
({
url
:
'/system/retreat/refundReject'
,
method
:
'post'
,
data
:
data
})
}
// 退货退款 地址
export
function
getASAdressData
(
query
)
{
return
request
({
url
:
'/local/AfterSalesAddress/list'
,
method
:
'get'
,
params
:
query
})
}
src/views/system/order/index.vue
浏览文件 @
37efc899
...
...
@@ -268,7 +268,7 @@
/** 获取 seller_id*/
this
.
sellerId
=
this
.
$store
.
state
.
user
.
sellerid
;
// 获取 订单 状态对应数量
this
.
getOrderTab
()
//
this.getOrderTab()
// 订单列表 搜索
this
.
getListOrder
()
//
...
...
@@ -360,19 +360,19 @@
},
/** 获取 订单 状态对应数量 */
getOrderTab
()
{
getOrderTabData
().
then
(
res
=>
{
//console.log("获取订单状态和对应订单数量",res);
if
(
res
.
code
===
1
&&
res
.
data
.
length
>
0
)
{
// 1 表示 代发货;2 表示 已发货
for
(
let
i
=
0
;
i
<
res
.
data
.
length
;
i
++
)
{
if
(
res
.
data
[
i
].
Status
===
1
)
{
this
.
total1
=
res
.
data
[
i
].
Count
>
999
?
'999+'
:
res
.
data
[
i
].
Count
;
}
else
if
(
res
.
data
[
i
].
Status
===
2
)
{
this
.
total2
=
res
.
data
[
i
].
Count
>
999
?
'999+'
:
res
.
data
[
i
].
Count
;
}
}
}
});
//
getOrderTabData().then(res => {
//
//console.log("获取订单状态和对应订单数量",res);
//
if (res.code === 1 && res.data.length > 0) {
//
// 1 表示 代发货;2 表示 已发货
//
for (let i = 0; i
<
res
.
data
.
length
;
i
++
)
{
//
if (res.data[i].Status === 1) {
//
this.total1 = res.data[i].Count > 999 ? '999+' : res.data[i].Count;
//
} else if (res.data[i].Status === 2) {
//
this.total2 = res.data[i].Count > 999 ? '999+' : res.data[i].Count;
//
}
//
}
//
}
//
});
},
// 获取订单列表
getListOrder
()
{
...
...
@@ -402,6 +402,12 @@
this
.
total
=
res
.
data
.
count
||
0
this
.
tableDataList
=
res
.
data
.
data
if
(
this
.
goodsStatus
==
1
)
{
this
.
taotal1
=
res
.
data
.
count
;
}
else
if
(
this
.
goodsStatus
==
2
)
{
this
.
taotal2
=
res
.
data
.
count
;
}
}
})
},
...
...
src/views/system/retreat/edit.vue
浏览文件 @
37efc899
...
...
@@ -129,20 +129,77 @@
</div>
<!-- 售后 操作按钮 -->
<div
class=
"as-handle-btn"
v-if=
"asOrderType == 1"
>
<el-button
class=
"as-btn"
type=
"primary"
>
同意退款
</el-button>
<el-button
class=
"as-btn"
type=
"primary"
>
拒绝退款
</el-button>
<div
class=
"as-handle-btn"
v-if=
"onlyOrRefundBtnType == 1"
>
<el-button
class=
"as-btn"
type=
"primary"
@
click=
"agreeHandle(1)"
>
同意退款
</el-button>
<el-button
class=
"as-btn"
type=
"primary"
@
click=
"refuseHandle(2)"
>
拒绝退款
</el-button>
</div>
<div
class=
"as-handle-btn"
v-if=
"onlyOrRefundBtnType == 2"
>
<el-button
class=
"as-btn"
type=
"primary"
@
click=
"agreeHandle(3)"
>
同意退货退款
</el-button>
<el-button
class=
"as-btn"
type=
"primary"
@
click=
"refuseHandle(4)"
>
拒绝退货退款
</el-button>
</div>
<div
class=
"as-handle-btn"
v-if=
"onlyOrRefundBtnType == 3"
>
<el-button
class=
"as-btn"
type=
"primary"
@
click=
"refuseHandle(4)"
>
拒收包裹
</el-button>
<el-button
class=
"as-btn"
type=
"primary"
@
click=
"agreeHandle(1)"
>
确定退款
</el-button>
</div>
</el-card>
<!-- 仅退款 同意退款 对话框 -->
<!-- [仅退款 同意/拒绝] [退货退款 确定退款/拒收包裹] 对话框 -->
<el-dialog
:title=
"dialogASTypeTitle"
:visible
.
sync=
"isASTypeDialog"
width=
"50%"
center
>
<div
v-if=
"onlyIsAgree == 1"
class=
"only-refund-agree"
>
<p>
同意退款,该订单将关闭,请您仔细核实商品发货状态以及退款金额,若因此导致的损失将由您自己承担!
</p>
<p>
确定同意同款吗?
</p>
<p>
确定同意退款后,将关闭该订单
</p>
</div>
<div
v-if=
"onlyIsAgree == 2"
class=
"only-refund-refuse"
>
<p>
拒绝原因:
</p>
<p
style=
"width:80%"
>
<el-input
type=
"textarea"
v-model=
"onlyRefuseReason"
:rows=
"4"
></el-input>
</p>
</div>
<div
v-if=
"onlyIsAgree == 3"
class=
"refund-agree"
>
<div
class=
"refund-agree-1"
>
<p>
同意退货退款,买家回填退货商品的物流单号,收到货后,请您仔细核实商品,核实无误后,点击【确定退款】按钮进行退款!若因此导致的损失将由您自己承担!
</p>
<p>
确定同意退货退款吗?
</p>
<p>
确定同意退货退款后,等待买家退回商品
</p>
</div>
<div
class=
"refund-agree-2"
>
<p>
选择发送退换货地址:
</p>
<p
style=
"width:80%"
>
<el-select
v-model=
"order_refund_address"
placeholder=
"退货地址"
style=
"width: 80%;"
>
<el-option
v-for=
"(item,index) in asAddressOptions"
:key=
"item.id"
:label=
"item.info"
:value=
"item.id"
></el-option>
</el-select>
</p>
</div>
</div>
<div
v-if=
"onlyIsAgree == 4"
class=
"onlyIsAgree-4"
>
<div
class=
"onlyIsAgree-4-1"
>
<p>
拒绝原因:
</p>
<p
style=
"width:80%"
>
<el-input
type=
"textarea"
v-model=
"refuseReason"
:rows=
"4"
></el-input>
</p>
</div>
<p>
请详细说明您拒绝的原因,拒绝后售后不会结束,买家可再次申请
</p>
</div>
<!-- 仅退款 拒绝退款 对话框 -->
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitAfterSale(onlyIsAgree)"
size=
"small"
>
确 定
</el-button>
<el-button
@
click=
"cancelAfterSale(onlyIsAgree)"
size=
"small"
>
取 消
</el-button>
</span>
</el-dialog>
</div>
</template>
<
script
>
import
{
getASOrderDetail
}
from
'@/api/module/retreat'
import
{
getASOrderDetail
,
agreeRefundData
,
refuseRefundData
,
getASAdressData
}
from
'@/api/module/retreat'
import
{
dateFormat
}
from
'@/utils'
//getASOrderDetail
export
default
{
name
:
"Edit"
,
...
...
@@ -185,14 +242,28 @@
asApplyList
:
[
{
data1
:
1256332213
,
data2
:
1
,
data3
:
3
,
data4
:
4
,
data5
:
5
,
data6
:
6
,
data7
:
7
}
],
// 0-全部隐藏-默认状态; 1-显示 仅退款 按钮;2-显示 退货退款中(同意/拒绝 退货退款)按钮; 3-显示 退货退款中 (拒收包裹 / 确定退款) 按钮
onlyOrRefundBtnType
:
0
,
// 1-仅退款 同意退款; 2-仅退款 拒绝退款; 3-退货退款 同意退款退款; 4-; 5-
onlyIsAgree
:
0
,
dialogASTypeTitle
:
''
,
isASTypeDialog
:
false
,
onlyRefuseReason
:
''
,
refuseReason
:
''
,
sellerId
:
0
,
asAddressOptions
:
[],
order_refund_address
:
''
}
// return end
},
watch
:
{},
created
()
{
this
.
sellerId
=
this
.
$store
.
state
.
user
.
sellerid
;
/** 获取 当前售后 订单的id */
this
.
asGoodId
=
this
.
$route
.
query
.
refund_sn
;
/** 查询 售后订单详情 */
this
.
getDetail
();
/** 获取 退货退款的发送 地址 */
this
.
getASAdress
();
},
mounted
()
{},
methods
:
{
...
...
@@ -305,13 +376,15 @@
// 售后订单详情
if
(
res
.
data
.
order_refund
)
{
this
.
asOrderDetail
=
res
.
data
.
order_refund
;
//-----
测试数据 ---
this
.
asOrderDetail
.
refund_type
=
1
;
//--------
//-----
------- 测试数据
// this.asOrderDetail.refund_type = 2
;
// this.asOrderDetail.status = 2;
// this.asOrderDetail.close_reason = 2;
//--------
------
// 先确定 售后类型
this
.
asOrderType
=
this
.
asOrderDetail
.
refund_type
// 根据售后订单信息,判断 订单状态,显示对应按钮操作
this
.
asHandleBtnType
(
this
.
asOrderDetail
)
// 金额处理
this
.
asOrderDetail
.
apply_price
=
this
.
asOrderDetail
.
apply_price
/
100
this
.
asOrderDetail
.
price
=
this
.
asOrderDetail
.
price
/
100
...
...
@@ -342,6 +415,177 @@
}
});
},
/** 仅退款
* 操作按钮 类型
* onlyOrRefundBtnType:// 1-显示 仅退款 按钮; 2-显示 退货退款中(同意/拒绝 退货退款)按钮; 3-显示 退货退款中 (拒收包裹 / 确定退款) 按钮
* disabledOnlyBtn: true-售后结束-不能点击;false-可以点击
* 每次 订单详情更新,被调用
* */
asHandleBtnType
(
row
)
{
// row.refund_type 1-仅退款 ; 2-退货退款
// row.status 退款状态-1关闭1待审核2待退货3待收货4待打款5已完成
// row.close_reason 售后关闭原因: 1卖家拒绝退款、退货退款 2卖家拒收拒绝退款 3买家超时未退货自动关闭 6买家取消
if
(
row
)
{
if
(
row
.
refund_type
==
1
)
{
this
.
onlyOrRefundBtnType
=
1
}
else
if
(
row
.
refund_type
==
2
)
{
this
.
onlyOrRefundBtnType
=
(
row
.
status
==
1
)
?
2
:
3
}
else
{
this
.
onlyOrRefundBtnType
=
0
;
}
}
},
/** 同意 */
agreeHandle
(
type
)
{
if
(
type
==
1
)
{
this
.
onlyIsAgree
=
type
// 仅退款 同意退款
this
.
dialogASTypeTitle
=
"提示"
;
this
.
isASTypeDialog
=
true
;
}
if
(
type
==
3
)
{
this
.
onlyIsAgree
=
type
// 退货退款 同意退货退款
this
.
dialogASTypeTitle
=
"提示"
;
this
.
isASTypeDialog
=
true
;
}
},
/** 拒绝 */
refuseHandle
(
type
)
{
if
(
type
==
2
)
{
this
.
onlyIsAgree
=
type
// 仅退款的 拒绝退款
this
.
dialogASTypeTitle
=
"拒绝原因"
;
this
.
onlyRefuseReason
=
''
;
this
.
isASTypeDialog
=
true
;
}
if
(
type
==
4
)
{
this
.
onlyIsAgree
=
type
// 4 拒绝退货退款
this
.
dialogASTypeTitle
=
"拒绝原因"
;
this
.
refuseReason
=
''
;
this
.
isASTypeDialog
=
true
;
}
},
/** 提交 退款 处理信息
*
* */
submitAfterSale
(
type
)
{
console
.
log
(
"确定的类型"
,
type
);
let
params
=
{
order_refund_sn
:
0
};
// type为1,则为,仅退款的 同意退款 操作
if
(
this
.
onlyIsAgree
==
1
)
{
params
.
order_refund_sn
=
this
.
asGoodId
// 1、为了更好提示,2、预防后期接口解耦
agreeRefundData
(
params
).
then
(
res
=>
{
let
msg
=
''
if
(
res
.
code
==
1
)
{
this
.
$message
({
type
:
'success'
,
message
:
'操作成功'
});
}
else
{
msg
=
res
.
message
?
res
.
message
:
'操作失败'
this
.
$message
({
type
:
'error'
,
message
:
msg
});
}
this
.
isASTypeDialog
=
false
;
// 更新订单
this
.
getDetail
();
});
}
// type为2,则为,仅退款的 拒绝退款 操作
if
(
this
.
onlyIsAgree
==
2
)
{
if
(
this
.
onlyRefuseReason
==
''
)
{
this
.
$message
({
type
:
'warning'
,
message
:
'请输入拒绝退款的原因'
});
return
}
params
[
'reason'
]
=
this
.
onlyRefuseReason
;
refuseRefundData
(
params
).
then
(
res
=>
{
let
msg
=
''
if
(
res
.
code
==
1
)
{
this
.
$message
({
type
:
'success'
,
message
:
'操作成功'
});
}
else
{
msg
=
res
.
message
?
res
.
message
:
'操作失败'
this
.
$message
({
type
:
'error'
,
message
:
msg
});
}
this
.
isASTypeDialog
=
false
;
// 更新订单
this
.
getDetail
();
});
}
// type 2 end
// type 为3,则为,退货退款的 同意退货退款,发送地址
if
(
this
.
onlyIsAgree
==
3
)
{
// console.log('地址信息:',this.order_refund_address);
if
(
this
.
order_refund_address
==
''
)
{
this
.
$message
({
type
:
'warning'
,
message
:
'请选择地址信息'
});
return
}
params
[
'order_refund_address'
]
=
this
.
order_refund_address
;
agreeRefundData
(
params
).
then
(
res
=>
{
let
msg
=
''
if
(
res
.
code
==
1
)
{
this
.
$message
({
type
:
'success'
,
message
:
'操作成功'
});
}
else
{
msg
=
res
.
message
?
res
.
message
:
'操作失败'
this
.
$message
({
type
:
'error'
,
message
:
msg
});
}
this
.
isASTypeDialog
=
false
;
// 更新订单
this
.
getDetail
();
});
}
// type 3 end
// type 为4,则为 退货退款的 拒绝
if
(
this
.
onlyIsAgree
==
4
)
{
if
(
this
.
refuseReason
==
''
)
{
this
.
$message
({
type
:
'warning'
,
message
:
'请输入拒绝的原因'
});
return
}
params
[
'reason'
]
=
this
.
refuseReason
;
refuseRefundData
(
params
).
then
(
res
=>
{
let
msg
=
''
if
(
res
.
code
==
1
)
{
this
.
$message
({
type
:
'success'
,
message
:
'操作成功'
});
}
else
{
msg
=
res
.
message
?
res
.
message
:
'操作失败'
this
.
$message
({
type
:
'error'
,
message
:
msg
});
}
this
.
isASTypeDialog
=
false
;
// 更新订单
this
.
getDetail
();
});
}
// type 4 end
//
},
/** */
/** 取消 售后对话框 */
cancelAfterSale
(
type
)
{
//console.log("拒绝类型",type);
this
.
isASTypeDialog
=
false
;
},
/** 售后 退货退款 地址 */
getASAdress
()
{
let
params
=
{
page
:
1
,
limit
:
100
,
seller_id
:
this
.
sellerId
}
getASAdressData
(
params
).
then
(
res
=>
{
if
(
res
.
code
==
1
)
{
this
.
asAddressOptions
=
res
.
data
.
list
;
}
else
{
let
msg
=
res
.
message
?
res
.
message
:
'获取售后地址失败'
this
.
$message
({
type
:
'error'
,
message
:
msg
});
}
});
},
/** 订单发货状态 goodsDeliveryStatus Formatter*/
GDSFormatter
(
status
)
{
let
statusText
=
''
...
...
@@ -469,6 +713,45 @@
justify-content
:
center
;
}
.only-refund-agree
{
margin
:
0
50px
;
}
.only-refund-agree
>
p
{
text-align
:
center
;
line-height
:
30px
;
}
.only-refund-refuse
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
flex-direction
:
row
;
}
.refund-agree
.refund-agree-1
>
p
{
text-align
:
center
;
line-height
:
30px
;
}
.refund-agree
>
.refund-agree-2
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
flex-direction
:
row
;
}
.onlyIsAgree-4
>
.onlyIsAgree-4-1
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
flex-direction
:
row
;
}
.onlyIsAgree-4
>
p
{
text-align
:
center
;
line-height
:
30px
;
}
.as-btn
{
margin
:
40px
20px
20px
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论