焊接日报
This commit is contained in:
+6
-1
@@ -6,4 +6,9 @@ import {
|
||||
/**
|
||||
* 请求单位工程
|
||||
*/
|
||||
export const reqProjectWorkArea = (projectId)=>get(`BaseInfo/getProjectWorkArea?projectId=${projectId}`)
|
||||
export const reqProjectWorkArea = (projectId)=>get(`BaseInfo/getProjectWorkArea?projectId=${projectId}`)
|
||||
|
||||
/**
|
||||
* 获取焊口位置
|
||||
*/
|
||||
export const getWeldingLocation = ()=>get(`BaseInfo/getWeldingLocation`)
|
||||
|
||||
@@ -6,9 +6,32 @@ import {
|
||||
/**
|
||||
* 获取焊接首页数据
|
||||
*/
|
||||
export const reqHJIndexData = (projectId)=>get(`HJGLIndex/GetJGLIndexItem?projectId=${projectId}`)
|
||||
export const reqHJIndexData = (projectId) => get(`HJGLIndex/GetJGLIndexItem?projectId=${projectId}`)
|
||||
|
||||
/**
|
||||
* 获取点口管理列表
|
||||
*/
|
||||
export const reqGetNotEndPointBatch = (unitWorkId,projectId)=>get(`NDETrust/getNotEndPointBatch?unitWorkId=${unitWorkId}&projectId=${projectId}`)
|
||||
export const reqGetNotEndPointBatch = (unitWorkId, projectId) => get(
|
||||
`NDETrust/getNotEndPointBatch?unitWorkId=${unitWorkId}&projectId=${projectId}`)
|
||||
|
||||
/**
|
||||
* 获取点口详情列表
|
||||
*/
|
||||
export const reqGetPointBatchDetail = (id) => get(`NDETrust/getPointBatchDetail?pointBatchId=${id}`)
|
||||
|
||||
/**
|
||||
* 获取焊接日报详情
|
||||
*/
|
||||
export const reqGetWeldJointByWeldJointId = (id) => get(`PipeJoint/getWeldJointByWeldJointId?WeldJointId=${id}`)
|
||||
|
||||
/**
|
||||
* 焊接日报填报
|
||||
*/
|
||||
export const reqSaveWeldingDailyByWeldJointId = (data) => get(
|
||||
`PreWeldingDaily/SaveWeldingDailyByWeldJointId?WeldJointId=${data.WeldJointId||''}&Personid=${data.Personid||''}&time=${data.time||''}&weldingLocation=${data.weldingLocation||''}&welderType=${data.welderType||''}`
|
||||
)
|
||||
|
||||
/**
|
||||
* 点口
|
||||
*/
|
||||
export const reqGetManualPointSave = (weldJointId)=>get(`NDETrust/getManualPointSave?weldJointId=${weldJointId}`)
|
||||
+232
-4
@@ -27,7 +27,6 @@
|
||||
// 首页
|
||||
.home {
|
||||
padding-top: 80px;
|
||||
padding-bottom: 60rpx;
|
||||
.u-border-bottom:after {
|
||||
border: none;
|
||||
}
|
||||
@@ -448,7 +447,7 @@
|
||||
// 列表区域
|
||||
.list-scroll {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
// 加载中
|
||||
@@ -468,7 +467,7 @@
|
||||
}
|
||||
|
||||
.list-wrap {
|
||||
padding: 24rpx;
|
||||
padding: 24rpx 24rpx 60rpx;
|
||||
}
|
||||
|
||||
// 列表项:序号 + 标题 + 箭头
|
||||
@@ -524,4 +523,233 @@
|
||||
color: #ccc;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
// 操作按钮区域
|
||||
.action-bar {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 24rpx;
|
||||
background: #ffffff;
|
||||
|
||||
.action-btn {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
padding: 16rpx 0;
|
||||
background: $u-type-primary;
|
||||
color: #ffffff;
|
||||
font-size: 28rpx;
|
||||
border-radius: 8rpx;
|
||||
margin: 0 8rpx;
|
||||
|
||||
&:active {
|
||||
opacity: 0.7;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 批号信息
|
||||
.batch-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 24rpx;
|
||||
background: #ffffff;
|
||||
margin-top: 2rpx;
|
||||
|
||||
.batch-refresh {
|
||||
margin-left: auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.rotating {
|
||||
animation: rotate 1s linear infinite;
|
||||
}
|
||||
}
|
||||
|
||||
.batch-label {
|
||||
width: 160rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.batch-value {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
// 卡片项
|
||||
.card-item {
|
||||
background: #ffffff;
|
||||
border-radius: 16rpx;
|
||||
padding: 28rpx;
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.card-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 16rpx 0;
|
||||
|
||||
&:not(:last-child) {
|
||||
border-bottom: 1rpx solid #f5f6f8;
|
||||
}
|
||||
}
|
||||
|
||||
.card-label {
|
||||
width: 160rpx;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.card-value {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.card-tag {
|
||||
display: inline-block;
|
||||
padding: 6rpx 20rpx;
|
||||
border-radius: 20rpx;
|
||||
font-size: 24rpx;
|
||||
background: rgba(244, 67, 54, 0.1);
|
||||
color: #f44336;
|
||||
margin-left: auto;
|
||||
|
||||
&.done {
|
||||
background: rgba(76, 175, 80, 0.1);
|
||||
color: #4caf50;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 详情页通用样式
|
||||
.page-detail {
|
||||
min-height: 100vh;
|
||||
background: #f5f6f8;
|
||||
padding-bottom: 180rpx;
|
||||
}
|
||||
|
||||
// 信息分组
|
||||
.info-group {
|
||||
background: #ffffff;
|
||||
margin: 24rpx;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.info-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 28rpx 32rpx;
|
||||
border-bottom: 1rpx solid #f5f6f8;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.info-label {
|
||||
width: 200rpx;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.info-value {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
&.info-link {
|
||||
.info-value {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
&:active {
|
||||
background: #f8f9fa;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 底部按钮
|
||||
.bottom-btns {
|
||||
position: fixed;
|
||||
left: 30rpx;
|
||||
right: 30rpx;
|
||||
bottom: 40rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
|
||||
.u-size-medium {
|
||||
height: 80rpx;
|
||||
font-size: 28rpx;
|
||||
border-radius: 8rpx;
|
||||
width: 45% !important;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
}
|
||||
// 网格页面(试压管理等)
|
||||
.page-grid {
|
||||
min-height: 100vh;
|
||||
background: #f5f6f8;
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
.grid-card {
|
||||
background: #ffffff;
|
||||
border-radius: 16rpx;
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
.grid-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.grid-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
min-width: 45%;
|
||||
padding: 32rpx 16rpx;
|
||||
border-radius: 12rpx;
|
||||
transition: all 0.2s;
|
||||
|
||||
&:active {
|
||||
background: #f0f3ff;
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.grid-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.grid-text {
|
||||
margin-top: 20rpx;
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
+25
@@ -37,6 +37,31 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "点口管理"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "diankou/port_list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "点口管理"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "weld/daily_paper",
|
||||
"style": {
|
||||
"navigationBarTitleText": "焊接日报"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pressure/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "试压管理"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "packaging/list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "包装管理",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
+13
-6
@@ -90,7 +90,8 @@
|
||||
<view class="section-grid">
|
||||
<view class="grid-item" v-for="(item, idx) in queryApps" :key="idx" @click="handleSkip(item)">
|
||||
<view class="icon-box">
|
||||
<u-icon :name="item.icon" :custom-prefix='item.prefix' :size="56" :color="pastelColors[idx % 6]" />
|
||||
<u-icon :name="item.icon" :custom-prefix='item.prefix' :size="56"
|
||||
:color="pastelColors[idx % 6]" />
|
||||
</view>
|
||||
<text class="item-label">{{ item.name }}</text>
|
||||
</view>
|
||||
@@ -147,6 +148,10 @@
|
||||
storeToRefs
|
||||
} from 'pinia';
|
||||
|
||||
import {
|
||||
scanToSkipUrl
|
||||
} from '@/utils/scanUtils.js'
|
||||
|
||||
const userStore = useUserStore()
|
||||
const menuStore = useMenuStore()
|
||||
const largeStore = useLargeStore()
|
||||
@@ -180,7 +185,7 @@
|
||||
const currentProjectName = computed(() => currentProject.value?.ProjectName || '')
|
||||
|
||||
const handleSkip = (item) => {
|
||||
if(!currentProject.value.ProjectId){
|
||||
if (!currentProject.value.ProjectId) {
|
||||
handleShowProjectSelect()
|
||||
uni.showToast({
|
||||
title: '请选择一个项目',
|
||||
@@ -241,12 +246,14 @@
|
||||
uni.scanCode({
|
||||
onlyFromCamera: true,
|
||||
success(res) {
|
||||
console.log('条码类型:' + res.scanType);
|
||||
console.log('条码内容:' + res.result);
|
||||
const result = res.result || ''
|
||||
uni.navigateTo({
|
||||
url:scanToSkipUrl(result)
|
||||
})
|
||||
},
|
||||
fail(err) {
|
||||
console.log("扫码失败了====>", err)
|
||||
console.error('扫码失败:', err)
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
</script>
|
||||
@@ -133,8 +133,9 @@
|
||||
}
|
||||
|
||||
const handleItemClick = (item) => {
|
||||
console.log('点击列表项:', item)
|
||||
// TODO: 跳转详情
|
||||
uni.navigateTo({
|
||||
url: `/pipe/diankou/port_list?id=${item.PointBatchId}&code=${item.PointBatchCode}`
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
<template>
|
||||
<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>
|
||||
|
||||
<!-- 批号信息 -->
|
||||
<view class="batch-info">
|
||||
<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="list-scroll">
|
||||
<!-- 加载中 -->
|
||||
<view v-if="loading" class="loading-box">
|
||||
<u-loading mode="circle" size="40"></u-loading>
|
||||
<text class="loading-text">加载中...</text>
|
||||
</view>
|
||||
<!-- 数据列表 -->
|
||||
<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' }">
|
||||
{{ item.PointState == '1' ? '已点' : '未点' }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 空状态 -->
|
||||
<u-empty v-if="listData.length === 0" mode="list" text="暂无数据"></u-empty>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref
|
||||
} from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { reqGetPointBatchDetail } from '@/api/hj.js'
|
||||
|
||||
// ===== 参数 =====
|
||||
const pointBatchId = ref('')
|
||||
const PointBatchCode = ref('')
|
||||
|
||||
// ===== 列表数据 =====
|
||||
const listData = ref([])
|
||||
const loading = ref(false)
|
||||
|
||||
// 加载数据
|
||||
const fetchData = async () => {
|
||||
if (loading.value) return
|
||||
loading.value = true
|
||||
|
||||
try {
|
||||
const res = await reqGetPointBatchDetail(pointBatchId.value)
|
||||
listData.value = res.data || []
|
||||
} catch (error) {
|
||||
console.error('加载数据失败:', error)
|
||||
uni.showToast({ title: '加载失败,请重试', icon: 'none' })
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const handleRefresh = () => {
|
||||
fetchData()
|
||||
}
|
||||
|
||||
// 自动点口
|
||||
const handleAutoPoint = async () => {
|
||||
// TODO: 调用自动点口 API
|
||||
uni.showToast({ title: '自动点口成功', icon: 'none' })
|
||||
fetchData()
|
||||
}
|
||||
|
||||
// 强制关闭批
|
||||
const handleForceClose = async () => {
|
||||
// TODO: 调用强制关闭批 API
|
||||
uni.showToast({ title: '强制关闭批成功', icon: 'none' })
|
||||
fetchData()
|
||||
}
|
||||
|
||||
// 点口调整
|
||||
const handleAdjust = () => {
|
||||
// TODO: 跳转到点口调整页面
|
||||
uni.showToast({ title: '功能开发中', icon: 'none' })
|
||||
}
|
||||
|
||||
// ===== 生命周期 =====
|
||||
onLoad((opt) => {
|
||||
pointBatchId.value = opt.id
|
||||
PointBatchCode.value = opt.code
|
||||
fetchData()
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<view class="page-grid">
|
||||
<!-- 卡片列表 -->
|
||||
<view class="grid-card">
|
||||
<view class="grid-list">
|
||||
<view class="grid-item" @click="handleClick('/pipe/pressure/condition')">
|
||||
<view class="grid-icon">
|
||||
<u-icon name="info-circle" :size="60" :color="$u.type.primary"></u-icon>
|
||||
</view>
|
||||
<text class="grid-text">试压前条件确认</text>
|
||||
</view>
|
||||
<view class="grid-item" @click="handleClick('/pipe/pressure/check')">
|
||||
<view class="grid-icon">
|
||||
<u-icon name="checkmark-circle" :size="60" :color="$u.type.primary"></u-icon>
|
||||
</view>
|
||||
<text class="grid-text">尾项检查及消项</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const handleClick = (url) => {
|
||||
uni.navigateTo({ url })
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,208 @@
|
||||
<template>
|
||||
<view class="page-detail">
|
||||
<!-- 信息列表 -->
|
||||
<view class="info-group">
|
||||
<view class="info-item">
|
||||
<text class="info-label">管线</text>
|
||||
<text class="info-value">{{ form.PipelineCode || '--' }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-label">焊口</text>
|
||||
<text class="info-value">{{ form.WeldJointCode || '--' }}</text>
|
||||
</view>
|
||||
<view class="info-item info-link" @click="handleShowLocationSelect">
|
||||
<text class="info-label">焊口位置</text>
|
||||
<text
|
||||
class="info-value">{{ form.WeldingLocationCode?`${form.WeldingLocationCode}(${form.WeldingLocationName})` : '请选择' }}</text>
|
||||
<u-icon name="arrow-right" :size="28" color="#ccc"></u-icon>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-label">焊接日期</text>
|
||||
<text class="info-value">{{ form.WeldingDate || '--' }}</text>
|
||||
</view>
|
||||
<view class="info-item info-link" @click="showTypePicker = true">
|
||||
<text class="info-label">焊工类型</text>
|
||||
<text class="info-value">{{ form.welderTypeName || '请选择' }}</text>
|
||||
<u-icon name="arrow-right" :size="28" color="#ccc"></u-icon>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-label">焊工</text>
|
||||
<text class="info-value">{{ form.welderName || '--' }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-label">材质1</text>
|
||||
<text class="info-value">{{ form.Material1Code || '--' }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-label">材质2</text>
|
||||
<text class="info-value">{{ form.Material2Code || '--' }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-label">达因</text>
|
||||
<text class="info-value">{{ form.Size || '--' }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-label">外径</text>
|
||||
<text class="info-value">{{ form.Dia || '--' }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-label">DN公称直径</text>
|
||||
<text class="info-value">{{ form.DNDia || '--' }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-label">壁厚</text>
|
||||
<text class="info-value">{{ form.Thickness || '--' }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-label">规格</text>
|
||||
<text class="info-value">{{ form.Specification || '--' }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-label">焊接方法</text>
|
||||
<text class="info-value">{{ form.WeldingMethodCode || '--' }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-label">焊缝类型</text>
|
||||
<text class="info-value">{{ form.WeldTypeCode || '--' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部按钮 -->
|
||||
<view class="bottom-btns">
|
||||
<u-button v-if="!form.WeldingDate" class="btn-submit" size="medium" type="primary"
|
||||
@click="handleReport">填报</u-button>
|
||||
<u-button v-if="form.WeldingDailyId" class="btn-point" size="medium" type="primary"
|
||||
@click="handlePoint">点口</u-button>
|
||||
<u-button class="btn-cancel" size="medium" @click="handleClose">取消</u-button>
|
||||
</view>
|
||||
|
||||
<!-- 焊口位置选择弹窗 -->
|
||||
<nbd-select v-model="showLocationPicker" :show-search="true" title="选择焊口位置" :list="locationList"
|
||||
label-key="BaseInfoCode" value-key="BaseInfoId" @confirm="handleConfirmLocation" />
|
||||
|
||||
<!-- 焊工类型选择弹窗 -->
|
||||
<nbd-select v-model="showTypePicker" title="选择焊工类型" :list="welderTypeList" label-key="BaseInfoName"
|
||||
value-key="BaseInfoCode" @confirm="handleConfirmType" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref
|
||||
} from 'vue'
|
||||
import {
|
||||
onLoad
|
||||
} from '@dcloudio/uni-app'
|
||||
import {
|
||||
reqGetWeldJointByWeldJointId,
|
||||
reqSaveWeldingDailyByWeldJointId,
|
||||
reqGetManualPointSave
|
||||
} from '@/api/hj.js'
|
||||
import {
|
||||
getWeldingLocation
|
||||
} from '@/api/base.js'
|
||||
import { useUserStore } from '@/store'
|
||||
const userStroe = useUserStore()
|
||||
const {userInfo} = userStroe
|
||||
// ===== 表单数据 =====
|
||||
const form = ref({})
|
||||
|
||||
// ===== 弹窗 =====
|
||||
const showLocationPicker = ref(false)
|
||||
const showTypePicker = ref(false)
|
||||
const locationList = ref([])
|
||||
const welderTypeList = ref([{
|
||||
BaseInfoName: '打底/盖面',
|
||||
BaseInfoCode: 0
|
||||
},
|
||||
{
|
||||
BaseInfoName: '打底',
|
||||
BaseInfoCode: 1
|
||||
},
|
||||
{
|
||||
BaseInfoName: '盖面',
|
||||
BaseInfoCode: 2
|
||||
},
|
||||
])
|
||||
|
||||
// ===== 弹窗 ========
|
||||
// 焊口位置弹窗
|
||||
const handleShowLocationSelect = () => {
|
||||
getWeldingLocation().then(res => {
|
||||
locationList.value = res.data
|
||||
showLocationPicker.value = true
|
||||
})
|
||||
}
|
||||
|
||||
// ===== 选择回调 =====
|
||||
const handleConfirmLocation = (item) => {
|
||||
form.value.WeldingLocationCode = item.BaseInfoCode
|
||||
form.value.WeldingLocationName = item.BaseInfoName
|
||||
form.value.WeldingLocationId = item.BaseInfoId
|
||||
showLocationPicker.value = false
|
||||
}
|
||||
|
||||
const handleConfirmType = (item) => {
|
||||
form.value.welderType = item.BaseInfoCode
|
||||
form.value.welderTypeName = item.BaseInfoName
|
||||
showTypePicker.value = false
|
||||
}
|
||||
|
||||
// ===== 操作 =====
|
||||
const handlePoint = async () => {
|
||||
// TODO: 调用点口 API
|
||||
const res = await reqGetManualPointSave(form.value.WeldJointId)
|
||||
uni.showToast({
|
||||
title: '点口成功',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
}
|
||||
// 填报事件
|
||||
const handleReport = async () => {
|
||||
uni.showModal({
|
||||
title: '信息提示',
|
||||
content: '确定要填报吗?',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
// TODO: 调用填报 API
|
||||
const result = await reqSaveWeldingDailyByWeldJointId(
|
||||
form.value.WeldJointId,
|
||||
userInfo.value.PersonId,
|
||||
$u.timeFormat(new Date().getTime(), 'yyyy-mm-dd'),
|
||||
form.value.WeldingLocationId,
|
||||
form.value.welderType
|
||||
)
|
||||
uni.showToast({
|
||||
title: '保存成功',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const handleClose = () => {
|
||||
uni.navigateBack()
|
||||
}
|
||||
|
||||
// ===== 生命周期 =====
|
||||
onLoad((opt) => {
|
||||
reqGetWeldJointByWeldJointId(opt.id).then(res => {
|
||||
form.value = res.data || {}
|
||||
if (form.value.CoverWelderName) {
|
||||
form.value.welderName = form.value.CoverWelderName
|
||||
}
|
||||
if (form.value.BackingWelderName) {
|
||||
form.value.welderName += '/' + form.value.BackingWelderName
|
||||
}
|
||||
form.value.welderType = 0
|
||||
form.value.welderTypeName = "打底/盖面"
|
||||
})
|
||||
})
|
||||
</script>
|
||||
+29
-6
@@ -3,24 +3,42 @@ import {
|
||||
} from 'pinia'
|
||||
import {
|
||||
ref,
|
||||
computed
|
||||
computed,
|
||||
watch
|
||||
} from 'vue'
|
||||
import {pastelColors,defaultApps} from '@/utils/constant.js'
|
||||
import {reqMenuPowerList} from '@/api/auth.js'
|
||||
|
||||
export const useMenuStore = defineStore('menu', () => {
|
||||
// 应用列表(默认配置 + 持久化)
|
||||
const appsList = ref([...defaultApps])
|
||||
// 持久化:仅缓存快捷应用的 menuId 列表,不缓存全部菜单
|
||||
const quickAppIds = ref([])
|
||||
|
||||
// 根据默认配置 + 持久化状态重建应用列表
|
||||
const buildAppsList = () => {
|
||||
return defaultApps.map(app => ({
|
||||
...app,
|
||||
selected: quickAppIds.value.includes(app.menuId)
|
||||
}))
|
||||
}
|
||||
|
||||
// 应用列表(从默认配置构建 + 持久化 selected 状态)
|
||||
const appsList = ref(buildAppsList())
|
||||
// 持久化恢复后,appsList 需重新根据 quickAppIds 构建
|
||||
watch(quickAppIds, (ids) => {
|
||||
if (ids && ids.length > 0) {
|
||||
appsList.value = buildAppsList()
|
||||
}
|
||||
}, { deep: true })
|
||||
// 编辑时的临时缓存
|
||||
const editCache = ref([])
|
||||
// 菜单的权限列表(后端返回的有权限的菜单 code 数组)
|
||||
const menuProwerList = ref([])
|
||||
|
||||
// 快捷应用列表(已选择的)
|
||||
const quickApps = computed(() => appsList.value.filter(app => app.selected&&hasMenuPermission(app.menuId)))
|
||||
const quickApps = computed(() => appsList.value.filter(app => app.selected && hasMenuPermission(app.menuId)))
|
||||
|
||||
// 业务查询列表(未选择的)
|
||||
const queryApps = computed(() => appsList.value.filter(app => !app.selected&&hasMenuPermission(app.menuId)))
|
||||
const queryApps = computed(() => appsList.value.filter(app => !app.selected && hasMenuPermission(app.menuId)))
|
||||
|
||||
/**
|
||||
* 打开编辑弹窗(备份当前状态)
|
||||
@@ -41,6 +59,10 @@ export const useMenuStore = defineStore('menu', () => {
|
||||
*/
|
||||
const confirmEdit = () => {
|
||||
appsList.value = editCache.value.map(app => ({ ...app }))
|
||||
// 只持久化快捷应用的 menuId 列表
|
||||
quickAppIds.value = appsList.value
|
||||
.filter(app => app.selected)
|
||||
.map(app => app.menuId)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -79,6 +101,7 @@ export const useMenuStore = defineStore('menu', () => {
|
||||
|
||||
return {
|
||||
appsList,
|
||||
quickAppIds,
|
||||
editCache,
|
||||
quickApps,
|
||||
quickAppsWithPermission,
|
||||
@@ -96,7 +119,7 @@ export const useMenuStore = defineStore('menu', () => {
|
||||
enabled: true,
|
||||
strategies: [{
|
||||
key: 'menu',
|
||||
paths: ['appsList'],
|
||||
paths: ['quickAppIds'],
|
||||
}]
|
||||
},
|
||||
})
|
||||
|
||||
+3
-1
@@ -22,6 +22,7 @@ export const defaultApps = [{
|
||||
name: '试压管理',
|
||||
icon: 'shiyabao',
|
||||
menuId: '55976B16-2C33-406E-B514-2FE42D031071',
|
||||
path: '/pipe/pressure/index',
|
||||
prefix: 'nbd-icon',
|
||||
selected: false
|
||||
},
|
||||
@@ -29,6 +30,7 @@ export const defaultApps = [{
|
||||
name: '包装管理',
|
||||
icon: 'baozhuangguanli',
|
||||
menuId: "25DED954-10C9-47CC-99F2-C44FDE9E0A81",
|
||||
path: "/pipe/packaging/list",
|
||||
prefix: 'nbd-icon',
|
||||
selected: false
|
||||
},
|
||||
@@ -46,4 +48,4 @@ export const defaultApps = [{
|
||||
prefix: 'nbd-icon',
|
||||
selected: false
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
+22
-2
@@ -137,11 +137,31 @@ export function request(options) {
|
||||
}
|
||||
|
||||
// GET 快捷方法
|
||||
export function get(url, params = {}) {
|
||||
export const get = (url, params = {}) => {
|
||||
return request({ url, method: 'GET', data: params })
|
||||
}
|
||||
|
||||
// POST 快捷方法
|
||||
export function post(url, data = {}) {
|
||||
export const post = (url, data = {}) => {
|
||||
return request({ url, method: 'POST', data })
|
||||
}
|
||||
|
||||
|
||||
export const getUrlParam = (url, name) => {
|
||||
if (!url || !name) return null;
|
||||
|
||||
// 构造正则:匹配 ?name= 或 &name= 后面的值
|
||||
// [?&] : 匹配起始分隔符
|
||||
// ${name}: 匹配具体的参数名
|
||||
// = : 匹配等号
|
||||
// ([^&]*) : 捕获组,匹配直到下一个 & 或字符串结束的内容
|
||||
const regex = new RegExp(`[?&]${name}=([^&]*)`, 'i'); // 'i' 表示忽略大小写
|
||||
|
||||
const match = url.match(regex);
|
||||
|
||||
if (match && match[1]) {
|
||||
return decodeURIComponent(match[1]);
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
import {getUrlParam} from './request'
|
||||
export const scanToSkipUrl = (str)=>{
|
||||
// 焊接日报跳转
|
||||
if(str.includes('weldjoint')){
|
||||
return `/pipe/weld/daily_paper?id=${getUrlParam(str,"id")}`
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user