|
@@ -292,6 +292,7 @@
|
|
|
class="w-full!"
|
|
class="w-full!"
|
|
|
value-format="x"
|
|
value-format="x"
|
|
|
:disabled="fillStatus === '1'"
|
|
:disabled="fillStatus === '1'"
|
|
|
|
|
+ @change="inputCurrentDepth()"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</template>
|
|
</template>
|
|
@@ -316,7 +317,7 @@
|
|
|
format="HH:mm"
|
|
format="HH:mm"
|
|
|
value-format="HH:mm"
|
|
value-format="HH:mm"
|
|
|
class="w-full!"
|
|
class="w-full!"
|
|
|
- @change="calculateDuration(row)"
|
|
|
|
|
|
|
+ @change="acalculateDuration(row)"
|
|
|
:disabled="fillStatus === '1'"
|
|
:disabled="fillStatus === '1'"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -341,7 +342,7 @@
|
|
|
format="HH:mm"
|
|
format="HH:mm"
|
|
|
value-format="HH:mm"
|
|
value-format="HH:mm"
|
|
|
class="w-full!"
|
|
class="w-full!"
|
|
|
- @change="calculateDuration(row)"
|
|
|
|
|
|
|
+ @change="acalculateDuration(row)"
|
|
|
:disabled="fillStatus === '1'"
|
|
:disabled="fillStatus === '1'"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -396,7 +397,7 @@
|
|
|
class="!w-full"
|
|
class="!w-full"
|
|
|
align="left"
|
|
align="left"
|
|
|
placeholder="请输入结束井深"
|
|
placeholder="请输入结束井深"
|
|
|
- @input="(val) => inputCurrentDepth(val, $index)"
|
|
|
|
|
|
|
+ @input="() => inputCurrentDepth()"
|
|
|
:disabled="fillStatus === '1'"
|
|
:disabled="fillStatus === '1'"
|
|
|
>
|
|
>
|
|
|
<template #suffix> m </template>
|
|
<template #suffix> m </template>
|
|
@@ -556,13 +557,41 @@ const removeProductionStatusRow = (index: number) => {
|
|
|
reportDetails.value.splice(index, 1)
|
|
reportDetails.value.splice(index, 1)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const inputCurrentDepth = useDebounceFn(function inputCurrentDepth(val: any, index: number) {
|
|
|
|
|
- if (reportDetails.value && index === reportDetails.value.length - 1) {
|
|
|
|
|
|
|
+const acalculateDuration = (row: any) => {
|
|
|
|
|
+ calculateDuration(row)
|
|
|
|
|
+ inputCurrentDepth()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const inputCurrentDepth = useDebounceFn(function inputCurrentDepth() {
|
|
|
|
|
+ const details = reportDetails.value
|
|
|
|
|
+
|
|
|
|
|
+ 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
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
const currentDepth = attrList.value.find((item) => item.description === 'currentDepth')
|
|
const currentDepth = attrList.value.find((item) => item.description === 'currentDepth')
|
|
|
- if (currentDepth) currentDepth.fillContent = val
|
|
|
|
|
|
|
+ if (currentDepth) currentDepth.fillContent = latestDetail.currentDepth
|
|
|
}
|
|
}
|
|
|
}, 300)
|
|
}, 300)
|
|
|
|
|
|
|
|
|
|
+// const inputCurrentDepth = useDebounceFn(function inputCurrentDepth(val: any, index: number) {
|
|
|
|
|
+// if (reportDetails.value && index === reportDetails.value.length - 1) {
|
|
|
|
|
+// const currentDepth = attrList.value.find((item) => item.description === 'currentDepth')
|
|
|
|
|
+// if (currentDepth) currentDepth.fillContent = val
|
|
|
|
|
+// }
|
|
|
|
|
+// }, 300)
|
|
|
|
|
+
|
|
|
const showDepth = computed(() => {
|
|
const showDepth = computed(() => {
|
|
|
return attrList.value.some((item) => item.description === 'currentDepth')
|
|
return attrList.value.some((item) => item.description === 'currentDepth')
|
|
|
})
|
|
})
|