setTaskcd.vue 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200
  1. <template>
  2. <div>
  3. <el-breadcrumb separator-class="el-icon-arrow-right">
  4. <el-breadcrumb-item>首页</el-breadcrumb-item>
  5. <el-breadcrumb-item>承担单位</el-breadcrumb-item>
  6. <el-breadcrumb-item>任务列表</el-breadcrumb-item>
  7. <el-breadcrumb-item>基本信息</el-breadcrumb-item>
  8. </el-breadcrumb>
  9. <!-- <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
  10. <el-tab-pane label="任务详情" name="taskDetail">
  11. </el-tab-pane>
  12. <el-tab-pane label="抽样" name="sampleDetail">
  13. <sampleDetailcd v-if="activeName == 'sampleDetail'" ref="sampleDetail"></sampleDetailcd>
  14. </el-tab-pane>
  15. <el-tab-pane label="检测" name="testDetail">
  16. </el-tab-pane>
  17. <el-tab-pane label="报告上传" name="reportDetail">
  18. </el-tab-pane>
  19. </el-tabs> -->
  20. <div id="taskDetail">
  21. <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
  22. <el-tab-pane label="任务详情" name="first">
  23. <el-descriptions class="margin-top" title=" " :column="2" :size="size" border>
  24. <el-descriptions-item>
  25. <template slot="label">
  26. 创建单位
  27. </template>
  28. {{readForm.creater.name}}
  29. </el-descriptions-item>
  30. <el-descriptions-item>
  31. <template slot="label">
  32. 发布单位
  33. </template>
  34. {{readForm.releaser.name}}
  35. </el-descriptions-item>
  36. <el-descriptions-item>
  37. <template slot="label">
  38. 年度
  39. </template>
  40. {{readForm.year}}
  41. </el-descriptions-item>
  42. <el-descriptions-item>
  43. <template slot="label">
  44. 监测类型
  45. </template>
  46. {{readForm.task_class}}
  47. </el-descriptions-item>
  48. <el-descriptions-item>
  49. <template slot="label">
  50. 开始时间
  51. </template>
  52. {{readForm.starttime}}
  53. </el-descriptions-item>
  54. <el-descriptions-item>
  55. <template slot="label">
  56. 结束时间
  57. </template>
  58. {{readForm.endtime}}
  59. </el-descriptions-item>
  60. <!-- <el-descriptions-item>
  61. <template slot="label">
  62. 行业
  63. </template>
  64. <span>{{readForm.model_type}}</span>
  65. </el-descriptions-item> -->
  66. <el-descriptions-item>
  67. <template slot="label">
  68. 抽检分离
  69. </template>
  70. <span v-if="readForm.is_divide==1">是</span>
  71. <span v-if="readForm.is_divide==0">否</span>
  72. </el-descriptions-item>
  73. <el-descriptions-item>
  74. <template slot="label">
  75. 附件
  76. </template>
  77. <div v-if="readForm.file_url==null">无</div>
  78. <el-link v-else type="primary" :href="readForm.file_url">下载附件</el-link>
  79. </el-descriptions-item>
  80. </el-descriptions>
  81. <el-descriptions class="margin-top" :size="size" border>
  82. <el-descriptions-item>
  83. <template slot="label">
  84. 备注
  85. </template>
  86. {{readForm.log}}
  87. </el-descriptions-item>
  88. </el-descriptions>
  89. <!-- <el-descriptions class="margin-top" :size="size" border>
  90. <el-descriptions-item>
  91. <template slot="label">
  92. 检测对象
  93. </template>
  94. {{productNameText}}
  95. </el-descriptions-item>
  96. </el-descriptions> -->
  97. <!-- <el-descriptions class="margin-top" :size="size" border>
  98. <el-descriptions-item>
  99. <template slot="label">
  100. 检测项
  101. </template>
  102. {{pesticidesNameText}}
  103. </el-descriptions-item>
  104. </el-descriptions> -->
  105. <!-- <el-table :data="underTask" border stripe highlight-current-row @current-change="handlecyCurrentChange" style="width: 100%"
  106. :row-style="rowStyle" :cell-style="cellStyle">
  107. <el-table-column :key="table.label" v-for="table in tableHeader2" :label="table.label"
  108. :prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
  109. </el-table> -->
  110. <!-- <div class="footer">
  111. <el-button type="success" size="mini" @click="input()">填报抽样单</el-button>
  112. <el-button type="success" size="mini" @click="next">导出总览</el-button>
  113. <el-button type="success" size="mini" @click="back">返回</el-button>
  114. </div> -->
  115. </el-tab-pane>
  116. <el-tab-pane label="抽样" name="second">
  117. <!-- <el-tab-pane v-if="sampleShow==true" label="抽样" name="second"> -->
  118. <!-- 头部搜索栏 -->
  119. <!-- <el-form style="display: flex; flex-direction: column;" ref="form2" :model="queryInfo">
  120. <el-row style="width: 75%;">
  121. <el-col :span="6">
  122. <el-form-item label="样品名称" class="select" size="small" prop="sample_name">
  123. <el-input v-model="queryInfo.sample_name"></el-input>
  124. </el-form-item>
  125. </el-col>
  126. <el-col :span="6">
  127. <el-form-item label="样品编码" class="select" size="small" prop="sample_id">
  128. <el-input v-model="queryInfo.sample_id"></el-input>
  129. </el-form-item>
  130. </el-col>
  131. <el-col :span="6">
  132. <el-form-item label="受检单位" class="select" size="small" prop="units_name">
  133. <el-input v-model="queryInfo.unit_test_name"></el-input>
  134. </el-form-item>
  135. </el-col>
  136. </el-row>
  137. <el-row style="width: 75%;">
  138. <el-col :span="6">
  139. <el-form-item label="抽样单位" class="select" size="small" prop="sample_unit_name">
  140. <el-input v-model="queryInfo.unit_sample_name"></el-input>
  141. </el-form-item>
  142. </el-col>
  143. <el-col :span="6">
  144. <el-form-item label="抽样日期" class="select" size="small" prop="sample_data">
  145. <el-input v-model="queryInfo.sample_data"></el-input>
  146. </el-form-item>
  147. </el-col>
  148. <el-col :span="6">
  149. <el-form-item label="抽样场所" class="select" size="small" prop="sample_ground">
  150. <el-input v-model="queryInfo.sample_ground"></el-input>
  151. </el-form-item>
  152. </el-col>
  153. <el-col :span="4">
  154. <el-button style="height: 32px;margin-left: 10px;" size="mini" type="success"
  155. @click="searchData()">查询
  156. </el-button>
  157. <el-button style="height: 32px;margin-left: 5px;" size="mini" type="success" @click="resetForm('form2')">
  158. 重置
  159. </el-button>
  160. </el-col>
  161. </el-row>
  162. </el-form> -->
  163. <el-row style="margin-right: 0px;">
  164. <el-table :data="underTask" border stripe highlight-current-row @current-change="handlecyCurrentChange" style="width: 100%"
  165. :row-style="rowStyle" :cell-style="cellStyle">
  166. <el-table-column :key="table.label" v-for="table in tableHeader2" :label="table.label"
  167. :prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
  168. <el-table-column label="操作" align="center" fixed="right">
  169. <template slot-scope="scope">
  170. <el-button style="margin:5px 0" type="success" size="small" plain @click="input(scope.row.id)">填报抽样单
  171. </el-button>
  172. <!-- <el-button type="success" size="small" plain @click="sampleDetail(scope.row.sample_id)">查看 -->
  173. <el-button style="margin-bottom:5px" type="success" size="small" @click="getCydlist(scope.row.id)">查看抽样单列表
  174. </el-button>
  175. <!-- <el-button type="success" size="small" plain @click="sampleDetail(scope.row.sample_id)" @focus="getSampleListDialog = true">查看抽样单列表
  176. </el-button> -->
  177. <!-- <el-button type="primary" size="small" plain icon="el-icon-edit-outline" @click="appear">上报抽样信息
  178. </el-button> -->
  179. </template>
  180. </el-table-column>
  181. </el-table>
  182. <!-- 抽样单列表对话框 -->
  183. <el-dialog title="抽样单列表" :visible.sync="getSampleListDialog" width="75%" :close-on-click-modal="false" class="dialogItem">
  184. <el-form v-if="getSampleListDialog">
  185. <!-- 表格数据区域-->
  186. <el-table ref="multipleTable" :data="tableData" border stripe highlight-current-row
  187. @selection-change="handleSelectionChange" style="width: 100%" :row-style="rowStyle"
  188. :cell-style="cellStyle">
  189. <el-table-column type="selection" width="50"></el-table-column>
  190. <el-table-column label="序号" width="50px">
  191. <template slot-scope="scope">
  192. {{ scope.$index+1 }}
  193. </template>
  194. </el-table-column>
  195. <el-table-column :key="table.label" v-for="table in tableHeader" :label="table.label"
  196. :prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
  197. <!-- <el-table-column label="附件" align="center" width="60">
  198. <template slot-scope="scope">
  199. <span v-if="scope.row.cydProfile.cyd_file_url==''">无</span>
  200. <el-link v-else type="primary" :href="scope.row.cydProfile.cyd_file_url">下载</el-link>
  201. </template>
  202. </el-table-column> -->
  203. <el-table-column label="操作" align="center" fixed="right">
  204. <template slot-scope="scope">
  205. <el-button style="margin:5px 5px" type="success" size="small" plain @click="sampleDetail(scope.row.id)">查看
  206. </el-button>
  207. <el-button style="margin:5px 5px" type="primary" size="small" plain icon="el-icon-edit-outline" @click="upCydItem(scope.row.sample_id)">上报抽样信息
  208. </el-button>
  209. </template>
  210. </el-table-column>
  211. </el-table>
  212. <!-- 分页器区域-->
  213. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
  214. :current-page="queryInfo.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo.pageSize"
  215. layout="total, sizes, prev, pager, next, jumper" :total="total" background />
  216. </el-form>
  217. </el-dialog>
  218. </el-row>
  219. </el-tab-pane>
  220. <el-tab-pane label="检测" name="third">
  221. <!-- <el-tab-pane v-if="checkShow==true" label="检测" name="third"> -->
  222. <el-table :data="underTask" border stripe highlight-current-row @current-change="handlecyCurrentChange" style="width: 100%"
  223. :row-style="rowStyle" :cell-style="cellStyle">
  224. <el-table-column :key="table.label" v-for="table in tableHeader2" :label="table.label"
  225. :prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
  226. <el-table-column label="操作" align="center" fixed="right">
  227. <template slot-scope="scope">
  228. <!-- <el-button type="success" size="small" plain @click="input(scope.row.id)">填报抽样单
  229. </el-button> -->
  230. <!-- <el-button type="success" size="small" plain @click="sampleDetail(scope.row.sample_id)">查看 -->
  231. <el-button style="margin:5px 0" type="success" size="small" @click="getJcdList(scope.row.id)">查看检测单列表
  232. </el-button>
  233. <!-- <el-button type="success" size="small" plain @click="sampleDetail(scope.row.sample_id)" @focus="getSampleListDialog = true">查看抽样单列表
  234. </el-button> -->
  235. <!-- <el-button type="primary" size="small" plain icon="el-icon-edit-outline" @click="appearTest">上报检测信息
  236. </el-button> -->
  237. </template>
  238. </el-table-column>
  239. </el-table>
  240. <!-- 查看检测单列表弹框 -->
  241. <el-dialog title="检测单列表" :visible.sync="checkTestList" width="80%" :close-on-click-modal="false"
  242. class="dialogItem">
  243. <!-- 表格数据区域-->
  244. <el-table :data="tableData1" border stripe highlight-current-row style="width: 100%"
  245. :row-style="rowStyle" :cell-style="cellStyle">
  246. <!-- <el-table-column type="selection" width="50"></el-table-column> -->
  247. <el-table-column label="序号" width="50px">
  248. <template slot-scope="scope">
  249. {{ scope.$index+1 }}
  250. </template>
  251. </el-table-column>
  252. <el-table-column :key="table.label" v-for="table in checkHeader" :label="table.label"
  253. :prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
  254. <el-table-column label="操作" align="center" fixed="right" width="350px">
  255. <template slot-scope="scope">
  256. <el-button style="margin:5px 5px" type="success" size="mini" v-if="scope.row.jc_value_id==null" plain
  257. @click="getJcdObjectItem(scope.row.sample_id,scope.row.sample_name)">检测</el-button>
  258. <el-button style="margin:5px 5px" type="primary" v-else size="mini" plain @click="update(scope.row)">修改</el-button>
  259. <el-button style="margin:5px 5px" type="primary" size="mini" plain @click="upJcdItem(scope.row.sample_id)">上报
  260. </el-button>
  261. <el-button style="margin:5px 5px" type="primary" size="mini" plain @click="creatpdf(scope.row.sample_id)">生成检测报告
  262. </el-button>
  263. </template>
  264. </el-table-column>
  265. </el-table>
  266. <!-- 分页器区域-->
  267. <el-pagination @size-change="handleSizeChange1" @current-change="handleCurrentChange1"
  268. :current-page="underInfo.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="underInfo.pageSize"
  269. layout="total, sizes, prev, pager, next, jumper" :total="testListTotal" background />
  270. </el-dialog>
  271. </el-tab-pane>
  272. <el-dialog title="填写检测单" :visible.sync="inputCheckShow" width="70%" :close-on-click-modal="false"
  273. class="dialogItem">
  274. <span class="demonstration">样品编码:{{sample_id}}</span>
  275. <span class="demonstration">样品名称:{{sample_name}}</span>
  276. <el-button type="success" size="small" plain @click="saveJcdItem()">保存</el-button>
  277. <span class="demonstration">注意:“不得检出”只能填为“ND”</span>
  278. <!-- 表格数据区域-->
  279. <el-table :data="testPesticides" border stripe highlight-current-row style="width: 100%"
  280. :row-style="rowStyle" :cell-style="cellStyle">
  281. <el-table-column :key="table.label" v-for="table in checkHeader2" :label="table.label"
  282. :prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
  283. <el-table-column label="检测值">
  284. <template slot-scope="scope">
  285. <el-input v-model="scope.row.test_value" size="small" />
  286. </template>
  287. </el-table-column>
  288. <el-table-column label="限量值">
  289. <template slot-scope="scope">
  290. <el-input v-model="scope.row.state_value" size="small" />
  291. </template>
  292. </el-table-column>
  293. <el-table-column label="单位">
  294. <!-- <template slot-scope="scope">
  295. <span v-model="scope.row.unit" size="small">mg/kg</span>
  296. </template> -->
  297. </el-table-column>
  298. <el-table-column label="抽检结果">
  299. <template slot-scope="scope">
  300. <span v-if="parseFloat(scope.row.test_value)<=parseFloat(scope.row.state_value)&&scope.row.state_value!='ND'"
  301. size="small">合格</span>
  302. <span v-else-if="parseFloat(scope.row.test_value)>parseFloat(scope.row.state_value)" size="small">不合格</span>
  303. <span v-else-if="scope.row.test_value=='ND'&&scope.row.state_value=='ND'"
  304. size="small">合格</span>
  305. <span v-else-if="scope.row.test_value!='ND'&&scope.row.state_value=='ND'"
  306. size="small">不合格</span>
  307. </template>
  308. </el-table-column>
  309. <el-table-column label="LOD">
  310. <template slot-scope="scope">
  311. <el-input v-model="scope.row.LOD" size="small" />
  312. </template>
  313. </el-table-column>
  314. <el-table-column label="LOQ">
  315. <template slot-scope="scope">
  316. <el-input v-model="scope.row.LOQ" />
  317. </template>
  318. </el-table-column>
  319. </el-table>
  320. </el-dialog>
  321. <!-- ///////////////////////////////////////////检测报告生成-------难、、、、、、、、、、、、、、、、、、、、、、 -->
  322. <el-dialog title="生成监测报告" :visible.sync="dialogVisible2" width="50%">
  323. <div id="pdf">
  324. <el-form ref="formjc" :model="formjc" label-width="100px"
  325. style="margin-top: 20px;width: 100%;background-color: aliceblue;padding: 5px;">
  326. <el-row style="text-align: center; font-size: 23px; margin: 40px 0;">
  327. 安徽省农业农村厅农产品质量安全例行监测检测报告
  328. </el-row>
  329. <el-row>
  330. <el-col :span="12">
  331. <el-form-item label="样品名称" prop="sample_name" class="labelItem" size="mini">
  332. <el-input disabled v-model="formjc.sample_name"></el-input>
  333. </el-form-item>
  334. </el-col>
  335. <el-col :span="11">
  336. <el-form-item label="样品编码" prop="sample_id" class="labelItem" style="" size="mini">
  337. <el-input disabled v-model="formjc.sample_id"></el-input>
  338. </el-form-item>
  339. </el-col>
  340. </el-row>
  341. <el-row>
  342. <el-col :span="12">
  343. <el-form-item label="型号规格" prop="type" class="labelItem" size="mini">
  344. <el-input disabled v-model="formjc.type"></el-input>
  345. </el-form-item>
  346. </el-col>
  347. <el-col :span="11">
  348. <el-form-item label="执行标准" prop="standard" class="labelItem" style="" size="mini">
  349. <el-input disabled v-model="formjc.standard"></el-input>
  350. </el-form-item>
  351. </el-col>
  352. </el-row>
  353. <el-row>
  354. <el-col :span="12">
  355. <el-form-item label="生产日期或批号" prop="production_date" class="labelItem" size="mini">
  356. <el-input disabled v-model="formjc.production_date"></el-input>
  357. </el-form-item>
  358. </el-col>
  359. <el-col :span="11">
  360. <el-form-item label="产地" prop="place" class="labelItem" style="" size="mini">
  361. <el-input disabled v-model="formjc.place"></el-input>
  362. </el-form-item>
  363. </el-col>
  364. </el-row>
  365. <el-row>
  366. <el-col :span="12">
  367. <el-form-item label="产品认证情况" prop="certicfie" class="labelItem" size="mini">
  368. <el-input disabled v-model="formjc.certicfie"></el-input>
  369. </el-form-item>
  370. </el-col>
  371. <el-col :span="11">
  372. <el-form-item label="证书编号" prop="certifie_num" class="labelItem" style="" size="mini">
  373. <el-input disabled v-model="formjc.certifie_num"></el-input>
  374. </el-form-item>
  375. </el-col>
  376. </el-row>
  377. <el-row>
  378. <el-col :span="12">
  379. <el-row>
  380. <el-col :span="13">
  381. <el-form-item label="抽样数量" prop="sample_num" class="labelItem" size="mini">
  382. <el-input disabled v-model="formjc.sample_num"></el-input>
  383. </el-form-item>
  384. </el-col>
  385. <el-col :span="10">
  386. <el-form-item label="单位" prop="sample_num_unit" class="labelItem" size="mini"
  387. label-width="60px">
  388. <el-input disabled v-model="formjc.sample_num_unit"></el-input>
  389. </el-form-item>
  390. </el-col>
  391. </el-row>
  392. </el-col>
  393. <el-col :span="11">
  394. <el-row>
  395. <el-col :span="13">
  396. <el-form-item label="抽样基数" prop="sample_base" class="labelItem" size="mini">
  397. <el-input disabled v-model="formjc.sample_base"></el-input>
  398. </el-form-item>
  399. </el-col>
  400. <el-col :span="10">
  401. <el-form-item label="单位" prop="sample_base_unit" class="labelItem" size="mini"
  402. label-width="60px" clearable>
  403. <el-input disabled v-model="formjc.sample_base_unit"></el-input>
  404. </el-form-item>
  405. </el-col>
  406. </el-row>
  407. </el-col>
  408. </el-row>
  409. <el-row>
  410. <el-col>
  411. <el-form-item label="抽样场所" prop="sample_ground" class="labelItem" size="mini">
  412. <el-input disabled v-model="formjc.sample_ground"></el-input>
  413. </el-form-item>
  414. </el-col>
  415. </el-row>
  416. <el-row>
  417. <el-col :span="7" style="text-align: center;vertical-align: middle;line-height: 250px;font-size: 14px;">
  418. <div class="">
  419. 受检单位情况
  420. </div>
  421. </el-col>
  422. <el-col :span="15">
  423. <el-form-item label="单位名称" prop="unitTest.unit_test_name" class="labelItem" style="" size="mini">
  424. <el-input disabled v-model="unitTest.unit_test_name"></el-input>
  425. </el-form-item>
  426. <el-form-item label="通讯地址" prop="unitTest.address" class="labelItem" style="" size="mini">
  427. <el-input disabled v-model="unitTest.address"></el-input>
  428. </el-form-item>
  429. <el-form-item label="法定代表人" prop="unitTest.represent_name" class="labelItem" style="" size="mini">
  430. <el-input disabled v-model="unitTest.represent_name"></el-input>
  431. </el-form-item>
  432. <el-form-item label="受检人" prop="unitTest.user_name" class="labelItem" style="" size="mini">
  433. <el-input disabled v-model="unitTest.user_name"></el-input>
  434. </el-form-item>
  435. <el-form-item label="电话" prop="unitTest.phone" class="labelItem" style="" size="mini">
  436. <el-input disabled v-model="unitTest.phone"></el-input>
  437. </el-form-item>
  438. <el-form-item label="传真" prop="unitTest.fax" class="labelItem" style="" size="mini">
  439. <el-input disabled v-model="unitTest.fax"></el-input>
  440. </el-form-item>
  441. </el-col>
  442. </el-row>
  443. </el-form>
  444. <el-table :data="resultjc" border stripe highlight-current-row style="width: 100%"
  445. :row-style="rowStyle" :cell-style="cellStyle">
  446. <el-table-column :key="table.label" v-for="table in jcheader" :label="table.label"
  447. :prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
  448. </el-table>
  449. </div>
  450. <div style="margin-top: 10px; text-align: center">
  451. <el-button @click="dialogVisible2 = false">取 消</el-button>
  452. <el-button type="primary" @click="download">生成检测报告pdf</el-button>
  453. </div>
  454. <!-- </span> -->
  455. </el-dialog>
  456. <!-- <el-tab-pane label="报告上传" name="five">
  457. <el-upload class="upload-demo" :file-list="fileList" drag :headers="myHeaders"
  458. action="http://syjcapi.aielab.net/api/v1/ossUpload" :on-success="uploadSuccess" :limit="1">
  459. <i class="el-icon-upload"></i>
  460. <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
  461. </el-upload>
  462. </el-tab-pane> -->
  463. </el-tabs>
  464. </div>
  465. </div>
  466. </template>
  467. <script>
  468. import htmlToPdf from '../../assets/js/htmlToPdf.js'
  469. import inputCheck from './inputCheck'
  470. const token = window.sessionStorage.getItem('token')
  471. const name = window.sessionStorage.getItem('name')
  472. export default {
  473. name: 'setTask',
  474. data() {
  475. return {
  476. size: 'medium',
  477. myHeaders: {
  478. Authorization: 'bearer' + token
  479. },
  480. formjc: {},
  481. unitTest: {},
  482. dialogVisible2: false,
  483. getSampleListDialog: false,
  484. checkTestList: false,
  485. activeName: 'first',
  486. id: 0,
  487. productNameText: '',
  488. pesticidesNameText: '',
  489. readForm: {
  490. creater: [],
  491. releaser: [],
  492. modelInfo: [],
  493. model_type: '',
  494. },
  495. sample_name: '',
  496. sample_id: '',
  497. sampleTask: [],
  498. underTask: [],
  499. unitTaskTotal: '0',
  500. underTasktotal: '0',
  501. testListTotal: '0',
  502. queryInfo: {
  503. pageNum: 1,
  504. pageSize: 10,
  505. },
  506. underInfo:{
  507. pageNum: 1,
  508. pageSize: 10,
  509. underTake_id: ''
  510. },
  511. releaserInfo:{
  512. groupname: '',
  513. rymc:'',
  514. },
  515. taskInfo:{
  516. base_file_url: null,
  517. batch: '',
  518. creater: null,
  519. createtime: null,
  520. endtime: null,
  521. endtime_cydsb: null,
  522. file_name: null,
  523. file_url: null,
  524. filenum: null,
  525. id: null,
  526. industry: null,
  527. is_divide: null,
  528. ispublic:null,
  529. level:null,
  530. log: null,
  531. main_unit: null,
  532. releaser:null,
  533. starttime: null,
  534. status: null,
  535. task_class: null,
  536. task_name:null,
  537. test_model_id:null,
  538. year: null,
  539. },
  540. // 填报对话框弹出
  541. inputDialogShow: false,
  542. cellStyle: {
  543. padding: 2 + 'px'
  544. },
  545. rowStyle: {
  546. height: 35 + 'px'
  547. },
  548. tableHeader: [{
  549. label: '抽样单编码',
  550. prop: 'cyd_code'
  551. // fixed: 'left'
  552. },
  553. {
  554. label: '受检单位',
  555. prop: 'inspectedUnit.inspected_name',
  556. width: 180
  557. },
  558. {
  559. label: '抽样日期',
  560. prop: 'cydProfile.cyd_date',
  561. width: 150
  562. },
  563. {
  564. label: '状态',
  565. prop: 'status',
  566. width: 100
  567. }
  568. ],
  569. //获取检测单列表表格
  570. checkHeader: [{
  571. label: '样品名称',
  572. prop: 'sample_name',
  573. width: 150
  574. // fixed: 'left'
  575. }, {
  576. label: '样品编码',
  577. prop: 'sample_id'
  578. // fixed: 'left'
  579. },
  580. {
  581. label: '受检单位',
  582. prop: 'unitTest.unit_test_name',
  583. width: 180
  584. },
  585. {
  586. label: '抽样单位',
  587. prop: 'undertake.bear_name',
  588. width: 180
  589. }, {
  590. label: '检测单位',
  591. prop: 'undertake.check_name',
  592. width: 180
  593. }, {
  594. label: '判定结果',
  595. prop: 'testResult',
  596. width: 100
  597. }, {
  598. label: '状态',
  599. prop: 'testStatus',
  600. width: 100
  601. }
  602. ],
  603. checkHeader2: [{
  604. label: '检测项目',
  605. prop: 'test_name',
  606. // fixed: 'left'
  607. }],
  608. // 数据表格数据
  609. tableData: [],
  610. tableData1: [],
  611. options: [],
  612. task_id: '',
  613. multipleSelection: null,
  614. // 填报检测对话框
  615. inputCheckShow: false,
  616. check_name: '',
  617. check_id: '',
  618. testPesticides: [],
  619. resultjc: [],
  620. // 模型列表
  621. options: [],
  622. bindForm: {
  623. test_model_id: '',
  624. closingdate: ''
  625. },
  626. jcheader: [{
  627. label: '检测项目',
  628. prop: 'test_name',
  629. },
  630. {
  631. label: '检测值',
  632. prop: 'test_value',
  633. }, {
  634. label: '限量值',
  635. prop: 'state_value',
  636. }, {
  637. label: '单位',
  638. prop: 'unit',
  639. }, {
  640. label: '抽检结果',
  641. prop: 'test_result'
  642. }, {
  643. label: 'LOD',
  644. prop: 'LOD',
  645. }, {
  646. label: 'LOQ',
  647. prop: 'LOQ',
  648. }
  649. ],
  650. tableHeader2: [{
  651. label: '抽样机构',
  652. prop: 'sampleOrgId.name',
  653. width: 180,
  654. }, {
  655. label: '检测机构',
  656. prop: 'checkOrgId.name'
  657. },
  658. {
  659. label: '抽样地区',
  660. prop: 'sample_address'
  661. },
  662. // {
  663. // label: '抽样数量',
  664. // prop: 'sample_number',
  665. // width: 100,
  666. // },
  667. // {
  668. // label: '报告上传单位',
  669. // prop: 'report_name'
  670. // },
  671. // {
  672. // label: '任务截止时间',
  673. // prop: 'uploadtime'
  674. // }
  675. ],
  676. fileList: [],
  677. total: 0,
  678. sampleShow: false, //是否展示抽样卡片
  679. checkShow: false, //是否展示检测卡片
  680. currentRow: null,
  681. //选中机构地域表格数据项
  682. };
  683. },
  684. components: {
  685. inputCheck
  686. },
  687. mounted() {},
  688. created() {
  689. this.task_id = this.$route.params.id
  690. this.getTask()
  691. this.getCheckTaskList()
  692. },
  693. methods: {
  694. // 获取机构地域表格
  695. // async getUnderTask() {
  696. // this.queryInfo['task_id'] = this.task_id
  697. // const result = await this.$http.post('getUnderTask', this.queryInfo)
  698. // // 判断业务逻辑
  699. // if (result.data.code == 0) {
  700. // this.underTask = result.data.data.rows
  701. // // 抽检分离时判断用户是抽样机构还是检测机构
  702. // for (let i = 0; i < this.underTask.length; i++) {
  703. // if (this.underTask[i].bear_name == name) {
  704. // this.sampleShow = true
  705. // }
  706. // if (this.underTask[i].check_name == name) {
  707. // this.checkShow = true
  708. // }
  709. // }
  710. // this.underTasktotal = result.data.data.total
  711. // }
  712. // },
  713. // 获取模型列表
  714. // async getmodelList() {
  715. // const {
  716. // data: res
  717. // } = await this.$http.post(
  718. // "getModelList", {
  719. // 'pageNum': 1,
  720. // 'pageSize': 100,
  721. // type_id: ""
  722. // }
  723. // );
  724. // this.options = res.data.rows
  725. // }, // 获取任务详情
  726. //查询
  727. async searchData() {
  728. console.log(this.queryInfo)
  729. this.queryInfo.pageNum = 1
  730. this.getCyds()
  731. },
  732. //重置
  733. resetForm(formName) {
  734. // console.log(this.queryInfo)
  735. this.$refs[formName].resetFields();
  736. },
  737. //选中抽样任务(单选)
  738. handlecyCurrentChange(val) {
  739. this.currentRow = val;
  740. console.log(this.currentRow)
  741. console.log(this.currentRow.id)
  742. // under_id =
  743. },
  744. //获取任务详情
  745. async getTask() {
  746. var that = this
  747. const {
  748. data: res
  749. } = await this.$http.post("getTask", {
  750. task_id: that.task_id,
  751. pageNum: that.queryInfo.pageNum,
  752. pageSize: that.queryInfo.pageSize
  753. });
  754. that.readForm = res.data
  755. console.log(that.readForm)
  756. },
  757. //抽样标签详情
  758. async getSampleTaskList(){
  759. for (var key in this.queryInfo) {
  760. if (this.queryInfo[key] == '') {
  761. delete this.queryInfo[key]
  762. }
  763. }
  764. var that = this
  765. const {
  766. data: res
  767. } = await this.$http.post("getSampleTaskList", {
  768. task_id: that.task_id,
  769. // pageNum: that.queryInfo.pageNum,
  770. // pageSize: that.queryInfo.pageSize
  771. });
  772. console.log(res)
  773. that.sampleTask = res.data.rows
  774. console.log(that.sampleTask)
  775. },
  776. //检测标签详情
  777. async getCheckTaskList(){
  778. var that = this
  779. const {
  780. data: res
  781. } = await this.$http.post("getCheckTaskList", {
  782. task_id: that.task_id,
  783. // pageNum: that.queryInfo.pageNum,
  784. // pageSize: that.queryInfo.pageSize
  785. });
  786. console.log(res)
  787. that.underTask = res.data.rows
  788. console.log(that.underTask)
  789. },
  790. // 上传成功
  791. async uploadSuccess(res) {
  792. console.log(res.data)
  793. this.form.file_url = res.data.fileUrl
  794. this.form.file_name = res.data.fileName
  795. const result = await this.$http.post('saveTestFile', {
  796. sample_id: sample_id
  797. })
  798. if (result.data.code == 0) {
  799. that.formjc = result.data.data
  800. }
  801. },
  802. //下载检测报告
  803. download() {
  804. htmlToPdf.downloadPDF(document.querySelector('#pdf'), '检测报告')
  805. },
  806. //生成检测报告pdf
  807. async creatpdf(sample_id) {
  808. var that = this
  809. that.dialogVisible2 = true
  810. // async getSampleDetail() {
  811. // const result = await this.$http.post('getSampleDetail', {
  812. // sample_id: sample_id
  813. // })
  814. // if (result.data.code == 0) {
  815. // that.formjc = result.data.data
  816. // }
  817. // console.log(that.formjc)
  818. const res = await this.$http.post('getTestValue', {
  819. sample_id: sample_id
  820. })
  821. console.log()
  822. if (res.data.code == 0) {
  823. that.formjc = res.data.data.result
  824. that.unitTest = res.data.data.result.unitTest
  825. that.resultjc = res.data.data.result_detail
  826. }
  827. console.log(that.formjc)
  828. console.log(that.resultjc)
  829. // },
  830. },
  831. //保存检测单
  832. async saveJcdItem() {
  833. console.log(this.testPesticides)
  834. console.log(this.underInfo)
  835. for (let i = 0; i < this.testPesticides.length; i++) {
  836. this.testPesticides[i]['unit'] = 'mg/kg'
  837. console.log(this.testPesticides[i]['state_value'])
  838. if (this.testPesticides[i]['state_value'] === 'ND') {
  839. if (this.testPesticides[i]['test_value'] !== 'ND') {
  840. this.testPesticides[i]['test_result'] = '不合格'
  841. }
  842. } else {
  843. if (this.testPesticides[i]['test_value'] <= this.testPesticides[i]['state_value']) {
  844. this.testPesticides[i]['test_result'] = '合格'
  845. } else if (this.testPesticides[i]['test_value'] > this.testPesticides[i]['state_value']) {
  846. this.testPesticides[i]['test_result'] = '不合格'
  847. }
  848. }
  849. delete this.testPesticides[i]['test_model_id']
  850. }
  851. var that = this
  852. const result = await this.$http.post("saveJcdItem", {
  853. pesticides: that.testPesticides,
  854. sample_id: that.sample_id
  855. });
  856. if (result.data.data.disable_upload_data == '') {
  857. this.$message({
  858. type: 'success',
  859. message: '检测成功!'
  860. });
  861. that.inputCheckShow = false
  862. that.getJcdList(this.underInfo.underTake_id)
  863. } else if(result.data.data.enable_upload_data == ''){
  864. this.$message({
  865. type: 'error',
  866. message: '请输入检测数据'
  867. });
  868. } else{
  869. this.$message({
  870. type: 'error',
  871. message: '已存在数据保存失败,新增数据保存成功'
  872. });
  873. that.inputCheckShow = false
  874. that.getJcdList(this.underInfo.underTake_id)
  875. }
  876. },
  877. //检测单列表-检测
  878. async getJcdObjectItem(id,name) {
  879. this.inputCheckShow = true
  880. var that = this
  881. const {
  882. data: res
  883. } = await this.$http.post("getJcdObjectItem", {
  884. sample_id: id,
  885. });
  886. that.testPesticides = res.data
  887. that.sample_name = name
  888. that.sample_id = id
  889. console.log(that.testPesticides)
  890. },
  891. //检测单列表-上报
  892. async upJcdItem(id){
  893. var that = this
  894. const result = await this.$http.post('upJcdItem', {
  895. sample_id: id
  896. })
  897. console.log(result.data.data)
  898. // this.getCyds()
  899. // 判断业务逻辑
  900. if (result.data.code == 0) {
  901. this.$message({
  902. type: 'success',
  903. message: '上报抽样信息成功'
  904. })
  905. this.getJcdList(result.data.data)
  906. }
  907. },
  908. handleClick(tab, event) {
  909. console.log(tab, event);
  910. },
  911. // 获取检测单列表
  912. async getJcdList(id){
  913. this.checkTestList = true
  914. console.log(id)
  915. // for (var key in this.queryInfo) {
  916. // if (this.queryInfo[key] == '') {
  917. // delete this.queryInfo[key]
  918. // }
  919. // }
  920. // this.queryInfo['underTake_id'] = id
  921. // this.underInfo['task_id'] = this.task_id
  922. this.underInfo['underTake_id'] = id
  923. console.log(this.underInfo)
  924. const {
  925. data: res
  926. } = await this.$http.post("getJcdList", this.underInfo);
  927. console.log(res.data)
  928. this.tableData1 = res.data.rows
  929. for (let i = 0; i < this.tableData1.length; i++) {
  930. if (this.tableData1[i].test_result == '0') {
  931. this.tableData1[i].testResult = '不合格'
  932. } else if (this.tableData1[i].test_result == '1') {
  933. this.tableData1[i].testResult = '合格'
  934. }else {
  935. this.tableData1[i].testResult = '未检测'
  936. }
  937. console.log(this.tableData1)
  938. this.testListTotal = res.data.total
  939. }
  940. for (let i = 0; i < this.tableData1.length; i++) {
  941. if (this.tableData1[i].test_status == '0') {
  942. this.tableData1[i].testStatus = '未上报'
  943. } else {
  944. this.tableData1[i].testStatus = '已上报'
  945. }
  946. console.log(this.tableData1)
  947. this.testListTotal = res.data.total
  948. }
  949. },
  950. // 获取抽样单列表
  951. async getCydlist(id) {
  952. this.queryInfo['task_id'] = this.task_id
  953. this.queryInfo['task_profile_id'] = id
  954. this.getSampleListDialog = true
  955. this.getCyds()
  956. },
  957. async getCyds() {
  958. const {
  959. data: res
  960. } = await this.$http.post("getCyds", this.queryInfo);
  961. // console.log(res)
  962. this.tableData = res.data.rows
  963. console.log(this.tableData)
  964. this.total = res.data.total
  965. },
  966. // 跳转到填写抽样单
  967. inputSample() {
  968. this.activeName = 'second'
  969. },
  970. // 填报抽样单
  971. input(id) {
  972. console.log(id)
  973. console.log(this.readForm.id)
  974. this.$router.push({
  975. name: 'fillSampleReport',
  976. params: {
  977. task_id: this.readForm.id,
  978. under_id:id
  979. }
  980. })
  981. // }
  982. // if(isset(this.currentRow.id)){
  983. // this.under_id=this.currentRow.id
  984. // }
  985. // console.log(this.currentRow.id)
  986. },
  987. // 返回
  988. back() {
  989. var that = this
  990. this.$router.push({
  991. name: 'setTaskcd',
  992. params: {
  993. id: that.id
  994. }
  995. })
  996. },
  997. // 上传抽样信息
  998. async upCydItem(id) {
  999. let that = this
  1000. // that.orgs = that.multipleSelection
  1001. // console.log(that.multipleSelection)
  1002. const result = await this.$http.post('upCydItem', {
  1003. sample_id: id
  1004. })
  1005. console.log(result.data.data)
  1006. // this.getCyds()
  1007. // 判断业务逻辑
  1008. if (result.data.code == 0) {
  1009. this.$message({
  1010. type: 'success',
  1011. message: '上报抽样信息成功'
  1012. })
  1013. this.getCyds(result.data.data)
  1014. }
  1015. },
  1016. // 多选删除抽样信息
  1017. async delAll() {
  1018. let that = this
  1019. // that.orgs = that.multipleSelection
  1020. console.log(that.multipleSelection)
  1021. const result = await this.$http.post('delSample', that.multipleSelection)
  1022. // 判断业务逻辑
  1023. if (result.data.code == 0) {
  1024. this.$message({
  1025. type: 'success',
  1026. message: '删除成功'
  1027. })
  1028. this.getCyds()
  1029. }
  1030. },
  1031. /** 修复当用户在大于1的分页进行数据搜索没有返回值的问题 */
  1032. setPageNum() {
  1033. this.queryInfo.pageNum = 1
  1034. this.getCyds()
  1035. },
  1036. setSelectedRow() {
  1037. // 设置当前页已选项
  1038. this.hander = true
  1039. this.tableData.forEach(item => {
  1040. if (this.list.includes(item[this.uniqueKey])) {
  1041. this.$refs.multipleTable.toggleRowSelection(item, true)
  1042. }
  1043. })
  1044. this.hander = false
  1045. },
  1046. /** 监听每页显示多少数据的改变 */
  1047. handleSizeChange(newSize) {
  1048. this.queryInfo.pageSize = newSize
  1049. this.getCyds()
  1050. },
  1051. /** 监听页码的改变 */
  1052. handleCurrentChange(newPage) {
  1053. this.queryInfo.pageNum = newPage
  1054. this.getCyds()
  1055. },
  1056. /** 监听每页显示多少数据的改变 */
  1057. handleSizeChange1(newSize) {
  1058. this.unitInfo.pageSize = newSize
  1059. this.getJcdList()
  1060. },
  1061. /** 监听页码的改变 */
  1062. handleCurrentChange1(newPage) {
  1063. this.unitInfo.pageNum = newPage
  1064. this.getJcdList()
  1065. },
  1066. // 批量勾选
  1067. handleSelectionChange(val) {
  1068. this.multipleSelection = val
  1069. console.log(this.multipleSelection)
  1070. if (this.hander) return false
  1071. // this.setSelectRows() // 处理选中的方法
  1072. },
  1073. // 跳转到查看抽样单详情
  1074. sampleDetail(id) {
  1075. console.log(id)
  1076. this.$router.push({
  1077. name: 'sampleReport',
  1078. params: {
  1079. id: id
  1080. }
  1081. })
  1082. }
  1083. }
  1084. }
  1085. </script>
  1086. <style lang="less" scoped>
  1087. .el-breadcrumb {
  1088. margin-bottom: 20px;
  1089. }
  1090. // .el-form-item {
  1091. // margin-bottom: 0px;
  1092. // }
  1093. .el-select {
  1094. width: 210px;
  1095. height: 100%;
  1096. }
  1097. .select {
  1098. display: flex;
  1099. flex-direction: row;
  1100. margin-left: 10px;
  1101. }
  1102. // .el-form {
  1103. // margin-left: 35%;
  1104. // }
  1105. // .el-form-item {
  1106. // // margin-bottom: 8px;
  1107. // margin: 0 auto;
  1108. // }
  1109. // .labelItem /deep/ .el-form-item__label {
  1110. // // width: 80px;
  1111. // text-align: center;
  1112. // vertical-align: middle;
  1113. // float: left;
  1114. // font-size: 14px;
  1115. // color: #606266;
  1116. // font-weight: bold;
  1117. // // line-height: 40px;
  1118. // padding: 0 20px 0 0;
  1119. // -webkit-box-sizing: border-box;
  1120. // box-sizing: border-box;
  1121. // }
  1122. .demonstration {
  1123. margin: 20px;
  1124. }
  1125. // .el-form-item__content {
  1126. // width: 200px;
  1127. // }
  1128. .footer {
  1129. margin-top: 20px;
  1130. margin-left: 45%;
  1131. }
  1132. .el-table{
  1133. margin-top: 20px;
  1134. }
  1135. .el-pagination {
  1136. margin-top: 25px;
  1137. }
  1138. /deep/ #taskDetail{
  1139. .el-descriptions-item__label.is-bordered-label{
  1140. width: 18.75rem;}
  1141. }
  1142. </style>