diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AfterSalesShippingDeviceController.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AfterSalesShippingDeviceController.java index 408ac130..10631c98 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AfterSalesShippingDeviceController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AfterSalesShippingDeviceController.java @@ -164,17 +164,6 @@ public class AfterSalesShippingDeviceController extends BaseController } - /** - * 删除出货设备 - */ - @RequiresPermissions("aftersales:shippingDevice:remove") - @Log(title = "出货设备", businessType = BusinessType.DELETE) - @PostMapping( "/remove") - @ResponseBody - public AjaxResult remove(String ids) - { - return toAjax(afterSalesShippingDeviceService.deleteAfterSalesShippingDeviceByIds(ids)); - } /** * 作废出货设备 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesWarehouseOutController.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesWarehouseOutController.java index a11d8b61..96723c52 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesWarehouseOutController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesWarehouseOutController.java @@ -5,6 +5,8 @@ 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; @@ -23,7 +25,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; /** - * 出库单Controller + * 售后维护设备出库Controller * * @author 刘晓旭 * @date 2024-04-23 @@ -37,6 +39,10 @@ public class AftersalesWarehouseOutController extends BaseController @Autowired private IAftersalesWarehouseOutService warehouseOutOrderService; + @Autowired + private IWarehouseOutOrderDetailService outOrderDetailService; + + @RequiresPermissions("aftersales:warehouseOutOrder:view") @GetMapping() public String warehouseOutOrder() @@ -45,7 +51,7 @@ public class AftersalesWarehouseOutController extends BaseController } /** - * 查询出库单列表 + * 查询售后维护设备出库列表 */ @RequiresPermissions("aftersales:warehouseOutOrder:list") @PostMapping("/list") @@ -53,26 +59,26 @@ public class AftersalesWarehouseOutController extends BaseController public TableDataInfo list(WarehouseOutOrder warehouseOutOrder) { startPage(); - List list = warehouseOutOrderService.selectWarehouseOutOrderList(warehouseOutOrder); + List list = warehouseOutOrderService.selectAftersalesWarehouseOutOrderList(warehouseOutOrder); return getDataTable(list); } /** - * 导出出库单列表 + * 导出售后维护设备出库列表 */ @RequiresPermissions("aftersales:warehouseOutOrder:export") - @Log(title = "出库单", businessType = BusinessType.EXPORT) + @Log(title = "售后维护设备出库", businessType = BusinessType.EXPORT) @PostMapping("/export") @ResponseBody public AjaxResult export(WarehouseOutOrder warehouseOutOrder) { - List list = warehouseOutOrderService.selectWarehouseOutOrderList(warehouseOutOrder); + List list = warehouseOutOrderService.selectAftersalesWarehouseOutOrderList(warehouseOutOrder); ExcelUtil util = new ExcelUtil(WarehouseOutOrder.class); - return util.exportExcel(list, "出库单数据"); + return util.exportExcel(list, "售后维护设备出库数据"); } /** - * 新增出库单 + * 新增售后维护设备出库 */ @GetMapping("/add") public String add() @@ -81,10 +87,10 @@ public class AftersalesWarehouseOutController extends BaseController } /** - * 新增保存出库单 + * 新增保存售后维护设备出库 */ @RequiresPermissions("aftersales:warehouseOutOrder:add") - @Log(title = "出库单", businessType = BusinessType.INSERT) + @Log(title = "售后维护设备出库", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody public AjaxResult addSave(WarehouseOutOrder warehouseOutOrder) @@ -93,7 +99,7 @@ public class AftersalesWarehouseOutController extends BaseController } /** - * 修改出库单 + * 修改售后维护设备出库 */ @GetMapping("/edit/{outOrderId}") public String edit(@PathVariable("outOrderId") Long outOrderId, ModelMap mmap) @@ -104,10 +110,10 @@ public class AftersalesWarehouseOutController extends BaseController } /** - * 修改保存出库单 + * 修改保存售后维护设备出库 */ @RequiresPermissions("aftersales:warehouseOutOrder:edit") - @Log(title = "出库单", businessType = BusinessType.UPDATE) + @Log(title = "售后维护设备出库", businessType = BusinessType.UPDATE) @PostMapping("/edit") @ResponseBody public AjaxResult editSave(WarehouseOutOrder warehouseOutOrder) @@ -116,7 +122,7 @@ public class AftersalesWarehouseOutController extends BaseController } /** - * 查看出库单详情 + * 查看售后维护设备出库详情 */ @GetMapping("/detail/{outOrderId}") public String detail(@PathVariable("outOrderId") Long outOrderId, ModelMap mmap) @@ -127,10 +133,10 @@ public class AftersalesWarehouseOutController extends BaseController } /** - * 修改保存出库单详情 + * 修改保存售后维护设备出库详情 */ @RequiresPermissions("aftersales:warehouseOutOrder:edit") - @Log(title = "出库单", businessType = BusinessType.UPDATE) + @Log(title = "售后维护设备出库", businessType = BusinessType.UPDATE) @PostMapping("/detail") @ResponseBody public AjaxResult detailSave(WarehouseOutOrder warehouseOutOrder) @@ -154,7 +160,7 @@ public class AftersalesWarehouseOutController extends BaseController * 修改保存出货设备 */ @RequiresPermissions("aftersales:warehouseOutOrder:addShippingDevices") - @Log(title = "出库单", businessType = BusinessType.INSERT) + @Log(title = "售后维护设备出库", businessType = BusinessType.INSERT) @PostMapping("/addShippingDevices") @ResponseBody public AjaxResult addShippingDevicesSave(WarehouseOutOrder warehouseOutOrder) @@ -206,10 +212,10 @@ public class AftersalesWarehouseOutController extends BaseController } /** - * 删除出库单 + * 删除售后维护设备出库 */ @RequiresPermissions("aftersales:warehouseOutOrder:remove") - @Log(title = "出库单", businessType = BusinessType.DELETE) + @Log(title = "售后维护设备出库", businessType = BusinessType.DELETE) @PostMapping( "/remove") @ResponseBody public AjaxResult remove(String ids) @@ -218,4 +224,69 @@ public class AftersalesWarehouseOutController extends BaseController } + + + + /** + * 售后第一次维护设备 + */ + @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(WarehouseOutOrder warehouseOutOrder) + { + return toAjax(warehouseOutOrderService.updateWarehouseOutOrder(warehouseOutOrder)); + } + + + /** + * 展示售后第一次维护设备物料信息 + * */ + @PostMapping("/getMaintenanceEquipmentOneMaterials") + @ResponseBody + public TableDataInfo getMaintenanceEquipmentOneMaterials(WarehouseOutOrder warehouseOutOrder) + { + + startPage(); + List list = warehouseOutOrderService.selectOutOrderDetailListByCode(warehouseOutOrder); + return getDataTable(list); + } + /** + * 展示售后第一次维护设备料号相关出货设备信息 + */ + @PostMapping("/showAftersalesShippingDevicelist") + @ResponseBody + public TableDataInfo showAftersalesShippingDevicelist(WarehouseOutOrder warehouseOutOrder) + { + + startPage(); + List list = warehouseOutOrderService.selectAftersalesShippingDevicelistByCodeAndNo(warehouseOutOrder); + return getDataTable(list); + } + + /** + * 第一次维护设备删除物料信息出货设备信息 + */ + @Log(title = "售后维护设备出库", businessType = BusinessType.DELETE) + @PostMapping("/deleteRow") + @ResponseBody + public AjaxResult deleteRow(String shippingDeviceId) + { + return toAjax(warehouseOutOrderService.deleteAftersalesShippingDeviceById(shippingDeviceId)); + } + + + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java index 26f40117..2e1a3a3b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java @@ -67,7 +67,7 @@ public interface AfterSalesShippingDeviceMapper * @param shippingDeviceCode 出货设备ID * @return 结果 */ - public int deleteAfterSalesShippingDeviceById(Long shippingDeviceCode); + public int deleteAfterSalesShippingDeviceById(String shippingDeviceId); /** * 批量删除出货设备 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAfterSalesShippingDeviceService.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAfterSalesShippingDeviceService.java index a91ebf7a..131d382d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAfterSalesShippingDeviceService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAfterSalesShippingDeviceService.java @@ -74,24 +74,6 @@ public interface IAfterSalesShippingDeviceService */ public int updateAfterSalesShippingDevice(AfterSalesShippingDeviceEditDto afterSalesShippingDeviceEditDto); - - - /** - * 批量删除出货设备 - * - * @param ids 需要删除的数据ID - * @return 结果 - */ - public int deleteAfterSalesShippingDeviceByIds(String ids); - - /** - * 删除出货设备信息 - * - * @param shippingDeviceCode 出货设备ID - * @return 结果 - */ - public int deleteAfterSalesShippingDeviceById(Long shippingDeviceCode); - /** * 作废出货设备 * @param shippingDeviceCode 出货设备ID diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesWarehouseOutService.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesWarehouseOutService.java index f044a02d..77a7c7d0 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesWarehouseOutService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesWarehouseOutService.java @@ -5,6 +5,7 @@ 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接口 @@ -28,7 +29,7 @@ public interface IAftersalesWarehouseOutService * @param warehouseOutOrder 出库单 * @return 出库单集合 */ - public List selectWarehouseOutOrderList(WarehouseOutOrder warehouseOutOrder); + public List selectAftersalesWarehouseOutOrderList(WarehouseOutOrder warehouseOutOrder); /** @@ -96,4 +97,21 @@ public interface IAftersalesWarehouseOutService SelectMaterialsVO selectShippingDevicesById(String quoteId, String materialCode); List selectShippingDeviceBySalesOrderCode(SelectMaterialsVO selectMaterialsVO); + + /* + * 根据设备ID删除出货设备信息 + * */ + int deleteAftersalesShippingDeviceById(String shippingDeviceId); + + + /** + * 展示售后第一次维护设备料号相关出货设备信息 + */ + List selectAftersalesShippingDevicelistByCodeAndNo(WarehouseOutOrder warehouseOutOrder); + + + /** + * 展示售后第一次维护设备物料相关信息 + * */ + List selectOutOrderDetailListByCode(WarehouseOutOrder warehouseOutOrder); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AfterSalesShippingDeviceServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AfterSalesShippingDeviceServiceImpl.java index 6fdc89d8..440c3d55 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AfterSalesShippingDeviceServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AfterSalesShippingDeviceServiceImpl.java @@ -168,29 +168,6 @@ public class AfterSalesShippingDeviceServiceImpl implements IAfterSalesShippingD return afterSalesShippingDeviceMapper.updateAfterSalesShippingDevice(afterSalesShippingDevice); } - /** - * 删除出货设备对象 - * - * @param ids 需要删除的数据ID - * @return 结果 - */ - @Override - public int deleteAfterSalesShippingDeviceByIds(String ids) - { - return afterSalesShippingDeviceMapper.deleteAfterSalesShippingDeviceByIds(Convert.toStrArray(ids)); - } - - /** - * 删除出货设备信息 - * - * @param shippingDeviceCode 出货设备ID - * @return 结果 - */ - @Override - public int deleteAfterSalesShippingDeviceById(Long shippingDeviceCode) - { - return afterSalesShippingDeviceMapper.deleteAfterSalesShippingDeviceById(shippingDeviceCode); - } /** * 作废出货设备 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesWarehouseOutServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesWarehouseOutServiceImpl.java index 8ceb3275..5b4614a2 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesWarehouseOutServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesWarehouseOutServiceImpl.java @@ -7,12 +7,15 @@ 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.SysSalesOrderChild; import com.ruoyi.system.mapper.SysSalesOrderChildMapper; 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; @@ -39,6 +42,9 @@ public class AftersalesWarehouseOutServiceImpl implements IAftersalesWarehouseOu @Autowired private AfterSalesShippingDeviceMapper shippingDeviceMapper; + @Autowired + private WarehouseOutOrderDetailMapper outOrderDetailMapper; + /** * 查询出库单 * @@ -58,9 +64,11 @@ public class AftersalesWarehouseOutServiceImpl implements IAftersalesWarehouseOu * @return 出库单 */ @Override - public List selectWarehouseOutOrderList(WarehouseOutOrder warehouseOutOrder) + public List selectAftersalesWarehouseOutOrderList(WarehouseOutOrder warehouseOutOrder) { - return warehouseOutOrderMapper.selectWarehouseOutOrderList(warehouseOutOrder); + + + return warehouseOutOrderMapper.selectAftersalesWarehouseOutOrderList(warehouseOutOrder); } @Override @@ -131,6 +139,62 @@ public class AftersalesWarehouseOutServiceImpl implements IAftersalesWarehouseOu return selectShippingDeviceVOs; } + /** + * 展示售后第一次维护设备料号相关出货设备信息 + */ + @Override + public List selectAftersalesShippingDevicelistByCodeAndNo(WarehouseOutOrder warehouseOutOrder) { + + List selectShippingDeviceVOs = new ArrayList<>(); + AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice(); + afterSalesShippingDevice.setSalesOrderCode(warehouseOutOrder.getSalesOrderCode()); + afterSalesShippingDevice.setMaterialNo(warehouseOutOrder.getMaterialNo()); + List 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 selectOutOrderDetailListByCode(WarehouseOutOrder warehouseOutOrder) { + + String outOrderCode = warehouseOutOrder.getOutOrderCode(); + if (!StringUtils.isNotEmpty(outOrderCode)) { + // 记录日志 + log.warn("未查找到与出库单号关联的出库单详情数据, 出库单号: {}", outOrderCode); + throw new BusinessException("未查出库单详情数据"); + } + List warehouseOutOrderDetails = outOrderDetailMapper.selectOutOrderDetailListByCode(outOrderCode); + return warehouseOutOrderDetails; + } + + /* + * 售后第一次维护设备信息根据设备ID删除出货设备信息 + * */ + @Override + public int deleteAftersalesShippingDeviceById(String shippingDeviceId) { + + return shippingDeviceMapper.deleteAfterSalesShippingDeviceById(shippingDeviceId); + } + + + @Override public List selectMaterialByMaterialCode(SelectMaterialsVO selectMaterialsVO) { List selectMaterialsVOs = new ArrayList<>(); @@ -182,7 +246,7 @@ public class AftersalesWarehouseOutServiceImpl implements IAftersalesWarehouseOu /** * 删除出库单对象 - * + * * @param ids 需要删除的数据ID * @return 结果 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderMapper.java index 33fd32fc..e505696e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderMapper.java @@ -27,6 +27,15 @@ public interface WarehouseOutOrderMapper */ public List selectWarehouseOutOrderList(WarehouseOutOrder warehouseOutOrder); + + /** + * 查询售后维护设备仓库出库单列表 + * + * @param warehouseOutOrder 仓库出库单 + * @return 仓库出库单集合 + */ + public List selectAftersalesWarehouseOutOrderList(WarehouseOutOrder warehouseOutOrder); + /** * 新增仓库出库单 * diff --git a/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml b/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml index dce6234c..33997e27 100644 --- a/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml @@ -225,10 +225,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where shipping_device_id= #{shippingDeviceId} - - delete from aftersales_shipping_device where shipping_device_code = #{shippingDeviceCode} + + delete from aftersales_shipping_device where shipping_device_id = #{shippingDeviceId} + delete from aftersales_shipping_device where shipping_device_code in diff --git a/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderMapper.xml b/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderMapper.xml index ec7f8d83..4371525f 100644 --- a/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderMapper.xml @@ -63,7 +63,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and delivery_date = #{deliveryDate} - + + + + + + + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+

物料信息

+
+
+ + + + + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/warehouseOutOrder.html b/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/warehouseOutOrder.html index 03d2e64e..fcc650d1 100644 --- a/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/warehouseOutOrder.html +++ b/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/warehouseOutOrder.html @@ -64,8 +64,10 @@ var editFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:edit')}]]; var detailFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:detail')}]]; var removeFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:remove')}]]; - var cancelFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:cancel')}]]; - var restoreFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:restore')}]]; + var maintenanceEquipmentOneFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:maintenanceEquipmentOne')}]]; + + + var warehouseOutStatusDatas = [[${@dict.getType('warehouse_out_status')}]]; var warehouseOrderTypeDatas = [[${@dict.getType('warehouse_order_type')}]]; var warehouseOutTypeDatas = [[${@dict.getType('warehouse_out_type')}]]; @@ -174,6 +176,9 @@ var actions = []; // actions.push('编辑 '); actions.push('详情 '); + if (row.warehouseOutStatus== "1"){ + actions.push('维护设备 '); + } return actions.join(''); } }] @@ -182,12 +187,21 @@ }); /*详情*/ - function detail(outOrderId ) { + function detail(outOrderId) { // 在这里编写派单操作的逻辑,使用传入的aftersalesOrderId参数 // 示例逻辑: var url = ctx + 'aftersales/warehouseOutOrder/detail/'+outOrderId; $.modal.open("详情",url); } + + /*售后第一次维护设备*/ + function maintenanceEquipmentOne(outOrderId) { + // 在这里编写派单操作的逻辑,使用传入的aftersalesOrderId参数 + // 示例逻辑: + var url = ctx + 'aftersales/warehouseOutOrder/maintenanceEquipmentOne/'+outOrderId; + $.modal.open("售后第一次维护设备",url); + } + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/makeorder/addProduceInbound.html b/ruoyi-admin/src/main/resources/templates/system/makeorder/addProduceInbound.html index 3944901e..39b8a145 100644 --- a/ruoyi-admin/src/main/resources/templates/system/makeorder/addProduceInbound.html +++ b/ruoyi-admin/src/main/resources/templates/system/makeorder/addProduceInbound.html @@ -163,19 +163,6 @@ align: 'center', title: '已完成数' }, - // { - // field: 'currentNum', - // title: '本次完成数', - // formatter: function (value,row,index){ - // var curIndex = index; - // // 物料类型是成品,通过添加设备履历表计算数量 - // if(row.materialType == 'chcpsb'){ - // return '' + - // ''; - // } - // return ''; - // } - // }, { field: 'currentNum', title: '本次完成数', @@ -205,7 +192,6 @@ var childTableId = 'child_table_'+index; var childFormTableId = 'child_form_table_'+index; var childTableFormId = 'child_table_form_'+index; - // $detail.html('
'); $detail.html('
'); // BOM展示 $('#'+childTableId).bootstrapTable({ @@ -383,104 +369,63 @@ function addEquipmentResume(curIndex,materialCode){ var url = prefix + "/addEquipmentResume?makeNo="+$("#makeNo").val()+"&saleNo="+$("#saleNo").val()+"&materialNo="+materialCode+"&curIndex="+curIndex; - // var options = { - // title: '设备履历表', - // url: url, - // // callBack: doSubmit - // }; - // $.modal.openOptions(options); $.modal.open("设备履历表",url); } - // function doSubmit(index, layero,uniqueId) { - // // debugger - // var iframeWin = window[layero.find('iframe')[0]['name']]; - // // 行取不到 - // // var data = iframeWin.$('#bootstrap-sub-table-1').bootstrapTable('getData'); - // // alert(JSON.stringify(data)); - // - // // 取不到 - // // var options = iframeWin.$('#bootstrap-sub-table-1').bootstrapTable('getOptions'); - // // var data = options.data; - // // alert(JSON.stringify(data)); - // - // var formData = iframeWin.$("#form-equipMaterial-add").serializeArray(); - // var formObj = serializeObject(formData); - // var formObjStr = JSON.stringify(formObj); - // // alert(formObjStr); - // // 关闭弹出框 - // layer.close(index); - // var curIndex = formObj.curIndex; - // if(formObj.equipResumes){ - // var currentNum = formObj.equipResumes.length; - // var equipResumeArrayStr = JSON.stringify(formObj.equipResumes); - // $('[data-id="currentNum_'+curIndex+'"]').val(currentNum); - // $('[data-id="equipResumeArrayStr_'+curIndex+'"]').val(equipResumeArrayStr); - // } - // - // } - - function serializeObject(formData) { - var obj = {}; - $.each(formData, function () { - if (this.name.indexOf("[") !== -1 && this.name.indexOf("].") !== -1) { - let temp1 = this.name.split("["); - let temp2 = temp1[1].split("]."); - let list_name = temp1[0]; - let list_index = parseInt(temp2[0]); - let list_key = temp2[1]; - // console.log(list_name, '-', list_index, '-', list_key) - if (obj[list_name]) { - // console.log(obj[list_name]) - let arr = obj[list_name] - if (arr.length < list_index + 1) { - for (let i = arr.length; i < list_index + 1; i++) { - // console.log(list_index + 1) - let list_obj_temp = {} - arr.push(list_obj_temp) - } - } - let list_obj = obj[list_name][list_index]; - list_obj[list_key] = this.value || ''; - } else { - let arr = [] - if (list_index !== 0) { - for (let i = 0; i < list_index + 1; i++) { - // console.log(list_index + 1) - let list_obj_temp = {} - arr.push(list_obj_temp) - } - } - let list_obj = {} - list_obj[list_key] = this.value || ''; - arr.push(list_obj) - obj[list_name] = arr; - } - } else { - if (obj[this.name]) { - if (!obj[this.name].push) { - obj[this.name] = [obj[this.name]]; - } - obj[this.name].push(this.value || ''); - } else { - obj[this.name] = this.value || ''; - } - } - }); - return obj; - } - $("#form-makeorder-edit").validate({ focusCleanup: true }); + // function submitHandler() { + // debugger + // var data = $("#form-makeorder-edit").serializeArray(); + // alert(JSON.stringify(data)); + // $.operate.save(ctx + "erp/inboundOrder/add", data); + // } + + + /* + * 提交设备履历信息 + * */ function submitHandler() { - debugger - var data = $("#form-makeorder-edit").serializeArray(); - alert(JSON.stringify(data)); - $.operate.save(ctx + "erp/inboundOrder/add", data); + // 获取表单数据 + const makeorderData = $("#form-makeorder-edit").serializeArray().reduce((obj, item) => { + obj[item.name] = item.value; + return obj; + }, {}); + // 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据 + var table = $('#bootstrap-sub-table-1').bootstrapTable('getData'); + //获取选中复选框行的数据 + // 将表数据转换成与complaintNoticeData格式一致的数组 + var materialDataList = table.map(function(item) { + // 根据实际字段名调整 + return { + "materialCode":item.materialCode, + "materialName": item.materialName, + "unit": item.unit, + "brand": item.brand, + "describe":item.describe, + "processMethod":item.processMethod, + "deliveryTime":item.deliveryTime, + "materialNum":item.materialNum, + "currentNum": item.currentNum, + "completedNum": item.completedNum, + + // ...其他字段 + }; + }); + + // 合并表单数据和表格数据 + const combinedData = Object.assign({}, makeorderData, { sysEquipDetailDtos: materialDataList }); + + console.log(combinedData) + // 使用 JSON.stringify() 序列化数据 + const jsonData = JSON.stringify(combinedData); + // 发送 AJAX 请求到后端接口 + $.operate.saveJson(prefix + "/addEquipmentResumeSave", jsonData); } + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html b/ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html index c37577ff..72429794 100644 --- a/ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html +++ b/ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html @@ -355,8 +355,9 @@ actions.push(' 进度查看 '); } - if (row.makeStatus == "0" || row.makeStatus == "1"){ - actions.push(' 出货 '); + // 生产状态部分完成/全部完成 + if (row.makeStatus == "5" || row.makeStatus == "6"){ + actions.push(' 出货 '); } // 详情 @@ -373,6 +374,12 @@ function downloadFile(filepath) { window.location.href =prefix + "/downloadFile?filepath="+ filepath; } + + //出货 + function salesDeliverGoods(salesOrderId){ + var url = prefix + "/salesDeliverGoods/" + salesOrderId; + $.modal.open("出货",url); + }