From 34a7e21b3508ac0f5f011d958210fdb7176d726b Mon Sep 17 00:00:00 2001
From: Fixiaobai <fixiaobai@163.com>
Date: 星期六, 09 九月 2023 11:54:05 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.22:9001/r/lims-before

---
 src/views/experiment/planAssignments/plan.vue |  109 +++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 79 insertions(+), 30 deletions(-)

diff --git a/src/views/experiment/planAssignments/plan.vue b/src/views/experiment/planAssignments/plan.vue
index c616156..34a94cc 100644
--- a/src/views/experiment/planAssignments/plan.vue
+++ b/src/views/experiment/planAssignments/plan.vue
@@ -44,23 +44,33 @@
 <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>
+			<el-form :model="search" :inline="true" label-position="left">
+				<el-form-item prop="code" label="鐢宠鍗曠紪鍙凤細" width="200" style="margin: 20px 10px;">
+					<el-input v-model="search.code" size="small" ></el-input>
+				</el-form-item>
+				<el-form-item prop="date" label="妫�楠屾椂闂达細" width="200" style="margin: 20px 10px;">
+					<el-date-picker v-model="search.date" type="daterange" range-separator="鑷�" start-placeholder="寮�濮嬫棩鏈�"
+						end-placeholder="缁撴潫鏃ユ湡" size="small" value-format="yyyy-MM-dd" style="margin-right: 20px;">
+					</el-date-picker>
+				</el-form-item>
+				<el-form-item prop="testValue" label="妫�楠岀粨鏋滐細" width="200" style="margin: 20px 10px;">
+					<el-select v-model="search.testValue" size="small">
+						<el-option label="鍏ㄩ儴" :value="null"></el-option>
+						<el-option label="鍚堟牸" :value="1"></el-option>
+						<el-option label="涓嶅悎鏍�" :value="0"></el-option>
+					</el-select>
+				</el-form-item>
+			</el-form>
+			<el-button size="small" type="primary" @click="selectDataList">鏌ヨ</el-button>
+			<el-button size="small" @click="cleanBtn">閲嶇疆</el-button>
+			<el-checkbox style="margin-left: 10px;" @change="selectDataList" v-model="isLookMe">鍙湅鎴�</el-checkbox>
 		</div>
 		<div class="thing">
 			<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="code" label="鐢宠鍗曞彿" width="200px">
+				<el-table-column prop="code" label="鐢宠鍗曞彿" width="250px">
 					<template slot-scope="scope">
 						<div style="display: flex;">
 							<div v-if="scope.row.orderNum=='01'" style="color: #3caaff;background-color: #eff5ff;" class="order_num">
@@ -76,7 +86,7 @@
 						</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="unit" label="鍗曚綅">
 				</el-table-column>
@@ -88,12 +98,14 @@
 				</el-table-column>
 				<el-table-column prop="checker" label="鎵ц浜�">
 				</el-table-column>
-				<el-table-column prop="instrumentname" label="妫�楠屾棩鏈�">
+				<el-table-column prop="instrumentname" label="妫�楠岃澶�">
 				</el-table-column>
-				<el-table-column prop="testState" label="妫�楠岀姸鎬�">
+				<el-table-column prop="testState" label="妫�楠岀姸鎬�" width="100px">
 					<template slot-scope="scope">
-						<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>
+						<el-tag type="success" effect="dark" v-if="scope.row.children!=undefined&&scope.row.testState!=null">宸蹭笂鎶�</el-tag>
+						<el-tag type="danger" effect="dark" v-else-if="scope.row.children!=undefined&&scope.row.testState==null">鏈笂鎶�</el-tag>
+						<el-tag type="success" v-else-if="scope.row.children==undefined&&scope.row.testState!=null">宸叉楠�</el-tag>
+						<el-tag type="danger" v-else-if="scope.row.children==undefined&&scope.row.testState==null">鏈楠�</el-tag>
 					</template>
 				</el-table-column>
 				<el-table-column prop="startTime" label="妫�楠屽紑濮�" width="100px">
@@ -102,12 +114,12 @@
 				</el-table-column>
 				<el-table-column label="鎿嶄綔" width="150">
 					<template slot-scope="scope">
-						<el-button size="mini" type="primary" v-if="isIfReport(scope.row)"
+						<el-button size="mini" :disabled="!isIfReport(scope.row)" type="primary" v-if="scope.row.orderNum == '01'"
 							@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>
+							v-if="scope.row.orderNum=='02'&&scope.row.children==undefined&&scope.row.testState==null">鍒嗛厤</el-button>
 						<el-button size="mini" type="text" @click="openUpInsDia(scope.row)"
-							v-if="scope.row.orderNum=='02'">妫�楠�</el-button>
+							v-if="scope.row.orderNum=='02'&&scope.row.children==undefined&&scope.row.testState==null">妫�楠�</el-button>
 					</template>
 				</el-table-column>
 			</el-table>
@@ -117,7 +129,7 @@
 				<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-select v-model="upData.checker" size="medium" clearable style="width: 100%;">
+						<el-select @change="selectChecker" 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>
@@ -135,7 +147,7 @@
 				<el-button @click="upDia = false">鍙� 娑�</el-button>
 			</span>
 		</el-dialog>
-		<el-dialog title="妫�楠�" :visible.sync="upInsDia" width="500px">
+		<el-dialog title="妫�楠�" :visible.sync="upInsDia" width="600px">
 			<div class="body" style="max-height: 50vh;overflow-y: auto;">
 				<el-row style="line-height: 46px;">
 					<el-col :span="5" style="font-size: 14px;text-align: right;">鐢宠鍗曠紪鐮侊細</el-col>
@@ -156,7 +168,7 @@
 					<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="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>
@@ -178,7 +190,7 @@
 									</el-input>
 								</template>
 							</el-table-column>
-							<el-table-column label="鎿嶄綔" width="60">
+							<el-table-column label="鎿嶄綔" width="80">
 								<template slot-scope="scope">
 									<el-button size="mini" type="text"
 										@click.native.prevent="deleteRow(scope.$index, upData.testValue)">鍒犻櫎</el-button>
@@ -207,9 +219,9 @@
 		data() {
 			return {
 				search: {
-					name: null,
+					code: null,
 					date: [],
-					userName: null,
+					testValue: null,
 				},
 				tableData: [],
 				upDia: false,
@@ -218,7 +230,8 @@
 				upInsDia: false,
 				upIndex2: 0,
 				users: [],
-				devices: []
+				devices: [],
+				isLookMe: false
 			}
 		},
 		mounted() {
@@ -228,7 +241,17 @@
 		},
 		methods: {
 			selectDataList() {
-				get(this.$url.selectAllPlan).then(res => {
+				var str = {}
+				str.code = this.search.code
+				str.isLookMe=this.isLookMe
+				str.status = this.search.testValue
+				try {
+					if (this.search.date.length != 0) {
+						str.beginTime = this.search.date[0]
+						str.endTime = this.search.date[1]
+					}
+				} catch (e) {}
+				get(this.$url.selectAllPlan, str).then(res => {
 					this.tableData = JSON.parse(JSON.stringify(res.data).replaceAll('pid', 'code').replaceAll('samplename',
 						'name').replaceAll('inspectionStatus', 'testState'))
 					this.tableData.forEach(a => {
@@ -251,18 +274,24 @@
 				row.children.forEach(a => {
 					if (a.testState != null && a.testState != undefined) count++
 				})
-				return row.testState == undefined && row.orderNum == '01' && count == row
+				return row.testState == undefined && count == row
 					.children.length
 			},
 			openUpDia(row) {
+				// console.log(row);
 				this.upDia = true
 				this.upData = {
 					id: row.code,
 					checker: null,
 					device: null
 				}
+				this.upData.checker=row.uId
+				this.upData.device=row.isuId
 			},
 			submitUpData() {
+				// console.log(this.upData.device);
+				// console.log(this.devices);
+				// return;
 				if (this.upData.checker == null || this.upData.checker == '') {
 					this.$message.error('浜哄憳鏈垎閰�')
 					return
@@ -279,6 +308,9 @@
 					this.upDia = false
 					this.selectDataList()
 				})
+			},
+			selectChecker(){
+				// console.log(this.upData.checker);
 			},
 			openUpInsDia(row) {
 				this.upInsDia = true
@@ -331,16 +363,33 @@
 			submitUpData2() {
 				var data = []
 				this.upData.testValue.forEach(a => {
-					data.push(a.number)
+					if (a.number != '' && a.number != null) {
+						data.push(a.number)
+					}
 				})
 				wpost(this.$url.check, {
 					id: this.upData.code,
 					value: data.toString()
 				}).then(res => {
-					this.$message.success('鎻愪氦鎴愬姛')
 					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(() => {})
 				})
+			},
+			cleanBtn(){
+				this.search = {
+					code: null,
+					date: [],
+					testValue: null,
+				}
+				this.selectDataList()
 			}
 		}
 	}

--
Gitblit v1.9.3