修复数字建BUG
parent
8a4261e572
commit
b494391d44
|
@ -207,7 +207,7 @@ export default {
|
|||
if (tmps.length > 0) {
|
||||
this.$store.dispatch("SetSelProject", tmps[0]);
|
||||
this.selProject = tmps[0];
|
||||
if(this.sel.vendorsCode == "jgw" ){
|
||||
if(this.selProject.vendorsCode == "jgw" ){
|
||||
this.selProject.vendorsCode = "uni";
|
||||
}
|
||||
|
||||
|
|
|
@ -4,8 +4,18 @@
|
|||
<module-one-1-1 label="劳务人员概况" class="labor-base">
|
||||
<div class="attendance-info warning-info">
|
||||
<div class="attendance-info-title warning-info-title">
|
||||
<div :class="attendanceNav == 0 ? 'active' : ''" @click="doAttendanceNav(0, '在岗人员')">在岗人员</div>
|
||||
<div :class="attendanceNav == 1 ? 'active' : ''" @click="doAttendanceNav(1, '今日出勤')">今日出勤</div>
|
||||
<div
|
||||
:class="attendanceNav == 0 ? 'active' : ''"
|
||||
@click="doAttendanceNav(0, '在岗人员')"
|
||||
>
|
||||
在岗人员
|
||||
</div>
|
||||
<div
|
||||
:class="attendanceNav == 1 ? 'active' : ''"
|
||||
@click="doAttendanceNav(1, '今日出勤')"
|
||||
>
|
||||
今日出勤
|
||||
</div>
|
||||
</div>
|
||||
<el-row>
|
||||
<el-col :span="8" class="attendance-tag">
|
||||
|
@ -28,38 +38,77 @@
|
|||
</div>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<staffSurveyChart :key="chartKey" :height="$dpi() == '1K' ? '220px' : $dpi() == '2K' ? '330px' : '550px'" :data="attendanceData" :width="140"></staffSurveyChart>
|
||||
<staffSurveyChart
|
||||
:key="chartKey"
|
||||
:height="
|
||||
$dpi() == '1K' ? '220px' : $dpi() == '2K' ? '330px' : '550px'
|
||||
"
|
||||
:data="attendanceData"
|
||||
:width="140"
|
||||
></staffSurveyChart>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</module-one-1-1>
|
||||
<module-one-1-1 label="劳务人员七天出勤趋势" class="labor-week-att">
|
||||
<my-chart :key="chartKey" id="prj_labor_chart2" width="100%" height="calc(100% - 40px)" :render="renderChart2"></my-chart>
|
||||
<my-chart
|
||||
:key="chartKey"
|
||||
id="prj_labor_chart2"
|
||||
width="100%"
|
||||
height="calc(100% - 40px)"
|
||||
:render="renderChart2"
|
||||
></my-chart>
|
||||
</module-one-1-1>
|
||||
<module-one-1-1 label="劳务人员年龄分布">
|
||||
<my-chart :key="chartKey" id="prj_labor_chart3" width="100%" height="calc(100% - 0px)" :render="renderChart3"></my-chart>
|
||||
<my-chart
|
||||
:key="chartKey"
|
||||
id="prj_labor_chart3"
|
||||
width="100%"
|
||||
height="calc(100% - 0px)"
|
||||
:render="renderChart3"
|
||||
></my-chart>
|
||||
</module-one-1-1>
|
||||
</el-col>
|
||||
<el-col :span="12" class="h100">
|
||||
<module-one-2-2 label class="no-title no-border">
|
||||
<my-chart :key="chartKey" id="prj-labor-map" width="100%" height="100%" :render="renderMap"></my-chart>
|
||||
<my-chart
|
||||
:key="chartKey"
|
||||
id="prj-labor-map"
|
||||
width="100%"
|
||||
height="100%"
|
||||
:render="renderMap"
|
||||
></my-chart>
|
||||
</module-one-2-2>
|
||||
<module-one-1-2 label="实时进出" class="prj-labor-real">
|
||||
<div class="real-item" v-for="(item, index) in realList" :key="index">
|
||||
<div class="real-item-type" :class="'is-'+item.inOutType">{{ item.inOutType==='out'?'出':'进' }}</div>
|
||||
<el-image class="real-item-img" fit="cover" :src="item.img" :preview-src-list="[item.img]"></el-image>
|
||||
<div class="real-item-type" :class="'is-' + item.inOutType">
|
||||
{{ item.inOutType === "out" ? "出" : "进" }}
|
||||
</div>
|
||||
<el-image
|
||||
class="real-item-img"
|
||||
fit="cover"
|
||||
:src="item.img"
|
||||
:preview-src-list="[item.img]"
|
||||
></el-image>
|
||||
<div class="real-item-name">{{ item.name }}</div>
|
||||
<div class="real-item-work-type">
|
||||
<span>{{ item.workType }}</span>
|
||||
</div>
|
||||
<div class="real-item-time">
|
||||
<span>{{item.inOutType==='in'?'进场时间:':'出场时间:'}} {{ item.inoutDate }}</span>
|
||||
<span
|
||||
>{{ item.inOutType === "in" ? "进场时间:" : "出场时间:" }}
|
||||
{{ item.inoutDate }}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</module-one-1-2>
|
||||
</el-col>
|
||||
<el-col :span="6" class="h100">
|
||||
<module-one-1-1 label="工种占比分布" class="chart-module4" :key="chartKey">
|
||||
<module-one-1-1
|
||||
label="工种占比分布"
|
||||
class="chart-module4"
|
||||
:key="chartKey"
|
||||
>
|
||||
<project-overview-chart
|
||||
:htmlShow="true"
|
||||
:key="'ai4' + chartKey"
|
||||
|
@ -73,7 +122,13 @@
|
|||
></project-overview-chart>
|
||||
</module-one-1-1>
|
||||
<module-one-1-1 label="人员地区分布">
|
||||
<my-chart :key="chartKey" id="prj_labor_chart5" width="100%" height="100%" :render="renderChart5"></my-chart>
|
||||
<my-chart
|
||||
:key="chartKey"
|
||||
id="prj_labor_chart5"
|
||||
width="100%"
|
||||
height="100%"
|
||||
:render="renderChart5"
|
||||
></my-chart>
|
||||
</module-one-1-1>
|
||||
<module-one-1-1 label="人员预警" class="prj-labor-alert">
|
||||
<div class="alert-list scroll">
|
||||
|
@ -100,13 +155,13 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import debounce from 'lodash.debounce'
|
||||
import staffSurveyChart from '@/components/staffSurveyChart.vue'
|
||||
import debounce from "lodash.debounce";
|
||||
import staffSurveyChart from "@/components/staffSurveyChart.vue";
|
||||
export default {
|
||||
components: { staffSurveyChart },
|
||||
data() {
|
||||
return {
|
||||
dpi: '',
|
||||
dpi: "",
|
||||
chartKey: 0,
|
||||
chart4Height: 230,
|
||||
chart2Height: 230,
|
||||
|
@ -114,9 +169,9 @@ export default {
|
|||
attendanceNav: 0,
|
||||
attendanceTotal: 0,
|
||||
attendanceData: [
|
||||
{ text: '普通工种', value: 0, id: 0 },
|
||||
{ text: '特殊工种', value: 0, id: 0 },
|
||||
{ text: '管理人员', value: 0, id: 0 },
|
||||
{ text: "普通工种", value: 0, id: 0 },
|
||||
{ text: "特殊工种", value: 0, id: 0 },
|
||||
{ text: "管理人员", value: 0, id: 0 },
|
||||
],
|
||||
legendOpt: {},
|
||||
overviewDatas: [],
|
||||
|
@ -127,36 +182,36 @@ export default {
|
|||
workerGroupList: [],
|
||||
realList: [],
|
||||
alertList: [],
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
changeChart4(opt) {
|
||||
if (this.$dpi() == '1K') {
|
||||
opt.legend[0].left = 200
|
||||
return opt
|
||||
} else if (this.$dpi() == '2K') {
|
||||
opt.legend[0].left = 290
|
||||
return opt
|
||||
if (this.$dpi() == "1K") {
|
||||
opt.legend[0].left = 200;
|
||||
return opt;
|
||||
} else if (this.$dpi() == "2K") {
|
||||
opt.legend[0].left = 290;
|
||||
return opt;
|
||||
} else {
|
||||
opt.legend[0].left = 500
|
||||
return opt
|
||||
opt.legend[0].left = 500;
|
||||
return opt;
|
||||
}
|
||||
},
|
||||
setOpts() {
|
||||
let is1K = this.$dpi() == '1K'
|
||||
let is2K = this.$dpi() == '2K'
|
||||
let is1K = this.$dpi() == "1K";
|
||||
let is2K = this.$dpi() == "2K";
|
||||
this.legendOpt = {
|
||||
icon: 'rect',
|
||||
orient: 'vertical',
|
||||
itemWidth: '50%',
|
||||
icon: "rect",
|
||||
orient: "vertical",
|
||||
itemWidth: "50%",
|
||||
left: 240,
|
||||
right: '10%',
|
||||
right: "10%",
|
||||
itemWidth: 20,
|
||||
itemGap: 20,
|
||||
itemHeight: 20,
|
||||
type: 'scroll',
|
||||
type: "scroll",
|
||||
pageTextStyle: {
|
||||
color: '#c3dbfd',
|
||||
color: "#c3dbfd",
|
||||
fontSize: is1K ? 12 : is2K ? 16 : 20,
|
||||
},
|
||||
scroll: {
|
||||
|
@ -170,133 +225,148 @@ export default {
|
|||
textStyle: {
|
||||
padding: [0, 0, 0, 0],
|
||||
fontSize: is1K ? 12 : is2K ? 14 : 20,
|
||||
color: '#c3dbfd',
|
||||
align: 'center',
|
||||
color: "#c3dbfd",
|
||||
align: "center",
|
||||
rich: {
|
||||
name: {
|
||||
fontSize: is1K ? 12 : is2K ? 14 : 20,
|
||||
color: '#c3dbfd',
|
||||
color: "#c3dbfd",
|
||||
padding: [5, 2, 5, 2],
|
||||
},
|
||||
percent: {
|
||||
fontSize: is1K ? 12 : is2K ? 14 : 20,
|
||||
color: '#4676FD',
|
||||
color: "#4676FD",
|
||||
padding: [0, 2, 0, 2],
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
};
|
||||
},
|
||||
init() {
|
||||
if (!this.selProject) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
this.loadAttendanceData()
|
||||
this.getGroupByWorker()
|
||||
this.groupAttendanceLastWeek()
|
||||
this.getWorkerCountGroupByType()
|
||||
this.getRealAttendance()
|
||||
this.getAttendanceAlert()
|
||||
this.loadAttendanceData();
|
||||
this.getGroupByWorker();
|
||||
this.groupAttendanceLastWeek();
|
||||
this.getWorkerCountGroupByType();
|
||||
this.getRealAttendance();
|
||||
this.getAttendanceAlert();
|
||||
setTimeout(this.init, 3 * 60 * 1000);
|
||||
},
|
||||
resize() {
|
||||
let is1K = this.$dpi() == '1K'
|
||||
let is2K = this.$dpi() == '2K'
|
||||
this.chart4Height = is1K ? 230 : is2K ? 360 : 595
|
||||
this.chart2Height = is1K ? 567 : is2K ? 800 : 1250
|
||||
this.chartKey++
|
||||
let is1K = this.$dpi() == "1K";
|
||||
let is2K = this.$dpi() == "2K";
|
||||
this.chart4Height = is1K ? 230 : is2K ? 360 : 595;
|
||||
this.chart2Height = is1K ? 567 : is2K ? 800 : 1250;
|
||||
this.chartKey++;
|
||||
},
|
||||
getAttendanceAlert() {
|
||||
this.$api.labor.getAttendanceAlert(this.selProject.vendorsCode, this.selProject.id).then((d) => {
|
||||
this.$api.labor
|
||||
.getAttendanceAlert(this.selProject.vendorsCode, this.selProject.id)
|
||||
.then((d) => {
|
||||
this.alertList = d.data.map((it) => {
|
||||
return it
|
||||
})
|
||||
})
|
||||
return it;
|
||||
});
|
||||
});
|
||||
},
|
||||
getRealAttendance() {
|
||||
this.$api.labor.getRealAttendance(this.selProject.vendorsCode, this.selProject.id).then((d) => {
|
||||
this.$api.labor
|
||||
.getRealAttendance(this.selProject.vendorsCode, this.selProject.id)
|
||||
.then((d) => {
|
||||
this.realList = d.data.map((it) => {
|
||||
it.name = it.workerName || it.userName;
|
||||
it.workType = it.workTypeName||it.subDeptGroupName
|
||||
it.img = it.scanPhoto||it.inPhoto||it.outPhoto
|
||||
it.workType = it.workTypeName || it.subDeptGroupName;
|
||||
it.img = it.scanPhoto || it.inPhoto || it.outPhoto;
|
||||
if (it.outTime) {
|
||||
it.inOutType = 'out'
|
||||
it.inoutDate = it.outTime
|
||||
it.inOutType = "out";
|
||||
it.inoutDate = it.outTime;
|
||||
} else if (it.inTime) {
|
||||
it.inOutType = 'in'
|
||||
it.inoutDate = it.inTime
|
||||
it.inOutType = "in";
|
||||
it.inoutDate = it.inTime;
|
||||
} else if (it.attendanceOutTime) {
|
||||
it.inOutType = 'out'
|
||||
it.inoutDate = it.attendanceInTime
|
||||
it.inOutType = "out";
|
||||
it.inoutDate = it.attendanceOutTime;
|
||||
} else {
|
||||
it.inOutType = 'in'
|
||||
it.inoutDate = it.attendanceTime
|
||||
it.inOutType = "in";
|
||||
it.inoutDate = it.attendanceTime;
|
||||
}
|
||||
return it
|
||||
})
|
||||
})
|
||||
return it;
|
||||
});
|
||||
});
|
||||
},
|
||||
getWorkerCountGroupByType() {
|
||||
this.$api.labor.getWorkerCountGroupByType(this.selProject.vendorsCode, this.selProject.id).then((d) => {
|
||||
let sum = 0
|
||||
this.$api.labor
|
||||
.getWorkerCountGroupByType(
|
||||
this.selProject.vendorsCode,
|
||||
this.selProject.id
|
||||
)
|
||||
.then((d) => {
|
||||
let sum = 0;
|
||||
d.data.forEach((item) => {
|
||||
item.id = item.id || item.comId
|
||||
sum += item.id ? item.id : 0
|
||||
})
|
||||
this.workerTotal = sum
|
||||
item.id = item.id || item.comId;
|
||||
sum += item.id ? item.id : 0;
|
||||
});
|
||||
this.workerTotal = sum;
|
||||
this.workerGroupList = d.data.map((item) => {
|
||||
return {
|
||||
name: item.workTypeName || item.craftPostName,
|
||||
value: item.id ? item.id : 0,
|
||||
}
|
||||
})
|
||||
this.chartKey++
|
||||
})
|
||||
};
|
||||
});
|
||||
this.chartKey++;
|
||||
});
|
||||
},
|
||||
groupAttendanceLastWeek() {
|
||||
this.$api.labor.groupAttendanceLastWeek(this.selProject.vendorsCode, this.selProject.id).then((d) => {
|
||||
this.$api.labor
|
||||
.groupAttendanceLastWeek(
|
||||
this.selProject.vendorsCode,
|
||||
this.selProject.id
|
||||
)
|
||||
.then((d) => {
|
||||
this.weekData = d.data.map((it) => {
|
||||
return {
|
||||
name: it.dt.substring(5).replace('-', '.'),
|
||||
name: it.dt.substring(5).replace("-", "."),
|
||||
value: it.cnt,
|
||||
|
||||
}
|
||||
})
|
||||
this.chartKey++
|
||||
})
|
||||
};
|
||||
});
|
||||
this.chartKey++;
|
||||
});
|
||||
},
|
||||
getGroupByWorker() {
|
||||
this.$api.labor.groupByWorker(this.selProject.vendorsCode, this.selProject.id).then((d) => {
|
||||
this.$api.labor
|
||||
.groupByWorker(this.selProject.vendorsCode, this.selProject.id)
|
||||
.then((d) => {
|
||||
this.nativeList = (d.data.native || []).map((it) => {
|
||||
it.name = it.nativePlace
|
||||
it.value = it.count
|
||||
return it
|
||||
})
|
||||
it.name = it.nativePlace;
|
||||
it.value = it.count;
|
||||
return it;
|
||||
});
|
||||
this.ageList = (d.data.age || []).map((it) => {
|
||||
it.name = ['', '18~30', '30~40', '40~55', '55岁以上'][it.age]
|
||||
it.value = it.count
|
||||
return it
|
||||
})
|
||||
this.chartKey++
|
||||
})
|
||||
it.name = ["", "18~30", "30~40", "40~55", "55岁以上"][it.age];
|
||||
it.value = it.count;
|
||||
return it;
|
||||
});
|
||||
this.chartKey++;
|
||||
});
|
||||
},
|
||||
renderChart2(opt) {
|
||||
let is1K = this.$dpi() == '1K'
|
||||
let is2K = this.$dpi() == '2K'
|
||||
let is1K = this.$dpi() == "1K";
|
||||
let is2K = this.$dpi() == "2K";
|
||||
const areaOption = {
|
||||
grid: {
|
||||
left: '5%',
|
||||
right: '5%',
|
||||
bottom: '0%',
|
||||
top: '15%',
|
||||
left: "5%",
|
||||
right: "5%",
|
||||
bottom: "0%",
|
||||
top: "15%",
|
||||
containLabel: true,
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
type: 'shadow',
|
||||
type: "shadow",
|
||||
label: {
|
||||
backgroundColor: '#6a7985',
|
||||
backgroundColor: "#6a7985",
|
||||
textStyle: {
|
||||
fontSize: is1K ? 12 : is2K ? 16 : 20,
|
||||
},
|
||||
|
@ -304,85 +374,85 @@ export default {
|
|||
},
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
type: "category",
|
||||
data: this.weekData.map((item) => item.name),
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: '#0df2c8',
|
||||
color: "#0df2c8",
|
||||
fontSize: is1K ? 12 : is2K ? 16 : 20,
|
||||
},
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
type: "value",
|
||||
minInterval: 1,
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: '#0df2c8',
|
||||
color: "#0df2c8",
|
||||
fontSize: is1K ? 12 : is2K ? 16 : 20,
|
||||
},
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '出勤人数',
|
||||
type: 'line',
|
||||
name: "出勤人数",
|
||||
type: "line",
|
||||
areaStyle: {
|
||||
color: 'rgba(13, 204, 242,0.5)', // 设置面积背景颜色为红色
|
||||
color: "rgba(13, 204, 242,0.5)", // 设置面积背景颜色为红色
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top', // 值标签显示在折线点上方
|
||||
position: "top", // 值标签显示在折线点上方
|
||||
textStyle: {
|
||||
color: '#0df2c8', // 设置标签文字颜色为红色
|
||||
color: "#0df2c8", // 设置标签文字颜色为红色
|
||||
fontSize: is1K ? 12 : is2K ? 16 : 20,
|
||||
},
|
||||
},
|
||||
data: this.weekData.map((item) => item.value),
|
||||
},
|
||||
],
|
||||
}
|
||||
return areaOption
|
||||
};
|
||||
return areaOption;
|
||||
},
|
||||
renderChart3(opt) {
|
||||
let is1K = this.$dpi() == '1K'
|
||||
let is2K = this.$dpi() == '2K'
|
||||
let is1K = this.$dpi() == "1K";
|
||||
let is2K = this.$dpi() == "2K";
|
||||
let pieOption = {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: '{b} 岁 <br/> {c} 人 ({d}%)',
|
||||
trigger: "item",
|
||||
formatter: "{b} 岁 <br/> {c} 人 ({d}%)",
|
||||
textStyle: {
|
||||
fontSize: is1K ? 12 : is2K ? 16 : 20,
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
orient: 'vertical',
|
||||
left: 'left',
|
||||
top: 'center',
|
||||
orient: "vertical",
|
||||
left: "left",
|
||||
top: "center",
|
||||
data: this.ageList.map((it) => it.name),
|
||||
textStyle: {
|
||||
color: '#19c0e6',
|
||||
color: "#19c0e6",
|
||||
fontSize: is1K ? 12 : is2K ? 16 : 20,
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'pie',
|
||||
radius: '55%',
|
||||
center: ['50%', '60%'],
|
||||
type: "pie",
|
||||
radius: "55%",
|
||||
center: ["50%", "60%"],
|
||||
data: this.ageList,
|
||||
label: {
|
||||
normal: {
|
||||
formatter: '{b}\n{c}',
|
||||
formatter: "{b}\n{c}",
|
||||
textStyle: {
|
||||
color: '#0df2c8',
|
||||
color: "#0df2c8",
|
||||
fontSize: is1K ? 12 : is2K ? 16 : 20,
|
||||
},
|
||||
},
|
||||
emphasis: {
|
||||
formatter: '{b}\n{c}',
|
||||
formatter: "{b}\n{c}",
|
||||
textStyle: {
|
||||
color: '#0df2c8',
|
||||
color: "#0df2c8",
|
||||
fontSize: is1K ? 12 : is2K ? 16 : 20,
|
||||
},
|
||||
},
|
||||
|
@ -395,37 +465,37 @@ export default {
|
|||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
return pieOption
|
||||
};
|
||||
return pieOption;
|
||||
},
|
||||
renderChart5(opt) {
|
||||
let is1K = this.$dpi() == '1K'
|
||||
let is2K = this.$dpi() == '2K'
|
||||
let is1K = this.$dpi() == "1K";
|
||||
let is2K = this.$dpi() == "2K";
|
||||
const pieOption = {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: '{b}: {c} ({d}%)',
|
||||
trigger: "item",
|
||||
formatter: "{b}: {c} ({d}%)",
|
||||
textStyle: {
|
||||
fontSize: is1K ? 12 : is2K ? 16 : 20,
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'pie',
|
||||
radius: ['50%', '70%'], // 设置为圆环图
|
||||
type: "pie",
|
||||
radius: ["50%", "70%"], // 设置为圆环图
|
||||
avoidLabelOverlap: false,
|
||||
label: {
|
||||
normal: {
|
||||
formatter: '{b}\n{c}',
|
||||
formatter: "{b}\n{c}",
|
||||
textStyle: {
|
||||
color: '#0df2c8',
|
||||
color: "#0df2c8",
|
||||
fontSize: is1K ? 12 : is2K ? 16 : 20,
|
||||
},
|
||||
},
|
||||
emphasis: {
|
||||
formatter: '{b}\n{c}',
|
||||
formatter: "{b}\n{c}",
|
||||
textStyle: {
|
||||
color: '#0df2c8',
|
||||
color: "#0df2c8",
|
||||
fontSize: is1K ? 12 : is2K ? 16 : 20,
|
||||
},
|
||||
},
|
||||
|
@ -434,62 +504,63 @@ export default {
|
|||
label: {
|
||||
show: true,
|
||||
fontSize: is1K ? 12 : is2K ? 16 : 20,
|
||||
fontWeight: 'bold',
|
||||
fontWeight: "bold",
|
||||
},
|
||||
},
|
||||
|
||||
data: this.nativeList,
|
||||
},
|
||||
],
|
||||
}
|
||||
return pieOption
|
||||
};
|
||||
return pieOption;
|
||||
},
|
||||
doAttendanceNav(n) {
|
||||
this.attendanceNav = n
|
||||
this.loadAttendanceData()
|
||||
this.attendanceNav = n;
|
||||
this.loadAttendanceData();
|
||||
},
|
||||
loadJhAttendanceData() {
|
||||
let data = {
|
||||
id: this.attendanceNav,
|
||||
projectId: this.selProject.id,
|
||||
attendanceTime: this.$dt(new Date()).format('YYYY-MM-DD'),
|
||||
}
|
||||
let ajax = this.$api.detail.groupByComany
|
||||
attendanceTime: this.$dt(new Date()).format("YYYY-MM-DD"),
|
||||
};
|
||||
let ajax = this.$api.detail.groupByComany;
|
||||
if (this.attendanceNav != 1) {
|
||||
ajax = this.$api.detail.groupAllByComany
|
||||
ajax = this.$api.detail.groupAllByComany;
|
||||
}
|
||||
ajax(data).then((d) => {
|
||||
let tmps = d.data || []
|
||||
let tmps = d.data || [];
|
||||
const func = (ids) => {
|
||||
let sum = 0
|
||||
tmps.filter((it) => ids.includes(it.companyTypeId))
|
||||
let sum = 0;
|
||||
tmps
|
||||
.filter((it) => ids.includes(it.companyTypeId))
|
||||
.map((it) => it.id)
|
||||
.forEach((it) => {
|
||||
sum += it * 1
|
||||
})
|
||||
return sum
|
||||
}
|
||||
sum += it * 1;
|
||||
});
|
||||
return sum;
|
||||
};
|
||||
|
||||
this.attendanceTotal = 0
|
||||
this.attendanceTotal = 0;
|
||||
this.attendanceData = [
|
||||
{ text: '劳务人员', value: func(['0', '2', '3', '4', '5']) },
|
||||
{ text: '监理人员', value: func(['8']) },
|
||||
{ text: '总包人员', value: func(['1', '6']) },
|
||||
]
|
||||
{ text: "劳务人员", value: func(["0", "2", "3", "4", "5"]) },
|
||||
{ text: "监理人员", value: func(["8"]) },
|
||||
{ text: "总包人员", value: func(["1", "6"]) },
|
||||
];
|
||||
this.attendanceData.forEach((it) => {
|
||||
this.attendanceTotal += it.value
|
||||
})
|
||||
})
|
||||
this.attendanceTotal += it.value;
|
||||
});
|
||||
});
|
||||
},
|
||||
loadUniAttendanceData() {
|
||||
let ajax = this.$api.detail.groupByCraftType
|
||||
let ajax = this.$api.detail.groupByCraftType;
|
||||
let posData = {
|
||||
comId: this.selProject.comId,
|
||||
projectId: this.selProject.id,
|
||||
}
|
||||
};
|
||||
if (this.attendanceNav == 1) {
|
||||
ajax = this.$api.detail.groupByCraftTypeByAttendance
|
||||
posData.createTime = this.$dt(new Date()).format('YYYY-MM-DD')
|
||||
ajax = this.$api.detail.groupByCraftTypeByAttendance;
|
||||
posData.createTime = this.$dt(new Date()).format("YYYY-MM-DD");
|
||||
//posData.createTime = '2024-10-13'
|
||||
}
|
||||
ajax(posData).then((d) => {
|
||||
|
@ -498,71 +569,71 @@ export default {
|
|||
text: it.createBy,
|
||||
value: it.id || 0,
|
||||
id: it.craftType,
|
||||
}
|
||||
})
|
||||
let count = 0
|
||||
};
|
||||
});
|
||||
let count = 0;
|
||||
this.attendanceData.forEach((it) => {
|
||||
count += it.value
|
||||
})
|
||||
this.attendanceTotal = count
|
||||
})
|
||||
count += it.value;
|
||||
});
|
||||
this.attendanceTotal = count;
|
||||
});
|
||||
},
|
||||
renderMap(opt, myChart) {
|
||||
let mapName = 'china'
|
||||
let data = this.nativeList
|
||||
let geoCoordMap = {}
|
||||
let mapName = "china";
|
||||
let data = this.nativeList;
|
||||
let geoCoordMap = {};
|
||||
|
||||
/*获取地图数据*/
|
||||
|
||||
let mapFeatures = echarts.getMap(mapName).geoJson.features
|
||||
let allData = []
|
||||
let mapFeatures = echarts.getMap(mapName).geoJson.features;
|
||||
let allData = [];
|
||||
mapFeatures.forEach(function (v) {
|
||||
// 地区名称
|
||||
var name = v.properties.name
|
||||
var name = v.properties.name;
|
||||
// 地区经纬度
|
||||
geoCoordMap[name] = v.properties.cp
|
||||
geoCoordMap[name] = v.properties.cp;
|
||||
allData.push({
|
||||
name: name,
|
||||
value: 0,
|
||||
})
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
let max = 880,
|
||||
min = 3 // todo
|
||||
min = 3; // todo
|
||||
let maxSize4Pin = 80,
|
||||
minSize4Pin = 20
|
||||
minSize4Pin = 20;
|
||||
|
||||
let convertData = function (data, lbl) {
|
||||
let res = []
|
||||
let res = [];
|
||||
if (lbl == 1) {
|
||||
data = allData
|
||||
data = allData;
|
||||
}
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
let geoCoord = geoCoordMap[data[i].name]
|
||||
let geoCoord = geoCoordMap[data[i].name];
|
||||
if (geoCoord) {
|
||||
res.push({
|
||||
name: data[i].name,
|
||||
value: geoCoord.concat(data[i].value),
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
if (lbl == 1) {
|
||||
return res
|
||||
}
|
||||
return res.filter((d) => d.value[2] > 0)
|
||||
return res;
|
||||
}
|
||||
return res.filter((d) => d.value[2] > 0);
|
||||
};
|
||||
let option = {
|
||||
visualMap: {
|
||||
show: false,
|
||||
min: 0,
|
||||
max: 200,
|
||||
left: 'left',
|
||||
top: 'bottom',
|
||||
text: ['高', '低'], // 文本,默认为数值文本
|
||||
left: "left",
|
||||
top: "bottom",
|
||||
text: ["高", "低"], // 文本,默认为数值文本
|
||||
calculable: true,
|
||||
seriesIndex: [1],
|
||||
inRange: {
|
||||
color: ['#00e1ff00', '#3da2ffFF'],
|
||||
color: ["#00e1ff00", "#3da2ffFF"],
|
||||
//color: ['#3B5077', '#031525'], // 蓝黑
|
||||
// color: ['#ffc0cb', '#800080'] // 红紫
|
||||
// color: ['#3C3B3F', '#605C3C'] // 黑绿
|
||||
|
@ -590,27 +661,27 @@ export default {
|
|||
roam: true,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
areaColor: '#031525',
|
||||
borderColor: '#3B5077',
|
||||
areaColor: "#031525",
|
||||
borderColor: "#3B5077",
|
||||
},
|
||||
emphasis: {
|
||||
areaColor: '#2B91B7',
|
||||
areaColor: "#2B91B7",
|
||||
},
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '散点',
|
||||
type: 'scatter',
|
||||
coordinateSystem: 'geo',
|
||||
name: "散点",
|
||||
type: "scatter",
|
||||
coordinateSystem: "geo",
|
||||
data: convertData(data, 1),
|
||||
symbolSize: function (val) {
|
||||
return val[2] / 10
|
||||
return val[2] / 10;
|
||||
},
|
||||
label: {
|
||||
normal: {
|
||||
formatter: '{b}',
|
||||
position: 'right',
|
||||
formatter: "{b}",
|
||||
position: "right",
|
||||
show: true,
|
||||
},
|
||||
emphasis: {
|
||||
|
@ -619,12 +690,12 @@ export default {
|
|||
},
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#05C3F9',
|
||||
color: "#05C3F9",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'map',
|
||||
type: "map",
|
||||
map: mapName,
|
||||
geoIndex: 0,
|
||||
aspectScale: 0.75, //长宽比
|
||||
|
@ -638,71 +709,71 @@ export default {
|
|||
data: data,
|
||||
},
|
||||
{
|
||||
name: '点',
|
||||
type: 'scatter',
|
||||
coordinateSystem: 'geo',
|
||||
symbol: 'pin', //气泡
|
||||
name: "点",
|
||||
type: "scatter",
|
||||
coordinateSystem: "geo",
|
||||
symbol: "pin", //气泡
|
||||
symbolSize: function (val) {
|
||||
var a = (maxSize4Pin - minSize4Pin) / (max - min)
|
||||
var b = minSize4Pin - a * min
|
||||
b = maxSize4Pin - a * max
|
||||
return a * val[2] + b
|
||||
var a = (maxSize4Pin - minSize4Pin) / (max - min);
|
||||
var b = minSize4Pin - a * min;
|
||||
b = maxSize4Pin - a * max;
|
||||
return a * val[2] + b;
|
||||
},
|
||||
label: {
|
||||
normal: {
|
||||
formatter: (a) => {
|
||||
return a.value[2]
|
||||
return a.value[2];
|
||||
},
|
||||
show: true,
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
color: "#fff",
|
||||
fontSize: 9,
|
||||
},
|
||||
},
|
||||
},
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#F62157', //标志颜色
|
||||
color: "#F62157", //标志颜色
|
||||
},
|
||||
},
|
||||
zlevel: 6,
|
||||
data: convertData(data, 2),
|
||||
},
|
||||
],
|
||||
}
|
||||
return option
|
||||
};
|
||||
return option;
|
||||
},
|
||||
loadAttendanceData() {
|
||||
if (this.selProject.vendorsCode != 'uni') {
|
||||
this.loadJhAttendanceData()
|
||||
if (this.selProject.vendorsCode != "uni") {
|
||||
this.loadJhAttendanceData();
|
||||
} else {
|
||||
this.loadUniAttendanceData()
|
||||
this.loadUniAttendanceData();
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
window.plApp = this
|
||||
this.$store.dispatch('ChangeNav', 102)
|
||||
window.plApp = this;
|
||||
this.$store.dispatch("ChangeNav", 102);
|
||||
this.$bus.$on(
|
||||
'projectChange',
|
||||
"projectChange",
|
||||
debounce((prj) => {
|
||||
this.selProject = prj
|
||||
this.init()
|
||||
this.selProject = prj;
|
||||
this.init();
|
||||
})
|
||||
)
|
||||
this.selProject = this.$store.getters.selProject
|
||||
this.init()
|
||||
this.dpi = this.$dpi()
|
||||
window.addEventListener('resize', () => {
|
||||
);
|
||||
this.selProject = this.$store.getters.selProject;
|
||||
this.init();
|
||||
this.dpi = this.$dpi();
|
||||
window.addEventListener("resize", () => {
|
||||
if (this.dpi != this.$dpi()) {
|
||||
this.dpi = this.$dpi()
|
||||
this.resize()
|
||||
this.dpi = this.$dpi();
|
||||
this.resize();
|
||||
}
|
||||
})
|
||||
this.setOpts()
|
||||
this.resize()
|
||||
});
|
||||
this.setOpts();
|
||||
this.resize();
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
|
|
|
@ -399,12 +399,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="groupAllByComany" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
select g.companyTypeId,count(1) id
|
||||
from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g,
|
||||
pro_project_info sp
|
||||
where u.cfgid=c.id and u.companyId=g.companyId and u.state=#{id} and c.project_id = sp.id
|
||||
select ct.sub_type companyTypeId,count(1) id
|
||||
from sur_project_attendance_user u, attendance_cfg c,
|
||||
view_sur_project_attendance_group g,
|
||||
pro_project_info sp,
|
||||
sur_project_attendance_company_type ct
|
||||
where u.cfgid=c.id and u.companyId=g.companyId and u.state=0 and c.project_id = sp.id
|
||||
and u.vendors_code=ct.vendors_code and g.companyTypeId=ct.type_id
|
||||
and sp.is_Del=0
|
||||
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
||||
and ct.sub_type in (0,1,2,3,4,5,6,8)
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and c.project_id=#{projectId}
|
||||
</if>
|
||||
|
@ -418,7 +421,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
group by g.companyTypeId
|
||||
group by ct.sub_type
|
||||
</select>
|
||||
|
||||
<select id="getHuazhuPage" parameterType="SurProjectAttendanceData" resultType="Long">
|
||||
|
@ -655,8 +658,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from sur_project_attendance_data_${year} where
|
||||
is_del !=1
|
||||
and projectid=#{prjId}
|
||||
AND (date(attendance_time) >= date(#{dateStart}) or date(attendance_out_time) >= date(#{dateStart}))
|
||||
AND (date(attendance_time) <= date(#{dateEnd}) or date(attendance_out_time) <= date(#{dateEnd}))
|
||||
AND DATE( ifnull( attendance_time, attendance_out_time ) ) >= date(#{dateStart})
|
||||
AND DATE( ifnull( attendance_time, attendance_out_time ) ) <= date(#{dateEnd})
|
||||
|
||||
) tmp
|
||||
group by dt
|
||||
|
|
|
@ -112,8 +112,8 @@ public class AttendanceSzjTask {
|
|||
try {
|
||||
params.put("offset",5);
|
||||
params.put("recordSize",5);
|
||||
params.put("startTime","2025-06-01");
|
||||
params.put("endTime","2025-06-07");
|
||||
params.put("startTime","2025-06-25");
|
||||
params.put("endTime","2025-06-26");
|
||||
String result = HttpUtils.sendJSONPost(SZJ_HOST + "v1/api/recognition/query", JSON.toJSONString(params), headerMap);
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
if (jsonObject != null && jsonObject.getBoolean("success")) {
|
||||
|
@ -460,7 +460,7 @@ public class AttendanceSzjTask {
|
|||
headerMap.put("token",token);
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
try {
|
||||
params.put("offset",1);
|
||||
params.put("offset",pageIndex);
|
||||
params.put("recordSize",100);
|
||||
String result = HttpUtils.sendJSONPost(SZJ_HOST + "v1/api/person/query", JSON.toJSONString(params), headerMap);
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
|
@ -504,7 +504,7 @@ public class AttendanceSzjTask {
|
|||
public void syncAttendanceData() {
|
||||
log.info("开始同步数智建考勤记录...{}",DateUtils.dateTimeStr());
|
||||
String startTime=DateUtil.formatDate(new Date());
|
||||
String endTime=DateUtil.formatDate(new Date());
|
||||
String endTime=DateUtil.formatDate(DateUtil.offsetDay(new Date(),1));
|
||||
syncAttendanceData(startTime,endTime);
|
||||
}
|
||||
|
||||
|
@ -513,8 +513,8 @@ public class AttendanceSzjTask {
|
|||
*/
|
||||
public void syncLastWeekAttendanceData() {
|
||||
log.info("开始同步数智建考勤记录...{}",DateUtils.dateTimeStr());
|
||||
String startTime=DateUtil.formatDate(DateUtil.offsetDay(new Date(),-7));
|
||||
String endTime=DateUtil.formatDate(new Date());
|
||||
String startTime=DateUtil.formatDate(DateUtil.offsetDay(new Date(),-6));
|
||||
String endTime=DateUtil.formatDate(DateUtil.offsetDay(new Date(),1));
|
||||
syncAttendanceData(startTime,endTime);
|
||||
}
|
||||
|
||||
|
@ -544,6 +544,7 @@ public class AttendanceSzjTask {
|
|||
try {
|
||||
String token = getToken(jSONObject.getString("secret"));
|
||||
doSyncAttendance(token, item,0,startTime,endTime);
|
||||
System.out.println("====完成====");
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
@ -596,6 +597,8 @@ public class AttendanceSzjTask {
|
|||
att.setCompanyName(user.getCompanyName());
|
||||
att.setCompanyTypeId(user.getCompanyTypeId());
|
||||
QuartzProjectAttendanceGroup groupWhere=new QuartzProjectAttendanceGroup();
|
||||
groupWhere.setCfgid(cfg.getId());
|
||||
groupWhere.setTeamId(NumberUtil.parseLong(user.getGroupId()));
|
||||
List<QuartzProjectAttendanceGroup> groupList=groupService.selectSurProjectAttendanceGroupList(groupWhere);
|
||||
if(!groupList.isEmpty()){
|
||||
QuartzProjectAttendanceGroup group=groupList.get(0);
|
||||
|
@ -624,7 +627,7 @@ public class AttendanceSzjTask {
|
|||
}
|
||||
}
|
||||
if(atts.size()==100){
|
||||
doSyncAttendance(token,cfg,offset+1,startTime,endTime);
|
||||
doSyncAttendance(token,cfg,offset,startTime,endTime);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
<if test="scanPhoto != null and scanPhoto != ''"> and scanPhoto = #{scanPhoto}</if>
|
||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||
<if test="attendanceTime != null and attendanceTime != ''"> and date(attendance_time) = date(#{attendanceTime})</if>
|
||||
<if test="attendanceTime != null and attendanceTime != ''"> and DATE( ifnull( attendance_time, attendance_out_time ) ) = date(#{attendanceTime})</if>
|
||||
</where>
|
||||
order by id desc
|
||||
</select>
|
||||
|
|
|
@ -65,7 +65,7 @@ public class LaborController extends BaseController {
|
|||
@GetMapping("/groupAttendanceLastWeek/{type}/{prjId}")
|
||||
public AjaxResult groupAttendanceLastWeek(@PathVariable("type")String type, @PathVariable("prjId") Long prjId){
|
||||
Date dateEnd=new DateTime();
|
||||
Date dateStart=DateUtil.offsetDay(dateEnd,-7);
|
||||
Date dateStart=DateUtil.offsetDay(dateEnd,-6);
|
||||
if("uni".equals(type.toLowerCase())){
|
||||
JSONArray sList=attendanceUbiDataService.groupAttendanceLastWeek(prjId,dateStart,dateEnd);
|
||||
return AjaxResult.success(sList);
|
||||
|
|
Loading…
Reference in New Issue