|
@@ -60,7 +60,7 @@
|
|
</van-popup>
|
|
</van-popup>
|
|
<!--任务分组 -->
|
|
<!--任务分组 -->
|
|
<van-field readonly name="groupId" v-if="user.company.packageProject==1&&item.taskGroups != null && item.taskGroups.length > 0" clickable
|
|
<van-field readonly name="groupId" v-if="user.company.packageProject==1&&item.taskGroups != null && item.taskGroups.length > 0" clickable
|
|
- :value="item.groupName" label="任务分组" placeholder="请选择任务分组"
|
|
|
|
|
|
+ :value="item.groupName" :label="user.timeType.enableNewWeeklyfill == 1 ? '分组' : '任务分组'" :placeholder="user.timeType.enableNewWeeklyfill == 1 ? '请选择分组' : '请选择任务分组'"
|
|
@click="clickPickTaskGroup(index, item)" />
|
|
@click="clickPickTaskGroup(index, item)" />
|
|
<van-popup v-model="item.showPickerTaskGroup" position="bottom">
|
|
<van-popup v-model="item.showPickerTaskGroup" position="bottom">
|
|
<van-picker show-toolbar :columns="item.taskGroups" value-key="name" @confirm="choseTaskGroup"
|
|
<van-picker show-toolbar :columns="item.taskGroups" value-key="name" @confirm="choseTaskGroup"
|
|
@@ -291,7 +291,7 @@
|
|
icon="plus" color="#ffffff" ><span style="color:#999;text-align:center;padding: 0 5px;"> 添加工时 </span></van-tag>
|
|
icon="plus" color="#ffffff" ><span style="color:#999;text-align:center;padding: 0 5px;"> 添加工时 </span></van-tag>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <div class="overtime" v-if="((user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)) || (isCorpWX&&canEdit))">
|
|
|
|
|
|
+ <div class="overtime" v-if="((user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)) || (isCorpWX&&canEdit)) && user.timeType.enableNewWeeklyfill != 1">
|
|
<div class="overTimeClas">
|
|
<div class="overTimeClas">
|
|
<van-checkbox v-model="item.isOvertime" style="width: 4.3rem;">加班</van-checkbox>
|
|
<van-checkbox v-model="item.isOvertime" style="width: 4.3rem;">加班</van-checkbox>
|
|
<van-field v-model="item.overtimeHours" type="number" :disabled="item.isOvertime==null||item.isOvertime==0"
|
|
<van-field v-model="item.overtimeHours" type="number" :disabled="item.isOvertime==null||item.isOvertime==0"
|
|
@@ -621,7 +621,7 @@
|
|
if (res.data.askLeaveTime) {
|
|
if (res.data.askLeaveTime) {
|
|
this.kaoqinText += ' | 请假'+res.data.askLeaveTime+'h';
|
|
this.kaoqinText += ' | 请假'+res.data.askLeaveTime+'h';
|
|
}
|
|
}
|
|
- if((this.user.timeType.showDdCardtime == 1 || this.user.timeType.showCorpwxCardtime == 1) && this.reportTimeType.type == 1){
|
|
|
|
|
|
+ if((this.user.timeType.showDdCardtime == 1 || this.user.timeType.showCorpwxCardtime == 1)){
|
|
this.$set(this.currentForm,'cardtime',res.data.workHours)
|
|
this.$set(this.currentForm,'cardtime',res.data.workHours)
|
|
}
|
|
}
|
|
}else {
|
|
}else {
|
|
@@ -827,7 +827,7 @@
|
|
|
|
|
|
this.showPickerUserddp = false;
|
|
this.showPickerUserddp = false;
|
|
//获取子项目
|
|
//获取子项目
|
|
- if(this.user.timeType.mainProjectState != 1){
|
|
|
|
|
|
+ if(this.user.timeType.mainProjectState != 1 && this.user.timeType.enableNewWeeklyfill != 1){
|
|
this.getSubprojectList(this.currentForm.domains[this.proIdx]);
|
|
this.getSubprojectList(this.currentForm.domains[this.proIdx]);
|
|
}
|
|
}
|
|
//加载项目相关的工程进度
|
|
//加载项目相关的工程进度
|
|
@@ -835,19 +835,21 @@
|
|
this.getProjectProfessions(this.currentForm.domains[this.proIdx],index);
|
|
this.getProjectProfessions(this.currentForm.domains[this.proIdx],index);
|
|
}
|
|
}
|
|
//获取任务分组
|
|
//获取任务分组
|
|
- this.getTaskGroups(this.currentForm.domains[this.proIdx], this.proIdx);
|
|
|
|
-
|
|
|
|
- // 获取1相关维度
|
|
|
|
- this.getTaskList(domainItem.projectId)
|
|
|
|
-
|
|
|
|
- //获取相关日报提交选择人
|
|
|
|
- domainItem.projectAuditorId = null;
|
|
|
|
- domainItem.projectAuditorName = null;
|
|
|
|
- domainItem.auditUserList = null;
|
|
|
|
- //获取项目审核人
|
|
|
|
- var curProject = this.project.filter(p=>p.id == domainItem.projectId)[0];
|
|
|
|
- if (this.user.timeType.reportAuditType == 0) {
|
|
|
|
- this.getProjectAuditorList(domainItem, index);
|
|
|
|
|
|
+ if(this.user.timeType.enableNewWeeklyfill == 1) { // 针对物奇获取项目分组
|
|
|
|
+ this.getProjectGroup(this.currentForm.domains[this.proIdx], this.proIdx)
|
|
|
|
+ } else {
|
|
|
|
+ this.getTaskGroups(this.currentForm.domains[this.proIdx], this.proIdx);
|
|
|
|
+ // 获取1相关维度
|
|
|
|
+ this.getTaskList(domainItem.projectId)
|
|
|
|
+ //获取相关日报提交选择人
|
|
|
|
+ domainItem.projectAuditorId = null;
|
|
|
|
+ domainItem.projectAuditorName = null;
|
|
|
|
+ domainItem.auditUserList = null;
|
|
|
|
+ //获取项目审核人
|
|
|
|
+ var curProject = this.project.filter(p=>p.id == domainItem.projectId)[0];
|
|
|
|
+ if (this.user.timeType.reportAuditType == 0) {
|
|
|
|
+ this.getProjectAuditorList(domainItem, index);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//获取项目下的任务分组
|
|
//获取项目下的任务分组
|
|
@@ -1364,6 +1366,9 @@
|
|
},
|
|
},
|
|
clickPickTaskGroup(i, item) {
|
|
clickPickTaskGroup(i, item) {
|
|
// if (!this.canEdit) return;
|
|
// if (!this.canEdit) return;
|
|
|
|
+ if(this.user.timeType.enableNewWeeklyfill == 1) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
this.clickIndex = i;
|
|
this.clickIndex = i;
|
|
item.showPickerTaskGroup = true;
|
|
item.showPickerTaskGroup = true;
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
@@ -1617,6 +1622,22 @@
|
|
// 提交日报
|
|
// 提交日报
|
|
submitReport() {
|
|
submitReport() {
|
|
this.form[this.inbtn] = this.currentForm
|
|
this.form[this.inbtn] = this.currentForm
|
|
|
|
+
|
|
|
|
+ // 针对物奇做的判断
|
|
|
|
+ if(this.user.timeType.enableNewWeeklyfill == 1){
|
|
|
|
+ const { allday } = this.user.timeType // 系统设置的每日工作时间
|
|
|
|
+ const { next, error, group } = this.judgeStrange(this.form)
|
|
|
|
+ if(!next){
|
|
|
|
+ if(error.length > 0) {
|
|
|
|
+ this.$toast(`【${error.join('、')}】填写工时合计非 ${allday} 小时`)
|
|
|
|
+ } else {
|
|
|
|
+ this.$toast(`${group.join('、')} 请选择项目分组`)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
//检查子项目
|
|
//检查子项目
|
|
if (this.user.timeType.subProMustFill == 1) {
|
|
if (this.user.timeType.subProMustFill == 1) {
|
|
for(let i in this.form){
|
|
for(let i in this.form){
|
|
@@ -1951,7 +1972,6 @@
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- // return
|
|
|
|
const toast = this.$toast.loading({
|
|
const toast = this.$toast.loading({
|
|
forbidClick: true,
|
|
forbidClick: true,
|
|
duration: 0
|
|
duration: 0
|
|
@@ -2037,6 +2057,127 @@
|
|
alert(JSON.stringify(res));
|
|
alert(JSON.stringify(res));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 针对物奇定制私人按周填报写的方法
|
|
|
|
+ async getProjectGroup(domainItem, index) {
|
|
|
|
+ const { data } = await this.$axios.post("/task-group/listProjectGroupAndAuditor", {projectId: domainItem.projectId})
|
|
|
|
+ if(!data) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(data.length == 0) {
|
|
|
|
+ this.$toast.fail('分组未设置,请联系该项目管理人员');
|
|
|
|
+ }
|
|
|
|
+ if(data.length == 1) {
|
|
|
|
+ domainItem.groupId = data[0].id;
|
|
|
|
+ domainItem.groupName = data[0].name;
|
|
|
|
+ domainItem.projectAuditorId = data[0].inchargerId;
|
|
|
|
+ domainItem.projectAuditorName = data[0].inchargerName;
|
|
|
|
+ if (!data[0].inchargerId) {
|
|
|
|
+ this.$toast.fail(`【${data[0].name}】分组未设置审批人,请联系该项目管理人员`);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ const newArr = data.map(item => {
|
|
|
|
+ const { inchargerId, inchargerName } = item;
|
|
|
|
+ return {
|
|
|
|
+ auditorId: inchargerId,
|
|
|
|
+ auditorName: inchargerName
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ domainItem.taskGroups = data;
|
|
|
|
+ domainItem.auditUserList = newArr;
|
|
|
|
+ this.$forceUpdate();
|
|
|
|
+ },
|
|
|
|
+ // 提交数据物奇的判断
|
|
|
|
+ judgeStrange(from) {
|
|
|
|
+ console.log(from, '<======== 要判断的fom表单')
|
|
|
|
+ const newFrom = JSON.parse(JSON.stringify(from))
|
|
|
|
+ const arrList = Object.values(newFrom).flatMap(({ domains, createDate }) =>
|
|
|
|
+ domains.map(({ workingTime, projectId, projectName, groupId }) => ({
|
|
|
|
+ dateTime: createDate,
|
|
|
|
+ workingTime,
|
|
|
|
+ projectId,
|
|
|
|
+ projectName,
|
|
|
|
+ groupId,
|
|
|
|
+ weeks: this.getNewWeek(createDate)
|
|
|
|
+ }))
|
|
|
|
+ );
|
|
|
|
+ console.log(arrList, '<==== 判断的数据')
|
|
|
|
+ let { strArr, groupArr } = this.judgmentData(arrList)
|
|
|
|
+ let strDataArr = this.getWeek(strArr);
|
|
|
|
+ let strGroupArr = groupArr
|
|
|
|
+
|
|
|
|
+ if(strDataArr.length > 0 || strGroupArr.length > 0) {
|
|
|
|
+ return {
|
|
|
|
+ next: false,
|
|
|
|
+ error: [...new Set(strDataArr)],
|
|
|
|
+ group: [...new Set(strGroupArr)]
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ return {
|
|
|
|
+ next: true,
|
|
|
|
+ error: [],
|
|
|
|
+ group: []
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 判断是否小于系统设置的每日工作时间
|
|
|
|
+ judgmentData(data) {
|
|
|
|
+ const { allday } = this.user.timeType // 系统设置的每日工作时间
|
|
|
|
+ const result = [];
|
|
|
|
+ data.forEach((item) => {
|
|
|
|
+ const date = item.dateTime;
|
|
|
|
+ const index = result.findIndex((arr) => arr[0].dateTime === date);
|
|
|
|
+
|
|
|
|
+ if (index === -1) {
|
|
|
|
+ result.push([item]);
|
|
|
|
+ } else {
|
|
|
|
+ result[index].push(item);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ const strArr = result
|
|
|
|
+ .filter((arr) => arr[0].projectId)
|
|
|
|
+ .filter(
|
|
|
|
+ (arr) => arr.reduce((sum, item) => sum + (+item.workingTime || 0), 0) != allday
|
|
|
|
+ )
|
|
|
|
+ .map((arr) => arr[0].dateTime);
|
|
|
|
+
|
|
|
|
+ const groupArr = data
|
|
|
|
+ .filter(item => item.projectId && !item.groupId)
|
|
|
|
+ .map(({ dateTime, weeks, projectName }) => `【${dateTime} ${weeks} 中的 (${projectName})项目】`);
|
|
|
|
+
|
|
|
|
+ return { strArr, groupArr }
|
|
|
|
+ },
|
|
|
|
+ // YYYY-MM-DD 转成 周几
|
|
|
|
+ getWeek(arr) {
|
|
|
|
+ const weekArr = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
|
|
|
|
+ for (let i = 0; i < arr.length; i++) {
|
|
|
|
+ const date = new Date(arr[i]);
|
|
|
|
+ const week = weekArr[date.getDay()];
|
|
|
|
+ arr[i] = `${arr[i]} ${week}`;
|
|
|
|
+ }
|
|
|
|
+ return arr;
|
|
|
|
+ },
|
|
|
|
+ getNewWeek(data) {
|
|
|
|
+ const weekArr = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
|
|
|
|
+ const date = new Date(data);
|
|
|
|
+ return weekArr[date.getDay()];
|
|
|
|
+ },
|
|
|
|
+ // 重新定义获取接口
|
|
|
|
+ async newPost(url, param) {
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
+ this.$axios.post(url, param,
|
|
|
|
+ res => {
|
|
|
|
+ resolve(res)
|
|
|
|
+ },
|
|
|
|
+ error => {
|
|
|
|
+ this.$toast.fail(error);
|
|
|
|
+ reject(error)
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
+ });
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|