| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <template>
- <view class="repair-page">
- <navigation title="设备报修"></navigation>
- <view class="list-box" v-if="dataList.length>0">
- <view class="add" @click="addInfo">
- <image class="icon" src="@/static/add.jpg"></image>
- <view class="text">新增</view>
- </view>
- <view class="list-item" v-for="(item, index) in dataList" :key="index">
- <view class="item-text">工单编号:{{ item.num || '-' }}</view>
- <view class="item-text">设备名称:{{ item.equipmentName || '-' }}</view>
- <view class="item-text">工单描述:{{ item.orderMsg || '-' }}</view>
- <view class="item-text">提交人:{{ item.createUserName || '-' }}</view>
- <view class="item-text">发生时间:{{ item.happenTime || '-' }}</view>
- <view class="btn-box">
- <view class="btn-item" @click="toDetail(item.id)">
- <view>详情</view>
- </view>
- </view>
- </view>
- </view>
- <empty v-else text="暂无报修数据" :showBtn="true" @onAdd="addInfo"></empty>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- dataList: [],
- userId: uni.getStorageSync('userInfo').id
- }
- },
- onShow() {
- this.getList()
- },
- methods: {
- getList() {
- uni.showLoading({
- title: '正在加载...'
- })
- this.$api.workOrderList({
- createUserId: this.userId
- }).then(res => {
- this.dataList = res.rows
- uni.hideLoading()
- }).catch(err => {})
- },
- addInfo() {
- uni.navigateTo({
- url: '/subPackages/repair/add'
- });
- },
- toDetail(id) {
- uni.navigateTo({
- url: '/subPackages/repair/detail?id=' + id
- });
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .repair-page {
- .add {
- display: flex;
- justify-content: center;
- align-items: center;
- background-color: #fff;
- padding: 20rpx;
- border-radius: 16rpx;
- .icon {
- width: 50rpx;
- height: 50rpx;
- margin-right: 16rpx;
- }
- }
- .list-box {
- padding: 0 20rpx;
- color: $uni-text-color-list;
- .list-item {
- background-color: $uni-bg-color;
- padding: 20rpx;
- border-radius: 20rpx;
- margin-top: 28rpx;
- .item-text {
- margin-top: 10rpx;
- }
- }
- .btn-box {
- display: flex;
- justify-content: flex-end;
- margin-top: 10rpx;
- .btn-item {
- width: 175rpx;
- height: 50rpx;
- line-height: 50rpx;
- text-align: center;
- border-radius: 24rpx;
- margin-left: 20rpx;
- border: 1px solid #43adfd;
- color: #43adfd;
- }
- }
- }
- }
- </style>
|