zs
2025-05-14 3ec65a96dd073e598e58c12fb0b5af31e38bc20e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<template>
    <u-swipe-action  v-if="materialData.length>0">
        <u-swipe-action-item :options="options" v-for="(item,index) in materialData"
                    :key="'material-list-item-'+index" style="margin-bottom: 20rpx;"
                    @click="deleteItem" :index="index" :name="item.materialId">
            <view class="material-item-group">
                <view class="material-list-item" >
                    <!-- <view class="close-btn">
                        <view class="icon-layer"><u-icon name="close" color="#ffffff" size="24" /></view>
                    </view> -->
                    <view class="badge-box"><u-badge :value="index+1" bg-color="#F18201" /></view>
                    <view class="item-row">
                        <view class="label">物料唯一码:</view>
                        <view class="content auto-wrap">{{item.materialId}}</view>
                    </view>
                    <view class="item-row">
                        <view class="label">物料名称:</view>
                        <view class="content auto-wrap">{{item.materialName}}</view>
                    </view>
                    <view class="item-row">
                        <view class="label">件号:</view>
                        <view class="content auto-wrap">{{item.materialNo}}</view>
                    </view>
                    <view class="item-row">
                        <view class="label">供应商:</view>
                        <view class="content auto-wrap">{{item.supplierCode}}</view>
                    </view>
 
                    <view class="item-row">
                        <view class="label">物料类型:</view>
<!-- 枚举 -->
                        <view class="content auto-wrap">{{parseDic($store,'material_type',item.materialType)}}</view>
 
                    </view>
 
                    <!-- <view class="item-row">
                        <view class="label">规格:</view>
                        <view class="content auto-wrap">{{item.materialSpec}}</view>
                    </view> -->
                    <view class="item-row">
                        <view class="label">机型:</view>
                        <view class="content auto-wrap">{{parseDic($store,'material_modal',item.materialModel)}}</view>
                    </view>
                    <!-- <view class="item-row">
                        <view class="label">数量:</view>
                        <view class="content auto-wrap">{{item.stockNumber}}</view>
                    </view> -->
                </view>
            </view>
        </u-swipe-action-item>
    </u-swipe-action>
</template>
 
<script>
    import {parseDic} from '@/static/js/utils/index.js'
    export default {
        props: {
            materialData: {
                type: Array,
                default: () => []
            },
            // materialModalData:{
            //     type: Array,
            //     default: () => []
            // }
        },
        data() {
            return {
                options: [{
                    text: '删除',
                    style:{
                        backgroundColor: '#F18202'
                    }
                }],
                materialModalData:[]
            }
        },
        // created(){
        //     this.materialModalData=getDicList(this.$store,'material_modal')?.sysDictDatas
        //     console.log(this.materialModalData);
        // },
        methods:{
            parseDic,
            deleteItem({name}){
                this.$emit('delMaterialData',name)
            }
        }
    }
</script>
 
<style scoped lang="scss">
    .material-item-group {
        /* background-color: transparent!impor; */
        padding-top: 10rpx;
 
        .material-list-item {
            border-bottom: 2rpx solid $uni-border-color;
            padding-bottom: 10rpx;
            padding-left: 60rpx;
            /* margin-bottom: 10rpx; */
            position: relative;
 
            &:last-child {
                border-bottom: 0;
            }
 
            .item-row {
                display: flex;
 
                .label {
                    flex-shrink: 0;
                    color: #000;
                    /* text-align: right; */
                    /* font-weight:5; */
                    width: 180rpx;
                }
 
                &>.content {
                    flex-grow: 1;
                    color: $u-content-color;
 
                    uni-input {
                        font: inherit;
                        color: $u-primary;
                        text-decoration: underline;
                    }
                }
            }
 
            .badge-box {
                position: absolute;
                top: 8rpx;
                left: 8rpx;
                z-index: 1;
            }
 
            .close-btn {
                $closeBtnSize: 70rpx;
                width: $closeBtnSize;
                height: $closeBtnSize;
                z-index: 1;
                position: absolute;
                top: 0rpx;
                right: 8rpx;
                background-color: $u-error;
                opacity: 0.6;
                border-radius: 25rpx;
 
                .icon-layer {
                    position: absolute;
                    width: 100%;
                    height: 100%;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    z-index: 2;
                }
            }
        }
    }
</style>