优化
This commit is contained in:
+6
-1
@@ -16,4 +16,9 @@ export const reqWeldingLocation = ()=>get(`BaseInfo/getWeldingLocation`)
|
||||
/**
|
||||
* 根据项目ID单位类型请求单位
|
||||
*/
|
||||
export const reqUnitByProjectIdUnitType = (projectId, unitType="")=>get(`Unit/getUnitByProjectIdUnitType?projectId=${projectId}&unitType=${unitType}`)
|
||||
export const reqUnitByProjectIdUnitType = (projectId, unitType="")=>get(`Unit/getUnitByProjectIdUnitType?projectId=${projectId}&unitType=${unitType}`)
|
||||
|
||||
/**
|
||||
* 获取待办
|
||||
*/
|
||||
export const reqToDoItemByProjectIdUserId = (projectId, personId)=>get(`ToDoItem/getToDoItemByProjectIdUserId?projectId=${projectId}&personId=${personId}`)
|
||||
@@ -124,3 +124,16 @@ export const reqPipelineComponentList = (params={})=>get(`/PipelineComponent/Get
|
||||
* @param {Object} params - { PipelineComponentId, PersonId, Message }
|
||||
*/
|
||||
export const reqPipelineComponentAccept = (params={})=>get(`/PipelineComponent/GetComponentConfirmArrival?PipelineComponentId=${params.PipelineComponentId}&PersonId=${params.PersonId}&Message=${params.Message}`)
|
||||
// =========================== 试压前条件确认 ========================================
|
||||
/**
|
||||
* 获取试压前条件确认列表
|
||||
* @param {String} unitWorkId
|
||||
* @param {String} isFinish
|
||||
* @param {String} testPackageNo
|
||||
*/
|
||||
export const reqTestPackageNoList = (unitWorkId, isFinish, testPackageNo)=>get(`TestPackage/getTestPackageNo?unitWorkId=${unitWorkId}&isFinish=${isFinish}&testPackageNo=${testPackageNo}`)
|
||||
/**
|
||||
* 获取试压前条件确认详情
|
||||
* @param {String} ptp_Id
|
||||
*/
|
||||
export const reqTestPackageDetail = (ptp_Id)=>get(`TestPackage/GetTestPackageDetail?ptp_Id=${ptp_Id}`)
|
||||
|
||||
+36
-4
@@ -26,8 +26,21 @@
|
||||
|
||||
// 首页
|
||||
.home {
|
||||
padding-top: 80px;
|
||||
&-navbar{
|
||||
padding-top: 40px;
|
||||
height: 85px;
|
||||
background-color: var(--u-type-primary);
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
&-title {
|
||||
font-size: 32rpx;
|
||||
color: #ffffff;
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
.u-border-bottom:after {
|
||||
border: none;
|
||||
}
|
||||
@@ -41,9 +54,28 @@
|
||||
}
|
||||
}
|
||||
|
||||
&-navbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 85px;
|
||||
background-color: $u-type-primary;
|
||||
padding: 40px 20rpx 0;
|
||||
|
||||
&-title {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
&-placeholder {
|
||||
width: 220rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&-icons {
|
||||
position: fixed;
|
||||
top: 95px;
|
||||
height: 80px;
|
||||
width: 100%;
|
||||
background-color: $u-type-primary;
|
||||
@@ -672,7 +704,7 @@
|
||||
}
|
||||
|
||||
.batch-label {
|
||||
width: 160rpx;
|
||||
width: 80rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@
|
||||
"quickapp" : {},
|
||||
/* 小程序特有相关 */
|
||||
"mp-weixin" : {
|
||||
"appid" : "",
|
||||
"appid" : "wx35c91aed9edf6e54",
|
||||
"setting" : {
|
||||
"urlCheck" : false
|
||||
},
|
||||
|
||||
+18
@@ -26,6 +26,12 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/todo/list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "待办"
|
||||
}
|
||||
}
|
||||
],
|
||||
"subPackages": [
|
||||
@@ -62,6 +68,18 @@
|
||||
"navigationBarTitleText": "试压前条件确认"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pressure/pressure_before/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "试压前条件确认"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pressure/check_remove/list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "尾项检查及消项"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "packaging/list",
|
||||
"style": {
|
||||
|
||||
+17
-10
@@ -1,18 +1,20 @@
|
||||
<template>
|
||||
<view class="wrap home">
|
||||
<u-navbar :is-back="false" title-color="#ffffff" :background="navbarBg" title="首页">
|
||||
<view class="home-navbar">
|
||||
<view class="slot-wrap">
|
||||
<u-input style="color: #ffffff;" v-model="currentProjectName" :clearable="false" type="select"
|
||||
placeholder="请选择项目" @click="handleShowProjectSelect" />
|
||||
</view>
|
||||
</u-navbar>
|
||||
<view class="home-navbar-title">首页</view>
|
||||
<view class="home-navbar-placeholder"></view>
|
||||
</view>
|
||||
<view class="home-icons">
|
||||
|
||||
<view class="home-icon" @click="handleScan">
|
||||
<u-icon name="saoyisao" custom-prefix="nbd-icon" :size="68" color="#ffffff" />
|
||||
<text>扫一扫</text>
|
||||
</view>
|
||||
<view class="home-icon">
|
||||
<view class="home-icon" @click="handleSkipByPath('/pages/todo/list')">
|
||||
<u-icon name="daiban" custom-prefix="nbd-icon" :size="68" color="#ffffff" />
|
||||
<text>待办</text>
|
||||
</view>
|
||||
@@ -175,15 +177,17 @@
|
||||
const {
|
||||
pastelColors
|
||||
} = menuStore
|
||||
const navbarBg = reactive({
|
||||
backgroundColor: "var(--u-type-primary)"
|
||||
})
|
||||
const projectNameKeyword = ref('')
|
||||
const showProject = ref(false)
|
||||
const showEditQuick = ref(false)
|
||||
|
||||
const currentProjectName = computed(() => currentProject.value?.ProjectName || '')
|
||||
|
||||
const handleSkipByPath = (path)=>{
|
||||
uni.navigateTo({
|
||||
url: path
|
||||
})
|
||||
}
|
||||
const handleSkip = (item) => {
|
||||
if (!currentProject.value.ProjectId) {
|
||||
handleShowProjectSelect()
|
||||
@@ -244,12 +248,15 @@
|
||||
*/
|
||||
const handleScan = () => {
|
||||
uni.scanCode({
|
||||
onlyFromCamera: true,
|
||||
success(res) {
|
||||
console.log('扫码结果:', res)
|
||||
const result = res.result || ''
|
||||
uni.navigateTo({
|
||||
url:scanToSkipUrl(result)
|
||||
})
|
||||
const url = scanToSkipUrl(result)
|
||||
if (url) {
|
||||
uni.navigateTo({ url })
|
||||
} else {
|
||||
uni.showToast({ title: '无法识别的二维码/条形码', icon: 'none' })
|
||||
}
|
||||
},
|
||||
fail(err) {
|
||||
console.error('扫码失败:', err)
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
<view class="user-detail">
|
||||
<text class="user-name">{{ userInfo?.PersonName || '未登录' }}</text>
|
||||
<text class="user-account">账号:{{ userInfo?.Account || '-' }}</text>
|
||||
<text class="user-company">{{ userInfo?.CompanyName || '暂无公司信息' }}</text>
|
||||
<text class="user-phone">{{ userInfo?.Telephone || '暂无手机号' }}</text>
|
||||
<text class="user-company">{{ userInfo?.UnitName || '暂无公司信息' }}</text>
|
||||
<!-- <text class="user-phone">{{ userInfo?.Telephone || '暂无手机号' }}</text> -->
|
||||
</view>
|
||||
</view>
|
||||
<u-button v-if="!token" size="large" shape="circle" @click="goLogin">
|
||||
@@ -28,7 +28,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 功能菜单 -->
|
||||
<view class="menu-list">
|
||||
<!-- <view class="menu-list">
|
||||
<view class="menu-item" @click="handleMenuClick('profile')">
|
||||
<view class="menu-left">
|
||||
<u-icon name="setting" :size="40" color="#2979ff"></u-icon>
|
||||
@@ -52,7 +52,7 @@
|
||||
</view>
|
||||
<u-icon name="arrow-right" :size="28" color="#ccc"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 退出登录 -->
|
||||
<view class="logout-btn" v-if="token">
|
||||
|
||||
@@ -0,0 +1,598 @@
|
||||
<template>
|
||||
<div class="wrap">
|
||||
<div class="content">
|
||||
<!-- 头部统计 -->
|
||||
<div class="list-header">
|
||||
<view class="header-info">
|
||||
<text class="header-title">待办事项(<text class="header-count">{{ itemList.length }}</text>)</text>
|
||||
</view>
|
||||
<view class="refresh-btn" @tap="onRefresh" :class="{ 'is-loading': isRefreshing }">
|
||||
<u-icon name="reload" color="#333" size="20"></u-icon>
|
||||
</view>
|
||||
</div>
|
||||
|
||||
<!-- 加载中 -->
|
||||
<div class="loading-box" v-if="status === -1 && isGet">
|
||||
<u-loading mode="circle" size="32"></u-loading>
|
||||
<p class="loading-text">正在加载...</p>
|
||||
</div>
|
||||
|
||||
<!-- 空状态 -->
|
||||
<div class="empty-box" v-if="status === 0">
|
||||
<view class="empty-illustration">
|
||||
<view class="empty-circle"></view>
|
||||
<view class="empty-icon">📋</view>
|
||||
</view>
|
||||
<p class="empty-title">暂无待办事项</p>
|
||||
<p class="empty-desc">所有任务已处理完毕</p>
|
||||
</div>
|
||||
|
||||
<!-- 列表 -->
|
||||
<div class="list" v-if="status === 1">
|
||||
<div
|
||||
class="list-item"
|
||||
:class="'type-' + getTypeIndex(item.MenuName)"
|
||||
v-for="(item, index) in itemList"
|
||||
:key="index"
|
||||
@click="gotoConfirm"
|
||||
:data-menuid="item.MenuId"
|
||||
:data-id="item.DataId"
|
||||
:data-name="item.MenuName"
|
||||
:data-model="item"
|
||||
:data-url="item.UrlStr"
|
||||
:style="{ animationDelay: (index * 0.05) + 's' }"
|
||||
>
|
||||
<!-- 左侧彩色指示条 -->
|
||||
<view class="item-indicator"></view>
|
||||
|
||||
<!-- 卡片内容 -->
|
||||
<view class="item-content">
|
||||
<!-- 类型图标 + 标题 + 状态 -->
|
||||
<view class="item-header">
|
||||
<view class="item-header-center">
|
||||
<text class="card-title">{{ item.MenuName }}</text>
|
||||
<text class="item-time-compact">{{ formatTimeCompact(item.DataTimeStr) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 内容摘要 -->
|
||||
<view class="item-content-text">{{ item.Content || '--' }}</view>
|
||||
|
||||
<!-- 底部操作 -->
|
||||
<view class="item-footer">
|
||||
<view class="item-meta">
|
||||
<text class="meta-icon">🕐</text>
|
||||
<text class="meta-value">{{ item.DataTimeStr || '--' }}</text>
|
||||
</view>
|
||||
<view class="item-action">
|
||||
<text class="action-text">处理</text>
|
||||
<text class="action-arrow">→</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</div>
|
||||
|
||||
<!-- 加载中提示 -->
|
||||
<div class="load-more" v-if="isGet">
|
||||
<u-loading mode="circle" size="24"></u-loading>
|
||||
<span class="load-more-text">加载中...</span>
|
||||
</div>
|
||||
|
||||
<!-- 无更多 -->
|
||||
<div class="no-more" v-if="isFininsh && !isGet">— 没有更多了 —</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { onShow, onReachBottom } from '@dcloudio/uni-app'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useUserStore } from '@/store'
|
||||
|
||||
const userStore = useUserStore()
|
||||
const { userInfo, currentProject } = storeToRefs(userStore)
|
||||
|
||||
const status = ref(-1)
|
||||
const isFininsh = ref(false)
|
||||
const pageIndex = ref(1)
|
||||
const pageSize = 10
|
||||
const isGet = ref(false)
|
||||
const isRefreshing = ref(false)
|
||||
const itemList = ref([])
|
||||
|
||||
// 类型序号(用于指示条颜色)
|
||||
const typeIndexMap = {
|
||||
'安全确认': 1, '安全检查': 1,
|
||||
'动火作业': 2,
|
||||
'考试计划': 3,
|
||||
'技术交底': 4,
|
||||
'质量验收': 5,
|
||||
'进度确认': 6,
|
||||
'材料进场': 7,
|
||||
'应急预案': 8,
|
||||
'会议通知': 9,
|
||||
}
|
||||
function getTypeIndex(name) {
|
||||
return typeIndexMap[name] || 0
|
||||
}
|
||||
|
||||
// 格式化时间:今天显示 "今天 HH:mm",其他显示 MM-DD
|
||||
function formatTimeCompact(str) {
|
||||
if (!str) return ''
|
||||
const today = new Date()
|
||||
const todayStr = today.getFullYear() + '-' + String(today.getMonth()+1).padStart(2,'0') + '-' + String(today.getDate()).padStart(2,'0')
|
||||
const datePart = str.split(' ')[0] || ''
|
||||
if (datePart === todayStr) return '今天 ' + (str.split(' ')[1] || '')
|
||||
return datePart.slice(5)
|
||||
}
|
||||
|
||||
// 刷新
|
||||
async function onRefresh() {
|
||||
if (isRefreshing.value) return
|
||||
isRefreshing.value = true
|
||||
pageIndex.value = 1
|
||||
isFininsh.value = false
|
||||
itemList.value = []
|
||||
await getList()
|
||||
isRefreshing.value = false
|
||||
}
|
||||
|
||||
// ===== 模拟数据(开发调试用,上线前改为 false) =====
|
||||
const USE_MOCK = true
|
||||
|
||||
const mockData = [
|
||||
{
|
||||
MenuId: 'M001',
|
||||
DataId: 'D001',
|
||||
MenuName: '安全确认',
|
||||
Content: '今日需要对3号楼脚手架搭设进行安全验收检查,确保符合规范要求',
|
||||
DataTimeStr: '2026-06-13 09:30',
|
||||
UrlStr: '/pages/grow/safe_confirm/main'
|
||||
},
|
||||
{
|
||||
MenuId: 'M002',
|
||||
DataId: 'D002',
|
||||
MenuName: '动火作业',
|
||||
Content: '1号楼地下室管道焊接动火申请,需确认消防设施配备齐全',
|
||||
DataTimeStr: '2026-06-13 10:15',
|
||||
UrlStr: '/pages/job_info/dh_approval/main'
|
||||
},
|
||||
{
|
||||
MenuId: 'M003',
|
||||
DataId: 'D003',
|
||||
MenuName: '考试计划',
|
||||
Content: '本月特种作业人员安全资格考试安排,请相关人员准时参加',
|
||||
DataTimeStr: '2026-06-12 14:00',
|
||||
UrlStr: '/pages/train_task/test_list/main'
|
||||
},
|
||||
{
|
||||
MenuId: 'M004',
|
||||
DataId: 'D004',
|
||||
MenuName: '安全检查',
|
||||
Content: '现场临时用电安全检查,重点排查配电箱接地保护和漏保动作电流',
|
||||
DataTimeStr: '2026-06-12 11:20',
|
||||
UrlStr: '/pages/grow/safe_confirm/main'
|
||||
},
|
||||
{
|
||||
MenuId: 'M005',
|
||||
DataId: 'D005',
|
||||
MenuName: '技术交底',
|
||||
Content: '基础底板大体积混凝土浇筑技术交底,注意温控措施和养护方案',
|
||||
DataTimeStr: '2026-06-11 16:45',
|
||||
UrlStr: '/pages/grow/safe_confirm/main'
|
||||
},
|
||||
{
|
||||
MenuId: 'M006',
|
||||
DataId: 'D006',
|
||||
MenuName: '质量验收',
|
||||
Content: '2号楼三层梁板钢筋隐蔽验收,检查钢筋规格、间距和锚固长度',
|
||||
DataTimeStr: '2026-06-11 15:30',
|
||||
UrlStr: '/pages/grow/safe_confirm/main'
|
||||
},
|
||||
{
|
||||
MenuId: 'M007',
|
||||
DataId: 'D007',
|
||||
MenuName: '进度确认',
|
||||
Content: '本月施工进度计划确认,包括主体结构、装饰装修和机电安装',
|
||||
DataTimeStr: '2026-06-11 09:00',
|
||||
UrlStr: '/pages/grow/safe_confirm/main'
|
||||
},
|
||||
{
|
||||
MenuId: 'M008',
|
||||
DataId: 'D008',
|
||||
MenuName: '材料进场',
|
||||
Content: 'HRB400E螺纹钢20mm进场验收,需核对材质证明和复试报告',
|
||||
DataTimeStr: '2026-06-10 13:20',
|
||||
UrlStr: '/pages/grow/safe_confirm/main'
|
||||
},
|
||||
{
|
||||
MenuId: 'M009',
|
||||
DataId: 'D009',
|
||||
MenuName: '应急预案',
|
||||
Content: '汛期防汛应急演练方案审批,请相关负责人审阅确认',
|
||||
DataTimeStr: '2026-06-10 10:50',
|
||||
UrlStr: '/pages/grow/safe_confirm/main'
|
||||
},
|
||||
{
|
||||
MenuId: 'M010',
|
||||
DataId: 'D010',
|
||||
MenuName: '会议通知',
|
||||
Content: '本周三下午3点召开项目周例会,请各部门负责人准时参会',
|
||||
DataTimeStr: '2026-06-10 08:30',
|
||||
UrlStr: '/pages/grow/safe_confirm/main'
|
||||
}
|
||||
]
|
||||
// ================================================
|
||||
|
||||
// 获取列表
|
||||
async function getList() {
|
||||
if (isGet.value) return
|
||||
isGet.value = true
|
||||
try {
|
||||
let list = []
|
||||
|
||||
if (USE_MOCK) {
|
||||
// 模拟网络延迟
|
||||
await new Promise(r => setTimeout(r, 600))
|
||||
const start = (pageIndex.value - 1) * pageSize
|
||||
const end = start + pageSize
|
||||
list = mockData.slice(start, end)
|
||||
} else {
|
||||
const UserId = userInfo.value?.PersonId || uni.getStorageSync('UserId') || ''
|
||||
const res = await reqToDoItemByProjectIdUserId(currentProject.value?.ProjectId, UserId)
|
||||
list = res?.data?.getDataList || []
|
||||
}
|
||||
|
||||
if (pageIndex.value === 1 && list.length === 0) {
|
||||
status.value = 0
|
||||
isGet.value = false
|
||||
return
|
||||
}
|
||||
|
||||
itemList.value = itemList.value.concat(list)
|
||||
status.value = 1
|
||||
pageIndex.value++
|
||||
isFininsh.value = list.length < pageSize
|
||||
} catch (e) {
|
||||
console.error('获取待办列表失败', e)
|
||||
status.value = 0
|
||||
}
|
||||
isGet.value = false
|
||||
}
|
||||
|
||||
// 点击列表项 → 直接跳转
|
||||
function gotoConfirm(e) {
|
||||
const dataset = e.mp?.currentTarget?.dataset || {}
|
||||
const { id, url, menuid } = dataset
|
||||
if (!url) return
|
||||
uni.navigateTo({ url: `${url}?id=${id}&menuId=${menuid}` })
|
||||
}
|
||||
|
||||
// 页面生命周期
|
||||
onShow(() => {
|
||||
status.value = -1
|
||||
isFininsh.value = false
|
||||
itemList.value = []
|
||||
pageIndex.value = 1
|
||||
isGet.value = false
|
||||
getList()
|
||||
})
|
||||
|
||||
onReachBottom(() => {
|
||||
if (isFininsh.value) return
|
||||
getList()
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
console.log('safeid', currentProject.value)
|
||||
// onShow 可能未触发时兜底加载
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #f5f6f8;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.wrap {
|
||||
min-height: 100vh;
|
||||
padding-bottom: 180rpx;
|
||||
background: #f5f6f8;
|
||||
}
|
||||
|
||||
/* ========== 头部统计 ========== */
|
||||
.list-header {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 99;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 32rpx;
|
||||
height: 96rpx;
|
||||
background: #fff;
|
||||
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);
|
||||
|
||||
.header-info {
|
||||
.header-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
|
||||
.header-count {
|
||||
color: #3577ff;
|
||||
font-weight: 700;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.refresh-btn {
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #f5f6f8;
|
||||
border-radius: 50%;
|
||||
|
||||
&.is-loading {
|
||||
animation: rotate 0.8s linear infinite;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ========== 列表容器 ========== */
|
||||
.list {
|
||||
padding: 24rpx 24rpx 40rpx;
|
||||
padding-top: 130rpx; // 固定头部高度
|
||||
}
|
||||
|
||||
/* ========== 列表项卡片 ========== */
|
||||
.list-item {
|
||||
position: relative;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
|
||||
overflow: hidden;
|
||||
transition: all 0.2s ease;
|
||||
animation: card-in 0.4s ease both;
|
||||
|
||||
&:active {
|
||||
transform: scale(0.97);
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* 左侧彩色指示条 */
|
||||
.item-indicator {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 8rpx;
|
||||
background: linear-gradient(180deg, #3577ff 0%, #6366f1 100%);
|
||||
}
|
||||
|
||||
.type-1 .item-indicator { background: linear-gradient(180deg, #ff4d4f 0%, #ff7a45 100%); }
|
||||
.type-2 .item-indicator { background: linear-gradient(180deg, #ff4d4f 0%, #ff7a45 100%); }
|
||||
.type-3 .item-indicator { background: linear-gradient(180deg, #3577ff 0%, #6366f1 100%); }
|
||||
.type-4 .item-indicator { background: linear-gradient(180deg, #13c2c2 0%, #36cfc9 100%); }
|
||||
.type-5 .item-indicator { background: linear-gradient(180deg, #52c41a 0%, #73d13d 100%); }
|
||||
.type-6 .item-indicator { background: linear-gradient(180deg, #fa8c16 0%, #ffc53d 100%); }
|
||||
.type-7 .item-indicator { background: linear-gradient(180deg, #722ed1 0%, #9254de 100%); }
|
||||
.type-8 .item-indicator { background: linear-gradient(180deg, #eb2f96 0%, #f759ab 100%); }
|
||||
.type-9 .item-indicator { background: linear-gradient(180deg, #1890ff 0%, #40a9ff 100%); }
|
||||
.type-0 .item-indicator { background: linear-gradient(180deg, #999 0%, #bbb 100%); }
|
||||
|
||||
/* 卡片内容区 */
|
||||
.item-content {
|
||||
padding: 28rpx 28rpx 28rpx 36rpx;
|
||||
}
|
||||
|
||||
/* 头部:图标 + 标题 + 状态 */
|
||||
.item-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.item-header-center {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.card-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 4rpx;
|
||||
}
|
||||
|
||||
.item-time-compact {
|
||||
font-size: 22rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.card-status {
|
||||
font-size: 22rpx;
|
||||
padding: 6rpx 16rpx;
|
||||
border-radius: 20rpx;
|
||||
font-weight: 500;
|
||||
flex-shrink: 0;
|
||||
|
||||
&.pending {
|
||||
background: rgba(255, 167, 38, 0.1);
|
||||
color: #ffa726;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 内容摘要 */
|
||||
.item-content-text {
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
line-height: 1.7;
|
||||
margin-bottom: 20rpx;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
/* 底部操作区 */
|
||||
.item-footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.item-meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.meta-icon {
|
||||
font-size: 24rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
|
||||
.meta-value {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.item-action {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 10rpx 24rpx;
|
||||
background: linear-gradient(135deg, #3577ff 0%, #6366f1 100%);
|
||||
border-radius: 24rpx;
|
||||
|
||||
.action-text {
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
font-weight: 500;
|
||||
margin-right: 6rpx;
|
||||
}
|
||||
|
||||
.action-arrow {
|
||||
font-size: 26rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ========== 加载中 ========== */
|
||||
.loading-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 200rpx 0;
|
||||
|
||||
.loading-text {
|
||||
margin-top: 24rpx;
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.load-more {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 32rpx 0;
|
||||
|
||||
.load-more-text {
|
||||
margin-left: 16rpx;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
/* ========== 空状态 ========== */
|
||||
.empty-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 200rpx 0;
|
||||
|
||||
.empty-illustration {
|
||||
position: relative;
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
margin-bottom: 48rpx;
|
||||
|
||||
.empty-circle {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
background: linear-gradient(135deg, rgba(53, 119, 255, 0.08), rgba(99, 102, 241, 0.08));
|
||||
}
|
||||
|
||||
.empty-icon {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 80rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.empty-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.empty-desc {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
/* ========== 无更多 ========== */
|
||||
.no-more {
|
||||
text-align: center;
|
||||
padding: 40rpx 0;
|
||||
font-size: 24rpx;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
/* ========== 卡片入场动画 ========== */
|
||||
@keyframes card-in {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(20rpx);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
/* ========== 旋转动画 ========== */
|
||||
@keyframes rotate {
|
||||
from { transform: rotate(0deg); }
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
</style>
|
||||
@@ -1,140 +0,0 @@
|
||||
<template>
|
||||
<view class="page-detail">
|
||||
<!-- 基本信息 -->
|
||||
<view class="info-group">
|
||||
<!-- 车次 -->
|
||||
<view class="info-item">
|
||||
<text class="info-label" v-if="isEdit"><text class="required">*</text>车次</text>
|
||||
<text class="info-label" v-else>车次</text>
|
||||
<view v-if="isEdit" class="info-input-wrap">
|
||||
<u-input v-model="form.TrainNumber" placeholder="请输入" />
|
||||
</view>
|
||||
<text class="info-value" v-else>{{ form.TrainNumber || '--' }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 单位名称 -->
|
||||
<view class="info-item">
|
||||
<text class="info-label" v-if="isEdit"><text class="required">*</text>单位名称</text>
|
||||
<text class="info-label" v-else>单位名称</text>
|
||||
<view v-if="isEdit" class="info-input-wrap">
|
||||
<u-input v-model="form.UnitName" :clearable="false" type="select" placeholder="请选择" @click="handleShowUnit" />
|
||||
</view>
|
||||
<text class="info-value" v-else>{{ form.UnitName || '--' }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 驾驶员姓名 -->
|
||||
<view class="info-item">
|
||||
<text class="info-label" v-if="isEdit"><text class="required">*</text>驾驶员姓名</text>
|
||||
<text class="info-label" v-else>驾驶员姓名</text>
|
||||
<view v-if="isEdit" class="info-input-wrap">
|
||||
<u-input v-model="form.DriverName" placeholder="请输入" />
|
||||
</view>
|
||||
<text class="info-value" v-else>{{ form.DriverName || '--' }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 驾驶员电话 -->
|
||||
<view class="info-item">
|
||||
<text class="info-label" v-if="isEdit"><text class="required">*</text>驾驶员电话</text>
|
||||
<text class="info-label" v-else>驾驶员电话</text>
|
||||
<view v-if="isEdit" class="info-input-wrap">
|
||||
<u-input v-model="form.DriverPhone" placeholder="请输入" type="number" />
|
||||
</view>
|
||||
<text class="info-value" v-else>{{ form.DriverPhone || '--' }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 车牌号 -->
|
||||
<view class="info-item">
|
||||
<text class="info-label" v-if="isEdit"><text class="required">*</text>车牌号</text>
|
||||
<text class="info-label" v-else>车牌号</text>
|
||||
<view v-if="isEdit" class="info-input-wrap">
|
||||
<u-input v-model="form.LicensePlateNumber" placeholder="请输入" />
|
||||
</view>
|
||||
<text class="info-value" v-else>{{ form.LicensePlateNumber || '--' }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 联系人姓名 -->
|
||||
<view class="info-item">
|
||||
<text class="info-label" v-if="isEdit"><text class="required">*</text>联系人姓名</text>
|
||||
<text class="info-label" v-else>联系人姓名</text>
|
||||
<view v-if="isEdit" class="info-input-wrap">
|
||||
<u-input v-model="form.ContactName" placeholder="请输入" />
|
||||
</view>
|
||||
<text class="info-value" v-else>{{ form.ContactName || '--' }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 联系人电话 -->
|
||||
<view class="info-item">
|
||||
<text class="info-label" v-if="isEdit"><text class="required">*</text>联系人电话</text>
|
||||
<text class="info-label" v-else>联系人电话</text>
|
||||
<view v-if="isEdit" class="info-input-wrap">
|
||||
<u-input v-model="form.ContactPhone" placeholder="请输入" type="number" />
|
||||
</view>
|
||||
<text class="info-value" v-else>{{ form.ContactPhone || '--' }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 备注 -->
|
||||
<view class="info-item">
|
||||
<text class="info-label">备注</text>
|
||||
<view v-if="isEdit" class="info-input-wrap">
|
||||
<u-input v-model="form.Remark" placeholder="请输入" type="textarea" />
|
||||
</view>
|
||||
<text class="info-value" v-else>{{ form.Remark || '--' }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 状态 -->
|
||||
<view class="info-item">
|
||||
<text class="info-label">状态</text>
|
||||
<text class="info-value">{{ form.StateName || '--' }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 扫码添加 -->
|
||||
<view class="info-item info-link" v-if="form.TrainNumberId && isEdit" @click="handleScan">
|
||||
<text class="info-label">扫码添加</text>
|
||||
<view class="scan-icon">
|
||||
<u-icon name="scan" :size="36" color="#3577FF"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 包装列表 -->
|
||||
<view class="package-group" v-if="form.TrainNumberId">
|
||||
<view class="section-title">
|
||||
<text>包装列表</text>
|
||||
<text class="section-count">({{ BZList.length }})</text>
|
||||
</view>
|
||||
<view v-for="(item, index) in BZList" :key="index" class="package-card">
|
||||
<view class="card-header">
|
||||
<text class="card-title">{{ item.PackagingCode || '--' }}</text>
|
||||
<view class="del-btn" @click="handleDeletePackage(item)" v-if="isEdit">
|
||||
<u-icon name="trash" :size="36" color="#ffffff"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-body">
|
||||
<view class="card-row">
|
||||
<text class="row-label">预制工作包</text>
|
||||
<text class="row-value">{{ item.StackingPosition || '--' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="BZList.length === 0" class="package-empty">
|
||||
<u-empty text="暂无数据" mode="list"></u-empty>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部按钮 -->
|
||||
<view class="bottom-btns" v-if="isEdit">
|
||||
<u-button size="medium" type="primary" :disabled="disabledBtn" @click="handleSave(0)">保存</u-button>
|
||||
<u-button size="medium" type="success" :disabled="disabledBtn" @click="handleSave(1)">发货</u-button>
|
||||
</view>
|
||||
<view class="bottom-btns" v-if="form.State === 1">
|
||||
<u-button size="medium" type="warning" :disabled="disabledBtn" @click="handleSign">签收</u-button>
|
||||
</view>
|
||||
|
||||
<!-- 单位选择弹窗 -->
|
||||
<nbd-select v-model="showUnitSelect" v-model:model="selectedUnit" :show-search="true" title="选择单位"
|
||||
:list="unitList" label-key="UnitName" value-key="UnitId" @confirm="handleUnitConfirm" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
</script>
|
||||
+20
-15
@@ -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 || '操作失败',
|
||||
|
||||
@@ -141,3 +141,10 @@
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.list-item .item-title {
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
|
||||
+237
-17
@@ -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
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<template>
|
||||
|
||||
</template>
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
@@ -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
|
||||
}
|
||||
|
||||
+15
-12
@@ -13,8 +13,8 @@ export const useUserStore = defineStore('user', () => {
|
||||
const token = ref("")
|
||||
const userInfo = ref(null)
|
||||
const loginForm = ref({
|
||||
account: 'hfnbd',
|
||||
password: '1111',
|
||||
account: '',
|
||||
password: '',
|
||||
Telephone: '',
|
||||
})
|
||||
|
||||
@@ -51,17 +51,20 @@ export const useUserStore = defineStore('user', () => {
|
||||
const fetchLogin = async () => {
|
||||
try {
|
||||
let res = await reqLogin(loginForm.value)
|
||||
userInfo.value = res.data
|
||||
token.value = res.data?.PersonId
|
||||
currentProject.value = {
|
||||
ProjectId: res.data?.LoginProjectId,
|
||||
ProjectName: res.data?.LoginProjectName
|
||||
if(res.data){
|
||||
userInfo.value = res.data
|
||||
token.value = res.data?.PersonId
|
||||
currentProject.value = {
|
||||
ProjectId: res.data?.LoginProjectId,
|
||||
ProjectName: res.data?.LoginProjectName
|
||||
}
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}, 900)
|
||||
}
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}, 900)
|
||||
|
||||
} catch (err) {
|
||||
|
||||
}
|
||||
|
||||
+2
-1
@@ -1,7 +1,7 @@
|
||||
import { useUserStore } from '@/store'
|
||||
|
||||
// TODO: 替换为实际的 API 地址
|
||||
export const baseUrl = 'https://sggl.sedin.com.cn/sgglapi/api/'
|
||||
export const baseUrl = 'https://lygcgs.com.cn:8078/shjapi/api/'
|
||||
|
||||
// ===== 防止重复请求 =====
|
||||
const pendingRequests = new Map()
|
||||
@@ -129,6 +129,7 @@ export function request(options) {
|
||||
},
|
||||
fail: (err) => {
|
||||
removePending(finalConfig) // 网络失败也要清理标识
|
||||
uni.hideLoading()
|
||||
uni.showToast({ title: '网络连接失败', icon: 'none' })
|
||||
reject(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user