jiangyu 3 years ago
parent
commit
47be76ae63

+ 5 - 4
src/components/jc/inputSample.vue

@@ -15,7 +15,7 @@
   	<!-- <el-descriptions-item label="联系地址" :contentStyle="{'text-align': 'right'}">
 	  江苏省苏州市吴中区吴中大道 1188 号
 	</el-descriptions-item> -->
-<el-descriptions  title="安徽省农业农村厅 农产品质量安全 例行检测 抽样单" :column="2" border style="margin-top:20px" :contentStyle="{'text-align': left}">
+<el-descriptions  title="农产品质量安全抽样单" :column="2" border style="margin-top:20px" :contentStyle="{'text-align': left}">
 	<el-descriptions-item label="*样品名称" prop="cyd_data.sample_name" class="labelItem" size="mini" required >
 		<!-- <el-col :span="12"> -->
 		<el-select v-model="cyd_data.sample_name" clearable style="width:60%">
@@ -224,7 +224,7 @@
 				// 样品下拉框
 				sampleList: [],
 				task_id: '',
-				under_id: '',
+				undertake_id: '',
 				// 产地
 				options: regionData,
 				selectedOptions: []
@@ -232,7 +232,7 @@
 		},
 		created() {
 			this.task_id = this.$route.params.task_id
-			this.under_id = this.$route.params.under_id
+			this.undertake_id = this.$route.params.under_id
 			console.log(this.task_id)
 			console.log(this.under_id)
 			this.getTestObj()
@@ -243,7 +243,7 @@
 			async getTestObj() {
 				const result = await this.$http.post('getTestObj', {
 					task_id: this.task_id,
-					under_id: this.under_id
+					undertake_id: this.undertake_id
 				})
 				if (result.data.code == 0) {
 					this.sampleList = result.data.data
@@ -284,6 +284,7 @@
 				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

+ 186 - 231
src/components/jc/sampleDetail.vue

@@ -5,233 +5,169 @@
 		<!-- <div slot="header" class="clearfix"> -->
 		<el-breadcrumb separator-class="el-icon-arrow-right">
 			<el-breadcrumb-item>首页</el-breadcrumb-item>
-			<el-breadcrumb-item :to="{ path: '/jc/routineMonitorqt' }">例行检测</el-breadcrumb-item>
+			<el-breadcrumb-item :to="{ path: '/jc/routineMonitorqt' }">{{task_name}}</el-breadcrumb-item>
 			<el-breadcrumb-item :to="{ path: '/jc/setTask' }">执行任务</el-breadcrumb-item>
 			<el-breadcrumb-item>抽样</el-breadcrumb-item>
-			<el-breadcrumb-item>填报抽样单</el-breadcrumb-item>
+			<el-breadcrumb-item>抽样单详情</el-breadcrumb-item>
 		</el-breadcrumb>
-		<div class="form">
-			<el-form ref="form" :model="form" label-width="100px"
-				style="margin-top: 20px;width: 48%;background-color: aliceblue;padding: 5px;">
-				<el-row style="text-align: center; font-size: 23px; margin: 40px 0;">
-					安徽省农业农村厅 农产品质量安全 例行检测 抽样单
-				</el-row>
-				<el-row>
-					<el-col :span="12">
-						<el-form-item label="样品名称" prop="sample_name" class="labelItem" size="mini" >
-							<el-input disabled v-model="form.sample_name"></el-input>
-						</el-form-item>
-					</el-col>
-					<el-col :span="11">
-						<el-form-item label="样品编码" prop="sample_id" class="labelItem" style="" size="mini">
-							<el-input disabled v-model="form.sample_id"></el-input>
-						</el-form-item>
-					</el-col>
-				</el-row>
-				<el-row>
-					<el-col :span="12">
-						<el-form-item label="商标" prop="brand" class="labelItem" size="mini">
-							<el-input disabled v-model="form.brand"></el-input>
-						</el-form-item>
-					</el-col>
-					<el-col :span="11">
-						<el-form-item label="包装" prop="ispack" class="labelItem" style="" size="mini">
-							<el-input disabled v-model="form.ispack"></el-input>
-						</el-form-item>
-					</el-col>
-				</el-row>
-				<el-row>
-					<el-col :span="12">
-						<el-form-item label="型号规格" prop="type" class="labelItem" size="mini">
-							<el-input disabled v-model="form.type"></el-input>
-						</el-form-item>
-					</el-col>
-					<el-col :span="11">
-						<el-form-item label="执行标准" prop="standard" class="labelItem" style="" size="mini">
-							<el-input disabled v-model="form.standard"></el-input>
-						</el-form-item>
-					</el-col>
-				</el-row>
-				<el-row>
-					<el-col :span="12">
-						<el-form-item label="生产日期或批号" prop="production_date" class="labelItem" size="mini" >
-							<el-input disabled v-model="form.production_date"></el-input>
-						</el-form-item>
-					</el-col>
-					<el-col :span="11">
-						<el-form-item label="产地" prop="place" class="labelItem" style="" size="mini">
-							<el-input disabled v-model="form.place"></el-input>
-						</el-form-item>
-					</el-col>
-				</el-row>
-				<el-row>
-					<el-col :span="12">
-						<el-form-item label="产品认证情况" prop="certicfie" class="labelItem" size="mini" >
-						<el-input disabled v-model="form.certicfie"></el-input>
-						</el-form-item>
-					</el-col>
-					<el-col :span="11">
-						<el-form-item label="证书编号" prop="certifie_num" class="labelItem" style="" size="mini">
-							<el-input disabled v-model="form.certifie_num"></el-input>
-						</el-form-item>
-					</el-col>
-				</el-row>
-				<el-row>
-					<el-col :span="12">
-						<el-row>
-							<el-col :span="13">
-								<el-form-item label="抽样数量" prop="sample_renum" class="labelItem" size="mini" >
-									<el-input disabled v-model="form.sample_renum"></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="10">
-								<el-form-item label="单位" prop="sample_num_unit" class="labelItem" size="mini" 
-									label-width="60px">
-									<el-input disabled v-model="form.sample_num_unit"></el-input>
-								</el-form-item>
-							</el-col>
-						</el-row>
-					</el-col>
-					<el-col :span="11">
-						<el-row>
-							<el-col :span="13">
-								<el-form-item label="抽样基数" prop="sample_base" class="labelItem" size="mini" >
-									<el-input disabled v-model="form.sample_base"></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="10">
-								<el-form-item label="单位" prop="sample_base_unit" class="labelItem" size="mini" 
-									label-width="60px" clearable>
-									<el-input disabled v-model="form.sample_base_unit"></el-input>
-								</el-form-item>
-							</el-col>
-						</el-row>
-					</el-col>
-				</el-row>
-				<el-row>
-					<el-col>
-						<el-form-item label="抽样场所" prop="sample_ground" class="labelItem" size="mini" >
-							<el-input disabled v-model="form.sample_ground"></el-input>
-						</el-form-item>
-					</el-col>
-				</el-row>
-				<el-row>
-					<el-col :span="7"
-						style="text-align: center;vertical-align: middle;line-height: 250px;font-size: 14px;">
-						<div class="">
-							受检单位情况
-						</div>
-					</el-col>
-					<el-col :span="15">
-						<el-form-item label="单位名称" prop="units_name" class="labelItem" style="" size="mini" >
-							<el-input disabled v-model="form.units_name"></el-input>
-						</el-form-item>
-						<el-form-item label="通讯地址" prop="address" class="labelItem" style="" size="mini" >
-							<el-input disabled v-model="form.address"></el-input>
-						</el-form-item>
-						<el-form-item label="法定代表人" prop="corporation" class="labelItem" style="" size="mini" >
-							<el-input disabled v-model="form.corporation"></el-input>
-						</el-form-item>
-						<el-form-item label="受检人" prop="user_name" class="labelItem" style="" size="mini" >
-							<el-input disabled v-model="form.user_name"></el-input>
-						</el-form-item>
-						<el-form-item label="电话" prop="phone" class="labelItem" style="" size="mini">
-							<el-input disabled v-model="form.phone"></el-input>
-						</el-form-item>
-						<el-form-item label="传真" prop="fax" class="labelItem" style="" size="mini">
-							<el-input disabled v-model="form.fax"></el-input>
-						</el-form-item>
-					</el-col>
-				</el-row>
-			</el-form>
-			<el-form ref="form" :model="form" label-width="110px"
-				style="margin-top: 20px;width: 48%;background-color: aliceblue;padding:10px 1px 1px 10px;">
-				<el-row>
-					<el-col :span="7"
-						style="text-align: center;vertical-align: middle;line-height: 250px;font-size: 14px;">
-						<div class="">
-							生产单位情况
-						</div>
-					</el-col>
-					<el-col :span="15">
-						<el-form-item label="生产类型" prop="production_class" class="labelItem" style="" size="mini" >
-							<el-input disabled v-model="form.production_class"></el-input>
-						</el-form-item>
-						<el-form-item label="单位名称" prop="production_name" class="labelItem" style="" size="mini"
-							>
-							<el-input disabled v-model="form.production_name"></el-input>
-						</el-form-item>
-						<el-form-item label="通讯地址" prop="p_address" class="labelItem" style="" size="mini" >
-							<el-input disabled v-model="form.p_address"></el-input>
-						</el-form-item>
-						<el-form-item label="邮编" prop="postcode" class="labelItem" style="" size="mini">
-							<el-input disabled v-model="form.postcode"></el-input>
-						</el-form-item>
-						<el-form-item label="联系人" prop="user_name" class="labelItem" style="" size="mini" >
-							<el-input disabled v-model="form.user_name"></el-input>
-						</el-form-item>
-						<el-form-item label="电话" prop="phone" class="labelItem" style="" size="mini">
-							<el-input disabled v-model="form.phone"></el-input>
-						</el-form-item>
-						<el-form-item label="传真" prop="fax" class="labelItem" style="" size="mini">
-							<el-input disabled v-model="form.fax"></el-input>
-						</el-form-item>
-					</el-col>
-				</el-row>
-				<el-row>
-					<el-col :span="7"
-						style="text-align: center;vertical-align: middle;line-height: 250px;font-size: 14px;">
-						<div class="">
-							抽样单位情况
-						</div>
-					</el-col>
-					<el-col :span="15">
-						<el-form-item label="单位名称" prop="sample_unit_name" class="labelItem" style="" size="mini"
-							>
-							<el-input disabled v-model="form.sample_unit_name"></el-input>
-						</el-form-item>
-						<el-form-item label="联系人" prop="sample_unit_user" class="labelItem" style="" size="mini"
-							>
-							<el-input disabled v-model="form.sample_unit_user"></el-input>
-						</el-form-item>
-						<el-form-item label="通讯地址" prop="sample_unit_address" class="labelItem" style="" size="mini"
-							>
-							<el-input disabled v-model="form.sample_unit_address"></el-input>
-						</el-form-item>
-						<el-form-item label="邮编" prop="sample_unit_postcode" class="labelItem" style="" size="mini">
-							<el-input disabled v-model="form.sample_unit_postcode"></el-input>
-						</el-form-item>
-						<el-form-item label="联系电话" prop="sample_unit_phone" class="labelItem" style="" size="mini">
-							<el-input disabled v-model="form.sample_unit_phone"></el-input>
-						</el-form-item>
-						<el-form-item label="传真" prop="sample_unit_fax" class="labelItem" style="" size="mini">
-							<el-input disabled v-model="form.sample_unit_fax"></el-input>
-						</el-form-item>
-						<el-form-item label="Email" prop="sample_unit_email" class="labelItem" style="" size="mini">
-							<el-input disabled v-model="form.sample_unit_email"></el-input>
-						</el-form-item>
-					</el-col>
-				</el-row>
-				<el-row>
-					<el-form-item label="检测任务依据" prop="base" class="labelItem" style="" size="mini" >
-						<el-input disabled v-model="form.base"></el-input>
-					</el-form-item>
-				</el-row>
-				<el-row>
-					<el-form-item label="抽样时间" prop="sample_date" class="labelItem" style="" size="mini" >
-					<el-input disabled v-model="form.sample_date"></el-input>
-					</el-form-item>
-				</el-row>
-				<el-row>
-					<el-form-item label="被抽检单位签字盖章附件" prop="filr_url" class="labelItem" style="" size="mini">
-					<el-link type="primary" :href="form.file_url">{{form.file_name}}</el-link>	
-					</el-form-item>
-				</el-row>
-				<el-form-item>
-					<el-button type="primary" @click="back">返回抽样列表</el-button>
-				</el-form-item>
-			</el-form>
-		</div>
+		<el-descriptions  title="农产品质量安全抽样单详情" :column="2" border style="margin-top:20px;" :contentStyle="{'text-align': left}">
+	<el-descriptions-item label="*样品名称" prop="form.sample_name" class="labelItem" size="mini">
+		<el-input v-model="form.sample_name" disabled></el-input>
+		<!-- </el-col> -->
+	</el-descriptions-item>
+	<el-descriptions-item label="样品编码" prop="form.sample_id" class="labelItem" style="" size="mini">
+		<el-input v-model="form.sample_id" disabled></el-input>
+	</el-descriptions-item>
+	<el-descriptions-item label="商标" prop="form.brand" class="labelItem" size="mini">
+		<el-input v-model="form.brand" disabled></el-input>
+	</el-descriptions-item>
+	<el-descriptions-item label="包装" prop="form.ispack" class="labelItem" style="" size="mini">
+		<el-radio v-model="form.ispack" label="有" disabled>有</el-radio>
+		<el-radio v-model="form.ispack" label="无" disabled>无</el-radio>
+	</el-descriptions-item>
+	<el-descriptions-item label="型号规格" prop="form.type" class="labelItem" size="mini">
+		<el-input v-model="form.type" disabled></el-input>
+	</el-descriptions-item>
+	<el-descriptions-item label="执行标准" prop="form.standard" class="labelItem" style="" size="mini">
+		<el-input v-model="form.standard" disabled></el-input>
+	</el-descriptions-item>
+	<el-descriptions-item label="*生产日期或批号" prop="form.production_date" class="labelItem" size="mini">
+		<el-input v-model="form.production_date" disabled></el-input>
+	</el-descriptions-item>
+	<el-descriptions-item label="产地" prop="form.place" class="labelItem" style="" size="mini">
+		<!-- <el-cascader  :options="options" v-model="selectedOptions" @change="handleChange" style="width:60%"></el-cascader> -->
+		<el-input v-model="form.place" disabled></el-input>
+
+	</el-descriptions-item>
+	<el-descriptions-item label="*产品认证情况" prop="form.certicfie" class="labelItem" size="mini">
+		<el-radio v-model="form.certicfie" label="无公害农产品" disabled>无公害农产品</el-radio>
+		<el-radio v-model="form.certicfie" label="绿色食品" disabled>绿色食品</el-radio>
+		<el-radio v-model="form.certicfie" label="有机食品" disabled>有机食品</el-radio>
+		<el-radio v-model="form.certicfie" label="其他" disabled>其他</el-radio>
+	</el-descriptions-item>
+	<el-descriptions-item label="证书编号" prop="form.certifie_num" class="labelItem" style="" size="mini">
+		<el-input v-model="form.certifie_num" disabled></el-input>
+	</el-descriptions-item>
+	<el-descriptions-item label="*抽样数量" prop="form.sample_num" class="labelItem" size="mini" required>
+		<el-input v-model="form.sample_num" style="width:180px" disabled></el-input>
+		<a> * 单位 </a><el-input v-model="form.sample_num_unit" clearable="true" style="width:180px" disabled></el-input>
+	</el-descriptions-item>
+	<el-descriptions-item label="抽样基数" prop="form.sample_base" class="labelItem" size="mini" required>
+		<el-input v-model="form.sample_base" style="width:180px" disabled></el-input>
+		<a> * 单位 </a><el-input v-model="form.sample_base_unit" clearable="true" style="width:180px" disabled></el-input>
+	</el-descriptions-item>
+	<el-descriptions-item label="*抽样场所" prop="form.sample_ground" class="labelItem" size="mini" required >
+							<el-radio v-model="form.sample_ground" label="生产基地/企业" disabled>生产基地/企业</el-radio>
+							<el-radio v-model="form.sample_ground" label="屠宰场" disabled>屠宰场</el-radio>
+							<el-radio v-model="form.sample_ground" label="农贸市场" disabled>农贸市场</el-radio>
+							<el-radio v-model="form.ample_ground" label="批发市场" disabled>批发市场</el-radio>
+							<el-radio v-model="form.sample_ground" label="超市" disabled>超市</el-radio>
+							<el-radio v-model="form.sample_ground" label="其他" disabled>其他</el-radio>
+	</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="unit_test.unit_name" class="labelItem" size="mini" required>
+									<el-input v-model="unit_test.unit_name" disabled></el-input>
+				</el-descriptions-item>
+				<el-descriptions-item label="*通讯地址" prop="unit_test.address" class="labelItem" size="mini" required>
+									<el-input v-model="unit_test.address" disabled></el-input>
+				</el-descriptions-item>
+				<el-descriptions-item label="*法定代表人" prop="unit_test.represent_name" class="labelItem" size="mini" required>
+									<el-input v-model="unit_test.represent_name" disabled></el-input>
+				</el-descriptions-item>
+				<el-descriptions-item label="*受检人" prop="unit_test.user_name" class="labelItem" size="mini" required>
+									<el-input v-model="unit_test.user_name" disabled></el-input>
+				</el-descriptions-item>
+				<el-descriptions-item label="电话" prop="unit_test.phone" class="labelItem" size="mini">
+									<el-input v-model="unit_test.phone" disabled></el-input>
+				</el-descriptions-item>
+				<el-descriptions-item label="传真" prop="unit_test.fax" class="labelItem" size="mini">
+							<el-input v-model="unit_test.fax" disabled></el-input>
+				</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="unit_production.production_name" class="labelItem" style="" size="mini" required>
+				<el-input v-model="unit_production.production_name" disabled></el-input>
+			</el-descriptions-item>
+			<el-descriptions-item label="*通讯地址" prop="unit_production.address" class="labelItem" style="" size="mini" required>
+				<el-input v-model="unit_production.address" disabled></el-input>
+			</el-descriptions-item>
+			<el-descriptions-item label="邮编" prop="unit_production.postcode" class="labelItem" style="" size="mini">
+				<el-input v-model="unit_production.postcode" disabled></el-input>
+			</el-descriptions-item>
+			<el-descriptions-item label="*联系人" prop="unit_production.user_name" class="labelItem" style="" size="mini" required>
+				<el-input v-model="unit_production.user_name" disabled></el-input>
+			</el-descriptions-item>
+			<el-descriptions-item label="电话" prop="unit_production.phone" class="labelItem" style="" size="mini">
+				<el-input v-model="unit_production.phone" disabled></el-input>
+			</el-descriptions-item>
+			<el-descriptions-item label="传真" prop="unit_production.fax" class="labelItem" style="" size="mini">
+				<el-input v-model="unit_production.fax" disabled></el-input>
+			</el-descriptions-item>
+			<el-descriptions-item label="生产方式" prop="unit_production.production_class" class="labelItem" style=""  required>
+				<el-radio v-model="unit_production.production_class" label="自产" disabled>自产</el-radio>
+				<el-radio v-model="unit_production.production_class" label="收购" disabled>收购</el-radio>
+			</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="unit_sample.unit_name" class="labelItem" style="" size="mini" required>
+									<el-input v-model="unit_sample.unit_name" disabled></el-input>
+			</el-descriptions-item>
+			<el-descriptions-item label="*联系人" prop="unit_sample.unit_user" class="labelItem" style="" size="mini" required>
+									<el-input v-model="unit_sample.unit_user" disabled></el-input>
+			</el-descriptions-item>
+			<el-descriptions-item label="*通讯地址" prop="unit_sample.address" class="labelItem" style="" size="mini" required>
+									<el-input v-model="unit_sample.address" disabled></el-input>
+			</el-descriptions-item>
+			<el-descriptions-item label="邮编" prop="unit_sample.postcode" class="labelItem" style="" size="mini">
+									<el-input v-model="unit_sample.postcode" disabled></el-input>
+			</el-descriptions-item>
+			<el-descriptions-item label="联系电话" prop="unit_sample.phone" class="labelItem" style="" size="mini">
+									<el-input v-model="unit_sample.phone" disabled></el-input>
+			</el-descriptions-item>
+			<el-descriptions-item label="传真" prop="unit_sample.fax" class="labelItem" style="" size="mini">
+									<el-input v-model="unit_sample.fax" disabled></el-input>
+			</el-descriptions-item>
+			<el-descriptions-item label="Email" prop="unit_sample.email" class="labelItem" style="" size="mini">
+									<el-input v-model="unit_sample.email" disabled></el-input>
+			</el-descriptions-item>
+			</el-descriptions>
+			</el-descriptions-item>
+		</el-descriptions>
+
+		<el-descriptions  :column="2" border>
+			<el-descriptions-item label="检测任务依据" prop="form.base" class="labelItem" style="" size="mini" required>
+								<el-input v-model="form.base" disabled></el-input>
+			</el-descriptions-item>
+			<el-descriptions-item  label="抽样时间" prop="form.sample_date" class="labelItem" style="" size="mini" required>
+								<el-date-picker v-model="form.sample_date" type="date" value-format="yyyy-MM-dd" disabled>
+								</el-date-picker>
+			</el-descriptions-item>
+			<el-descriptions-item  label="被抽检单位签字盖章附件" prop="form.file_name" class="labelItem" style="" size="mini">
+									<el-input v-model="form.file_name" disabled></el-input>
+
+								<!-- <el-upload class="upload-demo" :file-list="fileList" drag :headers="myHeaders"
+									action="http://new.syjc.com/api/v1/ossUpload" :on-success="uploadSuccess" :limit="1">
+									<i class="el-icon-upload"></i>
+									<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+								</el-upload> -->
+			</el-descriptions-item>
+		</el-descriptions>
 		<!-- </el-card> -->
 	</div>
 </template>
@@ -244,21 +180,30 @@
 		data() {
 			return {
 				form: {},
+				cyd_data: {},//抽样单信息上部分
+				unit_test: {},//受检单位信息
+				unit_production: {},//生产单位信息
+				unit_sample: {},//抽样单位信息
 			}
 		},
 		created() {
 			this.id = this.$route.params.id
+			console.log(this.id)
 			this.getSampleDetail()
 		},
 		methods: {
 			// 获取样本详情
 			async getSampleDetail() {
+				// let that = this
 				const result = await this.$http.post('getSampleDetail', {
 					sample_id: this.id
 				})
-				if (result.data.code == 0) {
-					this.form = result.data.data
-				}
+				console.log(result.data)
+					this.form = result.data[0]
+					this.unit_test = this.form.unitTest
+					this.unit_production = this.form.unitProduction
+					this.unit_sample = this.form.unitSample
+					console.log(this.form)
 			},
 			// 返回
 			back() {
@@ -275,10 +220,20 @@
 </script>
 
 <style lang="less" scoped>
-	.form {
-		display: flex;
-		flex-direction: row;
-		justify-content: space-between;
+	// .form {
+	// 	display: flex;
+	// 	flex-direction: row;
+	// 	justify-content: space-between;
+	// }
+		.el-descriptions {
+		width: 80%;
+		margin: auto;
+	}
+
+	/deep/ .el-descriptions__title {
+		margin: auto;
+		font-size: 1.25rem;
+		// font-weight: 31.25rem !important;
 	}
 
 	/* 	.el-form {

+ 1166 - 0
src/components/jc/sampleDetailcd copy.vue

@@ -0,0 +1,1166 @@
+<template>
+	<div>
+
+		<el-breadcrumb separator-class="el-icon-arrow-right">
+			<el-breadcrumb-item>首页</el-breadcrumb-item>
+			<el-breadcrumb-item>承担单位</el-breadcrumb-item>
+			<el-breadcrumb-item :to="{ path: '/jc/routineMonitor' }">任务列表</el-breadcrumb-item>
+			<el-breadcrumb-item>基本信息</el-breadcrumb-item>
+		</el-breadcrumb>
+
+		<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
+			<el-tab-pane label="任务详情" name="first">
+				<el-descriptions class="margin-top" title="例行监测任务" :column="2" :size="size" border>
+					<el-descriptions-item>
+						<template slot="label" prop="releaser">
+							发布单位
+						</template>
+						{{readForm.releaserInfo.rymc}}
+					</el-descriptions-item>
+					<el-descriptions-item>
+						<template slot="label">
+							年度
+						</template>
+						{{readForm.taskInfo.year}}
+					</el-descriptions-item>
+					<el-descriptions-item>
+						<template slot="label">
+							开始时间和结束时间
+						</template>
+						{{readForm.taskInfo.starttime}}-{{readForm.taskInfo.endtime}}
+					</el-descriptions-item>
+					<el-descriptions-item>
+						<template slot="label">
+							抽样信息上报截止时间
+						</template>
+						{{readForm.taskInfo.endtime_cydsb}}
+					</el-descriptions-item>
+					<el-descriptions-item>
+						<template slot="label">
+							监测类型
+						</template>
+						{{readForm.taskInfo.task_class}}
+					</el-descriptions-item>
+					<el-descriptions-item>
+						<template slot="label">
+							行业
+						</template>
+						<!-- <div v-if="readForm.product!=[]"> -->
+						<span>{{readForm.model_type}}</span>
+						<!-- </div> -->
+						<!-- <div v-else>暂无</div> -->
+					</el-descriptions-item>
+					<el-descriptions-item>
+						<template slot="label">
+							抽检分离
+						</template>
+						<span v-if="readForm.taskInfo.is_divide==1">是</span>
+						<span v-if="readForm.taskInfo.is_divide==0">否</span>
+					</el-descriptions-item>
+					<el-descriptions-item>
+						<template slot="label">
+							附件
+						</template>
+						<div v-if="readForm.file_url==null">无</div>
+						<el-link v-else type="primary" :href="readForm.taskInfo.file_url">下载附件</el-link>
+					</el-descriptions-item>
+
+				</el-descriptions>
+				<el-descriptions class="margin-top" :size="size" border>
+					<el-descriptions-item>
+						<template slot="label">
+							备注
+						</template>
+						{{readForm.taskInfo.log}}
+					</el-descriptions-item>
+				</el-descriptions>
+				<el-descriptions class="margin-top" :size="size" border>
+					<el-descriptions-item>
+
+						<template slot="label">
+							检测对象
+						</template>
+						{{productNameText}}
+						<!-- <span v-for="item in readForm.product">{{item.product_name}}、</span> -->
+					</el-descriptions-item>
+				</el-descriptions>
+				<el-descriptions class="margin-top" :size="size" border>
+					<el-descriptions-item>
+						<template slot="label">
+							检测项
+						</template>
+						{{pesticidesNameText}}
+						<!-- <span v-for="item in readForm.pesticides">{{item.test_name}}、</span> -->
+					</el-descriptions-item>
+				</el-descriptions>
+				<!-- <el-table :data="underTask" border stripe highlight-current-row  @current-change="handlecyCurrentChange" style="width: 100%"
+					:row-style="rowStyle" :cell-style="cellStyle">
+					<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> -->
+				<!-- <div class="footer">
+					<el-button type="success" size="mini" @click="input()">填报抽样单</el-button>
+					<el-button type="success" size="mini" @click="next">导出总览</el-button>
+					<el-button type="success" size="mini" @click="back">返回</el-button>
+				</div> -->
+			</el-tab-pane>
+
+			<el-tab-pane label="抽样" name="second">
+			<!-- <el-tab-pane v-if="sampleShow==true" label="抽样" name="second"> -->
+
+				<!-- 头部搜索栏 -->
+				
+					<el-form style="display: flex; flex-direction: column;" ref="form2" :model="queryInfo">
+						<el-row style="width: 75%;">
+							<el-col :span="6">
+						<el-form-item label="样品名称" class="select" size="small" prop="sample_name">
+							<el-input v-model="queryInfo.sample_name"></el-input>
+						</el-form-item>
+							</el-col>
+							<el-col :span="6">
+						<el-form-item label="样品编码" class="select" size="small" prop="sample_id">
+							<el-input v-model="queryInfo.sample_id"></el-input>
+						</el-form-item>
+							</el-col>
+							<el-col :span="6">
+						<el-form-item label="受检单位" class="select" size="small" prop="units_name">
+							<el-input v-model="queryInfo.unit_test_name"></el-input>
+						</el-form-item>
+						</el-col>
+						</el-row>
+						<el-row style="width: 75%;">
+							<el-col :span="6">
+						<el-form-item label="抽样单位" class="select" size="small" prop="sample_unit_name">
+							<el-input v-model="queryInfo.unit_sample_name"></el-input>
+						</el-form-item>
+						    </el-col>
+							<el-col :span="6">
+						<el-form-item label="抽样日期" class="select" size="small" prop="sample_data">
+							<el-input v-model="queryInfo.sample_data"></el-input>
+						</el-form-item>
+						</el-col>
+						<el-col :span="6">
+						<!-- <el-form-item label="抽样场所" class="select" size="small" prop="sample_ground">
+							<el-input v-model="queryInfo.sample_ground"></el-input>
+						</el-form-item> -->
+						</el-col>
+						<el-col :span="4">
+							<el-button style="height: 32px;margin-left: 10px;" size="mini" type="success"
+							@click="searchData()">查询
+						</el-button>
+						<!-- 重置 -->
+						<el-button style="height: 32px;margin-left: 5px;" size="mini" type="success" @click="resetForm('form2')">
+							重置
+						</el-button>
+						</el-col>
+						</el-row>
+					</el-form>
+				<el-row style="margin-right: 0px;">
+					<el-form style="display: flex; flex-direction: row;">
+						<!-- 	<el-form-item label="产地" class="select">
+							<el-select v-model="value" placeholder="请选择省份" size="small">
+								<el-option v-for="item in options" :key="item.value" :label="item.label"
+									:value="item.value">
+								</el-option>
+							</el-select>
+							<el-select v-model="value" placeholder="请选择城市" size="small">
+								<el-option v-for="item in options" :key="item.value" :label="item.label"
+									:value="item.value">
+								</el-option>
+							</el-select>
+							<el-select v-model="value" placeholder="请选择区/县" size="small">
+								<el-option v-for="item in options" :key="item.value" :label="item.label"
+									:value="item.value">
+								</el-option>
+							</el-select>
+						</el-form-item> -->
+						<!-- 查询 -->
+
+					</el-form>
+				<el-table :data="underTask" border stripe highlight-current-row  @current-change="handlecyCurrentChange" style="width: 100%"
+					:row-style="rowStyle" :cell-style="cellStyle">
+					<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 type="success" size="small" plain @click="input(scope.row.id)">填报抽样单
+						</el-button>
+						<!-- <el-button type="success" size="small" plain @click="sampleDetail(scope.row.sample_id)">查看 -->
+						<el-button type="success" size="small" @click="getSampleList(scope.row.id)">查看抽样单列表
+						</el-button>
+							<!-- <el-button type="success" size="small" plain @click="sampleDetail(scope.row.sample_id)" @focus="getSampleListDialog = true">查看抽样单列表
+						</el-button> -->
+						<el-button type="primary" size="small" plain icon="el-icon-edit-outline" @click="appear">上报抽样信息
+						</el-button>
+					</template>
+					</el-table-column>
+				</el-table>
+
+				<!-- 抽样单列表对话框 -->
+			<el-dialog title="抽样单列表" :visible.sync="getSampleListDialog" width="80%" :close-on-click-modal="false" class="dialogItem">
+				<el-form v-if="getSampleListDialog">
+					<!--  表格数据区域-->
+					<el-table ref="multipleTable" :data="tableData" border stripe highlight-current-row
+						@selection-change="handleSelectionChange" style="width: 100%" :row-style="rowStyle"
+						:cell-style="cellStyle">
+						<el-table-column type="selection" 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.label" v-for="table in tableHeader" :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 type="success" size="small" plain @click="sampleDetail(scope.row.sample_id)">查看
+								</el-button>
+							</template>
+						</el-table-column>
+					</el-table>
+					<!--    分页器区域-->
+					<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+					:current-page="queryInfo.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo.pageSize"
+					layout="total, sizes, prev, pager, next, jumper" :total="total" background />
+				</el-form>
+			</el-dialog>
+		</el-row>	
+		</el-tab-pane>
+
+			<el-tab-pane label="检测" name="third">
+			<!-- <el-tab-pane  v-if="checkShow==true"  label="检测" name="third"> -->
+			<el-table :data="unitTask" border stripe highlight-current-row  @current-change="handlecyCurrentChange" style="width: 100%"
+					:row-style="rowStyle" :cell-style="cellStyle">
+				<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 type="success" size="small" plain @click="input(scope.row.id)">填报抽样单
+					</el-button> -->
+					<!-- <el-button type="success" size="small" plain @click="sampleDetail(scope.row.sample_id)">查看 -->
+					<el-button type="success" size="small" @click="getTestList(scope.row.id)">查看检测单列表
+					</el-button>
+						<!-- <el-button type="success" size="small" plain @click="sampleDetail(scope.row.sample_id)" @focus="getSampleListDialog = true">查看抽样单列表
+					</el-button> -->
+					<el-button type="primary" size="small" plain icon="el-icon-edit-outline" @click="appearTest">上报检测信息
+					</el-button>
+				</template>
+				</el-table-column>
+			</el-table>
+			<!-- 查看检测单列表弹框 -->
+			<el-dialog title="检测单列表" :visible.sync="checkTestList" width="70%" :close-on-click-modal="false"
+				class="dialogItem">
+				<!--  表格数据区域-->
+				<el-table :data="tableData1" border stripe highlight-current-row style="width: 100%"
+					:row-style="rowStyle" :cell-style="cellStyle">
+					<!-- <el-table-column type="selection" 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.label" v-for="table in checkHeader" :label="table.label"
+						:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
+					<el-table-column label="操作" align="center" fixed="right" width="220px">
+						<template slot-scope="scope">
+							<el-button type="success" size="mini" v-if="scope.row.jc_value_id==null" plain
+								@click="check(scope.row.sample_id,scope.row.sample_name)">检测</el-button>
+							<el-button type="primary" v-else size="mini" plain @click="update(scope.row)">修改</el-button>
+							<el-button type="primary" size="mini" plain @click="upcheck(scope.row.sample_id)">上报
+							</el-button>
+							<el-button type="primary" size="mini" plain @click="creatpdf(scope.row.sample_id)">生成检测报告
+							</el-button>
+						</template>
+					</el-table-column>
+				</el-table>
+
+				<!--    分页器区域-->
+				<el-pagination @size-change="handleSizeChange1" @current-change="handleCurrentChange1"
+					:current-page="underInfo.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="underInfo.pageSize"
+					layout="total, sizes, prev, pager, next, jumper" :total="testListTotal" background />
+			</el-dialog>
+			</el-tab-pane>
+			
+
+			<el-dialog title="填写检测单" :visible.sync="inputCheckShow" width="70%" :close-on-click-modal="false"
+				class="dialogItem">
+				<span class="demonstration">样品编码:{{check_id}}</span>
+				<span class="demonstration">样品名称:{{check_name}}</span>
+				<el-button type="success" size="small" plain @click="onSubmit">保存</el-button>
+				<span class="demonstration">注意:“不得检出”只能填为“ND”</span>
+				<!--  表格数据区域-->
+				<el-table :data="testPesticides" border stripe highlight-current-row style="width: 100%"
+					:row-style="rowStyle" :cell-style="cellStyle">
+					<el-table-column :key="table.label" v-for="table in checkHeader2" :label="table.label"
+						:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
+					<el-table-column label="检测值">
+						<template slot-scope="scope">
+							<el-input v-model="scope.row.test_value" size="small" />
+						</template>
+					</el-table-column>
+					<el-table-column label="限量值">
+						<template slot-scope="scope">
+							<el-input v-model="scope.row.state_value" size="small" />
+						</template>
+					</el-table-column>
+					<el-table-column label="单位">
+						<template slot-scope="scope">
+							<span v-model="scope.row.unit" size="small">mg/kg</span>
+						</template>
+					</el-table-column>
+					<el-table-column label="抽检结果">
+						<template slot-scope="scope">
+							<span v-if="parseFloat(scope.row.test_value)<=parseFloat(scope.row.state_value)&&scope.row.state_value!='ND'"
+								size="small">合格</span>
+							<span v-else-if="parseFloat(scope.row.test_value)>parseFloat(scope.row.state_value)" size="small">不合格</span>
+							<span v-else-if="scope.row.test_value=='ND'&&scope.row.state_value=='ND'"
+								size="small">合格</span>
+							<span v-else-if="scope.row.test_value!='ND'&&scope.row.state_value=='ND'"
+								size="small">不合格</span>
+						</template>
+					</el-table-column>
+					<el-table-column label="LOD">
+						<template slot-scope="scope">
+							<el-input v-model="scope.row.LOD" size="small" />
+						</template>
+					</el-table-column>
+					<el-table-column label="LOQ">
+						<template slot-scope="scope">
+							<el-input v-model="scope.row.LOQ" />
+						</template>
+					</el-table-column>
+
+				</el-table>
+			</el-dialog>
+			<!-- ///////////////////////////////////////////检测报告生成-------难、、、、、、、、、、、、、、、、、、、、、、 -->
+			<el-dialog title="生成监测报告" :visible.sync="dialogVisible2" width="50%">
+				<div id="pdf">
+					<el-form ref="formjc" :model="formjc" label-width="100px"
+						style="margin-top: 20px;width: 100%;background-color: aliceblue;padding: 5px;">
+						<el-row style="text-align: center; font-size: 23px; margin: 40px 0;">
+							安徽省农业农村厅农产品质量安全例行监测检测报告
+						</el-row>
+						<el-row>
+							<el-col :span="12">
+								<el-form-item label="样品名称" prop="sample_name" class="labelItem" size="mini">
+									<el-input disabled v-model="formjc.sample_name"></el-input>
+								</el-form-item>
+							</el-col>
+							<el-col :span="11">
+								<el-form-item label="样品编码" prop="sample_id" class="labelItem" style="" size="mini">
+									<el-input disabled v-model="formjc.sample_id"></el-input>
+								</el-form-item>
+							</el-col>
+						</el-row>
+						<el-row>
+							<el-col :span="12">
+								<el-form-item label="型号规格" prop="type" class="labelItem" size="mini">
+									<el-input disabled v-model="formjc.type"></el-input>
+								</el-form-item>
+							</el-col>
+							<el-col :span="11">
+								<el-form-item label="执行标准" prop="standard" class="labelItem" style="" size="mini">
+									<el-input disabled v-model="formjc.standard"></el-input>
+								</el-form-item>
+							</el-col>
+						</el-row>
+						<el-row>
+							<el-col :span="12">
+								<el-form-item label="生产日期或批号" prop="production_date" class="labelItem" size="mini">
+									<el-input disabled v-model="formjc.production_date"></el-input>
+								</el-form-item>
+							</el-col>
+							<el-col :span="11">
+								<el-form-item label="产地" prop="place" class="labelItem" style="" size="mini">
+									<el-input disabled v-model="formjc.place"></el-input>
+								</el-form-item>
+							</el-col>
+						</el-row>
+						<el-row>
+							<el-col :span="12">
+								<el-form-item label="产品认证情况" prop="certicfie" class="labelItem" size="mini">
+									<el-input disabled v-model="formjc.certicfie"></el-input>
+								</el-form-item>
+							</el-col>
+							<el-col :span="11">
+								<el-form-item label="证书编号" prop="certifie_num" class="labelItem" style="" size="mini">
+									<el-input disabled v-model="formjc.certifie_num"></el-input>
+								</el-form-item>
+							</el-col>
+						</el-row>
+						<el-row>
+							<el-col :span="12">
+								<el-row>
+									<el-col :span="13">
+										<el-form-item label="抽样数量" prop="sample_renum" class="labelItem" size="mini">
+											<el-input disabled v-model="formjc.sample_renum"></el-input>
+										</el-form-item>
+									</el-col>
+									<el-col :span="10">
+										<el-form-item label="单位" prop="sample_num_unit" class="labelItem" size="mini"
+											label-width="60px">
+											<el-input disabled v-model="formjc.sample_num_unit"></el-input>
+										</el-form-item>
+									</el-col>
+								</el-row>
+							</el-col>
+							<el-col :span="11">
+								<el-row>
+									<el-col :span="13">
+										<el-form-item label="抽样基数" prop="sample_base" class="labelItem" size="mini">
+											<el-input disabled v-model="formjc.sample_base"></el-input>
+										</el-form-item>
+									</el-col>
+									<el-col :span="10">
+										<el-form-item label="单位" prop="sample_base_unit" class="labelItem" size="mini"
+											label-width="60px" clearable>
+											<el-input disabled v-model="formjc.sample_base_unit"></el-input>
+										</el-form-item>
+									</el-col>
+								</el-row>
+							</el-col>
+						</el-row>
+						<el-row>
+							<el-col>
+								<el-form-item label="抽样场所" prop="sample_ground" class="labelItem" size="mini">
+									<el-input disabled v-model="formjc.sample_ground"></el-input>
+								</el-form-item>
+							</el-col>
+						</el-row>
+						<el-row>
+							<el-col :span="7"
+								style="text-align: center;vertical-align: middle;line-height: 250px;font-size: 14px;">
+								<div class="">
+									受检单位情况
+								</div>
+							</el-col>
+							<el-col :span="15">
+								<el-form-item label="单位名称" prop="units_name" class="labelItem" style="" size="mini">
+									<el-input disabled v-model="formjc.units_name"></el-input>
+								</el-form-item>
+								<el-form-item label="通讯地址" prop="address" class="labelItem" style="" size="mini">
+									<el-input disabled v-model="formjc.address"></el-input>
+								</el-form-item>
+								<el-form-item label="法定代表人" prop="corporation" class="labelItem" style="" size="mini">
+									<el-input disabled v-model="formjc.corporation"></el-input>
+								</el-form-item>
+								<el-form-item label="受检人" prop="user_name" class="labelItem" style="" size="mini">
+									<el-input disabled v-model="formjc.user_name"></el-input>
+								</el-form-item>
+								<el-form-item label="电话" prop="phone" class="labelItem" style="" size="mini">
+									<el-input disabled v-model="formjc.phone"></el-input>
+								</el-form-item>
+								<el-form-item label="传真" prop="fax" class="labelItem" style="" size="mini">
+									<el-input disabled v-model="formjc.fax"></el-input>
+								</el-form-item>
+							</el-col>
+						</el-row>
+					</el-form>
+					<el-table :data="resultjc" border stripe highlight-current-row style="width: 100%"
+						:row-style="rowStyle" :cell-style="cellStyle">
+						<el-table-column :key="table.label" v-for="table in jcheader" :label="table.label"
+							:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
+					</el-table>
+				</div>
+				<div  style="margin-top: 10px; text-align: center">
+				<el-button @click="dialogVisible2 = false">取 消</el-button>
+				<el-button type="primary" @click="download">生成检测报告pdf</el-button>
+				</div>
+				<!-- </span> -->
+			</el-dialog>
+
+			<el-tab-pane label="报告上传" name="five">
+				<el-upload class="upload-demo" :file-list="fileList" drag :headers="myHeaders"
+					action="http://syjcapi.aielab.net/api/v1/ossUpload" :on-success="uploadSuccess" :limit="1">
+					<i class="el-icon-upload"></i>
+					<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+				</el-upload>
+			</el-tab-pane>
+		</el-tabs>
+
+	</div>
+</template>
+
+<script>
+	import htmlToPdf from '../../assets/js/htmlToPdf.js'
+	import inputCheck from './inputCheck'
+	const token = window.sessionStorage.getItem('token')
+	const name = window.sessionStorage.getItem('name')
+	export default {
+		name: 'setTask',
+		data() {
+			return {
+				size: 'medium',
+				myHeaders: {
+					Authorization: 'bearer' + token
+				},
+				formjc: {},
+				dialogVisible2: false,
+				getSampleListDialog: false,
+				checkTestList: false,
+				activeName: 'first',
+				id: 0,
+				productNameText: '',
+				pesticidesNameText: '',
+				readForm: {
+					
+				},
+				underTask: [],
+				unitTask: [],
+				unitTaskTotal: '0',
+				underTasktotal: '0',
+				testListTotal: '0',
+				queryInfo: {
+					pageNum: 1,
+					pageSize: 10,
+					task_id: '',
+					sample_id: '',
+					unit_test_name: '',
+					sample_name: '',
+					sample_data: '',
+					unit_sample_name: '',
+					sample_ground: '',
+				},
+				underInfo:{
+					pageNum: 1,
+					pageSize: 10,
+					task_id: '',
+					unit_id: '',
+				},
+				releaserInfo:{
+						groupname: '',
+						rymc:'',
+					},
+				taskInfo:{
+						base_file_url: null,
+						batch: '',
+						creater: null,
+						createtime: null,
+						endtime: null,
+						endtime_cydsb: null,
+						file_name: null,
+						file_url: null,
+						filenum: null,
+						id: null,
+						industry: null,
+						is_divide: null,
+						ispublic:null,
+						level:null,
+						log: null,
+						main_unit: null,
+						releaser:null,
+						starttime: null,
+						status: null,
+						task_class: null,
+						task_name:null,
+						test_model_id:null,
+						year: null,
+					},					
+				// 填报对话框弹出
+				inputDialogShow: false,
+				cellStyle: {
+					padding: 2 + 'px'
+				},
+				rowStyle: {
+					height: 35 + 'px'
+				},
+				tableHeader: [{
+						label: '样品编码',
+						prop: 'sample_id'
+						// fixed: 'left'
+					}, {
+						label: '样品名称',
+						prop: 'sample_name',
+						// fixed: 'left'
+					},
+					{
+						label: '受检单位',
+						prop: 'unit_test_name',
+						width: 180
+					},
+					{
+						label: '样品产地',
+						prop: 'place',
+						width: 180
+					}, {
+						label: '抽样日期',
+						prop: 'sample_date',
+						width: 180
+					}, {
+						label: '状态',
+						prop: 'status',
+						width: 180
+					}
+				],
+				checkHeader: [{
+						label: '样品名称',
+						prop: 'sample_name',
+						// fixed: 'left'
+					}, {
+						label: '样品编码',
+						prop: 'sample_id'
+						// fixed: 'left'
+					},
+					{
+						label: '受检单位',
+						prop: 'unit_test_name',
+						width: 180
+					},
+					{
+						label: '抽样单位',
+						prop: 'bear_name',
+						width: 180
+					}, {
+						label: '检测单位',
+						prop: 'check_name',
+						width: 180
+					}, {
+						label: '判定结果',
+						prop: 'test_result',
+						width: 180
+					}, {
+						label: '状态',
+						prop: 'test_status',
+						width: 180
+					}
+				],
+				checkHeader2: [{
+					label: '检测项目',
+					prop: 'test_name',
+					// fixed: 'left'
+				}],
+				// 数据表格数据
+				tableData: [],
+				tableData1: [],
+				options: [],
+				task_id: '',
+				multipleSelection: null,
+				// 填报检测对话框
+				inputCheckShow: false,
+				check_name: '',
+				check_id: '',
+				testPesticides: [],
+				resultjc: [],
+				// 模型列表
+				options: [],
+				bindForm: {
+					test_model_id: '',
+					closingdate: ''
+				},
+				jcheader: [{
+						label: '检测项目',
+						prop: 'test_name',
+					},
+					{
+						label: '检测值',
+						prop: 'test_value',
+					}, {
+						label: '限量值',
+						prop: 'state_value',
+					}, {
+						label: '单位',
+						prop: 'unit',
+					}, {
+						label: '抽检结果',
+						prop: 'test_result'
+					}, {
+						label: 'LOD',
+						prop: 'LOD',
+					}, {
+						label: 'LOQ',
+						prop: 'LOQ',
+					}
+				],
+				tableHeader2: [{
+						label: '抽样机构',
+						prop: 'bear_name',
+						width: 180,
+					}, {
+						label: '检测机构',
+						prop: 'check_name'
+					},
+					{
+						label: '抽样地区',
+						prop: 'address'
+					}, {
+						label: '抽样数量',
+						prop: 'sample_number'
+					},
+					{
+						label: '报告上传单位',
+						prop: 'report_name'
+					}, {
+						label: '报告上传截止时间',
+						prop: 'uploadtime'
+					}
+				],
+				fileList: [],
+				total: 0,
+				sampleShow: false, //是否展示抽样卡片
+				checkShow: false, //是否展示检测卡片
+				currentRow: null,
+				 //选中机构地域表格数据项
+			};
+		},
+		components: {
+			inputCheck
+		},
+		mounted() {},
+		created() {
+			this.task_id = this.$route.params.id
+
+
+			this.getTaskDetail()
+			// this.getTestList()
+			// this.getmodelList()
+			// this.getUnderTask()
+		},
+
+		methods: {
+			// 获取机构地域表格
+			// async getUnderTask() {
+			// 	this.queryInfo['task_id'] = this.task_id
+			// 	const result = await this.$http.post('getUnderTask', this.queryInfo)
+			// 	// 判断业务逻辑
+			// 	if (result.data.code == 0) {
+			// 		this.underTask = result.data.data.rows
+			// 		// 抽检分离时判断用户是抽样机构还是检测机构
+			// 		for (let i = 0; i < this.underTask.length; i++) {
+			// 			if (this.underTask[i].bear_name == name) {
+			// 				this.sampleShow = true
+			// 			}
+			// 			if (this.underTask[i].check_name == name) {
+			// 				this.checkShow = true
+			// 			}
+			// 		}
+			// 		this.underTasktotal = result.data.data.total
+			// 	}
+			// },
+			// 获取模型列表
+			// async getmodelList() {
+			// 	const {
+			// 		data: res
+			// 	} = await this.$http.post(
+			// 		"getModelList", {
+			// 			'pageNum': 1,
+			// 			'pageSize': 100,
+			// 			type_id: ""
+			// 		}
+			// 	);
+			// 	this.options = res.data.rows
+			// },	// 获取任务详情
+
+			//查询
+			async searchData() {
+				console.log(this.queryInfo)
+				this.queryInfo.pageNum = 1
+				this.getSampleList()
+			},
+			//重置
+			resetForm(formName) {
+				// console.log(this.queryInfo)
+					this.$refs[formName].resetFields();
+			},
+			//选中抽样任务(单选)
+			handlecyCurrentChange(val) {
+				this.currentRow = val;
+				console.log(this.currentRow)
+				console.log(this.currentRow.id)
+
+				// under_id = 
+			},
+			//获取任务详情
+			async getTaskDetail() {
+				var that = this
+				const {
+					data: res
+				} = await this.$http.post("getTaskDetail", {
+					task_id: that.task_id,
+					pageNum: that.queryInfo.pageNum,
+					pageSize: that.queryInfo.pageSize
+				});
+				console.log(res.data.product)
+				if (res.data.product.length > 0) {
+					if (res.data.product[0].type_id == '1') {
+						res.data.model_type = '种植业'
+					} else if (res.data.product[0].type_id == '2') {
+						res.data.model_type = '畜牧业'
+					} else if (res.data.product[0].type_id == '3') {
+						res.data.model_type = '渔业'
+					} else {
+						res.data.model_type = '其他'
+					}
+				}
+				that.readForm = res.data
+				console.log(that.readForm)
+				that.productNameText = that.readForm.product.map(el => el.product_name).join('、 ')
+				that.pesticidesNameText = that.readForm.pesticides.map(el => el.test_name).join('、 ')
+				that.underTask = res.data.underTaskList.rows
+				that.unitTask = res.data.unitTaskList.rows
+				console.log(that.underTask)
+				console.log(that.unitTask)
+				that.underTasktotal = res.data.underTaskList.total
+				that.unitTasktotal = res.data.unitTaskList.total
+
+				// 抽检不分离
+				if (that.taskInfo.is_divide == 0) {
+					this.sampleShow = true
+					this.checkShow = true
+				}
+			},
+
+			// 上传成功
+			async uploadSuccess(res) {
+				console.log(res.data)
+				this.form.file_url = res.data.fileUrl
+				this.form.file_name = res.data.fileName
+				const result = await this.$http.post('saveTestFile', {
+					sample_id: sample_id
+				})
+				if (result.data.code == 0) {
+					that.formjc = result.data.data
+				}
+			},
+			//下载检测报告
+			download() {
+				htmlToPdf.downloadPDF(document.querySelector('#pdf'), '检测报告')
+			},
+			//生成检测报告pdf
+			async creatpdf(sample_id) {
+				var that = this
+				that.dialogVisible2 = true
+				// async getSampleDetail() {
+				const result = await this.$http.post('getSampleDetail', {
+					sample_id: sample_id
+				})
+				if (result.data.code == 0) {
+					that.formjc = result.data.data
+				}
+				console.log(that.formjc)
+				const res = await this.$http.post('getTestValue', {
+					sample_id: sample_id
+				})
+				if (res.data.code == 0) {
+					that.resultjc = res.data.data.result_detail
+				}
+				console.log(that.resultjc)
+				// },
+
+			},
+			async onSubmit() {
+				console.log(this.testPesticides)
+				for (let i = 0; i < this.testPesticides.length; i++) {
+					this.testPesticides[i]['unit'] = 'mg/kg'
+					console.log(this.testPesticides[i]['state_value'])
+					if (this.testPesticides[i]['state_value'] === 'ND') {
+						if (this.testPesticides[i]['test_value'] !== 'ND') {
+							this.testPesticides[i]['test_result'] = '不合格'
+						}
+					} else {
+						if (this.testPesticides[i]['test_value'] <= this.testPesticides[i]['state_value']) {
+							this.testPesticides[i]['test_result'] = '合格'
+						} else if (this.testPesticides[i]['test_value'] > this.testPesticides[i]['state_value']) {
+							this.testPesticides[i]['test_result'] = '不合格'
+						}
+					}
+					delete this.testPesticides[i]['test_model_id']
+				}
+
+
+				var that = this
+				const result = await this.$http.post("saveSamplePesticides", {
+					pesticides: that.testPesticides,
+					sample_id: that.check_id
+				});
+				if (result.data.code == 0) {
+					this.$message({
+						type: 'success',
+						message: '检测成功!'
+					});
+					that.inputCheckShow = false
+					that.getSampleList()
+				} else {
+					this.$message({
+						type: 'error',
+						message: result.data.message
+					});
+					that.inputCheckShow = false
+				}
+			},
+			async check(id, name) {
+				this.inputCheckShow = true
+
+				this.check_id = id,
+				this.check_name = name
+				console.log(this.check_id)
+				console.log(this.check_name)
+				var that = this
+				const {
+					data: res
+				} = await this.$http.post("getTestPesticides", {
+					sample_id: id
+				});
+				that.testPesticides = res.data
+				console.log(that.testPesticides)
+			},
+			handleClick(tab, event) {
+				console.log(tab, event);
+			},
+			// 获取检测单列表
+			async getTestList(id){
+				this.checkTestList = true
+				console.log(id)
+				// for (var key in this.queryInfo) {
+				// 	if (this.queryInfo[key] == '') {
+				// 		delete this.queryInfo[key]
+				// 	}
+				// }
+				// this.queryInfo['underTake_id'] = id
+				this.underInfo['task_id'] = this.task_id
+				this.underInfo['unit_id'] = id
+
+				console.log(this.underInfo)
+				const {
+					data: res
+				} = await this.$http.post("getTaskDetail", this.underInfo);
+				
+				// console.log(res)
+				this.tableData1 = res.data.rows
+				console.log(this.tableData)
+				this.testListTotal = res.data.total
+				
+			},
+			// 获取抽样单列表
+			async getSampleList(id) {
+				// console.log(id2)
+				for (var key in this.queryInfo) {
+					if (this.queryInfo[key] == '') {
+						delete this.queryInfo[key]
+					}
+				}
+				this.queryInfo['task_id'] = this.task_id
+				this.queryInfo['undertake_id'] = id
+				
+				const {
+					data: res
+				} = await this.$http.post("getSampleList", this.queryInfo);
+				// console.log(res)
+				this.tableData = res.data.rows
+				console.log(this.tableData)
+				for (let i = 0; i < this.tableData.length; i++) {
+					if (this.tableData[i].status == '0') {
+						this.tableData[i].status = '未上报'
+					} else {
+						this.tableData[i].status = '已上报'
+					}
+					if (this.tableData[i].jc_value_id == null) {
+						this.tableData[i].test_result = '暂未检测'
+					} else {
+						if (this.tableData[i].test_result == '0') {
+							this.tableData[i].test_result = '不合格'
+						} else if (this.tableData[i].test_result == '1') {
+							this.tableData[i].test_result = '合格'
+						}
+					}
+					if (this.tableData[i].test_status == '0') {
+						this.tableData[i].test_status = '未上报'
+					} else if (this.tableData[i].test_status == '1') {
+						this.tableData[i].test_status = '已上报'
+					}
+
+				}
+				this.total = res.data.total
+				this.getSampleListDialog = true
+			},
+			// 跳转到填写抽样单
+			inputSample() {
+				this.activeName = 'second'
+			},
+			// 填报抽样单
+			input(id) {
+				console.log(id)
+				// // console.log(this.currentRow.id)
+				// if(this.currentRow == null){
+				// 	this.$message('请选中一条表格数据');
+				// 	return
+				// }
+						this.$router.push({
+					name: 'inputSample',
+					params: {
+						task_id: this.readForm.taskInfo.id,
+						under_id:id
+					}
+				})
+				// }
+				// if(isset(this.currentRow.id)){
+				// 	this.under_id=this.currentRow.id
+				// }
+			
+				// console.log(this.currentRow.id)
+			},
+			// 返回
+			back() {
+				var that = this
+				this.$router.push({
+					name: 'setTaskcd',
+					params: {
+						id: that.id
+					}
+				})
+			},
+			// 上传抽样信息
+			async appear() {
+				let that = this
+				// that.orgs = that.multipleSelection
+				console.log(that.multipleSelection)
+				const result = await this.$http.post('setSampleStatus', that.multipleSelection)
+				// 判断业务逻辑
+				if (result.data.code == 0) {
+					// 判断业务逻辑
+					if (result.data.code == 0) {
+						this.$message({
+							type: 'success',
+							message: '上报抽样信息成功'
+						})
+						this.getSampleList()
+					}
+				}
+			},
+			// 多选删除抽样信息
+			async delAll() {
+				let that = this
+				// that.orgs = that.multipleSelection
+				console.log(that.multipleSelection)
+				const result = await this.$http.post('delSample', that.multipleSelection)
+				// 判断业务逻辑
+				if (result.data.code == 0) {
+					this.$message({
+						type: 'success',
+						message: '删除成功'
+					})
+					this.getSampleList()
+				}
+			},
+			/** 修复当用户在大于1的分页进行数据搜索没有返回值的问题 */
+			setPageNum() {
+				this.queryInfo.pageNum = 1
+				this.getSampleList()
+			},
+			setSelectedRow() {
+				// 设置当前页已选项
+				this.hander = true
+				this.tableData.forEach(item => {
+					if (this.list.includes(item[this.uniqueKey])) {
+						this.$refs.multipleTable.toggleRowSelection(item, true)
+					}
+				})
+				this.hander = false
+			},
+
+			/** 监听每页显示多少数据的改变 */
+			handleSizeChange(newSize) {
+				this.queryInfo.pageSize = newSize
+				this.getSampleList()
+			},
+
+			/** 监听页码的改变 */
+			handleCurrentChange(newPage) {
+				this.queryInfo.pageNum = newPage
+				this.getSampleList()
+			},
+			/** 监听每页显示多少数据的改变 */
+			handleSizeChange1(newSize) {
+				this.unitInfo.pageSize = newSize
+				this.getTestList()
+			},
+
+			/** 监听页码的改变 */
+			handleCurrentChange1(newPage) {
+				this.unitInfo.pageNum = newPage
+				this.getTestList()
+			},
+			// 批量勾选
+			handleSelectionChange(val) {
+				this.multipleSelection = val
+				console.log(this.multipleSelection)
+				if (this.hander) return false
+				// this.setSelectRows() // 处理选中的方法
+			},
+			// 跳转到查看抽样单详情
+			sampleDetail(id) {
+				console.log(id)
+				this.$router.push({
+					name: 'sampleDetail',
+					params: {
+						id: id
+					}
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="less" scoped>
+	.el-breadcrumb {
+		margin-bottom: 20px;
+	}
+
+	// .el-form-item {
+	// 	margin-bottom: 0px;
+	// }
+
+	.el-select {
+		width: 210px;
+		height: 100%;
+	}
+
+	.select {
+		display: flex;
+		flex-direction: row;
+		margin-left: 10px;
+	}
+
+	// .el-form {
+	// 	margin-left: 35%;
+	// }
+
+	// .el-form-item {
+	// 	// margin-bottom: 8px;
+	// 	margin: 0 auto;
+	// }
+
+	// .labelItem /deep/ .el-form-item__label {
+	// 	// width: 80px;
+	// 	text-align: center;
+	// 	vertical-align: middle;
+	// 	float: left;
+	// 	font-size: 14px;
+	// 	color: #606266;
+	// 	font-weight: bold;
+	// 	// line-height: 40px;
+	// 	padding: 0 20px 0 0;
+	// 	-webkit-box-sizing: border-box;
+	// 	box-sizing: border-box;
+	// }
+
+	.demonstration {
+		margin: 20px;
+	}
+
+	// .el-form-item__content {
+	// 	width: 200px;
+	// }
+
+	.footer {
+		margin-top: 20px;
+		margin-left: 45%;
+	}
+	.el-table{
+		margin-top: 20px;
+	}
+	.el-pagination {
+		margin-top: 25px;
+	}
+</style>

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

@@ -0,0 +1,1166 @@
+<template>
+	<div>
+
+		<el-breadcrumb separator-class="el-icon-arrow-right">
+			<el-breadcrumb-item>首页</el-breadcrumb-item>
+			<el-breadcrumb-item>承担单位</el-breadcrumb-item>
+			<el-breadcrumb-item :to="{ path: '/jc/routineMonitor' }">任务列表</el-breadcrumb-item>
+			<el-breadcrumb-item>基本信息</el-breadcrumb-item>
+		</el-breadcrumb>
+
+		<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
+			<el-tab-pane label="任务详情" name="first">
+				<el-descriptions class="margin-top" title="例行监测任务" :column="2" :size="size" border>
+					<el-descriptions-item>
+						<template slot="label" prop="releaser">
+							发布单位
+						</template>
+						{{readForm.releaserInfo.rymc}}
+					</el-descriptions-item>
+					<el-descriptions-item>
+						<template slot="label">
+							年度
+						</template>
+						{{readForm.taskInfo.year}}
+					</el-descriptions-item>
+					<el-descriptions-item>
+						<template slot="label">
+							开始时间和结束时间
+						</template>
+						{{readForm.taskInfo.starttime}}-{{readForm.taskInfo.endtime}}
+					</el-descriptions-item>
+					<el-descriptions-item>
+						<template slot="label">
+							抽样信息上报截止时间
+						</template>
+						{{readForm.taskInfo.endtime_cydsb}}
+					</el-descriptions-item>
+					<el-descriptions-item>
+						<template slot="label">
+							监测类型
+						</template>
+						{{readForm.taskInfo.task_class}}
+					</el-descriptions-item>
+					<el-descriptions-item>
+						<template slot="label">
+							行业
+						</template>
+						<!-- <div v-if="readForm.product!=[]"> -->
+						<span>{{readForm.model_type}}</span>
+						<!-- </div> -->
+						<!-- <div v-else>暂无</div> -->
+					</el-descriptions-item>
+					<el-descriptions-item>
+						<template slot="label">
+							抽检分离
+						</template>
+						<span v-if="readForm.taskInfo.is_divide==1">是</span>
+						<span v-if="readForm.taskInfo.is_divide==0">否</span>
+					</el-descriptions-item>
+					<el-descriptions-item>
+						<template slot="label">
+							附件
+						</template>
+						<div v-if="readForm.file_url==null">无</div>
+						<el-link v-else type="primary" :href="readForm.taskInfo.file_url">下载附件</el-link>
+					</el-descriptions-item>
+
+				</el-descriptions>
+				<el-descriptions class="margin-top" :size="size" border>
+					<el-descriptions-item>
+						<template slot="label">
+							备注
+						</template>
+						{{readForm.taskInfo.log}}
+					</el-descriptions-item>
+				</el-descriptions>
+				<el-descriptions class="margin-top" :size="size" border>
+					<el-descriptions-item>
+
+						<template slot="label">
+							检测对象
+						</template>
+						{{productNameText}}
+						<!-- <span v-for="item in readForm.product">{{item.product_name}}、</span> -->
+					</el-descriptions-item>
+				</el-descriptions>
+				<el-descriptions class="margin-top" :size="size" border>
+					<el-descriptions-item>
+						<template slot="label">
+							检测项
+						</template>
+						{{pesticidesNameText}}
+						<!-- <span v-for="item in readForm.pesticides">{{item.test_name}}、</span> -->
+					</el-descriptions-item>
+				</el-descriptions>
+				<!-- <el-table :data="underTask" border stripe highlight-current-row  @current-change="handlecyCurrentChange" style="width: 100%"
+					:row-style="rowStyle" :cell-style="cellStyle">
+					<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> -->
+				<!-- <div class="footer">
+					<el-button type="success" size="mini" @click="input()">填报抽样单</el-button>
+					<el-button type="success" size="mini" @click="next">导出总览</el-button>
+					<el-button type="success" size="mini" @click="back">返回</el-button>
+				</div> -->
+			</el-tab-pane>
+
+			<el-tab-pane label="抽样" name="second">
+			<!-- <el-tab-pane v-if="sampleShow==true" label="抽样" name="second"> -->
+
+				<!-- 头部搜索栏 -->
+				
+					<el-form style="display: flex; flex-direction: column;" ref="form2" :model="queryInfo">
+						<el-row style="width: 75%;">
+							<el-col :span="6">
+						<el-form-item label="样品名称" class="select" size="small" prop="sample_name">
+							<el-input v-model="queryInfo.sample_name"></el-input>
+						</el-form-item>
+							</el-col>
+							<el-col :span="6">
+						<el-form-item label="样品编码" class="select" size="small" prop="sample_id">
+							<el-input v-model="queryInfo.sample_id"></el-input>
+						</el-form-item>
+							</el-col>
+							<el-col :span="6">
+						<el-form-item label="受检单位" class="select" size="small" prop="units_name">
+							<el-input v-model="queryInfo.unit_test_name"></el-input>
+						</el-form-item>
+						</el-col>
+						</el-row>
+						<el-row style="width: 75%;">
+							<el-col :span="6">
+						<el-form-item label="抽样单位" class="select" size="small" prop="sample_unit_name">
+							<el-input v-model="queryInfo.unit_sample_name"></el-input>
+						</el-form-item>
+						    </el-col>
+							<el-col :span="6">
+						<el-form-item label="抽样日期" class="select" size="small" prop="sample_data">
+							<el-input v-model="queryInfo.sample_data"></el-input>
+						</el-form-item>
+						</el-col>
+						<el-col :span="6">
+						<!-- <el-form-item label="抽样场所" class="select" size="small" prop="sample_ground">
+							<el-input v-model="queryInfo.sample_ground"></el-input>
+						</el-form-item> -->
+						</el-col>
+						<el-col :span="4">
+							<el-button style="height: 32px;margin-left: 10px;" size="mini" type="success"
+							@click="searchData()">查询
+						</el-button>
+						<!-- 重置 -->
+						<el-button style="height: 32px;margin-left: 5px;" size="mini" type="success" @click="resetForm('form2')">
+							重置
+						</el-button>
+						</el-col>
+						</el-row>
+					</el-form>
+				<el-row style="margin-right: 0px;">
+					<el-form style="display: flex; flex-direction: row;">
+						<!-- 	<el-form-item label="产地" class="select">
+							<el-select v-model="value" placeholder="请选择省份" size="small">
+								<el-option v-for="item in options" :key="item.value" :label="item.label"
+									:value="item.value">
+								</el-option>
+							</el-select>
+							<el-select v-model="value" placeholder="请选择城市" size="small">
+								<el-option v-for="item in options" :key="item.value" :label="item.label"
+									:value="item.value">
+								</el-option>
+							</el-select>
+							<el-select v-model="value" placeholder="请选择区/县" size="small">
+								<el-option v-for="item in options" :key="item.value" :label="item.label"
+									:value="item.value">
+								</el-option>
+							</el-select>
+						</el-form-item> -->
+						<!-- 查询 -->
+
+					</el-form>
+				<el-table :data="underTask" border stripe highlight-current-row  @current-change="handlecyCurrentChange" style="width: 100%"
+					:row-style="rowStyle" :cell-style="cellStyle">
+					<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 type="success" size="small" plain @click="input(scope.row.id)">填报抽样单
+						</el-button>
+						<!-- <el-button type="success" size="small" plain @click="sampleDetail(scope.row.sample_id)">查看 -->
+						<el-button type="success" size="small" @click="getSampleList(scope.row.id)">查看抽样单列表
+						</el-button>
+							<!-- <el-button type="success" size="small" plain @click="sampleDetail(scope.row.sample_id)" @focus="getSampleListDialog = true">查看抽样单列表
+						</el-button> -->
+						<el-button type="primary" size="small" plain icon="el-icon-edit-outline" @click="appear">上报抽样信息
+						</el-button>
+					</template>
+					</el-table-column>
+				</el-table>
+
+				<!-- 抽样单列表对话框 -->
+			<el-dialog title="抽样单列表" :visible.sync="getSampleListDialog" width="80%" :close-on-click-modal="false" class="dialogItem">
+				<el-form v-if="getSampleListDialog">
+					<!--  表格数据区域-->
+					<el-table ref="multipleTable" :data="tableData" border stripe highlight-current-row
+						@selection-change="handleSelectionChange" style="width: 100%" :row-style="rowStyle"
+						:cell-style="cellStyle">
+						<el-table-column type="selection" 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.label" v-for="table in tableHeader" :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 type="success" size="small" plain @click="sampleDetail(scope.row.sample_id)">查看
+								</el-button>
+							</template>
+						</el-table-column>
+					</el-table>
+					<!--    分页器区域-->
+					<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+					:current-page="queryInfo.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo.pageSize"
+					layout="total, sizes, prev, pager, next, jumper" :total="total" background />
+				</el-form>
+			</el-dialog>
+		</el-row>	
+		</el-tab-pane>
+
+			<el-tab-pane label="检测" name="third">
+			<!-- <el-tab-pane  v-if="checkShow==true"  label="检测" name="third"> -->
+			<el-table :data="unitTask" border stripe highlight-current-row  @current-change="handlecyCurrentChange" style="width: 100%"
+					:row-style="rowStyle" :cell-style="cellStyle">
+				<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 type="success" size="small" plain @click="input(scope.row.id)">填报抽样单
+					</el-button> -->
+					<!-- <el-button type="success" size="small" plain @click="sampleDetail(scope.row.sample_id)">查看 -->
+					<el-button type="success" size="small" @click="getTestList(scope.row.id)">查看检测单列表
+					</el-button>
+						<!-- <el-button type="success" size="small" plain @click="sampleDetail(scope.row.sample_id)" @focus="getSampleListDialog = true">查看抽样单列表
+					</el-button> -->
+					<el-button type="primary" size="small" plain icon="el-icon-edit-outline" @click="appearTest">上报检测信息
+					</el-button>
+				</template>
+				</el-table-column>
+			</el-table>
+			<!-- 查看检测单列表弹框 -->
+			<el-dialog title="检测单列表" :visible.sync="checkTestList" width="70%" :close-on-click-modal="false"
+				class="dialogItem">
+				<!--  表格数据区域-->
+				<el-table :data="tableData1" border stripe highlight-current-row style="width: 100%"
+					:row-style="rowStyle" :cell-style="cellStyle">
+					<!-- <el-table-column type="selection" 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.label" v-for="table in checkHeader" :label="table.label"
+						:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
+					<el-table-column label="操作" align="center" fixed="right" width="220px">
+						<template slot-scope="scope">
+							<el-button type="success" size="mini" v-if="scope.row.jc_value_id==null" plain
+								@click="check(scope.row.sample_id,scope.row.sample_name)">检测</el-button>
+							<el-button type="primary" v-else size="mini" plain @click="update(scope.row)">修改</el-button>
+							<el-button type="primary" size="mini" plain @click="upcheck(scope.row.sample_id)">上报
+							</el-button>
+							<el-button type="primary" size="mini" plain @click="creatpdf(scope.row.sample_id)">生成检测报告
+							</el-button>
+						</template>
+					</el-table-column>
+				</el-table>
+
+				<!--    分页器区域-->
+				<el-pagination @size-change="handleSizeChange1" @current-change="handleCurrentChange1"
+					:current-page="underInfo.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="underInfo.pageSize"
+					layout="total, sizes, prev, pager, next, jumper" :total="testListTotal" background />
+			</el-dialog>
+			</el-tab-pane>
+			
+
+			<el-dialog title="填写检测单" :visible.sync="inputCheckShow" width="70%" :close-on-click-modal="false"
+				class="dialogItem">
+				<span class="demonstration">样品编码:{{check_id}}</span>
+				<span class="demonstration">样品名称:{{check_name}}</span>
+				<el-button type="success" size="small" plain @click="onSubmit">保存</el-button>
+				<span class="demonstration">注意:“不得检出”只能填为“ND”</span>
+				<!--  表格数据区域-->
+				<el-table :data="testPesticides" border stripe highlight-current-row style="width: 100%"
+					:row-style="rowStyle" :cell-style="cellStyle">
+					<el-table-column :key="table.label" v-for="table in checkHeader2" :label="table.label"
+						:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
+					<el-table-column label="检测值">
+						<template slot-scope="scope">
+							<el-input v-model="scope.row.test_value" size="small" />
+						</template>
+					</el-table-column>
+					<el-table-column label="限量值">
+						<template slot-scope="scope">
+							<el-input v-model="scope.row.state_value" size="small" />
+						</template>
+					</el-table-column>
+					<el-table-column label="单位">
+						<template slot-scope="scope">
+							<span v-model="scope.row.unit" size="small">mg/kg</span>
+						</template>
+					</el-table-column>
+					<el-table-column label="抽检结果">
+						<template slot-scope="scope">
+							<span v-if="parseFloat(scope.row.test_value)<=parseFloat(scope.row.state_value)&&scope.row.state_value!='ND'"
+								size="small">合格</span>
+							<span v-else-if="parseFloat(scope.row.test_value)>parseFloat(scope.row.state_value)" size="small">不合格</span>
+							<span v-else-if="scope.row.test_value=='ND'&&scope.row.state_value=='ND'"
+								size="small">合格</span>
+							<span v-else-if="scope.row.test_value!='ND'&&scope.row.state_value=='ND'"
+								size="small">不合格</span>
+						</template>
+					</el-table-column>
+					<el-table-column label="LOD">
+						<template slot-scope="scope">
+							<el-input v-model="scope.row.LOD" size="small" />
+						</template>
+					</el-table-column>
+					<el-table-column label="LOQ">
+						<template slot-scope="scope">
+							<el-input v-model="scope.row.LOQ" />
+						</template>
+					</el-table-column>
+
+				</el-table>
+			</el-dialog>
+			<!-- ///////////////////////////////////////////检测报告生成-------难、、、、、、、、、、、、、、、、、、、、、、 -->
+			<el-dialog title="生成监测报告" :visible.sync="dialogVisible2" width="50%">
+				<div id="pdf">
+					<el-form ref="formjc" :model="formjc" label-width="100px"
+						style="margin-top: 20px;width: 100%;background-color: aliceblue;padding: 5px;">
+						<el-row style="text-align: center; font-size: 23px; margin: 40px 0;">
+							安徽省农业农村厅农产品质量安全例行监测检测报告
+						</el-row>
+						<el-row>
+							<el-col :span="12">
+								<el-form-item label="样品名称" prop="sample_name" class="labelItem" size="mini">
+									<el-input disabled v-model="formjc.sample_name"></el-input>
+								</el-form-item>
+							</el-col>
+							<el-col :span="11">
+								<el-form-item label="样品编码" prop="sample_id" class="labelItem" style="" size="mini">
+									<el-input disabled v-model="formjc.sample_id"></el-input>
+								</el-form-item>
+							</el-col>
+						</el-row>
+						<el-row>
+							<el-col :span="12">
+								<el-form-item label="型号规格" prop="type" class="labelItem" size="mini">
+									<el-input disabled v-model="formjc.type"></el-input>
+								</el-form-item>
+							</el-col>
+							<el-col :span="11">
+								<el-form-item label="执行标准" prop="standard" class="labelItem" style="" size="mini">
+									<el-input disabled v-model="formjc.standard"></el-input>
+								</el-form-item>
+							</el-col>
+						</el-row>
+						<el-row>
+							<el-col :span="12">
+								<el-form-item label="生产日期或批号" prop="production_date" class="labelItem" size="mini">
+									<el-input disabled v-model="formjc.production_date"></el-input>
+								</el-form-item>
+							</el-col>
+							<el-col :span="11">
+								<el-form-item label="产地" prop="place" class="labelItem" style="" size="mini">
+									<el-input disabled v-model="formjc.place"></el-input>
+								</el-form-item>
+							</el-col>
+						</el-row>
+						<el-row>
+							<el-col :span="12">
+								<el-form-item label="产品认证情况" prop="certicfie" class="labelItem" size="mini">
+									<el-input disabled v-model="formjc.certicfie"></el-input>
+								</el-form-item>
+							</el-col>
+							<el-col :span="11">
+								<el-form-item label="证书编号" prop="certifie_num" class="labelItem" style="" size="mini">
+									<el-input disabled v-model="formjc.certifie_num"></el-input>
+								</el-form-item>
+							</el-col>
+						</el-row>
+						<el-row>
+							<el-col :span="12">
+								<el-row>
+									<el-col :span="13">
+										<el-form-item label="抽样数量" prop="sample_renum" class="labelItem" size="mini">
+											<el-input disabled v-model="formjc.sample_renum"></el-input>
+										</el-form-item>
+									</el-col>
+									<el-col :span="10">
+										<el-form-item label="单位" prop="sample_num_unit" class="labelItem" size="mini"
+											label-width="60px">
+											<el-input disabled v-model="formjc.sample_num_unit"></el-input>
+										</el-form-item>
+									</el-col>
+								</el-row>
+							</el-col>
+							<el-col :span="11">
+								<el-row>
+									<el-col :span="13">
+										<el-form-item label="抽样基数" prop="sample_base" class="labelItem" size="mini">
+											<el-input disabled v-model="formjc.sample_base"></el-input>
+										</el-form-item>
+									</el-col>
+									<el-col :span="10">
+										<el-form-item label="单位" prop="sample_base_unit" class="labelItem" size="mini"
+											label-width="60px" clearable>
+											<el-input disabled v-model="formjc.sample_base_unit"></el-input>
+										</el-form-item>
+									</el-col>
+								</el-row>
+							</el-col>
+						</el-row>
+						<el-row>
+							<el-col>
+								<el-form-item label="抽样场所" prop="sample_ground" class="labelItem" size="mini">
+									<el-input disabled v-model="formjc.sample_ground"></el-input>
+								</el-form-item>
+							</el-col>
+						</el-row>
+						<el-row>
+							<el-col :span="7"
+								style="text-align: center;vertical-align: middle;line-height: 250px;font-size: 14px;">
+								<div class="">
+									受检单位情况
+								</div>
+							</el-col>
+							<el-col :span="15">
+								<el-form-item label="单位名称" prop="units_name" class="labelItem" style="" size="mini">
+									<el-input disabled v-model="formjc.units_name"></el-input>
+								</el-form-item>
+								<el-form-item label="通讯地址" prop="address" class="labelItem" style="" size="mini">
+									<el-input disabled v-model="formjc.address"></el-input>
+								</el-form-item>
+								<el-form-item label="法定代表人" prop="corporation" class="labelItem" style="" size="mini">
+									<el-input disabled v-model="formjc.corporation"></el-input>
+								</el-form-item>
+								<el-form-item label="受检人" prop="user_name" class="labelItem" style="" size="mini">
+									<el-input disabled v-model="formjc.user_name"></el-input>
+								</el-form-item>
+								<el-form-item label="电话" prop="phone" class="labelItem" style="" size="mini">
+									<el-input disabled v-model="formjc.phone"></el-input>
+								</el-form-item>
+								<el-form-item label="传真" prop="fax" class="labelItem" style="" size="mini">
+									<el-input disabled v-model="formjc.fax"></el-input>
+								</el-form-item>
+							</el-col>
+						</el-row>
+					</el-form>
+					<el-table :data="resultjc" border stripe highlight-current-row style="width: 100%"
+						:row-style="rowStyle" :cell-style="cellStyle">
+						<el-table-column :key="table.label" v-for="table in jcheader" :label="table.label"
+							:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
+					</el-table>
+				</div>
+				<div  style="margin-top: 10px; text-align: center">
+				<el-button @click="dialogVisible2 = false">取 消</el-button>
+				<el-button type="primary" @click="download">生成检测报告pdf</el-button>
+				</div>
+				<!-- </span> -->
+			</el-dialog>
+
+			<el-tab-pane label="报告上传" name="five">
+				<el-upload class="upload-demo" :file-list="fileList" drag :headers="myHeaders"
+					action="http://syjcapi.aielab.net/api/v1/ossUpload" :on-success="uploadSuccess" :limit="1">
+					<i class="el-icon-upload"></i>
+					<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+				</el-upload>
+			</el-tab-pane>
+		</el-tabs>
+
+	</div>
+</template>
+
+<script>
+	import htmlToPdf from '../../assets/js/htmlToPdf.js'
+	import inputCheck from './inputCheck'
+	const token = window.sessionStorage.getItem('token')
+	const name = window.sessionStorage.getItem('name')
+	export default {
+		name: 'setTask',
+		data() {
+			return {
+				size: 'medium',
+				myHeaders: {
+					Authorization: 'bearer' + token
+				},
+				formjc: {},
+				dialogVisible2: false,
+				getSampleListDialog: false,
+				checkTestList: false,
+				activeName: 'first',
+				id: 0,
+				productNameText: '',
+				pesticidesNameText: '',
+				readForm: {
+					
+				},
+				underTask: [],
+				unitTask: [],
+				unitTaskTotal: '0',
+				underTasktotal: '0',
+				testListTotal: '0',
+				queryInfo: {
+					pageNum: 1,
+					pageSize: 10,
+					task_id: '',
+					sample_id: '',
+					unit_test_name: '',
+					sample_name: '',
+					sample_data: '',
+					unit_sample_name: '',
+					sample_ground: '',
+				},
+				underInfo:{
+					pageNum: 1,
+					pageSize: 10,
+					task_id: '',
+					unit_id: '',
+				},
+				releaserInfo:{
+						groupname: '',
+						rymc:'',
+					},
+				taskInfo:{
+						base_file_url: null,
+						batch: '',
+						creater: null,
+						createtime: null,
+						endtime: null,
+						endtime_cydsb: null,
+						file_name: null,
+						file_url: null,
+						filenum: null,
+						id: null,
+						industry: null,
+						is_divide: null,
+						ispublic:null,
+						level:null,
+						log: null,
+						main_unit: null,
+						releaser:null,
+						starttime: null,
+						status: null,
+						task_class: null,
+						task_name:null,
+						test_model_id:null,
+						year: null,
+					},					
+				// 填报对话框弹出
+				inputDialogShow: false,
+				cellStyle: {
+					padding: 2 + 'px'
+				},
+				rowStyle: {
+					height: 35 + 'px'
+				},
+				tableHeader: [{
+						label: '样品编码',
+						prop: 'sample_id'
+						// fixed: 'left'
+					}, {
+						label: '样品名称',
+						prop: 'sample_name',
+						// fixed: 'left'
+					},
+					{
+						label: '受检单位',
+						prop: 'unit_test_name',
+						width: 180
+					},
+					{
+						label: '样品产地',
+						prop: 'place',
+						width: 180
+					}, {
+						label: '抽样日期',
+						prop: 'sample_date',
+						width: 180
+					}, {
+						label: '状态',
+						prop: 'status',
+						width: 180
+					}
+				],
+				checkHeader: [{
+						label: '样品名称',
+						prop: 'sample_name',
+						// fixed: 'left'
+					}, {
+						label: '样品编码',
+						prop: 'sample_id'
+						// fixed: 'left'
+					},
+					{
+						label: '受检单位',
+						prop: 'unit_test_name',
+						width: 180
+					},
+					{
+						label: '抽样单位',
+						prop: 'bear_name',
+						width: 180
+					}, {
+						label: '检测单位',
+						prop: 'check_name',
+						width: 180
+					}, {
+						label: '判定结果',
+						prop: 'test_result',
+						width: 180
+					}, {
+						label: '状态',
+						prop: 'test_status',
+						width: 180
+					}
+				],
+				checkHeader2: [{
+					label: '检测项目',
+					prop: 'test_name',
+					// fixed: 'left'
+				}],
+				// 数据表格数据
+				tableData: [],
+				tableData1: [],
+				options: [],
+				task_id: '',
+				multipleSelection: null,
+				// 填报检测对话框
+				inputCheckShow: false,
+				check_name: '',
+				check_id: '',
+				testPesticides: [],
+				resultjc: [],
+				// 模型列表
+				options: [],
+				bindForm: {
+					test_model_id: '',
+					closingdate: ''
+				},
+				jcheader: [{
+						label: '检测项目',
+						prop: 'test_name',
+					},
+					{
+						label: '检测值',
+						prop: 'test_value',
+					}, {
+						label: '限量值',
+						prop: 'state_value',
+					}, {
+						label: '单位',
+						prop: 'unit',
+					}, {
+						label: '抽检结果',
+						prop: 'test_result'
+					}, {
+						label: 'LOD',
+						prop: 'LOD',
+					}, {
+						label: 'LOQ',
+						prop: 'LOQ',
+					}
+				],
+				tableHeader2: [{
+						label: '抽样机构',
+						prop: 'bear_name',
+						width: 180,
+					}, {
+						label: '检测机构',
+						prop: 'check_name'
+					},
+					{
+						label: '抽样地区',
+						prop: 'address'
+					}, {
+						label: '抽样数量',
+						prop: 'sample_number'
+					},
+					{
+						label: '报告上传单位',
+						prop: 'report_name'
+					}, {
+						label: '报告上传截止时间',
+						prop: 'uploadtime'
+					}
+				],
+				fileList: [],
+				total: 0,
+				sampleShow: false, //是否展示抽样卡片
+				checkShow: false, //是否展示检测卡片
+				currentRow: null,
+				 //选中机构地域表格数据项
+			};
+		},
+		components: {
+			inputCheck
+		},
+		mounted() {},
+		created() {
+			this.task_id = this.$route.params.id
+
+
+			this.getTaskDetail()
+			// this.getTestList()
+			// this.getmodelList()
+			// this.getUnderTask()
+		},
+
+		methods: {
+			// 获取机构地域表格
+			// async getUnderTask() {
+			// 	this.queryInfo['task_id'] = this.task_id
+			// 	const result = await this.$http.post('getUnderTask', this.queryInfo)
+			// 	// 判断业务逻辑
+			// 	if (result.data.code == 0) {
+			// 		this.underTask = result.data.data.rows
+			// 		// 抽检分离时判断用户是抽样机构还是检测机构
+			// 		for (let i = 0; i < this.underTask.length; i++) {
+			// 			if (this.underTask[i].bear_name == name) {
+			// 				this.sampleShow = true
+			// 			}
+			// 			if (this.underTask[i].check_name == name) {
+			// 				this.checkShow = true
+			// 			}
+			// 		}
+			// 		this.underTasktotal = result.data.data.total
+			// 	}
+			// },
+			// 获取模型列表
+			// async getmodelList() {
+			// 	const {
+			// 		data: res
+			// 	} = await this.$http.post(
+			// 		"getModelList", {
+			// 			'pageNum': 1,
+			// 			'pageSize': 100,
+			// 			type_id: ""
+			// 		}
+			// 	);
+			// 	this.options = res.data.rows
+			// },	// 获取任务详情
+
+			//查询
+			async searchData() {
+				console.log(this.queryInfo)
+				this.queryInfo.pageNum = 1
+				this.getSampleList()
+			},
+			//重置
+			resetForm(formName) {
+				// console.log(this.queryInfo)
+					this.$refs[formName].resetFields();
+			},
+			//选中抽样任务(单选)
+			handlecyCurrentChange(val) {
+				this.currentRow = val;
+				console.log(this.currentRow)
+				console.log(this.currentRow.id)
+
+				// under_id = 
+			},
+			//获取任务详情
+			async getTaskDetail() {
+				var that = this
+				const {
+					data: res
+				} = await this.$http.post("getTaskDetail", {
+					task_id: that.task_id,
+					pageNum: that.queryInfo.pageNum,
+					pageSize: that.queryInfo.pageSize
+				});
+				console.log(res.data.product)
+				if (res.data.product.length > 0) {
+					if (res.data.product[0].type_id == '1') {
+						res.data.model_type = '种植业'
+					} else if (res.data.product[0].type_id == '2') {
+						res.data.model_type = '畜牧业'
+					} else if (res.data.product[0].type_id == '3') {
+						res.data.model_type = '渔业'
+					} else {
+						res.data.model_type = '其他'
+					}
+				}
+				that.readForm = res.data
+				console.log(that.readForm)
+				that.productNameText = that.readForm.product.map(el => el.product_name).join('、 ')
+				that.pesticidesNameText = that.readForm.pesticides.map(el => el.test_name).join('、 ')
+				that.underTask = res.data.underTaskList.rows
+				that.unitTask = res.data.unitTaskList.rows
+				console.log(that.underTask)
+				console.log(that.unitTask)
+				that.underTasktotal = res.data.underTaskList.total
+				that.unitTasktotal = res.data.unitTaskList.total
+
+				// 抽检不分离
+				if (that.taskInfo.is_divide == 0) {
+					this.sampleShow = true
+					this.checkShow = true
+				}
+			},
+
+			// 上传成功
+			async uploadSuccess(res) {
+				console.log(res.data)
+				this.form.file_url = res.data.fileUrl
+				this.form.file_name = res.data.fileName
+				const result = await this.$http.post('saveTestFile', {
+					sample_id: sample_id
+				})
+				if (result.data.code == 0) {
+					that.formjc = result.data.data
+				}
+			},
+			//下载检测报告
+			download() {
+				htmlToPdf.downloadPDF(document.querySelector('#pdf'), '检测报告')
+			},
+			//生成检测报告pdf
+			async creatpdf(sample_id) {
+				var that = this
+				that.dialogVisible2 = true
+				// async getSampleDetail() {
+				const result = await this.$http.post('getSampleDetail', {
+					sample_id: sample_id
+				})
+				if (result.data.code == 0) {
+					that.formjc = result.data.data
+				}
+				console.log(that.formjc)
+				const res = await this.$http.post('getTestValue', {
+					sample_id: sample_id
+				})
+				if (res.data.code == 0) {
+					that.resultjc = res.data.data.result_detail
+				}
+				console.log(that.resultjc)
+				// },
+
+			},
+			async onSubmit() {
+				console.log(this.testPesticides)
+				for (let i = 0; i < this.testPesticides.length; i++) {
+					this.testPesticides[i]['unit'] = 'mg/kg'
+					console.log(this.testPesticides[i]['state_value'])
+					if (this.testPesticides[i]['state_value'] === 'ND') {
+						if (this.testPesticides[i]['test_value'] !== 'ND') {
+							this.testPesticides[i]['test_result'] = '不合格'
+						}
+					} else {
+						if (this.testPesticides[i]['test_value'] <= this.testPesticides[i]['state_value']) {
+							this.testPesticides[i]['test_result'] = '合格'
+						} else if (this.testPesticides[i]['test_value'] > this.testPesticides[i]['state_value']) {
+							this.testPesticides[i]['test_result'] = '不合格'
+						}
+					}
+					delete this.testPesticides[i]['test_model_id']
+				}
+
+
+				var that = this
+				const result = await this.$http.post("saveSamplePesticides", {
+					pesticides: that.testPesticides,
+					sample_id: that.check_id
+				});
+				if (result.data.code == 0) {
+					this.$message({
+						type: 'success',
+						message: '检测成功!'
+					});
+					that.inputCheckShow = false
+					that.getSampleList()
+				} else {
+					this.$message({
+						type: 'error',
+						message: result.data.message
+					});
+					that.inputCheckShow = false
+				}
+			},
+			async check(id, name) {
+				this.inputCheckShow = true
+
+				this.check_id = id,
+				this.check_name = name
+				console.log(this.check_id)
+				console.log(this.check_name)
+				var that = this
+				const {
+					data: res
+				} = await this.$http.post("getTestPesticides", {
+					sample_id: id
+				});
+				that.testPesticides = res.data
+				console.log(that.testPesticides)
+			},
+			handleClick(tab, event) {
+				console.log(tab, event);
+			},
+			// 获取检测单列表
+			async getTestList(id){
+				this.checkTestList = true
+				console.log(id)
+				// for (var key in this.queryInfo) {
+				// 	if (this.queryInfo[key] == '') {
+				// 		delete this.queryInfo[key]
+				// 	}
+				// }
+				// this.queryInfo['underTake_id'] = id
+				this.underInfo['task_id'] = this.task_id
+				this.underInfo['unit_id'] = id
+
+				console.log(this.underInfo)
+				const {
+					data: res
+				} = await this.$http.post("getTaskDetail", this.underInfo);
+				
+				// console.log(res)
+				this.tableData1 = res.data.rows
+				console.log(this.tableData)
+				this.testListTotal = res.data.total
+				
+			},
+			// 获取抽样单列表
+			async getSampleList(id) {
+				// console.log(id2)
+				for (var key in this.queryInfo) {
+					if (this.queryInfo[key] == '') {
+						delete this.queryInfo[key]
+					}
+				}
+				this.queryInfo['task_id'] = this.task_id
+				this.queryInfo['undertake_id'] = id
+				
+				const {
+					data: res
+				} = await this.$http.post("getSampleList", this.queryInfo);
+				// console.log(res)
+				this.tableData = res.data.rows
+				console.log(this.tableData)
+				for (let i = 0; i < this.tableData.length; i++) {
+					if (this.tableData[i].status == '0') {
+						this.tableData[i].status = '未上报'
+					} else {
+						this.tableData[i].status = '已上报'
+					}
+					if (this.tableData[i].jc_value_id == null) {
+						this.tableData[i].test_result = '暂未检测'
+					} else {
+						if (this.tableData[i].test_result == '0') {
+							this.tableData[i].test_result = '不合格'
+						} else if (this.tableData[i].test_result == '1') {
+							this.tableData[i].test_result = '合格'
+						}
+					}
+					if (this.tableData[i].test_status == '0') {
+						this.tableData[i].test_status = '未上报'
+					} else if (this.tableData[i].test_status == '1') {
+						this.tableData[i].test_status = '已上报'
+					}
+
+				}
+				this.total = res.data.total
+				this.getSampleListDialog = true
+			},
+			// 跳转到填写抽样单
+			inputSample() {
+				this.activeName = 'second'
+			},
+			// 填报抽样单
+			input(id) {
+				console.log(id)
+				// // console.log(this.currentRow.id)
+				// if(this.currentRow == null){
+				// 	this.$message('请选中一条表格数据');
+				// 	return
+				// }
+						this.$router.push({
+					name: 'inputSample',
+					params: {
+						task_id: this.readForm.taskInfo.id,
+						under_id:id
+					}
+				})
+				// }
+				// if(isset(this.currentRow.id)){
+				// 	this.under_id=this.currentRow.id
+				// }
+			
+				// console.log(this.currentRow.id)
+			},
+			// 返回
+			back() {
+				var that = this
+				this.$router.push({
+					name: 'setTaskcd',
+					params: {
+						id: that.id
+					}
+				})
+			},
+			// 上传抽样信息
+			async appear() {
+				let that = this
+				// that.orgs = that.multipleSelection
+				console.log(that.multipleSelection)
+				const result = await this.$http.post('setSampleStatus', that.multipleSelection)
+				// 判断业务逻辑
+				if (result.data.code == 0) {
+					// 判断业务逻辑
+					if (result.data.code == 0) {
+						this.$message({
+							type: 'success',
+							message: '上报抽样信息成功'
+						})
+						this.getSampleList()
+					}
+				}
+			},
+			// 多选删除抽样信息
+			async delAll() {
+				let that = this
+				// that.orgs = that.multipleSelection
+				console.log(that.multipleSelection)
+				const result = await this.$http.post('delSample', that.multipleSelection)
+				// 判断业务逻辑
+				if (result.data.code == 0) {
+					this.$message({
+						type: 'success',
+						message: '删除成功'
+					})
+					this.getSampleList()
+				}
+			},
+			/** 修复当用户在大于1的分页进行数据搜索没有返回值的问题 */
+			setPageNum() {
+				this.queryInfo.pageNum = 1
+				this.getSampleList()
+			},
+			setSelectedRow() {
+				// 设置当前页已选项
+				this.hander = true
+				this.tableData.forEach(item => {
+					if (this.list.includes(item[this.uniqueKey])) {
+						this.$refs.multipleTable.toggleRowSelection(item, true)
+					}
+				})
+				this.hander = false
+			},
+
+			/** 监听每页显示多少数据的改变 */
+			handleSizeChange(newSize) {
+				this.queryInfo.pageSize = newSize
+				this.getSampleList()
+			},
+
+			/** 监听页码的改变 */
+			handleCurrentChange(newPage) {
+				this.queryInfo.pageNum = newPage
+				this.getSampleList()
+			},
+			/** 监听每页显示多少数据的改变 */
+			handleSizeChange1(newSize) {
+				this.unitInfo.pageSize = newSize
+				this.getTestList()
+			},
+
+			/** 监听页码的改变 */
+			handleCurrentChange1(newPage) {
+				this.unitInfo.pageNum = newPage
+				this.getTestList()
+			},
+			// 批量勾选
+			handleSelectionChange(val) {
+				this.multipleSelection = val
+				console.log(this.multipleSelection)
+				if (this.hander) return false
+				// this.setSelectRows() // 处理选中的方法
+			},
+			// 跳转到查看抽样单详情
+			sampleDetail(id) {
+				console.log(id)
+				this.$router.push({
+					name: 'sampleDetail',
+					params: {
+						id: id
+					}
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="less" scoped>
+	.el-breadcrumb {
+		margin-bottom: 20px;
+	}
+
+	// .el-form-item {
+	// 	margin-bottom: 0px;
+	// }
+
+	.el-select {
+		width: 210px;
+		height: 100%;
+	}
+
+	.select {
+		display: flex;
+		flex-direction: row;
+		margin-left: 10px;
+	}
+
+	// .el-form {
+	// 	margin-left: 35%;
+	// }
+
+	// .el-form-item {
+	// 	// margin-bottom: 8px;
+	// 	margin: 0 auto;
+	// }
+
+	// .labelItem /deep/ .el-form-item__label {
+	// 	// width: 80px;
+	// 	text-align: center;
+	// 	vertical-align: middle;
+	// 	float: left;
+	// 	font-size: 14px;
+	// 	color: #606266;
+	// 	font-weight: bold;
+	// 	// line-height: 40px;
+	// 	padding: 0 20px 0 0;
+	// 	-webkit-box-sizing: border-box;
+	// 	box-sizing: border-box;
+	// }
+
+	.demonstration {
+		margin: 20px;
+	}
+
+	// .el-form-item__content {
+	// 	width: 200px;
+	// }
+
+	.footer {
+		margin-top: 20px;
+		margin-left: 45%;
+	}
+	.el-table{
+		margin-top: 20px;
+	}
+	.el-pagination {
+		margin-top: 25px;
+	}
+</style>

+ 286 - 143
src/components/jc/setTaskcd.vue

@@ -8,9 +8,25 @@
 			<el-breadcrumb-item>基本信息</el-breadcrumb-item>
 		</el-breadcrumb>
 
+		<!-- <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
+			<el-tab-pane label="任务详情" name="taskDetail">
+			</el-tab-pane>
+
+			<el-tab-pane label="抽样" name="sampleDetail">
+				<sampleDetailcd v-if="activeName == 'sampleDetail'" ref="sampleDetail"></sampleDetailcd>
+			</el-tab-pane>
+
+			<el-tab-pane label="检测" name="testDetail">
+			</el-tab-pane>
+
+			<el-tab-pane label="报告上传" name="reportDetail">
+			</el-tab-pane>
+		</el-tabs> -->
+
+
 		<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
 			<el-tab-pane label="任务详情" name="first">
-				<el-descriptions class="margin-top" title="例行监测任务" :column="2" :size="size" border>
+				<el-descriptions class="margin-top" title=" " :column="2" :size="size" border>
 					<el-descriptions-item>
 						<template slot="label" prop="releaser">
 							发布单位
@@ -93,16 +109,16 @@
 						<!-- <span v-for="item in readForm.pesticides">{{item.test_name}}、</span> -->
 					</el-descriptions-item>
 				</el-descriptions>
-				<el-table :data="underTask" border stripe highlight-current-row  @current-change="handlecyCurrentChange" style="width: 100%"
+				<!-- <el-table :data="underTask" border stripe highlight-current-row  @current-change="handlecyCurrentChange" style="width: 100%"
 					:row-style="rowStyle" :cell-style="cellStyle">
 					<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>
-				<div class="footer">
+				</el-table> -->
+				<!-- <div class="footer">
 					<el-button type="success" size="mini" @click="input()">填报抽样单</el-button>
-					<!-- <el-button type="success" size="mini" @click="next">导出总览</el-button> -->
-					<!-- <el-button type="success" size="mini" @click="back">返回</el-button> -->
-				</div>
+					<el-button type="success" size="mini" @click="next">导出总览</el-button>
+					<el-button type="success" size="mini" @click="back">返回</el-button>
+				</div> -->
 			</el-tab-pane>
 
 			<el-tab-pane label="抽样" name="second">
@@ -110,7 +126,7 @@
 
 				<!-- 头部搜索栏 -->
 				
-					<el-form style="display: flex; flex-direction: column;" ref="form2" :model="queryInfo">
+					<!-- <el-form style="display: flex; flex-direction: column;" ref="form2" :model="queryInfo">
 						<el-row style="width: 75%;">
 							<el-col :span="6">
 						<el-form-item label="样品名称" class="select" size="small" prop="sample_name">
@@ -124,14 +140,14 @@
 							</el-col>
 							<el-col :span="6">
 						<el-form-item label="受检单位" class="select" size="small" prop="units_name">
-							<el-input v-model="queryInfo.units_name"></el-input>
+							<el-input v-model="queryInfo.unit_test_name"></el-input>
 						</el-form-item>
 						</el-col>
 						</el-row>
 						<el-row style="width: 75%;">
 							<el-col :span="6">
 						<el-form-item label="抽样单位" class="select" size="small" prop="sample_unit_name">
-							<el-input v-model="queryInfo.sample_unit_name"></el-input>
+							<el-input v-model="queryInfo.unit_sample_name"></el-input>
 						</el-form-item>
 						    </el-col>
 							<el-col :span="6">
@@ -148,78 +164,93 @@
 							<el-button style="height: 32px;margin-left: 10px;" size="mini" type="success"
 							@click="searchData()">查询
 						</el-button>
-						<!-- 重置 -->
+					
 						<el-button style="height: 32px;margin-left: 5px;" size="mini" type="success" @click="resetForm('form2')">
 							重置
 						</el-button>
 						</el-col>
 						</el-row>
-					</el-form>
+					</el-form> -->
 				<el-row style="margin-right: 0px;">
-					<el-form style="display: flex; flex-direction: row;">
-						<!-- 	<el-form-item label="产地" class="select">
-							<el-select v-model="value" placeholder="请选择省份" size="small">
-								<el-option v-for="item in options" :key="item.value" :label="item.label"
-									:value="item.value">
-								</el-option>
-							</el-select>
-							<el-select v-model="value" placeholder="请选择城市" size="small">
-								<el-option v-for="item in options" :key="item.value" :label="item.label"
-									:value="item.value">
-								</el-option>
-							</el-select>
-							<el-select v-model="value" placeholder="请选择区/县" size="small">
-								<el-option v-for="item in options" :key="item.value" :label="item.label"
-									:value="item.value">
-								</el-option>
-							</el-select>
-						</el-form-item> -->
-						<!-- 查询 -->
-
-					</el-form>
-					<div style="display: flex;flex-direction: row;float: right;">
-						<el-button type="primary" size="small" plain icon="el-icon-plus" @click="input()">填报抽样单
-						</el-button>
-						<el-button type="primary" size="small" plain icon="el-icon-edit-outline" @click="appear">上报抽样信息
-						</el-button>
-						<!-- <el-button type="primary" size="small" plain icon="el-icon-scissors" @click="repeal()">导出</el-button> -->
-						<el-button type="primary" size="small" plain icon="el-icon-delete" @click="delAll">删除
-						</el-button>
-						<!-- <el-button type="primary" size="small" plain icon="el-icon-download">导出</el-button> -->
-					</div>
-				</el-row>
-
-				<!--  表格数据区域-->
-				<el-table ref="multipleTable" :data="tableData" border stripe highlight-current-row
-					@selection-change="handleSelectionChange" style="width: 100%" :row-style="rowStyle"
-					:cell-style="cellStyle">
-					<el-table-column type="selection" 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.label" v-for="table in tableHeader" :label="table.label"
+				
+				<el-table :data="sampleTask" border stripe highlight-current-row  @current-change="handlecyCurrentChange" style="width: 100%"
+					:row-style="rowStyle" :cell-style="cellStyle">
+					<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 type="success" size="small" plain @click="sampleDetail(scope.row.sample_id)">查看
-							</el-button>
-						</template>
+					<template slot-scope="scope">
+						<el-button style="margin:5px 0" type="success" size="small" plain @click="input(scope.row.id)">填报抽样单
+						</el-button>
+						<!-- <el-button type="success" size="small" plain @click="sampleDetail(scope.row.sample_id)">查看 -->
+						<el-button style="margin-bottom:5px" type="success" size="small" @click="getSampleList(scope.row.id)">查看抽样单列表
+						</el-button>
+							<!-- <el-button type="success" size="small" plain @click="sampleDetail(scope.row.sample_id)" @focus="getSampleListDialog = true">查看抽样单列表
+						</el-button> -->
+						<!-- <el-button type="primary" size="small" plain icon="el-icon-edit-outline" @click="appear">上报抽样信息
+						</el-button> -->
+					</template>
 					</el-table-column>
 				</el-table>
-				<!--    分页器区域-->
-				<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+
+				<!-- 抽样单列表对话框 -->
+			<el-dialog title="抽样单列表" :visible.sync="getSampleListDialog" width="80%" :close-on-click-modal="false" class="dialogItem">
+				<el-form v-if="getSampleListDialog">
+					<!--  表格数据区域-->
+					<el-table ref="multipleTable" :data="tableData" border stripe highlight-current-row
+						@selection-change="handleSelectionChange" style="width: 100%" :row-style="rowStyle"
+						:cell-style="cellStyle">
+						<el-table-column type="selection" 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.label" v-for="table in tableHeader" :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 type="success" size="small" plain @click="sampleDetail(scope.row.sample_id)">查看
+								</el-button>
+								<el-button type="primary" size="small" plain icon="el-icon-edit-outline" @click="upCydItem(scope.row.sample_id)">上报抽样信息
+								</el-button>
+							</template>
+						</el-table-column>
+					</el-table>
+					<!--    分页器区域-->
+					<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
 					:current-page="queryInfo.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo.pageSize"
 					layout="total, sizes, prev, pager, next, jumper" :total="total" background />
-			</el-tab-pane>
+				</el-form>
+			</el-dialog>
+		</el-row>	
+		</el-tab-pane>
 
 			<el-tab-pane label="检测" name="third">
 			<!-- <el-tab-pane  v-if="checkShow==true"  label="检测" name="third"> -->
-
+			<el-table :data="underTask" border stripe highlight-current-row  @current-change="handlecyCurrentChange" style="width: 100%"
+					:row-style="rowStyle" :cell-style="cellStyle">
+				<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 type="success" size="small" plain @click="input(scope.row.id)">填报抽样单
+					</el-button> -->
+					<!-- <el-button type="success" size="small" plain @click="sampleDetail(scope.row.sample_id)">查看 -->
+					<el-button style="margin:5px 0" type="success" size="small" @click="getJcdList(scope.row.id)">查看检测单列表
+					</el-button>
+						<!-- <el-button type="success" size="small" plain @click="sampleDetail(scope.row.sample_id)" @focus="getSampleListDialog = true">查看抽样单列表
+					</el-button> -->
+					<!-- <el-button type="primary" size="small" plain icon="el-icon-edit-outline" @click="appearTest">上报检测信息
+					</el-button> -->
+				</template>
+				</el-table-column>
+			</el-table>
+			<!-- 查看检测单列表弹框 -->
+			<el-dialog title="检测单列表" :visible.sync="checkTestList" width="70%" :close-on-click-modal="false"
+				class="dialogItem">
 				<!--  表格数据区域-->
-				<el-table :data="tableData" border stripe highlight-current-row style="width: 100%"
+				<el-table :data="tableData1" border stripe highlight-current-row style="width: 100%"
 					:row-style="rowStyle" :cell-style="cellStyle">
 					<!-- <el-table-column type="selection" width="50"></el-table-column> -->
 					<el-table-column label="序号" width="50px">
@@ -235,7 +266,7 @@
 							<el-button type="success" size="mini" v-if="scope.row.jc_value_id==null" plain
 								@click="check(scope.row.sample_id,scope.row.sample_name)">检测</el-button>
 							<el-button type="primary" v-else size="mini" plain @click="update(scope.row)">修改</el-button>
-							<el-button type="primary" size="mini" plain @click="upcheck(scope.row.sample_id)">上报
+							<el-button type="primary" size="mini" plain @click="upJcdItem(scope.row.sample_id)">上报
 							</el-button>
 							<el-button type="primary" size="mini" plain @click="creatpdf(scope.row.sample_id)">生成检测报告
 							</el-button>
@@ -244,10 +275,13 @@
 				</el-table>
 
 				<!--    分页器区域-->
-				<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
-					:current-page="queryInfo.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo.pageSize"
-					layout="total, sizes, prev, pager, next, jumper" :total="total" background />
+				<el-pagination @size-change="handleSizeChange1" @current-change="handleCurrentChange1"
+					:current-page="underInfo.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="underInfo.pageSize"
+					layout="total, sizes, prev, pager, next, jumper" :total="testListTotal" background />
+			</el-dialog>
 			</el-tab-pane>
+			
+
 			<el-dialog title="填写检测单" :visible.sync="inputCheckShow" width="70%" :close-on-click-modal="false"
 				class="dialogItem">
 				<span class="demonstration">样品编码:{{check_id}}</span>
@@ -462,6 +496,8 @@
 				},
 				formjc: {},
 				dialogVisible2: false,
+				getSampleListDialog: false,
+				checkTestList: false,
 				activeName: 'first',
 				id: 0,
 				productNameText: '',
@@ -469,19 +505,27 @@
 				readForm: {
 					
 				},
+				sampleTask: [],
 				underTask: [],
+				unitTaskTotal: '0',
 				underTasktotal: '0',
+				testListTotal: '0',
 				queryInfo: {
 					pageNum: 1,
 					pageSize: 10,
 					task_id: '',
 					sample_id: '',
-					units_name: '',
+					unit_test_name: '',
 					sample_name: '',
 					sample_data: '',
-					sample_unit_name: '',
+					unit_sample_name: '',
 					sample_ground: '',
 				},
+				underInfo:{
+					pageNum: 1,
+					pageSize: 10,
+					
+				},
 				releaserInfo:{
 						groupname: '',
 						rymc:'',
@@ -530,7 +574,7 @@
 					},
 					{
 						label: '受检单位',
-						prop: 'unitTest.unit_name',
+						prop: 'unit_test_name',
 						width: 180
 					},
 					{
@@ -558,16 +602,16 @@
 					},
 					{
 						label: '受检单位',
-						prop: 'unitTest.unit_name',
+						prop: 'units_id',
 						width: 180
 					},
 					{
 						label: '抽样单位',
-						prop: 'unitSample.unit_name',
+						prop: 'undertake.bear_name',
 						width: 180
 					}, {
 						label: '检测单位',
-						prop: 'units_name',
+						prop: 'undertake.check_name',
 						width: 180
 					}, {
 						label: '判定结果',
@@ -586,6 +630,7 @@
 				}],
 				// 数据表格数据
 				tableData: [],
+				tableData1: [],
 				options: [],
 				task_id: '',
 				multipleSelection: null,
@@ -653,8 +698,6 @@
 				sampleShow: false, //是否展示抽样卡片
 				checkShow: false, //是否展示检测卡片
 				currentRow: null,
-				
-
 				 //选中机构地域表格数据项
 			};
 		},
@@ -667,9 +710,11 @@
 
 
 			this.getTaskDetail()
-			this.getSampleList()
+			// this.getJcdList()
 			// this.getmodelList()
 			// this.getUnderTask()
+			this.getSampleTaskList()
+			this.getCheckTaskList()
 		},
 
 		methods: {
@@ -730,37 +775,79 @@
 				var that = this
 				const {
 					data: res
-				} = await this.$http.post("getTaskDetail", {
+				} = await this.$http.post("getTaskInfo", {
 					task_id: that.task_id,
 					pageNum: that.queryInfo.pageNum,
 					pageSize: that.queryInfo.pageSize
 				});
-				console.log(res.data.product)
-				if (res.data.product.length > 0) {
-					if (res.data.product[0].type_id == '1') {
-						res.data.model_type = '种植业'
-					} else if (res.data.product[0].type_id == '2') {
-						res.data.model_type = '畜牧业'
-					} else if (res.data.product[0].type_id == '3') {
-						res.data.model_type = '渔业'
-					} else {
-						res.data.model_type = '其他'
-					}
-				}
+				
 				that.readForm = res.data
 				console.log(that.readForm)
 				that.productNameText = that.readForm.product.map(el => el.product_name).join('、 ')
 				that.pesticidesNameText = that.readForm.pesticides.map(el => el.test_name).join('、 ')
-				that.underTask = res.data.underTaskList.rows
-				console.log(that.underTask)
-				that.underTasktotal = res.data.underTaskList.total
+				console.log(res.data.modelInfo)
+			
+					if (res.data.modelInfo.type_id == '1') {
+						that.readForm.model_type = '种植业'
+					} else if (res.data.modelInfo.type_id == '2') {
+						that.readForm.model_type = '畜牧业'
+					} else if (res.data.modelInfo.type_id == '3') {
+						that.readForm.model_type = '渔业' 
+
+					} else {
+						that.readForm.model_type = '其他'
+					}
+				
+				console.log(that.readForm.model_type)
+				// that.underTask = res.data.underTaskList.rows
+				// that.unitTask = res.data.unitTaskList.rows
+				// console.log(that.underTask)
+				// console.log(that.unitTask)
+				// that.underTasktotal = res.data.underTaskList.total
+				// that.unitTasktotal = res.data.unitTaskList.total
+
 				// 抽检不分离
-				if (that.taskInfo.is_divide == 0) {
-					this.sampleShow = true
-					this.checkShow = true
+				// if (that.taskInfo.is_divide == 0) {
+				// 	this.sampleShow = true
+				// 	this.checkShow = true
+				// }
+			},
+
+			//抽样标签详情
+			async getSampleTaskList(){
+				for (var key in this.queryInfo) {
+				if (this.queryInfo[key] == '') {
+					delete this.queryInfo[key]
+					}
 				}
+				var that = this
+				const {
+					data: res
+				} = await this.$http.post("getSampleTaskList", {
+					task_id: that.task_id,
+					// pageNum: that.queryInfo.pageNum,
+					// pageSize: that.queryInfo.pageSize
+				});
+				console.log(res)
+				that.sampleTask = res.data.rows
+				console.log(that.sampleTask)
 			},
 
+			//检测标签详情
+			async getCheckTaskList(){
+				var that = this
+				const {
+					data: res
+				} = await this.$http.post("getCheckTaskList", {
+					task_id: that.task_id,
+					// pageNum: that.queryInfo.pageNum,
+					// pageSize: that.queryInfo.pageSize
+				});
+				console.log(res)
+				that.underTask = res.data.rows
+				console.log(that.sampleTask)
+			},
+			
 			// 上传成功
 			async uploadSuccess(res) {
 				console.log(res.data)
@@ -839,34 +926,77 @@
 					that.inputCheckShow = false
 				}
 			},
-			async check(id, name) {
+			//检测单列表-检测
+			async check(id) {
 				this.inputCheckShow = true
 
-				this.check_id = id,
-				this.check_name = name
-				console.log(this.check_id)
-				console.log(this.check_name)
 				var that = this
 				const {
 					data: res
-				} = await this.$http.post("getTestPesticides", {
+				} = await this.$http.post("getJcdObjectItem", {
 					sample_id: id
 				});
 				that.testPesticides = res.data
 				console.log(that.testPesticides)
 			},
+			//检测单列表-上报
+			async upJcdItem(id){
+				var that = this
+				const result = await this.$http.post('upJcdItem', {
+					sample_id: id
+				})
+				console.log(result.data.data)
+				// this.getSampleList()
+					// 判断业务逻辑
+					if (result.data.code == 0) {
+						this.$message({
+							type: 'success',
+							message: '上报抽样信息成功'
+						})
+						
+						this.getJcdList(result.data.data)
+					}
+			},
 			handleClick(tab, event) {
 				console.log(tab, event);
 			},
+			// 获取检测单列表
+			async getJcdList(id){
+				this.checkTestList = true
+				console.log(id)
+				// for (var key in this.queryInfo) {
+				// 	if (this.queryInfo[key] == '') {
+				// 		delete this.queryInfo[key]
+				// 	}
+				// }
+				// this.queryInfo['underTake_id'] = id
+				// this.underInfo['task_id'] = this.task_id
+				this.underInfo['underTake_id'] = id
 
-			// 获取抽样单列表
-			async getSampleList() {
-								for (var key in this.queryInfo) {
-					if (this.queryInfo[key] == '') {
-						delete this.queryInfo[key]
-					}
+				console.log(this.underInfo)
+				const {
+					data: res
+				} = await this.$http.post("getJcdList", this.underInfo);
+				
+				console.log(res.data)
+			
+				this.tableData1 = res.data.rows
+				if(res.data.rows.test_status = '0'){
+					this.tableData1.test_status = '未上报'
+				}else{
+					this.tableData1.test_status = '已上报'
 				}
+				console.log(this.tableData1)
+				this.testListTotal = res.data.total
+				
+			},
+			// 获取抽样单列表
+			async getSampleList(id) {
+				console.log(id)
+			
 				this.queryInfo['task_id'] = this.task_id
+				this.queryInfo['undertake_id'] = id
+				
 				const {
 					data: res
 				} = await this.$http.post("getSampleList", this.queryInfo);
@@ -874,46 +1004,46 @@
 				this.tableData = res.data.rows
 				console.log(this.tableData)
 				for (let i = 0; i < this.tableData.length; i++) {
-					if (this.tableData[i].status == '0') {
+					if (this.tableData[i].sample_status == '0') {
 						this.tableData[i].status = '未上报'
 					} else {
 						this.tableData[i].status = '已上报'
 					}
-					if (this.tableData[i].jc_value_id == null) {
-						this.tableData[i].test_result = '暂未检测'
-					} else {
-						if (this.tableData[i].test_result == '0') {
-							this.tableData[i].test_result = '不合格'
-						} else if (this.tableData[i].test_result == '1') {
-							this.tableData[i].test_result = '合格'
-						}
-					}
-					if (this.tableData[i].test_status == '0') {
-						this.tableData[i].test_status = '未上报'
-					} else if (this.tableData[i].test_status == '1') {
-						this.tableData[i].test_status = '已上报'
-					}
-
+					// if (this.tableData[i].jc_value_id == null) {
+					// 	this.tableData[i].test_result = '暂未检测'
+					// } else {
+					// 	if (this.tableData[i].test_result == '0') {
+					// 		this.tableData[i].test_result = '不合格'
+					// 	} else if (this.tableData[i].test_result == '1') {
+					// 		this.tableData[i].test_result = '合格'
+					// 	}
+					// }
+					// if (this.tableData[i].test_status == '0') {
+					// 	this.tableData[i].test_status = '未上报'
+					// } else if (this.tableData[i].test_status == '1') {
+					// 	this.tableData[i].test_status = '已上报'
+					// }
 				}
 				this.total = res.data.total
+				this.getSampleListDialog = true
 			},
 			// 跳转到填写抽样单
 			inputSample() {
 				this.activeName = 'second'
 			},
 			// 填报抽样单
-			input() {
-				// console.log(this.under_id)
+			input(id) {
+				console.log(id)
 				// // console.log(this.currentRow.id)
-				if(this.currentRow == null){
-					this.$message('请选中一条表格数据');
-					return
-				}
+				// if(this.currentRow == null){
+				// 	this.$message('请选中一条表格数据');
+				// 	return
+				// }
 						this.$router.push({
 					name: 'inputSample',
 					params: {
 						task_id: this.readForm.taskInfo.id,
-						under_id: this.currentRow.id
+						under_id:id
 					}
 				})
 				// }
@@ -934,22 +1064,24 @@
 				})
 			},
 			// 上传抽样信息
-			async appear() {
+			async upCydItem(id) {
 				let that = this
 				// that.orgs = that.multipleSelection
-				console.log(that.multipleSelection)
-				const result = await this.$http.post('setSampleStatus', that.multipleSelection)
-				// 判断业务逻辑
-				if (result.data.code == 0) {
+				// console.log(that.multipleSelection)
+				const result = await this.$http.post('upCydItem', {
+					sample_id: id
+				})
+				console.log(result.data.data)
+				// this.getSampleList()
 					// 判断业务逻辑
 					if (result.data.code == 0) {
 						this.$message({
 							type: 'success',
 							message: '上报抽样信息成功'
 						})
-						this.getSampleList()
+						
+						this.getSampleList(result.data.data)
 					}
-				}
 			},
 			// 多选删除抽样信息
 			async delAll() {
@@ -969,7 +1101,7 @@
 			/** 修复当用户在大于1的分页进行数据搜索没有返回值的问题 */
 			setPageNum() {
 				this.queryInfo.pageNum = 1
-				this.getSampleList()()
+				this.getSampleList()
 			},
 			setSelectedRow() {
 				// 设置当前页已选项
@@ -985,13 +1117,24 @@
 			/** 监听每页显示多少数据的改变 */
 			handleSizeChange(newSize) {
 				this.queryInfo.pageSize = newSize
-				this.getSampleList()()
+				this.getSampleList()
 			},
 
 			/** 监听页码的改变 */
 			handleCurrentChange(newPage) {
 				this.queryInfo.pageNum = newPage
-				this.getSampleList()()
+				this.getSampleList()
+			},
+			/** 监听每页显示多少数据的改变 */
+			handleSizeChange1(newSize) {
+				this.unitInfo.pageSize = newSize
+				this.getJcdList()
+			},
+
+			/** 监听页码的改变 */
+			handleCurrentChange1(newPage) {
+				this.unitInfo.pageNum = newPage
+				this.getJcdList()
 			},
 			// 批量勾选
 			handleSelectionChange(val) {

+ 6 - 1
src/router/index.js

@@ -129,7 +129,12 @@ const routes = [{
 					path: '/jc/setTask',
 					name:'setTask',
 					component: () => import('../components/jc/setTask')
-			}
+			},
+			// {
+			// 		path: '/jc/sampleDetailcd',
+			// 		name:'sampleDetailcd',
+			// 		component: () => import('../components/jc/sampleDetailcd')
+			// }
 		]
 	},{
 		path: '/pdf',