taskSample.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <template>
  2. <div>
  3. <div slot="header" class="clearfix">
  4. <el-breadcrumb separator-class="el-icon-arrow-right">
  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. </div>
  10. <!-- 牵头单位弹框 -->
  11. <!-- <el-button icon="el-icon-search" @click="getQtouList()" size="medium">搜索牵头单位</el-button> -->
  12. <!-- 下拉菜单 -->
  13. <!-- <div>
  14. 牵头单位
  15. <el-select v-model="value" placeholder="请选择" clearable>
  16. <el-option
  17. v-for="item in options"
  18. :key="item.value"
  19. :label="item.label"
  20. :value="item.value"
  21. @change="choseQt()">
  22. </el-option>
  23. </el-select> -->
  24. <!-- 返回按钮 -->
  25. <el-form-item label="牵头单位名称" class="select" size="small">
  26. <el-input v-model="queryInfo.unit_name"></el-input>
  27. <el-button type="success" size="small">查询</el-button>
  28. </el-form-item>
  29. <div class="btns">
  30. <el-button plain size="small" @click="returnTask()">
  31. 返回
  32. </el-button>
  33. </div>
  34. <!-- 表格数据区域-->
  35. <div class="table">
  36. <el-table ref="multipleTable" :data="tableData" border stripe highlight-current-row style="width: 100%"
  37. :row-style="rowStyle" :cell-style="cellStyle" @selection-change="handleSelectionChange">
  38. <el-table-column label="序号" width="50px">
  39. <template slot-scope="scope">
  40. {{ scope.$index+1 }}
  41. </template>
  42. </el-table-column>
  43. <el-table-column :key="table.label" v-for="table in tableHeader" :label="table.label" :prop="table.prop"
  44. align="center" :width="table.width" :fixed="table.fixed"/>
  45. <el-table-column label="操作" align="center" fixed="right">
  46. <!-- 操作按钮区域的作用域插槽 -->
  47. <template >
  48. <!-- <el-button type="success" size="mini" @click="readDialogVisible1(scope.row)">抽样单详情</el-button> -->
  49. <el-button style="margin: 5px auto;" type="success" size="small" @click="readSampleList()">查看详情</el-button>
  50. <el-button size="small" @click="sendBack()">退回</el-button>
  51. </template>
  52. </el-table-column>
  53. </el-table>
  54. <!-- 分页器区域-->
  55. <div class="block">
  56. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="queryInfo.pageNum"
  57. :page-sizes="[10, 15, 20]" :page-size="queryInfo.pageSize"
  58. layout="total, sizes, prev, pager, next, jumper" :total="total" background />
  59. </div>
  60. <!-- 牵头单位弹框 -->
  61. <!-- <el-dialog title="机构选择" :visible.sync="dialogVisible" width="50%" :close-on-click-modal="ture" :show-close="true" :center="true" @click="getTestList()" > -->
  62. <!-- <el-form v-if="getQtListShow" :model="getTestListForm"> -->
  63. <!-- 表格数据区域-->
  64. <!-- <el-table ref="multipleTable" :data="QtouList" row-key="id" @selection-change="handleSelectionChange()"
  65. border stripe highlight-current-row style="width: 100%">
  66. <el-table-column type="selection" :reserve-selection="true" width="50"></el-table-column>
  67. <el-table-column label="序号" width="50px">
  68. <template slot-scope="scope">
  69. {{ scope.$index+1 }}
  70. </template>
  71. </el-table-column>
  72. <el-table-column :key="table.prop" v-for="table in tableHeader_qt" :label="table.label"
  73. :prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
  74. </el-table> -->
  75. <!-- <div class="footer"> -->
  76. <!-- 分页器区域-->
  77. <!-- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
  78. :current-page="queryInfo.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo.pageSize"
  79. layout="total, sizes, prev, pager, next, jumper" :total="total" background />
  80. <el-button type="success" @click="dialogVisible = false" size="small">提交</el-button>
  81. </div> -->
  82. <!-- </el-form> -->
  83. <!-- </el-dialog> -->
  84. </div>
  85. </div>
  86. </template>
  87. <script>
  88. const token = window.sessionStorage.getItem('token')
  89. export default {
  90. name: '',
  91. data() {
  92. return {
  93. //控制弹框显隐
  94. dialogVisible: false,
  95. total:0,
  96. queryInfo:{
  97. keyWord: '',
  98. year:'',
  99. task_name:'',
  100. starttime:'',
  101. endtime:'',
  102. ispublic:'',
  103. pageSize:10,
  104. pageNum:1,
  105. task_class:'专项监测',
  106. task_id:'',
  107. unit_name:'',
  108. },
  109. cellStyle: {
  110. padding: 2 + 'px'
  111. },
  112. rowStyle: {
  113. height: 35 + 'px'
  114. },
  115. tableHeader: [{
  116. label: '样品名称',
  117. prop: 'sample_name',
  118. width: 150
  119. // fixed: 'left'
  120. },
  121. {
  122. label: '样品编码',
  123. prop: 'sample_id',
  124. width: 200
  125. // fixed: 'left'
  126. }, {
  127. label: '商标',
  128. prop: 'brand',
  129. width: 150
  130. // fixed: 'left'
  131. },
  132. {
  133. label: '等级',
  134. prop: 'level',
  135. width: 120
  136. },
  137. {
  138. label: '抽样基数',
  139. prop: 'sample_base',
  140. width: 120
  141. },
  142. {
  143. label: '抽样场所',
  144. prop: 'sample_ground',
  145. width: 120
  146. },
  147. {
  148. label: '状态',
  149. prop: 'sample_status',
  150. width: 180
  151. }
  152. ],
  153. // 表头
  154. tableHeader_qt: [{
  155. label: '单位名称',
  156. prop: 'name',
  157. width: 300
  158. // fixed: 'left'
  159. },
  160. {
  161. label: '机构类型',
  162. prop: 'jgxz',
  163. // width: 40
  164. // fixed: 'left'
  165. }, {
  166. label: '所属区域',
  167. prop: 'ssqy',
  168. width: 300
  169. // fixed: 'left'
  170. },{
  171. label: '产品范围',
  172. prop: 'cpfw',
  173. width: 300
  174. // fixed: 'left'
  175. }
  176. ],
  177. // 总共多少条数据
  178. total: 0,
  179. // table表格多选选项
  180. multipleSelection: null,
  181. getQtListShow: {},
  182. // 选中的牵头单位
  183. orgs: [],
  184. // 数据表格数据
  185. tableData: [],
  186. QtouList:[]
  187. }
  188. },
  189. mounted: function() {
  190. this.getJgCydList()
  191. // this.getQtouList()
  192. },
  193. created() {
  194. },
  195. created: function() {
  196. console.log(this.$route.params.task_id)
  197. // this.unit_id = this.$route.params.unit_id
  198. this.task_id = this.$route.params.task_id
  199. this.getJgCydList()
  200. // this.getQtouList()
  201. },
  202. methods: {
  203. handleSizeChange(val) {
  204. console.log(`每页 ${val} 条`);
  205. },
  206. handleCurrentChange(val) {
  207. this.queryInfo.pageNum = val;
  208. console.log(`当前页: ${val}`);
  209. this.getJgCydList()
  210. },
  211. //批量选中
  212. handleSelectionChange(val) {
  213. this.multipleSelection = val;
  214. console.log(this.multipleSelection)
  215. },
  216. //获取牵头单位列表
  217. async getQtouList() {
  218. this.dialogVisible = 'ture'
  219. console.log(this.dialogVisible)
  220. this.queryInfo['token'] = token
  221. const result = await this.$http.post('getQtouList',this.queryInfo )
  222. console.log( result.data.data.rows);
  223. // 判断业务逻辑
  224. if (result.data.code == 0) {
  225. this.QtouList = result.data.data.rows
  226. this.total = result.data.data.total
  227. }
  228. },
  229. //返回
  230. returnTask(){
  231. this.$router.push('routineMonitor')
  232. },
  233. /** 监听每页显示多少数据的改变 */
  234. handleSizeChange1(newSize) {
  235. this.queryInfo.pageSize = newSize
  236. this.getJgCydList()
  237. },
  238. /** 监听页码的改变 */
  239. handleCurrentChange1(newPage) {
  240. this.queryInfo.pageNum = newPage
  241. this.getJgCydList()
  242. },
  243. // 获取抽样单列表
  244. async getJgCydList() {
  245. const result = await this.$http.post('getJgCydList', {
  246. task_id: this.task_id,
  247. pageSize:this.queryInfo.pageSize,
  248. pageNum:this.queryInfo.pageNum
  249. })
  250. console.log( result.data)
  251. console.log(this.queryInfo.pageSize)
  252. if (result.data.code == 0) {
  253. this.tableData = result.data.data.rows
  254. this.total = result.data.data.total
  255. console.log( result.data.data.total)
  256. }
  257. console.log(this.tableData)
  258. },
  259. //查看详情
  260. async readSampleList(row) {
  261. const result = await this.$http.post('readSampleList',{
  262. task_id:this.task_id,
  263. })
  264. },
  265. }
  266. }
  267. </script>
  268. <style>
  269. .block{
  270. padding: 10px;
  271. }
  272. .btns{
  273. float:right;
  274. padding: 10px;
  275. }
  276. .footer {
  277. margin-top: 5px;
  278. display: flex;
  279. flex-direction: row;
  280. justify-content: space-between;
  281. }
  282. </style>