Browse Source

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

pull/1/head
test 4 months ago
parent
commit
213bc7d37b
  1. 175
      src/pages/issue/coms/comScanIssuePack.vue
  2. 2
      src/pages/issue/job/issueDetail.vue
  3. 153
      src/pages/issue/job/issueJob.vue
  4. 2
      src/pages/repleinsh/job/repleinshJob.vue

175
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 balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import { getDetailOption, getDetailEditRemoveOption } from '@/common/array.js' 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 { uniqueArray } from '@/common/basic.js'
import { calc } from '@/common/calc.js' import { calc } from '@/common/calc.js'
@ -99,6 +99,7 @@ const label = ref({})
const inputStyleObject = ref({ const inputStyleObject = ref({
fontSize: '100rpx' fontSize: '100rpx'
}) })
const bussinessCode = ref('Issue')
const toLocationCombox = ref() const toLocationCombox = ref()
const comscansimulate = ref() const comscansimulate = ref()
const comMessageRef = ref() const comMessageRef = ref()
@ -155,7 +156,7 @@ const showBalanceSelect = (items) => {
} }
const getFromLocationList = () => { const getFromLocationList = () => {
const list = [] let list = []
dataContent.value.forEach((location) => { dataContent.value.forEach((location) => {
location.Items.forEach((item) => { location.Items.forEach((item) => {
item.Locations.forEach((f) => { item.Locations.forEach((f) => {
@ -198,78 +199,116 @@ const onScanResult = (result) => {
getfocus() getfocus()
}) })
return return
}else {
queryBalance(result)
} }
// // getBalance(result.label, packageInfoParams, (balances) => {
uni.showLoading({ // packageInfo.value = packageInfoParams
title: '加载中', // //
mask: true // const s = ''
}) // if (!result.package.parentNumber) {
// if (balances.list.length == 0) {
getBalance(result.label, packageInfoParams, (balances) => { // showErrorMessage(',')
packageInfo.value = packageInfoParams // } else {
// // const newBalances = balances.list.filter((b) => b.locationCode == fromLocationCode.value)
const s = '' // if (newBalances.length == 0) {
if (!result.package.parentNumber) { // showErrorMessage(',')
if (balances.list.length == 0) { // } else if (newBalances.length == 1) {
showErrorMessage('未查找到该包装的库存信息,请重新扫描') // const balance = newBalances[0]
} else { // afterGetBalance(result.label, balance, packageInfoParams)
const newBalances = balances.list.filter((b) => b.locationCode == fromLocationCode.value) // } else {
if (newBalances.length == 0) { // showBalanceSelect(newBalances)
showErrorMessage('未查找到该包装的库存信息,请重新扫描') // }
} else if (newBalances.length == 1) { // }
const balance = newBalances[0] // } else {
afterGetBalance(result.label, balance, packageInfoParams) // //
} else { // if (balances.list.length == 0) {
showBalanceSelect(newBalances) // showErrorMessage(',')
} // } else {
} // //
} else { // const subPackitems = balances.list.filter((r) => r.packingNumber == packageInfoParams.number)
// // //
if (balances.list.length == 0) { // const subParentPackitems = balances.list.filter((r) => r.packingNumber == packageInfoParams.parentNumber && r.locationCode == fromLocationCode.value)
showErrorMessage('未查找到该包装的库存信息,请重新扫描') //
} else { // //
// // if (subPackitems.length == 0) {
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 (subParentPackitems.length > 0) {
// if (subParentPackitems.length == 1) {
// // const balance = subParentPackitems[0]
if (subPackitems.length == 0) { // balance.qty = packageInfoParams.qty
// // afterGetBalance(result.label, balance, packageInfo)
// } else {
if (subParentPackitems.length > 0) { // showBalanceSelect(subParentPackitems)
if (subParentPackitems.length == 1) { // }
const balance = subParentPackitems[0] // } else {
balance.qty = packageInfoParams.qty // showErrorMessage(`${packageInfoParams.parentNumber}${packageInfoParams.number}`)
afterGetBalance(result.label, balance, packageInfo) // }
} else { // } else {
showBalanceSelect(subParentPackitems) // let locationCode = fromLocationCode.value
} // if (balances.list == 1) {
} else { // locationCode = balances.list[0].locationCode
showErrorMessage(`按外包装【${packageInfoParams.parentNumber}】和子包装【${packageInfoParams.number}】都未查找到库存余额`) // } else {
} // const manyBlances = balances.list.filter((r) => r.locationCode != fromLocationCode.value)
} else { // if (manyBlances.length > 0) {
let locationCode = fromLocationCode.value // locationCode = manyBlances[0].locationCode
if (balances.list == 1) { // }
locationCode = balances.list[0].locationCode // }
} else { // showErrorMessage(`${packageInfoParams.number}${locationCode},`)
const manyBlances = balances.list.filter((r) => r.locationCode != fromLocationCode.value) // }
if (manyBlances.length > 0) { // }
locationCode = manyBlances[0].locationCode // }
} // uni.hideLoading()
} // })
showErrorMessage(`该包装【${packageInfoParams.number}】在库位【${locationCode}】已经有库存余额,请重新扫描`)
}
}
}
uni.hideLoading()
})
} catch (e) { } catch (e) {
showErrorMessage(e.stack) showErrorMessage(e.stack)
uni.hideLoading() uni.hideLoading()
} }
} }
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 {
//
this.$refs.balanceSelect.openPopup(res.data);
}
uni.hideLoading()
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
}
const getBalance = (label, packageInfoParams, callback) => { const getBalance = (label, packageInfoParams, callback) => {
const filters = [] 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> <work-station :workshopCode="jobContent.workShopCode" :productionLineCode="toLocation.productionLineCode" :workStationCode="toLocation.workStationCode" :rawLocationCode="toLocation.toLocationCode"> </work-station>
</view> --> </view> -->
<com-issue-detail-card ref="comIssueDetailCardRef" :dataContent="toLocation" @updateData="updateData"> </com-issue-detail-card> <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 class="split_line"></view>
</view> </view>
</scroll-view> </scroll-view>
@ -56,6 +57,7 @@ import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue' import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue'
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
import workStation from '@/mycomponents/workStation/workStation.vue' import workStation from '@/mycomponents/workStation/workStation.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
// store // store
const store = useCountStore() const store = useCountStore()

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

@ -13,7 +13,8 @@
<u-loadmore :status="loadingType" v-if="jobList.length > 0" /> <u-loadmore :status="loadingType" v-if="jobList.length > 0" />
</view> </view>
<win-scan-button @goScan="openScanPopup" v-if="jobList.length > 0"></win-scan-button> <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> <jobListView ref="jobListRef" @selectItem="selectItem"></jobListView>
<com-message ref="comMessageRef" /> <com-message ref="comMessageRef" />
</view> </view>
@ -26,7 +27,9 @@ import { cancleTakeIssueJob, getIssueJobList, getIssueJobByProductionline, close
import { goHome, updateTitle } from '@/common/basic.js' import { goHome, updateTitle } from '@/common/basic.js'
import { getDetailOption, getDetailGiveupOption, getDetailCloseOption } from '@/common/array.js' import { getDetailOption, getDetailGiveupOption, getDetailCloseOption } from '@/common/array.js'
import {
getBusinessType
} from '@/common/record.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue' import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue' import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comIssueJobCard from '@/pages/issue/coms/comIssueJobCard.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 winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackJob from '@/mycomponents/scan/winScanPackJob.vue' import winScanPackJob from '@/mycomponents/scan/winScanPackJob.vue'
import jobListView from '@/mycomponents/jobList/jobList.vue' import jobListView from '@/mycomponents/jobList/jobList.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
// store // store
const store = useCountStore() const store = useCountStore()
@ -65,6 +68,10 @@ const jobInfoPopupRef = ref()
const jobListPopupRef = ref() const jobListPopupRef = ref()
const scanPopup = ref() const scanPopup = ref()
const jobListRef = ref() const jobListRef = ref()
const businessTypeCode = ref('Issue')
const businessType = ref(null)
const fromInventoryStatuses = ref()
const fromLocationAreaTypeList = ref([])
onShow(() => { onShow(() => {
nextTick(() => { nextTick(() => {
getList('refresh', fromLocation.value, productionLine.value) getList('refresh', fromLocation.value, productionLine.value)
@ -106,6 +113,18 @@ onNavigationBarButtonTap((e) => {
filter.value.openFilter() 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 = () => { const getIssueJobByProductionline1 = () => {
getIssueJobByProductionline().then((res) => { getIssueJobByProductionline().then((res) => {
console.log('生产线', res) console.log('生产线', res)
@ -372,67 +391,81 @@ const showMessage = (message) => {
} }
const openScanPopup = () => { const openScanPopup = () => {
scanPopup.value.openScanPopup() scanPopup.value.openScanPopup()
if (businessType.value == null) {
getBusinessTypeFunc()
} else {
scanPopup.value.openScanPopup(businessType.value);
}
} }
const getScanResult = (result) => { const getScanResult = (result) => {
if (!result.label.batch) { let balance = result.balance;
showMessage('批次为空') if (balance != null) {
return scanMessage.value = ""
} if (!result.label.batch) {
if (!result.label.itemCode) { showMessage('批次为空')
showMessage('物料号为空') return
return }
} if (!result.label.itemCode) {
try { showMessage('物料号为空')
const filters = [ return
{ }
column: 'status', try {
action: 'in', const filters = [
value: '1,2' {
}, column: 'status',
{ action: 'in',
column: 'batch', value: '1,2'
action: '==', },
value: result.label.batch {
}, column: 'batch',
{ action: '==',
column: 'itemCode', value: result.label.batch
action: '==', },
value: result.label.itemCode {
} column: 'itemCode',
] action: '==',
getIssueJobList({ value: result.label.itemCode
filters, },
pageNo: 1, {
pageSize: 1000, column: "fromLocationCode",
sort: 'createTime', action: "==",
by: 'asc' value: balance.locationCode
})
.then((res) => {
scanMessage.value = result.scanMessage
const resultList = res.data.list
if (resultList.length > 0) {
resultList.forEach((item) => {
item.title = item.number
item.selected = false
})
const list = []
resultList.forEach((item) => {
if (!list.find((subItem) => subItem.title == item.title)) {
list.push(item)
}
})
if (list.length > 0) {
selectItem(list[0])
}
} else {
showMessage(`物料号[${result.label.itemCode}]批次[${result.label.batch}]` + '未查找到任务<br>' + `扫描[${result.scanMessage}]`)
} }
]
getIssueJobList({
filters,
pageNo: 1,
pageSize: 1000,
sort: 'createTime',
by: 'asc'
}) })
.catch((error) => { .then((res) => {
showMessage(`${error}<br>扫描[${result.scanMessage}]`) scanMessage.value = result.scanMessage
}) const resultList = res.data.list
} catch (e) { if (resultList.length > 0) {
showMessage(e.message) resultList.forEach((item) => {
item.title = item.number
item.selected = false
})
const list = []
resultList.forEach((item) => {
if (!list.find((subItem) => subItem.title == item.title)) {
list.push(item)
}
})
if (list.length > 0) {
selectItem(list[0])
}
} else {
showMessage(`物料号[${result.label.itemCode}]批次[${result.label.batch}]` + '未查找到任务<br>' + `扫描[${result.scanMessage}]`)
}
})
.catch((error) => {
showMessage(`${error}<br>扫描[${result.scanMessage}]`)
})
} catch (e) {
showMessage(e.message)
}
} }
} }
</script> </script>

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

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

Loading…
Cancel
Save