|
@ -8,7 +8,7 @@ |
|
|
<view class="cell_box uni-flex uni-row" style="font-weight: bold"> |
|
|
<view class="cell_box uni-flex uni-row" style="font-weight: bold"> |
|
|
<view class="cell_info" style="color: #000"> |
|
|
<view class="cell_info" style="color: #000"> |
|
|
<view class="text_lightblue" style="color: #000">阶段</view> |
|
|
<view class="text_lightblue" style="color: #000">阶段</view> |
|
|
<view style="color: #000">{{ getCountStageName(jobContent.stage) }}</view> |
|
|
<view style="color: #000">{{ getCountStageNameValue(jobContent.stage) }}</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="cell_info"> |
|
|
<view class="cell_info"> |
|
|
<view class="text_lightblue" style="color: #000">策略</view> |
|
|
<view class="text_lightblue" style="color: #000">策略</view> |
|
@ -29,8 +29,8 @@ |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<u-line color="#D8D8D8" style="margin-bottom: 15rpx"></u-line> |
|
|
<u-line color="#D8D8D8" style="margin-bottom: 10rpx"></u-line> |
|
|
<view style="margin-top: 170rpx; padding-bottom: 130rpx"> |
|
|
<view style="margin-top: 160rpx; padding-bottom: 130rpx"> |
|
|
<u-line color="#D8D8D8" style="margin-bottom: 15rpx"></u-line> |
|
|
<u-line color="#D8D8D8" style="margin-bottom: 15rpx"></u-line> |
|
|
<scroll-view scroll-y="true" class="" style="margin-bottom: 0px"> |
|
|
<scroll-view scroll-y="true" class="" style="margin-bottom: 0px"> |
|
|
<view class="detail-list" v-for="(item, index) in showList" :key="item.id"> |
|
|
<view class="detail-list" v-for="(item, index) in showList" :key="item.id"> |
|
@ -59,95 +59,83 @@ |
|
|
|
|
|
|
|
|
<win-scan-button @goScan="openScanPopup"></win-scan-button> |
|
|
<win-scan-button @goScan="openScanPopup"></win-scan-button> |
|
|
<win-scan-pack-and-location ref="scanPopup" :noShowBalanceMessage="true" @getCountScanResult="getScanResult"> </win-scan-pack-and-location> |
|
|
<win-scan-pack-and-location ref="scanPopup" :noShowBalanceMessage="true" @getCountScanResult="getScanResult"> </win-scan-pack-and-location> |
|
|
<count-qty-edit ref="countQtyEdit" @confirm="editConfirm" @close="editClose" :isShowStatus="true" :allowEditStatus="editInventoryStatus" :isShowBalance="jobContent.isOpenCount == 'TRUE'"> </count-qty-edit> |
|
|
<count-qty-edit ref="countQtyEditRef" @confirm="editConfirm" @close="editClose" :isShowStatus="true" :allowEditStatus="editInventoryStatus" :isShowBalance="jobContent.isOpenCount == 'TRUE'"> </count-qty-edit> |
|
|
<detail-info-popup ref="detailInfoPopup"></detail-info-popup> |
|
|
<detail-info-popup ref="detailInfoPopupRef"></detail-info-popup> |
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
<com-message ref="comMessageRef" /> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script setup lang="ts"> |
|
|
import { Decimal } from 'decimal.js' // 引入 |
|
|
import { ref, getCurrentInstance, onMounted, nextTick, watch } from 'vue' |
|
|
|
|
|
import { onShow, onNavigationBarButtonTap, onReady, onReachBottom, onPullDownRefresh, onLoad, onBackPress } from '@dcloudio/uni-app' |
|
|
import { getCountJobDetail, takeCountJob, cancleTakeCountJob, countJobSubmit } from '@/api/request2.js' |
|
|
import { getCountJobDetail, takeCountJob, cancleTakeCountJob, countJobSubmit } from '@/api/request2.js' |
|
|
import { calc } from '@/common/calc.js' |
|
|
|
|
|
|
|
|
|
|
|
import { goHome, navigateBack, getPackingNumberAndBatch, compare } from '@/common/basic.js' |
|
|
import { goHome, navigateBack, compare } from '@/common/basic.js' |
|
|
import { getCountStageName } from '@/common/directory.js' |
|
|
|
|
|
|
|
|
|
|
|
import { getDetailOption, getDetailEditRemoveOption, getClearOption } from '@/common/array.js' |
|
|
import { getDetailOption, getDetailEditRemoveOption } from '@/common/array.js' |
|
|
|
|
|
import { getCountStageName } from '@/common/directory.js' |
|
|
|
|
|
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
import winScanPack from '@/mycomponents/scan/winScanPack.vue' |
|
|
|
|
|
import comCountDetailcards from '@/pages/count/coms/comCountDetailcards.vue' |
|
|
import comCountDetailcards from '@/pages/count/coms/comCountDetailcards.vue' |
|
|
import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.vue' |
|
|
import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.vue' |
|
|
import countQtyEdit from '@/mycomponents/qty/countQtyEdit.vue' |
|
|
import countQtyEdit from '@/mycomponents/qty/countQtyEdit.vue' |
|
|
import jobTop from '@/mycomponents/job/jobTop.vue' |
|
|
import jobTop from '@/mycomponents/job/jobTop.vue' |
|
|
import detailInfoPopup from '@/pages/count/coms/detailInfoPopup.vue' |
|
|
import detailInfoPopup from '@/pages/count/coms/detailInfoPopup.vue' |
|
|
|
|
|
import { useCountStore } from '@/store' |
|
|
export default { |
|
|
// 获取自定义的store |
|
|
name: 'receipt_detail', |
|
|
const store = useCountStore() |
|
|
components: { |
|
|
|
|
|
winScanButton, |
|
|
const { proxy } = getCurrentInstance() |
|
|
winScanPack, |
|
|
|
|
|
comCountDetailcards, |
|
|
const id = ref('') |
|
|
winScanPackAndLocation, |
|
|
const fromLocationCode = ref('') |
|
|
countQtyEdit, |
|
|
const jobContent = ref({}) // 任务内容 |
|
|
jobTop, |
|
|
const editInventoryStatus = ref(false) |
|
|
detailInfoPopup |
|
|
const currentEditItem = ref({}) |
|
|
}, |
|
|
const jobStatus = ref('') |
|
|
data() { |
|
|
const allCount = ref(0) |
|
|
return { |
|
|
const scanCount = ref(0) |
|
|
id: '', |
|
|
const index = ref(0) |
|
|
receiptJob: {}, |
|
|
const pageSize = ref(20) |
|
|
fromLocationCode: '', |
|
|
const showList = ref([]) |
|
|
isShowPackingCode: true, |
|
|
const loadingType = ref('') |
|
|
jobContent: {}, // 任务内容 |
|
|
const allDetails = ref([]) |
|
|
subList: [], // 接口返回的任务subList |
|
|
const scanOptions = ref([]) |
|
|
detailSource: [], // 绑定在页面上的数据源 |
|
|
const detailOptions = ref([]) |
|
|
balance: {}, // 库存余额 |
|
|
const detailInfoPopupRef = ref() |
|
|
editInventoryStatus: false, |
|
|
const showItem = ref() |
|
|
package: {}, // 包装 |
|
|
const comMessageRef = ref() |
|
|
label: {}, // 标签 |
|
|
const scanPopup = ref() |
|
|
currentEditItem: {}, |
|
|
const countQtyEditRef = ref() |
|
|
jobStatus: '', |
|
|
|
|
|
allCount: 0, |
|
|
onLoad((option) => { |
|
|
scanCount: 0, |
|
|
id.value = option.id |
|
|
index: 0, |
|
|
if (id.value != undefined) { |
|
|
pageSize: 20, |
|
|
|
|
|
showList: [], |
|
|
|
|
|
loadingType: '', |
|
|
|
|
|
allDetails: [], |
|
|
|
|
|
scanOptions: [], |
|
|
|
|
|
detailOptions: [] |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
onLoad(option) { |
|
|
|
|
|
this.id = option.id |
|
|
|
|
|
if (this.id != undefined) { |
|
|
|
|
|
// 新建的任务自动接收 |
|
|
// 新建的任务自动接收 |
|
|
if (option.status == '1') { |
|
|
if (option.status == '1') { |
|
|
this.receive((callback) => { |
|
|
receive((callback) => { |
|
|
this.getDetail() |
|
|
getDetail() |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
this.getDetail() |
|
|
getDetail() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
this.detailOptions = getDetailOption() |
|
|
detailOptions.value = getDetailOption() |
|
|
this.scanOptions = getDetailEditRemoveOption() |
|
|
scanOptions.value = getDetailEditRemoveOption() |
|
|
}, |
|
|
}) |
|
|
// 返回首页 |
|
|
// 返回首页 |
|
|
onNavigationBarButtonTap(e) { |
|
|
onNavigationBarButtonTap((e) => { |
|
|
if (e.index === 0) { |
|
|
if (e.index === 0) { |
|
|
goHome() |
|
|
goHome() |
|
|
} |
|
|
} |
|
|
}, |
|
|
}) |
|
|
// 拦截返回按钮事件 |
|
|
// 拦截返回按钮事件 |
|
|
onBackPress(e) { |
|
|
onBackPress((e) => { |
|
|
// 已经接收但是没提交任务 |
|
|
// 已经接收但是没提交任务 |
|
|
if (e.from === 'backbutton') { |
|
|
if (e.from === 'backbutton') { |
|
|
if (this.jobStatus == '2') { |
|
|
if (jobStatus.value == '2') { |
|
|
// 取消承接任务 |
|
|
// 取消承接任务 |
|
|
cancleTakeCountJob(this.id) |
|
|
cancleTakeCountJob(id.value) |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
|
uni.navigateBack() |
|
|
uni.navigateBack() |
|
|
}) |
|
|
}) |
|
@ -159,144 +147,139 @@ export default { |
|
|
} |
|
|
} |
|
|
return true |
|
|
return true |
|
|
} |
|
|
} |
|
|
}, |
|
|
}) |
|
|
|
|
|
|
|
|
onPullDownRefresh() { |
|
|
onPullDownRefresh(() => { |
|
|
this.initList() |
|
|
initList() |
|
|
uni.stopPullDownRefresh() |
|
|
uni.stopPullDownRefresh() |
|
|
}, |
|
|
}) |
|
|
|
|
|
|
|
|
mounted() {}, |
|
|
onReachBottom(() => { |
|
|
onReachBottom() { |
|
|
|
|
|
console.log('onReachBottom') |
|
|
console.log('onReachBottom') |
|
|
// 避免多次触发 |
|
|
// 避免多次触发 |
|
|
if (this.loadingType == 'nomore') { |
|
|
if (loadingType.value == 'nomore') { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
this.index++ |
|
|
index.value++ |
|
|
const list = this.getDataPage(this.index, this.pageSize) |
|
|
const list = getDataPage(index.value, pageSize.value) |
|
|
if (list.length > 0) { |
|
|
if (list.length > 0) { |
|
|
// this.showList=list |
|
|
showList.value = showList.value.concat(list) |
|
|
this.showList = this.showList.concat(list) |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
// 没有更多了 |
|
|
// 没有更多了 |
|
|
this.loadingType = 'nomore' |
|
|
loadingType.value = 'nomore' |
|
|
} |
|
|
} |
|
|
}, |
|
|
}) |
|
|
methods: { |
|
|
|
|
|
// 接收 |
|
|
// 接收 |
|
|
receive(callback) { |
|
|
const receive = (callback) => { |
|
|
if (this.id != null) { |
|
|
if (id.value != null) { |
|
|
takeCountJob(this.id) |
|
|
takeCountJob(id.value) |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
|
callback() |
|
|
callback() |
|
|
}) |
|
|
}) |
|
|
.catch((error) => { |
|
|
.catch((error) => { |
|
|
this.showErrorMessage(error) |
|
|
showErrorMessage(error) |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}, |
|
|
} |
|
|
|
|
|
|
|
|
getDetail() { |
|
|
const getDetail = () => { |
|
|
const that = this |
|
|
|
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: '加载中....', |
|
|
title: '加载中....', |
|
|
mask: true |
|
|
mask: true |
|
|
}) |
|
|
}) |
|
|
getCountJobDetail(that.id) |
|
|
getCountJobDetail(id.value) |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
if (res.data == null) { |
|
|
if (res.data == null) { |
|
|
that.showMessage('未获取到详情') |
|
|
showMessage('未获取到详情') |
|
|
} else { |
|
|
} else { |
|
|
that.jobContent = res.data |
|
|
jobContent.value = res.data |
|
|
that.jobStatus = res.data.status |
|
|
jobStatus.value = res.data.status |
|
|
that.fromLocationCode = that.jobContent.locationCode |
|
|
fromLocationCode.value = jobContent.value.locationCode |
|
|
res.data.subList.forEach((item) => { |
|
|
res.data.subList.forEach((item) => { |
|
|
item.recommendQty = item.qty |
|
|
item.recommendQty = item.qty |
|
|
item.handleQty = 0 |
|
|
item.handleQty = 0 |
|
|
item.countTime = new Date() |
|
|
item.countTime = new Date() |
|
|
item.fromLocationCode = that.fromLocationCode |
|
|
item.fromLocationCode = fromLocationCode.value |
|
|
}) |
|
|
}) |
|
|
that.allDetails = res.data.subList |
|
|
allDetails.value = res.data.subList |
|
|
that.allCount = res.data.subList.length |
|
|
allCount.value = res.data.subList.length |
|
|
that.initList() |
|
|
initList() |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.catch((error) => { |
|
|
.catch((error) => { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
this.showErrorMessage(error) |
|
|
showErrorMessage(error) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
} |
|
|
|
|
|
|
|
|
initList() { |
|
|
const initList = () => { |
|
|
this.index = 1 |
|
|
index.value = 1 |
|
|
this.showList = [] |
|
|
showList.value = [] |
|
|
this.loadingType = '' |
|
|
loadingType.value = '' |
|
|
this.showList = this.getDataPage(this.index, this.pageSize) |
|
|
showList.value = getDataPage(index.value, pageSize.value) |
|
|
}, |
|
|
} |
|
|
|
|
|
|
|
|
getDataPage(pageNo, pageSize) { |
|
|
const getDataPage = (pageNo, pageSize) => { |
|
|
// 计算总页数 |
|
|
// 计算总页数 |
|
|
const totalPages = Math.ceil(this.allCount / pageSize) |
|
|
const totalPages = Math.ceil(allCount.value / pageSize) |
|
|
// 当前页起始索引 |
|
|
// 当前页起始索引 |
|
|
const start = (pageNo - 1) * pageSize |
|
|
const start = (pageNo - 1) * pageSize |
|
|
const end = start + pageSize // 当前页结束索引 |
|
|
const end = start + pageSize // 当前页结束索引 |
|
|
return this.allDetails.slice(start, end) |
|
|
return allDetails.value.slice(start, end) |
|
|
}, |
|
|
} |
|
|
|
|
|
|
|
|
swipeClick(e, item) { |
|
|
const swipeClick = (e, item) => { |
|
|
if (e.content.text == '详情') { |
|
|
if (e.content.text == '详情') { |
|
|
this.detail(item) |
|
|
detail(item) |
|
|
} else if (e.content.text == '编辑') { |
|
|
} else if (e.content.text == '编辑') { |
|
|
this.editItem(item) |
|
|
editItem(item) |
|
|
} else if (e.content.text == '移除') { |
|
|
} else if (e.content.text == '移除') { |
|
|
this.remove(item) |
|
|
remove(item) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
const detail = (item) => { |
|
|
|
|
|
showItem.value = item |
|
|
|
|
|
detailInfoPopupRef.value.openPopup(item) |
|
|
} |
|
|
} |
|
|
}, |
|
|
|
|
|
detail(item) { |
|
|
|
|
|
this.showItem = item |
|
|
|
|
|
this.$refs.detailInfoPopup.openPopup(item) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
remove(item, index) { |
|
|
const remove = (item, index) => { |
|
|
this.$refs.comMessage.showQuestionMessage('确定移除扫描信息?', (res) => { |
|
|
comMessageRef.value.showQuestionMessage('确定移除扫描信息?', (res) => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
item.scaned = false |
|
|
item.scaned = false |
|
|
item.handleQty = 0 |
|
|
item.handleQty = 0 |
|
|
this.$emit('removePack') |
|
|
emit('removePack') |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
} |
|
|
|
|
|
|
|
|
updateData() {}, |
|
|
|
|
|
|
|
|
|
|
|
openScanPopup() { |
|
|
const openScanPopup = () => { |
|
|
const fromlocationList = [] |
|
|
const fromlocationList = [] |
|
|
fromlocationList.push(this.fromLocationCode) |
|
|
fromlocationList.push(fromLocationCode.value) |
|
|
this.$refs.scanPopup.openScanPopupForJob(this.fromLocationCode, fromlocationList, this.jobContent) |
|
|
scanPopup.value.openScanPopupForJob(fromLocationCode.value, fromlocationList, jobContent.value) |
|
|
}, |
|
|
} |
|
|
|
|
|
|
|
|
closeScanPopup() { |
|
|
const closeScanPopup = () => { |
|
|
if (this.$refs.scanPopup != undefined) { |
|
|
if (scanPopup.value != undefined) { |
|
|
this.$refs.scanPopup.closeScanPopup() |
|
|
scanPopup.value.closeScanPopup() |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
scanPopupGetFocus() { |
|
|
const scanPopupGetFocus = () => { |
|
|
if (this.$refs.scanPopup != undefined) { |
|
|
if (scanPopup.value != undefined) { |
|
|
this.$refs.scanPopup.packGetFocus() |
|
|
scanPopup.value.packGetFocus() |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
scanPopupLoseFocus() { |
|
|
const scanPopupLoseFocus = () => { |
|
|
if (this.$refs.scanPopup != undefined) { |
|
|
if (scanPopup.value != undefined) { |
|
|
this.$refs.scanPopup.packLoseFocus() |
|
|
scanPopup.value.packLoseFocus() |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 明盘 |
|
|
// 明盘 |
|
|
getScanResult(result) { |
|
|
const getScanResult = (result) => { |
|
|
const { itemCode } = result.label |
|
|
const { itemCode } = result.label |
|
|
const { packingNumber } = result.label |
|
|
const { packingNumber } = result.label |
|
|
const pack = result.package |
|
|
const pack = result.package |
|
@ -305,84 +288,84 @@ export default { |
|
|
const qty = result.balance ? result.balance.qty : 0 |
|
|
const qty = result.balance ? result.balance.qty : 0 |
|
|
|
|
|
|
|
|
// 按物料、箱码、批次、状态匹配 |
|
|
// 按物料、箱码、批次、状态匹配 |
|
|
const items = this.allDetails.filter((r) => r.itemCode === itemCode && r.packingNumber === packingNumber && r.batch === batch && r.inventoryStatus === inventoryStatus) |
|
|
const items = allDetails.value.filter((r) => r.itemCode === itemCode && r.packingNumber === packingNumber && r.batch === batch && r.inventoryStatus === inventoryStatus) |
|
|
// 不在任务列表中,是否添加库存 |
|
|
// 不在任务列表中,是否添加库存 |
|
|
if (items.length == 0) { |
|
|
if (items.length == 0) { |
|
|
this.$refs.comMessage.showQuestionMessage(`包装【${result.label.packingNumber}】不在任务列表中,是否要添加到列表中?`, (res) => { |
|
|
comMessageRef.value.showQuestionMessage(`包装【${result.label.packingNumber}】不在任务列表中,是否要添加到列表中?`, (res) => { |
|
|
// 创建盘点信息,标记为已经扫描 |
|
|
// 创建盘点信息,标记为已经扫描 |
|
|
if (res) { |
|
|
if (res) { |
|
|
const detail = this.createAddDetailInfo(pack, qty) |
|
|
const detail = createAddDetailInfo(pack, qty) |
|
|
detail.countTime = new Date() |
|
|
detail.countTime = new Date() |
|
|
this.allDetails.push(detail) |
|
|
allDetails.value.push(detail) |
|
|
this.updateList() |
|
|
updateList() |
|
|
this.$refs.countQtyEdit.openEditPopupShowSeconds(detail, null) |
|
|
countQtyEditRef.value.openEditPopupShowSeconds(detail, null) |
|
|
} else { |
|
|
} else { |
|
|
this.scanPopupGetFocus() |
|
|
scanPopupGetFocus() |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
const selectItem = items[0] |
|
|
const selectItem = items[0] |
|
|
// 已经扫描 |
|
|
// 已经扫描 |
|
|
if (selectItem.scaned) { |
|
|
if (selectItem.scaned) { |
|
|
this.$refs.comMessage.showQuestionMessage(`包装【${result.label.packingNumber}】已经完成盘点,是否要编辑盘点结果?`, (res) => { |
|
|
comMessageRef.value.showQuestionMessage(`包装【${result.label.packingNumber}】已经完成盘点,是否要编辑盘点结果?`, (res) => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
this.currentEditItem = selectItem |
|
|
currentEditItem.value = selectItem |
|
|
this.$refs.countQtyEdit.openEditPopup(selectItem, null) |
|
|
countQtyEditRef.value.openEditPopup(selectItem, null) |
|
|
} else { |
|
|
} else { |
|
|
this.scanPopupGetFocus() |
|
|
scanPopupGetFocus() |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
// 未扫描,赋值 |
|
|
// 未扫描,赋值 |
|
|
selectItem.scaned = true |
|
|
selectItem.scaned = true |
|
|
|
|
|
selectItem.balanceQty = Number(qty) |
|
|
selectItem.handleQty = Number(qty) |
|
|
selectItem.handleQty = Number(qty) |
|
|
selectItem.packQty = pack.packQty |
|
|
selectItem.packQty = pack.packQty |
|
|
selectItem.packUnit = pack.packUnit |
|
|
selectItem.packUnit = pack.packUnit |
|
|
|
|
|
|
|
|
this.$refs.countQtyEdit.openEditPopupShowSeconds(selectItem, null) |
|
|
countQtyEditRef.value.openEditPopupShowSeconds(selectItem, null) |
|
|
selectItem.countTime = new Date() |
|
|
selectItem.countTime = new Date() |
|
|
this.updateList() |
|
|
updateList() |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
editConfirm(qty, inventoryStatus, mode) { |
|
|
const editConfirm = (qty, inventoryStatus, mode) => { |
|
|
const that = this |
|
|
|
|
|
// 编辑 |
|
|
// 编辑 |
|
|
if (mode == 'edit') { |
|
|
if (mode == 'edit') { |
|
|
this.currentEditItem.handleQty = qty |
|
|
currentEditItem.value.handleQty = qty |
|
|
this.currentEditItem.inventoryStatus = inventoryStatus |
|
|
currentEditItem.value.inventoryStatus = inventoryStatus |
|
|
} |
|
|
} |
|
|
// 重新排序 |
|
|
// 重新排序 |
|
|
this.currentEditItem.countTime = new Date() |
|
|
currentEditItem.value.countTime = new Date() |
|
|
this.updateList() |
|
|
updateList() |
|
|
this.scanPopupGetFocus() |
|
|
scanPopupGetFocus() |
|
|
}, |
|
|
} |
|
|
|
|
|
|
|
|
updateList() { |
|
|
const updateList = () => { |
|
|
this.allDetails.sort(compare('countTime')) // 按扫描信息排序 |
|
|
allDetails.value.sort(compare('countTime')) // 按扫描信息排序 |
|
|
this.initList() |
|
|
initList() |
|
|
this.scanPopupLoseFocus() |
|
|
scanPopupLoseFocus() |
|
|
this.calcAllCount() |
|
|
calcAllCount() |
|
|
this.calcScanCount() |
|
|
calcScanCount() |
|
|
}, |
|
|
} |
|
|
|
|
|
|
|
|
calcAllCount() { |
|
|
const calcAllCount = () => { |
|
|
this.allCount = this.allDetails.length |
|
|
allCount.value = allDetails.value.length |
|
|
}, |
|
|
} |
|
|
|
|
|
|
|
|
calcScanCount() { |
|
|
const calcScanCount = () => { |
|
|
this.scanCount = this.allDetails.filter((r) => r.scaned === true).length |
|
|
scanCount.value = allDetails.value.filter((r) => r.scaned === true).length |
|
|
}, |
|
|
} |
|
|
|
|
|
|
|
|
editClose() { |
|
|
const editClose = () => { |
|
|
this.scanPopupGetFocus() |
|
|
scanPopupGetFocus() |
|
|
}, |
|
|
} |
|
|
|
|
|
|
|
|
// 创建盘盈的明细 |
|
|
// 创建盘盈的明细 |
|
|
createAddDetailInfo(pack, qty) { |
|
|
const createAddDetailInfo = (pack, qty) => { |
|
|
const detail = { |
|
|
const detail = { |
|
|
id: this.jobContent.masterId, // 新增的明细 |
|
|
id: jobContent.value.masterId, // 新增的明细 |
|
|
scaned: true, |
|
|
scaned: true, |
|
|
countDetailNumber: '', |
|
|
countDetailNumber: '', |
|
|
ownerCode: '', |
|
|
ownerCode: '', |
|
@ -405,125 +388,124 @@ export default { |
|
|
remark: '', |
|
|
remark: '', |
|
|
countQty: 0, |
|
|
countQty: 0, |
|
|
balanceQty: Number(qty), |
|
|
balanceQty: Number(qty), |
|
|
fromLocationCode: this.fromLocationCode, |
|
|
fromLocationCode: fromLocationCode.value, |
|
|
creator: this.$store.state.user.id, |
|
|
creator: store.id, |
|
|
countTime: new Date() |
|
|
countTime: new Date() |
|
|
} |
|
|
} |
|
|
return detail |
|
|
return detail |
|
|
}, |
|
|
} |
|
|
|
|
|
|
|
|
commit() { |
|
|
const commit = () => { |
|
|
this.calcAllCount() |
|
|
calcAllCount() |
|
|
this.calcScanCount() |
|
|
calcScanCount() |
|
|
|
|
|
|
|
|
if (this.scanCount == this.allCount) { |
|
|
if (scanCount.value == allCount.value) { |
|
|
this.submitJob() |
|
|
submitJob() |
|
|
} else if (this.scanCount < this.allCount) { |
|
|
} else if (scanCount.value < allCount.value) { |
|
|
// 扫描数量小于任务数量,判断是否允许部分提交 |
|
|
// 扫描数量小于任务数量,判断是否允许部分提交 |
|
|
if (this.jobContent.allowPartialComplete == 'TRUE') { |
|
|
if (jobContent.value.allowPartialComplete == 'TRUE') { |
|
|
// 提交 |
|
|
// 提交 |
|
|
this.$refs.comMessage.showQuestionMessage(`已经扫描[${this.scanCount}]总共[${this.allCount}],是否把未扫描的盘点数量设置为0?`, (res) => { |
|
|
comMessageRef.value.showQuestionMessage(`已经扫描[${scanCount.value}]总共[${allCount.value}],是否把未扫描的盘点数量设置为0?`, (res) => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
this.allDetails.forEach((item) => { |
|
|
allDetails.value.forEach((item) => { |
|
|
if (!item.scaned) { |
|
|
if (!item.scaned) { |
|
|
item.scaned = true |
|
|
item.scaned = true |
|
|
item.handleQty = 0 |
|
|
item.handleQty = 0 |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
this.submitJob() |
|
|
submitJob() |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
// 不允许部分提交,提示 |
|
|
// 不允许部分提交,提示 |
|
|
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交<br>' + `已经扫描[${this.scanCount}]总共[${this.getTotalCount()}]`, (res) => { |
|
|
comMessageRef.value.showErrorMessage('请完成扫描后,再进行提交<br>' + `已经扫描[${scanCount.value}]总共[${getTotalCount()}]`, (res) => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
this.openScanPopup() |
|
|
openScanPopup() |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
} |
|
|
|
|
|
|
|
|
submitJob() { |
|
|
const submitJob = () => { |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: '提交中....', |
|
|
title: '提交中....', |
|
|
mask: true |
|
|
mask: true |
|
|
}) |
|
|
}) |
|
|
const params = this.setParams() |
|
|
const params = setParams() |
|
|
console.log('提交参数', JSON.stringify(params)) |
|
|
countJobSubmit(params) |
|
|
// countJobSubmit(params).then(res => { |
|
|
.then((res) => { |
|
|
// uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
// if (res.data) { |
|
|
if (res.data) { |
|
|
// this.showCommitSuccessMessage("提交成功<br>生成盘点记录<br>" + res.data) |
|
|
showCommitSuccessMessage(`提交成功<br>生成盘点记录<br>${res.data}`) |
|
|
// } else { |
|
|
} else { |
|
|
// this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
showErrorMessage(`提交失败[${res.msg}]`) |
|
|
// } |
|
|
} |
|
|
// }).catch(error => { |
|
|
}) |
|
|
// uni.hideLoading() |
|
|
.catch((error) => { |
|
|
// this.showErrorMessage(error) |
|
|
uni.hideLoading() |
|
|
// }) |
|
|
showErrorMessage(error) |
|
|
}, |
|
|
}) |
|
|
|
|
|
} |
|
|
setParams() { |
|
|
|
|
|
|
|
|
const setParams = () => { |
|
|
const subList = [] |
|
|
const subList = [] |
|
|
const creator = this.$store.state.user.id |
|
|
const creator = store.id |
|
|
|
|
|
|
|
|
this.allDetails.forEach((item) => { |
|
|
allDetails.value.forEach((item) => { |
|
|
if (item.scaned) { |
|
|
if (item.scaned) { |
|
|
item.countQty = item.handleQty |
|
|
item.countQty = item.handleQty |
|
|
} |
|
|
} |
|
|
subList.push(item) |
|
|
subList.push(item) |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
this.jobContent.subList = subList |
|
|
jobContent.value.subList = subList |
|
|
this.jobContent.creator = creator |
|
|
jobContent.value.creator = creator |
|
|
return this.jobContent |
|
|
return jobContent.value |
|
|
}, |
|
|
} |
|
|
|
|
|
|
|
|
showMessage(message) { |
|
|
const showMessage = (message) => { |
|
|
this.$refs.comMessage.showMessage(message, (res) => { |
|
|
comMessageRef.value.showMessage(message, (res) => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
this.afterCloseMessage() |
|
|
afterCloseMessage() |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
} |
|
|
showErrorMessage(message) { |
|
|
const showErrorMessage = (message) => { |
|
|
this.$refs.comMessage.showErrorMessage(message, (res) => { |
|
|
comMessageRef.value.showErrorMessage(message, (res) => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
this.afterCloseMessage() |
|
|
afterCloseMessage() |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
} |
|
|
|
|
|
|
|
|
showScanMessage(message) { |
|
|
const showScanMessage = (message) => { |
|
|
this.$refs.comMessage.showScanMessage(message) |
|
|
comMessageRef.value.showScanMessage(message) |
|
|
}, |
|
|
} |
|
|
|
|
|
|
|
|
afterCloseMessage() { |
|
|
const afterCloseMessage = () => { |
|
|
this.scanPopupGetFocus() |
|
|
scanPopupGetFocus() |
|
|
}, |
|
|
} |
|
|
|
|
|
|
|
|
closeScanMessage() { |
|
|
const closeScanMessage = () => { |
|
|
this.scanPopupGetFocus() |
|
|
scanPopupGetFocus() |
|
|
}, |
|
|
} |
|
|
|
|
|
|
|
|
editItem(item) { |
|
|
const editItem = (item) => { |
|
|
this.currentEditItem = item |
|
|
currentEditItem.value = item |
|
|
this.$refs.countQtyEdit.openEditPopup(this.currentEditItem, null) |
|
|
countQtyEditRef.value.openEditPopup(this.currentEditItem, null) |
|
|
}, |
|
|
} |
|
|
|
|
|
|
|
|
showCommitSuccessMessage(hint) { |
|
|
const showCommitSuccessMessage = (hint) => { |
|
|
this.$refs.comMessage.showSuccessMessage(hint, (res) => { |
|
|
comMessageRef.value.showSuccessMessage(hint, (res) => { |
|
|
navigateBack(1) |
|
|
navigateBack(1) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
|
|
|
getCountStageName(value) { |
|
|
|
|
|
return getCountStageName(value) |
|
|
|
|
|
}, |
|
|
|
|
|
isOpenCount(value) { |
|
|
|
|
|
return value == 'TRUE' ? '明盘' : '盲盘' |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
const getCountStageNameValue = (value) => { |
|
|
|
|
|
return getCountStageName(value) |
|
|
} |
|
|
} |
|
|
|
|
|
const isOpenCount = (value) => { |
|
|
|
|
|
return value == 'TRUE' ? '明盘' : '盲盘' |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
@ -543,7 +525,9 @@ page { |
|
|
|
|
|
|
|
|
.header { |
|
|
.header { |
|
|
position: fixed; |
|
|
position: fixed; |
|
|
|
|
|
/* #ifdef H5 */ |
|
|
top: 88rpx; |
|
|
top: 88rpx; |
|
|
|
|
|
/* #endif */ |
|
|
left: 0; |
|
|
left: 0; |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
background-color: #fff; |
|
|
background-color: #fff; |
|
|