zouyu
2023-09-13 b562911b2fe01cf2fc6a08ee8509d18aeeb2d6e4
src/components/view/finishedProductInspection.vue
@@ -1,6 +1,6 @@
<template>
  <div class="content-main">
    <div v-if="!showAddPage" class="rawPage">
    <div v-if="!showAdd" class="rawPage">
        <div class="title">
      <el-row>
        <el-col :span="12">成品检验</el-col>
@@ -13,21 +13,13 @@
    </div>
    <div class="nav">
        <span>检验结果:</span>
        <el-select v-model="searchData.inspectResult" size="small" placeholder="请选择" style="width: 224px;margin-right: 52px;">
            <el-option value="1" label="合格"></el-option>
            <el-option value="2" label="不合格"></el-option>
        <el-select v-model="searchData.result" size="small" placeholder="请选择" style="width: 224px;margin-right: 52px;">
            <el-option :value="''" label="全部"></el-option>
            <el-option :value="1" label="合格"></el-option>
            <el-option :value="0" label="不合格"></el-option>
          </el-select>
          <span>检验日期:</span>
          <el-date-picker
            v-model="searchData.inspectDate"
            type="date"
            placeholder="选择日期"
            style="margin-right: 52px">
           </el-date-picker>
          <span>检验人:</span>
          <el-select v-model="searchData.inspectUsername" size="small" placeholder="请选择" style="width: 224px;margin-right: 52px;">
            <el-option :value="item.id" :key="item.id" :label="item.name"  v-for="item in usernameOptions"></el-option>
          </el-select>
          <span>产品名称:</span>
        <el-input v-model="searchData.material" size="small" placeholder="请输入产品名称" style="width: 224px;margin-right: 52px;"></el-input>
          <el-button size="mini" @click="()=>{searchData={};getInspectionTableData()}"><span>重 置</span></el-button>
          <el-button size="mini" type="primary" @click="getInspectionTableData" style="background: #004EA2;"><span>查 询</span></el-button>
    </div>
@@ -66,7 +58,7 @@
                    min-width="108"
                />
                <el-table-column
                    prop="code"
                    prop="material_code"
                    label="产品编码"
                    min-width="100"
                />
@@ -113,6 +105,7 @@
                    <template slot-scope="scope">
                    <el-button type="text" size="small" @click="goToDetail(scope.row)">查看</el-button>
                    <el-button type="text" size="small">打印</el-button>
                    <el-button type="text" size="small">编辑</el-button>
                    </template>
                </el-table-column>
            </el-table>
@@ -120,9 +113,9 @@
        <!-- 分页器 -->
        <div class="pagination">
            <el-pagination
            :current-page="pageParams.pageNo"
            :page-sizes="[100, 200, 300, 400]"
            :page-size="pageParams.pageSize"
            :current-page="pageParams.pageSize"
            :page-sizes="[10, 50, 100, 200]"
            :page-size="pageParams.countSize"
            layout="total, sizes, prev, pager, next, jumper"
            :total="pageParams.total"
            @size-change="handleSizeChange"
@@ -261,29 +254,45 @@
                </el-table>
            </div>
    </div>
    <div class="newPage" v-if="showAdd">
        <finishedProductInspectionAdd />
    </div>
    <div class="newPage" v-if="showLook">
        <finishedProductInspectionLook :rowInfo="rowInfo"/>
    </div>
    <div class="newPage" v-if="showUp">
        <finishedProductInspectionUp :rowInfo="rowInfo"/>
    </div>
  </div>
</template>
<script>
import finishedProductInspectionAdd from '@/components/view/finishedProductInspectionAdd'
import finishedProductInspectionUp from '@/components/view/finishedProductInspectionUp'
import finishedProductInspectionLook from '@/components/view/finishedProductInspectionLook'
export default {
    components: { finishedProductInspectionAdd,finishedProductInspectionUp, finishedProductInspectionLook},
    data(){
        return {
            searchData:{
                inspectionResult: '',
                inspectionDate: '',
                inspecter: '',
                result: '',
                material: '',
            },
            // 主机工下拉框
            usernameOptions:[],
            inspectionTable:[
            ],
            rowInfo:{},
            pageParams:{
              pageNo: 1, // 当前页码
              pageSize: 100,
              countSize: 10, //每页数量
              pageSize: 1, // 当前页码
              total:0
            },            
            showAddPage: false,
            showAdd: false,
            showLook: false,
            showUp: false,
            showDetail:false,
            addInspectionform: [{
                number: '',
@@ -335,7 +344,7 @@
        this.currentPage = val
        },
        handleAddNew(){
            this.showAddPage=true
            this.showAdd=true
        },
        async getInspectionTableData() {
            const {data:{row,total}} = await this.$axios.get(this.$api.url.finishedInsListPage,{params:{...this.pageParams,...this.searchData}})
@@ -344,15 +353,15 @@
            this.pageParams.total = total
        },
        goToDetail(row) {
            this.showAddPage = true
            this.showDetail = true
            // this.showAddPage = true
            // this.showDetail = true
            this.finishedInsInfo = row
            console.log(this.showDetail)
            // this.addInspectionform = []
        },
        async init() {
            const {data} = await this.$axios.get(this.$api.url.finishedInspectUser)
            this.usernameOptions = data
            // const {data} = await this.$axios.get(this.$api.url.finishedInspectUser)
            // this.usernameOptions = data
        }
    }