|
@@ -189,18 +189,18 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- 填写日报的dialog -->
|
|
|
- <el-dialog :title="isBatch==0?'填写日报':'批量填报'" :visible.sync="dialogVisible" width="60%" :close-on-click-modal="false">
|
|
|
+ <el-dialog :title="isBatch==0?'填写日报':'批量填报'" :visible.sync="dialogVisible" width="60%" :close-on-click-modal="false" @closed="guanbi()">
|
|
|
<el-form ref="workForm" :model="workForm" :rules="workRules" label-width="100px">
|
|
|
- <el-form-item label="选择人员" v-if="isSubstitude"
|
|
|
-
|
|
|
- >
|
|
|
+ <el-form-item label="选择人员" v-if="isSubstitude">
|
|
|
<el-input @focus="showChooseMembTree" v-model="workForm.userNames"
|
|
|
placeholder="请选择代填人员" ></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="工作日期" prop="createDate">
|
|
|
<el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
|
|
|
:style="'width:'+(isBatch==0?'200':'280')+'px;'" :type="isBatch==0?'date':'daterange'"
|
|
|
- @change="changeMonth()" :clearable="false" placeholder="选择工作日期" :disabled="isDisable"></el-date-picker>
|
|
|
+ @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" placeholder="选择工作日期" :disabled="isDisable"></el-date-picker>
|
|
|
+ <div v-if="falsss" style="display: inline-block;">总{{jsDay}} 天, 共{{jsTime}} 小时</div>
|
|
|
+ <div v-if="isBatch!=0" style="display: inline-block;">总{{jsDay}} 天, 共{{jsTime}} 小时</div>
|
|
|
<span v-if="reportTimeType.type == 3" style="margin-left:30px;">{{isBatch==0?'总':'每日'}}时长:</span>
|
|
|
<el-input-number :disabled="!canEdit" v-if="reportTimeType.type == 3" style="margin-left:10px;" @change="changeAllTime"
|
|
|
v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
|
|
@@ -227,7 +227,8 @@
|
|
|
<el-select v-model="domain.workingTime" style="width:200px;"
|
|
|
v-if="reportTimeType.type == 1"
|
|
|
:disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
|
|
|
- placeholder="请选择工作时长" >
|
|
|
+ placeholder="请选择工作时长"
|
|
|
+ @change="seleChn(0)">
|
|
|
<el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
|
|
|
</el-select>
|
|
|
<span v-if="reportTimeType.type == 1">小时</span>
|
|
@@ -244,7 +245,8 @@
|
|
|
:picker-options="{
|
|
|
start: '08:00',
|
|
|
end: '23:30'
|
|
|
- }">
|
|
|
+ }"
|
|
|
+ @change="iptChang()">
|
|
|
</el-time-picker> - <el-time-picker
|
|
|
:disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
|
|
|
v-model="domain.endTime"
|
|
@@ -256,7 +258,8 @@
|
|
|
start: '08:00',
|
|
|
end: '23:30',
|
|
|
minTime: domain.startTime
|
|
|
- }">
|
|
|
+ }"
|
|
|
+ @change="iptChang()">
|
|
|
</el-time-picker>
|
|
|
</span>
|
|
|
<div class="overtime"><el-checkbox :disabled="!canEdit" v-model="domain.isOvertime">加班</el-checkbox></div>
|
|
@@ -291,11 +294,19 @@
|
|
|
<el-link type="primary" v-if="workForm.domains[index].state == 0 || workForm.domains[index].state == 2"
|
|
|
:underline="false" style="margin-left:5px;" @click="copyProject(index)">复制</el-link>
|
|
|
</el-form-item>
|
|
|
+ <!-- 相关维度 -->
|
|
|
+ <!-- <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1">
|
|
|
+ <el-select v-model="domain.degreeId" clearable placeholder="请选择相关维度">
|
|
|
+ <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
|
|
|
<el-form-item v-if="reportTimeType.type == 3" label="用时占比" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
|
|
|
:rules="{ required: true, message: '请设置用时占比', trigger: 'blur' }">
|
|
|
<div style="width:300px;">
|
|
|
- <el-col span="14"><el-slider :disabled="!canEdit" v-model="domain.progress" :min="10" :show-tooltip="false" :step="10" style="width:180px;" @change="domain.workingTime = (reportTimeType.allday*domain.progress/100).toFixed(1)"></el-slider></el-col>
|
|
|
+ <el-col span="14"><el-slider :disabled="!canEdit" v-model="domain.progress" :min="10" :show-tooltip="false" :step="10" style="width:180px;" @input="domain.workingTime = (reportTimeType.allday*domain.progress/100).toFixed(1)" @change="seleChn(0)"></el-slider></el-col>
|
|
|
<el-col span="10"><span style="margin-left:10px;float:right;"><span style="margin-right:10px;">{{domain.progress}}%</span>{{domain.workingTime}}小时</span></el-col>
|
|
|
</div>
|
|
|
<div class="overtime"><el-checkbox :disabled="!canEdit" v-model="domain.isOvertime">加班</el-checkbox></div>
|
|
@@ -360,6 +371,13 @@
|
|
|
:disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
|
|
|
</span>
|
|
|
</el-form-item>
|
|
|
+ <!-- 相关维度 -->
|
|
|
+ <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1">
|
|
|
+ <el-select v-model="domain.degreeId" clearable placeholder="请选择相关维度">
|
|
|
+ <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<!--项目管理专业版模式下,项目下的近期执行的任务 -->
|
|
|
<el-form-item label="相关任务" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
|
|
|
<el-select v-model="domain.taskId" placeholder="请选择" style="width:100%;" filterable="true"
|
|
@@ -384,8 +402,9 @@
|
|
|
value-format="HH:mm"
|
|
|
:picker-options="{
|
|
|
start: '00:00',
|
|
|
- end: '23:59'
|
|
|
- }">
|
|
|
+ end: '23:59',
|
|
|
+ }"
|
|
|
+ @change="iptChangs()">
|
|
|
</el-time-picker> - <el-time-picker
|
|
|
:disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
|
|
|
v-model="timeItem.endTime"
|
|
@@ -397,7 +416,8 @@
|
|
|
start: '00:00',
|
|
|
end: '23:59',
|
|
|
minTime: timeItem.startTime
|
|
|
- }">
|
|
|
+ }"
|
|
|
+ @change="iptChangs()">
|
|
|
</el-time-picker>
|
|
|
</span>
|
|
|
</el-form-item>
|
|
@@ -421,7 +441,7 @@
|
|
|
</p>
|
|
|
<el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider>
|
|
|
</div>
|
|
|
- <el-link v-if="showAddMore" :disabled="!canEdit" type="primary" :underline="false" @click="addDomain" style="margin-left:40px">添加更多</el-link>
|
|
|
+ <el-link v-if="showAddMore" :disabled="!canEdit" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px">添加更多</el-link>
|
|
|
</el-form>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="deleteReport" v-if="workForm.domains[0].id != null">删除</el-button>
|
|
@@ -666,9 +686,149 @@
|
|
|
domObj: null,
|
|
|
participator:[],
|
|
|
chosenMembCount:0,
|
|
|
+ jsDay: 0,
|
|
|
+ jsTime: 0,
|
|
|
+ falsss: false,
|
|
|
+ weidu: [],
|
|
|
+ weiduList: [],
|
|
|
+ yonghuUser: []
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ userssHu() {
|
|
|
+ this.http.post('/time-type/getCompanyTimeSetting',{
|
|
|
+ companyId: this.user.companyId
|
|
|
+ },
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.yonghuUser = res.data
|
|
|
+ console.log(this.yonghuUser)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
+ iptBlur(i) {
|
|
|
+ console.log(i)
|
|
|
+ // console.log(this.workForm.createDate)
|
|
|
+ if(this.isBatch == 0) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var stat = this.workForm.createDate[0]
|
|
|
+ var end = this.workForm.createDate[1]
|
|
|
+ // this.jsDay = 10
|
|
|
+ this.http.post('/report/getWorkDays',{
|
|
|
+ startDate: stat,
|
|
|
+ endDate: end
|
|
|
+ },
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ // console.log(res, '出来的数据')
|
|
|
+ this.jsDay = res.data
|
|
|
+ this.chuji(i)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+
|
|
|
+ var sl = this.workForm.domains
|
|
|
+ this.chuji(i)
|
|
|
+ // console.log(this.workForm, '看看')
|
|
|
+ },
|
|
|
+ chuji(i) {
|
|
|
+ console.log(12345, i)
|
|
|
+ if(i == 0) {
|
|
|
+ this.seleChn(1)
|
|
|
+ } else if(i == 1) {
|
|
|
+ this.seleChn(0)
|
|
|
+ } else if(i == 2) {
|
|
|
+ if(this.workForm.domains[0].multiWorktime > 0) {
|
|
|
+ console.log('触发上面的')
|
|
|
+ this.iptChangs()
|
|
|
+ } else {
|
|
|
+ console.log('触发下面的')
|
|
|
+ this.iptChang()
|
|
|
+ }
|
|
|
+ } else if(i == 3) {
|
|
|
+ this.seleChn(0)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ seleChn(e) {
|
|
|
+ console.log('出发了', e)
|
|
|
+ if(e == 1) {
|
|
|
+ for(var i in this.workForm.domains) {
|
|
|
+ if(this.workForm.domains[i].timeType == 0) {
|
|
|
+ this.workForm.domains[i].workingTime = 8
|
|
|
+ } else {
|
|
|
+ this.workForm.domains[i].workingTime = 4
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var quanbu = 0
|
|
|
+ var spl = this.workForm.domains
|
|
|
+ var zhi = ''
|
|
|
+ for(var i in spl) {
|
|
|
+ var sp = +spl[i].workingTime + 0
|
|
|
+ zhi = this.jsDay * sp
|
|
|
+ quanbu = +quanbu + zhi
|
|
|
+ }
|
|
|
+ this.jsTime = quanbu
|
|
|
+ },
|
|
|
+ iptChang() {
|
|
|
+ var sl = this.workForm.domains
|
|
|
+ var quanbu = 0
|
|
|
+ var zhi = ''
|
|
|
+ for(var i in sl) {
|
|
|
+ if(sl[i].startTime && sl[i].endTime) {
|
|
|
+ var date2 = '2021/12/12 ' + sl[i].endTime +':00'
|
|
|
+ var date1 = '2021/12/12 ' + sl[i].startTime +':00'
|
|
|
+ var date3 = new Date(date2).getTime() - new Date(date1).getTime();
|
|
|
+ var leave1=date3%(24*3600*1000)
|
|
|
+ var hours=Math.floor(leave1/(3600*1000))
|
|
|
+ var leave2=leave1%(3600*1000)
|
|
|
+ var minutes=Math.floor(leave2/(60*1000))
|
|
|
+ var shi = hours+'.'+ minutes
|
|
|
+ var sll = +shi + 0
|
|
|
+ zhi = this.jsDay * sll
|
|
|
+ quanbu = +quanbu + zhi
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.jsTime = quanbu
|
|
|
+ },
|
|
|
+ iptChangs() {
|
|
|
+ console.log(this.workForm)
|
|
|
+ var sl = this.workForm.domains
|
|
|
+ var quanbu = 0
|
|
|
+ var zhi = ''
|
|
|
+ for(var i in sl) {
|
|
|
+ for(var j in sl[i].worktimeList){
|
|
|
+ if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
|
|
|
+ var date2 = '2021/12/12 ' + sl[i].worktimeList[j].endTime +':00'
|
|
|
+ var date1 = '2021/12/12 ' + sl[i].worktimeList[j].startTime +':00'
|
|
|
+ var date3 = new Date(date2).getTime() - new Date(date1).getTime();
|
|
|
+ var leave1=date3%(24*3600*1000)
|
|
|
+ var hours=Math.floor(leave1/(3600*1000))
|
|
|
+ var leave2=leave1%(3600*1000)
|
|
|
+ var minutes=Math.floor(leave2/(60*1000))
|
|
|
+ var shi = hours+'.'+ minutes
|
|
|
+ var sll = +shi + 0
|
|
|
+ zhi = this.jsDay * sll
|
|
|
+ quanbu = +quanbu + zhi
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.jsTime = quanbu
|
|
|
+ },
|
|
|
removeTimeItem(item, index) {
|
|
|
item.worktimeList.splice(index, 1);
|
|
|
},
|
|
@@ -1007,6 +1167,30 @@
|
|
|
if (this.user.company.packageProject == 1) {
|
|
|
this.getProjectStages(domain, index);
|
|
|
}
|
|
|
+ // 获取项目相关的维度
|
|
|
+ this.dimension(domain, index)
|
|
|
+ },
|
|
|
+ // 获取维度数据
|
|
|
+ dimension(domain, index) {
|
|
|
+ console.log(domain)
|
|
|
+ if(domain.projectId == '') {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.http.post('/project/getDegreeList',{
|
|
|
+ projectId: domain.projectId,
|
|
|
+ },
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.workForm.domains[index].wuduList = res.data
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
},
|
|
|
//切换任务阶段
|
|
|
changeStages(domain, index) {
|
|
@@ -1456,6 +1640,7 @@
|
|
|
},
|
|
|
//时间段范围设置改动,监听
|
|
|
onTimeTypeChange(timeType) {
|
|
|
+ this.seleChn(1)
|
|
|
this.showAddMore = true;
|
|
|
for(var i in this.workForm.domains) {
|
|
|
if (this.workForm.domains[i].timeType == 0) {
|
|
@@ -1505,13 +1690,12 @@
|
|
|
type: "error"
|
|
|
});
|
|
|
});
|
|
|
- },
|
|
|
+ },
|
|
|
// 改变月份
|
|
|
changeMonthOut() {
|
|
|
this.getAllDate();
|
|
|
this.getReportList();
|
|
|
this.getDepartment();
|
|
|
-
|
|
|
},
|
|
|
|
|
|
// 选择日期
|
|
@@ -1676,14 +1860,35 @@
|
|
|
},
|
|
|
res => {
|
|
|
if (res.code == "ok") {
|
|
|
+ var quanbu = 0
|
|
|
+ this.jsDay = 1
|
|
|
+ var zhi = ''
|
|
|
+ var slp = res.data.report
|
|
|
+ for(var i in slp) {
|
|
|
+ var sp = +slp[i].workingTime + 0
|
|
|
+ zhi = this.jsDay * sp
|
|
|
+ quanbu = +quanbu + zhi
|
|
|
+ }
|
|
|
+ this.jsTime = quanbu
|
|
|
var list = res.data;
|
|
|
this.report = list;
|
|
|
if(list.report.length != 0) {
|
|
|
+ console.log('执行上面')
|
|
|
var arr = [];
|
|
|
this.canEdit = false;
|
|
|
for(var i in list.report) {
|
|
|
var flg = null
|
|
|
list.report[i].isOvertime == 1 ? flg = true : flg = false
|
|
|
+ // var srr = []
|
|
|
+ // if(list.report[i].degreeId != null) {
|
|
|
+ // var a = list.report[i].degreeId + ''
|
|
|
+ // var ace = a.split('')
|
|
|
+ // for(var b in ace) {
|
|
|
+ // var nnm = +ace[b] + 0
|
|
|
+ // srr.push(nnm)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
arr.push({
|
|
|
id: list.report[i].id,
|
|
|
projectId: list.report[i].projectId,
|
|
@@ -1707,6 +1912,8 @@
|
|
|
pics: list.report[i].pics,
|
|
|
multiWorktime: list.report[i].multiWorktime,
|
|
|
worktimeList: list.report[i].worktimeList,
|
|
|
+ degreeId: list.report[i].degreeId,
|
|
|
+ wuduList: list.report[i].degreeList,
|
|
|
})
|
|
|
if (list.report[i].state >= 2) {
|
|
|
this.canEdit = true;
|
|
@@ -1718,6 +1925,7 @@
|
|
|
userNames:null,
|
|
|
userId:null,
|
|
|
}
|
|
|
+ console.log(this.workForm, '数据')
|
|
|
} else {
|
|
|
this.workForm = {
|
|
|
createDate: this.workForm.createDate,
|
|
@@ -1751,9 +1959,35 @@
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+ guanbi() {
|
|
|
+ this.falsss = false
|
|
|
+ },
|
|
|
+ // wuduLists(id) {
|
|
|
+ // console.log(id)
|
|
|
+ // this.http.post('/project/getDegreeList',{
|
|
|
+ // projectId: id,
|
|
|
+ // },
|
|
|
+ // res => {
|
|
|
+ // if (res.code == "ok") {
|
|
|
+ // return res.data
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // error => {
|
|
|
+ // this.$message({
|
|
|
+ // message: error,
|
|
|
+ // type: "error"
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // );
|
|
|
+ // },
|
|
|
|
|
|
// 打开日报填写
|
|
|
fillInReport(i, isBatch) {
|
|
|
+ if(i != 1) {
|
|
|
+ this.falsss = false
|
|
|
+ } else {
|
|
|
+ this.falsss = true
|
|
|
+ }
|
|
|
if (this.isSubstitude) {
|
|
|
this.getSubstitudeUserDeptList();
|
|
|
}
|
|
@@ -1790,7 +2024,7 @@
|
|
|
},
|
|
|
|
|
|
// 添加模块
|
|
|
- addDomain() {
|
|
|
+ addDomain(i) {
|
|
|
var leftProgress = 10;
|
|
|
if (this.reportTimeType.type == 3) {
|
|
|
//计算已经待分配工时比例
|
|
@@ -1820,6 +2054,8 @@
|
|
|
this.showAddMore = false;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ this.chuji()
|
|
|
|
|
|
},
|
|
|
|
|
@@ -1834,6 +2070,7 @@
|
|
|
this.showAddMore = true;
|
|
|
}
|
|
|
}
|
|
|
+ this.seleChn(0)
|
|
|
|
|
|
},
|
|
|
|
|
@@ -2042,7 +2279,17 @@
|
|
|
} else {
|
|
|
formData.append("stage", "");
|
|
|
}
|
|
|
+ if(this.workForm.domains[i].degreeId) {
|
|
|
+ var sss = this.workForm.domains[i].degreeId.toString()
|
|
|
+ formData.append("degreeId", sss);
|
|
|
+ }
|
|
|
}
|
|
|
+ // console.log(formData, '看看数据')
|
|
|
+ // formData.forEach((value, key) => {
|
|
|
+ // console.log("%s=%s", key, value);
|
|
|
+ // })
|
|
|
+ // console.log(this.workForm, '这里是数据')
|
|
|
+ // return
|
|
|
this.http.uploadFile( this.port.report.editPort, formData,
|
|
|
res => {
|
|
|
this.listLoading = false;
|
|
@@ -2052,6 +2299,8 @@
|
|
|
type: "success"
|
|
|
});
|
|
|
this.dialogVisible = false;
|
|
|
+ this.jsDay = 0
|
|
|
+ this.jsTime = 0
|
|
|
this.getReportList();
|
|
|
this.getDepartment();
|
|
|
} else {
|
|
@@ -2212,6 +2461,7 @@
|
|
|
this.getTimeType();
|
|
|
this.getDepartment();
|
|
|
this.scrollFunction()
|
|
|
+ this.userssHu()
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
@@ -2325,5 +2575,9 @@
|
|
|
display: inline-block;
|
|
|
margin-left: 30px;
|
|
|
}
|
|
|
+ .bloks {
|
|
|
+ display: inline-block;
|
|
|
+ width: 380px;
|
|
|
+ }
|
|
|
|
|
|
</style>
|