小小儁爺
2024-11-27 6f1e210726050dfc1d1ddf97b00a780fc7e8805c
src/views/qualityManager/processCheck.vue
@@ -24,7 +24,6 @@
                v-model="form.checktype"
                style="width: 160px;"
                placeholder="请选择"
                filterable
              >
                <el-option
                  v-for="item in checktypeArr"
@@ -74,10 +73,28 @@
          </div>
        </div>
        <div class="content2" style="width: 60%;margin-left: 30px;">
          <div class="orderMsg">方案名称:{{ form.checkstandname }}</div>
          <!--          <div class="orderMsg">方案名称:{{ form.checkstandname }}</div>-->
          <div class="orderMsg">方案名称: <el-select
            v-model="form.checkstandcode"
            style="width: 160px;"
            placeholder="请选择"
            :disabled="form.checkstandcode===''"
            @change="checkstandcodeChange"
          >
            <el-option
              v-for="item in chekstandArr"
              :key="item.checkstandcode"
              :label="item.checkstandname"
              :value="item.checkstandcode"
            />
          </el-select>
          </div>
          <div class="orderMsg">抽样方式:{{
            form.sampmethod === 'FIXED' ? '固时抽检' : form.sampmethod === 'SCARE' ? '比例抽检' : ''
          }}
          </div>
          <div v-if="form.sampmethod === 'SCARE' " class="orderMsg">抽检比例:{{ chekstandArr.find(i=>i.checkstandcode===form.checkstandcode).sampscare }}%
          </div>
        </div>
        <div class="content2" style="width: 60%;margin-left: 30px;">
@@ -307,7 +324,9 @@
      stepActive: 0, // 当前处于第几件
      checkItemArr: [],
      check_result: ''
      check_result: '',
      chekstandArr: []
    }
  },
@@ -329,7 +348,11 @@
    }
  },
  activated() {   window.addEventListener('resize', this.getHeight)   this.getHeight() }, created() {
  activated() {
    window.addEventListener('resize', this.getHeight)
    this.getHeight()
  },
  created() {
  },
  mounted() {
@@ -368,8 +391,41 @@
        : res.labcont[0].good_qty * res.chekstand[0].sampscare / 100
      this.form.sampscare = this.form.sampscare <= this.form.good_qty ? this.form.sampscare : this.form.good_qty
      this.form.sampscare = Math.ceil(this.form.sampscare)// 向上取整
      this.chekstandArr = res.chekstand
      await this.getMesOrderStepCheckItemList()
    },
    // 质检方案改变
    async   checkstandcodeChange(val) {
      // this.form.check_type = ''
      // this.form.sampmethod = ''// FIXED(固时抽检)  SCARE(比例抽检)
      // this.form.sampscare = ''
      // this.form.qualitystatus = ''
      // this.form.good_qty = '' // 指的报工数量
      // this.form.sampleqty = ''
      // this.form.goodqty = '' // 合格数量
      // this.form.ngqty = '' // 不良数量
      this.stepActive = 0
      // this.checkItemArr = []
      // this.check_result = ''
      const index = this.chekstandArr.findIndex(i => i.checkstandcode === val)
      console.log(index)
      this.form.checkstandcode = this.chekstandArr[index].checkstandcode
      this.form.checkstandname = this.chekstandArr[index].checkstandname
      this.form.sampmethod = this.chekstandArr[index].sampmethod
      this.form.sampscare = this.chekstandArr[index].sampmethod === 'FIXED' ? this.chekstandArr[index].sampscare
        : this.form.good_qty * this.chekstandArr[index].sampscare / 100
      this.form.sampscare = this.form.sampscare <= this.form.good_qty ? this.form.sampscare : this.form.good_qty
      this.form.sampscare = Math.ceil(this.form.sampscare)// 向上取整
      await this.getMesOrderStepCheckItemList()
    },
    async getMesOrderStepCheckItemList() {
      const { data: res } = await MesOrderStepCheckItemList({ checkstandcode: this.form.checkstandcode })
      // this.checkItemArr = res