Browse Source

Merge branch 'qingban' of http://113.44.0.55:8014/jiaxiaoqiang/JG-ADMIN-TEMP into qingban

luoxiao 1 tuần trước cách đây
mục cha
commit
174b5a3b83

+ 8 - 1
src/api/craft/route/index.ts

@@ -25,6 +25,14 @@ export function saveProcessInRoute(data: object) {
     data: data,
   });
 }
+// 后端蛇形排序
+export function toJavaSnake(data: object) {
+  return request({
+    url: `/api/v1/op/routeOperation/serpentine/sort`,
+    method: "post",
+    data: data,
+  });
+}
 
 // 保存xx关系表中的工序
 export function updateProcess(data: object) {
@@ -44,7 +52,6 @@ export function editRouteWith(data: object) {
   });
 }
 
-
 // 编辑工艺 针对产品负责人的修改
 export function copyList(data: object) {
   return request({

+ 11 - 0
src/api/storage/index.ts

@@ -86,3 +86,14 @@ export function oprerate(
     data: queryParams,
   });
 }
+
+
+export function outInv(
+  queryParams: object
+): AxiosPromise<any> {
+  return request({
+    url: "/api/v1/semiFinishedStock/out",
+    method: "post",
+    data: queryParams,
+  });
+}

+ 3 - 0
src/hooks/useLayout.js

@@ -30,6 +30,9 @@ export function useLayout() {
       // if you need width+height of nodes for your layout, you can use the dimensions property of the internal node (`GraphNode` type)
       const graphNode = findNode(node.id);
 
+      if (node?.data?.handles) {
+        node.data.handles = [];
+      }
       dagreGraph.setNode(node.id, {
         width: graphNode.dimensions.width || 150,
         height: graphNode.dimensions.height || 50,

+ 27 - 12
src/views/base/craftManagement/route/bindProcess.vue

@@ -81,12 +81,12 @@
             @node-drag-start="nodeDragStart"
           >
             <MiniMap style="background-color: grey" v-show="!printStauts" />
-            <template #edge-custom="props">
-              <CustomConnectionLine v-bind="props" />
-            </template>
-            <template #connection-line="props">
-              <CustomConnectionLine v-bind="props" />
-            </template>
+            <!--            <template #edge-custom="props">-->
+            <!--              <CustomConnectionLine v-bind="props" />-->
+            <!--            </template>-->
+            <!--            <template #connection-line="props">-->
+            <!--              <CustomConnectionLine v-bind="props" />-->
+            <!--            </template>-->
             <template #node-custom="props">
               <CustomNode v-bind="props" />
             </template>
@@ -268,6 +268,7 @@ import { useCommonStoreHook, useDictionaryStore } from "@/store";
 import {
   processesByRouteId,
   saveProcessInRoute,
+  toJavaSnake,
   updateProcess,
 } from "@/api/craft/route/index";
 import { formOption } from "./bindConfig";
@@ -342,7 +343,9 @@ const { onDragOver, onDrop, onDragLeave, isDragOver, onDragStart } =
   useDragAndDrop();
 // onConnect(addEdges);
 const onConnectMethod = (edge) => {
-  edge.type = "custom";
+  edge.type = "smoothstep";
+  edge.markerEnd = "arrowclosed";
+  edge.style = { strokeWidth: "2" };
   addEdges(edge);
 };
 
@@ -712,12 +715,24 @@ async function layoutGraph(direction) {
   });
 }
 // 转换为蛇形布局
-const convertToSnakeLayout = () => {
-  addHistory();
-  nodes.value = useSnakeLayoutHook(nodes.value, edges.value);
-  nextTick(() => {
-    fitView();
+// const convertToSnakeLayout = () => {
+//   addHistory();
+//   nodes.value = useSnakeLayoutHook(nodes.value, edges.value);
+//   nextTick(() => {
+//     fitView();
+//   });
+// };
+const convertToSnakeLayout = async () => {
+  const res = await toJavaSnake({
+    id: route.fullPath.split("/")[4],
+    routeData: JSON.stringify({ ...flowData }),
   });
+  let jsonData = JSON.parse(res.data.routeData);
+  flowData.nodes = jsonData.nodes;
+  flowData.edges = jsonData.edges;
+
+  // await loadProcessesFlow();
+  // flowBoxScreen();
 };
 </script>
 

+ 17 - 16
src/views/base/craftManagement/route/components/CustomNode/index.vue

@@ -47,14 +47,6 @@ console.log(props.data);
 
 <template>
   <div class="nodes" :class="getBorderClass">
-    <Handle
-      :style="{
-        height: '13px',
-        width: '13px',
-      }"
-      type="target"
-      :position="Position.Top"
-    />
     <div
       style="
         text-align: center;
@@ -66,14 +58,18 @@ console.log(props.data);
       {{ data.lineTag ? data.label + "(" + data.lineTag + ")" : data.label }}
     </div>
 
-    <Handle
-      :style="{
-        height: '13px',
-        width: '13px',
-      }"
-      type="source"
-      :position="Position.Bottom"
-    />
+    <div v-if="data.handles && data.handles.length">
+      <Handle
+        class="handle-style"
+        v-for="(handle, index) in data.handles"
+        :type="handle.type"
+        :position="handle.position"
+      />
+    </div>
+    <div v-else>
+      <Handle class="handle-style" type="target" :position="Position.Top" />
+      <Handle class="handle-style" type="source" :position="Position.Bottom" />
+    </div>
   </div>
 </template>
 <style lang="scss">
@@ -110,4 +106,9 @@ console.log(props.data);
   border-width: 2px;
   color: green;
 }
+
+.handle-style {
+  width: 13px;
+  height: 13px;
+}
 </style>

+ 1 - 1
src/views/base/craftManagement/routeCommon/index.vue

@@ -274,7 +274,7 @@ const router = useRouter();
 // 绑定工序
 const bindProcess = (row) => {
   router.push({
-    path: `/base/craftManagement/bindProcess/${row.id}/null`,
+    path: `/base/craftManagement/bindProcess/${row.id}/null/null`,
   });
 };
 

+ 113 - 5
src/views/storage/semi/components/details.vue

@@ -17,7 +17,49 @@
         :row-style="rowStyle"
         :cell-style="cellStyle"
         @selection-change="selectionChange"
-    />
+    >
+      <template #menu-left="{ size }">
+        <el-button
+          :disabled="toDeleteIds.length < 1"
+          type="primary"
+          :size="size"
+          @click="dialog3.visible = true"
+        >出库
+        </el-button
+        >
+      </template>
+    </avue-crud>
+
+    <el-dialog
+      v-model="dialog3.visible"
+      :title="dialog3.title"
+      width="550px"
+      @close="dialog3.visible = false"
+    >
+      <el-input
+        v-model="outWorkOrderCode"
+        placeholder="选择出库工单号"
+        :prefix-icon="Search"
+        @click="dialog4.visible = true"
+      >
+      </el-input>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="dialog3.visible = false">取消</el-button>
+          <el-button type="primary" @click="outInventory">
+            确定
+          </el-button>
+        </div>
+      </template>
+    </el-dialog>
+    <el-dialog
+      v-model="dialog4.visible"
+      :title="dialog4.title"
+      width="950px"
+      @close="dialog4.visible = false"
+    >
+      <work-order-page @order-info="materialInfo2" :queryType="99"/>
+    </el-dialog>
   </div>
 </template>
 <script setup>
@@ -36,11 +78,13 @@ const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
 const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
 const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
 const crudRef = ref(null); //crudRef.value 获取avue-crud对象
-import { getSemi, oprerate } from "@/api/storage/index";
+import {getSemi, oprerate, outInv} from "@/api/storage/index";
 import { useDictionaryStore } from "@/store";
+import {Search} from "@element-plus/icons-vue";
 const { dicts } = useDictionaryStore();
 const emits = defineEmits(["close"]);
 const ruleFormRef = ref(null);
+const outWorkOrderCode = ref(null);
 const dialog1 = reactive({
   title: "工单号选择",
   visible: false,
@@ -49,6 +93,40 @@ const materialInfo1 = (value) => {
   formData.value.outWorkOrderCode = value.workOrderCode;
   dialog1.visible = false;
 };
+
+const materialInfo2 = async (value) => {
+  outWorkOrderCode.value = value.workOrderCode;
+  dialog4.visible = false;
+};
+const dialog3 = reactive({
+  title: "出库",
+  visible: false,
+});
+
+const dialog4 = reactive({
+  visible: false,
+  title: "工单编码选择",
+});
+const outInventory = () => {
+
+  outInv({
+    inStockId: props.id,
+    ids: toDeleteIds.value,
+    outNum: toDeleteIds.value.length,
+    outWorkOrderCode: outWorkOrderCode.value
+  }).then((res) => {
+    if (res.code == "200") {
+      ElMessage.success("出库成功!");
+    } else {
+      ElMessage.error("出库失败!");
+    }
+    dialog3.visible = false;
+    outWorkOrderCode.value = null;
+    search.value.inStockId = props.id;
+    dataList();
+  });
+
+};
 const formData = ref({
   stockId: "",
   stockType: "2",
@@ -97,8 +175,19 @@ option.value = Object.assign(option.value, {
   viewBtn: false,
   menu: false,
   addBtn: false,
+  selectable: (row) => {
+    // 返回 true 表示允许勾选,false 表示禁用勾选
+    return row.inventoryStatus === 1; // 例如:状态不是 "已审核" 的行才能勾选
+  },
   column: [
     {
+      label: "管号",
+      prop: "workOrderSeqNo",
+      editDisabled: true,
+      addDisplay: false,
+      search: true,
+    },
+    {
       label: "生产批号",
       prop: "workOrderCode",
       editDisabled: true,
@@ -112,11 +201,30 @@ option.value = Object.assign(option.value, {
       ],
     },
     {
-      label: "号",
-      prop: "workOrderSeqNo",
+      label: "出库工单号",
+      prop: "outWorkOrderCode",
       editDisabled: true,
       addDisplay: false,
-      search: true,
+      rules: [
+        {
+          required: true,
+          trigger: "trigger",
+        },
+      ],
+    },
+    {
+      label: "是否已出库",
+      prop: "inventoryStatus",
+      editDisabled: true,
+      addDisplay: false,
+      html: true,
+      formatter: (val) => {
+        if (val.inventoryStatus === 2) {
+          return '<b class="el-tag el-tag--success el-tag--light">是</b>';
+        } else {
+          return '<b class="el-tag el-tag--danger el-tag--light">否</b>';
+        }
+      },
     },
 
   ]

+ 14 - 3
src/views/storage/semi/index.vue

@@ -62,13 +62,12 @@
       v-model="dialog3.visible"
       :title="dialog3.title"
       width="950px"
-      @close="dialog3.visible = false"
+      @close="dialog3.visible = false;dataList();"
     >
       <Details
         :id="selectId"
         @close="
           dialog3.visible = false;
-          dataList();
         "
       />
     </el-dialog>
@@ -217,7 +216,7 @@ option.value = Object.assign(option.value, {
         },
       },*/
     {
-      label: "库数量",
+      label: "库数量",
       prop: "operateNum",
       addDisplay: false,
       editDisabled: true,
@@ -228,6 +227,18 @@ option.value = Object.assign(option.value, {
         },
       ],
     },
+    {
+      label: "出库数量",
+      prop: "outNum",
+      addDisplay: false,
+      editDisabled: true,
+      rules: [
+        {
+          required: true,
+          trigger: "trigger",
+        },
+      ],
+    },
 
     /*{
       label: "出入库类型",