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) {
return http.post("/wms/issue-job-detail/senior",params)
}
export function getIssueJobByProductionline() {
return http.get("/issue-job-mwmsain/getIssueJobByProductionline")
}
/**
* 发料任务明细
* @param {*} 任务id

64
src/common/balance.js

@ -134,6 +134,54 @@ export function getManagementPrecisions(itemCodes, locationCode, callback) {
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) {
@ -154,7 +202,7 @@ export function getBalanceByManagementPrecision(label, locationCode, fromInvento
let managementPrecision = res.data[0].ManagementPrecision;
switch (managementPrecision) {
case 'BY_PACKAGING':
byPacking(label, locationCode, fromInventoryStatuses, res => {
byPacking(label, "", locationCode, fromInventoryStatuses, res => {
res.managementPrecision = managementPrecision;
callback(res);
});
@ -199,6 +247,20 @@ export function byPacking(label, locationCode, fromInventoryStatuses, callback)
data: {}
};
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({
column: "packingNumber",
action: "==",

1
src/mycomponents/balance/balance.vue

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

7
src/mycomponents/job/jobFilter.vue

@ -13,7 +13,8 @@
</view>
<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>
<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 v-if="isShowFromLocationCode" class="uni-flex space-between u-col-center" style="width: 100%; margin-top: 30rpx">
<view class="" style="font-size: 32rpx"> 来源库位 </view>
@ -68,6 +69,10 @@ const props = defineProps({
isShowProductionLineCode: {
type: Boolean,
default: false
},
productionline: {
type: Array,
default: []
}
})
const dataContent = ref({})

6
src/mycomponents/jobList/jobList.vue

@ -23,13 +23,15 @@ import { ref } from 'vue'
const list = ref([])
const show = ref(false)
const openList = (listParmas) => {
const isScanedASN = ref(false)
const openList = (listParmas, isScanedASNParmas = false) => {
list.value = listParmas
isScanedASN.value = isScanedASNParmas
show.value = true
}
const selectItem = (item, index) => {
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 winComScan from '@/mycomponents/scan/winComScan.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'
@ -210,10 +210,12 @@ const scanLocation = (scanResult) => {
// this.packGetFocus();
checkPackage(scanResult)
} else {
uni.hideLoading()
const hint = getListLocationAreaTypeDesc(fromLocationAreaTypeList.value)
showErrorMessage(`扫描库位[${fromLocationCode.value}]是[${getLocationAreaTypeName(result.areaType)}],需要的库区是[${hint}]`)
}
} else {
uni.hideLoading()
showErrorMessage(`扫描库位[${fromLocationCode.value}]不可用`, (res) => {
locationGetFocus()
})
@ -254,7 +256,7 @@ const checkPackage = (result) => {
// mask: 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()
if (res.success) {
managementPrecision.value = res.managementPrecision
@ -267,6 +269,7 @@ const checkPackage = (result) => {
// uni.hideLoading();
})
} else {
uni.hideLoading()
packCallBack(null)
}
}

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

@ -1,7 +1,7 @@
<template>
<view class="">
<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">
<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>
@ -22,7 +22,7 @@
<script setup lang="ts">
import { ref, getCurrentInstance, nextTick } from 'vue'
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 { getDetailOption, getDetailGiveupOption } from '@/common/array.js'
@ -49,6 +49,7 @@ const todayTime = ref('')
const status = ref('1,2') //
const detailOptions = ref([])
const detailGiveupOptions = ref([])
const productionline = ref([])
const filter = ref()
const scanMessage = ref('')
const comMessageRef = ref()
@ -61,6 +62,9 @@ onShow(() => {
getList('refresh')
})
})
onLoad(() => {
getIssueJobByProductionline()
})
onReady(() => {
detailOptions.value = getDetailOption()
detailGiveupOptions.value = getDetailGiveupOption()
@ -92,6 +96,19 @@ onNavigationBarButtonTap((e) => {
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 = '') => {
proxy.$modal.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>
</view>
<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>
<com-message ref="comMessageRef" />
</view>
@ -269,16 +269,16 @@ const onReach = (message) => {
const openScanPopup = () => {
scanPopup.value.openScanPopup()
}
const selectItem = (item) => {
const selectItem = (item, isScanedASN = false) => {
scanPopup.value.closeScanPopup()
if (isScanedASN) {
openJobDetail(item)
} else {
openJobDetail(item, item.packingNumber)
}
}
const getScanResult = (result) => {
if (result.scanMessage.indexOf('ASN') > -1) {
showMessage('请扫描箱标签')
return
}
try {
let filters = []
if (result.label.barType == 'BarCode') {
@ -344,9 +344,9 @@ const getScanResult = (result) => {
})
if (list.length > 1) {
jobListRef.value.openList(list)
jobListRef.value.openList(list, result.scanMessage.indexOf('ASN') > -1)
} else {
selectItem(list[0])
selectItem(list[0], result.scanMessage.indexOf('ASN') > -1)
}
} else {
showMessage('未查找到任务')

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

@ -204,7 +204,7 @@ const onScan = (result) => {
mask: true
})
getBalance(result.label, (balances) => {
getBalance(result.label, packageInfo, (balances) => {
//
const s = ''
if (result.package.parentNumber == null || result.package.parentNumber == '') {
@ -240,8 +240,22 @@ const onScan = (result) => {
uni.hideLoading()
}
}
const getBalance = (labelParams, callback) => {
const getBalance = (labelParams, packageInfo, callback) => {
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({
column: 'packingNumber',
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 { 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'
@ -209,13 +209,7 @@ const submit = () => {
const setSubmitParamsAndSubmit = () => {
//
const itemCodes = []
const locationCode = toLocationCode.value
detailSource.value.forEach((toLocation) => {
toLocation.Items.forEach((item) => {
itemCodes.push(item.itemCode)
})
})
submitJob()
// // 使
// if (jobContent.value.useOnTheWayLocation == 'TRUE') {
@ -273,29 +267,23 @@ const setParams = () => {
// record.fromPackingNumber = r
// .packingNumber;
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.toLocationCode = toLocationCode.value
console.log(`提交${toLocationCode.value}`)
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.toPackingNumber = r.packingNumber
record.toPackUnit = r.packUnit
}
record.toBatch = r.batch
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) {
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.packQty = packQty
item.subList.push(newDetail)
@ -270,6 +274,7 @@ const setRecordParams = () => {
{
toInventoryStatus: detail.inventoryStatus,
fromPackingNumber: info.packingNumber,
fromParentPackingNumber: detail.parentNumber,
fromBatch: info.batch,
toPackingNumber: info.packingNumber,
toBatch: info.batch,

Loading…
Cancel
Save