diff --git a/src/views/repair/tickets/Components/TicketTable.vue b/src/views/repair/tickets/Components/TicketTable.vue
index 0453c20..0b98d74 100644
--- a/src/views/repair/tickets/Components/TicketTable.vue
+++ b/src/views/repair/tickets/Components/TicketTable.vue
@@ -366,6 +366,14 @@
取 消
+
+
+
@@ -408,6 +416,7 @@ export default {
data() {
return {
loading: false,
+ showLoading: false, // 添加加载状态
formData: {
id: null,
ticketsStatus: null,
@@ -490,7 +499,16 @@ export default {
methods: {
handleShow(row) {
- this.$refs.ticketsShow.open(row)
+ // 显示加载动画
+ this.showLoading = true;
+ // 调用子组件的open方法
+ this.$refs.ticketsShow.open(row).then(() => {
+ // 加载完成后隐藏加载动画
+ this.showLoading = false;
+ }).catch(() => {
+ // 出错时也隐藏加载动画
+ this.showLoading = false;
+ });
},
async handleVoid(row) {
this.$prompt('作废备注', '提示', {
@@ -736,5 +754,29 @@ export default {
\ No newline at end of file
diff --git a/src/views/repair/tickets/Components/TicketsShow.vue b/src/views/repair/tickets/Components/TicketsShow.vue
index 5853f3d..2fcaff9 100644
--- a/src/views/repair/tickets/Components/TicketsShow.vue
+++ b/src/views/repair/tickets/Components/TicketsShow.vue
@@ -7,373 +7,269 @@
v-dialogDrag
append-to-body
>
-
-
-
-
- 工单信息
-
-
-
-
-
- 订单编号
- {{ info.ticketNo }}
-
-
- 维修类别
-
-
-
- 状态
-
-
-
- 客户名称
- {{ info.userName }}
-
-
- 车牌号
- {{ info.carNo }}
-
-
- 车系
- {{ info.carBrandName }}
-
-
- 手机号
- {{ info.userMobile }}
-
-
- 经办人姓名
- {{ info.handleName }}
-
-
- 经办人电话
- {{ info.handleMobile }}
-
-
- 创建时间
- {{ parseTime(info.createTime, "{y}-{m}-{d}") }}
-
-
- 表显里程
- {{ info.mileageTraveled }}
-
-
- 三包单位
- {{ info.threePackUnits }}
-
-
- 保险名称
- {{ info.insuranceName }}
-
-
- 管理费
- {{ info.managerMoney }}
-
-
- 救援费
- {{ info.rescueMoney }}
-
-
- 三包费
- {{ info.threePackMoney }}
-
-
- 定损费
- {{ info.confirmFaultMoney }}
-
-
- 预计完工
- {{ parseTime(info.outTime, "{y}-{m}-{d}") }}
-
-
- 合计金额
- {{ info.totalPrice }}
-
-
- 最近保养日期
- {{ parseTime(info.maintenanceDate, "{y}-{m}-{d}") }}
-
-
- 最近保养里程
- {{ info.maintenanceMileage }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 服务顾问
- {{ info.adviserName }}
-
-
-
-
-
-
-
-
- 工单状态
-
-
-
- 备注
- {{ info.remark }}
-
-
-
-
-
-
-
-
- 项目信息
-
-
-
-
-
-
-
-
-
-
- 材料信息
-
-
-
-
-
-
-
-
-
-
-
-
- 附加信息
-
-
-
-
-
-
+
+
+
+
+
+ 工单信息
+
+
+
+
+
+ 订单编号
+ {{ info.ticketNo }}
+
+
+ 维修类别
+
+
+
+ 状态
+
+
+
+ 客户名称
+ {{ info.userName }}
+
+
+ 车牌号
+ {{ info.carNo }}
+
+
+ 车系
+ {{ info.carBrandName }}
+
+
+ 手机号
+ {{ info.userMobile }}
+
+
+ 经办人姓名
+ {{ info.handleName }}
+
+
+ 经办人电话
+ {{ info.handleMobile }}
+
+
+ 创建时间
+ {{ parseTime(info.createTime, "{y}-{m}-{d}") }}
+
+
+ 表显里程
+ {{ info.mileageTraveled }}
+
+
+ 三包单位
+ {{ info.threePackUnits }}
+
+
+ 保险名称
+ {{ info.insuranceName }}
+
+
+ 管理费
+ {{ info.managerMoney }}
+
+
+ 救援费
+ {{ info.rescueMoney }}
+
+
+ 三包费
+ {{ info.threePackMoney }}
+
+
+ 定损费
+ {{ info.confirmFaultMoney }}
+
+
+ 预计完工
+ {{ parseTime(info.outTime, "{y}-{m}-{d}") }}
+
+
+ 合计金额
+ {{ info.totalPrice }}
+
+
+ 最近保养日期
+ {{ parseTime(info.maintenanceDate, "{y}-{m}-{d}") }}
+
+
+ 最近保养里程
+ {{ info.maintenanceMileage }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 服务顾问
+ {{ info.adviserName }}
+
+
+
+
+
+
+
+
+ 工单状态
+
+
+
+ 备注
+ {{ info.remark }}
+
+
+
+
+
+
+
+
+ 项目信息
+
+
+
+
+
+
+
+
+
+
+ 材料信息
+
+
+
+
+
+
+
+
+
+
+
+
+ 附加信息
+
+
+
+
+
+
-
-
-
- 合计
-
-
-
-
- 总数量
- {{ totalCount }}
-
-
- 成本
- {{ otherInfo.cost }}
-
-
- 总金额
- {{ totalMoney }}
-
-
-
-
-
-
- 含工时项目毛利率
- {{ otherInfo.profitRate * 100 }}%
-
-
- 不含工时项目的毛利率
- {{ otherInfo.profitRateNo * 100 }}%
-
-
-
-
+
+
+
+ 合计
+
+
+
+
+ 总数量
+ {{ totalCount }}
+
+
+ 成本
+ {{ otherInfo.cost }}
+
+
+ 总金额
+ {{ totalMoney }}
+
+
+
+
+
+
+ 含工时项目毛利率
+ {{ otherInfo.profitRate * 100 }}%
+
+
+ 不含工时项目的毛利率
+ {{ otherInfo.profitRateNo * 100 }}%
+
+
+
+
-
-
-
-
- 工种
-
-
-
-
-
-
+
+
+
+
+ 工种
+
+
+
+
+
+
+
@@ -686,21 +689,33 @@ export default {
totalCount: 0,
totalMoney: 0,
otherInfo: {},
+ loading: false // 添加加载状态
};
},
methods: {
checkPermi,
- async open(row) {
- this.reset();
- const res = await getTicketsById(row.id);
- this.allList = res.data.items;
- this.computed();
- this.projects = this.allList.filter((item) => item.project);
- this.wares = this.allList.filter((item) => item.ware);
- this.others = this.allList.filter((item) => item.other);
- this.info = row;
- this.otherInfo = res.data;
- this.dialogVisible = true;
+ // 添加打开弹窗的方法,支持加载动画
+ open(row) {
+ // 返回 Promise 以便调用者可以正确处理异步操作
+ return new Promise((resolve, reject) => {
+ this.reset();
+ this.loading = true; // 开启加载状态
+ getTicketsById(row.id).then(res => {
+ this.allList = res.data.items;
+ this.computed();
+ this.projects = this.allList.filter((item) => item.project);
+ this.wares = this.allList.filter((item) => item.ware);
+ this.others = this.allList.filter((item) => item.other);
+ this.info = row;
+ this.otherInfo = res.data;
+ this.dialogVisible = true;
+ this.loading = false; // 关闭加载状态
+ resolve();
+ }).catch((error) => {
+ this.loading = false; // 出错时也关闭加载状态
+ reject(error);
+ });
+ });
},
async changeShow() {
try {
@@ -756,4 +771,17 @@ export default {
background-color: #f5f5f5;
font-weight: bold;
}
-
+
+// 添加按钮容器样式,使按钮位于右下角
+.dialog-footer {
+ display: flex;
+ justify-content: flex-end;
+ align-items: center;
+ padding: 20px 0;
+
+ .button-container {
+ display: flex;
+ gap: 10px;
+ }
+}
+
\ No newline at end of file