From bd4fdac0fee9cf4f96dd947fef6f6ae950a450fe Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期五, 01 九月 2023 17:07:48 +0800
Subject: [PATCH] 	modified:   package.json 	modified:   src/components/experiment/template_testReport/index.vue 	modified:   src/views/experiment/checkTheReport/index.vue 	modified:   src/views/experiment/inspectionApplication/index.vue 	modified:   src/views/inspectionManagement/commissionInspection/index.vue 	modified:   src/views/inspectionManagement/reportForInspection/index.vue

---
 src/views/experiment/inspectionApplication/index.vue          |   26 ++++--
 package.json                                                  |    1 
 src/views/inspectionManagement/reportForInspection/index.vue  |    1 
 src/components/experiment/template_testReport/index.vue       |  152 +++++++++++++++++++++----------------
 src/views/experiment/checkTheReport/index.vue                 |    6 +
 src/views/inspectionManagement/commissionInspection/index.vue |    1 
 6 files changed, 108 insertions(+), 79 deletions(-)

diff --git a/package.json b/package.json
index 4767215..112973e 100644
--- a/package.json
+++ b/package.json
@@ -22,6 +22,7 @@
     "element-ui": "2.13.2",
     "html2pdf.js": "^0.10.1",
     "js-cookie": "2.2.0",
+    "moment": "^2.29.4",
     "normalize.css": "7.0.0",
     "nprogress": "0.2.0",
     "path-to-regexp": "2.4.0",
diff --git a/src/components/experiment/template_testReport/index.vue b/src/components/experiment/template_testReport/index.vue
index 3fa121c..f9bf7f2 100644
--- a/src/components/experiment/template_testReport/index.vue
+++ b/src/components/experiment/template_testReport/index.vue
@@ -174,57 +174,73 @@
 									<span>妫�楠岀被鍨�</span><br>
 									<span>Type of test</span>
 								</td>
-								<td colspan="2"></td>
+								<td colspan="2">
+									{{reportData.type === 0 ? "鍘熸潗鏂欐楠�" : (reportData.type === 1 ? "濮旀墭妫�楠�" : "鎴愬搧妫�楠�")}}
+								</td>
 							</tr>
 							<tr>
 								<td>
 									<span>鏍峰搧鐘舵��</span><br>
 									<span>Sample discription</span>
 								</td>
-								<td colspan="2"></td>
+								<td colspan="2">/</td>
 								<td>
 									<span>鐢熶骇鍗曚綅</span><br>
 									<span>Producer</span>
 								</td>
-								<td colspan="2"></td>
+								<td colspan="2">
+									{{reportData.supplier}}
+								</td>
 							</tr>
 							<tr>
 								<td>
-									<span>鏀舵牱鏃堕棿</span><br>
+									<span>閫佹牱鏃堕棿</span><br>
 									<span>Received date</span>
 								</td>
-								<td colspan="2"></td>
+								<td colspan="2">
+									
+								</td>
 								<td>
 									<span>妫�楠屾棩鏈�</span><br>
 									<span>Test date</span>
 								</td>
-								<td colspan="2"></td>
+								<td colspan="2">
+									{{reportData.createTime}}
+								</td>
 							</tr>
 							<tr>
 								<td>
 									<span>濮旀墭浜�</span><br>
 									<span>Consignor</span>
 								</td>
-								<td colspan="2"></td>
+								<td colspan="2">
+									{{enterprise.linkName}}
+								</td>
 								<td>
 									<span>鐢佃瘽</span><br>
 									<span>Tel</span>
 								</td>
-								<td colspan="2"></td>
+								<td colspan="2">
+									{{enterprise.linkPhone}}
+								</td>
 							</tr>
 							<tr>
 								<td>
 									<span>濮旀墭鍗曚綅</span><br>
 									<span>Client</span>
 								</td>
-								<td colspan="5"></td>
+								<td colspan="5">
+									{{enterprise.name}}
+								</td>
 							</tr>
 							<tr>
 								<td>
 									<span>濮旀墭鍗曚綅鍦板潃</span><br>
 									<span>Address</span>
 								</td>
-								<td colspan="5"></td>
+								<td colspan="5">
+									{{enterprise.address}}
+								</td>
 							</tr>
 							<tr>
 								<td>
@@ -246,12 +262,12 @@
 									<span>Conclusion </span>
 								</td>
 								<td colspan="5">
-									<div style="height: 120px;"></div>
+									<div style="padding-left: 20px;width:100%;text-align:left; font-size:18px;height: 120px;line-height: 120px;">{{reportData.inspectionStatus === 1 ? "鍚堟牸" : "涓嶅悎鏍�"}}</div>
 									<div style="height: 60px;margin-left: 250px;">
 										<span>锛堟娴嬫姤鍛婁笓鐢ㄧ珷锛�</span><br>
 										<span>( SPECIFIC STAMP FOR TEST RTORT) </span><br>
-										<span>绛惧彂鏃ユ湡锛� 骞� 鏈� 鏃�</span><br>
-										<span>Date of issue: August 23, 2023</span>
+										<span>绛惧彂鏃ユ湡锛� {{formattedDate('yyyy骞碝M鏈圖D鏃�','zh-cn') }}</span><br>
+										<span>Date of issue: {{formattedDate('LL','en-ca') }}</span>
 									</div>
 								</td>
 							</tr>
@@ -267,7 +283,7 @@
 									<span>缂栧埗</span><br>
 									<span>Preparer</span>
 								</td>
-								<td colspan="2"></td>
+								<td colspan="2">{{reportData.preparerName}}</td>
 								<td>
 									<span>妫�楠�</span><br>
 									<span>Tester</span>
@@ -308,8 +324,8 @@
 				<div class="table">
 					<div class="table-header">
 						<div>
-							<span>鎶ュ憡缂栧彿锛�</span><br>
-							<span>Reference No锛�</span>
+							<span>鎶ュ憡缂栧彿锛歿{reportData.rcode}}</span><br>
+							<span>Reference No锛歿{reportData.rcode}}</span>
 						</div>
 						<div>
 							<span>绗�2椤靛叡2椤�</span><br>
@@ -323,12 +339,12 @@
 									<span>鏍峰搧缂栧彿</span><br>
 									<span>Sample No</span>
 								</td>
-								<td colspan="3"></td>
+								<td colspan="3">{{reportData.imCode}}</td>
 								<td colspan="4">
 									<span>瑙勬牸鍨嬪彿</span><br>
 									<span>Type</span>
 								</td>
-								<td colspan="3"></td>
+								<td colspan="3">{{reportData.specifications}}</td>
 							</tr>
 							<tr>
 								<td>
@@ -356,53 +372,35 @@
 									<span>Conclusion</span>
 								</td>
 							</tr>
-							<tr>
-								<td>
-									<span></span><br>
-									<span></span>
-								</td>
-								<td colspan="3">
-									<span>鏍峰搧鏍囪瘑</span><br>
-									<span>Sample labeling</span>
-								</td>
-								<td>
-									<span></span><br>
-									<span>I</span>
-								</td>
-								<td colspan="3">
-									<span></span><br>
-									<span></span>
-								</td>
-								<td colspan="3">
-									<span></span><br>
-									<span></span>
-								</td>
-								<td>
-									<span></span><br>
-									<span></span>
-								</td>
-							</tr>
 							<tr v-for="(item, index) in resultTable" :key="index">
 								<td>
-									<span>{{ item.id }}</span><br>
+									<span>{{ index + 1 }}</span><br>
 								</td>
 								<td colspan="3">
-									<span>{{ item.testitem }}</span><br>
-									<span>{{ item.testitem_engName }}</span>
+									<span>{{ item.ipName }}</span>
 								</td>
 								<td>
 									<span>{{ item.unit }}</span>
 								</td>
 								<td colspan="3">
-									<span>{{ item.requirement }}</span><br>
-									<span>{{ item.requirement_eng }}</span>
+									<span>{{ item.required }}</span><br>
 								</td>
 								<td colspan="3">
-									<span>{{ item.testresult }}</span><br>
-									<span>{{ item.testresult_engName }}</span>
+									<span>{{ item.testValue }}</span><br>
 								</td>
 								<td>
-									<span>{{ item.conclusion }}</span>
+									<span>{{ isIfState(item.testState) }}</span>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									<span>澶囨敞:</span><br/>
+									<span>remarks:</span>
+								</td>
+								<td colspan="13">
+									鈥溾垰鈥濊〃绀洪」鐩悎鏍硷紝鈥溍椻�濊〃绀洪」鐩笉鍚堟牸,鈥滐紞鈥濊〃绀轰笉瑕佸垽瀹氾紝鈥滐紡鈥濊〃绀烘病鏈夋爣鍑嗚姹傘��
+									鈥溾垰鈥� indicates test Item is qualified锛屸�溍椻�� indicates test Item is unqualified,
+									鈥滐紞鈥� indicates test Item  judgment is not required,鈥滐紡鈥� indicates test Item is no test requirement .
 								</td>
 							</tr>
 						</table>
@@ -412,8 +410,8 @@
 			<div class="pageFour">
 				<div class="page-header" style="display: flex;justify-content: space-between;font-size: 12px;">
 					<div>
-						<span>鎶ュ憡缂栧彿锛�</span><br>
-						<span>Reference No锛�</span>
+						<span>鎶ュ憡缂栧彿锛歿{reportData.rcode}}</span><br>
+						<span>Reference No锛歿{reportData.rcode}}</span>
 					</div>
 					<div>
 						<span>闄勯〉</span><br>
@@ -474,6 +472,7 @@
 								</td>
 							</tr>
 						</table>
+						<p style="width:100%;text-align: center;font-size: 15px;">------浠ヤ笅绌虹櫧锛團ollowing Blank锛�------</p>
 					</div>
 				</div>
 			</div>
@@ -482,6 +481,7 @@
 </template>
 
 <script>
+	import moment from 'moment';
 	import {
 		get,
 		post,
@@ -489,19 +489,9 @@
 	} from "@/api/util/requestUtil.js"
 	export default {
 		name: 'TestReport',
-		props: ["reportData"],
 		data() {
 			return {
-				resultTable: [{
-					id: '1',
-					testitem: '鍘熷鎷変几',
-					testitem_engName: 'Primitive strength',
-					unit: 'MPa',
-					requirement: '鏈�灏�10.0',
-					requirement_eng: 'Minimun 10.0',
-					testresult: '',
-					testitem_engName: ''
-				}],
+				resultTable: [],
 				table: [{
 					id: 1,
 					equipment_name: '鎷栨媺鏈�',
@@ -516,7 +506,8 @@
 			}
 		},
 		mounted() {
-			this.getEnterprise()
+			this.initResultData();
+			this.getEnterprise();
 			if (Object.keys(this.reportData).length > 0) {
 				this.reData.productNames = ''
 				this.reportData.products.forEach(a=>{
@@ -526,12 +517,39 @@
 			}
 		},
 		methods: {
+			initResultData(){
+				this.resultTable = this.reportData.products;
+				if (this.resultTable.length < 15) {
+					let size = this.resultTable.length;
+					let num = 15 - size;
+					for (let i = 0; i < num; i++) {
+						this.resultTable.push({
+							code: null,
+							ipName: "",
+							required: "",
+							testState: null,
+							testValue: "",
+							unit: ""
+						})
+					}
+				}
+			},
+			isIfState(val) {
+				if (val === 1) return "鈭�"
+				else if (val === null || val === undefined) return null
+				else return "X"
+			},
+			formattedDate(fmt,local) {
+				moment.locale(local);
+				return moment().format(fmt);
+			},
 			getEnterprise() {
 				get("/report/getEnterprise").then(res => {
 					this.enterprise = res.data
 				})
 			}
-		}
+		},
+		props: ["reportData"],
 	}
 </script>
 
diff --git a/src/views/experiment/checkTheReport/index.vue b/src/views/experiment/checkTheReport/index.vue
index 1d97b93..9552c34 100644
--- a/src/views/experiment/checkTheReport/index.vue
+++ b/src/views/experiment/checkTheReport/index.vue
@@ -177,18 +177,20 @@
 			TestReport
 		},
 		methods: {
-			async queryReportByRCode(code) {
+			async queryReportByRCode(code,name) {
 				const resp = await getReportData({
 					code: code
 				});
 				this.reportData = resp.data;
+				this.reportData.preparerName = name;
 				this.dialogVisible = true;
 				console.log(this.reportData);
 			},
 			//鏌ョ湅鎶ュ憡鎸夐挳
 			previewFun(row) {
 				this.reportType = row.type;
-				this.queryReportByRCode(row.reportCode);
+				this.queryReportByRCode(row.reportCode,row.name);
+				
 			},
 			handleSelectionChange(selection) {
 				this.selectedRows = selection;
diff --git a/src/views/experiment/inspectionApplication/index.vue b/src/views/experiment/inspectionApplication/index.vue
index bcce505..be7fb86 100644
--- a/src/views/experiment/inspectionApplication/index.vue
+++ b/src/views/experiment/inspectionApplication/index.vue
@@ -609,8 +609,12 @@
 			},
 			reset() {
 				this.countSize = 1;
-				this.pageSize = 8;
-				this.searchData = {};
+				this.pageSize = 10;
+				this.searchData = {
+					applicationnumber: '',
+					type: '',
+					state: '',
+				};
 				this.selectInspectsList();
 			},
 			//琚�変腑鐨勪俊鎭� 鍗曢��
@@ -770,12 +774,18 @@
 				this.addInspection()
 			},
 			delInspect(row){
-				delInspect({
-					id: row.id
-				}).then(res=>{
-					this.$message.success('宸蹭綔搴�')
-					this.selectInspectsList()
-				})
+				this.$confirm('鎮ㄧ‘璁ゅ垹闄よ繖鏉℃暟鎹悧?', '鎻愮ず', {
+					confirmButtonText: '纭畾',
+					cancelButtonText: '鍙栨秷',
+					type: 'warning'
+				}).then(() => {
+					delInspect({
+						id: row.id
+					}).then(()=>{
+						this.$message.success('宸蹭綔搴�')
+						this.selectInspectsList()
+					})
+				}).catch(() => {});
 			}
 		}
 	}
diff --git a/src/views/inspectionManagement/commissionInspection/index.vue b/src/views/inspectionManagement/commissionInspection/index.vue
index 2fa91e2..783bb85 100644
--- a/src/views/inspectionManagement/commissionInspection/index.vue
+++ b/src/views/inspectionManagement/commissionInspection/index.vue
@@ -71,7 +71,6 @@
 							<el-table-column prop="inspectionTime" label="閫佹牱鏃堕棿" min-width="8%" />
 							<el-table-column prop="completionDeadline" label="瀹屾垚鏈熼檺" min-width="8%" />
 							<el-table-column prop="contacts" label="濮旀墭缂栧埗浜�" min-width="8%" />
-							<el-table-column prop="insTime" label="妫�楠屾棩鏈�" min-width="8%" />
 							<el-table-column prop="inspection_status" label="鐘舵��" min-width="8%">
 								<template slot-scope="scope">
 									<div v-if="scope.row.inspection_status === 0">
diff --git a/src/views/inspectionManagement/reportForInspection/index.vue b/src/views/inspectionManagement/reportForInspection/index.vue
index 2b88e61..f89e215 100644
--- a/src/views/inspectionManagement/reportForInspection/index.vue
+++ b/src/views/inspectionManagement/reportForInspection/index.vue
@@ -84,7 +84,6 @@
 						<el-table-column prop="quantity" label="鏁伴噺" min-width="5%" />
 						<el-table-column prop="inspectionDate" label="鎶ユ鏃ユ湡" min-width="8%" />
 						<el-table-column prop="surveyor" label="妫�楠屼汉" min-width="8%" />
-						<el-table-column prop="insTime" label="妫�楠屾棩鏈�" min-width="8%" />
 						<el-table-column prop="type" label="鐘舵��" min-width="8%">
 							<template slot-scope="scope">
 								<span :style="{ color: scope.row.type === 1 ? 'green' : 'red' }">

--
Gitblit v1.9.3