|
@@ -590,15 +590,17 @@
|
|
|
:disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
|
|
|
</el-form-item>
|
|
|
<!-- 拍照上传 -->
|
|
|
- <el-form-item label="图片上传" v-if="user.companyId == '7' || user.companyId == '10'">
|
|
|
+ <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1">
|
|
|
<div class="photos">
|
|
|
- <div class="photos_img" v-for="(p, ip) in domain.pics" :key="ip">
|
|
|
- <img
|
|
|
- style="width: 120px; height: 120px; margin-right:10px;"
|
|
|
- :src="p" />
|
|
|
- </div>
|
|
|
- <div @click="addImg(index)" class="photos_img">
|
|
|
- <img src="../../assets/image/aacbc.png" />
|
|
|
+ <div>
|
|
|
+ <el-upload
|
|
|
+ list-type="picture-card"
|
|
|
+ :http-request="(file) => {return addImg(file, index)}"
|
|
|
+ :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
|
|
|
+ :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
|
|
|
+ :file-list="domain.imgListUrl" :limit="9">
|
|
|
+ <i class="el-icon-plus"></i>
|
|
|
+ </el-upload>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
@@ -769,8 +771,9 @@
|
|
|
:src="pic"
|
|
|
:preview-src-list="domain.pics">
|
|
|
</el-image>
|
|
|
- </p> -->
|
|
|
- <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider>
|
|
|
+ </p>
|
|
|
+ <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
|
|
|
+
|
|
|
</div>
|
|
|
<span id="workFormsItemBottom"></span>
|
|
|
<el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
|
|
@@ -2014,7 +2017,6 @@
|
|
|
console.log('进一')
|
|
|
for(let m in domains[i].worktimeList){
|
|
|
if(domains[i].worktimeList[m].startTime && domains[i].worktimeList[m].endTime){
|
|
|
- // hours += this.getHour(domains[i].worktimeList[m].startTime, domains[i].worktimeList[m].endTime)
|
|
|
let selectionTime = this.getHour(domains[i].worktimeList[m].startTime, domains[i].worktimeList[m].endTime)
|
|
|
let subtractedData = 0
|
|
|
console.log(selectionTime)
|
|
@@ -2031,7 +2033,6 @@
|
|
|
}
|
|
|
}else{
|
|
|
if(this.user.timeType.type == 2){
|
|
|
- console.log('进2')
|
|
|
if(domains[i].startTime && domains[i].endTime){
|
|
|
// let selectionTime = this.getHourMinutes(domains[i].startTime, domains[i].endTime)
|
|
|
let selectionTime = this.getHour(domains[i].startTime, domains[i].endTime)
|
|
@@ -2047,7 +2048,6 @@
|
|
|
// hours += this.getHour(domains[i].startTime, domains[i].endTime)
|
|
|
}
|
|
|
}else{
|
|
|
- console.log('进3')
|
|
|
hours += domains[i].workingTime ? parseFloat(domains[i].workingTime) : 0
|
|
|
}
|
|
|
}
|
|
@@ -2118,58 +2118,58 @@
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ handlePictureCardPreview(file, index) {
|
|
|
+ console.log(file, index)
|
|
|
+ let arr = []
|
|
|
+ let imgArr = this.workForm.domains[index].imgListUrl
|
|
|
+ for(var i in imgArr) {
|
|
|
+ arr.push(imgArr[i].url)
|
|
|
+ }
|
|
|
+ console.log(arr, '图片数据')
|
|
|
+ const $viewer = this.$viewerApi({
|
|
|
+ images: arr
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
// 图片上传
|
|
|
- addImg(index) {
|
|
|
- var that = this;
|
|
|
- // if (that.workForm.domains[index].pics == null) {
|
|
|
- // that.workForm.domains[index].pics = [];
|
|
|
- // that.workForm.domains[index].iospics = [];
|
|
|
- // }
|
|
|
- // that.workForm.domains[index].pics.push('wxLocalResource://imageidQzpcVXNlcnNcTEpZXERlc2t0b3Bc5oG25pCe5Zu+54mHXGhwLmpwZw==')
|
|
|
- // console.log(that.workForm.domains)
|
|
|
- wx.chooseImage({
|
|
|
- count: 3, // 默认9
|
|
|
- sizeType: ['compressed'],
|
|
|
- sourceType: ['album'],
|
|
|
- defaultCameraMode: "batch",
|
|
|
- success: function (res) {
|
|
|
- console.log(res, '数据')
|
|
|
- var localIds = res.localIds;
|
|
|
- wx.getLocalImgData({
|
|
|
- localId: localIds[0], // 图片的localID
|
|
|
- success: function (res) {
|
|
|
- var localData = res.localData;
|
|
|
- console.log('转之后的', localData, res)
|
|
|
- if (that.workForm.domains[index].pics == null) {
|
|
|
- that.workForm.domains[index].pics = [];
|
|
|
- that.workForm.domains[index].iospics = [];
|
|
|
- }
|
|
|
- if (that.user.companyId == 7) {
|
|
|
- that.workForm.domains[index].pics = that.workForm.domains[index].pics.concat(localData);
|
|
|
- } else {
|
|
|
- that.workForm.domains[index].pics = localData;
|
|
|
- }
|
|
|
- that.$forceUpdate();
|
|
|
- if (that.workForm.domains[index].serverPics == null) {
|
|
|
- that.workForm.domains[index].serverPics = [];
|
|
|
- }
|
|
|
- for (var i=0;i<localIds.length; i++) {
|
|
|
- wx.uploadImage({
|
|
|
- localId: localIds[i], // 需要上传的图片的本地ID,由chooseImage接口获得
|
|
|
- isShowProgressTips: 1, // 默认为1,显示进度提示
|
|
|
- success: function (res) {
|
|
|
- var serverId = res.serverId; // 返回图片的服务器端ID
|
|
|
- that.workForm.domains[index].serverPics.push(serverId);
|
|
|
-
|
|
|
- console.log(that.workForm.domains, '数据')
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
+ addImg(e, index) {
|
|
|
+ console.log(e, '数据')
|
|
|
+ let formData = new FormData()
|
|
|
+ formData.append('multipartFile', e.file)
|
|
|
+ this.http.uploadFile('/common/uploadFile', formData,
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t('uploadedsuccessfully'),
|
|
|
+ type: "success"
|
|
|
});
|
|
|
-
|
|
|
+ if(!this.workForm.domains[index].imgList) {
|
|
|
+ this.workForm.domains[index].imgList = []
|
|
|
+ this.workForm.domains[index].imgListUrl = []
|
|
|
+ }
|
|
|
+ this.workForm.domains[index].imgList.push(res.data)
|
|
|
+ this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
|
|
|
+ } else {
|
|
|
+ this.$message({message: res.msg,type: "error"});
|
|
|
}
|
|
|
- })
|
|
|
+ console.log(this.workForm.domains[index])
|
|
|
+ },
|
|
|
+ error => {this.$message({message: error,type: "error"});
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 删除图片
|
|
|
+ delImg(file,fileList, index) {
|
|
|
+ console.log(file, fileList)
|
|
|
+ let idx = 0
|
|
|
+ for(let i in fileList) {
|
|
|
+ if(fileList[i].uid == file.uid) {
|
|
|
+ idx = i
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.workForm.domains[index].imgList.splice(idx, 1)
|
|
|
+ this.workForm.domains[index].imgListUrl.splice(idx, 1)
|
|
|
+ console.log(this.workForm.domains[index])
|
|
|
},
|
|
|
test(){
|
|
|
console.log('test',this.workForm.domains);
|
|
@@ -2777,15 +2777,16 @@
|
|
|
var sl = this.workForm.domains
|
|
|
var quanbu = 0
|
|
|
var zhi = ''
|
|
|
+ let timeArr = []
|
|
|
for(var i in sl) {
|
|
|
for(var j in sl[i].worktimeList){
|
|
|
let addUp = 0
|
|
|
if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
|
|
|
let selectionTime = this.getHour(sl[i].worktimeList[j].startTime, sl[i].worktimeList[j].endTime)
|
|
|
let subtractedData = 0
|
|
|
- console.log(selectionTime)
|
|
|
let arr = JSON.parse(JSON.stringify(this.vacationTime))
|
|
|
arr.unshift({s: sl[i].worktimeList[j].startTime, e: sl[i].worktimeList[j].endTime})
|
|
|
+ timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
|
|
|
for(var j in arr) {
|
|
|
subtractedData += +this.timeOverlap(j, arr)
|
|
|
}
|
|
@@ -2800,8 +2801,21 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- // this.jsTime = quanbu
|
|
|
this.$set(this, 'jsTime', quanbu)
|
|
|
+ this.getTimeHours(timeArr)
|
|
|
+ },
|
|
|
+ // 调用接口或去数据
|
|
|
+ getTimeHours(arr) {
|
|
|
+ this.http.post('/report/getHoursByTimeRange',{
|
|
|
+ timeJsonStr: JSON.stringify(arr)
|
|
|
+ },res => {
|
|
|
+ this.$set(this, 'jsTime', res.data)
|
|
|
+ },err => {
|
|
|
+ this.$message({
|
|
|
+ message: err,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
removeTimeItem(item, index) {
|
|
|
item.worktimeList.splice(index, 1);
|
|
@@ -4702,6 +4716,19 @@
|
|
|
if (list.report[i].state == 0){
|
|
|
this.canCancelInDialog = true
|
|
|
}
|
|
|
+ // 加判断
|
|
|
+ if(this.user.timeType.choseFromAlbum == 1) {
|
|
|
+ let arrList = []
|
|
|
+ for(var k in list.report[i].pics) {
|
|
|
+ let obj = {
|
|
|
+ name: k,
|
|
|
+ url: list.report[i].pics[k]
|
|
|
+ }
|
|
|
+ arrList.push(obj)
|
|
|
+ }
|
|
|
+ arr[i].imgListUrl = arrList
|
|
|
+ arr[i].imgList = list.report[i].pics
|
|
|
+ }
|
|
|
}
|
|
|
this.reportCanDelete = candelete
|
|
|
this.workForm = {
|
|
@@ -4711,6 +4738,7 @@
|
|
|
userId:null,
|
|
|
time: list.time
|
|
|
}
|
|
|
+ console.log('workForm', this.workForm)
|
|
|
} else {
|
|
|
this.workForm = {
|
|
|
createDate: this.workForm.createDate,
|
|
@@ -5315,7 +5343,6 @@
|
|
|
if (((dateAr[k].s <= dateAr[idx].s && dateAr[k].e >= dateAr[idx].s) || (dateAr[k].s <= dateAr[idx].s && dateAr[k].e <= dateAr[idx].e))) {
|
|
|
// 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
|
|
|
if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
|
|
|
- // zhi += 2
|
|
|
zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
|
|
|
}
|
|
|
// 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
|
|
@@ -6020,8 +6047,13 @@
|
|
|
this.isDraft = isDraft;
|
|
|
this.$refs.workForm.validate(valid => {
|
|
|
if (valid) {
|
|
|
-
|
|
|
- if(this.totalReportHours < this.user.timeType.allday){
|
|
|
+ var timesHours = 0
|
|
|
+ if(this.reportTimeType.multiWorktime == 1) {
|
|
|
+ timesHours = this.totalReportHours
|
|
|
+ } else {
|
|
|
+ timesHours = jsTime
|
|
|
+ }
|
|
|
+ if(timesHours < this.user.timeType.allday){
|
|
|
this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
@@ -6306,6 +6338,20 @@
|
|
|
formData.append("progress", this.workForm.domains[i].progress);
|
|
|
formData.append("workingTime", this.workForm.domains[i].workingTime);
|
|
|
}
|
|
|
+
|
|
|
+ if(this.user.timeType.choseFromAlbum == 1 ) {
|
|
|
+ console.log(this.workForm.domains[i].imgList)
|
|
|
+ if(this.workForm.domains[i].imgList) {
|
|
|
+ let imgListFor = this.workForm.domains[i].imgList
|
|
|
+ for(var b in imgListFor) {
|
|
|
+ imgListFor[b] = imgListFor[b].replace('/upload/', '')
|
|
|
+ }
|
|
|
+ console.log(imgListFor)
|
|
|
+ let m = JSON.stringify(imgListFor);
|
|
|
+ m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
|
|
|
+ formData.append("picStr", m);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
//处理多个时间事项
|
|
@@ -6867,6 +6913,10 @@
|
|
|
</style>
|
|
|
|
|
|
<style lang="scss">
|
|
|
+/*去除upload组件过渡效果*/
|
|
|
+.photos .el-upload-list__item {
|
|
|
+ transition: none !important;
|
|
|
+}
|
|
|
.daily {
|
|
|
.el-card__body {
|
|
|
height: 80%;
|
|
@@ -6898,6 +6948,7 @@
|
|
|
</style>
|
|
|
|
|
|
<style scoped>
|
|
|
+
|
|
|
/* 项目标签的样式 */
|
|
|
.el-tag + .el-tag {
|
|
|
margin-left: 10px;
|