flx:优化页面
This commit is contained in:
parent
a4168b5bd3
commit
8033850e36
@ -965,6 +965,7 @@ export default {
|
||||
teamOptions: [],
|
||||
departmentOptions: [],
|
||||
addPersonnelDialog: false,
|
||||
selectListAll: [],
|
||||
title: "",
|
||||
};
|
||||
},
|
||||
|
||||
@ -444,11 +444,17 @@
|
||||
<img
|
||||
:src="fileUrl + scope.row.imageUrl"
|
||||
style="width: 40px; height: 60px; cursor: pointer"
|
||||
v-if="scope.row.imageUrl"
|
||||
@click="
|
||||
bigImageUrl = fileUrl + scope.row.imageUrl;
|
||||
bigImageDialog = true;
|
||||
"
|
||||
/>
|
||||
<img
|
||||
style="width: 40px; height: 60px; cursor: pointer"
|
||||
src="@/assets/images/profile_photo.png"
|
||||
v-else
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
@ -278,34 +278,39 @@
|
||||
<div>根据不同工时段换算工日</div>
|
||||
<p>例:可设置0~~6工时(包含6工时)算0.5工日:6~~24工时算1工日</p>
|
||||
<div class="progress-time">
|
||||
<div v-for="(item, index) in 25">
|
||||
<div v-if="workerInfo.hour2dayStart == index || workerInfo.hour2dayEnd == index" class="progress-active">{{ index }}</div>
|
||||
<div @click="onClickPitch(index, 1)" v-for="(item, index) in 25">
|
||||
<div v-if="activePitchUp(hour2dayList, index)" class="progress-active">{{ index }}</div>
|
||||
<div class="progress-bj"></div>
|
||||
<div class="progress-wz">{{ index }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="rulebox">
|
||||
<div class="rulebox" v-for="(item, index) in workerInfo.hour2dayJson">
|
||||
<div>规则</div>
|
||||
<el-input-number
|
||||
v-model="workerInfo.hour2dayStart"
|
||||
:disabled="index == 0"
|
||||
v-model="item.hourMin"
|
||||
controls-position="right"
|
||||
@change="onHour2dayChange"
|
||||
:min="0"
|
||||
:max="workerInfo.hour2dayEnd ? workerInfo.hour2dayEnd : 24"
|
||||
:max="item.hourMax ? item.hourMax : 24"
|
||||
></el-input-number>
|
||||
<p>工时至</p>
|
||||
<el-input-number
|
||||
v-model="workerInfo.hour2dayEnd"
|
||||
:disabled="index == workerInfo.hour2dayJson.length - 1"
|
||||
v-model="item.hourMax"
|
||||
controls-position="right"
|
||||
:min="workerInfo.hour2dayStart ? workerInfo.hour2dayStart : 0"
|
||||
@change="onHour2dayChange"
|
||||
:min="item.hourMin ? item.hourMin : 0"
|
||||
:max="24"
|
||||
></el-input-number>
|
||||
<p>工时等于</p>
|
||||
<el-input-number
|
||||
v-model="workerInfo.hour2dayDay"
|
||||
v-model="item.day"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
></el-input-number>
|
||||
<p>工日</p>
|
||||
<i v-if="index != 0" @click="onDeletePitch(index, 1)" class="el-icon-error"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -380,13 +385,13 @@
|
||||
<div class="timing">
|
||||
<div>设置特定时间范围:</div>
|
||||
<el-time-picker
|
||||
format="HH:mm"
|
||||
value-format="HH:mm"
|
||||
v-model="workerInfo.overtimeHourStart"
|
||||
placeholder="时间点">
|
||||
</el-time-picker>
|
||||
<p>-</p>
|
||||
<el-time-picker
|
||||
format="HH:mm"
|
||||
value-format="HH:mm"
|
||||
v-model="workerInfo.overtimeHourEnd"
|
||||
placeholder="时间点">
|
||||
</el-time-picker>
|
||||
@ -406,34 +411,39 @@
|
||||
<div>根据不同工时段换算工日</div>
|
||||
<p>例:可设置0~~6工时(包含6工时)算0.5工日:6~~24工时算1工日</p>
|
||||
<div class="progress-time">
|
||||
<div v-for="(item, index) in 25">
|
||||
<div v-if="workerInfo.overtimeHour2dayStart == index || workerInfo.overtimeHour2dayEnd == index" class="progress-active">{{ index }}</div>
|
||||
<div @click="onClickPitch(index, 2)" v-for="(item, index) in 25">
|
||||
<div v-if="activePitchUp(overtimeHour2dayList, index)" class="progress-active">{{ index }}</div>
|
||||
<div class="progress-bj"></div>
|
||||
<div class="progress-wz">{{ index }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="rulebox">
|
||||
<div class="rulebox" v-for="(item, index) in workerInfo.overtimeHour2dayJson">
|
||||
<div>规则</div>
|
||||
<el-input-number
|
||||
v-model="workerInfo.overtimeHour2dayStart"
|
||||
:disabled="index == 0"
|
||||
v-model="item.hourMin"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
:max="workerInfo.overtimeHour2dayEnd ? workerInfo.overtimeHour2dayEnd : 24"
|
||||
@change="onOvertimeHour2dayChange"
|
||||
:max="item.hourMax ? item.hourMax : 24"
|
||||
></el-input-number>
|
||||
<p>工时至</p>
|
||||
<el-input-number
|
||||
v-model="workerInfo.overtimeHour2dayEnd"
|
||||
:disabled="index == workerInfo.overtimeHour2dayJson.length - 1"
|
||||
v-model="item.hourMax"
|
||||
@change="onOvertimeHour2dayChange"
|
||||
controls-position="right"
|
||||
:min="workerInfo.overtimeHour2dayStart ? workerInfo.overtimeHour2dayStart : 0"
|
||||
:min="item.hourMin ? item.hourMin : 0"
|
||||
:max="24"
|
||||
></el-input-number>
|
||||
<p>工时等于</p>
|
||||
<el-input-number
|
||||
v-model="workerInfo.overtimeHour2dayDay"
|
||||
v-model="item.day"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
></el-input-number>
|
||||
<p>工日</p>
|
||||
<i v-if="index != 0" @click="onDeletePitch(index, 2)" class="el-icon-error"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -513,6 +523,8 @@ import {
|
||||
getProjectConfigListApi,
|
||||
editProjectConfigListApi,
|
||||
} from "@/assets/js/api/project.js";
|
||||
import { isJSON } from '@/util/nowDate';
|
||||
import dayjs from "dayjs";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -540,7 +552,7 @@ export default {
|
||||
yesAdvance: "",
|
||||
},
|
||||
rules: {
|
||||
ruleName: [
|
||||
planName: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t("message.workType.placeholder"),
|
||||
@ -569,6 +581,8 @@ export default {
|
||||
},
|
||||
workerAttendanceGroupList: [],
|
||||
batchSettingType: "",
|
||||
hour2dayList: [0, 24],
|
||||
overtimeHour2dayList: [0, 24],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
@ -577,6 +591,71 @@ export default {
|
||||
this.getProjectDetailFn();
|
||||
},
|
||||
methods: {
|
||||
onHour2dayChange(currentValue, oldValue) {
|
||||
const findIndex = this.hour2dayList.findIndex(item => item == oldValue);
|
||||
if(findIndex != -1) {
|
||||
this.hour2dayList.splice(findIndex, 1, currentValue);
|
||||
this.generateHour2dayJson();
|
||||
}
|
||||
},
|
||||
onOvertimeHour2dayChange(currentValue, oldValue) {
|
||||
const findIndex = this.overtimeHour2dayList.findIndex(item => item == oldValue);
|
||||
if(findIndex != -1) {
|
||||
this.overtimeHour2dayList.splice(findIndex, 1, currentValue);
|
||||
this.generateOvertimeHour2dayJson();
|
||||
}
|
||||
},
|
||||
onClickPitch(item, type) {
|
||||
if(type == 1) {
|
||||
this.hour2dayList.push(item);
|
||||
this.generateHour2dayJson();
|
||||
} else if(type == 2) {
|
||||
this.overtimeHour2dayList.push(item);
|
||||
this.generateOvertimeHour2dayJson();
|
||||
}
|
||||
|
||||
},
|
||||
onDeletePitch(eIndex, type) {
|
||||
if(type == 1) {
|
||||
const findIndex = this.hour2dayList.findIndex(item => item == this.workerInfo.hour2dayJson[eIndex].hourMin);
|
||||
if(findIndex != -1) {
|
||||
this.hour2dayList.splice(findIndex, 1);
|
||||
this.generateHour2dayJson();
|
||||
}
|
||||
} else if (type == 2) {
|
||||
const findIndex = this.overtimeHour2dayList.findIndex(item => item == this.workerInfo.overtimeHour2dayJson[eIndex].hourMin);
|
||||
if(findIndex != -1) {
|
||||
this.overtimeHour2dayList.splice(findIndex, 1);
|
||||
this.generateOvertimeHour2dayJson();
|
||||
}
|
||||
}
|
||||
},
|
||||
generateHour2dayJson() {
|
||||
const resultSortList = this.hour2dayList.sort((a,b) => a - b);
|
||||
const oldSelectionList = this.workerInfo.hour2dayJson;
|
||||
this.workerInfo.hour2dayJson = [];
|
||||
resultSortList.forEach((ele, index) => {
|
||||
if(index == 0) return;
|
||||
this.workerInfo.hour2dayJson.push({
|
||||
hourMin: resultSortList[index-1],
|
||||
hourMax: ele,
|
||||
day: oldSelectionList[index-1] ? oldSelectionList[index-1].day : 0,
|
||||
})
|
||||
})
|
||||
},
|
||||
generateOvertimeHour2dayJson() {
|
||||
const resultSortList = this.overtimeHour2dayList.sort((a,b) => a - b);
|
||||
const oldSelectionList = this.workerInfo.overtimeHour2dayJson;
|
||||
this.workerInfo.overtimeHour2dayJson = [];
|
||||
resultSortList.forEach((ele, index) => {
|
||||
if(index == 0) return;
|
||||
this.workerInfo.overtimeHour2dayJson.push({
|
||||
hourMin: resultSortList[index-1],
|
||||
hourMax: ele,
|
||||
day: oldSelectionList[index-1] ? oldSelectionList[index-1].day : 0,
|
||||
})
|
||||
})
|
||||
},
|
||||
getWorkerAttendanceGroupV2List() {
|
||||
getWorkerAttendanceGroupV2ListApi({
|
||||
projectSn: this.$store.state.projectSn,
|
||||
@ -687,8 +766,18 @@ export default {
|
||||
hour2dayStart: "",
|
||||
hour2dayEnd: "",
|
||||
hour2dayDay: "",
|
||||
hour2dayJson: [{
|
||||
hourMin: 0,
|
||||
hourMax: 24,
|
||||
day: 0,
|
||||
}],
|
||||
ratio2dayHour: "",
|
||||
ratio2dayDay: "",
|
||||
overtimeHour2dayJson: [{
|
||||
hourMin: 0,
|
||||
hourMax: 24,
|
||||
day: 0,
|
||||
}],
|
||||
ratio2dayLess1: "",
|
||||
isOpenOvertime: false,
|
||||
overtimeHourType: "",
|
||||
@ -701,6 +790,8 @@ export default {
|
||||
overtimeRatio2dayHour: "",
|
||||
overtimeRatio2dayDay: "",
|
||||
}
|
||||
this.hour2dayList = [0, 24];
|
||||
this.overtimeHour2dayList= [0, 24];
|
||||
},
|
||||
addBefore(type) {
|
||||
this.batchSettingType = type;
|
||||
@ -735,10 +826,47 @@ export default {
|
||||
// console.log('编辑前的内容', worker)
|
||||
this.workerInfo = JSON.parse(JSON.stringify({
|
||||
...worker,
|
||||
overtimeHourStart: worker.overtimeHourStart ? dayjs(worker.overtimeHourStart).format('HH:mm') : "",
|
||||
overtimeHourEnd: worker.overtimeHourStart ? dayjs(worker.overtimeHourEnd).format('HH:mm') : "",
|
||||
isOpenOvertime: worker.isOpenOvertime == 1 ? true : false,
|
||||
ratio2dayLess1: worker.ratio2dayLess1 == 1 ? true : false,
|
||||
overtimeRatio2dayLess1: worker.overtimeRatio2dayLess1 == 1 ? true : false,
|
||||
hour2dayJson: isJSON(worker.hour2dayJson) && worker.hour2dayJson ? JSON.parse(worker.hour2dayJson) : [{
|
||||
hourMin: 0,
|
||||
hourMax: 24,
|
||||
day: 0,
|
||||
}],
|
||||
overtimeHour2dayJson: isJSON(worker.overtimeHour2dayJson) && worker.overtimeHour2dayJson ? JSON.parse(worker.overtimeHour2dayJson) : [{
|
||||
hourMin: 0,
|
||||
hourMax: 24,
|
||||
day: 0,
|
||||
}],
|
||||
}));
|
||||
if(this.workerInfo.hour2dayJson.length > 2) {
|
||||
this.workerInfo.hour2dayJson.forEach(item => {
|
||||
if(!this.hour2dayList.includes(item.hourMin)) {
|
||||
this.hour2dayList.push(item.hourMin)
|
||||
}
|
||||
if(!this.hour2dayList.includes(item.hourMax)) {
|
||||
this.hour2dayList.push(item.hourMax)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.hour2dayList = [0, 24];
|
||||
}
|
||||
if(this.workerInfo.overtimeHour2dayJson.length > 2) {
|
||||
this.workerInfo.overtimeHour2dayJson.forEach(item => {
|
||||
if(!this.overtimeHour2dayList.includes(item.hourMin)) {
|
||||
this.overtimeHour2dayList.push(item.hourMin)
|
||||
}
|
||||
if(!this.overtimeHour2dayList.includes(item.hourMax)) {
|
||||
this.overtimeHour2dayList.push(item.hourMax)
|
||||
}
|
||||
})
|
||||
}else {
|
||||
this.overtimeHour2dayList= [0, 24];
|
||||
}
|
||||
|
||||
this.getWorkerAttendanceGroupV2List();
|
||||
},
|
||||
deleteBefore(worker) {},
|
||||
@ -775,9 +903,14 @@ export default {
|
||||
Submit() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
const defaultTime = dayjs().format('YYYY-MM-DD');
|
||||
const params = {
|
||||
...this.workerInfo,
|
||||
projectSn : this.$store.state.projectSn,
|
||||
overtimeHourStart: this.workerInfo.overtimeHourStart ? dayjs(defaultTime + this.workerInfo.overtimeHourStart + ':00').format('YYYY-MM-DD HH:mm:ss') : "",
|
||||
overtimeHourEnd: this.workerInfo.overtimeHourEnd ? dayjs(defaultTime + this.workerInfo.overtimeHourEnd + ':00').format('YYYY-MM-DD HH:mm:ss') : "",
|
||||
hour2dayJson: JSON.stringify(this.workerInfo.hour2dayJson),
|
||||
overtimeHour2dayJson: JSON.stringify(this.workerInfo.overtimeHour2dayJson),
|
||||
isOpenOvertime: this.workerInfo.isOpenOvertime ? 1 : 0,
|
||||
ratio2dayLess1: this.workerInfo.ratio2dayLess1 ? 1 : 0,
|
||||
overtimeRatio2dayLess1: this.workerInfo.overtimeRatio2dayLess1 ? 1 : 0,
|
||||
@ -806,6 +939,13 @@ export default {
|
||||
});
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
activePitchUp() {
|
||||
return (dataList, index) => {
|
||||
return dataList.includes(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
@ -931,6 +1071,7 @@ export default {
|
||||
}
|
||||
.rulebox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 10px;
|
||||
> div:first-child {
|
||||
margin-right: 10px;
|
||||
@ -942,9 +1083,16 @@ export default {
|
||||
color: #a2a4af;
|
||||
margin-left: 10px;
|
||||
}
|
||||
> i {
|
||||
color: #a2a4af;
|
||||
margin-left: 10px;
|
||||
}
|
||||
/deep/ .el-input-number {
|
||||
width: 80px;
|
||||
line-height: 24px;
|
||||
.el-input {
|
||||
width: 80px !important;
|
||||
}
|
||||
.el-input-number__decrease {
|
||||
height: 12px;
|
||||
line-height: 12px;
|
||||
|
||||
@ -154,14 +154,14 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="checkWorkerNames"
|
||||
prop="totalHour"
|
||||
show-overflow-tooltip
|
||||
label="合计"
|
||||
align="center"
|
||||
width="90"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.checkWorkerNames ? scope.row.checkWorkerNames : "--" }}
|
||||
{{ scope.row.totalHour ? scope.row.totalHour : "--" }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -425,7 +425,7 @@ export default {
|
||||
let dataList = [];
|
||||
for (const key in dateTime) {
|
||||
dataList.push({
|
||||
date: dayjs(key).format("YYYY/MM/DD"),
|
||||
date: dayjs(key).format("YYYY-MM-DD"),
|
||||
day: dayjs(key).format("DD"),
|
||||
});
|
||||
}
|
||||
|
||||
@ -233,7 +233,8 @@
|
||||
realTimeDevData.ranger
|
||||
? realTimeDevData.ranger
|
||||
: 0
|
||||
}}°
|
||||
}}m
|
||||
<!-- ° -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user