taskdetail.vue 4.8 KB

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