123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200 |
- <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>任务列表</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="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> -->
- <div id="taskDetail">
- <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">
- 创建单位
- </template>
- {{readForm.creater.name}}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label">
- 发布单位
- </template>
- {{readForm.releaser.name}}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label">
- 年度
- </template>
- {{readForm.year}}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label">
- 监测类型
- </template>
- {{readForm.task_class}}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label">
- 开始时间
- </template>
- {{readForm.starttime}}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label">
- 结束时间
- </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">
- 抽检分离
- </template>
- <span v-if="readForm.is_divide==1">是</span>
- <span v-if="readForm.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.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.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">
- <!-- <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-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 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">查看抽样单列表
- </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="75%" :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" width="60">
- <template slot-scope="scope">
- <span v-if="scope.row.cydProfile.cyd_file_url==''">无</span>
- <el-link v-else type="primary" :href="scope.row.cydProfile.cyd_file_url">下载</el-link>
- </template>
- </el-table-column> -->
- <el-table-column label="操作" align="center" fixed="right">
- <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>
- </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="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="80%" :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="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>
- <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>
- </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">样品编码:{{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>
- <!-- 表格数据区域-->
- <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_num" class="labelItem" size="mini">
- <el-input disabled v-model="formjc.sample_num"></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="unitTest.unit_test_name" class="labelItem" style="" size="mini">
- <el-input disabled v-model="unitTest.unit_test_name"></el-input>
- </el-form-item>
- <el-form-item label="通讯地址" prop="unitTest.address" class="labelItem" style="" size="mini">
- <el-input disabled v-model="unitTest.address"></el-input>
- </el-form-item>
- <el-form-item label="法定代表人" prop="unitTest.represent_name" class="labelItem" style="" size="mini">
- <el-input disabled v-model="unitTest.represent_name"></el-input>
- </el-form-item>
- <el-form-item label="受检人" prop="unitTest.user_name" class="labelItem" style="" size="mini">
- <el-input disabled v-model="unitTest.user_name"></el-input>
- </el-form-item>
- <el-form-item label="电话" prop="unitTest.phone" class="labelItem" style="" size="mini">
- <el-input disabled v-model="unitTest.phone"></el-input>
- </el-form-item>
- <el-form-item label="传真" prop="unitTest.fax" class="labelItem" style="" size="mini">
- <el-input disabled v-model="unitTest.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>
- </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: {},
- unitTest: {},
- dialogVisible2: false,
- getSampleListDialog: false,
- checkTestList: false,
- activeName: 'first',
- id: 0,
- productNameText: '',
- pesticidesNameText: '',
- readForm: {
- creater: [],
- releaser: [],
- modelInfo: [],
- model_type: '',
-
- },
- sample_name: '',
- sample_id: '',
- sampleTask: [],
- underTask: [],
- unitTaskTotal: '0',
- underTasktotal: '0',
- testListTotal: '0',
- queryInfo: {
- pageNum: 1,
- pageSize: 10,
- },
- underInfo:{
- 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,
- cellStyle: {
- padding: 2 + 'px'
- },
- rowStyle: {
- height: 35 + 'px'
- },
- tableHeader: [{
- label: '抽样单编码',
- prop: 'cyd_code'
- // fixed: 'left'
- },
- {
- label: '受检单位',
- prop: 'inspectedUnit.inspected_name',
- width: 180
- },
- {
- label: '抽样日期',
- prop: 'cydProfile.cyd_date',
- width: 150
- },
- {
- label: '状态',
- prop: 'status',
- width: 100
- }
- ],
- //获取检测单列表表格
- checkHeader: [{
- label: '样品名称',
- prop: 'sample_name',
- width: 150
- // fixed: 'left'
- }, {
- label: '样品编码',
- prop: 'sample_id'
- // fixed: 'left'
- },
- {
- label: '受检单位',
- prop: 'unitTest.unit_test_name',
- width: 180
- },
- {
- label: '抽样单位',
- prop: 'undertake.bear_name',
- width: 180
- }, {
- label: '检测单位',
- prop: 'undertake.check_name',
- width: 180
- }, {
- label: '判定结果',
- prop: 'testResult',
- width: 100
- }, {
- label: '状态',
- prop: 'testStatus',
- width: 100
- }
- ],
- 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: 'sampleOrgId.name',
- width: 180,
- }, {
- label: '检测机构',
- prop: 'checkOrgId.name'
- },
- {
- label: '抽样地区',
- prop: 'sample_address'
- },
- // {
- // label: '抽样数量',
- // prop: 'sample_number',
- // width: 100,
- // },
- // {
- // 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.getTask()
- this.getCheckTaskList()
- },
- 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.getCyds()
- },
- //重置
- 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 getTask() {
- var that = this
- const {
- data: res
- } = await this.$http.post("getTask", {
- task_id: that.task_id,
- pageNum: that.queryInfo.pageNum,
- pageSize: that.queryInfo.pageSize
- });
-
- that.readForm = res.data
- console.log(that.readForm)
- },
- //抽样标签详情
- 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.underTask)
- },
-
- // 上传成功
- 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
- })
- 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']
- }
- 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 {
- data: res
- } = await this.$http.post("getJcdObjectItem", {
- sample_id: id,
- });
- that.testPesticides = res.data
- that.sample_name = name
- that.sample_id = id
- 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.getCyds()
- // 判断业务逻辑
- 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
- 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
- console.log(this.tableData)
- this.total = res.data.total
-
- },
- // 跳转到填写抽样单
- inputSample() {
- this.activeName = 'second'
- },
- // 填报抽样单
- input(id) {
- console.log(id)
- console.log(this.readForm.id)
- this.$router.push({
- name: 'fillSampleReport',
- params: {
- task_id: this.readForm.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 upCydItem(id) {
- let that = this
- // that.orgs = that.multipleSelection
- // console.log(that.multipleSelection)
- const result = await this.$http.post('upCydItem', {
- sample_id: id
- })
- console.log(result.data.data)
- // this.getCyds()
- // 判断业务逻辑
- if (result.data.code == 0) {
- 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()
- }
- },
- /** 修复当用户在大于1的分页进行数据搜索没有返回值的问题 */
- setPageNum() {
- this.queryInfo.pageNum = 1
- this.getCyds()
- },
- 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.getCyds()
- },
- /** 监听页码的改变 */
- handleCurrentChange(newPage) {
- this.queryInfo.pageNum = newPage
- this.getCyds()
- },
- /** 监听每页显示多少数据的改变 */
- handleSizeChange1(newSize) {
- this.unitInfo.pageSize = newSize
- this.getJcdList()
- },
- /** 监听页码的改变 */
- handleCurrentChange1(newPage) {
- this.unitInfo.pageNum = newPage
- this.getJcdList()
- },
- // 批量勾选
- 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: 'sampleReport',
- 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;
- }
- /deep/ #taskDetail{
- .el-descriptions-item__label.is-bordered-label{
- width: 18.75rem;}
- }
- </style>
|