王震
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="新增检验单"
@@ -182,7 +183,7 @@
            >
              <div class="check-box">
                <el-radio-group v-model="type" @change="handleRadioChange">
                  <el-radio :label="0" border>原材料检验</el-radio>
                  <el-radio :label="0" border >原材料检验</el-radio>
                  <el-radio :label="1" border>委托检验</el-radio>
                  <el-radio :label="2" border>成品检验</el-radio>
                </el-radio-group>
@@ -192,43 +193,43 @@
                  <el-row :gutter="100">
                      <el-col :span="10">
                          <el-form-item label="来料日期:">
                              <el-input style="width: 300px" type="text" :value="infoForm.dateSurvey" placeholder="请输入来料日期" autocomplete="off" />
                              <el-input style="width: 300px" type="text" :value="infoForm.dateSurvey" placeholder="请输入来料日期" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      <el-col :span="10">
                          <el-form-item label="供应商名称:">
                              <el-input style="width: 300px" type="text" :value="infoForm.supplierName" placeholder="请输入供应商名称" autocomplete="off" />
                              <el-input style="width: 300px" type="text" :value="infoForm.supplierName" placeholder="请输入供应商名称" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      </el-row>
                      <el-row :gutter="100">
                      <el-col :span="10">
                          <el-form-item label="原材料编码:">
                              <el-input style="width: 300px" type="text" :value="infoForm.materialCoding" placeholder="请输入原材料编码" autocomplete="off" />
                              <el-input style="width: 300px" type="text" :value="infoForm.materialCoding" placeholder="请输入原材料编码" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      <el-col :span="10">
                          <el-form-item label="原材料名称:">
                              <el-input style="width: 300px" type="text" :value="infoForm.materialName" placeholder="请输入原材料名称" autocomplete="off" />
                              <el-input style="width: 300px" type="text" :value="infoForm.materialName" placeholder="请输入原材料名称" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      </el-row>
                      <el-row :gutter="100">
                      <el-col :span="10">
                          <el-form-item label="规格型号:">
                              <el-input style="width: 300px" type="text" :value="infoForm.specificationsModels" placeholder="请输入规格型号" autocomplete="off" />
                              <el-input style="width: 300px" type="text" :value="infoForm.specificationsModels" placeholder="请输入规格型号" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      <el-col :span="10">
                          <el-form-item label="单位:">
                              <el-input style="width: 300px" type="text" :value="infoForm.unit" placeholder="请输入单位" autocomplete="off" />
                              <el-input style="width: 300px" type="text" :value="infoForm.unit" placeholder="请输入单位" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      </el-row>
                      <el-row :gutter="100">
                      <el-col :span="10">
                          <el-form-item label="数量:">
                              <el-input style="width: 300px" type="text" :value="infoForm.quantity" placeholder="请输入数量" autocomplete="off" />
                              <el-input style="width: 300px" type="text" :value="infoForm.quantity" placeholder="请输入数量" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      <el-col :span="10">
@@ -251,43 +252,43 @@
                  <el-row :gutter="100">
                      <el-col :span="10">
                          <el-form-item label="来料日期:">
                              <el-input style="width: 300px" type="text" :value="commisionSelection.formTime" placeholder="请输入来料日期" autocomplete="off" />
                              <el-input style="width: 300px" type="text" :value="commisionSelection.formTime" placeholder="请输入来料日期" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      <el-col :span="10">
                          <el-form-item label="供应商名称:">
                              <el-input style="width: 300px" type="text" :value="commisionSelection.supplier" placeholder="请输入委托单位" autocomplete="off" />
                              <el-input style="width: 300px" type="text" :value="commisionSelection.supplier" placeholder="请输入委托单位" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      </el-row>
                      <el-row :gutter="100">
                      <el-col :span="10">
                          <el-form-item label="委托编号:">
                              <el-input style="width: 300px" type="text" :value="commisionSelection.mcode" placeholder="请输入样品编号" autocomplete="off" />
                              <el-input style="width: 300px" type="text" :value="commisionSelection.mcode" placeholder="请输入样品编号" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      <el-col :span="10">
                          <el-form-item label="委托名称:">
                              <el-input style="width: 300px" type="text" :value="commisionSelection.name" placeholder="请输入样品名称" autocomplete="off" />
                              <el-input style="width: 300px" type="text" :value="commisionSelection.name" placeholder="请输入样品名称" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      </el-row>
                      <el-row :gutter="100">
                      <el-col :span="10">
                          <el-form-item label="规格型号:">
                              <el-input style="width: 300px" type="text" :value="commisionSelection.specifications" placeholder="请输入型号规格" autocomplete="off" />
                              <el-input style="width: 300px" type="text" :value="commisionSelection.specifications" placeholder="请输入型号规格" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      <el-col :span="10">
                          <el-form-item label="单位:">
                            <el-input style="width: 300px" type="text" :value="commisionSelection.unit" placeholder="请输入单位" autocomplete="off" />
                            <el-input style="width: 300px" type="text" :value="commisionSelection.unit" placeholder="请输入单位" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      </el-row>
                      <el-row :gutter="100">
                      <el-col :span="10">
                          <el-form-item label="数量:">
                            <el-input style="width: 300px" type="text" :value="commisionSelection.num" placeholder="请输入数量" autocomplete="off" />
                            <el-input style="width: 300px" type="text" :value="commisionSelection.num" placeholder="请输入数量" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      <el-col :span="10">
@@ -310,43 +311,43 @@
                  <el-row :gutter="100">
                      <el-col :span="10">
                          <el-form-item label="来料日期:">
                              <el-input style="width: 300px" type="text" v-model="finishedTable.deliverydate" placeholder="请输入来料日期" autocomplete="off" />
                              <el-input style="width: 300px" type="text" v-model="finishedTable.deliverydate" placeholder="请输入来料日期" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      <el-col :span="10">
                          <el-form-item label="供应商名称:">
                              <el-input style="width: 300px" type="text" v-model="finishedTable.supplier" placeholder="请输入供应商名称" autocomplete="off" />
                              <el-input style="width: 300px" type="text" v-model="finishedTable.supplier" placeholder="请输入供应商名称" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      </el-row>
                      <el-row :gutter="100">
                      <el-col :span="10">
                          <el-form-item label="原材料编码:">
                              <el-input style="width: 300px" type="text" v-model="finishedTable.code" placeholder="请输入原材料编码" autocomplete="off" />
                              <el-input style="width: 300px" type="text" v-model="finishedTable.code" placeholder="请输入原材料编码" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      <el-col :span="10">
                          <el-form-item label="原材料名称:">
                              <el-input style="width: 300px" type="text" v-model="finishedTable.name" placeholder="请输入原材料名称" autocomplete="off" />
                              <el-input style="width: 300px" type="text" v-model="finishedTable.name" placeholder="请输入原材料名称" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      </el-row>
                      <el-row :gutter="100">
                      <el-col :span="10">
                          <el-form-item label="规格型号:">
                              <el-input style="width: 300px" type="text" v-model="finishedTable.modelandspecification" placeholder="请输入规格型号" autocomplete="off" />
                              <el-input style="width: 300px" type="text" v-model="finishedTable.modelandspecification" placeholder="请输入规格型号" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      <el-col :span="10">
                          <el-form-item label="单位:">
                              <el-input style="width: 300px" type="text" v-model="finishedTable.unit" placeholder="请输入单位" autocomplete="off" />
                              <el-input style="width: 300px" type="text" v-model="finishedTable.unit" placeholder="请输入单位" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      </el-row>
                      <el-row :gutter="100">
                      <el-col :span="10">
                          <el-form-item label="数量:">
                              <el-input style="width: 300px" type="text" v-model="finishedTable.amount" placeholder="请输入数量" autocomplete="off" />
                              <el-input style="width: 300px" type="text" v-model="finishedTable.amount" placeholder="请输入数量" autocomplete="off" />
                          </el-form-item>
                      </el-col>
                      <el-col :span="10">
@@ -390,7 +391,7 @@
                type="selection"
                label=""
                min-width="10%"
              />
              />
              <el-table-column
                type="index"
                label="序号"
@@ -528,15 +529,16 @@
                <el-button @click="commisionVisible = false">取 消</el-button>
                <el-button type="primary" @click="handleCommisionSelection">确 定</el-button>
              </span>
          </div>
          </div>
        </el-dialog>
      </template>
      <template v-else>
        <router-view />
      </template>
    </div>
  </template>
  <script>
  import { selectInspectsList, selectAll, addInspect} from '@/api/experiment/planAssignments'
  export default {
@@ -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,17 +721,15 @@
      this.total = this.inspectionTable.length
    },
    reset(){
      this.searchData = {
          applicationnumber: '',
          type: '',
          state: ''
      }
      this.countSize = 1
      this.searchData = { }
      // console.log('2222');
      this.selectInspectsList()
    },
    //被选中的信息 单选
    //被选中的信息 单选
    handleSelectionChange(val) {
      if (val.length > 1) {
        this.$refs.multipleTable.clearSelection();
        this.$refs.multipleTable.clearSelection();
        this.$refs.multipleTable.toggleRowSelection(val.pop())
      }
      this.tmp = val[0]
@@ -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' });
      }
    },
    // 新增检验
@@ -818,7 +834,7 @@
    }
  }
  </script>
  <style lang="scss" scoped>
  .checkType{
    .check-box{
@@ -833,7 +849,7 @@
            border-color: #b3d8ff;
           ::v-deep  .el-radio__label{
              color: #333 !important;
            }
          }
          height: auto;
@@ -876,7 +892,7 @@
    display: flex;
    justify-content: flex-end;
  }
  .getDataBtn, .createBtn {
    margin-left: 10px; /* Optional: Add some space between the buttons */
  }