Explorar el Código

流程配置修改

xiaoddyy123 hace 3 años
padre
commit
5580b49542

+ 6 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/ams/FlowConfigHeaderController.java

@@ -124,4 +124,10 @@ public class FlowConfigHeaderController extends BaseController {
     public AjaxResult flowConfigLotatt(@PathVariable Long id) {
         return AjaxResult.success(flowConfigHeaderService.selectLotattDetails(id));
     }
+
+    @GetMapping(value = "/flowConfigDict")
+    public AjaxResult flowConfigDict() {
+        List<FlowConfigHeader> list = flowConfigHeaderService.selectFlowConfigHeaderList(null);
+        return AjaxResult.success(list);
+    }
 }

+ 8 - 0
ruoyi-ui/src/api/ams/flowConfig.js

@@ -68,3 +68,11 @@ export function flowConfigLotatt(id) {
     method: 'get',
   })
 }
+
+// 查询流程配置字典
+export function flowConfigDict() {
+  return request({
+    url: '/ams/flowConfig/flowConfigDict',
+    method: 'get',
+  })
+}

+ 29 - 7
ruoyi-ui/src/views/ams/flowConfig/index.vue

@@ -321,12 +321,26 @@
           </el-col>
         </el-row>
         <el-row>
-          <el-col :span="6">
-            <el-form-item label="关联流程" prop="">
-
+          <el-col :span="8">
+            <el-form-item label="关联流程" prop="relFlow">
+              <el-select style="width: 100%" v-model="form.relFlow" size="small">
+                <el-option
+                  v-for="dict in flowDict"
+                  :key="dict.id"
+                  :label="dict.flowName"
+                  :value="dict.id"
+                />
+              </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="6">
+          <el-col :span="16">
+            <el-form-item>
+              <el-steps :active="3">
+                <el-step title="步骤1"></el-step>
+                <el-step title="步骤2"></el-step>
+                <el-step title="步骤3"></el-step>
+              </el-steps>
+            </el-form-item>
           </el-col>
         </el-row>
         <el-divider content-position="center">批次属性信息</el-divider>
@@ -361,7 +375,7 @@
 </template>
 
 <script>
-import { listFlowConfig, getFlowConfig, delFlowConfig, addFlowConfig, updateFlowConfig, queryLotattConfigListActive } from "@/api/ams/flowConfig";
+import { listFlowConfig, getFlowConfig, delFlowConfig, addFlowConfig, updateFlowConfig, queryLotattConfigListActive, flowConfigDict } from "@/api/ams/flowConfig";
 import { querySkuTypeDict } from "@/api/base/skuType";
 import { treeselectLocationZone } from "@/api/base/locationZone";
 import { querySupplierDict } from "@/api/base/supplier";
@@ -435,7 +449,8 @@ export default {
         {label : '入库', value : 'ASN'},
         {label : '出库', value : 'SO'},
         {label : '移库', value : 'MV'}
-      ]
+      ],
+      flowDict: []
     };
   },
   created() {
@@ -486,7 +501,9 @@ export default {
         createTime: null,
         updateBy: null,
         updateTime: null,
-        remark: null
+        remark: null,
+        relFlow: '',
+        rootFlow: ''
       };
       this.flowConfigDetailsList = [];
       this.resetForm("form");
@@ -667,6 +684,11 @@ export default {
         this.supplierCombo = response.data;
       });
 
+      //查询流程配置字典
+      flowConfigDict().then(response => {
+        this.flowDict = response.data;
+      });
+
       // 初始化库位
       treeselectLocationZone().then(response => {
         this.locationFromOptions = response.data;

+ 0 - 1
warewms-ams/src/main/java/com/ruoyi/ams/business/BusinessServiceImpl.java

@@ -57,7 +57,6 @@ public class BusinessServiceImpl implements IBusinessService {
     @Autowired
     private IFlowConfigHeaderService flowConfigHeaderService;
 
-
     @Transactional
     @Override
     public AjaxResult agvCall(List<AgvCallDTO> agvCallDTOList) {

+ 20 - 0
warewms-ams/src/main/java/com/ruoyi/ams/config/domain/form/FlowConfigForm.java

@@ -105,6 +105,10 @@ public class FlowConfigForm {
 
     private String remark;
 
+    private String relFlow;
+
+    private String rootFlow;
+
     public Long getId() {
         return id;
     }
@@ -296,4 +300,20 @@ public class FlowConfigForm {
     public void setFlowType(String flowType) {
         this.flowType = flowType;
     }
+
+    public String getRelFlow() {
+        return relFlow;
+    }
+
+    public void setRelFlow(String relFlow) {
+        this.relFlow = relFlow;
+    }
+
+    public String getRootFlow() {
+        return rootFlow;
+    }
+
+    public void setRootFlow(String rootFlow) {
+        this.rootFlow = rootFlow;
+    }
 }

+ 8 - 0
warewms-ams/src/main/java/com/ruoyi/ams/config/service/impl/FlowConfigHeaderServiceImpl.java

@@ -226,6 +226,14 @@ public class FlowConfigHeaderServiceImpl implements IFlowConfigHeaderService {
         }*/
         flowConfigHeader.setCreateBy(loginUser.getUsername());
         flowConfigHeader.setCreateTime(new Date());
+        if (!StringUtils.isEmpty(flowConfigForm.getRelFlow())) { //如果没有根节点那么说明
+            FlowConfigHeaderVO headerVO = this.selectFlowConfigHeaderById(flowConfigForm.getId());
+            if(StringUtils.isEmpty(headerVO.getRootFlow())) {
+                flowConfigHeader.setRootFlow(headerVO.getId().toString());
+            } else {
+                flowConfigHeader.setRootFlow(headerVO.getRootFlow());
+            }
+        }
         flowConfigHeaderMapper.insertFlowConfigHeader(flowConfigHeader);
         insertFlowConfigDetails(flowConfigHeader);
         return AjaxResult.success("保存成功");