瀏覽代碼

抽样单调整

jiangyu 3 年之前
父節點
當前提交
6ada419324
共有 4 個文件被更改,包括 211 次插入197 次删除
  1. 2 2
      src/components/admin/addSpecialTask.vue
  2. 160 162
      src/components/jc/inputSample.vue
  3. 15 12
      src/components/jc/setTask.vue
  4. 34 21
      src/components/jc/setTaskcd.vue

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

@@ -45,9 +45,9 @@
 					</el-date-picker>
 				</el-col>
 			</el-form-item>
-			<el-form-item label="发布单位" required>
+			<!-- <el-form-item label="发布单位" required>
 				<el-input v-model="groupname" :disabled="true"></el-input>
-			</el-form-item>
+			</el-form-item> -->
 			<el-form-item label="牵头单位" required>
 				<el-input v-model="form.main_unit" @focus="getTestListShow = true"></el-input>
 			</el-form-item>

+ 160 - 162
src/components/jc/inputSample.vue

@@ -16,9 +16,9 @@
 	  江苏省苏州市吴中区吴中大道 1188 号
 	</el-descriptions-item> -->
 <el-descriptions  title="安徽省农业农村厅 农产品质量安全 例行检测 抽样单" :column="2" border style="margin-top:20px" :contentStyle="{'text-align': left}">
-	<el-descriptions-item label="*样品名称" prop="sample_name" class="labelItem" size="mini" required >
+	<el-descriptions-item label="*样品名称" prop="cyd_data.sample_name" class="labelItem" size="mini" required >
 		<!-- <el-col :span="12"> -->
-		<el-select v-model="form.sample_name" clearable style="width:60%">
+		<el-select v-model="cyd_data.sample_name" clearable style="width:60%">
 				<el-option v-for="item in sampleList"
 				:key="item.product_id" 
 				:label="item.product_name"
@@ -27,77 +27,77 @@
 		</el-select>
 		<!-- </el-col> -->
 	</el-descriptions-item>
-	<el-descriptions-item label="样品编码" prop="sample_id" class="labelItem" style="" size="mini">
-		<el-input v-model="form.sample_id" disabled>
+	<el-descriptions-item label="样品编码" prop="cyd_data.sample_id" class="labelItem" style="" size="mini">
+		<el-input v-model="cyd_data.sample_id" disabled>
 			<el-button slot="append" @click="createCode">生成</el-button>
 		</el-input>
 	</el-descriptions-item>
-	<el-descriptions-item label="商标" prop="brand" class="labelItem" size="mini">
-		<el-input v-model="form.brand"></el-input>
+	<el-descriptions-item label="商标" prop="cyd_data.brand" class="labelItem" size="mini">
+		<el-input v-model="cyd_data.brand"></el-input>
 	</el-descriptions-item>
-	<el-descriptions-item label="包装" prop="ispack" class="labelItem" style="" size="mini">
-		<el-radio v-model="form.ispack" label="有">有</el-radio>
-		<el-radio v-model="form.ispack" label="无">无</el-radio>
+	<el-descriptions-item label="包装" prop="cyd_data.ispack" class="labelItem" style="" size="mini">
+		<el-radio v-model="cyd_data.ispack" label="有">有</el-radio>
+		<el-radio v-model="cyd_data.ispack" label="无">无</el-radio>
 	</el-descriptions-item>
-	<el-descriptions-item label="型号规格" prop="type" class="labelItem" size="mini">
-		<el-input v-model="form.type"></el-input>
+	<el-descriptions-item label="型号规格" prop="cyd_data.type" class="labelItem" size="mini">
+		<el-input v-model="cyd_data.type"></el-input>
 	</el-descriptions-item>
-	<el-descriptions-item label="执行标准" prop="standard" class="labelItem" style="" size="mini">
-		<el-input v-model="form.standard"></el-input>
+	<el-descriptions-item label="执行标准" prop="cyd_data.standard" class="labelItem" style="" size="mini">
+		<el-input v-model="cyd_data.standard"></el-input>
 	</el-descriptions-item>
-	<el-descriptions-item label="*生产日期或批号" prop="production_date" class="labelItem" size="mini" required>
-		<el-input v-model="form.production_date"></el-input>
+	<el-descriptions-item label="*生产日期或批号" prop="cyd_data.production_date" class="labelItem" size="mini" required>
+		<el-input v-model="cyd_data.production_date"></el-input>
 	</el-descriptions-item>
-	<el-descriptions-item label="产地" prop="place" class="labelItem" style="" size="mini">
+	<el-descriptions-item label="产地" prop="cyd_data.place" class="labelItem" style="" size="mini">
 		<el-cascader  :options="options" v-model="selectedOptions" @change="handleChange" style="width:60%"></el-cascader>
 	</el-descriptions-item>
-	<el-descriptions-item label="*产品认证情况" prop="certicfie" class="labelItem" size="mini" required>
-		<el-radio v-model="form.certicfie" label="无公害农产品">无公害农产品</el-radio>
-							<el-radio v-model="form.certicfie" label="绿色食品">绿色食品</el-radio>
-							<el-radio v-model="form.certicfie" label="有机食品">有机食品</el-radio>
-							<el-radio v-model="form.certicfie" label="其他">其他</el-radio>
+	<el-descriptions-item label="*产品认证情况" prop="cyd_data.certicfie" class="labelItem" size="mini" required>
+		<el-radio v-model="cyd_data.certicfie" label="无公害农产品">无公害农产品</el-radio>
+							<el-radio v-model="cyd_data.certicfie" label="绿色食品">绿色食品</el-radio>
+							<el-radio v-model="cyd_data.certicfie" label="有机食品">有机食品</el-radio>
+							<el-radio v-model="cyd_data.certicfie" label="其他">其他</el-radio>
 	</el-descriptions-item>
-	<el-descriptions-item label="证书编号" prop="certifie_num" class="labelItem" style="" size="mini">
-		<el-input v-model="form.certifie_num"></el-input>
+	<el-descriptions-item label="证书编号" prop="cyd_data.certifie_num" class="labelItem" style="" size="mini">
+		<el-input v-model="cyd_data.certifie_num"></el-input>
 	</el-descriptions-item>
-	<el-descriptions-item label="*抽样数量" prop="sample_renum" class="labelItem" size="mini" required>
-		<el-input v-model="form.sample_renum" style="width:180px"></el-input>
-		<a> * 单位 </a><el-input v-model="form.sample_num_unit" clearable="true" style="width:180px"></el-input>
+	<el-descriptions-item label="*抽样数量" prop="cyd_data.sample_num" class="labelItem" size="mini" required>
+		<el-input v-model="cyd_data.sample_num" style="width:180px"></el-input>
+		<a> * 单位 </a><el-input v-model="cyd_data.sample_num_unit" clearable="true" style="width:180px"></el-input>
 	</el-descriptions-item>
-	<el-descriptions-item label="抽样基数" prop="sample_base" class="labelItem" size="mini" required>
-		<el-input v-model="form.sample_base" style="width:180px"></el-input>
-		<a> * 单位 </a><el-input v-model="form.sample_base_unit1" clearable="true" style="width:180px"></el-input>
+	<el-descriptions-item label="抽样基数" prop="cyd_data.sample_base" class="labelItem" size="mini" required>
+		<el-input v-model="cyd_data.sample_base" style="width:180px"></el-input>
+		<a> * 单位 </a><el-input v-model="cyd_data.sample_base_unit" clearable="true" style="width:180px"></el-input>
 	</el-descriptions-item>
-	<el-descriptions-item label="*抽样场所" prop="sample_ground" class="labelItem" size="mini" required >
-							<el-radio v-model="form.sample_ground" label="生产基地/企业">生产基地/企业</el-radio>
-							<el-radio v-model="form.sample_ground" label="屠宰场">屠宰场</el-radio>
-							<el-radio v-model="form.sample_ground" label="农贸市场">农贸市场</el-radio>
-							<el-radio v-model="form.sample_ground" label="批发市场">批发市场</el-radio>
-							<el-radio v-model="form.sample_ground" label="超市">超市</el-radio>
-							<el-radio v-model="form.sample_ground" label="其他">其他</el-radio>
+	<el-descriptions-item label="*抽样场所" prop="cyd_data.sample_ground" class="labelItem" size="mini" required >
+							<el-radio v-model="cyd_data.sample_ground" label="生产基地/企业">生产基地/企业</el-radio>
+							<el-radio v-model="cyd_data.sample_ground" label="屠宰场">屠宰场</el-radio>
+							<el-radio v-model="cyd_data.sample_ground" label="农贸市场">农贸市场</el-radio>
+							<el-radio v-model="cyd_data.sample_ground" label="批发市场">批发市场</el-radio>
+							<el-radio v-model="cyd_data.sample_ground" label="超市">超市</el-radio>
+							<el-radio v-model="cyd_data.sample_ground" label="其他">其他</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="units_name" class="labelItem" style="" size="mini" required>
-									<el-input v-model="form.units_name"></el-input>
+				<el-descriptions-item label="*单位名称" prop="unit_test.unit_name" class="labelItem" style="" size="mini" required>
+									<el-input v-model="unit_test.unit_name"></el-input>
 				</el-descriptions-item>
-				<el-descriptions-item label="*通讯地址" prop="address" class="labelItem" style="" size="mini" required>
-									<el-input v-model="form.address"></el-input>
+				<el-descriptions-item label="*通讯地址" prop="unit_test.address" class="labelItem" style="" size="mini" required>
+									<el-input v-model="unit_test.address"></el-input>
 				</el-descriptions-item>
-				<el-descriptions-item label="*法定代表人" prop="corporation" class="labelItem" style="" size="mini" required>
-									<el-input v-model="form.corporation"></el-input>
+				<el-descriptions-item label="*法定代表人" prop="unit_test.represent_name" class="labelItem" style="" size="mini" required>
+									<el-input v-model="unit_test.represent_name"></el-input>
 				</el-descriptions-item>
-				<el-descriptions-item label="*受检人" prop="user_name" class="labelItem" style="" size="mini" required>
-									<el-input v-model="form.user_name"></el-input>
+				<el-descriptions-item label="*受检人" prop="unit_test.user_name" class="labelItem" style="" size="mini" required>
+									<el-input v-model="unit_test.user_name"></el-input>
 				</el-descriptions-item>
-				<el-descriptions-item label="电话" prop="phone" class="labelItem" style="" size="mini">
-									<el-input v-model="form.phone"></el-input>
+				<el-descriptions-item label="电话" prop="unit_test.phone" class="labelItem" style="" size="mini">
+									<el-input v-model="unit_test.phone"></el-input>
 				</el-descriptions-item>
-				<el-descriptions-item label="传真" prop="fax" class="labelItem" style="" size="mini">
-							<el-input v-model="form.fax"></el-input>
+				<el-descriptions-item label="传真" prop="unit_test.fax" class="labelItem" style="" size="mini">
+							<el-input v-model="unit_test.fax"></el-input>
 				</el-descriptions-item>
 			</el-descriptions>
 		</el-descriptions-item>
@@ -106,27 +106,27 @@
 		<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="production_name" class="labelItem" style="" size="mini" required>
-				<el-input v-model="form.production_name"></el-input>
+			<el-descriptions-item label="*单位名称" prop="unit_production.production_name" class="labelItem" style="" size="mini" required>
+				<el-input v-model="unit_production.production_name"></el-input>
 			</el-descriptions-item>
-			<el-descriptions-item label="*通讯地址" prop="p_address" class="labelItem" style="" size="mini" required>
-				<el-input v-model="form.p_address"></el-input>
+			<el-descriptions-item label="*通讯地址" prop="unit_production.address" class="labelItem" style="" size="mini" required>
+				<el-input v-model="unit_production.address"></el-input>
 			</el-descriptions-item>
-			<el-descriptions-item label="邮编" prop="p_postcode" class="labelItem" style="" size="mini">
-				<el-input v-model="form.p_postcode"></el-input>
+			<el-descriptions-item label="邮编" prop="unit_production.postcode" class="labelItem" style="" size="mini">
+				<el-input v-model="unit_production.postcode"></el-input>
 			</el-descriptions-item>
-			<el-descriptions-item label="*联系人" prop="p_user_name" class="labelItem" style="" size="mini" required>
-				<el-input v-model="form.p_user_name"></el-input>
+			<el-descriptions-item label="*联系人" prop="unit_production.user_name" class="labelItem" style="" size="mini" required>
+				<el-input v-model="unit_production.user_name"></el-input>
 			</el-descriptions-item>
-			<el-descriptions-item label="电话" prop="p_phone" class="labelItem" style="" size="mini">
-				<el-input v-model="form.p_phone"></el-input>
+			<el-descriptions-item label="电话" prop="unit_production.phone" class="labelItem" style="" size="mini">
+				<el-input v-model="unit_production.phone"></el-input>
 			</el-descriptions-item>
-			<el-descriptions-item label="传真" prop="p_fax" class="labelItem" style="" size="mini">
-				<el-input v-model="form.p_fax"></el-input>
+			<el-descriptions-item label="传真" prop="unit_production.fax" class="labelItem" style="" size="mini">
+				<el-input v-model="unit_production.fax"></el-input>
 			</el-descriptions-item>
-			<el-descriptions-item label="生产方式" prop="production_class" class="labelItem" style=""  required>
-				<el-radio v-model="form.production_class" label="自产">自产</el-radio>
-				<el-radio v-model="form.production_class" label="收购">收购</el-radio>
+			<el-descriptions-item label="生产方式" prop="unit_production.production_class" class="labelItem" style=""  required>
+				<el-radio v-model="unit_production.production_class" label="自产">自产</el-radio>
+				<el-radio v-model="unit_production.production_class" label="收购">收购</el-radio>
 			</el-descriptions-item>
 			</el-descriptions>
 			</el-descriptions-item>
@@ -137,45 +137,45 @@
 		<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="sample_unit_name" class="labelItem" style="" size="mini"
+			<el-descriptions-item label="*单位名称" prop="unit_sample.unit_name" class="labelItem" style="" size="mini"
 									required>
-									<el-input v-model="form.sample_unit_name"></el-input>
+									<el-input v-model="unit_sample.unit_name"></el-input>
 			</el-descriptions-item>
-			<el-descriptions-item label="*联系人" prop="sample_unit_user" class="labelItem" style="" size="mini"
+			<el-descriptions-item label="*联系人" prop="unit_sample.unit_user" class="labelItem" style="" size="mini"
 									required>
-									<el-input v-model="form.sample_unit_user"></el-input>
+									<el-input v-model="unit_sample.unit_user"></el-input>
 			</el-descriptions-item>
-			<el-descriptions-item label="*通讯地址" prop="sample_unit_address" class="labelItem" style="" size="mini"
+			<el-descriptions-item label="*通讯地址" prop="unit_sample.address" class="labelItem" style="" size="mini"
 									required>
-									<el-input v-model="form.sample_unit_address"></el-input>
+									<el-input v-model="unit_sample.address"></el-input>
 			</el-descriptions-item>
-			<el-descriptions-item label="邮编" prop="sample_unit_postcode" class="labelItem" style="" size="mini">
-									<el-input v-model="form.sample_unit_postcode"></el-input>
+			<el-descriptions-item label="邮编" prop="unit_sample.postcode" class="labelItem" style="" size="mini">
+									<el-input v-model="unit_sample.postcode"></el-input>
 			</el-descriptions-item>
-			<el-descriptions-item label="联系电话" prop="sample_unit_phone" class="labelItem" style="" size="mini">
-									<el-input v-model="form.sample_unit_phone"></el-input>
+			<el-descriptions-item label="联系电话" prop="unit_sample.phone" class="labelItem" style="" size="mini">
+									<el-input v-model="unit_sample.phone"></el-input>
 			</el-descriptions-item>
-			<el-descriptions-item label="传真" prop="sample_unit_fax" class="labelItem" style="" size="mini">
-									<el-input v-model="form.sample_unit_fax"></el-input>
+			<el-descriptions-item label="传真" prop="unit_sample.fax" class="labelItem" style="" size="mini">
+									<el-input v-model="unit_sample.fax"></el-input>
 			</el-descriptions-item>
-			<el-descriptions-item label="Email" prop="sample_unit_email" class="labelItem" style="" size="mini">
-									<el-input v-model="form.sample_unit_email"></el-input>
+			<el-descriptions-item label="Email" prop="unit_sample.email" class="labelItem" style="" size="mini">
+									<el-input v-model="unit_sample.email"></el-input>
 			</el-descriptions-item>
 			</el-descriptions>
 			</el-descriptions-item>
 		</el-descriptions>
 
 		<el-descriptions  :column="2" border>
-			<el-descriptions-item label="检测任务依据" prop="base" class="labelItem" style="" size="mini" required>
-								<el-input v-model="form.base"></el-input>
+			<el-descriptions-item label="检测任务依据" prop="cyd_data.base" class="labelItem" style="" size="mini" required>
+								<el-input v-model="cyd_data.base"></el-input>
 			</el-descriptions-item>
-			<el-descriptions-item  label="抽样时间" prop="sample_date" class="labelItem" style="" size="mini" required>
-								<el-date-picker v-model="form.sample_date" type="date" value-format="yyyy-MM-dd">
+			<el-descriptions-item  label="抽样时间" prop="cyd_data.sample_date" class="labelItem" style="" size="mini" required>
+								<el-date-picker v-model="cyd_data.sample_date" type="date" value-format="yyyy-MM-dd">
 								</el-date-picker>
 			</el-descriptions-item>
-			<el-descriptions-item  label="被抽检单位签字盖章附件" prop="filr_url" class="labelItem" style="" size="mini">
+			<el-descriptions-item  label="被抽检单位签字盖章附件" prop="cyd_data.file_url" class="labelItem" style="" size="mini">
 								<el-upload class="upload-demo" :file-list="fileList" drag :headers="myHeaders"
-									action="http://syjcapi.aielab.net/api/v1/ossUpload" :on-success="uploadSuccess" :limit="1">
+									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>
@@ -214,70 +214,79 @@
 					Authorization: 'bearer' + token
 				},
 				fileList: [],
-				form: {
-					sample_name: '',//样品名称
-					sample_id: '',//样品编码
-					brand: '',//商标
-					ispack: '',//包装
-					type: '', //型号规格
-					standard: '',//执行标准
-					production_date: '',//生产日期或批号
-					place: '', //产地,
-					certicfie: '',//产品认证情况
-					certifie_num: '',//证书编号
-					sample_renum: '',//抽样数量
-					sample_num_unit: '',//单位
-					sample_base: '',//抽样基数
-					sample_base_unit: '',//单位
-					sample_ground: '',//抽样场所
-					// 受检单位情况
-					units_name: '',//单位名称
-					address: '',//通讯地址
-					corporation: '',//法定代表人
-					user_name: '',//受检人
-					phone: '',//电话
-					fax: '',//传真
-					// 生产单位情况
-					production_class: '',//生产、自购
-					production_name: '',//单位名称
-					p_address: '',//通讯地址
-					p_postcode: '',//邮编
-					p_user_name: '',//联系人
-					p_phone: '',//电话
-					p_fax: '',//传真
-					// 抽样单位情况
-					sample_unit_name: '',//单位名称
-					sample_unit_user: '',//联系人
-					sample_unit_address: '',//通讯地址
-					sample_unit_postcode: '',//邮编
-					sample_unit_phone: '',//联系电话
-					sample_unit_fax: '',//传真
-					sample_unit_email: '',//Email
-					base: '',//检测任务依据
-					sample_date: '',//抽样时间
-					filr_url: '',//被抽检单位签字盖章附件
-						},
+				// form: {
+				// 	sample_name: '',//样品名称
+				// 	sample_id: '',//样品编码
+				// 	brand: '',//商标
+				// 	ispack: '',//包装
+				// 	type: '', //型号规格
+				// 	standard: '',//执行标准
+				// 	production_date: '',//生产日期或批号
+				// 	place: '', //产地,
+				// 	certicfie: '',//产品认证情况
+				// 	certifie_num: '',//证书编号
+				// 	sample_renum: '',//抽样数量
+				// 	sample_num_unit: '',//单位
+				// 	sample_base: '',//抽样基数
+				// 	sample_base_unit: '',//单位
+				// 	sample_ground: '',//抽样场所
+				// 	// 受检单位情况
+				// 	units_name: '',//单位名称
+				// 	address: '',//通讯地址
+				// 	corporation: '',//法定代表人
+				// 	user_name: '',//受检人
+				// 	phone: '',//电话
+				// 	fax: '',//传真
+				// 	// 生产单位情况
+				// 	production_class: '',//生产、自购
+				// 	production_name: '',//单位名称
+				// 	p_address: '',//通讯地址
+				// 	p_postcode: '',//邮编
+				// 	p_user_name: '',//联系人
+				// 	p_phone: '',//电话
+				// 	p_fax: '',//传真
+				// 	// 抽样单位情况
+				// 	sample_unit_name: '',//单位名称
+				// 	sample_unit_user: '',//联系人
+				// 	sample_unit_address: '',//通讯地址
+				// 	sample_unit_postcode: '',//邮编
+				// 	sample_unit_phone: '',//联系电话
+				// 	sample_unit_fax: '',//传真
+				// 	sample_unit_email: '',//Email
+				// 	base: '',//检测任务依据
+				// 	sample_date: '',//抽样时间
+				// 	filr_url: '',//被抽检单位签字盖章附件
+				// 		},
+				form: {},
+				cyd_data: {},//抽样单信息上部分
+				unit_test: {},//受检单位信息
+				unit_production: {},//生产单位信息
+				unit_sample: {},//抽样单位信息
 				units: [],
 				production: [],
 				// 样品下拉框
 				sampleList: [],
-				id: '',
+				task_id: '',
+				under_id: '',
 				// 产地
 				options: regionData,
 				selectedOptions: []
 			}
 		},
 		created() {
-			this.id = this.$route.params.id
-			console.log(this.id)
+			this.task_id = this.$route.params.task_id
+			this.under_id = this.$route.params.under_id
+			console.log(this.task_id)
+			console.log(this.under_id)
 			this.getTestObj()
 		},
 		methods: {
 
-			// 获取样本列
+			// 获取样本列
 			async getTestObj() {
 				const result = await this.$http.post('getTestObj', {
-					id: this.id
+					task_id: this.task_id,
+					under_id: this.under_id
 				})
 				if (result.data.code == 0) {
 					this.sampleList = result.data.data
@@ -287,10 +296,12 @@
 			async createCode() {
 				var that = this
 				const result = await this.$http.post('getSampleId', {
-					id: this.id
+					task_id: this.task_id
 				})
+				console.log(result.data.data.id)
 				if (result.data.code == 0) {
-					that.form.sample_id = result.data.data.id
+					that.cyd_data.sample_id = result.data.data.id
+					this.getTestObj()
 				}
 			},
 			// 获取选择产地
@@ -302,41 +313,25 @@
 					loc += CodeToText[this.selectedOptions[i]];
 				}
 				// console.log(loc)
-				that.form.place = loc
-				console.log(that.form.place)
+				that.cyd_data.place = loc
+				console.log(that.cyd_data.place)
 			},
-			// 上传成功
+			// 上传成功(要确认数据)
 			uploadSuccess(res) {
 				console.log(res.data)
-				this.form.file_url = res.data.fileUrl
-				this.form.file_name = res.data.fileName
+				this.cyd_data.file_url = res.data.fileUrl
+				this.cyd_data.file_name = res.data.fileName
 			},
 			async onSubmit() {
 				// console.log(this.form.sample_name)
 				var that = this
-				that.units = {
-					'units_name': that.form.units_name,
-					'phone': that.form.phone,
-					'user_name': that.form.user_name,
-					'address': that.form.address,
-					'fax': that.form.fax
-				}
-				that.production = {
-					'production_name': that.form.production_name,
-					'phone': that.form.p_phone,
-					'user_name': that.form.p_user_name,
-					'address': that.form.p_address,
-					'fax': that.form.p_fax,
-					'postcode': that.form.p_postcode,
-					'production_class': that.form.production
-
-				}
-				that.form['task_id'] = that.id
-
-				that.form.units = that.units
-				that.form.production = that.production
+				console.log(that.cyd_data)
+				that.form.cyd_data = that.cyd_data
+				that.form.unit_test = that.unit_test
+				that.form.unit_production = that.unit_production
+				that.form.unit_sample = that.unit_sample
 				console.log(that.form)
-				const result = await this.$http.post('saveSample', that.form)
+				const result = await this.$http.post('saveSample', this.form)
 				if (result.data.code == 0) {
 					// that.form.sample_id = result.data.data.id
 					this.$message({
@@ -348,7 +343,10 @@
 			// 重置表单
 			resetForm() {
 				// console.log(this.form)
-					this.form='';
+					this.cyd_data = '';
+					this.unit_test = '';
+					this.unit_production = '';
+					this.unit_sample = '';
 					this.selectedOptions = '';
 			},
 			// 返回
@@ -357,7 +355,7 @@
 				this.$router.push({
 					name: 'setTaskcd',
 					params: {
-						id: that.id
+						task_id: that.task_id
 					}
 				})
 			}

+ 15 - 12
src/components/jc/setTask.vue

@@ -469,7 +469,7 @@
 						message: '保存成功!'
 					});
 					this.resetForm(formName)
-					this.getUnderTask()
+					this.getTaskDetail()
 				}
 			},
 			//重置
@@ -507,7 +507,7 @@
 						type: 'success',
 						message: '删除成功!'
 					});
-					that.getUnderTask()
+					that.getTaskDetail()
 				} else {
 					this.$message({
 						type: 'error',
@@ -518,15 +518,15 @@
 				this.$refs.multipleTable.clearSelection();
 			},
 			// 获取机构地域表格
-			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
-					this.underTasktotal = result.data.data.total
-				}
-			},
+			// 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
+			// 		this.underTasktotal = result.data.data.total
+			// 	}
+			// },
 			// 提交选中报告上传单位
 			choseReportUnit() {
 				let that = this
@@ -587,6 +587,7 @@
 			},
 			choseChange2(val) {
 				this.currentRow2 = val;
+				console.log(this.currentRow2)
 			},
 
 			// 跳转到机构与地域
@@ -657,7 +658,9 @@
 				const {
 					data: res
 				} = await this.$http.post("getTaskDetail", {
-					task_id: that.task_id
+					task_id: that.task_id,
+					pageNum: that.queryInfo.pageNum,
+					pageSize: that.queryInfo.pageSize
 				});
 				console.log(res.data.product)
 				if (res.data.product.length > 0) {

+ 34 - 21
src/components/jc/setTaskcd.vue

@@ -93,7 +93,7 @@
 						<!-- <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 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" />
@@ -651,7 +651,8 @@
 				fileList: [],
 				total: 0,
 				sampleShow: false, //是否展示抽样卡片
-				checkShow: false //是否展示检测卡片
+				checkShow: false, //是否展示检测卡片
+				currentRow: null //选中机构地域表格数据项
 			};
 		},
 		components: {
@@ -670,24 +671,24 @@
 
 		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 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 {
@@ -713,6 +714,14 @@
 				// 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
@@ -736,9 +745,11 @@
 					}
 				}
 				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
 				// 抽检不分离
 				if (that.taskInfo.is_divide == 0) {
@@ -888,9 +899,11 @@
 				this.$router.push({
 					name: 'inputSample',
 					params: {
-						id: this.readForm.id
+						task_id: this.readForm.taskInfo.id,
+						under_id: this.currentRow.id
 					}
 				})
+				// console.log(this.currentRow.id)
 			},
 			// 返回
 			back() {