123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252 |
- <template>
-
- <div style="width: 100%">
- <!-- 标题栏导航 -->
- <div slot="header" class="clearfix">
- <el-breadcrumb separator-class="el-icon-artableDate-right">
- <el-breadcrumb-item >首页</el-breadcrumb-item>
- <el-breadcrumb-item>例行监测</el-breadcrumb-item>
- <el-breadcrumb-item>查看检测单列表</el-breadcrumb-item>
- </el-breadcrumb>
- </div>
- <!-- 表格区域 -->
- <el-table :data="tableData" border stripe highlight-current-row style="width: 100%" >
- <el-table-column :key="table.label" v-for="table in tableHeader1" :label="table.label"
- :prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
- <!-- 操作 -->
- <el-table-column label="操作" align="center" fixed="right">
- <template slot-scope="scope">
- <el-button style="margin:5px 0" type="success" size="small" @click="getSampleList(scope.row.id)">获取样品列表</el-button>
- </template>
- </el-table-column>
- </el-table>
- <!--原页面分页器区域-->
- <el-pagination class="feyeqi" @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 class="btns">
- <el-button plain size="medium" @click="returnJcdList()" >
- 返回
- </el-button>
- </div>
- <!-- 弹框 样品列表 -->
- <el-dialog title="样品列表" :visible.sync="readDialog" width="75%" :close-on-click-modal="false" class="dialogItem">
- <el-form v-if="readDialog">
- <el-table :data="tableData2" border stripe highlight-current-row style="width: 100%" >
- <el-table-column :key="table.label" v-for="table in tableHeader2" :label="table.label"
- :prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
- <!-- 操作 -->
- <el-table-column label="操作" align="center" fixed="right">
- <template slot-scope="scope">
- <el-button style="margin:5px 0" type="success" size="small" @click="getSampleList(scope.row.id)">查看检测单详情</el-button>
- </template>
- </el-table-column>
- </el-table>
- <!-- 样品列表分页器区域-->
- <el-pagination @size-change="handleSizeChange2" @current-change="handleCurrentChange2"
- :current-page="userInfo.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="userInfo.pageSize"
- layout="total, sizes, prev, pager, next, jumper" :total="total" background />
- </el-form>
- </el-dialog>
- </div>
- </template>
- <script>
- export default {
- data() {
- return {
- readDialog: false,
- // 数据表格数据
- total:0,
- tableData:[],
- tableData2:[],
- sampleOrgId:{},
- task_id:'',
- task_profile_id:'',
- underInfo:{
- pageNum: 1,
- pageSize: 10,
- cyd_id: ''
- },
- queryInfo:{
- pageSize:10,
- pageNum:1,
- task_class:'例行监测',
- sample_org_id:'',
- check_org_id:'',
- cyd_status:'',
- cyd_status_condition:'',
- cyd_code:''
- },
- tableHeader1: [{
- label: '抽样单编码',
- prop: 'cyd_code',
- width: 180,
- },{
- label: '受检单位',
- prop: 'inspectedUnit.inspected_name',
- width: 120,
- },{
- label: '单位地址',
- prop: 'inspectedUnit.inspected_address',
- width: 200,
- },{
- label: '单位联系人',
- prop: 'inspectedUnit.contact_name',
- width: 200,
- },{
- label: '联系人电话',
- prop: 'inspectedUnit.contact_phone',
- width: 200,
- }],
- tableHeader2: [{
- label: '样品名称',
- prop: 'sample_name',
- width: 180,
- },{
- label: '样品品牌',
- prop: 'sample_brand',
- width: 120,
- },{
- label: '抽样数量',
- prop: 'sample_count',
- width: 200,
- },{
- label: '抽样基数',
- prop: 'sample_base',
- width: 200,
- },{
- label: '生产日期',
- prop: 'sample_md_date',
- width: 200,
- },{
- label: '样品来源',
- prop: 'sample_source',
- width: 200,
- },{
- label: '备注',
- prop: 'inspectedUnit.contact_phone',
- width: 200,
- }]
- }
- },
- mounted() {
- this.getJcds()
- },
- created() {
- this.cyd_id = this.$route.params.cyd_id
- this.task_id = this.$route.params.task_id
- this.task_profile_id = this.$route.params.task_profile_id
- console.log(this.task_id)
- console.log(this.task_profile_id)
- this.getJcds()
- this.getSamples()
- },
- methods: {
- //返回
- returnSampleList(){
- var that = this
- this.$router.push({
- name:'setTaskJg',
- params:{
- task_id: that.task_id
- }
- })
- console.log(task_id)
- },
- // 获取检测单列表
- async getJcds() {
- var that = this
- const {data: res} = await this.$http.post("getJcds", {
- task_id: that.task_id,
- task_profile_id:that.task_profile_id,
- pageNum: that.queryInfo.pageNum,
- pageSize: that.queryInfo.pageSize
- });
- console.log(that.id)
- this.tableData = res.data.rows
- console.log( this.tableData)
- this.total = res.data.total
- console.log( this.total)
- },
- // 获取样品列表
- async getSampleList(id) {
- this.task_id = this.task_id
- this.task_profile_id = id
- this.readDialog = true
- this.getSamples()
- },
- async getSamples() {
- // var that = this
- const {
- data: res
- } = await this.$http.post("getSamples",{
- cyd_id: this.id,
- task_id: this.task_id,
- task_id: this.task_id,
- task_profile_id:this.task_profile_id,
- pageNum: this.queryInfo.pageNum,
- pageSize: this.queryInfo.pageSize
- });
- this.tableData2 = res.data.rows
- console.log(this.id)
- this.total = res.data.total
-
- },
- //分页器
- handleSizeChange(val) {
- console.log(`每页 ${val} 条`);
- },
- handleCurrentChange(val) {
- this.queryInfo.pageNum = val;
- console.log(`当前页: ${val}`);
- this.getJcds()
- },
- /** 监听页码的改变 */
- handleCurrentChange(newPage) {
- this.queryInfo.pageNum = newPage
- this.getJcds()
- },
- /** 监听每页显示多少数据的改变 */
- handleSizeChange(newSize) {
- this.queryInfo.pageSize = newSize
- this.getJcds()
- },
- //分页器2
- /** 监听页码的改变 */
- handleCurrentChange2(newPage) {
- this.userInfo.pageNum2 = newPage
- this.getSamples()
- },
- /** 监听每页显示多少数据的改变 */
- handleSizeChange2(newSize) {
- this.userInfo.pageSize2 = newSize
- this.getSamples()
- },
- //查看检测单详情
- readCheck(id){
- this.$router.push({
- name:'readCheck',
- params: {
- cyd_id:id,
- }
- })
- },
-
- }
- }
- </script>
- <style>
- .btns{
- float:right;
- /* margin-top: 10px; */
- padding: 10px;
- }
- .feyeqi{
- margin-top: 10px;
- }
- </style>
|