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
<template>
    <u-modal :show="show" title="出库确认" :closeOnClickOverlay="true" :showCancelButton="true" @cancel="handlerCancel"
        @confirm="handlerConfirm" @close="handlerCancel">
        <u-form labelPosition="left" labelWidth="100rpx" :model="form" :rules="rules" ref="uForm">
            <u-form-item required label="密码" prop="pwd">
                <u-input v-model="form.pwd" type="password" placeholder="请输入密码" style="width: 450rpx;"></u-input>
            </u-form-item>
        </u-form>
 
        <!-- <view class="status_flex">
            <u-input v-model="pwd" type="password" placeholder="请输入密码" style="width: 450rpx;"></u-input>
        </view> -->
    </u-modal>
</template>
 
<script>
    import {
        $alert
    } from '@/static/js/utils/index.js'
    import {
        unLineWorkPiece
    } from '@/api/outBound/index.js'
    export default {
        emits: ['update'],
        data() {
            return {
                show: false,
                workPieceData:[],
                CarNo:'',
                form: {
                    pwd: ''
                },
                rules: {
                    pwd: {
                        type: 'string',
                        required: true,
                        message: '请输入密码',
                        trigger: ['blur', 'change']
                    }
                }
            }
        },
        onReady() {
            this.$refs.uForm.setRules(this.rules)
        },
        methods: {
            showModal(workPieceData,CarNo){
                this.show=true
                this.workPieceData=workPieceData    
                this.CarNo=CarNo
            },
            handlerCancel() {
                this.form =  {
                    pwd: '',
                }
                this.show = false
            },
            // 选中的状态传递给父组件
            handlerConfirm() {
                console.log(111);
                this.$refs.uForm.validate().then(res => {
                    const params = {
                        password: this.form.pwd,
                        CarNo:this.CarNo,
                        workPieceInfoLst:this.workPieceData
                    }
                    console.log(params,'params');
                    unLineWorkPiece(params).then(res => {
                        uni.showToast({
                            title: '下线成功'
                        })
                        this.$emit('reflesh')
                        this.handlerCancel()
                    })
                }).catch(errors => {
                    console.log(errors,'22');
                })
            }
 
        }
    }
</script>
 
<style lang="scss" scoped>
    .status_flex {
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
 
        .flex_item {
            width: 450rpx;
            height: 70rpx;
            text-align: center;
            line-height: 70rpx;
            border: 1px solid $color-common;
            color: $color-common;
            font-size: 32rpx;
            font-weight: 550;
            background: #fff;
            margin-bottom: 30rpx;
        }
 
        .active_item {
            background: $color-common;
            color: #fff;
        }
    }
    
    ::v-deep .u-transition {
      z-index: 99 !important;
    }
</style>