setReturnTask.vue 44 KB

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