yyfang před 3 roky
rodič
revize
bf47643db8

+ 17 - 17
src/components/admin.vue

@@ -94,23 +94,23 @@
 				menuList: []
 			}
 		},
-		watch: {
-			/** 监听,当路由发生变化的时候执行(防止用户手动更换地址导致tabs的面板变动却不切换相应的tabs) */
-			'$route.path': function() {
-				var iindex = -1
-				var jindex = -1
-				for (let i = 0; i < this.menuList.length; i++) {
-					for (let j = 0; j < this.menuList[i].children.length; j++) {
-						if (this.menuList[i].children[j].path == this.$route.path) {
-							iindex = i
-							jindex = j
-							break
-						}
-					}
-				}
-				this.addTab(this.menuList[iindex].children[jindex].subMenuName, this.$route.path)
-			}
-		},
+		// watch: {
+		// 	/** 监听,当路由发生变化的时候执行(防止用户手动更换地址导致tabs的面板变动却不切换相应的tabs) */
+		// 	'$route.path': function() {
+		// 		var iindex = -1
+		// 		var jindex = -1
+		// 		for (let i = 0; i < this.menuList.length; i++) {
+		// 			for (let j = 0; j < this.menuList[i].children.length; j++) {
+		// 				if (this.menuList[i].children[j].path == this.$route.path) {
+		// 					iindex = i
+		// 					jindex = j
+		// 					break
+		// 				}
+		// 			}
+		// 		}
+		// 		this.addTab(this.menuList[iindex].children[jindex].subMenuName, this.$route.path)
+		// 	}
+		// },
 		created() {
 			this.lastTime = new Date().getTime() // 网页第一次打开时,记录当前时间
 			// 保证admin中的页面刷新后重置到/admin路由下

+ 30 - 24
src/components/admin/addTask.vue

@@ -4,12 +4,10 @@
 
 			<el-breadcrumb-item>首页</el-breadcrumb-item>
 			<el-breadcrumb-item>监测任务</el-breadcrumb-item>
-			<el-breadcrumb-item>例行监测</el-breadcrumb-item>
-			<el-breadcrumb-item :to="{path:'/admin/routineMonitor'}">任务列表</el-breadcrumb-item>
-			<el-breadcrumb-item>添加任务</el-breadcrumb-item>
+			<el-breadcrumb-item>新增任务</el-breadcrumb-item>
 		</el-breadcrumb>
 		<div class="title">
-			例行监测
+			新增任务
 		</div>
 
 		<el-form :model="form" label-width="100px">
@@ -73,7 +71,7 @@
 			</el-form-item>
 			<el-form-item>
 				<el-button type="success" @click="onSubmit()">保存</el-button>
-				<el-button type="success" @click="nextStep()">下一步</el-button>
+				<el-button type="success" @click="nextStep(id)">下一步</el-button>
 				<el-button @click="reBack()">返回</el-button>
 			</el-form-item>
 		</el-form>
@@ -85,6 +83,7 @@
 	export default {
 		data() {
 			return {
+				task_class:'',
 				// rymc: rymc,		//从本地缓存获取发布单位
 				myHeaders: {
 					Authorization: 'bearer'+ token			//上传文件添加token
@@ -92,6 +91,7 @@
 				// 任务表单
 				form: {
 					main_unit: [],	
+					task_id:''
 				},
 				// 优先级选项
 				priority: [{
@@ -129,7 +129,9 @@
 			}
 		},
 		created() {
-			
+			 this.task_class = this.$route.params.task_class
+			 this.task_id = this.$route.params.task_id
+			 this.postTasks()
 		},
 		mounted() {
 			let that = this
@@ -163,9 +165,11 @@
 				this.form['releaser'] = window.sessionStorage.getItem('rymc')
 				this.form['task_class'] = '例行监测'
 				this.form['ispublic'] = 0
+				this.form['task_id'] = this.task_id
 				const result = await this.$http.post('postTasks', this.form)
-				
-				
+					this.task_id = result.data.data.task_id
+					console.log( this.task_id)
+					// console.log( result.data.data)
 				// 判断业务逻辑
 				if (result.code == 0) {
 						this.$message({
@@ -185,23 +189,25 @@
 				this.$router.push('routineMonitor')
 			},
 			//下一步
-			nextStep(id){
-			console.log(id)
-			this.$router.push({
-				name:'addTaskJcObject',
-				params:{
-					task_id:id
-				}
-			})
+			nextStep(){
+				var that = this
+				this.$router.push({
+					name:'addTaskJcObject',
+					params:{
+						 task_id: that.task_id
+					}
+				})
+				console.log(that.task_id)
+				console.log(task_id)
 			},			
 			// 获取任务列表
-			// async postTasks() {
-			// 	const result = await this.$http.post('postTasks', this.queryInfo)
+			async postTasks() {
+				const result = await this.$http.post('postTasks', this.queryInfo)
 			// 	// 判断业务逻辑
-			// 	if (result.data.code == 0) {
+				// if (result.data.code == 0) {
 			// 		this.testList = result.data.data.rows
 			// 		this.total = result.data.data.total
-			// 		this.task_id = result.data.data.task_id
+					this.task_id = result.data.task_id},
 			// 	}else{
 			// 		this.$message({
 			// 			type: 'error',
@@ -265,14 +271,14 @@
 				// 	that.form.main_unit.push(that.multipleSelection[i].name)
 				// }
 				// that.getTestListShow = false
-
-			},
-			// 上传成功
-			uploadSuccess(res) {
+				// 上传成功
+				uploadSuccess(res) {
 				console.log(res.data)
 				this.form.file_url = res.data.fileUrl
 				this.form.file_name = res.data.fileName
 			}
+			},
+			
 		}
 	
 </script>

+ 133 - 172
src/components/admin/addTaskJcObject.vue

@@ -4,13 +4,9 @@
 
 			<el-breadcrumb-item>首页</el-breadcrumb-item>
 			<el-breadcrumb-item>监测任务</el-breadcrumb-item>
-			<el-breadcrumb-item>例行监测</el-breadcrumb-item>
-			<el-breadcrumb-item :to="{path:'/admin/routineMonitor'}">任务列表</el-breadcrumb-item>
 			<el-breadcrumb-item>添加任务</el-breadcrumb-item>
 		</el-breadcrumb>
-		<div class="title">
-			例行监测
-		</div>
+		<div class="title">添加任务</div>
 		<el-form :model="form" label-width="100px">
 			<el-form-item prop="main_unit" label="抽样机构"  required>
 				<el-input v-model="form.main_unit" @focus="getOrganizationsShow1 = true"></el-input>
@@ -18,7 +14,7 @@
 			<el-form-item prop="check_unit" label="检测机构"   required>
 					<el-input v-model="form.check_unit" @focus="getOrganizationsShow2 = true"></el-input>
 			</el-form-item>
-			<el-form-item prop="sample_address" label="地区"   required>
+			<el-form-item prop="sample_address" label="地区"   >
 				<el-cascader  :options="region" v-model="sample_address"
 					@change="handleChange">
 				</el-cascader>
@@ -31,46 +27,21 @@
 		</el-form>
 
 		<!-- 选择抽样机构对话框 -->
-		<el-dialog title="机构选择" :visible.sync="getOrganizationsShow1" width="50%" :close-on-click-modal="false" @open="getOrganizations1()" class="dialogItem">
+		<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-select v-model="form.groupname" clearable>
-						<el-option v-for="item in group" :key="item.value" :label="item.label" :value="item.value">
-						</el-option>
-					</el-select>
-				</el-form-item>
-			</el-col>
-			<el-col :span="6">
-				<!-- 机构性质 -->
-				<el-form-item label="机构性质">
-						<el-select v-model="form.properties" clearable>
-							<el-option v-for="item in field" :key="item.value" :label="item.label" :value="item.value">
-							</el-option>
-						</el-select>
-				</el-form-item>
-			</el-col>
-			<el-col :span="6">
-				<!-- 输入匹配关键词 -->
-				<!-- <el-form-item label="搜索名称">
-					<el-autocomplete
-						class="inline-input"
-						v-model="state2"
-						:fetch-suggestions="querySearch"
-						placeholder="请输入内容"
-						:trigger-on-focus="false"
-						@select="handleSelect">
-					</el-autocomplete>
-				</el-form-item> -->
-			</el-col>
-			<el-col :span="6">
-			<el-button type="success" @click="querySearch()" style="margin-top:40px">搜索</el-button>
-			</el-col>
-		</el-row>
-				<!--  表格数据区域-->
+									<!-- 检索功能 -->
+									<!-- <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%">
 					<el-table-column type="selection" :reserve-selection="true" width="50"></el-table-column>
@@ -82,62 +53,25 @@
 					<el-table-column :key="table.prop" v-for="table in tableHeader" :label="table.label"
 						:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
 				</el-table>
-				<div class="footer">
-					<!--    分页器区域-->
-					<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
-						:current-page="queryInfo1.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo1.pageSize"
-						layout="total, sizes, prev, pager, next, jumper" :total="total" background />
-					<el-button type="success" @click="choseTest1()">提交</el-button>
-				</div>
-				
+		<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 />
+			<el-button type="success" @click="choseTest1()">提交</el-button>
+		</div>
+		
 			</el-form>
 		</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">
-		<!-- 检索功能 -->
-		<el-row :gutter="20">
-			<el-col :span="6">
-				<!-- 组别名称 -->
-				<el-form-item label="组别名称">
-					<el-select v-model="form.groupname" clearable>
-						<el-option v-for="item in group" :key="item.value" :label="item.label" :value="item.value">
-						</el-option>
-					</el-select>
-				</el-form-item>
-			</el-col>
-			<el-col :span="6">
-				<!-- 机构性质 -->
-				<el-form-item label="机构性质">
-						<el-select v-model="form.properties" clearable>
-							<el-option v-for="item in field" :key="item.value" :label="item.label" :value="item.value">
-							</el-option>
-						</el-select>
-				</el-form-item>
-			</el-col>
-			<el-col :span="6">
-				<!-- 输入匹配关键词 -->
-				<!-- <el-form-item label="搜索名称">
-					<el-autocomplete
-						class="inline-input"
-						v-model="state2"
-						:fetch-suggestions="querySearch"
-						placeholder="请输入内容"
-						:trigger-on-focus="false"
-						@select="handleSelect">
-					</el-autocomplete>
-				</el-form-item> -->
-			</el-col>
-			<el-col :span="6">
-			<el-button type="success" @click="choseTest()" style="margin-top:40px">搜索</el-button>
-			</el-col>
-		</el-row>
 				<!--  表格数据区域-->
-				<el-table ref="multipleTable" :data="testList2" row-key="id"  @current-change="handleSelectionChange2"
+				<el-table ref="multipleTable" :data="testList2" row-key="id" @selection-change="handleSelectionChange2"
 					border stripe highlight-current-row style="width: 100%" >
-					<!-- <el-table :data="testList" border stripe highlight-current-row  @current-change="handleSelectionChange2" style="width: 100%"
-					:row-style="rowStyle" :cell-style="cellStyle"> -->
 					<el-table-column type="selection" :reserve-selection="true" width="50"></el-table-column>
 					<el-table-column label="序号" width="50px">
 						<template slot-scope="scope">
@@ -148,13 +82,13 @@
 						:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
 				</el-table>
 				<div class="footer">
-					<!--    分页器区域-->
-					<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+<!--检测机构分页器区域-->
+					<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="total" background />
+						layout="total, sizes, prev, pager, next, jumper" :total="total2" background />
+
 					<el-button type="success" @click="choseTest2()">提交</el-button>
 				</div>
-				
 			</el-form>
 		</el-dialog>
 			
@@ -164,6 +98,7 @@
 <script>
 import {
 		regionData,
+		CodeToText,
 		regionDataPlus,
 	} from 'element-china-area-data'
 	const rymc = window.sessionStorage.getItem('rymc')
@@ -171,49 +106,49 @@ import {
 	export default {
 		data() {
 			return {
+				CodeToText:'',
 					form: {
+					// name:'',
 					bear_unit: '',
 					report_unit: '',
-					// check_unit: '',
 					sample_number: '',
-					sample_address: '',
+					// sample_address: '',
 					uploadtime: '',
 					groupname:'',
 					properties:'',
 					main_unit:[],
-					check_unit:[]
+					check_unit:[],
+					sample_org_id:'',
+					check_org_id:''
 				},
 				currentRow: null,
 				currentRow2: null,
 				//组别名称
-				group: [{
-					value: '1',
-					label: '检测机构'
-				}, {
-					value: '2',
-					label: '县级监管单位'
-				}, {
-					value: '3',
-					label: '市级监管单位'
-				},{
-					value: '4',
-					label: '省级监管单位'
-				}],
+				// group: [
+				// {
+				// 	value: '2',
+				// 	label: '县级监管单位'
+				// }, {
+				// 	value: '3',
+				// 	label: '市级监管单位'
+				// },{
+				// 	value: '4',
+				// 	label: '省级监管单位'
+				// }],
 				//机构性质
-				field: [{
-					value: '1',
-					label: '政府部门'
-				}, {
-					value: '2',
-					label: '事业单位'
-				}, {
-					value: '3',
-					label: '企业'
-				}],
-
+				// field: [{
+				// 	value: '1',
+				// 	label: '政府部门'
+				// }, {
+				// 	value: '2',
+				// 	label: '事业单位'
+				// }, {
+				// 	value: '3',
+				// 	label: '企业'
+				// }],
 				// 抽样地区
 				region: regionData,
-				// sample_address: [],
+				sample_address:'',
 				// 机构地域表格数据
 				underTask: [],
 				underTasktotal: 0,
@@ -227,17 +162,8 @@ import {
 						name: '是'
 					}
 				],
-				// rymc: rymc,		//从本地缓存获取发布单位
-				myHeaders: {
-					Authorization: 'bearer'+ token			//上传文件添加token
-				},
-				// 任务表单
-				// form: {
-				// 	main_unit: [],	
-				// 	check_unit: [],				
-				// },
-				// form: {
-				// 	check_unit: [],			
+				// myHeaders: {
+				// 	Authorization: 'bearer'+ token//上传文件添加token
 				// },
 				// 优先级选项
 				priority: [{
@@ -263,11 +189,12 @@ import {
 
 				// 弹出抽样机构弹窗
 				getOrganizationsShow1: false,
-				// 查询检测机构请求参数
+				// 查询抽样机构请求参数
 				queryInfo1: {
 					pageNum: 1,
 					pageSize: 10,
-					keyWord: ''
+					name:'',
+					sample_org_id:''
 				},
 
 				// 弹出检测机构弹窗
@@ -276,9 +203,11 @@ import {
 				queryInfo2: {
 					pageNum: 1,
 					pageSize: 10,
-					keyWord: '',
-					groupname:'检测机构'
+					// keyWord: '',
+					groupname:'检测机构',
 				},
+				//抽样机构列表
+				testList: [],
 				// 检测机构列表
 				testList2: [],
 				// 表头
@@ -312,9 +241,13 @@ import {
 				orgs2: [],
 				// 上传成功文件列表
 				fileList: []
+				
 			}
 		},
 		created:function(){
+			this.sample_org_id = this.id
+			this.task_id= this.$route.params.task_id
+			console.log(this.task_id)
 			this.postTaskProfile()
 		},
 		
@@ -322,23 +255,38 @@ import {
 			let that = this
 		},
 		methods: {
-			// 获取机构列表
-				async postTaskProfile() {
+			// 添加任务step2
+			async postTaskProfile() {
 				const result = await this.$http.post('postTaskProfile', {
 					task_id: this.task_id,
-					// pageSize:this.queryInfo.pageSize,
-					// pageNum:this.queryInfo.pageNum
-				})},
+					sample_org_id:this.sample_org_id,
+					check_org_id:this.check_org_id,
+					sample_address:this.sample_address
+				})
+				this.sample_org_id = result.data.rows.id
+				this.check_org_id = result.data.rows.id
+				console.log(this.sample_org_id)
+			},
+			//搜索
+			// async search(){
+			// 	this.queryInfo1.pageNum = 1
+			// 		this.getOrganizations()
+			// },
+			//搜索
+			// async search2(){
+			// 	this.queryInfo2.pageNum = 1
+			// 		this.getOrganizations()
+			// },
+			
 			// 获取选择抽样地区
 			handleChange() {
 				var that = this
 				var loc = "";
-				// console.log(this.form.place)
 				for (let i = 0; i < this.sample_address.length; i++) {
 					loc += CodeToText[this.sample_address[i]];
 				}
-				// console.log(loc)
 				that.form.sample_address = loc
+				// console.log(loc)
 			},
 			//保存
 			async onSubmit() {
@@ -348,8 +296,11 @@ import {
 				this.form['releaser'] = window.sessionStorage.getItem('rymc')
 				this.form['task_class'] = '例行监测'
 				this.form['ispublic'] = 0
-				
+				this.form['sample_org_id'] = this.sample_org_id
+				this.form['check_org_id'] = this.check_org_id
+				this.form['task_id'] = this.task_id
 				const result = await this.$http.post('postTaskProfile', this.form)
+
 				// 判断业务逻辑
 				if (result.data.code == 0) {
 					this.$router.push('routineMonitor')
@@ -367,25 +318,21 @@ import {
 			async getOrganizations1() {
 				this.queryInfo1['token'] = token
 				const result = await this.$http.post('getOrganizations', this.queryInfo1)
-				console.log(result.data.code);
-				// 判断业务逻辑
-				if (result.data.code == 0) {
 					this.testList = result.data.data.rows
 					this.total = result.data.data.total
-				}
+					this.sample_org_id = result.data.rows.id
+					console.log(result.data.data.rows.id)
 			},
 
 			// 获取检测机构列表
 			async getOrganizations2() {
 				this.queryInfo2['token'] = token
 				const result = await this.$http.post('getOrganizations', this.queryInfo2)
-				console.log(result.data.code);
-				// 判断业务逻辑
-				if (result.data.code == 0) {
 					this.testList2 = result.data.data.rows
 					this.total2 = result.data.data.total
-				}
+					// this.check_org_id = result.data.rows.id
 			},
+
 			/** 修复当用户在大于1的分页进行数据搜索没有返回值的问题 */
 			setPageNum() {
 				this.queryInfo.pageNum = 1
@@ -401,47 +348,61 @@ import {
 				})
 				this.hander = false
 			},
-
+//抽样机构页码
 			/** 监听每页显示多少数据的改变 */
-			handleSizeChange(newSize) {
+			handleSizeChange1(newSize) {
 				this.queryInfo1.pageSize = newSize
 				this.getOrganizations1()
 			},
-
 			/** 监听页码的改变 */
-			handleCurrentChange(newPage) {
+			handleCurrentChange1(newPage) {
 				this.queryInfo1.pageNum = newPage
 				this.getOrganizations1()
 			},
-			//批量勾选
-			// handleSelectionChange(val) {
-			// 	this.multipleSelection = val
-			// 	if (this.hander) return false
-			// 	this.setSelectRows() // 处理选中的方法
-			// },
+//检测机构页码
+			/** 监听每页显示多少数据的改变 */
+			handleSizeChange2(newSize) {
+				this.queryInfo2.pageSize = newSize
+				this.getOrganizations2()
+			},
+			/** 监听页码的改变 */
+			handleCurrentChange2(newPage) {
+				this.queryInfo2.pageNum = newPage
+				this.getOrganizations2()
+			},
+
 			//选中抽样(单选)
 			handleSelectionChange1(val) {
 				this.currentRow = val;
 				console.log(this.currentRow)
 				console.log(this.currentRow[0].name)
+				this.sample_org_id = this.currentRow[0].id
+				console.log(this.sample_org_id)
 			},
 			//选中检测(单选)
 			handleSelectionChange2(val) {
-				this.currentRow = val;
-				console.log(this.currentRow)
-				console.log(this.currentRow[0].name)
+				this.currentRow2 = val;
+				this.check_org_id = this.currentRow2[0].id
+				console.log(this.currentRow2)
+				console.log(this.currentRow2[0].name)
+				console.log(this.check_org_id)
 			},
-			// 抽样单位提交
-			choseTest1() {
+// 抽样单位提交
+			async choseTest1() {
 				let that = this
 				that.form.main_unit = that.currentRow[0].name
 				that.getOrganizationsShow1 = false
+				that.form.sample_org_id = that.currentRow[0].id
+				console.log(that.form.sample_org_id)
+
 			},
-			// 检测单位提交
+// 检测单位提交
 			choseTest2() {
 				let that = this
 				that.form.check_unit = that.currentRow2[0].name
+				that.form.check_org_id = that.currentRow2[0].id
 				that.getOrganizationsShow2 = false
+				console.log(that.form.check_org_id)
 			},
 		}
 	}

+ 296 - 0
src/components/admin/addTaskJd.vue

@@ -0,0 +1,296 @@
+<template>
+	<div style="width: 100%">
+		<el-breadcrumb separator-class="el-icon-arrow-right">
+
+			<el-breadcrumb-item>首页</el-breadcrumb-item>
+			<el-breadcrumb-item>监测任务</el-breadcrumb-item>
+			<el-breadcrumb-item>新增任务</el-breadcrumb-item>
+		</el-breadcrumb>
+		<div class="title">
+			新增任务
+		</div>
+
+		<el-form :model="form" label-width="100px">
+			<el-form-item label="任务名称" required>
+				<el-input v-model="form.task_name" placeholder="最长40字符"></el-input>
+			</el-form-item>
+			<el-form-item label="任务优先级" required>
+				<el-select v-model="form.level" placeholder="请选择">
+					<el-option v-for="item in priority" :key="item.value" :label="item.label" :value="item.value">
+					</el-option>
+				</el-select>
+			</el-form-item>
+			<el-form-item label="年度" required>
+				<el-date-picker v-model="form.year" type="year" value-format="yyyy">
+				</el-date-picker>
+			</el-form-item>
+			<el-form-item label="批次" required>
+				<el-select v-model="form.batch">
+					<el-option v-for="item in batch" :key="item.label" :label="item.label" :value="item.label">
+					</el-option>
+				</el-select>
+			</el-form-item>
+			<el-form-item label="任务时间" required>
+				<el-col :span="8">
+					<el-date-picker v-model="form.starttime" type="date" value-format="yyyy-MM-dd">
+					</el-date-picker>
+				</el-col>
+				<el-col :span="1">
+					<div class="line">--</div>
+				</el-col>
+				<el-col :span="11">
+					<el-date-picker v-model="form.endtime" type="date" value-format="yyyy-MM-dd">
+					</el-date-picker>
+				</el-col>
+			</el-form-item>
+			<!-- <el-form-item label="发布单位" required>
+				<el-input v-model="rymc" :disabled="true"></el-input>
+			</el-form-item> -->
+			<!-- <el-form-item label="牵头单位" required>
+				<el-input v-model="form.main_unit" @focus="getTestListShow = true"></el-input>
+			</el-form-item> -->
+			<el-form-item label="文件号">
+				<el-input v-model="form.filenum"></el-input>
+			</el-form-item>
+			<el-form-item label="抽检分离:" prop="is_divide" width="70px" class="labelItem" required>
+					<el-select  v-model="form.is_divide" size="" >
+						<el-option v-for="item in divideOptions" :key="item.id" :label="item.name" :value="item.id">
+						</el-option>
+					</el-select>
+			</el-form-item>
+			<el-form-item label="备注">
+				<el-input type="textarea" placeholder="最长300字符" v-model="form.log"></el-input>
+			</el-form-item>
+			<el-form-item label="附件" required>
+				<el-upload class="upload-demo" :file-list="fileList" drag :headers="myHeaders"
+					action="http://syjcapi.aielab.net/api/v1/ossUpload" :on-success="uploadSuccess"
+					:limit="1">
+					<i class="el-icon-upload"></i>
+					<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+				</el-upload>
+			</el-form-item>
+			<el-form-item>
+				<el-button type="success" @click="onSubmit()">保存</el-button>
+				<el-button type="success" @click="nextStep()">下一步</el-button>
+				<el-button @click="reBack()">返回</el-button>
+			</el-form-item>
+		</el-form>
+	</div>
+</template>
+<script>
+	const rymc = window.sessionStorage.getItem('rymc')
+	const token = window.sessionStorage.getItem('token')
+	export default {
+		data() {
+			return {
+				task_class:'',
+				// rymc: rymc,		//从本地缓存获取发布单位
+				myHeaders: {
+					Authorization: 'bearer'+ token			//上传文件添加token
+				},
+				// 任务表单
+				form: {
+					main_unit: [],	
+				},
+				// 优先级选项
+				priority: [{
+					value: '0',
+					label: '一般'
+				}, {
+					value: '1',
+					label: '紧急'
+				}, {
+					value: '2',
+					label: '特急'
+				}],
+				// 批次选项
+				batch: [{
+					label: '一季度'
+				}, {
+					label: '二季度'
+				}, {
+					label: '三季度'
+				}, {
+					label: '四季度'
+				}],
+				// 抽检分离选项
+				divideOptions: [{
+						id: 0,
+						name: '否'
+					},
+					{
+						id: 1,
+						name: '是'
+					}
+				],
+				// 上传成功文件列表
+				fileList: []
+			}
+		},
+		created() {
+			 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);
+			//       }
+			//     })
+			//   })
+			// })
+		},
+		methods: {
+			//保存
+			async onSubmit() {
+				this.form['token'] = token
+				this.form['groupname'] = this.groupname
+				this.form['orgs'] = this.orgs
+				this.form['releaser'] = window.sessionStorage.getItem('rymc')
+				this.form['task_class'] = '监督抽查'
+				this.form['ispublic'] = 0
+				const result = await this.$http.post('postTasks', this.form)
+				
+				
+				// 判断业务逻辑
+				if (result.code == 0) {
+						this.$message({
+						type: 'success',
+						message: result.data.message
+					})
+				} else {
+					this.$message({
+						type: 'success',
+						message: result.data.message
+					})
+				}
+					
+			},
+			//返回
+			reBack() {
+				this.$router.push('checkMonitor')
+			},
+			//下一步
+			nextStep(id){
+			console.log(id)
+			this.$router.push({
+				name:'addTaskObjectJd',
+				params:{
+					task_id:id
+				}
+			})
+			},			
+			// 获取任务列表
+			async postTasks() {
+				const result = await this.$http.post('postTasks', this.queryInfo)
+			// 	// 判断业务逻辑
+				// if (result.data.code == 0) {
+			// 		this.testList = result.data.data.rows
+			// 		this.total = result.data.data.total
+					this.task_id = result.data.task_id},
+			// 	}else{
+			// 		this.$message({
+			// 			type: 'error',
+			// 			message: result.data.message
+			// 		})
+			// 	}
+			// },
+			// 获取检测机构列表
+			// async getTestList() {
+			// 	this.queryInfo['token'] = token
+			// 	const result = await this.$http.post('getTestList', this.queryInfo)
+			// 	console.log(result);
+				// 判断业务逻辑
+			// 	if (result.data.code == 0) {
+			// 		this.testList = result.data.data.rows
+			// 		this.total = result.data.data.total
+			// 	}
+			// },
+			/** 修复当用户在大于1的分页进行数据搜索没有返回值的问题 */
+			// setPageNum() {
+			// 	this.queryInfo.pageNum = 1
+			// 	this.getTestList()
+			// },
+			// setSelectedRow() {
+			// 	// 设置当前页已选项
+			// 	this.hander = true
+			// 	this.testList.forEach(item => {
+			// 		if (this.list.includes(item[this.uniqueKey])) {
+			// 			this.$refs.multipleTable.toggleRowSelection(item, true)
+			// 		}
+			// 	})
+			// 	this.hander = false
+			// },
+
+			/** 监听每页显示多少数据的改变 */
+			// handleSizeChange(newSize) {
+			// 	this.queryInfo.pageSize = newSize
+			// 	this.getTestList()
+			// },
+
+			/** 监听页码的改变 */
+			// handleCurrentChange(newPage) {
+			// 	this.queryInfo.pageNum = newPage
+			// 	this.getTestList()
+			// },
+			// // 批量勾选
+			// handleSelectionChange(val) {
+			// 	this.multipleSelection = val
+			// 	if (this.hander) return false
+			// 	// this.setSelectRows() // 处理选中的方法
+			// },
+			// 提交
+			// choseTest() {
+			// 	let that = this
+			// 	that.orgs = that.multipleSelection
+			// 	console.log(that.orgs)
+			// 	that.form.main_unit = that.multipleSelection.map(el => el.name).join(', ')
+			// 	console.log(that.form.main_unit)
+				// that.form.main_unit = that.multipleSelection
+				// for(let i=0;i<that.multipleSelection.length;i++){
+				// 	that.form.main_unit.push(that.multipleSelection[i].name)
+				// }
+				// that.getTestListShow = false
+				// 上传成功
+				uploadSuccess(res) {
+				console.log(res.data)
+				this.form.file_url = res.data.fileUrl
+				this.form.file_name = res.data.fileName
+			}
+			},
+			
+		}
+	
+</script>
+<style lang="less" scoped>
+	.title {
+		margin-left: 50%;
+		margin-bottom: 20px;
+	}
+
+	.el-form {
+		width: 800px;
+		margin: 0 auto;
+	}
+
+	.footer {
+		margin-top: 5px;
+		display: flex;
+		flex-direction: row;
+		justify-content: space-between;
+	}
+</style>

+ 409 - 0
src/components/admin/addTaskObjectJd.vue

@@ -0,0 +1,409 @@
+<template>
+	<div style="width: 100%">
+		<el-breadcrumb separator-class="el-icon-arrow-right">
+
+			<el-breadcrumb-item>首页</el-breadcrumb-item>
+			<el-breadcrumb-item>监测任务</el-breadcrumb-item>
+			<el-breadcrumb-item>添加任务</el-breadcrumb-item>
+		</el-breadcrumb>
+		<div class="title">添加任务</div>
+		<el-form :model="form" label-width="100px">
+			<el-form-item prop="main_unit" label="抽样机构"  required>
+				<el-input v-model="form.main_unit" @focus="getOrganizationsShow1 = true"></el-input>
+			</el-form-item>
+			<el-form-item prop="check_unit" label="检测机构"   required>
+					<el-input v-model="form.check_unit" @focus="getOrganizationsShow2 = true"></el-input>
+			</el-form-item>
+			<el-form-item prop="sample_address" label="地区"   >
+				<el-cascader  :options="region" v-model="sample_address"
+					@change="handleChange">
+				</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>
+
+		<!-- 选择抽样机构对话框 -->
+		<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%">
+					<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 tableHeader" :label="table.label"
+						:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
+				</el-table>
+				<div class="footer">
+					<!-- 分页器区域-->
+					<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+						:current-page="queryInfo1.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo1.pageSize"
+						layout="total, sizes, prev, pager, next, jumper" :total="total" background />
+					<el-button type="success" @click="choseTest1()">提交</el-button>
+				</div>
+				
+			</el-form>
+		</el-dialog>
+
+		<!-- 选择检测机构对话框 -->
+		<el-dialog title="机构选择" :visible.sync="getOrganizationsShow2" width="50%" :close-on-click-modal="false" @open="getOrganizations2()" class="dialogItem">
+			<el-form v-if="getOrganizationsShow2" :model="getOrganizationsForm2">
+			<!-- 检索功能 -->
+			<!-- <el-row :gutter="20">
+				<el-col :span="6">
+					<el-form-item label="单位名称" >
+							<el-input v-model="form.name"></el-input>
+					</el-form-item>
+				</el-col> -->
+				<!-- <el-col :span="6">
+					<el-button type="success" @click="search2()" style="margin-top:40px">搜索</el-button>
+				</el-col> -->
+			<!-- </el-row> -->
+				<!--  表格数据区域-->
+				<el-table ref="multipleTable" :data="testList2" row-key="id" @selection-change="handleSelectionChange2"
+					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 tableHeader" :label="table.label"
+						:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
+				</el-table>
+				<div class="footer">
+					<!--分页器区域-->
+					<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+						:current-page="queryInfo2.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo2.pageSize"
+						layout="total, sizes, prev, pager, next, jumper" :total="total" background />
+					<el-button type="success" @click="choseTest2()">提交</el-button>
+				</div>
+			</el-form>
+		</el-dialog>
+			
+
+	</div>
+</template>
+<script>
+import {
+		regionData,
+		CodeToText,
+		regionDataPlus,
+	} from 'element-china-area-data'
+	const rymc = window.sessionStorage.getItem('rymc')
+	const token = window.sessionStorage.getItem('token')
+	export default {
+		data() {
+			return {
+				CodeToText:'',
+					form: {
+					// name:'',
+					bear_unit: '',
+					report_unit: '',
+					// check_unit: '',
+					sample_number: '',
+					sample_address: '',
+					uploadtime: '',
+					groupname:'',
+					properties:'',
+					main_unit:[],
+					check_unit:[]
+				},
+				currentRow: null,
+				currentRow2: null,
+				//组别名称
+				// group: [
+				// {
+				// 	value: '2',
+				// 	label: '县级监管单位'
+				// }, {
+				// 	value: '3',
+				// 	label: '市级监管单位'
+				// },{
+				// 	value: '4',
+				// 	label: '省级监管单位'
+				// }],
+				//机构性质
+				// field: [{
+				// 	value: '1',
+				// 	label: '政府部门'
+				// }, {
+				// 	value: '2',
+				// 	label: '事业单位'
+				// }, {
+				// 	value: '3',
+				// 	label: '企业'
+				// }],
+				// 抽样地区
+				region: regionData,
+				sample_address: [],
+				// 机构地域表格数据
+				underTask: [],
+				underTasktotal: 0,
+				// 抽检分离选项
+				divideOptions: [{
+						id: 0,
+						name: '否'
+					},
+					{
+						id: 1,
+						name: '是'
+					}
+				],
+				// myHeaders: {
+				// 	Authorization: 'bearer'+ token//上传文件添加token
+				// },
+				// 任务表单
+				// form: {
+				// 	main_unit: [],	
+				// 	check_unit: [],				
+				// },
+				// form: {
+				// 	check_unit: [],			
+				// },
+				// 优先级选项
+				priority: [{
+					value: '0',
+					label: '一般'
+				}, {
+					value: '1',
+					label: '紧急'
+				}, {
+					value: '2',
+					label: '特急'
+				}],
+				// 批次选项
+				batch: [{
+					label: '一季度'
+				}, {
+					label: '二季度'
+				}, {
+					label: '三季度'
+				}, {
+					label: '四季度'
+				}],
+
+				// 弹出抽样机构弹窗
+				getOrganizationsShow1: false,
+				// 查询检测机构请求参数
+				queryInfo1: {
+					pageNum: 1,
+					pageSize: 10,
+					name:'',
+				},
+
+				// 弹出检测机构弹窗
+				getOrganizationsShow2: false,
+				// 查询检测机构请求参数
+				queryInfo2: {
+					pageNum: 1,
+					pageSize: 10,
+					keyWord: '',
+					groupname:'检测机构'
+				},
+				//抽样机构列表
+				testList: [],
+				// 检测机构列表
+				testList2: [],
+				// 表头
+				tableHeader: [{
+						label: '单位名称',
+						prop: 'name',
+						width: 300
+						// fixed: 'left'
+					},
+					{
+						label: '机构类型',
+						prop: 'properties',
+						width:150
+						// fixed: 'left'
+					}, {
+						label: '组别名称',
+						prop: 'groupname',
+						width: 300
+						// fixed: 'left'
+					}
+				],
+				// 总共多少条数据
+				total: 0,
+				total2: 0,
+				// table表格多选选项
+				// multipleSelection: null,
+				getOrganizationsForm1: {},
+				getOrganizationsForm2: {},
+				// 选中的牵头单位
+				orgs: [],
+				orgs2: [],
+				// 上传成功文件列表
+				fileList: []
+				
+			}
+		},
+		created:function(){
+			this.postTaskProfile()
+		},
+		
+		mounted() {
+			let that = this
+		},
+		methods: {
+			// 获取机构列表
+				async postTaskProfile() {
+				const result = await this.$http.post('postTaskProfile', {
+					task_id: this.task_id,
+				
+				})},
+			//搜索
+			async search(){
+				this.queryInfo1.pageNum = 1
+					this.getOrganizations()
+			},
+			//搜索
+			async search2(){
+				this.queryInfo2.pageNum = 1
+					this.getOrganizations()
+			},
+			// 获取选择抽样地区
+			handleChange() {
+				var that = this
+				var loc = "";
+				for (let i = 0; i < this.sample_address.length; i++) {
+					loc += CodeToText[this.sample_address[i]];
+				}
+				that.form.sample_address = loc
+			},
+			//保存
+			async onSubmit() {
+				this.form['token'] = token
+				this.form['groupname'] = this.groupname
+				this.form['orgs'] = this.orgs
+				this.form['releaser'] = window.sessionStorage.getItem('rymc')
+				this.form['task_class'] = '监督抽查'
+				this.form['ispublic'] = 0
+				const result = await this.$http.post('postTaskProfile', this.form)
+				// 判断业务逻辑
+				if (result.data.code == 0) {
+					this.$router.push('checkMonitor')
+				} else {
+					this.$message({
+						type: 'error',
+						message: result.data.message
+					})
+				}
+			},
+			reBack() {
+				this.$router.push('addTaskJd')
+			},		
+			// 获取抽样机构列表
+			async getOrganizations1() {
+				this.queryInfo1['token'] = token
+				const result = await this.$http.post('getOrganizations', this.queryInfo1)
+				console.log(result.data.code);
+				// 判断业务逻辑
+				if (result.data.code == 0) {
+					this.testList = result.data.data.rows
+					this.total = result.data.data.total
+				}
+			},
+
+			// 获取检测机构列表
+			async getOrganizations2() {
+				this.queryInfo2['token'] = token
+				const result = await this.$http.post('getOrganizations', this.queryInfo2)
+				console.log(result.data.code);
+				// 判断业务逻辑
+				if (result.data.code == 0) {
+					this.testList2 = result.data.data.rows
+					this.total2 = result.data.data.total
+				}
+			},
+			/** 修复当用户在大于1的分页进行数据搜索没有返回值的问题 */
+			setPageNum() {
+				this.queryInfo.pageNum = 1
+				this.getOrganizations1()
+			},
+			setSelectedRow() {
+				// 设置当前页已选项
+				this.hander = true
+				this.testList.forEach(item => {
+					if (this.list.includes(item[this.uniqueKey])) {
+						this.$refs.multipleTable.toggleRowSelection(item, true)
+					}
+				})
+				this.hander = false
+			},
+
+			/** 监听每页显示多少数据的改变 */
+			handleSizeChange(newSize) {
+				this.queryInfo1.pageSize = newSize
+				this.getOrganizations1()
+			},
+
+			/** 监听页码的改变 */
+			handleCurrentChange(newPage) {
+				this.queryInfo1.pageNum = newPage
+				this.getOrganizations1()
+			},
+			//选中抽样(单选)
+			handleSelectionChange1(val) {
+				this.currentRow = val;
+				console.log(this.currentRow)
+				console.log(this.currentRow[0].name)
+			},
+			//选中检测(单选)
+			handleSelectionChange2(val) {
+				this.currentRow2 = val;
+				console.log(this.currentRow2)
+				console.log(this.currentRow2[0].name)
+			},
+			// 抽样单位提交
+			choseTest1() {
+				let that = this
+				that.form.main_unit = that.currentRow[0].name
+				that.getOrganizationsShow1 = false
+			},
+			// 检测单位提交
+			choseTest2() {
+				let that = this
+				that.form.check_unit = that.currentRow2[0].name
+				that.getOrganizationsShow2 = false
+			},
+		}
+	}
+</script>
+<style lang="less" scoped>
+	.title {
+		margin-left: 50%;
+		margin-bottom: 20px;
+	}
+
+	.el-form {
+		width: 800px;
+		margin: 0 auto;
+	}
+
+	.footer {
+		margin-top: 5px;
+		display: flex;
+		flex-direction: row;
+		justify-content: space-between;
+	}
+</style>

+ 409 - 0
src/components/admin/addTaskObjectZx.vue

@@ -0,0 +1,409 @@
+<template>
+	<div style="width: 100%">
+		<el-breadcrumb separator-class="el-icon-arrow-right">
+
+			<el-breadcrumb-item>首页</el-breadcrumb-item>
+			<el-breadcrumb-item>监测任务</el-breadcrumb-item>
+			<el-breadcrumb-item>添加任务</el-breadcrumb-item>
+		</el-breadcrumb>
+		<div class="title">添加任务</div>
+		<el-form :model="form" label-width="100px">
+			<el-form-item prop="main_unit" label="抽样机构"  required>
+				<el-input v-model="form.main_unit" @focus="getOrganizationsShow1 = true"></el-input>
+			</el-form-item>
+			<el-form-item prop="check_unit" label="检测机构"   required>
+					<el-input v-model="form.check_unit" @focus="getOrganizationsShow2 = true"></el-input>
+			</el-form-item>
+			<el-form-item prop="sample_address" label="地区"   >
+				<el-cascader  :options="region" v-model="sample_address"
+					@change="handleChange">
+				</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>
+
+		<!-- 选择抽样机构对话框 -->
+		<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%">
+					<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 tableHeader" :label="table.label"
+						:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
+				</el-table>
+				<div class="footer">
+					<!-- 分页器区域-->
+					<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+						:current-page="queryInfo1.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo1.pageSize"
+						layout="total, sizes, prev, pager, next, jumper" :total="total" background />
+					<el-button type="success" @click="choseTest1()">提交</el-button>
+				</div>
+				
+			</el-form>
+		</el-dialog>
+
+		<!-- 选择检测机构对话框 -->
+		<el-dialog title="机构选择" :visible.sync="getOrganizationsShow2" width="50%" :close-on-click-modal="false" @open="getOrganizations2()" class="dialogItem">
+			<el-form v-if="getOrganizationsShow2" :model="getOrganizationsForm2">
+			<!-- 检索功能 -->
+			<!-- <el-row :gutter="20">
+				<el-col :span="6">
+					<el-form-item label="单位名称" >
+							<el-input v-model="form.name"></el-input>
+					</el-form-item>
+				</el-col> -->
+				<!-- <el-col :span="6">
+					<el-button type="success" @click="search2()" style="margin-top:40px">搜索</el-button>
+				</el-col> -->
+			<!-- </el-row> -->
+				<!--  表格数据区域-->
+				<el-table ref="multipleTable" :data="testList2" row-key="id" @selection-change="handleSelectionChange2"
+					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 tableHeader" :label="table.label"
+						:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
+				</el-table>
+				<div class="footer">
+					<!--分页器区域-->
+					<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+						:current-page="queryInfo2.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo2.pageSize"
+						layout="total, sizes, prev, pager, next, jumper" :total="total" background />
+					<el-button type="success" @click="choseTest2()">提交</el-button>
+				</div>
+			</el-form>
+		</el-dialog>
+			
+
+	</div>
+</template>
+<script>
+import {
+		regionData,
+		CodeToText,
+		regionDataPlus,
+	} from 'element-china-area-data'
+	const rymc = window.sessionStorage.getItem('rymc')
+	const token = window.sessionStorage.getItem('token')
+	export default {
+		data() {
+			return {
+				CodeToText:'',
+					form: {
+					// name:'',
+					bear_unit: '',
+					report_unit: '',
+					// check_unit: '',
+					sample_number: '',
+					sample_address: '',
+					uploadtime: '',
+					groupname:'',
+					properties:'',
+					main_unit:[],
+					check_unit:[]
+				},
+				currentRow: null,
+				currentRow2: null,
+				//组别名称
+				// group: [
+				// {
+				// 	value: '2',
+				// 	label: '县级监管单位'
+				// }, {
+				// 	value: '3',
+				// 	label: '市级监管单位'
+				// },{
+				// 	value: '4',
+				// 	label: '省级监管单位'
+				// }],
+				//机构性质
+				// field: [{
+				// 	value: '1',
+				// 	label: '政府部门'
+				// }, {
+				// 	value: '2',
+				// 	label: '事业单位'
+				// }, {
+				// 	value: '3',
+				// 	label: '企业'
+				// }],
+				// 抽样地区
+				region: regionData,
+				sample_address: [],
+				// 机构地域表格数据
+				underTask: [],
+				underTasktotal: 0,
+				// 抽检分离选项
+				divideOptions: [{
+						id: 0,
+						name: '否'
+					},
+					{
+						id: 1,
+						name: '是'
+					}
+				],
+				// myHeaders: {
+				// 	Authorization: 'bearer'+ token//上传文件添加token
+				// },
+				// 任务表单
+				// form: {
+				// 	main_unit: [],	
+				// 	check_unit: [],				
+				// },
+				// form: {
+				// 	check_unit: [],			
+				// },
+				// 优先级选项
+				priority: [{
+					value: '0',
+					label: '一般'
+				}, {
+					value: '1',
+					label: '紧急'
+				}, {
+					value: '2',
+					label: '特急'
+				}],
+				// 批次选项
+				batch: [{
+					label: '一季度'
+				}, {
+					label: '二季度'
+				}, {
+					label: '三季度'
+				}, {
+					label: '四季度'
+				}],
+
+				// 弹出抽样机构弹窗
+				getOrganizationsShow1: false,
+				// 查询检测机构请求参数
+				queryInfo1: {
+					pageNum: 1,
+					pageSize: 10,
+					name:'',
+				},
+
+				// 弹出检测机构弹窗
+				getOrganizationsShow2: false,
+				// 查询检测机构请求参数
+				queryInfo2: {
+					pageNum: 1,
+					pageSize: 10,
+					keyWord: '',
+					groupname:'检测机构'
+				},
+				//抽样机构列表
+				testList: [],
+				// 检测机构列表
+				testList2: [],
+				// 表头
+				tableHeader: [{
+						label: '单位名称',
+						prop: 'name',
+						width: 300
+						// fixed: 'left'
+					},
+					{
+						label: '机构类型',
+						prop: 'properties',
+						width:150
+						// fixed: 'left'
+					}, {
+						label: '组别名称',
+						prop: 'groupname',
+						width: 300
+						// fixed: 'left'
+					}
+				],
+				// 总共多少条数据
+				total: 0,
+				total2: 0,
+				// table表格多选选项
+				// multipleSelection: null,
+				getOrganizationsForm1: {},
+				getOrganizationsForm2: {},
+				// 选中的牵头单位
+				orgs: [],
+				orgs2: [],
+				// 上传成功文件列表
+				fileList: []
+				
+			}
+		},
+		created:function(){
+			this.postTaskProfile()
+		},
+		
+		mounted() {
+			let that = this
+		},
+		methods: {
+			// 获取机构列表
+				async postTaskProfile() {
+				const result = await this.$http.post('postTaskProfile', {
+					task_id: this.task_id,
+				
+				})},
+			//搜索
+			async search(){
+				this.queryInfo1.pageNum = 1
+					this.getOrganizations()
+			},
+			//搜索
+			async search2(){
+				this.queryInfo2.pageNum = 1
+					this.getOrganizations()
+			},
+			// 获取选择抽样地区
+			handleChange() {
+				var that = this
+				var loc = "";
+				for (let i = 0; i < this.sample_address.length; i++) {
+					loc += CodeToText[this.sample_address[i]];
+				}
+				that.form.sample_address = loc
+			},
+			//保存
+			async onSubmit() {
+				this.form['token'] = token
+				this.form['groupname'] = this.groupname
+				this.form['orgs'] = this.orgs
+				this.form['releaser'] = window.sessionStorage.getItem('rymc')
+				this.form['task_class'] = '专项监测'
+				this.form['ispublic'] = 0
+				const result = await this.$http.post('postTaskProfile', this.form)
+				// 判断业务逻辑
+				if (result.data.code == 0) {
+					this.$router.push('specialMonitor')
+				} else {
+					this.$message({
+						type: 'error',
+						message: result.data.message
+					})
+				}
+			},
+			reBack() {
+				this.$router.push('addTaskZx')
+			},		
+			// 获取抽样机构列表
+			async getOrganizations1() {
+				this.queryInfo1['token'] = token
+				const result = await this.$http.post('getOrganizations', this.queryInfo1)
+				console.log(result.data.code);
+				// 判断业务逻辑
+				if (result.data.code == 0) {
+					this.testList = result.data.data.rows
+					this.total = result.data.data.total
+				}
+			},
+
+			// 获取检测机构列表
+			async getOrganizations2() {
+				this.queryInfo2['token'] = token
+				const result = await this.$http.post('getOrganizations', this.queryInfo2)
+				console.log(result.data.code);
+				// 判断业务逻辑
+				if (result.data.code == 0) {
+					this.testList2 = result.data.data.rows
+					this.total2 = result.data.data.total
+				}
+			},
+			/** 修复当用户在大于1的分页进行数据搜索没有返回值的问题 */
+			setPageNum() {
+				this.queryInfo.pageNum = 1
+				this.getOrganizations1()
+			},
+			setSelectedRow() {
+				// 设置当前页已选项
+				this.hander = true
+				this.testList.forEach(item => {
+					if (this.list.includes(item[this.uniqueKey])) {
+						this.$refs.multipleTable.toggleRowSelection(item, true)
+					}
+				})
+				this.hander = false
+			},
+
+			/** 监听每页显示多少数据的改变 */
+			handleSizeChange(newSize) {
+				this.queryInfo1.pageSize = newSize
+				this.getOrganizations1()
+			},
+
+			/** 监听页码的改变 */
+			handleCurrentChange(newPage) {
+				this.queryInfo1.pageNum = newPage
+				this.getOrganizations1()
+			},
+			//选中抽样(单选)
+			handleSelectionChange1(val) {
+				this.currentRow = val;
+				console.log(this.currentRow)
+				console.log(this.currentRow[0].name)
+			},
+			//选中检测(单选)
+			handleSelectionChange2(val) {
+				this.currentRow2 = val;
+				console.log(this.currentRow2)
+				console.log(this.currentRow2[0].name)
+			},
+			// 抽样单位提交
+			choseTest1() {
+				let that = this
+				that.form.main_unit = that.currentRow[0].name
+				that.getOrganizationsShow1 = false
+			},
+			// 检测单位提交
+			choseTest2() {
+				let that = this
+				that.form.check_unit = that.currentRow2[0].name
+				that.getOrganizationsShow2 = false
+			},
+		}
+	}
+</script>
+<style lang="less" scoped>
+	.title {
+		margin-left: 50%;
+		margin-bottom: 20px;
+	}
+
+	.el-form {
+		width: 800px;
+		margin: 0 auto;
+	}
+
+	.footer {
+		margin-top: 5px;
+		display: flex;
+		flex-direction: row;
+		justify-content: space-between;
+	}
+</style>

+ 296 - 0
src/components/admin/addTaskZx.vue

@@ -0,0 +1,296 @@
+<template>
+	<div style="width: 100%">
+		<el-breadcrumb separator-class="el-icon-arrow-right">
+
+			<el-breadcrumb-item>首页</el-breadcrumb-item>
+			<el-breadcrumb-item>监测任务</el-breadcrumb-item>
+			<el-breadcrumb-item>新增任务</el-breadcrumb-item>
+		</el-breadcrumb>
+		<div class="title">
+			新增任务
+		</div>
+
+		<el-form :model="form" label-width="100px">
+			<el-form-item label="任务名称" required>
+				<el-input v-model="form.task_name" placeholder="最长40字符"></el-input>
+			</el-form-item>
+			<el-form-item label="任务优先级" required>
+				<el-select v-model="form.level" placeholder="请选择">
+					<el-option v-for="item in priority" :key="item.value" :label="item.label" :value="item.value">
+					</el-option>
+				</el-select>
+			</el-form-item>
+			<el-form-item label="年度" required>
+				<el-date-picker v-model="form.year" type="year" value-format="yyyy">
+				</el-date-picker>
+			</el-form-item>
+			<el-form-item label="批次" required>
+				<el-select v-model="form.batch">
+					<el-option v-for="item in batch" :key="item.label" :label="item.label" :value="item.label">
+					</el-option>
+				</el-select>
+			</el-form-item>
+			<el-form-item label="任务时间" required>
+				<el-col :span="8">
+					<el-date-picker v-model="form.starttime" type="date" value-format="yyyy-MM-dd">
+					</el-date-picker>
+				</el-col>
+				<el-col :span="1">
+					<div class="line">--</div>
+				</el-col>
+				<el-col :span="11">
+					<el-date-picker v-model="form.endtime" type="date" value-format="yyyy-MM-dd">
+					</el-date-picker>
+				</el-col>
+			</el-form-item>
+			<!-- <el-form-item label="发布单位" required>
+				<el-input v-model="rymc" :disabled="true"></el-input>
+			</el-form-item> -->
+			<!-- <el-form-item label="牵头单位" required>
+				<el-input v-model="form.main_unit" @focus="getTestListShow = true"></el-input>
+			</el-form-item> -->
+			<el-form-item label="文件号">
+				<el-input v-model="form.filenum"></el-input>
+			</el-form-item>
+			<el-form-item label="抽检分离:" prop="is_divide" width="70px" class="labelItem" required>
+					<el-select  v-model="form.is_divide" size="" >
+						<el-option v-for="item in divideOptions" :key="item.id" :label="item.name" :value="item.id">
+						</el-option>
+					</el-select>
+			</el-form-item>
+			<el-form-item label="备注">
+				<el-input type="textarea" placeholder="最长300字符" v-model="form.log"></el-input>
+			</el-form-item>
+			<el-form-item label="附件" required>
+				<el-upload class="upload-demo" :file-list="fileList" drag :headers="myHeaders"
+					action="http://syjcapi.aielab.net/api/v1/ossUpload" :on-success="uploadSuccess"
+					:limit="1">
+					<i class="el-icon-upload"></i>
+					<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+				</el-upload>
+			</el-form-item>
+			<el-form-item>
+				<el-button type="success" @click="onSubmit()">保存</el-button>
+				<el-button type="success" @click="nextStep()">下一步</el-button>
+				<el-button @click="reBack()">返回</el-button>
+			</el-form-item>
+		</el-form>
+	</div>
+</template>
+<script>
+	const rymc = window.sessionStorage.getItem('rymc')
+	const token = window.sessionStorage.getItem('token')
+	export default {
+		data() {
+			return {
+				task_class:'',
+				// rymc: rymc,		//从本地缓存获取发布单位
+				myHeaders: {
+					Authorization: 'bearer'+ token			//上传文件添加token
+				},
+				// 任务表单
+				form: {
+					main_unit: [],	
+				},
+				// 优先级选项
+				priority: [{
+					value: '0',
+					label: '一般'
+				}, {
+					value: '1',
+					label: '紧急'
+				}, {
+					value: '2',
+					label: '特急'
+				}],
+				// 批次选项
+				batch: [{
+					label: '一季度'
+				}, {
+					label: '二季度'
+				}, {
+					label: '三季度'
+				}, {
+					label: '四季度'
+				}],
+				// 抽检分离选项
+				divideOptions: [{
+						id: 0,
+						name: '否'
+					},
+					{
+						id: 1,
+						name: '是'
+					}
+				],
+				// 上传成功文件列表
+				fileList: []
+			}
+		},
+		created() {
+			 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);
+			//       }
+			//     })
+			//   })
+			// })
+		},
+		methods: {
+			//保存
+			async onSubmit() {
+				this.form['token'] = token
+				this.form['groupname'] = this.groupname
+				this.form['orgs'] = this.orgs
+				this.form['releaser'] = window.sessionStorage.getItem('rymc')
+				this.form['task_class'] = '专项监测'
+				this.form['ispublic'] = 0
+				const result = await this.$http.post('postTasks', this.form)
+				
+				
+				// 判断业务逻辑
+				if (result.code == 0) {
+						this.$message({
+						type: 'success',
+						message: result.data.message
+					})
+				} else {
+					this.$message({
+						type: 'success',
+						message: result.data.message
+					})
+				}
+					
+			},
+			//返回
+			reBack() {
+				this.$router.push('specialMonitor')
+			},
+			//下一步
+			nextStep(id){
+			console.log(id)
+			this.$router.push({
+				name:'addTaskObjectZx',
+				params:{
+					task_id:id
+				}
+			})
+			},			
+			// 获取任务列表
+			async postTasks() {
+				const result = await this.$http.post('postTasks', this.queryInfo)
+			// 	// 判断业务逻辑
+				// if (result.data.code == 0) {
+			// 		this.testList = result.data.data.rows
+			// 		this.total = result.data.data.total
+					this.task_id = result.data.task_id},
+			// 	}else{
+			// 		this.$message({
+			// 			type: 'error',
+			// 			message: result.data.message
+			// 		})
+			// 	}
+			// },
+			// 获取检测机构列表
+			// async getTestList() {
+			// 	this.queryInfo['token'] = token
+			// 	const result = await this.$http.post('getTestList', this.queryInfo)
+			// 	console.log(result);
+				// 判断业务逻辑
+			// 	if (result.data.code == 0) {
+			// 		this.testList = result.data.data.rows
+			// 		this.total = result.data.data.total
+			// 	}
+			// },
+			/** 修复当用户在大于1的分页进行数据搜索没有返回值的问题 */
+			// setPageNum() {
+			// 	this.queryInfo.pageNum = 1
+			// 	this.getTestList()
+			// },
+			// setSelectedRow() {
+			// 	// 设置当前页已选项
+			// 	this.hander = true
+			// 	this.testList.forEach(item => {
+			// 		if (this.list.includes(item[this.uniqueKey])) {
+			// 			this.$refs.multipleTable.toggleRowSelection(item, true)
+			// 		}
+			// 	})
+			// 	this.hander = false
+			// },
+
+			/** 监听每页显示多少数据的改变 */
+			// handleSizeChange(newSize) {
+			// 	this.queryInfo.pageSize = newSize
+			// 	this.getTestList()
+			// },
+
+			/** 监听页码的改变 */
+			// handleCurrentChange(newPage) {
+			// 	this.queryInfo.pageNum = newPage
+			// 	this.getTestList()
+			// },
+			// // 批量勾选
+			// handleSelectionChange(val) {
+			// 	this.multipleSelection = val
+			// 	if (this.hander) return false
+			// 	// this.setSelectRows() // 处理选中的方法
+			// },
+			// 提交
+			// choseTest() {
+			// 	let that = this
+			// 	that.orgs = that.multipleSelection
+			// 	console.log(that.orgs)
+			// 	that.form.main_unit = that.multipleSelection.map(el => el.name).join(', ')
+			// 	console.log(that.form.main_unit)
+				// that.form.main_unit = that.multipleSelection
+				// for(let i=0;i<that.multipleSelection.length;i++){
+				// 	that.form.main_unit.push(that.multipleSelection[i].name)
+				// }
+				// that.getTestListShow = false
+				// 上传成功
+				uploadSuccess(res) {
+				console.log(res.data)
+				this.form.file_url = res.data.fileUrl
+				this.form.file_name = res.data.fileName
+			}
+			},
+			
+		}
+	
+</script>
+<style lang="less" scoped>
+	.title {
+		margin-left: 50%;
+		margin-bottom: 20px;
+	}
+
+	.el-form {
+		width: 800px;
+		margin: 0 auto;
+	}
+
+	.footer {
+		margin-top: 5px;
+		display: flex;
+		flex-direction: row;
+		justify-content: space-between;
+	}
+</style>

+ 84 - 76
src/components/admin/checkMonitor.vue

@@ -5,7 +5,7 @@
 		<el-breadcrumb separator-class="el-icon-arrow-right">		
 		  <el-breadcrumb-item >首页</el-breadcrumb-item>
 		  <el-breadcrumb-item>监测任务</el-breadcrumb-item>
-		  <el-breadcrumb-item>例行监测</el-breadcrumb-item>
+		  <el-breadcrumb-item>监督抽查</el-breadcrumb-item>
 		  <el-breadcrumb-item>任务列表</el-breadcrumb-item>
 		</el-breadcrumb>
 		</div>
@@ -14,12 +14,11 @@
 		<div class="headSearch">
 			<el-row :gutter="120" style="margin-right: 0px;">
 				<el-form :inline="true">
-				<!-- <el-form style="display: flex; flex-direction: row;" > -->
-				<el-form-item label="年度" class="select" size="small">
+				<el-form-item label="年度"  size="small">
 					<el-date-picker v-model="queryInfo.year" style="width: 110px;" value-format="yyyy" type="year" clearable />
 				</el-form-item>
 
-				<el-form-item label="任务状态" class="select" size="small">
+				<el-form-item label="任务状态" size="small">
 					<el-select v-model="queryInfo.ispublic" style="width: 110px;" clearable>
 						<el-option 
 							v-for="item in taskispublic" 
@@ -29,29 +28,19 @@
 						</el-option>
 					</el-select>
 				</el-form-item>
-				<!-- 起止时间 -->
-				<el-form-item label="任务时间" class="select" size="small">
-					<el-date-picker v-model="queryInfo.starttime" style="width: 120px;" align="right" type="date"
+
+				<el-form-item label="任务时间" size="small">
+					<el-date-picker v-model="queryInfo.starttime" style="width: 180px;" align="right" type="date"
 						:picker-options="pickerOptions" clearable value-format="yyyy-MM-dd" />
 				</el-form-item>
-				<el-form-item label="--" class="select" style="margin-left: 10px;" size="small">
-					<el-date-picker v-model="queryInfo.endtime" style="width: 120px;" align="right" type="date"
+
+				<el-form-item label="--" style="margin-left: 8px;" size="small">
+					<el-date-picker v-model="queryInfo.endtime" style="width: 180px;" align="right" type="date"
 						:picker-options="pickerOptions"  clearable />
 				</el-form-item>
 
-				<el-form-item label="任务名称" class="select" size="small">
-					<el-input v-model="queryInfo.task_name" style="width: 120px;"></el-input>
-				</el-form-item>
-					<!--创建者搜索 -->
-				<el-form-item label="创建者" size="small"> 
-					<el-autocomplete
-						class="inline-input"
-						v-model="state2"
-						:fetch-suggestions="querySearch"
-						placeholder="请输入内容"
-						:trigger-on-focus="false"
-						@select="handleSelect">
-					</el-autocomplete>
+				<el-form-item label="任务名称" size="small">
+					<el-input v-model="queryInfo.task_name"></el-input>
 				</el-form-item>
 				<!-- 查询 -->
 				<el-button  size="mini" style="height: 40px;margin-left: 10px;" type="success" @click="searchData()">查询</el-button>
@@ -88,7 +77,7 @@
 			<template slot-scope="scope">
 				{{ scope.$index+1 }}
 			</template>
-			</el-table-column>
+		</el-table-column>
 			<el-table-column :key="table.label" v-for="table in tableHeader" :label="table.label" :prop="table.prop" align="center"
 				:width="table.width" :fixed="table.fixed" />
 				<el-table-column prop="status" label="任务状态" width="130" align="center" >
@@ -113,11 +102,11 @@
 				<template slot-scope="scope">
 					<el-col style="margin-bottom: 5px;">
 						<el-button type="success" size="mini" @click="readDialogVisible1(scope.row)" style="margin-top:5px">详情</el-button>
-						<el-button type="success" size="mini" plain @click="takeTheLeadReportList(scope.row.id)" style="margin-top:5px">牵头单位报告</el-button>
+						<el-button type="success" size="mini" @click="sendBack(scope.row)" style="margin-top:5px" >退回</el-button>
 					</el-col>
 					<el-col style="margin-bottom: 5px;">
-						<el-button type="success" size="mini" plain @click="undertakeReport(scope.row.id)">承担单位报告</el-button>
-						<el-button type="success" size="mini" plain @click="taskSample(scope.row.id)">抽样单</el-button>
+						<el-button type="success" size="mini" plain @click="getJcds(scope.row.id)" style="margin-top:5px">检测单</el-button> 
+						<el-button type="success" size="mini" plain @click="sampleList(scope.row.id)">抽样单</el-button>
 					</el-col>
 				</template>
 			</el-table-column>
@@ -153,12 +142,18 @@
 				<el-form-item label="任务时间:" prop="starttime" width="200px" class="labelItem">
 					<div>{{readForm.starttime}} 至 {{readForm.endtime}}</div>
 				</el-form-item>
-				<el-form-item label="发布单位:" prop="releaser" class="labelItem">
-					<div>{{readForm.releaser}}</div>
+				<el-form-item label="发布单位:" prop="creater" class="labelItem">
+					<div>{{readForm.creater.name}}</div>
 				</el-form-item>
-				<el-form-item label="牵头单位:" prop="main_unit" class="labelItem">
-					<div>{{readForm.main_unit}}</div>
+				<el-form-item label="抽样单位:" prop="taskProfile.sample_org_id.name " class="labelItem">
+					<div>{{readForm.taskProfile.sample_org_id.name }}</div>
+				</el-form-item>
+				<el-form-item label="检测单位:" prop="taskProfile.check_org_id.name" class="labelItem">
+					<div>{{readForm.taskProfile.check_org_id.name}}</div>
 				</el-form-item>
+				<!-- <el-form-item label="牵头单位:" prop="main_unit" class="labelItem">
+					<div>{{readForm.main_unit}}</div>
+				</el-form-item> -->
 				<el-form-item label="附件:" prop="file_url" class="labelItem">
 					<!-- <div>{{readForm.file_url}}</div> -->
 					<el-link :href="readForm.file_url" type="primary">{{readForm.file_name}}</el-link>
@@ -187,16 +182,21 @@
 		name: '',
 		data() {
 			return {
+				task_id:'',
 				queryInfo:{
+					creater:'',
+					task_name_like:'',
+					level:'',
 					year:'',
+					batch:'',
 					task_name:'',
 					starttime:'',
 					endtime:'',
 					ispublic:'',
 					pageSize:10,
 					pageNum:1,
-					task_class:'监督抽查'
-				},
+					task_class:'监督抽查',
+				}, 
 				total:0,
 				cellStyle: {
 					padding: 2 + 'px'
@@ -305,58 +305,74 @@
 		},
 		created() {
 			this.getTasks()
+			this.task_id = this.$route.params.id
 		},
 		methods: {
+			//新增
 			add() {
-				this.$router.push('addTask')
+				this.$router.push('addTaskJd')
 			},
-			takeTheLeadReportList(id) {
-				console.log(id)
+			//查看抽样机构
+			sampleList(id){
 				this.$router.push({
-					name:'takeTheLeadReportList',
+					name:'setTaskJg',
 					params: {
-					task_id: id,
+					id:id,
 					}
 				})
 			},
-			undertakeReport(id){
+			//查看检测机构
+			getJcds(id) {
 				console.log(id)
 				this.$router.push({
-					name:'undertakeReport',
+					name:'getJcds',
 					params: {
-					task_id: id,
+					id: id,
+					parentName:'例行监测',
+					labelName:'检测单'
 					}
 				})
 			},
-			taskSample(id){
-				console.log(id)
-				this.$router.push({
-					name:'taskSample',
-					params: {
-					task_id: id,
-					}
-				})
-		},
-			
 			// 搜索
 			async searchData() {
 				this.queryInfo.pageNum = 1
-				this.gettaskList()
+				this.queryInfo.task_name_like = this.queryInfo.task_name
+				console.log(this.queryInfo.task_name)
+				this.getTasks()
 			},
 			// 重置
 			reset(){
 				this.queryInfo={
 					year:'',
 					task_name:'',
+					task_name_like:'',
 					starttime:'',
 					endtime:'',
 					ispublic:'',
 					pageSize:10,
 					pageNum:1,
 					task_class:'监督抽查',
-					task_id
+					// task_id
 				}
 				this.getTasks()
+			},
+			//退回
+			async sendBack(){
+				const result = await this.$http.post("postRetask", this.queryInfo);
+					if (result.data.code == 0) {
+						this.$message({
+						type: 'success',
+						message:'退回成功',
+					})
+				} else {
+					this.$message({
+						type: 'warning',
+						message:'退回失败',
+					})
+				}
+				console.log(result.data.code)
+				
+				
 			},
 			/** 监听页码的改变 */
 			handleCurrentChange(newPage) {
@@ -385,20 +401,30 @@
 			},
 			// 查看任务详情
 			async readDialogVisible1(row) {
+				console.log(this.readForm	)
+				console.log(row)
 				this.readForm.batch = row.batch
 				this.readForm.task_name = row.task_name
 				this.readForm.task_class = row.task_class
 				this.readForm.level = row.level
-				console.log(this.readForm.level)
 				this.readForm.year = row.year
 				this.readForm.starttime = row.starttime
 				this.readForm.endtime = row.endtime
 				this.readForm.releaser = row.releaser
+				this.readForm.creater = row.creater
 				this.readForm.main_unit = row.main_unit
 				this.readForm.file_url = row.file_url
 				this.readForm.file_name = row.file_name
 				this.readForm.filenum = row.filenum
 				this.readForm.log = row.log
+                const {
+					data: res
+				} = await this.$http.post(
+					"getTask", {task_id:row.id}
+				);
+                this.readForm.taskProfile = res.data.taskProfile
+			   
+
 				this.readDialogVisible = true
 
 			},
@@ -415,16 +441,13 @@
 				// 		this.$alert('任务仅创建者可以删除!', {
 				// 			confirmButtonText: '确定',
 				// 			callback: action => {
-
 				// 			}
 				// 		});
 				// 	}
 				// }
 				var that = this;
 				const length = this.multipleSelection.length;
-				// var val = this.selectedData;
 				for (let i = 0; i < length; i++) {
-					// console.log(this.multipleSelection[i])
 					this.delarr.push(this.multipleSelection[i].id);
 				}
 				const result = await this.$http.post('deleteTasks', {
@@ -444,24 +467,12 @@
 						message: '删除失败!'
 					});
 				}
-				// console.log(this.$refs.multipleTable);
 				this.$refs.multipleTable.clearSelection();
 				that.delarr = [];
-				// this.$refs.multipleTable.clearSelectionFun();
+				this.getTasks()
 			},
 			// 发布任务
 			async ispublic() {
-				// 判断任务是否为该创建者创建
-				// for (let i = 0; i < this.multipleSelection.length; i++) {
-				// 	if (rybh != this.multipleSelection[i].releaser) {
-				// 		this.$alert('任务仅创建者可以发布!', {
-				// 			confirmButtonText: '确定',
-				// 			callback: action => {
-
-				// 			}
-				// 		});
-				// 	}
-				// }
 				var that = this;
 				let canPub = 0
 				const length = this.multipleSelection.length;
@@ -482,7 +493,7 @@
 					}
 				}
 				if(canPub==1){
-					const result = await this.$http.post('isPublicTask', {
+					const result = await this.$http.post('putTaskPublic', {
 						pubarr: that.multipleSelection,
 						token: token,
 					})
@@ -524,12 +535,11 @@
 						this.$alert('任务不在可废止状态!', {
 							confirmButtonText: '确定',
 							callback: action => {
-
 							}
 						});
 					}
 					if(canPub==1){
-						const result = await this.$http.post('isPublicTask', {
+						const result = await this.$http.post('putTaskPublic', {
 							pubarr: that.pubarr,
 							token: token
 						})
@@ -545,8 +555,6 @@
 				}
 
 			}
-
-
 		},
 	}
 </script>
@@ -585,7 +593,7 @@
 	.select {
 		// display: flex;
 		flex-direction: row;
-		// margin-left: 10px;
+		margin-left: 35px;
 		
 	}
 
@@ -629,6 +637,6 @@
 		margin-top: 20px;
 	}
 	.headSearch{
-		margin-left: 25px;
+		margin-left: 60px;
 	}
 </style>

+ 12 - 2
src/components/admin/editInformation.vue

@@ -77,7 +77,7 @@
 
 			<el-form-item>
 				<el-button type="success" @click="onSubmit()">保存</el-button>
-				<!-- <el-button type="success" @click="nextStep()">下一步</el-button> -->
+				<el-button type="success" @click="nextStep()">下一步</el-button>
 				<el-button @click="reBack()">返回</el-button>
 			</el-form-item>
 		</el-form>
@@ -184,8 +184,18 @@
 			reBack() {
 				this.$router.push('reTask')
 			},
-		},
+			//下一步
+			nextStep(id){
+			console.log(id)
+			this.$router.push({
+				name:'nextStep',
+				params:{
+					task_id:id
+				}
+			})
+			},
 	}
+}
 	
 </script>
 <style lang="less" scoped>

+ 20 - 6
src/components/admin/getJcds.vue

@@ -1,12 +1,11 @@
 <template>
-    
    	<div style="width: 100%">
         <!-- 标题栏导航 -->
 	    <div slot="header" class="clearfix">
             <el-breadcrumb separator-class="el-icon-arrow-right">		
             <el-breadcrumb-item >首页</el-breadcrumb-item>
-            <el-breadcrumb-item>例行监测</el-breadcrumb-item>
-            <el-breadcrumb-item>查看检测机构</el-breadcrumb-item>
+            <el-breadcrumb-item>{{parentName}}</el-breadcrumb-item>
+            <el-breadcrumb-item>{{labelName}}</el-breadcrumb-item>
             </el-breadcrumb>
 		</div>
 <!-- 表格区域 -->
@@ -25,11 +24,11 @@
                 :current-page="queryInfo.pageNum" :page-sizes="[10, 15, 20]" :page-size="queryInfo.pageSize"
                 layout="total, sizes, prev, pager, next, jumper" :total="total" background />
         <!-- 返回按钮 -->
-            <div class="btns">
+            <!-- <div class="btns">
                 <el-button plain size="medium" @click="returnTask()" >
                     返回
                 </el-button>
-            </div>
+            </div> -->
     </div>
 </template>
 
@@ -40,6 +39,8 @@ export default {
             // 数据表格数据
 			tableData: [],
             sampleOrgId:{},
+            parentName:'',
+            labelName:'',
             queryInfo:{
 				pageSize:10,
 					pageNum:1,
@@ -70,12 +71,25 @@ export default {
     },
     created() {
         this.task_id = this.$route.params.id
+        this.parentName = this.$route.params.parentName
+        this.labelName = this.$route.params.labelName
         this.getJgTaskProfiles()
     },
 	methods: {
         //返回
         returnTask(){
-            this.$router.push('routineMonitor')
+            if(this.parentName == '例行监测'){
+                this.$router.push({
+                    name:'routineMonitor',
+                    params:{id:this.$route.params.id}
+                })
+            }
+            if(this.parentName == '专项监测'){
+                 this.$router.push({
+                    name:'specialMonitor',
+                    params:{id:this.$route.params.id}
+                })
+            }
         },
         // 获取检测机构列表
         async getJgTaskProfiles() {

+ 8 - 5
src/components/admin/getMonitor.vue

@@ -12,11 +12,11 @@
 		<div class="headSearch" >
 			<el-row :gutter="120" style="margin-right: 0px;">
 				<el-form :inline="true">
-                    <el-form-item label="组别"  size="small">
+                    <!-- <el-form-item label="组别"  size="small">
                         <el-select v-model="queryInfo.groupname" style="width: 150px;" clearable>
-                            <el-option v-for="item in groupList" :key="item.value" :label="item.label" :value="item.value" ></el-option>
+                            <el-option v-for="item in groupList" :key="item.value" :label="item.label" :value="item.label" ></el-option>
                         </el-select>
-                    </el-form-item>
+                    </el-form-item> -->
 
                     <!-- <el-form-item label="机构性质" size="small">
                         <el-select v-model="queryInfo.jgxz" style="width: 150px;" clearable>
@@ -36,7 +36,7 @@
 		</div>
 
         <!-- 表格区域 -->
-        <el-table ref="multipleTable" :data="tableData"  border stripe highlight-current-row style="width: 100%" :row-style="rowStyle" :cell-style="cellStyle" >
+        <el-table class="biaoge" ref="multipleTable" :data="tableData"  border stripe highlight-current-row style="width: 100%" :row-style="rowStyle" :cell-style="cellStyle" >
             <el-table-column label="序号" width="50px">
                 <template slot-scope="scope">
                     {{ scope.$index+1 }}
@@ -113,7 +113,7 @@ export default {
                 pageNum:1,
                 groupname:'',
                 jgxz:'',
-                name:''
+                name:'',
             }, 
            	// 查看任务详情
             readDialogVisible: false,
@@ -255,4 +255,7 @@ export default {
 .fenYeQi{
      margin-top: 10px;
 }
+.biaoge{
+    margin-top: 10px;
+}
 </style>

+ 87 - 61
src/components/admin/getOrganization.vue

@@ -12,27 +12,23 @@
 		<div class="headSearch" >
 			<el-row :gutter="120" style="margin-right: 0px;">
 				<el-form :inline="true">
-                    <el-form-item label="农业系统"  size="small">
-                        <el-select v-model="queryInfo.dtLevel" style="width: 150px;" clearable>
-                            <el-option v-for="item in dtLevelList" :key="item.value" :label="item.label" :value="item.value" ></el-option>
-                        </el-select>
-                    </el-form-item>
-
-                    <el-form-item label="机构性质" size="small">
+                    <!-- <el-form-item label="机构性质" size="small">
                         <el-select v-model="queryInfo.jgxz" style="width: 150px;" clearable>
                             <el-option v-for="item in jxgzList" :key="item.value" :label="item.label" :value="item.value" ></el-option>
                         </el-select>
-                    </el-form-item>
+                    </el-form-item> -->
 
-                    <el-form-item label="产品范围" size="small">
-                        <el-select v-model="queryInfo.cpfw" style="width: 150px;" clearable>
-                            <el-option v-for="item in cpfwList" :key="item.value" :label="item.label" :value="item.value" ></el-option>
-                        </el-select>
+                  <el-form-item label="机构名称" size="small">
+                        <el-input v-model="queryInfo.name"></el-input>
                     </el-form-item>
-
-                    <el-form-item label="法人姓名" size="small">
+                    <!-- <el-form-item label="法人姓名" size="small">
                         <el-input v-model="queryInfo.user_fa"></el-input>
-                    </el-form-item>
+                    </el-form-item> -->
+                    <!-- <el-form-item label="产品范围" size="small">
+                        <el-select v-model="queryInfo.cpfw" style="width: 150px;" clearable>
+                            <el-option v-for="item in cpfwList" :key="item.value" :label="item.label" :value="item.label" ></el-option>
+                        </el-select>
+                    </el-form-item> -->
                     <!-- 查询 -->
                     <el-button  size="mini" style="height: 40px;margin-left: 10px;" type="success" @click="searchData()">查询</el-button>
                     <!-- 重置 -->
@@ -42,7 +38,7 @@
 		</div>
 
         <!-- 表格区域 -->
-        <el-table ref="multipleTable" :data="tableData"  border stripe highlight-current-row style="width: 100%" :row-style="rowStyle" :cell-style="cellStyle" >
+        <el-table class="biaoge" ref="multipleTable" :data="tableData"  border stripe highlight-current-row style="width: 100%" :row-style="rowStyle" :cell-style="cellStyle" >
             <el-table-column label="序号" width="50px">
                 <template slot-scope="scope">
                     {{ scope.$index+1 }}
@@ -69,55 +65,58 @@
         <!-- 任务详情对话框-->
 		<el-dialog title="查看详情" :visible.sync="readDialogVisible" width="30%" :close-on-click-modal="false" class="dialogItem">
             <el-form v-if="readDialogVisible" :model="readForm" label-width="150px">
-                <el-form-item label="依托单位:" prop="dtRelyOnUnit" class="labelItem">
+                <el-form-item label="机构名称:" prop="name" class="labelItem">
+					<div>{{readForm.name}}</div>
+				</el-form-item>
+                <el-form-item label="依托单位:" prop="userJcjgProfile.dtRelyOnUnit" class="labelItem">
 					<div>{{readForm.dtRelyOnUnit}}</div>
 				</el-form-item>
-                <el-form-item label="审核状态:" prop="flag" class="labelItem">
+                <el-form-item label="审核状态:" prop="userJcjgProfile.flag" class="labelItem">
 					<div v-if="readForm.flag=='1'">已通过审核</div>
                     <div v-else>未通过</div>
 				</el-form-item>
-                	<el-form-item label="机构性质:" prop="jgxz" class="labelItem">
-					<div v-if="readForm.jgxz=='1'">政府部分</div>
-					<div v-else-if="readForm.level=='2'">事业单位</div>
+                	<el-form-item label="机构性质:" prop="userJcjgProfile.properties" class="labelItem">
+					<div v-if="readForm.properties=='1'">政府部分</div>
+					<div v-else-if="readForm.properties=='2'">事业单位</div>
 					<div v-else>企业</div>
 				</el-form-item>
-                <el-form-item label="统一社会信用代码:" prop="dtCode" class="labelItem">
+                <el-form-item label="统一社会信用代码:" prop="userJcjgProfile.dtCode" class="labelItem">
 					<div>{{readForm.dtCode}}</div>
 				</el-form-item>
-                 <el-form-item label="通讯地址:" prop="address" class="labelItem">
+                 <el-form-item label="通讯地址:" prop="userJcjgProfile.address" class="labelItem">
 					<div>{{readForm.address}}</div>
 				</el-form-item>
-                 <el-form-item label="法人名称:" prop="user_fa" class="labelItem">
+                 <el-form-item label="法人名称:" prop="userJcjgProfile.user_fa" class="labelItem">
 					<div>{{readForm.user_fa}}</div>
 				</el-form-item>
-                 <el-form-item label="邮编:" prop="zipcode" class="labelItem">
+                 <el-form-item label="邮编:" prop="userJcjgProfile.zipcode" class="labelItem">
 					<div>{{readForm.zipcode}}</div>
 				</el-form-item>
-                 <el-form-item label="技术负责人:" prop="user_js" class="labelItem">
+                 <el-form-item label="技术负责人:" prop="userJcjgProfile.user_js" class="labelItem">
 					<div>{{readForm.user_js}}</div>
 				</el-form-item>
-                 <el-form-item label="质量负责人:" prop="user_zl" class="labelItem">
+                 <el-form-item label="质量负责人:" prop="userJcjgProfile.user_zl" class="labelItem">
 					<div>{{readForm.user_zl}}</div>
 				</el-form-item>
-                 <el-form-item label="catl证书编码:" prop="catl_code" class="labelItem">
+                 <el-form-item label="catl证书编码:" prop="userJcjgProfile.catl_code" class="labelItem">
 					<div>{{readForm.catl_code}}</div>
 				</el-form-item>
-                 <el-form-item label="catl证书到期时间:" prop="calt_expiration" class="labelItem">
+                 <el-form-item label="catl证书到期时间:" prop="userJcjgProfile.calt_expiration" class="labelItem">
 					<div>{{readForm.calt_expiration}}</div>
 				</el-form-item>
-                 <el-form-item label="cma证书编码:" prop="cma_code" class="labelItem">
+                 <el-form-item label="cma证书编码:" prop="userJcjgProfile.cma_code" class="labelItem">
 					<div>{{readForm.cma_code}}</div>
 				</el-form-item>
-                 <el-form-item label="cma证书到期时间:" prop="cma_expiration" class="labelItem">
+                 <el-form-item label="cma证书到期时间:" prop="userJcjgProfile.cma_expiration" class="labelItem">
 					<div>{{readForm.cma_expiration}}</div>
 				</el-form-item>
-                 <el-form-item label="产品范围:" prop="cpfw" class="labelItem">
+                 <el-form-item label="产品范围:" prop="userJcjgProfile.cpfw" class="labelItem">
 					<div>{{readForm.cpfw}}</div>
 				</el-form-item>
-                 <el-form-item label="认证产品数量(个):" prop="shuliang" class="labelItem">
+                 <el-form-item label="认证产品数量(个):" prop="userJcjgProfile.shuliang" class="labelItem">
 					<div>{{readForm.shuliang}}</div>
 				</el-form-item>
-                <el-form-item label="认证参数数量(个):" prop="canshu" class="labelItem">
+                <el-form-item label="认证参数数量(个):" prop="userJcjgProfile.canshu" class="labelItem">
 					<div>{{readForm.canshu}}</div>
 				</el-form-item>
                 
@@ -133,6 +132,7 @@ export default {
     data(){
         return{
             queryInfo:{
+                name:'',
                 pageSize:10,
                 pageNum:1,
                 jgxz:'',
@@ -140,7 +140,8 @@ export default {
                 cpfw:'',
                 user_fa:'',
                 flag:'',
-                dtRelyOnUnit:''
+                dtRelyOnUnit:'',
+                groupname:'检测机构'
             }, 
            	// 查看任务详情
             readDialogVisible: false,
@@ -155,37 +156,43 @@ export default {
             tableData:[],
         //表格区域
         tableHeader: [
-            {
-                label: '依托单位',
-                prop: 'dtRelyOnUnit',
+             {
+                label: '机构名称',
+                prop: 'name',
                 width: 180
 			},{
-                label: '信用代码',
-                prop: 'dtCode',
+                label: '依托单位',
+                prop: 'userJcjgProfile.dtRelyOnUnit',
                 width: 180
-            },{
+			},
+            // {
+            //     label: '信用代码',
+            //     prop: 'dtCode',
+            //     width: 180
+            // },
+            {
                 label: '法人姓名',
-                prop: 'user_fa',
+                prop: 'userJcjgProfile.user_fa',
                 width: 100
             },{
                 label: 'cma证书编码',
-                prop: 'cma_code',
+                prop: 'userJcjgProfile.cma_code',
                 width: 150
             },{
                 label: 'mara证书编码',
-                prop: 'mara_code',
+                prop: 'userJcjgProfile.mara_code',
                 width: 140
             },{
                 label: '机构性质',
-                prop: 'jgxz',
+                prop: 'properties',
                 width: 150
             },{
                 label: '产品范围',
-                prop: 'cpfw',
+                prop: 'userJcjgProfile.cpfw',
                 width: 150
             },{
                 label: '认证参数数量',
-                prop: 'canshu',
+                prop: 'userJcjgProfile.canshu',
                 width: 150
             }
         ],
@@ -239,11 +246,24 @@ export default {
             const {data: res} = await this.$http.post("getJcOrgs", this.queryInfo);
             this.tableData = res.data.rows
             this.total = res.data.total
+            console.log(this.tableData) 
+            for(let i= 0; i < this.tableData.length; i++) {
+                if (this.tableData[i].properties == 1){
+                      this.tableData[i].properties ='政府部门';
+                }else if(this.tableData[i].properties == 2){
+                    this.tableData[i].properties ='事业单位';
+                }else{
+                     this.tableData[i].properties ='企业';
+                }
+            }
         },
         //查询
         async searchData(){
 				this.queryInfo.pageNum = 1
 				this.getJcOrgs()
+                // this.queryInfo.cpfw = res.data.rows.userJcjgProfile.cpfw
+                // this.queryInfo.task_name_like = this.queryInfo.task_name
+				console.log(this.queryInfo.name)
 		}, 
         //重置
         reset(){
@@ -255,7 +275,9 @@ export default {
                 cpfw:'',
                 user_fa:'',
                 flag:'',
-                dtRelyOnUnit:''
+                dtRelyOnUnit:'',
+                groupname:'检测机构'
+
 				}
 				this.getJcOrgs()
         },
@@ -280,21 +302,22 @@ export default {
                 },
 			// 查看主体信息详情
 			async readDialogVisible1(row) {
-				this.readForm.dtRelyOnUnit = row.dtRelyOnUnit
-                this.readForm.flag = row.flag
-                this.readForm.dtCode = row.dtCode
-                this.readForm.address = row.address
-                this.readForm.user_fa = row.user_fa
-                this.readForm.zipcode = row.zipcode
-                this.readForm.user_js = row.user_js
-                this.readForm.user_zl = row.user_zl
+                this.readForm.name = row.name
+				this.readForm.dtRelyOnUnit = row.userJcjgProfile.dtRelyOnUnit
+                this.readForm.flag = row.userJcjgProfile.flag
+                this.readForm.dtCode = row.userJcjgProfile.dtCode
+                this.readForm.address = row.userJcjgProfile.address
+                this.readForm.user_fa = row.userJcjgProfile.user_fa
+                this.readForm.zipcode = row.userJcjgProfile.zipcode
+                this.readForm.user_js = row.userJcjgProfile.user_js
+                this.readForm.user_zl = row.userJcjgProfile.user_zl
                 this.readForm.catl_code = row.catl_code
                 this.readForm.calt_expiration = row.calt_expiration
-                this.readForm.cma_code = row.cma_code
-                this.readForm.cma_expiration = row.cma_expiration
-                this.readForm.cpfw = row.cpfw
-                this.readForm.shuliang = row.shuliang
-                this.readForm.canshu = row.canshu
+                this.readForm.cma_code = row.userJcjgProfile.cma_code
+                this.readForm.cma_expiration = row.userJcjgProfile.cma_expiration
+                this.readForm.cpfw = row.userJcjgProfile.cpfw
+                this.readForm.shuliang = row.userJcjgProfile.shuliang
+                this.readForm.canshu = row.userJcjgProfile.canshu
 				console.log(this.readForm.dtRelyOnUnit)
 				this.readDialogVisible = true
 
@@ -312,4 +335,7 @@ export default {
 .fenYeQi{
      margin-top: 10px;
 }
+.biaoge{
+    margin-top: 10px;
+}
 </style>

+ 442 - 0
src/components/admin/nextStep.vue

@@ -0,0 +1,442 @@
+<template>
+	<div style="width: 100%">
+		<el-breadcrumb separator-class="el-icon-arrow-right">
+
+			<el-breadcrumb-item>首页</el-breadcrumb-item>
+			<el-breadcrumb-item>退回任务</el-breadcrumb-item>
+			<el-breadcrumb-item>编辑</el-breadcrumb-item>
+		</el-breadcrumb>
+		<div class="title">
+			退回任务
+		</div>
+		<el-form :model="form" label-width="100px">
+			<el-form-item prop="main_unit" label="抽样机构"  required>
+				<el-input v-model="form.main_unit" @focus="getOrganizationsShow1 = true"></el-input>
+			</el-form-item>
+			<el-form-item prop="check_unit" label="检测机构"   required>
+					<el-input v-model="form.check_unit" @focus="getOrganizationsShow2 = true"></el-input>
+			</el-form-item>
+			<el-form-item prop="sample_address" label="地区"   >
+				<el-cascader  :options="region" v-model="sample_address"
+					@change="handleChange">
+				</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>
+
+		<!-- 选择抽样机构对话框 -->
+		<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-select v-model="form.groupname" clearable>
+						<el-option v-for="item in group" :key="item.value" :label="item.label" :value="item.value">
+						</el-option>
+					</el-select>
+				</el-form-item>
+			</el-col>
+			<el-col :span="6"> -->
+				<!-- 机构性质 -->
+				<!-- <el-form-item label="机构性质">
+						<el-select v-model="form.properties" clearable>
+							<el-option v-for="item in field" :key="item.value" :label="item.label" :value="item.value">
+							</el-option>
+						</el-select>
+				</el-form-item>
+			</el-col>
+			<el-col :span="6">
+			</el-col>
+			<el-col :span="6">
+			<el-button type="success" @click="querySearch()" 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%">
+					<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 tableHeader" :label="table.label"
+						:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
+				</el-table>
+				<div class="footer">
+					<!--    分页器区域-->
+					<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+						:current-page="queryInfo1.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo1.pageSize"
+						layout="total, sizes, prev, pager, next, jumper" :total="total" background />
+					<el-button type="success" @click="choseTest1()">提交</el-button>
+				</div>
+				
+			</el-form>
+		</el-dialog>
+
+		<!-- 选择检测机构对话框 -->
+		<el-dialog title="机构选择" :visible.sync="getOrganizationsShow2" width="50%" :close-on-click-modal="false" @open="getOrganizations2()" class="dialogItem">
+			<el-form v-if="getOrganizationsShow2" :model="getOrganizationsForm2">
+		<!-- 检索功能 -->
+		<!-- <el-row :gutter="20">
+			<el-col :span="6"> -->
+				<!-- 组别名称 -->
+				<!-- <el-form-item label="组别名称">
+					<el-select v-model="form.groupname" clearable>
+						<el-option v-for="item in group" :key="item.value" :label="item.label" :value="item.value">
+						</el-option>
+					</el-select>
+				</el-form-item>
+			</el-col>
+			<el-col :span="6"> -->
+				<!-- 机构性质 -->
+				<!-- <el-form-item label="机构性质">
+						<el-select v-model="form.properties" clearable>
+							<el-option v-for="item in field" :key="item.value" :label="item.label" :value="item.value">
+							</el-option>
+						</el-select>
+				</el-form-item>
+			</el-col>
+			<el-col :span="6">
+			</el-col>
+			<el-col :span="6">
+			<el-button type="success" @click="choseTest()" style="margin-top:40px">搜索</el-button>
+			</el-col> -->
+		<!-- </el-row> -->
+				<!--  表格数据区域-->
+				<el-table ref="multipleTable" :data="testList2" row-key="id" @selection-change="handleSelectionChange2"
+					border stripe highlight-current-row style="width: 100%" >
+					<!-- <el-table :data="testList" border stripe highlight-current-row  @current-change="handleSelectionChange2" style="width: 100%"
+					:row-style="rowStyle" :cell-style="cellStyle"> -->
+					<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 tableHeader" :label="table.label"
+						:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
+				</el-table>
+				<div class="footer">
+					<!--    分页器区域-->
+					<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+						:current-page="queryInfo2.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo2.pageSize"
+						layout="total, sizes, prev, pager, next, jumper" :total="total" background />
+					<el-button type="success" @click="choseTest2()">提交</el-button>
+				</div>
+				
+			</el-form>
+		</el-dialog>
+			
+
+	</div>
+</template>
+<script>
+import {
+		regionData,
+		regionDataPlus,
+	} from 'element-china-area-data'
+	const rymc = window.sessionStorage.getItem('rymc')
+	const token = window.sessionStorage.getItem('token')
+	export default {
+		data() {
+			return {
+					form: {
+					bear_unit: '',
+					report_unit: '',
+					// check_unit: '',
+					sample_number: '',
+					sample_address: '',
+					uploadtime: '',
+					groupname:'',
+					properties:'',
+					main_unit:[],
+					check_unit:[]
+				},
+				currentRow: null,
+				currentRow2: null,
+				//组别名称
+				group: [{
+					value: '1',
+					label: '检测机构'
+				}, {
+					value: '2',
+					label: '县级监管单位'
+				}, {
+					value: '3',
+					label: '市级监管单位'
+				},{
+					value: '4',
+					label: '省级监管单位'
+				}],
+				//机构性质
+				field: [{
+					value: '1',
+					label: '政府部门'
+				}, {
+					value: '2',
+					label: '事业单位'
+				}, {
+					value: '3',
+					label: '企业'
+				}],
+
+				// 抽样地区
+				region: regionData,
+				// sample_address: [],
+				// 机构地域表格数据
+				underTask: [],
+				underTasktotal: 0,
+				// 抽检分离选项
+				divideOptions: [{
+						id: 0,
+						name: '否'
+					},
+					{
+						id: 1,
+						name: '是'
+					}
+				],
+				// rymc: rymc,		//从本地缓存获取发布单位
+				myHeaders: {
+					Authorization: 'bearer'+ token			//上传文件添加token
+				},
+				// 任务表单
+				// form: {
+				// 	main_unit: [],	
+				// 	check_unit: [],				
+				// },
+				// form: {
+				// 	check_unit: [],			
+				// },
+				// 优先级选项
+				priority: [{
+					value: '0',
+					label: '一般'
+				}, {
+					value: '1',
+					label: '紧急'
+				}, {
+					value: '2',
+					label: '特急'
+				}],
+				// 批次选项
+				batch: [{
+					label: '一季度'
+				}, {
+					label: '二季度'
+				}, {
+					label: '三季度'
+				}, {
+					label: '四季度'
+				}],
+
+				// 弹出抽样机构弹窗
+				getOrganizationsShow1: false,
+				// 查询检测机构请求参数
+				queryInfo1: {
+					pageNum: 1,
+					pageSize: 10,
+					keyWord: ''
+				},
+
+				// 弹出检测机构弹窗
+				getOrganizationsShow2: false,
+				// 查询检测机构请求参数
+				queryInfo2: {
+					pageNum: 1,
+					pageSize: 10,
+					keyWord: '',
+					groupname:'检测机构'
+				},
+				// 检测机构列表
+				testList2: [],
+				// 表头
+				tableHeader: [{
+						label: '单位名称',
+						prop: 'name',
+						width: 300
+						// fixed: 'left'
+					},
+					{
+						label: '机构类型',
+						prop: 'properties',
+						width:150
+						// fixed: 'left'
+					}, {
+						label: '组别名称',
+						prop: 'groupname',
+						width: 300
+						// fixed: 'left'
+					}
+				],
+				// 总共多少条数据
+				total: 0,
+				total2: 0,
+				// table表格多选选项
+				// multipleSelection: null,
+				getOrganizationsForm1: {},
+				getOrganizationsForm2: {},
+				// 选中的牵头单位
+				orgs: [],
+				orgs2: [],
+				// 上传成功文件列表
+				fileList: []
+			}
+		},
+		created:function(){
+			this.postTaskProfile()
+		},
+		
+		mounted() {
+			let that = this
+		},
+		methods: {
+			// 获取机构列表
+				async postTaskProfile() {
+				const result = await this.$http.post('postTaskProfile', {
+					task_id: this.task_id,
+					// pageSize:this.queryInfo.pageSize,
+					// pageNum:this.queryInfo.pageNum
+				})},
+			// 获取选择抽样地区
+			handleChange() {
+				var that = this
+				var loc = "";
+				// console.log(this.form.place)
+				for (let i = 0; i < this.sample_address.length; i++) {
+					loc += CodeToText[this.sample_address[i]];
+				}
+				// console.log(loc)
+				that.form.sample_address = loc
+			},
+			//保存
+			async onSubmit() {
+				this.form['token'] = token
+				this.form['groupname'] = this.groupname
+				this.form['orgs'] = this.orgs
+				this.form['releaser'] = window.sessionStorage.getItem('rymc')
+				this.form['task_class'] = 'retask'
+				this.form['ispublic'] = 0
+				
+				const result = await this.$http.post('postTaskProfile', this.form)
+				// 判断业务逻辑
+				if (result.data.code == 0) {
+					this.$router.push('reTask')
+				} else {
+					this.$message({
+						type: 'error',
+						message: result.data.message
+					})
+				}
+			},
+			reBack() {
+				this.$router.push('editInformation')
+			},		
+			// 获取抽样机构列表
+			async getOrganizations1() {
+				this.queryInfo1['token'] = token
+				const result = await this.$http.post('getOrganizations', this.queryInfo1)
+				console.log(result.data.code);
+				// 判断业务逻辑
+				if (result.data.code == 0) {
+					this.testList = result.data.data.rows
+					this.total = result.data.data.total
+				}
+			},
+
+			// 获取检测机构列表
+			async getOrganizations2() {
+				this.queryInfo2['token'] = token
+				const result = await this.$http.post('getOrganizations', this.queryInfo2)
+				console.log(result.data.code);
+				// 判断业务逻辑
+				if (result.data.code == 0) {
+					this.testList2 = result.data.data.rows
+					this.total2 = result.data.data.total
+				}
+			},
+			/** 修复当用户在大于1的分页进行数据搜索没有返回值的问题 */
+			setPageNum() {
+				this.queryInfo.pageNum = 1
+				this.getOrganizations1()
+			},
+			setSelectedRow() {
+				// 设置当前页已选项
+				this.hander = true
+				this.testList.forEach(item => {
+					if (this.list.includes(item[this.uniqueKey])) {
+						this.$refs.multipleTable.toggleRowSelection(item, true)
+					}
+				})
+				this.hander = false
+			},
+
+			/** 监听每页显示多少数据的改变 */
+			handleSizeChange(newSize) {
+				this.queryInfo1.pageSize = newSize
+				this.getOrganizations1()
+			},
+
+			/** 监听页码的改变 */
+			handleCurrentChange(newPage) {
+				this.queryInfo1.pageNum = newPage
+				this.getOrganizations1()
+			},
+			//批量勾选
+			// handleSelectionChange(val) {
+			// 	this.multipleSelection = val
+			// 	if (this.hander) return false
+			// 	this.setSelectRows() // 处理选中的方法
+			// },
+			//选中抽样(单选)
+			handleSelectionChange1(val) {
+				this.currentRow = val;
+				console.log(this.currentRow)
+				console.log(this.currentRow[0].name)
+			},
+			//选中检测(单选)
+			handleSelectionChange2(val) {
+				this.currentRow2 = val;
+				console.log(this.currentRow2)
+				console.log(this.currentRow2[0].name)
+			},
+			// 抽样单位提交
+			choseTest1() {
+				let that = this
+				that.form.main_unit = that.currentRow[0].name
+				that.getOrganizationsShow1 = false
+			},
+			// 检测单位提交
+			choseTest2() {
+				let that = this
+				that.form.check_unit = that.currentRow2[0].name
+				that.getOrganizationsShow2 = false
+			},
+		}
+	}
+</script>
+<style lang="less" scoped>
+	.title {
+		margin-left: 50%;
+		margin-bottom: 20px;
+	}
+
+	.el-form {
+		width: 800px;
+		margin: 0 auto;
+	}
+
+	.footer {
+		margin-top: 5px;
+		display: flex;
+		flex-direction: row;
+		justify-content: space-between;
+	}
+</style>

+ 25 - 12
src/components/admin/reTask.vue

@@ -5,7 +5,7 @@
 		<el-breadcrumb separator-class="el-icon-arrow-right">		
 		  <el-breadcrumb-item >首页</el-breadcrumb-item>
 		  <el-breadcrumb-item>监测任务</el-breadcrumb-item>
-		  <el-breadcrumb-item>例行监测</el-breadcrumb-item>
+		  <el-breadcrumb-item>退回任务</el-breadcrumb-item>
 		  <el-breadcrumb-item>任务列表</el-breadcrumb-item>
 		</el-breadcrumb>
 		</div>
@@ -14,11 +14,11 @@
 		<div class="headSearch">
 			<el-row :gutter="120" style="margin-right: 0px;">
 				<el-form :inline="true">
-				<el-form-item label="年度" class="select" size="small">
+				<el-form-item label="年度" size="small">
 					<el-date-picker v-model="queryInfo.year" style="width: 110px;" value-format="yyyy" type="year" clearable />
 				</el-form-item>
 
-				<el-form-item label="任务状态" class="select" size="small">
+				<el-form-item label="任务状态" size="small">
 					<el-select v-model="queryInfo.ispublic" style="width: 110px;" clearable>
 						<el-option 
 							v-for="item in taskispublic" 
@@ -29,17 +29,17 @@
 					</el-select>
 				</el-form-item>
 
-				<el-form-item label="任务时间" class="select" size="small">
+				<el-form-item label="任务时间"  size="small">
 					<el-date-picker v-model="queryInfo.starttime" style="width: 180px;" align="right" type="date"
 						:picker-options="pickerOptions" clearable value-format="yyyy-MM-dd" />
 				</el-form-item>
 
-				<el-form-item label="--" class="select" style="margin-left: 8px;" size="small">
+				<el-form-item label="--"  style="margin-left: 8px;" size="small">
 					<el-date-picker v-model="queryInfo.endtime" style="width: 180px;" align="right" type="date"
 						:picker-options="pickerOptions"  clearable />
 				</el-form-item>
 
-				<el-form-item label="任务名称" class="select" size="small">
+				<el-form-item label="任务名称"  size="small">
 					<el-input v-model="queryInfo.task_name"></el-input>
 				</el-form-item>
 
@@ -107,9 +107,7 @@
 						<el-button type="success" size="mini"  @click="editInform(scope.row.id)">编辑</el-button>
 					</el-col>
 					<el-col style="margin-bottom: 5px;">
-						<!-- <el-button type="success" size="mini" plain @click="takeTheLeadReportList(scope.row.id)" style="margin-top:5px">牵头单位报告</el-button> -->
 						<el-button type="success" size="mini" plain @click="getJcds(scope.row.id)" style="margin-top:5px">检测单</el-button> 
-						<!-- <el-button type="success" size="mini" plain @click="undertakeReport(scope.row.id)">承担单位报告</el-button> -->
 						<el-button type="success" size="mini" plain @click="sampleList(scope.row.id)">抽样单</el-button>
 					</el-col>
 				</template>
@@ -320,7 +318,21 @@
 				this.$router.push({
 					name:'setTaskJg',
 					params: {
-					task_id:id,
+					id:id,
+					parentName:'退回任务',
+					labelName:'抽样单'
+					}
+				})
+			},
+			//查看检测机构
+			getJcds(id) {
+				console.log(id)
+				this.$router.push({
+					name:'getJcds',
+					params: {
+					id: id,
+					parentName:'退回任务',
+					labelName:'检测单'
 					}
 				})
 			},
@@ -328,20 +340,21 @@
 			// 搜索
 			async searchData() {
 				this.queryInfo.pageNum = 1
+				this.queryInfo.task_name_like = this.queryInfo.task_name
 				this.getTasks()
 			},
 			// 重置
 			reset(){
 				this.queryInfo={
 					year:'',
+					task_name_like:'',
 					task_name:'',
 					starttime:'',
 					endtime:'',
 					ispublic:'',
 					pageSize:10,
 					pageNum:1,
-					task_class:'例行监测',
-					task_id
+					task_class:'retask',
 				}
 				this.getTasks()
 			},
@@ -632,6 +645,6 @@
 		margin-top: 20px;
 	}
 	.headSearch{
-		margin-left: 25px;
+		margin-left: 60px;
 	}
 </style>

+ 74 - 0
src/components/admin/readCheck.vue

@@ -0,0 +1,74 @@
+<template>
+<div>
+    <el-descriptions title="检测单" direction="vertical" :column="5" border align="center">
+            <!-- 检测单信息 -->
+            <el-descriptions-item label="检测单编码" prop="jcd_data.jcd_code">{{jcd_data.jcd_code}}</el-descriptions-item>
+            <el-descriptions-item label="检测结果" prop="jcd_data.jcd_result">{{jcd_data.jcd_result}}</el-descriptions-item>
+            <el-descriptions-item label="附件链接" prop="jcd_data.file_url">{{jcd_data.file_url}}</el-descriptions-item>
+            <el-descriptions-item label="附件名称" prop="jcd_data.file_name">{{jcd_data.file_name}}</el-descriptions-item>
+            <el-descriptions-item label="检测单状态" prop="jcd_data.jcd_status">{{jcd_data.jcd_status}}</el-descriptions-item>
+            <el-descriptions-item label="检测项目名称" prop="jcd_data.jcdItem.item_name">{{jcd_data.jcdItem.item_name}}</el-descriptions-item>
+            <el-descriptions-item label="检验标准" prop="jcd_data.jcdItem.item_standard">{{jcd_data.jcdItem.item_standard}}</el-descriptions-item>
+            <el-descriptions-item label="实测值" prop="jcd_data.jcdItem.item_measured_value">{{jcd_data.jcdItem.item_measured_value}}</el-descriptions-item>
+            <el-descriptions-item label="检验依据" prop="jcd_data.jcdItem.item_basis">{{jcd_data.jcdItem.item_basis}}</el-descriptions-item>
+            <el-descriptions-item label="检验备注" prop="jcd_data.jcdItem.item_log">{{jcd_data.jcdItem.item_log}}</el-descriptions-item>
+         <!-- 返回 -->
+        </el-descriptions> 
+        <el-form>
+				<el-form-item class="btn">
+				<el-button type="primary" @click="back()" style="margin-top:10px">返回</el-button>
+                </el-form-item>
+		</el-form>
+</div>
+</template>
+                    
+
+<script>
+	const token = window.sessionStorage.getItem('token')
+	export default {
+		data() {
+			return {
+				jcd_data:{},//检测单信息
+				jcd_id:''
+			}
+		},
+		created() {
+			this.jcd_id = this.$route.params.jcd_id
+			console.log(this.jcd_id)
+			this.getJcd()
+		},
+		mounted(){
+		if (window.history && window.history.pushState) {
+		history.pushState(null, null, document.URL); //这里有没有都无所谓,最好是有以防万一
+		window.addEventListener('popstate', this.goBack, false);
+		// 回退时执行goback方法
+		}
+    },
+		methods: { 
+          // 返回
+			back() {
+				var that = this
+				console.log(that.task_id)
+				this.$router.push({
+					name: 'readCheckList',
+					params: {
+						// id: this.$route.params.cyd_id
+						task_id : this.$route.params.task_id,
+       					task_profile_id : this.$route.params.task_profile_id,	
+					}
+				})
+				console.log()
+			},
+			// 获取检测单信息
+			async getJcd() {
+				const {data: res} = await this.$http.post('getJcd', {
+					jcd_id: this.jcd_id
+				})
+				this.jcd_data = res.data//检测单信息
+				console.log(this.jcd_data)
+                console.log(this.jcd_id)
+			},
+		
+		},
+	}
+</script>

+ 0 - 252
src/components/admin/readCheckList copy.vue

@@ -1,252 +0,0 @@
-<template>
-    
-   	<div style="width: 100%">
-            <!-- 标题栏导航 -->
-            <div slot="header" class="clearfix">
-                <el-breadcrumb separator-class="el-icon-artableDate-right">		
-                <el-breadcrumb-item >首页</el-breadcrumb-item>
-                <el-breadcrumb-item>例行监测</el-breadcrumb-item>
-                <el-breadcrumb-item>查看检测单列表</el-breadcrumb-item>
-                </el-breadcrumb>
-            </div>
-            <!-- 表格区域 -->
-                <el-table :data="tableData" border stripe highlight-current-row style="width: 100%" >
-                    <el-table-column :key="table.label" v-for="table in tableHeader1" :label="table.label"
-                        :prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
-                    <!-- 操作 -->
-                    <el-table-column label="操作" align="center" fixed="right">
-                    <template slot-scope="scope">
-                        <el-button style="margin:5px 0" type="success" size="small" @click="getSampleList(scope.row.id)">获取样品列表</el-button>
-                    </template>
-                    </el-table-column>
-                </el-table>
-                <!--原页面分页器区域-->
-                <el-pagination class="feyeqi" @size-change="handleSizeChange" @current-change="handleCurrentChange"
-                    :current-page="queryInfo.pageNum" :page-sizes="[10, 15, 20]" :page-size="queryInfo.pageSize"
-                    layout="total, sizes, prev, pager, next, jumper" :total="total" background />
-                <!-- 返回按钮 -->
-                <div class="btns">
-                    <el-button plain size="medium" @click="returnJcdList()" >
-                        返回
-                    </el-button>
-                </div>
-
-        	<!-- 弹框 样品列表 -->
-			<el-dialog title="样品列表" :visible.sync="readDialog" width="75%" :close-on-click-modal="false" class="dialogItem">
-				<el-form v-if="readDialog">
-                    <el-table :data="tableData2" border stripe highlight-current-row style="width: 100%" >
-                        <el-table-column :key="table.label" v-for="table in tableHeader2" :label="table.label"
-                            :prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
-                        <!-- 操作 -->
-                        <el-table-column label="操作" align="center" fixed="right">
-                        <template slot-scope="scope">
-                            <el-button style="margin:5px 0" type="success" size="small" @click="getSampleList(scope.row.id)">查看检测单详情</el-button>
-                        </template>
-                        </el-table-column>
-                    </el-table>
-					<!-- 样品列表分页器区域-->
-					<el-pagination @size-change="handleSizeChange2" @current-change="handleCurrentChange2"
-					:current-page="userInfo.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="userInfo.pageSize"
-					layout="total, sizes, prev, pager, next, jumper" :total="total" background />
-				</el-form>
-			</el-dialog>
-    </div>
-</template>
-
-<script>
-export default {
-    data() {
-        return {
-            readDialog: false,
-            // 数据表格数据
-            total:0,
-			tableData:[],
-            tableData2:[],
-            sampleOrgId:{},
-            task_id:'', 
-            task_profile_id:'', 
-            underInfo:{
-					pageNum: 1,
-					pageSize: 10,
-					cyd_id: ''
-				},
-            queryInfo:{
-					pageSize:10,
-					pageNum:1,
-					task_class:'例行监测',
-                    sample_org_id:'', 
-                    check_org_id:'', 
-                    cyd_status:'',
-                    cyd_status_condition:'',
-                    cyd_code:''
-                    },
-                tableHeader1: [{
-                            label: '抽样单编码',
-                            prop: 'cyd_code',
-                            width: 180,
-                        },{
-                            label: '受检单位',
-                            prop: 'inspectedUnit.inspected_name',
-                            width: 120,
-                        },{
-                            label: '单位地址',
-                            prop: 'inspectedUnit.inspected_address',
-                            width: 200,
-                        },{
-                            label: '单位联系人',
-                            prop: 'inspectedUnit.contact_name',
-                            width: 200,
-                        },{
-                            label: '联系人电话',
-                            prop: 'inspectedUnit.contact_phone',
-                            width: 200,
-                        }],
-                 tableHeader2: [{
-                            label: '样品名称',
-                            prop: 'sample_name',
-                            width: 180,
-                        },{
-                            label: '样品品牌',
-                            prop: 'sample_brand',
-                            width: 120,
-                        },{
-                            label: '抽样数量',
-                            prop: 'sample_count',
-                            width: 200,
-                        },{
-                            label: '抽样基数',
-                            prop: 'sample_base',
-                            width: 200,
-                        },{
-                            label: '生产日期',
-                            prop: 'sample_md_date',
-                            width: 200,
-                        },{
-                            label: '样品来源',
-                            prop: 'sample_source',
-                            width: 200,
-                        },{
-                            label: '备注',
-                            prop: 'inspectedUnit.contact_phone',
-                            width: 200,
-                        }]
-
-        }
-    },
-    mounted() { 
-        this.getJcds()
-    },
-    created() {
-        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
-        console.log(this.task_id)
-        console.log(this.task_profile_id)
-        this.getJcds()
-        this.getSamples()
-    },
-	methods: {
-        //返回
-        returnSampleList(){
-            var that = this
-            this.$router.push({
-                name:'setTaskJg',
-                params:{
-                    task_id: that.task_id
-                }
-            })
-                console.log(task_id)
-        },
-       // 获取检测单列表
-        async getJcds() {
-            var that = this
-            const {data: res} = await this.$http.post("getJcds", {
-                task_id: that.task_id,
-                task_profile_id:that.task_profile_id,
-                pageNum: that.queryInfo.pageNum,
-                pageSize: that.queryInfo.pageSize
-            });
-            console.log(that.id)
-            this.tableData = res.data.rows
-            console.log( this.tableData)
-            this.total = res.data.total
-            console.log( this.total)
-        },
-
-        // 获取样品列表
-			async getSampleList(id) {
-				this.task_id = this.task_id
-				this.task_profile_id = id
-				this.readDialog = true
-				this.getSamples()
-			},
-			async getSamples() {
-                // var that = this
-				const {
-					data: res
-				} = await this.$http.post("getSamples",{
-                    cyd_id: this.id,
-                    task_id: this.task_id,
-                    task_id: this.task_id,
-                    task_profile_id:this.task_profile_id,
-                    pageNum: this.queryInfo.pageNum,
-                    pageSize: this.queryInfo.pageSize
-                    });
-				this.tableData2 = res.data.rows
-				console.log(this.id)
-				this.total = res.data.total
-				
-			},
-        //分页器
-                handleSizeChange(val) {
-                    console.log(`每页 ${val} 条`);
-                    },
-                handleCurrentChange(val) {
-                    this.queryInfo.pageNum = val;
-                    console.log(`当前页: ${val}`);
-                    this.getJcds()
-                    },
-                /** 监听页码的改变 */
-                handleCurrentChange(newPage) {
-                    this.queryInfo.pageNum = newPage
-                    this.getJcds()
-                },
-                /** 监听每页显示多少数据的改变 */
-                handleSizeChange(newSize) {
-                    this.queryInfo.pageSize = newSize
-                    this.getJcds()
-                },
-         //分页器2
-                /** 监听页码的改变 */
-                handleCurrentChange2(newPage) {
-                    this.userInfo.pageNum2 = newPage
-                    this.getSamples()
-                },
-                /** 监听每页显示多少数据的改变 */
-                handleSizeChange2(newSize) {
-                    this.userInfo.pageSize2 = newSize
-                    this.getSamples()
-                },
-         //查看检测单详情
-         readCheck(id){
-             this.$router.push({
-					name:'readCheck',
-					params: {
-					cyd_id:id,
-					}
-				})
-         },
-        
-    }
-}
-</script>
-<style>
-.btns{
-	float:right;
-	/* margin-top: 10px; */
-	padding: 10px;
-}
-.feyeqi{
-    margin-top: 10px;
-}
-</style>

+ 43 - 18
src/components/admin/readCheckList.vue

@@ -27,9 +27,9 @@
                 layout="total, sizes, prev, pager, next, jumper" :total="total" background />
     <!-- 返回按钮 -->
             <div class="btns">
-                <template slot-scope="scope">
-                <el-button plain size="medium" @click="returnJcdList(scope.row.task_id)" >返回</el-button>
-                </template>
+         
+                <el-button plain size="medium" @click="returnJcdList()" >返回</el-button>
+           
             </div>
 
             <!-- 查看样品列表弹框 -->
@@ -42,7 +42,7 @@
                     <!-- 操作区域 -->
                         <el-table-column label="操作" align="center" fixed="right">
                             <template slot-scope="scope">
-                                <el-button style="margin:5px 0" type="success" size="small" @click="getSampleList(scope.row.id)">查看检测单详情</el-button>
+                                <el-button style="margin:5px 0" type="success" size="small" @click="getCheckList(scope.row.jcd.id)">查看检测单详情</el-button>
                             </template>
                         </el-table-column>
                     <!-- 第二个分页器-->
@@ -63,7 +63,7 @@ export default{
             readDialog:false,
             //第一个表格
             tableData:[],
-            //第二个表格
+            //第二个表格z`
             tableData2:[],
             //获取检测机构的两个参数
             task_id:'', 
@@ -129,11 +129,13 @@ export default{
                             label: '样品来源',
                             prop: 'sample_source',
                             width: 200,
-                        },{
-                            label: '备注',
-                            prop: 'inspectedUnit.contact_phone',
-                            width: 200,
-                        }]
+                         },
+                        // {
+                        //     label: '备注',
+                        //     prop: 'inspectedUnit.contact_phone',
+                        //     width: 200,
+                        // }
+                        ]
         }
     },
    created() {
@@ -141,7 +143,14 @@ export default{
        this.task_id = this.$route.params.task_id,
        this.task_profile_id = this.$route.params.task_profile_id
        this.getJcds()
-       this.getSamples()
+    //    this.getSamples()
+   },
+   mounted(){
+    if (window.history && window.history.pushState) {
+            history.pushState(null, null, document.URL); //这里有没有都无所谓,最好是有以防万一
+            window.addEventListener('popstate', this.goBack, false);
+            // 回退时执行goback方法
+    }
    },
    methods:{
        //获取检测机构列表的接口
@@ -167,6 +176,17 @@ export default{
             this.queryInfo.pageSize = newSize
             this.getJcds()
         },
+        //返回按钮
+        goBack(){
+             this.$router.push({
+                name:'getJcds',
+                params:{
+                    id: this.$route.params.task_id
+                }
+            }) 
+        },
+
+
         //第二个分页器
         /** 监听页码的改变 */
         handleCurrentChange2(newPage) {
@@ -179,12 +199,12 @@ export default{
             this.getSamples()
         },
         //返回
-        returnJcdList(task_id){
+        returnJcdList(){
             // var that = this
             this.$router.push({
                 name:'getJcds',
                 params:{
-                    task_id: task_id
+                    id: this.$route.params.task_id
                 }
             })
         },
@@ -193,8 +213,6 @@ export default{
 				this.readDialog = true
 				this.getSamples(id)
 		},
-
-
         async getSamples(id) {
             const {data: res} = await this.$http.post("getSamples",{
                     cyd_id: id,
@@ -203,9 +221,16 @@ export default{
                 })
                 this.tableData2 = res.data.rows
                 console.log(res.data.rows)
-        }
-
-
+        },
+        //查看检测单
+         getCheckList(id){
+            this.$router.push({
+                name:'readCheck',
+                params:{
+                   jcd_id: id
+                }
+            })
+        },
    
     }
 }

+ 0 - 187
src/components/admin/readSample copy.vue

@@ -1,187 +0,0 @@
-<template>
-	<div>
-    <el-descriptions  title="农产品质量安全抽样单" :column="2" border style="margin-top:20px">
-            <el-descriptions-item label="抽样单编号" prop="cyd_data.cyd_code" style="width:200px" class="labelItem" size="mini" required >
-                {{cyd_data.cyd_code}}
-            </el-descriptions-item>
-        <!-- 抽样单位信息 -->
-                        <el-descriptions-item label="单位名称" prop="taskProfile_unit.name" size="mini" required>
-                            {{taskProfile_unit.name}}
-                        </el-descriptions-item>
-                        <el-descriptions-item label="单位组别" prop="taskProfile_unit.groupname" size="mini" required>
-                            {{taskProfile_unit.groupname}}
-                        </el-descriptions-item>
-                        <el-descriptions-item label="联系人" prop="taskProfile_unit.contact_name" size="mini" required>
-                            {{taskProfile_unit.contact_name}}
-                        </el-descriptions-item>
-                        <el-descriptions-item label="联系电话" prop="taskProfile_unit.contact_phone" size="mini" required>
-                            {{taskProfile_unit.contact_phone}}
-                        </el-descriptions-item>
-                        <el-descriptions-item label="别名" prop="taskProfile_unit.name_other" size="mini">
-                            {{taskProfile_unit.name_other}}
-                        </el-descriptions-item>
-        <!-- 样品信息 -->
-                <el-descriptions-item label="样品信息">
-                    <el-descriptions-item label="样品名称" prop="sample.sample_name" size="mini" required>
-                        {{sample.sample_name}}
-                    </el-descriptions-item>
-                </el-descriptions-item>
-    </el-descriptions>
-<!-- 底部按钮 -->
-		<el-form>
-				<el-form-item class="btn">
-				<el-button type="primary" @click="back()">返回任务详情</el-button>
-                </el-form-item>
-		</el-form>
-        </div>
-</template>
-
-<script>
-	const token = window.sessionStorage.getItem('token')
-	import {
-		provinceAndCityData,
-		regionData,
-		provinceAndCityDataPlus,
-		regionDataPlus,
-		CodeToText,
-		TextToCode
-	} from 'element-china-area-data'
-	export default {
-		data() {
-			return {
-				myHeaders: {
-					Authorization: 'bearer' + token
-				},
-				fileList: [],
-				form: {},
-				cyd_data: {},//抽样单信息
-                taskProfile_unit:{},//抽样单位信息
-				inspected_unit: {},//受检单位信息
-				sample: {},//样品信息
-				units: [],
-				production: [],
-				// 样品下拉框
-				sampleList: [],
-				task_id: '',
-				undertake_id: '',
-				// 产地
-				options: regionData,
-				selectedOptions: []
-			}
-		},
-		created() {
-			this.cyd_id = this.$route.params.cyd_id
-			console.log(this.cyd_id)
-			this.getCyd()
-		},
-		methods: {
-			// 获取抽样单信息
-			async getCyd() {
-				const result = await this.$http.post('getCyd', {
-					cyd_id: this.cyd_id
-				})
-				console.log(result.data.data)
-				this.cyd_data = result.data.data//抽样单信息
-                this.taskProfile_unit = result.data.data.taskProfile//抽样单位信息
-				this.inspected_unit = result.data.data.inspectedUnit//受检单位信息
-				this.sample = result.data.data.sample//样品信息
-				console.log(this.cyd_data)
-                console.log(this.taskProfile_unit)
-				console.log(this.inspected_unit)
-				console.log(this.sample)
-                console.log(this.cyd_id)
-			},
-			// 生成样品编码
-			async createCode() {
-				var that = this
-				const result = await this.$http.post('getSampleId', {
-					task_id: this.task_id
-				})
-				console.log(result.data.data.id)
-				if (result.data.code == 0) {
-					that.cyd_data.sample_id = result.data.data.id
-					this.getTestObj()
-				}
-			},
-			// 获取选择产地
-			handleChange() {
-				var that = this
-				var loc = "";
-				// console.log(this.form.place)
-				for (let i = 0; i < this.selectedOptions.length; i++) {
-					loc += CodeToText[this.selectedOptions[i]];
-				}
-				// console.log(loc)
-				that.cyd_data.place = loc
-				console.log(that.cyd_data.place)
-			},
-			// 上传成功(要确认数据)
-			uploadSuccess(res) {
-				console.log(res.data)
-				this.cyd_data.file_url = res.data.fileUrl
-				this.cyd_data.file_name = res.data.fileName
-			},
-			async onSubmit() {
-				console.log(this.cyd_data.sample_name)
-				var that = this
-				console.log(that.cyd_data)
-				that.cyd_data.task_id = that.task_id
-				that.cyd_data.undertake_id = that.undertake_id
-				that.form.cyd_data = that.cyd_data
-				that.form.unit_test = that.unit_test
-				that.form.unit_production = that.unit_production
-				that.form.unit_sample = that.unit_sample
-				console.log(that.form)
-				const result = await this.$http.post('saveSample', this.form)
-				if (result.data.code == 0) {
-					// that.form.sample_id = result.data.data.id
-					this.$message({
-						type: 'success',
-						message: '提交抽样单成功!'
-						
-					});
-				}
-			},
-			// 返回
-			back() {
-				var that = this
-				console.log(that.task_id)
-				this.$router.push({
-					name: 'setTaskcd',
-					params: {
-						id: that.task_id
-					}
-				})
-			}
-		},
-	}
-</script>
-
-<style lang="less" scoped>
-	.form {
-		display: flex;
-		flex-direction: row;
-		justify-content: center;
-		align-content: flex-start;
-	}
-
-	.el-descriptions {
-		width: 80%;
-		margin: auto;
-	}
-
-	/deep/ .el-descriptions__title {
-		margin: auto;
-		font-size: 1.25rem;
-		// font-weight: 31.25rem !important;
-	}
-	.btn{
-		margin-top:20px ;
-		// float: right;
-		text-align: center;
-	}
-	/deep/ #sampleReport{
-		.el-descriptions-item__label.is-bordered-label{
-		width: 15rem;}
-	}
-</style>

+ 5 - 14
src/components/admin/readSample.vue

@@ -62,7 +62,9 @@
 		},
 		created() {
 			this.cyd_id = this.$route.params.cyd_id
+			// this.sample_id = 34
 			console.log(this.cyd_id)
+			console.log(this.sample_id)
 			this.getCyd()
 		},
 		methods: {
@@ -78,9 +80,10 @@
 				})
 			},
 			// 获取抽样单信息
-			async getCyd() {
+			async getCyd(id) {
 				const result = await this.$http.post('getCyd', {
-					cyd_id: this.cyd_id
+					cyd_id: this.cyd_id,
+					sample_id :34
 				})
 				console.log(result.data.data)
 				this.cyd_data = result.data.data//抽样单信息
@@ -95,18 +98,6 @@
 				console.log(this.sample_unit)
                 console.log(this.cyd_id)
 			},
-			// 生成样品编码
-			async createCode() {
-				var that = this
-				const result = await this.$http.post('getSampleId', {
-					task_id: this.task_id
-				})
-				console.log(result.data.data.id)
-				if (result.data.code == 0) {
-					that.cyd_data.sample_id = result.data.data.id
-					this.getTestObj()
-				}
-			},
 		},
 	}
 </script>

+ 0 - 224
src/components/admin/readSampleList copy.vue

@@ -1,224 +0,0 @@
-<template>
-    
-   	<div style="width: 100%">
-        <!-- 标题栏导航 -->
-	    <div slot="header" class="clearfix">
-            <el-breadcrumb separator-class="el-icon-artableDate-right">		
-            <el-breadcrumb-item >首页</el-breadcrumb-item>
-            <el-breadcrumb-item>例行监测</el-breadcrumb-item>
-            <el-breadcrumb-item>查看抽样单</el-breadcrumb-item>
-            </el-breadcrumb>
-		</div>
-<!-- 表格区域 -->
-    <el-table :data="tableData" border stripe highlight-current-row style="width: 100%" >
-        <el-table-column :key="table.label" v-for="table in tableHeader2" :label="table.label"
-            :prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
-            <!-- <el-table-column prop="level" label="任务优先级" width="95" align="center">
-					<template slot-scope="scope">
-						<el-tag type="success" v-if="scope.row.level==0">一般</el-tag>
-						<el-tag type="warning" v-if="scope.row.level==1">紧急</el-tag>
-						<el-tag type="danger" v-if="scope.row.level==2">特急</el-tag>
-					</template>
-				</el-table-column> -->
-        <!-- 操作 -->
-        <el-table-column label="操作" align="center" fixed="right">
-        <template>
-            <el-button style="margin:5px 0" type="success" size="small" @click="dialogVisible=true">查看详情</el-button>
-        </template>
-        </el-table-column>
-    </el-table>
-        <!--分页器区域-->
-            <el-pagination class="feyeqi" @size-change="handleSizeChange" @current-change="handleCurrentChange"
-                :current-page="queryInfo.pageNum" :page-sizes="[10, 15, 20]" :page-size="queryInfo.pageSize"
-                layout="total, sizes, prev, pager, next, jumper" :total="total" background />
-        <!-- 返回按钮 -->
-            <div class="btns">
-                <el-button plain size="medium" @click="returnSampleList()" >
-                    返回
-                </el-button>
-            </div>
-        <!-- 查看详情对话框-->
-		<el-dialog title="查看" :visible.sync="dialogVisible" width="30%" :close-on-click-modal="false"
-			class="dialogItem" >
-			<el-form v-if="dialogVisible" label-width="100px">
-				<el-form-item label="抽样单编码:" prop="tableData.cyd_code" class="labelItem">
-					<div>{{readForm.cyd_code}}</div>
-				</el-form-item>
-				<el-form-item label="抽样单状态:" prop="cyd_status" class="labelItem">
-					<div v-if="level=='0'">一般</div>
-					<div v-if="level=='1'">紧急</div>
-					<div v-if="level=='2'">特急</div>
-				</el-form-item>
-				<el-form-item label="抽样人员1:" prop="sample_person_one" width="70px" class="labelItem">
-					<div>{{sample_person_one}}</div>
-				</el-form-item>
-				<el-form-item label="抽样人员2:" prop="sample_person_two" class="labelItem">
-					<div>{{readForm.sample_person_two}}</div>
-				</el-form-item>
-				<el-form-item label="抽样时间:" prop="cyd_date" class="labelItem">
-					<div>{{readForm.cyd_date}}</div>
-				</el-form-item>
-				<el-form-item label="单位名称:" prop="inspected_name" class="labelItem">
-					<div>{{readForm.inspected_name}}</div>
-				</el-form-item>
-				<el-form-item label="单位地址:" prop="inspected_address" class="labelItem">
-					<div>{{readForm.inspected_address}}</div>
-				</el-form-item>
-                <el-form-item label="联系人:" prop="contact_name" class="labelItem">
-					<div>{{readForm.contact_name}}</div>
-				</el-form-item>
-				<el-form-item label="备注:" prop="cyd_log" class="labelItem">
-					<div v-if="readForm.cyd_log==null">无</div>
-					<div v-else>{{readForm.cyd_log}}</div>
-				</el-form-item>
-				<div class="footer">
-					<el-button type="success" @click="dialogVisible = false">返回</el-button>
-				</div>
-			</el-form>
-		</el-dialog>
-
-    </div>
-</template>
-
-<script>
-export default {
-    data() {
-        return {
-            // 查看任务详情
-			dialogVisible: false,
-			readForm: {
-                cyd_code:''
-            },
-            // 数据表格数据
-			tableData:[],
-            sampleOrgId:{},
-            queryInfo:{
-					pageSize:10,
-					pageNum:1,
-					task_class:'例行监测',
-                    task_id: 39, //任务id
-                    task_profile_id: 90, //task_profile_id
-                    sample_org_id: 18, //抽样单位id
-                    check_org_id: 272, //检测单位id
-                    cyd_status:'',
-                    cyd_status_condition:'',
-                    cyd_code:''
-                    },
-                tableHeader2: [{
-                            label: '抽样单编码',
-                            prop: 'cyd_code',
-                            width: 180,
-                        },{
-                            label: '抽样人员1',
-                            prop: 'cydProfile.sample_person_one',
-                            width: 120,
-                        },{
-                            label: '抽样人员2',
-                            prop: 'cydProfile.sample_person_two',
-                            width: 120,
-                        },{
-                            label: '抽样时间',
-                            prop: 'cydProfile.cyd_date',
-                            width: 160,
-                        },
-                        // {
-                        //     label: '样品名称',
-                        //     prop: 'inspectedUnit.sample_name',
-                        //     width: 120,
-                        // },{
-                        //     label: '样品商标',
-                        //     prop: 'sample.data.sample_brand'
-                        // },
-                        {
-                            label: '抽样单状态',
-                            prop: 'cyd_status'
-                        },
-                ]  
-        }
-    },
-    mounted() {
-        this.getCyds()
-    },
-    created() {
-        this.id = this.$route.params.id
-        // this.task_id = this.$route.params.id
-        // console.log(this.task_id)
-        this.getCyds()
-    },
-	methods: {
-        //返回
-        returnSampleList(){
-            this.$router.push('setTaskJg')
-        },
-       // 获取抽样单列表
-        async getCyds() {
-            for (var key in this.queryInfo) {
-                if (this.queryInfo[key] == '') {
-                    delete this.queryInfo[key]
-                }
-            }
-            const {
-                data: res
-            } = await this.$http.post(
-                "getCyds", this.queryInfo
-            );
-            this.tableData = res.data.rows
-            console.log( this.tableData)
-            this.total = res.data.total
-            this.task_id = res.data.rows.task_id
-            for(let i=0; i<this.tableData.length; i++){
-                if (this.tableData[i].cyd_status == "0"){
-                      this.tableData[i].cyd_status ="未发布";
-                }else if(this.tableData[i].cyd_status == "1"){
-                    this.tableData[i].cyd_status ="已发布";
-                }else if(this.tableData[i].cyd_status == "2"){
-                    this.tableData[i].cyd_status ="废止";
-                }else if(this.tableData[i].cyd_status == "3"){
-                    this.tableData[i].cyd_status ="已结束未完成";
-                }else if(this.tableData[i].cyd_status == "4"){
-                    this.tableData[i].cyd_status ="已结束已完成";
-                }else{
-                     this.tableData[i].releaser.properties ="执行中";
-                }
-            }
-        },
-        
-        //分页器
-                handleSizeChange(val) {
-                    console.log(`每页 ${val} 条`);
-                    },
-                handleCurrentChange(val) {
-                    this.queryInfo.pageNum = val;
-                    console.log(`当前页: ${val}`);
-                    this.getCyds()
-                    },
-                /** 监听页码的改变 */
-                handleCurrentChange(newPage) {
-                    this.queryInfo.pageNum = newPage
-                    this.getCyds()
-                },
-                /** 监听每页显示多少数据的改变 */
-                handleSizeChange(newSize) {
-                    this.queryInfo.pageSize = newSize
-                    this.getCyds()
-                },
-            	// 查看任务详情
-			async readDialogVisible1(row) {
-				this.readForm.cyd_code = row.cyd_code
-				
-				this.readDialogVisible = true
-            }
-         
-    }
-}
-</script>
-<style>
-.btns{
-	float:right;
-	/* margin-top: 10px; */
-	padding: 10px;
-}
-.feyeqi{
-    margin-top: 10px;
-}
-</style>

+ 61 - 86
src/components/admin/routineMonitor.vue

@@ -14,11 +14,11 @@
 		<div class="headSearch">
 			<el-row :gutter="120" style="margin-right: 0px;">
 				<el-form :inline="true">
-				<el-form-item label="年度" class="select" size="small">
+				<el-form-item label="年度"  size="small">
 					<el-date-picker v-model="queryInfo.year" style="width: 110px;" value-format="yyyy" type="year" clearable />
 				</el-form-item>
 
-				<el-form-item label="任务状态" class="select" size="small">
+				<el-form-item label="任务状态" size="small">
 					<el-select v-model="queryInfo.ispublic" style="width: 110px;" clearable>
 						<el-option 
 							v-for="item in taskispublic" 
@@ -29,20 +29,19 @@
 					</el-select>
 				</el-form-item>
 
-				<el-form-item label="任务时间" class="select" size="small">
+				<el-form-item label="任务时间" size="small">
 					<el-date-picker v-model="queryInfo.starttime" style="width: 180px;" align="right" type="date"
 						:picker-options="pickerOptions" clearable value-format="yyyy-MM-dd" />
 				</el-form-item>
 
-				<el-form-item label="--" class="select" style="margin-left: 8px;" size="small">
+				<el-form-item label="--" style="margin-left: 8px;" size="small">
 					<el-date-picker v-model="queryInfo.endtime" style="width: 180px;" align="right" type="date"
 						:picker-options="pickerOptions"  clearable />
 				</el-form-item>
 
-				<el-form-item label="任务名称" class="select" size="small">
+				<el-form-item label="任务名称" size="small">
 					<el-input v-model="queryInfo.task_name"></el-input>
 				</el-form-item>
-
 				<!-- 查询 -->
 				<el-button  size="mini" style="height: 40px;margin-left: 10px;" type="success" @click="searchData()">查询</el-button>
 				<!-- 重置 -->
@@ -102,13 +101,11 @@
 				<!-- 操作按钮区域的作用域插槽 -->
 				<template slot-scope="scope">
 					<el-col style="margin-bottom: 5px;">
-						<el-button type="success" size="mini" @click="readDialogVisible1(scope.row.id)" style="margin-top:5px">详情</el-button>
-						<el-button type="success" size="mini" @click="sendBack(scope.row)" style="margin-top:5px" >退回</el-button>
+						<el-button type="success" size="mini" @click="readDialogVisible1(scope.row)" style="margin-top:5px">详情</el-button>
+						<el-button type="success" size="mini" @click="sendBack(scope.row.id)" style="margin-top:5px" >退回</el-button>
 					</el-col>
 					<el-col style="margin-bottom: 5px;">
-						<!-- <el-button type="success" size="mini" plain @click="takeTheLeadReportList(scope.row.id)" style="margin-top:5px">牵头单位报告</el-button> -->
 						<el-button type="success" size="mini" plain @click="getJcds(scope.row.id)" style="margin-top:5px">检测单</el-button> 
-						<!-- <el-button type="success" size="mini" plain @click="undertakeReport(scope.row.id)">承担单位报告</el-button> -->
 						<el-button type="success" size="mini" plain @click="sampleList(scope.row.id)">抽样单</el-button>
 					</el-col>
 				</template>
@@ -148,12 +145,12 @@
 				<el-form-item label="发布单位:" prop="creater" class="labelItem">
 					<div>{{readForm.creater.name}}</div>
 				</el-form-item>
-				<el-form-item label="抽样单位:" prop="taskProfile.sample_org_id.name " class="labelItem">
+				<!-- <el-form-item label="抽样单位:" prop="taskProfile.sample_org_id.name " class="labelItem">
 					<div>{{readForm.taskProfile.sample_org_id.name }}</div>
 				</el-form-item>
 				<el-form-item label="检测单位:" prop="taskProfile.check_org_id.name" class="labelItem">
 					<div>{{readForm.taskProfile.check_org_id.name}}</div>
-				</el-form-item>
+				</el-form-item> -->
 				<!-- <el-form-item label="牵头单位:" prop="main_unit" class="labelItem">
 					<div>{{readForm.main_unit}}</div>
 				</el-form-item> -->
@@ -176,7 +173,7 @@
 
 		</el-dialog>
 	</div>
-</template>
+</template> 
 <script>
 	const token = window.sessionStorage.getItem('token')
 	const rybh = window.sessionStorage.getItem('rybh')
@@ -187,6 +184,7 @@
 			return {
 				task_id:'',
 				queryInfo:{
+					creater:'',
 					task_name_like:'',
 					level:'',
 					year:'',
@@ -330,38 +328,17 @@
 					name:'getJcds',
 					params: {
 					id: id,
+					parentName:'例行监测',
+					labelName:'查看检测机构'
 					}
 				})
 			},
-			// takeTheLeadReportList(id) {
-			// 	console.log(id)
-			// 	this.$router.push({
-			// 		name:'takeTheLeadReportList',
-			// 		params: {
-			// 		task_id: id,
-			// 		}
-			// 	})
-			// },
-			//
-			// 	})
-			// },
-			//承担单位报告
-			// undertakeReport(id){
-			// 	console.log(id)
-			// 	this.$router.push({
-			// 		name:'undertakeReport',
-			// 		params: {
-			// 		task_id: id,
-			// 		}
-			// 	})
-			// },
-			
-		// },
-			
 			// 搜索
 			async searchData() {
 				this.queryInfo.pageNum = 1
-				this.gettaskList()
+				this.queryInfo.task_name_like = this.queryInfo.task_name
+				console.log(this.queryInfo.task_name)
+				this.getTasks()
 			},
 			// 重置
 			reset(){
@@ -374,41 +351,27 @@
 					pageSize:10,
 					pageNum:1,
 					task_class:'例行监测',
-					task_id
+					// task_id
 				}
 				this.getTasks()
 			},
 			//退回
-			async sendBack(){
+			async sendBack(id){
 				const result = await this.$http.post("postRetask", this.queryInfo);
-				// this.tableData = res.data.rows
-				// console.log(this.tableData)
-				// this.total = res.data.total
-				
-				// if (result.code = 0){
-				// 	this.$message({
-				// 	message:'退回成功',
-				// 	type: 'success'});
-				// 	this.getTasks()}
-				// else {
-				// 	this.$message({
-				// 	message:'退回失败',
-				// 	type: 'warning'
-				// 	});
-				// 	this.getTasks()
 					if (result.data.code == 0) {
 						this.$message({
 						type: 'success',
 						// message: result.data.message
 						message:'退回成功',
 					})
-				} else {
-					this.$message({
-						type: 'warning',
-						// message: result.data.message
-						message:'退回失败',
-					})
-				}
+						} else {
+							this.$message({
+								type: 'warning',
+								message: result.data.message
+								// message:'退回失败',
+							})
+						}
+					
 				console.log(result.data.code)
 				
 				
@@ -440,14 +403,14 @@
 			},
 			// 查看任务详情
 			async readDialogVisible1(row) {
-				this.readForm.taskProfile.sample_org_id.name = row.taskProfile.sample_org_id.name
-				this.readForm.taskProfile.check_org_id.name = row.taskProfile.check_org_id.name
+				// console.log(this.readForm	)
+				// console.log(row)
 				this.readForm.batch = row.batch
 				this.readForm.task_name = row.task_name
 				this.readForm.task_class = row.task_class
 				this.readForm.level = row.level
-				// console.log(this.readForm.level)
 				this.readForm.year = row.year
+				// this.taskProfile.sample_org_id.name = row.taskProfile.sample_org_id.name
 				this.readForm.starttime = row.starttime
 				this.readForm.endtime = row.endtime
 				this.readForm.releaser = row.releaser
@@ -457,6 +420,16 @@
 				this.readForm.file_name = row.file_name
 				this.readForm.filenum = row.filenum
 				this.readForm.log = row.log
+                // const {
+				// 	data: res
+				// } = await this.$http.post("getTask", {
+				// 	task_id:row.id
+					
+				// 	}
+				// );
+                // this.readForm.taskProfile = res.data.taskProfile
+			   
+
 				this.readDialogVisible = true
 
 			},
@@ -468,15 +441,15 @@
 			// 删除任务
 			async delArray() {
 				// 判断任务是否为该创建者创建
-				// for (let i = 0; i < this.multipleSelection.length; i++) {
-				// 	if (rybh != this.multipleSelection[i].releaser) {
-				// 		this.$alert('任务仅创建者可以删除!', {
-				// 			confirmButtonText: '确定',
-				// 			callback: action => {
-				// 			}
-				// 		});
-				// 	}
-				// }
+				for (let i = 0; i < this.multipleSelection.length; i++) {
+					if (rybh != this.multipleSelection[i].releaser) {
+						this.$alert('任务仅创建者可以删除!', {
+							confirmButtonText: '确定',
+							callback: action => {
+							}
+						});
+					}
+				}
 				var that = this;
 				const length = this.multipleSelection.length;
 				for (let i = 0; i < length; i++) {
@@ -496,27 +469,29 @@
 				} else {
 					this.$message({
 						type: 'error',
-						message: '删除失败!'
+						// message: '删除失败!'
+						message: result.data.message
 					});
 				}
 				// console.log(this.$refs.multipleTable);
 				this.$refs.multipleTable.clearSelection();
 				that.delarr = [];
+				this.getTasks()
 				// this.$refs.multipleTable.clearSelectionFun();
 			},
 			// 发布任务
 			async ispublic() {
 				// 判断任务是否为该创建者创建
-				// for (let i = 0; i < this.multipleSelection.length; i++) {
-				// 	if (rybh != this.multipleSelection[i].releaser) {
-				// 		this.$alert('任务仅创建者可以发布!', {
-				// 			confirmButtonText: '确定',
-				// 			callback: action => {
+				for (let i = 0; i < this.multipleSelection.length; i++) {
+					if (rybh != this.multipleSelection[i].releaser) {
+						this.$alert('任务仅创建者可以发布!', {
+							confirmButtonText: '确定',
+							callback: action => {
 
-				// 			}
-				// 		});
-				// 	}
-				// }
+							}
+						});
+					}
+				}
 				var that = this;
 				let canPub = 0
 				const length = this.multipleSelection.length;
@@ -681,6 +656,6 @@
 		margin-top: 20px;
 	}
 	.headSearch{
-		margin-left: 25px;
+		margin-left: 60px;
 	}
 </style>

+ 31 - 13
src/components/admin/specialMonitor.vue

@@ -18,7 +18,7 @@
 					<el-date-picker v-model="queryInfo.year" style="width: 110px;" value-format="yyyy" type="year" clearable />
 				</el-form-item>
 
-				<el-form-item label="任务状态" class="select" size="small">
+				<el-form-item label="任务状态" size="small">
 					<el-select v-model="queryInfo.ispublic" style="width: 110px;" clearable>
 						<el-option 
 							v-for="item in taskispublic" 
@@ -29,17 +29,17 @@
 					</el-select>
 				</el-form-item>
 
-				<el-form-item label="任务时间" class="select" size="small">
+				<el-form-item label="任务时间"  size="small">
 					<el-date-picker v-model="queryInfo.starttime" style="width: 180px;" align="right" type="date"
 						:picker-options="pickerOptions" clearable value-format="yyyy-MM-dd" />
 				</el-form-item>
 
-				<el-form-item label="--" class="select" style="margin-left: 8px;" size="small">
+				<el-form-item label="--" style="margin-left: 8px;" size="small">
 					<el-date-picker v-model="queryInfo.endtime" style="width: 180px;" align="right" type="date"
 						:picker-options="pickerOptions"  clearable />
 				</el-form-item>
 
-				<el-form-item label="任务名称" class="select" size="small">
+				<el-form-item label="任务名称" size="small">
 					<el-input v-model="queryInfo.task_name"></el-input>
 				</el-form-item>
 
@@ -103,7 +103,7 @@
 				<template slot-scope="scope">
 					<el-col style="margin-bottom: 5px;">
 						<el-button type="success" size="mini" @click="readDialogVisible1(scope.row)" style="margin-top:5px">详情</el-button>
-						<el-button type="success" size="mini" @click="sendBack(scope.row)" style="margin-top:5px">退回</el-button>
+						<el-button type="success" size="mini" @click="sendBack(scope.row.id)" style="margin-top:5px">退回</el-button>
 					</el-col>
 					<el-col style="margin-bottom: 5px;">
 						<!-- <el-button type="success" size="mini" plain @click="takeTheLeadReportList(scope.row.id)" style="margin-top:5px">牵头单位报告</el-button> -->
@@ -181,6 +181,7 @@
 			return {
 				queryInfo:{
 					year:'',
+					task_name_like:'',
 					task_name:'',
 					starttime:'',
 					endtime:'',
@@ -303,7 +304,7 @@
 		methods: {
 			//新增
 			add() {
-				this.$router.push('addTask')
+				this.$router.push('addTaskZx')
 			},
 			//查看抽样机构
 			sampleList(id){
@@ -316,11 +317,12 @@
 			},
 			//查看检测机构
 			getJcds(id) {
-				console.log(id)
 				this.$router.push({
 					name:'getJcds',
 					params: {
 					id: id,
+					parentName:'专项监测',
+					labelName:'检测单'
 					}
 				})
 			},
@@ -352,7 +354,10 @@
 			// 搜索
 			async searchData() {
 				this.queryInfo.pageNum = 1
-				this.gettaskList()
+				this.queryInfo.task_name_like = this.queryInfo.task_name
+				console.log(this.queryInfo.task_name)
+				this.getTasks()
+
 			},
 			// 重置
 			reset(){
@@ -364,14 +369,28 @@
 					ispublic:'',
 					pageSize:10,
 					pageNum:1,
-					task_class:'例行监测',
-					task_id
+					task_class:'专项监测',
+					
 				}
 				this.getTasks()
 			},
 			//退回
-			sendBack(){
-
+			async sendBack(id){
+				const result = await this.$http.post("postRetask", {task_id:id});
+				// this.task_id = res.data.rows.id
+				console.log(id)
+					if (result.data.code == 0) {
+						this.$message({
+						type: 'success',
+						message:'退回成功',
+					})
+				} else {
+					this.$message({
+						type: 'warning',
+						// message:'退回失败',
+						message: result.data.message
+					})
+				}
 			},
 			/** 监听页码的改变 */
 			handleCurrentChange(newPage) {
@@ -404,7 +423,6 @@
 				this.readForm.task_name = row.task_name
 				this.readForm.task_class = row.task_class
 				this.readForm.level = row.level
-				// console.log(this.readForm.level)
 				this.readForm.year = row.year
 				this.readForm.starttime = row.starttime
 				this.readForm.endtime = row.endtime

+ 0 - 2
src/components/jc/sampleDetailcd.vue

@@ -710,8 +710,6 @@
 		mounted() {},
 		created() {
 			this.task_id = this.$route.params.id
-
-
 			this.getTaskDetail()
 			// this.getTestList()
 			// this.getmodelList()

+ 32 - 0
src/router/index.js

@@ -9,6 +9,13 @@ import {
 import 'element-ui/lib/theme-chalk/index.css'
 Vue.use(VueRouter)
 
+//获取原型对象上的push函数
+const originalPush = VueRouter.prototype.push
+//修改原型对象中的push方法
+VueRouter.prototype.push = function push(location) {
+   return originalPush.call(this, location).catch(err => err)
+}
+
 
 /** 按需导入后台系统功能组件 */
 const routes = [{
@@ -36,6 +43,7 @@ const routes = [{
 			},
 			{
 				path: '/admin/addTask',
+				name:'addTask',
 				component: () => import('../components/admin/addTask')
 			},
 			
@@ -134,6 +142,30 @@ const routes = [{
 				path: '/admin/readSample',
 				name:'readSample',
 				component: () => import('../components/admin/readSample')
+			},{
+				path: '/admin/readCheck',
+				name:'readCheck',
+				component: () => import('../components/admin/readCheck')
+			},{
+				path: '/admin/nextStep',
+				name:'nextStep',
+				component: () => import('../components/admin/nextStep')
+			},{
+				path: '/admin/addTaskZx',
+				name:'addTaskZx',
+				component: () => import('../components/admin/addTaskZx')
+			},{
+				path: '/admin/addTaskObjectZx',
+				name:'addTaskObjectZx',
+				component: () => import('../components/admin/addTaskObjectZx')
+			},{
+				path: '/admin/addTaskJd',
+				name:'addTaskJd',
+				component: () => import('../components/admin/addTaskJd')
+			},{
+				path: '/admin/addTaskObjectJd',
+				name:'addTaskObjectJd',
+				component: () => import('../components/admin/addTaskObjectJd')
 			},
 			
 		]