Quellcode durchsuchen

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-wms into dengfei

695593266@qq.com vor 5 Monaten
Ursprung
Commit
07a8e5cc1d
36 geänderte Dateien mit 1224 neuen und 351 gelöschten Zeilen
  1. 105 0
      public/fromQRCode/designDrawing.html
  2. 3 2
      src/api/inventory/index.js
  3. 11 0
      src/api/saleManage/accountstatement.js
  4. 19 3
      src/api/warehouseManagement/warehouseDefinition.js
  5. 1 1
      src/config/setting.js
  6. 5 0
      src/main.js
  7. 5 2
      src/mixins/tableColumnsMixin.js
  8. 35 0
      src/utils/clickOnce.js
  9. 4 0
      src/utils/dict/warehouse.js
  10. 3 2
      src/utils/page-tab-util.js
  11. 4 4
      src/utils/request.js
  12. 10 1
      src/views/warehouseManagement/components/AssetsDialog.vue
  13. 55 77
      src/views/warehouseManagement/inventoryAllocation/accountstatement/generateStatement.vue
  14. 37 7
      src/views/warehouseManagement/inventoryAllocation/accountstatement/orderListDialog.vue
  15. 61 15
      src/views/warehouseManagement/inventoryAllocation/add.vue
  16. 43 2
      src/views/warehouseManagement/inventoryAllocation/components/inventory-search.vue
  17. 167 23
      src/views/warehouseManagement/inventoryAllocation/components/print-template-bs-car.vue
  18. 39 7
      src/views/warehouseManagement/inventoryAllocation/components/print-template-bs.vue
  19. 10 0
      src/views/warehouseManagement/inventoryAllocation/details.vue
  20. 74 2
      src/views/warehouseManagement/inventoryAllocation/index.vue
  21. 22 22
      src/views/warehouseManagement/outgoingManagement/add.vue
  22. 8 2
      src/views/warehouseManagement/outgoingManagement/index.vue
  23. 33 9
      src/views/warehouseManagement/stockLedger/components/item-list.vue
  24. 28 1
      src/views/warehouseManagement/stockLedger/components/item-search.vue
  25. 1 2
      src/views/warehouseManagement/stockManagement/add.vue
  26. 28 23
      src/views/warehouseManagement/stockManagement/components/print-template-tr.vue
  27. 23 23
      src/views/warehouseManagement/stockManagement/components/printStockEnter.vue
  28. 2 2
      src/views/warehouseManagement/stockManagement/index.vue
  29. 3 3
      src/views/warehouseManagement/stocktaking/reportLoss/components/addReportDialog.vue
  30. 1 1
      src/views/warehouseManagement/stocktaking/reportLoss/components/reportProcuts.vue
  31. 55 25
      src/views/warehouseManagement/stocktaking/work/components/disposeDialog.vue
  32. 14 1
      src/views/warehouseManagement/stocktaking/work/index.vue
  33. 212 84
      src/views/warehouseManagement/warehouseDefinition/add.vue
  34. 11 4
      src/views/warehouseManagement/warehouseDefinition/components/WarehouseEdit.vue
  35. 91 0
      src/views/warehouseManagement/warehouseDefinition/components/qsCode.vue
  36. 1 1
      src/views/warehouseManagement/warehouseDefinition/index.vue

+ 105 - 0
public/fromQRCode/designDrawing.html

@@ -0,0 +1,105 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+        <meta http-equiv="X-UA-Compatible" content="IE=edge">
+        <meta name="viewport" content="width=device-width,initial-scale=1.0">
+        <meta name="apple-mobile-web-app-capable" content="yes">
+        <meta name="apple-mobile-web-app-status-bar-style" content="black">
+        <meta name="format-detection" content="telephone=no">
+        <meta http-equiv="X-UA-Compatible" content="chrome=1" >
+        <style>
+            *{
+                outline: 0;
+                padding: 0;
+                margin: 0;
+                border: none;
+                box-sizing: border-box;
+                background-size: contain;
+                background-position: center;
+                background-repeat: no-repeat;
+            }
+            ul,ol{
+                list-style: none outside none;
+            }
+            ul.product-info {
+                padding: 20px;
+            }
+                ul.product-info > li {
+                    line-height: 30px;
+                    font-size: 14px;
+                }
+        </style>
+    </head>
+
+    <body>
+        <ul class="product-info">
+            <li>
+                <label for="">库区名称:</label>
+                <span id="name">-</span>
+            </li>
+    
+            <li>
+                <label for="">库区编码:</label>
+                <span id="code">-</span>
+            </li>
+            <li>
+                <label for="">库区类型:</label>
+                <span id="areaType">-</span>
+            </li>
+            <li>
+                <label for="">库区属性:</label>
+                <span id="attribute">-</span>
+            </li>
+            <li>
+                <label for="">库区位置:</label>
+                <span id="address">-</span>
+            </li>
+            <li>
+                <label for="">库区长(cm):</label>
+                <span id="areaLength">-</span>
+            </li>
+            <li>
+                <label for="">库区宽(cm):</label>
+                <span id="areaWidth">-</span>
+            </li>
+            <li>
+                <label for="">库区高(cm):</label>
+                <span id="areaHigh">-</span>
+            </li>
+            <li>
+                <label for="">货架数量:</label>
+                <span id="subCount">-</span>
+            </li>
+            <li>
+                <label for="">货架编码:</label>
+                <span id="codeList">-</span>
+            </li>
+            <li>
+                <label for="">备注:</label>
+                <span id="remark">-</span>
+            </li>
+        </ul>
+    </body>
+    <script>
+        function str_to_obj(str){
+            var obj = {};
+            var temp = str.split('&');
+            for(var i = 0; i < temp .length;i++) {
+                var t  =  temp[i].split('=');
+                obj[t[0]]=t[1];
+            }
+            return obj
+        }
+  
+        var queryObj = str_to_obj(window.location.search.substring(1));
+        let ids=['name','code','areaType','attribute','address','areaLength','areaWidth','areaHigh','subCount','codeList','remark']
+        ids.forEach(id=>{
+            if(queryObj[id]){
+                document.querySelector('#'+id).innerHTML = decodeURIComponent(queryObj[id]);
+            }
+        })
+
+     
+    </script>
+</html>

+ 3 - 2
src/api/inventory/index.js

@@ -95,9 +95,10 @@ export async function getPlanDetailList(params) {
 }
 
 // 盘点报工
-export async function reportWork(data) {
+export async function reportWork(data, params) {
   console.log(data);
-  const res = await request.post('/wms/planOrder/reportWork', data);
+  const urlParams = new URLSearchParams(params);
+  const res = await request.post('/wms/planOrder/reportWork?' + urlParams, data);
   if (res.data.code == 0) {
     return res.data.data;
   }

+ 11 - 0
src/api/saleManage/accountstatement.js

@@ -181,3 +181,14 @@ export async function accountStatementExportAPI(id) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+/**
+ * 对账单 生成对账单
+ */
+export async function batchGenerateStatementAPI(data) {
+  const res = await request.post(`/wms/allotApply/batchGenerateStatement`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 19 - 3
src/api/warehouseManagement/warehouseDefinition.js

@@ -99,9 +99,16 @@ export default {
       return res.data.message;
     }
   },
-  //删除
-  isDelete: async (id) => {
-    const res = await request.get('/wms/warehouse/isDelete/' + id);
+  //判断库区是否可删除
+  isAreaCanDelete: async (id) => {
+    const res = await request.get(`/wms/warehousearea/isCanDelete/${id}`);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+  //判断货架是否可删除
+  isGoodsshelvesCanDelete: async (id) => {
+    const res = await request.get(`/wms/warehouseareagoodsshelves/isCanDelete/${id}`);
     if (res.data.code == 0) {
       return res.data.data;
     }
@@ -150,6 +157,15 @@ export default {
     if (res.data.code == 0) {
       return res.data.data;
     }
+  },
+   //删除货架
+  deleteListByAreaId: async (data) => {
+    const res = await request.delete(
+      `/wms/warehouseareagoodsshelves/delete`, data
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
   },
   //根据货架查货位
   getListByGoodId: async (goodId) => {

+ 1 - 1
src/config/setting.js

@@ -18,7 +18,7 @@ export const HIDE_FOOTERS = [
 export const REPEATABLE_TABS = [];
 
 // 不需要登录的路由
-export const WHITE_LIST = ['/login', '/forget'];
+export const WHITE_LIST = ['/login', '/forget','/fromQRCode/designDrawing.html'];
 
 // 开启 KeepAlive 后仍然不需要缓存的路由地址
 export const KEEP_ALIVE_EXCLUDES = [];

+ 5 - 0
src/main.js

@@ -13,6 +13,8 @@ import DictSelection from '@/components/Dict/DictSelection';
 import HeaderTitle from '@/components/header-title';
 import initParentStore from '../qiankun_config/store';
 import elTableInfiniteScroll from 'el-table-infinite-scroll';
+
+import clickOnce from './utils/clickOnce.js';
 // bpmnProcessDesigner 需要引入
 import MyPD from '@/components/bpmnProcessDesigner/package/index.js';
 Vue.use(MyPD);
@@ -25,6 +27,9 @@ import { create, all } from 'mathjs'; // 引入mathjs工具并初始化
 import authSelection from '@/components/AuthSelection';
 import Print from 'vue-printjs';
 
+// 注册全局自定义指令
+Vue.directive('click-once', clickOnce);
+
 
 import seekPage from '@/components/seekPage';
 Vue.component('seekPage', seekPage);

+ 5 - 2
src/mixins/tableColumnsMixin.js

@@ -3,12 +3,15 @@ import request from '@/utils/request';
 export default {
   data() {
     return {
-      newColumns: []
+      newColumns: [],
+      tabMixinsInit: true //进入页面是否默认请求列配置
     };
   },
   created() {
     //从服务器获取缓存列表配置
-    this.getTabColumns();
+    if (this.tabMixinsInit) {
+      this.getTabColumns();
+    }
     // 创建防抖函数并绑定this
     this.debouncedHandleColumnChange = this.debounce(
       this.handleColumnChangeImpl,

+ 35 - 0
src/utils/clickOnce.js

@@ -0,0 +1,35 @@
+export default {
+  bind(el, binding, vnode) {
+    // 创建加载指示器元素
+    const loadingIndicator = document.createElement('i');
+    loadingIndicator.classList.add('loading-indicator', 'el-icon-loading'); // 假设使用 Element UI 的加载图标
+    el.appendChild(loadingIndicator);
+
+    // 隐藏加载指示器,默认不显示
+    loadingIndicator.style.display = 'none';
+
+    // 保存加载指示器引用
+    el._loadingIndicator = loadingIndicator;
+
+    // 添加点击事件监听器
+    el.addEventListener('click', () => {
+      // 显示加载指示器
+      loadingIndicator.style.display = 'inline-block';
+
+      // 禁用按钮
+      el.setAttribute('disabled', '');
+
+      // 假设这里有一个异步操作,完成后需要隐藏加载指示器和重新启用按钮
+      setTimeout(() => {
+        loadingIndicator.style.display = 'none';
+        el.removeAttribute('disabled'); // 重新启用按钮
+      }, 2000); // 模拟异步操作耗时2秒
+    });
+
+    // 清理事件监听器,防止内存泄漏
+    vnode.context.$once('hook:beforeDestroy', () => {
+      el.removeEventListener('click', () => {});
+      el.removeChild(loadingIndicator);
+    });
+  }
+};

+ 4 - 0
src/utils/dict/warehouse.js

@@ -126,6 +126,10 @@ export const sceneState = [
     code: 17,
     label: '回收入库'
   },
+  {
+    code: 18,
+    label: '返工返修入库'
+  },
   {
     code: 99,
     label: '其他入库'

+ 3 - 2
src/utils/page-tab-util.js

@@ -243,10 +243,11 @@ export function logout(route, from) {
   if (route) {
     router.push({
       path: '/login',
-      query: from ? { from } : void 0
+      // query: from ? { from } : void 0
     });
   } else {
     // 这样跳转避免再次登录重复注册动态路由
-    location.replace(BASE_URL + 'login' + (from ? '?from=' + from : ''));
+    location.replace(window.location.origin + '/login');
+
   }
 }

+ 4 - 4
src/utils/request.js

@@ -64,9 +64,9 @@ service.interceptors.response.use(
     // 登录过期处理
     if (error?.response?.status === 401) {
       const currentPath = router.currentRoute.path;
-      if (currentPath === LAYOUT_PATH) {
-        logout(true);
-      } else {
+      // if (currentPath === LAYOUT_PATH) {
+      //   logout(true);
+      // } else {
         MessageBox.alert('登录状态已过期, 请退出重新登录!', '系统提示', {
           confirmButtonText: '重新登录',
           callback: (action) => {
@@ -78,7 +78,7 @@ service.interceptors.response.use(
             MessageBox.close();
           }
         });
-      }
+      // }
       return Promise.reject(new Error(error.response.data?.message));
     }else if(!error?.response?.status){
       Message.error('服务调用失败,请联系管理员!');

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

@@ -553,9 +553,18 @@
           } else {
             finalValue = singleDotValue;
           }
-          return (row.outboundNum = finalValue);
+          row.outboundNum = finalValue;
+          const currentIndex = this.selectionList.findIndex(item => item.id === row.id)
+          if(currentIndex > -1) {
+            this.$set(this.selectionList, currentIndex, row);
+          }
+          return
         } else {
           row.outboundNum = row.measureQuantity;
+          const currentIndex = this.selectionList.findIndex(item => item.id === row.id)
+          if(currentIndex > -1) {
+            this.$set(this.selectionList, currentIndex, row);
+          }
         }
       },
 

+ 55 - 77
src/views/warehouseManagement/inventoryAllocation/accountstatement/generateStatement.vue

@@ -28,22 +28,12 @@
             height="350"
             full-height="calc(100vh - 76px)"
         > 
-            <template v-slot:orderNo="scope">
-                <el-form-item :prop="'datasource.' + scope.$index + '.orderNo'">
-                    <el-input v-model="scope.row.orderNo" @click.native="openOrderDialog(scope.row, scope.$index)"></el-input>
-                <!-- <el-select
-                    v-model="scope.row.batchStockId" 
-                    placeholder="请选择"
-                    @change="batchNoChange(scope.$index, scope.row)"
+            <template v-slot:saleOrderNos="scope">
+                <el-form-item 
+                    :prop="'datasource.' + scope.$index + '.saleOrderNos'"
+                    :rules="[{ required: true, message: '请选择订单', trigger: ['blur'] }]"
                 >
-                    <el-option
-                    v-for="item in scope.row.batchNoList || []"
-                    :key="item.id"
-                    :label="item.batchNo"
-                    :value="item.id"
-                    >
-                    </el-option>
-                </el-select> -->
+                    <el-input v-model="scope.row.saleOrderNos" @click.native="openOrderDialog(scope.row, scope.$index)"></el-input>
                 </el-form-item>
             </template>
         </ele-pro-table>
@@ -62,6 +52,7 @@
     <orderListDialog
       ref="orderListDialogRef"
       @changeParent="getOrderInfo"
+      needProduces="4"
     ></orderListDialog>
   </ele-modal>
 </template>
@@ -72,11 +63,7 @@
 
   import saleForm from './saleForm.vue';
   import {
-    getStatementRecordListAPI,
-    infoAccountStatementAPI,
-    createAccountStatementAPI,
-    updateAccountStatementAPI,
-    accountstatementInfoAPI
+    batchGenerateStatementAPI
   } from '@/api/saleManage/accountstatement';
   import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
   import OrderListDialog from './orderListDialog.vue';
@@ -171,12 +158,28 @@
           },
           {
             minWidth: 140,
-            prop: 'orderNo',
+            prop: 'customerNames',
+            label: '客户名称',
+            slot: 'customerNames',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          // {
+          //   minWidth: 140,
+          //   prop: 'totalQuantity',
+          //   label: '数量',
+          //   slot: 'totalQuantity',
+          //   align: 'center',
+          //   showOverflowTooltip: true
+          // }
+          {
+            minWidth: 140,
+            prop: 'saleOrderNos',
             label: '销售订单号',
-            slot: 'orderNo',
+            slot: 'saleOrderNos',
             align: 'center',
             showOverflowTooltip: true
-          }
+          },
         ]
       };
     },
@@ -185,17 +188,17 @@
       open(dialogType, row) {
         this.dialogType = dialogType;
         console.log('row~~~', row);
-        this.form.datasource = row || [];
+        this.form.datasource = JSON.parse(JSON.stringify(row)) || [];
       },
       //打开订单弹窗
       openOrderDialog(row, index) {
-        let item = { id: row.orderId };
-        this.$refs.orderListDialogRef.open(item, index);
+        // let item = { id: row.orderId };
+        this.$refs.orderListDialogRef.open(row, index);
       },
       //选择订单信息回调
       getOrderInfo(arr, index) {
         console.log('arr~~~', arr, index, this.form.datasource[index]);
-        this.form.datasource[index].orderNo = arr.map(item => item.orderNo).join(',');
+        this.form.datasource[index].saleOrderNos = arr.map(item => item.orderNo).join(',');
         // this.dataForm.sourceType = 3;
         // let params = Object.assign({}, this.dataForm, {
         //   orderId: obj.id,
@@ -211,6 +214,8 @@
 
       //关闭弹窗
       cancel() {
+        // this.form.datasource = [];
+        this.$set(this.form, 'datasource', []);
         this.$emit('update:generateStatementFlag', false);
       },
    
@@ -218,58 +223,31 @@
       async save(is) {
         if (!this.form.datasource.length)
           return this.$message.warning('暂无对账信息');
-        let api =
-          this.dialogType == 'add'
-            ? createAccountStatementAPI
-            : updateAccountStatementAPI;
-        let params = {
-          ...this.dataForm,
-          orderList: this.form.datasource,
-        };
-        console.log('params~~~', params);
-        this.saveLoading = true;
-        try {
-          let data = await api(params);
-          this.saveLoading = false;
-          if (is == 'sub') {
-            await this.submitApprove(data);
-            return;
-            // await submitAccountStatementApproveAPI({
-            //   businessId: data,
-            //   type: this.dataForm.type
-            // });
-          }
-          this.$message.success('操作成功');
-          this.reload();
-        } catch (error) {
-          this.saveLoading = false;
-        }
-        this.$message.success('操作成功');
-        this.reload();
-      },
-      async submitApprove(res) {
-        let data = await accountstatementInfoAPI(res);
-        this.processSubmitDialogFlag = true;
-        this.$nextTick(() => {
-          let params = {
-            businessId: res,
-            businessKey: 'sales_account_statement_approve',
-            formCreateUserId: data.createUserId,
-            variables: {
-              type: data.type,
-              businessCode: data.statementNo,
-              businessName: data.contactName,
-              businessType: '对账单'
+        
+        this.$refs.form.validate(async(valid, obj) => {
+          if (valid) {
+            let params = this.form.datasource.map(item => {
+                return {
+                    allotId: item.id,
+                    saleOrderNos: item.saleOrderNos,
+                }
+            });
+            console.log('params~~~', params);
+            this.saveLoading = true;
+            try {
+                const res = await batchGenerateStatementAPI(params);
+                console.log('res~~~', res);
+                this.saveLoading = false;
+                const msg = res && res.length > 0 ? res.join(',') : '操作成功';
+                this.$message.success(msg);
+                this.reload();
+            } catch (error) {
+                this.saveLoading = false;
             }
-            // callBackMethodType : '1',
-            // callBackMethod : 'proTargetPlanApproveApiImpl.updatePlanApprovalStatus',
-            // pcHandle : '/bpm/handleTask/components/project-manage/plan-manage/submit.vue',
-            // pcView : '/bpm/handleTask/components/project-manage/plan-manage/detailDialog.vue',
-            // miniHandle : '',
-            // miniView : '',
-          };
-          this.$refs.processSubmitDialogRef.init(params);
+          }
         });
+        // this.$message.success('操作成功');
+        // this.reload();
       },
       reload() {
         this.cancel();

+ 37 - 7
src/views/warehouseManagement/inventoryAllocation/accountstatement/orderListDialog.vue

@@ -58,6 +58,10 @@ export default {
       default: () => {
         return {};
       }
+    },
+    needProduces: {
+      type: String,
+      default: ''
     }
   },
   data() {
@@ -95,6 +99,28 @@ export default {
           showOverflowTooltip: true,
           minWidth: 200
         },
+        {
+          prop: 'needProduce',
+          label: '订单类型',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 150,
+
+          formatter: (_row, _column, cellValue) => {
+            let businessType =
+              cellValue == 1
+                ? '有客户生产性订单'
+                : cellValue == 2
+                ? '无客户生产性订单'
+                : cellValue == 4
+                ? '不定向订单'
+                : cellValue == 5
+                ? '委外订单'
+                : '库存式订单';
+
+            return businessType;
+          }
+        },
         {
           prop: 'contractName',
           label: '合同名称',
@@ -183,9 +209,10 @@ export default {
   methods: {
     open(item, currentIndex) {
       this.currentIndex = currentIndex;
-      if (item && item.id) {
-        this.radio = item.id;
-      }
+      this.selection = [];
+      // if (item && item.id) {
+      //   this.radio = item.id;
+      // }
 
       this.visible = true;
     },
@@ -195,6 +222,9 @@ export default {
       if (this.contactData.id) {
         where['contactId'] = this.contactData.id;
       }
+      if (this.needProduces) {
+        where['needProduces'] = this.needProduces;
+      }
       return getTableList({
         pageNum: page,
         size: limit,
@@ -227,10 +257,10 @@ export default {
       if (!this.selection.length) {
         return this.$message.warning('请至少选择一条数据');
       }
-      let partaIds = this.selection.map((item) => item.partaId);
-      if (new Set(partaIds).size != 1) {
-        return this.$message.warning('请选择相同客户的订单!');
-      }
+      // let partaIds = this.selection.map((item) => item.partaId);
+      // if (new Set(partaIds).size != 1) {
+      //   return this.$message.warning('请选择相同客户的订单!');
+      // }
       this.$emit('changeParent', this.selection, this.currentIndex);
       this.handleClose();
     }

+ 61 - 15
src/views/warehouseManagement/inventoryAllocation/add.vue

@@ -240,7 +240,7 @@
             height="calc(100vh-300px)"
             :pageSize="20"
             :datasource="datasource"
-            cache-key="wms-inventoryAllocation-add-table-left"
+            :cache-key="cacheKeyUrl"
             :selection.sync="selection"
             row-key="id"
             :initLoad="false"
@@ -407,8 +407,8 @@
             </template>
           </ele-pro-table>
           <div class="submit_item">
-            <el-button type="primary" @click="submit(0)">保存</el-button
-            ><el-button type="primary" @click="config">提交</el-button></div
+            <el-button v-click-once type="primary" @click="submit(0)">保存</el-button
+            ><el-button v-click-once type="primary" @click="config">提交</el-button></div
           >
         </div>
       </div>
@@ -424,6 +424,7 @@
   export default {
     data() {
       return {
+        cacheKeyUrl: 'wms-inventoryAllocation-add-table-left',
         query: {},
         allocationType,
         outTreeList: [],
@@ -544,6 +545,24 @@
             showOverflowTooltip: true,
             minWidth: 110
           },
+          {
+            prop: 'measureQuantity',
+            label: '计量数量',
+            align: 'center',
+            showOverflowTooltip: true,
+          },
+          {
+            prop: 'measureUnit',
+            label: '计量单位',
+            align: 'center',
+            showOverflowTooltip: true,
+          },
+          {
+            prop: 'lockQuantity',
+            label: '锁定数量',
+            align: 'center',
+            showOverflowTooltip: true,
+          },
           {
             prop: 'brandNum',
             label: '牌号',
@@ -565,6 +584,20 @@
             minWidth: 130,
             showOverflowTooltip: true,
           },
+          {
+            prop: 'colorKey',
+            label: '颜色',
+            align: 'center',
+            minWidth: 130,
+            showOverflowTooltip: true,
+          },
+          {
+            prop: 'modeKey',
+            label: '机型',
+            align: 'center',
+            minWidth: 130,
+            showOverflowTooltip: true,
+          },
           ...(this.dimension != '1' ? [{
             prop: 'batchNo',
             label: '批次号',
@@ -593,18 +626,7 @@
               showOverflowTooltip: true,
             }
           ] : []),
-          {
-            prop: 'measureQuantity',
-            label: '计量数量',
-            align: 'center',
-            showOverflowTooltip: true,
-          },
-          {
-            prop: 'measureUnit',
-            label: '计量单位',
-            align: 'center',
-            showOverflowTooltip: true,
-          },
+          
           {
             prop: 'weight',
             label: '重量',
@@ -736,6 +758,20 @@
             minWidth: 130,
             showOverflowTooltip: true,
           },
+          {
+            prop: 'colorKey',
+            label: '颜色',
+            align: 'center',
+            minWidth: 130,
+            showOverflowTooltip: true,
+          },
+          {
+            prop: 'modeKey',
+            label: '机型',
+            align: 'center',
+            minWidth: 130,
+            showOverflowTooltip: true,
+          },
           // {
           //   prop: 'batchNo',
           //   label: '批次号',
@@ -1465,7 +1501,10 @@
                 .join(','),
               allotApplyAddPOBuilders: this.tableData.map((item) => {
                 return {
+                  colorKey: item.colorKey,
+                  modeKey: item.modeKey,
                   quantity: item.quantity,
+                  categoryCode: item.categoryCode,
                   categoryId: item.categoryId,
                   warehouseId: item.warehouseId,
                   warehouseName: item.warehouseName,
@@ -1502,6 +1541,13 @@
               targetFactoriesId: this.params.targetFactoriesId,
             };
             console.log('params------------', params);
+            console.log('params.allotApplyAddPOBuilders------------', params);
+            const customerNames = params.allotApplyAddPOBuilders.map((item) => item.customerNames);
+            const saleOrderNos = params.allotApplyAddPOBuilders.map((item) => item.saleOrderNos);
+          
+            if (new Set(customerNames).size !== 1, new Set(saleOrderNos).size !== 1) {
+              return this.$message.error('不同客户,不同销售订单的产品不允许调拨');
+            } 
             storageApi.allotApplySave(params).then(() => {
               this.$message.success('保存成功');
               this.$router.go(-1);

+ 43 - 2
src/views/warehouseManagement/inventoryAllocation/components/inventory-search.vue

@@ -181,6 +181,42 @@
           </el-select>
         </el-form-item>
       </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="销售订单:" prop="saleOrderNo">
+          <el-input
+            clearable
+            v-model="where.saleOrderNo"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="客户名称:" prop="customerName">
+          <el-input
+            clearable
+            v-model="where.customerName"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="对账状态:" prop="isReconciliation">
+          <el-select
+            filterable
+            placeholder="请选择"
+            v-model="where.isReconciliation"
+            clearable
+            class="w100"
+          >
+            <el-option
+              v-for="item in isReconciliationOp"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+      </el-col>
       <el-col v-bind="styleResponsive ? { lg: 18, md: 12 } : { span: 18 }">
         <div class="ele-form-actions">
           <el-button
@@ -223,7 +259,8 @@
         categoryName: '',
         categoryCode: '',
         targetWarehouse: '',
-        sourceWarehouse: ''
+        sourceWarehouse: '',
+        isReconciliation: ''
       };
       return {
         // 表单数据
@@ -247,7 +284,11 @@
             value: 2,
             label: '已完成'
           }
-        ]
+        ],
+        isReconciliationOp: [
+          { value: 0, label: '未对账' },
+          { value: 1, label: '已对账' },
+        ],
       };
     },
     computed: {

+ 167 - 23
src/views/warehouseManagement/inventoryAllocation/components/print-template-bs-car.vue

@@ -4,9 +4,14 @@
     :visible.sync="QRvisible"
     v-if="QRvisible"
     width="90%"
+    destroy-on-close
+    :append-to-body="true"
+    :close-on-click-modal="false"
+    :before-close="close"
   >
     <div
       id="printSection"
+      ref="printRef"
       style="
         display: flex;
         align-items: center;
@@ -48,7 +53,7 @@
           margin-bottom: 10px;
         "
       >
-        <span style="width: 40%">客户名称:</span>
+        <span style="width: 40%">客户名称:{{ infoData.customerNames }}</span>
         <span style="width: 40%"
           >发货单号:{{ infoData.allotCode }}</span
         >
@@ -63,11 +68,12 @@
       >
         <span style="width: 40%">发货日期:{{ infoData.createTime }}</span>
         <span style="width: 40%"
-          >收货联系人:
-        </span>
+          >收货联系人:{{ infoData.receiveContacts }} {{ infoData.receiveTels }}</span
+        >
       </div>
       <table
         cellspacing="0"
+        class="print-table"
         border
         style="
           width: 100%;
@@ -82,30 +88,63 @@
             <td style="padding: 5px; width: 35px"> 序号 </td>
             <td style="padding: 5px; width: 10%;"> 车型 </td>
             <td style="padding: 5px; width: 12%;"> 料号 </td>
-            <td style="padding: 5px; width: 20%;"> 零件名 </td>
+            <td style="padding: 5px; width: 14%;"> 零件名 </td>
             <td style="padding: 5px; width: 8%;"> 单位</td>
             <td style="padding: 5px; width: 8%;"> 交货数</td>
             <td style="padding: 5px; width: 8%;"> 实收数量</td>
-            <td style="padding: 5px; width: 15%"> 客户订单号</td>
+            <td style="padding: 5px; width: 11%"> 客户订单号</td>
             <td style="padding: 5px; width: 8%;"> 重量</td>
-            <td style="padding: 5px; width: 10%;"> 工艺</td>
-            <td style="padding: 5px; width: 10%;"> 备注</td>
+            <td style="padding: 5px; width: 14%;"> 工艺</td>
+            <td style="padding: 5px; width: 12%;"> 备注</td>
           </tr>
 
           <tr align="center" v-for="(item, index) in detailList">
             <td style="padding: 5px"> {{ index + 1 }} </td>
-            <td style="padding: 5px">  </td>
+            <td style="padding: 5px"> 
+              <span v-if="isPrint">{{ item.car }}</span>
+              <el-input
+                v-else
+                type="textarea"
+                style="width: 100%; border: none;"
+                placeholder=""
+                v-model="item.car"
+                class="input-with-select"
+                autosize
+              ></el-input> 
+            </td>
             <td style="padding: 5px"> {{ item.categoryCode }} </td>
             <td style="padding: 5px">
               {{ item.categoryName }}
             </td>
             <td style="padding: 5px"> {{ item.measureUnit }} </td>
             <td style="padding: 5px"> {{ item.quantity }}</td>
-            <td style="padding: 5px"> {{ item.quantity }}</td>
+            <td style="padding: 5px"> </td>
             <td style="padding: 5px"> {{ item.saleOrderNo }}</td>
             <td style="padding: 5px"> {{ item.weight }}</td>
-            <td style="padding: 5px">{{ item.produceRoutingName }} </td>
-            <td style="padding: 5px"> {{ item.remark }} </td>
+            <td style="padding: 5px">
+              <span v-if="isPrint">{{ item.produceRoutingName }}</span>
+              <el-input
+                v-else
+                type="textarea"
+                style="width: 100%; border: none;"
+                placeholder=""
+                v-model="item.produceRoutingName"
+                class="input-with-select"
+                autosize
+              ></el-input>
+            </td>
+            <td style="padding: 5px">
+              <span v-if="isPrint">{{ item.remark }}</span>
+              <el-input
+                v-else
+                type="textarea"
+                style="width: 100%; border: none;"
+                placeholder=""
+                v-model="item.remark"
+                class="input-with-select"
+                autosize
+              ></el-input> 
+            </td>
           </tr>
           <tr style="height: 40px;">
             <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td>
@@ -114,13 +153,54 @@
             <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td>
             <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td>
             <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ detailList.reduce((total, item) => total + Number(item.quantity || 0), 0) || ''}}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ detailList.reduce((total, item) => total + Number(item.quantity || 0), 0) || ''}}</td>
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td>
             <td style="border: 1px solid #000; padding: 8px; text-align: center;" colspan="4">
-              <div style="display: flex; align-items: center;">
-                <div style="flex: 1;">铁框:</div>
-                <div style="flex: 1;">托盘:</div>
-                <div style="flex: 1;">工装:</div>
-                <div style="flex: 1;">胶框:</div>
+              <div style="display: flex; align-items: center;" class="foot">
+                <div style="flex: 1; width: 25%; display: flex; align-items: center;">
+                  <span style="width: 50px;">铁框:</span>
+                  <span v-if="isPrint">{{ query.tk }}</span>
+                  <el-input
+                    v-else
+                    style="width: calc(100% - 50px); border: none;"
+                    placeholder=""
+                    v-model="query.tk"
+                    class="input-with-select"
+                  >
+                  </el-input>
+                </div>
+                <div style="flex: 1; width: 25%; display: flex; align-items: center;">
+                  <span style="width: 50px;">托盘:</span>
+                  <span v-if="isPrint">{{ query.tp }}</span>
+                  <el-input
+                    v-else
+                    style="width: 100%; border: none;"
+                    placeholder=""
+                    v-model="query.tp"
+                    class="input-with-select"
+                  ></el-input>
+                </div>
+                <div style="flex: 1; width: 25%; display: flex; align-items: center;">
+                  <span style="width: 50px;">工装:</span>
+                  <span v-if="isPrint">{{ query.gz }}</span>
+                  <el-input
+                    v-else
+                    style="width: calc(100% - 50px); border: none;"
+                    placeholder=""
+                    v-model="query.gz"
+                    class="input-with-select"
+                  ></el-input>
+                </div>
+                <div style="flex: 1; width: 25%; display: flex; align-items: center;">
+                  <span style="width: 50px;">胶框:</span>
+                  <span v-if="isPrint">{{ query.jk }}</span>
+                  <el-input
+                    v-else
+                    style="width: calc(100% - 50px); border: none;"
+                    placeholder=""
+                    v-model="query.jk"
+                    class="input-with-select"
+                  ></el-input>
+                </div>
               </div>
             </td>
           </tr>
@@ -138,7 +218,11 @@
           <div>发货人:{{ infoData.allotName }}</div>
         </div>
         <div style="flex: 1">
-          <div>承运人:</div>
+          <div>承运人:
+            <span v-for="car in infoData.transports">
+              {{ car.driverName }} {{ car.trakNumber }}
+            </span>
+          </div>
         </div>
         <div style="flex: 1"> 收货人: </div>
         <!-- <div style="flex: 1"> 托盘:{{   infoData.trayNum }} </div> -->
@@ -156,6 +240,7 @@
 <script>
   import storageApi from '@/api/warehouseManagement/index.js';
   import { mapGetters } from 'vuex';
+  import { printElement } from 'ele-admin';
   export default {
     name: 'print',
     computed: {
@@ -169,16 +254,33 @@
     },
     data() {
       return {
+        isPrint: false,
         checked: '',
         QRvisible: false,
         isPrintPrice: false,
         infoData: {},
         outBound: {},
-        detailList: []
+        detailList: [],
+        query: {
+          tp: '',
+          gz: '',
+          jk: '',
+          tk: '',
+        }
       };
     },
 
     methods: {
+      print() {
+        this.isPrint = true;
+        // 等待 DOM 更新完成后再打印,确保输入框变成不可编辑的 span
+        this.$nextTick(() => {
+          // 如果 ref 是组件可以用 this.$refs.printRef.$el
+          // printElement(this.$refs.printRef);
+          //printElement(this.$refs.printRef, { });  // 参数二加更多参数同 printThis 方法
+          this.print1();
+        });
+      },
       async open(row) {
         this.row = row;
         this.getData();
@@ -208,15 +310,22 @@
             // specification: this.infoData.specification
           };
         });
-        console.log('infoData', this.infoData)
-        console.log('detailList', this.detailList)
+        // console.log('infoData', this.infoData)
+        // console.log('detailList', this.detailList)
     },
       close() {
         this.QRvisible = false;
+        this.query = {
+          tp: '',
+          gz: '',
+          jk: '',
+          tk: '',
+        }
       },
 
-      print() {
+      print1() {
         const printSection = document.getElementById('printSection');
+        const self = this;
         // 创建打印任务
         const printWindow = window.open('', '_blank');
         printWindow.document.open();
@@ -228,6 +337,20 @@
         printWindow.document.write(printSection.innerHTML);
         printWindow.document.write('</body></html>');
         printWindow.document.close();
+        
+        // 监听打印窗口关闭事件,恢复输入框
+        printWindow.onbeforeunload = function() {
+          self.isPrint = false;
+        };
+        
+        printWindow.onunload = function() {
+          self.isPrint = false;
+        };
+        
+        printWindow.onafterprint = function() {
+          self.isPrint = false;
+        };
+        
         printWindow.onload = function () {
           printWindow.print();
         };
@@ -236,4 +359,25 @@
   };
 </script>
 
-<style lang="scss"></style>
+<style lang="scss" scoped>
+:deep(.print-table) {
+  .el-input--medium {
+    font-size: 12px !important;
+    .el-textarea__inner {
+      border: none;
+      padding-left: 0;
+      padding-right: 0;
+    }
+  }
+}
+ :deep(.foot) {
+    .el-input--medium {
+      font-size: 12px !important;
+      .el-input__inner {
+        border: none;
+        padding-left: 0;
+        padding-right: 0;
+      }
+    }
+ }
+</style>

+ 39 - 7
src/views/warehouseManagement/inventoryAllocation/components/print-template-bs.vue

@@ -16,15 +16,15 @@
 
       <div style="margin-bottom: 15px; width: 100%;">
         <div style="display: flex; margin-bottom: 8px; width: 100%;">
-          <div style="flex: 1; text-align: left;">客户名称:</div>
+          <div style="flex: 1; text-align: left;">客户名称:{{ infoData.customerNames || '' }}</div>
           <div style="flex: 1; text-align: left;">发货单号:{{ infoData.allotCode || '' }}</div>
         </div>
         <div style="display: flex; margin-bottom: 8px;">
           <div style="flex: 1; text-align: left;">发货日期:{{ infoData.createTime || '' }}</div>
-          <div style="flex: 1; text-align: left;">联系人:</div>
+          <div style="flex: 1; text-align: left;">联系人:{{ infoData.receiveContacts || '' }}</div>
         </div>
         <div style="display: flex;">
-          <div style="flex: 1; text-align: left;">联系电话:</div>
+          <div style="flex: 1; text-align: left;">联系电话:{{ infoData.receiveTels || '' }}</div>
         </div>
       </div>
 
@@ -32,7 +32,7 @@
         <thead>
           <tr>
             <th style="border: 1px solid #000; padding: 8px; text-align: center; width: 40px;">序号</th>
-            <th style="border: 1px solid #000; padding: 8px; text-align: center; width: 15%;">型号</th>
+            <th style="border: 1px solid #000; padding: 8px; text-align: center; width: 15%;">编码</th>
             <th style="border: 1px solid #000; padding: 8px; text-align: center; width: 20%;">零件名</th>
             <th style="border: 1px solid #000; padding: 8px; text-align: center; width: 8%;">单位</th>
             <th style="border: 1px solid #000; padding: 8px; text-align: center; width: 8%;">送货数量</th>
@@ -45,12 +45,23 @@
         <tbody>
           <tr v-for="(item, index) in detailList" :key="index">
             <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ index + 1 }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.categoryModel || '' }}</td>
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.categoryCode || '' }}</td>
             <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.categoryName || '' }}</td>
             <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.measureUnit || '' }}</td>
             <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.quantity || '' }}</td>
             <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.quantity || '' }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.remark || '' }}</td>
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;">
+              <span v-if="isPrint">{{ item.remark }}</span>
+              <el-input
+                v-else
+                type="textarea"
+                style="width: 100%; border: none;"
+                placeholder=""
+                v-model="item.remark"
+                class="input-with-select"
+                autosize
+              ></el-input>
+            </td>
             <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.saleOrderNo || '' }}</td>
             <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.produceRoutingName || '' }}</td>
           </tr>
@@ -97,6 +108,7 @@ export default {
   data () {
     return {
       visible: false,
+      isPrint: false,
       row: {
         customerName: '',
         contactPerson: '',
@@ -157,7 +169,13 @@ export default {
         console.log('detailList', this.detailList)
     },
     confirm () {
-     const printSection = document.getElementById('printSection');
+      this.isPrint = true;
+      this.$nextTick(() => {
+        this.print();
+      });
+    },
+    print() {
+      const printSection = document.getElementById('printSection');
       // 创建打印任务
       const printWindow = window.open('', '_blank');
       printWindow.document.open();
@@ -169,6 +187,20 @@ export default {
       printWindow.document.write(printSection.innerHTML);
       printWindow.document.write('</body></html>');
       printWindow.document.close();
+
+      // 监听打印窗口关闭事件,恢复输入框
+        printWindow.onbeforeunload = function() {
+          self.isPrint = false;
+        };
+        
+        printWindow.onunload = function() {
+          self.isPrint = false;
+        };
+        
+        printWindow.onafterprint = function() {
+          self.isPrint = false;
+        };
+        
       printWindow.onload = function () {
         printWindow.print();
       };

+ 10 - 0
src/views/warehouseManagement/inventoryAllocation/details.vue

@@ -159,6 +159,16 @@
               prop="specification"
               :show-overflow-tooltip="true"
             ></el-table-column>
+            <el-table-column
+              label="颜色"
+              prop="colorKey"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="机型"
+              prop="modeKey"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
             <el-table-column
               v-if="infoData.inventoryDimension == 3"
               label="包装编码"

+ 74 - 2
src/views/warehouseManagement/inventoryAllocation/index.vue

@@ -22,9 +22,9 @@
           <el-button v-if="$hasPermission('wms:inventoryAllocation:print2')" :disabled="selection.length > 1" icon="el-icon-download" type="primary"  @click="printExl2"
             >打印送货单带车</el-button
           >
-          <!-- <el-button v-if="$hasPermission('wms:inventoryAllocation:statement')" :disabled="selection.length == 0" type="primary"  @click="handleGenerateStatement('add')"
+          <el-button v-if="$hasPermission('wms:inventoryAllocation:statement')" :disabled="selection.length == 0" type="primary"  @click="handleGenerateStatement('add')"
             >生成对账单</el-button
-          > -->
+          >
         </template>
         <!-- 单号链接 -->
         <template v-slot:allotCode="{ row }">
@@ -38,6 +38,7 @@
             type="primary"
             :underline="false"
             icon="el-icon-view"
+            :disabled="saveLoading"
             @click="submit(row)"
           >
             提交
@@ -114,6 +115,23 @@
         generateStatementFlag: false,
         allocationType,
         groupName: '',
+        saveLoading: false,
+        isReconciliationOp: [
+          { value: 0, label: '未对账' },
+          { value: 1, label: '已对账' },
+        ],
+        inventoryDimensionOp: [{
+          code: '1',
+          label: '物品维度'
+        },
+        {
+          code: '2',
+          label: '批次维度'
+        },
+        {
+          code: '3',
+          label: '包装维度'
+        }],
         stutusOptions: {
           0: '未提交',
           1: '审核中',
@@ -165,6 +183,42 @@
               )[0].label;
             }
           },
+          {
+            prop: 'isReconciliation',
+            label: '对账状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row, _column, cellValue) => {
+            return this.isReconciliationOp.find(item => item.value == cellValue)?.label || '';
+          }
+          },
+          {
+            prop: 'saleOrderNos',
+            label: '销售订单号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'customerNames',
+            label: '客户',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'inventoryDimension',
+            label: '列表维度',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (row, column, cellValue) => {
+              return this.inventoryDimensionOp.filter(
+                (item) => item.code == row.inventoryDimension
+              )[0].label;
+            }
+          },
           {
             prop: 'categoryName',
             label: '物品名称',
@@ -179,6 +233,13 @@
             showOverflowTooltip: true,
             minWidth: 110
           },
+          {
+            prop: 'colorKey',
+            label: '颜色',
+            align: 'center',
+            minWidth: 130,
+            showOverflowTooltip: true,
+          },
           {
             prop: 'sourceWarehouse',
             label: '来源仓库',
@@ -256,6 +317,13 @@
           this.$message.warning('请选择已完成的调拨单生成对账单');
           return;
         }
+
+        // 检查选中的列表维度是否包含物品维度
+        const dimensionRecords = this.selection.filter(item => item.inventoryDimension == 1);
+        if (dimensionRecords.length > 0) {
+          this.$message.warning('请选择批次维度或包装维度调拨单生成对账单');
+          return;
+        }
         
         this.generateStatementFlag = true;
         this.$nextTick(() => {
@@ -298,6 +366,7 @@
       },
       // 提交
       submit(row) {
+        this.saveLoading = true;
         storageApi
           .submitAllot({
             id: row.id,
@@ -305,11 +374,14 @@
             outVerifyUserId: row.targetWarehouseUserId
           })
           .then(() => {
+            this.saveLoading = false;
             this.$message({
               type: 'success',
               message: '提交成功'
             });
             this.reload();
+          }).catch(() => {
+            this.saveLoading = false;
           });
       },
       // 修改

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

@@ -27,17 +27,21 @@
               </el-select> </el-form-item
           ></el-col>
           <el-col :span="6">
-            <el-form-item label="客户名称" prop="">
-              <el-input
+            <el-form-item label="出库物品类型" prop="extInfo.assetType">
+              <el-select
+                style="width: 100%"
+                multiple
+                v-model="formData.extInfo.assetType"
                 placeholder="请选择"
-                v-model="formData.clientName"
-                style="width: calc(100% - 80px)"
               >
-              </el-input>
-              <openContactDialog
-                style="margin-left: 3px"
-                @changeParent="contactDialogSuccess"
-              ></openContactDialog>
+                <el-option
+                  v-for="item in goodsLists"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="6">
@@ -56,21 +60,17 @@
             </el-form-item>
           </el-col>
           <el-col :span="6">
-            <el-form-item label="出库物品类型" prop="extInfo.assetType">
-              <el-select
-                style="width: 100%"
-                multiple
-                v-model="formData.extInfo.assetType"
+            <el-form-item label="客户名称" prop="">
+              <el-input
                 placeholder="请选择"
+                v-model="formData.clientName"
+                style="width: calc(100% - 80px)"
               >
-                <el-option
-                  v-for="item in goodsLists"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                >
-                </el-option>
-              </el-select>
+              </el-input>
+              <openContactDialog
+                style="margin-left: 3px"
+                @changeParent="contactDialogSuccess"
+              ></openContactDialog>
             </el-form-item>
           </el-col>
           <el-col :span="6">

+ 8 - 2
src/views/warehouseManagement/outgoingManagement/index.vue

@@ -17,12 +17,12 @@
               ></el-date-picker> </el-form-item
           ></el-col>
           <el-col :span="6">
-            <el-form-item label="出库单号" prop="sourceBizNo">
+            <el-form-item label="出库单号" prop="bizNo">
               <el-input
                 size="small"
                 class="w100"
                 placeholder="请输入"
-                v-model="formData.sourceBizNo"
+                v-model="formData.bizNo"
               ></el-input> </el-form-item
           ></el-col>
           <el-col :span="6">
@@ -311,6 +311,12 @@
   // import { deepClone } from '@/utils'
   export default {
     components: { outboundOrderPrint, print, print1, print2, print3, print4 },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
     data() {
       return {
         currentId: '',

+ 33 - 9
src/views/warehouseManagement/stockLedger/components/item-list.vue

@@ -563,6 +563,28 @@
                 showOverflowTooltip: true
               }
             : '',
+          this.selectedDime == 3 || this.selectedDime == 2
+            ? {
+                prop: 'customerNames',
+                label: '客户名称',
+                showOverflowTooltip: true,
+                width: 120,
+                formatter: (row) => {
+                  return row.saleOrderInfo?.customerNames || '';
+                }
+              }
+            : '',
+          this.selectedDime == 3 || this.selectedDime == 2
+            ? {
+                prop: 'saleOrderNos',
+                label: '销售订单号',
+                showOverflowTooltip: true,
+                width: 120,
+                formatter: (row) => {
+                  return row.saleOrderInfo?.saleOrderNos || '';
+                }
+              }
+            : '',
           this.selectedDime == 3 || this.selectedDime == 4
             ? {
                 prop: 'engrave',
@@ -578,26 +600,28 @@
                 showOverflowTooltip: true
               }
             : '',
+          this.selectedDime != 1 ? 
           {
             prop: 'supplierName',
             label: '供应商',
             width: 120,
             showOverflowTooltip: true
-          },
+          } : '',
+          this.selectedDime != 1 ? 
           {
             prop: 'supplierCode',
             label: '供应商代号',
             width: 120,
             showOverflowTooltip: true
-          },
+          } : '',
 
-          this.selectedDime == 1
-            ? {
-                prop: 'provenance',
-                label: '产地',
-                showOverflowTooltip: true
-              }
-            : '',
+          // this.selectedDime == 1
+          //   ? {
+          //       prop: 'provenance',
+          //       label: '产地',
+          //       showOverflowTooltip: true
+          //     }
+          //   : '',
           this.isPrice == 1
             ? {
                 prop: 'unitPrice',

+ 28 - 1
src/views/warehouseManagement/stockLedger/components/item-search.vue

@@ -167,7 +167,34 @@
               placeholder="请输入"
             ></el-input>
           </el-form-item>
+        </el-col>  
+        <el-col :span="6">
+          <el-form-item label="颜色:" prop="colorKey">
+            <el-input
+              clearable
+              v-model="params.colorKey"
+              placeholder="请输入"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <!-- <el-col v-if="dimension == 3 || dimension == 2" :span="6">
+          <el-form-item label="销售订单号:" prop="saleOrderNos">
+            <el-input
+              clearable
+              v-model="params.saleOrderNos"
+              placeholder="请输入"
+            ></el-input>
+          </el-form-item>
         </el-col>
+        <el-col v-if="dimension == 3 || dimension == 2" :span="6">
+          <el-form-item label="客户名称:" prop="customerNames">
+            <el-input
+              clearable
+              v-model="params.customerNames"
+              placeholder="请输入"
+            ></el-input>
+          </el-form-item>
+        </el-col> -->
         <!-- <el-col v-if="dimension == 3 || dimension == 4" :span="6">
           <el-form-item label="客户代号:" prop="clientCode">
             <el-input
@@ -232,7 +259,7 @@
         qualityResult: '',
         factoryId: '',
         keyWord: '',
-        deptIds: '',
+  
         warehouseId: '',
         startTime: '',
         endTime: ''

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

@@ -182,7 +182,7 @@
                 >
               </template>
               <template v-slot:headerBatchNo="{ column }">
-                <span class="is-required">{{ column.label }}11</span>
+                <span class="is-required">{{ column.label }}</span>
               </template>
               <template v-slot:batchNo="{ row, $index }">
                 <template v-if="row.isSave">
@@ -198,7 +198,6 @@
                     @keyup.native="
                       moveFocus($event, $index, 'batchNo', '产品', row)
                     "
-                    type="number"
                     v-model="row.batchNo"
                   >
                   </el-input>

+ 28 - 23
src/views/warehouseManagement/stockManagement/components/print-template-tr.vue

@@ -14,12 +14,12 @@
       "
     >
       <!-- 入库单标题 -->
-      <div style="text-align: center; margin-bottom: 20px;">
-        <h2 style="margin: 0; font-size: 24px; font-weight: bold;">{{ groupName }}采购入库(退厂)单</h2>
+      <div style="text-align: center; margin-bottom: 10px;">
+        <h2 style="margin: 0; font-size: 20px; font-weight: bold;">{{ groupName }}采购入库单</h2>
       </div>
       
       <!-- 供应商信息 -->
-      <div style="margin-bottom: 20px; width: 100%;">
+      <div style="margin-bottom: 10px; width: 100%;">
         <div style="width: 100%; display: flex;">
           <div style="width: 40%;">
             <strong>供应商:</strong>{{ rowList.extInfo?.supplierName || '' }}
@@ -39,33 +39,35 @@
         cellspacing="0"
         style="
           width: 100%;
-          border-collapse: collapse;
-          font-size: 14px;
+          table-layout: fixed;
+          word-break: break-all;
+          word-wrap: break-word;
+          font-size: 12px;
+          margin-bottom: 10px;
         "
       >
         <thead>
           <tr>
-            <th style="border: 1px solid #000; padding: 8px; text-align: center;">序号</th>
-            <th style="border: 1px solid #000; padding: 8px; text-align: center;">编号</th>
-            <th style="border: 1px solid #000; padding: 8px; text-align: center; width: 180px;">名称</th>
-            <th style="border: 1px solid #000; padding: 8px; text-align: center; width: 140px;">规格型号</th>
-            <th style="border: 1px solid #000; padding: 8px; text-align: center;">批号</th>
-            <th style="border: 1px solid #000; padding: 8px; text-align: center;">单位</th>
-            <th style="border: 1px solid #000; padding: 8px; text-align: center;">数量</th>
-            <th style="border: 1px solid #000; padding: 8px; text-align: center;">备注</th>
+            <th style="border: 1px solid #000; padding: 5px; text-align: center; width: 5%;">序号</th>
+            <th style="border: 1px solid #000; padding: 5px; text-align: center; width: 12%;">编号</th>
+            <th style="border: 1px solid #000; padding: 5px; text-align: center; width: 20%;">名称</th>
+            <th style="border: 1px solid #000; padding: 5px; text-align: center; width: 20%;">规格型号</th>
+            <th style="border: 1px solid #000; padding: 5px; text-align: center; width: 12%;">批号</th>
+            <th style="border: 1px solid #000; padding: 5px; text-align: center; width: 10%;">单位</th>
+            <th style="border: 1px solid #000; padding: 5px; text-align: center; width: 10%;">数量</th>
+            <th style="border: 1px solid #000; padding: 5px; text-align: center; width: 10%;">备注</th>
           </tr>
         </thead>
         <tbody>
           <tr v-for="(row, index) in rowList.outInDetailList" :key="index">
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ index + 1 }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ row?.categoryCode || '' }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ row?.categoryName || '' }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ row?.specification || '' }}/{{ row?.categoryModel || '' }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ row?.batchNo || '' }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ row?.measureUnit || '' }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ row?.measureQuantity || '' }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ row?.remark || '' }}</td>
-            
+            <td style="border: 1px solid #000; padding: 5px; text-align: center;">{{ index + 1 }}</td>
+            <td style="border: 1px solid #000; padding: 5px; text-align: center;">{{ row?.categoryCode || '' }}</td>
+            <td style="border: 1px solid #000; padding: 5px; text-align: center;">{{ row?.categoryName || '' }}</td>
+            <td style="border: 1px solid #000; padding: 5px; text-align: center;">{{ row?.categoryModel || '' }}</td>
+            <td style="border: 1px solid #000; padding: 5px; text-align: center;">{{ row?.batchNo || '' }}</td>
+            <td style="border: 1px solid #000; padding: 5px; text-align: center;">{{ row?.measureUnit || '' }}</td>
+            <td style="border: 1px solid #000; padding: 5px; text-align: center;">{{ row?.measureQuantity || '' }}</td>
+            <td style="border: 1px solid #000; padding: 5px; text-align: center;">{{ row?.remark || '' }}</td>
           </tr>
           
           <!-- 合计金额行 -->
@@ -174,7 +176,10 @@
         printWindow.document.open();
         printWindow.document.write('<html><head><title>打印预览</title>');
         printWindow.document.write(
-          '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
+          '<style type="text/css">' +
+          '@page { size: 24cm 14cm; margin: 0; }' +
+          'body { width: 24cm; height: 14cm; margin: 0; padding: 0; }' +
+          '</style>'
         );
         printWindow.document.write('</head><body>');
         printWindow.document.write(printSection.innerHTML);

+ 23 - 23
src/views/warehouseManagement/stockManagement/components/printStockEnter.vue

@@ -45,37 +45,37 @@
       >
         <thead>
           <tr>
-            <th style="border: 1px solid #000; padding: 8px; text-align: center;">编号</th>
-            <th style="border: 1px solid #000; padding: 8px; text-align: center; width: 180px;">名称</th>
-            <th style="border: 1px solid #000; padding: 8px; text-align: center; width: 140px;">规格</th>
-            <th style="border: 1px solid #000; padding: 8px; text-align: center;">单位</th>
-            <th style="border: 1px solid #000; padding: 8px; text-align: center;">入库数量</th>
-            <th style="border: 1px solid #000; padding: 8px; text-align: center;">单价</th>
-            <th style="border: 1px solid #000; padding: 8px; text-align: center;">金额</th>
-            <th style="border: 1px solid #000; padding: 8px; text-align: center;">批次号</th>
+            <th style="border: 1px solid #000; padding: 4px; text-align: center; width: 5%;">编号</th>
+            <th style="border: 1px solid #000; padding: 4px; text-align: center; width: 18%;">名称</th>
+            <th style="border: 1px solid #000; padding: 4px; text-align: center; width: 18%;">型号规格</th>
+            <th style="border: 1px solid #000; padding: 4px; text-align: center; width: 8%;">单位</th>
+            <th style="border: 1px solid #000; padding: 4px; text-align: center; width: 8%;">入库数量</th>
+            <th style="border: 1px solid #000; padding: 4px; text-align: center; width: 8%;">单价</th>
+            <th style="border: 1px solid #000; padding: 4px; text-align: center; width: 10%;">金额</th>
+            <th style="border: 1px solid #000; padding: 4px; text-align: center; width: 12%;">批次号</th>
           </tr>
         </thead>
         <tbody>
           <tr v-for="(row, index) in rowList.outInDetailList" :key="index">
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ index + 1 }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ row?.categoryName || '' }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ row?.specification || '' }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ row?.measureUnit || '' }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ row?.measureQuantity || '' }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ row?.unitPrice || 0 }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ row?.totalMoney || 0}}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ row?.batchNo || '' }}</td>
+            <td style="border: 1px solid #000; padding: 4px; text-align: center;">{{ index + 1 }}</td>
+            <td style="border: 1px solid #000; padding: 4px; text-align: center;">{{ row?.categoryName || '' }}</td>
+            <td style="border: 1px solid #000; padding: 4px; text-align: center;">{{row.categoryModel || '' }}{{ row.categoryModel && row?.specification ? '/' : '' }}{{ row?.specification || '' }}</td>
+            <td style="border: 1px solid #000; padding: 4px; text-align: center;">{{ row?.measureUnit || '' }}</td>
+            <td style="border: 1px solid #000; padding: 4px; text-align: center;">{{ row?.measureQuantity || '' }}</td>
+            <td style="border: 1px solid #000; padding: 4px; text-align: center;">{{ row?.unitPrice || 0 }}</td>
+            <td style="border: 1px solid #000; padding: 4px; text-align: center;">{{ row?.totalMoney || 0}}</td>
+            <td style="border: 1px solid #000; padding: 4px; text-align: center;">{{ row?.batchNo || '' }}</td>
           </tr>
           
           <!-- 合计金额行 -->
           <tr>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;" colspan="2">合计:</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ totalAmount || '' }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ totalAllPrice || '' }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td>
+            <td style="border: 1px solid #000; padding: 4px; text-align: center;" colspan="2">合计:</td>
+            <td style="border: 1px solid #000; padding: 4px; text-align: center;"></td>
+            <td style="border: 1px solid #000; padding: 4px; text-align: center;"></td>
+            <td style="border: 1px solid #000; padding: 4px; text-align: center;">{{ totalAmount || '' }}</td>
+            <td style="border: 1px solid #000; padding: 4px; text-align: center;"></td>
+            <td style="border: 1px solid #000; padding: 4px; text-align: center;">{{ totalAllPrice || '' }}</td>
+            <td style="border: 1px solid #000; padding: 4px; text-align: center;"></td>
           </tr>
         </tbody>
       </table>

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

@@ -18,12 +18,12 @@
             </el-form-item>
           </el-col>
           <el-col :span="6">
-            <el-form-item label="入库单号" prop="sourceBizNo">
+            <el-form-item label="入库单号" prop="bizNo">
               <el-input
                 size="small"
                 class="w100"
                 placeholder="请输入"
-                v-model="formData.sourceBizNo"
+                v-model="formData.bizNo"
               ></el-input>
             </el-form-item>
           </el-col>

+ 3 - 3
src/views/warehouseManagement/stocktaking/reportLoss/components/addReportDialog.vue

@@ -209,7 +209,7 @@
                 ></el-table-column>
               </el-table>
               <div slot="reference" class="name-wrapper">
-                <el-tag size="medium">{{ scope.row.categoryLevelId }}</el-tag>
+                <el-tag size="medium">{{ scope.row.categoryLevelName }}</el-tag>
               </div>
             </el-popover>
           </template>
@@ -235,12 +235,12 @@
           :show-overflow-tooltip="true"
         ></el-table-column>
         <el-table-column
-          prop="wornQuantity"
+          prop="loseQuantity"
           label="盘亏数量"
           :show-overflow-tooltip="true"
         ></el-table-column>
         <el-table-column
-          prop="loseQuantity"
+          prop="wornQuantity"
           label="破损数量"
           :show-overflow-tooltip="true"
         ></el-table-column>

+ 1 - 1
src/views/warehouseManagement/stocktaking/reportLoss/components/reportProcuts.vue

@@ -140,7 +140,7 @@
                   </el-table>
                   <div slot="reference" class="name-wrapper">
                     <el-tag size="medium">{{
-                      scope.row.categoryLevelId
+                      scope.row.categoryLevelName
                     }}</el-tag>
                   </div>
                 </el-popover>

+ 55 - 25
src/views/warehouseManagement/stocktaking/work/components/disposeDialog.vue

@@ -4,6 +4,7 @@
       :title="`处理工单`"
       append-to-body
       :visible.sync="visibleDialog"
+      destroy-on-close
       @close="closeWindows"
       width="80vw"
       :maxable="true"
@@ -17,7 +18,7 @@
               v-model="keyWord"
               class="input-with-select"
             >
-              <el-button slot="append" icon="el-icon-search">搜索</el-button>
+              <el-button slot="append" icon="el-icon-search" @click="search">搜索</el-button>
             </el-input>
             <el-button type="primary" @click="control">处理</el-button>
           </div>
@@ -38,16 +39,17 @@
             </el-table-column>
             <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="info.categoryCode"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+
             <!-- <el-table-column
               width="150"
               prop="categoryLevelPath"
@@ -59,21 +61,21 @@
               prop="batchNo"
               :show-overflow-tooltip="true"
             ></el-table-column>
-            <el-table-column
+            <!-- <el-table-column
               label="包装编码"
               prop="packageNo"
               :show-overflow-tooltip="true"
-            ></el-table-column>
-            <el-table-column
+            ></el-table-column> -->
+            <!-- <el-table-column
               label="包装数量"
               prop="info.packingCountBase"
               :show-overflow-tooltip="true"
-            ></el-table-column>
-            <el-table-column
+            ></el-table-column> -->
+            <!-- <el-table-column
               label="包装单位"
               prop="info.packingUnit"
               :show-overflow-tooltip="true"
-            ></el-table-column>
+            ></el-table-column> -->
             <!-- <el-table-column
               label="牌号"
               prop="brandNum"
@@ -93,17 +95,17 @@
               label="规格"
               prop="specification"
               :show-overflow-tooltip="true"
-            ></el-table-column>
+            ></el-table-column> -->
             <el-table-column
               label="计量数量"
-              prop="measureQuantity"
+              prop="info.measureQuantity"
               :show-overflow-tooltip="true"
             ></el-table-column>
             <el-table-column
               label="计量单位"
-              prop="measureUnit"
+              prop="info.measureUnit"
               :show-overflow-tooltip="true"
-            ></el-table-column> -->
+            ></el-table-column>
             <el-table-column
               label="重量"
               prop="info.weight"
@@ -178,12 +180,17 @@
               prop="categoryName"
               :show-overflow-tooltip="true"
             ></el-table-column>
+            <el-table-column
+              label="物品编码"
+              prop="info.categoryCode"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
             <el-table-column
               label="批次号"
               prop="batchNo"
               :show-overflow-tooltip="true"
             ></el-table-column>
-            <el-table-column
+            <!-- <el-table-column
               label="包装编码"
               prop="packageNo"
               :show-overflow-tooltip="true"
@@ -197,6 +204,16 @@
               label="包装单位"
               prop="info.packingUnit"
               :show-overflow-tooltip="true"
+            ></el-table-column> -->
+            <el-table-column
+              label="计量数量"
+              prop="info.measureQuantity"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="计量单位"
+              prop="info.measureUnit"
+              :show-overflow-tooltip="true"
             ></el-table-column>
             <el-table-column
               label="重量"
@@ -300,6 +317,12 @@
       this.getFieldModel();
     },
     methods: {
+      // 搜索
+      search() {
+        this.pages.keyWord = this.keyWord;
+        this.pages.pageNum = 1;
+        this._getInformation();
+      },
       control() {
         if (this.selection.length > 0) {
           console.log(this.selection);
@@ -386,6 +409,7 @@
         this.selectionIds = this.selectionIds.filter((item) => item !== row.id);
       },
       onConfirm() {
+        let arr = []
         if (this.controlTableData.length > 0) {
           let isBoolen = this.controlTableData.every(
             (item) => item.controlStatus > 0 && item.count > 0
@@ -393,7 +417,7 @@
           if (!isBoolen) {
             return this.$message.error('请选择盘点状态和数量!');
           }
-          let arr = this.controlTableData.map((item) => {
+          arr = this.controlTableData.map((item) => {
             let key = null;
             switch (item.controlStatus) {
               case '2':
@@ -413,15 +437,18 @@
               [key]: item.count
             };
           });
-          console.log(arr);
-          reportWork(arr).then(() => {
-            this.$message.success('报工成功!');
-            this.$emit('flushed');
-            this.closeWindows();
-          });
         } else {
-          this.$message.error('请选择物品!');
+          arr = []
         }
+        console.log(arr);
+        reportWork(arr, { planOrderId: this.planOrderId }).then(() => {
+          this.$message.success('报工成功!');
+          this.$emit('flushed');
+          this.closeWindows();
+        });
+        // } else {
+        //   this.$message.error('请选择物品!');
+        // }
       },
       open(id) {
         this.planOrderId = id;
@@ -431,7 +458,10 @@
         this.selection = val;
       },
       closeWindows() {
+        this.keyWord = '';
+        this.pages.keyWord = '';
         this.selection = [];
+        this.controlTableData = [];
         this.visibleDialog = false;
       },
       async _getInformation() {

+ 14 - 1
src/views/warehouseManagement/stocktaking/work/index.vue

@@ -141,11 +141,24 @@
         ],
         // 加载状态
         loading: false,
-        planOrderId: ''
+        planOrderId: '',
+        userInfo: {}
       };
     },
+    created() {
+      let info = JSON.parse(localStorage.getItem('info'));
+      this.userInfo = info;
+    },
     methods: {
       control(row) {
+        console.log(row, this.userInfo);
+        if (row.executorId != this.userInfo.userId) {
+          this.$message({
+            type: 'error',
+            message: '您不是盘点人员,不能报工!',
+          });
+          return;
+        }
         this.$refs.disposeDialogRef.open(row.id);
       },
       /* 表格数据源 */

+ 212 - 84
src/views/warehouseManagement/warehouseDefinition/add.vue

@@ -41,6 +41,11 @@
               stripe
               :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
             >
+              <el-table-column label="二维码" prop="qrcode" min-width="100" align="center">
+                <template slot-scope="{ row, $index }">
+                  <el-link v-if="row.id && !row.isEdit" type="primary" @click="generateQrcode(row, '库区')">二维码</el-link>
+                </template>
+              </el-table-column>
               <el-table-column label="库区编号" prop="code" min-width="120">
                 <template slot-scope="{ row, $index }">
                   <el-form-item
@@ -179,7 +184,7 @@
                   <span v-else>{{ scope.row.extInfo[0].areaLength }}</span>
                 </template>
               </el-table-column>
-              <el-table-column label="库区宽(cm)" min-width="120">
+              <el-table-column label="库区宽(cm)" min-width="120" align="center">
                 <template slot-scope="scope">
                   <el-form-item
                     :prop="
@@ -201,7 +206,7 @@
                   <span v-else>{{ scope.row.extInfo[0].areaWidth }}</span>
                 </template>
               </el-table-column>
-              <el-table-column label="库区高(cm)" min-width="120">
+              <el-table-column label="库区高(cm)" min-width="120" align="center">
                 <template slot-scope="scope">
                   <el-form-item
                     :prop="
@@ -223,7 +228,7 @@
                   <span v-else>{{ scope.row.extInfo[0].areaHigh }}</span>
                 </template>
               </el-table-column>
-              <el-table-column label="货架数量" min-width="120">
+              <el-table-column label="货架数量" min-width="100" align="center">
                 <template slot-scope="scope">
                   <el-form-item
                     :prop="
@@ -268,7 +273,7 @@
                 <span v-else>{{ scope.row.areaBarcode }}</span>
               </template>
             </el-table-column> -->
-              <el-table-column label="备注" min-width="120">
+              <el-table-column label="备注" min-width="120" align="center">
                 <template slot-scope="scope">
                   <el-form-item
                     :prop="'warehouseAreasSaveList.' + scope.$index + 'remark'"
@@ -285,7 +290,7 @@
                   <span v-else>{{ scope.row.remark }}</span>
                 </template>
               </el-table-column>
-              <el-table-column label="操作" fixed="right" width="150">
+              <el-table-column label="操作" fixed="right" width="170" align="center">
                 <template slot-scope="{ row, $index }">
                   <el-button
                     type="text"
@@ -297,6 +302,11 @@
                   <el-button type="text" v-else @click="addShelf(row, $index)"
                     >添加货架</el-button
                   >
+
+                  <!-- <el-button type="text" v-if="!row.isEdit" @click="editArea(row, $index)"
+                    >编辑</el-button
+                  > -->
+
                   <el-button type="text" @click="remove1($index, row)"
                     >删除库区</el-button
                   >
@@ -327,11 +337,17 @@
               stripe
               :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
             >
+              <el-table-column label="二维码" prop="qrcode" min-width="100" align="center">
+                <template slot-scope="{ row, $index }">
+                  <el-link v-if="row.id && !row.isEdit" type="primary" @click="generateQrcode(row, '货架')">二维码</el-link>
+                </template>
+              </el-table-column>
               <el-table-column
                 label="库区编号"
                 prop="reservoirAreaCode"
+                align="center"
               ></el-table-column>
-              <el-table-column label="货架编号" prop="code" min-width="120">
+              <el-table-column label="货架编号" prop="code" min-width="120" align="center">
                 <template slot-scope="{ row, $index }">
                   <el-form-item
                     :prop="'areaGoodsshelvesList.' + $index + '.code'"
@@ -347,7 +363,7 @@
                   <span v-else>{{ row.code }}</span>
                 </template>
               </el-table-column>
-              <el-table-column label="货架行数" min-width="120">
+              <el-table-column label="货架行数" min-width="120" align="center">
                 <template slot-scope="scope">
                   <el-form-item
                     :prop="
@@ -376,7 +392,7 @@
                   <span v-else>{{ scope.row.extInfo[0].line }}</span>
                 </template>
               </el-table-column>
-              <el-table-column label="货架列数" min-width="120">
+              <el-table-column label="货架列数" min-width="120" align="center">
                 <template slot-scope="scope">
                   <el-form-item
                     :prop="
@@ -405,7 +421,7 @@
                   <span v-else>{{ scope.row.extInfo[0].column }}</span>
                 </template>
               </el-table-column>
-              <el-table-column label="货架长(cm)" min-width="120">
+              <el-table-column label="货架长(cm)" min-width="120" align="center">
                 <template slot-scope="scope">
                   <el-form-item
                     :prop="
@@ -427,7 +443,7 @@
                   <span v-else>{{ scope.row.extInfo[0].areaLength }}</span>
                 </template>
               </el-table-column>
-              <el-table-column label="货架宽(cm)" min-width="120">
+              <el-table-column label="货架宽(cm)" min-width="120" align="center">
                 <template slot-scope="scope">
                   <el-form-item
                     :prop="
@@ -449,7 +465,7 @@
                   <span v-else>{{ scope.row.extInfo[0].areaWidth }}</span>
                 </template>
               </el-table-column>
-              <el-table-column label="货架高(cm)" min-width="120">
+              <el-table-column label="货架高(cm)" min-width="120" align="center">
                 <template slot-scope="scope">
                   <el-form-item
                     :prop="
@@ -471,7 +487,7 @@
                   <span v-else>{{ scope.row.extInfo[0].areaHigh }}</span>
                 </template>
               </el-table-column>
-              <el-table-column label="货位数量" prop="" min-width="120">
+              <el-table-column label="货位数量" prop="" min-width="120" align="center">
                 <template slot-scope="{ row }">
                   {{ setNUm(row) }}
                 </template>
@@ -480,6 +496,7 @@
                 label="是否规则"
                 prop="isRegular"
                 min-width="120"
+                align="center"
               >
                 <template slot-scope="{ row }">
                   <el-select
@@ -506,7 +523,7 @@
               label="货架条码"
               prop="goodsshelvesBarcode"
             ></el-table-column> -->
-              <el-table-column label="备注" min-width="120">
+              <el-table-column label="备注" min-width="120" align="center">
                 <template slot-scope="scope">
                   <el-form-item
                     :prop="'areaGoodsshelvesList.' + scope.$index + '.remark'"
@@ -521,7 +538,7 @@
                   <span v-else>{{ scope.row.remark }}</span>
                 </template>
               </el-table-column>
-              <el-table-column label="操作" fixed="right" min-width="120">
+              <el-table-column label="操作" fixed="right" min-width="120" align="center">
                 <template slot-scope="{ $index, row }">
                   <el-button
                     type="text"
@@ -561,7 +578,12 @@
               :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
             >
               <!-- <el-table-column type="selection" width="55"> </el-table-column> -->
-              <el-table-column label="货架编号" prop="goodsShelvesCode">
+              <el-table-column label="二维码" prop="qrcode" min-width="100" align="center">
+                <template slot-scope="{ row, $index }">
+                  <el-link v-if="row.id && !row.isEdit" type="primary" @click="generateQrcode(row, '货位')">二维码</el-link>
+                </template>
+              </el-table-column>
+              <el-table-column label="货架编号" prop="goodsShelvesCode" align="center">
                 <template slot-scope="{ row }">
                   {{ row.warehouseAreaCode + '-' + row.warehouseAreaGoodsCode }}
                 </template>
@@ -570,6 +592,7 @@
                 label="货位编号"
                 prop="goodsAllocationCode"
                 min-width="120"
+                align="center"
               >
                 <template slot-scope="{ row, $index }">
                   <el-form-item
@@ -588,7 +611,7 @@
                   <span v-else>{{ row.goodsAllocationCode }}</span>
                 </template></el-table-column
               >
-              <el-table-column label="货位长(cm)" min-width="120">
+              <el-table-column label="货位长(cm)" min-width="120" align="center">
                 <template slot-scope="scope">
                   <el-form-item
                     :prop="
@@ -615,7 +638,7 @@
                   }}</span>
                 </template>
               </el-table-column>
-              <el-table-column label="货位宽(cm)" min-width="120">
+              <el-table-column label="货位宽(cm)" min-width="120" align="center">
                 <template slot-scope="scope">
                   <el-form-item
                     :prop="
@@ -640,7 +663,7 @@
                   }}</span>
                 </template>
               </el-table-column>
-              <el-table-column label="货位高(cm)" min-width="120">
+              <el-table-column label="货位高(cm)" min-width="120" align="center">
                 <template slot-scope="scope">
                   <el-form-item
                     :prop="
@@ -665,7 +688,7 @@
                   }}</span>
                 </template>
               </el-table-column>
-              <el-table-column label="限重(kg)" min-width="120">
+              <el-table-column label="限重(kg)" min-width="120" align="center">
                 <template slot-scope="scope">
                   <!-- :rules="areaLocationRules.weightLimit"
                     :prop="
@@ -685,7 +708,7 @@
                   <span v-else>{{ scope.row.extInfo[0].weightLimit }}</span>
                 </template>
               </el-table-column>
-              <el-table-column label="基本货位容积(cm³)" min-width="120">
+              <el-table-column label="基本货位容积(cm³)" min-width="120" align="center">
                 <template slot-scope="scope">
                   <el-form-item
                     :prop="
@@ -735,13 +758,15 @@
         <el-button @click="handleMine" type="primary">确 定</el-button>
       </span>
     </el-dialog>
+    <!-- 二维码 -->
+    <qsCode ref="qsCodeRef"></qsCode>
   </div>
 </template>
 
 <script>
   // import selectTree from '@/components/selectTree';
   import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
-
+  import qsCode from './components/qsCode.vue'
   import {
     warehouseDefinition_areaType,
     warehouseDefinition_areaAttribute,
@@ -752,13 +777,16 @@
 
   // import { throttle } from 'lodash';
   export default {
+    components: {
+      qsCode
+    },
     // components: { selectTree },
     filters: {
       filterAreaType: useDictLabelFilter
     },
     data() {
       // const msg = throttle(
-      //   () => this.$message.error('货架总体积不能大于库区体积!'),
+      //   () => this.$message.warning('货架总体积不能大于库区体积!'),
       //   500
       // );
 
@@ -808,6 +836,7 @@
       };
 
       return {
+        editType: '',
         warehouseDefinition_isRegular,
         warehouseDefinition_areaType,
         warehouseDefinition_areaAttribute,
@@ -853,6 +882,11 @@
           }
         },
         areaLocationRules: {
+          goodsAllocationCode: {
+            required: true,
+            message: '请输入货位编号',
+            trigger: 'blur'
+          },
           code: {
             required: true,
             message: '请输入货位编号',
@@ -971,8 +1005,10 @@
         let kqArr = [];
         for (const key in warehouseAreasSaveList) {
           kqArr.push({
+            id: warehouseAreasSaveList[key].id,
             name: warehouseAreasSaveList[key].name,
             code: warehouseAreasSaveList[key].code,
+            isEdit: false,
             extInfo: [
               {
                 areaType: warehouseAreasSaveList[key].type,
@@ -1213,7 +1249,7 @@
               row.reservoirAreaCode === item.reservoirAreaCode
           ).length > 1
         ) {
-          return this.$message.error('货架编号不能重复!');
+          return this.$message.warning('货架编号不能重复!');
         }
         const savedSum = this.areaForm.areaGoodsshelvesList
           .filter((t) => t.reservoirAreaCode === row.reservoirAreaCode)
@@ -1238,7 +1274,7 @@
               row.extInfo[0].areaWidth *
               row.extInfo[0].areaHigh
           ) {
-            return this.$message.error('货架总体积不能大于库区体积!');
+            return this.$message.warning('货架总体积不能大于库区体积!');
           }
         }
 
@@ -1253,48 +1289,92 @@
       },
       generateAllocation(num, obj) {
         console.log(obj);
-        const pre =
-          this.areaForm.allocationReqList[
-            this.areaForm.allocationReqList.length - 1
-          ];
-
-        for (var i = 0; i < num; i++) {
-          this.areaForm.allocationReqList.push({
-            warehouseAreaCode: obj.reservoirAreaCode,
-            warehouseAreaGoodsCode: obj.code,
-            goodsAllocationCode: obj.code + '-' + (i + 1),
-            // allocationBarcode: '',
-            code: obj.code + '-' + (i + 1),
+        const rows = Number(obj.extInfo[0].line); // 行数
+        const cols = Number(obj.extInfo[0].column); // 列数
+        
+        // 按行优先遍历:行从1到rows,列从1到cols
+        for (let row = 1; row <= rows; row++) {
+          for (let col = 1; col <= cols; col++) {
+            // 货位编号规则:货架编号-行号-列号
+            const allocationCode = `${obj.code}-${row}-${col}`;
+            
+            this.areaForm.allocationReqList.push({
+              warehouseAreaCode: obj.reservoirAreaCode,
+              warehouseAreaGoodsCode: obj.code,
+              goodsAllocationCode: allocationCode,
+              // allocationBarcode: '',
+              code: allocationCode,
 
-            extInfo: [
-              {
-                goodsAllocationWide: Number(obj.extInfo[0].areaWidth),
-                goodsAllocationHigh: Number(
-                  obj.extInfo[0].areaHigh / Number(obj.extInfo[0].line)
-                ).toFixed(0),
-                goodsAllocationLength: Number(
-                  obj.extInfo[0].areaLength / Number(obj.extInfo[0].column)
-                ).toFixed(0),
-                weightLimit: '',
-                volumeUnit:
-                  Number(
-                    obj.extInfo[0].areaLength / Number(obj.extInfo[0].column)
-                  ).toFixed(0) *
-                  Number(
-                    obj.extInfo[0].areaHigh / Number(obj.extInfo[0].line)
-                  ).toFixed(0) *
-                  Number(obj.extInfo[0].areaWidth)
-              }
-            ],
-            goodsShelvesCode: obj.code,
-            reservoirAreaCode: obj.reservoirAreaCode,
-            warehouseId: this.formData.id, //?
+              extInfo: [
+                {
+                  goodsAllocationWide: Number(obj.extInfo[0].areaWidth),
+                  goodsAllocationHigh: Number(
+                    obj.extInfo[0].areaHigh / rows
+                  ).toFixed(0),
+                  goodsAllocationLength: Number(
+                    obj.extInfo[0].areaLength / cols
+                  ).toFixed(0),
+                  weightLimit: '',
+                  volumeUnit:
+                    Number(obj.extInfo[0].areaLength / cols).toFixed(0) *
+                    Number(obj.extInfo[0].areaHigh / rows).toFixed(0) *
+                    Number(obj.extInfo[0].areaWidth)
+                }
+              ],
+              goodsShelvesCode: obj.code,
+              reservoirAreaCode: obj.reservoirAreaCode,
+              warehouseId: this.formData.id,
 
-            type: 3,
-            isEdit: true
-          });
+              type: 3,
+              isEdit: true
+            });
+          }
         }
       },
+      // generateAllocation(num, obj) {
+      //   console.log(obj);
+      //   const pre =
+      //     this.areaForm.allocationReqList[
+      //       this.areaForm.allocationReqList.length - 1
+      //     ];
+
+      //   for (var i = 0; i < num; i++) {
+      //     this.areaForm.allocationReqList.push({
+      //       warehouseAreaCode: obj.reservoirAreaCode,
+      //       warehouseAreaGoodsCode: obj.code,
+      //       goodsAllocationCode: obj.code + '-' + (i + 1),
+      //       // allocationBarcode: '',
+      //       code: obj.code + '-' + (i + 1),
+
+      //       extInfo: [
+      //         {
+      //           goodsAllocationWide: Number(obj.extInfo[0].areaWidth),
+      //           goodsAllocationHigh: Number(
+      //             obj.extInfo[0].areaHigh / Number(obj.extInfo[0].line)
+      //           ).toFixed(0),
+      //           goodsAllocationLength: Number(
+      //             obj.extInfo[0].areaLength / Number(obj.extInfo[0].column)
+      //           ).toFixed(0),
+      //           weightLimit: '',
+      //           volumeUnit:
+      //             Number(
+      //               obj.extInfo[0].areaLength / Number(obj.extInfo[0].column)
+      //             ).toFixed(0) *
+      //             Number(
+      //               obj.extInfo[0].areaHigh / Number(obj.extInfo[0].line)
+      //             ).toFixed(0) *
+      //             Number(obj.extInfo[0].areaWidth)
+      //         }
+      //       ],
+      //       goodsShelvesCode: obj.code,
+      //       reservoirAreaCode: obj.reservoirAreaCode,
+      //       warehouseId: this.formData.id, //?
+
+      //       type: 3,
+      //       isEdit: true
+      //     });
+      //   }
+      // },
       saveArea(index) {
         this.hjForm = { code: '', type: 1 };
         if (
@@ -1303,7 +1383,7 @@
               item.code === this.areaForm.warehouseAreasSaveList[index].code
           ).length > 1
         ) {
-          return this.$message.error('库区编号不能重复!');
+          return this.$message.warning('库区编号不能重复!');
         }
         this.hjCodeIndex = index;
         this.hjCodeFalg = true;
@@ -1403,7 +1483,7 @@
             (item) => item.reservoirAreaCode === reservoirAreaCode
           ).length === 1
         ) {
-          return this.$message.error('至少保留一个货架!');
+          return this.$message.warning('至少保留一个货架!');
         }
         if (this.savedShelves.includes(id)) {
           let list = this.areaForm.allocationReqList
@@ -1413,7 +1493,7 @@
           const res = await existGoods(list);
 
           if (res?.success && res.data) {
-            return this.$message.error('此货架下货位有关联货物,无法删除!');
+            return this.$message.warning('此货架下货位有关联货物,无法删除!');
           }
         }
 
@@ -1446,18 +1526,24 @@
         //  warehouseAreasSaveList: res.reservoirAreaList || [], //库区
         // areaGoodsshelvesList: res.goodsShelvesList || [], //货架
         // allocationReqList: res.goodsAllocationList || [] //货位
+        console.log('removeGoods1~~', idx, id, code, reservoirAreaCode);
         if (
           this.areaForm.areaGoodsshelvesList.filter(
             (item) => item.reservoirAreaCode === reservoirAreaCode
           ).length === 1
         ) {
-          return this.$message.error('至少保留一个货架!');
+          return this.$message.warning('至少保留一个货架!');
         }
 
         this.$confirm(`是否删除这个货架?`).then(async () => {
+          // 删除前统计该库区的货架数量
+          const beforeCount = this.areaForm.areaGoodsshelvesList.filter(
+            (item) => item.reservoirAreaCode === reservoirAreaCode
+          ).length;
+
           if (id) {
-            const res = await warehouseDefinition.isDelete(id);
-            if (res == 1) {
+            const res = await warehouseDefinition.isGoodsshelvesCanDelete(id);
+            if (res) {
               this.areaForm.areaGoodsshelvesList =
                 this.areaForm.areaGoodsshelvesList.filter(
                   (item) => item.code !== code
@@ -1466,9 +1552,11 @@
                 this.areaForm.allocationReqList.filter(
                   (item) => item.goodsShelvesCode !== code
                 );
+              // 更新对应库区的货架数量
+              this.updateAreaSubCount(reservoirAreaCode, beforeCount);
               this.$message.warning('已在本地删除,保存之后生效!');
             } else {
-              this.$message.warning('此数据可能有关联数据,暂时无法删除!');
+              this.$message.warning('该货架已上架产品,无法删除。');
             }
           } else {
             this.areaForm.areaGoodsshelvesList =
@@ -1479,17 +1567,38 @@
               this.areaForm.allocationReqList.filter(
                 (item) => item.goodsShelvesCode !== code
               );
-
+            // 更新对应库区的货架数量
+            this.updateAreaSubCount(reservoirAreaCode, beforeCount);
             this.$message.success('删除成功!');
           }
         });
       },
+      updateAreaSubCount(reservoirAreaCode, beforeCount) {
+        // 删除后统计该库区的货架数量
+        const afterCount = this.areaForm.areaGoodsshelvesList.filter(
+          (item) => item.reservoirAreaCode === reservoirAreaCode
+        ).length;
+        // 更新库区的货架数量
+        const areaIndex = this.areaForm.warehouseAreasSaveList.findIndex(
+          (item) => item.code === reservoirAreaCode
+        );
+        if (areaIndex !== -1) {
+          this.areaForm.warehouseAreasSaveList[areaIndex].subCount = afterCount;
+        }
+      },
+      editArea(row, index) {
+        this.editType = 'edit';
+        row.isEdit = true;
+        this.$set(this.areaForm.warehouseAreasSaveList[index], 'isEdit', true);
+        console.log('editArea~~', row, index, this.areaForm.warehouseAreasSaveList[index]);
+      },
       remove1(index, { id, code }) {
+        console.log('remove1~~', index, id, code);
         this.$confirm(`是否删除这个库区`)
           .then(async () => {
             if (id) {
-              const res = await warehouseDefinition.isDelete(id);
-              if (res == 1) {
+              const res = await warehouseDefinition.isAreaCanDelete(id);
+              if (res) {
                 this.areaForm.warehouseAreasSaveList.splice(index, 1);
                 this.areaForm.areaGoodsshelvesList =
                   this.areaForm.areaGoodsshelvesList.filter(
@@ -1501,7 +1610,7 @@
                   );
                 this.$message.warning('已在本地删除,保存之后生效!');
               } else {
-                this.$message.warning('此数据可能有关联数据,暂时无法删除!');
+                this.$message.warning('该库区已上架产品,无法删除。');
               }
             } else {
               this.areaForm.warehouseAreasSaveList.splice(index, 1);
@@ -1535,7 +1644,7 @@
           const res = await existGoods(list);
 
           if (res?.success && res.data) {
-            return this.$message.error('此库区下货位有关联货物,无法删除!');
+            return this.$message.warning('此库区下货位有关联货物,无法删除!');
           }
         }
         // 货架code
@@ -1558,6 +1667,7 @@
         this.areaForm.warehouseAreasSaveList.splice(index, 1);
       },
       addArea() {
+        this.editType = 'add';
         const pre =
           this.areaForm.warehouseAreasSaveList[
             this.areaForm.warehouseAreasSaveList.length - 1
@@ -1594,23 +1704,23 @@
         delete this.formData.reservoirAreaList;
 
         if (this.areaForm.warehouseAreasSaveList.length === 0) {
-          return this.$message.error('请添加库区');
+          return this.$message.warning('请添加库区');
         }
         // ===dakai
         if (
           this.areaForm.warehouseAreasSaveList.length > 0 &&
           this.areaForm.allocationReqList.length === 0
         ) {
-          return this.$message.error('请添加货位');
+          return this.$message.warning('请添加货位');
         }
         if (
           this.areaForm.warehouseAreasSaveList.length > 0 &&
           this.areaForm.areaGoodsshelvesList.length === 0
         ) {
-          return this.$message.error('请添加货架');
+          return this.$message.warning('请添加货架');
         }
         if (!this.checkVolume()) {
-          return this.$message.error('货架总体积不能大于库区体积!');
+          return this.$message.warning('货架总体积不能大于库区体积!');
         }
 
         // let obj = {};
@@ -1631,13 +1741,21 @@
         // }
         
         let codeS=this.areaForm.allocationReqList?.map(item=>{
-          return item.reservoirAreaCode+'_'+item.goodsShelvesCode+'_'+item.goodsAllocationCode
+          return item.reservoirAreaCode+'_'+item.warehouseAreaGoodsCode+'_'+item.goodsAllocationCode
         })
-        if(codeS){
-          codeS=Array.from(new Set(codeS)) 
-        }
-        if(codeS?.length!=this.areaForm.allocationReqList?.length){
-          return this.$message.error('货位编号不能重复!');
+        // 找出重复的货位编号
+        const duplicateCodes = [];
+        const codeCount = {};
+        codeS?.forEach(code => {
+          codeCount[code] = (codeCount[code] || 0) + 1;
+          if (codeCount[code] === 2) {
+            duplicateCodes.push(code);
+          }
+        });
+
+        console.log('duplicateCodes', this.areaForm.allocationReqList, codeS, duplicateCodes);
+        if(duplicateCodes.length > 0){
+          return this.$message.warning(`货位编号重复:${duplicateCodes.join('、')}!`);
         }
    
 
@@ -1793,6 +1911,16 @@
           newArr.push({ ...arr[key].extInfo[0], ...arr[key] });
         }
         return newArr;
+      },
+      generateQrcode(row, type) {
+        console.log(row);
+        if(row.isEdit){
+          this.$message.warning('请先保存库区');
+          return;
+        }
+        this.$nextTick(() => {
+          this.$refs.qsCodeRef.open(row, type);
+        });
       }
     }
   };

+ 11 - 4
src/views/warehouseManagement/warehouseDefinition/components/WarehouseEdit.vue

@@ -27,13 +27,13 @@
           maxlength="16"
         ></el-input>
       </el-form-item>
-      <el-form-item label="物品类型" prop="warehouseType">
+      <el-form-item label="仓库类型" prop="warehouseType">
         <el-select
           filterable
           size="small"
           class="w100"
           v-model="formData.warehouseType"
-          placeholder="物品类型"
+          placeholder="仓库类型"
           :clearable="true"
         >
           <el-option
@@ -61,7 +61,7 @@
           ></el-option>
         </el-select>
       </el-form-item>
-      <el-form-item label="仓库类型" prop="inventoryType">
+      <el-form-item label="物品类型" prop="inventoryType">
         <!-- <DictSelection
           dictName="仓库类型"
           clearable
@@ -243,8 +243,9 @@ export default {
       rules: {
         code: [{ required: true, message: '请输入仓库编码', trigger: 'blur' }],
         name: [{ required: true, message: '请输入仓库名称', trigger: 'blur' }],
+        warehouseType: [{ required: true, message: '请选择仓库类型', trigger: 'blur' }],
         inventoryType: [
-          { required: true, message: '请选择仓库类型', trigger: 'blur' }
+          { required: true, message: '请选择物品类型', trigger: 'blur' }
         ],
         factoryId: [
           { required: true, message: '请选择工厂名称', trigger: 'blur' }
@@ -429,6 +430,12 @@ export default {
       this.$refs.formRef.validate(async (value) => {
         if (value) {
           let params = Object.assign(this.formData);
+          let user = this.userList.find((item) => {
+            return item.id == params.ownerId;
+          });
+          console.log(user);
+
+          params.ownerName = user.name;
           params.inventoryType = params.inventoryType.join(',');
           params.inventoryName = params.inventoryName.join(',');
 

+ 91 - 0
src/views/warehouseManagement/warehouseDefinition/components/qsCode.vue

@@ -0,0 +1,91 @@
+<template>
+  <el-dialog
+      class="ele-dialog-form"
+      :visible.sync="codeVisible"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      center
+      width="200px"
+      append-to-body
+      title="二维码"
+    >
+      <div class="qr-code-container">
+        <ele-qr-code :value="text" :size="140" />
+      </div>
+    
+      <template v-slot:footer>
+        <el-button @click="codeVisible=false">返回</el-button>
+      </template>
+    </el-dialog>
+</template>
+
+<script>
+
+
+import EleQrCode from 'ele-admin/es/ele-qr-code';
+import {
+  warehouseDefinition_areaType,
+  warehouseDefinition_areaAttribute,
+} from '@/utils/dict/index';
+
+export default {
+
+  data() {
+    return {
+      codeVisible: false,
+      text:''
+
+
+    }
+  },
+  components: {
+
+    EleQrCode
+  },
+  watch: {},
+  methods: {
+    open(row, type) {
+      this.codeVisible=true
+      // let addr =
+      //         '' + row.addressName ? row.addressName.replaceAll(',', '') : '';
+      //       addr += row.address ? row.address : '';
+      // const paramsStr = this.obj_to_str({
+      //   name: encodeURIComponent(row.name),
+      //   // areaType: encodeURIComponent(warehouseDefinition_areaType.find(item=>item.code==row.extInfo[0].areaType)?.label),
+      //   // attribute: encodeURIComponent(warehouseDefinition_areaAttribute.find(item=>item.code==row.extInfo[0].attribute)?.label),
+      //   code: encodeURIComponent(row.code),
+      //   // codeList: encodeURIComponent(codes),
+      //   // address: encodeURIComponent(row.extInfo[0].address),
+      //   // areaLength: encodeURIComponent(row.extInfo[0].areaLength),
+      //   // areaWidth: encodeURIComponent(row.extInfo[0].areaWidth),
+      //   // areaHigh: encodeURIComponent(row.extInfo[0].areaHigh),
+      //   // subCount: encodeURIComponent(row.subCount),
+      //   // remark: encodeURIComponent(row.remark),
+      // });
+
+      console.log('二维码参数~~~', row, type);
+      this.text = `/pages/warehouse/hwQrcode/index?type=${type}&code=${row.code}&id=${row.id}`;
+
+        console.log('二维码~~~', this.text);
+    },
+
+    obj_to_str(obj) {
+      var str = '';
+      for (var k in obj) {
+        str += `${k}=${obj[k]}&`;
+      }
+      return str;
+    },
+    
+
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.qr-code-container{
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+</style>

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

@@ -245,7 +245,7 @@
           emptyAllocationStart: ''
         },
         cacheKeyUrl: 'wms-c2e9664a-warehouseDefinition-index',
-
+        selection: [],
         columns: [
           {
             columnKey: 'index',