| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279 |
- <template>
- <!-- 调拨 -->
- <view class="main-wrap">
- <uni-search-bar class="uni-search-bar" @confirm="search" v-model="searchValue" @input="inputChange" cancelButton="none" placeholder="调拨单号"></uni-search-bar>
- <view class="scroll_box">
- <scroll-view scroll-y="true" class="scroll-Y" @scrolltolower="lower">
- <view class="order-list">
- <view class="item" v-for="(item, index) in listData" :key="index">
- <view class="title">
- <view class="s1">
- {{ item.code }}
- </view>
- <view class="s2">
- {{ item.name }}
- </view>
- </view>
- <view class="main">
- <view class="row">
- <view class="row-item">
- <text class="t1">物品名称</text>
- <text class="t2">{{ item.categoryName }}</text>
- </view>
- <view class="row-item">
- <text class="t1">批次号</text>
- <text class="t2">{{ item.batchNo }}</text>
- </view>
- </view>
- <view class="row">
- <view class="row-item w100">
- <text class="t1">包装编码</text>
- <text class="t2">{{ item.packageNo }}</text>
- </view>
- </view>
- <view class="row">
- <view class="row-item">
- <text class="t1">包装数量</text>
- <text class="t2">{{ item.packingQuantity }}</text>
- </view>
- <view class="row-item">
- <text class="t1">包装单位</text>
- <text class="t2">{{ item.packingUnit }}</text>
- </view>
- </view>
- <view class="row">
- <view class="row-item">
- <text class="t1">计量数量</text>
- <text class="t2">{{ item.measureQuantity }}</text>
- </view>
- <view class="row-item">
- <text class="t1">计量单位</text>
- <text class="t2">{{ item.measureUnit }}</text>
- </view>
- </view>
- <view class="row">
- <view class="row-item">
- <text class="t1">重量</text>
- <text class="t2">{{ item.weight }}</text>
- </view>
- <view class="row-item">
- <text class="t1">重量单位</text>
- <text class="t2">{{ item.weightUnit }}</text>
- </view>
- </view>
- <view class="row">
- <view class="row-item w100">
- <text class="t1">调出区域</text>
- <text class="t2">{{ warehouseLabel(item) }}</text>
- </view>
- </view>
- <view class="row">
- <view class="row-item w100">
- <text class="t1">调入区域</text>
- <text class="t2">{{ targetWarehouseLabel(item) }}</text>
- </view>
- </view>
- <view class="row">
- <view class="row-item w100">
- <text class="t1">创建时间</text>
- <text class="t2">{{ item.createTime }}</text>
- </view>
- </view>
- <!-- <view class="ckmx" @click="goDetails(item)"> 查看明细 </view> -->
- </view>
- </view>
- </view>
- <u-loadmore :status="status" fontSize="32" iconSize="36" style="margin: 20rpx 0" />
- </scroll-view>
- </view>
- </view>
- </template>
- <script>
- import { getAllotDetails } from '@/api/warehouseManagement'
- export default {
- props: ['categoryCode', 'categoryId', 'dimension'],
- data() {
- return {
- page: 1,
- size: 10,
- isEnd: true,
- listData: [],
- status: 'loading',
- searchValue: '',
- timerId: null
- }
- },
- created() {
- this.getData()
- },
- methods: {
- inputChange() {
- // 清除timer对应的延时器
- clearTimeout(this.timerId)
- // 重新启动一个延时器,并把timerId赋值给this.timer
- this.timerId = setTimeout(() => {
- // 如果500毫秒内,没有触发新的输入事件,则为搜索关键词赋值
- this.search()
- }, 500)
- },
- warehouseLabel(row) {
- if (row.warehouseName && row.areaName && row.goodsShelfName && row.goodsAllocationName) {
- return row.warehouseName + '/' + row.areaName + '/' + row.goodsShelfName + '/' + row.goodsAllocationName
- } else if (row.warehouseName && row.areaName && row.goodsShelfName) {
- return row.warehouseName + '/' + row.areaName + '/' + row.goodsShelfName
- } else if (row.warehouseName && row.areaName) {
- return row.warehouseName + '/' + row.areaName
- } else {
- return row.warehouseName
- }
- },
- targetWarehouseLabel(row) {
- if (row.targetWarehouseName && row.targetAreaName && row.targetGoodsShelfName && row.targetGoodsAllocationName) {
- return row.targetWarehouseName + '/' + row.targetAreaName + '/' + row.targetGoodsShelfName + '/' + row.targetGoodsAllocationName
- } else if (row.targetWarehouseName && row.targetAreaName && row.targetGoodsShelfName) {
- return row.targetWarehouseName + '/' + row.targetAreaName + '/' + row.targetGoodsShelfName
- } else if (row.targetWarehouseName && row.targetAreaName) {
- return row.targetWarehouseName + '/' + row.targetAreaName
- } else {
- return row.targetWarehouseName
- }
- },
- // 触底
- lower() {
- console.log('触底')
- if (this.isEnd) {
- return
- }
- this.getMoreLists()
- },
- getData() {
- uni.showLoading({
- title: '加载中'
- })
- let par = {
- pageNum: this.page,
- size: this.size,
- keyWord: this.searchValue,
- categoryId: this.categoryId
- }
- getAllotDetails(par)
- .then(res => {
- this.listData = this.listData.concat(res.list)
- let length = res.count
- if (this.listData.length < length) {
- this.isEnd = false
- } else {
- this.isEnd = true
- this.status = 'nomore'
- }
- })
- .finally(() => {
- uni.hideLoading()
- })
- },
- getMoreLists() {
- this.page++
- this.getData()
- },
- search() {
- this.page = 1
- this.listData = []
- this.status = 'loading'
- this.getData()
- },
- goDetails(item) {
- let par = {
- bizNum: item.dialNumber,
- batchNum: this.batchNum,
- type: '调拨'
- }
- par = this.URLSearchParams(par)
- uni.navigateTo({
- url: '/pages/warehouse/inventory/order/order?' + par
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .main-wrap {
- height: 100%;
- display: flex;
- flex-direction: column;
- overflow: hidden;
- }
- .scroll_box {
- flex: 1;
- overflow: hidden;
- }
- .scroll-Y {
- //height: calc(100% - 112rpx);
- height: 100%;
- background-color: #fafafa;
- }
- .order-list {
- .item {
- background-color: #fff;
- margin-bottom: 30rpx;
- margin-bottom: 30rpx;
- .title {
- display: flex;
- padding: 20rpx;
- justify-content: space-between;
- align-items: center;
- border-bottom: 1px solid #dedede;
- .s1 {
- color: #333333;
- font-size: 28rpx;
- font-weight: bold;
- }
- .s2 {
- font-size: 28rpx;
- font-weight: bold;
- color: #333333;
- }
- }
- .main {
- padding: 0 30rpx;
- .row {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 20rpx 0;
- border-bottom: 1px dashed #dedede;
- .row-item {
- .t1 {
- font-weight: bold;
- font-size: 28rpx;
- color: #333333;
- margin-right: 20rpx;
- }
- .t2 {
- font-size: 28rpx;
- color: #333333;
- }
- }
- }
- .ckmx {
- color: #70b603;
- font-size: 28rpx;
- font-weight: bold;
- padding: 20rpx;
- display: flex;
- justify-content: flex-end;
- }
- }
- }
- }
- </style>
|