setReturnTasks.vue 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597
  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 v-if="readForm.is_divide==1">是</span>
  65. <span v-if="readForm.is_divide==0">否</span>
  66. </el-descriptions-item>
  67. <el-descriptions-item>
  68. <template slot="label">
  69. 附件
  70. </template>
  71. <div v-if="readForm.file_url==null">无</div>
  72. <el-link v-else type="primary" :href="readForm.file_url">下载附件</el-link>
  73. </el-descriptions-item>
  74. </el-descriptions>
  75. <el-descriptions class="margin-top" :size="size" border>
  76. <el-descriptions-item>
  77. <template slot="label">
  78. 备注
  79. </template>
  80. {{readForm.log}}
  81. </el-descriptions-item>
  82. </el-descriptions>
  83. </el-tab-pane>
  84. <el-tab-pane label="退回" name="fourth">
  85. <div>
  86. <el-table :data="thTask" border stripe highlight-current-row @current-change="handlecyCurrentChange" style="width: 100%"
  87. :row-style="rowStyle" :cell-style="cellStyle">
  88. <el-table-column :key="table.label" v-for="table in thtableHeader" :label="table.label"
  89. :prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
  90. <el-table-column label="操作" align="center" fixed="right">
  91. <template slot-scope="scope">
  92. <el-button style="margin:5px 0" type="success" size="small" @click="checkUnqualifiedItems(scope.row.task_id,scope.row.id)">查看不合格检测项
  93. </el-button>
  94. </template>
  95. </el-table-column>
  96. </el-table>
  97. <!-- 分页器区域-->
  98. <el-pagination @size-change="handleSizeChangeth" @current-change="handleCurrentChangeth"
  99. :current-page="queryInfoth.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfoth.pageSize"
  100. layout="total, sizes, prev, pager, next, jumper" :total="thTaskTotal" background />
  101. <!-- 不合格检测项目 -->
  102. <el-dialog title="不合格检测项目" :visible.sync="UnqualifiedJcxItemDialog" width="70%" :close-on-click-modal="false"
  103. class="dialogItem">
  104. <el-table :data="thjcxItems" border stripe highlight-current-row style="width: 100%"
  105. :row-style="rowStyle" :cell-style="cellStyle">
  106. <!-- <el-table-column type="selection" width="50" align="center"></el-table-column> -->
  107. <el-table-column label="序号" width="50px" align="center">
  108. <template slot-scope="scope">
  109. {{ scope.$index+1 }}
  110. </template>
  111. </el-table-column>
  112. <el-table-column :key="table.label" v-for="table in thjcxHeader" :label="table.label" :prop="table.prop"
  113. align="center" :width="table.width" :fixed="table.fixed" />
  114. </el-table>
  115. <el-pagination @size-change="handleSizeChangethItems" @current-change="handleCurrentChangethItems"
  116. :current-page="queryInfothItems.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfothItems.pageSize"
  117. layout="total, sizes, prev, pager, next, jumper" :total="thItemsTotal" background />
  118. </el-dialog>
  119. </div>
  120. </el-tab-pane>
  121. <el-tab-pane label="抽样" name="second">
  122. <!-- <el-tab-pane v-if="sampleShow==true" label="抽样" name="second"> -->
  123. <!-- 头部搜索栏 -->
  124. <!-- <el-form style="display: flex; flex-direction: column;" ref="form2" :model="queryInfo">
  125. <el-row style="width: 75%;">
  126. <el-col :span="6">
  127. <el-form-item label="样品名称" class="select" size="small" prop="sample_name">
  128. <el-input v-model="queryInfo.sample_name"></el-input>
  129. </el-form-item>
  130. </el-col>
  131. <el-col :span="6">
  132. <el-form-item label="样品编码" class="select" size="small" prop="sample_id">
  133. <el-input v-model="queryInfo.sample_id"></el-input>
  134. </el-form-item>
  135. </el-col>
  136. <el-col :span="6">
  137. <el-form-item label="受检单位" class="select" size="small" prop="units_name">
  138. <el-input v-model="queryInfo.unit_test_name"></el-input>
  139. </el-form-item>
  140. </el-col>
  141. </el-row>
  142. <el-row style="width: 75%;">
  143. <el-col :span="6">
  144. <el-form-item label="抽样单位" class="select" size="small" prop="sample_unit_name">
  145. <el-input v-model="queryInfo.unit_sample_name"></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_data">
  150. <el-input v-model="queryInfo.sample_data"></el-input>
  151. </el-form-item>
  152. </el-col>
  153. <el-col :span="6">
  154. <el-form-item label="抽样场所" class="select" size="small" prop="sample_ground">
  155. <el-input v-model="queryInfo.sample_ground"></el-input>
  156. </el-form-item>
  157. </el-col>
  158. <el-col :span="4">
  159. <el-button style="height: 32px;margin-left: 10px;" size="mini" type="success"
  160. @click="searchData()">查询
  161. </el-button>
  162. <el-button style="height: 32px;margin-left: 5px;" size="mini" type="success" @click="resetForm('form2')">
  163. 重置
  164. </el-button>
  165. </el-col>
  166. </el-row>
  167. </el-form> -->
  168. <el-row style="margin-right: 0px;">
  169. <el-table :data="underTask" border stripe highlight-current-row @current-change="handlecyCurrentChange" style="width: 100%"
  170. :row-style="rowStyle" :cell-style="cellStyle">
  171. <el-table-column :key="table.label" v-for="table in tableHeader2" :label="table.label"
  172. :prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
  173. <el-table-column label="操作" align="center" fixed="right">
  174. <template slot-scope="scope">
  175. <el-button style="margin:5px 0" type="success" size="small" plain @click="input(scope.row.id)">填报抽样单
  176. </el-button>
  177. <el-button style="margin-bottom:5px" type="success" size="small" @click="getCydlist(scope.row.id)">查看抽样单列表
  178. </el-button>
  179. <!-- <el-button type="success" size="small" plain @click="sampleDetail(scope.row.sample_id)" @focus="getSampleListDialog = true">查看抽样单列表
  180. </el-button> -->
  181. <!-- <el-button type="primary" size="small" plain icon="el-icon-edit-outline" @click="appear">上报抽样信息
  182. </el-button> -->
  183. </template>
  184. </el-table-column>
  185. </el-table>
  186. <!-- 抽样单列表对话框 -->
  187. <el-dialog title="抽样单列表" :visible.sync="getSampleListDialog" width="75%" :close-on-click-modal="false" class="dialogItem">
  188. <el-form v-if="getSampleListDialog">
  189. <!-- 表格数据区域-->
  190. <el-table ref="multipleTable" :data="tableData" border stripe highlight-current-row
  191. @selection-change="handleSelectionChange" style="width: 100%" :row-style="rowStyle"
  192. :cell-style="cellStyle">
  193. <el-table-column type="selection" width="50"></el-table-column>
  194. <el-table-column label="序号" width="50px">
  195. <template slot-scope="scope">
  196. {{ scope.$index+1 }}
  197. </template>
  198. </el-table-column>
  199. <el-table-column :key="table.label" v-for="table in tableHeader" :label="table.label"
  200. :prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
  201. <!-- <el-table-column label="附件" align="center" width="60">
  202. <template slot-scope="scope">
  203. <span v-if="scope.row.cydProfile.cyd_file_url==''">无</span>
  204. <el-link v-else type="primary" :href="scope.row.cydProfile.cyd_file_url">下载</el-link>
  205. </template>
  206. </el-table-column> -->
  207. <el-table-column label="操作" align="center" fixed="right">
  208. <template slot-scope="scope">
  209. <el-button style="margin:5px 5px" type="success" size="small" plain @click="sampleDetail(scope.row.id)">查看
  210. </el-button>
  211. <el-button style="margin:5px 5px" type="primary" size="small" plain icon="el-icon-edit-outline" v-if="scope.row.cyd_status == 1" @click="putCydStatus(scope.row.id)">上报抽样信息
  212. </el-button>
  213. <el-button style="margin:5px 5px" type="success" size="small" plain v-if="scope.row.cyd_status == 1" @click="deleteCyd(scope.row.id)">删除
  214. </el-button>
  215. <el-button style="margin:5px 5px" type="primary" size="small" plain icon="el-icon-edit-outline" v-else>抽样信息已上报
  216. </el-button>
  217. </template>
  218. </el-table-column>
  219. </el-table>
  220. <!-- 分页器区域-->
  221. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
  222. :current-page="queryInfo.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo.pageSize"
  223. layout="total, sizes, prev, pager, next, jumper" :total="total" background />
  224. </el-form>
  225. </el-dialog>
  226. </el-row>
  227. </el-tab-pane>
  228. <el-tab-pane label="检测" name="third">
  229. <!-- <el-tab-pane v-if="checkShow==true" label="检测" name="third"> -->
  230. <el-table :data="underTask" border stripe highlight-current-row @current-change="handlecyCurrentChange" style="width: 100%"
  231. :row-style="rowStyle" :cell-style="cellStyle">
  232. <el-table-column :key="table.label" v-for="table in tableHeader2" :label="table.label"
  233. :prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
  234. <el-table-column label="操作" align="center" fixed="right">
  235. <template slot-scope="scope">
  236. <el-button style="margin:5px 0" type="success" size="small" @click="getJcdList(scope.row.id)">查看检测单列表
  237. </el-button>
  238. </template>
  239. </el-table-column>
  240. </el-table>
  241. <!-- 查看检测单列表弹框 -->
  242. <el-dialog title="检测单列表" :visible.sync="checkTestList" width="70%" :close-on-click-modal="false"
  243. class="dialogItem">
  244. <!-- 表格数据区域-->
  245. <el-table :data="tableData1" border stripe highlight-current-row style="width: 100%"
  246. :row-style="rowStyle" :cell-style="cellStyle">
  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" plain
  257. @click="getSamplesLists(scope.row.id)">获取样品列表</el-button>
  258. <!-- <el-button style="margin:5px 5px" type="primary" size="mini" plain @click="creatpdf(scope.row.sample_id)">生成检测报告
  259. </el-button> -->
  260. </template>
  261. </el-table-column>
  262. </el-table>
  263. <!-- 分页器区域-->
  264. <el-pagination @size-change="handleSizeChange1" @current-change="handleCurrentChange1"
  265. :current-page="queryInfo1.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo1.pageSize"
  266. layout="total, sizes, prev, pager, next, jumper" :total="jcdListTotal" background />
  267. </el-dialog>
  268. </el-tab-pane>
  269. <el-dialog title="样品信息列表" :visible.sync="getSamplesList" width="75%" :close-on-click-modal="false"
  270. class="dialogItem">
  271. <!-- 表格数据区域-->
  272. <el-table ref="multipleTable" :data="yptableData" border stripe highlight-current-row style="width: 100%; margin:auto;"
  273. :row-style="rowStyle" :cell-style="cellStyle">
  274. <el-table-column type="selection" width="50"></el-table-column>
  275. <el-table-column label="序号" width="50px">
  276. <template slot-scope="scope">
  277. {{ scope.$index+1 }}
  278. </template>
  279. </el-table-column>
  280. <el-table-column :key="table.label" v-for="table in yptableHeader" :label="table.label" :prop="table.prop"
  281. align="center" :width="table.width" :fixed="table.fixed" />
  282. <el-table-column label="操作" align="center">
  283. <template slot-scope="scope">
  284. <el-col style="margin-bottom: 5px;">
  285. <el-button style="margin:5px 5px" type="success" size="mini" v-if="scope.row.jcd==null" plain
  286. @click="getJcdObj(scope.row.id,scope.row.cyd_id)">填报检测单</el-button>
  287. <!-- <el-button style="margin:5px 5px" type="primary" v-else size="mini" plain @click="update(scope.row)">修改</el-button> -->
  288. <el-button style="margin:5px 5px" type="primary" size="mini" plain @click="putJcdStatus(scope.row.jcd.id,scope.row.cyd_id)" v-else-if="scope.row.jcd.jcd_status == '1'">上报检测单
  289. </el-button>
  290. <el-button style="margin:5px 5px" type="primary" size="mini" plain v-else-if="scope.row.jcd.jcd_status == '3'">检测单已上报
  291. </el-button>
  292. </el-col>
  293. </template>
  294. </el-table-column>
  295. </el-table>
  296. <el-pagination @size-change="handleSizeChangeyp" @current-change="handleCurrentChangeyp"
  297. :current-page="ypqueryInfo.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="ypqueryInfo.pageSize"
  298. layout="total, sizes, prev, pager, next, jumper" :total="samplesListTotal" background />
  299. </el-dialog>
  300. <el-dialog title="填报检测单" :visible.sync="inputJcdShow" width="70%" :close-on-click-modal="false"
  301. class="dialogItem">
  302. <div id="inputJcd" style="margin:10px 50px; width:100%">
  303. <el-form :rules="rules" :model="jcd">
  304. <el-row>
  305. <el-col :span="10">
  306. <el-form-item label="检测单编码:" prop="jcd_code" class="labelItem">
  307. <el-input v-model="jcd.jcd_code" placeholder="请输入检测单编码" style="width:50%;margin-left:5px;"></el-input>
  308. </el-form-item>
  309. </el-col>
  310. <el-col :span="6">
  311. <el-form-item label="检测结果:" prop="jcd_result" class="labelItem">
  312. <el-radio-group v-model="jcd.jcd_result">
  313. <el-radio :label="1">合格</el-radio>
  314. <el-radio :label="0">不合格</el-radio>
  315. </el-radio-group>
  316. </el-form-item>
  317. </el-col>
  318. </el-row>
  319. <!-- 上传检测报告 -->
  320. <el-form-item label="检测单报告上传:" prop="jcd" class="labelItem">
  321. <el-upload
  322. class="upload-demo"
  323. :headers="myHeaders"
  324. action='http://syjcapi.aielab.net/api/v1/ossUpload'
  325. :on-preview="handlePreview"
  326. :on-remove="handleRemove"
  327. :before-remove="beforeRemove"
  328. :on-success="uploadSuccess"
  329. multiple
  330. :file-list="fileList">
  331. <el-button size="small" type="primary">点击上传</el-button>
  332. <div slot="tip" class="el-upload__tip">只能上传pdf文件,且不超过500kb</div>
  333. </el-upload>
  334. </el-form-item>
  335. </el-form>
  336. </div>
  337. <!-- <div v-show="jcd.jcd_result==0"> -->
  338. <div style="display: flex;flex-direction: row;float: right;margin-bottom: 10px;" v-show="jcd.jcd_result==0">
  339. <el-button type="success" size="small" plain @click="addJcxItemDialog = true">新增不合格项</el-button>
  340. </div>
  341. <div v-show="jcd.jcd_result==0" id="additems">
  342. <!-- 表格数据区域-->
  343. <el-table border :data="jcxItems" >
  344. <el-table-column type="selection"></el-table-column>
  345. <el-table-column label="序号">
  346. <template slot-scope="scope">
  347. {{scope.$index+1}}
  348. </template>
  349. </el-table-column>
  350. <el-table-column :key="table.label" v-for="table in jcxHeader" :label="table.label" :prop="table.prop" align="center"></el-table-column>
  351. <el-table-column label="操作" align="center">
  352. <template slot-scope="scope">
  353. <el-col>
  354. <el-button type="success" size="mini" @click="delJcdItem(scope.row.id)">删除</el-button>
  355. </el-col>
  356. </template>
  357. </el-table-column>
  358. </el-table>
  359. <!-- <el-table ref="multipleTable" :data="jcxItems" border stripe highlight-current-row style="margin:auto;width:100%;"
  360. :row-style="rowStyle" :cell-style="cellStyle">
  361. <el-table-column type="selection" width="50px"></el-table-column>
  362. <el-table-column label="序号" width="50px">
  363. <template slot-scope="scope">
  364. {{ scope.$index+1 }}
  365. </template>
  366. </el-table-column>
  367. <el-table-column :key="table.label" v-for="table in jcxHeader" :label="table.label" :prop="table.prop"
  368. align="center" :width="table.width" :fixed="table.fixed" />
  369. <el-table-column label="操作" align="center">
  370. <template slot-scope="scope">
  371. <el-col style="margin-bottom: 5px;">
  372. <el-button type="success" size="mini" @click="delJcdItem(scope.row.id)">删除</el-button>
  373. </el-col>
  374. </template>
  375. </el-table-column>
  376. </el-table> -->
  377. <!-- 分页器区域-->
  378. <el-pagination @size-change="handleSizeChange2" @current-change="handleCurrentChange2"
  379. :current-page="queryInfo2.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo2.pageSize"
  380. layout="total, sizes, prev, pager, next, jumper" :total="jcxItemTotal" background />
  381. </div>
  382. <!--
  383. <el-table :data="jcxItems" border stripe highlight-current-row style="width: 100%;"
  384. :row-style="rowStyle" :cell-style="cellStyle" align="center" v-show="jcd.jcd_result==0">
  385. <el-table-column label="序号" align="center" style="width: auto;">
  386. <template slot-scope="scope">
  387. {{ scope.$index+1 }}
  388. </template>
  389. </el-table-column>
  390. <el-table-column :key="table.label" v-for="table in jcxHeader" :label="table.label"
  391. :prop="table.prop" align="center" :width="table.width" :fixed="table.fixed">
  392. </el-table-column>
  393. <el-table-column label="操作" align="center">
  394. <template slot-scope="scope">
  395. <el-col style="margin: 5px auto">
  396. <el-button type="success" size="mini" @click="delJcdItem(scope.row.id)">删除</el-button>
  397. </el-col>
  398. </template>
  399. </el-table-column>
  400. </el-table> -->
  401. <div class="footer">
  402. <el-button type="success" style="margin-bottom:30px;" size="small" @click="putJcd()">完成</el-button>
  403. </div>
  404. </el-dialog>
  405. <el-dialog title="新增不合格检测项目" :visible.sync="addJcxItemDialog" width="40%" :close-on-click-modal="false"
  406. class="dialogItem">
  407. <div id="addUnqualifiedJcx" style="margin:auto;">
  408. <el-form ref="jcxform" :rules="rules" :model="jcxItem" style="margin:10px auto;">
  409. <el-form-item label="检测项目:" prop="item_name" class="labelItem">
  410. <el-input v-model="jcxItem.item_name" style="width:42%"></el-input>
  411. </el-form-item>
  412. <el-form-item label="标准指标:" prop="item_standard" class="labelItem">
  413. <el-input v-model="jcxItem.item_standard" style="width:42%;"></el-input>
  414. </el-form-item>
  415. <el-form-item label="实测值:" prop="item_measured_value" class="labelItem">
  416. <el-input v-model="jcxItem.item_measured_value" style="width:42%"></el-input>
  417. </el-form-item>
  418. <el-form-item label="单项判定:" prop="item_result" class="labelItem">
  419. <el-input v-model="jcxItem.item_result" style="width:42%"></el-input>
  420. </el-form-item>
  421. <el-form-item label="监测依据:" prop="item_basis" class="labelItem">
  422. <el-input v-model="jcxItem.item_basis" style="width:42%"></el-input>
  423. </el-form-item>
  424. <el-form-item label="备注:" prop="item_log" class="labelItem">
  425. <el-input v-model="jcxItem.item_log" style="width:42%"></el-input>
  426. </el-form-item>
  427. </el-form>
  428. </div>
  429. <div class="footer">
  430. <el-button type="success" style="margin-bottom:30px;" size="small" @click="postJcdItem('jcxform')">保存</el-button>
  431. </div>
  432. </el-dialog>
  433. <!-- ///////////////////////////////////////////检测报告生成-------难、、、、、、、、、、、、、、、、、、、、、、 -->
  434. <el-dialog title="生成监测报告" :visible.sync="dialogVisible2" width="50%">
  435. <div id="pdf">
  436. <el-form ref="formjc" :model="formjc" label-width="100px"
  437. style="margin-top: 20px;width: 100%;background-color: aliceblue;padding: 5px;">
  438. <el-row style="text-align: center; font-size: 23px; margin: 40px 0;">
  439. 安徽省农业农村厅农产品质量安全例行监测检测报告
  440. </el-row>
  441. <el-row>
  442. <el-col :span="12">
  443. <el-form-item label="样品名称" prop="sample_name" class="labelItem" size="mini">
  444. <el-input disabled v-model="formjc.sample_name"></el-input>
  445. </el-form-item>
  446. </el-col>
  447. <el-col :span="11">
  448. <el-form-item label="样品编码" prop="sample_id" class="labelItem" style="" size="mini">
  449. <el-input disabled v-model="formjc.sample_id"></el-input>
  450. </el-form-item>
  451. </el-col>
  452. </el-row>
  453. <el-row>
  454. <el-col :span="12">
  455. <el-form-item label="型号规格" prop="type" class="labelItem" size="mini">
  456. <el-input disabled v-model="formjc.type"></el-input>
  457. </el-form-item>
  458. </el-col>
  459. <el-col :span="11">
  460. <el-form-item label="执行标准" prop="standard" class="labelItem" style="" size="mini">
  461. <el-input disabled v-model="formjc.standard"></el-input>
  462. </el-form-item>
  463. </el-col>
  464. </el-row>
  465. <el-row>
  466. <el-col :span="12">
  467. <el-form-item label="生产日期或批号" prop="production_date" class="labelItem" size="mini">
  468. <el-input disabled v-model="formjc.production_date"></el-input>
  469. </el-form-item>
  470. </el-col>
  471. <el-col :span="11">
  472. <el-form-item label="产地" prop="place" class="labelItem" style="" size="mini">
  473. <el-input disabled v-model="formjc.place"></el-input>
  474. </el-form-item>
  475. </el-col>
  476. </el-row>
  477. <el-row>
  478. <el-col :span="12">
  479. <el-form-item label="产品认证情况" prop="certicfie" class="labelItem" size="mini">
  480. <el-input disabled v-model="formjc.certicfie"></el-input>
  481. </el-form-item>
  482. </el-col>
  483. <el-col :span="11">
  484. <el-form-item label="证书编号" prop="certifie_num" class="labelItem" style="" size="mini">
  485. <el-input disabled v-model="formjc.certifie_num"></el-input>
  486. </el-form-item>
  487. </el-col>
  488. </el-row>
  489. <el-row>
  490. <el-col :span="12">
  491. <el-row>
  492. <el-col :span="13">
  493. <el-form-item label="抽样数量" prop="sample_num" class="labelItem" size="mini">
  494. <el-input disabled v-model="formjc.sample_num"></el-input>
  495. </el-form-item>
  496. </el-col>
  497. <el-col :span="10">
  498. <el-form-item label="单位" prop="sample_num_unit" class="labelItem" size="mini"
  499. label-width="60px">
  500. <el-input disabled v-model="formjc.sample_num_unit"></el-input>
  501. </el-form-item>
  502. </el-col>
  503. </el-row>
  504. </el-col>
  505. <el-col :span="11">
  506. <el-row>
  507. <el-col :span="13">
  508. <el-form-item label="抽样基数" prop="sample_base" class="labelItem" size="mini">
  509. <el-input disabled v-model="formjc.sample_base"></el-input>
  510. </el-form-item>
  511. </el-col>
  512. <el-col :span="10">
  513. <el-form-item label="单位" prop="sample_base_unit" class="labelItem" size="mini"
  514. label-width="60px" clearable>
  515. <el-input disabled v-model="formjc.sample_base_unit"></el-input>
  516. </el-form-item>
  517. </el-col>
  518. </el-row>
  519. </el-col>
  520. </el-row>
  521. <el-row>
  522. <el-col>
  523. <el-form-item label="抽样场所" prop="sample_ground" class="labelItem" size="mini">
  524. <el-input disabled v-model="formjc.sample_ground"></el-input>
  525. </el-form-item>
  526. </el-col>
  527. </el-row>
  528. <el-row>
  529. <el-col :span="7" style="text-align: center;vertical-align: middle;line-height: 250px;font-size: 14px;">
  530. <div class="">
  531. 受检单位情况
  532. </div>
  533. </el-col>
  534. <el-col :span="15">
  535. <el-form-item label="单位名称" prop="unitTest.unit_test_name" class="labelItem" style="" size="mini">
  536. <el-input disabled v-model="unitTest.unit_test_name"></el-input>
  537. </el-form-item>
  538. <el-form-item label="通讯地址" prop="unitTest.address" class="labelItem" style="" size="mini">
  539. <el-input disabled v-model="unitTest.address"></el-input>
  540. </el-form-item>
  541. <el-form-item label="法定代表人" prop="unitTest.represent_name" class="labelItem" style="" size="mini">
  542. <el-input disabled v-model="unitTest.represent_name"></el-input>
  543. </el-form-item>
  544. <el-form-item label="受检人" prop="unitTest.user_name" class="labelItem" style="" size="mini">
  545. <el-input disabled v-model="unitTest.user_name"></el-input>
  546. </el-form-item>
  547. <el-form-item label="电话" prop="unitTest.phone" class="labelItem" style="" size="mini">
  548. <el-input disabled v-model="unitTest.phone"></el-input>
  549. </el-form-item>
  550. <el-form-item label="传真" prop="unitTest.fax" class="labelItem" style="" size="mini">
  551. <el-input disabled v-model="unitTest.fax"></el-input>
  552. </el-form-item>
  553. </el-col>
  554. </el-row>
  555. </el-form>
  556. <el-table :data="resultjc" border stripe highlight-current-row style="width: 100%"
  557. :row-style="rowStyle" :cell-style="cellStyle">
  558. <el-table-column :key="table.label" v-for="table in jcheader" :label="table.label"
  559. :prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
  560. </el-table>
  561. </div>
  562. <!-- <div style="margin-top: 10px; text-align: center">
  563. <el-button @click="dialogVisible2 = false">取 消</el-button>
  564. <el-button type="primary" @click="download">生成检测报告pdf</el-button>
  565. </div> -->
  566. <!-- </span> -->
  567. </el-dialog>
  568. <!-- <el-tab-pane label="报告上传" name="five">
  569. <el-upload class="upload-demo" :file-list="fileList" drag :headers="myHeaders"
  570. action="http://syjcapi.aielab.net/api/v1/ossUpload" :on-success="uploadSuccess" :limit="1">
  571. <i class="el-icon-upload"></i>
  572. <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
  573. </el-upload>
  574. </el-tab-pane> -->
  575. </el-tabs>
  576. </div>
  577. </div>
  578. </template>
  579. <script>
  580. import htmlToPdf from '../../assets/js/htmlToPdf.js'
  581. import inputCheck from './inputCheck'
  582. const token = window.sessionStorage.getItem('token')
  583. const name = window.sessionStorage.getItem('name')
  584. export default {
  585. name: 'setTask',
  586. data() {
  587. return {
  588. size: 'medium',
  589. myHeaders: {
  590. Authorization: token
  591. },
  592. rules: {
  593.                 item_name: [{required: true, message: '该项为必填项', trigger: 'blur'},],
  594. // inspected_address: [{required: true, message: '请输入单位地址', trigger: 'blur'},],
  595. item_standard: [{required: true, message: '该项为必填项', trigger: 'blur'},],
  596. item_measured_value: [{required: true, message: '该项为必填项', trigger: 'blur'},],
  597. item_result: [{required: true, message: '该项为必填项', trigger: 'blur'},],
  598. item_basis: [{required: true, message: '该项为必填项', trigger: 'blur'},],
  599. item_log: [{required: true, message: '该项为必填项', trigger: 'blur'},],
  600. },
  601. radio:{},
  602. formjc: {},
  603. unitTest: {},
  604. dialogVisible2: false,
  605. getSampleListDialog: false,//抽样单列表对话框
  606. checkTestList: false,//检测单列表对话框
  607. addJcxItemDialog: false,//新增不合格检测项目对话框
  608. getSamplesList: false,//检测单列表中获取样品信息对话框
  609. UnqualifiedJcxItemDialog: false,//退回中查看不合格检测项目对话框
  610. jcxItemTotal: 0,
  611. samplesListTotal: 0,
  612. activeName: 'first',
  613. jcxItems: [],
  614. thjcxItems:[],
  615. thItemsTotal: 0,
  616. id: 0,
  617. jcd: {
  618. jcd_result: 1,
  619. file_name: '',
  620. file_url: '',
  621. sample_id: '',
  622. cyd_id: ''
  623. },
  624. readForm: {
  625. creater: [],
  626. releaser: [],
  627. modelInfo: [],
  628. model_type: '',
  629. },
  630. // sample_name: '',
  631. // sample_id: '',
  632. sampleTask: [],
  633. underTask: [],
  634. jcdListTotal: 0,
  635. queryInfo: {
  636. pageNum: 1,
  637. pageSize: 10,
  638. },
  639. queryInfo1:{
  640. pageNum: 1,
  641. pageSize: 10,
  642. task_id: '',
  643. task_profile_id: ''
  644. },
  645. queryInfo2:{
  646. pageNum: 1,
  647. pageSize: 10,
  648. jcd_id: ''
  649. },
  650. ypqueryInfo:{
  651. pageNum: 1,
  652. pageSize: 10,
  653. cyd_id: ''
  654. },
  655. queryInfoth:{
  656. pageNum: 1,
  657. pageSize: 10,
  658. task_id: ''
  659. },
  660. queryInfothItems:{
  661. pageNum: 1,
  662. pageSize: 10,
  663. task_id: '',
  664. task_profile_id: ''
  665. },
  666. cellStyle: {
  667. padding: 2 + 'px'
  668. },
  669. rowStyle: {
  670. height: 35 + 'px'
  671. },
  672. tableHeader: [{
  673. label: '抽样单编码',
  674. prop: 'cyd_code'
  675. // fixed: 'left'
  676. },
  677. {
  678. label: '受检单位',
  679. prop: 'inspectedUnit.inspected_name',
  680. width: 180
  681. },
  682. {
  683. label: '抽样日期',
  684. prop: 'cydProfile.cyd_date',
  685. width: 150
  686. },
  687. {
  688. label: '状态',
  689. prop: 'status',
  690. width: 100
  691. }
  692. ],
  693. //获取检测单列表表格
  694. checkHeader: [{
  695. label: '抽样单编码',
  696. prop: 'cyd_code'
  697. // fixed: 'left'
  698. },
  699. {
  700. label: '受检单位',
  701. prop: 'inspectedUnit.inspected_name',
  702. // width: 180
  703. },
  704. {
  705. label: '抽样日期',
  706. prop: 'cydProfile.cyd_date',
  707. // width: 150
  708. },
  709. // {
  710. // label: '状态',
  711. // prop: 'status',
  712. // width: 100
  713. // }
  714. ],
  715. jcxHeader: [
  716. {
  717. label: '检测项目',
  718. prop: 'item_name',
  719. // width: 'auto'
  720. // fixed: 'left'
  721. },
  722. {
  723. label: '标准指标',
  724. prop: 'item_standard',
  725. // width: 'auto'
  726. },
  727. {
  728. label: '实测值',
  729. prop: 'item_measured_value',
  730. // width: 'auto'
  731. },
  732. {
  733. label: '单项判定',
  734. prop: 'item_result',
  735. // width: 'auto'
  736. },
  737. {
  738. label: '检验依据',
  739. prop: 'item_basis',
  740. // width: 'auto'
  741. },
  742. {
  743. label: '备注',
  744. prop: 'item_log',
  745. // width: 'auto'
  746. },
  747. ],
  748. thjcxHeader: [
  749. {
  750. label: '检测项目',
  751. prop: 'item_name'
  752. // fixed: 'left'
  753. },
  754. {
  755. label: '标准指标',
  756. prop: 'item_standard',
  757. // width: 180
  758. },
  759. {
  760. label: '实测值',
  761. prop: 'item_measured_value',
  762. // width: 150
  763. },
  764. {
  765. label: '单项判定',
  766. prop: 'item_result',
  767. // width: 100
  768. },
  769. {
  770. label: '检验依据',
  771. prop: 'item_basis',
  772. // width: 100
  773. },
  774. {
  775. label: '备注',
  776. prop: 'item_log',
  777. // width: 100
  778. },
  779. ],
  780. checkHeader2: [{
  781. label: '检测项目',
  782. prop: 'test_name',
  783. // fixed: 'left'
  784. }],
  785. // 数据表格数据
  786. tableData: [],
  787. tableData1: [],
  788. yptableData: [],//检测单列表中样品信息表格
  789. options: [],
  790. thTask: [],
  791. thTaskTotal: 0,
  792. task_id: '',
  793. multipleSelection: null,
  794. // 填报检测对话框
  795. inputJcdShow: false,
  796. jcd_id: '',
  797. testPesticides: [],
  798. resultjc: [],
  799. thtableHeader: [{
  800. label: '抽样机构',
  801. prop: 'sampleOrgId.name',
  802. // width: 180,
  803. }, {
  804. label: '检测机构',
  805. prop: 'checkOrgId.name'
  806. },
  807. {
  808. label: '抽样地区',
  809. prop: 'sample_address'
  810. },
  811. ],
  812. jcheader: [{
  813. label: '检测项目',
  814. prop: 'test_name',
  815. },
  816. {
  817. label: '检测值',
  818. prop: 'test_value',
  819. }, {
  820. label: '限量值',
  821. prop: 'state_value',
  822. }, {
  823. label: '单位',
  824. prop: 'unit',
  825. }, {
  826. label: '抽检结果',
  827. prop: 'test_result'
  828. }, {
  829. label: 'LOD',
  830. prop: 'LOD',
  831. }, {
  832. label: 'LOQ',
  833. prop: 'LOQ',
  834. }
  835. ],
  836. tableHeader2: [{
  837. label: '抽样机构',
  838. prop: 'sampleOrgId.name',
  839. width: 180,
  840. }, {
  841. label: '检测机构',
  842. prop: 'checkOrgId.name'
  843. },
  844. {
  845. label: '抽样地区',
  846. prop: 'sample_address'
  847. },
  848. // {
  849. // label: '抽样数量',
  850. // prop: 'sample_number',
  851. // width: 100,
  852. // },
  853. // {
  854. // label: '报告上传单位',
  855. // prop: 'report_name'
  856. // },
  857. // {
  858. // label: '任务截止时间',
  859. // prop: 'uploadtime'
  860. // }
  861. ],
  862. yptableHeader: [{
  863. label: '样品名称',
  864. prop: 'sample_name'
  865. // fixed: 'left'
  866. },
  867. {
  868. label: '样品来源',
  869. prop: 'sample_source',
  870. // fixed: 'left'
  871. },
  872. {
  873. label: '抽样数量',
  874. prop: 'sample_count'
  875. },
  876. {
  877. label: '抽样基数',
  878. prop: 'sample_base'
  879. },
  880. {
  881. label: '生产日期',
  882. prop: 'sample_md_date'
  883. },
  884. {
  885. label: '检测单状态',
  886. prop: 'jcd_status'
  887. },
  888. {
  889. label: '备注',
  890. prop: 'sample_log'
  891. }
  892. ],
  893. fileList: [],
  894. total: 0,
  895. sampleShow: false, //是否展示抽样卡片
  896. checkShow: false, //是否展示检测卡片
  897. currentRow: null,//选中机构地域表格数据项
  898. jcxItem:{},//新增检测项目
  899. };
  900. },
  901. components: {
  902. inputCheck
  903. },
  904. mounted() {},
  905. created() {
  906. this.task_id = this.$route.params.id
  907. this.getTask()
  908. this.getCheckTaskList()
  909. this.getOldTaskProfile()
  910. },
  911. methods: {
  912. // 获取检测单列表
  913. async getJcdList(id){
  914. this.queryInfo1['task_id'] = this.task_id
  915. this.queryInfo1['task_profile_id'] = id
  916. this.checkTestList = true
  917. this.getJcds()
  918. },
  919. async getJcds() {
  920. const {
  921. data: res
  922. } = await this.$http.post("getJcds", this.queryInfo1);
  923. // console.log(res)
  924. this.tableData1 = res.data.rows
  925. for(let i= 0; i < this.tableData1.length; i++) {
  926. if(this.tableData1[i].cyd_status == 1) {
  927. this.tableData1[i].status = '未上报'
  928. }else {
  929. this.tableData1[i].status = '已上报'
  930. }
  931. }
  932. this.jcdListTotal = res.data.total
  933. },
  934. // 获取抽样单列表
  935. async getCydlist(id) {
  936. this.queryInfo['task_id'] = this.task_id
  937. this.queryInfo['task_profile_id'] = id
  938. this.getSampleListDialog = true
  939. this.getCyds()
  940. },
  941. async getCyds() {
  942. const {
  943. data: res
  944. } = await this.$http.post("getCyds", this.queryInfo);
  945. // console.log(res)
  946. this.tableData = res.data.rows
  947. for(let i= 0; i < this.tableData.length; i++) {
  948. if(this.tableData[i].cyd_status == 1) {
  949. this.tableData[i].status = '未上报'
  950. }else {
  951. this.tableData[i].status = '已上报'
  952. }
  953. }
  954. this.total = res.data.total
  955. },
  956. //删除抽样单
  957. async deleteCyd(id){
  958. let that = this
  959. const res = await this.$http.post('deleteCyd',{cyd_id:id})
  960. this.getCyds()
  961. },
  962. //检测单列表中获取样品信息列表
  963. async getSamplesLists(id){
  964. let that = this
  965. that.ypqueryInfo['cyd_id'] = id
  966. this.getSamples()
  967. },
  968. async getSamples() {
  969. let that = this
  970. // that.ypqueryInfo['cyd_id'] = id
  971. const res = await this.$http.post('getSamples',that.ypqueryInfo)
  972. console.log(res.data.data.rows)
  973. that.yptableData = res.data.data.rows
  974. for(let i= 0; i < this.yptableData.length; i++) {
  975. if(this.yptableData[i].jcd == null) {
  976. this.yptableData[i].jcd_status = '未填报'
  977. }else if(this.yptableData[i].jcd.jcd_status == '1') {
  978. this.yptableData[i].jcd_status = '未上报'
  979. }else if(this.yptableData[i].jcd.jcd_status == '3') {
  980. this.yptableData[i].jcd_status = '已上报'
  981. }else if(this.yptableData[i].jcd.jcd_status == '5') {
  982. this.yptableData[i].jcd_status = '已完成'
  983. }
  984. }
  985. console.log(that.yptableData)
  986. that.samplesListTotal = res.data.data.total
  987. this.getSamplesList = true
  988. },
  989. // 删除不合格检测项目信息
  990. async delJcdItem(id) {
  991. let that = this
  992. const result = await this.$http.post('delJcdItem', {jcd_item_id: id})
  993. // 判断业务逻辑
  994. if (result.data.code == 0) {
  995. this.$message({
  996. type: 'success',
  997. message: '删除成功'
  998. })
  999. this.getJcdItems()
  1000. }
  1001. },
  1002. //新增不合格检测项目
  1003. async postJcdItem(formName) {
  1004. let that = this
  1005. that.jcxItem['jcd_id'] = that.jcd_id
  1006. const result = await this.$http.post('postJcdItem', that.jcxItem)
  1007. if (result.data.code == 0) {
  1008. this.$message({
  1009. type: 'success',
  1010. message: '保存成功'
  1011. })
  1012. this.addJcxItemDialog = false
  1013. this.$refs[formName].resetFields();
  1014. this.getJcdItems()
  1015. }
  1016. },
  1017. //获取不合格检测项目列表
  1018. async getJcdItems() {
  1019. let that = this
  1020. that.queryInfo2.jcd_id = that.jcd_id
  1021. const res = await this.$http.post('getJcdItems',that.queryInfo2)
  1022. console.log(res.data.data.rows)
  1023. this.jcxItems = res.data.data.rows
  1024. this.jcxItemTotal = res.data.data.total
  1025. },
  1026. //填报检测单完成
  1027. async putJcd() {
  1028. let that = this
  1029. that.jcd.jcd_id = that.jcd_id
  1030. console.log(that.jcd)
  1031. const res = await this.$http.post('putJcd',that.jcd)
  1032. if (res.data.code == 0) {
  1033. this.$message({
  1034. type: 'success',
  1035. message: '填报检测单成功'
  1036. })
  1037. }
  1038. this.inputJcdShow = false
  1039. // this.getSamplesList = false
  1040. this.getSamples(that.jcd.cyd_id)
  1041. that.jcd.jcd_result = 1
  1042. },
  1043. //查询
  1044. async searchData() {
  1045. console.log(this.queryInfo)
  1046. this.queryInfo.pageNum = 1
  1047. this.getCyds()
  1048. },
  1049. //重置
  1050. resetForm(formName) {
  1051. // console.log(this.queryInfo)
  1052. this.$refs[formName].resetFields();
  1053. },
  1054. //选中抽样任务(单选)
  1055. handlecyCurrentChange(val) {
  1056. this.currentRow = val;
  1057. console.log(this.currentRow)
  1058. console.log(this.currentRow.id)
  1059. // under_id =
  1060. },
  1061. //获取任务详情
  1062. async getTask() {
  1063. var that = this
  1064. const {
  1065. data: res
  1066. } = await this.$http.post("getTask", {
  1067. task_id: that.task_id,
  1068. pageNum: that.queryInfo.pageNum,
  1069. pageSize: that.queryInfo.pageSize
  1070. });
  1071. that.readForm = res.data
  1072. console.log(that.readForm)
  1073. },
  1074. //退回任务列表
  1075. async getOldTaskProfile(){
  1076. this.queryInfoth['task_id'] = this.task_id
  1077. const res = await this.$http.post('getOldTaskProfile',this.queryInfoth)
  1078. console.log(res.data.data)
  1079. this.thTask = res.data.data.rows
  1080. this.thTaskTotal = res.data.data.total
  1081. },
  1082. //退回中查看不合格检测项目
  1083. async checkUnqualifiedItems(task_id,task_profile_id){
  1084. var that = this
  1085. that.queryInfothItems['task_id'] = task_id
  1086. that.queryInfothItems['task_profile_id'] = task_profile_id
  1087. this.checkbhgItems()
  1088. },
  1089. async checkbhgItems(){
  1090. var that = this
  1091. const res = await this.$http.post('getUnqualifiedItem',that.queryInfothItems)
  1092. this.thjcxItems = res.data.data.rows
  1093. for(let i= 0; i < this.thjcxItems.length; i++) {
  1094. if(this.thjcxItems[i].item_result == 0) {
  1095. this.thjcxItems[i].item_result = '不合格'
  1096. }else if(this.thjcxItems[i].item_result == 1) {
  1097. this.thjcxItems[i].item_result = '合格'
  1098. }
  1099. }
  1100. this.thItemsTotal = res.data.data.total
  1101. this.UnqualifiedJcxItemDialog = true
  1102. },
  1103. //上传文件
  1104. handleRemove(file, fileList) {
  1105. console.log(file, fileList);
  1106. },
  1107. handlePreview(file) {
  1108. console.log(file);
  1109. },
  1110. beforeRemove(file, fileList) {
  1111. return this.$confirm(`确定移除 ${ file.name }?`);
  1112. },
  1113. // 上传成功
  1114. uploadSuccess(res) {
  1115. console.log(res.data)
  1116. this.jcd.file_url = res.data.fileUrl
  1117. this.jcd.file_name = res.data.fileName
  1118. console.log(this.jcd.file_url)
  1119. console.log(this.jcd.file_name)
  1120. },
  1121. //抽样标签详情
  1122. async getSampleTaskList(){
  1123. for (var key in this.queryInfo) {
  1124. if (this.queryInfo[key] == '') {
  1125. delete this.queryInfo[key]
  1126. }
  1127. }
  1128. var that = this
  1129. const {
  1130. data: res
  1131. } = await this.$http.post("getSampleTaskList", {
  1132. task_id: that.task_id,
  1133. // pageNum: that.queryInfo.pageNum,
  1134. // pageSize: that.queryInfo.pageSize
  1135. });
  1136. console.log(res)
  1137. that.sampleTask = res.data.rows
  1138. console.log(that.sampleTask)
  1139. },
  1140. //检测标签详情
  1141. async getCheckTaskList(){
  1142. var that = this
  1143. const {
  1144. data: res
  1145. } = await this.$http.post("getCheckTaskList", {
  1146. task_id: that.task_id,
  1147. // pageNum: that.queryInfo.pageNum,
  1148. // pageSize: that.queryInfo.pageSize
  1149. });
  1150. console.log(res)
  1151. that.underTask = res.data.rows
  1152. console.log(that.underTask)
  1153. },
  1154. // 上传成功
  1155. // async uploadSuccess(res) {
  1156. // console.log(res.data)
  1157. // this.form.file_url = res.data.fileUrl
  1158. // this.form.file_name = res.data.fileName
  1159. // const result = await this.$http.post('saveTestFile', {
  1160. // sample_id: sample_id
  1161. // })
  1162. // if (result.data.code == 0) {
  1163. // that.formjc = result.data.data
  1164. // }
  1165. // },
  1166. //下载检测报告
  1167. // download() {
  1168. // htmlToPdf.downloadPDF(document.querySelector('#pdf'), '检测报告')
  1169. // },
  1170. //生成检测报告pdf
  1171. // async creatpdf(sample_id) {
  1172. // var that = this
  1173. // that.dialogVisible2 = true
  1174. // // async getSampleDetail() {
  1175. // // const result = await this.$http.post('getSampleDetail', {
  1176. // // sample_id: sample_id
  1177. // // })
  1178. // // if (result.data.code == 0) {
  1179. // // that.formjc = result.data.data
  1180. // // }
  1181. // // console.log(that.formjc)
  1182. // const res = await this.$http.post('getTestValue', {
  1183. // sample_id: sample_id
  1184. // })
  1185. // console.log()
  1186. // if (res.data.code == 0) {
  1187. // that.formjc = res.data.data.result
  1188. // that.unitTest = res.data.data.result.unitTest
  1189. // that.resultjc = res.data.data.result_detail
  1190. // }
  1191. // console.log(that.formjc)
  1192. // console.log(that.resultjc)
  1193. // // },
  1194. // },
  1195. //保存检测单
  1196. // async saveJcdItem() {
  1197. // console.log(this.testPesticides)
  1198. // console.log(this.underInfo)
  1199. // for (let i = 0; i < this.testPesticides.length; i++) {
  1200. // this.testPesticides[i]['unit'] = 'mg/kg'
  1201. // console.log(this.testPesticides[i]['state_value'])
  1202. // if (this.testPesticides[i]['state_value'] === 'ND') {
  1203. // if (this.testPesticides[i]['test_value'] !== 'ND') {
  1204. // this.testPesticides[i]['test_result'] = '不合格'
  1205. // }
  1206. // } else {
  1207. // if (this.testPesticides[i]['test_value'] <= this.testPesticides[i]['state_value']) {
  1208. // this.testPesticides[i]['test_result'] = '合格'
  1209. // } else if (this.testPesticides[i]['test_value'] > this.testPesticides[i]['state_value']) {
  1210. // this.testPesticides[i]['test_result'] = '不合格'
  1211. // }
  1212. // }
  1213. // delete this.testPesticides[i]['test_model_id']
  1214. // }
  1215. // var that = this
  1216. // const result = await this.$http.post("saveJcdItem", {
  1217. // pesticides: that.testPesticides,
  1218. // sample_id: that.sample_id
  1219. // });
  1220. // if (result.data.data.disable_upload_data == '') {
  1221. // this.$message({
  1222. // type: 'success',
  1223. // message: '检测成功!'
  1224. // });
  1225. // that.inputCheckShow = false
  1226. // that.getJcdList(this.underInfo.underTake_id)
  1227. // } else if(result.data.data.enable_upload_data == ''){
  1228. // this.$message({
  1229. // type: 'error',
  1230. // message: '请输入检测数据'
  1231. // });
  1232. // } else{
  1233. // this.$message({
  1234. // type: 'error',
  1235. // message: '已存在数据保存失败,新增数据保存成功'
  1236. // });
  1237. // that.inputCheckShow = false
  1238. // that.getJcdList(this.underInfo.underTake_id)
  1239. // }
  1240. // },
  1241. //填报检测单
  1242. async getJcdObj(sample_id,cyd_id) {
  1243. console.log(111)
  1244. this.inputJcdShow = true
  1245. console.log(222)
  1246. var that = this
  1247. that.jcd.cyd_id = cyd_id
  1248. const {
  1249. data: res
  1250. } = await this.$http.post("getJcdObj", {
  1251. cyd_id: cyd_id,
  1252. sample_id: sample_id
  1253. });
  1254. that.jcd_id = res.data.jcd_id
  1255. // that.jcd.sample_id =
  1256. console.log(that.jcd_id)
  1257. // console.log(that.cyd_id)
  1258. },
  1259. //检测单列表-上报
  1260. async putJcdStatus(id,cyd_id){
  1261. var that = this
  1262. console.log(cyd_id)
  1263. const result = await this.$http.post('putJcdStatus', {
  1264. jcd_id: id
  1265. })
  1266. console.log(result.data.data)
  1267. // this.getCyds()
  1268. // 判断业务逻辑
  1269. if (result.data.code == 0) {
  1270. this.$message({
  1271. type: 'success',
  1272. message: '上报抽样信息成功'
  1273. })
  1274. this.getSamples(cyd_id)
  1275. }
  1276. },
  1277. handleClick(tab, event) {
  1278. console.log(tab, event);
  1279. },
  1280. // 跳转到填写抽样单
  1281. inputSample() {
  1282. this.activeName = 'second'
  1283. },
  1284. // 填报抽样单
  1285. input(id) {
  1286. console.log(id)
  1287. console.log(this.readForm.id)
  1288. this.$router.push({
  1289. name: 'fillSampleReport',
  1290. params: {
  1291. task_id: this.readForm.id,
  1292. under_id:id
  1293. }
  1294. })
  1295. // }
  1296. // if(isset(this.currentRow.id)){
  1297. // this.under_id=this.currentRow.id
  1298. // }
  1299. // console.log(this.currentRow.id)
  1300. },
  1301. // 返回
  1302. back() {
  1303. var that = this
  1304. this.$router.push({
  1305. name: 'setTaskcd',
  1306. params: {
  1307. id: that.id
  1308. }
  1309. })
  1310. },
  1311. // 上传抽样信息
  1312. async putCydStatus(id) {
  1313. let that = this
  1314. // that.orgs = that.multipleSelection
  1315. // console.log(that.multipleSelection)
  1316. const result = await this.$http.post('putCydStatus', {
  1317. cyd_id: id
  1318. })
  1319. console.log(result.data.data)
  1320. // this.getCyds()
  1321. // 判断业务逻辑
  1322. this.$message({
  1323. type: 'success',
  1324. message: '上报抽样信息成功'
  1325. })
  1326. this.getCyds(result.data.data)
  1327. // if (result.data.code == 0) {
  1328. // this.$message({
  1329. // type: 'success',
  1330. // message: '上报抽样信息成功'
  1331. // })
  1332. // this.getCyds(result.data.data)
  1333. // }
  1334. },
  1335. /** 修复当用户在大于1的分页进行数据搜索没有返回值的问题 */
  1336. setPageNum() {
  1337. this.queryInfo.pageNum = 1
  1338. this.getCyds()
  1339. },
  1340. setSelectedRow() {
  1341. // 设置当前页已选项
  1342. this.hander = true
  1343. this.tableData.forEach(item => {
  1344. if (this.list.includes(item[this.uniqueKey])) {
  1345. this.$refs.multipleTable.toggleRowSelection(item, true)
  1346. }
  1347. })
  1348. this.hander = false
  1349. },
  1350. /** 监听每页显示多少数据的改变 */
  1351. handleSizeChange(newSize) {
  1352. this.queryInfo.pageSize = newSize
  1353. this.getCyds()
  1354. },
  1355. /** 监听页码的改变 */
  1356. handleCurrentChange(newPage) {
  1357. this.queryInfo.pageNum = newPage
  1358. this.getCyds()
  1359. },
  1360. /** 监听每页显示多少数据的改变 */
  1361. handleSizeChange1(newSize) {
  1362. this.queryInfo1.pageSize = newSize
  1363. this.getJcds()
  1364. },
  1365. /** 监听页码的改变 */
  1366. handleCurrentChange1(newPage) {
  1367. this.queryInfo1.pageNum = newPage
  1368. this.getJcds()
  1369. },
  1370. /** 监听每页显示多少数据的改变 */
  1371. handleSizeChange2(newSize) {
  1372. this.queryInfo2.pageSize = newSize
  1373. this.getJcdItems()
  1374. },
  1375. /** 监听页码的改变 */
  1376. handleCurrentChange2(newPage) {
  1377. this.queryInfo2.pageNum = newPage
  1378. this.getJcdItems()
  1379. },
  1380. handleSizeChangeyp(newSize) {
  1381. this.ypqueryInfo.pageSize = newSize
  1382. this.getSamples()
  1383. },
  1384. /** 监听页码的改变 */
  1385. handleCurrentChangeyp(newPage) {
  1386. this.ypqueryInfo.pageNum = newPage
  1387. this.getSamples()
  1388. },
  1389. /** 监听每页显示多少数据的改变 */
  1390. handleSizeChangeth(newSize) {
  1391. this.queryInfoth.pageSize = newSize
  1392. this.getOldTaskProfile()
  1393. },
  1394. /** 监听页码的改变 */
  1395. handleCurrentChangeth(newPage) {
  1396. this.queryInfoth.pageNum = newPage
  1397. this.getOldTaskProfile()
  1398. },
  1399. handleSizeChangethItems(newSize) {
  1400. this.queryInfothItems.pageSize = newSize
  1401. this.checkbhgItems()
  1402. },
  1403. /** 监听页码的改变 */
  1404. handleCurrentChangethItems(newPage) {
  1405. this.queryInfothItems.pageNum = newPage
  1406. this.checkbhgItems()
  1407. },
  1408. // 批量勾选
  1409. handleSelectionChange(val) {
  1410. this.multipleSelection = val
  1411. console.log(this.multipleSelection)
  1412. if (this.hander) return false
  1413. // this.setSelectRows() // 处理选中的方法
  1414. },
  1415. // 跳转到查看抽样单详情
  1416. sampleDetail(id) {
  1417. console.log(id)
  1418. console.log(this.task_id)
  1419. this.$router.push({
  1420. name: 'sampleReport',
  1421. params: {
  1422. task_id: this.task_id,
  1423. cyd_id: id
  1424. }
  1425. })
  1426. }
  1427. }
  1428. }
  1429. </script>
  1430. <style lang="less" scoped>
  1431. .el-breadcrumb {
  1432. margin-bottom: 20px;
  1433. }
  1434. // .el-form-item {
  1435. // margin-bottom: 0px;
  1436. // }
  1437. .el-select {
  1438. width: 210px;
  1439. height: 100%;
  1440. }
  1441. .select {
  1442. display: flex;
  1443. flex-direction: row;
  1444. margin-left: 10px;
  1445. }
  1446. // .el-form {
  1447. // margin-left: 35%;
  1448. // }
  1449. // .el-form-item {
  1450. // // margin-bottom: 8px;
  1451. // margin: 0 auto;
  1452. // }
  1453. // .labelItem /deep/ .el-form-item__label {
  1454. // // width: 80px;
  1455. // text-align: center;
  1456. // vertical-align: middle;
  1457. // float: left;
  1458. // font-size: 14px;
  1459. // color: #606266;
  1460. // font-weight: bold;
  1461. // // line-height: 40px;
  1462. // padding: 0 20px 0 0;
  1463. // -webkit-box-sizing: border-box;
  1464. // box-sizing: border-box;
  1465. // }
  1466. .demonstration {
  1467. margin: 20px;
  1468. }
  1469. // .el-form-item__content {
  1470. // width: 200px;
  1471. // }
  1472. .footer {
  1473. margin-top: 20px;
  1474. margin-left: 45%;
  1475. }
  1476. .el-table{
  1477. margin-top: 20px;
  1478. }
  1479. .el-pagination {
  1480. margin-top: 25px;
  1481. }
  1482. /deep/ #taskDetail{
  1483. .el-descriptions-item__label.is-bordered-label{
  1484. width: 18.75rem;}
  1485. }
  1486. /deep/ #addUnqualifiedJcx{
  1487. .el-form-item__label{
  1488. width: 15%;
  1489. }
  1490. .el-form-item__error{
  1491. left: 6.875rem;
  1492. }
  1493. }
  1494. // /deep/ #additems{
  1495. // .el-table__header{
  1496. // width: 100%;
  1497. // }
  1498. // }
  1499. // /deep/ #inputJcd{
  1500. // .el-upload__tip{
  1501. // margin-left: 7.1875rem;
  1502. // }
  1503. // }
  1504. </style>