| | |
| | | <view class="form-item"> |
| | | <view class="title"><text>*</text>条码:</view> |
| | | <view class="right" style="width: 380rpx;"> |
| | | <input auto-focus v-model="HBarCode" placeholder="请扫描(或输入)条码" @focus="HBarCode = ''" @blur="getCode(HBarCode)" @confirm="getCode(HBarCode)" /> |
| | | <input :focus="HBarCodeFocus" v-model="HBarCode" placeholder="请扫描(或输入)条码" @confirm="getCode(HBarCode)" /> |
| | | </view> |
| | | <uni-icons type="scan" |
| | | style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;" |
| | |
| | | |
| | | <view style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view> |
| | | |
| | | <view class="list" v-for="(item,index) in listData" :key="index" @tap="toSon(item)"> |
| | | <view class="list" v-for="(item,index) in listData" :key="index" @tap="toSon(item, index+1)"> |
| | | <uni-card :title="item.物料代码" :extra="'No. ' + Number(index+1)" style="margin: 10px;"> |
| | | <view class="card-detail"> |
| | | <view class="detail"> |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | HBarCodeFocus: true, |
| | | userInfo: getUserInfo(), |
| | | serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API', |
| | | HBarCode: '', |
| | |
| | | listData: [], |
| | | } |
| | | }, |
| | | onLoad() {}, |
| | | onLoad() { |
| | | this.HBarCodeFocus = true |
| | | }, |
| | | methods: { |
| | | //扫码 |
| | | toScanCode() { |
| | |
| | | (res) => { |
| | | console.log('采购订单: ', res) |
| | | let {data, count, Message} = res.data |
| | | if(count == 0 && data.count > 0){ |
| | | if(count == 1 && Array.from(data).length> 0){ |
| | | CommonUtils.playSound(1) |
| | | this.baseInfo = { |
| | | HBillNo: data[0].单据号, |
| | |
| | | this.listData = data |
| | | } else { |
| | | CommonUtils.playSound(0) |
| | | this.refeshBarcodeState() |
| | | uni.showToast({ |
| | | title: "此条码无返回值...", |
| | | icon: 'none' |
| | |
| | | } |
| | | }, |
| | | (err) => { |
| | | this.refeshBarcodeState() |
| | | CommonUtils.playSound(0) |
| | | } |
| | | ) |
| | | |
| | | } |
| | | }, |
| | | toSon(item) { |
| | | async refeshBarcodeState(){ |
| | | this.HBarCodeFocus = false |
| | | |
| | | await this.$nextTick(() => { |
| | | this.HBarCode = "" |
| | | this.HBarCodeFocus = true |
| | | }) |
| | | }, |
| | | toSon(item, lineNo) { |
| | | uni.navigateTo({ |
| | | url: `./generate?OperationType=1&closeType=1&linterid=${this.baseInfo.HInterID}&hmaterid=${item["HMaterID"]}` |
| | | url: `./generate?OperationType=1&closeType=1&linterid=${this.baseInfo.HInterID}&hmaterid=${item["HMaterID"]}&lineNo=${lineNo}` |
| | | }) |
| | | } |
| | | } |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | lineNo: 0, |
| | | printInfo: "", |
| | | userInfo: getUserInfo(), |
| | | serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API', |
| | |
| | | baseInfo: { |
| | | HBillNo: '', |
| | | HMainID: '', |
| | | HSupName: '', |
| | | HSubID: '', |
| | | HOrderBillNo: '', |
| | | HMaterID: '', |
| | |
| | | HMinQty: '', |
| | | HBQty: '', |
| | | HSupID: '', |
| | | HBatchNo: '', |
| | | HDate: '', |
| | | }, |
| | | sWhere: '', |
| | | listData: [], |
| | |
| | | labelPrinterComponentVue |
| | | }, |
| | | onLoad(e) { |
| | | console.log(e) |
| | | console.log("页面传递参数: ",e) |
| | | this.OperationType = e.OperationType |
| | | this.linterid = e.linterid |
| | | this.hmaterid = e.hmaterid |
| | | this.lineNo = e.lineNo |
| | | this.getData() |
| | | }, |
| | | methods: { |
| | |
| | | HMaterModel: data[0]['规格型号'], |
| | | HQty: data[0]['数量'], |
| | | HMTONo: data[0]['计划跟踪号'], |
| | | HSupID: data[0]['HSupID'] |
| | | HSupID: data[0]['HSupID'], |
| | | HBatchNo: data[0]['批号'], |
| | | HSupName: data[0]['供应商'], |
| | | HBatchNo: data[0]['批号'], |
| | | HDate: data[0]['日期'], |
| | | } |
| | | this.listData = data |
| | | } else { |
| | |
| | | B QR 500 30 M 2 U 3 |
| | | LA,${listOne['条码编号']} |
| | | ENDQR |
| | | T 24 0 30 30 供应商: ${listOne['供应商']} |
| | | T 24 0 30 80 供应商料号: |
| | | T 24 0 30 130 物料编码: ${listOne['物料代码']} |
| | | T 24 0 30 180 物料分组: ${listOne['托号']} |
| | | T 24 0 300 180 规格型号: ${listOne['规格型号']} |
| | | T 24 0 30 230 数量: ${listOne['数量']} |
| | | T 24 0 300 230 日期: ${listOne['日期'].split(" ")[0]} |
| | | T 24 0 30 280 检验员: |
| | | T 24 0 300 280 计划跟踪号: ${listOne['计划跟踪号']} |
| | | T 24 0 30 330 检验结果: |
| | | T 24 0 10 30 供应商: ${this.baseInfo.HSupName} |
| | | T 24 0 10 55 (eng) |
| | | T 24 0 10 80 供应商料号: ${this.baseInfo.HMaterNumber} |
| | | T 24 0 10 105 (eng) |
| | | T 24 0 10 130 物料名称: ${this.baseInfo.HMaterName} |
| | | T 24 0 5 155 (eng) |
| | | T 24 0 5 180 分组: ${this.baseInfo.HBatchNo} |
| | | T 24 0 5 205 (eng) |
| | | T 24 0 300 180 规格: ${this.baseInfo.HMaterModel} |
| | | T 24 0 300 205 (eng) |
| | | T 24 0 10 230 数量: ${this.baseInfo.HQty} (${this.baseInfo.HPcsName}) |
| | | T 24 0 5 255 (eng) |
| | | T 24 0 300 230 日期: ${this.baseInfo.HDate} |
| | | T 24 0 300 255 (eng) |
| | | T 24 0 5 280 检验员: |
| | | T 24 0 5 305 (eng) |
| | | T 24 0 300 280 采购单号: ${this.baseInfo.HBillNo || ''} |
| | | T 24 0 300 305 (eng) |
| | | T 24 0 5 330 检验结果: |
| | | T 24 0 5 355 (eng) |
| | | BOX 260 330 280 350 4 |
| | | T 24 0 290 330 合格 |
| | | T 24 0 290 355 (eng) |
| | | BOX 360 330 380 350 4 |
| | | T 24 0 390 330 不合格 |
| | | T 24 0 390 355 (eng) |
| | | BOX 480 330 500 350 4 |
| | | T 24 0 510 330 特采 |
| | | T 24 0 510 355 (eng) |
| | | FORM |
| | | PRINT`) |
| | | count++; |
| | |
| | | //获取选择的工厂代码 |
| | | var CampanyName = "xxx"; |
| | | //获取选择的源单类型 |
| | | var HSourceBillType = "收料通知单"; |
| | | var HSourceBillType = "采购订单"; |
| | | //获取选择的条码类型 |
| | | var HSelectBarCodeType = "唯一条码"; |
| | | var HSelectBarCodeType = "品种条码"; |
| | | //获取当前登录人员 |
| | | var UserName = uni.getStorageSync('HUserName'); |
| | | var sMainSub = sMainStr + ';' + HOrgType + ';' + HSourceBillType + ';' + HSelectBarCodeType + ';' + |
| | |
| | | <view class="form-item"> |
| | | <view class="title"><text>*</text>条码:</view> |
| | | <view class="right" style="width: 380rpx;"> |
| | | <input auto-focus v-model="HBarCode" placeholder="请扫描(或输入)条码" @confirm="getCode(HBarCode)"/> |
| | | <input :focus="HBarCodeFocus" v-model="HBarCode" placeholder="请扫描(或输入)条码" @confirm="getCode(HBarCode)"/> |
| | | </view> |
| | | <uni-icons type="scan" style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;" size="20" @click="toScanCode"></uni-icons> |
| | | </view> |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | HBarCodeFocus: false, |
| | | |
| | | userInfo:getUserInfo(), |
| | | serverUrl: uni.getStorageSync('serverUrl')||'http://47.96.97.237/API', |
| | | HBarCode:'', |
| | |
| | | listData:[], |
| | | } |
| | | }, |
| | | onLoad() {}, |
| | | onLoad() { |
| | | this.HBarCodeFocus = true |
| | | }, |
| | | methods: { |
| | | playSound(e){ |
| | | async refreshBarCodeState() { |
| | | this.HBarCodeFocus = false |
| | | await this.$nextTick(() => { |
| | | this.HBarCodeFocus = true |
| | | this.HBarCode = "" |
| | | }) |
| | | }, |
| | | playSound(e){ |
| | | const innerAudioContext = uni.createInnerAudioContext(); |
| | | if(e == 1){ |
| | | innerAudioContext.src = '/static/success.wav'; |
| | |
| | | //扫条码处理 |
| | | getCode(HBarCode){ |
| | | if(!HBarCode){ |
| | | this.playSound(0) |
| | | this.refreshBarCodeState() |
| | | uni.showToast({ |
| | | title:'条码不能为空', |
| | | icon:'none' |
| | |
| | | this.listData = data |
| | | }else{ |
| | | this.playSound(0) |
| | | this.refreshBarCodeState() |
| | | uni.showToast({ |
| | | title:res.data.Message, |
| | | icon:'none' |
| | |
| | | }, |
| | | fail: (res) => { |
| | | this.playSound(0) |
| | | this.refreshBarCodeState() |
| | | console.log(res); |
| | | uni.showToast({ |
| | | title:'接口请求失败', |
| | |
| | | <view class="item"> |
| | | <view class="left">条码编号:</view> |
| | | <view class="right barcode"> |
| | | <input auto-focus name="HBarCode" v-model="lailiaoInfo.barCodeNo" @focus="lailiaoInfo.barCodeNo = ''" @blur="barCodeEntryHandler(lailiaoInfo.barCodeNo)" |
| | | <input :focus="HBarCodeFocus" name="HBarCode" v-model="lailiaoInfo.barCodeNo" |
| | | @focus="lailiaoInfo.barCodeNo = ''" @confirm="barCodeEntryHandler(lailiaoInfo.barCodeNo)" |
| | | placeholder="请扫描商品条码" /> |
| | | </view> |
| | | <view> |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | HBarCodeFocus: false, |
| | | |
| | | printInfo: "", |
| | | userInfo: getUserInfo(), |
| | | buttonStatus: { |
| | |
| | | components: { |
| | | labelPrinterComponentVue |
| | | }, |
| | | onLoad() { |
| | | this.HBarCodeFocus = true |
| | | }, |
| | | methods: { |
| | | async refreshBarcodeState() { |
| | | this.HBarCodeFocus = false |
| | | await this.$nextTick(() => { |
| | | this.HBarCodeFocus = true |
| | | this.lailiaoInfo.barCodeNo = "" |
| | | }) |
| | | }, |
| | | async print() { |
| | | if (this.$printer.isConnected() === false) { |
| | | this.$refs.labelPrinter.openPopup() |
| | |
| | | // await this.$nextTick(() => { |
| | | // this.$refs.labelPrinter.execPrint() |
| | | // }) |
| | | // T 24 0 300 280 计划跟踪号: ${this.lailiaoInfo.HMTONo || ''} |
| | | // T 24 0 300 280 计划跟踪号: ${this.lailiaoInfo.HMTONo || ''} |
| | | this.printInfo = `! 0 200 200 400 1 |
| | | PAGE-WIDTH 608 |
| | | SETQRVER 3 |
| | |
| | | icon: 'none', |
| | | title: '查询的单据号不存在...' |
| | | }) |
| | | |
| | | |
| | | } |
| | | let d = data[row - 1] |
| | | console.log('条码接收数据: ',d) |
| | | console.log('条码接收数据: ', d) |
| | | this.lailiaoInfo = Object.assign(this.lailiaoInfo, { |
| | | HMaterNumber: d['物料编码'], |
| | | HMaterName: d['物料名称'], |
| | |
| | | btn2: false |
| | | } |
| | | }, |
| | | barCodeEntryHandler(barCode){ |
| | | barCodeEntryHandler(barCode) { |
| | | if (CommonUtils.isEmpty(barCode) === false) { |
| | | console.log('条码内容:' + barCode); |
| | | this.lailiaoInfo.barCodeNo = barCode; |
| | | if (barCode.includes("@") === false) { |
| | | this.buttonStatus.btn2 = false |
| | | CommonUtils.playSound(0) |
| | | this.refreshBarcodeState() |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | | title: '条码格式错误,请重新扫描...' |
| | |
| | | count |
| | | } = res.data |
| | | if (count > 0) { |
| | | |
| | | |
| | | this.setLailiaoInfo(data, Row) |
| | | |
| | | }else { |
| | | |
| | | } else { |
| | | CommonUtils.playSound(0) |
| | | this.refreshBarcodeState() |
| | | } |
| | | }, |
| | | (error) => { |
| | | CommonUtils.playSound(0) |
| | | this.refreshBarcodeState() |
| | | this.buttonStatus.btn2 = false |
| | | } |
| | | ) |
| | | |
| | | |
| | | } |
| | | }, |
| | | toScanCode() { |
| | | toScanCode() { |
| | | uni.scanCode({ |
| | | onlyFromCamera: true, |
| | | success: (res) => { |
| | |
| | | }); |
| | | }, |
| | | GenereateBarCode() { |
| | | let HBarCodeNoStr = `${this.lailiaoInfo.HBillNo}@${this.lailiaoInfo.HBillLineNo}@${this.lailiaoInfo.HMaterNumber}@${this.lailiaoInfo.HMTONo}@${this.lailiaoInfo.HQty}@${this.lailiaoInfo.HSupID}` |
| | | let HBarCodeNoStr = |
| | | `${this.lailiaoInfo.HBillNo}@${this.lailiaoInfo.HBillLineNo}@${this.lailiaoInfo.HMaterNumber}@${this.lailiaoInfo.HMTONo}@${this.lailiaoInfo.HQty}@${this.lailiaoInfo.HSupID}` |
| | | let sMain = [] |
| | | sMain[0] = this.lailiaoInfo |
| | | let sMainStr = JSON.stringify(sMain); |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | .barcode { |
| | | background-color: #fff !important; |
| | | } |
| | |
| | | <view class="form-item"> |
| | | <view class="title">条码:</view> |
| | | <view class="right" style="width: 380rpx;"> |
| | | <input v-model="hform.HBarCode" placeholder="请扫描(或输入)条码" @confirm="getCode(hform.HBarCode)" /> |
| | | <input :focus="barCodeFocus" v-model="hform.HBarCode" placeholder="请扫描(或输入)条码" |
| | | @confirm="getCode(hform.HBarCode)" /> |
| | | </view> |
| | | <view class="icon-wrapper"> |
| | | <uni-icons type="scan" size="20" @click="toScanCode"></uni-icons> |
| | |
| | | <view class="right" v-show="showHSourceBillNo"> |
| | | <!-- <uni-combox v-if="reHSourceBillNo" :candidates="arrayHSourceBillNo" placeholder="请输入源单单号" |
| | | v-model="hform.HSourceBillNo" @input="HSourceBillNoChange"></uni-combox> --> |
| | | <input type="text" name="HSourceBillNo" v-model="hform.HSourceBillNo" placeholder="请输入源单单号" /> |
| | | <input :focus="HSourcebillNoFocus" type="text" @confirm="onHSourceBillNoConfirmHandler" name="HSourceBillNo" |
| | | v-model="hform.HSourceBillNo" placeholder="请输入源单单号" /> |
| | | |
| | | </view> |
| | | <view class="icon-wrapper" v-show="showHSourceBillNo" :disabled="hform.HMainSourceBillType === -1"> |
| | |
| | | import { |
| | | getUserInfo |
| | | } from "@/utils/auth.js"; |
| | | import elemIterator from '../../utils/elemIterator'; |
| | | import BillListPopupVue from '../../components/BillListPopup/BillListPopup.vue'; |
| | | export default { |
| | | data() { |
| | | return { |
| | | |
| | | userInfo: getUserInfo(), |
| | | serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API', |
| | | HModName: 'Kf_MoveStockBill_PDA', |
| | | ModRightName: 'CE_MoveStock', |
| | | OperationType: 1, |
| | | HInterID_Temp: '', |
| | | |
| | | |
| | | HSCIsStockMgr: false, |
| | | HIsStockMgr: false, |
| | | showHStockPlaceName: true, |
| | |
| | | showHSourceBillNo: true, |
| | | reHSourceBillNo: true, |
| | | showHSupName: true, |
| | | barCodeFocus: false, |
| | | HSourcebillNoFocus: false, |
| | | |
| | | HStockStyleArray: ["组织内调拨", "跨组织调拨"], |
| | | |
| | |
| | | HQty: '', |
| | | HSCWHName: getUserInfo().HWHName, |
| | | HSCWHID: getUserInfo().HWhID, |
| | | HWHName: getUserInfo().HWHName, |
| | | HWHID: getUserInfo().HWhID, |
| | | HWHName: "", |
| | | HWHID: "", |
| | | HStockStyle: '组织内调拨', |
| | | HOutStockPlaceName: getUserInfo().HSPName, |
| | | HOutStockPlaceName: getUserInfo().HSPName, |
| | | HOutStockPlaceID: getUserInfo().HSPID, |
| | | HStockPlaceName: getUserInfo().HSPName, |
| | | HStockPlaceID: getUserInfo().HSPID, |
| | | HTransferDirect: '', //调拨方向 |
| | | HShipType: '', // 出库类型 |
| | | |
| | | HMainSourceBillType: 3720, |
| | | HMainSourceBillType: 1402, |
| | | HSourceBillNo: '', //CGDD000200 |
| | | HFIFOWHName: '', |
| | | HFIFOWHID: '', |
| | |
| | | if (e.HInterID) { |
| | | this.HInterID_Temp = e.HInterID |
| | | // this.btnType = 1 |
| | | this.barCodeFocus = true |
| | | this.RoadBillMain(e.HInterID) |
| | | } else { |
| | | this.HSourcebillNoFocus = true |
| | | this.getNewData() |
| | | } |
| | | this.getHBaseList() |
| | |
| | | } |
| | | } |
| | | ) |
| | | }, |
| | | onHSourceBillNoConfirmHandler() { |
| | | if (this.hform.HMainSourceBillType == -1) { |
| | | // 手工录入不进行提交 |
| | | this.playSound(1) |
| | | return |
| | | } |
| | | |
| | | this.getHBarCodeData(this.hform.HSourceBillNo) |
| | | }, |
| | | playSound(e) { |
| | | const innerAudioContext = uni.createInnerAudioContext(); |
| | |
| | | this.hform.HFIFOWHID = 0 |
| | | } |
| | | uni.request({ |
| | | url: this.serverUrl + '/WEBSController/get_SourceBarCode_MateOut_Json', |
| | | url: this.serverUrl + '/WEBSController/get_SourceBarCode_MoveStock_Json', |
| | | data: { |
| | | HInterID: this.hform.HInterID, |
| | | HBillNo: this.hform.HBillNo, |
| | |
| | | HSourceBillNo: HBarCode, |
| | | HSourceBillType: this.hform.HMainSourceBillType, |
| | | HMaker: this.hform.HMaker, |
| | | HStockOrgID: this.hform.HStockOrgID, |
| | | HFIFOWHID: this.hform.HFIFOWHID, |
| | | HPTQty: this.hform.HPTQty || 0, |
| | | HPlanMode: this.hform.HPlanMode || 0 |
| | | HOWNERID: this.hform.HStockOrgID, |
| | | HFIFOWhID: this.hform.HFIFOWHID, |
| | | // HPTQty: this.hform.HPTQty || 0, |
| | | // HPlanMode: this.hform.HPlanMode || 0 |
| | | }, |
| | | success: (res) => { |
| | | if (res.data.count == 1) { |
| | |
| | | } |
| | | this.tabs = 2 |
| | | this.showHSupName = false |
| | | this.barCodeFocus = true |
| | | this.playSound(1) |
| | | this.DisBillEntryList() |
| | | } else { |
| | | this.playSound(0) |
| | | console.log('res: ',res); |
| | | |
| | | uni.showToast({ |
| | | title: res.data.Message, |
| | | icon: 'none' |
| | | }) |
| | | this.HSourcebillNoFocus = false |
| | | this.$nextTick(() => { |
| | | this.hform.HSourceBillNo = "" |
| | | this.HSourcebillNoFocus = true |
| | | }) |
| | | } |
| | | }, |
| | | fail: (res) => { |
| | | console.log(res); |
| | | fail: (err) => { |
| | | console.log('err: ',err); |
| | | this.playSound(0) |
| | | uni.showToast({ |
| | | title: '接口请求失败', |
| | | icon: 'none' |
| | | }) |
| | | this.HSourcebillNoFocus = false |
| | | this.$nextTick(() => { |
| | | this.hform.HSourceBillNo = "" |
| | | this.HSourcebillNoFocus = true |
| | | }) |
| | | }, |
| | | }); |
| | |
| | | this.DisBillEntryList() |
| | | } else { |
| | | this.playSound(0) |
| | | |
| | | uni.showToast({ |
| | | title: res.data.Message, |
| | | icon: 'none' |
| | | }) |
| | | this.barCodeFocus = false |
| | | this.$nextTick(() => { |
| | | this.barCodeFocus = true |
| | | this.hform.HBarCode = "" |
| | | }) |
| | | } |
| | | }, |
| | | fail: (res) => { |
| | | this.playSound(0) |
| | | this.barCodeFocus = true |
| | | console.log(res); |
| | | uni.showToast({ |
| | | title: '接口请求失败', |
| | | icon: 'none' |
| | | }) |
| | | this.barCodeFocus = false |
| | | this.$nextTick(() => { |
| | | this.barCodeFocus = true |
| | | this.hform.HBarCode = "" |
| | | }) |
| | | }, |
| | | }); |
| | |
| | | title: res.data.Message, |
| | | icon: 'none' |
| | | }) |
| | | this.barCodeFocus = false |
| | | this.$nextTick(() => { |
| | | this.barCodeFocus = true |
| | | this.hform.HBarCode = "" |
| | | }) |
| | | } |
| | | }, |
| | | fail: (res) => { |
| | | this.playSound(0) |
| | | this.barCodeFocus = true |
| | | console.log(res); |
| | | uni.showToast({ |
| | | title: '接口请求失败', |
| | | icon: 'none' |
| | | }) |
| | | this.barCodeFocus = false |
| | | this.$nextTick(() => { |
| | | this.barCodeFocus = true |
| | | this.hform.HBarCode = "" |
| | | }) |
| | | }, |
| | | }); |
| | |
| | | } |
| | | } |
| | | }, |
| | | |
| | | |
| | | goBack() { |
| | | uni.showModal({ |
| | | title: '提示', |
| New file |
| | |
| | | import { CommonUtils } from "./common" |
| | | |
| | | export default class elemIterator{ |
| | | current = 0 |
| | | elemArray = [] |
| | | constructor(current, elemArray){ |
| | | if(CommonUtils.isAllDigits(current) == false) { |
| | | current = 0 |
| | | } |
| | | |
| | | if(Array.isArray(elemArray) == false){ |
| | | elemArray = [] |
| | | } |
| | | |
| | | this.current = Number(current) |
| | | this.elemArray = elemArray |
| | | } |
| | | |
| | | setElemArray(elemArray) { |
| | | if(Array.isArray(elemArray) == false){ |
| | | throw new TypeError() |
| | | } |
| | | this.elemArray = elemArray |
| | | } |
| | | |
| | | setElemArrayArgs(...args) { |
| | | this.elemArray = args |
| | | } |
| | | |
| | | moveNext(){ |
| | | this.current++ |
| | | if(this.current == this.elemArray.length){ |
| | | this.current = 0 |
| | | } |
| | | } |
| | | |
| | | getCurrentElem(){ |
| | | return this.elemArray[this.current] |
| | | } |
| | | |
| | | exec(callback){ |
| | | if(Object.prototype.toString.call(callback) !== '[object Function]'){ |
| | | throw new TypeError() |
| | | } |
| | | |
| | | callback.call(null, this.elemArray[this.current]) |
| | | } |
| | | } |
| | | |