huang_an пре 2 година
родитељ
комит
c392c423e7

+ 2 - 2
src/views/warehouseManagement/outgoingManagement/add.vue

@@ -481,7 +481,7 @@
 <script>
   import outin from '@/api/warehouseManagement/outin';
   import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
-  import { getTreeByPid } from '@/api/classifyManage';
+  import { getTreeByPid, getTreeByGroup } from '@/api/classifyManage';
   import selectUpload from '@/components/selectUpload';
   import upload from '@/components/uploadImg';
   import {
@@ -933,7 +933,7 @@
         console.log(this.title);
       },
       async initData() {
-        const { data } = await getTreeByPid(0);
+        const { data } = await getTreeByGroup({ type: 1 });
         this.codeList = data;
         const res = await warehouseDefinition.tree();
         this.treeList = this.$util.toTreeData({

+ 4 - 13
src/views/warehouseManagement/stockLedger/allBatchDetails.vue

@@ -115,7 +115,6 @@
           // //   .warehousingType,
 
           categoryId: this.categoryId
-
         };
       }
     },
@@ -128,8 +127,8 @@
         const res = await getDetails(row.id);
         this.$nextTick(() => {
           console.log(res);
-          this.categoryId = res.categoryWms && res.categoryWms.categoryId
-         
+          this.categoryId = res.categoryWms && res.categoryWms.categoryId;
+
           this.$refs.baseInfoRef.getDetailInfoAugr(res.category); //基本信息
           this.$refs.warehouseConfigRef.getDetailInfoAugr(res.categoryWms);
         });
@@ -139,16 +138,8 @@
           categoryId: row.id
         });
         const list = this.$store.state.userPage.userList;
-        console.log('===', list);
-        for (const key in list) {
-          for (const k in rep.list) {
-            if (list[key].id == rep.list[k].createUserId) {
-              const name = list[key].name;
-              rep.list[k].createUserName = name;
-            }
-          }
-        }
-        console.log('qqq', rep.list);
+
+        console.log('qqq11', rep.list);
         this.stockList = rep.list;
       }
     }

+ 173 - 140
src/views/warehouseManagement/stockLedger/components/details/BatchDetail.vue

@@ -1,26 +1,31 @@
 <!-- 批次明细 -->
 <template>
   <div class="detail-box">
-
-    <el-table :data="tableData" :header-cell-style="{ background: '#EEEEEE', border: 'none' }"><el-table-column
-        width="80px" label="序号">
-        <template slot-scope="{ $index }">
-          <!-- {{ $tableIndex($index, page, size) }} -->
-        </template>
-      </el-table-column>
+    <el-table
+      :data="tableData"
+      :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
+    >
+      <el-table-column width="80px" label="序号" type="index" />
 
       <el-table-column label="批次号" prop="batchNum" sortable>
         <template slot-scope="{ row }">
-          <el-popover placement="bottom-start" title="" width="900" trigger="click">
-            <el-table :data="row.children" height="300" row-key="index" :header-cell-style="{
-              background: '#EEEEEE',
-              border: 'none'
-            }" v-loading="row.loading">
-              <el-table-column width="80px" label="序号">
-                <template slot-scope="{ $index }">
-                  <!-- {{ $tableIndex($index, page, size) }} -->
-                </template>
-              </el-table-column>
+          <el-popover
+            placement="bottom-start"
+            title=""
+            width="900"
+            trigger="click"
+          >
+            <el-table
+              :data="row.children"
+              height="300"
+              row-key="index"
+              :header-cell-style="{
+                background: '#EEEEEE',
+                border: 'none'
+              }"
+              v-loading="row.loading"
+            >
+              <el-table-column width="80px" label="序号" type="index" />
               <el-table-column label="入库单号" prop="bizNum"></el-table-column>
               <el-table-column label="入库场景" prop="bizType">
                 <template slot-scope="{ row }">
@@ -28,23 +33,47 @@
                 </template>
               </el-table-column>
               <el-table-column label="数量" prop="count"></el-table-column>
-              <el-table-column label="包装单位" width="120" prop="packingUnit"></el-table-column>
-              <el-table-column label="最小包装单位" width="120" prop="minPackUnit"></el-table-column>
+              <el-table-column
+                label="包装单位"
+                width="120"
+                prop="packingUnit"
+              ></el-table-column>
+              <el-table-column
+                label="最小包装单位"
+                width="120"
+                prop="minPackUnit"
+              ></el-table-column>
 
-              <el-table-column label="库位" prop="" min-width="150" show-overflow-tooltip>
+              <el-table-column
+                label="库位"
+                prop=""
+                min-width="150"
+                show-overflow-tooltip
+              >
                 <template slot-scope="{ row }">
                   {{ row.position }}
                 </template>
               </el-table-column>
-              <el-table-column label="入库时间" prop="updateTime"></el-table-column>
+              <el-table-column
+                label="入库时间"
+                prop="updateTime"
+              ></el-table-column>
               <el-table-column label="入库人" prop=""></el-table-column>
               <el-table-column label="条码" prop=""></el-table-column>
             </el-table>
-            <el-link type="primary" slot="reference" @click.stop="handleExpand(row)">{{ row.batchNum }}</el-link>
+            <el-link
+              type="primary"
+              slot="reference"
+              @click.stop="handleExpand(row)"
+              >{{ row.batchNum }}</el-link
+            >
           </el-popover>
         </template>
       </el-table-column>
-      <el-table-column label="库存数量" prop="availableCountBase"></el-table-column>
+      <el-table-column
+        label="库存数量"
+        prop="availableCountBase"
+      ></el-table-column>
 
       <el-table-column label="计量单位" prop="measuringUnit"></el-table-column>
       <el-table-column label="重量单位" prop=""></el-table-column>
@@ -54,11 +83,18 @@
       <el-table-column label="最近出库时间" prop=""></el-table-column>
       <el-table-column label="质检单" prop="" v-if="baseInfo.assetType === 3">
         <template slot-scope="{ row }">
-          <el-button type="text" @click="_getAnalysisCertificate(row)">查看</el-button>
+          <el-button type="text" @click="_getAnalysisCertificate(row)"
+            >查看</el-button
+          >
         </template>
       </el-table-column>
     </el-table>
-    <Pagination :total="total" :page.sync="page" :size.sync="size" @pagination="handlePageChange" />
+    <Pagination
+      :total="total"
+      :page.sync="page"
+      :size.sync="size"
+      @pagination="handlePageChange"
+    />
 
     <el-dialog :visible.sync="certificateVisible" title="质检单" width="55vw">
       <div style="text-align: center; max-height: 80vh; overflow: auto">
@@ -68,133 +104,130 @@
   </div>
 </template>
 <script>
-import Pagination from '@/components/Pagination';
-// import { sceneState } from '@/utils/dict/index'
-// import { useDictLabel } from '@/utils/dict/index'
-// import {
-//   inWarehouseSceneDetail,
-//   getAnalysisCertificate,
-//   getDetail
-// } from '@/api/stockManagement/stockLedger'
-// import { imageView } from '@/utils/index'
+  import Pagination from '@/components/Pagination';
+  // import { sceneState } from '@/utils/dict/index'
+  // import { useDictLabel } from '@/utils/dict/index'
+  // import {
+  //   inWarehouseSceneDetail,
+  //   getAnalysisCertificate,
+  //   getDetail
+  // } from '@/api/stockManagement/stockLedger'
+  // import { imageView } from '@/utils/index'
 
-import { getBatchDetails } from '@/api/classifyManage/index'
-export default {
-  components: { Pagination },
-  props: {
-    baseInfo: {
-      type: Object,
-      default: () => ({})
+  import { getBatchDetails } from '@/api/classifyManage/index';
+  export default {
+    components: { Pagination },
+    props: {
+      baseInfo: {
+        type: Object,
+        default: () => ({})
+      },
+      baseParams: {
+        type: Object,
+        default: () => ({})
+      }
     },
-    baseParams: {
-      type: Object,
-      default: () => ({})
-    }
-  },
-  data() {
-    return {
-      searchForm: { batchNum: '', isZero: '' },
-      tableData: [],
-      size: 10,
-      page: 1,
-      total: 0,
-      certificateVisible: false,
-      certificate: ''
-    };
-  },
-  created() {
-    this.getList()
-  },
-  methods: {
-    // getSceneState: useDictLabel(sceneState),
-    //质检单  资产类型、资产编码以及批次号获取质检单
-    async _getAnalysisCertificate(row) {
-      if (row.certificate) {
-        this.certificate = row.certificate;
-        this.certificateVisible = true;
+    data() {
+      return {
+        searchForm: { batchNum: '', isZero: '' },
+        tableData: [],
+        size: 10,
+        page: 1,
+        total: 0,
+        certificateVisible: false,
+        certificate: ''
+      };
+    },
+    created() {
+      this.getList();
+    },
+    methods: {
+      // getSceneState: useDictLabel(sceneState),
+      //质检单  资产类型、资产编码以及批次号获取质检单
+      async _getAnalysisCertificate(row) {
+        if (row.certificate) {
+          this.certificate = row.certificate;
+          this.certificateVisible = true;
 
-        return;
-      }
-      const res = await getAnalysisCertificate({
-        code: this.baseInfo.assetType,
-        ...this.baseParams,
-        batchNum: row.batchNum
-      });
-      if (res?.success) {
-        if (res.data?.length) {
-          imageView(res.data[0]).then((res) => {
-            this.certificate = res;
-            this.$set(row, 'certificate', res);
-            this.certificateVisible = true;
-          });
-        } else {
-          this.$message.error('未上传质检单!');
+          return;
         }
-      }
-    },
-    // 批次入库详情
-    async handleExpand(row) {
-      if (!row.children?.length) {
-        this.$set(row, 'loading', true);
-        const res = await inWarehouseSceneDetail({
+        const res = await getAnalysisCertificate({
+          code: this.baseInfo.assetType,
           ...this.baseParams,
-          bizStatus: 1,
           batchNum: row.batchNum
         });
         if (res?.success) {
-          this.$set(
-            row,
-            'children',
-            res.data.map((item, index) => ({
-              index: index + '' + Date.now(),
-              ...item
-            }))
-          );
+          if (res.data?.length) {
+            imageView(res.data[0]).then((res) => {
+              this.certificate = res;
+              this.$set(row, 'certificate', res);
+              this.certificateVisible = true;
+            });
+          } else {
+            this.$message.error('未上传质检单!');
+          }
         }
-        this.$set(row, 'loading', false);
-      }
-    },
-    search() {
-      this.page = 1;
-      this.getList();
-    },
-    reset() {
-      this.searchForm = {};
-      this.search();
-    },
-    handlePageChange() {
-      this.getList();
-    },
-    async getList() {
-      const params = {
-        size: this.size,
-        page: this.page,
-        ...this.baseParams,
-        batchNum: this.baseParams.batchNum || this.searchForm.batchNum,
-        isZero: this.searchForm.isZero,
-        inventoryCode: this.baseInfo.assetCode,
-        name: this.baseInfo.assetName,
-        // dimension: +this.$route.query.dimension
-        batchNo: this.$route.query.batchNo,
-        categoryId: this.baseParams.categoryId
-      };
-      const res = await getBatchDetails(params);
-
-
-      this.tableData = (res.data.list || []).map((item, index) => ({
-        index: index + '' + Date.now(),
-        ...item
-      }));
-
+      },
+      // 批次入库详情
+      async handleExpand(row) {
+        if (!row.children?.length) {
+          this.$set(row, 'loading', true);
+          const res = await inWarehouseSceneDetail({
+            ...this.baseParams,
+            bizStatus: 1,
+            batchNum: row.batchNum
+          });
+          if (res?.success) {
+            this.$set(
+              row,
+              'children',
+              res.data.map((item, index) => ({
+                index: index + '' + Date.now(),
+                ...item
+              }))
+            );
+          }
+          this.$set(row, 'loading', false);
+        }
+      },
+      search() {
+        this.page = 1;
+        this.getList();
+      },
+      reset() {
+        this.searchForm = {};
+        this.search();
+      },
+      handlePageChange() {
+        this.getList();
+      },
+      async getList() {
+        const params = {
+          size: this.size,
+          page: this.page,
+          ...this.baseParams,
+          batchNum: this.baseParams.batchNum || this.searchForm.batchNum,
+          isZero: this.searchForm.isZero,
+          inventoryCode: this.baseInfo.assetCode,
+          name: this.baseInfo.assetName,
+          // dimension: +this.$route.query.dimension
+          batchNo: this.$route.query.batchNo,
+          categoryId: this.baseParams.categoryId
+        };
+        const res = await getBatchDetails(params);
 
-      this.total = res.count;
+        this.tableData = (res.data.list || []).map((item, index) => ({
+          index: index + '' + Date.now(),
+          ...item
+        }));
 
+        this.total = res.count;
+      }
     }
-  }
-};
+  };
 </script>
 <style lang="scss" scoped>
-.detail-box {
-  margin: 20px auto;
-}
+  .detail-box {
+    margin: 20px auto;
+  }
 </style>

+ 20 - 6
src/views/warehouseManagement/stockLedger/components/details/InWarehouse.vue

@@ -116,17 +116,21 @@
     >
       <el-table-column width="80px" label="序号" type="index" />
       <el-table-column label="入库单号" prop="bizNo"></el-table-column>
-      <el-table-column label="入库场景" prop="bizScene">
+      <el-table-column label="入库场景" prop="bizType">
         <template slot-scope="{ row }">{{
-          getSceneState(+row.bizScene)
+          getSceneState(+row.bizType)
         }}</template>
       </el-table-column>
       <el-table-column label="入库数量" prop="countNo"></el-table-column>
-      <el-table-column label="计量单位" prop="unit"></el-table-column>
+      <el-table-column label="计量单位" prop="measuringUnit"></el-table-column>
       <el-table-column label="包装数量" prop="packageNo"></el-table-column>
       <el-table-column label="包装单位" prop="packingUnit"></el-table-column>
-      <el-table-column label="操作人" prop=""></el-table-column>
-      <el-table-column label="审核人" prop=""></el-table-column>
+      <el-table-column label="操作人" prop="createUserId">
+        <template slot-scope="{ row }">
+          {{ handleDeta(row.createUserId) }}
+        </template>
+      </el-table-column>
+      <el-table-column label="审核人" prop="verifyName"></el-table-column>
       <el-table-column label="入库时间" prop="createTime"></el-table-column>
     </el-table>
     <Pagination
@@ -178,7 +182,8 @@
         tableData: [],
         size: 10,
         page: 1,
-        total: 0
+        total: 0,
+        vuexUser: []
       };
     },
     created() {
@@ -200,6 +205,13 @@
       handlePageChange() {
         this.getList();
       },
+      handleDeta(row) {
+        for (const key in this.vuexUser) {
+          if (this.vuexUser[key].id == row) {
+            return this.vuexUser[key].name;
+          }
+        }
+      },
       async getList() {
         const res = await ouint.getInventoryDetails({
           size: this.size,
@@ -210,6 +222,8 @@
           // batchNum: this.baseParams.batchNum || this.searchForm.batchNum
         });
         if (res) {
+          const list = this.$store.state.userPage.userList;
+          this.vuexUser = list;
           this.tableData = res.list;
           this.total = res.count;
         }

+ 31 - 17
src/views/warehouseManagement/stockLedger/components/details/OutWarehouse.vue

@@ -118,8 +118,8 @@
           {{ $tableIndex($index, page, size) }}
         </template>
       </el-table-column>
-      <el-table-column label="出库单号" prop="bizNum"></el-table-column>
-      <el-table-column label="出库场景" prop="bizScene">
+      <el-table-column label="出库单号" prop="bizNo"></el-table-column>
+      <el-table-column label="出库场景" prop="bizType">
         <!-- <template slot-scope="{ row }">{{
           getSceneState(+row.bizScene)
         }}</template> -->
@@ -128,14 +128,18 @@
         label="出库数量"
         prop="measurementUnit"
       ></el-table-column>
-      <el-table-column label="计量单位" prop="unit"></el-table-column>
+      <el-table-column label="计量单位" prop="measuringUnit"></el-table-column>
       <template v-if="!baseInfo.isUnpack">
-        <el-table-column label="包装数量" prop="outInNum"></el-table-column>
-        <el-table-column label="包装单位" prop="minPackUnit"></el-table-column>
+        <el-table-column label="包装数量" prop="packageNo"></el-table-column>
+        <el-table-column label="包装单位" prop="packingUnit"></el-table-column>
       </template>
-      <el-table-column label="操作人" prop="createUsername"></el-table-column>
+      <el-table-column label="操作人" prop="createUserId">
+        <template slot-scope="{ row }">
+          {{ handleDeta(row) }}
+        </template>
+      </el-table-column>
       <el-table-column label="审核人" prop="verifyName"></el-table-column>
-      <el-table-column label="出库时间" prop="verifyTime"></el-table-column>
+      <el-table-column label="出库时间" prop="createTime"></el-table-column>
     </el-table>
     <Pagination
       :total="total"
@@ -161,10 +165,10 @@
 <script>
   import Pagination from '@/components/Pagination';
   // import { getInWarehouseDetail } from '@/api/stockManagement/stockLedger'
-  // import { outputSceneState } from '@/utils/dict/index'
+  import { outputSceneState } from '@/utils/dict/index';
   import OutWarehouseDialg from './OutWarehouseDialg.vue';
   import { inventorybookPage } from '@/api/classifyManage/itemInformation';
-  // import { useDictLabel } from '@/utils/dict/index'
+  import { useDictLabel } from '@/utils/dict/index';
   // import dictMixin from '@/mixins/dictMixins'
 
   import ouint from '@/api/warehouseManagement/outin';
@@ -183,7 +187,7 @@
     },
     data() {
       return {
-        // outputSceneState,
+        outputSceneState,
         outputSceneState: [],
         searchForm: {
           bizNum: '',
@@ -195,15 +199,23 @@
         tableData: [],
         size: 15,
         page: 1,
-        total: 0
+        total: 0,
+        vuexUser: []
       };
     },
     created() {
       // this.requestDict('类型用途')
-      this.getList()
+      this.getList();
     },
     methods: {
-      // getSceneState: useDictLabel(outputSceneState),
+      getSceneState: useDictLabel(outputSceneState),
+      handleDeta(row) {
+        for (const key in this.vuexUser) {
+          if (this.vuexUser[key].id == row) {
+            return this.vuexUser[key].name;
+          }
+        }
+      },
       handleCellClick(row) {
         this.$refs.detailRef.open(row);
       },
@@ -223,13 +235,15 @@
           size: this.size,
           page: this.page,
           type: 2,
-          ...this.baseParams,
+          ...this.baseParams
           // ...this.searchForm,
           // batchNum: this.baseParams.batchNum || this.searchForm.batchNum
         });
-        if (res?.success) {
-          this.tableData = res.data.records;
-          this.total = res.data.total;
+        if (res) {
+          const list = this.$store.state.userPage.userList;
+          this.vuexUser = list;
+          this.tableData = res.list;
+          this.total = res.count;
         }
       }
     }

+ 24 - 10
src/views/warehouseManagement/stockLedger/components/details/WarehouseDetail.vue

@@ -11,7 +11,7 @@
         prop="onlyCode"
         width="200px"
       ></el-table-column> -->
-      <el-table-column label="批次号" prop="batchNo"></el-table-column>
+      <el-table-column label="批次号" prop="batchNum"></el-table-column>
       <el-table-column label="编码" prop="code"></el-table-column>
       <el-table-column label="名称" prop="name"></el-table-column>
       <el-table-column label="牌号" prop="brandNum"></el-table-column>
@@ -21,14 +21,18 @@
       </el-table-column>
       <el-table-column label="数量" prop="countNo"></el-table-column>
       <el-table-column label="单价" prop="price">
-        <template slot-scope="{ row }">
+        <!-- <template slot-scope="{ row }">
           <template v-if="row.univalence || row.univalence === 0">
             {{ row.univalence }} {{ priceList[row.univalenceUnit] }}
           </template>
-        </template></el-table-column
-      >
+        </template> -->
+      </el-table-column>
       <el-table-column label="质保期" prop="expirationDate"></el-table-column>
-      <el-table-column label="入库人" prop="createUserName"></el-table-column>
+      <el-table-column label="入库人" prop="createUserName">
+        <template slot-scope="{ row }">
+          {{ handleUserName(row.createUserId) }}
+        </template>
+      </el-table-column>
       <el-table-column label="入库时间" prop="createTime"></el-table-column>
     </el-table>
     <Pagination
@@ -76,7 +80,8 @@
         tableData: [],
         size: 15,
         page: 1,
-        total: 0
+        total: 0,
+        vuexUser: []
       };
     },
     computed: {
@@ -85,9 +90,16 @@
       }
     },
     created() {
-      this.getList()
+      this.getList();
     },
     methods: {
+      handleUserName(row) {
+        for (const key in this.vuexUser) {
+          if (this.vuexUser[key].id == row) {
+            return this.vuexUser[key].name;
+          }
+        }
+      },
       search() {
         this.page = 1;
         this.getList();
@@ -107,9 +119,11 @@
           ...this.baseParams,
           batchNum: this.baseParams.batchNum || this.searchForm.batchNum
         });
-        if (res?.success) {
-          this.tableData = res.data.records;
-          this.total = res.data.total;
+        if (res) {
+          const list = this.$store.state.userPage.userList;
+          this.vuexUser = list;
+          this.tableData = res.list;
+          this.total = res.count;
         }
       }
     }

+ 2 - 2
src/views/warehouseManagement/stockManagement/add.vue

@@ -854,7 +854,7 @@
 
 <script>
   import outin from '@/api/warehouseManagement/outin';
-  import { getTreeByPid } from '@/api/classifyManage';
+  import { getTreeByPid, getTreeByGroup } from '@/api/classifyManage';
   import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
   import selectUpload from '@/components/selectUpload';
   import upload from '@/components/uploadImg';
@@ -1527,7 +1527,7 @@
         console.log('sasasa===', this.warehousingMaterialList);
       },
       async initData() {
-        const { data } = await getTreeByPid(0);
+        const { data } = await getTreeByGroup({ type: 1 });
         this.codeList = data;
         // .map((item) => {
         //   return { dictCode: item.id, dictValue: item.name };

+ 5 - 23
src/views/warehouseManagement/warehouseDefinition/components/WarehouseEdit.vue

@@ -28,20 +28,11 @@
         ></el-input>
       </el-form-item>
       <el-form-item label="仓库类型" prop="inventoryType">
-        <el-select
-          filterable
-          placeholder="请选择"
-          v-model="formData.inventoryType"
+        <DictSelection
+          dictName="仓库类型"
           clearable
-          class="w100"
-        >
-          <el-option
-            v-for="(item, idx) in warehouseDefinition_inventoryList"
-            :key="item.code"
-            :value="item.code"
-            :label="item.label"
-          ></el-option>
-        </el-select>
+          v-model="formData.inventoryType"
+        />
       </el-form-item>
       <el-form-item label="所属工厂" prop="factoryId">
         <el-select
@@ -154,14 +145,6 @@
     components: { DeptSelect },
     data() {
       return {
-        warehouseDefinition_inventoryList: [
-          { code: 1, label: '物料仓' },
-          { code: 2, label: '产品仓' },
-          { code: 3, label: '设备仓' },
-          { code: 4, label: '模具仓' },
-          { code: 5, label: '舟皿仓' },
-          { code: 6, label: '备品备件仓' }
-        ],
         visible: false,
         loading: false,
         formData: {
@@ -223,12 +206,11 @@
     },
     created() {},
     methods: {
-      open(type, row) {
+      async open(type, row) {
         console.log(type);
         this.type = type;
         this.visible = true;
         this.init();
-
         if (type === '修改') {
           console.log(1);
           this.loadingVis = true;

+ 4 - 13
src/views/warehouseManagement/warehouseDefinition/index.vue

@@ -14,20 +14,11 @@
           ></el-col>
           <el-col :span="4">
             <el-form-item label="仓库类型" prop="inventoryType">
-              <el-select
-                filterable
-                placeholder="请选择"
-                v-model="formData.inventoryType"
+              <DictSelection
+                dictName="仓库类型"
                 clearable
-                class="w100"
-              >
-                <el-option
-                  v-for="item in warehouseDefinition_inventoryList"
-                  :key="item.code"
-                  :value="item.code"
-                  :label="item.label"
-                ></el-option>
-              </el-select> </el-form-item
+                v-model="formData.inventoryType"
+              /> </el-form-item
           ></el-col>
           <el-col :span="5">
             <el-form-item label="所属工厂" prop="factoryId">