#
whycq
2024-09-13 f9e93380e5192b35943769950c698c50b86febb6
pages/pakin/pakin.vue
@@ -130,6 +130,8 @@
</template>
<script>
   import {setCurrentDeviceAction} from '../../static/js/PresetsPda.js'
   import {initScan,startScan,stopScan} from '../../static/js/scanModule.js'
   export default {
      data() {
         return {
@@ -203,11 +205,32 @@
         },
         // 搜索物料
         findMat() {
            let that = this
            let _this = this
            initScan();
            startScan();
            let item = {}
            item['threeCode'] = that.matnr
            this.dataList.unshift(item)
            this.focuss()
            uni.$on("SCAN_CODE", ({code}) => {
               console.log(code);
               item['threeCode'] = code
               if (_this.dataList.length > 0) {
                  let add = false
                  for   (let k of _this.dataList) {
                     if (code == k.threeCode) {
                        add = false
                     } else {
                        add = true
                     }
                  }
                  if (add) {
                     _this.dataList.unshift(item)
                  }
               } else {
                  _this.dataList.unshift(item)
               }
               _this.focuss()
               // code就是扫码的结果 接下来写业务需求
            });
         },
         selectMat() {
            let that = this