ysy 1 year ago
parent
commit
cd87355ff8

+ 1 - 1
src/api/produce/feeding.js

@@ -4,7 +4,7 @@ import request from '@/utils/request';
 
 // 投料保存
 export async function batchSave(data) {
-    const res = await request.post(`/pda/mes/feed/batchSave`, data);
+    const res = await request.post(`/mes/feed/batchSave`, data);
     if (res.data.code == 0) {
         return res.data.data;
       }

+ 7 - 2
src/views/produce/components/feeding/components/deviceBom.vue

@@ -10,7 +10,7 @@
       <div class="content_table" v-for="(item, index) in list" :key="index">
         <div class="item rx-sc">
           <div class="rx ww33">
-            <div class="lable rx-cc">工位名称</div>
+            <div class="lable lable90 rx-cc">工位名称</div>
             <div class="content">
               {{
                 item.workstationName ||
@@ -32,7 +32,7 @@
 
         <div class="item rx-sc">
           <div class="rx ww33">
-            <div class="lable rx-cc">固资编码</div>
+            <div class="lable lable90 rx-cc">固资编码</div>
             <div class="content rx-sc">
               <div>{{ item.extInfo.fixCode }}</div>
             </div>
@@ -53,6 +53,11 @@
           </div>
         </div>
 
+        
+        <div class="sort_index">
+          {{ index + 1}}
+        </div>
+
         <div class="del_box">
           <el-link type="danger" icon="el-icon-delete" @click="getDelete(index)"></el-link>
         </div>

+ 82 - 71
src/views/produce/components/feeding/components/instanceBom.vue

@@ -16,142 +16,149 @@
       stripe
       border
     >
- 
       <el-table-column label="序号" type="index" width="55">
         <template slot-scope="{ row, $index }">
-          {{ $index }} 
+          {{ $index + 1 }}
         </template>
       </el-table-column>
 
-
-      <el-table-column label="编码" type="code" minWidth="110" >
+      <el-table-column label="编码" type="code" minWidth="110">
         <template slot-scope="{ row, $index }">
-          {{ row.code}}
+          {{ row.code }}
         </template>
       </el-table-column>
 
-      <el-table-column label="名称" type="name"  minWidth="110">
+      <el-table-column label="名称" type="name" minWidth="110">
         <template slot-scope="{ row, $index }">
-          {{ row.name}}
+          {{ row.name }}
         </template>
       </el-table-column>
 
-      <el-table-column label="型号" type="modelType" >
+      <el-table-column label="型号" type="modelType">
         <template slot-scope="{ row, $index }">
-          {{ row.modelType}}
+          {{ row.modelType }}
         </template>
       </el-table-column>
 
-      
-      <el-table-column label="规格" type="specification" >
+      <el-table-column label="规格" type="specification">
         <template slot-scope="{ row, $index }">
-          {{ row.specification}}
+          {{ row.specification }}
         </template>
       </el-table-column>
 
-            
-      <el-table-column label="牌号" type="brandNum" >
+      <el-table-column label="牌号" type="brandNum">
         <template slot-scope="{ row, $index }">
-          {{ row.brandNum}}
+          {{ row.brandNum }}
         </template>
       </el-table-column>
 
-
-      <el-table-column label="包装库存" type="brandNum" >
+      <el-table-column label="包装库存" type="brandNum">
         <template slot-scope="{ row, $index }">
           {{ row.packingCountBase }}/ {{ row.minUnit }}
         </template>
       </el-table-column>
-   
 
-      <el-table-column  v-if="singleReport == 1" :label="currentTaskDiagram.isFirstTask == 1 ? '物料重量' : '上道重量'" type="weightUnit" >
+      <el-table-column
+        v-if="singleReport == 1"
+        :label="currentTaskDiagram.isFirstTask == 1 ? '物料重量' : '上道重量'"
+        type="weightUnit"
+      >
         <template slot-scope="{ row, $index }">
           <div v-if="currentTaskDiagram.isFirstTask == 1">
-              {{ row.extInfo.weight || 0 }} {{ row.extInfo.weightUnit }}</div
-            >
-            <div  v-if="currentTaskDiagram.isFirstTask == 0">
-              {{ row.extInfo.newWeight || 0 }}
-              {{ row.extInfo.weightUnit }}</div
-            >
+            {{ row.extInfo.weight || 0 }} {{ row.extInfo.weightUnit }}</div
+          >
+          <div v-if="currentTaskDiagram.isFirstTask == 0">
+            {{ row.extInfo.newWeight || 0 }}
+            {{ row.extInfo.weightUnit }}</div
+          >
         </template>
       </el-table-column>
 
-
-      <el-table-column  v-if="singleReport == 1" label="刻码" type="engrave" >
+      <el-table-column v-if="singleReport == 1" label="刻码" type="engrave">
         <template slot-scope="{ row, $index }">
           {{ row.extInfo.engrave }}
         </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 }}
         </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
-                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>
+           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" label="炉次号" width="90" type="heatNumber" >
+      <el-table-column
+        v-if="singleReport == 1"
+        label="炉次号"
+        width="90"
+        type="heatNumber"
+      >
         <template slot-scope="{ row, $index }">
           <el-input
-                size="mini"
-                v-model="row.extInfo.heatNumber"
-                placeholder="请输入炉次号"
-              />
+            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" >
+      <el-table-column
+        v-if="singleReport == 1"
+        label="数量"
+        width="90"
+        type="feedQuantity"
+      >
         <template slot-scope="{ row, $index }">
-          <el-input
-                size="mini"
-                v-model="row.feedQuantity"
-                placeholder="数量"
-              />
+          <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="feedQuantity" >
+      <el-table-column
+        v-if="singleReport == 1"
+        label="位置"
+        width="110"
+        type="feedQuantity"
+      >
         <template slot-scope="{ row, $index }">
-         {{row.extInfo.position}}
+          {{ row.extInfo.position }}
         </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
-                >
-              </template>
-            </el-table-column>
-      
-
-
-
-
-
+        <template slot-scope="{ $index, row }">
+          <el-link type="danger" @click="getDelete($index)">删除</el-link>
+        </template>
+      </el-table-column>
     </el-table>
-
   </div>
 </template>
 <script>
@@ -247,4 +254,8 @@
   .mb4 {
     margin-bottom: 4px;
   }
+
+  .content_num{
+    --input-background-color: #f0f8f2;
+  }
 </style>

+ 1 - 1
src/views/produce/components/feeding/components/semiProductBom.vue

@@ -20,7 +20,7 @@
  
       <el-table-column label="序号" type="index" width="55">
         <template slot-scope="{ row, $index }">
-          {{ $index }} 
+          {{ $index + 1 }}
         </template>
       </el-table-column>
 

+ 433 - 468
src/views/produce/components/feeding/index.vue

@@ -1,553 +1,518 @@
 <template>
   <div>
     <div class="top_fixed">
-      <el-button type="primary" size="mini" @click="save(2, 'all')"
-        >一键投料(报工)</el-button
-      >
-      <el-button type="primary" size="mini" @click="removeCacheFn('all')"
-        >清空缓存</el-button
-      >
-      <el-button type="primary" size="mini" @click="save(1, 'all')"
-        >缓存</el-button
-      >
+      <el-button type="primary" size="mini" @click="save(2, 'all')">一键投料(报工)</el-button>
+      <el-button type="primary" size="mini" @click="removeCacheFn('all')">清空缓存</el-button>
+      <el-button type="primary" size="mini" @click="save(1, 'all')">缓存</el-button>
     </div>
 
-    <div class="feed_box"  v-if="isLoad">
+    <div class="feed_box" v-if="isLoad">
       <div v-for="(item, index) in List" :key="index" class="card_box">
         <div class="title_box rx-bc">
           <div class="name">工单信息 </div>
 
           <div class="rx-bc">
             <el-button type="text" size="mini">出库单</el-button>
-            <el-button
-              type="text"
-              size="mini"
-              @click="openPicking(item.workOrderId, item)"
-              >添加物料</el-button
-            >
-            <el-button
-              type="text"
-              size="mini"
-              @click="removeCacheFn(item.workOrderId)"
-              >清空缓存</el-button
-            >
-            <el-button type="text" size="mini" @click="save(1, index)"
-              >缓存</el-button
-            >
+            <el-button type="text" size="mini" @click="openPicking(item.workOrderId, item)">添加物料</el-button>
+            <el-button type="text" size="mini" @click="removeCacheFn(item.workOrderId)">清空缓存</el-button>
+            <el-button type="text" size="mini" @click="save(1, index)">缓存</el-button>
           </div>
         </div>
 
-        <workOrderBom :item="item" ></workOrderBom>
+        <workOrderBom :item="item"></workOrderBom>
 
-        <paramBom
-          v-if="item.paramDetailList.length != 0"
-          :list="item.paramDetailList"
-        ></paramBom>
+        <paramBom v-if="item.paramDetailList.length != 0" :list="item.paramDetailList"></paramBom>
 
-        <deviceBom
-          v-if="item.equipmentList.length != 0"
-          :list="item.equipmentList"
-        ></deviceBom>
+        <deviceBom v-if="item.equipmentList.length != 0" :list="item.equipmentList"></deviceBom>
 
 
-        <productsBom
-          v-if="item.product != null && item.product != '{}'"
-          :itemObj="item"
-
-          :productsObj="item.product"
-        >
+        <productsBom v-if="item.product != null && item.product != '{}'" :itemObj="item" :productsObj="item.product">
         </productsBom>
 
         <modelBom v-if="item.modelList.length != 0" :list="item.modelList">
         </modelBom>
 
-        <instanceBom
-          v-if="item.instanceList.length != 0"
-          :list="item.instanceList"
-          :equipmentList="item.equipmentList"
-          :currentTaskDiagram="item.currentTaskDiagram"
-          :singleReport="item.singleReport"
-        ></instanceBom>
-
-        <semiProductBom
-          v-if="item.semiProductList.length != 0"
-          :list="item.semiProductList"
-          :equipmentList="item.equipmentList"
-          :currentTaskDiagram="item.currentTaskDiagram"
-          :singleReport="item.singleReport"
-        ></semiProductBom>
-
-        <turnoverBom
-          v-if="item.turnover.length != 0"
-          :wordItem="item"
-          :list="item.turnover"
-          pattern="feed"
-        ></turnoverBom>
-
-        <aridRegion
-          v-if="item.aridRegionList.length != 0"
-          :list="item.aridRegionList"
-          
-        ></aridRegion>
-
-        <palletBom
-          v-if="item.palletList.length != 0"
-          :list="item.palletList"
-        ></palletBom>
-
-        <revolvingDiskBom
-          v-if="item.revolvingDiskList.length != 0"
-          :list="item.revolvingDiskList"
-        ></revolvingDiskBom>
+        <instanceBom v-if="item.instanceList.length != 0" :list="item.instanceList" :equipmentList="item.equipmentList"
+          :currentTaskDiagram="item.currentTaskDiagram" :singleReport="item.singleReport"></instanceBom>
+
+        <semiProductBom v-if="item.semiProductList.length != 0" :list="item.semiProductList"
+          :equipmentList="item.equipmentList" :currentTaskDiagram="item.currentTaskDiagram"
+          :singleReport="item.singleReport"></semiProductBom>
+
+        <turnoverBom v-if="item.turnover.length != 0" :wordItem="item" :list="item.turnover" pattern="feed">
+        </turnoverBom>
+
+        <aridRegion v-if="item.aridRegionList.length != 0" :list="item.aridRegionList"></aridRegion>
+
+        <palletBom v-if="item.palletList.length != 0" :list="item.palletList"></palletBom>
+
+        <revolvingDiskBom v-if="item.revolvingDiskList.length != 0" :list="item.revolvingDiskList"></revolvingDiskBom>
       </div>
     </div>
 
-    <pickingList
-      isType="feed"
-      ref="pickingListRef"
-      @allSelection="allSelection"
-    ></pickingList>
+    <pickingList isType="feed" ref="pickingListRef" @allSelection="allSelection"></pickingList>
   </div>
 </template>
 
 <script>
-  import { workorderList } from '@/api/produce/workOrder';
-  import {
-    batchSave,
-    feedSaveCache,
-    feedGetCache,
-    removeCache
-  } from '@/api/produce/feeding';
-
-  import pickingList from '../picking/pickingList.vue';
-
-  import workOrderBom from './components/workOrderBom.vue';
-  import paramBom from './components/paramBom.vue';
-  import deviceBom from './components/deviceBom.vue';
-  import productsBom from './components/productsBom.vue';
-  import modelBom from './components/modelBom.vue';
-  import instanceBom from './components/instanceBom.vue';
-  import semiProductBom from './components/semiProductBom.vue';
-  import turnoverBom from './components/turnoverBom.vue';
-  import aridRegion from './components/aridRegion.vue';
-  import palletBom from './components/palletBom.vue';
-  import revolvingDiskBom from './components/revolvingDiskBom.vue';
-  import { deepClone } from '@/utils';
-  export default {
-    name: 'feeding',
-    components: {
-      pickingList,
-
-      workOrderBom,
-      paramBom,
-      deviceBom,
-      productsBom,
-      modelBom,
-      instanceBom,
-      semiProductBom,
-      turnoverBom,
-      aridRegion,
-      palletBom,
-      revolvingDiskBom
-    },
-    props: {
-      workListIds: {
-        type: Array,
-        default() {
-          return [];
-        }
+import { workorderList } from '@/api/produce/workOrder';
+import {
+  batchSave,
+  feedSaveCache,
+  feedGetCache,
+  removeCache
+} from '@/api/produce/feeding';
+
+import pickingList from '../picking/pickingList.vue';
+
+import workOrderBom from './components/workOrderBom.vue';
+import paramBom from './components/paramBom.vue';
+import deviceBom from './components/deviceBom.vue';
+import productsBom from './components/productsBom.vue';
+import modelBom from './components/modelBom.vue';
+import instanceBom from './components/instanceBom.vue';
+import semiProductBom from './components/semiProductBom.vue';
+import turnoverBom from './components/turnoverBom.vue';
+import aridRegion from './components/aridRegion.vue';
+import palletBom from './components/palletBom.vue';
+import revolvingDiskBom from './components/revolvingDiskBom.vue';
+import { deepClone } from '@/utils';
+export default {
+  name: 'feeding',
+  components: {
+    pickingList,
+
+    workOrderBom,
+    paramBom,
+    deviceBom,
+    productsBom,
+    modelBom,
+    instanceBom,
+    semiProductBom,
+    turnoverBom,
+    aridRegion,
+    palletBom,
+    revolvingDiskBom
+  },
+  props: {
+    workListIds: {
+      type: Array,
+      default() {
+        return [];
       }
-    },
+    }
+  },
 
-    computed: {
-      taskObj() {
-        return this.$store.state.user.taskObj;
-      }
-    },
+  computed: {
+    taskObj() {
+      return this.$store.state.user.taskObj;
+    }
+  },
 
-    watch: {
-      workListIds: {
-        handler(val) {
-          this.getList(val);
-        },
-        deep: true,
-        immediate: true
-      }
-    },
-    data() {
-      return {
-        List: [],
-        idsList: [],
-        isLoad: false,
+  watch: {
+    workListIds: {
+      handler(val) {
+        this.getList(val);
+      },
+      deep: true,
+      immediate: true
+    }
+  },
+  data() {
+    return {
+      List: [],
+      idsList: [],
+      isLoad: false,
+    };
+  },
+
+  methods: {
+    getList(ids) {
+      this.idsList = ids || [];
+      let param = {
+        ids: ids,
+        taskId: this.taskObj.id
       };
-    },
-
-    methods: {
-      getList(ids) {
-        this.idsList = ids || [];
-        let param = {
-          ids: ids,
-          taskId: this.taskObj.id
-        };
-        this.isLoad = false;
-        workorderList(param)
-          .then((res) => {
-            let arr = [];
-            arr = res.map((m) => {
-              m.workOrderId = m.id;
-              m.paramDetailList = [];
-
-              m.instanceList = []; // 物料
-              m.equipmentList = []; // 设备
-              m.modelList = []; // 模具
-              m.aridRegionList = []; // 干燥区
-              m.packingList = []; // 包装
-              m.palletList = []; // 舟皿
-              m.revolvingDiskList = []; // 周转盘
-              m.semiProductList = []; //半成品
-
-              if (m.pickOutInList.length > 0) {
-                m.pickOutInList.forEach((f) => {
-                  if (f.rootCategoryLevelId == 1) {
-                    m.instanceList.push(f);
-                  } else if (f.rootCategoryLevelId == 4) {
-                    m.modelList.push(f);
-                  } else if (f.rootCategoryLevelId == 5) {
-                    m.modelList.push(f);
-                  } else if (f.rootCategoryLevelId == 11) {
-                    m.aridRegionList.push(f);
-                  } else if (f.rootCategoryLevelId == 13) {
-                    m.packingList.push(f);
-                  } else if (f.rootCategoryLevelId == 8) {
-                    m.palletList.push(f);
-                  } else if (f.rootCategoryLevelId == 26) {
-                    m.revolvingDiskList.push(f);
-                  } else if (
-                    [23, 2, 9, 28].includes(Number(f.rootCategoryLevelId))
-                  ) {
-                    m.semiProductList.push(f);
-                  }
-                });
-              }
-
-              // 处理字段
-              if (m.quality == '') {
-                m.product = '{}';
-              }
-
-              if (!Object.prototype.hasOwnProperty.call(m, 'product')) {
-                m.product = '{}';
-              }
-
-              delete m.id;
-              if (this.taskObj.id) {
-                m.taskId = this.taskObj.id;
-                m.taskName = this.taskObj.name;
-              }
-              return {
-                ...m
-              };
-            });
-            this.List = deepClone(arr);
-          })
-          .finally(() => {
-            this.isLoad = true;
-            this.getCacheFn();
-          });
+      this.isLoad = false;
+      workorderList(param)
+        .then((res) => {
+          let arr = [];
+          arr = res.map((m) => {
+            m.workOrderId = m.id;
+            m.paramDetailList = [];
+
+            m.instanceList = []; // 物料
+            m.equipmentList = []; // 设备
+            m.modelList = []; // 模具
+            m.aridRegionList = []; // 干燥区
+            m.packingList = []; // 包装
+            m.palletList = []; // 舟皿
+            m.revolvingDiskList = []; // 周转盘
+            m.semiProductList = []; //半成品
+
+            if (m.pickOutInList.length > 0) {
+              m.pickOutInList.forEach((f) => {
+                if (f.rootCategoryLevelId == 1) {
+                  m.instanceList.push(f);
+                } else if (f.rootCategoryLevelId == 4) {
+                  m.modelList.push(f);
+                } else if (f.rootCategoryLevelId == 5) {
+                  m.modelList.push(f);
+                } else if (f.rootCategoryLevelId == 11) {
+                  m.aridRegionList.push(f);
+                } else if (f.rootCategoryLevelId == 13) {
+                  m.packingList.push(f);
+                } else if (f.rootCategoryLevelId == 8) {
+                  m.palletList.push(f);
+                } else if (f.rootCategoryLevelId == 26) {
+                  m.revolvingDiskList.push(f);
+                } else if (
+                  [23, 2, 9, 28].includes(Number(f.rootCategoryLevelId))
+                ) {
+                  m.semiProductList.push(f);
+                }
+              });
+            }
 
-        this.$forceUpdate();
-      },
+            // 处理字段
+            if (m.quality == '') {
+              m.product = '{}';
+            }
 
-      openPicking(id, item) {
-        this.$refs.pickingListRef.open(id, item);
-      },
+            if (!Object.prototype.hasOwnProperty.call(m, 'product')) {
+              m.product = '{}';
+            }
 
-      allSelection(id, selectList) {
-        this.List.forEach((m) => {
-          if (m.workOrderId == id) {
-            let modelList = []; // 模具
-            let instanceList = []; // 投料
-            let aridRegionList = []; // 干燥区
-            let equipmentList = []; // 生产设备
-            let palletList = []; // 舟皿
-            let revolvingDiskList = []; // 周转盘
-            let semiProductList = []; // 半成品
-            let turnover = []; //周转车
-
-            selectList.forEach((f) => {
-              if (f.rootCategoryLevelId == 4) {
-                equipmentList = equipmentList.concat(f);
-              }
-              if (f.rootCategoryLevelId == 5) {
-                modelList = modelList.concat(f);
-              } else if (f.rootCategoryLevelId == 1) {
-                instanceList = instanceList.concat(f);
-              } else if (f.rootCategoryLevelId == 11) {
-                aridRegionList = aridRegionList.concat(f);
-              } else if (f.rootCategoryLevelId == 7) {
-                turnover = turnover.concat(f);
-              } else if (f.rootCategoryLevelId == 8) {
-                palletList = palletList.concat(f);
-              } else if (f.rootCategoryLevelId == 26) {
-                revolvingDiskList = revolvingDiskList.concat(f);
-              } else if (
-                [23, 2, 9, 28].includes(Number(f.rootCategoryLevelId))
-              ) {
-                semiProductList = semiProductList.concat(f);
-              }
-            });
-
-            this.$set(m, 'modelList', modelList);
-            this.$set(m, 'instanceList', instanceList);
-            this.$set(m, 'aridRegionList', aridRegionList);
-            this.$set(m, 'equipmentList', equipmentList);
-            this.$set(m, 'turnover', turnover);
-            this.$set(m, 'palletList', palletList);
-            this.$set(m, 'revolvingDiskList', revolvingDiskList);
-            this.$set(m, 'semiProductList', semiProductList);
-
-            this.$forceUpdate();
-          }
+            delete m.id;
+            if (this.taskObj.id) {
+              m.taskId = this.taskObj.id;
+              m.taskName = this.taskObj.name;
+            }
+            return {
+              ...m
+            };
+          });
+          this.List = deepClone(arr);
+        })
+        .finally(() => {
+          this.isLoad = true;
+          this.getCacheFn();
         });
-      },
 
-      getCacheFn() {
-        let parma = {
-          workOrderIds: this.idsList,
-          taskId: this.taskObj.id,
-          type: 2
-        };
+      this.$forceUpdate();
+    },
 
-        feedGetCache(parma).then((res) => {
-          if (res.length == 0) {
-            return false;
-          }
-          let objList = res[0].extInfo.objList;
-          this.List.forEach((f) => {
-            objList.forEach((o) => {
-              if (f.workOrderId == o.workOrderId && f.taskId == o.taskId) {
-                f['instanceList'] = o.instanceList || [];
-                f['equipmentList'] = o.equipmentList || [];
-                f['modelList'] = o.modelList || [];
-                f['aridRegionList'] = o.aridRegionList || [];
-                f['packingList'] = o.packingList || [];
-                f['palletList'] = o.palletList || [];
-                f['revolvingDiskList'] = o.revolvingDiskList || [];
-                f['semiProductList'] = o.semiProductList || [];
-                this.$forceUpdate();
-              }
-            });
-          });
-        });
-      },
+    openPicking(id, item) {
+      this.$refs.pickingListRef.open(id, item);
+    },
 
-      async save(type, index) {
-        this.List.forEach((f) => {
-          f.instanceList.forEach((e) => {
-            if (Object.prototype.hasOwnProperty.call(e, 'type')) {
-              e.extInfo['type'] = e.type;
+    allSelection(id, selectList) {
+      this.List.forEach((m) => {
+        if (m.workOrderId == id) {
+          let modelList = []; // 模具
+          let instanceList = []; // 投料
+          let aridRegionList = []; // 干燥区
+          let equipmentList = []; // 生产设备
+          let palletList = []; // 舟皿
+          let revolvingDiskList = []; // 周转盘
+          let semiProductList = []; // 半成品
+          let turnover = []; //周转车
+
+          selectList.forEach((f) => {
+            if (f.rootCategoryLevelId == 4) {
+              equipmentList = equipmentList.concat(f);
+            }
+            if (f.rootCategoryLevelId == 5) {
+              modelList = modelList.concat(f);
+            } else if (f.rootCategoryLevelId == 1) {
+              instanceList = instanceList.concat(f);
+            } else if (f.rootCategoryLevelId == 11) {
+              aridRegionList = aridRegionList.concat(f);
+            } else if (f.rootCategoryLevelId == 7) {
+              turnover = turnover.concat(f);
+            } else if (f.rootCategoryLevelId == 8) {
+              palletList = palletList.concat(f);
+            } else if (f.rootCategoryLevelId == 26) {
+              revolvingDiskList = revolvingDiskList.concat(f);
+            } else if (
+              [23, 2, 9, 28].includes(Number(f.rootCategoryLevelId))
+            ) {
+              semiProductList = semiProductList.concat(f);
             }
-            e.extInfo['isConsumable'] = e.isConsumable;
           });
-        });
 
-        const isCache = await this.checkCache(type);
+          this.$set(m, 'modelList', modelList);
+          this.$set(m, 'instanceList', instanceList);
+          this.$set(m, 'aridRegionList', aridRegionList);
+          this.$set(m, 'equipmentList', equipmentList);
+          this.$set(m, 'turnover', turnover);
+          this.$set(m, 'palletList', palletList);
+          this.$set(m, 'revolvingDiskList', revolvingDiskList);
+          this.$set(m, 'semiProductList', semiProductList);
 
-        if (!isCache) {
-          return false;
+          this.$forceUpdate();
         }
+      });
+    },
+
+    getCacheFn() {
+      let parma = {
+        workOrderIds: this.idsList,
+        taskId: this.taskObj.id,
+        type: 2
+      };
 
-        batchSave(this.List).then((res) => {
-          this.$message.success('投料成功');
-          this.getList(this.idsList);
+      feedGetCache(parma).then((res) => {
+        if (res.length == 0) {
+          return false;
+        }
+        let objList = res[0].extInfo.objList;
+        this.List.forEach((f) => {
+          objList.forEach((o) => {
+            if (f.workOrderId == o.workOrderId && f.taskId == o.taskId) {
+              f['instanceList'] = o.instanceList || [];
+              f['equipmentList'] = o.equipmentList || [];
+              f['modelList'] = o.modelList || [];
+              f['aridRegionList'] = o.aridRegionList || [];
+              f['packingList'] = o.packingList || [];
+              f['palletList'] = o.palletList || [];
+              f['revolvingDiskList'] = o.revolvingDiskList || [];
+              f['semiProductList'] = o.semiProductList || [];
+              this.$forceUpdate();
+            }
+          });
         });
-      },
+      });
+    },
 
-      checkCache(type, index) {
-        return new Promise((resolve) => {
-          if (type == 1) {
-            console.log([this.List[index]]);
-            feedSaveCache(this.List).then((rr) => {
-              this.$message.success('已经缓存');
-            });
-            resolve(false);
-          } else if (type == 2) {
-            resolve(true);
+    async save(type, index) {
+      this.List.forEach((f) => {
+        f.instanceList.forEach((e) => {
+          if (Object.prototype.hasOwnProperty.call(e, 'type')) {
+            e.extInfo['type'] = e.type;
           }
+          e.extInfo['isConsumable'] = e.isConsumable;
         });
-      },
+      });
 
-      removeCacheFn(type) {
-        this.$confirm('是否清空缓存', '缓存')
-          .then(() => {
-            let parma = {
-              workOrderIds: this.type == 'all' ? this.idsList : [type],
-              taskId: this.taskObj.id,
-              type: 2
-            };
-            removeCache(parma).then((res) => {
-              this.getList(this.idsList);
-            });
-          })
-          .catch(() => {});
+      const isCache = await this.checkCache(type);
+
+      if (!isCache) {
+        return false;
       }
-    }
-  };
-</script>
 
-<style scoped lang="scss">
-  .top_fixed {
-    width: 100%;
-    height: 40px;
-    background: #fff;
-    display: flex;
-    align-items: center;
-    justify-content: flex-end;
-  }
+      batchSave(this.List).then((res) => {
+        this.$message.success('投料成功');
+        this.getList(this.idsList);
+      });
+    },
 
-  .feed_box {
-    margin-top: 6px;
-    width: 100%;
-    height: calc(100vh - 70px - 50px - 80px - 60px);
-    overflow-y: scroll;
-    overflow-x: hidden;
-  }
+    checkCache(type, index) {
+      return new Promise((resolve) => {
+        if (type == 1) {
+          console.log([this.List[index]]);
+          feedSaveCache(this.List).then((rr) => {
+            this.$message.success('已经缓存');
+          });
+          resolve(false);
+        } else if (type == 2) {
+          resolve(true);
+        }
+      });
+    },
 
-  .card_box {
-    background: #fff;
-    padding: 8px;
-    border-radius: 2px;
+    removeCacheFn(type) {
+      this.$confirm('是否清空缓存', '缓存')
+        .then(() => {
+          let parma = {
+            workOrderIds: this.type == 'all' ? this.idsList : [type],
+            taskId: this.taskObj.id,
+            type: 2
+          };
+          removeCache(parma).then((res) => {
+            this.getList(this.idsList);
+          });
+        })
+        .catch(() => { });
+    }
   }
+};
+</script>
+
+<style scoped lang="scss">
+.top_fixed {
+  width: 100%;
+  height: 40px;
+  background: #fff;
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+}
+
+.feed_box {
+  margin-top: 6px;
+  width: 100%;
+  height: calc(100vh - 70px - 50px - 80px - 60px);
+  overflow-y: scroll;
+  overflow-x: hidden;
+}
+
+.card_box {
+  background: #fff;
+  padding: 8px;
+  border-radius: 2px;
+}
 </style>
 
 <style lang="scss">
-  .mt6 {
-    margin-top: 6px;
-  }
-
-  .title_box {
-    .name {
-      font-size: 14px;
-      font-style: normal;
-      font-weight: 400;
-      color: #157a2c;
-      padding-left: 5px;
-      position: relative;
-
-      &:before {
-        position: absolute;
-        content: '';
-        left: 0px;
-        top: 0px;
-        bottom: 0px;
-        width: 2px;
-        height: 14px;
-        background: #157a2c;
-        margin: auto;
-      }
+.mt6 {
+  margin-top: 6px;
+}
+
+.title_box {
+  .name {
+    font-size: 14px;
+    font-style: normal;
+    font-weight: 400;
+    color: #157a2c;
+    padding-left: 5px;
+    position: relative;
+
+    &:before {
+      position: absolute;
+      content: '';
+      left: 0px;
+      top: 0px;
+      bottom: 0px;
+      width: 2px;
+      height: 14px;
+      background: #157a2c;
+      margin: auto;
     }
   }
+}
 
-  .material {
-    margin-top: 6px;
+.material {
+  margin-top: 6px;
 
-    .content_table {
-      width: 100%;
-      border: 1px solid #e3e5e5;
-      position: relative;
-
-      .item {
-        display: flex;
-        border-bottom: 1px solid #e3e5e5;
-
-        .lable {
-          width: 72px;
-          text-align: center;
-          background-color: #f7f9fa;
-          font-size: 12px;
-          border-right: 1px solid #e3e5e5;
-          flex-shrink: 0;
-        }
+  .content_table {
+    width: 100%;
+    border: 1px solid #e3e5e5;
+    position: relative;
+
+    .item {
+      display: flex;
+      border-bottom: 1px solid #e3e5e5;
+
+      .lable {
+        width: 72px;
+        text-align: center;
+        background-color: #f7f9fa;
+        font-size: 12px;
+        border-right: 1px solid #e3e5e5;
+        flex-shrink: 0;
+      }
 
-        .lable80 {
-          width: 80px !important;
-          font-size: 12px;
-        }
-        .lable100 {
-          width: 100px !important;
-        }
+      .lable80 {
+        width: 80px !important;
+        font-size: 12px;
+      }
 
-        .ww60 {
-          width: 60px;
-        }
+      .lable90 {
+        width: 90px !important;
+      }
 
-        .content {
-          width: 250px;
-          min-height: 32px;
-          font-size: 14px;
-          line-height: 14px;
-          font-style: normal;
-          font-weight: 400;
-          padding: 9px 4px;
-          box-sizing: border-box;
-          word-wrap: break-word;
-          flex-grow: 1 !important;
-
-          .unit {
-            padding: 0 2px;
-            font-size: 12px;
-            color: #404446;
-          }
-        }
+      .lable100 {
+        width: 100px !important;
+      }
 
-        .content_num {
-          display: flex;
-          align-items: center;
-          padding: 2px;
-          --input-background-color: #f0f8f2;
-        }
 
-        .pd2 {
-          padding: 2px 4px;
-        }
+      .ww60 {
+        width: 60px;
+      }
 
-        &:last-child {
-          border-bottom: none;
+      .content {
+        width: 250px;
+        min-height: 32px;
+        font-size: 14px;
+        line-height: 14px;
+        font-style: normal;
+        font-weight: 400;
+        padding: 9px 4px;
+        box-sizing: border-box;
+        word-wrap: break-word;
+        flex-grow: 1 !important;
+
+        .unit {
+          padding: 0 2px;
+          font-size: 12px;
+          color: #404446;
         }
       }
 
-      .ww55 {
-        width: 55%;
+      .content_num {
+        display: flex;
+        align-items: center;
+        padding: 2px;
+        --input-background-color: #f0f8f2;
       }
 
-      .ww50 {
-        width: 50%;
+      .pd2 {
+        padding: 2px 4px;
       }
 
-      .ww45 {
-        width: 45%;
-      }
-      .ww40 {
-        width: 40%;
+      &:last-child {
+        border-bottom: none;
       }
+    }
 
-      .ww30 {
-        width: 30%;
-      }
+    .ww55 {
+      width: 55%;
+    }
 
-      .ww33 {
-        width: 33.33%;
-      }
+    .ww50 {
+      width: 50%;
+    }
 
-      .ww20 {
-        width: 20%;
-      }
+    .ww45 {
+      width: 45%;
+    }
 
-      .del_box {
-        position: absolute;
-        right: 2px;
-        top: 2px;
-      }
+    .ww40 {
+      width: 40%;
+    }
+
+    .ww30 {
+      width: 30%;
+    }
+
+    .ww33 {
+      width: 33.33%;
+    }
+
+    .ww20 {
+      width: 20%;
+    }
+
+    .del_box {
+      position: absolute;
+      right: 2px;
+      top: 2px;
+    }
+
+    .sort_index {
+      position: absolute;
+      left: 2px;
+      top: 2px;
+      width: 14px;
+      height: 14px;
+      line-height: 14px;
+      text-align: center;
+      color: #fff;
+      font-size: 12px;
+      border-radius: 50%;
+      background: rgb(21, 122, 44);
     }
   }
+}
 </style>

+ 9 - 5
src/views/produceOrder/index.vue

@@ -25,8 +25,9 @@
         :selection.sync="selection"
         @sort-change="onSortChange"
         autoAmendPage
+        :parse-data="parseData"
       >
-        <!-- :parse-data="parseData" -->
+    
         <template v-slot:toolbar>
           <el-button type="success">新建</el-button>
           <el-button type="success">暂停</el-button>
@@ -119,7 +120,7 @@
               报工
             </el-link>
             <el-link
-              v-if="row.status == 4 && row.isSplit == 0 && !row.originalCode"
+              v-if="row.status == 4 && !row.originalCode"
               type="primary"
               :underline="false"
               icon="el-icon-truck"
@@ -166,6 +167,7 @@
   import printSr from './components/printSr';
   import printTg from './components/printTg';
   import { debounce } from 'lodash';
+import { List } from 'echarts/core';
 
   export default {
     components: {
@@ -469,14 +471,16 @@
 
       /* 数据转为树形结构 */
       parseData(data) {
-        console.log(99, data);
-        return this.$util.toTreeData({
+        return  {
+          ...data,
+          list: this.$util.toTreeData({
           data: data.list,
           count: data.total,
 
           idField: 'code',
           parentIdField: 'originalCode'
-        });
+        })
+        }
       },
 
       /* 数据转为树形结构 */