|
@@ -63,13 +63,6 @@
|
|
|
</template>
|
|
|
{{readForm.endtime}}
|
|
|
</el-descriptions-item>
|
|
|
-
|
|
|
- <!-- <el-descriptions-item>
|
|
|
- <template slot="label">
|
|
|
- 行业
|
|
|
- </template>
|
|
|
- <span>{{readForm.model_type}}</span>
|
|
|
- </el-descriptions-item> -->
|
|
|
<el-descriptions-item>
|
|
|
<template slot="label">
|
|
|
抽检分离
|
|
@@ -94,33 +87,6 @@
|
|
|
{{readForm.log}}
|
|
|
</el-descriptions-item>
|
|
|
</el-descriptions>
|
|
|
- <!-- <el-descriptions class="margin-top" :size="size" border>
|
|
|
- <el-descriptions-item>
|
|
|
-
|
|
|
- <template slot="label">
|
|
|
- 检测对象
|
|
|
- </template>
|
|
|
- {{productNameText}}
|
|
|
- </el-descriptions-item>
|
|
|
- </el-descriptions> -->
|
|
|
- <!-- <el-descriptions class="margin-top" :size="size" border>
|
|
|
- <el-descriptions-item>
|
|
|
- <template slot="label">
|
|
|
- 检测项
|
|
|
- </template>
|
|
|
- {{pesticidesNameText}}
|
|
|
- </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">
|
|
@@ -183,7 +149,6 @@
|
|
|
<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="getCydlist(scope.row.id)">查看抽样单列表
|
|
|
</el-button>
|
|
|
<!-- <el-button type="success" size="small" plain @click="sampleDetail(scope.row.sample_id)" @focus="getSampleListDialog = true">查看抽样单列表
|
|
@@ -220,7 +185,7 @@
|
|
|
<template slot-scope="scope">
|
|
|
<el-button style="margin:5px 5px" type="success" size="small" plain @click="sampleDetail(scope.row.id)">查看
|
|
|
</el-button>
|
|
|
- <el-button style="margin:5px 5px" type="primary" size="small" plain icon="el-icon-edit-outline" @click="upCydItem(scope.row.sample_id)">上报抽样信息
|
|
|
+ <el-button style="margin:5px 5px" type="primary" size="small" plain icon="el-icon-edit-outline" @click="putCydStatus(scope.row.id)">上报抽样信息
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -242,15 +207,8 @@
|
|
|
: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>
|
|
@@ -260,7 +218,6 @@
|
|
|
<!-- 表格数据区域-->
|
|
|
<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 }}
|
|
@@ -272,73 +229,118 @@
|
|
|
<el-table-column label="操作" align="center" fixed="right" width="350px">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button style="margin:5px 5px" type="success" size="mini" v-if="scope.row.jc_value_id==null" plain
|
|
|
- @click="getJcdObjectItem(scope.row.sample_id,scope.row.sample_name)">检测</el-button>
|
|
|
+ @click="getJcdObj(scope.row.id)">填报检测单</el-button>
|
|
|
<el-button style="margin:5px 5px" type="primary" v-else size="mini" plain @click="update(scope.row)">修改</el-button>
|
|
|
<el-button style="margin:5px 5px" type="primary" size="mini" plain @click="upJcdItem(scope.row.sample_id)">上报
|
|
|
</el-button>
|
|
|
- <el-button style="margin:5px 5px" type="primary" size="mini" plain @click="creatpdf(scope.row.sample_id)">生成检测报告
|
|
|
- </el-button>
|
|
|
+ <!-- <el-button style="margin:5px 5px" 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 />
|
|
|
+ :current-page="queryInfo1.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo1.pageSize"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper" :total="jcdListTotal" background />
|
|
|
</el-dialog>
|
|
|
</el-tab-pane>
|
|
|
|
|
|
|
|
|
- <el-dialog title="填写检测单" :visible.sync="inputCheckShow" width="70%" :close-on-click-modal="false"
|
|
|
+ <el-dialog title="填报检测单" :visible.sync="inputJcdShow" width="70%" :close-on-click-modal="false"
|
|
|
class="dialogItem">
|
|
|
- <span class="demonstration">样品编码:{{sample_id}}</span>
|
|
|
- <span class="demonstration">样品名称:{{sample_name}}</span>
|
|
|
- <el-button type="success" size="small" plain @click="saveJcdItem()">保存</el-button>
|
|
|
- <span class="demonstration">注意:“不得检出”只能填为“ND”</span>
|
|
|
+
|
|
|
+
|
|
|
+ <div id="" style="margin:10px auto; width:100%">
|
|
|
+ <el-form :rules="rules" :model="jcd">
|
|
|
+ <el-form-item label="检测单编码:" prop="jcd_code" class="labelItem">
|
|
|
+ <el-input v-model="jcd.jcd_code" placeholder="请输入检测单编码" style="width:26.5%;margin-left:5px;"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="检测结果:" prop="jcd_result" class="labelItem">
|
|
|
+ <el-radio-group v-model="jcd.jcd_result" @change="jcResult()">
|
|
|
+ <el-radio :label="1">合格</el-radio>
|
|
|
+ <el-radio :label="0">不合格</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <!-- 上传检测报告 -->
|
|
|
+ <el-form-item label="检测单报告上传:" prop="jcd" class="labelItem">
|
|
|
+ <el-upload
|
|
|
+ class="upload-demo"
|
|
|
+ :headers="myHeaders"
|
|
|
+ action='http://new.syjc.com/api/v1/ossUpload'
|
|
|
+ :on-preview="handlePreview"
|
|
|
+ :on-remove="handleRemove"
|
|
|
+ :before-remove="beforeRemove"
|
|
|
+ :on-success="uploadSuccess"
|
|
|
+ multiple
|
|
|
+ :file-list="fileList">
|
|
|
+ <el-button size="small" type="primary">点击上传</el-button>
|
|
|
+ <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div style="display: flex;flex-direction: row;float: right;margin-bottom: 10px;">
|
|
|
+ <el-button type="success" size="small" plain @click="addJcxItemDialog = true">新增不合格项</el-button>
|
|
|
+ </div>
|
|
|
<!-- 表格数据区域-->
|
|
|
- <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="抽检结果">
|
|
|
+ <el-table :data="jcxItems" border stripe highlight-current-row style="width: 100%"
|
|
|
+ :row-style="rowStyle" :cell-style="cellStyle" align="center">
|
|
|
+ <el-table-column label="序号" width="50px">
|
|
|
<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>
|
|
|
+ {{ scope.$index+1 }}
|
|
|
</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 :key="table.label" v-for="table in jcxHeader" :label="table.label"
|
|
|
+ :prop="table.prop" align="center" :width="table.width" :fixed="table.fixed">
|
|
|
+
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="LOQ">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-input v-model="scope.row.LOQ" />
|
|
|
+ <el-table-column label="操作" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-col style="margin-bottom: 5px;">
|
|
|
+ <el-button type="success" size="mini" @click="delJcdItem(scope.row.id)">删除</el-button>
|
|
|
+ </el-col>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
-
|
|
|
</el-table>
|
|
|
+
|
|
|
+ <!-- 分页器区域-->
|
|
|
+ <el-pagination @size-change="handleSizeChange2" @current-change="handleCurrentChange2"
|
|
|
+ :current-page="queryInfo2.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo2.pageSize"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper" :total="jcxItemTotal" background />
|
|
|
+
|
|
|
+ <div class="footer">
|
|
|
+ <el-button type="success" style="margin-bottom:30px;" size="small" @click="putJcd()">完成</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog title="新增不合格检测项目" :visible.sync="addJcxItemDialog" width="70%" :close-on-click-modal="false"
|
|
|
+ class="dialogItem">
|
|
|
+ <el-form :rules="rules" :model="jcxItem" style="margin:10px auto;">
|
|
|
+ <el-form-item label="检测项目:" prop="item_name" class="labelItem">
|
|
|
+ <el-input v-model="jcxItem.item_name" style="width:42%"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="标准指标:" prop="item_standard" class="labelItem">
|
|
|
+ <el-input v-model="jcxItem.item_standard" style="width:42%;margin-left:5px;"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="实测值:" prop="item_measured_value" class="labelItem">
|
|
|
+ <el-input v-model="jcxItem.item_measured_value" style="width:42%"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="单项判定:" prop="item_result" class="labelItem">
|
|
|
+ <el-input v-model="jcxItem.item_result" style="width:42%"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="监测依据:" prop="item_basis" class="labelItem">
|
|
|
+ <el-input v-model="jcxItem.item_basis" style="width:42%"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="备注:" prop="item_log" class="labelItem">
|
|
|
+ <el-input v-model="jcxItem.item_log" style="width:42%"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <div class="footer">
|
|
|
+ <el-button type="success" style="margin-bottom:30px;" size="small" @click="postJcdItem()">保存</el-button>
|
|
|
+ </div>
|
|
|
</el-dialog>
|
|
|
<!-- ///////////////////////////////////////////检测报告生成-------难、、、、、、、、、、、、、、、、、、、、、、 -->
|
|
|
<el-dialog title="生成监测报告" :visible.sync="dialogVisible2" width="50%">
|
|
@@ -469,10 +471,10 @@
|
|
|
:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
|
|
|
</el-table>
|
|
|
</div>
|
|
|
- <div style="margin-top: 10px; text-align: center">
|
|
|
+ <!-- <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>
|
|
|
+ </div> -->
|
|
|
<!-- </span> -->
|
|
|
</el-dialog>
|
|
|
|
|
@@ -499,17 +501,33 @@
|
|
|
return {
|
|
|
size: 'medium',
|
|
|
myHeaders: {
|
|
|
- Authorization: 'bearer' + token
|
|
|
+ Authorization: token
|
|
|
},
|
|
|
+ rules: {
|
|
|
+ item_name: [{required: true, message: '该项为必填项', trigger: 'blur'},],
|
|
|
+ // inspected_address: [{required: true, message: '请输入单位地址', trigger: 'blur'},],
|
|
|
+ item_standard: [{required: true, message: '该项为必填项', trigger: 'blur'},],
|
|
|
+ item_measured_value: [{required: true, message: '该项为必填项', trigger: 'blur'},],
|
|
|
+ item_result: [{required: true, message: '该项为必填项', trigger: 'blur'},],
|
|
|
+ item_basis: [{required: true, message: '该项为必填项', trigger: 'blur'},],
|
|
|
+ item_log: [{required: true, message: '该项为必填项', trigger: 'blur'},],
|
|
|
+ },
|
|
|
+ radio:{},
|
|
|
formjc: {},
|
|
|
unitTest: {},
|
|
|
dialogVisible2: false,
|
|
|
- getSampleListDialog: false,
|
|
|
- checkTestList: false,
|
|
|
+ getSampleListDialog: false,//抽样单列表对话框
|
|
|
+ checkTestList: false,//检测单列表对话框
|
|
|
+ addJcxItemDialog: false,//新增不合格检测项目对话框
|
|
|
+ jcxItemTotal: 0,
|
|
|
activeName: 'first',
|
|
|
+ jcxItems: {},
|
|
|
id: 0,
|
|
|
- productNameText: '',
|
|
|
- pesticidesNameText: '',
|
|
|
+ jcd: {
|
|
|
+ jcd_result: '',
|
|
|
+ file_name: '',
|
|
|
+ file_url: ''
|
|
|
+ },
|
|
|
readForm: {
|
|
|
creater: [],
|
|
|
releaser: [],
|
|
@@ -517,53 +535,27 @@
|
|
|
model_type: '',
|
|
|
|
|
|
},
|
|
|
- sample_name: '',
|
|
|
- sample_id: '',
|
|
|
+ // sample_name: '',
|
|
|
+ // sample_id: '',
|
|
|
sampleTask: [],
|
|
|
underTask: [],
|
|
|
- unitTaskTotal: '0',
|
|
|
- underTasktotal: '0',
|
|
|
- testListTotal: '0',
|
|
|
+
|
|
|
+ jcdListTotal: 0,
|
|
|
queryInfo: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
},
|
|
|
- underInfo:{
|
|
|
+ queryInfo1:{
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
- underTake_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,
|
|
|
+ task_id: '',
|
|
|
+ task_profile_id: ''
|
|
|
+ },
|
|
|
+ queryInfo2:{
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ jcd_id: ''
|
|
|
+ },
|
|
|
cellStyle: {
|
|
|
padding: 2 + 'px'
|
|
|
},
|
|
@@ -593,38 +585,60 @@
|
|
|
],
|
|
|
//获取检测单列表表格
|
|
|
checkHeader: [{
|
|
|
- label: '样品名称',
|
|
|
- prop: 'sample_name',
|
|
|
- width: 150
|
|
|
- // fixed: 'left'
|
|
|
- }, {
|
|
|
- label: '样品编码',
|
|
|
- prop: 'sample_id'
|
|
|
+ label: '抽样单编码',
|
|
|
+ prop: 'cyd_code'
|
|
|
// fixed: 'left'
|
|
|
},
|
|
|
{
|
|
|
label: '受检单位',
|
|
|
- prop: 'unitTest.unit_test_name',
|
|
|
+ prop: 'inspectedUnit.inspected_name',
|
|
|
width: 180
|
|
|
},
|
|
|
{
|
|
|
- label: '抽样单位',
|
|
|
- prop: 'undertake.bear_name',
|
|
|
- width: 180
|
|
|
- }, {
|
|
|
- label: '检测单位',
|
|
|
- prop: 'undertake.check_name',
|
|
|
- width: 180
|
|
|
- }, {
|
|
|
- label: '判定结果',
|
|
|
- prop: 'testResult',
|
|
|
- width: 100
|
|
|
- }, {
|
|
|
+ label: '抽样日期',
|
|
|
+ prop: 'cydProfile.cyd_date',
|
|
|
+ width: 150
|
|
|
+ },
|
|
|
+ {
|
|
|
label: '状态',
|
|
|
- prop: 'testStatus',
|
|
|
+ prop: 'status',
|
|
|
width: 100
|
|
|
}
|
|
|
],
|
|
|
+
|
|
|
+ jcxHeader: [
|
|
|
+ {
|
|
|
+ label: '检测项目',
|
|
|
+ prop: 'item_name'
|
|
|
+ // fixed: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '标准指标',
|
|
|
+ prop: 'item_standard',
|
|
|
+ // width: 180
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '实测值',
|
|
|
+ prop: 'item_measured_value',
|
|
|
+ // width: 150
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '单项判定',
|
|
|
+ prop: 'item_result',
|
|
|
+ // width: 100
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '检验依据',
|
|
|
+ prop: 'item_basis',
|
|
|
+ // width: 100
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '备注',
|
|
|
+ prop: 'item_log',
|
|
|
+ // width: 100
|
|
|
+ },
|
|
|
+ ],
|
|
|
+
|
|
|
checkHeader2: [{
|
|
|
label: '检测项目',
|
|
|
prop: 'test_name',
|
|
@@ -637,17 +651,11 @@
|
|
|
task_id: '',
|
|
|
multipleSelection: null,
|
|
|
// 填报检测对话框
|
|
|
- inputCheckShow: false,
|
|
|
- check_name: '',
|
|
|
- check_id: '',
|
|
|
+ inputJcdShow: false,
|
|
|
+ jcd_id: '',
|
|
|
testPesticides: [],
|
|
|
resultjc: [],
|
|
|
- // 模型列表
|
|
|
- options: [],
|
|
|
- bindForm: {
|
|
|
- test_model_id: '',
|
|
|
- closingdate: ''
|
|
|
- },
|
|
|
+
|
|
|
jcheader: [{
|
|
|
label: '检测项目',
|
|
|
prop: 'test_name',
|
|
@@ -702,8 +710,8 @@
|
|
|
total: 0,
|
|
|
sampleShow: false, //是否展示抽样卡片
|
|
|
checkShow: false, //是否展示检测卡片
|
|
|
- currentRow: null,
|
|
|
- //选中机构地域表格数据项
|
|
|
+ currentRow: null,//选中机构地域表格数据项
|
|
|
+ jcxItem:{},//新增检测项目
|
|
|
};
|
|
|
},
|
|
|
components: {
|
|
@@ -718,39 +726,105 @@
|
|
|
},
|
|
|
|
|
|
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 getJcdList(id){
|
|
|
+ this.queryInfo1['task_id'] = this.task_id
|
|
|
+ this.queryInfo1['task_profile_id'] = id
|
|
|
+ this.checkTestList = true
|
|
|
+ this.getJcds()
|
|
|
+ },
|
|
|
+ async getJcds() {
|
|
|
+ const {
|
|
|
+ data: res
|
|
|
+ } = await this.$http.post("getJcds", this.queryInfo1);
|
|
|
+ // console.log(res)
|
|
|
+ this.tableData1 = res.data.rows
|
|
|
+ for(let i= 0; i < this.tableData1.length; i++) {
|
|
|
+ if(this.tableData1[i].cyd_status = 1) {
|
|
|
+ this.tableData1[i].status = '未发布'
|
|
|
+ }else {
|
|
|
+ this.tableData1[i].status = '已发布'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(this.tableData1[0].cyd_status)
|
|
|
+ this.jcdListTotal = res.data.total
|
|
|
+
|
|
|
+ },
|
|
|
+ // 获取抽样单列表
|
|
|
+ async getCydlist(id) {
|
|
|
+ this.queryInfo['task_id'] = this.task_id
|
|
|
+ this.queryInfo['task_profile_id'] = id
|
|
|
+ this.getSampleListDialog = true
|
|
|
+ this.getCyds()
|
|
|
+ },
|
|
|
+ async getCyds() {
|
|
|
+ const {
|
|
|
+ data: res
|
|
|
+ } = await this.$http.post("getCyds", this.queryInfo);
|
|
|
+ // console.log(res)
|
|
|
+ this.tableData = res.data.rows
|
|
|
+ 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
|
|
|
+
|
|
|
+ },
|
|
|
|
|
|
+ // 删除不合格检测项目信息
|
|
|
+ async delJcdItem(id) {
|
|
|
+ let that = this
|
|
|
+ const result = await this.$http.post('delJcdItem', {jcd_item_id: id})
|
|
|
+ // 判断业务逻辑
|
|
|
+ if (result.data.code == 0) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '删除成功'
|
|
|
+ })
|
|
|
+ this.getJcdItems()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //新增不合格检测项目
|
|
|
+ async postJcdItem() {
|
|
|
+ let that = this
|
|
|
+ that.jcxItem['jcd_id'] = that.jcd_id
|
|
|
+ const result = await this.$http.post('postJcdItem', that.jcxItem)
|
|
|
+ if (result.data.code == 0) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '保存成功'
|
|
|
+ })
|
|
|
+ this.addJcxItemDialog = false
|
|
|
+ this.getJcdItems()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //获取不合格检测项目列表
|
|
|
+ async getJcdItems() {
|
|
|
+ let that = this
|
|
|
+ that.queryInfo2.jcd_id = that.jcd_id
|
|
|
+ const res = await this.$http.post('getJcdItems',that.queryInfo2)
|
|
|
+ console.log(res.data.data.rows)
|
|
|
+ this.jcxItems = res.data.data.rows
|
|
|
+ this.jcxItemTotal = res.data.data.tatal
|
|
|
+ },
|
|
|
+ //填报检测单完成
|
|
|
+ async putJcd() {
|
|
|
+ let that = this
|
|
|
+ that.jcd.jcd_id = that.jcd_id
|
|
|
+ const res = await this.$http.post('putJcd',that.jcd)
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '填报检测单成功'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.inputJcdShow = false
|
|
|
+ },
|
|
|
+
|
|
|
//查询
|
|
|
async searchData() {
|
|
|
console.log(this.queryInfo)
|
|
@@ -785,6 +859,26 @@
|
|
|
console.log(that.readForm)
|
|
|
},
|
|
|
|
|
|
+ //上传文件
|
|
|
+ handleRemove(file, fileList) {
|
|
|
+ console.log(file, fileList);
|
|
|
+ },
|
|
|
+ handlePreview(file) {
|
|
|
+ console.log(file);
|
|
|
+ },
|
|
|
+ beforeRemove(file, fileList) {
|
|
|
+ return this.$confirm(`确定移除 ${ file.name }?`);
|
|
|
+ },
|
|
|
+
|
|
|
+ // 上传成功
|
|
|
+ uploadSuccess(res) {
|
|
|
+ console.log(res.data)
|
|
|
+ this.jcd.file_url = res.data.fileUrl
|
|
|
+ this.jcd.file_name = res.data.fileName
|
|
|
+ console.log(this.jcd.file_url)
|
|
|
+ console.log(this.jcd.file_name)
|
|
|
+ },
|
|
|
+
|
|
|
//抽样标签详情
|
|
|
async getSampleTaskList(){
|
|
|
for (var key in this.queryInfo) {
|
|
@@ -821,109 +915,109 @@
|
|
|
},
|
|
|
|
|
|
// 上传成功
|
|
|
- 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
|
|
|
- }
|
|
|
- },
|
|
|
+ // 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'), '检测报告')
|
|
|
- },
|
|
|
+ // 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
|
|
|
- })
|
|
|
- console.log()
|
|
|
- if (res.data.code == 0) {
|
|
|
- that.formjc = res.data.data.result
|
|
|
- that.unitTest = res.data.data.result.unitTest
|
|
|
- that.resultjc = res.data.data.result_detail
|
|
|
- }
|
|
|
- console.log(that.formjc)
|
|
|
- console.log(that.resultjc)
|
|
|
- // },
|
|
|
+ // 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
|
|
|
+ // })
|
|
|
+ // console.log()
|
|
|
+ // if (res.data.code == 0) {
|
|
|
+ // that.formjc = res.data.data.result
|
|
|
+ // that.unitTest = res.data.data.result.unitTest
|
|
|
+ // that.resultjc = res.data.data.result_detail
|
|
|
+ // }
|
|
|
+ // console.log(that.formjc)
|
|
|
+ // console.log(that.resultjc)
|
|
|
+ // // },
|
|
|
|
|
|
- },
|
|
|
+ // },
|
|
|
//保存检测单
|
|
|
- async saveJcdItem() {
|
|
|
- console.log(this.testPesticides)
|
|
|
- console.log(this.underInfo)
|
|
|
- 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']
|
|
|
- }
|
|
|
-
|
|
|
+ // async saveJcdItem() {
|
|
|
+ // console.log(this.testPesticides)
|
|
|
+ // console.log(this.underInfo)
|
|
|
+ // 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("saveJcdItem", {
|
|
|
- pesticides: that.testPesticides,
|
|
|
- sample_id: that.sample_id
|
|
|
- });
|
|
|
- if (result.data.data.disable_upload_data == '') {
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '检测成功!'
|
|
|
- });
|
|
|
- that.inputCheckShow = false
|
|
|
- that.getJcdList(this.underInfo.underTake_id)
|
|
|
- } else if(result.data.data.enable_upload_data == ''){
|
|
|
- this.$message({
|
|
|
- type: 'error',
|
|
|
- message: '请输入检测数据'
|
|
|
- });
|
|
|
- } else{
|
|
|
- this.$message({
|
|
|
- type: 'error',
|
|
|
- message: '已存在数据保存失败,新增数据保存成功'
|
|
|
- });
|
|
|
- that.inputCheckShow = false
|
|
|
- that.getJcdList(this.underInfo.underTake_id)
|
|
|
- }
|
|
|
- },
|
|
|
- //检测单列表-检测
|
|
|
- async getJcdObjectItem(id,name) {
|
|
|
- this.inputCheckShow = true
|
|
|
|
|
|
+ // var that = this
|
|
|
+ // const result = await this.$http.post("saveJcdItem", {
|
|
|
+ // pesticides: that.testPesticides,
|
|
|
+ // sample_id: that.sample_id
|
|
|
+ // });
|
|
|
+ // if (result.data.data.disable_upload_data == '') {
|
|
|
+ // this.$message({
|
|
|
+ // type: 'success',
|
|
|
+ // message: '检测成功!'
|
|
|
+ // });
|
|
|
+ // that.inputCheckShow = false
|
|
|
+ // that.getJcdList(this.underInfo.underTake_id)
|
|
|
+ // } else if(result.data.data.enable_upload_data == ''){
|
|
|
+ // this.$message({
|
|
|
+ // type: 'error',
|
|
|
+ // message: '请输入检测数据'
|
|
|
+ // });
|
|
|
+ // } else{
|
|
|
+ // this.$message({
|
|
|
+ // type: 'error',
|
|
|
+ // message: '已存在数据保存失败,新增数据保存成功'
|
|
|
+ // });
|
|
|
+ // that.inputCheckShow = false
|
|
|
+ // that.getJcdList(this.underInfo.underTake_id)
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ //填报检测单
|
|
|
+ async getJcdObj(id) {
|
|
|
+ console.log(111)
|
|
|
+ this.inputJcdShow = true
|
|
|
+ console.log(222)
|
|
|
var that = this
|
|
|
const {
|
|
|
data: res
|
|
|
- } = await this.$http.post("getJcdObjectItem", {
|
|
|
- sample_id: id,
|
|
|
+ } = await this.$http.post("getJcdObj", {
|
|
|
+ cyd_id: id,
|
|
|
});
|
|
|
- that.testPesticides = res.data
|
|
|
- that.sample_name = name
|
|
|
- that.sample_id = id
|
|
|
- console.log(that.testPesticides)
|
|
|
+
|
|
|
+ that.jcd_id = res.data.jcd_id
|
|
|
+ console.log(that.jcd_id)
|
|
|
},
|
|
|
//检测单列表-上报
|
|
|
async upJcdItem(id){
|
|
@@ -946,72 +1040,7 @@
|
|
|
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
|
|
|
-
|
|
|
- console.log(this.underInfo)
|
|
|
- const {
|
|
|
- data: res
|
|
|
- } = await this.$http.post("getJcdList", this.underInfo);
|
|
|
-
|
|
|
- console.log(res.data)
|
|
|
|
|
|
- this.tableData1 = res.data.rows
|
|
|
- for (let i = 0; i < this.tableData1.length; i++) {
|
|
|
- if (this.tableData1[i].test_result == '0') {
|
|
|
- this.tableData1[i].testResult = '不合格'
|
|
|
- } else if (this.tableData1[i].test_result == '1') {
|
|
|
- this.tableData1[i].testResult = '合格'
|
|
|
- }else {
|
|
|
- this.tableData1[i].testResult = '未检测'
|
|
|
- }
|
|
|
- console.log(this.tableData1)
|
|
|
- this.testListTotal = res.data.total
|
|
|
- }
|
|
|
- for (let i = 0; i < this.tableData1.length; i++) {
|
|
|
- if (this.tableData1[i].test_status == '0') {
|
|
|
- this.tableData1[i].testStatus = '未上报'
|
|
|
- } else {
|
|
|
- this.tableData1[i].testStatus = '已上报'
|
|
|
- }
|
|
|
- console.log(this.tableData1)
|
|
|
- this.testListTotal = res.data.total
|
|
|
- }
|
|
|
- },
|
|
|
- // 获取抽样单列表
|
|
|
- async getCydlist(id) {
|
|
|
- this.queryInfo['task_id'] = this.task_id
|
|
|
- this.queryInfo['task_profile_id'] = id
|
|
|
- this.getSampleListDialog = true
|
|
|
- this.getCyds()
|
|
|
- },
|
|
|
- async getCyds() {
|
|
|
- const {
|
|
|
- data: res
|
|
|
- } = await this.$http.post("getCyds", this.queryInfo);
|
|
|
- // console.log(res)
|
|
|
- this.tableData = res.data.rows
|
|
|
- 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
|
|
|
-
|
|
|
- },
|
|
|
// 跳转到填写抽样单
|
|
|
inputSample() {
|
|
|
this.activeName = 'second'
|
|
@@ -1046,40 +1075,32 @@
|
|
|
})
|
|
|
},
|
|
|
// 上传抽样信息
|
|
|
- async upCydItem(id) {
|
|
|
+ async putCydStatus(id) {
|
|
|
let that = this
|
|
|
// that.orgs = that.multipleSelection
|
|
|
// console.log(that.multipleSelection)
|
|
|
- const result = await this.$http.post('upCydItem', {
|
|
|
- sample_id: id
|
|
|
+ const result = await this.$http.post('putCydStatus', {
|
|
|
+ cyd_id: id
|
|
|
})
|
|
|
console.log(result.data.data)
|
|
|
// this.getCyds()
|
|
|
// 判断业务逻辑
|
|
|
- if (result.data.code == 0) {
|
|
|
- this.$message({
|
|
|
+ this.$message({
|
|
|
type: 'success',
|
|
|
message: '上报抽样信息成功'
|
|
|
})
|
|
|
|
|
|
this.getCyds(result.data.data)
|
|
|
- }
|
|
|
- },
|
|
|
- // 多选删除抽样信息
|
|
|
- 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.getCyds()
|
|
|
- }
|
|
|
+ // if (result.data.code == 0) {
|
|
|
+ // this.$message({
|
|
|
+ // type: 'success',
|
|
|
+ // message: '上报抽样信息成功'
|
|
|
+ // })
|
|
|
+
|
|
|
+ // this.getCyds(result.data.data)
|
|
|
+ // }
|
|
|
},
|
|
|
+
|
|
|
/** 修复当用户在大于1的分页进行数据搜索没有返回值的问题 */
|
|
|
setPageNum() {
|
|
|
this.queryInfo.pageNum = 1
|
|
@@ -1109,14 +1130,25 @@
|
|
|
},
|
|
|
/** 监听每页显示多少数据的改变 */
|
|
|
handleSizeChange1(newSize) {
|
|
|
- this.unitInfo.pageSize = newSize
|
|
|
+ this.queryInfo1.pageSize = newSize
|
|
|
this.getJcdList()
|
|
|
},
|
|
|
|
|
|
/** 监听页码的改变 */
|
|
|
handleCurrentChange1(newPage) {
|
|
|
- this.unitInfo.pageNum = newPage
|
|
|
+ this.queryInfo1.pageNum = newPage
|
|
|
this.getJcdList()
|
|
|
+ },
|
|
|
+ /** 监听每页显示多少数据的改变 */
|
|
|
+ handleSizeChange2(newSize) {
|
|
|
+ this.queryInfo2.pageSize = newSize
|
|
|
+ this.getJcdItems()
|
|
|
+ },
|
|
|
+
|
|
|
+ /** 监听页码的改变 */
|
|
|
+ handleCurrentChange2(newPage) {
|
|
|
+ this.queryInfo2.pageNum = newPage
|
|
|
+ this.getJcdItems()
|
|
|
},
|
|
|
// 批量勾选
|
|
|
handleSelectionChange(val) {
|