|
|
@ -1,36 +1,58 @@ |
|
|
|
<template> |
|
|
|
<view class="page-wraper"> |
|
|
|
<com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view> |
|
|
|
|
|
|
|
<view class="page-header"> |
|
|
|
<view class="header_job_top"> |
|
|
|
<job-top :dataContent="jobContent"></job-top> |
|
|
|
<view class="card_view"> |
|
|
|
<text class="card_packing_code ">盘点计划</text> |
|
|
|
<text class="card_content ">{{jobContent.planNumber}}</text> |
|
|
|
</view> |
|
|
|
<view v-for="(range, index) in dataContent.countRange" :key="index"> |
|
|
|
<view class="card_view"> |
|
|
|
<text class="card_packing_code ">{{getCountScopeName(range.type)}}</text> |
|
|
|
<text class="card_content ">{{range.value}}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- <scroll-view scroll-y="true" class="page-main-scroll"> --> |
|
|
|
|
|
|
|
<uni-collapse ref="collapse"> |
|
|
|
<uni-collapse-item :open="false"> |
|
|
|
<template v-slot:title> |
|
|
|
<view> |
|
|
|
<job-top :dataContent="jobContent"></job-top> |
|
|
|
盘点范围 |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
<view v-for="(range, index) in jobContent.countRange" :key="index"> |
|
|
|
<view class="card_view"> |
|
|
|
<text class="card_packing_code ">{{getCountScopeName(range.type)}}</text> |
|
|
|
<text class="card_content ">{{range.value}}</text> |
|
|
|
</view> |
|
|
|
<view class="card_view"> |
|
|
|
<text class="card_packing_code ">{{getCountScopeName(range.type)}}</text> |
|
|
|
<text class="card_content ">{{range.value}}</text> |
|
|
|
</view> |
|
|
|
<view class="card_view"> |
|
|
|
<text class="card_packing_code ">{{getCountScopeName(range.type)}}</text> |
|
|
|
<text class="card_content ">{{range.value}}</text> |
|
|
|
</view> |
|
|
|
<view class="card_view"> |
|
|
|
<text class="card_packing_code ">{{getCountScopeName(range.type)}}</text> |
|
|
|
<text class="card_content ">{{range.value}}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-collapse-item> |
|
|
|
</uni-collapse> |
|
|
|
</view> |
|
|
|
<view class="card_view" v-if="fromLocationCode!=''"> |
|
|
|
<text class="card_location">盘点库位</text> |
|
|
|
<text class="card_content ">{{fromLocationCode}}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="page-main"> |
|
|
|
|
|
|
|
<view class="page-main" > |
|
|
|
<view class=""> |
|
|
|
<com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view> |
|
|
|
</view> |
|
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
|
<uni-swipe-action ref="swipeAction"> |
|
|
|
<uni-swipe-action-item @click="swipeClick($event,item)" :right-options="editRemoveOption"> |
|
|
|
<!-- {{editRemoveOption}} --> |
|
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
|
<uni-swipe-action-item @click="swipeClick($event,item,index)" :right-options="editRemoveOption"> |
|
|
|
<view class=""> |
|
|
|
<package-and-item-card :dataContent="item"></package-and-item-card> |
|
|
|
</view> |
|
|
|
<view class='split_line'></view> |
|
|
|
</view> |
|
|
|
</uni-swipe-action-item> |
|
|
|
</uni-swipe-action-item> |
|
|
|
</view> |
|
|
|
</uni-swipe-action> |
|
|
|
</scroll-view> |
|
|
|
</view> |
|
|
@ -48,9 +70,7 @@ |
|
|
|
|
|
|
|
<win-scan-button v-if="fromLocationCode!=''" @goScan='openScanPopup'></win-scan-button> |
|
|
|
<win-scan-pack ref="scanPopup" @getResult='getScanResult'></win-scan-pack> |
|
|
|
|
|
|
|
<win-scan-location ref="scanLocationCode" title="盘点库位" @getLocation='getLocation'></win-scan-location> |
|
|
|
|
|
|
|
<count-qty-edit ref="countQtyEdit" @confirm="editConfirm" @close="editClose" :isShowStatus="true" |
|
|
|
:allowEditStatus="editInventoryStatus" :isShowBalance="jobContent.isOpenCount=='TRUE'"> |
|
|
|
</count-qty-edit> |
|
|
@ -60,15 +80,18 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import { |
|
|
|
getCountJobDetail, |
|
|
|
getFuuzyCountJobDetail, |
|
|
|
takeCountJob, |
|
|
|
cancleTakeCountJob, |
|
|
|
countJobSubmit |
|
|
|
} from '@/api/request2.js'; |
|
|
|
import { |
|
|
|
calc |
|
|
|
} from '@/common/calc.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
getCountScopeType |
|
|
|
} from '@/common/directory.js'; |
|
|
|
Decimal |
|
|
|
} from 'decimal.js'; //引入 |
|
|
|
|
|
|
|
import { |
|
|
|
getEditRemoveOption |
|
|
@ -80,6 +103,10 @@ |
|
|
|
getPackingNumberAndBatch |
|
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
getCountScopeType |
|
|
|
} from '@/common/directory.js'; |
|
|
|
|
|
|
|
|
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
|
import winScanPack from '@/mycomponents/scan/winScanPack.vue' |
|
|
@ -92,7 +119,7 @@ |
|
|
|
import PackageAndItemCard from '@/mycomponents/package/PackageAndItemCard.vue' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'receipt_detail', |
|
|
|
name: 'fuzzycountdetail', |
|
|
|
components: { |
|
|
|
winScanButton, |
|
|
|
winScanPack, |
|
|
@ -128,13 +155,16 @@ |
|
|
|
//新建的任务自动接收 |
|
|
|
if (option.status == "1") { |
|
|
|
this.receive((callback => { |
|
|
|
this.getDetail(); |
|
|
|
this.getDetail(r => { |
|
|
|
this.showFromLocationPopup(); |
|
|
|
}); |
|
|
|
})); |
|
|
|
} else { |
|
|
|
this.getDetail(); |
|
|
|
this.getDetail(r => { |
|
|
|
this.showFromLocationPopup(); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
this.showFromLocationPopup(); |
|
|
|
this.editRemoveOption = getEditRemoveOption(); |
|
|
|
}, |
|
|
|
//返回首页 |
|
|
@ -181,16 +211,17 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
getDetail() { |
|
|
|
getDetail(callback) { |
|
|
|
var that = this; |
|
|
|
uni.showLoading({ |
|
|
|
title: "加载中....", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
getCountJobDetail(that.id).then(res => { |
|
|
|
getFuuzyCountJobDetail(that.id).then(res => { |
|
|
|
uni.hideLoading(); |
|
|
|
that.jobContent = res.data; |
|
|
|
that.jobStatus = res.data.status; |
|
|
|
callback(); |
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
@ -199,6 +230,8 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
showFromLocationPopup() { |
|
|
|
let as = ''; |
|
|
|
// this.$refs.scanLocationCode.openScanPopup(); |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.scanLocationCode.openScanPopup(); |
|
|
|
}) |
|
|
@ -207,35 +240,48 @@ |
|
|
|
getLocation(location, code) { |
|
|
|
let countRange = this.jobContent.countRange; |
|
|
|
|
|
|
|
let range = countRange.find(r => r.type == "LOCATION_CODE"); |
|
|
|
if (range != undefined) { |
|
|
|
if (!rang.value.includes(location.code)) { |
|
|
|
this.showErrorMessage("库位代码【" + location.code + "】,不在盘点库位范围【" + rangeValue + "】内") |
|
|
|
return; |
|
|
|
} |
|
|
|
} else { |
|
|
|
range = countRange.find(r => r.type == "LOCATIONGROUP_CODE"); |
|
|
|
if (countRange != null) { |
|
|
|
let range = countRange.find(r => r.type == "LOCATION_CODE"); |
|
|
|
if (range != undefined) { |
|
|
|
if (!rang.value.includes(location.locationGroupCode)) { |
|
|
|
this.showErrorMessage("库位组代码【" + location.locationGroupCode + "】,不在盘点库位组范围【" + rangeValue + |
|
|
|
"】内") |
|
|
|
let rangeValue = range.value; |
|
|
|
let index = rangeValue.indexOf(location.code) |
|
|
|
if (index < 0) { |
|
|
|
this.afterScanLocation("库位代码【" + location.code + "】,不在盘点库位范围【" + rangeValue + "】内"); |
|
|
|
return; |
|
|
|
} |
|
|
|
} else { |
|
|
|
range = countRange.find(r => r.type == "AREA_CODE"); |
|
|
|
range = countRange.find(r => r.type == "LOCATIONGROUP_CODE"); |
|
|
|
if (range != undefined) { |
|
|
|
if (!rang.value.includes(location.areaCode)) { |
|
|
|
this.showErrorMessage("库区代码【" + location.areaCode + "】,不在盘点库区范围【" + rangeValue + "】内") |
|
|
|
let rangeValue = range.value; |
|
|
|
let index = rangeValue.indexOf(location.locationGroupCode) |
|
|
|
if (index < 0) { |
|
|
|
this.afterScanLocation("库位组代码【" + location.locationGroupCode + "】,不在盘点库位组范围【" + |
|
|
|
rangeValue + |
|
|
|
"】内"); |
|
|
|
return; |
|
|
|
} |
|
|
|
} else { |
|
|
|
range = countRange.find(r => r.type == "WAREHOUSE_CODE"); |
|
|
|
range = countRange.find(r => r.type == "AREABASIC_CODE"); |
|
|
|
if (range != undefined) { |
|
|
|
if (!rang.value.includes(location.warehouseCode)) { |
|
|
|
this.showErrorMessage("仓库代码【" + location.warehouseCode + "】,不在盘点仓库范围【" + rangeValue + |
|
|
|
"】内") |
|
|
|
let rangeValue = range.value; |
|
|
|
let index = rangeValue.indexOf(location.areaCode) |
|
|
|
if (index < 0) { |
|
|
|
this.afterScanLocation("库区代码【" + location.areaCode + "】,不在盘点库区范围【" + |
|
|
|
rangeValue + "】内"); |
|
|
|
return; |
|
|
|
} |
|
|
|
} else { |
|
|
|
range = countRange.find(r => r.type == "WAREHOUSE_CODE"); |
|
|
|
if (range != undefined) { |
|
|
|
let rangeValue = range.value; |
|
|
|
let index = rangeValue.indexOf(location.warehouseCode) |
|
|
|
if (index < 0) { |
|
|
|
this.afterScanLocation("仓库代码【" + location.warehouseCode + "】,不在盘点仓库范围【" + |
|
|
|
rangeValue + |
|
|
|
"】内"); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -243,6 +289,11 @@ |
|
|
|
this.getFromLocationCode(location, code) |
|
|
|
}, |
|
|
|
|
|
|
|
afterScanLocation(message) { |
|
|
|
this.showErrorMessage(message) |
|
|
|
this.showFromLocationPopup(); |
|
|
|
}, |
|
|
|
|
|
|
|
getFromLocationCode(location, code) { |
|
|
|
this.fromLocation = location; |
|
|
|
this.fromLocationCode = code; |
|
|
@ -253,10 +304,6 @@ |
|
|
|
this.$refs.scanPopup.openScanPopup(); |
|
|
|
}, |
|
|
|
|
|
|
|
closeScanPopup() { |
|
|
|
this.$refs.scanPopup.closeScanPopup(); |
|
|
|
}, |
|
|
|
|
|
|
|
scanPopupGetFocus() { |
|
|
|
if (this.$refs.scanPopup != undefined) { |
|
|
|
this.$refs.scanPopup.getfocus(); |
|
|
@ -269,36 +316,38 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
scanPopupGetFocus() { |
|
|
|
if (this.$refs.scanPopup != undefined) { |
|
|
|
this.$refs.scanPopup.packGetFocus(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
scanPopupLoseFocus() { |
|
|
|
if (this.$refs.scanPopup != undefined) { |
|
|
|
this.$refs.scanPopup.packLoseFocus(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//明盘 |
|
|
|
getScanResult(result) { |
|
|
|
let that = this; |
|
|
|
let package = result.package; |
|
|
|
let detail = this.detailSource.find(r => r.itemCode == package.itemCode && r.packingNumber == package |
|
|
|
.packingNumber && r.batch == package.batch && r.inventoryStatus == "OK"); |
|
|
|
let packInfo = result.package; |
|
|
|
let detail = this.detailSource.find(r => r.itemCode == packInfo.itemCode && r.packingNumber == packInfo |
|
|
|
.number && r.batch == packInfo.batch && r.inventoryStatus == "OK"); |
|
|
|
|
|
|
|
if (detail == undefined) { |
|
|
|
detail = this.createDetailInfo(package); |
|
|
|
this.detailSource.push(detail) |
|
|
|
detail = this.createDetailInfo(packInfo); |
|
|
|
this.detailSource.unshift(detail) |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
} else { |
|
|
|
let index = detail.index; |
|
|
|
list.unshift(list.splice(index, 1)[0]); //置顶 |
|
|
|
//提交 |
|
|
|
this.showQuestionMessage('该箱码已经扫描,是否要编辑盘点明细?', res => { |
|
|
|
if (res) { |
|
|
|
this.edit(detail); |
|
|
|
} |
|
|
|
}); |
|
|
|
let index = this.detailSource.findIndex(r => r.itemCode == packInfo.itemCode && r.packingNumber == |
|
|
|
packInfo |
|
|
|
.number && r.batch == packInfo.batch && r.inventoryStatus == "OK"); |
|
|
|
if (index >= 0) { |
|
|
|
this.detailSource.unshift(this.detailSource.splice(index, 1)[0]); //置顶 |
|
|
|
//提交 |
|
|
|
this.$refs.comMessage.showQuestionMessage('该箱码已经扫描,是否要编辑盘点明细?', res => { |
|
|
|
if (res) { |
|
|
|
this.closeScanPopup(); |
|
|
|
this.edit(detail); |
|
|
|
} else { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
@ -318,18 +367,26 @@ |
|
|
|
projectCode: "", |
|
|
|
qty: packInfo.qty, |
|
|
|
countQty: packInfo.qty, |
|
|
|
packQty: packInfo.packQty, |
|
|
|
packUom: packInfo.packUom, |
|
|
|
uom: packInfo.uom, |
|
|
|
remark: "", |
|
|
|
locationCode: this.fromLocationCode, |
|
|
|
creator: this.$store.state.user.id, |
|
|
|
warehouseCode: this.fromLocation.warehouseCode, |
|
|
|
areaCode: this.fromLocation.areaCode, |
|
|
|
locationGroupCode: this.fromLocation.locationGroupCode |
|
|
|
locationGroupCode: this.fromLocation.locationGroupCode, |
|
|
|
creationTime: new Date(), |
|
|
|
countTime: new Date() |
|
|
|
} |
|
|
|
return detail; |
|
|
|
}, |
|
|
|
|
|
|
|
swipeClick(e, item) { |
|
|
|
editClose() { |
|
|
|
this.$refs.countQtyEdit.closeEditPopup(); |
|
|
|
}, |
|
|
|
|
|
|
|
swipeClick(e, item, index) { |
|
|
|
if (e.content.text == "编辑") { |
|
|
|
this.edit(item) |
|
|
|
} else if (e.content.text == "移除") { |
|
|
@ -341,19 +398,16 @@ |
|
|
|
edit(item) { |
|
|
|
let that = this; |
|
|
|
this.currentEditItem = item; |
|
|
|
this.$refs.countQtyEdit.openEditPopup(item); |
|
|
|
item.handleQty = item.qty; |
|
|
|
this.$refs.countQtyEdit.openEditPopup(item, null); |
|
|
|
}, |
|
|
|
|
|
|
|
editConfirm(qty, inventoryStatus, mode) { |
|
|
|
let that = this; |
|
|
|
//编辑 |
|
|
|
if (mode == 'edit') { |
|
|
|
this.currentEditItem.countQty = qty; |
|
|
|
this.currentEditItem.qty = qty; |
|
|
|
this.currentEditItem.inventoryStatus = inventoryStatus; |
|
|
|
} |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
|
|
|
|
this.currentEditItem.countQty = qty; |
|
|
|
this.currentEditItem.qty = qty; |
|
|
|
this.currentEditItem.inventoryStatus = inventoryStatus; |
|
|
|
this.openScanPopup(); |
|
|
|
}, |
|
|
|
|
|
|
|
editClose() { |
|
|
@ -363,11 +417,19 @@ |
|
|
|
remove(item, index) { |
|
|
|
this.showQuestionMessage("是否要移除扫描信息?", res => { |
|
|
|
if (res) { |
|
|
|
this.dataContent.subList.splice(index, 1) |
|
|
|
this.detailSource.splice(index, 1) |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
detail(item) { |
|
|
|
this.showItem = item; |
|
|
|
this.$refs.detailInfoPopup.openPopup(item); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
commit() { |
|
|
|
// if(this.detailSource.length==0) |
|
|
|
// { |
|
|
@ -394,13 +456,13 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
setParams() { |
|
|
|
var subList = [] |
|
|
|
var creator = this.$store.state.user.id |
|
|
|
this.jobContent.subList = this.detailSource |
|
|
|
// this.jobContent.creator = creator; |
|
|
|
return this.jobContent; |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
showMessage(message) { |
|
|
|
this.$refs.comMessage.showMessage(message, res => { |
|
|
|
if (res) { |
|
|
@ -408,7 +470,6 @@ |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
showErrorMessage(message) { |
|
|
|
this.$refs.comMessage.showErrorMessage(message, res => { |
|
|
|
if (res) { |
|
|
@ -421,12 +482,6 @@ |
|
|
|
this.$refs.comMessage.showScanMessage(message); |
|
|
|
}, |
|
|
|
|
|
|
|
showQuestionMessage(message, callback) { |
|
|
|
this.$refs.comMessage.showQuestionMessage(message, res => { |
|
|
|
callback(res); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
afterCloseMessage() { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
}, |
|
|
@ -435,25 +490,30 @@ |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
}, |
|
|
|
|
|
|
|
editItem(item) { |
|
|
|
this.currentEditItem = item; |
|
|
|
var detail = this.detailSource.find(r => r.itemCode == item.itemCode); |
|
|
|
this.$refs.countQtyEdit.openEditPopup(item, |
|
|
|
detail.subList); |
|
|
|
}, |
|
|
|
|
|
|
|
showCommitSuccessMessage(hint) { |
|
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
|
navigateBack(1); |
|
|
|
}) |
|
|
|
}, |
|
|
|
getCountStageName(value) { |
|
|
|
return getCountStageName(value) |
|
|
|
}, |
|
|
|
isOpenCount(value) { |
|
|
|
return value == "TRUE" ? "明盘" : "盲盘" |
|
|
|
}, |
|
|
|
|
|
|
|
getCountScopeName(value) { |
|
|
|
let item = getCountScopeType(value); |
|
|
|
return item.label; |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
showQuestionMessage(message, callback) { |
|
|
|
this.$refs.comMessage.showQuestionMessage(message, res => { |
|
|
|
callback(res); |
|
|
|
}); |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
@ -464,32 +524,32 @@ |
|
|
|
background-color: #fff; |
|
|
|
} |
|
|
|
|
|
|
|
.page-wraper { |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
width: 100%; |
|
|
|
height: 100%; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.page-main { |
|
|
|
flex: 1; |
|
|
|
position: relative; |
|
|
|
} |
|
|
|
|
|
|
|
.page-main-scroll { |
|
|
|
position: absolute; |
|
|
|
left: 0; |
|
|
|
right: 0; |
|
|
|
top: 0; |
|
|
|
bottom: 0; |
|
|
|
} |
|
|
|
|
|
|
|
.page-main-list { |
|
|
|
/* height: 80rpx; |
|
|
|
line-height: 80rpx; */ |
|
|
|
text-align: center; |
|
|
|
background: #e0e0e0; |
|
|
|
|
|
|
|
} |
|
|
|
</style> |
|
|
|
// .page-wraper { |
|
|
|
// display: flex; |
|
|
|
// flex-direction: column; |
|
|
|
// width: 100%; |
|
|
|
// height: 100%; |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
// .page-main { |
|
|
|
// flex: 1; |
|
|
|
// position: relative; |
|
|
|
// } |
|
|
|
|
|
|
|
// .page-main-scroll { |
|
|
|
// position: absolute; |
|
|
|
// left: 0; |
|
|
|
// right: 0; |
|
|
|
// top: 0; |
|
|
|
// bottom: 0; |
|
|
|
// } |
|
|
|
|
|
|
|
// .page-main-list { |
|
|
|
// /* height: 80rpx; |
|
|
|
// line-height: 80rpx; */ |
|
|
|
// text-align: center; |
|
|
|
// background: #e0e0e0; |
|
|
|
|
|
|
|
// } |
|
|
|
</style> |