|  |  |  | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script> | 
|---|
|  |  |  | import {setCurrentDeviceAction} from '../../static/js/PresetsPda.js' | 
|---|
|  |  |  | import {initScan,startScan,stopScan} from '../../static/js/scanModule.js' | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | data() { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 搜索物料 | 
|---|
|  |  |  | 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 | 
|---|