123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295 |
- <template>
- <div>
- <div slot="header" class="clearfix">
- <el-breadcrumb separator-class="el-icon-arrow-right">
- <el-breadcrumb-item >首页</el-breadcrumb-item>
- <el-breadcrumb-item>监测任务</el-breadcrumb-item>
- <el-breadcrumb-item>抽样单</el-breadcrumb-item>
- </el-breadcrumb>
- </div>
- <!-- 牵头单位弹框 -->
- <!-- <el-button icon="el-icon-search" @click="getQtouList()" size="medium">搜索牵头单位</el-button> -->
- <!-- 下拉菜单 -->
- <!-- <div>
- 牵头单位
- <el-select v-model="value" placeholder="请选择" clearable>
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- @change="choseQt()">
- </el-option>
- </el-select> -->
- <!-- 返回按钮 -->
- <el-form-item label="牵头单位名称" class="select" size="small">
- <el-input v-model="queryInfo.unit_name"></el-input>
- <el-button type="success" size="small">查询</el-button>
- </el-form-item>
-
- <div class="btns">
- <el-button plain size="small" @click="returnTask()">
- 返回
- </el-button>
- </div>
- <!-- 表格数据区域-->
- <div class="table">
- <el-table ref="multipleTable" :data="tableData" border stripe highlight-current-row style="width: 100%"
- :row-style="rowStyle" :cell-style="cellStyle" @selection-change="handleSelectionChange">
- <el-table-column label="序号" width="50px">
- <template slot-scope="scope">
- {{ scope.$index+1 }}
- </template>
- </el-table-column>
- <el-table-column :key="table.label" v-for="table in tableHeader" :label="table.label" :prop="table.prop"
- align="center" :width="table.width" :fixed="table.fixed"/>
- <el-table-column label="操作" align="center" fixed="right">
- <!-- 操作按钮区域的作用域插槽 -->
- <template >
- <!-- <el-button type="success" size="mini" @click="readDialogVisible1(scope.row)">抽样单详情</el-button> -->
- <el-button style="margin: 5px auto;" type="success" size="small" @click="readSampleList()">查看详情</el-button>
- <el-button size="small" @click="sendBack()">退回</el-button>
- </template>
- </el-table-column>
- </el-table>
- <!-- 分页器区域-->
- <div class="block">
- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="queryInfo.pageNum"
- :page-sizes="[10, 15, 20]" :page-size="queryInfo.pageSize"
- layout="total, sizes, prev, pager, next, jumper" :total="total" background />
- </div>
- <!-- 牵头单位弹框 -->
- <!-- <el-dialog title="机构选择" :visible.sync="dialogVisible" width="50%" :close-on-click-modal="ture" :show-close="true" :center="true" @click="getTestList()" > -->
- <!-- <el-form v-if="getQtListShow" :model="getTestListForm"> -->
- <!-- 表格数据区域-->
- <!-- <el-table ref="multipleTable" :data="QtouList" row-key="id" @selection-change="handleSelectionChange()"
- border stripe highlight-current-row style="width: 100%">
- <el-table-column type="selection" :reserve-selection="true" width="50"></el-table-column>
- <el-table-column label="序号" width="50px">
- <template slot-scope="scope">
- {{ scope.$index+1 }}
- </template>
- </el-table-column>
- <el-table-column :key="table.prop" v-for="table in tableHeader_qt" :label="table.label"
- :prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
- </el-table> -->
- <!-- <div class="footer"> -->
- <!-- 分页器区域-->
- <!-- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
- :current-page="queryInfo.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo.pageSize"
- layout="total, sizes, prev, pager, next, jumper" :total="total" background />
- <el-button type="success" @click="dialogVisible = false" size="small">提交</el-button>
- </div> -->
- <!-- </el-form> -->
- <!-- </el-dialog> -->
- </div>
- </div>
-
- </template>
- <script>
- const token = window.sessionStorage.getItem('token')
- export default {
- name: '',
- data() {
- return {
-
- //控制弹框显隐
- dialogVisible: false,
- total:0,
- queryInfo:{
- keyWord: '',
- year:'',
- task_name:'',
- starttime:'',
- endtime:'',
- ispublic:'',
- pageSize:10,
- pageNum:1,
- task_class:'专项监测',
- task_id:'',
- unit_name:'',
- },
- cellStyle: {
- padding: 2 + 'px'
- },
- rowStyle: {
- height: 35 + 'px'
- },
- tableHeader: [{
- label: '样品名称',
- prop: 'sample_name',
- width: 150
- // fixed: 'left'
- },
- {
- label: '样品编码',
- prop: 'sample_id',
- width: 200
- // fixed: 'left'
- }, {
- label: '商标',
- prop: 'brand',
- width: 150
- // fixed: 'left'
- },
- {
- label: '等级',
- prop: 'level',
- width: 120
- },
- {
- label: '抽样基数',
- prop: 'sample_base',
- width: 120
- },
- {
- label: '抽样场所',
- prop: 'sample_ground',
- width: 120
- },
- {
- label: '状态',
- prop: 'sample_status',
- width: 180
- }
- ],
- // 表头
- tableHeader_qt: [{
- label: '单位名称',
- prop: 'name',
- width: 300
- // fixed: 'left'
- },
- {
- label: '机构类型',
- prop: 'jgxz',
- // width: 40
- // fixed: 'left'
- }, {
- label: '所属区域',
- prop: 'ssqy',
- width: 300
- // fixed: 'left'
- },{
- label: '产品范围',
- prop: 'cpfw',
- width: 300
- // fixed: 'left'
- }
- ],
- // 总共多少条数据
- total: 0,
- // table表格多选选项
- multipleSelection: null,
- getQtListShow: {},
- // 选中的牵头单位
- orgs: [],
- // 数据表格数据
- tableData: [],
- QtouList:[]
- }
- },
- mounted: function() {
- this.getJgCydList()
- // this.getQtouList()
- },
- created() {
- },
- created: function() {
- console.log(this.$route.params.task_id)
- // this.unit_id = this.$route.params.unit_id
- this.task_id = this.$route.params.task_id
- this.getJgCydList()
- // this.getQtouList()
- },
-
- methods: {
- handleSizeChange(val) {
- console.log(`每页 ${val} 条`);
- },
- handleCurrentChange(val) {
- this.queryInfo.pageNum = val;
- console.log(`当前页: ${val}`);
- this.getJgCydList()
- },
- //批量选中
- handleSelectionChange(val) {
- this.multipleSelection = val;
- console.log(this.multipleSelection)
- },
-
- //获取牵头单位列表
- async getQtouList() {
- this.dialogVisible = 'ture'
- console.log(this.dialogVisible)
- this.queryInfo['token'] = token
- const result = await this.$http.post('getQtouList',this.queryInfo )
- console.log( result.data.data.rows);
- // 判断业务逻辑
- if (result.data.code == 0) {
- this.QtouList = result.data.data.rows
- this.total = result.data.data.total
- }
- },
- //返回
- returnTask(){
- this.$router.push('routineMonitor')
- },
- /** 监听每页显示多少数据的改变 */
- handleSizeChange1(newSize) {
- this.queryInfo.pageSize = newSize
- this.getJgCydList()
- },
- /** 监听页码的改变 */
- handleCurrentChange1(newPage) {
- this.queryInfo.pageNum = newPage
- this.getJgCydList()
- },
- // 获取抽样单列表
- async getJgCydList() {
- const result = await this.$http.post('getJgCydList', {
- task_id: this.task_id,
- pageSize:this.queryInfo.pageSize,
- pageNum:this.queryInfo.pageNum
- })
- console.log( result.data)
- console.log(this.queryInfo.pageSize)
- if (result.data.code == 0) {
- this.tableData = result.data.data.rows
- this.total = result.data.data.total
- console.log( result.data.data.total)
- }
- console.log(this.tableData)
- },
- //查看详情
- async readSampleList(row) {
- const result = await this.$http.post('readSampleList',{
- task_id:this.task_id,
- })
- },
- }
- }
-
-
-
- </script>
- <style>
- .block{
- padding: 10px;
- }
- .btns{
- float:right;
- padding: 10px;
- }
- .footer {
- margin-top: 5px;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- }
- </style>
|