taskdetail.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <template>
  2. <div id="pdf1">
  3. <el-descriptions class="margin-top" :title="readForm.task_class+'任务'" :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%">
  83. <el-table-column :key="table.label" v-for="table in tableHeader" :label="table.label" :prop="table.prop"
  84. align="center" :width="table.width" :fixed="table.fixed" />
  85. </el-table>
  86. </div>
  87. </template>
  88. <script>
  89. export default {
  90. name: 'taskdetail',
  91. props: ['task_id'],
  92. data() {
  93. return {
  94. activeName: 'first',
  95. id: 0,
  96. task_id: this.task_id,
  97. readForm: {},
  98. // rowStyle: '',
  99. // cellStyle: '',
  100. // size: '',
  101. // 机构地域表格数据
  102. underTask: [],
  103. underTasktotal: 0,
  104. tableHeader: [{
  105. label: '抽样机构',
  106. prop: 'bear_name',
  107. width: 180,
  108. }, {
  109. label: '检测机构',
  110. prop: 'check_name'
  111. },
  112. {
  113. label: '抽样地区',
  114. prop: 'address'
  115. }, {
  116. label: '抽样数量',
  117. prop: 'sample_number'
  118. },
  119. {
  120. label: '报告上传单位',
  121. prop: 'report_name'
  122. }, {
  123. label: '报告上传截止时间',
  124. prop: 'uploadtime'
  125. }
  126. ],
  127. };
  128. },
  129. created() {
  130. this.getTaskDetail();
  131. this.getUnderTask();
  132. },
  133. methods: {
  134. handleClick(tab, event) {
  135. console.log(tab, event);
  136. },
  137. // 获取任务详情
  138. async getTaskDetail() {
  139. var that = this
  140. const {
  141. data: res
  142. } = await this.$http.post("getTaskDetail", {
  143. task_id: this.task_id
  144. });
  145. console.log(res.data.product)
  146. if (res.data.product.length > 0) {
  147. if (res.data.product[0].type_id == '1') {
  148. res.data.model_type = '种植业'
  149. } else if (res.data.product[0].type_id == '2') {
  150. res.data.model_type = '畜牧业'
  151. } else if (res.data.product[0].type_id == '3') {
  152. res.data.model_type = '渔业'
  153. } else {
  154. res.data.model_type = '其他'
  155. }
  156. }
  157. this.readForm = res.data
  158. },
  159. // 获取机构地域表格
  160. async getUnderTask() {
  161. const result = await this.$http.post('getUnderTask', {
  162. task_id: this.task_id
  163. })
  164. // 判断业务逻辑
  165. if (result.data.code == 0) {
  166. this.underTask = result.data.data.rows
  167. this.underTasktotal = result.data.data.total
  168. }
  169. },
  170. }
  171. }
  172. </script>
  173. <style>
  174. </style>