xiaojiao
2026-01-24 c5f01e9a882b16f534166d033312c5c8ba8d94dd
ÏîÄ¿´úÂë/PDA/pages/Check/Check.vue
@@ -18,7 +18,7 @@
            <u-tr>
               <u-td width="30%">轴承编号</u-td>
               <u-td>
                  <u-input v-model="materielNumber" :focus="qrcodeFocus" :border="true" placeholder="请扫描轴承编号"
                  <u-input v-model="materielNumber" :focus="qrcodeFocus" :border="true" placeholder="请扫描轴承编号!"
                     @input="barcodeChange" />
               </u-td>
            </u-tr>
@@ -152,10 +152,26 @@
            this.checkResult = value.orignItem.label;
         },
         barcodeChange() {
            if(this.materielNumber.length > 20){
               const rawStr = _this.materielNumber;
               // 2. ä¿®å¤æ ¼å¼ï¼ˆå•引号→双引号 + åˆ å°¾é€—号)
               const fixedStr = rawStr.replace(/'/g, '"').replace(/,\s*}/, '}');
               console.log(fixedStr)
               // 3. è§£æžä¸ºå­—典(对象)
               const temp_dict = JSON.parse(fixedStr);
               console.log(temp_dict)
               // 4. æ­£ç¡®èŽ·å–å€¼
               console.log(temp_dict['轴承条码']); // è¾“出:1(不再是undefined)
               _this.materielNumber = temp_dict['轴承条码'];
            }
            if (_this.materielNumber == '' || _this.materielNumber == null) {
               _this.initAVG();
               return;
            }
            let where =
               "[" +
               "{'name':'containerdtl_number','value':'" + _this.materielNumber + "'}]";