|
@@ -5,16 +5,16 @@
|
|
|
<view class="second">注意日期区间最长不超过31天</view>
|
|
|
</view>
|
|
|
<uni-section title="开始日期:" type="square" class="uni-row sta">
|
|
|
- <input v-model="startTime" type="date"/>
|
|
|
+ <input v-model="startTime" type="date" />
|
|
|
</uni-section>
|
|
|
<uni-section title="结束日期:" type="square" class="uni-row end">
|
|
|
- <input v-model="endTime" type="date"/>
|
|
|
+ <input v-model="endTime" type="date" />
|
|
|
</uni-section>
|
|
|
<button @click="handleSearch">查询</button>
|
|
|
</view>
|
|
|
|
|
|
<view v-if="show" class="uni-column container">
|
|
|
-
|
|
|
+
|
|
|
<view class="uni-row" style="position: fixed;
|
|
|
top: 0;width: 100%;
|
|
|
height: 120rpx;
|
|
@@ -26,30 +26,32 @@
|
|
|
align-items: center;
|
|
|
border-top: 1rpx solid lightgray;
|
|
|
border-bottom: 1rpx solid lightgray;">
|
|
|
-
|
|
|
+
|
|
|
<!-- <uni-section title="选择日期:" type="square" class="uni-row" style="margin-left: 16rpx;">
|
|
|
<uni-data-select v-model="selectDate" :localdata="dateList" @change="change" :clear="false"
|
|
|
placeholder="无报工记录"
|
|
|
style="width: 200rpx;"></uni-data-select>
|
|
|
</uni-section> -->
|
|
|
-
|
|
|
+
|
|
|
<view class="tab-container">
|
|
|
- <view :class="['tab-item', editStatus === false ? 'active': '']" @click="handleCheckTabHis()">历史报工</view>
|
|
|
+ <view :class="['tab-item', editStatus === false ? 'active': '']" @click="handleCheckTabHis()">历史报工
|
|
|
+ </view>
|
|
|
<view :class="['tab-item', editStatus === true ? 'active': '']" @click="handleCheckTab()">已完成报工</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<view style="width: 100%;">
|
|
|
- <uni-section title="时间范围:" type="square" class="uni-row" style="justify-content: start;align-items: center;margin-left: 20rpx;">
|
|
|
- {{ startTime }} ~ {{endTime}}
|
|
|
- </uni-section>
|
|
|
-
|
|
|
- <!-- <view style="width: 100%;font-size: 28rpx; text-align: left; margin-left: 16rpx;">时间范围:{{ startTime }} ~ {{endTime}}</view> -->
|
|
|
- <!-- <uni-section title="条数:" type="square" class="uni-row" style="justify-content: center;align-items: center;">
|
|
|
+ <uni-section title="时间范围:" type="square" class="uni-row"
|
|
|
+ style="justify-content: start;align-items: center;margin-left: 20rpx;">
|
|
|
+ {{ startTime }} ~ {{endTime}}
|
|
|
+ </uni-section>
|
|
|
+
|
|
|
+ <!-- <view style="width: 100%;font-size: 28rpx; text-align: left; margin-left: 16rpx;">时间范围:{{ startTime }} ~ {{endTime}}</view> -->
|
|
|
+ <!-- <uni-section title="条数:" type="square" class="uni-row" style="justify-content: center;align-items: center;">
|
|
|
{{ listDataItem.length }}
|
|
|
</uni-section> -->
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<view class="scroll-container" v-if="!editStatus">
|
|
|
|
|
|
<view v-for="(item, index) in listDataItem" :key="index" class="list-item">
|
|
@@ -103,9 +105,9 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<view class="scroll-container" v-if="editStatus">
|
|
|
-
|
|
|
+
|
|
|
<view v-for="(item, index) in listDaywork" :key="index" class="list-item">
|
|
|
<view class="title-container">
|
|
|
<view class="title uni-row">
|
|
@@ -137,7 +139,7 @@
|
|
|
<text class="label">操作者</text>
|
|
|
<text class="label right">{{ item['nickName'] }}</text>
|
|
|
</view> -->
|
|
|
- <!-- <view class="item-info uni-row">
|
|
|
+ <!-- <view class="item-info uni-row">
|
|
|
<text class="label">开始时间</text>
|
|
|
<text class="label right">{{ item['startTime'] ? item['startTime'] : '-' }}</text>
|
|
|
</view> -->
|
|
@@ -149,21 +151,22 @@
|
|
|
<text class="label">废品数</text>
|
|
|
<text class="label right">{{ item['rejectSum'] ? item['rejectSum'] : 0 }}</text>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<view class="item-info uni-row">
|
|
|
<text class="label">设备</text>
|
|
|
<text class="label right">{{ item['equipmentDetailCode'] }}</text>
|
|
|
- <view class="uni-row" style="justify-content: flex-end;margin-left: 20px;" v-if="item['adoptStatus'] && item['adoptStatus'] != null">
|
|
|
- <text >交检状态:</text>
|
|
|
- <text v-if="item['adoptStatus'] == 1" style="color: #67c337;" >正常</text>
|
|
|
- <text v-if="item['adoptStatus'] == 2" style="color: red;" >反选</text>
|
|
|
+ <view class="uni-row" style="justify-content: flex-end;margin-left: 20px;"
|
|
|
+ v-if="item['adoptStatus'] && item['adoptStatus'] != null">
|
|
|
+ <text>交检状态:</text>
|
|
|
+ <text v-if="item['adoptStatus'] == 1" style="color: #67c337;">正常</text>
|
|
|
+ <text v-if="item['adoptStatus'] == 2" style="color: red;">反选</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
<!-- <dialog-lotInfo ref="lotInfo"></dialog-lotInfo> -->
|
|
|
</template>
|
|
|
|
|
@@ -197,8 +200,8 @@
|
|
|
const total = ref(0)
|
|
|
const editStatus = ref(false)
|
|
|
onLoad(() => {
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
})
|
|
|
|
|
|
onShow(() => {
|
|
@@ -219,7 +222,7 @@
|
|
|
let today = Date.parse(new Date());
|
|
|
let startTimestamp = Date.parse(new Date(startTime.value));
|
|
|
let endTimestamp = Date.parse(new Date(endTime.value));
|
|
|
- if(endTimestamp - startTimestamp < 0){
|
|
|
+ if (endTimestamp - startTimestamp < 0) {
|
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
|
title: '开始日期不能超过结束日期',
|
|
@@ -227,7 +230,7 @@
|
|
|
})
|
|
|
return;
|
|
|
}
|
|
|
- if(today - endTimestamp < 0 || today - startTimestamp < 0){
|
|
|
+ if (today - endTimestamp < 0 || today - startTimestamp < 0) {
|
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
|
title: '开始或结束日期不能超过今日',
|
|
@@ -235,7 +238,7 @@
|
|
|
})
|
|
|
return;
|
|
|
}
|
|
|
- if(!startTime.value || !endTime.value){
|
|
|
+ if (!startTime.value || !endTime.value) {
|
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
|
title: '请选择开始或结束日期',
|
|
@@ -243,7 +246,7 @@
|
|
|
})
|
|
|
return;
|
|
|
}
|
|
|
- if(endTimestamp - startTimestamp > 1000 * 60 * 60 * 24 * 30){
|
|
|
+ if (endTimestamp - startTimestamp > 1000 * 60 * 60 * 24 * 30) {
|
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
|
title: '日期区间最长不超过31天',
|
|
@@ -252,7 +255,7 @@
|
|
|
return;
|
|
|
}
|
|
|
show.value = !show.value
|
|
|
- if(show.value) {
|
|
|
+ if (show.value) {
|
|
|
init();
|
|
|
}
|
|
|
}
|
|
@@ -263,7 +266,7 @@
|
|
|
});
|
|
|
console.log(startTime.value);
|
|
|
console.log(endTime.value)
|
|
|
- getDayWorkItemHistory(startTime.value,endTime.value).then(res => {
|
|
|
+ getDayWorkItemHistory(startTime.value, endTime.value).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
listData.value = res.rows || [];
|
|
|
listDataItem.value = res.rows || [];
|
|
@@ -287,52 +290,61 @@
|
|
|
}
|
|
|
return accumulator;
|
|
|
}, {});
|
|
|
-
|
|
|
-
|
|
|
- // 0718
|
|
|
- for (var i = 0; i < listData.value.length; i++) {
|
|
|
- var current = listData.value[i];
|
|
|
- var found = false;
|
|
|
- var endTimeStatus = "";
|
|
|
- for (var j = 0; j < listDaywork.value.length; j++) {
|
|
|
- if (listDaywork.value[j].dayworkId === current.dayworkId && listDaywork.value[j].processId === current.processId) {
|
|
|
- listDaywork.value[j].qualifiedNum += current.qualifiedNum;
|
|
|
- listDaywork.value[j].rejectSum += current.rejectSum;
|
|
|
- if(listDaywork.value[j].equipmentDetailCode != null && listDaywork.value[j].equipmentDetailCode != undefined && listDaywork.value[j].equipmentDetailCode != listDaywork.value[j].equipmentDetailCode){
|
|
|
- listDaywork.value[j].equipmentDetailCode = listDaywork.value[j].equipmentDetailCode+","+current.equipmentDetailCode
|
|
|
- }
|
|
|
- found = true;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (current.status == 3 ) {
|
|
|
- endTimeStatus = current.endTime;
|
|
|
-
|
|
|
- } else {
|
|
|
- endTimeStatus= null;
|
|
|
- }
|
|
|
- if (!found) {
|
|
|
- listDaywork.value.push({
|
|
|
- processAlias:current.process.processAlias,
|
|
|
- equipmentDetailCode:current.equipmentDetailCode,
|
|
|
- lotCode:current.lotCode,
|
|
|
- productDescription:current.productDescription,
|
|
|
- daywork:current.daywork,
|
|
|
- dayworkId: current.dayworkId,
|
|
|
- processId: current.processId,
|
|
|
- qualifiedNum: current.qualifiedNum,
|
|
|
- rejectSum: current.rejectSum,
|
|
|
- endTime: endTimeStatus,
|
|
|
- adoptStatus:current.adoptStatus == null? null:current.adoptStatus
|
|
|
-
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- console.log(listData.value);
|
|
|
- console.log(listDaywork.value);
|
|
|
-
|
|
|
+
|
|
|
+ var hasEndTime = false
|
|
|
+ // 0718
|
|
|
+ for (var i = 0; i < listData.value.length; i++) {
|
|
|
+ var current = listData.value[i];
|
|
|
+ var found = false;
|
|
|
+ var endTimeStatus = "";
|
|
|
+ for (var j = 0; j < listDaywork.value.length; j++) {
|
|
|
+ if (listDaywork.value[j].dayworkId === current.dayworkId && listDaywork.value[j]
|
|
|
+ .processId === current.processId) {
|
|
|
+ listDaywork.value[j].qualifiedNum += current.qualifiedNum;
|
|
|
+ listDaywork.value[j].rejectSum += current.rejectSum;
|
|
|
+ if (listDaywork.value[j].equipmentDetailCode != null && listDaywork.value[j]
|
|
|
+ .equipmentDetailCode != undefined && listDaywork.value[j].equipmentDetailCode !=
|
|
|
+ listDaywork.value[j].equipmentDetailCode) {
|
|
|
+ listDaywork.value[j].equipmentDetailCode = listDaywork.value[j]
|
|
|
+ .equipmentDetailCode + "," + current.equipmentDetailCode
|
|
|
+ }
|
|
|
+ found = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (current.status == 3) {
|
|
|
+ console.log("999")
|
|
|
+ hasEndTime = true
|
|
|
+ endTimeStatus = current.endTime;
|
|
|
+ console.log(endTimeStatus)
|
|
|
+ }
|
|
|
+ if (!hasEndTime && current.status != 3) {
|
|
|
+ console.log("777")
|
|
|
+ endTimeStatus = null;
|
|
|
+ }
|
|
|
+ if (!found && current.status == 3) {
|
|
|
+ console.log()
|
|
|
+ listDaywork.value.push({
|
|
|
+ processAlias: current.process.processAlias,
|
|
|
+ equipmentDetailCode: current.equipmentDetailCode,
|
|
|
+ lotCode: current.lotCode,
|
|
|
+ productDescription: current.productDescription,
|
|
|
+ daywork: current.daywork,
|
|
|
+ dayworkId: current.dayworkId,
|
|
|
+ processId: current.processId,
|
|
|
+ qualifiedNum: current.qualifiedNum,
|
|
|
+ rejectSum: current.rejectSum,
|
|
|
+ endTime: endTimeStatus,
|
|
|
+ adoptStatus: current.adoptStatus == null ? null : current.adoptStatus
|
|
|
+
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log(listData.value);
|
|
|
+ console.log(listDaywork.value);
|
|
|
+
|
|
|
// 时间下拉
|
|
|
// for (let i = 0; i < Object.keys(groupedData).length; i++) {
|
|
|
// dateList.value[i] = {
|
|
@@ -358,12 +370,14 @@
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- function handleCheckTab(){
|
|
|
+ function handleCheckTab() {
|
|
|
editStatus.value = true
|
|
|
}
|
|
|
- function handleCheckTabHis(){
|
|
|
+
|
|
|
+ function handleCheckTabHis() {
|
|
|
editStatus.value = false
|
|
|
}
|
|
|
+
|
|
|
function change() {
|
|
|
listDataItem.value = listData.value[selectDate.value]
|
|
|
}
|
|
@@ -374,49 +388,48 @@
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
-
|
|
|
.time-controls {
|
|
|
.title {
|
|
|
- margin: 20% auto 40% auto;
|
|
|
-
|
|
|
+ margin: 20% auto 40% auto;
|
|
|
+
|
|
|
.first {
|
|
|
font-size: 48rpx;
|
|
|
margin: 0 auto;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.second {
|
|
|
color: red;
|
|
|
font-size: 24rpx;
|
|
|
margin: 10rpx auto 0 auto;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.sta {
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
margin-bottom: 48rpx;
|
|
|
-
|
|
|
+
|
|
|
input {
|
|
|
- border:1rpx solid gray;
|
|
|
+ border: 1rpx solid gray;
|
|
|
border-radius: 8rpx;
|
|
|
width: 400rpx;
|
|
|
height: 64rpx;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.end {
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
margin-bottom: 64rpx;
|
|
|
-
|
|
|
+
|
|
|
input {
|
|
|
- border:1rpx solid gray;
|
|
|
+ border: 1rpx solid gray;
|
|
|
border-radius: 8rpx;
|
|
|
width: 400rpx;
|
|
|
height: 64rpx;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
button {
|
|
|
width: 78%;
|
|
|
background-color: #1684fc;
|
|
@@ -503,13 +516,14 @@
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.tab-container {
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
width: 100%;
|
|
|
height: 32px;
|
|
|
justify-content: space-around;
|
|
|
-
|
|
|
+
|
|
|
.table-item {
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
@@ -520,9 +534,10 @@
|
|
|
justify-content: center;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.tab-item.active {
|
|
|
color: rgba(25, 137, 250, 1);
|
|
|
-
|
|
|
+
|
|
|
font-weight: 700;
|
|
|
}
|
|
|
</style>
|