taskdetail.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <div id="pdf1">
  3. <el-descriptions class="margin-top" :title="readForm.taskInfo.task_class+'任务'" :column="2" :size="size" border>
  4. <el-descriptions-item>
  5. <template slot="label">
  6. 发布单位
  7. </template>
  8. {{readForm.releaserInfo.rymc}}
  9. </el-descriptions-item>
  10. <el-descriptions-item>
  11. <template slot="label">
  12. 年度
  13. </template>
  14. {{readForm.taskInfo.year}}
  15. </el-descriptions-item>
  16. <el-descriptions-item>
  17. <template slot="label">
  18. 开始时间和结束时间
  19. </template>
  20. {{readForm.taskInfo.starttime}}-{{readForm.taskInfo.endtime}}
  21. </el-descriptions-item>
  22. <el-descriptions-item>
  23. <template slot="label">
  24. 抽样信息上报截止时间
  25. </template>
  26. {{readForm.taskInfo.endtime_cydsb}}
  27. </el-descriptions-item>
  28. <el-descriptions-item>
  29. <template slot="label">
  30. 监测类型
  31. </template>
  32. {{readForm.taskInfo.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.taskInfo.is_divide==1">是</span>
  48. <span v-if="readForm.taskInfo.is_divide==0">否</span>
  49. </el-descriptions-item>
  50. <el-descriptions-item>
  51. <template slot="label">
  52. 附件
  53. </template>
  54. <div v-if="readForm.taskInfo.file_url==null">无</div>
  55. <el-link v-else type="primary" :href="readForm.taskInfo.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.taskInfo.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. // releaser: '',
  101. // task_name: '',
  102. // level: '',
  103. // task_class: '',
  104. // year: '',
  105. modelInfo:{
  106. creattime:'',
  107. id:'',
  108. name:'',
  109. type_id:'',
  110. updatetime:'',
  111. user_id:'',
  112. },
  113. releaserInfo:{
  114. groupname: '',
  115. rymc:'',
  116. },
  117. taskInfo:{
  118. base_file_url: null,
  119. batch: '',
  120. creater: null,
  121. createtime: null,
  122. endtime: null,
  123. endtime_cydsb: null,
  124. file_name: null,
  125. file_url: null,
  126. filenum: null,
  127. id: null,
  128. industry: null,
  129. is_divide: null,
  130. ispublic:null,
  131. level:null,
  132. log: null,
  133. main_unit: null,
  134. releaser:null,
  135. starttime: null,
  136. status: null,
  137. task_class: null,
  138. task_name:null,
  139. test_model_id:null,
  140. year: null,
  141. },
  142. endtime: '',
  143. file_url: '',
  144. filenum: '',
  145. log: ''
  146. },
  147. size: '',
  148. // 机构地域表格数据
  149. underTask: [],
  150. underTasktotal: 0,
  151. productNameText: '',
  152. pesticidesNameText: '',
  153. tableHeader: [{
  154. label: '抽样机构',
  155. prop: 'bear_name',
  156. width: 180,
  157. }, {
  158. label: '检测机构',
  159. prop: 'check_name'
  160. },
  161. {
  162. label: '抽样地区',
  163. prop: 'address'
  164. }, {
  165. label: '抽样数量',
  166. prop: 'sample_number'
  167. },
  168. {
  169. label: '报告上传单位',
  170. prop: 'report_name'
  171. }, {
  172. label: '报告上传截止时间',
  173. prop: 'uploadtime'
  174. }
  175. ],
  176. };
  177. },
  178. created() {
  179. this.getTaskDetail();
  180. // this.getUnderTask();
  181. },
  182. methods: {
  183. handleClick(tab, event) {
  184. console.log(tab, event);
  185. },
  186. // 获取任务详情
  187. async getTaskDetail() {
  188. var that = this
  189. const {
  190. data: res
  191. } = await this.$http.post("getTaskDetail", {
  192. task_id: that.task_id
  193. });
  194. console.log(res.data.product)
  195. // if (res.data.modelInfo.product.length > 0) {
  196. if (res.data.modelInfo.type_id == '1') {
  197. res.data.model_type = '种植业'
  198. } else if (res.data.modelInfo.type_id == '2') {
  199. res.data.model_type = '畜牧业'
  200. } else if (res.data.modelInfo.type_id == '3') {
  201. res.data.model_type = '渔业'
  202. } else if (res.data.modelInfo.type_id == '4') {
  203. res.data.model_type = '其他'
  204. }else {
  205. res.data.model_type = '无'
  206. }
  207. // }
  208. this.readForm = res.data
  209. this.underTask = res.data.unitTaskList.rows
  210. this.underTasktotal = res.data.unitTaskList.total
  211. console.log(this.readForm.product)
  212. this.readForm.taskInfo.is_divide = res.data.taskInfo.is_divide
  213. this.readForm.taskInfo.endtime_cydsb = res.data.taskInfo.endtime_cydsb
  214. that.productNameText = that.readForm.product.map(el => el.product_name).join('、 ')
  215. console.log(that.productNameText)
  216. that.pesticidesNameText = that.readForm.pesticides.map(el => el.test_name).join('、 ')
  217. console.log(this.divideOptions.id)
  218. },
  219. // 获取机构地域表格
  220. // async getUnderTask() {
  221. // const result = await this.$http.post('getUnderTask', {
  222. // task_id: this.task_id
  223. // })
  224. // // 判断业务逻辑
  225. // if (result.data.code == 0) {
  226. // this.underTask = result.data.data.rows
  227. // this.underTasktotal = result.data.data.total
  228. // }
  229. // },
  230. }
  231. }
  232. </script>
  233. <style>
  234. </style>