From 33e4ee0ff4b02f4d6eef7f0e5260ed9fa745597a Mon Sep 17 00:00:00 2001
From: value <z1292839451@163.com>
Date: 星期三, 30 八月 2023 11:56:48 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/views/laboratory/measure/Add.vue | 67 ++++++++++++++++++++-------------
src/views/laboratory/measure/index.vue | 36 +++++++++++-------
2 files changed, 62 insertions(+), 41 deletions(-)
diff --git a/src/views/laboratory/measure/Add.vue b/src/views/laboratory/measure/Add.vue
index 0533251..889c813 100644
--- a/src/views/laboratory/measure/Add.vue
+++ b/src/views/laboratory/measure/Add.vue
@@ -5,26 +5,30 @@
</el-col>
<el-col>
<el-form :model="planAddInfo" style="padding-left: 150px;">
- <el-form-item>
+ <el-col>
<el-col :span="6" style="display: flex;justify-content: space-around;">
- <span>璐熻矗浜猴細</span>
- <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-form-item label="璐熻矗浜猴細" :rules="[{ required: true, message: '璇烽�夋嫨璐熻矗浜�', trigger: 'change' }]">
+ <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-form-item>
</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>
+ <el-form-item label="璁″垝鏃堕棿锛�" :rules="[{ required: true, message: '璇烽�夋嫨璁″垝鏃堕棿', trigger: 'change' }]">
+ <el-date-picker v-model="planAddInfo.planDate" type="daterange" range-separator="鑷�"
+ start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡">
+ </el-date-picker>
+ </el-form-item>
</el-col>
<el-col :span="5"></el-col>
<el-col :span="5" style="display: flex;justify-content: space-around;">
- <span>璁¢噺鍗曚綅锛�</span>
- <el-input style="width: 150px;" v-model="planAddInfo.unit" placeholder=""></el-input>
+ <el-form-item label="璁¢噺鍗曚綅锛�">
+ <el-input style="width: 150px;" v-model="planAddInfo.unit" placeholder=""></el-input>
+ </el-form-item>
</el-col>
- </el-form-item>
+ </el-col>
</el-form>
</el-col>
<el-col>
@@ -47,7 +51,8 @@
<el-table-column prop="equipmentPointName" label="浠櫒璁惧" min-width="150">
<template slot-scope="scope">
<span v-show="!codePointesTableStatus">{{ scope.row.equipmentPointName }}</span>
- <el-select @change="insListChange(scope.row.equipmentPointName,scope)" v-model="scope.row.equipmentPointName" placeholder="璇烽�夋嫨浠櫒璁惧">
+ <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>
@@ -95,6 +100,7 @@
getListUserAndListIns, addPlanAndMeasure
} from '@/api/laboratory/measure'
import { dateFormat } from "../../../utils/dateUtil";
+import { MessageBox, Message } from 'element-ui'
export default {
data() {
return {
@@ -125,7 +131,7 @@
}],
userList: [],
insList: [],
- instrumentList:[],
+ instrumentList: [],
// 鐮佺偣琛ㄦ牸鐨勭姸鎬侊細鏁版嵁灞曠ずfalse/鏂板杈撳叆true
codePointesTableStatus: false,
}
@@ -136,7 +142,7 @@
res.data.userList.forEach(element => {
this.userList.push({ label: element.name, value: element.id })
});
- this.instrumentList=res.data.instrumentList
+ this.instrumentList = res.data.instrumentList
res.data.instrumentList.forEach(item => {
this.insList.push({ label: item.equipmentName, value: item.id })
})
@@ -161,21 +167,28 @@
})
},
async add() {
- console.log(111111);
+ if (this.planAddInfo.measurePerson == null || this.planAddInfo.measurePerson == ''||this.planAddInfo.planDate[0]==null||this.planAddInfo.planDate[0]=='') {
+ Message({
+ message: "璐熻矗浜哄拰璁″垝鏃ユ湡涓嶈兘涓虹┖锛�",
+ type: 'warning',
+ duration: 2 * 1000
+ })
+ return false
+ }
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!=''){
+ if (item.endDate != null && item.endDate != '') {
item.endDate = dateFormat(item.endDate)
}
})
- console.log(this.codePointsTable);
+ console.log(this.codePointsTable);
let data = {}
- this.codePointsTable.length>0?data = { measureList: this.codePointsTable, plan: this.planAddInfo }:data = {plan: this.planAddInfo }
+ this.codePointsTable.length > 0 ? data = { measureList: this.codePointsTable, plan: this.planAddInfo } : data = { plan: this.planAddInfo }
let add = await addPlanAndMeasure(data)
- this.planAddInfo={
+ this.planAddInfo = {
plannedOrderNumber: '',
measurePerson: '',
planDate: "",
@@ -183,17 +196,17 @@
createPerson: '',
createTime: ''
}
- this.codePointsTable=[]
+ this.codePointsTable = []
return add.data
},
- insListChange(i,s){
+ insListChange(i, s) {
console.log(i);
console.log(s.$index);
- let ins= this.instrumentList.filter(item=>{
- return item.id==i
+ 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+'鏈�'
+ 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 abb7da9..2c6fb63 100644
--- a/src/views/laboratory/measure/index.vue
+++ b/src/views/laboratory/measure/index.vue
@@ -118,9 +118,12 @@
</div>
</div>
<div>
- <el-button v-if="selectInfoBtn" @click="combackLookPlan" style="position: fixed;top: 43px;right: 14px; z-index: 1000;" type="primary" icon="el-icon-refresh-left" size="mini" plain >杩斿洖</el-button>
- <div v-if="addBtn" style="display: flex;justify-content: center;width: 10%;position: fixed;top: 43px;right: 14px; z-index: 1000;">
- <el-button @click="addTop = -82;addBtn=false" size="mini" style="width: 60px;" >杩斿洖</el-button>
+ <el-button v-if="selectInfoBtn" @click="combackLookPlan"
+ style="position: fixed;top: 43px;right: 14px; z-index: 1000;" type="primary" icon="el-icon-refresh-left"
+ size="mini" plain>杩斿洖</el-button>
+ <div v-if="addBtn"
+ style="display: flex;justify-content: center;width: 10%;position: fixed;top: 43px;right: 14px; z-index: 1000;">
+ <el-button @click="addTop = -82; addBtn = false" size="mini" style="width: 60px;">杩斿洖</el-button>
<el-button size="mini" @click="measureAdd" style="width: 60px;" type="primary">淇濆瓨</el-button>
</div>
</div>
@@ -378,13 +381,19 @@
this.measureUpInfo.remarks = scope.row.remarks
this.measureUpInfo.termValidity = scope.row.termValidity
},
- measureAdd() {
+ async measureAdd() {
+ let res = await this.$refs.add.add()
+ if (!res) {
+ return
+ }
this.addTop = -82
- this.$message({
- message: '鎿嶄綔鎴愬姛锛�',
- type: 'success'
- });
- this.lookVisible = false
+ this.$message({
+ message: '鎿嶄綔鎴愬姛锛�',
+ type: 'success'
+ });
+ this.lookVisible = false
+ this.addBtn = false
+ this.limitGetPlanMeasureInstrument()
},
async handleSizeChangePlan(num) {
this.pageSizePlan = num
@@ -399,7 +408,7 @@
this.addTop = 2
this.lookVisible = true
this.$parent.mainShowAdd()
- this.addBtn=true
+ this.addBtn = true
},
async limitGetPlanMeasureInstrument() {
let param = {
@@ -418,7 +427,7 @@
this.getPlanAndInfoAndIns(id)
this.lookVisible = true
this.mymodelTop = 2
- this.selectInfoBtn=true
+ this.selectInfoBtn = true
this.$parent.triggerMainBtnPlan()
},
async getPlanAndInfoAndIns(id) {
@@ -440,7 +449,7 @@
combackLookPlan() {
this.lookVisible = false
this.mymodelTop = -1000
- this.selectInfoBtn=false
+ this.selectInfoBtn = false
},
blurSearch() {
if (this.radioValue === 1) {
@@ -576,5 +585,4 @@
margin: 10px 0;
}
}
-}
-</style>
+}</style>
--
Gitblit v1.9.3