Commit fd88d779 authored by 刘殿昕's avatar 刘殿昕

订单评价

parent e2cd743f
...@@ -192,6 +192,7 @@ ...@@ -192,6 +192,7 @@
<div v-else-if="cellItem.pay_status == -1">订单已取消</div> <div v-else-if="cellItem.pay_status == -1">订单已取消</div>
<el-popover <el-popover
v-if=" v-if="
cellItem.order_type != 3 &&
cellItem.approval_second_level == 1 && cellItem.approval_second_level == 1 &&
cellItem.pay_status != -1 && cellItem.pay_status != -1 &&
cellItem.is_estimated == 0 cellItem.is_estimated == 0
...@@ -360,7 +361,7 @@ export default { ...@@ -360,7 +361,7 @@ export default {
}, },
methods: { methods: {
addEvaluation() { addEvaluation() {
if (this.textarea == "" && this.serviceRate == null) { if (this.textarea == "" || this.serviceRate == null) {
this.$message({ this.$message({
message: "请先完善评价内容", message: "请先完善评价内容",
type: "error", type: "error",
......
...@@ -80,6 +80,7 @@ ...@@ -80,6 +80,7 @@
<div class="btn_group"> <div class="btn_group">
<el-popover <el-popover
v-if=" v-if="
orderDetail.order_type != 3 &&
orderDetail.is_estimated == 0 && orderDetail.is_estimated == 0 &&
orderDetail.approval_second_level == 1 && orderDetail.approval_second_level == 1 &&
orderDetail.pay_status != -1 orderDetail.pay_status != -1
...@@ -622,8 +623,58 @@ export default { ...@@ -622,8 +623,58 @@ export default {
}, },
methods: { methods: {
addEvaluation() { addEvaluation() {
console.log(this.serviceRate, this.textarea); if (this.textarea == "" || this.serviceRate == null) {
this.visible = false; this.$message({
message: "请先完善评价内容",
type: "error",
});
} else {
if (this.orderDetail.order_type == 1) {
let query = {
service_id: this.orderDetail.service_id,
content: this.textarea,
score: this.serviceRate,
apply_id: this.orderDetail.apply_id,
};
this.$api.user.addServiceEvaluation(query).then((response) => {
if (response.data.success == 1) {
this.$message({
message: "评价订单成功",
type: "success",
});
this.visible = false;
this.getOrderDetail();
} else {
this.$message({
message: "评价订单失败",
type: "error",
});
}
});
} else if (this.orderDetail.order_type == 2) {
let query = {
app: this.orderDetail.app_id,
content: this.textarea,
score: this.serviceRate,
apply_id: this.orderDetail.apply_id,
};
this.$api.user.addServiceEvaluation(query).then((response) => {
if (response.data.success == 1) {
this.$message({
message: "评价订单成功",
type: "success",
});
this.visible = false;
this.getOrderDetail();
} else {
this.$message({
message: "评价订单失败",
type: "error",
});
}
});
}
}
}, },
download() {}, download() {},
getOrderDetail() { getOrderDetail() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment