王震
2023-08-22 15ac79a640187f1bc4d52d911428786bfdc710bd
src/views/experiment/inspectionApplication/index.vue
@@ -154,7 +154,7 @@
                >
                  <template slot-scope="scope">
                    <el-button type="text" size="small" @click="handleClick(scope.row)">查看</el-button>
                    <el-button type="text" size="small" >提交</el-button>
                    <!-- <el-button type="text" size="small" >提交</el-button> -->
                    <el-button type="text" size="small" >作废</el-button>
                  </template>
                </el-table-column>
@@ -164,7 +164,7 @@
                <el-pagination
                  class="pagination"
                  :current-page="currentPage"
                  :page-sizes="[5, 10, 20, 30]"
                  :page-sizes="[1, 10, 20, 30]"
                  :page-size="pageSize"
                  layout="total, sizes, prev, pager, next, jumper"
                  :total="total"
@@ -174,6 +174,7 @@
              </div>
            </div>
          </div>
          <!-- 对话框 -->
          <div class="checkType">
            <el-dialog
              title="新增检验单"
@@ -533,6 +534,7 @@
      </template>
      <template v-else>
        <router-view />
      </template>
    </div>
  </template>
@@ -546,8 +548,9 @@
        searchData: {
          applicationnumber: '',
          type: '',
          state: ''
          state: '',
        },
        icode:'',
        inspectionTable: [],
        rawMaterialTable: [],
        commisionTable: [{
@@ -623,7 +626,7 @@
        }],
        currentPage: 1,
        total: 20, // 总条数
        pageSize: 5, // 每页的数据条数
        pageSize: 8, // 每页的数据条数
        radioValue: '全部',
        checkTypeVisible: false,
        type: '', // 默认不选中的状态
@@ -649,9 +652,24 @@
      if (this.$route.name === 'ForInspectionDetail') this.showDetail = true
    },
    methods: {
      async handleClick(row){
        // console.log(item);
        // const res = await ddd({goodId:id})
        // this.$message({
        //   message: '恭喜你,这是一条成功消息',
        //   type: 'success'
        // });
        // console.log(res);
        this.inspectionTable = row;
        console.log(row.icode);
        this.icode = row.icode
        this.$router.push({name:'Viewdetails',query: {icode:row.icode}});
        this.selectInspectsList()
      },
      async selectInspectsList() {
        // 获取分页列表
        const res = await selectInspectsList({ countSize: this.pageSize, pageSize: this.currentPage })
        const res = await selectInspectsList({ countSize: this.pageSize, pageSize: this.currentPage,message:this.icode})
        // this.inspectionTable = data
        // console.log(res.data.row)
        const data = res.data.row
@@ -703,11 +721,9 @@
      this.total = this.inspectionTable.length
    },
    reset(){
      this.searchData = {
          applicationnumber: '',
          type: '',
          state: ''
      }
      this.countSize = 1
      this.searchData = { }
      // console.log('2222');
      this.selectInspectsList()
    },
    //被选中的信息 单选    
@@ -727,31 +743,31 @@
      this.rawmaterialVisible = false
    },
    async handleRadioChange(){
      console.log(this.type)
      if(this.type === 0){
        // 原材料报检
        this.rawmaterialVisible = true
        const res = await selectAll({type: this.type})
        var data = res.data
        data.forEach((item)=>{
          var checkdate = []
          checkdate.push(item['createTime'])
          checkdate.push(item['updateTime'])
          item['checkdate'] = checkdate // 检验日期
        })
        this.rawMaterialTable = data
        // this.rawmaterialVisible = true
        // const res = await selectAll({type: this.type})
        // var data = res.data
        // data.forEach((item)=>{
        //   var checkdate = []
        //   checkdate.push(item['createTime'])
        //   checkdate.push(item['updateTime'])
        //   item['checkdate'] = checkdate // 检验日期
        // })
        this.$router.push({ name: 'ReportForInspection' });
      }else if(this.type === 1){
        this.commisionVisible = true
        const res = await selectAll({type: this.type})
        var data = res.data
        data.forEach((item)=>{
          var checkdate = []
          checkdate.push(item['startTime'])
          checkdate.push(item['endTime'])
          item['checkdate_'] = item['startTime'] + '~' + item['endTime']
          item['checkdate'] = checkdate // 检验日期
        })
        this.commisionTable = res.data
        // this.commisionVisible = true
        // const res = await selectAll({type: this.type})
        // var data = res.data
        // data.forEach((item)=>{
        //   var checkdate = []
        //   checkdate.push(item['startTime'])
        //   checkdate.push(item['endTime'])
        //   item['checkdate_'] = item['startTime'] + '~' + item['endTime']
        //   item['checkdate'] = checkdate // 检验日期
        // })
        // this.commisionTable = res.data
        this.$router.push({ name: 'CommissionInspection' });
      }
    },
    // 新增检验