配件库存查询, 厂家下拉
This commit is contained in:
parent
d75d79f031
commit
4245a5b71a
|
|
@ -204,7 +204,7 @@ const handleSearch = async () => {
|
|||
|
||||
const fetchSuppliers = async () => {
|
||||
try {
|
||||
const res = await getSupplierList()
|
||||
const res = await getSupplierList({ pageNum: 1, pageSize: 99999 })
|
||||
if (res.code === 200) {
|
||||
suppliers.value = res.rows.map(item => ({
|
||||
id: item.supplierId,
|
||||
|
|
|
|||
|
|
@ -569,7 +569,7 @@ const formLeft = ref({
|
|||
//返厂维修
|
||||
const partsMillList = ref([])
|
||||
const getSupplierListData = async () => {
|
||||
const res = await getSupplierList({})
|
||||
const res = await getSupplierList({ pageNum: 1, pageSize: 99999 })
|
||||
partsMillList.value = res.rows.map((item) => {
|
||||
let obj = {
|
||||
value: item.supplierId,
|
||||
|
|
|
|||
|
|
@ -490,7 +490,7 @@ const partTreeChange = (val,index) =>{
|
|||
//获取厂商
|
||||
const partsMillList = ref([])
|
||||
const getSupplierListData = async () => {
|
||||
const res = await getSupplierList({})
|
||||
const res = await getSupplierList({ pageNum: 1, pageSize: 99999 })
|
||||
partsMillList.value = res.rows.map((item) => {
|
||||
let obj = {
|
||||
value: item.supplierId,
|
||||
|
|
|
|||
|
|
@ -264,6 +264,11 @@ const deviceList = ref([
|
|||
url: '/pages/stquery/deviceStatusRecord/index',
|
||||
iconSrc: '../../static/searchModel/partRecord.png',
|
||||
},
|
||||
{
|
||||
title: '配件库存查询',
|
||||
url: '/pages/stquery/deviceStatusRecord/partsStore',
|
||||
iconSrc: '../../static/searchModel/partRecord.png',
|
||||
},
|
||||
])
|
||||
|
||||
// 使用计算属性筛选 newInfoList 中的数据
|
||||
|
|
|
|||
|
|
@ -0,0 +1,211 @@
|
|||
<template>
|
||||
<!-- 退料任务 -->
|
||||
<view class="accept page-common">
|
||||
<uni-row :gutter="24" class="search-form">
|
||||
<uni-col :span="18">
|
||||
<view>
|
||||
<uni-easyinput v-model="queryParams.keyWord" placeholder="请输入内容" />
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="6">
|
||||
<view class="search" @click="getTableList">查询</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<view style="width: 100%">
|
||||
<uni-table border stripe emptyText="">
|
||||
<uni-tr>
|
||||
<uni-th style="font-size: 20rpx" width="40px" align="center">序号</uni-th>
|
||||
<uni-th style="font-size: 20rpx" width="70px" align="center">配件名称</uni-th>
|
||||
<uni-th style="font-size: 20rpx" width="70px" align="center">规格型号</uni-th>
|
||||
<uni-th style="font-size: 20rpx" width="70px" align="center">单位</uni-th>
|
||||
<uni-th style="font-size: 20rpx" width="45px" align="center">库存</uni-th>
|
||||
</uni-tr>
|
||||
<uni-tr></uni-tr>
|
||||
</uni-table>
|
||||
</view>
|
||||
<scroll-view scroll-y class="scroll-container" @scrolltolower="onScrollTolower">
|
||||
<uni-table border stripe emptyText="暂无更多数据" sticky>
|
||||
<!-- 表格数据行 -->
|
||||
<uni-tr v-for="(item, index) in tableList" :key="index">
|
||||
<uni-td style="width: 40px; font-size: 20rpx; text-align: center">{{
|
||||
index + 1
|
||||
}}</uni-td>
|
||||
<uni-td style="width: 70px; font-size: 20rpx; text-align: center">{{
|
||||
item.typeName
|
||||
}}</uni-td>
|
||||
<uni-td style="width: 70px; font-size: 20rpx; text-align: center">{{
|
||||
item.typeModelName
|
||||
}}</uni-td>
|
||||
<uni-td style="width: 70px; font-size: 20rpx; text-align: center">{{
|
||||
item.unit
|
||||
}}</uni-td>
|
||||
<uni-td style="width: 45px; font-size: 20rpx; text-align: center">{{
|
||||
item.storeNum
|
||||
}}</uni-td>
|
||||
</uni-tr>
|
||||
</uni-table>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import { getPartPersonNumApi } from '@/services/stquery/stquery.js'
|
||||
import { debounce } from 'lodash-es'
|
||||
|
||||
const tableList = ref([]) //列表数据源
|
||||
const total = ref(0)
|
||||
// 查询参数
|
||||
const queryParams = ref({
|
||||
keyWord: '', //关键字
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
})
|
||||
// 滚动触底事件
|
||||
const onScrollTolower = debounce(() => {
|
||||
console.log('触底事件')
|
||||
if (total.value > tableList.value.length) {
|
||||
queryParams.value.pageSize += 10
|
||||
getTableList()
|
||||
}
|
||||
}, 500)
|
||||
// 获取列表数据
|
||||
const getTableList = async (isTap = false) => {
|
||||
try {
|
||||
uni.showLoading({ title: '加载中', mask: true })
|
||||
const res = await getPartPersonNumApi(queryParams.value)
|
||||
const newRows = res?.data?.rows || []
|
||||
total.value = res?.data?.total || 0
|
||||
|
||||
if (isTap || queryParams.pageNum === 1) {
|
||||
// 刷新或tab切换,直接替换
|
||||
tableList.value = newRows
|
||||
} else {
|
||||
// 加载更多,按 typeId 去重后合并
|
||||
const existingIds = new Set(tableList.value.map((item) => item.typeId))
|
||||
const filteredRows = newRows.filter((item) => !existingIds.has(item.typeId))
|
||||
tableList.value.push(...filteredRows)
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ getTableList ~ error:', error)
|
||||
} finally {
|
||||
uni.hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
onLoad(() => {
|
||||
tableList.value = []
|
||||
total.value = 0
|
||||
getTableList(true)
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.accept {
|
||||
height: 95vh;
|
||||
word-break: break-all;
|
||||
background-color: #f7f8fa;
|
||||
padding: 24rpx;
|
||||
// 搜索表单
|
||||
.search-form {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
padding: 10rpx;
|
||||
border-radius: 20rpx;
|
||||
margin-bottom: 24rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
|
||||
|
||||
.select-box {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
}
|
||||
.select-box-content {
|
||||
height: 75rpx;
|
||||
width: auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
.select-box-item {
|
||||
width: auto;
|
||||
padding: 5rpx;
|
||||
margin-right: 10rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
font-size: 24rpx;
|
||||
word-break: keep-all;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
// 搜索按钮
|
||||
.search {
|
||||
height: 60rpx;
|
||||
background: linear-gradient(135deg, #4b8eff 0%, #3784fb 100%);
|
||||
text-align: center;
|
||||
line-height: 60rpx;
|
||||
color: #fff;
|
||||
border-radius: 12rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
box-shadow: 0 6rpx 20rpx rgba(55, 132, 251, 0.2);
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:active {
|
||||
transform: scale(0.98);
|
||||
opacity: 0.9;
|
||||
}
|
||||
}
|
||||
|
||||
// 新增按钮
|
||||
.addBtn {
|
||||
height: 80rpx;
|
||||
background: linear-gradient(135deg, #19be6b 0%, #16a75c 100%);
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
color: #fff;
|
||||
border-radius: 12rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
box-shadow: 0 6rpx 20rpx rgba(25, 190, 107, 0.2);
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:active {
|
||||
transform: scale(0.98);
|
||||
opacity: 0.9;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 列表容器
|
||||
.scroll-container {
|
||||
width: 100%;
|
||||
height: 65vh;
|
||||
margin: 0rpx auto;
|
||||
}
|
||||
|
||||
/* 针对Web平台 */
|
||||
.scroll-view {
|
||||
overflow: auto; /* 允许滚动 */
|
||||
-ms-overflow-style: none; /* IE和Edge */
|
||||
scrollbar-width: none; /* Firefox */
|
||||
}
|
||||
|
||||
/* 针对其他非Web平台,比如小程序,可以通过条件编译来设置 */
|
||||
/* #ifdef MP-WEIXIN */
|
||||
.scroll-view {
|
||||
scroll-view {
|
||||
scroll-x: true;
|
||||
scroll-y: auto;
|
||||
::-webkit-scrollbar {
|
||||
display: none; /* 针对Webkit浏览器,隐藏滚动条 */
|
||||
width: 0;
|
||||
height: 0;
|
||||
color: transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* #endif */
|
||||
</style>
|
||||
|
|
@ -27,12 +27,14 @@ export const getSelectionList = (data) => {
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 配件库存
|
||||
export const getPartPersonNumApi = (data) => {
|
||||
return http({
|
||||
method: 'GET',
|
||||
url: '/material/complex_query/getPartPersonNum',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue