| | |
| | | <view class="item"> |
| | | <view class="left">条码编号:</view> |
| | | <view class="right"> |
| | | <input name="HBarCode" v-model="barCodeInfoMeta.barCodeNo" placeholder="请扫描设备" /> |
| | | <input name="HBarCode" disabled v-model="barCodeInfoMeta.barCodeNo" placeholder="请扫描设备" |
| | | @blur="searchbarCodeInfo" /> |
| | | </view> |
| | | <view> |
| | | <uni-icons type="scan" |
| | |
| | | </view> |
| | | <view class="operation-zone"> |
| | | <button class="btn-c" @click="searchbarCodeInfoMeta">拆码</button> |
| | | <button type="default" :class="cantGenerate?'':'btn-c'" @click="SaveBarCodeCreate" :disabled="cantGenerate">生成</button> |
| | | <button type="default" :class="cantGenerate?'':'btn-c'" @click="SaveBarCodeCreate" |
| | | :disabled="cantGenerate">生成</button> |
| | | </view> |
| | | </view> |
| | | <view class="divide"></view> |
| | |
| | | <view class="title">条码信息</view> |
| | | <uni-card> |
| | | <view class="detail"> |
| | | <text>条码编号:</text>{{barCodeInfo['HBarCode'] || ''}} |
| | | <text>条码号:</text>{{barCodeInfo['条码编号'] || ''}} |
| | | </view> |
| | | <view class="detail"> |
| | | <text>条码数量:</text>{{barCodeInfo['HQty'] || '0'}} |
| | | <text>原数量:</text>{{barCodeInfo['数量'] || '0'}} |
| | | </view> |
| | | <view class="dWetail"> |
| | | <text>物料代码:</text>{{barCodeInfo['HNumber'] || ''}} |
| | | <text>物料编码:</text>{{barCodeInfo['物料代码'] || ''}} |
| | | </view> |
| | | <view class="detail"> |
| | | <text>物料名称:</text>{{barCodeInfo['HName'] || ''}} |
| | | <text>物料名称:</text>{{barCodeInfo['物料名称'] || ''}} |
| | | </view> |
| | | <view class="detail"> |
| | | <text>规格型号:</text>{{barCodeInfo['HModel'] || ''}} |
| | | <text>规格型号:</text>{{barCodeInfo['规格型号'] || ''}} |
| | | </view> |
| | | <view class="detail"> |
| | | <text>批号:</text>{{barCodeInfo['HBatchNo'] || ''}} |
| | | <text>计量单位:</text>{{barCodeInfo['计量单位'] || ''}} |
| | | </view> |
| | | </uni-card> |
| | | </view> |
| | |
| | | <text>规格型号:</text>{{item['HModel'] || ''}} |
| | | </view> |
| | | <view class="detail"> |
| | | <text>批号:</text>{{item['HBatchNo'] || ''}} |
| | | <text>计量单位:</text>{{barCodeInfo['计量单位'] || ''}} |
| | | </view> |
| | | </uni-card> |
| | | </view> |
| | |
| | | Message |
| | | } = res1 |
| | | if (count > 0) { |
| | | console.log(data[0]) |
| | | if(data.length < 1) { |
| | | |
| | | if (data.length < 1) { |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | | title: Message |
| | | }); |
| | | } |
| | | this.barCodeInfo = data[0] |
| | | // this.barCodeInfo = data[0] |
| | | if (data[0]["HQty"] < this.barCodeInfoMeta.splitNum) { |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | |
| | | this.barCodeSplitInfo.push(Object.assign(barCodeItem, { |
| | | HSplitNum: Math.floor(data[0]["HQty"] / this.barCodeInfoMeta |
| | | .splitNum), |
| | | HBarCode: data[0]["HBarCode"] + String.fromCharCode(('A'.charCodeAt(0) + i)) |
| | | HBarCode: data[0]["HBarCode"] + String.fromCharCode(('A' |
| | | .charCodeAt(0) + i)) |
| | | })) |
| | | } |
| | | this.barCodeSplitInfo[i - 1]["HSplitNum"] += remainder |
| | |
| | | }, |
| | | function(err) { |
| | | console.error(err) |
| | | } |
| | | ) |
| | | }, |
| | | async searchbarCodeInfo() { |
| | | await this.$nextTick() |
| | | let urlEncode = |
| | | `/Gy_BarCodeBillList/page?sWhere= and 条码编号=\'\'${this.barCodeInfoMeta.barCodeNo}\'\'&user=${this.userInfo.HEmpName}&page=1&size=1` |
| | | .toString() |
| | | if (CommonUtils.isEmpty(this.barCodeInfoMeta.barCodeNo) == true) { |
| | | return uni.showToast({ |
| | | icon: "fail", |
| | | title: "条码编号不能为空!" |
| | | }) |
| | | } |
| | | this.doRequest( |
| | | urlEncode, |
| | | null, |
| | | function(res) { |
| | | console.log(res) |
| | | let res1 = res.data |
| | | let { |
| | | data, |
| | | count |
| | | } = res1 |
| | | if (count > 0) { |
| | | this.barCodeInfo = data[0] |
| | | } |
| | | }, |
| | | function(err) { |
| | | console.err(err) |
| | | } |
| | | ) |
| | | }, |
| | |
| | | title: '拆码数量和不得大于条码数量' |
| | | }); |
| | | } |
| | | let msg = `${this.barCodeInfoMeta["baoCodeNo"]};${this.barCodeInfoMeta["splitNum"]};${JSON.stringify(this.barCodeSplitInfo)};${this.userInfo["HEmpName"]}` |
| | | let msg = |
| | | `${this.barCodeInfoMeta["baoCodeNo"]};${this.barCodeInfoMeta["splitNum"]};${JSON.stringify(this.barCodeSplitInfo)};${this.userInfo["HEmpName"]}` |
| | | this.doRequest( |
| | | "/Sc_BarCode/Save_SplitBarCode", |
| | | { |
| | | "/Sc_BarCode/Save_SplitBarCode", { |
| | | msg: msg |
| | | }, |
| | | function(res) { |
| | |
| | | if (this.CommonUtils.isEmpty(res.result) === false) { |
| | | console.log('条码内容:' + res.result); |
| | | this.barCodeInfoMeta.barCodeNo = res.result |
| | | |
| | | this.doRequest( |
| | | "/Gy_SplitBarCode/Info", { |
| | | HBarCodeNo: res.result, |
| | | HSplitBarNum: 1 |
| | | }, |
| | | function(res) { |
| | | console.log(res) |
| | | this.barCodeSplitInfo = [] |
| | | let res1 = res.data |
| | | let { |
| | | data, |
| | | count |
| | | } = res1 |
| | | if (count > 0) { |
| | | console.log(data[0]) |
| | | this.barCodeInfo = data[0] |
| | | } |
| | | }, |
| | | function(err) { |
| | | console.error(err) |
| | | } |
| | | ) |
| | | |
| | | this.searchbarCodeInfo() |
| | | // this.doRequest( |
| | | // "/Gy_SplitBarCode/Info", { |
| | | // HBarCodeNo: res.result, |
| | | // HSplitBarNum: 1 |
| | | // }, |
| | | // function(res) { |
| | | // console.log(res) |
| | | // this.barCodeSplitInfo = [] |
| | | // let res1 = res.data |
| | | // let { |
| | | // data, |
| | | // count |
| | | // } = res1 |
| | | // if (count > 0) { |
| | | // console.log(data[0]) |
| | | // this.barCodeInfo = data[0] |
| | | // } |
| | | // }, |
| | | // function(err) { |
| | | // console.error(err) |
| | | // } |
| | | // ) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | onLoad() { |
| | | console.log(this.userInfo) |
| | | } |
| | | } |
| | | </script> |
| | |
| | | input { |
| | | padding: 8rpx 20rpx; |
| | | font-size: 30rpx; |
| | | line-height: 30rpx; |
| | | } |
| | | |
| | | |
| | | button { |
| | | padding: 0; |
| | | width: 150rpx; |
| | | font-size: 25rpx; |
| | | } |
| | | |
| | | |
| | | .uni-card { |
| | | margin: 0 !important; |
| | | } |
| | |
| | | |
| | | .content { |
| | | flex: 1; |
| | | |
| | | .barcode-detail, .barcode-split{ |
| | | |
| | | .barcode-detail, |
| | | .barcode-split { |
| | | padding: 30rpx; |
| | | display: flex; |
| | | flex-direction: column; |