-
zhangwei
2024-08-29 447e19fa298ae11a1c3a3fa2d2ff3a1a8dba0501
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
196
197
198
199
200
201
202
203
<template>
    <view class="c-p-b-150">
        <view class="coreshop-ff">
            <view class="c-p-20">
                <view class="chuany-flex chuany-justify-between chuany-flex-wrap">
                    <text class="chuany-font34 chuany-text-bold">
                        {{dakaList.orderName}}
                    </text>
                    <text class="">
                        日期:{{$util.formatDate(dakaList.workDate)}}
                    </text>
                </view>
            </view>
            <view class="c-p-20">
                <view class="">
                    <text class="">
                        打卡记录:
                    </text>
                    <view class="chuany-flex chuany-justify-evenly chuany-flex-wrap c-p-t-20">
                        <view
                            class="chuany-flex chuany-flex-direction chuany-align-center chuany-justify-around textclo chuany-font24 c-p-b-10 daka"
                            :key="index" v-for="(item,index) in dakaList.orderBiddingDetailCheck">
                            <up-avatar shape="square" size="56" :src="item.checkPhoto"
                                @click="previewImage(item.checkPhoto)"></up-avatar>
                            <view class="step_item">
                                <up-icon name="checkmark-circle-fill" :color="item.checktime?'#2979ff':'#e9e8e8'"
                                    size="22"></up-icon>
                                <view class="line" :class="item.checkPhoto?'line-active':''"
                                    v-if="index!==dakaList.length-1&&index%2==0">
                                </view>
                            </view>
                            <text>{{item.checktime?'已打卡':'未打卡'}}</text>
                            <text
                                :class="$util.formatDate(item.checktime,true)=='-'?'core-opa':''">{{$util.formatDate(item.checktime,true)}}</text>
                        </view>
                    </view>
                </view>
            </view>
            <up-cell title="工作时长" :border='false'>
                <template #right-icon>
                    {{dakaList.workTime}} 小时
                </template>
            </up-cell>
            <up-cell title="方式" :border='false'>
                <template #right-icon>
                    {{dakaList.workerTypeName}}
                </template>
            </up-cell>
            <up-cell title="工价" :border='false'>
                <template #right-icon>
                    {{dakaList.workPrice}} {{dakaList.workerType==0?'元/小时':'元/件'}}
                </template>
            </up-cell>
            <up-cell title="数量" :border='false'  v-if="dakaList.workerType==1" >
                <template #right-icon>
                    <up-input v-model="workCount" border="none" placeholder="请填写数量"></up-input>
                </template>
            </up-cell>
            <up-cell title="工资" :border='false'>
                <template #right-icon>
                    {{dakaList.todaySalary}} 元
                </template>
            </up-cell>
            <!-- <view class="stepwit">
                <tem-steps></tem-steps>
            </view> -->
            <view class="tabbtns">
                <up-button color='#fece01' class="text-69" text="工资申报" @click="saveDakaDetail"></up-button>
            </view>
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                orderBiddingDetailId: '',
                dakaList: {},
                workCount: '',
                confirmObj: {
                    orderBiddingDetailId: '', //招工打卡Id
                    workTime: '', //工作时长
                    workCount: '', //计件数量
                    todaySalary: '' //当日工资
                }
            }
        },
        onLoad(options) {
            this.orderBiddingDetailId = options.id
            this.getDakaDetail(this.orderBiddingDetailId)
        },
        methods: {
            previewImage(url) {
                uni.previewImage({
                    urls: [url]
                })
            },
            getDakaDetail(id) {
                this.$api.getDakaDetail({
                    orderBiddingDetailId: id
                }).then(res => {
                    this.dakaList = res.data
                    if (this.dakaList.orderBiddingDetailCheck.length == 0) {
                        this.dakaList.orderBiddingDetailCheck.length = 2
                    }
                    if (this.dakaList.orderBiddingDetailCheck.length > 6) {
                        this.dakaList.orderBiddingDetailCheck.length = 6
                    }
                    if (this.dakaList.orderBiddingDetailCheck.length % 2 !== 0) {
                        this.dakaList.orderBiddingDetailCheck.push({})
                    }
                    console.log(res, '打卡');
                })
            },
            saveDakaDetail() {
                if (dakaList.workerType == 1 && this.workCount) {
                    this.$util.showToast({
                        title: '请填写数量!',
                        icon: 'error'
                    })
                    return
                }
                let obj = {
                    orderBiddingDetailId: dakaList.orderBiddingDetailId, //招工打卡Id
                    workTime: dakaList.workTime, //工作时长
                    todaySalary: dakaList.todaySalary //当日工资
                }
                if (this.workCount) {
                    obj.workCount = this.workCount
                }
                this.$api.saveDakaDetail(obj).then(res => {
                    console.log(res, '----');
                })
            },
        }
    }
</script>
 
<style lang='scss'>
    .list {
        background-color: #fff;
        padding: 30rpx 30rpx 0 30rpx;
    }
 
    .content {
        height: 430rpx;
        width: 100%;
        background-color: #fff;
        border-radius: 20rpx;
        /* margin: 30rpx 30rpx 0 30rpx; */
        box-shadow: 0rpx 4rpx 12rpx 3rpx rgba(85, 85, 85, 0.10);
    }
 
    .bgblue {
        background-color: #4e96f5;
        border-radius: 20rpx 20rpx 0 0;
        color: #fff;
    }
 
    .redcla {
        color: #f05348;
    }
 
    .textclo {
        color: #606266;
    }
 
    .stepwit {
        width: 50%;
        margin: 0 auto
    }
 
 
 
    .daka {
        width: 260rpx;
        height: 230rpx;
    }
 
    .step_item {
        position: relative;
        /* width: 144rpx; */
        display: flex;
 
        .line {
            position: absolute;
            top: 17rpx;
            left: 35rpx;
            content: "";
            height: 4rpx;
            width: 310rpx;
            background-color: #e9e8e8;
        }
 
        .line-active {
            background-color: #2979ff;
        }
    }
    .u-cell__body{
        padding: 6px 15px !important;
    }
</style>