|
@@ -1,55 +1,102 @@
|
|
<template>
|
|
<template>
|
|
<div class="p-appointment">
|
|
<div class="p-appointment">
|
|
<h3 class="ptc-title">Confirm appointment</h3>
|
|
<h3 class="ptc-title">Confirm appointment</h3>
|
|
- <div class="ptc-block wrapper">
|
|
|
|
|
|
+ <div v-for="item of list" :key="item.id" class="ptc-block wrapper">
|
|
<div class="inner">
|
|
<div class="inner">
|
|
<div class="block-title">
|
|
<div class="block-title">
|
|
- <span class="text"
|
|
|
|
- >Monday, October 10 9:00-9:30 PTC Browns Plains Kiosk</span
|
|
|
|
- >
|
|
|
|
- <span class="ptc-tag" :class="{ s1: 1, s2: 0, s3: 0 }"
|
|
|
|
- >Under review</span
|
|
|
|
- >
|
|
|
|
|
|
+ <span class="text">{{ item.pickup_time }} {{ item.shop_name }}</span>
|
|
|
|
+ <span class="ptc-tag" :class="`s${item.audit_status}`">{{
|
|
|
|
+ item.audit_status === 0
|
|
|
|
+ ? 'Under review'
|
|
|
|
+ : item.audit_status === 1
|
|
|
|
+ ? 'Approved'
|
|
|
|
+ : 'Canceled'
|
|
|
|
+ }}</span>
|
|
</div>
|
|
</div>
|
|
<div class="cell-group mt48">
|
|
<div class="cell-group mt48">
|
|
<div class="cell">
|
|
<div class="cell">
|
|
<span class="cell-label">Phone Brand:</span>
|
|
<span class="cell-label">Phone Brand:</span>
|
|
- <span class="cell-value">Apple</span>
|
|
|
|
|
|
+ <span class="cell-value">{{ item.phone_brand }}</span>
|
|
</div>
|
|
</div>
|
|
<div class="cell">
|
|
<div class="cell">
|
|
<span class="cell-label">Phone Model:</span>
|
|
<span class="cell-label">Phone Model:</span>
|
|
- <span class="cell-value">iPhone 12</span>
|
|
|
|
|
|
+ <span class="cell-value">{{ item.phone_model }}</span>
|
|
</div>
|
|
</div>
|
|
<div class="cell">
|
|
<div class="cell">
|
|
<span class="cell-label">Phone Number:</span>
|
|
<span class="cell-label">Phone Number:</span>
|
|
- <span class="cell-value">6668888</span>
|
|
|
|
|
|
+ <span class="cell-value">{{ item.phone_number }}</span>
|
|
</div>
|
|
</div>
|
|
<div class="cell">
|
|
<div class="cell">
|
|
<span class="cell-label">IMEI:</span>
|
|
<span class="cell-label">IMEI:</span>
|
|
- <span class="cell-value">iPhonaskfjoaxxx</span>
|
|
|
|
|
|
+ <span class="cell-value">{{ item.phone_imei }}</span>
|
|
</div>
|
|
</div>
|
|
<div class="cell">
|
|
<div class="cell">
|
|
<span class="cell-label">Service:</span>
|
|
<span class="cell-label">Service:</span>
|
|
- <span class="cell-value">Batery Replacement</span>
|
|
|
|
|
|
+ <span class="cell-value">{{ item.fix_name }}</span>
|
|
</div>
|
|
</div>
|
|
<div class="cell">
|
|
<div class="cell">
|
|
<span class="cell-label">Member Price:</span>
|
|
<span class="cell-label">Member Price:</span>
|
|
- <span class="cell-value">$35</span>
|
|
|
|
|
|
+ <span class="cell-value">${{ item.price }}</span>
|
|
</div>
|
|
</div>
|
|
<div class="cell mt48">
|
|
<div class="cell mt48">
|
|
<span class="cell-label">Postcript:</span>
|
|
<span class="cell-label">Postcript:</span>
|
|
- <span class="cell-value"
|
|
|
|
- >This is my remark,This is my remarkThis is my remark</span
|
|
|
|
- >
|
|
|
|
|
|
+ <span class="cell-value">{{ item.remark }}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="button-group">
|
|
<div class="button-group">
|
|
- <button class="ptc-button">Reschedule</button>
|
|
|
|
- <button class="ptc-button ptc-button--stroke">Cancel</button>
|
|
|
|
|
|
+ <button
|
|
|
|
+ v-if="item.audit_status === 2"
|
|
|
|
+ class="ptc-button ptc-button--stroke"
|
|
|
|
+ @click="deleteRepair(item)"
|
|
|
|
+ >
|
|
|
|
+ Delete
|
|
|
|
+ </button>
|
|
|
|
+ <template v-else>
|
|
|
|
+ <button
|
|
|
|
+ class="ptc-button"
|
|
|
|
+ @click="$router.push('/appointment?id=' + item.id)"
|
|
|
|
+ >
|
|
|
|
+ Reschedule
|
|
|
|
+ </button>
|
|
|
|
+ <button
|
|
|
|
+ class="ptc-button ptc-button--stroke"
|
|
|
|
+ @click="cancelRepair(item)"
|
|
|
|
+ >
|
|
|
|
+ Cancel
|
|
|
|
+ </button>
|
|
|
|
+ </template>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
+<script>
|
|
|
|
+import { defineComponent } from 'vue'
|
|
|
|
+import * as api from '@/service/repair'
|
|
|
|
+
|
|
|
|
+export default defineComponent({
|
|
|
|
+ async beforeRouteEnter(to, from, next) {
|
|
|
|
+ const { results } = await api.getRepairList()
|
|
|
|
+ next(vm => (vm.list = results))
|
|
|
|
+ },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ /** @type {any[]} */
|
|
|
|
+ list: [],
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ async cancelRepair(item) {
|
|
|
|
+ await api.cancelRepair(item.id)
|
|
|
|
+ item.audit_status = 2
|
|
|
|
+ },
|
|
|
|
+ async deleteRepair(item) {
|
|
|
|
+ await api.deleteRepair(item.id)
|
|
|
|
+ this.list.splice(this.list.indexOf(item), 1)
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+})
|
|
|
|
+</script>
|
|
|
|
+
|
|
<style lang="scss" src="./index.scss"></style>
|
|
<style lang="scss" src="./index.scss"></style>
|