123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319 |
- <template>
- <scroll-view class="container">
- <!-- Banner -->
- <view class="banner">
- <text class="banner-title">关键工序</text>
- </view>
- <view class="card-list" style="flex-direction: row;">
- <uni-tag
- v-for="(tag,index) in 6" :key="index"
- :text="tag +''"
- size="medium"
- type="primary"
- circle
- @click="tabsClick(tag)"
- style="width:40rpx;margin: 0 10rpx;"
- ></uni-tag>
- </view>
- <!-- 检查报告卡片列表 -->
- <view v-if="processList.length" class="card-list">
- <view class="card card-view" v-for="item in processList" :key="item.id" v-show="current == item.id">
- <view class="divider"></view>
- <view class="info-row">
- <text class="label info-text">序号</text>
- <view class="value info-text">
- <uni-number-box v-model="item.id" disabled></uni-number-box>
- </view>
- </view>
- <view class="info-row">
- <text class="label info-text">产品码</text>
- <view class="value info-text">
- <input
- v-model="item.productcode"
- class="surround"
- disabled
- ></input>
- </view>
- </view>
- <view class="info-row">
- <text class="label info-text">检测项目</text>
- <view class="value info-text">
- <input
- v-model="item.invname"
- class="surround"
- disabled
- ></input>
- </view>
- </view>
- <view class="info-row">
- <text class="label info-text">分类</text>
- <view class="value info-text">
- <input
- v-model="item.model"
- class="surround"
- disabled
- ></input>
- </view>
- </view>
- <view class="info-row">
- <text class="label info-text">上限要求</text>
- <view class="value info-text">
- <uni-number-box v-model="item.upperlimit" :step="0.1" :min="0.5" disabled></uni-number-box>
- </view>
- </view>
- <view class="info-row">
- <text class="label info-text">下限要求</text>
- <view class="value info-text">
- <uni-number-box v-model="item.lowerlimit" :min="0" disabled></uni-number-box>
- </view>
- </view>
-
- <view class="divider"></view>
- <view class="info-row">
- <text class="label info-text">实测值小</text>
- <view class="value info-text">
- <uni-number-box v-model="item.minactval" :min="0" ></uni-number-box>
- </view>
- </view>
- <view class="info-row">
- <text class="label info-text">实测值大</text>
- <view class="value info-text">
- <uni-number-box v-model="item.maxactval" :min="0" ></uni-number-box>
- </view>
- </view>
- <view class="info-row">
- <text class="label info-text">结论</text>
- <view class="value info-text">
- <input
- v-model="item.conclusion"
- class="surround"
- ></input>
- </view>
- </view>
- </view>
- </view>
- <!-- 空状态 -->
- <view v-else class="empty-card">
- <image src="/static/image/empty.png" class="empty-img" />
- <text class="empty-text">暂无检查检验记录</text>
- </view>
- </scroll-view>
- </template>
- <script setup>
- import {
- ref
- } from 'vue'
-
- type Process = {
- id: number,
- productcode: string,
- invname: string,
- model: string,
- upperlimit: number,
- lowerlimit: number,
- minactval: number,
- maxactval: number,
- conclusion: string,
- applyDate: string,
- reportDate: string
- }
-
- var current = ref(1)
- var processList = ref<Process[]>([])
-
- const initProcessList = [{
- id: 1,
- productcode:"YH0001",
- invname: '对称度',
- model: '重要尺寸',
- upperlimit:0.5,
- lowerlimit:0,
- minactval:0,
- maxactval:0,
- conclusion:'',
- applyDate: '2025-08-20 09:15',
- reportDate: '2025-08-20 17:30'
- },
- {
- id: 2,
- productcode:"YH0001",
- invname: '对称度',
- model: '重要尺寸',
- upperlimit:0.5,
- lowerlimit:0,
- minactval:0,
- maxactval:0,
- conclusion:'',
- applyDate: '2025-08-28 10:00',
- reportDate: '2025-08-28 13:40'
- }
- ] as Process[];
-
- processList.value = initProcessList.filter(item=>item.id == current.value);
- const tabsClick = (obj: number) =>{
- current.value = obj
- processList.value = initProcessList.filter(item=>item.id == current.value)
- }
-
- </script>
- <style scoped>
- .container {
- padding: 40rpx;
- background-color: #f5f7fa;
- height: 100%;
- box-sizing: border-box;
- }
- .banner {
- background: linear-gradient(135deg, #6dd5ed, #2193b0);
- border-radius: 24rpx;
- padding: 40rpx 30rpx;
- margin-bottom: 40rpx;
- box-shadow: 0 8rpx 16rpx rgba(33, 147, 176, 0.3);
- }
- .banner-title {
- color: white;
- font-size: 36rpx;
- font-weight: bold;
- text-align: center;
- }
-
- .box{
- width: 40rpx;
- background-color: #909193;
- border-radius: 15rpx;
- }
- .card-list {
- display: flex;
- flex-direction: column;
- }
- .card-list .card-view {
- margin-bottom: 30rpx;
- }
-
- .card {
- background-color: white;
- border-radius: 20rpx;
- padding: 30rpx;
- box-shadow: 0 6rpx 20rpx rgba(0, 0, 0, 0.05);
- display: flex;
- flex-direction: column;
- }
- .card-header {
- display: flex;
- align-items: center;
- margin-bottom: 20rpx;
- }
- .card-icon {
- width: 64rpx;
- height: 64rpx;
- margin-right: 20rpx;
- border-radius: 12rpx;
- background-color: #eef5ff;
- padding: 10rpx;
- }
- .info-row {
- display: flex;
- flex-direction: row;
- /* #ifdef APP-NVUE */
- font-size: 28rpx;
- color: #33475b;
- /* #endif */
- align-items: center;
- padding: 20rpx;
- }
- .info-row .info-text {
- margin-right: 10rpx;
- }
-
- .label {
- font-weight: bold;
- color: #102a43;
- min-width: 150rpx;
- }
-
- .value {
- flex: 1;
- /* #ifdef APP-NVUE */
- white-space: nowrap;
- text-overflow: ellipsis;
- /* #endif */
- overflow: hidden;
- }
- .divider {
- height: 1px;
- background-color: #eee;
- margin: 20rpx 0;
- }
- .card-info {
- font-size: 28rpx;
- color: #666;
- line-height: 1.6;
- display: flex;
- flex-direction: column;
- }
- .card-info .card-info-view {
- margin-bottom: 10rpx;
- }
-
- .btn-group {
- display: flex;
- justify-content: flex-end;
- margin-top: 20rpx;
- }
- .main-btn {
- font-size: 28rpx;
- color: white;
- border: none;
- border-radius: 100rpx;
- background: linear-gradient(to right, #36d1dc, #5b86e5);
- box-shadow: 0 6rpx 16rpx rgba(91, 134, 229, 0.3);
- /* #ifndef APP-ANDROID */
- transition: all 0.2s ease-in-out;
- /* #endif */
- }
- /* #ifndef APP-ANDROID */
- .main-btn:active {
- opacity: 0.9;
- transform: scale(0.98);
- }
- /* #endif */
- .empty-card {
- background-color: white;
- border-radius: 20rpx;
- padding: 60rpx 30rpx;
- box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.05);
- text-align: center;
- margin-top: 100rpx;
- }
- .empty-img {
- width: 180rpx;
- height: 180rpx;
- margin-bottom: 30rpx;
- opacity: 0.8;
- }
- .empty-text {
- font-size: 30rpx;
- color: #999;
- }
- .surround {
- border: 1px solid silver;
- border-radius: 10rpx;
- }
- </style>
|