695593266@qq.com 5 mesiacov pred
rodič
commit
ce4e51c8e9

+ 4 - 2
src/api/requirementListPlan/index.js

@@ -10,8 +10,10 @@ export async function getRequirementListPlan(data) {
 }
 
 // 获取需求计划-详情分页
-export async function getRequirementListPlanDetailPage(data) {
-  const res = await request.get('/aps/materialrequirements/detailPage', data);
+export async function getRequirementListPlanDetailPage(params) {
+  const res = await request.get('/aps/materialrequirements/detailPage', {
+    params
+  });
   if (res.data.code == 0) {
     return res.data.data;
   }

+ 0 - 353
src/views/materialRequirement/requirementListOrder/index.vue

@@ -1,353 +0,0 @@
-<template>
-  <div class="ele-body">
-    <el-card shadow="never" v-loading="loading">
-      <seek-page :seekList="seekList" @search="search"></seek-page>
-
-      <ele-pro-table
-        ref="table"
-        :columns="columns"
-        :datasource="datasource"
-        :selection.sync="selection"
-        row-key="id"
-        cache-key="entrust_list_data"
-        :height="tableHeight"
-        :pageSize="20"
-        @fullscreen-change="fullscreenChange"
-      >
-        <template v-slot:toolbar>
-          <el-button
-            size="small"
-            type="primary"
-            icon="el-icon-plus"
-            class="ele-btn-icon"
-            @click="detail"
-          >
-            详情
-          </el-button>
-        </template>
-      </ele-pro-table>
-    </el-card>
-  </div>
-</template>
-
-<script>
-  import dictMixins from '@/mixins/dictMixins';
-  export default {
-    mixins: [dictMixins],
-    data() {
-      return {
-        loading: false,
-        factoryList: [],
-        selection: [],
-        tableHeight: 'calc(100vh - 320px)'
-      };
-    },
-
-    computed: {
-      columns() {
-        return [
-          {
-            columnKey: 'selection',
-            type: 'selection',
-            width: 45,
-            align: 'center',
-            fixed: 'left'
-          },
-          {
-            columnKey: 'index',
-            label: '序号',
-            type: 'index',
-            width: 55,
-            align: 'center',
-            showOverflowTooltip: true,
-            fixed: 'left'
-          },
-          {
-            prop: 'type',
-            label: '需求订单号',
-            width: 100,
-            align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
-          },
-          {
-            prop: 'type',
-            label: '顶级产品编号',
-            width: 120,
-            align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
-          },
-          {
-            prop: 'type',
-            label: '顶级产品名称',
-            width: 120,
-            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'
-          },
-          {
-            prop: 'type',
-            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'
-          },
-          {
-            prop: 'type',
-            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'
-          },
-          {
-            prop: 'type',
-            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'
-          },
-          {
-            prop: 'type',
-            label: '计量单位',
-            width: 100,
-            align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
-          },
-          {
-            prop: 'type',
-            label: 'BOM类型',
-            width: 100,
-            align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
-          },
-          {
-            prop: 'type',
-            label: 'BOM版本',
-            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'
-          },
-          {
-            prop: 'type',
-            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'
-          },
-          {
-            prop: 'type',
-            label: '投料控制清单号',
-            width: 120,
-            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'
-          }
-        ];
-      },
-
-      seekList() {
-        return [
-          {
-            label: '计划编号:',
-            value: 'name',
-            type: 'input',
-            labelWidth: 100
-          },
-          {
-            label: '批次号:',
-            value: 'name',
-            type: 'input',
-            labelWidth: 80
-          },
-          {
-            label: '编码:',
-            value: 'name',
-            type: 'input',
-            labelWidth: 50
-          },
-          {
-            label: '需求订单号:',
-            value: 'name',
-            type: 'input',
-            labelWidth: 100
-          },
-          {
-            label: '顶级产品编号:',
-            value: 'name',
-            type: 'input',
-            labelWidth: 100
-          },
-          {
-            label: '顶级产品名称:',
-            value: 'name',
-            type: 'input',
-            labelWidth: 100
-          },
-          {
-            label: '计划状态:',
-            value: 'name',
-            type: 'select',
-            labelWidth: 100,
-            planList: this.factoryList
-          },
-          {
-            label: '计划类别:',
-            value: 'name',
-            type: 'select',
-            labelWidth: 100,
-            planList: this.factoryList
-          },
-          {
-            label: '承制单位:',
-            value: 'name',
-            type: 'select',
-            labelWidth: 100,
-            planList: this.factoryList
-          }
-        ];
-      }
-    },
-
-    methods: {
-      datasource() {},
-
-      search() {},
-
-      fullscreenChange(fullscreen) {
-        if (fullscreen) {
-          this.tableHeight = 'calc(100vh - 120px)';
-        } else {
-          this.tableHeight = 'calc(100vh - 320px)';
-        }
-      },
-
-      detail() {
-        this.$router.push({
-          path: '/materialRequirement/requirementListOrder/details'
-        });
-      }
-    }
-  };
-</script>
-
-<style></style>

+ 99 - 64
src/views/materialRequirement/requirementListOrder/details.vue → src/views/requirementListPlan/details.vue

@@ -43,7 +43,7 @@
 
           <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.imgCode" disabled></el-input>
             </el-form-item>
           </el-col>
 
@@ -88,14 +88,7 @@
               <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"
-            v-if="$route.query.type == 'order'"
-          >
+          <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>
@@ -105,17 +98,45 @@
 
       <seek-page :seekList="seekList" @search="search"></seek-page>
 
+      <!--feedingControlQty -->
+
       <ele-pro-table
         ref="table"
         :columns="columns"
-        :datasource="datasource"
+        :datasource="detailList"
         :selection.sync="selection"
         row-key="id"
         cache-key="entrust_list_data"
         :height="tableHeight"
         :pageSize="20"
         @fullscreen-change="fullscreenChange"
-      ></ele-pro-table>
+      >
+        <template #quantity="{ row }">
+          <span
+            >{{ row.feedingControlQty ? row.feedingControlQty : 0 }}/{{
+              row.quantity ? row.quantity : 0
+            }}</span
+          >
+        </template>
+
+        <template #componentAttribute="{ row }">
+          <el-tag size="small">{{
+            componentAttributeMap[row.componentAttribute]
+          }}</el-tag>
+        </template>
+
+        <template #attributeType="{ row }">
+          <el-tag type="success" size="small">{{
+            attributeTypeMap[row.attributeType]
+          }}</el-tag>
+        </template>
+
+        <template #produceType="{ row }">
+          <el-tag type="warning" size="small">{{
+            produceTypeMap[row.produceType]
+          }}</el-tag></template
+        >
+      </ele-pro-table>
     </el-card>
   </div>
 </template>
@@ -132,20 +153,40 @@
         form: {},
         rules: {},
         tableHeight: 'calc(100vh - 560px)',
-        selection: []
+        selection: [],
+        detailList: [],
+
+        componentAttributeMap: {
+          1: '自制件',
+          2: '采购件',
+          3: '外协件',
+          4: '受托件'
+        },
+
+        attributeTypeMap: {
+          1: '总装',
+          2: '部装',
+          3: '零件',
+          4: '原材料'
+        },
+        produceTypeMap: {
+          1: '加工',
+          2: '装配',
+          3: '下料'
+        }
       };
     },
 
     computed: {
       columns() {
         return [
-          {
-            columnKey: 'selection',
-            type: 'selection',
-            width: 45,
-            align: 'center',
-            fixed: 'left'
-          },
+          // {
+          //   columnKey: 'selection',
+          //   type: 'selection',
+          //   width: 45,
+          //   align: 'center',
+          //   fixed: 'left'
+          // },
           {
             columnKey: 'index',
             label: '序号',
@@ -156,12 +197,11 @@
             fixed: 'left'
           },
           {
-            prop: 'categoryLevelId',
+            prop: 'categoryLevelName',
             label: '物料分类',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'categoryLevelId'
+            showOverflowTooltip: true
           },
           ,
           {
@@ -241,21 +281,20 @@
           },
 
           {
-            prop: 'type',
+            prop: 'baseQuantity',
             label: '基本数量',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           },
 
           {
-            prop: 'type',
+            prop: 'quantity',
             label: '投料控制数量/定额数量',
             width: 190,
             align: 'center',
             showOverflowTooltip: true,
-            slot: 'type'
+            slot: 'quantity'
           },
 
           {
@@ -347,42 +386,40 @@
           },
 
           {
-            prop: 'type',
+            prop: 'createUserName',
             label: '创建人',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           },
 
           {
-            prop: 'type',
+            prop: 'createTime',
             label: '创建时间',
             width: 100,
             align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            showOverflowTooltip: true
           }
         ];
       },
 
       seekList() {
         return [
-          {
-            label: '计划编号:',
-            value: 'name',
-            type: 'input',
-            labelWidth: 100
-          },
-          {
-            label: '批次号:',
-            value: 'name',
-            type: 'input',
-            labelWidth: 80
-          },
+          // {
+          //   label: '计划编号:',
+          //   value: 'name',
+          //   type: 'input',
+          //   labelWidth: 100
+          // },
+          // {
+          //   label: '批次号:',
+          //   value: 'name',
+          //   type: 'input',
+          //   labelWidth: 80
+          // },
           {
             label: '编码:',
-            value: 'name',
+            value: 'categoryCode',
             type: 'input',
             labelWidth: 50
           }
@@ -391,11 +428,18 @@
     },
 
     mounted() {
-      this.getDetailData();
-      this.getDetailPage();
+      this.initPage();
     },
 
     methods: {
+      initPage() {
+        const { id, type } = this.$route.query;
+        if (!id || type !== 'plan') return;
+
+        this.getDetailData(id);
+        this.getDetailPage(id);
+      },
+
       datasource() {
         return [];
       },
@@ -416,24 +460,15 @@
         });
       },
 
-      async getDetailData() {
-        const URL =
-          this.$route.query.type == 'plan' ? getRequirementListPlanDetail : '';
-
-        await URL(this.$route.query.id).then((res) => {
-          this.form = res;
-        });
+      async getDetailData(id) {
+        this.form = (await getRequirementListPlanDetail(id)) || {};
       },
 
-      async getDetailPage() {
-        const URL =
-          this.$route.query.type == 'plan'
-            ? getRequirementListPlanDetailPage
-            : '';
-
-        await URL({ materialRequirementsId: this.$route.query.id }).then(
-          (res) => {}
-        );
+      async getDetailPage(id) {
+        const res = await getRequirementListPlanDetailPage({
+          materialRequirementsId: id
+        });
+        this.detailList = res?.list || [];
       },
 
       fullscreenChange(fullscreen) {

+ 1 - 15
src/views/materialRequirement/requirementListPlan/index.vue → src/views/requirementListPlan/index.vue

@@ -179,20 +179,6 @@
             align: 'center',
             showOverflowTooltip: true
           },
-          {
-            prop: 'type',
-            label: 'BOM类型',
-            width: 100,
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'type',
-            label: 'BOM版本',
-            width: 100,
-            align: 'center',
-            showOverflowTooltip: true
-          },
           {
             prop: 'brandNum',
             label: '牌号',
@@ -348,7 +334,7 @@
 
       goDetail(item) {
         this.$router.push({
-          path: '/materialRequirement/requirementListOrder/details',
+          path: '/requirementListPlan/details',
           query: {
             id: item.id,
             type: 'plan'