jiangyu 3 лет назад
Родитель
Сommit
565701e7f5

+ 69 - 28
src/components/jc/fillSampleReport.vue

@@ -24,18 +24,15 @@
 				<el-form-item label="单位名称:" prop="inspected_name" class="labelItem">
 					<el-input v-model="inspected_Unit.inspected_name" style="width:42%"></el-input>
 				</el-form-item>
-				<el-form-item label="单位地址:" prop="inspected_address" class="labelItem">
-					<el-row>
-					<el-col :span="10" style="margin-right:10px;">	
-						<!-- <el-cascader placeholder="请选择地区" :options="region" v- model="selectedOptions" @change="handleChange" :props="{ expandTrigger: 'hover' }" style="width:100%">
-						</el-cascader> -->
-					</el-col>
-					<el-col :span="10">
-						<el-input v-model="inspected_Unit.inspected_address" placeholder="请输入详细地址" style="width:100%"></el-input>
-					</el-col>
-					</el-row>
+				<el-form-item label="单位地址:" prop="inspected_address" class="labelItem">	
+						<el-cascader placeholder="请选择地区" :options="options" v-model="selectedOptions" @change="handleChange" style="width:15%">
+						</el-cascader>
+						<el-input v-model="inspected_Unit.inspected_address2" placeholder="请输入详细地址" style="width:26.5%;margin-left:5px;"></el-input>
 				</el-form-item>
 				
+				<!-- <el-form-item label="" prop="inspected_address2" class="labelItem">	
+						<el-input v-model="inspected_Unit.inspected_address" placeholder="请输入详细地址" style="width:42%"></el-input>
+				</el-form-item> -->
 				<el-form-item label="联系人:" prop="contact_name" class="labelItem">
 					<el-input v-model="inspected_Unit.contact_name" style="width:42%"></el-input>
 				</el-form-item>
@@ -61,7 +58,7 @@
 			<!-- </el-row> -->
 				<!--  表格数据区域-->
 			<el-table ref="multipleTable" :data="tableData" border stripe highlight-current-row style="width: 100%; margin:auto;"
-				:row-style="rowStyle" :cell-style="cellStyle" @selection-change="handleSelectionChange">
+				: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">
@@ -87,6 +84,13 @@
 				<el-form-item label="抽样单编号:" prop="cyd_code" class="labelItem">
 					<el-input v-model="sample_unit.cyd_code" style="width:40%"></el-input>
 				</el-form-item>
+
+					<el-form-item label="抽样地点:" prop="sample_address" class="labelItem">	
+						<el-cascader placeholder="请选择地区" :options="options" v-model="selectedOptions1" @change="handleChange1" style="width:15%">
+						</el-cascader>
+						<el-input v-model="sample_unit.sample_address2" placeholder="请输入详细地址" style="width:26.5%;margin-left:5px;"></el-input>
+				</el-form-item>
+
 				<el-form-item label="抽样人员1:" prop="sample_person_one" class="labelItem">
 					<el-input v-model="sample_unit.sample_person_one" style="width:40%"></el-input>
 				</el-form-item>
@@ -111,7 +115,7 @@
 						:on-remove="handleRemove"
 						:before-remove="beforeRemove"
 						multiple
-						:limit="3"
+						:limit="10"
 						:on-exceed="handleExceed"
 						:file-list="fileList">
 						<el-button size="small" type="primary">点击上传</el-button>
@@ -137,6 +141,9 @@
 				<!-- <el-form-item label="样品编号:" prop="releaser" class="labelItem" required>
 					<el-input v-model="" style="width:42%"></el-input>
 				</el-form-item> -->
+				<el-form-item label="抽样地点:" prop="sample_name" class="labelItem">
+					<el-input v-model="product_Unit.sample_name" style="width:42%"></el-input>
+				</el-form-item>
 				<el-form-item label="样品商标:" prop="sample_brand" class="labelItem">
 					<el-input v-model="product_Unit.sample_brand" style="width:42%"></el-input>
 				</el-form-item>
@@ -218,7 +225,7 @@
 
 				rules: {
                 	inspected_name: [{required: true, message: '请输入单位名称', trigger: 'blur'},],
-					inspected_address: [{required: true, message: '请输入单位地址', trigger: 'blur'},],
+					// inspected_address: [{required: true, message: '请输入单位地址', trigger: 'blur'},],
 					contact_name: [{required: true, message: '请输入联系人', trigger: 'blur'},],
 					contact_phone: [{required: true, message: '请输入联系电话', trigger: 'blur'},]
 						},
@@ -274,6 +281,11 @@
 					}
 
 				],
+				// 产地
+				options: regionData,
+				selectedOptions: [],
+				//抽样地点
+				selectedOptions1: [],
 				// 数据表格数据
 				tableData: [],
 				// 批量删除选中数据
@@ -326,7 +338,7 @@
 				task_id: '',
 				undertake_id: '',
 				// 产地
-				options: regionData,
+				options: regionData[11].children,
 				selectedOptions: [],
 				// 日期选择器快捷选项
 				pickerOptions: {
@@ -362,9 +374,9 @@
 			console.log(this.task_id)
 			console.log(this.task_profile_id)
 			this.getCydObj()
-			
-
 			console.log(regionData)
+			console.log(regionData[11])
+
 		},
 		methods: {
 			// // 步骤条下一步
@@ -457,6 +469,9 @@
 			async postInspectedUnit() {
 				var that = this
 				that.inspected_Unit['cyd_id'] = that.cyd_id
+				console.log()
+				that.inspected_Unit.inspected_address = that.inspected_Unit.inspected_address1 + that.inspected_Unit.inspected_address2
+				console.log(that.inspected_Unit.inspected_address)
 				const res = await this.$http.post('postInspectedUnit',that.inspected_Unit)
 				console.log(res)
 				// 判断业务逻辑
@@ -490,6 +505,7 @@
 			async postCydProfile(){
 				var that = this
 				that.sample_unit['cyd_id'] = that.cyd_id
+				that.sample_unit.sample_address = that.sample_unit.sample_address1 + that.sample_unit.sample_address2
 				const res = await this.$http.post('postCydProfile',that.sample_unit)
 				const result = await this.$http.post('postCyd',{
 					cyd_id: that.cyd_id,
@@ -503,6 +519,19 @@
 					}
 					});
 			},
+			//上传文件
+			 handleRemove(file, fileList) {
+				console.log(file, fileList);
+			},
+			handlePreview(file) {
+				console.log(file);
+			},
+			handleExceed(files, fileList) {
+				this.$message.warning(`当前限制选择 10 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
+			},
+			beforeRemove(file, fileList) {
+				return this.$confirm(`确定移除 ${ file.name }?`);
+			},
 			//填报抽样单样品信息分页
 			handleSizeChange(val) {
 				this.queryInfo.pageSize = val;
@@ -525,18 +554,30 @@
 			},
 			// 获取样本列表
 			// 生成样品编码
-			// 获取选择产地
-			// handleChange() {
-			// 	var that = this
-			// 	var loc = "";
-			// 	// console.log(this.form.place)
-			// 	for (let i = 0; i < this.selectedOptions.length; i++) {
-			// 		loc += CodeToText[this.selectedOptions[i]];
-			// 	}
-			// 	// console.log(loc)
-			// 	that.cyd_data.place = loc
-			// 	console.log(that.cyd_data.place)
-			// },
+			// 获取受检单位地址
+			handleChange() {
+				var that = this
+				var loc = "";
+				console.log(this.selectedOptions)
+				for (let i = 0; i < this.selectedOptions.length; i++) {
+					loc += CodeToText[this.selectedOptions[i]];
+				}
+				console.log(loc)
+				that.inspected_Unit.inspected_address1 = loc
+				console.log(that.inspected_Unit.inspected_address1)
+			},
+			// 获取抽样地址
+			handleChange1() {
+				var that = this
+				var loc = "";
+				console.log(this.selectedOptions1)
+				for (let i = 0; i < this.selectedOptions1.length; i++) {
+					loc += CodeToText[this.selectedOptions1[i]];
+				}
+				console.log(loc)
+				that.sample_unit.sample_address1 = loc
+				console.log(that.sample_unit.sample_address1)
+			},
 			// 上传成功(要确认数据)
 			// uploadSuccess(res) {
 			// 	console.log(res.data)

+ 1 - 0
src/components/jc/inputSample.vue

@@ -235,6 +235,7 @@
 			console.log(this.task_id)
 			console.log(this.undertake_id)
 			this.getTestObj()
+			console.log(this.regionData)
 		},
 		methods: {
 

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

@@ -179,7 +179,7 @@ const HeadersList = [{
 					},
 					{
 						label: '发布单位',
-						prop: 'releaser',
+						prop: 'releaser.name',
 
 					},
 					// {

+ 99 - 39
src/components/jc/sampleReport.vue

@@ -97,44 +97,55 @@
 		<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.sample_name" size="mini" required>
-					{{sample.sample_name}}
-				</el-descriptions-item>
-			</el-descriptions>
+					<el-descriptions-item label="抽样地点" prop="sample.sample_name" size="mini" required>
+						{{sample.sample_name}}
+					</el-descriptions-item>
+				</el-descriptions>
+				<div>
+					<el-table :data="sample" border stripe highlight-current-row style="width: 100%"
+					:row-style="rowStyle" :cell-style="cellStyle">
+				<el-table-column :key="table.label" v-for="table in tableHeader" :label="table.label"
+					:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
+			</el-table>
+				</div>
+				
 			</el-descriptions-item>
 		</el-descriptions>
-	
-		
-		<!-- <el-descriptions  :column="2" border>
-			<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="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="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">
-									<i class="el-icon-upload"></i>
-									<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
-								</el-upload>
+		<!-- 抽样单位信息 -->
+		<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="sampleOrgId.name" size="mini" required>
+						{{sampleOrgId.name}}
+					</el-descriptions-item>
+					<el-descriptions-item label="机构类型" prop="sampleOrgId.groupname" size="mini" required>
+						{{sampleOrgId.groupname}}
+					</el-descriptions-item>
+					<el-descriptions-item label="联系人" prop="sampleOrgId.contact_name" size="mini" required>
+						{{sampleOrgId.contact_name}}
+					</el-descriptions-item>
+					<el-descriptions-item label="联系电话" prop="sampleOrgId.contact_phone" size="mini" required>
+						{{sampleOrgId.contact_phone}}
+					</el-descriptions-item>
+				</el-descriptions>
 			</el-descriptions-item>
-		</el-descriptions> -->
+		</el-descriptions>
+	<!-- 备注 -->
+	<el-descriptions :column="1" border style="" >
+		<el-descriptions-item label="备注" > 
+			{{cyd_data.cydProfile.cyd_log}}
+		</el-descriptions-item>
+	</el-descriptions>
 	</div>
 <!-- 底部按钮 -->
 		<el-form>
 				<el-form-item class="btn">
 					<el-button type="primary" @click="back()">返回任务详情</el-button>
-					<el-button @click="resetForm()">重置</el-button>
-					<el-button @click="onSubmit">保存,继续添加</el-button>
+					<!-- <el-button @click="resetForm()">重置</el-button>
+					<el-button @click="onSubmit">保存,继续添加</el-button> -->
 				</el-form-item>
-			</el-form>
-			<!-- <el-form ref="form1" :model="form" label-width="110px"
-				style="margin-top: 20px;width: 48%;background-color: aliceblue;padding:10px 1px 1px 10px;">
-			</el-form> -->
+			</el-form>	
 		</div>
-		<!-- </el-card> -->
 </template>
 
 <script>
@@ -156,9 +167,18 @@
 				},
 				fileList: [],
 				form: {},
-				cyd_data: {},//抽样单信息上部分
-				inspected_unit: {},//受检单位信息
+				cyd_data: {
+					cydProfile: '',
+				},//抽样单信息上部分
+				inspected_unit: {
+					inspected_name: '',
+					inspected_address: '',
+					contact_name: '',
+					contact_phone: '',
+					contact_email: ''
+				},//受检单位信息
 				sample: {},//样品信息
+				sampleOrgId: [],//抽样单位信息
 				units: [],
 				production: [],
 				// 样品下拉框
@@ -167,11 +187,46 @@
 				undertake_id: '',
 				// 产地
 				options: regionData,
-				selectedOptions: []
+				selectedOptions: [],
+
+				cellStyle: {
+					padding: 2 + 'px'
+				},
+				rowStyle: {
+					height: 35 + 'px'
+				},
+				tableHeader: [{
+						label: '样品名称',
+						prop: 'sample_name'
+						// fixed: 'left'
+					},
+					{
+						label: '样品来源',
+						prop: 'sample_source',
+						// width: 180
+					},
+					{
+						label: '抽样数量',
+						prop: 'sample_count',
+						// width: 150
+					},
+					{
+						label: '抽样基数',
+						prop: 'sample_base',
+						// width: 100
+					},
+					{
+						label: '生产日期',
+						prop: 'sample_md_date',
+						// width: 100
+					}
+				],
 			}
 		},
 		created() {
+			this.task_id = this.$route.params.task_id
 			this.task_profile_id = this.$route.params.id
+			console.log(this.task_id)
 			console.log(this.task_profile_id)
 			this.getCyd()
 		},
@@ -186,9 +241,14 @@
 				this.cyd_data = result.data.data
 				this.inspected_unit = result.data.data.inspectedUnit
 				this.sample = result.data.data.sample
+				if(this.sample.sample_source == ''){
+					this.sample.sample_source = '自产'
+				}
+				this.sampleOrgId = result.data.data.taskProfile.sampleOrgId
 				console.log(this.cyd_data)
 				console.log(this.inspected_unit)
 				console.log(this.sample)
+				console.log(this.sampleOrgId)
 			},
 
 
@@ -244,14 +304,14 @@
 				}
 			},
 			// 重置表单
-			resetForm() {
-				// console.log(this.form)
-					this.cyd_data = '';
-					this.unit_test = '';
-					this.unit_production = '';
-					this.unit_sample = '';
-					this.selectedOptions = '';
-			},
+			// resetForm() {
+			// 	// console.log(this.form)
+			// 		this.cyd_data = '';
+			// 		this.unit_test = '';
+			// 		this.unit_production = '';
+			// 		this.unit_sample = '';
+			// 		this.selectedOptions = '';
+			// },
 			// 返回
 			back() {
 				var that = this

+ 11 - 1
src/components/jc/setTaskcd.vue

@@ -1001,7 +1001,14 @@
 				} = await this.$http.post("getCyds", 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].cyd_status = 1) {
+						this.tableData[i].status = '未发布'
+					}else {
+						this.tableData[i].status = '已发布'
+					}
+				}
+				console.log(this.tableData[0].cyd_status)
 				this.total = res.data.total
 				
 			},
@@ -1121,9 +1128,12 @@
 			// 跳转到查看抽样单详情
 			sampleDetail(id) {
 				console.log(id)
+				console.log(this.task_id)
+
 				this.$router.push({
 					name: 'sampleReport',
 					params: {
+						task_id: this.task_id,
 						id: id
 					}
 				})