Selaa lähdekoodia

报工 投料 改成动态表头

yusheng 1 vuosi sitten
vanhempi
commit
0ac10ba93d

+ 218 - 203
src/views/produce/components/feeding/components/instanceBom.vue

@@ -1,211 +1,95 @@
 <template>
   <div>
     <div class="title_box rx-bc mt6">
-      <div class="name"
-        >物料清单 ({{ list.length || 0 }})个
-      </div>
+      <div class="name">物料清单 ({{ list.length || 0 }})个 </div>
 
       <div class="rx-bc"> </div>
     </div>
-
-    <el-table
-      :ref="`tableRef`"
-      class="table_content"
-      :max-height="600"
-      :data="list"
-      tooltip-effect="dark"
-      style="width: 100%"
-      stripe
-      border
+    <ele-pro-table
+      ref="table"
+      :needPage="false"
+      :columns="columns"
+      :datasource="list"
+      class="time-form"
+      max-height="600"
+      @columns-change="handleColumnChange"
+      :cache-key="cacheKeyUrl"
     >
-      <el-table-column label="序号" type="index" width="55">
-        <template slot-scope="{ row, $index }">
-          {{ $index + 1 }}
-        </template>
-      </el-table-column>
-
-      <el-table-column label="编码" type="code" minWidth="110">
-        <template slot-scope="{ row, $index }">
-          {{ row.code }}
-        </template>
-      </el-table-column>
-
-      <el-table-column label="名称" type="name" minWidth="110">
-        <template slot-scope="{ row, $index }">
-          {{ row.name }}
-        </template>
-      </el-table-column>
-
-      <el-table-column label="数量" width="150" type="feedQuantity">
-        <template slot-scope="{ row, $index }">
-          <el-input
-            size="mini"
-            class="content_num"
-            v-model="row.feedQuantity"
-            placeholder="数量"
-          >
+      <template v-slot:feedQuantity="{ row, $index }">
+        <el-input
+          size="mini"
+          class="content_num"
+          v-model="row.feedQuantity"
+          placeholder="数量"
+        >
           <template slot="append">{{ row.unit }}</template>
-          </el-input>
-        </template>
-      </el-table-column>
-
-      <el-table-column
-        v-if="clientEnvironmentId == 3 && workInfo.singleReport ==1"
-        label="位置"
-        width="110"
-        type="feedQuantity"
-      >
-        <template slot-scope="{ row, $index }">
+        </el-input>
+      </template>
+      <template v-slot:position="{ row, $index }">
+        <el-input
+          size="mini"
+          class="content_num"
+          v-model="row.extInfo.position"
+          placeholder="位置"
+        />
+      </template>
+      <template v-slot:weightUnit="{ row, $index }">
+        <div v-if="currentTaskDiagram.isFirstTask == 1" class="flex-div">
           <el-input
+            v-model="row.extInfo.weight"
             size="mini"
-            class="content_num"
-            v-model="row.extInfo.position"
-            placeholder="位置"
-          />
-
-        </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="规格" type="specification">
-        <template slot-scope="{ row, $index }">
-          {{ row.specification }}
-        </template>
-      </el-table-column>
-
-      <el-table-column label="牌号" type="brandNum">
-        <template slot-scope="{ row, $index }">
-          {{ row.brandNum }}
-        </template>
-      </el-table-column>
-
-      <!-- <el-table-column label="包装库存" type="brandNum">
-        <template slot-scope="{ row, $index }">
-          {{ row.packingCountBase }}/ {{ row.minUnit }}
-        </template>
-      </el-table-column> -->
-
-      <el-table-column
-        v-if="clientEnvironmentId == 3 && workInfo.singleReport ==1"
-        :label="currentTaskDiagram.isFirstTask == 1 ? '物料重量' : '上道工序重量'"
-        type="weightUnit"
-        width="120"
-      >
-        <template slot-scope="{ row, $index }">
-          <!-- <div v-if="currentTaskDiagram.isFirstTask == 1">
-            {{ row.extInfo.weight || 0 }} {{ row.extInfo.weightUnit }}</div
-          > -->
-           <div v-if="currentTaskDiagram.isFirstTask == 1" class="flex-div">
-            <el-input v-model="row.extInfo.weight" size="mini" :disabled="isDetails" style="width: 100%">
-                  <template slot="append">
-                    <div> {{ row.extInfo.weightUnit }}</div>
-                  </template>
-            </el-input>
-          </div>
-          <div v-if="currentTaskDiagram.isFirstTask == 0">
-            {{ row.extInfo.newWeight || 0 }}
-            {{ row.extInfo.weightUnit }}</div
+            :disabled="isDetails"
+            style="width: 100%"
           >
-        </template>
-      </el-table-column>
-
-      <el-table-column
-        v-if="clientEnvironmentId == 3 && workInfo.singleReport == 1"
-        label="刻码"
-        type="engrave"
-      >
-        <template slot-scope="{ row, $index }">
-          {{ row.extInfo.engrave }}
-        </template>
-      </el-table-column>
-
-      <el-table-column
-        v-if="clientEnvironmentId == 3 && workInfo.singleReport == 1"
-        label="物料代号"
-        type="materielCode"
-      >
-        <template slot-scope="{ row, $index }">
-          {{ row.extInfo.materielCode }}
-        </template>
-      </el-table-column>
-
-      <el-table-column
-        v-if="deviceList.length > 0"
-        width="140"
-        label="设备"
-        type="deviceId"
-      >
-        <template slot-scope="{ row, $index }">
-          <el-select
-            class="content_num"
-            filterable
-            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="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="clientEnvironmentId == 3 && workInfo.singleReport == 0"
-        label="投料类型"
-        type="materielCode"
-      >
-        <template slot-scope="{ row, $index }">
-          <span style="color: #157a2c">
-            {{ workInfo.singleReport == 0 ? '批量投料' : '' }}</span
+            <template slot="append">
+              <div> {{ row.extInfo.weightUnit }}</div>
+            </template>
+          </el-input>
+        </div>
+        <div v-if="currentTaskDiagram.isFirstTask == 0">
+          {{ row.extInfo.newWeight || 0 }}
+          {{ row.extInfo.weightUnit }}</div
+        >
+      </template>
+      <template v-slot:deviceId="{ row, $index }">
+        <el-select
+          v-if="deviceList?.length > 0"
+          class="content_num"
+          filterable
+          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"
           >
-        </template>
-      </el-table-column>
-
-
-
-      <el-table-column
-        label="操作"
-        fixed="right"
-        width="60px"
-        v-if="!isDetails"
-      >
-        <template slot-scope="{ $index, row }">
-          <el-link type="danger" @click="getDelete($index)">删除</el-link>
-        </template>
-      </el-table-column>
-    </el-table>
+          </el-option>
+        </el-select>
+      </template>
+      <template v-slot:heatNumber="{ row, $index }">
+        <el-input
+          size="mini"
+          class="content_num"
+          v-model="row.extInfo.heatNumber"
+          placeholder="请输入炉次号"
+        />
+      </template>
+
+      <!-- 操作列 -->
+      <template v-slot:action="{ row, $index }" v-if="!isDetails">
+        <el-link type="danger" @click="getDelete($index)">删除</el-link>
+      </template>
+    </ele-pro-table>
   </div>
 </template>
 <script>
+  import tabMixins from '@/mixins/tableColumnsMixin';
   export default {
+    mixins: [tabMixins],
     props: {
       list: {
         type: Array,
@@ -233,6 +117,138 @@
     computed: {
       clientEnvironmentId() {
         return this.$store.state.user.info.clientEnvironmentId;
+      },
+      columns() {
+        return [
+          ...[
+            {
+              width: 55,
+              type: 'index',
+              columnKey: 'index',
+              align: 'center',
+              label: '序号',
+              fixed: 'left'
+            },
+
+            {
+              minWidth: 120,
+              prop: 'code',
+              label: '编码',
+              align: 'center',
+              fixed: 'left',
+              showOverflowTooltip: true
+            },
+            {
+              minWidth: 140,
+              prop: 'name',
+              label: '名称',
+              align: 'center',
+              showOverflowTooltip: true
+            },
+            {
+              width: 150,
+              prop: 'feedQuantity',
+              label: '数量',
+              slot: 'feedQuantity',
+              align: 'center'
+            },
+            {
+              width: 150,
+              prop: 'position',
+              label: '位置',
+              slot: 'position',
+              align: 'center'
+            },
+            {
+              width: 150,
+              prop: 'modelType',
+              label: '型号',
+              slot: 'modelType',
+              align: 'center',
+              showOverflowTooltip: true
+            },
+            {
+              width: 150,
+              prop: 'specification',
+              label: '规格',
+              slot: 'specification',
+              align: 'center',
+              showOverflowTooltip: true
+            },
+            {
+              width: 150,
+              prop: 'brandNum',
+              label: '牌号',
+              slot: 'brandNum',
+              align: 'center',
+              showOverflowTooltip: true
+            },
+
+            {
+              width: 120,
+              prop: 'weightUnit',
+              label:
+                this.currentTaskDiagram.isFirstTask == 1
+                  ? '物料重量'
+                  : '上道工序重量',
+              slot: 'weightUnit',
+              align: 'center',
+              showOverflowTooltip: true
+            },
+            {
+              minWidth: 120,
+              prop: 'extInfo.engrave',
+              label: '刻码',
+              slot: 'engrave',
+              align: 'center'
+            },
+            {
+              minWidth: 160,
+              prop: 'extInfo.materielCode',
+              label: '物料代号',
+              align: 'center',
+              slot: 'materielCode'
+            },
+            {
+              minWidth: 150,
+              prop: 'deviceId',
+              label: '设备',
+              align: 'center',
+              slot: 'deviceId'
+            },
+            {
+              minWidth: 100,
+              prop: 'heatNumber',
+              label: '炉次号',
+              slot: 'heatNumber',
+              align: 'center'
+            },
+            {
+              columnKey: 'action',
+              label: '操作',
+              width: 120,
+              align: 'center',
+              resizable: false,
+              slot: 'action',
+              fixed: 'right',
+              showOverflowTooltip: true
+            }
+          ],
+          this.workInfo.singleReport == 0
+            ? {
+                minWidth: 120,
+                label: '投料类型',
+                align: 'center',
+                formatter: () => {
+                  return '批量投料';
+                },
+                showOverflowTooltip: true
+              }
+            : {
+                show: false,
+                width:1,
+              }
+        ];
       }
     },
 
@@ -249,7 +265,8 @@
 
     data() {
       return {
-        deviceList: []
+        deviceList: [],
+        cacheKeyUrl: 'mes_produce_feeding_instanceBom'
       };
     },
 
@@ -275,11 +292,8 @@
       },
 
       changeHeatNumber() {
- 
-
         this.deviceList.forEach((f) => {
           this.list.forEach((o) => {
-
             if (
               o.deviceId &&
               f.id == o.deviceId &&
@@ -291,14 +305,15 @@
               o['deviceName'] = this.deviceList[0].name;
               o['deviceId'] = this.deviceList[0].id;
               o['workstationName'] = this.deviceList[0].workstationName;
-              this.$set(o.extInfo, 'heatNumber', this.deviceList[0].extInfo.heatNumber);
+              this.$set(
+                o.extInfo,
+                'heatNumber',
+                this.deviceList[0].extInfo.heatNumber
+              );
 
-              
-             this.$forceUpdate();
-           
+              this.$forceUpdate();
             }
           });
-
         });
       }
     }
@@ -313,10 +328,10 @@
   .content_num {
     --input-background-color: #f0f8f2;
   }
-   .flex-div{
+  .flex-div {
     display: flex;
   }
-  ::v-deep .el-input-group__append{
+  ::v-deep .el-input-group__append {
     padding: 0 10px !important;
   }
 </style>

+ 271 - 208
src/views/produce/components/feeding/components/semiProductBom.vue

@@ -5,218 +5,103 @@
 
       <div class="rx-bc"> </div>
     </div>
-
-    <el-table
-      :ref="`semiProductBom`"
-      class="table_content"
-      :max-height="600"
-      :data="list"
-      tooltip-effect="dark"
-      style="width: 100%"
-      stripe
-      border
+    <ele-pro-table
+      ref="table"
+      :needPage="false"
+      :columns="columns"
+      :datasource="list"
+      class="time-form"
+      max-height="600"
+      @columns-change="handleColumnChange"
+      :cache-key="cacheKeyUrl"
     >
-      <el-table-column label="序号" type="index" width="55">
-        <template slot-scope="{ row, $index }">
-          {{ $index + 1 }}
-        </template>
-      </el-table-column>
-
-      <el-table-column label="编码" type="code" minWidth="110">
-        <template slot-scope="{ row, $index }">
-          {{ row.code }}
-        </template>
-      </el-table-column>
-      <el-table-column label="批次号" type="code" minWidth="90">
-        <template slot-scope="{ row, $index }">
-          <el-input v-model="row.batchNo" size="mini" class="content_num" :disabled="isDetails" style="width: 100%"></el-input>
-        </template>
-      </el-table-column>
-      <el-table-column label="序列号" type="productSequence" minWidth="110">
-        <template slot-scope="{ row, $index }">
-          {{ row.extInfo.productSequence }}
-        </template>
-      </el-table-column>
-      <el-table-column label="名称" type="name" minWidth="110">
-        <template slot-scope="{ row, $index }">
-          {{ row.name }} 
-        </template>
-      </el-table-column>
-      <el-table-column label="物品分类" type="rootCategoryLevelId" minWidth="110">
-        <template slot-scope="{ row, $index }">
-            {{
-              row.rootCategoryLevelId == 2
-                ? '在制品'
-                : row.rootCategoryLevelId == 23
-                ? '半成品'
-                : row.rootCategoryLevelId == 9
-                ? '产品'
-                : item.rootCategoryLevelId == 28
-                ? '废品'
-                : ''
-            }}
-        </template>
-      </el-table-column>
-      <el-table-column 
-        v-if="workInfo.singleReport == 1"
-       label="刻码" type="engrave">
-        <template slot-scope="{ row, $index }">
-          {{ row.extInfo.engrave }}
-        </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="规格" type="specification">
-        <template slot-scope="{ row, $index }">
-          {{ row.specification }}
-        </template>
-      </el-table-column>
-
-      <el-table-column label="牌号" type="brandNum">
-        <template slot-scope="{ row, $index }">
-          {{ row.brandNum }}
-        </template>
-      </el-table-column>
-
-      <!-- <el-table-column label="包装库存" type="brandNum">
-        <template slot-scope="{ row, $index }">
-          {{ row.packingCountBase }}/ {{ row.minUnit }}
-        </template>
-      </el-table-column> -->
-
-      <el-table-column
-         v-if="clientEnvironmentId == 3 && workInfo.singleReport == 1"
-        :label="currentTaskDiagram.isFirstTask == 1 ? '物料重量' : '上道工序重量'"
-        type="weightUnit"
-        width="120"
-      >
-        <template slot-scope="{ row, $index }">
-          <!-- <div v-if="currentTaskDiagram.isFirstTask == 1">
-            {{ row.extInfo.weight || 0 }} {{ row.extInfo.weightUnit }}</div
-          > -->
-          <div v-if="currentTaskDiagram.isFirstTask == 1" class="flex-div">
-            <el-input v-model="row.extInfo.weight" size="mini" :disabled="isDetails" style="width: 100%">
-                  <template slot="append">
-                    <div> {{ row.weightUnit }}</div>
-                  </template>
-            </el-input>
-          </div>
-          
-          <div v-if="currentTaskDiagram.isFirstTask == 0">
-            {{ row.extInfo.newWeight || 0 }}
-            {{ row.extInfo.weightUnit }}</div
-          >
-        </template>
-      </el-table-column>
-
-      
-
-      <el-table-column
-       v-if="workInfo.singleReport == 1"
-        label="物料代号"
-        type="materielCode"
-      >
-        <template slot-scope="{ row, $index }">
-          {{ row.extInfo.materielCode }}
-        </template>
-      </el-table-column>
-
-      <el-table-column
-        v-if="deviceList.length > 0"
-        width="140"
-        label="设备"
-        type="deviceId"
-      >
-        <template slot-scope="{ row, $index }">
-          <el-select
-            v-model="row.deviceId"
-            filterable
-            placeholder="请选择"
-            @change="(e) => selectVal(e, row, $index)"
-            size="mini"
-            :disabled="isDetails"
-          >
-            <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>
+      <template v-slot:batchNo="{ row, $index }">
+        <el-input
+          size="mini"
+          class="content_num"
+          v-model="row.batchNo"
+          placeholder="批次号"
+        >
+        </el-input>
+      </template>
 
-      <el-table-column
-        v-if="deviceList.length > 0"
-        label="炉次号"
-        width="90"
-        type="heatNumber"
-      >
-        <template slot-scope="{ row, $index }">
+      <template v-slot:feedQuantity="{ row, $index }">
+        <el-input
+          size="mini"
+          class="content_num"
+          v-model="row.feedQuantity"
+          placeholder="数量"
+          :disabled="isDetails"
+        />
+      </template>
+      <template v-slot:position="{ row, $index }">
+        <el-input
+          size="mini"
+          v-model="row.extInfo.position"
+          placeholder="位置"
+          :disabled="isDetails"
+        />
+      </template>
+      <template v-slot:weightUnit="{ row, $index }">
+        <div v-if="currentTaskDiagram.isFirstTask == 1" class="flex-div">
           <el-input
+            v-model="row.extInfo.weight"
             size="mini"
-            v-model="row.extInfo.heatNumber"
-            placeholder="请输入炉次号"
             :disabled="isDetails"
-          />
-        </template>
-      </el-table-column>
-
-      <el-table-column
-      
-        label="数量"
-        width="90"
-        type="feedQuantity"
-      >
-        <template slot-scope="{ row, $index }">
-          <el-input size="mini"  class="content_num" v-model="row.feedQuantity" placeholder="数量" :disabled="isDetails"/>
-        </template>
-      </el-table-column>
-
-      <el-table-column
-        v-if="clientEnvironmentId == 3 && workInfo.singleReport == 0"
-        label="投料类型"
-        type="materielCode"
-      >
-        <template slot-scope="{ row, $index }">
-          <span style="color: #157a2c">
-            {{ workInfo.singleReport == 0 ? '批量投料' : '' }}</span
+            style="width: 100%"
           >
-        </template>
-      </el-table-column>
+            <template slot="append">
+              <div> {{ row.weightUnit }}</div>
+            </template>
+          </el-input>
+        </div>
 
-      <el-table-column
-        v-if="clientEnvironmentId == 3 && workInfo.singleReport ==1"
-        label="位置"
-        width="110"
-        type="feedQuantity"
-      >
-        <template slot-scope="{ row, $index }">
-          <el-input size="mini" v-model="row.extInfo.position" placeholder="位置" :disabled="isDetails"/>
-        </template>
-      </el-table-column>
+        <div v-if="currentTaskDiagram.isFirstTask == 0">
+          {{ row.extInfo.newWeight || 0 }}
+          {{ row.extInfo.weightUnit }}</div
+        >
+      </template>
+      <template v-slot:deviceId="{ row, $index }">
+        <el-select
+          v-if="deviceList?.length > 0"
+          v-model="row.deviceId"
+          filterable
+          placeholder="请选择"
+          @change="(e) => selectVal(e, row, $index)"
+          size="mini"
+          :disabled="isDetails"
+        >
+          <el-option
+            v-for="item in deviceList"
+            :label="item.name + '-' + item.codeNumber"
+            :value="item.id"
+            :key="item.id"
+          >
+          </el-option>
+        </el-select>
+      </template>
+      <template v-slot:heatNumber="{ row, $index }">
+        <el-input
+          size="mini"
+          v-model="row.extInfo.heatNumber"
+          placeholder="请输入炉次号"
+          :disabled="isDetails"
+        />
+      </template>
 
-      <el-table-column
-        label="操作"
-        fixed="right"
-        width="60px"
-        v-if="!isDetails"
-      >
-        <template slot-scope="{ $index, row }">
-          <el-link type="danger" @click="getDelete($index)">删除</el-link>
-        </template>
-      </el-table-column>
-    </el-table>
+      <!-- 操作列 -->
+      <template v-slot:action="{ row, $index }" v-if="!isDetails">
+        <el-link type="danger" @click="getDelete($index)">删除</el-link>
+      </template>
+    </ele-pro-table>
   </div>
 </template>
 <script>
+  import tabMixins from '@/mixins/tableColumnsMixin';
+
   export default {
+    mixins: [tabMixins],
+
     props: {
       list: {
         type: Array,
@@ -245,6 +130,175 @@
     computed: {
       clientEnvironmentId() {
         return this.$store.state.user.info.clientEnvironmentId;
+      },
+      columns() {
+        // let materielCode = this.workInfo.singleReport == 0 && ;
+
+        return [
+          ...[
+            {
+              width: 55,
+              type: 'index',
+              columnKey: 'index',
+              align: 'center',
+              label: '序号',
+              fixed: 'left'
+            },
+            {
+              minWidth: 120,
+              prop: 'code',
+              label: '编码',
+              align: 'center',
+              fixed: 'left',
+              showOverflowTooltip: true
+            },
+            {
+              width: 100,
+              prop: 'batchNo',
+              label: '批次号',
+              slot: 'batchNo',
+              align: 'center'
+            },
+            {
+              width: 110,
+              prop: 'productSequence',
+              label: '序列号',
+              slot: 'productSequence',
+              align: 'center'
+            },
+            {
+              minWidth: 140,
+              prop: 'name',
+              label: '名称',
+              align: 'center',
+              showOverflowTooltip: true
+            },
+
+            {
+              minWidth: 100,
+              prop: 'rootCategoryLevelId',
+              label: '类型',
+              align: 'center',
+              showOverflowTooltip: true,
+              formatter: (row) => {
+                return row.rootCategoryLevelId == 2
+                  ? '在制品'
+                  : row.rootCategoryLevelId == 23
+                  ? '半成品'
+                  : row.rootCategoryLevelId == 9
+                  ? '产品'
+                  : item.rootCategoryLevelId == 28
+                  ? '废品'
+                  : '';
+              }
+            },
+            {
+              minWidth: 120,
+              prop: 'extInfo.engrave',
+              label: '刻码',
+              slot: 'engrave',
+              align: 'center'
+            },
+            {
+              width: 150,
+              prop: 'modelType',
+              label: '型号',
+              slot: 'modelType',
+              align: 'center',
+              showOverflowTooltip: true
+            },
+            {
+              width: 150,
+              prop: 'specification',
+              label: '规格',
+              slot: 'specification',
+              align: 'center',
+              showOverflowTooltip: true
+            },
+            {
+              width: 150,
+              prop: 'brandNum',
+              label: '牌号',
+              slot: 'brandNum',
+              align: 'center',
+              showOverflowTooltip: true
+            },
+            {
+              width: 120,
+              prop: 'weightUnit',
+              label:
+                this.currentTaskDiagram.isFirstTask == 1
+                  ? '物料重量'
+                  : '上道工序重量',
+              slot: 'weightUnit',
+              align: 'center',
+              showOverflowTooltip: true
+            },
+            {
+              minWidth: 160,
+              prop: 'extInfo.materielCode',
+              label: '物料代号',
+              align: 'center',
+              slot: 'materielCode'
+            },
+            {
+              minWidth: 150,
+              prop: 'deviceId',
+              label: '设备',
+              align: 'center',
+              slot: 'deviceId'
+            },
+
+            {
+              minWidth: 100,
+              prop: 'heatNumber',
+              label: '炉次号',
+              slot: 'heatNumber',
+              align: 'center'
+            },
+
+            {
+              width: 130,
+              prop: 'feedQuantity',
+              label: '数量',
+              slot: 'feedQuantity',
+              align: 'center'
+            },
+
+            {
+              width: 150,
+              prop: 'position',
+              label: '位置',
+              slot: 'position',
+              align: 'center'
+            },
+
+            {
+              columnKey: 'action',
+              label: '操作',
+              width: 120,
+              align: 'center',
+              resizable: false,
+              slot: 'action',
+              fixed: 'right',
+              showOverflowTooltip: true
+            }
+          ],
+          this.workInfo.singleReport == 0
+            ? {
+                minWidth: 120,
+                label: '投料类型',
+                align: 'center',
+                formatter: () => {
+                  return '批量投料';
+                },
+                showOverflowTooltip: true
+              }
+            : {
+                show: false,
+                width:1
+              }
+        ];
       }
     },
 
@@ -261,7 +315,8 @@
 
     data() {
       return {
-        deviceList: []
+        deviceList: [],
+        cacheKeyUrl: 'mes_produce_feeding_semiProductBom'
       };
     },
 
@@ -286,10 +341,10 @@
       },
 
       changeHeatNumber() {
-        console.log(this.deviceList,'aahashasoshaiuhuigwsiu');
+        console.log(this.deviceList, 'aahashasoshaiuhuigwsiu');
 
         this.deviceList.forEach((f) => {
-          this.list.forEach((o,index) => {
+          this.list.forEach((o, index) => {
             if (
               o.deviceId &&
               f.id == o.deviceId &&
@@ -297,14 +352,22 @@
             ) {
               // o.extInfo.heatNumber = f.extInfo.heatNumber;
               o['workstationName'] = f.workstationName;
-              this.$set(this.list[index].extInfo,'heatNumber',f.extInfo.heatNumber)
+              this.$set(
+                this.list[index].extInfo,
+                'heatNumber',
+                f.extInfo.heatNumber
+              );
               this.$forceUpdate();
             } else if (this.deviceList.length == 1) {
               o['deviceName'] = this.deviceList[0].name;
               o['deviceId'] = this.deviceList[0].id;
               o['workstationName'] = this.deviceList[0].workstationName;
               // o.extInfo.heatNumber = this.deviceList[0].extInfo.heatNumber;
-              this.$set(this.list[index].extInfo,'heatNumber',this.deviceList[0].extInfo.heatNumber)
+              this.$set(
+                this.list[index].extInfo,
+                'heatNumber',
+                this.deviceList[0].extInfo.heatNumber
+              );
               this.$forceUpdate();
             }
           });
@@ -319,13 +382,13 @@
     margin-bottom: 4px;
   }
 
-  .content_num{
+  .content_num {
     --input-background-color: #f0f8f2;
   }
-  .flex-div{
+  .flex-div {
     display: flex;
   }
-  ::v-deep .el-input-group__append{
+  ::v-deep .el-input-group__append {
     padding: 0 10px !important;
   }
 </style>

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 662 - 440
src/views/produce/components/jobBooking/components/semiProductJobBom.vue


Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä