|
|
@@ -0,0 +1,960 @@
|
|
|
+<template>
|
|
|
+ <no-ssr placeholder="数据拼命读取中,请稍候。。。">
|
|
|
+ <div style="width: 100%; overflow-y: auto" v-loading="downloading">
|
|
|
+ <div slot="header" style="padding-top: 0px">
|
|
|
+ <el-card>
|
|
|
+ <span style="float: left; margin-top:10px;">
|
|
|
+ <img v-if="user.photo" :src="'http://'+user.host+user.photo" class="avatar-index">
|
|
|
+ <img v-else class="avatar-index" src="../assets/img/avatar-default.jpg" :alt="user.name"> [
|
|
|
+ {{user.Realname}} ]
|
|
|
+ </span>
|
|
|
+ <span style="float: right; margin-right:10px;">
|
|
|
+ <el-form ref="form" :inline="true" style="float: right;">
|
|
|
+ <el-form-item label="查询日期">
|
|
|
+ <el-date-picker v-model="Getime" size="mini" type="daterange" range-separator="至" start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期" style="width:200px" @change="getNewData"></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-select v-if="allshow" v-model="Department" clearable filterable placeholder="请选择公司" size="mini" style="width: 110px"
|
|
|
+ @change="getNewData">
|
|
|
+ <el-option v-for="item in departmentList" :key="item.value" :label="item.Name" :value="item.Id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </span>
|
|
|
+ <el-form ref="form" :inline="true" style="float: left; margin-left:20px;">
|
|
|
+ <el-form-item>
|
|
|
+ <router-link :to="'/lims/dataentry/tacktodo'">
|
|
|
+ <el-button type="primary" plain style="margin-left:5px;" size="mini" v-if="!allshow && permissions[permissionscode.entry]">
|
|
|
+ 数据录入
|
|
|
+ <span style="color:#0000FF">【{{usertotal.EntryTotal}}】</span>
|
|
|
+ </el-button>
|
|
|
+ </router-link>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <router-link :to="'/lims/dataentry/tacktodo'">
|
|
|
+ <el-button type="primary" plain style="margin-left:5px;" size="mini" v-if="!allshow && permissions[permissionscode.check]">
|
|
|
+ 数据校核
|
|
|
+ <span style="color:#0000FF">【{{usertotal.CheckTotal}}】</span>
|
|
|
+ </el-button>
|
|
|
+ </router-link>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <router-link :to="'/lims/dataentry/tacktodo'">
|
|
|
+ <el-button type="primary" plain style="margin-left:5px;" size="mini" v-if="!allshow && permissions[permissionscode.audit]">
|
|
|
+ 数据审批
|
|
|
+ <span style="color:#0000FF">【{{usertotal.AuditTotal}}】</span>
|
|
|
+ </el-button>
|
|
|
+ </router-link>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <router-link :to="'/lims/createreport/reporttodo'">
|
|
|
+ <el-button type="primary" plain style="margin-left:5px;" size="mini" v-if="!allshow && permissions[permissionscode.sign]">
|
|
|
+ 报告签发
|
|
|
+ <span style="color:#0000FF">【{{usertotal.SignTotal}}】</span>
|
|
|
+ </el-button>
|
|
|
+ </router-link>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-card>
|
|
|
+
|
|
|
+ <el-row :gutter="5">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-card class="box-card" style="height: calc(100vh - 350px);" v-if="!allshow">
|
|
|
+ <div slot="header">
|
|
|
+ <legend style="color:#436EEE"></legend>
|
|
|
+ <i class="icon icon-database"> 待办工作</i>
|
|
|
+ </div>
|
|
|
+ <el-table :data="WaitData" size="small" border height="calc(100vh - 470px)">
|
|
|
+ <el-table-column label="待办工作跳转" width="100" align="center" fixed>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="primary" plain size="mini" @click="gopage(scope.row)">详情</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="EntrustNo" sortable min-width="100" label="委托单号" align="center"></el-table-column>
|
|
|
+ <el-table-column prop="CustomerName" sortable min-width="90" label="委托方名称" align="center"></el-table-column>
|
|
|
+ <el-table-column prop="TestDetail" sortable min-width="100" label="检测项目" align="center"></el-table-column>
|
|
|
+ <el-table-column prop="CheckStatus" sortable min-width="90" label="代办工作" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag size="small" v-show="scope.row.CheckStatus=='0'" type="danger">数据录入</el-tag>
|
|
|
+ <el-tag size="small" v-show="scope.row.CheckStatus=='1'" type="success">数据校核</el-tag>
|
|
|
+ <el-tag size="small" v-show="scope.row.CheckStatus=='2'" type="info">数据审批</el-tag>
|
|
|
+ <el-tag size="small" v-show="scope.row.ReportStatus=='4'" type="warning">报告签发</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-card class="box-card" style="height: calc(100vh - 350px);" v-if="!allshow">
|
|
|
+ <div slot="header">
|
|
|
+ <legend style="color:#436EEE"></legend>
|
|
|
+ <i class="icon icon-database"> 已办工作</i>
|
|
|
+ </div>
|
|
|
+ <el-table :data="DoneData" size="small" border height="calc(100vh - 470px)">
|
|
|
+ <el-table-column prop="EntrustNo" sortable min-width="100" label="委托单号" align="center"></el-table-column>
|
|
|
+ <el-table-column prop="CustomerName" sortable min-width="100" label="委托方名称" align="center"></el-table-column>
|
|
|
+ <el-table-column prop="TestDetail" sortable min-width="100" label="检测项目" align="center"></el-table-column>
|
|
|
+ <el-table-column prop="CheckStatus" sortable min-width="100" label="已办工作" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag size="small" v-show="scope.row.CreateUserId == user.id&&scope.row.CheckStatus=='1'" type="danger">数据录入</el-tag>
|
|
|
+ <el-tag size="small" v-show="scope.row.JHUserId == user.id&&(scope.row.CheckStatus=='2'||scope.row.CheckStatus=='3')"
|
|
|
+ type="success">数据校核</el-tag>
|
|
|
+ <el-tag size="small" v-show="scope.row.CheckUserId == user.id&&(scope.row.CheckStatus=='4'||scope.row.CheckStatus=='5')"
|
|
|
+ type="info">数据审批</el-tag>
|
|
|
+ <el-tag size="small" v-show="scope.row.ReportStatus != '0'" type="warning">报告签发</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row>
|
|
|
+ <el-card style="margin-top: 5px; height:460.5px; width: 100%">
|
|
|
+ <div class="salesCard">
|
|
|
+ <el-col :span="16" style="margin-top: -10px">
|
|
|
+ <el-tabs size="large" :tab-bar-style="{marginBottom: '24px', paddingLeft: '16px'}">
|
|
|
+ <el-tab-pane label="检测任务">
|
|
|
+ <div v-if="EntrustX.length === 0">无显示数据,可在
|
|
|
+ <router-link :to="'/lims/tasksentrust/addentrust/operation'">检测任务</router-link> 中录入</div>
|
|
|
+ <div id="Entrustid" style="height:380px; margin-left:-25px; margin-top:-10px; min-width:400px; width: 900px"></div>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="数据录入">
|
|
|
+ <div v-if="DataEntryX.length === 0">无显示数据,可在
|
|
|
+ <router-link :to="'/lims/dataentry/tacktodo'">数据录入</router-link> 中录入</div>
|
|
|
+ <div id="Dataentryid" style="height:380px; margin-left:-25px; margin-top:-10px; min-width:400px; width: 900px"></div>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8" style="float: right; margin-top: -10px">
|
|
|
+ <div v-if="ProjectList.length === 0">无显示数据</div>
|
|
|
+ <ranking-list title="检测报告" :list="ProjectList" />
|
|
|
+ </el-col>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="5">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-card :bordered="false" style="margin-top: 5px">
|
|
|
+ <div slot="header">
|
|
|
+ <legend style="color:#436EEE"></legend>
|
|
|
+ <i class="icon icon-database"> 设备使用记录统计</i>
|
|
|
+ </div>
|
|
|
+ <div v-if="InstrumentX.length === 0">无显示数据</div>
|
|
|
+ <div id="Instrumentid" style="height:366.5px; min-width:400px; width: 100%"></div>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-card :bordered="false" style="margin-top: 5px">
|
|
|
+ <div slot="header">
|
|
|
+ <legend style="color:#436EEE"></legend>
|
|
|
+ <i class="icon icon-database"> 委托方统计</i>
|
|
|
+ </div>
|
|
|
+ <div v-if="CustomerTitle.length === 0">无显示数据</div>
|
|
|
+ <div id="Customerid" style="width:100%; height:366.5px;"></div>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </no-ssr>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import echarts from 'echarts'
|
|
|
+ import {
|
|
|
+ mapGetters
|
|
|
+ } from 'vuex'
|
|
|
+
|
|
|
+ import ChartCard from '../components/card/ChartCard'
|
|
|
+ import MiniArea from '../components/chart/MiniArea'
|
|
|
+ import MiniBar from '../components/chart/MiniBar'
|
|
|
+ import MiniProgress from '../components/chart/MiniProgress'
|
|
|
+ import Bar from '../components/chart/Bar'
|
|
|
+ import RankingList from '../components/chart/RankingList'
|
|
|
+ import Trend from '../components/chart/Trend'
|
|
|
+ import docTemplateApi from '@/api/lims/docTemplate'
|
|
|
+ import SalesData from '../components/chart/SalesData'
|
|
|
+
|
|
|
+ export default {
|
|
|
+ computed: {
|
|
|
+ ...mapGetters({
|
|
|
+ authUser: 'authUser'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ name: 'index',
|
|
|
+ components: {
|
|
|
+ Trend,
|
|
|
+ RankingList,
|
|
|
+ Bar,
|
|
|
+ MiniProgress,
|
|
|
+ MiniBar,
|
|
|
+ MiniArea,
|
|
|
+ ChartCard,
|
|
|
+ SalesData
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ currentPage: 1,
|
|
|
+ pageSize: 50,
|
|
|
+ downloading: true,
|
|
|
+ usertotal: {},
|
|
|
+ DoneTotal: {},
|
|
|
+ WaitData: [], //待办事项列表数据
|
|
|
+ DoneData: [], //已办工作列表数据
|
|
|
+ department: '',
|
|
|
+ Department: '',
|
|
|
+ departmentList: [{
|
|
|
+ Id: 100000150,
|
|
|
+ Name: '特检站'
|
|
|
+ }, {
|
|
|
+ Id: 100000151,
|
|
|
+ Name: '宇信公司'
|
|
|
+ }, {
|
|
|
+ Id: 100000152,
|
|
|
+ Name: '计量能源站'
|
|
|
+ }, {
|
|
|
+ Id: 100000153,
|
|
|
+ Name: '工程监督中心'
|
|
|
+ }, {
|
|
|
+ Id: 100000166,
|
|
|
+ Name: '质检中心'
|
|
|
+ }, {
|
|
|
+ Id: 100000167,
|
|
|
+ Name: '物资商品检验所'
|
|
|
+ }],
|
|
|
+ Getime: [new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 12000), new Date()],
|
|
|
+ WhtinTime: new Date(new Date().getTime() - 3600 * 1000 * 24 * 7),
|
|
|
+ ProjectList: [],
|
|
|
+ InstrumentList: [],
|
|
|
+ Entrustid: null,
|
|
|
+ Dataentryid: null,
|
|
|
+ Customerid: null,
|
|
|
+ Instrumentid: null,
|
|
|
+ CustomerTitle: [], //委托方
|
|
|
+ CustomerData: [], //委托方数据
|
|
|
+ EntrustX: [], //检测任务月份
|
|
|
+ EntrustY: [], //检测任务数目
|
|
|
+ DataEntryX: [], //数据录入月份
|
|
|
+ DataEntryY: [], //数据录入数目
|
|
|
+ InstrumentX: [], //设备使用记录
|
|
|
+ InstrumentY: [],
|
|
|
+ reportColor: ['#188df0'],
|
|
|
+ instrumentColor: ['#FA7080', '#FFE373', '#816FD7', '#FF9B73', '#FFF273', '#FFBFB2', '#F690BB', '#1E90FF',
|
|
|
+ '#000080'
|
|
|
+ ],
|
|
|
+ user: {
|
|
|
+ id: '',
|
|
|
+ photo: '',
|
|
|
+ name: '',
|
|
|
+ Realname: '',
|
|
|
+ host: ''
|
|
|
+ },
|
|
|
+ allshow: false,
|
|
|
+ whichshow: '',
|
|
|
+ permissionscode: {
|
|
|
+ entry: 'lims.dataentry.add',
|
|
|
+ check: 'lims.dataentry.approve',
|
|
|
+ audit: 'lims.dataentry.makesure',
|
|
|
+ sign: 'lims.report.send',
|
|
|
+ },
|
|
|
+ permissions: {
|
|
|
+ 'lims.dataentry.add': false,
|
|
|
+ 'lims.dataentry.approve': false,
|
|
|
+ 'lims.dataentry.makesure': false,
|
|
|
+ 'lims.report.send': false,
|
|
|
+ },
|
|
|
+
|
|
|
+ docTemplateDictList: [],
|
|
|
+ docTempType: '',
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ //this.initDatas()
|
|
|
+ this.getPermissions() //权限
|
|
|
+ this.getShowPermissions()
|
|
|
+ this.getDictList() //获取模板
|
|
|
+ let _this = this
|
|
|
+ _this.user.photo = _this.authUser.Profile.Photo
|
|
|
+ _this.user.name = _this.authUser.Profile.name
|
|
|
+ _this.user.Realname = _this.authUser.Profile.Realname
|
|
|
+ _this.user.host = _this.authUser.Profile.Host
|
|
|
+ _this.user.id = _this.authUser.Profile.Id
|
|
|
+ },
|
|
|
+ computed: mapGetters({
|
|
|
+ authUser: 'authUser'
|
|
|
+ }),
|
|
|
+ methods: {
|
|
|
+ initData() {
|
|
|
+ let _this = this
|
|
|
+ // paginate
|
|
|
+ const params = {
|
|
|
+ _currentPage: this.currentPage,
|
|
|
+ _size: this.pageSize
|
|
|
+ }
|
|
|
+ this.$axios.get('/limsindex/getwaiting', {
|
|
|
+ params
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ _this.usertotal = res.data
|
|
|
+ _this.downloading = false
|
|
|
+ _this.getProject()
|
|
|
+ _this.getEntrust()
|
|
|
+ _this.getDataEntry()
|
|
|
+ _this.getInstrument()
|
|
|
+ _this.getCustomer()
|
|
|
+ _this.pushData()
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ initDatas() {
|
|
|
+ let _this = this
|
|
|
+ // paginate
|
|
|
+ const params = {
|
|
|
+ _currentPage: this.currentPage,
|
|
|
+ _size: this.pageSize,
|
|
|
+ whtintime: this.formatDateTime(this.WhtinTime)
|
|
|
+ }
|
|
|
+ this.$axios.get('/limsindex/getdone', {
|
|
|
+ params
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ _this.DoneTotal = res.data
|
|
|
+ _this.downloading = false
|
|
|
+ _this.pushDoneData()
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ pushData() {
|
|
|
+ let _this = this
|
|
|
+ if (_this.usertotal.EntryList.length && _this.usertotal.EntryList.length > 0) {
|
|
|
+ _this.WaitData = _this.WaitData.concat(_this.usertotal.EntryList)
|
|
|
+ }
|
|
|
+ if (_this.usertotal.CheckList.length && _this.usertotal.CheckList.length > 0) {
|
|
|
+ _this.WaitData = _this.WaitData.concat(_this.usertotal.CheckList)
|
|
|
+ }
|
|
|
+ if (_this.usertotal.AuditList.length && _this.usertotal.AuditList.length > 0) {
|
|
|
+ _this.WaitData = _this.WaitData.concat(_this.usertotal.AuditList)
|
|
|
+ }
|
|
|
+ if (_this.usertotal.SignList.length && _this.usertotal.SignList.length > 0) {
|
|
|
+ _this.WaitData = _this.WaitData.concat(_this.usertotal.SignList)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ pushDoneData() {
|
|
|
+ this.$axios.get('/limsdataentry/list', {}).then(res => {
|
|
|
+ if (res.data.items) {
|
|
|
+ this.DoneData = this.DoneData.concat(res.data.items)
|
|
|
+ }
|
|
|
+ this.$axios.get('/createreport/list', {}).then(res => {
|
|
|
+ if (res.data.items) {
|
|
|
+ this.DoneData = this.DoneData.concat(res.data.items)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ // let _this = this
|
|
|
+ // if (_this.DoneTotal.EntryList.length && _this.DoneTotal.EntryList.length > 0) {
|
|
|
+ // _this.DoneData = _this.DoneData.concat(_this.DoneTotal.EntryList)
|
|
|
+ // }
|
|
|
+ // if (_this.DoneTotal.CheckList.length && _this.DoneTotal.CheckList.length > 0) {
|
|
|
+ // _this.DoneData = _this.DoneData.concat(_this.DoneTotal.CheckList)
|
|
|
+ // }
|
|
|
+ // if (_this.DoneTotal.AuditList.length && _this.DoneTotal.AuditList.length > 0) {
|
|
|
+ // _this.DoneData = _this.DoneData.concat(_this.DoneTotal.AuditList)
|
|
|
+ // }
|
|
|
+ // if (_this.DoneTotal.SignList.length && _this.DoneTotal.SignList.length > 0) {
|
|
|
+ // _this.DoneData = _this.DoneData.concat(_this.DoneTotal.SignList)
|
|
|
+ // }
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ getNewData() {
|
|
|
+ this.WaitData = [] //待办事项列表
|
|
|
+ //this.DoneData = [] //已办事项列表
|
|
|
+ this.EntrustX = [] //检测任务月份
|
|
|
+ this.EntrustY = [] //检测任务数目
|
|
|
+ this.DataEntryX = [] //数据录入月份
|
|
|
+ this.DataEntryY = [] //数据录入数目
|
|
|
+ this.ProjectList = []
|
|
|
+ this.InstrumentX = []
|
|
|
+ this.InstrumentY = []
|
|
|
+ this.CustomerTitle = [] //委托方
|
|
|
+ this.CustomerData = [] //委托方数据
|
|
|
+ this.initData()
|
|
|
+ },
|
|
|
+ //检测任务柱状图数据获取
|
|
|
+ getEntrust() {
|
|
|
+ let _this = this
|
|
|
+ let getime = []
|
|
|
+ if (!_this.Getime) {
|
|
|
+ _this.Getime = []
|
|
|
+ }
|
|
|
+ // 解析时间
|
|
|
+ if (_this.Getime.length == 2) {
|
|
|
+ _this.Getime[1].setHours(23)
|
|
|
+ _this.Getime[1].setMinutes(59)
|
|
|
+ _this.Getime[1].setSeconds(59)
|
|
|
+ getime.push(_this.formatDateTime(_this.Getime[0]))
|
|
|
+ getime.push(_this.formatDateTime(_this.Getime[1]))
|
|
|
+ }
|
|
|
+ let params = {
|
|
|
+ department: this.Department,
|
|
|
+ }
|
|
|
+ _this.$axios.get('/limsindex/getentrust?getime=' + getime.join(','), {
|
|
|
+ params
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ for (var i = 0; i < res.data.length; i++) {
|
|
|
+ _this.EntrustX.push(res.data[i].YearName + '年' + res.data[i].MonthName + '月')
|
|
|
+ _this.EntrustY.push(res.data[i].Num)
|
|
|
+ }
|
|
|
+ _this.drawEntrust()
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ drawEntrust() {
|
|
|
+ let _this = this
|
|
|
+ var chartBar = echarts.init(document.getElementById('Entrustid'))
|
|
|
+ chartBar.setOption({
|
|
|
+ title: {
|
|
|
+ text: ''
|
|
|
+ },
|
|
|
+ tooltip: {
|
|
|
+ trigger: 'item',
|
|
|
+ formatter: '({b}) {c}'
|
|
|
+ },
|
|
|
+ xAxis: {
|
|
|
+ data: _this.EntrustX,
|
|
|
+ },
|
|
|
+ yAxis: {},
|
|
|
+ series: [{
|
|
|
+ name: '月份',
|
|
|
+ type: 'bar',
|
|
|
+ label: {
|
|
|
+ normal: {
|
|
|
+ show: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data: _this.EntrustY,
|
|
|
+ itemStyle: {
|
|
|
+ normal: {
|
|
|
+ color: function (params) {
|
|
|
+ var colorList = _this.reportColor
|
|
|
+ return colorList[params.dataIndex]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //数据录入柱状图数据获取
|
|
|
+ getDataEntry() {
|
|
|
+ let _this = this
|
|
|
+ let getime = []
|
|
|
+ if (!_this.Getime) {
|
|
|
+ _this.Getime = []
|
|
|
+ }
|
|
|
+ // 解析时间
|
|
|
+ if (_this.Getime.length == 2) {
|
|
|
+ _this.Getime[1].setHours(23)
|
|
|
+ _this.Getime[1].setMinutes(59)
|
|
|
+ _this.Getime[1].setSeconds(59)
|
|
|
+ getime.push(_this.formatDateTime(_this.Getime[0]))
|
|
|
+ getime.push(_this.formatDateTime(_this.Getime[1]))
|
|
|
+ }
|
|
|
+ let params = {
|
|
|
+ department: this.Department,
|
|
|
+ }
|
|
|
+ _this.$axios.get('/limsindex/getdata?getime=' + getime.join(','), {
|
|
|
+ params
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ for (var i = 0; i < res.data.length; i++) {
|
|
|
+ _this.DataEntryX.push(res.data[i].YearName + '年' + res.data[i].MonthName + '月')
|
|
|
+ _this.DataEntryY.push(res.data[i].Num)
|
|
|
+ }
|
|
|
+ _this.drawDataEntry()
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ drawDataEntry() {
|
|
|
+ let _this = this
|
|
|
+ var chartBar = echarts.init(document.getElementById('Dataentryid'))
|
|
|
+ chartBar.setOption({
|
|
|
+ title: {
|
|
|
+ text: ''
|
|
|
+ },
|
|
|
+ tooltip: {
|
|
|
+ trigger: 'item',
|
|
|
+ formatter: '({b}) {c}'
|
|
|
+ },
|
|
|
+ xAxis: {
|
|
|
+ data: _this.DataEntryX,
|
|
|
+ },
|
|
|
+ yAxis: {},
|
|
|
+ series: [{
|
|
|
+ name: '月份',
|
|
|
+ type: 'bar',
|
|
|
+ label: {
|
|
|
+ normal: {
|
|
|
+ show: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data: _this.DataEntryY,
|
|
|
+ itemStyle: {
|
|
|
+ normal: {
|
|
|
+ color: function (params) {
|
|
|
+ var colorList = _this.reportColor
|
|
|
+ return colorList[params.dataIndex]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //检测报告列表获取获取
|
|
|
+ getProject() {
|
|
|
+ let _this = this
|
|
|
+ let getime = []
|
|
|
+ if (!_this.Getime) {
|
|
|
+ _this.Getime = []
|
|
|
+ }
|
|
|
+ // 解析时间
|
|
|
+ if (_this.Getime.length == 2) {
|
|
|
+ _this.Getime[1].setHours(23)
|
|
|
+ _this.Getime[1].setMinutes(59)
|
|
|
+ _this.Getime[1].setSeconds(59)
|
|
|
+ getime.push(_this.formatDateTime(_this.Getime[0]))
|
|
|
+ getime.push(_this.formatDateTime(_this.Getime[1]))
|
|
|
+ }
|
|
|
+ let params = {
|
|
|
+ department: this.Department,
|
|
|
+ }
|
|
|
+ _this.$axios.get('/limsindex/getproject?getime=' + getime.join(','), {
|
|
|
+ params
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ for (var i = 0; i < res.data.length; i++) {
|
|
|
+ _this.ProjectList.push({
|
|
|
+ name: res.data[i].Name,
|
|
|
+ total: res.data[i].Num
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //设备运行记录图
|
|
|
+ getInstrument() {
|
|
|
+ let _this = this
|
|
|
+ let getime = []
|
|
|
+ if (!_this.Getime) {
|
|
|
+ _this.Getime = []
|
|
|
+ }
|
|
|
+ // 解析时间
|
|
|
+ if (_this.Getime.length == 2) {
|
|
|
+ _this.Getime[1].setHours(23)
|
|
|
+ _this.Getime[1].setMinutes(59)
|
|
|
+ _this.Getime[1].setSeconds(59)
|
|
|
+ getime.push(_this.formatDateTime(_this.Getime[0]))
|
|
|
+ getime.push(_this.formatDateTime(_this.Getime[1]))
|
|
|
+ }
|
|
|
+ let params = {
|
|
|
+ department: this.Department,
|
|
|
+ }
|
|
|
+ _this.$axios.get('/limsindex/getinstrument?getime=' + getime.join(','), {
|
|
|
+ params
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ // if (res.data == null) {
|
|
|
+ // _this.$message({
|
|
|
+ // type: "warning",
|
|
|
+ // message: "设备使用记录没有符合查询条件的结果!"
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ for (var i = 0; i < res.data.length; i++) {
|
|
|
+ _this.InstrumentX.push(res.data[i].Name)
|
|
|
+ _this.InstrumentY.push(res.data[i].Num)
|
|
|
+ }
|
|
|
+ // }
|
|
|
+ _this.drawInstrument()
|
|
|
+ }).catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ drawInstrument() {
|
|
|
+ let _this = this
|
|
|
+ var chartBar = echarts.init(document.getElementById('Instrumentid'))
|
|
|
+ chartBar.setOption({
|
|
|
+ title: {
|
|
|
+ text: ''
|
|
|
+ },
|
|
|
+ tooltip: {
|
|
|
+ trigger: 'axis',
|
|
|
+ // formatter: '({b}) {c}'
|
|
|
+ axisPointer: {
|
|
|
+ type: 'shadow'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ grid: {
|
|
|
+ left: '3%',
|
|
|
+ right: '4%',
|
|
|
+ bottom: '3%',
|
|
|
+ containLabel: true
|
|
|
+ },
|
|
|
+ xAxis: {
|
|
|
+ type: 'value',
|
|
|
+ boundaryGap: [0, 0.01],
|
|
|
+ },
|
|
|
+ yAxis: {
|
|
|
+ type: 'category',
|
|
|
+ data: _this.InstrumentX,
|
|
|
+ },
|
|
|
+ series: [{
|
|
|
+ name: '设备名称',
|
|
|
+ type: 'bar',
|
|
|
+ label: {
|
|
|
+ normal: {
|
|
|
+ show: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data: _this.InstrumentY,
|
|
|
+ itemStyle: {
|
|
|
+ normal: {
|
|
|
+ color: function (params) {
|
|
|
+ var colorList = _this.instrumentColor
|
|
|
+ return colorList[params.dataIndex]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ //委托方统计环形图获取
|
|
|
+ getCustomer() {
|
|
|
+ let _this = this
|
|
|
+ let getime = []
|
|
|
+ if (!_this.Getime) {
|
|
|
+ _this.Getime = []
|
|
|
+ }
|
|
|
+ // 解析时间
|
|
|
+ if (_this.Getime.length == 2) {
|
|
|
+ _this.Getime[1].setHours(23)
|
|
|
+ _this.Getime[1].setMinutes(59)
|
|
|
+ _this.Getime[1].setSeconds(59)
|
|
|
+ getime.push(_this.formatDateTime(_this.Getime[0]))
|
|
|
+ getime.push(_this.formatDateTime(_this.Getime[1]))
|
|
|
+ }
|
|
|
+ // let params = {
|
|
|
+ // department: this.Department,
|
|
|
+ // }
|
|
|
+ _this.$axios.get('limsindex/getcustomer?getime=' + getime.join(','), {})
|
|
|
+ .then(res => {
|
|
|
+ // if (res.data == null) {
|
|
|
+ // _this.$message({
|
|
|
+ // type: "warning",
|
|
|
+ // message: "没有符合查询条件的结果!"
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ for (var i = 0; i < res.data.length; i++) {
|
|
|
+ if (res.data[i].Name === '') {
|
|
|
+ res.data[i].Name = '未知'
|
|
|
+ }
|
|
|
+ if (i < 10) {
|
|
|
+ _this.CustomerTitle.push({
|
|
|
+ name: res.data[i].Name
|
|
|
+ })
|
|
|
+ _this.CustomerData.push({
|
|
|
+ name: res.data[i].Name,
|
|
|
+ value: res.data[i].Num
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ _this.CustomerData.push({
|
|
|
+ name: res.data[i].Name,
|
|
|
+ value: res.data[i].Num
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // }
|
|
|
+ _this.drawCustomer()
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ drawCustomer() {
|
|
|
+ var chartPie = echarts.init(document.getElementById('Customerid'))
|
|
|
+ chartPie.setOption({
|
|
|
+ title: {
|
|
|
+ text: ''
|
|
|
+ },
|
|
|
+ tooltip: {
|
|
|
+ trigger: 'item',
|
|
|
+ formatter: '{b} {c} ({d}%)'
|
|
|
+ },
|
|
|
+ legend: {
|
|
|
+ orient: 'vertical',
|
|
|
+ left: 'right',
|
|
|
+ itemHeight: 20,
|
|
|
+ itemWidth: 20,
|
|
|
+ data: this.CustomerTitle
|
|
|
+ },
|
|
|
+ color: ['#FA7080', '#FFE373', '#816FD7', '#FF9B73', '#FFF273', '#FFBFB2', '#F690BB', '#1E90FF', '#000080'],
|
|
|
+ series: [{
|
|
|
+ name: '委托方统计',
|
|
|
+ type: 'pie',
|
|
|
+ radius: ['35%', '80%'],
|
|
|
+ label: {
|
|
|
+ normal: {
|
|
|
+ show: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data: this.CustomerData
|
|
|
+ }]
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ //页面跳转
|
|
|
+ gopage(val) {
|
|
|
+ if (val.CheckStatus == '0' || val.CheckStatus == '1' || val.CheckStatus == '2') {
|
|
|
+ this.OpenOrignDataInput(val)
|
|
|
+ } else if (val.CheckStatus == '4') {
|
|
|
+ this.shenHeFunc(val)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getDictList() {
|
|
|
+ docTemplateApi.getDictList(this.$axios).then(res => {
|
|
|
+ this.docTemplateDictList = res.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //打开数据录入
|
|
|
+ OpenOrignDataInput(row) {
|
|
|
+ let CheckStatus = row.CheckStatus
|
|
|
+ let eid = row.EId
|
|
|
+ let tbid = row.TaskId
|
|
|
+ let DataEntryId = row.Id
|
|
|
+ let datadocId = row.DataDocId
|
|
|
+ let datadoc = row.DataDoc
|
|
|
+ for (let idx in this.docTemplateDictList) {
|
|
|
+ if (datadocId == this.docTemplateDictList[idx].Id) {
|
|
|
+ this.docTempType = this.docTemplateDictList[idx].TemplateCode
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let queryParams = {
|
|
|
+ eid: eid,
|
|
|
+ tbid: tbid,
|
|
|
+ deid: DataEntryId,
|
|
|
+ datastatus: CheckStatus,
|
|
|
+ datadocId: datadocId
|
|
|
+ };
|
|
|
+ switch (this.docTempType) {
|
|
|
+ //漏电保护
|
|
|
+ case "DAYT.LeakProtect.Detail":
|
|
|
+ this.$router.push({
|
|
|
+ path: '/lims/reportleakprotect/subdata/datalist',
|
|
|
+ query: queryParams,
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ //空气泡沫
|
|
|
+ case "DAYT.Airfoamgenerator.Detail":
|
|
|
+ this.$router.push({
|
|
|
+ path: '/lims/reportairfoamgenerator/subdata/datalist',
|
|
|
+ query: queryParams,
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ //呼吸阀
|
|
|
+ case "DAYT.AtmosValve.Detail":
|
|
|
+ this.$router.push({
|
|
|
+ path: '/lims/reportatmosvalve/subdata/datalist',
|
|
|
+ query: queryParams,
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ //液压安全阀
|
|
|
+ case "DAYT.HydraulicSafe.Detail":
|
|
|
+ this.$router.push({
|
|
|
+ path: '/lims/reporthydraulicsafe/subdata/datalist',
|
|
|
+ query: queryParams,
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ //电气接地
|
|
|
+ case "DAYT.ElecGround.Detail":
|
|
|
+ this.$router.push({
|
|
|
+ path: '/lims/reportelecground/subdata/datalist',
|
|
|
+ query: queryParams,
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ //防雷装置等电位
|
|
|
+ case "DAYT.Equipotent.Detail":
|
|
|
+ this.$router.push({
|
|
|
+ path: '/lims/reportequipotent/subdata/datalist',
|
|
|
+ query: queryParams,
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ //防雷装置
|
|
|
+ case "DAYT.LightProtect.Detail":
|
|
|
+ this.$router.push({
|
|
|
+ path: '/lims/reportlightprotect/datareview',
|
|
|
+ query: queryParams,
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ //电流表
|
|
|
+ case "DAYT.Ammeter.Detail":
|
|
|
+ this.$router.push({
|
|
|
+ path: '/lims/reportammeter/subdata/dataopera',
|
|
|
+ query: queryParams,
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ //阻火器
|
|
|
+ case "DAYT.BackFire.Detail":
|
|
|
+ this.$router.push({
|
|
|
+ path: '/lims/reportzuhq/subdata/datalist',
|
|
|
+ query: queryParams,
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ //游梁式抽油机
|
|
|
+ case "DAYT.BeamPumpingUnits.Detail":
|
|
|
+ this.$router.push({
|
|
|
+ path: '/lims/reportbeampumpingUnits/subdata/dataopera',
|
|
|
+ query: queryParams,
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ //无游梁式抽油机
|
|
|
+ case "DAYT.NoBeamPumpingUnits.Detail":
|
|
|
+ this.$router.push({
|
|
|
+ path: '/lims/reportnobeampumpingUnits/subdata/dataopera',
|
|
|
+ query: queryParams,
|
|
|
+ });
|
|
|
+ break;
|
|
|
+
|
|
|
+ default:
|
|
|
+ this.$message.warning('无模板类型相匹配,请重试');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 签发
|
|
|
+ shenHeFunc(row) {
|
|
|
+ let _this = this
|
|
|
+ let queryParams = {
|
|
|
+ key: row.Id + '' + row.EId,
|
|
|
+ docurl: row.ReportUrl,
|
|
|
+ reportId: row.Id
|
|
|
+ }
|
|
|
+ _this.$router.push({
|
|
|
+ path: '/lims/createreport/onlyofficesframe',
|
|
|
+ query: queryParams
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // searchCommand(command) {
|
|
|
+ // let _this = this
|
|
|
+ // if (command == 'entry') {
|
|
|
+ // _this.WaitData = _this.usertotal.EntryList
|
|
|
+ // } else if (command == 'check') {
|
|
|
+ // _this.WaitData = _this.usertotal.CheckList
|
|
|
+ // } else if (command == 'audit') {
|
|
|
+ // _this.WaitData = _this.usertotal.AuditList
|
|
|
+ // } else if (command == 'send') {
|
|
|
+ // _this.WaitData = _this.usertotal.SignList
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+
|
|
|
+ formatDateTime(date) {
|
|
|
+ var y = date.getFullYear();
|
|
|
+ var m = date.getMonth() + 1;
|
|
|
+ m = m < 10 ? ('0' + m) : m;
|
|
|
+ var d = date.getDate();
|
|
|
+ d = d < 10 ? ('0' + d) : d;
|
|
|
+ var h = date.getHours();
|
|
|
+ var minute = date.getMinutes();
|
|
|
+ minute = minute < 10 ? ('0' + minute) : minute;
|
|
|
+ return y + '-' + m + '-' + d + ' ' + h + ':' + minute;
|
|
|
+ },
|
|
|
+
|
|
|
+ //获取权限
|
|
|
+ getPermissions() {
|
|
|
+ let _this = this
|
|
|
+ // request
|
|
|
+ let params = {
|
|
|
+ percodes: `'${this.permissionscode.entry}','${this.permissionscode.check}','${this.permissionscode.audit}','${this.permissionscode.sign}'`
|
|
|
+ }
|
|
|
+ this.$axios.get('/permissions/isauths', {
|
|
|
+ params
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ if (res.data instanceof Array && res.data.length > 0) {
|
|
|
+ console.log(res.data)
|
|
|
+ res.data.forEach(element => {
|
|
|
+ _this.permissions[element.Code] = element.Isperm
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getShowPermissions() {
|
|
|
+ let _this = this
|
|
|
+ if (_this.authUser.Profile.DepartmentId == "100000054") {
|
|
|
+ _this.allshow = true
|
|
|
+ _this.Department = 100000150
|
|
|
+ } else {
|
|
|
+ this.$axios.get('/limsentrust/getshow', {})
|
|
|
+ .then(res => {
|
|
|
+ _this.whichshow = res.data.items
|
|
|
+ if (res.data.items == 'tjz') {
|
|
|
+ _this.Department = 100000150
|
|
|
+ } else if (res.data.items == 'yx') {
|
|
|
+ _this.Department = 100000151
|
|
|
+ } else if (res.data.items == 'jlny') {
|
|
|
+ _this.Department = 100000152
|
|
|
+ } else if (res.data.items == 'gcjd') {
|
|
|
+ _this.Department = 100000153
|
|
|
+ } else if (res.data.items == 'zj') {
|
|
|
+ _this.Department = 100000166
|
|
|
+ } else if (res.data.items == 'wzjy') {
|
|
|
+ _this.Department = 100000167
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ _this.initData()
|
|
|
+ _this.initDatas()
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="css">
|
|
|
+ .avatar-index {
|
|
|
+ width: 45px;
|
|
|
+ height: 45px;
|
|
|
+ margin-top: -15px;
|
|
|
+ margin-bottom: -15px;
|
|
|
+ }
|
|
|
+
|
|
|
+</style>
|