<template>
|
<view>
|
<page-nav title="个人计件工资产量"></page-nav>
|
<view class="mainContent" :style="{maxHeight:'1600rpx',overflow: 'scroll'}">
|
<view>
|
<u-gap height="10" bgColor="#eff0f1"></u-gap>
|
<view class="head" :style="{height:detailOrderArray.find(i=>i.unprice===0)?'140rpx':'80rpx'}">
|
<view class="head_block">
|
<view class="head_left marginLeft20">
|
<!-- <view class="head_bar"></view> -->
|
<view class="head_title" style="font-weight: 600;">
|
姓名:{{username}}
|
</view>
|
|
</view>
|
|
<view class="">
|
<view class="head_title" style="font-weight: 600;">
|
工号:{{usercode}}
|
</view>
|
</view>
|
|
|
|
<view class="marginRight20">
|
<view class="head_title" style="font-weight: 600;display: flex;align-items: center;">
|
<view style="margin-right: 10rpx;"> 按{{compute?'末道':'逐道'}}</view>
|
<u-switch v-model="compute" size="20" @change="switchChange"></u-switch>
|
</view>
|
</view>
|
</view>
|
|
<!-- <view v-if="detailOrderArray.find(i=>i.unprice===0)" class="marginLeft20 marginTop10"
|
style="color: red;font-size: 30rpx;display: flex;">
|
<u-icon name="error-circle" style="margin: 0 10rpx;" color="red"></u-icon>
|
<view>节拍工价未设置全,请联系管理员!</view>
|
</view> -->
|
<!-- <u-alert v-if="detailOrderArray.find(i=>i.unprice===0)" type="info" :show-icon="true" description='1111'></u-alert> -->
|
|
|
</view>
|
<u-gap height="10" bgColor="#eff0f1"></u-gap>
|
<view class="head">
|
<view class="head_block" style="height: 120rpx; display: flex;justify-content: space-around;">
|
<u-button :plain='today' @click="dateChange('today')" type="primary" shape="circle" text="今日">
|
</u-button>
|
<u-button :plain='month' @click="dateChange('month')" type="primary" shape="circle" text="本月">
|
</u-button>
|
<u-button :plain='custom' @click="dateChange('custom')" type="primary" shape="circle"
|
text="自定义"></u-button>
|
</view>
|
</view>
|
<u-gap height="10" bgColor="#eff0f1"></u-gap>
|
<view class="head">
|
<view class="head_block flex_column" :style="{minHeight:!custom?'230rpx':'130rpx'}">
|
<view v-if="!custom" class="flex_column"
|
style="display: flex;justify-content: space-around;width: 100%;">
|
<view class="" style="display: flex;justify-content: center;width: 100%;">
|
<view class="titleFont">开始日期</view>
|
<view class="titleFont">~</view>
|
<view class="titleFont">结束日期</view>
|
</view>
|
<!-- <view class='inputClass' style="margin:10rpx auto 0;">
|
<u--input placeholder="请选择" border="surround" v-model="startDate"></u--input>
|
</view> -->
|
<u-button type="info" icon='calendar' iconColor="#0659FF" size="" @click="calendarClick"
|
:text="calendarRange">
|
</u-button>
|
|
</view>
|
<view style="display: flex;justify-content: space-around;width: 100%;">
|
<view class="head_block_item flex_column">
|
<view class="titleFont">报工数量</view>
|
<view class="number">{{ parseFloat(form.report_qty)}}</view>
|
</view>
|
<view class="head_block_item flex_column">
|
<view class="titleFont">良废扣除</view>
|
<view class="number">{{ parseFloat(form.userngbadmoney)}}</view>
|
</view>
|
<view class="head_block_item flex_column">
|
<view class="titleFont">工资收入(元)</view>
|
<view class="number">{{parseFloat(form.usermoney)}}</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
<u-gap height="20" bgColor="#eff0f1"></u-gap>
|
<view :style="{maxHeight:!custom?'830rpx':'960rpx',overflow: 'scroll'}">
|
<view v-for="(item,index) in detailOrderArray" :key="key">
|
<view class="head">
|
<view
|
style="min-height: 100rpx; display: flex;justify-content: space-between; margin: 20rpx;">
|
<view class="flex_column" style="width: 65%;">
|
<view class="lineH50">
|
<view class="titleFont">
|
工单:
|
</view>
|
<view class="contentFont">
|
{{item.wo_code}}
|
</view>
|
</view>
|
<view class="lineH50">
|
<view class="titleFont">
|
产品:
|
</view>
|
<view class="contentFont">
|
{{item.partname}}
|
</view>
|
</view>
|
<view class="lineH50">
|
<view class="titleFont">
|
报工:
|
</view>
|
<view class="contentFont">
|
{{item.report_qty}}
|
</view>
|
</view>
|
<view class="lineH50">
|
<view class="titleFont">
|
工废料废:
|
</view>
|
<view class="contentFont">
|
<!-- {{item.bad_qty}} -->
|
</view>
|
</view>
|
<!-- <view class="lineH50">
|
<view class="titleFont">
|
班组:
|
</view>
|
<view class="contentFont">
|
{{item.group_name}}
|
</view>
|
</view>
|
<view class="lineH50" v-if="$company==='A'">
|
<view class="titleFont">
|
分配比例:
|
</view>
|
<view class="contentFont">
|
{{item.ratio}} %
|
</view>
|
</view> -->
|
</view>
|
<view class="flex_column" style="width: 35%;">
|
<view class="lineH50">
|
<view class="titleFont">
|
数量:
|
</view>
|
<view class="contentFont">
|
{{item.task_qty}}
|
</view>
|
</view>
|
<view class="lineH50">
|
<view class="titleFont">
|
工序:
|
</view>
|
<view class="contentFont">
|
{{item.stepname}}
|
</view>
|
</view>
|
<view class="lineH50">
|
<view class="titleFont">
|
不良:
|
</view>
|
<view class="contentFont">
|
{{item.ng_qty}}
|
</view>
|
</view>
|
<view class="lineH50" :style="{color:item.unprice===0?'red':''}">
|
<view class="titleFont">
|
单价:
|
</view>
|
<view class="contentFont">
|
{{item.unprice}}
|
</view>
|
</view>
|
<view class="lineH50">
|
<view class="titleFont">
|
人数:
|
</view>
|
<view class="contentFont">
|
{{item.colum}}
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
<u-gap height="20" v-if="index!==detailOrderArray.length" bgColor="#eff0f1"></u-gap>
|
</view>
|
</view>
|
</view>
|
</view>
|
|
|
|
<uni-calendar ref="calendar" :range='true' :insert="false" @confirm="calendarConfirm" />
|
|
</view>
|
</template>
|
|
|
<script>
|
import {
|
PieceRateWage
|
} from '../../config/api.js';
|
|
export default {
|
onLoad(option) {},
|
|
onPullDownRefresh() {
|
setTimeout(() => {
|
this.init(() => {
|
uni.stopPullDownRefresh();
|
})
|
}, 1000);
|
},
|
|
data() {
|
return {
|
topRightMessageCount: '',
|
|
today: true,
|
month: false,
|
custom: true,
|
|
username: uni.getStorageSync('username'),
|
usercode: uni.getStorageSync('usercode'),
|
group_name: uni.getStorageSync('group_name'),
|
|
form: {
|
report_qty: 0,
|
userngbadmoney: 0,
|
usermoney: 0
|
},
|
|
calendarRange: new Date().getFullYear() + '-' + (new Date().getMonth() + 1).toString().padStart(
|
2, '0') + '-01' + '~' + new Date().toISOString().slice(0, 10),
|
|
detailOrderArray: [],
|
|
|
compute: true, // last 是末道 contin 每道
|
|
|
key: new Date().getTime()
|
|
}
|
},
|
created() {
|
|
},
|
mounted() {
|
this.init()
|
|
// uni.getSystemInfo({
|
// success: (res) => {
|
// console.log(res);
|
// }
|
// })
|
this.getData()
|
},
|
methods: {
|
init() {
|
uni.stopPullDownRefresh();
|
},
|
// 获取安灯消息列表长度
|
getTopRightMessageCountIsChange(val) {
|
this.topRightMessageCount = val
|
},
|
switchChange() {
|
this.getData()
|
},
|
// 请求数据
|
async getData() {
|
const data = {
|
compute: this.compute ? 'last' : 'contin',
|
|
Ratetime: this.calendarRange
|
}
|
const res = await PieceRateWage(this.global.formatData(data))
|
if (res.code === '200') {
|
this.form = res.data.dt0[0]
|
this.detailOrderArray = res.data.dt1
|
this.key = new Date().getTime()
|
}
|
},
|
// 按钮切换
|
dateChange(val) {
|
if (val === 'today') {
|
this.today = false
|
this.month = true
|
this.custom = true
|
this.calendarRange = new Date().toISOString().slice(0, 10) + '~' + new Date().toISOString().slice(0,
|
10)
|
} else if (val === 'month') {
|
this.today = true
|
this.month = false
|
this.custom = true
|
|
this.calendarRange = new Date().getFullYear() + '-' + (new Date().getMonth() + 1).toString().padStart(
|
2, '0') + '-01' + '~' + new Date().toISOString().slice(0, 10)
|
|
} else if (val === 'custom') {
|
this.today = true
|
this.month = true
|
this.custom = false
|
this.calendarRange = new Date().getFullYear() + '-' + (new Date().getMonth() + 1).toString().padStart(
|
2, '0') + '-01' + '~' + new Date().toISOString().slice(0, 10)
|
}
|
this.getData()
|
},
|
calendarConfirm(val) {
|
if (val.range.before < val.range.after) {
|
this.calendarRange = val.range.before + '~' + val.range.after
|
} else {
|
this.calendarRange = val.range.after + '~' + val.range.before
|
}
|
|
if (val.range.before === '') {
|
this.calendarRange = new Date().toISOString().slice(0, 10) + '~' + val.range.after
|
}
|
if (val.range.after === '') {
|
this.calendarRange = val.range.before + '~' + new Date().toISOString().slice(0, 10)
|
}
|
if (val.range.before === '' && val.range.after === '') {
|
this.calendarRange = new Date().toISOString().slice(0, 10) + '~' + new Date().toISOString().slice(0,
|
10)
|
}
|
this.getData()
|
},
|
calendarClick() {
|
this.$refs.calendar.open();
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
@import url('@/style/global.css');
|
|
::v-deep .uicon-arrow-left>span {
|
display: block;
|
}
|
|
.u-button--circle {
|
margin: 0;
|
width: 180rpx;
|
border-radius: 20rpx;
|
}
|
|
.head_block_item {
|
text-align: center;
|
|
.number {
|
font-weight: bolder;
|
color: red;
|
}
|
}
|
|
.u-button--info {
|
width: 50%;
|
height: 40rpx;
|
border: 1px solid #0659FF;
|
border-radius: 10rpx;
|
}
|
|
::v-deep .uicon-calendar {
|
font-size: 28rpx !important;
|
}
|
|
.lineH50 {
|
line-height: 50rpx;
|
display: flex;
|
}
|
</style>
|