cz vor 1 Jahr
Ursprung
Commit
989d2a29b7

+ 20 - 16
src/views/JXSK/processConfig/vueFlow.vue

@@ -158,6 +158,10 @@ const antvInit = async (data) => {
     height: 600,
     container: document.getElementById("graph-container")!,
     grid: true,
+    panning: {
+      enabled: true,
+      eventTypes: "rightMouseDown",
+    },
     onPortRendered: pushRoom,
     mousewheel: {
       enabled: true,
@@ -214,11 +218,11 @@ const antvInit = async (data) => {
       },
     },
   });
-  graph.use(
-    new MiniMap({
-      container: document.getElementById("minimap"),
-    })
-  );
+  // graph.use(
+  //   new MiniMap({
+  //     container: document.getElementById("minimap"),
+  //   })
+  // );
   const stencil = new Stencil({
     title: "流程图",
     target: graph,
@@ -280,8 +284,8 @@ const antvInit = async (data) => {
       ports[i].style.visibility = show ? "visible" : "hidden";
     }
   };
-  // 监听添加节点
 
+  // 监听添加节点
   graph.on("node:added", ({ node }) => {});
   graph.on("node:mouseenter", () => {
     const container = document.getElementById("graph-container")!;
@@ -531,7 +535,7 @@ const antvInit = async (data) => {
   } else {
     graph.addNode({
       shape: "start-btn",
-      x: 200,
+      x: 500,
       y: 20,
       label: "开始",
       id: 1,
@@ -540,7 +544,7 @@ const antvInit = async (data) => {
 
     graph.addNode({
       shape: "end-btn",
-      x: 200,
+      x: 500,
       y: 300,
       label: "结束",
       id: 99,
@@ -571,6 +575,11 @@ onMounted(() => {
   } else {
     getFlowInfo();
   }
+  setTimeout(() => {
+    if (window.document.getElementById("minimap").children.length > 1) {
+      window.document.getElementById("minimap").children[0].remove();
+    }
+  }, 500);
 });
 defineExpose({
   submitAll,
@@ -614,20 +623,15 @@ defineExpose({
   #container {
   }
   #graph-container {
-    // width: 100%;
     width: 100%;
+    // width: 100%;
     // position: absolute;
     // right: 0;
     // top: 0;
   }
 }
-// .x6-graph-svg {
-//   height: 600px !important;
-// }
-.x6-graph {
+
+#stencil .x6-widget-stencil-content .x6-widget-stencil-group-content .x6-graph {
   height: 1000px !important;
 }
-// .x6-widget-stencil-group {
-//   overflow: none !important;
-// }
 </style>

+ 31 - 90
src/views/JXSK/production/forward/index.vue

@@ -1,66 +1,39 @@
 <template>
   <div class="tenant">
     <div class="content">
-      <byTable
-        :source="sourceList.data"
-        :pagination="sourceList.pagination"
-        :config="config"
-        :loading="loading"
-        highlight-current-row
-        :selectConfig="selectConfig"
-        :table-events="{}"
-        :action-list="[]"
-        @get-list="getList"
-      >
+      <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
+               :selectConfig="selectConfig" :table-events="{}" :action-list="[]" @get-list="getList">
       </byTable>
     </div>
-    <el-dialog
-      :title="'任务流转'"
-      v-model="dialogVisible"
-      :width="submitType == '20' ? '60%' : '600'"
-      v-loading="loading"
-      destroy-on-close
-    >
-      <byForm
-        :formConfig="formConfig"
-        :formOption="formOption"
-        v-model="formData.data"
-        :rules="rules"
-        ref="byform"
-      >
+    <el-dialog :title="'任务流转'" v-model="dialogVisible" :width="submitType == '20' ? '60%' : '600'" v-loading="loading" destroy-on-close>
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
         <template #right>
           <div style="width: 100%; padding-left: 54%; margin-bottom: -330px">
             <el-form-item label="条形码">
               <div id="pdfDom" style="border: 1px solid #000; padding: 10px">
                 <svg id="barCode"></svg>
                 <div>
-                  <div
-                    style="
+                  <div style="
                       font-size: 14px;
                       font-weight: 700;
                       color: #000;
                       line-height: 32px;
-                    "
-                  >
+                    ">
                     产品:{{ printData.productName }}
                   </div>
-                  <div
-                    style="
+                  <div style="
                       font-size: 14px;
                       font-weight: 700;
                       color: #000;
                       line-height: 32px;
-                    "
-                  >
+                    ">
                     客户:{{ printData.customerName }}
                   </div>
                 </div>
               </div>
             </el-form-item>
             <div style="text-align: center; margin-top: 10px">
-              <el-button type="primary" v-print="printObj" size="large"
-                >打 印</el-button
-              >
+              <el-button type="primary" v-print="printObj" size="large">打 印</el-button>
             </div>
           </div>
         </template>
@@ -71,68 +44,41 @@
         </template>
         <template #file>
           <div style="width: 100%">
-            <el-upload
-              v-model:fileList="formData.data.fileList"
-              action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
-              :data="uploadData"
-              multiple
-              :before-upload="uploadFile"
-              :on-preview="onPreviewFile"
-            >
+            <el-upload v-model:fileList="formData.data.fileList" action="https://winfaster.obs.cn-south-1.myhuaweicloud.com" :data="uploadData"
+                       multiple :before-upload="uploadFile" :on-preview="onPreviewFile">
               <el-button>选择</el-button>
             </el-upload>
           </div>
         </template>
         <template #fileOne>
-          <div
-            style="width: 100%"
-            v-if="
+          <div style="width: 100%" v-if="
               formData.data.fileListOne && formData.data.fileListOne.length > 0
-            "
-          >
-            <span
-              v-for="item in formData.data.fileListOne"
-              :key="item.id"
-              @click="onPreviewFile(item)"
-              style="margin-right: 10px; cursor: pointer; color: #409eff"
-            >
+            ">
+            <span v-for="item in formData.data.fileListOne" :key="item.id" @click="onPreviewFile(item)"
+                  style="margin-right: 10px; cursor: pointer; color: #409eff">
               {{ item.name }}
             </span>
           </div>
           <div style="width: 100%" v-else>无</div>
         </template>
         <template #fileTwo>
-          <div
-            style="width: 100%"
-            v-if="
+          <div style="width: 100%" v-if="
               formData.data.fileListTwo && formData.data.fileListTwo.length > 0
-            "
-          >
-            <span
-              v-for="item in formData.data.fileListTwo"
-              :key="item.id"
-              @click="onPreviewFile(item)"
-              style="margin-right: 10px; cursor: pointer; color: #409eff"
-            >
+            ">
+            <span v-for="item in formData.data.fileListTwo" :key="item.id" @click="onPreviewFile(item)"
+                  style="margin-right: 10px; cursor: pointer; color: #409eff">
               {{ item.name }}
             </span>
           </div>
           <div style="width: 100%" v-else>无</div>
         </template>
         <template #fileThree>
-          <div
-            style="width: 100%"
-            v-if="
+          <div style="width: 100%" v-if="
               formData.data.fileListThree &&
               formData.data.fileListThree.length > 0
-            "
-          >
-            <span
-              v-for="item in formData.data.fileListThree"
-              :key="item.id"
-              @click="onPreviewFile(item)"
-              style="margin-right: 10px; cursor: pointer; color: #409eff"
-            >
+            ">
+            <span v-for="item in formData.data.fileListThree" :key="item.id" @click="onPreviewFile(item)"
+                  style="margin-right: 10px; cursor: pointer; color: #409eff">
               {{ item.name }}
             </span>
           </div>
@@ -141,20 +87,10 @@
       </byForm>
       <template #footer>
         <el-button @click="dialogVisible = false" size="large">取 消</el-button>
-        <el-button
-          type="primary"
-          @click="submitForm(true)"
-          size="large"
-          :loading="submitLoading"
-        >
+        <el-button type="primary" @click="submitForm(true)" size="large" :loading="submitLoading">
           {{ submitText }}
         </el-button>
-        <el-button
-          type="danger"
-          @click="submitForm()"
-          size="large"
-          :loading="submitLoading"
-        >
+        <el-button type="danger" @click="submitForm()" size="large" :loading="submitLoading">
           退回任务池
         </el-button>
       </template>
@@ -403,6 +339,7 @@ const submitForm = (flag) => {
         id: formData.data.id,
         receivedUserId: formData.data.receivedUserId,
         fileList: formData.data.fileList,
+        taskProgressId: formData.data.taskProgressId,
       };
       proxy.post("/productionTaskDetail/circulation", data).then(
         (res) => {
@@ -427,6 +364,7 @@ const submitForm = (flag) => {
         .post("/productionTaskDetail/productStorage", {
           id: formData.data.id,
           fileList: formData.data.fileList,
+          taskProgressId: formData.data.taskProgressId,
         })
         .then(
           (res) => {
@@ -454,7 +392,10 @@ const submitForm = (flag) => {
       type: "warning",
     }).then(() => {
       proxy
-        .post("/productionTaskDetail/revokeTask", { id: formData.data.id })
+        .post("/productionTaskDetail/revokeTask", {
+          id: formData.data.id,
+          taskProgressId: formData.data.taskProgressId,
+        })
         .then(
           (res) => {
             ElMessage({

+ 24 - 18
src/views/JXSK/production/processConfig/vueFlow.vue

@@ -119,7 +119,7 @@ const deleteFlowDefinitionNodeObj = () => {
   dialogVisible.value = false;
   let productionId = formData.data.cell.store.data.productionId;
   // type 1为自定义工序 0为固定工序
-  proxy.$emit("removeRow", { id: productionId, type: "1" });
+  proxy.$emit("removeRow", { id: productionId });
 };
 
 const submitForm = () => {
@@ -250,6 +250,10 @@ const antvInit = async (data) => {
     height: 600,
     container: document.getElementById("graph-container")!,
     grid: true,
+    panning: {
+      enabled: true,
+      eventTypes: "rightMouseDown",
+    },
     onPortRendered: pushRoom,
     mousewheel: {
       enabled: true,
@@ -306,11 +310,11 @@ const antvInit = async (data) => {
       },
     },
   });
-  graph.use(
-    new MiniMap({
-      container: document.getElementById("minimap"),
-    })
-  );
+  // graph.use(
+  //   new MiniMap({
+  //     container: document.getElementById("minimap"),
+  //   })
+  // );
   const stencil = new Stencil({
     title: "流程图",
     target: graph,
@@ -379,13 +383,13 @@ const antvInit = async (data) => {
       let time = Date.now();
       node.store.data.productionId = time;
       proxy.$emit("addRow", {
-        time,
+        productionId: time,
       });
     } else if (node.store.data && node.store.data.shape == "handle-btn") {
       let name = node.store.data.label;
       proxy.$emit("addRow", {
         name,
-        nodeId: node.id,
+        productionId: node.store.data.productionId,
       });
     }
   });
@@ -420,7 +424,9 @@ const antvInit = async (data) => {
       }).then(() => {
         graph.removeNode(cell.id);
         if (cell.shape === "handle-btn") {
-          proxy.$emit("removeRow", { id: cell.id, type: "0" });
+          proxy.$emit("removeRow", {
+            id: cell.store.data.productionId,
+          });
         }
       });
       return;
@@ -673,7 +679,7 @@ const antvInit = async (data) => {
   } else {
     graph.addNode({
       shape: "start-btn",
-      x: 200,
+      x: 500,
       y: 20,
       label: "开始",
       id: 1,
@@ -682,7 +688,7 @@ const antvInit = async (data) => {
 
     graph.addNode({
       shape: "end-btn",
-      x: 200,
+      x: 500,
       y: 300,
       label: "结束",
       id: 99,
@@ -713,6 +719,11 @@ onMounted(() => {
   } else {
     getFlowInfo();
   }
+  setTimeout(() => {
+    if (window.document.getElementById("minimap").children.length > 1) {
+      window.document.getElementById("minimap").children[0].remove();
+    }
+  }, 500);
 });
 defineExpose({
   submitAll,
@@ -763,13 +774,8 @@ defineExpose({
     // top: 0;
   }
 }
-// .x6-graph-svg {
-//   height: 600px !important;
-// }
-.x6-graph {
+
+#stencil .x6-widget-stencil-content .x6-widget-stencil-group-content .x6-graph {
   height: 1000px !important;
 }
-// .x6-widget-stencil-group {
-//   overflow: none !important;
-// }
 </style>

+ 27 - 19
src/views/JXSK/production/receive/index.vue

@@ -13,7 +13,7 @@
         @get-list="getList"
       >
       </byTable> -->
-      <div style="display:flex;flex-wrap:wrap;justify-content:space-between;padding:0 30px">
+      <div style="display:flex;flex-wrap:wrap;justify-content:space-between;padding:0 30px" v-if="sourceList.data && sourceList.data.length>0">
         <el-card class="box-card" v-for="item in sourceList.data" :key="item.id" style="width:31%;margin-top:20px;">
           <div style="display:flex;flex-wrap:wrap;justify-content:space-between;padding-left: 10px;align-items:center">
             <div style="flex:1">
@@ -43,6 +43,9 @@
 
         </el-card>
       </div>
+      <div v-else>
+        暂无数据
+      </div>
 
     </div>
     <el-dialog :title="'任务接收'" v-model="dialogVisible" width="700" v-loading="loading" destroy-on-close>
@@ -330,24 +333,29 @@ const getList = async (req) => {
     });
 };
 const submitApi = () => {
-  proxy.post("/productionTaskDetail/receive", { id: formData.data.id }).then(
-    (res) => {
-      ElMessage({
-        message: "操作成功",
-        type: "success",
-      });
-      dialogVisible.value = false;
-      submitLoading.value = false;
-      getList();
-    },
-    (err) => {
-      submitLoading.value = false;
-      return ElMessage({
-        message: err.message,
-        type: "info",
-      });
-    }
-  );
+  proxy
+    .post("/productionTaskDetail/receive", {
+      id: formData.data.id,
+      taskProgressId: formData.data.taskProgressId,
+    })
+    .then(
+      (res) => {
+        ElMessage({
+          message: "操作成功",
+          type: "success",
+        });
+        dialogVisible.value = false;
+        submitLoading.value = false;
+        getList();
+      },
+      (err) => {
+        submitLoading.value = false;
+        return ElMessage({
+          message: err.message,
+          type: "info",
+        });
+      }
+    );
 };
 const submitForm = (flag) => {
   if (flag) {

+ 10 - 14
src/views/JXSK/production/workOrder/index.vue

@@ -773,7 +773,7 @@ const submitApi = (type) => {
   if (!data) {
     return;
   }
-  formData.data.customizedNodeObject = data.nodeObject;
+  formData.dataOne.customizedNodeObject = data.nodeObject;
   formData.dataOne.fileList = formData.dataOne.fileList.map((item) => {
     return {
       id: item.raw.id,
@@ -806,7 +806,6 @@ const submitApi = (type) => {
     (err) => (loadingOne.value = false)
   );
 };
-const nodeObject = ref("");
 const submitFormOne = (type) => {
   byformOne.value.handleSubmit((valid) => {
     // for (
@@ -883,6 +882,8 @@ const initSort = () => {
   });
 };
 const isDetailOne = ref(false);
+const nodeObject = ref("");
+
 const getDtlOne = (row, flag) => {
   isDetailOne.value = flag;
   // formOptionOne.disabled = flag;
@@ -892,6 +893,7 @@ const getDtlOne = (row, flag) => {
   proxy
     .post("/workOrderProductionProcesses/detail", { workOrderId: row.id })
     .then((res) => {
+      nodeObject.value = res.customizedNodeObject;
       dialogVisibleOne.value = true;
       res.workOrderProductionProcessesList =
         res.workOrderProductionProcessesList.map((x) => ({
@@ -1020,31 +1022,25 @@ const handleSelect = (row) => {
   });
 };
 
-const clickAdd = ({ time, name, nodeId }) => {
+const clickAdd = ({ productionId, name }) => {
   let obj = {
     fileList: [],
     fileListCopy: [],
     name: "",
     remarks: "",
   };
-  if (time) {
-    obj.productionId = time;
+  if (productionId) {
+    obj.id = productionId;
   }
   if (name) {
     obj.name = name;
   }
-  if (nodeId) {
-    obj.nodeId = nodeId;
-  }
-  // type 1为自定义工序 0为固定工序
-  obj.type = time ? "1" : "0";
   formData.dataOne.workOrderProductionProcessesList.push(obj);
 };
 
-const removeRow = ({ id, type }) => {
-  let key = type == "1" ? "productionId" : "nodeId";
+const removeRow = ({ id }) => {
   const index = formData.dataOne.workOrderProductionProcessesList.findIndex(
-    (x) => x[key] == id
+    (x) => x.id == id
   );
   if (index > -1) {
     formData.dataOne.workOrderProductionProcessesList.splice(index, 1);
@@ -1053,7 +1049,7 @@ const removeRow = ({ id, type }) => {
 
 const changeName = ({ productionId, name }) => {
   const index = formData.dataOne.workOrderProductionProcessesList.findIndex(
-    (x) => x.productionId == productionId
+    (x) => x.id == productionId
   );
   if (index > -1) {
     formData.dataOne.workOrderProductionProcessesList[index].name = name;

+ 3 - 3
src/views/production/project/technology/index.vue

@@ -15,7 +15,7 @@
         <template #line="{ item }">
           <span v-for="(x, i) in item.processRouteNameList" :key="i">
             {{ x }}
-            <span style="margin: 0 3px" v-if="i + 1 < item.processRouteNameList.length">>
+            <span style="margin: 0 3px" v-if="i + 1 < item.processRouteNameList.length"> ,
             </span>
           </span>
         </template>
@@ -100,7 +100,7 @@ import byForm from "@/components/byForm/index";
 import SelectProduct from "@/components/product/SelectProduct";
 import vueFlow from "@/views/JXSK/processConfig/vueFlow.vue";
 
-import { computed, defineComponent, ref, toRaw } from "vue";
+import { computed, defineComponent, nextTick, ref, toRaw } from "vue";
 const loading = ref(false);
 const submitLoading = ref(false);
 const sourceList = ref({
@@ -317,9 +317,9 @@ const getProcesses = async () => {
     });
 };
 
-const dataId = ref("1702504334962466818");
 const openModal = () => {
   dialogVisible.value = true;
+  nodeObject.value = "";
   modalType.value = "add";
   formData.data = {};
   selectLine.value = [];

+ 1 - 1
vite.config.js

@@ -39,7 +39,7 @@ export default defineConfig(({
       proxy: {
         // https://cn.vitejs.dev/config/#server-proxy
         '/dev-api': {
-          target: ' http://139.9.102.170:10020/test-api',
+          target: 'http://139.9.102.170:10020/test-api',
           changeOrigin: true,
           rewrite: (p) => p.replace(/^\/dev-api/, '')
         },