查询
This commit is contained in:
@@ -17,7 +17,7 @@ export const reqGetWeldJointByWeldJointId = (id) => get(`PipeJoint/getWeldJointB
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 搜索筛选焊口(下料/组对等中间页)
|
* 搜索筛选焊口(下料/组对等中间页)
|
||||||
* @param {Object} params - { projectId, keyword?, pageIndex?, pageSize? }
|
* @param {Object} params - { projectId, pipelineCode?, weldJointCode?, pageIndex?, pageSize? }
|
||||||
*/
|
*/
|
||||||
export const reqPipeJointWeldedJoints = (params = {}) => request('PipeJoint/GetWeldedJoints', {
|
export const reqPipeJointWeldedJoints = (params = {}) => request('PipeJoint/GetWeldedJoints', {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
@@ -246,13 +246,6 @@ export const reqAuditWeldingDaily = (data = {}) => post(`/PreWeldingDaily/AuditP
|
|||||||
*/
|
*/
|
||||||
export const reqDeleteWeldingDaily = (data = {}) => post(`/PreWeldingDaily/DeletePendingWeldingDailyTempDetails`, data)
|
export const reqDeleteWeldingDaily = (data = {}) => post(`/PreWeldingDaily/DeletePendingWeldingDailyTempDetails`, data)
|
||||||
|
|
||||||
// ========================= 焊缝外观检测 ====================================
|
|
||||||
/**
|
|
||||||
* 分页查询当前项目中已焊接的焊口
|
|
||||||
* @param {Object} params - { projectId, pipelineCode?, weldJointCode?, pageIndex?, pageSize? }
|
|
||||||
*/
|
|
||||||
export const reqWeldedJoints = (params = {}) => get('/WeldAppearanceCheck/GetWeldedJoints', params)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询焊口基础信息及历史外观检测记录
|
* 查询焊口基础信息及历史外观检测记录
|
||||||
* @param {String} weldJointId 焊口ID
|
* @param {String} weldJointId 焊口ID
|
||||||
|
|||||||
+2
-2
@@ -90,7 +90,7 @@ import { ref, onMounted } from 'vue'
|
|||||||
import { onShow, onReachBottom } from '@dcloudio/uni-app'
|
import { onShow, onReachBottom } from '@dcloudio/uni-app'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useUserStore } from '@/store'
|
import { useUserStore } from '@/store'
|
||||||
|
import { reqToDoItemByProjectIdUserId } from '@/api/base'
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const { userInfo, currentProject } = storeToRefs(userStore)
|
const { userInfo, currentProject } = storeToRefs(userStore)
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ async function onRefresh() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===== 模拟数据(开发调试用,上线前改为 false) =====
|
// ===== 模拟数据(开发调试用,上线前改为 false) =====
|
||||||
const USE_MOCK = true
|
const USE_MOCK = false
|
||||||
|
|
||||||
const mockData = [
|
const mockData = [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,33 +1,52 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="search-page">
|
<view class="search-page">
|
||||||
<!-- 顶部:输入框内扫码(类似淘宝搜索) -->
|
<!-- 顶部固定筛选:扫码 + 管线号/焊口号 + 重置/查询 -->
|
||||||
<view class="search-bar">
|
<view class="filter-panel">
|
||||||
<view class="search-bar__input-wrap">
|
<view class="filter-panel__row">
|
||||||
|
<view
|
||||||
|
class="filter-panel__scan"
|
||||||
|
@click="handleScan"
|
||||||
|
>
|
||||||
<u-icon
|
<u-icon
|
||||||
name="scan"
|
name="scan"
|
||||||
:size="28"
|
:size="36"
|
||||||
color="#2979ff"
|
color="#2979ff"
|
||||||
@click="handleScan"
|
|
||||||
/>
|
/>
|
||||||
|
</view>
|
||||||
|
<view class="filter-panel__fields">
|
||||||
|
<view class="filter-panel__item filter-panel__item--pipe">
|
||||||
<input
|
<input
|
||||||
class="search-bar__input"
|
class="filter-panel__input"
|
||||||
v-model="keyword"
|
v-model="pipelineCode"
|
||||||
type="text"
|
type="text"
|
||||||
|
placeholder="管线号"
|
||||||
confirm-type="search"
|
confirm-type="search"
|
||||||
:placeholder="placeholder"
|
@confirm="handleSearch"
|
||||||
:focus="autoFocus"
|
|
||||||
@input="handleSearchInput"
|
|
||||||
@confirm="handleSearchConfirm"
|
|
||||||
/>
|
/>
|
||||||
<u-icon
|
</view>
|
||||||
v-if="keyword"
|
<view class="filter-panel__item filter-panel__item--joint">
|
||||||
name="close-circle-fill"
|
<input
|
||||||
:size="28"
|
class="filter-panel__input"
|
||||||
color="#ccc"
|
v-model="weldJointCode"
|
||||||
@click="handleClear"
|
type="text"
|
||||||
|
placeholder="焊口号"
|
||||||
|
confirm-type="search"
|
||||||
|
@confirm="handleSearch"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="filter-panel__actions">
|
||||||
|
<view
|
||||||
|
class="filter-panel__btn filter-panel__btn--reset"
|
||||||
|
@click="handleReset"
|
||||||
|
>重置</view>
|
||||||
|
<view
|
||||||
|
class="filter-panel__btn filter-panel__btn--search"
|
||||||
|
@click="handleSearch"
|
||||||
|
>查询</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 结果列表 -->
|
<!-- 结果列表 -->
|
||||||
<scroll-view
|
<scroll-view
|
||||||
@@ -66,7 +85,7 @@
|
|||||||
v-if="!searched && !loading"
|
v-if="!searched && !loading"
|
||||||
class="result-hint"
|
class="result-hint"
|
||||||
>
|
>
|
||||||
<text>扫码或输入焊口/管线编号搜索</text>
|
<text>扫码,或输入管线号 / 焊口号后点击查询</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view
|
<view
|
||||||
@@ -93,7 +112,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
/**
|
/**
|
||||||
* 焊口搜索中间页:扫码进入业务页,或关键字搜索后点选进入
|
* 焊口搜索中间页:扫码进入业务页,或按管线号/焊口号搜索后点选进入
|
||||||
* 入参:target(业务页路径)、title(导航标题)
|
* 入参:target(业务页路径)、title(导航标题)
|
||||||
*/
|
*/
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
@@ -109,17 +128,20 @@ const { currentProject } = storeToRefs(userStore)
|
|||||||
|
|
||||||
/** 业务目标页,如 /scanpages/hj/material_sampling */
|
/** 业务目标页,如 /scanpages/hj/material_sampling */
|
||||||
const targetPath = ref('')
|
const targetPath = ref('')
|
||||||
const placeholder = ref('搜索焊口')
|
|
||||||
const autoFocus = ref(true)
|
|
||||||
|
|
||||||
const keyword = ref('')
|
const pipelineCode = ref('')
|
||||||
|
const weldJointCode = ref('')
|
||||||
const listData = ref([])
|
const listData = ref([])
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const searched = ref(false)
|
const searched = ref(false)
|
||||||
const hasMore = ref(true)
|
const hasMore = ref(true)
|
||||||
const currentPage = ref(1)
|
const currentPage = ref(1)
|
||||||
const pageSize = 20
|
const pageSize = 20
|
||||||
let searchTimer = null
|
|
||||||
|
/**
|
||||||
|
* 是否有可搜索条件
|
||||||
|
*/
|
||||||
|
const hasKeyword = () => !!(pipelineCode.value.trim() || weldJointCode.value.trim())
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 从接口响应取出列表
|
* 从接口响应取出列表
|
||||||
@@ -146,14 +168,13 @@ const clearList = () => {
|
|||||||
* @param {boolean} isRefresh
|
* @param {boolean} isRefresh
|
||||||
*/
|
*/
|
||||||
const loadList = async (isRefresh = true) => {
|
const loadList = async (isRefresh = true) => {
|
||||||
const kw = keyword.value.trim()
|
|
||||||
const projectId = currentProject.value?.ProjectId
|
const projectId = currentProject.value?.ProjectId
|
||||||
if (!projectId) {
|
if (!projectId) {
|
||||||
uni.showToast({ title: '请先选择项目', icon: 'none' })
|
uni.showToast({ title: '请先选择项目', icon: 'none' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!kw) {
|
if (!hasKeyword()) {
|
||||||
clearList()
|
uni.showToast({ title: '请输入管线号或焊口号', icon: 'none' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (loading.value) return
|
if (loading.value) return
|
||||||
@@ -169,7 +190,8 @@ const loadList = async (isRefresh = true) => {
|
|||||||
try {
|
try {
|
||||||
const res = await reqPipeJointWeldedJoints({
|
const res = await reqPipeJointWeldedJoints({
|
||||||
projectId,
|
projectId,
|
||||||
keyword: kw,
|
pipelineCode: pipelineCode.value.trim() || undefined,
|
||||||
|
weldJointCode: weldJointCode.value.trim() || undefined,
|
||||||
pageIndex: currentPage.value,
|
pageIndex: currentPage.value,
|
||||||
pageSize,
|
pageSize,
|
||||||
})
|
})
|
||||||
@@ -195,30 +217,20 @@ const loadList = async (isRefresh = true) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSearchInput = () => {
|
/** 点击查询 */
|
||||||
if (searchTimer) clearTimeout(searchTimer)
|
const handleSearch = () => {
|
||||||
searchTimer = setTimeout(() => {
|
|
||||||
const kw = keyword.value.trim()
|
|
||||||
if (!kw) {
|
|
||||||
clearList()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
loadList(true)
|
|
||||||
}, 400)
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleSearchConfirm = () => {
|
|
||||||
if (searchTimer) clearTimeout(searchTimer)
|
|
||||||
loadList(true)
|
loadList(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleClear = () => {
|
/** 重置条件与结果 */
|
||||||
keyword.value = ''
|
const handleReset = () => {
|
||||||
|
pipelineCode.value = ''
|
||||||
|
weldJointCode.value = ''
|
||||||
clearList()
|
clearList()
|
||||||
}
|
}
|
||||||
|
|
||||||
const loadMore = () => {
|
const loadMore = () => {
|
||||||
if (!loading.value && hasMore.value && keyword.value.trim()) {
|
if (!loading.value && hasMore.value && hasKeyword()) {
|
||||||
currentPage.value += 1
|
currentPage.value += 1
|
||||||
loadList(false)
|
loadList(false)
|
||||||
}
|
}
|
||||||
@@ -298,31 +310,91 @@ onLoad((opt) => {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-bar {
|
.filter-panel {
|
||||||
display: flex;
|
flex-shrink: 0;
|
||||||
align-items: center;
|
|
||||||
padding: 16rpx 24rpx;
|
padding: 16rpx 24rpx;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
|
|
||||||
&__input-wrap {
|
&__row {
|
||||||
flex: 1;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__scan {
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 72rpx;
|
||||||
height: 72rpx;
|
height: 72rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 12rpx;
|
justify-content: center;
|
||||||
padding: 0 20rpx;
|
|
||||||
background: #f5f6f8;
|
background: #f5f6f8;
|
||||||
border-radius: 36rpx;
|
border-radius: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__fields {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__item {
|
||||||
|
min-width: 0;
|
||||||
|
height: 72rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 16rpx;
|
||||||
|
background: #f5f6f8;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
|
||||||
|
&--pipe {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
&--joint {
|
||||||
|
flex: none;
|
||||||
|
width: 140rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__input {
|
&__input {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
height: 72rpx;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__actions {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 16rpx;
|
||||||
|
margin-top: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__btn {
|
||||||
|
flex: 1;
|
||||||
height: 72rpx;
|
height: 72rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 28rpx;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
|
||||||
|
&--reset {
|
||||||
|
color: #666;
|
||||||
|
background: #f5f6f8;
|
||||||
|
}
|
||||||
|
|
||||||
|
&--search {
|
||||||
|
color: #fff;
|
||||||
|
background: #2979ff;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -91,8 +91,7 @@ export const defaultApps = [{
|
|||||||
name: '焊缝检测',
|
name: '焊缝检测',
|
||||||
icon: 'search',
|
icon: 'search',
|
||||||
menuId: "",
|
menuId: "",
|
||||||
path: "/scanpages/hj/weld_appearance",
|
path: "/scanpages/hj/weld_joint_search?target=%2Fscanpages%2Fhj%2Fweld_appearance&title=%E7%84%8A%E7%BC%9D%E6%A3%80%E6%B5%8B",
|
||||||
isScan: true,
|
|
||||||
prefix: 'uicon',
|
prefix: 'uicon',
|
||||||
selected: false
|
selected: false
|
||||||
},
|
},
|
||||||
|
|||||||
+3
-4
@@ -95,12 +95,11 @@ export function request(url, options = {}) {
|
|||||||
* 兼容两种调用方式:
|
* 兼容两种调用方式:
|
||||||
* get('/path?key=val') 旧风格(URL 自带参数)
|
* get('/path?key=val') 旧风格(URL 自带参数)
|
||||||
* get('/path', { key: 'val' }) 新风格(参数对象,自动编码)
|
* get('/path', { key: 'val' }) 新风格(参数对象,自动编码)
|
||||||
|
* 不可对形参 url 做 += 重赋值,正式版 Babel 会把形参编译为只读,触发 "a" is read-only
|
||||||
*/
|
*/
|
||||||
export const get = (url, params) => {
|
export const get = (url, params) => {
|
||||||
if (params) {
|
const fullUrl = params ? `${url}${toQueryString(params)}` : url
|
||||||
url += toQueryString(params)
|
return request(fullUrl, { method: 'GET' })
|
||||||
}
|
|
||||||
return request(url, { method: 'GET' })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user