|
|
@@ -439,9 +439,30 @@ const orange = computed(() => {
|
|
|
return false
|
|
|
})
|
|
|
|
|
|
-const inputCurrentDepth = useDebounceFn(function inputCurrentDepth(val: any, index: number) {
|
|
|
- if (form.value.reportDetails && index === form.value.reportDetails.length - 1) {
|
|
|
- form.value.currentDepth = val
|
|
|
+const acalculateDuration = (row: any) => {
|
|
|
+ calculateDuration(row)
|
|
|
+ inputCurrentDepth()
|
|
|
+}
|
|
|
+
|
|
|
+const inputCurrentDepth = useDebounceFn(function inputCurrentDepth() {
|
|
|
+ const details = form.value.reportDetails
|
|
|
+
|
|
|
+ if (Array.isArray(details) && details.length > 0) {
|
|
|
+ const latestDetail = details.reduce((prev, current) => {
|
|
|
+ const currentFullTime = dayjs(current.reportDate)
|
|
|
+ .hour(parseInt(current.endTime.split(':')[0]))
|
|
|
+ .minute(parseInt(current.endTime.split(':')[1]))
|
|
|
+ .valueOf()
|
|
|
+
|
|
|
+ const prevFullTime = dayjs(prev.reportDate)
|
|
|
+ .hour(parseInt(prev.endTime.split(':')[0]))
|
|
|
+ .minute(parseInt(prev.endTime.split(':')[1]))
|
|
|
+ .valueOf()
|
|
|
+
|
|
|
+ return currentFullTime >= prevFullTime ? current : prev
|
|
|
+ })
|
|
|
+
|
|
|
+ form.value.currentDepth = latestDetail.currentDepth
|
|
|
}
|
|
|
}, 300)
|
|
|
</script>
|
|
|
@@ -716,6 +737,7 @@ const inputCurrentDepth = useDebounceFn(function inputCurrentDepth(val: any, ind
|
|
|
class="w-full!"
|
|
|
value-format="x"
|
|
|
:disabled="isMainFieldDisabled"
|
|
|
+ @change="inputCurrentDepth()"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
@@ -740,7 +762,7 @@ const inputCurrentDepth = useDebounceFn(function inputCurrentDepth(val: any, ind
|
|
|
format="HH:mm"
|
|
|
value-format="HH:mm"
|
|
|
class="w-full!"
|
|
|
- @change="calculateDuration(row)"
|
|
|
+ @change="acalculateDuration(row)"
|
|
|
:disabled="isMainFieldDisabled"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
@@ -765,7 +787,7 @@ const inputCurrentDepth = useDebounceFn(function inputCurrentDepth(val: any, ind
|
|
|
format="HH:mm"
|
|
|
value-format="HH:mm"
|
|
|
class="w-full!"
|
|
|
- @change="calculateDuration(row)"
|
|
|
+ @change="acalculateDuration(row)"
|
|
|
:disabled="isMainFieldDisabled"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
@@ -817,7 +839,7 @@ const inputCurrentDepth = useDebounceFn(function inputCurrentDepth(val: any, ind
|
|
|
align="left"
|
|
|
placeholder="请输入结束井深"
|
|
|
:disabled="isMainFieldDisabled"
|
|
|
- @input="(val) => inputCurrentDepth(val, $index)"
|
|
|
+ @input="() => inputCurrentDepth()"
|
|
|
>
|
|
|
<template #suffix> m </template>
|
|
|
</el-input-number>
|