|
@@ -30,7 +30,7 @@
|
|
</view>
|
|
</view>
|
|
<view class="item-info uni-row">
|
|
<view class="item-info uni-row">
|
|
<text class="label">总工时</text>
|
|
<text class="label">总工时</text>
|
|
- <text class="label right">{{ item['totalWorkingHours']}}h</text>
|
|
|
|
|
|
+ <text class="label right">{{ item['totalWorkingHours']}}</text>
|
|
</view>
|
|
</view>
|
|
<view class="item-info uni-row">
|
|
<view class="item-info uni-row">
|
|
<text class="label">合格数/投入数</text>
|
|
<text class="label">合格数/投入数</text>
|
|
@@ -75,7 +75,7 @@
|
|
@click="handleScanCode">扫一扫开始新批次</button>
|
|
@click="handleScanCode">扫一扫开始新批次</button>
|
|
</view>
|
|
</view>
|
|
<dialog-lot ref="lotDialog" @submit="handleDoIt" />
|
|
<dialog-lot ref="lotDialog" @submit="handleDoIt" />
|
|
- <dialog-turnoverApplication ref="turnoverApplicationDialog" @confirm="handleDoTurnoverAfter"/>
|
|
|
|
|
|
+ <dialog-turnoverApplication ref="turnoverApplicationDialog" @confirm="handleDoTurnoverAfter" />
|
|
</view>
|
|
</view>
|
|
|
|
|
|
</template>
|
|
</template>
|
|
@@ -99,6 +99,9 @@
|
|
import {
|
|
import {
|
|
store
|
|
store
|
|
} from '@/store/index.js'
|
|
} from '@/store/index.js'
|
|
|
|
+ import {
|
|
|
|
+ toHHmmss
|
|
|
|
+ } from '@/utils/common.js'
|
|
|
|
|
|
|
|
|
|
const turnoverApplicationDialog = ref(null)
|
|
const turnoverApplicationDialog = ref(null)
|
|
@@ -139,12 +142,12 @@
|
|
})
|
|
})
|
|
uni.$on('dayworkItemUpdate', reflush)
|
|
uni.$on('dayworkItemUpdate', reflush)
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+
|
|
onUnload(() => {
|
|
onUnload(() => {
|
|
uni.$off('dayworkItemUpdate', reflush)
|
|
uni.$off('dayworkItemUpdate', reflush)
|
|
})
|
|
})
|
|
-
|
|
|
|
- function reflush(){
|
|
|
|
|
|
+
|
|
|
|
+ function reflush() {
|
|
init(curSubPlan.value.id);
|
|
init(curSubPlan.value.id);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -180,6 +183,21 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // 计算总工时
|
|
|
|
+ for (let i = 0; i < listData.value.length; i++) {
|
|
|
|
+ listData.value[i].totalWorkingHours = 0;
|
|
|
|
+ if (listData.value[i].dayworkItemList) {
|
|
|
|
+ for (let j = 0; j < listData.value[i].dayworkItemList.length; j++) {
|
|
|
|
+ if (listData.value[i].dayworkItemList[j].status == 2 || listData.value[i].dayworkItemList[
|
|
|
|
+ j].status == 3) {
|
|
|
|
+ listData.value[i].totalWorkingHours += Number(listData.value[i].dayworkItemList[j].workingHours);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ listData.value[i].totalWorkingHours = toHHmmss(listData.value[i].totalWorkingHours);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
console.log(listData.value)
|
|
console.log(listData.value)
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
})
|
|
})
|
|
@@ -199,11 +217,19 @@
|
|
success: function(res) {
|
|
success: function(res) {
|
|
console.log(res.result)
|
|
console.log(res.result)
|
|
let vehicleObj = JSON.parse(res.result);
|
|
let vehicleObj = JSON.parse(res.result);
|
|
|
|
+ if (!vehicleObj.carrierId || vehicleObj.carrierId == "") {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: "error",
|
|
|
|
+ title: "请扫载具码",
|
|
|
|
+ duration: 1000
|
|
|
|
+ })
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
showDaywork({
|
|
showDaywork({
|
|
carrierId: vehicleObj.carrierId,
|
|
carrierId: vehicleObj.carrierId,
|
|
status: 7
|
|
status: 7
|
|
}).then(response => {
|
|
}).then(response => {
|
|
- if(response.code == 200){
|
|
|
|
|
|
+ if (response.code == 200) {
|
|
console.log(response)
|
|
console.log(response)
|
|
lotDialog.value.open(response.data);
|
|
lotDialog.value.open(response.data);
|
|
// reqParam.value = response.data
|
|
// reqParam.value = response.data
|
|
@@ -244,21 +270,21 @@
|
|
function handleDoIt(data) {
|
|
function handleDoIt(data) {
|
|
handleAddDaywork(data);
|
|
handleAddDaywork(data);
|
|
}
|
|
}
|
|
-
|
|
|
|
- function handleDoTurnoverAfter(){
|
|
|
|
|
|
+
|
|
|
|
+ function handleDoTurnoverAfter() {
|
|
init();
|
|
init();
|
|
}
|
|
}
|
|
-
|
|
|
|
- function handleCancelTurnover(data){
|
|
|
|
|
|
+
|
|
|
|
+ function handleCancelTurnover(data) {
|
|
turnoverDelete(data).then(res => {
|
|
turnoverDelete(data).then(res => {
|
|
- if(res.code == 200){
|
|
|
|
|
|
+ if (res.code == 200) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
icon: "success",
|
|
icon: "success",
|
|
title: "取消成功",
|
|
title: "取消成功",
|
|
duration: 2000
|
|
duration: 2000
|
|
})
|
|
})
|
|
init(curSubPlan.value.id);
|
|
init(curSubPlan.value.id);
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
icon: "fail",
|
|
icon: "fail",
|
|
title: "取消失败",
|
|
title: "取消失败",
|