jiangping
2023-10-24 349bcef9a96391d22522a3409adf5a89e7e70a95
minipro_standard/pages_inspect/pages/InOperation/InOperation.vue
@@ -25,14 +25,11 @@
                        <span>{{item.outActnum}}{{item.unitName}}</span>
                     </div>
                     <div class="page_content_title_bottom">
                        <span class="green" v-if="item.qualityType === 0">合格&nbsp;<span
                              class="black">/</span>&nbsp;</span>
                        <span class="warning" v-else-if="item.qualityType === 1">不良&nbsp;<span
                              class="black">/</span>&nbsp;</span>
                        <span class="error" v-else-if="item.qualityType === 2">报废&nbsp;<span
                              class="black">/</span>&nbsp;</span>
                        <span v-else>-&nbsp;/&nbsp;</span>
                        <span>{{item.procedureName ? item.procedureName : '-'}}&nbsp;/&nbsp;</span>
                        <span class="green" v-if="item.qualityType === 0">合格<text class="c6" decode>{{ split}}</text></span>
                        <span class="warning" v-else-if="item.qualityType === 1">不良<text class="c6" decode>{{ split}}</text></span>
                        <span class="error" v-else-if="item.qualityType === 2">报废<text class="c6" decode>{{ split}}</text></span>
                        <span v-else>-<text class="c6" decode>{{ split}}</text></span>
                        <span>{{item.procedureName ? item.procedureName : '-'}}<text class="c6" decode>{{ split}}</text></span>
                        <span>{{item.batch ? item.batch : '-'}}</span>
                     </div>
                  </div>
@@ -72,10 +69,10 @@
                     </div>
                  </div>
                  <div class="page_yxwl_list_item_sx">
                     <span class="green" v-if="item.qualityType === 0">合格&nbsp;<span>/</span>&nbsp;</span>
                     <span class="warning" v-else-if="item.qualityType === 1">不良&nbsp;<span>/</span>&nbsp;</span>
                     <span class="red" v-else-if="item.qualityType === 2">报废&nbsp;<span>/</span>&nbsp;</span>
                     <span>{{item.procedureName ? item.procedureName : '-'}}&nbsp;<span>/</span>&nbsp;</span>
                     <span class="green" v-if="item.qualityType === 0">合格<text class="c6" decode>{{ split}}</text></span>
                     <span class="warning" v-else-if="item.qualityType === 1">不良<text class="c6" decode>{{ split}}</text></span>
                     <span class="red" v-else-if="item.qualityType === 2">报废<text class="c6" decode>{{ split}}</text></span>
                     <span>{{item.procedureName ? item.procedureName : '-'}}<text class="c6" decode>{{ split}}</text></span>
                     <span>{{item.batch ? item.batch : '-'}}</span>
                  </div>
                  <div class="page_yxwl_list_item_num">
@@ -115,10 +112,10 @@
                     </div>
                  </div>
                  <div class="page_yxwl_list_item_sx">
                     <span class="green" v-if="item1.qualityType === 0">合格&nbsp;<span>/</span>&nbsp;</span>
                     <span class="yellow" v-else-if="item1.qualityType === 1">不良&nbsp;<span>/</span>&nbsp;</span>
                     <span class="red" v-else-if="item1.qualityType === 2">报废&nbsp;<span>/</span>&nbsp;</span>
                     <span>{{item1.procedureName ? item1.procedureName : '-'}}&nbsp;<span>/</span>&nbsp;</span>
                     <span class="green" v-if="item1.qualityType === 0">合格<text class="c6" decode>{{ split}}</text></span>
                     <span class="yellow" v-else-if="item1.qualityType === 1">不良<text class="c6" decode>{{ split}}</text></span>
                     <span class="red" v-else-if="item1.qualityType === 2">报废<text class="c6" decode>{{ split}}</text></span>
                     <span>{{item1.procedureName ? item1.procedureName : '-'}}<text class="c6" decode>{{ split}}</text></span>
                     <span>{{item1.batch ? item1.batch : '-'}}</span>
                  </div>
                  <div class="page_yxwl_list_item_num">
@@ -200,6 +197,7 @@
      },
      data() {
         return {
            split: '&nbsp;/&nbsp;',
            type: '',
            id: '',
            wareHouseId: '',
@@ -301,17 +299,42 @@
         },
         selectMaterial(val) {
            let material = JSON.parse(JSON.stringify(val))
            let tempMaterial = this.seleMateriaList.find(item => item.locationId == this.location)
            if (tempMaterial) {
               if (tempMaterial.qualityType == material.qualityType && tempMaterial.procedureId == material
                  .procedureId &&
                  tempMaterial.batch == material.batch && tempMaterial.materialId == material.materialId) {
                  uni.$u.toast('相同货位,同一个物料只能有一个')
                  return
            let repetition = false
            this.seleMateriaList.forEach(item => {
               if (item.locationId == this.location) {
                  if (item.id == material.id) {
                     repetition = true
                     return
                  }
               }
            })
            if (repetition) {
               uni.$u.toast('相同货位,同一个物料只能有一个')
               return
            }
            // let tempMaterial = this.seleMateriaList.find(item => item.locationId == this.location)
            // debugger
            // if (tempMaterial) {
            //    /*
            //    tempMaterial.qualityType == material.qualityType
            //       && tempMaterial.procedureId == material.procedureId
            //       &&tempMaterial.batch == material.batch
            //       &&tempMaterial.oldLocationId == material.locationId
            //       && tempMaterial.materialId == material.materialId
            //    */
            //    if (tempMaterial.id == material.id) {
            //       uni.$u.toast('相同货位,同一个物料只能有一个')
            //       return
            //    }
            // }
            // if (tempMaterial && tempMaterial.id == material.id) {
            //    uni.$u.toast('相同货位,同一个物料只能有一个')
            //    return
            // }
            let materialNum = 0
            let num = 0
            // let selectedM = this.seleMateriaList.find(item => item.id == material.id)
            // let waitMaterial = this.MateriaList.find(item => item.id === material.id)
            this.seleMateriaList.forEach(item => {
               if (item.id === material.id) {
                  materialNum += Number(item.outActnum)
@@ -322,9 +345,11 @@
                  num = item.outActnum - materialNum
               }
            })
            material.outActnum = num
            this.seleMateriaList.push({
               ...material,
               oldLocationId: material.locationId,
               locationId: this.location,
               locationName: this.locationName
            })