|
|
@ -1,128 +1,167 @@ |
|
|
|
<!-- 盘点任务详情 --> |
|
|
|
<template> |
|
|
|
<page-meta root-font-size="18px" :page-style="'overflow:'+(isShowScanPopup?'hidden':'visible')"></page-meta> |
|
|
|
<view class=""> |
|
|
|
<scroll-view scroll-y="true" class="scroll-detail" :scroll-top="scrollTop" @scrolltoupper="upper" |
|
|
|
@scrolltolower="lower" @scroll="scroll"> |
|
|
|
<view class="" style="display:flex;flex-direction: column;"> |
|
|
|
<view class=""> |
|
|
|
<view class="top_card"> |
|
|
|
<com-count-scan-detail :jobContent="datacontent" :allCount="allCount" :scanCount="scanCount" |
|
|
|
:newCount="newCount" :location="location"> |
|
|
|
</com-count-scan-detail> |
|
|
|
</view> |
|
|
|
<view class="detail-list" v-for="(item, index) in details" :key="item.id"> |
|
|
|
<uni-swipe-action> |
|
|
|
<uni-swipe-action-item :right-options="options" :auto-close="false" |
|
|
|
@click="swipeClick($event,item,index)"> |
|
|
|
<view class="detail-content common_card"> |
|
|
|
<view class="choose_main"> |
|
|
|
<view class="ljh_box"> |
|
|
|
<view class="ljh_info"> |
|
|
|
<view class="tit_ljh">{{ item.itemCode }}</view> |
|
|
|
<view class="label_xm font_sm fr">{{ item.packingCode }}</view> |
|
|
|
</view> |
|
|
|
<view class="desc_card uni-flex space-between"> |
|
|
|
<view class="desc_ljh"> |
|
|
|
<view class="font_xs text_lightblue"> {{ item.itemName }}</view> |
|
|
|
<view class="font_xs text_lightblue">{{ item.itemDesc1 }} |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="" v-if="allDetails.length>0"> |
|
|
|
<z-paging ref="paging" use-virtual-list @query="queryList"> |
|
|
|
<template #top> |
|
|
|
<com-count-scan-detail :jobContent="datacontent" :allCount="allCount" :scanCount="scanCount" |
|
|
|
:newCount="newCount" :location="location"> |
|
|
|
</com-count-scan-detail> |
|
|
|
</template> |
|
|
|
|
|
|
|
<template #cell="{item,index}"> |
|
|
|
<view> |
|
|
|
<uni-swipe-action> |
|
|
|
<uni-swipe-action-item :right-options="options" :auto-close="false" |
|
|
|
@click="swipeClick($event,item,index)"> |
|
|
|
<view class="detail-content common_card"> |
|
|
|
<view class="choose_main"> |
|
|
|
<view class="ljh_box"> |
|
|
|
<view class="ljh_info"> |
|
|
|
<view class="tit_ljh">{{index+1+'.'+item.itemCode }}</view> |
|
|
|
<view class="label_xm font_sm fr">{{ item.packingCode }}</view> |
|
|
|
</view> |
|
|
|
<view class="desc_card uni-flex space-between"> |
|
|
|
<view class="desc_ljh"> |
|
|
|
<view class="font_xs text_lightblue"> {{ item.itemName }}</view> |
|
|
|
<view class="font_xs text_lightblue">{{ item.itemDesc1 }} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="list_form"> |
|
|
|
<view> |
|
|
|
<uni-table style="overflow-x: hidden;"> |
|
|
|
<uni-tr> |
|
|
|
<uni-th width="100"></uni-th> |
|
|
|
<uni-th width="100" align="center">库存</uni-th> |
|
|
|
<uni-th width="100" align="center">盘点</uni-th> |
|
|
|
</uni-tr> |
|
|
|
<uni-tr> |
|
|
|
<uni-th width="100">数量({{item.inventoryUom}})</uni-th> |
|
|
|
<uni-th width="100" align="center"> |
|
|
|
<text class="text_black">{{item.inventoryQty}}</text> |
|
|
|
</uni-th> |
|
|
|
<uni-th width="100" align="center"> |
|
|
|
<com-number-box v-if="item.scaned && item.packingCode" |
|
|
|
v-model="item.countQty" :max="99999" :min="0" |
|
|
|
@change="qtyChanged($event,item)" |
|
|
|
style='margin-right: 10px;padding: 2px;'> |
|
|
|
</com-number-box> |
|
|
|
<com-number-box v-if="item.packingCode==''" v-model="item.countQty" |
|
|
|
@change="qtyChanged($event,item)" :max="99999" :min="0" |
|
|
|
style='margin-right: 10px;padding: 2px;'> |
|
|
|
</com-number-box> |
|
|
|
<text class="text_black" |
|
|
|
v-else-if="!item.scaned">{{item.countQty}}</text> |
|
|
|
|
|
|
|
<!-- <text class="text_black" v-if="item.packingCode" |
|
|
|
style="font-size: 1rem;">{{item.countQty}}</text> |
|
|
|
<com-number-box v-else v-model="item.countQty" :max="99999" :min="0" |
|
|
|
style='margin-right: 10px;padding: 2px;'> |
|
|
|
</com-number-box> --> |
|
|
|
|
|
|
|
<!--<uni-easyinput v-model="item.countQty" type="digit" |
|
|
|
@input="qtyInput($event,item)"> |
|
|
|
</uni-easyinput> --> |
|
|
|
</uni-th> |
|
|
|
</uni-tr> |
|
|
|
</uni-table> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view style="margin:0 20rpx 20rpx;"> |
|
|
|
<view class="uni-flex uni-row bot_card"> |
|
|
|
<view class="bot_card_item"> |
|
|
|
<label class="icon_bg icon_bg_kw"> |
|
|
|
<image class="icon_normal" src="@/static/icons_ui/icon_kw.svg"> |
|
|
|
</image> |
|
|
|
</label> |
|
|
|
<text>{{ item.locationCode }}</text> |
|
|
|
</view> |
|
|
|
<view class="bot_card_item"> |
|
|
|
<label class="icon_bg icon_bg_pc"> |
|
|
|
<image class="icon_normal" src="@/static/icons_ui/icon_pc.svg"> |
|
|
|
</image> |
|
|
|
</label> |
|
|
|
<text>{{item.lot}}</text> |
|
|
|
<view class="list_form"> |
|
|
|
<view> |
|
|
|
<uni-table style="overflow-x: hidden;"> |
|
|
|
<uni-tr> |
|
|
|
<uni-th width="100"></uni-th> |
|
|
|
<uni-th width="100" align="center">库存</uni-th> |
|
|
|
<uni-th width="100" align="center">盘点</uni-th> |
|
|
|
</uni-tr> |
|
|
|
<uni-tr> |
|
|
|
<uni-th width="100">数量({{item.uom}})</uni-th> |
|
|
|
<uni-th width="100" align="center"> |
|
|
|
<text class="text_black">{{item.inventoryQty}}</text> |
|
|
|
</uni-th> |
|
|
|
<uni-th width="100" align="center"> |
|
|
|
<!-- <com-number-box v-if="item.scaned && item.packingCode" |
|
|
|
v-model="item.countQty" :max="99999" :min="0" |
|
|
|
@change="qtyChanged($event,item)" |
|
|
|
style='margin-right: 10px;padding: 2px;'> |
|
|
|
</com-number-box> |
|
|
|
<com-number-box v-if="item.packingCode==''" |
|
|
|
v-model="item.countQty" |
|
|
|
@change="qtyChanged($event,item)" :max="99999" |
|
|
|
:min="0" style='margin-right: 10px;padding: 2px;'> |
|
|
|
</com-number-box> --> |
|
|
|
<view class="flex" |
|
|
|
style="align-items: center;justify-content: center;" |
|
|
|
v-if="item.scaned && item.packingCode"> |
|
|
|
<text class="text_black">{{item.countQty}} </text> |
|
|
|
<view class="photo_btn fr" @click="openEditCount(item)"> |
|
|
|
<text class="fl font_xs">修改</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="flex" |
|
|
|
style="align-items: center;justify-content: center;" |
|
|
|
v-if="item.packingCode==''"> |
|
|
|
<text class="text_black">{{item.countQty}} </text> |
|
|
|
<view class="photo_btn fr" @click="openEditCount(item)"> |
|
|
|
<text class="fl font_xs">修改</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="" v-else-if="!item.scaned"> |
|
|
|
<text class="text_black">{{item.countQty}}</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<!-- <text class="text_black" v-if="item.packingCode" |
|
|
|
style="font-size: 1rem;">{{item.countQty}}</text> --> |
|
|
|
<!-- <com-number-box v-else v-model="item.countQty" |
|
|
|
:max="99999" :min="0" |
|
|
|
style='margin-right: 10px;padding: 2px;'> |
|
|
|
</com-number-box> --> |
|
|
|
|
|
|
|
</uni-th> |
|
|
|
</uni-tr> |
|
|
|
</uni-table> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="bot_card_item" style="width: 25%;"> |
|
|
|
<view class="uni-flex" v-if="item.isNew "> |
|
|
|
<!-- picker的index默认是0 --> |
|
|
|
<picker @change="bindPickerChange($event,item)" :value="item.status-1" |
|
|
|
:range="statusArray"> |
|
|
|
<view class="uni-flex " style="padding:5px 0px;"> |
|
|
|
<text class="state_point" |
|
|
|
:class="item.status | statusStyle">{{statusArray[item.status-1]}}</text> |
|
|
|
<image class="icon_normal" |
|
|
|
src="@/static/icons_ui/icon_down.svg"> |
|
|
|
<view style="margin:0 20rpx 20rpx;"> |
|
|
|
<view class="uni-flex uni-row bot_card"> |
|
|
|
<view class="bot_card_item"> |
|
|
|
<label class="icon_bg icon_bg_kw" style="text-align: center;"> |
|
|
|
<text |
|
|
|
style=" display: block; color: white;text-align: center;font-size: 28rpx;">库</text> |
|
|
|
<!-- <image class="icon_normal" |
|
|
|
src="@/static/icons_ui/icon_kw.svg"> --> |
|
|
|
</image> |
|
|
|
</label> |
|
|
|
<text>{{ item.locationCode }}</text> |
|
|
|
</view> |
|
|
|
<view class="bot_card_item"> |
|
|
|
<label class="icon_bg icon_bg_pc"> |
|
|
|
<text |
|
|
|
style=" display: block; color: white;text-align: center;font-size: 28rpx;">批</text> |
|
|
|
<!-- <image class="icon_normal" |
|
|
|
src="@/static/icons_ui/icon_pc.svg"> |
|
|
|
</image> --> |
|
|
|
</label> |
|
|
|
<text>{{item.lot}}</text> |
|
|
|
</view> |
|
|
|
<view class="bot_card_item" style="width: 25%;"> |
|
|
|
<view class="uni-flex" v-if="item.isNew "> |
|
|
|
<!-- picker的index默认是0 --> |
|
|
|
<picker @change="bindPickerChange($event,item)" |
|
|
|
:value="item.status-1" :range="statusArray"> |
|
|
|
<view class="uni-flex " style="padding:5px 0px;"> |
|
|
|
<text class="state_point" |
|
|
|
:class="item.status | statusStyle">{{statusArray[item.status-1]}}</text> |
|
|
|
<image class="icon_normal" |
|
|
|
src="@/static/icons_ui/icon_down.svg"> |
|
|
|
</image> |
|
|
|
</view> |
|
|
|
</picker> |
|
|
|
</view> |
|
|
|
</picker> |
|
|
|
<text v-else class="state_point" :class="item.status | statusStyle"> |
|
|
|
{{ item.status | statusColor}} |
|
|
|
</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<text v-else class="state_point" :class="item.status | statusStyle"> |
|
|
|
{{ item.status | statusColor}} |
|
|
|
</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="uni-flex space-between" style="margin:0 20rpx 20rpx;" |
|
|
|
v-if="item.scaned || item.packingCode==''"> |
|
|
|
<text class="font_xs" |
|
|
|
style="padding: 5px 2px; text-overflow: ellipsis; overflow: hidden;">{{item.countDescription}}</text> |
|
|
|
<view class="photo_btn fr" @click="openEditCountDesc(item)"> |
|
|
|
<text class="fl font_xs" style="width:65px;">盘点描述</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view v-if="item.scaned" class="choose_marked_count" |
|
|
|
style="background-color: #5FCB94; opacity: 0.65"> |
|
|
|
<view class="" style="background-color: #5FCB94; width: 200rpx;height: 300rpx;"> |
|
|
|
|
|
|
|
</view> |
|
|
|
<!-- <image src="@/static/image_marked.svg"></image> --> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="uni-flex space-between" style="margin:0 20rpx 20rpx;" |
|
|
|
v-if="item.scaned || item.packingCode==''"> |
|
|
|
<text class="font_xs" |
|
|
|
style="padding: 5px 2px; text-overflow: ellipsis; overflow: hidden;">{{item.countDescription}}</text> |
|
|
|
<view class="photo_btn fr" @click="openEditCountDesc(item)"> |
|
|
|
<text class="fl font_xs" style="width:65px;">盘点描述</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view v-if="item.scaned" class="choose_marked"> |
|
|
|
<image src="@/static/image_marked.svg"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-swipe-action-item> |
|
|
|
</uni-swipe-action> |
|
|
|
</view> |
|
|
|
</scroll-view> |
|
|
|
</uni-swipe-action-item> |
|
|
|
</uni-swipe-action> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
</z-paging> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="new_btn_bot"> |
|
|
|
<button class="new_save_btn" @click="submit()">提交</button> |
|
|
@ -131,9 +170,11 @@ |
|
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
|
<win-scan-by-pack ref="scanPopup" @getScanResult='getScanResult' @close='closeScanPopup()'></win-scan-by-pack> |
|
|
|
<com-easy-input ref="descPopup" @confirm='closeEditCountDesc'></com-easy-input> |
|
|
|
<com-easy-input-count ref="countPopup" @confirm='closeEditCount'></com-easy-input-count> |
|
|
|
<win-inventory-status ref="statusPopup"></win-inventory-status> |
|
|
|
<!-- com-message必须放在最下层 --> |
|
|
|
<com-message ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'></com-message> |
|
|
|
<!-- <uni-load-more :status="loadingType" v-if="details.length>0"></uni-load-more> --> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
@ -159,7 +200,8 @@ |
|
|
|
goHome, |
|
|
|
getISODateTime, |
|
|
|
compare, |
|
|
|
getRemoveOption |
|
|
|
getRemoveOption, |
|
|
|
getCurrDateTime |
|
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
import { |
|
|
@ -174,8 +216,11 @@ |
|
|
|
import comCountScanDetail from '@/mycomponents/coms/task/comCountScanDetail.vue'; |
|
|
|
import comNumberBox from '@/mycomponents/common/comNumberBox.vue'; |
|
|
|
import comEasyInput from '@/mycomponents/common/comEasyInput.vue'; |
|
|
|
import comEasyInputCount from '@/mycomponents/common/comEasyInputCount.vue'; |
|
|
|
|
|
|
|
import winInventoryStatus from '@/mycomponents/wincom/winInventoryStatus.vue'; |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
|
// comCountItems, |
|
|
@ -185,6 +230,7 @@ |
|
|
|
comCountScanDetail, |
|
|
|
comNumberBox, |
|
|
|
comEasyInput, |
|
|
|
comEasyInputCount, |
|
|
|
winInventoryStatus |
|
|
|
}, |
|
|
|
data() { |
|
|
@ -192,9 +238,11 @@ |
|
|
|
type: '', |
|
|
|
id: '', |
|
|
|
datacontent: {}, |
|
|
|
details: {}, |
|
|
|
details: [], |
|
|
|
allDetails: [], //所以的明细 |
|
|
|
currentItem: {}, |
|
|
|
editDescItem: {}, |
|
|
|
editCountItem: {}, |
|
|
|
scrollTop: 0, |
|
|
|
old: { |
|
|
|
scrollTop: 0 |
|
|
@ -208,7 +256,14 @@ |
|
|
|
topItem: '', |
|
|
|
isShowScanPopup: false, |
|
|
|
statusArray: [], |
|
|
|
allStatusArray: [] |
|
|
|
allStatusArray: [], |
|
|
|
ipage: 1, |
|
|
|
iSize: 20, |
|
|
|
testList: [], |
|
|
|
isload: true, |
|
|
|
loadingType: "", |
|
|
|
currentPage: 0, |
|
|
|
pageSize: 20, |
|
|
|
// array: [{ |
|
|
|
// text: '待检', |
|
|
|
// value: 1 |
|
|
@ -246,6 +301,8 @@ |
|
|
|
onNavigationBarButtonTap(e) { |
|
|
|
if (e.index === 0) { |
|
|
|
goHome(); |
|
|
|
} else if (e.index === 1) { |
|
|
|
window.location.reload(); |
|
|
|
} |
|
|
|
}, |
|
|
|
//拦截返回按钮事件 |
|
|
@ -259,13 +316,15 @@ |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
onReachBottom() {}, |
|
|
|
|
|
|
|
filters: { |
|
|
|
statusStyle: function(val) { |
|
|
|
return getJobStatuStyle(val); |
|
|
|
}, |
|
|
|
statusColor: function(val) { |
|
|
|
return getJobStatuDesc(val); |
|
|
|
}, |
|
|
|
// statusColor: function(val) { |
|
|
|
// return getJobStatuDesc(val); |
|
|
|
// }, |
|
|
|
statusStyle: function(val) { |
|
|
|
return getInventoryTypeStyle(val); |
|
|
|
}, |
|
|
@ -312,7 +371,14 @@ |
|
|
|
getCountJobDetail(params) |
|
|
|
.then(async res => { |
|
|
|
that.datacontent = res; |
|
|
|
that.allCount = res.details.length |
|
|
|
// var test = res.details[0] |
|
|
|
// for (var i = 0; i < 10000; i++) { |
|
|
|
// var detail = {} |
|
|
|
// var detail = Object.assign(detail, test) |
|
|
|
// detail.id = i; |
|
|
|
// res.details.push(detail) |
|
|
|
// } |
|
|
|
|
|
|
|
if (res.details != null) { |
|
|
|
res.details.forEach(r => { |
|
|
|
r.scaned = false |
|
|
@ -321,7 +387,9 @@ |
|
|
|
r.countQty = 0; |
|
|
|
}) |
|
|
|
} |
|
|
|
that.details = res.details; |
|
|
|
that.allDetails = res.details; |
|
|
|
that.allCount = res.details.length |
|
|
|
|
|
|
|
//查询库位信息 |
|
|
|
let locationCode = that.datacontent.locationCode; |
|
|
|
let location = await locationsAsync(locationCode); |
|
|
@ -334,6 +402,16 @@ |
|
|
|
uni.hideLoading(); |
|
|
|
}, |
|
|
|
|
|
|
|
getDataPage(pageNo, pageSize) { |
|
|
|
//计算总页数 |
|
|
|
var totalPages = Math.ceil(this.allCount / pageSize); |
|
|
|
//当前页起始索引 |
|
|
|
const start = (pageNo - 1) * pageSize; |
|
|
|
const end = start + pageSize; //当前页结束索引 |
|
|
|
return this.allDetails.slice(start, end) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getScanResult(result) { |
|
|
|
let that = this; |
|
|
|
this.scanResult = result; |
|
|
@ -343,12 +421,12 @@ |
|
|
|
let lot = result.data.lot === null ? '' : result.data.lot; |
|
|
|
// let items = this.details.filter(r => r.itemCode === itemCode && |
|
|
|
// r.packingCode === packingCode && r.lot === lot) |
|
|
|
let items = this.details.filter(r => |
|
|
|
let items = this.allDetails.filter(r => |
|
|
|
r.packingCode === packingCode) |
|
|
|
if (items.length === 0) { |
|
|
|
//按零件盘点,不能添加其他零件为明细 |
|
|
|
if (this.datacontent.countMethod === 2) { |
|
|
|
if (this.details[0].itemCode === itemCode) { |
|
|
|
if (this.allDetails[0].itemCode === itemCode) { |
|
|
|
this.addNewDetail(result); |
|
|
|
} else { |
|
|
|
this.showMessage('扫描的库存不在列表中'); |
|
|
@ -360,40 +438,62 @@ |
|
|
|
let item = items[0]; |
|
|
|
this.currentItem = item; |
|
|
|
if (item.scaned) { |
|
|
|
this.setQty(item, item.countQty); |
|
|
|
// this.showMessage('该库存已经完成盘点,请扫描下一标签'); |
|
|
|
// this.setQty(item, item.countQty); |
|
|
|
this.$refs.comMessage.showMessage('箱码【' + packingCode + '】已经完成盘点,请扫描下一标签') |
|
|
|
} else { |
|
|
|
this.setQty(item, item.inventoryQty); |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.showMessage('盘点数量异常,箱码【' + packingCode + '】的出现多条数据'); |
|
|
|
} |
|
|
|
this.scrollToTop(); |
|
|
|
// this.scrollToTop(); |
|
|
|
this.calcScanCount(); |
|
|
|
}, |
|
|
|
|
|
|
|
addNewDetail(result) { |
|
|
|
async addNewDetail(result) { |
|
|
|
if (this.location == null) { |
|
|
|
this.showMessage('未查找到库位信息,不可以添加为任务明细'); |
|
|
|
return; |
|
|
|
} |
|
|
|
showConfirmMsg('扫描的库存在任务中不存在,是否要添加为任务明细?', async confirm => { |
|
|
|
if (confirm) { |
|
|
|
let balanceItem = await this.getBalanceAsync(result); |
|
|
|
let detail = this.creatDetail(result); |
|
|
|
if (balanceItem != null) { |
|
|
|
this.setDetailByBalance(detail, balanceItem); |
|
|
|
} else { |
|
|
|
this.setDetailNoBalance(detail, result) |
|
|
|
} |
|
|
|
this.details.unshift(detail); |
|
|
|
this.calcAllCount(); |
|
|
|
this.calcScanCount(); |
|
|
|
this.$forceUpdate(); |
|
|
|
let balanceItem = await this.getBalanceAsync(result); |
|
|
|
let detail = this.creatDetail(result); |
|
|
|
if (balanceItem == null || balanceItem == undefined) { |
|
|
|
setTimeout(res => { |
|
|
|
showConfirmMsg('扫描的库存在任务中不存在,是否要添加为任务明细?', async confirm => { |
|
|
|
if (confirm) { |
|
|
|
this.setDetailNoBalance(detail, result) |
|
|
|
this.allDetails.unshift(detail); |
|
|
|
// this.details.unshift(detail); |
|
|
|
this.calcAllCount(); |
|
|
|
this.calcScanCount(); |
|
|
|
this.$forceUpdate(); |
|
|
|
} else { |
|
|
|
this.scanPopupGetfocus(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, 100) |
|
|
|
|
|
|
|
} else { |
|
|
|
if (balanceItem.locationCode != this.location.code) { |
|
|
|
this.showMessage("箱码【" + result.data.code + "】在库位【" + balanceItem.locationCode + "】不在库位【" + |
|
|
|
this.location.code + "】不可以添加为任务明细"); |
|
|
|
} else { |
|
|
|
this.scanPopupGetfocus(); |
|
|
|
setTimeout(res => { |
|
|
|
showConfirmMsg('扫描的库存在任务中不存在,是否要添加为任务明细?', async confirm => { |
|
|
|
if (confirm) { |
|
|
|
this.setDetailByBalance(detail, balanceItem); |
|
|
|
this.allDetails.unshift(detail); |
|
|
|
// this.details.unshift(detail); |
|
|
|
this.calcAllCount(); |
|
|
|
this.calcScanCount(); |
|
|
|
this.$forceUpdate(); |
|
|
|
} else { |
|
|
|
this.scanPopupGetfocus(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, 100) |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
async getBalanceAsync(result) { |
|
|
@ -430,7 +530,7 @@ |
|
|
|
number: this.datacontent.number, |
|
|
|
|
|
|
|
inventoryQty: 0, |
|
|
|
inventoryUom: result.data.uom, |
|
|
|
uom: result.data.uom, |
|
|
|
|
|
|
|
packingCode: result.data.packingCode, |
|
|
|
lot: result.data.lot, |
|
|
@ -460,6 +560,7 @@ |
|
|
|
|
|
|
|
setDetailByBalance(detail, balanceItem) { |
|
|
|
detail.InventoryLocationCode = balanceItem.locationCode; |
|
|
|
detail.inventoryQty = balanceItem.qty; |
|
|
|
detail.countQty = balanceItem.qty; |
|
|
|
detail.status = balanceItem.status; |
|
|
|
return detail; |
|
|
@ -467,6 +568,7 @@ |
|
|
|
|
|
|
|
setDetailNoBalance(detail, result) { |
|
|
|
detail.InventoryLocationCode = ""; |
|
|
|
detail.inventoryQty = 0; |
|
|
|
detail.countQty = result.data.qty; |
|
|
|
detail.status = 2; |
|
|
|
return detail; |
|
|
@ -477,7 +579,10 @@ |
|
|
|
item.countQty = Number(qty); |
|
|
|
item.countTime = new Date(); |
|
|
|
item.countOperator = localStorage.userId; |
|
|
|
this.details.sort(compare('countTime')); //按扫描信息排序 |
|
|
|
|
|
|
|
this.allDetails.sort(compare('countTime')); //按扫描信息排序 |
|
|
|
this.$refs.paging.reload(); |
|
|
|
this.scanPopupGetfocus(); |
|
|
|
this.$forceUpdate(); |
|
|
|
}, |
|
|
|
|
|
|
@ -495,7 +600,7 @@ |
|
|
|
content: '是否移除选择的行?', |
|
|
|
success: res => { |
|
|
|
if (res.confirm) { |
|
|
|
that.details.splice(index, 1); |
|
|
|
that.allDetails.splice(index, 1); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
@ -536,8 +641,10 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
submit() { |
|
|
|
// let params = JSON.stringify(this.allDetails); |
|
|
|
// console.log('params', params); |
|
|
|
let that = this; |
|
|
|
let unCheckedItems = that.details.filter(r => { |
|
|
|
let unCheckedItems = that.allDetails.filter(r => { |
|
|
|
return r.scaned === false |
|
|
|
}) |
|
|
|
if (unCheckedItems.length > 0) { |
|
|
@ -556,24 +663,28 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
finish() { |
|
|
|
if (this.details.length == 0) { |
|
|
|
showConfirmMsg('还没有要盘点的任务详情,是否要继续提交?', confirm => { |
|
|
|
if (confirm) { |
|
|
|
this.finishJob(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
this.finishJob(); |
|
|
|
} |
|
|
|
this.finishJob(); |
|
|
|
// if (this.details.length == 0) { |
|
|
|
// showConfirmMsg('还没有要盘点的任务详情,是否要继续提交?', confirm => { |
|
|
|
// if (confirm) { |
|
|
|
// this.finishJob(); |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// } else { |
|
|
|
// this.finishJob(); |
|
|
|
// } |
|
|
|
}, |
|
|
|
|
|
|
|
finishJob() { |
|
|
|
let that=this; |
|
|
|
let that = this; |
|
|
|
uni.showLoading({ |
|
|
|
title: "提交中...", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
this.datacontent.details = this.details; |
|
|
|
this.datacontent.details = this.allDetails; |
|
|
|
that.datacontent.completeUserId = localStorage.getItem('userId') |
|
|
|
that.datacontent.completeUserName = localStorage.getItem('userName_CN') |
|
|
|
that.datacontent.completeTime = getCurrDateTime() |
|
|
|
let params = JSON.stringify(this.datacontent); |
|
|
|
finishCountJob(this.id, params) |
|
|
|
.then(res => { |
|
|
@ -608,12 +719,12 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
calcAllCount() { |
|
|
|
this.allCount = this.details.length; |
|
|
|
this.newCount = this.details.filter(r => r.isNew).length; |
|
|
|
this.allCount = this.allDetails.length; |
|
|
|
this.newCount = this.allDetails.filter(r => r.isNew).length; |
|
|
|
}, |
|
|
|
|
|
|
|
calcScanCount() { |
|
|
|
this.scanCount = this.details.filter(r => r.scaned === true).length; |
|
|
|
this.scanCount = this.allDetails.filter(r => r.scaned === true).length; |
|
|
|
}, |
|
|
|
|
|
|
|
bindPickerChange(e, item) { |
|
|
@ -628,8 +739,10 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
openScanPopup() { |
|
|
|
this.isShowScanPopup = true; |
|
|
|
this.$refs.scanPopup.openScanPopup(); |
|
|
|
setTimeout(r => { |
|
|
|
this.isShowScanPopup = true; |
|
|
|
this.$refs.scanPopup.openScanPopup(); |
|
|
|
}, 0) |
|
|
|
}, |
|
|
|
|
|
|
|
closeScanPopup() { |
|
|
@ -649,6 +762,16 @@ |
|
|
|
this.editDescItem.countDescription = content; |
|
|
|
this.$forceUpdate(); |
|
|
|
}, |
|
|
|
openEditCount(item) { |
|
|
|
this.editCountItem = item; |
|
|
|
this.$refs.countPopup.openPopup(item.countQty); |
|
|
|
}, |
|
|
|
|
|
|
|
closeEditCount(content) { |
|
|
|
this.editCountItem.countQty = content; |
|
|
|
this.$forceUpdate(); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
showCommitSuccessMessage() { |
|
|
|
this.$refs.comMessage.showCommitSuccess(); |
|
|
@ -686,6 +809,12 @@ |
|
|
|
console.log(e) |
|
|
|
this.old.scrollTop = e.detail.scrollTop |
|
|
|
}, |
|
|
|
queryList(pageNo, pageSize) { |
|
|
|
var list = [] |
|
|
|
this.currentPage = pageNo |
|
|
|
list = this.getDataPage(pageNo, pageSize) |
|
|
|
this.$refs.paging.complete(list) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
} |
|
|
|