Forráskód Böngészése

feat:排产计划(纺丝、加弹、翻框、络筒)

hmc 1 éve
szülő
commit
367e30d1da
31 módosított fájl, 4480 hozzáadás és 306 törlés
  1. 32 8
      zkqy-custom-business/src/main/java/com/zkqy/business/controller/AmmunitionPlanInformationIntermediateTableController.java
  2. 1 1
      zkqy-custom-business/src/main/java/com/zkqy/business/controller/DetailsOfTheRefuelingPlanController.java
  3. 142 0
      zkqy-custom-business/src/main/java/com/zkqy/business/controller/DetailsOfTheRefuelingPlanSpinningController.java
  4. 28 22
      zkqy-custom-business/src/main/java/com/zkqy/business/controller/SaleOrderController.java
  5. 9 9
      zkqy-custom-business/src/main/java/com/zkqy/business/controller/SaleProductsController.java
  6. 4 3
      zkqy-custom-business/src/main/java/com/zkqy/business/domain/AmmunitionPlanInformationIntermediateTable.java
  7. 29 6
      zkqy-custom-business/src/main/java/com/zkqy/business/domain/DetailsOfTheRefuelingPlan.java
  8. 265 0
      zkqy-custom-business/src/main/java/com/zkqy/business/domain/DetailsOfTheRefuelingPlanSpinning.java
  9. 14 1
      zkqy-custom-business/src/main/java/com/zkqy/business/domain/SaleOrder.java
  10. 49 48
      zkqy-custom-business/src/main/java/com/zkqy/business/domain/vo/AmmunitionPlanInformationIntermediateTableRVo.java
  11. 21 0
      zkqy-custom-business/src/main/java/com/zkqy/business/domain/vo/DetailsOfTheRefuelingPlanSpinningRVo.java
  12. 24 0
      zkqy-custom-business/src/main/java/com/zkqy/business/domain/vo/DetailsOfTheRefuelingPlanSpinningVo.java
  13. 6 0
      zkqy-custom-business/src/main/java/com/zkqy/business/mapper/DetailsOfTheRefuelingPlanMapper.java
  14. 72 0
      zkqy-custom-business/src/main/java/com/zkqy/business/mapper/DetailsOfTheRefuelingPlanSpinningMapper.java
  15. 11 0
      zkqy-custom-business/src/main/java/com/zkqy/business/mapper/SaleOrderMapper.java
  16. 8 0
      zkqy-custom-business/src/main/java/com/zkqy/business/mapper/SaleProductsMapper.java
  17. 15 0
      zkqy-custom-business/src/main/java/com/zkqy/business/service/IAmmunitionPlanInformationIntermediateTableService.java
  18. 77 0
      zkqy-custom-business/src/main/java/com/zkqy/business/service/IDetailsOfTheRefuelingPlanSpinningService.java
  19. 314 67
      zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/AmmunitionPlanInformationIntermediateTableServiceImpl.java
  20. 45 0
      zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/DetailsOfTheRefuelingPlanServiceImpl.java
  21. 230 0
      zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/DetailsOfTheRefuelingPlanSpinningServiceImpl.java
  22. 36 10
      zkqy-custom-business/src/main/resources/mapper/business/DetailsOfTheRefuelingPlanMapper.xml
  23. 181 0
      zkqy-custom-business/src/main/resources/mapper/business/DetailsOfTheRefuelingPlanSpinningMapper.xml
  24. 17 1
      zkqy-custom-business/src/main/resources/mapper/business/SaleOrderMapper.xml
  25. 11 2
      zkqy-custom-business/src/main/resources/mapper/business/SaleProductsMapper.xml
  26. 101 2
      zkqy-ui/src/api/plan/paln.js
  27. 645 0
      zkqy-ui/src/views/orderMange/planTable/fangsi.vue
  28. 653 0
      zkqy-ui/src/views/orderMange/planTable/fankuang.vue
  29. 782 124
      zkqy-ui/src/views/orderMange/planTable/index.vue
  30. 656 0
      zkqy-ui/src/views/orderMange/planTable/luotong.vue
  31. 2 2
      zkqy-ui/src/views/tablelist/commonTable/listInfo.vue

+ 32 - 8
zkqy-custom-business/src/main/java/com/zkqy/business/controller/AmmunitionPlanInformationIntermediateTableController.java

@@ -3,20 +3,14 @@ package com.zkqy.business.controller;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
+import com.zkqy.business.domain.DetailsOfTheRefuelingPlan;
 import com.zkqy.business.domain.vo.AmmunitionPlanInformationIntermediateTableRVo;
 import com.zkqy.business.domain.vo.AmmunitionPlanInformationIntermediateTableVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import com.zkqy.common.annotation.Log;
 import com.zkqy.common.core.controller.BaseController;
 import com.zkqy.common.core.domain.AjaxResult;
@@ -36,6 +30,8 @@ import com.zkqy.common.core.page.TableDataInfo;
 @RequestMapping("/business/ammunitionPlanInfo")
 @Api(value = "/business/table", description = "加弹计划信息-接口")
 public class AmmunitionPlanInformationIntermediateTableController extends BaseController {
+
+
     @Autowired
     private IAmmunitionPlanInformationIntermediateTableService ammunitionPlanInformationIntermediateTableService;
 
@@ -50,6 +46,9 @@ public class AmmunitionPlanInformationIntermediateTableController extends BaseCo
     public AjaxResult add(@RequestBody AmmunitionPlanInformationIntermediateTable ammunitionPlanInformationIntermediateTable) {
         return toAjax(ammunitionPlanInformationIntermediateTableService.insertAmmunitionPlanInformationIntermediateTable(ammunitionPlanInformationIntermediateTable));
     }
+
+
+
     /**
      * 查询加弹计划信息列表
      */
@@ -62,6 +61,31 @@ public class AmmunitionPlanInformationIntermediateTableController extends BaseCo
         return AjaxResult.success(list);
     }
 
+    @PreAuthorize("@ss.hasPermi('business:table:list')")
+    @GetMapping("/list2")
+    @ApiOperation(value = "查询加弹计划信息列表")
+    public AjaxResult list2(AmmunitionPlanInformationIntermediateTableVo ammunitionPlanInformationIntermediateTable) {
+        List<AmmunitionPlanInformationIntermediateTableRVo> list = ammunitionPlanInformationIntermediateTableService.selectAmmunitionPlanInformationIntermediateTableList(ammunitionPlanInformationIntermediateTable);
+        return AjaxResult.success(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('business:table:list')")
+    @GetMapping("/getAllPlanListByMachineId")
+    @ApiOperation(value = "查询加弹计划信息列表")
+    public AjaxResult getAllPlanListByMachineId(@RequestParam("machineId") String machineId) {
+        List<DetailsOfTheRefuelingPlan> list = ammunitionPlanInformationIntermediateTableService.getAllPlanListByMachineId(machineId);
+        return AjaxResult.success(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('business:table:list')")
+    @GetMapping("/getAllPlanListByProductTypeAndStatus")
+    @ApiOperation(value = "查询加弹计划信息列表")
+    public AjaxResult getAllPlanListByProductType(DetailsOfTheRefuelingPlan detailsOfTheRefuelingPlan) {
+        List<DetailsOfTheRefuelingPlan> list = ammunitionPlanInformationIntermediateTableService.getAllPlanListByProductType(detailsOfTheRefuelingPlan);
+        return AjaxResult.success(list);
+    }
+
+
     /**
      * 导出加弹计划信息列表
      */

+ 1 - 1
zkqy-custom-business/src/main/java/com/zkqy/business/controller/DetailsOfTheRefuelingPlanController.java

@@ -90,7 +90,7 @@ public class DetailsOfTheRefuelingPlanController extends BaseController {
     @Log(title = "加弹计划详细信息", businessType = BusinessType.UPDATE)
     @PutMapping
     @ApiOperation(value = "修改加弹计划详细信息")
-    public AjaxResult edit(@RequestBody DetailsOfTheRefuelingPlan detailsOfTheRefuelingPlan) {
+    public AjaxResult edit(DetailsOfTheRefuelingPlan detailsOfTheRefuelingPlan) {
         return toAjax(detailsOfTheRefuelingPlanService.updateDetailsOfTheRefuelingPlan(detailsOfTheRefuelingPlan));
     }
 

+ 142 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/controller/DetailsOfTheRefuelingPlanSpinningController.java

@@ -0,0 +1,142 @@
+package com.zkqy.business.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.zkqy.business.domain.vo.DetailsOfTheRefuelingPlanSpinningRVo;
+import com.zkqy.business.domain.vo.DetailsOfTheRefuelingPlanSpinningVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.zkqy.common.annotation.Log;
+import com.zkqy.common.core.controller.BaseController;
+import com.zkqy.common.core.domain.AjaxResult;
+import com.zkqy.common.enums.BusinessType;
+import com.zkqy.business.domain.DetailsOfTheRefuelingPlanSpinning;
+import com.zkqy.business.service.IDetailsOfTheRefuelingPlanSpinningService;
+import com.zkqy.common.utils.poi.ExcelUtil;
+import com.zkqy.common.core.page.TableDataInfo;
+
+/**
+ * 纺丝计划详细信息Controller
+ *
+ * @author zkqy
+ * @date 2024-04-09
+ */
+@RestController
+@RequestMapping("/system/spinning")
+@Api(value = "/system/spinning", description = "纺丝计划详细信息-接口")
+public class DetailsOfTheRefuelingPlanSpinningController extends BaseController {
+    @Autowired
+    private IDetailsOfTheRefuelingPlanSpinningService detailsOfTheRefuelingPlanSpinningService;
+
+    /**
+     * 查询纺丝计划详细信息列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:spinning:list')")
+    @GetMapping("/list")
+    @ApiOperation(value = "查询纺丝计划详细信息列表")
+    public TableDataInfo list(DetailsOfTheRefuelingPlanSpinningVo detailsOfTheRefuelingPlanSpinning) {
+        List<DetailsOfTheRefuelingPlanSpinningRVo> list = detailsOfTheRefuelingPlanSpinningService.selectDetailsOfTheRefuelingPlanSpinningList(detailsOfTheRefuelingPlanSpinning);
+        return getDataTable(list);
+    }
+
+    /**
+     * 查询纺丝计划详细信息列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:spinning:list')")
+    @GetMapping("/list/getPlanSpinningInfo")
+    @ApiOperation(value = "查询纺丝计划详细信息列表")
+    public AjaxResult getPlanSpinningInfo(DetailsOfTheRefuelingPlanSpinningVo detailsOfTheRefuelingPlanSpinning) {
+        List<DetailsOfTheRefuelingPlanSpinning> list = detailsOfTheRefuelingPlanSpinningService.selectDetailsOfTheRefuelingPlanSpinningListInfo(detailsOfTheRefuelingPlanSpinning);
+        return AjaxResult.success(list);
+    }
+
+
+
+
+    /**
+     * 新增纺丝计划详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:spinning:add')")
+    @Log(title = "纺丝计划详细信息", businessType = BusinessType.INSERT)
+    @PostMapping
+    @ApiOperation(value = "新增纺丝计划详细信息")
+    public AjaxResult addBatch(@RequestBody List<DetailsOfTheRefuelingPlanSpinning> detailsOfTheRefuelingPlanSpinning) {
+        return toAjax(detailsOfTheRefuelingPlanSpinningService.insertDetailsOfTheRefuelingPlanSpinningBatch(detailsOfTheRefuelingPlanSpinning));
+    }
+
+
+//    /**
+//     * 导出纺丝计划详细信息列表
+//     */
+//    @PreAuthorize("@ss.hasPermi('system:spinning:export')")
+//    @Log(title = "纺丝计划详细信息", businessType = BusinessType.EXPORT)
+//    @PostMapping("/export")
+//    @ApiOperation(value = "导出纺丝计划详细信息列表")
+//    public void export(HttpServletResponse response, DetailsOfTheRefuelingPlanSpinning detailsOfTheRefuelingPlanSpinning) {
+//        List<DetailsOfTheRefuelingPlanSpinning> list = detailsOfTheRefuelingPlanSpinningService.selectDetailsOfTheRefuelingPlanSpinningList(detailsOfTheRefuelingPlanSpinning);
+//        ExcelUtil<DetailsOfTheRefuelingPlanSpinning> util = new ExcelUtil<DetailsOfTheRefuelingPlanSpinning>(DetailsOfTheRefuelingPlanSpinning.class);
+//        util.exportExcel(response, list, "纺丝计划详细信息数据");
+//    }
+
+    /**
+     * 获取纺丝计划详细信息详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:spinning:query')")
+    @GetMapping(value = "/{id}")
+    @ApiOperation(value = "获取纺丝计划详细信息详细信息")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(detailsOfTheRefuelingPlanSpinningService.selectDetailsOfTheRefuelingPlanSpinningById(id));
+    }
+
+    /**
+     * 新增纺丝计划详细信息
+     */
+//    @PreAuthorize("@ss.hasPermi('system:spinning:add')")
+//    @Log(title = "纺丝计划详细信息", businessType = BusinessType.INSERT)
+//    @PostMapping
+//    @ApiOperation(value = "新增纺丝计划详细信息")
+//    public AjaxResult add(@RequestBody DetailsOfTheRefuelingPlanSpinning detailsOfTheRefuelingPlanSpinning) {
+//        return toAjax(detailsOfTheRefuelingPlanSpinningService.insertDetailsOfTheRefuelingPlanSpinning(detailsOfTheRefuelingPlanSpinning));
+//    }
+
+    /**
+     * 修改纺丝计划详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:spinning:edit')")
+    @Log(title = "纺丝计划详细信息", businessType = BusinessType.UPDATE)
+    @PutMapping
+    @ApiOperation(value = "修改纺丝计划详细信息")
+    public AjaxResult edit(@RequestBody DetailsOfTheRefuelingPlanSpinning detailsOfTheRefuelingPlanSpinning) {
+        return toAjax(detailsOfTheRefuelingPlanSpinningService.updateDetailsOfTheRefuelingPlanSpinning(detailsOfTheRefuelingPlanSpinning));
+    }
+
+    @PreAuthorize("@ss.hasPermi('system:spinning:edit')")
+    @Log(title = "纺丝计划详细信息", businessType = BusinessType.UPDATE)
+    @PutMapping("/update/updateSpinningInfoPlanOne")
+    @ApiOperation(value = "修改纺丝计划详细信息")
+    public AjaxResult updateSpinningInfoPlanOne(@RequestBody DetailsOfTheRefuelingPlanSpinning detailsOfTheRefuelingPlanSpinning) {
+        return toAjax(detailsOfTheRefuelingPlanSpinningService.updateDetailsOfTheRefuelingPlanSpinning(detailsOfTheRefuelingPlanSpinning));
+    }
+
+    /**
+     * 删除纺丝计划详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:spinning:remove')")
+    @Log(title = "纺丝计划详细信息", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    @ApiOperation(value = "删除纺丝计划详细信息")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(detailsOfTheRefuelingPlanSpinningService.deleteDetailsOfTheRefuelingPlanSpinningByIds(ids));
+    }
+}

+ 28 - 22
zkqy-custom-business/src/main/java/com/zkqy/business/controller/SaleOrderController.java

@@ -3,7 +3,9 @@ package com.zkqy.business.controller;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
+import com.zkqy.business.domain.SaleProducts;
 import com.zkqy.business.domain.vo.SaleOrderVO;
+import com.zkqy.business.domain.vo.SaleProductsVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -27,24 +29,33 @@ import com.zkqy.common.core.page.TableDataInfo;
 @RestController
 @RequestMapping("/system/order")
 @Api(value = "/system/order", description = "销售订单-接口")
-public class SaleOrderController extends BaseController
-{
+public class SaleOrderController extends BaseController {
     @Autowired
     private ISaleOrderService saleOrderService;
 
-/**
- * 查询销售订单列表
- */
-@PreAuthorize("@ss.hasPermi('system:order:list')")
-@GetMapping("/list")
-@ApiOperation(value = "查询销售订单列表")
-    public TableDataInfo list(SaleOrder saleOrder)
-    {
+    /**
+     * 查询销售订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:order:list')")
+    @GetMapping("/list")
+    @ApiOperation(value = "查询销售订单列表")
+    public TableDataInfo list(SaleOrder saleOrder) {
         startPage();
         List<SaleOrder> list = saleOrderService.selectSaleOrderList(saleOrder);
         return getDataTable(list);
     }
 
+
+    @GetMapping("/salesman/getSalesman")
+    @ApiOperation(value = "查询销售产品列表")
+    public AjaxResult getSalesman(SaleOrder saleOrder) {
+        //销售单什么状态为3的(待生产)
+        saleOrder.setStatus("3");
+        List<SaleOrder> list = saleOrderService.selectSaleOrderList(saleOrder);
+        return AjaxResult.success(list);
+    }
+
+
     /**
      * 导出销售订单列表
      */
@@ -52,8 +63,7 @@ public class SaleOrderController extends BaseController
     @Log(title = "销售订单", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     @ApiOperation(value = "导出销售订单列表")
-    public void export(HttpServletResponse response, SaleOrder saleOrder)
-    {
+    public void export(HttpServletResponse response, SaleOrder saleOrder) {
         List<SaleOrder> list = saleOrderService.selectSaleOrderList(saleOrder);
         ExcelUtil<SaleOrder> util = new ExcelUtil<SaleOrder>(SaleOrder.class);
         util.exportExcel(response, list, "销售订单数据");
@@ -65,8 +75,7 @@ public class SaleOrderController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:order:query')")
     @GetMapping(value = "/{id}")
     @ApiOperation(value = "获取销售订单详细信息")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
         return success(saleOrderService.selectSaleOrderById(id));
     }
 
@@ -77,8 +86,7 @@ public class SaleOrderController extends BaseController
     @Log(title = "销售订单", businessType = BusinessType.INSERT)
     @PostMapping
     @ApiOperation(value = "新增销售订单")
-    public AjaxResult add(@RequestBody SaleOrder saleOrder)
-    {
+    public AjaxResult add(@RequestBody SaleOrder saleOrder) {
         return toAjax(saleOrderService.insertSaleOrder(saleOrder));
     }
 
@@ -101,8 +109,7 @@ public class SaleOrderController extends BaseController
     @Log(title = "销售订单", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     @ApiOperation(value = "删除销售订单")
-    public AjaxResult remove(@PathVariable List<Long> ids)
-    {
+    public AjaxResult remove(@PathVariable List<Long> ids) {
         saleOrderService.deleteSaleOrderByIds(ids);
         return AjaxResult.success();
     }
@@ -112,16 +119,15 @@ public class SaleOrderController extends BaseController
      */
     @GetMapping(value = "/checkContractNo")
     @ApiOperation(value = "销售单合同号校验")
-    public AjaxResult checkContractNo(@RequestParam(required = false) Long id,@RequestParam String saleNo)
-    {
-        return AjaxResult.success(saleOrderService.checkContractNo(id,saleNo));
+    public AjaxResult checkContractNo(@RequestParam(required = false) Long id, @RequestParam String saleNo) {
+        return AjaxResult.success(saleOrderService.checkContractNo(id, saleNo));
     }
 
     /**
      * 批量审批接口
      */
     @PostMapping("/batchApproval")
-    public AjaxResult batchApproval(@RequestBody SaleOrderVO vo){
+    public AjaxResult batchApproval(@RequestBody SaleOrderVO vo) {
         return toAjax(saleOrderService.batchApproval(vo));
     }
 

+ 9 - 9
zkqy-custom-business/src/main/java/com/zkqy/business/controller/SaleProductsController.java

@@ -8,14 +8,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import com.zkqy.common.annotation.Log;
 import com.zkqy.common.core.controller.BaseController;
 import com.zkqy.common.core.domain.AjaxResult;
@@ -38,10 +31,17 @@ public class SaleProductsController extends BaseController {
 
     @Autowired
     private ISaleProductsService saleProductsService;
+
+    /**
+     * @RequestParam("saleNo") String saleNo
+     * //saleProducts.setSaleOrderNo(saleNo);
+     * @return
+     */
     @GetMapping("/getProducts")
     @ApiOperation(value = "查询销售产品列表")
-    public AjaxResult getProducts(SaleProducts saleProducts) {
+    public AjaxResult getProducts() {
         //销售单什么状态为3的(待生产)
+        SaleProducts saleProducts=new SaleProducts();
         saleProducts.setStatus("3");
         List<SaleProductsVo> list = saleProductsService.selectSaleProductsListAndCustomerName(saleProducts);
         return AjaxResult.success(list);

+ 4 - 3
zkqy-custom-business/src/main/java/com/zkqy/business/domain/AmmunitionPlanInformationIntermediateTable.java

@@ -24,6 +24,9 @@ public class AmmunitionPlanInformationIntermediateTable extends BaseEntity
     @Excel(name = "机台号")
     private String machineId;
 
+    /** 时间戳随机码(每个计划都有一个随机码) */
+    @Excel(name = "时间戳随机码(每个计划都有一个随机码)")
+    private String timestampRandomCode;
     private List<DetailsOfTheRefuelingPlan> detailsOfTheRefuelingPlans;
 
     public List<DetailsOfTheRefuelingPlan> getDetailsOfTheRefuelingPlans() {
@@ -34,9 +37,7 @@ public class AmmunitionPlanInformationIntermediateTable extends BaseEntity
         this.detailsOfTheRefuelingPlans = detailsOfTheRefuelingPlans;
     }
 
-    /** 时间戳随机码(每个计划都有一个随机码) */
-    @Excel(name = "时间戳随机码(每个计划都有一个随机码)")
-    private String timestampRandomCode;
+
 
     public void setId(Long id) 
     {

+ 29 - 6
zkqy-custom-business/src/main/java/com/zkqy/business/domain/DetailsOfTheRefuelingPlan.java

@@ -18,7 +18,23 @@ public class DetailsOfTheRefuelingPlan extends BaseEntity
     /** 主键 */
     private Long id;
 
+    /**
+     * 产品id
+     */
+    private  String productId;
 
+    /**
+     * 业务员id
+     */
+    private  String salesmanId;
+
+    public String getSalesmanId() {
+        return salesmanId;
+    }
+
+    public void setSalesmanId(String salesmanId) {
+        this.salesmanId = salesmanId;
+    }
 
     /** 时间戳唯一码 */
     @Excel(name = "时间戳唯一码")
@@ -38,7 +54,7 @@ public class DetailsOfTheRefuelingPlan extends BaseEntity
 
     /** 生产批号 */
     @Excel(name = "生产批号")
-    private Long currentLotNumber;
+    private String currentLotNumber;
 
     /** 锭数 */
     @Excel(name = "锭数")
@@ -65,6 +81,14 @@ public class DetailsOfTheRefuelingPlan extends BaseEntity
     @Excel(name = "产品类型")
     private String productType;
 
+
+    public String getProductId() {
+        return productId;
+    }
+
+    public void setProductId(String productId) {
+        this.productId = productId;
+    }
     public String getProductType() {
         return productType;
     }
@@ -113,9 +137,8 @@ public class DetailsOfTheRefuelingPlan extends BaseEntity
     }
 
     public String getCurrentColorCode() 
-    {
-        return currentColorCode;
-    }
+    {return currentColorCode;}
+
     public void setCurrentSpecification(String currentSpecification) 
     {
         this.currentSpecification = currentSpecification;
@@ -125,12 +148,12 @@ public class DetailsOfTheRefuelingPlan extends BaseEntity
     {
         return currentSpecification;
     }
-    public void setCurrentLotNumber(Long currentLotNumber) 
+    public void setCurrentLotNumber(String currentLotNumber)
     {
         this.currentLotNumber = currentLotNumber;
     }
 
-    public Long getCurrentLotNumber() 
+    public String getCurrentLotNumber()
     {
         return currentLotNumber;
     }

+ 265 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/domain/DetailsOfTheRefuelingPlanSpinning.java

@@ -0,0 +1,265 @@
+package com.zkqy.business.domain;
+
+import com.zkqy.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.zkqy.common.annotation.Excel;
+
+/**
+ * 加弹计划详细信息对象 details_of_the_refueling_plan_spinning
+ * 
+ * @author zkqy
+ * @date 2024-04-09
+ */
+public class DetailsOfTheRefuelingPlanSpinning extends BaseEntity
+{
+
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    private Long id;
+
+    /** 时间戳唯一码 */
+    @Excel(name = "时间戳唯一码")
+    private String timestampRandomCode;
+
+    /** 机台号 */
+    @Excel(name = "机台号")
+    private String machineId;
+
+    /** 生产位数 */
+    @Excel(name = "生产位数")
+    private String productionDigit;
+
+    /** 生产色号 */
+    @Excel(name = "生产色号")
+    private String currentColorCode;
+
+    /** 生产规格 */
+    @Excel(name = "生产规格")
+    private String currentSpecification;
+
+    /** 生产批号 */
+    @Excel(name = "生产批号")
+    private String currentLotNumber;
+
+    /** 上级时间 */
+    @Excel(name = "上级时间")
+    private String startTime;
+
+    /** 计划下级时间 */
+    @Excel(name = "计划下级时间")
+    private String plannedEndTime;
+
+    /** 计划状态(0:待机 1:上机 2: 停机 3:已完成) */
+    @Excel(name = "计划状态", readConverterExp = "0=:待机,1=:上机,2=:,停=机,3=:已完成")
+    private String planStatus;
+
+    /** 数量    */
+    @Excel(name = "数量   ")
+    private String number;
+
+    /** 创建人id */
+    @Excel(name = "创建人id")
+    private String createbyId;
+
+    /** 创建人姓名 */
+    @Excel(name = "创建人姓名")
+    private String createbyName;
+
+    /** 修改人id */
+    @Excel(name = "修改人id")
+    private String updatebyId;
+
+    /** 修改人姓名 */
+    @Excel(name = "修改人姓名")
+    private String updatebyName;
+
+    /** 产品id */
+    @Excel(name = "产品id")
+    private String productId;
+
+    /** 业务员id */
+    @Excel(name = "业务员id")
+    private String salesmanId;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setTimestampRandomCode(String timestampRandomCode) 
+    {
+        this.timestampRandomCode = timestampRandomCode;
+    }
+
+    public String getTimestampRandomCode() 
+    {
+        return timestampRandomCode;
+    }
+    public void setMachineId(String machineId) 
+    {
+        this.machineId = machineId;
+    }
+
+    public String getMachineId() 
+    {
+        return machineId;
+    }
+    public void setProductionDigit(String productionDigit) 
+    {
+        this.productionDigit = productionDigit;
+    }
+
+    public String getProductionDigit() 
+    {
+        return productionDigit;
+    }
+    public void setCurrentColorCode(String currentColorCode) 
+    {
+        this.currentColorCode = currentColorCode;
+    }
+
+    public String getCurrentColorCode() 
+    {
+        return currentColorCode;
+    }
+    public void setCurrentSpecification(String currentSpecification) 
+    {
+        this.currentSpecification = currentSpecification;
+    }
+
+    public String getCurrentSpecification() 
+    {
+        return currentSpecification;
+    }
+    public void setCurrentLotNumber(String currentLotNumber) 
+    {
+        this.currentLotNumber = currentLotNumber;
+    }
+
+    public String getCurrentLotNumber() 
+    {
+        return currentLotNumber;
+    }
+    public void setStartTime(String startTime) 
+    {
+        this.startTime = startTime;
+    }
+
+    public String getStartTime() 
+    {
+        return startTime;
+    }
+    public void setPlannedEndTime(String plannedEndTime) 
+    {
+        this.plannedEndTime = plannedEndTime;
+    }
+
+    public String getPlannedEndTime() 
+    {
+        return plannedEndTime;
+    }
+    public void setPlanStatus(String planStatus) 
+    {
+        this.planStatus = planStatus;
+    }
+
+    public String getPlanStatus() 
+    {
+        return planStatus;
+    }
+    public void setNumber(String number) 
+    {
+        this.number = number;
+    }
+
+    public String getNumber() 
+    {
+        return number;
+    }
+    public void setCreatebyId(String createbyId) 
+    {
+        this.createbyId = createbyId;
+    }
+
+    public String getCreatebyId() 
+    {
+        return createbyId;
+    }
+    public void setCreatebyName(String createbyName) 
+    {
+        this.createbyName = createbyName;
+    }
+
+    public String getCreatebyName() 
+    {
+        return createbyName;
+    }
+    public void setUpdatebyId(String updatebyId) 
+    {
+        this.updatebyId = updatebyId;
+    }
+
+    public String getUpdatebyId() 
+    {
+        return updatebyId;
+    }
+    public void setUpdatebyName(String updatebyName) 
+    {
+        this.updatebyName = updatebyName;
+    }
+
+    public String getUpdatebyName() 
+    {
+        return updatebyName;
+    }
+    public void setProductId(String productId) 
+    {
+        this.productId = productId;
+    }
+
+    public String getProductId() 
+    {
+        return productId;
+    }
+    public void setSalesmanId(String salesmanId) 
+    {
+        this.salesmanId = salesmanId;
+    }
+
+    public String getSalesmanId() 
+    {
+        return salesmanId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("timestampRandomCode", getTimestampRandomCode())
+            .append("machineId", getMachineId())
+            .append("productionDigit", getProductionDigit())
+            .append("currentColorCode", getCurrentColorCode())
+            .append("currentSpecification", getCurrentSpecification())
+            .append("currentLotNumber", getCurrentLotNumber())
+            .append("startTime", getStartTime())
+            .append("plannedEndTime", getPlannedEndTime())
+            .append("planStatus", getPlanStatus())
+            .append("number", getNumber())
+            .append("remark", getRemark())
+            .append("createbyId", getCreatebyId())
+            .append("createbyName", getCreatebyName())
+            .append("updatebyId", getUpdatebyId())
+            .append("updatebyName", getUpdatebyName())
+            .append("createTime", getCreateTime())
+            .append("updateTime", getUpdateTime())
+            .append("productId", getProductId())
+            .append("salesmanId", getSalesmanId())
+            .toString();
+    }
+}

+ 14 - 1
zkqy-custom-business/src/main/java/com/zkqy/business/domain/SaleOrder.java

@@ -123,7 +123,20 @@ public class SaleOrder extends BaseEntity
     @Excel(name = "交货日期")
     private String deliveryDate;
 
-    public void setId(Long id) 
+
+    /** 批号 */
+    @Excel(name = "交货日期")
+    private String lotNumber;
+
+
+    public String getLotNumber() {
+        return lotNumber;
+    }
+
+    public void setLotNumber(String lotNumber) {
+        this.lotNumber = lotNumber;
+    }
+    public void setId(Long id)
     {
         this.id = id;
     }

+ 49 - 48
zkqy-custom-business/src/main/java/com/zkqy/business/domain/vo/AmmunitionPlanInformationIntermediateTableRVo.java

@@ -29,14 +29,26 @@ public class AmmunitionPlanInformationIntermediateTableRVo {
     private  String planStatus;
 
 
-    //色号
-    private  String djCurrentColorCode;
+//    //色号
+//    private  String djCurrentColorCode;
+//
+//    //生产规格
+//    private  String djCurrentSpecification;
+//
+//    //生产批号
+//    private  String djCurrentLotNumber;
+//
+//
+//
+//    //数量
+//    private  String djNumber;
 
-    //生产规格
-    private  String djCurrentSpecification;
+    /*产品类别A面B面*/
+    private  String productType;
 
-    //生产批号
-    private  String djCurrentLotNumber;
+
+    //待生产列表
+    private String listOfPendingProduction;
 
     public String getProductType() {
         return productType;
@@ -45,17 +57,6 @@ public class AmmunitionPlanInformationIntermediateTableRVo {
     public void setProductType(String productType) {
         this.productType = productType;
     }
-
-    //数量
-    private  String djNumber;
-
-    /*产品类别A面B面*/
-    private  String productType;
-
-
-    //待生产列表
-    private String listOfPendingProduction;
-
     public String getMachineId() {
         return machineId;
     }
@@ -120,37 +121,37 @@ public class AmmunitionPlanInformationIntermediateTableRVo {
         this.planStatus = planStatus;
     }
 
-    public String getDjCurrentColorCode() {
-        return djCurrentColorCode;
-    }
-
-    public void setDjCurrentColorCode(String djCurrentColorCode) {
-        this.djCurrentColorCode = djCurrentColorCode;
-    }
-
-    public String getDjCurrentSpecification() {
-        return djCurrentSpecification;
-    }
-
-    public void setDjCurrentSpecification(String djCurrentSpecification) {
-        this.djCurrentSpecification = djCurrentSpecification;
-    }
-
-    public String getDjCurrentLotNumber() {
-        return djCurrentLotNumber;
-    }
-
-    public void setDjCurrentLotNumber(String djCurrentLotNumber) {
-        this.djCurrentLotNumber = djCurrentLotNumber;
-    }
-
-    public String getDjNumber() {
-        return djNumber;
-    }
-
-    public void setDjNumber(String djNumber) {
-        this.djNumber = djNumber;
-    }
+//    public String getDjCurrentColorCode() {
+//        return djCurrentColorCode;
+//    }
+//
+//    public void setDjCurrentColorCode(String djCurrentColorCode) {
+//        this.djCurrentColorCode = djCurrentColorCode;
+//    }
+//
+//    public String getDjCurrentSpecification() {
+//        return djCurrentSpecification;
+//    }
+//
+//    public void setDjCurrentSpecification(String djCurrentSpecification) {
+//        this.djCurrentSpecification = djCurrentSpecification;
+//    }
+//
+//    public String getDjCurrentLotNumber() {
+//        return djCurrentLotNumber;
+//    }
+//
+//    public void setDjCurrentLotNumber(String djCurrentLotNumber) {
+//        this.djCurrentLotNumber = djCurrentLotNumber;
+//    }
+//
+//    public String getDjNumber() {
+//        return djNumber;
+//    }
+//
+//    public void setDjNumber(String djNumber) {
+//        this.djNumber = djNumber;
+//    }
 
     public String getListOfPendingProduction() {
         return listOfPendingProduction;

+ 21 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/domain/vo/DetailsOfTheRefuelingPlanSpinningRVo.java

@@ -0,0 +1,21 @@
+package com.zkqy.business.domain.vo;
+
+import com.zkqy.business.domain.DetailsOfTheRefuelingPlanSpinning;
+import com.zkqy.common.annotation.Excel;
+
+import java.util.List;
+
+public class DetailsOfTheRefuelingPlanSpinningRVo extends DetailsOfTheRefuelingPlanSpinning {
+    /**
+     * 待生产列表哦
+     */
+    public List<String> plannedProduction;
+
+    public List<String> getPlannedProduction() {
+        return plannedProduction;
+    }
+
+    public void setPlannedProduction(List<String> plannedProduction) {
+        this.plannedProduction = plannedProduction;
+    }
+}

+ 24 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/domain/vo/DetailsOfTheRefuelingPlanSpinningVo.java

@@ -0,0 +1,24 @@
+package com.zkqy.business.domain.vo;
+
+import com.zkqy.business.domain.DetailsOfTheRefuelingPlanSpinning;
+import com.zkqy.common.annotation.Excel;
+
+import java.util.List;
+
+
+public class DetailsOfTheRefuelingPlanSpinningVo extends DetailsOfTheRefuelingPlanSpinning {
+
+
+
+    /** 产线部门 */
+    @Excel(name = "产线部门")
+    private String productionLineDepartment;
+
+    public String getProductionLineDepartment() {
+        return productionLineDepartment;
+    }
+
+    public void setProductionLineDepartment(String productionLineDepartment) {
+        this.productionLineDepartment = productionLineDepartment;
+    }
+}

+ 6 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/mapper/DetailsOfTheRefuelingPlanMapper.java

@@ -29,6 +29,12 @@ public interface DetailsOfTheRefuelingPlanMapper
      */
     public List<DetailsOfTheRefuelingPlan> selectDetailsOfTheRefuelingPlanList(DetailsOfTheRefuelingPlan detailsOfTheRefuelingPlan);
 
+    /**
+     * 修改查询计划信息
+     * @param detailsOfTheRefuelingPlan
+     * @return
+     */
+    public List<DetailsOfTheRefuelingPlan>  selectDetailsOfTheRefuelingPlanListDetiles(DetailsOfTheRefuelingPlan detailsOfTheRefuelingPlan);
     /**
      * 新增加弹计划详细信息
      * 

+ 72 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/mapper/DetailsOfTheRefuelingPlanSpinningMapper.java

@@ -0,0 +1,72 @@
+package com.zkqy.business.mapper;
+
+import java.util.List;
+
+import com.zkqy.business.domain.DetailsOfTheRefuelingPlanSpinning;
+import com.zkqy.business.domain.DetailsOfTheRefuelingPlanSpinning;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 加弹计划详细信息Mapper接口
+ * 
+ * @author zkqy
+ * @date 2024-04-09
+ */
+@Mapper
+public interface DetailsOfTheRefuelingPlanSpinningMapper 
+{
+    /**
+     * 查询加弹计划详细信息
+     * 
+     * @param id 加弹计划详细信息主键
+     * @return 加弹计划详细信息
+     */
+    public DetailsOfTheRefuelingPlanSpinning selectDetailsOfTheRefuelingPlanSpinningById(Long id);
+
+    /**
+     * 查询加弹计划详细信息列表
+     * 
+     * @param detailsOfTheRefuelingPlanSpinning 加弹计划详细信息
+     * @return 加弹计划详细信息集合
+     */
+    public List<DetailsOfTheRefuelingPlanSpinning> selectDetailsOfTheRefuelingPlanSpinningList(DetailsOfTheRefuelingPlanSpinning detailsOfTheRefuelingPlanSpinning);
+
+    /**
+     * 新增加弹计划详细信息
+     * 
+     * @param detailsOfTheRefuelingPlanSpinning 加弹计划详细信息
+     * @return 结果
+     */
+    public int insertDetailsOfTheRefuelingPlanSpinning(DetailsOfTheRefuelingPlanSpinning detailsOfTheRefuelingPlanSpinning);
+
+    /**
+     * 批量新增
+     * @param detailsOfTheRefuelingPlanSpinnings
+     * @return
+     */
+    public int  insertBatchDetailsOfTheRefuelingPlanSpinning(List<DetailsOfTheRefuelingPlanSpinning> detailsOfTheRefuelingPlanSpinnings);
+
+    /**
+     * 修改加弹计划详细信息
+     * 
+     * @param detailsOfTheRefuelingPlanSpinning 加弹计划详细信息
+     * @return 结果
+     */
+    public int updateDetailsOfTheRefuelingPlanSpinning(DetailsOfTheRefuelingPlanSpinning detailsOfTheRefuelingPlanSpinning);
+
+    /**
+     * 删除加弹计划详细信息
+     * 
+     * @param id 加弹计划详细信息主键
+     * @return 结果
+     */
+    public int deleteDetailsOfTheRefuelingPlanSpinningById(Long id);
+
+    /**
+     * 批量删除加弹计划详细信息
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteDetailsOfTheRefuelingPlanSpinningByIds(Long[] ids);
+}

+ 11 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/mapper/SaleOrderMapper.java

@@ -3,6 +3,7 @@ package com.zkqy.business.mapper;
 import java.util.List;
 import com.zkqy.business.domain.SaleOrder;
 import com.zkqy.business.domain.vo.SaleOrderVO;
+import org.apache.ibatis.annotations.Mapper;
 
 /**
  * 销售订单Mapper接口
@@ -10,6 +11,7 @@ import com.zkqy.business.domain.vo.SaleOrderVO;
  * @author zkqy
  * @date 2024-03-14
  */
+@Mapper
 public interface SaleOrderMapper 
 {
     /**
@@ -44,6 +46,15 @@ public interface SaleOrderMapper
      */
     public int updateSaleOrder(SaleOrder saleOrder);
 
+    public int updateSaleOrderBySaleNo(SaleOrder saleOrder);
+    /**
+     * 批量修改销售订单
+     *
+     * @param saleOrder 销售订单
+     * @return 结果
+     */
+    public int updateSaleOrderBatch(List<SaleOrder> saleOrder);
+
     /**
      * 删除销售订单
      * 

+ 8 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/mapper/SaleProductsMapper.java

@@ -3,6 +3,7 @@ package com.zkqy.business.mapper;
 import java.util.List;
 import com.zkqy.business.domain.SaleProducts;
 import com.zkqy.business.domain.vo.SaleProductsVo;
+import org.apache.ibatis.annotations.Mapper;
 
 /**
  * 销售产品Mapper接口
@@ -10,6 +11,7 @@ import com.zkqy.business.domain.vo.SaleProductsVo;
  * @author zkqy
  * @date 2024-03-14
  */
+@Mapper
 public interface SaleProductsMapper 
 {
     /**
@@ -50,6 +52,12 @@ public interface SaleProductsMapper
      */
     public int updateSaleProducts(SaleProducts saleProducts);
 
+    /**
+     * 批量修改线号
+     * @param saleProducts
+     * @return
+     */
+    public int updateSaleProductBatch(List<SaleProducts> saleProducts);
     /**
      * 删除销售产品
      * 

+ 15 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/service/IAmmunitionPlanInformationIntermediateTableService.java

@@ -2,6 +2,7 @@ package com.zkqy.business.service;
 
 import java.util.List;
 import com.zkqy.business.domain.AmmunitionPlanInformationIntermediateTable;
+import com.zkqy.business.domain.DetailsOfTheRefuelingPlan;
 import com.zkqy.business.domain.vo.AmmunitionPlanInformationIntermediateTableRVo;
 import com.zkqy.business.domain.vo.AmmunitionPlanInformationIntermediateTableVo;
 
@@ -60,4 +61,18 @@ public interface IAmmunitionPlanInformationIntermediateTableService
      * @return 结果
      */
     public int deleteAmmunitionPlanInformationIntermediateTableById(Long id);
+
+    /**
+     * 修改产线用的查询
+     * @param machineId
+     * @return
+     */
+    List<DetailsOfTheRefuelingPlan> getAllPlanListByMachineId(String machineId);
+
+    /**
+     * 根据类型查询计划信息
+     * @param detailsOfTheRefuelingPlan
+     * @return
+     */
+    List<DetailsOfTheRefuelingPlan> getAllPlanListByProductType(DetailsOfTheRefuelingPlan detailsOfTheRefuelingPlan);
 }

+ 77 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/service/IDetailsOfTheRefuelingPlanSpinningService.java

@@ -0,0 +1,77 @@
+package com.zkqy.business.service;
+
+import java.util.List;
+import com.zkqy.business.domain.DetailsOfTheRefuelingPlanSpinning;
+import com.zkqy.business.domain.vo.DetailsOfTheRefuelingPlanSpinningRVo;
+import com.zkqy.business.domain.vo.DetailsOfTheRefuelingPlanSpinningVo;
+
+/**
+ * 加弹计划详细信息Service接口
+ * 
+ * @author zkqy
+ * @date 2024-04-09
+ */
+public interface IDetailsOfTheRefuelingPlanSpinningService 
+{
+    /**
+     * 查询加弹计划详细信息
+     * 
+     * @param id 加弹计划详细信息主键
+     * @return 加弹计划详细信息
+     */
+    public DetailsOfTheRefuelingPlanSpinning selectDetailsOfTheRefuelingPlanSpinningById(Long id);
+
+    /**
+     * 查询加弹计划详细信息列表
+     * 
+     * @param detailsOfTheRefuelingPlanSpinning 加弹计划详细信息
+     * @return 加弹计划详细信息集合
+     */
+    public List<DetailsOfTheRefuelingPlanSpinningRVo> selectDetailsOfTheRefuelingPlanSpinningList(DetailsOfTheRefuelingPlanSpinningVo detailsOfTheRefuelingPlanSpinning);
+
+    /**
+     * 信息列表
+     * @param detailsOfTheRefuelingPlanSpinning
+     * @return
+     */
+    public List<DetailsOfTheRefuelingPlanSpinning> selectDetailsOfTheRefuelingPlanSpinningListInfo(DetailsOfTheRefuelingPlanSpinningVo detailsOfTheRefuelingPlanSpinning);
+
+    /**
+     * 新增加弹计划详细信息
+     * 
+     * @param detailsOfTheRefuelingPlanSpinning 加弹计划详细信息
+     * @return 结果
+     */
+    public int insertDetailsOfTheRefuelingPlanSpinning(DetailsOfTheRefuelingPlanSpinning detailsOfTheRefuelingPlanSpinning);
+
+    /**
+     * 修改加弹计划详细信息
+     * 
+     * @param detailsOfTheRefuelingPlanSpinning 加弹计划详细信息
+     * @return 结果
+     */
+    public int updateDetailsOfTheRefuelingPlanSpinning(DetailsOfTheRefuelingPlanSpinning detailsOfTheRefuelingPlanSpinning);
+
+    /**
+     * 批量删除加弹计划详细信息
+     * 
+     * @param ids 需要删除的加弹计划详细信息主键集合
+     * @return 结果
+     */
+    public int deleteDetailsOfTheRefuelingPlanSpinningByIds(Long[] ids);
+
+    /**
+     * 删除加弹计划详细信息信息
+     * 
+     * @param id 加弹计划详细信息主键
+     * @return 结果
+     */
+    public int deleteDetailsOfTheRefuelingPlanSpinningById(Long id);
+
+    /**
+     * 批量插入
+     * @param detailsOfTheRefuelingPlanSpinning
+     * @return
+     */
+    int insertDetailsOfTheRefuelingPlanSpinningBatch(List<DetailsOfTheRefuelingPlanSpinning> detailsOfTheRefuelingPlanSpinning);
+}

+ 314 - 67
zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/AmmunitionPlanInformationIntermediateTableServiceImpl.java

@@ -5,17 +5,15 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.stream.Collectors;
 
-import com.zkqy.business.domain.DetailsOfTheRefuelingPlan;
-import com.zkqy.business.domain.ProductionLine;
+import com.zkqy.business.domain.*;
 import com.zkqy.business.domain.vo.AmmunitionPlanInformationIntermediateTableRVo;
 import com.zkqy.business.domain.vo.AmmunitionPlanInformationIntermediateTableVo;
-import com.zkqy.business.mapper.DetailsOfTheRefuelingPlanMapper;
-import com.zkqy.business.mapper.ProductionLineMapper;
+import com.zkqy.business.mapper.*;
 import com.zkqy.common.utils.StringUtils;
+import com.zkqy.common.utils.spring.SpringUtils;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.zkqy.business.mapper.AmmunitionPlanInformationIntermediateTableMapper;
-import com.zkqy.business.domain.AmmunitionPlanInformationIntermediateTable;
 import com.zkqy.business.service.IAmmunitionPlanInformationIntermediateTableService;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -38,6 +36,12 @@ public class AmmunitionPlanInformationIntermediateTableServiceImpl implements IA
     @Autowired
     private ProductionLineMapper productionLineMapper;
 
+    @Autowired
+    private SaleOrderMapper saleOrderMapper;
+
+    @Autowired
+    private SaleProductsMapper saleProductsMapper;
+
     /**
      * 新增加弹计划信息
      *
@@ -48,18 +52,31 @@ public class AmmunitionPlanInformationIntermediateTableServiceImpl implements IA
     @Transactional
     public int insertAmmunitionPlanInformationIntermediateTable(AmmunitionPlanInformationIntermediateTable ammunitionPlanInformationIntermediateTable)
     {
-        //1、新增加弹计划表数据
-        int insertCount = ammunitionPlanInformationIntermediateTableMapper.insertAmmunitionPlanInformationIntermediateTable(ammunitionPlanInformationIntermediateTable);
-        //2、更新加弹详细信息计划表
-        if(insertCount>0){
-             //计划集合
-            List<DetailsOfTheRefuelingPlan> detailsOfTheRefuelingPlanList=new ArrayList<>();
-            detailsOfTheRefuelingPlanMapper.insertBatchDetailsOfTheRefuelingPlan(detailsOfTheRefuelingPlanList);
-        }
-        return 1;
+//        List<SaleOrder> saleOrderList=new ArrayList<>();
+//        List<SaleProducts> saleProductsList=new ArrayList<>();
+//        //改批号,和产线号
+//        ammunitionPlanInformationIntermediateTable.getDetailsOfTheRefuelingPlans().forEach(item->{
+//            //改掉某个订单的批号
+//            SaleOrder saleOrder = new SaleOrder();
+//            //当初计划要存,业务员id,后期存的内容是订单号
+//            saleOrder.setSaleNo(item.getSalesmanId().toString());
+//            saleOrder.setLotNumber(item.getCurrentLotNumber().toString());
+//            saleOrderList.add(saleOrder);
+//            //改产品的线号
+//            SaleProducts saleProducts=new SaleProducts();
+//            saleProducts.setId(Long.valueOf(item.getProductId()));
+//            saleProducts.setProductionLineNo(item.getMachineId());
+//            saleProductsList.add(saleProducts);
+//        });
+//        //更新批号
+//        int i1 = saleOrderMapper.updateSaleOrderBatch(saleOrderList);
+//        //更新产线
+//        int i2 = saleProductsMapper.updateSaleProductBatch(saleProductsList);
+        //插入计划数据
+        int i3 = detailsOfTheRefuelingPlanMapper.insertBatchDetailsOfTheRefuelingPlan(ammunitionPlanInformationIntermediateTable.getDetailsOfTheRefuelingPlans());
+        return i3;
     }
 
-
     /**
      * 查询加弹计划信息
      * 
@@ -79,7 +96,7 @@ public class AmmunitionPlanInformationIntermediateTableServiceImpl implements IA
      * @return 加弹计划信息
      */
     @Override
-    public List<AmmunitionPlanInformationIntermediateTableRVo> selectAmmunitionPlanInformationIntermediateTableList(AmmunitionPlanInformationIntermediateTableVo ammunitionPlanInformationIntermediateTablVo)
+    public List<AmmunitionPlanInformationIntermediateTableRVo>  selectAmmunitionPlanInformationIntermediateTableList(AmmunitionPlanInformationIntermediateTableVo ammunitionPlanInformationIntermediateTablVo)
     {
         //查询产线信息
         ProductionLine productionLine=new ProductionLine();
@@ -98,64 +115,276 @@ public class AmmunitionPlanInformationIntermediateTableServiceImpl implements IA
         List<AmmunitionPlanInformationIntermediateTableRVo> list=new ArrayList<>();
         //循环固定死的产线
         productionLines.stream().forEach(item -> {
-            //拿到了某个车间的所有产线
-            AmmunitionPlanInformationIntermediateTableRVo rs1=new AmmunitionPlanInformationIntermediateTableRVo();
-            rs1.setMachineId(item.getProductionLineNo());//产线号
-            //所有的计划都属于这个产线、所以不能根据产线去查,计划详情
-            //先根据产线号去查询计划信息
-            AmmunitionPlanInformationIntermediateTable ammunitionPlanInformationIntermediateTable=new AmmunitionPlanInformationIntermediateTable();
-            ammunitionPlanInformationIntermediateTable.setMachineId(item.getProductionLineNo());
-            //拿到了所有的计划随机码 一个产线对应许多的随机码
-            List<AmmunitionPlanInformationIntermediateTable> ammunitionPlanInformationIntermediateTables = ammunitionPlanInformationIntermediateTableMapper.selectAmmunitionPlanInformationIntermediateTableList(ammunitionPlanInformationIntermediateTable);
-            if(ammunitionPlanInformationIntermediateTables.size()>0){
-                //循环的是随机码
-                ammunitionPlanInformationIntermediateTables.stream().forEach(it->{
-                    //=====
-                    AmmunitionPlanInformationIntermediateTableRVo rs=new AmmunitionPlanInformationIntermediateTableRVo();
-                    rs.setMachineId(item.getProductionLineNo());//产线号
-                    //=====
-                    DetailsOfTheRefuelingPlan detailsOfTheRefuelingPlan=new DetailsOfTheRefuelingPlan();
-                    detailsOfTheRefuelingPlan.setTimestampRandomCode(it.getTimestampRandomCode());//计划随机码
-                    detailsOfTheRefuelingPlan.setPlanStatus("0");//状态是未完成的 ---先查询A面的查出来放一块
-                    //查询的是计划信息列表
-                    List<DetailsOfTheRefuelingPlan> detailsOfTheRefuelingPlans = detailsOfTheRefuelingPlanMapper.selectDetailsOfTheRefuelingPlanList(detailsOfTheRefuelingPlan);
-                    //构造一个合适的对象放到 list
-                    if(detailsOfTheRefuelingPlans.size()>0){
-                        //第一不部分的构造数据
-                        rs.setCurrentColorCode(detailsOfTheRefuelingPlans.get(0).getCurrentColorCode());//色号
-                        rs.setCurrentSpecification(detailsOfTheRefuelingPlans.get(0).getCurrentSpecification());//生产规格
-                        rs.setCurrentLotNumber(detailsOfTheRefuelingPlans.get(0).getCurrentLotNumber().toString());//生产批号
-                        rs.setCurrentSpindleCount(detailsOfTheRefuelingPlans.get(0).getCurrentSpindleCount());//锭数
-                        rs.setStartTime(detailsOfTheRefuelingPlans.get(0).getStartTime());//上机时间
-                        rs.setPlannedEndTime(detailsOfTheRefuelingPlans.get(0).getPlannedEndTime());//下机时间
-                        //一个机台可能有好多任务、用随机码给解决掉了、
-                        //一个机台有分AB面(假如我第一条数据是A面、第二条数据是B面?怎么办?)
-                        rs.setProductType(detailsOfTheRefuelingPlans.get(0).getProductType());//A面
-                        if(detailsOfTheRefuelingPlans.size()>2){
-                            rs.setDjCurrentColorCode(detailsOfTheRefuelingPlans.get(1).getCurrentColorCode());//色号
-                            rs.setDjCurrentSpecification(detailsOfTheRefuelingPlans.get(1).getCurrentSpecification());//生产规格
-                            rs.setDjNumber(detailsOfTheRefuelingPlans.get(1).getNumber());//数量
-                            rs.setDjCurrentLotNumber(detailsOfTheRefuelingPlans.get(1).getCurrentLotNumber().toString());//批号
-                        }
-                        if(detailsOfTheRefuelingPlans.size()>=3){
-                            String combinedCodes = detailsOfTheRefuelingPlans.stream()
-                                    .skip(2) // 排除前两个元素
-                                    .map(plan -> plan.getCurrentColorCode()+ plan.getCurrentLotNumber()) // 将色号和批号拼接成字符串
-                                    .collect(Collectors.joining(","));
-//                            HashMap hashMap=new HashMap();
-//                            hashMap.put(it.getTimestampRandomCode(),combinedCodes);
-                            rs.setListOfPendingProduction(combinedCodes);
-                        }
+            //A面待生产
+            DetailsOfTheRefuelingPlan detailsOfTheRefuelingPlan2=new DetailsOfTheRefuelingPlan();
+            detailsOfTheRefuelingPlan2.setMachineId(item.getProductionLineNo());//产线号
+            detailsOfTheRefuelingPlan2.setPlanStatus("0");
+            detailsOfTheRefuelingPlan2.setProductType("A面");
+            List<DetailsOfTheRefuelingPlan> detailsOfTheRefuelingPlans2 = detailsOfTheRefuelingPlanMapper.selectDetailsOfTheRefuelingPlanList(detailsOfTheRefuelingPlan2);
+            //B面的待生产
+            DetailsOfTheRefuelingPlan detailsOfTheRefuelingPlan3=new DetailsOfTheRefuelingPlan();
+            detailsOfTheRefuelingPlan3.setMachineId(item.getProductionLineNo());//产线号
+            detailsOfTheRefuelingPlan3.setPlanStatus("0");
+            detailsOfTheRefuelingPlan3.setProductType("B面");
+            List<DetailsOfTheRefuelingPlan> detailsOfTheRefuelingPlans3 = detailsOfTheRefuelingPlanMapper.selectDetailsOfTheRefuelingPlanList(detailsOfTheRefuelingPlan3);
+            //查询产线A面上机的
+            DetailsOfTheRefuelingPlan Asj=new DetailsOfTheRefuelingPlan();
+            Asj.setMachineId(item.getProductionLineNo());//产线号
+            Asj.setPlanStatus("1");
+            Asj.setProductType("A面");
+            List<DetailsOfTheRefuelingPlan> AList = detailsOfTheRefuelingPlanMapper.selectDetailsOfTheRefuelingPlanList(Asj);
+            if(AList.size()>0){
+                //A面上机产品
+                AList.stream().forEach(item1->{
+                    //拿到了某个车间的所有产线
+                    AmmunitionPlanInformationIntermediateTableRVo rs1=new AmmunitionPlanInformationIntermediateTableRVo();
+                    rs1.setMachineId(item.getProductionLineNo());//产线号
+                    AmmunitionPlanInformationIntermediateTableRVo ammunitionPlanInformationIntermediateTableRVo=new AmmunitionPlanInformationIntermediateTableRVo();
+                    BeanUtils.copyProperties(item1,ammunitionPlanInformationIntermediateTableRVo);
+                    BeanUtils.copyProperties(item1,rs1);
+                    rs1.setCurrentLotNumber(item1.getCurrentLotNumber().toString());
+                    //当前产线A面待生产
+                    String collect = detailsOfTheRefuelingPlans2.stream().map(plan -> plan.getCurrentColorCode() + "-(" + plan.getCurrentLotNumber() + ")").collect(Collectors.joining(","));
+                    rs1.setListOfPendingProduction(collect);
+                    list.add(rs1);
+                });
+                //A停机的
+                DetailsOfTheRefuelingPlan detailsOfTheRefuelingPlan4=new DetailsOfTheRefuelingPlan();
+                detailsOfTheRefuelingPlan4.setMachineId(item.getProductionLineNo());//产线号
+                detailsOfTheRefuelingPlan4.setPlanStatus("2");
+                detailsOfTheRefuelingPlan4.setProductType("A面");
+                List<DetailsOfTheRefuelingPlan> detailsOfTheRefuelingPlans4 = detailsOfTheRefuelingPlanMapper.selectDetailsOfTheRefuelingPlanList(detailsOfTheRefuelingPlan4);
+
+                if(detailsOfTheRefuelingPlans4.size()>0){
+                    detailsOfTheRefuelingPlans4.stream().forEach(item1->{
+                        //拿到了某个车间的所有产线
+                        AmmunitionPlanInformationIntermediateTableRVo rs1=new AmmunitionPlanInformationIntermediateTableRVo();
+                        rs1.setMachineId(item.getProductionLineNo());//产线号
+                        rs1.setProductType("A面");
+                        BeanUtils.copyProperties(item1,rs1);
+                        rs1.setStartTime("停机");
+                        rs1.setCurrentLotNumber(item1.getCurrentLotNumber().toString());
+                        //当前产线b面待生产
+                        String collect = detailsOfTheRefuelingPlans3.stream().map(plan -> plan.getCurrentColorCode() + "-(" + plan.getCurrentLotNumber() + ")").collect(Collectors.joining(","));
+                        rs1.setListOfPendingProduction(collect);
+                        list.add(rs1);
+                    });
+                }
+            }else {
+                if(detailsOfTheRefuelingPlans2.size()>0){
+                    AmmunitionPlanInformationIntermediateTableRVo rs1=new AmmunitionPlanInformationIntermediateTableRVo();
+                    rs1.setMachineId(item.getProductionLineNo());//产线号
+                    String collect = detailsOfTheRefuelingPlans2.stream().map(plan -> plan.getCurrentColorCode() + "-(" + plan.getCurrentLotNumber() + ")").collect(Collectors.joining(","));
+                    rs1.setListOfPendingProduction(collect);
+                    rs1.setProductType("A面");
+                    list.add(rs1);
+                }else {
+                    AmmunitionPlanInformationIntermediateTableRVo rs1=new AmmunitionPlanInformationIntermediateTableRVo();
+                    rs1.setMachineId(item.getProductionLineNo());//产线号
+                    rs1.setProductType("A面");
+                    list.add(rs1);
+                }
+            }
+            //查询B面上机的
+            DetailsOfTheRefuelingPlan Bsj=new DetailsOfTheRefuelingPlan();
+            Bsj.setMachineId(item.getProductionLineNo());//产线号
+            Bsj.setPlanStatus("1");
+            Bsj.setProductType("B面");
+            List<DetailsOfTheRefuelingPlan> BList = detailsOfTheRefuelingPlanMapper.selectDetailsOfTheRefuelingPlanList(Bsj);
+            if(BList.size()>0){
+                //B面上机产品
+                BList.stream().forEach(item1->{
+                    //拿到了某个车间的所有产线
+                    AmmunitionPlanInformationIntermediateTableRVo rs1=new AmmunitionPlanInformationIntermediateTableRVo();
+                    rs1.setMachineId(item.getProductionLineNo());//产线号
+                    AmmunitionPlanInformationIntermediateTableRVo ammunitionPlanInformationIntermediateTableRVo=new AmmunitionPlanInformationIntermediateTableRVo();
+                    BeanUtils.copyProperties(item1,ammunitionPlanInformationIntermediateTableRVo);
+                    BeanUtils.copyProperties(item1,rs1);
+                    rs1.setCurrentLotNumber(item1.getCurrentLotNumber().toString());
+                    //当前产线b面待生产
+                    String collect = detailsOfTheRefuelingPlans3.stream().map(plan -> plan.getCurrentColorCode() + "-(" + plan.getCurrentLotNumber() + ")").collect(Collectors.joining(","));
+                    rs1.setListOfPendingProduction(collect);
+                    list.add(rs1);
+                });
+                        //            //B停机的
+                    DetailsOfTheRefuelingPlan detailsOfTheRefuelingPlan5=new DetailsOfTheRefuelingPlan();
+                    detailsOfTheRefuelingPlan5.setMachineId(item.getProductionLineNo());//产线号
+                    detailsOfTheRefuelingPlan5.setPlanStatus("2");
+                    detailsOfTheRefuelingPlan5.setProductType("B面");
+                    List<DetailsOfTheRefuelingPlan> detailsOfTheRefuelingPlans5 = detailsOfTheRefuelingPlanMapper.selectDetailsOfTheRefuelingPlanList(detailsOfTheRefuelingPlan5);
+
+                    if(detailsOfTheRefuelingPlans5.size()>0){
+                        detailsOfTheRefuelingPlans5.stream().forEach(item1->{
+                            //拿到了某个车间的所有产线
+                            AmmunitionPlanInformationIntermediateTableRVo rs1=new AmmunitionPlanInformationIntermediateTableRVo();
+                            rs1.setMachineId(item.getProductionLineNo());//产线号
+                            rs1.setProductType("B面");
+                            rs1.setStartTime("停机");
+                            rs1.setCurrentLotNumber(item1.getCurrentLotNumber().toString());
+                            //当前产线b面待生产
+                            String collect = detailsOfTheRefuelingPlans3.stream().map(plan -> plan.getCurrentColorCode() + "-(" + plan.getCurrentLotNumber() + ")").collect(Collectors.joining(","));
+                            rs1.setListOfPendingProduction(collect);
+                            list.add(rs1);
+                        });
                     }
-                    //把计划对象添加进去
-                    list.add(rs);
+
+            }else {
+                //A面上没有上级产品(看看他有没有待机产品)
+                if(detailsOfTheRefuelingPlans3.size()>0){
+                    AmmunitionPlanInformationIntermediateTableRVo rs1=new AmmunitionPlanInformationIntermediateTableRVo();
+                    rs1.setMachineId(item.getProductionLineNo());//产线号
+                    String collect = detailsOfTheRefuelingPlans3.stream().map(plan -> plan.getCurrentColorCode() + "-(" + plan.getCurrentLotNumber() + ")").collect(Collectors.joining(","));
+                    rs1.setListOfPendingProduction(collect);
+                    rs1.setProductType("B面");
+                    list.add(rs1);
+                }else {
+                    AmmunitionPlanInformationIntermediateTableRVo rs1=new AmmunitionPlanInformationIntermediateTableRVo();
+                    rs1.setMachineId(item.getProductionLineNo());//产线号
+                    rs1.setProductType("B面");
+                    list.add(rs1);
+                }
+            }
+/*            //所有的计划都属于这个产线、所以不能根据产线去查,计划详情
+            //查这个产线的待生产产品
+            DetailsOfTheRefuelingPlan detailsOfTheRefuelingPlan=new DetailsOfTheRefuelingPlan();
+            detailsOfTheRefuelingPlan.setMachineId(item.getProductionLineNo());//产线号
+            detailsOfTheRefuelingPlan.setPlanStatus("1");
+            //查询都是上机的产品(不管A面还是B面)
+            List<DetailsOfTheRefuelingPlan> detailsOfTheRefuelingPlans = detailsOfTheRefuelingPlanMapper.selectDetailsOfTheRefuelingPlanList(detailsOfTheRefuelingPlan);
+            //查询未上级的产品 (不管A面还是B面)
+            DetailsOfTheRefuelingPlan detailsOfTheRefuelingPlan4=new DetailsOfTheRefuelingPlan();
+            detailsOfTheRefuelingPlan4.setMachineId(item.getProductionLineNo());//产线号
+            detailsOfTheRefuelingPlan4.setPlanStatus("1");
+
+            //A面的待生产
+            DetailsOfTheRefuelingPlan detailsOfTheRefuelingPlan2=new DetailsOfTheRefuelingPlan();
+            detailsOfTheRefuelingPlan2.setMachineId(item.getProductionLineNo());//产线号
+            detailsOfTheRefuelingPlan2.setPlanStatus("0");
+            detailsOfTheRefuelingPlan2.setProductType("A面");
+            List<DetailsOfTheRefuelingPlan> detailsOfTheRefuelingPlans2 = detailsOfTheRefuelingPlanMapper.selectDetailsOfTheRefuelingPlanList(detailsOfTheRefuelingPlan2);
+            //B面的待生产
+            DetailsOfTheRefuelingPlan detailsOfTheRefuelingPlan3=new DetailsOfTheRefuelingPlan();
+            detailsOfTheRefuelingPlan3.setMachineId(item.getProductionLineNo());//产线号
+            detailsOfTheRefuelingPlan3.setPlanStatus("0");
+            detailsOfTheRefuelingPlan3.setProductType("B面");
+            List<DetailsOfTheRefuelingPlan> detailsOfTheRefuelingPlans3 = detailsOfTheRefuelingPlanMapper.selectDetailsOfTheRefuelingPlanList(detailsOfTheRefuelingPlan3);
+
+               boolean isFlagA=false;
+                          boolean isFlagB=false;
+                           //循环每个上机产品
+                           detailsOfTheRefuelingPlans.forEach(it->{
+                               //查询他的待上机(A面待上机或者B面待上机)
+                               if(it.getProductType().contains("A面")||it.getProductType().contains("B面")){
+                                   //执行待产列表上位逻辑
+
+                               }
+                          });
+
+            //正在生产中的
+            if(detailsOfTheRefuelingPlans.size()>0){
+                detailsOfTheRefuelingPlans.forEach(it->{
+                    //拿到了某个车间的所有产线
+                    AmmunitionPlanInformationIntermediateTableRVo rs1=new AmmunitionPlanInformationIntermediateTableRVo();
+                    rs1.setMachineId(item.getProductionLineNo());//产线号
+
+                    BeanUtils.copyProperties(it,rs1);
+                    rs1.setCurrentLotNumber(it.getCurrentLotNumber().toString());
+                    String collect;// 将色号和批号拼接成字符串
+                    if(it.getProductType().equals("A面")){
+                        collect = detailsOfTheRefuelingPlans2.stream().map(plan -> plan.getCurrentColorCode() + "-(" + plan.getCurrentLotNumber() + ")") // 将色号和批号拼接成字符串
+                                .collect(Collectors.joining(","));
+                    }else {
+                        collect = detailsOfTheRefuelingPlans3.stream().map(plan -> plan.getCurrentColorCode() + "-(" + plan.getCurrentLotNumber() + ")") // 将色号和批号拼接成字符串
+                                .collect(Collectors.joining(","));
+                    }
+                    rs1.setListOfPendingProduction(collect);
+                    list.add(rs1);
                 });
             }else {
+                AmmunitionPlanInformationIntermediateTableRVo rs1=new AmmunitionPlanInformationIntermediateTableRVo();
+                rs1.setMachineId(item.getProductionLineNo());//产线号
                 list.add(rs1);
             }
+            //待生产的,
+            detailsOfTheRefuelingPlans3.forEach(ac->{
 
+            });*/
         });
         return list;
+        /**
+         * //        //查询产线信息
+         * //        ProductionLine productionLine=new ProductionLine();
+         * //        productionLine.setProductionLineDepartment("加弹部");
+         * //        productionLine.setProductionLineWorkshop("南车间");
+         * //        //部门
+         * //        if(StringUtils.isNotNull(ammunitionPlanInformationIntermediateTablVo.getProductionLineDepartment())){
+         * //            productionLine.setProductionLineDepartment(ammunitionPlanInformationIntermediateTablVo.getProductionLineDepartment());
+         * //        }
+         * //        //车间
+         * //        if(StringUtils.isNotNull(ammunitionPlanInformationIntermediateTablVo.getProductionLineWorkshop())){
+         * //            productionLine.setProductionLineWorkshop(ammunitionPlanInformationIntermediateTablVo.getProductionLineWorkshop());
+         * //        }
+         * //        List<ProductionLine> productionLines = productionLineMapper.selectProductionLineList(productionLine);
+         * //        //创建产线对象
+         * //        List<AmmunitionPlanInformationIntermediateTableRVo> list=new ArrayList<>();
+         * //        //循环固定死的产线
+         * //        productionLines.stream().forEach(item -> {
+         * //            //拿到了某个车间的所有产线
+         * //            AmmunitionPlanInformationIntermediateTableRVo rs1=new AmmunitionPlanInformationIntermediateTableRVo();
+         * //            rs1.setMachineId(item.getProductionLineNo());//产线号
+         * //            //所有的计划都属于这个产线、所以不能根据产线去查,计划详情
+         * //            //先根据产线号去查询计划信息
+         * //            AmmunitionPlanInformationIntermediateTable ammunitionPlanInformationIntermediateTable=new AmmunitionPlanInformationIntermediateTable();
+         * //            ammunitionPlanInformationIntermediateTable.setMachineId(item.getProductionLineNo());
+         * //            //拿到了所有的计划随机码 一个产线对应许多的随机码
+         * //            List<AmmunitionPlanInformationIntermediateTable> ammunitionPlanInformationIntermediateTables = ammunitionPlanInformationIntermediateTableMapper.selectAmmunitionPlanInformationIntermediateTableList(ammunitionPlanInformationIntermediateTable);
+         * //            if(ammunitionPlanInformationIntermediateTables.size()>0){
+         * //                //循环的是随机码
+         * //                ammunitionPlanInformationIntermediateTables.stream().forEach(it->{
+         * //                    //=====
+         * //                    AmmunitionPlanInformationIntermediateTableRVo rs=new AmmunitionPlanInformationIntermediateTableRVo();
+         * //                    rs.setMachineId(item.getProductionLineNo());//产线号
+         * //                    //=====
+         * //                    DetailsOfTheRefuelingPlan detailsOfTheRefuelingPlan=new DetailsOfTheRefuelingPlan();
+         * //                    detailsOfTheRefuelingPlan.setTimestampRandomCode(it.getTimestampRandomCode());//计划随机码
+         * //                    detailsOfTheRefuelingPlan.setPlanStatus("0");//状态是未完成的 ---先查询A面的查出来放一块
+         * //                    //查询的是计划信息列表
+         * //                    List<DetailsOfTheRefuelingPlan> detailsOfTheRefuelingPlans = detailsOfTheRefuelingPlanMapper.selectDetailsOfTheRefuelingPlanList(detailsOfTheRefuelingPlan);
+         * //                    //构造一个合适的对象放到 list
+         * //                    if(detailsOfTheRefuelingPlans.size()>0){
+         * //                        //第一不部分的构造数据
+         * //                        rs.setCurrentColorCode(detailsOfTheRefuelingPlans.get(0).getCurrentColorCode());//色号
+         * //                        rs.setCurrentSpecification(detailsOfTheRefuelingPlans.get(0).getCurrentSpecification());//生产规格
+         * //                        rs.setCurrentLotNumber(detailsOfTheRefuelingPlans.get(0).getCurrentLotNumber().toString());//生产批号
+         * //                        rs.setCurrentSpindleCount(detailsOfTheRefuelingPlans.get(0).getCurrentSpindleCount());//锭数
+         * //                        rs.setStartTime(detailsOfTheRefuelingPlans.get(0).getStartTime());//上机时间
+         * //                        rs.setPlannedEndTime(detailsOfTheRefuelingPlans.get(0).getPlannedEndTime());//下机时间
+         * //                        //一个机台可能有好多任务、用随机码给解决掉了、
+         * //                        rs.setProductType(detailsOfTheRefuelingPlans.get(0).getProductType());//A面
+         * //                        if(detailsOfTheRefuelingPlans.size()>2){
+         * //                            rs.setDjCurrentColorCode(detailsOfTheRefuelingPlans.get(1).getCurrentColorCode());//色号
+         * //                            rs.setDjCurrentSpecification(detailsOfTheRefuelingPlans.get(1).getCurrentSpecification());//生产规格
+         * //                            rs.setDjNumber(detailsOfTheRefuelingPlans.get(1).getNumber());//数量
+         * //                            rs.setDjCurrentLotNumber(detailsOfTheRefuelingPlans.get(1).getCurrentLotNumber().toString());//批号
+         * //                        }
+         * //                        if(detailsOfTheRefuelingPlans.size()>=3){
+         * //                            String combinedCodes = detailsOfTheRefuelingPlans.stream()
+         * //                                    .skip(2) // 排除前两个元素
+         * //                                    .map(plan -> plan.getCurrentColorCode()+ "-("+plan.getCurrentLotNumber()+")") // 将色号和批号拼接成字符串
+         * //                                    .collect(Collectors.joining(","));
+         * //                            rs.setListOfPendingProduction(combinedCodes);
+         * //                        }
+         * //                    }
+         * //                    //把计划对象添加进去
+         * //                    list.add(rs);
+         * //                });
+         * //            }else {
+         * //                list.add(rs1);
+         * //            }
+         * //
+         * //        });
+         * //        return list;
+         */
     }
 
 
@@ -195,4 +424,22 @@ public class AmmunitionPlanInformationIntermediateTableServiceImpl implements IA
     {
         return ammunitionPlanInformationIntermediateTableMapper.deleteAmmunitionPlanInformationIntermediateTableById(id);
     }
+
+    @Override
+    public List<DetailsOfTheRefuelingPlan> getAllPlanListByMachineId(String machineId) {
+        DetailsOfTheRefuelingPlan detailsOfTheRefuelingPlan3=new DetailsOfTheRefuelingPlan();
+        detailsOfTheRefuelingPlan3.setMachineId(machineId);//产线号
+        List<DetailsOfTheRefuelingPlan> detailsOfTheRefuelingPlans3 = detailsOfTheRefuelingPlanMapper.selectDetailsOfTheRefuelingPlanListDetiles(detailsOfTheRefuelingPlan3);
+        return detailsOfTheRefuelingPlans3;
+    }
+
+    @Override
+    public List<DetailsOfTheRefuelingPlan> getAllPlanListByProductType(DetailsOfTheRefuelingPlan detailsOfTheRefuelingPlan) {
+        DetailsOfTheRefuelingPlan detailsOfTheRefuelingPlan3=new DetailsOfTheRefuelingPlan();
+        detailsOfTheRefuelingPlan3.setMachineId(detailsOfTheRefuelingPlan.getMachineId());//产线号
+        detailsOfTheRefuelingPlan3.setProductType(detailsOfTheRefuelingPlan.getProductType());//类型
+        detailsOfTheRefuelingPlan3.setPlanStatus(detailsOfTheRefuelingPlan.getPlanStatus());//状态
+        List<DetailsOfTheRefuelingPlan> detailsOfTheRefuelingPlans3 = detailsOfTheRefuelingPlanMapper.selectDetailsOfTheRefuelingPlanListDetiles(detailsOfTheRefuelingPlan3);
+        return detailsOfTheRefuelingPlans3;
+    }
 }

+ 45 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/DetailsOfTheRefuelingPlanServiceImpl.java

@@ -1,6 +1,13 @@
 package com.zkqy.business.service.impl;
 
 import java.util.List;
+
+import com.zkqy.business.domain.Materiel;
+import com.zkqy.business.domain.SaleOrder;
+import com.zkqy.business.domain.SaleProducts;
+import com.zkqy.business.mapper.MaterielMapper;
+import com.zkqy.business.mapper.SaleOrderMapper;
+import com.zkqy.business.mapper.SaleProductsMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.zkqy.business.mapper.DetailsOfTheRefuelingPlanMapper;
@@ -18,6 +25,15 @@ public class DetailsOfTheRefuelingPlanServiceImpl implements IDetailsOfTheRefuel
 {
     @Autowired
     private DetailsOfTheRefuelingPlanMapper detailsOfTheRefuelingPlanMapper;
+    @Autowired
+    private SaleOrderMapper saleOrderMapper;
+
+    @Autowired
+    private SaleProductsMapper productsMapper;
+
+    @Autowired
+    private MaterielMapper materielMapper;
+
 
     /**
      * 查询加弹计划详细信息
@@ -64,6 +80,35 @@ public class DetailsOfTheRefuelingPlanServiceImpl implements IDetailsOfTheRefuel
     @Override
     public int updateDetailsOfTheRefuelingPlan(DetailsOfTheRefuelingPlan detailsOfTheRefuelingPlan)
     {
+        /**
+         * //改掉某个订单的批号
+         *         SaleOrder saleOrder = new SaleOrder();
+         *         //当初计划要存,业务员id,后期存的内容是订单号
+         *         saleOrder.setSaleNo(detailsOfTheRefuelingPlan.getSalesmanId().toString());//订单号
+         *         saleOrder.setLotNumber(detailsOfTheRefuelingPlan.getCurrentLotNumber().toString());//批号
+         *         saleOrderMapper.updateSaleOrderBySaleNo(saleOrder);
+         *         /*  //把色号编码给切出来
+         *         String currentColorCode = detailsOfTheRefuelingPlan.getCurrentColorCode();
+         *         String substring = currentColorCode.substring(0, currentColorCode.indexOf("("));
+         *         //去查询母粒编码信息
+         *         Materiel materiel=new Materiel();
+         *         materiel.setMaterieEncoding(substring);
+         *         List<Materiel> materiels = materielMapper.selectMaterielList(materiel);
+         *         if(materiels.size()==0){
+         *             return 0;
+         *         }
+         *         //查询到这个产品对应的母粒信息
+         *         Materiel materiel1 = materiels.get(0);
+         *         SaleProducts saleProducts=new SaleProducts();
+         *         saleProducts.setSaleOrderNo(detailsOfTheRefuelingPlan.getSalesmanId().toString());
+         *         saleProducts.set(detailsOfTheRefuelingPlan.getSalesmanId().toString());
+         *         productsMapper.updateSaleProducts()
+         *SaleProducts saleProducts = new SaleProducts();
+         *saleProducts.setId(Long.valueOf(detailsOfTheRefuelingPlan.getProductId()));//产品id
+         *saleProducts.setProductionLineNo(detailsOfTheRefuelingPlan.getMachineId());//产线编号
+         *         //改这个产品用的那个产线
+         *productsMapper.updateSaleProducts(saleProducts);
+         */
         return detailsOfTheRefuelingPlanMapper.updateDetailsOfTheRefuelingPlan(detailsOfTheRefuelingPlan);
     }
 

+ 230 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/DetailsOfTheRefuelingPlanSpinningServiceImpl.java

@@ -0,0 +1,230 @@
+package com.zkqy.business.service.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import com.zkqy.business.domain.*;
+import com.zkqy.business.domain.vo.DetailsOfTheRefuelingPlanSpinningRVo;
+import com.zkqy.business.domain.vo.DetailsOfTheRefuelingPlanSpinningVo;
+import com.zkqy.business.mapper.ProductionLineMapper;
+import com.zkqy.business.mapper.SaleOrderMapper;
+import com.zkqy.business.mapper.SaleProductsMapper;
+import com.zkqy.common.utils.DateUtils;
+import com.zkqy.common.utils.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.zkqy.business.mapper.DetailsOfTheRefuelingPlanSpinningMapper;
+import com.zkqy.business.service.IDetailsOfTheRefuelingPlanSpinningService;
+
+/**
+ * 加弹计划详细信息Service业务层处理
+ *
+ * @author zkqy
+ * @date 2024-04-09
+ */
+@Service
+public class DetailsOfTheRefuelingPlanSpinningServiceImpl implements IDetailsOfTheRefuelingPlanSpinningService {
+
+    @Autowired
+    private DetailsOfTheRefuelingPlanSpinningMapper detailsOfTheRefuelingPlanSpinningMapper;
+
+    @Autowired
+    private ProductionLineMapper productionLineMapper;
+
+    @Autowired
+    private SaleOrderMapper saleOrderMapper;
+
+    @Autowired
+    private SaleProductsMapper saleProductsMapper;
+    /**
+     * 查询加弹计划详细信息
+     *
+     * @param id 加弹计划详细信息主键
+     * @return 加弹计划详细信息
+     */
+    @Override
+    public DetailsOfTheRefuelingPlanSpinning selectDetailsOfTheRefuelingPlanSpinningById(Long id) {
+        return detailsOfTheRefuelingPlanSpinningMapper.selectDetailsOfTheRefuelingPlanSpinningById(id);
+    }
+
+    /**
+     * 查询加弹计划详细信息列表
+     *
+     * @param detailsOfTheRefuelingPlanSpinning 加弹计划详细信息
+     * @return 加弹计划详细信息
+     */
+    @Override
+    public List<DetailsOfTheRefuelingPlanSpinningRVo> selectDetailsOfTheRefuelingPlanSpinningList(DetailsOfTheRefuelingPlanSpinningVo detailsOfTheRefuelingPlanSpinning) {
+        //查询产线信息
+        ProductionLine productionLine = new ProductionLine();
+        //部门
+        if (StringUtils.isNotNull(detailsOfTheRefuelingPlanSpinning.getProductionLineDepartment())) {
+            productionLine.setProductionLineDepartment(detailsOfTheRefuelingPlanSpinning.getProductionLineDepartment());
+        }
+        List<ProductionLine> productionLines = productionLineMapper.selectProductionLineList(productionLine);
+        //存放产线计划的集合
+        List<DetailsOfTheRefuelingPlanSpinningRVo> list = new ArrayList<>();
+        //循环固定死的产线
+        productionLines.stream().forEach(item -> {
+            //先根据产线号去查询计划信息
+            DetailsOfTheRefuelingPlanSpinning spinning = new DetailsOfTheRefuelingPlanSpinning();
+            spinning.setMachineId(item.getProductionLineNo());
+            //直接根据产线号拿计划,
+            List<DetailsOfTheRefuelingPlanSpinning> detailsOfTheRefuelingPlanSpinnings = detailsOfTheRefuelingPlanSpinningMapper.selectDetailsOfTheRefuelingPlanSpinningList(spinning);
+            List<DetailsOfTheRefuelingPlanSpinning>  tj= detailsOfTheRefuelingPlanSpinnings.stream().filter(plan -> plan.getPlanStatus().equals("2")).collect(Collectors.toList());
+            if(tj.size()>0){
+                DetailsOfTheRefuelingPlanSpinning tj1 = tj.get(0);
+                //拿到了某个车间的所有产线
+                DetailsOfTheRefuelingPlanSpinningRVo rs2 = new DetailsOfTheRefuelingPlanSpinningRVo();
+                rs2.setMachineId(item.getProductionLineNo());//产线号
+                //把第一个元素给拷贝过去
+                BeanUtils.copyProperties(tj1, rs2);
+                rs2.setCurrentLotNumber("");
+                rs2.setCurrentSpecification("停机");
+                rs2.setStartTime("");
+                rs2.setPlannedEndTime("");
+                List<String> collect = detailsOfTheRefuelingPlanSpinnings.stream().filter(plan -> plan.getPlanStatus().equals("0")).map(plan -> plan.getCurrentColorCode() + "-(" + plan.getCurrentLotNumber() + ")").collect(Collectors.toList());
+                rs2.setPlannedProduction(collect);
+                list.add(rs2);
+            }else {
+                if (detailsOfTheRefuelingPlanSpinnings.size() > 0) {
+                    List<DetailsOfTheRefuelingPlanSpinning> shangJiPlan = detailsOfTheRefuelingPlanSpinnings.stream().filter(plan -> plan.getPlanStatus().equals("1")).collect(Collectors.toList());
+                    //找到生产中的
+                    if( shangJiPlan.size()>0){
+                        DetailsOfTheRefuelingPlanSpinning spinning1 = shangJiPlan.get(0);
+                        //拿到了某个车间的所有产线
+                        DetailsOfTheRefuelingPlanSpinningRVo rs1 = new DetailsOfTheRefuelingPlanSpinningRVo();
+                        rs1.setMachineId(item.getProductionLineNo());//产线号
+                        //把第一个元素给拷贝过去
+                        BeanUtils.copyProperties(spinning1, rs1);
+                        List<String> collect = detailsOfTheRefuelingPlanSpinnings.stream().filter(plan -> plan.getPlanStatus().equals("0")).map(plan -> plan.getCurrentColorCode() + "-(" + plan.getCurrentLotNumber() + ")").collect(Collectors.toList());
+                        rs1.setPlannedProduction(collect);
+                        list.add(rs1);
+
+                    }else {
+                        //拿到了某个车间的所有产线
+                        DetailsOfTheRefuelingPlanSpinningRVo rs1 = new DetailsOfTheRefuelingPlanSpinningRVo();
+                        rs1.setMachineId(item.getProductionLineNo());//产线号
+                        List<String> collect = detailsOfTheRefuelingPlanSpinnings.stream().filter(plan -> plan.getPlanStatus().equals("0")).map(plan -> plan.getCurrentColorCode() + "-(" + plan.getCurrentLotNumber() + ")").collect(Collectors.toList());
+                        rs1.setPlannedProduction(collect);
+                        list.add(rs1);
+                    }
+                } else {
+                    //拿到了某个车间的所有产线
+                    DetailsOfTheRefuelingPlanSpinningRVo rs1 = new DetailsOfTheRefuelingPlanSpinningRVo();
+                    rs1.setMachineId(item.getProductionLineNo());//产线号
+                    list.add(rs1);
+                }
+            }
+
+        });
+        return list;
+    }
+
+
+    @Override
+    public List<DetailsOfTheRefuelingPlanSpinning> selectDetailsOfTheRefuelingPlanSpinningListInfo(DetailsOfTheRefuelingPlanSpinningVo detailsOfTheRefuelingPlanSpinning) {
+        return detailsOfTheRefuelingPlanSpinningMapper.selectDetailsOfTheRefuelingPlanSpinningList(detailsOfTheRefuelingPlanSpinning);
+    }
+    /**
+     * 新增加弹计划详细信息
+     *
+     * @param detailsOfTheRefuelingPlanSpinning 加弹计划详细信息
+     * @return 结果
+     */
+    @Override
+    public int insertDetailsOfTheRefuelingPlanSpinning(DetailsOfTheRefuelingPlanSpinning detailsOfTheRefuelingPlanSpinning) {
+        detailsOfTheRefuelingPlanSpinning.setCreateTime(DateUtils.getNowDate());
+        return detailsOfTheRefuelingPlanSpinningMapper.insertDetailsOfTheRefuelingPlanSpinning(detailsOfTheRefuelingPlanSpinning);
+    }
+
+    /**
+     * 修改加弹计划详细信息
+     *
+     * @param detailsOfTheRefuelingPlanSpinning 加弹计划详细信息
+     * @return 结果
+     */
+    @Override
+    public int updateDetailsOfTheRefuelingPlanSpinning(DetailsOfTheRefuelingPlanSpinning detailsOfTheRefuelingPlanSpinning) {
+//        detailsOfTheRefuelingPlanSpinning.setUpdateTime(DateUtils.getNowDate());
+//        //改掉某个订单的批号
+//        SaleOrder saleOrder = new SaleOrder();
+//        //当初计划要存,业务员id,后期存的内容是订单号
+//        saleOrder.setSaleNo(detailsOfTheRefuelingPlanSpinning.getSalesmanId().toString());//订单号
+//        saleOrder.setLotNumber(detailsOfTheRefuelingPlanSpinning.getCurrentLotNumber().toString());//批号
+//        saleOrderMapper.updateSaleOrderBySaleNo(saleOrder);
+//        /*  //把色号编码给切出来
+//        String currentColorCode = detailsOfTheRefuelingPlan.getCurrentColorCode();
+//        String substring = currentColorCode.substring(0, currentColorCode.indexOf("("));
+//        //去查询母粒编码信息
+//        Materiel materiel=new Materiel();
+//        materiel.setMaterieEncoding(substring);
+//        List<Materiel> materiels = materielMapper.selectMaterielList(materiel);
+//        if(materiels.size()==0){
+//            return 0;
+//        }
+//        //查询到这个产品对应的母粒信息
+//        Materiel materiel1 = materiels.get(0);
+//        SaleProducts saleProducts=new SaleProducts();
+//        saleProducts.setSaleOrderNo(detailsOfTheRefuelingPlan.getSalesmanId().toString());
+//        saleProducts.set(detailsOfTheRefuelingPlan.getSalesmanId().toString());
+//        productsMapper.updateSaleProducts()*/
+//        SaleProducts saleProducts=new SaleProducts();
+//        saleProducts.setId(Long.valueOf(detailsOfTheRefuelingPlanSpinning.getProductId()));//产品id
+//        saleProducts.setProductionLineNo(detailsOfTheRefuelingPlanSpinning.getMachineId());//产线编号
+//        //改这个产品用的那个产线
+//        saleProductsMapper.updateSaleProducts(saleProducts);
+        return detailsOfTheRefuelingPlanSpinningMapper.updateDetailsOfTheRefuelingPlanSpinning(detailsOfTheRefuelingPlanSpinning);
+    }
+
+    /**
+     * 批量删除加弹计划详细信息
+     *
+     * @param ids 需要删除的加弹计划详细信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDetailsOfTheRefuelingPlanSpinningByIds(Long[] ids) {
+        return detailsOfTheRefuelingPlanSpinningMapper.deleteDetailsOfTheRefuelingPlanSpinningByIds(ids);
+    }
+
+    /**
+     * 删除加弹计划详细信息信息
+     *
+     * @param id 加弹计划详细信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDetailsOfTheRefuelingPlanSpinningById(Long id) {
+        return detailsOfTheRefuelingPlanSpinningMapper.deleteDetailsOfTheRefuelingPlanSpinningById(id);
+    }
+
+    @Override
+    public int insertDetailsOfTheRefuelingPlanSpinningBatch(List<DetailsOfTheRefuelingPlanSpinning> detailsOfTheRefuelingPlanSpinning) {
+        //批量插入修改产线号和批号
+        List<SaleOrder> saleOrderList=new ArrayList<>();
+        List<SaleProducts> saleProductsList=new ArrayList<>();
+        //改批号,和产线号
+        detailsOfTheRefuelingPlanSpinning.forEach(item->{
+            //改掉某个订单的批号
+            SaleOrder saleOrder = new SaleOrder();
+            //当初计划要存,业务员id,后期存的内容是订单号
+            saleOrder.setSaleNo(item.getSalesmanId().toString());//订单号
+            saleOrder.setLotNumber(item.getCurrentLotNumber().toString());//批号
+            saleOrderList.add(saleOrder);
+            //改产品的线号,批号
+            SaleProducts saleProducts=new SaleProducts();
+            saleProducts.setId(Long.valueOf(item.getProductId()));
+            saleProducts.setProductionLineNo(item.getMachineId());
+            saleProducts.setLotNumber(item.getCurrentLotNumber().toString());//批号
+            saleProductsList.add(saleProducts);
+        });
+        //更新批号
+        int i1 = saleOrderMapper.updateSaleOrderBatch(saleOrderList);
+        //更新产线
+        int i2 = saleProductsMapper.updateSaleProductBatch(saleProductsList);
+        return detailsOfTheRefuelingPlanSpinningMapper.insertBatchDetailsOfTheRefuelingPlanSpinning(detailsOfTheRefuelingPlanSpinning);
+    }
+}

+ 36 - 10
zkqy-custom-business/src/main/resources/mapper/business/DetailsOfTheRefuelingPlanMapper.xml

@@ -20,7 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectDetailsOfTheRefuelingPlanVo">
-        select id, timestamp_random_code, machine_id, current_color_code, current_specification, current_lot_number, current_spindle_count, start_time, planned_end_time,plan_status,number,productType from {DBNAME}.details_of_the_refueling_plan
+        select id, timestamp_random_code, machine_id, current_color_code, current_specification, current_lot_number, current_spindle_count, start_time, planned_end_time,plan_status,number,productType,product_id,salesman_id from {DBNAME}.details_of_the_refueling_plan
     </sql>
 
     <select id="selectDetailsOfTheRefuelingPlanList" parameterType="com.zkqy.business.domain.DetailsOfTheRefuelingPlan" resultMap="DetailsOfTheRefuelingPlanResult">
@@ -37,7 +37,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="planStatus != null  and planStatus != ''"> and plan_status = #{planStatus}</if>
             <if test="number != null  and number != ''"> and `number` = #{number}</if>
             <if test="productType != null  and productType != ''"> and `productType` = #{productType}</if>
+            <if test="productId != null  and productId != ''"> and `product_id` = #{productId}</if>
+            <if test="salesmanId != null  and salesmanId != ''"> and `salesman_id` = #{salesmanId}</if>
         </where>
+        ORDER BY productType
+    </select>
+
+    <select id="selectDetailsOfTheRefuelingPlanListDetiles" parameterType="com.zkqy.business.domain.DetailsOfTheRefuelingPlan" resultMap="DetailsOfTheRefuelingPlanResult">
+        <include refid="selectDetailsOfTheRefuelingPlanVo"/>
+        <where>
+            <if test="timestampRandomCode != null  and timestampRandomCode != ''"> and timestamp_random_code = #{timestampRandomCode}</if>
+            <if test="machineId != null "> and machine_id = #{machineId}</if>
+            <if test="currentColorCode != null  and currentColorCode != ''"> and current_color_code = #{currentColorCode}</if>
+            <if test="currentSpecification != null  and currentSpecification != ''"> and current_specification = #{currentSpecification}</if>
+            <if test="currentLotNumber != null "> and current_lot_number = #{currentLotNumber}</if>
+            <if test="currentSpindleCount != null  and currentSpindleCount != ''"> and current_spindle_count = #{currentSpindleCount}</if>
+            <if test="startTime != null  and startTime != ''"> and start_time = #{startTime}</if>
+            <if test="plannedEndTime != null  and plannedEndTime != ''"> and planned_end_time = #{plannedEndTime}</if>
+            <if test="planStatus != null  and planStatus != ''"> and plan_status = #{planStatus}</if>
+            <if test="number != null  and number != ''"> and `number` = #{number}</if>
+            <if test="productType != null  and productType != ''"> and `productType` = #{productType}</if>
+            and plan_status!=3
+        </where>
+        ORDER BY CASE WHEN plan_status = 1 THEN 0 ELSE 1 END, plan_status;
     </select>
     
     <select id="selectDetailsOfTheRefuelingPlanById" parameterType="Long" resultMap="DetailsOfTheRefuelingPlanResult">
@@ -79,8 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <insert id="insertBatchDetailsOfTheRefuelingPlan" parameterType="java.util.List">
         INSERT INTO {DBNAME}.details_of_the_refueling_plan
-        (<trim prefix="(" suffix=")" suffixOverrides=",">
-        id,
+        <trim prefix="(" suffix=")" suffixOverrides=",">
         timestamp_random_code,
         machine_id,
         current_color_code,
@@ -89,14 +110,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         current_spindle_count,
         start_time,
         planned_end_time,
-        planStatus,
+        plan_status,
         `number`,
         `productType`,
-    </trim>)
+        `product_id`,
+            `salesman_id`,
+    </trim>
         VALUES
         <foreach collection="list" item="item" separator=",">
-            (<trim prefix="(" suffix=")" suffixOverrides=",">
-            #{item.id},
+            <trim prefix="(" suffix=")" suffixOverrides=",">
             #{item.timestampRandomCode},
             #{item.machineId},
             #{item.currentColorCode},
@@ -104,10 +126,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{item.currentLotNumber},
             #{item.currentSpindleCount},
             #{item.startTime},
+            #{item.plannedEndTime},
             #{item.planStatus},
             #{item.number},
             #{item.productType},
-        </trim>)
+            #{item.productId},
+            #{item.salesmanId},
+        </trim>
         </foreach>
     </insert>
 
@@ -125,9 +150,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="plannedEndTime != null">planned_end_time = #{plannedEndTime},</if>
             <if test="planStatus != null">plan_status = #{planStatus},</if>
             <if test="number != null">`number` = #{number},</if>
-            <if test="productType != null  and productType != ''">`productType`= #{productType}</if>
+            <if test="productType != null  and productType != ''">`productType`= #{productType},</if>
+            <if test="productId != null  and productId != ''">`product_id`= #{productId},</if>
+            <if test="salesmanId != null  and salesmanId != ''">`salesman_id`= #{salesmanId},</if>
         </trim>
-
         where id = #{id}
     </update>
 

+ 181 - 0
zkqy-custom-business/src/main/resources/mapper/business/DetailsOfTheRefuelingPlanSpinningMapper.xml

@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zkqy.business.mapper.DetailsOfTheRefuelingPlanSpinningMapper">
+    
+    <resultMap type="com.zkqy.business.domain.DetailsOfTheRefuelingPlanSpinning" id="DetailsOfTheRefuelingPlanSpinningResult">
+        <result property="id"    column="id"    />
+        <result property="timestampRandomCode"    column="timestamp_random_code"    />
+        <result property="machineId"    column="machine_id"    />
+        <result property="productionDigit"    column="production_digit"    />
+        <result property="currentColorCode"    column="current_color_code"    />
+        <result property="currentSpecification"    column="current_specification"    />
+        <result property="currentLotNumber"    column="current_lot_number"    />
+        <result property="startTime"    column="start_time"    />
+        <result property="plannedEndTime"    column="planned_end_time"    />
+        <result property="planStatus"    column="plan_status"    />
+        <result property="number"    column="number"    />
+        <result property="remark"    column="remark"    />
+        <result property="createbyId"    column="createby_id"    />
+        <result property="createbyName"    column="createby_name"    />
+        <result property="updatebyId"    column="updateby_id"    />
+        <result property="updatebyName"    column="updateby_name"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="productId"    column="product_id"    />
+        <result property="salesmanId"    column="salesman_id"    />
+    </resultMap>
+
+    <sql id="selectDetailsOfTheRefuelingPlanSpinningVo">
+        select id, timestamp_random_code, machine_id, production_digit, current_color_code, current_specification, current_lot_number, start_time, planned_end_time, plan_status, number, remark, createby_id, createby_name, updateby_id, updateby_name, create_time, update_time, product_id, salesman_id from {DBNAME}.details_of_the_refueling_plan_spinning
+    </sql>
+
+    <select id="selectDetailsOfTheRefuelingPlanSpinningList" parameterType="com.zkqy.business.domain.DetailsOfTheRefuelingPlanSpinning" resultMap="DetailsOfTheRefuelingPlanSpinningResult">
+        <include refid="selectDetailsOfTheRefuelingPlanSpinningVo"/>
+        <where>  
+            <if test="timestampRandomCode != null  and timestampRandomCode != ''"> and timestamp_random_code = #{timestampRandomCode}</if>
+            <if test="machineId != null  and machineId != ''"> and machine_id = #{machineId}</if>
+            <if test="productionDigit != null  and productionDigit != ''"> and production_digit = #{productionDigit}</if>
+            <if test="currentColorCode != null  and currentColorCode != ''"> and current_color_code = #{currentColorCode}</if>
+            <if test="currentSpecification != null  and currentSpecification != ''"> and current_specification = #{currentSpecification}</if>
+            <if test="currentLotNumber != null  and currentLotNumber != ''"> and current_lot_number = #{currentLotNumber}</if>
+            <if test="startTime != null  and startTime != ''"> and start_time = #{startTime}</if>
+            <if test="plannedEndTime != null  and plannedEndTime != ''"> and planned_end_time = #{plannedEndTime}</if>
+            <if test="planStatus != null  and planStatus != ''"> and plan_status = #{planStatus}</if>
+            <if test="number != null  and number != ''"> and number = #{number}</if>
+            <if test="createbyId != null  and createbyId != ''"> and createby_id = #{createbyId}</if>
+            <if test="createbyName != null  and createbyName != ''"> and createby_name like concat('%', #{createbyName}, '%')</if>
+            <if test="updatebyId != null  and updatebyId != ''"> and updateby_id = #{updatebyId}</if>
+            <if test="updatebyName != null  and updatebyName != ''"> and updateby_name like concat('%', #{updatebyName}, '%')</if>
+            <if test="productId != null  and productId != ''"> and product_id = #{productId}</if>
+            <if test="salesmanId != null  and salesmanId != ''"> and salesman_id = #{salesmanId}</if>
+        </where>
+    </select>
+    
+    <select id="selectDetailsOfTheRefuelingPlanSpinningById" parameterType="Long" resultMap="DetailsOfTheRefuelingPlanSpinningResult">
+        <include refid="selectDetailsOfTheRefuelingPlanSpinningVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertDetailsOfTheRefuelingPlanSpinning" parameterType="com.zkqy.business.domain.DetailsOfTheRefuelingPlanSpinning" useGeneratedKeys="true" keyProperty="id">
+        insert into {DBNAME}.details_of_the_refueling_plan_spinning
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="timestampRandomCode != null">timestamp_random_code,</if>
+            <if test="machineId != null">machine_id,</if>
+            <if test="productionDigit != null">production_digit,</if>
+            <if test="currentColorCode != null and currentColorCode != ''">current_color_code,</if>
+            <if test="currentSpecification != null">current_specification,</if>
+            <if test="currentLotNumber != null">current_lot_number,</if>
+            <if test="startTime != null">start_time,</if>
+            <if test="plannedEndTime != null">planned_end_time,</if>
+            <if test="planStatus != null">plan_status,</if>
+            <if test="number != null">number,</if>
+            <if test="remark != null">remark,</if>
+            <if test="createbyId != null">createby_id,</if>
+            <if test="createbyName != null">createby_name,</if>
+            <if test="updatebyId != null">updateby_id,</if>
+            <if test="updatebyName != null">updateby_name,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="productId != null">product_id,</if>
+            <if test="salesmanId != null">salesman_id,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="timestampRandomCode != null">#{timestampRandomCode},</if>
+            <if test="machineId != null">#{machineId},</if>
+            <if test="productionDigit != null">#{productionDigit},</if>
+            <if test="currentColorCode != null and currentColorCode != ''">#{currentColorCode},</if>
+            <if test="currentSpecification != null">#{currentSpecification},</if>
+            <if test="currentLotNumber != null">#{currentLotNumber},</if>
+            <if test="startTime != null">#{startTime},</if>
+            <if test="plannedEndTime != null">#{plannedEndTime},</if>
+            <if test="planStatus != null">#{planStatus},</if>
+            <if test="number != null">#{number},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="createbyId != null">#{createbyId},</if>
+            <if test="createbyName != null">#{createbyName},</if>
+            <if test="updatebyId != null">#{updatebyId},</if>
+            <if test="updatebyName != null">#{updatebyName},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="productId != null">#{productId},</if>
+            <if test="salesmanId != null">#{salesmanId},</if>
+         </trim>
+    </insert>
+
+    <update id="updateDetailsOfTheRefuelingPlanSpinning" parameterType="com.zkqy.business.domain.DetailsOfTheRefuelingPlanSpinning">
+        update {DBNAME}.details_of_the_refueling_plan_spinning
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="timestampRandomCode != null">timestamp_random_code = #{timestampRandomCode},</if>
+            <if test="machineId != null">machine_id = #{machineId},</if>
+            <if test="productionDigit != null">production_digit = #{productionDigit},</if>
+            <if test="currentColorCode != null and currentColorCode != ''">current_color_code = #{currentColorCode},</if>
+            <if test="currentSpecification != null">current_specification = #{currentSpecification},</if>
+            <if test="currentLotNumber != null">current_lot_number = #{currentLotNumber},</if>
+            <if test="startTime != null">start_time = #{startTime},</if>
+            <if test="plannedEndTime != null">planned_end_time = #{plannedEndTime},</if>
+            <if test="planStatus != null">plan_status = #{planStatus},</if>
+            <if test="number != null">number = #{number},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="createbyId != null">createby_id = #{createbyId},</if>
+            <if test="createbyName != null">createby_name = #{createbyName},</if>
+            <if test="updatebyId != null">updateby_id = #{updatebyId},</if>
+            <if test="updatebyName != null">updateby_name = #{updatebyName},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="productId != null">product_id = #{productId},</if>
+            <if test="salesmanId != null">salesman_id = #{salesmanId},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteDetailsOfTheRefuelingPlanSpinningById" parameterType="Long">
+        delete from {DBNAME}.details_of_the_refueling_plan_spinning where id = #{id}
+    </delete>
+
+    <delete id="deleteDetailsOfTheRefuelingPlanSpinningByIds" parameterType="String">
+        delete from {DBNAME}.details_of_the_refueling_plan_spinning where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+
+
+
+    <insert id="insertBatchDetailsOfTheRefuelingPlanSpinning" parameterType="java.util.List">
+        INSERT INTO {DBNAME}.details_of_the_refueling_plan_spinning
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            timestamp_random_code,
+            machine_id,
+            current_color_code,
+            current_specification,
+            current_lot_number,
+            production_digit,
+            start_time,
+            planned_end_time,
+            plan_status,
+            `number`,
+            `product_id`,
+            `salesman_id`,
+        </trim>
+        VALUES
+        <foreach collection="list" item="item" separator=",">
+            <trim prefix="(" suffix=")" suffixOverrides=",">
+                #{item.timestampRandomCode},
+                #{item.machineId},
+                #{item.currentColorCode},
+                #{item.currentSpecification},
+                #{item.currentLotNumber},
+                #{item.productionDigit},
+                #{item.startTime},
+                #{item.plannedEndTime},
+                #{item.planStatus},
+                #{item.number},
+                #{item.productId},
+                #{item.salesmanId},
+            </trim>
+        </foreach>
+    </insert>
+</mapper>

+ 17 - 1
zkqy-custom-business/src/main/resources/mapper/business/SaleOrderMapper.xml

@@ -150,7 +150,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </insert>
 
     <update id="updateSaleOrder" parameterType="com.zkqy.business.domain.SaleOrder">
-        update sale_order
+        update {DBNAME}.sale_order
         <trim prefix="SET" suffixOverrides=",">
             <if test="saleNo != null">sale_no = #{saleNo},</if>
             <if test="saleCustomNo != null">sale_custom_no = #{saleCustomNo},</if>
@@ -219,5 +219,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </update>
+    <update id="updateSaleOrderBatch">
+        <foreach collection="list" item="item" index="index" open="" close="" separator=";">
+            update {DBNAME}.sale_order
+            <set>
+                lot_number=#{item.lotNumber}
+            </set>
+            where sale_no =#{item.saleNo}
+        </foreach>
+    </update>
+    <update id="updateSaleOrderBySaleNo">
+        update {DBNAME}.sale_order
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="lotNumber != null">lot_number = #{lotNumber},</if>
+        </trim>
+        where sale_no = #{saleNo}
+    </update>
 
 </mapper>

+ 11 - 2
zkqy-custom-business/src/main/resources/mapper/business/SaleProductsMapper.xml

@@ -185,7 +185,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </insert>
 
     <update id="updateSaleProducts" parameterType="com.zkqy.business.domain.SaleProducts">
-        update sale_products
+        update {DBNAME}.sale_products
         <trim prefix="SET" suffixOverrides=",">
             <if test="saleProductNo != null">sale_product_no = #{saleProductNo},</if>
             <if test="saleOrderNo != null">sale_order_no = #{saleOrderNo},</if>
@@ -225,7 +225,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </update>
-
+    <update id="updateSaleProductBatch">
+        <foreach collection="list" item="item" index="index" open="" close="" separator=";">
+            update {DBNAME}.sale_products
+            <set>
+                production_line_no=#{item.productionLineNo},
+                lot_number=#{item.lotNumber}
+            </set>
+            where id = #{item.id}
+        </foreach>
+    </update>
     <select id="selectSaleProductsIds" resultType="long">
         select id from {DBNAME}.sale_products where sale_order_no = #{saleOrderNo}
     </select>

+ 101 - 2
zkqy-ui/src/api/plan/paln.js

@@ -2,16 +2,19 @@ import request from "@/utils/request";
 
 export function ammunitionPlanInfo(planVo) {
   return request({
-    url: '/business/ammunitionPlanInfo/list',
+    url: '/business/ammunitionPlanInfo/list2',
     method: 'GET',
     params: planVo
   })
 }
 
-
+//id
 export function getProductsInfo() {
   return request({
     url: '/system/products/getProducts',
+    // params: {
+    //   saleNo: id,
+    // },
     method: 'GET',
   })
 }
@@ -23,3 +26,99 @@ export function getMaterielInfo(queryParams) {
     params:queryParams
   })
 }
+
+export function addMaterielInfo(data) {
+  return request({
+    url: '/business/ammunitionPlanInfo',
+    method: 'POST',
+    data:data,
+    baseURL: process.env.VUE_APP_BASE_API1
+  })
+}
+
+// 得到所有的销售员信息
+export function getSalesman(data) {
+  return request({
+    url: '/system/order/salesman/getSalesman',
+    method: 'GET',
+    baseURL: process.env.VUE_APP_BASE_API1
+  })
+}
+
+export function getAllPlanListByMachineId(machineId) {
+  return request({
+    url: '/business/ammunitionPlanInfo/getAllPlanListByMachineId',
+    method: 'GET',
+    params:{
+      machineId:machineId
+    },
+    baseURL: process.env.VUE_APP_BASE_API1
+  })
+}
+
+export function getAllPlanListByProductTypeAndStatus(data) {
+  return request({
+    url: '/business/ammunitionPlanInfo/getAllPlanListByProductTypeAndStatus',
+    params:data,
+    method: 'GET',
+    baseURL: process.env.VUE_APP_BASE_API1
+  })
+}
+
+export function updatePlanOne(data) {
+  return request({
+    url: '/system/plan',
+    params:data,
+    method: 'PUT',
+    baseURL: process.env.VUE_APP_BASE_API1
+  })
+}
+
+/**
+ * 查询纺丝排产计划
+ * @param planVo
+ * @returns {*}
+ */
+export function getSpinningPlanList(data) {
+  return request({
+    url: '/system/spinning/list',
+    method: 'GET',
+    params:data,
+    baseURL: process.env.VUE_APP_BASE_API1
+  })
+}
+
+
+/**
+ * 新增纺丝计划
+ */
+export function addSpinningPlanList(data) {
+  return request({
+    url: '/system/spinning',
+    method: 'POST',
+    data:data,
+    baseURL: process.env.VUE_APP_BASE_API1
+  })
+}
+
+/**
+ * 查询有没有正在上机的
+ */
+export function getPlanSpinningInfo(data) {
+  return request({
+    url: '/system/spinning/list/getPlanSpinningInfo',
+    method: 'get',
+    params:data,
+    baseURL: process.env.VUE_APP_BASE_API1
+  })
+}
+
+
+export function updateSpinningInfoPlanOne(data) {
+  return request({
+    url: '/system/spinning/update/updateSpinningInfoPlanOne',
+    data:data,
+    method: 'PUT',
+    baseURL: process.env.VUE_APP_BASE_API1
+  })
+}

+ 645 - 0
zkqy-ui/src/views/orderMange/planTable/fangsi.vue

@@ -0,0 +1,645 @@
+<template>
+  <div class="app-container" style="width: 100%;">
+        <!--表格-->
+        <el-table
+          :data="tableData"
+          ref="tableRef">
+          <el-table-column prop="machineId" fixed label="线号" header-align="center" align="center" width="111px" ></el-table-column>
+          <el-table-column prop="productionDigit" fixed label="生产位数" header-align="center" align="center" width="111.2px"></el-table-column>
+          <el-table-column label="在机产品" header-align="center" >
+            <el-table-column prop="currentColorCode" label="色号" header-align="center" width="90px" align="center"></el-table-column>
+            <el-table-column prop="currentSpecification" label="规格" header-align="center" width="90px" align="center"></el-table-column>
+            <el-table-column prop="currentLotNumber" label="批号" header-align="center"  width="90px" align="center"></el-table-column>
+            <el-table-column prop="startTime" label="上机时间" header-align="center" width="90px" align="center"></el-table-column>
+            <el-table-column prop="plannedEndTime" label="下机时间" header-align="center" width="90px" align="center"></el-table-column>
+          </el-table-column>
+          <el-table-column prop="plannedProduction" label="待生产产品列表" header-align="center" align="center"  >
+            <template v-slot:default="scope">
+              <div v-if="scope.row.plannedProduction && scope.row.plannedProduction.length > 0">
+                <div v-for="(chunk, chunkIndex) in splitList(scope.row.plannedProduction, 5)" :key="`chunk-${chunkIndex}`">
+                  <span v-for="(item, index) in chunk" :key="`item-${chunkIndex}-${index}`">
+                    {{ item }}, <!-- 替换为实际显示每个产品的代码 -->
+                  </span>
+                </div>
+              </div>
+              <div v-else>
+
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column   fixed="right" label="操作" header-align="center" align="center" width="150px" >
+            <template v-slot:default="scope">
+              <el-dropdown>
+                <el-button type="primary">
+                  操作
+                  <i class="el-icon-arrow-down el-icon--right"></i>
+                </el-button>
+                <el-dropdown-menu slot="dropdown">
+                  <el-dropdown-item @click.native.prevent="handleAddPlan(scope.row)">新增计划</el-dropdown-item>
+                  <el-dropdown-item @click.native.prevent="handleEditPlan(scope.row)">修改计划</el-dropdown-item>
+                </el-dropdown-menu>
+              </el-dropdown>
+            </template>
+          </el-table-column>
+        </el-table>
+        <!--新增计划弹窗-->
+        <el-dialog title="新增计划"  :visible.sync="nanInsertDialogTableVisible" width="1200px">
+          <el-table :data="tableData2" @row-click.self="handleRowClick">
+<!--            <el-table-column prop="salesmanId" label="业务员" header-align="center" align="center" width="100px">-->
+<!--              <template v-slot:default="scope">-->
+<!--                <el-select  v-model="scope.row.salesmanId" placeholder="请选择业务员" @change="selectedSalesmanItem(scope.row,scope.row.salesmanId)">-->
+<!--                  <el-option v-for="salesmanItem in salesmanInfo" :key="salesmanItem.saleNo" :label="salesmanItem.salesman" :value="salesmanItem.saleNo" ></el-option>-->
+<!--                </el-select>-->
+<!--              </template>-->
+<!--            </el-table-column>-->
+            <el-table-column prop="productId" label="产品" header-align="center" align="center" width="150px">
+                <template v-slot:default="scope">
+                     <el-select  v-model="scope.row.productId" placeholder="请选择待排产产品" @change="selectedChangeDate(scope.row,scope.row.productId)">
+                           <el-option v-for="product in productsInfo" :key="product.id" :label="product.productName" :value="product.id" ></el-option>
+                     </el-select>
+                </template>
+            </el-table-column>
+
+            <el-table-column prop="currentColorCode" label="色号" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <!-- 如果当前行正在编辑,则显示输入框 -->
+                <el-input v-if="scope.row.isEditing"  disabled="disabled"   v-model="scope.row.currentColorCode" placeholder="请输入色号" @blur.stop.prevent="handleInputBlur(scope.row)" ></el-input>
+                <!-- 否则显示普通文本 -->
+                <span v-else>{{ scope.row.currentColorCode }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="productionDigit" label="生产位数" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing" v-model="scope.row.productionDigit" placeholder="请输入生产位数" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.productionDigit }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="currentSpecification" label="规格" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <!-- 如果当前行正在编辑,则显示输入框 -->
+                <el-input v-if="scope.row.isEditing" v-model="scope.row.currentSpecification" placeholder="请输入规格" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <!-- 否则显示普通文本 -->
+                <span v-else>{{ scope.row.currentSpecification }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="currentLotNumber" label="批号" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing"   v-model="scope.row.currentLotNumber" placeholder="请输入批号" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.currentLotNumber }}</span>
+              </template>
+            </el-table-column>
+
+            <el-table-column prop="djNumber" label="数量" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing" v-model="scope.row.number" placeholder="请输入数量" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.number }}</span>
+              </template>
+            </el-table-column>
+
+            <el-table-column prop="startTime" label="上机时间" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing" v-model="scope.row.startTime" placeholder="请输入上机时间" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.startTime }}</span>
+              </template>
+            </el-table-column>
+
+            <el-table-column prop="plannedEndTime" label="计划下机时间" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing" :ref="'input'+scope.$index" v-model="scope.row.plannedEndTime" placeholder="请输入计划下机时间" @blur="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.plannedEndTime }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="planStatus" label="计划状态" header-align="center" align="center" width="100px">
+              <template v-slot:default="scope">
+                <el-select  v-model="scope.row.planStatus" placeholder="请选择业务员" @change="selectedSalesmanItem(scope.row,scope.row.planStatus)">
+                  <el-option v-for="stateItem in stateList0" :key="stateItem.id" :label="stateItem.name" :value="stateItem.id" ></el-option>
+                </el-select>
+              </template>
+            </el-table-column>
+            <el-table-column label="操作">
+              <template slot-scope="scope">
+                <el-button
+                  size="mini"
+                  type="danger"
+                  @click.stop.prevent="handleDelete(scope.$index, scope.row)">删除</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+          <el-button type="primary" style="width: 100%;margin-top: 30px"  @click="addEditableRow">新增计划产品</el-button>
+          <span slot="footer" class="dialog-footer">
+            <el-button @click="nanInsertDialogTableVisible = false">取 消</el-button>
+            <el-button type="primary" @click="addPlanInfo">确 定</el-button>
+           </span>
+        </el-dialog>
+        <!--修改计划弹窗-->
+        <el-dialog title="修改计划"  :visible.sync="nanUpdateDialogTableVisible" width="1200px">
+           <!--查询条件-->
+          <el-form ref="form"  :model="formData" label-width="80px" :inline="true">
+              <el-form-item label="计划状态:">
+                <el-select v-model="formData.planStatus" placeholder="请选择计划状态">
+                  <el-option v-for="stateListItem in stateList2" :key="product.id" :label="stateListItem.name" :value="stateListItem.id" ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item>
+                <el-button type="primary" @click="onSubmit">查询</el-button>
+                <el-button @click="reset">重置</el-button>
+              </el-form-item>
+          </el-form>
+          <!--表格-->
+          <el-table :data="tableData2" @row-click.self="handleRowClick">
+<!--            <el-table-column prop="salesmanId" label="业务员" header-align="center" align="center" width="100px">-->
+<!--              <template v-slot:default="scope">-->
+<!--                <el-select  :ref="'salesmanSelect'+scope.$index"  v-model="scope.row.salesmanId" placeholder="请选择业务员" @change="selectedSalesmanItem(scope.row,scope.row.salesmanId,scope.$index)">-->
+<!--                  <el-option v-for="salesmanItem in salesmanInfo" :key="salesmanItem.saleNo" :label="salesmanItem.salesman" :value="salesmanItem.saleNo" ></el-option>-->
+<!--                </el-select>-->
+<!--              </template>-->
+<!--            </el-table-column>-->
+            <el-table-column prop="productId" label="产品" header-align="center" align="center" width="150px">
+              <template v-slot:default="scope">
+                <el-select  :ref="'productSelected'+scope.$index" v-model="scope.row.productId" placeholder="请选择待排产产品" @change="selectedChangeDate(scope.row,scope.row.productId)">
+                  <el-option v-for="product in productsInfo" :key="product.id" :label="product.productName" :value="product.id" ></el-option>
+                </el-select>
+              </template>
+            </el-table-column>
+            <el-table-column prop="productionDigit" label="生产位数" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing" v-model="scope.row.productionDigit" placeholder="请输入生产位数" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.productionDigit }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="currentColorCode" label="色号" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <!-- 如果当前行正在编辑,则显示输入框 -->
+                <el-input v-if="scope.row.isEditing"  disabled="disabled"  v-model="scope.row.currentColorCode" placeholder="请输入色号" @blur.stop.prevent="handleInputBlur(scope.row)" ></el-input>
+                <!-- 否则显示普通文本 -->
+                <span v-else>{{ scope.row.currentColorCode }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="currentSpecification" label="规格" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <!-- 如果当前行正在编辑,则显示输入框 -->
+                <el-input v-if="scope.row.isEditing" v-model="scope.row.currentSpecification" placeholder="请输入规格" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <!-- 否则显示普通文本 -->
+                <span v-else>{{ scope.row.currentSpecification }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="currentLotNumber" label="批号" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing"  v-model="scope.row.currentLotNumber" placeholder="请输入批号" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.currentLotNumber }}</span>
+              </template>
+            </el-table-column>
+
+            <el-table-column prop="startTime" label="上机时间" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing" v-model="scope.row.startTime" placeholder="请输入上机时间" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.startTime }}</span>
+              </template>
+            </el-table-column>
+
+            <el-table-column prop="plannedEndTime" label="计划下机时间" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing" :ref="'input'+scope.$index" v-model="scope.row.plannedEndTime" placeholder="请输入计划下机时间" @blur="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.plannedEndTime }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="planStatus" label="计划状态" header-align="center" align="center" width="100px">
+              <template v-slot:default="scope">
+                <!--上机变停机待机-->
+                <el-select v-if="scope.row.planStatus==1" v-model="scope.row.planStatus" placeholder="计划状态" @change="selectedSalesmanItem(scope.row,scope.row.planStatus)">
+                  <el-option v-for="stateItem in stateList1" :key="stateItem.id" :label="stateItem.name" :value="stateItem.id" ></el-option>
+                </el-select>
+                <!--待机可以上机-->
+                <el-select v-if="scope.row.planStatus==0" v-model="scope.row.planStatus" placeholder="计划状态" @change="selectedSalesmanItem(scope.row,scope.row.planStatus)">
+                  <el-option v-for="stateItem in stateList0" :key="stateItem.id" :label="stateItem.name" :value="stateItem.id" ></el-option>
+                </el-select>
+                <!--停机变上机-->
+                <el-select v-if="scope.row.planStatus==2" v-model="scope.row.planStatus" placeholder="计划状态" @change="selectedSalesmanItem(scope.row,scope.row.planStatus)">
+                  <el-option v-for="stateItem in stateList2" :key="stateItem.id" :label="stateItem.name" :value="stateItem.id" ></el-option>
+                </el-select>
+                <!--已完成-->
+                <el-select v-if="scope.row.planStatus==3" v-model="scope.row.planStatus" placeholder="计划状态" @change="selectedSalesmanItem(scope.row,scope.row.planStatus)">
+                  <el-option v-for="stateItem in stateList3" :key="stateItem.id" :label="stateItem.name" :value="stateItem.id" ></el-option>
+                </el-select>
+              </template>
+            </el-table-column>
+            <el-table-column label="操作">
+              <template v-slot:default="scope">
+                <el-button
+                  size="mini"
+                  type="danger"
+                  @click.stop.prevent="updateStatus(scope.$index, scope.row,scope.row.planStatus)">更新状态{{scope.row.planStatus}}</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+          <!--按钮信息-->
+          <span slot="footer" class="dialog-footer">
+            <el-button @click="nanUpdateDialogTableVisible = false">取 消</el-button>
+            <el-button type="primary" @click="nanUpdateDialogTableVisible = false">确 定</el-button>
+           </span>
+        </el-dialog>
+  </div>
+</template>
+<script>
+import {
+  getProductsInfo,
+  getMaterielInfo,
+  getSalesman,
+  getSpinningPlanList,
+  addSpinningPlanList,
+  getPlanSpinningInfo,
+  updateSpinningInfoPlanOne
+} from "@/api/plan/paln.js";
+export default {
+  data() {
+    return {
+      //选中的是那个车间
+      tableData:[],
+      form: {
+        product:"",
+      },
+      previousMachineId: undefined,
+      currentRowspan: 1,
+      prevRow: {},
+      tableData2: [],
+      tableDataStatus: [],
+      nanInsertDialogTableVisible:false,
+      nanUpdateDialogTableVisible:false,
+      beiInsertDialogTableVisible:false,
+      beiUpdateDialogTableVisible:false,
+      editingRowIndex: -1,
+      lastEditLine:0,
+      isEditLine:false,
+      productsInfo:[],
+      salesmanInfo:[],
+      product:{},
+      materiel:{},
+      //机台号
+      machineId:"",
+      // 待机/上机/停产
+      stateList0:[
+        {"id":0,"name":"待机"},
+        {"id":1,"name":"上机"},
+      ],
+      stateList1:[
+        {"id":0,"name":"待机"},
+        {"id":2,"name":"停机"},
+        {"id":1,"name":"上机"},
+        {"id":3,"name":"已完成"},
+      ],
+      stateList2:[
+        {"id":0,"name":"待机"},
+        {"id":2,"name":"停机"},
+        {"id":1,"name":"上机"},
+      ],
+      stateList3:[
+        {"id":3,"name":"已完成"},
+      ],
+      formData:{
+        updateSelectedProductCategory:"",
+        updateSelectedProductState:""
+      },
+    }
+  },
+  mounted() {
+    // 得到排产计划信息
+    this.getSpinningPlanList();
+    //业务员信息
+    // this.getSalesman();
+    //得到排产产品信息
+    this.getProductsInfo();
+  },
+  methods: {
+    //五个显示为一排
+    splitList(list, chunkSize) {
+      const chunks = [];
+      for (let i = 0; i < list.length; i += chunkSize) {
+        chunks.push(list.slice(i, i + chunkSize));
+      }
+      return chunks;
+    },
+    // 查询排产信息
+    getSpinningPlanList() {
+      getSpinningPlanList({"productionLineDepartment":"纺丝部"}).then((response) => {
+        this.tableData = response.rows
+      });
+    },
+    // //查询产品的业务员信息
+    // getSalesman() {
+    //   getSalesman().then((response) => {
+    //     this.salesmanInfo = response.data;
+    //   })
+    // },
+    // //业务员下拉框切换调用的函数
+    // selectedSalesmanItem(row,saleNo,index){
+    //   this.getProductsInfo(saleNo,index);
+    // },
+    // //待投产的产品数据
+    // getProductsInfo(saleNo,sy) {
+    //   getProductsInfo(saleNo,sy).then((response) => {
+    //     this.productsInfo = response.data;
+    //     this.productsInfo.forEach(item => {
+    //       item.productName = item.productName+"—"+item.materieEncoding+item.materieColorNumber
+    //     });
+    //   })
+    // },
+    getProductsInfo() {
+      getProductsInfo().then((response) => {
+        this.productsInfo = response.data;
+        this.productsInfo.forEach(item => {
+          item.productName = item.productName+"—"+item.materieEncoding+item.materieColorNumber
+        });
+      })
+    },
+    // 下拉框数据改变查询色号批号信息
+    selectedChangeDate(row,selectedProduct) {
+      //选择的那个销售产品
+      this.product = this.productsInfo.find(product => product.id === selectedProduct);
+      //得到选择的商品
+      this.form.product=selectedProduct;
+      //通过母粒编码查询到对应的母粒信息
+      let queryParams = {
+        "materielCode": this.product.colourNumber
+      }
+      //得到对应的母粒信息
+      getMaterielInfo(queryParams).then((response) => {
+        if (response.data!=null) {
+          this.materiel = response.data;
+          //色号 母粒编码+色号
+          row.currentColorCode = this.materiel.materieEncoding+"("+this.materiel.materieColorNumber+")";
+          row.sh=this.materiel.materieColorNumber;
+          //批次
+        }
+      });
+      console.log(this.product.salesmanId)
+      //批号信息
+      row.salesmanId=this.product.saleOrderNo;
+    },
+    // 新增计划产品信息
+    handleAddPlan(row) {
+      this.nanInsertDialogTableVisible = true
+      this.tableData2=[]
+      //先清空
+      this.machineId=""
+      //当前操作机台号
+      this.machineId=row.machineId;
+    },
+    // 删除行
+    handleDelete(index, row) {
+      // console.log(index,row)
+      // this.tableData2[a];
+      this.tableData2.splice(index, 1);
+      // 把上一编辑行置回-1
+      this.editingRowIndex = -1;
+    },
+    // 点击编辑行
+    handleRowClick(row) {
+      this.isEditLine = true;
+      //找到当前行的编辑索引
+      var rowIndex = this.tableData2.indexOf(row);
+      if (this.lastEditLine != 0 &&
+        this.editingRowIndex !== rowIndex &&
+        this.editingRowIndex !== -1 &&
+        !this.isRowFilled(this.tableData2[this.lastEditLine])) {
+        this.$message({
+          message: '请先完成上一条数据的填写',
+          type: 'warning'
+        });
+        return;
+      }
+      //编辑索引不等于当前编辑行索引
+      if (this.editingRowIndex !== rowIndex) {
+        // alert(this.editingRowIndex);
+        if (this.editingRowIndex !== -1) {
+          //把当前行变成不可编辑的
+          this.tableData2[this.editingRowIndex].isEditing = false;
+        }
+        //把当前行变成可编辑的
+        row.isEditing = true;
+        this.editingRowIndex = rowIndex;
+      }
+
+    },
+    // 光标失去焦点变成不可编辑
+    handleInputBlur(row) {
+      let rowIndex = this.tableData2.indexOf(row);
+      //编辑索引不等于当前编辑行索引
+      if (this.editingRowIndex !== rowIndex) {
+        if (this.isRowFilled(row)) {
+          row.isEditing = false;
+          //对于整个表格来说
+          this.isEditLine = false;
+          //当前编辑行置为-1
+          this.editingRowIndex = -1;
+        }
+      }
+    },
+    // 检查行是否填写完毕的示例方法
+    isRowFilled(row) {
+      return row.currentSpecification && row.productionDigit && row.startTime && row.plannedEndTime;
+    },
+    // 新增一行标记为可编辑
+    addEditableRow() {
+      // 检查当前编辑行是否已填写完毕
+      if(this.tableData2.length!=0){
+        if (this.editingRowIndex !== -1 && !this.isRowFilled(this.tableData2[this.editingRowIndex])) {
+          this.$message({
+            message: '请先完成上一条数据的填写',
+            type: 'warning'
+          });
+          return;
+        }
+        //新增行之前先让以前的行不能编辑
+        this.tableData2.forEach(item => {
+          item.isEditing = false;
+        })
+      }
+      this.tableData2.push({
+        currentColorCode: '',
+        currentSpecification: '',
+        currentLotNumber: '',
+        productionDigit: '',
+        startTime: '',
+        plannedEndTime:'',
+        planStatus:0,
+        productId:'',
+        salesmanId:'',
+        isEditing: true // 标记为正在编辑状态
+      });
+      this.editingRowIndex = this.tableData2.length - 1; // 更新当前编辑的行索引
+      this.lastEditLine = this.tableData2.length - 1
+    },
+    // 添加计划
+    addPlanInfo(){
+      const datatime=Date.now()+this.machineId;
+      //先查询计划表中有没有正在上机的
+      getPlanSpinningInfo({"machineId":this.machineId,"planStatus":1}).then(response => {
+          let i=0
+          //处理表格数据
+          this.tableData2.forEach(item=>{
+            item.timestampRandomCode=datatime;
+            item.machineId=this.machineId;
+            if(item.planStatus==1){
+              i++
+            }
+          })
+          if(i>=1&&response.data.length>0){
+            this.$message({
+              message: '只能有一个产品的状态为上机',
+              type: 'warning'
+            });
+            return;
+          }else {
+            //添加计划信息
+            addSpinningPlanList(this.tableData2).then(response => {
+              if (response.code == 200) {
+                this.$message({
+                  message: '添加成功',
+                  type: 'success'
+                });
+                this.getSpinningPlanList();
+                //最后把弹窗关掉
+                this.nanInsertDialogTableVisible=false
+              } else {
+                this.$message({
+                  message: '添加失败',
+                  type: 'error'
+                });
+                //最后把弹窗关掉
+                this.nanInsertDialogTableVisible=false
+              }
+            });
+          }
+      });
+    },
+    // 修改产品计划
+    handleEditPlan(row) {
+      //当前操作机台号
+      this.machineId=row.machineId;
+      this.tableData2=[];
+      //弹窗
+      this.nanUpdateDialogTableVisible = true
+      getPlanSpinningInfo({"machineId":row.machineId}).then((response) => {
+        //得到生产中,停产的,待产的
+        response.data.forEach(item => {
+          item.isEditing=false;
+          item.planStatus=parseInt(item.planStatus);
+          item.productId=parseInt(item.productId)
+        })
+        this.tableData2=response.data;
+        console.log( this.tableData2)
+        // 在数据加载完成后,手动触发每个行的第一个下拉框的 change 事件
+        this.$nextTick(() => {
+          // 获取第一个业务员选择框(假设表格只有一行)
+          this.tableDataStatus=[];
+          for (let i = 0; i < this.tableData2.length; i++) {
+            const firstSalesmanSelect = this.$refs['salesmanSelect'+i];
+            this.tableDataStatus.push({"index":i,"planStatus":this.tableData2[i].planStatus})
+            // console.log(firstSalesmanSelect,11111111)
+            // 触发 change 事件
+            if (firstSalesmanSelect) {
+              firstSalesmanSelect.$emit('change', {
+                target: {value: "ddd"},
+              });
+            }
+          }
+
+        });
+      })
+    },
+    //弹窗里边的点击查询
+    onSubmit(){
+      this.formData.machineId=this.machineId;
+      getPlanSpinningInfo(this.formData).then(response => {
+        //得到生产中,停产的,待产的
+        response.data.forEach(item => {
+          item.isEditing=false;
+          item.planStatus=parseInt(item.planStatus);
+        })
+        this.tableData2=response.data;
+      });
+    },
+    //重置
+    reset(){
+      getPlanSpinningInfo({"machineId":this.machineId}).then(response => {
+        //得到生产中,停产的,待产的
+        response.data.forEach(item => {
+          item.isEditing=false;
+          item.planStatus=parseInt(item.planStatus);
+        })
+        this.tableData2=response.data;
+      });
+    },
+    //更新状态
+    updateStatus(ind, row,planStatus){
+      const a=planStatus;
+      console.log( row.planStatus,this.tableDataStatus[ind].planStatus)
+      if(planStatus==this.tableDataStatus[ind].planStatus){
+        this.$message({
+          message: '并未更改状态,不会发送请求',
+          type: 'warning'
+        });
+        return;
+      }
+      //先查询计划表中有没有正在上机的
+      getPlanSpinningInfo({"machineId":this.machineId,"planStatus":planStatus}).then(response => {
+        let i=0
+        //处理表格数据
+        this.tableData2.forEach(item=>{
+          item.machineId=this.machineId;
+          if(item.planStatus==1){
+            i++
+          }
+        })
+        if(i>=1&&response.data.length>0){
+          this.$message({
+            message: '只能有一个产品的状态为上机',
+            type: 'warning'
+          });
+          row.planStatus=planStatus;
+          return;
+        }else {
+          updateSpinningInfoPlanOne(row).then(response=>{
+            if (response.code == 200) {
+              this.$message({
+                message: '修改成功',
+                type: 'success'
+              });
+              this.getSpinningPlanList();
+              this.tableDataStatus=[]
+              for (let i = 0; i < this.tableData2.length; i++) {
+                this.tableDataStatus.push({"index": i, "planStatus": this.tableData2[i].planStatus})
+              }
+              //最后把弹窗关掉
+              this.nanInsertDialogTableVisible=false
+            } else {
+              this.$message({
+                message: '修改失败',
+                type: 'error'
+              });
+              //最后把弹窗关掉
+              this.nanInsertDialogTableVisible=false
+            }
+          })
+        }
+      });
+
+    }
+  },
+  computed: {
+
+  },
+}
+</script>
+
+<style scoped>
+.el-tabs--border-card >>> .el-tabs__content {
+  padding: 0 !important;
+}
+.el-table__body-wrapper {
+  cursor: grab;
+}
+.el-table__body-wrapper.grabbing {
+  cursor: grabbing;
+}
+</style>

+ 653 - 0
zkqy-ui/src/views/orderMange/planTable/fankuang.vue

@@ -0,0 +1,653 @@
+<template>
+  <div class="app-container" style="width: 100%;">
+        <!--表格-->
+        <el-table
+          :data="tableData"
+          ref="tableRef">
+          <el-table-column prop="machineId" fixed label="机台号" header-align="center" align="center" width="111px" ></el-table-column>
+          <el-table-column prop="productionDigit" fixed label="生产位数" header-align="center" align="center" width="111.2px"></el-table-column>
+          <el-table-column label="在机产品" header-align="center" >
+            <el-table-column prop="currentColorCode" label="色号" header-align="center" width="90px" align="center"></el-table-column>
+            <el-table-column prop="currentSpecification" label="规格" header-align="center" width="90px" align="center"></el-table-column>
+            <el-table-column prop="currentLotNumber" label="批号" header-align="center"  width="90px" align="center"></el-table-column>
+            <el-table-column prop="startTime" label="上机时间" header-align="center" width="90px" align="center"></el-table-column>
+            <el-table-column prop="plannedEndTime" label="下机时间" header-align="center" width="90px" align="center"></el-table-column>
+          </el-table-column>
+          <el-table-column prop="plannedProduction" label="待生产产品列表" header-align="center" align="center"  >
+            <template v-slot:default="scope">
+              <div v-if="scope.row.plannedProduction && scope.row.plannedProduction.length > 0">
+                <div v-for="(chunk, chunkIndex) in splitList(scope.row.plannedProduction, 5)" :key="`chunk-${chunkIndex}`">
+                  <span v-for="(item, index) in chunk" :key="`item-${chunkIndex}-${index}`">
+                    {{ item }}, <!-- 替换为实际显示每个产品的代码 -->
+                  </span>
+                </div>
+              </div>
+              <div v-else>
+
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column   fixed="right" label="操作" header-align="center" align="center" width="150px" >
+            <template v-slot:default="scope">
+              <el-dropdown>
+                <el-button type="primary">
+                  操作
+                  <i class="el-icon-arrow-down el-icon--right"></i>
+                </el-button>
+                <el-dropdown-menu slot="dropdown">
+                  <el-dropdown-item @click.native.prevent="handleAddPlan(scope.row)">新增计划</el-dropdown-item>
+                  <el-dropdown-item @click.native.prevent="handleEditPlan(scope.row)">修改计划</el-dropdown-item>
+                </el-dropdown-menu>
+              </el-dropdown>
+            </template>
+          </el-table-column>
+        </el-table>
+        <!--新增计划弹窗-->
+        <el-dialog title="新增计划"  :visible.sync="nanInsertDialogTableVisible" width="1200px">
+          <el-table :data="tableData2" @row-click.self="handleRowClick">
+<!--            <el-table-column prop="salesmanId" label="业务员" header-align="center" align="center" width="100px">-->
+<!--              <template v-slot:default="scope">-->
+<!--                <el-select  v-model="scope.row.salesmanId" placeholder="请选择业务员" @change="selectedSalesmanItem(scope.row,scope.row.salesmanId)">-->
+<!--                  <el-option v-for="salesmanItem in salesmanInfo" :key="salesmanItem.saleNo" :label="salesmanItem.salesman" :value="salesmanItem.saleNo" ></el-option>-->
+<!--                </el-select>-->
+<!--              </template>-->
+<!--            </el-table-column>-->
+            <el-table-column prop="productId" label="产品" header-align="center" align="center" width="150px">
+                <template v-slot:default="scope">
+                     <el-select  v-model="scope.row.productId" placeholder="请选择待排产产品" @change="selectedChangeDate(scope.row,scope.row.productId)">
+                           <el-option v-for="product in productsInfo" :key="product.id" :label="product.productName" :value="product.id" ></el-option>
+                     </el-select>
+                </template>
+            </el-table-column>
+
+            <el-table-column prop="currentColorCode" label="色号" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <!-- 如果当前行正在编辑,则显示输入框 -->
+                <el-input v-if="scope.row.isEditing"  disabled="disabled"  v-model="scope.row.currentColorCode" placeholder="请输入色号" @blur.stop.prevent="handleInputBlur(scope.row)" ></el-input>
+                <!-- 否则显示普通文本 -->
+                <span v-else>{{ scope.row.currentColorCode }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="productionDigit" label="生产位数" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing" v-model="scope.row.productionDigit" placeholder="请输入生产位数" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.productionDigit }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="currentSpecification" label="规格" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <!-- 如果当前行正在编辑,则显示输入框 -->
+                <el-input v-if="scope.row.isEditing" v-model="scope.row.currentSpecification" placeholder="请输入规格" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <!-- 否则显示普通文本 -->
+                <span v-else>{{ scope.row.currentSpecification }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="currentLotNumber" label="批号" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing" disabled="disabled" v-model="scope.row.currentLotNumber" placeholder="请输入批号" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.currentLotNumber }}</span>
+              </template>
+            </el-table-column>
+
+            <el-table-column prop="djNumber" label="数量" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing" v-model="scope.row.number" placeholder="请输入数量" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.number }}</span>
+              </template>
+            </el-table-column>
+
+            <el-table-column prop="startTime" label="上机时间" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing" v-model="scope.row.startTime" placeholder="请输入上机时间" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.startTime }}</span>
+              </template>
+            </el-table-column>
+
+            <el-table-column prop="plannedEndTime" label="计划下机时间" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing" :ref="'input'+scope.$index" v-model="scope.row.plannedEndTime" placeholder="请输入计划下机时间" @blur="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.plannedEndTime }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="planStatus" label="计划状态" header-align="center" align="center" width="100px">
+              <template v-slot:default="scope">
+                <el-select  v-model="scope.row.planStatus" placeholder="请选择业务员" @change="selectedSalesmanItem(scope.row,scope.row.planStatus)">
+                  <el-option v-for="stateItem in stateList0" :key="stateItem.id" :label="stateItem.name" :value="stateItem.id" ></el-option>
+                </el-select>
+              </template>
+            </el-table-column>
+            <el-table-column label="操作">
+              <template slot-scope="scope">
+                <el-button
+                  size="mini"
+                  type="danger"
+                  @click.stop.prevent="handleDelete(scope.$index, scope.row)">删除</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+          <el-button type="primary" style="width: 100%;margin-top: 30px"  @click="addEditableRow">新增计划产品</el-button>
+          <span slot="footer" class="dialog-footer">
+            <el-button @click="nanInsertDialogTableVisible = false">取 消</el-button>
+            <el-button type="primary" @click="addPlanInfo">确 定</el-button>
+           </span>
+        </el-dialog>
+        <!--修改计划弹窗-->
+        <el-dialog title="修改计划"  :visible.sync="nanUpdateDialogTableVisible" width="1200px">
+           <!--查询条件-->
+          <el-form ref="form"  :model="formData" label-width="80px" :inline="true">
+              <el-form-item label="计划状态:">
+                <el-select v-model="formData.planStatus" placeholder="请选择计划状态">
+                  <el-option v-for="stateListItem in stateList2" :key="product.id" :label="stateListItem.name" :value="stateListItem.id" ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item>
+                <el-button type="primary" @click="onSubmit">查询</el-button>
+                <el-button @click="reset">重置</el-button>
+              </el-form-item>
+          </el-form>
+          <!--表格-->
+          <el-table :data="tableData2" @row-click.self="handleRowClick">
+<!--            <el-table-column prop="salesmanId" label="业务员" header-align="center" align="center" width="100px">-->
+<!--              <template v-slot:default="scope">-->
+<!--                <el-select  :ref="'salesmanSelect'+scope.$index"  v-model="scope.row.salesmanId" placeholder="请选择业务员" @change="selectedSalesmanItem(scope.row,scope.row.salesmanId,scope.$index)">-->
+<!--                  <el-option v-for="salesmanItem in salesmanInfo" :key="salesmanItem.saleNo" :label="salesmanItem.salesman" :value="salesmanItem.saleNo" ></el-option>-->
+<!--                </el-select>-->
+<!--              </template>-->
+<!--            </el-table-column>-->
+            <el-table-column prop="productId" label="产品" header-align="center" align="center" width="150px">
+              <template v-slot:default="scope">
+                <el-select  :ref="'productSelected'+scope.$index" v-model="scope.row.productId" placeholder="请选择待排产产品" @change="selectedChangeDate(scope.row,scope.row.productId)">
+                  <el-option v-for="product in productsInfo" :key="product.id" :label="product.productName" :value="product.id" ></el-option>
+                </el-select>
+              </template>
+            </el-table-column>
+            <el-table-column prop="productionDigit" label="生产位数" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing" v-model="scope.row.productionDigit" placeholder="请输入生产位数" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.productionDigit }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="currentColorCode" label="色号" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <!-- 如果当前行正在编辑,则显示输入框 -->
+                <el-input v-if="scope.row.isEditing"  disabled="disabled"  v-model="scope.row.currentColorCode" placeholder="请输入色号" @blur.stop.prevent="handleInputBlur(scope.row)" ></el-input>
+                <!-- 否则显示普通文本 -->
+                <span v-else>{{ scope.row.currentColorCode }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="weishu" label="位数" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <!-- 如果当前行正在编辑,则显示输入框 -->
+                <el-input v-if="scope.row.isEditing"  disabled="disabled"  v-model="scope.row.currentColorCode" placeholder="请输入色号" @blur.stop.prevent="handleInputBlur(scope.row)" ></el-input>
+                <!-- 否则显示普通文本 -->
+                <span v-else>{{ scope.row.currentColorCode }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="currentSpecification" label="规格" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <!-- 如果当前行正在编辑,则显示输入框 -->
+                <el-input v-if="scope.row.isEditing" v-model="scope.row.currentSpecification" placeholder="请输入规格" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <!-- 否则显示普通文本 -->
+                <span v-else>{{ scope.row.currentSpecification }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="currentLotNumber" label="批号" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing" disabled="disabled" v-model="scope.row.currentLotNumber" placeholder="请输入批号" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.currentLotNumber }}</span>
+              </template>
+            </el-table-column>
+
+            <el-table-column prop="startTime" label="上机时间" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing" v-model="scope.row.startTime" placeholder="请输入上机时间" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.startTime }}</span>
+              </template>
+            </el-table-column>
+
+            <el-table-column prop="plannedEndTime" label="计划下机时间" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing" :ref="'input'+scope.$index" v-model="scope.row.plannedEndTime" placeholder="请输入计划下机时间" @blur="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.plannedEndTime }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="planStatus" label="计划状态" header-align="center" align="center" width="100px">
+              <template v-slot:default="scope">
+                <!--上机变停机待机-->
+                <el-select v-if="scope.row.planStatus==1" v-model="scope.row.planStatus" placeholder="计划状态" @change="selectedSalesmanItem(scope.row,scope.row.planStatus)">
+                  <el-option v-for="stateItem in stateList1" :key="stateItem.id" :label="stateItem.name" :value="stateItem.id" ></el-option>
+                </el-select>
+                <!--待机可以上机-->
+                <el-select v-if="scope.row.planStatus==0" v-model="scope.row.planStatus" placeholder="计划状态" @change="selectedSalesmanItem(scope.row,scope.row.planStatus)">
+                  <el-option v-for="stateItem in stateList0" :key="stateItem.id" :label="stateItem.name" :value="stateItem.id" ></el-option>
+                </el-select>
+                <!--停机变上机-->
+                <el-select v-if="scope.row.planStatus==2" v-model="scope.row.planStatus" placeholder="计划状态" @change="selectedSalesmanItem(scope.row,scope.row.planStatus)">
+                  <el-option v-for="stateItem in stateList2" :key="stateItem.id" :label="stateItem.name" :value="stateItem.id" ></el-option>
+                </el-select>
+                <!--已完成-->
+                <el-select v-if="scope.row.planStatus==3" v-model="scope.row.planStatus" placeholder="计划状态" @change="selectedSalesmanItem(scope.row,scope.row.planStatus)">
+                  <el-option v-for="stateItem in stateList3" :key="stateItem.id" :label="stateItem.name" :value="stateItem.id" ></el-option>
+                </el-select>
+              </template>
+            </el-table-column>
+            <el-table-column label="操作">
+              <template v-slot:default="scope">
+                <el-button
+                  size="mini"
+                  type="danger"
+                  @click.stop.prevent="updateStatus(scope.$index, scope.row,scope.row.planStatus)">更新状态{{scope.row.planStatus}}</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+          <span slot="footer" class="dialog-footer">
+            <el-button @click="nanUpdateDialogTableVisible = false">取 消</el-button>
+            <el-button type="primary" @click="nanUpdateDialogTableVisible = false">确 定</el-button>
+           </span>
+        </el-dialog>
+  </div>
+</template>
+<script>
+import {
+  getProductsInfo,
+  getMaterielInfo,
+  getSalesman,
+  getSpinningPlanList,
+  addSpinningPlanList,
+  getPlanSpinningInfo,
+  updateSpinningInfoPlanOne
+} from "@/api/plan/paln.js";
+export default {
+  data() {
+    return {
+      //选中的是那个车间
+      tableData:[],
+      form: {
+        product:"",
+      },
+      previousMachineId: undefined,
+      currentRowspan: 1,
+      prevRow: {},
+      tableData2: [],
+      tableDataStatus: [],
+      nanInsertDialogTableVisible:false,
+      nanUpdateDialogTableVisible:false,
+      beiInsertDialogTableVisible:false,
+      beiUpdateDialogTableVisible:false,
+      editingRowIndex: -1,
+      lastEditLine:0,
+      isEditLine:false,
+      productsInfo:[],
+      salesmanInfo:[],
+      product:{},
+      materiel:{},
+      //机台号
+      machineId:"",
+      // 待机/上机/停产
+      stateList0:[
+        {"id":0,"name":"待机"},
+        {"id":1,"name":"上机"},
+      ],
+      stateList1:[
+        {"id":0,"name":"待机"},
+        {"id":1,"name":"上机"},
+        {"id":2,"name":"停机"},
+        {"id":3,"name":"已完成"},
+      ],
+      stateList2:[
+        {"id":0,"name":"待机"},
+        {"id":2,"name":"停机"},
+        {"id":1,"name":"上机"},
+      ],
+      stateList3:[
+        {"id":3,"name":"已完成"},
+      ],
+      formData:{
+        updateSelectedProductCategory:"",
+        updateSelectedProductState:""
+      },
+    }
+  },
+  mounted() {
+    // 得到排产计划信息
+    this.getSpinningPlanList();
+    // this.getSalesman();
+    this.getProductsInfo();
+  },
+  methods: {
+    //五个显示为一排
+    splitList(list, chunkSize) {
+      const chunks = [];
+      for (let i = 0; i < list.length; i += chunkSize) {
+        chunks.push(list.slice(i, i + chunkSize));
+      }
+      return chunks;
+    },
+    // 查询排产信息
+    getSpinningPlanList() {
+      getSpinningPlanList({"productionLineDepartment":"翻框部"}).then((response) => {
+        this.tableData = response.rows
+      });
+    },
+    // //查询产品的业务员信息
+    // getSalesman() {
+    //   getSalesman().then((response) => {
+    //     this.salesmanInfo = response.data;
+    //   })
+    // },
+    // //业务员下拉框切换调用的函数
+    // selectedSalesmanItem(row,saleNo,index){
+    //   console.log("ccc",index)
+    //   this.getProductsInfo(saleNo,index);
+    // },
+    // //待投产的产品数据
+    // getProductsInfo(saleNo,sy) {
+    //   getProductsInfo(saleNo,sy).then((response) => {
+    //     this.productsInfo = response.data;
+    //     this.productsInfo.forEach(item => {
+    //       item.productName = item.productName+"—"+item.materieEncoding+item.materieColorNumber
+    //     });
+    //   })
+    // },
+    getProductsInfo() {
+      console.log("ddddddddddddddddddddddd")
+      getProductsInfo().then((response) => {
+        this.productsInfo = response.data;
+        this.productsInfo.forEach(item => {
+          item.productName = item.productName+"—"+item.materieEncoding+item.materieColorNumber
+        });
+      })
+    },
+    // 下拉框数据改变查询色号批号信息
+    selectedChangeDate(row,selectedProduct) {
+      //选择的那个销售产品
+      this.product = this.productsInfo.find(product => product.id === selectedProduct);
+      //选择的那个产品
+      this.form.product=selectedProduct;
+      //批次
+      row.currentLotNumber=this.product.lotNumber;
+      //通过母粒编码查询到对应的母粒信息
+      let queryParams = {
+        "materielCode": this.product.colourNumber
+      }
+      //得到对应的母粒信息
+      getMaterielInfo(queryParams).then((response) => {
+        if (response.data!=null) {
+          this.materiel = response.data;
+          //色号 母粒编码+色号
+          row.currentColorCode = this.materiel.materieEncoding+"("+this.materiel.materieColorNumber+")";
+          row.sh=this.materiel.materieColorNumber;
+
+        }
+      });
+      //色号
+      // console.log(this.materiel)
+    },
+    // 新增计划产品信息
+    handleAddPlan(row) {
+      this.nanInsertDialogTableVisible = true
+      this.tableData2=[]
+      //先清空
+      this.machineId=""
+      //当前操作机台号
+      this.machineId=row.machineId;
+    },
+    // 删除行
+    handleDelete(index, row) {
+      // console.log(index,row)
+      // this.tableData2[a];
+      this.tableData2.splice(index, 1);
+      // 把上一编辑行置回-1
+      this.editingRowIndex = -1;
+    },
+    // 点击编辑行
+    handleRowClick(row) {
+      this.isEditLine = true;
+      //找到当前行的编辑索引
+      var rowIndex = this.tableData2.indexOf(row);
+      if (this.lastEditLine != 0 &&
+        this.editingRowIndex !== rowIndex &&
+        this.editingRowIndex !== -1 &&
+        !this.isRowFilled(this.tableData2[this.lastEditLine])) {
+        this.$message({
+          message: '请先完成上一条数据的填写',
+          type: 'warning'
+        });
+        return;
+      }
+      //编辑索引不等于当前编辑行索引
+      if (this.editingRowIndex !== rowIndex) {
+        // alert(this.editingRowIndex);
+        if (this.editingRowIndex !== -1) {
+          //把当前行变成不可编辑的
+          this.tableData2[this.editingRowIndex].isEditing = false;
+        }
+        //把当前行变成可编辑的
+        row.isEditing = true;
+        this.editingRowIndex = rowIndex;
+      }
+
+    },
+    // 光标失去焦点变成不可编辑
+    handleInputBlur(row) {
+      let rowIndex = this.tableData2.indexOf(row);
+      //编辑索引不等于当前编辑行索引
+      if (this.editingRowIndex !== rowIndex) {
+        if (this.isRowFilled(row)) {
+          row.isEditing = false;
+          //对于整个表格来说
+          this.isEditLine = false;
+          //当前编辑行置为-1
+          this.editingRowIndex = -1;
+        }
+      }
+    },
+    // 检查行是否填写完毕的示例方法
+    isRowFilled(row) {
+      return row.currentSpecification && row.productionDigit && row.startTime && row.plannedEndTime;
+    },
+    // 新增一行标记为可编辑
+    addEditableRow() {
+      // 检查当前编辑行是否已填写完毕
+      if(this.tableData2.length!=0){
+        if (this.editingRowIndex !== -1 && !this.isRowFilled(this.tableData2[this.editingRowIndex])) {
+          this.$message({
+            message: '请先完成上一条数据的填写',
+            type: 'warning'
+          });
+          return;
+        }
+        //新增行之前先让以前的行不能编辑
+        this.tableData2.forEach(item => {
+          item.isEditing = false;
+        })
+      }
+      this.tableData2.push({
+        currentColorCode: '',
+        currentSpecification: '',
+        currentLotNumber: '',
+        productionDigit: '',
+        startTime: '',
+        plannedEndTime:'',
+        planStatus:0,
+        productId:'',
+        salesmanId:'',
+        isEditing: true // 标记为正在编辑状态
+      });
+      this.editingRowIndex = this.tableData2.length - 1; // 更新当前编辑的行索引
+      this.lastEditLine = this.tableData2.length - 1
+    },
+    // 添加计划
+    addPlanInfo(){
+      const datatime=Date.now()+this.machineId;
+      //先查询计划表中有没有正在上机的
+      getPlanSpinningInfo({"machineId":this.machineId,"planStatus":1}).then(response => {
+          let i=0
+          //处理表格数据
+          this.tableData2.forEach(item=>{
+            item.timestampRandomCode=datatime;
+            item.machineId=this.machineId;
+            if(item.planStatus==1){
+              i++
+            }
+          })
+          if(i>=1&&response.data.length>0){
+            this.$message({
+              message: '只能有一个产品的状态为上机',
+              type: 'warning'
+            });
+            return;
+          }else {
+            //添加计划信息
+            addSpinningPlanList(this.tableData2).then(response => {
+              if (response.code == 200) {
+                this.$message({
+                  message: '添加成功',
+                  type: 'success'
+                });
+                this.getSpinningPlanList();
+                //最后把弹窗关掉
+                this.nanInsertDialogTableVisible=false
+              } else {
+                this.$message({
+                  message: '添加失败',
+                  type: 'error'
+                });
+                //最后把弹窗关掉
+                this.nanInsertDialogTableVisible=false
+              }
+            });
+          }
+      });
+    },
+    // 修改产品计划
+    handleEditPlan(row) {
+      //当前操作机台号
+      this.machineId=row.machineId;
+      this.tableData2=[];
+      //弹窗
+      this.nanUpdateDialogTableVisible = true
+      getPlanSpinningInfo({"machineId":row.machineId}).then((response) => {
+        //得到生产中,停产的,待产的
+        response.data.forEach(item => {
+          item.isEditing=false;
+          item.planStatus=parseInt(item.planStatus);
+          item.productId=parseInt(item.productId)
+        })
+        this.tableData2=response.data;
+        console.log( this.tableData2)
+        // 在数据加载完成后,手动触发每个行的第一个下拉框的 change 事件
+        this.$nextTick(() => {
+          // 获取第一个业务员选择框(假设表格只有一行)
+          this.tableDataStatus=[];
+          for (let i = 0; i < this.tableData2.length; i++) {
+            const firstSalesmanSelect = this.$refs['salesmanSelect'+i];
+            this.tableDataStatus.push({"index":i,"planStatus":this.tableData2[i].planStatus})
+            // console.log(firstSalesmanSelect,11111111)
+            // 触发 change 事件
+            if (firstSalesmanSelect) {
+              firstSalesmanSelect.$emit('change', {
+                target: {value: "ddd"},
+              });
+            }
+          }
+
+        });
+      })
+    },
+    //弹窗里边的点击查询
+    onSubmit(){
+      this.formData.machineId=this.machineId;
+      getPlanSpinningInfo(this.formData).then(response => {
+        //得到生产中,停产的,待产的
+        response.data.forEach(item => {
+          item.isEditing=false;
+          item.planStatus=parseInt(item.planStatus);
+        })
+        this.tableData2=response.data;
+      });
+    },
+    //重置
+    reset(){
+      getPlanSpinningInfo({"machineId":this.machineId}).then(response => {
+        //得到生产中,停产的,待产的
+        response.data.forEach(item => {
+          item.isEditing=false;
+          item.planStatus=parseInt(item.planStatus);
+        })
+        this.tableData2=response.data;
+      });
+    },
+    //更新状态
+    updateStatus(ind, row,planStatus){
+      const a=planStatus;
+      console.log( row.planStatus,this.tableDataStatus[ind].planStatus)
+      if(planStatus==this.tableDataStatus[ind].planStatus){
+        this.$message({
+          message: '并未更改状态,不会发送请求',
+          type: 'warning'
+        });
+        return;
+      }
+      //先查询计划表中有没有正在上机的
+      getPlanSpinningInfo({"machineId":this.machineId,"planStatus":planStatus}).then(response => {
+        let i=0
+        //处理表格数据
+        this.tableData2.forEach(item=>{
+          item.machineId=this.machineId;
+          if(item.planStatus==1){
+            i++
+          }
+        })
+        if(i>=1&&response.data.length>0){
+          this.$message({
+            message: '只能有一个产品的状态为上机',
+            type: 'warning'
+          });
+          row.planStatus=planStatus;
+          return;
+        }else {
+          updateSpinningInfoPlanOne(row).then(response=>{
+            if (response.code == 200) {
+              this.$message({
+                message: '修改成功',
+                type: 'success'
+              });
+              this.getSpinningPlanList();
+              this.tableDataStatus=[]
+              for (let i = 0; i < this.tableData2.length; i++) {
+                this.tableDataStatus.push({"index": i, "planStatus": this.tableData2[i].planStatus})
+              }
+              //最后把弹窗关掉
+              this.nanInsertDialogTableVisible=false
+            } else {
+              this.$message({
+                message: '修改失败',
+                type: 'error'
+              });
+              //最后把弹窗关掉
+              this.nanInsertDialogTableVisible=false
+            }
+          })
+        }
+      });
+
+    }
+  },
+  computed: {
+
+  },
+}
+</script>
+
+<style scoped>
+.el-tabs--border-card >>> .el-tabs__content {
+  padding: 0 !important;
+}
+.el-table__body-wrapper {
+  cursor: grab;
+}
+.el-table__body-wrapper.grabbing {
+  cursor: grabbing;
+}
+</style>

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 782 - 124
zkqy-ui/src/views/orderMange/planTable/index.vue


+ 656 - 0
zkqy-ui/src/views/orderMange/planTable/luotong.vue

@@ -0,0 +1,656 @@
+<template>
+  <div class="app-container" style="width: 100%;">
+        <!--表格-->
+        <el-table
+          :data="tableData"
+          ref="tableRef">
+          <el-table-column prop="machineId" fixed label="机台号" header-align="center" align="center" width="111px" ></el-table-column>
+          <el-table-column prop="productionDigit" fixed label="生产位数" header-align="center" align="center" width="111.2px"></el-table-column>
+          <el-table-column label="在机产品" header-align="center" >
+            <el-table-column prop="currentColorCode" label="色号" header-align="center" width="90px" align="center"></el-table-column>
+            <el-table-column prop="currentSpecification" label="规格" header-align="center" width="90px" align="center"></el-table-column>
+            <el-table-column prop="currentLotNumber" label="批号" header-align="center"  width="90px" align="center"></el-table-column>
+            <el-table-column prop="startTime" label="上机时间" header-align="center" width="90px" align="center"></el-table-column>
+            <el-table-column prop="plannedEndTime" label="下机时间" header-align="center" width="90px" align="center"></el-table-column>
+          </el-table-column>
+          <el-table-column prop="plannedProduction" label="待生产产品列表" header-align="center" align="center"  >
+            <template v-slot:default="scope">
+              <div v-if="scope.row.plannedProduction && scope.row.plannedProduction.length > 0">
+                <div v-for="(chunk, chunkIndex) in splitList(scope.row.plannedProduction, 5)" :key="`chunk-${chunkIndex}`">
+                  <span v-for="(item, index) in chunk" :key="`item-${chunkIndex}-${index}`">
+                    {{ item }}, <!-- 替换为实际显示每个产品的代码 -->
+                  </span>
+                </div>
+              </div>
+              <div v-else>
+
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column   fixed="right" label="操作" header-align="center" align="center" width="150px" >
+            <template v-slot:default="scope">
+              <el-dropdown>
+                <el-button type="primary">
+                  操作
+                  <i class="el-icon-arrow-down el-icon--right"></i>
+                </el-button>
+                <el-dropdown-menu slot="dropdown">
+                  <el-dropdown-item @click.native.prevent="handleAddPlan(scope.row)">新增计划</el-dropdown-item>
+                  <el-dropdown-item @click.native.prevent="handleEditPlan(scope.row)">修改计划</el-dropdown-item>
+                </el-dropdown-menu>
+              </el-dropdown>
+            </template>
+          </el-table-column>
+        </el-table>
+        <!--新增计划弹窗-->
+        <el-dialog title="新增计划"  :visible.sync="nanInsertDialogTableVisible" width="1200px">
+          <el-table :data="tableData2" @row-click.self="handleRowClick">
+<!--            <el-table-column prop="salesmanId" label="业务员" header-align="center" align="center" width="100px">-->
+<!--              <template v-slot:default="scope">-->
+<!--                <el-select  v-model="scope.row.salesmanId" placeholder="请选择业务员" @change="selectedSalesmanItem(scope.row,scope.row.salesmanId)">-->
+<!--                  <el-option v-for="salesmanItem in salesmanInfo" :key="salesmanItem.saleNo" :label="salesmanItem.salesman" :value="salesmanItem.saleNo" ></el-option>-->
+<!--                </el-select>-->
+<!--              </template>-->
+<!--            </el-table-column>-->
+            <el-table-column prop="productId" label="产品" header-align="center" align="center" width="150px">
+                <template v-slot:default="scope">
+                     <el-select  v-model="scope.row.productId" placeholder="请选择待排产产品" @change="selectedChangeDate(scope.row,scope.row.productId)">
+                           <el-option v-for="product in productsInfo" :key="product.id" :label="product.productName" :value="product.id" ></el-option>
+                     </el-select>
+                </template>
+            </el-table-column>
+
+            <el-table-column prop="currentColorCode" label="色号" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <!-- 如果当前行正在编辑,则显示输入框 -->
+                <el-input v-if="scope.row.isEditing"  disabled="disabled"  v-model="scope.row.currentColorCode" placeholder="请输入色号" @blur.stop.prevent="handleInputBlur(scope.row)" ></el-input>
+                <!-- 否则显示普通文本 -->
+                <span v-else>{{ scope.row.currentColorCode }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="productionDigit" label="生产位数" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing" v-model="scope.row.productionDigit" placeholder="请输入生产位数" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.productionDigit }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="currentSpecification" label="规格" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <!-- 如果当前行正在编辑,则显示输入框 -->
+                <el-input v-if="scope.row.isEditing" v-model="scope.row.currentSpecification" placeholder="请输入规格" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <!-- 否则显示普通文本 -->
+                <span v-else>{{ scope.row.currentSpecification }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="currentLotNumber" label="批号" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing" disabled="disabled" v-model="scope.row.currentLotNumber" placeholder="请输入批号" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.currentLotNumber }}</span>
+              </template>
+            </el-table-column>
+
+            <el-table-column prop="djNumber" label="数量" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing" v-model="scope.row.number" placeholder="请输入数量" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.number }}</span>
+              </template>
+            </el-table-column>
+
+            <el-table-column prop="startTime" label="上机时间" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing" v-model="scope.row.startTime" placeholder="请输入上机时间" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.startTime }}</span>
+              </template>
+            </el-table-column>
+
+            <el-table-column prop="plannedEndTime" label="计划下机时间" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing" :ref="'input'+scope.$index" v-model="scope.row.plannedEndTime" placeholder="请输入计划下机时间" @blur="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.plannedEndTime }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="planStatus" label="计划状态" header-align="center" align="center" width="100px">
+              <template v-slot:default="scope">
+                <el-select  v-model="scope.row.planStatus" placeholder="请选择业务员" @change="selectedSalesmanItem(scope.row,scope.row.planStatus)">
+                  <el-option v-for="stateItem in stateList0" :key="stateItem.id" :label="stateItem.name" :value="stateItem.id" ></el-option>
+                </el-select>
+              </template>
+            </el-table-column>
+            <el-table-column label="操作">
+              <template slot-scope="scope">
+                <el-button
+                  size="mini"
+                  type="danger"
+                  @click.stop.prevent="handleDelete(scope.$index, scope.row)">删除</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+          <el-button type="primary" style="width: 100%;margin-top: 30px"  @click="addEditableRow">新增计划产品</el-button>
+          <span slot="footer" class="dialog-footer">
+            <el-button @click="nanInsertDialogTableVisible = false">取 消</el-button>
+            <el-button type="primary" @click="addPlanInfo">确 定</el-button>
+           </span>
+        </el-dialog>
+        <!--修改计划弹窗-->
+        <el-dialog title="修改计划"  :visible.sync="nanUpdateDialogTableVisible" width="1200px">
+           <!--查询条件-->
+          <el-form ref="form"  :model="formData" label-width="80px" :inline="true">
+              <el-form-item label="计划状态:">
+                <el-select v-model="formData.planStatus" placeholder="请选择计划状态">
+                  <el-option v-for="stateListItem in stateList2" :key="product.id" :label="stateListItem.name" :value="stateListItem.id" ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item>
+                <el-button type="primary" @click="onSubmit">查询</el-button>
+                <el-button @click="reset">重置</el-button>
+              </el-form-item>
+          </el-form>
+          <!--表格-->
+          <el-table :data="tableData2" @row-click.self="handleRowClick">
+<!--            <el-table-column prop="salesmanId" label="业务员" header-align="center" align="center" width="100px">-->
+<!--              <template v-slot:default="scope">-->
+<!--                <el-select  :ref="'salesmanSelect'+scope.$index"  v-model="scope.row.salesmanId" placeholder="请选择业务员" @change="selectedSalesmanItem(scope.row,scope.row.salesmanId,scope.$index)">-->
+<!--                  <el-option v-for="salesmanItem in salesmanInfo" :key="salesmanItem.saleNo" :label="salesmanItem.salesman" :value="salesmanItem.saleNo" ></el-option>-->
+<!--                </el-select>-->
+<!--              </template>-->
+<!--            </el-table-column>-->
+            <el-table-column prop="productId" label="产品" header-align="center" align="center" width="150px">
+              <template v-slot:default="scope">
+                <el-select  :ref="'productSelected'+scope.$index" v-model="scope.row.productId" placeholder="请选择待排产产品" @change="selectedChangeDate(scope.row,scope.row.productId)">
+                  <el-option v-for="product in productsInfo" :key="product.id" :label="product.productName" :value="product.id" ></el-option>
+                </el-select>
+              </template>
+            </el-table-column>
+            <el-table-column prop="productionDigit" label="生产位数" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing" v-model="scope.row.productionDigit" placeholder="请输入生产位数" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.productionDigit }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="currentColorCode" label="色号" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <!-- 如果当前行正在编辑,则显示输入框 -->
+                <el-input v-if="scope.row.isEditing"  disabled="disabled"  v-model="scope.row.currentColorCode" placeholder="请输入色号" @blur.stop.prevent="handleInputBlur(scope.row)" ></el-input>
+                <!-- 否则显示普通文本 -->
+                <span v-else>{{ scope.row.currentColorCode }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="weishu" label="位数" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <!-- 如果当前行正在编辑,则显示输入框 -->
+                <el-input v-if="scope.row.isEditing"  disabled="disabled"  v-model="scope.row.currentColorCode" placeholder="请输入色号" @blur.stop.prevent="handleInputBlur(scope.row)" ></el-input>
+                <!-- 否则显示普通文本 -->
+                <span v-else>{{ scope.row.currentColorCode }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="currentSpecification" label="规格" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <!-- 如果当前行正在编辑,则显示输入框 -->
+                <el-input v-if="scope.row.isEditing" v-model="scope.row.currentSpecification" placeholder="请输入规格" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <!-- 否则显示普通文本 -->
+                <span v-else>{{ scope.row.currentSpecification }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="currentLotNumber" label="批号" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing" disabled="disabled"  v-model="scope.row.currentLotNumber" placeholder="请输入批号" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.currentLotNumber }}</span>
+              </template>
+            </el-table-column>
+
+            <el-table-column prop="startTime" label="上机时间" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing" v-model="scope.row.startTime" placeholder="请输入上机时间" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.startTime }}</span>
+              </template>
+            </el-table-column>
+
+            <el-table-column prop="plannedEndTime" label="计划下机时间" header-align="center" align="center">
+              <template v-slot:default="scope">
+                <el-input v-if="scope.row.isEditing" :ref="'input'+scope.$index" v-model="scope.row.plannedEndTime" placeholder="请输入计划下机时间" @blur="handleInputBlur(scope.row)">></el-input>
+                <span v-else>{{ scope.row.plannedEndTime }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="planStatus" label="计划状态" header-align="center" align="center" width="100px">
+              <template v-slot:default="scope">
+                <!--上机变停机待机-->
+                <el-select v-if="scope.row.planStatus==1" v-model="scope.row.planStatus" placeholder="计划状态" @change="selectedSalesmanItem(scope.row,scope.row.planStatus)">
+                  <el-option v-for="stateItem in stateList1" :key="stateItem.id" :label="stateItem.name" :value="stateItem.id" ></el-option>
+                </el-select>
+                <!--待机可以上机-->
+                <el-select v-if="scope.row.planStatus==0" v-model="scope.row.planStatus" placeholder="计划状态" @change="selectedSalesmanItem(scope.row,scope.row.planStatus)">
+                  <el-option v-for="stateItem in stateList0" :key="stateItem.id" :label="stateItem.name" :value="stateItem.id" ></el-option>
+                </el-select>
+                <!--停机变上机-->
+                <el-select v-if="scope.row.planStatus==2" v-model="scope.row.planStatus" placeholder="计划状态" @change="selectedSalesmanItem(scope.row,scope.row.planStatus)">
+                  <el-option v-for="stateItem in stateList2" :key="stateItem.id" :label="stateItem.name" :value="stateItem.id" ></el-option>
+                </el-select>
+                <!--已完成-->
+                <el-select v-if="scope.row.planStatus==3" v-model="scope.row.planStatus" placeholder="计划状态" @change="selectedSalesmanItem(scope.row,scope.row.planStatus)">
+                  <el-option v-for="stateItem in stateList3" :key="stateItem.id" :label="stateItem.name" :value="stateItem.id" ></el-option>
+                </el-select>
+              </template>
+            </el-table-column>
+            <el-table-column label="操作">
+              <template v-slot:default="scope">
+                <el-button
+                  size="mini"
+                  type="danger"
+                  @click.stop.prevent="updateStatus(scope.$index, scope.row,scope.row.planStatus)">更新状态{{scope.row.planStatus}}</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+          <span slot="footer" class="dialog-footer">
+            <el-button @click="nanUpdateDialogTableVisible = false">取 消</el-button>
+            <el-button type="primary" @click="nanUpdateDialogTableVisible = false">确 定</el-button>
+           </span>
+        </el-dialog>
+  </div>
+</template>
+<script>
+import {
+  getProductsInfo,
+  getMaterielInfo,
+  getSalesman,
+  getSpinningPlanList,
+  addSpinningPlanList,
+  getPlanSpinningInfo,
+  updateSpinningInfoPlanOne
+} from "@/api/plan/paln.js";
+export default {
+  data() {
+    return {
+      //选中的是那个车间
+      tableData:[],
+      form: {
+        product:"",
+      },
+      previousMachineId: undefined,
+      currentRowspan: 1,
+      prevRow: {},
+      tableData2: [],
+      tableDataStatus: [],
+      nanInsertDialogTableVisible:false,
+      nanUpdateDialogTableVisible:false,
+      beiInsertDialogTableVisible:false,
+      beiUpdateDialogTableVisible:false,
+      editingRowIndex: -1,
+      lastEditLine:0,
+      isEditLine:false,
+      productsInfo:[],
+      salesmanInfo:[],
+      product:{},
+      materiel:{},
+      //机台号
+      machineId:"",
+      // 待机/上机/停产
+      stateList0:[
+        {"id":0,"name":"待机"},
+        {"id":1,"name":"上机"},
+      ],
+      stateList1:[
+        {"id":0,"name":"待机"},
+        {"id":2,"name":"停机"},
+        {"id":1,"name":"上机"},
+        {"id":3,"name":"已完成"},
+      ],
+      stateList2:[
+        {"id":0,"name":"待机"},
+        {"id":2,"name":"停机"},
+        {"id":1,"name":"上机"},
+      ],
+      stateList3:[
+        {"id":3,"name":"已完成"},
+      ],
+      formData:{
+        updateSelectedProductCategory:"",
+        updateSelectedProductState:""
+      },
+    }
+  },
+  mounted() {
+    // 得到排产计划信息
+    this.getSpinningPlanList();
+    // //
+    // this.getSalesman();
+    this.getProductsInfo();
+  },
+  methods: {
+    //五个显示为一排
+    splitList(list, chunkSize) {
+      const chunks = [];
+      for (let i = 0; i < list.length; i += chunkSize) {
+        chunks.push(list.slice(i, i + chunkSize));
+      }
+      return chunks;
+    },
+    // 查询排产信息
+    getSpinningPlanList() {
+      getSpinningPlanList({"productionLineDepartment":"络筒部"}).then((response) => {
+        this.tableData = response.rows
+      });
+    },
+    // //查询产品的业务员信息
+    // getSalesman() {
+    //   getSalesman().then((response) => {
+    //     this.salesmanInfo = response.data;
+    //   })
+    // },
+    // //业务员下拉框切换调用的函数
+    // selectedSalesmanItem(row,saleNo,index){
+    //   console.log("ccc",index)
+    //   this.getProductsInfo(saleNo,index);
+    // },
+    // //待投产的产品数据
+    // getProductsInfo(saleNo,sy) {
+    //   getProductsInfo(saleNo,sy).then((response) => {
+    //     this.productsInfo = response.data;
+    //     this.productsInfo.forEach(item => {
+    //       item.productName = item.productName+"—"+item.materieEncoding+item.materieColorNumber
+    //     });
+    //   })
+    // },
+    //待投产的产品数据
+    getProductsInfo() {
+      getProductsInfo().then((response) => {
+        this.productsInfo = response.data;
+        this.productsInfo.forEach(item => {
+          item.productName = item.productName+"—"+item.materieEncoding+item.materieColorNumber
+        });
+      })
+    },
+    // 下拉框数据改变查询色号批号信息
+    selectedChangeDate(row,selectedProduct) {
+      //选择的那个销售产品
+      this.product = this.productsInfo.find(product => product.id === selectedProduct);
+      this.form.product=selectedProduct;
+      //批次
+      row.currentLotNumber=this.product.lotNumber;
+      //通过母粒编码查询到对应的母粒信息
+      let queryParams = {
+        "materielCode": this.product.colourNumber
+      }
+      //得到对应的母粒信息
+      getMaterielInfo(queryParams).then((response) => {
+        if (response.data!=null) {
+          this.materiel = response.data;
+          //色号 母粒编码+色号
+          row.currentColorCode = this.materiel.materieEncoding+"("+this.materiel.materieColorNumber+")";
+          row.sh=this.materiel.materieColorNumber;
+          //批次
+          // row.currentLotNumber=this.product.lotNumber==null?"XW121":this.product.lotNumber;
+        }
+      });
+
+      //色号
+      // console.log(this.materiel)
+
+    },
+    // 新增计划产品信息
+    handleAddPlan(row) {
+      this.nanInsertDialogTableVisible = true
+      this.tableData2=[]
+      //先清空
+      this.machineId=""
+      //当前操作机台号
+      this.machineId=row.machineId;
+    },
+    // 删除行
+    handleDelete(index, row) {
+      // console.log(index,row)
+      // this.tableData2[a];
+      this.tableData2.splice(index, 1);
+      // 把上一编辑行置回-1
+      this.editingRowIndex = -1;
+    },
+    // 点击编辑行
+    handleRowClick(row) {
+      this.isEditLine = true;
+      //找到当前行的编辑索引
+      var rowIndex = this.tableData2.indexOf(row);
+      if (this.lastEditLine != 0 &&
+        this.editingRowIndex !== rowIndex &&
+        this.editingRowIndex !== -1 &&
+        !this.isRowFilled(this.tableData2[this.lastEditLine])) {
+        this.$message({
+          message: '请先完成上一条数据的填写',
+          type: 'warning'
+        });
+        return;
+      }
+      //编辑索引不等于当前编辑行索引
+      if (this.editingRowIndex !== rowIndex) {
+        // alert(this.editingRowIndex);
+        if (this.editingRowIndex !== -1) {
+          //把当前行变成不可编辑的
+          this.tableData2[this.editingRowIndex].isEditing = false;
+        }
+        //把当前行变成可编辑的
+        row.isEditing = true;
+        this.editingRowIndex = rowIndex;
+      }
+
+    },
+    // 光标失去焦点变成不可编辑
+    handleInputBlur(row) {
+      let rowIndex = this.tableData2.indexOf(row);
+      //编辑索引不等于当前编辑行索引
+      if (this.editingRowIndex !== rowIndex) {
+        if (this.isRowFilled(row)) {
+          row.isEditing = false;
+          //对于整个表格来说
+          this.isEditLine = false;
+          //当前编辑行置为-1
+          this.editingRowIndex = -1;
+        }
+      }
+    },
+    // 检查行是否填写完毕的示例方法
+    isRowFilled(row) {
+      return row.currentSpecification && row.productionDigit && row.startTime && row.plannedEndTime;
+    },
+    // 新增一行标记为可编辑
+    addEditableRow() {
+      // 检查当前编辑行是否已填写完毕
+      if(this.tableData2.length!=0){
+        if (this.editingRowIndex !== -1 && !this.isRowFilled(this.tableData2[this.editingRowIndex])) {
+          this.$message({
+            message: '请先完成上一条数据的填写',
+            type: 'warning'
+          });
+          return;
+        }
+        //新增行之前先让以前的行不能编辑
+        this.tableData2.forEach(item => {
+          item.isEditing = false;
+        })
+      }
+      this.tableData2.push({
+        currentColorCode: '',
+        currentSpecification: '',
+        currentLotNumber: '',
+        productionDigit: '',
+        startTime: '',
+        plannedEndTime:'',
+        planStatus:0,
+        productId:'',
+        salesmanId:'',
+        isEditing: true // 标记为正在编辑状态
+      });
+      this.editingRowIndex = this.tableData2.length - 1; // 更新当前编辑的行索引
+      this.lastEditLine = this.tableData2.length - 1
+    },
+    // 添加计划
+    addPlanInfo(){
+      const datatime=Date.now()+this.machineId;
+      //先查询计划表中有没有正在上机的
+      getPlanSpinningInfo({"machineId":this.machineId,"planStatus":1}).then(response => {
+          let i=0
+          //处理表格数据
+          this.tableData2.forEach(item=>{
+            item.timestampRandomCode=datatime;
+            item.machineId=this.machineId;
+            if(item.planStatus==1){
+              i++
+            }
+          })
+          if(i>=1&&response.data.length>0){
+            this.$message({
+              message: '只能有一个产品的状态为上机',
+              type: 'warning'
+            });
+            return;
+          }else {
+            //添加计划信息
+            addSpinningPlanList(this.tableData2).then(response => {
+              if (response.code == 200) {
+                this.$message({
+                  message: '添加成功',
+                  type: 'success'
+                });
+                this.getSpinningPlanList();
+                //最后把弹窗关掉
+                this.nanInsertDialogTableVisible=false
+              } else {
+                this.$message({
+                  message: '添加失败',
+                  type: 'error'
+                });
+                //最后把弹窗关掉
+                this.nanInsertDialogTableVisible=false
+              }
+            });
+          }
+      });
+    },
+    // 修改产品计划
+    handleEditPlan(row) {
+      //当前操作机台号
+      this.machineId=row.machineId;
+      this.tableData2=[];
+      //弹窗
+      this.nanUpdateDialogTableVisible = true
+      getPlanSpinningInfo({"machineId":row.machineId}).then((response) => {
+        //得到生产中,停产的,待产的
+        response.data.forEach(item => {
+          item.isEditing=false;
+          item.planStatus=parseInt(item.planStatus);
+          item.productId=parseInt(item.productId)
+        })
+        this.tableData2=response.data;
+        console.log( this.tableData2)
+        // 在数据加载完成后,手动触发每个行的第一个下拉框的 change 事件
+        this.$nextTick(() => {
+          // 获取第一个业务员选择框(假设表格只有一行)
+          this.tableDataStatus=[];
+          for (let i = 0; i < this.tableData2.length; i++) {
+            const firstSalesmanSelect = this.$refs['salesmanSelect'+i];
+            this.tableDataStatus.push({"index":i,"planStatus":this.tableData2[i].planStatus})
+            // console.log(firstSalesmanSelect,11111111)
+            // 触发 change 事件
+            if (firstSalesmanSelect) {
+              firstSalesmanSelect.$emit('change', {
+                target: {value: "ddd"},
+              });
+            }
+          }
+
+        });
+      })
+    },
+    //弹窗里边的点击查询
+    onSubmit(){
+      this.formData.machineId=this.machineId;
+      getPlanSpinningInfo(this.formData).then(response => {
+        //得到生产中,停产的,待产的
+        response.data.forEach(item => {
+          item.isEditing=false;
+          item.planStatus=parseInt(item.planStatus);
+        })
+        this.tableData2=response.data;
+      });
+    },
+    //重置
+    reset(){
+      getPlanSpinningInfo({"machineId":this.machineId}).then(response => {
+        //得到生产中,停产的,待产的
+        response.data.forEach(item => {
+          item.isEditing=false;
+          item.planStatus=parseInt(item.planStatus);
+        })
+        this.tableData2=response.data;
+      });
+    },
+    //更新状态
+    updateStatus(ind, row,planStatus){
+      const a=planStatus;
+      console.log( row.planStatus,this.tableDataStatus[ind].planStatus)
+      if(planStatus==this.tableDataStatus[ind].planStatus){
+        this.$message({
+          message: '并未更改状态,不会发送请求',
+          type: 'warning'
+        });
+        return;
+      }
+      //先查询计划表中有没有正在上机的
+      getPlanSpinningInfo({"machineId":this.machineId,"planStatus":planStatus}).then(response => {
+        let i=0
+        //处理表格数据
+        this.tableData2.forEach(item=>{
+          item.machineId=this.machineId;
+          if(item.planStatus==1){
+            i++
+          }
+        })
+        if(i>=1&&response.data.length>0){
+          this.$message({
+            message: '只能有一个产品的状态为上机',
+            type: 'warning'
+          });
+          row.planStatus=planStatus;
+          return;
+        }else {
+          updateSpinningInfoPlanOne(row).then(response=>{
+            if (response.code == 200) {
+              this.$message({
+                message: '修改成功',
+                type: 'success'
+              });
+              this.getSpinningPlanList();
+              this.tableDataStatus=[]
+              for (let i = 0; i < this.tableData2.length; i++) {
+                this.tableDataStatus.push({"index": i, "planStatus": this.tableData2[i].planStatus})
+              }
+              //最后把弹窗关掉
+              this.nanInsertDialogTableVisible=false
+            } else {
+              this.$message({
+                message: '修改失败',
+                type: 'error'
+              });
+              //最后把弹窗关掉
+              this.nanInsertDialogTableVisible=false
+            }
+          })
+        }
+      });
+
+    }
+  },
+  computed: {
+
+  },
+}
+</script>
+
+<style scoped>
+.el-tabs--border-card >>> .el-tabs__content {
+  padding: 0 !important;
+}
+.el-table__body-wrapper {
+  cursor: grab;
+}
+.el-table__body-wrapper.grabbing {
+  cursor: grabbing;
+}
+</style>

+ 2 - 2
zkqy-ui/src/views/tablelist/commonTable/listInfo.vue

@@ -66,7 +66,7 @@
         :selection="selection"
       ></btn-menu-list>
       <!-- 按钮行 end -->
-      <!-- <el-col :span="1.5">
+     <el-col :span="1.5">
         <el-button
           type="primary"
           plain
@@ -116,7 +116,7 @@
           @click="handleExport"
           >导出
         </el-button>
-      </el-col> -->
+      </el-col>
       <right-toolbar
         :showCount.sync="showCount"
         :showSearch.sync="showSearch"

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott