2025008071805
This commit is contained in:
parent
6320230085
commit
466aae0244
|
|
@ -2242,7 +2242,7 @@ public class AppleOrderController extends BaseController {
|
||||||
dayMap.put("today", dayOrderList.size());
|
dayMap.put("today", dayOrderList.size());
|
||||||
queryOrder.setMakeTimeStart(tomorrowStart);
|
queryOrder.setMakeTimeStart(tomorrowStart);
|
||||||
queryOrder.setMakeTimeEnd(tomorrowStart + 24 * 60 * 60);
|
queryOrder.setMakeTimeEnd(tomorrowStart + 24 * 60 * 60);
|
||||||
List<Order> tomorrowOrderList1 = orderService.selectOrderList(queryOrderday);
|
List<Order> tomorrowOrderList1 = orderService.selectOrderList(queryOrder);
|
||||||
dayMap.put("tomorrow", tomorrowOrderList1.size());
|
dayMap.put("tomorrow", tomorrowOrderList1.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5197,6 +5197,8 @@ public class AppletController extends BaseController {
|
||||||
}
|
}
|
||||||
// 4. 修改订单的师傅id
|
// 4. 修改订单的师傅id
|
||||||
order.setWorkerId(newWorkerId);
|
order.setWorkerId(newWorkerId);
|
||||||
|
order.setStatus(1L);
|
||||||
|
order.setIsAccept(0);
|
||||||
int updateOrder = orderService.updateOrder(order);
|
int updateOrder = orderService.updateOrder(order);
|
||||||
if (updateOrder <= 0) {
|
if (updateOrder <= 0) {
|
||||||
return AjaxResult.error("订单更新失败");
|
return AjaxResult.error("订单更新失败");
|
||||||
|
|
@ -5828,6 +5830,40 @@ public class AppletController extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 师傅设置出发上门
|
||||||
|
* GET /api/worker/start/door/{id}
|
||||||
|
* 逻辑参考OrderController的edit接口中jsonStatus=4的流程
|
||||||
|
*/
|
||||||
|
@GetMapping("/api/cuidan/{id}")
|
||||||
|
public AjaxResult workercuidanDoor(@PathVariable("id") Long id, HttpServletRequest request) throws Exception {
|
||||||
|
// 1. 获取当前登录师傅ID(token在header)
|
||||||
|
String token = request.getHeader("token");
|
||||||
|
Map<String, Object> userValidation = AppletLoginUtil.validateUserToken(token, usersService);
|
||||||
|
if (!(Boolean) userValidation.get("valid")) {
|
||||||
|
return AppletControllerUtil.appletWarning("未登录或token无效");
|
||||||
|
}
|
||||||
|
Users user = (Users) userValidation.get("user");
|
||||||
|
if (user == null) {
|
||||||
|
return AppletControllerUtil.appletWarning("用户信息获取失败");
|
||||||
|
}
|
||||||
|
Long workerId = user.getId();
|
||||||
|
|
||||||
|
// 2. 获取订单
|
||||||
|
Order order = orderService.selectOrderById(id);
|
||||||
|
if (order == null) {
|
||||||
|
return AppletControllerUtil.appletWarning("订单不存在");
|
||||||
|
}
|
||||||
|
Users usersworker = usersService.selectUsersById(order.getWorkerId());
|
||||||
|
if (usersworker != null) {
|
||||||
|
WXsendMsgUtil.sendMsgForWorkerCuiDanInfo(usersworker.getOpenid(), order, "订单催单","用户催师傅快点服务");
|
||||||
|
}
|
||||||
|
return AppletControllerUtil.appletSuccess("催单成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 师傅设置出发上门
|
* 师傅设置出发上门
|
||||||
* GET /api/worker/start/door/{id}
|
* GET /api/worker/start/door/{id}
|
||||||
|
|
|
||||||
|
|
@ -91,23 +91,11 @@ public class CoursorUtil extends BaseController {
|
||||||
* @param request HTTP请求对象
|
* @param request HTTP请求对象
|
||||||
* @return 游标详细信息
|
* @return 游标详细信息
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/api/cursor/order/info/{id}")
|
@GetMapping(value = "/api/cursor/order/test/{id}")
|
||||||
public AjaxResult getOrderCursorInfo(@PathVariable("id") long id, HttpServletRequest request) {
|
public AjaxResult getOrderCursorInfo(@PathVariable("id") long id, HttpServletRequest request) {
|
||||||
try {
|
try {
|
||||||
// 参数验证
|
JSONObject commissionResult = WorkerCommissionUtil.calculateCompleteWorkerCommission(id);
|
||||||
if (id <= 0) {
|
return AppletControllerUtil.appletSuccess(123);
|
||||||
return AppletControllerUtil.appletError("游标ID无效");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询游标信息
|
|
||||||
GoodsOrderCursor cursor = goodsOrderCursorService.selectGoodsOrderCursorById(id);
|
|
||||||
if (cursor == null) {
|
|
||||||
return AppletControllerUtil.appletError("游标信息不存在");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 构建返回数据
|
|
||||||
Map<String, Object> cursorData = buildCursorResponse(cursor);
|
|
||||||
return AppletControllerUtil.appletSuccess(cursorData);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return AppletControllerUtil.appletError("查询游标信息失败:" + e.getMessage());
|
return AppletControllerUtil.appletError("查询游标信息失败:" + e.getMessage());
|
||||||
|
|
|
||||||
|
|
@ -142,6 +142,192 @@ public class OrderController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 师傅完成订单接口
|
||||||
|
* POST /api/worker/finish/service
|
||||||
|
* 参数:{"id":订单id,"image":[图片url数组]}
|
||||||
|
*/
|
||||||
|
@PostMapping("/complete-service")
|
||||||
|
public AjaxResult workerFinishService(@RequestBody Map<String, Object> params, HttpServletRequest request) throws Exception {
|
||||||
|
if (params == null || params.get("orderId") == null) {
|
||||||
|
return AppletControllerUtil.appletError("参数错误");
|
||||||
|
}
|
||||||
|
String orderid;
|
||||||
|
try {
|
||||||
|
orderid = params.get("orderId").toString();
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AppletControllerUtil.appletError("订单ID格式错误");
|
||||||
|
}
|
||||||
|
Order order = orderService.selectOrderByOrderId(orderid);
|
||||||
|
if (order == null) {
|
||||||
|
return AppletControllerUtil.appletError("订单不存在");
|
||||||
|
}
|
||||||
|
String reamk = "";
|
||||||
|
String latitude = "";
|
||||||
|
String longitude = "";
|
||||||
|
String addressName = "";
|
||||||
|
PayBeforeUtil payBeforeUtil = new PayBeforeUtil();
|
||||||
|
String priceDifferenceprice= "0";
|
||||||
|
// int paynum=usersPayBeforService.countByLastOrderIdAndStatus(order.getOrderId());
|
||||||
|
// //如果订单没有支付
|
||||||
|
// if (paynum<=0){
|
||||||
|
// // 1. 修改订单状态
|
||||||
|
// order.setStatus(6L); // 完成
|
||||||
|
// order.setReceiveType(3L); // 完成类型
|
||||||
|
// order.setJsonStatus(9); // 完成
|
||||||
|
// order.setLogJson("{\"type\":8}");
|
||||||
|
// int update = orderService.updateOrder(order);
|
||||||
|
// }
|
||||||
|
// 2. 组装日志内容
|
||||||
|
Map<String, Object> logContent = new LinkedHashMap<>();
|
||||||
|
if (StringUtils.isNotBlank(reamk)) {
|
||||||
|
logContent.put("name","师傅服务完成--"+ reamk);
|
||||||
|
}else{
|
||||||
|
logContent.put("name", "师傅服务完成");
|
||||||
|
}
|
||||||
|
|
||||||
|
logContent.put("image", params.get("image"));
|
||||||
|
String contentStr = com.alibaba.fastjson2.JSONObject.toJSONString(logContent);
|
||||||
|
// 3. 写入订单日志
|
||||||
|
OrderLog log = new OrderLog();
|
||||||
|
log.setOid(order.getId());
|
||||||
|
log.setOrderId(order.getOrderId());
|
||||||
|
log.setLogOrderId(GenerateCustomCode.generCreateOrder("DSB"));
|
||||||
|
log.setTitle("服务完成");
|
||||||
|
log.setLatitude(latitude);
|
||||||
|
log.setLongitude(longitude);
|
||||||
|
log.setAddressName(addressName);
|
||||||
|
log.setType(new java.math.BigDecimal(7));
|
||||||
|
log.setContent(contentStr);
|
||||||
|
log.setWorkerId(order.getWorkerId());
|
||||||
|
log.setCreatedAt(new Date());
|
||||||
|
if (StringUtils.isNotBlank(priceDifferenceprice)) {
|
||||||
|
log.setCjMoney(new BigDecimal(priceDifferenceprice));
|
||||||
|
log.setCjPaid(1L);
|
||||||
|
}
|
||||||
|
orderLogService.insertOrderLog(log);
|
||||||
|
//如果有补差价,就要插入日志中进行处理
|
||||||
|
if (StringUtils.isNotBlank(priceDifferenceprice)) {
|
||||||
|
log.setCjMoney(new BigDecimal(priceDifferenceprice));
|
||||||
|
log.setCjPaid(1L);
|
||||||
|
Users userinfo = usersService.selectUsersById(order.getUid());
|
||||||
|
|
||||||
|
payBeforeUtil.createPayBefore(userinfo, log.getCjMoney(), log.getLogOrderId(), log.getId(),
|
||||||
|
null, 10L, null, null,
|
||||||
|
null, null, null,1L,null,order.getOrderId(), null);
|
||||||
|
}
|
||||||
|
//判断这个订单还有没有未支付的数据,如果有就停留在服务中如果没有就直接去到状态为4的已完成状态
|
||||||
|
int paynum=usersPayBeforService.countByLastOrderIdAndStatus(order.getOrderId());
|
||||||
|
//如果订单没有支付,订单完成,分佣,推送
|
||||||
|
if (paynum<=0){
|
||||||
|
//师傅完成时,确认没有可支付的信息,就可以分佣,让这个订单结束
|
||||||
|
OrderUtil.ISTOPAYSIZE(order.getOrderId());
|
||||||
|
|
||||||
|
order.setStatus(4L); // 完成
|
||||||
|
order.setReceiveType(3L); // 完成类型
|
||||||
|
order.setJsonStatus(9); // 完成
|
||||||
|
order.setLogJson("{\"type\":8}");
|
||||||
|
int update = orderService.updateOrder(order);
|
||||||
|
|
||||||
|
Users wusers = usersService.selectUsersById(order.getWorkerId());
|
||||||
|
WorkerCommissionUtil.processWorkerCommission(order,wusers);
|
||||||
|
Users users = usersService.selectUsersById(order.getUid());
|
||||||
|
ServiceGoods serviceGoods = serviceGoodsService.selectServiceGoodsById(order.getProductId());
|
||||||
|
WXsendMsgUtil.sendWorkerFinishOrder(users.getOpenid(), order, serviceGoods);
|
||||||
|
}else{
|
||||||
|
order.setStatus(6L); // 完成
|
||||||
|
order.setJsonStatus(9); // 完成
|
||||||
|
int update = orderService.updateOrder(order);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return AppletControllerUtil.appletSuccess("服务已完成");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 完成服务接口
|
||||||
|
// */
|
||||||
|
// @PreAuthorize("@ss.hasPermi('system:Order:edit')")
|
||||||
|
// @Log(title = "完成服务", businessType = BusinessType.UPDATE)
|
||||||
|
// @PostMapping("/complete-service")
|
||||||
|
// public AjaxResult completeService(@RequestBody Map<String, Object> params) {
|
||||||
|
// try {
|
||||||
|
// // 参数验证
|
||||||
|
// if (params == null || params.isEmpty()) {
|
||||||
|
// return error("请求参数不能为空");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// String orderId = params.get("orderId") != null ? params.get("orderId").toString() : null;
|
||||||
|
// if (orderId == null || orderId.trim().isEmpty()) {
|
||||||
|
// return error("订单号不能为空");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // 查询订单信息
|
||||||
|
// Order order = orderService.selectOrderByOrderId(orderId);
|
||||||
|
// if (order == null) {
|
||||||
|
// return error("订单不存在");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // 验证订单状态(只有服务中状态的订单才能完成服务)
|
||||||
|
// if (order.getStatus() == null || order.getStatus() != 3L) {
|
||||||
|
// return error("当前订单状态不可完成服务,只有服务中状态的订单才能完成服务");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // 验证是否已分配师傅
|
||||||
|
// if (order.getWorkerId() == null) {
|
||||||
|
// return error("订单未分配师傅,无法完成服务");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // 验证师傅是否已接单
|
||||||
|
// if (order.getIsAccept() == null || order.getIsAccept() != 1) {
|
||||||
|
// return error("师傅未接单,无法完成服务");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // 验证订单进度状态(应该是服务中状态)
|
||||||
|
// if (order.getJsonStatus() == null || order.getJsonStatus() != 7) {
|
||||||
|
// return error("订单进度状态不正确,只有服务中状态的订单才能完成服务");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // TODO: 在这里添加您的具体业务逻辑
|
||||||
|
// // 例如:
|
||||||
|
// // 1. 更新订单状态为已完成
|
||||||
|
// // 2. 记录完成时间
|
||||||
|
// // 3. 计算服务费用
|
||||||
|
// // 4. 生成支付订单
|
||||||
|
// // 5. 发送通知等
|
||||||
|
//
|
||||||
|
// return success("完成服务成功");
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// return error("完成服务失败:" + e.getMessage());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// ... existing code ...
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取服务订单最新的日志状态用来判断页面的操作
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:Order:query')")
|
||||||
|
@GetMapping(value = "/orderlog/{id}")
|
||||||
|
public AjaxResult getorderlogInfo(@PathVariable("id") Long id) {
|
||||||
|
Order order = orderService.selectOrderById(id);
|
||||||
|
if (order != null){
|
||||||
|
order.setOrderLog(new OrderLog());
|
||||||
|
}
|
||||||
|
OrderLog orderLog = orderLogService.selectDataTheFirstNew(id);
|
||||||
|
return success(orderLog.getType());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取服务订单详细信息
|
* 获取服务订单详细信息
|
||||||
*/
|
*/
|
||||||
|
|
@ -215,6 +401,13 @@ public class OrderController extends BaseController {
|
||||||
orderdata.setReamk(order.getReamk());
|
orderdata.setReamk(order.getReamk());
|
||||||
orderdata.setBigtype(1);
|
orderdata.setBigtype(1);
|
||||||
orderdata.setAddressEn(userAddress.getAddressName());
|
orderdata.setAddressEn(userAddress.getAddressName());
|
||||||
|
if (userAddress != null) {
|
||||||
|
try {
|
||||||
|
order.setAdressjson(JSON.toJSONString(userAddress));
|
||||||
|
} catch (Exception e) {
|
||||||
|
order.setAdressjson(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
//添加订单日志记录
|
//添加订单日志记录
|
||||||
int flg= orderService.insertOrder(orderdata);
|
int flg= orderService.insertOrder(orderdata);
|
||||||
if (flg>0){
|
if (flg>0){
|
||||||
|
|
@ -918,134 +1111,134 @@ public class OrderController extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 开始服务接口
|
// * 开始服务接口
|
||||||
*/
|
// */
|
||||||
@PreAuthorize("@ss.hasPermi('system:Order:edit')")
|
// @PreAuthorize("@ss.hasPermi('system:Order:edit')")
|
||||||
@Log(title = "开始服务", businessType = BusinessType.UPDATE)
|
// @Log(title = "开始服务", businessType = BusinessType.UPDATE)
|
||||||
@PostMapping("/start-service")
|
// @PostMapping("/start-service")
|
||||||
public AjaxResult startService(@RequestBody Map<String, Object> params) {
|
// public AjaxResult startService(@RequestBody Map<String, Object> params) {
|
||||||
try {
|
// try {
|
||||||
String orderId = params.get("orderId").toString();
|
// String orderId = params.get("orderId").toString();
|
||||||
String image = params.get("image").toString();
|
// String image = params.get("image").toString();
|
||||||
if (StringUtils.isBlank(image)) {
|
// if (StringUtils.isBlank(image)) {
|
||||||
return error("需上传图片");
|
// return error("需上传图片");
|
||||||
}
|
// }
|
||||||
Order order = orderService.selectOrderByOrderId(orderId);
|
// Order order = orderService.selectOrderByOrderId(orderId);
|
||||||
if (order == null) {
|
// if (order == null) {
|
||||||
return error("订单不存在");
|
// return error("订单不存在");
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
OrderLog newlogdata =new OrderLog();
|
// OrderLog newlogdata =new OrderLog();
|
||||||
newlogdata.setType(new BigDecimal("6.0"));
|
// newlogdata.setType(new BigDecimal("6.0"));
|
||||||
newlogdata.setOid(order.getId());
|
// newlogdata.setOid(order.getId());
|
||||||
//如果没有进行服务的记录就是开启服务
|
// //如果没有进行服务的记录就是开启服务
|
||||||
List<OrderLog> logList = orderLogService.selectOrderLogList(newlogdata);
|
// List<OrderLog> logList = orderLogService.selectOrderLogList(newlogdata);
|
||||||
if (logList.isEmpty()){
|
// if (logList.isEmpty()){
|
||||||
// 2. 组装日志内容为数组格式
|
// // 2. 组装日志内容为数组格式
|
||||||
Map<String, Object> logItem = new LinkedHashMap<>();
|
// Map<String, Object> logItem = new LinkedHashMap<>();
|
||||||
logItem.put("name", "师傅开始服务");
|
// logItem.put("name", "师傅开始服务");
|
||||||
logItem.put("image", params.get("image"));
|
// logItem.put("image", params.get("image"));
|
||||||
logItem.put("type", 1);
|
// logItem.put("type", 1);
|
||||||
List<Object> logArr = new ArrayList<>();
|
// List<Object> logArr = new ArrayList<>();
|
||||||
logArr.add(logItem);
|
// logArr.add(logItem);
|
||||||
String contentStr = com.alibaba.fastjson2.JSONObject.toJSONString(logArr);
|
// String contentStr = com.alibaba.fastjson2.JSONObject.toJSONString(logArr);
|
||||||
// 3. 写入订单日志
|
// // 3. 写入订单日志
|
||||||
OrderLog log = new OrderLog();
|
// OrderLog log = new OrderLog();
|
||||||
log.setOid(order.getId());
|
// log.setOid(order.getId());
|
||||||
log.setOrderId(order.getOrderId());
|
// log.setOrderId(order.getOrderId());
|
||||||
log.setTitle("开始服务");
|
// log.setTitle("开始服务");
|
||||||
log.setType(new BigDecimal(6.0));
|
// log.setType(new BigDecimal(6.0));
|
||||||
log.setContent(contentStr);
|
// log.setContent(contentStr);
|
||||||
log.setWorkerId(order.getWorkerId());
|
// log.setWorkerId(order.getWorkerId());
|
||||||
log.setWorkerLogId(order.getWorkerId());
|
// log.setWorkerLogId(order.getWorkerId());
|
||||||
log.setIsPause(1);
|
// log.setIsPause(1);
|
||||||
log.setCreatedAt(new Date());
|
// log.setCreatedAt(new Date());
|
||||||
orderLogService.insertOrderLog(log);
|
// orderLogService.insertOrderLog(log);
|
||||||
//开始服务
|
// //开始服务
|
||||||
// 1. 修改订单状态
|
// // 1. 修改订单状态
|
||||||
order.setStatus(3L); // 服务中
|
// order.setStatus(3L); // 服务中
|
||||||
order.setJsonStatus(7); // 服务中
|
// order.setJsonStatus(7); // 服务中
|
||||||
order.setLogJson("{\"type\":6}");
|
// order.setLogJson("{\"type\":6}");
|
||||||
order.setIsPause(1); // 服务中
|
// order.setIsPause(1); // 服务中
|
||||||
order.setUpdatedAt(new Date());
|
// order.setUpdatedAt(new Date());
|
||||||
int update = orderService.updateOrder(order);
|
// int update = orderService.updateOrder(order);
|
||||||
return AppletControllerUtil.appletSuccess("服务已开始");
|
// return AppletControllerUtil.appletSuccess("服务已开始");
|
||||||
}else{
|
// }else{
|
||||||
|
//
|
||||||
if (order.getJsonStatus() == 7) {
|
// if (order.getJsonStatus() == 7) {
|
||||||
com.alibaba.fastjson2.JSONObject logItem = new com.alibaba.fastjson2.JSONObject();
|
// com.alibaba.fastjson2.JSONObject logItem = new com.alibaba.fastjson2.JSONObject();
|
||||||
logItem.put("name", "暂停服务");
|
// logItem.put("name", "暂停服务");
|
||||||
logItem.put("image", params.get("image"));
|
// logItem.put("image", params.get("image"));
|
||||||
logItem.put("reson", params.get("reson"));
|
// logItem.put("reson", params.get("reson"));
|
||||||
logItem.put("next_time", params.get("next_time"));
|
// logItem.put("next_time", params.get("next_time"));
|
||||||
logItem.put("time", new Date());
|
// logItem.put("time", new Date());
|
||||||
logItem.put("type", 2);
|
// logItem.put("type", 2);
|
||||||
|
//
|
||||||
|
//
|
||||||
OrderLog newlogdata1 =new OrderLog();
|
// OrderLog newlogdata1 =new OrderLog();
|
||||||
newlogdata1.setOid(order.getId());
|
// newlogdata1.setOid(order.getId());
|
||||||
newlogdata1.setOrderId(order.getOrderId());
|
// newlogdata1.setOrderId(order.getOrderId());
|
||||||
newlogdata1.setTitle("暂停服务");
|
// newlogdata1.setTitle("暂停服务");
|
||||||
newlogdata1.setIsPause(2);
|
// newlogdata1.setIsPause(2);
|
||||||
newlogdata1.setContent(logItem.toJSONString());
|
// newlogdata1.setContent(logItem.toJSONString());
|
||||||
newlogdata1.setType(new BigDecimal(6.0));
|
// newlogdata1.setType(new BigDecimal(6.0));
|
||||||
newlogdata1.setWorkerId(order.getWorkerId());
|
// newlogdata1.setWorkerId(order.getWorkerId());
|
||||||
newlogdata1.setWorkerLogId(order.getWorkerId());
|
// newlogdata1.setWorkerLogId(order.getWorkerId());
|
||||||
|
//
|
||||||
|
//
|
||||||
orderLogService.insertOrderLog(newlogdata1);
|
// orderLogService.insertOrderLog(newlogdata1);
|
||||||
if (order != null) {
|
// if (order != null) {
|
||||||
// 1. 修改订单状态
|
// // 1. 修改订单状态
|
||||||
order.setStatus(3L); // 服务中
|
// order.setStatus(3L); // 服务中
|
||||||
order.setJsonStatus(8); // 服务中
|
// order.setJsonStatus(8); // 服务中
|
||||||
order.setLogJson("{\"type\":6}");
|
// order.setLogJson("{\"type\":6}");
|
||||||
order.setIsPause(2); // 服务中
|
// order.setIsPause(2); // 服务中
|
||||||
order.setUpdatedAt(new Date());
|
// order.setUpdatedAt(new Date());
|
||||||
orderService.updateOrder(order);
|
// orderService.updateOrder(order);
|
||||||
}
|
// }
|
||||||
return AppletControllerUtil.appletSuccess("操作成功");
|
// return AppletControllerUtil.appletSuccess("操作成功");
|
||||||
}
|
// }
|
||||||
if (order.getJsonStatus() == 8) {
|
// if (order.getJsonStatus() == 8) {
|
||||||
com.alibaba.fastjson2.JSONObject logItem = new com.alibaba.fastjson2.JSONObject();
|
// com.alibaba.fastjson2.JSONObject logItem = new com.alibaba.fastjson2.JSONObject();
|
||||||
logItem.put("name", "继续服务");
|
// logItem.put("name", "继续服务");
|
||||||
logItem.put("image", params.get("image"));
|
// logItem.put("image", params.get("image"));
|
||||||
logItem.put("time", new Date());
|
// logItem.put("time", new Date());
|
||||||
logItem.put("type", 1);
|
// logItem.put("type", 1);
|
||||||
|
//
|
||||||
OrderLog newlogdata2 =new OrderLog();
|
// OrderLog newlogdata2 =new OrderLog();
|
||||||
newlogdata2.setOid(order.getId());
|
// newlogdata2.setOid(order.getId());
|
||||||
newlogdata2.setOrderId(order.getOrderId());
|
// newlogdata2.setOrderId(order.getOrderId());
|
||||||
newlogdata2.setTitle("继续服务");
|
// newlogdata2.setTitle("继续服务");
|
||||||
newlogdata2.setIsPause(1);
|
// newlogdata2.setIsPause(1);
|
||||||
newlogdata2.setType(new BigDecimal(6.0));
|
// newlogdata2.setType(new BigDecimal(6.0));
|
||||||
newlogdata2.setWorkerId(order.getWorkerId());
|
// newlogdata2.setWorkerId(order.getWorkerId());
|
||||||
newlogdata2.setWorkerLogId(order.getWorkerId());
|
// newlogdata2.setWorkerLogId(order.getWorkerId());
|
||||||
newlogdata2.setContent(logItem.toJSONString());
|
// newlogdata2.setContent(logItem.toJSONString());
|
||||||
orderLogService.insertOrderLog(newlogdata2);
|
// orderLogService.insertOrderLog(newlogdata2);
|
||||||
if (order != null) {
|
// if (order != null) {
|
||||||
//继续服务
|
// //继续服务
|
||||||
order.setStatus(3L); // 服务中
|
// order.setStatus(3L); // 服务中
|
||||||
order.setJsonStatus(7); // 服务中
|
// order.setJsonStatus(7); // 服务中
|
||||||
order.setLogJson("{\"type\":6}");
|
// order.setLogJson("{\"type\":6}");
|
||||||
order.setIsPause(1); // 服务中
|
// order.setIsPause(1); // 服务中
|
||||||
order.setUpdatedAt(new Date());
|
// order.setUpdatedAt(new Date());
|
||||||
orderService.updateOrder(order);
|
// orderService.updateOrder(order);
|
||||||
}
|
// }
|
||||||
return AppletControllerUtil.appletSuccess("操作成功");
|
// return AppletControllerUtil.appletSuccess("操作成功");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
// 这里调用具体的业务逻辑,您来实现
|
// // 这里调用具体的业务逻辑,您来实现
|
||||||
// 例如:更新订单状态为服务中,记录开始时间等
|
// // 例如:更新订单状态为服务中,记录开始时间等
|
||||||
|
//
|
||||||
return success("开始服务成功");
|
// return success("开始服务成功");
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
return error("开始服务失败:" + e.getMessage());
|
// return error("开始服务失败:" + e.getMessage());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目报价接口
|
* 项目报价接口
|
||||||
|
|
@ -1074,7 +1267,7 @@ public class OrderController extends BaseController {
|
||||||
* 获取基检项目和订单报价信息
|
* 获取基检项目和订单报价信息
|
||||||
* GET /api/worker/basic/project?id=订单id&goodid=服务id
|
* GET /api/worker/basic/project?id=订单id&goodid=服务id
|
||||||
*/
|
*/
|
||||||
@GetMapping("/basic/project/{id}")
|
@GetMapping("/basic-project/{id}")
|
||||||
public AjaxResult getWorkerBasicProject(@PathVariable("id") Long id ) {
|
public AjaxResult getWorkerBasicProject(@PathVariable("id") Long id ) {
|
||||||
|
|
||||||
List<String> basicList = new ArrayList<>();
|
List<String> basicList = new ArrayList<>();
|
||||||
|
|
@ -1212,7 +1405,7 @@ public class OrderController extends BaseController {
|
||||||
* 报价获取服务项目
|
* 报价获取服务项目
|
||||||
*/
|
*/
|
||||||
@ApiOperation("获取取服务项目")
|
@ApiOperation("获取取服务项目")
|
||||||
@GetMapping("/quote/craft/{goodsId}")
|
@GetMapping("/quote-craft/{goodsId}")
|
||||||
public AjaxResult getWorkerQuoteCraft(@PathVariable("goodsId") Long goodsId) {
|
public AjaxResult getWorkerQuoteCraft(@PathVariable("goodsId") Long goodsId) {
|
||||||
// 1. 查询商品基本信息
|
// 1. 查询商品基本信息
|
||||||
ServiceGoods serviceGoods = serviceGoodsService.selectServiceGoodsById(goodsId);
|
ServiceGoods serviceGoods = serviceGoodsService.selectServiceGoodsById(goodsId);
|
||||||
|
|
@ -1268,7 +1461,7 @@ public class OrderController extends BaseController {
|
||||||
* GET /api/worker/quote/material/{goodsId}
|
* GET /api/worker/quote/material/{goodsId}
|
||||||
*/
|
*/
|
||||||
@ApiOperation("获取所需物料")
|
@ApiOperation("获取所需物料")
|
||||||
@GetMapping("/quote/material/{goodsId}")
|
@GetMapping("/quote-material/{goodsId}")
|
||||||
public AjaxResult getWorkerQuoteMaterial(@PathVariable("goodsId") Long goodsId) {
|
public AjaxResult getWorkerQuoteMaterial(@PathVariable("goodsId") Long goodsId) {
|
||||||
// 1. 查询商品基本信息
|
// 1. 查询商品基本信息
|
||||||
ServiceGoods serviceGoods = serviceGoodsService.selectServiceGoodsById(goodsId);
|
ServiceGoods serviceGoods = serviceGoodsService.selectServiceGoodsById(goodsId);
|
||||||
|
|
@ -1337,7 +1530,7 @@ public class OrderController extends BaseController {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ApiOperation(value = "测试")
|
@ApiOperation(value = "测试")
|
||||||
@PostMapping("/worker/estimate")
|
@PostMapping("/worker-estimate")
|
||||||
public AjaxResult workerEstimate(@RequestBody Map<String, Object> params, HttpServletRequest request) throws Exception {
|
public AjaxResult workerEstimate(@RequestBody Map<String, Object> params, HttpServletRequest request) throws Exception {
|
||||||
if (params == null) {
|
if (params == null) {
|
||||||
return AjaxResult.error("参数错误");
|
return AjaxResult.error("参数错误");
|
||||||
|
|
@ -1615,6 +1808,144 @@ public class OrderController extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 师傅开始服务接口
|
||||||
|
* POST /api/worker/do/service
|
||||||
|
* 参数:{"oid":订单id,"image":[图片url数组]}
|
||||||
|
*/
|
||||||
|
@PostMapping("/start-service")
|
||||||
|
public AjaxResult workerDostartserviceService(@RequestBody Map<String, Object> params, HttpServletRequest request) {
|
||||||
|
System.out.println("jsonArray.size():"+params.toString());
|
||||||
|
String orderid = "";
|
||||||
|
if (params.get("orderId") != null) {
|
||||||
|
try {
|
||||||
|
orderid = params.get("orderId").toString();
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AppletControllerUtil.appletError("订单ID格式错误");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Order order = orderService.selectOrderByOrderId(orderid);
|
||||||
|
if (order == null) {
|
||||||
|
return AppletControllerUtil.appletError("订单不存在");
|
||||||
|
}
|
||||||
|
String image = "";
|
||||||
|
if (params.get("image") != null) {
|
||||||
|
try {
|
||||||
|
image = params.get("image").toString();
|
||||||
|
// JSONArray jsonArray = JSON.parseArray(image);
|
||||||
|
// if (jsonArray.size() > 1) {
|
||||||
|
// System.out.println("jsonArray.size():"+jsonArray.size());
|
||||||
|
// System.out.println("jsonArray.size():"+jsonArray.getFirst().toString());
|
||||||
|
// }
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AppletControllerUtil.appletError("图片格式错误");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
OrderLog newlogdata =new OrderLog();
|
||||||
|
newlogdata.setType(new BigDecimal("6.0"));
|
||||||
|
newlogdata.setOid(order.getId());
|
||||||
|
//如果没有进行服务的记录就是开启服务
|
||||||
|
List<OrderLog> logList = orderLogService.selectOrderLogList(newlogdata);
|
||||||
|
if (logList.isEmpty()){
|
||||||
|
// 2. 组装日志内容为数组格式
|
||||||
|
Map<String, Object> logItem = new LinkedHashMap<>();
|
||||||
|
logItem.put("name", "师傅开始服务");
|
||||||
|
logItem.put("image", params.get("image"));
|
||||||
|
logItem.put("type", 1);
|
||||||
|
List<Object> logArr = new ArrayList<>();
|
||||||
|
logArr.add(logItem);
|
||||||
|
String contentStr = com.alibaba.fastjson2.JSONObject.toJSONString(logArr);
|
||||||
|
// 3. 写入订单日志
|
||||||
|
OrderLog log = new OrderLog();
|
||||||
|
log.setOid(order.getId());
|
||||||
|
log.setOrderId(order.getOrderId());
|
||||||
|
log.setTitle("开始服务");
|
||||||
|
log.setType(new BigDecimal(6.0));
|
||||||
|
log.setContent(contentStr);
|
||||||
|
log.setWorkerId(order.getWorkerId());
|
||||||
|
log.setWorkerLogId(order.getWorkerId());
|
||||||
|
log.setIsPause(1);
|
||||||
|
log.setCreatedAt(new Date());
|
||||||
|
orderLogService.insertOrderLog(log);
|
||||||
|
//开始服务
|
||||||
|
// 1. 修改订单状态
|
||||||
|
order.setStatus(3L); // 服务中
|
||||||
|
order.setJsonStatus(7); // 服务中
|
||||||
|
order.setLogJson("{\"type\":6}");
|
||||||
|
order.setIsPause(1); // 服务中
|
||||||
|
order.setUpdatedAt(new Date());
|
||||||
|
int update = orderService.updateOrder(order);
|
||||||
|
return AppletControllerUtil.appletSuccess("服务已开始");
|
||||||
|
}else{
|
||||||
|
|
||||||
|
if (order.getJsonStatus() == 7) {
|
||||||
|
com.alibaba.fastjson2.JSONObject logItem = new com.alibaba.fastjson2.JSONObject();
|
||||||
|
logItem.put("name", "暂停服务");
|
||||||
|
logItem.put("image", params.get("image"));
|
||||||
|
logItem.put("reson", params.get("reson"));
|
||||||
|
logItem.put("next_time", params.get("next_time"));
|
||||||
|
logItem.put("time", new Date());
|
||||||
|
logItem.put("type", 2);
|
||||||
|
|
||||||
|
|
||||||
|
OrderLog newlogdata1 =new OrderLog();
|
||||||
|
newlogdata1.setOid(order.getId());
|
||||||
|
newlogdata1.setOrderId(order.getOrderId());
|
||||||
|
newlogdata1.setTitle("暂停服务");
|
||||||
|
newlogdata1.setIsPause(2);
|
||||||
|
newlogdata1.setContent(logItem.toJSONString());
|
||||||
|
newlogdata1.setType(new BigDecimal(6.0));
|
||||||
|
newlogdata1.setWorkerId(order.getWorkerId());
|
||||||
|
newlogdata1.setWorkerLogId(order.getWorkerId());
|
||||||
|
|
||||||
|
|
||||||
|
orderLogService.insertOrderLog(newlogdata1);
|
||||||
|
if (order != null) {
|
||||||
|
// 1. 修改订单状态
|
||||||
|
order.setStatus(3L); // 服务中
|
||||||
|
order.setJsonStatus(8); // 服务中
|
||||||
|
order.setLogJson("{\"type\":6}");
|
||||||
|
order.setIsPause(2); // 服务中
|
||||||
|
order.setUpdatedAt(new Date());
|
||||||
|
orderService.updateOrder(order);
|
||||||
|
}
|
||||||
|
return AppletControllerUtil.appletSuccess("操作成功");
|
||||||
|
}
|
||||||
|
if (order.getJsonStatus() == 8) {
|
||||||
|
com.alibaba.fastjson2.JSONObject logItem = new com.alibaba.fastjson2.JSONObject();
|
||||||
|
logItem.put("name", "继续服务");
|
||||||
|
logItem.put("image", params.get("image"));
|
||||||
|
logItem.put("time", new Date());
|
||||||
|
logItem.put("type", 1);
|
||||||
|
|
||||||
|
OrderLog newlogdata2 =new OrderLog();
|
||||||
|
newlogdata2.setOid(order.getId());
|
||||||
|
newlogdata2.setOrderId(order.getOrderId());
|
||||||
|
newlogdata2.setTitle("继续服务");
|
||||||
|
newlogdata2.setIsPause(1);
|
||||||
|
newlogdata2.setType(new BigDecimal(6.0));
|
||||||
|
newlogdata2.setWorkerId(order.getWorkerId());
|
||||||
|
newlogdata2.setWorkerLogId(order.getWorkerId());
|
||||||
|
newlogdata2.setContent(logItem.toJSONString());
|
||||||
|
orderLogService.insertOrderLog(newlogdata2);
|
||||||
|
if (order != null) {
|
||||||
|
//继续服务
|
||||||
|
order.setStatus(3L); // 服务中
|
||||||
|
order.setJsonStatus(7); // 服务中
|
||||||
|
order.setLogJson("{\"type\":6}");
|
||||||
|
order.setIsPause(1); // 服务中
|
||||||
|
order.setUpdatedAt(new Date());
|
||||||
|
orderService.updateOrder(order);
|
||||||
|
}
|
||||||
|
return AppletControllerUtil.appletSuccess("操作成功");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return AppletControllerUtil.appletSuccess("操作成功");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -505,13 +505,16 @@ public class PayNotifyController extends BaseController {
|
||||||
UsersPayBefor newpayBefor = usersPayBeforService.selectUsersPayBeforByOrderId(usersPayBefor.getOrderid());
|
UsersPayBefor newpayBefor = usersPayBeforService.selectUsersPayBeforByOrderId(usersPayBefor.getOrderid());
|
||||||
if (newpayBefor!=null){
|
if (newpayBefor!=null){
|
||||||
// 创建订单
|
// 创建订单
|
||||||
usersPayBefor.setStatus(2L);
|
newpayBefor.setStatus(2L);
|
||||||
usersPayBefor.setPaytime(new Date());
|
newpayBefor.setPaytime(new Date());
|
||||||
usersPayBefor.setPaycode(transactionId);
|
newpayBefor.setPaycode(transactionId);
|
||||||
usersPayBeforService.updateUsersPayBefor(newpayBefor);
|
int flgs=usersPayBeforService.updateUsersPayBefor(newpayBefor);
|
||||||
|
if (flgs>0){
|
||||||
|
OrderUtil.prepayCallback(newpayBefor, user);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
OrderUtil.prepayCallback(usersPayBefor, user);
|
}
|
||||||
|
// OrderUtil.prepayCallback(newpayBefor, user);
|
||||||
String errorMsg = balanceResult != null ? (String) balanceResult.get("message") : "余额支付失败";
|
String errorMsg = balanceResult != null ? (String) balanceResult.get("message") : "余额支付失败";
|
||||||
logger.error("组合支付余额部分扣款失败:{}", errorMsg);
|
logger.error("组合支付余额部分扣款失败:{}", errorMsg);
|
||||||
return buildFailResponse("组合支付余额部分扣款失败: " + errorMsg);
|
return buildFailResponse("组合支付余额部分扣款失败: " + errorMsg);
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,13 @@ export function getOrder(id) {
|
||||||
// method: 'get'
|
// method: 'get'
|
||||||
// })
|
// })
|
||||||
// }
|
// }
|
||||||
|
// 删除服务订单
|
||||||
|
export function getOrderlogFrist(id) {
|
||||||
|
return request({
|
||||||
|
url: '/system/Order/orderlog/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 新增服务订单
|
// 新增服务订单
|
||||||
export function addOrder(data) {
|
export function addOrder(data) {
|
||||||
|
|
@ -257,3 +262,36 @@ export function projectQuote(orderId) {
|
||||||
data: { orderId: orderId }
|
data: { orderId: orderId }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取基础项目信息
|
||||||
|
export function Orderbasicproject(orderId) {
|
||||||
|
return request({
|
||||||
|
url: '/system/Order/basic-project/' + orderId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取报价工艺列表
|
||||||
|
export function Orderquotecraft(goodId) {
|
||||||
|
return request({
|
||||||
|
url: '/system/Order/quote-craft/' + goodId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取报价物料列表
|
||||||
|
export function Orderquotematerial(goodId) {
|
||||||
|
return request({
|
||||||
|
url: '/system/Order/quote-material/' + goodId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 工人报价
|
||||||
|
export function Orderworkerestimate(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/Order/worker-estimate',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -568,8 +568,8 @@ export default {
|
||||||
|
|
||||||
// 任务状态修改
|
// 任务状态修改
|
||||||
handlefenleiStatusChange(row) {
|
handlefenleiStatusChange(row) {
|
||||||
let text = row.status === "0" ? "启用" : "停用"
|
let text = row.status === "1" ? "启用" : "停用"
|
||||||
this.$modal.confirm('确认要"' + text + '""' + row.title + '"状态吗?').then(function() {
|
this.$modal.confirm('确认要' + text + '' + row.title + '状态吗?').then(function() {
|
||||||
return changefenleiStatus(row.id, row.status)
|
return changefenleiStatus(row.id, row.status)
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$modal.msgSuccess(text + "成功")
|
this.$modal.msgSuccess(text + "成功")
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -136,9 +136,10 @@
|
||||||
:label="item.title"
|
:label="item.title"
|
||||||
:name="item.id"
|
:name="item.id"
|
||||||
v-for="item in craftlist"
|
v-for="item in craftlist"
|
||||||
|
:key="item.id"
|
||||||
>
|
>
|
||||||
<div class="wullistbox">
|
<div class="wullistbox">
|
||||||
<div v-for="value in item.craft" class="li">
|
<div v-for="value in item.craft" :key="value.id" class="li">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<p>{{ value.title }}</p>
|
<p>{{ value.title }}</p>
|
||||||
<span>{{ value.price }}{{ value.unit }}</span>
|
<span>{{ value.price }}{{ value.unit }}</span>
|
||||||
|
|
@ -174,9 +175,10 @@
|
||||||
:label="item.title"
|
:label="item.title"
|
||||||
:name="item.id"
|
:name="item.id"
|
||||||
v-for="item in materiallist"
|
v-for="item in materiallist"
|
||||||
|
:key="item.id"
|
||||||
>
|
>
|
||||||
<div class="wulist">
|
<div class="wulist">
|
||||||
<div v-for="value in item.material" class="li">
|
<div v-for="value in item.material" :key="value.id" class="li">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<img :src="value.image" />
|
<img :src="value.image" />
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -220,7 +222,7 @@ export default {
|
||||||
name: "ProjectQuoteDialog",
|
name: "ProjectQuoteDialog",
|
||||||
props: {
|
props: {
|
||||||
visible: { type: Boolean, default: false },
|
visible: { type: Boolean, default: false },
|
||||||
orderId: { type: String, default: "" },
|
orderId: { type: [String, Number], default: "" },
|
||||||
workerId: { type: [String, Number], default: "" },
|
workerId: { type: [String, Number], default: "" },
|
||||||
goodId: { type: [String, Number], default: "" },
|
goodId: { type: [String, Number], default: "" },
|
||||||
},
|
},
|
||||||
|
|
@ -341,39 +343,41 @@ export default {
|
||||||
return {
|
return {
|
||||||
name: r,
|
name: r,
|
||||||
select:
|
select:
|
||||||
res.data.quote.basic.findIndex((rr) => rr.name == r) != -1
|
res.data.quote.basic && res.data.quote.basic.findIndex((rr) => rr.name == r) != -1
|
||||||
? true
|
? true
|
||||||
: false,
|
: false,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
// 备注回显
|
// 备注回显
|
||||||
|
if (res.data.quote.reamk) {
|
||||||
this.form.reamk = res.data.quote.reamk;
|
this.form.reamk = res.data.quote.reamk;
|
||||||
|
}
|
||||||
|
|
||||||
// 服务回显
|
// 服务回显
|
||||||
|
if (res.data.quote.craft && Array.isArray(res.data.quote.craft)) {
|
||||||
this.form.craft = res.data.quote.craft.map((r) => {
|
this.form.craft = res.data.quote.craft.map((r) => {
|
||||||
r["title"] = r.name;
|
r["title"] = r.name;
|
||||||
return r;
|
return r;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 物料回显
|
// 物料回显
|
||||||
|
if (res.data.quote.material && Array.isArray(res.data.quote.material)) {
|
||||||
this.form.material = res.data.quote.material.map((r) => {
|
this.form.material = res.data.quote.material.map((r) => {
|
||||||
r["title"] = r.name;
|
r["title"] = r.name;
|
||||||
return r;
|
return r;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 付款类型
|
// 付款类型
|
||||||
if (res.data.quote.deposit.price) {
|
if (res.data.quote.deposit && res.data.quote.deposit.price) {
|
||||||
this.payType = 'stage';
|
this.payType = 'stage';
|
||||||
this.form.price = res.data.quote.deposit.price;
|
this.form.price = res.data.quote.deposit.price;
|
||||||
// 定金存在并且用户已支付不可修改付款方式和定金
|
|
||||||
// if(res.data.payStatusdata.dingjin==2){
|
|
||||||
// isset.value=false;
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 优惠金额
|
// 优惠金额
|
||||||
if (res.data.quote.project.price) {
|
if (res.data.quote.reduction && res.data.quote.reduction.price) {
|
||||||
this.form.reduction = res.data.quote.reduction.price;
|
this.form.reduction = res.data.quote.reduction.price;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -456,8 +460,8 @@ export default {
|
||||||
reduction: this.form.reduction, //优惠券
|
reduction: this.form.reduction, //优惠券
|
||||||
reamk: this.form.reamk,
|
reamk: this.form.reamk,
|
||||||
};
|
};
|
||||||
await Orderworkerestimate(payload)
|
await Orderworkerestimate(payload);
|
||||||
this.$message.success('报价已生成')
|
this.$message.success('报价已生成');
|
||||||
this.$emit("submit", payload);
|
this.$emit("submit", payload);
|
||||||
this.visibleInner = false;
|
this.visibleInner = false;
|
||||||
this.$emit("update:visible", false);
|
this.$emit("update:visible", false);
|
||||||
|
|
|
||||||
|
|
@ -1101,8 +1101,8 @@ export default {
|
||||||
|
|
||||||
// 状态修改
|
// 状态修改
|
||||||
handlefenleiStatusChange(row) {
|
handlefenleiStatusChange(row) {
|
||||||
const text = row.status === "0" ? "启用" : "停用";
|
const text = row.status === "1" ? "启用" : "停用";
|
||||||
this.$modal.confirm('确认要"' + text + '""' + row.title + '"吗?').then(function() {
|
this.$modal.confirm('确认要' + text + '' + row.title + '吗?').then(function() {
|
||||||
return changefenleiStatus(row.id, row.status);
|
return changefenleiStatus(row.id, row.status);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$modal.msgSuccess(text + "成功");
|
this.$modal.msgSuccess(text + "成功");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue