实现效果图如下:
代码如下:
<template>
<view class="container">
<u-steps dot direction="column" current="2" class="stepbox">
<u-steps-item v-for="(item,index) in stepList" :key="index">
<view class="topbox" slot="desc">
<view class="stepTitle">
<view :class="item.stat=='0'?'textColor':'textColore'">{{item.statVal}}</view>
<view>{{item.date}}</view>
</view>
<view class="itembox">
<view class="d-flex u-flex-row justify-content-between">
<view>{{item.workName}}</view>
<view>{{item.operate}}</view>
</view>
<view class="font-size-sm text-color-assist item">
<view>产品编号{{item.productNum}} </view>
<view>良品数量:<text>{{item.goodNum}}</text> / 不良品数量: <text>{{item.defectNum}}</text></view>
<view>不良原因:{{item.reason}}</view>
</view>
</view>
</view>
</u-steps-item>
</u-steps>
</view>
</template>
目前采用的是本地测试数据,具体可根据自己需求来改:
<script>
export default {
data() {
return {
stepList: [{
id: '0',
state: '备料中',
date: '2023.04.11 10:22:01',
workName: '操作工A',
operate: '备料',
productNum: '2013ASDE433dd',
goodNum: "200",
defectNum: '50',
reason: '设备维修中'
},
{
id: '1',
state: '已跟进',
date: '2023.06.22 11:32:45',
workName: '操作工A',
operate: '投料',
productNum: '2013ASDE433dd',
goodNum: "200",
defectNum: '50',
reason: '人员不足'
},
{
id: '2',
state: '操作中',
date: '2023.08.04 13:01:31',
workName: '搅拌',
operate: '下料',
productNum: '2013ASDE433dd',
goodNum: "200",
defectNum: '50',
reason: '设备数量过少'
},
{
id: '3',
state: '已完结',
date: '2023.09.20 08:10:28',
workName: '操作工A',
operate: '称量',
productNum: '2013ASDE433dd',
goodNum: "200",
defectNum: '50',
reason: '人员不足'
},
],
}
}
}
</script>
<style lang="scss" scoped>
.container {
width: 100%;
box-sizing: border-box;
.title{
background: #fff;
line-height: 80rpx;
padding-left: 20rpx;
}
.stepbox{
padding: 40rpx;
.topbox {
width: 100%;
.stepTitle {
display: flex;
flex-direction: row;
justify-content: space-between;
font-size: 26rpx;
.textColor {
color: #307AF0;
}
.textColore {
color: #333333;
}
}
.itembox {
width: 550rpx;
background: #fff;
margin: 20rpx;
display: flex;
flex-direction: column;
border-radius: 20rpx;
padding: 30rpx 70rpx 30rpx 30rpx;
.item {
margin-top: 20rpx;
line-height: 50rpx;
text {
color: blue;
margin-right: 6rpx;
}
}
}
}
}
}
::v-deep .u-steps-item__wrapper {
background: #E2E7F5;
border-radius: 30rpx;
}
</style>