Browse Source

添加打印模版以及调拨页面

huang_an 1 year ago
parent
commit
273cda347e
25 changed files with 2536 additions and 954 deletions
  1. 7 62
      package-lock.json
  2. 1 1
      package.json
  3. 46 0
      src/api/warehouseManagement/index.js
  4. BIN
      src/assets/logo.jpg
  5. BIN
      src/assets/logo1.jpg
  6. 34 1
      src/views/warehouseManagement/components/AssetsDialog.vue
  7. 8 0
      src/views/warehouseManagement/inboundRequests/components/tgDetails.vue
  8. 230 26
      src/views/warehouseManagement/inventoryAllocation/add.vue
  9. 40 4
      src/views/warehouseManagement/inventoryAllocation/components/inventory-search.vue
  10. 190 79
      src/views/warehouseManagement/inventoryAllocation/details.vue
  11. 38 88
      src/views/warehouseManagement/inventoryAllocation/index.vue
  12. 8 0
      src/views/warehouseManagement/outgoingManagement/add.vue
  13. 321 0
      src/views/warehouseManagement/outgoingManagement/components/print.vue
  14. 356 0
      src/views/warehouseManagement/outgoingManagement/components/print1.vue
  15. 245 0
      src/views/warehouseManagement/outgoingManagement/components/print2.vue
  16. 267 0
      src/views/warehouseManagement/outgoingManagement/components/print3.vue
  17. 234 0
      src/views/warehouseManagement/outgoingManagement/components/print4.vue
  18. 54 6
      src/views/warehouseManagement/outgoingManagement/index.vue
  19. 33 2
      src/views/warehouseManagement/stockLedger/components/item-search.vue
  20. 212 508
      src/views/warehouseManagement/stockManagement/add.vue
  21. 2 1
      src/views/warehouseManagement/stockManagement/components/priceMaintenanceDialog.vue
  22. 49 12
      src/views/warehouseManagement/stockManagement/components/selectType.vue
  23. 122 163
      src/views/warehouseManagement/stockManagement/details.vue
  24. 1 0
      src/views/warehouseManagement/stockManagement/details_3.vue
  25. 38 1
      src/views/warehouseManagement/stockManagement/index.vue

+ 7 - 62
package-lock.json

@@ -22,7 +22,7 @@
         "ele-admin": "^1.11.2",
         "element-ui": "2.15.7",
         "github-markdown-css": "^5.1.0",
-        "jsbarcode": "^3.11.5",
+        "jsbarcode": "^3.11.6",
         "json-bigint": "^1.0.0",
         "mathjs": "11.11.0",
         "nprogress": "^0.2.0",
@@ -7960,64 +7960,9 @@
       }
     },
     "node_modules/jsbarcode": {
-      "version": "3.11.5",
-      "resolved": "https://registry.npmmirror.com/jsbarcode/-/jsbarcode-3.11.5.tgz",
-      "integrity": "sha512-zv3KsH51zD00I/LrFzFSM6dst7rDn0vIMzaiZFL7qusTjPZiPtxg3zxetp0RR7obmjTw4f6NyGgbdkBCgZUIrA==",
-      "bin": {
-        "auto.js": "bin/barcodes/CODE128/auto.js",
-        "Barcode.js": "bin/barcodes/Barcode.js",
-        "barcodes": "bin/barcodes",
-        "canvas.js": "bin/renderers/canvas.js",
-        "checksums.js": "bin/barcodes/MSI/checksums.js",
-        "codabar": "bin/barcodes/codabar",
-        "CODE128": "bin/barcodes/CODE128",
-        "CODE128_AUTO.js": "bin/barcodes/CODE128/CODE128_AUTO.js",
-        "CODE128.js": "bin/barcodes/CODE128/CODE128.js",
-        "CODE128A.js": "bin/barcodes/CODE128/CODE128A.js",
-        "CODE128B.js": "bin/barcodes/CODE128/CODE128B.js",
-        "CODE128C.js": "bin/barcodes/CODE128/CODE128C.js",
-        "CODE39": "bin/barcodes/CODE39",
-        "constants.js": "bin/barcodes/ITF/constants.js",
-        "defaults.js": "bin/options/defaults.js",
-        "EAN_UPC": "bin/barcodes/EAN_UPC",
-        "EAN.js": "bin/barcodes/EAN_UPC/EAN.js",
-        "EAN13.js": "bin/barcodes/EAN_UPC/EAN13.js",
-        "EAN2.js": "bin/barcodes/EAN_UPC/EAN2.js",
-        "EAN5.js": "bin/barcodes/EAN_UPC/EAN5.js",
-        "EAN8.js": "bin/barcodes/EAN_UPC/EAN8.js",
-        "encoder.js": "bin/barcodes/EAN_UPC/encoder.js",
-        "ErrorHandler.js": "bin/exceptions/ErrorHandler.js",
-        "exceptions": "bin/exceptions",
-        "exceptions.js": "bin/exceptions/exceptions.js",
-        "fixOptions.js": "bin/help/fixOptions.js",
-        "GenericBarcode": "bin/barcodes/GenericBarcode",
-        "getOptionsFromElement.js": "bin/help/getOptionsFromElement.js",
-        "getRenderProperties.js": "bin/help/getRenderProperties.js",
-        "help": "bin/help",
-        "index.js": "bin/renderers/index.js",
-        "index.tmp.js": "bin/barcodes/index.tmp.js",
-        "ITF": "bin/barcodes/ITF",
-        "ITF.js": "bin/barcodes/ITF/ITF.js",
-        "ITF14.js": "bin/barcodes/ITF/ITF14.js",
-        "JsBarcode.js": "bin/JsBarcode.js",
-        "linearizeEncodings.js": "bin/help/linearizeEncodings.js",
-        "merge.js": "bin/help/merge.js",
-        "MSI": "bin/barcodes/MSI",
-        "MSI.js": "bin/barcodes/MSI/MSI.js",
-        "MSI10.js": "bin/barcodes/MSI/MSI10.js",
-        "MSI1010.js": "bin/barcodes/MSI/MSI1010.js",
-        "MSI11.js": "bin/barcodes/MSI/MSI11.js",
-        "MSI1110.js": "bin/barcodes/MSI/MSI1110.js",
-        "object.js": "bin/renderers/object.js",
-        "options": "bin/options",
-        "optionsFromStrings.js": "bin/help/optionsFromStrings.js",
-        "pharmacode": "bin/barcodes/pharmacode",
-        "renderers": "bin/renderers",
-        "shared.js": "bin/renderers/shared.js",
-        "svg.js": "bin/renderers/svg.js",
-        "UPC.js": "bin/barcodes/EAN_UPC/UPC.js",
-        "UPCE.js": "bin/barcodes/EAN_UPC/UPCE.js"
-      }
+      "version": "3.11.6",
+      "resolved": "https://registry.npmmirror.com/jsbarcode/-/jsbarcode-3.11.6.tgz",
+      "integrity": "sha512-G5TKGyKY1zJo0ZQKFM1IIMfy0nF2rs92BLlCz+cU4/TazIc4ZH+X1GYeDRt7TKjrYqmPfTjwTBkU/QnQlsYiuA=="
     },
     "node_modules/jsesc": {
       "version": "2.5.2",
@@ -21083,9 +21028,9 @@
       }
     },
     "jsbarcode": {
-      "version": "3.11.5",
-      "resolved": "https://registry.npmmirror.com/jsbarcode/-/jsbarcode-3.11.5.tgz",
-      "integrity": "sha512-zv3KsH51zD00I/LrFzFSM6dst7rDn0vIMzaiZFL7qusTjPZiPtxg3zxetp0RR7obmjTw4f6NyGgbdkBCgZUIrA=="
+      "version": "3.11.6",
+      "resolved": "https://registry.npmmirror.com/jsbarcode/-/jsbarcode-3.11.6.tgz",
+      "integrity": "sha512-G5TKGyKY1zJo0ZQKFM1IIMfy0nF2rs92BLlCz+cU4/TazIc4ZH+X1GYeDRt7TKjrYqmPfTjwTBkU/QnQlsYiuA=="
     },
     "jsesc": {
       "version": "2.5.2",

+ 1 - 1
package.json

@@ -27,7 +27,7 @@
     "ele-admin": "^1.11.2",
     "element-ui": "2.15.7",
     "github-markdown-css": "^5.1.0",
-    "jsbarcode": "^3.11.5",
+    "jsbarcode": "^3.11.6",
     "json-bigint": "^1.0.0",
     "mathjs": "11.11.0",
     "nprogress": "^0.2.0",

+ 46 - 0
src/api/warehouseManagement/index.js

@@ -283,5 +283,51 @@ export default {
       return res.data.data;
     }
     return Promise.reject(new Error(res.data.message));
+  },
+  // 通过销售发货单获取
+  getBySendRecordNo: async (id) => {
+    const res = await request.get(
+      `/eom/saleordersendrecord/getBySendRecordNo/${id}`
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 库内调拨保存
+  allotApplySave: async (data) => {
+    const res = await request.post('/wms/allotApply/save', data);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 库内调拨列表
+  getAllotApplyPage: async (data) => {
+    const res = await request.get(`/wms/allotApply/page`, {
+      params: data
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 库内调拨详情列表
+  getAllotDetailList: async (data) => {
+    const res = await request.get(`/wms/allotDetail/list`, {
+      params: data
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 库内调拨详情
+  getAllotDetail: async (id) => {
+    const res = await request.get(`/wms/allotApply/getById/${id}`);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
   }
 };

BIN
src/assets/logo.jpg


BIN
src/assets/logo1.jpg


+ 34 - 1
src/views/warehouseManagement/components/AssetsDialog.vue

@@ -100,8 +100,26 @@
             </el-select>
           </el-form-item>
         </el-col>
+        <el-col :span="6">
+          <el-form-item label="所属工厂" prop="factoryId">
+            <el-select
+              filterable
+              placeholder="请选择"
+              v-model="searchForm.factoryId"
+              clearable
+              class="w100"
+            >
+              <el-option
+                v-for="item in factoryList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
 
-        <el-col :span="18">
+        <el-col>
           <div style="float: right">
             <el-button type="primary" @click="doSearch">搜索</el-button>
             <el-button icon="el-icon-refresh-left" @click="reset"
@@ -307,6 +325,7 @@
 </template>
 
 <script>
+  import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
   import storageApi from '@/api/warehouseManagement';
   import AssetTree from '../stockManagement/components/assetTree.vue';
   import { getWarehouseList } from '@/api/classifyManage/itemInformation';
@@ -318,6 +337,7 @@
     },
     data() {
       return {
+        factoryList: [],
         newColumns: [], // 动态表头
         isShowTable: true,
         qualityResultOption: [
@@ -348,6 +368,7 @@
           categoryCode: '',
           categoryName: '',
           batchNo: '',
+          factoryId: '',
           brandNum: '',
           engrave: '',
           barcodes: '',
@@ -365,6 +386,7 @@
     created() {
       this.getFieldModel();
       this.getWarehouse();
+      this.getFactoryList();
     },
     watch: {
       tableData(val) {
@@ -372,6 +394,16 @@
       }
     },
     methods: {
+      //获取工厂列表
+      async getFactoryList() {
+        const res = await warehouseDefinition.getFactoryarea({
+          pageNum: 1,
+          size: 9999,
+          type: 1
+        });
+        this.factoryList = res.list;
+        this.handleList();
+      },
       async getWarehouse() {
         const { data } = await getWarehouseList();
         this.warehouseList = data;
@@ -507,6 +539,7 @@
           engrave: '',
           barcodes: '',
           warehouseId: '',
+          factoryId: '',
           categoryLevelId: this.categoryLevelId,
           pageNum: 1,
           size: 20

+ 8 - 0
src/views/warehouseManagement/inboundRequests/components/tgDetails.vue

@@ -70,6 +70,14 @@
           {
             label: '发货码',
             prop: 'sendCode'
+          },
+          {
+            label: '用途',
+            prop: 'purpose'
+          },
+          {
+            label: '领用人名称',
+            prop: 'userName'
           }
         ]
       };

+ 230 - 26
src/views/warehouseManagement/inventoryAllocation/add.vue

@@ -13,6 +13,7 @@
                 <template>
                   <el-select
                     clearable
+                    @change="allocateChange"
                     style="width: 100%"
                     v-model="allocateId"
                     placeholder="请选择"
@@ -39,7 +40,7 @@
                     placeholder="请选择"
                   >
                     <el-option
-                      v-for="item in warehouseList"
+                      v-for="item in outWarehouseList"
                       :label="item.name"
                       :value="item.id"
                       :key="item.id"
@@ -53,6 +54,7 @@
               <el-form-item label="调入仓库:" prop="warehouseId">
                 <template>
                   <el-select
+                    :disabled="allocateId == 1"
                     clearable
                     style="width: 100%"
                     v-model="params.inWarehouseId"
@@ -60,7 +62,7 @@
                     placeholder="请选择"
                   >
                     <el-option
-                      v-for="item in warehouseList"
+                      v-for="item in inWarehouseList"
                       :label="item.name"
                       :value="item.id"
                       :key="item.id"
@@ -75,23 +77,43 @@
       </div>
       <div class="reservoirArea">
         <div>
-          <div>调出库区</div>
+          <div
+            >调出库区{{
+              currentPullAreaName ? `(${currentPullAreaName})` : '(未选)'
+            }}</div
+          >
           <div class="box">
             <div
-              :class="currentPullAreaId == item.id ? 'red_border' : ''"
+              :class="currentPullAreaId == item.id ? 'click_border' : ''"
               v-for="item in pullLibrary"
-              @click="pullClick(item.id)"
+              @click="pullClick(item.id, item.name)"
               >{{ item.name }}</div
             >
           </div>
         </div>
         <div>
-          <div>调入库区</div>
+          <div
+            >调入库区{{
+              currentTuneAreaName ? `(${currentTuneAreaName})` : '(未选)'
+            }}</div
+          >
           <div class="box">
             <div
-              :class="currentTuneAreaId === item.id ? 'red_border' : ''"
+              :class="
+                allocateId == 1 && currentPullAreaId === item.id
+                  ? 'unClick_color'
+                  : currentTuneAreaId === item.id
+                  ? 'click_border'
+                  : ''
+              "
               v-for="item in tuneLibrary"
-              @click="tuneClick(item.id)"
+              @click="
+                tuneClick(
+                  item.id,
+                  item.name,
+                  allocateId == 1 && currentPullAreaId === item.id
+                )
+              "
               >{{ item.name }}</div
             >
           </div>
@@ -100,14 +122,28 @@
     </el-card>
     <el-card class="box-card">
       <div class="productsList">
-        <div>物品信息</div>
+        <header-title
+          :title="`物品信息${
+            currentPullAreaName ? `(${currentPullAreaName})` : '(未选)'
+          }`"
+          ><el-button type="primary" @click="merge"
+            >调入</el-button
+          ></header-title
+        >
         <el-table
           ref="table"
           :data="productList"
+          @selection-change="selecctedRow"
           tooltip-effect="dark"
           :max-height="500"
           border
         >
+          <el-table-column
+            align="center"
+            width="50"
+            :selectable="checkSelectable"
+            type="selection"
+          ></el-table-column>
           <el-table-column label="序号" type="index" width="50">
           </el-table-column>
           <el-table-column
@@ -235,7 +271,11 @@
         </el-table>
       </div>
       <div class="allocateDetails">
-        <div>调拨明细</div>
+        <header-title :title="`调拨明细`"
+          ><el-button type="primary" @click="submit"
+            >保存</el-button
+          ></header-title
+        >
         <el-table
           ref="table"
           :data="tableData"
@@ -309,13 +349,13 @@
           </el-table-column>
           <el-table-column
             label="调出库区"
-            prop="weightUnit"
+            prop="outWarehouseAreaName"
             :show-overflow-tooltip="true"
           >
           </el-table-column>
           <el-table-column
             label="调入库区"
-            prop="weightUnit"
+            prop="inWarehouseName"
             :show-overflow-tooltip="true"
           >
           </el-table-column>
@@ -334,23 +374,94 @@
           { label: '库内调拨', value: 1 },
           { label: '库外调拨', value: 2 }
         ],
+        selectionIds: [],
+        selection: [],
         tableData: [],
         productList: [],
-        allocateId: 2,
+        allocateId: 1,
         currentPullAreaId: '',
+        currentPullAreaName: '',
         currentTuneAreaId: '',
+        currentTuneAreaName: '',
         pullLibrary: [], // 调出库
         tuneLibrary: [], // 调入库
-        warehouseList: [],
-        params: {}
+        outWarehouseList: [],
+        inWarehouseList: [],
+        params: {
+          outWarehouseId: '',
+          outWarehouseName: '',
+          inWarehouseId: '',
+          inWarehouseName: ''
+        }
       };
     },
     created() {
       this.getWarehouseOptions();
     },
     methods: {
-      pullClick(id) {
-        this.currentPullAreaId = id;
+      submit() {
+        if (this.tableData.length > 0) {
+          let params = {
+            categoryCode: this.tableData
+              .map((item) => item.categoryCode)
+              .join(','),
+            categoryName: this.tableData
+              .map((item) => item.categoryName)
+              .join(','),
+            outInDetailRecordId: this.tableData.map((item) => item.id),
+            sourceWarehouse: this.params.outWarehouseName,
+            sourceWarehouseId: this.params.outWarehouseId,
+            sourceWarehouseArea: this.currentPullAreaName,
+            sourceWarehouseAreaId: this.currentPullAreaId,
+            targetWarehouse: this.params.inWarehouseName,
+            targetWarehouseId: this.params.inWarehouseId,
+            targetWarehouseArea: this.currentTuneAreaName,
+            targetWarehouseAreaId: this.currentTuneAreaId,
+            status: 0,
+            type: this.allocateId
+          };
+          console.log('params------------', params);
+          storageApi.allotApplySave(params).then(() => {
+            this.$message.success('保存成功');
+            this.$router.go(-1);
+          });
+        } else {
+          this.$message.error('请调入相关数据');
+        }
+      },
+      checkSelectable(row) {
+        return !this.selectionIds.includes(row.id);
+      },
+      allocateChange(val) {
+        this.allocateId = val;
+        this.params = {
+          outWarehouseId: '',
+          outWarehouseName: '',
+          inWarehouseId: '',
+          inWarehouseName: ''
+        };
+        this.currentPullAreaId = '';
+        this.currentPullAreaName = '';
+        this.currentTuneAreaId = '';
+        this.currentTuneAreaName = '';
+        this.pullLibrary = [];
+        this.tuneLibrary = [];
+        this.productList = [];
+        this.tableData = [];
+        this.productList = [];
+        this.getWarehouseOptions();
+      },
+      pullClick(id, name) {
+        if (this.currentPullAreaId == id) {
+          return false;
+        } else {
+          console.log('-------------');
+          this.currentPullAreaId = id;
+          this.currentPullAreaName = name;
+          this.currentTuneAreaId = '';
+          this.currentTuneAreaName = '';
+        }
+
         storageApi
           .getPackingList({
             warehouseAreaId: id,
@@ -361,24 +472,72 @@
             this.productList = list;
           });
       },
-      tuneClick(id) {
+      tuneClick(id, name, boolen) {
+        if (!this.currentPullAreaId) {
+          return this.$message.error('请先选择调出库');
+        }
+        if (boolen) {
+          return false;
+        }
         this.currentTuneAreaId = id;
+        this.currentTuneAreaName = name;
+      },
+      selecctedRow(val) {
+        this.selection = val;
       },
       async warehouseChange(val, type) {
         console.log(val);
         console.log(type);
         storageApi.getListByWarehouseId(val).then((data) => {
           console.log(data);
-          if (type === '调出') {
+          if (this.allocateId == 1) {
+            // 库内调拨同步选择仓库
+            this.params.inWarehouseId = val;
             this.pullLibrary = data;
-          } else {
             this.tuneLibrary = data;
+            this.params = {
+              outWarehouseId: val,
+              outWarehouseName: this.outWarehouseList.filter(
+                (item) => item.id == val
+              )[0].name,
+              inWarehouseId: val,
+              inWarehouseName: this.inWarehouseList.filter(
+                (item) => item.id == val
+              )[0].name
+            };
+            console.log(this.params);
+          } else {
+            if (type === '调出') {
+              this.pullLibrary = data;
+              this.currentPullAreaId = '';
+              this.currentPullAreaName = '';
+              this.currentTuneAreaId = '';
+              this.currentTuneAreaName = '';
+              this.inWarehouseList = this.inWarehouseList.filter(
+                (item) => item.id !== val
+              );
+              this.params.outWarehouseId = val;
+              this.params.outWarehouseName = this.outWarehouseList.filter(
+                (item) => item.id === val
+              )[0].name;
+              this.productList = [];
+            } else {
+              this.tuneLibrary = data;
+              this.outWarehouseList = this.outWarehouseList.filter(
+                (item) => item.id !== val
+              );
+              this.params.inWarehouseId = val;
+              this.params.inWarehouseName = this.inWarehouseList.filter(
+                (item) => item.id === val
+              )[0].name;
+            }
           }
         });
       },
       async getWarehouseOptions() {
         const { data } = await storageApi.getWarehouseTrees();
-        this.warehouseList = data;
+        this.outWarehouseList = data;
+        this.inWarehouseList = data;
       },
       getAreaData() {
         console.log('this.current----', this.current.data);
@@ -397,6 +556,45 @@
           pageNum: page,
           size: limit
         });
+      },
+      async merge() {
+        if (
+          this.selection.length > 0 &&
+          this.currentPullAreaId &&
+          this.currentTuneAreaId
+        ) {
+          console.log(this.selection);
+          console.log(this.selectionIds);
+          let boolen = this.selection.every((item) =>
+            this.selectionIds.includes(item.id)
+          );
+          if (this.selection.length > 0 && !boolen) {
+            this.selection = this.selection.filter(
+              (item) => !this.selectionIds.includes(item.id)
+            );
+            this.selectionIds = this.selectionIds.concat(
+              this.selection.map((item) => item.id)
+            );
+            console.log('this.selection---------', this.selection);
+            console.log('this.selectionIds---', this.selectionIds);
+            this.tableData = this.tableData.concat(
+              this.selection.map((item) => {
+                return {
+                  ...item,
+                  outWarehouseAreaId: this.currentPullAreaId,
+                  outWarehouseAreaName: this.currentPullAreaName,
+                  inWarehouseId: this.currentTuneAreaId,
+                  inWarehouseName: this.currentTuneAreaName
+                };
+              })
+            );
+            console.log('this.tableData---------', this.tableData);
+          } else {
+            this.$message.error('请选择正确的行');
+          }
+        } else {
+          this.$message.error('请选择调入库和调出库以及物品信息');
+        }
       }
     }
   };
@@ -409,8 +607,12 @@
     .box-card {
       margin: 20px;
     }
-    .red_border {
-      border-color: red !important;
+    .click_border {
+      box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px,
+        rgb(51, 51, 51) 0px 0px 0px 5px;
+    }
+    .unClick_color {
+      background-color: #ccc !important;
     }
     .reservoirArea {
       display: flex;
@@ -420,14 +622,16 @@
         .box {
           > div {
             display: inline-block;
-            width: 100px;
-            height: 100px;
+            width: 120px;
+            height: 80px;
             margin: 10px;
             margin-left: 0;
             display: flex;
             align-items: center;
             justify-content: center;
-            border: 1px solid #ccc;
+            border-radius: 10px;
+            color: #fff;
+            background-color: #409eff;
             cursor: pointer;
           }
         }

+ 40 - 4
src/views/warehouseManagement/inventoryAllocation/components/inventory-search.vue

@@ -56,10 +56,32 @@
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="组织机构:" prop="deptIds">
-          <auth-selection data-type="Array" v-model="where.deptIds" style="width: 100%"></auth-selection>
+          <auth-selection
+            data-type="Array"
+            v-model="where.deptIds"
+            style="width: 100%"
+          ></auth-selection>
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 12, md: 12 } : { span: 6 }">
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="所属工厂" prop="factoryId">
+          <el-select
+            filterable
+            placeholder="请选择"
+            v-model="where.factoryId"
+            clearable
+            class="w100"
+          >
+            <el-option
+              v-for="item in factoryList"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            ></el-option>
+          </el-select>
+        </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"
@@ -85,6 +107,7 @@
 
 <script>
   import { login } from '@/api/login';
+  import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
   export default {
     data() {
       // 默认表单数据
@@ -94,7 +117,8 @@
       return {
         // 表单数据
         where: { ...defaultWhere },
-        treeData: []
+        treeData: [],
+        factoryList: []
       };
     },
     computed: {
@@ -103,8 +127,20 @@
         return this.$store.state.theme.styleResponsive;
       }
     },
-    created() {},
+    created() {
+      this.getFactoryList();
+    },
     methods: {
+      //获取工厂列表
+      async getFactoryList() {
+        const res = await warehouseDefinition.getFactoryarea({
+          pageNum: 1,
+          size: 9999,
+          type: 1
+        });
+        this.factoryList = res.list;
+        this.handleList();
+      },
       /* 搜索 */
       search() {
         console.log(this.where);

+ 190 - 79
src/views/warehouseManagement/inventoryAllocation/details.vue

@@ -13,12 +13,12 @@
           <el-form label-width="110px">
             <el-col :span="8">
               <el-form-item label="调拨单号">
-                <span>{{ infoData.dialNumber }}</span>
+                <span>{{ infoData.id }}</span>
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="创建人">
-                <span>{{ infoData.createUserName }}</span>
+                <span>{{ infoData.allotName }}</span>
               </el-form-item>
             </el-col>
             <el-col :span="8">
@@ -29,32 +29,117 @@
             <el-col :span="8">
               <el-form-item label="调拨类型">
                 <span>{{
-                  infoData.dialType | dictFilter(allocationType)
+                  allocationType.filter((item) => item.code == infoData.type)[0]
+                    .label
                 }}</span>
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="调出库">
-                <span>{{ infoData.warehouseName }}</span>
+                <span>{{ infoData.sourceWarehouse }}</span>
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="调入库">
-                <span>{{ infoData.inWarehouseName }}</span>
+                <span>{{ infoData.targetWarehouse }}</span>
               </el-form-item>
             </el-col>
           </el-form>
         </div>
       </div>
       <div class="content-detail mt20">
-		<HeaderTitle title="调拨明细" size="16px"></HeaderTitle>
+        <HeaderTitle title="调拨明细" size="16px"></HeaderTitle>
         <div class="mt20">
-          <AssetsCell
+          <!-- <AssetsCell
             v-for="(item, index) in detailList"
             :key="index"
             :item="item"
             type="detail"
-          />
+          /> -->
+          <el-table
+            ref="table"
+            :data="detailList"
+            tooltip-effect="dark"
+            :max-height="500"
+            border
+          >
+            <el-table-column label="序号" type="index" width="50">
+            </el-table-column>
+            <el-table-column
+              label="物品编码"
+              prop="categoryCode"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="物品名称"
+              prop="categoryName"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="牌号"
+              prop="brandNum"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="型号"
+              prop="categoryModel"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="规格"
+              prop="specification"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="包装编码"
+              prop="packageNo"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="包装数量"
+              prop="packingQuantity"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="包装单位"
+              prop="packingUnit"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="计量数量"
+              prop="measureQuantity"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="计量单位"
+              prop="measureUnit"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="重量"
+              prop="weight"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="重量单位"
+              prop="weightUnit"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="调出库区"
+              prop="outWarehouseAreaName"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="调入库区"
+              prop="inWarehouseName"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+          </el-table>
         </div>
       </div>
     </div>
@@ -62,85 +147,111 @@
 </template>
 
 <script>
-import AssetsCell from './components/AssetsCell'
-// import { getDetail } from '@/api/stockManagement/inventoryAllocation'
-import PageHeader from '@/components/PageHeader'
-import { allocationType } from '@/utils/dict/warehouse'
-import { useDictLabelFilter } from '@/utils/dict'
-import StatusStep from '@/components/StatusStep/index.vue'
+  import storageApi from '@/api/warehouseManagement/index.js';
+  import AssetsCell from './components/AssetsCell';
+  // import { getDetail } from '@/api/stockManagement/inventoryAllocation'
+  import PageHeader from '@/components/PageHeader';
+  import { allocationType } from '@/utils/dict/warehouse';
+  import { useDictLabelFilter } from '@/utils/dict';
+  import StatusStep from '@/components/StatusStep/index.vue';
 
-export default {
-  components: { AssetsCell, StatusStep , PageHeader	},
-  data () {
-    return {
-      allocationType,
-      auditStatus: [
-        { code: 4, label: '草稿', class: '' },
-        { code: 0, label: '已驳回', class: 'danger-text' },
-        { code: 1, label: '待审核', class: 'primary-text' },
-        { code: 2, label: '已审核', class: 'primary-text' }
-      ],
-      detailList: [],
-      infoData: {}
-    }
-  },
-  created () {
-    this._getDetail()
-  },
-  filters: {
-    dictFilter: useDictLabelFilter
-  },
-  computed: {
-    statusList () {
-      const base = [{ label: '创建' }]
-      console.log(this.infoData.auditStatus, 'this.infoData.auditStatus')
-      if (this.infoData.auditStatus == 4) {
-        base.push({ code: 4, label: '草稿' })
-      }
-      base.push({ code: 1, label: '待审核' })
+  export default {
+    components: { AssetsCell, StatusStep, PageHeader },
+    data() {
+      return {
+        allocationType,
+        auditStatus: [
+          { code: 4, label: '草稿', class: '' },
+          { code: 0, label: '已驳回', class: 'danger-text' },
+          { code: 1, label: '待审核', class: 'primary-text' },
+          { code: 2, label: '已审核', class: 'primary-text' }
+        ],
+        detailList: [],
+        infoData: {}
+      };
+    },
+    created() {
+      this._getDetail();
+    },
+    filters: {
+      dictFilter: useDictLabelFilter
+    },
+    computed: {
+      statusList() {
+        const base = [{ label: '创建' }];
+        console.log(this.infoData.auditStatus, 'this.infoData.auditStatus');
+        if (this.infoData.auditStatus == 4) {
+          base.push({ code: 4, label: '草稿' });
+        }
+        base.push({ code: 1, label: '待审核' });
 
-      if (this.infoData.auditStatus == 0) {
-        base.push({ code: 0, label: '已驳回', activeColor: '#cc3300' })
-      } else {
-        if ([1, 2, 4].includes(this.infoData.auditStatus)) {
-          base.push({ code: 2, label: '已完成', activeColor: '#157a2c' })
+        if (this.infoData.auditStatus == 0) {
+          base.push({ code: 0, label: '已驳回', activeColor: '#cc3300' });
+        } else {
+          if ([1, 2, 4].includes(this.infoData.auditStatus)) {
+            base.push({ code: 2, label: '已完成', activeColor: '#157a2c' });
+          }
         }
+        console.log(base, 'base');
+        return base;
       }
-      console.log(base, 'base')
-      return base
-    }
-  },
-  methods: {
-    async _getDetail () {
-      const res = await getDetail({ id: this.$route.query.id })
-      if (res?.success) {
-        this.infoData = res.data.conventionalStockTransfer
-        this.detailList = res.data.stockTransferInfoList.map(i => ({
-          batchNum: i.batchNo,
-          ...i
-        }))
+    },
+    methods: {
+      async _getDetail() {
+        const res = await storageApi.getAllotDetailList({
+          applyId: this.$route.query.id
+        });
+        const data = await storageApi.getAllotDetail(this.$route.query.id);
+        console.log(res);
+        console.log(data);
+        this.infoData = data;
+        if (this.infoData.type == 1) {
+          // 库内调拨
+          this.infoData.auditStatus = 2;
+          this.detailList = res.map((item) => {
+            return {
+              ...item,
+              categoryCode: this.infoData.categoryCode,
+              categoryName: this.infoData.categoryName,
+              brandNum: this.infoData.brandNum,
+              categoryModel: this.infoData.model,
+              specification: this.infoData.specification,
+              outWarehouseAreaName: this.infoData.sourceWarehouse,
+              inWarehouseName: this.infoData.targetWarehouse
+            };
+          });
+        } else {
+          // 库外调拨
+        }
+
+        // if (res?.success) {
+        //   this.infoData = res.data.conventionalStockTransfer;
+        //   this.detailList = res.data.stockTransferInfoList.map((i) => ({
+        //     batchNum: i.batchNo,
+        //     ...i
+        //   }));
+        // }
       }
     }
-  }
-}
+  };
 </script>
 
 <style lang="scss" scoped>
-.p20 {
-  padding: 20px;
-}
-.mt40 {
-  margin-top: 40px;
-}
+  .p20 {
+    padding: 20px;
+  }
+  .mt40 {
+    margin-top: 40px;
+  }
 
-.mt20 {
-  margin-top: 20px;
-}
-.content-detail {
-  overflow: hidden;
-}
-.content-height{
-	height: auto;
-	background: #fff;
-}
+  .mt20 {
+    margin-top: 20px;
+  }
+  .content-detail {
+    overflow: hidden;
+  }
+  .content-height {
+    height: auto;
+    background: #fff;
+  }
 </style>

+ 38 - 88
src/views/warehouseManagement/inventoryAllocation/index.vue

@@ -9,45 +9,19 @@
         :datasource="datasource"
         cache-key="systemRoleTable"
       >
-        <!-- 表头工具栏 -->
         <template v-slot:toolbar>
-          <el-button
-            size="small"
-            type="primary"
-            icon="el-icon-plus"
-            class="ele-btn-icon"
-            @click="addClick()"
-          >
-            新建
-          </el-button>
-          <!-- <el-button
-            size="small"
-            type="primary"
-            class="ele-btn-icon"
-            @click="goDetail()"
+          <el-button icon="el-icon-plus" type="primary" @click="add"
+            >新建</el-button
           >
-            详情
-          </el-button> -->
         </template>
-        <!-- 	     <template v-slot:enable="{ row }">
-	       <el-switch
-	         v-model="row.enable"
-	         active-color="#13ce66"
-	         inactive-color="#ff4949"
-	         :active-value="1"
-	         :inactive-value="0"
-	         @change="changeEnable(row)"
-	       >
-	       </el-switch>
-	     </template> -->
         <template v-slot:action="{ row }">
           <el-link
             type="primary"
             :underline="false"
-            icon="el-icon-edit"
-            @click="revocationRow(row)"
+            icon="el-icon-view"
+            @click="goDetail(row)"
           >
-            撤回
+            详情
           </el-link>
         </template>
       </ele-pro-table>
@@ -56,6 +30,8 @@
 </template>
 
 <script>
+  import { allocationType } from '@/utils/dict/warehouse';
+  import storageApi from '@/api/warehouseManagement/index.js';
   import InventorySearch from './components/inventory-search.vue';
   import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
   import { pageRoles } from '@/api/system/role';
@@ -65,6 +41,7 @@
     },
     data() {
       return {
+        allocationType,
         // 表格列配置
         columns: [
           {
@@ -77,44 +54,27 @@
             fixed: 'left'
           },
           {
-            prop: 'itemName',
+            prop: 'categoryName',
             label: '物品名称',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
-            prop: 'code',
-            label: '编码',
+            prop: 'type',
+            label: '调拨类型',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 110
+            minWidth: 110,
+            formatter: (row, column, cellValue) => {
+              return this.allocationType.filter(
+                (item) => item.code == row.type
+              )[0].label;
+            }
           },
           {
-            prop: 'modelType',
-            label: '型号',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'quantity',
-            label: '数量',
-            align: 'center',
-            showOverflowTooltip: true,
-            slot: 'enable',
-            minWidth: 110
-          },
-          {
-            prop: 'weight',
-            label: '重量',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'batchNo',
-            label: '批次',
+            prop: 'categoryCode',
+            label: '物品编码',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
@@ -146,6 +106,14 @@
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 300,
+            align: 'center',
+            slot: 'action',
+            showOverflowTooltip: true
           }
         ],
         // 加载状态
@@ -154,49 +122,31 @@
     },
     computed: {},
     methods: {
+      // 新建
+      add() {
+        this.$router.push({
+          path: '/warehouseManagement/inventoryAllocation/add'
+        });
+      },
       /* 表格数据源 */
       datasource({ page, limit, where }) {
-        return warehouseDefinition.allotRecord({
+        return storageApi.getAllotApplyPage({
           pageNum: page,
           size: limit,
           ...where
         });
       },
-      async changeEnable(row) {
-        const res = await putRoles(row);
-        if (res.code == 0) {
-          this.$message({
-            type: 'success',
-            message: '修改成功',
-            customClass: 'ele-message-border'
-          });
-          this.reload();
-        }
-      },
       /* 刷新表格 */
       reload(where) {
         this.$refs.table.reload({ page: 1, where });
       },
-
       // 详情
-      goDetail() {
+      goDetail(row) {
         this.$router.push({
-          path: '/warehouseManagement/inventoryAllocation/details'
-          // query: {
-          //   id
-          // }
+          path: '/warehouseManagement/inventoryAllocation/details',
+          query: { id: row.id }
         });
-      },
-
-      // 新增
-      addClick() {
-        this.$router.push({
-          path: '/warehouseManagement/inventoryAllocation/add'
-        });
-      },
-
-      // 撤回
-      revocationRow(row) {}
+      }
     }
   };
 </script>

+ 8 - 0
src/views/warehouseManagement/outgoingManagement/add.vue

@@ -268,6 +268,14 @@
                   {{ row.totalMoney ? row.totalMoney : 0 }}
                 </template>
               </el-table-column>
+
+              <el-table-column
+                v-if="clientEnvironmentId == 4"
+                label="采购原因"
+                align="center"
+                prop="purpose"
+                :show-overflow-tooltip="true"
+              ></el-table-column>
               <el-table-column
                 v-if="clientEnvironmentId == 4"
                 label="采购原因"

+ 321 - 0
src/views/warehouseManagement/outgoingManagement/components/print.vue

@@ -0,0 +1,321 @@
+<template>
+  <ele-modal
+    title="出库单"
+    :visible.sync="QRvisible"
+    v-if="QRvisible"
+    width="90%"
+  >
+    <div
+      id="printSection"
+      style="
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        flex-direction: column;
+      "
+    >
+      <table
+        cellspacing="0"
+        style="
+          width: 100%;
+          table-layout: fixed;
+          word-break: break-all;
+          word-wrap: break-word;
+        "
+      >
+        <tbody>
+          <tr align="center">
+            <td colspan="12" style="font-size: 28px; font-weight: bold">
+              嘉实(湖南)医药科技有限公司产品出库单
+            </td>
+          </tr>
+          <tr>
+            <td colspan="4" style="padding: 10px">
+              制单日期:{{ getNowFormatDate() }}
+            </td>
+            <td colspan="4" style="padding: 10px">
+              发货日期: {{ getNowFormatDate() }}</td
+            >
+            <td colspan="4" style="padding: 10px">
+              出库日期:{{ getNowFormatDate() }}
+            </td>
+          </tr>
+          <tr>
+            <td colspan="4" style="padding: 10px">
+              上市许可持有人:嘉实(湖南)医药科技有限公司</td
+            >
+            <td colspan="4" style="padding: 10px">
+              地址: 长沙高新开发区汇智中路179号金导园C区8栋</td
+            >
+            <td colspan="4" style="padding: 10px"> 电话: 0731-84221288</td>
+          </tr>
+          <tr>
+            <td colspan="4" style="padding: 10px"> 受托生产企业:</td>
+            <td colspan="8" style="padding: 10px"> 地址: </td>
+          </tr>
+          <tr>
+            <td colspan="4" style="padding: 10px"> 购货单位:</td>
+            <td colspan="8" style="padding: 10px"> 收货地址: </td>
+          </tr>
+        </tbody>
+      </table>
+      <table
+        border
+        cellspacing="0"
+        style="
+          width: 100%;
+          table-layout: fixed;
+          word-break: break-all;
+          word-wrap: break-word;
+        "
+      >
+        <tbody>
+          <tr align="center">
+            <td style="padding: 10px 0"> 产品名称 </td>
+            <td style="padding: 10px 0"> 规格 </td>
+            <td style="padding: 10px 0"> 包装规格 </td>
+            <td style="padding: 10px 0"> 剂型 </td>
+            <td style="padding: 10px 0"> 批准文号 </td>
+            <td style="padding: 10px 0"> 批号 </td>
+            <td style="padding: 10px 0"> 单位 </td>
+            <td style="padding: 10px 0"> 数量 </td>
+            <td style="padding: 10px 0"> 单价(元) </td>
+            <td style="padding: 10px 0"> 金额(元) </td>
+            <td style="padding: 10px 0"> 有效期 </td>
+            <td style="padding: 10px 0"> 备注 </td>
+          </tr>
+          <tr align="center" v-for="(item, index) in codeList">
+            <td style="padding: 10px 0">{{ item.categoryCode }}</td>
+            <td style="padding: 10px 0">{{ item.categoryName }}</td>
+            <td style="padding: 10px 0"
+              >{{ item.specification }}{{ item.categoryModel }}</td
+            >
+            <td style="padding: 10px 0">{{ item.measureUnit }}</td>
+            <td style="padding: 10px 0">{{ item.measureQuantity }}</td>
+            <td style="padding: 10px 0">{{ item.packingQuantity }}</td>
+            <td style="padding: 10px 0">{{ item.packagingStrength }}</td>
+            <td style="padding: 10px 0">{{ item.packagingDensity }}</td>
+            <td style="padding: 10px 0">{{ item.remark }}</td>
+            <td style="padding: 10px 0">{{ item.packagingDensity }}</td>
+            <td style="padding: 10px 0">{{ item.remark }}</td>
+            <td style="padding: 10px 0">{{ item.remark }}</td>
+          </tr>
+          <tr align="center">
+            <td colspan="7" style="padding: 10px 0"> 合计 </td>
+            <td style="padding: 10px 0"></td>
+            <td style="padding: 10px 0"></td>
+            <td style="padding: 10px 0"></td>
+            <td style="padding: 10px 0"></td>
+            <td style="padding: 10px 0"></td>
+          </tr>
+        </tbody>
+      </table>
+      <table
+        cellspacing="0"
+        style="
+          width: 100%;
+          table-layout: fixed;
+          word-break: break-all;
+          word-wrap: break-word;
+        "
+      >
+        <tbody>
+          <tr>
+            <td colspan="3" style="padding: 10px 0">
+              开票员:{{ this.formData.driverNames }}</td
+            >
+            <td colspan="3" style="padding: 10px 0"> 保管员:</td>
+            <td colspan="3" style="padding: 10px 0"> 复核:</td>
+            <td colspan="3" style="padding: 10px 0">
+              发货员:{{ this.formData.markerName }}</td
+            >
+          </tr>
+          <tr>
+            <td colspan="3" style="padding: 10px 0"> 白联:开票留存 </td>
+            <td colspan="3" style="padding: 10px 0"> 红联:仓库留存 </td>
+            <td colspan="3" style="padding: 10px 0"> 蓝联:财务留存 </td>
+            <td colspan="3" style="padding: 10px 0"> 绿联/黄联:随货同行 </td>
+          </tr>
+        </tbody>
+      </table>
+      <!-- <div class="person">
+        <div> 承运人:</div>
+        <div> 装卸工:</div>
+        <div> 签收人:</div>
+        <div> 制单人:</div>
+      </div> -->
+      <!-- <div class="person">
+        <div
+          ><span>物流服务评价:</span
+          ><el-checkbox v-model="checked1">满意</el-checkbox>
+          <el-checkbox v-model="checked1">不满意</el-checkbox></div
+        >
+        <div> 打印时间:</div>
+      </div> -->
+      <!-- <div class="person">
+        <div> (白)记账联 </div>
+        <div> (红)客户留存联 </div>
+        <div> (蓝)结算联 </div>
+        <div> (绿)运费联 </div>
+        <div> (黄)装卸联 </div>
+        <div> (白)出门联 </div>
+      </div> -->
+    </div>
+
+    <div slot="footer">
+      <el-button @click="print">打印预览</el-button>
+      <el-button @click="close">关闭</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import { mapGetters } from 'vuex';
+  import JsBarcode from 'jsbarcode';
+  import storageApi from '@/api/warehouseManagement';
+  export default {
+    name: 'print',
+    computed: {
+      ...mapGetters(['user'])
+    },
+    data() {
+      return {
+        checked: '',
+        QRvisible: false,
+        codeList: [],
+        formData: {}
+      };
+    },
+
+    methods: {
+      open(id) {
+        console.log(this.user);
+        // 制单人
+        storageApi.getInboundDetailsById(id).then((res) => {
+          this.formData = res;
+          this.formData.markerName = this.user.info.name;
+          this.codeList = res.outInDetailList;
+          this.codeList.reduce((total, item) => {
+            return (total += item.measureQuantity);
+          }, 0);
+          storageApi.getBySendRecordNo(res.sourceBizNo).then((data) => {
+            console.log('res---------', data);
+            if (JSON.stringify(data) != '{}') {
+              this.formData.projectName = data.saleOrder?.projectName;
+              this.formData.carNo = data.carNo; // 车牌号
+              this.formData.linkName = data.linkName; // 客户名称
+              this.formData.linkPhone = data.linkPhone; // 客户电话
+              this.formData.driverNames = data.logisticTrakListNoteVOList
+                .map((item) => item.driverName)
+                .join(','); // 承运人
+              this.codeList = this.codeList.map((item) => {
+                let obj = data.productList.filter(
+                  (proItem) => proItem.productId == item.categoryId
+                )[0];
+                console.log('obj---------', obj);
+                return {
+                  ...item,
+                  packagingDensity: obj.extField.packagingDensity,
+                  packagingStrength: obj.extField.packagingStrength
+                };
+              });
+            }
+            this.QRvisible = true;
+            this.$nextTick(() => {
+              JsBarcode('#print', '12345678', {
+                format: 'CODE39', //选择要使用的条形码类型
+                width: 1, //设置条之间的宽度
+                height: 50, //高度
+                displayValue: false, //是否在条形码下方显示文字
+                text: '', //覆盖显示的文本
+                fontOptions: 'bold italic', //使文字加粗体或变斜体
+                font: 'fantasy', //设置文本的字体
+                textAlign: 'right', //设置文本的水平对齐方式
+                textPosition: 'top', //设置文本的垂直位置
+                textMargin: 1, //设置条形码和文本之间的间距
+                fontSize: 15, //设置文本的大小
+                background: '#fff', //设置条形码的背景
+                lineColor: '#000', //设置条和文本的颜色。
+                margin: 2 //设置条形码周围的空白边距
+              });
+            });
+          });
+        });
+      },
+      close() {
+        this.QRvisible = false;
+      },
+      //获取当前日期函数
+      getNowFormatDate() {
+        let date = new Date(),
+          obj = {
+            year: date.getFullYear(), //获取完整的年份(4位)
+            month: date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
+            strDate: date.getDate(), // 获取当前日(1-31)
+            week: '星期' + '日一二三四五六'.charAt(date.getDay()), //获取当前星期几(0 ~ 6,0代表星期天)
+            hour: date.getHours(), //获取当前小时(0 ~ 23)
+            minute: date.getMinutes(), //获取当前分钟(0 ~ 59)
+            second: date.getSeconds() //获取当前秒数(0 ~ 59)
+          };
+        Object.keys(obj).forEach((key) => {
+          if (obj[key] < 10) obj[key] = `0${obj[key]}`;
+        });
+        // return `${obj.year}年${obj.month}月${obj.strDate}日 ${obj.hour}:${obj.minute}:${obj.second}`;
+        return `${obj.year}-${obj.month}-${obj.strDate}`;
+      },
+      print() {
+        const printSection = document.getElementById('printSection');
+        // 创建打印任务
+        const printWindow = window.open('', '_blank');
+        printWindow.document.open();
+        printWindow.document.write('<html><head><title>打印预览</title>');
+        printWindow.document.write(
+          '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
+        );
+        printWindow.document.write('</head><body>');
+        printWindow.document.write(printSection.innerHTML);
+        printWindow.document.write('</body></html>');
+        printWindow.document.close();
+        printWindow.onload = function () {
+          printWindow.print();
+        };
+      }
+    }
+  };
+</script>
+
+<style lang="scss">
+  #printSection {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    flex-direction: column;
+    .table_box {
+      width: 70%;
+      table-layout: fixed;
+      word-break: break-all;
+      word-wrap: break-word;
+    }
+    th,
+    td {
+      padding: 20px;
+      position: relative;
+    }
+    .barCode {
+      position: absolute;
+      right: 10px;
+      top: 50%;
+      transform: translateY(-50%);
+    }
+    .person {
+      width: 70%;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      margin-bottom: 10px;
+      > div {
+        flex: 1;
+      }
+    }
+  }
+</style>

+ 356 - 0
src/views/warehouseManagement/outgoingManagement/components/print1.vue

@@ -0,0 +1,356 @@
+<template>
+  <ele-modal
+    title="出库单"
+    :visible.sync="QRvisible"
+    v-if="QRvisible"
+    width="90%"
+  >
+    <div
+      id="printSection"
+      style="
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        flex-direction: column;
+      "
+    >
+      <table
+        cellspacing="0"
+        style="
+          width: 100%;
+          table-layout: fixed;
+          word-break: break-all;
+          word-wrap: break-word;
+        "
+      >
+        <tbody>
+          <tr align="center">
+            <td colspan="3">
+              <div
+                style="
+                  display: flex;
+                  align-items: center;
+                  justify-content: center;
+                "
+              >
+                <img
+                  style="width: 80px; height: 80px"
+                  src="@/assets/logo.jpg"
+                  alt=""
+                />
+                <div>
+                  <div style="font-size: 14px">湖南宝悦新型建材有限公司</div>
+                  <div style="font-size: 10px"
+                    >HUNAN BAO YUE BULIDING MATERAIL</div
+                  >
+                </div>
+              </div>
+            </td>
+            <td colspan="3" style="font-size: 28px; font-weight: bold">
+              销 售 出 库 单
+            </td>
+            <td colspan="3"><svg id="print"></svg></td>
+          </tr>
+          <tr>
+            <td colspan="3" style="padding: 10px">
+              出库单号:{{ formData.bizNo }}
+            </td>
+            <td colspan="3" style="padding: 10px">
+              项目: {{ formData.projectName }}</td
+            >
+            <td colspan="3" style="padding: 10px">
+              日期:{{ getNowFormatDate() }}
+            </td>
+          </tr>
+          <tr>
+            <td colspan="3" style="padding: 10px">
+              客户:{{ formData.linkName }}</td
+            >
+            <td colspan="3" style="padding: 10px">
+              联系电话: {{ formData.linkPhone }}</td
+            >
+            <td colspan="3" style="padding: 10px">
+              车牌号: {{ formData.carNo }}</td
+            >
+          </tr>
+        </tbody>
+      </table>
+      <table
+        border
+        cellspacing="0"
+        style="
+          width: 100%;
+          table-layout: fixed;
+          word-break: break-all;
+          word-wrap: break-word;
+        "
+      >
+        <tbody>
+          <tr align="center">
+            <td style="padding: 10px 0"> 产品编码 </td>
+            <td style="padding: 10px 0"> 产品名称 </td>
+            <td style="padding: 10px 0"> 规格型号 </td>
+            <td style="padding: 10px 0"> 单位 </td>
+            <td style="padding: 10px 0"> 数量 </td>
+            <td style="padding: 10px 0"> 块数 </td>
+            <td style="padding: 10px 0"> 强度 </td>
+            <td style="padding: 10px 0"> 密度 </td>
+            <td style="padding: 10px 0"> 备注 </td>
+          </tr>
+          <tr align="center" v-for="(item, index) in codeList">
+            <td style="padding: 10px 0">{{ item.categoryCode }}</td>
+            <td style="padding: 10px 0">{{ item.categoryName }}</td>
+            <td style="padding: 10px 0"
+              >{{ item.specification }}{{ item.categoryModel }}</td
+            >
+            <td style="padding: 10px 0">{{ item.measureUnit }}</td>
+            <td style="padding: 10px 0">{{ item.measureQuantity }}</td>
+            <td style="padding: 10px 0">{{ item.packingQuantity }}</td>
+            <td style="padding: 10px 0">{{ item.packagingStrength }}</td>
+            <td style="padding: 10px 0">{{ item.packagingDensity }}</td>
+            <td style="padding: 10px 0">{{ item.remark }}</td>
+          </tr>
+          <tr align="center">
+            <td colspan="4" style="padding: 10px 0"> 合计 </td>
+            <td colspan="1" style="padding: 10px 0">
+              {{
+                codeList.reduce((total, item) => {
+                  return (total += item.measureQuantity);
+                }, 0)
+              }}
+            </td>
+            <td style="padding: 10px 0"></td>
+            <td colspan="2" style="padding: 10px 0"></td>
+            <td colspan="1" style="padding: 10px 0"></td>
+          </tr>
+          <tr align="center">
+            <td colspan="3" style="padding: 10px 0">
+              注意事项:遗失托盘赔偿260/个
+            </td>
+            <td colspan="2" style="padding: 10px 0"> 装车托盘数:</td>
+            <td style="padding: 10px 0"></td>
+            <td style="padding: 10px 0"> 带回托盘数: </td>
+            <td colspan="2" style="padding: 10px 0"></td>
+          </tr>
+        </tbody>
+      </table>
+      <table
+        cellspacing="0"
+        style="
+          width: 100%;
+          table-layout: fixed;
+          word-break: break-all;
+          word-wrap: break-word;
+        "
+      >
+        <tbody>
+          <tr>
+            <td colspan="3" style="padding: 10px 0">
+              承运人:{{ this.formData.driverNames }}</td
+            >
+            <td colspan="3" style="padding: 10px 0"> 装卸工:</td>
+            <td colspan="3" style="padding: 10px 0"> 签收人:</td>
+            <td colspan="3" style="padding: 10px 0">
+              制单人:{{ this.formData.markerName }}</td
+            >
+          </tr>
+          <tr>
+            <td colspan="8" style="padding: 10px 0"
+              >物流服务评价:<el-checkbox v-model="checked">满意</el-checkbox
+              ><el-checkbox v-model="checked">不满意</el-checkbox></td
+            >
+            <td colspan="4" style="padding: 10px 0"
+              >打印时间:{{ getNowFormatDate() }}</td
+            >
+          </tr>
+          <tr>
+            <td colspan="2" style="padding: 10px 0"> (白)记账联 </td>
+            <td colspan="2" style="padding: 10px 0"> (红)客户留存联 </td>
+            <td colspan="2" style="padding: 10px 0"> (蓝)结算联 </td>
+            <td colspan="2" style="padding: 10px 0"> (绿)运费联 </td>
+            <td colspan="2" style="padding: 10px 0"> (黄)装卸联 </td>
+            <td colspan="2" style="padding: 10px 0"> (白)出门联 </td>
+          </tr>
+        </tbody>
+      </table>
+      <!-- <div class="person">
+        <div> 承运人:</div>
+        <div> 装卸工:</div>
+        <div> 签收人:</div>
+        <div> 制单人:</div>
+      </div> -->
+      <!-- <div class="person">
+        <div
+          ><span>物流服务评价:</span
+          ><el-checkbox v-model="checked1">满意</el-checkbox>
+          <el-checkbox v-model="checked1">不满意</el-checkbox></div
+        >
+        <div> 打印时间:</div>
+      </div> -->
+      <!-- <div class="person">
+        <div> (白)记账联 </div>
+        <div> (红)客户留存联 </div>
+        <div> (蓝)结算联 </div>
+        <div> (绿)运费联 </div>
+        <div> (黄)装卸联 </div>
+        <div> (白)出门联 </div>
+      </div> -->
+    </div>
+
+    <div slot="footer">
+      <el-button @click="print">打印预览</el-button>
+      <el-button @click="close">关闭</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import { mapGetters } from 'vuex';
+  import JsBarcode from 'jsbarcode';
+  import storageApi from '@/api/warehouseManagement';
+  export default {
+    name: 'print',
+    computed: {
+      ...mapGetters(['user'])
+    },
+    data() {
+      return {
+        checked: '',
+        QRvisible: false,
+        codeList: [],
+        formData: {}
+      };
+    },
+
+    methods: {
+      open(id) {
+        console.log(this.user);
+        // 制单人
+        storageApi.getInboundDetailsById(id).then((res) => {
+          this.formData = res;
+          this.formData.markerName = this.user.info.name;
+          this.codeList = res.outInDetailList;
+          this.codeList.reduce((total, item) => {
+            return (total += item.measureQuantity);
+          }, 0);
+          storageApi.getBySendRecordNo(res.sourceBizNo).then((data) => {
+            console.log('res---------', data);
+            if (JSON.stringify(data) != '{}') {
+              this.formData.projectName = data.saleOrder?.projectName;
+              this.formData.carNo = data.carNo; // 车牌号
+              this.formData.linkName = data.linkName; // 客户名称
+              this.formData.linkPhone = data.linkPhone; // 客户电话
+              this.formData.driverNames = data.logisticTrakListNoteVOList
+                .map((item) => item.driverName)
+                .join(','); // 承运人
+              this.codeList = this.codeList.map((item) => {
+                let obj = data.productList.filter(
+                  (proItem) => proItem.productId == item.categoryId
+                )[0];
+                console.log('obj---------', obj);
+                return {
+                  ...item,
+                  packagingDensity: obj.extField.packagingDensity,
+                  packagingStrength: obj.extField.packagingStrength
+                };
+              });
+            }
+            this.QRvisible = true;
+            this.$nextTick(() => {
+              JsBarcode('#print', '12345678', {
+                format: 'CODE39', //选择要使用的条形码类型
+                width: 1, //设置条之间的宽度
+                height: 50, //高度
+                displayValue: false, //是否在条形码下方显示文字
+                text: '', //覆盖显示的文本
+                fontOptions: 'bold italic', //使文字加粗体或变斜体
+                font: 'fantasy', //设置文本的字体
+                textAlign: 'right', //设置文本的水平对齐方式
+                textPosition: 'top', //设置文本的垂直位置
+                textMargin: 1, //设置条形码和文本之间的间距
+                fontSize: 15, //设置文本的大小
+                background: '#fff', //设置条形码的背景
+                lineColor: '#000', //设置条和文本的颜色。
+                margin: 2 //设置条形码周围的空白边距
+              });
+            });
+          });
+        });
+      },
+      close() {
+        this.QRvisible = false;
+      },
+      //获取当前日期函数
+      getNowFormatDate() {
+        let date = new Date(),
+          obj = {
+            year: date.getFullYear(), //获取完整的年份(4位)
+            month: date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
+            strDate: date.getDate(), // 获取当前日(1-31)
+            week: '星期' + '日一二三四五六'.charAt(date.getDay()), //获取当前星期几(0 ~ 6,0代表星期天)
+            hour: date.getHours(), //获取当前小时(0 ~ 23)
+            minute: date.getMinutes(), //获取当前分钟(0 ~ 59)
+            second: date.getSeconds() //获取当前秒数(0 ~ 59)
+          };
+        Object.keys(obj).forEach((key) => {
+          if (obj[key] < 10) obj[key] = `0${obj[key]}`;
+        });
+        // return `${obj.year}年${obj.month}月${obj.strDate}日 ${obj.hour}:${obj.minute}:${obj.second}`;
+        return `${obj.year}-${obj.month}-${obj.strDate}`;
+      },
+      print() {
+        const printSection = document.getElementById('printSection');
+        // 创建打印任务
+        const printWindow = window.open('', '_blank');
+        printWindow.document.open();
+        printWindow.document.write('<html><head><title>打印预览</title>');
+        printWindow.document.write(
+          '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
+        );
+        printWindow.document.write('</head><body>');
+        printWindow.document.write(printSection.innerHTML);
+        printWindow.document.write('</body></html>');
+        printWindow.document.close();
+        printWindow.onload = function () {
+          printWindow.print();
+        };
+      }
+    }
+  };
+</script>
+
+<style lang="scss">
+  #printSection {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    flex-direction: column;
+    .table_box {
+      width: 70%;
+      table-layout: fixed;
+      word-break: break-all;
+      word-wrap: break-word;
+    }
+    th,
+    td {
+      padding: 20px;
+      position: relative;
+    }
+    .barCode {
+      position: absolute;
+      right: 10px;
+      top: 50%;
+      transform: translateY(-50%);
+    }
+    .person {
+      width: 70%;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      margin-bottom: 10px;
+      > div {
+        flex: 1;
+      }
+    }
+  }
+</style>

+ 245 - 0
src/views/warehouseManagement/outgoingManagement/components/print2.vue

@@ -0,0 +1,245 @@
+<template>
+  <ele-modal
+    title="出库单"
+    :visible.sync="QRvisible"
+    v-if="QRvisible"
+    width="90%"
+  >
+    <div
+      id="printSection"
+      style="
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        flex-direction: column;
+      "
+    >
+      <table
+        border
+        cellspacing="0"
+        style="
+          width: 100%;
+          table-layout: fixed;
+          word-break: break-all;
+          word-wrap: break-word;
+        "
+      >
+        <tbody>
+          <tr align="center">
+            <td colspan="4">
+              <div
+                style="
+                  display: flex;
+                  align-items: center;
+                  justify-content: center;
+                "
+              >
+                <img
+                  style="width: 60px; height: 50px"
+                  src="@/assets/logo1.jpg"
+                  alt=""
+                />
+                <div>
+                  <div style="font-size: 14px">嘉实医药</div>
+                  <div style="font-size: 10px">HARVEST PHARMACEUTICALS</div>
+                </div>
+              </div>
+            </td>
+            <td colspan="6"> 文件编码: R10/SMP-XS-005-01 </td>
+          </tr>
+          <tr align="center">
+            <td colspan="4" style="padding: 10px"> 编号:SMP-XS-005-01 </td>
+            <td colspan="6" style="padding: 10px"> 名称: 产品出库通知单</td>
+          </tr>
+        </tbody>
+      </table>
+      <table
+        cellspacing="0"
+        style="
+          width: 100%;
+          margin: 20px 0;
+          table-layout: fixed;
+          word-break: break-all;
+          word-wrap: break-word;
+        "
+      >
+        <tbody>
+          <tr align="center">
+            <td>产品出库通知单</td>
+          </tr>
+        </tbody>
+      </table>
+      <table
+        border
+        cellspacing="0"
+        style="
+          width: 100%;
+          table-layout: fixed;
+          word-break: break-all;
+          word-wrap: break-word;
+        "
+      >
+        <tbody>
+          <tr align="center">
+            <td rowspan="2" style="padding: 10px 0; width: 130px">
+              受托生产企业
+            </td>
+            <td colspan="2" style="padding: 10px 0"> 单位名称 </td>
+            <td colspan="7" style="padding: 10px 0"> </td>
+          </tr>
+          <tr align="center">
+            <td colspan="2" style="padding: 10px 0"> 仓储地址 </td>
+            <td colspan="7" style="padding: 10px 0"> </td>
+          </tr>
+          <tr align="center">
+            <td colspan="10" style="padding: 10px 0"> 出库产品信息 </td>
+          </tr>
+          <tr align="center">
+            <td style="padding: 10px 0"> 产品名称 </td>
+            <td style="padding: 10px 0"> 规格 </td>
+            <td style="padding: 10px 0"> 批号 </td>
+            <td style="padding: 10px 0"> 单位 </td>
+            <td style="padding: 10px 0"> 数量 </td>
+            <td style="padding: 10px 0"> 收货单位 </td>
+            <td style="padding: 10px 0"> 收获地址 </td>
+            <td style="padding: 10px 0"> 收货人/电话 </td>
+            <td style="padding: 10px 0"> 回款时间/承诺回款时间 </td>
+            <td style="padding: 10px 0"> 备注 </td>
+          </tr>
+          <tr align="center" v-for="(item, index) in codeList">
+            <td style="padding: 10px 0">{{ item.categoryCode }}</td>
+            <td style="padding: 10px 0">{{ item.categoryName }}</td>
+            <td style="padding: 10px 0"
+              >{{ item.specification }}{{ item.categoryModel }}</td
+            >
+            <td style="padding: 10px 0">{{ item.measureUnit }}</td>
+            <td style="padding: 10px 0">{{ item.measureQuantity }}</td>
+            <td style="padding: 10px 0">{{ item.packingQuantity }}</td>
+            <td style="padding: 10px 0">{{ item.packagingStrength }}</td>
+            <td style="padding: 10px 0">{{ item.packagingDensity }}</td>
+            <td style="padding: 10px 0">{{ item.packagingDensity }}</td>
+            <td style="padding: 10px 0">{{ item.remark }}</td>
+          </tr>
+          <tr align="center">
+            <td colspan="2" style="padding: 10px 0"> 填表人 </td>
+            <td colspan="8" style="padding: 10px 0"> 签名/日期: </td>
+          </tr>
+          <tr align="center">
+            <td colspan="2" style="padding: 10px 0"> 审批人 </td>
+            <td colspan="8" style="padding: 10px 0"> 签名/日期: </td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+
+    <div slot="footer">
+      <el-button @click="print">打印预览</el-button>
+      <el-button @click="close">关闭</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import { mapGetters } from 'vuex';
+  import JsBarcode from 'jsbarcode';
+  import storageApi from '@/api/warehouseManagement';
+  export default {
+    name: 'print',
+    computed: {
+      ...mapGetters(['user'])
+    },
+    data() {
+      return {
+        checked: '',
+        QRvisible: false,
+        codeList: [],
+        formData: {}
+      };
+    },
+
+    methods: {
+      open(id) {
+        storageApi.getInboundDetailsById(id).then((res) => {
+          this.formData = res;
+          this.formData.markerName = this.user.info.name;
+          this.codeList = res.outInDetailList;
+          this.QRvisible = true;
+        });
+      },
+      close() {
+        this.QRvisible = false;
+      },
+      //获取当前日期函数
+      getNowFormatDate() {
+        let date = new Date(),
+          obj = {
+            year: date.getFullYear(), //获取完整的年份(4位)
+            month: date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
+            strDate: date.getDate(), // 获取当前日(1-31)
+            week: '星期' + '日一二三四五六'.charAt(date.getDay()), //获取当前星期几(0 ~ 6,0代表星期天)
+            hour: date.getHours(), //获取当前小时(0 ~ 23)
+            minute: date.getMinutes(), //获取当前分钟(0 ~ 59)
+            second: date.getSeconds() //获取当前秒数(0 ~ 59)
+          };
+        Object.keys(obj).forEach((key) => {
+          if (obj[key] < 10) obj[key] = `0${obj[key]}`;
+        });
+        // return `${obj.year}年${obj.month}月${obj.strDate}日 ${obj.hour}:${obj.minute}:${obj.second}`;
+        return `${obj.year}-${obj.month}-${obj.strDate}`;
+      },
+      print() {
+        const printSection = document.getElementById('printSection');
+        // 创建打印任务
+        const printWindow = window.open('', '_blank');
+        printWindow.document.open();
+        printWindow.document.write('<html><head><title>打印预览</title>');
+        printWindow.document.write(
+          '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
+        );
+        printWindow.document.write('</head><body>');
+        printWindow.document.write(printSection.innerHTML);
+        printWindow.document.write('</body></html>');
+        printWindow.document.close();
+        printWindow.onload = function () {
+          printWindow.print();
+        };
+      }
+    }
+  };
+</script>
+
+<style lang="scss">
+  #printSection {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    flex-direction: column;
+    .table_box {
+      width: 70%;
+      table-layout: fixed;
+      word-break: break-all;
+      word-wrap: break-word;
+    }
+    th,
+    td {
+      padding: 20px;
+      position: relative;
+    }
+    .barCode {
+      position: absolute;
+      right: 10px;
+      top: 50%;
+      transform: translateY(-50%);
+    }
+    .person {
+      width: 70%;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      margin-bottom: 10px;
+      > div {
+        flex: 1;
+      }
+    }
+  }
+</style>

+ 267 - 0
src/views/warehouseManagement/outgoingManagement/components/print3.vue

@@ -0,0 +1,267 @@
+<template>
+  <ele-modal
+    title="出库单"
+    :visible.sync="QRvisible"
+    v-if="QRvisible"
+    width="90%"
+  >
+    <div
+      id="printSection"
+      style="
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        flex-direction: column;
+      "
+    >
+      <table
+        border
+        cellspacing="0"
+        style="
+          width: 100%;
+          table-layout: fixed;
+          word-break: break-all;
+          word-wrap: break-word;
+        "
+      >
+        <tbody>
+          <tr align="center">
+            <td colspan="4">
+              <div
+                style="
+                  display: flex;
+                  align-items: center;
+                  justify-content: center;
+                "
+              >
+                <img
+                  style="width: 60px; height: 50px"
+                  src="@/assets/logo1.jpg"
+                  alt=""
+                />
+                <div>
+                  <div style="font-size: 14px">嘉实医药</div>
+                  <div style="font-size: 10px">HARVEST PHARMACEUTICALS</div>
+                </div>
+              </div>
+            </td>
+            <td colspan="6"> 文件编码: R1/SMP-WL-021-01 </td>
+          </tr>
+          <tr align="center">
+            <td colspan="4" style="padding: 10px"> 编号:SMP-XS-005-01 </td>
+            <td colspan="6" style="padding: 10px"> 名称: 产品入库及发运台账</td>
+          </tr>
+        </tbody>
+      </table>
+      <table
+        border
+        cellspacing="0"
+        style="
+          width: 100%;
+          margin: 20px 0;
+          table-layout: fixed;
+          word-break: break-all;
+          word-wrap: break-word;
+        "
+      >
+        <tbody>
+          <tr align="center">
+            <td colspan="12">产品入库信息</td>
+          </tr>
+          <tr align="center">
+            <td>产品名称</td>
+            <td colspan="2"></td>
+            <td>产品规格</td>
+            <td colspan="2"></td>
+            <td>产品代码</td>
+            <td colspan="2"></td>
+            <td>包装规格</td>
+            <td colspan="2"></td>
+          </tr>
+          <tr align="center">
+            <td>批量</td>
+            <td colspan="2"></td>
+            <td>数量</td>
+            <td colspan="2"></td>
+            <td>批号</td>
+            <td colspan="2"></td>
+            <td>生产日期</td>
+            <td colspan="2"></td>
+          </tr>
+          <tr align="center">
+            <td>批量</td>
+            <td colspan="2"></td>
+            <td>数量</td>
+            <td colspan="2"></td>
+            <td>批号</td>
+            <td colspan="2"></td>
+            <td>生产日期</td>
+            <td colspan="2"></td>
+          </tr>
+          <tr align="center">
+            <td>入库日期</td>
+            <td colspan="2"></td>
+            <td>存放地点</td>
+            <td colspan="8"></td>
+          </tr>
+          <tr align="center">
+            <td>入库经办人</td>
+            <td colspan="11"></td>
+          </tr>
+        </tbody>
+      </table>
+      <table
+        border
+        cellspacing="0"
+        style="
+          width: 100%;
+          table-layout: fixed;
+          word-break: break-all;
+          word-wrap: break-word;
+        "
+      >
+        <tbody>
+          <tr align="center">
+            <td colspan="12" style="padding: 10px 0"> 产品发运信息 </td>
+          </tr>
+          <tr align="center">
+            <td style="padding: 10px 0"> 发运时间 </td>
+            <td colspan="2" style="padding: 10px 0"> 发运凭证号 </td>
+            <td style="padding: 10px 0"> 发运数量 </td>
+            <td style="padding: 10px 0"> 剩余库存 </td>
+            <td colspan="3" style="padding: 10px 0"> 收货单位 </td>
+            <td style="padding: 10px 0"> 收货人 </td>
+            <td style="padding: 10px 0"> 收货人电话 </td>
+            <td style="padding: 10px 0"> 发运经办人 </td>
+            <td style="padding: 10px 0"> 备注 </td>
+          </tr>
+          <tr align="center" v-for="(item, index) in codeList">
+            <td style="padding: 10px 0">{{ item.categoryCode }}</td>
+            <td colspan="2" style="padding: 10px 0">{{ item.categoryName }}</td>
+            <td style="padding: 10px 0"
+              >{{ item.specification }}{{ item.categoryModel }}</td
+            >
+            <td style="padding: 10px 0">{{ item.measureUnit }}</td>
+            <td colspan="3" style="padding: 10px 0">{{
+              item.measureQuantity
+            }}</td>
+            <td style="padding: 10px 0">{{ item.packingQuantity }}</td>
+            <td style="padding: 10px 0">{{ item.packagingStrength }}</td>
+            <td style="padding: 10px 0">{{ item.packagingDensity }}</td>
+            <td style="padding: 10px 0">{{ item.remark }}</td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+
+    <div slot="footer">
+      <el-button @click="print">打印预览</el-button>
+      <el-button @click="close">关闭</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import { mapGetters } from 'vuex';
+  import JsBarcode from 'jsbarcode';
+  import storageApi from '@/api/warehouseManagement';
+  export default {
+    name: 'print',
+    computed: {
+      ...mapGetters(['user'])
+    },
+    data() {
+      return {
+        checked: '',
+        QRvisible: false,
+        codeList: [],
+        formData: {}
+      };
+    },
+
+    methods: {
+      open(id) {
+        storageApi.getInboundDetailsById(id).then((res) => {
+          this.formData = res;
+          this.formData.markerName = this.user.info.name;
+          this.codeList = res.outInDetailList;
+          this.QRvisible = true;
+        });
+      },
+      close() {
+        this.QRvisible = false;
+      },
+      //获取当前日期函数
+      getNowFormatDate() {
+        let date = new Date(),
+          obj = {
+            year: date.getFullYear(), //获取完整的年份(4位)
+            month: date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
+            strDate: date.getDate(), // 获取当前日(1-31)
+            week: '星期' + '日一二三四五六'.charAt(date.getDay()), //获取当前星期几(0 ~ 6,0代表星期天)
+            hour: date.getHours(), //获取当前小时(0 ~ 23)
+            minute: date.getMinutes(), //获取当前分钟(0 ~ 59)
+            second: date.getSeconds() //获取当前秒数(0 ~ 59)
+          };
+        Object.keys(obj).forEach((key) => {
+          if (obj[key] < 10) obj[key] = `0${obj[key]}`;
+        });
+        // return `${obj.year}年${obj.month}月${obj.strDate}日 ${obj.hour}:${obj.minute}:${obj.second}`;
+        return `${obj.year}-${obj.month}-${obj.strDate}`;
+      },
+      print() {
+        const printSection = document.getElementById('printSection');
+        // 创建打印任务
+        const printWindow = window.open('', '_blank');
+        printWindow.document.open();
+        printWindow.document.write('<html><head><title>打印预览</title>');
+        printWindow.document.write(
+          '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
+        );
+        printWindow.document.write('</head><body>');
+        printWindow.document.write(printSection.innerHTML);
+        printWindow.document.write('</body></html>');
+        printWindow.document.close();
+        printWindow.onload = function () {
+          printWindow.print();
+        };
+      }
+    }
+  };
+</script>
+
+<style lang="scss">
+  #printSection {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    flex-direction: column;
+    .table_box {
+      width: 70%;
+      table-layout: fixed;
+      word-break: break-all;
+      word-wrap: break-word;
+    }
+    th,
+    td {
+      padding: 20px;
+      position: relative;
+    }
+    .barCode {
+      position: absolute;
+      right: 10px;
+      top: 50%;
+      transform: translateY(-50%);
+    }
+    .person {
+      width: 70%;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      margin-bottom: 10px;
+      > div {
+        flex: 1;
+      }
+    }
+  }
+</style>

+ 234 - 0
src/views/warehouseManagement/outgoingManagement/components/print4.vue

@@ -0,0 +1,234 @@
+<template>
+  <ele-modal
+    title="出库单"
+    :visible.sync="QRvisible"
+    v-if="QRvisible"
+    width="90%"
+  >
+    <div
+      id="printSection"
+      style="
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        flex-direction: column;
+      "
+    >
+      <table
+        border
+        cellspacing="0"
+        style="
+          width: 100%;
+          table-layout: fixed;
+          word-break: break-all;
+          word-wrap: break-word;
+          margin-bottom: 20px;
+        "
+      >
+        <tbody>
+          <tr align="center">
+            <td colspan="4" rowspan="2">
+              <div
+                style="
+                  display: flex;
+                  align-items: center;
+                  justify-content: center;
+                "
+              >
+                <img
+                  style="width: 60px; height: 50px"
+                  src="@/assets/logo1.jpg"
+                  alt=""
+                />
+                <div>
+                  <div style="font-size: 14px">嘉实医药</div>
+                  <div style="font-size: 10px">HARVEST PHARMACEUTICALS</div>
+                </div>
+              </div>
+            </td>
+            <td colspan="6" style="padding: 10px">
+              文件编码: R3/SMP-WL-021-01
+            </td>
+          </tr>
+          <tr align="center">
+            <td colspan="6" style="padding: 10px"> 名称: 产品总账</td>
+          </tr>
+        </tbody>
+      </table>
+      <table
+        border
+        cellspacing="0"
+        style="
+          width: 100%;
+          table-layout: fixed;
+          word-break: break-all;
+          word-wrap: break-word;
+        "
+      >
+        <tbody>
+          <tr align="center">
+            <td style="padding: 10px 0"> 序号 </td>
+            <td colspan="2" style="padding: 10px 0"> 受托生产企业 </td>
+            <td colspan="2" style="padding: 10px 0"> 产品名称 </td>
+            <td style="padding: 10px 0"> 产品规格 </td>
+            <td style="padding: 10px 0"> 包装规格 </td>
+            <td style="padding: 10px 0"> 批号 </td>
+            <td style="padding: 10px 0"> 入库时间 </td>
+            <td style="padding: 10px 0"> 入库总量 </td>
+            <td style="padding: 10px 0"> 出库总量 </td>
+            <td style="padding: 10px 0"> 剩余数量 </td>
+          </tr>
+          <tr align="center" v-for="(item, index) in codeList">
+            <td style="padding: 10px 0">{{ item.categoryCode }}</td>
+            <td colspan="2" style="padding: 10px 0">{{ item.categoryName }}</td>
+            <td colspan="2" style="padding: 10px 0"
+              >{{ item.specification }}{{ item.categoryModel }}</td
+            >
+            <td style="padding: 10px 0">{{ item.measureUnit }}</td>
+            <td style="padding: 10px 0">{{ item.measureQuantity }}</td>
+            <td style="padding: 10px 0">{{ item.packingQuantity }}</td>
+            <td style="padding: 10px 0">{{ item.packagingStrength }}</td>
+            <td style="padding: 10px 0">{{ item.packagingDensity }}</td>
+            <td style="padding: 10px 0">{{ item.remark }}</td>
+            <td style="padding: 10px 0">{{ item.remark }}</td>
+          </tr>
+        </tbody>
+      </table>
+      <table
+        cellspacing="0"
+        style="
+          width: 100%;
+          margin: 20px 0;
+          table-layout: fixed;
+          word-break: break-all;
+          word-wrap: break-word;
+        "
+      >
+        <tbody>
+          <tr align="center">
+            <td colspan="2">制表人:</td>
+            <td colspan="4"></td>
+            <td colspan="2">复核人:</td>
+            <td colspan="4"></td>
+          </tr>
+          <tr align="center">
+            <td colspan="2">统计日期:</td>
+            <td colspan="4"></td>
+            <td colspan="2">复核日期:</td>
+            <td colspan="4"></td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+
+    <div slot="footer">
+      <el-button @click="print">打印预览</el-button>
+      <el-button @click="close">关闭</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import { mapGetters } from 'vuex';
+  import JsBarcode from 'jsbarcode';
+  import storageApi from '@/api/warehouseManagement';
+  export default {
+    name: 'print',
+    computed: {
+      ...mapGetters(['user'])
+    },
+    data() {
+      return {
+        checked: '',
+        QRvisible: false,
+        codeList: [],
+        formData: {}
+      };
+    },
+
+    methods: {
+      open(id) {
+        storageApi.getInboundDetailsById(id).then((res) => {
+          this.formData = res;
+          this.formData.markerName = this.user.info.name;
+          this.codeList = res.outInDetailList;
+          this.QRvisible = true;
+        });
+      },
+      close() {
+        this.QRvisible = false;
+      },
+      //获取当前日期函数
+      getNowFormatDate() {
+        let date = new Date(),
+          obj = {
+            year: date.getFullYear(), //获取完整的年份(4位)
+            month: date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
+            strDate: date.getDate(), // 获取当前日(1-31)
+            week: '星期' + '日一二三四五六'.charAt(date.getDay()), //获取当前星期几(0 ~ 6,0代表星期天)
+            hour: date.getHours(), //获取当前小时(0 ~ 23)
+            minute: date.getMinutes(), //获取当前分钟(0 ~ 59)
+            second: date.getSeconds() //获取当前秒数(0 ~ 59)
+          };
+        Object.keys(obj).forEach((key) => {
+          if (obj[key] < 10) obj[key] = `0${obj[key]}`;
+        });
+        // return `${obj.year}年${obj.month}月${obj.strDate}日 ${obj.hour}:${obj.minute}:${obj.second}`;
+        return `${obj.year}-${obj.month}-${obj.strDate}`;
+      },
+      print() {
+        const printSection = document.getElementById('printSection');
+        // 创建打印任务
+        const printWindow = window.open('', '_blank');
+        printWindow.document.open();
+        printWindow.document.write('<html><head><title>打印预览</title>');
+        printWindow.document.write(
+          '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
+        );
+        printWindow.document.write('</head><body>');
+        printWindow.document.write(printSection.innerHTML);
+        printWindow.document.write('</body></html>');
+        printWindow.document.close();
+        printWindow.onload = function () {
+          printWindow.print();
+        };
+      }
+    }
+  };
+</script>
+
+<style lang="scss">
+  #printSection {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    flex-direction: column;
+    .table_box {
+      width: 70%;
+      table-layout: fixed;
+      word-break: break-all;
+      word-wrap: break-word;
+    }
+    th,
+    td {
+      padding: 20px;
+      position: relative;
+    }
+    .barCode {
+      position: absolute;
+      right: 10px;
+      top: 50%;
+      transform: translateY(-50%);
+    }
+    .person {
+      width: 70%;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      margin-bottom: 10px;
+      > div {
+        flex: 1;
+      }
+    }
+  }
+</style>

+ 54 - 6
src/views/warehouseManagement/outgoingManagement/index.vue

@@ -87,7 +87,30 @@
               ></auth-selection>
             </el-form-item>
           </el-col>
-          <el-col :span="6" style="display: flex; justify-content: flex-end">
+          <el-col :span="6">
+            <el-form-item label="所属工厂" prop="factoryId">
+              <el-select
+                filterable
+                placeholder="请选择"
+                v-model="formData.factoryId"
+                clearable
+                class="w100"
+              >
+                <el-option
+                  v-for="item in factoryList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                ></el-option>
+              </el-select> </el-form-item
+          ></el-col>
+          <el-col
+            style="
+              display: flex;
+              justify-content: flex-end;
+              margin-bottom: 10px;
+            "
+          >
             <div>
               <el-button icon="el-icon-refresh-left" size="small" @click="reset"
                 >重置</el-button
@@ -122,6 +145,9 @@
             @click="putIntoStorage"
             >退货入库</el-button
           >
+          <el-button icon="el-icon-printer" type="primary" @click="openPrint"
+            >打印</el-button
+          >
         </template>
         <template v-slot:selection="{ row }">
           <el-radio class="radio" v-model="currentId" :label="row.id"
@@ -148,9 +174,9 @@
         </template>
 
         <!-- 领料人 -->
-        <template v-slot:createUserName="{ row }">
+        <template v-slot:fromUser="{ row }">
           <div class="deviceName">
-            <p class="n-p">{{ row.createUserName }}</p>
+            <p class="n-p">{{ row.fromUser }}</p>
             <!-- <p class="col">出库:{{ row.createTime }}</p> -->
           </div>
         </template>
@@ -210,11 +236,13 @@
       </ele-pro-table>
     </el-card>
     <outboundOrderPrint ref="outboundOrderPrintRef" />
+    <print ref="printRef"></print>
   </div>
 </template>
 
 <script>
   import storageApi from '@/api/warehouseManagement';
+  import print from './components/print.vue';
   import { allCategoryLevel } from '@/api/classifyManage';
   import outin from '@/api/warehouseManagement/outin';
   import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
@@ -224,7 +252,7 @@
   // import { getPage } from '@/api/stockManagement'
   // import { deepClone } from '@/utils'
   export default {
-    components: { outboundOrderPrint },
+    components: { outboundOrderPrint, print },
     data() {
       return {
         currentId: '',
@@ -232,6 +260,7 @@
         auditStatus,
         outputSceneState,
         codeList: [],
+        factoryList: [],
         tableData: [],
         fromUserList: [],
         formData: {
@@ -242,6 +271,7 @@
           startTime: '',
           endTime: '',
           status: '',
+          factoryId: '',
           time: []
         },
         total: 0,
@@ -321,10 +351,10 @@
           },
 
           {
-            prop: 'createUserName',
+            prop: 'fromUser',
             label: '领料人',
             align: 'center',
-            slot: 'createUserName',
+            slot: 'fromUser',
             showOverflowTooltip: true,
             width: 200
           },
@@ -365,8 +395,26 @@
     created() {
       this.getUser();
       this.getTypeList();
+      this.getFactoryList();
     },
     methods: {
+      //获取工厂列表
+      async getFactoryList() {
+        const res = await warehouseDefinition.getFactoryarea({
+          pageNum: 1,
+          size: 9999,
+          type: 1
+        });
+        this.factoryList = res.list;
+        this.handleList();
+      },
+      openPrint() {
+        if (this.currentId) {
+          this.$refs.printRef.open(this.currentId);
+        } else {
+          this.$message.warning('请选择一条单据!');
+        }
+      },
       putIntoStorage() {
         if (this.currentId) {
           if (this.currentRow.verifyStatus == 2) {

+ 33 - 2
src/views/warehouseManagement/stockLedger/components/item-search.vue

@@ -129,6 +129,23 @@
             ></auth-selection>
           </el-form-item>
         </el-col>
+        <el-col :span="6">
+          <el-form-item label="所属工厂" prop="factoryId">
+            <el-select
+              filterable
+              placeholder="请选择"
+              v-model="params.factoryId"
+              clearable
+              class="w100"
+            >
+              <el-option
+                v-for="item in factoryList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+              ></el-option>
+            </el-select> </el-form-item
+        ></el-col>
         <el-col>
           <div class="ele-form-actions">
             <el-button
@@ -155,6 +172,7 @@
 </template>
 <script>
   import { getWarehouseList } from '@/api/classifyManage/itemInformation';
+  import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
   export default {
     data() {
       // 默认表单数据
@@ -171,7 +189,8 @@
         code: '',
         categoryCode: '',
         assetName: '',
-        qualityResult: ''
+        qualityResult: '',
+        factoryId: ''
       };
       return {
         // 表单数据
@@ -197,7 +216,8 @@
           }
         ],
         warehouseList: [],
-        dimension: '1'
+        dimension: '1',
+        factoryList: []
       };
     },
     props: {
@@ -223,8 +243,19 @@
     },
     created() {
       this.getArguInfo();
+      this.getFactoryList();
     },
     methods: {
+      //获取工厂列表
+      async getFactoryList() {
+        const res = await warehouseDefinition.getFactoryarea({
+          pageNum: 1,
+          size: 9999,
+          type: 1
+        });
+        this.factoryList = res.list;
+        this.handleList();
+      },
       //搜索数据源
       async getArguInfo() {
         const { data } = await getWarehouseList();

File diff suppressed because it is too large
+ 212 - 508
src/views/warehouseManagement/stockManagement/add.vue


+ 2 - 1
src/views/warehouseManagement/stockManagement/components/priceMaintenanceDialog.vue

@@ -171,7 +171,8 @@
     data() {
       return {
         newColumns: [],
-        dialogVisible: false
+        dialogVisible: false,
+        productList: []
       };
     },
     created() {

+ 49 - 12
src/views/warehouseManagement/stockManagement/components/selectType.vue

@@ -8,18 +8,40 @@
       width="80vw"
     >
       <div class="search_box">
-        <el-col :span="8">
-          <el-input v-model="value" placeholder="搜索物品编码、名称">
-            <el-button
-              slot="append"
-              type="primary"
-              icon="el-icon-search"
-              size="small"
-              @click="handleSearch"
-              >搜索</el-button
-            >
-          </el-input>
-        </el-col>
+        <el-row :gutter="15">
+          <el-col :span="6">
+            <el-form label-width="80px" class="ele-form-search">
+              <el-form-item label="所属工厂" prop="factoryId">
+                <el-select
+                  filterable
+                  placeholder="请选择"
+                  v-model="factoryId"
+                  clearable
+                  class="w100"
+                >
+                  <el-option
+                    v-for="item in factoryList"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.id"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+            </el-form>
+          </el-col>
+          <el-col :span="8">
+            <el-input v-model="value" placeholder="搜索物品编码、名称">
+              <el-button
+                slot="append"
+                type="primary"
+                icon="el-icon-search"
+                size="small"
+                @click="handleSearch"
+                >搜索</el-button
+              >
+            </el-input>
+          </el-col>
+        </el-row>
       </div>
       <div class="flex_info">
         <div class="flex_left">
@@ -143,6 +165,7 @@
 </template>
 
 <script>
+  import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
   import AssetTree from './assetTree.vue';
   import { getList } from '@/api/classifyManage/itemInformation';
   import storageApi from '@/api/warehouseManagement/index.js';
@@ -185,6 +208,8 @@
     components: { AssetTree },
     data() {
       return {
+        factoryList: [],
+        factoryId: '',
         value: '',
         treeType: '',
         treeList: [],
@@ -204,8 +229,19 @@
     },
     created() {
       this.getFieldModel();
+      this.getFactoryList();
     },
     methods: {
+      //获取工厂列表
+      async getFactoryList() {
+        const res = await warehouseDefinition.getFactoryarea({
+          pageNum: 1,
+          size: 9999,
+          type: 1
+        });
+        this.factoryList = res.list;
+        this.handleList();
+      },
       doLayout() {
         let that = this;
         this.$nextTick(() => {
@@ -294,6 +330,7 @@
           ...this.pages,
           // type: this.curType,
           // code: this.value,
+          factoryId: this.factoryId,
           searchKey: this.value,
           categoryLevelId: this.classificationId
         };

+ 122 - 163
src/views/warehouseManagement/stockManagement/details.vue

@@ -101,7 +101,7 @@
           </div>
         </div>
         <div class="content-detail mt20">
-          <header-title title="产品信息" size="16px"> </header-title>
+          <header-title title="产品信息" size="16px"></header-title>
           <el-table
             ref="productListTable"
             :data="productList"
@@ -164,20 +164,26 @@
             >
             </el-table-column>
             <el-table-column
-              label="包装数量"
-              prop="packingQuantity"
+              label="最小包装单元"
               align="center"
+              width="120"
+              prop="minPackingQuantity"
             >
               <template slot-scope="{ row, $index }">
-                {{ row.packingQuantity }}
+                {{ row.minPackingQuantity }} {{ row.measureUnit }} /{{
+                  row.packingUnit
+                }}
               </template>
             </el-table-column>
+
             <el-table-column
-              label="包装单位"
+              label="包装数量"
+              prop="packingQuantity"
               align="center"
-              width="120"
-              prop="packingUnit"
             >
+              <template slot-scope="{ row, $index }">
+                {{ row.packingQuantity }} {{ row.packingUnit }}
+              </template>
             </el-table-column>
             <el-table-column
               label="计量数量"
@@ -185,8 +191,23 @@
               width="100"
               align="center"
             >
+              <template slot-scope="{ row, $index }">
+                <template>
+                  {{
+                    $math.format(
+                      row.minPackingQuantity * row.packingQuantity,
+                      14
+                    )
+                  }}
+                </template>
+              </template>
             </el-table-column>
             <el-table-column label="计量单位" prop="measureUnit" align="center">
+              <template slot-scope="{ row, $index }">
+                <template>
+                  {{ row.measureUnit }}
+                </template>
+              </template>
             </el-table-column>
             <el-table-column
               label="重量"
@@ -264,42 +285,17 @@
           </el-table>
         </div>
         <div class="mt20">
-          <header-title :title="`包装明细`" size="16px">
-            <el-button
-              v-for="item in mergeOptions"
-              size="mini"
-              type="primary"
-              @click="openMergeDialog(item)"
-              >合并成{{ item.conversionUnit }}</el-button
-            >
-            <el-button
-              v-for="item in splitOptions"
-              size="mini"
-              type="primary"
-              @click="openSplitDialog(item)"
-              >拆分到{{ item.packageUnit }}</el-button
-            >
-          </header-title>
+          <header-title :title="`包装明细`" size="16px"></header-title>
           <el-table
             ref="showPackingListTable"
-            :data="packingList"
+            :data="showPackingList"
             tooltip-effect="dark"
             :max-height="300"
             border
             :row-class-name="tableRowClassName"
             :header-cell-style="rowClass"
-            @selection-change="productSplit"
+            v-el-table-infinite-scroll="pickingHandleScroll"
           >
-            <el-table-column
-              v-if="infoData.verifyStatus == 2"
-              key="selection"
-              label="选择"
-              type="selection"
-              width="55"
-              align="center"
-              fixed="left"
-            >
-            </el-table-column>
             <el-table-column label="序号" type="index" width="50">
             </el-table-column>
             <el-table-column
@@ -454,17 +450,73 @@
               </template>
             </el-table-column>
           </el-table>
-          <el-pagination
-            background
-            layout="total, sizes, prev, pager, next, jumper"
-            :total="total"
-            :page-sizes="[10, 10, 20, 30]"
-            :page-size.sync="pages.size"
-            :current-page.sync="pages.pageNum"
-            @current-change="handleCurrentChange"
-            @size-change="handleSizeChange"
+        </div>
+        <div class="mt20">
+          <header-title :title="`物料明细`" size="16px"> </header-title>
+          <el-table
+            ref="multipleTable"
+            :data="showMaterialList"
+            tooltip-effect="dark"
+            :max-height="300"
+            border
+            :row-class-name="tableRowClassName"
+            :header-cell-style="rowClass"
+            style="width: 100%"
+            stripe
+            height="300px"
+            v-el-table-infinite-scroll="materielHandleScroll"
           >
-          </el-pagination>
+            <el-table-column label="序号" type="index" width="50">
+            </el-table-column>
+            <el-table-column
+              label="编码"
+              prop="categoryCode"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="名称"
+              prop="categoryName"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column label="批次号" prop="batchNo"></el-table-column>
+            <el-table-column
+              label="物料编码"
+              prop="materialCode"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="发货条码"
+              prop="barcodes"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="计量数量"
+              prop="measureQuantity"
+            ></el-table-column>
+            <el-table-column
+              label="计量单位"
+              prop="measureUnit"
+            ></el-table-column>
+            <el-table-column label="物料代号" prop="materielDesignation">
+            </el-table-column>
+            <el-table-column label="客户代号" prop="clientCode">
+            </el-table-column>
+            <el-table-column label="刻码" prop="engrave"> </el-table-column>
+            <el-table-column width="100" label="重量" prop="weight">
+            </el-table-column>
+            <el-table-column label="重量单位" prop="weightUnit">
+            </el-table-column>
+            <el-table-column label="质检结果" prop="result" width="120">
+              <template slot-scope="{ row }">
+                <span>{{ qualityResults[row.result] }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="质检状态" prop="status" width="120">
+              <template slot-scope="{ row }">
+                <span>{{ qualityStatus[row.status] }}</span>
+              </template>
+            </el-table-column>
+          </el-table>
         </div>
       </div>
     </el-card>
@@ -472,40 +524,25 @@
       ref="wareHouseDailogRef"
       @houseData="houseData"
     ></WareHouseDailog>
-    <mergeDetails
-      ref="mergeDetailsRef"
-      @refresh="getPackingList"
-    ></mergeDetails>
-    <splitDetails ref="splitDetailsRef"></splitDetails>
   </div>
 </template>
 
 <script>
-  import mergeDetails from './mergeDetails.vue';
-  import splitDetails from './splitDetails.vue';
   import WareHouseDailog from '../components/warehouseShelvesDialog.vue';
   import elTableInfiniteScroll from 'el-table-infinite-scroll';
   import { getFile } from '@/api/system/file/index.js';
   import PageHeader from '@/components/PageHeader';
   import storageApi from '@/api/warehouseManagement';
-  import { getCode } from '@/api/codeManagement/index.js';
   import { allCategoryLevel } from '@/api/classifyManage';
   import { useDictLabel, sceneState } from '@/utils/dict/index';
   import { mapGetters, mapActions } from 'vuex';
   export default {
-    components: { PageHeader, WareHouseDailog, mergeDetails, splitDetails },
+    components: { PageHeader, WareHouseDailog },
     directives: {
       'el-table-infinite-scroll': elTableInfiniteScroll
     },
     data() {
       return {
-        total: 0,
-        pages: { pageNum: 1, size: 10 },
-        oldSelectionList: [],
-        selectionList: [],
-        mergeOptions: [],
-        splitOptions: [],
-        currentId: '',
         newColumns: [], // 动态表头
         qualityStatus: {
           0: '未质检',
@@ -528,8 +565,7 @@
         infoData: {},
         stepsTitle: '已完成',
         stepsStatus: 'success',
-        active: 0,
-        verifyStatus: ''
+        active: 0
       };
     },
     watch: {
@@ -588,69 +624,10 @@
     created() {
       this.getFieldModel();
       this.requestDict('类型用途');
-      this.requestDict('不拆物料层规格');
       this.getAllCategoryType();
       this._getInfo();
-      this.verifyStatus = this.$route.query.verifyStatus;
     },
     methods: {
-      openMergeDialog(dimensionRow) {
-        this.$refs.mergeDetailsRef.open(dimensionRow, this.selectionList);
-      },
-      openSplitDialog(dimensionRow) {
-        this.$refs.splitDetailsRef.open(dimensionRow, this.selectionList);
-      },
-      productSplit(selectionList) {
-        console.log(selectionList);
-        let isUnification = selectionList.every(
-          (item) =>
-            item.packingUnit == selectionList[0].packingUnit &&
-            item.categoryId == selectionList[0].categoryId
-        );
-        if (isUnification) {
-          if (selectionList.length > 0) {
-            this.selectionList = selectionList;
-            this.oldSelectionList = selectionList;
-            if (this.mergeOptions.length == 0) {
-              storageApi
-                .getCategoryPackageDisposition({
-                  categoryIds: [this.selectionList[0].categoryId]
-                })
-                .then((data) => {
-                  console.log(data);
-                  console.log(this.selectionList[0]);
-                  // 形成合并按钮
-                  let mergeIndex = data.findIndex(
-                    (item) =>
-                      item.packageUnit == this.selectionList[0].packingUnit &&
-                      item.packageUnit != item.conversionUnit
-                  );
-                  console.log(mergeIndex);
-                  this.mergeOptions = data.filter(
-                    (item) => item.sort == data[mergeIndex].sort
-                  );
-                  // 形成拆分按钮
-                  let splitIndex = data.findIndex(
-                    (item) =>
-                      item.conversionUnit ==
-                        this.selectionList[0].packingUnit &&
-                      item.packageUnit != item.conversionUnit
-                  );
-                  this.splitOptions = data.filter(
-                    (item) => item.sort == data[splitIndex].sort
-                  );
-                });
-            }
-          } else {
-            this.mergeOptions = [];
-            this.splitOptions = [];
-          }
-        } else {
-          this.$message.error('请选择相同物品和包装装单位');
-          this.$refs.showPackingListTable.clearSelection();
-        }
-        console.log(isUnification);
-      },
       // 获取动态表头
       getFieldModel() {
         storageApi.fieldModel({ fieldModel: 't_main_category' }).then((res) => {
@@ -824,6 +801,7 @@
         return code?.dictValue;
       },
       tableRowClassName({ row, rowIndex }) {
+        console.log(row);
         if (row.result == 2) {
           return 'warning-row';
         } else {
@@ -900,52 +878,33 @@
             };
           }
         );
-        this.getPackingList();
-        // // 获取包装维度数据
-        // const arr = [];
-        // for (const key in this.productList) {
-        //   for (const k in this.productList[key].outInDetailRecordRequestList) {
-        //     arr.push({
-        //       ...this.productList[key].outInDetailRecordRequestList[k]
-        //     });
-        //   }
-        // }
-        // this.packingList = arr;
-        // // 获取物料维度数据
-        // let iArr = [];
-        // arr.forEach((item) => {
-        //   item.materialDetailList.forEach((ele) => {
-        //     iArr.push({ ...ele });
-        //   });
-        // });
-        // this.materialList = iArr;
-        // console.log(this.packingList);
-        // console.log(this.materialList);
-        // this.pickingFetchData();
-        // this.materielFetchData();
+        // 获取包装维度数据
+        const arr = [];
+        for (const key in this.productList) {
+          for (const k in this.productList[key].outInDetailRecordRequestList) {
+            arr.push({
+              ...this.productList[key].outInDetailRecordRequestList[k]
+            });
+          }
+        }
+        this.packingList = arr;
+        // 获取物料维度数据
+        let iArr = [];
+        arr.forEach((item) => {
+          item.materialDetailList.forEach((ele) => {
+            iArr.push({ ...ele });
+          });
+        });
+        this.materialList = iArr;
+        console.log(this.packingList);
+        console.log(this.materialList);
+        this.pickingFetchData();
+        this.materielFetchData();
       },
       download(row) {
         if (row.storePath) {
           getFile({ objectName: row.storePath }, row.name);
         }
-      },
-      handleCurrentChange(e) {
-        this.getPackingList();
-      },
-      handleSizeChange(e) {
-        this.pages.pageNum = 1;
-        this.getPackingList();
-      },
-      getPackingList() {
-        storageApi
-          .getOutInRecordsPage({
-            ...this.pages,
-            outInId: this.$route.query.id
-          })
-          .then((data) => {
-            this.total = data.count;
-            this.packingList = data.list;
-          });
       }
     }
   };

+ 1 - 0
src/views/warehouseManagement/stockManagement/details_3.vue

@@ -666,6 +666,7 @@
         });
       },
       isUpper(row) {
+        console.log('this.packingList------', this.packingList);
         let filterPackingList = this.packingList.filter((packingItem) => {
           return packingItem.parentIndex === row.index;
         });

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

@@ -87,6 +87,23 @@
               ></auth-selection>
             </el-form-item>
           </el-col>
+          <el-col :span="6">
+            <el-form-item label="所属工厂" prop="factoryId">
+              <el-select
+                filterable
+                placeholder="请选择"
+                v-model="formData.factoryId"
+                clearable
+                class="w100"
+              >
+                <el-option
+                  v-for="item in factoryList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                ></el-option>
+              </el-select> </el-form-item
+          ></el-col>
           <!-- <el-col :lg="6" :sm="8" :xs="8">
           <el-form-item label="创建时间" prop="time">
             <el-date-picker
@@ -100,7 +117,13 @@
               value-format="yyyy-MM-dd"
             ></el-date-picker> </el-form-item
         ></el-col> -->
-          <el-col :span="6" style="display: flex; justify-content: flex-end">
+          <el-col
+            style="
+              display: flex;
+              justify-content: flex-end;
+              margin-bottom: 10px;
+            "
+          >
             <div>
               <el-button icon="el-icon-refresh-left" size="small" @click="reset"
                 >重置</el-button
@@ -228,6 +251,7 @@
 
 <script>
   import storageApi from '@/api/warehouseManagement';
+  import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
   import priceMaintenanceDialog from './components/priceMaintenanceDialog.vue';
   import { allCategoryLevel } from '@/api/classifyManage';
   import {
@@ -244,6 +268,7 @@
         warehousingType,
         sceneState,
         codeList: [],
+        factoryList: [],
         tableData: [],
         formData: {
           deptIds: '',
@@ -253,6 +278,7 @@
           startTime: '',
           endTime: '',
           status: '',
+          factoryId: '',
           time: []
           // type: 1
         },
@@ -368,8 +394,19 @@
     },
     mounted() {
       this.getTypeList();
+      this.getFactoryList();
     },
     methods: {
+      //获取工厂列表
+      async getFactoryList() {
+        const res = await warehouseDefinition.getFactoryarea({
+          pageNum: 1,
+          size: 9999,
+          type: 1
+        });
+        this.factoryList = res.list;
+        this.handleList();
+      },
       // 单击获取id
       cellClick(row) {
         this.currentRow = row;

Some files were not shown because too many files changed in this diff