|
@@ -236,12 +236,15 @@
|
|
|
returnType="timestamp"
|
|
returnType="timestamp"
|
|
|
v-model="detail.reportDate"
|
|
v-model="detail.reportDate"
|
|
|
:border="false"
|
|
:border="false"
|
|
|
- :disabled="!isView" />
|
|
|
|
|
|
|
+ :disabled="!isView"
|
|
|
|
|
+ @change="inputCurrentDepth(item.nonSumList)" />
|
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
|
<uni-forms-item :label="`${$t('ruiDu.timeNode')}:`" required>
|
|
<uni-forms-item :label="`${$t('ruiDu.timeNode')}:`" required>
|
|
|
<view
|
|
<view
|
|
|
@click="
|
|
@click="
|
|
|
- !isView ? undefined : handleClickTimeRangeItem(index)
|
|
|
|
|
|
|
+ !isView
|
|
|
|
|
+ ? undefined
|
|
|
|
|
+ : handleClickTimeRangeItem(index, item.nonSumList)
|
|
|
">
|
|
">
|
|
|
<view
|
|
<view
|
|
|
class="time-range-item"
|
|
class="time-range-item"
|
|
@@ -278,9 +281,7 @@
|
|
|
v-bind="defaultProps"
|
|
v-bind="defaultProps"
|
|
|
:disabled="!isView"
|
|
:disabled="!isView"
|
|
|
v-model.number="detail.currentDepth"
|
|
v-model.number="detail.currentDepth"
|
|
|
- @input="
|
|
|
|
|
- val => inputCurrentDepth(item.nonSumList, val, index)
|
|
|
|
|
- " />
|
|
|
|
|
|
|
+ @input="val => inputCurrentDepth(item.nonSumList)" />
|
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
|
<uni-forms-item
|
|
<uni-forms-item
|
|
|
label="详情"
|
|
label="详情"
|
|
@@ -376,8 +377,11 @@ const endDefaultTime = ref("08:00");
|
|
|
|
|
|
|
|
const reportDetailIndex = ref(0);
|
|
const reportDetailIndex = ref(0);
|
|
|
|
|
|
|
|
-const handleClickTimeRangeItem = index => {
|
|
|
|
|
|
|
+const aaaList = ref();
|
|
|
|
|
+
|
|
|
|
|
+const handleClickTimeRangeItem = (index, list) => {
|
|
|
reportDetailIndex.value = index;
|
|
reportDetailIndex.value = index;
|
|
|
|
|
+ aaaList.value = list;
|
|
|
reportDetailsTimeRangeRef.value.open();
|
|
reportDetailsTimeRangeRef.value.open();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -405,6 +409,7 @@ const reportDetailsTimeRange = data => {
|
|
|
reportDetails.value[reportDetailIndex.value].endTime = data[1];
|
|
reportDetails.value[reportDetailIndex.value].endTime = data[1];
|
|
|
|
|
|
|
|
calculateDuration(reportDetails.value[reportDetailIndex.value]);
|
|
calculateDuration(reportDetails.value[reportDetailIndex.value]);
|
|
|
|
|
+ inputCurrentDepth(aaaList.value ?? []);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const reportDetails = ref([]);
|
|
const reportDetails = ref([]);
|
|
@@ -438,14 +443,28 @@ const removeReportDetailRow = index => {
|
|
|
const taskId = ref(undefined);
|
|
const taskId = ref(undefined);
|
|
|
const taskOptions = ref([]);
|
|
const taskOptions = ref([]);
|
|
|
|
|
|
|
|
-const inputCurrentDepth = useDebounceFn(function inputCurrentDepth(
|
|
|
|
|
- list,
|
|
|
|
|
- val,
|
|
|
|
|
- index
|
|
|
|
|
-) {
|
|
|
|
|
- if (reportDetails.value && index === reportDetails.value.length - 1) {
|
|
|
|
|
- const currentDepth = list.find(item => item.description === "currentDepth");
|
|
|
|
|
- if (currentDepth) currentDepth.fillContent = val;
|
|
|
|
|
|
|
+const inputCurrentDepth = useDebounceFn(function inputCurrentDepth(list) {
|
|
|
|
|
+ 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 = list.find(
|
|
|
|
|
+ item => item?.description === "currentDepth"
|
|
|
|
|
+ );
|
|
|
|
|
+ if (currentDepth) currentDepth.fillContent = latestDetail.currentDepth;
|
|
|
}
|
|
}
|
|
|
}, 300);
|
|
}, 300);
|
|
|
|
|
|