Browse Source

修改发料任务的扫描 2024/8/6

hella_vue3
王志国 1 month ago
parent
commit
213bc7d37b
  1. 169
      src/pages/issue/coms/comScanIssuePack.vue
  2. 2
      src/pages/issue/job/issueDetail.vue
  3. 39
      src/pages/issue/job/issueJob.vue
  4. 2
      src/pages/repleinsh/job/repleinshJob.vue

169
src/pages/issue/coms/comScanIssuePack.vue

@ -60,7 +60,7 @@ import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import { getDetailOption, getDetailEditRemoveOption } from '@/common/array.js'
import { getWorkShopLineStation, getBalanceByFilter } from '@/api/request2.js'
import { getWorkShopLineStation, getBalanceByFilter,getBalanceByParams } from '@/api/request2.js'
import { uniqueArray } from '@/common/basic.js'
import { calc } from '@/common/calc.js'
@ -99,6 +99,7 @@ const label = ref({})
const inputStyleObject = ref({
fontSize: '100rpx'
})
const bussinessCode = ref('Issue')
const toLocationCombox = ref()
const comscansimulate = ref()
const comMessageRef = ref()
@ -155,7 +156,7 @@ const showBalanceSelect = (items) => {
}
const getFromLocationList = () => {
const list = []
let list = []
dataContent.value.forEach((location) => {
location.Items.forEach((item) => {
item.Locations.forEach((f) => {
@ -198,78 +199,116 @@ const onScanResult = (result) => {
getfocus()
})
return
}
//
uni.showLoading({
title: '加载中',
mask: true
})
getBalance(result.label, packageInfoParams, (balances) => {
packageInfo.value = packageInfoParams
//
const s = ''
if (!result.package.parentNumber) {
if (balances.list.length == 0) {
showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} else {
const newBalances = balances.list.filter((b) => b.locationCode == fromLocationCode.value)
if (newBalances.length == 0) {
showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} else if (newBalances.length == 1) {
const balance = newBalances[0]
afterGetBalance(result.label, balance, packageInfoParams)
}else {
showBalanceSelect(newBalances)
}
queryBalance(result)
}
// getBalance(result.label, packageInfoParams, (balances) => {
// packageInfo.value = packageInfoParams
// //
// const s = ''
// if (!result.package.parentNumber) {
// if (balances.list.length == 0) {
// showErrorMessage(',')
// } else {
// const newBalances = balances.list.filter((b) => b.locationCode == fromLocationCode.value)
// if (newBalances.length == 0) {
// showErrorMessage(',')
// } else if (newBalances.length == 1) {
// const balance = newBalances[0]
// afterGetBalance(result.label, balance, packageInfoParams)
// } else {
// showBalanceSelect(newBalances)
// }
// }
// } else {
// //
// if (balances.list.length == 0) {
// showErrorMessage(',')
// } else {
// //
// const subPackitems = balances.list.filter((r) => r.packingNumber == packageInfoParams.number)
// //
// const subParentPackitems = balances.list.filter((r) => r.packingNumber == packageInfoParams.parentNumber && r.locationCode == fromLocationCode.value)
//
// //
// if (subPackitems.length == 0) {
// //
//
// if (subParentPackitems.length > 0) {
// if (subParentPackitems.length == 1) {
// const balance = subParentPackitems[0]
// balance.qty = packageInfoParams.qty
// afterGetBalance(result.label, balance, packageInfo)
// } else {
// showBalanceSelect(subParentPackitems)
// }
// } else {
// showErrorMessage(`${packageInfoParams.parentNumber}${packageInfoParams.number}`)
// }
// } else {
// let locationCode = fromLocationCode.value
// if (balances.list == 1) {
// locationCode = balances.list[0].locationCode
// } else {
// const manyBlances = balances.list.filter((r) => r.locationCode != fromLocationCode.value)
// if (manyBlances.length > 0) {
// locationCode = manyBlances[0].locationCode
// }
// }
// showErrorMessage(`${packageInfoParams.number}${locationCode},`)
// }
// }
// }
// uni.hideLoading()
// })
} catch (e) {
showErrorMessage(e.stack)
uni.hideLoading()
}
} else {
//
if (balances.list.length == 0) {
showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} else {
//
const subPackitems = balances.list.filter((r) => r.packingNumber == packageInfoParams.number)
//
const subParentPackitems = balances.list.filter((r) => r.packingNumber == packageInfoParams.parentNumber && r.locationCode == fromLocationCode.value)
//
if (subPackitems.length == 0) {
//
if (subParentPackitems.length > 0) {
if (subParentPackitems.length == 1) {
const balance = subParentPackitems[0]
balance.qty = packageInfoParams.qty
afterGetBalance(result.label, balance, packageInfo)
} else {
showBalanceSelect(subParentPackitems)
}
} else {
showErrorMessage(`按外包装【${packageInfoParams.parentNumber}】和子包装【${packageInfoParams.number}】都未查找到库存余额`)
const queryBalance = (result)=>{
var params = {
itemCode: result.package.itemCode,
batch: result.label.batch,
packingNumber: result.label.packingNumber,
parentPackingNumber: result.package.parentNumber,
inventoryStatus: jobContent.value.outInventoryStatuses.split(','),
areaType:jobContent.value.fromAreaTypes.split(','),
bussinessCode:jobContent.value.businessType
}
uni.showLoading({
title: '查询中',
mask: true
})
getBalanceByParams(params).then(res => {
if (res.data.length == 0) {
var status = getInventoryStatusDesc(params.inventoryStatus)
var areaType = getListLocationAreaTypeDesc(params.areaType)
var hint =
"按物料号 [" + params.itemCode + "] <br>" +
"包装号 [" + params.packingNumber + "] <br>" +
"批次 [" + params.batch + "] <br>" +
"状态 [" + status + "] <br>" +
"库区 [" + areaType + "] <br>" +
"未查找到库存余额"
this.showErrorMessage(hint)
} else if (res.data.length == 1) {
result.balance = res.data[0]
if (result.label.packingNumber != result.balance.packingNumber) {
result.balance.lableQty = result.label.qty
}
this.afterGetBalance(result.label, result.balance, result.package);
} else {
let locationCode = fromLocationCode.value
if (balances.list == 1) {
locationCode = balances.list[0].locationCode
} else {
const manyBlances = balances.list.filter((r) => r.locationCode != fromLocationCode.value)
if (manyBlances.length > 0) {
locationCode = manyBlances[0].locationCode
}
}
showErrorMessage(`该包装【${packageInfoParams.number}】在库位【${locationCode}】已经有库存余额,请重新扫描`)
}
}
//
this.$refs.balanceSelect.openPopup(res.data);
}
uni.hideLoading()
})
} catch (e) {
showErrorMessage(e.stack)
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
}
}
const getBalance = (label, packageInfoParams, callback) => {
const filters = []

2
src/pages/issue/job/issueDetail.vue

@ -20,6 +20,7 @@
<work-station :workshopCode="jobContent.workShopCode" :productionLineCode="toLocation.productionLineCode" :workStationCode="toLocation.workStationCode" :rawLocationCode="toLocation.toLocationCode"> </work-station>
</view> -->
<com-issue-detail-card ref="comIssueDetailCardRef" :dataContent="toLocation" @updateData="updateData"> </com-issue-detail-card>
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select>
<view class="split_line"></view>
</view>
</scroll-view>
@ -56,6 +57,7 @@ import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
import workStation from '@/mycomponents/workStation/workStation.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import { useCountStore } from '@/store'
// store
const store = useCountStore()

39
src/pages/issue/job/issueJob.vue

@ -13,7 +13,8 @@
<u-loadmore :status="loadingType" v-if="jobList.length > 0" />
</view>
<win-scan-button @goScan="openScanPopup" v-if="jobList.length > 0"></win-scan-button>
<winScanPackJob ref="scanPopup" @getResult="getScanResult"></winScanPackJob>
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode">
</winComScanBalance>
<jobListView ref="jobListRef" @selectItem="selectItem"></jobListView>
<com-message ref="comMessageRef" />
</view>
@ -26,7 +27,9 @@ import { cancleTakeIssueJob, getIssueJobList, getIssueJobByProductionline, close
import { goHome, updateTitle } from '@/common/basic.js'
import { getDetailOption, getDetailGiveupOption, getDetailCloseOption } from '@/common/array.js'
import {
getBusinessType
} from '@/common/record.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comIssueJobCard from '@/pages/issue/coms/comIssueJobCard.vue'
@ -36,7 +39,7 @@ import jobInfoPopup from '@/pages/issue/coms/jobInfoPopup.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackJob from '@/mycomponents/scan/winScanPackJob.vue'
import jobListView from '@/mycomponents/jobList/jobList.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
import { useCountStore } from '@/store'
// store
const store = useCountStore()
@ -65,6 +68,10 @@ const jobInfoPopupRef = ref()
const jobListPopupRef = ref()
const scanPopup = ref()
const jobListRef = ref()
const businessTypeCode = ref('Issue')
const businessType = ref(null)
const fromInventoryStatuses = ref()
const fromLocationAreaTypeList = ref([])
onShow(() => {
nextTick(() => {
getList('refresh', fromLocation.value, productionLine.value)
@ -106,6 +113,18 @@ onNavigationBarButtonTap((e) => {
filter.value.openFilter()
}
})
const getBusinessTypeFunc = ()=> {
getBusinessType(businessTypeCode.value, res => {
if (res.success) {
businessType.value = res.businessType;
fromInventoryStatuses.value = res.fromInventoryStatuses.split(',');
fromLocationAreaTypeList.value = res.fromLocationAreaTypeList
// this.openScanPopup();
} else {
showErrorMessage(res.message)
}
});
}
const getIssueJobByProductionline1 = () => {
getIssueJobByProductionline().then((res) => {
console.log('生产线', res)
@ -372,8 +391,16 @@ const showMessage = (message) => {
}
const openScanPopup = () => {
scanPopup.value.openScanPopup()
if (businessType.value == null) {
getBusinessTypeFunc()
} else {
scanPopup.value.openScanPopup(businessType.value);
}
}
const getScanResult = (result) => {
let balance = result.balance;
if (balance != null) {
scanMessage.value = ""
if (!result.label.batch) {
showMessage('批次为空')
return
@ -398,6 +425,11 @@ const getScanResult = (result) => {
column: 'itemCode',
action: '==',
value: result.label.itemCode
},
{
column: "fromLocationCode",
action: "==",
value: balance.locationCode
}
]
getIssueJobList({
@ -435,6 +467,7 @@ const getScanResult = (result) => {
showMessage(e.message)
}
}
}
</script>
<style scoped lang="scss"></style>

2
src/pages/repleinsh/job/repleinshJob.vue

@ -415,7 +415,7 @@ const getBusinessTypeFunc = ()=> {
getBusinessType(this.businessTypeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.fromInventoryStatuses = getDirectoryItemArray(res.fromInventoryStatuses);
this.fromInventoryStatuses = getDirectoryItemArray(res.fromInventoryStatuses).split(',');
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList
// this.openScanPopup();
} else {

Loading…
Cancel
Save