Browse Source

文件迁移Vue2升级Vue3 8/2-10/25

pull/1/head
test 3 months ago
parent
commit
f1738c952f
  1. 556
      src/pages/customerReturn/record/recordList.vue
  2. 811
      src/pages/customerReturn/record/recordListDetail.vue
  3. 89
      src/pages/productPutaway/record/fgDirectPutaway.vue
  4. 87
      src/pages/productPutaway/record/semiDirectPutaway.vue
  5. 75
      src/pages/productReceipt/record/semiDirectReceipt.vue

556
src/pages/customerReturn/record/recordList.vue

@ -5,13 +5,9 @@
</job-filter> </job-filter>
<com-empty-view v-if="recordList.length==0"></com-empty-view> <com-empty-view v-if="recordList.length==0"></com-empty-view>
<view v-if="recordList.length>0"> <view v-if="recordList.length>0">
<uni-swipe-action ref="swipeAction"> <u-swipe-action ref="swipeAction" v-for="(item, index) in recordList" :key="index">
<view v-for="(item, index) in recordList" :key="index"> <comReturnRecordCard :dataContent="item" @click='openJobDetail(item)'></comReturnRecordCard>
<uni-swipe-action-item> </u-swipe-action>
<comReturnRecordCard :dataContent="item" @click='openJobDetail(item)'></comReturnRecordCard>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
<job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></job-list-popup> <job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></job-list-popup>
<job-info-popup ref='jobInfoPopup'></job-info-popup> <job-info-popup ref='jobInfoPopup'></job-info-popup>
@ -25,7 +21,7 @@
</view> </view>
</template> </template>
<script> <script setup lang="ts">
import {getCustomerReturnRecordList, cancleTakeProductionReceiptJob,} from '@/api/request2.js'; import {getCustomerReturnRecordList, cancleTakeProductionReceiptJob,} from '@/api/request2.js';
import {goHome, updateTitle} from '@/common/basic.js'; import {goHome, updateTitle} from '@/common/basic.js';
@ -47,294 +43,262 @@
import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue" import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue"
import jobList from '@/mycomponents/jobList/jobList.vue' import jobList from '@/mycomponents/jobList/jobList.vue'
export default { import { ref,} from 'vue';
name: 'productionReceipt', import { onLoad, onShow, onReady, onReachBottom, onPullDownRefresh, onBackPress, onNavigationBarButtonTap } from '@dcloudio/uni-app';
components: {
comEmptyView, const recordList = ref([]);
jobFilter, const pageNo = ref(1);
comReturnRecordCard, const pageSize = ref(10);
jobListPopup, const totalCount = ref(0);
jobInfoPopup, const loadingType = ref("nomore");
winScanPackJob, const checkedToday = ref(false);
winScanButton, const checkedWaitTask = ref(false);
jobList const todayTime = ref("");
}, const detailOptions = ref([]);
data() { const detailGiveupOptions = ref([]);
return { const title = ref('');
recordList: [], const scanMessage = ref("");
pageNo: 1, const filterItemCode = ref("");
pageSize: 10, const queryParams = ref({
totalCount: 0, creationTime: "",
loadingType: "nomore", receiveStatus: "",
checkedToday: false, itemCode: ""
checkedWaitTask: false, });
todayTime: "",
detailOptions: [], const filter = ref(null);
detailGiveupOptions: [], const jobListPopup = ref(null);
title: '', const jobInfoPopup = ref(null);
scanMessage: "", const comMessage = ref(null);
filterItemCode: "", const scanPopup = ref(null);
queryParams:{ const recordListRef = ref(null);
creationTime:"",
receiveStatus:"", onLoad((option) => {
itemCode:"" title.value = option.title;
} });
};
}, onShow(() => {
onLoad(option) { getList('refresh');
this.title = option.title });
},
onReady(() => {
onShow() { detailOptions.value = getDetailOption();
this.getList('refresh') detailGiveupOptions.value = getDetailGiveupOption();
}, });
onReady() { onReachBottom(() => {
this.detailOptions = getDetailOption(); //
this.detailGiveupOptions = getDetailGiveupOption(); if (loadingType.value === 'loading' || loadingType.value === 'nomore') return;
}, getList('more');
});
onReachBottom() {
// onPullDownRefresh(() => {
if (this.loadingType == 'loading' || this.loadingType == 'nomore') { getList('refresh');
return; });
}
this.getList('more') onBackPress((options) => {
}, if (options.from === 'navigateBack') {
uni.navigateBack({ delta: 1 });
onPullDownRefresh() { return false;
this.getList('refresh') }
}, });
//退 onNavigationBarButtonTap((e) => {
onBackPress(options) { if (e.index === 0) {
if (options.from === 'navigateBack') { goHome();
uni.navigateBack({ } else if (e.index === 1) {
delta: 1 filter.value.openFilter();
}) }
return false; });
}
}, const setQueryParam = () => {
const filterParams = [];
//
onNavigationBarButtonTap(e) { //
if (e.index === 0) { if (queryParams.value.creationTime) {
goHome(); filterParams.push({
} else if (e.index == 1) { column: "create_time",
this.$refs.filter.openFilter(); action: "between",
} value: queryParams.value.creationTime
}, });
}
methods: {
//
setQueryParam() { if (queryParams.value.receiveStatus) {
var filterParams = [] filterParams.push({
column: "receiveStatus",
// action: "in",
if (this.queryParams.creationTime) { value: queryParams.value.receiveStatus
filterParams.push({ });
column: "create_time", } else {
action: "betweeen", filterParams.push({
value: this.queryParams.creationTime column: "receiveStatus",
}) action: "in",
} value: "0"
// });
if (this.queryParams.receiveStatus) { }
filterParams.push({
column: "receiveStatus", //
action: "in", if (queryParams.value.itemCode) {
value: this.queryParams.receiveStatus filterParams.push({
}) column: "itemCode",
} else { action: "like",
filterParams.push({ value: queryParams.value.itemCode
column: "receiveStatus", });
action: "in", filterItemCode.value = queryParams.value.itemCode;
value: "0" } else if (filterItemCode.value) {
}) filterParams.push({
} column: "itemCode",
action: "like",
// value: filterItemCode.value
if (this.queryParams.itemCode) { });
filterParams.push({ }
column: "itemCode",
action: "like", return filterParams;
value: this.queryParams.itemCode };
})
this.filterItemCode = this.queryParams.itemCode const getList = (type) => {
}else { uni.showLoading({ title: "加载中­....", mask: true });
if(this.filterItemCode){
filterParams.push({ loadingType.value = "loading";
column: "itemCode", if (type === "refresh") {
action: "like", pageNo.value = 1;
value: this.filterItemCode recordList.value = [];
}) }
}
const queryFiltersParams = setQueryParam();
} const params = {
filters: queryFiltersParams,
return filterParams; pageNo: pageNo.value,
pageSize: pageSize.value,
}, };
getList(type) {
let that = this; console.log("查询条件", JSON.stringify(params));
uni.showLoading({
title: "加载中­....", getCustomerReturnRecordList(params).then((res) => {
mask: true uni.hideLoading();
}); if (type === "refresh") {
uni.stopPullDownRefresh();
this.loadingType = "loading"; }
if (type === "refresh") {
this.pageNo = 1; const list = res.data.list;
this.recordList = []; totalCount.value = res.data.total;
} updateTitle(`${title.value} (${totalCount.value})`);
var queryFiltersParams = this.setQueryParam() loadingType.value = "loadmore";
var params = {
filters: queryFiltersParams, if (!list || list.length === 0) {
pageNo: this.pageNo, loadingType.value = "nomore";
pageSize: this.pageSize, return;
} }
console.log("查询条件",JSON.stringify(params)) list.forEach((item) => {
item.packingNumber = item.toPackingNumber;
getCustomerReturnRecordList(params).then(res => { });
uni.hideLoading();
if (type === "refresh") { recordList.value = type === "refresh" ? list : [...recordList.value, ...list];
uni.stopPullDownRefresh(); pageNo.value++;
} }).catch((error) => {
if (type === "refresh") {
var list = res.data.list; uni.stopPullDownRefresh();
this.totalCount = res.data.total }
updateTitle(this.title + "(" + this.totalCount + ")"); loadingType.value = "";
this.loadingType = "loadmore"; updateTitle(title.value);
if (list == null || list.length == 0) { uni.hideLoading();
this.loadingType = "nomore"; showMessage(error);
return; });
} };
list.forEach(item=>{
item.packingNumber =item.toPackingNumber const openJobDetail = (item, scanMessage = '') => {
}) uni.navigateTo({
this.recordList = type === "refresh" ? list : this.recordList.concat(list); url: `./recordListDetail?id=${item.masterId}&receiveStatus=${item.receiveStatus}&scanMessage=${scanMessage}&title=${title.value}`
this.pageNo++; });
scanMessage.value = "";
}).catch(error => { };
if (type === "refresh") {
uni.stopPullDownRefresh(); const showItemList = (itemList) => {
} jobListPopup.value.openPopup(itemList);
this.loadingType = ""; };
updateTitle(this.title);
uni.hideLoading(); const selectedItem = (item) => {
that.showMessage(error) openJobDetail(item);
}) };
},
const openjobInfoPopup = (item) => {
openJobDetail(item, scanMessage = '') { jobInfoPopup.value.openPopup(item);
uni.navigateTo({ };
url: './recordListDetail?id=' + item.masterId + '&receiveStatus=' + item.receiveStatus +
'&scanMessage=' + scanMessage + '&title=' + this.title const showMessage = (message) => {
}); if (scanPopup.value) {
this.scanMessage = "" scanPopup.value.packLoseFocus();
}, }
comMessage.value.showErrorMessage(message, (res) => {
showItemList(itemList) { if (res && scanPopup.value) {
this.$refs.jobListPopup.openPopup(itemList); scanPopup.value.packGetFocus();
}, }
});
selectedItem(item) { };
this.openJobDetail(item);
}, const openScanPopup = () => {
scanPopup.value.openScanPopup();
openjobInfoPopup(item) { };
this.$refs.jobInfoPopup.openPopup(item)
}, const selectItem = (item) => {
scanPopup.value.closeScanPopup();
showMessage(message) { openJobDetail(item, scanMessage.value);
if (this.$refs.scanPopup) { };
this.$refs.scanPopup.packLoseFocus()
} const getScanResult = (result) => {
this.$refs.comMessage.showErrorMessage(message, res => { try {
if (res) { scanMessage.value = "";
if (this.$refs.scanPopup) { const filters = [
this.$refs.scanPopup.packGetFocus() { column: "toPackingNumber", action: "in", value: `${result.package.number},${result.package.parentNumber}` },
} { column: "receiveStatus", action: "in", value: '0' },
} { column: "toBatch", action: "==", value: result.label.batch },
}); { column: "itemCode", action: "==", value: result.label.itemCode },
}, ];
openScanPopup() {
this.$refs.scanPopup.openScanPopup(); getCustomerReturnRecordList({
}, filters: filters,
selectItem(item) { pageNo: 1,
this.$refs.scanPopup.closeScanPopup(); pageSize: 100,
this.openJobDetail(item, this.scanMessage); }).then((res) => {
}, scanMessage.value = result.scanMessage;
getScanResult(result) { const resultList = res.data.list;
try { if (resultList.length > 0) {
this.scanMessage = "" resultList.forEach((item) => {
var filters = [{ item.title = item.number;
column: "toPackingNumber", item.selected = false;
action: "in", });
value: result.package.number + "," + result.package.parentNumber
}, const list = [];
{ resultList.forEach((item) => {
column: "receiveStatus", if (!list.find((subItem) => subItem.title === item.title)) {
action: "in", list.push(item);
value: '0' }
}, });
{
column: "toBatch", if (list.length > 1) {
action: "==", recordListRef.value.openList(list);
value: result.label.batch } else {
}, selectItem(list[0]);
{ }
column: "itemCode", } else {
action: "==", showMessage(`未查找到任务\n扫描[${result.scanMessage}]`);
value: result.label.itemCode }
}, }).catch((error) => {
] showMessage(`${error}\n扫描[${result.scanMessage}]`);
});
getCustomerReturnRecordList({ } catch (e) {
filters: filters, showMessage(e.message);
pageNo: 1, }
pageSize: 100, };
}).then(res => {
this.scanMessage = result.scanMessage const getListByFilter = (params) => {
let resultList = res.data.list; queryParams.value.creationTime = params.creationTime;
if (resultList.length > 0) { queryParams.value.receiveStatus = params.receiveStatus;
resultList.forEach(item => { queryParams.value.itemCode = params.itemCode;
item.title = item.number; getList('refresh');
item.selected = false };
})
let list = []
resultList.forEach(item => {
if (!list.find(subItem => subItem.title == item.title)) {
list.push(item)
}
})
if (list.length > 1) {
this.$refs.recordList.openList(list)
} else {
this.selectItem(list[0])
}
} else {
this.showMessage("未查找到任务\n" + "扫描[" + result.scanMessage + "]")
}
}).catch(error => {
this.showMessage(error + "\n扫描[" + result.scanMessage + "]")
})
} catch (e) {
this.showMessage(e.message)
}
},
getListByFilter(params) {
this.queryParams.creationTime=params.creationTime
this.queryParams.receiveStatus=params.receiveStatus
this.queryParams.itemCode=params.itemCode
this.getList('refresh')
},
}
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

811
src/pages/customerReturn/record/recordListDetail.vue

@ -1,424 +1,401 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<view class="page-main"> <view class="page-main">
<view class="page-header"> <view class="page-header">
<view class="header-view"> <view class="header-view">
<view class="header_job_top"> <view class="header_job_top">
<receive-top :dataContent="recordContent"></receive-top> <receive-top :dataContent="recordContent"></receive-top>
</view> </view>
</view> </view>
</view> </view>
<view v-if="detailSource.length>0" class="uni-flex uni-row " <view v-if="detailSource.length>0" class="uni-flex uni-row "
style=";margin-top: 15rpx; margin-bottom: 15rpx; margin-left: 20rpx; text-align: right;"> style=";margin-top: 15rpx; margin-bottom: 15rpx; margin-left: 20rpx; text-align: right;">
<view class="font_default" style="display: block; font-weight: bold;"> <view class="font_default" style="display: block; font-weight: bold;">
整单接收 整单接收
</view> </view>
<view class="uni-flex" style="margin-left: 20rpx; align-items: center; text-align: center;"> <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" <u-switch v-model="isAllReceived" active-color="#5FCB94" inactive-color="#eee" size="35"
@change="switchChange"></u-switch> @change="switchChange"></u-switch>
</view> </view>
</view> </view>
<scroll-view scroll-y="true"> <scroll-view scroll-y="true">
<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">
<view class=""> <view class="">
<com-detail-card :dataContent="item" :index="index" :settingParam="recordContent" <com-detail-card :dataContent="item" :index="index" :settingParam="recordContent"
@remove="updateData" :isShowToLocation="true" @updateData="updateData" @remove="updateData" :isShowToLocation="true" @updateData="updateData"
@openDetail="openDetail"> @openDetail="openDetail">
</com-detail-card> </com-detail-card>
<view class='split_line'></view> <view class='split_line'></view>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<view class="page-footer"> <view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10" <view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; "> style="background-color:ghostwhite; width: 100%; ">
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
<button class="btn_single_commit" style="width: 280rpx;" hover-class="btn_commit_after" <button class="btn_single_commit" style="width: 280rpx;" hover-class="btn_commit_after"
@click="reject">拒绝</button> @click="reject">拒绝
</view> </button>
<view class=" uni-flex uni-row"> </view>
<button class="btn_single_commit" style="width: 280rpx;" hover-class="btn_commit_after" <view class=" uni-flex uni-row">
@click="receive" :disabled="receiveDisable">接收</button> <button class="btn_single_commit" style="width: 280rpx;" hover-class="btn_commit_after"
</view> @click="receive" :disabled="receiveDisable">接收
</view> </button>
</view> </view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button> </view>
<win-scan-pack ref="scanPopup" @getResult='getScanResult' headerType="HPQ,HMQ">></win-scan-pack>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup> <win-scan-pack ref="scanPopup" @getResult='getScanResult' headerType="HPQ,HMQ">></win-scan-pack>
<comMessage ref="comMessage"></comMessage> <detail-info-popup ref="detailInfoPopup"></detail-info-popup>
</view>
<comMessage ref="comMessage"></comMessage>
</view>
</template> </template>
<script> <script setup lang="ts">
import { import {
getCustomerReturnRecordDetail, getCustomerReturnRecordDetail,
customerReturnRecordRefuse, customerReturnRecordRefuse,
customerReturnRecordReceive, customerReturnRecordReceive,
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
goHome, goHome,
navigateBack, navigateBack,
getCurrDateTime, getCurrDateTime,
getInventoryStatusName, getInventoryStatusName,
getSwitchInfoByCode getSwitchInfoByCode
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
getDataSource, getDataSource,
calcHandleQty, calcHandleQty,
getScanCount getScanCount
} from '@/common/detail.js'; } from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue" import comDetailCard from "@/mycomponents/detail/comDetailCard.vue"
import detailInfoPopup from '@/pages/productionReceipt/coms/detailInfoPopup.vue' import detailInfoPopup from '@/pages/productionReceipt/coms/detailInfoPopup.vue'
import receiveTop from '@/mycomponents/receive/receiveTop.vue' import receiveTop from '@/mycomponents/receive/receiveTop.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue'
export default { import {ref} from 'vue';
components: { import {
winScanButton, onLoad,
winScanPack, onBackPress,
comDetailCard, onNavigationBarButtonTap
detailInfoPopup, } from '@dcloudio/uni-app';
receiveTop
}, const id = ref(null);
data() { const isAllReceived = ref(false);
return { const receiveDisable = ref(true);
id: '', const recordContent = ref(null);
scanCount: 0, const subList = ref([]);
recordContent: {}, // const detailSource = ref([]);
subList: [], //subList const scanCount = ref(0);
detailSource: [], //
fromLocationCode: "", const detailInfoPopup = ref(null);
toLocationCode: "", const scanPopup = ref(null);
isAllReceived: false, const comMessage = ref(null);
receiveDisable: true //
}; onLoad((option) => {
}, uni.setNavigationBarTitle({
onLoad(option) { title: option.title + '详情'
uni.setNavigationBarTitle({ });
title: option.title + '详情' id.value = option.id;
}) if (id.value !== undefined) {
this.id = option.id; //
if (this.id != undefined) { if (option.receiveStatus === "0") {
// getDetail();
if (option.receiveStatus == "0") { }
this.getDetail(); }
} });
}
}, onNavigationBarButtonTap((e) => {
// if (e.index === 0) {
onNavigationBarButtonTap(e) { goHome();
if (e.index === 0) { }
goHome(); });
}
}, onBackPress((e) => {
// //
onBackPress(e) { if (e.from === 'backbutton') {
// uni.navigateBack();
if (e.from == 'backbutton') { return true;
uni.navigateBack(); }
return true; });
}
}, //
const getDetail = () => {
uni.showLoading({title: "加载中....", mask: true});
mounted() { getCustomerReturnRecordDetail(id.value).then((res) => {
uni.hideLoading();
}, isAllReceived.value = false;
methods: { receiveDisable.value = true;
// if (res.data == null) {
getDetail() { showMessage('未获取到详情');
var that = this; } else {
uni.showLoading({ if (res.data.list.length > 0) {
title: "加载中....", recordContent.value = res.data.list[0];
mask: true subList.value = res.data.list;
}); subList.value.forEach((item) => {
getCustomerReturnRecordDetail(that.id).then(res => { item.batch = item.toBatch;
uni.hideLoading(); item.packingNumber = item.toPackingNumber;
this.isAllReceived= false });
this.receiveDisable = true detailSource.value = getDataSource(subList.value);
if (res.data == null) { } else {
that.showMessage('未获取到详情'); showMessage('列表数据为0');
} else { }
if (res.data.list.length > 0) { }
that.recordContent = res.data.list[0]; }).catch((error) => {
that.subList = res.data.list; uni.hideLoading();
that.subList.forEach(item => { showErrorMessage(error);
item.batch = item.toBatch; });
item.packingNumber = item.toPackingNumber; };
})
that.detailSource = getDataSource(that.subList) const calcHandleQty = () => {
} else { calcHandleQty(detailSource.value);
that.showMessage('列表数据为0'); updateBtn();
} continueScan();
} };
}).catch(error => {
uni.hideLoading() const updateBtn = () => {
this.showErrorMessage(error) scanCount.value = getScanCount(subList.value);
}) //
}, if (scanCount.value === subList.value.length) {
receiveDisable.value = false;
calcHandleQty() { } else {
calcHandleQty(this.detailSource); receiveDisable.value = true;
this.updateBtn() }
this.continueScan() };
this.$forceUpdate();
}, const continueScan = () => {
scanCount.value = getScanCount(subList.value);
updateBtn() { if (scanCount.value === subList.value.length) {
this.scanCount = getScanCount(this.subList); closeScanPopup();
// } else {
if (this.scanCount == this.subList.length) { scanPopupGetFocus();
this.receiveDisable = false; }
}else { };
this.receiveDisable = true;
} const updateData = () => {
}, calcHandleQty();
updateBtn();
// };
continueScan() {
this.scanCount = getScanCount(this.subList); const openDetail = (item) => {
if (this.scanCount == this.subList.length) { detailInfoPopup.value.openPopup(item);
this.closeScanPopup(); };
} else {
this.scanPopupGetFocus(); const openScanPopup = () => {
} scanPopup.value.openScanPopup();
}, };
updateData() { const closeScanPopup = () => {
this.calcHandleQty(); scanPopup.value.closeScanPopup();
this.updateBtn() };
},
const getScanResult = (result) => {
openDetail(item) { try {
this.$refs.detailInfoPopup.openPopup(item) const itemCode = result.label.itemCode;
}, const packingNumber = result.package.number;
const batch = result.label.batch;
openScanPopup() { const detail = detailSource.value.find((r) => r.itemCode === itemCode);
this.$refs.scanPopup.openScanPopup();
}, if (detail === undefined) {
showErrorMessage(`物料号【${itemCode}】不在列表中`);
closeScanPopup() { } else {
this.$refs.scanPopup.closeScanPopup(); const itemDetail = detail.subList.find((r) => r.packingNumber === packingNumber && r.batch === batch);
}, if (itemDetail === undefined) {
showErrorMessage(`箱码[${packingNumber}]批次[${batch}]不在列表中`);
getScanResult(result) { } else {
try { if (itemDetail.scaned) {
var itemCode = result.label.itemCode; showErrorMessage(`箱码[${packingNumber}]批次[${batch}]已经扫描`);
var packingNumber = result.package.number; } else {
var batch = result.label.batch; itemDetail.scaned = true;
var detail = this.detailSource.find(r => r.itemCode == itemCode); itemDetail.handleQty = Number(itemDetail.qty);
calcHandleQty();
if (detail == undefined) { }
this.showErrorMessage("物料号【" + itemCode + "】不在列表中") }
} else { }
var itemDetail = detail.subList.find(r => { } catch (e) {
return r.packingNumber == packingNumber && showMessage(e.message);
r.batch == batch }
}) };
if (itemDetail == undefined) {
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]不在列表中") const reject = () => {
} else { showQuestionMessage("是否拒绝接收?", (res) => {
if (itemDetail.scaned) { if (res) {
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]已经扫描") uni.showLoading({title: "提交中....", mask: true});
} else { customerReturnRecordRefuse(id.value).then((res) => {
itemDetail.scaned = true; uni.hideLoading();
itemDetail.handleQty = Number(itemDetail.qty) if (res.data) {
this.calcHandleQty(); showCommitSuccessMessage("拒绝成功");
} } else {
} showErrorMessage(`拒绝失败[${res.msg}]`);
} }
} catch (e) { }).catch((error) => {
this.showMessage(e.message) uni.hideLoading();
} showErrorMessage(error);
}, });
reject() { }
this.showQuestionMessage("是否拒绝接收?", res => { });
if (res) { };
uni.showLoading({
title: "提交中....", const receive = () => {
mask: true scanCount.value = getScanCount(subList.value);
}); if (scanCount.value === 0) {
customerReturnRecordRefuse(this.id).then(res=>{ showErrorMessage("扫描数为0,请先扫描");
uni.hideLoading() return;
if(res.data){ }
this.showCommitSuccessMessage("拒绝成功") if (scanCount.value < subList.value.length) {
}else { showErrorMessage("还有未扫描的数据,请先扫描");
this.showErrorMessage("拒绝失败[" + res.msg + "]") return;
} }
}).catch(error=>{
uni.hideLoading() //
this.showErrorMessage(error) if (scanCount.value === subList.value.length) {
}) receiveSubmit();
} }
}) };
},
const showMessageHint = (hint, callback) => {
receive() { comMessage.value.showErrorMessage(hint, (res) => {
this.scanCount = getScanCount(this.subList); if (res) {
if (this.scanCount == 0) { callback();
this.showErrorMessage("扫描数为0,请先扫描") }
return; });
} };
if (this.scanCount < this.subList.length) {
this.showErrorMessage("还有未扫描的数据,请先扫描") const receiveSubmit = () => {
return; uni.showLoading({title: "提交中....", mask: true});
} customerReturnRecordReceive(id.value).then((res) => {
uni.hideLoading();
// if (res.data) {
if (this.scanCount == this.subList.length) { showCommitSuccessMessage("接收成功");
this.receiveSubmit(); } else {
} showErrorMessage(`接收失败[${res.msg}]`);
}, }
}).catch((error) => {
showMessageHint(hint, callback) { uni.hideLoading();
this.$refs.comMessage.showErrorMessage(hint, res => { showErrorMessage(error);
if (res) { });
callback() };
}
}); const showMessage = (message) => {
}, setTimeout(() => {
scanPopupLoseFocus();
receiveSubmit() { comMessage.value.showMessage(message, (res) => {
uni.showLoading({ if (res) {
title: "提交中....", afterCloseMessage();
mask: true }
}); });
customerReturnRecordReceive(this.id).then(res => { });
uni.hideLoading() };
if (res.data) {
this.showCommitSuccessMessage("接收成功") const showErrorMessage = (message) => {
} else { setTimeout(() => {
this.showErrorMessage("接收失败[" + res.msg + "]") scanPopupLoseFocus();
} comMessage.value.showErrorMessage(message, (res) => {
}).catch(error => { if (res) {
uni.hideLoading() afterCloseMessage();
this.showErrorMessage(error) }
}) });
}, });
};
showMessage(message) {
setTimeout(r => { const showQuestionMessage = (message, callback) => {
this.scanPopupLoseFocus(); setTimeout(() => {
this.$refs.comMessage.showMessage(message, res => { scanPopupLoseFocus();
if (res) { comMessage.value.showQuestionMessage(message, (res) => {
this.afterCloseMessage() if (res) {
} callback(res);
}); }
}) });
}, });
};
showErrorMessage(message) {
setTimeout(r => { const scanPopupGetFocus = () => {
this.scanPopupLoseFocus(); if (scanPopup.value) {
this.$refs.comMessage.showErrorMessage(message, res => { scanPopup.value.getfocus();
if (res) { }
this.afterCloseMessage() };
}
}); const scanPopupLoseFocus = () => {
}) if (scanPopup.value) {
}, scanPopup.value.losefocus();
}
showQuestionMessage(message, callback) { };
setTimeout(r => {
this.scanPopupLoseFocus(); const afterCloseMessage = () => {
this.$refs.comMessage.showQuestionMessage(message, res => { scanPopupGetFocus();
if (res) { };
callback(res);
} const showCommitSuccessMessage = (hint) => {
}); comMessage.value.showSuccessMessage(hint, (res) => {
}) navigateBack(1);
}, });
};
scanPopupGetFocus() {
if (this.$refs.scanPopup) { const switchChange = (isOn) => {
this.$refs.scanPopup.getfocus(); isAllReceived.value = isOn;
} if (isAllReceived.value) {
}, detailSource.value.forEach((item) => {
item.subList.forEach((info) => {
scanPopupLoseFocus() { info.scaned = true;
if (this.$refs.scanPopup) { info.handleQty = Number(info.qty);
this.$refs.scanPopup.losefocus(); });
} });
}, calcHandleQty();
} else {
afterCloseMessage() { comMessage.value.showQuestionMessage("是否要关闭整单收货?", (res) => {
this.scanPopupGetFocus(); if (res) {
}, getDetail();
} else {
isAllReceived.value = true;
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> </script>
<style scoped lang="scss"> <style scoped lang="scss">
page { page {
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: #fff; background-color: #fff;
} }
.page-wraper { .page-wraper {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.page-main { .page-main {
flex: 1; flex: 1;
position: relative; position: relative;
} }
.page-main-scroll { .page-main-scroll {
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
top: 0; top: 0;
bottom: 0; bottom: 0;
} }
.page-main-list { .page-main-list {
/* height: 80rpx; /* height: 80rpx;
line-height: 80rpx; */ line-height: 80rpx; */
text-align: center; text-align: center;
background: #e0e0e0; background: #e0e0e0;
} }
</style> </style>

89
src/pages/productPutaway/record/fgDirectPutaway.vue

@ -1,48 +1,41 @@
<template> <template>
<view class=""> <view class="">
<product-putaway-record :title="title" ref="productPutawayRecord" putawayType='assemble'></product-putaway-record> <product-putaway-record :title="title" ref="productPutawayRecordRef" putawayType="assemble"></product-putaway-record>
</view> </view>
</template> </template>
<script> <script setup>
import productPutawayRecord from '@/pages/productPutaway/record/productPutawayRecord.vue' import { ref } from 'vue';
import { onLoad, onShow, onPullDownRefresh, onNavigationBarButtonTap } from '@dcloudio/uni-app';
export default { import productPutawayRecord from '@/pages/productPutaway/record/productPutawayRecord.vue';
components: {
productPutawayRecord const title = ref('');
}, const productPutawayRecordRef = ref(null);
data() {
return { onLoad((option) => {
title:'' title.value = option.title;
}; });
},
onLoad(option){ onShow(() => {
this.title = option.title if (productPutawayRecordRef.value) {
}, // productPutawayRecordRef.value.refresh();
}
onShow() { });
if(this.$refs.productPutawayRecord!=undefined){
// this.$refs.productPutawayRecord.refresh(); onPullDownRefresh(() => {
} if (productPutawayRecordRef.value) {
}, // productPutawayRecordRef.value.refresh();
}
onPullDownRefresh() { });
// this.$refs.productPutawayRecord.refresh();
}, onNavigationBarButtonTap((e) => {
onNavigationBarButtonTap(e) { if (e.index === 0) {
if (e.index === 0) { productPutawayRecordRef.value.toHome();
this.$refs.productPutawayRecord.toHome(); } else if (e.index === 1) {
} else if (e.index == 1) { productPutawayRecordRef.value.openFilter();
this.$refs.productPutawayRecord.openFilter(); }
} });
}, </script>
methods: { <style scoped lang="scss">
</style>
}
}
</script>
<style scoped lang="scss">
</style>

87
src/pages/productPutaway/record/semiDirectPutaway.vue

@ -1,48 +1,41 @@
<template> <template>
<view class=""> <view class="">
<product-putaway-record :title="title" ref="productPutawayRecord" putawayType='predict'></product-putaway-record> <product-putaway-record :title="title" ref="productPutawayRecordRef" putawayType="predict"></product-putaway-record>
</view> </view>
</template> </template>
<script> <script setup lang="ts">
import productPutawayRecord from '@/pages/productPutaway/record/productPutawayRecord.vue' import { ref } from 'vue';
import { onLoad, onShow, onPullDownRefresh, onNavigationBarButtonTap } from '@dcloudio/uni-app';
export default { import productPutawayRecord from '@/pages/productPutaway/record/productPutawayRecord.vue';
components: {
productPutawayRecord const title = ref('');
}, const productPutawayRecordRef = ref(null);
data() {
return { onLoad((option) => {
title:'' title.value = option.title;
}; });
},
onLoad(option){ onShow(() => {
this.title = option.title if (productPutawayRecordRef.value) {
}, productPutawayRecordRef.value.refresh();
}
onShow() { });
if(this.$refs.productPutawayRecord!=undefined){
this.$refs.productPutawayRecord.refresh(); onPullDownRefresh(() => {
} if (productPutawayRecordRef.value) {
}, productPutawayRecordRef.value.refresh();
}
onPullDownRefresh() { });
this.$refs.productPutawayRecord.refresh();
}, onNavigationBarButtonTap((e) => {
onNavigationBarButtonTap(e) { if (e.index === 0) {
if (e.index === 0) { productPutawayRecordRef.value.toHome();
this.$refs.productPutawayRecord.toHome(); } else if (e.index === 1) {
} else if (e.index == 1) { productPutawayRecordRef.value.openFilter();
this.$refs.productPutawayRecord.openFilter(); }
} });
}, </script>
methods: { <style scoped lang="scss">
</style>
}
}
</script>
<style scoped lang="scss">
</style>

75
src/pages/productReceipt/record/semiDirectReceipt.vue

@ -1,48 +1,47 @@
<template> <template>
<view class=""> <view class="">
<product-receipt-record :title="title" ref="productPutawayRecord" type='predict'></product-receipt-record> <product-receipt-record :title="title" ref="productReceiptRecordRef" type="predict"></product-receipt-record>
</view> </view>
</template> </template>
<script> <script setup>
import productReceiptRecord from '@/pages/productReceipt/record/productReceiptRecord.vue' import { ref } from 'vue';
import { onLoad, onShow, onPullDownRefresh, onNavigationBarButtonTap } from '@dcloudio/uni-app';
import productReceiptRecord from '@/pages/productReceipt/record/productReceiptRecord.vue';
export default { //
components: { const title = ref('');
productReceiptRecord const productReceiptRecordRef = ref(null);
},
data() {
return {
title:''
};
},
onLoad(option){
this.title = option.title
},
onShow() {
if(this.$refs.productReceiptRecord!=undefined){
this.$refs.productReceiptRecord.refresh();
}
},
onPullDownRefresh() { //
this.$refs.productReceiptRecord.refresh(); onLoad((option) => {
}, title.value = option.title;
onNavigationBarButtonTap(e) { });
if (e.index === 0) {
this.$refs.productReceiptRecord.toHome();
} else if (e.index == 1) {
this.$refs.productReceiptRecord.openFilter();
}
},
methods: { //
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> </script>
<style scoped lang="scss"> <style scoped lang="scss">
/* 样式部分保持不变 */
</style> </style>

Loading…
Cancel
Save