王志国
3 weeks ago
5 changed files with 772 additions and 846 deletions
@ -1,424 +1,401 @@ |
|||
<template> |
|||
<view class="page-wraper"> |
|||
<view class="page-main"> |
|||
<view class="page-header"> |
|||
<view class="header-view"> |
|||
<view class="header_job_top"> |
|||
<receive-top :dataContent="recordContent"></receive-top> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view v-if="detailSource.length>0" class="uni-flex uni-row " |
|||
style=";margin-top: 15rpx; margin-bottom: 15rpx; margin-left: 20rpx; text-align: right;"> |
|||
<view class="font_default" style="display: block; font-weight: bold;"> |
|||
整单接收 |
|||
</view> |
|||
<view class="uni-flex" style="margin-left: 20rpx; align-items: center; text-align: center;"> |
|||
<u-switch v-model="isAllReceived" active-color="#5FCB94" inactive-color="#eee" size="35" |
|||
@change="switchChange"></u-switch> |
|||
</view> |
|||
</view> |
|||
<scroll-view scroll-y="true"> |
|||
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|||
<view class=""> |
|||
<com-detail-card :dataContent="item" :index="index" :settingParam="recordContent" |
|||
@remove="updateData" :isShowToLocation="true" @updateData="updateData" |
|||
@openDetail="openDetail"> |
|||
</com-detail-card> |
|||
<view class='split_line'></view> |
|||
</view> |
|||
|
|||
</view> |
|||
</scroll-view> |
|||
</view> |
|||
|
|||
<view class="page-footer"> |
|||
<view class="uni-flex u-col-center space-between padding_10" |
|||
style="background-color:ghostwhite; width: 100%; "> |
|||
<view class=" uni-flex uni-row"> |
|||
<button class="btn_single_commit" style="width: 280rpx;" hover-class="btn_commit_after" |
|||
@click="reject">拒绝</button> |
|||
</view> |
|||
<view class=" uni-flex uni-row"> |
|||
<button class="btn_single_commit" style="width: 280rpx;" hover-class="btn_commit_after" |
|||
@click="receive" :disabled="receiveDisable">接收</button> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|||
<win-scan-pack ref="scanPopup" @getResult='getScanResult' headerType="HPQ,HMQ">></win-scan-pack> |
|||
|
|||
<detail-info-popup ref="detailInfoPopup"></detail-info-popup> |
|||
|
|||
<comMessage ref="comMessage"></comMessage> |
|||
</view> |
|||
<view class="page-wraper"> |
|||
<view class="page-main"> |
|||
<view class="page-header"> |
|||
<view class="header-view"> |
|||
<view class="header_job_top"> |
|||
<receive-top :dataContent="recordContent"></receive-top> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view v-if="detailSource.length>0" class="uni-flex uni-row " |
|||
style=";margin-top: 15rpx; margin-bottom: 15rpx; margin-left: 20rpx; text-align: right;"> |
|||
<view class="font_default" style="display: block; font-weight: bold;"> |
|||
整单接收 |
|||
</view> |
|||
<view class="uni-flex" style="margin-left: 20rpx; align-items: center; text-align: center;"> |
|||
<u-switch v-model="isAllReceived" active-color="#5FCB94" inactive-color="#eee" size="35" |
|||
@change="switchChange"></u-switch> |
|||
</view> |
|||
</view> |
|||
<scroll-view scroll-y="true"> |
|||
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|||
<view class=""> |
|||
<com-detail-card :dataContent="item" :index="index" :settingParam="recordContent" |
|||
@remove="updateData" :isShowToLocation="true" @updateData="updateData" |
|||
@openDetail="openDetail"> |
|||
</com-detail-card> |
|||
<view class='split_line'></view> |
|||
</view> |
|||
|
|||
</view> |
|||
</scroll-view> |
|||
</view> |
|||
|
|||
<view class="page-footer"> |
|||
<view class="uni-flex u-col-center space-between padding_10" |
|||
style="background-color:ghostwhite; width: 100%; "> |
|||
<view class=" uni-flex uni-row"> |
|||
<button class="btn_single_commit" style="width: 280rpx;" hover-class="btn_commit_after" |
|||
@click="reject">拒绝 |
|||
</button> |
|||
</view> |
|||
<view class=" uni-flex uni-row"> |
|||
<button class="btn_single_commit" style="width: 280rpx;" hover-class="btn_commit_after" |
|||
@click="receive" :disabled="receiveDisable">接收 |
|||
</button> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|||
<win-scan-pack ref="scanPopup" @getResult='getScanResult' headerType="HPQ,HMQ">></win-scan-pack> |
|||
|
|||
<detail-info-popup ref="detailInfoPopup"></detail-info-popup> |
|||
|
|||
<comMessage ref="comMessage"></comMessage> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
|
|||
import { |
|||
getCustomerReturnRecordDetail, |
|||
customerReturnRecordRefuse, |
|||
customerReturnRecordReceive, |
|||
} from '@/api/request2.js'; |
|||
import { |
|||
goHome, |
|||
navigateBack, |
|||
getCurrDateTime, |
|||
getInventoryStatusName, |
|||
getSwitchInfoByCode |
|||
} from '@/common/basic.js'; |
|||
import { |
|||
getDataSource, |
|||
calcHandleQty, |
|||
getScanCount |
|||
} from '@/common/detail.js'; |
|||
|
|||
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|||
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue" |
|||
import detailInfoPopup from '@/pages/productionReceipt/coms/detailInfoPopup.vue' |
|||
import receiveTop from '@/mycomponents/receive/receiveTop.vue' |
|||
import winScanPack from '@/mycomponents/scan/winScanPack.vue' |
|||
|
|||
export default { |
|||
components: { |
|||
winScanButton, |
|||
winScanPack, |
|||
comDetailCard, |
|||
detailInfoPopup, |
|||
receiveTop |
|||
}, |
|||
data() { |
|||
return { |
|||
id: '', |
|||
scanCount: 0, |
|||
recordContent: {}, //任务内容 |
|||
subList: [], //接口返回的任务subList |
|||
detailSource: [], //绑定在页面上的数据源 |
|||
fromLocationCode: "", |
|||
toLocationCode: "", |
|||
isAllReceived: false, |
|||
receiveDisable: true //默认不可点击 |
|||
}; |
|||
}, |
|||
onLoad(option) { |
|||
uni.setNavigationBarTitle({ |
|||
title: option.title + '详情' |
|||
}) |
|||
this.id = option.id; |
|||
if (this.id != undefined) { |
|||
//新建的任务自动接收 |
|||
if (option.receiveStatus == "0") { |
|||
this.getDetail(); |
|||
} |
|||
} |
|||
}, |
|||
//返回首页 |
|||
onNavigationBarButtonTap(e) { |
|||
if (e.index === 0) { |
|||
goHome(); |
|||
} |
|||
}, |
|||
//拦截返回按钮事件 |
|||
onBackPress(e) { |
|||
//已经接收但是没提交任务 |
|||
if (e.from == 'backbutton') { |
|||
uni.navigateBack(); |
|||
return true; |
|||
} |
|||
}, |
|||
|
|||
|
|||
mounted() { |
|||
|
|||
}, |
|||
methods: { |
|||
//接收 |
|||
getDetail() { |
|||
var that = this; |
|||
uni.showLoading({ |
|||
title: "加载中....", |
|||
mask: true |
|||
}); |
|||
getCustomerReturnRecordDetail(that.id).then(res => { |
|||
uni.hideLoading(); |
|||
this.isAllReceived= false |
|||
this.receiveDisable = true |
|||
if (res.data == null) { |
|||
that.showMessage('未获取到详情'); |
|||
} else { |
|||
if (res.data.list.length > 0) { |
|||
that.recordContent = res.data.list[0]; |
|||
that.subList = res.data.list; |
|||
that.subList.forEach(item => { |
|||
item.batch = item.toBatch; |
|||
item.packingNumber = item.toPackingNumber; |
|||
}) |
|||
that.detailSource = getDataSource(that.subList) |
|||
} else { |
|||
that.showMessage('列表数据为0'); |
|||
} |
|||
} |
|||
}).catch(error => { |
|||
uni.hideLoading() |
|||
this.showErrorMessage(error) |
|||
}) |
|||
}, |
|||
|
|||
calcHandleQty() { |
|||
calcHandleQty(this.detailSource); |
|||
this.updateBtn() |
|||
this.continueScan() |
|||
this.$forceUpdate(); |
|||
}, |
|||
|
|||
updateBtn() { |
|||
this.scanCount = getScanCount(this.subList); |
|||
//扫描数量和任务数量相等,直接提交 |
|||
if (this.scanCount == this.subList.length) { |
|||
this.receiveDisable = false; |
|||
}else { |
|||
this.receiveDisable = true; |
|||
} |
|||
}, |
|||
|
|||
//继续扫描 |
|||
continueScan() { |
|||
this.scanCount = getScanCount(this.subList); |
|||
if (this.scanCount == this.subList.length) { |
|||
this.closeScanPopup(); |
|||
} else { |
|||
this.scanPopupGetFocus(); |
|||
} |
|||
}, |
|||
|
|||
updateData() { |
|||
this.calcHandleQty(); |
|||
this.updateBtn() |
|||
}, |
|||
|
|||
openDetail(item) { |
|||
this.$refs.detailInfoPopup.openPopup(item) |
|||
}, |
|||
|
|||
openScanPopup() { |
|||
this.$refs.scanPopup.openScanPopup(); |
|||
}, |
|||
|
|||
closeScanPopup() { |
|||
this.$refs.scanPopup.closeScanPopup(); |
|||
}, |
|||
|
|||
getScanResult(result) { |
|||
try { |
|||
var itemCode = result.label.itemCode; |
|||
var packingNumber = result.package.number; |
|||
var batch = result.label.batch; |
|||
var detail = this.detailSource.find(r => r.itemCode == itemCode); |
|||
|
|||
if (detail == undefined) { |
|||
this.showErrorMessage("物料号【" + itemCode + "】不在列表中") |
|||
} else { |
|||
var itemDetail = detail.subList.find(r => { |
|||
return r.packingNumber == packingNumber && |
|||
r.batch == batch |
|||
}) |
|||
if (itemDetail == undefined) { |
|||
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]不在列表中") |
|||
} else { |
|||
if (itemDetail.scaned) { |
|||
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]已经扫描") |
|||
} else { |
|||
itemDetail.scaned = true; |
|||
itemDetail.handleQty = Number(itemDetail.qty) |
|||
this.calcHandleQty(); |
|||
} |
|||
} |
|||
} |
|||
} catch (e) { |
|||
this.showMessage(e.message) |
|||
} |
|||
}, |
|||
reject() { |
|||
this.showQuestionMessage("是否拒绝接收?", res => { |
|||
if (res) { |
|||
uni.showLoading({ |
|||
title: "提交中....", |
|||
mask: true |
|||
}); |
|||
customerReturnRecordRefuse(this.id).then(res=>{ |
|||
uni.hideLoading() |
|||
if(res.data){ |
|||
this.showCommitSuccessMessage("拒绝成功") |
|||
}else { |
|||
this.showErrorMessage("拒绝失败[" + res.msg + "]") |
|||
} |
|||
}).catch(error=>{ |
|||
uni.hideLoading() |
|||
this.showErrorMessage(error) |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
receive() { |
|||
this.scanCount = getScanCount(this.subList); |
|||
if (this.scanCount == 0) { |
|||
this.showErrorMessage("扫描数为0,请先扫描") |
|||
return; |
|||
} |
|||
if (this.scanCount < this.subList.length) { |
|||
this.showErrorMessage("还有未扫描的数据,请先扫描") |
|||
return; |
|||
} |
|||
|
|||
//扫描数量和任务数量相等,直接提交 |
|||
if (this.scanCount == this.subList.length) { |
|||
this.receiveSubmit(); |
|||
} |
|||
}, |
|||
|
|||
showMessageHint(hint, callback) { |
|||
this.$refs.comMessage.showErrorMessage(hint, res => { |
|||
if (res) { |
|||
callback() |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
receiveSubmit() { |
|||
uni.showLoading({ |
|||
title: "提交中....", |
|||
mask: true |
|||
}); |
|||
customerReturnRecordReceive(this.id).then(res => { |
|||
uni.hideLoading() |
|||
if (res.data) { |
|||
this.showCommitSuccessMessage("接收成功") |
|||
} else { |
|||
this.showErrorMessage("接收失败[" + res.msg + "]") |
|||
} |
|||
}).catch(error => { |
|||
uni.hideLoading() |
|||
this.showErrorMessage(error) |
|||
}) |
|||
}, |
|||
|
|||
showMessage(message) { |
|||
setTimeout(r => { |
|||
this.scanPopupLoseFocus(); |
|||
this.$refs.comMessage.showMessage(message, res => { |
|||
if (res) { |
|||
this.afterCloseMessage() |
|||
} |
|||
}); |
|||
}) |
|||
}, |
|||
|
|||
showErrorMessage(message) { |
|||
setTimeout(r => { |
|||
this.scanPopupLoseFocus(); |
|||
this.$refs.comMessage.showErrorMessage(message, res => { |
|||
if (res) { |
|||
this.afterCloseMessage() |
|||
} |
|||
}); |
|||
}) |
|||
}, |
|||
|
|||
showQuestionMessage(message, callback) { |
|||
setTimeout(r => { |
|||
this.scanPopupLoseFocus(); |
|||
this.$refs.comMessage.showQuestionMessage(message, res => { |
|||
if (res) { |
|||
callback(res); |
|||
} |
|||
}); |
|||
}) |
|||
}, |
|||
|
|||
scanPopupGetFocus() { |
|||
if (this.$refs.scanPopup) { |
|||
this.$refs.scanPopup.getfocus(); |
|||
} |
|||
}, |
|||
|
|||
scanPopupLoseFocus() { |
|||
if (this.$refs.scanPopup) { |
|||
this.$refs.scanPopup.losefocus(); |
|||
} |
|||
}, |
|||
|
|||
afterCloseMessage() { |
|||
this.scanPopupGetFocus(); |
|||
}, |
|||
|
|||
|
|||
showCommitSuccessMessage(hint) { |
|||
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|||
navigateBack(1) |
|||
}) |
|||
}, |
|||
|
|||
switchChange(isOn) { |
|||
this.isAllReceived = isOn |
|||
if(this.isAllReceived){ |
|||
this.detailSource.forEach(item=>{ |
|||
item.subList.forEach(info=>{ |
|||
info.scaned=true; |
|||
info.handleQty=Number(info.qty) |
|||
}) |
|||
}) |
|||
this.calcHandleQty(); |
|||
}else { |
|||
this.$refs.comMessage.showQuestionMessage("是否要关闭整单收货?", res => { |
|||
if (res) { |
|||
this.getDetail() |
|||
} else { |
|||
this.isAllReceived=true |
|||
} |
|||
}); |
|||
} |
|||
|
|||
} |
|||
} |
|||
} |
|||
<script setup lang="ts"> |
|||
|
|||
import { |
|||
getCustomerReturnRecordDetail, |
|||
customerReturnRecordRefuse, |
|||
customerReturnRecordReceive, |
|||
} from '@/api/request2.js'; |
|||
import { |
|||
goHome, |
|||
navigateBack, |
|||
getCurrDateTime, |
|||
getInventoryStatusName, |
|||
getSwitchInfoByCode |
|||
} from '@/common/basic.js'; |
|||
import { |
|||
getDataSource, |
|||
calcHandleQty, |
|||
getScanCount |
|||
} from '@/common/detail.js'; |
|||
|
|||
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|||
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue" |
|||
import detailInfoPopup from '@/pages/productionReceipt/coms/detailInfoPopup.vue' |
|||
import receiveTop from '@/mycomponents/receive/receiveTop.vue' |
|||
import winScanPack from '@/mycomponents/scan/winScanPack.vue' |
|||
|
|||
import {ref} from 'vue'; |
|||
import { |
|||
onLoad, |
|||
onBackPress, |
|||
onNavigationBarButtonTap |
|||
} from '@dcloudio/uni-app'; |
|||
|
|||
const id = ref(null); |
|||
const isAllReceived = ref(false); |
|||
const receiveDisable = ref(true); |
|||
const recordContent = ref(null); |
|||
const subList = ref([]); |
|||
const detailSource = ref([]); |
|||
const scanCount = ref(0); |
|||
|
|||
const detailInfoPopup = ref(null); |
|||
const scanPopup = ref(null); |
|||
const comMessage = ref(null); |
|||
|
|||
onLoad((option) => { |
|||
uni.setNavigationBarTitle({ |
|||
title: option.title + '详情' |
|||
}); |
|||
id.value = option.id; |
|||
if (id.value !== undefined) { |
|||
// 新建的任务自动接收 |
|||
if (option.receiveStatus === "0") { |
|||
getDetail(); |
|||
} |
|||
} |
|||
}); |
|||
|
|||
onNavigationBarButtonTap((e) => { |
|||
if (e.index === 0) { |
|||
goHome(); |
|||
} |
|||
}); |
|||
|
|||
onBackPress((e) => { |
|||
// 已经接收但是没提交任务 |
|||
if (e.from === 'backbutton') { |
|||
uni.navigateBack(); |
|||
return true; |
|||
} |
|||
}); |
|||
|
|||
// 方法 |
|||
const getDetail = () => { |
|||
uni.showLoading({title: "加载中....", mask: true}); |
|||
getCustomerReturnRecordDetail(id.value).then((res) => { |
|||
uni.hideLoading(); |
|||
isAllReceived.value = false; |
|||
receiveDisable.value = true; |
|||
if (res.data == null) { |
|||
showMessage('未获取到详情'); |
|||
} else { |
|||
if (res.data.list.length > 0) { |
|||
recordContent.value = res.data.list[0]; |
|||
subList.value = res.data.list; |
|||
subList.value.forEach((item) => { |
|||
item.batch = item.toBatch; |
|||
item.packingNumber = item.toPackingNumber; |
|||
}); |
|||
detailSource.value = getDataSource(subList.value); |
|||
} else { |
|||
showMessage('列表数据为0'); |
|||
} |
|||
} |
|||
}).catch((error) => { |
|||
uni.hideLoading(); |
|||
showErrorMessage(error); |
|||
}); |
|||
}; |
|||
|
|||
const calcHandleQty = () => { |
|||
calcHandleQty(detailSource.value); |
|||
updateBtn(); |
|||
continueScan(); |
|||
}; |
|||
|
|||
const updateBtn = () => { |
|||
scanCount.value = getScanCount(subList.value); |
|||
// 扫描数量和任务数量相等,直接提交 |
|||
if (scanCount.value === subList.value.length) { |
|||
receiveDisable.value = false; |
|||
} else { |
|||
receiveDisable.value = true; |
|||
} |
|||
}; |
|||
|
|||
const continueScan = () => { |
|||
scanCount.value = getScanCount(subList.value); |
|||
if (scanCount.value === subList.value.length) { |
|||
closeScanPopup(); |
|||
} else { |
|||
scanPopupGetFocus(); |
|||
} |
|||
}; |
|||
|
|||
const updateData = () => { |
|||
calcHandleQty(); |
|||
updateBtn(); |
|||
}; |
|||
|
|||
const openDetail = (item) => { |
|||
detailInfoPopup.value.openPopup(item); |
|||
}; |
|||
|
|||
const openScanPopup = () => { |
|||
scanPopup.value.openScanPopup(); |
|||
}; |
|||
|
|||
const closeScanPopup = () => { |
|||
scanPopup.value.closeScanPopup(); |
|||
}; |
|||
|
|||
const getScanResult = (result) => { |
|||
try { |
|||
const itemCode = result.label.itemCode; |
|||
const packingNumber = result.package.number; |
|||
const batch = result.label.batch; |
|||
const detail = detailSource.value.find((r) => r.itemCode === itemCode); |
|||
|
|||
if (detail === undefined) { |
|||
showErrorMessage(`物料号【${itemCode}】不在列表中`); |
|||
} else { |
|||
const itemDetail = detail.subList.find((r) => r.packingNumber === packingNumber && r.batch === batch); |
|||
if (itemDetail === undefined) { |
|||
showErrorMessage(`箱码[${packingNumber}]批次[${batch}]不在列表中`); |
|||
} else { |
|||
if (itemDetail.scaned) { |
|||
showErrorMessage(`箱码[${packingNumber}]批次[${batch}]已经扫描`); |
|||
} else { |
|||
itemDetail.scaned = true; |
|||
itemDetail.handleQty = Number(itemDetail.qty); |
|||
calcHandleQty(); |
|||
} |
|||
} |
|||
} |
|||
} catch (e) { |
|||
showMessage(e.message); |
|||
} |
|||
}; |
|||
|
|||
const reject = () => { |
|||
showQuestionMessage("是否拒绝接收?", (res) => { |
|||
if (res) { |
|||
uni.showLoading({title: "提交中....", mask: true}); |
|||
customerReturnRecordRefuse(id.value).then((res) => { |
|||
uni.hideLoading(); |
|||
if (res.data) { |
|||
showCommitSuccessMessage("拒绝成功"); |
|||
} else { |
|||
showErrorMessage(`拒绝失败[${res.msg}]`); |
|||
} |
|||
}).catch((error) => { |
|||
uni.hideLoading(); |
|||
showErrorMessage(error); |
|||
}); |
|||
} |
|||
}); |
|||
}; |
|||
|
|||
const receive = () => { |
|||
scanCount.value = getScanCount(subList.value); |
|||
if (scanCount.value === 0) { |
|||
showErrorMessage("扫描数为0,请先扫描"); |
|||
return; |
|||
} |
|||
if (scanCount.value < subList.value.length) { |
|||
showErrorMessage("还有未扫描的数据,请先扫描"); |
|||
return; |
|||
} |
|||
|
|||
// 扫描数量和任务数量相等,直接提交 |
|||
if (scanCount.value === subList.value.length) { |
|||
receiveSubmit(); |
|||
} |
|||
}; |
|||
|
|||
const showMessageHint = (hint, callback) => { |
|||
comMessage.value.showErrorMessage(hint, (res) => { |
|||
if (res) { |
|||
callback(); |
|||
} |
|||
}); |
|||
}; |
|||
|
|||
const receiveSubmit = () => { |
|||
uni.showLoading({title: "提交中....", mask: true}); |
|||
customerReturnRecordReceive(id.value).then((res) => { |
|||
uni.hideLoading(); |
|||
if (res.data) { |
|||
showCommitSuccessMessage("接收成功"); |
|||
} else { |
|||
showErrorMessage(`接收失败[${res.msg}]`); |
|||
} |
|||
}).catch((error) => { |
|||
uni.hideLoading(); |
|||
showErrorMessage(error); |
|||
}); |
|||
}; |
|||
|
|||
const showMessage = (message) => { |
|||
setTimeout(() => { |
|||
scanPopupLoseFocus(); |
|||
comMessage.value.showMessage(message, (res) => { |
|||
if (res) { |
|||
afterCloseMessage(); |
|||
} |
|||
}); |
|||
}); |
|||
}; |
|||
|
|||
const showErrorMessage = (message) => { |
|||
setTimeout(() => { |
|||
scanPopupLoseFocus(); |
|||
comMessage.value.showErrorMessage(message, (res) => { |
|||
if (res) { |
|||
afterCloseMessage(); |
|||
} |
|||
}); |
|||
}); |
|||
}; |
|||
|
|||
const showQuestionMessage = (message, callback) => { |
|||
setTimeout(() => { |
|||
scanPopupLoseFocus(); |
|||
comMessage.value.showQuestionMessage(message, (res) => { |
|||
if (res) { |
|||
callback(res); |
|||
} |
|||
}); |
|||
}); |
|||
}; |
|||
|
|||
const scanPopupGetFocus = () => { |
|||
if (scanPopup.value) { |
|||
scanPopup.value.getfocus(); |
|||
} |
|||
}; |
|||
|
|||
const scanPopupLoseFocus = () => { |
|||
if (scanPopup.value) { |
|||
scanPopup.value.losefocus(); |
|||
} |
|||
}; |
|||
|
|||
const afterCloseMessage = () => { |
|||
scanPopupGetFocus(); |
|||
}; |
|||
|
|||
const showCommitSuccessMessage = (hint) => { |
|||
comMessage.value.showSuccessMessage(hint, (res) => { |
|||
navigateBack(1); |
|||
}); |
|||
}; |
|||
|
|||
const switchChange = (isOn) => { |
|||
isAllReceived.value = isOn; |
|||
if (isAllReceived.value) { |
|||
detailSource.value.forEach((item) => { |
|||
item.subList.forEach((info) => { |
|||
info.scaned = true; |
|||
info.handleQty = Number(info.qty); |
|||
}); |
|||
}); |
|||
calcHandleQty(); |
|||
} else { |
|||
comMessage.value.showQuestionMessage("是否要关闭整单收货?", (res) => { |
|||
if (res) { |
|||
getDetail(); |
|||
} else { |
|||
isAllReceived.value = true; |
|||
} |
|||
}); |
|||
} |
|||
}; |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
page { |
|||
width: 100%; |
|||
height: 100%; |
|||
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; |
|||
|
|||
} |
|||
page { |
|||
width: 100%; |
|||
height: 100%; |
|||
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> |
@ -1,48 +1,41 @@ |
|||
<template> |
|||
<view class=""> |
|||
<product-putaway-record :title="title" ref="productPutawayRecord" putawayType='assemble'></product-putaway-record> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import productPutawayRecord from '@/pages/productPutaway/record/productPutawayRecord.vue' |
|||
|
|||
export default { |
|||
components: { |
|||
productPutawayRecord |
|||
}, |
|||
data() { |
|||
return { |
|||
title:'' |
|||
}; |
|||
}, |
|||
onLoad(option){ |
|||
this.title = option.title |
|||
}, |
|||
|
|||
onShow() { |
|||
if(this.$refs.productPutawayRecord!=undefined){ |
|||
// this.$refs.productPutawayRecord.refresh(); |
|||
} |
|||
}, |
|||
|
|||
onPullDownRefresh() { |
|||
// this.$refs.productPutawayRecord.refresh(); |
|||
}, |
|||
onNavigationBarButtonTap(e) { |
|||
if (e.index === 0) { |
|||
this.$refs.productPutawayRecord.toHome(); |
|||
} else if (e.index == 1) { |
|||
this.$refs.productPutawayRecord.openFilter(); |
|||
} |
|||
}, |
|||
|
|||
methods: { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
|
|||
</style> |
|||
<template> |
|||
<view class=""> |
|||
<product-putaway-record :title="title" ref="productPutawayRecordRef" putawayType="assemble"></product-putaway-record> |
|||
</view> |
|||
</template> |
|||
|
|||
<script setup> |
|||
import { ref } from 'vue'; |
|||
import { onLoad, onShow, onPullDownRefresh, onNavigationBarButtonTap } from '@dcloudio/uni-app'; |
|||
import productPutawayRecord from '@/pages/productPutaway/record/productPutawayRecord.vue'; |
|||
|
|||
const title = ref(''); |
|||
const productPutawayRecordRef = ref(null); |
|||
|
|||
onLoad((option) => { |
|||
title.value = option.title; |
|||
}); |
|||
|
|||
onShow(() => { |
|||
if (productPutawayRecordRef.value) { |
|||
// productPutawayRecordRef.value.refresh(); |
|||
} |
|||
}); |
|||
|
|||
onPullDownRefresh(() => { |
|||
if (productPutawayRecordRef.value) { |
|||
// productPutawayRecordRef.value.refresh(); |
|||
} |
|||
}); |
|||
|
|||
onNavigationBarButtonTap((e) => { |
|||
if (e.index === 0) { |
|||
productPutawayRecordRef.value.toHome(); |
|||
} else if (e.index === 1) { |
|||
productPutawayRecordRef.value.openFilter(); |
|||
} |
|||
}); |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
</style> |
|||
|
@ -1,48 +1,41 @@ |
|||
<template> |
|||
<view class=""> |
|||
<product-putaway-record :title="title" ref="productPutawayRecord" putawayType='predict'></product-putaway-record> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import productPutawayRecord from '@/pages/productPutaway/record/productPutawayRecord.vue' |
|||
|
|||
export default { |
|||
components: { |
|||
productPutawayRecord |
|||
}, |
|||
data() { |
|||
return { |
|||
title:'' |
|||
}; |
|||
}, |
|||
onLoad(option){ |
|||
this.title = option.title |
|||
}, |
|||
|
|||
onShow() { |
|||
if(this.$refs.productPutawayRecord!=undefined){ |
|||
this.$refs.productPutawayRecord.refresh(); |
|||
} |
|||
}, |
|||
|
|||
onPullDownRefresh() { |
|||
this.$refs.productPutawayRecord.refresh(); |
|||
}, |
|||
onNavigationBarButtonTap(e) { |
|||
if (e.index === 0) { |
|||
this.$refs.productPutawayRecord.toHome(); |
|||
} else if (e.index == 1) { |
|||
this.$refs.productPutawayRecord.openFilter(); |
|||
} |
|||
}, |
|||
|
|||
methods: { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
|
|||
</style> |
|||
<view class=""> |
|||
<product-putaway-record :title="title" ref="productPutawayRecordRef" putawayType="predict"></product-putaway-record> |
|||
</view> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { ref } from 'vue'; |
|||
import { onLoad, onShow, onPullDownRefresh, onNavigationBarButtonTap } from '@dcloudio/uni-app'; |
|||
import productPutawayRecord from '@/pages/productPutaway/record/productPutawayRecord.vue'; |
|||
|
|||
const title = ref(''); |
|||
const productPutawayRecordRef = ref(null); |
|||
|
|||
onLoad((option) => { |
|||
title.value = option.title; |
|||
}); |
|||
|
|||
onShow(() => { |
|||
if (productPutawayRecordRef.value) { |
|||
productPutawayRecordRef.value.refresh(); |
|||
} |
|||
}); |
|||
|
|||
onPullDownRefresh(() => { |
|||
if (productPutawayRecordRef.value) { |
|||
productPutawayRecordRef.value.refresh(); |
|||
} |
|||
}); |
|||
|
|||
onNavigationBarButtonTap((e) => { |
|||
if (e.index === 0) { |
|||
productPutawayRecordRef.value.toHome(); |
|||
} else if (e.index === 1) { |
|||
productPutawayRecordRef.value.openFilter(); |
|||
} |
|||
}); |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
</style> |
|||
|
@ -1,48 +1,47 @@ |
|||
<template> |
|||
<view class=""> |
|||
<product-receipt-record :title="title" ref="productPutawayRecord" type='predict'></product-receipt-record> |
|||
</view> |
|||
<view class=""> |
|||
<product-receipt-record :title="title" ref="productReceiptRecordRef" type="predict"></product-receipt-record> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import productReceiptRecord from '@/pages/productReceipt/record/productReceiptRecord.vue' |
|||
|
|||
export default { |
|||
components: { |
|||
productReceiptRecord |
|||
}, |
|||
data() { |
|||
return { |
|||
title:'' |
|||
}; |
|||
}, |
|||
onLoad(option){ |
|||
this.title = option.title |
|||
}, |
|||
|
|||
onShow() { |
|||
if(this.$refs.productReceiptRecord!=undefined){ |
|||
this.$refs.productReceiptRecord.refresh(); |
|||
} |
|||
}, |
|||
|
|||
onPullDownRefresh() { |
|||
this.$refs.productReceiptRecord.refresh(); |
|||
}, |
|||
onNavigationBarButtonTap(e) { |
|||
if (e.index === 0) { |
|||
this.$refs.productReceiptRecord.toHome(); |
|||
} else if (e.index == 1) { |
|||
this.$refs.productReceiptRecord.openFilter(); |
|||
} |
|||
}, |
|||
|
|||
methods: { |
|||
|
|||
} |
|||
} |
|||
<script setup> |
|||
import { ref } from 'vue'; |
|||
import { onLoad, onShow, onPullDownRefresh, onNavigationBarButtonTap } from '@dcloudio/uni-app'; |
|||
import productReceiptRecord from '@/pages/productReceipt/record/productReceiptRecord.vue'; |
|||
|
|||
// 定义响应式数据 |
|||
const title = ref(''); |
|||
const productReceiptRecordRef = ref(null); |
|||
|
|||
// 页面加载时处理 |
|||
onLoad((option) => { |
|||
title.value = option.title; |
|||
}); |
|||
|
|||
// 页面显示时处理 |
|||
onShow(() => { |
|||
if (productReceiptRecordRef.value) { |
|||
productReceiptRecordRef.value.refresh(); |
|||
} |
|||
}); |
|||
|
|||
// 下拉刷新时处理 |
|||
onPullDownRefresh(() => { |
|||
if (productReceiptRecordRef.value) { |
|||
productReceiptRecordRef.value.refresh(); |
|||
} |
|||
}); |
|||
|
|||
// 导航栏按钮点击事件 |
|||
onNavigationBarButtonTap((e) => { |
|||
if (e.index === 0) { |
|||
productReceiptRecordRef.value.toHome(); |
|||
} else if (e.index === 1) { |
|||
productReceiptRecordRef.value.openFilter(); |
|||
} |
|||
}); |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
|
|||
/* 样式部分保持不变 */ |
|||
</style> |
Loading…
Reference in new issue