ysy hace 1 año
padre
commit
033fe274d8

+ 110 - 4
src/views/produce/components/jobBooking/components/semiProductJobBom.vue

@@ -77,7 +77,7 @@
             size="mini"
             class="content_num"
             v-model="row.extInfo.materielCode"
-            placeholder="数量"
+            placeholder="物料代号"
           />
         </template>
       </el-table-column>
@@ -205,6 +205,65 @@
         </template>
       </el-table-column>
 
+      <el-table-column
+        v-if="singleReport == 1"
+        label="是否合格"
+        width="110"
+        prop="isQualified"
+      >
+        <template slot-scope="{ row, $index }">
+          <el-select
+          
+            size="mini"
+            class="content_num"
+            v-model="row.extInfo.isQualified"
+            filterable
+            placeholder="请选择"
+            :disabled="isDetails"
+          >
+            <el-option
+              v-for="item in isQualifiedList"
+              :label="item.name"
+              :value="item.code"
+              :key="item.code"
+            >
+            </el-option>
+          </el-select>
+     
+        </template>
+      </el-table-column>
+
+
+      <el-table-column
+        v-if="singleReport == 1"
+        label="类型"
+        width="110"
+        prop="notType"
+      >
+        <template slot-scope="{ row, $index }">
+          <el-select
+          v-if="row.extInfo.isQualified && row.extInfo.isQualified == 1"
+            size="mini"
+            class="content_num"
+            v-model="row.extInfo.notType"
+            filterable
+            placeholder="请选择"
+            :disabled="isDetails"
+
+          >
+            <el-option
+              v-for="item in notTypeList"
+              :label="item.name"
+              :value="item.code"
+              :key="item.code"
+            >
+            </el-option>
+          </el-select>
+     
+        </template>
+      </el-table-column>
+
+
       <el-table-column
         label="质检结果"
         width="80"
@@ -212,14 +271,26 @@
         v-if="item.currentTaskDiagram.isFirstTask == 1"
       >
         <template slot-scope="{ row, $index }">
-          <div @click="openNumerate(row, $index)">
+          <div @click="openNumerate(row, $index)" v-if="![1,2,3,4].includes(Number(row.extInfo.notType))">
             <div class="numerate">点击计算</div>
           </div>
         </template>
       </el-table-column>
 
       <el-table-column label="处置" width="130" prop="taskName">
-        <template slot-scope="{ row, $index }">
+        <template slot-scope="{ row, $index }" >
+          <div  v-if="row.extInfo.isQualified != 2  && row.extInfo.notType != 5 ">
+            <span v-if="isDetails">{{ row.extInfo.notReason }}</span>
+          <el-input
+            v-else
+            size="mini"
+            class="content_num"
+            v-model="row.extInfo.notReason"
+            placeholder="原因"
+          
+          />
+          </div>
+        <div v-if="![1,2,3,4].includes(Number(row.extInfo.notType))">
           <span v-if="isDetails">{{ row.extInfo.taskName }}</span>
           <el-select
             v-else
@@ -238,6 +309,7 @@
             >
             </el-option>
           </el-select>
+          </div>
         </template>
       </el-table-column>
 
@@ -458,7 +530,41 @@ import { row } from 'mathjs';
         resultObj: {},
         resultIdx: 0,
 
-        show: false
+        show: false,
+
+
+        
+				isQualifiedList: [{
+						code: '1',
+						name: '不合格'
+					},
+					{
+						code: '2',
+						name: '合格'
+					}
+				],
+
+				notTypeList: [{
+						code: "1",
+						name: '返工'
+					},
+					{
+						code: "2",
+						name: '返修'
+					},
+					{
+						code: "3",
+						name: '报废'
+					},
+					{
+						code: '4',
+						name: '降级使用'
+					},
+					{
+						code: "5",
+						name: '让步接收'
+					}
+				]
       };
     },
 

+ 198 - 4
src/views/produce/components/jobBooking/components/semiProductJobBomPL.vue

@@ -99,6 +99,110 @@
               </div>
             </div>
           </div>
+
+
+          <div class="material" :key="'not' + $index">
+            <div class="btn_end">
+              <el-button
+                v-if="!isDetails"
+                type="primary"
+                size="mini"
+                @click="handAddListPL4($index)"
+                style="margin-bottom: 4px"
+                >分批</el-button
+              >
+
+              <div class="content_table2">
+                <div class="head row rx-sc">
+                  <div class="item ww30">不合格品数量</div>
+                  <div class="item ww30"
+                    >类型
+                  </div>
+                  <div class="item ww30">处置/原因</div>
+                  <div class="item ww10">操作</div>
+                </div>
+
+                <div class="table">
+                  <div
+                    class="tr row rx-sc"
+                    v-for="(it, yyIdx) in row.extInfo.notBatchReportInfo"
+                    :key="'not'+ $index + yyIdx"
+                  >
+                    <div class="item ww30">
+                      <div v-if="isDetails">{{ it.allFeedQuantity }}</div>
+                      <el-input
+                        v-else
+                        class="content_num"
+                        size="mini"
+                        v-model="it.allFeedQuantity"
+                        @input="blurNum2(it, $index, yyIdx)"
+                        type="number"
+                      ></el-input>
+                    </div>
+
+                    <div class="item ww30">
+                      <el-select
+                        size="mini"
+                        class="content_num"
+                        filterable
+                        v-model="it.notType"
+                        placeholder="请选择"
+                        @change="handLoad()"
+                        :disabled="isDetails"
+                      >
+                        <el-option
+                          v-for="item in notTypeList"
+                          :label="item.name"
+                          :value="item.code"
+                          :key="item.code"
+                        >
+                        </el-option>
+                      </el-select>
+                    </div>
+
+
+                    <div class="item ww30" v-if="it.notType != 5">
+                      <div v-if="isDetails">{{ it.notReason }}</div>
+                      <el-input
+                        v-else
+                        class="content_num"
+                        size="mini"
+                        v-model="it.notReason"
+                      ></el-input>
+                    </div>
+
+                    <div class="item ww30" v-if="it.notType == 5">
+                      <el-select
+                        size="mini"
+                        class="content_num"
+                        filterable
+                        v-model="it.taskId"
+                        placeholder="请选择"
+                        :disabled="isDetails"
+                        @change="(e) => selectName(e, $index, yyIdx)"
+                      >
+                        <el-option
+                          v-for="item in stepsList"
+                          :label="item.taskTypeName"
+                          :value="item.taskId"
+                          :key="item.taskId"
+                        >
+                        </el-option>
+                      </el-select>
+                    </div>
+
+                    <div
+                      class="item ww10 rx-cc"
+                      @click="handDel4($index, yyIdx)"
+                    >
+                      <el-link type="danger">删除</el-link>
+                    </div>
+                  </div>
+                </div>
+              </div>
+            </div>
+          </div>
+
         </template>
       </el-table-column>
 
@@ -277,7 +381,32 @@
     data() {
       return {
         deviceList: [],
-        stepsList: []
+        stepsList: [],
+
+
+        notTypeList: [{
+						code: "1",
+						name: '返工'
+					},
+					{
+						code: "2",
+						name: '返修'
+					},
+					{
+						code: "3",
+						name: '报废'
+					},
+					{
+						code: '4',
+						name: '降级使用'
+					},
+					{
+						code: "5",
+						name: '让步接收'
+					}
+				]
+
+
       };
     },
 
@@ -333,7 +462,14 @@
           count = count + Number(m.allFeedQuantity || 0);
         });
 
-        if (count > this.list[idx].feedQuantity) {
+        let count2 = 0
+				this.list[idx].extInfo.notBatchReportInfo.forEach(m => {
+					count2 = count2 + Number(m.allFeedQuantity || 0)
+				})
+				
+
+
+        if (Number(count + count2)  > this.list[idx].feedQuantity) {
           this.$set(
             this.list[idx].extInfo.batchReportInfo[yyIdx],
             'allFeedQuantity',
@@ -341,7 +477,40 @@
           );
           this.$forceUpdate();
 
-          this.$message.info('投料合格品数不能大于投料数量');
+          this.$message.info('投料数不能大于投料数量');
+        }
+      },
+
+      blurNum2(it, idx, yyIdx) {
+        let value = it.allFeedQuantity;
+        value = value.replace(/\./g, '');
+        this.$set(
+          this.list[idx].extInfo.notBatchReportInfo[yyIdx],
+          'allFeedQuantity',
+          value
+        );
+
+        let count = 0;
+        this.list[idx].extInfo.batchReportInfo.forEach((m) => {
+          count = count + Number(m.allFeedQuantity || 0);
+        });
+
+        let count2 = 0
+				this.list[idx].extInfo.notBatchReportInfo.forEach(m => {
+					count2 = count2 + Number(m.allFeedQuantity || 0)
+				})
+				
+
+
+        if (Number(count + count2)  > this.list[idx].feedQuantity) {
+          this.$set(
+            this.list[idx].extInfo.notBatchReportInfo[yyIdx],
+            'allFeedQuantity',
+            0
+          );
+          this.$forceUpdate();
+
+          this.$message.info('投料数不能大于投料数量');
         }
       },
 
@@ -357,7 +526,32 @@
           taskObj.taskTypeName
         );
         this.$forceUpdate();
-      }
+      },
+
+      
+      handAddListPL4(idx) {
+        this.list[idx].extInfo.notBatchReportInfo.push({
+          allFeedQuantity: '',
+					notType: '',
+					taskId: '',
+					taskName: '',
+					notReason: ''
+        });
+        this.$forceUpdate();
+       
+      },
+
+      handDel4(idx, yyIdx) {
+        this.list[idx].extInfo.notBatchReportInfo.splice(yyIdx, 1);
+      },
+
+
+
+      handLoad() {
+				this.$forceUpdate()
+			},
+
+
     },
 
     created() {

+ 24 - 17
src/views/produce/components/jobBooking/index.vue

@@ -114,7 +114,6 @@
         ></semiProductJobBomPL>
 
         <oneJobQualityBom
-          
           v-if="
             item.semiProductList &&
             item.semiProductList.length != 0 &&
@@ -123,13 +122,9 @@
           "
           :item="item"
           :list="item.semiProductList"
-       
         >
         </oneJobQualityBom>
 
-
-          
-
         <oneJobQualityBomPL
           v-if="
             item.semiProductList &&
@@ -142,8 +137,6 @@
         >
         </oneJobQualityBomPL>
 
-
-
         <byProductBom
           v-if="item.productRecycleList.length != 0"
           :list="item.productRecycleList"
@@ -336,13 +329,15 @@
                 });
               }
 
-
-                  
               if (this.taskObj.type == 6 && this.clientEnvironmentId == 3) {
                 obj.semiProductList = obj.pickOutInList;
               }
 
-              if (this.clientEnvironmentId == 3 && obj.singleReport == 0 && this.taskObj.type != 6 )  {
+              if (
+                this.clientEnvironmentId == 3 &&
+                obj.singleReport == 0 &&
+                this.taskObj.type != 6
+              ) {
                 obj.semiProductList.map((a) => {
                   a.extInfo.batchReportInfo = [
                     {
@@ -352,6 +347,17 @@
                       taskName: ''
                     }
                   ];
+
+                  a.extInfo.notBatchReportInfo = [
+                    {
+                      allFeedQuantity: '',
+                      notType: '',
+                      taskId: '',
+                      taskName: '',
+                      notReason: ''
+                    }
+                  ];
+
                   return {
                     a
                   };
@@ -432,7 +438,6 @@
                 turnover = turnover.concat(f);
               }
             });
-   
 
             this.$set(m, 'equipmentList', equipmentList);
             this.$set(m, 'turnover', turnover);
@@ -529,16 +534,18 @@
           }
         }
 
-        if(this.clientEnvironmentId == 3 && type == 2 && this.taskObj.type == 6)  {
+        if (
+          this.clientEnvironmentId == 3 &&
+          type == 2 &&
+          this.taskObj.type == 6
+        ) {
           this.List.forEach((L) => {
-            if(L.singleReport ==  0) {
-              L.semiProductList = []
+            if (L.singleReport == 0) {
+              L.semiProductList = [];
             }
-          })
+          });
         }
 
-
-
         jobSave(this.List)
           .then((res) => {
             this.loading.close();