Merge branch 'master' of http://192.168.30.2:3000/bonus/bonus-material-app
This commit is contained in:
commit
7803f67d12
|
|
@ -50,12 +50,13 @@
|
||||||
</uni-row>
|
</uni-row>
|
||||||
</view>
|
</view>
|
||||||
<view class="table-list-item">
|
<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 :model="codeData" label-width="100" :border="true">
|
||||||
<uni-forms-item label="物资类型:" name="materialName">
|
<uni-forms-item label="物资类型:" name="typeName">
|
||||||
<span class="form-view">{{ codeData.materialName }}</span>
|
<span class="form-view">{{ codeData.typeName }}</span>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="规格型号:" name="materialModel">
|
<uni-forms-item label="规格型号:" name="typeModelName">
|
||||||
<span class="form-view">{{ codeData.materialModel }}</span>
|
<span class="form-view">{{ codeData.typeModelName }}</span>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="设备状态:" name="statusName">
|
<uni-forms-item label="设备状态:" name="statusName">
|
||||||
<span class="form-view">{{ codeData.statusName }}</span>
|
<span class="form-view">{{ codeData.statusName }}</span>
|
||||||
|
|
@ -64,6 +65,7 @@
|
||||||
<span class="form-view">1</span>
|
<span class="form-view">1</span>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
</uni-forms>
|
</uni-forms>
|
||||||
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="outbound-btn" @tap="onHandleOutbound"> 出库 </view>
|
<view class="outbound-btn" @tap="onHandleOutbound"> 出库 </view>
|
||||||
|
|
@ -72,7 +74,7 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import { getCodeDeviceListAPI, setOutboundNumAPI } from '@/services/picking/outbound.js'
|
import { getCodeScanAPI, setOutboundNumAPI } from '@/services/picking/outbound.js'
|
||||||
import { onBackPress } from '@dcloudio/uni-app'
|
import { onBackPress } from '@dcloudio/uni-app'
|
||||||
import { debounce } from 'lodash-es'
|
import { debounce } from 'lodash-es'
|
||||||
import { onShow } from '@dcloudio/uni-app'
|
import { onShow } from '@dcloudio/uni-app'
|
||||||
|
|
@ -90,31 +92,42 @@ const queryCodeParams = ref({
|
||||||
typeId: '',
|
typeId: '',
|
||||||
maStatus: 1,
|
maStatus: 1,
|
||||||
maCode: '',
|
maCode: '',
|
||||||
|
qrCode: '',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const qrCodeScan = ref('')
|
||||||
|
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
|
console.log('options', options)
|
||||||
queryParams.value = JSON.parse(options.queryParams)
|
queryParams.value = JSON.parse(options.queryParams)
|
||||||
queryCodeParams.value.typeId = queryParams.value.typeId
|
queryCodeParams.value.typeId = queryParams.value.typeId
|
||||||
})
|
})
|
||||||
// 计算出库最大数量
|
// 计算出库最大数量
|
||||||
const maxNum = computed(() => {
|
const maxNum = computed(() => {
|
||||||
// 通过预领数量和已领数量计算剩余待出库数量
|
// 通过预领数量和已领数量计算剩余待出库数量
|
||||||
const waitNum = queryParams.value.preNum - queryParams.value.alNum - codeNum.value
|
const waitNum = queryParams.value.preNum - queryParams.value.alNum
|
||||||
return waitNum
|
return waitNum
|
||||||
})
|
})
|
||||||
// 扫码识别按钮
|
// 扫码识别按钮
|
||||||
const scanStart = () => {
|
const scanStart = () => {
|
||||||
console.log('编码识别--')
|
console.log('编码识别--')
|
||||||
// 只允许通过相机扫码
|
// 只允许通过相机扫码
|
||||||
uni.scanCode({
|
// uni.scanCode({
|
||||||
onlyFromCamera: true,
|
// onlyFromCamera: true,
|
||||||
scanType: ['qrCode', 'pdf417'],
|
// scanType: ['qrCode', 'pdf417'],
|
||||||
success: (res) => {
|
// success: (res) => {
|
||||||
console.log('扫码结果:' + res.result)
|
// console.log('扫码结果:' + res.result)
|
||||||
queryCodeParams.value.maCode = res.result.split("qrcode=")[1]
|
// qrCodeScan.value = res.result.split("qrcode=")[1]
|
||||||
},
|
// queryCodeParams.value.maCode = res.result.split("qrcode=")[1]
|
||||||
fail: (err) => {},
|
// if (qrCodeScan.value=="") {
|
||||||
})
|
// uni.showToast({ title: '扫码识别失败', icon: 'none'})
|
||||||
|
// }else{
|
||||||
|
// getMaInfoScan()
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// fail: (err) => {},
|
||||||
|
// })
|
||||||
|
|
||||||
|
|
||||||
var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
|
var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
|
||||||
mpaasScanModule.mpaasScan({
|
mpaasScanModule.mpaasScan({
|
||||||
|
|
@ -132,8 +145,21 @@ const scanStart = () => {
|
||||||
if(ret.resp_code==10){
|
if(ret.resp_code==10){
|
||||||
uni.showToast({ title: '用户取消', icon: 'none' })
|
uni.showToast({ title: '用户取消', icon: 'none' })
|
||||||
}
|
}
|
||||||
|
if(ret.resp_code==11){
|
||||||
|
uni.showToast({ title: '扫码失败', icon: 'none' })
|
||||||
|
}
|
||||||
if(ret.resp_code==1000){
|
if(ret.resp_code==1000){
|
||||||
uni.showToast({ title: '成功', icon: 'none' })
|
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({
|
// uni.showModal({
|
||||||
// title: "弹窗标题",
|
// title: "弹窗标题",
|
||||||
|
|
@ -148,34 +174,68 @@ const scanStart = () => {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//根据编码获取设备类型
|
//查看是否是该规格型号
|
||||||
const getMaInfo = async () => {
|
const getMaInfoScan = async () => {
|
||||||
console.log('queryCodeParams', queryCodeParams.value)
|
const res = await getCodeScanAPI(queryCodeParams.value)
|
||||||
const res = await getCodeDeviceListAPI(queryCodeParams.value)
|
|
||||||
console.log(res)
|
console.log(res)
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
if (res.rows && res.rows.length > 0) {
|
if (res.data && res.data.recordList.length > 0) {
|
||||||
codeData.value = res.rows[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 {
|
} else {
|
||||||
uni.showToast({ title: '未查询到该编码', icon: 'none' })
|
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 () => {
|
const onHandleOutbound = async () => {
|
||||||
// 组装出库参数
|
// 组装出库参数
|
||||||
const paramsList = [codeData.value]
|
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 })
|
const res = await setOutboundNumAPI({ leaseOutDetailsList: paramsList })
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '出库成功!',
|
title: '出库成功!',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
})
|
})
|
||||||
|
queryParams.value.alNum = queryParams.value.alNum + 1
|
||||||
queryCodeParams.value.maCode = ''
|
queryCodeParams.value.maCode = ''
|
||||||
codeData.value = {}
|
codeData.value = {}
|
||||||
codeNum.value = codeNum.value + 1
|
// codeNum.value = codeNum.value + 1
|
||||||
uni.$emit('onUpdate', codeNun.value)
|
// uni.$emit('onUpdate', codeNun.value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 页面加载完毕
|
// 页面加载完毕
|
||||||
|
|
@ -184,6 +244,21 @@ onShow(() => {
|
||||||
// scanStart()
|
// scanStart()
|
||||||
}, 500)
|
}, 500)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 监听返回事件
|
||||||
|
// 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>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
<!-- 编码出库-->
|
<!-- 编码出库-->
|
||||||
<view class="page-container">
|
<view class="page-container">
|
||||||
<!-- 表单信息区域 -->
|
<!-- 表单信息区域 -->
|
||||||
|
<scroll-view scroll-y style="height: 100vh;">
|
||||||
<view class="form-section">
|
<view class="form-section">
|
||||||
<view class="section-header" @tap="toggleForm">
|
<view class="section-header" @tap="toggleForm">
|
||||||
<text class="title">表单信息</text>
|
<text class="title">表单信息</text>
|
||||||
|
|
@ -62,6 +63,7 @@
|
||||||
</uni-row>
|
</uni-row>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<scroll-view scroll-y @scrolltolower="onScrollTolower" style="padding-bottom: 90rpx">
|
<scroll-view scroll-y @scrolltolower="onScrollTolower" style="padding-bottom: 90rpx">
|
||||||
<view class="table-list-item" v-for="item in codeDeviceList" :key="item.maId">
|
<view class="table-list-item" v-for="item in codeDeviceList" :key="item.maId">
|
||||||
<uni-row :gutter="24">
|
<uni-row :gutter="24">
|
||||||
|
|
@ -114,17 +116,16 @@
|
||||||
{{ finish ? '没有更多数据了~' : '正在加载...' }}
|
{{ finish ? '没有更多数据了~' : '正在加载...' }}
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
|
</scroll-view>
|
||||||
<view class="outbound-btn" @tap="onHandleOutbound"> 出库 </view>
|
<view class="outbound-btn" @tap="onHandleOutbound"> 出库 </view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<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 } from '@/services/picking/outbound.js'
|
import { getCodeDeviceListAPI, setOutboundNumAPI } from '@/services/picking/outbound.js'
|
||||||
import { getBoxBindByCode } from '@/services/standard.js'
|
import { getBoxBindByCode } from '@/services/standard.js'
|
||||||
import { onBackPress } from '@dcloudio/uni-app'
|
|
||||||
import { debounce } from 'lodash-es'
|
import { debounce } from 'lodash-es'
|
||||||
// const query = defineProps() // 获取上级页面传递的路由参数
|
// const query = defineProps() // 获取上级页面传递的路由参数
|
||||||
// const queryParams = JSON.parse(query.queryParams)
|
// const queryParams = JSON.parse(query.queryParams)
|
||||||
|
|
@ -250,8 +251,10 @@ const maxNum = ref(0)
|
||||||
const getCodeDeviceListData = async () => {
|
const getCodeDeviceListData = async () => {
|
||||||
console.log('queryCodeParams', queryCodeParams.value)
|
console.log('queryCodeParams', queryCodeParams.value)
|
||||||
const res = await getCodeDeviceListAPI(queryCodeParams.value)
|
const res = await getCodeDeviceListAPI(queryCodeParams.value)
|
||||||
|
console.log('xxxxxxxxxxxxxxx', )
|
||||||
|
console.log('333132133', res)
|
||||||
codeDeviceList.value.push(...res.rows)
|
codeDeviceList.value.push(...res.rows)
|
||||||
|
console.log('21313131',codeDeviceList.value)
|
||||||
if (codeDeviceList.value.length > 0) {
|
if (codeDeviceList.value.length > 0) {
|
||||||
codeDeviceList.value = codeDeviceList.value.map((e) => {
|
codeDeviceList.value = codeDeviceList.value.map((e) => {
|
||||||
return { ...e, checked: false }
|
return { ...e, checked: false }
|
||||||
|
|
@ -346,7 +349,7 @@ const onHandleOutbound = async () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
console.log()
|
||||||
const res = await setOutboundNumAPI({ leaseOutDetailsList: paramsList })
|
const res = await setOutboundNumAPI({ leaseOutDetailsList: paramsList })
|
||||||
|
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
|
|
@ -376,10 +379,17 @@ onLoad((options) => {
|
||||||
|
|
||||||
})
|
})
|
||||||
queryParams.value = JSON.parse(options.queryParams)
|
queryParams.value = JSON.parse(options.queryParams)
|
||||||
|
console.log('111111111111111111111',queryParams.value.id)
|
||||||
maxNum.value = queryParams.value.preNum - queryParams.value.alNum
|
maxNum.value = queryParams.value.preNum - queryParams.value.alNum
|
||||||
queryCodeParams.value.typeId = queryParams.value.typeId
|
queryCodeParams.value.typeId = queryParams.value.typeId
|
||||||
getCodeDeviceListData()
|
getCodeDeviceListData()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
onShow(() => {
|
||||||
|
// 重新计算 maxNum 的值
|
||||||
|
maxNum.value = queryParams.value.preNum - queryParams.value.alNum
|
||||||
|
})
|
||||||
|
|
||||||
// 页面销毁时移除事件监听
|
// 页面销毁时移除事件监听
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
uni.$off('onUpdate') // 移除事件监听
|
uni.$off('onUpdate') // 移除事件监听
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,7 @@ import { ref, computed } from 'vue'
|
||||||
import { getPickingOutboundListAPI } from '@/services/picking/outbound.js'
|
import { getPickingOutboundListAPI } from '@/services/picking/outbound.js'
|
||||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||||
import { debounce } from 'lodash-es'
|
import { debounce } from 'lodash-es'
|
||||||
|
import { onBackPress } from '@dcloudio/uni-app';
|
||||||
const total = ref(0) // 数据总量
|
const total = ref(0) // 数据总量
|
||||||
const active = ref(1) // tap索引
|
const active = ref(1) // tap索引
|
||||||
const tableList = ref([]) // 列表数据源
|
const tableList = ref([]) // 列表数据源
|
||||||
|
|
|
||||||
|
|
@ -39,3 +39,10 @@ export const getCodeDeviceListAPI = (data) => {
|
||||||
data,
|
data,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export const getCodeScanAPI = (data) => {
|
||||||
|
return http({
|
||||||
|
method: 'GET',
|
||||||
|
url: '/material/lease_apply_info/getInfoByQrcode',
|
||||||
|
data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue