|
@@ -52,9 +52,12 @@
|
|
|
</view>
|
|
|
|
|
|
<u-loading-page :loading="state.loading" fontSize="16" style="z-index: 99"></u-loading-page>
|
|
|
- <view class="content-area" v-for="(group, date) in proxy.$common.groupedItems(state.dataList, 'submitDate')" :key="date">
|
|
|
- <view class="content-area-time font14">{{ proxy.$time.jktTimes(date, "否") }}</view>
|
|
|
- <view class="content-area-center bg-white" v-for="(el, ind) in group" :key="ind">
|
|
|
+
|
|
|
+
|
|
|
+ <!-- start -->
|
|
|
+ <view class="content-area" v-for="(el, index) in reportListNewData" :key="index">
|
|
|
+ <view class="content-area-time font14" v-if="!el.id">{{ proxy.$time.jktTimes(el.submitDate, "否") }}</view>
|
|
|
+ <view class="content-area-center bg-white" v-else style="margin:0 10px 10px;border-radius:10px">
|
|
|
<view class="content-area-top menu-item" style="float: right; padding: 10px 0px">
|
|
|
<view class="content-area-top-time"> </view>
|
|
|
<u-icon class="content-area-top-icon" name="more-dot-fill" size="20" color="#000" @click="moreClick(el)"></u-icon>
|
|
@@ -86,6 +89,9 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <!-- end -->
|
|
|
+
|
|
|
+
|
|
|
</template>
|
|
|
</oa-scroll>
|
|
|
|
|
@@ -198,7 +204,7 @@ const state = reactive({
|
|
|
tabsCurrent: 0,
|
|
|
|
|
|
loading: false,
|
|
|
- dataList: [],
|
|
|
+ reportListNewData:[],
|
|
|
pageSize: 20,
|
|
|
current: 1,
|
|
|
total: 0,
|
|
@@ -228,7 +234,7 @@ const state = reactive({
|
|
|
tree: [],
|
|
|
});
|
|
|
|
|
|
-const { tabsList, tabsCurrent, dataList, pageSize, current, total, popup, eventList, modal, timedList, tree } = toRefs(state);
|
|
|
+const { tabsList, tabsCurrent,reportListNewData, pageSize, current, total, popup, eventList, modal, timedList, tree } = toRefs(state);
|
|
|
/**
|
|
|
* 操作弹框提醒
|
|
|
* @param type 弹框类型
|
|
@@ -259,6 +265,7 @@ function dialogConfirm() {
|
|
|
* @初始化
|
|
|
*/
|
|
|
function init() {
|
|
|
+ let arrayList = [];
|
|
|
projectApi()
|
|
|
.ReportRecord({
|
|
|
// startDate: "2024-07-10",
|
|
@@ -274,11 +281,34 @@ function init() {
|
|
|
el.contentText += `${cl.projectName} ${cl.workTime}h \n ${cl.workContent} \n`;
|
|
|
});
|
|
|
});
|
|
|
- state.dataList = requset.data.records;
|
|
|
state.total = requset.data.total;
|
|
|
state.loading = false;
|
|
|
|
|
|
- console.log(state.dataList);
|
|
|
+ var reportListData = requset.data.records;
|
|
|
+ var groupBySubmitTime = reportListData.reduce((acc, current) => {
|
|
|
+ const existIndex = acc.findIndex((item) => item.submitDate.slice(0, 10) === current.submitDate.slice(0, 10));
|
|
|
+ if (existIndex === -1) {
|
|
|
+ acc.push({ submitDate: current.submitDate, items: [current] });
|
|
|
+ } else {
|
|
|
+ acc[existIndex].items.push(current);
|
|
|
+ }
|
|
|
+ return acc;
|
|
|
+ }, []);
|
|
|
+
|
|
|
+ groupBySubmitTime.forEach(function (item, index) {
|
|
|
+ item.items.unshift({ submitDate: item.submitDate });
|
|
|
+ item.items.forEach(function (aa) {
|
|
|
+ arrayList.push(aa);
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ state.reportListNewData = arrayList;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
state.loading = false;
|