Browse Source

删除解密方式

695593266@qq.com 1 month ago
parent
commit
f0d62803ff

+ 2 - 1
.claude/settings.local.json

@@ -2,7 +2,8 @@
   "permissions": {
     "allow": [
       "Bash(python *)",
-      "Bash(node *)"
+      "Bash(node *)",
+      "mcp__ide__getDiagnostics"
     ]
   }
 }

+ 28 - 5
src/views/bpm/handleTask/components/productionWarehousing/detailDialog.vue

@@ -65,11 +65,29 @@
       </el-form>
     </div>
     <keep-alive>
+      <newAdd
+        ref="add"
+        :form="form"
+        :bizType="form.type || 1"
+        v-if="form.code && !isDetail && clientEnvironmentId != 9"
+        :sourceBizNo="form.code"
+        :detailList="form.detailList"
+        :isMoreProduct="form.type == 3 ? true : false"
+      ></newAdd>
+      <newAdd
+        ref="add"
+        :form="form"
+        :bizType="form.type || 1"
+        v-if="form.code && isDetail && clientEnvironmentId != 9"
+        :sourceBizNo="form.code"
+        :saleProductList="form.detailList"
+      ></newAdd>
+
       <add
         ref="add"
         :form="form"
         :bizType="form.type || 1"
-        v-if="form.code && !isDetail"
+        v-if="form.code && !isDetail && clientEnvironmentId == 9"
         :sourceBizNo="form.code"
         :detailList="form.detailList"
         :isMoreProduct="form.type == 3 ? true : false"
@@ -78,7 +96,7 @@
         ref="add"
         :form="form"
         :bizType="form.type || 1"
-        v-if="form.code && isDetail"
+        v-if="form.code && isDetail && clientEnvironmentId == 9"
         :sourceBizNo="form.code"
         :saleProductList="form.detailList"
       ></add>
@@ -92,7 +110,7 @@
   import { reviewStatusEnum } from '@/enum/dict';
   import add from './storage.vue';
 
-  // import add from '@/views/bpm/stockManagement/storage.vue';
+  import newAdd from '@/views/bpm/stockManagement/storage.vue';
 
   export default {
     props: {
@@ -107,7 +125,8 @@
       }
     },
     components: {
-      add
+      add,
+      newAdd
     },
     mixins: [dictMixins],
     data() {
@@ -124,10 +143,14 @@
         totalPackage: '',
         totalCount: '',
         isDetail: false,
-        dataSource: []
+        dataSource: [],
+        clientEnvironmentId: ''
       };
     },
     async created() {
+      this.clientEnvironmentId =
+        this.$store.state.user.info.clientEnvironmentId;
+      // this.clientEnvironmentId = 9;
       await this.getDetailData(this.businessId);
     },
 

+ 52 - 4
src/views/bpm/handleTask/components/productionWarehousing/storage.vue

@@ -986,7 +986,6 @@
   import { mapActions, mapGetters } from 'vuex';
   import BigNumber from 'bignumber.js';
   import headList from '@/components/headList';
-  import { decryptCode } from '@/utils/crypto';
   import tabMixins from '@/mixins/tableColumnsMixin';
 
   // import dictMixins from '@/mixins/dictMixins';
@@ -1259,7 +1258,7 @@
 
         if (e.key === 'Enter') {
           if (this._scanning && this.scanBuffer.length > 3) {
-            this.processScanCode(decryptCode(this.scanBuffer));
+            this.processScanCode(this.scanBuffer);
             // 扫码枪结束,吞掉这次 Enter,避免触发表单提交/单元格回车跳转
             e.preventDefault();
             e.stopPropagation();
@@ -1302,7 +1301,7 @@
           .trim();
         console.log('扫码粘贴事件:', text);
         if (text.length >= 3) {
-          this.processScanCode(decryptCode(text));
+          this.processScanCode(text);
         }
       },
       // 处理扫码结果:先匹配产品信息,再匹配包装明细
@@ -1312,7 +1311,56 @@
       processScanCode(code) {
         console.log('扫描条码:', code);
 
-        // 1. 在产品信息表格按 产品编码-批次号 匹配(二维码由产品编码和批号用-拼接)
+        // 新格式(非 jobBom):以 ";" 分隔的 8 段
+        // productCode;partCode;partName;batchNo;originalBatchNo;certificateNo;originalCertificateNo;feedQuantity
+        if (code.includes(';')) {
+          const segs = code.split(';');
+          const partCode = segs[1] || '';
+          const batchNo = segs[3] || '';
+          const certificateNo = segs[5] || '';
+          console.log('扫码新格式匹配条件:', {
+            partCode,
+            batchNo,
+            certificateNo
+          });
+
+          // 1. 在产品信息表格按 产品编码 + 批次号 匹配
+          const productIndex = this.productList.findIndex(
+            (item) =>
+              item.categoryCode &&
+              item.batchNo &&
+              item.categoryCode === partCode &&
+              item.batchNo === batchNo
+          );
+          if (productIndex > -1) {
+            this.productList[productIndex].confirmStatus = 1;
+            this.$message.success(
+              `产品信息匹配成功:${this.productList[productIndex].categoryCode}-${this.productList[productIndex].batchNo}`
+            );
+            return;
+          }
+
+          // 2. 在包装明细按 产品编码 + 批次号(+ 合格证号) 匹配
+          const packingIndex = this.packingList.findIndex(
+            (item) =>
+              item.categoryCode === partCode &&
+              item.batchNo === batchNo &&
+              (!certificateNo ||
+                !item.certificateNo ||
+                item.certificateNo === certificateNo)
+          );
+          if (packingIndex > -1) {
+            this.packingList[packingIndex].confirmStatus = 1;
+            this.$message.success(`包装明细匹配成功:${code}`);
+            return;
+          }
+
+          this.$message.warning(`未匹配到对应数据:${code}`);
+          return;
+        }
+
+        // 旧格式(jobBom):以 "-" 分隔
+        // 1. 在产品信息表格按 产品编码-批次号 匹配
         const productIndex = this.productList.findIndex(
           (item) =>
             item.categoryCode &&