| | |
| | | <view class="form-item"> |
| | | <view class="title"><text>*</text>条码:</view> |
| | | <view class="right" style="width: 380rpx;"> |
| | | <input 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%;" |
| | |
| | | |
| | | <view style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view> |
| | | |
| | | <view class="list" v-for="(item,index) in listData" :key="index" @tap="toSon(item)"> |
| | | <uni-card :title="item.物料代码" :extra="'No. ' + Number(index+1)" style="margin: 10px;"> |
| | | <view class="list" v-for="(item,index) in listData" :key="item['行号']" @tap="toSon(item)"> |
| | | <uni-card :title="item.物料代码" :extra="'行号: ' + item['行号']" style="margin: 10px;"> |
| | | <view class="card-detail"> |
| | | <view class="detail"> |
| | | <text>物料名称:</text>{{item.物料名称}} |
| | |
| | | <view class="detail"> |
| | | <text>订单数量:</text>{{item.数量}} |
| | | </view> |
| | | <!-- <view class="detail"> |
| | | <text>行号:</text>{{item.行号}} |
| | | </view> --> |
| | | </view> |
| | | |
| | | </uni-card> |
| | |
| | | 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() { |
| | | uni.scanCode({ |
| | | onlyFromCamera: true, |
| | | success: (res) => { |
| | | console.log('条码内容:' + res.result); |
| | | this.HBarCode = res.result |
| | | |
| | | this.getCode(this.HBarCode) |
| | | } |
| | | }); |
| | | var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module") |
| | | mpaasScanModule.mpaasScan({ |
| | | 'hideAlbum': true, |
| | | 'timeoutInterval':'10', //超时时间 |
| | | 'timeoutText':'未识别到二维码' //超时提醒 |
| | | },(ret) => { |
| | | console.log(ret.resp_result) |
| | | this.HBarCode = ret.resp_result |
| | | this.getCode(this.HBarCode) |
| | | }) |
| | | }, |
| | | //扫条码处理 |
| | | getCode(HBarCode) { |
| | |
| | | }, |
| | | (res) => { |
| | | console.log('采购订单: ', res) |
| | | let {data, count} = res.data |
| | | if(count > 0){ |
| | | let {data, count, Message} = res.data |
| | | if(count == 1 && Array.from(data).length> 0){ |
| | | CommonUtils.playSound(1) |
| | | this.baseInfo = { |
| | | HBillNo: data[0].单据号, |
| | | HSupName: data[0].供应商, |
| | | HDeptName: data[0].部门, |
| | | HBillNo: data[0]['单据号'], |
| | | HSupName: data[0]['供应商'], |
| | | HDeptName: data[0]['部门'], |
| | | HInterID: data[0].hmainid, |
| | | } |
| | | this.listData = data |
| | | } else { |
| | | CommonUtils.playSound(0) |
| | | this.refeshBarcodeState() |
| | | uni.showToast({ |
| | | title: res.data.Message, |
| | | 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&billNo=${item['单据号']}&lineNo=${item['行号']}` |
| | | }) |
| | | } |
| | | } |