Browse Source

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

hella_vue3
王志国 3 weeks ago
parent
commit
f1738c952f
  1. 398
      src/pages/customerReturn/record/recordList.vue
  2. 475
      src/pages/customerReturn/record/recordListDetail.vue
  3. 67
      src/pages/productPutaway/record/fgDirectPutaway.vue
  4. 65
      src/pages/productPutaway/record/semiDirectPutaway.vue
  5. 63
      src/pages/productReceipt/record/semiDirectReceipt.vue

398
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">
<uni-swipe-action-item>
<comReturnRecordCard :dataContent="item" @click='openJobDetail(item)'></comReturnRecordCard> <comReturnRecordCard :dataContent="item" @click='openJobDetail(item)'></comReturnRecordCard>
</uni-swipe-action-item> </u-swipe-action>
</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) => {
},
onPullDownRefresh() {
this.getList('refresh')
},
//退
onBackPress(options) {
if (options.from === 'navigateBack') { if (options.from === 'navigateBack') {
uni.navigateBack({ uni.navigateBack({ delta: 1 });
delta: 1
})
return false; return false;
} }
}, });
// onNavigationBarButtonTap((e) => {
onNavigationBarButtonTap(e) {
if (e.index === 0) { if (e.index === 0) {
goHome(); goHome();
} else if (e.index == 1) { } else if (e.index === 1) {
this.$refs.filter.openFilter(); filter.value.openFilter();
} }
}, });
methods: {
setQueryParam() { const setQueryParam = () => {
var filterParams = [] const filterParams = [];
// //
if (this.queryParams.creationTime) { if (queryParams.value.creationTime) {
filterParams.push({ filterParams.push({
column: "create_time", column: "create_time",
action: "betweeen", action: "between",
value: this.queryParams.creationTime value: queryParams.value.creationTime
}) });
} }
//
if (this.queryParams.receiveStatus) { //
if (queryParams.value.receiveStatus) {
filterParams.push({ filterParams.push({
column: "receiveStatus", column: "receiveStatus",
action: "in", action: "in",
value: this.queryParams.receiveStatus value: queryParams.value.receiveStatus
}) });
} else { } else {
filterParams.push({ filterParams.push({
column: "receiveStatus", column: "receiveStatus",
action: "in", action: "in",
value: "0" value: "0"
}) });
} }
// //
if (this.queryParams.itemCode) { if (queryParams.value.itemCode) {
filterParams.push({ filterParams.push({
column: "itemCode", column: "itemCode",
action: "like", action: "like",
value: this.queryParams.itemCode value: queryParams.value.itemCode
}) });
this.filterItemCode = this.queryParams.itemCode filterItemCode.value = queryParams.value.itemCode;
}else { } else if (filterItemCode.value) {
if(this.filterItemCode){
filterParams.push({ filterParams.push({
column: "itemCode", column: "itemCode",
action: "like", action: "like",
value: this.filterItemCode value: filterItemCode.value
}) });
}
} }
return filterParams; return filterParams;
};
}, const getList = (type) => {
getList(type) { uni.showLoading({ title: "加载中­....", mask: true });
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
this.loadingType = "loading"; loadingType.value = "loading";
if (type === "refresh") { if (type === "refresh") {
this.pageNo = 1; pageNo.value = 1;
this.recordList = []; recordList.value = [];
} }
var queryFiltersParams = this.setQueryParam()
var params = { const queryFiltersParams = setQueryParam();
const params = {
filters: queryFiltersParams, filters: queryFiltersParams,
pageNo: this.pageNo, pageNo: pageNo.value,
pageSize: this.pageSize, pageSize: pageSize.value,
} };
console.log("查询条件",JSON.stringify(params)) console.log("查询条件", JSON.stringify(params));
getCustomerReturnRecordList(params).then(res => { getCustomerReturnRecordList(params).then((res) => {
uni.hideLoading(); uni.hideLoading();
if (type === "refresh") { if (type === "refresh") {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
} }
var list = res.data.list; const list = res.data.list;
this.totalCount = res.data.total totalCount.value = res.data.total;
updateTitle(this.title + "(" + this.totalCount + ")"); updateTitle(`${title.value} (${totalCount.value})`);
this.loadingType = "loadmore"; loadingType.value = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore"; if (!list || list.length === 0) {
loadingType.value = "nomore";
return; return;
} }
list.forEach(item=>{
item.packingNumber =item.toPackingNumber
})
this.recordList = type === "refresh" ? list : this.recordList.concat(list);
this.pageNo++;
}).catch(error => { list.forEach((item) => {
item.packingNumber = item.toPackingNumber;
});
recordList.value = type === "refresh" ? list : [...recordList.value, ...list];
pageNo.value++;
}).catch((error) => {
if (type === "refresh") { if (type === "refresh") {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
} }
this.loadingType = ""; loadingType.value = "";
updateTitle(this.title); updateTitle(title.value);
uni.hideLoading(); uni.hideLoading();
that.showMessage(error) showMessage(error);
}) });
}, };
openJobDetail(item, scanMessage = '') { const openJobDetail = (item, scanMessage = '') => {
uni.navigateTo({ uni.navigateTo({
url: './recordListDetail?id=' + item.masterId + '&receiveStatus=' + item.receiveStatus + url: `./recordListDetail?id=${item.masterId}&receiveStatus=${item.receiveStatus}&scanMessage=${scanMessage}&title=${title.value}`
'&scanMessage=' + scanMessage + '&title=' + this.title
}); });
this.scanMessage = "" scanMessage.value = "";
}, };
showItemList(itemList) { const showItemList = (itemList) => {
this.$refs.jobListPopup.openPopup(itemList); jobListPopup.value.openPopup(itemList);
}, };
selectedItem(item) { const selectedItem = (item) => {
this.openJobDetail(item); openJobDetail(item);
}, };
openjobInfoPopup(item) { const openjobInfoPopup = (item) => {
this.$refs.jobInfoPopup.openPopup(item) jobInfoPopup.value.openPopup(item);
}, };
showMessage(message) { const showMessage = (message) => {
if (this.$refs.scanPopup) { if (scanPopup.value) {
this.$refs.scanPopup.packLoseFocus() scanPopup.value.packLoseFocus();
}
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.packGetFocus()
} }
comMessage.value.showErrorMessage(message, (res) => {
if (res && scanPopup.value) {
scanPopup.value.packGetFocus();
} }
}); });
}, };
openScanPopup() {
this.$refs.scanPopup.openScanPopup(); const openScanPopup = () => {
}, scanPopup.value.openScanPopup();
selectItem(item) { };
this.$refs.scanPopup.closeScanPopup();
this.openJobDetail(item, this.scanMessage); const selectItem = (item) => {
}, scanPopup.value.closeScanPopup();
getScanResult(result) { openJobDetail(item, scanMessage.value);
};
const getScanResult = (result) => {
try { try {
this.scanMessage = "" scanMessage.value = "";
var filters = [{ const filters = [
column: "toPackingNumber", { column: "toPackingNumber", action: "in", value: `${result.package.number},${result.package.parentNumber}` },
action: "in", { column: "receiveStatus", action: "in", value: '0' },
value: result.package.number + "," + result.package.parentNumber { column: "toBatch", action: "==", value: result.label.batch },
}, { column: "itemCode", action: "==", value: result.label.itemCode },
{ ];
column: "receiveStatus",
action: "in",
value: '0'
},
{
column: "toBatch",
action: "==",
value: result.label.batch
},
{
column: "itemCode",
action: "==",
value: result.label.itemCode
},
]
getCustomerReturnRecordList({ getCustomerReturnRecordList({
filters: filters, filters: filters,
pageNo: 1, pageNo: 1,
pageSize: 100, pageSize: 100,
}).then(res => { }).then((res) => {
this.scanMessage = result.scanMessage scanMessage.value = result.scanMessage;
let resultList = res.data.list; const resultList = res.data.list;
if (resultList.length > 0) { if (resultList.length > 0) {
resultList.forEach(item => { resultList.forEach((item) => {
item.title = item.number; item.title = item.number;
item.selected = false item.selected = false;
}) });
let list = []
resultList.forEach(item => { const list = [];
if (!list.find(subItem => subItem.title == item.title)) { resultList.forEach((item) => {
list.push(item) if (!list.find((subItem) => subItem.title === item.title)) {
list.push(item);
} }
}) });
if (list.length > 1) { if (list.length > 1) {
this.$refs.recordList.openList(list) recordListRef.value.openList(list);
} else { } else {
this.selectItem(list[0]) selectItem(list[0]);
} }
} else { } else {
this.showMessage("未查找到任务\n" + "扫描[" + result.scanMessage + "]") showMessage(`未查找到任务\n扫描[${result.scanMessage}]`);
} }
}).catch(error => { }).catch((error) => {
this.showMessage(error + "\n扫描[" + result.scanMessage + "]") showMessage(`${error}\n扫描[${result.scanMessage}]`);
}) });
} catch (e) { } catch (e) {
this.showMessage(e.message) showMessage(e.message);
} }
}, };
getListByFilter(params) { const getListByFilter = (params) => {
this.queryParams.creationTime=params.creationTime queryParams.value.creationTime = params.creationTime;
this.queryParams.receiveStatus=params.receiveStatus queryParams.value.receiveStatus = params.receiveStatus;
this.queryParams.itemCode=params.itemCode queryParams.value.itemCode = params.itemCode;
this.getList('refresh') getList('refresh');
}, };
}
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

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

@ -37,11 +37,13 @@
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">拒绝
</button>
</view> </view>
<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="receive" :disabled="receiveDisable">接收</button> @click="receive" :disabled="receiveDisable">接收
</button>
</view> </view>
</view> </view>
</view> </view>
@ -55,370 +57,345 @@
</view> </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) => {
},
onLoad(option) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: option.title + '详情' title: option.title + '详情'
}) });
this.id = option.id; id.value = option.id;
if (this.id != undefined) { if (id.value !== undefined) {
// //
if (option.receiveStatus == "0") { if (option.receiveStatus === "0") {
this.getDetail(); getDetail();
} }
} }
}, });
//
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') {
uni.navigateBack(); uni.navigateBack();
return true; return true;
} }
}, });
//
mounted() { const getDetail = () => {
uni.showLoading({title: "加载中....", mask: true});
}, getCustomerReturnRecordDetail(id.value).then((res) => {
methods: {
//
getDetail() {
var that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getCustomerReturnRecordDetail(that.id).then(res => {
uni.hideLoading(); uni.hideLoading();
this.isAllReceived= false isAllReceived.value = false;
this.receiveDisable = true receiveDisable.value = true;
if (res.data == null) { if (res.data == null) {
that.showMessage('未获取到详情'); showMessage('未获取到详情');
} else { } else {
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
that.recordContent = res.data.list[0]; recordContent.value = res.data.list[0];
that.subList = res.data.list; subList.value = res.data.list;
that.subList.forEach(item => { subList.value.forEach((item) => {
item.batch = item.toBatch; item.batch = item.toBatch;
item.packingNumber = item.toPackingNumber; item.packingNumber = item.toPackingNumber;
}) });
that.detailSource = getDataSource(that.subList) detailSource.value = getDataSource(subList.value);
} else { } else {
that.showMessage('列表数据为0'); showMessage('列表数据为0');
} }
} }
}).catch(error => { }).catch((error) => {
uni.hideLoading() uni.hideLoading();
this.showErrorMessage(error) showErrorMessage(error);
}) });
}, };
calcHandleQty() { const calcHandleQty = () => {
calcHandleQty(this.detailSource); calcHandleQty(detailSource.value);
this.updateBtn() updateBtn();
this.continueScan() continueScan();
this.$forceUpdate(); };
},
const updateBtn = () => {
updateBtn() { scanCount.value = getScanCount(subList.value);
this.scanCount = getScanCount(this.subList); //
// if (scanCount.value === subList.value.length) {
if (this.scanCount == this.subList.length) { receiveDisable.value = false;
this.receiveDisable = false; } else {
}else { receiveDisable.value = true;
this.receiveDisable = true;
} }
}, };
// const continueScan = () => {
continueScan() { scanCount.value = getScanCount(subList.value);
this.scanCount = getScanCount(this.subList); if (scanCount.value === subList.value.length) {
if (this.scanCount == this.subList.length) { closeScanPopup();
this.closeScanPopup();
} else { } else {
this.scanPopupGetFocus(); scanPopupGetFocus();
} }
}, };
updateData() { const updateData = () => {
this.calcHandleQty(); calcHandleQty();
this.updateBtn() updateBtn();
}, };
openDetail(item) { const openDetail = (item) => {
this.$refs.detailInfoPopup.openPopup(item) detailInfoPopup.value.openPopup(item);
}, };
openScanPopup() { const openScanPopup = () => {
this.$refs.scanPopup.openScanPopup(); scanPopup.value.openScanPopup();
}, };
closeScanPopup() { const closeScanPopup = () => {
this.$refs.scanPopup.closeScanPopup(); scanPopup.value.closeScanPopup();
}, };
getScanResult(result) { const getScanResult = (result) => {
try { try {
var itemCode = result.label.itemCode; const itemCode = result.label.itemCode;
var packingNumber = result.package.number; const packingNumber = result.package.number;
var batch = result.label.batch; const batch = result.label.batch;
var detail = this.detailSource.find(r => r.itemCode == itemCode); const detail = detailSource.value.find((r) => r.itemCode === itemCode);
if (detail == undefined) { if (detail === undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中") showErrorMessage(`物料号【${itemCode}】不在列表中`);
} else { } else {
var itemDetail = detail.subList.find(r => { const itemDetail = detail.subList.find((r) => r.packingNumber === packingNumber && r.batch === batch);
return r.packingNumber == packingNumber && if (itemDetail === undefined) {
r.batch == batch showErrorMessage(`箱码[${packingNumber}]批次[${batch}]不在列表中`);
})
if (itemDetail == undefined) {
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]不在列表中")
} else { } else {
if (itemDetail.scaned) { if (itemDetail.scaned) {
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]已经扫描") showErrorMessage(`箱码[${packingNumber}]批次[${batch}]已经扫描`);
} else { } else {
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.handleQty = Number(itemDetail.qty) itemDetail.handleQty = Number(itemDetail.qty);
this.calcHandleQty(); calcHandleQty();
} }
} }
} }
} catch (e) { } catch (e) {
this.showMessage(e.message) showMessage(e.message);
} }
}, };
reject() {
this.showQuestionMessage("是否拒绝接收?", res => { const reject = () => {
showQuestionMessage("是否拒绝接收?", (res) => {
if (res) { if (res) {
uni.showLoading({ uni.showLoading({title: "提交中....", mask: true});
title: "提交中....", customerReturnRecordRefuse(id.value).then((res) => {
mask: true uni.hideLoading();
}); if (res.data) {
customerReturnRecordRefuse(this.id).then(res=>{ showCommitSuccessMessage("拒绝成功");
uni.hideLoading() } else {
if(res.data){ showErrorMessage(`拒绝失败[${res.msg}]`);
this.showCommitSuccessMessage("拒绝成功")
}else {
this.showErrorMessage("拒绝失败[" + res.msg + "]")
} }
}).catch(error=>{ }).catch((error) => {
uni.hideLoading() uni.hideLoading();
this.showErrorMessage(error) showErrorMessage(error);
}) });
} }
}) });
}, };
receive() { const receive = () => {
this.scanCount = getScanCount(this.subList); scanCount.value = getScanCount(subList.value);
if (this.scanCount == 0) { if (scanCount.value === 0) {
this.showErrorMessage("扫描数为0,请先扫描") showErrorMessage("扫描数为0,请先扫描");
return; return;
} }
if (this.scanCount < this.subList.length) { if (scanCount.value < subList.value.length) {
this.showErrorMessage("还有未扫描的数据,请先扫描") showErrorMessage("还有未扫描的数据,请先扫描");
return; return;
} }
// //
if (this.scanCount == this.subList.length) { if (scanCount.value === subList.value.length) {
this.receiveSubmit(); receiveSubmit();
} }
}, };
showMessageHint(hint, callback) { const showMessageHint = (hint, callback) => {
this.$refs.comMessage.showErrorMessage(hint, res => { comMessage.value.showErrorMessage(hint, (res) => {
if (res) { if (res) {
callback() callback();
} }
}); });
}, };
receiveSubmit() { const receiveSubmit = () => {
uni.showLoading({ uni.showLoading({title: "提交中....", mask: true});
title: "提交中....", customerReturnRecordReceive(id.value).then((res) => {
mask: true uni.hideLoading();
});
customerReturnRecordReceive(this.id).then(res => {
uni.hideLoading()
if (res.data) { if (res.data) {
this.showCommitSuccessMessage("接收成功") showCommitSuccessMessage("接收成功");
} else { } else {
this.showErrorMessage("接收失败[" + res.msg + "]") showErrorMessage(`接收失败[${res.msg}]`);
} }
}).catch(error => { }).catch((error) => {
uni.hideLoading() uni.hideLoading();
this.showErrorMessage(error) showErrorMessage(error);
}) });
}, };
showMessage(message) { const showMessage = (message) => {
setTimeout(r => { setTimeout(() => {
this.scanPopupLoseFocus(); scanPopupLoseFocus();
this.$refs.comMessage.showMessage(message, res => { comMessage.value.showMessage(message, (res) => {
if (res) { if (res) {
this.afterCloseMessage() afterCloseMessage();
} }
}); });
}) });
}, };
showErrorMessage(message) { const showErrorMessage = (message) => {
setTimeout(r => { setTimeout(() => {
this.scanPopupLoseFocus(); scanPopupLoseFocus();
this.$refs.comMessage.showErrorMessage(message, res => { comMessage.value.showErrorMessage(message, (res) => {
if (res) { if (res) {
this.afterCloseMessage() afterCloseMessage();
} }
}); });
}) });
}, };
showQuestionMessage(message, callback) { const showQuestionMessage = (message, callback) => {
setTimeout(r => { setTimeout(() => {
this.scanPopupLoseFocus(); scanPopupLoseFocus();
this.$refs.comMessage.showQuestionMessage(message, res => { comMessage.value.showQuestionMessage(message, (res) => {
if (res) { if (res) {
callback(res); callback(res);
} }
}); });
}) });
}, };
scanPopupGetFocus() { const scanPopupGetFocus = () => {
if (this.$refs.scanPopup) { if (scanPopup.value) {
this.$refs.scanPopup.getfocus(); scanPopup.value.getfocus();
} }
}, };
scanPopupLoseFocus() { const scanPopupLoseFocus = () => {
if (this.$refs.scanPopup) { if (scanPopup.value) {
this.$refs.scanPopup.losefocus(); scanPopup.value.losefocus();
} }
}, };
afterCloseMessage() { const afterCloseMessage = () => {
this.scanPopupGetFocus(); scanPopupGetFocus();
}, };
const showCommitSuccessMessage = (hint) => {
showCommitSuccessMessage(hint) { comMessage.value.showSuccessMessage(hint, (res) => {
this.$refs.comMessage.showSuccessMessage(hint, res => { navigateBack(1);
navigateBack(1) });
}) };
},
const switchChange = (isOn) => {
switchChange(isOn) { isAllReceived.value = isOn;
this.isAllReceived = isOn if (isAllReceived.value) {
if(this.isAllReceived){ detailSource.value.forEach((item) => {
this.detailSource.forEach(item=>{ item.subList.forEach((info) => {
item.subList.forEach(info=>{ info.scaned = true;
info.scaned=true; info.handleQty = Number(info.qty);
info.handleQty=Number(info.qty) });
}) });
}) calcHandleQty();
this.calcHandleQty(); } else {
}else { comMessage.value.showQuestionMessage("是否要关闭整单收货?", (res) => {
this.$refs.comMessage.showQuestionMessage("是否要关闭整单收货?", res => {
if (res) { if (res) {
this.getDetail() getDetail();
} else { } else {
this.isAllReceived=true isAllReceived.value = 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>

67
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';
import productPutawayRecord from '@/pages/productPutaway/record/productPutawayRecord.vue';
export default { const title = ref('');
components: { const productPutawayRecordRef = ref(null);
productPutawayRecord
},
data() {
return {
title:''
};
},
onLoad(option){
this.title = option.title
},
onShow() { onLoad((option) => {
if(this.$refs.productPutawayRecord!=undefined){ title.value = option.title;
// this.$refs.productPutawayRecord.refresh(); });
}
},
onPullDownRefresh() { onShow(() => {
// this.$refs.productPutawayRecord.refresh(); if (productPutawayRecordRef.value) {
}, // productPutawayRecordRef.value.refresh();
onNavigationBarButtonTap(e) {
if (e.index === 0) {
this.$refs.productPutawayRecord.toHome();
} else if (e.index == 1) {
this.$refs.productPutawayRecord.openFilter();
} }
}, });
methods: {
onPullDownRefresh(() => {
if (productPutawayRecordRef.value) {
// productPutawayRecordRef.value.refresh();
} }
} });
</script>
<style scoped lang="scss"> onNavigationBarButtonTap((e) => {
if (e.index === 0) {
productPutawayRecordRef.value.toHome();
} else if (e.index === 1) {
productPutawayRecordRef.value.openFilter();
}
});
</script>
</style> <style scoped lang="scss">
</style>

65
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';
import productPutawayRecord from '@/pages/productPutaway/record/productPutawayRecord.vue';
export default { const title = ref('');
components: { const productPutawayRecordRef = ref(null);
productPutawayRecord
},
data() {
return {
title:''
};
},
onLoad(option){
this.title = option.title
},
onShow() { onLoad((option) => {
if(this.$refs.productPutawayRecord!=undefined){ title.value = option.title;
this.$refs.productPutawayRecord.refresh(); });
}
},
onPullDownRefresh() { onShow(() => {
this.$refs.productPutawayRecord.refresh(); if (productPutawayRecordRef.value) {
}, productPutawayRecordRef.value.refresh();
onNavigationBarButtonTap(e) {
if (e.index === 0) {
this.$refs.productPutawayRecord.toHome();
} else if (e.index == 1) {
this.$refs.productPutawayRecord.openFilter();
} }
}, });
methods: {
onPullDownRefresh(() => {
if (productPutawayRecordRef.value) {
productPutawayRecordRef.value.refresh();
} }
} });
</script>
<style scoped lang="scss"> onNavigationBarButtonTap((e) => {
if (e.index === 0) {
productPutawayRecordRef.value.toHome();
} else if (e.index === 1) {
productPutawayRecordRef.value.openFilter();
}
});
</script>
</style> <style scoped lang="scss">
</style>

63
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){ onLoad((option) => {
this.$refs.productReceiptRecord.refresh(); title.value = option.title;
} });
},
onPullDownRefresh() { //
this.$refs.productReceiptRecord.refresh(); onShow(() => {
}, if (productReceiptRecordRef.value) {
onNavigationBarButtonTap(e) { productReceiptRecordRef.value.refresh();
if (e.index === 0) {
this.$refs.productReceiptRecord.toHome();
} else if (e.index == 1) {
this.$refs.productReceiptRecord.openFilter();
} }
}, });
methods: {
//
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