yyfang vor 3 Jahren
Ursprung
Commit
9cbd745450

+ 2 - 1
src/components/admin/addTask.vue

@@ -174,12 +174,13 @@
 				if (result.code == 0) {
 						this.$message({
 						type: 'success',
+						// message: result.data.message
 						message: result.data.message
 					})
 				} else {
 					this.$message({
 						type: 'success',
-						message: result.data.message
+						message: '保存成功'
 					})
 				}
 					

+ 427 - 0
src/components/admin/addTaskJcObject copy.vue

@@ -0,0 +1,427 @@
+<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>
+
+		<!-- 选择抽样机构对话框 -->
+		<template scope-slot="scope">
+			<el-dialog title="机构选择" :visible.sync="getOrganizationsShow1" width="50%" :close-on-click-modal="false" @open="getOrganizations1()" class="dialogItem">
+			<el-form v-if="getOrganizationsShow1" :model="getOrganizationsForm1">
+									<!-- 检索功能 -->
+									<!-- <el-row :gutter="20">
+										<el-col :span="6">
+											<el-form-item label="单位名称" >
+													<el-input v-model="queryInfo1.name"></el-input>
+											</el-form-item>
+										</el-col>
+										<el-col :span="6">
+											<el-button type="success" @click="search()" style="margin-top:40px">搜索</el-button>
+										</el-col>
+									</el-row> -->
+			<!--  表格数据区域-->
+				<el-table ref="multipleTable" :data="testList" row-key="id" @selection-change="handleSelectionChange1"
+					border stripe highlight-current-row style="width: 100%">
+					<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="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-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="handleSizeChange2" @current-change="handleCurrentChange2"
+						:current-page="queryInfo2.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo2.pageSize"
+						layout="total, sizes, prev, pager, next, jumper" :total="total2" background />
+
+					<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: '',
+					sample_number: '',
+					// sample_address: '',
+					uploadtime: '',
+					groupname:'',
+					properties:'',
+					main_unit:[],
+					check_unit:[],
+					sample_org_id:'',
+					check_org_id:''
+				},
+				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
+				// },
+				// 优先级选项
+				priority: [{
+					value: '0',
+					label: '一般'
+				}, {
+					value: '1',
+					label: '紧急'
+				}, {
+					value: '2',
+					label: '特急'
+				}],
+				// 批次选项
+				batch: [{
+					label: '一季度'
+				}, {
+					label: '二季度'
+				}, {
+					label: '三季度'
+				}, {
+					label: '四季度'
+				}],
+
+				// 弹出抽样机构弹窗
+				getOrganizationsShow1: false,
+				// 查询抽样机构请求参数
+				queryInfo1: {
+					pageNum: 1,
+					pageSize: 10,
+					name:'',
+					sample_org_id:''
+				},
+
+				// 弹出检测机构弹窗
+				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.sample_org_id = this.id
+			this.task_id= this.$route.params.task_id
+			console.log(this.task_id)
+			this.postTaskProfile()
+		},
+		
+		mounted() {
+			let that = this
+		},
+		methods: {
+			// 添加任务step2
+			async postTaskProfile() {
+				const result = await this.$http.post('postTaskProfile', {
+					task_id: this.task_id,
+					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 = "";
+				for (let i = 0; i < this.sample_address.length; i++) {
+					loc += CodeToText[this.sample_address[i]];
+				}
+				that.form.sample_address = loc
+				// console.log(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
+				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')
+				} else {
+					this.$message({
+						type: 'error',
+						message: result.data.message
+					})
+				}
+			},
+			reBack() {
+				this.$router.push('addTask')
+			},		
+			// 获取抽样机构列表
+			async getOrganizations1() {
+				this.queryInfo1['token'] = token
+				const result = await this.$http.post('getOrganizations', this.queryInfo1)
+					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)
+					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
+				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
+			},
+//抽样机构页码
+			/** 监听每页显示多少数据的改变 */
+			handleSizeChange1(newSize) {
+				this.queryInfo1.pageSize = newSize
+				this.getOrganizations1()
+			},
+			/** 监听页码的改变 */
+			handleCurrentChange1(newPage) {
+				this.queryInfo1.pageNum = newPage
+				this.getOrganizations1()
+			},
+//检测机构页码
+			/** 监听每页显示多少数据的改变 */
+			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.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)
+			},
+// 抽样单位提交
+			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)
+			},
+		}
+	}
+</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>

+ 16 - 18
src/components/admin/addTaskJcObject.vue

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

+ 2 - 1
src/components/admin/addTaskJd.vue

@@ -175,7 +175,8 @@
 				} else {
 					this.$message({
 						type: 'success',
-						message: result.data.message
+						// message: result.data.message
+						message: '保存成功'
 					})
 				}
 					

+ 98 - 82
src/components/admin/addTaskObjectJd.vue

@@ -16,31 +16,28 @@
 			</el-form-item>
 			<el-form-item prop="sample_address" label="地区"   >
 				<el-cascader  :options="region" v-model="sample_address"
-					@change="handleChange">
+					@change="handleChange" clearable >
 				</el-cascader>
 			</el-form-item>
+
+				<!-- <el-form-item prop="sample_address" label="地区"   >
+					<el-cascader :options="options" :props="props" v-model="sample_address" clearable ></el-cascader>
+				</el-form-item> -->
+
+
+
 		<!-- 底部按钮 -->
 			<el-form-item>
 				<el-button type="success" @click="onSubmit()">保存</el-button>
 				<el-button @click="reBack">返回</el-button>
 			</el-form-item>
 		</el-form>
-
+<!-- 抽样机构 -->
 		<!-- 选择抽样机构对话框 -->
-		<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-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>
@@ -52,31 +49,22 @@
 					<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-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%" >
@@ -90,10 +78,11 @@
 						: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>
@@ -113,19 +102,22 @@ import {
 	export default {
 		data() {
 			return {
+				// 地区单选
+				props: { multiple: true },
 				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,
@@ -154,7 +146,7 @@ import {
 				// }],
 				// 抽样地区
 				region: regionData,
-				sample_address: [],
+				sample_address:[],
 				// 机构地域表格数据
 				underTask: [],
 				underTasktotal: 0,
@@ -171,14 +163,6 @@ import {
 				// myHeaders: {
 				// 	Authorization: 'bearer'+ token//上传文件添加token
 				// },
-				// 任务表单
-				// form: {
-				// 	main_unit: [],	
-				// 	check_unit: [],				
-				// },
-				// form: {
-				// 	check_unit: [],			
-				// },
 				// 优先级选项
 				priority: [{
 					value: '0',
@@ -203,11 +187,12 @@ import {
 
 				// 弹出抽样机构弹窗
 				getOrganizationsShow1: false,
-				// 查询检测机构请求参数
+				// 查询抽样机构请求参数
 				queryInfo1: {
 					pageNum: 1,
 					pageSize: 10,
 					name:'',
+					sample_org_id:''
 				},
 
 				// 弹出检测机构弹窗
@@ -216,8 +201,8 @@ import {
 				queryInfo2: {
 					pageNum: 1,
 					pageSize: 10,
-					keyWord: '',
-					groupname:'检测机构'
+					// keyWord: '',
+					groupname:'检测机构',
 				},
 				//抽样机构列表
 				testList: [],
@@ -258,6 +243,9 @@ import {
 			}
 		},
 		created:function(){
+			this.sample_org_id = this.id
+			this.task_id= this.$route.params.task_id
+			console.log(this.task_id)
 			this.postTaskProfile()
 		},
 		
@@ -265,22 +253,29 @@ import {
 			let that = this
 		},
 		methods: {
-			// 获取机构列表
-				async postTaskProfile() {
+			// 添加任务step2
+			async postTaskProfile() {
 				const result = await this.$http.post('postTaskProfile', {
 					task_id: this.task_id,
-				
-				})},
-			//搜索
-			async search(){
-				this.queryInfo1.pageNum = 1
-					this.getOrganizations()
+					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 search2(){
-				this.queryInfo2.pageNum = 1
-					this.getOrganizations()
-			},
+			// async search(){
+			// 	this.queryInfo1.pageNum = 1
+			// 		this.getOrganizations()
+			// },
+			//搜索
+			// async search2(){
+			// 	this.queryInfo2.pageNum = 1
+			// 		this.getOrganizations()
+			// },
+			
 			// 获取选择抽样地区
 			handleChange() {
 				var that = this
@@ -289,6 +284,7 @@ import {
 					loc += CodeToText[this.sample_address[i]];
 				}
 				that.form.sample_address = loc
+				// console.log(loc)
 			},
 			//保存
 			async onSubmit() {
@@ -298,10 +294,14 @@ 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('checkMonitor')
+					this.$router.push('routineMonitor')
 				} else {
 					this.$message({
 						type: 'error',
@@ -310,31 +310,27 @@ import {
 				}
 			},
 			reBack() {
-				this.$router.push('addTaskJd')
+				this.$router.push('addTask')
 			},		
 			// 获取抽样机构列表
 			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
@@ -350,41 +346,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()
 			},
+//检测机构页码
+			/** 监听每页显示多少数据的改变 */
+			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.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)
 			},
 		}
 	}

+ 98 - 82
src/components/admin/addTaskObjectZx.vue

@@ -16,31 +16,28 @@
 			</el-form-item>
 			<el-form-item prop="sample_address" label="地区"   >
 				<el-cascader  :options="region" v-model="sample_address"
-					@change="handleChange">
+					@change="handleChange" clearable >
 				</el-cascader>
 			</el-form-item>
+
+				<!-- <el-form-item prop="sample_address" label="地区"   >
+					<el-cascader :options="options" :props="props" v-model="sample_address" clearable ></el-cascader>
+				</el-form-item> -->
+
+
+
 		<!-- 底部按钮 -->
 			<el-form-item>
 				<el-button type="success" @click="onSubmit()">保存</el-button>
 				<el-button @click="reBack">返回</el-button>
 			</el-form-item>
 		</el-form>
-
+<!-- 抽样机构 -->
 		<!-- 选择抽样机构对话框 -->
-		<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-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>
@@ -52,31 +49,22 @@
 					<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-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%" >
@@ -90,10 +78,11 @@
 						: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>
@@ -113,19 +102,22 @@ import {
 	export default {
 		data() {
 			return {
+				// 地区单选
+				props: { multiple: true },
 				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,
@@ -154,7 +146,7 @@ import {
 				// }],
 				// 抽样地区
 				region: regionData,
-				sample_address: [],
+				sample_address:[],
 				// 机构地域表格数据
 				underTask: [],
 				underTasktotal: 0,
@@ -171,14 +163,6 @@ import {
 				// myHeaders: {
 				// 	Authorization: 'bearer'+ token//上传文件添加token
 				// },
-				// 任务表单
-				// form: {
-				// 	main_unit: [],	
-				// 	check_unit: [],				
-				// },
-				// form: {
-				// 	check_unit: [],			
-				// },
 				// 优先级选项
 				priority: [{
 					value: '0',
@@ -203,11 +187,12 @@ import {
 
 				// 弹出抽样机构弹窗
 				getOrganizationsShow1: false,
-				// 查询检测机构请求参数
+				// 查询抽样机构请求参数
 				queryInfo1: {
 					pageNum: 1,
 					pageSize: 10,
 					name:'',
+					sample_org_id:''
 				},
 
 				// 弹出检测机构弹窗
@@ -216,8 +201,8 @@ import {
 				queryInfo2: {
 					pageNum: 1,
 					pageSize: 10,
-					keyWord: '',
-					groupname:'检测机构'
+					// keyWord: '',
+					groupname:'检测机构',
 				},
 				//抽样机构列表
 				testList: [],
@@ -258,6 +243,9 @@ import {
 			}
 		},
 		created:function(){
+			this.sample_org_id = this.id
+			this.task_id= this.$route.params.task_id
+			console.log(this.task_id)
 			this.postTaskProfile()
 		},
 		
@@ -265,22 +253,29 @@ import {
 			let that = this
 		},
 		methods: {
-			// 获取机构列表
-				async postTaskProfile() {
+			// 添加任务step2
+			async postTaskProfile() {
 				const result = await this.$http.post('postTaskProfile', {
 					task_id: this.task_id,
-				
-				})},
-			//搜索
-			async search(){
-				this.queryInfo1.pageNum = 1
-					this.getOrganizations()
+					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 search2(){
-				this.queryInfo2.pageNum = 1
-					this.getOrganizations()
-			},
+			// async search(){
+			// 	this.queryInfo1.pageNum = 1
+			// 		this.getOrganizations()
+			// },
+			//搜索
+			// async search2(){
+			// 	this.queryInfo2.pageNum = 1
+			// 		this.getOrganizations()
+			// },
+			
 			// 获取选择抽样地区
 			handleChange() {
 				var that = this
@@ -289,6 +284,7 @@ import {
 					loc += CodeToText[this.sample_address[i]];
 				}
 				that.form.sample_address = loc
+				// console.log(loc)
 			},
 			//保存
 			async onSubmit() {
@@ -298,10 +294,14 @@ 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('specialMonitor')
+					this.$router.push('routineMonitor')
 				} else {
 					this.$message({
 						type: 'error',
@@ -310,31 +310,27 @@ import {
 				}
 			},
 			reBack() {
-				this.$router.push('addTaskZx')
+				this.$router.push('addTask')
 			},		
 			// 获取抽样机构列表
 			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
@@ -350,41 +346,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()
 			},
+//检测机构页码
+			/** 监听每页显示多少数据的改变 */
+			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.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)
 			},
 		}
 	}

+ 2 - 1
src/components/admin/addTaskZx.vue

@@ -175,7 +175,8 @@
 				} else {
 					this.$message({
 						type: 'success',
-						message: result.data.message
+						// message: result.data.message
+						message: '保存成功'
 					})
 				}
 					

+ 3 - 3
src/components/admin/checkMonitor.vue

@@ -328,8 +328,8 @@
 					name:'getJcds',
 					params: {
 					id: id,
-					parentName:'例行监测',
-					labelName:'检测单'
+					parentName:'监督抽查',
+					labelName:'查看检测机构'
 					}
 				})
 			},
@@ -358,7 +358,7 @@
 			},
 			//退回
 			async sendBack(){
-				const result = await this.$http.post("postRetask", this.queryInfo);
+				const result = await this.$http.post("postRetask",  {task_id:id});
 					if (result.data.code == 0) {
 						this.$message({
 						type: 'success',

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

@@ -6,10 +6,10 @@
 			<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>
 
 		<el-form :model="form" label-width="100px">

+ 74 - 0
src/components/admin/readCheck copy.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>

+ 165 - 52
src/components/admin/readCheck.vue

@@ -1,74 +1,187 @@
 <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>
+	<div>
+	<div id="sampleReport">
+        <el-descriptions  title="农产品质量安全检测单" :column="2" border style="margin-top:20px">
+            <el-descriptions-item label="抽样单编号" prop="jcd_unit.jcd_code" style="width:200px" class="labelItem" size="mini" required >
+                {{jcd_unit.jcd_code}}
+            </el-descriptions-item>
+			<el-descriptions-item label="检测结果" prop="jcd_unit.jcd_result" style="width:200px" class="labelItem" size="mini" required >
+                {{jcd_unit.jcd_result}}
+            </el-descriptions-item>
+			<el-descriptions-item label="附件链接" prop="jcd_unit.file_url" style="width:200px" class="labelItem" size="mini" required >
+                {{jcd_unit.file_url}}
+            </el-descriptions-item>
+			<el-descriptions-item label="检测单状态" prop="jcd_unit.jcd_status" style="width:200px" class="labelItem" size="mini" required >
+                {{jcd_unit.jcd_status}}
+            </el-descriptions-item>               
+        </el-descriptions>
+            <!-- 检测单未合格项目信息 -->
+                <el-descriptions id="sampleInfo" :column="1" border style="">
+                    <el-descriptions-item label="未合格项目信息">
+                        <!-- 不合格样品表格区域 -->
+                        <div>
+                            <el-table :data="jcdItem" border stripe highlight-current-row style="width: 100%;border:1px;"
+                            :row-style="rowStyle" :cell-style="cellStyle">
+                                <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>
+                        </div>
+                    </el-descriptions-item>
+                </el-descriptions>
+			</div>  
+        <!-- 底部按钮 -->
+                <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 {
+		name: 'inputSample',
 		data() {
 			return {
-				jcd_data:{},//检测单信息
-				jcd_id:''
+				myHeaders: {Authorization: 'bearer' + token},
+				fileList: [],
+				form: {},
+				jcd_id:'',
+				jcdItem: [],//不合格项信息
+				jcd_unit:[],//检测单信息
+				units: [],
+				production: [],
+				task_id: '',
+            	task_profile_id:'', 
+				cellStyle: {
+					padding: 2 + 'px'
+				},
+				rowStyle: {
+					height: 35 + 'px'
+				},
+				tableHeader: [{
+						label: '检测项目',
+						prop: 'item_name',
+						// fixed: 'left'
+                        width: 210
+					},
+					{
+						label: '检验标准',
+						prop: 'item_standard',
+						width: 210
+					},
+					{
+						label: '实测值',
+						prop: 'item_measured_value',
+						width: 210
+					},
+					{
+						label: '检验依据',
+						prop: 'item_result',
+						width: 210
+					},
+					{
+						label: '检验备注',
+						prop: 'item_log',
+						width: 210
+					}
+				],
 			}
 		},
 		created() {
+			this.task_id = this.$route.params.task_id
+			this.task_profile_id = this.$route.params.task_profile_id
 			this.jcd_id = this.$route.params.jcd_id
-			console.log(this.jcd_id)
+			// console.log(this.task_id)
+			// console.log(this.task_profile_id)
 			this.getJcd()
 		},
-		mounted(){
-		if (window.history && window.history.pushState) {
-		history.pushState(null, null, document.URL); //这里有没有都无所谓,最好是有以防万一
-		window.addEventListener('popstate', this.goBack, false);
-		// 回退时执行goback方法
-		}
-    },
-		methods: { 
-          // 返回
+		methods: {
+			// 获取抽样单信息
+			async getJcd() {
+				const result = await this.$http.post('getJcd', {
+					task_profile_id: this.task_profile_id,
+					task_id: this.task_id,
+					jcd_id : this.$route.params.jcd_id
+				})
+				this.jcd_unit = result.data.data//检测单信息
+					console.log(this.jcd_unit.jcd_result)
+				if(this.jcd_unit.jcd_result == '1'){
+					this.jcd_unit.jcd_result = '合格'
+				}else{
+					this.jcd_unit.jcd_result = '不合格'
+				}
+
+				if(this.jcd_unit.jcd_status == '1'){
+					this.jcd_unit.jcd_status = '未上报'
+				}else if(this.jcd_unit.jcd_status == '2'){
+					this.jcd_unit.jcd_status = '已上报'
+				}else if(this.jcd_unit.jcd_status == '5'){
+					this.jcd_unit.jcd_status = '已完成'
+				}else{
+					this.jcd_unit.jcd_status = '无'
+				}
+                this.jcdItem = result.data.data.jcdItem//不合格项信息
+				
+				console.log(this.jcd_unit)
+				console.log(result.data.data.jcdItem)
+			},
+			// 返回
 			back() {
-				var that = this
-				console.log(that.task_id)
+				// 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,	
+						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>
+</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: 12%;
+		font-size: .875rem;
+		}
+		.el-descriptions-item__content{
+			font-size: .875rem;
+		}
+	}
+
+</style>

+ 1 - 1
src/components/admin/readCheckList.vue

@@ -88,7 +88,7 @@ export default{
                             prop: 'cyd_code',
                             width: 180,
                         },{
-                            label: '受检单位',
+                            label: '单位名称',
                             prop: 'inspectedUnit.inspected_name',
                             width: 120,
                         },{

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

@@ -0,0 +1,103 @@
+<template>
+<div>
+    <el-descriptions title="抽样单" direction="vertical" :column="5" border align="center">
+            <!-- 抽样单信息 -->
+            <el-descriptions-item label="抽样单编码" prop="cyd_data.cyd_code">{{cyd_data.cyd_code}}</el-descriptions-item>
+            <el-descriptions-item label="抽样单状态" prop="cyd_data.cyd_status">{{cyd_data.cyd_status}}</el-descriptions-item>
+            <el-descriptions-item label="单位名称" prop="taskProfile_unit.sampleOrgId.name">{{taskProfile_unit.sampleOrgId.name}}</el-descriptions-item>
+            <el-descriptions-item label="单位别名" prop="taskProfile_unit.sampleOrgId.name_other">{{taskProfile_unit.sampleOrgId.name_other}}</el-descriptions-item>
+            <el-descriptions-item label="组别" prop="taskProfile_unit.sampleOrgId.groupname">{{taskProfile_unit.sampleOrgId.groupname}}</el-descriptions-item>
+            <el-descriptions-item label="机构性质" prop="taskProfile_unit.sampleOrgId.properties">{{taskProfile_unit.sampleOrgId.properties}}</el-descriptions-item>
+            <el-descriptions-item label="联系人" prop="taskProfile_unit.sampleOrgId.contact_name">{{taskProfile_unit.sampleOrgId.contact_name}}</el-descriptions-item>
+            <el-descriptions-item label="联系电话" prop="taskProfile_unit.sampleOrgId.contact_phone">{{taskProfile_unit.sampleOrgId.contact_phone}}</el-descriptions-item>
+            <!-- 抽样人员信息 -->
+            <el-descriptions-item label="抽样人员1" prop="cydProfile_unit.sample_person_one">{{cydProfile_unit.sample_person_one}}</el-descriptions-item>
+            <el-descriptions-item label="抽样人员2" prop="cydProfile_unit.sample_person_two">{{cydProfile_unit.sample_person_two}}</el-descriptions-item>
+            <el-descriptions-item label="抽样地区" prop="cydProfile_unit.sample_address">{{cydProfile_unit.sample_address}}</el-descriptions-item>
+            <el-descriptions-item label="抽样日期" prop="cydProfile_unit.cyd_date">{{cydProfile_unit.cyd_date}}</el-descriptions-item>
+            <el-descriptions-item label="附件名称" prop="cydProfile_unit.cyd_file_name">{{cydProfile_unit.cyd_file_name}}</el-descriptions-item>
+            <el-descriptions-item label="附件链接" prop="cydProfile_unit.cyd_file_url">{{cydProfile_unit.cyd_file_url}}</el-descriptions-item>
+            <el-descriptions-item label="抽样单备注" prop="cydProfile_unit.cyd_log">{{cydProfile_unit.cyd_log}}</el-descriptions-item>
+            <!-- 受检单位信息 -->
+            <el-descriptions-item label="受检地区" prop="inspected_unit.inspected_address">{{inspected_unit.inspected_address}}</el-descriptions-item>
+            <el-descriptions-item label="受检单位名称" prop="inspected_unit.inspected_name">{{inspected_unit.inspected_name}}</el-descriptions-item>
+            <el-descriptions-item label="联系人" prop="inspected_unit.contact_name">{{inspected_unit.contact_name}}</el-descriptions-item>
+            <el-descriptions-item label="联系人电话" prop="inspected_unit.contact_phone">{{inspected_unit.contact_phone}}</el-descriptions-item>
+            <el-descriptions-item label="联系人邮箱" prop="inspected_unit.contact_email">{{inspected_unit.contact_email}}</el-descriptions-item>
+            <!-- 样品信息 -->
+            <el-descriptions-item label="样品名称" prop="sample_unit.sample_name">{{sample_unit.sample_name}}</el-descriptions-item>
+            <el-descriptions-item label="样品商标" prop="sample_unit.sample_brand">{{sample_unit.sample_brand}}</el-descriptions-item>
+            <el-descriptions-item label="样品规格型号" prop="sample_unit.sample_type">{{sample_unit.sample_type}}</el-descriptions-item>
+            <el-descriptions-item label="样品生产日期" prop="sample_unit.sample_md_date">{{sample_unit.sample_md_date}}</el-descriptions-item>
+            <el-descriptions-item label="样品质量等级" prop="sample_unit.sample_quality_grade">{{sample_unit.sample_quality_grade}}</el-descriptions-item>
+            <el-descriptions-item label="样品生产厂家" prop="sample_unit.sample_product_name">{{sample_unit.sample_product_name}}</el-descriptions-item>
+            <el-descriptions-item label="样品生产厂家联系电话" prop="sample_unit.sample_product_phone">{{sample_unit.sample_product_phone}}</el-descriptions-item>
+            <el-descriptions-item label="样品来源" prop="sample_unit.sample_source">{{sample_unit.sample_source}}</el-descriptions-item>
+            <el-descriptions-item label="抽样日期" prop="sample_unit.sample_ing_date">{{sample_unit.sample_ing_date}}</el-descriptions-item>
+            <el-descriptions-item label="抽样数量" prop="sample_unit.sample_count">{{sample_unit.sample_count}}</el-descriptions-item>
+            <el-descriptions-item label="抽样基数" prop="sample_unit.sample_base">{{sample_unit.sample_base}}</el-descriptions-item>
+            <el-descriptions-item label="样品备注" prop="sample_unit.sample_log">{{sample_unit.sample_log}}</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')
+	export default {
+		data() {
+			return {
+				cyd_data: {},//抽样单信息
+                cydProfile_unit:{},//抽样人员信息
+                taskProfile_unit:{},//抽样单位信息
+				inspected_unit: {},//受检单位信息
+				sample_unit: {},//样品信息
+			}
+		},
+		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: {
+          // 返回
+			back() {
+				var that = this
+				console.log(that.task_id)
+				this.$router.push({
+					name: 'readSampleList',
+					params: {
+						id: that.task_id
+					}
+				})
+			},
+			// 获取抽样单信息
+			async getCyd(id) {
+				const result = await this.$http.post('getCyd', {
+					cyd_id: this.cyd_id,
+					sample_id :34
+				})
+				console.log(result.data.data)
+				this.cyd_data = result.data.data//抽样单信息
+                this.cydProfile_unit = result.data.data.cydProfile//抽样人员信息
+                this.taskProfile_unit = result.data.data.taskProfile//抽样单位信息
+				this.inspected_unit = result.data.data.inspectedUnit//受检单位信息
+				this.sample_unit = result.data.data.sample//样品信息
+				console.log(this.cyd_data)
+                console.log(this.cydProfile_unit)
+                console.log(this.taskProfile_unit)
+				console.log(this.inspected_unit)
+				console.log(this.sample_unit)
+                console.log(this.cyd_id)
+			},
+		},
+	}
+</script>

+ 279 - 70
src/components/admin/readSample.vue

@@ -1,103 +1,312 @@
 <template>
-<div>
-    <el-descriptions title="抽样单" direction="vertical" :column="5" border align="center">
-            <!-- 抽样单信息 -->
-            <el-descriptions-item label="抽样单编码" prop="cyd_data.cyd_code">{{cyd_data.cyd_code}}</el-descriptions-item>
-            <el-descriptions-item label="抽样单状态" prop="cyd_data.cyd_status">{{cyd_data.cyd_status}}</el-descriptions-item>
-            <el-descriptions-item label="单位名称" prop="taskProfile_unit.sampleOrgId.name">{{taskProfile_unit.sampleOrgId.name}}</el-descriptions-item>
-            <el-descriptions-item label="单位别名" prop="taskProfile_unit.sampleOrgId.name_other">{{taskProfile_unit.sampleOrgId.name_other}}</el-descriptions-item>
-            <el-descriptions-item label="组别" prop="taskProfile_unit.sampleOrgId.groupname">{{taskProfile_unit.sampleOrgId.groupname}}</el-descriptions-item>
-            <el-descriptions-item label="机构性质" prop="taskProfile_unit.sampleOrgId.properties">{{taskProfile_unit.sampleOrgId.properties}}</el-descriptions-item>
-            <el-descriptions-item label="联系人" prop="taskProfile_unit.sampleOrgId.contact_name">{{taskProfile_unit.sampleOrgId.contact_name}}</el-descriptions-item>
-            <el-descriptions-item label="联系电话" prop="taskProfile_unit.sampleOrgId.contact_phone">{{taskProfile_unit.sampleOrgId.contact_phone}}</el-descriptions-item>
-            <!-- 抽样人员信息 -->
-            <el-descriptions-item label="抽样人员1" prop="cydProfile_unit.sample_person_one">{{cydProfile_unit.sample_person_one}}</el-descriptions-item>
-            <el-descriptions-item label="抽样人员2" prop="cydProfile_unit.sample_person_two">{{cydProfile_unit.sample_person_two}}</el-descriptions-item>
-            <el-descriptions-item label="抽样地区" prop="cydProfile_unit.sample_address">{{cydProfile_unit.sample_address}}</el-descriptions-item>
-            <el-descriptions-item label="抽样日期" prop="cydProfile_unit.cyd_date">{{cydProfile_unit.cyd_date}}</el-descriptions-item>
-            <el-descriptions-item label="附件名称" prop="cydProfile_unit.cyd_file_name">{{cydProfile_unit.cyd_file_name}}</el-descriptions-item>
-            <el-descriptions-item label="附件链接" prop="cydProfile_unit.cyd_file_url">{{cydProfile_unit.cyd_file_url}}</el-descriptions-item>
-            <el-descriptions-item label="抽样单备注" prop="cydProfile_unit.cyd_log">{{cydProfile_unit.cyd_log}}</el-descriptions-item>
-            <!-- 受检单位信息 -->
-            <el-descriptions-item label="受检地区" prop="inspected_unit.inspected_address">{{inspected_unit.inspected_address}}</el-descriptions-item>
-            <el-descriptions-item label="受检单位名称" prop="inspected_unit.inspected_name">{{inspected_unit.inspected_name}}</el-descriptions-item>
-            <el-descriptions-item label="联系人" prop="inspected_unit.contact_name">{{inspected_unit.contact_name}}</el-descriptions-item>
-            <el-descriptions-item label="联系人电话" prop="inspected_unit.contact_phone">{{inspected_unit.contact_phone}}</el-descriptions-item>
-            <el-descriptions-item label="联系人邮箱" prop="inspected_unit.contact_email">{{inspected_unit.contact_email}}</el-descriptions-item>
+	<div>
+	<div id="sampleReport">
+        <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>
+         <!-- 抽样人员情况 -->
+            <el-descriptions :column="1" border style="" >
+                <el-descriptions-item label="抽样人员信息" >
+                    <el-descriptions  :column="1" border  size="mini" style="width:100%;font-size:20px;">
+                        <el-descriptions-item label="抽样人员1" prop="cydProfile_unit.sample_person_one" size="mini" required>
+                            {{cydProfile_unit.sample_person_one}}
+                        </el-descriptions-item>
+                         <el-descriptions-item label="抽样人员2" prop="cydProfile_unit.sample_person_two" size="mini" required>
+                            {{cydProfile_unit.sample_person_two}}
+                        </el-descriptions-item>
+                        <el-descriptions-item label="抽样地区" prop="cydProfile_unit.sample_address" size="mini" required>
+                            {{cydProfile_unit.sample_address}}
+                        </el-descriptions-item>
+                        <el-descriptions-item label="抽样日期" prop="cydProfile_unit.cyd_date" size="mini" required>
+                            {{cydProfile_unit.cyd_date}}
+                        </el-descriptions-item>
+                        <el-descriptions-item label="附件链接" prop="cydProfile_unit.cyd_file_url" size="mini">
+                            {{cydProfile_unit.cyd_file_url}}
+                        </el-descriptions-item>
+                         <el-descriptions-item label="抽样单备注" prop="cydProfile_unit.cyd_log" size="mini">
+                            {{cydProfile_unit.cyd_log}}
+                        </el-descriptions-item>
+                    </el-descriptions>
+                </el-descriptions-item>
+            </el-descriptions>
+            <!-- 抽样单位信息 -->
+                <el-descriptions :column="1" border style="" >
+                    <el-descriptions-item label="抽样单位信息" >
+                        <el-descriptions  :column="1" border  size="mini" style="width:100%">
+                                <el-descriptions-item label="抽样单状态" prop="cyd_data.cyd_status" style="width:200px" class="labelItem" size="mini" required >
+                                    {{cyd_data.cyd_status}}
+                                </el-descriptions-item>
+                                <el-descriptions-item label="单位名称" prop="taskProfile_unit.sampleOrgId.name" style="width:200px" class="labelItem" size="mini" required >
+                                    {{taskProfile_unit.sampleOrgId.name}}
+                                </el-descriptions-item>
+                                <el-descriptions-item label="单位别名" prop="taskProfile_unit.sampleOrgId.name_other" style="width:200px" class="labelItem" size="mini" required >
+                                    {{taskProfile_unit.sampleOrgId.name_other}}
+                                </el-descriptions-item>
+                                <el-descriptions-item label="组别" prop="taskProfile_unit.sampleOrgId.groupname" style="width:200px" class="labelItem" size="mini" required >
+                                    {{taskProfile_unit.sampleOrgId.groupname}}
+                                </el-descriptions-item>
+                                <el-descriptions-item label="机构性质" prop="taskProfile_unit.sampleOrgId.properties" style="width:200px" class="labelItem" size="mini" required >
+                                    {{taskProfile_unit.sampleOrgId.properties}}
+                                </el-descriptions-item>
+                                <el-descriptions-item label="联系人" prop="taskProfile_unit.sampleOrgId.contact_name" style="width:200px" class="labelItem" size="mini" required >
+                                    {{taskProfile_unit.sampleOrgId.contact_name}}
+                                </el-descriptions-item>
+                                <el-descriptions-item label="联系电话" prop="taskProfile_unit.sampleOrgId.contact_phone" style="width:200px" class="labelItem" size="mini" required >
+                                    {{taskProfile_unit.sampleOrgId.contact_phone}}
+                                </el-descriptions-item>
+                        </el-descriptions>
+                    </el-descriptions-item>
+                </el-descriptions>
+            <!-- 受检单位情况 -->
+            <el-descriptions :column="1" border style="" >
+                <el-descriptions-item label="受检单位信息" >
+                    <el-descriptions  :column="1" border  size="mini" style="width:100%;font-size:20px;">
+                        <el-descriptions-item label="受检地区" prop="inspected_unit.inspected_address" size="mini" required>
+                            {{inspected_unit.inspected_address}}
+                        </el-descriptions-item>
+                         <el-descriptions-item label="受检单位名称" prop="inspected_unit.inspected_name" size="mini" required>
+                            {{inspected_unit.inspected_name}}
+                        </el-descriptions-item>
+                        <el-descriptions-item label="联系人" prop="inspected_unit.contact_name" size="mini" required>
+                            {{inspected_unit.contact_name}}
+                        </el-descriptions-item>
+                        <el-descriptions-item label="联系人电话" prop="inspected_unit.contact_phone" size="mini" required>
+                            {{inspected_unit.contact_phone}}
+                        </el-descriptions-item>
+                        <el-descriptions-item label="联系人邮箱" prop="inspected_unit.contact_email" size="mini" required>
+                            {{inspected_unit.contact_email}}
+                        </el-descriptions-item>
+                    </el-descriptions>
+                </el-descriptions-item>
+            </el-descriptions>
             <!-- 样品信息 -->
-            <el-descriptions-item label="样品名称" prop="sample_unit.sample_name">{{sample_unit.sample_name}}</el-descriptions-item>
-            <el-descriptions-item label="样品商标" prop="sample_unit.sample_brand">{{sample_unit.sample_brand}}</el-descriptions-item>
-            <el-descriptions-item label="样品规格型号" prop="sample_unit.sample_type">{{sample_unit.sample_type}}</el-descriptions-item>
-            <el-descriptions-item label="样品生产日期" prop="sample_unit.sample_md_date">{{sample_unit.sample_md_date}}</el-descriptions-item>
-            <el-descriptions-item label="样品质量等级" prop="sample_unit.sample_quality_grade">{{sample_unit.sample_quality_grade}}</el-descriptions-item>
-            <el-descriptions-item label="样品生产厂家" prop="sample_unit.sample_product_name">{{sample_unit.sample_product_name}}</el-descriptions-item>
-            <el-descriptions-item label="样品生产厂家联系电话" prop="sample_unit.sample_product_phone">{{sample_unit.sample_product_phone}}</el-descriptions-item>
-            <el-descriptions-item label="样品来源" prop="sample_unit.sample_source">{{sample_unit.sample_source}}</el-descriptions-item>
-            <el-descriptions-item label="抽样日期" prop="sample_unit.sample_ing_date">{{sample_unit.sample_ing_date}}</el-descriptions-item>
-            <el-descriptions-item label="抽样数量" prop="sample_unit.sample_count">{{sample_unit.sample_count}}</el-descriptions-item>
-            <el-descriptions-item label="抽样基数" prop="sample_unit.sample_base">{{sample_unit.sample_base}}</el-descriptions-item>
-            <el-descriptions-item label="样品备注" prop="sample_unit.sample_log">{{sample_unit.sample_log}}</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>
+                <el-descriptions id="sampleInfo" :column="1" border style="">
+                    <el-descriptions-item label="样品信息">
+                        <el-descriptions  :column="1" border size="mini" style="width:100%;margin-bottom:5px">
+                            <el-descriptions-item label="抽样地点" prop="cyd_data.cydProfile.sample_address" size="mini" required>
+                                {{cyd_data.cydProfile.sample_address}}
+                            </el-descriptions-item>
+                        </el-descriptions>
+                        <!-- 样品表格区域 -->
+                        <div>
+                            <el-table :data="sample_unit" border stripe highlight-current-row style="width: 100%;border:1px;"
+                            :row-style="rowStyle" :cell-style="cellStyle">
+                                <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>
+                        </div>
+                    </el-descriptions-item>
+                </el-descriptions>
+            <!-- 备注 -->
+                <el-descriptions :column="1" border style="" >
+                    <el-descriptions-item label="备注" > 
+                        {{cyd_data.cydProfile.cyd_log}}
+                    </el-descriptions-item>
+                </el-descriptions>
+            </div>
+        <!-- 底部按钮 -->
+                <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 {
+		name: 'inputSample',
 		data() {
 			return {
-				cyd_data: {},//抽样单信息
+				myHeaders: {Authorization: 'bearer' + token},
+				fileList: [],
+				form: {},
+				cyd_data: {cydProfile: '',},//抽样单信息
                 cydProfile_unit:{},//抽样人员信息
                 taskProfile_unit:{},//抽样单位信息
 				inspected_unit: {},//受检单位信息
 				sample_unit: {},//样品信息
+				units: [],
+				production: [],
+				task_id: '',
+				undertake_id: '',
+				cellStyle: {
+					padding: 2 + 'px'
+				},
+				rowStyle: {
+					height: 35 + 'px'
+				},
+				tableHeader: [{
+						label: '样品名称',
+						prop: 'sample_name',
+						// fixed: 'left'
+                        width: 80
+					},
+					{
+						label: '样品来源',
+						prop: 'sample_source',
+						width: 70
+					},
+					{
+						label: '样品商标',
+						prop: 'sample_brand',
+						width: 80
+					},
+					{
+						label: '抽样基数',
+						prop: 'sample_base',
+						width: 70
+					},
+					{
+						label: '抽样数量',
+						prop: 'sample_count',
+						width: 80
+					},
+					{
+						label: '抽样日期',
+						prop: 'sample_md_date',
+						width: 120
+					},
+					{
+						label: '质量等级',
+						prop: 'sample_quality_grade',
+						width: 80
+					},
+					{
+						label: '规格型号',
+						prop: 'sample_type',
+						width: 80
+					},
+					{
+						label: '生产日期',
+						prop: 'sample_md_date',
+						width: 120
+					},
+					{
+						label: '生产厂家',
+						prop: 'sample_product_name',
+						width: 100
+					},
+					{
+						label: '厂家联系电话',
+						prop: 'sample_product_phone',
+						width: 100
+					},
+					{
+						label: '样品备注',
+						prop: 'sample_log',
+						width: 100
+					}
+				],
 			}
 		},
 		created() {
-			this.cyd_id = this.$route.params.cyd_id
-			// this.sample_id = 34
-			console.log(this.cyd_id)
-			console.log(this.sample_id)
+			this.task_id = this.$route.params.task_id
+			this.task_profile_id = this.$route.params.id
+			console.log(this.task_id)
+			console.log(this.task_profile_id)
 			this.getCyd()
 		},
 		methods: {
-          // 返回
-			back() {
-				var that = this
-				console.log(that.task_id)
-				this.$router.push({
-					name: 'readSampleList',
-					params: {
-						id: that.task_id
-					}
-				})
-			},
+
 			// 获取抽样单信息
-			async getCyd(id) {
+			async getCyd() {
 				const result = await this.$http.post('getCyd', {
-					cyd_id: this.cyd_id,
-					sample_id :34
+					task_profile_id: this.task_profile_id
 				})
 				console.log(result.data.data)
 				this.cyd_data = result.data.data//抽样单信息
+                 if(this.cyd_data.cyd_status == '1'){
+					this.cyd_data.cyd_status = '未上报'
+				}else if(this.cyd_data.cyd_status == '2'){
+                    this.cyd_data.cyd_status = '已上报'
+                }else if(this.cyd_data.cyd_status == '3'){
+                    this.cyd_data.cyd_status = '已上报给抽样单位'
+                }else if(this.cyd_data.cyd_status == '21'){
+                    this.cyd_data.cyd_status = '已上报给检测单位'
+                }else if(this.cyd_data.cyd_status == '22'){
+                    this.cyd_data.cyd_status = '已上报给报告上传单位'
+                }else{
+                    this.cyd_data.cyd_status = '已上报给监管单位'
+                }
                 this.cydProfile_unit = result.data.data.cydProfile//抽样人员信息
                 this.taskProfile_unit = result.data.data.taskProfile//抽样单位信息
 				this.inspected_unit = result.data.data.inspectedUnit//受检单位信息
 				this.sample_unit = result.data.data.sample//样品信息
+				if(this.sample.sample_source == ''){
+					this.sample.sample_source = '自产'
+				}
+				// this.sampleOrgId = result.data.data.taskProfile.sampleOrgId
+                this.taskProfile_unit = result.data.data.taskProfile
+                if(this.taskProfile_unit.sampleOrgId.properties == '1'){
+                    this.taskProfile_unit.sampleOrgId.properties == '政府部门'
+                }else if(this.taskProfile_unit.sampleOrgId.properties == '2'){
+                    this.taskProfile_unit.sampleOrgId.properties == '事业单位'
+                }else{
+                    this.taskProfile_unit.sampleOrgId.properties == '企业'
+                }
 				console.log(this.cyd_data)
-                console.log(this.cydProfile_unit)
-                console.log(this.taskProfile_unit)
 				console.log(this.inspected_unit)
-				console.log(this.sample_unit)
-                console.log(this.cyd_id)
+				console.log(this.sample)
+				console.log(this.sampleOrgId)
 			},
+			// 返回
+			back() {
+				var that = this
+				console.log(that.task_id)
+				this.$router.push({
+					name: 'readCheckList',
+					params: {
+						id: that.task_id
+					}
+				})
+			}
 		},
 	}
-</script>
+</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: 12%;
+		font-size: .875rem;
+		}
+		.el-descriptions-item__content{
+			font-size: .875rem;
+		}
+	}
+
+</style>

+ 1 - 1
src/components/admin/routineMonitor.vue

@@ -357,7 +357,7 @@
 			},
 			//退回
 			async sendBack(id){
-				const result = await this.$http.post("postRetask", this.queryInfo);
+				const result = await this.$http.post("postRetask",  {task_id:id}); 
 					if (result.data.code == 0) {
 						this.$message({
 						type: 'success',

+ 2 - 27
src/components/admin/specialMonitor.vue

@@ -322,35 +322,10 @@
 					params: {
 					id: id,
 					parentName:'专项监测',
-					labelName:'检测单'
+					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

+ 2 - 2
src/components/jc/sampleReport.vue

@@ -313,13 +313,13 @@
 			// 		this.selectedOptions = '';
 			// },
 			// 返回
-			back() {
+			back() { 
 				var that = this
 				console.log(that.task_id)
 				this.$router.push({
 					name: 'setTaskcd',
 					params: {
-						id: that.task_id
+						task_id: that.task_id
 					}
 				})
 			}