<template>
|
<view class="">
|
<view class="coreshop-ff">
|
<up-list>
|
<up-list-item>
|
<up-cell :title="workerInfo.userWorker?workerInfo.userWorker.name:''">
|
<template #icon>
|
<up-avatar shape="square" size="35" :src="workerInfo.avatar"
|
customStyle="margin: -3px 5px -3px 0"></up-avatar>
|
</template>
|
</up-cell>
|
</up-list-item>
|
<view class="c-p-20">
|
<view class="chuany-flex chuany-justify-between chuany-flex-wrap">
|
<text class="chuany-font32">
|
{{dakaList.orderName}}
|
</text>
|
<text class="">
|
打卡日期:{{$util.formatDate(dakaList.workDate)}}
|
</text>
|
</view>
|
</view>
|
<view class="c-p-l-20 c-p-r-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> -->
|
<template #right-icon>
|
<up-input v-model="dakaList.workTime" type="digit"
|
border="none" placeholder="请填写时长"></up-input>
|
</template>
|
<!-- <template #value v-else>
|
{{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>
|
<!--
|
<template #right-icon v-if="dakaList.isShenPiName!=='已结算'">
|
<up-input v-model="dakaList.workPrice" type="digit"
|
border="none" placeholder="请填写工价"></up-input>
|
</template>
|
<template #value v-else>
|
{{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="dakaList.workCount" type="digit"
|
@blur='(val) => {dakaList.todaySalary=$util.roundToTwo(dakaList.workCount*dakaList.workPrice)}'
|
border="none" placeholder="请填写数量"></up-input>
|
</template>
|
<!-- <template #value v-else>
|
{{dakaList.workCount}}
|
</template> -->
|
</up-cell>
|
<up-cell title="工资" :border='false'>
|
<!-- <template #right-icon>
|
{{dakaList.todaySalary}} 元
|
</template> -->
|
<template #right-icon>
|
<up-input v-model="dakaList.todaySalary" type="digit"
|
border="none" placeholder="请填写工资"></up-input>
|
</template>
|
<!-- <template #value v-else>
|
{{dakaList.todaySalary}} 元
|
</template> -->
|
</up-cell>
|
<!-- <view class="stepwit">
|
<tem-steps></tem-steps>
|
</view> -->
|
</up-list>
|
<view class="tabbtns">
|
<up-button color='#fece01' class="text-69" :text="dakaList.isShenPiName!=='已结算'?'确认':'修改'" :loading='isLoading'
|
:loadingText="dakaList.isShenPiName!=='已结算'?'确认中':'修改中'" @click="saveDakaDetailCompany"></up-button>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
orderBiddingDetailId: '',
|
dakaList: {},
|
workCount: '',
|
confirmObj: {
|
orderBiddingDetailId: '', //招工打卡Id
|
workTime: '', //工作时长
|
workCount: '', //计件数量
|
todaySalary: '' //当日工资
|
},
|
workerInfo: '',
|
isLoading: false
|
}
|
},
|
onLoad(options) {
|
this.orderBiddingDetailId = options.id
|
this.getDakaDetail(this.orderBiddingDetailId)
|
},
|
methods: {
|
getWorkerInfo(id) {
|
this.$api.getUserId(id).then(res => {
|
this.workerInfo = res.data
|
})
|
},
|
previewImage(url) {
|
uni.previewImage({
|
urls: [url]
|
})
|
},
|
getDakaDetail(id) {
|
this.$api.getDakaDetail({
|
orderBiddingDetailId: id
|
}).then(res => {
|
this.dakaList = res.data
|
this.dakaList.workCount = res.data.workCount
|
this.getWorkerInfo(res.data.workerUserId)
|
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, '打卡');
|
})
|
},
|
saveDakaDetailCompany() {
|
if (this.dakaList.workerType == 1 && !this.dakaList.workCount) {
|
this.$util.showToast({
|
title: '请填写数量!',
|
icon: 'error'
|
})
|
return
|
}
|
let obj = {
|
orderBiddingDetailId: this.dakaList.orderBiddingDetailId, //招工打卡Id
|
workTime: this.dakaList.workTime, //工作时长
|
todaySalary: this.dakaList.todaySalary //当日工资
|
}
|
if (this.dakaList.workCount) {
|
obj.workCount = this.dakaList.workCount
|
}
|
this.isLoading = true
|
this.$api.saveDakaDetailCompany(obj).then(res => {
|
if (res.code == 1) {
|
this.$util.showToast({
|
title: '确认成功!',
|
icon: 'success'
|
})
|
} else {
|
this.$util.showToast({
|
title: res.msg ? res.msg : '失败!'
|
})
|
}
|
this.isLoading = false
|
})
|
},
|
}
|
}
|
</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>
|