Files
hazardousWaste_app/pages/components/SearchList.vue
2026-04-03 08:38:34 +08:00

186 lines
4.7 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- 查询列表 - 使用我的出库单/我的入库单 -->
<template>
<view class="content">
<view class="topSearch">
<uni-easyinput type="text" v-model="queryParams.keyword" prefixIcon="search" :inputBorder="false"
@iconClick="getList" placeholder="请输入搜索内容" />
</view>
<z-paging ref="pagingRef" class="containerBox" v-model="list" @query="getList">
<uni-list class="listBox">
<uni-list-item v-for="item in list" :key="item.id" clickable @click="onDetail(item)">
<template v-slot:body>
<view style="display: flex; flex-direction: column; width: 100%;">
<view class="line title">
<p> {{ typeName + '编号' }}:{{ item.billNo }}</p>
<span :style="getColor(item?.billType)">
{{ getBillType(item?.billType, item?.status) }}
</span>
</view>
<p class="line content">{{ typeName + '类型' }}
<span> {{ getOrderType(item.status) }}</span>
</p>
<p class="line content">库位
<span> {{ item.areaName }}</span>
</p>
<p class="line content">开单时间
<span>{{ item.createTime }}</span>
</p>
</view>
</template>
</uni-list-item>
</uni-list>
</z-paging>
</view>
</template>
<script setup>
import _, { includes } from 'lodash';
import { computed, toRefs, ref } from 'vue';
import { onShow } from "@dcloudio/uni-app";
import { stockList } from '../../api/stockIn';
import { getBillType, getColor } from '../until';
const props = defineProps({
// 查询列表类型 stockIn:入库 stockIn-putAway入库单入库 stockOut出库
type: {
type: String,
default: '',
required: true
},
// 查询条件
query: {
type: Object,
default: {},
required: true
},
})
const { type, query } = toRefs(props)
const pagingRef = ref(null)
// 数据:列表
const list = ref([])
const typeName = computed(() => includes(type.value, 'stockIn') ? '入库单' : '出库单')
const getOrderType = () => {
if (includes(type.value, 'stockIn')) {
return '入库单入库'
} else {
return '出库单出库'
}
}
// 数据:关键字
const queryParams = ref({
keyword: ''
})
onShow(() => {
pagingRef.value?.reload?.()
})
// 点击:查看详情
const onDetail = (val) => {
if (_.includes(type.value, 'stockIn')) {
// pages/stockIn/detail
uni.navigateTo({
url: `/pages/warehousing/stockIn/components/detail?billNo=${val.billNo}&type=${type.value}`,
});
}
}
// 数据:获取列表
const getList = (pageNo, pageSize) => {
queryParams.value.pageNum = pageNo
if (_.includes(type.value, 'stockIn')) {
stockList({ ...queryParams?.value, ...query?.value }).then(res => {
res.rows.forEach(e => {
e.showMore = false;
});
pagingRef.value.complete(res.rows)
}).catch(res => {
pagingRef.value.complete(false)
})
} else if (type.value == 'stockOut') {
}
}
</script>
<style scoped lang="scss">
.topSearch {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 999;
padding: 4rpx;
background-color: #fff;
border-bottom: 1px solid #eee;
box-sizing: border-box;
}
.containerBox {
padding-top: 44px;
width: 100%;
height: 100%;
box-sizing: border-box;
.zp-l-text-rpx {
font-size: 12px;
}
}
::v-deep .listBox {
width: 100%;
height: 100%;
box-sizing: border-box;
background-color: #F8F8FF;
.zp-l-text-rpx {
font-size: 12px;
}
.uni-list {
background-color: #F8F8FF;
}
.uni-list-item {
margin-bottom: 4rpx;
}
.uni-list-item__container {
padding: 0;
}
.line {
display: flex;
// justify-content: space-between;
align-items: center;
// border-bottom: 1px solid #eee;
padding: 12rpx 20rpx;
}
.title {
display: flex;
justify-content: space-between;
font-weight: 600;
font-size: 13px;
}
.content {
font-weight: 500;
font-size: 13px;
}
.empty {
color: #D3D3D3;
}
span {
color: #696969;
}
}
</style>