schangxiang@126.com
2024-08-31 459a62207a0a8ee406c233f8edf9f7ee88a5bbe2
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
<template>
    <u-swipe-action>
        <u-swipe-action-item v-for="(item,index) in workPieceData" :key="index" :options="options" 
            :name="index" @click="actionClick" style="margin-bottom: 10rpx;background-color: #fff;">
        <view class="content" >
            <view class="content_flex">
                <view class="flex_index">{{workPieceData.length-index}}</view>
                <view class="flex_code">成品码: {{item.oP80NewCode}}</view>
                <!-- <view class="flex_status">{{item.qualityStateName}}</view> -->
            </view>
            <!-- <view class="content_flex">
                <view class="flex_color" style="width: 100%;">工件号: {{item.workPieceID}}</view>
            </view>
            <view class="content_flex">
                <view class="flex_color" style="width: 100%;">工件状态: {{item.workPieceStateName}}</view>
            </view>
            <view class="content_flex">
                <view class="flex_color" style="width: 100%;">当前工序: {{item.workingProcedureCurrent}}</view>
            </view>
            <view class="content_flex">
                <view class="flex_color" style="width: 100%;">设备编号: {{item.equipmentID}}</view>
            </view> -->
        </view>
    </u-swipe-action-item>
    </u-swipe-action>
</template>
 
<script>
    export default {
        props: {
            workPieceData: {
                type: Array,
                default: () => []
            }
        },
        data() {
            return {
                options: [{
                    text: "移除",
                    style: {
                        background: '#F08202'
                    }
                }],
            }
        },
        methods:{
            actionClick(opt){
                uni.showModal({
                title: '提示',
                content: '是否确认移除工件号"'+this.workPieceData[opt.name].workPieceID+'"?',
                showCancel: true,
                cancelColor: '#333333',
                success: (res => {
                        if (res.confirm) {
                            console.log('移除',opt);
                            this.$emit('deleteData',this.workPieceData[opt.name])
                        } else if (res.cancel) {
                        
                        }
                    })
                });
                
            }
        }
    }
</script>
 
<style lang="scss" scoped>
    .content {
        background-color: #fff;
        width: 100%;
        box-sizing: border-box;
        border: 1px solid #fff;
        padding: 15rpx;
        margin-bottom: 10rpx;
 
        .content_flex {
            display: flex;
            justify-content: flex-start;
            align-items: center;
            margin-bottom: 5rpx;
 
            .flex_index {
                width: 50rpx;
                height: 50rpx;
                background: $color-common;
                color: #fff;
                font-size: 30rpx;
                line-height: 50rpx;
                text-align: center;
                border-radius: 50%;
                margin-right: 15rpx;
            }
 
            .flex_code {
                font-size: 32rpx;
                color: $color-common;
                width: 75%;
            }
 
            .flex_status {
                width: 90rpx;
                text-align: center;
                padding: 10rpx;
                background: $color-common;
                color: #fff;
                font-weight: 550;
                align-self: flex-end;
 
            }
 
            .flex_color {
                font-size: 32rpx;
                color: #000;
                width: 75%;
 
            }
            
            .card-action {
                width: 100%;
                display: flex;
                justify-content: flex-end;
                align-items: center;
            }
 
        }
    }
</style>