ysy hace 1 año
padre
commit
f31417ce61

+ 3 - 0
src/api/produce/index.js

@@ -0,0 +1,3 @@
+import request from '@/utils/request';
+
+

+ 12 - 0
src/api/produce/workOrder.js

@@ -0,0 +1,12 @@
+import request from '@/utils/request';
+
+
+
+// 工单列表
+export async function workorderPage(data) {
+  const res = await request.post('/pda/mes/workorder/page', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

BIN
src/assets/Frame.png


+ 1 - 0
src/styles/index.scss

@@ -3,3 +3,4 @@ $--ele-font-path: '~ele-admin/es/style/fonts';
 @import '~ele-admin/es/style/themes/dynamic.scss';
 @import '~ele-admin/es/style/index.scss';
 @import './transition/index.scss';
+

+ 114 - 0
src/views/produce/components/footBtn.vue

@@ -0,0 +1,114 @@
+<template>
+    <div class="foot_box">
+      <div v-for="(item, index) in btnList" :key="index" class="btn" :style="{'background': item.bjColor}">
+        <img src="../../../assets/Frame.png" class="Frame">
+        {{ item.name }}
+      </div>
+    </div>
+</template>
+
+<script>
+export default {
+    data() {
+        return {
+          btnList: [
+            {
+                name: '领料',
+                type: '',
+                bjColor: '#FC1B75'
+            },
+            {
+                name: '投料',
+                type: '',
+                bjColor: '#FBD114'
+            },
+
+            {
+                name: '报工',
+                type: '',
+                bjColor: '#157A2C'
+            },
+
+            {
+                name: '请托',
+                type: '',
+                bjColor: '#3490DE'
+            },
+
+            {
+                name: '委外',
+                type: '',
+                bjColor: '#39D9AC'
+            },
+
+            {
+                name: '副产品回收',
+                type: '',
+                bjColor: '#6639A6'
+            },
+
+            {
+                name: '暂停',
+                type: '',
+                bjColor: '#858585'
+            },
+
+            {
+                name: '异常',
+                type: '',
+                bjColor: '#FF4D4F'
+            },
+            
+            {
+                name: '交接',
+                type: '',
+                bjColor: '#2B56C2'
+            }
+
+
+          ]
+        };
+    },
+    created() {
+
+    },
+    methods: {
+
+    }
+};
+</script>
+
+<style lang="scss" scoped>
+.foot_box{
+    min-width: 1280px;
+    width: 100%;
+    height: 80px;
+    padding: 0 16px;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    font-size: 20px;
+}
+
+.btn{
+    height: 80px;
+    width: calc(100% / 9);
+    margin: 0 3px;
+    color: #fff;
+    font-weight: 800;
+    font-size: 20px;
+    border-radius: 4px;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    justify-content: center;
+    cursor: pointer;
+
+    .Frame{
+        width: 26px;
+        height: 26px;
+    }
+
+}
+
+</style>

+ 120 - 0
src/views/produce/components/produceOrder.vue

@@ -0,0 +1,120 @@
+<template>
+  <ele-pro-table
+    ref="table"
+    :columns="columns"
+    height="32vh"
+    :datasource="datasource"
+    cache-key="produceOrderZ"
+    highlight-current-row
+    @row-click="rowClick"
+    :need-page="false"
+  >
+    <template v-slot:toolbar>
+      <div class="c_title">工单列表</div>
+    </template>
+  </ele-pro-table>
+</template>
+
+<script>
+  import { workorderPage } from '@/api/produce/workOrder.js';
+
+  export default {
+    components: {},
+    data() {
+      return {
+        loading: false
+      };
+    },
+    computed: {
+      // 表格列配置
+      columns() {
+        return [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'batchNo',
+            label: '批号',
+            align: 'center'
+          },
+
+          {
+            prop: 'code',
+            label: '生产工单号',
+            align: 'center'
+          },
+          {
+            prop: '',
+            label: '计划编号',
+            align: 'center'
+          },
+          {
+            prop: '',
+            label: '计划类型',
+            align: 'center'
+          },
+
+          {
+            prop: 'produceRoutingName',
+            label: '工艺路线',
+            align: 'center'
+          },
+
+          {
+            prop: 'productCode',
+            label: '产品编码',
+            align: 'center'
+          },
+          {
+            prop: 'productName',
+            label: '产品名称',
+            align: 'center'
+          },
+
+          {
+            prop: 'brandNo',
+            label: '牌号',
+            align: 'center'
+          },
+          {
+            prop: 'model',
+            label: '型号',
+            align: 'center'
+          }
+        ];
+      }
+    },
+    created() {},
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, limit, where }) {
+        return workorderPage({
+          pageNum: page,
+          size: limit,
+          ...where
+        });
+      },
+
+      /* 刷新表格 */
+      reload(where) {
+        this.$nextTick(() => {
+          this.$refs.table.reload({ page: 1, where });
+        });
+      },
+
+      rowClick() {}
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .table {
+    height: calc((100vh - 70px - 50px - 80px - 20px) / 2);
+  }
+</style>

+ 38 - 0
src/views/produce/components/productionResource/index.vue

@@ -0,0 +1,38 @@
+<template>
+  <div>
+    <el-tabs v-model="activeName" type="border-card">
+      <el-tab-pane label="工艺路线" name="1" lazy>
+        <processRoute></processRoute>
+      </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>
+  </div>
+</template>
+
+<script>
+  import processRoute from './processRoute';
+  export default {
+    components: {
+      processRoute
+    },
+    data() {
+      return {
+        activeName: '1'
+      };
+    }
+  };
+</script>
+
+<style lang="scss">
+  .el-tabs__content {
+    padding: 4px !important;
+  }
+</style>

+ 130 - 0
src/views/produce/components/productionResource/processRoute.vue

@@ -0,0 +1,130 @@
+<template>
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      height="400px"
+      :datasource="datasource"
+      cache-key="produceOrderZ"
+      highlight-current-row
+      @row-click="rowClick"
+      :need-page="false"
+    >
+      <template v-slot:toolbar>
+      
+      </template>
+    </ele-pro-table>
+  </template>
+  
+  <script>
+    import { getList } from '@/api/warehousing/index.js';
+  
+    export default {
+      components: {},
+      data() {
+        return {
+          loading: false
+        };
+      },
+      computed: {
+        // 表格列配置
+        columns() {
+          return [
+            {
+              columnKey: 'index',
+              label: '序号',
+              type: 'index',
+              width: 55,
+              align: 'center',
+              showOverflowTooltip: true,
+              fixed: 'left'
+            },
+            {
+              prop: 'workOrderCode',
+              label: '工单编码',
+              align: 'center',
+              minWidth: 110
+            },
+            {
+              prop: 'warehouseName',
+              label: '仓库名称	',
+              align: 'center'
+            },
+  
+            {
+              prop: 'categoryLevelName',
+              label: '物品分类名称',
+              align: 'center'
+            },
+            {
+              prop: 'categoryName',
+              label: '物品名称',
+              align: 'center'
+            },
+            {
+              slot: 'totalCount',
+              label: '总数量',
+              align: 'center'
+            },
+  
+            {
+              slot: 'totalPackage',
+              label: '总包装',
+              align: 'center'
+            },
+  
+            {
+              slot: 'totalWeight',
+              label: '总重量',
+              align: 'center'
+            },
+  
+            {
+              prop: 'approvalUserName',
+              label: '审核人',
+              align: 'center'
+            },
+  
+            {
+              prop: 'createTime',
+              label: '创建时间',
+              align: 'center',
+              showOverflowTooltip: true,
+              minWidth: 110
+            },
+            {
+              slot: 'approvalStatus',
+              label: '状态',
+              align: 'center'
+            }
+          ];
+        }
+      },
+      created() {},
+      methods: {
+        /* 表格数据源 */
+        datasource({ page, limit, where }) {
+          return getList({
+            pageNum: page,
+            size: limit,
+            ...where
+          });
+        },
+  
+        /* 刷新表格 */
+        reload(where) {
+          this.$nextTick(() => {
+            this.$refs.table.reload({ page: 1, where });
+          });
+        },
+  
+        rowClick() {}
+      }
+    };
+  </script>
+  
+  <style lang="scss" scoped>
+    .table {
+      height: calc((100vh - 70px - 50px - 80px - 20px) / 2);
+    }
+  </style>
+  

+ 118 - 0
src/views/produce/components/search.vue

@@ -0,0 +1,118 @@
+<template>
+    <div class="search_box">
+        <div class="left">
+            <div class="back" @click="back()">
+                <i class="el-icon-back"></i>
+                返回
+            </div>
+
+            <el-form class="search_form" label-width="90px" @keyup.enter.native="search" @submit.native.prevent>
+
+                <el-form-item label="工序名称:">
+                    <el-select v-model="search.taskId">
+                        <el-option v-for="(item,index) in produceTaskList" :key="index" :label="item.name" :value="item.id"></el-option>
+                    </el-select>
+                </el-form-item>
+
+                <el-form-item label="设备名称:">
+                    <el-input clearable v-model="search.deviceName" placeholder="请输入" />
+                </el-form-item>
+
+
+            </el-form>
+        </div>
+        <div class="right">
+            <div class="lab">操作员:{{ userName }}</div>
+            <div class="lab">{{ currentTime }}</div>
+        </div>
+    </div>
+</template>
+
+<script>
+export default {
+    data() {
+        return {
+            currentTime: '',
+            userName: JSON.parse(localStorage.getItem('userInfo'))?.data?.name,
+
+            produceTaskList: [],
+            search: {
+                taskId: null,
+                deviceName: null,
+            }
+        };
+    },
+    created() {
+        this.updateCurrentTime();
+        setInterval(this.updateCurrentTime, 1000); // 每秒更新一次时间
+    },
+    methods: {
+        back() {
+            this.$router.go(-1);
+        },
+        updateCurrentTime() {
+            const now = new Date();
+            const year = now.getFullYear();
+            const month = (now.getMonth() + 1).toString().padStart(2, '0'); // 月份是从0开始的
+            const day = now.getDate().toString().padStart(2, '0');
+            const hours = now.getHours().toString().padStart(2, '0');
+            const minutes = now.getMinutes().toString().padStart(2, '0');
+            const seconds = now.getSeconds().toString().padStart(2, '0');
+
+            this.currentTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+        }
+    }
+};
+</script>
+
+<style lang="scss" scoped>
+.search_box {
+    min-width: 1280px;
+    width: 100%;
+    height: 50px;
+    background: #157a2c;
+    padding: 0 16px;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    font-size: 20px;
+
+    .left {
+        display: flex;
+        align-items: center;
+        font-size: 16px;
+        color: #fff;
+
+        .back{
+            margin-right: 40px;
+            cursor: pointer;
+        }
+    }
+
+    .right {
+        display: flex;
+        align-items: center;
+        font-size: 16px;
+        color: #fff;
+
+        .lab {
+            line-height: 50px;
+            margin-left: 60px;
+        }
+    }
+}
+
+.search_form {
+    display: flex !important;
+    height: 50px;
+    font-size: #FFF;
+    align-items: center;
+
+    --color-text-regular: #fff;
+}
+
+.el-form-item {
+    margin-bottom: 0px !important;
+}
+</style>
+<st

+ 132 - 0
src/views/produce/index.vue

@@ -0,0 +1,132 @@
+<template>
+  <div class="index_box">
+    <div class="content_box">
+      <Search></Search>
+
+      <div class="main">
+        <div class="left_main">
+          <div class="top">
+          <produceOrder></produceOrder>
+          </div>
+          <div class="bottom">
+            <productionResource></productionResource>
+          </div>
+        </div>
+        <div class="right_main"></div>
+      </div>
+      <footBtn></footBtn>
+    </div>
+  </div>
+</template>
+
+<script>
+  import Search from './components/search.vue';
+  import footBtn from './components/footBtn.vue';
+  import produceOrder from './components/produceOrder.vue';
+  import productionResource from './components/productionResource/index.vue';
+  export default {
+    components: {
+      Search,
+      footBtn,
+      produceOrder,
+      productionResource
+    },
+    data() {
+      return {
+        loading: false
+      };
+    },
+
+    mounted() {
+      this.$nextTick(() => {
+        const targetElements =
+          document.getElementsByClassName('ele-admin-tabs');
+
+        if (targetElements.length > 0) {
+          // 遍历所有具有 'ele-admin-tabs' 类的元素
+          Array.from(targetElements).forEach((element) => {
+            // 对每个元素添加 'new-ele-admin-tabs' 类
+            element.classList.add('new-ele-admin-tabs');
+          });
+        }
+      });
+    },
+
+    destroyed() {
+      this.$nextTick(() => {
+        const targetElements =
+          document.getElementsByClassName('ele-admin-tabs');
+
+        if (targetElements.length > 0) {
+          Array.from(targetElements).forEach((element) => {
+            element.classList.remove('new-ele-admin-tabs');
+          });
+        }
+      });
+    }
+  };
+</script>
+
+<style>
+  .new-ele-admin-tabs {
+    display: none !important;
+  }
+
+  .c_title{
+    color: #157a2c;
+    font-size: 18px;
+    font-weight: bold;
+  }
+</style>
+<style lang="scss" scoped>
+  .index_box {
+    padding: 8px;
+    padding-bottom: 0px;
+    width: 100%;
+
+    min-width: 1280px !important;
+    height: calc(100vh - 60px);
+    overflow-x: auto; /* 当内容超出宽度时,允许水平滚动 */
+    white-space: nowrap; /* 防止内部文本换行,确保所有内容都在一行显示 */
+    scrollbar-width: thin; /* 设置滚动条宽度(浏览器兼容性可能有所不同) */
+    scrollbar-color: #40a9ff transparent; /* 设置滚动条颜色和轨道颜色(同样,浏览器兼容性) */
+  }
+
+
+  .main {
+    width: 100%;
+    min-width: 1280px;
+
+    height: calc(100vh - 70px - 50px - 80px);
+    display: flex;
+    justify-content: space-between;
+  }
+
+  .left_main {
+    height: 100%;
+    display: flex;
+    flex-direction: column;
+    justify-content: space-around;
+    width: 49.4%;
+    min-width: 640px;
+    .top {
+      width: 100%;
+      height: calc((100vh - 70px - 50px - 80px - 20px) / 2);
+      overflow: hidden;
+
+    }
+    .bottom {
+      width: 100%;
+      height: calc((100vh - 70px - 50px - 80px - 20px) / 2);
+      overflow: hidden;
+    }
+  }
+
+  .right_main {
+    width: 49.4%;
+    min-width: 640px;
+    height: calc((100vh - 70px - 50px - 80px - 12px));
+    margin-top: 6px;
+    background: blueviolet;
+  }
+</style>

+ 1 - 1
src/views/produceOrder/components/produceOrder-search.vue

@@ -48,7 +48,7 @@
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="物料编码:">
+        <el-form-item label="产品编码:">
           <el-input
             clearable
             v-model="where.productCode"

+ 1 - 1
src/views/produceOrder/detail.vue

@@ -34,7 +34,7 @@
         <el-descriptions-item label="计划类型">{{
           typeList[infoData.planType]
         }}</el-descriptions-item>
-        <el-descriptions-item label="物料编码">{{
+        <el-descriptions-item label="产品编码">{{
           infoData.productCode
         }}</el-descriptions-item>
         <el-descriptions-item label="产品名称">{{

+ 10 - 2
src/views/produceOrder/index.vue

@@ -419,14 +419,22 @@
           ...where,
           ...order,
           pageNum: page,
-          size: limit
+          size: limit,
+          ...this.sort
         });
         // res['list'] = this.flattenArray(res.list)
         return res;
       },
 
+
       onSortChange(e) {
-        console.log(e);
+        let sort = {
+          orderBy: e.order,
+          sortName:  e.prop,
+        }
+        this.sort = sort
+        this.reload()
+       
       },
       flattenArray(arr) {
         var result = []; // 存放结果的数组

+ 1 - 1
src/views/produceWord/components/order-search.vue

@@ -31,7 +31,7 @@
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="物料编码:">
+        <el-form-item label="产品编码:">
           <el-input
             clearable
             v-model="where.productCode"

+ 15 - 3
src/views/produceWord/index.vue

@@ -9,6 +9,7 @@
         :columns="columns"
         :datasource="datasource"
         cache-key="workOrderTable"
+        @sort-change="onSortChange"
       >
         <template v-slot:code="{ row }">
           <!-- <el-link type="primary" :underline="false" @click="goDetail(row)"> -->
@@ -127,7 +128,7 @@
           },
           {
             prop: 'productCode',
-            label: '物料编号',
+            label: '产品编码',
             align: 'center'
           },
           {
@@ -160,7 +161,7 @@
             align: 'center',
             minWidth: 120,
             slot: 'priority',
-            sortable: true
+            sortable: 'custom'
           },
 
           {
@@ -250,7 +251,8 @@
         return getList({
           pageNum: page,
           size: limit,
-          ...where
+          ...where,
+          ...this.sort
         });
       },
 
@@ -261,6 +263,16 @@
         });
       },
 
+      onSortChange(e) {
+        let sort = {
+          orderBy: e.order,
+          sortName:  e.prop,
+        }
+        this.sort = sort
+        this.reload()
+       
+      },
+
       sortTop(row) {
         row.priority = Number(row.priority) + 1;
         this.priorityChange(row);