|
@@ -81,7 +81,7 @@
|
|
|
<van-cell title="总时长(h)" v-if="reportTimeType.type == 3">
|
|
|
<template>
|
|
|
<van-stepper :disabled="(!canEdit || user.timeType.lockWorktime == 1) && !isWeekend"
|
|
|
- v-model="reportTimeType.allday" @change="changeAllTime" min="0.5" max="12" step="0.5"
|
|
|
+ v-model="form.totalDuration" @change="changeAllTime" min="0.5" :max="reportSettingsRow.maxReportTime || 12" step="0.5"
|
|
|
:decimal-length="1" />
|
|
|
</template>
|
|
|
</van-cell>
|
|
@@ -524,11 +524,21 @@
|
|
|
|
|
|
</div>
|
|
|
<div style="text-align:center;" v-if="showAddMore">
|
|
|
- <van-tag size="large"
|
|
|
+ <template v-if="reportSettingsRow.type != 3">
|
|
|
+ <van-tag size="large"
|
|
|
style="text-align:center;margin:10px;padding:12px;margin-bottom:120px;border: 1px solid #20a0ff;"
|
|
|
- @click="addNewPro" icon="plus" color="#ffffff"><span
|
|
|
- style="color:#999;text-align:center;padding: 0 50px;"> + 新增{{ user.companyId == 781 ? '任务' : '项目' }}
|
|
|
- </span></van-tag>
|
|
|
+ @click="addNewPro" icon="plus" color="#ffffff">
|
|
|
+ <span style="color:#999;text-align:center;padding: 0 50px;"> + 新增{{ user.companyId == 781 ? '任务' : '项目' }}</span>
|
|
|
+ </van-tag>
|
|
|
+ </template>
|
|
|
+ <template v-if="reportSettingsRow.type == 3 && canEdit">
|
|
|
+ <van-tag size="large"
|
|
|
+ style="text-align:center;margin:10px;padding:12px;margin-bottom:120px;border: 1px solid #20a0ff;"
|
|
|
+ @click="addNewPro" icon="plus" color="#ffffff">
|
|
|
+ <span style="color:#999;text-align:center;padding: 0 50px;"> + 新增{{ user.companyId == 781 ? '任务' : '项目' }}</span>
|
|
|
+ </van-tag>
|
|
|
+ </template>
|
|
|
+
|
|
|
<!-- <van-button id="btn-start-recording" @click="startRecording">录音</van-button>
|
|
|
<van-button id="btn-stop-recording" @click="stopRecording">停止</van-button>
|
|
|
<van-button id="btn-play-recording" @click="getRecording">获取文件</van-button> -->
|
|
@@ -690,6 +700,7 @@ export default {
|
|
|
timeType: [],
|
|
|
form: {
|
|
|
createDate: this.format(new Date(new Date()), "yyyy-MM-dd"),
|
|
|
+ totalDuration: 8,
|
|
|
domains: [{
|
|
|
id: null,
|
|
|
projectId: "",
|
|
@@ -752,7 +763,9 @@ export default {
|
|
|
showAddMore: false,
|
|
|
businessTripsArray: [],
|
|
|
doYouWantToDisplayTheWorkOrder: true,
|
|
|
- hideWorkingHours: false
|
|
|
+ hideWorkingHours: false,
|
|
|
+
|
|
|
+ reportSettingsRow: {},
|
|
|
};
|
|
|
},
|
|
|
|
|
@@ -1415,7 +1428,8 @@ export default {
|
|
|
changeAllTime() {
|
|
|
//总时长发生改变,自动按比例计算
|
|
|
this.form.domains.forEach(d => {
|
|
|
- d.workingTime = (d.progress * this.reportTimeType.allday / 100).toFixed(1);
|
|
|
+ // d.workingTime = (d.progress * this.reportTimeType.allday / 100).toFixed(1);
|
|
|
+ d.workingTime = (d.progress * this.form.totalDuration / 100).toFixed(1);
|
|
|
});
|
|
|
},
|
|
|
cancel() {
|
|
@@ -1829,6 +1843,7 @@ export default {
|
|
|
this.report = res.data;
|
|
|
this.businessTripsArray = res.data.businessTrips || []
|
|
|
var t = res.data.timeType;
|
|
|
+ this.reportSettingsRow = res.data.timeType
|
|
|
var timeType = [];
|
|
|
//转化时间格式
|
|
|
if (t.allday != null) {
|
|
@@ -1993,6 +2008,13 @@ export default {
|
|
|
const { projectCode } = this.proads.find(item => item.id == list[i].projectId)
|
|
|
this.getInfoByProjectId(projectCode, i, false)
|
|
|
}
|
|
|
+ if(res.data.timeType.type == 3) {
|
|
|
+ const reportCalculationReportList = res.data.report || []
|
|
|
+ this.form.totalDuration = reportCalculationReportList.reduce((accumulator, current) => {
|
|
|
+ const workingTime = current.workingTime || 0;
|
|
|
+ return accumulator + workingTime;
|
|
|
+ }, 0);
|
|
|
+ }
|
|
|
}
|
|
|
this.form.domains = array;
|
|
|
this.setTotalReportHours()
|
|
@@ -2001,6 +2023,9 @@ export default {
|
|
|
this.canCancel = false;
|
|
|
this.canEdit = true;
|
|
|
var shuzhi = this.user.timeType.allday + ''
|
|
|
+ if(res.data.timeType.type == 3) {
|
|
|
+ this.form.totalDuration = this.user.timeType.allday
|
|
|
+ }
|
|
|
//没有填报的可以点击提交
|
|
|
this.form.domains = [{
|
|
|
id: null,
|
|
@@ -2825,7 +2850,7 @@ export default {
|
|
|
if(!customDegreeMultiple) { // 单选
|
|
|
formData.append("degreeId", this.form.domains[i].degreeId);
|
|
|
} else {
|
|
|
- let newDegreeId = this.form.domains[i].degreeId.split(',')
|
|
|
+ let newDegreeId = Array.isArray(this.form.domains[i].degreeId) ? this.form.domains[i].degreeId : this.form.domains[i].degreeId.split(',')
|
|
|
formData.append("multiDegrId", JSON.stringify(newDegreeId).replace(/,/g, '@'))
|
|
|
}
|
|
|
} else {
|