schangxiang@126.com
2025-05-21 a3a2b238a2626ef8744e7a135f9ca2e2fbb5184c
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<template>
    <!--  -->
    <view class="content" :class="content.checked?'content_active':''">
        <view class="detail" @click.stop="$emit('checkChange',content)">
            <view class="row1">
                <view style="display: flex;align-items: center">
                    <text class="index">{{index+1}}</text>
                    <!-- materialcode -->
                    <text class="id-name">{{content.materialcode}}({{content.materialname}})</text>
                </view>
                <!-- <view class="tag">
                    <u-tag plain size="mini" text="免检" type="success"></u-tag>
                </view> -->
            </view>
            <view class="row2">
                <u-row>
                    <u-col span="3">项目编号:</u-col>
                    <u-col span="9">{{content.projectCode}}</u-col>
                </u-row>
            </view>
            <view class="row3">
                <view class="row-content">
                    <view class="col-content">
                        <view>
                            <view>采购数量</view>
                            <view>{{content.qty}}</view>
                        </view>
                    </view>
                    <view class="col-content">
                        <view>
                            <view>送货数量</view>
                            <view style="text-align: center;color:#F18202">{{content.deliveryQty}}</view>
                        </view>
                    </view>
                    <view class="col-content" style="align-items: center;">
                        <view>
                            <view style="text-align: center;">收货数量</view>
                            <view :style="{ width: inputWid(content.receivedQty) ,textAlign:'center',margin:'0 auto'}">
                                <input :maxlength="10" @click.native.stop="stop" type="number" v-model="content.receivedQty"
                                    @blur="inputBlur" style="color:#F18202;border-bottom: 1rpx solid #F18202;" />
                            </view>
                        </view>
                    </view>
                </view>
            </view>
        </view>
        <!-- <easy-picker :visible.sync="workingProcedureVisible" :list="workingProcedureList" value-field="value" label-field="label" @select="onChangeInputUser"></easy-picker> -->
    </view>
</template>
 
<script>
    // import EasyPicker from '@/components/EasyPicker.vue'
    export default {
        // components:{EasyPicker},
        props: {
            content: {
                type: Object,
                required: true
            },
            index: {
                type: Number,
                required: true
            }
        },
        data() {
            return {
                workingProcedureVisible: false,
                workingProcedureList: []
            }
        },
        created() {
            // this.getListbycode()
            console.log(this.title, 'title')
            console.log(this.content, 'content');
        },
        computed: {
            inputWid() {
                return function(value) {
                    console.log(String(value).length, 'v');
                    if (!value) {
                        return '30rpx'
                    } else {
                        // 有内容,字符串长度*字体大小
                        return (String(value).length) * 25 + 30 + 'rpx'
                    }
                }
            }
        },
        methods: {
            showWorkingProcedure() {
                this.workingProcedureVisible = true
            },
            // async getListbycode(){
            //     try{
            //         let {data}=await listbycode({code:'process_type'})
            //         this.workingProcedureList=data
            //     }catch(e){
            //         //TODO handle the exception
            //         console.log(e);
            //     }
 
            // },
            onChangeInputUser(val, valObj, index) {
                this.$emit('changeWPCurrent', val)
            },
            inputBlur({
                detail
            }) {
                const {
                    value
                } = detail
                if (Math.sign(value)!=1) {
                    this.content.receivedQty = 1
                }
            },
            stop(e) {
                if (e) {
                    e.stopPropagation()
                }
            }
        }
    }
</script>
 
<style scoped lang="scss">
    .content {
        background-color: #fff;
        width: 96%;
        margin: 18rpx auto;
        border: 1rpx solid #fff;
        display: flex;
        align-items: center;
        padding: 5rpx 5rpx 8rpx;
        font-size: 30ont30ize-common;
 
        .detail {
            box-sizing: border-box;
            flex: 1;
 
            .row1 {
                display: flex;
                justify-content: space-between;
                margin: 5rpx 0;
 
                .index {
                    display: inline-block;
                    width: 40rpx;
                    height: 40rpx;
                    border-radius: 20rpx;
                    background-color: $color-common;
                    text-align: center;
                    color: #fff;
                    margin-right: 10rpx;
                    line-height: 40rpx;
                }
 
                .id-name {
                    font-weight: 700;
                    font-size: 30rpx;
                }
            }
 
            .row2,
            .row3 {
                color: #bbb;
                font-size: 30rpx;
 
                .row-content {
                    display: flex;
                    align-items: flex-start;
 
                    .col-content {
                        width: 25%;
                        display: flex;
                        flex-direction: column;
                        justify-content: center;
                        align-items: flex-start;
                    }
                }
            }
 
            .row2{
                margin:8rpx 0;
            }
        }
    }
 
    .content_active {
        border: 1rpx solid #F18202 !important;
    }
 
    ::v-deep uni-input {
        font-size: $fontsize-common;
    }
</style>