ysy 1 an în urmă
părinte
comite
fda1cdaec3

+ 171 - 160
src/views/produce/components/jobBooking/components/semiProductJobBom.vue

@@ -6,16 +6,8 @@
       <div class="rx-bc"> </div>
     </div>
 
-    <el-table
-      ref="oneJobQualityBom"
-      class="table_content"
-      :max-height="600"
-      :data="list"
-      tooltip-effect="dark"
-      style="width: 100%"
-      stripe
-      border
-    >
+    <el-table ref="oneJobQualityBom" class="table_content" :max-height="600" :data="list" tooltip-effect="dark"
+      style="width: 100%" stripe border>
       <el-table-column label="序号" type="index" width="55">
         <template slot-scope="{ row, $index }">
           {{ $index + 1 }}
@@ -24,20 +16,17 @@
 
       <el-table-column label="次数" type="index" width="80">
         <template slot-scope="{ row, $index }">
-          <div
-            class="tag_box"
-            v-if="
-              Object.prototype.hasOwnProperty.call(row, 'extInfo') &&
-              Object.prototype.hasOwnProperty.call(
-                row.extInfo,
-                'productionTimes'
-              ) &&
-              Object.prototype.hasOwnProperty.call(
-                row.extInfo.productionTimes,
-                item.currentTaskDiagram.taskId
-              )
-            "
-          >
+          <div class="tag_box" v-if="
+            Object.prototype.hasOwnProperty.call(row, 'extInfo') &&
+            Object.prototype.hasOwnProperty.call(
+              row.extInfo,
+              'productionTimes'
+            ) &&
+            Object.prototype.hasOwnProperty.call(
+              row.extInfo.productionTimes,
+              item.currentTaskDiagram.taskId
+            )
+          ">
             {{ row.extInfo.productionTimes[item.currentTaskDiagram.taskId] }}
           </div>
 
@@ -59,12 +48,12 @@
             row.rootCategoryLevelId == 2
               ? '在制品'
               : row.rootCategoryLevelId == 23
-              ? '半成品'
-              : row.rootCategoryLevelId == 9
-              ? '产品'
-              : row.rootCategoryLevelId == 28
-              ? '废品'
-              : ''
+                ? '半成品'
+                : row.rootCategoryLevelId == 9
+                  ? '产品'
+                  : row.rootCategoryLevelId == 28
+                    ? '废品'
+                    : ''
           }})
         </template>
       </el-table-column>
@@ -93,108 +82,101 @@
         </template>
       </el-table-column>
 
-      <el-table-column
-        v-if="singleReport == 1"
-        :label="
-          item.currentTaskDiagram.isFirstTask == 1 ? '物料重量' : '上道重量'
-        "
-        type="weightUnit"
-      >
+      <el-table-column v-if="singleReport == 1" :label="item.currentTaskDiagram.isFirstTask == 1 ? '物料重量' : '上道重量'
+        " type="weightUnit">
         <template slot-scope="{ row, $index }">
           <div v-if="item.currentTaskDiagram.isFirstTask == 1">
-            {{ row.extInfo.weight || 0 }} {{ row.extInfo.weightUnit }}</div
-          >
+            {{ row.extInfo.weight || 0 }} {{ row.extInfo.weightUnit }}</div>
           <div v-if="item.currentTaskDiagram.isFirstTask == 0">
             {{ row.extInfo.newWeight || 0 }}
-            {{ row.extInfo.weightUnit }}</div
-          >
+            {{ row.extInfo.weightUnit }}</div>
         </template>
       </el-table-column>
 
       <el-table-column v-if="singleReport == 1" label="刻码" type="engrave">
         <template slot-scope="{ row, $index }">
-          {{ row.extInfo.engrave }}
+          <span v-if='isDetails'>{{ row.extInfo.engrave }}</span>
+          <el-input v-else size="mini" class="content_num" v-model="row.extInfo.engrave" placeholder="刻码" />
         </template>
       </el-table-column>
 
-      <el-table-column
-        v-if="singleReport == 1"
-        label="物料代号"
-        type="materielCode"
-      >
+      <el-table-column v-if="singleReport == 1" label="物料代号" type="materielCode">
         <template slot-scope="{ row, $index }">
-          {{ row.extInfo.materielCode }}
+          <span v-if='isDetails'>{{ row.extInfo.materielCode }}</span>
+          <el-input v-else size="mini" class="content_num" v-model="row.extInfo.materielCode" placeholder="数量" />
+
         </template>
       </el-table-column>
 
-      <el-table-column
-        v-if="singleReport == 1 && deviceList.length > 0"
-        width="140"
-        label="设备"
-        type="deviceId"
-      >
+      <el-table-column v-if="singleReport == 1 && deviceList.length > 0" width="140" label="设备" type="deviceId">
         <template slot-scope="{ row, $index }">
-          <el-select
-            class="content_num"
-            v-model="row.deviceId"
-            placeholder="请选择"
-            @change="(e) => selectVal(e, row, $index)"
-            size="mini"
-          >
-            <el-option
-              v-for="item in deviceList"
-              :label="item.name + '-' + item.codeNumber"
-              :value="item.id"
-              :key="item.id"
-            >
+          <el-select class="content_num" v-model="row.deviceId" placeholder="请选择"
+            @change="(e) => selectVal(e, row, $index)" size="mini">
+            <el-option v-for="item in deviceList" :label="item.name + '-' + item.codeNumber" :value="item.id"
+              :key="item.id">
             </el-option>
           </el-select>
         </template>
       </el-table-column>
 
-      <el-table-column
-        v-if="singleReport == 1 && deviceList.length > 0"
-        label="炉次号"
-        width="90"
-        type="heatNumber"
-      >
+      <el-table-column v-if="singleReport == 1 && deviceList.length > 0" label="炉次号" width="90" type="heatNumber">
+        <template slot-scope="{ row, $index }">
+          <el-input size="mini" class="content_num" v-model="row.extInfo.heatNumber" placeholder="请输入炉次号" />
+        </template>
+      </el-table-column>
+
+      <el-table-column v-if="singleReport == 1" label="数量" width="90" type="feedQuantity">
+        <template slot-scope="{ row, $index }">
+          <el-input size="mini" class="content_num" v-model="row.feedQuantity" placeholder="数量" />
+        </template>
+      </el-table-column>
+
+      <el-table-column v-if="singleReport == 1" label="位置" width="110" type="position">
+        <template slot-scope="{ row, $index }">
+          <span v-if='isDetails'>{{ row.extInfo.position }}</span>
+          <el-input v-else size="mini" class="content_num" v-model="row.extInfo.position" placeholder="位置" />
+        </template>
+      </el-table-column>
+
+
+      <el-table-column v-if="singleReport == 1" label="物料重量" width="110" type="weight">
         <template slot-scope="{ row, $index }">
-          <el-input
-            size="mini"
-            class="content_num"
-            v-model="row.extInfo.heatNumber"
-            placeholder="请输入炉次号"
-          />
+          <div class="tag_box">{{ row.extInfo.newWeight ? '上' : '原' }}</div>
+          <span>{{ row.extInfo.newWeight ? row.extInfo.newWeight : row.extInfo.weight }}</span>
         </template>
       </el-table-column>
 
-      <el-table-column
-        v-if="singleReport == 1"
-        label="数量"
-        width="90"
-        type="feedQuantity"
-      >
+
+      <el-table-column v-if="singleReport == 1" label="报工重量" width="110" type="feedQuantity">
         <template slot-scope="{ row, $index }">
-          <el-input
-            size="mini"
-            class="content_num"
-            v-model="row.feedQuantity"
-            placeholder="数量"
-          />
+          <span v-if='isDetails'>{{ row.extInfo.reportWeight }}</span>
+          <el-input v-else size="mini" class="content_num" v-model="row.extInfo.reportWeight" placeholder="报工重量"
+            type='digit' />
+
         </template>
       </el-table-column>
 
-      <el-table-column
-        v-if="singleReport == 1"
-        label="位置"
-        width="110"
-        type="feedQuantity"
-      >
+
+      <!-- v-if="item.currentTaskDiagram.isFirstTask == 1 " -->
+      <el-table-column label="质检结果" width="110" type="">
         <template slot-scope="{ row, $index }">
-          {{ row.extInfo.position }}
+          <div  @click="openNumerate(row, $index)">
+							<div class="numerate">点击计算</div>
+						</div>
+
         </template>
       </el-table-column>
 
+      <el-table-column label="处置" width="110" type="taskName">
+        <template slot-scope="{ row, $index }">
+          <span v-if='isDetails'>{{ row.extInfo.taskName }}</span>
+        
+
+        </template>
+      </el-table-column>
+
+
+
       <el-table-column label="操作" fixed="right" width="60px">
         <template slot-scope="{ $index, row }">
           <el-link type="danger" @click="getDelete($index)">删除</el-link>
@@ -205,79 +187,108 @@
 </template>
 
 <script>
-  export default {
-    name: 'semiProductJobBom',
+  import { getTaskInstanceList } from '@/api/produce/job';
 
-    props: {
-      list: {
-        type: Array,
-        default: () => []
-      },
-      equipmentList: {
-        type: Array,
-        default: () => []
-      },
+export default {
+  name: 'semiProductJobBom',
 
-      item: {
-        type: Object,
-        default: () => {}
-      },
-      isDetails: {
-        type: Boolean,
-        default: false
-      },
-      singleReport: {
-        default: null
-      }
+  props: {
+    list: {
+      type: Array,
+      default: () => []
     },
-
-    watch: {
-      equipmentList: {
-        immediate: true,
-        deep: true,
-        handler(newVal) {
-          this.deviceList = newVal;
-          this.changeHeatNumber();
-        }
-      }
+    equipmentList: {
+      type: Array,
+      default: () => []
     },
 
-    data() {
-      return {
-        deviceList: []
-      };
+    item: {
+      type: Object,
+      default: () => { }
+    },
+    isDetails: {
+      type: Boolean,
+      default: false
     },
+    singleReport: {
+      default: null
+    }
+  },
 
-    methods: {
-      changeHeatNumber() {
-        this.deviceList.forEach((f) => {
-          this.list.forEach((o) => {
-            if (
-              o.deviceId &&
-              f.instanceId == o.deviceId &&
-              this.deviceList.length > 1
-            ) {
-              o.extInfo.heatNumber = f.extInfo.heatNumber;
-              this.$forceUpdate();
-            } else if (this.deviceList.length == 1) {
-              o.extInfo.heatNumber = this.deviceList[0].extInfo.heatNumber;
-              this.$forceUpdate();
-            }
-          });
-        });
+  watch: {
+    equipmentList: {
+      immediate: true,
+      deep: true,
+      handler(newVal) {
+        this.deviceList = newVal;
+        this.changeHeatNumber();
       }
     }
+  },
+
+  data() {
+    return {
+      deviceList: [],
+
+      stepsList: []
+    };
+  },
+
+  methods: {
+
+    getTaskFn() {
+      console.log(this.item, 'this.item')
+        getTaskInstanceList(this.item.id).then((res) => {
+          this.stepsList = res;
+
+
+        });
+      },
+
+    changeHeatNumber() {
+      this.deviceList.forEach((f) => {
+        this.list.forEach((o) => {
+          if (
+            o.deviceId &&
+            f.instanceId == o.deviceId &&
+            this.deviceList.length > 1
+          ) {
+            o.extInfo.heatNumber = f.extInfo.heatNumber;
+            this.$forceUpdate();
+          } else if (this.deviceList.length == 1) {
+            o.extInfo.heatNumber = this.deviceList[0].extInfo.heatNumber;
+            this.$forceUpdate();
+          }
+        });
+      });
+    }
+  },
+
+  created() {
+    this.getTaskFn()
+  }
+  
   };
 </script>
 
 <style lang="scss" scoped>
-  .tag_box {
-    display: inline-block;
-    padding: 1px 6px;
-    margin-right: 6px;
-    background: #e6a23c;
-    font-size: 11px;
-    color: #fff;
-    border-radius: 2px;
-  }
+.tag_box {
+  display: inline-block;
+  padding: 1px 6px;
+  margin-right: 6px;
+  background: #e6a23c;
+  font-size: 11px;
+  color: #fff;
+  border-radius: 2px;
+}
+
+.content_num {
+  --input-background-color: #f0f8f2;
+}
+
+.numerate {
+				font-size: 22rpx;
+				color: #157A2C;
+        cursor: pointer;
+			}
 </style>

+ 51 - 42
src/views/produce/components/routings.vue

@@ -1,62 +1,71 @@
 <template>
-    <div>
-        <el-dialog title="工艺路线" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false"
-            :close-on-press-escape="false" append-to-body width="70%">
+  <div>
+    <el-dialog
+      title="工艺路线"
+      :visible.sync="visible"
+      :before-close="handleClose"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      append-to-body
+      width="70%"
+    >
+      <el-tag type="warning" style="margin-bottom: 40px">{{
+        routeObj.produceRoutingName
+      }}</el-tag>
 
-            <el-tag type="warning" style="margin-bottom:  40px;">{{ routeObj.produceRoutingName }}</el-tag>
-          
-            <div>
-                <el-steps :active="activeIndex" space="20px" align-center>
-                    <el-step v-for="(item, index) in routeList" :key="index" :title="item.taskTypeName"></el-step>
-                </el-steps>
-            </div>
-        </el-dialog>
-    </div>
+      <div>
+        <el-steps :active="activeIndex" space="20px" align-center>
+          <el-step
+            v-for="(item, index) in routeList"
+            :key="index"
+            :title="item.taskTypeName"
+          ></el-step>
+        </el-steps>
+      </div>
+    </el-dialog>
+  </div>
 </template>
 <script>
-import { getTaskInstanceList } from '@/api/produce/job';
-export default {
+  import { getTaskInstanceList } from '@/api/produce/job';
+  export default {
     props: {
-        routeObj: {
-            type: Object,
-            default() {
-                return {};
-            }
+      routeObj: {
+        type: Object,
+        default() {
+          return {};
         }
+      }
     },
     data() {
-        return {
-            visible: true,
-            routeList: [],
-            activeIndex: 0
-        };
+      return {
+        visible: true,
+        routeList: [],
+        activeIndex: 0
+      };
     },
 
     methods: {
-        getTaskFn() {
+      getTaskFn() {
+        getTaskInstanceList(this.routeObj.id).then((res) => {
+          this.routeList = res;
 
-            getTaskInstanceList(this.routeObj.id).then((res) => {
-                this.routeList = res;
+          // 使用findIndex方法查找
+          const index = this.routeList.findIndex(
+            (item) => Number(item.taskId) == Number(this.routeObj.taskId)
+          );
+          this.activeIndex = index;
+        });
+      },
 
-
-                            // 使用findIndex方法查找
-            const index = this.routeList.findIndex(item => Number(item.taskId) == Number(this.routeObj.taskId));
-            this.activeIndex = index
-            });
-
-
-
-        },
-
-        handleClose() {
-            this.$emit('closeRoute');
-        }
+      handleClose() {
+        this.$emit('closeRoute');
+      }
     },
 
     created() {
-        this.getTaskFn();
+      this.getTaskFn();
     }
-};
+  };
 </script>
 
 <style lang="scss" scoped></style>