123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364 |
- <!-- 每日盘点扫描 -->
- <template>
- <view class="container-wrap">
- <uni-nav-bar :title="isReading ? '扫描中' : '扫描结果'" :status-bar="true" background-color="#3F92F9" color="#FFF">
- <view slot="left">
- <u-icon name="account-fill" color="#FFF" size="35"></u-icon>
- <span style="padding: 0 5rpx;color: #FFFFFF;">{{ userInfo.name }}</span>
- </view>
- <view slot="right" @tap="$utils.back()">
- <span style="color: #FFFFFF;">返回</span>
- </view>
- </uni-nav-bar>
- <view class="container">
- <!-- 扫描到RFID标签时,打开质检结果 -->
- <view v-if="!isReading" class="info">
- <view class="row flex-start">
- <view class="col">
- <view class="label">
- 物料类型:
- </view>
- <view class="value">
- {{ data.materialType }}
- </view>
- </view>
- <view class="col">
- <view class="label">
- 标签编码:
- </view>
- <view class="value">
- {{ data.materialCode }}
- </view>
- </view>
- </view>
- <view class="row flex-start">
- <view class="col">
- <view class="label">
- 物料名称:
- </view>
- <view class="value">
- {{ data.materialName }}
- </view>
- </view>
- </view>
- <view class="row flex-start">
- <view class="col">
- <view class="label">
- 所在仓库:
- </view>
- <view class="value">
- {{ data.saveHouse }}
- </view>
- </view>
- <view class="col">
- <view class="label">
- 放置区域:
- </view>
- <view class="value">
- {{ data.stockArea }}
- </view>
- </view>
- </view>
- <view class="row flex-start">
- <view class="col">
- <view class="label">
- 库存件数:
- </view>
- <view class="value">
- {{ data.tagNum }}
- </view>
- </view>
- <view class="col">
- <view class="label">
- 库存数量:
- </view>
- <view class="value">
- {{ data.quantity }}
- </view>
- </view>
- </view>
- </view>
- <!-- 扫描rfid -->
- <view class="reading">
- <u-image height="200rpx" mode="aspectFit" src="../../../static/images/rfid.png"></u-image>
- <view class="title" v-if="isReading">扫描中...</view>
- <view class="title" v-if="!isReading">批量扫描中...</view>
- </view>
- <!-- 扫描列表 -->
- <view class="info bottom-list" style="background-color: #FFFFFF;" v-if="scanResult.rfidItems">
- <view class="row" v-for="(item, index) in scanResult.rfidItems" :key="index">
- <view class="col" style="flex: 3;overflow: hidden;">
- <view class="label" style="width: 120rpx;">标签值:</view>
- <view class="value">{{ item.rfidCode }}</view>
- </view>
- <view class="col" style="flex: 1;">
- <view class="label">物料数量:</view>
- <view class="value">{{ item.quantity }}</view>
- </view>
- </view>
- </view>
- <view class="info bottom-total">
- <view class="row">
- <view class="col">
- <view class="label">盘点件数:</view>
- <view class="value">{{ scanResult.tagNum }}</view>
- </view>
- <view class="col">
- <view class="label">盘点数量:</view>
- <view class="value">{{ scanResult.quantity }}</view>
- </view>
- </view>
- </view>
- </view>
- <view class="btn">
- <my-fixed-button :customClick="true" @click="show = true" text="结束扫描"></my-fixed-button>
- <!-- 选择物流 -->
- <my-dialog :showDialog="show" :btnStyle="btnStyle" :title="data.materialName" @cancelClick="cancel"
- @cfmClick="over">
- <view slot="content" style="width: 100%;padding: 0 40rpx;">
- <u-form label-width="130rpx">
- <u-form-item class="remark-label" label="库存数量:" :border-bottom="false">
- <view class="row" style="justify-content: space-between;width: 100%;">
- <view>{{ data.quantity }}</view>
- <view style="font-size: 38rpx;">扫描数量:{{ data.checkQuantity }}</view>
- </view>
- </u-form-item>
- <u-form-item class="remark-label" label="盘点数量:" :border-bottom="false">
- <view class="row">
- <u-input v-model="handQty" :border="true" @focus="qtyFocus" @blur="qtyBlur"/>
- <view
- style="width: 120rpx;padding: 0 10rpx;color: #007AFF;"
- :style="{ color: (data.quantity == handQty ? '#007AFF' : '#FA3534') }"
- >
- {{ data.quantity == handQty ? '一致' : '不一致' }}
- </view>
- </view>
- </u-form-item>
- <u-form-item class="remark-label" label="库存卷数:" :border-bottom="false">
- <view class="row" style="justify-content: space-between;width: 100%;">
- <view>{{ data.tagNum }}</view>
- <view style="font-size: 38rpx;">扫描件数:{{ data.checkTagNum }}</view>
- </view>
- </u-form-item>
- <u-form-item class="remark-label" label="盘点卷数:" :border-bottom="false">
- <view class="row">
- <u-input v-model="handTagQty" :border="true" @focus="tagFocus" @blur="tagBlur" />
- <view
- style="width: 120rpx;padding: 0 10rpx;color: #007AFF;"
- :style="{ color: (data.tagNum == handTagQty ? '#007AFF' : '#FA3534') }"
- >
- {{ data.tagNum == handTagQty ? '一致' : '不一致' }}
- </view>
- </view>
- </u-form-item>
- </u-form>
- </view>
- </my-dialog>
- </view>
- </view>
- </template>
- <script>
- const uhf = uni.requireNativePlugin('js-uhf');
- export default {
- data() {
- return {
- handQty: '',
- handTagQty: '',
- btnStyle: {
- },
- show: false,
- scanResult: {},
- timer: null,
- rfidCodeList: [],
- quantity: 0,
- isReading: false,
- data: {},
- rfidCode: ''
- };
- },
- methods: {
- qtyFocus () {
- this.handQty = ''
- },
- qtyBlur() {
- !this.handQty && (this.handQty = this.data.quantity)
- },
- tagFocus () {
- this.handTagQty = ''
- },
- tagBlur() {
- !this.handTagQty && (this.handTagQty = this.data.tagNum)
- },
- cancel () {
- this.handQty = ''
- this.handTagQty = ''
- this.show = false
- },
- showModal () {
- this.show = true
- },
- over() {
- if(!this.handTagQty) {
- return this.$msg.showToast('请输入卷数!')
- }
- this.$http.CompleteEveryDayBatchCheck({
- materialCode: this.data.materialCode,
- stockHouseId: this.data.stockHouseId,
- rfidItems: this.rfidCodeList,
- handTagQty: this.handTagQty,
- handQty: this.handQty
- }).then(res => {
- console.log(res)
- if(res.code === 0) {
- this.cancel()
- this.$utils.back()
- uni.$emit('getlist')
- }
- })
- },
- back() {
- this.$utils.back()
- },
- bind() {
- this.$http.RfidCompleteCheck({
- rfidCode: this.rfidCode,
- quantity: this.quantity,
- type: 2
- }).then(res => {
- if(res.code === 0) {
- this.$msg.showToast(res.msg || '操作成功!')
- uni.$emit('getlist')
- this.isReading = true
- this.scanRfid()
- } else {
- this.isReading = true
- this.scanRfid()
- }
- })
- },
- /* 退货申请 */
- returnOrder() {
- this.$utils.open('/pages/store-out-manage/return-apply/return-apply')
- },
- /* rfid获取绑定物料信息 */
- getList() {
- this.$http.ScanRfidCodeStockTag({
- rfidCode: this.rfidCode,
- checkRfidType: 1
- }).then(res => {
- console.log(res)
- if(res.code === 0) {
- this.isReading = false
- this.data = res.result
- // this.quantity = this.data.quantity
- this.handQty = this.data.quantity
- this.handTagQty = this.data.tagNum
- } else {
- this.isReading = true
- setTimeout(() => {
- this.scanRfid()
- }, 1000)
- }
- })
- },
- handleList (list) {
- list.forEach(item => {
- if (this.rfidCodeList.indexOf(item.epc) == -1) {
- this.rfidCodeList.push(item.epc)
- }
- })
- },
- scanRfid () {
- uhf.starts({}, res => {
- // console.log(res)
- if(res.data[0]) {
- if(this.rfidCodeList.length === 0) {
- this.rfidCodeList.push(res.data[0].epc)
- } else {
- this.handleList(res.data)
- }
- }
- })
- this.timer = setInterval(() => {
- this.$http.GetEveryDayCheckRfid({
- materialCode: this.data.materialCode,
- stockHouseId: this.data.stockHouseId,
- rfidItems: this.rfidCodeList,
- isUnShowLoading: true
- }).then(res => {
- // console.log(res)
- if(res.code === 0) {
- this.scanResult = res.result
- }
- })
- }, 1000)
- }
- },
- onLoad(option) {
- this.data = JSON.parse(option.data)
- this.handQty = this.data.quantity
- this.handTagQty = this.data.tagNum
- this.scanRfid()
- },
- onUnload() {
- this.$pda.uhfStops()
- clearInterval(this.timer)
- }
- }
- </script>
- <style lang="scss" scoped>
- .container-wrap {
- overflow: hidden;
- .container {
- padding: 0 10rpx;
- height: calc(100vh - var(--status-bar-height) - 44px);
- overflow: hidden;
- display: flex;
- flex-direction: column;
- padding-bottom: 80rpx;
- .title {
- font-size: 36rpx;
- font-weight: bold;
- text-align: center;
- }
- .reading {
- padding: 40rpx 0;
- }
- .info {
- padding: 20rpx 60rpx;
- border-radius: 10rpx ;
- .row {
- align-items: flex-start;
- .label {
- font-size: 28rpx;
- width: 140rpx;
- }
- .value {
- font-size: 28rpx;
- flex: 1;
- overflow: hidden;
- word-wrap: break-word;
- }
- }
- }
- .bottom-list {
- flex: 1;
- overflow: auto;
- }
-
- .btn {
- height: 180rpx;
- .row {
- padding: 0;
- padding-bottom: 10rpx;
- width: 100%;
- &:last-child {
- padding-bottom: 0;
- }
- }
- }
- }
- }
- </style>
|