From 65a67490426dadcf62fc1bef3cb54dffa27d099d Mon Sep 17 00:00:00 2001 From: XiaoRuby <3114200645@qq.com> Date: 星期三, 23 八月 2023 15:05:23 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/experiment/passRateStatistics/index.vue | 419 ++++++++++------- src/views/experiment/reportAuditing/index.vue | 78 ++- src/api/experiment/reportAuditing.js | 11 src/views/experiment/inspectionApplication/index.vue | 10 src/worker/test.js | 5 src/api/url.js | 6 src/views/experiment/planAssignments/plan.vue | 299 ++++++++---- src/api/home.js | 37 + src/api/experiment/passRateStatistics.js | 11 .env.development | 2 src/api/util/requestUtil.js | 9 src/views/home/index.vue | 458 ++++++++++++++++--- src/main.js | 5 package.json | 1 src/layout/components/Sidebar/index.vue | 1 src/assets/404_images/bg.png | 0 src/views/experiment/checkTheReport/index.vue | 2 src/App.vue | 26 + 18 files changed, 979 insertions(+), 401 deletions(-) diff --git a/.env.development b/.env.development index 8dd5cb9..ab9be2d 100644 --- a/.env.development +++ b/.env.development @@ -2,4 +2,4 @@ ENV = 'development' # base api -VUE_APP_BASE_API = 'http://192.168.110.167:1234/' +VUE_APP_BASE_API = 'http://localhost:1234/' diff --git a/package.json b/package.json index c0ee919..00e6b41 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "babel-jest": "23.6.0", "babel-plugin-dynamic-import-node": "2.3.3", "chalk": "2.4.2", + "comlink-loader": "^2.0.0", "connect": "3.6.6", "eslint": "6.7.2", "eslint-plugin-vue": "6.2.2", diff --git a/src/App.vue b/src/App.vue index a25f956..230665e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -48,6 +48,16 @@ color: #fff; } + .el-message-box{ + border: 0; + border-radius: 15px; + } + + .el-message-box__header * { + font-size: 16px !important; + color: #fff !important; + } + .el-dialog__headerbtn .el-dialog__close{ color: #fff; top: -20px; @@ -67,4 +77,20 @@ box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41); padding: 0 14px; } + + .ins_state_success{ + background-color: #67c23a; + color: #fff; + display: initial; + padding: 6px 10px; + border-radius: 4px; + } + + .ins_state_error{ + background-color: #f56c6c; + color: #fff; + display: initial; + padding: 6px 10px; + border-radius: 4px; + } </style> diff --git a/src/api/experiment/passRateStatistics.js b/src/api/experiment/passRateStatistics.js index daa6a86..f8416d5 100644 --- a/src/api/experiment/passRateStatistics.js +++ b/src/api/experiment/passRateStatistics.js @@ -44,4 +44,15 @@ method: 'get', params }) + } + + /** + * getSampleOptions + */ + export function getSampleOptions(params) { + return request({ + url: '/qualificationRate/getSampleOptions', + method: 'get', + params + }) } \ No newline at end of file diff --git a/src/api/experiment/reportAuditing.js b/src/api/experiment/reportAuditing.js index f6a7bae..4784701 100644 --- a/src/api/experiment/reportAuditing.js +++ b/src/api/experiment/reportAuditing.js @@ -2,8 +2,17 @@ export function selectAllReportCheck(params) { return request({ - url: '/reportAuditing/selectAllReportAuditing', + // url: '/reportAuditing/selectAllReportAuditing', + url: '/report/selectAllReport', method: 'get', params }) } +// 瀹℃牳 +export function checkApi(params){ + return request({ + url: '/report/check', + method: 'post', + params + }) +} \ No newline at end of file diff --git a/src/api/home.js b/src/api/home.js new file mode 100644 index 0000000..7c33bcc --- /dev/null +++ b/src/api/home.js @@ -0,0 +1,37 @@ +import request from '@/utils/request' + +//鑾峰彇宸叉楠宼op3 +export function getVerifiedTop3(params) { + return request({ + url: '/home/checktop3', + method: 'get', + params + }) +} + +//鑾峰彇鏈楠宼op4 +export function getUncheckedTop4(params) { + return request({ + url: '/home/unchecktop4', + method: 'get', + params + }) +} + +//鑾峰彇鍘熸潗鏂欎笌鎴愬搧鍚堟牸鐜� +export function getMatAndFinshQualified(params) { + return request({ + url: '/home/qualified', + method: 'get', + params + }) +} + +//鑾峰彇妫�楠屼笌鏈楠岀殑鍗曞瓙涓庨」鐩殑鏁伴噺 +export function getCheckAndProjectNum(params) { + return request({ + url: '/home/checkProjectNum', + method: 'get', + params + }) +} \ No newline at end of file diff --git a/src/api/url.js b/src/api/url.js index 5f8f97d..8849e20 100644 --- a/src/api/url.js +++ b/src/api/url.js @@ -1,4 +1,10 @@ const url = { + "selectAllPlan": "/plan/selectAllPlan",//鏌ヨ鎵�鏈夋楠岃鍒� + "choosecheck": "/plan/choosecheck",//鍒嗛厤--閫夋嫨妫�楠屼汉 + "chooseinstum": "/plan/chooseinstum",//鍒嗛厤--閫夋嫨璁惧 + "reported": "/plan/reported",//涓婃姤 + "distribution": "/plan/distribution",//鍒嗛厤 + "check": "/plan/check",//妫�楠� } export default function(Vue) { diff --git a/src/api/util/requestUtil.js b/src/api/util/requestUtil.js index dee7d95..3055a2f 100644 --- a/src/api/util/requestUtil.js +++ b/src/api/util/requestUtil.js @@ -15,6 +15,15 @@ data }) } + +export function wpost(path, params) { + return request({ + url: path, + method: 'post', + params + }) +} + export function postFile(path, data) { return request({ url: path, diff --git a/src/assets/404_images/bg.png b/src/assets/404_images/bg.png new file mode 100644 index 0000000..412689d --- /dev/null +++ b/src/assets/404_images/bg.png Binary files differ diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue index 1187cbb..e093b2b 100644 --- a/src/layout/components/Sidebar/index.vue +++ b/src/layout/components/Sidebar/index.vue @@ -31,6 +31,7 @@ 'sidebar' ]), routes() { + console.log(this.$router.options.routes); return this.$router.options.routes }, activeMenu() { diff --git a/src/main.js b/src/main.js index e996df0..beb2705 100644 --- a/src/main.js +++ b/src/main.js @@ -14,6 +14,11 @@ import store from './store' import router from './router' +//寮曞叆echarts +import echarts from 'echarts' +Vue.prototype.$echarts = echarts + + import '@/icons' // icon import '@/permission' // permission control diff --git a/src/views/experiment/checkTheReport/index.vue b/src/views/experiment/checkTheReport/index.vue index a5057c4..2a92de3 100644 --- a/src/views/experiment/checkTheReport/index.vue +++ b/src/views/experiment/checkTheReport/index.vue @@ -100,7 +100,7 @@ <el-table-column prop="approver" label="瀹℃壒浜�" min-width="8%"> <template slot-scope="scope"> <span> - <el-tag type="info" icon="el-icon-user"> + <el-tag v-if="scope.row.approver!=null && scope.row.approver!=''" type="info" icon="el-icon-user"> <i class="el-icon-user">{{ scope.row.approver }}</i> </el-tag> </span> diff --git a/src/views/experiment/inspectionApplication/index.vue b/src/views/experiment/inspectionApplication/index.vue index 80346ca..a378d03 100644 --- a/src/views/experiment/inspectionApplication/index.vue +++ b/src/views/experiment/inspectionApplication/index.vue @@ -164,7 +164,7 @@ <el-pagination class="pagination" :current-page="currentPage" - :page-sizes="[1, 10, 20, 30]" + :page-sizes="[ 10, 20, 30,40]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total" @@ -721,10 +721,10 @@ this.total = this.inspectionTable.length }, reset(){ - this.countSize = 1 - this.searchData = { } - // console.log('2222'); - this.selectInspectsList() + this.countSize = 1; + this.pageSize = 8; + this.searchData = { }; + this.selectInspectsList(); }, //琚�変腑鐨勪俊鎭� 鍗曢�� handleSelectionChange(val) { diff --git a/src/views/experiment/passRateStatistics/index.vue b/src/views/experiment/passRateStatistics/index.vue index e59f783..fceb330 100644 --- a/src/views/experiment/passRateStatistics/index.vue +++ b/src/views/experiment/passRateStatistics/index.vue @@ -19,6 +19,14 @@ </el-option> </el-select> </el-form-item> + <el-form-item style="margin-left: 40px;" label="鏍峰搧:"> + <el-select v-model="searchData.code" filterable placeholder="璇烽�夋嫨"> + <el-option v-for="item in sampleOptions" :key="item.value" :label="item.label" :value="item.value"> + <span style="float: left">{{ item.label }}</span> + <span style="float: right; color: #8492a6; font-size: 13px">{{ item.value }}</span> + </el-option> + </el-select> + </el-form-item> <div class="rightBtn"> <el-form-item> <el-button type="primary" plain size="mini">娓呯┖</el-button> @@ -31,12 +39,18 @@ <div class="chart-content"> <div class="qualified-wrapper"> <div style="margin-left: 20px;padding:20px 0px;font-size:18px">妫�娴嬫牱鍝佸悎鏍肩巼缁熻</div> - <div class="qualified" ref="qualified"></div> + <div :hidden="testSample" class="qualified" ref="qualified"></div> + <div :hidden="!testSample" style="height: 100%;text-align: center; color: #999696df; margin-top: 100px;">鏆傛棤鏁版嵁 + </div> </div> <div class="unqualified"> <div class="firstBox-wrapper"> - <div style="margin-left: 20px;padding:20px 0px;font-size:18px">渚涘簲鍟嗕笉鍚堟牸娆℃暟缁熻</div> - <div class="firstBox" ref="unqualified_provider"></div> + <div style="margin-left: 20px;padding:20px 0px;font-size:18px">渚涘簲鍟嗗悎鏍肩巼缁熻</div> + <div> + <div :hidden="supplierData" class="firstBox" ref="unqualified_provider"></div> + <div :hidden="!supplierData" style="height: 100%;text-align: center; color: #999696df; margin-top: 100px;"> + 鏆傛棤鏁版嵁</div> + </div> </div> <div class="secondBox-wrapper"> <div class="secondBox_header"> @@ -46,12 +60,17 @@ }}</el-radio-button> </el-radio-group> </div> - <div class="secondBox" ref="unqualified_project"></div> + <div style="width: 100%;height: 100;"> + <div :hidden="projectData" class="secondBox" ref="unqualified_project"></div> + <div :hidden="!projectData" style="height: 100%;text-align: center; color: #999696df; margin-top: 100px;">鏆傛棤鏁版嵁 + </div> + </div> </div> </div> </div> <div class="bottom"> <el-button type="primary" size="mini">鏁版嵁瀵煎嚭</el-button> + <!-- <el-button type="primary" size="mini" @click="testWork">娴嬭瘯</el-button> --> </div> </div> </template> @@ -70,18 +89,26 @@ }) import * as echarts from 'echarts' -import { getSupplierList,getTestSampleStatistics,getSupplierNoPassStatistics,getNoPassProjectStatistics } from '@/api/experiment/passRateStatistics'; +import { getSupplierList, getTestSampleStatistics, getSupplierNoPassStatistics, getNoPassProjectStatistics, getSampleOptions } from '@/api/experiment/passRateStatistics'; import { dateFormat } from '../../../utils/dateUtil' +import MyWorker from 'comlink-loader!../../../worker/test'; export default { data() { return { supplier: [], + sampleOptions: [], searchData: { date: [], type: null, - supplier: null + supplier: null, + sample: null, + code: null }, options: [ + { + label: '鍏ㄩ儴', + value: 3 + }, { label: '鍘熸潗鏂�', value: 0 @@ -109,191 +136,228 @@ rules: { // date: [{ required: true, message: '璇疯緭鍏ヨ处鍙�', trigger: 'blur' }], // type: [{ required: true, message: '璇疯緭鍏ュ悕瀛�', trigger: 'blur' }] - } + }, + supplierNoPassStatistics: null, + supplierData: false, + projectStatistics: null, + projectData: false, + testSampleStatistics: null, + testSample: false, + m1: null, + m2: null, + m3: null } }, - mounted() { - this.getSupplierList() - this.getTestSampleStatistics() - this.getSupplierNoPassStatistics() - const chartDom_qualified = this.$refs.qualified; - const chartDom_unqualified_provider = this.$refs.unqualified_provider; - const chartDom_unqualified_project = this.$refs.unqualified_project; - - const myChart1 = echarts.init(chartDom_qualified); - const myChart2 = echarts.init(chartDom_unqualified_provider); - const myChart3 = echarts.init(chartDom_unqualified_project); - - /** - * 妫�娴嬪悎鏍肩巼缁熻 - */ - const option_qualified = { - tooltip: { - trigger: 'axis', - axisPointer: { // 鍧愭爣杞存寚绀哄櫒锛屽潗鏍囪酱瑙﹀彂鏈夋晥 - type: 'shadow' // 榛樿涓虹洿绾匡紝鍙�変负锛�'line' | 'shadow' - } - }, - legend: { - data: ['鏁版嵁1', '鏁版嵁2', '鏁版嵁3'] - }, - xAxis: [ - { - type: 'category', - data: ['绗竴鎵�', '绗簩鎵�', '绗笁鎵�', '绗洓鎵�'] - } - ], - yAxis: [ - { - type: 'value', - axisLabel: { - formatter: '{value}' - } - } - ], - series: [ - { - name: '鏁版嵁1', - type: 'bar', - data: [7245, 3475, 1237, 3456] - }, - { - name: '鏁版嵁2', - type: 'bar', - data: [9965, 9075, 4875, 8687] - }, - { - name: '鏁版嵁3', - type: 'line', - yAxisIndex: 0, - symbolSize: 3, // 鎶樼嚎鑺傜偣鐨勫ぇ灏� - symbol: 'circle', // 鎶樼嚎鑺傜偣鐨勫舰鐘� - smooth: false, // 骞虫粦鏇茬嚎 - data: [1465, 6437, 3257, 6537] - } - ] - }; - /** - * 渚涘簲鍟� - */ - const option_unqualified1 = { - tooltip: { - trigger: 'axis', - axisPointer: { // 鍧愭爣杞存寚绀哄櫒锛屽潗鏍囪酱瑙﹀彂鏈夋晥 - type: 'shadow' // 榛樿涓虹洿绾匡紝鍙�変负锛�'line' | 'shadow' - }, - formatter: function (params) { - let tooltip = params[0].name + '<br/>'; - params.forEach(function (item) { - tooltip += item.marker + ' ' + item.seriesName + ': ' + item.value.toFixed(2) + '%<br/>'; // 灏嗘暟鎹繚鐣欎袱浣嶅皬鏁板苟杞负鐧惧垎姣斿舰寮� - }); - return tooltip; - } - }, - legend: { - data: ['鍚堟牸鏁伴噺', '涓嶅悎鏍兼暟閲�'] - }, - xAxis: { - data: ['渚涘簲鍟�1', '渚涘簲鍟�2', '渚涘簲鍟�3', '渚涘簲鍟�4'] - }, - yAxis: [ - { - type: 'value', - axisLabel: { - formatter: '{value}%' - } - } - ], - series: [ - { - name: '鍚堟牸鏁伴噺', - data: [52, 46, 39, 66], - type: 'bar', - stack: 'x' - }, - { - name: '涓嶅悎鏍兼暟閲�', - data: [47, 53, 60, 33], - type: 'bar', - stack: 'x' - } - ] - }; - /** - * 涓嶅悎鏍奸」鐩� - */ - const option_unqualified2 = { - legend: { - orient: 'vertical', - x: 'left', - data: ['缁濈紭鍋忓績鐜�', '璇曢獙缁撴灉', '瀵间綋灞忚斀鏈�澶у��'] - }, - title: { - text: '', - left: 'center', - top: 'center' - }, - series: [ - { - type: 'pie', - data: [ - { - value: 40, - name: '缁濈紭鍋忓績鐜�' - }, - { - value: 20, - name: '璇曢獙缁撴灉' - }, - { - value: 40, - name: '瀵间綋灞忚斀鏈�澶у��' - } - ], - radius: ['40%', '70%'], - label: { - show: true, - formatter: '{b}: {c}' - }, - } - ] - } - - myChart1.setOption(option_qualified); - myChart2.setOption(option_unqualified1); - if (this.type === 0) { - myChart3.setOption(option_unqualified2); - } - if (this.type === 1) { - myChart3.setOption(option_unqualified2); - } + async mounted() { + await this.start() + this.tableStart() }, methods: { - search() { - this.getTestSampleStatistics() - }, - dateHandle(){ - let data=JSON.parse(JSON.stringify(this.searchData)) - if(this.searchData.date.length!=0&&this.searchData.date !=[]){ - data.beginDate=dateFormat(this.searchData.date[0]) - data.endDate=dateFormat(this.searchData.date[1]) + testWork(){ + const inst = new MyWorker(); + inst.test() + for (let index = 0; index < 100; index++) { + console.log("涓荤嚎绋�"+index); } - data.date=null + }, + async search() { + this.testSampleStatistics = null + this.supplierNoPassStatistics = null + this.projectStatistics = null + this.supplier = [] + this.sampleOptions = [] + await this.start() + this.tableStart() + }, + dateHandle() { + let data = JSON.parse(JSON.stringify(this.searchData)) + if (this.searchData.date.length != 0 && this.searchData.date != []) { + data.beginDate = dateFormat(this.searchData.date[0]) + data.endDate = dateFormat(this.searchData.date[1]) + } + if (data.supplier == '鍏ㄩ儴') { + data.supplier = null + } + if (data.type === 3) { + data.type = null + } + if (this.sampleOptions.length > 0 && this.sampleOptions != []) { + let labelSam = this.sampleOptions.filter(item => { + return item.value == data.code + })[0] + data.sample = labelSam.label + } + if (data.code == '鍏ㄩ儴') { + data.code = null + data.sample = null + } + data.date = null return data }, async getSupplierList() { let res = await getSupplierList() + this.supplier.push({ label: '鍏ㄩ儴', value: '鍏ㄩ儴' }) res.data.forEach(item => { this.supplier.push({ label: item.supplier, value: item.supplier }) }) }, - getTestSampleStatistics(){ - let param= this.dateHandle() - let res =getTestSampleStatistics(param) + async getTestSampleStatistics() { + let param = this.dateHandle() + let res = await getTestSampleStatistics(param) + this.testSample = !res.data.noData + this.testSampleStatistics = res.data }, - getSupplierNoPassStatistics(){ - let param= this.dateHandle() - getSupplierNoPassStatistics(param) + async getSupplierNoPassStatistics() { + let param = this.dateHandle() + let res = await getSupplierNoPassStatistics(param) + this.supplierData = !res.data.noData + this.supplierNoPassStatistics = res.data + }, + async getNoPassProjectStatistics() { + let param = this.dateHandle() + let res = await getNoPassProjectStatistics(param) + this.projectData = !res.data.noData + this.projectStatistics = res.data + }, + async start() { + await this.getTestSampleStatistics() + await this.getSupplierNoPassStatistics() + await this.getNoPassProjectStatistics() + await this.getSupplierList() + await this.getSampleOptions() + }, + async getSampleOptions() { + let res = await getSampleOptions() + this.sampleOptions.push({ + label: '鍏ㄩ儴', + value: '鍏ㄩ儴' + }) + res.data.forEach(item => { + let data = { + label: item.name, + value: item.code + } + this.sampleOptions.push(data) + }) + }, + tableStart() { + const chartDom_qualified = this.$refs.qualified; + const chartDom_unqualified_provider = this.$refs.unqualified_provider; + const chartDom_unqualified_project = this.$refs.unqualified_project; + + const myChart1 = echarts.init(chartDom_qualified); + const myChart2 = echarts.init(chartDom_unqualified_provider, null, { + height: 300 + }); + + const myChart3 = echarts.init(chartDom_unqualified_project, null, { + height: 268 + }); + window.addEventListener("resize",function(){ + myChart1.resize() + myChart2.resize() + myChart3.resize() + }) + this.m1 = myChart1 + this.m2 = myChart2 + this.m3 = myChart3 + /** + * 妫�娴嬪悎鏍肩巼缁熻 + */ + const option_qualified = { + tooltip: { + trigger: 'axis', + axisPointer: { // 鍧愭爣杞存寚绀哄櫒锛屽潗鏍囪酱瑙﹀彂鏈夋晥 + type: 'shadow' // 榛樿涓虹洿绾匡紝鍙�変负锛�'line' | 'shadow' + } + }, + legend: { + data: ['鍚堟牸', '涓嶅悎鏍�'] + }, + xAxis: [ + { + type: 'category', + data: this.testSampleStatistics.xAxis + } + ], + yAxis: [ + { + type: 'value', + axisLabel: { + formatter: '{value}' + } + } + ], + series: this.testSampleStatistics.series + }; + /** + * 渚涘簲鍟� + */ + const option_unqualified1 = { + tooltip: { + trigger: 'axis', + axisPointer: { // 鍧愭爣杞存寚绀哄櫒锛屽潗鏍囪酱瑙﹀彂鏈夋晥 + type: 'shadow' // 榛樿涓虹洿绾匡紝鍙�変负锛�'line' | 'shadow' + }, + formatter: function (params) { + let tooltip = params[0].name + '<br/>'; + params.forEach(function (item) { + tooltip += item.marker + ' ' + item.seriesName + ': ' + item.value.toFixed(2) + '%<br/>'; // 灏嗘暟鎹繚鐣欎袱浣嶅皬鏁板苟杞负鐧惧垎姣斿舰寮� + }); + return tooltip; + } + }, + legend: { + data: ['鍚堟牸鏁伴噺', '涓嶅悎鏍兼暟閲�'] + }, + xAxis: { + data: this.supplierNoPassStatistics.xAxis + }, + yAxis: [ + { + type: 'value', + axisLabel: { + formatter: '{value}%' + } + } + ], + series: this.supplierNoPassStatistics.series + }; + /** + * 涓嶅悎鏍奸」鐩� + */ + const option_unqualified2 = { + legend: { + orient: 'vertical', + x: 'left', + data: this.projectStatistics.legend + }, + title: { + text: '', + left: 'center', + top: 'center' + }, + series: [ + { + type: 'pie', + data: this.projectStatistics.series, + radius: ['40%', '70%'], + label: { + show: true, + formatter: '{b}: {c}%' + }, + } + ] + } + + myChart1.setOption(option_qualified); + myChart2.setOption(option_unqualified1); + if (this.type === 0) { + myChart3.setOption(option_unqualified2); + } + if (this.type === 1) { + myChart3.setOption(option_unqualified2); + } } } } @@ -303,6 +367,7 @@ .content-main { height: 100%; width: 100%; + overflow: auto; .top-bar { position: absolute; diff --git a/src/views/experiment/planAssignments/plan.vue b/src/views/experiment/planAssignments/plan.vue index ee84390..0907cbc 100644 --- a/src/views/experiment/planAssignments/plan.vue +++ b/src/views/experiment/planAssignments/plan.vue @@ -17,11 +17,11 @@ margin: 10px; padding: 15px; background-color: white; - height: calc(100vh - 15vh); + height: calc(100vh - 18vh); overflow-y: auto; } - .order_num{ + .order_num { border-radius: 1rem; width: 35px; height: 25px; @@ -56,41 +56,77 @@ <el-button size="small">閲嶇疆</el-button> </div> <div class="thing"> - <el-table :data="tableData" style="width: 100%;" row-key="id" default-expand-all + <el-table :data="tableData" style="width: 100%;" row-key="code" default-expand-all :tree-props="{children: 'children', hasChildren: 'hasChildren'}" :key="upIndex"> <el-table-column type="index" width="50" label="搴忓彿"> </el-table-column> - <el-table-column prop="date" label="鐢宠鍗曞彿"> + <el-table-column prop="code" label="鐢宠鍗曞彿" width="250px"> <template slot-scope="scope"> <div style="display: flex;"> - <div v-if="scope.row.code=='01'" style="color: #3caaff;background-color: #eff5ff;" class="order_num">01</div> - <div v-else-if="scope.row.code=='02'" style="color: #57c981;background-color: #f1fbf4;" class="order_num">02</div> - <div v-else-if="scope.row.code=='03'" style="color: #dfa8fb;background-color: #faf2ff;" class="order_num">03</div> - <div>{{scope.row.date}}</div> + <div v-if="scope.row.orderNum=='01'" style="color: #3caaff;background-color: #eff5ff;" class="order_num"> + 01 + </div> + <div v-else-if="scope.row.orderNum=='02'" style="color: #57c981;background-color: #f1fbf4;" + class="order_num"> + 02</div> + <div v-else-if="scope.row.orderNum=='03'" style="color: #dfa8fb;background-color: #faf2ff;" + class="order_num"> + 03</div> + <div>{{scope.row.code}}</div> </div> </template> </el-table-column> - <el-table-column prop="name" label="妫�楠岀粨鏋�"> + <el-table-column prop="name" label="鍚嶇О" width="200px"> </el-table-column> - <el-table-column prop="address" label="鍦板潃"> + <el-table-column prop="unit" label="鍗曚綅"> </el-table-column> - <el-table-column label="鎿嶄綔" width="80"> + <el-table-column prop="required" label="瑕佹眰鍊�"> + </el-table-column> + <el-table-column prop="internal" label="鍐呮帶鍊�"> + </el-table-column> + <el-table-column prop="testValue" label="妫�楠屽��"> + </el-table-column> + <el-table-column prop="checker" label="鎵ц浜�"> + </el-table-column> + <el-table-column prop="instrumentname" label="妫�楠岃澶�"> + </el-table-column> + <el-table-column prop="testState" label="妫�楠岀姸鎬�" width="100px"> <template slot-scope="scope"> - <el-button size="mini" type="primary" v-if="isIfReport(scope.row)">涓婃姤</el-button> - <el-button size="mini" type="warning" @click="openUpDia(scope.row)" - v-else-if="scope.row.code=='03'&&scope.row.insId==undefined&&scope.row.address==null">鍒嗛厤</el-button> - <el-button size="mini" type="success" @click="openUpInsDia(scope.row)" - v-else-if="scope.row.code=='03'&&scope.row.insId==undefined&&scope.row.name==null">妫�楠�</el-button> + <el-tag type="success" v-if="scope.row.testState==1">鍚堟牸</el-tag> + <el-tag type="danger" v-else-if="scope.row.testState==0">涓嶅悎鏍�</el-tag> + </template> + </el-table-column> + <el-table-column prop="startTime" label="妫�楠屽紑濮�" width="100px"> + </el-table-column> + <el-table-column prop="endTime" label="妫�楠岀粨鏉�" width="100px"> + </el-table-column> + <el-table-column label="鎿嶄綔" width="150"> + <template slot-scope="scope"> + <el-button size="mini" type="primary" v-if="isIfReport(scope.row)" + @click="addReported(scope.row.id)">涓婃姤</el-button> + <el-button size="mini" type="text" @click="openUpDia(scope.row)" + v-if="scope.row.orderNum=='02'">鍒嗛厤</el-button> + <el-button size="mini" type="text" @click="openUpInsDia(scope.row)" + v-if="scope.row.orderNum=='02'">妫�楠�</el-button> </template> </el-table-column> </el-table> </div> <el-dialog title="鍒嗛厤璁惧鍜屼汉鍛�" :visible.sync="upDia" width="500px" top="30vh"> <div class="body"> - <el-row style="line-height: 46px;"> + <el-row style="line-height: 50px;"> <el-col :span="4" style="font-size: 14px;text-align: right;">浜哄憳:</el-col> <el-col :span="16" :offset="1"> - <el-input v-model="upData.address" size="small" clearable></el-input> + <el-select v-model="upData.checker" size="medium" clearable style="width: 100%;"> + <el-option v-for="(a, ai) in users" :key="ai" :label="a.name" :value="a.id"></el-option> + </el-select> + </el-col> + </el-row> + <el-row style="line-height: 50px;"> + <el-col :span="4" style="font-size: 14px;text-align: right;">璁惧:</el-col> + <el-col :span="16" :offset="1"> + <el-cascader v-model="upData.device" :options="devices" size="medium" style="width: 100%;" clearable + :props="{label: 'name',value: 'id',emitPath: false}" :show-all-levels="false"></el-cascader> </el-col> </el-row> </div> @@ -102,29 +138,37 @@ <el-dialog title="妫�楠�" :visible.sync="upInsDia" width="500px"> <div class="body" style="max-height: 50vh;overflow-y: auto;"> <el-row style="line-height: 46px;"> - <el-col :span="4" style="font-size: 14px;text-align: right;">鏍峰搧缂栫爜锛�</el-col> - <el-col :span="8">{{upData.date}}</el-col> - <el-col :span="4" style="font-size: 14px;text-align: right;">鏍峰搧鍚嶇О锛�</el-col> - <el-col :span="8">{{upData.date}}</el-col> + <el-col :span="5" style="font-size: 14px;text-align: right;">鐢宠鍗曠紪鐮侊細</el-col> + <el-col :span="7">{{upData.insId}}</el-col> + <el-col :span="5" style="font-size: 14px;text-align: right;">鏍峰搧鍚嶇О锛�</el-col> + <el-col :span="7">{{upData.productName}}</el-col> </el-row> <el-row style="line-height: 46px;"> - <el-col :span="4" style="font-size: 14px;text-align: right;">妫�楠岄」鐩細</el-col> - <el-col :span="8">{{upData.date}}</el-col> - <el-col :span="4" style="font-size: 14px;text-align: right;">鍗曚綅锛�</el-col> - <el-col :span="8">{{upData.date}}</el-col> + <el-col :span="5" style="font-size: 14px;text-align: right;">妫�楠岄」鐩細</el-col> + <el-col :span="7">{{upData.name}}</el-col> + <el-col :span="5" style="font-size: 14px;text-align: right;">鍗曚綅锛�</el-col> + <el-col :span="7">{{upData.unit}}</el-col> </el-row> <el-row style="line-height: 46px;"> - <el-col :span="4" style="font-size: 14px;text-align: right;">鏍囧噯鍊硷細</el-col> - <el-col :span="8">{{upData.date}}</el-col> - <el-col :span="4" style="font-size: 14px;text-align: right;">鍐呮帶鍊硷細</el-col> - <el-col :span="8">{{upData.date}}</el-col> + <el-col :span="5" style="font-size: 14px;text-align: right;">鏍囧噯鍊硷細</el-col> + <el-col :span="7">{{upData.required}}</el-col> + <el-col :span="5" style="font-size: 14px;text-align: right;">鍐呮帶鍊硷細</el-col> + <el-col :span="7">{{upData.internal}}</el-col> + </el-row> + <el-row style="line-height: 46px;"> + <el-col :span="5" style="font-size: 14px;text-align: right;">妫�楠岀姸鎬侊細</el-col> + <el-col :span="7"> + <el-tag type="success" v-if="upData.testState==1">鍚堟牸</el-tag> + <el-tag type="danger" v-else-if="upData.testState==0">涓嶅悎鏍�</el-tag> + <el-tag type="info" v-else>鏃犵粨鏋�</el-tag> + </el-col> </el-row> <el-row style="line-height: 46px;"> <el-col style="text-align: right;"><el-button size="mini" @click="addRes">娣诲姞妫�楠屽��</el-button></el-col> </el-row> <el-row> <el-col> - <el-table :data="upData.res" border style="width: 99.9%;" :key="upIndex2"> + <el-table :data="upData.testValue" border style="width: 99.9%;" :key="upIndex2"> <el-table-column type="index" width="100" label="搴忓彿"> </el-table-column> <el-table-column label="妫�楠屽��"> @@ -137,7 +181,7 @@ <el-table-column label="鎿嶄綔" width="60"> <template slot-scope="scope"> <el-button size="mini" type="text" - @click.native.prevent="deleteRow(scope.$index, upData.res)">鍒犻櫎</el-button> + @click.native.prevent="deleteRow(scope.$index, upData.testValue)">鍒犻櫎</el-button> </template> </el-table-column> </el-table> @@ -145,7 +189,7 @@ </el-row> </div> <span slot="footer" class="dialog-footer"> - <el-button type="primary" @click="submitUpData">鎻� 浜�</el-button> + <el-button type="primary" @click="submitUpData2">鎻� 浜�</el-button> <el-button @click="upInsDia = false">鍙� 娑�</el-button> </span> </el-dialog> @@ -153,6 +197,12 @@ </template> <script> + import { + get, + post, + wpost, + postFile + } from "@/api/util/requestUtil.js" export default { data() { return { @@ -161,125 +211,146 @@ date: [], userName: null, }, - tableData: [{ - id: 1, - insId: 123, - date: '2016-05-02', - name: null, - address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1518 寮�', - children: [{ - id: 33, - date: '2016-05-01', - name: null, - res: '[{"number": 1},{"number": 2}]', - address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1519 寮�' - }, { - id: 34, - date: '2016-05-01', - name: null, - res: '[{"number": 1,"res": "涓嶅悎鏍�"},{"number": 3,"res": "涓嶅悎鏍�"}]', - address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1519 寮�', - children: [{ - id: 35, - date: 'hhh', - name: null, - res: '[{"number": 1},{"number": 2}]', - address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1519 寮�' - }] - }] - }, { - id: 2, - insId: 123, - date: '2016-05-04', - name: null, - address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1517 寮�', - children: [] - }, { - id: 3, - insId: 123, - date: '2016-05-01', - children: [{ - id: 31, - date: '2016-05-01', - name: null, - res: '[{"number": 1},{"number": 2}]', - address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1519 寮�' - }, { - id: 32, - date: '2016-05-01', - name: null, - res: '[]', - address: null - }] - }], + tableData: [], upDia: false, upData: {}, upIndex: 0, upInsDia: false, - upIndex2: 0 + upIndex2: 0, + users: [], + devices: [] } }, mounted() { this.selectDataList() + this.getUsers() + this.getDevices() }, methods: { selectDataList() { - this.tableData.forEach(a => { - a.code = '01' - if (a.children != undefined) { - a.children.forEach(b => { - b.code = '02' - if (b.children != undefined) { - b.children.forEach(c => { - c.code = '03' - c.res = JSON.parse(c.res) - }) - } - }) - } + get(this.$url.selectAllPlan).then(res => { + this.tableData = JSON.parse(JSON.stringify(res.data).replaceAll('pid', 'code').replaceAll('samplename', + 'name').replaceAll('inspectionStatus', 'testState')) + this.tableData.forEach(a => { + a.orderNum = '01' + if (a.children != undefined) { + a.children.forEach(b => { + b.orderNum = '02' + if (b.testValue == undefined) { + b.testValue = [] + } + }) + } + }) + this.upIndex++ }) - this.upIndex++ }, isIfReport(row) { var count = 0 if (row.children == undefined) return false row.children.forEach(a => { - if (a.name != null && a.name != undefined) count++ + if (a.testState != null && a.testState != undefined) count++ }) - return row.insId != undefined && count == row.children.length + return row.testState == undefined && row.orderNum == '01' && count == row + .children.length }, openUpDia(row) { this.upDia = true this.upData = { - id: row.id, - address: row.address + id: row.code, + checker: null, + device: null } }, submitUpData() { - this.tableData.forEach(a => { - a.children.forEach(b => { - if (b.id == this.upData.id) { - b.address = this.upData.address - } - }) + if (this.upData.checker == null || this.upData.checker == '') { + this.$message.error('浜哄憳鏈垎閰�') + return + } else if (this.upData.device == null || this.upData.device == '') { + this.$message.error('璁惧鏈垎閰�') + return + } + wpost(this.$url.distribution, { + id: this.upData.id, + userId: this.upData.checker, + instrumentId: this.upData.device + }).then(res => { + this.$message.success('鍒嗛厤鎴愬姛') + this.upDia = false + this.selectDataList() }) - this.$message.success('淇敼鎴愬姛') - this.upIndex++ - this.upDia = false }, openUpInsDia(row) { this.upInsDia = true this.upData = this.HaveJson(row) + var str = [] + JSON.parse('[' + this.upData.testValue + ']').forEach(a => { + str.push({ + number: a + }) + }) + this.upData.testValue = this.HaveJson(str) + this.tableData.forEach(a => { + a.children.forEach(b => { + if (b.code == this.upData.code) { + this.upData.insId = a.code + this.upData.productName = a.name + } + }) + }) }, deleteRow(index, rows) { rows.splice(index, 1); }, addRes() { - this.upData.res.push({ + this.upData.testValue.push({ "number": null }) this.upIndex2++ + }, + getUsers() { + get(this.$url.choosecheck).then(res => { + this.users = res.data + }) + }, + getDevices() { + get(this.$url.chooseinstum).then(res => { + this.devices = res.data + }) + }, + addReported(id) { + wpost(this.$url.reported, { + id: id + }).then(res => { + this.$message.success('涓婃姤鎴愬姛') + this.selectDataList() + }).catch(e => { + this.$message.error('涓婃姤澶辫触') + }) + }, + submitUpData2() { + var data = [] + this.upData.testValue.forEach(a => { + if(a.number!=''&&a.number!=null){ + data.push(a.number) + } + }) + wpost(this.$url.check, { + id: this.upData.code, + value: data.toString() + }).then(res => { + this.upInsDia = false + this.selectDataList() + this.$confirm(`<p style="line-height: 80px">鎮ㄧ殑椤圭洰(${this.upData.name})妫�楠岀粨鏋滀负锛�<span class="${res.data==1?'ins_state_success':'ins_state_error'}">${res.data==1?'鍚堟牸':'涓嶅悎鏍�'}</span></p>`, '鎻愪氦鎴愬姛', { + confirmButtonText: '纭畾', + cancelButtonText: '鍏抽棴', + dangerouslyUseHTMLString:true, + type: `${res.data==1?'success':'error'}` + }).then(() => { + }).catch(() => { + }) + }) } } } -</script> +</script> \ No newline at end of file diff --git a/src/views/experiment/reportAuditing/index.vue b/src/views/experiment/reportAuditing/index.vue index 0f4b6a3..6c699b2 100644 --- a/src/views/experiment/reportAuditing/index.vue +++ b/src/views/experiment/reportAuditing/index.vue @@ -59,7 +59,11 @@ :data="reportTable" style="width: 100%" > - <el-table-column type="selection" label="" min-width="5%" /> + <el-table-column + type="index" + width="50"> + </el-table-column> + <!-- <el-table-column label="" min-width="5%" /> --> <el-table-column prop="materialCode" label="鏍峰搧缂栧彿" min-width="10%"> <template slot-scope="scope"> <span style="color: #409eff"> @@ -79,7 +83,7 @@ label="鏍峰搧鍚嶇О" min-width="10%" /> - <el-table-column prop="status" label="瀹℃壒鐘舵��" min-width="8%"> + <el-table-column prop="status" label="瀹℃壒鐘舵��" min-width="8%" v-model="Auditconclusion"> <template slot-scope="scope"> <span> <el-tag type="warning">{{ @@ -99,31 +103,23 @@ @click="handleClick(scope.row)" >鏌ョ湅璇︾粏 </el-button> - <el-button type="text" size="small" @click="checkskip = true">瀹℃牳</el-button> + <el-button type="text" size="small" @click="shenHE(scope)">瀹℃牳</el-button> <el-dialog title="鍘熷璁板綍瀹℃牳" - :visible.sync="checkskip" + :visible.sync="checkskipvisible" width="30%" - :before-close="handleClose"> + + > <el-form :model="form"> - <el-form-item label="璇烽�夋嫨瀹℃牳缁撴灉" :label-width="formLabelWidth"> + <el-form-item label="璇烽�夋嫨瀹℃牳缁撴灉:" :label-width="formLabelWidth"> </el-form-item> - <el-row :gutter="20"> - <el-col :span="6" :offset="5"> - <!-- <el-button type="primary" style="background-color: rgb(208, 201, 192);">閫�鍥�</el-button> --> - <el-button style="background-color: rgb(206, 211, 216);">閫�鍥�</el-button> - </el-col> - <el-col :span="6" :offset="3"> - <!-- <el-button type="primary" style="background-color: rgb(181, 237, 125);">閫氳繃</el-button> --> - <el-button style="background-color: rgb(192, 236, 148);">閫氳繃</el-button> - </el-col> - </el-row> - </el-form> + <div slot="footer" class="dialog-footer"> - <el-button @click="checkskip = false">鍙� 娑�</el-button> - <el-button type="primary" @click="checkskip= false">纭� 瀹�</el-button> + <el-button @click="checkskipvisible = false">鍙� 娑�</el-button> + <el-button style="background-color: rgb(206, 211, 216);" @click="nocheckskip(scope.row)" >涓嶉�氳繃</el-button> + <el-button type="primary" @click="checkskip(scope.row)">閫氳繃</el-button> </div> </el-dialog> @@ -148,27 +144,36 @@ </template> <script> -import { selectAllReportCheck } from "@/api/experiment/reportAuditing"; +import { selectAllReportCheck,checkApi } from "@/api/experiment/reportAuditing"; export default { data() { return { - input: "", + input: '', checkStatus: undefined, reportTable: [], page: 1, total: 0, pageSize: 10, - checked: true, - checkskip: false, + checkskipvisible: false, form:{}, - handleClose:'', - formLabelWidth: '120px' + // handleClose:{}, + formLabelWidth: '120px', + checked:{}, + usertt:[], + Auditconclusion:{}, + tableRow: {}, + + }; }, created() { this.getData(); }, methods: { + shenHE(s){ + this.tableRow=s + this.checkskipvisible=true + }, // 鐘舵�佹寜閽� handleRadioChange() { this.getData(); @@ -193,10 +198,27 @@ this.checkStatus = undefined; this.getData(); }, - //瀹℃牳璺宠浆 - // checkskip() { + //閫氳繃 + async checkskip(row) { + console.log(this.tableRow); + this.reportTable[this.tableRow.$index].status=2 + this.transmitData(this.tableRow.row.id) + this.checkskipvisible= false - // }, + }, + //涓嶉�氳繃 + async nocheckskip(row) { + console.log(this.tableRow); + this.reportTable[this.tableRow.$index].status=0 + this.transmitData(this.tableRow.row.id) + this.checkskipvisible= false + + }, + //瀹℃牳 + async transmitData(id) { + let param={"id":id,"result":1} + let data = await checkApi(param) + }, // 鏌ヨ鍒楄〃 async getData() { const params = { diff --git a/src/views/home/index.vue b/src/views/home/index.vue index f876061..1730a72 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -1,96 +1,406 @@ <template> <div class="home-main"> - <div class="home-header-welcome"> - <div class="welcome-left"> - <div class="left-avatar" /> - <div class="left-tips"> - <div>Hi jack锛屾杩庝娇鐢╖T-LIMS</div> - <div>浠婂ぉ鏄�2023骞�07鏈�07鏃� 鏄熸湡浜�</div> - </div> + <div class="content-main"> + <div class="echart1"> + <el-row :gutter="10"> + <el-col :span="16"> + <el-card class="box-card" :body-style="{ padding: '0px 10px',height:'120px' }"> + <p style="font-size: 10px;margin-left: 10px;">妫�楠屾�绘暟缁熻</p> + <el-row :gutter="10"> + <el-col :span="6" > + <img :src="imgSrc" /> + <div class="card-text"> + <h6>妫�楠屽崟宸叉楠屾�绘暟</h6> + <p>{{insNum}}</p> + </div> + </el-col> + <el-col :span="6"> + <img :src="imgSrc"/> + <div class="card-text"> + <h6>妫�楠屽崟鏈楠屾�绘暟</h6> + <p>{{insUnNum}}</p> + </div> + </el-col> + <el-col :span="6"> + <img :src="imgSrc"/> + <div class="card-text"> + <h6>妫�楠岄」鐩凡妫�楠屾�绘暟</h6> + <p>{{insproNum}}</p> + </div> + </el-col> + <el-col :span="6"> + <img :src="imgSrc"/> + <div class="card-text"> + <h6>妫�楠岄」鐩湭妫�楠屾�绘暟</h6> + <p>{{insproUnNum}}</p> + </div> + </el-col> + </el-row> + </el-card> + </el-col> + <el-col :span="8"> + <el-card class="box-card" :body-style="{ padding: '0px',height:'120px' }"> + <p style="font-size: 10px;margin-left: 10px;color: #2fcf10;">宸叉楠�</p> + <el-table + :data="verifiedData" + :default-sort = "{prop: 'date', order: 'descending'}" + :cell-style="{margin:'0',padding:'2px 0px'}" + :header-cell-style="{margin:'0',padding:'0',backgroundColor:'#f0f7ff',color:'#0050a7'}"> + <el-table-column prop="no" label="鎺掑悕" sortable width="110"></el-table-column> + <el-table-column prop="result" label="妫�楠岀粨璁�" width="110"></el-table-column> + <el-table-column prop="num" label="妫�楠屾暟閲�" sortable width="110"></el-table-column> + <el-table-column prop="chact" label="妫�楠屽崰姣�" sortable width="110"></el-table-column> + </el-table> + </el-card> + </el-col> + </el-row> </div> - <div class="welcome-right"> - <div class="right-centent"> - <div>鍗冲皢瓒呮湡寰呭姙</div> - <div>鏆傛棤</div> - </div> - <div /> - <div class="right-centent"> - <div>宸茶秴鏈熷緟鍔�</div> - <div>21</div> - </div> + <div class="echart2"> + <el-row :gutter="10"> + <el-col :span="6"> + <el-card :body-style="{ padding: '0px',height:'180px' }"> + <p>鍘熸潗鏂欏悎鏍肩巼</p> + <div id="materialPieChart" style="width:100%;height:180px"></div> + </el-card> + </el-col> + <el-col :span="6"> + <el-card :body-style="{ padding: '0px',height:'180px' }"> + <p>鎴愬搧鍚堟牸鐜�</p> + <div id="finishedPieChart" style="width:100%;height:180px"></div> + </el-card> + </el-col> + <el-col :span="12"> + <el-card :body-style="{ padding: '0px',height:'180px' }"> + <p style="z-index: 10;position: absolute;font-size: 10px;margin-left: 10px;color: #ff0000;">鏈楠�</p> + <el-table + :data="uncheckedData" + :cell-style="{margin:'0px',padding:'3px 0px'}" + :header-cell-style="{margin:'0px',padding:'3px 0px',backgroundColor:'#f0f7ff',color:'#0050a7'}"> + <el-table-column prop="no" label="搴忓彿" width="100"></el-table-column> + <el-table-column prop="name" label="寰呮椤圭洰" width="120"></el-table-column> + <el-table-column prop="instrumentname" label="璁惧" width="120"></el-table-column> + <el-table-column prop="startTime" label="妫�楠屾椂闂�" width="120"> + </el-table-column><el-table-column prop="checkname" label="妫�楠屼汉" width="120"> + </el-table-column><el-table-column prop="endTime" label="棰勮缁撴潫鏃堕棿" width="120"></el-table-column> + </el-table> + </el-card> + </el-col> + </el-row> + </div> + <div class="echart3"> + <el-card :body-style="{ padding: '0px',height:'300px' }"> + <el-radio-group class="button-group" :input="getDataByType(radioType)" v-model="radioType" size="mini"> + <el-radio-button label="鏈懆"></el-radio-button> + <el-radio-button label="鏈湀"></el-radio-button> + <el-radio-button label="鏈勾"></el-radio-button> + </el-radio-group> + <div id="barLineChart" style="width:100%;height:300px;"></div> + </el-card> </div> </div> - <div class="content-main" /> </div> </template> <script> +import * as echarts from 'echarts'; +import { getVerifiedTop3,getUncheckedTop4,getMatAndFinshQualified,getCheckAndProjectNum +} from '@/api/home' export default { + name: "home", + data() { + return { + insNum: 0, + insUnNum: 0, + insproNum: 0, + insproUnNum: 1110, + radioType: "鏈勾", + imgSrc: require("@/assets/404_images/bg.png"), + verifiedData: new Array(), + uncheckedData: new Array(), + } + }, + mounted(){ + this.getcheckProjectNum(); + this.getVerifiedData(); + this.getUncheckedData(); + this.getPieChart(); + }, + methods: { + async getcheckProjectNum(){ + const {data} = await getCheckAndProjectNum(); + this.insNum = data.insNum; + this.insUnNum = data.insUnNum; + this.insproNum = data.insproNum; + this.insproUnNum = data.insproUnNum; + }, + async getVerifiedData(){ + const { data } = await getVerifiedTop3(); + for(let i=0;i<data.length;i++){ + let val = ""; + if(data[i].result == 0){ + val = "涓嶅悎鏍�"; + }else if(data[i].result == 1){ + val = "鍚堟牸"; + }else{ + val = "鏈楠�"; + } + this.verifiedData.push ({ + no: i+1, + result: val, + num: data[i].num, + chact: data[i].chact + '%' + }) + } + }, + async getUncheckedData(){ + const {data} = await getUncheckedTop4(); + for(let i=0;i<data.length;i++){ + this.uncheckedData.push ({ + no: i+1, + name: data[i].name, + instrumentname: data[i].instrumentname, + startTime: data[i].startTime, + checkname: data[i].checkname, + endTime: data[i].endTime + }) + } + }, + initPieChart(elementId,data){ + var chartDom = document.getElementById(elementId); + var myChart = echarts.init(chartDom); + window.addEventListener('resize', function() { + myChart.resize(); + }); + var option; + option = { + tooltip: { + trigger: 'item' + }, + legend: { + orient: 'vertical', + right: 'right', + top: 'center', + left: 20 + }, + series: [ + { + type: 'pie', + radius: ['40%', '70%'], + tooltip: { + valueFormatter: function(value){ + return value + '%'; + } + }, + avoidLabelOverlap: false, + label: { + show: false, + position: 'center', + }, + labelLine: { + show: false + }, + data: data + } + ] + }; + option && myChart.setOption(option); + }, + async getPieChart(){ + const {data} = await getMatAndFinshQualified(); + let material = [ + { value: data.material, name: '鍚堟牸',itemStyle:{color: '#91cc75'} }, + { value: data.unmaterial, name: '涓嶅悎鏍�',itemStyle:{color: '#fac858'} }, + { value: data.notmaterial, name: '寰呮楠�' }, + ] + let finished = [ + { value: data.finished, name: '鍚堟牸',itemStyle:{color: '#91cc75'} }, + { value: data.unfinished, name: '涓嶅悎鏍�',itemStyle:{color: '#fac858'} }, + { value: data.notfinished, name: '寰呮楠�' }, + ] + //娓叉煋楗肩姸鍥� + this.initPieChart("materialPieChart",material); + this.initPieChart("finishedPieChart",finished); + }, + async getDataByType(label){ + const xAxis = ['涓�鏈�', '浜屾湀', '涓夋湀', '鍥涙湀', '浜旀湀', '鍏湀', '涓冩湀','鍏湀','涔濇湀','鍗佹湀','鍗佷竴鏈�','鍗佷簩鏈�'] + const bar1Data = [2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3]; + const bar2Data = [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3]; + const line1Data = [2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2]; + const line2Data = [3.0, 4.2, 6.3, 5.5, 8.3, 13.2, 20.3, 13.4, 23.0, 21.5, 2.0, 33.2]; + switch(label){ + case "鏈勾": + this.initBarAndLineChart(xAxis,bar1Data,bar2Data,line1Data,line2Data); + break; + case "鏈湀": + let arr = new Array(); + for(let i=1;i<=31;i++){ + arr.push(i); + } + this.initBarAndLineChart(arr,bar1Data,bar2Data,line1Data,line2Data); + break; + case "鏈懆": + let arr2 = new Array("鍛ㄤ竴","鍛ㄤ簩","鍛ㄤ笁","鍛ㄥ洓","鍛ㄤ簲","鍛ㄥ叚","鍛ㄦ棩"); + this.initBarAndLineChart(arr2,bar1Data,bar2Data,line1Data,line2Data); + break + } + }, + initBarAndLineChart(xAxis,bar1Data,bar2Data,line1Data,line2Data){ + var chartDom = document.getElementById('barLineChart'); + var myChart = echarts.init(chartDom); + window.addEventListener('resize', function() { + myChart.resize(); + }); + var option; + option = { + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'cross', + crossStyle: { + color: '#999' + } + } + }, + legend: { + data: ['鍘熸潗鏂欐楠�', '鎴愬搧妫�楠�', '鍘熸潗鏂欏悎鏍肩巼','鎴愬搧鍚堟牸鐜�'] + }, + xAxis: [ + { + type: 'category', + data: xAxis, + axisPointer: { + type: 'shadow' + } + } + ], + yAxis: [ + { + type: 'value', + name: '妫�楠屾暟閲�', + min: 0, + max: 1000, + interval: 100, + axisLabel: { + formatter: '{value}' + } + }, + { + type: 'value', + name: '鍚堟牸鐜�', + min: 0, + max: 100, + interval: 10, + axisLabel: { + formatter: '{value} %' + } + } + ], + series: [ + { + name: '鍘熸潗鏂欐楠�', + type: 'bar', + tooltip: { + valueFormatter: function (value) { + return value; + } + }, + data: bar1Data + }, + { + name: '鎴愬搧妫�楠�', + type: 'bar', + tooltip: { + valueFormatter: function (value) { + return value ; + } + }, + data: bar2Data + }, + { + name: '鍘熸潗鏂欏悎鏍肩巼', + smooth: true, + type: 'line', + yAxisIndex: 1, + tooltip: { + valueFormatter: function (value) { + return value + ' %'; + } + }, + data: line1Data + }, + { + name: '鎴愬搧鍚堟牸鐜�', + smooth: true, + type: 'line', + yAxisIndex: 1, + tooltip: { + valueFormatter: function (value) { + return value + ' %'; + } + }, + data: line2Data + } + ] + }; + option && myChart.setOption(option); + } + } } </script> <style lang="scss" scoped> .home-main{ - .home-header-welcome{ - width: 100%; - background: #fff; - height: 84px; - display: flex; - border-bottom: 1px solid #f0f2f5; - padding: 8px 24px 12px 24px; - justify-content: space-between; - .welcome-left{ - display: flex; - align-items: center; - height: 100%; - .left-avatar{ - width: 56px; - height: 56px; - margin-right: 24px; - background: #0077DB; - border-radius: 50%; + .content-main{ + .echart1{ + .el-table{ + font-weight: bold; + width: 100%; + height:100; + padding:0px; + margin-left:10px; + } + .box-card img{ + width:100%; + height:100px; + border-radius: 10px; + } + .box-card .card-text{ + position: absolute; + top:0px; + h6{ + margin:10px 15px; + } + p{ + width:100%; + text-align: right; + font-size: 25px; + } + } + } + .echart2 { + .el-table{ + font-weight: bold; + width: 100%; + height:100; + padding:0px; + margin-left:10px; + padding-top:40px; } - .left-tips{ - height: 80%; - display: flex; - flex-direction: column; - justify-content: space-between; - >div:nth-child(1){ - font-size: 20px; - color: #303133; - } - >div:nth-child(2){ - font-size: 14px; - color: #606266; - } + .el-col{ + margin: 10px 0; + } + p{ + position: absolute; + font-size: 10px; + margin-left: 10px; + color:black; } } - .welcome-right{ - width: 250px; - display: flex; - justify-content: space-between; - align-items: center; - .right-centent{ - height: 80%; - display: flex; - flex-direction: column; - justify-content: space-between; - align-items: flex-end; - >div:nth-child(1){ - color: #909399; - font-size: 14px; - } - >div:nth-child(2){ - font-size: 24px; - color: #c0c4cc; - } - } - >div:nth-child(2){ - width: 2px; - height: 70%; - background: #f0f2f5; - } + .echart3 .button-group{ + margin-top: 10px; + margin-left: 88%; + z-index: 10; } } } diff --git a/src/worker/test.js b/src/worker/test.js new file mode 100644 index 0000000..9fda9e4 --- /dev/null +++ b/src/worker/test.js @@ -0,0 +1,5 @@ +export function test(){ + for (let index = 0; index < 100; index++) { + console.log("瀛愮嚎绋�"+index); + } +} \ No newline at end of file -- Gitblit v1.9.3