|
|
@ -4,8 +4,8 @@ |
|
|
|
<view class="header_job_top"> |
|
|
|
<view class="header-view"> |
|
|
|
<job-top :dataContent="jobContent"></job-top> |
|
|
|
<uni-collapse ref="collapse"> |
|
|
|
<uni-collapse-item :open="true"> |
|
|
|
<u-collapse ref="collapse"> |
|
|
|
<u-collapse-item :open="true"> |
|
|
|
<template v-slot:title> |
|
|
|
<view class="card_itemName" style="padding: 3px 5px; font-size: 28rpx"> 盘点范围 </view> |
|
|
|
</template> |
|
|
@ -15,8 +15,8 @@ |
|
|
|
<text class="card_content">{{ range.value }}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-collapse-item> |
|
|
|
</uni-collapse> |
|
|
|
</u-collapse-item> |
|
|
|
</u-collapse> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="card_view" v-if="fromLocationCode != ''"> |
|
|
@ -27,16 +27,17 @@ |
|
|
|
<com-blank-view @goScan="showFromLocationPopup" v-if="detailSource.length == 0"></com-blank-view> |
|
|
|
<view class="page-main"> |
|
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
|
<uni-swipe-action ref="swipeAction"> |
|
|
|
<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"> |
|
|
|
<u-swipe-action ref="swipeAction" |
|
|
|
v-for="(item, index) in detailSource" :key="item.id" |
|
|
|
:options="editRemoveOption" |
|
|
|
@click="(...event)=>swipeClick(event, item, index)"> |
|
|
|
<view class="detail-list"> |
|
|
|
<view class=""> |
|
|
|
<package-and-item-card :dataContent="item"></package-and-item-card> |
|
|
|
</view> |
|
|
|
<view class="split_line"></view> |
|
|
|
</uni-swipe-action-item> |
|
|
|
</view> |
|
|
|
</uni-swipe-action> |
|
|
|
</u-swipe-action> |
|
|
|
</scroll-view> |
|
|
|
</view> |
|
|
|
|
|
|
@ -63,7 +64,7 @@ |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
<script setup> |
|
|
|
import { Decimal } from 'decimal.js' // 引入 |
|
|
|
import { getFuuzyCountJobDetail, takeCountJob, cancleTakeCountJob, countJobSubmit } from '@/api/request2.js' |
|
|
|
import { calc } from '@/common/calc.js' |
|
|
@ -84,169 +85,135 @@ import jobTop from '@/mycomponents/job/jobTop.vue' |
|
|
|
import comBlankView from '@/mycomponents/common/comBlankView.vue' |
|
|
|
import PackageAndItemCard from '@/mycomponents/package/PackageAndItemCard.vue' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'fuzzycountdetail', |
|
|
|
components: { |
|
|
|
winScanButton, |
|
|
|
winScanPack, |
|
|
|
comCountDetailCard, |
|
|
|
// winScanPackAndLocation, |
|
|
|
winScanLocation, |
|
|
|
countQtyEdit, |
|
|
|
jobTop, |
|
|
|
comBlankView, |
|
|
|
PackageAndItemCard |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
id: '', |
|
|
|
scanCount: 0, |
|
|
|
jobContent: {}, // 任务内容 |
|
|
|
subList: [], // 接口返回的任务subList |
|
|
|
detailSource: [], // 绑定在页面上的数据源 |
|
|
|
balance: {}, // 库存余额 |
|
|
|
editInventoryStatus: false, |
|
|
|
package: {}, // 包装 |
|
|
|
label: {}, // 标签 |
|
|
|
currentEditItem: {}, |
|
|
|
jobStatus: '', |
|
|
|
fromLocation: {}, |
|
|
|
fromLocationCode: '', |
|
|
|
editRemoveOption: [], |
|
|
|
itemRangeValue: '' |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
|
this.id = option.id |
|
|
|
if (this.id != undefined) { |
|
|
|
// 新建的任务自动接收 |
|
|
|
if (option.status == '1') { |
|
|
|
this.receive((callback) => { |
|
|
|
this.getDetail((r) => { |
|
|
|
this.showFromLocationPopup() |
|
|
|
}) |
|
|
|
}) |
|
|
|
import { ref, nextTick } from 'vue' |
|
|
|
import { onLoad, onPullDownRefresh, onBackPress, onNavigationBarButtonTap } from '@dcloudio/uni-app' |
|
|
|
import {useCountStore} from '@/store' |
|
|
|
const store = useCountStore() |
|
|
|
const id = ref(null) |
|
|
|
const jobStatus = ref('') |
|
|
|
const editRemoveOption = ref(getEditRemoveOption()) |
|
|
|
const jobContent = ref({}) |
|
|
|
const itemRangeValue = ref('') |
|
|
|
const fromLocation = ref({}) |
|
|
|
const fromLocationCode = ref('') |
|
|
|
const detailSource = ref([]) |
|
|
|
const managementList = ref([]) |
|
|
|
const managementType = ref('') |
|
|
|
const currentEditItem = ref(null) |
|
|
|
const showItem = ref(null) |
|
|
|
|
|
|
|
const scanLocationCode = ref(null) |
|
|
|
const scanPopup = ref(null) |
|
|
|
const comMessage = ref(null) |
|
|
|
const countQtyEdit = ref(null) |
|
|
|
const detailInfoPopup = ref(null) |
|
|
|
|
|
|
|
onLoad(option => { |
|
|
|
id.value = option.id |
|
|
|
if (id.value !== undefined) { |
|
|
|
if (option.status === '1') { |
|
|
|
receive(() => getDetail(() => showFromLocationPopup())) |
|
|
|
} else { |
|
|
|
this.getDetail((r) => { |
|
|
|
this.showFromLocationPopup() |
|
|
|
}) |
|
|
|
getDetail(() => showFromLocationPopup()) |
|
|
|
} |
|
|
|
} |
|
|
|
this.editRemoveOption = getEditRemoveOption() |
|
|
|
}, |
|
|
|
// 返回首页 |
|
|
|
onNavigationBarButtonTap(e) { |
|
|
|
editRemoveOption.value = getEditRemoveOption() |
|
|
|
}) |
|
|
|
|
|
|
|
onNavigationBarButtonTap(e => { |
|
|
|
if (e.index === 0) { |
|
|
|
goHome() |
|
|
|
} |
|
|
|
}, |
|
|
|
// 拦截返回按钮事件 |
|
|
|
onBackPress(e) { |
|
|
|
// 已经接收但是没提交任务 |
|
|
|
}) |
|
|
|
|
|
|
|
onBackPress(e => { |
|
|
|
if (e.from === 'backbutton') { |
|
|
|
if (this.jobStatus == '2') { |
|
|
|
// 取消承接任务 |
|
|
|
cancleTakeCountJob(this.id) |
|
|
|
.then((res) => { |
|
|
|
uni.navigateBack() |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
uni.navigateBack() |
|
|
|
}) |
|
|
|
if (jobStatus.value === '2') { |
|
|
|
cancleTakeCountJob(id.value) |
|
|
|
.then(() => uni.navigateBack()) |
|
|
|
.catch(() => uni.navigateBack()) |
|
|
|
} else { |
|
|
|
uni.navigateBack() |
|
|
|
} |
|
|
|
return true |
|
|
|
} |
|
|
|
}, |
|
|
|
}) |
|
|
|
|
|
|
|
onPullDownRefresh() { |
|
|
|
onPullDownRefresh(() => { |
|
|
|
// uni.stopPullDownRefresh(); |
|
|
|
}, |
|
|
|
|
|
|
|
mounted() {}, |
|
|
|
methods: { |
|
|
|
// 接收 |
|
|
|
receive(callback) { |
|
|
|
if (this.id != null) { |
|
|
|
takeCountJob(this.id) |
|
|
|
.then((res) => { |
|
|
|
callback() |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
this.showErrorMessage(error) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
const receive = (callback) => { |
|
|
|
if (id.value !== null) { |
|
|
|
takeCountJob(id.value) |
|
|
|
.then(callback) |
|
|
|
.catch(error => showErrorMessage(error)) |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
getDetail(callback) { |
|
|
|
const that = this |
|
|
|
uni.showLoading({ |
|
|
|
title: '加载中....', |
|
|
|
mask: true |
|
|
|
}) |
|
|
|
getFuuzyCountJobDetail(that.id) |
|
|
|
.then((res) => { |
|
|
|
const getDetail = (callback) => { |
|
|
|
uni.showLoading({ title: '加载中....', mask: true }) |
|
|
|
getFuuzyCountJobDetail(id.value) |
|
|
|
.then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
that.jobContent = res.data |
|
|
|
that.jobStatus = res.data.status |
|
|
|
const range = that.jobContent.countRange.find((r) => r.type == 'ITEM_CODE') |
|
|
|
if (range != undefined) { |
|
|
|
that.itemRangeValue = range.value |
|
|
|
jobContent.value = res.data |
|
|
|
jobStatus.value = res.data.status |
|
|
|
const range = jobContent.value.countRange.find(r => r.type === 'ITEM_CODE') |
|
|
|
if (range !== undefined) { |
|
|
|
itemRangeValue.value = range.value |
|
|
|
} |
|
|
|
callback() |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
.catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
that.showErrorMessage(error) |
|
|
|
showErrorMessage(error) |
|
|
|
}) |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
showFromLocationPopup() { |
|
|
|
const as = '' |
|
|
|
const showFromLocationPopup = () => { |
|
|
|
// this.$refs.scanLocationCode.openScanPopup(); |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.scanLocationCode.openScanPopup() |
|
|
|
nextTick(() => { |
|
|
|
scanLocationCode.value.openScanPopup() |
|
|
|
}) |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
getLocation(location, code) { |
|
|
|
const { countRange } = this.jobContent |
|
|
|
const getLocation = (location, code) => { |
|
|
|
const { countRange } = jobContent.value |
|
|
|
|
|
|
|
if (countRange != null) { |
|
|
|
let range = countRange.find((r) => r.type == 'LOCATION_CODE') |
|
|
|
if (range != undefined) { |
|
|
|
if (countRange !== null) { |
|
|
|
let range = countRange.find(r => r.type === 'LOCATION_CODE') |
|
|
|
if (range !== undefined) { |
|
|
|
const rangeValue = range.value |
|
|
|
const index = rangeValue.indexOf(location.code) |
|
|
|
if (index < 0) { |
|
|
|
this.afterScanLocation(`库位代码【${location.code}】,不在盘点库位范围【${rangeValue}】内`) |
|
|
|
afterScanLocation(`库位代码【${location.code}】,不在盘点库位范围【${rangeValue}】内`) |
|
|
|
return |
|
|
|
} |
|
|
|
} else { |
|
|
|
range = countRange.find((r) => r.type == 'LOCATIONGROUP_CODE') |
|
|
|
if (range != undefined) { |
|
|
|
range = countRange.find(r => r.type === 'LOCATIONGROUP_CODE') |
|
|
|
if (range !== undefined) { |
|
|
|
const rangeValue = range.value |
|
|
|
const index = rangeValue.indexOf(location.locationGroupCode) |
|
|
|
if (index < 0) { |
|
|
|
this.afterScanLocation(`库位组代码【${location.locationGroupCode}】,不在盘点库位组范围【${rangeValue}】内`) |
|
|
|
afterScanLocation(`库位组代码【${location.locationGroupCode}】,不在盘点库位组范围【${rangeValue}】内`) |
|
|
|
return |
|
|
|
} |
|
|
|
} else { |
|
|
|
range = countRange.find((r) => r.type == 'AREABASIC_CODE') |
|
|
|
if (range != undefined) { |
|
|
|
range = countRange.find(r => r.type === 'AREABASIC_CODE') |
|
|
|
if (range !== undefined) { |
|
|
|
const rangeValue = range.value |
|
|
|
const index = rangeValue.indexOf(location.areaCode) |
|
|
|
if (index < 0) { |
|
|
|
this.afterScanLocation(`库区代码【${location.areaCode}】,不在盘点库区范围【${rangeValue}】内`) |
|
|
|
afterScanLocation(`库区代码【${location.areaCode}】,不在盘点库区范围【${rangeValue}】内`) |
|
|
|
return |
|
|
|
} |
|
|
|
} else { |
|
|
|
range = countRange.find((r) => r.type == 'WAREHOUSE_CODE') |
|
|
|
if (range != undefined) { |
|
|
|
range = countRange.find(r => r.type === 'WAREHOUSE_CODE') |
|
|
|
if (range !== undefined) { |
|
|
|
const rangeValue = range.value |
|
|
|
const index = rangeValue.indexOf(location.warehouseCode) |
|
|
|
if (index < 0) { |
|
|
|
this.afterScanLocation(`仓库代码【${location.warehouseCode}】,不在盘点仓库范围【${rangeValue}】内`) |
|
|
|
afterScanLocation(`仓库代码【${location.warehouseCode}】,不在盘点仓库范围【${rangeValue}】内`) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
@ -254,116 +221,108 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.getFromLocationCode(location, code) |
|
|
|
}, |
|
|
|
getFromLocationCode(location, code) |
|
|
|
} |
|
|
|
|
|
|
|
afterScanLocation(message) { |
|
|
|
this.showErrorMessage(message) |
|
|
|
this.showFromLocationPopup() |
|
|
|
}, |
|
|
|
const afterScanLocation = (message) => { |
|
|
|
showErrorMessage(message) |
|
|
|
showFromLocationPopup() |
|
|
|
} |
|
|
|
|
|
|
|
getFromLocationCode(location, code) { |
|
|
|
this.fromLocation = location |
|
|
|
this.fromLocationCode = code |
|
|
|
this.openScanPopup() |
|
|
|
}, |
|
|
|
const getFromLocationCode = (location, code) => { |
|
|
|
fromLocation.value = location |
|
|
|
fromLocationCode.value = code |
|
|
|
openScanPopup() |
|
|
|
} |
|
|
|
|
|
|
|
openScanPopup() { |
|
|
|
this.$refs.scanPopup.openScanPopup() |
|
|
|
}, |
|
|
|
const openScanPopup = () => { |
|
|
|
scanPopup.value.openScanPopup() |
|
|
|
} |
|
|
|
|
|
|
|
scanPopupGetFocus() { |
|
|
|
if (this.$refs.scanPopup != undefined) { |
|
|
|
this.$refs.scanPopup.getfocus() |
|
|
|
const scanPopupGetFocus = () => { |
|
|
|
if (scanPopup.value !== undefined) { |
|
|
|
scanPopup.value.getfocus() |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
closeScanPopup() { |
|
|
|
if (this.$refs.scanPopup != undefined) { |
|
|
|
this.$refs.scanPopup.closeScanPopup() |
|
|
|
const closeScanPopup = () => { |
|
|
|
if (scanPopup.value !== undefined) { |
|
|
|
scanPopup.value.closeScanPopup() |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
scanPopupLoseFocus() { |
|
|
|
if (this.$refs.scanPopup != undefined) { |
|
|
|
this.$refs.scanPopup.losefocus() |
|
|
|
const scanPopupLoseFocus = () => { |
|
|
|
if (scanPopup.value !== undefined) { |
|
|
|
scanPopup.value.losefocus() |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
getScanResult(result) { |
|
|
|
const that = this |
|
|
|
const getScanResult = (result) => { |
|
|
|
const packInfo = result.package |
|
|
|
if (this.itemRangeValue != '') { |
|
|
|
const index = this.itemRangeValue.indexOf(packInfo.itemCode) |
|
|
|
if (itemRangeValue.value !== '') { |
|
|
|
const index = itemRangeValue.value.indexOf(packInfo.itemCode) |
|
|
|
if (index < 0) { |
|
|
|
this.showErrorMessage(`物料代码【${packInfo.itemCode}】,不在盘点范围【${this.itemRangeValue}】内`) |
|
|
|
showErrorMessage(`物料代码【${packInfo.itemCode}】,不在盘点范围【${itemRangeValue.value}】内`) |
|
|
|
} else { |
|
|
|
this.onScan(packInfo) |
|
|
|
onScan(packInfo) |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.onScan(packInfo) |
|
|
|
onScan(packInfo) |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
async onScan(packInfo) { |
|
|
|
const onScan = async (packInfo) => { |
|
|
|
console.log(packInfo) |
|
|
|
//获取管理模式,封装参数\ |
|
|
|
// 获取管理模式,封装参数 |
|
|
|
await getManagementPrecisions([packInfo.itemCode], packInfo.toLocationCode, res => { |
|
|
|
if (res.success) { |
|
|
|
this.managementList = res.list; |
|
|
|
this.managementType = this.managementList.some(item => item.ManagementPrecision == |
|
|
|
'BY_BATCH') ? 'BY_BATCH' : '' |
|
|
|
if (this.managementType == 'BY_BATCH') { |
|
|
|
let detail = this.detailSource.find(r => r.itemCode == packInfo.itemCode && r.batch == packInfo |
|
|
|
.batch && r.inventoryStatus == "OK"); |
|
|
|
if (detail == undefined) { |
|
|
|
detail = this.createDetailInfo(packInfo); |
|
|
|
managementList.value = res.list |
|
|
|
managementType.value = managementList.value.some(item => item.ManagementPrecision === 'BY_BATCH') ? 'BY_BATCH' : '' |
|
|
|
if (managementType.value === 'BY_BATCH') { |
|
|
|
let detail = detailSource.value.find(r => r.itemCode === packInfo.itemCode && r.batch === packInfo.batch && r.inventoryStatus === 'OK') |
|
|
|
if (detail === undefined) { |
|
|
|
detail = createDetailInfo(packInfo) |
|
|
|
detail.packingNumber = '' |
|
|
|
detail.packUnit = '' |
|
|
|
this.detailSource.unshift(detail) |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
detailSource.value.unshift(detail) |
|
|
|
scanPopupGetFocus() |
|
|
|
} else { |
|
|
|
let index = this.detailSource.findIndex(r => r.itemCode == packInfo.itemCode && r.batch == packInfo |
|
|
|
.batch && r.inventoryStatus == "OK"); |
|
|
|
let index = detailSource.value.findIndex(r => r.itemCode === packInfo.itemCode && r.batch === packInfo.batch && r.inventoryStatus === 'OK') |
|
|
|
if (index >= 0) { |
|
|
|
this.detailSource.unshift(this.detailSource.splice(index, 1)[0]); //置顶 |
|
|
|
this.detailSource[0].qty = calc.add(this.detailSource[0].qty, packInfo.qty) |
|
|
|
detailSource.value.unshift(detailSource.value.splice(index, 1)[0]) // 置顶 |
|
|
|
detailSource.value[0].qty = calc.add(detailSource.value[0].qty, packInfo.qty) |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
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(packInfo); |
|
|
|
this.detailSource.unshift(detail) |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
let detail = detailSource.value.find(r => r.itemCode === packInfo.itemCode && r.packingNumber === packInfo.number && r.batch === packInfo.batch && r.inventoryStatus === 'OK') |
|
|
|
if (detail === undefined) { |
|
|
|
detail = createDetailInfo(packInfo) |
|
|
|
detailSource.value.unshift(detail) |
|
|
|
scanPopupGetFocus() |
|
|
|
} else { |
|
|
|
let index = this.detailSource.findIndex(r => r.itemCode == packInfo.itemCode && r.packingNumber == |
|
|
|
packInfo.number && r.batch == packInfo.batch && r.inventoryStatus == "OK"); |
|
|
|
let index = detailSource.value.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 => { |
|
|
|
detailSource.value.unshift(detailSource.value.splice(index, 1)[0]) // 置顶 |
|
|
|
// 提交 |
|
|
|
comMessage.value.showQuestionMessage('该箱码已经扫描,是否要编辑盘点明细?', res => { |
|
|
|
if (res) { |
|
|
|
this.closeScanPopup(); |
|
|
|
this.edit(detail); |
|
|
|
closeScanPopup() |
|
|
|
edit(detail) |
|
|
|
} else { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
scanPopupGetFocus() |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
// 创建盘盈的明细 |
|
|
|
createDetailInfo(packInfo) { |
|
|
|
const detail = { |
|
|
|
const createDetailInfo = (packInfo) => { |
|
|
|
return { |
|
|
|
scaned: true, |
|
|
|
// countDetailNumber: "", |
|
|
|
number: this.jobContent.number, |
|
|
|
number: jobContent.value.number, |
|
|
|
packingNumber: packInfo.number, |
|
|
|
batch: packInfo.batch, |
|
|
|
inventoryStatus: 'OK', |
|
|
@ -378,159 +337,153 @@ export default { |
|
|
|
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, |
|
|
|
locationCode: fromLocationCode.value, |
|
|
|
creator: store.id, |
|
|
|
warehouseCode: fromLocation.value.warehouseCode, |
|
|
|
areaCode: fromLocation.value.areaCode, |
|
|
|
locationGroupCode: fromLocation.value.locationGroupCode, |
|
|
|
createTime: new Date().getTime(), |
|
|
|
countTime: new Date().getTime(), |
|
|
|
countUser: this.$store.state.user.id, |
|
|
|
countUser: store.id, |
|
|
|
countDescription: '', |
|
|
|
countQty: packInfo.qty |
|
|
|
} |
|
|
|
return detail |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
swipeClick(e, item, index) { |
|
|
|
if (e.content.text == '编辑') { |
|
|
|
this.edit(item) |
|
|
|
} else if (e.content.text == '移除') { |
|
|
|
this.remove(item) |
|
|
|
const swipeClick = (e, item, index) => { |
|
|
|
if (e.content.text === '编辑') { |
|
|
|
edit(item) |
|
|
|
} else if (e.content.text === '移除') { |
|
|
|
remove(item, index) |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
// 编辑盘点结果 |
|
|
|
edit(item) { |
|
|
|
const that = this |
|
|
|
this.currentEditItem = item |
|
|
|
const edit = (item) => { |
|
|
|
currentEditItem.value = item |
|
|
|
item.handleQty = item.qty |
|
|
|
this.$refs.countQtyEdit.openEditPopup(item, null) |
|
|
|
}, |
|
|
|
|
|
|
|
editConfirm(qty, inventoryStatus, mode) { |
|
|
|
const that = this |
|
|
|
this.currentEditItem.countQty = qty |
|
|
|
this.currentEditItem.qty = qty |
|
|
|
this.currentEditItem.inventoryStatus = inventoryStatus |
|
|
|
this.openScanPopup() |
|
|
|
}, |
|
|
|
|
|
|
|
editClose() { |
|
|
|
this.scanPopupGetFocus() |
|
|
|
}, |
|
|
|
|
|
|
|
remove(item, index) { |
|
|
|
this.scanPopupLoseFocus(); |
|
|
|
this.showQuestionMessage('是否要移除扫描信息?', (res) => { |
|
|
|
countQtyEdit.value.openEditPopup(item, null) |
|
|
|
} |
|
|
|
|
|
|
|
const editConfirm = (qty, inventoryStatus, mode) => { |
|
|
|
currentEditItem.value.countQty = qty |
|
|
|
currentEditItem.value.qty = qty |
|
|
|
currentEditItem.value.inventoryStatus = inventoryStatus |
|
|
|
openScanPopup() |
|
|
|
} |
|
|
|
|
|
|
|
const editClose = () => { |
|
|
|
scanPopupGetFocus() |
|
|
|
} |
|
|
|
|
|
|
|
const remove = (item, index) => { |
|
|
|
scanPopupLoseFocus() |
|
|
|
comMessage.value.showQuestionMessage('是否要移除扫描信息?', res => { |
|
|
|
if (res) { |
|
|
|
this.detailSource.splice(index, 1) |
|
|
|
detailSource.value.splice(index, 1) |
|
|
|
} |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
scanPopupGetFocus() |
|
|
|
}) |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
detail(item) { |
|
|
|
this.showItem = item |
|
|
|
this.$refs.detailInfoPopup.openPopup(item) |
|
|
|
}, |
|
|
|
const detail = (item) => { |
|
|
|
showItem.value = item |
|
|
|
detailInfoPopup.value.openPopup(item) |
|
|
|
} |
|
|
|
|
|
|
|
commit() { |
|
|
|
if (this.detailSource.length == 0) { |
|
|
|
this.$refs.comMessage.showMessage('还未扫描,是否要继续提交', (res) => { |
|
|
|
const commit = () => { |
|
|
|
if (detailSource.value.length === 0) { |
|
|
|
comMessage.value.showMessage('还未扫描,是否要继续提交', res => { |
|
|
|
if (res) { |
|
|
|
this.commitJob() |
|
|
|
commitJob() |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.commitJob() |
|
|
|
commitJob() |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
commitJob() { |
|
|
|
uni.showLoading({ |
|
|
|
title: '提交中....', |
|
|
|
mask: true |
|
|
|
}) |
|
|
|
const params = this.setParams() |
|
|
|
const commitJob = () => { |
|
|
|
uni.showLoading({ title: '提交中....', mask: true }) |
|
|
|
const params = setParams() |
|
|
|
console.log('提交参数', JSON.stringify(params)) |
|
|
|
countJobSubmit(params) |
|
|
|
.then((res) => { |
|
|
|
.then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data == null) { |
|
|
|
this.showCommitSuccessMessage('提交成功') |
|
|
|
if (res.data === null) { |
|
|
|
showCommitSuccessMessage('提交成功') |
|
|
|
} else { |
|
|
|
this.showErrorMessage(`提交失败[${res.msg}]`) |
|
|
|
showErrorMessage(`提交失败[${res.msg}]`) |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
.catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(error) |
|
|
|
showErrorMessage(error) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
setParams() { |
|
|
|
const creator = this.$store.state.user.id |
|
|
|
this.jobContent.subList = this.detailSource |
|
|
|
// this.jobContent.creator = creator; |
|
|
|
return this.jobContent |
|
|
|
}, |
|
|
|
|
|
|
|
showMessage(message) { |
|
|
|
this.scanPopupLoseFocus(); |
|
|
|
this.$refs.comMessage.showMessage(message, (res) => { |
|
|
|
} |
|
|
|
|
|
|
|
const setParams = () => { |
|
|
|
const creator = store.id |
|
|
|
jobContent.value.subList = detailSource.value |
|
|
|
// jobContent.value.creator = creator; |
|
|
|
return jobContent.value |
|
|
|
} |
|
|
|
|
|
|
|
const showMessage = (message) => { |
|
|
|
scanPopupLoseFocus() |
|
|
|
comMessage.value.showMessage(message, res => { |
|
|
|
if (res) { |
|
|
|
this.afterCloseMessage() |
|
|
|
afterCloseMessage() |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
showErrorMessage(message) { |
|
|
|
this.scanPopupLoseFocus(); |
|
|
|
this.$refs.comMessage.showErrorMessage(message, (res) => { |
|
|
|
} |
|
|
|
|
|
|
|
const showErrorMessage = (message) => { |
|
|
|
scanPopupLoseFocus() |
|
|
|
comMessage.value.showErrorMessage(message, res => { |
|
|
|
if (res) { |
|
|
|
this.afterCloseMessage() |
|
|
|
afterCloseMessage() |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
showScanMessage(message) { |
|
|
|
this.$refs.comMessage.showScanMessage(message) |
|
|
|
}, |
|
|
|
|
|
|
|
afterCloseMessage() { |
|
|
|
this.scanPopupGetFocus() |
|
|
|
}, |
|
|
|
|
|
|
|
closeScanMessage() { |
|
|
|
this.scanPopupGetFocus() |
|
|
|
}, |
|
|
|
|
|
|
|
showCommitSuccessMessage(hint) { |
|
|
|
this.$refs.comMessage.showSuccessMessage(hint, (res) => { |
|
|
|
this.fromLocationCode = '' |
|
|
|
this.fromLocation = {} |
|
|
|
this.detailSource = [] |
|
|
|
this.showFromLocationPopup() |
|
|
|
} |
|
|
|
|
|
|
|
const showScanMessage = (message) => { |
|
|
|
comMessage.value.showScanMessage(message) |
|
|
|
} |
|
|
|
|
|
|
|
const afterCloseMessage = () => { |
|
|
|
scanPopupGetFocus() |
|
|
|
} |
|
|
|
|
|
|
|
const closeScanMessage = () => { |
|
|
|
scanPopupGetFocus() |
|
|
|
} |
|
|
|
|
|
|
|
const showCommitSuccessMessage = (hint) => { |
|
|
|
comMessage.value.showSuccessMessage(hint, res => { |
|
|
|
fromLocationCode.value = '' |
|
|
|
fromLocation.value = {} |
|
|
|
detailSource.value = [] |
|
|
|
showFromLocationPopup() |
|
|
|
}) |
|
|
|
}, |
|
|
|
getCountStageName(value) { |
|
|
|
} |
|
|
|
|
|
|
|
const getCountStageName = (value) => { |
|
|
|
return getCountStageName(value) |
|
|
|
}, |
|
|
|
isOpenCount(value) { |
|
|
|
return value == 'TRUE' ? '明盘' : '盲盘' |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
const isOpenCount = (value) => { |
|
|
|
return value === 'TRUE' ? '明盘' : '盲盘' |
|
|
|
} |
|
|
|
|
|
|
|
getCountScopeName(value) { |
|
|
|
const getCountScopeName = (value) => { |
|
|
|
const item = getCountScopeType(value) |
|
|
|
return item.label |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
showQuestionMessage(message, callback) { |
|
|
|
this.$refs.comMessage.showQuestionMessage(message, (res) => { |
|
|
|
const showQuestionMessage = (message, callback) => { |
|
|
|
comMessage.value.showQuestionMessage(message, res => { |
|
|
|
callback(res) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|