From 4c4c6475fde41dbee74c6a071a187a47a1c4a243 Mon Sep 17 00:00:00 2001
From: XiaoRuby <3114200645@qq.com>
Date: 星期二, 22 八月 2023 09:24:08 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/views/experiment/passRateStatistics/index.vue | 240 +++++++----
src/views/laboratory/measure/index.vue | 183 ++++++++-
src/api/url.js | 7
src/views/experiment/planAssignments/plan.vue | 255 +++++++++++++
src/layout/index.vue | 6
src/api/experiment/passRateStatistics.js | 47 ++
src/utils/dateUtil.js | 49 ++
src/router/index.js | 2
src/components/Breadcrumb/index.vue | 11
src/api/laboratory/measure.js | 26 +
src/api/util/requestUtil.js | 11
src/views/home/index.vue | 3
src/views/laboratory/measure/Add.vue | 170 ++++++--
src/layout/components/Sidebar/Logo.vue | 2
src/main.js | 8
src/layout/components/AppMain.vue | 42 +-
src/App.vue | 59 +++
17 files changed, 936 insertions(+), 185 deletions(-)
diff --git a/src/App.vue b/src/App.vue
index ec9032c..a25f956 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -9,3 +9,62 @@
name: 'App'
}
</script>
+
+<style>
+ #app{
+ overflow: hidden !important;
+ }
+
+ .breadcrumb-container{
+ height: 40px;
+ }
+ .app-main{
+ margin-top: 41px !important;
+ }
+
+ .el-menu-item{
+ width: 100%;
+ }
+
+ /* 鍏ㄥ眬妯℃�佹鏍峰紡 */
+ .el-dialog{
+ border-radius: 10px;
+ overflow: hidden;
+ }
+
+ .el-dialog__header,.el-message-box__header {
+ box-sizing: border-box;
+ height: 46px;
+ border-bottom: 1px solid rgb(238, 238, 238);
+ padding: 0px;
+ padding-left: 18px;
+ display: flex;
+ align-items: center;
+ background-color: #069cff;
+ }
+
+ .el-dialog__header *{
+ font-size: 16px !important;
+ color: #fff;
+ }
+
+ .el-dialog__headerbtn .el-dialog__close{
+ color: #fff;
+ top: -20px;
+ }
+
+ .el-dialog__headerbtn{
+ top: initial;
+ }
+
+ .el-dialog__footer .el-button * {
+ font-size: 14px !important;
+ }
+
+ .el-dialog__footer .el-button {
+ height: 36px;
+ border: 1px solid rgba(190, 190, 190, 0.44);
+ box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
+ padding: 0 14px;
+ }
+</style>
diff --git a/src/api/experiment/passRateStatistics.js b/src/api/experiment/passRateStatistics.js
new file mode 100644
index 0000000..daa6a86
--- /dev/null
+++ b/src/api/experiment/passRateStatistics.js
@@ -0,0 +1,47 @@
+import request from '@/utils/request'
+
+export function getSupplierList(params) {
+ return request({
+ url: '/qualificationRate/getSupplierList',
+ method: 'get',
+ params
+ })
+ }
+
+ /**
+ * 鏍峰搧鍚堟牸鐜�
+ * @param {} params
+ * @returns
+ */
+ export function getTestSampleStatistics(params) {
+ return request({
+ url: '/qualificationRate/getTestSampleStatistics',
+ method: 'get',
+ params
+ })
+ }
+ /**
+ * 渚涘簲鍟嗗悎鏍肩巼
+ * @param {} params
+ * @returns
+ */
+ export function getSupplierNoPassStatistics(params) {
+ return request({
+ url: '/qualificationRate/getSupplierNoPassStatistics',
+ method: 'get',
+ params
+ })
+ }
+
+ /**
+ * 椤圭洰鍚堟牸鐜�
+ * @param {} params
+ * @returns
+ */
+ export function getNoPassProjectStatistics(params) {
+ return request({
+ url: '/qualificationRate/getNoPassProjectStatistics',
+ method: 'get',
+ params
+ })
+ }
\ No newline at end of file
diff --git a/src/api/laboratory/measure.js b/src/api/laboratory/measure.js
index 3a6104e..dce0385 100644
--- a/src/api/laboratory/measure.js
+++ b/src/api/laboratory/measure.js
@@ -33,4 +33,30 @@
method: 'get',
params
})
+}
+
+//鑾峰彇user鍒楄〃鍜屼华鍣ㄥ垪琛�
+export function getListUserAndListIns(params) {
+ return request({
+ url: '/metering-plan/getListUserAndListIns',
+ method: 'get',
+ params
+ })
+}
+
+//娣诲姞璁″垝浠ュ強璁¢噺淇℃伅
+export function addPlanAndMeasure(data) {
+ return request({
+ url: '/metering-plan/addPlanAndMeasure',
+ method: 'post',
+ data
+ })
+}
+//淇敼璁¢噺
+export function updateMetricalInformationInfo(data) {
+ return request({
+ url: '/metrical-information/updateMetricalInformationInfo',
+ method: 'post',
+ data
+ })
}
\ No newline at end of file
diff --git a/src/api/url.js b/src/api/url.js
new file mode 100644
index 0000000..5f8f97d
--- /dev/null
+++ b/src/api/url.js
@@ -0,0 +1,7 @@
+const url = {
+}
+
+export default function(Vue) {
+ //娣诲姞鍏ㄥ眬API
+ Vue.prototype.$url = url
+}
\ No newline at end of file
diff --git a/src/api/util/requestUtil.js b/src/api/util/requestUtil.js
index 263da29..dee7d95 100644
--- a/src/api/util/requestUtil.js
+++ b/src/api/util/requestUtil.js
@@ -15,4 +15,13 @@
data
})
}
-
+export function postFile(path, data) {
+ return request({
+ url: path,
+ method: 'post',
+ headers: {
+ 'Content-Type': 'multipart/form-data'
+ },
+ data
+ })
+}
diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue
index a038a02..3c4c407 100644
--- a/src/components/Breadcrumb/index.vue
+++ b/src/components/Breadcrumb/index.vue
@@ -12,6 +12,7 @@
</el-col>
<el-col :span="12" style="background-color: #fff;display: flex;justify-content: end; align-items: center;">
<el-button v-if="backPlan" type="primary" icon="el-icon-refresh-left" size="mini" plain @click="backPlanUp">杩斿洖</el-button>
+ <el-button v-if="add" size="mini" @click="breadd" style="width: 60px;" type="primary">淇濆瓨</el-button>
<el-col :span="1"></el-col>
</el-col>
</div>
@@ -24,7 +25,8 @@
data() {
return {
levelList: null,
- backPlan: false
+ backPlan: false,
+ add: false
}
},
watch: {
@@ -40,6 +42,13 @@
this.$parent.combackPlan()
this.backPlan=false
},
+ breadd(){
+ this.add=false
+ this.$parent.indexAdd()
+ },
+ showadd(){
+ this.add=true
+ },
triggerBtnPlan(){
this.backPlan?this.backPlan=false:this.backPlan=true
},
diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue
index 4c2c635..f0ae826 100644
--- a/src/layout/components/AppMain.vue
+++ b/src/layout/components/AppMain.vue
@@ -1,52 +1,52 @@
<template>
<section class="app-main">
<transition name="fade-transform" mode="out-in">
- <router-view
- ref="child"
- @triggerMainBtnPlan="triggerMainBtnPlan"
- :key="key"
- />
+ <router-view ref="child" @triggerMainBtnPlan="triggerMainBtnPlan" :key="key" />
</transition>
</section>
</template>
<script>
export default {
- name: "AppMain",
+ name: 'AppMain',
computed: {
key() {
- return this.$route.path;
- },
+ return this.$route.path
+ }
},
methods: {
- childMethod() {
- this.$refs.child.combackLookPlan();
+ childMethod(){
+ this.$refs.child.combackLookPlan()
},
- triggerMainBtnPlan() {
- this.$parent.triggerCombackBtn();
+ triggerMainBtnPlan(){
+ this.$parent.triggerCombackBtn()
},
- },
-};
+ mainAdd(){
+ this.$refs.child.measureAdd()
+ },
+ mainShowAdd(){
+ this.$parent.showIndexAdd()
+ }
+ }
+}
</script>
<style lang="scss" scoped>
.app-main {
/* 88 = navbar+baredcrumb */
- min-height: calc(100vh - 88px);
+ height: calc(100vh - 88px);
width: 100%;
position: relative;
overflow: hidden;
- > div {
- min-height: calc(100vh - 88px);
+ >div{
height: 100%;
width: 100%;
}
- ::v-deep .content-main {
- //杩欐槸鎵�鏈夐〉闈㈢殑鍐呰竟璺�
+ ::v-deep .content-main{//杩欐槸鎵�鏈夐〉闈㈢殑鍐呰竟璺�
padding: 24px !important;
}
}
-.fixed-header + .app-main {
+.fixed-header+.app-main {
padding-top: 50px;
}
</style>
@@ -58,7 +58,7 @@
padding-right: 15px;
}
}
-.el-menu--popup {
+.el-menu--popup{
width: 120px;
}
</style>
diff --git a/src/layout/components/Sidebar/Logo.vue b/src/layout/components/Sidebar/Logo.vue
index d07b76a..096beb8 100644
--- a/src/layout/components/Sidebar/Logo.vue
+++ b/src/layout/components/Sidebar/Logo.vue
@@ -46,7 +46,7 @@
width: 100%;
height: 50px;
line-height: 50px;
- background: #fff;
+ background: #f8f8f8;
text-align: center;
overflow: hidden;
diff --git a/src/layout/index.vue b/src/layout/index.vue
index a1016fa..37ab14d 100644
--- a/src/layout/index.vue
+++ b/src/layout/index.vue
@@ -58,6 +58,12 @@
combackPlan(){
this.$refs.main.childMethod()
},
+ indexAdd(){
+ this.$refs.main.mainAdd()
+ },
+ showIndexAdd(){
+ this.$refs.breadcrumb.showadd()
+ },
triggerCombackBtn(){
this.$refs.breadcrumb.triggerBtnPlan()
}
diff --git a/src/main.js b/src/main.js
index 6319eed..e996df0 100644
--- a/src/main.js
+++ b/src/main.js
@@ -17,6 +17,8 @@
import '@/icons' // icon
import '@/permission' // permission control
+import url from './api/url.js'
+
/**
* If you don't want to use mock-server
* you want to use MockJs for mock api
@@ -30,11 +32,17 @@
mockXHR()
}
+Vue.prototype.HaveJson = (val) => {
+ return JSON.parse(JSON.stringify(val))
+}
+
// set ElementUI lang to EN
Vue.use(ElementUI, { locale })
// 濡傛灉鎯宠涓枃鐗� element-ui锛屾寜濡備笅鏂瑰紡澹版槑
// Vue.use(ElementUI)
+Vue.use(url);
+
Vue.config.productionTip = false
new Vue({
diff --git a/src/router/index.js b/src/router/index.js
index d7d2464..36817fd 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -199,7 +199,7 @@
{
path: 'planAssignments',
name: 'PlanAssignments',
- component: () => import('@/views/experiment/planAssignments/index'),
+ component: () => import('@/views/experiment/planAssignments/plan'),
meta: { title: '妫�楠岃鍒�', icon: 'tree' }
},
{
diff --git a/src/utils/dateUtil.js b/src/utils/dateUtil.js
new file mode 100644
index 0000000..33df681
--- /dev/null
+++ b/src/utils/dateUtil.js
@@ -0,0 +1,49 @@
+export function dateFormat(longTypeDate) {
+ var dateTypeDate = "";
+ var date = new Date();
+ date.setTime(longTypeDate);
+ dateTypeDate += date.getFullYear(); //骞�
+ dateTypeDate += "-" + getMonth(date); //鏈�
+ dateTypeDate += "-" + getDay(date); //鏃�
+ return dateTypeDate;
+}
+
+//杩斿洖 01-12 鐨勬湀浠藉��
+function getMonth(date) {
+ var month = "";
+ month = date.getMonth() + 1; //getMonth()寰楀埌鐨勬湀浠芥槸0-11
+ if (month < 10) {
+ month = "0" + month;
+ }
+ return month;
+}
+//杩斿洖01-30鐨勬棩鏈�
+function getDay(date) {
+ var day = "";
+ day = date.getDate();
+ if (day < 10) {
+ day = "0" + day;
+ }
+ return day;
+}
+function datetimeFormat(longTypeDate) {
+ var dateTypeDate = "";
+ var date = new Date();
+ date.setTime(longTypeDate);
+ dateTypeDate += date.getFullYear(); //骞�
+ dateTypeDate += "-" + this.getMonth(date); //鏈�
+ dateTypeDate += "-" + this.getDay(date); //鏃�
+ return dateTypeDate;
+}
+function format(d) {
+ var y = d.getFullYear();
+ var m = d.getMonth() + 1;
+ if (m < 10) {
+ m = "0" + m;
+ }
+ var day = d.getDate();
+ if (day < 10) {
+ day = "0" + day;
+ }
+ return y + "-" + m + "-" + day;
+}
\ No newline at end of file
diff --git a/src/views/experiment/passRateStatistics/index.vue b/src/views/experiment/passRateStatistics/index.vue
index 8783d00..e59f783 100644
--- a/src/views/experiment/passRateStatistics/index.vue
+++ b/src/views/experiment/passRateStatistics/index.vue
@@ -2,52 +2,48 @@
<div class="content-main">
<div class="top-bar">
<el-form ref="form" :inline="true" :rules="rules" :model="searchData" label-position="top">
- <el-form-item label="妫�娴嬫棩鏈�:" class="sermargin" prop="date">
- <el-date-picker
- v-model="searchData.date"
- type="daterange"
- range-separator="鑷�"
- start-placeholder="寮�濮嬫棩鏈�"
- end-placeholder="缁撴潫鏃ユ湡">
- </el-date-picker>
- </el-form-item>
- <el-form-item label="妫�楠岀被鍨�:" class="sermargin" prop="type">
- <el-select v-model="searchData.type" placeholder="鍏ㄩ儴">
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="鐗╂枡鍒嗙粍:">
- <el-button type="primary" icon="el-icon-plus" class="chooseMaterialBtn" >閫夋嫨鐗╂枡鍒嗙粍</el-button>
- </el-form-item>
- <div class="rightBtn">
- <el-form-item>
- <el-button type="primary" plain size="mini">娓呯┖</el-button>
- <el-button type="primary" @click="search" size="mini">鏌ヨ</el-button>
- </el-form-item>
- </div>
- </el-form>
+ <el-form-item label="妫�娴嬫棩鏈�:" class="sermargin" prop="date">
+ <el-date-picker v-model="searchData.date" type="daterange" range-separator="鑷�" start-placeholder="寮�濮嬫棩鏈�"
+ end-placeholder="缁撴潫鏃ユ湡">
+ </el-date-picker>
+ </el-form-item>
+ <el-form-item label="妫�楠岀被鍨�:" class="sermargin" prop="type">
+ <el-select v-model="searchData.type" placeholder="鍏ㄩ儴">
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="渚涘簲鍟�:">
+ <el-select v-model="searchData.supplier" placeholder="鍏ㄩ儴">
+ <el-option v-for="item in supplier" :key="item.value" :label="item.label" :value="item.value">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <div class="rightBtn">
+ <el-form-item>
+ <el-button type="primary" plain size="mini">娓呯┖</el-button>
+ <el-button type="primary" @click="search" size="mini">鏌ヨ</el-button>
+ </el-form-item>
+ </div>
+ </el-form>
</div>
<div class="top-bar-copy"></div>
<div class="chart-content">
<div class="qualified-wrapper">
- <div style="margin-left: 20px;padding:20px 0px;font-size:18px">妫�娴嬫壒娆″悎鏍肩巼缁熻</div>
+ <div style="margin-left: 20px;padding:20px 0px;font-size:18px">妫�娴嬫牱鍝佸悎鏍肩巼缁熻</div>
<div class="qualified" ref="qualified"></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>
- <div class="secondBox-wrapper" >
+ <div class="firstBox-wrapper">
+ <div style="margin-left: 20px;padding:20px 0px;font-size:18px">渚涘簲鍟嗕笉鍚堟牸娆℃暟缁熻</div>
+ <div class="firstBox" ref="unqualified_provider"></div>
+ </div>
+ <div class="secondBox-wrapper">
<div class="secondBox_header">
<div style="font-size:18px">涓嶅悎鏍奸」鐩粺璁�</div>
<el-radio-group v-model="type">
- <el-radio-button v-for="item in radiooptions" :key="item.value" :label="item.value" >{{ item.label }}</el-radio-button>
+ <el-radio-button v-for="item in radiooptions" :key="item.value" :label="item.value">{{ item.label
+ }}</el-radio-button>
</el-radio-group>
</div>
<div class="secondBox" ref="unqualified_project"></div>
@@ -55,14 +51,14 @@
</div>
</div>
<div class="bottom">
- <el-button type="primary" size="mini" >鏁版嵁瀵煎嚭</el-button>
+ <el-button type="primary" size="mini">鏁版嵁瀵煎嚭</el-button>
</div>
</div>
</template>
<script>
// 娣诲姞婊氬姩鐩戝惉浜嬩欢
-window.addEventListener('scroll', function() {
+window.addEventListener('scroll', function () {
var topBar = document.querySelector('.top-bar');
var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
@@ -74,25 +70,32 @@
})
import * as echarts from 'echarts'
+import { getSupplierList,getTestSampleStatistics,getSupplierNoPassStatistics,getNoPassProjectStatistics } from '@/api/experiment/passRateStatistics';
+import { dateFormat } from '../../../utils/dateUtil'
export default {
- data(){
+ data() {
return {
- searchData:{
+ supplier: [],
+ searchData: {
date: [],
- type: 0,
- group: ''
+ type: null,
+ supplier: null
},
- options:[
+ options: [
{
- label: '閲囪喘鍏ュ簱',
+ label: '鍘熸潗鏂�',
value: 0
},
{
- label: 'xxxx',
+ label: '鎴愬搧',
value: 1
+ },
+ {
+ label: '濮旀墭鍝�',
+ value: 2
}
],
- radiooptions:[
+ radiooptions: [
{
label: '鐜舰楗煎浘',
value: 0
@@ -104,12 +107,15 @@
],
type: 0,
rules: {
- date: [{required: true, message: '璇疯緭鍏ヨ处鍙�', trigger: 'blur'}],
- type: [{required: true, message: '璇疯緭鍏ュ悕瀛�', trigger: 'blur'}]
+ // date: [{ required: true, message: '璇疯緭鍏ヨ处鍙�', trigger: 'blur' }],
+ // type: [{ required: true, message: '璇疯緭鍏ュ悕瀛�', trigger: 'blur' }]
}
}
},
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;
@@ -118,6 +124,9 @@
const myChart2 = echarts.init(chartDom_unqualified_provider);
const myChart3 = echarts.init(chartDom_unqualified_project);
+ /**
+ * 妫�娴嬪悎鏍肩巼缁熻
+ */
const option_qualified = {
tooltip: {
trigger: 'axis',
@@ -164,15 +173,18 @@
}
]
};
- const option_unqualified1 ={
+ /**
+ * 渚涘簲鍟�
+ */
+ const option_unqualified1 = {
tooltip: {
trigger: 'axis',
axisPointer: { // 鍧愭爣杞存寚绀哄櫒锛屽潗鏍囪酱瑙﹀彂鏈夋晥
type: 'shadow' // 榛樿涓虹洿绾匡紝鍙�変负锛�'line' | 'shadow'
},
- formatter: function(params) {
+ formatter: function (params) {
let tooltip = params[0].name + '<br/>';
- params.forEach(function(item) {
+ params.forEach(function (item) {
tooltip += item.marker + ' ' + item.seriesName + ': ' + item.value.toFixed(2) + '%<br/>'; // 灏嗘暟鎹繚鐣欎袱浣嶅皬鏁板苟杞负鐧惧垎姣斿舰寮�
});
return tooltip;
@@ -185,13 +197,13 @@
data: ['渚涘簲鍟�1', '渚涘簲鍟�2', '渚涘簲鍟�3', '渚涘簲鍟�4']
},
yAxis: [
- {
- type: 'value',
- axisLabel: {
- formatter: '{value}%'
- }
+ {
+ type: 'value',
+ axisLabel: {
+ formatter: '{value}%'
}
- ],
+ }
+ ],
series: [
{
name: '鍚堟牸鏁伴噺',
@@ -207,6 +219,9 @@
}
]
};
+ /**
+ * 涓嶅悎鏍奸」鐩�
+ */
const option_unqualified2 = {
legend: {
orient: 'vertical',
@@ -246,25 +261,54 @@
myChart1.setOption(option_qualified);
myChart2.setOption(option_unqualified1);
- if(this.type === 0){
+ if (this.type === 0) {
myChart3.setOption(option_unqualified2);
}
- if(this.type === 1){
+ if (this.type === 1) {
myChart3.setOption(option_unqualified2);
+ }
+ },
+ 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])
+ }
+ data.date=null
+ return data
+ },
+ async getSupplierList() {
+ let res = await getSupplierList()
+ res.data.forEach(item => {
+ this.supplier.push({ label: item.supplier, value: item.supplier })
+ })
+ },
+ getTestSampleStatistics(){
+ let param= this.dateHandle()
+ let res =getTestSampleStatistics(param)
+ },
+ getSupplierNoPassStatistics(){
+ let param= this.dateHandle()
+ getSupplierNoPassStatistics(param)
}
}
}
</script>
<style lang="scss" scoped>
-.content-main{
- height:100%;
+.content-main {
+ height: 100%;
width: 100%;
- .top-bar{
+
+ .top-bar {
position: absolute;
width: 99%;
top: 0;
- left:0;
+ left: 0;
z-index: 999;
margin-top: 5px;
margin-left: 9.5px;
@@ -272,79 +316,95 @@
display: flex;
justify-content: space-between;
padding: 5px 24px 0px 24px;
- transition: position 0.3s ease;
- .el-form{
+ transition: position 0.3s ease;
+
+ .el-form {
width: 100%;
- .chooseMaterialBtn{
+
+ .chooseMaterialBtn {
background-color: #fff;
- border-color: rgba(192,196,204,0.5);
+ border-color: rgba(192, 196, 204, 0.5);
color: gray;
width: 220px;
}
}
- .sermargin{
+
+ .sermargin {
margin-right: 60px;
}
- .rightBtn{
- display:flex;
- justify-content:end;
+
+ .rightBtn {
+ display: flex;
+ justify-content: end;
margin-right: 20px;
margin-top: -40px;
margin-bottom: -10px;
}
}
+
.top-bar.fixed {
position: fixed;
top: 0.45rem;
left: 0.52rem;
- width:93.8%;
+ width: 93.8%;
}
- .top-bar-copy{
+
+ .top-bar-copy {
width: 100%;
height: 12vh;
}
- .chart-content{
+
+ .chart-content {
margin: 0px -15px;
margin-bottom: 60px;
- .qualified-wrapper{
+
+ .qualified-wrapper {
// margin-top: 14vh;
background-color: #fff;
width: 100%;
- height:50vh;
+ height: 50vh;
}
- .qualified{
+
+ .qualified {
width: 100%;
height: 400px;
}
- .unqualified{
+
+ .unqualified {
margin-top: 10px;
height: 50vh;
- display:flex;
+ display: flex;
justify-content: space-between;
- .firstBox-wrapper{
+
+ .firstBox-wrapper {
background-color: #fff;
- width:49%;
- .firstBox{
+ width: 49%;
+
+ .firstBox {
width: 100%;
height: 40vh;
}
}
- .secondBox-wrapper{
- background-color:#fff;
- width:49%;
- .secondBox_header{
- display:flex;
+
+ .secondBox-wrapper {
+ background-color: #fff;
+ width: 49%;
+
+ .secondBox_header {
+ display: flex;
justify-content: space-between;
margin: 20px 20px;
}
- .secondBox{
+
+ .secondBox {
width: 100%;
height: 40vh;
}
}
}
}
- .bottom{
+
+ .bottom {
position: fixed;
width: 95%;
bottom: 0rem !important;
@@ -352,7 +412,7 @@
margin: 0px -15px;
padding: 20px 40px;
z-index: 999;
- display:flex;
+ display: flex;
justify-content: end;
background-color: #fff;
}
diff --git a/src/views/experiment/planAssignments/plan.vue b/src/views/experiment/planAssignments/plan.vue
new file mode 100644
index 0000000..0d931cc
--- /dev/null
+++ b/src/views/experiment/planAssignments/plan.vue
@@ -0,0 +1,255 @@
+<style scoped>
+ .plan {
+ width: 100%;
+ }
+
+ .title {
+ height: 60px;
+ width: calc(100% - 20px);
+ background-color: white;
+ margin: 5px 10px;
+ display: flex;
+ align-items: center;
+ padding: 0 30px;
+ }
+
+ .thing {
+ margin: 10px;
+ padding: 15px;
+ background-color: white;
+ height: calc(100vh - 15vh);
+ }
+</style>
+<style>
+ .plan .has-gutter tr th {
+ background-color: #f5f7fa !important;
+ color: #333;
+ }
+
+ .plan .cell {
+ color: #333;
+ }
+</style>
+
+<template>
+ <div class="plan">
+ <div class="title">
+ <span>椤圭洰鍚嶇О锛�</span>
+ <el-input v-model="search.name" size="medium" style="width: 200px;margin-right: 20px;"></el-input>
+ <span>妫�楠屾椂闂达細</span>
+ <el-date-picker v-model="search.date" type="daterange" range-separator="鑷�" start-placeholder="寮�濮嬫棩鏈�"
+ end-placeholder="缁撴潫鏃ユ湡" size="medium" style="margin-right: 20px;">
+ </el-date-picker>
+ <span>妫�楠屼汉锛�</span>
+ <el-input v-model="search.userName" size="medium" style="width: 200px;margin-right: 20px;"></el-input>
+ <el-button size="small" type="primary">鏌ヨ</el-button>
+ <el-button size="small">閲嶇疆</el-button>
+ </div>
+ <div class="thing">
+ <el-table :data="tableData" style="width: 100%;" row-key="id" 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>
+ <el-table-column prop="name" label="妫�楠岀粨鏋�">
+ </el-table-column>
+ <el-table-column prop="address" label="鍦板潃">
+ </el-table-column>
+ <el-table-column label="鎿嶄綔" width="80">
+ <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.insId==undefined&&scope.row.address==null">鍒嗛厤</el-button>
+ <el-button size="mini" type="success" @click="openUpInsDia(scope.row)"
+ v-else-if="scope.row.insId==undefined&&scope.row.name==null">妫�楠�</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-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-col>
+ </el-row>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button type="primary" @click="submitUpData">纭� 瀹�</el-button>
+ <el-button @click="upDia = false">鍙� 娑�</el-button>
+ </span>
+ </el-dialog>
+ <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-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-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-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-column type="index" width="100" label="搴忓彿">
+ </el-table-column>
+ <el-table-column label="妫�楠屽��">
+ <template slot-scope="scope">
+ <el-input v-model.number="scope.row.number" size="small" clearable placeholder="璇疯緭鍏�"
+ @change="(val)=>scope.row.number = isNaN(val)?null:val">
+ </el-input>
+ </template>
+ </el-table-column>
+ <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>
+ </template>
+ </el-table-column>
+ </el-table>
+ </el-col>
+ </el-row>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button type="primary" @click="submitUpData">鎻� 浜�</el-button>
+ <el-button @click="upInsDia = false">鍙� 娑�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+ export default {
+ data() {
+ return {
+ search: {
+ name: null,
+ 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": 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
+ }]
+ }],
+ upDia: false,
+ upData: {},
+ upIndex: 0,
+ upInsDia: false,
+ upIndex2: 0
+ }
+ },
+ mounted() {
+ this.selectDataList()
+ },
+ methods: {
+ selectDataList() {
+ this.tableData.forEach(a => {
+ a.code = '[1]'
+ if (a.children != undefined) {
+ a.children.forEach(b => {
+ b.code = '[2]'
+ b.res = JSON.parse(b.res)
+ })
+ }
+ })
+ 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++
+ })
+ return row.insId != undefined && count == row.children.length
+ },
+ openUpDia(row) {
+ this.upDia = true
+ this.upData = {
+ id: row.id,
+ address: row.address
+ }
+ },
+ submitUpData() {
+ this.tableData.forEach(a => {
+ a.children.forEach(b => {
+ if (b.id == this.upData.id) {
+ b.address = this.upData.address
+ }
+ })
+ })
+ this.$message.success('淇敼鎴愬姛')
+ this.upIndex++
+ this.upDia = false
+ },
+ openUpInsDia(row) {
+ this.upInsDia = true
+ this.upData = this.HaveJson(row)
+ },
+ deleteRow(index, rows) {
+ rows.splice(index, 1);
+ },
+ addRes() {
+ this.upData.res.push({
+ "number": null
+ })
+ this.upIndex2++
+ }
+ }
+ }
+</script>
\ No newline at end of file
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 8415e5c..f876061 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -94,4 +94,5 @@
}
}
}
-</style>
+
+</style>
\ No newline at end of file
diff --git a/src/views/laboratory/measure/Add.vue b/src/views/laboratory/measure/Add.vue
index 0cf9cd1..224b34e 100644
--- a/src/views/laboratory/measure/Add.vue
+++ b/src/views/laboratory/measure/Add.vue
@@ -8,15 +8,15 @@
<el-form-item>
<el-col :span="6" style="display: flex;justify-content: space-around;">
<span>璐熻矗浜猴細</span>
- <el-select v-model="planAddInfo.measurePerson" placeholder="璇烽�夋嫨娲诲姩鍖哄煙">
- <el-option label="鍖哄煙涓�" value="shanghai"></el-option>
- <el-option label="鍖哄煙浜�" value="beijing"></el-option>
+ <el-select v-model="planAddInfo.measurePerson" placeholder="璇烽�夋嫨璐熻矗浜�">
+ <el-option v-for="item in userList" :key="item.value" :label="item.label" :value="item.value">
+ </el-option>
</el-select>
</el-col>
<el-col :span="8" style="display: flex;justify-content: space-around;">
<span>璁″垝鏃堕棿锛�</span>
- <el-date-picker v-model="planAddInfo.planDate" type="daterange" range-separator="鑷�" start-placeholder="寮�濮嬫棩鏈�"
- end-placeholder="缁撴潫鏃ユ湡">
+ <el-date-picker v-model="planAddInfo.planDate" type="daterange" range-separator="鑷�"
+ start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡">
</el-date-picker>
</el-col>
<el-col :span="5"></el-col>
@@ -36,39 +36,54 @@
:show-text="false"></el-progress>
</el-col>
</el-col>
+
<el-col style="width:93%;height: 20vh;margin-top: 30px; margin-left: 40px;">
+ <el-button icon="el-icon-plus" @click="addcodePointsTable()" style="margin-bottom: 10px;"
+ type="primary">鏂板璁¢噺</el-button>
<el-table ref="codePointsTable" :cell-style="{ textAlign: 'center' }"
:header-cell-style="{ border: '0px', background: '#f5f7fa', color: '#606266', boxShadow: 'inset 0 1px 0 #ebeef5', textAlign: 'center' }"
:data="codePointsTable" style="width: 100%">
- <el-table-column type="index" label="搴忓彿" min-width="90" />
- <el-table-column prop="equipmentPointName" label="浠櫒璁惧鍚嶇О" min-width="150">
+ <el-table-column type="index" v-model="codePointsTable.index" label="搴忓彿" min-width="90" />
+ <el-table-column prop="equipmentPointName" label="浠櫒璁惧" min-width="150">
<template slot-scope="scope">
- <span v-show="!codePointesTableStatus">{{ scope.row.equipmentPoint }}</span>
- <el-input v-show="codePointesTableStatus" v-model="scope.row.equipmentPoint" />
+ <span v-show="!codePointesTableStatus">{{ scope.row.equipmentPointName }}</span>
+ <el-select @change="insListChange(scope.row.equipmentPointName,scope)" v-model="scope.row.equipmentPointName" placeholder="璇烽�夋嫨浠櫒璁惧">
+ <el-option v-for="item in insList" :key="item.value" :label="item.label" :value="item.value">
+ </el-option>
+ </el-select>
</template>
</el-table-column>
-
<el-table-column prop="measuringRange" label="娴嬮噺鑼冨洿" min-width="150">
<template slot-scope="scope">
<span v-show="!codePointesTableStatus">{{ scope.row.measuringRange }}</span>
- <el-input v-show="codePointesTableStatus" v-model="scope.row.measuringRange" />
+ <el-input disabled v-show="codePointesTableStatus" v-model="scope.row.measuringRange" />
</template>
</el-table-column>
- <el-table-column prop="unit" label="鍗曚綅" min-width="150">
+ <el-table-column prop="termValidity" label="璁¢噺鍛ㄦ湡" min-width="150">
<template slot-scope="scope">
- <span v-show="!codePointesTableStatus">{{ scope.row.unit }}</span>
- <el-input v-show="codePointesTableStatus" v-model="scope.row.unit" />
+ <span v-show="!codePointesTableStatus">{{ scope.row.termValidity }}</span>
+ <el-input disabled v-show="codePointesTableStatus" v-model="scope.row.termValidity" />
</template>
</el-table-column>
- <el-table-column prop="descriptiveness" label="鎻忚堪" min-width="200">
+ <el-table-column prop="result" label="璁¢噺缁撴灉" min-width="200">
<template slot-scope="scope">
- <span v-show="!codePointesTableStatus">{{ scope.row.descriptiveness }}</span>
- <el-input v-show="codePointesTableStatus" v-model="scope.row.descriptiveness" />
+ <span v-show="!codePointesTableStatus">{{ scope.row.result }}</span>
+ <el-select v-model="scope.row.result" placeholder="璇烽�夋嫨">
+ <el-option v-for="item in result" :key="item.value" :label="item.label" :value="item.value">
+ </el-option>
+ </el-select>
</template>
</el-table-column>
- <el-table-column prop="descriptiveness" label="鎿嶄綔" min-width="200">
+ <el-table-column prop="endDate" label="璁¢噺鏃ユ湡" min-width="200">
<template slot-scope="scope">
- <el-tag type="" icon=""></el-tag>
+ <span v-show="!codePointesTableStatus">{{ scope.row.endDate }}</span>
+ <el-date-picker v-model="scope.row.endDate" type="date" placeholder="閫夋嫨鏃ユ湡">
+ </el-date-picker>
+ </template>
+ </el-table-column>
+ <el-table-column prop="index" label="鎿嶄綔" min-width="200">
+ <template slot-scope="scope">
+ <span><a @click="removetableIndex(scope.row.index)" style="color: deepskyblue;">浣滃簾</a></span>
</template>
</el-table-column>
</el-table>
@@ -76,41 +91,110 @@
</div>
</template>
<script>
+import {
+ getListUserAndListIns, addPlanAndMeasure
+} from '@/api/laboratory/measure'
+import { dateFormat } from "../../../utils/dateUtil";
export default {
data() {
return {
planAddInfo: {
- plannedOrderNumber: 7897897987,
- measurePerson: '鏌愭煇浜�',
- planDate: "2021-09-08 ~ 2024-08-09",
- unit: '鏌愭煇妫�娴嬪眬',
- createPerson: '鏌愭煇璐熻矗浜�',
- createTime: '2021-09-08'
+ plannedOrderNumber: '',
+ measurePerson: '',
+ planDate: "",
+ unit: '',
+ createPerson: '',
+ createTime: ''
},
codePointsTable: [{
- id: '',
+ "index": 1,
+ "equipmentPointName": '',
+ "measuringRange": '',
+ "termValidity": "",
+ "result": null,
+ }],
+ result: [{
+ label: '鍚堟牸',
+ value: 1
+ }, {
+ label: '鐭鍚庡彲鐢�',
+ value: 2
+ }, {
+ label: '涓嶅悎鏍�',
+ value: 3
+ }],
+ userList: [],
+ insList: [],
+ instrumentList:[],
+ // 鐮佺偣琛ㄦ牸鐨勭姸鎬侊細鏁版嵁灞曠ずfalse/鏂板杈撳叆true
+ codePointesTableStatus: false,
+ }
+ },
+ async created() {
+ this.codePointsTable = []
+ let res = await getListUserAndListIns()
+ res.data.userList.forEach(element => {
+ this.userList.push({ label: element.name, value: element.id })
+ });
+ this.instrumentList=res.data.instrumentList
+ res.data.instrumentList.forEach(item => {
+ this.insList.push({ label: item.equipmentName, value: item.id })
+ })
+ console.log(this.insList);
+ },
+ methods: {
+ addcodePointsTable() {
+ const newObj = {
+ index: this.codePointsTable.length + 1,
equipmentPointName: '',
measuringRange: '',
termValidity: "",
- planDate: null,
- }],
- // 鐮佺偣琛ㄦ牸鐨勭姸鎬侊細鏁版嵁灞曠ずfalse/鏂板杈撳叆true
- codePointesTableStatus: true,
- }
- },
- methods: {
- // 鏂板璁惧鐮佺偣
- addNewCodePoints() {
- //
- if (!this.codePointsTable) {
- this.codePointsTable = []
+ result: null,
+ endDate: null,
+ planDate: null
}
- const newObj = {}
- newObj.equipmentPointName = ''
- newObj.descriptiveness = ''
- newObj.unit = ''
- newObj.instrumentId = this.equipmentDetail.id
this.codePointsTable.push(newObj)
+ this.codePointesTableStatus = true
+ },
+ removetableIndex(id) {
+ this.codePointsTable = this.codePointsTable.filter(item => {
+ return item.index != id;
+ })
+ },
+ async add() {
+ console.log(111111);
+ this.planAddInfo.startTime = dateFormat(this.planAddInfo.planDate[0])
+ this.planAddInfo.endTime = dateFormat(this.planAddInfo.planDate[1])
+ console.log(this.planAddInfo);
+ this.planAddInfo.planDate = null
+ this.codePointsTable.forEach(item => {
+ if(item.endDate!=null&&item.endDate!=''){
+ item.endDate = dateFormat(item.endDate)
+ }
+ })
+ console.log(this.codePointsTable);
+ let data = {}
+ this.codePointsTable.length>0?data = { measureList: this.codePointsTable, plan: this.planAddInfo }:data = {plan: this.planAddInfo }
+ let add = await addPlanAndMeasure(data)
+ this.planAddInfo={
+ plannedOrderNumber: '',
+ measurePerson: '',
+ planDate: "",
+ unit: '',
+ createPerson: '',
+ createTime: ''
+ }
+ this.codePointsTable=[]
+ return add.data
+ },
+ insListChange(i,s){
+ console.log(i);
+ console.log(s.$index);
+ let ins= this.instrumentList.filter(item=>{
+ return item.id==i
+ })[0]
+ this.codePointsTable[s.$index].measuringRange=ins.measuringRange
+ this.codePointsTable[s.$index].termValidity=ins.termValidity+'鏈�'
}
}
}
diff --git a/src/views/laboratory/measure/index.vue b/src/views/laboratory/measure/index.vue
index d133f34..c32c063 100644
--- a/src/views/laboratory/measure/index.vue
+++ b/src/views/laboratory/measure/index.vue
@@ -117,11 +117,12 @@
</div>
</div>
</div>
- <div style="position: absolute;top:14px;left: 9px;transition: 1s;width: 99%;height: 82vh;background-color: #fff;z-index: 21;">
- <Add/>
+ <div
+ :style="`position: absolute;top:${addTop}px;left: 9px;transition: 1s;width: 99%;height: 82vh;background-color: #fff;z-index: 21;`">
+ <Add ref="add" />
</div>
<div id="myMOdel"
- :style="`position: absolute;transition: 1s;top:${mymodelTop}px; left: 9px; width: 99%; height: 65vh; background-color: #fff;z-index: 20;`">
+ :style="`position: absolute;transition: 1s;top:${mymodelTop}px; left: 9px; width: 99%; height: 85vh; background-color: #fff;z-index: 20;`">
<el-col :span="10">
<p style="font-size: 13px;padding-left: 40px;">璁″垝淇℃伅</p>
</el-col>
@@ -188,22 +189,84 @@
<el-table-column prop="imCreateTime" label="鍒涘缓鏃ユ湡" />
<el-table-column prop="measurementName" label="鍒涘缓浜�" />
<el-table-column prop="measurementUnit" label="璁¢噺鍗曚綅" />
- <el-table-column prop="equipmentCode" label="璁¢噺缂栧彿" />
+ <el-table-column prop="code" label="璁¢噺缂栧彿" />
+ <el-table-column prop="equipmentCode" label="鎿嶄綔">
+ <template slot-scope="scope">
+ <a @click="measureUp(scope)" style="color: deepskyblue;">璁¢噺</a>
+ </template>
+ </el-table-column>
</el-table>
</el-col>
- <el-col style="width: 93%;margin-left: 40px; margin-top: 90px;display: flex;justify-content: end;">
+ <el-col style="width: 93%;margin-left: 40px; margin-top: 250px;display: flex;justify-content: end;">
<el-pagination @size-change="handleSizeChangePlan" @current-change="handleCurrentChangePllan"
- :current-page="currentPagePlan" :page-sizes="[5, 10, 20]" :page-size="pageSizePlan"
+ :current-page="currentPagePlan" :page-sizes="[5, 10]" :page-size="pageSizePlan"
layout="total, sizes, prev, pager, next, jumper" :total="totalPlan">
</el-pagination>
</el-col>
</div>
+ <el-dialog class="measureForm" title="璁¢噺" :visible.sync="dialogVisible">
+ <el-form label-position="top" ref="upmeasureForm" :model="measureUpInfo">
+ <el-row :gutter="20">
+ <el-col :span="24">
+ <el-form-item label="妫�瀹氭湁鏁堟湡" prop="date"
+ :rules="[{ required: true, message: '璇烽�夋嫨妫�瀹氭湁鏁堟湡', trigger: 'change' }]">
+ <el-date-picker v-model="measureUpInfo.date" type="date" placeholder="閫夋嫨鏃ユ湡">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="涓嶇‘瀹氬害" prop="uncertainty"
+ :rules="[{ required: true, message: '璇峰~鍐欎笉纭畾搴�', trigger: 'blur' }]">
+ <el-input placeholder="璇峰~鍐欎笉纭畾搴�" v-model="measureUpInfo.uncertainty" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="缁撴灉" prop="result" :rules="[{ required: true, message: '璇烽�夋嫨缁撴灉', trigger: 'change' }]">
+ <el-select v-model="measureUpInfo.result" clearable filterable :allow-create="true" placeholder="璇烽�夋嫨缁撴灉"
+ style="width:100%">
+ <el-option v-for="item in result" :key="item.id" :label="item.label" :value="item.value" />
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row :gutter="20">
+ <el-col :span="24">
+ <el-form-item label="鎬ц兘鎸囨爣">
+ <el-input v-model="measureUpInfo.performanceIndex" type="textarea" :rows="2" placeholder="璇疯緭鍏ュ唴瀹�" />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row :gutter="20">
+ <el-col :span="24">
+ <el-form-item label="澶囨敞">
+ <el-input v-model="measureUpInfo.remarks" type="textarea" :rows="2" placeholder="璇疯緭鍏ュ唴瀹�" />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row :gutter="20">
+ <el-col :span="24">
+ <el-form-item label="">
+ <el-upload class="upload-demo" action="#" :on-change="handleUploadupdated" :auto-upload="false">
+ <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button>
+ </el-upload>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button type="primary" @click="upMeasure">纭� 瀹�</el-button>
+
+ <el-button @click="dialogVisible = false">鍙� 娑�</el-button>
+ </span>
+ </el-dialog>
</div>
</div>
</template>
<script>
-import { getPlanPageList, getStandingPageList, getPlanMeasureInstrument, limitGetPlanMeasureRequest } from '@/api/laboratory/measure'
+import { getPlanPageList, getStandingPageList, getPlanMeasureInstrument, limitGetPlanMeasureRequest, updateMetricalInformationInfo } from '@/api/laboratory/measure'
import { default as Add } from "./Add.vue";
export default {
components: {
@@ -211,6 +274,29 @@
},
data() {
return {
+ dialogVisible: false,
+ tableIndex: null,
+ measureUpInfo: {
+ id: null,
+ code: null,
+ result: null,
+ date: null,
+ uncertainty: null,
+ performanceIndex: null,
+ remarks: null,
+ file: null,
+ termValidity: null
+ },
+ result: [{
+ label: '鍚堟牸',
+ value: 1
+ }, {
+ label: '鐭鍚庡彲鐢�',
+ value: 2
+ }, {
+ label: '涓嶅悎鏍�',
+ value: 3
+ }],
searchData: {
code: '',
name: '',
@@ -232,9 +318,8 @@
currentPagePlan: 1,
pageSizePlan: 5,
totalPlan: 0,
- drawer: false,
direction: 'rtl',
- lookVisible: true,
+ lookVisible: false,
measureData: [],
planInfo: {
plannedOrderNumber: 7897897987,
@@ -244,7 +329,8 @@
createPerson: '鏌愭煇璐熻矗浜�',
createTime: '2021-09-08'
},
- mymodelTop: -600,//14
+ mymodelTop: -700,//14
+ addTop: -700,
planId: 0
}
},
@@ -253,6 +339,47 @@
// this.getPlanPageList()
},
methods: {
+ upResult() {
+ this.measureData[this.tableIndex].result = this.resultUp
+
+ },
+ async upMeasure() {
+ let res = await updateMetricalInformationInfo(this.measureUpInfo)
+ if (res) {
+ this.$message({
+ message: '鎿嶄綔鎴愬姛锛�',
+ type: 'success'
+ });
+ this.limitGetPlanMeasureInstrument()
+ this.dialogVisible = false
+ }
+ },
+ handleUploadupdated() {
+
+ },
+ measureUp(scope) {
+ this.dialogVisible = true
+ this.tableIndex = scope.$index
+ this.measureUpInfo.result = scope.row.result
+ this.measureUpInfo.code = scope.row.code
+ this.measureUpInfo.date = scope.row.endDate
+ this.measureUpInfo.id = scope.row.imId
+ this.measureUpInfo.uncertainty = scope.row.uncertainty
+ this.measureUpInfo.performanceIndex = scope.row.performanceIndex
+ this.measureUpInfo.remarks = scope.row.remarks
+ this.measureUpInfo.termValidity = scope.row.termValidity
+ },
+ measureAdd() {
+ let add = this.$refs.add.add()
+ if (add) {
+ this.addTop = -700
+ this.$message({
+ message: '鎿嶄綔鎴愬姛锛�',
+ type: 'success'
+ });
+ this.lookVisible = false
+ }
+ },
async handleSizeChangePlan(num) {
this.pageSizePlan = num
await this.limitGetPlanMeasureInstrument()
@@ -262,14 +389,17 @@
await this.limitGetPlanMeasureInstrument()
},
addPlan() {
- this.drawer = true
+ this.addTop = 14
+ this.lookVisible = true
+ this.$parent.mainShowAdd()
},
async limitGetPlanMeasureInstrument() {
- let res = await limitGetPlanMeasureRequest({
+ let param = {
id: this.planId,
currentPage: this.currentPagePlan,
- pageSize: this.pageSize
- })
+ pageSize: this.pageSizePlan
+ }
+ let res = await limitGetPlanMeasureRequest(param)
this.totalPlan = res.data.taotal
this.measureData = res.data.list
},
@@ -282,7 +412,6 @@
},
async getPlanAndInfoAndIns(id) {
let res = await getPlanMeasureInstrument({ "id": id, "currentPage": this.currentPagePlan, "pageSize": this.pageSize });
- console.log(res);
for (const key in res.data.list) {
this.planInfo[key] = res.data.list[key]
}
@@ -299,27 +428,29 @@
},
combackLookPlan() {
this.lookVisible = false
- this.mymodelTop = -600
+ this.mymodelTop = -700
},
blurSearch() {
if (this.radioValue === 1) {
- console.log("璁″垝");
}
},
handleClose() {
this.drawer = false
},
- handleCurrentChange() {
- this.getStandingPageList()
+ handleCurrentChange(num) {
+ this.currentPage = num
+ this.radioValue ? this.getPlanPageList() : this.getStandingPageList()
},
- handleSizeChange() {
- this.getStandingPageList()
+ handleSizeChange(num) {
+ this.pageSize = num
+ this.radioValue ? this.getPlanPageList() : this.getStandingPageList()
},
async getStandingPageList() {
- const res = await getStandingPageList({
+ let param = {
currentPage: this.currentPage, pageSize: this.pageSize,
code: this.searchData.code, name: this.searchData.name, unit: this.searchData.measureunit
- })
+ }
+ const res = await getStandingPageList(param)
this.measureLedgerTable = res.data.records
this.total = res.data.total
this.measureLedgerTable.forEach(item => {
@@ -362,10 +493,11 @@
this.reset()
},
async getPlanPageList() {
- const res = await getPlanPageList({
+ let param = {
currentPage: this.currentPage, pageSize: this.pageSize,
code: this.searchData.code, name: this.searchData.name, unit: this.searchData.measureunit
- })
+ }
+ const res = await getPlanPageList(param)
res.data.list.forEach(item => {
item.palanDate = item.beginTime + " ~ " + item.endTime
})
@@ -373,7 +505,6 @@
this.total = res.data.total
},
async lookMeasurement(code) {
- console.log(code);
},
}
}
--
Gitblit v1.9.3