You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

2003 lines
64 KiB

<template>
<view class="u-demo-block">
<u-swiper style="margin-top: 10px;" :list="list3" :effect3d="true" height="300"></u-swiper>
<!-- <u-grid style="margin-top: 10px;" :col="3">
<u-grid-item @click="toRen">
<u-image width="30px" height="30px" src="http://new.hxgk.group/sj/renwu.png"></u-image>
<view class="grid-text">任务</view>
</u-grid-item>
<u-grid-item @click="toShen">
<u-image width="30px" height="30px" src="http://new.hxgk.group/sj/shenpi.png"></u-image>
<view class="grid-text">审批</view>
</u-grid-item>
<u-grid-item @click="toMy">
<u-image width="30px" height="30px" src="http://new.hxgk.group/sj/geren.png"></u-image>
<view class="grid-text">我的</view>
</u-grid-item>
</u-grid> -->
<u-card :title="title" :sub-title="subTitle" :padding="padding" :border="border" @click="headClick">
<view class="" slot="body">
<view class="u-body-item u-flex u-border-bottom u-col-between u-p-t-0" v-for="(iteam,index) in dataList.slice(0,2)" :key='index'>
<view class="u-body-item-title u-line-2">
{{iteam.title}}
</view>
</view>
<!-- <view class="u-body-item u-flex u-row-between u-p-b-0">
<view class="u-body-item-title u-line-2">
生产调度
</view>
</view> -->
</view>
<!-- <view class="" slot="foot">
<u-icon v-if="bottomSlot" name="chat-fill" size="34" label="30评论"></u-icon>
</view> -->
</u-card>
<u-card title="待审批" sub-title="查看详情" :padding="padding" :border="border" @click="headClick1">
<view class="" slot="body">
<view class="u-body-item u-flex u-border-bottom u-col-between u-p-t-0" v-for="(iteam,index) in dataProcessList.slice(0,2)" :key='index'>
<view class="u-body-item-title u-line-2">
{{iteam.tittle}}
</view>
</view>
<!-- <view class="u-body-item u-flex u-row-between u-p-b-0">
<view class="u-body-item-title u-line-2">
生产调度
</view>
</view> -->
</view>
<!-- <view class="" slot="foot">
<u-icon v-if="bottomSlot" name="chat-fill" size="34" label="30评论"></u-icon>
</view> -->
</u-card>
<el-select v-model="serMonth" placeholder="请选择月份" @change='changeMonth' class="my-el-select" style="width: 120px;">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-carousel arrow="always" :autoplay='false' indicator-position='none'>
<el-carousel-item>
<view id="safety" style="height: 250px;"></view>
</el-carousel-item>
<el-carousel-item>
<view id="environment" style="height: 250px;"></view>
</el-carousel-item>
<el-carousel-item>
<view id="health" style="height: 250px;"></view>
</el-carousel-item>
<el-carousel-item>
<view id="production" style="height: 250px;"></view>
</el-carousel-item>
<el-carousel-item>
<view id="craft" style="height: 250px;"></view>
</el-carousel-item>
<el-carousel-item>
<view id="equipment" style="height: 250px;"></view>
</el-carousel-item>
<el-carousel-item>
<view id="labor" style="height: 250px;"></view>
</el-carousel-item>
<el-carousel-item>
<view id="educate" style="height: 250px;"></view>
</el-carousel-item>
</el-carousel>
<view id="scoreEchart" style="height: 250px;margin-top: -60px;"></view>
<!-- <el-select v-model="serMonth" placeholder="请选择部门" @change='changeMonth' class="my-el-select" style="width: 120px;">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select> -->
<u-toast ref="uToast" />
</view>
</template>
<script>
export default {
data() {
return {
serMonth:'',
options: [{
value: 1,
label: '1月'
},
{
value: 2,
label: '2月'
},
{
value: 3,
label: '3月'
},
{
value: 4,
label: '4月'
},
{
value: 5,
label: '5月'
},
{
value: 6,
label: '6月'
},
{
value: 7,
label: '7月'
},
{
value: 8,
label: '8月'
},
{
value: 9,
label: '9月'
},
{
value: 10,
label: '10月'
},
{
value: 11,
label: '11月'
},
{
value: 12,
label: '12月'
},
],
buoptions: [],
month:[],
year:[],
keyFrom:{
key:'',
token:'',
},
dataProcessList:[],
dataList:[],
key:'',
token:'',
title: '待提交',
subTitle: '查看详情',
thumb: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg',
padding: 20,
bottomSlot: true,
border: true,
list3: [
'http://new.hxgk.group/sj/1.png',
'http://new.hxgk.group/sj/2.png',
'http://new.hxgk.group/sj/3.png',
],
}
},
onLoad(option){
this.$store.commit('SET_USER_apiPass',2)
// alert("首页apipass")
// alert(this.$store.state.apiPass)
// console.log("this.$store.state.apiPass")
// 线上使用
// alert("option")
// alert(JSON.stringify(option))
// console.log(this.$store.state.apiPass)
console.log('option')
console.log(option)
// 线上
this.$store.commit('SET_USER_KEY',option.key)
sessionStorage.setItem('userKey',option.key);
sessionStorage.setItem('userToken',option.token);
this.$store.commit('SET_USER_TOKEN',option.token)
this.keyFrom.key=option.key
this.keyFrom.token=option.token
// this.keyFrom.key='42b8467843a07625f7999576a015cb1f'
// this.keyFrom.token='50a16b1f35ef367d53a4e9d0f333535f540fc87c'
console.log('onLoad')
// console.log("option")
// console.log(option)
// console.log(this.$route.query)
// window.sessionStorage.setItem("key",option.key)
// window.sessionStorage.setItem("token",option.token)
// console.log("option.key")
// console.log(this.$store.state.userKey)
// console.log(this.$store.state.userToken)
// if (this.$store.state.userKey==''||this.$store.state.userToken=='') {
// window.location.href = 'https://www.hxgk.group/jumpapiurl/webindex?url=http://new.hxgk.group/sj/index.html';
// }else if(this.$store.state.userKey==undefined||this.$store.state.userToken==undefined){
// window.location.href = 'https://www.hxgk.group/jumpapiurl/webindex?url=http://new.hxgk.group/sj/index.html';
// }
// this.key=sessionStorage.getItem('key')
// this.token=sessionStorage.getItem('token')
// alert("888")
},
async onShow() {
// await this.$u.api.Duty.newqualitative().then(res => {
// // alert(JSON.stringify(res))
// if(res.code==0){
// this.dataList=res.data
// }
// })
console.log('onShow')
this.getData()
this.getProcessData()
// this.getData()
console.log(this.$store.state.userKey)
// if (this.$store.state.userKey!=''||this.$store.state.userToken!='') {
// setTimeout(()=>{
// console.log('onShow1')
// },300);
// }else if(this.$store.state.userKey!=undefined||this.$store.state.userToken!=undefined){
// setTimeout(()=>{
// console.log('onShow2')
// this.$u.api.Duty.newqualitative().then(res => {
// // alert(JSON.stringify(res))
// if(res.code==0){
// this.dataList=res.data
// }
// })
// },300);
// }
},
created(){
console.log(this.$store.state.apiPass)
this.getYear()
this.getSafetyData()
this.getEnvironmentData()
this.getHealthData()
this.getProductionData()
this.getCraftData()
this.getEquipmentData()
this.getLaborData()
this.getEducateData()
this.getScore()
},
methods: {
changeMonth(){
this.month=[],
this.serMonth=parseInt(this.serMonth);
this.month.push(this.serMonth)
this.getSafetyData()
this.getEnvironmentData()
this.getHealthData()
this.getProductionData()
this.getCraftData()
this.getEquipmentData()
this.getLaborData()
this.getEducateData()
this.getScore()
},
getYear(){
const year=new Date().getFullYear()
var month=new Date().getMonth()
this.year.push(year)
this.month.push(month)
},
// 获取成绩图表
async getScore(){
var safetyEchart={
title: {
text: '',
left: 'center',
textStyle: {
fontSize: 14, //字体大小
fontWeight: 400, //字体粗细
align:'center',//文字水平对齐方式(left/right)
verticalAlign:'middle',//文字垂直对齐方式(top/bottom)
},
},
xAxis:{
type: 'category',
axisLabel: {
rotate : 60,
//x轴文字的配置
show: true,
interval: 0,//使x轴文字显示全
},
data: []
},
yAxis: {
type: 'value',
min:90, //取0为最小刻度
min: function(value) {//取最小值向下取整为最小刻度
return Math.floor(value.min)
},
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
data: []
},
series:[],
}
var cylindricaldata = []
// const searchInfo = {
// targetid: [
// "11"
// ], //指标ID
// org: [
// "41",
// "42",
// "13",
// "14",
// "15",
// "20",
// ], //行政单位
// year: this.year.map(String), //年度
// timeattribute: {
// class: 3, //0:全年;1:半年;2:季度;3:月度
// time: this.month //class->0(0),Time->1(1:上半年,2:下半年),class->2(1:第一季度,2:第二季度,3:第三季度,4:第四季度),class->3(1:1月....12:12月)
// }, //时间辅助
// AccMethod: [
// 1
// ], //核算方式 1:合计值;2:平均值
// analysisangle: 1 //析维度 1:行政组织;2:时间
// }
const searchInfo = {
year: this.year.map(String), //年份
month: this.month
}
uni.request({
url: 'http://new.hxgk.group/api/ststic/departmenttranscript',
// url: 'http://hxgk.user.phone/api/ststic/departmenttranscript',
method: 'POST',
header: {
'content-type': 'application/json' ,//自定义请求头信息
"user-key": this.keyFrom.key,
"user-token": this.keyFrom.token
// "user-key": '4fb8e8697c366be03e8fc96319b98524',
// "user-token": 'd0b27f36e0d7dfdf883dfe0000069ca182078ed2'
},
data: searchInfo,
//请求成功后返回
success: (res) => {
// 请求成功之后将数据给Info
if(res.statusCode===200){
console.log("res.data.data")
console.log(res.data.data)
safetyEchart.xAxis.data=res.data.data.echarsListOrg.xline
safetyEchart.title.text=res.data.data.echarsListOrg.cylindrical+'份绩效成绩'
cylindricaldata=res.data.data.echarsListOrg.cylindricaldata
console.log("cylindricaldata")
console.log(cylindricaldata)
cylindricaldata.forEach(ele=>{
this.$set(ele, 'type', 'bar')
// this.$set(ele, 'barWidth', '25')
this.$set(ele, 'showBackground', true)
this.$set(ele, 'backgroundStyle', {
color: 'rgba(180, 180, 180, 0.2)'
})
this.$set(ele, 'itemStyle', {
color:function(d){return "#"+Math.floor(Math.random()*(256*256*256-1)).toString(16);}
})
this.$set(ele, 'label', {
show: true, // 开启显示
rotate: 70, // 旋转70度
position: 'top', // 在上方显示
distance: 20, // 距离图形元素的距离。当 position 为字符描述值(如 'top'、'insideRight')时候有效。
verticalAlign: 'middle',
textStyle: { // 数值样式
color: 'black',
fontSize: 10
}
})
this.$set(ele, 'formatter', function(params){
let txtArry = params.seriesName.split('');
let rs = "";
for(var i=0;i < txtArry.length; i++ ){
rs += txtArry[i] + "\n";
}
return rs;
}
)
safetyEchart.series.push(ele)
})
var dataLenth=cylindricaldata[0].data
// cylindricaldata[0].data=[]
console.log(cylindricaldata)
var myChart = this.$echarts.init(document.getElementById('scoreEchart'));
myChart.clear();
console.log('safetyEchart')
console.log(safetyEchart)
myChart.setOption(safetyEchart);
}
}
});
},
// 教育培训缩略图
async getEducateData(){
var safetyEchart={
title: {
text: '',
left: 'center',
textStyle: {
fontSize: 14, //字体大小
fontWeight: 400, //字体粗细
align:'center',//文字水平对齐方式(left/right)
verticalAlign:'middle',//文字垂直对齐方式(top/bottom)
},
},
xAxis:{
type: 'category',
axisLabel: {
//x轴文字的配置
show: true,
interval: 0,//使x轴文字显示全
},
data: []
},
yAxis: {
type: 'value'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
data: []
},
series:[],
}
var cylindricaldata = []
const searchInfo = {
targetid: [
"11"
], //指标ID
org: [
"115",
"282",
"116",
"349",
"354",
"126",
], //行政单位
year: this.year.map(String), //年度
timeattribute: {
class: 3, //0:全年;1:半年;2:季度;3:月度
time: this.month //class->0(0),Time->1(1:上半年,2:下半年),class->2(1:第一季度,2:第二季度,3:第三季度,4:第四季度),class->3(1:1月....12:12月)
}, //时间辅助
AccMethod: [
1
], //核算方式 1:合计值;2:平均值
analysisangle: 1 //析维度 1:行政组织;2:时间
}
uni.request({
url: 'http://new.hxgk.group/api/quant/quantechart',
method: 'POST',
header: {
'content-type': 'application/json' ,//自定义请求头信息
"user-key": this.keyFrom.key,
"user-token": this.keyFrom.token
},
data: searchInfo,
//请求成功后返回
success: (res) => {
console.log('教育培训缩略图')
console.log(res)
// 请求成功之后将数据给Info
if(res.statusCode===200){
// that.dataList=res.data.data
safetyEchart.xAxis.data=res.data.data.xAxis
safetyEchart.title.text=res.data.data.legend
// safetyEchart.title.text=res.data.data.legend
cylindricaldata=res.data.data.series
console.log("cylindricaldata")
console.log(cylindricaldata)
cylindricaldata.forEach(ele=>{
this.$set(ele, 'type', 'bar')
// this.$set(ele, 'barWidth', '25')
this.$set(ele, 'showBackground', true)
this.$set(ele, 'backgroundStyle', {
color: 'rgba(180, 180, 180, 0.2)'
})
this.$set(ele, 'formatter', function(params){
let txtArry = params.seriesName.split('');
let rs = "";
for(var i=0;i < txtArry.length; i++ ){
rs += txtArry[i] + "\n";
}
return rs;
}
)
safetyEchart.series.push(ele)
})
var dataLenth=cylindricaldata[0].data
cylindricaldata[0].data=[]
cylindricaldata[0].data=[
{
value: dataLenth[0],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#5470C6'
}
},
{
value: dataLenth[1],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#91CC75'
}
},
{
value: dataLenth[2],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#FAC858'
}
},
{
value: dataLenth[3],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#EE6666'
}
},
{
value: dataLenth[4],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#73C0DE'
}
},
{
value: dataLenth[5],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#3BA272'
}
},
]
console.log(cylindricaldata)
var myChart = this.$echarts.init(document.getElementById('educate'));
myChart.clear();
console.log('safetyEchart')
console.log(safetyEchart)
myChart.setOption(safetyEchart);
}
}
});
},
// 劳动纪律缩略图
async getLaborData(){
var safetyEchart={
title: {
text: '',
left: 'center',
textStyle: {
fontSize: 14, //字体大小
fontWeight: 400, //字体粗细
align:'center',//文字水平对齐方式(left/right)
verticalAlign:'middle',//文字垂直对齐方式(top/bottom)
},
},
xAxis:{
type: 'category',
axisLabel: {
//x轴文字的配置
show: true,
interval: 0,//使x轴文字显示全
},
data: []
},
yAxis: {
type: 'value'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
data: []
},
series:[],
}
var cylindricaldata = []
const searchInfo = {
targetid: [
"10"
], //指标ID
org: [
"115",
"282",
"116",
"349",
"354",
"126",
], //行政单位
year: this.year.map(String), //年度
timeattribute: {
class: 3, //0:全年;1:半年;2:季度;3:月度
time: this.month //class->0(0),Time->1(1:上半年,2:下半年),class->2(1:第一季度,2:第二季度,3:第三季度,4:第四季度),class->3(1:1月....12:12月)
}, //时间辅助
AccMethod: [
1
], //核算方式 1:合计值;2:平均值
analysisangle: 1 //析维度 1:行政组织;2:时间
}
uni.request({
url: 'http://new.hxgk.group/api/quant/quantechart',
method: 'POST',
header: {
'content-type': 'application/json' ,//自定义请求头信息
"user-key": this.keyFrom.key,
"user-token": this.keyFrom.token
},
data: searchInfo,
//请求成功后返回
success: (res) => {
console.log(res)
// 请求成功之后将数据给Info
if(res.statusCode===200){
// that.dataList=res.data.data
safetyEchart.xAxis.data=res.data.data.xAxis
safetyEchart.title.text=res.data.data.legend
cylindricaldata=res.data.data.series
cylindricaldata.forEach(ele=>{
this.$set(ele, 'type', 'bar')
// this.$set(ele, 'barWidth', '25')
this.$set(ele, 'showBackground', true)
this.$set(ele, 'backgroundStyle', {
color: 'rgba(180, 180, 180, 0.2)'
})
this.$set(ele, 'formatter', function(params){
let txtArry = params.seriesName.split('');
let rs = "";
for(var i=0;i < txtArry.length; i++ ){
rs += txtArry[i] + "\n";
}
return rs;
}
)
safetyEchart.series.push(ele)
})
var dataLenth=cylindricaldata[0].data
cylindricaldata[0].data=[]
cylindricaldata[0].data=[
{
value: dataLenth[0],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#5470C6',
}
},
{
value: dataLenth[1],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#91CC75'
}
},
{
value: dataLenth[2],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#FAC858'
}
},
{
value: dataLenth[3],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#EE6666'
}
},
{
value: dataLenth[4],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#73C0DE'
}
},
{
value: dataLenth[5],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#3BA272'
}
},
]
console.log('safetyEchart')
console.log(safetyEchart)
var myChart = this.$echarts.init(document.getElementById('labor'));
myChart.clear();
myChart.setOption(safetyEchart);
}
}
});
},
// 设备电仪缩略图
async getEquipmentData(){
var safetyEchart={
title: {
text: '',
left: 'center',
textStyle: {
fontSize: 14, //字体大小
fontWeight: 400, //字体粗细
align:'center',//文字水平对齐方式(left/right)
verticalAlign:'middle',//文字垂直对齐方式(top/bottom)
},
},
xAxis:{
type: 'category',
axisLabel: {
//x轴文字的配置
show: true,
interval: 0,//使x轴文字显示全
},
data: []
},
yAxis: {
type: 'value'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
data: []
},
series:[],
}
var cylindricaldata = []
const searchInfo = {
targetid: [
"8"
], //指标ID
org: [
"115",
"282",
"116",
"349",
"354",
"126",
], //行政单位
year: this.year.map(String), //年度
timeattribute: {
class: 3, //0:全年;1:半年;2:季度;3:月度
time: this.month //class->0(0),Time->1(1:上半年,2:下半年),class->2(1:第一季度,2:第二季度,3:第三季度,4:第四季度),class->3(1:1月....12:12月)
}, //时间辅助
AccMethod: [
1
], //核算方式 1:合计值;2:平均值
analysisangle: 1 //析维度 1:行政组织;2:时间
}
uni.request({
url: 'http://new.hxgk.group/api/quant/quantechart',
method: 'POST',
header: {
'content-type': 'application/json' ,//自定义请求头信息
"user-key": this.keyFrom.key,
"user-token": this.keyFrom.token
},
data: searchInfo,
//请求成功后返回
success: (res) => {
console.log(res)
// 请求成功之后将数据给Info
if(res.statusCode===200){
// that.dataList=res.data.data
safetyEchart.xAxis.data=res.data.data.xAxis
safetyEchart.title.text=res.data.data.legend
cylindricaldata=res.data.data.series
cylindricaldata.forEach(ele=>{
this.$set(ele, 'type', 'bar')
// this.$set(ele, 'barWidth', '25')
this.$set(ele, 'showBackground', true)
this.$set(ele, 'backgroundStyle', {
color: 'rgba(180, 180, 180, 0.2)'
})
this.$set(ele, 'formatter', function(params){
let txtArry = params.seriesName.split('');
let rs = "";
for(var i=0;i < txtArry.length; i++ ){
rs += txtArry[i] + "\n";
}
return rs;
}
)
safetyEchart.series.push(ele)
})
var dataLenth=cylindricaldata[0].data
cylindricaldata[0].data=[]
cylindricaldata[0].data=[
{
value: dataLenth[0],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#5470C6'
}
},
{
value: dataLenth[1],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#91CC75'
}
},
{
value: dataLenth[2],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#FAC858'
}
},
{
value: dataLenth[3],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#EE6666'
}
},
{
value: dataLenth[4],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#73C0DE'
}
},
{
value: dataLenth[5],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#3BA272'
}
},
]
var myChart = this.$echarts.init(document.getElementById('equipment'));
myChart.clear();
myChart.setOption(safetyEchart);
}
}
});
},
// 工艺管理缩略图
async getCraftData(){
var safetyEchart={
title: {
text: '',
left: 'center',
textStyle: {
fontSize: 14, //字体大小
fontWeight: 400, //字体粗细
align:'center',//文字水平对齐方式(left/right)
verticalAlign:'middle',//文字垂直对齐方式(top/bottom)
},
},
xAxis:{
type: 'category',
axisLabel: {
//x轴文字的配置
show: true,
interval: 0,//使x轴文字显示全
},
data: []
},
yAxis: {
type: 'value'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
data: []
},
series:[],
}
var cylindricaldata = []
const searchInfo = {
targetid: [
"9"
], //指标ID
org: [
"115",
"282",
"116",
"349",
"354",
"126",
], //行政单位
year: this.year.map(String), //年度
timeattribute: {
class: 3, //0:全年;1:半年;2:季度;3:月度
time: this.month //class->0(0),Time->1(1:上半年,2:下半年),class->2(1:第一季度,2:第二季度,3:第三季度,4:第四季度),class->3(1:1月....12:12月)
}, //时间辅助
AccMethod: [
1
], //核算方式 1:合计值;2:平均值
analysisangle: 1 //析维度 1:行政组织;2:时间
}
uni.request({
url: 'http://new.hxgk.group/api/quant/quantechart',
method: 'POST',
header: {
'content-type': 'application/json' ,//自定义请求头信息
"user-key": this.keyFrom.key,
"user-token": this.keyFrom.token
},
data: searchInfo,
//请求成功后返回
success: (res) => {
// 请求成功之后将数据给Info
if(res.statusCode===200){
// that.dataList=res.data.data
safetyEchart.xAxis.data=res.data.data.xAxis
safetyEchart.title.text=res.data.data.legend
cylindricaldata=res.data.data.series
cylindricaldata.forEach(ele=>{
this.$set(ele, 'type', 'bar')
// this.$set(ele, 'barWidth', '25')
this.$set(ele, 'showBackground', true)
this.$set(ele, 'backgroundStyle', {
color: 'rgba(180, 180, 180, 0.2)'
})
this.$set(ele, 'formatter', function(params){
let txtArry = params.seriesName.split('');
let rs = "";
for(var i=0;i < txtArry.length; i++ ){
rs += txtArry[i] + "\n";
}
return rs;
}
)
safetyEchart.series.push(ele)
})
var dataLenth=cylindricaldata[0].data
cylindricaldata[0].data=[]
cylindricaldata[0].data=[
{
value: dataLenth[0],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#5470C6'
}
},
{
value: dataLenth[1],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#91CC75'
}
},
{
value: dataLenth[2],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#FAC858'
}
},
{
value: dataLenth[3],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#EE6666'
}
},
{
value: dataLenth[4],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#73C0DE'
}
},
{
value: dataLenth[5],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#3BA272'
}
},
]
var myChart = this.$echarts.init(document.getElementById('craft'));
myChart.clear();
myChart.setOption(safetyEchart);
}
}
});
},
// 生产调度缩略图
async getProductionData(){
var safetyEchart={
title: {
text: '',
left: 'center',
textStyle: {
fontSize: 14, //字体大小
fontWeight: 400, //字体粗细
align:'center',//文字水平对齐方式(left/right)
verticalAlign:'middle',//文字垂直对齐方式(top/bottom)
},
},
xAxis:{
type: 'category',
axisLabel: {
//x轴文字的配置
show: true,
interval: 0,//使x轴文字显示全
},
data: []
},
yAxis: {
type: 'value'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
data: []
},
series:[],
}
var cylindricaldata = []
const searchInfo = {
targetid: [
"7"
], //指标ID
org: [
"115",
"282",
"116",
"349",
"354",
"126",
], //行政单位
year: this.year.map(String), //年度
timeattribute: {
class: 3, //0:全年;1:半年;2:季度;3:月度
time: this.month //class->0(0),Time->1(1:上半年,2:下半年),class->2(1:第一季度,2:第二季度,3:第三季度,4:第四季度),class->3(1:1月....12:12月)
}, //时间辅助
AccMethod: [
1
], //核算方式 1:合计值;2:平均值
analysisangle: 1 //析维度 1:行政组织;2:时间
}
uni.request({
url: 'http://new.hxgk.group/api/quant/quantechart',
method: 'POST',
header: {
'content-type': 'application/json' ,//自定义请求头信息
"user-key": this.keyFrom.key,
"user-token": this.keyFrom.token
},
data: searchInfo,
//请求成功后返回
success: (res) => {
// 请求成功之后将数据给Info
if(res.statusCode===200){
// that.dataList=res.data.data
safetyEchart.xAxis.data=res.data.data.xAxis
safetyEchart.title.text=res.data.data.legend
cylindricaldata=res.data.data.series
console.log("cylindricaldata")
console.log(cylindricaldata)
cylindricaldata.forEach(ele=>{
this.$set(ele, 'type', 'bar')
// this.$set(ele, 'barWidth', '25')
this.$set(ele, 'showBackground', true)
this.$set(ele, 'backgroundStyle', {
color: 'rgba(180, 180, 180, 0.2)'
})
this.$set(ele, 'formatter', function(params){
let txtArry = params.seriesName.split('');
let rs = "";
for(var i=0;i < txtArry.length; i++ ){
rs += txtArry[i] + "\n";
}
return rs;
}
)
safetyEchart.series.push(ele)
})
var dataLenth=cylindricaldata[0].data
cylindricaldata[0].data=[]
cylindricaldata[0].data=[
{
value: dataLenth[0],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#5470C6'
}
},
{
value: dataLenth[1],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#91CC75'
}
},
{
value: dataLenth[2],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#FAC858'
}
},
{
value: dataLenth[3],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#EE6666'
}
},
{
value: dataLenth[4],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#73C0DE'
}
},
{
value: dataLenth[5],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#3BA272'
}
},
]
console.log(cylindricaldata)
var myChart = this.$echarts.init(document.getElementById('production'));
myChart.clear();
myChart.setOption(safetyEchart);
}
}
});
},
// 职业卫生缩略图
async getHealthData(){
var safetyEchart={
title: {
text: '',
left: 'center',
textStyle: {
fontSize: 14, //字体大小
fontWeight: 400, //字体粗细
align:'center',//文字水平对齐方式(left/right)
verticalAlign:'middle',//文字垂直对齐方式(top/bottom)
},
},
xAxis:{
type: 'category',
axisLabel: {
//x轴文字的配置
show: true,
interval: 0,//使x轴文字显示全
},
data: []
},
yAxis: {
type: 'value'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
data: []
},
series:[],
}
var cylindricaldata = []
const searchInfo = {
targetid: [
"85"
], //指标ID
org: [
"115",
"282",
"116",
"349",
"354",
"126",
], //行政单位
year: this.year.map(String), //年度
timeattribute: {
class: 3, //0:全年;1:半年;2:季度;3:月度
time: this.month //class->0(0),Time->1(1:上半年,2:下半年),class->2(1:第一季度,2:第二季度,3:第三季度,4:第四季度),class->3(1:1月....12:12月)
}, //时间辅助
AccMethod: [
1
], //核算方式 1:合计值;2:平均值
analysisangle: 1 //析维度 1:行政组织;2:时间
}
uni.request({
url: 'http://new.hxgk.group/api/quant/quantechart',
method: 'POST',
header: {
'content-type': 'application/json' ,//自定义请求头信息
"user-key": this.keyFrom.key,
"user-token": this.keyFrom.token
},
data: searchInfo,
//请求成功后返回
success: (res) => {
console.log(res)
// 请求成功之后将数据给Info
if(res.statusCode===200){
// that.dataList=res.data.data
safetyEchart.xAxis.data=res.data.data.xAxis
safetyEchart.title.text=res.data.data.legend
cylindricaldata=res.data.data.series
console.log("cylindricaldata")
console.log(cylindricaldata)
cylindricaldata.forEach(ele=>{
this.$set(ele, 'type', 'bar')
// this.$set(ele, 'barWidth', '25')
this.$set(ele, 'showBackground', true)
this.$set(ele, 'backgroundStyle', {
color: 'rgba(180, 180, 180, 0.2)'
})
this.$set(ele, 'formatter', function(params){
let txtArry = params.seriesName.split('');
let rs = "";
for(var i=0;i < txtArry.length; i++ ){
rs += txtArry[i] + "\n";
}
return rs;
}
)
safetyEchart.series.push(ele)
})
var dataLenth=cylindricaldata[0].data
cylindricaldata[0].data=[]
cylindricaldata[0].data=[
{
value: dataLenth[0],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#5470C6'
}
},
{
value: dataLenth[1],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#91CC75'
}
},
{
value: dataLenth[2],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#FAC858'
}
},
{
value: dataLenth[3],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#EE6666'
}
},
{
value: dataLenth[4],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#73C0DE'
}
},
{
value: dataLenth[5],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#3BA272'
}
},
]
console.log(cylindricaldata)
var myChart = this.$echarts.init(document.getElementById('health'));
console.log("safetyEchart")
console.log(safetyEchart)
myChart.clear();
myChart.setOption(safetyEchart);
}
}
});
},
// 环保管理缩略图
async getEnvironmentData(){
var safetyEchart={
title: {
text: '',
left: 'center',
textStyle: {
fontSize: 14, //字体大小
fontWeight: 400, //字体粗细
align:'center',//文字水平对齐方式(left/right)
verticalAlign:'middle',//文字垂直对齐方式(top/bottom)
},
},
xAxis:{
type: 'category',
axisLabel: {
//x轴文字的配置
show: true,
interval: 0,//使x轴文字显示全
},
data: []
},
yAxis: {
type: 'value'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
data: []
},
series:[],
}
var cylindricaldata = []
const searchInfo = {
targetid: [
"84"
], //指标ID
org: [
"115",
"282",
"116",
"349",
"354",
"126",
], //行政单位
year: this.year.map(String), //年度
timeattribute: {
class: 3, //0:全年;1:半年;2:季度;3:月度
time: this.month //class->0(0),Time->1(1:上半年,2:下半年),class->2(1:第一季度,2:第二季度,3:第三季度,4:第四季度),class->3(1:1月....12:12月)
}, //时间辅助
AccMethod: [
1
], //核算方式 1:合计值;2:平均值
analysisangle: 1 //析维度 1:行政组织;2:时间
}
uni.request({
url: 'http://new.hxgk.group/api/quant/quantechart',
method: 'POST',
header: {
'content-type': 'application/json' ,//自定义请求头信息
"user-key": this.keyFrom.key,
"user-token": this.keyFrom.token
},
data: searchInfo,
//请求成功后返回
success: (res) => {
console.log(res)
// 请求成功之后将数据给Info
if(res.statusCode===200){
// that.dataList=res.data.data
safetyEchart.xAxis.data=res.data.data.xAxis
safetyEchart.title.text=res.data.data.legend
cylindricaldata=res.data.data.series
console.log("cylindricaldata")
console.log(cylindricaldata)
cylindricaldata.forEach(ele=>{
this.$set(ele, 'type', 'bar')
// this.$set(ele, 'barWidth', '25')
this.$set(ele, 'showBackground', true)
this.$set(ele, 'backgroundStyle', {
color: 'rgba(180, 180, 180, 0.2)'
})
this.$set(ele, 'formatter', function(params){
let txtArry = params.seriesName.split('');
let rs = "";
for(var i=0;i < txtArry.length; i++ ){
rs += txtArry[i] + "\n";
}
return rs;
}
)
safetyEchart.series.push(ele)
})
var dataLenth=cylindricaldata[0].data
cylindricaldata[0].data=[]
cylindricaldata[0].data=[
{
value: dataLenth[0],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#5470C6'
}
},
{
value: dataLenth[1],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#91CC75'
}
},
{
value: dataLenth[2],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#FAC858'
}
},
{
value: dataLenth[3],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#EE6666'
}
},
{
value: dataLenth[4],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#73C0DE'
}
},
{
value: dataLenth[5],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#3BA272'
}
},
]
console.log(cylindricaldata)
var myChart = this.$echarts.init(document.getElementById('environment'));
myChart.clear();
myChart.setOption(safetyEchart);
}
}
});
// const res = await quantechart(searchInfo)
// safetyEchart.xAxis.data=res.data.xAxis
// safetyEchart.legend.data=res.data.legend
// cylindricaldata=res.data.series
},
// 安全管理缩略图
async getSafetyData(){
var safetyEchart={
title: {
text: '',
left: 'center',
textStyle: {
fontSize: 14, //字体大小
fontWeight: 400, //字体粗细
align:'center',//文字水平对齐方式(left/right)
verticalAlign:'middle',//文字垂直对齐方式(top/bottom)
},
},
xAxis:{
type: 'category',
axisLabel: {
//x轴文字的配置
show: true,
interval: 0,//使x轴文字显示全
},
data: []
},
yAxis: {
type: 'value'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
data: []
},
series:[],
}
var cylindricaldata = []
const searchInfo = {
targetid: [
"6"
], //指标ID
org: [
"115",
"282",
"116",
"349",
"354",
"126",
], //行政单位
year: this.year.map(String), //年度
timeattribute: {
class: 3, //0:全年;1:半年;2:季度;3:月度
time: this.month //class->0(0),Time->1(1:上半年,2:下半年),class->2(1:第一季度,2:第二季度,3:第三季度,4:第四季度),class->3(1:1月....12:12月)
}, //时间辅助
AccMethod: [
1
], //核算方式 1:合计值;2:平均值
analysisangle: 1 //析维度 1:行政组织;2:时间
}
uni.request({
url: 'http://new.hxgk.group/api/quant/quantechart',
// url: 'http://hxgk.user.phone/api/quant/quantechart',
method: 'POST',
header: {
'content-type': 'application/json' ,//自定义请求头信息
"user-key": this.keyFrom.key,
"user-token": this.keyFrom.token
// 'user-token': 'd0b27f36e0d7dfdf883dfe0000069ca182078ed2',
// "user-key": '4fb8e8697c366be03e8fc96319b98524'
},
data: searchInfo,
//请求成功后返回
success: (res) => {
console.log(res)
// 请求成功之后将数据给Info
if(res.statusCode===200){
// that.dataList=res.data.data
safetyEchart.xAxis.data=res.data.data.xAxis
safetyEchart.title.text=res.data.data.legend
cylindricaldata=res.data.data.series
console.log("cylindricaldata")
console.log(cylindricaldata)
cylindricaldata.forEach(ele=>{
this.$set(ele, 'type', 'bar')
// this.$set(ele, 'barWidth', '25')
this.$set(ele, 'showBackground', true)
this.$set(ele, 'backgroundStyle', {
color: 'rgba(180, 180, 180, 0.2)'
})
this.$set(ele, 'formatter', function(params){
let txtArry = params.seriesName.split('');
let rs = "";
for(var i=0;i < txtArry.length; i++ ){
rs += txtArry[i] + "\n";
}
return rs;
}
)
safetyEchart.series.push(ele)
})
console.log(cylindricaldata)
var dataLenth=cylindricaldata[0].data
cylindricaldata[0].data=[]
cylindricaldata[0].data=[
{
value: dataLenth[0],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#5470C6'
}
},
{
value: dataLenth[1],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#91CC75'
}
},
{
value: dataLenth[2],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#FAC858'
}
},
{
value: dataLenth[3],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#EE6666'
}
},
{
value: dataLenth[4],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#73C0DE'
}
},
{
value: dataLenth[5],
label: {
show: true,
position: 'top',
color:'black'
},
itemStyle: {
color: '#3BA272'
}
},
]
var myChart = this.$echarts.init(document.getElementById('safety'));
console.log("safetyEchart")
console.log(safetyEchart)
myChart.clear();
myChart.setOption(safetyEchart);
}
}
});
},
async getData(){
const that = this
uni.request({
url: 'http://new.hxgk.group/api/eval/newqualitative',
method: 'POST',
header: {
'content-type': 'application/json' ,//自定义请求头信息
"user-key": this.keyFrom.key,
"user-token": this.keyFrom.token
},
//请求成功后返回
success: (res) => {
console.log(res)
// 请求成功之后将数据给Info
if(res.statusCode===200){
that.dataList=res.data.data
}
}
});
},
async getProcessData(){
const that = this
uni.request({
url: 'http://new.hxgk.group/api/eval/seeflowlog',
method: 'POST',
header: {
'content-type': 'application/json' ,//自定义请求头信息
"user-key": this.keyFrom.key,
"user-token": this.keyFrom.token
},
data: {
isset: 2,
page: 1,
pagesize: 1000000,
state: 0
},
//请求成功后返回
success: (res) => {
console.log(res)
// 请求成功之后将数据给Info
if(res.statusCode===200){
that.dataProcessList=res.data.data.list
}
}
});
},
thumbChange(index) {
this.thumb = index == 0 ? 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg' : '';
},
paddingChange(index) {
this.padding = [20, 30, 40][index];
},
bottomChange(index) {
this.bottomSlot = !index;
},
borderChange(index) {
this.border = !index;
},
click(index) {
console.log(index);
},
headClick(index) {
uni.switchTab({
url: '/pages/task/index'
});
},
headClick1(index) {
uni.switchTab({
url: '/pages/approval/index'
});
},
toRen() {
uni.switchTab({
url: '/pages/task/index'
});
},
toShen() {
uni.switchTab({
url: '/pages/approval/index'
});
},
toMy() {
uni.switchTab({
url: '/pages/personal/index'
});
},
}
}
</script>
<style scoped lang="scss">
.u-demo {
padding-top: 0;
}
.u-card-wrap {
background-color: $u-bg-color;
padding: 1px;
}
.u-body-item {
font-size: 32rpx;
color: #333;
padding: 20rpx 10rpx;
}
.u-body-item image {
width: 120rpx;
flex: 0 0 120rpx;
height: 120rpx;
border-radius: 8rpx;
margin-left: 12rpx;
}
/* 自定义宽度 */
/deep/ .my-el-select {
margin-left: 15px;
width: 320px;
/* selecte 框的高度设置默认是 40px*/
.el-input__inner{
height: 30px;
}
/* 下面设置右侧按钮居中 */
.el-input__suffix {
top: 5px;
}
.el-input__icon {
line-height: inherit;
}
.el-input__suffix-inner {
display: inline-block;
}
}
</style>