样式修复
This commit is contained in:
@@ -7,15 +7,12 @@
|
||||
<u-input style="color: #333;" v-model="selectUnit.UnitName" :clearable="false" type="select"
|
||||
placeholder="请选择单位工程" @click="handleShowUnit" />
|
||||
</view>
|
||||
<view class="refresh-btn" @click="handleRefresh">
|
||||
<u-icon name="reload" :size="36" :class="{ rotating: loading }"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 列表内容 -->
|
||||
<scroll-view class="list-scroll" scroll-y @scrolltolower="loadMore" refresher-enabled
|
||||
:refresher-triggered="refreshing" @refresh="handleRefresh">
|
||||
<scroll-view class="list-scroll" scroll-y @scrolltolower="loadMore" refresher-enabled="true"
|
||||
:refresher-triggered="refreshing" @refresherrefresh="handleRefresh">
|
||||
<view class="list-wrap">
|
||||
<view v-for="(item, index) in list" :key="index" class="card-item deliver-card" @click="clickTap(item)">
|
||||
<view class="card-header">
|
||||
@@ -188,6 +185,7 @@ import { reqTrainNumberList } from '@/api/hj'
|
||||
|
||||
// ===== 刷新 =====
|
||||
const handleRefresh = () => {
|
||||
refreshing.value = true
|
||||
pageindex.value = 1
|
||||
isFinished.value = false
|
||||
list.value = []
|
||||
|
||||
+22
-14
@@ -1,20 +1,29 @@
|
||||
<template>
|
||||
<view class="page-list">
|
||||
<!-- 头部过滤区域 -->
|
||||
<view class="filter-header">
|
||||
<view class="filter-row" style="margin-bottom: 16rpx;">
|
||||
<!-- 单位工程下拉选择 -->
|
||||
<view class="project-select-btn">
|
||||
<u-input style="color: #333;" v-model="unitWorkName" :clearable="false" type="select"
|
||||
placeholder="请选择单位工程" @click="handleShowUnitWorkSelect" />
|
||||
</view>
|
||||
<!-- 刷新按钮 -->
|
||||
<view class="refresh-btn" @click="handleRefresh">
|
||||
<u-icon name="reload" :size="36" :class="{ rotating: loading }"></u-icon>
|
||||
</view>
|
||||
<view class="filter-section">
|
||||
<!-- 单位工程选择 -->
|
||||
<view class="filter-item">
|
||||
<text class="filter-label">单位工程</text>
|
||||
<u-input
|
||||
type="select"
|
||||
v-model="unitWorkName"
|
||||
readonly
|
||||
:clearable="false"
|
||||
@click="handleShowUnitWorkSelect"
|
||||
placeholder="请选择单位工程"
|
||||
></u-input>
|
||||
</view>
|
||||
|
||||
<!-- 搜索框 -->
|
||||
<view class="filter-item search-item">
|
||||
<u-search
|
||||
v-model="keyword"
|
||||
placeholder="搜索点口批号..."
|
||||
:show-action="false"
|
||||
shape="square"
|
||||
></u-search>
|
||||
</view>
|
||||
<!-- 关键字搜索 -->
|
||||
<u-search v-model="keyword" :show-action="false" shape="round" bg-color="#f5f6f8" />
|
||||
</view>
|
||||
|
||||
<!-- 列表内容 -->
|
||||
@@ -47,7 +56,6 @@
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
onMounted,
|
||||
computed
|
||||
} from 'vue'
|
||||
import {
|
||||
|
||||
@@ -4,10 +4,7 @@
|
||||
<view class="filter-header">
|
||||
<!-- 第一行:搜索框 + 刷新 -->
|
||||
<view class="search-row">
|
||||
<u-search v-model="keyword" placeholder="请输入包装编号" :show-action="false" shape="round" bg-color="#f5f6f8" @change="handleSearch" />
|
||||
<view class="refresh-btn" @click="handleRefresh">
|
||||
<u-icon name="reload" :size="32" :class="{ rotating: loading }"></u-icon>
|
||||
</view>
|
||||
<u-search v-model="keyword" placeholder="请输入包装编号" :show-action="false" shape="square" bg-color="#f5f6f8" @change="handleSearch" />
|
||||
</view>
|
||||
<!-- 第二行:车次关联 + 单位选择 -->
|
||||
<view class="filter-row has-radio">
|
||||
@@ -23,8 +20,8 @@
|
||||
</view>
|
||||
|
||||
<!-- 列表内容 -->
|
||||
<scroll-view class="list-scroll" scroll-y @scrolltolower="loadMore" refresher-enabled
|
||||
:refresher-triggered="refreshing" @refresh="handleRefresh">
|
||||
<scroll-view class="list-scroll" scroll-y @scrolltolower="loadMore" refresher-enabled="true"
|
||||
:refresher-triggered="refreshing" @refresherrefresh="handleRefresh">
|
||||
<view class="list-wrap">
|
||||
<view v-for="(item, index) in listData" :key="item.PackagingManageId || index" class="card-item"
|
||||
@click="handleItemClick(item)">
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!-- 卡片列表 -->
|
||||
<view class="grid-card">
|
||||
<view class="grid-list">
|
||||
<view class="grid-item" @click="handleClick('/pipe/pressure/condition')">
|
||||
<view class="grid-item" @click="handleClick('/pipe/pressure/pressure_before/list')">
|
||||
<view class="grid-icon">
|
||||
<u-icon name="info-circle" :size="60" :color="$u.type.primary"></u-icon>
|
||||
</view>
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
<template>
|
||||
<view class="page-list pressure-filter">
|
||||
<!-- 筛选区域 -->
|
||||
<view class="filter-section">
|
||||
<!-- 单位工程选择 -->
|
||||
<view class="filter-item">
|
||||
<text class="filter-label">单位工程</text>
|
||||
<u-input
|
||||
type="select"
|
||||
v-model="unitWorkName"
|
||||
readonly
|
||||
:clearable="false"
|
||||
@click="handleShowUnitPopup"
|
||||
placeholder="请选择单位工程"
|
||||
></u-input>
|
||||
</view>
|
||||
|
||||
<!-- 试压条件选择 -->
|
||||
<view class="filter-item">
|
||||
<text class="filter-label">试压条件</text>
|
||||
<u-radio-group v-model="addInfo.isFinish" @change="onFinishChange">
|
||||
<u-radio :name="true" label="具备" active-color="#3577FF" shape="square"></u-radio>
|
||||
<u-radio :name="false" label="不具备" active-color="#3577FF" shape="square"></u-radio>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
|
||||
<!-- 搜索框 -->
|
||||
<view class="filter-item search-item">
|
||||
<u-search
|
||||
v-model="addInfo.testPackageNo"
|
||||
placeholder="搜索试压包号..."
|
||||
@search="getTestPackageNo"
|
||||
:show-action="false"
|
||||
shape="square"
|
||||
></u-search>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 试压包列表 -->
|
||||
<scroll-view class="list-scroll" scroll-y>
|
||||
<view class="list-wrap">
|
||||
<view v-for="(item, index) in itemList" :key="index" class="card-item" @click="goDetail(item)">
|
||||
<view class="card-header">
|
||||
<text class="card-title">{{ item.BaseInfoCode }}</text>
|
||||
</view>
|
||||
<view class="card-body">
|
||||
<view class="card-row">
|
||||
<text class="row-label">单位工程</text>
|
||||
<text class="row-value">{{ addInfo.unit_name || '--' }}</text>
|
||||
</view>
|
||||
<view class="card-row">
|
||||
<text class="row-label">试压条件</text>
|
||||
<text class="row-value">{{ addInfo.isFinish_name || '--' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 空状态 -->
|
||||
<u-empty v-if="!loading && itemList.length === 0" mode="list" text="暂无数据"></u-empty>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 单位工程选择弹窗 -->
|
||||
<nbd-select v-model="showUnitPopup" :show-search="true" title="请选择单位工程" :list="unitList"
|
||||
label-key="BaseInfoName" v-model:model="selectedUnit" value-key="BaseInfoId" @confirm="handleUnitConfirm" />
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import { useUserStore } from '@/store'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { reqProjectWorkArea } from '@/api/base.js'
|
||||
import nbdSelect from '@/components/nbd-select'
|
||||
|
||||
const userStore = useUserStore()
|
||||
const { currentProject } = storeToRefs(userStore)
|
||||
|
||||
// 表单数据
|
||||
const addInfo = reactive({
|
||||
unit_name: '',
|
||||
unitWorkId: '',
|
||||
BaseInfoCode: '',
|
||||
isFinish: false,
|
||||
isFinish_name: '否',
|
||||
testPackageNo: ''
|
||||
})
|
||||
|
||||
// 弹窗状态
|
||||
const showUnitPopup = ref(false)
|
||||
|
||||
// 选中值
|
||||
const selectedUnit = ref(null)
|
||||
|
||||
// 单位工程名称(计算属性)
|
||||
const unitWorkName = computed(() => selectedUnit.value?.BaseInfoName || '')
|
||||
|
||||
// 列表数据
|
||||
const itemList = ref([])
|
||||
const unitList = ref([])
|
||||
const loading = ref(false)
|
||||
|
||||
// 点击单位工程下拉
|
||||
const handleShowUnitPopup = () => {
|
||||
reqProjectWorkArea(currentProject.value.ProjectId).then(res => {
|
||||
unitList.value = res.data || []
|
||||
showUnitPopup.value = true
|
||||
})
|
||||
}
|
||||
|
||||
// 选择单位工程
|
||||
const handleUnitConfirm = (item) => {
|
||||
selectedUnit.value = item
|
||||
addInfo.unit_name = item.BaseInfoName
|
||||
addInfo.unitWorkId = item.BaseInfoId
|
||||
addInfo.BaseInfoCode = item.BaseInfoCode
|
||||
getTestPackageNo()
|
||||
}
|
||||
|
||||
// 试压条件变更
|
||||
const onFinishChange = (value) => {
|
||||
addInfo.isFinish_name = value ? '是' : '否'
|
||||
getTestPackageNo()
|
||||
}
|
||||
|
||||
// 跳转详情页
|
||||
const goDetail = (item) => {
|
||||
const params = {
|
||||
value: item
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: `/pages/weldTwo/pressure/detail/main?params=${JSON.stringify(params)}`
|
||||
})
|
||||
}
|
||||
|
||||
// 获取单位工程列表
|
||||
const getUnitList = async () => {
|
||||
try {
|
||||
const projectId = uni.getStorageSync('projectId') || ''
|
||||
const res = await uni.$weld.getAllUnit(projectId)
|
||||
if (res.code === 1) {
|
||||
unitList.value = res.data
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取单位工程失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
// 获取试压包批号列表
|
||||
const getTestPackageNo = async () => {
|
||||
if (!addInfo.unitWorkId) return
|
||||
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await uni.$weld.getTestPackageNo(addInfo.unitWorkId, addInfo.isFinish, addInfo.testPackageNo)
|
||||
if (res.code === 1) {
|
||||
itemList.value = res.data
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取试压包批号失败:', error)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 页面显示时加载数据
|
||||
onShow(() => {
|
||||
getUnitList()
|
||||
})
|
||||
</script>
|
||||
Reference in New Issue
Block a user