Jelajahi Sumber

修复产线派单报错

695593266@qq.com 5 bulan lalu
induk
melakukan
1d772d324c

+ 124 - 112
src/views/materialRequirement/requirementListOrder/details.vue

@@ -1,7 +1,11 @@
 <template>
   <div class="ele-body">
     <el-card shadow="never" class="tabs_box">
-      <el-button size="small" type="primary" class="ele-btn-icon"
+      <el-button
+        size="small"
+        type="primary"
+        class="ele-btn-icon"
+        @click="closeDetail"
         >关闭</el-button
       >
       <headerTitle style="margin-top: 10px" />
@@ -15,25 +19,25 @@
         <el-row :gutter="10" class="basic">
           <el-col :lg="8" :md="12" :sm="12" :xl="8" :xs="12">
             <el-form-item label="计划编号:">
-              <el-input v-model="form.order" disabled></el-input>
+              <el-input v-model="form.planCode" disabled></el-input>
             </el-form-item>
           </el-col>
 
           <el-col :lg="8" :md="12" :sm="12" :xl="8" :xs="12">
             <el-form-item label="批次号:">
-              <el-input v-model="form.order" disabled></el-input>
+              <el-input v-model="form.batchNo" disabled></el-input>
             </el-form-item>
           </el-col>
 
           <el-col :lg="8" :md="12" :sm="12" :xl="8" :xs="12">
             <el-form-item label="编码:">
-              <el-input v-model="form.order" disabled></el-input>
+              <el-input v-model="form.categoryCode" disabled></el-input>
             </el-form-item>
           </el-col>
 
           <el-col :lg="8" :md="12" :sm="12" :xl="8" :xs="12">
             <el-form-item label="名称:">
-              <el-input v-model="form.order" disabled></el-input>
+              <el-input v-model="form.categoryName" disabled></el-input>
             </el-form-item>
           </el-col>
 
@@ -43,48 +47,55 @@
             </el-form-item>
           </el-col>
 
-          <el-col :lg="8" :md="12" :sm="12" :xl="8" :xs="12">
+          <!-- <el-col :lg="8" :md="12" :sm="12" :xl="8" :xs="12">
             <el-form-item label="计划数量:">
               <el-input v-model="form.order" disabled></el-input>
             </el-form-item>
-          </el-col>
+          </el-col> -->
 
-          <el-col :lg="8" :md="12" :sm="12" :xl="8" :xs="12">
+          <!-- <el-col :lg="8" :md="12" :sm="12" :xl="8" :xs="12">
             <el-form-item label="BOM类型:">
               <el-input v-model="form.order" disabled></el-input>
             </el-form-item>
-          </el-col>
+          </el-col> -->
 
-          <el-col :lg="8" :md="12" :sm="12" :xl="8" :xs="12">
+          <!-- <el-col :lg="8" :md="12" :sm="12" :xl="8" :xs="12">
             <el-form-item label="BOM版本:">
               <el-input v-model="form.order" disabled></el-input>
             </el-form-item>
-          </el-col>
+          </el-col> -->
 
-          <el-col :lg="8" :md="12" :sm="12" :xl="8" :xs="12">
+          <!-- <el-col :lg="8" :md="12" :sm="12" :xl="8" :xs="12">
             <el-form-item label="投料控制清单号:">
               <el-input v-model="form.order" disabled></el-input>
             </el-form-item>
-          </el-col>
+          </el-col> -->
 
           <el-col :lg="8" :md="12" :sm="12" :xl="8" :xs="12">
             <el-form-item label="需求订单号:">
-              <el-input v-model="form.order" disabled></el-input>
+              <el-input v-model="form.code" disabled></el-input>
             </el-form-item>
           </el-col>
 
           <el-col :lg="8" :md="12" :sm="12" :xl="8" :xs="12">
             <el-form-item label="顶级产品编号:">
-              <el-input v-model="form.order" disabled></el-input>
+              <el-input v-model="form.topCategoryName" disabled></el-input>
             </el-form-item>
           </el-col>
 
           <el-col :lg="8" :md="12" :sm="12" :xl="8" :xs="12">
             <el-form-item label="顶级产品名称:">
-              <el-input v-model="form.order" disabled></el-input>
+              <el-input v-model="form.topCategoryName" disabled></el-input>
             </el-form-item>
           </el-col>
-          <el-col :lg="8" :md="12" :sm="12" :xl="8" :xs="12">
+          <el-col
+            :lg="8"
+            :md="12"
+            :sm="12"
+            :xl="8"
+            :xs="12"
+            v-if="$route.query.type == 'order'"
+          >
             <el-form-item label="生产工单号:">
               <el-input v-model="form.order" disabled></el-input>
             </el-form-item>
@@ -110,13 +121,17 @@
 </template>
 
 <script>
+  import {
+    getRequirementListPlanDetail,
+    getRequirementListPlanDetailPage
+  } from '@/api/requirementListPlan';
   export default {
     data() {
       return {
         visible: false,
         form: {},
         rules: {},
-        tableHeight: 'calc(100vh - 665px)',
+        tableHeight: 'calc(100vh - 560px)',
         selection: []
       };
     },
@@ -141,48 +156,47 @@
             fixed: 'left'
           },
           {
-            prop: 'type',
+            prop: 'categoryLevelId',
             label: '物料分类',
             width: 100,
             align: 'center',
             showOverflowTooltip: true,
-            slot: 'type'
+            slot: 'categoryLevelId'
           },
           ,
           {
-            prop: 'type',
+            prop: 'componentAttribute',
             label: '属性类型',
             width: 100,
             align: 'center',
             showOverflowTooltip: true,
-            slot: 'type'
+            slot: 'componentAttribute'
           },
           ,
           {
-            prop: 'type',
+            prop: 'attributeType',
             label: '存货类型',
             width: 100,
             align: 'center',
             showOverflowTooltip: true,
-            slot: 'type'
+            slot: 'attributeType'
           },
           ,
           {
-            prop: 'type',
+            prop: 'produceType',
             label: '生产类型',
             width: 100,
             align: 'center',
             showOverflowTooltip: true,
-            slot: 'type'
+            slot: 'produceType'
           },
           ,
           {
-            prop: 'type',
+            prop: 'categoryCode',
             label: '物料编码',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           },
           ,
           {
@@ -193,43 +207,39 @@
             showOverflowTooltip: true,
             slot: 'type'
           },
-          ,
+
           {
-            prop: 'type',
+            prop: 'categoryName',
             label: '物料名称',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           },
-          ,
+
           {
-            prop: 'type',
+            prop: 'modelType',
             label: '型号',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           },
-          ,
+
           {
-            prop: 'type',
+            prop: 'specification',
             label: '规格',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           },
-          ,
+
           {
-            prop: 'type',
+            prop: 'categorySize',
             label: '尺寸',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           },
-          ,
+
           {
             prop: 'type',
             label: '基本数量',
@@ -238,7 +248,7 @@
             showOverflowTooltip: true,
             slot: 'type'
           },
-          ,
+
           {
             prop: 'type',
             label: '投料控制数量/定额数量',
@@ -247,124 +257,95 @@
             showOverflowTooltip: true,
             slot: 'type'
           },
-          ,
+
           {
-            prop: 'type',
+            prop: 'measuringUnit',
             label: '计量单位',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           },
-          ,
+
           {
-            prop: 'type',
+            prop: 'brandNum',
             label: '牌号',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           },
-          ,
+
           {
-            prop: 'type',
+            prop: 'weight',
             label: '重量',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           },
-          ,
+
           {
-            prop: 'type',
+            prop: 'weightUnit',
             label: '重量单位',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
-          },
-          ,
-          {
-            prop: 'type',
-            label: '机型',
-            width: 100,
-            align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
-          },
-          ,
-          {
-            prop: 'type',
-            label: '颜色',
-            width: 100,
-            align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           },
-          ,
+
           {
-            prop: 'type',
+            prop: 'pickQuantity',
             label: '已领数量',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           },
-          ,
+
           {
-            prop: 'type',
+            prop: 'unPickQuantity',
             label: '未领数量',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           },
-          ,
+
           {
-            prop: 'type',
+            prop: 'outQuantity',
             label: '已出库数量',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           },
-          ,
+
           {
-            prop: 'type',
+            prop: 'unOutQuantity',
             label: '未出库数量',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           },
-          ,
+
           {
-            prop: 'type',
+            prop: 'feedQuantity',
             label: '已投数量',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           },
-          ,
+
           {
-            prop: 'type',
+            prop: 'unFeedQuantity',
             label: '未投数量',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           },
-          ,
+
           {
-            prop: 'type',
+            prop: 'oddmentsQuantity',
             label: '余料数量',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           },
-          ,
+
           {
             prop: 'type',
             label: '创建人',
@@ -373,7 +354,7 @@
             showOverflowTooltip: true,
             slot: 'type'
           },
-          ,
+
           {
             prop: 'type',
             label: '创建时间',
@@ -409,6 +390,11 @@
       }
     },
 
+    mounted() {
+      this.getDetailData();
+      this.getDetailPage();
+    },
+
     methods: {
       datasource() {
         return [];
@@ -424,11 +410,37 @@
 
       search() {},
 
+      closeDetail() {
+        this.$nextTick(() => {
+          this.$router.back();
+        });
+      },
+
+      async getDetailData() {
+        const URL =
+          this.$route.query.type == 'plan' ? getRequirementListPlanDetail : '';
+
+        await URL(this.$route.query.id).then((res) => {
+          this.form = res;
+        });
+      },
+
+      async getDetailPage() {
+        const URL =
+          this.$route.query.type == 'plan'
+            ? getRequirementListPlanDetailPage
+            : '';
+
+        await URL({ materialRequirementsId: this.$route.query.id }).then(
+          (res) => {}
+        );
+      },
+
       fullscreenChange(fullscreen) {
         if (fullscreen) {
           this.tableHeight = 'calc(100vh - 120px)';
         } else {
-          this.tableHeight = 'calc(100vh - 665px)';
+          this.tableHeight = 'calc(100vh - 560px)';
         }
       }
     }

+ 73 - 51
src/views/materialRequirement/requirementListPlan/index.vue

@@ -14,7 +14,26 @@
         :pageSize="20"
         @fullscreen-change="fullscreenChange"
       >
-        <template v-slot:toolbar>
+        <template v-slot:code="{ row }">
+          <el-link type="primary" :underline="false" @click="goDetail(row)">
+            {{ row.code }}
+          </el-link>
+        </template>
+
+        <template v-slot:action="{ row }">
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除该计划吗?"
+            @confirm="remove(row)"
+          >
+            <template v-slot:reference>
+              <el-link type="danger" :underline="false" icon="el-icon-delete">
+                删除
+              </el-link>
+            </template>
+          </el-popconfirm>
+        </template>
+        <!-- <template v-slot:toolbar>
           <el-button
             size="small"
             type="primary"
@@ -24,7 +43,7 @@
           >
             详情
           </el-button>
-        </template>
+        </template> -->
       </ele-pro-table>
     </el-card>
   </div>
@@ -69,7 +88,7 @@
           {
             prop: 'code',
             label: '需求清单号',
-            width: 100,
+            width: 150,
             align: 'center',
             showOverflowTooltip: true,
             slot: 'code'
@@ -77,172 +96,159 @@
           {
             prop: 'topCategoryCode',
             label: '顶级产品编号',
-            width: 120,
+            width: 150,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'topCategoryCode'
+            showOverflowTooltip: true
           },
           {
             prop: 'topCategoryName',
             label: '顶级产品名称',
-            width: 120,
+            width: 150,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'topCategoryName'
+            showOverflowTooltip: true
           },
 
           {
             prop: 'planCode',
             label: '计划编号',
-            width: 100,
+            width: 150,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'planCode'
+            showOverflowTooltip: true
           },
           {
             prop: 'batchNo',
             label: '批次号',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'batchNo'
+            showOverflowTooltip: true
           },
 
           {
             prop: 'categoryCode',
             label: '编码',
-            width: 100,
+            width: 150,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'categoryCode'
+            showOverflowTooltip: true
           },
           {
             prop: 'categoryName',
             label: '名称',
-            width: 100,
+            width: 140,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'categoryName'
+            showOverflowTooltip: true
           },
           {
             prop: 'type',
             label: '零部件图号',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           },
           {
             prop: 'modelType',
             label: '型号',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'modelType'
+            showOverflowTooltip: true
           },
           {
             prop: 'specification',
             label: '规格',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'specification'
+            showOverflowTooltip: true
           },
           {
             prop: 'categorySize',
             label: '尺寸',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'categorySize'
+            showOverflowTooltip: true
           },
           {
             prop: 'quantity',
             label: '计划数量',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'quantity'
+            showOverflowTooltip: true
           },
           {
             prop: 'measuringUnit',
             label: '计量单位',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'measuringUnit'
+            showOverflowTooltip: true
           },
           {
             prop: 'type',
             label: 'BOM类型',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           },
           {
             prop: 'type',
             label: 'BOM版本',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           },
           {
             prop: 'brandNum',
             label: '牌号',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'brandNum'
+            showOverflowTooltip: true
           },
           {
             prop: 'type',
             label: '加工类型',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           },
           {
             prop: 'type',
             label: '作业名称',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           },
           {
             prop: 'type',
             label: '承制单位',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           },
           {
             prop: 'type',
             label: '计划类别',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           },
           {
             prop: 'type',
             label: '创建人',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           },
           {
             prop: 'createTime',
             label: '创建时间',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'createTime'
+            showOverflowTooltip: true
+          },
+          {
+            label: '操作',
+            width: 80,
+            align: 'center',
+            resizable: false,
+            fixed: 'right',
+            slot: 'action'
           }
         ];
       },
@@ -332,7 +338,23 @@
         }
       },
 
-      detail() {}
+      async remove(row) {
+        const ids = [row.id];
+        await deleteRequirementListPlan(ids).then((res) => {
+          this.$message.success('删除成功');
+          this.reload();
+        });
+      },
+
+      goDetail(item) {
+        this.$router.push({
+          path: '/materialRequirement/requirementListOrder/details',
+          query: {
+            id: item.id,
+            type: 'plan'
+          }
+        });
+      }
     }
   };
 </script>

+ 11 - 2
src/views/workOrder/mixins/release.js

@@ -415,6 +415,9 @@ export default {
           digit = false;
           return;
         }
+
+        console.log(item, '数据');
+
         let Aobj = {
           assigneeId: item.id,
           quantity: item.quantity,
@@ -425,8 +428,14 @@ export default {
           assigneeName: item.name,
           measuringUnit: this.current.measuringUnit,
           isNew: item.isNew ? item.isNew : '',
-          deviceId: item.extInfo.assetId ? item.extInfo.assetId : '',
-          deviceName: item.extInfo.assetName ? item.extInfo.assetName : ''
+          deviceId:
+            item.extInfo && item.extInfo.assetId ? item.extInfo.assetId : '',
+          deviceName:
+            item.extInfo && item.extInfo.assetName
+              ? item.extInfo.assetName
+              : '',
+          workStationId: item.id,
+          workStationName: item.name
         };
         if (item.teamTimeIds) {
           Aobj.teamTimeIds = item.teamTimeIds;