yyfang пре 3 година
родитељ
комит
39efebbea8

+ 11 - 11
src/components/admin/addTaskJcObject.vue

@@ -134,7 +134,7 @@
 			</el-col>
 		</el-row>
 				<!--  表格数据区域-->
-				<el-table ref="multipleTable" :data="testList" row-key="id"  @current-change="handleSelectionChange2"
+				<el-table ref="multipleTable" :data="testList2" row-key="id"  @current-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"> -->
@@ -184,6 +184,7 @@ import {
 					check_unit:[]
 				},
 				currentRow: null,
+				currentRow2: null,
 				//组别名称
 				group: [{
 					value: '1',
@@ -275,10 +276,11 @@ import {
 				queryInfo2: {
 					pageNum: 1,
 					pageSize: 10,
-					keyWord: ''
+					keyWord: '',
+					groupname:'检测机构'
 				},
 				// 检测机构列表
-				testList: [],
+				testList2: [],
 				// 表头
 				tableHeader: [{
 						label: '单位名称',
@@ -300,12 +302,14 @@ import {
 				],
 				// 总共多少条数据
 				total: 0,
+				total2: 0,
 				// table表格多选选项
 				// multipleSelection: null,
 				getOrganizationsForm1: {},
 				getOrganizationsForm2: {},
 				// 选中的牵头单位
 				orgs: [],
+				orgs2: [],
 				// 上传成功文件列表
 				fileList: []
 			}
@@ -318,7 +322,7 @@ import {
 			let that = this
 		},
 		methods: {
-			// 获取接口
+			// 获取机构列表
 				async postTaskProfile() {
 				const result = await this.$http.post('postTaskProfile', {
 					task_id: this.task_id,
@@ -378,8 +382,8 @@ import {
 				console.log(result.data.code);
 				// 判断业务逻辑
 				if (result.data.code == 0) {
-					this.testList = result.data.data.rows
-					this.total = result.data.data.total
+					this.testList2 = result.data.data.rows
+					this.total2 = result.data.data.total
 				}
 			},
 			/** 修复当用户在大于1的分页进行数据搜索没有返回值的问题 */
@@ -430,17 +434,13 @@ import {
 			// 抽样单位提交
 			choseTest1() {
 				let that = this
-				that.orgs = that.currentRow[0].name
-				// console.log(that.orgs)
 				that.form.main_unit = that.currentRow[0].name
 				that.getOrganizationsShow1 = false
 			},
 			// 检测单位提交
 			choseTest2() {
 				let that = this
-				that.orgs = that.currentRow[0].name
-				// console.log(that.orgs)
-				that.form.check_unit = that.currentRow[0].name
+				that.form.check_unit = that.currentRow2[0].name
 				that.getOrganizationsShow2 = false
 			},
 		}

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

@@ -94,16 +94,20 @@
 				},
 				// 任务表单
 				form: {
-                    task_name:'',
-                    username:'',
-                    name:'', 
-                    name_other:'', 
-                    groupname: '', 
-                    properties: '', 
-                    contact_name: '', 
-                    contact_phone: '',
-                    create_time:'' ,
-                    update_time:''
+					main_unit: [],	
+					// batch:'',
+					// level:'',
+					// filenum:'',
+                    // task_name:'',
+                    // username:'',
+                    // name:'', 
+                    // name_other:'', 
+                    // groupname: '', 
+                    // properties: '', 
+                    // contact_name: '', 
+                    // contact_phone: '',
+                    // create_time:'' ,
+                    // update_time:''
 				},
 				// 优先级选项
 				priority: [{
@@ -152,12 +156,12 @@
                 const result = await this.$http.post("getTask",{task_id:this.task_id});
 				this.form=result.data.data
 				console.log(result.data)
-            },
+            }, 
             //保存
 			async onSubmit() {
 				this.form['token'] = token
 				this.form['groupname'] = this.groupname
-				this.form['orgs'] = this.orgs
+				// this.form['orgs'] = this.orgs
 				this.form['releaser'] = window.sessionStorage.getItem('rymc')
 				this.form['task_class'] = 'retask'
 				this.form['ispublic'] = 0

+ 30 - 34
src/components/admin/getJcds.vue

@@ -15,8 +15,8 @@
             :prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
         <!-- 操作 -->
         <el-table-column label="操作" align="center" fixed="right">
-        <template>
-            <el-button @click="read" style="margin:5px 0" type="success" size="small" >查看检测单列表</el-button>
+        <template slot-scope="scope">
+            <el-button @click="read(scope.row.task_id,scope.row.id)" style="margin:5px 0" type="success" size="small" >查看检测单列表</el-button>
         </template>
         </el-table-column>
     </el-table>
@@ -41,17 +41,11 @@ export default {
 			tableData: [],
             sampleOrgId:{},
             queryInfo:{
-					pageSize:10,
+				pageSize:10,
 					pageNum:1,
-					task_class:'例行监测',
-                    task_id: 33, //任务id
-                    sample_org_id: 18, //抽样单位id
-                    check_org_id: 272, //检测单位id
-                    sample_address:null, //抽样地址
-                    task_id:'33',
-                    task_profile_id:'',
-                    pageNum:'1',
-                    pageSize:'10',
+					// task_class:'例行监测',
+                    task_id:'',
+                    // task_profile_id:''
                     cyd_status_condition:'',
                     cyd_status:''
                     },
@@ -75,9 +69,7 @@ export default {
         this.getJgTaskProfiles()
     },
     created() {
-        this.id = this.$route.params.id
-        // this.task_id = this.$route.params.id
-        // console.log(this.task_id)
+        this.task_id = this.$route.params.id
         this.getJgTaskProfiles()
     },
 	methods: {
@@ -85,27 +77,31 @@ export default {
         returnTask(){
             this.$router.push('routineMonitor')
         },
-        // 获取抽样机构列表
+        // 获取检测机构列表
         async getJgTaskProfiles() {
-            for (var key in this.queryInfo) {
-                if (this.queryInfo[key] == '') {
-                    delete this.queryInfo[key]
-                }
-            }
-            const {
-                data: res
-            } = await this.$http.post(
-                "getJgTaskProfiles", this.queryInfo
-            );
-            this.tableData = res.data.rows
-            this.total = res.data.total
-            this.task_id = res.data.rows.task_id
-            console.log(result.data.rows.task_id)
+              var that = this
+            const { data: res} = await this.$http.post("getJgTaskProfiles", {
+                task_id: that.task_id,
+                task_profile_id:that.id,
+                pageNum: that.queryInfo.pageNum,
+                pageSize: that.queryInfo.pageSize
+                });
+                that.tableData = res.data.rows
+                that.total = res.data.total
         },
-        //查看检测单 
-        read(){
-				this.$router.push('readCheckList')
-			},
+        //查看检测单列表 
+        read(task_id,id){
+            // console.log(11)
+            // console.log(id)
+            // console.log(task_id)
+				this.$router.push({
+					name:'readCheckList',
+					params: {
+					task_id:task_id,
+                    task_profile_id:id
+					}
+				})
+		},
           //分页器
                 handleSizeChange(val) {
                     console.log(`每页 ${val} 条`);

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


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

@@ -0,0 +1,252 @@
+<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>

+ 178 - 183
src/components/admin/readCheckList.vue

@@ -3,215 +3,210 @@
    	<div style="width: 100%">
         <!-- 标题栏导航 -->
 	    <div slot="header" class="clearfix">
-            <el-breadcrumb separator-class="el-icon-artableDate-right">		
+            <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>
 		</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 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"
+    
+    <!-- 检测单表格区域 -->
+        <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 @size-change="handleSizeChange1" @current-change="handleCurrentChange1"
                 :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="returnJcd()" >
-                    返回
-                </el-button>
+                <template slot-scope="scope">
+                <el-button plain size="medium" @click="returnJcdList(scope.row.task_id)" >返回</el-button>
+                </template>
             </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>
 
+            <!-- 查看样品列表弹框 -->
+            <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-pagination @size-change="handleSizeChange2" @current-change="handleCurrentChange2"
+                    :current-page="yangInfo.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="yangInfo.pageSize"
+                    layout="total, sizes, prev, pager, next, jumper" :total="total" background />
+                </el-table>
+                </el-form>
+            </el-dialog>
     </div>
 </template>
 
 <script>
-export default {
-    data() {
-        return {
-            // 查看任务详情
-			dialogVisible: false,
-			readForm: {
-                cyd_code:''
-            },
-            // 数据表格数据
-			tableData:[],
-            sampleOrgId:{},
+export default{
+    data(){
+        return{
+            //弹框显隐
+            readDialog:false,
+            //第一个表格
+            tableData:[],
+            //第二个表格
+            tableData2:[],
+            //获取检测机构的两个参数
+            task_id:'', 
+            task_profile_id:'', 
+            //获取样品列表的抽样单id
+            cyd_id:'',
+            //条数
+            total:0,
+             // 第一个页码
             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: '抽样单编码',
+                pageSize:10,
+				pageNum:1,
+            },
+            // 第二个页码
+            yangInfo:{
+                pageSize:10,
+                pageNum:1
+            },
+            //第一个大表格
+            tableHeader1: [{
+                label: '抽样单编码',
                             prop: 'cyd_code',
                             width: 180,
                         },{
-                            label: '抽样人员1',
-                            prop: 'cydProfile.sample_person_one',
+                            label: '受检单位',
+                            prop: 'inspectedUnit.inspected_name',
                             width: 120,
                         },{
-                            label: '抽样人员2',
-                            prop: 'cydProfile.sample_person_two',
+                            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: 'cydProfile.cyd_date',
-                            width: 160,
-                        },
-                        // {
-                        //     label: '样品名称',
-                        //     prop: 'inspectedUnit.sample_name',
-                        //     width: 120,
-                        // },{
-                        //     label: '样品商标',
-                        //     prop: 'sample.data.sample_brand'
-                        // },
-                        {
-                            label: '抽样单状态',
-                            prop: 'cyd_status'
-                        },
-                ]  
+                            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.id = this.$route.params.id
-        // this.task_id = this.$route.params.id
-        // console.log(this.task_id)
-        this.getJcds()
-    },
-	methods: {
-        //返回
-        returnJcd(){
-            this.$router.push('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
+       this.getJcds()
+       this.getSamples()
+   },
+   methods:{
+       //获取检测机构列表的接口
         async getJcds() {
-            for (var key in this.queryInfo) {
-                if (this.queryInfo[key] == '') {
-                    delete this.queryInfo[key]
-                }
-            }
-            const {
-                data: res
-            } = await this.$http.post(
-                "getJcds", 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 ="执行中";
+             const {data: res} = await this.$http.post("getJcds", {
+                pageNum: this.queryInfo.pageNum,
+                pageSize: this.queryInfo.pageSize,
+                task_id: this.task_id,
+                task_profile_id:this.task_profile_id,
+             })
+             this.tableData = res.data.rows
+             this.total = res.data.total
+             console.log( this.tableData)
+        },
+       //第一个分页器
+        /** 监听页码的改变 */
+        handleCurrentChange1(newPage) {
+            this.queryInfo.pageNum = newPage
+            this.getJcds()
+        },
+        /** 监听每页显示多少数据的改变 */
+        handleSizeChange1(newSize) {
+            this.queryInfo.pageSize = newSize
+            this.getJcds()
+        },
+        //第二个分页器
+        /** 监听页码的改变 */
+        handleCurrentChange2(newPage) {
+            this.yangInfo.pageNum = newPage
+            this.getSamples()
+        },
+        /** 监听每页显示多少数据的改变 */
+        handleSizeChange2(newSize) {
+            this.yangInfo.pageSize = newSize
+            this.getSamples()
+        },
+        //返回
+        returnJcdList(task_id){
+            // var that = this
+            this.$router.push({
+                name:'getJcds',
+                params:{
+                    task_id: task_id
                 }
-            }
+            })
         },
-        
-        //分页器
-                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()
-                },
-            	// 查看任务详情
-			async readDialogVisible1(row) {
-				this.readForm.cyd_code = row.cyd_code
-				
-				this.readDialogVisible = true
-            }
-         
+        //获取样品列表
+        async getSampleList(id) {
+				this.readDialog = true
+				this.getSamples(id)
+		},
+
+
+        async getSamples(id) {
+            const {data: res} = await this.$http.post("getSamples",{
+                    cyd_id: id,
+                    pageNum: this.yangInfo.pageNum,
+                    pageSize: this.yangInfo.pageSize
+                })
+                this.tableData2 = res.data.rows
+                console.log(res.data.rows)
+        }
+
+
+   
     }
 }
 </script>
-<style>
-.btns{
-	float:right;
-	/* margin-top: 10px; */
-	padding: 10px;
-}
-.feyeqi{
-    margin-top: 10px;
-}
-</style>

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

@@ -0,0 +1,187 @@
+<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>

+ 112 - 0
src/components/admin/readSample.vue

@@ -0,0 +1,112 @@
+<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
+			console.log(this.cyd_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() {
+				const result = await this.$http.post('getCyd', {
+					cyd_id: this.cyd_id
+				})
+				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)
+			},
+			// 生成样品编码
+			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>

+ 58 - 46
src/components/admin/readSampleList.vue

@@ -6,17 +6,24 @@
             <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-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="cyd_status" label="抽样单状态" width="150" align="center">
+                <template slot-scope="scope">
+                    <el-tag type="success" v-if="scope.row.cyd_status==1">未上报</el-tag>
+                    <el-tag type="warning" v-if="scope.row.cyd_status==2">已上报</el-tag>
+                    <el-tag type="danger" v-if="scope.row.cyd_status==3">已完成</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="readDialogVisible1(scope.row)">查看详情</el-button>
+        <template slot-scope="scope">
+            <el-button style="margin:5px 0" type="success" size="small" @click="readSample(scope.row.id)">查看详情</el-button>
         </template>
         </el-table-column>
     </el-table>
@@ -31,7 +38,7 @@
                 </el-button>
             </div>
         <!-- 查看详情对话框-->
-		<el-dialog title="查看" :visible.sync="readDialogVisible" width="30%" :close-on-click-modal="false"
+		<!-- <el-dialog title="查看" :visible.sync="readDialogVisible" width="30%" :close-on-click-modal="false"
 			class="dialogItem">
 			<el-form v-if="readDialogVisible" label-width="100px">
 				<el-form-item label="抽样单编码:" prop="tableData.cyd_code" class="labelItem">
@@ -68,7 +75,7 @@
 					<el-button type="success" @click="readDialogVisible = false">返回</el-button>
 				</div>
 			</el-form>
-		</el-dialog>
+		</el-dialog> -->
 
     </div>
 </template>
@@ -78,19 +85,19 @@ export default {
     data() {
         return {
             // 查看任务详情
-			readDialogVisible: false,
-			readForm: {},
+			// readDialogVisible: false,
+			// readForm: {},
             // 数据表格数据
 			tableData:[],
             sampleOrgId:{},
+            task_id:'', 
+            task_profile_id:'', 
             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
+                    sample_org_id:'', 
+                    check_org_id:'', 
                     cyd_status:'',
                     cyd_status_condition:'',
                     cyd_code:''
@@ -120,53 +127,51 @@ export default {
                         //     label: '样品商标',
                         //     prop: 'sample.data.sample_brand'
                         // },
-                        {
-                            label: '抽样单状态',
-                            prop: 'cyd_status'
-                        },
+                        // {
+                        //     label: '抽样单状态',
+                        //     prop: 'cyd_status'
+                        // },
                 ]  
         }
     },
-    mounted() {
+    mounted() { 
         this.getCyds()
     },
     created() {
+        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.getCyds()
     },
 	methods: {
         //返回
         returnSampleList(){
-            this.$router.push('setTaskJg')
+            var that = this
+            this.$router.push({
+                name:'setTaskJg',
+                params:{
+                    task_id: that.task_id
+                }
+            })
+                console.log(task_id)
         },
        // 获取抽样单列表
         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);
+            var that = this
+            const {data: res} = await this.$http.post("getCyds", {
+                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
-            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 ="执行中";
-                }
-            }
+            console.log( this.total)
+           
         },
-        
         //分页器
                 handleSizeChange(val) {
                     console.log(`每页 ${val} 条`);
@@ -187,12 +192,19 @@ export default {
                     this.getCyds()
                 },
             	// 查看抽样单详情
-			async readDialogVisible1(row) {
-				this.readForm.cyd_code = row.cyd_code
-				
-				this.readDialogVisible = true
-            }
-         
+                // async readDialogVisible1(row) {
+                // 	this.readForm.cyd_code = row.cyd_code
+                // 	this.readDialogVisible = true
+                // },
+         //查看抽样单详情
+         readSample(id){
+             this.$router.push({
+					name:'readSample',
+					params: {
+					cyd_id:id,
+					}
+				})
+         }
     }
 }
 </script>

+ 17 - 8
src/components/admin/routineMonitor.vue

@@ -102,7 +102,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="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-col>
 					<el-col style="margin-bottom: 5px;">
@@ -148,6 +148,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">
+					<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> -->
@@ -179,9 +185,12 @@
 		name: '',
 		data() {
 			return {
+				task_id:'',
 				queryInfo:{
-					cyd_id:'367',
+					task_name_like:'',
+					level:'',
 					year:'',
+					batch:'',
 					task_name:'',
 					starttime:'',
 					endtime:'',
@@ -189,8 +198,6 @@
 					pageSize:10,
 					pageNum:1,
 					task_class:'例行监测',
-					task_id:'',
-					task_profile_id:''
 				}, 
 				total:0,
 				cellStyle: {
@@ -300,6 +307,7 @@
 		},
 		created() {
 			this.getTasks()
+			this.task_id = this.$route.params.id
 		},
 		methods: {
 			//新增
@@ -311,18 +319,17 @@
 				this.$router.push({
 					name:'setTaskJg',
 					params: {
-					task_id:id,
+					id:id,
 					}
 				})
 			},
 			//查看检测机构
-			getJcds(id,profile_id) {
+			getJcds(id) {
 				console.log(id)
 				this.$router.push({
 					name:'getJcds',
 					params: {
-					task_id: id,
-					task_profile_id:profile_id
+					id: id,
 					}
 				})
 			},
@@ -433,6 +440,8 @@
 			},
 			// 查看任务详情
 			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
 				this.readForm.batch = row.batch
 				this.readForm.task_name = row.task_name
 				this.readForm.task_class = row.task_class

+ 30 - 51
src/components/admin/setTaskJg.vue

@@ -15,8 +15,8 @@
             :prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
         <!-- 操作 -->
         <el-table-column label="操作" align="center" fixed="right">
-        <template>
-            <el-button @click="read(id)" style="margin:5px 0" type="success" size="small">查看抽样单列表</el-button>
+        <template slot-scope="scope">
+            <el-button @click="read(scope.row.task_id,scope.row.id)" style="margin:5px 0" type="success" size="small">查看抽样单列表</el-button>
         </template>
         </el-table-column>
     </el-table>
@@ -43,36 +43,10 @@ export default {
             queryInfo:{
 					pageSize:10,
 					pageNum:1,
-					task_class:'例行监测',
-                    task_id: 33, //任务id
-                    sample_org_id: 18, //抽样单位id
-                    check_org_id: 272, //检测单位id
-                    sample_address:null, //抽样地址
-                    create_time:null,
-                    update_time: null,
-                    delete_time: null,
+					// task_class:'例行监测',
+                    task_id:'',
+                    // task_profile_id:''
                     },
-            sampleOrgId: {
-                    name:null, //抽样单位名称
-                    name_other: null, //抽样单位别名
-                    groupnam: null,
-                    properties: null,
-                    contact_name: null,
-                    contact_phone: null,
-                    create_time: null,
-                    update_time: null
-                    },
-            checkOrgId: {
-                    id: null, //task_profile_id
-                    name: null, //抽样单位名称
-                    name_other: null, //抽样单位别名
-                    groupname: null,
-                    properties:null,
-                    contact_name: null,
-                    contact_phone: null,
-                    create_time: null,
-                    update_time: null
-            },
             	total:0,
                 tableHeader2: [{
                             label: '抽样机构',
@@ -93,9 +67,8 @@ export default {
         this.getJgTaskProfiles()
     },
     created() {
-        this.id = this.$route.params.id
-        // this.task_id = this.$route.params.id
-        // console.log(this.task_id)
+        this.task_id = this.$route.params.id
+        console.log(this.task_id)
         this.getJgTaskProfiles()
     },
 	methods: {
@@ -105,27 +78,33 @@ export default {
         },
         // 获取抽样机构列表
         async getJgTaskProfiles() {
-            for (var key in this.queryInfo) {
-                if (this.queryInfo[key] == '') {
-                    delete this.queryInfo[key]
-                }
-            }
-            const {
-                data: res
-            } = await this.$http.post(
-                "getJgTaskProfiles", this.queryInfo
-            );
-            this.tableData = res.data.rows
-            this.total = res.data.total
-            this.task_id = res.data.rows.task_id
-            console.log(res.data.rows.task_id)
+            var that = this
+            console.log(that.id)
+            const {data: res} = await this.$http.post("getJgTaskProfiles", {
+                task_id:that.task_id,
+                task_profile_id:that.id,
+                pageNum: that.queryInfo.pageNum,
+                pageSize: that.queryInfo.pageSize
+                });
+                
+                that.tableData = res.data.rows
+                 // this.tableData = res.data.rows
+                that.total = res.data.total
+                console.log(that.task_profile_id)
+
+            
+            console.log( this.tableData)
         },
-        //查看抽样单 
-        read(id){
+        //查看抽样单列表
+        read(task_id,id){
+            // console.log(11)
+            // console.log(id)
+            // console.log(task_id)
 				this.$router.push({
 					name:'readSampleList',
 					params: {
-					task_id:id,
+					task_id:task_id,
+                    task_profile_id:id
 					}
 				})
 		},

+ 3 - 4
src/components/admin/specialMonitor.vue

@@ -310,18 +310,17 @@
 				this.$router.push({
 					name:'setTaskJg',
 					params: {
-					task_id:id,
+					id:id,
 					}
 				})
 			},
 			//查看检测机构
-			getJcds(id,profile_id) {
+			getJcds(id) {
 				console.log(id)
 				this.$router.push({
 					name:'getJcds',
 					params: {
-					task_id: id,
-					task_profile_id:profile_id
+					id: id,
 					}
 				})
 			},

+ 4 - 0
src/router/index.js

@@ -130,6 +130,10 @@ const routes = [{
 				path: '/admin/editInformation',
 				name:'editInformation',
 				component: () => import('../components/admin/editInformation')
+			},{
+				path: '/admin/readSample',
+				name:'readSample',
+				component: () => import('../components/admin/readSample')
 			},
 			
 		]