gaojs
5 months ago
3 changed files with 211 additions and 0 deletions
@ -0,0 +1,13 @@ |
|||
import http from '../http' |
|||
// 获取库位
|
|||
export function getLocation(number) { |
|||
return http.get('/eam/location/scanCodeByNumber?number='+number) |
|||
} |
|||
// 出库获取库位
|
|||
export function getOutLocation(data) { |
|||
return http.post('/eam/location/outScanCodeByNumber',data) |
|||
} |
|||
// 首页扫码获取详情
|
|||
export function pdaItemAndLocation(number) { |
|||
return http.get('/eam/location/pdaItemAndLocation?number='+number) |
|||
} |
@ -0,0 +1,191 @@ |
|||
<template> |
|||
<view class="add-form-container"> |
|||
<view class="screen-input"> |
|||
<u-search v-model='number' :show-action='false' :bg-color="'white'" :border-color="'#E4E4E4'" |
|||
:shape="'square'" :height="80" :placeholder="'请扫描设备或者库位'" :clearabled="true" @blur="blur()" |
|||
@confirm="handelScanMsg"> |
|||
</u-search> |
|||
</view> |
|||
<view class="title"> |
|||
<view class=""> |
|||
详细信息 |
|||
</view> |
|||
</view> |
|||
<view class="list"> |
|||
<view class="item " v-for="(item,index) in list" :key="index"> |
|||
<view class="item-box"> |
|||
<view class="spare-title"> |
|||
<view class="title-txt"> |
|||
库位名称:{{item.name}} |
|||
</view> |
|||
</view> |
|||
<view class="dec"> |
|||
<view>库位编码:</view> |
|||
<view>{{item.code}}</view> |
|||
</view> |
|||
<view class="dec"> |
|||
<view>库位名称:</view> |
|||
<view>{{item.name}}</view> |
|||
</view> |
|||
<view class="dec"> |
|||
<view>库区编码:</view> |
|||
<view>{{item.areaCode}}</view> |
|||
</view> |
|||
<view class="dec"> |
|||
<view>库区名称:</view> |
|||
<view>{{item.areaName}}</view> |
|||
</view> |
|||
<view class="dec"> |
|||
<view>备件编码:</view> |
|||
<view>{{item.spareCode}}</view> |
|||
</view> |
|||
<view class="dec"> |
|||
<view>备件名称:</view> |
|||
<view>{{item.spareName}}</view> |
|||
</view> |
|||
<view class="dec"> |
|||
<view>库存:</view> |
|||
<view>{{item.spareQty}}</view> |
|||
</view> |
|||
<view class="dec"> |
|||
<view>备件单价:</view> |
|||
<view>{{item.singlePrice}}</view> |
|||
</view> |
|||
|
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
|
|||
</view> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { |
|||
onLoad |
|||
} from '@dcloudio/uni-app' |
|||
import { |
|||
ref, |
|||
getCurrentInstance |
|||
} from 'vue' |
|||
|
|||
import * as locationApi from "@/api/eam/location" |
|||
|
|||
const { proxy } = getCurrentInstance() |
|||
const number = ref('LN0000000001') |
|||
const list = ref([]) |
|||
|
|||
|
|||
function getPdaItemAndLocation() { |
|||
locationApi.pdaItemAndLocation(number.value).then((res) => { |
|||
console.log(res) |
|||
if(!res.data||res.data.length==0){ |
|||
list.value = [] |
|||
if(res.msg){ |
|||
proxy.$modal.showToast(res.msg) |
|||
} |
|||
return; |
|||
} |
|||
list.value = res.data |
|||
}).catch((err)=>{ |
|||
list.value = [] |
|||
proxy.$modal.showToast(err.msg) |
|||
}) |
|||
} |
|||
function blur() { |
|||
if (number.value) { |
|||
getPdaItemAndLocation() |
|||
} |
|||
} |
|||
// 扫描设备条码 |
|||
function handelScanMsg() { |
|||
getPdaItemAndLocation() |
|||
} |
|||
onLoad(async (option) => { |
|||
getPdaItemAndLocation() |
|||
|
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.add-form-container { |
|||
min-height: 100vh; |
|||
background: white; |
|||
} |
|||
|
|||
.u-form-item { |
|||
padding: 20rpx 30rpx; |
|||
} |
|||
|
|||
.screen-input { |
|||
margin: 30rpx; |
|||
} |
|||
|
|||
.title { |
|||
display: flex; |
|||
align-items: center; |
|||
padding: 0px 30rpx; |
|||
// background: #f5f5f5; |
|||
margin-top: 10px; |
|||
font-weight: bold; |
|||
font-size: 32rpx; |
|||
|
|||
view { |
|||
&:nth-child(1) { |
|||
flex: 1; |
|||
border-left: 10rpx solid #409eff; |
|||
padding-left: 20rpx; |
|||
font-weight: bold; |
|||
color: #409eff; |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
.list { |
|||
padding: 30rpx; |
|||
|
|||
.item { |
|||
display: flex; |
|||
margin-bottom: 20rpx; |
|||
|
|||
.item-box { |
|||
background: #F5F5F5; |
|||
border-radius: 12rpx; |
|||
flex: 1; |
|||
width: 0rpx; |
|||
} |
|||
|
|||
.spare-title { |
|||
padding: 20rpx 30rpx; |
|||
border-bottom: 1px solid #e4e4e4; |
|||
|
|||
.title-txt { |
|||
color: #409eff; |
|||
font-size: 30rpx; |
|||
font-weight: bold; |
|||
} |
|||
} |
|||
|
|||
.dec { |
|||
color: #9c9c9c; |
|||
padding: 20rpx 30rpx 20rpx; |
|||
display: flex; |
|||
|
|||
view { |
|||
&:nth-child(1) { |
|||
width: 150rpx; |
|||
} |
|||
|
|||
&:nth-child(2) { |
|||
flex: 1; |
|||
word-wrap: break-word; |
|||
width: 0px; |
|||
} |
|||
|
|||
} |
|||
} |
|||
|
|||
} |
|||
} |
|||
</style> |
Loading…
Reference in new issue