瀏覽代碼

返回值的问题

yyfang 3 年之前
父節點
當前提交
fff109df3e

+ 30 - 20
src/components/admin/addTaskJcObject copy.vue

@@ -16,31 +16,27 @@
 			</el-form-item>
 			<el-form-item prop="sample_address" label="地区"   >
 				<el-cascader  :options="region" v-model="sample_address"
-					@change="handleChange">
+					@change="handleChange" clearable>
 				</el-cascader>
 			</el-form-item>
+
+				<!-- <el-form-item prop="sample_address" label="地区"   >
+					<el-cascader :options="options" :props="props" v-model="sample_address" clearable ></el-cascader>
+				</el-form-item> -->
+
+
+
 		<!-- 底部按钮 -->
 			<el-form-item>
 				<el-button type="success" @click="onSubmit()">保存</el-button>
 				<el-button @click="reBack">返回</el-button>
 			</el-form-item>
 		</el-form>
-
+<!-- 抽样机构 -->
 		<!-- 选择抽样机构对话框 -->
 		<template scope-slot="scope">
 			<el-dialog title="机构选择" :visible.sync="getOrganizationsShow1" width="50%" :close-on-click-modal="false" @open="getOrganizations1()" class="dialogItem">
 			<el-form v-if="getOrganizationsShow1" :model="getOrganizationsForm1">
-									<!-- 检索功能 -->
-									<!-- <el-row :gutter="20">
-										<el-col :span="6">
-											<el-form-item label="单位名称" >
-													<el-input v-model="queryInfo1.name"></el-input>
-											</el-form-item>
-										</el-col>
-										<el-col :span="6">
-											<el-button type="success" @click="search()" style="margin-top:40px">搜索</el-button>
-										</el-col>
-									</el-row> -->
 			<!--  表格数据区域-->
 				<el-table ref="multipleTable" :data="testList" row-key="id" @selection-change="handleSelectionChange1"
 					border stripe highlight-current-row style="width: 100%">
@@ -54,7 +50,7 @@
 						:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
 				</el-table>
 		<div class="footer">
-<!--抽样机构分页器区域-->
+	<!--抽样机构分页器区域-->
 			<el-pagination @size-change="handleSizeChange1" @current-change="handleCurrentChange1"
 				:current-page="queryInfo1.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo1.pageSize"
 				layout="total, sizes, prev, pager, next, jumper" :total="total" background />
@@ -65,7 +61,7 @@
 		</el-dialog>
 		</template>
 		
-
+<!-- 检测机构 -->
 		<!-- 选择检测机构对话框 -->
 		<el-dialog title="机构选择" :visible.sync="getOrganizationsShow2" width="50%" :close-on-click-modal="false" @open="getOrganizations2()" class="dialogItem">
 			<el-form v-if="getOrganizationsShow2" :model="getOrganizationsForm2">
@@ -82,7 +78,7 @@
 						:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
 				</el-table>
 				<div class="footer">
-<!--检测机构分页器区域-->
+	<!--检测机构分页器区域-->
 					<el-pagination @size-change="handleSizeChange2" @current-change="handleCurrentChange2"
 						:current-page="queryInfo2.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo2.pageSize"
 						layout="total, sizes, prev, pager, next, jumper" :total="total2" background />
@@ -92,7 +88,18 @@
 			</el-form>
 		</el-dialog>
 			
-
+<!-- 地区表格区域 -->
+			<el-table ref="multipleTable" :data="regionList" row-key="id" @selection-change="handleSelectionChange3"
+					border stripe highlight-current-row style="width: 100%">
+					<el-table-column type="selection" :reserve-selection="true" width="50"></el-table-column>
+					<el-table-column label="序号" width="50px">
+						<template slot-scope="scope">
+							{{ scope.$index+1 }}
+						</template>
+					</el-table-column>
+					<el-table-column :key="table.prop" v-for="table in tableHeader3" :label="table.label"
+						:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
+			</el-table>
 	</div>
 </template>
 <script>
@@ -106,6 +113,8 @@ import {
 	export default {
 		data() {
 			return {
+				// 地区单选
+				props: { multiple: true },
 				CodeToText:'',
 					form: {
 					// name:'',
@@ -117,7 +126,7 @@ import {
 					groupname:'',
 					properties:'',
 					main_unit:[],
-					check_unit:[],
+					check_unit:[], 
 					sample_org_id:'',
 					check_org_id:''
 				},
@@ -147,8 +156,9 @@ import {
 				// 	label: '企业'
 				// }],
 				// 抽样地区
-				region: regionData,
-				sample_address:'',
+				// region: regionData,
+				region: regionData[11].children,
+				sample_address:[],
 				// 机构地域表格数据
 				underTask: [],
 				underTasktotal: 0,

+ 25 - 9
src/components/admin/addTaskJcObject.vue

@@ -89,17 +89,12 @@
 		</el-dialog>
 			
 <!-- 地区表格区域 -->
-			<el-table ref="multipleTable" :data="regionList" row-key="id" @selection-change="handleSelectionChange3"
-					border stripe highlight-current-row style="width: 100%">
-					<el-table-column type="selection" :reserve-selection="true" width="50"></el-table-column>
-					<el-table-column label="序号" width="50px">
-						<template slot-scope="scope">
-							{{ scope.$index+1 }}
-						</template>
-					</el-table-column>
+			<div class="diqubiaoge">
+				<el-table  ref="multipleTable" :data="regionList" row-key="id" border stripe highlight-current-row >
 					<el-table-column :key="table.prop" v-for="table in tableHeader3" :label="table.label"
 						:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
-			</el-table>
+				</el-table>
+			</div>
 	</div>
 </template>
 <script>
@@ -220,6 +215,8 @@ import {
 				testList: [],
 				// 检测机构列表
 				testList2: [],
+				// 地区
+				regionList: [],
 				// 表头
 				tableHeader: [{
 						label: '单位名称',
@@ -239,6 +236,20 @@ import {
 						// fixed: 'left'
 					}
 				],
+				tableHeader3:[{
+					label: '抽样机构',
+					prop:'form.main_unit',
+					width:260,
+				},{
+					label: '检测机构',
+					prop:'form.check_unit',
+					width:260,
+				},{
+					label: '地区',
+					prop:'sample_address',
+					// width:260,
+				},
+				],
 				// 总共多少条数据
 				total: 0,
 				total2: 0,
@@ -434,4 +445,9 @@ import {
 		flex-direction: row;
 		justify-content: space-between;
 	}
+	.diqubiaoge{
+		display: flex;
+        justify-content: center;
+		 width: 50%
+	}
 </style>

+ 23 - 23
src/components/admin/addTaskJd.vue

@@ -131,29 +131,29 @@
 			 this.task_class = this.$route.params.task_class
 			 this.postTasks()
 		},
-		mounted() {
-			let that = this
-			// this.$nextTick(() => {
-			// 	console.log(that.multipleSelection)
-			//         that.multipleSelection.forEach((row) => {
-			//           that.$refs.multipleTable.toggleRowSelection(
-			//             that.testList.find((item) => {
-			//               return row==item; 
-			//             }),
-			//             true
-			//           );
-			//         });
-			//       });
-			// this.$nextTick(() => {
-			//   this.testList.forEach(outerItem => {
-			//     this.multipleSelection[this.page.current - 1] && this.multipleSelection[this.page.current - 1].forEach(item => {
-			//       if(outerItem.id == item.id) {
-			//         this.$refs.multipleTable.toggleRowSelection(outerItem,true);
-			//       }
-			//     })
-			//   })
-			// })
-		},
+		// mounted() {
+		// 	let that = this
+		// 	// this.$nextTick(() => {
+		// 	// 	console.log(that.multipleSelection)
+		// 	//         that.multipleSelection.forEach((row) => {
+		// 	//           that.$refs.multipleTable.toggleRowSelection(
+		// 	//             that.testList.find((item) => {
+		// 	//               return row==item; 
+		// 	//             }),
+		// 	//             true
+		// 	//           );
+		// 	//         });
+		// 	//       });
+		// 	// this.$nextTick(() => {
+		// 	//   this.testList.forEach(outerItem => {
+		// 	//     this.multipleSelection[this.page.current - 1] && this.multipleSelection[this.page.current - 1].forEach(item => {
+		// 	//       if(outerItem.id == item.id) {
+		// 	//         this.$refs.multipleTable.toggleRowSelection(outerItem,true);
+		// 	//       }
+		// 	//     })
+		// 	//   })
+		// 	// })
+		// },
 		methods: {
 			//保存
 			async onSubmit() {

+ 7 - 3
src/components/admin/getJcds.vue

@@ -15,7 +15,7 @@
         <!-- 操作 -->
         <el-table-column label="操作" align="center" fixed="right">
         <template slot-scope="scope">
-            <el-button @click="read(scope.row.task_id,scope.row.id)" style="margin:5px 0" type="success" size="small" >查看检测单列表</el-button>
+            <el-button @click="read(scope.row.task_id,scope.row.id)" style="margin:5px 0" type="primary" size="small" >查看检测单列表</el-button>
         </template>
         </el-table-column>
     </el-table>
@@ -102,7 +102,8 @@ export default {
                         task_id:this.$route.params.id
                         }
                 })
-            }else{
+            }
+            else if(this.parentName == '退回任务'){
                  this.$router.push({
                     name:'reTask',
                     params:{
@@ -132,9 +133,12 @@ export default {
 					name:'readCheckList',
 					params: {
 					task_id:task_id,
-                    task_profile_id:id
+                    task_profile_id:id,
+                    parentName:this.parentName,
 					}
+                    
 				})
+                console.log(parentName)
 		},
           //分页器
                 handleSizeChange(val) {

+ 6 - 1
src/components/admin/readCheck.vue

@@ -52,6 +52,7 @@
 		name: 'inputSample',
 		data() {
 			return {
+				parentName:'',
 				myHeaders: {Authorization: 'bearer' + token},
 				fileList: [],
 				form: {},
@@ -101,6 +102,8 @@
 			this.task_id = this.$route.params.task_id
 			this.task_profile_id = this.$route.params.task_profile_id
 			this.jcd_id = this.$route.params.jcd_id
+			this.parentName = this.$route.params.parentName
+			console.log(this.parentName)
 			// console.log(this.task_id)
 			// console.log(this.task_profile_id)
 			this.getJcd()
@@ -143,9 +146,11 @@
 					name: 'readCheckList',
 					params: {
 						task_id: this.$route.params.task_id,
-						task_profile_id: this.$route.params.task_profile_id
+						task_profile_id: this.$route.params.task_profile_id,
+						parentName:this.parentName
 					}
 				})
+				console.log(parentName)
 			}
 		},
 	}

+ 8 - 3
src/components/admin/readCheckList.vue

@@ -5,6 +5,7 @@
 	    <div slot="header" class="clearfix">
             <el-breadcrumb separator-class="el-icon-arrow-right">		
             <el-breadcrumb-item >首页</el-breadcrumb-item>
+            <el-breadcrumb-item >{{parentName}}</el-breadcrumb-item>
             <el-breadcrumb-item>查看检测单列表</el-breadcrumb-item>
             </el-breadcrumb>
 		</div>
@@ -141,6 +142,8 @@ export default{
        this.cyd_id = this.$route.params.cyd_id
        this.task_id = this.$route.params.task_id,
        this.task_profile_id = this.$route.params.task_profile_id
+       this.parentName = this.$route.params.parentName
+       console.log(this.parentName)
        this.getJcds()
     //    this.getSamples()
    },
@@ -203,7 +206,8 @@ export default{
             this.$router.push({
                 name:'getJcds',
                 params:{
-                    id: this.$route.params.task_id
+                    id: this.$route.params.task_id,
+                    parentName:this.parentName,
                 }
             })
         },
@@ -221,14 +225,15 @@ export default{
                 this.tableData2 = res.data.rows
                 console.log(res.data.rows)
         },
-        //查看检测单
+        //查看检测单详情
          getCheckList(id){
             this.$router.push({
                 name:'readCheck',
                 params:{
                    jcd_id: id,
                    task_id:this.$route.params.task_id,
-                   task_profile_id:this.$route.params.task_profile_id
+                   task_profile_id:this.$route.params.task_profile_id,
+                   parentName:this.parentName,
                 }
             })
         },