liuxiaoxu
2 weeks ago
15 changed files with 0 additions and 3268 deletions
@ -1,411 +0,0 @@ |
|||
package com.ruoyi.aftersales.controller; |
|||
|
|||
import java.util.List; |
|||
|
|||
import com.ruoyi.aftersales.domain.vo.SelectMaterialsVO; |
|||
import com.ruoyi.aftersales.domain.vo.SelectShippingDeviceVO; |
|||
import com.ruoyi.warehouse.domain.WarehouseOutOrder; |
|||
import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail; |
|||
import com.ruoyi.warehouse.service.IWarehouseOutOrderDetailService; |
|||
import org.apache.shiro.authz.annotation.RequiresPermissions; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Controller; |
|||
import org.springframework.ui.ModelMap; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import com.ruoyi.common.annotation.Log; |
|||
import com.ruoyi.common.enums.BusinessType; |
|||
import com.ruoyi.aftersales.service.IAftersalesWarehouseOutService; |
|||
import com.ruoyi.common.core.controller.BaseController; |
|||
import com.ruoyi.common.core.domain.AjaxResult; |
|||
import com.ruoyi.common.utils.poi.ExcelUtil; |
|||
import com.ruoyi.common.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 售后维护设备出库Controller |
|||
* |
|||
* @author 刘晓旭 |
|||
* @date 2024-04-23 |
|||
*/ |
|||
@Controller |
|||
@RequestMapping("/aftersales/warehouseOutOrder") |
|||
public class AftersalesWarehouseOutController extends BaseController |
|||
{ |
|||
private String prefix = "aftersales/warehouseOutOrder"; |
|||
|
|||
@Autowired |
|||
private IAftersalesWarehouseOutService warehouseOutOrderService; |
|||
|
|||
@Autowired |
|||
private IWarehouseOutOrderDetailService outOrderDetailService; |
|||
|
|||
|
|||
@RequiresPermissions("aftersales:warehouseOutOrder:view") |
|||
@GetMapping() |
|||
public String warehouseOutOrder() |
|||
{ |
|||
return prefix + "/warehouseOutOrder"; |
|||
} |
|||
|
|||
/** |
|||
* 查询售后维护设备出库列表 |
|||
*/ |
|||
@RequiresPermissions("aftersales:warehouseOutOrder:list") |
|||
@PostMapping("/list") |
|||
@ResponseBody |
|||
public TableDataInfo list(WarehouseOutOrder warehouseOutOrder) |
|||
{ |
|||
startPage(); |
|||
List<WarehouseOutOrder> list = warehouseOutOrderService.selectAftersalesWarehouseOutOrderList(warehouseOutOrder); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 导出售后维护设备出库列表 |
|||
*/ |
|||
@RequiresPermissions("aftersales:warehouseOutOrder:export") |
|||
@Log(title = "售后维护设备出库", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
@ResponseBody |
|||
public AjaxResult export(WarehouseOutOrder warehouseOutOrder) |
|||
{ |
|||
List<WarehouseOutOrder> list = warehouseOutOrderService.selectAftersalesWarehouseOutOrderList(warehouseOutOrder); |
|||
ExcelUtil<WarehouseOutOrder> util = new ExcelUtil<WarehouseOutOrder>(WarehouseOutOrder.class); |
|||
return util.exportExcel(list, "售后维护设备出库数据"); |
|||
} |
|||
|
|||
/** |
|||
* 新增售后维护设备出库 |
|||
*/ |
|||
@GetMapping("/add") |
|||
public String add() |
|||
{ |
|||
return prefix + "/add"; |
|||
} |
|||
|
|||
/** |
|||
* 新增保存售后维护设备出库 |
|||
*/ |
|||
@RequiresPermissions("aftersales:warehouseOutOrder:add") |
|||
@Log(title = "售后维护设备出库", businessType = BusinessType.INSERT) |
|||
@PostMapping("/add") |
|||
@ResponseBody |
|||
public AjaxResult addSave(WarehouseOutOrder warehouseOutOrder) |
|||
{ |
|||
return toAjax(warehouseOutOrderService.insertWarehouseOutOrder(warehouseOutOrder)); |
|||
} |
|||
|
|||
/** |
|||
* 修改售后维护设备出库 |
|||
*/ |
|||
@GetMapping("/edit/{outOrderId}") |
|||
public String edit(@PathVariable("outOrderId") Long outOrderId, ModelMap mmap) |
|||
{ |
|||
WarehouseOutOrder warehouseOutOrder = warehouseOutOrderService.selectWarehouseOutOrderById(outOrderId); |
|||
mmap.put("warehouseOutOrder", warehouseOutOrder); |
|||
return prefix + "/edit"; |
|||
} |
|||
|
|||
/** |
|||
* 修改保存售后维护设备出库 |
|||
*/ |
|||
@RequiresPermissions("aftersales:warehouseOutOrder:edit") |
|||
@Log(title = "售后维护设备出库", businessType = BusinessType.UPDATE) |
|||
@PostMapping("/edit") |
|||
@ResponseBody |
|||
public AjaxResult editSave(WarehouseOutOrder warehouseOutOrder) |
|||
{ |
|||
return toAjax(warehouseOutOrderService.updateWarehouseOutOrder(warehouseOutOrder)); |
|||
} |
|||
|
|||
/** |
|||
* 查看售后维护设备出库详情 |
|||
*/ |
|||
@GetMapping("/detail/{outOrderId}") |
|||
public String detail(@PathVariable("outOrderId") Long outOrderId, ModelMap mmap) |
|||
{ |
|||
WarehouseOutOrder warehouseOutOrder = warehouseOutOrderService.selectWarehouseOutOrderById(outOrderId); |
|||
mmap.put("warehouseOutOrder", warehouseOutOrder); |
|||
return prefix + "/detail"; |
|||
} |
|||
|
|||
/** |
|||
* 修改保存售后维护设备出库详情 |
|||
*/ |
|||
@RequiresPermissions("aftersales:warehouseOutOrder:edit") |
|||
@Log(title = "售后维护设备出库", businessType = BusinessType.UPDATE) |
|||
@PostMapping("/detail") |
|||
@ResponseBody |
|||
public AjaxResult detailSave(WarehouseOutOrder warehouseOutOrder) |
|||
{ |
|||
return toAjax(warehouseOutOrderService.updateWarehouseOutOrder(warehouseOutOrder)); |
|||
} |
|||
|
|||
/** |
|||
* 物料新增出货设备 |
|||
*/ |
|||
@GetMapping("/addShippingDevices/{quoteId}/{materialCode}") |
|||
public String addShippingDevices(@PathVariable("quoteId") String quoteId, |
|||
@PathVariable("materialCode") String materialCode, |
|||
ModelMap mmap) { |
|||
SelectMaterialsVO selectMaterialsVO = warehouseOutOrderService.selectShippingDevicesById(quoteId, materialCode); |
|||
// 假设您还需要根据materialCode获取额外信息,可以在这里添加逻辑
|
|||
mmap.put("selectMaterialsVO", selectMaterialsVO); |
|||
return prefix + "/addShippingDevices"; |
|||
} |
|||
/** |
|||
* 修改保存出货设备 |
|||
*/ |
|||
@RequiresPermissions("aftersales:warehouseOutOrder:addShippingDevices") |
|||
@Log(title = "售后维护设备出库", businessType = BusinessType.INSERT) |
|||
@PostMapping("/addShippingDevices") |
|||
@ResponseBody |
|||
public AjaxResult addShippingDevicesSave(WarehouseOutOrder warehouseOutOrder) |
|||
{ |
|||
return toAjax(warehouseOutOrderService.updateWarehouseOutOrder(warehouseOutOrder)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 查询物料信息列表 |
|||
*/ |
|||
@RequiresPermissions("aftersales:warehouseOutOrder:optionMaterials") |
|||
@PostMapping("/optionMaterials") |
|||
@ResponseBody |
|||
public TableDataInfo optionMaterials(WarehouseOutOrder warehouseOutOrder) |
|||
{ |
|||
|
|||
startPage(); |
|||
List<SelectMaterialsVO> list = warehouseOutOrderService.selectMaterialBySalesOrderCode(warehouseOutOrder); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 添加出货设备查询物料信息 |
|||
*/ |
|||
@PostMapping("/addShippingDevicesMaterial") |
|||
@ResponseBody |
|||
public TableDataInfo optionMaterial(SelectMaterialsVO selectMaterialsVO) |
|||
{ |
|||
|
|||
startPage(); |
|||
List<SelectMaterialsVO> list = warehouseOutOrderService.selectMaterialByMaterialCode(selectMaterialsVO); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 添加出货设备查询出货设备信息 |
|||
*/ |
|||
@PostMapping("/addShippingDevicesOptions") |
|||
@ResponseBody |
|||
public TableDataInfo addShippingDevicesOptions(SelectMaterialsVO selectMaterialsVO) |
|||
{ |
|||
|
|||
startPage(); |
|||
List<SelectShippingDeviceVO> list = warehouseOutOrderService.selectShippingDeviceBySalesOrderCode(selectMaterialsVO); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 删除售后维护设备出库 |
|||
*/ |
|||
@RequiresPermissions("aftersales:warehouseOutOrder:remove") |
|||
@Log(title = "售后维护设备出库", businessType = BusinessType.DELETE) |
|||
@PostMapping( "/remove") |
|||
@ResponseBody |
|||
public AjaxResult remove(String ids) |
|||
{ |
|||
return toAjax(warehouseOutOrderService.deleteWarehouseOutOrderByIds(ids)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 售后第一次维护设备 |
|||
*/ |
|||
@GetMapping("/maintenanceEquipmentOne/{outOrderId}") |
|||
public String maintenanceEquipmentOne(@PathVariable("outOrderId") Long outOrderId, ModelMap mmap) |
|||
{ |
|||
WarehouseOutOrder warehouseOutOrder = warehouseOutOrderService.selectWarehouseOutOrderById(outOrderId); |
|||
mmap.put("warehouseOutOrder", warehouseOutOrder); |
|||
return prefix + "/maintenanceEquipmentOne"; |
|||
} |
|||
|
|||
/** |
|||
* 修改保存售后第一次维护设备 |
|||
*/ |
|||
@RequiresPermissions("aftersales:warehouseOutOrder:maintenanceEquipmentOne") |
|||
@Log(title = "售后维护设备出库", businessType = BusinessType.UPDATE) |
|||
@PostMapping("/maintenanceEquipmentOne") |
|||
@ResponseBody |
|||
public AjaxResult maintenanceEquipmentOneSave(@RequestBody WarehouseOutOrder warehouseOutOrder) |
|||
{ |
|||
return toAjax(warehouseOutOrderService.updateMaintenanceEquipmentOne(warehouseOutOrder)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 展示售后第一次维护设备物料信息 |
|||
* */ |
|||
@PostMapping("/getMaintenanceEquipmentOneMaterials") |
|||
@ResponseBody |
|||
public TableDataInfo getMaintenanceEquipmentOneMaterials(WarehouseOutOrder warehouseOutOrder) |
|||
{ |
|||
|
|||
startPage(); |
|||
List<WarehouseOutOrderDetail> list = warehouseOutOrderService.selectOutOrderDetailListByCode(warehouseOutOrder); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 展示售后第一次维护设备料号已选择添加出货设备的相关出货设备信息 |
|||
*/ |
|||
@PostMapping("/showAftersalesShippingDeviceListOne") |
|||
@ResponseBody |
|||
public TableDataInfo showAftersalesShippingDeviceListOne(@RequestParam("materialNo") String materialNo, |
|||
@RequestParam("salesOrderCode") String salesOrderCode, |
|||
@RequestParam("makeNo") String makeNo) |
|||
{ |
|||
|
|||
startPage(); |
|||
List<SelectShippingDeviceVO> list = warehouseOutOrderService.showAftersalesShippingDeviceList(materialNo,salesOrderCode,makeNo); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
/** |
|||
* 售后第一次维护设备 添加出货设备信息 |
|||
*/ |
|||
@GetMapping("/addShippingDevicesOne") |
|||
public String addShippingDevicesOne(@RequestParam("outOrderDetailId") Long outOrderDetailId, |
|||
@RequestParam("salesOrderCode") String salesOrderCode, |
|||
@RequestParam("makeNo") String makeNo, |
|||
ModelMap mmap) |
|||
{ |
|||
WarehouseOutOrderDetail warehouseOutOrderDetail = outOrderDetailService.selectWarehouseOutOrderDetailById(outOrderDetailId); |
|||
mmap.put("salesOrderCode",salesOrderCode); |
|||
mmap.put("makeNo",makeNo); |
|||
mmap.put("warehouseOutOrderDetail", warehouseOutOrderDetail); |
|||
return prefix + "/addShippingDevicesOne"; |
|||
} |
|||
|
|||
/** |
|||
* 修改保存售后第一次维护设备 添加出货设备信息 |
|||
*/ |
|||
@ResponseBody |
|||
@PostMapping("/addShippingDevicesOne") |
|||
public AjaxResult addShippingDevicesOneSave(@RequestBody WarehouseOutOrderDetail warehouseOutOrderDetail) |
|||
{ |
|||
|
|||
return toAjax(outOrderDetailService.addShippingDevicesOne(warehouseOutOrderDetail)); |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* 展示售后第一次维护设备添加出货设备料号相关出货设备信息 |
|||
*/ |
|||
@PostMapping("/getAllMaterialShippingDevices") |
|||
@ResponseBody |
|||
public TableDataInfo showAftersalesShippingDevicelist(WarehouseOutOrderDetail warehouseOutOrderDetail) |
|||
{ |
|||
|
|||
startPage(); |
|||
List<SelectShippingDeviceVO> list = warehouseOutOrderService.selectAftersalesShippingDeviceList(warehouseOutOrderDetail); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* 第一次维护设备删除物料信息出货设备信息 |
|||
*/ |
|||
@Log(title = "售后维护设备出库", businessType = BusinessType.DELETE) |
|||
@PostMapping("/deleteRow") |
|||
@ResponseBody |
|||
public AjaxResult deleteRow(String shippingDeviceId) |
|||
{ |
|||
return toAjax(warehouseOutOrderService.deleteAftersalesShippingDeviceById(shippingDeviceId)); |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
/** |
|||
* 售后第二次维护设备 |
|||
*/ |
|||
@GetMapping("/maintenanceEquipmentTwo/{outOrderId}") |
|||
public String maintenanceEquipmentTwo(@PathVariable("outOrderId") Long outOrderId, ModelMap mmap) |
|||
{ |
|||
WarehouseOutOrder warehouseOutOrder = warehouseOutOrderService.selectWarehouseOutOrderById(outOrderId); |
|||
mmap.put("warehouseOutOrder", warehouseOutOrder); |
|||
return prefix + "/maintenanceEquipmentTwo"; |
|||
} |
|||
|
|||
/** |
|||
* 修改保存售后第二次维护设备 |
|||
*/ |
|||
@RequiresPermissions("aftersales:warehouseOutOrder:maintenanceEquipmentTwo") |
|||
@Log(title = "售后维护设备出库", businessType = BusinessType.UPDATE) |
|||
@PostMapping("/maintenanceEquipmentTwo") |
|||
@ResponseBody |
|||
public AjaxResult maintenanceEquipmentTwoSave(@RequestBody WarehouseOutOrder warehouseOutOrder) |
|||
{ |
|||
return toAjax(warehouseOutOrderService.updateMaintenanceEquipmentTwo(warehouseOutOrder)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 展示售后第二次维护设备物料信息 |
|||
* */ |
|||
@PostMapping("/getMaintenanceEquipmentTwoMaterials") |
|||
@ResponseBody |
|||
public TableDataInfo getMaintenanceEquipmentTwoMaterials(WarehouseOutOrder warehouseOutOrder) |
|||
{ |
|||
|
|||
startPage(); |
|||
List<WarehouseOutOrderDetail> list = warehouseOutOrderService.selectOutOrderDetailListByCode(warehouseOutOrder); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 展示售后第二次维护设备料号已选择添加出货设备的相关出货设备信息 |
|||
*/ |
|||
// @PostMapping("/showAftersalesShippingDeviceListTwo")
|
|||
// @ResponseBody
|
|||
// public TableDataInfo showAftersalesShippingDeviceListTwo(@RequestParam("materialNo") String materialNo,
|
|||
// @RequestParam("salesOrderCode") String salesOrderCode,
|
|||
// @RequestParam("makeNo") String makeNo)
|
|||
// {
|
|||
//
|
|||
// startPage();
|
|||
// List<SelectShippingDeviceVO> list = warehouseOutOrderService.showAftersalesShippingDeviceListTwo(materialNo,salesOrderCode,makeNo);
|
|||
// return getDataTable(list);
|
|||
// }
|
|||
|
|||
|
|||
/** |
|||
* 确认收货 |
|||
*/ |
|||
@RequiresPermissions("aftersales:warehouseOutOrder:confirmReceivingGoods") |
|||
@Log(title = "售后维护设备出库", businessType = BusinessType.UPDATE) |
|||
@GetMapping( "/confirmReceivingGoods/{outOrderId}") |
|||
@ResponseBody |
|||
public AjaxResult confirmReceivingGoods(@PathVariable("outOrderId") Long outOrderId){ |
|||
return toAjax(warehouseOutOrderService.confirmReceivingGoodsById(outOrderId)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 确认验收 |
|||
*/ |
|||
@RequiresPermissions("aftersales:warehouseOutOrder:confirmCheckGoods") |
|||
@Log(title = "售后维护设备出库", businessType = BusinessType.UPDATE) |
|||
@GetMapping( "/confirmCheckGoods/{outOrderId}") |
|||
@ResponseBody |
|||
public AjaxResult confirmCheckGoods(@PathVariable("outOrderId") Long outOrderId){ |
|||
return toAjax(warehouseOutOrderService.confirmCheckGoodsById(outOrderId)); |
|||
} |
|||
|
|||
} |
@ -1,158 +0,0 @@ |
|||
package com.ruoyi.aftersales.service; |
|||
|
|||
import java.util.List; |
|||
|
|||
import com.ruoyi.aftersales.domain.vo.SelectMaterialsVO; |
|||
import com.ruoyi.aftersales.domain.vo.SelectShippingDeviceVO; |
|||
import com.ruoyi.warehouse.domain.WarehouseOutOrder; |
|||
import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail; |
|||
|
|||
/** |
|||
* 出库单Service接口 |
|||
* |
|||
* @author 刘晓旭 |
|||
* @date 2024-04-23 |
|||
*/ |
|||
public interface IAftersalesWarehouseOutService |
|||
{ |
|||
/** |
|||
* 查询出库单 |
|||
* |
|||
* @param outOrderId 出库单ID |
|||
* @return 出库单 |
|||
*/ |
|||
public WarehouseOutOrder selectWarehouseOutOrderById(Long outOrderId); |
|||
|
|||
/** |
|||
* 查询出库单列表 |
|||
* |
|||
* @param warehouseOutOrder 出库单 |
|||
* @return 出库单集合 |
|||
*/ |
|||
public List<WarehouseOutOrder> selectAftersalesWarehouseOutOrderList(WarehouseOutOrder warehouseOutOrder); |
|||
|
|||
|
|||
/** |
|||
* 查询关联销售单的物料列表 |
|||
* |
|||
* @param salesOrderCode 销售单号 |
|||
* @return 出库单集合 |
|||
*/ |
|||
public List<SelectMaterialsVO> selectMaterialBySalesOrderCode(WarehouseOutOrder warehouseOutOrder); |
|||
|
|||
/** |
|||
* 查询添加出货设备的物料列表 |
|||
* |
|||
* @param salesOrderCode 销售单号 |
|||
* @return 出库单集合 |
|||
*/ |
|||
public List<SelectMaterialsVO> selectMaterialByMaterialCode(SelectMaterialsVO selectMaterialsVO); |
|||
|
|||
/** |
|||
* 新增出库单 |
|||
* |
|||
* @param warehouseOutOrder 出库单 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertWarehouseOutOrder(WarehouseOutOrder warehouseOutOrder); |
|||
|
|||
/** |
|||
* 修改出库单 |
|||
* |
|||
* @param warehouseOutOrder 出库单 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateWarehouseOutOrder(WarehouseOutOrder warehouseOutOrder); |
|||
|
|||
/** |
|||
* 批量删除出库单 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteWarehouseOutOrderByIds(String ids); |
|||
|
|||
/** |
|||
* 删除出库单信息 |
|||
* |
|||
* @param outOrderId 出库单ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteWarehouseOutOrderById(Long outOrderId); |
|||
|
|||
/** |
|||
* 作废出库单 |
|||
* @param outOrderId 出库单ID |
|||
* @return |
|||
*/ |
|||
int cancelWarehouseOutOrderById(Long outOrderId); |
|||
|
|||
/** |
|||
* 恢复出库单 |
|||
* @param outOrderId 出库单ID |
|||
* @return |
|||
*/ |
|||
int restoreWarehouseOutOrderById(Long outOrderId); |
|||
|
|||
SelectMaterialsVO selectShippingDevicesById(String quoteId, String materialCode); |
|||
|
|||
List<SelectShippingDeviceVO> selectShippingDeviceBySalesOrderCode(SelectMaterialsVO selectMaterialsVO); |
|||
|
|||
/* |
|||
* 根据设备ID删除出货设备信息 |
|||
* */ |
|||
int deleteAftersalesShippingDeviceById(String shippingDeviceId); |
|||
|
|||
|
|||
/** |
|||
* 展示售后第一次维护设备料号相关出货设备信息 |
|||
*/ |
|||
List<SelectShippingDeviceVO> selectAftersalesShippingDevicelistByCodeAndNo(WarehouseOutOrder warehouseOutOrder); |
|||
|
|||
|
|||
/** |
|||
* 展示售后第一次维护设备物料相关信息 |
|||
* */ |
|||
List<WarehouseOutOrderDetail> selectOutOrderDetailListByCode(WarehouseOutOrder warehouseOutOrder); |
|||
|
|||
/** |
|||
* 展示售后第一次维护设备 添加出货设备 料号相关出货设备信息 (旧版) |
|||
* */ |
|||
List<SelectShippingDeviceVO> selectAftersalesShippingDeviceListByMaterialNo(WarehouseOutOrderDetail warehouseOutOrderDetail); |
|||
|
|||
/** |
|||
* 展示售后第一次维护设备料号已选择添加出货设备的相关出货设备信息 |
|||
* */ |
|||
List<SelectShippingDeviceVO> showAftersalesShippingDeviceList(String materialNo,String salesOrderCode,String makeNo); |
|||
|
|||
/** |
|||
* 修改保存售后第一次维护设备 |
|||
*/ |
|||
int updateMaintenanceEquipmentOne(WarehouseOutOrder warehouseOutOrder); |
|||
|
|||
|
|||
// /**
|
|||
// * 展示售后第二次维护设备料号已选择添加出货设备的相关出货设备信息
|
|||
// */
|
|||
// List<SelectShippingDeviceVO> showAftersalesShippingDeviceListTwo(WarehouseOutOrder warehouseOutOrder);
|
|||
|
|||
/** |
|||
* 修改保存售后第二次维护设备 |
|||
*/ |
|||
int updateMaintenanceEquipmentTwo(WarehouseOutOrder warehouseOutOrder); |
|||
|
|||
/** |
|||
* 确认收货 |
|||
*/ |
|||
int confirmReceivingGoodsById(Long outOrderId); |
|||
|
|||
/** |
|||
* 确认验收 |
|||
*/ |
|||
int confirmCheckGoodsById(Long outOrderId); |
|||
|
|||
/** |
|||
* 展示售后第一次维护设备添加出货设备料号相关出货设备信息 关联物料号、生产单号、销售单号 |
|||
* */ |
|||
List<SelectShippingDeviceVO> selectAftersalesShippingDeviceList(WarehouseOutOrderDetail warehouseOutOrderDetail); |
|||
} |
@ -1,618 +0,0 @@ |
|||
package com.ruoyi.aftersales.service.impl; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
import java.util.stream.Collectors; |
|||
|
|||
import com.ruoyi.aftersales.domain.AfterSalesShippingDevice; |
|||
import com.ruoyi.aftersales.domain.vo.SelectMaterialsVO; |
|||
import com.ruoyi.aftersales.domain.vo.SelectShippingDeviceVO; |
|||
import com.ruoyi.aftersales.mapper.AfterSalesShippingDeviceMapper; |
|||
import com.ruoyi.common.exception.BusinessException; |
|||
import com.ruoyi.common.utils.DateUtils; |
|||
import com.ruoyi.common.utils.ShiroUtils; |
|||
import com.ruoyi.common.utils.StringUtils; |
|||
import com.ruoyi.system.domain.SysSalesOrder; |
|||
import com.ruoyi.system.domain.SysSalesOrderChild; |
|||
import com.ruoyi.system.domain.SysSalesShippingInform; |
|||
import com.ruoyi.system.domain.SysSalesShippingInformDetail; |
|||
import com.ruoyi.system.mapper.SysSalesOrderChildMapper; |
|||
import com.ruoyi.system.mapper.SysSalesOrderMapper; |
|||
import com.ruoyi.system.mapper.SysSalesShippingInformMapper; |
|||
import com.ruoyi.warehouse.domain.WarehouseOutOrder; |
|||
import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail; |
|||
import com.ruoyi.warehouse.mapper.WarehouseOutOrderDetailMapper; |
|||
import com.ruoyi.warehouse.mapper.WarehouseOutOrderMapper; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import com.ruoyi.aftersales.service.IAftersalesWarehouseOutService; |
|||
import com.ruoyi.common.core.text.Convert; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
/** |
|||
* 出库单Service业务层处理 |
|||
* |
|||
* @author 刘晓旭 |
|||
* @date 2024-04-23 |
|||
*/ |
|||
@Service |
|||
@Slf4j |
|||
public class AftersalesWarehouseOutServiceImpl implements IAftersalesWarehouseOutService |
|||
{ |
|||
@Autowired |
|||
private WarehouseOutOrderMapper warehouseOutOrderMapper; |
|||
|
|||
@Autowired |
|||
private SysSalesOrderChildMapper sysSalesOrderChildMapper; |
|||
|
|||
@Autowired |
|||
private AfterSalesShippingDeviceMapper shippingDeviceMapper; |
|||
|
|||
@Autowired |
|||
private WarehouseOutOrderDetailMapper outOrderDetailMapper; |
|||
|
|||
@Autowired |
|||
private SysSalesShippingInformMapper shippingInformMapper; |
|||
|
|||
@Autowired |
|||
private SysSalesOrderMapper sysSalesOrderMapper; |
|||
|
|||
/** |
|||
* 查询出库单 |
|||
* |
|||
* @param outOrderId 出库单ID |
|||
* @return 出库单 |
|||
*/ |
|||
@Override |
|||
public WarehouseOutOrder selectWarehouseOutOrderById(Long outOrderId) |
|||
{ |
|||
return warehouseOutOrderMapper.selectWarehouseOutOrderById(outOrderId); |
|||
} |
|||
|
|||
/** |
|||
* 查询出库单列表 |
|||
* |
|||
* @param warehouseOutOrder 出库单 |
|||
* @return 出库单 |
|||
*/ |
|||
@Override |
|||
public List<WarehouseOutOrder> selectAftersalesWarehouseOutOrderList(WarehouseOutOrder warehouseOutOrder) |
|||
{ |
|||
|
|||
|
|||
return warehouseOutOrderMapper.selectAftersalesWarehouseOutOrderList(warehouseOutOrder); |
|||
} |
|||
|
|||
@Override |
|||
public List<SelectMaterialsVO> selectMaterialBySalesOrderCode(WarehouseOutOrder warehouseOutOrder) { |
|||
|
|||
List<SelectMaterialsVO> selectMaterialsVOs = new ArrayList<>(); |
|||
|
|||
List<SysSalesOrderChild> sysSalesOrderChildren = sysSalesOrderChildMapper.selectSysSalesOrderChildByQuoteId(warehouseOutOrder.getSalesOrderCode()); |
|||
if (!StringUtils.isNotEmpty(sysSalesOrderChildren)){ |
|||
// 记录日志
|
|||
log.warn("未查找到与销售订单关联的物料数据, 销售订单编码: {}", warehouseOutOrder.getSalesOrderCode()); |
|||
throw new RuntimeException("未查找到物料相关数据"); |
|||
} |
|||
for (SysSalesOrderChild sysSalesOrderChild : sysSalesOrderChildren) { |
|||
SelectMaterialsVO selectMaterialsVO = new SelectMaterialsVO(); |
|||
selectMaterialsVO.setQuoteId(sysSalesOrderChild.getQuoteId()); |
|||
selectMaterialsVO.setMaterialCode(sysSalesOrderChild.getMaterialCode()); |
|||
selectMaterialsVO.setMaterialName(sysSalesOrderChild.getMaterialName()); |
|||
selectMaterialsVO.setMaterialType(sysSalesOrderChild.getMaterialType()); |
|||
selectMaterialsVO.setBrand(sysSalesOrderChild.getBrand()); |
|||
selectMaterialsVO.setDescribe(sysSalesOrderChild.getDescribe()); |
|||
selectMaterialsVO.setUnit(sysSalesOrderChild.getUnit()); |
|||
selectMaterialsVO.setPhotoUrl(sysSalesOrderChild.getPhotoUrl()); |
|||
selectMaterialsVO.setProcessMethod(sysSalesOrderChild.getProcessMethod()); |
|||
selectMaterialsVOs.add(selectMaterialsVO); |
|||
} |
|||
return selectMaterialsVOs; |
|||
} |
|||
|
|||
|
|||
@Override |
|||
public SelectMaterialsVO selectShippingDevicesById(String quoteId, String materialCode) { |
|||
SelectMaterialsVO selectMaterialsVO = new SelectMaterialsVO(); |
|||
SysSalesOrderChild sysSalesOrderChild = sysSalesOrderChildMapper.selectOneByQuoteIdAndMaterialCode(quoteId, materialCode); |
|||
if (StringUtils.isNotNull(sysSalesOrderChild)){ |
|||
selectMaterialsVO.setQuoteId(quoteId); |
|||
selectMaterialsVO.setMaterialCode(materialCode); |
|||
selectMaterialsVO.setMaterialType(sysSalesOrderChild.getMaterialType()); |
|||
selectMaterialsVO.setBrand(sysSalesOrderChild.getBrand()); |
|||
selectMaterialsVO.setDescribe(sysSalesOrderChild.getDescribe()); |
|||
selectMaterialsVO.setUnit(sysSalesOrderChild.getUnit()); |
|||
selectMaterialsVO.setPhotoUrl(sysSalesOrderChild.getPhotoUrl()); |
|||
selectMaterialsVO.setProcessMethod(sysSalesOrderChild.getProcessMethod()); |
|||
} |
|||
return selectMaterialsVO; |
|||
} |
|||
|
|||
/*根据销售单号查询出货设备信息*/ |
|||
@Override |
|||
public List<SelectShippingDeviceVO> selectShippingDeviceBySalesOrderCode(SelectMaterialsVO selectMaterialsVO) { |
|||
|
|||
List<SelectShippingDeviceVO> selectShippingDeviceVOs = new ArrayList<>(); |
|||
List<AfterSalesShippingDevice> afterSalesShippingDevices = shippingDeviceMapper.selectShippingDeviceBySalesOrderCode(selectMaterialsVO.getQuoteId()); |
|||
if (!StringUtils.isNotEmpty(afterSalesShippingDevices)) { |
|||
// 记录日志
|
|||
log.warn("未查找到与销售订单关联的出库设备数据, 销售订单编码: {}", selectMaterialsVO.getQuoteId()); |
|||
throw new RuntimeException("未查找到物料相关数据"); |
|||
} |
|||
for (AfterSalesShippingDevice afterSalesShippingDevice : afterSalesShippingDevices) { |
|||
SelectShippingDeviceVO shippingDeviceVO = new SelectShippingDeviceVO(); |
|||
shippingDeviceVO.setShippingDeviceId(afterSalesShippingDevice.getShippingDeviceId()); |
|||
shippingDeviceVO.setDeviceModelCode(afterSalesShippingDevice.getDeviceModelCode()); |
|||
shippingDeviceVO.setDeviceRunningNumber(afterSalesShippingDevice.getDeviceRunningNumber()); |
|||
shippingDeviceVO.setMakePhotoUrl(afterSalesShippingDevice.getMakePhotourl()); |
|||
shippingDeviceVO.setQuoteId(afterSalesShippingDevice.getSalesOrderCode()); |
|||
selectShippingDeviceVOs.add(shippingDeviceVO); |
|||
} |
|||
return selectShippingDeviceVOs; |
|||
} |
|||
|
|||
/** |
|||
* 展示售后第一次维护设备料号相关出货设备信息 |
|||
*/ |
|||
@Override |
|||
public List<SelectShippingDeviceVO> selectAftersalesShippingDevicelistByCodeAndNo(WarehouseOutOrder warehouseOutOrder) { |
|||
|
|||
List<SelectShippingDeviceVO> selectShippingDeviceVOs = new ArrayList<>(); |
|||
AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice(); |
|||
afterSalesShippingDevice.setSalesOrderCode(warehouseOutOrder.getSalesOrderCode()); |
|||
afterSalesShippingDevice.setMaterialNo(warehouseOutOrder.getMaterialNo()); |
|||
List<AfterSalesShippingDevice> afterSalesShippingDevices = shippingDeviceMapper.selectShippingDeviceList(afterSalesShippingDevice); |
|||
if (!StringUtils.isNotEmpty(afterSalesShippingDevices)) { |
|||
// 记录日志
|
|||
log.warn("未查找到与销售订单关联的出库设备数据, 销售订单编码: {}", warehouseOutOrder.getSalesOrderCode()); |
|||
throw new BusinessException("未查出库设备数据"); |
|||
} |
|||
|
|||
for (AfterSalesShippingDevice tempAfterSalesShippingDevice : afterSalesShippingDevices) { |
|||
SelectShippingDeviceVO shippingDeviceVO = new SelectShippingDeviceVO(); |
|||
shippingDeviceVO.setShippingDeviceId(tempAfterSalesShippingDevice.getShippingDeviceId()); |
|||
shippingDeviceVO.setDeviceModelCode(tempAfterSalesShippingDevice.getDeviceModelCode()); |
|||
shippingDeviceVO.setDeviceRunningNumber(tempAfterSalesShippingDevice.getDeviceRunningNumber()); |
|||
shippingDeviceVO.setMakePhotoUrl(tempAfterSalesShippingDevice.getMakePhotourl()); |
|||
shippingDeviceVO.setQuoteId(tempAfterSalesShippingDevice.getSalesOrderCode()); |
|||
selectShippingDeviceVOs.add(shippingDeviceVO); |
|||
} |
|||
return selectShippingDeviceVOs; |
|||
} |
|||
|
|||
/** |
|||
* 展示售后第一次维护设备物料相关信息 |
|||
* */ |
|||
@Override |
|||
public List<WarehouseOutOrderDetail> selectOutOrderDetailListByCode(WarehouseOutOrder warehouseOutOrder) { |
|||
|
|||
String outOrderCode = warehouseOutOrder.getOutOrderCode(); |
|||
if (!StringUtils.isNotEmpty(outOrderCode)) { |
|||
// 记录日志
|
|||
log.warn("未查找到与出库单号关联的出库单详情数据, 出库单号: {}", outOrderCode); |
|||
throw new BusinessException("未查出库单详情数据"); |
|||
} |
|||
List<WarehouseOutOrderDetail> warehouseOutOrderDetails = outOrderDetailMapper.selectOutOrderDetailListByCode(outOrderCode); |
|||
return warehouseOutOrderDetails; |
|||
} |
|||
|
|||
/** |
|||
* 展示售后第一次维护设备 添加出货设备 料号相关出货设备信息 |
|||
* */ |
|||
@Override |
|||
public List<SelectShippingDeviceVO> selectAftersalesShippingDeviceListByMaterialNo(WarehouseOutOrderDetail warehouseOutOrderDetail) { |
|||
|
|||
List<SelectShippingDeviceVO> selectShippingDeviceVOs = new ArrayList<>(); |
|||
AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice(); |
|||
afterSalesShippingDevice.setMaterialNo(warehouseOutOrderDetail.getMaterialNo()); |
|||
List<AfterSalesShippingDevice> afterSalesShippingDevices = shippingDeviceMapper.selectShippingDeviceListByMaterialNo(afterSalesShippingDevice); |
|||
if (!StringUtils.isNotEmpty(afterSalesShippingDevices)) { |
|||
// 记录日志
|
|||
log.warn("未查找到与物料号关联的出库设备数据, 物料号: {}",warehouseOutOrderDetail.getMaterialNo()); |
|||
} |
|||
|
|||
for (AfterSalesShippingDevice tempAfterSalesShippingDevice : afterSalesShippingDevices) { |
|||
SelectShippingDeviceVO shippingDeviceVO = new SelectShippingDeviceVO(); |
|||
shippingDeviceVO.setShippingDeviceId(tempAfterSalesShippingDevice.getShippingDeviceId()); |
|||
shippingDeviceVO.setDeviceModelCode(tempAfterSalesShippingDevice.getDeviceModelCode()); |
|||
shippingDeviceVO.setDeviceRunningNumber(tempAfterSalesShippingDevice.getDeviceRunningNumber()); |
|||
shippingDeviceVO.setMakePhotoUrl(tempAfterSalesShippingDevice.getMakePhotourl()); |
|||
shippingDeviceVO.setQuoteId(tempAfterSalesShippingDevice.getSalesOrderCode()); |
|||
selectShippingDeviceVOs.add(shippingDeviceVO); |
|||
} |
|||
return selectShippingDeviceVOs; |
|||
} |
|||
|
|||
/** |
|||
* 展示售后第一次维护设备料号已选择添加出货设备的相关出货设备信息 |
|||
* */ |
|||
@Override |
|||
public List<SelectShippingDeviceVO> showAftersalesShippingDeviceList(String materialNo,String salesOrderCode,String makeNo) { |
|||
|
|||
List<SelectShippingDeviceVO> selectShippingDeviceVOs = new ArrayList<>(); |
|||
AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice(); |
|||
afterSalesShippingDevice.setMaterialNo(materialNo); |
|||
afterSalesShippingDevice.setSalesOrderCode(salesOrderCode); |
|||
afterSalesShippingDevice.setMakeNo(makeNo); |
|||
List<AfterSalesShippingDevice> afterSalesShippingDevices = shippingDeviceMapper.selectAfterSalesShippingDeviceByNoAndCode(afterSalesShippingDevice); |
|||
List<AfterSalesShippingDevice> filterAfterSalesShippingDevices = afterSalesShippingDevices.stream().filter(shippingDevice -> "0".equals(shippingDevice.getAddShippingDeviceFlag())).collect(Collectors.toList()); |
|||
if (!StringUtils.isNotEmpty(filterAfterSalesShippingDevices)) { |
|||
// 记录日志
|
|||
log.warn("未查找到与物料号关联的出库设备数据, 物料号: {}",materialNo); |
|||
} |
|||
|
|||
for (AfterSalesShippingDevice tempAfterSalesShippingDevice : filterAfterSalesShippingDevices) { |
|||
SelectShippingDeviceVO shippingDeviceVO = new SelectShippingDeviceVO(); |
|||
shippingDeviceVO.setShippingDeviceId(tempAfterSalesShippingDevice.getShippingDeviceId()); |
|||
shippingDeviceVO.setDeviceModelCode(tempAfterSalesShippingDevice.getDeviceModelCode()); |
|||
shippingDeviceVO.setDeviceRunningNumber(tempAfterSalesShippingDevice.getDeviceRunningNumber()); |
|||
shippingDeviceVO.setMakePhotoUrl(tempAfterSalesShippingDevice.getMakePhotourl()); |
|||
shippingDeviceVO.setQuoteId(tempAfterSalesShippingDevice.getSalesOrderCode()); |
|||
selectShippingDeviceVOs.add(shippingDeviceVO); |
|||
} |
|||
return selectShippingDeviceVOs; |
|||
} |
|||
|
|||
/** |
|||
* 修改保存售后第一次维护设备 |
|||
*/ |
|||
@Transactional(rollbackFor = Exception.class) |
|||
@Override |
|||
public int updateMaintenanceEquipmentOne(WarehouseOutOrder warehouseOutOrder) { |
|||
|
|||
String loginName = ShiroUtils.getLoginName(); |
|||
|
|||
List<SelectShippingDeviceVO> selectShippingDeviceVOList = warehouseOutOrder.getSelectShippingDeviceVOList(); |
|||
for (SelectShippingDeviceVO selectShippingDeviceVO : selectShippingDeviceVOList) { |
|||
AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice(); |
|||
afterSalesShippingDevice.setShippingDeviceId(selectShippingDeviceVO.getShippingDeviceId()); |
|||
afterSalesShippingDevice.setSnCode(selectShippingDeviceVO.getSnCode()); |
|||
afterSalesShippingDevice.setUpdateBy(loginName); |
|||
afterSalesShippingDevice.setUpdateTime(new Date()); |
|||
int updateShippingDeviceResult = shippingDeviceMapper.updateAfterSalesShippingDevice(afterSalesShippingDevice); |
|||
if (updateShippingDeviceResult <= 0){ |
|||
throw new BusinessException("更新出货设备数据失败"); |
|||
} |
|||
|
|||
} |
|||
|
|||
//设置出库单为待业务确认发货
|
|||
warehouseOutOrder.setWarehouseOutStatus("2"); |
|||
|
|||
//更新销售管理销售出库的出货状态 待业务确认发货
|
|||
SysSalesShippingInform sysSalesShippingInform = new SysSalesShippingInform(); |
|||
sysSalesShippingInform.setOutOrderCode(warehouseOutOrder.getOutOrderCode()); |
|||
sysSalesShippingInform.setWarehouseOutStatus("2"); |
|||
sysSalesShippingInform.setUpdateBy(loginName); |
|||
sysSalesShippingInform.setUpdateTime(new Date()); |
|||
int updateShippingInformResult = shippingInformMapper.updateSysSalesShippingInformByOutOrderCode(sysSalesShippingInform); |
|||
if (updateShippingInformResult <= 0){ |
|||
log.warn("出库单号为空:{}",warehouseOutOrder.getOutOrderCode()); |
|||
throw new BusinessException("更新销售出库单数据失败"); |
|||
} |
|||
|
|||
|
|||
|
|||
return warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder); |
|||
} |
|||
|
|||
// /**
|
|||
// * 展示售后第二次维护设备料号已选择添加出货设备的相关出货设备信息
|
|||
// */
|
|||
// @Override
|
|||
// public List<SelectShippingDeviceVO> showAftersalesShippingDeviceListTwo(String materialNo,String salesOrderCode,String makeNo) {
|
|||
//
|
|||
// List<SelectShippingDeviceVO> selectShippingDeviceVOs = new ArrayList<>();
|
|||
// AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice();
|
|||
// afterSalesShippingDevice.setMaterialNo(materialNo);
|
|||
// afterSalesShippingDevice.setSalesOrderCode(salesOrderCode);
|
|||
// afterSalesShippingDevice.setMakeNo(makeNo);
|
|||
// List<AfterSalesShippingDevice> afterSalesShippingDevices = shippingDeviceMapper.selectAfterSalesShippingDeviceByNoAndCode(afterSalesShippingDevice);
|
|||
// List<AfterSalesShippingDevice> filterAfterSalesShippingDevices = afterSalesShippingDevices.stream().filter(shippingDevice -> "0".equals(shippingDevice.getAddShippingDeviceFlag())).collect(Collectors.toList());
|
|||
// if (!StringUtils.isNotEmpty(filterAfterSalesShippingDevices)) {
|
|||
// // 记录日志
|
|||
// log.warn("未查找到与物料号关联的出库设备数据, 物料号: {}",materialNo);
|
|||
// }
|
|||
//
|
|||
// for (AfterSalesShippingDevice tempAfterSalesShippingDevice : filterAfterSalesShippingDevices) {
|
|||
// SelectShippingDeviceVO shippingDeviceVO = new SelectShippingDeviceVO();
|
|||
// shippingDeviceVO.setShippingDeviceId(tempAfterSalesShippingDevice.getShippingDeviceId());
|
|||
// shippingDeviceVO.setDeviceModelCode(tempAfterSalesShippingDevice.getDeviceModelCode());
|
|||
// shippingDeviceVO.setDeviceRunningNumber(tempAfterSalesShippingDevice.getDeviceRunningNumber());
|
|||
// shippingDeviceVO.setMakePhotoUrl(tempAfterSalesShippingDevice.getMakePhotourl());
|
|||
// shippingDeviceVO.setQuoteId(tempAfterSalesShippingDevice.getSalesOrderCode());
|
|||
// shippingDeviceVO.setSnCode(tempAfterSalesShippingDevice.getSnCode());
|
|||
// shippingDeviceVO.setFactoryDate(tempAfterSalesShippingDevice.getFactoryDate());
|
|||
// shippingDeviceVO.setGuaranteePeriod(tempAfterSalesShippingDevice.getGuaranteePeriod());
|
|||
// shippingDeviceVO.setLockDate(tempAfterSalesShippingDevice.getLockDate());
|
|||
// shippingDeviceVO.setLockDateFlag(tempAfterSalesShippingDevice.getLockDateFlag());
|
|||
// shippingDeviceVO.setWastageExpireDate(tempAfterSalesShippingDevice.getWastageExpireDate());
|
|||
// shippingDeviceVO.setComponentGuaranteeDate(tempAfterSalesShippingDevice.getComponentGuaranteeDate());
|
|||
// selectShippingDeviceVOs.add(shippingDeviceVO);
|
|||
//
|
|||
// }
|
|||
// return selectShippingDeviceVOs;
|
|||
// }
|
|||
|
|||
/** |
|||
* 修改保存售后第二次维护设备 |
|||
*/ |
|||
@Transactional(rollbackFor = Exception.class) |
|||
@Override |
|||
public int updateMaintenanceEquipmentTwo(WarehouseOutOrder warehouseOutOrder) { |
|||
|
|||
String loginName = ShiroUtils.getLoginName(); |
|||
|
|||
List<SelectShippingDeviceVO> selectShippingDeviceVOList = warehouseOutOrder.getSelectShippingDeviceVOList(); |
|||
for (SelectShippingDeviceVO selectShippingDeviceVO : selectShippingDeviceVOList) { |
|||
AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice(); |
|||
afterSalesShippingDevice.setShippingDeviceId(selectShippingDeviceVO.getShippingDeviceId()); |
|||
afterSalesShippingDevice.setSnCode(selectShippingDeviceVO.getSnCode()); |
|||
afterSalesShippingDevice.setFactoryDate(selectShippingDeviceVO.getFactoryDate()); |
|||
afterSalesShippingDevice.setGuaranteePeriod(selectShippingDeviceVO.getGuaranteePeriod()); |
|||
afterSalesShippingDevice.setLockDate(selectShippingDeviceVO.getLockDate()); |
|||
afterSalesShippingDevice.setLockDateFlag(selectShippingDeviceVO.getLockDateFlag()); |
|||
afterSalesShippingDevice.setWastageExpireDate(selectShippingDeviceVO.getWastageExpireDate()); |
|||
afterSalesShippingDevice.setComponentGuaranteeDate(selectShippingDeviceVO.getComponentGuaranteeDate()); |
|||
afterSalesShippingDevice.setUpdateBy(loginName); |
|||
afterSalesShippingDevice.setUpdateTime(new Date()); |
|||
int updateShippingDeviceResult = shippingDeviceMapper.updateAfterSalesShippingDevice(afterSalesShippingDevice); |
|||
if (updateShippingDeviceResult <= 0){ |
|||
throw new BusinessException("更新出货设备数据失败"); |
|||
} |
|||
|
|||
} |
|||
|
|||
//设置出库单为待业务确认发货
|
|||
warehouseOutOrder.setWarehouseOutStatus("4"); |
|||
|
|||
//更新销售管理销售出库的出货状态 待业务确认发货
|
|||
SysSalesShippingInform sysSalesShippingInform = new SysSalesShippingInform(); |
|||
sysSalesShippingInform.setOutOrderCode(warehouseOutOrder.getOutOrderCode()); |
|||
sysSalesShippingInform.setWarehouseOutStatus("4"); |
|||
sysSalesShippingInform.setUpdateBy(loginName); |
|||
sysSalesShippingInform.setUpdateTime(new Date()); |
|||
int updateShippingInformResult = shippingInformMapper.updateSysSalesShippingInformByOutOrderCode(sysSalesShippingInform); |
|||
if (updateShippingInformResult <= 0){ |
|||
log.warn("出库单号为空:{}",warehouseOutOrder.getOutOrderCode()); |
|||
throw new BusinessException("更新销售出库单数据失败"); |
|||
} |
|||
|
|||
|
|||
|
|||
return warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 确认收货 |
|||
*/ |
|||
@Transactional(rollbackFor = Exception.class) |
|||
@Override |
|||
public int confirmReceivingGoodsById(Long outOrderId) { |
|||
|
|||
String loginName = ShiroUtils.getLoginName(); |
|||
WarehouseOutOrder warehouseOutOrder = warehouseOutOrderMapper.selectWarehouseOutOrderById(outOrderId); |
|||
if (warehouseOutOrder == null){ |
|||
log.warn("出库单Id为空:{}",outOrderId); |
|||
} |
|||
String outOrderCode = warehouseOutOrder.getOutOrderCode(); |
|||
SysSalesShippingInform sysSalesShippingInform = new SysSalesShippingInform(); |
|||
sysSalesShippingInform.setOutOrderCode(outOrderCode); |
|||
sysSalesShippingInform.setWarehouseOutStatus("10"); |
|||
sysSalesShippingInform.setUpdateTime(new Date()); |
|||
sysSalesShippingInform.setUpdateBy(loginName); |
|||
|
|||
int updateSalesShippingInformResult = shippingInformMapper.updateSysSalesShippingInformByOutOrderCode(sysSalesShippingInform); |
|||
if (updateSalesShippingInformResult <= 0){ |
|||
throw new BusinessException("更新销售出库数据失败"); |
|||
} |
|||
|
|||
String salesOrderCode = warehouseOutOrder.getSalesOrderCode(); |
|||
if (StringUtils.isEmpty(salesOrderCode)){ |
|||
log.warn("销售订单号为空:{}",salesOrderCode); |
|||
} |
|||
SysSalesOrder sysSalesOrder = new SysSalesOrder(); |
|||
sysSalesOrder.setSalesOrderCode(salesOrderCode); |
|||
//设置为全部出货
|
|||
sysSalesOrder.setDeliveryStatus("6"); |
|||
sysSalesOrder.setUpdateTime(new Date()); |
|||
sysSalesOrder.setUpdateBy(loginName); |
|||
int updateSysSalesOrderResult = sysSalesOrderMapper.updateSysSalesOrderBySalesOrderCode(sysSalesOrder); |
|||
if (updateSysSalesOrderResult <= 0){ |
|||
throw new BusinessException("更新销售订单数据失败"); |
|||
} |
|||
warehouseOutOrder.setUpdateTime(new Date()); |
|||
warehouseOutOrder.setUpdateBy(loginName); |
|||
//设置为待验收
|
|||
warehouseOutOrder.setWarehouseOutStatus("10"); |
|||
return warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder); |
|||
} |
|||
|
|||
/** |
|||
* 确认验收 |
|||
*/ |
|||
@Transactional(rollbackFor = Exception.class) |
|||
@Override |
|||
public int confirmCheckGoodsById(Long outOrderId) { |
|||
|
|||
String loginName = ShiroUtils.getLoginName(); |
|||
WarehouseOutOrder warehouseOutOrder = warehouseOutOrderMapper.selectWarehouseOutOrderById(outOrderId); |
|||
if (warehouseOutOrder == null){ |
|||
log.warn("出库单Id为空:{}",outOrderId); |
|||
} |
|||
String outOrderCode = warehouseOutOrder.getOutOrderCode(); |
|||
SysSalesShippingInform sysSalesShippingInform = new SysSalesShippingInform(); |
|||
sysSalesShippingInform.setOutOrderCode(outOrderCode); |
|||
sysSalesShippingInform.setWarehouseOutStatus("12"); |
|||
sysSalesShippingInform.setUpdateTime(new Date()); |
|||
sysSalesShippingInform.setUpdateBy(loginName); |
|||
|
|||
int updateSalesShippingInformResult = shippingInformMapper.updateSysSalesShippingInformByOutOrderCode(sysSalesShippingInform); |
|||
if (updateSalesShippingInformResult <= 0){ |
|||
throw new BusinessException("更新销售出库数据失败"); |
|||
} |
|||
|
|||
String salesOrderCode = warehouseOutOrder.getSalesOrderCode(); |
|||
if (StringUtils.isEmpty(salesOrderCode)){ |
|||
log.warn("销售订单号为空:{}",salesOrderCode); |
|||
} |
|||
SysSalesOrder sysSalesOrder = new SysSalesOrder(); |
|||
sysSalesOrder.setSalesOrderCode(salesOrderCode); |
|||
//设置为全部出货
|
|||
sysSalesOrder.setDeliveryStatus("8"); |
|||
sysSalesOrder.setUpdateTime(new Date()); |
|||
sysSalesOrder.setUpdateBy(loginName); |
|||
int updateSysSalesOrderResult = sysSalesOrderMapper.updateSysSalesOrderBySalesOrderCode(sysSalesOrder); |
|||
if (updateSysSalesOrderResult <= 0){ |
|||
throw new BusinessException("更新销售订单数据失败"); |
|||
} |
|||
warehouseOutOrder.setUpdateTime(new Date()); |
|||
warehouseOutOrder.setUpdateBy(loginName); |
|||
//设置为全部验收
|
|||
warehouseOutOrder.setWarehouseOutStatus("12"); |
|||
return warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 展示售后第一次维护设备添加出货设备料号相关出货设备信息 关联物料号、生产单号、销售单号 |
|||
* */ |
|||
@Override |
|||
public List<SelectShippingDeviceVO> selectAftersalesShippingDeviceList(WarehouseOutOrderDetail warehouseOutOrderDetail) { |
|||
List<SelectShippingDeviceVO> selectShippingDeviceVOs = new ArrayList<>(); |
|||
AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice(); |
|||
afterSalesShippingDevice.setMaterialNo(warehouseOutOrderDetail.getMaterialNo()); |
|||
afterSalesShippingDevice.setMakeNo(warehouseOutOrderDetail.getMakeNo()); |
|||
afterSalesShippingDevice.setSalesOrderCode(warehouseOutOrderDetail.getSalesOrderCode()); |
|||
List<AfterSalesShippingDevice> afterSalesShippingDevices = shippingDeviceMapper.selectAfterSalesShippingDeviceByNoAndCode(afterSalesShippingDevice); |
|||
if (!StringUtils.isNotEmpty(afterSalesShippingDevices)) { |
|||
// 记录日志
|
|||
log.warn("未查找到与物料号关联的出库设备数据, 物料号: {}",warehouseOutOrderDetail.getMaterialNo()); |
|||
} |
|||
|
|||
for (AfterSalesShippingDevice tempAfterSalesShippingDevice : afterSalesShippingDevices) { |
|||
SelectShippingDeviceVO shippingDeviceVO = new SelectShippingDeviceVO(); |
|||
shippingDeviceVO.setShippingDeviceId(tempAfterSalesShippingDevice.getShippingDeviceId()); |
|||
shippingDeviceVO.setDeviceModelCode(tempAfterSalesShippingDevice.getDeviceModelCode()); |
|||
shippingDeviceVO.setDeviceRunningNumber(tempAfterSalesShippingDevice.getDeviceRunningNumber()); |
|||
shippingDeviceVO.setMakePhotoUrl(tempAfterSalesShippingDevice.getMakePhotourl()); |
|||
shippingDeviceVO.setQuoteId(tempAfterSalesShippingDevice.getSalesOrderCode()); |
|||
selectShippingDeviceVOs.add(shippingDeviceVO); |
|||
} |
|||
return selectShippingDeviceVOs; |
|||
|
|||
} |
|||
|
|||
/* |
|||
* 售后第一次维护设备信息根据设备ID删除出货设备信息 |
|||
* */ |
|||
@Override |
|||
public int deleteAftersalesShippingDeviceById(String shippingDeviceId) { |
|||
|
|||
return shippingDeviceMapper.deleteAfterSalesShippingDeviceById(shippingDeviceId); |
|||
} |
|||
|
|||
|
|||
|
|||
@Override |
|||
public List<SelectMaterialsVO> selectMaterialByMaterialCode(SelectMaterialsVO selectMaterialsVO) { |
|||
List<SelectMaterialsVO> selectMaterialsVOs = new ArrayList<>(); |
|||
SysSalesOrderChild sysSalesOrderChild = sysSalesOrderChildMapper.selectOneByQuoteIdAndMaterialCode(selectMaterialsVO.getQuoteId(), selectMaterialsVO.getMaterialCode()); |
|||
if (StringUtils.isNotNull(sysSalesOrderChild)){ |
|||
// selectMaterialsVO.setQuoteId(selectMaterialsVO.getQuoteId());
|
|||
// selectMaterialsVO.setMaterialCode(selectMaterialsVO.getMaterialCode());
|
|||
selectMaterialsVO.setMaterialName(sysSalesOrderChild.getMaterialName()); |
|||
selectMaterialsVO.setMaterialType(sysSalesOrderChild.getMaterialType()); |
|||
selectMaterialsVO.setBrand(sysSalesOrderChild.getBrand()); |
|||
selectMaterialsVO.setDescribe(sysSalesOrderChild.getDescribe()); |
|||
selectMaterialsVO.setUnit(sysSalesOrderChild.getUnit()); |
|||
selectMaterialsVO.setPhotoUrl(sysSalesOrderChild.getPhotoUrl()); |
|||
selectMaterialsVO.setProcessMethod(sysSalesOrderChild.getProcessMethod()); |
|||
selectMaterialsVOs.add(selectMaterialsVO); |
|||
} |
|||
return selectMaterialsVOs; |
|||
} |
|||
|
|||
/** |
|||
* 新增出库单 |
|||
* |
|||
* @param warehouseOutOrder 出库单 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int insertWarehouseOutOrder(WarehouseOutOrder warehouseOutOrder) |
|||
{ |
|||
String loginName = ShiroUtils.getLoginName(); |
|||
warehouseOutOrder.setCreateBy(loginName); |
|||
warehouseOutOrder.setCreateTime(DateUtils.getNowDate()); |
|||
return warehouseOutOrderMapper.insertWarehouseOutOrder(warehouseOutOrder); |
|||
} |
|||
|
|||
/** |
|||
* 修改出库单 |
|||
* |
|||
* @param warehouseOutOrder 出库单 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updateWarehouseOutOrder(WarehouseOutOrder warehouseOutOrder) |
|||
{ |
|||
String loginName = ShiroUtils.getLoginName(); |
|||
warehouseOutOrder.setUpdateBy(loginName); |
|||
warehouseOutOrder.setUpdateTime(DateUtils.getNowDate()); |
|||
return warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder); |
|||
} |
|||
|
|||
/** |
|||
* 删除出库单对象 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteWarehouseOutOrderByIds(String ids) |
|||
{ |
|||
return warehouseOutOrderMapper.deleteWarehouseOutOrderByIds(Convert.toStrArray(ids)); |
|||
} |
|||
|
|||
/** |
|||
* 删除出库单信息 |
|||
* |
|||
* @param outOrderId 出库单ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteWarehouseOutOrderById(Long outOrderId) |
|||
{ |
|||
return warehouseOutOrderMapper.deleteWarehouseOutOrderById(outOrderId); |
|||
} |
|||
|
|||
/** |
|||
* 作废出库单 |
|||
* |
|||
* @param outOrderId 出库单ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int cancelWarehouseOutOrderById(Long outOrderId) |
|||
{ |
|||
return warehouseOutOrderMapper.cancelWarehouseOutOrderById(outOrderId); |
|||
} |
|||
|
|||
/** |
|||
* 恢复出库单信息 |
|||
* |
|||
* @param outOrderId 出库单ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int restoreWarehouseOutOrderById(Long outOrderId) |
|||
{ |
|||
return warehouseOutOrderMapper.restoreWarehouseOutOrderById(outOrderId); |
|||
} |
|||
|
|||
|
|||
} |
@ -1,207 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('新增出库单')" /> |
|||
<th:block th:include="include :: datetimepicker-css" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-warehouseOutOrder-add"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">出库单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="outOrderCode" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">关联生产订单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="makeNo" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">出库状态:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="warehouseOutStatus" class="form-control m-b" th:with="type=${@dict.getType('warehouse_out_status')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">关联订单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="relatedOrderCode" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">关联销售订单编号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="salesOrderCode" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">订单类型:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="warehouseOrderType" class="form-control m-b" th:with="type=${@dict.getType('warehouse_order_type')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">出库类型:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="warehouseOutType" class="form-control m-b" th:with="type=${@dict.getType('warehouse_out_type')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">业务人员:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="businessName" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">售后人员:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="aftersalesName" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">仓库员:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="warehouseName" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">出货设备id:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="shippingDeviceId" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">料号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="materialNo" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">物料名称:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="materialName" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">物料合计:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="materialSum" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">数量合计:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="enterpriseSum" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">出库数:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="outOrderSum" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">出库对象:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="outOrderName" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">出库时间:</label> |
|||
<div class="col-sm-8"> |
|||
<div class="input-group date"> |
|||
<input name="outOrderTime" class="form-control" placeholder="yyyy-MM-dd" type="text"> |
|||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">客户ID:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="customerId" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">客户名称:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="customerName" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">申请人员:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="applyName" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">计划交付时间:</label> |
|||
<div class="col-sm-8"> |
|||
<div class="input-group date"> |
|||
<input name="planDeliveryTime" class="form-control" placeholder="yyyy-MM-dd" type="text"> |
|||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">交付条件:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deliveryCondition" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">收货地址:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deliveryAddress" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">联系人:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deliveryName" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">联系电话:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deliveryNumber" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "aftersales/warehouseOutOrder" |
|||
$("#form-warehouseOutOrder-add").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/add", $('#form-warehouseOutOrder-add').serialize()); |
|||
} |
|||
} |
|||
|
|||
$("input[name='outOrderTime']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true |
|||
}); |
|||
|
|||
$("input[name='planDeliveryTime']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true |
|||
}); |
|||
</script> |
|||
</body> |
|||
</html> |
@ -1,312 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('添加出货设备')" /> |
|||
<th:block th:include="include :: datetimepicker-css" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-addShippingDevicesOne-edit" th:object="${warehouseOutOrderDetail}"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label">料号:</label> |
|||
<div class="col-sm-8"> |
|||
<input readonly name="materialNo" th:field="*{materialNo}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label">图片:</label> |
|||
<div class="col-sm-8"> |
|||
<input readonly name="materialPhotourl" th:field="*{materialPhotourl}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label">物料名称:</label> |
|||
<div class="col-sm-8"> |
|||
<input readonly name="materialName" th:field="*{materialName}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- <div class="form-group">--> |
|||
<!-- <label class="col-sm-4 control-label">物料类型:</label>--> |
|||
<!-- <div class="col-sm-8">--> |
|||
<!-- <input readonly name="materialType" th:field="*{materialType}" class="form-control" type="text">--> |
|||
<!-- </div>--> |
|||
<!-- </div>--> |
|||
<!-- <div class="form-group">--> |
|||
<!-- <label class="col-sm-4 control-label">物料类别:</label>--> |
|||
<!-- <div class="col-sm-8">--> |
|||
<!-- <input readonly name="materialClass" th:field="*{materialClass}" class="form-control" type="text">--> |
|||
<!-- </div>--> |
|||
<!-- </div>--> |
|||
|
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label">型号:</label> |
|||
<div class="col-sm-8"> |
|||
<input readonly name="materialModel" th:field="*{materialModel}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label">规格:</label> |
|||
<div class="col-sm-8"> |
|||
<input readonly name="materialSpecification" th:field="*{materialSpecification}" class="form-control" |
|||
type="text"> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label">单位:</label> |
|||
<div class="col-sm-8"> |
|||
<input readonly name="materialUnit" th:field="*{materialUnit}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label">品牌:</label> |
|||
<div class="col-sm-8"> |
|||
<input readonly name="materialBrand" th:field="*{materialBrand}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label">描述:</label> |
|||
<div class="col-sm-8"> |
|||
<input readonly name="materialDescribe" th:field="*{materialDescribe}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<!-- <div class="col-sm-12 select-table table-striped">--> |
|||
<!-- <h3 class="mb-4">物料信息</h3>--> |
|||
<!-- <table id="table-material"></table>--> |
|||
<!-- </div>--> |
|||
|
|||
|
|||
</form> |
|||
<div class="container"> |
|||
<!-- 选择出货设备 --> |
|||
<div class="row"> |
|||
|
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<h3 class="mb-4">出货设备</h3> |
|||
<table id="table-shippingDevices"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<script th:inline="javascript"> |
|||
// var addFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:addShippingDevice')}]]; |
|||
// var addFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:addShippingDevice')}]]; |
|||
|
|||
var prefix = ctx + "aftersales/warehouseOutOrder"; |
|||
var warehouseOutOrderDetail = [[${warehouseOutOrderDetail}]]; |
|||
var salesOrderCode = [[${salesOrderCode}]]; |
|||
var makeNo = [[${makeNo}]]; |
|||
|
|||
$("#form-addShippingDevicesOne-edit").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
/* |
|||
* 提交设备履历信息 |
|||
* */ |
|||
function submitHandler() { |
|||
// 获取表单数据 |
|||
const shippingDevicesData = $("#form-addShippingDevicesOne-edit").serializeArray().reduce((obj, item) => { |
|||
obj[item.name] = item.value; |
|||
return obj; |
|||
}, {}); |
|||
// 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据 |
|||
// var table = $('#table-shippingDevices').bootstrapTable('getData'); |
|||
//获取选中复选框行的数据 |
|||
const selectedRows = $("#table-shippingDevices").bootstrapTable('getSelections'); |
|||
// 检查表格数据是否为空 |
|||
if (selectedRows.length===0){ |
|||
$.modal.alertWarning("请至少选择一条出货设备信息后再保存!"); |
|||
return; |
|||
} |
|||
// 将表数据转换成与complaintNoticeData格式一致的数组 |
|||
var equipDetailDataList = selectedRows.map(function(item) { |
|||
// 根据实际字段名调整 |
|||
return { |
|||
"shippingDeviceId": item.shippingDeviceId, |
|||
"deviceModelCode": item.deviceModelCode, |
|||
"deviceRunningNumber": item.deviceRunningNumber, |
|||
"makePhotoUrl": item.makePhotoUrl |
|||
// ...其他字段 |
|||
}; |
|||
}); |
|||
|
|||
// 合并表单数据和表格数据 |
|||
const combinedData = Object.assign({}, shippingDevicesData, { selectShippingDeviceVOList: equipDetailDataList }); |
|||
|
|||
console.log(combinedData) |
|||
// 使用 JSON.stringify() 序列化数据 |
|||
const jsonData = JSON.stringify(combinedData); |
|||
// 发送 AJAX 请求到后端接口 |
|||
$.operate.saveJson(prefix + "/addShippingDevicesOne", jsonData); |
|||
} |
|||
|
|||
|
|||
$("input[name='outOrderTime']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true |
|||
}); |
|||
|
|||
$("input[name='planDeliveryTime']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true |
|||
}); |
|||
// |
|||
// /*物料信息列表*/ |
|||
// $(function() { |
|||
// // 物料信息 |
|||
// $('#table-material').bootstrapTable('destroy'); |
|||
// var materialOptions = { |
|||
// id:"table-material", |
|||
// url: prefix + "/addShippingDevicesMaterial", |
|||
// modalName: "物料信息", |
|||
// showColumns: false, |
|||
// pagination: false, |
|||
// showToggle: false, |
|||
// showRefresh:false, |
|||
// showSearch:false, |
|||
// queryParams:queryParams, |
|||
// columns: [{ |
|||
// checkbox: true |
|||
// }, |
|||
// { title:'销售订单号', |
|||
// field:'quoteId', |
|||
// visible: false |
|||
// }, |
|||
// { |
|||
// title: '料号', |
|||
// field: 'materialCode', |
|||
// }, |
|||
// { |
|||
// title: '图片', |
|||
// field: 'photoUrl', |
|||
// }, |
|||
// { |
|||
// title: '物料名称', |
|||
// field: 'materialName', |
|||
// }, |
|||
// { |
|||
// title: '物料类型', |
|||
// field: 'materialType', |
|||
// }, |
|||
// { |
|||
// title: '单位', |
|||
// field: 'materialUnit', |
|||
// }, |
|||
// { |
|||
// title: '品牌', |
|||
// field: 'brand', |
|||
// }, |
|||
// { |
|||
// title: '描述', |
|||
// field: 'describe', |
|||
// }, |
|||
// ] |
|||
// }; |
|||
// $.table.init(materialOptions); |
|||
// |
|||
// }) |
|||
// function queryParams(params) { |
|||
// var curParams = { |
|||
// // 传递参数查询参数 |
|||
// quoteId: selectMaterialsVO.quoteId, |
|||
// materialCode: selectMaterialsVO.materialCode, |
|||
// }; |
|||
// return curParams; |
|||
// } |
|||
|
|||
$(function(){ |
|||
|
|||
var options = { |
|||
id: "table-shippingDevices", |
|||
url: prefix + "/getAllMaterialShippingDevices", |
|||
pagination: false, |
|||
showSearch: false, |
|||
showRefresh: false, |
|||
showToggle: false, |
|||
showColumns: false, |
|||
queryParams:queryParams, |
|||
sidePagination: "client", |
|||
columns: [{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
field: 'equipmentIndex', |
|||
align: 'center', |
|||
title: "序号", |
|||
formatter: function (value, row, index) { |
|||
// 使用bootstrap-table的内置序号生成 |
|||
return index + 1; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'shippingDeviceId', |
|||
align: 'center', |
|||
title: '出货设备id', |
|||
}, |
|||
{ |
|||
field: 'deviceModelCode', |
|||
align: 'center', |
|||
title: '设备型号', |
|||
}, |
|||
{ |
|||
field: 'deviceRunningNumber', |
|||
align: 'center', |
|||
title: '流水号', |
|||
}, |
|||
{ |
|||
field: 'makePhotoUrl', |
|||
align: 'center', |
|||
title: '生产图片', |
|||
}, |
|||
{ |
|||
title: '操作', |
|||
align: 'center', |
|||
formatter: function (value, row, index) { |
|||
return '<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(' + index + ')"><i class="fa fa-remove"></i>删除</a>'; |
|||
} |
|||
} |
|||
|
|||
] |
|||
}; |
|||
$.table.init(options); |
|||
|
|||
}) |
|||
|
|||
function queryParams(params) { |
|||
var curParams = { |
|||
// 传递参数查询参数 |
|||
materialNo: warehouseOutOrderDetail.materialNo, |
|||
salesOrderCode:salesOrderCode, |
|||
makeNo:makeNo |
|||
}; |
|||
return curParams; |
|||
} |
|||
|
|||
function removeRow(index) { |
|||
var data = $('#table-shippingDevices').bootstrapTable('getData'); |
|||
var row = data[index]; // 获取要删除的行数据 |
|||
if (row) { |
|||
$('#table-shippingDevices').bootstrapTable('remove', { |
|||
field: 'equipmentIndex', |
|||
values: [row.equipmentIndex] |
|||
}); |
|||
} |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
@ -1,198 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('修改出库单')" /> |
|||
<th:block th:include="include :: datetimepicker-css" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-warehouseOutOrder-edit" th:object="${warehouseOutOrder}"> |
|||
<input name="outOrderId" th:field="*{outOrderId}" type="hidden"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">出库单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="outOrderCode" th:field="*{outOrderCode}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">出库对象:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="outOrderName" th:field="*{outOrderName}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">销售单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="salesOrderCode" th:field="*{salesOrderCode}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">申请人员:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="applyName" th:field="*{applyName}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">生产单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="makeNo" th:field="*{makeNo}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">出库状态:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="warehouseOutStatus" class="form-control m-b" th:with="type=${@dict.getType('warehouse_out_status')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseOutStatus}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">关联订单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="relatedOrderCode" th:field="*{relatedOrderCode}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">客户ID:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="customerId" th:field="*{customerId}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">客户名称:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="customerName" th:field="*{customerName}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">收货联系人:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deliveryName" th:field="*{deliveryName}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">收货电话:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deliveryNumber" th:field="*{deliveryNumber}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">收货地址:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deliveryAddress" th:field="*{deliveryAddress}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<h3 class="mb-4">物料信息</h3> |
|||
<table id="bootstrap-table"></table> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<script th:inline="javascript"> |
|||
var addFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:addShippingDevices')}]]; |
|||
|
|||
var prefix = ctx + "aftersales/warehouseOutOrder"; |
|||
var warehouseOutOrder = [[${warehouseOutOrder}]]; |
|||
|
|||
$("#form-warehouseOutOrder-edit").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/edit", $('#form-warehouseOutOrder-edit').serialize()); |
|||
} |
|||
} |
|||
|
|||
$("input[name='outOrderTime']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true |
|||
}); |
|||
|
|||
$("input[name='planDeliveryTime']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true |
|||
}); |
|||
|
|||
$(function() { |
|||
var options = { |
|||
url: prefix + "/optionMaterials", |
|||
modalName: "物料信息", |
|||
showColumns: false, |
|||
pagination: false, |
|||
showToggle: false, |
|||
showRefresh:false, |
|||
showSearch:false, |
|||
queryParams:queryParams, |
|||
columns: [{ |
|||
checkbox: true |
|||
}, |
|||
{ title:'销售订单号', |
|||
field:'quoteId', |
|||
visible: false |
|||
}, |
|||
{ |
|||
title: '料号', |
|||
field: 'materialCode', |
|||
}, |
|||
{ |
|||
title: '图片', |
|||
field: 'photoUrl', |
|||
}, |
|||
{ |
|||
title: '物料名称', |
|||
field: 'materialName', |
|||
}, |
|||
{ |
|||
title: '物料类型', |
|||
field: 'materialType', |
|||
}, |
|||
{ |
|||
title: '单位', |
|||
field: 'materialUnit', |
|||
}, |
|||
{ |
|||
title: '品牌', |
|||
field: 'brand', |
|||
}, |
|||
{ |
|||
title: '描述', |
|||
field: 'describe', |
|||
}, |
|||
{ |
|||
title: '操作', |
|||
align: 'center', |
|||
formatter: function(value, row, index) { |
|||
var actions = []; |
|||
actions.push('<a class="btn btn-success btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="addShippingDevices(\'' + row.quoteId + '\',\'' + row.materialCode + '\')"><i class="fa fa-add"></i>添加出货设备</a>'); |
|||
return actions.join(''); |
|||
} |
|||
} |
|||
] |
|||
}; |
|||
$.table.init(options); |
|||
|
|||
}) |
|||
function queryParams(params) { |
|||
var curParams = { |
|||
// 传递参数查询参数 |
|||
salesOrderCode: warehouseOutOrder.salesOrderCode |
|||
}; |
|||
return curParams; |
|||
} |
|||
|
|||
/*添加出货设备*/ |
|||
function addShippingDevices(quoteId, materialCode) { |
|||
// 确保URL编码,特别是如果materialCode中可能含有特殊字符 |
|||
var url = ctx + 'aftersales/warehouseOutOrder/addShippingDevices/' + encodeURIComponent(quoteId) + '/' + encodeURIComponent(materialCode); |
|||
$.modal.open("添加出货设备", url); |
|||
} |
|||
|
|||
</script> |
|||
</body> |
|||
</html> |
@ -1,208 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('修改出库单')" /> |
|||
<th:block th:include="include :: datetimepicker-css" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-warehouseOutOrder-edit" th:object="${warehouseOutOrder}"> |
|||
<input name="outOrderId" th:field="*{outOrderId}" type="hidden"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">出库单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="outOrderCode" th:field="*{outOrderCode}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">关联生产订单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="makeNo" th:field="*{makeNo}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">出库状态:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="warehouseOutStatus" class="form-control m-b" th:with="type=${@dict.getType('warehouse_out_status')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseOutStatus}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">关联订单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="relatedOrderCode" th:field="*{relatedOrderCode}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">关联销售订单编号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="salesOrderCode" th:field="*{salesOrderCode}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">订单类型:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="warehouseOrderType" class="form-control m-b" th:with="type=${@dict.getType('warehouse_order_type')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseOrderType}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">出库类型:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="warehouseOutType" class="form-control m-b" th:with="type=${@dict.getType('warehouse_out_type')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseOutType}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">业务人员:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="businessName" th:field="*{businessName}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">售后人员:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="aftersalesName" th:field="*{aftersalesName}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">仓库员:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="warehouseName" th:field="*{warehouseName}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">出货设备id:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="shippingDeviceId" th:field="*{shippingDeviceId}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">料号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="materialNo" th:field="*{materialNo}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">物料名称:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="materialName" th:field="*{materialName}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">物料合计:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="materialSum" th:field="*{materialSum}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">数量合计:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="enterpriseSum" th:field="*{enterpriseSum}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">出库数:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="outOrderSum" th:field="*{outOrderSum}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">出库对象:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="outOrderName" th:field="*{outOrderName}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">出库时间:</label> |
|||
<div class="col-sm-8"> |
|||
<div class="input-group date"> |
|||
<input name="outOrderTime" th:value="${#dates.format(warehouseOutOrder.outOrderTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text"> |
|||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">客户ID:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="customerId" th:field="*{customerId}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">客户名称:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="customerName" th:field="*{customerName}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">申请人员:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="applyName" th:field="*{applyName}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">计划交付时间:</label> |
|||
<div class="col-sm-8"> |
|||
<div class="input-group date"> |
|||
<input name="planDeliveryTime" th:value="${#dates.format(warehouseOutOrder.planDeliveryTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text"> |
|||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">交付条件:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deliveryCondition" th:field="*{deliveryCondition}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">收货地址:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deliveryAddress" th:field="*{deliveryAddress}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">联系人:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deliveryName" th:field="*{deliveryName}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">联系电话:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deliveryNumber" th:field="*{deliveryNumber}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "aftersales/warehouseOutOrder"; |
|||
$("#form-warehouseOutOrder-edit").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/edit", $('#form-warehouseOutOrder-edit').serialize()); |
|||
} |
|||
} |
|||
|
|||
$("input[name='outOrderTime']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true |
|||
}); |
|||
|
|||
$("input[name='planDeliveryTime']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true |
|||
}); |
|||
</script> |
|||
</body> |
|||
</html> |
@ -1,357 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('售后维护设备1')" /> |
|||
<th:block th:include="include :: datetimepicker-css" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-maintenanceEquipmentOne-edit" th:object="${warehouseOutOrder}"> |
|||
<input name="outOrderId" th:field="*{outOrderId}" type="hidden"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">出库单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="outOrderCode" th:field="*{outOrderCode}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">出库对象:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="outOrderName" th:field="*{outOrderName}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">销售单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="salesOrderCode" th:field="*{salesOrderCode}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">申请人员:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="applyName" th:field="*{applyName}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">生产单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="makeNo" th:field="*{makeNo}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">客户ID:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="customerId" th:field="*{customerId}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">客户名称:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="customerName" th:field="*{customerName}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">收货联系人:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deliveryName" th:field="*{deliveryName}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">收货电话:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deliveryNumber" th:field="*{deliveryNumber}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">收货地址:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deliveryAddress" th:field="*{deliveryAddress}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<h3 class="mb-4">物料信息</h3> |
|||
<table id="bootstrap-table"></table> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<!--用于可以修改列表字段的插件--> |
|||
<th:block th:include="include :: bootstrap-table-editable-js" /> |
|||
<script th:inline="javascript"> |
|||
var addFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:addShippingDevices')}]]; |
|||
|
|||
var prefix = ctx + "aftersales/warehouseOutOrder"; |
|||
var warehouseOutOrder = [[${warehouseOutOrder}]]; |
|||
|
|||
$("#form-maintenanceEquipmentOne-edit").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
// function submitHandler() { |
|||
// if ($.validate.form()) { |
|||
// $.operate.save(prefix + "/maintenanceEquipmentOne", $('#form-maintenanceEquipmentOne-edit').serialize()); |
|||
// } |
|||
// } |
|||
|
|||
|
|||
function submitHandler() { |
|||
// 获取表单数据 |
|||
const shippingDevicesData = $("#form-maintenanceEquipmentOne-edit").serializeArray().reduce((obj, item) => { |
|||
obj[item.name] = item.value; |
|||
return obj; |
|||
}, {}); |
|||
|
|||
// 在需要收集所有子表数据的地方调用此函数 |
|||
var allSubData = getAllSubTablesData(); |
|||
|
|||
// 将表数据转换成与complaintNoticeData格式一致的数组 |
|||
var equipDetailDataList = allSubData.map(function(item) { |
|||
// 根据实际字段名调整 |
|||
return { |
|||
"shippingDeviceId": item.shippingDeviceId, |
|||
"deviceModelCode": item.deviceModelCode, |
|||
"deviceRunningNumber": item.deviceRunningNumber, |
|||
"makePhotoUrl": item.makePhotoUrl, |
|||
"snCode": item.snCode |
|||
// ...其他字段 |
|||
}; |
|||
}); |
|||
|
|||
// 合并表单数据和表格数据 |
|||
const combinedData = Object.assign({}, shippingDevicesData, { selectShippingDeviceVOList: equipDetailDataList }); |
|||
|
|||
console.log(combinedData) |
|||
// 使用 JSON.stringify() 序列化数据 |
|||
const jsonData = JSON.stringify(combinedData); |
|||
// 发送 AJAX 请求到后端接口 |
|||
$.operate.saveJson(prefix + "/maintenanceEquipmentOne", jsonData); |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
$("input[name='outOrderTime']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true |
|||
}); |
|||
|
|||
$("input[name='planDeliveryTime']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true |
|||
}); |
|||
|
|||
|
|||
$(function() { |
|||
var options = { |
|||
id:'bootstrap-table', |
|||
url: prefix + "/getMaintenanceEquipmentOneMaterials", |
|||
modalName: "物料信息", |
|||
showColumns: false, |
|||
pagination: false, |
|||
showToggle: false, |
|||
showRefresh:false, |
|||
showSearch:false, |
|||
queryParams:queryParams, |
|||
detailView: true, |
|||
onExpandRow : function(index, row, $detail) { |
|||
initChildTable(index, row, $detail); |
|||
}, |
|||
columns: [{ |
|||
checkbox: true |
|||
}, |
|||
|
|||
{ title:'销售订单号', |
|||
field:'quoteId', |
|||
visible: false |
|||
}, |
|||
{ |
|||
title:'出库单详情Id', |
|||
field:'outOrderDetailId', |
|||
visible: false |
|||
|
|||
}, |
|||
{ |
|||
title: '料号', |
|||
field: 'materialNo', |
|||
}, |
|||
{ |
|||
title: '图片', |
|||
field: 'photoUrl', |
|||
}, |
|||
{ |
|||
title: '物料名称', |
|||
field: 'materialName', |
|||
}, |
|||
{ |
|||
title: '物料类型', |
|||
field: 'materialType', |
|||
}, |
|||
{ |
|||
title: '单位', |
|||
field: 'materialUnit', |
|||
}, |
|||
{ |
|||
title: '品牌', |
|||
field: 'brand', |
|||
}, |
|||
{ |
|||
title: '描述', |
|||
field: 'describe', |
|||
}, |
|||
{ |
|||
title: '订单数量', |
|||
field: 'makeNum', |
|||
}, |
|||
{ |
|||
title: '已出库数', |
|||
field: 'hasOutOrderSum', |
|||
}, |
|||
{ |
|||
title: '申请出库数', |
|||
field: 'applyOutOrderSum', |
|||
}, |
|||
{ |
|||
title: '准备出库数', |
|||
field: 'prepareOutOrderSum', |
|||
}, |
|||
{ |
|||
title: '操作', |
|||
align: 'center', |
|||
formatter: function(value, row, index) { |
|||
var actions = []; |
|||
actions.push('<a class="btn btn-success btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="addShippingDevicesOne(\'' + row.outOrderDetailId + '\')"><i class="fa fa-add"></i>添加出货设备</a>'); |
|||
return actions.join(''); |
|||
} |
|||
} |
|||
] |
|||
}; |
|||
$.table.init(options); |
|||
}) |
|||
|
|||
|
|||
initChildTable = function(index, row, $detail) { |
|||
var parentRow = row; |
|||
var childTableId = 'child_table_'+index; |
|||
$detail.html('<table id="'+childTableId+'"></table>'); |
|||
$('#'+childTableId).bootstrapTable({ |
|||
url: prefix + "/showAftersalesShippingDeviceListOne", |
|||
method: 'post', |
|||
sidePagination: "server", |
|||
contentType: "application/x-www-form-urlencoded", |
|||
queryParams : { |
|||
// salesOrderCode: warehouseOutOrder.salesOrderCode, |
|||
materialNo: parentRow.materialNo, |
|||
salesOrderCode:warehouseOutOrder.salesOrderCode, |
|||
makeNo:warehouseOutOrder.makeNo |
|||
}, |
|||
columns: [ |
|||
{ |
|||
title: '出货设备ID', |
|||
field: 'shippingDeviceId', |
|||
}, |
|||
{ |
|||
title: '设备型号', |
|||
field: 'deviceModelCode', |
|||
}, |
|||
{ |
|||
title: '流水号', |
|||
field: 'deviceRunningNumber', |
|||
}, |
|||
{ |
|||
title: '设备SN号', |
|||
field: 'snCode', |
|||
editable:true |
|||
}, |
|||
{ |
|||
title: '操作', |
|||
align: 'center', |
|||
formatter: function (value, row, index) { |
|||
return '<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="deleteRow(\'' + row.shippingDeviceId + '\')"><i class="fa fa-remove"></i>删除</a>'; |
|||
} |
|||
} |
|||
], |
|||
}); |
|||
}; |
|||
|
|||
|
|||
function queryParams(params) { |
|||
var curParams = { |
|||
// 传递参数查询参数 |
|||
outOrderCode: warehouseOutOrder.outOrderCode |
|||
}; |
|||
return curParams; |
|||
} |
|||
|
|||
|
|||
// 获取所有子表数据的函数 |
|||
// 获取所有子表数据的函数 |
|||
function getAllSubTablesData() { |
|||
var allSubData = []; |
|||
// 获取所有被展开的行 |
|||
var parentLength = $("#bootstrap-table").bootstrapTable("getData").length; |
|||
for (let i = 0; i < parentLength; i++) { |
|||
var sonData = $('#'+"child_table_" + i).bootstrapTable("getData"); |
|||
//循环获取子表中存在的行数据,每个行数据转换添加到allSubData数组中 |
|||
allSubData = allSubData.concat(sonData); |
|||
} |
|||
return allSubData; |
|||
} |
|||
|
|||
|
|||
function deleteRow(shippingDeviceId) { |
|||
// 弹出确认框询问用户是否确定删除 |
|||
if (confirm("确定要删除这条记录吗?")) { |
|||
// 发送删除请求到服务器 |
|||
$.ajax({ |
|||
url: prefix + "/deleteRow", // 请根据实际API路径调整 |
|||
type: 'POST', |
|||
data: { |
|||
shippingDeviceId: shippingDeviceId, // 传递需要删除的记录的ID |
|||
}, |
|||
success: function(result) { |
|||
if (result.success) { // 假设result是一个对象,包含success属性来表示操作是否成功 |
|||
// 删除操作成功,从表格中移除这一行 |
|||
$('#child_table_' + index).bootstrapTable('remove', { |
|||
field: 'shippingDeviceId', |
|||
values: [shippingDeviceId] |
|||
}); |
|||
toastr.success("删除成功!"); // 显示成功提示信息,这里使用toastr作为示例,确保已引入相关库 |
|||
} else { |
|||
toastr.error("删除失败: " + result.message); // 显示失败原因,同样确保已引入toastr库 |
|||
} |
|||
}, |
|||
error: function() { |
|||
toastr.error("发生错误,删除失败!"); // 网络错误或后端错误处理 |
|||
} |
|||
}); |
|||
} |
|||
}; |
|||
|
|||
|
|||
|
|||
/*添加出货设备*/ |
|||
// function addShippingDevicesOne(quoteId, materialCode) { |
|||
// // 确保URL编码,特别是如果materialCode中可能含有特殊字符 |
|||
// var url = ctx + 'aftersales/warehouseOutOrder/addShippingDevicesOne/' + encodeURIComponent(quoteId) + '/' + encodeURIComponent(materialCode); |
|||
// $.modal.open("添加出货设备", url); |
|||
// } |
|||
|
|||
function addShippingDevicesOne(outOrderDetailId) { |
|||
var salesOrderCode = [[${warehouseOutOrder.salesOrderCode}]]; |
|||
var makeNo = [[${warehouseOutOrder.makeNo}]]; |
|||
var queryParams = new URLSearchParams(); |
|||
queryParams.append('outOrderDetailId', outOrderDetailId); |
|||
queryParams.append('salesOrderCode', encodeURIComponent(salesOrderCode)); |
|||
queryParams.append('makeNo',encodeURIComponent(makeNo)); |
|||
var url = prefix + '/addShippingDevicesOne?' + queryParams.toString(); |
|||
$.modal.open("添加出货设备", url); |
|||
} |
|||
|
|||
|
|||
</script> |
|||
</body> |
|||
</html> |
@ -1,407 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('售后维护设备2')" /> |
|||
<th:block th:include="include :: datetimepicker-css" /> |
|||
<th:block th:include="include :: bootstrap-editable-css" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-maintenanceEquipmentTwo-edit" th:object="${warehouseOutOrder}"> |
|||
<input name="outOrderId" th:field="*{outOrderId}" type="hidden"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">出库单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="outOrderCode" th:field="*{outOrderCode}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">出库对象:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="outOrderName" th:field="*{outOrderName}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">销售单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="salesOrderCode" th:field="*{salesOrderCode}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">申请人员:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="applyName" th:field="*{applyName}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">生产单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="makeNo" th:field="*{makeNo}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">送货日期:</label> |
|||
<div class="col-sm-8"> |
|||
<div class="input-group date"> |
|||
<input name="deliveryDate" th:value="${#dates.format(warehouseOutOrder.deliveryDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text"> |
|||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">客户ID:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="customerId" th:field="*{customerId}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">客户名称:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="customerName" th:field="*{customerName}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">收货联系人:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deliveryName" th:field="*{deliveryName}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">收货电话:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deliveryNumber" th:field="*{deliveryNumber}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">收货地址:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deliveryAddress" th:field="*{deliveryAddress}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<h3 class="mb-4">物料信息</h3> |
|||
<table id="bootstrap-table"></table> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<!--用于可以修改列表字段的插件--> |
|||
<th:block th:include="include :: bootstrap-table-editable-js" /> |
|||
<script th:inline="javascript"> |
|||
var addFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:addShippingDevices')}]]; |
|||
|
|||
var prefix = ctx + "aftersales/warehouseOutOrder"; |
|||
var warehouseOutOrder = [[${warehouseOutOrder}]]; |
|||
|
|||
$("#form-maintenanceEquipmentTwo-edit").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
$("input[name='deliveryDate']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
// 获取表单数据 |
|||
const shippingDevicesData = $("#form-maintenanceEquipmentTwo-edit").serializeArray().reduce((obj, item) => { |
|||
obj[item.name] = item.value; |
|||
return obj; |
|||
}, {}); |
|||
|
|||
// 在需要收集所有子表数据的地方调用此函数 |
|||
var allSubData = getAllSubTablesData(); |
|||
|
|||
// 将表数据转换成与complaintNoticeData格式一致的数组 |
|||
var equipDetailDataList = allSubData.map(function(item) { |
|||
// 根据实际字段名调整 |
|||
return { |
|||
"shippingDeviceId": item.shippingDeviceId, |
|||
"deviceModelCode": item.deviceModelCode, |
|||
"deviceRunningNumber": item.deviceRunningNumber, |
|||
"makePhotoUrl": item.makePhotoUrl, |
|||
"snCode": item.snCode, |
|||
"factoryDate": item.factoryDate, |
|||
"guaranteePeriod": item.guaranteePeriod, |
|||
"lockDateFlag": item.lockDateFlag, |
|||
"lockDate": item.lockDate, |
|||
"wastageExpireDate": item.wastageExpireDate, |
|||
"componentGuaranteeDate": item.componentGuaranteeDate |
|||
// ...其他字段 |
|||
}; |
|||
}); |
|||
|
|||
// 合并表单数据和表格数据 |
|||
const combinedData = Object.assign({}, shippingDevicesData, { selectShippingDeviceVOList: equipDetailDataList }); |
|||
|
|||
console.log(combinedData) |
|||
// 使用 JSON.stringify() 序列化数据 |
|||
const jsonData = JSON.stringify(combinedData); |
|||
// 发送 AJAX 请求到后端接口 |
|||
$.operate.saveJson(prefix + "/maintenanceEquipmentTwo", jsonData); |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
$("input[name='outOrderTime']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true |
|||
}); |
|||
|
|||
$("input[name='planDeliveryTime']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true |
|||
}); |
|||
|
|||
|
|||
$(function() { |
|||
var options = { |
|||
id:'bootstrap-table', |
|||
url: prefix + "/getMaintenanceEquipmentTwoMaterials", |
|||
modalName: "物料信息", |
|||
showColumns: false, |
|||
pagination: false, |
|||
showToggle: false, |
|||
showRefresh:false, |
|||
showSearch:false, |
|||
queryParams:queryParams, |
|||
detailView: true, |
|||
onExpandRow : function(index, row, $detail) { |
|||
initChildTable(index, row, $detail); |
|||
}, |
|||
columns: [{ |
|||
checkbox: true |
|||
}, |
|||
|
|||
{ title:'销售订单号', |
|||
field:'quoteId', |
|||
visible: false |
|||
}, |
|||
{ |
|||
title:'出库单详情Id', |
|||
field:'outOrderDetailId', |
|||
visible: false |
|||
|
|||
}, |
|||
{ |
|||
title: '料号', |
|||
field: 'materialNo', |
|||
}, |
|||
{ |
|||
title: '图片', |
|||
field: 'photoUrl', |
|||
}, |
|||
{ |
|||
title: '物料名称', |
|||
field: 'materialName', |
|||
}, |
|||
{ |
|||
title: '物料类型', |
|||
field: 'materialType', |
|||
}, |
|||
{ |
|||
title: '单位', |
|||
field: 'materialUnit', |
|||
}, |
|||
{ |
|||
title: '品牌', |
|||
field: 'brand', |
|||
}, |
|||
{ |
|||
title: '描述', |
|||
field: 'describe', |
|||
}, |
|||
{ |
|||
title: '订单数量', |
|||
field: 'makeNum', |
|||
}, |
|||
{ |
|||
title: '已出库数', |
|||
field: 'hasOutOrderSum', |
|||
}, |
|||
{ |
|||
title: '申请出库数', |
|||
field: 'applyOutOrderSum', |
|||
}, |
|||
{ |
|||
title: '准备出库数', |
|||
field: 'prepareOutOrderSum', |
|||
}, |
|||
] |
|||
}; |
|||
$.table.init(options); |
|||
}) |
|||
|
|||
|
|||
initChildTable = function(index, row, $detail) { |
|||
var parentRow = row; |
|||
var childTableId = 'child_table_'+index; |
|||
$detail.html('<table id="'+childTableId+'"></table>'); |
|||
$('#'+childTableId).bootstrapTable({ |
|||
url: prefix + "/showAftersalesShippingDeviceListTwo", |
|||
method: 'post', |
|||
sidePagination: "server", |
|||
contentType: "application/x-www-form-urlencoded", |
|||
queryParams : { |
|||
// salesOrderCode: warehouseOutOrder.salesOrderCode, |
|||
materialNo: parentRow.materialNo, |
|||
salesOrderCode:warehouseOutOrder.salesOrderCode, |
|||
makeNo:warehouseOutOrder.makeNo |
|||
}, |
|||
columns: [ |
|||
{ |
|||
title: '出货设备ID', |
|||
field: 'shippingDeviceId', |
|||
}, |
|||
{ |
|||
title: '设备型号', |
|||
field: 'deviceModelCode', |
|||
}, |
|||
{ |
|||
title: '流水号', |
|||
field: 'deviceRunningNumber', |
|||
}, |
|||
{ |
|||
title: '设备SN号', |
|||
field: 'snCode', |
|||
align: 'center', |
|||
editable:true |
|||
}, |
|||
{ |
|||
title: '出库日期', |
|||
field: 'factoryDate', |
|||
align: 'center', |
|||
editable:{ |
|||
type:'date', |
|||
title: '出库日期', |
|||
clear: false,//隐藏clear按钮 |
|||
placement: 'center',//居中显示 |
|||
} |
|||
}, |
|||
{ |
|||
title: '保修期', |
|||
field: 'guaranteePeriod', |
|||
align: 'center', |
|||
editable:true |
|||
}, |
|||
{ |
|||
title: '是否有锁机时间', |
|||
field: 'lockDateFlag', |
|||
align: 'center', |
|||
editable: { |
|||
type: 'select', |
|||
title: '是否有锁机时间', |
|||
source:[{value:"0",text:"是"},{value:"1",text:"否"}] |
|||
} |
|||
}, |
|||
{ |
|||
title: '锁机时间', |
|||
field: 'lockDate', |
|||
align: 'center', |
|||
editable:{ |
|||
type:'date', |
|||
title: '锁机时间', |
|||
clear: false,//隐藏clear按钮 |
|||
placement: 'center',//居中显示 |
|||
} |
|||
}, |
|||
{ |
|||
title: '损耗品到期时间', |
|||
field: 'wastageExpireDate', |
|||
align: 'center', |
|||
editable:{ |
|||
type:'date', |
|||
title: '损耗品到期时间', |
|||
clear: false,//隐藏clear按钮 |
|||
placement: 'center',//居中显示 |
|||
} |
|||
}, |
|||
{ |
|||
title: '二次维修后部件质保时间', |
|||
field: 'componentGuaranteeDate', |
|||
align: 'center', |
|||
editable:{ |
|||
type:'date', |
|||
title: '二次维修后部件质保时间', |
|||
clear: false,//隐藏clear按钮 |
|||
placement: 'center',//居中显示 |
|||
} |
|||
}, |
|||
{ |
|||
title: '操作', |
|||
align: 'center', |
|||
formatter: function (value, row, index) { |
|||
return '<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="deleteRow(\'' + row.shippingDeviceId + '\')"><i class="fa fa-remove"></i>删除</a>'; |
|||
} |
|||
} |
|||
], |
|||
}); |
|||
}; |
|||
|
|||
|
|||
function queryParams(params) { |
|||
var curParams = { |
|||
// 传递参数查询参数 |
|||
outOrderCode: warehouseOutOrder.outOrderCode |
|||
}; |
|||
return curParams; |
|||
} |
|||
|
|||
|
|||
// 获取所有子表数据的函数 |
|||
// 获取所有子表数据的函数 |
|||
function getAllSubTablesData() { |
|||
var allSubData = []; |
|||
// 获取所有被展开的行 |
|||
var parentLength = $("#bootstrap-table").bootstrapTable("getData").length; |
|||
for (let i = 0; i < parentLength; i++) { |
|||
var sonData = $('#'+"child_table_" + i).bootstrapTable("getData"); |
|||
//循环获取子表中存在的行数据,每个行数据转换添加到allSubData数组中 |
|||
allSubData = allSubData.concat(sonData); |
|||
} |
|||
return allSubData; |
|||
} |
|||
|
|||
|
|||
function deleteRow(shippingDeviceId) { |
|||
// 弹出确认框询问用户是否确定删除 |
|||
if (confirm("确定要删除这条记录吗?")) { |
|||
// 发送删除请求到服务器 |
|||
$.ajax({ |
|||
url: prefix + "/deleteRow", // 请根据实际API路径调整 |
|||
type: 'POST', |
|||
data: { |
|||
shippingDeviceId: shippingDeviceId, // 传递需要删除的记录的ID |
|||
}, |
|||
success: function(result) { |
|||
if (result.success) { // 假设result是一个对象,包含success属性来表示操作是否成功 |
|||
// 删除操作成功,从表格中移除这一行 |
|||
$('#child_table_' + index).bootstrapTable('remove', { |
|||
field: 'shippingDeviceId', |
|||
values: [shippingDeviceId] |
|||
}); |
|||
toastr.success("删除成功!"); // 显示成功提示信息,这里使用toastr作为示例,确保已引入相关库 |
|||
} else { |
|||
toastr.error("删除失败: " + result.message); // 显示失败原因,同样确保已引入toastr库 |
|||
} |
|||
}, |
|||
error: function() { |
|||
toastr.error("发生错误,删除失败!"); // 网络错误或后端错误处理 |
|||
} |
|||
}); |
|||
} |
|||
}; |
|||
|
|||
|
|||
|
|||
</script> |
|||
</body> |
|||
</html> |
@ -1,294 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> |
|||
<head> |
|||
<th:block th:include="include :: header('出库单列表')" /> |
|||
</head> |
|||
<body class="gray-bg"> |
|||
<div class="container-div"> |
|||
<div class="row"> |
|||
<div class="col-sm-12 search-collapse"> |
|||
<form id="formId"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
<label>出库单号:</label> |
|||
<input type="text" name="outOrderCode"/> |
|||
</li> |
|||
<li> |
|||
<label>出库状态:</label> |
|||
<select name="warehouseOutStatus" th:with="type=${@dict.getType('warehouse_out_status')}"> |
|||
<option value="">所有</option> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</li> |
|||
<li> |
|||
<label>关联订单号:</label> |
|||
<input type="text" name="relatedOrderCode"/> |
|||
</li> |
|||
<li> |
|||
<label>申请人员:</label> |
|||
<input type="text" name="applyName"/> |
|||
</li> |
|||
<li> |
|||
<label>仓库员:</label> |
|||
<input type="text" name="warehouseName"/> |
|||
</li> |
|||
<li> |
|||
<label>订单类型:</label> |
|||
<select name="warehouseOrderType" th:with="type=${@dict.getType('warehouse_order_type')}"> |
|||
<option value="">所有</option> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</li> |
|||
<li class="select-time"> |
|||
<label>录入时间:</label> |
|||
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/> |
|||
<span>-</span> |
|||
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/> |
|||
</li> |
|||
<li> |
|||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a> |
|||
</li> |
|||
</ul> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="bootstrap-table"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<script th:inline="javascript"> |
|||
var editFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:edit')}]]; |
|||
var detailFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:detail')}]]; |
|||
var removeFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:remove')}]]; |
|||
var maintenanceEquipmentOneFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:maintenanceEquipmentOne')}]]; |
|||
|
|||
var maintenanceEquipmentTwoFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:maintenanceEquipmentTwo')}]]; |
|||
var confirmReceivingGoodsFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:confirmReceivingGoods')}]]; |
|||
var confirmCheckGoodsFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:confirmCheckGoods')}]]; |
|||
|
|||
var warehouseOutStatusDatas = [[${@dict.getType('warehouse_out_status')}]]; |
|||
var warehouseOrderTypeDatas = [[${@dict.getType('warehouse_order_type')}]]; |
|||
var warehouseOutTypeDatas = [[${@dict.getType('warehouse_out_type')}]]; |
|||
var prefix = ctx + "aftersales/warehouseOutOrder"; |
|||
|
|||
$(function() { |
|||
var options = { |
|||
url: prefix + "/list", |
|||
createUrl: prefix + "/add", |
|||
updateUrl: prefix + "/edit/{id}", |
|||
removeUrl: prefix + "/remove", |
|||
cancelUrl: prefix + "/cancel/{id}", |
|||
restoreUrl: prefix + "/restore/{id}", |
|||
exportUrl: prefix + "/export", |
|||
modalName: "出库单", |
|||
columns: [{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
title: '出库单Id', |
|||
field: 'outOrderId', |
|||
visible: false |
|||
}, |
|||
{ |
|||
title: '出库单号', |
|||
field: 'outOrderCode', |
|||
}, |
|||
{ |
|||
title: '出库状态', |
|||
field: 'warehouseOutStatus', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectDictLabel(warehouseOutStatusDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
title: '关联订单号', |
|||
field: 'relatedOrderCode', |
|||
}, |
|||
{ |
|||
title: '订单类型', |
|||
field: 'warehouseOrderType', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectDictLabel(warehouseOrderTypeDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
title: '业务人', |
|||
field: 'businessName', |
|||
}, |
|||
{ |
|||
title: '物料合计', |
|||
field: 'materialSum', |
|||
}, |
|||
{ |
|||
title: '数量合计', |
|||
field: 'enterpriseSum', |
|||
}, |
|||
{ |
|||
title: '计划交付时间', |
|||
field: 'planDeliveryTime', |
|||
}, |
|||
{ |
|||
title: '交付条件', |
|||
field: 'deliveryCondition', |
|||
}, |
|||
{ |
|||
title: '联系人', |
|||
field: 'deliveryName', |
|||
}, |
|||
{ |
|||
title: '联系电话', |
|||
field: 'deliveryNumber', |
|||
}, |
|||
{ |
|||
title: '收货地址', |
|||
field: 'deliveryAddress', |
|||
}, |
|||
{ |
|||
title: '录入时间', |
|||
field: 'createTime', |
|||
}, |
|||
{ |
|||
title: '出库时间', |
|||
field: 'outOrderTime', |
|||
}, |
|||
{ |
|||
title: '仓库员', |
|||
field: 'warehouseName', |
|||
}, |
|||
{ |
|||
title: '售后员', |
|||
field: 'aftersalesName', |
|||
}, |
|||
{ |
|||
title: '更新人', |
|||
field: 'updateBy', |
|||
}, |
|||
{ |
|||
title: '上次更新时间', |
|||
field: 'updateTime', |
|||
}, |
|||
{ |
|||
title: '操作', |
|||
align: 'center', |
|||
formatter: function(value, row, index) { |
|||
var actions = []; |
|||
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.outOrderId + '\')"><i class="fa fa-edit"></i>编辑</a> '); |
|||
actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="detail(\'' + row.outOrderId + '\')"><i class="fa fa-edit"></i>详情</a> '); |
|||
if (row.warehouseOutStatus== "1"){ |
|||
actions.push('<a class="btn btn-success btn-xs ' + maintenanceEquipmentOneFlag + '" href="javascript:void(0)" onclick="maintenanceEquipmentOne(\'' + row.outOrderId + '\')"><i class="fa fa-edit"></i>维护设备</a> '); |
|||
} |
|||
if (row.warehouseOutStatus== "3"){ |
|||
actions.push('<a class="btn btn-success btn-xs ' + maintenanceEquipmentTwoFlag + '" href="javascript:void(0)" onclick="maintenanceEquipmentTwo(\'' + row.outOrderId + '\')"><i class="fa fa-edit"></i>维护设备</a> '); |
|||
} |
|||
if (row.warehouseOutStatus=="7"){ |
|||
actions.push('<a class="btn btn-success btn-xs ' + confirmReceivingGoodsFlag + '" href="javascript:void(0)" onclick="confirmReceivingGoods(\'' + row.outOrderId + '\')"><i class="fa fa-edit"></i>确认收货</a> '); |
|||
} |
|||
// if (row.warehouseOutStatus=="10"){ |
|||
// actions.push('<a class="btn btn-success btn-xs ' + confirmCheckGoodsFlag + '" href="javascript:void(0)" onclick="confirmCheckGoods(\'' + row.outOrderId + '\')"><i class="fa fa-edit"></i>确认验收</a> '); |
|||
// } |
|||
return actions.join(''); |
|||
} |
|||
}] |
|||
}; |
|||
$.table.init(options); |
|||
}); |
|||
|
|||
/*详情*/ |
|||
function detail(outOrderId) { |
|||
var url = ctx + 'aftersales/warehouseOutOrder/detail/'+outOrderId; |
|||
$.modal.open("详情",url); |
|||
} |
|||
|
|||
/*售后第一次维护设备*/ |
|||
function maintenanceEquipmentOne(outOrderId) { |
|||
var url = ctx + 'aftersales/warehouseOutOrder/maintenanceEquipmentOne/'+outOrderId; |
|||
$.modal.open("售后第一次维护设备",url); |
|||
} |
|||
|
|||
|
|||
/*售后第二次维护设备*/ |
|||
function maintenanceEquipmentTwo(outOrderId) { |
|||
var url = ctx + 'aftersales/warehouseOutOrder/maintenanceEquipmentTwo/'+outOrderId; |
|||
$.modal.open("售后第二次维护设备",url); |
|||
} |
|||
|
|||
//确认收货 |
|||
function confirmReceivingGoods(outOrderId) { |
|||
// 使用layer.confirm替代alert,以实现确认功能 |
|||
layer.confirm("确定要收货吗?", { |
|||
title: "系统提示", |
|||
btn: ['确定', '取消'], // 自定义按钮文本 |
|||
yes: function(index, layero) { |
|||
// 用户点击确定后的操作 |
|||
$.ajax({ |
|||
url: prefix + '/confirmReceivingGoods/' + outOrderId, |
|||
type: 'GET', |
|||
dataType: 'json', |
|||
success: function(data) { |
|||
if (data.code == web_status.SUCCESS) { |
|||
// 成功后提示 |
|||
layer.close(index); // 关闭当前confirm对话框 |
|||
$.modal.alert("收货成功。"); |
|||
$('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格 |
|||
} else { |
|||
layer.close(index); // 关闭当前confirm对话框 |
|||
$.modal.alertError(data.msg); |
|||
} |
|||
}, |
|||
error: function(error) { |
|||
layer.close(index); // 关闭当前confirm对话框 |
|||
$.modal.alertError("收货失败。"); |
|||
} |
|||
}); |
|||
}, |
|||
cancel: function(index, layero) { |
|||
// 用户点击取消的操作,通常无需处理,直接关闭对话框即可 |
|||
layer.close(index); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
//确认验收 |
|||
function confirmCheckGoods(outOrderId) { |
|||
// 使用layer.confirm替代alert,以实现确认功能 |
|||
layer.confirm("确定要验收吗?", { |
|||
title: "系统提示", |
|||
btn: ['确定', '取消'], // 自定义按钮文本 |
|||
yes: function(index, layero) { |
|||
// 用户点击确定后的操作 |
|||
$.ajax({ |
|||
url: prefix + '/confirmCheckGoods/' + outOrderId, |
|||
type: 'GET', |
|||
dataType: 'json', |
|||
success: function(data) { |
|||
if (data.code == web_status.SUCCESS) { |
|||
// 成功后提示 |
|||
layer.close(index); // 关闭当前confirm对话框 |
|||
$.modal.alert("验收成功。"); |
|||
$('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格 |
|||
} else { |
|||
layer.close(index); // 关闭当前confirm对话框 |
|||
$.modal.alertError(data.msg); |
|||
} |
|||
}, |
|||
error: function(error) { |
|||
layer.close(index); // 关闭当前confirm对话框 |
|||
$.modal.alertError("验收失败。"); |
|||
} |
|||
}); |
|||
}, |
|||
cancel: function(index, layero) { |
|||
// 用户点击取消的操作,通常无需处理,直接关闭对话框即可 |
|||
layer.close(index); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
|
|||
</script> |
|||
</body> |
|||
</html> |
Loading…
Reference in new issue