ysy hace 1 año
padre
commit
2a7cc9ba0c

+ 84 - 5
src/views/produce/components/productionResource/columnsTab.js

@@ -98,11 +98,53 @@ export const materialQuotaColumns = [{
   }
 ]
 
+export const aptitudeParamColumns = [
 
+    {
+        prop: 'type',
+      label: '类型',
+      showOverflowTooltip: true,
+      align: 'center',
+      minWidth: 110,
+     
+    },
+    {
+      align: 'center',
+      prop: 'code',
+      label: '编码',
+      showOverflowTooltip: true,
+      minWidth: 110
+    },
+    {
+
+      prop: 'name',
+      label: '名称',
+      showOverflowTooltip: true,
+      align: 'center',
+      minWidth: 110
+    },
+    {
+
+      prop: 'level',
+      label: '等级',
+      showOverflowTooltip: true,
+      align: 'center',
+      minWidth: 110,
+
+    },
+    {
+      prop: 'hourCost',
+      label: '标准工时费',
+      showOverflowTooltip: true,
+      align: 'center',
+      minWidth: 110
+    },
+
+  ]
 export const fileParamColumns = [
 
   {
-    slot: 'type',
+
     prop: 'type',
     label: '类型',
     showOverflowTooltip: true,
@@ -110,7 +152,7 @@ export const fileParamColumns = [
     minWidth: 110
   },
   {
-    slot: 'code',
+
     prop: 'code',
     label: '编码',
     showOverflowTooltip: true,
@@ -118,7 +160,7 @@ export const fileParamColumns = [
     minWidth: 110
   },
   {
-    slot: 'name',
+
     prop: 'name',
     label: '名称',
     showOverflowTooltip: true,
@@ -134,7 +176,7 @@ export const fileParamColumns = [
     minWidth: 200
   },
   {
-    slot: 'versions',
+
     prop: 'versions',
     label: '版本',
     showOverflowTooltip: true,
@@ -142,7 +184,7 @@ export const fileParamColumns = [
     minWidth: 110
   },
   {
-    slot: 'status',
+
     prop: 'status',
     label: '状态',
     showOverflowTooltip: true,
@@ -165,3 +207,40 @@ export const fileParamColumns = [
   },
 
 ]
+
+export const standardColumns =   [
+    {
+      prop: 'code',
+      label: '编码'
+    },
+    {
+      prop: 'name',
+      label: '名称',
+      showOverflowTooltip: true
+    },
+    {
+      prop: 'brandNum',
+      label: '牌号'
+    },
+
+    {
+      prop: 'modelType',
+      label: '型号',
+      align: 'center',
+      showOverflowTooltip: true
+    },
+    {
+      prop: 'specification',
+      label: '规格',
+      align: 'center',
+      showOverflowTooltip: true
+    },
+    {
+      prop: 'measuringUnit',
+      label: '计量单位',
+      showOverflowTooltip: true,
+      minWidth: 90
+    },
+
+
+  ]

+ 88 - 116
src/views/produce/components/productionResource/index.vue

@@ -2,14 +2,8 @@
   <div>
     <el-tabs v-model="activeName" type="border-card" @tab-click="tabsChange">
       <el-tab-pane lazy label="工艺参数" name="工艺参数">
-        <ele-pro-table
-          ref="table"
-          :datasource="newBomObj.produceList"
-          :immediate="true"
-          :need-page="false"
-          :columns="produceColumns"
-          height="260px"
-        >
+        <ele-pro-table ref="table" :datasource="newBomObj.produceList" :immediate="true" :need-page="false"
+          :columns="produceColumns" height="260px">
         </ele-pro-table>
       </el-tab-pane>
       <el-tab-pane lazy label="质检参数" name="质检参数"></el-tab-pane>
@@ -20,19 +14,12 @@
         <normalHoursInfo :normalHours="newBomObj.normalHours"></normalHoursInfo>
       </el-tab-pane>
       <el-tab-pane lazy label="材料定额" name="材料定额">
-        <ele-pro-table
-          ref="materialQuotaTable"
-          :columns="materialQuotaColumns"
-          :datasource="newBomObj.materialQuota"
-          :need-page="false"
-          :immediate="true"
-          height="260px"
-        >
+        <ele-pro-table ref="materialQuotaTable" :columns="materialQuotaColumns" :datasource="newBomObj.materialQuota"
+          :need-page="false" :immediate="true" height="260px">
           <template v-slot:toolbar>
             基本数量:
             <span style="color: rgb(21, 122, 44)">
-              {{ newBomObj.baseCount }} {{ newBomObj.baseCountUnit }}</span
-            >
+              {{ newBomObj.baseCount }} {{ newBomObj.baseCountUnit }}</span>
           </template>
 
           <template v-slot:isReworkBom="{ row }">
@@ -40,52 +27,36 @@
           </template>
 
           <template v-slot:bomArtFiles="{ row }">
-            <el-button
-              size="mini"
-              type="primary"
-              @click="downloadFile(row.bomArtFiles)"
-              >下载</el-button
-            >
+            <el-button size="mini" type="primary" @click="downloadFile(row.bomArtFiles)">下载</el-button>
           </template>
         </ele-pro-table>
       </el-tab-pane>
+
+      <el-tab-pane lazy label="关键设备" name="关键设备">
+        <ele-pro-table ref="standardDeviceTable" :columns="standardColumns" :datasource="newBomObj.standardDevice"
+          row-key="id" height="260px">
+        </ele-pro-table>
+      </el-tab-pane>
+
       <el-tab-pane lazy label="制造资源" name="制造资源">
-        <ele-pro-table
-          ref="resourceTable"
-          :columns="materialQuotaColumns"
-          :datasource="newBomObj.resource"
-          :need-page="false"
-          :immediate="true"
-          height="260px"
-        >
+        <ele-pro-table ref="resourceTable" :columns="materialQuotaColumns" :datasource="newBomObj.resource"
+          :need-page="false" :immediate="true" height="260px">
           <template v-slot:isReworkBom="{ row }">
             {{ row.isReworkBom ? '是' : '否' }}
           </template>
 
           <template v-slot:bomArtFiles="{ row }">
-            <el-button
-              size="mini"
-              type="primary"
-              @click="downloadFile(row.bomArtFiles)"
-              >下载</el-button
-            >
+            <el-button size="mini" type="primary" @click="downloadFile(row.bomArtFiles)">下载</el-button>
           </template>
         </ele-pro-table>
       </el-tab-pane>
       <el-tab-pane lazy label="替代料" name="替代料">
-        <ele-pro-table
-          ref="replaceMaterialTable"
-          :columns="materialQuotaColumns"
-          :datasource="newBomObj.replaceMaterial"
-          :need-page="false"
-          :immediate="true"
-          height="260px"
-        >
+        <ele-pro-table ref="replaceMaterialTable" :columns="materialQuotaColumns"
+          :datasource="newBomObj.replaceMaterial" :need-page="false" :immediate="true" height="260px">
           <template v-slot:toolbar>
             基本数量:
             <span style="color: rgb(21, 122, 44)">
-              {{ newBomObj.baseCount2 }} {{ newBomObj.baseCountUnit2 }}</span
-            >
+              {{ newBomObj.baseCount2 }} {{ newBomObj.baseCountUnit2 }}</span>
           </template>
 
           <template v-slot:isReworkBom="{ row }">
@@ -93,95 +64,96 @@
           </template>
 
           <template v-slot:bomArtFiles="{ row }">
-            <el-button
-              size="mini"
-              type="primary"
-              @click="downloadFile(row.bomArtFiles)"
-              >下载</el-button
-            >
+            <el-button size="mini" type="primary" @click="downloadFile(row.bomArtFiles)">下载</el-button>
           </template>
         </ele-pro-table>
       </el-tab-pane>
       <el-tab-pane lazy label="工种" name="工种">
-        <ele-pro-table
-          ref="aptitudeParamTable"
-          :columns="fileParamColumns"
-          :datasource="newBomObj.aptitudeParam"
-          row-key="id"
-                    height="260px"
-        >
+        <ele-pro-table ref="aptitudeParamTable" :columns="aptitudeParamColumns" :datasource="newBomObj.aptitudeParam"
+          row-key="id" height="260px">
         </ele-pro-table>
       </el-tab-pane>
       <el-tab-pane lazy label="工艺文件" name="工艺文件">
-        {{ newBomObj.fileParam }}
+        <ele-pro-table ref="fileParamTable" :columns="fileParamColumns" :datasource="newBomObj.fileParam" row-key="id"
+          height="260px">
+          <template v-slot:path="{ row }">
+            <el-button v-if="row.path" size="mini" type="primary" @click="downloadFile(row.path)">下载</el-button>
+          </template>
+        </ele-pro-table>
       </el-tab-pane>
       <el-tab-pane lazy label="标准产出" name="标准产出">
-        {{ newBomObj.standardOutput }}
+        <ele-pro-table ref="standardTable" :columns="standardColumns" :datasource="newBomObj.standardOutput"
+          row-key="id" height="260px">
+        </ele-pro-table>
       </el-tab-pane>
     </el-tabs>
   </div>
 </template>
 
 <script>
-  import {
-    produceColumns,
-    materialQuotaColumns,
-    fileParamColumns
-  } from './columnsTab.js';
-
-  import beatInfo from './components/beatInfo.vue';
-  import normalHoursInfo from './components/normalHoursInfo.vue';
-
-  import { getFile } from '@/api/system/file';
-  export default {
-    components: {
-      beatInfo,
-      normalHoursInfo
-    },
-
-    props: {
-      BomObj: {
-        type: Object
-      }
-    },
-
-    watch: {
-      BomObj: {
-        handler(val) {
-          this.newBomObj = JSON.parse(JSON.stringify(val));
-
-          this.$forceUpdate();
-        },
-        immediate: true,
-        deep: true
-      }
-    },
-
-    data() {
-      return {
-        activeName: '工艺参数',
-        newBomObj: {},
+import {
+  produceColumns,
+  materialQuotaColumns,
+  aptitudeParamColumns,
+  fileParamColumns,
+  standardColumns
+} from './columnsTab.js';
+
+import beatInfo from './components/beatInfo.vue';
+import normalHoursInfo from './components/normalHoursInfo.vue';
+
+import { getFile } from '@/api/system/file';
+export default {
+  components: {
+    beatInfo,
+    normalHoursInfo
+  },
+
+  props: {
+    BomObj: {
+      type: Object
+    }
+  },
 
-        produceColumns,
-        materialQuotaColumns,
-        fileParamColumns
-      };
-    },
+  watch: {
+    BomObj: {
+      handler(val) {
+        this.newBomObj = JSON.parse(JSON.stringify(val));
 
-    methods: {
-      tabsChange(tab) {
-        this.activeName = tab.name;
+        this.$forceUpdate();
       },
+      immediate: true,
+      deep: true
+    }
+  },
+
+  data() {
+    return {
+      activeName: '工艺参数',
+      newBomObj: {},
+
+      produceColumns,
+      materialQuotaColumns,
+      aptitudeParamColumns,
+      fileParamColumns,
+      standardColumns
+    };
+  },
+
+  methods: {
+    tabsChange(tab) {
+      this.activeName = tab.name;
+    },
 
-      downloadFile(url) {
-        getFile({ objectName: url }, '附件');
-      }
+    downloadFile(url) {
+      getFile({ objectName: url }, '附件');
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss">
-  .el-tabs__content {
-    padding: 4px !important;
-  }
+.el-tabs__content {
+  padding: 4px !important;
+}
 </style>