diff --git a/src/components/order-list/order-list-cell.vue b/src/components/order-list/order-list-cell.vue index fbe8b0f836656e79450f5b82035baa9b3709a33c..e3296c848810208fa49f3ea0f17ac9249c129cd7 100644 --- a/src/components/order-list/order-list-cell.vue +++ b/src/components/order-list/order-list-cell.vue @@ -3,7 +3,11 @@
申请时间:{{ helper.dateStringTransform(cellItem.add_time) }}
订单编号:{{ cellItem.order_id }}
-
删除
+
删除
@@ -23,7 +27,7 @@
{{ cellItem.order_type != 3 ? cellItem.sector : cellItem.namespace }}
+ >{{ cellItem.order_type == 1 ? cellItem.sector : cellItem.order_type == 2 ? cellItem.app_type : cellItem.namespace }}
再次申请
+
取消申请
@@ -153,8 +162,8 @@ export default { default: () => { { } - } - } + }, + }, }, data: () => ({ visible: false, @@ -163,14 +172,14 @@ export default { textarea: "", showMsgBox: false, helper: helper, - message: {} + message: {}, }), methods: { addEvaluation() { if (this.textarea == "" && this.serviceRate == null) { this.$message({ message: "请先完善评价内容", - type: "error" + type: "error", }); } else { if (this.cellItem.order_type == 1) { @@ -178,20 +187,20 @@ export default { service_id: this.cellItem.service_id, content: this.textarea, score: this.serviceRate, - apply_id: this.cellItem.apply_id + apply_id: this.cellItem.apply_id, }; - this.$api.user.addServiceEvaluation(query).then(response => { + this.$api.user.addServiceEvaluation(query).then((response) => { if (response.data.success == 1) { this.$message({ message: "评价订单成功", - type: "success" + type: "success", }); this.visible = false; this.$emit("updateList"); } else { this.$message({ message: "评价订单失败", - type: "error" + type: "error", }); } }); @@ -200,20 +209,20 @@ export default { app: this.cellItem.app_id, content: this.textarea, score: this.serviceRate, - apply_id: this.cellItem.apply_id + apply_id: this.cellItem.apply_id, }; - this.$api.user.addServiceEvaluation(query).then(response => { + this.$api.user.addServiceEvaluation(query).then((response) => { if (response.data.success == 1) { this.$message({ message: "评价订单成功", - type: "success" + type: "success", }); this.visible = false; this.$emit("updateList"); } else { this.$message({ message: "评价订单失败", - type: "error" + type: "error", }); } }); @@ -224,20 +233,22 @@ export default { this.$router.push("/user/order_detail/" + val); }, delOrder() { - this.$api.user.delOrder({ id: this.cellItem.order_id }).then(response => { - if (response.data.success == 1) { - this.$message({ - message: "删除订单成功", - type: "success" - }); - this.$emit("updateList"); - } else { - this.$message({ - message: "删除订单失败", - type: "error" - }); - } - }); + this.$api.user + .delOrder({ id: this.cellItem.order_id }) + .then((response) => { + if (response.data.success == 1) { + this.$message({ + message: "删除订单成功", + type: "success", + }); + this.$emit("updateList"); + } else { + this.$message({ + message: "删除订单失败", + type: "error", + }); + } + }); }, nextApply() { let query = {}; @@ -246,26 +257,26 @@ export default { service_id: parseFloat(this.cellItem.service_id), spec_id: this.cellItem.svc_spec_id, duration: this.cellItem.duration, - duration_unit: this.cellItem.duration_unit + duration_unit: this.cellItem.duration_unit, }; this.$router.push({ path: "/shop/shop_car_apply", - query: query + query: query, }); } else if (this.cellItem.order_type == 2) { query = { app_id: parseFloat(this.cellItem.app_id), spec_id: this.cellItem.spec_app, duration: this.cellItem.duration, - duration_unit: this.cellItem.duration_unit + duration_unit: this.cellItem.duration_unit, }; this.$router.push({ path: "/shop/shop_car_apply", - query: query + query: query, }); } else if (this.cellItem.order_type == 2) { this.$router.push({ - path: "/shop/shop_cloud" + path: "/shop/shop_cloud", }); } }, @@ -273,34 +284,52 @@ export default { if (this.cellItem.order_type == 1) { this.$api.user .getServiceEvaluation({ apply_id: this.cellItem.apply_id }) - .then(response => { + .then((response) => { if (response.data.success == 1) { this.message = response.data.data; this.showMsgBox = true; } else { this.$message({ message: "获取评价失败", - type: "error" + type: "error", }); } }); } else if (this.cellItem.order_type == 2) { this.$api.user .getAppEvaluation({ apply_id: this.cellItem.apply_id }) - .then(response => { + .then((response) => { if (response.data.success == 1) { this.message = response.data.data; this.showMsgBox = true; } else { this.$message({ message: "获取评价失败", - type: "error" + type: "error", }); } }); } - } - } + }, + cancelDetail() { + this.$api.user + .cancelOrder({ order_id: this.cellItem.order_id }) + .then((response) => { + if (response.data.success == 1) { + this.$message({ + message: "取消订单成功", + type: "success", + }); + this.$emit("updateList"); + } else { + this.$message({ + message: "取消订单失败", + type: "error", + }); + } + }); + }, + }, }; diff --git a/src/components/service-list/commodity-card.vue b/src/components/service-list/commodity-card.vue index 4db4fe9b170218bb7e16ce94ccd4f0a9d6f90fa8..dbe922e0e41e174a5fd6596d4ea2c2b52a7e33fb 100644 --- a/src/components/service-list/commodity-card.vue +++ b/src/components/service-list/commodity-card.vue @@ -1,10 +1,7 @@