岗位菜单权限与日报审核
This commit is contained in:
@@ -0,0 +1,337 @@
|
||||
<template>
|
||||
<view class="detail-page">
|
||||
<!-- 焊口主标识 -->
|
||||
<view class="joint-hero">
|
||||
<text class="joint-hero__code">{{ form.WeldJointCode || '--' }}</text>
|
||||
<view class="joint-hero__meta">
|
||||
<view class="joint-hero__pill">
|
||||
<text class="pill-label">管线编码</text>
|
||||
<text class="pill-value">{{ form.PipelineCode || '--' }}</text>
|
||||
</view>
|
||||
<view class="joint-hero__pill">
|
||||
<text class="pill-label">提交人</text>
|
||||
<text class="pill-value">{{ form.SubmitPersonName || '--' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 焊口信息 -->
|
||||
<view class="section">
|
||||
<view class="section__header">
|
||||
<view class="section__bar"></view>
|
||||
<text class="section__title">焊口信息</text>
|
||||
</view>
|
||||
<view class="card">
|
||||
<view class="card__row">
|
||||
<text class="card__label">材质1</text>
|
||||
<text class="card__value">{{ form.Material1Code || '--' }}</text>
|
||||
</view>
|
||||
<view class="card__row">
|
||||
<text class="card__label">材质2</text>
|
||||
<text class="card__value">{{ form.Material2Code || '--' }}</text>
|
||||
</view>
|
||||
<view class="card__row">
|
||||
<text class="card__label">达因</text>
|
||||
<text class="card__value">{{ form.Size ?? '--' }}</text>
|
||||
</view>
|
||||
<view class="card__row">
|
||||
<text class="card__label">外径</text>
|
||||
<text class="card__value">{{ form.Dia ?? '--' }}</text>
|
||||
</view>
|
||||
<view class="card__row">
|
||||
<text class="card__label">DN公称直径</text>
|
||||
<text class="card__value">{{ form.DNDia || '--' }}</text>
|
||||
</view>
|
||||
<view class="card__row">
|
||||
<text class="card__label">壁厚</text>
|
||||
<text class="card__value">{{ form.Thickness ?? '--' }}</text>
|
||||
</view>
|
||||
<view class="card__row">
|
||||
<text class="card__label">焊缝类型</text>
|
||||
<text class="card__value">{{ form.WeldTypeCode || '--' }}</text>
|
||||
</view>
|
||||
<view class="card__row">
|
||||
<text class="card__label">焊口属性</text>
|
||||
<text class="card__value">{{ form.JointAttribute || '--' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 日报信息 -->
|
||||
<view class="section">
|
||||
<view class="section__header">
|
||||
<view class="section__bar"></view>
|
||||
<text class="section__title">日报信息</text>
|
||||
</view>
|
||||
<view class="card">
|
||||
<view class="card__row">
|
||||
<text class="card__label">焊口位置</text>
|
||||
<text class="card__value">{{ form.WeldingLocationCode || '--' }}</text>
|
||||
</view>
|
||||
<view class="card__row">
|
||||
<text class="card__label">焊接日期</text>
|
||||
<text class="card__value">{{ fmtDate(form.WeldingDate) }}</text>
|
||||
</view>
|
||||
<view class="card__row">
|
||||
<text class="card__label">盖面焊工</text>
|
||||
<text class="card__value">{{ form.CoverWelderCode || '--' }}</text>
|
||||
</view>
|
||||
<view class="card__row">
|
||||
<text class="card__label">打底焊工</text>
|
||||
<text class="card__value">{{ form.BackingWelderCode || '--' }}</text>
|
||||
</view>
|
||||
<view class="card__row">
|
||||
<text class="card__label">焊接方法</text>
|
||||
<text class="card__value">{{ form.WeldingMethodCode || '--' }}</text>
|
||||
</view>
|
||||
<view class="card__row">
|
||||
<text class="card__label">焊接模式</text>
|
||||
<text class="card__value">{{ form.WeldingMode || '--' }}</text>
|
||||
</view>
|
||||
<view class="card__row">
|
||||
<text class="card__label">焊丝</text>
|
||||
<text class="card__value">{{ form.WeldingWireCode || '--' }}</text>
|
||||
</view>
|
||||
<view class="card__row">
|
||||
<text class="card__label">焊条</text>
|
||||
<text class="card__value">{{ form.WeldingRodCode || '--' }}</text>
|
||||
</view>
|
||||
<view class="card__row">
|
||||
<text class="card__label">提交时间</text>
|
||||
<text class="card__value">{{ fmtDateTime(form.SubmitDate) }}</text>
|
||||
</view>
|
||||
<!-- 焊前拍照 -->
|
||||
<view class="card__row card__row--stack">
|
||||
<text class="card__label">焊前拍照</text>
|
||||
<view class="card__value-wrap">
|
||||
<nbd-photo-view :attachUrl="form.BeforePhotoUrl || ''" :cols="4" />
|
||||
</view>
|
||||
</view>
|
||||
<!-- 焊后拍照 -->
|
||||
<view class="card__row card__row--stack">
|
||||
<text class="card__label">焊后拍照</text>
|
||||
<view class="card__value-wrap">
|
||||
<nbd-photo-view :attachUrl="form.AfterPhotoUrl || ''" :cols="4" />
|
||||
</view>
|
||||
</view>
|
||||
<!-- 明细附件 -->
|
||||
<view class="card__row card__row--stack" v-if="form.AttachUrl">
|
||||
<text class="card__label">附件</text>
|
||||
<view class="card__value-wrap">
|
||||
<nbd-photo-view :attachUrl="form.AttachUrl" :cols="4" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部按钮 -->
|
||||
<view class="bottom-btns">
|
||||
<u-button class="btn-delete" size="medium" type="error" @click="handleDelete">删除</u-button>
|
||||
<u-button class="btn-audit" size="medium" type="primary" @click="handleAudit">审核通过</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref
|
||||
} from 'vue'
|
||||
import {
|
||||
onLoad
|
||||
} from '@dcloudio/uni-app'
|
||||
import {
|
||||
useUserStore
|
||||
} from '@/store'
|
||||
import {
|
||||
reqPendingWeldingDailyDetail,
|
||||
reqAuditWeldingDaily,
|
||||
reqDeleteWeldingDaily
|
||||
} from '@/api/hj.js'
|
||||
|
||||
const userStore = useUserStore()
|
||||
const {
|
||||
userInfo
|
||||
} = userStore
|
||||
|
||||
const tempDetailId = ref('')
|
||||
const form = ref({})
|
||||
|
||||
// ===== 操作 =====
|
||||
const handleAudit = () => {
|
||||
uni.showModal({
|
||||
title: '信息提示',
|
||||
content: '确定审核通过该日报吗?',
|
||||
success: async ({
|
||||
confirm
|
||||
}) => {
|
||||
if (!confirm) return
|
||||
try {
|
||||
await reqAuditWeldingDaily({
|
||||
TempDetailIds: [tempDetailId.value],
|
||||
AuditMan: userInfo.PersonId
|
||||
})
|
||||
} catch (err) {
|
||||
return // 报错已由 request.js 统一 toast
|
||||
}
|
||||
uni.showToast({
|
||||
title: '审核成功',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const handleDelete = () => {
|
||||
uni.showModal({
|
||||
title: '信息提示',
|
||||
content: '确定删除该日报吗?',
|
||||
success: async ({
|
||||
confirm
|
||||
}) => {
|
||||
if (!confirm) return
|
||||
try {
|
||||
await reqDeleteWeldingDaily({
|
||||
TempDetailIds: [tempDetailId.value]
|
||||
})
|
||||
} catch (err) {
|
||||
return // 报错已由 request.js 统一 toast
|
||||
}
|
||||
uni.showToast({
|
||||
title: '删除成功',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// ===== 工具 =====
|
||||
const fmtDate = (val) => {
|
||||
if (!val) return '--'
|
||||
return String(val).slice(0, 10)
|
||||
}
|
||||
|
||||
const fmtDateTime = (val) => {
|
||||
if (!val) return '--'
|
||||
return String(val).slice(0, 16).replace('T', ' ')
|
||||
}
|
||||
|
||||
// ===== 生命周期 =====
|
||||
onLoad((opt) => {
|
||||
tempDetailId.value = opt.id || ''
|
||||
// 接口报错时 request.js 已统一 toast,这里 catch 住避免未处理 Promise 异常
|
||||
reqPendingWeldingDailyDetail(opt.id).then(res => {
|
||||
form.value = res.data || {}
|
||||
}).catch(() => {})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
$primary: $app-primary;
|
||||
$primary-light: $app-primary-light;
|
||||
$primary-mid: $app-primary-mid;
|
||||
$primary-dark: $app-primary-dark;
|
||||
$text: $app-text;
|
||||
$text-secondary: $app-text-secondary;
|
||||
$card-bg: #ffffff;
|
||||
$shadow-md: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
|
||||
|
||||
.detail-page {
|
||||
background: #f0f2f5;
|
||||
}
|
||||
|
||||
// ===== 焊口主标识(同 daily_paper) =====
|
||||
.joint-hero {
|
||||
position: relative;
|
||||
margin: 24rpx;
|
||||
padding: 36rpx 32rpx 28rpx;
|
||||
background: $card-bg;
|
||||
border-radius: $app-radius;
|
||||
box-shadow: $shadow-md;
|
||||
overflow: hidden;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 4rpx;
|
||||
background: linear-gradient(90deg, $primary, #6ba3ff, $primary);
|
||||
background-size: 200% 100%;
|
||||
animation: shimmer 3s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes shimmer {
|
||||
|
||||
0%,
|
||||
100% {
|
||||
background-position: 0% 0;
|
||||
}
|
||||
|
||||
50% {
|
||||
background-position: 100% 0;
|
||||
}
|
||||
}
|
||||
|
||||
&__code {
|
||||
display: block;
|
||||
font-size: 52rpx;
|
||||
font-weight: 800;
|
||||
color: $text;
|
||||
line-height: 1.2;
|
||||
word-break: break-all;
|
||||
font-family: monospace;
|
||||
letter-spacing: 2rpx;
|
||||
margin-bottom: 28rpx;
|
||||
position: relative;
|
||||
padding-left: 24rpx;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 6rpx;
|
||||
bottom: 6rpx;
|
||||
width: 4rpx;
|
||||
background: $primary;
|
||||
border-radius: 2rpx;
|
||||
}
|
||||
}
|
||||
|
||||
&__meta {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
&__pill {
|
||||
display: inline-flex;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
background: $primary-light;
|
||||
padding: 10rpx 18rpx;
|
||||
border-radius: 10rpx;
|
||||
border: 1rpx solid $primary-mid;
|
||||
|
||||
.pill-label {
|
||||
font-size: 22rpx;
|
||||
color: $text-secondary;
|
||||
width: 60rpx;
|
||||
}
|
||||
|
||||
.pill-value {
|
||||
font-size: 24rpx;
|
||||
font-weight: 600;
|
||||
color: $primary-dark;
|
||||
font-family: monospace;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user