This commit is contained in:
2026-06-16 19:26:48 +08:00
parent 77e3a85134
commit d7461853cf
20 changed files with 1229 additions and 223 deletions
+20 -15
View File
@@ -117,7 +117,8 @@
<!-- 底部按钮 -->
<view class="bottom-btns" v-if="!form.State || form.State === 0">
<u-button size="medium" type="primary" :disabled="disabledBtn" @click="handleSave(0)">保存</u-button>
<u-button v-if="form.Id" size="medium" type="primary" :disabled="disabledBtn" @click="handleSave(0,true)">保存</u-button>
<u-button v-else size="medium" type="primary" :disabled="disabledBtn" @click="handleSave(0)">保存</u-button>
<u-button v-if="form.Id" size="medium" type="success" :disabled="disabledBtn"
@click="handleSave(1)">发货</u-button>
</view>
@@ -251,7 +252,7 @@
// ===== 单位选择 =====
const showUnitSelect = ref(false)
const unitList = ref([])
const selectedUnit = ref()
const selectedUnit = ref({})
// ===== 包装列表 =====
const BZList = ref([])
@@ -283,9 +284,9 @@
}
// ===== 单位选择确认 =====
const handleUnitConfirm = () => {
form.value.UnitId = selectedUnit.value.UnitId
form.value.UnitName = selectedUnit.value.UnitName
const handleUnitConfirm = (item) => {
form.value.UnitId = item.UnitId
form.value.UnitName = item.UnitName
showUnitSelect.value = false
}
@@ -487,7 +488,7 @@
}
// ===== 保存 =====
const handleSave = (type) => {
const handleSave = (type, isSkip=false) => {
if (!form.value.TrainNumber) {
return uni.showToast({
title: '请输入车次',
@@ -560,7 +561,7 @@
showCancel: true,
success: (res) => {
if (res.confirm) {
saveTrainNumber(params)
saveTrainNumber(params,true)
}
}
})
@@ -571,25 +572,29 @@
}
// 保存车次信息
const saveTrainNumber = async (params) => {
const saveTrainNumber = async (params,isSkip=false) => {
try {
disabledBtn.value = true
const res = await reqSaveTrainNumber(params)
if(isSkip){
uni.showToast({
title: params.State === 1 ? '发货成功' : '保存成功',
icon: 'none'
})
setTimeout(() => {
uni.navigateBack()
}, 2000)
return
}
if (res.code === 1) {
// 更新表单状态
form.value.Id = res.data?.id || form.value.Id
form.value.Id = res.data?.id
form.value.State = params.State
uni.showToast({
title: params.State === 1 ? '发货成功' : '保存成功',
icon: 'none'
})
setTimeout(() => {
uni.navigateBack({
delta: 1
})
}, 900)
} else {
uni.showToast({
title: res.msg || '操作失败',
+7
View File
@@ -141,3 +141,10 @@
}
</script>
<style lang="scss" scoped>
.list-item .item-title {
white-space: normal;
word-break: break-all;
}
</style>
+237 -17
View File
@@ -2,19 +2,30 @@
<view class="page-list">
<!-- 操作按钮区域 -->
<view class="action-bar">
<view class="action-btn" @click="handleAutoPoint">自动点口</view>
<view class="action-btn" @click="handleForceClose">强制关闭批</view>
<view class="action-btn" @click="handleAdjust">点口调整</view>
<view class="action-btn primary" @click="handleAutoPoint">
<u-icon name="checkmark" :size="28" color="#fff"></u-icon>
<text>自动点口</text>
</view>
<view class="action-btn danger" @click="handleForceClose">
<u-icon name="close" :size="28" color="#fff"></u-icon>
<text>强制关闭</text>
</view>
<view class="action-btn warning" @click="handleAdjust">
<u-icon name="edit-pen" :size="28" color="#fff"></u-icon>
<text>点口调整</text>
</view>
</view>
<!-- 批号信息 -->
<view class="batch-info">
<view class="batch-info-left">
<text class="batch-label">批号</text>
<text class="batch-value">{{ PointBatchCode || '--' }}</text>
<view class="batch-refresh" @click="handleRefresh">
<u-icon name="reload" :size="36" :class="{ rotating: loading }"></u-icon>
</view>
</view>
<view class="batch-refresh" @click="handleRefresh">
<u-icon name="reload" :size="36" :class="{ rotating: loading }"></u-icon>
</view>
</view>
<!-- 列表内容 -->
<view class="list-scroll">
@@ -26,20 +37,18 @@
<!-- 数据列表 -->
<view v-else class="list-wrap">
<view v-for="(item, index) in listData" :key="item.id || index" class="card-item">
<view class="card-row">
<text class="card-label">管线号</text>
<text class="card-value">{{ item.PipelineCode || '--' }}</text>
</view>
<view class="card-row">
<text class="card-label">焊口代号</text>
<text class="card-value">{{ item.WeldJointCode || '--' }}</text>
</view>
<view class="card-row">
<text class="card-label">状态</text>
<view class="card-tag" :class="{ done: item.PointState == '1' }">
<view class="card-header">
<text class="card-code">{{ item.PipelineCode || '--' }}</text>
<view class="status-tag" :class="item.PointState == '1' ? 'done' : 'pending'">
{{ item.PointState == '1' ? '已点' : '未点' }}
</view>
</view>
<view class="card-body">
<view class="card-row">
<text class="row-label">焊口代号</text>
<text class="row-value">{{ item.WeldJointCode || '--' }}</text>
</view>
</view>
</view>
<!-- 空状态 -->
@@ -111,3 +120,214 @@
fetchData()
})
</script>
<style lang="scss" scoped>
/* 操作按钮区域 */
.action-bar {
display: flex;
gap: 20rpx;
padding: 24rpx;
background: #fff;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.action-btn {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
gap: 8rpx;
height: 72rpx;
border-radius: 12rpx;
font-size: 26rpx;
font-weight: 500;
color: #fff;
transition: all 0.2s;
&:active {
opacity: 0.85;
transform: scale(0.98);
}
&.primary {
background: linear-gradient(135deg, #4a7df5 0%, #356bdb 100%);
box-shadow: 0 4rpx 12rpx rgba(74, 125, 245, 0.3);
}
&.danger {
background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
box-shadow: 0 4rpx 12rpx rgba(255, 107, 107, 0.3);
}
&.warning {
background: linear-gradient(135deg, #ffa726 0%, #fb8c00 100%);
box-shadow: 0 4rpx 12rpx rgba(255, 167, 38, 0.3);
}
}
/* 批号信息 */
.batch-info {
display: flex;
align-items: flex-start;
justify-content: space-between;
padding: 24rpx 32rpx;
background: #fff;
margin-top: 2rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.batch-info-left {
display: flex;
align-items: flex-start;
gap: 16rpx;
}
.batch-label {
font-size: 28rpx;
color: #666;
line-height: 1.4;
}
.batch-value {
font-size: 28rpx;
font-weight: 600;
color: #333;
line-height: 1.4;
}
.batch-refresh {
width: 64rpx;
height: 64rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
background: #f5f6f8;
transition: all 0.2s;
&:active {
background: #e8e9eb;
transform: scale(0.95);
}
}
.rotating {
animation: rotate 1s linear infinite;
}
@keyframes rotate {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
/* 列表区域 */
.list-scroll {
flex: 1;
overflow-y: auto;
background: #f5f6f8;
}
.list-wrap {
padding: 24rpx;
}
/* 卡片样式 */
.card-item {
background: #fff;
border-radius: 16rpx;
padding: 28rpx;
margin-bottom: 20rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
transition: transform 0.15s, box-shadow 0.15s;
&:active {
transform: scale(0.99);
box-shadow: 0 1rpx 8rpx rgba(0, 0, 0, 0.04);
}
&:last-child {
margin-bottom: 0;
}
}
.card-header {
display: flex;
align-items: flex-start;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.card-code {
font-size: 30rpx;
font-weight: 600;
color: #333;
flex: 1;
word-break: break-all;
margin-right: 16rpx;
}
/* 状态标签 */
.status-tag {
display: inline-flex;
align-items: center;
padding: 8rpx 20rpx;
border-radius: 24rpx;
font-size: 24rpx;
font-weight: 500;
flex-shrink: 0;
white-space: nowrap;
&.done {
background: rgba(76, 175, 80, 0.1);
color: #4caf50;
}
&.pending {
background: rgba(153, 153, 153, 0.1);
color: #999;
}
}
.card-body {
padding-top: 20rpx;
}
.card-row {
display: flex;
align-items: center;
padding: 12rpx 0;
}
.row-label {
width: 160rpx;
font-size: 26rpx;
color: #999;
flex-shrink: 0;
}
.row-value {
font-size: 28rpx;
color: #333;
flex: 1;
}
/* 加载状态 */
.loading-box {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 120rpx 0;
}
.loading-text {
margin-top: 20rpx;
font-size: 26rpx;
color: #999;
}
</style>
+2 -10
View File
@@ -113,14 +113,6 @@
// ===== 保存 =====
const handleSave = async () => {
setTimeout(() => {
uni.redirectTo({
url: '/pipe/packaging/detail?id' + res.data.id
})
}, 1500)
return
if (!form.value.StackingPosition) {
uni.showToast({
title: '请输入预制工作包',
@@ -149,11 +141,11 @@
if (res.code === 1 || res.data) {
uni.showToast({
title: '保存成功',
icon: 'success'
icon: 'none'
})
setTimeout(() => {
uni.redirectTo({
url: '/pipe/packaging/detail?id' + res.data.id
url: '/pipe/packaging/detail?id=' + res.data.id
})
}, 1500)
}
+2 -2
View File
@@ -32,10 +32,10 @@
</text>
</view>
<view class="card-body">
<view class="card-row">
<!-- <view class="card-row">
<text class="row-label">包装单位</text>
<text class="row-value">{{ item.UnitName || '--' }}</text>
</view>
</view> -->
<view class="card-row">
<text class="row-label">预制工作包</text>
<text class="row-value">{{ item.StackingPosition || '--' }}</text>
+3
View File
@@ -0,0 +1,3 @@
<template>
</template>
+1 -1
View File
@@ -9,7 +9,7 @@
</view>
<text class="grid-text">试压前条件确认</text>
</view>
<view class="grid-item" @click="handleClick('/pipe/pressure/check')">
<view class="grid-item" @click="handleClick('/pipe/pressure/check_remove/list')">
<view class="grid-icon">
<u-icon name="checkmark-circle" :size="60" :color="$u.type.primary"></u-icon>
</view>
+242
View File
@@ -0,0 +1,242 @@
<template>
<view class="page-detail">
<!-- 统计概览 -->
<view class="stats-group">
<view class="stats-item">
<view class="stats-dot" style="background:#f44336"></view>
<text class="stats-label">未完成</text>
<text class="stats-value">{{ red_num }}</text>
</view>
<view class="stats-item">
<view class="stats-dot" style="background:#FFFF00"></view>
<text class="stats-label">未达检测比例</text>
<text class="stats-value">{{ yellow_num }}</text>
</view>
<view class="stats-item">
<view class="stats-dot" style="background:#800080"></view>
<text class="stats-label">已达比例有不合格</text>
<text class="stats-value">{{ green_num }}</text>
</view>
<view class="stats-item">
<view class="stats-dot" style="background:#008000"></view>
<text class="stats-label">已通过</text>
<text class="stats-value">{{ purple_num }}</text>
</view>
</view>
<!-- 表头 -->
<view class="table-header">
<text class="col-code">管线号</text>
<text class="col-num">完成/总焊口</text>
<text class="col-num">合格/不合格</text>
<text class="col-num">实际/应检比例</text>
</view>
<!-- 列表 -->
<scroll-view class="list-scroll" scroll-y>
<view class="list-wrap">
<view v-for="(item, index) in itemList" :key="index" class="table-row"
:style="{ background: item.bgColor || '#fff' }" @click="toDetail(item)">
<text class="col-code" :class="{ 'text-white': isDarkBg(item.bgColor) }">{{ item.PipelineCode || '--' }}</text>
<text class="col-num" :class="{ 'text-white': isDarkBg(item.bgColor) }">{{ item.WeldJointCountT || 0 }}/{{ item.WeldJointCount || 0 }}</text>
<text class="col-num" :class="{ 'text-white': isDarkBg(item.bgColor) }">{{ item.CountS || 0 }}/{{ item.CountU || 0 }}</text>
<text class="col-num" :class="{ 'text-white': isDarkBg(item.bgColor) }">{{ item.Ratio || '--' }}/{{ item.NDTR_Name || '--' }}</text>
</view>
<!-- 空状态 -->
<u-empty v-if="itemList.length === 0" mode="list" text="暂无数据"></u-empty>
</view>
</scroll-view>
</view>
</template>
<script setup>
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import {reqTestPackageDetail} from '@/api/hj'
// 统计数据
const red_num = ref(0)
const yellow_num = ref(0)
const green_num = ref(0)
const purple_num = ref(0)
// 列表数据
const itemList = ref([])
// 判断深色背景(用于切换文字颜色)
const isDarkBg = (color) => {
if (!color) return false
const darkColors = ['#800080', '#008000', '#f44336', '#800080']
return darkColors.includes(color.toLowerCase())
}
// 跳转详情
const toDetail = (item) => {
uni.navigateTo({
url: `/pipe/pressure/pressure_before/detail?id=${item.PipelineCode}`
})
}
// 获取数据
const fetchData = async (id) => {
try {
const res = await reqTestPackageDetail(id)
if (res.code === 1 && res.data) {
res.data.forEach(item => {
if (item.WeldJointCountT >= item.WeldJointCount) {
if (item.CountU <= 0) {
if (item.Ratio >= item.NDTR_Name) {
if (item.CountS === item.CountU) {
item.bgColor = '#800080' // 焊完了都合格背景是紫色
green_num.value++
} else {
item.bgColor = '#008000'
purple_num.value++
}
} else {
item.bgColor = '#008000' // 实际检测比例小于应检测比例背景是淡绿色
purple_num.value++
}
} else {
item.bgColor = '#FFFF00' // 已经焊完但是有一个不合格背景是黄色
yellow_num.value++
}
} else {
item.bgColor = '#00FFFF' // 完成的焊口数小于总焊口数背景是红色
red_num.value++
}
})
itemList.value = res.data
}
} catch (error) {
console.error('获取数据失败:', error)
uni.showToast({ title: '加载失败', icon: 'none' })
}
}
onLoad((options) => {
console.log('options:', JSON.parse(options.params))
let data = JSON.parse(options.params)
if (data?.value?.BaseInfoId) {
fetchData(data?.value?.BaseInfoId)
}
})
</script>
<style lang="scss" scoped>
.page-detail {
min-height: 100vh;
background: #f5f6f8;
}
/* 统计概览 */
.stats-group {
display: flex;
flex-wrap: wrap;
gap: 16rpx;
padding: 24rpx;
background: #fff;
}
.stats-item {
flex: 1;
min-width: calc(50% - 8rpx);
display: flex;
align-items: center;
gap: 12rpx;
padding: 20rpx 16rpx;
background: #f8f9fa;
border-radius: 12rpx;
}
.stats-dot {
width: 20rpx;
height: 20rpx;
border-radius: 50%;
flex-shrink: 0;
}
.stats-label {
font-size: 22rpx;
color: #666;
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.stats-value {
font-size: 28rpx;
font-weight: 600;
color: #333;
flex-shrink: 0;
}
/* 表头 */
.table-header {
display: flex;
align-items: center;
padding: 20rpx 24rpx;
background: #4a7df5;
border-radius: 12rpx 12rpx 0 0;
margin: 24rpx 24rpx 0;
}
.table-header .col-code,
.table-header .col-num {
font-size: 24rpx;
color: #fff;
font-weight: 500;
}
/* 列表 */
.list-scroll {
flex: 1;
overflow-y: auto;
}
.list-wrap {
padding: 0 24rpx 24rpx;
}
.table-row {
display: flex;
align-items: center;
padding: 24rpx;
border-bottom: 1rpx solid #f0f0f0;
border-radius: 0;
transition: opacity 0.2s;
&:last-child {
border-bottom: none;
border-radius: 0 0 12rpx 12rpx;
}
&:active {
opacity: 0.8;
}
}
.col-code {
width: 160rpx;
font-size: 26rpx;
color: #333;
flex-shrink: 0;
font-weight: 500;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.col-num {
flex: 1;
font-size: 24rpx;
color: #666;
text-align: center;
}
.text-white {
color: #fff !important;
}
</style>
+5 -5
View File
@@ -74,7 +74,7 @@
import { useUserStore } from '@/store'
import { storeToRefs } from 'pinia'
import { reqProjectWorkArea } from '@/api/base.js'
import nbdSelect from '@/components/nbd-select'
import { reqTestPackageNoList } from '@/api/hj.js'
const userStore = useUserStore()
const { currentProject } = storeToRefs(userStore)
@@ -132,15 +132,15 @@
value: item
}
uni.navigateTo({
url: `/pages/weldTwo/pressure/detail/main?params=${JSON.stringify(params)}`
url: `/pipe/pressure/pressure_before/detail?params=${JSON.stringify(params)}`
})
}
// 获取单位工程列表
const getUnitList = async () => {
try {
const projectId = uni.getStorageSync('projectId') || ''
const res = await uni.$weld.getAllUnit(projectId)
const projectId = currentProject.value.ProjectId || ''
const res = await reqProjectWorkArea(projectId)
if (res.code === 1) {
unitList.value = res.data
}
@@ -155,7 +155,7 @@
loading.value = true
try {
const res = await uni.$weld.getTestPackageNo(addInfo.unitWorkId, addInfo.isFinish, addInfo.testPackageNo)
const res = await reqTestPackageNoList(addInfo.unitWorkId, addInfo.isFinish, addInfo.testPackageNo)
if (res.code === 1) {
itemList.value = res.data
}