From 62f956ab1cf14c0d7dadede35d06a23afd973e56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BF=97=E5=9B=BD?= <854933521@qq.com> Date: Mon, 28 Oct 2024 13:38:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E6=96=99=EF=BC=8C=E8=A1=A5=E6=96=99?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=EF=BC=8C=E6=9F=A5=E8=AF=A2=EF=BC=8C=E9=87=8D?= =?UTF-8?q?=E7=BD=AE=E5=8A=9F=E8=83=BD=202024/8/7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mycomponents/job/jobFilter.vue | 10 +++- src/pages/issue/job/issueJob.vue | 64 ++++++++++++++++-------- src/pages/repleinsh/job/repleinshJob.vue | 52 ++++++++++++------- 3 files changed, 86 insertions(+), 40 deletions(-) diff --git a/src/mycomponents/job/jobFilter.vue b/src/mycomponents/job/jobFilter.vue index 844ec414..91b7bf83 100644 --- a/src/mycomponents/job/jobFilter.vue +++ b/src/mycomponents/job/jobFilter.vue @@ -60,7 +60,7 @@ --> - + @@ -161,6 +161,14 @@ const query = ()=> { emit("onQuery", params) closeScanPopup(); } +const reset = ()=>{ + productionLineCode.value = '' + fromLocationCode.value = '' + itemCode.value = '' + creationTime.value = '' + status.value = '' + query() +}, // 生产线 const productionLineCodeConfirm = (e) => { const lineCode = e diff --git a/src/pages/issue/job/issueJob.vue b/src/pages/issue/job/issueJob.vue index 00a2f0fa..8edede1a 100644 --- a/src/pages/issue/job/issueJob.vue +++ b/src/pages/issue/job/issueJob.vue @@ -78,11 +78,12 @@ const scanPopup = ref() const jobListRef = ref() const businessTypeCode = ref('Issue') const businessType = ref(null) +const filterItemCode = ref('') const fromInventoryStatuses = ref() const fromLocationAreaTypeList = ref([]) onShow(() => { nextTick(() => { - getList('refresh', fromLocation.value, productionLine.value) + getList('refresh', fromLocation.value, productionLine.value,filterItemCode.value) }) }) onLoad((option) => { @@ -99,10 +100,10 @@ onReachBottom(() => { if (loadingType.value == 'loading' || loadingType.value == 'nomore') { return } - getList('more', fromLocation.value, productionLine.value) + getList('more', fromLocation.value, productionLine.value,filterItemCode.value) }) onPullDownRefresh(() => { - getList('refresh', fromLocation.value, productionLine.value) + getList('refresh', fromLocation.value, productionLine.value,filterItemCode.value) }) // 后退按钮 onBackPress((options) => { @@ -150,7 +151,7 @@ const getIssueJobByProductionline1 = () => { } }) } -const getList = (type, fromLocation = '', productionLine = '') => { +const getList = (type, fromLocation = '', productionLine = '',filterItemCode = '') => { proxy.$modal.loading('加载中­....') loadingType.value = 'loading' if (type === 'refresh') { @@ -193,6 +194,14 @@ const getList = (type, fromLocation = '', productionLine = '') => { value: productionLine }) } + if(filterItemCode){ + // 物料代码 + filters.push({ + column: "itemCode", + action: "like", + value: filterItemCode + }) + } const params = { filters, pageNo: pageNo.value, @@ -295,55 +304,66 @@ const getListByFilter = ( param )=>{ }) if (param.fromLocationCode) { + fromLocation.value = param.fromLocationCode // 来源库位 filters.push({ column: "fromLocationCode", action: "==", value: param.fromLocationCode }) + }else{ + fromLocation.value = '' } + if (param.productionLineCode) { + productionLine.value = param.productionLineCode // 生产线 filters.push({ column: "productionLineCode", action: "==", value: param.productionLineCode }) + }else{ + productionLine.value = '' } if (param.itemCode) { - // 生产线 + filterItemCode.value = param.itemCode + // 物料代码 filters.push({ column: "itemCode", action: "like", value: param.itemCode }) + }else{ + filterItemCode.value = '' } let params = { filters: filters, pageNo: 1, pageSize: 100, } - getIssueJobList(params).then(res => { - uni.hideLoading(); - if (res.data.total == 0) { - showMessage('未查找到' + '【' + code + '】的收货任务'); - } else if (res.data.total == 1) { - openJobDetail(res.data.list[0]); - } else { - showItemList(res.data.list); - } - }).catch(error => { - showMessage(error) - }) + getList('refresh', fromLocation.value, productionLine.value, filterItemCode.value) + // getIssueJobList(params).then(res => { + // uni.hideLoading(); + // if (res.data.total == 0) { + // showMessage('未查找到' + '【' + code + '】的收货任务'); + // } else if (res.data.total == 1) { + // openJobDetail(res.data.list[0]); + // } else { + // showItemList(res.data.list); + // } + // }).catch(error => { + // showMessage(error) + // }) } const fromLocationCode = (fromLocationParams) => { fromLocation.value = fromLocationParams - getList('refresh', fromLocation.value, productionLine.value) + getList('refresh', fromLocation.value, productionLine.value,filterItemCode.value) } const productionLineCode = (productionLineCode) => { productionLine.value = productionLineCode - getList('refresh', fromLocation.value, productionLine.value) + getList('refresh', fromLocation.value, productionLine.value,filterItemCode.value) } const getByAsnNumber = (code) => { proxy.$modal.loading('加载中­....') @@ -372,7 +392,7 @@ const cancleJob = (id) => { cancleTakeIssueJob(id) .then((res) => { if (res.data) { - getList('refresh', fromLocation.value, productionLine.value) + getList('refresh', fromLocation.value, productionLine.value,filterItemCode.value) uni.showToast({ title: '放弃任务成功' }) @@ -410,12 +430,12 @@ const closeJob = (id) => { const switchChangeToday = (state, creationTime) => { checkedToday.value = state todayTime.value = creationTime - getList('refresh', fromLocation.value, productionLine.value) + getList('refresh', fromLocation.value, productionLine.value,filterItemCode.value) } const switchChangeWait = (state, jobStatus) => { checkedWaitTask.value = state status.value = jobStatus - getList('refresh', fromLocation.value, productionLine.value) + getList('refresh', fromLocation.value, productionLine.value,filterItemCode.value) } const getScanNumber = (code) => { getDataListByType(code) diff --git a/src/pages/repleinsh/job/repleinshJob.vue b/src/pages/repleinsh/job/repleinshJob.vue index 6efe2cf4..139252a4 100644 --- a/src/pages/repleinsh/job/repleinshJob.vue +++ b/src/pages/repleinsh/job/repleinshJob.vue @@ -75,6 +75,8 @@ const inInventoryStatus = ref("") const checkedWaitTask = ref(false) const productionLineCode = ref('') const productionlineList = ref([]) +const fromLocationCode = ref('') +const filterItemCode = ref('') onShow(() => { nextTick(() => { getList('refresh') @@ -94,10 +96,10 @@ onReachBottom(() => { if (loadingType.value == 'loading' || loadingType.value == 'nomore') { return } - getList('more') + getList('more',fromLocationCode.value,filterItemCode.value) }) onPullDownRefresh(() => { - getList('refresh') + getList('refresh',fromLocationCode.value,filterItemCode.value) }) // 后退按钮 onBackPress((options) => { @@ -116,7 +118,7 @@ onNavigationBarButtonTap((e) => { filter.value.openFilter() } }) -const getList = (type, fromLocationCode = '') => { +const getList = (type, fromLocationCode = '', filterItemCode = '') => { proxy.$modal.loading('加载中­....') loadingType.value = 'loading' if (type === 'refresh') { @@ -151,6 +153,14 @@ const getList = (type, fromLocationCode = '') => { value: fromLocationCode }) } + if (filterItemCode != '') { + // 物料代码 + filters.push({ + column: "itemCode", + action: "like", + value: filterItemCode + }) + } const params = { filters, pageNo: pageNo.value, @@ -188,7 +198,8 @@ const getList = (type, fromLocationCode = '') => { } const fromLocationCode = (fromLocationCode) => { console.log('fromLocationCode', fromLocationCode) - getList('refresh', fromLocationCode, '') + fromLocationCode.value = fromLocationCode + getList('refresh', fromLocationCode.value, filterItemCode.value) } const openJobDetail = (item, scanMessageParams = '') => { proxy.$tab.navigateTo(`./repleinshDetail?id=${item.masterId}&status=${item.status}&scanMessage=${scanMessage.value}&title=${title.value}`) @@ -361,11 +372,14 @@ const getListByFilter = ( param )=>{ if (param.fromLocationCode) { // 来源库位 + fromLocationCode.value = param.fromLocationCode filters.push({ column: "fromLocationCode", action: "==", value: param.fromLocationCode }) + }else{ + fromLocationCode.value = '' } // if (param.productionLine) { // // 生产线 @@ -376,30 +390,34 @@ const getListByFilter = ( param )=>{ // }) // } if (param.itemCode) { - // 生产线 + // 物料代码 + filterItemCode.value = param.itemCode filters.push({ column: "itemCode", action: "like", value: param.itemCode }) + }else{ + filterItemCode.value = '' } let params = { filters: filters, pageNo: 1, pageSize: 100, } - getIssueJobList(params).then(res => { - uni.hideLoading(); - if (res.data.total == 0) { - showMessage('未查找到补料任务'); - } else if (res.data.total == 1) { - openJobDetail(res.data.list[0]); - } else { - showItemList(res.data.list); - } - }).catch(error => { - showMessage(error) - }) + getList('refresh', fromLocationCode.value, filterItemCode.value) + // getIssueJobList(params).then(res => { + // uni.hideLoading(); + // if (res.data.total == 0) { + // showMessage('未查找到补料任务'); + // } else if (res.data.total == 1) { + // openJobDetail(res.data.list[0]); + // } else { + // showItemList(res.data.list); + // } + // }).catch(error => { + // showMessage(error) + // }) } const selectItem = (item) => { scanPopup.value.closeScanPopup()