Przeglądaj źródła

领料列表优化

ysy 1 rok temu
rodzic
commit
72ffdea276

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

@@ -1,3 +1,13 @@
 import request from '@/utils/request';
 
 
+
+// 查询仓库下拉列表
+export async function getWarehouseList() {
+    const res = await request.post(`/wms/warehouse/getWarehouseList`, {});
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  }
+  

+ 73 - 8
src/views/produce/components/picking/index.vue

@@ -1,6 +1,6 @@
 <template>
   <el-dialog
-    title="领料"
+    title="新建领料"
     :visible.sync="visible"
     :before-close="handleClose"
     :close-on-click-modal="false"
@@ -8,7 +8,7 @@
     append-to-body
     width="80%"
   >
-    <div v-for="(item, index) in workList" :key="index">
+    <div v-for="(item, idx) in workList" :key="idx">
       <div class="table_box">
         <div class="row">
           <div class="col">
@@ -28,18 +28,71 @@
             <div class="content">{{ item.batchNo }}</div>
           </div>
           <div class="col pd6">
-            <el-button type="primary" size="mini" @click="openPicking(item.workOrderId, item)">领料</el-button>
+            <el-button
+              type="primary"
+              size="mini"
+              @click="openPicking(item.id, item)"
+              >新增</el-button
+            >
           </div>
         </div>
       </div>
+
+      <el-form ref="form" :model="{ pickList: item.pickList }" :rules="rules">
+        <el-table
+          ref="table"
+          :key="'table' + idx"
+          :max-height="300"
+          :data="item.pickList"
+          tooltip-effect="dark"
+          style="width: 100%"
+          stripe
+        >
+          <el-table-column label="序号" type="index" width="50">
+          </el-table-column>
+
+          <el-table-column label="编码" prop="assetCode">
+            <template slot-scope="{ row, $index }">
+              {{ row.rootCategoryLevelId == 4 ? row.codeNumber : row.code }}
+            </template>
+          </el-table-column>
+
+          <el-table-column label="名称" prop="name"> </el-table-column>
+          <el-table-column label="型号" prop="modelType"> </el-table-column>
+          <el-table-column label="规格" prop="specification"> </el-table-column>
+          <el-table-column label="数量" prop="demandQuantity">
+            <template slot-scope="{ row, $index }">
+              <el-input
+                :ref="'demandQuantity' + idx + $index"
+                v-model="row.demandQuantity"
+              >
+              <template slot="append">{{ row.unit }}</template>
+            </el-input> 
+
+            </template>
+          </el-table-column>
+
+          <el-table-column label="领料仓库" prop="warehouseId">
+            <template slot-scope="{ row, $index }">
+             <el-select></el-select>
+            </template>
+          </el-table-column>
+
+        </el-table>
+      </el-form>
     </div>
 
-    <pickingList isType="pick" ref="pickingListRef"></pickingList>
+    <pickingList
+      isType="pick"
+      ref="pickingListRef"
+      @allSelection="allSelection"
+    ></pickingList>
   </el-dialog>
 </template>
 
 <script>
-import pickingList from './pickingList.vue'
+  import pickingList from './pickingList.vue';
+
   export default {
     components: {
       pickingList
@@ -54,7 +107,9 @@ import pickingList from './pickingList.vue'
     },
     data() {
       return {
-        visible: true
+        visible: true,
+
+        rules: {}
       };
     },
 
@@ -64,8 +119,17 @@ import pickingList from './pickingList.vue'
         this.$emit('close', false);
       },
 
-      openPicking(workOrderId, item) {
-        this.$refs.pickingListRef.open(workOrderId, item);
+      openPicking(id, item) {
+        this.$refs.pickingListRef.open(id, item);
+      },
+
+      allSelection(id, list) {
+        this.workList.forEach((e) => {
+          if (e.id == id) {
+            e.pickList = list;
+            this.$forceUpdate();
+          }
+        });
       }
     }
   };
@@ -74,6 +138,7 @@ import pickingList from './pickingList.vue'
 <style lang="scss" scoped>
   .table_box {
     border: 1px solid #acd4b5;
+    margin: 6px 0;
 
     &:last-child {
       border-bottom: none;

+ 163 - 72
src/views/produce/components/picking/pickingList.vue

@@ -45,7 +45,12 @@
             @done="onDone"
           >
             <template v-slot:toolbar>
-              <el-alert type="info" :closable="false" class="ele-alert-border" style="width: 300px;">
+              <el-alert
+                type="info"
+                :closable="false"
+                class="ele-alert-border"
+                style="width: 300px"
+              >
                 <i class="el-icon-info ele-text-info"></i>
                 <span class="ele-text">
                   <span>
@@ -88,6 +93,42 @@
             <template v-slot:availableCountBase="{ row }">
               {{ row.availableCountBase }} {{ row.measuringUnit }}
             </template>
+
+            <template v-slot:weight="{ row }">
+              {{ row.weight }} {{ row.weightUnit }}
+            </template>
+
+            <!-- 库存保质期 -->
+            <template v-slot:expirationDate="{ row }">
+              <span v-if="row.expirationDate">
+                {{ row.expirationDate ? row.expirationDate : '-' }}
+                {{
+                  row.expirationDateUnit == 'year'
+                    ? '年'
+                    : row.expirationDateUnit == 'month'
+                    ? '月'
+                    : '日'
+                }}
+              </span>
+            </template>
+            <!-- 质检状态 -->
+            <template v-slot:qualityStatus="{ row }">
+              <span v-if="row.qualityResult == 0 || row.qualityResult == 1"
+                >已检</span
+              >
+              <span v-else-if="row.qualityStatus == 1">已检</span>
+              <span v-else-if="row.qualityStatus == 0">未检</span>
+              <span v-else>-</span>
+            </template>
+            <!-- 质检结果 -->
+            <template v-slot:qualityResult="{ row }">
+              <span v-if="row.qualityResult == 0 || row.qualityResult == ''"
+                >合格</span
+              >
+              <span v-else-if="row.qualityResult == 1">不合格</span>
+              <span v-else-if="row.qualityResult == 3">让步接收</span>
+              <span v-else>-</span>
+            </template>
           </ele-pro-table>
         </template>
       </ele-split-layout>
@@ -117,6 +158,7 @@
       return {
         visible: false,
 
+        id: null,
         treeIds: null,
         categoryLevelId: null,
         rootCategoryLevelId: null,
@@ -170,6 +212,11 @@
             label: '名称',
             showOverflowTooltip: true
           },
+          {
+            prop: 'brandNum',
+            label: '牌号',
+            showOverflowTooltip: true
+          },
           {
             prop: 'modelType',
             label: '型号',
@@ -180,69 +227,131 @@
             label: '规格',
             showOverflowTooltip: true
           },
+          {
+            prop: 'batchNo',
+            label: '批次号',
+            align: 'center'
+          },
+          {
+            prop: 'manualBatchNo',
+            label: '批号',
+            align: 'center'
+          },
+          {
+            prop: 'availableCountBase',
+            label: '计量库存数量',
+            sortable: 'custom',
+            slot: 'availableCountBase',
+            showOverflowTooltip: true,
+            width: 130,
+            align: 'center'
+          },
 
-          ...[
-            {
-              prop: 'brandNum',
-              label: '牌号',
-              showOverflowTooltip: true
-            }
-          ],
-
-          ...(this.rootCategoryLevelId == '4'
+          ...([1, 23, 8].includes(Number(this.rootCategoryLevelId))
             ? [
                 {
-                  prop: 'workstationName',
-                  label: '工位',
-                  showOverflowTooltip: true
-                },
-
-                {
-                  prop: 'runStatus',
-                  label: '状态',
-                  slot: 'runStatus',
+                  prop: 'packingCountBase',
+                  label: '包装库存',
+                  slot: 'packingCountBase',
                   showOverflowTooltip: true
                 }
               ]
             : []),
 
-          ...(this.rootCategoryLevelId == '5'
-            ? [
-                {
-                  prop: 'dieHoleNum',
-                  label: '模孔数量',
-                  showOverflowTooltip: true
-                },
-                {
-                  prop: 'mandrelDiameter',
-                  label: '芯棒直径',
-                  showOverflowTooltip: true
-                },
-                {
-                  prop: 'shrinkEffictive',
-                  label: '收缩系数',
-                  showOverflowTooltip: true
-                }
-              ]
-            : []),
+          {
+            prop: 'weight',
+            label: '重量',
+            showOverflowTooltip: true,
+            slot: 'weight'
+          },
 
-          ...(this.rootCategoryLevelId == '7'
+          {
+            prop: 'expirationDate',
+            slot: 'expirationDate',
+            label: '库存保质期',
+            width: 100
+          },
+          {
+            prop: 'expirationTime',
+            label: '周期倒计时',
+            showOverflowTooltip: true,
+            width: 100
+          },
+          {
+            prop: 'qualityResult',
+            slot: 'qualityResult',
+            label: '质检结果',
+            showOverflowTooltip: true,
+            width: 100
+          },
+          {
+            prop: 'qualityStatus',
+            slot: 'qualityStatus',
+            label: '质检状态',
+            showOverflowTooltip: true,
+            width: 100
+          },
+          {
+            prop: 'pathName',
+            width: 230,
+            label: '仓库',
+            showOverflowTooltip: true
+          },
+
+          ...(this.rootCategoryLevelId == '4'
             ? [
                 {
-                  prop: 'materialQuality',
-                  label: '材质',
+                  prop: 'workstationName',
+                  label: '工位',
                   showOverflowTooltip: true
                 },
 
                 {
-                  prop: 'vehicleLen',
-                  label: '长宽高',
-                  slot: 'vehicleLen',
+                  prop: 'runStatus',
+                  label: '状态',
+                  slot: 'runStatus',
                   showOverflowTooltip: true
                 }
               ]
             : []),
 
+          // ...(this.rootCategoryLevelId == '5'
+          //   ? [
+          //       {
+          //         prop: 'dieHoleNum',
+          //         label: '模孔数量',
+          //         showOverflowTooltip: true
+          //       },
+          //       {
+          //         prop: 'mandrelDiameter',
+          //         label: '芯棒直径',
+          //         showOverflowTooltip: true
+          //       },
+          //       {
+          //         prop: 'shrinkEffictive',
+          //         label: '收缩系数',
+          //         showOverflowTooltip: true
+          //       }
+          //     ]
+          //   : []),
+
+          // ...(this.rootCategoryLevelId == '7'
+          //   ? [
+          //       {
+          //         prop: 'materialQuality',
+          //         label: '材质',
+          //         showOverflowTooltip: true
+          //       },
+
+          //       {
+          //         prop: 'vehicleLen',
+          //         label: '长宽高',
+          //         slot: 'vehicleLen',
+          //         showOverflowTooltip: true
+          //       }
+          //     ]
+          //   : []),
+
           ...(this.rootCategoryLevelId == '8'
             ? [
                 {
@@ -262,28 +371,6 @@
                   showOverflowTooltip: true
                 }
               ]
-            : []),
-
-          ...([1, 23, 8].includes(Number(this.rootCategoryLevelId))
-            ? [
-                {
-                  prop: 'packingCountBase',
-                  label: '包装库存',
-                  slot: 'packingCountBase',
-                  showOverflowTooltip: true
-                }
-              ]
-            : []),
-
-          ...([1, 23].includes(Number(this.rootCategoryLevelId))
-            ? [
-                {
-                  prop: 'availableCountBase',
-                  label: '计量库存数量',
-                  slot: 'availableCountBase',
-                  showOverflowTooltip: true
-                }
-              ]
             : [])
         ];
       }
@@ -326,8 +413,9 @@
         });
       },
 
-            /* 清空选择 */
-            clearChoose() {
+      /* 清空选择 */
+      clearChoose() {
+        this.allSelection = [];
         this.$refs.table.clearSelection();
       },
       rowStyle({ row }) {
@@ -354,17 +442,20 @@
         });
       },
       open(id, item) {
-        if (item) {
-        }
+        this.id = id;
         this.visible = true;
       },
 
       handleClose() {
+        this.clearChoose();
         this.visible = false;
       },
       selected() {
-        console.log(this.selection);
-
+        if (this.allSelection.length == 0) {
+          this.$message.warning('请选择物料');
+          return false;
+        }
+        this.$emit('allSelection', this.id, this.allSelection);
         this.handleClose();
       }
     },

+ 162 - 83
src/views/produce/components/picking/pickingListSearch.vue

@@ -1,90 +1,169 @@
 <!-- 搜索表单 -->
 <template>
-    <el-form
-      label-width="77px"
-      class="ele-form-search"
-      @keyup.enter.native="search"
-      @submit.native.prevent
-    >
-      <el-row :gutter="10">
-        <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
-          <el-form-item label="关键字">
-            <el-input clearable v-model="where.keyWord" placeholder="请输入" />
-          </el-form-item>
-        </el-col>
-
-        <el-col v-bind="styleResponsive ? { md: 4 } : { md: 4 }">
-          <div class="ele-form-actions">
-            <el-button
-              type="primary"
-              icon="el-icon-search"
-              class="ele-btn-icon"
-              @click="search"
-            >
-              查询
-            </el-button>
-  
-            <el-button
-              @click="reset"
-              icon="el-icon-refresh"
-              class="ele-btn-icon"
-              size="medium"
-              >重置</el-button
+  <el-form
+    label-width="77px"
+    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="仓库:" prop="warehouseId">
+          <template>
+            <el-select
+              clearable
+              style="width: 100%"
+              v-model="where.warehouseId"
+              placeholder="请选择"
             >
-          </div>
-        </el-col>
-      </el-row>
-    </el-form>
-  </template>
-  
-  <script>
-    export default {
-      data () {
-        // 默认表单数据
-        const defaultWhere = {
-            code: '',
-      
-        };
-        return {
-          defaultWhere,
-          // 表单数据
-          where: { ...defaultWhere },
-  
-        };
-      },
-      computed: {
-        // 是否开启响应式布局
-        styleResponsive () {
-          return this.$store.state.theme.styleResponsive;
-        }
+              <el-option
+                v-for="item in warehouseList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              >
+              </el-option>
+            </el-select>
+          </template>
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="物品编码:" prop="code">
+          <el-input
+            clearable
+            placeholder="请输入"
+            v-model.trim="where.code"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="物品名称:" prop="assetName">
+          <el-input
+            clearable
+            v-model="where.assetName"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="批次号:" prop="batchNo">
+          <el-input
+            clearable
+            v-model="where.batchNo"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="批号:" prop="manualBatchNo">
+          <el-input
+            clearable
+            v-model="where.manualBatchNo"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="型号:" prop="modelType">
+          <el-input
+            clearable
+            v-model="where.modelType"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="规格:" prop="specification">
+          <el-input
+            clearable
+            v-model="where.specification"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <div class="ele-form-actions">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+            size="small"
+          >
+            查询
+          </el-button>
+          <el-button
+            @click="reset"
+            icon="el-icon-refresh-left"
+            size="small"
+            type="primary"
+            >重置</el-button
+          >
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  import { getWarehouseList } from '@/api/produce/index.js';
+  export default {
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        batchNo: '',
+
+        warehouseId: '',
+        manualBatchNo: '',
+
+        modelType: '',
+        specification: '',
+        code: '',
+
+        assetName: ''
+      };
+      return {
+        defaultWhere,
+        // 表单数据
+        where: { ...defaultWhere },
+        warehouseList: []
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    created() {
+      this.getArguInfo();
+    },
+    methods: {
+      /* 搜索 */
+      search() {
+        this.$emit('search', this.where);
       },
-      created() {
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.search();
       },
-      methods: {
-  
-        /* 搜索 */
-        search () {
-  
-          this.$emit('search', this.where);
-        },
-        /*  重置 */
-        reset () {
-          this.where = { ...this.defaultWhere };
-          this.search();
-        },
-        reset2 () {
-          this.where = { ...this.defaultWhere };
-  
-        }
+      //搜索数据源
+      async getArguInfo() {
+        const { data } = await getWarehouseList();
+        this.warehouseList = data;
       }
-    };
-  </script>
-  
-  <style>
-    .ele-form-actions {
-      display: inline-block;
-      transform: translate(0);
-      transition: all;
     }
-  </style>
-  
+  };
+</script>
+
+<style>
+  .ele-form-actions {
+    display: inline-block;
+    transform: translate(0);
+    transition: all;
+  }
+</style>