|
@@ -14,8 +14,17 @@
|
|
|
</template>
|
|
|
</van-field>
|
|
|
|
|
|
- <van-field readonly clickable name="datetimePicker" :value="form.createDate" label="时间选择"
|
|
|
- placeholder="点击选择时间" @click="showPicker = true" :rules="rules.createDate" />
|
|
|
+ <van-cell >
|
|
|
+ <van-field style="padding:0px" readonly clickable name="datetimePicker" :value="form.createDate" label="时间选择"
|
|
|
+ placeholder="点击选择时间" @click="showPicker = true" :rules="rules.createDate" >
|
|
|
+ </van-field>
|
|
|
+ <template #right-icon>
|
|
|
+ <!--先开放几家,试一下-->
|
|
|
+ <span style="color:#20a0ff;" @click="getAIReport()" v-if="!hasWrittenReport && (user.companyId==10||user.companyId==7||user.companyId==7030)">智能填报</span>
|
|
|
+ </template>
|
|
|
+ </van-cell>
|
|
|
+
|
|
|
+
|
|
|
<van-cell>
|
|
|
<template #default>
|
|
|
<div class="attendanceRecord">
|
|
@@ -573,7 +582,7 @@ export default {
|
|
|
integrationProjectList: [],
|
|
|
cardRefLoading: false,
|
|
|
today: '',
|
|
|
-
|
|
|
+ hasWrittenReport: false,
|
|
|
showPickerStage: false,
|
|
|
showPickerTaskGroup: false,
|
|
|
showPickerSubProject: false,
|
|
@@ -1497,7 +1506,113 @@ export default {
|
|
|
}
|
|
|
}).catch(err => { this.$toast.clear(); });
|
|
|
},
|
|
|
-
|
|
|
+ getAIReport(createDate) {
|
|
|
+ const toast = this.$toast.loading({
|
|
|
+ forbidClick: true,
|
|
|
+ duration: 0
|
|
|
+ });
|
|
|
+ this.$axios.post('/report/getAIReport', {})
|
|
|
+ .then(res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ var quanbu = 0
|
|
|
+ this.jsDay = 1
|
|
|
+ var zhi = ''
|
|
|
+ var slp = res.data
|
|
|
+ for(var i in slp) {
|
|
|
+ var sp = +slp[i].workingTime + 0
|
|
|
+ zhi = this.jsDay * sp
|
|
|
+ quanbu = +quanbu + zhi
|
|
|
+ }
|
|
|
+
|
|
|
+ this.jsTime = quanbu
|
|
|
+ var aiReportData = res.data;
|
|
|
+ this.canCancelInDialog = false
|
|
|
+ if(aiReportData.length != 0) {
|
|
|
+ var arr = [];
|
|
|
+ var list = aiReportData;
|
|
|
+ console.log('11111111')
|
|
|
+ for(var i in list) {
|
|
|
+ var subProjectName = null;
|
|
|
+ if (list[i].subProjectId) {
|
|
|
+ subProjectName = list[i].subProjectList.filter(s => s.id == list[i].subProjectId)[0].name;
|
|
|
+ }
|
|
|
+ var projectName = list[i].projectName;
|
|
|
+ console.log('in for loop=='+projectName)
|
|
|
+ arr.push({
|
|
|
+ id: list[i].id,
|
|
|
+ projectId: list[i].projectId,
|
|
|
+ projectName: projectName,
|
|
|
+ workingTime: String(list[i].workingTime),
|
|
|
+ content: list[i].content,
|
|
|
+ state: list[i].state,
|
|
|
+ timeType: list[i].timeType,
|
|
|
+ // label: timeType[list[i].timeType].label,
|
|
|
+ startTime: list[i].startTime,
|
|
|
+ endTime: list[i].endTime,
|
|
|
+ isOvertime: 0,
|
|
|
+ progress: list[i].progress,
|
|
|
+ taskList: list[i].taskList,
|
|
|
+ taskId: list[i].taskId ? list[i].taskId : null,
|
|
|
+ taskName: list[i].taskName,
|
|
|
+ professionProgress: list[i].professionProgressList,
|
|
|
+ pics: null,
|
|
|
+ multiWorktime: list[i].multiWorktime,
|
|
|
+ worktimeList: list[i].worktimeList,
|
|
|
+ wuduList: list[i].degreeList,
|
|
|
+ degreeId: list[i].degreeId==-1?null:list[i].degreeId,
|
|
|
+ subProjectId: list[i].subProjectId,
|
|
|
+ subProjectName: subProjectName,
|
|
|
+ subProjectList: list[i].subProjectList,
|
|
|
+ groupId: list[i].groupId == 0 ? null : list[i].groupId,
|
|
|
+ groupName: list[i].groupName,
|
|
|
+ taskGroups: list[i].taskGroups,
|
|
|
+ stages: list[i].stages,
|
|
|
+ stage: list[i].stage == '-' ? null : list[i].stage,
|
|
|
+ customData: list[i].customData,
|
|
|
+ projectAuditorId: list[i].projectAuditorId,
|
|
|
+ projectAuditorName: list[i].projectAuditorName,
|
|
|
+ auditUserList: list[i].auditUserList,
|
|
|
+ overtimeHours: list[i].overtimeHours,
|
|
|
+ customText: list[i].customText,
|
|
|
+ basecostId: list[i].basecostId,
|
|
|
+ //basecostName: basecostName,
|
|
|
+ canEdit: true,
|
|
|
+ auditorFirst: list[i].auditorFirst ? list[i].auditorFirst : { name: '', id: '' },
|
|
|
+ auditorSec: list[i].auditorSec ? list[i].auditorSec : { name: '', id: '' },
|
|
|
+ auditorThird: list[i].auditorThird ? list[i].auditorThird : { name: '', id: '' },
|
|
|
+ ccUserid: list[i].ccUserid ? list[i].ccUserid : { name: '', id: '' },
|
|
|
+ extraField1: list[i].extraField1,
|
|
|
+ extraField1Name: list[i].extraField1Name,
|
|
|
+ extraField2: list[i].extraField2,
|
|
|
+ extraField2Name: list[i].extraField2Name,
|
|
|
+ extraField3: list[i].extraField3,
|
|
|
+ extraField3Name: list[i].extraField3Name,
|
|
|
+ workContentList: list[i].workContentList,
|
|
|
+ sapServiceId: list[i].sapServiceId,
|
|
|
+ sapServiceName: list[i].sapServiceName,
|
|
|
+ serviceList: list[i].serviceList,
|
|
|
+ userReportDeptName: list[i].userReportDeptName,
|
|
|
+ reportTargetDeptId: list[i].deptId
|
|
|
+ })
|
|
|
+ console.log('执行AIReoprt==========')
|
|
|
+ }
|
|
|
+ this.form.domains = arr;
|
|
|
+
|
|
|
+ // this.setTotalReportHours()
|
|
|
+ } else {
|
|
|
+
|
|
|
+ }
|
|
|
+ this.canEdit = true;
|
|
|
+ this.originCanEdit = true;
|
|
|
+ this.seleChn()
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch(err => { this.$toast.clear(); });
|
|
|
+ },
|
|
|
// 获取日报
|
|
|
getReport() {
|
|
|
this.isWeekend = false
|
|
@@ -1534,6 +1649,7 @@ export default {
|
|
|
}
|
|
|
var list = res.data.report;
|
|
|
this.canCancelInDialog = false
|
|
|
+ this.hasWrittenReport = list.length != 0;
|
|
|
if (list.length != 0 && !this.substitute) {
|
|
|
this.canEdit = false;
|
|
|
this.canCancel = false;
|