Browse Source

修改直接补料2024/6/21 16:36:24

hella_vue3
zhang_li 3 months ago
parent
commit
937c7574be
  1. 4
      src/api/request2.js
  2. 64
      src/common/balance.js
  3. 1
      src/mycomponents/balance/balance.vue
  4. 7
      src/mycomponents/job/jobFilter.vue
  5. 6
      src/mycomponents/jobList/jobList.vue
  6. 7
      src/mycomponents/scan/winScanPackAndLocation.vue
  7. 21
      src/pages/issue/job/issueJob.vue
  8. 16
      src/pages/purchaseReceipt/job/receiptJob.vue
  9. 18
      src/pages/repleinsh/coms/comScanReplishPack.vue
  10. 24
      src/pages/repleinsh/job/repleinshDetail.vue
  11. 5
      src/pages/repleinsh/record/directRepleinshRecord.vue

4
src/api/request2.js

@ -821,6 +821,10 @@ export function putawayRecordSubmit(params) {
export function getIssueJobList(params) { export function getIssueJobList(params) {
return http.post("/wms/issue-job-detail/senior",params) return http.post("/wms/issue-job-detail/senior",params)
} }
export function getIssueJobByProductionline() {
return http.get("/issue-job-mwmsain/getIssueJobByProductionline")
}
/** /**
* 发料任务明细 * 发料任务明细
* @param {*} 任务id * @param {*} 任务id

64
src/common/balance.js

@ -134,6 +134,54 @@ export function getManagementPrecisions(itemCodes, locationCode, callback) {
callback(result); callback(result);
}) })
} }
//通过父包装查询
export function getBalanceByManagementPrecisionByPacking(label, packageInfo,locationCode, fromInventoryStatuses, callback) {
let result = {
list: [],
success: true,
message: ''
};
let params = {
itemCodes: [label.itemCode],
locationCode: locationCode
};
// let jsonParem = JSON.stringify(param)
getManagementPrecision(params).then(res => {
let managementPrecision = res.data[0].ManagementPrecision;
switch (managementPrecision) {
case 'BY_PACKAGING':
byPacking(label, packageInfo,locationCode, fromInventoryStatuses, res => {
res.managementPrecision = managementPrecision;
callback(res);
});
break;
case 'BY_BATCH':
byBatch(label, locationCode, fromInventoryStatuses, res => {
res.managementPrecision = managementPrecision;
callback(res);
});
break;
case 'BY_QUANTITY':
byQuantity(label, locationCode, fromInventoryStatuses, res => {
res.managementPrecision = managementPrecision;
callback(res);
});
break;
case 'BY_UNIQUEID':
byUniqueId(label, fromInventoryStatuses, res => {
res.managementPrecision = managementPrecision;
callback(res);
});
break;
}
}).catch(error => {
let result = {
success: false,
message: error
};
callback(result);
})
}
export function getBalanceByManagementPrecision(label, locationCode, fromInventoryStatuses, callback) { export function getBalanceByManagementPrecision(label, locationCode, fromInventoryStatuses, callback) {
@ -154,7 +202,7 @@ export function getBalanceByManagementPrecision(label, locationCode, fromInvento
let managementPrecision = res.data[0].ManagementPrecision; let managementPrecision = res.data[0].ManagementPrecision;
switch (managementPrecision) { switch (managementPrecision) {
case 'BY_PACKAGING': case 'BY_PACKAGING':
byPacking(label, locationCode, fromInventoryStatuses, res => { byPacking(label, "", locationCode, fromInventoryStatuses, res => {
res.managementPrecision = managementPrecision; res.managementPrecision = managementPrecision;
callback(res); callback(res);
}); });
@ -199,6 +247,20 @@ export function byPacking(label, locationCode, fromInventoryStatuses, callback)
data: {} data: {}
}; };
var filters = [] var filters = []
if (packageInfo&&packageInfo.parentNumber) {
var packingNumber = packageInfo.parentNumber + "," + label.packingNumber;
filters.push({
column: "packingNumber",
action: "in",
value: packingNumber
})
} else {
filters.push({
column: "packingNumber",
action: "==",
value: label.packingNumber
})
}
filters.push({ filters.push({
column: "packingNumber", column: "packingNumber",
action: "==", action: "==",

1
src/mycomponents/balance/balance.vue

@ -2,6 +2,7 @@
<view :class="dataContent.scaned ? 'scan_view' : ''"> <view :class="dataContent.scaned ? 'scan_view' : ''">
<view class="uni-flex uni-row space-between" style="align-items: center; padding: 20rpx"> <view class="uni-flex uni-row space-between" style="align-items: center; padding: 20rpx">
<view> <view>
<pack v-if="dataContent.parentNumber" title="父包装" :packingCode="dataContent.parentNumber"></pack>
<pack v-if="isShowPack && dataContent.packingNumber" :packingCode="dataContent.packingNumber"></pack> <pack v-if="isShowPack && dataContent.packingNumber" :packingCode="dataContent.packingNumber"></pack>
<batch v-if="isShowBatch && dataContent.batch" :batch="dataContent.batch"></batch> <batch v-if="isShowBatch && dataContent.batch" :batch="dataContent.batch"></batch>
<location title="来源库位" v-if="isShowFromLocation" :locationCode="dataContent.locationCode"></location> <location title="来源库位" v-if="isShowFromLocation" :locationCode="dataContent.locationCode"></location>

7
src/mycomponents/job/jobFilter.vue

@ -13,7 +13,8 @@
</view> </view>
<view v-if="isShowProductionLineCode" class="uni-flex space-between u-col-center" style="width: 100%; margin-top: 30rpx"> <view v-if="isShowProductionLineCode" class="uni-flex space-between u-col-center" style="width: 100%; margin-top: 30rpx">
<view class="" style="font-size: 32rpx"> 生产线 </view> <view class="" style="font-size: 32rpx"> 生产线 </view>
<u-input style="margin-left: 20rpx" v-model="productionLineCode" :border="true" placeholder="请输入生产线" @confirm="productionLineCodeConfirm" /> <!-- <u-input style="margin-left: 20rpx" v-model="productionLineCode" :border="true" placeholder="请输入生产线" @confirm="productionLineCodeConfirm" /> -->
<uni-data-select class="uni-data-select" style="margin-left: 20rpx" placeholder="请输入生产线" v-model="productionLineCode" :clear="false" :localdata="productionline" @change="productionLineCodeConfirm"></uni-data-select>
</view> </view>
<view v-if="isShowFromLocationCode" class="uni-flex space-between u-col-center" style="width: 100%; margin-top: 30rpx"> <view v-if="isShowFromLocationCode" class="uni-flex space-between u-col-center" style="width: 100%; margin-top: 30rpx">
<view class="" style="font-size: 32rpx"> 来源库位 </view> <view class="" style="font-size: 32rpx"> 来源库位 </view>
@ -68,6 +69,10 @@ const props = defineProps({
isShowProductionLineCode: { isShowProductionLineCode: {
type: Boolean, type: Boolean,
default: false default: false
},
productionline: {
type: Array,
default: []
} }
}) })
const dataContent = ref({}) const dataContent = ref({})

6
src/mycomponents/jobList/jobList.vue

@ -23,13 +23,15 @@ import { ref } from 'vue'
const list = ref([]) const list = ref([])
const show = ref(false) const show = ref(false)
const openList = (listParmas) => { const isScanedASN = ref(false)
const openList = (listParmas, isScanedASNParmas = false) => {
list.value = listParmas list.value = listParmas
isScanedASN.value = isScanedASNParmas
show.value = true show.value = true
} }
const selectItem = (item, index) => { const selectItem = (item, index) => {
show.value = false show.value = false
emit('selectItem', item) emit('selectItem', item, isScanedASN.value)
} }
// //

7
src/mycomponents/scan/winScanPackAndLocation.vue

@ -44,7 +44,7 @@
import { ref, getCurrentInstance } from 'vue' import { ref, getCurrentInstance } from 'vue'
import winComScan from '@/mycomponents/scan/winComScan.vue' import winComScan from '@/mycomponents/scan/winComScan.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue' import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import { getBalanceByManagementPrecision } from '@/common/balance.js' import { getBalanceByManagementPrecisionByPacking } from '@/common/balance.js'
import { getBasicLocationByCode } from '@/api/request2.js' import { getBasicLocationByCode } from '@/api/request2.js'
@ -210,10 +210,12 @@ const scanLocation = (scanResult) => {
// this.packGetFocus(); // this.packGetFocus();
checkPackage(scanResult) checkPackage(scanResult)
} else { } else {
uni.hideLoading()
const hint = getListLocationAreaTypeDesc(fromLocationAreaTypeList.value) const hint = getListLocationAreaTypeDesc(fromLocationAreaTypeList.value)
showErrorMessage(`扫描库位[${fromLocationCode.value}]是[${getLocationAreaTypeName(result.areaType)}],需要的库区是[${hint}]`) showErrorMessage(`扫描库位[${fromLocationCode.value}]是[${getLocationAreaTypeName(result.areaType)}],需要的库区是[${hint}]`)
} }
} else { } else {
uni.hideLoading()
showErrorMessage(`扫描库位[${fromLocationCode.value}]不可用`, (res) => { showErrorMessage(`扫描库位[${fromLocationCode.value}]不可用`, (res) => {
locationGetFocus() locationGetFocus()
}) })
@ -254,7 +256,7 @@ const checkPackage = (result) => {
// mask: true // mask: true
// }) // })
if (props.queryBalance == true) { if (props.queryBalance == true) {
getBalanceByManagementPrecision(result.label, fromLocationCode.value, props.balanceFromInventoryStatuses ? fromInventoryStatuses.value : undefined, (res) => { getBalanceByManagementPrecisionByPacking(result.label, fromLocationCode.value, props.balanceFromInventoryStatuses ? fromInventoryStatuses.value : undefined, (res) => {
uni.hideLoading() uni.hideLoading()
if (res.success) { if (res.success) {
managementPrecision.value = res.managementPrecision managementPrecision.value = res.managementPrecision
@ -267,6 +269,7 @@ const checkPackage = (result) => {
// uni.hideLoading(); // uni.hideLoading();
}) })
} else { } else {
uni.hideLoading()
packCallBack(null) packCallBack(null)
} }
} }

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

@ -1,7 +1,7 @@
<template> <template>
<view class=""> <view class="">
<com-empty-view v-if="jobList.length == 0"></com-empty-view> <com-empty-view v-if="jobList.length == 0"></com-empty-view>
<job-filter :isShowFromLocationCode="true" :isShowProductionLineCode="true" ref="filter" otherTitle="" @switchChangeToday="switchChangeToday" @switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday" :checkedWaitTask="checkedWaitTask" @productionLineCode="productionLineCode" @fromLocationCode="fromLocationCode"> </job-filter> <job-filter :isShowFromLocationCode="true" :isShowProductionLineCode="true" :productionline="productionline" ref="filter" otherTitle="" @switchChangeToday="switchChangeToday" @switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday" :checkedWaitTask="checkedWaitTask" @productionLineCode="productionLineCode" @fromLocationCode="fromLocationCode"> </job-filter>
<view v-if="jobList.length > 0" class="u-m-20"> <view v-if="jobList.length > 0" class="u-m-20">
<u-swipe-action :show="item.show" :index="index" v-for="(item, index) in jobList" :key="index" :options="item.status == '2' ? detailGiveupOptions : detailOptions" bg-color="rgba(255,255,255,0)" class="u-m-b-20" @click="swipeClick"> <u-swipe-action :show="item.show" :index="index" v-for="(item, index) in jobList" :key="index" :options="item.status == '2' ? detailGiveupOptions : detailOptions" bg-color="rgba(255,255,255,0)" class="u-m-b-20" @click="swipeClick">
<com-issue-job-card :dataContent="item" @click="openJobDetail(item)"></com-issue-job-card> <com-issue-job-card :dataContent="item" @click="openJobDetail(item)"></com-issue-job-card>
@ -22,7 +22,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, getCurrentInstance, nextTick } from 'vue' import { ref, getCurrentInstance, nextTick } from 'vue'
import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app' import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
import { cancleTakeIssueJob, getIssueJobList } from '@/api/request2.js' import { cancleTakeIssueJob, getIssueJobList, getIssueJobByProductionline } from '@/api/request2.js'
import { goHome, updateTitle } from '@/common/basic.js' import { goHome, updateTitle } from '@/common/basic.js'
import { getDetailOption, getDetailGiveupOption } from '@/common/array.js' import { getDetailOption, getDetailGiveupOption } from '@/common/array.js'
@ -49,6 +49,7 @@ const todayTime = ref('')
const status = ref('1,2') // const status = ref('1,2') //
const detailOptions = ref([]) const detailOptions = ref([])
const detailGiveupOptions = ref([]) const detailGiveupOptions = ref([])
const productionline = ref([])
const filter = ref() const filter = ref()
const scanMessage = ref('') const scanMessage = ref('')
const comMessageRef = ref() const comMessageRef = ref()
@ -61,6 +62,9 @@ onShow(() => {
getList('refresh') getList('refresh')
}) })
}) })
onLoad(() => {
getIssueJobByProductionline()
})
onReady(() => { onReady(() => {
detailOptions.value = getDetailOption() detailOptions.value = getDetailOption()
detailGiveupOptions.value = getDetailGiveupOption() detailGiveupOptions.value = getDetailGiveupOption()
@ -92,6 +96,19 @@ onNavigationBarButtonTap((e) => {
filter.value.openFilter() filter.value.openFilter()
} }
}) })
const getIssueJobByProductionline = () => {
getIssueJobByProductionline().then((res) => {
console.log('生产线', res)
if (res.code == 0) {
productionline.value = res.data.map((item) => ({
value: item,
text: item
}))
} else {
productionline.value = []
}
})
}
const getList = (type, fromLocationCode = '', productionLineCode = '') => { const getList = (type, fromLocationCode = '', productionLineCode = '') => {
proxy.$modal.loading('加载中­....') proxy.$modal.loading('加载中­....')
loadingType.value = 'loading' loadingType.value = 'loading'

16
src/pages/purchaseReceipt/job/receiptJob.vue

@ -11,7 +11,7 @@
<receipt-job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></receipt-job-list-popup> <receipt-job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></receipt-job-list-popup>
</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 title="箱标签" ref="scanPopup" @getResult="getScanResult"> </winScanPackJob> <winScanPackJob title="箱标签/ASN单号" ref="scanPopup" @getResult="getScanResult"> </winScanPackJob>
<jobListCom ref="jobListRef" @selectItem="selectItem"></jobListCom> <jobListCom ref="jobListRef" @selectItem="selectItem"></jobListCom>
<com-message ref="comMessageRef" /> <com-message ref="comMessageRef" />
</view> </view>
@ -269,16 +269,16 @@ const onReach = (message) => {
const openScanPopup = () => { const openScanPopup = () => {
scanPopup.value.openScanPopup() scanPopup.value.openScanPopup()
} }
const selectItem = (item) => { const selectItem = (item, isScanedASN = false) => {
scanPopup.value.closeScanPopup() scanPopup.value.closeScanPopup()
if (isScanedASN) {
openJobDetail(item)
} else {
openJobDetail(item, item.packingNumber) openJobDetail(item, item.packingNumber)
} }
}
const getScanResult = (result) => { const getScanResult = (result) => {
if (result.scanMessage.indexOf('ASN') > -1) {
showMessage('请扫描箱标签')
return
}
try { try {
let filters = [] let filters = []
if (result.label.barType == 'BarCode') { if (result.label.barType == 'BarCode') {
@ -344,9 +344,9 @@ const getScanResult = (result) => {
}) })
if (list.length > 1) { if (list.length > 1) {
jobListRef.value.openList(list) jobListRef.value.openList(list, result.scanMessage.indexOf('ASN') > -1)
} else { } else {
selectItem(list[0]) selectItem(list[0], result.scanMessage.indexOf('ASN') > -1)
} }
} else { } else {
showMessage('未查找到任务') showMessage('未查找到任务')

18
src/pages/repleinsh/coms/comScanReplishPack.vue

@ -204,7 +204,7 @@ const onScan = (result) => {
mask: true mask: true
}) })
getBalance(result.label, (balances) => { getBalance(result.label, packageInfo, (balances) => {
// //
const s = '' const s = ''
if (result.package.parentNumber == null || result.package.parentNumber == '') { if (result.package.parentNumber == null || result.package.parentNumber == '') {
@ -240,8 +240,22 @@ const onScan = (result) => {
uni.hideLoading() uni.hideLoading()
} }
} }
const getBalance = (labelParams, callback) => { const getBalance = (labelParams, packageInfo, callback) => {
const filters = [] const filters = []
if (packageInfo.parentNumber) {
const packingNumber = `${packageInfo.parentNumber},${packageInfo.packingNumber}`
filters.push({
column: 'packingNumber',
action: 'in',
value: packingNumber
})
} else {
filters.push({
column: 'packingNumber',
action: '==',
value: packageInfo.packingNumber
})
}
filters.push({ filters.push({
column: 'packingNumber', column: 'packingNumber',
action: '==', action: '==',

24
src/pages/repleinsh/job/repleinshDetail.vue

@ -39,7 +39,7 @@ import { ref, getCurrentInstance, nextTick, watch } from 'vue'
import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app' import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
import { takeRepleinshJob, cancleTakeRepleinshJob, getRepleinshJobDetail, repleinshJobSubmit } from '@/api/request2.js' import { takeRepleinshJob, cancleTakeRepleinshJob, getRepleinshJobDetail, repleinshJobSubmit } from '@/api/request2.js'
import { goHome, navigateBack, getRemoveOption, getCurrDateTime, getDirectoryItemArray, getPackingNumberAndBatch } from '@/common/basic.js' import { goHome, navigateBack, getRemoveOption, getCurrDateTime, getDirectoryItemArray, getPackingNumberAndBatch, deepCopyData } from '@/common/basic.js'
import { getDataSource } from '@/pages/issue/js/issue.js' import { getDataSource } from '@/pages/issue/js/issue.js'
@ -209,13 +209,7 @@ const submit = () => {
const setSubmitParamsAndSubmit = () => { const setSubmitParamsAndSubmit = () => {
// //
const itemCodes = []
const locationCode = toLocationCode.value
detailSource.value.forEach((toLocation) => {
toLocation.Items.forEach((item) => {
itemCodes.push(item.itemCode)
})
})
submitJob() submitJob()
// // 使 // // 使
// if (jobContent.value.useOnTheWayLocation == 'TRUE') { // if (jobContent.value.useOnTheWayLocation == 'TRUE') {
@ -273,29 +267,23 @@ const setParams = () => {
// record.fromPackingNumber = r // record.fromPackingNumber = r
// .packingNumber; // .packingNumber;
record.fromBatch = r.batch record.fromBatch = r.batch
record.fromContainerNumber = r.ContainerNumber record.fromContainerNumber = r.containerNumber
record.toContainerNumber = r.ContainerNumber record.toContainerNumber = r.containerNumber
record.toInventoryStatus = r.inventoryStatus record.toInventoryStatus = r.inventoryStatus
record.toLocationCode = toLocationCode.value record.toLocationCode = toLocationCode.value
console.log(`提交${toLocationCode.value}`) console.log(`提交${toLocationCode.value}`)
record.supplierCode = r.supplierCode record.supplierCode = r.supplierCode
record.fromParentPackingNumber = r.parentPackingNumber
if (r.parentPackingNumber != '' && r.parentPackingNumber != null) {
record.fromPackingNumber = r.parentPackingNumber
record.toPackingNumber = r.packingNumber
// record.fromPackUnit = r.packUnit;
record.toPackUnit = r.packUnit
} else {
record.fromPackingNumber = r.packingNumber record.fromPackingNumber = r.packingNumber
record.toPackingNumber = r.packingNumber record.toPackingNumber = r.packingNumber
record.toPackUnit = r.packUnit record.toPackUnit = r.packUnit
}
record.toBatch = r.batch record.toBatch = r.batch
subItem.recordList.push(record) subItem.recordList.push(record)
}) })
commitSubList.push(subItem) commitSubList.push(deepCopyData(subItem))
} }
} }
}) })

5
src/pages/repleinsh/record/directRepleinshRecord.vue

@ -137,6 +137,10 @@ const getScanResult = (result) => {
}) })
if (detail == undefined) { if (detail == undefined) {
const newDetail = createDetailInfo(balance, pack) const newDetail = createDetailInfo(balance, pack)
newDetail.parentNumber = pack.parentNumber
newDetail.packingNumber = pack.number
newDetail.parentNumber = pack.parentNumber
newDetail.packingNumber = pack.number
newDetail.packUnit = packUnit newDetail.packUnit = packUnit
newDetail.packQty = packQty newDetail.packQty = packQty
item.subList.push(newDetail) item.subList.push(newDetail)
@ -270,6 +274,7 @@ const setRecordParams = () => {
{ {
toInventoryStatus: detail.inventoryStatus, toInventoryStatus: detail.inventoryStatus,
fromPackingNumber: info.packingNumber, fromPackingNumber: info.packingNumber,
fromParentPackingNumber: detail.parentNumber,
fromBatch: info.batch, fromBatch: info.batch,
toPackingNumber: info.packingNumber, toPackingNumber: info.packingNumber,
toBatch: info.batch, toBatch: info.batch,

Loading…
Cancel
Save