Ver código fonte

Merge branch 'qingban' of http://maven.jgiot.com:7012/jiaxiaoqiang/JG-ADMIN-TEMP into qingban

huhao@jgai.com 3 meses atrás
pai
commit
2d53f2780e

+ 1 - 0
src/App.vue

@@ -34,4 +34,5 @@ const fontColor = computed(() => {
     ? "rgba(255, 255, 255, .15)"
     : "rgba(0, 0, 0, .15)";
 });
+settingsStore.changeTheme(ThemeEnum.LIGHT)
 </script>

+ 1 - 0
src/common/configs/buttonPermission.ts

@@ -73,6 +73,7 @@ const ButtonPermKeys = {
     BTNS: {
       picture_del: "base:picture:del",
       picture_edit: "base:picture:edit",
+      picture_download: "base:picture:download",
     },
   },
   //设备管理

+ 18 - 1
src/views/base/craftManagement/route/bindProcess.vue

@@ -5,6 +5,11 @@
   >
     <div class="header">
       <div class="title">绑定工序</div>
+      <div class="processInfo">
+        <span>工艺名称:{{ routeOperationData?.processRouteName }}</span>
+        <span>产品名称:{{ routeOperationData?.prodtName }}</span>
+        <span>产品编码:{{ routeOperationData?.prodtCode }}</span>
+      </div>
       <el-button :icon="Back" size="small" @click="back">返回</el-button>
     </div>
     <div class="binContainer">
@@ -598,11 +603,14 @@ const filterDicts = () => {
   // dictsArray.value = arr;
 };
 
+
+const routeOperationData = ref(null);
 const cancelStatus = ref(true);
 //通过id获取现存储信息
 const loadProcessesFlow = async () => {
   const res = await processesByRouteId(route.fullPath.split("/")[4]);
   if (res.data) {
+    routeOperationData.value = res.data;
     if (res.data.routeData && res.data.routeData != "") {
       let jsonData = JSON.parse(res.data.routeData);
       flowData.nodes = jsonData.nodes;
@@ -626,6 +634,7 @@ const formRef = ref(null);
 const reset = () => {
   currentProcess.value = {};
   editStatus.value = false;
+  routeOperationData.value = {};
 };
 const editProComponent = async () => {
   router.push({
@@ -779,7 +788,7 @@ const convertToSnakeLayout = () => {
   }
 }
 
-.title {
+.title,.processInfo{
   line-height: 44px;
   color: #6f7991;
   font-size: 14px;
@@ -787,6 +796,14 @@ const convertToSnakeLayout = () => {
   text-align: left;
   margin-left: 20px;
 }
+
+.processInfo span {
+  margin: 0 150px 0 200px;
+}
+.processInfo {
+  position: absolute;
+  left: 5%;
+}
 .title2 {
   color: #232032;
   font-size: 14px;

+ 27 - 2
src/views/base/craftManagement/route/components/groupProcess.vue

@@ -35,7 +35,6 @@ function confirmClick() {
 }
 
 const startGroup = async (nodes: any[], routeId: string) => {
-  console.log(nodes);
   nodesData.value = markRaw(nodes);
   routeIdA.value = routeId;
 
@@ -92,6 +91,28 @@ const addGroup = () => {
     groupData.value[input3.value] = [];
   }
 };
+
+
+// 新增全选相关
+const checked = ref<boolean>()
+const selectAll = (key: string) => {
+  if (checked.value) {
+    groupData.value[key] = []
+    nodesData.value.map((item) => {
+      groupData.value[key].push(item.operationId)
+    })
+  } else {
+    groupData.value[key] = []
+  }
+}
+
+const changeChecked = (key: string) => {
+  if (groupData.value[key].length === nodesData.value.length) {
+    checked.value = true
+  } else {
+    checked.value = false
+  }
+}
 </script>
 
 <template>
@@ -126,6 +147,7 @@ const addGroup = () => {
           filterable
           placeholder="请选择工序"
           popper-class="custom-header"
+          @click="changeChecked(key)"
         >
           <!--          <template #header>-->
           <!--            <el-checkbox-->
@@ -135,7 +157,10 @@ const addGroup = () => {
           <!--            >-->
           <!--              All-->
           <!--            </el-checkbox>-->
-          <!--          </template>-->
+          <!--          </template> -->
+          <template #header>
+            <el-checkbox v-model="checked" @change="selectAll(key)">全选</el-checkbox>
+          </template>
           <el-option
             v-for="item in nodesData"
             :key="item.operationId"

+ 2 - 1
src/views/base/craftManagement/route/components/processComponent.vue

@@ -197,7 +197,8 @@ const clickToolCom = (com, index) => {
     com.compentType === "jingu" ||
     com.compentType === "ceshishuju" ||
     com.compentType === "screwdriver" ||
-    com.compentType === "gongxuwenjian"
+    com.compentType === "gongxuwenjian" ||
+    com.compentType === "shebeijilu"
   ) {
     isNoneedEdit.value = true;
   } else {

+ 39 - 0
src/views/base/information/index.vue

@@ -24,6 +24,7 @@
           v-model:pdf-list="pdfUrlList"
           v-model:file-name-list="fileNameList"
           :limit="10"
+          :show-tip="false"
           :generate-pdf="true"
           @finished="testFiles"
         />
@@ -62,6 +63,14 @@
           v-hasPerm="[buttonPermission.BasicData.BTNS.picture_edit]"
           >编辑</el-button
         >
+        <el-button
+          @click="downloadFile(row, index)"
+          :loading="downloadBtnLoading"
+          text
+          type="primary"
+          v-hasPerm="[buttonPermission.BasicData.BTNS.picture_download]"
+        >下载</el-button
+        >
       </template>
       <template #menu-left="{ size }">
         <el-button
@@ -163,6 +172,8 @@ onMounted?.(() => {
   dataEditList();
 });
 
+
+
 const onSelectedFinish = (selectedValue) => {
   form.value.associationCode = selectedValue.materialCode;
   form.value.associationName = selectedValue.materialName;
@@ -413,4 +424,32 @@ const deleteRecord = (row, index, done) => {
   deleteRow(row, index, done);
   dataEditList();
 };
+
+const downloadBtnLoading = ref(false);
+const downloadFile = async (row, index, done) => {
+
+  downloadBtnLoading.value = true;
+  let url = import.meta.env.VITE_APP_UPLOAD_URL + row.drawingPath;
+
+  // 1. 获取资源并转为Blob
+  const response = await fetch(url);
+  const blob = await response.blob();
+
+  // 2. 创建临时对象URL
+  const tempUrl = URL.createObjectURL(blob);
+
+  // 3. 创建隐藏a标签触发下载
+  const link = document.createElement("a");
+  link.href = tempUrl;
+  link.download = row.filename;
+  link.style.display = "none";
+  document.body.appendChild(link);
+  link.click();
+
+  // 4. 清理内存
+  URL.revokeObjectURL(tempUrl);
+  document.body.removeChild(link)
+  downloadBtnLoading.value = false;
+}
+
 </script>

+ 6 - 2
src/views/plan/order/index.vue

@@ -480,9 +480,13 @@ option.value = {
         }
       },
       change: ({ value, column }) => {
-        if (value != form.value.materialCode && value) {
-          dialog1.visible = true;
+
+        if (column.boxType && column.boxType === "add") {
+          if (value != form.value.materialCode && value) {
+            dialog1.visible = true;
+          }
         }
+
       },
     },
     {

+ 3 - 1
vite.config.ts

@@ -257,7 +257,9 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
       "process.env": process.env, //尝试访问 Node.js 环境变量,但这些变量在浏览器环境中是不存在的。(process is not defined)
     },
     esbuild: {
-      drop: ["console", "debugger"], // 去除 console.log 和 debugger
+      // 仅在生产环境删除调试语句
+      drop: mode === 'production' ? ["console", "debugger"] : [],
+      // drop: ["console", "debugger"], // 去除 console.log 和 debugger , 这行导致所有调试语句被删除
     },
   };
 });