| | |
| | | <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)"> |
| | | <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} = 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].供应商, |
| | |
| | | } |
| | | 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&linterid=${this.baseInfo.HInterID}&hmaterid=${item["HMaterID"]}&lineNo=${lineNo}` |
| | | }) |
| | | } |
| | | } |