领料出库

This commit is contained in:
bb_pan 2025-09-04 22:43:10 +08:00
parent 70454d5349
commit 3a7ccb63ef
3 changed files with 39 additions and 6 deletions

View File

@ -188,6 +188,7 @@
</scroll-view>
<view class="outbound-btn" @tap="onHandleOutbound"> 出库 </view>
</view>
<PopupConfirm ref="popupConfirm" :content="content" />
</template>
<script setup>
@ -203,6 +204,7 @@ import { getBoxBindByCode } from '@/services/standard.js'
import { debounce } from 'lodash-es'
import ScanQrCode from '@/pages/devicesSearch/ScanQrCode.vue'
import ScanQrCodeBox from '@/pages/devicesSearch/ScanQrCodeBox.vue'
import PopupConfirm from '@/components/PopupConfirm'
// const query = defineProps() //
// const queryParams = JSON.parse(query.queryParams)
const loading = ref(false)
@ -226,6 +228,9 @@ const queryCodeParams = ref({
})
const qrCodeScan = ref('')
const codeData = ref({})
const keyId = ref()
const popupConfirm = ref()
const content = ref('是否确定出库?')
//
const isExpanded = ref(false)
@ -430,6 +435,12 @@ const onHandleOutbound = async () => {
})
return
}
const confirm = await popupConfirm.value.openPopup()
console.log('🚀 ~ onHandleOutbound ~ confirm:', confirm)
if (!confirm.data) return
if (!keyId.value) {
keyId.value = new Date().getTime()
}
uni.showLoading()
loading.value = true
//
@ -453,7 +464,8 @@ const onHandleOutbound = async () => {
leaseUnit: queryParams.value.leaseUnit,
leaseUnitId: queryParams.value.leaseUnitId,
taskId: queryParams.value.taskId,
code: queryParams.value.code
code: queryParams.value.code,
keyId: keyId.value,
})
})
console.log('mmmmmmmmmmmmmmmm', paramsList)
@ -471,6 +483,7 @@ const onHandleOutbound = async () => {
// queryParams.value.publishTask,
// queryParams.value.typeId,
// ) //
keyId.value = null
uni.navigateBack()
}
} catch (error) {
@ -758,6 +771,9 @@ const confirmCodeOutBound = async () => {
const { typeId, parentId, publishTask } = queryParams.value
//
const paramsList = []
if (!keyId.value) {
keyId.value = new Date().getTime()
}
paramsList.push({
leaseType: 0,
maId: codeData.value.maId,
@ -771,10 +787,12 @@ const confirmCodeOutBound = async () => {
typeName: codeData.value.typeName,
typeModelName: codeData.value.typeModelName,
publishTask,
code: queryParams.value.code
code: queryParams.value.code,
keyId: keyId.value,
})
const res = await setOutboundNumAPI({ leaseOutDetailsList: paramsList })
console.log('333333333333', res)
keyId.value = null
if (res.code === 200) {
uni.showToast({
title: '出库成功!',

View File

@ -24,9 +24,9 @@
<div class="title">
<span class="main-title">领料出库</span>
<div class="status-tag">
<uni-tag :text="item.status == 2 ? '已完成' : '未完成'"
:type="item.status == 2 ? 'success' : 'warning'"
:custom-style="item.status == 2 ? successStyle : warningStyle"
<uni-tag :text="item.preNum == item.alNum ? '已完成' : '未完成'"
:type="item.preNum == item.alNum ? 'success' : 'warning'"
:custom-style="item.preNum == item.alNum ? successStyle : warningStyle"
/>
</div>
</div>

View File

@ -48,6 +48,7 @@
<view class="outbound-btn" @tap="onHandleOutbound"> 出库 </view>
</view>
</view>
<PopupConfirm ref="popupConfirm" :content="content" />
</template>
<script setup>
@ -55,11 +56,16 @@ import { computed, ref } from 'vue'
import { setOutboundNumAPI, leaseOutByInfoApi } from '@/services/picking/outbound.js'
import { onLoad, onShow } from '@dcloudio/uni-app'
import { formatDiff } from '@/utils/bnsBase.js'
import PopupConfirm from '@/components/PopupConfirm'
const loading = ref(false)
const formData = ref({})
const outboundNum = ref(0)
const queryParams = ref({})
const maCodeList = ref([])
const popupConfirm = ref()
const content = ref('是否确定出库?')
const keyId = ref()
//
const maxNum = computed(() => {
@ -152,6 +158,13 @@ const onHandleOutbound = async () => {
})
return
}
const confirm = await popupConfirm.value.openPopup()
console.log('🚀 ~ onHandleOutbound ~ confirm:', confirm)
if (!confirm.data) return
if (!keyId.value) {
keyId.value = new Date().getTime()
}
console.log('🚀 ~ onHandleOutbound ~ keyId.value:', keyId.value)
uni.showLoading()
loading.value = true
@ -177,7 +190,8 @@ const onHandleOutbound = async () => {
leaseUnitId: queryParams.value.leaseUnitId,
taskId: queryParams.value.taskId,
maCodeList: maCodeList.value,
code: queryParams.value.code
code: queryParams.value.code,
keyId: keyId.value,
}
console.log('出库参数', params)
try {
@ -204,6 +218,7 @@ const onHandleOutbound = async () => {
success() {},
})
}, 500)
keyId.value = null
}
} catch (error) {
console.log('🚀 ~ onHandleOutbound ~ error:', error)