app领料页面功能修改
This commit is contained in:
parent
c4a9995d48
commit
99363d6463
|
|
@ -130,19 +130,19 @@
|
||||||
"navigationBarTitleText": "出库详情"
|
"navigationBarTitleText": "出库详情"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/picking/outbound/inner-detail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "出库详情"
|
||||||
|
}
|
||||||
|
},
|
||||||
// 3. 编码出库
|
// 3. 编码出库
|
||||||
{
|
{
|
||||||
"path": "pages/picking/outbound/code-outbound",
|
"path": "pages/picking/outbound/code-outbound",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "编码出库"
|
"navigationBarTitleText": "编码出库"
|
||||||
}
|
}
|
||||||
}, // 3. 编码出库
|
}, // 3. 编码出库
|
||||||
{
|
|
||||||
"path": "pages/picking/outbound/code-outScan",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "编码出库"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/picking/outbound/codeOutScan",
|
"path": "pages/picking/outbound/codeOutScan",
|
||||||
"style": {
|
"style": {
|
||||||
|
|
|
||||||
|
|
@ -1,381 +0,0 @@
|
||||||
<template>
|
|
||||||
<!-- 编码出库-->
|
|
||||||
<view class="page-container">
|
|
||||||
<!-- <view class="table-list-item">
|
|
||||||
<uni-forms :model="formData" label-width="100" :border="true">
|
|
||||||
<uni-forms-item label="领料单位:" name="leaseUnit">
|
|
||||||
<span class="form-view">{{ queryParams.leaseUnit }}</span>
|
|
||||||
</uni-forms-item>
|
|
||||||
<uni-forms-item label="领料工程:" name="leaseProject">
|
|
||||||
<span class="form-view">{{ queryParams.leaseProject }}</span>
|
|
||||||
</uni-forms-item>
|
|
||||||
<uni-forms-item label="物资类型:" name="maTypeName">
|
|
||||||
<span class="form-view">{{ queryParams.maTypeName }}</span>
|
|
||||||
</uni-forms-item>
|
|
||||||
<uni-forms-item label="规格型号:" name="typeName">
|
|
||||||
<span class="form-view">{{ queryParams.typeName }}</span>
|
|
||||||
</uni-forms-item>
|
|
||||||
<uni-forms-item label="待出库数量:" name="maxNum">
|
|
||||||
<span class="form-view">{{ maxNum }}</span>
|
|
||||||
</uni-forms-item>
|
|
||||||
</uni-forms>
|
|
||||||
</view> -->
|
|
||||||
<view>
|
|
||||||
<CustomCamera :coverImageType="coverImageType" @back="back" @getImage="getImage"/>
|
|
||||||
</view>
|
|
||||||
<!-- <view class="table-list-item">
|
|
||||||
<button class="scan-btn" @click="">开始扫码</button>
|
|
||||||
</view> -->
|
|
||||||
<!-- <view class="table-list-item">
|
|
||||||
<uni-row :gutter="24" style="display: flex; align-items: center">
|
|
||||||
<uni-col :span="6">
|
|
||||||
<view> 设备编码 </view>
|
|
||||||
</uni-col>
|
|
||||||
<uni-col :span="12">
|
|
||||||
<view>
|
|
||||||
<uni-easyinput v-model="queryCodeParams.maCode" placeholder="请输入内容" />
|
|
||||||
</view>
|
|
||||||
</uni-col>
|
|
||||||
<uni-col :span="6">
|
|
||||||
<view
|
|
||||||
class="coding-btn"
|
|
||||||
style="padding: 10rpx 0;color: #fe9a09;background-color: #fff7eb;border: 1px solid #fe9a09;"
|
|
||||||
@click=""
|
|
||||||
>编码检索</view
|
|
||||||
>
|
|
||||||
</uni-col>
|
|
||||||
</uni-row>
|
|
||||||
</view>
|
|
||||||
<view class="table-list-item">
|
|
||||||
<scroll-view class="scroll-view" scroll-y="true" style="height: 300rpx;">
|
|
||||||
<uni-forms :model="codeData" label-width="100" :border="true">
|
|
||||||
<uni-forms-item label="物资类型:" name="typeName">
|
|
||||||
<span class="form-view">{{ codeData.typeName }}</span>
|
|
||||||
</uni-forms-item>
|
|
||||||
<uni-forms-item label="规格型号:" name="typeModelName">
|
|
||||||
<span class="form-view">{{ codeData.typeModelName }}</span>
|
|
||||||
</uni-forms-item>
|
|
||||||
<uni-forms-item label="设备状态:" name="statusName">
|
|
||||||
<span class="form-view">{{ codeData.statusName }}</span>
|
|
||||||
</uni-forms-item>
|
|
||||||
<uni-forms-item label="设备数量:">
|
|
||||||
<span class="form-view">1</span>
|
|
||||||
</uni-forms-item>
|
|
||||||
</uni-forms>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
|
||||||
<view class="outbound-btn" @tap="onHandleOutbound"> 出库 </view> -->
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref, computed } from 'vue'
|
|
||||||
import CustomCamera from "@/components/CustomCamera/APP/index.nvue"
|
|
||||||
import { getCodeScanAPI, setOutboundNumAPI } from '@/services/picking/outbound.js'
|
|
||||||
import { onBackPress } from '@dcloudio/uni-app'
|
|
||||||
import { debounce } from 'lodash-es'
|
|
||||||
import { onShow } from '@dcloudio/uni-app'
|
|
||||||
import { onLoad } from '@dcloudio/uni-app'
|
|
||||||
// const query = defineProps() // 获取上级页面传递的路由参数
|
|
||||||
// const queryParams = JSON.parse(query.queryParams)
|
|
||||||
const queryParams = ref({})
|
|
||||||
const formData = ref({})
|
|
||||||
const codeData = ref({})
|
|
||||||
const codeNum = ref(0)
|
|
||||||
// 编码设备列表查询参数
|
|
||||||
const queryCodeParams = ref({
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
typeId: '',
|
|
||||||
maStatus: 1,
|
|
||||||
maCode: '',
|
|
||||||
qrCode: '',
|
|
||||||
})
|
|
||||||
const qrCodeScan = ref('')
|
|
||||||
onLoad((options) => {
|
|
||||||
console.log('options', options)
|
|
||||||
queryParams.value = JSON.parse(options.queryParams)
|
|
||||||
queryCodeParams.value.typeId = queryParams.value.typeId
|
|
||||||
})
|
|
||||||
// 计算出库最大数量
|
|
||||||
const maxNum = computed(() => {
|
|
||||||
// 通过预领数量和已领数量计算剩余待出库数量
|
|
||||||
const waitNum = queryParams.value.preNum - queryParams.value.alNum
|
|
||||||
return waitNum
|
|
||||||
})
|
|
||||||
|
|
||||||
const coverImageType = ref('side')
|
|
||||||
const back = () => {
|
|
||||||
uni.navigateBack()
|
|
||||||
}
|
|
||||||
const getImage = (res) => {
|
|
||||||
console.log(res)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 扫码识别按钮
|
|
||||||
const scanStart = () => {
|
|
||||||
var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
|
|
||||||
mpaasScanModule.mpaasScan({
|
|
||||||
// 扫码识别类型,参数可多选,qrCode、barCode,不设置,默认识别所有
|
|
||||||
'scanType': ['qrCode','barCode'],
|
|
||||||
// 是否隐藏相册,默认false不隐藏
|
|
||||||
'hideAlbum': false,
|
|
||||||
//ios需要设置这个参数,只支持中英文 zh-Hans、en,默认中文
|
|
||||||
'language' : 'en',
|
|
||||||
//相册选择照片识别错误提示(ios)
|
|
||||||
'failedMsg': '未识别到二维码,请重试',
|
|
||||||
//Android支持全屏需要设置此参数
|
|
||||||
'screenType': 'full'
|
|
||||||
},(ret) => {
|
|
||||||
if(ret.resp_code==10){
|
|
||||||
uni.showToast({ title: '用户取消', icon: 'none' })
|
|
||||||
}
|
|
||||||
if(ret.resp_code==11){
|
|
||||||
uni.showToast({ title: '扫码失败', icon: 'none' })
|
|
||||||
}
|
|
||||||
if(ret.resp_code==1000){
|
|
||||||
uni.showToast({ title: '成功', icon: 'none' })
|
|
||||||
console.log('1111',ret.resp_result)
|
|
||||||
qrCodeScan.value = ret.resp_result.split("qrcode=")[1]
|
|
||||||
// queryCodeParams.value.maCode = ret.resp_result.split("qrcode=")[1]
|
|
||||||
queryCodeParams.value.qrCode = ret.resp_result.split("qrcode=")[1]
|
|
||||||
if (qrCodeScan.value=="") {
|
|
||||||
uni.showToast({ title: '扫码识别失败', icon: 'none'})
|
|
||||||
}else{
|
|
||||||
getMaInfoScan()
|
|
||||||
// 停止扫描
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// uni.showModal({
|
|
||||||
// title: "弹窗标题",
|
|
||||||
// // 返回值中,resp_code 表示返回结果值,10:用户取消,11:其他错误,1000:成功
|
|
||||||
// // 返回值中,resp_message 表示返回结果信息
|
|
||||||
// // 返回值中,resp_result 表示扫码结果,只有成功才会有返回
|
|
||||||
// content: JSON.stringify(ret),
|
|
||||||
// showCancel: false,
|
|
||||||
// confirmText: "确定"
|
|
||||||
// })
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
//查看是否是该规格型号
|
|
||||||
const getMaInfoScan = async () => {
|
|
||||||
const res = await getCodeScanAPI(queryCodeParams.value)
|
|
||||||
console.log(res)
|
|
||||||
if (res.code == 200) {
|
|
||||||
if (res.data && res.data.recordList.length > 0) {
|
|
||||||
// codeData.value = res.rows[0]
|
|
||||||
queryCodeParams.value.maCode = res.data.recordList[0].maCode
|
|
||||||
codeData.value = res.data.recordList[0]
|
|
||||||
uni.showToast({ title: res.data.msg, icon: 'none'})
|
|
||||||
}else{
|
|
||||||
uni.showToast({ title: res.data.msg, icon: 'none'})
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
uni.showToast({ title: res.data.msg, icon: 'none' })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// //根据编码获取设备类型
|
|
||||||
// const getMaInfo = async () => {
|
|
||||||
// console.log('queryCodeParams', queryCodeParams.value)
|
|
||||||
// const res = await getCodeDeviceListAPI(queryCodeParams.value)
|
|
||||||
// console.log(res)
|
|
||||||
// if (res.code == 200) {
|
|
||||||
// if (res.rows && res.rows.length > 0) {
|
|
||||||
// codeData.value = res.rows[0]
|
|
||||||
// } else {
|
|
||||||
// uni.showToast({ title: '未查询到该编码', icon: 'none' })
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// 出库按钮
|
|
||||||
const onHandleOutbound = async () => {
|
|
||||||
// 组装出库参数
|
|
||||||
let paramsList = []
|
|
||||||
paramsList.push({
|
|
||||||
maCode: codeData.value.maCode,
|
|
||||||
maId: codeData.value.maId,
|
|
||||||
leaseType:0,
|
|
||||||
outType:2,
|
|
||||||
outNum:1,
|
|
||||||
typeId:codeData.value.typeId,
|
|
||||||
manageType: codeData.value.manageType,
|
|
||||||
parentId: queryParams.value.parentId,
|
|
||||||
typeName: codeData.value.typeName,
|
|
||||||
typeModelName: codeData.value.typeModelName,
|
|
||||||
})
|
|
||||||
|
|
||||||
console.log('333333333', paramsList)
|
|
||||||
const res = await setOutboundNumAPI({ leaseOutDetailsList: paramsList })
|
|
||||||
if (res.code === 200) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '出库成功!',
|
|
||||||
icon: 'none',
|
|
||||||
})
|
|
||||||
queryParams.value.alNum = queryParams.value.alNum + 1
|
|
||||||
queryCodeParams.value.maCode = ''
|
|
||||||
codeData.value = {}
|
|
||||||
// codeNum.value = codeNum.value + 1
|
|
||||||
// uni.$emit('onUpdate', codeNun.value)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 页面加载完毕
|
|
||||||
onShow(() => {
|
|
||||||
})
|
|
||||||
|
|
||||||
// 监听返回事件
|
|
||||||
// onBackPress(() => {
|
|
||||||
// // 跳转到固定页面
|
|
||||||
// // uni.redirectTo({
|
|
||||||
// // url: '/pages/fixed-page/fixed-page' // 替换为你要跳转的固定页面路径
|
|
||||||
// // });
|
|
||||||
// console.log('2222222222222222222',queryParams.value.id)
|
|
||||||
// uni.redirectTo({
|
|
||||||
// url: `/pages/picking/outbound/code-outbound?queryParams=${JSON.stringify(queryParams.value)}`
|
|
||||||
// });
|
|
||||||
// // 返回 true 表示阻止默认返回行为
|
|
||||||
// return true;
|
|
||||||
// });
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.page-container {
|
|
||||||
display: flex;
|
|
||||||
height: 100%;
|
|
||||||
flex-direction: column;
|
|
||||||
background-color: #f7f8fa;
|
|
||||||
padding: 24rpx;
|
|
||||||
|
|
||||||
.table-list-item {
|
|
||||||
background: #fff;
|
|
||||||
padding: 32rpx;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
|
|
||||||
margin-bottom: 24rpx;
|
|
||||||
|
|
||||||
// 表单样式
|
|
||||||
:deep(.uni-forms) {
|
|
||||||
.uni-forms-item {
|
|
||||||
margin-bottom: 24rpx;
|
|
||||||
padding: 0;
|
|
||||||
|
|
||||||
&:last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-forms-item__label {
|
|
||||||
color: #8c8c8c;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-weight: 500;
|
|
||||||
padding: 0;
|
|
||||||
line-height: 1.8;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-forms-item__content {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
min-height: unset;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-view {
|
|
||||||
color: #262626;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-weight: 500;
|
|
||||||
line-height: 1.8;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 扫码按钮
|
|
||||||
.scan-btn {
|
|
||||||
width: 100%;
|
|
||||||
height: 88rpx;
|
|
||||||
background: linear-gradient(135deg, #4b8eff 0%, #3784fb 100%);
|
|
||||||
text-align: center;
|
|
||||||
line-height: 88rpx;
|
|
||||||
color: #fff;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-weight: 600;
|
|
||||||
box-shadow: 0 6rpx 20rpx rgba(55, 132, 251, 0.2);
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
|
|
||||||
&:active {
|
|
||||||
transform: scale(0.98);
|
|
||||||
opacity: 0.9;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 编码检索按钮
|
|
||||||
.coding-btn {
|
|
||||||
padding: 12rpx 0;
|
|
||||||
background: #fff;
|
|
||||||
color: #ff9800;
|
|
||||||
border: 2rpx solid rgba(255, 152, 0, 0.5);
|
|
||||||
background: linear-gradient(to bottom, rgba(255, 152, 0, 0.05), rgba(255, 152, 0, 0.1));
|
|
||||||
border-radius: 12rpx;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-weight: 600;
|
|
||||||
letter-spacing: 1rpx;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
|
|
||||||
&:active {
|
|
||||||
background: rgba(255, 152, 0, 0.15);
|
|
||||||
border-color: rgba(255, 152, 0, 0.6);
|
|
||||||
transform: translateY(1rpx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 输入框样式
|
|
||||||
:deep(.uni-easyinput__content) {
|
|
||||||
background-color: #f7f8fa;
|
|
||||||
border: 2rpx solid #e8e8e8;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
height: 80rpx;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
|
|
||||||
&:focus-within {
|
|
||||||
border-color: #3784fb;
|
|
||||||
box-shadow: 0 0 0 2rpx rgba(55, 132, 251, 0.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-easyinput__content-input {
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #262626;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 底部出库按钮
|
|
||||||
.outbound-btn {
|
|
||||||
position: fixed;
|
|
||||||
bottom: 40rpx;
|
|
||||||
left: 50%;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
width: 90%;
|
|
||||||
height: 88rpx;
|
|
||||||
background: linear-gradient(135deg, #4b8eff 0%, #3784fb 100%);
|
|
||||||
text-align: center;
|
|
||||||
line-height: 88rpx;
|
|
||||||
color: #fff;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-weight: 600;
|
|
||||||
box-shadow: 0 6rpx 20rpx rgba(55, 132, 251, 0.2);
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
|
|
||||||
&:active {
|
|
||||||
transform: translateX(-50%) scale(0.98);
|
|
||||||
opacity: 0.9;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|
@ -123,7 +123,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onUnmounted } from 'vue'
|
import { ref, computed, onUnmounted } from 'vue'
|
||||||
import { onLoad, onShow, } from '@dcloudio/uni-app'
|
import { onLoad, onShow, } from '@dcloudio/uni-app'
|
||||||
import { getCodeDeviceListAPI, setOutboundNumAPI, getCodeScanAPI } from '@/services/picking/outbound.js'
|
import { getCodeDetailAPI, getCodeDeviceListAPI, setOutboundNumAPI, getCodeScanAPI } from '@/services/picking/outbound.js'
|
||||||
import { getBoxBindByCode } from '@/services/standard.js'
|
import { getBoxBindByCode } from '@/services/standard.js'
|
||||||
import { debounce } from 'lodash-es'
|
import { debounce } from 'lodash-es'
|
||||||
// const query = defineProps() // 获取上级页面传递的路由参数
|
// const query = defineProps() // 获取上级页面传递的路由参数
|
||||||
|
|
@ -131,8 +131,8 @@ import { debounce } from 'lodash-es'
|
||||||
const queryParams = ref({})
|
const queryParams = ref({})
|
||||||
const formData = ref({})
|
const formData = ref({})
|
||||||
const codeDeviceList = ref([])
|
const codeDeviceList = ref([])
|
||||||
const total = ref(0)
|
const maxNum = ref(0)
|
||||||
const codeNum = ref(0)
|
const total = ref(0)
|
||||||
const boxCode = ref("")
|
const boxCode = ref("")
|
||||||
const boxInfo = ref({})
|
const boxInfo = ref({})
|
||||||
// 编码设备列表查询参数
|
// 编码设备列表查询参数
|
||||||
|
|
@ -154,6 +154,116 @@ const toggleForm = () => {
|
||||||
isExpanded.value = !isExpanded.value
|
isExpanded.value = !isExpanded.value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 页面加载完毕
|
||||||
|
onLoad((options) => {
|
||||||
|
queryParams.value = JSON.parse(options.queryParams)
|
||||||
|
})
|
||||||
|
|
||||||
|
onShow(() => {
|
||||||
|
console.log(queryParams.value)
|
||||||
|
getCodeDetailData(queryParams.value.id)//获取详情
|
||||||
|
})
|
||||||
|
// 获取编码列表
|
||||||
|
const getCodeDetailData = async (id) => {
|
||||||
|
const res = await getCodeDetailAPI({id:id})
|
||||||
|
formData.value=res.data;
|
||||||
|
maxNum.value=formData.value.preNum-formData.value.alNum;
|
||||||
|
queryCodeParams.value.typeId = queryParams.value.typeId;
|
||||||
|
queryCodeParams.value.pageNum = 1;
|
||||||
|
codeDeviceList.value = [];
|
||||||
|
getCodeDeviceListData()//获取编码列表
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取编码列表
|
||||||
|
const getCodeDeviceListData = async () => {
|
||||||
|
const res = await getCodeDeviceListAPI(queryCodeParams.value)
|
||||||
|
codeDeviceList.value.push(...res.rows)
|
||||||
|
if (codeDeviceList.value.length > 0) {
|
||||||
|
codeDeviceList.value = codeDeviceList.value.map((e) => {
|
||||||
|
return { ...e, checked: false }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
total.value = res.total
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 编码搜索按钮
|
||||||
|
const onCodeSearch = () => {
|
||||||
|
queryCodeParams.value.pageNum = 1
|
||||||
|
codeDeviceList.value = []
|
||||||
|
getCodeDeviceListData()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 滚动触底事件
|
||||||
|
const onScrollTolower = debounce(() => {
|
||||||
|
// console.log('滚动触底--')
|
||||||
|
if (total.value > codeDeviceList.value.length) {
|
||||||
|
queryCodeParams.value.pageNum++
|
||||||
|
getCodeDeviceListData()
|
||||||
|
}
|
||||||
|
}, 500)
|
||||||
|
|
||||||
|
// 判断数<EFBFBD><EFBFBD>是否加载完毕
|
||||||
|
const finish = computed(() => {
|
||||||
|
if (total.value === codeDeviceList.value.length) return true
|
||||||
|
})
|
||||||
|
|
||||||
|
// 复选框事件
|
||||||
|
const onChangeChecked = (item) => {
|
||||||
|
item.checked = !item.checked
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算已选择数量
|
||||||
|
const isSelectNum = computed(() => {
|
||||||
|
const isSelectList = codeDeviceList.value.filter((e) => e.checked === true)
|
||||||
|
if (maxNum.value === isSelectList.length) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '勾选设备已达到最大待出库数量!',
|
||||||
|
icon: 'none',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return isSelectList.length
|
||||||
|
})
|
||||||
|
|
||||||
|
// 出库按钮
|
||||||
|
const onHandleOutbound = async () => {
|
||||||
|
const isSelect = codeDeviceList.value.some((e) => e.checked === true)
|
||||||
|
if (!isSelect) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请勾选需要出库的设备',
|
||||||
|
icon: 'none',
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 解构所需要的数据
|
||||||
|
const { typeId, parentId } = queryParams.value
|
||||||
|
// 组装出库参数
|
||||||
|
const paramsList = []
|
||||||
|
codeDeviceList.value.map((e) => {
|
||||||
|
if (e.checked) {
|
||||||
|
paramsList.push({
|
||||||
|
leaseType: 0,
|
||||||
|
maId: e.maId,
|
||||||
|
maCode: e.maCode,
|
||||||
|
manageType: 0,
|
||||||
|
outNum: 1,
|
||||||
|
parentId,
|
||||||
|
typeId,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log()
|
||||||
|
const res = await setOutboundNumAPI({ leaseOutDetailsList: paramsList })
|
||||||
|
if (res.code === 200) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '出库成功!',
|
||||||
|
icon: 'none',
|
||||||
|
})
|
||||||
|
getCodeDetailData(queryParams.value.id)//获取详情
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 标准箱识别
|
// 标准箱识别
|
||||||
const boxScan = async () => {
|
const boxScan = async () => {
|
||||||
boxCode.value=""
|
boxCode.value=""
|
||||||
|
|
@ -182,33 +292,32 @@ const boxOut = async () => {
|
||||||
console.log(param)
|
console.log(param)
|
||||||
const res = await getBoxBindByCode(param)
|
const res = await getBoxBindByCode(param)
|
||||||
console.log(res)
|
console.log(res)
|
||||||
if(res.code==200){
|
if(res.code==200){
|
||||||
boxInfo.value = res.data
|
boxInfo.value = res.data;
|
||||||
uni.showModal({
|
if(boxInfo.value.recordList&&boxInfo.value.recordList.length>0){
|
||||||
title: '提示',
|
if(boxInfo.value.recordList.length>maxNum.value){
|
||||||
content: boxInfo.value.msg,
|
uni.showToast({ title: '标准箱绑定设备数量多于待出库数量!', icon: 'none'})
|
||||||
confirmText: '确定',
|
}else{
|
||||||
cancelText: '取消',
|
uni.showModal({
|
||||||
success: async (res) => {
|
title: '提示',
|
||||||
if (res.confirm) {
|
content: boxInfo.value.msg,
|
||||||
if(boxInfo.value.recordList.length>0){
|
confirmText: '确定',
|
||||||
if(boxInfo.value.recordList.length>maxNum.value){
|
cancelText: '取消',
|
||||||
uni.showToast({ title: '标准箱绑定设备数量多于待出库数量!', icon: 'none'})
|
success: async (res) => {
|
||||||
}else{
|
if (res.confirm) {
|
||||||
boxOutBound()
|
boxOutBound()
|
||||||
}
|
}
|
||||||
}else{
|
}
|
||||||
uni.showToast({ title: '标准箱未绑定设备!', icon: 'none'})
|
})
|
||||||
}
|
}
|
||||||
}
|
}else{
|
||||||
}
|
uni.showToast({ title: '标准箱未绑定设备!', icon: 'none'})
|
||||||
})
|
}
|
||||||
}else{
|
}else{
|
||||||
uni.showToast({ title: '扫码识别失败', icon: 'none'})
|
uni.showToast({ title: '扫码识别失败', icon: 'none'})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 标准箱出库确认
|
// 标准箱出库确认
|
||||||
const boxOutBound = async () => {
|
const boxOutBound = async () => {
|
||||||
// 解构所需要的数据
|
// 解构所需要的数据
|
||||||
|
|
@ -221,68 +330,27 @@ const boxOutBound = async () => {
|
||||||
boxId: e.boxId,
|
boxId: e.boxId,
|
||||||
maId: e.maId,
|
maId: e.maId,
|
||||||
maCode: e.maCode,
|
maCode: e.maCode,
|
||||||
manageType: 0,
|
manageType: 0,
|
||||||
// 出库方式 0数量,1编码,2二维码,3标准箱
|
outType: 3,// 出库方式 0数量,1编码,2二维码,3标准箱
|
||||||
outType: 3,
|
|
||||||
outNum: 1,
|
outNum: 1,
|
||||||
parentId,
|
parentId,
|
||||||
typeId,
|
typeId,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
console.log(paramsList)
|
console.log(paramsList)
|
||||||
const res = await setOutboundNumAPI({ leaseOutDetailsList: paramsList })
|
const res = await setOutboundNumAPI({ leaseOutDetailsList: paramsList })
|
||||||
|
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '出库成功!',
|
title: '出库成功!',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
})
|
})
|
||||||
setTimeout(() => {
|
getCodeDetailData(queryParams.value.id)//获取详情
|
||||||
// 返回上一个页面
|
|
||||||
uni.navigateBack({
|
|
||||||
delta: 1,
|
|
||||||
success() {
|
|
||||||
uni.$emit('onUpdate')
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}, 500)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const maxNum = ref(0)
|
|
||||||
// 计算出库最大数量
|
|
||||||
// const maxNum = computed(() => {
|
|
||||||
// // 1. 先通过预领数量和已领数量计算剩余待出库数量
|
|
||||||
// const waitNum = queryParams.value.preNum - queryParams.value.alNum
|
|
||||||
|
|
||||||
// // 2. 判断库存数量是否大于待出库数量 如大于则取待出库数量 如小于则取库存书看了
|
|
||||||
// return total.value > waitNum ? waitNum : total.value
|
|
||||||
// })
|
|
||||||
|
|
||||||
// 获取编码列表
|
|
||||||
const getCodeDeviceListData = async () => {
|
|
||||||
console.log('queryCodeParams', queryCodeParams.value)
|
|
||||||
const res = await getCodeDeviceListAPI(queryCodeParams.value)
|
|
||||||
console.log('xxxxxxxxxxxxxxx', )
|
|
||||||
console.log('333132133', res)
|
|
||||||
codeDeviceList.value.push(...res.rows)
|
|
||||||
console.log('21313131',codeDeviceList.value)
|
|
||||||
if (codeDeviceList.value.length > 0) {
|
|
||||||
codeDeviceList.value = codeDeviceList.value.map((e) => {
|
|
||||||
return { ...e, checked: false }
|
|
||||||
})
|
|
||||||
}
|
|
||||||
total.value = res.total
|
|
||||||
}
|
|
||||||
|
|
||||||
// 编码识别按钮
|
// 编码识别按钮
|
||||||
const onCodeIdentify = () => {
|
const onCodeIdentify = () => {
|
||||||
console.log('编码识别--')
|
console.log('编码识别--')
|
||||||
// uni.navigateTo({
|
|
||||||
// url: `/pages/picking/outbound/code-outScan?queryParams=${JSON.stringify(
|
|
||||||
// queryParams.value,
|
|
||||||
// )}`,
|
|
||||||
// })
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/picking/outbound/codeOutScan?queryParams=${JSON.stringify(queryParams.value)}`,
|
url: `/pages/picking/outbound/codeOutScan?queryParams=${JSON.stringify(queryParams.value)}`,
|
||||||
})
|
})
|
||||||
|
|
@ -370,130 +438,19 @@ const confirmCodeOutBound = async () => {
|
||||||
})
|
})
|
||||||
const res = await setOutboundNumAPI({ leaseOutDetailsList: paramsList })
|
const res = await setOutboundNumAPI({ leaseOutDetailsList: paramsList })
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '出库成功!',
|
title: '出库成功!',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
})
|
})
|
||||||
setTimeout(() => {
|
getCodeDetailData(queryParams.value.id)//获取详情
|
||||||
scanStart()
|
setTimeout(() => {
|
||||||
}, 800)
|
scanStart()
|
||||||
|
}, 800)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 编码搜索按钮
|
|
||||||
const onCodeSearch = () => {
|
|
||||||
queryCodeParams.value.pageNum = 1
|
|
||||||
codeDeviceList.value = []
|
|
||||||
getCodeDeviceListData()
|
|
||||||
}
|
|
||||||
|
|
||||||
// 滚动触底事件
|
|
||||||
const onScrollTolower = debounce(() => {
|
|
||||||
// console.log('滚动触底--')
|
|
||||||
if (total.value > codeDeviceList.value.length) {
|
|
||||||
queryCodeParams.value.pageNum++
|
|
||||||
getCodeDeviceListData()
|
|
||||||
}
|
|
||||||
}, 500)
|
|
||||||
|
|
||||||
// 判断数<EFBFBD><EFBFBD>是否加载完毕
|
|
||||||
const finish = computed(() => {
|
|
||||||
if (total.value === codeDeviceList.value.length) return true
|
|
||||||
})
|
|
||||||
|
|
||||||
// 复选框事件
|
|
||||||
const onChangeChecked = (item) => {
|
|
||||||
item.checked = !item.checked
|
|
||||||
}
|
|
||||||
|
|
||||||
// 计算已选择数量
|
|
||||||
const isSelectNum = computed(() => {
|
|
||||||
const isSelectList = codeDeviceList.value.filter((e) => e.checked === true)
|
|
||||||
if (maxNum.value === isSelectList.length) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '勾选设备已达到最大待出库数量!',
|
|
||||||
icon: 'none',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return isSelectList.length
|
|
||||||
})
|
|
||||||
|
|
||||||
// 出库按钮
|
|
||||||
const onHandleOutbound = async () => {
|
|
||||||
const isSelect = codeDeviceList.value.some((e) => e.checked === true)
|
|
||||||
|
|
||||||
if (!isSelect) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请勾选需要出库的设备',
|
|
||||||
icon: 'none',
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// 解构所需要的数据
|
|
||||||
const { typeId, parentId } = queryParams.value
|
|
||||||
// 组装出库参数
|
|
||||||
const paramsList = []
|
|
||||||
codeDeviceList.value.map((e) => {
|
|
||||||
if (e.checked) {
|
|
||||||
paramsList.push({
|
|
||||||
leaseType: 0,
|
|
||||||
maId: e.maId,
|
|
||||||
maCode: e.maCode,
|
|
||||||
manageType: 0,
|
|
||||||
outNum: 1,
|
|
||||||
parentId,
|
|
||||||
typeId,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
console.log()
|
|
||||||
const res = await setOutboundNumAPI({ leaseOutDetailsList: paramsList })
|
|
||||||
|
|
||||||
if (res.code === 200) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '出库成功!',
|
|
||||||
icon: 'none',
|
|
||||||
})
|
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
// 返回上一个页面
|
|
||||||
uni.navigateBack({
|
|
||||||
delta: 1,
|
|
||||||
success() {
|
|
||||||
uni.$emit('onUpdate')
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}, 500)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 页面加载完毕
|
|
||||||
onLoad((options) => {
|
|
||||||
// 监听出库完成事件 刷新列表
|
|
||||||
uni.$on('onUpdate', (num) => {
|
|
||||||
console.log('监听事件', num)
|
|
||||||
codeNum.value = num
|
|
||||||
|
|
||||||
})
|
|
||||||
queryParams.value = JSON.parse(options.queryParams)
|
|
||||||
console.log('111111111111111111111',queryParams.value.id)
|
|
||||||
maxNum.value = queryParams.value.preNum - queryParams.value.alNum
|
|
||||||
queryCodeParams.value.typeId = queryParams.value.typeId
|
|
||||||
getCodeDeviceListData()
|
|
||||||
})
|
|
||||||
|
|
||||||
onShow(() => {
|
|
||||||
// 重新计算 maxNum 的值
|
|
||||||
maxNum.value = queryParams.value.preNum - queryParams.value.alNum
|
|
||||||
})
|
|
||||||
|
|
||||||
// 页面销毁时移除事件监听
|
|
||||||
onUnmounted(() => {
|
|
||||||
uni.$off('onUpdate') // 移除事件监听
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,8 @@
|
||||||
</view>
|
</view>
|
||||||
</uni-col>
|
</uni-col>
|
||||||
<uni-col :span="6">
|
<uni-col :span="6">
|
||||||
<view class="coding-btn" style="padding: 10rpx 0;color: #fe9a09;background-color: #fff7eb;border: 1px solid #fe9a09;" @click="">
|
<view class="coding-btn" style="padding: 10rpx 0;color: #fe9a09;background-color: #fff7eb;border: 1px solid #fe9a09;"
|
||||||
|
@click="getCode()">
|
||||||
<text style="color: #fe9a09;text-align: center;">编码检索</text>
|
<text style="color: #fe9a09;text-align: center;">编码检索</text>
|
||||||
</view>
|
</view>
|
||||||
</uni-col>
|
</uni-col>
|
||||||
|
|
@ -31,18 +32,24 @@
|
||||||
<view class="table-list-item">
|
<view class="table-list-item">
|
||||||
<scroll-view class="scroll-view" scroll-y="true" style="height: 500rpx;">
|
<scroll-view class="scroll-view" scroll-y="true" style="height: 500rpx;">
|
||||||
<uni-forms :model="codeData" label-width="100" :border="true">
|
<uni-forms :model="codeData" label-width="100" :border="true">
|
||||||
<uni-forms-item label="物资类型:" name="typeName">
|
<uni-forms-item label="物资名称:" name="materialType">
|
||||||
<text class="form-view">{{ codeData.typeName }}</text>
|
<text style="height: 100%;display: flex;align-items: center;">{{ codeData.materialType }}</text>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="规格型号:" name="typeModelName">
|
<uni-forms-item label="物资类型:" name="materialName">
|
||||||
<text class="form-view">{{ codeData.typeModelName }}</text>
|
<text style="height: 100%;display: flex;align-items: center;">{{ codeData.materialName }}</text>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="设备状态:" name="statusName">
|
<uni-forms-item label="规格型号:" name="materialModel">
|
||||||
<text class="form-view">{{ codeData.statusName }}</text>
|
<text style="height: 100%;display: flex;align-items: center;">{{ codeData.materialModel }}</text>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="设备数量:">
|
<uni-forms-item label="设备编码:" name="maCode">
|
||||||
<text class="form-view">1</text>
|
<text style="height: 100%;display: flex;align-items: center;">{{ codeData.maCode }}</text>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
|
<uni-forms-item label="设备状态:" name="statusName">
|
||||||
|
<text style="height: 100%;display: flex;align-items: center;">{{ codeData.statusName }}</text>
|
||||||
|
</uni-forms-item>
|
||||||
|
<!-- <uni-forms-item label="设备数量:">
|
||||||
|
<text class="form-view">1</text>
|
||||||
|
</uni-forms-item> -->
|
||||||
</uni-forms>
|
</uni-forms>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -54,7 +61,6 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -71,7 +77,7 @@
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.queryParams = JSON.parse(options.queryParams)
|
this.queryParams = JSON.parse(options.queryParams)
|
||||||
this.queryCodeParams.typeId = this.queryParams.typeId
|
this.queryCodeParams.typeId = this.queryParams.typeId;
|
||||||
},
|
},
|
||||||
onReady() {
|
onReady() {
|
||||||
this.cameraHeight = uni.getSystemInfoSync().screenHeight * 0.22
|
this.cameraHeight = uni.getSystemInfoSync().screenHeight * 0.22
|
||||||
|
|
@ -79,6 +85,7 @@
|
||||||
this.init()
|
this.init()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//初始化相机
|
||||||
init() {
|
init() {
|
||||||
this.livePusher = uni.createLivePusherContext('livePusher', this);
|
this.livePusher = uni.createLivePusherContext('livePusher', this);
|
||||||
console.log(this.livePusher)
|
console.log(this.livePusher)
|
||||||
|
|
@ -86,6 +93,7 @@
|
||||||
this.startPreview()
|
this.startPreview()
|
||||||
}, 1000)
|
}, 1000)
|
||||||
},
|
},
|
||||||
|
// 开始相机
|
||||||
startPreview() {
|
startPreview() {
|
||||||
this.livePusher.startPreview({
|
this.livePusher.startPreview({
|
||||||
success: () => {
|
success: () => {
|
||||||
|
|
@ -103,6 +111,7 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
//截屏
|
||||||
handleInstruct(instruct) {
|
handleInstruct(instruct) {
|
||||||
if (this.ready) {
|
if (this.ready) {
|
||||||
this.ready = false
|
this.ready = false
|
||||||
|
|
@ -115,30 +124,70 @@
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
//编码检索
|
||||||
|
async getCode(){
|
||||||
|
let param = {
|
||||||
|
maCode:this.queryCodeParams.maCode,
|
||||||
|
typeId:this.queryCodeParams.typeId,
|
||||||
|
maStatus:1
|
||||||
|
}
|
||||||
|
uni.request({
|
||||||
|
url: 'http://192.168.2.246:18080/material/ma_machine/list',
|
||||||
|
method: 'get',
|
||||||
|
data: param,
|
||||||
|
success: res => {
|
||||||
|
res = res.data;
|
||||||
|
console.log(res)
|
||||||
|
if(res.rows&&res.rows.length>0){
|
||||||
|
this.codeData=res.rows[0];
|
||||||
|
}else{
|
||||||
|
uni.showToast({
|
||||||
|
title: '未检索到有效的设备编码!',
|
||||||
|
icon: 'none',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
fail: err => {
|
||||||
|
console.log(err)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// const res = await getCodeDeviceListAPI(param)
|
||||||
|
// console.log(res)
|
||||||
|
// this.codeData=res.rows[0];
|
||||||
|
},
|
||||||
|
//出库按钮
|
||||||
async onHandleOutbound(){
|
async onHandleOutbound(){
|
||||||
let paramsList = []
|
let paramsList = []
|
||||||
paramsList.push({
|
paramsList.push({
|
||||||
maCode: this.codeData.maCode,
|
maCode: this.codeData.maCode,
|
||||||
maId: this.codeData.maId,
|
maId: this.codeData.maId,
|
||||||
leaseType:0,
|
manageType:0,
|
||||||
outType:2,
|
outNum:1,
|
||||||
outNum:1,
|
typeId:this.codeData.typeId,
|
||||||
typeId:this.codeData.typeId,
|
parentId: this.queryParams.parentId,
|
||||||
manageType: this.codeData.manageType,
|
})
|
||||||
parentId: this.queryParams.parentId,
|
|
||||||
// typeName: this.codeData.typeName,
|
|
||||||
// typeModelName: this.codeData.typeModelName
|
|
||||||
})
|
|
||||||
console.log('333333333', paramsList)
|
console.log('333333333', paramsList)
|
||||||
// const res = await setOutboundNumAPI({ leaseOutDetailsList: paramsList })
|
uni.request({
|
||||||
// if (res.code === 200) {
|
url: 'http://192.168.2.246:18080/material/lease_apply_info/leaseOut',
|
||||||
// uni.showToast({
|
method: 'post',
|
||||||
// title: '出库成功!',
|
data: { leaseOutDetailsList: paramsList },
|
||||||
// icon: 'none',
|
success: res => {
|
||||||
// })
|
res = res.data;
|
||||||
// this.queryCodeParams.maCode = ''
|
console.log(res)
|
||||||
// this.codeData = {}
|
if (res.code === 200) {
|
||||||
// }
|
uni.showToast({
|
||||||
|
title: '出库成功!',
|
||||||
|
icon: 'none',
|
||||||
|
})
|
||||||
|
this.queryCodeParams.maCode = ''
|
||||||
|
this.codeData = {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: err => {
|
||||||
|
console.log(err)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,15 +19,12 @@
|
||||||
class="table-list-item"
|
class="table-list-item"
|
||||||
>
|
>
|
||||||
<uni-swipe-action class="swipe-action">
|
<uni-swipe-action class="swipe-action">
|
||||||
<uni-swipe-action-item
|
<uni-swipe-action-item :right-options="item.status==2 ? options2 : options"
|
||||||
:right-options="item.status == 2 ? options2 : options"
|
@click="onClick($event, item)">
|
||||||
@click="onClick($event, item)"
|
|
||||||
>
|
|
||||||
<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
|
<uni-tag :text="item.status == 2 ? '已完成' : '未完成'"
|
||||||
:text="item.status == 2 ? '已完成' : '未完成'"
|
|
||||||
:type="item.status == 2 ? 'success' : 'warning'"
|
:type="item.status == 2 ? 'success' : 'warning'"
|
||||||
:custom-style="item.status == 2 ? successStyle : warningStyle"
|
:custom-style="item.status == 2 ? successStyle : warningStyle"
|
||||||
/>
|
/>
|
||||||
|
|
@ -98,9 +95,10 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onUnmounted } from 'vue'
|
import { ref, onUnmounted } from 'vue'
|
||||||
import { getOutboundDetailsAPI } from '@/services/picking/outbound.js'
|
import { getOutboundDetailsAPI,leaseOutBackApi } from '@/services/picking/outbound.js'
|
||||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||||
|
|
||||||
|
const taskStatus = ref(3)//进行中
|
||||||
const detailsList = ref([])
|
const detailsList = ref([])
|
||||||
// const query = defineProps() // 获取上级页面传递的路由参数
|
// const query = defineProps() // 获取上级页面传递的路由参数
|
||||||
|
|
||||||
|
|
@ -117,74 +115,99 @@ const leaseApplyInfo = ref({
|
||||||
preNum: '', // 预领数量
|
preNum: '', // 预领数量
|
||||||
parentId: '', // 出库时所需参数 取列表 id
|
parentId: '', // 出库时所需参数 取列表 id
|
||||||
id: '', // 出库时所需参数 取详情接口 id
|
id: '', // 出库时所需参数 取详情接口 id
|
||||||
typeId: '', // 出库时所需参数 取详情接口 typeId
|
typeId: '', // 出库时所需参数 取详情接口 typeId
|
||||||
manageType: '', // 出库时所需参数 取详情接口 manageType
|
manageType: '', // 出库时所需参数 取详情接口 manageType
|
||||||
})
|
})
|
||||||
|
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
leaseApplyInfo.value.parentId = options.id
|
leaseApplyInfo.value.parentId = options.id
|
||||||
getOutboundDetailsData()
|
getOutboundDetailsData()
|
||||||
})
|
})
|
||||||
|
|
||||||
// 获取列表详情
|
|
||||||
const getOutboundDetailsData = async () => {
|
|
||||||
const { data: res } = await getOutboundDetailsAPI(leaseApplyInfo.value.parentId)
|
|
||||||
detailsList.value = res.leaseApplyDetailsList
|
|
||||||
console.log(res.leaseApplyInfo)
|
|
||||||
leaseApplyInfo.value.leaseUnitId = res.leaseApplyInfo.leaseUnitId
|
|
||||||
leaseApplyInfo.value.leaseUnit = res.leaseApplyInfo.leaseUnit
|
|
||||||
leaseApplyInfo.value.leaseProjectId = res.leaseApplyInfo.leaseProjectId
|
|
||||||
leaseApplyInfo.value.leaseProject = res.leaseApplyInfo.leaseProject
|
|
||||||
// console.log('详情数据', res)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 点击跳转出库页面
|
|
||||||
const onCodingItem = (item) => {
|
|
||||||
console.log(item)
|
|
||||||
// 解构所需要的数据
|
|
||||||
const {
|
|
||||||
status,
|
|
||||||
manageType,
|
|
||||||
maTypeName,
|
|
||||||
typeName,
|
|
||||||
storageNum,
|
|
||||||
preNum,
|
|
||||||
alNum,
|
|
||||||
unitName,
|
|
||||||
id,
|
|
||||||
typeId,
|
|
||||||
unitValue,
|
|
||||||
} = item
|
|
||||||
leaseApplyInfo.value.maTypeName = maTypeName
|
|
||||||
leaseApplyInfo.value.typeName = typeName
|
|
||||||
leaseApplyInfo.value.unitName = unitName
|
|
||||||
leaseApplyInfo.value.storageNum = storageNum
|
|
||||||
leaseApplyInfo.value.preNum = preNum
|
|
||||||
leaseApplyInfo.value.alNum = alNum
|
|
||||||
leaseApplyInfo.value.id = id
|
|
||||||
leaseApplyInfo.value.typeId = typeId
|
|
||||||
leaseApplyInfo.value.manageType = manageType
|
|
||||||
leaseApplyInfo.value.unitValue = unitValue
|
|
||||||
|
|
||||||
if (status == 2) {
|
|
||||||
uni.showToast({ title: '该物资已完成出库!', icon: 'none' })
|
|
||||||
return
|
|
||||||
}
|
|
||||||
let codingUrl = ''
|
|
||||||
if (manageType === 0) {
|
|
||||||
codingUrl = '/pages/picking/outbound/code-outbound' // 编码出库
|
|
||||||
}
|
|
||||||
if (manageType == 1) {
|
|
||||||
codingUrl = '/pages/picking/outbound/num-outbound' // 数量出库
|
|
||||||
}
|
|
||||||
|
|
||||||
// 把 leaseApplyInfo 领料信息转成 json 传递到下个页面
|
|
||||||
uni.navigateTo({ url: `${codingUrl}?queryParams=${JSON.stringify(leaseApplyInfo.value)}` })
|
|
||||||
}
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
getOutboundDetailsData()
|
getOutboundDetailsData()
|
||||||
})
|
})
|
||||||
|
// 获取列表详情
|
||||||
|
const getOutboundDetailsData = async () => {
|
||||||
|
const { data: res } = await getOutboundDetailsAPI(leaseApplyInfo.value.parentId)
|
||||||
|
console.log(res)
|
||||||
|
detailsList.value = res.leaseApplyDetailsList;
|
||||||
|
leaseApplyInfo.value.taskId = res.leaseApplyInfo.taskId;
|
||||||
|
leaseApplyInfo.value.typeId = res.leaseApplyInfo.typeId;
|
||||||
|
leaseApplyInfo.value.leaseUnitId = res.leaseApplyInfo.leaseUnitId;
|
||||||
|
leaseApplyInfo.value.leaseUnit = res.leaseApplyInfo.leaseUnit;
|
||||||
|
leaseApplyInfo.value.leaseProjectId = res.leaseApplyInfo.leaseProjectId;
|
||||||
|
leaseApplyInfo.value.leaseProject = res.leaseApplyInfo.leaseProject;
|
||||||
|
taskStatus.value = res.leaseApplyInfo.taskStatus;
|
||||||
|
if(taskStatus.value==3){
|
||||||
|
options.value = [
|
||||||
|
{ text: '出库',style: {backgroundColor: '#84c649',color: '#fff',fontSize: '28rpx'} },
|
||||||
|
{ text: '退回',style: {backgroundColor: '#ed6042',color: '#fff',fontSize: '28rpx'} },
|
||||||
|
{ text: '查看',style: {backgroundColor: '#3784fb',color: '#fff',fontSize: '28rpx'} }
|
||||||
|
];
|
||||||
|
options2.value = [
|
||||||
|
{ text: '退回',style: {backgroundColor: '#ed6042',color: '#fff',fontSize: '28rpx'}},
|
||||||
|
{ text: '查看',style: {backgroundColor: '#3784fb',color: '#fff',fontSize: '28rpx'}}
|
||||||
|
]
|
||||||
|
}else if(taskStatus.value==4){
|
||||||
|
options.value = [
|
||||||
|
{ text: '出库',style: {backgroundColor: '#84c649',color: '#fff',fontSize: '28rpx'} },
|
||||||
|
{ text: '查看',style: {backgroundColor: '#3784fb',color: '#fff',fontSize: '28rpx'} }
|
||||||
|
];
|
||||||
|
options2.value = [
|
||||||
|
{ text: '查看',style: {backgroundColor: '#3784fb',color: '#fff',fontSize: '28rpx'}}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 数量退回
|
||||||
|
const leaseOutBack = async (item) => {
|
||||||
|
console.log(item)
|
||||||
|
if(item.manageType==0){//编码
|
||||||
|
const { status,manageType,maTypeName,typeName,storageNum,preNum,alNum,unitName,id,typeId, unitValue} = item
|
||||||
|
leaseApplyInfo.value.maTypeName = maTypeName
|
||||||
|
leaseApplyInfo.value.typeName = typeName
|
||||||
|
leaseApplyInfo.value.unitName = unitName
|
||||||
|
leaseApplyInfo.value.storageNum = storageNum
|
||||||
|
leaseApplyInfo.value.preNum = preNum
|
||||||
|
leaseApplyInfo.value.alNum = alNum
|
||||||
|
leaseApplyInfo.value.id = id
|
||||||
|
leaseApplyInfo.value.typeId = typeId
|
||||||
|
leaseApplyInfo.value.manageType = manageType
|
||||||
|
leaseApplyInfo.value.unitValue = unitValue
|
||||||
|
console.log(leaseApplyInfo.value)
|
||||||
|
let codingUrl = '/pages/picking/outbound/inner-detail'
|
||||||
|
// 把 leaseApplyInfo 领料信息转成 json 传递到下个页面
|
||||||
|
uni.navigateTo({ url: `${codingUrl}?queryParams=${JSON.stringify(leaseApplyInfo.value)}&isBack=1` })
|
||||||
|
}else{
|
||||||
|
let param = {
|
||||||
|
outNum:item.alNum,
|
||||||
|
taskId:leaseApplyInfo.value.taskId,
|
||||||
|
typeId:item.typeId,
|
||||||
|
parentId:item.parentId
|
||||||
|
}
|
||||||
|
console.log(param)
|
||||||
|
uni.showModal({
|
||||||
|
title: '退回',
|
||||||
|
content: `是否确定退回该类型的出库?`,
|
||||||
|
confirmText: '确定',
|
||||||
|
cancelText: '取消',
|
||||||
|
success: async (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
const res = await leaseOutBackApi(param)
|
||||||
|
console.log(res)
|
||||||
|
if(res.code==200){
|
||||||
|
uni.showToast({
|
||||||
|
title: '退回成功!',
|
||||||
|
icon: 'none',
|
||||||
|
})
|
||||||
|
getOutboundDetailsData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
// 状态标签样式
|
// 状态标签样式
|
||||||
const successStyle = {
|
const successStyle = {
|
||||||
color: '#52c41a',
|
color: '#52c41a',
|
||||||
|
|
@ -224,13 +247,20 @@ const options = ref([
|
||||||
{
|
{
|
||||||
text: '出库',
|
text: '出库',
|
||||||
style: {
|
style: {
|
||||||
backgroundColor: '#3784fb',
|
backgroundColor: '#84c649',
|
||||||
// color: '#fff',
|
// color: '#fff',
|
||||||
fontSize: '28rpx',
|
fontSize: '28rpx',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
])
|
{
|
||||||
|
text: '查看',
|
||||||
|
style: {
|
||||||
|
backgroundColor: '#3784fb',
|
||||||
|
// color: '#fff',
|
||||||
|
fontSize: '28rpx',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
])
|
||||||
const options2 = ref([
|
const options2 = ref([
|
||||||
{
|
{
|
||||||
text: '查看',
|
text: '查看',
|
||||||
|
|
@ -244,9 +274,106 @@ const options2 = ref([
|
||||||
|
|
||||||
// 点击滑动按钮
|
// 点击滑动按钮
|
||||||
const onClick = (e, item) => {
|
const onClick = (e, item) => {
|
||||||
if (e.index === 0) {
|
if(taskStatus.value==3){//出库进行中
|
||||||
onCodingItem(item)
|
if (e.index === 0) {
|
||||||
|
if (item.status == 2) {//已完成
|
||||||
|
console.log(302)//退回
|
||||||
|
leaseOutBack(item)
|
||||||
|
}else{
|
||||||
|
console.log(30)
|
||||||
|
onCodingItem(item)//出库
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (e.index === 1) {
|
||||||
|
if (item.status == 2) {//已完成
|
||||||
|
console.log(312)
|
||||||
|
checkViewDetail(item)//查看
|
||||||
|
}else{
|
||||||
|
console.log(31)//退回
|
||||||
|
leaseOutBack(item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (e.index === 2) {
|
||||||
|
if (item.status == 2) {//已完成
|
||||||
|
}else{
|
||||||
|
console.log(32)
|
||||||
|
checkViewDetail(item)//查看
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(taskStatus.value==4){//出库已完成
|
||||||
|
checkViewDetail(item)//查看
|
||||||
|
}
|
||||||
|
// onCodingItem(item)//出库
|
||||||
|
// checkViewDetail(item)//查看
|
||||||
|
// onCodingItem(item)//出库
|
||||||
|
}
|
||||||
|
// 点击跳转出库页面
|
||||||
|
const onCodingItem = (item) => {
|
||||||
|
// 解构所需要的数据
|
||||||
|
const {
|
||||||
|
status,
|
||||||
|
manageType,
|
||||||
|
maTypeName,
|
||||||
|
typeName,
|
||||||
|
storageNum,
|
||||||
|
preNum,
|
||||||
|
alNum,
|
||||||
|
unitName,
|
||||||
|
id,
|
||||||
|
typeId,
|
||||||
|
unitValue,
|
||||||
|
} = item
|
||||||
|
leaseApplyInfo.value.maTypeName = maTypeName
|
||||||
|
leaseApplyInfo.value.typeName = typeName
|
||||||
|
leaseApplyInfo.value.unitName = unitName
|
||||||
|
leaseApplyInfo.value.storageNum = storageNum
|
||||||
|
leaseApplyInfo.value.preNum = preNum
|
||||||
|
leaseApplyInfo.value.alNum = alNum
|
||||||
|
leaseApplyInfo.value.id = id
|
||||||
|
leaseApplyInfo.value.typeId = typeId
|
||||||
|
leaseApplyInfo.value.manageType = manageType
|
||||||
|
leaseApplyInfo.value.unitValue = unitValue
|
||||||
|
console.log(leaseApplyInfo.value)
|
||||||
|
let codingUrl = ''
|
||||||
|
if (manageType === 0) {
|
||||||
|
codingUrl = '/pages/picking/outbound/code-outbound' // 编码出库
|
||||||
}
|
}
|
||||||
|
if (manageType == 1) {
|
||||||
|
codingUrl = '/pages/picking/outbound/num-outbound' // 数量出库
|
||||||
|
}
|
||||||
|
// 把 leaseApplyInfo 领料信息转成 json 传递到下个页面
|
||||||
|
uni.navigateTo({ url: `${codingUrl}?queryParams=${JSON.stringify(leaseApplyInfo.value)}` })
|
||||||
|
}
|
||||||
|
const checkViewDetail = (item) => {
|
||||||
|
// 解构所需要的数据
|
||||||
|
const {
|
||||||
|
status,
|
||||||
|
manageType,
|
||||||
|
maTypeName,
|
||||||
|
typeName,
|
||||||
|
storageNum,
|
||||||
|
preNum,
|
||||||
|
alNum,
|
||||||
|
unitName,
|
||||||
|
id,
|
||||||
|
typeId,
|
||||||
|
unitValue,
|
||||||
|
} = item
|
||||||
|
leaseApplyInfo.value.maTypeName = maTypeName
|
||||||
|
leaseApplyInfo.value.typeName = typeName
|
||||||
|
leaseApplyInfo.value.unitName = unitName
|
||||||
|
leaseApplyInfo.value.storageNum = storageNum
|
||||||
|
leaseApplyInfo.value.preNum = preNum
|
||||||
|
leaseApplyInfo.value.alNum = alNum
|
||||||
|
leaseApplyInfo.value.id = id
|
||||||
|
leaseApplyInfo.value.typeId = typeId
|
||||||
|
leaseApplyInfo.value.manageType = manageType
|
||||||
|
leaseApplyInfo.value.unitValue = unitValue
|
||||||
|
console.log(leaseApplyInfo.value)
|
||||||
|
let codingUrl = '/pages/picking/outbound/inner-detail'
|
||||||
|
// 把 leaseApplyInfo 领料信息转成 json 传递到下个页面
|
||||||
|
uni.navigateTo({ url: `${codingUrl}?queryParams=${JSON.stringify(leaseApplyInfo.value)}&isBack=0` })
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,489 @@
|
||||||
|
<template>
|
||||||
|
<view class="page-container">
|
||||||
|
<!-- 表单信息区域 -->
|
||||||
|
<scroll-view scroll-y style="height: 100vh;">
|
||||||
|
<view class="form-section" v-if="queryParams.manageType==1">
|
||||||
|
<view class="form-content">
|
||||||
|
<uni-forms :model="formData" label-width="100" :border="true">
|
||||||
|
<uni-forms-item label="物资类型:" name="maTypeName">
|
||||||
|
<span style="height: 100%;display: flex;align-items: center;">{{ formData.maTypeName||"" }}</span>
|
||||||
|
</uni-forms-item>
|
||||||
|
<uni-forms-item label="规格型号:" name=" typeName">
|
||||||
|
<span style="height: 100%;display: flex;align-items: center;">{{ formData.typeName||"" }}</span>
|
||||||
|
</uni-forms-item>
|
||||||
|
<uni-forms-item label="出库人:" name="createBy">
|
||||||
|
<span style="height: 100%;display: flex;align-items: center;">{{ formData.createBy||"" }}</span>
|
||||||
|
</uni-forms-item>
|
||||||
|
<uni-forms-item label="出库时间:" name="createTime">
|
||||||
|
<span style="height: 100%;display: flex;align-items: center;">{{ formData.createTime||"" }}</span>
|
||||||
|
</uni-forms-item>
|
||||||
|
</uni-forms>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<scroll-view scroll-y @scrolltolower="onScrollTolower" v-if="queryParams.manageType==0" style="padding-bottom: 90rpx">
|
||||||
|
<view class="table-list-item" v-for="item in codeDeviceList" :key="item.maId">
|
||||||
|
<uni-row :gutter="24">
|
||||||
|
<uni-col :span="6">物资类型:</uni-col>
|
||||||
|
<uni-col :span="14">
|
||||||
|
<view class="cont">{{ item.maTypeName }}</view>
|
||||||
|
</uni-col>
|
||||||
|
<uni-col :span="4">
|
||||||
|
<view class="return-btn" @tap="leaseOutBack(item)" v-if="isBack"> 退回 </view>
|
||||||
|
</uni-col>
|
||||||
|
<!-- <uni-col :span="4">
|
||||||
|
<checkbox-group @change="onChangeChecked(item)">
|
||||||
|
<label>
|
||||||
|
<checkbox
|
||||||
|
color="#409eff"
|
||||||
|
borderColor="#409eff"
|
||||||
|
activeBorderColor="#409eff"
|
||||||
|
:checked="item.checked"
|
||||||
|
style="transform: scale(0.7)"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
</checkbox-group>
|
||||||
|
</uni-col> -->
|
||||||
|
</uni-row>
|
||||||
|
<uni-row :gutter="24">
|
||||||
|
<uni-col :span="6">规格型号:</uni-col>
|
||||||
|
<uni-col :span="16">
|
||||||
|
<view class="cont">{{ item.typeName }}</view>
|
||||||
|
</uni-col>
|
||||||
|
</uni-row>
|
||||||
|
<uni-row :gutter="24">
|
||||||
|
<uni-col :span="6">设备编码:</uni-col>
|
||||||
|
<uni-col :span="16">
|
||||||
|
<view class="cont">{{ item.maCode }}</view>
|
||||||
|
</uni-col>
|
||||||
|
</uni-row>
|
||||||
|
<uni-row :gutter="24">
|
||||||
|
<uni-col :span="6">出库人:</uni-col>
|
||||||
|
<uni-col :span="16">
|
||||||
|
<view class="cont">{{ item.createBy||"" }}</view>
|
||||||
|
</uni-col>
|
||||||
|
</uni-row>
|
||||||
|
<uni-row :gutter="24">
|
||||||
|
<uni-col :span="6">出库时间:</uni-col>
|
||||||
|
<uni-col :span="16">
|
||||||
|
<view class="cont">{{item.createTime||""}}</view>
|
||||||
|
</uni-col>
|
||||||
|
</uni-row>
|
||||||
|
</view>
|
||||||
|
<view class="loading-text">
|
||||||
|
{{ finish ? '没有更多数据了~' : '正在加载...' }}
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
</scroll-view>
|
||||||
|
<!-- <view class="outbound-btn" @tap="leaseOutBack" v-if="isBack"> 退回 </view> -->
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, computed, onUnmounted } from 'vue'
|
||||||
|
import { onLoad, onShow, } from '@dcloudio/uni-app'
|
||||||
|
import { getDetailsByIdApi, leaseOutBackApi } from '@/services/picking/outbound.js'
|
||||||
|
import { debounce } from 'lodash-es'
|
||||||
|
const queryParams = ref({})
|
||||||
|
const formData = ref({})
|
||||||
|
const isBack = ref(0)
|
||||||
|
const codeDeviceList = ref([])
|
||||||
|
const total = ref(0)
|
||||||
|
// 编码设备列表查询参数
|
||||||
|
const queryCodeParams = ref({
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
taskId: '',
|
||||||
|
typeId: '',
|
||||||
|
})
|
||||||
|
|
||||||
|
// 页面加载完毕
|
||||||
|
onLoad((options) => {
|
||||||
|
queryParams.value = JSON.parse(options.queryParams)
|
||||||
|
if(options.isBack==0){
|
||||||
|
isBack.value = false
|
||||||
|
}else{
|
||||||
|
isBack.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
onShow(() => {
|
||||||
|
console.log(queryParams.value)
|
||||||
|
queryCodeParams.value.taskId = queryParams.value.taskId;
|
||||||
|
queryCodeParams.value.typeId = queryParams.value.typeId;
|
||||||
|
queryCodeParams.value.pageNum = 1;
|
||||||
|
codeDeviceList.value = [];
|
||||||
|
getCodeDeviceListData()//获取编码列表
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
// 获取编码列表
|
||||||
|
const getCodeDeviceListData = async () => {
|
||||||
|
const res = await getDetailsByIdApi(queryCodeParams.value)
|
||||||
|
if(queryParams.value.manageType==0){
|
||||||
|
codeDeviceList.value.push(...res.data.rows)
|
||||||
|
if (isBack.value&&codeDeviceList.value.length > 0) {
|
||||||
|
codeDeviceList.value = codeDeviceList.value.map((e) => {
|
||||||
|
return { ...e, checked: false }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
total.value = res.data.total;
|
||||||
|
}else if(queryParams.value.manageType==1){
|
||||||
|
if(res.data.rows&&res.data.rows.length>0){
|
||||||
|
formData.value=res.data.rows[0]
|
||||||
|
}else{
|
||||||
|
formData.value={
|
||||||
|
maTypeName:queryParams.value.maTypeName,
|
||||||
|
typeName:queryParams.value.typeName,
|
||||||
|
createBy:"",
|
||||||
|
createTime:""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 编码搜索按钮
|
||||||
|
const onCodeSearch = () => {
|
||||||
|
queryCodeParams.value.pageNum = 1
|
||||||
|
codeDeviceList.value = []
|
||||||
|
getCodeDeviceListData()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 滚动触底事件
|
||||||
|
const onScrollTolower = debounce(() => {
|
||||||
|
// console.log('滚动触底--')
|
||||||
|
if (total.value > codeDeviceList.value.length) {
|
||||||
|
queryCodeParams.value.pageNum++
|
||||||
|
getCodeDeviceListData()
|
||||||
|
}
|
||||||
|
}, 500)
|
||||||
|
|
||||||
|
// 判断数<EFBFBD><EFBFBD>是否加载完毕
|
||||||
|
const finish = computed(() => {
|
||||||
|
if (total.value === codeDeviceList.value.length) return true
|
||||||
|
})
|
||||||
|
|
||||||
|
// 复选框事件
|
||||||
|
const onChangeChecked = (item) => {
|
||||||
|
item.checked = !item.checked
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const leaseOutBack = async (item) => {
|
||||||
|
|
||||||
|
// 解构所需要的数据
|
||||||
|
const { typeId, parentId,taskId } = queryParams.value
|
||||||
|
// const isSelect = codeDeviceList.value.some((e) => e.checked === true)
|
||||||
|
// if (!isSelect) {
|
||||||
|
// uni.showToast({
|
||||||
|
// title: '请勾选需要出库的设备',
|
||||||
|
// icon: 'none',
|
||||||
|
// })
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// 组装出库参数
|
||||||
|
// const paramsList = []
|
||||||
|
// codeDeviceList.value.map((e) => {
|
||||||
|
// if (e.checked) {
|
||||||
|
// paramsList.push({
|
||||||
|
// maId: e.maId,
|
||||||
|
// taskId,
|
||||||
|
// parentId,
|
||||||
|
// typeId,
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// console.log(paramsList)
|
||||||
|
console.log(item)
|
||||||
|
let param = {
|
||||||
|
maId: item.maId,
|
||||||
|
outNum:1,
|
||||||
|
taskId,
|
||||||
|
parentId,
|
||||||
|
typeId,
|
||||||
|
}
|
||||||
|
console.log(param)
|
||||||
|
const res = await leaseOutBackApi(param)
|
||||||
|
if (res.code === 200) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '退回成功!',
|
||||||
|
icon: 'none',
|
||||||
|
})
|
||||||
|
queryCodeParams.value.pageNum = 1
|
||||||
|
codeDeviceList.value = []
|
||||||
|
getCodeDeviceListData()//获取详情
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.page-container {
|
||||||
|
display: flex;
|
||||||
|
height: 100%;
|
||||||
|
flex-direction: column;
|
||||||
|
background-color: #f7f8fa;
|
||||||
|
padding: 24rpx;
|
||||||
|
|
||||||
|
.table-list-item {
|
||||||
|
background: #fff;
|
||||||
|
padding: 32rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
|
||||||
|
margin-bottom: 24rpx;
|
||||||
|
|
||||||
|
// 表单样式
|
||||||
|
:deep(.uni-forms) {
|
||||||
|
.uni-forms-item {
|
||||||
|
margin-bottom: 24rpx;
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-forms-item__label {
|
||||||
|
color: #8c8c8c;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
padding: 0;
|
||||||
|
line-height: 1.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-forms-item__content {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
min-height: unset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 编码按钮组
|
||||||
|
.coding-btn {
|
||||||
|
padding: 16rpx 0;
|
||||||
|
background: linear-gradient(135deg, #4b8eff 0%, #3784fb 100%);
|
||||||
|
border-radius: 12rpx;
|
||||||
|
text-align: center;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
box-shadow: 0 6rpx 20rpx rgba(55, 132, 251, 0.2);
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
transform: scale(0.98);
|
||||||
|
opacity: 0.9;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 编码检索按钮特殊样式
|
||||||
|
&.search-btn {
|
||||||
|
padding: 12rpx 0;
|
||||||
|
background: #fff;
|
||||||
|
color: #ff9800;
|
||||||
|
border: 2rpx solid rgba(255, 152, 0, 0.5);
|
||||||
|
background: linear-gradient(to bottom, rgba(255, 152, 0, 0.05), rgba(255, 152, 0, 0.1));
|
||||||
|
box-shadow: none;
|
||||||
|
font-weight: 600;
|
||||||
|
letter-spacing: 1rpx;
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
background: rgba(255, 152, 0, 0.15);
|
||||||
|
border-color: rgba(255, 152, 0, 0.6);
|
||||||
|
transform: translateY(1rpx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 编码列表样式
|
||||||
|
:deep(.uni-row) {
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-col-6 {
|
||||||
|
color: #8c8c8c;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cont {
|
||||||
|
color: #262626;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 1.8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 输入框样式
|
||||||
|
:deep(.uni-easyinput__content) {
|
||||||
|
background-color: #f7f8fa;
|
||||||
|
border: 2rpx solid #e8e8e8;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
|
||||||
|
&:focus-within {
|
||||||
|
border-color: #3784fb;
|
||||||
|
box-shadow: 0 0 0 2rpx rgba(55, 132, 251, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-easyinput__content-input {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #262626;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 复选框样式
|
||||||
|
:deep(checkbox) {
|
||||||
|
.wx-checkbox-input {
|
||||||
|
width: 36rpx;
|
||||||
|
height: 36rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
border: 2rpx solid #e8e8e8;
|
||||||
|
background: transparent;
|
||||||
|
|
||||||
|
&.wx-checkbox-input-checked {
|
||||||
|
background: #3784fb;
|
||||||
|
border-color: #3784fb;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.wx-checkbox-input-disabled {
|
||||||
|
background: #f5f5f5;
|
||||||
|
border-color: #e8e8e8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.return-btn{
|
||||||
|
width: 100%;
|
||||||
|
height: 60rpx;
|
||||||
|
background: #fa8c16;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 60rpx;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
// 底部出库按钮
|
||||||
|
.outbound-btn {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 40rpx;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
width: 90%;
|
||||||
|
height: 88rpx;
|
||||||
|
background: linear-gradient(135deg, #4b8eff 0%, #3784fb 100%);
|
||||||
|
text-align: center;
|
||||||
|
line-height: 88rpx;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
box-shadow: 0 6rpx 20rpx rgba(55, 132, 251, 0.2);
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
transform: translateX(-50%) scale(0.98);
|
||||||
|
opacity: 0.9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 加载提示文字
|
||||||
|
.loading-text {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #8c8c8c;
|
||||||
|
padding: 32rpx 0;
|
||||||
|
letter-spacing: 1rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-section {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
margin-bottom: 24rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
|
||||||
|
|
||||||
|
// 头部样式
|
||||||
|
.section-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 24rpx 32rpx;
|
||||||
|
background: #fff;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
background: #f7f8fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #262626;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toggle-icon {
|
||||||
|
font-size: 40rpx;
|
||||||
|
color: #8c8c8c;
|
||||||
|
transform: rotate(90deg);
|
||||||
|
transition: transform 0.3s ease;
|
||||||
|
display: inline-block;
|
||||||
|
|
||||||
|
&.is-expanded {
|
||||||
|
transform: rotate(-90deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 表单内容区域
|
||||||
|
.form-content {
|
||||||
|
max-height: 300px;
|
||||||
|
overflow: hidden;
|
||||||
|
transition: max-height 0.3s ease-out;
|
||||||
|
|
||||||
|
&.is-expanded {
|
||||||
|
max-height: 1000rpx; // 根据实际内容调整
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.uni-forms) {
|
||||||
|
padding: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.uni-forms-item) {
|
||||||
|
margin-bottom: 0rpx;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-forms-item__label {
|
||||||
|
color: #8c8c8c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-view {
|
||||||
|
color: #262626;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -124,14 +124,11 @@ const onHandleOutbound = async () => {
|
||||||
title: '出库成功!',
|
title: '出库成功!',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
})
|
})
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// 返回上一个页面
|
// 返回上一个页面
|
||||||
uni.navigateBack({
|
uni.navigateBack({
|
||||||
delta: 1,
|
delta: 1,
|
||||||
success() {
|
success() {},
|
||||||
uni.$emit('onUpdate')
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
}, 500)
|
}, 500)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -176,6 +176,9 @@ const bindMa = (qrCode) => {
|
||||||
if(res.code==200){
|
if(res.code==200){
|
||||||
uni.showToast({ title: '绑定成功', icon: 'none' })
|
uni.showToast({ title: '绑定成功', icon: 'none' })
|
||||||
getCodeList()
|
getCodeList()
|
||||||
|
setTimeout(()=>{
|
||||||
|
scanStart()
|
||||||
|
},500)
|
||||||
}else{
|
}else{
|
||||||
uni.showToast({ title: '绑定失败', icon: 'none' })
|
uni.showToast({ title: '绑定失败', icon: 'none' })
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ export const getPickingOutboundListAPI = (data) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 领料出库 ---- 列表详情
|
* 领料出库 ---- 任务详情
|
||||||
*/
|
*/
|
||||||
export const getOutboundDetailsAPI = (id) => {
|
export const getOutboundDetailsAPI = (id) => {
|
||||||
return http({
|
return http({
|
||||||
|
|
@ -20,7 +20,28 @@ export const getOutboundDetailsAPI = (id) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 领料出库 ---- 数量出库
|
* 领料出库 ---- 物资详情
|
||||||
|
*/
|
||||||
|
export const getCodeDetailAPI = (data) => {
|
||||||
|
return http({
|
||||||
|
method: 'GET',
|
||||||
|
url: `/material/lease_apply_info/getInnerById`,
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 领料出库 ---- 查看详情
|
||||||
|
*/
|
||||||
|
export const getDetailsByIdApi = (data) => {
|
||||||
|
return http({
|
||||||
|
method: 'GET',
|
||||||
|
url: `/material/lease_apply_info/getDetailsById`,
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领料出库 ---- 出库
|
||||||
*/
|
*/
|
||||||
export const setOutboundNumAPI = (data) => {
|
export const setOutboundNumAPI = (data) => {
|
||||||
return http({
|
return http({
|
||||||
|
|
@ -39,6 +60,7 @@ export const getCodeDeviceListAPI = (data) => {
|
||||||
data,
|
data,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//
|
||||||
export const getCodeScanAPI = (data) => {
|
export const getCodeScanAPI = (data) => {
|
||||||
return http({
|
return http({
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
|
|
@ -46,3 +68,11 @@ export const getCodeScanAPI = (data) => {
|
||||||
data,
|
data,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//出库退回
|
||||||
|
export const leaseOutBackApi = (data) => {
|
||||||
|
return http({
|
||||||
|
method: 'POSt',
|
||||||
|
url: '/material/lease_apply_info/leaseOutBack',
|
||||||
|
data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,10 @@ import { useMemberStore } from '@/stores'
|
||||||
* baseURL 设置请求ip地址和端口
|
* baseURL 设置请求ip地址和端口
|
||||||
*/
|
*/
|
||||||
const ENV = process.env.NODE_ENV
|
const ENV = process.env.NODE_ENV
|
||||||
export const baseURL = ENV === 'development' ? 'http://192.168.0.244:18580' : 'http://192.168.0.244:18580'//测试
|
// export const baseURL = ENV === 'development' ? 'http://192.168.0.244:18580' : 'http://192.168.0.244:18580'//测试
|
||||||
// export const baseURL = ENV === 'development' ? 'http://36.33.26.201:19988/prod-api/' : 'http://36.33.26.201:19988/prod-api/'//生产
|
// export const baseURL = ENV === 'development' ? 'http://36.33.26.201:19988/prod-api/' : 'http://36.33.26.201:19988/prod-api/'//生产
|
||||||
// export const baseURL = ENV === 'development' ? 'http://192.168.0.234:18080' : '***'
|
// export const baseURL = ENV === 'development' ? 'http://192.168.0.234:18080' : '***'
|
||||||
// export const baseURL = ENV === 'development' ? 'http://192.168.2.248:18080' : '***'
|
export const baseURL = ENV === 'development' ? 'http://192.168.2.246:18080' : 'http://192.168.2.246:18080'//马
|
||||||
// export const baseURL = ENV === 'development' ? '/api' : '***'
|
// export const baseURL = ENV === 'development' ? '/api' : '***'
|
||||||
/**
|
/**
|
||||||
* httpInterceptor 分别拦截 request 和 uploadFile 请求
|
* httpInterceptor 分别拦截 request 和 uploadFile 请求
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue