领料出库
This commit is contained in:
parent
70454d5349
commit
3a7ccb63ef
|
|
@ -188,6 +188,7 @@
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
<view class="outbound-btn" @tap="onHandleOutbound"> 出库 </view>
|
<view class="outbound-btn" @tap="onHandleOutbound"> 出库 </view>
|
||||||
</view>
|
</view>
|
||||||
|
<PopupConfirm ref="popupConfirm" :content="content" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
@ -203,6 +204,7 @@ import { getBoxBindByCode } from '@/services/standard.js'
|
||||||
import { debounce } from 'lodash-es'
|
import { debounce } from 'lodash-es'
|
||||||
import ScanQrCode from '@/pages/devicesSearch/ScanQrCode.vue'
|
import ScanQrCode from '@/pages/devicesSearch/ScanQrCode.vue'
|
||||||
import ScanQrCodeBox from '@/pages/devicesSearch/ScanQrCodeBox.vue'
|
import ScanQrCodeBox from '@/pages/devicesSearch/ScanQrCodeBox.vue'
|
||||||
|
import PopupConfirm from '@/components/PopupConfirm'
|
||||||
// const query = defineProps() // 获取上级页面传递的路由参数
|
// const query = defineProps() // 获取上级页面传递的路由参数
|
||||||
// const queryParams = JSON.parse(query.queryParams)
|
// const queryParams = JSON.parse(query.queryParams)
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|
@ -226,6 +228,9 @@ const queryCodeParams = ref({
|
||||||
})
|
})
|
||||||
const qrCodeScan = ref('')
|
const qrCodeScan = ref('')
|
||||||
const codeData = ref({})
|
const codeData = ref({})
|
||||||
|
const keyId = ref()
|
||||||
|
const popupConfirm = ref()
|
||||||
|
const content = ref('是否确定出库?')
|
||||||
|
|
||||||
// 控制表单展开收起
|
// 控制表单展开收起
|
||||||
const isExpanded = ref(false)
|
const isExpanded = ref(false)
|
||||||
|
|
@ -430,6 +435,12 @@ const onHandleOutbound = async () => {
|
||||||
})
|
})
|
||||||
return
|
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()
|
uni.showLoading()
|
||||||
loading.value = true
|
loading.value = true
|
||||||
// 解构所需要的数据
|
// 解构所需要的数据
|
||||||
|
|
@ -453,7 +464,8 @@ const onHandleOutbound = async () => {
|
||||||
leaseUnit: queryParams.value.leaseUnit,
|
leaseUnit: queryParams.value.leaseUnit,
|
||||||
leaseUnitId: queryParams.value.leaseUnitId,
|
leaseUnitId: queryParams.value.leaseUnitId,
|
||||||
taskId: queryParams.value.taskId,
|
taskId: queryParams.value.taskId,
|
||||||
code: queryParams.value.code
|
code: queryParams.value.code,
|
||||||
|
keyId: keyId.value,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
console.log('mmmmmmmmmmmmmmmm', paramsList)
|
console.log('mmmmmmmmmmmmmmmm', paramsList)
|
||||||
|
|
@ -471,6 +483,7 @@ const onHandleOutbound = async () => {
|
||||||
// queryParams.value.publishTask,
|
// queryParams.value.publishTask,
|
||||||
// queryParams.value.typeId,
|
// queryParams.value.typeId,
|
||||||
// ) //获取详情
|
// ) //获取详情
|
||||||
|
keyId.value = null
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
@ -758,6 +771,9 @@ const confirmCodeOutBound = async () => {
|
||||||
const { typeId, parentId, publishTask } = queryParams.value
|
const { typeId, parentId, publishTask } = queryParams.value
|
||||||
// 组装出库参数
|
// 组装出库参数
|
||||||
const paramsList = []
|
const paramsList = []
|
||||||
|
if (!keyId.value) {
|
||||||
|
keyId.value = new Date().getTime()
|
||||||
|
}
|
||||||
paramsList.push({
|
paramsList.push({
|
||||||
leaseType: 0,
|
leaseType: 0,
|
||||||
maId: codeData.value.maId,
|
maId: codeData.value.maId,
|
||||||
|
|
@ -771,10 +787,12 @@ const confirmCodeOutBound = async () => {
|
||||||
typeName: codeData.value.typeName,
|
typeName: codeData.value.typeName,
|
||||||
typeModelName: codeData.value.typeModelName,
|
typeModelName: codeData.value.typeModelName,
|
||||||
publishTask,
|
publishTask,
|
||||||
code: queryParams.value.code
|
code: queryParams.value.code,
|
||||||
|
keyId: keyId.value,
|
||||||
})
|
})
|
||||||
const res = await setOutboundNumAPI({ leaseOutDetailsList: paramsList })
|
const res = await setOutboundNumAPI({ leaseOutDetailsList: paramsList })
|
||||||
console.log('333333333333', res)
|
console.log('333333333333', res)
|
||||||
|
keyId.value = null
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '出库成功!',
|
title: '出库成功!',
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,9 @@
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<span class="main-title">领料出库</span>
|
<span class="main-title">领料出库</span>
|
||||||
<div class="status-tag">
|
<div class="status-tag">
|
||||||
<uni-tag :text="item.status == 2 ? '已完成' : '未完成'"
|
<uni-tag :text="item.preNum == item.alNum ? '已完成' : '未完成'"
|
||||||
:type="item.status == 2 ? 'success' : 'warning'"
|
:type="item.preNum == item.alNum ? 'success' : 'warning'"
|
||||||
:custom-style="item.status == 2 ? successStyle : warningStyle"
|
:custom-style="item.preNum == item.alNum ? successStyle : warningStyle"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@
|
||||||
<view class="outbound-btn" @tap="onHandleOutbound"> 出库 </view>
|
<view class="outbound-btn" @tap="onHandleOutbound"> 出库 </view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<PopupConfirm ref="popupConfirm" :content="content" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
@ -55,11 +56,16 @@ import { computed, ref } from 'vue'
|
||||||
import { setOutboundNumAPI, leaseOutByInfoApi } from '@/services/picking/outbound.js'
|
import { setOutboundNumAPI, leaseOutByInfoApi } from '@/services/picking/outbound.js'
|
||||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||||
import { formatDiff } from '@/utils/bnsBase.js'
|
import { formatDiff } from '@/utils/bnsBase.js'
|
||||||
|
import PopupConfirm from '@/components/PopupConfirm'
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const formData = ref({})
|
const formData = ref({})
|
||||||
const outboundNum = ref(0)
|
const outboundNum = ref(0)
|
||||||
const queryParams = ref({})
|
const queryParams = ref({})
|
||||||
const maCodeList = ref([])
|
const maCodeList = ref([])
|
||||||
|
const popupConfirm = ref()
|
||||||
|
const content = ref('是否确定出库?')
|
||||||
|
const keyId = ref()
|
||||||
|
|
||||||
// 计算出库最大数量
|
// 计算出库最大数量
|
||||||
const maxNum = computed(() => {
|
const maxNum = computed(() => {
|
||||||
|
|
@ -152,6 +158,13 @@ const onHandleOutbound = async () => {
|
||||||
})
|
})
|
||||||
return
|
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()
|
uni.showLoading()
|
||||||
loading.value = true
|
loading.value = true
|
||||||
|
|
||||||
|
|
@ -177,7 +190,8 @@ const onHandleOutbound = async () => {
|
||||||
leaseUnitId: queryParams.value.leaseUnitId,
|
leaseUnitId: queryParams.value.leaseUnitId,
|
||||||
taskId: queryParams.value.taskId,
|
taskId: queryParams.value.taskId,
|
||||||
maCodeList: maCodeList.value,
|
maCodeList: maCodeList.value,
|
||||||
code: queryParams.value.code
|
code: queryParams.value.code,
|
||||||
|
keyId: keyId.value,
|
||||||
}
|
}
|
||||||
console.log('出库参数', params)
|
console.log('出库参数', params)
|
||||||
try {
|
try {
|
||||||
|
|
@ -204,6 +218,7 @@ const onHandleOutbound = async () => {
|
||||||
success() {},
|
success() {},
|
||||||
})
|
})
|
||||||
}, 500)
|
}, 500)
|
||||||
|
keyId.value = null
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('🚀 ~ onHandleOutbound ~ error:', error)
|
console.log('🚀 ~ onHandleOutbound ~ error:', error)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue