Browse Source

修改批量导入入库以及出库选择选项

huang_an 1 year ago
parent
commit
3a2979d819

+ 10 - 11
src/store/modules/user.js

@@ -37,7 +37,7 @@ export default {
   namespaced: true,
   state: {
     // 当前登录用户信息
-    info: localStorage.getItem('info') || null,
+    info: JSON.parse(localStorage.getItem('info')) || null,
     // 当前登录用户的菜单
     menus: null,
     // 当前登录用户的权限
@@ -49,26 +49,25 @@ export default {
   },
   mutations: {
     // 设置登录用户的信息
-    setUserInfo (state, info) {
+    setUserInfo(state, info) {
       localStorage.setItem('info', JSON.stringify(info));
       console.log('setUserInfo');
-
       state.info = info;
     },
     // 设置登录用户的菜单
-    setMenus (state, menus) {
+    setMenus(state, menus) {
       state.menus = menus;
     },
     // 设置登录用户的权限
-    setAuthorities (state, authorities) {
+    setAuthorities(state, authorities) {
       state.authorities = authorities;
     },
     // 设置登录用户的权限路由
-    setAuthoritiesRouter (state, authoritiesRouter) {
+    setAuthoritiesRouter(state, authoritiesRouter) {
       state.authoritiesRouter = authoritiesRouter;
     },
     // 设置登录用户的角色
-    setRoles (state, roles) {
+    setRoles(state, roles) {
       state.roles = roles;
     }
   },
@@ -106,7 +105,7 @@ export default {
     //   return { menus, homePath };
     // },
     //动态路由
-    async fetchUserInfo ({ commit }) {
+    async fetchUserInfo({ commit }) {
       const result = await getResourcesTree().catch(() => {});
       const list = result.filter((i) => i.path === '/page-wms');
       if (!list.length) {
@@ -158,19 +157,19 @@ export default {
     /**
      * 更新用户信息
      */
-    setInfo ({ commit }, value) {
+    setInfo({ commit }, value) {
       commit('setUserInfo', value);
     },
     /**
      * 更新菜单数据
      */
-    setMenus ({ commit }, value) {
+    setMenus({ commit }, value) {
       commit('setMenus', value);
     },
     /**
      * 更新菜单的badge
      */
-    setMenuBadge ({ commit, state }, { path, value, color }) {
+    setMenuBadge({ commit, state }, { path, value, color }) {
       const menus = formatTreeData(state.menus, (m) => {
         if (path === m.path) {
           return {

+ 24 - 2
src/views/warehouseManagement/components/AssetsDialog.vue

@@ -106,6 +106,24 @@
             ></el-input>
           </el-form-item>
         </el-col>
+        <el-col :span="6">
+          <el-form-item label="批号">
+            <el-input
+              type="text"
+              placeholder="搜索批号"
+              v-model="searchForm.manualBatchNo"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="牌号">
+            <el-input
+              type="text"
+              placeholder="搜索牌号"
+              v-model="searchForm.brandNum"
+            ></el-input>
+          </el-form-item>
+        </el-col>
         <el-col v-if="dimension != 2" :span="6">
           <el-form-item label="质检结果">
             <el-select
@@ -395,9 +413,11 @@
           code: '',
           assetName: '',
           batchNo: '',
+          brandNum: '',
           engrave: '',
           barcodes: '',
-          qualityResult: ''
+          qualityResult: '',
+          manualBatchNo: ''
         },
         selectionList: [],
         materialType: '',
@@ -606,7 +626,9 @@
         this.searchForm.batchNo = '';
         this.searchForm.engrave = '';
         this.searchForm.barcodes = '';
-        this.searchForm.qualityStatus = '';
+        this.searchForm.qualityResult = '';
+        this.searchForm.manualBatchNo = '';
+        this.searchForm.brandNum = '';
         this.doSearch();
       },
       doSearch() {

+ 7 - 1
src/views/warehouseManagement/stockManagement/add.vue

@@ -847,7 +847,7 @@
         <div class="mt20">
           <header-title :title="`包装明细`">
             <div class="switch_right">
-              <span v-if="materialCodeReqList.length != 0">
+              <span v-if="materialCodeReqList.length != 0 && !isDisableSplit">
                 分拆<el-switch
                   v-model="isSplit"
                   active-color="#13ce66"
@@ -1436,6 +1436,12 @@
       };
     },
     computed: {
+      // 是否允许分拆
+      isDisableSplit() {
+        return this.warehousingMaterialList.some(
+          (item) => item.weightUnit == item.measuringUnit
+        );
+      },
       // 条码信息
       materialCodeReqList() {
         return this.warehousingMaterialList

+ 15 - 37
src/views/warehouseManagement/stockManagement/add_export.vue

@@ -874,24 +874,14 @@
     methods: {
       wrapHandleScroll() {
         console.log('---------wrapHandleScroll------------');
-        this.wrapPageNum += 1;
-        this.wrapFetchData();
-        // console.log(event);
-        // const target = event.target;
-        // // 计算是否滚动到底部
-        // if (
-        //   target.scrollHeight - target.scrollTop <= target.clientHeight &&
-        //   this.showMaterialCodeReqList.length < this.materialCodeReqList.length
-        // ) {
-        //   if (!this.loadingWrapMore) {
-        //     this.loadingWrapMore = true;
-        //     setTimeout(() => {
-        //       this.wrapPageNum += 1;
-        //       this.wrapFetchData();
-        //       this.loadingWrapMore = false;
-        //     }, 1000);
-        //   }
-        // }
+        if (
+          this.showMaterialCodeReqList.length < this.materialCodeReqList.length
+        ) {
+          if (this.materialCodeReqList.length > this.pageSize) {
+            this.wrapPageNum += 1;
+          }
+          this.wrapFetchData();
+        }
       },
       wrapFetchData() {
         const start = (this.wrapPageNum - 1) * this.pageSize;
@@ -901,25 +891,13 @@
         );
       },
       materielHandleScroll() {
-        console.log('----------materielHandleScroll-----------');
-        this.materielPageNum += 1;
-        this.materielFetchData();
-        // console.log(event);
-        // const target = event.target;
-        // // 计算是否滚动到底部
-        // if (
-        //   target.scrollHeight - target.scrollTop <= target.clientHeight &&
-        //   this.showResultArray.length < this.resultArray.length
-        // ) {
-        //   if (!this.loadingMaterielMore) {
-        //     this.loadingMaterielMore = true;
-        //     setTimeout(() => {
-        //       this.materielPageNum += 1;
-        //       this.materielFetchData();
-        //       this.loadingMaterielMore = false;
-        //     }, 1000);
-        //   }
-        // }
+        console.log('---------materielHandleScroll------------');
+        if (this.showResultArray.length < this.resultArray.length) {
+          if (this.resultArray.length > this.pageSize) {
+            this.materielPageNum += 1;
+          }
+          this.materielFetchData();
+        }
       },
       materielFetchData() {
         const start = (this.materielPageNum - 1) * this.pageSize;

+ 21 - 4
src/views/warehouseManagement/stockManagement/details.vue

@@ -646,8 +646,14 @@
     methods: {
       wrapHandleScroll() {
         console.log('---------wrapHandleScroll------------');
-        this.wrapPageNum += 1;
-        this.wrapFetchData();
+        if (
+          this.showMaterialCodeReqList.length < this.materialCodeReqList.length
+        ) {
+          if (this.materialCodeReqList.length > this.pageSize) {
+            this.wrapPageNum += 1;
+          }
+          this.wrapFetchData();
+        }
       },
       wrapFetchData() {
         const start = (this.wrapPageNum - 1) * this.pageSize;
@@ -655,10 +661,18 @@
         this.showMaterialCodeReqList = this.showMaterialCodeReqList.concat(
           this.materialCodeReqList.slice(start, end)
         );
+        console.log(start, end);
+        console.log(this.materialCodeReqList);
+        console.log(this.showMaterialCodeReqList);
       },
       materielHandleScroll() {
-        this.materielPageNum += 1;
-        this.materielFetchData();
+        console.log('---------materielHandleScroll------------');
+        if (this.showResultArray.length < this.resultArray.length) {
+          if (this.resultArray.length > this.pageSize) {
+            this.materielPageNum += 1;
+          }
+          this.materielFetchData();
+        }
       },
       materielFetchData() {
         const start = (this.materielPageNum - 1) * this.pageSize;
@@ -666,6 +680,7 @@
         this.showResultArray = this.showResultArray.concat(
           this.resultArray.slice(start, end)
         );
+        console.log(this.showResultArray);
       },
       ...mapActions('dict', ['requestDict']),
       getAuditStatus: useDictLabel(auditStatus),
@@ -730,6 +745,8 @@
             });
           });
           this.resultArray = iArr;
+          console.log(this.materialCodeReqList);
+          console.log(this.resultArray);
           this.wrapFetchData();
           this.materielFetchData();
         }

+ 1 - 1
src/views/warehouseManagement/stockManagement/index.vue

@@ -105,8 +105,8 @@
           >
           <!-- v-if="clientEnvironmentId == 2" -->
           <el-button
-            v-if="clientEnvironmentId == 2"
             icon="el-icon-plus"
+            v-if="clientEnvironmentId == 4"
             type="primary"
             @click="exportExcel"
             >导入</el-button