taskdetail.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <div>
  3. <el-descriptions class="margin-top" title="例行监测任务" :column="2" :size="size" border>
  4. <el-descriptions-item>
  5. <template slot="label">
  6. 发布单位
  7. </template>
  8. {{readForm.releaser}}
  9. </el-descriptions-item>
  10. <el-descriptions-item>
  11. <template slot="label">
  12. 年度
  13. </template>
  14. {{readForm.year}}
  15. </el-descriptions-item>
  16. <el-descriptions-item>
  17. <template slot="label">
  18. 开始时间和结束时间
  19. </template>
  20. {{readForm.starttime}}-{{readForm.endtime}}
  21. </el-descriptions-item>
  22. <el-descriptions-item>
  23. <template slot="label">
  24. 抽样信息上报截止时间
  25. </template>
  26. {{readForm.endtime_cydsb}}
  27. </el-descriptions-item>
  28. <el-descriptions-item>
  29. <template slot="label">
  30. 监测类型
  31. </template>
  32. {{readForm.task_class}}
  33. </el-descriptions-item>
  34. <el-descriptions-item>
  35. <template slot="label">
  36. 行业
  37. </template>
  38. <!-- <div v-if="readForm.product!=[]"> -->
  39. <span>{{readForm.model_type}}</span>
  40. <!-- </div> -->
  41. <!-- <div v-else>暂无</div> -->
  42. </el-descriptions-item>
  43. <el-descriptions-item>
  44. <template slot="label">
  45. 抽检分离
  46. </template>
  47. <span v-if="readForm.is_divide==1">是</span>
  48. <span v-if="readForm.is_divide==0">否</span>
  49. </el-descriptions-item>
  50. <el-descriptions-item>
  51. <template slot="label">
  52. 附件
  53. </template>
  54. <div v-if="readForm.file_url==null">无</div>
  55. <el-link v-else type="primary" :href="readForm.file_url">下载附件</el-link>
  56. </el-descriptions-item>
  57. </el-descriptions>
  58. <el-descriptions class="margin-top" :size="size" border>
  59. <el-descriptions-item>
  60. <template slot="label">
  61. 备注
  62. </template>
  63. {{readForm.log}}
  64. </el-descriptions-item>
  65. </el-descriptions>
  66. <el-descriptions class="margin-top" :size="size" border>
  67. <el-descriptions-item>
  68. <template slot="label">
  69. 检测对象
  70. </template>
  71. <span v-for="item in readForm.product">{{item.product_name}}、</span>
  72. </el-descriptions-item>
  73. </el-descriptions>
  74. <el-descriptions class="margin-top" :size="size" border>
  75. <el-descriptions-item>
  76. <template slot="label">
  77. 检测项
  78. </template>
  79. <span v-for="item in readForm.pesticides">{{item.test_name}}、</span>
  80. </el-descriptions-item>
  81. </el-descriptions>
  82. <el-table :data="underTask" border stripe highlight-current-row style="width: 100%" :row-style="rowStyle"
  83. :cell-style="cellStyle">
  84. <el-table-column :key="table.label" v-for="table in tableHeader" :label="table.label" :prop="table.prop"
  85. align="center" :width="table.width" :fixed="table.fixed" />
  86. </el-table>
  87. </div>
  88. </template>
  89. <script>
  90. export default {
  91. name: 'taskdetail',
  92. props: ['task_id'],
  93. data() {
  94. return {
  95. activeName: 'first',
  96. id: 0,
  97. task_id: this.task_id,
  98. readForm: {},
  99. // 机构地域表格数据
  100. underTask: [],
  101. underTasktotal: 0,
  102. tableHeader: [{
  103. label: '抽样机构',
  104. prop: 'bear_name',
  105. width: 180,
  106. }, {
  107. label: '检测机构',
  108. prop: 'check_name'
  109. },
  110. {
  111. label: '抽样地区',
  112. prop: 'address'
  113. }, {
  114. label: '抽样数量',
  115. prop: 'sample_number'
  116. },
  117. {
  118. label: '报告上传单位',
  119. prop: 'report_name'
  120. }, {
  121. label: '报告上传截止时间',
  122. prop: 'uploadtime'
  123. }
  124. ],
  125. };
  126. },
  127. created() {
  128. this.getTaskDetail();
  129. this.getUnderTask();
  130. },
  131. methods: {
  132. handleClick(tab, event) {
  133. console.log(tab, event);
  134. },
  135. // 获取任务详情
  136. async getTaskDetail() {
  137. var that = this
  138. const {
  139. data: res
  140. } = await this.$http.post("getTaskDetail", {
  141. task_id: this.task_id
  142. });
  143. console.log(res.data.product)
  144. if (res.data.product.length > 0) {
  145. if (res.data.product[0].type_id == '1') {
  146. res.data.model_type = '种植业'
  147. } else if (res.data.product[0].type_id == '2') {
  148. res.data.model_type = '畜牧业'
  149. } else if (res.data.product[0].type_id == '3') {
  150. res.data.model_type = '渔业'
  151. } else {
  152. res.data.model_type = '其他'
  153. }
  154. }
  155. this.readForm = res.data
  156. },
  157. // 获取机构地域表格
  158. async getUnderTask() {
  159. const result = await this.$http.post('getUnderTask', {
  160. task_id: this.task_id
  161. })
  162. // 判断业务逻辑
  163. if (result.data.code == 0) {
  164. this.underTask = result.data.data.rows
  165. this.underTasktotal = result.data.data.total
  166. }
  167. },
  168. }
  169. }
  170. </script>
  171. <style>
  172. </style>