diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/GoodsOrderController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/GoodsOrderController.java index 5cee1f4..609a5af 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/GoodsOrderController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/GoodsOrderController.java @@ -73,6 +73,7 @@ public class GoodsOrderController extends BaseController startPage(); List list = goodsOrderService.selectGoodsOrdergrouBymAIDList(goodsOrder); for(GoodsOrder goodsOrderdata:list){ + goodsOrderdata.setOrderId(goodsOrderdata.getMainOrderId()); ServiceGoods serviceGoods=serviceGoodsService.selectServiceGoodsById(goodsOrderdata.getProductId()); if(serviceGoods!=null){ @@ -459,29 +460,39 @@ public class GoodsOrderController extends BaseController return error("快递公司不存在"); } - // 更新订单信息 - existingOrder.setDeliveryId(goodsOrder.getDeliveryId()); - existingOrder.setDeliveryNum(goodsOrder.getDeliveryNum()); - existingOrder.setSendTime(goodsOrder.getSendTime()); - existingOrder.setStatus(3L); // 设置为已发货状态 - if (goodsOrder.getMark() != null && !goodsOrder.getMark().trim().isEmpty()) { - existingOrder.setMark(goodsOrder.getMark()); +// // 更新订单信息 +// existingOrder.setDeliveryId(goodsOrder.getDeliveryId()); +// existingOrder.setDeliveryNum(goodsOrder.getDeliveryNum()); +// existingOrder.setSendTime(goodsOrder.getSendTime()); +// existingOrder.setStatus(3L); // 设置为已发货状态 +// if (goodsOrder.getMark() != null && !goodsOrder.getMark().trim().isEmpty()) { +// existingOrder.setMark(goodsOrder.getMark()); +// } + GoodsOrder updatedOrder = new GoodsOrder(); + updatedOrder.setMainOrderId(existingOrder.getMainOrderId()); + List goodsOrderList = goodsOrderService.selectGoodsOrderList(updatedOrder); + int count = 0; + for (GoodsOrder goodsOrderdata : goodsOrderList) { + goodsOrderdata.setDeliveryId(goodsOrder.getDeliveryId()); + goodsOrderdata.setDeliveryNum(goodsOrder.getDeliveryNum()); + goodsOrderdata.setSendTime(goodsOrder.getSendTime()); + goodsOrderdata.setStatus(3L); // 设置为已发货状态 + count+= goodsOrderService.updateGoodsOrder(goodsOrderdata); } - // 更新订单 - int result = goodsOrderService.updateGoodsOrder(existingOrder); + - if (result > 0) { + if (count > 0) { // 添加发货日志 JSONObject logData = new JSONObject(); logData.put("wlgs", siteDelivery.getTitle()); logData.put("wldh", goodsOrder.getDeliveryNum()); OrderUtil.addgoodsorderlog( existingOrder.getId(), - existingOrder.getOrderId(), + existingOrder.getMainOrderId(), "订单已发货", "2", - logData, + logData, 2L ); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController.java index d8716cc..aae4de7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController.java @@ -237,13 +237,32 @@ public class OrderController extends BaseController { @PreAuthorize("@ss.hasPermi('system:Order:query')") @GetMapping("/receive-records/{orderId}") public AjaxResult getReceiveRecords(@PathVariable("orderId") String orderId) { + System.out.println("=== 获取接单记录 ==="); + System.out.println("订单ID: " + orderId); + List list = orderLogService.selectOrderLogByOrderId(orderId); - for (OrderLog orderLogdata : list) { - Users users = usersService.selectUsersById(orderLogdata.getWorkerId()); - if (users != null) { - orderLogdata.setWorkerName(users.getName()); + System.out.println("查询到的日志记录数量: " + (list != null ? list.size() : "null")); + + if (list != null && !list.isEmpty()) { + System.out.println("第一条记录: " + list.get(0)); + for (OrderLog orderLogdata : list) { + System.out.println("处理日志记录: ID=" + orderLogdata.getId() + ", 标题=" + orderLogdata.getTitle()); + if (orderLogdata.getWorkerId() != null) { + Users users = usersService.selectUsersById(orderLogdata.getWorkerId()); + if (users != null) { + orderLogdata.setWorkerName(users.getName()); + System.out.println("设置师傅姓名: " + users.getName()); + } else { + System.out.println("未找到师傅信息,workerId: " + orderLogdata.getWorkerId()); + } + } else { + System.out.println("日志记录没有师傅ID"); + } } + } else { + System.out.println("没有找到订单日志记录"); } + return success(list); } @@ -407,4 +426,16 @@ public class OrderController extends BaseController { List list = usersService.selectUsersList(users); return getDataTable(list); } + + /** + * 获取所有工人列表(用于订单处理) + */ + @PreAuthorize("@ss.hasPermi('system:Order:edit')") + @GetMapping("/getWorkerList") + public AjaxResult getWorkerList() { + Users users = new Users(); + users.setType("2"); // 工人类型 + List list = usersService.selectUsersList(users); + return AjaxResult.success(list); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/CartOrderUtil.java b/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/CartOrderUtil.java index deee3a8..0f55033 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/CartOrderUtil.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/CartOrderUtil.java @@ -105,6 +105,7 @@ public class CartOrderUtil { order.setDeduction(BigDecimal.ZERO); order.setBigtype(serviceGoods.getServicetype()); order.setReceiveType(Long.valueOf(dispatchtype)); // 自由抢单 + int insertResult = orderService.insertOrder(order); if (insertResult <= 0) { result.put("success", false); @@ -210,7 +211,7 @@ public class CartOrderUtil { com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); jsonObject.put("name", "订单创建成功"); //添加记录日志Long oid,String orderId,String title,String type,String content,Long ordertype - OrderUtil.addgoodsorderlog(goodsOrder.getId(),goodsOrder.getOrderId(),"订单生成","1",jsonObject,2L); + OrderUtil.addgoodsorderlog(goodsOrder.getId(),goodsOrder.getMainOrderId(),"订单生成","1",jsonObject,2L); return result; } catch (Exception e) { @@ -274,6 +275,7 @@ public class CartOrderUtil { goodsOrder.setPayPrice(itemPrice); goodsOrder.setStatus(1L); // 待支付 goodsOrder.setMainOrderId(maincorid); + //goodsOrder.setIsmany(1L); int insertResult = goodsOrderService.insertGoodsOrder(goodsOrder); if (insertResult <= 0) { result.put("success", false); @@ -284,11 +286,11 @@ public class CartOrderUtil { result.put("orderId", goodsOrder.getOrderId()); result.put("productName", serviceGoods.getTitle()); result.put("allprice", itemPrice.toString()); - PayBeforeUtil payBeforeUtil = new PayBeforeUtil(); + // PayBeforeUtil payBeforeUtil = new PayBeforeUtil(); com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); jsonObject.put("name", "订单创建成功"); - OrderUtil.addgoodsorderlog(goodsOrder.getId(),goodsOrder.getOrderId(),"订单生成","1",jsonObject,2L); - String payBeforeId = payBeforeUtil.createPayBefore(user, itemPrice, goodsOrder.getOrderId(), null, goodsOrder.getProductId(), 11L, goodsOrder.getSku(), null, null, null, null,2L, null, null); + //OrderUtil.addgoodsorderlog(goodsOrder.getId(),goodsOrder.getOrderId(),"订单生成","1",jsonObject,2L); + //String payBeforeId = payBeforeUtil.createPayBefore(user, itemPrice, goodsOrder.getOrderId(), null, goodsOrder.getProductId(), 11L, goodsOrder.getSku(), null, null, null, null,2L, null, null); return result; } catch (Exception e) { logger.error("商品类购物车下单异常:", e); @@ -297,4 +299,82 @@ public class CartOrderUtil { return result; } } +// /** +// * 商品类购物车下单 +// * @param user 用户 +// * @param cart 购物车 +// * @param serviceGoods 商品 +// * @param userAddress 地址 +// * @param goodsOrderService 商品订单service +// * @return 下单结果Map +// */ +// public static Map createGoodsOrderFromCartMain(Users user, GoodsCart cart, ServiceGoods serviceGoods, UserAddress userAddress, IGoodsOrderService goodsOrderService,String maincorid,Long isself) { +// Map result = new HashMap<>(); +// try { +// BigDecimal itemPrice=BigDecimal.ZERO; +// String skuStr = cart.getSku(); +// if (skuStr != null && !skuStr.trim().isEmpty()) { +// try { +// JSONObject skuJson = JSONObject.parseObject(skuStr); +// if (skuJson.containsKey("price")) { +// BigDecimal skuPrice = new BigDecimal(skuJson.getString("price")); +// itemPrice = skuPrice.multiply(BigDecimal.valueOf(cart.getGoodNum())); +// } else { +// // 没有price字段,回退用商品price +// itemPrice = serviceGoods.getPrice().multiply(BigDecimal.valueOf(cart.getGoodNum())); +// } +// } catch (Exception e) { +// // 解析失败,回退用商品price +// itemPrice = serviceGoods.getPrice().multiply(BigDecimal.valueOf(cart.getGoodNum())); +// } +// } else { +// // sku为空,直接用商品price +// itemPrice = serviceGoods.getPrice().multiply(BigDecimal.valueOf(cart.getGoodNum())); +// } +// GoodsOrder goodsOrder = new GoodsOrder(); +// goodsOrder.setType(2); +// goodsOrder.setOrderId(GenerateCustomCode.generCreateOrder("B")); +// goodsOrder.setUid(user.getId()); +// goodsOrder.setUname(user.getName()); +// goodsOrder.setProductId(serviceGoods.getId()); +// goodsOrder.setProductName(serviceGoods.getTitle()); +// goodsOrder.setNum(cart.getGoodNum()); +// goodsOrder.setSku(cart.getSku()); +// goodsOrder.setIsforservice(serviceGoods.getIsforservice()); +// goodsOrder.setForserviceid(serviceGoods.getForserviceid()); +// goodsOrder.setMark(cart.getReamk()); +// goodsOrder.setIsself(isself); +// goodsOrder.setAddressId(userAddress.getId()); +// goodsOrder.setName(userAddress.getName()); +// goodsOrder.setPhone(userAddress.getPhone()); +// goodsOrder.setAddress(userAddress.getAddressInfo()); +// goodsOrder.setTotalPrice(itemPrice); +// goodsOrder.setGoodPrice(serviceGoods.getPrice()); +// goodsOrder.setPayPrice(itemPrice); +// goodsOrder.setStatus(1L); // 待支付 +// goodsOrder.setMainOrderId(maincorid); +// goodsOrder.setIsmany(1L); +// int insertResult = goodsOrderService.insertGoodsOrder(goodsOrder); +// if (insertResult <= 0) { +// result.put("success", false); +// result.put("msg", "商品订单创建失败"); +// return result; +// } +// result.put("success", true); +// result.put("orderId", goodsOrder.getOrderId()); +// result.put("productName", serviceGoods.getTitle()); +// result.put("allprice", itemPrice.toString()); +// PayBeforeUtil payBeforeUtil = new PayBeforeUtil(); +// com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); +// jsonObject.put("name", "订单创建成功"); +// OrderUtil.addgoodsorderlog(goodsOrder.getId(),goodsOrder.getOrderId(),"订单生成","1",jsonObject,2L); +// String payBeforeId = payBeforeUtil.createPayBefore(user, itemPrice, goodsOrder.getOrderId(), null, goodsOrder.getProductId(), 11L, goodsOrder.getSku(), null, null, null, null,2L, null, null); +// return result; +// } catch (Exception e) { +// logger.error("商品类购物车下单异常:", e); +// result.put("success", false); +// result.put("msg", "商品类购物车下单异常:" + e.getMessage()); +// return result; +// } +// } } \ No newline at end of file diff --git a/ruoyi-ui/src/views/system/Order/index.vue b/ruoyi-ui/src/views/system/Order/index.vue index 2286dc4..8854a4e 100644 --- a/ruoyi-ui/src/views/system/Order/index.vue +++ b/ruoyi-ui/src/views/system/Order/index.vue @@ -171,6 +171,17 @@ v-hasPermi="['system:Order:remove']" >删除 + + 订单处理 + @@ -327,6 +338,15 @@ @click="handleUpdate(scope.row)" v-hasPermi="['system:Order:edit']" > + + + + + + + + +
+ 订单基本信息 +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ 接单记录流程 +
+
+
+
+ + 刷新接单记录 + + + 测试数据 + + + 测试API + +
+
+ 共 {{ orderProcessForm.receiveRecords.length }} 条记录 + 订单号: {{ orderProcessForm.orderId }} +
+
+ + + +
+ {{ record.workerName || '系统' }} + + {{ record.title || '未知状态' }} + +
+
+

{{ record.content }}

+
+ + ¥{{ record.price }} + + + 定金: ¥{{ record.deposit }} + +
+
+
+
+ + + +
+ + +
+

调试信息:

+

订单ID: {{ orderProcessForm.orderId }}

+

接单记录数组: {{ JSON.stringify(orderProcessForm.receiveRecords) }}

+

数组长度: {{ orderProcessForm.receiveRecords.length }}

+

数组类型: {{ Array.isArray(orderProcessForm.receiveRecords) ? 'Array' : typeof orderProcessForm.receiveRecords }}

+
+
+
+
+ + + + +
+ 师傅信息 +
+ + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ 服务时间 +
+ + + + + + + + + + + + + + + + + +
+
+ + + + +
+ 暂停信息 +
+ + + + + + + + + + + + +
+
+ + + + +
+ 取消/结束信息 +
+ + + + + + + + + + + + +
+
+ + + + +
+ 备注信息 +
+ + + + + + + +
+
+
+
+ +
+ { + if (response.data.code === 200) { + this.workerList = response.data.data.map(worker => ({ + id: worker.id, + name: worker.name, + phone: worker.phone, + status: worker.isWork === 1 ? '可用' : '不可用' + })) + } + }).catch(error => { + console.error('获取工人列表失败:', error) + // 使用模拟数据作为备选 + this.workerList = [ + { id: 1, name: '张师傅', phone: '13800138001', status: '可用' }, + { id: 2, name: '李师傅', phone: '13800138002', status: '可用' }, + { id: 3, name: '王师傅', phone: '13800138003', status: '可用' } + ] + }) + }, + + /** 加载接单记录 */ + loadReceiveRecords(orderId) { + console.log('开始加载接单记录,订单号:', orderId) + console.log('当前订单处理表单:', this.orderProcessForm) + + // 检查订单号是否有效 + if (!orderId) { + console.error('订单号为空,无法加载接单记录') + return + } + + this.$http.get(`/system/Order/receive-records/${orderId}`).then(response => { + console.log('接单记录API响应:', response) + console.log('响应状态码:', response.status) + console.log('响应数据:', response.data) + + if (response.data.code === 200) { + this.orderProcessForm.receiveRecords = response.data.data || [] + console.log('接单记录数据:', this.orderProcessForm.receiveRecords) + console.log('接单记录数量:', this.orderProcessForm.receiveRecords.length) + console.log('接单记录类型:', typeof this.orderProcessForm.receiveRecords) + + // 检查数组是否为空 + if (this.orderProcessForm.receiveRecords.length === 0) { + console.warn('接单记录数组为空') + } else { + console.log('第一条记录:', this.orderProcessForm.receiveRecords[0]) + console.log('记录字段:', Object.keys(this.orderProcessForm.receiveRecords[0])) + } + } else { + console.error('接单记录API返回错误:', response.data) + this.orderProcessForm.receiveRecords = [] + } + }).catch(error => { + console.error('获取接单记录失败:', error) + console.error('错误详情:', error.response || error.message) + this.orderProcessForm.receiveRecords = [] + }) + }, + + /** 格式化预约时间 */ + formatAppointmentTime(makeTime, makeHour) { + if (!makeTime) return '未设置' + const date = new Date(makeTime * 1000) + const dateStr = date.toLocaleDateString() + return `${dateStr} ${makeHour || ''}` + }, + + /** 格式化创建时间 */ + formatCreatedTime(createdAt) { + if (!createdAt) return '未设置' + const date = new Date(createdAt) + return date.toLocaleString() + }, + + /** 格式化时间轴时间 */ + formatTimelineTime(createdAt) { + if (!createdAt) return '未知时间' + const date = new Date(createdAt) + return date.toLocaleString() + }, + + /** 刷新接单记录 */ + refreshReceiveRecords() { + if (this.orderProcessForm.orderId) { + this.loadReceiveRecords(this.orderProcessForm.orderId) + } + }, + + /** 测试接单记录数据 */ + testReceiveRecords() { + console.log('=== 测试接单记录数据 ===') + console.log('当前订单ID:', this.orderProcessForm.orderId) + console.log('当前接单记录数组:', this.orderProcessForm.receiveRecords) + console.log('数组长度:', this.orderProcessForm.receiveRecords.length) + console.log('数组类型:', Array.isArray(this.orderProcessForm.receiveRecords)) + + if (this.orderProcessForm.receiveRecords.length > 0) { + console.log('第一条记录详情:', this.orderProcessForm.receiveRecords[0]) + console.log('记录字段列表:', Object.keys(this.orderProcessForm.receiveRecords[0])) + } + + // 测试手动设置数据 + const testData = [ + { + title: '订单生成', + content: '用户创建报价订单,待报价', + workerName: '系统', + createdAt: new Date().toISOString() + }, + { + title: '支付成功', + content: '报价订单支付成功,待服务', + workerName: '李惠', + createdAt: new Date().toISOString() + } + ] + + console.log('设置测试数据:', testData) + this.orderProcessForm.receiveRecords = testData + }, + + /** 手动测试API调用 */ + async testApiCall() { + console.log('=== 手动测试API调用 ===') + const orderId = this.orderProcessForm.orderId + + if (!orderId) { + console.error('订单ID为空,无法测试') + return + } + + try { + console.log('开始调用API:', `/system/Order/receive-records/${orderId}`) + + const response = await this.$http.get(`/system/Order/receive-records/${orderId}`) + console.log('API响应成功:', response) + console.log('响应状态:', response.status) + console.log('响应数据:', response.data) + + if (response.data.code === 200) { + const records = response.data.data || [] + console.log('接单记录数量:', records.length) + + if (records.length > 0) { + console.log('第一条记录:', records[0]) + console.log('记录字段:', Object.keys(records[0])) + } else { + console.warn('没有找到接单记录,可能的原因:') + console.warn('1. 数据库中该订单没有日志记录') + console.warn('2. 订单号不匹配') + console.warn('3. 数据库查询条件不正确') + } + } else { + console.error('API返回错误:', response.data) + } + } catch (error) { + console.error('API调用失败:', error) + console.error('错误详情:', error.response || error.message) + } + }, + + /** 获取时间轴项目类型 */ + getTimelineItemType(title) { + if (!title) return 'info' + if (title.includes('订单生成') || title.includes('创建')) return 'primary' + if (title.includes('支付成功') || title.includes('接单')) return 'success' + if (title.includes('出发') || title.includes('到达')) return 'warning' + if (title.includes('开始服务')) return 'info' + if (title.includes('服务完成') || title.includes('完成')) return 'danger' + return 'info' + }, + + /** 获取时间轴项目颜色 */ + getTimelineItemColor(title) { + if (!title) return '#909399' + if (title.includes('订单生成') || title.includes('创建')) return '#409EFF' // 蓝色 + if (title.includes('支付成功') || title.includes('接单')) return '#67C23A' // 绿色 + if (title.includes('出发') || title.includes('到达')) return '#E6A23C' // 橙色 + if (title.includes('开始服务')) return '#909399' // 灰色 + if (title.includes('服务完成') || title.includes('完成')) return '#F56C6C' // 红色 + return '#909399' + }, + + /** 获取状态标签类型 */ + getStatusTagType(title) { + if (!title) return 'info' + if (title.includes('订单生成') || title.includes('创建')) return 'primary' + if (title.includes('支付成功') || title.includes('接单')) return 'success' + if (title.includes('出发') || title.includes('到达')) return 'warning' + if (title.includes('开始服务')) return 'info' + if (title.includes('服务完成') || title.includes('完成')) return 'danger' + return 'info' + }, + + /** 订单处理提交 */ + submitOrderProcess() { + this.$refs.orderProcessForm.validate((valid) => { + if (valid) { + // 根据状态变化处理不同的业务逻辑 + const status = this.orderProcessForm.status + const jsonStatus = this.orderProcessForm.jsonStatus + + // 更新订单状态 + const updateData = { + id: this.orderProcessForm.id, + status: status, + jsonStatus: jsonStatus, + workerId: this.orderProcessForm.workerId, + departureTime: this.orderProcessForm.departureTime, + arrivalTime: this.orderProcessForm.arrivalTime, + startTime: this.orderProcessForm.startTime, + pauseTime: this.orderProcessForm.pauseTime, + pauseReason: this.orderProcessForm.pauseReason, + completeTime: this.orderProcessForm.completeTime, + nextServiceTime: this.orderProcessForm.nextServiceTime, + cancelTime: this.orderProcessForm.cancelTime, + cancelReason: this.orderProcessForm.cancelReason, + mark: this.orderProcessForm.mark, + servicePhotos: this.orderProcessForm.servicePhotos + } + + // 调用后端API更新订单 + updateOrder(updateData).then(response => { + this.$modal.msgSuccess("订单处理成功") + this.orderProcessOpen = false + this.getList() + }).catch(error => { + this.$modal.msgError("订单处理失败:" + error.message) + }) + } + }) + }, + + /** 取消订单处理 */ + cancelOrderProcess() { + this.orderProcessOpen = false + this.orderProcessForm = { + id: null, + orderId: null, + status: null, + jsonStatus: null, + workerId: null, + departureTime: null, + arrivalTime: null, + startTime: null, + pauseTime: null, + pauseReason: null, + completeTime: null, + nextServiceTime: null, + cancelTime: null, + cancelReason: null, + mark: null, + servicePhotos: [], + // 订单基本信息 + userName: null, + userPhone: null, + productName: null, + num: null, + appointmentTime: null, + appointmentAddress: null, + totalPrice: null, + payPrice: null, + createdAt: null, + // 接单记录 + receiveRecords: [], + orderLog: { + workerId: null, + workerName: null, + price: 0, + deposit: 0, + content: "", + remark: null + } + } + }, + + /** 处理订单状态变化 */ + handleStatusChange(status) { + const now = new Date() + + switch (status) { + case 2: // 待服务 + if (!this.orderProcessForm.workerId) { + this.$message.warning('请先选择师傅') + this.orderProcessForm.status = this.orderProcessForm.status + return + } + break + case 3: // 服务中 + this.orderProcessForm.startTime = now + break + case 4: // 已结束 + this.orderProcessForm.completeTime = now + break + case 5: // 已取消 + this.orderProcessForm.cancelTime = now + if (!this.orderProcessForm.cancelReason) { + this.$message.warning('请填写取消原因') + this.orderProcessForm.status = this.orderProcessForm.status + return + } + break + case 6: // 师傅完成服务 + this.orderProcessForm.completeTime = now + break + case 7: // 未服务提前结束订单 + this.orderProcessForm.completeTime = now + if (!this.orderProcessForm.cancelReason) { + this.$message.warning('请填写结束原因') + this.orderProcessForm.status = this.orderProcessForm.status + return + } + break + } + }, + + /** 处理服务进度变化 */ + handleJsonStatusChange(jsonStatus) { + const now = new Date() + + switch (jsonStatus) { + case 8: // 服务暂停 + this.orderProcessForm.pauseTime = now + if (!this.orderProcessForm.pauseReason) { + this.$message.warning('请填写暂停原因') + this.orderProcessForm.jsonStatus = this.orderProcessForm.jsonStatus + return + } + break + case 9: // 服务恢复 + this.orderProcessForm.startTime = now + break + } + }, + /** 搜索按钮操作 */ handleQuery() { // 处理支付时间 @@ -4013,5 +4806,218 @@ export default { } } } + +// 订单处理对话框样式 +.order-process-dialog { + .el-card { + margin-bottom: 20px; + + .el-card__header { + background-color: #f5f7fa; + border-bottom: 1px solid #e4e7ed; + + .clearfix { + display: flex; + align-items: center; + + span { + font-weight: 600; + color: #303133; + font-size: 16px; + } + } + } + + .el-card__body { + padding: 20px; + } + } + + .el-form-item { + margin-bottom: 18px; + } + + .el-select { + width: 100%; + } + + .el-date-picker { + width: 100%; + } + + .el-textarea { + .el-textarea__inner { + resize: vertical; + } + } + + .dialog-footer { + text-align: center; + padding-top: 20px; + border-top: 1px solid #e4e7ed; + + .el-button { + margin: 0 10px; + min-width: 100px; + } + } +} + +// 状态变化提示样式 +.status-change-tip { + margin-bottom: 15px; + padding: 10px 15px; + background-color: #f0f9ff; + border: 1px solid #b3d8ff; + border-radius: 4px; + color: #409eff; + font-size: 14px; + + .el-icon-info { + margin-right: 8px; + } +} + +// 接单记录流程样式 +.process-timeline { + padding: 20px 0; + + .timeline-header-actions { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 20px; + padding: 0 20px; + + .left-actions { + display: flex; + gap: 10px; + } + + .right-info { + display: flex; + flex-direction: column; + align-items: flex-end; + gap: 5px; + + .record-count { + color: #606266; + font-size: 14px; + font-weight: 500; + } + + .order-id-info { + color: #909399; + font-size: 12px; + } + } + } + + .el-timeline { + padding-left: 20px; + + .el-timeline-item { + .el-timeline-item__node { + width: 16px; + height: 16px; + } + + .el-timeline-item__timestamp { + font-size: 12px; + color: #909399; + margin-bottom: 8px; + } + } + } + + .timeline-card { + margin-bottom: 0; + border: 1px solid #e4e7ed; + border-radius: 6px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); + + .el-card__body { + padding: 16px; + } + + .timeline-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 12px; + + .worker-name { + font-weight: 600; + color: #303133; + font-size: 14px; + } + } + + .timeline-content { + .content-text { + margin: 0 0 8px 0; + color: #606266; + font-size: 14px; + line-height: 1.5; + } + + .remark-text { + margin: 0 0 12px 0; + color: #909399; + font-size: 13px; + font-style: italic; + } + + .timeline-details { + display: flex; + flex-wrap: wrap; + gap: 16px; + + .detail-item { + display: flex; + align-items: center; + color: #606266; + font-size: 13px; + + i { + margin-right: 4px; + color: #909399; + } + } + } + } + } + + .el-empty { + padding: 40px 0; + + .el-empty__description { + color: #909399; + font-size: 14px; + } + } +} + +// 订单基本信息样式优化 +.order-process-dialog { + .el-card { + .el-card__body { + .el-form-item { + .el-form-item__label { + font-weight: 600; + color: #606266; + } + + .el-input.is-disabled { + .el-input__inner { + background-color: #f5f7fa; + color: #606266; + border-color: #e4e7ed; + } + } + } + } + } +}