<template>
|
<view class="example">
|
<u-tabs :list="list" :is-Scroll="false" :current="current"></u-tabs>
|
<view v-show="current===0">
|
<uni-section title="缓存架状态查看" type="line" padding style="height: calc(100vh - 100px);">
|
<uni-forms ref="formup" :modelValue="baseFormData" :rules="formRules">
|
<uni-forms-item label="缓存架条码:" label-width="120" required name="HCJInput">
|
<uni-easyinput v-model="baseFormData.HCJInput" focus placeholder="请扫描缓存架条码"></uni-easyinput>
|
</uni-forms-item>
|
|
</uni-forms>
|
<uni-list>
|
<!-- to 属性携带参数跳转详情页面,当前只为参考 -->
|
<uni-list-item direction="column" >
|
<!-- 通过header插槽定义列表的标题 -->
|
<template v-slot:header>
|
<view class="uni-title">名称:{{listData.name}}
|
<!-- <uni-icons type="trash" size="22" style="position: absolute;right: 5%;"
|
@click="deleteList(item.container_barcode)">
|
</uni-icons> -->
|
</view>
|
</template>
|
<!-- 通过body插槽定义列表内容显示 -->
|
<template v-slot:body>
|
<view class="uni-list-box">
|
<view class="uni-content">
|
<view class="uni-title-sub uni-ellipsis-2">缓存架状态:{{listData.location_state}}</view>
|
<view class="uni-title-sub uni-ellipsis-2">缓存架编码:{{listData.upper_code}}</view>
|
<view class="uni-title-sub uni-ellipsis-2">启用/禁用:{{listData.status}}</view>
|
<!-- <view class="uni-note">
|
NG:{{item.extJson.NG+ ' 屏蔽:'+item.extJson.PB}}
|
</view> -->
|
<!-- <view class="uni-title-sub uni-ellipsis-2">
|
NG:{{item.extJson.NG==0?"否":"是"}} 屏蔽:{{item.extJson.PB==0?"否":"是"}}
|
</view> -->
|
</view>
|
</view>
|
</template>
|
</uni-list-item>
|
</uni-list>
|
<u-button type="success" size="default" shape="circle" :ripple="true" ripple-bg-color="#909399"
|
@click="submit">
|
状态查询
|
</u-button>
|
</uni-section>
|
</view>
|
</view>
|
</template>
|
<script>
|
export default {
|
data() {
|
return {
|
baseFormData: {
|
HCJInput: '',
|
classes: ''
|
},
|
formRules: {
|
HCJInput: {
|
rules: [{
|
required: true,
|
errorMessage: '缓存架不能为空'
|
}]
|
}
|
},
|
listData: [],
|
list: [{
|
name: '状态查看'
|
}],
|
current: 0
|
}
|
},
|
onLoad() {
|
|
},
|
methods: {
|
// onClickItem(e) {
|
// if (this.current != e.currentIndex) {
|
// this.current = e.currentIndex;
|
// }
|
// },
|
submit() {
|
this.$refs.formup.validate().then((res) => {
|
this.$t.message.loading()
|
let formDataParam = {};
|
if (this.baseFormData.HCJInput.includes("SL")) {
|
formDataParam = {
|
UpperCode: this.baseFormData.HCJInput,
|
current: 1,
|
size: 10
|
}
|
} else {
|
formDataParam = {
|
DownCode: this.baseFormData.HCJInput,
|
current: 1,
|
size: 10
|
}
|
}
|
this.$u.get('/api/PDA/LoctionPage', formDataParam).then(res => {
|
console.log(res)
|
this.$t.message.closeLoading()
|
if (res.status) {
|
this.$t.message.toast(res.message)
|
// res.data.records[0].extJson = JSON.parse(res.data.records[0].extJson)
|
res.data.status = res.data.status ==
|
"0" ? "启用" : "禁用"
|
res.data.location_state = res.data.location_state ==
|
"LocationState_Empty" ? "空缓存架" : "有货缓存架"
|
this.listData = res.data
|
console.log(this.listData);
|
setTimeout(() => {
|
this.baseFormData.HCJInput = ''
|
}, 100);
|
} else
|
this.$t.message.toast(res.message)
|
|
}).catch((err) => {
|
this.$t.message.toast(res.message)
|
})
|
})
|
}
|
|
},
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
@import '@/common/uni-ui.scss';
|
|
.example {
|
padding: 15px;
|
background-color: #fff;
|
}
|
|
page {
|
display: flex;
|
flex-direction: column;
|
box-sizing: border-box;
|
background-color: #efeff4;
|
min-height: 100%;
|
height: auto;
|
}
|
|
.tips {
|
color: #67c23a;
|
font-size: 14px;
|
line-height: 40px;
|
text-align: center;
|
background-color: #f0f9eb;
|
height: 0;
|
opacity: 0;
|
transform: translateY(-100%);
|
transition: all 0.3s;
|
}
|
|
.tips-ani {
|
transform: translateY(0);
|
height: 40px;
|
opacity: 1;
|
}
|
|
.content {
|
width: 100%;
|
display: flex;
|
}
|
|
.list-picture {
|
width: 100%;
|
height: 145px;
|
}
|
|
.thumb-image {
|
width: 100%;
|
height: 100%;
|
}
|
|
.ellipsis {
|
display: flex;
|
overflow: hidden;
|
}
|
|
.uni-ellipsis-1 {
|
overflow: hidden;
|
white-space: nowrap;
|
text-overflow: ellipsis;
|
}
|
|
.uni-ellipsis-2 {
|
overflow: hidden;
|
text-overflow: ellipsis;
|
display: -webkit-box;
|
-webkit-line-clamp: 2;
|
-webkit-box-orient: vertical;
|
}
|
</style>
|