ysy пре 1 година
родитељ
комит
3954225ab7

+ 13 - 0
src/api/produce/job.js

@@ -45,3 +45,16 @@ export async function saveParam(data) {
 
 
   
+
+
+// pda常规质检-批量报工型取样
+  export async function sample(data) {
+    const res = await request.post(`/mes/workorder/sample`, data);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  }
+  
+  
+    

+ 195 - 5
src/views/produce/components/jobBooking/components/oneJobQualityBomPL.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <div class="title_box rx-bc mt6">
-      <div class="name">取样信息({{ list.length || 0 }})个 </div>
+      <div class="name">取样信息 </div>
 
       <div class="rx-bc"> </div>
     </div>
@@ -72,7 +72,7 @@
                         size="mini"
                         v-model="it.sample"
                         type="number"
-                        @input="blurNum(it, $index, yyIdx)"
+                        @input="blurNum2(it, $index, yyIdx)"
                       ></el-input>
                     </div>
                   </div>
@@ -146,14 +146,164 @@
         </template>
       </el-table-column>
     </el-table>
+
+    <div style="display: flex; justify-content: center; margin: 12px auto;"  v-if="!isDetails">
+      <el-button size="mini" style="background-color: #157a2c; color: #fff; width: 180px;"  @click="handSample()">取样</el-button>
+    </div>
+     
+
+    <div class="title_box rx-bc mt6">
+      <div class="name">报工信息 </div>
+
+      <div class="rx-bc"> </div>
+    </div>
+
+
+    <el-table
+      ref="oneJobQualityBomPL"
+      class="table_content"
+      :data="item.sampleQuality"
+      tooltip-effect="dark"
+      style="width: 100%"
+      stripe
+      border
+      :default-expand-all="true"
+    >
+      <el-table-column type="expand" label="取样" width="80">
+        <template slot-scope="{ row, $index }">
+          <div class="material" :key="$index" v-if="row.extInfo.batchReportInfo.length > 0">
+            <div class="btn_end">
+              <div class="content_table2">
+                <div class="head row rx-sc">
+                  <div class="item ww33">合格品数量</div>
+                  <div class="item ww33"
+                    >报工总重量 /{{ row.extInfo.weightUnit }}
+                  </div>
+                  <div class="item ww33">处置</div>
+                
+                </div>
+
+                <div class="table">
+                  <div
+                    class="tr row rx-sc"
+                    v-for="(it, yyIdx) in row.extInfo.batchReportInfo"
+                    :key="$index + yyIdx"
+                  >
+                    <div class="item ww33">
+                      <div v-if="isDetails">{{ it.allFeedQuantity }}</div>
+                      <el-input
+                        v-else
+                        class="content_num"
+                        size="mini"
+                        v-model="it.allFeedQuantity"
+                        @input="blurNum(it, $index, yyIdx)"
+                        type="number"
+                      ></el-input>
+                    </div>
+
+                    <div class="item ww33">
+                      <div v-if="isDetails">{{ it.allReportWeight }}</div>
+                      <el-input
+                        v-else
+                        class="content_num"
+                        size="mini"
+                        v-model="it.allReportWeight"
+                        type="number"
+                      ></el-input>
+                    </div>
+
+                    <div class="item ww33 rx-cc">
+                      <el-select
+                        size="mini"
+                        class="content_num"
+                        filterable
+                        v-model="it.taskId"
+                        placeholder="请选择"
+                        @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>
+                </div>
+              </div>
+            </div>
+          </div>
+        </template>
+      </el-table-column>
+
+      <el-table-column label="序号" width="85">
+        <template slot-scope="{ row, $index }">
+          {{ $index + 1 }}
+          <div class="tag_box" v-if="row.isCache">缓</div>
+        </template>
+      </el-table-column>
+
+      <el-table-column label="编码" prop="code" minWidth="110">
+        <template slot-scope="{ row, $index }">
+          {{ row.code }}
+        </template>
+      </el-table-column>
+
+      <el-table-column label="名称" prop="name" minWidth="140">
+        <template slot-scope="{ row, $index }">
+          {{ row.name }}
+        </template>
+      </el-table-column>
+
+      <el-table-column label="型号" type="modelType">
+        <template slot-scope="{ row, $index }">
+          {{ row.modelType }}
+        </template>
+      </el-table-column>
+
+      <el-table-column label="规格" prop="specification">
+        <template slot-scope="{ row, $index }">
+          {{ row.specification }}
+        </template>
+      </el-table-column>
+
+      <el-table-column label="牌号" prop="brandNum">
+        <template slot-scope="{ row, $index }">
+          {{ row.brandNum }}
+        </template>
+      </el-table-column>
+
+      <el-table-column width="140" label="设备" prop="deviceId">
+        <template slot-scope="{ row, $index }">
+          {{ row.deviceName || row.extInfo.deviceName }}
+        </template>
+      </el-table-column>
+
+      <el-table-column label="炉次号" width="90" prop="heatNumber">
+        <template slot-scope="{ row, $index }">
+          {{ row.extInfo.heatNumber }}
+        </template>
+      </el-table-column>
+
+
+
+    </el-table>
+    
+
+
+
   </div>
 </template>
 
 <script>
-  import { getTaskInstanceList } from '@/api/produce/job';
+  import { getTaskInstanceList, sample } from '@/api/produce/job';
 
   export default {
-    name: 'semiProductJobBom',
+    name: 'oneJobQualityBomPL',
 
     props: {
       list: {
@@ -180,6 +330,12 @@
       };
     },
 
+    computed: {
+      taskObj() {
+        return this.$store.state.user.taskObj;
+      }
+    },
+
     methods: {
       getTaskFn() {
         getTaskInstanceList(this.item.workOrderId).then((res) => {
@@ -191,7 +347,7 @@
         this.list.splice(idx, 1);
       },
 
-      blurNum(it, idx, yyIdx) {
+      blurNum2(it, idx, yyIdx) {
         let value = it.sample;
         value = value.replace(/\./g, '');
 
@@ -202,7 +358,36 @@
           this.$set(this.list[idx].extInfo.batchReportInfo[yyIdx], 'sample', 0);
           this.$forceUpdate();
         }
+      },
+
+
+      handSample() {
+
+				let param = {
+					taskId:this.taskObj.id,
+					workOrderId: this.list[0].workOrderId,
+					dispose: this.list,
+
+				}
+
+        sample(param).then(res => {
+          this.item.sampleQuality = res || []
+					this.$forceUpdate()
+        })
+      },
+
+
+      
+      selectName(value, idx, yyIdx) {
+        const taskObj = this.stepsList.find((item) => item.taskId === value);
+        this.$set(
+          this.item.sampleQuality[idx].extInfo.batchReportInfo[yyIdx],
+          'taskName',
+          taskObj.taskTypeName
+        );
+        this.$forceUpdate();
       }
+
     },
 
     created() {
@@ -267,6 +452,11 @@
         width: 30%;
       }
 
+      .ww33 {
+        width: 33.333%;
+      }
+
+
       .ww25 {
         width: 25%;
       }