|
@@ -79,7 +79,8 @@
|
|
|
<template slot="label">
|
|
|
检测对象
|
|
|
</template>
|
|
|
- <span v-for="item in readForm.product">{{item.product_name}}、</span>
|
|
|
+ {{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>
|
|
@@ -87,7 +88,8 @@
|
|
|
<template slot="label">
|
|
|
检测项
|
|
|
</template>
|
|
|
- <span v-for="item in readForm.pesticides">{{item.test_name}}、</span>
|
|
|
+ {{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 style="width: 100%"
|
|
@@ -98,52 +100,58 @@
|
|
|
<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>
|
|
|
+ <!-- <el-button type="success" size="mini" @click="back">返回</el-button> -->
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
|
|
|
<el-tab-pane v-if="sampleShow==true" label="抽样" name="second">
|
|
|
<!-- 头部搜索栏 -->
|
|
|
- <el-row style="margin-right: 0px;">
|
|
|
- <el-form style="display: flex; flex-direction: row;">
|
|
|
- <el-form-item label="产品编码" class="select" size="small">
|
|
|
- <el-input v-model="queryInfo.task_name"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="受检单位" class="select" size="small">
|
|
|
- <el-input v-model="queryInfo.task_name"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="抽样编码" class="select" size="small">
|
|
|
- <el-input v-model="queryInfo.task_name"></el-input>
|
|
|
+
|
|
|
+ <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-form-item label="样品名称" class="select" size="small">
|
|
|
- <el-input v-model="queryInfo.task_name"></el-input>
|
|
|
+ </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-form>
|
|
|
- </el-row>
|
|
|
- <el-row style="margin-right: 0px;">
|
|
|
- <el-form style="display: flex; flex-direction: row;">
|
|
|
- <el-form-item label="抽样场所" class="select" size="small">
|
|
|
- <el-input v-model="queryInfo.task_name"></el-input>
|
|
|
+ </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-form-item>
|
|
|
- <el-form-item label="抽样日期" class="select" size="small">
|
|
|
- <el-input v-model="queryInfo.task_name"></el-input>
|
|
|
+ </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-form-item>
|
|
|
- <el-form-item label="抽样单位" class="select" size="small">
|
|
|
- <el-input v-model="queryInfo.task_name"></el-input>
|
|
|
+ </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-form-item label="抽样机构" class="select" size="small">
|
|
|
- <el-input v-model="queryInfo.task_name"></el-input>
|
|
|
+ </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-button style="height: 30px;margin-left: 10px;" size="mini" type="success"
|
|
|
+ </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: 30px;margin-left: 5px;" size="mini" type="success" @click="reset()">
|
|
|
+ <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>
|
|
|
<el-row style="margin-right: 0px;">
|
|
|
<el-form style="display: flex; flex-direction: row;">
|
|
|
<!-- <el-form-item label="产地" class="select">
|
|
@@ -416,8 +424,10 @@
|
|
|
: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>
|
|
|
|
|
@@ -450,13 +460,21 @@
|
|
|
dialogVisible2: false,
|
|
|
activeName: 'first',
|
|
|
id: 0,
|
|
|
+ productNameText: '',
|
|
|
+ pesticidesNameText: '',
|
|
|
readForm: {},
|
|
|
underTask: [],
|
|
|
underTasktotal: '0',
|
|
|
queryInfo: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
- task_id: ''
|
|
|
+ task_id: '',
|
|
|
+ sample_id: '',
|
|
|
+ units_name: '',
|
|
|
+ sample_name: '',
|
|
|
+ sample_data: '',
|
|
|
+ sample_unit_name: '',
|
|
|
+ sample_ground: '',
|
|
|
},
|
|
|
// 填报对话框弹出
|
|
|
inputDialogShow: false,
|
|
@@ -648,6 +666,19 @@
|
|
|
// );
|
|
|
// 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();
|
|
|
+ },
|
|
|
+ //获取任务详情
|
|
|
async getTaskDetail() {
|
|
|
var that = this
|
|
|
const {
|
|
@@ -668,6 +699,8 @@
|
|
|
}
|
|
|
}
|
|
|
that.readForm = res.data
|
|
|
+ that.productNameText = that.readForm.product.map(el => el.product_name).join('、 ')
|
|
|
+ that.pesticidesNameText = that.readForm.pesticides.map(el => el.test_name).join('、 ')
|
|
|
// 抽检不分离
|
|
|
if (that.readForm.is_divide == 0) {
|
|
|
this.sampleShow = true
|
|
@@ -687,9 +720,11 @@
|
|
|
that.formjc = result.data.data
|
|
|
}
|
|
|
},
|
|
|
+ //下载检测报告
|
|
|
download() {
|
|
|
htmlToPdf.downloadPDF(document.querySelector('#pdf'), '检测报告')
|
|
|
},
|
|
|
+ //生成检测报告pdf
|
|
|
async creatpdf(sample_id) {
|
|
|
var that = this
|
|
|
that.dialogVisible2 = true
|
|
@@ -769,6 +804,11 @@
|
|
|
|
|
|
// 获取抽样单列表
|
|
|
async getSampleList() {
|
|
|
+ for (var key in this.queryInfo) {
|
|
|
+ if (this.queryInfo[key] == '') {
|
|
|
+ delete this.queryInfo[key]
|
|
|
+ }
|
|
|
+ }
|
|
|
this.queryInfo['task_id'] = this.task_id
|
|
|
const {
|
|
|
data: res
|
|
@@ -815,7 +855,13 @@
|
|
|
},
|
|
|
// 返回
|
|
|
back() {
|
|
|
-
|
|
|
+ var that = this
|
|
|
+ this.$router.push({
|
|
|
+ name: 'setTaskcd',
|
|
|
+ params: {
|
|
|
+ id: that.id
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
// 上传抽样信息
|
|
|
async appear() {
|