ysy пре 1 година
родитељ
комит
7b5e43148e

+ 167 - 0
src/views/produce/components/productionResource/columnsTab.js

@@ -0,0 +1,167 @@
+export const produceColumns = [{
+    prop: 'sort',
+
+    label: '排序',
+    minWidth: 60
+  },
+  {
+    prop: 'code',
+    label: '参数编码',
+    showOverflowTooltip: true,
+    align: 'center',
+    minWidth: 110
+  },
+  {
+    prop: 'name',
+    label: '参数名称',
+    showOverflowTooltip: true,
+    align: 'center',
+    minWidth: 110
+  },
+  {
+    align: 'center',
+    prop: 'description',
+    label: '文本描述',
+    showOverflowTooltip: true,
+    minWidth: 110
+  },
+
+  {
+    prop: 'maxValue',
+    label: '参数上限',
+    align: 'center'
+  },
+  {
+    prop: 'minValue',
+
+    label: '参数下限',
+    align: 'center'
+  },
+  {
+    prop: 'defaultValue',
+    label: '默认值',
+    align: 'center'
+  }
+]
+
+export const materialQuotaColumns = [{
+    label: '子项编号',
+    prop: 'subCode',
+    action: 'subCode'
+  },
+  {
+    label: '物料名称',
+    prop: 'categoryName',
+
+    action: 'categoryName'
+  },
+  {
+    label: '是否回收料',
+    prop: 'isReworkBom',
+    slot: 'isReworkBom',
+    action: 'isReworkBom'
+  },
+  {
+    label: '编码',
+    prop: 'categoryCode'
+  },
+  {
+    label: '牌号',
+    prop: 'brandNum'
+  },
+  {
+    label: '型号',
+    prop: 'modelType'
+  },
+  {
+    label: '数量',
+    prop: 'count',
+    action: 'count'
+  },
+  {
+    label: '单位',
+    prop: 'unit',
+    action: 'unit'
+  },
+
+  {
+    label: '附件',
+    slot: 'bomArtFiles',
+    action: 'bomArtFiles',
+    minWidth: 150
+  },
+
+  {
+    label: '备注',
+    prop: 'remark',
+    action: 'remark'
+  }
+]
+
+
+export const fileParamColumns = [
+
+  {
+    slot: 'type',
+    prop: 'type',
+    label: '类型',
+    showOverflowTooltip: true,
+    align: 'center',
+    minWidth: 110
+  },
+  {
+    slot: 'code',
+    prop: 'code',
+    label: '编码',
+    showOverflowTooltip: true,
+    align: 'center',
+    minWidth: 110
+  },
+  {
+    slot: 'name',
+    prop: 'name',
+    label: '名称',
+    showOverflowTooltip: true,
+    align: 'center',
+    minWidth: 110
+  },
+  {
+    slot: 'path',
+    prop: 'path',
+    label: '附件',
+    showOverflowTooltip: true,
+    align: 'center',
+    minWidth: 200
+  },
+  {
+    slot: 'versions',
+    prop: 'versions',
+    label: '版本',
+    showOverflowTooltip: true,
+    align: 'center',
+    minWidth: 110
+  },
+  {
+    slot: 'status',
+    prop: 'status',
+    label: '状态',
+    showOverflowTooltip: true,
+    align: 'center',
+    minWidth: 110
+  },
+  {
+    prop: 'createName',
+    label: '创建人',
+    showOverflowTooltip: true,
+    align: 'center',
+    minWidth: 110
+  },
+  {
+    prop: 'createTime',
+    label: '创建时间',
+    showOverflowTooltip: true,
+    align: 'center',
+    minWidth: 110
+  },
+
+]

+ 213 - 0
src/views/produce/components/productionResource/components/beatInfo.vue

@@ -0,0 +1,213 @@
+<template>
+  <div class="box_height">
+  <div >
+    <el-form label-width="100px" ref="form" :model="beatParam">
+            <el-row>
+              <el-col :span="16" label-width="100px">
+                <el-form-item label="节拍生产数量" prop="beatNum">
+                  <el-input
+                    v-if="!isView"
+                    placeholder=""
+                    v-model="beatParam.beatNum"
+                  ></el-input>
+                  <div v-else>{{ beatParam.beatNum }}</div>
+                </el-form-item>
+              </el-col>
+
+              <el-col :span="8" label-width="100px">
+                <el-form-item label="单位" prop="beatUnit">
+                  <el-input
+                    v-if="!isView"
+                    placeholder=""
+                    v-model="beatParam.beatUnit"
+                  ></el-input>
+                  <div v-else>{{ beatParam.beatUnit }}</div>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="16" label-width="100px">
+                <el-form-item label="对应物料数量" prop="materielNum">
+                  <el-input
+                    v-if="!isView"
+                    placeholder=""
+                    v-model="beatParam.materielNum"
+                  ></el-input>
+                  <div v-else>{{ beatParam.materielNum }}</div>
+                </el-form-item>
+              </el-col>
+
+              <el-col :span="8" label-width="100px">
+                <el-form-item label="单位" prop="materielUnit">
+                  <el-input
+                    v-if="!isView"
+                    placeholder=""
+                    v-model="beatParam.materielUnit"
+                  ></el-input>
+                  <div v-else>{{ beatParam.materielUnit }}</div>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="16" label-width="100px">
+                <el-form-item label="节拍时间" prop="beatTime">
+                  <el-input
+                    v-if="!isView"
+                    placeholder=""
+                    v-model="beatParam.beatTime"
+                  ></el-input>
+                  <div v-else>{{ beatParam.beatTime }}</div>
+                </el-form-item>
+              </el-col>
+
+              <el-col :span="8" label-width="100px">
+                <el-form-item label="单位" prop="beatTimeUnit">
+                  <el-input
+                    v-if="!isView"
+                    placeholder=""
+                    v-model="beatParam.beatTimeUnit"
+                  ></el-input>
+                  <div v-else>{{ beatParam.beatTimeUnit }}</div>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="16" label-width="100px">
+                <el-form-item label="节拍准备时长" prop="name">
+                  <el-input
+                    v-if="!isView"
+                    placeholder=""
+                    v-model="beatParam.beatPrepareTime"
+                  ></el-input>
+                  <div v-else>{{ beatParam.beatPrepareTime }}</div>
+                </el-form-item>
+              </el-col>
+
+              <el-col :span="8" label-width="100px">
+                <el-form-item label="单位" prop="name">
+                  <el-input
+                    v-if="!isView"
+                    placeholder=""
+                    v-model="beatParam.beatPrepareUnit"
+                  ></el-input>
+                  <div v-else>{{ beatParam.beatPrepareUnit }}</div>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="16" label-width="100px">
+                <el-form-item label="节拍休息时长" prop="name">
+                  <el-input
+                    v-if="!isView"
+                    placeholder=""
+                    v-model="beatParam.beatRestTime"
+                  ></el-input>
+                  <div v-else>{{ beatParam.beatRestTime }}</div>
+                </el-form-item>
+              </el-col>
+
+              <el-col :span="8" label-width="100px">
+                <el-form-item label="单位" prop="name">
+                  <el-input
+                    v-if="!isView"
+                    placeholder=""
+                    v-model="beatParam.beatRestUnit"
+                  ></el-input>
+                  <div v-else>{{ beatParam.beatRestUnit }}</div>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="24" label-width="100px">
+                <el-form-item label="备注" prop="remark">
+                  <el-input
+                    v-if="!isView"
+                    placeholder=""
+                    v-model="beatParam.remark"
+                    type="textarea"
+                    :rows="4"
+                  ></el-input>
+                  <div v-else>{{ beatParam.remark }}</div>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="8" label-width="100px">
+                <el-form-item label="添加人" prop="name">
+                  <el-input
+                    v-if="!isView"
+                    placeholder=""
+                    disabled
+                    v-model="beatParam.createName"
+                  ></el-input>
+                  <div v-else>{{ beatParam.createName }}</div>
+                </el-form-item>
+              </el-col>
+
+              <el-col :span="8" label-width="100px">
+                <el-form-item label="添加时间" prop="name">
+                  <el-input
+                    v-if="!isView"
+                    placeholder=""
+                    disabled
+                    v-model="beatParam.createTime"
+                  ></el-input>
+                  <div v-else>{{ beatParam.createTime }}</div>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="8" label-width="100px">
+                <el-form-item label="修改人" prop="name">
+                  <el-input
+                    v-if="!isView"
+                    placeholder=""
+                    disabled
+                    v-model="beatParam.updateName"
+                  ></el-input>
+                  <div v-else>{{ beatParam.updateName }}</div>
+                </el-form-item>
+              </el-col>
+
+              <el-col :span="8" label-width="100px">
+                <el-form-item label="最后修改时间" prop="name">
+                  <el-input
+                    v-if="!isView"
+                    placeholder=""
+                    disabled
+                    v-model="beatParam.updateTime"
+                  ></el-input>
+                  <div v-else>{{ beatParam.updateTime }}</div>
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+  </div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "beatParam",
+
+  props: {
+    beatParam: Object,
+  },
+  data() {
+    return {
+      beatParam: {},
+      isView: true
+    };
+   }
+};
+
+</script>
+
+<style scoped lang="scss">
+
+.box_height{
+  padding: 8px 20px;
+  height: 300px;
+  overflow-y: scroll;
+}
+</style>

+ 70 - 0
src/views/produce/components/productionResource/components/normalHoursInfo.vue

@@ -0,0 +1,70 @@
+<template>
+    <div class="box_height">
+    <div >
+        <el-form label-width="100px" ref="form" :model="normalHours">
+            <el-row>
+              <el-col :span="16" label-width="100px">
+                <el-form-item label="标准时长" prop="type">
+                  <el-input
+                    v-if="!isView"
+                    placeholder="标准时长"
+                    v-model="normalHours.time"
+                  ></el-input>
+                  <div v-else>{{ normalHours.time }}</div>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8" label-width="100px">
+                <el-form-item label="单位" prop="type">
+                  <el-input
+                    v-if="!isView"
+                    placeholder="单位"
+                    v-model="normalHours.unit"
+                  ></el-input>
+                  <div v-else>{{ normalHours.unit }}</div>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="24" label-width="100px">
+                <el-form-item label="备注" prop="remark">
+                  <el-input
+                    v-if="!isView"
+                    placeholder=""
+                    v-model="normalHours.remark"
+                    type="textarea"
+                    :rows="4"
+                  ></el-input>
+                  <div v-else>{{ normalHours.remark }}</div>
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+    </div>
+    </div>
+  </template>
+  
+  <script>
+  export default {
+    name: "normalHours",
+  
+    props: {
+        normalHours: Object,
+    },
+    data() {
+      return {
+
+        isView: true
+      };
+     }
+  };
+  
+  </script>
+  
+  <style scoped lang="scss">
+  
+  .box_height{
+    padding: 8px 20px;
+    height: 300px;
+    overflow-y: scroll;
+  }
+  </style>

+ 149 - 18
src/views/produce/components/productionResource/index.vue

@@ -1,32 +1,149 @@
 <template>
   <div>
-    <el-tabs v-model="activeName" type="border-card">
-      <el-tab-pane label="工艺路线" name="1" lazy>
-        {{ newBomObj.id }}
-      </el-tab-pane>
-      <el-tab-pane lazy label="工艺参数" name="2"></el-tab-pane>
-      <el-tab-pane lazy label="质检参数" name="3"></el-tab-pane>
-      <el-tab-pane lazy label="生产节拍" name="4"></el-tab-pane>
-      <el-tab-pane lazy label="标准工时" name="5"></el-tab-pane>
-      <el-tab-pane lazy label="材料定额" name="6"></el-tab-pane>
-      <el-tab-pane lazy label="制造资源" name="7"></el-tab-pane>
-      <el-tab-pane lazy label="替代料" name="8"></el-tab-pane>
-      <el-tab-pane lazy label="资质" name="9"></el-tab-pane>
-      <el-tab-pane lazy label="制造资源" name="10"></el-tab-pane>
+    <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>
+      </el-tab-pane>
+      <el-tab-pane lazy label="质检参数" name="质检参数"></el-tab-pane>
+      <el-tab-pane lazy label="生产节拍" name="生产节拍">
+        <beatInfo :beatParam="newBomObj.beatParam"></beatInfo>
+      </el-tab-pane>
+      <el-tab-pane lazy label="标准工时" name="标准工时">
+        <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"
+        >
+          <template v-slot:toolbar>
+            基本数量:
+            <span style="color: rgb(21, 122, 44)">
+              {{ newBomObj.baseCount }} {{ newBomObj.baseCountUnit }}</span
+            >
+          </template>
+
+          <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
+            >
+          </template>
+        </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"
+        >
+          <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
+            >
+          </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"
+        >
+          <template v-slot:toolbar>
+            基本数量:
+            <span style="color: rgb(21, 122, 44)">
+              {{ newBomObj.baseCount2 }} {{ newBomObj.baseCountUnit2 }}</span
+            >
+          </template>
+
+          <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
+            >
+          </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>
+      </el-tab-pane>
+      <el-tab-pane lazy label="工艺文件" name="工艺文件">
+        {{ newBomObj.fileParam }}
+      </el-tab-pane>
+      <el-tab-pane lazy label="标准产出" name="标准产出">
+        {{ newBomObj.standardOutput }}
+      </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: {},
+    components: {
+      beatInfo,
+      normalHoursInfo
+    },
 
     props: {
       BomObj: {
         type: Object
-
+      }
     },
-  },
 
     watch: {
       BomObj: {
@@ -42,9 +159,23 @@
 
     data() {
       return {
-        activeName: '1',
-        newBomObj: {}
+        activeName: '工艺参数',
+        newBomObj: {},
+
+        produceColumns,
+        materialQuotaColumns,
+        fileParamColumns
       };
+    },
+
+    methods: {
+      tabsChange(tab) {
+        this.activeName = tab.name;
+      },
+
+      downloadFile(url) {
+        getFile({ objectName: url }, '附件');
+      }
     }
   };
 </script>