王震
2023-08-26 9b69204868cacae4a67b119a9836be59c537a7ae
查看详情页
已修改2个文件
161 ■■■■■ 文件已修改
src/api/experiment/planAssignments.js 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/experiment/inspectionApplication/index.vue 145 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/experiment/planAssignments.js
@@ -55,3 +55,19 @@
    params
  })
}
//原材料检验列表
export function YANcailiso(params) {
  return request({
    url: '/raw-material/selectAll',
    method: 'get',
    params
  })
}
//版本号
export function chooseVer(params) {
  return request({
    url: '/inspection/chooseVer',
    method: 'get',
    params
  })
}
src/views/experiment/inspectionApplication/index.vue
@@ -183,7 +183,7 @@
                            top="10vh"
            >
              <div class="check-box">
                <el-radio-group v-model="type" @change="handleRadioChange">
                <el-radio-group v-model="type" @click.native="handleRadioChange">
                  <el-radio :style="`background-color: ${type==0?'rgb(170, 236, 214)':'#fff'};border-radius: 10px;`" :label="0" border>原材料检验</el-radio>
                  <el-radio :style="`background-color: ${type==1?'rgb(170, 236, 214)':'#fff'};border-radius: 10px;`" :label="1" border>委托检验</el-radio>
                  <el-radio :style="`background-color: ${type==2?'rgb(170, 236, 214)':'#fff'};border-radius: 10px;`" :label="2" border>成品检验</el-radio>
@@ -379,21 +379,21 @@
        <el-dialog
              title="标准库"
              :visible.sync="Standardframe"
              width="48%"
              >
              <!-- <el-form :model="form">
                <el-form-item label="请选择审核结果:" :label-width="formLabelWidth">
                </el-form-item>
              </el-form> -->
              <!-- <div slot="footer" class="dialog-footer"> -->
              width="48%">
              <el-card>
                  <template slot-scope="scope" >
                    <span>版本选择:</span>
                            <el-select v-model="commisionTable" size="small" slot="append" style="width: 220px;">
                            <el-option v-for="item in BANben" :key="item.id" :label="item.name"  :value="item.name"></el-option>
                            </el-select>
                  </template>
              </el-card>
                <el-table
                    :data="tableData"
                    style="width: 100%; margin-bottom: 20px"
                    row-key="name"
                    border
                    height="calc(100vh - 250px)"
                    default-expand-all
                    ref="multipleTable"
                    :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
@@ -445,7 +445,11 @@
                      </template>
                    </el-table-column>
                  </el-table>
              <!-- </div> -->
                  <span slot="footer" class="dialog-footer">
                <el-button @click="Standardframe = false">取 消</el-button>
                <el-button type="primary" @click="Standardframe = false">确 定</el-button>
            </span>
            </el-dialog>
        <!-- 原材料检验模态框 -->
@@ -461,20 +465,19 @@
              :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'center'}"
              :data="rawMaterialTable"
              style="width: 100%"
              @selection-change="handleSelectionChange"
              @selection-change="handleSelectionChange_0"
            >
              <el-table-column
            <el-table-column
                type="selection"
                label=""
                min-width="10%"
              />
              />
              <el-table-column
                type="index"
                label="序号"
                min-width="8%"
              />
              <el-table-column
                prop="dateSurvey"
                prop="createTime"
                label="来料日期"
                min-width="8%"
              />
@@ -519,12 +522,12 @@
                min-width="8%"
              />
              <el-table-column
                prop="createTime"
                prop="dateSurvey"
                label="检验日期"
                min-width="8%"
              />
              <el-table-column
                prop="state"
                prop="condition"
                label="状态"
                min-width="8%"
              >
@@ -597,7 +600,7 @@
  </template>
  <script>
  import { selectInspectsList, selectAll, addInspect,getCommisionList} from '@/api/experiment/planAssignments'
  import { selectInspectsList, selectAll, addInspect,getCommisionList,YANcailiso,chooseVer} from '@/api/experiment/planAssignments'
  export default {
    data() {
      return {
@@ -607,34 +610,11 @@
          type: '',
          state: '',
        },
        valu:{},
        icode:'',
        inspectionTable: [],
        rawMaterialTable: [],
        commisionTable: [{
          specifications_models: "GGXH-AAAAA",
          inspectionTime: "2023-08-03",
          id: 2,
          samples_number: 0,
          dateSurvey: "2023-08-03",
          entrusted: "阿里巴巴",
          completionDeadline: "2023-08-03",
          contacts: "小黑",
          entrust_coding: "SL20230803000003",
          sample_name: "发动机",
          inspection_status: 1
        },{
          specifications_models: "GGXH-AAAAA",
          inspectionTime: "2023-08-03",
          id: 2,
          samples_number: 0,
          dateSurvey: "2023-08-03",
          entrusted: "阿里巴巴",
          completionDeadline: "2023-08-03",
          contacts: "小黑",
          entrust_coding: "SL20230803000003",
          sample_name: "发动机",
          inspection_status: 1
        }],
        commisionTable: [],
        finishedTable: {
          deliverydate: '',
          supplier: '',
@@ -691,7 +671,10 @@
        commisionVisible: false,
        tmp: '',
        Standardframe: false,
                tableData: []
                tableData: [],
        tableRow:{},
        BANben:[],
        select_1: []
      }
    },
    watch: {
@@ -706,7 +689,6 @@
    },
    created() {
      this.selectInspectsList()
      // this.getCommisionList()
    },
    updated() {
      if (this.$route.name === 'ForInspectionDetail') this.showDetail = true
@@ -727,11 +709,27 @@
        this.$router.push({name:'Viewdetails',query: {id:row.id}});
        this.selectInspectsList()
      },
      //版本库
      async chooseVer() {
        const res = await chooseVer ({
          mcode:this.commisionTable.entrust_coding,
          name:this.commisionTable.entrusted,
          scifications:this.commisionTable.specifications_models
         })
        console.log(res);
        this.BANben = res.data.row
      },
      //委托检验
      async getCommisionList() {
        const res = await getCommisionList({pageNo:1,pageSize:10 })
        this.commisionTable = res.data
        console.log(this.commisionTable);
        console.log(res);
        this.commisionTable = res.data.row
      },
      //原材料
      async selecYANcailisotAllAPI() {
        const res = await YANcailiso({pageNo:1,pageSize:10 })
        console.log(res);
        this.rawMaterialTable = res.data.row
      },
      async selectInspectsList() {
        // 获取分页列表
@@ -808,23 +806,30 @@
      this.infoForm = this.tmp
      this.rawmaterialVisible = false
    },
    async handleRadioChange(){
      if(this.type === 0){
    handleRadioChange(){
      setTimeout(() => {
        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 // 检验日期
        YANcailiso({pageNo:1,pageSize:10}).then(res=>{
        //   var data = res.data
        // data.forEach((item)=>{
        //   var checkdate = []
        //   checkdate.push(item['createTime'])
        //   checkdate.push(item['updateTime'])
        //   item['checkdate'] = checkdate // 检验日期
        // })
        this.rawMaterialTable = res.data.row
        })
          // this.infoForm = res.data
        // this.$router.push({ name: 'ReportForInspection' });
      }else if(this.type === 1){
        this.commisionVisible = true
        const res = await getCommisionList({pageNo:1,pageSize:10})
        getCommisionList({pageNo:1,pageSize:10}).then(res=>{
          // console.log(res);
          this.commisionTable = res.data.row
        })
        // var data = res.data
        // data.forEach((item)=>{
        //   var checkdate = []
@@ -833,9 +838,9 @@
        //   item['checkdate_'] = item['startTime'] + '~' + item['endTime']
        //   item['checkdate'] = checkdate // 检验日期
        // })
        this.commisionTable = res.data
        // this.$router.push({ name: 'CommissionInspection' });
      }
      }, 100);
    },
    // 新增检验
    async addInspection(){
@@ -900,7 +905,25 @@
      },
      //确定跳转
      QUEding(){
        // this.tableRow = a
        this.Standardframe = true
        chooseVer({mcode:this.select_1[0].materialCoding,
          name:this.select_1[0].materialName,
          scifications:this.select_1[0].specificationsModels}).then(res => {
            this.BANben = res.data.row
            console.log(this.BANben);
          })
      },
      handleSelectionChange_0(val){
        this.select_1 = []
        val.forEach(v => {
          let obj = {}
          obj.materialCoding = v.materialCoding
          obj.materialName = v.materialName
          obj.specificationsModels = v.specificationsModels
          this.select_1.push(obj)
        })
      }
    }
  }