|
@@ -3,215 +3,210 @@
|
|
|
<div style="width: 100%">
|
|
|
<!-- 标题栏导航 -->
|
|
|
<div slot="header" class="clearfix">
|
|
|
- <el-breadcrumb separator-class="el-icon-artableDate-right">
|
|
|
+ <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-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 tableHeader2" :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 style="margin:5px 0" type="success" size="small" @click="dialogVisible=true">查看详情</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <!--分页器区域-->
|
|
|
- <el-pagination class="feyeqi" @size-change="handleSizeChange" @current-change="handleCurrentChange"
|
|
|
+
|
|
|
+ <!-- 检测单表格区域 -->
|
|
|
+ <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 @size-change="handleSizeChange1" @current-change="handleCurrentChange1"
|
|
|
: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="returnJcd()" >
|
|
|
- 返回
|
|
|
- </el-button>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button plain size="medium" @click="returnJcdList(scope.row.task_id)" >返回</el-button>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
- <!-- 查看详情对话框-->
|
|
|
- <el-dialog title="查看" :visible.sync="dialogVisible" width="30%" :close-on-click-modal="false"
|
|
|
- class="dialogItem" >
|
|
|
- <el-form v-if="dialogVisible" label-width="100px">
|
|
|
- <el-form-item label="抽样单编码:" prop="tableData.cyd_code" class="labelItem">
|
|
|
- <div>{{readForm.cyd_code}}</div>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="抽样单状态:" prop="cyd_status" class="labelItem">
|
|
|
- <div v-if="level=='0'">一般</div>
|
|
|
- <div v-if="level=='1'">紧急</div>
|
|
|
- <div v-if="level=='2'">特急</div>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="抽样人员1:" prop="sample_person_one" width="70px" class="labelItem">
|
|
|
- <div>{{sample_person_one}}</div>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="抽样人员2:" prop="sample_person_two" class="labelItem">
|
|
|
- <div>{{readForm.sample_person_two}}</div>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="抽样时间:" prop="cyd_date" class="labelItem">
|
|
|
- <div>{{readForm.cyd_date}}</div>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="单位名称:" prop="inspected_name" class="labelItem">
|
|
|
- <div>{{readForm.inspected_name}}</div>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="单位地址:" prop="inspected_address" class="labelItem">
|
|
|
- <div>{{readForm.inspected_address}}</div>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="联系人:" prop="contact_name" class="labelItem">
|
|
|
- <div>{{readForm.contact_name}}</div>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="备注:" prop="cyd_log" class="labelItem">
|
|
|
- <div v-if="readForm.cyd_log==null">无</div>
|
|
|
- <div v-else>{{readForm.cyd_log}}</div>
|
|
|
- </el-form-item>
|
|
|
- <div class="footer">
|
|
|
- <el-button type="success" @click="dialogVisible = false">返回</el-button>
|
|
|
- </div>
|
|
|
- </el-form>
|
|
|
- </el-dialog>
|
|
|
|
|
|
+ <!-- 查看样品列表弹框 -->
|
|
|
+ <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-pagination @size-change="handleSizeChange2" @current-change="handleCurrentChange2"
|
|
|
+ :current-page="yangInfo.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="yangInfo.pageSize"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper" :total="total" background />
|
|
|
+ </el-table>
|
|
|
+ </el-form>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- // 查看任务详情
|
|
|
- dialogVisible: false,
|
|
|
- readForm: {
|
|
|
- cyd_code:''
|
|
|
- },
|
|
|
- // 数据表格数据
|
|
|
- tableData:[],
|
|
|
- sampleOrgId:{},
|
|
|
+export default{
|
|
|
+ data(){
|
|
|
+ return{
|
|
|
+ //弹框显隐
|
|
|
+ readDialog:false,
|
|
|
+ //第一个表格
|
|
|
+ tableData:[],
|
|
|
+ //第二个表格
|
|
|
+ tableData2:[],
|
|
|
+ //获取检测机构的两个参数
|
|
|
+ task_id:'',
|
|
|
+ task_profile_id:'',
|
|
|
+ //获取样品列表的抽样单id
|
|
|
+ cyd_id:'',
|
|
|
+ //条数
|
|
|
+ total:0,
|
|
|
+ // 第一个页码
|
|
|
queryInfo:{
|
|
|
- pageSize:10,
|
|
|
- pageNum:1,
|
|
|
- task_class:'例行监测',
|
|
|
- task_id: 39, //任务id
|
|
|
- task_profile_id: 90, //task_profile_id
|
|
|
- sample_org_id: 18, //抽样单位id
|
|
|
- check_org_id: 272, //检测单位id
|
|
|
- cyd_status:'',
|
|
|
- cyd_status_condition:'',
|
|
|
- cyd_code:''
|
|
|
- },
|
|
|
- tableHeader2: [{
|
|
|
- label: '抽样单编码',
|
|
|
+ pageSize:10,
|
|
|
+ pageNum:1,
|
|
|
+ },
|
|
|
+ // 第二个页码
|
|
|
+ yangInfo:{
|
|
|
+ pageSize:10,
|
|
|
+ pageNum:1
|
|
|
+ },
|
|
|
+ //第一个大表格
|
|
|
+ tableHeader1: [{
|
|
|
+ label: '抽样单编码',
|
|
|
prop: 'cyd_code',
|
|
|
width: 180,
|
|
|
},{
|
|
|
- label: '抽样人员1',
|
|
|
- prop: 'cydProfile.sample_person_one',
|
|
|
+ label: '受检单位',
|
|
|
+ prop: 'inspectedUnit.inspected_name',
|
|
|
width: 120,
|
|
|
},{
|
|
|
- label: '抽样人员2',
|
|
|
- prop: 'cydProfile.sample_person_two',
|
|
|
+ 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: 'cydProfile.cyd_date',
|
|
|
- width: 160,
|
|
|
- },
|
|
|
- // {
|
|
|
- // label: '样品名称',
|
|
|
- // prop: 'inspectedUnit.sample_name',
|
|
|
- // width: 120,
|
|
|
- // },{
|
|
|
- // label: '样品商标',
|
|
|
- // prop: 'sample.data.sample_brand'
|
|
|
- // },
|
|
|
- {
|
|
|
- label: '抽样单状态',
|
|
|
- prop: 'cyd_status'
|
|
|
- },
|
|
|
- ]
|
|
|
+ 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.id = this.$route.params.id
|
|
|
- // this.task_id = this.$route.params.id
|
|
|
- // console.log(this.task_id)
|
|
|
- this.getJcds()
|
|
|
- },
|
|
|
- methods: {
|
|
|
- //返回
|
|
|
- returnJcd(){
|
|
|
- this.$router.push('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
|
|
|
+ this.getJcds()
|
|
|
+ this.getSamples()
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ //获取检测机构列表的接口
|
|
|
async getJcds() {
|
|
|
- for (var key in this.queryInfo) {
|
|
|
- if (this.queryInfo[key] == '') {
|
|
|
- delete this.queryInfo[key]
|
|
|
- }
|
|
|
- }
|
|
|
- const {
|
|
|
- data: res
|
|
|
- } = await this.$http.post(
|
|
|
- "getJcds", this.queryInfo
|
|
|
- );
|
|
|
- this.tableData = res.data.rows
|
|
|
- console.log( this.tableData)
|
|
|
- this.total = res.data.total
|
|
|
- this.task_id = res.data.rows.task_id
|
|
|
- for(let i=0; i<this.tableData.length; i++){
|
|
|
- if (this.tableData[i].cyd_status == "0"){
|
|
|
- this.tableData[i].cyd_status ="未发布";
|
|
|
- }else if(this.tableData[i].cyd_status == "1"){
|
|
|
- this.tableData[i].cyd_status ="已发布";
|
|
|
- }else if(this.tableData[i].cyd_status == "2"){
|
|
|
- this.tableData[i].cyd_status ="废止";
|
|
|
- }else if(this.tableData[i].cyd_status == "3"){
|
|
|
- this.tableData[i].cyd_status ="已结束未完成";
|
|
|
- }else if(this.tableData[i].cyd_status == "4"){
|
|
|
- this.tableData[i].cyd_status ="已结束已完成";
|
|
|
- }else{
|
|
|
- this.tableData[i].releaser.properties ="执行中";
|
|
|
+ const {data: res} = await this.$http.post("getJcds", {
|
|
|
+ pageNum: this.queryInfo.pageNum,
|
|
|
+ pageSize: this.queryInfo.pageSize,
|
|
|
+ task_id: this.task_id,
|
|
|
+ task_profile_id:this.task_profile_id,
|
|
|
+ })
|
|
|
+ this.tableData = res.data.rows
|
|
|
+ this.total = res.data.total
|
|
|
+ console.log( this.tableData)
|
|
|
+ },
|
|
|
+ //第一个分页器
|
|
|
+ /** 监听页码的改变 */
|
|
|
+ handleCurrentChange1(newPage) {
|
|
|
+ this.queryInfo.pageNum = newPage
|
|
|
+ this.getJcds()
|
|
|
+ },
|
|
|
+ /** 监听每页显示多少数据的改变 */
|
|
|
+ handleSizeChange1(newSize) {
|
|
|
+ this.queryInfo.pageSize = newSize
|
|
|
+ this.getJcds()
|
|
|
+ },
|
|
|
+ //第二个分页器
|
|
|
+ /** 监听页码的改变 */
|
|
|
+ handleCurrentChange2(newPage) {
|
|
|
+ this.yangInfo.pageNum = newPage
|
|
|
+ this.getSamples()
|
|
|
+ },
|
|
|
+ /** 监听每页显示多少数据的改变 */
|
|
|
+ handleSizeChange2(newSize) {
|
|
|
+ this.yangInfo.pageSize = newSize
|
|
|
+ this.getSamples()
|
|
|
+ },
|
|
|
+ //返回
|
|
|
+ returnJcdList(task_id){
|
|
|
+ // var that = this
|
|
|
+ this.$router.push({
|
|
|
+ name:'getJcds',
|
|
|
+ params:{
|
|
|
+ task_id: task_id
|
|
|
}
|
|
|
- }
|
|
|
+ })
|
|
|
},
|
|
|
-
|
|
|
- //分页器
|
|
|
- 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()
|
|
|
- },
|
|
|
- // 查看任务详情
|
|
|
- async readDialogVisible1(row) {
|
|
|
- this.readForm.cyd_code = row.cyd_code
|
|
|
-
|
|
|
- this.readDialogVisible = true
|
|
|
- }
|
|
|
-
|
|
|
+ //获取样品列表
|
|
|
+ async getSampleList(id) {
|
|
|
+ this.readDialog = true
|
|
|
+ this.getSamples(id)
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ async getSamples(id) {
|
|
|
+ const {data: res} = await this.$http.post("getSamples",{
|
|
|
+ cyd_id: id,
|
|
|
+ pageNum: this.yangInfo.pageNum,
|
|
|
+ pageSize: this.yangInfo.pageSize
|
|
|
+ })
|
|
|
+ this.tableData2 = res.data.rows
|
|
|
+ console.log(res.data.rows)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
-<style>
|
|
|
-.btns{
|
|
|
- float:right;
|
|
|
- /* margin-top: 10px; */
|
|
|
- padding: 10px;
|
|
|
-}
|
|
|
-.feyeqi{
|
|
|
- margin-top: 10px;
|
|
|
-}
|
|
|
-</style>
|