ysy 1 year ago
parent
commit
96dde41f52

+ 1 - 1
.env

@@ -1,2 +1,2 @@
-VUE_APP_NAME=排程系统
+VUE_APP_NAME=MES系统
 VUE_APP_API_BASE_URL=/api

+ 6 - 0
src/styles/transition/common.scss

@@ -106,6 +106,12 @@
 }
 
 
+.el-table__expand-icon {
+  font-size: 16px !important;
+  color: #1890ff !important;
+}
+
+
 
 /* 布局-横向 */
 /* c:center,s:start,e:end,a:around,b:between,w:wrap */

+ 102 - 0
src/views/byProduct/components/product-search.vue

@@ -0,0 +1,102 @@
+<!-- 搜索表单 -->
+<template>
+    <el-form
+      label-width="90px"
+      class="ele-form-search"
+      @keyup.enter.native="search"
+      @submit.native.prevent
+    >
+      <el-row :gutter="15">
+        <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+          <el-form-item label="副产品单号:">
+            <el-input
+              size="mini"
+              clearable
+              v-model="where.workOrderId"
+              placeholder="请输入"
+            />
+          </el-form-item>
+        </el-col>
+  
+        <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+          <el-form-item label="工单号:">
+            <el-input
+              size="mini"
+              clearable
+              v-model="where.joinWorkOrderCode"
+              placeholder="请输入"
+            />
+          </el-form-item>
+        </el-col>
+  
+
+        <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+          <el-form-item label-width="0px">
+            <el-button
+              size="mini"
+              type="primary"
+              icon="el-icon-search"
+              class="ele-btn-icon"
+              @click="search"
+            >
+              查询
+            </el-button>
+            <el-button
+              size="mini"
+              @click="reset"
+              icon="el-icon-refresh-left"
+              type="primary"
+              >重置</el-button
+            >
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+  </template>
+  
+  <script>
+    export default {
+      props: {
+  
+      },
+      data() {
+        // 默认表单数据
+        const defaultWhere = {
+          workOrderId: '',
+          joinWorkOrderCode: '',
+          status: ''
+        };
+        return {
+          // 表单数据
+          where: { ...defaultWhere },
+        };
+      },
+      computed: {
+        // 是否开启响应式布局
+        styleResponsive() {
+          return this.$store.state.theme.styleResponsive;
+        }
+      },
+      watch: {},
+      created() {},
+      methods: {
+        /* 搜索 */
+        search() {
+          this.$emit('search', this.where);
+        },
+        /*  重置 */
+        reset() {
+          this.where = { ...this.defaultWhere };
+          this.search();
+        }
+      }
+    };
+  </script>
+  <style lang="scss" scoped>
+    .ele-form-actions {
+      display: flex;
+      align-items: center;
+      justify-content: flex-end;
+    }
+  </style>
+  

+ 248 - 0
src/views/byProduct/index.vue

@@ -0,0 +1,248 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <productSearch @search="reload" ref="searchRef" >
+      </productSearch>
+
+      <!-- 数据表格 -->
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        row-key="id"
+        cache-key="pickKey"
+        :selection.sync="selection"
+        autoAmendPage
+        :parse-data="parseData"
+        @update:selection="handleSelectionChange"
+      >
+        <template v-slot:toolbar>
+          <el-button
+            type="primary"
+            size="mini"
+            @click="handPick"
+            >工单领料</el-button
+          >
+          <el-button
+            type="primary"
+          
+            size="mini"
+            @click="handSelfPick"
+            >自建领料单</el-button
+          >
+        </template>
+
+        <template v-slot:joinWorkOrderCode="{ row }">
+          <el-tag type="warning" v-if="row.type == 1">自建领料单</el-tag>
+          <div v-else>{{ row.joinWorkOrderCode }}</div>
+        </template>
+
+        <template v-slot:status="{ row }">
+          <el-tag
+            :type="['danger', 'success', 'warning', 'danger'][row.status]"
+            effect="dark"
+            >{{ statusList[row.status] }}</el-tag
+          >
+        </template>
+
+        <template v-slot:action="{ row }">
+          <el-button type="text" size="mini" @click="handDetailed(row)"
+            >详情</el-button
+          >
+        </template>
+      </ele-pro-table>
+    </el-card>
+
+    <!-- <addPick v-if="addPickShow" @close="close"></addPick>
+      <selfBuildPick v-if="selfBuildPickShow" @close="close"></selfBuildPick>
+  
+      <detailed
+        @detailedClose="detailedClose"
+        v-if="detailedShow"
+        :detailedObj="detailedObj"
+      ></detailed>
+  
+      <selfDetailed
+        @detailedClose="detailedClose"
+        v-if="selfDetailedShow"
+        :detailedObj="detailedObj"
+      ></selfDetailed> -->
+  </div>
+</template>
+
+<script>
+  import { getPage, returnPage } from '@/api/pick/pickApply';
+
+  import productSearch from './components/product-search.vue';
+
+  // import addPick from './components/addPick.vue';
+  // import selfBuildPick from './components/selfBuildPick.vue';
+
+  // import detailed from '@/views/produce/components/picking/detailed.vue';
+  // import selfDetailed from './components/selfDetailed.vue';
+
+  export default {
+    components: {
+      productSearch
+      // addPick,
+      // selfBuildPick,
+      // detailed,
+      // selfDetailed
+    },
+
+    data() {
+      return {
+        // 加载状态
+        loading: false,
+        selection: [],
+
+        addPickShow: false,
+        selfBuildPickShow: false,
+
+        detailedShow: false,
+        detailedObj: null,
+
+        selfDetailedShow: false,
+
+        statusList: ['未领料', '领料中', '已出库', '已驳回']
+      };
+    },
+    computed: {
+      columns() {
+        return [
+        
+          {
+            prop: 'code',
+            label: '领料单编号',
+            align: 'center'
+          },
+
+          {
+            prop: 'joinWorkOrderCode',
+            slot: 'joinWorkOrderCode',
+            label: '关联工单编号',
+            align: 'center'
+          },
+
+          {
+            prop: 'joinWarehouseName',
+            label: '领料仓库名称',
+            align: 'center'
+          },
+
+          {
+            prop: 'joinReviewerName',
+            label: '关联审核人',
+            align: 'center'
+          },
+
+          {
+            prop: 'executorName',
+            label: '领料人',
+            align: 'center'
+          },
+
+          {
+            prop: 'createTime',
+            label: '领料时间',
+            align: 'center'
+          },
+          {
+            prop: 'status',
+            slot: 'status',
+            label: '状态',
+            align: 'center'
+          },
+
+          {
+            prop: '',
+            label: '操作',
+            width: 80,
+            align: 'center',
+            resizable: false,
+            fixed: 'right',
+            slot: 'action'
+          }
+        ];
+      }
+    },
+    created() {},
+    methods: {
+      /* 表格数据源 */
+      async datasource({ page, limit, where }) {
+
+        let parma = {
+          ...where,
+          pageNum: page,
+          size: limit
+        };
+    
+
+        let res = await getPage(parma);
+
+        return res;
+      },
+
+      /* 数据转为树形结构 */
+      parseData(data) {
+        return {
+          ...data,
+          list: this.$util.toTreeData({
+            data: data.list,
+            count: data.total,
+
+            idField: 'id',
+            parentIdField: 'parentId'
+          })
+        };
+      },
+
+      handPick() {
+        this.addPickShow = true;
+      },
+
+      close(val) {
+        if (val) {
+          this.reload();
+        }
+        this.addPickShow = false;
+        this.selfBuildPickShow = false;
+      },
+
+      handSelfPick() {
+        this.selfBuildPickShow = true;
+      },
+
+      selfClose(val) {
+        if (val) {
+          this.reload();
+        }
+        this.selfBuildPickShow = false;
+      },
+
+      handDetailed(row) {
+        this.detailedObj = JSON.stringify(row);
+        if (row.type == 1) {
+          this.selfDetailedShow = true;
+        } else {
+          this.detailedShow = true;
+        }
+      },
+
+      detailedClose() {
+        this.detailedShow = false;
+        this.selfDetailedShow = false;
+      },
+
+      handleSelectionChange(data) {
+        let ids = [];
+        ids = data.map((item) => item.id);
+        this.$emit('selectionChange', ids);
+      },
+      /* 刷新表格 */
+      reload(where = {}) {
+        this.$refs.table.reload({ page: 1, where });
+      }
+    }
+  };
+</script>

+ 12 - 15
src/views/pick/pickApply/index.vue

@@ -14,7 +14,7 @@
         :selection.sync="selection"
         autoAmendPage
         :parse-data="parseData"
-         @update:selection="handleSelectionChange"
+        @update:selection="handleSelectionChange"
       >
         <template v-slot:toolbar>
           <el-button
@@ -40,11 +40,9 @@
 
         <template v-slot:status="{ row }">
           <el-tag
-              :type="['danger', 'success', 'warning', 'danger'][row.status]"
+            :type="['danger', 'success', 'warning', 'danger'][row.status]"
             effect="dark"
-            >{{
-            statusList[row.status]
-            }}</el-tag
+            >{{ statusList[row.status] }}</el-tag
           >
         </template>
 
@@ -115,9 +113,7 @@
 
         selfDetailedShow: false,
 
-
-        
-        statusList: ['未领料', '领料中', '已出库', '已驳回'],
+        statusList: ['未领料', '领料中', '已出库', '已驳回']
       };
     },
     computed: {
@@ -134,7 +130,9 @@
           {
             prop: 'code',
             label: '领料单编号',
-            align: 'center'
+            align: 'center',
+            align: 'left',
+             
           },
 
           {
@@ -146,7 +144,7 @@
 
           {
             prop: 'joinWarehouseName',
-            label: '关联仓库名称',
+            label: '领料仓库名称',
             align: 'center'
           },
 
@@ -200,7 +198,7 @@
         if (this.isReturn) {
           parma.status = 2;
         }
-        
+
         let res = await URL(parma);
 
         return res;
@@ -257,11 +255,10 @@
         this.selfDetailedShow = false;
       },
 
-
       handleSelectionChange(data) {
-        let ids = []
-        ids = data.map(item => item.id)
-        this.$emit('selectionChange', ids)
+        let ids = [];
+        ids = data.map((item) => item.id);
+        this.$emit('selectionChange', ids);
       },
       /* 刷新表格 */
       reload(where = {}) {