2
0

35 Incheckningar 271df808e2 ... b8a17a39a7

Upphovsman SHA1 Meddelande Datum
  廖泽勇 b8a17a39a7 Merge branch 'dev_ml' of http://121.40.253.172:3000/pengyue/jsh_erp 1 månad sedan
  廖泽勇 88653ed255 Merge branch 'test' of http://121.40.253.172:3000/pengyue/jsh_erp 1 månad sedan
  maliang 918281a136 fix:角色勾选bug修复 1 månad sedan
  yz 1708ff0856 Merge remote-tracking branch 'origin/master' 1 månad sedan
  yz dd29e3e7a9 Merge remote-tracking branch 'origin/dev_huangjunjie' 1 månad sedan
  huang 1e5653b53c 导入-添加期初库存后更新当前库存,出库bug修改 1 månad sedan
  maliang 2c3c189f22 fix:其它出库、其它入库详情字段调整 1 månad sedan
  huang 5f02343aee 更新sql 1 månad sedan
  maliang 8ed83787cb fix:其它出库价格比对 1 månad sedan
  yz 2b71d1f594 Merge remote-tracking branch 'origin/dev_ml' 1 månad sedan
  廖泽勇 321ab849f5 Merge branch 'dev_ml' of http://121.40.253.172:3000/pengyue/jsh_erp into test 1 månad sedan
  maliang 072f8741a3 fix:修改商品模版 1 månad sedan
  yz f044e67a87 Merge remote-tracking branch 'origin/dev_huangjunjie' 1 månad sedan
  huang 649c22b054 更新sql 1 månad sedan
  huang 98d037ccde 商品信息导入增加期初库存,pda商品库存增加仓库筛选 1 månad sedan
  maliang 71025b467b fix:回归测试bug 1 månad sedan
  廖泽勇 62f19bea04 Merge branch 'dev_ml' of http://121.40.253.172:3000/pengyue/jsh_erp into test 1 månad sedan
  maliang 49366ac2bf fix:修改 1 månad sedan
  yz ff8a32cbfe Merge remote-tracking branch 'origin/dev_huangjunjie' 1 månad sedan
  huang 6855528985 pda盘点商品条码搜索,pc商品信息导出、订单税额、序列号bug修改 1 månad sedan
  huang dc271a5f2a Merge branch 'master' of http://121.40.253.172:3000/pengyue/jsh_erp into dev_huangjunjie 1 månad sedan
  yz 93f7a62fe5 Merge remote-tracking branch 'origin/dev_huangjunjie' 1 månad sedan
  huang a18d733b47 二期: bug修改 1 månad sedan
  廖泽勇 09ce931f09 Merge branch 'dev_ml' of http://121.40.253.172:3000/pengyue/jsh_erp into test 1 månad sedan
  maliang 4ff72c2872 fix:bug 1 månad sedan
  maliang dcb06ee870 fix:bug 1 månad sedan
  maliang 77a146e8fd fix:bug 1 månad sedan
  廖泽勇 4a1e5e2506 Merge branch 'dev_huangjunjie' of http://121.40.253.172:3000/pengyue/jsh_erp into test 1 månad sedan
  廖泽勇 46eb38e903 Merge branch 'dev_ml' of http://121.40.253.172:3000/pengyue/jsh_erp into test 1 månad sedan
  廖泽勇 f8d7a3c13a Merge branch 'master' of http://121.40.253.172:3000/pengyue/jsh_erp into test 1 månad sedan
  huang 8aba73d5fd 二期:除审核外的需求修改 1 månad sedan
  maliang 7b1747b77d fix:关联订单 1 månad sedan
  maliang aee8a6c3d6 fix:修改 1 månad sedan
  maliang f6c02d12fe feat:二期修改 2 månader sedan
  廖泽勇 21349a8f3f Merge branch 'dev_ml_423' of http://121.40.253.172:3000/pengyue/jsh_erp into test 2 månader sedan
99 ändrade filer med 2738 tillägg och 1335 borttagningar
  1. 35 0
      docs/new_sql.sql
  2. BIN
      jshERP-web/public/doc/goods_template.xls
  3. 14 4
      jshERP-web/src/components/jeecg/JEditableTable.vue
  4. 2 2
      jshERP-web/src/components/jeecgbiz/modal/JSelectMaterialModal2.vue
  5. 3 0
      jshERP-web/src/components/menu/SideMenu.vue
  6. 3 0
      jshERP-web/src/mixins/JEditableTableMixin.js
  7. 3 1
      jshERP-web/src/views/bill/OtherInList.vue
  8. 3 1
      jshERP-web/src/views/bill/OtherOutList.vue
  9. 2 0
      jshERP-web/src/views/bill/PurchaseInList.vue
  10. 2 0
      jshERP-web/src/views/bill/SaleOutList.vue
  11. 456 5
      jshERP-web/src/views/bill/dialog/BillDetail.vue
  12. 4 19
      jshERP-web/src/views/bill/dialog/LinkBillList.vue
  13. 2 2
      jshERP-web/src/views/bill/mixins/BillListMixin.js
  14. 206 293
      jshERP-web/src/views/bill/mixins/BillModalMixin.js
  15. 1 1
      jshERP-web/src/views/bill/modules/AllocationOutModal.vue
  16. 1 1
      jshERP-web/src/views/bill/modules/AssembleModal.vue
  17. 1 1
      jshERP-web/src/views/bill/modules/DisassembleModal.vue
  18. 60 40
      jshERP-web/src/views/bill/modules/OtherInModal.vue
  19. 69 18
      jshERP-web/src/views/bill/modules/OtherOutModal.vue
  20. 1 1
      jshERP-web/src/views/bill/modules/PurchaseApplyModal.vue
  21. 1 1
      jshERP-web/src/views/bill/modules/PurchaseBackModal.vue
  22. 93 53
      jshERP-web/src/views/bill/modules/PurchaseInModal.vue
  23. 69 35
      jshERP-web/src/views/bill/modules/PurchaseOrderModal.vue
  24. 1 1
      jshERP-web/src/views/bill/modules/RetailBackModal.vue
  25. 1 1
      jshERP-web/src/views/bill/modules/RetailOutModal.vue
  26. 1 1
      jshERP-web/src/views/bill/modules/SaleBackModal.vue
  27. 62 12
      jshERP-web/src/views/bill/modules/SaleOrderModal.vue
  28. 80 19
      jshERP-web/src/views/bill/modules/SaleOutModal.vue
  29. 2 2
      jshERP-web/src/views/financial/AdvanceInList.vue
  30. 2 2
      jshERP-web/src/views/financial/GiroList.vue
  31. 2 2
      jshERP-web/src/views/financial/ItemInList.vue
  32. 2 2
      jshERP-web/src/views/financial/ItemOutList.vue
  33. 2 2
      jshERP-web/src/views/financial/MoneyInList.vue
  34. 2 2
      jshERP-web/src/views/financial/MoneyOutList.vue
  35. 2 2
      jshERP-web/src/views/financial/mixins/FinancialListMixin.js
  36. 6 2
      jshERP-web/src/views/material/MaterialCategoryList.vue
  37. 22 48
      jshERP-web/src/views/material/MaterialList.vue
  38. 83 315
      jshERP-web/src/views/material/modules/MaterialModal.vue
  39. 3 9
      jshERP-web/src/views/stock/CheckList.vue
  40. 3 2
      jshERP-web/src/views/stock/TaskList.vue
  41. 17 8
      jshERP-web/src/views/stock/components/checkModal.vue
  42. 3 3
      jshERP-web/src/views/stock/components/editForm.vue
  43. 20 7
      jshERP-web/src/views/stock/components/stockModal.vue
  44. 15 3
      jshERP-web/src/views/system/VendorList.vue
  45. 10 4
      jshERP-web/src/views/system/modules/CustomerModal.vue
  46. 22 14
      jshERP-web/src/views/system/modules/RolePushBtnModal.vue
  47. 39 35
      jshERP-web/src/views/system/modules/VendorModal.vue
  48. 126 0
      jshERP-web/src/views/task/ApprovalList.vue
  49. 115 0
      jshERP-web/src/views/task/FlowList.vue
  50. 146 0
      jshERP-web/src/views/task/HandledList.vue
  51. 141 0
      jshERP-web/src/views/task/InitiateList.vue
  52. 5 0
      src/main/java/com/jsh/erp/constants/BusinessConstants.java
  53. 21 11
      src/main/java/com/jsh/erp/constants/ExceptionConstants.java
  54. 2 0
      src/main/java/com/jsh/erp/controller/DepotItemController.java
  55. 8 26
      src/main/java/com/jsh/erp/controller/MaterialCategoryController.java
  56. 12 13
      src/main/java/com/jsh/erp/controller/MaterialController.java
  57. 14 11
      src/main/java/com/jsh/erp/controller/OrganizationController.java
  58. 4 4
      src/main/java/com/jsh/erp/controller/SupplierController.java
  59. 12 20
      src/main/java/com/jsh/erp/controller/pda/PdaController.java
  60. 65 0
      src/main/java/com/jsh/erp/datasource/dto/MaterialQueryDTO.java
  61. 40 0
      src/main/java/com/jsh/erp/datasource/entities/AuditProcess.java
  62. 5 0
      src/main/java/com/jsh/erp/datasource/entities/Depot.java
  63. 6 0
      src/main/java/com/jsh/erp/datasource/entities/DepotHead.java
  64. 6 0
      src/main/java/com/jsh/erp/datasource/entities/DepotItemVo4WithInfoEx.java
  65. 12 0
      src/main/java/com/jsh/erp/datasource/entities/Material.java
  66. 6 0
      src/main/java/com/jsh/erp/datasource/entities/MaterialBatch.java
  67. 15 0
      src/main/java/com/jsh/erp/datasource/entities/MaterialCategory.java
  68. 0 3
      src/main/java/com/jsh/erp/datasource/entities/MaterialVo4Unit.java
  69. 9 0
      src/main/java/com/jsh/erp/datasource/entities/Supplier.java
  70. 2 1
      src/main/java/com/jsh/erp/datasource/mappers/MaterialMapperEx.java
  71. 4 1
      src/main/java/com/jsh/erp/datasource/mappers/SequenceMapperEx.java
  72. 2 0
      src/main/java/com/jsh/erp/datasource/pda/dto/PDADepotHeadDTO.java
  73. 3 0
      src/main/java/com/jsh/erp/datasource/pda/dto/PDADepotMaterialDto.java
  74. 6 0
      src/main/java/com/jsh/erp/datasource/vo/DepotHeadVo4List.java
  75. 1 1
      src/main/java/com/jsh/erp/service/DepotItemService.java
  76. 25 5
      src/main/java/com/jsh/erp/service/MaterialCategoryService.java
  77. 7 2
      src/main/java/com/jsh/erp/service/MaterialService.java
  78. 8 81
      src/main/java/com/jsh/erp/service/SequenceService.java
  79. 8 2
      src/main/java/com/jsh/erp/service/SupplierService.java
  80. 27 5
      src/main/java/com/jsh/erp/service/impl/DepotHeadServiceImpl.java
  81. 10 8
      src/main/java/com/jsh/erp/service/impl/DepotItemServiceImpl.java
  82. 56 32
      src/main/java/com/jsh/erp/service/impl/MaterialBatchServiceImpl.java
  83. 11 6
      src/main/java/com/jsh/erp/service/impl/MaterialCategoryServiceImpl.java
  84. 0 1
      src/main/java/com/jsh/erp/service/impl/MaterialExtendServiceImpl.java
  85. 155 105
      src/main/java/com/jsh/erp/service/impl/MaterialServiceImpl.java
  86. 76 0
      src/main/java/com/jsh/erp/service/impl/SequenceServiceImpl.java
  87. 7 4
      src/main/java/com/jsh/erp/service/impl/SupplierServiceImpl.java
  88. 28 0
      src/main/java/com/jsh/erp/utils/TreeNodeUtils.java
  89. 18 3
      src/main/resources/mapper_xml/DepotHeadMapper.xml
  90. 1 1
      src/main/resources/mapper_xml/DepotItemMapper.xml
  91. 1 1
      src/main/resources/mapper_xml/DepotItemMapperEx.xml
  92. 7 1
      src/main/resources/mapper_xml/MaterialCategoryMapper.xml
  93. 3 1
      src/main/resources/mapper_xml/MaterialCategoryMapperEx.xml
  94. 1 1
      src/main/resources/mapper_xml/MaterialExtendMapper.xml
  95. 12 2
      src/main/resources/mapper_xml/MaterialMapper.xml
  96. 26 4
      src/main/resources/mapper_xml/MaterialMapperEx.xml
  97. 2 2
      src/main/resources/mapper_xml/SequenceMapperEx.xml
  98. 27 0
      src/main/resources/mapper_xml/SupplierMapper.xml
  99. 1 1
      src/main/resources/mapper_xml/TaskStocktakingItemMapper.xml

+ 35 - 0
docs/new_sql.sql

@@ -219,6 +219,41 @@ CREATE TABLE `material_batch` (
   PRIMARY KEY (`id`)
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='商品批次信息表';
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='商品批次信息表';
 
 
+-- 产品类型表 新增有效期阈值
+ALTER TABLE jsh_material_category
+  ADD COLUMN expiry_threshold INT DEFAULT NULL COMMENT '有效期阈值';
+
+-- 产品信息表  新增保质期天数,默认采购价,默认销售价
+ALTER TABLE jsh_material
+  ADD COLUMN expiry_num INT DEFAULT NULL COMMENT '保质期天数',
+  ADD COLUMN default_purchase_decimal DECIMAL(24,2) DEFAULT NULL COMMENT '默认采购价格',
+  ADD COLUMN default_wholesale_decimal DECIMAL(24,2) DEFAULT NULL COMMENT '默认销售价格',
+  ADD COLUMN reminder VARCHAR(255) DEFAULT NULL COMMENT '商品提醒';
+
+
+-- 供应商信息表  新增供应商编码,是否支持售后,售后规则
+ALTER TABLE jsh_supplier
+  ADD COLUMN serial_no VARCHAR(50) DEFAULT NULL COMMENT '供应商编码',
+  ADD COLUMN is_after_sales VARCHAR(1) DEFAULT NULL COMMENT '是否支持售后 (1是0否)',
+  ADD COLUMN after_sales_rules VARCHAR(1000) DEFAULT NULL COMMENT '售后规则';
+
+-- 单据主表 新增复核
+ALTER TABLE jsh_depot_head
+  ADD COLUMN auditor BIGINT DEFAULT NULL COMMENT '复核人员',
+  ADD COLUMN tax_rate DECIMAL(24,6) DEFAULT NULL COMMENT '税率';
+
+-- 商品批次 新增商品拓展id
+ALTER TABLE material_batch
+  ADD COLUMN material_extend_id BIGINT DEFAULT NULL COMMENT '商品拓展id';
+
+-- 2025-05-21 编号表添加供应商编号
+INSERT INTO `jsh_sequence` (`seq_name`, `min_value`, `max_value`, `current_val`, `increment_val`, `remark`) VALUES ('supplier_number_seq', '1', '999999999999999999', '1', '1', '供应商编号sequence');
+
+
+
+
+
+
 
 
 
 
 
 

BIN
jshERP-web/public/doc/goods_template.xls


+ 14 - 4
jshERP-web/src/components/jeecg/JEditableTable.vue

@@ -1629,6 +1629,14 @@ export default {
       })
       })
     },
     },
     /**
     /**
+     * @des 根据行id获取rows所在的索引
+     * @param id 行id
+     * @returns index 返回行所在的索引
+    */
+    getRowIndexByRowId(id){
+      return this.rows.findIndex(row => row.id === id)
+    },
+    /**
      * 在指定位置添加一行
      * 在指定位置添加一行
      * @param insertIndex 添加位置下标
      * @param insertIndex 添加位置下标
      * @param num 添加的行数,默认1
      * @param num 添加的行数,默认1
@@ -1648,13 +1656,14 @@ export default {
         this.recalcSortNumber()
         this.recalcSortNumber()
         this.forceUpdateFormValues()
         this.forceUpdateFormValues()
       })
       })
-      // 触发 insert 事件
-      this.$emit('inserted', {
-        rows: newRows.map((row) => {
+      const emitRows = newRows.map((row) => {
           let r = cloneObject(row)
           let r = cloneObject(row)
           r.id = this.getCleanId(r.id)
           r.id = this.getCleanId(r.id)
           return r
           return r
-        }),
+        })
+      // 触发 insert 事件
+      this.$emit('inserted', {
+        rows: emitRows,
         num,
         num,
         insertIndex,
         insertIndex,
         target: this,
         target: this,
@@ -1662,6 +1671,7 @@ export default {
       this.$nextTick(() => {
       this.$nextTick(() => {
         this.autoJumpNextInputBill()
         this.autoJumpNextInputBill()
       })
       })
+      return emitRows
     },
     },
     /** 删除被选中的行 */
     /** 删除被选中的行 */
     removeSelectedRows() {
     removeSelectedRows() {

+ 2 - 2
jshERP-web/src/components/jeecgbiz/modal/JSelectMaterialModal2.vue

@@ -1,13 +1,13 @@
 <template>
 <template>
   <a-modal
   <a-modal
-    :width="modalWidth"
+    width="100%"
     :visible="visible"
     :visible="visible"
     :title="title"
     :title="title"
     :wrapClassName="wrapClassNameInfo()"
     :wrapClassName="wrapClassNameInfo()"
     @ok="handleSubmit"
     @ok="handleSubmit"
     @cancel="close"
     @cancel="close"
     cancelText="关闭(ESC)"
     cancelText="关闭(ESC)"
-    style="top: 20px; height: 95%"
+    style="top: 0; height: 100%"
   >
   >
     <a-row :gutter="10" style="padding: 10px; margin: -10px">
     <a-row :gutter="10" style="padding: 10px; margin: -10px">
       <a-col :md="24" :sm="24">
       <a-col :md="24" :sm="24">

+ 3 - 0
jshERP-web/src/components/menu/SideMenu.vue

@@ -167,5 +167,8 @@ export default {
     }
     }
   }
   }
 }
 }
+.ant-menu-submenu-selected{
+  background-color: color(~`colorPalette("@{primary-color}", 3)`);
+}
 </style>
 </style>
 <!-- update_end author:sunjianlei date:20190530 for: 选中首页的时候不显示背景颜色 -->
 <!-- update_end author:sunjianlei date:20190530 for: 选中首页的时候不显示背景颜色 -->

+ 3 - 0
jshERP-web/src/mixins/JEditableTableMixin.js

@@ -77,6 +77,9 @@ export const JEditableTableMixin = {
       this.eachAllTable((item) => {
       this.eachAllTable((item) => {
         item.initialize()
         item.initialize()
       })
       })
+      if(this.materialTable && this.materialTable.dataSource) {
+        this.materialTable.dataSource = []
+      }
       this.$emit('close')
       this.$emit('close')
     },
     },
 
 

+ 3 - 1
jshERP-web/src/views/bill/OtherInList.vue

@@ -256,6 +256,7 @@ export default {
         'materialsList',
         'materialsList',
         'operTimeStr',
         'operTimeStr',
         'userName',
         'userName',
+        'auditorName',
         'materialCount',
         'materialCount',
         'totalPrice',
         'totalPrice',
         'status',
         'status',
@@ -283,6 +284,7 @@ export default {
         { title: '商品信息', dataIndex: 'materialsList', width: 220, ellipsis: true },
         { title: '商品信息', dataIndex: 'materialsList', width: 220, ellipsis: true },
         { title: '单据日期', dataIndex: 'operTimeStr', width: 145 },
         { title: '单据日期', dataIndex: 'operTimeStr', width: 145 },
         { title: '操作员', dataIndex: 'userName', width: 80, ellipsis: true },
         { title: '操作员', dataIndex: 'userName', width: 80, ellipsis: true },
+        { title: '复核人员', dataIndex: 'auditorName;', width: 80, ellipsis: true },
         { title: '数量', dataIndex: 'materialCount', width: 60 },
         { title: '数量', dataIndex: 'materialCount', width: 60 },
         { title: '金额合计', dataIndex: 'totalPrice', width: 80 },
         { title: '金额合计', dataIndex: 'totalPrice', width: 80 },
         { title: '备注', dataIndex: 'remark', width: 200 },
         { title: '备注', dataIndex: 'remark', width: 200 },
@@ -341,7 +343,7 @@ export default {
           }
           }
         })
         })
       } else {
       } else {
-        this.$message.warning('抱歉,只有未审核的单据才能删除,请先进行反审核!')
+        this.$message.warning('抱歉,只有未审核的单据才能删除!')
       }
       }
     },
     },
     batchDel: function () {
     batchDel: function () {

+ 3 - 1
jshERP-web/src/views/bill/OtherOutList.vue

@@ -256,6 +256,7 @@ export default {
         'materialsList',
         'materialsList',
         'operTimeStr',
         'operTimeStr',
         'userName',
         'userName',
+        'auditorName',
         'materialCount',
         'materialCount',
         'totalPrice',
         'totalPrice',
         'status',
         'status',
@@ -283,6 +284,7 @@ export default {
         { title: '商品信息', dataIndex: 'materialsList', width: 220, ellipsis: true },
         { title: '商品信息', dataIndex: 'materialsList', width: 220, ellipsis: true },
         { title: '单据日期', dataIndex: 'operTimeStr', width: 145 },
         { title: '单据日期', dataIndex: 'operTimeStr', width: 145 },
         { title: '操作员', dataIndex: 'userName', width: 80, ellipsis: true },
         { title: '操作员', dataIndex: 'userName', width: 80, ellipsis: true },
+        { title: '复核人员', dataIndex: 'auditorName;', width: 80, ellipsis: true },
         { title: '数量', dataIndex: 'materialCount', width: 60 },
         { title: '数量', dataIndex: 'materialCount', width: 60 },
         { title: '金额合计', dataIndex: 'totalPrice', width: 80 },
         { title: '金额合计', dataIndex: 'totalPrice', width: 80 },
         { title: '备注', dataIndex: 'remark', width: 200 },
         { title: '备注', dataIndex: 'remark', width: 200 },
@@ -341,7 +343,7 @@ export default {
           }
           }
         })
         })
       } else {
       } else {
-        this.$message.warning('抱歉,只有未审核的单据才能删除,请先进行反审核!')
+        this.$message.warning('抱歉,只有未审核的单据才能删除!')
       }
       }
     },
     },
     batchDel: function () {
     batchDel: function () {

+ 2 - 0
jshERP-web/src/views/bill/PurchaseInList.vue

@@ -291,6 +291,7 @@ export default {
         'materialsList',
         'materialsList',
         'operTimeStr',
         'operTimeStr',
         'userName',
         'userName',
+        'auditorName',
         'materialCount',
         'materialCount',
         'totalPrice',
         'totalPrice',
         'totalTaxLastMoney',
         'totalTaxLastMoney',
@@ -323,6 +324,7 @@ export default {
         { title: '商品信息', dataIndex: 'materialsList', width: 220, ellipsis: true },
         { title: '商品信息', dataIndex: 'materialsList', width: 220, ellipsis: true },
         { title: '单据日期', dataIndex: 'operTimeStr', width: 145 },
         { title: '单据日期', dataIndex: 'operTimeStr', width: 145 },
         { title: '操作员', dataIndex: 'userName', width: 80, ellipsis: true },
         { title: '操作员', dataIndex: 'userName', width: 80, ellipsis: true },
+        { title: '复核人员', dataIndex: 'auditorName;', width: 80, ellipsis: true },
         { title: '数量', dataIndex: 'materialCount', width: 60 },
         { title: '数量', dataIndex: 'materialCount', width: 60 },
         { title: '金额合计', dataIndex: 'totalPrice', width: 80 },
         { title: '金额合计', dataIndex: 'totalPrice', width: 80 },
         {
         {

+ 2 - 0
jshERP-web/src/views/bill/SaleOutList.vue

@@ -291,6 +291,7 @@ export default {
         'materialsList',
         'materialsList',
         'operTimeStr',
         'operTimeStr',
         'userName',
         'userName',
+        'auditorName',
         'materialCount',
         'materialCount',
         'totalPrice',
         'totalPrice',
         'totalTaxLastMoney',
         'totalTaxLastMoney',
@@ -323,6 +324,7 @@ export default {
         { title: '商品信息', dataIndex: 'materialsList', width: 220, ellipsis: true },
         { title: '商品信息', dataIndex: 'materialsList', width: 220, ellipsis: true },
         { title: '单据日期', dataIndex: 'operTimeStr', width: 145 },
         { title: '单据日期', dataIndex: 'operTimeStr', width: 145 },
         { title: '操作员', dataIndex: 'userName', width: 80, ellipsis: true },
         { title: '操作员', dataIndex: 'userName', width: 80, ellipsis: true },
+        { title: '复核人员', dataIndex: 'auditorName;', width: 80, ellipsis: true },
         { title: '数量', dataIndex: 'materialCount', width: 60 },
         { title: '数量', dataIndex: 'materialCount', width: 60 },
         { title: '金额合计', dataIndex: 'totalPrice', width: 80 },
         { title: '金额合计', dataIndex: 'totalPrice', width: 80 },
         {
         {

+ 456 - 5
jshERP-web/src/views/bill/dialog/BillDetail.vue

@@ -86,6 +86,31 @@
           <a-row class="form-row" :gutter="24">
           <a-row class="form-row" :gutter="24">
             <a-col :lg="18" :md="12" :sm="24">
             <a-col :lg="18" :md="12" :sm="24">
               <div :style="tableWidthRetail">
               <div :style="tableWidthRetail">
+                <div class="table-operator">
+                  <a-popover trigger="click" placement="right">
+                    <template slot="content">
+                      <a-checkbox-group @change="onColChange" v-model="settingDataIndex" :defaultValue="settingDataIndex">
+                        <a-row style="width: 500px">
+                          <template v-for="(item, index) in defColumns">
+                            <template>
+                              <a-col :span="8">
+                                <a-checkbox :value="item.dataIndex">
+                                  <j-ellipsis :value="item.title" :length="10"></j-ellipsis>
+                                </a-checkbox>
+                              </a-col>
+                            </template>
+                          </template>
+                        </a-row>
+                        <a-row style="padding-top: 10px">
+                          <a-col>
+                            恢复默认列配置:<a-button @click="handleRestDefault" type="link" size="small">恢复默认</a-button>
+                          </a-col>
+                        </a-row>
+                      </a-checkbox-group>
+                    </template>
+                    <a-button icon="setting">列设置</a-button>
+                  </a-popover>
+                </div>
                 <a-table
                 <a-table
                   ref="table"
                   ref="table"
                   size="middle"
                   size="middle"
@@ -195,6 +220,31 @@
           <a-row class="form-row" :gutter="24">
           <a-row class="form-row" :gutter="24">
             <a-col :lg="18" :md="12" :sm="24">
             <a-col :lg="18" :md="12" :sm="24">
               <div :style="tableWidthRetail">
               <div :style="tableWidthRetail">
+                <div class="table-operator">
+                  <a-popover trigger="click" placement="right">
+                    <template slot="content">
+                      <a-checkbox-group @change="onColChange" v-model="settingDataIndex" :defaultValue="settingDataIndex">
+                        <a-row style="width: 500px">
+                          <template v-for="(item, index) in defColumns">
+                            <template>
+                              <a-col :span="8">
+                                <a-checkbox :value="item.dataIndex">
+                                  <j-ellipsis :value="item.title" :length="10"></j-ellipsis>
+                                </a-checkbox>
+                              </a-col>
+                            </template>
+                          </template>
+                        </a-row>
+                        <a-row style="padding-top: 10px">
+                          <a-col>
+                            恢复默认列配置:<a-button @click="handleRestDefault" type="link" size="small">恢复默认</a-button>
+                          </a-col>
+                        </a-row>
+                      </a-checkbox-group>
+                    </template>
+                    <a-button icon="setting">列设置</a-button>
+                  </a-popover>
+                </div>
                 <a-table
                 <a-table
                   ref="table"
                   ref="table"
                   size="middle"
                   size="middle"
@@ -284,6 +334,31 @@
             <a-col :xl="6" :lg="8" :md="12" :sm="24"> </a-col>
             <a-col :xl="6" :lg="8" :md="12" :sm="24"> </a-col>
           </a-row>
           </a-row>
           <div :style="tableWidth">
           <div :style="tableWidth">
+            <div class="table-operator">
+              <a-popover trigger="click" placement="right">
+                <template slot="content">
+                  <a-checkbox-group @change="onColChange" v-model="settingDataIndex" :defaultValue="settingDataIndex">
+                    <a-row style="width: 500px">
+                      <template v-for="(item, index) in defColumns">
+                        <template>
+                          <a-col :span="8">
+                            <a-checkbox :value="item.dataIndex">
+                              <j-ellipsis :value="item.title" :length="10"></j-ellipsis>
+                            </a-checkbox>
+                          </a-col>
+                        </template>
+                      </template>
+                    </a-row>
+                    <a-row style="padding-top: 10px">
+                      <a-col>
+                        恢复默认列配置:<a-button @click="handleRestDefault" type="link" size="small">恢复默认</a-button>
+                      </a-col>
+                    </a-row>
+                  </a-checkbox-group>
+                </template>
+                <a-button icon="setting">列设置</a-button>
+              </a-popover>
+            </div>
             <a-table
             <a-table
               ref="table"
               ref="table"
               size="middle"
               size="middle"
@@ -363,6 +438,31 @@
             </a-col>
             </a-col>
           </a-row>
           </a-row>
           <div style="width: 100%">
           <div style="width: 100%">
+            <div class="table-operator">
+              <a-popover trigger="click" placement="right">
+                <template slot="content">
+                  <a-checkbox-group @change="onColChange" v-model="settingDataIndex" :defaultValue="settingDataIndex">
+                    <a-row style="width: 500px">
+                      <template v-for="(item, index) in defColumns">
+                        <template>
+                          <a-col :span="8">
+                            <a-checkbox :value="item.dataIndex">
+                              <j-ellipsis :value="item.title" :length="10"></j-ellipsis>
+                            </a-checkbox>
+                          </a-col>
+                        </template>
+                      </template>
+                    </a-row>
+                    <a-row style="padding-top: 10px">
+                      <a-col>
+                        恢复默认列配置:<a-button @click="handleRestDefault" type="link" size="small">恢复默认</a-button>
+                      </a-col>
+                    </a-row>
+                  </a-checkbox-group>
+                </template>
+                <a-button icon="setting">列设置</a-button>
+              </a-popover>
+            </div>
             <a-table
             <a-table
               ref="table"
               ref="table"
               size="middle"
               size="middle"
@@ -417,7 +517,7 @@
             </a-col>
             </a-col>
             <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-col :xl="6" :lg="8" :md="12" :sm="24">
               <a-form-item
               <a-form-item
-                :labelCol="{ xs: { span: 24 }, sm: { span: 6 } }"
+                :labelCol="labelCol"
                 :wrapperCol="wrapperCol"
                 :wrapperCol="wrapperCol"
                 label="优惠后金额"
                 label="优惠后金额"
               >
               >
@@ -470,6 +570,31 @@
             </a-col>
             </a-col>
           </a-row>
           </a-row>
           <div>
           <div>
+            <div class="table-operator">
+              <a-popover trigger="click" placement="right">
+                <template slot="content">
+                  <a-checkbox-group @change="onColChange" v-model="settingDataIndex" :defaultValue="settingDataIndex">
+                    <a-row style="width: 500px">
+                      <template v-for="(item, index) in defColumns">
+                        <template>
+                          <a-col :span="8">
+                            <a-checkbox :value="item.dataIndex">
+                              <j-ellipsis :value="item.title" :length="10"></j-ellipsis>
+                            </a-checkbox>
+                          </a-col>
+                        </template>
+                      </template>
+                    </a-row>
+                    <a-row style="padding-top: 10px">
+                      <a-col>
+                        恢复默认列配置:<a-button @click="handleRestDefault" type="link" size="small">恢复默认</a-button>
+                      </a-col>
+                    </a-row>
+                  </a-checkbox-group>
+                </template>
+                <a-button icon="setting">列设置</a-button>
+              </a-popover>
+            </div>
             <a-table
             <a-table
               ref="table"
               ref="table"
               size="middle"
               size="middle"
@@ -612,6 +737,31 @@
             </a-col>
             </a-col>
           </a-row>
           </a-row>
           <div :style="tableWidth">
           <div :style="tableWidth">
+            <div class="table-operator">
+              <a-popover trigger="click" placement="right">
+                <template slot="content">
+                  <a-checkbox-group @change="onColChange" v-model="settingDataIndex" :defaultValue="settingDataIndex">
+                    <a-row style="width: 500px">
+                      <template v-for="(item, index) in defColumns">
+                        <template>
+                          <a-col :span="8">
+                            <a-checkbox :value="item.dataIndex">
+                              <j-ellipsis :value="item.title" :length="10"></j-ellipsis>
+                            </a-checkbox>
+                          </a-col>
+                        </template>
+                      </template>
+                    </a-row>
+                    <a-row style="padding-top: 10px">
+                      <a-col>
+                        恢复默认列配置:<a-button @click="handleRestDefault" type="link" size="small">恢复默认</a-button>
+                      </a-col>
+                    </a-row>
+                  </a-checkbox-group>
+                </template>
+                <a-button icon="setting">列设置</a-button>
+              </a-popover>
+            </div>
             <a-table
             <a-table
               ref="table"
               ref="table"
               size="middle"
               size="middle"
@@ -726,6 +876,31 @@
             </a-col>
             </a-col>
           </a-row>
           </a-row>
           <div :style="tableWidth">
           <div :style="tableWidth">
+            <div class="table-operator">
+              <a-popover trigger="click" placement="right">
+                <template slot="content">
+                  <a-checkbox-group @change="onColChange" v-model="settingDataIndex" :defaultValue="settingDataIndex">
+                    <a-row style="width: 500px">
+                      <template v-for="(item, index) in defColumns">
+                        <template>
+                          <a-col :span="8">
+                            <a-checkbox :value="item.dataIndex">
+                              <j-ellipsis :value="item.title" :length="10"></j-ellipsis>
+                            </a-checkbox>
+                          </a-col>
+                        </template>
+                      </template>
+                    </a-row>
+                    <a-row style="padding-top: 10px">
+                      <a-col>
+                        恢复默认列配置:<a-button @click="handleRestDefault" type="link" size="small">恢复默认</a-button>
+                      </a-col>
+                    </a-row>
+                  </a-checkbox-group>
+                </template>
+                <a-button icon="setting">列设置</a-button>
+              </a-popover>
+            </div>
             <a-table
             <a-table
               ref="table"
               ref="table"
               size="middle"
               size="middle"
@@ -837,6 +1012,31 @@
             </a-col>
             </a-col>
           </a-row>
           </a-row>
           <div :style="tableWidth">
           <div :style="tableWidth">
+            <div class="table-operator">
+              <a-popover trigger="click" placement="right">
+                <template slot="content">
+                  <a-checkbox-group @change="onColChange" v-model="settingDataIndex" :defaultValue="settingDataIndex">
+                    <a-row style="width: 500px">
+                      <template v-for="(item, index) in defColumns">
+                        <template>
+                          <a-col :span="8">
+                            <a-checkbox :value="item.dataIndex">
+                              <j-ellipsis :value="item.title" :length="10"></j-ellipsis>
+                            </a-checkbox>
+                          </a-col>
+                        </template>
+                      </template>
+                    </a-row>
+                    <a-row style="padding-top: 10px">
+                      <a-col>
+                        恢复默认列配置:<a-button @click="handleRestDefault" type="link" size="small">恢复默认</a-button>
+                      </a-col>
+                    </a-row>
+                  </a-checkbox-group>
+                </template>
+                <a-button icon="setting">列设置</a-button>
+              </a-popover>
+            </div>
             <a-table
             <a-table
               ref="table"
               ref="table"
               size="middle"
               size="middle"
@@ -984,6 +1184,31 @@
             </a-col>
             </a-col>
           </a-row>
           </a-row>
           <div :style="tableWidth">
           <div :style="tableWidth">
+            <div class="table-operator">
+              <a-popover trigger="click" placement="right">
+                <template slot="content">
+                  <a-checkbox-group @change="onColChange" v-model="settingDataIndex" :defaultValue="settingDataIndex">
+                    <a-row style="width: 500px">
+                      <template v-for="(item, index) in defColumns">
+                        <template>
+                          <a-col :span="8">
+                            <a-checkbox :value="item.dataIndex">
+                              <j-ellipsis :value="item.title" :length="10"></j-ellipsis>
+                            </a-checkbox>
+                          </a-col>
+                        </template>
+                      </template>
+                    </a-row>
+                    <a-row style="padding-top: 10px">
+                      <a-col>
+                        恢复默认列配置:<a-button @click="handleRestDefault" type="link" size="small">恢复默认</a-button>
+                      </a-col>
+                    </a-row>
+                  </a-checkbox-group>
+                </template>
+                <a-button icon="setting">列设置</a-button>
+              </a-popover>
+            </div>
             <a-table
             <a-table
               ref="table"
               ref="table"
               size="middle"
               size="middle"
@@ -1105,6 +1330,31 @@
             </a-col>
             </a-col>
           </a-row>
           </a-row>
           <div :style="tableWidth">
           <div :style="tableWidth">
+            <div class="table-operator">
+              <a-popover trigger="click" placement="right">
+                <template slot="content">
+                  <a-checkbox-group @change="onColChange" v-model="settingDataIndex" :defaultValue="settingDataIndex">
+                    <a-row style="width: 500px">
+                      <template v-for="(item, index) in defColumns">
+                        <template>
+                          <a-col :span="8">
+                            <a-checkbox :value="item.dataIndex">
+                              <j-ellipsis :value="item.title" :length="10"></j-ellipsis>
+                            </a-checkbox>
+                          </a-col>
+                        </template>
+                      </template>
+                    </a-row>
+                    <a-row style="padding-top: 10px">
+                      <a-col>
+                        恢复默认列配置:<a-button @click="handleRestDefault" type="link" size="small">恢复默认</a-button>
+                      </a-col>
+                    </a-row>
+                  </a-checkbox-group>
+                </template>
+                <a-button icon="setting">列设置</a-button>
+              </a-popover>
+            </div>
             <a-table
             <a-table
               ref="table"
               ref="table"
               size="middle"
               size="middle"
@@ -1146,6 +1396,28 @@
               </a-form-item>
               </a-form-item>
             </a-col>
             </a-col>
           </a-row>
           </a-row>
+          <a-row class="form-row" :gutter="24">
+            <a-col :xl="6" :lg="8" :md="12" :sm="24">
+              <a-form-item
+                :labelCol="labelCol"
+                :wrapperCol="wrapperCol"
+                label="优惠后金额"
+              >
+                {{ model.discountLastMoney }}
+              </a-form-item>
+            </a-col>
+            <a-col :xl="6" :lg="8" :md="12" :sm="24">
+              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="支付订金">
+                {{ model.changeAmount }}
+              </a-form-item>
+            </a-col>
+            <a-col :xl="6" :lg="8" :md="12" :sm="24">
+              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="二维码">
+                <!-- <vue-qr :text="model.number" :size="200" /> -->
+                <vue-qrcode :value="model.number" :options="{ width: 200, margin:1 }"></vue-qrcode>
+              </a-form-item>
+            </a-col>
+          </a-row>
         </section>
         </section>
       </template>
       </template>
       <!--其它出库-->
       <!--其它出库-->
@@ -1178,6 +1450,31 @@
             </a-col>
             </a-col>
           </a-row>
           </a-row>
           <div :style="tableWidth">
           <div :style="tableWidth">
+            <div class="table-operator">
+              <a-popover trigger="click" placement="right">
+                <template slot="content">
+                  <a-checkbox-group @change="onColChange" v-model="settingDataIndex" :defaultValue="settingDataIndex">
+                    <a-row style="width: 500px">
+                      <template v-for="(item, index) in defColumns">
+                        <template>
+                          <a-col :span="8">
+                            <a-checkbox :value="item.dataIndex">
+                              <j-ellipsis :value="item.title" :length="10"></j-ellipsis>
+                            </a-checkbox>
+                          </a-col>
+                        </template>
+                      </template>
+                    </a-row>
+                    <a-row style="padding-top: 10px">
+                      <a-col>
+                        恢复默认列配置:<a-button @click="handleRestDefault" type="link" size="small">恢复默认</a-button>
+                      </a-col>
+                    </a-row>
+                  </a-checkbox-group>
+                </template>
+                <a-button icon="setting">列设置</a-button>
+              </a-popover>
+            </div>
             <a-table
             <a-table
               ref="table"
               ref="table"
               size="middle"
               size="middle"
@@ -1219,6 +1516,28 @@
               </a-form-item>
               </a-form-item>
             </a-col>
             </a-col>
           </a-row>
           </a-row>
+          <a-row class="form-row" :gutter="24">
+            <a-col :xl="6" :lg="8" :md="12" :sm="24">
+              <a-form-item
+                :labelCol="labelCol"
+                :wrapperCol="wrapperCol"
+                label="优惠后金额"
+              >
+                {{ model.discountLastMoney }}
+              </a-form-item>
+            </a-col>
+            <a-col :xl="6" :lg="8" :md="12" :sm="24">
+              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="支付订金">
+                {{ model.changeAmount }}
+              </a-form-item>
+            </a-col>
+            <a-col :xl="6" :lg="8" :md="12" :sm="24">
+              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="二维码">
+                <!-- <vue-qr :text="model.number" :size="200" /> -->
+                <vue-qrcode :value="model.number" :options="{ width: 200, margin:1 }"></vue-qrcode>
+              </a-form-item>
+            </a-col>
+          </a-row>
         </section>
         </section>
       </template>
       </template>
       <!--调拨出库-->
       <!--调拨出库-->
@@ -1239,6 +1558,31 @@
             <a-col :xl="6" :lg="8" :md="12" :sm="24"></a-col>
             <a-col :xl="6" :lg="8" :md="12" :sm="24"></a-col>
           </a-row>
           </a-row>
           <div :style="tableWidth">
           <div :style="tableWidth">
+            <div class="table-operator">
+              <a-popover trigger="click" placement="right">
+                <template slot="content">
+                  <a-checkbox-group @change="onColChange" v-model="settingDataIndex" :defaultValue="settingDataIndex">
+                    <a-row style="width: 500px">
+                      <template v-for="(item, index) in defColumns">
+                        <template>
+                          <a-col :span="8">
+                            <a-checkbox :value="item.dataIndex">
+                              <j-ellipsis :value="item.title" :length="10"></j-ellipsis>
+                            </a-checkbox>
+                          </a-col>
+                        </template>
+                      </template>
+                    </a-row>
+                    <a-row style="padding-top: 10px">
+                      <a-col>
+                        恢复默认列配置:<a-button @click="handleRestDefault" type="link" size="small">恢复默认</a-button>
+                      </a-col>
+                    </a-row>
+                  </a-checkbox-group>
+                </template>
+                <a-button icon="setting">列设置</a-button>
+              </a-popover>
+            </div>
             <a-table
             <a-table
               ref="table"
               ref="table"
               size="middle"
               size="middle"
@@ -1300,6 +1644,31 @@
             <a-col :xl="6" :lg="8" :md="12" :sm="24"></a-col>
             <a-col :xl="6" :lg="8" :md="12" :sm="24"></a-col>
           </a-row>
           </a-row>
           <div :style="tableWidth">
           <div :style="tableWidth">
+            <div class="table-operator">
+              <a-popover trigger="click" placement="right">
+                <template slot="content">
+                  <a-checkbox-group @change="onColChange" v-model="settingDataIndex" :defaultValue="settingDataIndex">
+                    <a-row style="width: 500px">
+                      <template v-for="(item, index) in defColumns">
+                        <template>
+                          <a-col :span="8">
+                            <a-checkbox :value="item.dataIndex">
+                              <j-ellipsis :value="item.title" :length="10"></j-ellipsis>
+                            </a-checkbox>
+                          </a-col>
+                        </template>
+                      </template>
+                    </a-row>
+                    <a-row style="padding-top: 10px">
+                      <a-col>
+                        恢复默认列配置:<a-button @click="handleRestDefault" type="link" size="small">恢复默认</a-button>
+                      </a-col>
+                    </a-row>
+                  </a-checkbox-group>
+                </template>
+                <a-button icon="setting">列设置</a-button>
+              </a-popover>
+            </div>
             <a-table
             <a-table
               ref="table"
               ref="table"
               size="middle"
               size="middle"
@@ -1361,6 +1730,31 @@
             <a-col :xl="6" :lg="8" :md="12" :sm="24"></a-col>
             <a-col :xl="6" :lg="8" :md="12" :sm="24"></a-col>
           </a-row>
           </a-row>
           <div :style="tableWidth">
           <div :style="tableWidth">
+            <div class="table-operator">
+              <a-popover trigger="click" placement="right">
+                <template slot="content">
+                  <a-checkbox-group @change="onColChange" v-model="settingDataIndex" :defaultValue="settingDataIndex">
+                    <a-row style="width: 500px">
+                      <template v-for="(item, index) in defColumns">
+                        <template>
+                          <a-col :span="8">
+                            <a-checkbox :value="item.dataIndex">
+                              <j-ellipsis :value="item.title" :length="10"></j-ellipsis>
+                            </a-checkbox>
+                          </a-col>
+                        </template>
+                      </template>
+                    </a-row>
+                    <a-row style="padding-top: 10px">
+                      <a-col>
+                        恢复默认列配置:<a-button @click="handleRestDefault" type="link" size="small">恢复默认</a-button>
+                      </a-col>
+                    </a-row>
+                  </a-checkbox-group>
+                </template>
+                <a-button icon="setting">列设置</a-button>
+              </a-popover>
+            </div>
             <a-table
             <a-table
               ref="table"
               ref="table"
               size="middle"
               size="middle"
@@ -1426,6 +1820,31 @@
             <a-col :xl="6" :lg="8" :md="12" :sm="24"></a-col>
             <a-col :xl="6" :lg="8" :md="12" :sm="24"></a-col>
           </a-row>
           </a-row>
           <div :style="tableWidth">
           <div :style="tableWidth">
+            <div class="table-operator">
+              <a-popover trigger="click" placement="right">
+                <template slot="content">
+                  <a-checkbox-group @change="onColChange" v-model="settingDataIndex" :defaultValue="settingDataIndex">
+                    <a-row style="width: 500px">
+                      <template v-for="(item, index) in defColumns">
+                        <template>
+                          <a-col :span="8">
+                            <a-checkbox :value="item.dataIndex">
+                              <j-ellipsis :value="item.title" :length="10"></j-ellipsis>
+                            </a-checkbox>
+                          </a-col>
+                        </template>
+                      </template>
+                    </a-row>
+                    <a-row style="padding-top: 10px">
+                      <a-col>
+                        恢复默认列配置:<a-button @click="handleRestDefault" type="link" size="small">恢复默认</a-button>
+                      </a-col>
+                    </a-row>
+                  </a-checkbox-group>
+                </template>
+                <a-button icon="setting">列设置</a-button>
+              </a-popover>
+            </div>
             <a-table
             <a-table
               ref="table"
               ref="table"
               size="middle"
               size="middle"
@@ -1516,6 +1935,7 @@ import { getMpListShort, getCheckFlag, exportXlsPost } from '@/utils/util'
 import BillPrintIframe from './BillPrintIframe'
 import BillPrintIframe from './BillPrintIframe'
 import FinancialDetail from '../../financial/dialog/FinancialDetail'
 import FinancialDetail from '../../financial/dialog/FinancialDetail'
 import JUpload from '@/components/jeecg/JUpload'
 import JUpload from '@/components/jeecg/JUpload'
+import JEllipsis from '@/components/jeecg/JEllipsis'
 import Vue from 'vue'
 import Vue from 'vue'
 // import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 // import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 // import QrcodeVue from 'qrcode.vue'
 // import QrcodeVue from 'qrcode.vue'
@@ -1529,6 +1949,7 @@ export default {
     FinancialDetail,
     FinancialDetail,
     JUpload,
     JUpload,
     VueQrcode,
     VueQrcode,
+    JEllipsis
     // VueQr,
     // VueQr,
   },
   },
   data() {
   data() {
@@ -1558,7 +1979,7 @@ export default {
       },
       },
       labelCol: {
       labelCol: {
         xs: { span: 24 },
         xs: { span: 24 },
-        sm: { span: 6 },
+        sm: { span: 8 },
       },
       },
       wrapperCol: {
       wrapperCol: {
         xs: { span: 24 },
         xs: { span: 24 },
@@ -1575,6 +1996,9 @@ export default {
       columns: [],
       columns: [],
       //列定义
       //列定义
       defColumns: [],
       defColumns: [],
+      // 实际索引
+      settingDataIndex: [],
+      prefixNo: '',
       retailOutColumns: [
       retailOutColumns: [
         { title: '仓库名称', dataIndex: 'depotName' },
         { title: '仓库名称', dataIndex: 'depotName' },
         { title: '条码', dataIndex: 'barCode' },
         { title: '条码', dataIndex: 'barCode' },
@@ -2097,7 +2521,6 @@ export default {
         for (let i = 0; i < this.defColumns.length; i++) {
         for (let i = 0; i < this.defColumns.length; i++) {
           currentCol.push(this.defColumns[i])
           currentCol.push(this.defColumns[i])
         }
         }
-        this.columns = currentCol
       } else if (record.purchaseStatus === '3') {
       } else if (record.purchaseStatus === '3') {
         //将已出库的标题转为已采购,针对销售订单转采购订单的场景
         //将已出库的标题转为已采购,针对销售订单转采购订单的场景
         for (let i = 0; i < this.defColumns.length; i++) {
         for (let i = 0; i < this.defColumns.length; i++) {
@@ -2115,7 +2538,6 @@ export default {
           }
           }
           currentCol.push(info)
           currentCol.push(info)
         }
         }
-        this.columns = currentCol
       } else {
       } else {
         for (let i = 0; i < this.defColumns.length; i++) {
         for (let i = 0; i < this.defColumns.length; i++) {
           //移除列
           //移除列
@@ -2153,8 +2575,10 @@ export default {
             currentCol.push(info)
             currentCol.push(info)
           }
           }
         }
         }
-        this.columns = currentCol
       }
       }
+      this.defColumns = currentCol
+      this.initColumnsSetting()
+      // this.columns = currentCol
     },
     },
     initPlatform() {
     initPlatform() {
       getPlatformConfigByKey({ platformKey: 'bill_print_flag' }).then((res) => {
       getPlatformConfigByKey({ platformKey: 'bill_print_flag' }).then((res) => {
@@ -2650,6 +3074,30 @@ export default {
         '单据日期:' + this.model.operTimeStr + ' ' + '单据编号:' + this.model.number + '' + '关联单号:' + linkNumber
         '单据日期:' + this.model.operTimeStr + ' ' + '单据编号:' + this.model.number + '' + '关联单号:' + linkNumber
       exportXlsPost(this.billType + '_' + this.model.number, '单据导出', head, tip, list)
       exportXlsPost(this.billType + '_' + this.model.number, '单据导出', head, tip, list)
     },
     },
+    initColumnsSetting() {
+      let columnsStr = Vue.ls.get(`${this.prefixNo}_XQ`)
+      if (columnsStr && columnsStr.indexOf(',') > -1) {
+        this.settingDataIndex = columnsStr.split(',')
+      } else {
+        this.settingDataIndex = this.defColumns.map(item => item.dataIndex)
+      }
+      this.columns = this.defColumns.filter((item) => {
+        return this.settingDataIndex.includes(item.dataIndex)
+      })
+    },
+    //恢复默认
+    handleRestDefault() {
+      Vue.ls.remove(`${this.prefixNo}_XQ`)
+      this.initColumnsSetting()
+    },
+    //列设置更改事件
+    onColChange(checkedValues) {
+      this.columns = this.defColumns.filter((item) => {
+        return checkedValues.includes(item.dataIndex)
+      })
+      let columnsStr = checkedValues.join()
+      Vue.ls.set(`${this.prefixNo}_XQ`, columnsStr)
+    },
   },
   },
 }
 }
 </script>
 </script>
@@ -2669,4 +3117,7 @@ export default {
   height: 100%;
   height: 100%;
   object-fit: cover;
   object-fit: cover;
 }
 }
+.table-operator {
+  margin-bottom: 18px;
+}
 </style>
 </style>

+ 4 - 19
jshERP-web/src/views/bill/dialog/LinkBillList.vue

@@ -153,7 +153,7 @@ export default {
       discountMoney: '',
       discountMoney: '',
       deposit: '',
       deposit: '',
       remark: '',
       remark: '',
-      defaultDepotId: '',
+      depotId: '',
       queryParam: {
       queryParam: {
         number: '',
         number: '',
         materialParam: '',
         materialParam: '',
@@ -304,12 +304,12 @@ export default {
     },
     },
     handleOk() {
     handleOk() {
       if (this.selectType === 'list') {
       if (this.selectType === 'list') {
-        this.getDepotByCurrentUser()
         this.getSelectBillRows()
         this.getSelectBillRows()
         this.selectType = 'detail'
         this.selectType = 'detail'
         this.title = '请选择单据明细'
         this.title = '请选择单据明细'
         if (this.selectBillRows && this.selectBillRows.length > 0) {
         if (this.selectBillRows && this.selectBillRows.length > 0) {
           let record = this.selectBillRows[0]
           let record = this.selectBillRows[0]
+          console.log('this.selectBillRows======', this.selectBillRows)
           this.linkNumber = record.number
           this.linkNumber = record.number
           this.organId = record.organId
           this.organId = record.organId
           this.accountId = record.accountId
           this.accountId = record.accountId
@@ -317,6 +317,7 @@ export default {
           this.discountMoney = record.discountMoney
           this.discountMoney = record.discountMoney
           this.deposit = record.changeAmount - record.finishDeposit
           this.deposit = record.changeAmount - record.finishDeposit
           this.remark = record.remark
           this.remark = record.remark
+          this.depotId = record.depotId
           this.initListColumns()
           this.initListColumns()
           this.loadDetailData(1)
           this.loadDetailData(1)
         }
         }
@@ -331,7 +332,7 @@ export default {
             this.discountMoney,
             this.discountMoney,
             this.deposit,
             this.deposit,
             this.remark,
             this.remark,
-            this.defaultDepotId,
+            this.depotId,
             this.accountId,
             this.accountId,
             this.salesMan
             this.salesMan
           )
           )
@@ -439,22 +440,6 @@ export default {
         }
         }
       }
       }
     },
     },
-    //加载默认仓库id
-    getDepotByCurrentUser() {
-      getAction('/depot/findDepotByCurrentUser').then((res) => {
-        if (res.code === 200) {
-          if (res.data.length === 1) {
-            this.defaultDepotId = res.data[0].id + ''
-          } else {
-            for (let i = 0; i < res.data.length; i++) {
-              if (res.data[i].isDefault) {
-                this.defaultDepotId = res.data[i].id + ''
-              }
-            }
-          }
-        }
-      })
-    },
     rowAction(record, index) {
     rowAction(record, index) {
       return {
       return {
         on: {
         on: {

+ 2 - 2
jshERP-web/src/views/bill/mixins/BillListMixin.js

@@ -100,14 +100,14 @@ export const BillListMixin = {
           }
           }
         })
         })
       } else {
       } else {
-        this.$message.warning('抱歉,只有未审核的单据才能编辑,请先进行反审核!')
+        this.$message.warning('抱歉,只有未审核的单据才能编辑!')
       }
       }
     },
     },
     myHandleDelete(record) {
     myHandleDelete(record) {
       if (record.status === '0') {
       if (record.status === '0') {
         this.handleDelete(record.id)
         this.handleDelete(record.id)
       } else {
       } else {
-        this.$message.warning('抱歉,只有未审核的单据才能删除,请先进行反审核!')
+        this.$message.warning('抱歉,只有未审核的单据才能删除!')
       }
       }
     },
     },
     myHandleDetail(record, type, prefixNo) {
     myHandleDetail(record, type, prefixNo) {

+ 206 - 293
jshERP-web/src/views/bill/mixins/BillModalMixin.js

@@ -33,7 +33,6 @@ export const BillModalMixin = {
         options: [],
         options: [],
         value: '',
         value: '',
       },
       },
-      currentSelectDepotId: '',
       depotList: [],
       depotList: [],
       accountList: [],
       accountList: [],
       accountIdList: [],
       accountIdList: [],
@@ -286,6 +285,13 @@ export const BillModalMixin = {
       getAction('/depot/findDepotByCurrentUser').then((res) => {
       getAction('/depot/findDepotByCurrentUser').then((res) => {
         if (res.code === 200) {
         if (res.code === 200) {
           let arr = res.data
           let arr = res.data
+          this.depotList = res.data.map(item => {
+            return {
+              ...item,
+              value: item.id,
+              label: item.depotName,
+            }
+          })
           for (let item of that.materialTable.columns) {
           for (let item of that.materialTable.columns) {
             if (item.key == 'depotId' || item.key == 'anotherDepotId') {
             if (item.key == 'depotId' || item.key == 'anotherDepotId') {
               item.options = []
               item.options = []
@@ -395,46 +401,47 @@ export const BillModalMixin = {
         .then((allValues) => {
         .then((allValues) => {
           //获取单据明细列表信息
           //获取单据明细列表信息
           let detailArr = allValues.tablesValue[0].values
           let detailArr = allValues.tablesValue[0].values
-          let batchNumbers = ''
-          for (let detail of detailArr) {
-            batchNumbers += detail.batchNumber + ','
-          }
-          if (batchNumbers) {
-            batchNumbers = batchNumbers.substring(0, batchNumbers.length - 1)
-          }
-          let param = {
-            batchNumber: batchNumbers,
-            organId: this.form.getFieldValue('organId'),
-            depotId: depotId,
-            mpList: getMpListShort(Vue.ls.get('materialPropertyList')), //扩展属性
-            prefixNo: this.prefixNo,
-          }
-          getMaterialByBatchNumber(param).then((res) => {
-            if (res && res.code === 200) {
-              let mList = res.data
-              //构造新的列表数组,用于存放单据明细信息
-              let newDetailArr = []
-              if (mList && mList.length) {
-                for (let i = 0; i < detailArr.length; i++) {
-                  let item = detailArr[i]
-                  item.depotId = depotId
-                  for (let j = 0; j < mList.length; j++) {
-                    if (mList[j].batchNumber === item.batchNumber) {
-                      item.stock = mList[j].stock
-                    }
-                  }
-                  newDetailArr.push(item)
-                }
-              } else {
-                for (let i = 0; i < detailArr.length; i++) {
-                  let item = detailArr[i]
-                  item.depotId = depotId
-                  newDetailArr.push(item)
-                }
-              }
-              this.materialTable.dataSource = newDetailArr
-            }
-          })
+          console.log('detailArr=======',detailArr)
+          // let batchNumbers = ''
+          // for (let detail of detailArr) {
+          //   batchNumbers += detail.batchNumber + ','
+          // }
+          // if (batchNumbers) {
+          //   batchNumbers = batchNumbers.substring(0, batchNumbers.length - 1)
+          // }
+          // let param = {
+          //   batchNumber: batchNumbers,
+          //   organId: this.form.getFieldValue('organId'),
+          //   depotId: depotId,
+          //   mpList: getMpListShort(Vue.ls.get('materialPropertyList')), //扩展属性
+          //   prefixNo: this.prefixNo,
+          // }
+          // getMaterialByBatchNumber(param).then((res) => {
+          //   if (res && res.code === 200) {
+          //     let mList = res.data
+          //     //构造新的列表数组,用于存放单据明细信息
+          //     let newDetailArr = []
+          //     if (mList && mList.length) {
+          //       for (let i = 0; i < detailArr.length; i++) {
+          //         let item = detailArr[i]
+          //         item.depotId = depotId
+          //         for (let j = 0; j < mList.length; j++) {
+          //           if (mList[j].batchNumber === item.batchNumber) {
+          //             item.stock = mList[j].stock
+          //           }
+          //         }
+          //         newDetailArr.push(item)
+          //       }
+          //     } else {
+          //       for (let i = 0; i < detailArr.length; i++) {
+          //         let item = detailArr[i]
+          //         item.depotId = depotId
+          //         newDetailArr.push(item)
+          //       }
+          //     }
+          //     this.materialTable.dataSource = newDetailArr
+          //   }
+          // })
         })
         })
     },
     },
     depotModalFormOk() {
     depotModalFormOk() {
@@ -454,37 +461,91 @@ export const BillModalMixin = {
       setTimeout(function () {
       setTimeout(function () {
         that.$refs.materialDataTable.resetScrollTop((target.rows.length + 1) * that.$refs.materialDataTable.rowHeight)
         that.$refs.materialDataTable.resetScrollTop((target.rows.length + 1) * that.$refs.materialDataTable.rowHeight)
       }, 1000)
       }, 1000)
-      // if (this.currentSelectDepotId) {
-      //   //如果单据选择过仓库,则直接从当前选择的仓库加载
-      //   target.setValues([{ rowKey: row.id, values: { depotId: this.currentSelectDepotId } }])
-      // } else {
-      //   getAction('/depot/findDepotByCurrentUser').then((res) => {
-      //     if (res.code === 200) {
-      //       let arr = res.data
-      //       if (arr.length === 1) {
-      //         target.setValues([{ rowKey: row.id, values: { depotId: arr[0].id + '' } }])
-      //       } else {
-      //         for (let i = 0; i < arr.length; i++) {
-      //           if (arr[i].isDefault) {
-      //             target.setValues([{ rowKey: row.id, values: { depotId: arr[i].id + '' } }])
-      //           }
-      //         }
-      //       }
-      //     }
-      //   })
-      // }
     },
     },
     //根据仓库名、商品条码带出对应的仓位货架、库存数量
     //根据仓库名、商品条码带出对应的仓位货架、库存数量
-    async setProPosition(barCode, depotId, event){
-      const { row, column, value, target } = event
-      findStockByDepotAndBarCode({ depotId: depotId, barCode: barCode }).then(res => {
-        const {position='',stock} = res.data
-        target.setValues([
-          {
+    // async setProPosition(barCode, depotId, event){
+    //   const { row, column, value, target } = event
+    //   findStockByDepotAndBarCode({ depotId: depotId, barCode: barCode }).then(res => {
+    //     const {position='',stock} = res.data
+    //     target.setValues([
+    //       {
+    //         rowKey: row.id,
+    //         values: { position:position,inventory: stock },
+    //       },
+    //     ])
+    //     target.$forceUpdate()
+    //   })
+    // },
+    // 选择供应商、客户带出税率
+    getTatRate(id){
+      getAction('/supplier/info', { id }).then((res) => {
+        if (res && res.code === 200) {
+          let info = res.data.info
+          const taxRate = info.taxRate?(info.taxRate - 0) : 0
+          this.form.setFieldsValue({
+            taxRate
+          })
+          const target = this.$refs[this.refKeys[0]]
+          if(target){
+            this.autoCalcPrice(target,taxRate)
+          }
+        }
+      })
+    },
+    // 自动计算表格价格
+    autoCalcPrice(editTableVm,taxRate){
+      const that = this
+      editTableVm.getValues((error, values) => {
+        const updateRows = []
+        console.log('9999999------',values)
+        for(let row of values){
+          const allPrice =  row.allPrice - 0
+          const taxMoney = (taxRate * 0.01 * allPrice).toFixed(2) - 0
+          const taxLastMoney = (allPrice + taxMoney).toFixed(2) - 0
+          updateRows.push({
             rowKey: row.id,
             rowKey: row.id,
-            values: { position:position,inventory: stock,stock: stock },
-          },
-        ])
+            values: { taxRate, taxMoney: taxMoney, taxLastMoney: taxLastMoney },
+          })
+        }
+        editTableVm.setValues(updateRows)
+        editTableVm.recalcAllStatisticsColumns()
+        that.autoChangePrice(editTableVm)
+        editTableVm.$forceUpdate()
+      })
+    },
+    //默认采购价、销售价与当前采购价、销售价不一致
+    getDefaultWholesaleDecimal(index,key,value,allValues){
+      const obj = allValues.inputValues[index]
+      if(obj&&obj[key]){
+        return obj[key] != value
+      }
+      return false
+    },
+    onChangePrice(e,callback){
+      const { value } = e.target;
+      callback(value)
+    },
+    // 仓库名移动到基础表单
+    async changeDepot(depotId,editTableRefName){
+      const target = this.$refs[`${editTableRefName}`]
+      if(!target){
+        return
+      }
+      target.getValues(async (error, values) => {
+        const rows = values
+        const updateRows = []
+        for (let row of rows) {
+          const barCode = row.barCode
+          if(depotId&&barCode){
+            const res = await findStockByDepotAndBarCode({ depotId: depotId, barCode: barCode })
+            const {position='',stock=0} = res.data
+            updateRows.push({
+              rowKey: row.id,
+              values: { position:position,inventory: stock, stock,depotId },
+            })
+          }
+        }
+        target.setValues(updateRows)
         target.$forceUpdate()
         target.$forceUpdate()
       })
       })
     },
     },
@@ -494,96 +555,13 @@ export const BillModalMixin = {
       const { type, row, column, value, target } = event
       const { type, row, column, value, target } = event
       let param, snList, batchNumber, operNumber, unitPrice, allPrice, taxRate, taxMoney, taxLastMoney
       let param, snList, batchNumber, operNumber, unitPrice, allPrice, taxRate, taxMoney, taxLastMoney
       switch (column.key) {
       switch (column.key) {
-        case 'depotId':
-          that.currentSelectDepotId = row.depotId
-          console.log('row========', row)
-          // // 选择商品自动带出barCode、商品ID
-          if(row.depotId&&row.barCode&&type=='select'){
-            // // 根据仓库id自动带出仓位货架(若有)参数:商品id、仓库id
-            this.setProPosition(row.barCode, row.depotId, event)
-          }
-          break
-        // case 'batchNumber':
-        //   param = {
-        //     batchNumber: value,
-        //     organId: this.form.getFieldValue('organId'),
-        //     mpList: getMpListShort(Vue.ls.get('materialPropertyList')), //扩展属性
-        //     prefixNo: this.prefixNo,
+        // case 'depotId':
+        //   console.log('row========', row)
+        //   // // 选择商品自动带出barCode、商品ID
+        //   if(row.depotId&&row.barCode&&type=='select'){
+        //     // // 根据仓库id自动带出仓位货架(若有)参数:商品id、仓库id
+        //     this.setProPosition(row.barCode, row.depotId, event)
         //   }
         //   }
-        //   getMaterialByBatchNumber(param).then((res) => {
-        //     if (res && res.code === 200) {
-        //       let mList = res.data
-
-        //       if (value.indexOf(',') > -1) {
-        //         //多个条码
-        //         this.$refs.materialDataTable.getValues((error, values) => {
-        //           values.pop() //移除最后一行数据
-        //           let mArr = values
-        //           for (let i = 0; i < mList.length; i++) {
-        //             let mInfo = mList[i]
-        //             if (mInfo.unitId) {
-        //               mInfo.unitList = JSON.stringify(mInfo.unitList)
-        //             }
-        //             this.changeColumnShow(mInfo)
-        //             let mObj = this.parseInfoToObj(mInfo)
-        //             mObj.depotId = mInfo.depotId
-        //             mObj.stock = mInfo.stock
-        //             mObj.inventory = mInfo.inventory
-        //             mArr.push(mObj)
-        //           }
-        //           let allPriceTotal = 0
-        //           let taxLastMoneyTotal = 0
-        //           for (let j = 0; j < mArr.length; j++) {
-        //             allPriceTotal += mArr[j].allPrice - 0
-        //             taxLastMoneyTotal += mArr[j].taxLastMoney - 0
-        //             //组合和拆分单据给商品类型进行重新赋值
-        //             if (j === 0) {
-        //               mArr[0].mType = '组合件'
-        //             } else {
-        //               mArr[j].mType = '普通子件'
-        //             }
-        //           }
-
-        //           this.materialTable.dataSource = mArr
-        //           if (this.prefixNo === 'LSCK' || this.prefixNo === 'LSTH') {
-        //             target.statisticsColumns.allPrice = allPriceTotal
-        //           } else {
-        //             target.statisticsColumns.taxLastMoney = taxLastMoneyTotal
-        //           }
-        //           that.autoChangePrice(target)
-        //           //强制渲染
-        //           target.$forceUpdate()
-        //         })
-        //       } else {
-        //         //单个条码
-        //         let depotIdSelected = row.depotId || ''
-        //         // findStockByDepotAndBarCode({ depotId: depotIdSelected, barCode: row.batchNumber }).then((res) => {
-        //         //   if (res && res.code === 200) {
-        //         //     let mArr = []
-        //         //     let mInfo = mList[0]
-        //         //     if (mInfo.unitId) {
-        //         //       mInfo.unitList = JSON.stringify(mInfo.unitList)
-        //         //     }
-        //         //     this.changeColumnShow(mInfo)
-        //         //     let mInfoEx = this.parseInfoToObj(mInfo)
-        //         //     mInfoEx.stock = res.data.stock
-        //         //     mInfoEx.inventory = mInfo.inventory
-        //         //     let mObj = {
-        //         //       rowKey: row.id,
-        //         //       values: mInfoEx,
-        //         //     }
-        //         //     mArr.push(mObj)
-        //         //     target.setValues(mArr)
-        //         //     target.recalcAllStatisticsColumns()
-        //         //     that.autoChangePrice(target)
-        //         //     target.autoSelectBySpecialKey('operNumber', row.orderNum)
-        //         //     //强制渲染
-        //         //     target.$forceUpdate()
-        //         //   }
-        //         // })
-        //       }
-        //     }
-        //   })
         //   break
         //   break
         case 'barCode':
         case 'barCode':
           param = {
           param = {
@@ -592,57 +570,37 @@ export const BillModalMixin = {
             mpList: getMpListShort(Vue.ls.get('materialPropertyList')), //扩展属性
             mpList: getMpListShort(Vue.ls.get('materialPropertyList')), //扩展属性
             prefixNo: this.prefixNo,
             prefixNo: this.prefixNo,
           }
           }
-          getMaterialByBarCode(param).then((res) => {
+          const formDepotId = that.form.getFieldValue('depotId')
+          const formTaxRate = that.form.getFieldValue('taxRate')
+          getMaterialByBarCode(param).then(async (res) => {
             if (res && res.code === 200) {
             if (res && res.code === 200) {
               let mList = res.data
               let mList = res.data
-              console.log('mList======',mList)
-              target.getValues(async (error, values) => {
-                const clickRowIndex = values.findIndex((item) => item.id === row.id) //获取当前行的索引
-                // values.pop() //移除最后一行数据
-                values.splice(clickRowIndex, 1) //移除当前行数据
-                let mArr = values // 新加的行
-                for (let i = 0; i < mList.length; i++) {
-                  let mInfo = mList[i]
-                  if (mInfo.unitId) {
-                    mInfo.unitList = JSON.stringify(mInfo.unitList)
-                  }
-                  this.changeColumnShow(mInfo)
-                  let mObj = this.parseInfoToObj(mInfo)
-                  mObj.depotId = mInfo.depotId
-                  const res = await findStockByDepotAndBarCode({ depotId: mInfo.depotId, barCode: mObj.barCode })
-                  const {position,stock} = res.data
+              let mArr = await target.getValuesPromise(false)
+              const clickRowIndex = mArr.findIndex(item => item.id === row.id)
+              for(let i = 0; i < mList.length; i++){
+                const rawInfo = mList[i]
+                const mObj = that.parseInfoToObj(rawInfo)
+                mObj.allPrice = ((mObj.unitPrice - 0)* (mObj.operNumber))
+                mObj.taxRate = formTaxRate || 0
+                mObj.taxMoney = (mObj.taxRate * 0.01 * mObj.allPrice).toFixed(2) - 0
+                mObj.taxLastMoney = (mObj.allPrice + mObj.taxMoney)
+                mObj.depotId = formDepotId
+                mObj.position = ''
+                if(formDepotId){
+                  const res = await findStockByDepotAndBarCode({ depotId: formDepotId, barCode: mObj.barCode })
+                  const {position='',stock=0} = res.data
                   mObj.stock = stock
                   mObj.stock = stock
-                  console.log('stock===',stock)
-                  console.log('position===',position)
+                  mObj.inventory = stock
                   mObj.position = position
                   mObj.position = position
-                  mObj.inventory = mInfo.inventory
-                  const unitPrice = (mObj.unitPrice||0)- 0
-                  mObj.allPrice = (unitPrice * mObj.operNumber).toFixed(2)
-                  // mObj.taxLastMoney = mInfo.taxLastMoney||0
-                  mArr.push(mObj)
-                }
-                let allPriceTotal = 0
-                let taxLastMoneyTotal = 0
-                for (let j = 0; j < mArr.length; j++) {
-                  allPriceTotal += mArr[j].allPrice - 0
-                  taxLastMoneyTotal += mArr[j].taxLastMoney- 0
-                  //组合和拆分单据给商品类型进行重新赋值
-                  if (j === 0) {
-                    mArr[0].mType = '组合件'
-                  } else {
-                    mArr[j].mType = '普通子件'
-                  }
                 }
                 }
-                console.log('mArr--------',mArr)
-                this.materialTable.dataSource = mArr
-                if (this.prefixNo === 'LSCK' || this.prefixNo === 'LSTH') {
-                  target.statisticsColumns.allPrice = allPriceTotal
-                } else {
-                  target.statisticsColumns.taxLastMoney = taxLastMoneyTotal
-                }
-                that.autoChangePrice(target)
-                //强制渲染
-                target.$forceUpdate()
+                mArr.splice(clickRowIndex,0,mObj)
+              }
+              this.materialTable.dataSource = mArr.filter(item => item.id !== row.id)
+              target.$nextTick(() => {
+                target.recalcAllStatisticsColumns()
+                setTimeout(() => {
+                  that.autoChangePrice(target)
+                },100)
               })
               })
             }
             }
           })
           })
@@ -668,51 +626,6 @@ export const BillModalMixin = {
             that.autoChangePrice(target)
             that.autoChangePrice(target)
           }
           }
           break
           break
-        // case 'batchNumber':
-        //   console.log('====================adasdas', column)
-        //   batchNumber = value
-        //   let depotItemId = ''
-        //   if (this.model.id) {
-        //     //只有在保存之后的编辑页面下才获取明细id
-        //     let rowId = row.id
-        //     if (rowId.length <= 19) {
-        //       depotItemId = rowId - 0
-        //     }
-        //   }
-        //   getBatchNumberList({
-        //     name: '',
-        //     depotItemId: depotItemId,
-        //     depotId: row.depotId,
-        //     barCode: row.barCode,
-        //     batchNumber: batchNumber,
-        //   }).then((res) => {
-        //     if (res && res.code === 200) {
-        //       if (res.data && res.data.rows) {
-        //         let info = res.data.rows[0]
-        //         operNumber = info.totalNum
-        //         taxRate = row.taxRate - 0 //税率
-        //         unitPrice = row.unitPrice - 0 //单价
-        //         allPrice = (unitPrice * operNumber).toFixed(2) - 0
-        //         taxMoney = (taxRate * 0.01 * allPrice).toFixed(2) - 0
-        //         taxLastMoney = (allPrice + taxMoney).toFixed(2) - 0
-        //         target.setValues([
-        //           {
-        //             rowKey: row.id,
-        //             values: {
-        //               expirationDate: info.expirationDateStr,
-        //               operNumber: operNumber,
-        //               allPrice: allPrice,
-        //               taxMoney: taxMoney,
-        //               taxLastMoney: taxLastMoney,
-        //             },
-        //           },
-        //         ])
-        //         target.recalcAllStatisticsColumns()
-        //         that.autoChangePrice(target)
-        //       }
-        //     }
-        //   })
-        //   break
         case 'operNumber':
         case 'operNumber':
           operNumber = value - 0
           operNumber = value - 0
           taxRate = row.taxRate - 0 //税率
           taxRate = row.taxRate - 0 //税率
@@ -752,37 +665,38 @@ export const BillModalMixin = {
           target.recalcAllStatisticsColumns()
           target.recalcAllStatisticsColumns()
           that.autoChangePrice(target)
           that.autoChangePrice(target)
           break
           break
-        case 'taxRate':
-          operNumber = row.operNumber - 0 //数量
-          allPrice = row.allPrice - 0
-          unitPrice = row.unitPrice - 0
-          taxRate = value - 0 //税率
-          taxMoney = (taxRate * 0.01 * allPrice).toFixed(2) - 0
-          taxLastMoney = (allPrice + taxMoney).toFixed(2) - 0
-          target.setValues([{ rowKey: row.id, values: { taxMoney: taxMoney, taxLastMoney: taxLastMoney } }])
-          target.recalcAllStatisticsColumns()
-          that.autoChangePrice(target)
-          break
-        case 'taxLastMoney':
-          operNumber = row.operNumber - 0 //数量
-          taxLastMoney = value - 0
-          taxRate = row.taxRate - 0 //税率
-          if (taxRate) {
-            unitPrice = (taxLastMoney / operNumber / (1 + taxRate * 0.01)).toFixed(2) - 0
-            allPrice = (unitPrice * operNumber).toFixed(2) - 0
-            taxMoney = (taxLastMoney - allPrice).toFixed(2) - 0
-          } else {
-            //税率为0的情况,特殊处理
-            allPrice = taxLastMoney
-            unitPrice = (allPrice / operNumber).toFixed(2) - 0 //单价
-            taxMoney = 0
-          }
-          target.setValues([
-            { rowKey: row.id, values: { unitPrice: unitPrice, allPrice: allPrice, taxMoney: taxMoney } },
-          ])
-          target.recalcAllStatisticsColumns()
-          that.autoChangePrice(target)
-          break
+        // case 'taxRate':
+        //   operNumber = row.operNumber - 0 //数量
+        //   allPrice = row.allPrice - 0
+        //   unitPrice = row.unitPrice - 0
+        //   taxRate = value - 0 //税率
+        //   taxMoney = (taxRate * 0.01 * allPrice).toFixed(2) - 0
+        //   taxLastMoney = (allPrice + taxMoney).toFixed(2) - 0
+        //   target.setValues([{ rowKey: row.id, values: { taxMoney: taxMoney, taxLastMoney: taxLastMoney } }])
+        //   target.recalcAllStatisticsColumns()
+        //   that.autoChangePrice(target)
+        //   break
+        // case 'taxLastMoney':
+        //   console.log('taxLastMoney---------')
+        //   operNumber = row.operNumber - 0 //数量
+        //   taxLastMoney = value - 0
+        //   taxRate = row.taxRate - 0 //税率
+        //   if (taxRate) {
+        //     unitPrice = (taxLastMoney / operNumber / (1 + taxRate * 0.01)).toFixed(2) - 0
+        //     allPrice = (unitPrice * operNumber).toFixed(2) - 0
+        //     taxMoney = (taxLastMoney - allPrice).toFixed(2) - 0
+        //   } else {
+        //     //税率为0的情况,特殊处理
+        //     allPrice = taxLastMoney
+        //     unitPrice = (allPrice / operNumber).toFixed(2) - 0 //单价
+        //     taxMoney = 0
+        //   }
+        //   target.setValues([
+        //     { rowKey: row.id, values: { unitPrice: unitPrice, allPrice: allPrice, taxMoney: taxMoney } },
+        //   ])
+        //   target.recalcAllStatisticsColumns()
+        //   that.autoChangePrice(target)
+        //   break
         case 'unit':
         case 'unit':
           // row.actualQuantityInStorage=
           // row.actualQuantityInStorage=
           if (row.unitId) {
           if (row.unitId) {
@@ -804,22 +718,19 @@ export const BillModalMixin = {
     parseInfoToObj(mInfo) {
     parseInfoToObj(mInfo) {
       return {
       return {
         barCode: mInfo.barCode,
         barCode: mInfo.barCode,
-        batchNumber: mInfo.batchNumber,
         name: mInfo.name,
         name: mInfo.name,
         standard: mInfo.standard,
         standard: mInfo.standard,
         model: mInfo.model,
         model: mInfo.model,
         color: mInfo.color,
         color: mInfo.color,
         brand: mInfo.brand,
         brand: mInfo.brand,
-        mfrs: mInfo.mfrs,
         materialOther: mInfo.materialOther,
         materialOther: mInfo.materialOther,
         unit: mInfo.commodityUnit,
         unit: mInfo.commodityUnit,
         sku: mInfo.sku,
         sku: mInfo.sku,
         operNumber: 1,
         operNumber: 1,
-        unitPrice: mInfo.billPrice,
-        allPrice: mInfo.billPrice,
-        taxRate: 0,
-        taxMoney: 0,
-        taxLastMoney: mInfo.billPrice,
+        unitPrice: mInfo.billPrice * (mInfo.ratio||1), //单价
+        wholesaleDecimal:mInfo.defaultWholesaleDecimal, //销售价
+        defaultWholesaleDecimal: mInfo.defaultWholesaleDecimal, //默认销售价 不展示
+        defaultPurchaseDecimal: mInfo.defaultPurchaseDecimal, //默认采购价 不展示
 
 
         productionDate: mInfo.productionDate,
         productionDate: mInfo.productionDate,
         expiryNum: mInfo.expiryNum,
         expiryNum: mInfo.expiryNum,
@@ -833,6 +744,7 @@ export const BillModalMixin = {
         unitList: mInfo.unitList,
         unitList: mInfo.unitList,
         depotId: mInfo.depotId,
         depotId: mInfo.depotId,
         inventory: mInfo.inventory,
         inventory: mInfo.inventory,
+        ratio: mInfo.ratio,
       }
       }
     },
     },
     //使得型号、颜色、扩展信息、sku等为隐藏
     //使得型号、颜色、扩展信息、sku等为隐藏
@@ -898,10 +810,10 @@ export const BillModalMixin = {
     },
     },
     //改变优惠、本次付款、欠款的值
     //改变优惠、本次付款、欠款的值
     autoChangePrice(target) {
     autoChangePrice(target) {
-      let allTaxLastMoney = target.statisticsColumns.taxLastMoney - 0
-      let discount = this.form.getFieldValue('discount') - 0
+      let allTaxLastMoney = target.getStatisticsValue('taxLastMoney')||0
+      let discount = this.form.getFieldValue('discount') ? this.form.getFieldValue('discount') - 0 : 0
       let otherMoney = this.form.getFieldValue('otherMoney') ? this.form.getFieldValue('otherMoney') - 0 : 0
       let otherMoney = this.form.getFieldValue('otherMoney') ? this.form.getFieldValue('otherMoney') - 0 : 0
-      let deposit = this.form.getFieldValue('deposit')
+      let deposit = this.form.getFieldValue('deposit') ? this.form.getFieldValue('deposit') - 0 : 0
       let discountMoney = (discount * 0.01 * allTaxLastMoney).toFixed(2) - 0
       let discountMoney = (discount * 0.01 * allTaxLastMoney).toFixed(2) - 0
       let discountLastMoney = (allTaxLastMoney - discountMoney).toFixed(2) - 0
       let discountLastMoney = (allTaxLastMoney - discountMoney).toFixed(2) - 0
       let changeAmountNew = (discountLastMoney + otherMoney).toFixed(2) - 0
       let changeAmountNew = (discountLastMoney + otherMoney).toFixed(2) - 0
@@ -915,7 +827,7 @@ export const BillModalMixin = {
           discountMoney: discountMoney,
           discountMoney: discountMoney,
           discountLastMoney: discountLastMoney,
           discountLastMoney: discountLastMoney,
           changeAmount: changeAmountNew,
           changeAmount: changeAmountNew,
-          debt: 0,
+          debt: (discountLastMoney + (otherMoney || 0) - deposit - changeAmountNew).toFixed(2),
         })
         })
       })
       })
     },
     },
@@ -924,7 +836,7 @@ export const BillModalMixin = {
       const value = e.target.value - 0
       const value = e.target.value - 0
       let otherMoney = this.form.getFieldValue('otherMoney') ? this.form.getFieldValue('otherMoney') - 0 : 0
       let otherMoney = this.form.getFieldValue('otherMoney') ? this.form.getFieldValue('otherMoney') - 0 : 0
       let deposit = this.form.getFieldValue('deposit')
       let deposit = this.form.getFieldValue('deposit')
-      let allTaxLastMoney = this.$refs.materialDataTable.statisticsColumns.taxLastMoney - 0
+      let allTaxLastMoney = this.$refs.materialDataTable.getStatisticsValue('taxLastMoney') - 0
       let discountMoneyNew = (allTaxLastMoney * value * 0.01).toFixed(2) - 0
       let discountMoneyNew = (allTaxLastMoney * value * 0.01).toFixed(2) - 0
       let discountLastMoneyNew = (allTaxLastMoney - discountMoneyNew).toFixed(2) - 0
       let discountLastMoneyNew = (allTaxLastMoney - discountMoneyNew).toFixed(2) - 0
       let changeAmountNew = (discountLastMoneyNew + otherMoney).toFixed(2) - 0
       let changeAmountNew = (discountLastMoneyNew + otherMoney).toFixed(2) - 0
@@ -946,7 +858,7 @@ export const BillModalMixin = {
       const value = e.target.value - 0
       const value = e.target.value - 0
       let otherMoney = this.form.getFieldValue('otherMoney') ? this.form.getFieldValue('otherMoney') - 0 : 0
       let otherMoney = this.form.getFieldValue('otherMoney') ? this.form.getFieldValue('otherMoney') - 0 : 0
       let deposit = this.form.getFieldValue('deposit')
       let deposit = this.form.getFieldValue('deposit')
-      let allTaxLastMoney = this.$refs.materialDataTable.statisticsColumns.taxLastMoney - 0
+      let allTaxLastMoney = this.$refs.materialDataTable.getStatisticsValue('taxLastMoney') - 0
       let discountNew = ((value / allTaxLastMoney) * 100).toFixed(2) - 0
       let discountNew = ((value / allTaxLastMoney) * 100).toFixed(2) - 0
       let discountLastMoneyNew = (allTaxLastMoney - value).toFixed(2) - 0
       let discountLastMoneyNew = (allTaxLastMoney - value).toFixed(2) - 0
       let changeAmountNew = (discountLastMoneyNew + otherMoney).toFixed(2) - 0
       let changeAmountNew = (discountLastMoneyNew + otherMoney).toFixed(2) - 0
@@ -1011,6 +923,7 @@ export const BillModalMixin = {
           return getListData(this.form, tables)
           return getListData(this.form, tables)
         })
         })
         .then((allValues) => {
         .then((allValues) => {
+          console.log(1233444,allValues)
           let detailArr = allValues.tablesValue[0].values
           let detailArr = allValues.tablesValue[0].values
           let batchNumberStr = ''
           let batchNumberStr = ''
           for (let detail of detailArr) {
           for (let detail of detailArr) {

+ 1 - 1
jshERP-web/src/views/bill/modules/AllocationOutModal.vue

@@ -308,7 +308,7 @@ export default {
     //调用完edit()方法之后会自动调用此方法
     //调用完edit()方法之后会自动调用此方法
     editAfter() {
     editAfter() {
       this.billStatus = '0'
       this.billStatus = '0'
-      this.currentSelectDepotId = ''
+      
       this.changeColumnHide()
       this.changeColumnHide()
       this.changeFormTypes(this.materialTable.columns, 'snList', 0)
       this.changeFormTypes(this.materialTable.columns, 'snList', 0)
       // this.changeFormTypes(this.materialTable.columns, 'batchNumber', 0)
       // this.changeFormTypes(this.materialTable.columns, 'batchNumber', 0)

+ 1 - 1
jshERP-web/src/views/bill/modules/AssembleModal.vue

@@ -222,7 +222,7 @@ export default {
     //调用完edit()方法之后会自动调用此方法
     //调用完edit()方法之后会自动调用此方法
     editAfter() {
     editAfter() {
       this.billStatus = '0'
       this.billStatus = '0'
-      this.currentSelectDepotId = ''
+      
       this.changeColumnHide()
       this.changeColumnHide()
       if (this.action === 'add') {
       if (this.action === 'add') {
         this.addInit(this.prefixNo)
         this.addInit(this.prefixNo)

+ 1 - 1
jshERP-web/src/views/bill/modules/DisassembleModal.vue

@@ -222,7 +222,7 @@ export default {
     //调用完edit()方法之后会自动调用此方法
     //调用完edit()方法之后会自动调用此方法
     editAfter() {
     editAfter() {
       this.billStatus = '0'
       this.billStatus = '0'
-      this.currentSelectDepotId = ''
+      
       this.changeColumnHide()
       this.changeColumnHide()
       if (this.action === 'add') {
       if (this.action === 'add') {
         this.addInit(this.prefixNo)
         this.addInit(this.prefixNo)

+ 60 - 40
jshERP-web/src/views/bill/modules/OtherInModal.vue

@@ -33,6 +33,7 @@
                 :dropdownMatchSelectWidth="false"
                 :dropdownMatchSelectWidth="false"
                 showSearch
                 showSearch
                 optionFilterProp="children"
                 optionFilterProp="children"
+                @change="getTatRate"
               >
               >
                 <div slot="dropdownRender" slot-scope="menu">
                 <div slot="dropdownRender" slot-scope="menu">
                   <v-nodes :vnodes="menu" />
                   <v-nodes :vnodes="menu" />
@@ -64,6 +65,28 @@
           </a-col>
           </a-col>
           <a-col :lg="6" :md="12" :sm="24">
           <a-col :lg="6" :md="12" :sm="24">
             <a-form-item
             <a-form-item
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              label="仓库名"
+            >
+              <a-select v-decorator="['depotId',validatorRules.depotId]" placeholder="请选择仓库名" @change="changeDepot($event,refKeys[0])">
+                <a-select-option v-for="(item, index) in depotList" :key="index" :value="item.id">
+                  {{ item.depotName }}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :lg="6" :md="12" :sm="24">
+            <a-form-item
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              label="税率"
+            >
+              <a-input placeholder="自动带出" disabled v-decorator="['taxRate']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="6" :md="12" :sm="24">
+            <a-form-item
               v-if="inOutManageFlag && !model.billType"
               v-if="inOutManageFlag && !model.billType"
               :labelCol="labelCol"
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
               :wrapperCol="wrapperCol"
@@ -123,15 +146,31 @@
               <a-button icon="import" @click="onImport(prefixNo)">导入明细</a-button>
               <a-button icon="import" @click="onImport(prefixNo)">导入明细</a-button>
             </a-row>
             </a-row>
           </template>
           </template>
-          <template #depotBatchSet>
-            <a-icon type="down" @click="handleBatchSetDepot" />
+          <template #depotId="{ value }">
+            <a-select
+              disabled
+              :value="value"
+              :options="depotList"
+            >
+            </a-select>
           </template>
           </template>
-          <template #depotAdd>
-            <a-divider v-if="quickBtn.depot" style="margin: 4px 0" />
-            <div v-if="quickBtn.depot" style="padding: 4px 8px; cursor: pointer" @click="addDepot">
-              <a-icon type="plus" /> 新增仓库
-            </div>
+          <template #wholesaleDecimal="{ handleChange, value, index,allValues }">
+            <a-input :value="value" @change="($event) => onChangePrice($event,handleChange)">
+              <a-tooltip slot="suffix" title="修改后和默认价格不一致">
+                <a-icon type="info-circle" style="color: #f5222d" v-show="getDefaultWholesaleDecimal(index,'defaultWholesaleDecimal',value,allValues)" />
+              </a-tooltip>
+            </a-input>
           </template>
           </template>
+          <template #unitPrice="{ handleChange, value, index,allValues }">
+            <a-input :value="value" @change="($event) => onChangePrice($event,handleChange)">
+              <a-tooltip slot="suffix" title="修改后和默认价格不一致">
+                <a-icon type="info-circle" style="color: #f5222d" v-show="getDefaultWholesaleDecimal(index,'defaultPurchaseDecimal',value,allValues)" />
+              </a-tooltip>
+            </a-input>
+          </template>
+          <!-- <template #depotBatchSet>
+            <a-icon type="down" @click="handleBatchSetDepot" />
+          </template> -->
           <template #unit="{ handleChange, handleFocus, value }">
           <template #unit="{ handleChange, handleFocus, value }">
             <a-select
             <a-select
               placeholder="请选择"
               placeholder="请选择"
@@ -270,18 +309,6 @@ export default {
         loading: false,
         loading: false,
         dataSource: [],
         dataSource: [],
         columns: [
         columns: [
-          // {
-          //   title: '仓库名称',
-          //   key: 'depotId',
-          //   width: '8%',
-          //   type: FormTypes.select,
-          //   placeholder: '请选择${title}',
-          //   options: [],
-          //   allowSearch: true,
-          //   disabled: true,
-          //   validateRules: [{ required: true, message: '${title}不能为空' }],
-          // },
-          // { title: '批次号', key: 'batchNumber', width: '9%', type: FormTypes.normal },
           {
           {
             title: '商品条码',
             title: '商品条码',
             key: 'barCode',
             key: 'barCode',
@@ -292,8 +319,6 @@ export default {
             validateRules: [{ required: true, message: '${title}不能为空' }],
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
           },
           { title: '名称', key: 'name', width: '120px', type: FormTypes.normal },
           { title: '名称', key: 'name', width: '120px', type: FormTypes.normal },
-          // { title: '规格', key: 'standard', width: '9%', type: FormTypes.normal },
-
           {
           {
             title: '生产日期',
             title: '生产日期',
             key: 'productionDate',
             key: 'productionDate',
@@ -301,9 +326,8 @@ export default {
             type: FormTypes.datetime,
             type: FormTypes.datetime,
             validateRules: [{ required: true, message: '${title}不能为空' }],
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
           },
-          { title: '保质期', key: 'expiryNum', width: '120px', type: FormTypes.inputNumber },
-          // { title: '商品条码', key: 'barCode', width: '9%', type: FormTypes.normal },
-          { title: '仓库名', key: 'depotId', width: '120px', type: FormTypes.select,validateRules: [{ required: true, message: '${title}不能为空' }], },
+          { title: '保质期', key: 'expiryNum', width: '120px', type: FormTypes.normal },
+          { title: '仓库名', key: 'depotId', width: '120px', type: FormTypes.slot},
           { title: '仓库货架', key: 'position', width: '120px', type: FormTypes.input },
           { title: '仓库货架', key: 'position', width: '120px', type: FormTypes.input },
           { title: '包装规格', key: 'unitName', width: '120px', type: FormTypes.normal },
           { title: '包装规格', key: 'unitName', width: '120px', type: FormTypes.normal },
 
 
@@ -318,16 +342,13 @@ export default {
             key: 'unit',
             key: 'unit',
             width: '120px',
             width: '120px',
             type: FormTypes.normal,
             type: FormTypes.normal,
-            // options: [],
-            // allowClear: false,
-            // slotName: 'unit',
           },
           },
           {
           {
             title: '销售价',
             title: '销售价',
             key: 'wholesaleDecimal',
             key: 'wholesaleDecimal',
             width: '120px',
             width: '120px',
-            type: FormTypes.input,
-            validateRules: [{ required: true, message: '${title}不能为空' }],
+            type: FormTypes.slot,
+            validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' }],
           },
           },
           { title: '单位id', key: 'unitId', width: '120px', type: FormTypes.hidden },
           { title: '单位id', key: 'unitId', width: '120px', type: FormTypes.hidden },
           { title: '单位列表', key: 'unitList', width: '120px', type: FormTypes.hidden },
           { title: '单位列表', key: 'unitList', width: '120px', type: FormTypes.hidden },
@@ -344,15 +365,8 @@ export default {
             statistics: true,
             statistics: true,
             validateRules: [{ required: true, message: '${title}不能为空' }],
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
           },
-          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.inputNumber,validateRules: [{ required: true, message: '${title}不能为空' }], },
-          { title: '金额', key: 'allPrice', width: '120px', type: FormTypes.inputNumber, statistics: true },
-          // {
-          //   title: '实际入库数量',
-          //   key: 'actualQuantityInStorage',
-          //   width: '120px',
-          //   type: FormTypes.inputNumber,
-          //   validateRules: [{ required: true, message: '实际入库数量不能为空' }],
-          // },
+          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.slot,validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' }], },
+          { title: '金额', key: 'allPrice', width: '120px', type: FormTypes.inputNumber,readonly: true, statistics: true },
           { title: '入库差异', key: 'warehousingVariance', width: '120px', type: FormTypes.input },
           { title: '入库差异', key: 'warehousingVariance', width: '120px', type: FormTypes.input },
           { title: '入库差异原因', key: 'reasonOfDifference', width: '120px', type: FormTypes.input },
           { title: '入库差异原因', key: 'reasonOfDifference', width: '120px', type: FormTypes.input },
           {
           {
@@ -366,6 +380,8 @@ export default {
           { title: '入库时间', key: 'warehousingTime', width: '200px', type: FormTypes.date },
           { title: '入库时间', key: 'warehousingTime', width: '200px', type: FormTypes.date },
           { title: '备注', key: 'remark', width: '200px', type: FormTypes.input },
           { title: '备注', key: 'remark', width: '200px', type: FormTypes.input },
           { title: '关联id', key: 'linkId', width: '120px', type: FormTypes.hidden },
           { title: '关联id', key: 'linkId', width: '120px', type: FormTypes.hidden },
+          { title: '默认销售价', key: 'defaultWholesaleDecimal', width: '120px', type: FormTypes.hidden },
+          { title: '默认采购价', key: 'defaultPurchaseDecimal', width: '120px', type: FormTypes.hidden },
         ],
         ],
       },
       },
       confirmLoading: false,
       confirmLoading: false,
@@ -379,6 +395,9 @@ export default {
         type: {
         type: {
           rules: [{ required: true, message: '请选择类型!' }],
           rules: [{ required: true, message: '请选择类型!' }],
         },
         },
+        depotId: {
+          rules: [{ required: true, message: '请选择仓库名!' }],
+        },
       },
       },
       url: {
       url: {
         add: '/depotHead/addDepotHeadAndDetail',
         add: '/depotHead/addDepotHeadAndDetail',
@@ -393,7 +412,6 @@ export default {
     //调用完edit()方法之后会自动调用此方法
     //调用完edit()方法之后会自动调用此方法
     editAfter() {
     editAfter() {
       this.billStatus = '0'
       this.billStatus = '0'
-      this.currentSelectDepotId = ''
       this.rowCanEdit = true
       this.rowCanEdit = true
       this.materialTable.columns[0].type = FormTypes.popupJsh
       this.materialTable.columns[0].type = FormTypes.popupJsh
       this.changeColumnHide()
       this.changeColumnHide()
@@ -429,7 +447,9 @@ export default {
               'discountLastMoney',
               'discountLastMoney',
               'otherMoney',
               'otherMoney',
               'accountId',
               'accountId',
-              'changeAmount'
+              'changeAmount',
+              'depotId',
+              'taxRate'
             )
             )
           )
           )
         })
         })

+ 69 - 18
jshERP-web/src/views/bill/modules/OtherOutModal.vue

@@ -33,7 +33,7 @@
                 :dropdownMatchSelectWidth="false"
                 :dropdownMatchSelectWidth="false"
                 showSearch
                 showSearch
                 optionFilterProp="children"
                 optionFilterProp="children"
-                @change="handleOrganChange"
+                @change="getTatRate"
               >
               >
                 <div slot="dropdownRender" slot-scope="menu">
                 <div slot="dropdownRender" slot-scope="menu">
                   <v-nodes :vnodes="menu" />
                   <v-nodes :vnodes="menu" />
@@ -65,6 +65,28 @@
           </a-col>
           </a-col>
           <a-col :lg="6" :md="12" :sm="24">
           <a-col :lg="6" :md="12" :sm="24">
             <a-form-item
             <a-form-item
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              label="仓库名"
+            >
+              <a-select v-decorator="['depotId',validatorRules.depotId]" placeholder="请选择仓库名" @change="changeDepot($event,refKeys[0])">
+                <a-select-option v-for="(item, index) in depotList" :key="index" :value="item.id">
+                  {{ item.depotName }}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :lg="6" :md="12" :sm="24">
+            <a-form-item
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              label="税率"
+            >
+              <a-input placeholder="自动带出" disabled v-decorator="['taxRate']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="6" :md="12" :sm="24">
+            <a-form-item
               v-if="inOutManageFlag && !model.billType"
               v-if="inOutManageFlag && !model.billType"
               :labelCol="labelCol"
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
               :wrapperCol="wrapperCol"
@@ -124,15 +146,37 @@
               <a-button icon="import" @click="onImport(prefixNo)">导入明细</a-button>
               <a-button icon="import" @click="onImport(prefixNo)">导入明细</a-button>
             </a-row>
             </a-row>
           </template>
           </template>
-          <template #depotBatchSet>
-            <a-icon type="down" @click="handleBatchSetDepot" />
+          <template #depotId="{ value }">
+            <a-select
+              disabled
+              :value="value"
+              :options="depotList"
+            >
+            </a-select>
+          </template>
+          <template #wholesaleDecimal="{ handleChange, value, index,allValues }">
+            <a-input :value="value" @change="($event) => onChangePrice($event,handleChange)">
+              <a-tooltip slot="suffix" title="修改后和默认价格不一致">
+                <a-icon type="info-circle" style="color: #f5222d" v-show="getDefaultWholesaleDecimal(index,'defaultWholesaleDecimal',value,allValues)" />
+              </a-tooltip>
+            </a-input>
           </template>
           </template>
-          <template #depotAdd>
+          <template #unitPrice="{ handleChange, value, index,allValues }">
+            <a-input :value="value" @change="($event) => onChangePrice($event,handleChange)">
+              <a-tooltip slot="suffix" title="修改后和默认价格不一致">
+                <a-icon type="info-circle" style="color: #f5222d" v-show="getDefaultWholesaleDecimal(index,'defaultWholesaleDecimal',value,allValues)" />
+              </a-tooltip>
+            </a-input>
+          </template>
+          <!-- <template #depotBatchSet>
+            <a-icon type="down" @click="handleBatchSetDepot" />
+          </template> -->
+          <!-- <template #depotAdd>
             <a-divider v-if="quickBtn.depot" style="margin: 4px 0" />
             <a-divider v-if="quickBtn.depot" style="margin: 4px 0" />
             <div v-if="quickBtn.depot" style="padding: 4px 8px; cursor: pointer" @click="addDepot">
             <div v-if="quickBtn.depot" style="padding: 4px 8px; cursor: pointer" @click="addDepot">
               <a-icon type="plus" /> 新增仓库
               <a-icon type="plus" /> 新增仓库
             </div>
             </div>
-          </template>
+          </template> -->
           <template #unit="{ handleChange, handleFocus, value }">
           <template #unit="{ handleChange, handleFocus, value }">
             <a-select
             <a-select
               placeholder="请选择"
               placeholder="请选择"
@@ -298,7 +342,7 @@ export default {
           // { title: '生产日期', key: 'productionDate', width: '200px', type: FormTypes.normal, disabled: true },
           // { title: '生产日期', key: 'productionDate', width: '200px', type: FormTypes.normal, disabled: true },
           // { title: '保质期', key: 'expiryNum', width: '120px', type: FormTypes.normal },
           // { title: '保质期', key: 'expiryNum', width: '120px', type: FormTypes.normal },
           // { title: '商品条码', key: 'barCode', width: '9%', type: FormTypes.normal },
           // { title: '商品条码', key: 'barCode', width: '9%', type: FormTypes.normal },
-          { title: '仓库名', key: 'depotId', width: '120px', type: FormTypes.select,validateRules: [{ required: true, message: '${title}不能为空' }], },
+          { title: '仓库名', key: 'depotId', width: '120px', type: FormTypes.slot,validateRules: [{ required: true, message: '${title}不能为空' }], },
           { title: '仓库货架', key: 'position', width: '120px', type: FormTypes.input },
           { title: '仓库货架', key: 'position', width: '120px', type: FormTypes.input },
           { title: '包装规格', key: 'unitName', width: '120px', type: FormTypes.normal },
           { title: '包装规格', key: 'unitName', width: '120px', type: FormTypes.normal },
 
 
@@ -317,7 +361,7 @@ export default {
             // allowClear: false,
             // allowClear: false,
             // slotName: 'unit',
             // slotName: 'unit',
           },
           },
-          { title: '销售价', key: 'wholesaleDecimal', width: '120px', type: FormTypes.input },
+          { title: '销售价', key: 'wholesaleDecimal', width: '120px', type: FormTypes.slot,validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' }] },
           { title: '单位id', key: 'unitId', width: '120px', type: FormTypes.hidden },
           { title: '单位id', key: 'unitId', width: '120px', type: FormTypes.hidden },
           { title: '单位列表', key: 'unitList', width: '120px', type: FormTypes.hidden },
           { title: '单位列表', key: 'unitList', width: '120px', type: FormTypes.hidden },
           { title: '序列号', key: 'snList', width: '120px', type: FormTypes.popupJsh, kind: 'sn', multi: true },
           { title: '序列号', key: 'snList', width: '120px', type: FormTypes.popupJsh, kind: 'sn', multi: true },
@@ -333,15 +377,15 @@ export default {
             statistics: true,
             statistics: true,
             validateRules: [{ required: true, message: '${title}不能为空' }],
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
           },
-          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.inputNumber,validateRules: [{ required: true, message: '${title}不能为空' }], },
-          { title: '金额', key: 'allPrice', width: '120px', type: FormTypes.inputNumber, statistics: true },
-          {
-            title: '实际出库数量',
-            key: 'actualQuantityInStorage',
-            width: '120px',
-            type: FormTypes.inputNumber,
-            validateRules: [{ required: true, message: '实际入库数量不能为空' }],
-          },
+          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.slot,validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' }], },
+          { title: '金额', key: 'allPrice', width: '120px', type: FormTypes.inputNumber, readonly: true, statistics: true },
+          // {
+          //   title: '实际出库数量',
+          //   key: 'actualQuantityInStorage',
+          //   width: '120px',
+          //   type: FormTypes.inputNumber,
+          //   validateRules: [{ required: true, message: '实际入库数量不能为空' }],
+          // },
           { title: '出库差异', key: 'warehousingVariance', width: '120px', type: FormTypes.inputNumber },
           { title: '出库差异', key: 'warehousingVariance', width: '120px', type: FormTypes.inputNumber },
           { title: '出库差异原因', key: 'reasonOfDifference', width: '120px', type: FormTypes.input },
           { title: '出库差异原因', key: 'reasonOfDifference', width: '120px', type: FormTypes.input },
           {
           {
@@ -355,6 +399,8 @@ export default {
           { title: '出库时间', key: 'warehousingTime', width: '200px', type: FormTypes.date },
           { title: '出库时间', key: 'warehousingTime', width: '200px', type: FormTypes.date },
           { title: '备注', key: 'remark', width: '120px', type: FormTypes.input },
           { title: '备注', key: 'remark', width: '120px', type: FormTypes.input },
           { title: '关联id', key: 'linkId', width: '120px', type: FormTypes.hidden },
           { title: '关联id', key: 'linkId', width: '120px', type: FormTypes.hidden },
+          { title: '默认销售价', key: 'defaultWholesaleDecimal', width: '120px', type: FormTypes.hidden },
+          { title: '默认采购价', key: 'defaultPurchaseDecimal', width: '120px', type: FormTypes.hidden },
         ],
         ],
       },
       },
       confirmLoading: false,
       confirmLoading: false,
@@ -368,6 +414,9 @@ export default {
         type: {
         type: {
           rules: [{ required: true, message: '请选择类型!' }],
           rules: [{ required: true, message: '请选择类型!' }],
         },
         },
+        depotId: {
+          rules: [{ required: true, message: '请选择仓库名!' }],
+        },
       },
       },
       url: {
       url: {
         add: '/depotHead/addDepotHeadAndDetail',
         add: '/depotHead/addDepotHeadAndDetail',
@@ -382,7 +431,7 @@ export default {
     //调用完edit()方法之后会自动调用此方法
     //调用完edit()方法之后会自动调用此方法
     editAfter() {
     editAfter() {
       this.billStatus = '0'
       this.billStatus = '0'
-      this.currentSelectDepotId = ''
+      
       this.rowCanEdit = true
       this.rowCanEdit = true
       this.materialTable.columns[0].type = FormTypes.popupJsh
       this.materialTable.columns[0].type = FormTypes.popupJsh
       this.changeColumnHide()
       this.changeColumnHide()
@@ -417,7 +466,9 @@ export default {
               'discountLastMoney',
               'discountLastMoney',
               'otherMoney',
               'otherMoney',
               'accountId',
               'accountId',
-              'changeAmount'
+              'changeAmount',
+              'depotId',
+              'taxRate'
             )
             )
           )
           )
         })
         })

+ 1 - 1
jshERP-web/src/views/bill/modules/PurchaseApplyModal.vue

@@ -238,7 +238,7 @@ export default {
     //调用完edit()方法之后会自动调用此方法
     //调用完edit()方法之后会自动调用此方法
     editAfter() {
     editAfter() {
       this.billStatus = '0'
       this.billStatus = '0'
-      this.currentSelectDepotId = ''
+      
       this.rowCanEdit = true
       this.rowCanEdit = true
       this.changeColumnHide()
       this.changeColumnHide()
       if (this.action === 'add') {
       if (this.action === 'add') {

+ 1 - 1
jshERP-web/src/views/bill/modules/PurchaseBackModal.vue

@@ -384,7 +384,7 @@ export default {
     //调用完edit()方法之后会自动调用此方法
     //调用完edit()方法之后会自动调用此方法
     editAfter() {
     editAfter() {
       this.billStatus = '0'
       this.billStatus = '0'
-      this.currentSelectDepotId = ''
+      
       this.rowCanEdit = true
       this.rowCanEdit = true
       this.materialTable.columns[1].type = FormTypes.popupJsh
       this.materialTable.columns[1].type = FormTypes.popupJsh
       this.changeColumnHide()
       this.changeColumnHide()

+ 93 - 53
jshERP-web/src/views/bill/modules/PurchaseInModal.vue

@@ -41,6 +41,7 @@
                 :dropdownMatchSelectWidth="false"
                 :dropdownMatchSelectWidth="false"
                 showSearch
                 showSearch
                 optionFilterProp="children"
                 optionFilterProp="children"
+                @change="getTatRate"
               >
               >
                 <div slot="dropdownRender" slot-scope="menu">
                 <div slot="dropdownRender" slot-scope="menu">
                   <v-nodes :vnodes="menu" />
                   <v-nodes :vnodes="menu" />
@@ -95,6 +96,34 @@
               />
               />
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
+          <a-col :lg="6" :md="12" :sm="24">
+            <a-form-item
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              label="仓库名"
+              data-step="4"
+              data-title=""
+              data-intro="仓库名"
+            >
+              <a-select v-decorator="['depotId',validatorRules.depotId]" placeholder="请选择仓库名" @change="changeDepot($event,refKeys[0])">
+                <a-select-option v-for="(item, index) in depotList" :key="index" :value="item.id">
+                  {{ item.depotName }}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :lg="6" :md="12" :sm="24">
+            <a-form-item
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              label="税率"
+              data-step="5"
+              data-title="税率"
+              data-intro="税率"
+            >
+              <a-input placeholder="自动带出" disabled v-decorator="['taxRate']" />
+            </a-form-item>
+          </a-col>
         </a-row>
         </a-row>
         <j-editable-table
         <j-editable-table
           id="billModal"
           id="billModal"
@@ -148,15 +177,15 @@
               <a-button icon="import" @click="onImport(prefixNo)">导入明细</a-button>
               <a-button icon="import" @click="onImport(prefixNo)">导入明细</a-button>
             </a-row>
             </a-row>
           </template>
           </template>
-          <template #depotBatchSet>
+          <!-- <template #depotBatchSet>
             <a-icon type="down" @click="handleBatchSetDepot" />
             <a-icon type="down" @click="handleBatchSetDepot" />
-          </template>
-          <template #depotAdd>
+          </template> -->
+          <!-- <template #depotAdd>
             <a-divider v-if="quickBtn.depot" style="margin: 4px 0" />
             <a-divider v-if="quickBtn.depot" style="margin: 4px 0" />
             <div v-if="quickBtn.depot" style="padding: 4px 8px; cursor: pointer" @click="addDepot">
             <div v-if="quickBtn.depot" style="padding: 4px 8px; cursor: pointer" @click="addDepot">
               <a-icon type="plus" /> 新增仓库
               <a-icon type="plus" /> 新增仓库
             </div>
             </div>
-          </template>
+          </template> -->
           <template #unit="{ handleChange, handleFocus, value }">
           <template #unit="{ handleChange, handleFocus, value }">
             <a-select
             <a-select
               placeholder="请选择"
               placeholder="请选择"
@@ -188,6 +217,28 @@
             >
             >
             </a-select>
             </a-select>
           </template>
           </template>
+          <template #depotId="{ value }">
+            <a-select
+              disabled
+              :value="value"
+              :options="depotList"
+            >
+            </a-select>
+          </template>
+          <template #wholesaleDecimal="{ handleChange, value, index,allValues }">
+            <a-input :value="value" @change="($event) => onChangePrice($event,handleChange)">
+              <a-tooltip slot="suffix" title="修改后和默认价格不一致">
+                <a-icon type="info-circle" style="color: #f5222d" v-show="getDefaultWholesaleDecimal(index,'defaultWholesaleDecimal',value,allValues)" />
+              </a-tooltip>
+            </a-input>
+          </template>
+          <template #unitPrice="{ handleChange, value, index,allValues }">
+            <a-input :value="value" @change="($event) => onChangePrice($event,handleChange)">
+              <a-tooltip slot="suffix" title="修改后和默认价格不一致">
+                <a-icon type="info-circle" style="color: #f5222d" v-show="getDefaultWholesaleDecimal(index,'defaultPurchaseDecimal',value,allValues)" />
+              </a-tooltip>
+            </a-input>
+          </template>
         </j-editable-table>
         </j-editable-table>
         <a-row class="form-row" :gutter="24">
         <a-row class="form-row" :gutter="24">
           <a-col :lg="24" :md="24" :sm="24">
           <a-col :lg="24" :md="24" :sm="24">
@@ -449,17 +500,6 @@ export default {
         loading: false,
         loading: false,
         dataSource: [],
         dataSource: [],
         columns: [
         columns: [
-          // {
-          //   title: '仓库名称',
-          //   key: 'depotId',
-          //   width: '8%',
-          //   type: FormTypes.select,
-          //   placeholder: '请选择${title}',
-          //   options: [],
-          //   allowSearch: true,
-          //   disabled: true,
-          //   validateRules: [{ required: true, message: '${title}不能为空' }],
-          // },
           {
           {
             title: '商品条码',
             title: '商品条码',
             key: 'barCode',
             key: 'barCode',
@@ -481,9 +521,8 @@ export default {
             type: FormTypes.datetime,
             type: FormTypes.datetime,
             validateRules: [{ required: true, message: '${title}不能为空' }],
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
           },
-          { title: '保质期', key: 'expiryNum', width: '120px', type: FormTypes.inputNumber },
-          // { title: '商品条码', key: 'barCode', width: '9%', type: FormTypes.normal },
-          { title: '仓库名', key: 'depotId', width: '120px', type: FormTypes.select,validateRules: [{ required: true, message: '${title}不能为空' }], },
+          { title: '保质期', key: 'expiryNum', width: '120px', type: FormTypes.normal },
+          { title: '仓库名', key: 'depotId', width: '120px', type: FormTypes.slot},
           { title: '仓库货架', key: 'position', width: '120px', type: FormTypes.input },
           { title: '仓库货架', key: 'position', width: '120px', type: FormTypes.input },
           { title: '包装规格', key: 'unitName', width: '120px', type: FormTypes.normal },
           { title: '包装规格', key: 'unitName', width: '120px', type: FormTypes.normal },
 
 
@@ -498,16 +537,13 @@ export default {
             key: 'unit',
             key: 'unit',
             width: '120px',
             width: '120px',
             type: FormTypes.normal,
             type: FormTypes.normal,
-            // options: [],
-            // allowClear: false,
-            // slotName: 'unit',
           },
           },
           {
           {
             title: '销售价',
             title: '销售价',
             key: 'wholesaleDecimal',
             key: 'wholesaleDecimal',
             width: '120px',
             width: '120px',
-            type: FormTypes.input,
-            validateRules: [{ required: true, message: '${title}不能为空' }],
+            type: FormTypes.slot,
+            validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' }],
           },
           },
           { title: '单位id', key: 'unitId', width: '120px', type: FormTypes.hidden },
           { title: '单位id', key: 'unitId', width: '120px', type: FormTypes.hidden },
           { title: '单位列表', key: 'unitList', width: '120px', type: FormTypes.hidden },
           { title: '单位列表', key: 'unitList', width: '120px', type: FormTypes.hidden },
@@ -524,9 +560,9 @@ export default {
             statistics: true,
             statistics: true,
             validateRules: [{ required: true, message: '${title}不能为空' }],
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
           },
-          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.inputNumber,validateRules: [{ required: true, message: '${title}不能为空' }], },
-          { title: '金额', key: 'allPrice', width: '120px', type: FormTypes.inputNumber, statistics: true },
-          { title: '税率', key: 'taxRate', width: '120px', type: FormTypes.inputNumber, placeholder: '%' },
+          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.slot,validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' }], },
+          { title: '金额', key: 'allPrice', width: '120px', type: FormTypes.inputNumber, readonly: true, statistics: true },
+          { title: '税率', key: 'taxRate', width: '120px', type: FormTypes.hidden, placeholder: '%' },
           {
           {
             title: '税额',
             title: '税额',
             key: 'taxMoney',
             key: 'taxMoney',
@@ -535,15 +571,8 @@ export default {
             readonly: true,
             readonly: true,
             statistics: true,
             statistics: true,
           },
           },
-          { title: '价税合计', key: 'taxLastMoney', width: '120px', type: FormTypes.inputNumber, statistics: true },
+          { title: '价税合计', key: 'taxLastMoney', width: '120px', type: FormTypes.inputNumber,readonly: true, statistics: true },
 
 
-          // {
-          //   title: '实际入库数量',
-          //   key: 'actualQuantityInStorage',
-          //   width: '120px',
-          //   type: FormTypes.inputNumber,
-          //   validateRules: [{ required: true, message: '实际入库数量不能为空' }],
-          // },
           { title: '入库差异', key: 'warehousingVariance', width: '120px', type: FormTypes.inputNumber },
           { title: '入库差异', key: 'warehousingVariance', width: '120px', type: FormTypes.inputNumber },
           { title: '入库差异原因', key: 'reasonOfDifference', width: '120px', type: FormTypes.input },
           { title: '入库差异原因', key: 'reasonOfDifference', width: '120px', type: FormTypes.input },
           {
           {
@@ -558,6 +587,8 @@ export default {
 
 
           { title: '备注', key: 'remark', width: '200px', type: FormTypes.input },
           { title: '备注', key: 'remark', width: '200px', type: FormTypes.input },
           { title: '关联id', key: 'linkId', width: '120px', type: FormTypes.hidden },
           { title: '关联id', key: 'linkId', width: '120px', type: FormTypes.hidden },
+          { title: '默认销售价', key: 'defaultWholesaleDecimal', width: '120px', type: FormTypes.hidden },
+          { title: '默认采购价', key: 'defaultPurchaseDecimal', width: '120px', type: FormTypes.hidden },
         ],
         ],
       },
       },
       confirmLoading: false,
       confirmLoading: false,
@@ -577,6 +608,9 @@ export default {
             { pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' },
             { pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' },
           ],
           ],
         },
         },
+        depotId: {
+          rules: [{ required: true, message: '请选择仓库名!' }],
+        },
       },
       },
       url: {
       url: {
         add: '/depotHead/addDepotHeadAndDetail',
         add: '/depotHead/addDepotHeadAndDetail',
@@ -591,8 +625,8 @@ export default {
   methods: {
   methods: {
     //调用完edit()方法之后会自动调用此方法
     //调用完edit()方法之后会自动调用此方法
     editAfter() {
     editAfter() {
+      console.log('this.model======',this.model)
       this.billStatus = '0'
       this.billStatus = '0'
-      this.currentSelectDepotId = ''
       this.rowCanEdit = true
       this.rowCanEdit = true
       this.materialTable.columns[0].type = FormTypes.popupJsh
       this.materialTable.columns[0].type = FormTypes.popupJsh
       this.changeColumnHide()
       this.changeColumnHide()
@@ -654,7 +688,9 @@ export default {
               'accountId',
               'accountId',
               'deposit',
               'deposit',
               'changeAmount',
               'changeAmount',
-              'debt'
+              'debt',
+              'depotId',
+              'taxRate'
             )
             )
           )
           )
         })
         })
@@ -730,9 +766,9 @@ export default {
     linkBillListOk(selectBillDetailRows, linkNumber, organId, discountMoney, deposit, remark, depotId, accountId) {
     linkBillListOk(selectBillDetailRows, linkNumber, organId, discountMoney, deposit, remark, depotId, accountId) {
       let that = this
       let that = this
       this.rowCanEdit = false
       this.rowCanEdit = false
-      this.materialTable.columns[1].type = FormTypes.normal
-      this.changeFormTypes(this.materialTable.columns, 'preNumber', 1)
-      this.changeFormTypes(this.materialTable.columns, 'finishNumber', 1)
+      // this.changeFormTypes(this.materialTable.columns, 'preNumber', 1)
+      // this.changeFormTypes(this.materialTable.columns, 'finishNumber', 1)
+      console.log('selectBillDetailRows', selectBillDetailRows)
       if (selectBillDetailRows && selectBillDetailRows.length > 0) {
       if (selectBillDetailRows && selectBillDetailRows.length > 0) {
         let listEx = []
         let listEx = []
         let allTaxLastMoney = 0
         let allTaxLastMoney = 0
@@ -764,24 +800,28 @@ export default {
           this.depositStatus = true
           this.depositStatus = true
           changeAmount = (discountLastMoney - deposit).toFixed(2) - 0
           changeAmount = (discountLastMoney - deposit).toFixed(2) - 0
         }
         }
+        console.log('depotId===',depotId)
+        this.form.setFieldsValue({
+          organId: organId,
+          linkNumber: linkNumber,
+          discount: discount,
+          discountMoney: discountMoney,
+          discountLastMoney: discountLastMoney,
+          deposit: deposit,
+          changeAmount: changeAmount,
+          accountId: accountId,
+          remark: remark,
+          depotId: depotId,
+        })
         this.$nextTick(() => {
         this.$nextTick(() => {
-          this.form.setFieldsValue({
-            organId: organId,
-            linkNumber: linkNumber,
-            discount: discount,
-            discountMoney: discountMoney,
-            discountLastMoney: discountLastMoney,
-            deposit: deposit,
-            changeAmount: changeAmount,
-            accountId: accountId,
-            remark: remark,
-          })
+          console.log('discount===',this.form.getFieldValue('discount'))
+          this.getTatRate(organId)
         })
         })
         //判断后进行仓库的切换
         //判断后进行仓库的切换
         if (depotId) {
         if (depotId) {
-          setTimeout(function () {
-            that.batchSetDepotModalFormOk(depotId)
-          }, 1000)
+          setTimeout(() => {
+            this.changeDepot(depotId, this.refKeys[0])
+          }, 100)
         }
         }
       }
       }
     },
     },

+ 69 - 35
jshERP-web/src/views/bill/modules/PurchaseOrderModal.vue

@@ -40,6 +40,7 @@
                 :dropdownMatchSelectWidth="false"
                 :dropdownMatchSelectWidth="false"
                 showSearch
                 showSearch
                 optionFilterProp="children"
                 optionFilterProp="children"
+                @change="getTatRate"
               >
               >
                 <div slot="dropdownRender" slot-scope="menu">
                 <div slot="dropdownRender" slot-scope="menu">
                   <v-nodes :vnodes="menu" />
                   <v-nodes :vnodes="menu" />
@@ -96,11 +97,39 @@
           </a-col>
           </a-col>
           <a-col :lg="6" :md="12" :sm="24">
           <a-col :lg="6" :md="12" :sm="24">
             <a-form-item
             <a-form-item
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              label="仓库名"
+              data-step="4"
+              data-title="仓库名"
+              data-intro="仓库名"
+            >
+              <a-select v-decorator="['depotId',validatorRules.depotId]" placeholder="请选择仓库名" @change="changeDepot($event,refKeys[0])">
+                <a-select-option v-for="(item, index) in depotList" :key="index" :value="item.id">
+                  {{ item.depotName }}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :lg="6" :md="12" :sm="24">
+            <a-form-item
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              label="税率"
+              data-step="5"
+              data-title="税率"
+              data-intro="税率"
+            >
+              <a-input placeholder="自动带出" disabled v-decorator="['taxRate']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="6" :md="12" :sm="24">
+            <a-form-item
               v-if="purchaseBySaleFlag"
               v-if="purchaseBySaleFlag"
               :labelCol="labelCol"
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
               :wrapperCol="wrapperCol"
               label="关联订单"
               label="关联订单"
-              data-step="3"
+              data-step="5"
               data-title="关联订单"
               data-title="关联订单"
               data-intro="采购订单单据可以通过关联订单来选择已录入的销售订单,选择之后会自动加载订单的内容,
               data-intro="采购订单单据可以通过关联订单来选择已录入的销售订单,选择之后会自动加载订单的内容,
               提交之后原来的销售订单会对应的改变单据状态。另外本系统支持分批多次关联"
               提交之后原来的销售订单会对应的改变单据状态。另外本系统支持分批多次关联"
@@ -165,6 +194,28 @@
               <a-button icon="import" @click="onImport(prefixNo)">导入明细</a-button>
               <a-button icon="import" @click="onImport(prefixNo)">导入明细</a-button>
             </a-row>
             </a-row>
           </template>
           </template>
+          <template #depotId="{ value }">
+            <a-select
+              disabled
+              :value="value"
+              :options="depotList"
+            >
+            </a-select>
+          </template>
+          <template #wholesaleDecimal="{ handleChange, value, index, allValues}">
+            <a-input :value="value" @change="($event) => onChangePrice($event,handleChange)">
+              <a-tooltip slot="suffix" title="修改后和默认价格不一致">
+                <a-icon type="info-circle" style="color: #f5222d" v-if="getDefaultWholesaleDecimal(index,'defaultWholesaleDecimal',value,allValues)" />
+              </a-tooltip>
+            </a-input>
+          </template>
+          <template #unitPrice="{ handleChange, value, index, allValues}">
+            <a-input :value="value" @change="($event) => onChangePrice($event,handleChange)">
+              <a-tooltip slot="suffix" title="修改后和默认价格不一致">
+                <a-icon type="info-circle" style="color: #f5222d" v-if="getDefaultWholesaleDecimal(index,'defaultPurchaseDecimal',value,allValues)" />
+              </a-tooltip>
+            </a-input>
+          </template>
           <!-- <template #unit="{ handleChange, handleFocus, value }">
           <!-- <template #unit="{ handleChange, handleFocus, value }">
             <a-select
             <a-select
               placeholder="请选择"
               placeholder="请选择"
@@ -413,7 +464,6 @@ export default {
         sm: { span: 16 },
         sm: { span: 16 },
       },
       },
       refKeys: ['materialDataTable'],
       refKeys: ['materialDataTable'],
-      tableKeys: ['materialDataTable'],
       activeKey: 'materialDataTable',
       activeKey: 'materialDataTable',
       materialTable: {
       materialTable: {
         loading: false,
         loading: false,
@@ -438,9 +488,8 @@ export default {
             type: FormTypes.datetime,
             type: FormTypes.datetime,
             validateRules: [{ required: true, message: '${title}不能为空' }],
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
           },
-          { title: '保质期', key: 'expiryNum', width: '120px', type: FormTypes.inputNumber },
-          // { title: '商品条码', key: 'barCode', width: '120px', type: FormTypes.normal },
-          { title: '仓库名', key: 'depotId', width: '120px', type: FormTypes.select,validateRules: [{ required: true, message: '${title}不能为空' }], },
+          { title: '保质期', key: 'expiryNum', width: '120px', type: FormTypes.normal },
+          { title: '仓库名', key: 'depotId', width: '120px', type: FormTypes.slot},
           { title: '仓库货架', key: 'position', width: '120px', type: FormTypes.input },
           { title: '仓库货架', key: 'position', width: '120px', type: FormTypes.input },
           { title: '包装规格', key: 'unitName', width: '120px', type: FormTypes.normal },
           { title: '包装规格', key: 'unitName', width: '120px', type: FormTypes.normal },
 
 
@@ -455,16 +504,13 @@ export default {
             key: 'unit',
             key: 'unit',
             width: '120px',
             width: '120px',
             type: FormTypes.normal,
             type: FormTypes.normal,
-            // options: [],
-            // allowClear: false,
-            // slotName: 'unit',
           },
           },
           {
           {
             title: '销售价',
             title: '销售价',
             key: 'wholesaleDecimal',
             key: 'wholesaleDecimal',
             width: '120px',
             width: '120px',
-            type: FormTypes.input,
-            validateRules: [{ required: true, message: '${title}不能为空' }],
+            type: FormTypes.slot,
+            validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' }],
           },
           },
           { title: '单位id', key: 'unitId', width: '120px', type: FormTypes.hidden },
           { title: '单位id', key: 'unitId', width: '120px', type: FormTypes.hidden },
           { title: '单位列表', key: 'unitList', width: '120px', type: FormTypes.hidden },
           { title: '单位列表', key: 'unitList', width: '120px', type: FormTypes.hidden },
@@ -479,28 +525,9 @@ export default {
             statistics: true,
             statistics: true,
             validateRules: [{ required: true, message: '${title}不能为空' }],
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
           },
-          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.inputNumber,validateRules: [{ required: true, message: '${title}不能为空' }], },
-          { title: '金额', key: 'allPrice', width: '120px', type: FormTypes.inputNumber, statistics: true },
-
-          // {
-          //   title: '实际入库数量',
-          //   key: 'actualQuantityInStorage',
-          //   width: '9%',
-          //   type: FormTypes.inputNumber,
-          //   validateRules: [{ required: true, message: '实际入库数量不能为空' }],
-          // },
-          // { title: '入库差异', key: 'warehousingVariance', width: '9%', type: FormTypes.input },
-          // { title: '入库差异原因', key: 'reasonOfDifference', width: '9%', type: FormTypes.input },
-          // {
-          //   title: '入库人',
-          //   key: 'warehousingUser',
-          //   width: '9%',
-          //   type: FormTypes.input,
-          //   validateRules: [{ required: true, message: '入库人不能为空' }],
-          // },
-          // { title: '入库时间', key: 'warehousingTime', width: '9%', type: FormTypes.date },
-
-          { title: '税率', key: 'taxRate', width: '120px', type: FormTypes.inputNumber, placeholder: '%' },
+          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.slot,validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' }], },
+          { title: '金额', key: 'allPrice', width: '120px', type: FormTypes.inputNumber, readonly: true, statistics: true },
+          { title: '税率', key: 'taxRate', width: '120px', type: FormTypes.hidden, placeholder: '%' },
           {
           {
             title: '税额',
             title: '税额',
             key: 'taxMoney',
             key: 'taxMoney',
@@ -509,9 +536,11 @@ export default {
             readonly: true,
             readonly: true,
             statistics: true,
             statistics: true,
           },
           },
-          { title: '价税合计', key: 'taxLastMoney', width: '120px', type: FormTypes.inputNumber, statistics: true },
+          { title: '价税合计', key: 'taxLastMoney', width: '120px', type: FormTypes.inputNumber,readonly: true, statistics: true },
           { title: '备注', key: 'remark', width: '200px', type: FormTypes.input },
           { title: '备注', key: 'remark', width: '200px', type: FormTypes.input },
           { title: '关联id', key: 'linkId', width: '120px', type: FormTypes.hidden },
           { title: '关联id', key: 'linkId', width: '120px', type: FormTypes.hidden },
+          { title: '默认销售价', key: 'defaultWholesaleDecimal', width: '120px', type: FormTypes.hidden },
+          { title: '默认采购价', key: 'defaultPurchaseDecimal', width: '120px', type: FormTypes.hidden },
         ],
         ],
       },
       },
       confirmLoading: false,
       confirmLoading: false,
@@ -522,6 +551,9 @@ export default {
         organId: {
         organId: {
           rules: [{ required: true, message: '请选择供应商!' }],
           rules: [{ required: true, message: '请选择供应商!' }],
         },
         },
+        depotId: {
+          rules: [{ required: true, message: '请选择仓库名!' }],
+        },
       },
       },
       url: {
       url: {
         add: '/depotHead/addDepotHeadAndDetail',
         add: '/depotHead/addDepotHeadAndDetail',
@@ -536,8 +568,8 @@ export default {
   methods: {
   methods: {
     //调用完edit()方法之后会自动调用此方法
     //调用完edit()方法之后会自动调用此方法
     editAfter() {
     editAfter() {
+      console.log('this.model======',this.model)
       this.billStatus = '0'
       this.billStatus = '0'
-      this.currentSelectDepotId = ''
       this.rowCanEdit = true
       this.rowCanEdit = true
       // this.materialTable.columns[1].type = FormTypes.popupJsh
       // this.materialTable.columns[1].type = FormTypes.popupJsh
       this.changeColumnHide()
       this.changeColumnHide()
@@ -581,7 +613,9 @@ export default {
               'discountMoney',
               'discountMoney',
               'discountLastMoney',
               'discountLastMoney',
               'accountId',
               'accountId',
-              'changeAmount'
+              'changeAmount',
+              'depotId',
+              'taxRate',
             )
             )
           )
           )
         })
         })

+ 1 - 1
jshERP-web/src/views/bill/modules/RetailBackModal.vue

@@ -351,7 +351,7 @@ export default {
     //调用完edit()方法之后会自动调用此方法
     //调用完edit()方法之后会自动调用此方法
     editAfter() {
     editAfter() {
       this.billStatus = '0'
       this.billStatus = '0'
-      this.currentSelectDepotId = ''
+      
       this.rowCanEdit = true
       this.rowCanEdit = true
       this.materialTable.columns[1].type = FormTypes.popupJsh
       this.materialTable.columns[1].type = FormTypes.popupJsh
       this.changeColumnHide()
       this.changeColumnHide()

+ 1 - 1
jshERP-web/src/views/bill/modules/RetailOutModal.vue

@@ -397,7 +397,7 @@ export default {
     //调用完edit()方法之后会自动调用此方法
     //调用完edit()方法之后会自动调用此方法
     editAfter() {
     editAfter() {
       this.billStatus = '0'
       this.billStatus = '0'
-      this.currentSelectDepotId = ''
+      
       this.changeColumnHide()
       this.changeColumnHide()
       this.changeFormTypes(this.materialTable.columns, 'snList', 0)
       this.changeFormTypes(this.materialTable.columns, 'snList', 0)
       this.changeFormTypes(this.materialTable.columns, 'batchNumber', 0)
       this.changeFormTypes(this.materialTable.columns, 'batchNumber', 0)

+ 1 - 1
jshERP-web/src/views/bill/modules/SaleBackModal.vue

@@ -394,7 +394,7 @@ export default {
     //调用完edit()方法之后会自动调用此方法
     //调用完edit()方法之后会自动调用此方法
     editAfter() {
     editAfter() {
       this.billStatus = '0'
       this.billStatus = '0'
-      this.currentSelectDepotId = ''
+      
       this.rowCanEdit = true
       this.rowCanEdit = true
       this.materialTable.columns[1].type = FormTypes.popupJsh
       this.materialTable.columns[1].type = FormTypes.popupJsh
       this.changeColumnHide()
       this.changeColumnHide()

+ 62 - 12
jshERP-web/src/views/bill/modules/SaleOrderModal.vue

@@ -41,7 +41,7 @@
                 :dropdownMatchSelectWidth="false"
                 :dropdownMatchSelectWidth="false"
                 showSearch
                 showSearch
                 optionFilterProp="children"
                 optionFilterProp="children"
-                @change="handleOrganChange"
+                @change="getTatRate"
               >
               >
                 <div slot="dropdownRender" slot-scope="menu">
                 <div slot="dropdownRender" slot-scope="menu">
                   <v-nodes :vnodes="menu" />
                   <v-nodes :vnodes="menu" />
@@ -94,6 +94,34 @@
               />
               />
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
+          <a-col :lg="6" :md="12" :sm="24">
+            <a-form-item
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              label="仓库名"
+              data-step="4"
+              data-title=""
+              data-intro="仓库名"
+            >
+              <a-select v-decorator="['depotId',validatorRules.depotId]" placeholder="请选择仓库名" @change="changeDepot($event,refKeys[0])">
+                <a-select-option v-for="(item, index) in depotList" :key="index" :value="item.id">
+                  {{ item.depotName }}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :lg="6" :md="12" :sm="24">
+            <a-form-item
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              label="税率"
+              data-step="5"
+              data-title="税率"
+              data-intro="税率"
+            >
+              <a-input placeholder="自动带出" disabled v-decorator="['taxRate']" />
+            </a-form-item>
+          </a-col>
         </a-row>
         </a-row>
         <j-editable-table
         <j-editable-table
           id="billModal"
           id="billModal"
@@ -146,6 +174,21 @@
               <a-button icon="import" @click="onImport(prefixNo)">导入明细</a-button>
               <a-button icon="import" @click="onImport(prefixNo)">导入明细</a-button>
             </a-row>
             </a-row>
           </template>
           </template>
+          <template #depotId="{ value }">
+            <a-select
+              disabled
+              :value="value"
+              :options="depotList"
+            >
+            </a-select>
+          </template>
+          <template #unitPrice="{ handleChange, value, index,allValues }">
+            <a-input :value="value" @change="($event) => onChangePrice($event,handleChange)">
+              <a-tooltip slot="suffix" title="修改后和默认价格不一致">
+                <a-icon type="info-circle" style="color: #f5222d" v-show="getDefaultWholesaleDecimal(index,'defaultWholesaleDecimal',value, allValues)" />
+              </a-tooltip>
+            </a-input>
+          </template>
           <!-- <template #unit="{ handleChange, handleFocus, value }">
           <!-- <template #unit="{ handleChange, handleFocus, value }">
             <a-select
             <a-select
               placeholder="请选择"
               placeholder="请选择"
@@ -401,7 +444,7 @@ export default {
           // { title: '生产日期', key: 'productionDate', width: '6%', type: FormTypes.normal },
           // { title: '生产日期', key: 'productionDate', width: '6%', type: FormTypes.normal },
           // { title: '保质期', key: 'expiryNum', width: '6%', type: FormTypes.normal },
           // { title: '保质期', key: 'expiryNum', width: '6%', type: FormTypes.normal },
           // { title: '商品条码', key: 'barCode', width: '6%', type: FormTypes.normal },
           // { title: '商品条码', key: 'barCode', width: '6%', type: FormTypes.normal },
-          { title: '仓库名', key: 'depotId', width: '120px', type: FormTypes.select,validateRules: [{ required: true, message: '${title}不能为空' }], },
+          { title: '仓库名', key: 'depotId', width: '120px', type: FormTypes.slot },
           { title: '仓库货架', key: 'position', width: '120px', type: FormTypes.input },
           { title: '仓库货架', key: 'position', width: '120px', type: FormTypes.input },
           { title: '包装规格', key: 'unitName', width: '120px', type: FormTypes.normal },
           { title: '包装规格', key: 'unitName', width: '120px', type: FormTypes.normal },
 
 
@@ -420,11 +463,11 @@ export default {
             // allowClear: false,
             // allowClear: false,
             // slotName: 'unit',
             // slotName: 'unit',
           },
           },
-          { title: '单位id', key: 'unitId', width: '120px', type: FormTypes.hidden },
-          { title: '单位列表', key: 'unitList', width: '120px', type: FormTypes.hidden },
-          { title: '序列号', key: 'snList', width: '120px', type: FormTypes.popupJsh, kind: 'sn', multi: true },
+          // { title: '单位id', key: 'unitId', width: '120px', type: FormTypes.hidden },
+          // { title: '单位列表', key: 'unitList', width: '120px', type: FormTypes.hidden },
+          // { title: '序列号', key: 'snList', width: '120px', type: FormTypes.popupJsh, kind: 'sn', multi: true },
           // { title: '有效期', key: 'expirationDate', width: '7%', type: FormTypes.input, readonly: true },
           // { title: '有效期', key: 'expirationDate', width: '7%', type: FormTypes.input, readonly: true },
-          { title: '多属性', key: 'sku', width: '120px', type: FormTypes.normal },
+          // { title: '多属性', key: 'sku', width: '120px', type: FormTypes.normal },
           // { title: '原数量', key: 'preNumber', width: '4%', type: FormTypes.normal },
           // { title: '原数量', key: 'preNumber', width: '4%', type: FormTypes.normal },
           // { title: '已出库', key: 'finishNumber', width: '4%', type: FormTypes.normal },
           // { title: '已出库', key: 'finishNumber', width: '4%', type: FormTypes.normal },
           {
           {
@@ -435,9 +478,9 @@ export default {
             statistics: true,
             statistics: true,
             validateRules: [{ required: true, message: '${title}不能为空' }],
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
           },
-          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.inputNumber,validateRules: [{ required: true, message: '${title}不能为空' }], },
-          { title: '金额', key: 'allPrice', width: '120px', type: FormTypes.inputNumber, statistics: true },
-          { title: '税率', key: 'taxRate', width: '120px', type: FormTypes.inputNumber, placeholder: '%' },
+          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.slot,validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' }], },
+          { title: '金额', key: 'allPrice', width: '120px', type: FormTypes.inputNumber, readonly: true, statistics: true },
+          { title: '税率', key: 'taxRate', width: '120px', type: FormTypes.hidden, placeholder: '%' },
           {
           {
             title: '税额',
             title: '税额',
             key: 'taxMoney',
             key: 'taxMoney',
@@ -446,7 +489,7 @@ export default {
             readonly: true,
             readonly: true,
             statistics: true,
             statistics: true,
           },
           },
-          { title: '价税合计', key: 'taxLastMoney', width: '120px', type: FormTypes.inputNumber, statistics: true },
+          { title: '价税合计', key: 'taxLastMoney', width: '120px', type: FormTypes.inputNumber, readonly: true, statistics: true },
 
 
           // {
           // {
           //   title: '实际出库数量',
           //   title: '实际出库数量',
@@ -468,6 +511,8 @@ export default {
 
 
           { title: '备注', key: 'remark', width: '200px', type: FormTypes.input },
           { title: '备注', key: 'remark', width: '200px', type: FormTypes.input },
           { title: '关联id', key: 'linkId', width: '120px', type: FormTypes.hidden },
           { title: '关联id', key: 'linkId', width: '120px', type: FormTypes.hidden },
+          { title: '默认销售价', key: 'defaultWholesaleDecimal', width: '120px', type: FormTypes.hidden },
+          { title: '默认采购价', key: 'defaultPurchaseDecimal', width: '120px', type: FormTypes.hidden },
         ],
         ],
       },
       },
       confirmLoading: false,
       confirmLoading: false,
@@ -478,6 +523,9 @@ export default {
         organId: {
         organId: {
           rules: [{ required: true, message: '请选择客户!' }],
           rules: [{ required: true, message: '请选择客户!' }],
         },
         },
+        depotId: {
+          rules: [{ required: true, message: '请选择仓库名!' }],
+        },
       },
       },
       url: {
       url: {
         add: '/depotHead/addDepotHeadAndDetail',
         add: '/depotHead/addDepotHeadAndDetail',
@@ -492,7 +540,7 @@ export default {
     //调用完edit()方法之后会自动调用此方法
     //调用完edit()方法之后会自动调用此方法
     editAfter() {
     editAfter() {
       this.billStatus = '0'
       this.billStatus = '0'
-      this.currentSelectDepotId = ''
+      
       this.changeColumnHide()
       this.changeColumnHide()
       if (this.action === 'add') {
       if (this.action === 'add') {
         this.addInit(this.prefixNo)
         this.addInit(this.prefixNo)
@@ -529,7 +577,9 @@ export default {
               'salesMan',
               'salesMan',
               'receiverName',
               'receiverName',
               'receiverPhone',
               'receiverPhone',
-              'receiverAddress'
+              'receiverAddress',
+              'depotId',
+              'taxRate'
             )
             )
           )
           )
         })
         })

+ 80 - 19
jshERP-web/src/views/bill/modules/SaleOutModal.vue

@@ -42,7 +42,7 @@
                 :dropdownMatchSelectWidth="false"
                 :dropdownMatchSelectWidth="false"
                 showSearch
                 showSearch
                 optionFilterProp="children"
                 optionFilterProp="children"
-                @change="handleOrganChange"
+                @change="getTatRate"
               >
               >
                 <div slot="dropdownRender" slot-scope="menu">
                 <div slot="dropdownRender" slot-scope="menu">
                   <v-nodes :vnodes="menu" />
                   <v-nodes :vnodes="menu" />
@@ -97,6 +97,34 @@
               />
               />
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
+          <a-col :lg="6" :md="12" :sm="24">
+            <a-form-item
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              label="仓库名"
+              data-step="5"
+              data-title=""
+              data-intro="仓库名"
+            >
+              <a-select v-decorator="['depotId',validatorRules.depotId]" placeholder="请选择仓库名" @change="changeDepot($event,refKeys[0])">
+                <a-select-option v-for="(item, index) in depotList" :key="index" :value="item.id">
+                  {{ item.depotName }}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :lg="6" :md="12" :sm="24">
+            <a-form-item
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              label="税率"
+              data-step="5"
+              data-title="税率"
+              data-intro="税率"
+            >
+              <a-input placeholder="自动带出" disabled v-decorator="['taxRate']" />
+            </a-form-item>
+          </a-col>
         </a-row>
         </a-row>
         <j-editable-table
         <j-editable-table
           id="billModal"
           id="billModal"
@@ -150,15 +178,15 @@
               <a-button icon="import" @click="onImport(prefixNo)">导入明细</a-button>
               <a-button icon="import" @click="onImport(prefixNo)">导入明细</a-button>
             </a-row>
             </a-row>
           </template>
           </template>
-          <template #depotBatchSet>
+          <!-- <template #depotBatchSet>
             <a-icon type="down" @click="handleBatchSetDepot" />
             <a-icon type="down" @click="handleBatchSetDepot" />
-          </template>
-          <template #depotAdd>
+          </template> -->
+          <!-- <template #depotAdd>
             <a-divider v-if="quickBtn.depot" style="margin: 4px 0" />
             <a-divider v-if="quickBtn.depot" style="margin: 4px 0" />
             <div v-if="quickBtn.depot" style="padding: 4px 8px; cursor: pointer" @click="addDepot">
             <div v-if="quickBtn.depot" style="padding: 4px 8px; cursor: pointer" @click="addDepot">
               <a-icon type="plus" /> 新增仓库
               <a-icon type="plus" /> 新增仓库
             </div>
             </div>
-          </template>
+          </template> -->
           <template #unit="{ handleChange, handleFocus, value }">
           <template #unit="{ handleChange, handleFocus, value }">
             <a-select
             <a-select
               placeholder="请选择"
               placeholder="请选择"
@@ -190,6 +218,28 @@
             >
             >
             </a-select>
             </a-select>
           </template>
           </template>
+          <template #depotId="{ value }">
+            <a-select
+              disabled
+              :value="value"
+              :options="depotList"
+            >
+            </a-select>
+          </template>
+          <!-- <template #wholesaleDecimal="{ handleChange, value, index }">
+            <a-input :value="value" @change="($event) => onChangePrice($event,handleChange)">
+              <a-tooltip slot="suffix" title="修改后和默认价格不一致">
+                <a-icon type="info-circle" style="color: #f5222d" v-show="getDefaultWholesaleDecimal(index,'defaultWholesaleDecimal')!=value" />
+              </a-tooltip>
+            </a-input>
+          </template> -->
+          <template #unitPrice="{ handleChange, value, index,allValues }">
+            <a-input :value="value" @change="($event) => onChangePrice($event,handleChange)">
+              <a-tooltip slot="suffix" title="修改后和默认价格不一致">
+                <a-icon type="info-circle" style="color: #f5222d" v-show="getDefaultWholesaleDecimal(index,'defaultWholesaleDecimal',value,allValues)" />
+              </a-tooltip>
+            </a-input>
+          </template>
         </j-editable-table>
         </j-editable-table>
         <a-row class="form-row" :gutter="24">
         <a-row class="form-row" :gutter="24">
           <a-col :lg="24" :md="24" :sm="24">
           <a-col :lg="24" :md="24" :sm="24">
@@ -502,7 +552,7 @@ export default {
           // { title: '生产日期', key: 'productionDate', width: '9%', type: FormTypes.normal, disabled: true },
           // { title: '生产日期', key: 'productionDate', width: '9%', type: FormTypes.normal, disabled: true },
           // { title: '保质期', key: 'expiryNum', width: '6%', type: FormTypes.normal },
           // { title: '保质期', key: 'expiryNum', width: '6%', type: FormTypes.normal },
           // { title: '商品条码', key: 'barCode', width: '9%', type: FormTypes.normal },
           // { title: '商品条码', key: 'barCode', width: '9%', type: FormTypes.normal },
-          { title: '仓库名', key: 'depotId', width: '120px', type: FormTypes.select,validateRules: [{ required: true, message: '${title}不能为空' }], },
+          { title: '仓库名', key: 'depotId', width: '120px', type: FormTypes.slot },
           { title: '仓库货架', key: 'position', width: '120px', type: FormTypes.input },
           { title: '仓库货架', key: 'position', width: '120px', type: FormTypes.input },
           { title: '包装规格', key: 'unitName', width: '120px', type: FormTypes.normal },
           { title: '包装规格', key: 'unitName', width: '120px', type: FormTypes.normal },
 
 
@@ -536,9 +586,9 @@ export default {
             statistics: true,
             statistics: true,
             validateRules: [{ required: true, message: '${title}不能为空' }],
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
           },
-          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.inputNumber,validateRules: [{ required: true, message: '${title}不能为空' }], },
-          { title: '金额', key: 'allPrice', width: '120px', type: FormTypes.inputNumber, statistics: true },
-          { title: '税率', key: 'taxRate', width: '120px', type: FormTypes.inputNumber, placeholder: '%' },
+          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.slot,validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' }], },
+          { title: '金额', key: 'allPrice', width: '120px', type: FormTypes.inputNumber,readonly: true, statistics: true },
+          { title: '税率', key: 'taxRate', width: '120px', type: FormTypes.hidden, placeholder: '%' },
           {
           {
             title: '税额',
             title: '税额',
             key: 'taxMoney',
             key: 'taxMoney',
@@ -547,7 +597,7 @@ export default {
             readonly: true,
             readonly: true,
             statistics: true,
             statistics: true,
           },
           },
-          { title: '价税合计', key: 'taxLastMoney', width: '120px', type: FormTypes.inputNumber, statistics: true },
+          { title: '价税合计', key: 'taxLastMoney', width: '120px', type: FormTypes.inputNumber, readonly: true, statistics: true },
 
 
           // {
           // {
           //   title: '实际出库数量',
           //   title: '实际出库数量',
@@ -570,6 +620,8 @@ export default {
 
 
           { title: '备注', key: 'remark', width: '200px', type: FormTypes.input },
           { title: '备注', key: 'remark', width: '200px', type: FormTypes.input },
           { title: '关联id', key: 'linkId', width: '120px', type: FormTypes.hidden },
           { title: '关联id', key: 'linkId', width: '120px', type: FormTypes.hidden },
+          { title: '默认销售价', key: 'defaultWholesaleDecimal', width: '120px', type: FormTypes.hidden },
+          { title: '默认采购价', key: 'defaultPurchaseDecimal', width: '120px', type: FormTypes.hidden },
         ],
         ],
       },
       },
       confirmLoading: false,
       confirmLoading: false,
@@ -589,6 +641,9 @@ export default {
             { pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' },
             { pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' },
           ],
           ],
         },
         },
+        depotId: {
+          rules: [{ required: true, message: '请选择仓库名!' }],
+        },
       },
       },
       url: {
       url: {
         add: '/depotHead/addDepotHeadAndDetail',
         add: '/depotHead/addDepotHeadAndDetail',
@@ -603,7 +658,6 @@ export default {
     //调用完edit()方法之后会自动调用此方法
     //调用完edit()方法之后会自动调用此方法
     editAfter() {
     editAfter() {
       this.billStatus = '0'
       this.billStatus = '0'
-      this.currentSelectDepotId = ''
       this.rowCanEdit = true
       this.rowCanEdit = true
       this.materialTable.columns[0].type = FormTypes.popupJsh
       this.materialTable.columns[0].type = FormTypes.popupJsh
       this.changeColumnHide()
       this.changeColumnHide()
@@ -672,7 +726,9 @@ export default {
               'salesMan',
               'salesMan',
               'receiverName',
               'receiverName',
               'receiverPhone',
               'receiverPhone',
-              'receiverAddress'
+              'receiverAddress',
+              'depotId',
+              'taxRate'
             )
             )
           )
           )
         })
         })
@@ -760,9 +816,9 @@ export default {
     ) {
     ) {
       let that = this
       let that = this
       this.rowCanEdit = false
       this.rowCanEdit = false
-      this.materialTable.columns[1].type = FormTypes.normal
-      this.changeFormTypes(this.materialTable.columns, 'preNumber', 1)
-      this.changeFormTypes(this.materialTable.columns, 'finishNumber', 1)
+      // this.materialTable.columns[1].type = FormTypes.normal
+      // this.changeFormTypes(this.materialTable.columns, 'preNumber', 1)
+      // this.changeFormTypes(this.materialTable.columns, 'finishNumber', 1)
       if (selectBillDetailRows && selectBillDetailRows.length > 0) {
       if (selectBillDetailRows && selectBillDetailRows.length > 0) {
         let listEx = []
         let listEx = []
         let allTaxLastMoney = 0
         let allTaxLastMoney = 0
@@ -789,10 +845,13 @@ export default {
         }
         }
         let discountLastMoney = (allTaxLastMoney - discountMoney).toFixed(2) - 0
         let discountLastMoney = (allTaxLastMoney - discountMoney).toFixed(2) - 0
         let changeAmount = discountLastMoney
         let changeAmount = discountLastMoney
+        console.log('deposit===',deposit)
         if (deposit) {
         if (deposit) {
           this.depositStatus = true
           this.depositStatus = true
           changeAmount = (discountLastMoney - deposit).toFixed(2) - 0
           changeAmount = (discountLastMoney - deposit).toFixed(2) - 0
         }
         }
+        
+        this.personList.value = salesMan
         this.$nextTick(() => {
         this.$nextTick(() => {
           this.form.setFieldsValue({
           this.form.setFieldsValue({
             organId: organId,
             organId: organId,
@@ -807,14 +866,16 @@ export default {
             receiverName,
             receiverName,
             receiverPhone,
             receiverPhone,
             receiverAddress,
             receiverAddress,
+            depotId: depotId,
           })
           })
-          this.personList.value = salesMan
+          console.log('discount===',this.form.getFieldValue('discount'))
+          this.getTatRate(organId)
         })
         })
         //判断后进行仓库的切换
         //判断后进行仓库的切换
         if (depotId) {
         if (depotId) {
-          setTimeout(function () {
-            that.batchSetDepotModalFormOk(depotId)
-          }, 1000)
+          setTimeout(() => {
+            this.changeDepot(depotId, this.refKeys[0])
+          }, 100)
         }
         }
       }
       }
     },
     },

+ 2 - 2
jshERP-web/src/views/financial/AdvanceInList.vue

@@ -102,12 +102,12 @@
         <div class="table-operator" style="margin-top: 5px">
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
             >审核</a-button
           >
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
             >反审核</a-button
-          >
+          > -->
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
             >导出</a-button
           >
           >

+ 2 - 2
jshERP-web/src/views/financial/GiroList.vue

@@ -102,12 +102,12 @@
         <div class="table-operator" style="margin-top: 5px">
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
             >审核</a-button
           >
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
             >反审核</a-button
-          >
+          > -->
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
             >导出</a-button
           >
           >

+ 2 - 2
jshERP-web/src/views/financial/ItemInList.vue

@@ -130,12 +130,12 @@
         <div class="table-operator" style="margin-top: 5px">
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
             >审核</a-button
           >
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
             >反审核</a-button
-          >
+          > -->
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
             >导出</a-button
           >
           >

+ 2 - 2
jshERP-web/src/views/financial/ItemOutList.vue

@@ -130,12 +130,12 @@
         <div class="table-operator" style="margin-top: 5px">
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
             >审核</a-button
           >
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
             >反审核</a-button
-          >
+          > -->
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
             >导出</a-button
           >
           >

+ 2 - 2
jshERP-web/src/views/financial/MoneyInList.vue

@@ -121,12 +121,12 @@
         <div class="table-operator" style="margin-top: 5px">
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
             >审核</a-button
           >
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
             >反审核</a-button
-          >
+          > -->
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
             >导出</a-button
           >
           >

+ 2 - 2
jshERP-web/src/views/financial/MoneyOutList.vue

@@ -121,12 +121,12 @@
         <div class="table-operator" style="margin-top: 5px">
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
             >审核</a-button
           >
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
             >反审核</a-button
-          >
+          > -->
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
             >导出</a-button
           >
           >

+ 2 - 2
jshERP-web/src/views/financial/mixins/FinancialListMixin.js

@@ -78,14 +78,14 @@ export const FinancialListMixin = {
           }
           }
         })
         })
       } else {
       } else {
-        this.$message.warning('抱歉,只有未审核的单据才能编辑,请先进行反审核!')
+        this.$message.warning('抱歉,只有未审核的单据才能编辑!')
       }
       }
     },
     },
     myHandleDelete(record) {
     myHandleDelete(record) {
       if (record.status === '0') {
       if (record.status === '0') {
         this.handleDelete(record.id)
         this.handleDelete(record.id)
       } else {
       } else {
-        this.$message.warning('抱歉,只有未审核的单据才能删除,请先进行反审核!')
+        this.$message.warning('抱歉,只有未审核的单据才能删除!')
       }
       }
     },
     },
     myHandleDetail(record, type, prefixNo) {
     myHandleDetail(record, type, prefixNo) {

+ 6 - 2
jshERP-web/src/views/material/MaterialCategoryList.vue

@@ -66,7 +66,7 @@
             <a-input placeholder="请输入名称" v-decorator="['name', validatorRules.name]" />
             <a-input placeholder="请输入名称" v-decorator="['name', validatorRules.name]" />
           </a-form-item>
           </a-form-item>
           <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="编号">
           <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="编号">
-            <a-input placeholder="请输入编号" v-decorator="['serialNo', validatorRules.serialNo]" />
+            <a-input placeholder="请输入编号" v-decorator="['serialNo', validatorRules.serialNo]" disabled />
           </a-form-item>
           </a-form-item>
           <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="上级目录">
           <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="上级目录">
             <a-tree-select
             <a-tree-select
@@ -86,6 +86,9 @@
           <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="备注">
           <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="备注">
             <a-textarea placeholder="请输入备注" :rows="2" v-decorator.trim="['remark']" />
             <a-textarea placeholder="请输入备注" :rows="2" v-decorator.trim="['remark']" />
           </a-form-item>
           </a-form-item>
+          <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="有效期阈值">
+            <a-input-number :min="0" v-decorator="['expiryThreshold']" style="width: 100%;" placeholder="请输入有效期阈值" />
+          </a-form-item>
         </a-form>
         </a-form>
         <div class="anty-form-btn">
         <div class="anty-form-btn">
           <a-button @click="emptyCurrForm" type="default" htmlType="button" icon="sync">重置</a-button>
           <a-button @click="emptyCurrForm" type="default" htmlType="button" icon="sync">重置</a-button>
@@ -292,6 +295,7 @@ export default {
             record.parentId = res.data.parentId
             record.parentId = res.data.parentId
             record.sort = res.data.sort
             record.sort = res.data.sort
             record.remark = res.data.remark
             record.remark = res.data.remark
+            record.expiryThreshold = res.data.expiryThreshold
             console.log('onSelect-record', record)
             console.log('onSelect-record', record)
             this.currSelected = Object.assign({}, record)
             this.currSelected = Object.assign({}, record)
             this.model = this.currSelected
             this.model = this.currSelected
@@ -316,7 +320,7 @@ export default {
     // 触发onSelect事件时,为类别树右侧的form表单赋值
     // 触发onSelect事件时,为类别树右侧的form表单赋值
     setValuesToForm(record) {
     setValuesToForm(record) {
       this.$nextTick(() => {
       this.$nextTick(() => {
-        this.form.setFieldsValue(pick(record, 'name', 'serialNo', 'parentId', 'sort', 'remark'))
+        this.form.setFieldsValue(pick(record, 'name', 'serialNo', 'parentId', 'sort', 'remark', 'expiryThreshold'))
       })
       })
     },
     },
     getCurrSelectedTitle() {
     getCurrSelectedTitle() {

+ 22 - 48
jshERP-web/src/views/material/MaterialList.vue

@@ -59,11 +59,6 @@
                     <a-input placeholder="请输入品牌查询" v-model="queryParam.brand"></a-input>
                     <a-input placeholder="请输入品牌查询" v-model="queryParam.brand"></a-input>
                   </a-form-item>
                   </a-form-item>
                 </a-col>
                 </a-col>
-                <!-- <a-col :md="6" :sm="24">
-                  <a-form-item label="制造商" :labelCol="labelCol" :wrapperCol="wrapperCol">
-                    <a-input placeholder="请输入制造商查询" v-model="queryParam.mfrs"></a-input>
-                  </a-form-item>
-                </a-col> -->
                 <a-col :md="6" :sm="24">
                 <a-col :md="6" :sm="24">
                   <a-form-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
                   <a-form-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
                     <a-select placeholder="请选择状态" v-model="queryParam.enabled">
                     <a-select placeholder="请选择状态" v-model="queryParam.enabled">
@@ -80,23 +75,6 @@
                     </a-select>
                     </a-select>
                   </a-form-item>
                   </a-form-item>
                 </a-col>
                 </a-col>
-                <!-- <a-col :md="6" :sm="24">
-                  <a-form-item label="批号" :labelCol="labelCol" :wrapperCol="wrapperCol">
-                    <a-select placeholder="有无批号" v-model="queryParam.enableBatchNumber">
-                      <a-select-option value="1">有</a-select-option>
-                      <a-select-option value="0">无</a-select-option>
-                    </a-select>
-                  </a-form-item>
-                </a-col> -->
-                <!-- <a-col :md="6" :sm="24">
-                  <a-form-item label="仓位货架" :labelCol="labelCol" :wrapperCol="wrapperCol">
-                    <a-input
-                      style="width: 100%"
-                      placeholder="请输入仓位货架查询"
-                      v-model="queryParam.position"
-                    ></a-input>
-                  </a-form-item>
-                </a-col> -->
                 <a-col :md="6" :sm="24">
                 <a-col :md="6" :sm="24">
                   <a-form-item label="扩展信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
                   <a-form-item label="扩展信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
                     <a-input
                     <a-input
@@ -115,15 +93,15 @@
                     ></a-input-number>
                     ></a-input-number>
                   </a-form-item>
                   </a-form-item>
                 </a-col>
                 </a-col>
-                <!-- <a-col :md="6" :sm="24">
-                  <a-form-item label="保质期" :labelCol="labelCol" :wrapperCol="wrapperCol">
-                    <a-input-number
-                      style="width: 100%"
-                      placeholder="请输入保质期查询"
-                      v-model="queryParam.expiryNum"
-                    ></a-input-number>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="预警提示" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                    <a-select v-model="queryParam.reminder" option-label-prop="title" placeholder="请选择预警提示">
+                      <a-select-option key="临期" value="临期" title="临期">临期</a-select-option>
+                      <a-select-option key="无动销" value="无动销" title="无动销">无动销</a-select-option>
+                      <a-select-option key="库存危险" value="库存危险" title="库存危险">库存危险</a-select-option>
+                    </a-select>
                   </a-form-item>
                   </a-form-item>
-                </a-col> -->
+                </a-col>
                 <a-col :md="6" :sm="24">
                 <a-col :md="6" :sm="24">
                   <a-form-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol">
                   <a-form-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol">
                     <a-input placeholder="请输入备注查询" v-model="queryParam.remark"></a-input>
                     <a-input placeholder="请输入备注查询" v-model="queryParam.remark"></a-input>
@@ -220,9 +198,6 @@
                 </div>
                 </div>
               </a-popover>
               </a-popover>
             </template>
             </template>
-            <template slot="customBarCode" slot-scope="text, record">
-              {{ record.mBarCode }}
-            </template>
             <template slot="customName" slot-scope="text, record">
             <template slot="customName" slot-scope="text, record">
               {{ record.name }}
               {{ record.name }}
               <a-tag v-if="record.enableSerialNumber == 1" color="orange">序</a-tag>
               <a-tag v-if="record.enableSerialNumber == 1" color="orange">序</a-tag>
@@ -238,6 +213,11 @@
                 {{ text }}
                 {{ text }}
               </a-tooltip>
               </a-tooltip>
             </template>
             </template>
+            <template slot="reminder" slot-scope="text, record">
+              <a-tag v-if="record.reminder&&record.reminder.includes('临期')" color="red" style="margin-right: 10px;">临期</a-tag>
+              <a-tag v-if="record.reminder&&record.reminder.includes('无动销')" color="orange" style="margin-right: 10px;">无动销</a-tag>
+              <a-tag v-if="record.reminder&&record.reminder.includes('库存危险')" color="blue">库存危险</a-tag>
+            </template>
             <template slot="customRenderEnabled" slot-scope="enabled">
             <template slot="customRenderEnabled" slot-scope="enabled">
               <a-tag v-if="enabled" color="green">启用</a-tag>
               <a-tag v-if="enabled" color="green">启用</a-tag>
               <a-tag v-if="!enabled" color="orange">禁用</a-tag>
               <a-tag v-if="!enabled" color="orange">禁用</a-tag>
@@ -295,14 +275,11 @@ export default {
         model: '',
         model: '',
         color: '',
         color: '',
         brand: '',
         brand: '',
-        mfrs: '',
         materialOther: '',
         materialOther: '',
         weight: '',
         weight: '',
-        expiryNum: '',
         enabled: undefined,
         enabled: undefined,
         enableSerialNumber: undefined,
         enableSerialNumber: undefined,
-        enableBatchNumber: undefined,
-        position: '',
+        reminder: undefined,
         remark: '',
         remark: '',
         mpList: getMpListShort(Vue.ls.get('materialPropertyList')), //扩展属性
         mpList: getMpListShort(Vue.ls.get('materialPropertyList')), //扩展属性
       },
       },
@@ -316,7 +293,7 @@ export default {
       // 默认索引
       // 默认索引
       defDataIndex: [
       defDataIndex: [
         'action',
         'action',
-        'mBarCode',
+        'barCode',
         'name',
         'name',
         'standard',
         'standard',
         'model',
         'model',
@@ -325,11 +302,12 @@ export default {
         'materialOther',
         'materialOther',
         'unit',
         'unit',
         'stock',
         'stock',
-        'purchaseDecimal',
+        'defaultPurchaseDecimal',
         'commodityDecimal',
         'commodityDecimal',
-        'wholesaleDecimal',
+        'defaultWholesaleDecimal',
         'lowDecimal',
         'lowDecimal',
         'enabled',
         'enabled',
+        'reminder'
       ],
       ],
       // 默认列
       // 默认列
       defColumns: [
       defColumns: [
@@ -341,7 +319,7 @@ export default {
           scopedSlots: { customRender: 'action' },
           scopedSlots: { customRender: 'action' },
         },
         },
         { title: '图片', dataIndex: 'pic', width: 60, scopedSlots: { customRender: 'customPic' } },
         { title: '图片', dataIndex: 'pic', width: 60, scopedSlots: { customRender: 'customPic' } },
-        { title: '条码', dataIndex: 'mBarCode', width: 120 },
+        { title: '条码', dataIndex: 'barCode', width: 120 },
         { title: '名称', dataIndex: 'name', width: 160, scopedSlots: { customRender: 'customName' } },
         { title: '名称', dataIndex: 'name', width: 160, scopedSlots: { customRender: 'customName' } },
         { title: '系统SKU', dataIndex: 'systemSku', width: 120 },
         { title: '系统SKU', dataIndex: 'systemSku', width: 120 },
         { title: '规格', dataIndex: 'standard', width: 120 },
         { title: '规格', dataIndex: 'standard', width: 120 },
@@ -368,20 +346,16 @@ export default {
           },
           },
         },
         },
         { title: '基础重量', dataIndex: 'weight', width: 80 },
         { title: '基础重量', dataIndex: 'weight', width: 80 },
-        // { title: '保质期', dataIndex: 'expiryNum', width: 60 },
-        // { title: '制造商', dataIndex: 'mfrs', width: 120, ellipsis: true },
         {
         {
           title: '初始库存',
           title: '初始库存',
           dataIndex: 'initialStock',
           dataIndex: 'initialStock',
           width: 80,
           width: 80,
           scopedSlots: { customRender: 'customRenderInitialStock' },
           scopedSlots: { customRender: 'customRenderInitialStock' },
         },
         },
+        { title: '默认采购价', dataIndex: 'defaultPurchaseDecimal', width: 100 },
+        { title: '默认销售价', dataIndex: 'defaultWholesaleDecimal', width: 100 },
         { title: '库存', dataIndex: 'stock', width: 80, scopedSlots: { customRender: 'customRenderStock' } },
         { title: '库存', dataIndex: 'stock', width: 80, scopedSlots: { customRender: 'customRenderStock' } },
-        { title: '采购价', dataIndex: 'purchaseDecimal', width: 80 },
-        { title: '零售价', dataIndex: 'commodityDecimal', width: 80 },
-        { title: '销售价', dataIndex: 'wholesaleDecimal', width: 80 },
-        { title: '最低售价', dataIndex: 'lowDecimal', width: 80 },
-        // { title: '仓位货架', dataIndex: 'position', width: 80 },
+        { title: '预警提示', dataIndex: 'reminder', width: 100, scopedSlots: { customRender: 'reminder' }},
         { title: '备注', dataIndex: 'remark', width: 80 },
         { title: '备注', dataIndex: 'remark', width: 80 },
         {
         {
           title: '状态',
           title: '状态',

+ 83 - 315
jshERP-web/src/views/material/modules/MaterialModal.vue

@@ -21,7 +21,7 @@
         <a-tabs default-active-key="1" size="small">
         <a-tabs default-active-key="1" size="small">
           <a-tab-pane key="1" tab="基本信息" id="materialHeadModal" forceRender>
           <a-tab-pane key="1" tab="基本信息" id="materialHeadModal" forceRender>
             <a-row class="form-row" :gutter="24">
             <a-row class="form-row" :gutter="24">
-              <a-col :md="6" :sm="24">
+              <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <a-form-item
                 <a-form-item
                   :labelCol="labelCol"
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
                   :wrapperCol="wrapperCol"
@@ -37,7 +37,7 @@
                   />
                   />
                 </a-form-item>
                 </a-form-item>
               </a-col>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <a-form-item
                 <a-form-item
                   :labelCol="labelCol"
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
                   :wrapperCol="wrapperCol"
@@ -49,7 +49,7 @@
                   <a-input placeholder="请输入规格" v-decorator.trim="['standard', validatorRules.standard]" />
                   <a-input placeholder="请输入规格" v-decorator.trim="['standard', validatorRules.standard]" />
                 </a-form-item>
                 </a-form-item>
               </a-col>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <a-form-item
                 <a-form-item
                   :labelCol="labelCol"
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
                   :wrapperCol="wrapperCol"
@@ -61,7 +61,7 @@
                   <a-input placeholder="请输入型号" v-decorator.trim="['model', validatorRules.model]" />
                   <a-input placeholder="请输入型号" v-decorator.trim="['model', validatorRules.model]" />
                 </a-form-item>
                 </a-form-item>
               </a-col>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <a-form-item
                 <a-form-item
                   :labelCol="labelCol"
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
                   :wrapperCol="wrapperCol"
@@ -111,42 +111,7 @@
                   </a-row>
                   </a-row>
                 </a-form-item>
                 </a-form-item>
               </a-col>
               </a-col>
-           
-            </a-row>
-            <a-row class="form-row" :gutter="24">
-              <!-- <a-col :md="6" :sm="24" v-if="!model.id">
-                <a-form-item
-                  :labelCol="labelCol"
-                  :wrapperCol="wrapperCol"
-                  label="多属性"
-                  data-step="5"
-                  data-title="多属性"
-                  data-intro="多属性是针对的sku商品(比如服装、鞋帽行业),此处开关如果启用就可以在下方进行多sku的配置,配置具体的颜色、尺码之类的组合"
-                >
-                  <a-tooltip title="多属性针对服装、鞋帽等行业,需要先录入单位才能激活此处输入框">
-                    <a-tag class="tag-info" v-if="!manySkuStatus">需要先录入单位才能激活</a-tag>
-                    <a-select
-                      mode="multiple"
-                      v-decorator="['manySku']"
-                      showSearch
-                      optionFilterProp="children"
-                      placeholder="请选择多属性(可多选)"
-                      @change="onManySkuChange"
-                      v-show="manySkuStatus"
-                    >
-                      <a-select-option
-                        v-for="(item, index) in materialAttributeList"
-                        :key="index"
-                        :value="item.value"
-                        :disabled="item.disabled"
-                      >
-                        {{ item.name }}
-                      </a-select-option>
-                    </a-select>
-                  </a-tooltip>
-                </a-form-item>
-              </a-col> -->
-              <a-col :md="6" :sm="24">
+              <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <a-form-item
                 <a-form-item
                   :labelCol="labelCol"
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
                   :wrapperCol="wrapperCol"
@@ -158,7 +123,7 @@
                   <a-input placeholder="请输入颜色" v-decorator.trim="['color']" />
                   <a-input placeholder="请输入颜色" v-decorator.trim="['color']" />
                 </a-form-item>
                 </a-form-item>
               </a-col>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <a-form-item
                 <a-form-item
                   :labelCol="labelCol"
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
                   :wrapperCol="wrapperCol"
@@ -170,7 +135,7 @@
                   <a-input placeholder="请输入品牌" v-decorator.trim="['brand']" />
                   <a-input placeholder="请输入品牌" v-decorator.trim="['brand']" />
                 </a-form-item>
                 </a-form-item>
               </a-col>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <a-form-item
                 <a-form-item
                   :labelCol="labelCol"
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
                   :wrapperCol="wrapperCol"
@@ -182,7 +147,7 @@
                   <a-input placeholder="" v-decorator.trim="['mnemonic']" :readOnly="true" />
                   <a-input placeholder="" v-decorator.trim="['mnemonic']" :readOnly="true" />
                 </a-form-item>
                 </a-form-item>
               </a-col>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <a-form-item
                 <a-form-item
                   :labelCol="labelCol"
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
                   :wrapperCol="wrapperCol"
@@ -202,9 +167,7 @@
                   </a-tree-select>
                   </a-tree-select>
                 </a-form-item>
                 </a-form-item>
               </a-col>
               </a-col>
-            </a-row>
-            <a-row class="form-row" :gutter="24">
-              <a-col :md="6" :sm="24">
+              <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <a-form-item
                 <a-form-item
                   :labelCol="labelCol"
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
                   :wrapperCol="wrapperCol"
@@ -216,7 +179,7 @@
                   <a-input-number style="width: 100%" placeholder="请输入基础重量(kg)" v-decorator.trim="['weight']" />
                   <a-input-number style="width: 100%" placeholder="请输入基础重量(kg)" v-decorator.trim="['weight']" />
                 </a-form-item>
                 </a-form-item>
               </a-col>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <a-form-item
                 <a-form-item
                   :labelCol="labelCol"
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
                   :wrapperCol="wrapperCol"
@@ -233,7 +196,7 @@
                   </a-tooltip>
                   </a-tooltip>
                 </a-form-item>
                 </a-form-item>
               </a-col>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <a-form-item
                 <a-form-item
                   :labelCol="labelCol"
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
                   :wrapperCol="wrapperCol"
@@ -245,7 +208,7 @@
                   <a-input placeholder="提交后自动生成" disabled v-decorator="['systemSku']" />
                   <a-input placeholder="提交后自动生成" disabled v-decorator="['systemSku']" />
                 </a-form-item>
                 </a-form-item>
               </a-col>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <a-form-item
                 <a-form-item
                   :labelCol="labelCol"
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
                   :wrapperCol="wrapperCol"
@@ -264,74 +227,46 @@
                   </a-tooltip>
                   </a-tooltip>
                 </a-form-item>
                 </a-form-item>
               </a-col>
               </a-col>
-            </a-row>
-            <a-row class="form-row" :gutter="24">
-              <a-col :md="12" :sm="24" v-if="manySkuSelected >= 1">
+              <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <a-form-item
                 <a-form-item
-                  :labelCol="{ xs: { span: 24 }, sm: { span: 4 } }"
-                  :wrapperCol="{ xs: { span: 24 }, sm: { span: 20 } }"
-                  :label="skuOneTitle"
+                  :labelCol="labelCol"
+                  :wrapperCol="wrapperCol"
+                  label="保质期(天)"
+                  data-step="14"
+                  data-title="保质期(天)"
+                  data-intro="保质期(天)"
                 >
                 >
-                  <a-select
-                    mode="multiple"
-                    v-decorator="['skuOne']"
-                    showSearch
-                    optionFilterProp="children"
-                    placeholder="请选择(可多选)"
-                    @select="onSkuChange"
-                    @deselect="onSkuOneDeSelect"
-                  >
-                    <a-select-option v-for="(item, index) in skuOneList" :key="index" :value="item.value">
-                      {{ item.name }}
-                    </a-select-option>
-                  </a-select>
+                  <a-input-number :min="0" v-decorator="['expiryNum']" style="width: 100%;" placeholder="请输入保质期(天)" />
                 </a-form-item>
                 </a-form-item>
               </a-col>
               </a-col>
-              <a-col :md="12" :sm="24" v-if="manySkuSelected >= 2">
+              <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <a-form-item
                 <a-form-item
-                  :labelCol="{ xs: { span: 24 }, sm: { span: 4 } }"
-                  :wrapperCol="{ xs: { span: 24 }, sm: { span: 20 } }"
-                  :label="skuTwoTitle"
-                >
-                  <a-select
-                    mode="multiple"
-                    v-decorator="['skuTwo']"
-                    showSearch
-                    optionFilterProp="children"
-                    placeholder="请选择(可多选)"
-                    @select="onSkuChange"
-                    @deselect="onSkuTwoDeSelect"
-                  >
-                    <a-select-option v-for="(item, index) in skuTwoList" :key="index" :value="item.value">
-                      {{ item.name }}
-                    </a-select-option>
-                  </a-select>
+                  :labelCol="labelCol"
+                  :wrapperCol="wrapperCol"
+                  label="默认采购价"
+                  data-step="15"
+                  data-title="默认采购价"
+                  data-intro="默认采购价"
+                > 
+                  <a-input @blur="$refs.meTable.$forceUpdate()" v-decorator="['defaultPurchaseDecimal',validatorRules.defaultPurchaseDecimal]" style="width: 100%" placeholder="请输入默认采购价" />
                 </a-form-item>
                 </a-form-item>
               </a-col>
               </a-col>
-              <a-col :md="12" :sm="24" v-if="manySkuSelected >= 3">
+              <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <a-form-item
                 <a-form-item
-                  :labelCol="{ xs: { span: 24 }, sm: { span: 4 } }"
-                  :wrapperCol="{ xs: { span: 24 }, sm: { span: 20 } }"
-                  :label="skuThreeTitle"
+                  :labelCol="labelCol"
+                  :wrapperCol="wrapperCol"
+                  label="默认销售价"
+                  data-step="16"
+                  data-title="默认销售价"
+                  data-intro="默认销售价"
                 >
                 >
-                  <a-select
-                    mode="multiple"
-                    v-decorator="['skuThree']"
-                    showSearch
-                    optionFilterProp="children"
-                    placeholder="请选择(可多选)"
-                    @select="onSkuChange"
-                    @deselect="onSkuThreeDeSelect"
-                  >
-                    <a-select-option v-for="(item, index) in skuThreeList" :key="index" :value="item.value">
-                      {{ item.name }}
-                    </a-select-option>
-                  </a-select>
+                  <a-input @blur="$refs.meTable.$forceUpdate()" v-decorator="['defaultWholesaleDecimal',validatorRules.defaultWholesaleDecimal]" style="width: 100%;" placeholder="请输入默认销售价" />
                 </a-form-item>
                 </a-form-item>
               </a-col>
               </a-col>
             </a-row>
             </a-row>
             <div style="margin-top: 8px" id="materialDetailModal">
             <div style="margin-top: 8px" id="materialDetailModal">
               <a-table
               <a-table
+                ref="meTable"
                 size="middle"
                 size="middle"
                 rowKey="id"
                 rowKey="id"
                 :loading="meTable.loading"
                 :loading="meTable.loading"
@@ -348,6 +283,18 @@
                 <template slot="depotId" slot-scope="text, record">
                 <template slot="depotId" slot-scope="text, record">
                   {{ formatDepotName(record.depotId) }}
                   {{ formatDepotName(record.depotId) }}
                 </template>
                 </template>
+                <template slot="purchaseDecimal" slot-scope="text, record">
+                  {{ record.purchaseDecimal }}
+                  <a-tooltip slot="suffix" title="采购价和默认采购价不一致">
+                    <a-icon type="info-circle" style="color: #f5222d" v-show="record.purchaseDecimal!=form.getFieldValue('defaultPurchaseDecimal')" />
+                  </a-tooltip>
+                </template>
+                <template slot="wholesaleDecimal" slot-scope="text, record">
+                  {{ record.wholesaleDecimal }}
+                  <a-tooltip slot="suffix" title="销售价和默认销售价不一致">
+                    <a-icon type="info-circle" style="color: #f5222d" v-show="record.wholesaleDecimal!=form.getFieldValue('defaultWholesaleDecimal')" />
+                  </a-tooltip>
+                </template>
               </a-table>
               </a-table>
             </div>
             </div>
             <a-row class="form-row" :gutter="24">
             <a-row class="form-row" :gutter="24">
@@ -426,7 +373,6 @@
               :actionButton="false"
               :actionButton="false"
             >
             >
               <template #buttonAfter>
               <template #buttonAfter>
-                <!-- <a-button style="margin: 0px 0px 8px 0px" @click="batchSetStock('currentStock')">期初库存-批量</a-button> -->
                 <a-button style="margin: 0px 0px 8px 0px" @click="batchSetStock('lowSafeStock')">最低安全库存-批量</a-button>
                 <a-button style="margin: 0px 0px 8px 0px" @click="batchSetStock('lowSafeStock')">最低安全库存-批量</a-button>
                 <a-button style="margin-left: 8px" @click="batchSetStock('highSafeStock')">最高安全库存-批量</a-button>
                 <a-button style="margin-left: 8px" @click="batchSetStock('highSafeStock')">最高安全库存-批量</a-button>
               </template>
               </template>
@@ -445,7 +391,7 @@
                   <j-image-upload v-model="fileList" bizPath="material" text="上传" isMultiple></j-image-upload>
                   <j-image-upload v-model="fileList" bizPath="material" text="上传" isMultiple></j-image-upload>
                 </a-form-item>
                 </a-form-item>
               </a-col>
               </a-col>
-              <a-col :lg="6" :md="6" :sm="24"></a-col>
+              <a-col :md="6" :sm="24"></a-col>
             </a-row>
             </a-row>
             <a-row class="form-row" :gutter="24">
             <a-row class="form-row" :gutter="24">
               <a-col :lg="18" :md="18" :sm="24">
               <a-col :lg="18" :md="18" :sm="24">
@@ -457,7 +403,7 @@
                   图片最多4张,且单张大小不超过1M
                   图片最多4张,且单张大小不超过1M
                 </a-form-item>
                 </a-form-item>
               </a-col>
               </a-col>
-              <a-col :lg="6" :md="6" :sm="24"></a-col>
+              <a-col :md="6" :sm="24"></a-col>
             </a-row>
             </a-row>
           </a-tab-pane>
           </a-tab-pane>
         </a-tabs>
         </a-tabs>
@@ -482,13 +428,10 @@ import { FormTypes, getRefPromise, VALIDATE_NO_PASSED, validateFormAndTables } f
 import {
 import {
   checkMaterial,
   checkMaterial,
   checkMaterialBarCode,
   checkMaterialBarCode,
-  getMaterialAttributeNameList,
-  getMaterialAttributeValueListById,
-  getMaxBarCode,
   queryMaterialCategoryTreeList,
   queryMaterialCategoryTreeList,
   changeNameToPinYin,
   changeNameToPinYin,
 } from '@/api/api'
 } from '@/api/api'
-import { removeByVal, autoJumpNextInput, handleIntroJs } from '@/utils/util'
+import {  autoJumpNextInput, handleIntroJs } from '@/utils/util'
 import { getAction, httpAction } from '@/api/manage'
 import { getAction, httpAction } from '@/api/manage'
 import JImageUpload from '@/components/jeecg/JImageUpload'
 import JImageUpload from '@/components/jeecg/JImageUpload'
 import JDate from '@/components/jeecg/JDate'
 import JDate from '@/components/jeecg/JDate'
@@ -523,23 +466,9 @@ export default {
       unitList: [],
       unitList: [],
       depotList: [],
       depotList: [],
       fileList: [],
       fileList: [],
-      unitStatus: false,
-      manyUnitStatus: true,
       unitChecked: false,
       unitChecked: false,
-      manySkuStatus: false,
-      switchDisabled: false, //开关的启用状态
-      barCodeSwitch: false, //生成条码开关
-      maxBarCodeInfo: '', //最大条码
       meDeleteIdList: [], //删除条码信息的id数组
       meDeleteIdList: [], //删除条码信息的id数组
       prefixNo: 'material',
       prefixNo: 'material',
-      materialAttributeList: [],
-      skuOneTitle: '属性1',
-      skuTwoTitle: '属性2',
-      skuThreeTitle: '属性3',
-      skuOneList: [],
-      skuTwoList: [],
-      skuThreeList: [],
-      manySkuSelected: 0,
       model: {},
       model: {},
       showOkFlag: true,
       showOkFlag: true,
       setTimeFlag: null,
       setTimeFlag: null,
@@ -572,6 +501,7 @@ export default {
           {
           {
             title: '采购价',
             title: '采购价',
             dataIndex: 'purchaseDecimal',
             dataIndex: 'purchaseDecimal',
+            scopedSlots: { customRender: 'purchaseDecimal' } 
           },
           },
           {
           {
             title: '零售价',
             title: '零售价',
@@ -580,6 +510,7 @@ export default {
           {
           {
             title: '销售价',
             title: '销售价',
             dataIndex: 'wholesaleDecimal',
             dataIndex: 'wholesaleDecimal',
+            scopedSlots: { customRender: 'wholesaleDecimal' } 
           },
           },
           {
           {
             title: '最低售价',
             title: '最低售价',
@@ -590,10 +521,6 @@ export default {
             dataIndex: 'productionDate',
             dataIndex: 'productionDate',
           },
           },
           {
           {
-            title: '保质期(天)',
-            dataIndex: 'expiryNum',
-          },
-          {
             title: '供应商',
             title: '供应商',
             dataIndex: 'supplierId',
             dataIndex: 'supplierId',
             scopedSlots: { customRender: 'supplierId' } 
             scopedSlots: { customRender: 'supplierId' } 
@@ -607,7 +534,10 @@ export default {
             dataIndex: 'depotId',
             dataIndex: 'depotId',
             scopedSlots: { customRender: 'depotId' } 
             scopedSlots: { customRender: 'depotId' } 
           },
           },
-         
+          {
+            title: '库位',
+            dataIndex: 'position',
+          },
         ],
         ],
         pagination: {
         pagination: {
           current: 1,
           current: 1,
@@ -653,6 +583,14 @@ export default {
             type: FormTypes.normal,
             type: FormTypes.normal,
           },
           },
           {
           {
+            title: '期初库存',
+            key: 'number',
+            width: '15%',
+            type: FormTypes.inputNumber,
+            defaultValue: '',
+            placeholder: '请输入${title}',
+          },
+          {
             title: '库存总数量',
             title: '库存总数量',
             key: 'currentStock',
             key: 'currentStock',
             width: '15%',
             width: '15%',
@@ -711,6 +649,12 @@ export default {
         unitId: {
         unitId: {
           rules: [{ required: true, message: '请选择多单位!' }],
           rules: [{ required: true, message: '请选择多单位!' }],
         },
         },
+        defaultWholesaleDecimal: {
+          rules: [{ required: true, message: '请输入默认销售价!' }],
+        },
+        defaultPurchaseDecimal: {
+          rules: [{ required: true, message: '请输入默认采购价!' }],
+        },
       },
       },
       url: {
       url: {
         add: '/material/add',
         add: '/material/add',
@@ -770,13 +714,9 @@ export default {
       this.form.resetFields()
       this.form.resetFields()
       this.model = Object.assign({}, record)
       this.model = Object.assign({}, record)
       this.activeKey = '1'
       this.activeKey = '1'
-      this.manySkuSelected = 0
-      this.barCodeSwitch = false
-      this.manySkuStatus = false
-      this.maxBarCodeInfo = ''
       this.visible = true
       this.visible = true
       this.meDeleteIdList = []
       this.meDeleteIdList = []
-      this.modalStyle = 'top:20px;height: 95%;'
+      this.modalStyle = 'top:0;height: 95%;'
       if (JSON.stringify(record) === '{}') {
       if (JSON.stringify(record) === '{}') {
         this.fileList = []
         this.fileList = []
       } else {
       } else {
@@ -799,6 +739,9 @@ export default {
             'categoryId',
             'categoryId',
             'enableSerialNumber',
             'enableSerialNumber',
             'movingPinReminderCycle',
             'movingPinReminderCycle',
+            'expiryNum',
+            'defaultPurchaseDecimal',
+            'defaultWholesaleDecimal',
             'systemSku',
             'systemSku',
             'weight',
             'weight',
             'remark',
             'remark',
@@ -810,22 +753,15 @@ export default {
         autoJumpNextInput('materialHeadModal')
         autoJumpNextInput('materialHeadModal')
         autoJumpNextInput('materialDetailModal')
         autoJumpNextInput('materialDetailModal')
       })
       })
-      this.initMaterialAttribute()
       this.loadTreeData()
       this.loadTreeData()
       this.loadUnitListData()
       this.loadUnitListData()
       // 加载子表数据
       // 加载子表数据
       if (this.model.id) {
       if (this.model.id) {
-        //禁用多属性开关
-        this.switchDisabled = true
         // 判断是否是多单位
         // 判断是否是多单位
         if (this.model.unit) {
         if (this.model.unit) {
           this.unitChecked = false
           this.unitChecked = false
-          this.unitStatus = false
-          this.manyUnitStatus = true
         } else {
         } else {
           this.unitChecked = true
           this.unitChecked = true
-          this.unitStatus = true
-          this.manyUnitStatus = false
           console.log('多单位-----', record)
           console.log('多单位-----', record)
           await this.getUnitListByID(record.unitId)
           await this.getUnitListByID(record.unitId)
         }
         }
@@ -834,7 +770,6 @@ export default {
         this.requestMeTableData()
         this.requestMeTableData()
         this.requestDepotTableData(this.url.depotWithStock, { mId: this.model.id }, this.depotTable)
         this.requestDepotTableData(this.url.depotWithStock, { mId: this.model.id }, this.depotTable)
       } else {
       } else {
-        this.switchDisabled = false
         this.requestDepotTableData(this.url.depotWithStock, { mId: 0 }, this.depotTable)
         this.requestDepotTableData(this.url.depotWithStock, { mId: 0 }, this.depotTable)
       }
       }
     },
     },
@@ -882,7 +817,10 @@ export default {
       tab.loading = true
       tab.loading = true
       getAction(url, params)
       getAction(url, params)
         .then((res) => {
         .then((res) => {
-          tab.dataSource = res.data || []
+          tab.dataSource = (res.data || []).map(item => {
+            item.number = item.initStock
+            return item
+          })
           console.log('====================', res.data)
           console.log('====================', res.data)
         })
         })
         .finally(() => {
         .finally(() => {
@@ -893,9 +831,9 @@ export default {
       this.$emit('close')
       this.$emit('close')
       this.visible = false
       this.visible = false
       this.modalStyle = ''
       this.modalStyle = ''
-      this.unitStatus = false
-      this.manyUnitStatus = true
       this.unitChecked = false
       this.unitChecked = false
+      this.meTable.dataSource = []
+      this.meTable.pagination.current = 1
       this.getAllTable().then((editableTables) => {
       this.getAllTable().then((editableTables) => {
         editableTables[0].initialize()
         editableTables[0].initialize()
         editableTables[1].initialize()
         editableTables[1].initialize()
@@ -1137,151 +1075,6 @@ export default {
         }
         }
       })
       })
     },
     },
-    onManySkuChange(value) {
-      this.manySkuSelected = value.length
-      //控制多属性下拉框中选择项的状态
-      if (value.length < 3) {
-        this.materialAttributeList.forEach((item, index, array) => {
-          array.indexOf(item.value) === -1 ? Vue.set(array[index], 'disabled', false) : ''
-        })
-      } else {
-        this.materialAttributeList.forEach((item, index, array) => {
-          value.indexOf(item.value) === -1 ? Vue.set(array[index], 'disabled', true) : ''
-        })
-      }
-      //更新属性1和属性2和属性3的下拉框
-      if (value.length <= 3) {
-        let skuOneId = value[0]
-        let skuTwoId = value[1]
-        let skuThreeId = value[2]
-        this.materialAttributeList.forEach((item) => {
-          if (item.value === skuOneId) {
-            this.skuOneTitle = item.name
-          }
-          if (item.value === skuTwoId) {
-            this.skuTwoTitle = item.name
-          }
-          if (item.value === skuThreeId) {
-            this.skuThreeTitle = item.name
-          }
-        })
-        if (skuOneId) {
-          getMaterialAttributeValueListById({ id: skuOneId }).then((res) => {
-            this.skuOneList = res ? res : []
-          })
-        }
-        if (skuTwoId) {
-          getMaterialAttributeValueListById({ id: skuTwoId }).then((res) => {
-            this.skuTwoList = res ? res : []
-          })
-        }
-        if (skuThreeId) {
-          getMaterialAttributeValueListById({ id: skuThreeId }).then((res) => {
-            this.skuThreeList = res ? res : []
-          })
-        }
-      }
-      this.barCodeSwitch = false
-      this.meTable.dataSource = []
-    },
-    onSkuChange() {
-      let skuOneData = this.form.getFieldValue('skuOne')
-      let skuTwoData = this.form.getFieldValue('skuTwo')
-      let skuThreeData = this.form.getFieldValue('skuThree')
-      this.autoSkuList(skuOneData, skuTwoData, skuThreeData)
-    },
-    onSkuOneDeSelect(value) {
-      let skuOneData = this.form.getFieldValue('skuOne')
-      let skuTwoData = this.form.getFieldValue('skuTwo')
-      let skuThreeData = this.form.getFieldValue('skuThree')
-      removeByVal(skuOneData, value)
-      this.autoSkuList(skuOneData, skuTwoData, skuThreeData)
-    },
-    onSkuTwoDeSelect(value) {
-      let skuOneData = this.form.getFieldValue('skuOne')
-      let skuTwoData = this.form.getFieldValue('skuTwo')
-      let skuThreeData = this.form.getFieldValue('skuThree')
-      removeByVal(skuTwoData, value)
-      this.autoSkuList(skuOneData, skuTwoData, skuThreeData)
-    },
-    onSkuThreeDeSelect(value) {
-      let skuOneData = this.form.getFieldValue('skuOne')
-      let skuTwoData = this.form.getFieldValue('skuTwo')
-      let skuThreeData = this.form.getFieldValue('skuThree')
-      removeByVal(skuThreeData, value)
-      this.autoSkuList(skuOneData, skuTwoData, skuThreeData)
-    },
-    autoSkuList(skuOneData, skuTwoData, skuThreeData) {
-      let unit = this.form.getFieldValue('unit')
-      if (unit) {
-        //计算多属性已经选择了几个
-        let skuArr = []
-        if (this.getNumByField('skuOne')) {
-          skuArr.push(skuOneData)
-        }
-        if (this.getNumByField('skuTwo')) {
-          skuArr.push(skuTwoData)
-        }
-        if (this.getNumByField('skuThree')) {
-          skuArr.push(skuThreeData)
-        }
-        let skuArrOne = skuArr[0]
-        let skuArrTwo = skuArr[1]
-        let skuArrThree = skuArr[2]
-        let count = this.getNumByField('skuOne') + this.getNumByField('skuTwo') + this.getNumByField('skuThree')
-        let barCodeSku = []
-        if (count === 1) {
-          let skuArrOnly = []
-          if (this.getNumByField('skuOne')) {
-            skuArrOnly = skuOneData
-          } else if (this.getNumByField('skuTwo')) {
-            skuArrOnly = skuTwoData
-          } else if (this.getNumByField('skuThree')) {
-            skuArrOnly = skuThreeData
-          }
-          for (let i = 0; i < skuArrOnly.length; i++) {
-            barCodeSku.push(skuArrOnly[i])
-          }
-        } else if (count === 2) {
-          for (let i = 0; i < skuArrOne.length; i++) {
-            for (let j = 0; j < skuArrTwo.length; j++) {
-              barCodeSku.push(skuArrOne[i] + '/' + skuArrTwo[j])
-            }
-          }
-        } else if (count === 3) {
-          for (let i = 0; i < skuArrOne.length; i++) {
-            for (let j = 0; j < skuArrTwo.length; j++) {
-              for (let k = 0; k < skuArrThree.length; k++) {
-                barCodeSku.push(skuArrOne[i] + '/' + skuArrTwo[j] + '/' + skuArrThree[k])
-              }
-            }
-          }
-        }
-        let meTableData = []
-        getMaxBarCode({}).then((res) => {
-          if (res && res.code === 200) {
-            let maxBarCode = res.data.barCode - 0
-            for (let i = 0; i < barCodeSku.length; i++) {
-              let currentBarCode = maxBarCode + i + 1
-              meTableData.push({ barCode: currentBarCode, commodityUnit: unit, sku: barCodeSku[i] })
-            }
-            this.meTable.dataSource = meTableData
-          }
-        })
-      } else {
-        this.$message.warning('请填写单位(注意不要勾选多单位)')
-        this.barCodeSwitch = false
-      }
-    },
-    getNumByField(field) {
-      let num = 0
-      if (this.form.getFieldValue(field)) {
-        if (this.form.getFieldValue(field).length > 0) {
-          num = 1
-        }
-      }
-      return num
-    },
     onAdded(event) {
     onAdded(event) {
       const { row, target } = event
       const { row, target } = event
       // 不勾选多单位
       // 不勾选多单位
@@ -1296,14 +1089,6 @@ export default {
       // this.meDeleteIdList = value
       // this.meDeleteIdList = value
       console.log('onDeleted', value)
       console.log('onDeleted', value)
     },
     },
-    // batchSetPrice(type) {
-    //   if (this.manySkuSelected > 0 || this.model.id) {
-    //     this.$refs.priceModalForm.add(type)
-    //     this.$refs.priceModalForm.disableSubmit = false
-    //   } else {
-    //     this.$message.warning('抱歉,只有开启多属性才能进行批量操作!')
-    //   }
-    // },
     batchSetStock(type) {
     batchSetStock(type) {
       this.$refs.stockModalForm.add(type)
       this.$refs.stockModalForm.add(type)
       this.$refs.stockModalForm.disableSubmit = false
       this.$refs.stockModalForm.disableSubmit = false
@@ -1332,13 +1117,6 @@ export default {
       }
       }
       this.depotTable.dataSource = depotTableData
       this.depotTable.dataSource = depotTableData
     },
     },
-    initMaterialAttribute() {
-      getMaterialAttributeNameList().then((res) => {
-        if (res) {
-          this.materialAttributeList = res
-        }
-      })
-    },
     loadParseMaterialProperty() {
     loadParseMaterialProperty() {
       let mpList = Vue.ls.get('materialPropertyList')
       let mpList = Vue.ls.get('materialPropertyList')
       for (let i = 0; i < mpList.length; i++) {
       for (let i = 0; i < mpList.length; i++) {
@@ -1380,12 +1158,6 @@ export default {
       }
       }
     },
     },
     onlyUnitOnChange(e) {
     onlyUnitOnChange(e) {
-      if (e.target.value) {
-        //单位有填写了之后则显示多属性的文本框
-        this.manySkuStatus = true
-      } else {
-        this.manySkuStatus = false
-      }
       console.log('onlyUnitOnChange=======',e.target.value)
       console.log('onlyUnitOnChange=======',e.target.value)
       this.$refs.editableProBarCodeTable.getValues((error, values) => {
       this.$refs.editableProBarCodeTable.getValues((error, values) => {
         let mArr = values
         let mArr = values
@@ -1404,12 +1176,8 @@ export default {
     unitOnChange(e) {
     unitOnChange(e) {
       let isChecked = e.target.checked
       let isChecked = e.target.checked
       if (isChecked) {
       if (isChecked) {
-        this.unitStatus = true
-        this.manyUnitStatus = false
         this.unitChecked = true
         this.unitChecked = true
       } else {
       } else {
-        this.unitStatus = false
-        this.manyUnitStatus = true
         this.unitChecked = false
         this.unitChecked = false
       }
       }
 
 

+ 3 - 9
jshERP-web/src/views/stock/CheckList.vue

@@ -12,14 +12,6 @@
         ></filter-form>
         ></filter-form>
         <div style="margin-bottom: 6px">
         <div style="margin-bottom: 6px">
           <a-button :disabled="!selectedRowKeys.length" type="primary" @click="onStartTask">开始盘点</a-button>
           <a-button :disabled="!selectedRowKeys.length" type="primary" @click="onStartTask">开始盘点</a-button>
-
-          <!-- <a-popconfirm style="margin: 0 6px" title="确定取消选中的盘点任务吗?" @confirm="() => cancelTask()">
-            <a-button :disabled="!selectedRowKeys.length">取消盘点</a-button>
-          </a-popconfirm>
-          <a-popconfirm title="确定删除选中的盘点任务吗?" @confirm="() => handleDelete()">
-            <a-button :disabled="!selectedRowKeys.length">批量删除</a-button>
-          </a-popconfirm> -->
-          <!-- <a-button style="margin-left: 6px">导出任务</a-button> -->
         </div>
         </div>
         <a-table
         <a-table
           ref="table"
           ref="table"
@@ -233,4 +225,6 @@ export default {
 }
 }
 </script>
 </script>
 
 
-<style></style>
+<style scoped>
+@import '~@assets/less/common.less';
+</style>

+ 3 - 2
jshERP-web/src/views/stock/TaskList.vue

@@ -78,7 +78,6 @@
 </template>
 </template>
 
 
 <script>
 <script>
-// import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import FilterForm from './components/FilterForm.vue'
 import FilterForm from './components/FilterForm.vue'
 import table from './utils/table'
 import table from './utils/table'
 import StockModal from './components/stockModal.vue'
 import StockModal from './components/stockModal.vue'
@@ -240,4 +239,6 @@ export default {
 }
 }
 </script>
 </script>
 
 
-<style></style>
+<style scoped>
+@import '~@assets/less/common.less';
+</style>

+ 17 - 8
jshERP-web/src/views/stock/components/checkModal.vue

@@ -1,6 +1,17 @@
 <template>
 <template>
-  <div>
-    <a-modal @cancel="handleCancel" :visible="stockVisible" :title="title" width="90%">
+  <div ref="container">
+    <a-modal 
+      :title="title" 
+      width="100%"
+      @cancel="handleCancel" 
+      :visible="stockVisible"
+      :confirmLoading="confirmLoading"
+      :getContainer="() => $refs.container" 
+      :wrapClassName="wrapClassNameInfo()"
+      :mask="isDesktop()"
+      :maskClosable="false"
+      style="top: 0; height: 100%" 
+    >
       <a-spin :spinning="confirmLoading">
       <a-spin :spinning="confirmLoading">
         <edit-form
         <edit-form
           :spinnerList="spinnerList"
           :spinnerList="spinnerList"
@@ -129,22 +140,20 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import { findBySelectOrgan, queryMaterialCategoryTreeList, getAllOrganizationTreeByUser } from '@/api/api'
+import {  queryMaterialCategoryTreeList } from '@/api/api'
 
 
 import editForm from './editForm.vue'
 import editForm from './editForm.vue'
 import table from '../utils/table'
 import table from '../utils/table'
 import JSelectMaterialModal from '../../../components/jeecgbiz/modal/JSelectMaterialModal.vue'
 import JSelectMaterialModal from '../../../components/jeecgbiz/modal/JSelectMaterialModal.vue'
 import { getAction, postAction } from '@/api/manage'
 import { getAction, postAction } from '@/api/manage'
-import { getMaterialByBatchNumber } from '@/api/api'
 import { newTableMixin } from '@/mixins/newTableMixin'
 import { newTableMixin } from '@/mixins/newTableMixin'
 import { Modal } from 'ant-design-vue'
 import { Modal } from 'ant-design-vue'
+import { mixinDevice } from '@/utils/mixin'
 
 
-// import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-// import { Form } from 'ant-design-vue'
-// const useForm = Form.useForm
 export default {
 export default {
+  name: 'CheckModal',
   components: { editForm, JSelectMaterialModal },
   components: { editForm, JSelectMaterialModal },
-  mixins: [newTableMixin],
+  mixins: [ newTableMixin, mixinDevice ],
   props: {
   props: {
     rules: {
     rules: {
       type: Object,
       type: Object,

+ 3 - 3
jshERP-web/src/views/stock/components/editForm.vue

@@ -73,7 +73,7 @@
       </a-col>
       </a-col>
       <a-col :xl="6" :lg="8" :md="12" :sm="24" class="form-col">
       <a-col :xl="6" :lg="8" :md="12" :sm="24" class="form-col">
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="盘点状态">
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="盘点状态">
-          <a-select placeholder="请选择" v-decorator="['taskStatus']" :options="taskStatusList" :disabled="isDisabled">
+          <a-select placeholder="请选择" v-decorator="['taskStatus']" :options="taskStatusList" :disabled="true">
           </a-select>
           </a-select>
         </a-form-item>
         </a-form-item>
       </a-col>
       </a-col>
@@ -136,11 +136,11 @@ export default {
       ],
       ],
       labelCol: {
       labelCol: {
         xs: { span: 24 },
         xs: { span: 24 },
-        sm: { span: 8 },
+        sm: { span: 9 },
       },
       },
       wrapperCol: {
       wrapperCol: {
         xs: { span: 24 },
         xs: { span: 24 },
-        sm: { span: 16 },
+        sm: { span: 15 },
       },
       },
       taskTypeList: [
       taskTypeList: [
         { value: 1, label: '全盘' },
         { value: 1, label: '全盘' },

+ 20 - 7
jshERP-web/src/views/stock/components/stockModal.vue

@@ -1,6 +1,17 @@
 <template>
 <template>
-  <div>
-    <a-modal @cancel="handleCancel" :visible="stockVisible" :title="title" width="90%">
+  <div ref="container">
+    <a-modal 
+      :title="title" 
+      width="100%" 
+      @cancel="handleCancel" 
+      :visible="stockVisible" 
+      :confirmLoading="confirmLoading"
+      :getContainer="() => $refs.container" 
+      :wrapClassName="wrapClassNameInfo()"
+      :mask="isDesktop()"
+      :maskClosable="false"
+      style="top: 0; height: 100%"
+    >
       <a-spin :spinning="confirmLoading">
       <a-spin :spinning="confirmLoading">
         <edit-form
         <edit-form
           :spinnerList="spinnerList"
           :spinnerList="spinnerList"
@@ -68,14 +79,13 @@ import editForm from './editForm.vue'
 import table from '../utils/table'
 import table from '../utils/table'
 import JSelectMaterialModal from '../../../components/jeecgbiz/modal/JSelectMaterialModal2.vue'
 import JSelectMaterialModal from '../../../components/jeecgbiz/modal/JSelectMaterialModal2.vue'
 import { getAction, postAction } from '@/api/manage'
 import { getAction, postAction } from '@/api/manage'
-import { getMaterialByBatchNumber } from '@/api/api'
 import { newTableMixin } from '@/mixins/newTableMixin'
 import { newTableMixin } from '@/mixins/newTableMixin'
-// import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-// import { Form } from 'ant-design-vue'
-// const useForm = Form.useForm
+import { mixinDevice } from '@/utils/mixin'
+
 export default {
 export default {
+  name: 'StockModal',
   components: { editForm, JSelectMaterialModal },
   components: { editForm, JSelectMaterialModal },
-  mixins: [newTableMixin],
+  mixins: [ newTableMixin, mixinDevice ],
   props: {
   props: {
     rules: {
     rules: {
       type: Object,
       type: Object,
@@ -165,6 +175,9 @@ export default {
           if (params.taskType === 2) {
           if (params.taskType === 2) {
             params.materialExtendIdList = this.dataSource.map((item) => item.batchNumber)
             params.materialExtendIdList = this.dataSource.map((item) => item.batchNumber)
           }
           }
+          if(this.openType != 'add') {
+            params.id = this.taskId
+          }
           const url = this.openType === 'add' ? this.url.add : this.url.update
           const url = this.openType === 'add' ? this.url.add : this.url.update
           postAction(url, params).then((res) => {
           postAction(url, params).then((res) => {
             if (res.code === 200) {
             if (res.code === 200) {

+ 15 - 3
jshERP-web/src/views/system/VendorList.vue

@@ -1,7 +1,7 @@
 <template>
 <template>
   <a-row :gutter="24">
   <a-row :gutter="24">
     <a-col :md="24">
     <a-col :md="24">
-      <a-card :style="cardStyle" :bordered="false">
+      <a-card :bordered="false">
         <!-- 查询区域 -->
         <!-- 查询区域 -->
         <div class="table-page-search-wrapper">
         <div class="table-page-search-wrapper">
           <!-- 搜索区域 -->
           <!-- 搜索区域 -->
@@ -146,21 +146,33 @@ export default {
           align: 'center',
           align: 'center',
           scopedSlots: { customRender: 'action' },
           scopedSlots: { customRender: 'action' },
         },
         },
+        { title: '供应商编码', dataIndex: 'serialNo', width: 150, align: 'left' },
         { title: '名称', dataIndex: 'supplier', width: 150, align: 'left' },
         { title: '名称', dataIndex: 'supplier', width: 150, align: 'left' },
         { title: '联系人', dataIndex: 'contacts', width: 70, align: 'left' },
         { title: '联系人', dataIndex: 'contacts', width: 70, align: 'left' },
         { title: '手机号码', dataIndex: 'telephone', width: 100, align: 'left' },
         { title: '手机号码', dataIndex: 'telephone', width: 100, align: 'left' },
         { title: '联系电话', dataIndex: 'phoneNum', width: 100, align: 'left' },
         { title: '联系电话', dataIndex: 'phoneNum', width: 100, align: 'left' },
         { title: '电子邮箱', dataIndex: 'email', width: 150, align: 'left' },
         { title: '电子邮箱', dataIndex: 'email', width: 150, align: 'left' },
         { title: '税率(%)', dataIndex: 'taxRate', width: 80, align: 'left' },
         { title: '税率(%)', dataIndex: 'taxRate', width: 80, align: 'left' },
+        { title: '是否支持售后', dataIndex: 'isAfterSales', width: 110, align: 'left',customRender: function (t, r, index) {
+            switch (r.isAfterSales) {
+              case '1':
+                return '是'
+              case '0':
+                return '否'
+              default:
+                return ''
+            }
+          }, },
+        { title: '售后规则', dataIndex: 'afterSalesRules', width: 100, align: 'left' },
         { title: '供应商分级', dataIndex: 'supplierLevel', width: 100, align: 'left' },
         { title: '供应商分级', dataIndex: 'supplierLevel', width: 100, align: 'left' },
         {
         {
-          title: '结算方式',
+          title: '结算周期',
           dataIndex: 'settlementMethod',
           dataIndex: 'settlementMethod',
           width: 80,
           width: 80,
           align: 'left',
           align: 'left',
           scopedSlots: { customRender: 'settlementMethod' },
           scopedSlots: { customRender: 'settlementMethod' },
         },
         },
-        { title: '账单周期', dataIndex: 'billingCycleDays', width: 80, align: 'left' },
+        { title: '付款方式', dataIndex: 'billingCycleDays', width: 80, align: 'left' },
         { title: '采购对接人', dataIndex: 'procurementContact', width: 100, align: 'left' },
         { title: '采购对接人', dataIndex: 'procurementContact', width: 100, align: 'left' },
         { title: '到货天数', dataIndex: 'deliveryDays', width: 80, align: 'left' },
         { title: '到货天数', dataIndex: 'deliveryDays', width: 80, align: 'left' },
         {
         {

+ 10 - 4
jshERP-web/src/views/system/modules/CustomerModal.vue

@@ -32,8 +32,6 @@
                 <a-input placeholder="请输入联系人" v-decorator.trim="['contacts']" />
                 <a-input placeholder="请输入联系人" v-decorator.trim="['contacts']" />
               </a-form-item>
               </a-form-item>
             </a-col>
             </a-col>
-          </a-row>
-          <a-row class="form-row" :gutter="24">
             <a-col :span="24 / 2">
             <a-col :span="24 / 2">
               <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="手机号码">
               <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="手机号码">
                 <a-input placeholder="请输入手机号码" v-decorator.trim="['telephone', validatorRules.telephone]" />
                 <a-input placeholder="请输入手机号码" v-decorator.trim="['telephone', validatorRules.telephone]" />
@@ -131,7 +129,10 @@ export default {
       form: this.$form.createForm(this),
       form: this.$form.createForm(this),
       validatorRules: {
       validatorRules: {
         telephone: {
         telephone: {
-          rules: [{ required: true, message: '请输入手机号!' }],
+          rules: [
+            { required: true, message: '请输入手机号!' },
+            { pattern: /^(?:\+?86)?1[3-9]\d{9}$/, message: '手机号格式不正确!' },
+          ],
         },
         },
         supplier: {
         supplier: {
           rules: [
           rules: [
@@ -238,4 +239,9 @@ export default {
   },
   },
 }
 }
 </script>
 </script>
-<style scoped></style>
+<style scoped>
+.form-row{
+  display: flex;
+  flex-wrap: wrap;
+}
+</style>

+ 22 - 14
jshERP-web/src/views/system/modules/RolePushBtnModal.vue

@@ -55,54 +55,54 @@
             :dataSource="dataSource"
             :dataSource="dataSource"
             :loading="loading"
             :loading="loading"
           >
           >
-            <span slot="action" slot-scope="text, record">
+            <span slot="action" slot-scope="text, record, index">
               <a-checkbox
               <a-checkbox
                 v-if="record.pushBtn.indexOf(1) > -1"
                 v-if="record.pushBtn.indexOf(1) > -1"
                 value="1"
                 value="1"
                 :checked="record.btnStr ? record.btnStr.indexOf(1) > -1 : false"
                 :checked="record.btnStr ? record.btnStr.indexOf(1) > -1 : false"
-                @change="onChange(record, '1')"
+                @change="onChange(record, '1', index)"
                 >编辑</a-checkbox
                 >编辑</a-checkbox
               >
               >
               <a-checkbox
               <a-checkbox
                 v-if="record.pushBtn.indexOf(2) > -1"
                 v-if="record.pushBtn.indexOf(2) > -1"
                 value="2"
                 value="2"
                 :checked="record.btnStr ? record.btnStr.indexOf(2) > -1 : false"
                 :checked="record.btnStr ? record.btnStr.indexOf(2) > -1 : false"
-                @change="onChange(record, '2')"
+                @change="onChange(record, '2', index)"
                 >审核</a-checkbox
                 >审核</a-checkbox
               >
               >
               <a-checkbox
               <a-checkbox
                 v-if="record.pushBtn.indexOf(7) > -1"
                 v-if="record.pushBtn.indexOf(7) > -1"
                 value="7"
                 value="7"
                 :checked="record.btnStr ? record.btnStr.indexOf(7) > -1 : false"
                 :checked="record.btnStr ? record.btnStr.indexOf(7) > -1 : false"
-                @change="onChange(record, '7')"
+                @change="onChange(record, '7', index)"
                 >反审核</a-checkbox
                 >反审核</a-checkbox
               >
               >
               <a-checkbox
               <a-checkbox
                 v-if="record.pushBtn.indexOf(3) > -1"
                 v-if="record.pushBtn.indexOf(3) > -1"
                 value="3"
                 value="3"
                 :checked="record.btnStr ? record.btnStr.indexOf(3) > -1 : false"
                 :checked="record.btnStr ? record.btnStr.indexOf(3) > -1 : false"
-                @change="onChange(record, '3')"
+                @change="onChange(record, '3', index)"
                 >导出</a-checkbox
                 >导出</a-checkbox
               >
               >
               <a-checkbox
               <a-checkbox
                 v-if="record.pushBtn.indexOf(4) > -1"
                 v-if="record.pushBtn.indexOf(4) > -1"
                 value="4"
                 value="4"
                 :checked="record.btnStr ? record.btnStr.indexOf(4) > -1 : false"
                 :checked="record.btnStr ? record.btnStr.indexOf(4) > -1 : false"
-                @change="onChange(record, '4')"
+                @change="onChange(record, '4', index)"
                 >启用禁用</a-checkbox
                 >启用禁用</a-checkbox
               >
               >
               <a-checkbox
               <a-checkbox
                 v-if="record.pushBtn.indexOf(5) > -1"
                 v-if="record.pushBtn.indexOf(5) > -1"
                 value="5"
                 value="5"
                 :checked="record.btnStr ? record.btnStr.indexOf(5) > -1 : false"
                 :checked="record.btnStr ? record.btnStr.indexOf(5) > -1 : false"
-                @change="onChange(record, '5')"
+                @change="onChange(record, '5', index)"
                 >打印</a-checkbox
                 >打印</a-checkbox
               >
               >
               <a-checkbox
               <a-checkbox
                 v-if="record.pushBtn.indexOf(6) > -1"
                 v-if="record.pushBtn.indexOf(6) > -1"
                 value="6"
                 value="6"
                 :checked="record.btnStr ? record.btnStr.indexOf(6) > -1 : false"
                 :checked="record.btnStr ? record.btnStr.indexOf(6) > -1 : false"
-                @change="onChange(record, '6')"
+                @change="onChange(record, '6', index)"
                 >作废</a-checkbox
                 >作废</a-checkbox
               >
               >
             </span>
             </span>
@@ -233,7 +233,7 @@ export default {
     },
     },
     toggleChecked() {
     toggleChecked() {
       this.checked = !this.checked
       this.checked = !this.checked
-      let funArray = this.dataSource
+      let funArray = this.dataSource.slice()
       if (this.checked) {
       if (this.checked) {
         for (let item of funArray) {
         for (let item of funArray) {
           item.btnStr = item.pushBtn
           item.btnStr = item.pushBtn
@@ -243,10 +243,11 @@ export default {
           item.btnStr = ''
           item.btnStr = ''
         }
         }
       }
       }
+      this.dataSource = funArray
     },
     },
     editToggleChecked() {
     editToggleChecked() {
       this.editChecked = !this.editChecked
       this.editChecked = !this.editChecked
-      let funArray = this.dataSource
+      let funArray = this.dataSource.slice()
       if (this.editChecked) {
       if (this.editChecked) {
         for (let item of funArray) {
         for (let item of funArray) {
           item.btnStr = this.parseArrByParam(1, item.btnStr, 1)
           item.btnStr = this.parseArrByParam(1, item.btnStr, 1)
@@ -256,10 +257,11 @@ export default {
           item.btnStr = this.parseArrByParam(1, item.btnStr, 0)
           item.btnStr = this.parseArrByParam(1, item.btnStr, 0)
         }
         }
       }
       }
+      this.dataSource = funArray
     },
     },
     auditToggleChecked() {
     auditToggleChecked() {
       this.auditChecked = !this.auditChecked
       this.auditChecked = !this.auditChecked
-      let funArray = this.dataSource
+      let funArray = this.dataSource.slice()
       if (this.auditChecked) {
       if (this.auditChecked) {
         for (let item of funArray) {
         for (let item of funArray) {
           item.btnStr = this.parseArrByParam(2, item.btnStr, 1)
           item.btnStr = this.parseArrByParam(2, item.btnStr, 1)
@@ -269,10 +271,11 @@ export default {
           item.btnStr = this.parseArrByParam(2, item.btnStr, 0)
           item.btnStr = this.parseArrByParam(2, item.btnStr, 0)
         }
         }
       }
       }
+      this.dataSource = funArray
     },
     },
     unAuditToggleChecked() {
     unAuditToggleChecked() {
       this.unAuditChecked = !this.unAuditChecked
       this.unAuditChecked = !this.unAuditChecked
-      let funArray = this.dataSource
+      let funArray = this.dataSource.slice()
       if (this.unAuditChecked) {
       if (this.unAuditChecked) {
         for (let item of funArray) {
         for (let item of funArray) {
           item.btnStr = this.parseArrByParam(7, item.btnStr, 1)
           item.btnStr = this.parseArrByParam(7, item.btnStr, 1)
@@ -282,10 +285,11 @@ export default {
           item.btnStr = this.parseArrByParam(7, item.btnStr, 0)
           item.btnStr = this.parseArrByParam(7, item.btnStr, 0)
         }
         }
       }
       }
+      this.dataSource = funArray
     },
     },
     exportToggleChecked() {
     exportToggleChecked() {
       this.exportChecked = !this.exportChecked
       this.exportChecked = !this.exportChecked
-      let funArray = this.dataSource
+      let funArray = this.dataSource.slice()
       if (this.exportChecked) {
       if (this.exportChecked) {
         for (let item of funArray) {
         for (let item of funArray) {
           item.btnStr = this.parseArrByParam(3, item.btnStr, 1)
           item.btnStr = this.parseArrByParam(3, item.btnStr, 1)
@@ -295,6 +299,7 @@ export default {
           item.btnStr = this.parseArrByParam(3, item.btnStr, 0)
           item.btnStr = this.parseArrByParam(3, item.btnStr, 0)
         }
         }
       }
       }
+      this.dataSource = funArray
     },
     },
     /**
     /**
      * 格式转换,控制按钮的显示或隐藏
      * 格式转换,控制按钮的显示或隐藏
@@ -324,7 +329,7 @@ export default {
       }
       }
       return btnStr
       return btnStr
     },
     },
-    onChange(record, value) {
+    onChange(record, value, index) {
       let funArray = this.dataSource
       let funArray = this.dataSource
       for (let item of funArray) {
       for (let item of funArray) {
         if (item.id === record.id) {
         if (item.id === record.id) {
@@ -335,16 +340,19 @@ export default {
               //去掉勾选
               //去掉勾选
               removeByVal(btnArr, value)
               removeByVal(btnArr, value)
               item.btnStr = btnArr.join()
               item.btnStr = btnArr.join()
+              this.$set(this.dataSource, index, item)
             } else {
             } else {
               //勾选
               //勾选
               btnArr.push(value)
               btnArr.push(value)
               item.btnStr = btnArr.join()
               item.btnStr = btnArr.join()
+              this.$set(this.dataSource, index, item)
             }
             }
           } else {
           } else {
             let btnArr = []
             let btnArr = []
             //勾选
             //勾选
             btnArr.push(value)
             btnArr.push(value)
             item.btnStr = btnArr.join()
             item.btnStr = btnArr.join()
+            this.$set(this.dataSource, index, item)
           }
           }
         }
         }
       }
       }

+ 39 - 35
jshERP-web/src/views/system/modules/VendorModal.vue

@@ -2,7 +2,7 @@
   <div ref="container">
   <div ref="container">
     <a-modal
     <a-modal
       :title="title"
       :title="title"
-      :width="1200"
+      width="100%"
       :visible="visible"
       :visible="visible"
       :confirmLoading="confirmLoading"
       :confirmLoading="confirmLoading"
       :getContainer="() => $refs.container"
       :getContainer="() => $refs.container"
@@ -14,7 +14,7 @@
       @cancel="handleCancel"
       @cancel="handleCancel"
       cancelText="取消"
       cancelText="取消"
       okText="保存"
       okText="保存"
-      style="top: 10%"
+      style="top: 0; height: 100%"
     >
     >
       <template slot="footer">
       <template slot="footer">
         <a-button key="back" v-if="isReadOnly" @click="handleCancel"> 取消 </a-button>
         <a-button key="back" v-if="isReadOnly" @click="handleCancel"> 取消 </a-button>
@@ -23,6 +23,11 @@
         <a-form :form="form" id="vendorModal">
         <a-form :form="form" id="vendorModal">
           <a-row class="form-row" :gutter="24">
           <a-row class="form-row" :gutter="24">
             <a-col :span="24 / 2">
             <a-col :span="24 / 2">
+              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="供应商编码">
+                <a-input placeholder="自动生成" v-decorator.trim="['serialNo']" disabled />
+              </a-form-item>
+            </a-col>
+            <a-col :span="24 / 2">
               <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="名称">
               <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="名称">
                 <a-input placeholder="请输入名称" v-decorator.trim="['supplier', validatorRules.supplier]" />
                 <a-input placeholder="请输入名称" v-decorator.trim="['supplier', validatorRules.supplier]" />
               </a-form-item>
               </a-form-item>
@@ -32,8 +37,6 @@
                 <a-input placeholder="请输入联系人" v-decorator.trim="['contacts']" />
                 <a-input placeholder="请输入联系人" v-decorator.trim="['contacts']" />
               </a-form-item>
               </a-form-item>
             </a-col>
             </a-col>
-          </a-row>
-          <a-row class="form-row" :gutter="24">
             <a-col :span="24 / 2">
             <a-col :span="24 / 2">
               <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="手机号码">
               <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="手机号码">
                 <a-input placeholder="请输入手机号码" v-decorator.trim="['telephone']" />
                 <a-input placeholder="请输入手机号码" v-decorator.trim="['telephone']" />
@@ -45,26 +48,6 @@
               </a-form-item>
               </a-form-item>
             </a-col>
             </a-col>
             <a-col :span="24 / 2">
             <a-col :span="24 / 2">
-              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="电子邮箱">
-                <a-input placeholder="请输入电子邮箱" v-decorator.trim="['email']" />
-              </a-form-item>
-            </a-col>
-            <!-- <a-col :span="24 / 2">
-              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="传真">
-                <a-input placeholder="请输入传真" v-decorator.trim="['fax']" />
-              </a-form-item>
-            </a-col> -->
-            <!-- <a-col :span="24 / 2">
-              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="期初应付">
-                <a-input placeholder="请输入期初应付" v-decorator.trim="['beginNeedPay']" />
-              </a-form-item>
-            </a-col> -->
-            <!-- <a-col :span="24 / 2">
-              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="期末应付">
-                <a-input v-decorator.trim="['allNeedPay']" :readOnly="true" />
-              </a-form-item>
-            </a-col> -->
-            <a-col :span="24 / 2">
               <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="纳税人识别号">
               <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="纳税人识别号">
                 <a-input placeholder="请输入纳税人识别号" v-decorator.trim="['taxNum']" />
                 <a-input placeholder="请输入纳税人识别号" v-decorator.trim="['taxNum']" />
               </a-form-item>
               </a-form-item>
@@ -100,21 +83,23 @@
               </a-form-item>
               </a-form-item>
             </a-col>
             </a-col>
             <a-col :span="24 / 2">
             <a-col :span="24 / 2">
-              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="结算方式">
+              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="结算周期">
                 <a-select
                 <a-select
                   v-decorator.trim="['settlementMethod']"
                   v-decorator.trim="['settlementMethod']"
                   :options="settleOptions"
                   :options="settleOptions"
-                  placeholder="请选择结算方式"
+                  placeholder="请选择结算周期"
                 ></a-select>
                 ></a-select>
               </a-form-item>
               </a-form-item>
             </a-col>
             </a-col>
             <a-col :span="24 / 2">
             <a-col :span="24 / 2">
-              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="账单周期">
-                <a-input
-                  placeholder="请输入账单周期"
-                  oninput="value=value.replace(/[^\d]/g, '')"
+              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="付款方式">
+                <a-select
                   v-decorator.trim="['billingCycleDays']"
                   v-decorator.trim="['billingCycleDays']"
-                />
+                  placeholder="请选择付款方式"
+                >
+                  <a-select-option value="先款后货">先款后货</a-select-option>
+                  <a-select-option value="先货后款">先货后款</a-select-option>
+                </a-select>
               </a-form-item>
               </a-form-item>
             </a-col>
             </a-col>
             <a-col :span="24 / 2">
             <a-col :span="24 / 2">
@@ -132,7 +117,7 @@
               </a-form-item>
               </a-form-item>
             </a-col>
             </a-col>
             <a-col :span="24 / 2">
             <a-col :span="24 / 2">
-              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="开具发票情况">
+              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="发票类型">
                 <a-select
                 <a-select
                   v-decorator.trim="['invoiceType']"
                   v-decorator.trim="['invoiceType']"
                   :options="invoiceOptions"
                   :options="invoiceOptions"
@@ -151,6 +136,22 @@
               </a-form-item>
               </a-form-item>
             </a-col>
             </a-col>
             <a-col :span="24 / 2">
             <a-col :span="24 / 2">
+              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="是否支持售后">
+                <a-select
+                  v-decorator.trim="['isAfterSales']"
+                  placeholder="请选择是否支持售后"
+                >
+                <a-select-option value="1">是</a-select-option>
+                <a-select-option value="0">否</a-select-option>
+              </a-select>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24 / 2">
+              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="售后规则">
+                <a-textarea :rows="2" placeholder="请输入售后规则" v-decorator.trim="['afterSalesRules']" />
+              </a-form-item>
+            </a-col>
+            <a-col :span="24 / 2">
               <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="备注">
               <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="备注">
                 <a-textarea :rows="2" placeholder="请输入备注" v-decorator.trim="['description']" />
                 <a-textarea :rows="2" placeholder="请输入备注" v-decorator.trim="['description']" />
               </a-form-item>
               </a-form-item>
@@ -186,11 +187,11 @@ export default {
       isReadOnly: false,
       isReadOnly: false,
       labelCol: {
       labelCol: {
         xs: { span: 24 },
         xs: { span: 24 },
-        sm: { span: 4 },
+        sm: { span: 6 },
       },
       },
       wrapperCol: {
       wrapperCol: {
         xs: { span: 24 },
         xs: { span: 24 },
-        sm: { span: 20 },
+        sm: { span: 18 },
       },
       },
       confirmLoading: false,
       confirmLoading: false,
       form: this.$form.createForm(this),
       form: this.$form.createForm(this),
@@ -267,7 +268,10 @@ export default {
             'procurementContact',
             'procurementContact',
             'deliveryDays',
             'deliveryDays',
             'invoiceType',
             'invoiceType',
-            'contractUpload'
+            'contractUpload',
+            'serialNo',
+            'isAfterSales',
+            'afterSalesRules',
           )
           )
         )
         )
         autoJumpNextInput('vendorModal')
         autoJumpNextInput('vendorModal')

+ 126 - 0
jshERP-web/src/views/task/ApprovalList.vue

@@ -0,0 +1,126 @@
+<template>
+  <a-row :gutter="24">
+    <a-col :md="24">
+      <a-card :style="cardStyle" :bordered="false">
+        <!-- 查询区域 -->
+        <div class="table-page-search-wrapper">
+          <a-form layout="inline" @keyup.enter.native="searchQuery">
+            <a-row :gutter="24">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                  <a-input placeholder="请输入单据编号" v-model="queryParam.loginName"></a-input>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="流程类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                  <a-select v-model="queryParam.processType" placeholder="请选择流程类型">
+                    <a-select-option value="0">全部</a-select-option>
+                    <a-select-option value="1">请假</a-select-option>
+                  </a-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="发起人" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                  <a-input placeholder="请输入发起人" v-model="queryParam.loginName"></a-input>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
+                  <a-button type="primary" @click="searchQuery">查询</a-button>
+                  <a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
+                </span>
+              </a-col>
+            </a-row>
+          </a-form>
+        </div>
+        <!-- table区域-begin -->
+        <div>
+          <a-table
+            ref="table"
+            bordered
+            size="middle"
+            rowKey="id"
+            :columns="columns"
+            :dataSource="dataSource"
+            :pagination="ipagination"
+            :scroll="scroll"
+            :loading="loading"
+            :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
+            @change="handleTableChange"
+          >
+            <span slot="action" slot-scope="text, record">
+              <a @click="">查看</a>
+              <a-divider type="vertical" />
+              <a-popconfirm
+                title="确定删除吗?"
+                @confirm="() => handleDelete(record.id)"
+              >
+                <a>删除</a>
+              </a-popconfirm>
+            </span>
+          </a-table>
+        </div>
+        <!-- table区域-end -->
+      </a-card>
+    </a-col>
+  </a-row>
+</template>
+<script>
+import { postAction } from '@/api/manage'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+export default {
+  name: 'ApprovalList',
+  mixins: [JeecgListMixin],
+  components: {},
+  data() {
+    return {
+      labelCol: {
+        span: 5,
+      },
+      wrapperCol: {
+        span: 18,
+        offset: 1,
+      },
+      queryParam: {},
+      depotFlag: '0',
+      customerFlag: '0',
+      columns: [
+        { title: '单据编号', dataIndex: 'number', width: 100, align: 'left' },
+        { title: '流程类型', dataIndex: 'username', width: 100, align: 'left' },
+        { title: '发起人', dataIndex: 'userType', width: 80, align: 'left' },
+        { title: '审核人', dataIndex: 'roleName', width: 100, align: 'left' },
+        { title: '创建时间', dataIndex: 'orgAbr', width: 100, align: 'left' },
+        { title: '审批时间', dataIndex: 'leaderFlagStr', width: 60, align: 'left' },
+        { title: '审批结果', dataIndex: 'phonenum', width: 80, align: 'left' },
+        {
+          title: '操作',
+          dataIndex: 'action',
+          scopedSlots: { customRender: 'action' },
+          align: 'center',
+          width: 100,
+        },
+      ],
+      url: {
+        list: '',
+        delete: '',
+      },
+    }
+  },
+  created() {
+  },
+  methods: {
+    searchQuery() {
+      this.loadData(1)
+      this.getSystemConfig()
+    },
+    searchReset() {
+      this.queryParam = {}
+      this.loadData(1)
+      this.getSystemConfig()
+    },
+  },
+}
+</script>
+<style scoped>
+@import '~@assets/less/common.less';
+</style>

+ 115 - 0
jshERP-web/src/views/task/FlowList.vue

@@ -0,0 +1,115 @@
+<template>
+  <a-row :gutter="24">
+    <a-col :md="24">
+      <a-card :style="cardStyle" :bordered="false">
+        <!-- 查询区域 -->
+        <div class="table-page-search-wrapper">
+          <a-form layout="inline" @keyup.enter.native="searchQuery">
+            <a-row :gutter="24">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="流程类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                  <a-select v-model="queryParam.processType" placeholder="请选择流程类型">
+                    <a-select-option value="0">全部</a-select-option>
+                    <a-select-option value="1">请假</a-select-option>
+                  </a-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
+                  <a-button type="primary" @click="searchQuery">查询</a-button>
+                  <a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
+                </span>
+              </a-col>
+            </a-row>
+          </a-form>
+        </div>
+        <!-- table区域-begin -->
+        <div>
+          <a-table
+            ref="table"
+            bordered
+            size="middle"
+            rowKey="id"
+            :columns="columns"
+            :dataSource="dataSource"
+            :pagination="ipagination"
+            :scroll="scroll"
+            :loading="loading"
+            :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
+            @change="handleTableChange"
+          >
+            <span slot="action" slot-scope="text, record">
+              <a @click="">查看</a>
+              <a-divider type="vertical" />
+              <a-popconfirm
+                title="确定删除吗?"
+                @confirm="() => handleDelete(record.id)"
+              >
+                <a>删除</a>
+              </a-popconfirm>
+            </span>
+          </a-table>
+        </div>
+        <!-- table区域-end -->
+      </a-card>
+    </a-col>
+  </a-row>
+</template>
+<script>
+import { postAction } from '@/api/manage'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+export default {
+  name: 'FlowList',
+  mixins: [JeecgListMixin],
+  components: {},
+  data() {
+    return {
+      labelCol: {
+        span: 5,
+      },
+      wrapperCol: {
+        span: 18,
+        offset: 1,
+      },
+      queryParam: {},
+      depotFlag: '0',
+      customerFlag: '0',
+      columns: [
+        { title: '流程类型', dataIndex: 'username', width: 100, align: 'left' },
+        { title: '流程节点1', dataIndex: 'userType', width: 80, align: 'left' },
+        { title: '流程节点2', dataIndex: 'roleName', width: 100, align: 'left' },
+        { title: '流程节点3', dataIndex: 'orgAbr', width: 100, align: 'left' },
+        { title: '流程节点4', dataIndex: 'leaderFlagStr', width: 60, align: 'left' },
+        { title: '备注', dataIndex: 'phonenum', width: 80, align: 'left' },
+        {
+          title: '操作',
+          dataIndex: 'action',
+          scopedSlots: { customRender: 'action' },
+          align: 'center',
+          width: 100,
+        },
+      ],
+      url: {
+        list: '',
+        delete: '',
+      },
+    }
+  },
+  created() {
+  },
+  methods: {
+    searchQuery() {
+      this.loadData(1)
+      this.getSystemConfig()
+    },
+    searchReset() {
+      this.queryParam = {}
+      this.loadData(1)
+      this.getSystemConfig()
+    },
+  },
+}
+</script>
+<style scoped>
+@import '~@assets/less/common.less';
+</style>

+ 146 - 0
jshERP-web/src/views/task/HandledList.vue

@@ -0,0 +1,146 @@
+<template>
+  <a-row :gutter="24">
+    <a-col :md="24">
+      <a-card :style="cardStyle" :bordered="false">
+        <!-- 查询区域 -->
+        <div class="table-page-search-wrapper">
+          <a-form layout="inline" @keyup.enter.native="searchQuery">
+            <a-row :gutter="24">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                  <a-input placeholder="请输入单据编号" v-model="queryParam.loginName"></a-input>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="流程类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                  <a-select v-model="queryParam.processType" placeholder="请选择流程类型">
+                    <a-select-option value="0">全部</a-select-option>
+                    <a-select-option value="1">请假</a-select-option>
+                  </a-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                  <a-select v-model="queryParam.processType" placeholder="请选择状态">
+                    <a-select-option value="0">全部</a-select-option>
+                    <a-select-option value="1">请假</a-select-option>
+                    <a-select-option value="2">报销</a-select-option>
+                    <a-select-option value="3">采购</a-select-option>
+                  </a-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="审核时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                  <a-range-picker
+                    style="width: 100%"
+                    v-model="queryParam.createTimeRange"
+                    format="YYYY-MM-DD"
+                    :placeholder="['开始时间', '结束时间']"
+                  />
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="发起人" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                  <a-input placeholder="请输入发起人" v-model="queryParam.loginName"></a-input>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
+                  <a-button type="primary" @click="searchQuery">查询</a-button>
+                  <a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
+                </span>
+              </a-col>
+            </a-row>
+          </a-form>
+        </div>
+        <!-- table区域-begin -->
+        <div>
+          <a-table
+            ref="table"
+            bordered
+            size="middle"
+            rowKey="id"
+            :columns="columns"
+            :dataSource="dataSource"
+            :pagination="ipagination"
+            :scroll="scroll"
+            :loading="loading"
+            :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
+            @change="handleTableChange"
+          >
+            <span slot="action" slot-scope="text, record">
+              <a @click="">查看</a>
+              <a-divider type="vertical" />
+              <a-popconfirm
+                title="确定删除吗?"
+                @confirm="() => handleDelete(record.id)"
+              >
+                <a>删除</a>
+              </a-popconfirm>
+            </span>
+          </a-table>
+        </div>
+        <!-- table区域-end -->
+      </a-card>
+    </a-col>
+  </a-row>
+</template>
+<script>
+import { postAction } from '@/api/manage'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+export default {
+  name: 'HandledList',
+  mixins: [JeecgListMixin],
+  components: {},
+  data() {
+    return {
+      labelCol: {
+        span: 5,
+      },
+      wrapperCol: {
+        span: 18,
+        offset: 1,
+      },
+      queryParam: {},
+      depotFlag: '0',
+      customerFlag: '0',
+      columns: [
+        { title: '单据编号', dataIndex: 'number', width: 100, align: 'left' },
+        { title: '流程类型', dataIndex: 'username', width: 100, align: 'left' },
+        { title: '发起人', dataIndex: 'userType', width: 80, align: 'left' },
+        { title: '审核人', dataIndex: 'roleName', width: 100, align: 'left' },
+        { title: '创建时间', dataIndex: 'orgAbr', width: 100, align: 'left' },
+        { title: '审批时间', dataIndex: 'leaderFlagStr', width: 60, align: 'left' },
+        { title: '审批结果', dataIndex: 'phonenum', width: 80, align: 'left' },
+        {
+          title: '操作',
+          dataIndex: 'action',
+          scopedSlots: { customRender: 'action' },
+          align: 'center',
+          width: 100,
+        },
+      ],
+      url: {
+        list: '',
+        delete: '',
+      },
+    }
+  },
+  created() {
+  },
+  methods: {
+    searchQuery() {
+      this.loadData(1)
+      this.getSystemConfig()
+    },
+    searchReset() {
+      this.queryParam = {}
+      this.loadData(1)
+      this.getSystemConfig()
+    },
+  },
+}
+</script>
+<style scoped>
+@import '~@assets/less/common.less';
+</style>

+ 141 - 0
jshERP-web/src/views/task/InitiateList.vue

@@ -0,0 +1,141 @@
+<template>
+  <a-row :gutter="24">
+    <a-col :md="24">
+      <a-card :style="cardStyle" :bordered="false">
+        <!-- 查询区域 -->
+        <div class="table-page-search-wrapper">
+          <a-form layout="inline" @keyup.enter.native="searchQuery">
+            <a-row :gutter="24">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                  <a-input placeholder="请输入单据编号" v-model="queryParam.loginName"></a-input>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="流程类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                  <a-select v-model="queryParam.processType" placeholder="请选择流程类型">
+                    <a-select-option value="0">全部</a-select-option>
+                    <a-select-option value="1">请假</a-select-option>
+                  </a-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                  <a-select v-model="queryParam.processType" placeholder="请选择状态">
+                    <a-select-option value="0">全部</a-select-option>
+                    <a-select-option value="1">请假</a-select-option>
+                    <a-select-option value="2">报销</a-select-option>
+                    <a-select-option value="3">采购</a-select-option>
+                  </a-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="创建时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                  <a-range-picker
+                    style="width: 100%"
+                    v-model="queryParam.createTimeRange"
+                    format="YYYY-MM-DD"
+                    :placeholder="['开始时间', '结束时间']"
+                  />
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
+                  <a-button type="primary" @click="searchQuery">查询</a-button>
+                  <a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
+                </span>
+              </a-col>
+            </a-row>
+          </a-form>
+        </div>
+        <!-- table区域-begin -->
+        <div>
+          <a-table
+            ref="table"
+            bordered
+            size="middle"
+            rowKey="id"
+            :columns="columns"
+            :dataSource="dataSource"
+            :pagination="ipagination"
+            :scroll="scroll"
+            :loading="loading"
+            :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
+            @change="handleTableChange"
+          >
+            <span slot="action" slot-scope="text, record">
+              <a @click="">查看</a>
+              <a-divider type="vertical" />
+              <a-popconfirm
+                title="确定删除吗?"
+                @confirm="() => handleDelete(record.id)"
+              >
+                <a>删除</a>
+              </a-popconfirm>
+            </span>
+          </a-table>
+        </div>
+        <!-- table区域-end -->
+      </a-card>
+    </a-col>
+  </a-row>
+</template>
+<script>
+import { postAction } from '@/api/manage'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+export default {
+  name: 'InitiateList',
+  mixins: [JeecgListMixin],
+  components: {},
+  data() {
+    return {
+      labelCol: {
+        span: 5,
+      },
+      wrapperCol: {
+        span: 18,
+        offset: 1,
+      },
+      queryParam: {},
+      depotFlag: '0',
+      customerFlag: '0',
+      columns: [
+        { title: '单据编号', dataIndex: 'number', width: 100, align: 'left' },
+        { title: '流程类型', dataIndex: 'username', width: 100, align: 'left' },
+        { title: '发起人', dataIndex: 'userType', width: 80, align: 'left' },
+        { title: '审核人', dataIndex: 'roleName', width: 100, align: 'left' },
+        { title: '创建时间', dataIndex: 'orgAbr', width: 100, align: 'left' },
+        { title: '审批时间', dataIndex: 'leaderFlagStr', width: 60, align: 'left' },
+        { title: '审批结果', dataIndex: 'phonenum', width: 80, align: 'left' },
+        {
+          title: '操作',
+          dataIndex: 'action',
+          scopedSlots: { customRender: 'action' },
+          align: 'center',
+          width: 100,
+        },
+      ],
+      url: {
+        list: '',
+        delete: '',
+      },
+    }
+  },
+  created() {
+  },
+  methods: {
+    searchQuery() {
+      this.loadData(1)
+      this.getSystemConfig()
+    },
+    searchReset() {
+      this.queryParam = {}
+      this.loadData(1)
+      this.getSystemConfig()
+    },
+  },
+}
+</script>
+<style scoped>
+@import '~@assets/less/common.less';
+</style>

+ 5 - 0
src/main/java/com/jsh/erp/constants/BusinessConstants.java

@@ -122,6 +122,11 @@ public class BusinessConstants {
     public static final String SEQ_TO_STRING_LESS_INSERT = "0";
     public static final String SEQ_TO_STRING_LESS_INSERT = "0";
     //单据编号
     //单据编号
     public static final String DEPOT_NUMBER_SEQ = "depot_number_seq";
     public static final String DEPOT_NUMBER_SEQ = "depot_number_seq";
+    //供应商返回字符串的最小长度
+    public static final Long SUPPLIER_SEQ_TO_STRING_MIN_LENGTH = 1000L;
+    //供应商编号
+    public static final String SUPPLIER_NUMBER_SEQ = "supplier_number_seq";
+
     /**
     /**
      * 商品类别根目录id
      * 商品类别根目录id
      * */
      * */

+ 21 - 11
src/main/java/com/jsh/erp/constants/ExceptionConstants.java

@@ -356,30 +356,40 @@ public class ExceptionConstants {
     //EXCEL中有副条码在系统中已存在(除自身商品之外)
     //EXCEL中有副条码在系统中已存在(除自身商品之外)
     public static final int MATERIAL_EXCEL_IMPORT_MANY_BARCODE_EXIST_CODE = 80000028;
     public static final int MATERIAL_EXCEL_IMPORT_MANY_BARCODE_EXIST_CODE = 80000028;
     public static final String MATERIAL_EXCEL_IMPORT_MANY_BARCODE_EXIST_MSG = "抱歉,EXCEL中有副条码在系统中已存在,具体副条码为:%s";
     public static final String MATERIAL_EXCEL_IMPORT_MANY_BARCODE_EXIST_MSG = "抱歉,EXCEL中有副条码在系统中已存在,具体副条码为:%s";
-    //基本单位为空
+    //类别为空
     public static final int MATERIAL_Category_Name_EMPTY_CODE = 8000029;
     public static final int MATERIAL_Category_Name_EMPTY_CODE = 8000029;
     public static final String MATERIAL_Category_Name_EMPTY_MSG = "第%s行类别为空";
     public static final String MATERIAL_Category_Name_EMPTY_MSG = "第%s行类别为空";
-
-    //类型不存在错误
+    //类别不存在
     public static final int MATERIAL_TYPE_NOT_DECIMAL_CODE = 8000030;
     public static final int MATERIAL_TYPE_NOT_DECIMAL_CODE = 8000030;
     public static final String MATERIAL_TYPE_NOT_DECIMAL_MSG = "第%s行类别不存在";
     public static final String MATERIAL_TYPE_NOT_DECIMAL_MSG = "第%s行类别不存在";
-
-    //供应商不存在错误
+    //供应商不存在
     public static final int MATERIAL_SUPPLIER_NOT_DECIMAL_CODE = 8000031;
     public static final int MATERIAL_SUPPLIER_NOT_DECIMAL_CODE = 8000031;
     public static final String MATERIAL_SUPPLIER_NOT_DECIMAL_MSG = "第%s行供应商不存在";
     public static final String MATERIAL_SUPPLIER_NOT_DECIMAL_MSG = "第%s行供应商不存在";
-
-    //仓库不存在错误
+    //仓库不存在
     public static final int MATERIAL_DEPOT_NOT_DECIMAL_CODE = 8000031;
     public static final int MATERIAL_DEPOT_NOT_DECIMAL_CODE = 8000031;
     public static final String MATERIAL_DEPOT_NOT_DECIMAL_MSG = "第%s行仓库不存在";
     public static final String MATERIAL_DEPOT_NOT_DECIMAL_MSG = "第%s行仓库不存在";
-
     //erp_sku 不存在
     //erp_sku 不存在
     public static final int MATERIAL_ERP_SKU_NOT_DECIMAL_CODE = 8000032;
     public static final int MATERIAL_ERP_SKU_NOT_DECIMAL_CODE = 8000032;
     public static final String MATERIAL_ERP_SKU_NOT_DECIMAL_MSG = "商品erp_sku[%s]不存在";
     public static final String MATERIAL_ERP_SKU_NOT_DECIMAL_MSG = "商品erp_sku[%s]不存在";
-
-    //EXCEL中有条码在系统中已存在(除自身商品之外)
+    //EXCEL中有条码在系统中已存在
     public static final int MATERIAL_EXCEL_IMPORT_BARCODE_SYSTEM_EXIST_CODE = 80000033;
     public static final int MATERIAL_EXCEL_IMPORT_BARCODE_SYSTEM_EXIST_CODE = 80000033;
     public static final String MATERIAL_EXCEL_IMPORT_BARCODE_SYSTEM_EXIST_MSG = "抱歉,EXCEL中有条码在系统中已存在,具体条码为:%s";
     public static final String MATERIAL_EXCEL_IMPORT_BARCODE_SYSTEM_EXIST_MSG = "抱歉,EXCEL中有条码在系统中已存在,具体条码为:%s";
-    //基本单位为空
+    //默认采购价为空
+    public static final int MATERIAL_DEFAULT_PURCHASE_DECIMAL_EMPTY_CODE = 80000034;
+    public static final String MATERIAL_DEFAULT_PURCHASE_DECIMAL_EMPTY_MSG = "第%s行默认采购价不存在";
+    //默认采购价格式错误
+    public static final int MATERIAL_DEFAULT_PURCHASE_DECIMAL_NOT_DECIMAL_CODE = 8000035;
+    public static final String MATERIAL_DEFAULT_PURCHASE_DECIMAL_NOT_DECIMAL_MSG = "第%s行默认采购价格式错误";
+    //默认销售价为空
+    public static final int MATERIAL_DEFAULT_WHOLESALE_DECIMAL_EMPTY_CODE = 80000036;
+    public static final String MATERIAL_DEFAULT_WHOLESALE_DECIMAL_EMPTY_MSG = "第%s行默认销售价不存在";
+    //默认销售价格式错误
+    public static final int MATERIAL_DEFAULT_WHOLESALE_DECIMAL_NOT_DECIMAL_CODE = 8000037;
+    public static final String MATERIAL_DEFAULT_WHOLESALE_DECIMAL_NOT_DECIMAL_MSG = "第%s行默认销售价格式错误";
+
+    //基础重量格式错误
+    public static final int MATERIAL_STOCK_NOT_DECIMAL_CODE = 8000038;
+    public static final String MATERIAL_STOCK_NOT_DECIMAL_MSG = "第%s行期初库存格式错误";
 
 
     /**
     /**
      *  单据信息
      *  单据信息

+ 2 - 0
src/main/java/com/jsh/erp/controller/DepotItemController.java

@@ -293,6 +293,8 @@ public class DepotItemController {
                     item.put("warehousingTime",diEx.getWarehousingTime());
                     item.put("warehousingTime",diEx.getWarehousingTime());
                     item.put("warehousingUserName",diEx.getWarehousingUserName());
                     item.put("warehousingUserName",diEx.getWarehousingUserName());
                     item.put("wholesaleDecimal",diEx.getWholesaleDecimal());
                     item.put("wholesaleDecimal",diEx.getWholesaleDecimal());
+                    item.put("defaultPurchaseDecimal",diEx.getDefaultPurchaseDecimal());
+                    item.put("defaultWholesaleDecimal",diEx.getDefaultWholesaleDecimal());
                     dataArray.add(item);
                     dataArray.add(item);
                     //合计数据汇总
                     //合计数据汇总
                     totalOperNumber = totalOperNumber.add(diEx.getOperNumber()==null?BigDecimal.ZERO:diEx.getOperNumber());
                     totalOperNumber = totalOperNumber.add(diEx.getOperNumber()==null?BigDecimal.ZERO:diEx.getOperNumber());

+ 8 - 26
src/main/java/com/jsh/erp/controller/MaterialCategoryController.java

@@ -9,10 +9,7 @@ import com.jsh.erp.datasource.entities.MaterialCategory;
 import com.jsh.erp.datasource.vo.TreeNode;
 import com.jsh.erp.datasource.vo.TreeNode;
 import com.jsh.erp.service.MaterialCategoryService;
 import com.jsh.erp.service.MaterialCategoryService;
 
 
-import com.jsh.erp.utils.BaseResponseInfo;
-import com.jsh.erp.utils.Constants;
-import com.jsh.erp.utils.ErpInfo;
-import com.jsh.erp.utils.StringUtil;
+import com.jsh.erp.utils.*;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
@@ -66,17 +63,17 @@ public class MaterialCategoryController extends BaseController {
 
 
     @PostMapping(value = "/add")
     @PostMapping(value = "/add")
     @ApiOperation(value = "新增")
     @ApiOperation(value = "新增")
-    public String addResource(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception {
+    public String addResource(@RequestBody MaterialCategory materialCategory, HttpServletRequest request)throws Exception {
         Map<String, Object> objectMap = new HashMap<>();
         Map<String, Object> objectMap = new HashMap<>();
-        int insert = materialCategoryService.insertMaterialCategory(obj, request);
+        int insert = materialCategoryService.insertMaterialCategory(materialCategory, request);
         return returnStr(objectMap, insert);
         return returnStr(objectMap, insert);
     }
     }
 
 
     @PutMapping(value = "/update")
     @PutMapping(value = "/update")
     @ApiOperation(value = "修改")
     @ApiOperation(value = "修改")
-    public String updateResource(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception {
+    public String updateResource(@RequestBody MaterialCategory materialCategory, HttpServletRequest request)throws Exception {
         Map<String, Object> objectMap = new HashMap<>();
         Map<String, Object> objectMap = new HashMap<>();
-        int update = materialCategoryService.updateMaterialCategory(obj, request);
+        int update = materialCategoryService.updateMaterialCategory(materialCategory, request);
         return returnStr(objectMap, update);
         return returnStr(objectMap, update);
     }
     }
 
 
@@ -133,14 +130,8 @@ public class MaterialCategoryController extends BaseController {
         return res;
         return res;
     }
     }
 
 
-    /**
-     * 根据id来查询商品名称
-     * @param id
-     * @param request
-     * @return
-     */
     @GetMapping(value = "/findById")
     @GetMapping(value = "/findById")
-    @ApiOperation(value = "根据id来查询商品名称")
+    @ApiOperation(value = "根据类别id来查询类别信息")
     public BaseResponseInfo findById(@RequestParam("id") Long id, HttpServletRequest request)throws Exception {
     public BaseResponseInfo findById(@RequestParam("id") Long id, HttpServletRequest request)throws Exception {
         BaseResponseInfo res = new BaseResponseInfo();
         BaseResponseInfo res = new BaseResponseInfo();
         try {
         try {
@@ -158,6 +149,7 @@ public class MaterialCategoryController extends BaseController {
                     outer.put("sort", mc.getSort());
                     outer.put("sort", mc.getSort());
                     outer.put("serialNo", mc.getSerialNo());
                     outer.put("serialNo", mc.getSerialNo());
                     outer.put("remark", mc.getRemark());
                     outer.put("remark", mc.getRemark());
+                    outer.put("expiryThreshold",mc.getExpiryThreshold());
                 }
                 }
             }
             }
             res.code = 200;
             res.code = 200;
@@ -171,21 +163,11 @@ public class MaterialCategoryController extends BaseController {
     }
     }
     /**
     /**
      * 获取商品类别树数据
      * 获取商品类别树数据
-     * @Param:
-     * @return com.alibaba.fastjson.JSONArray
      */
      */
     @RequestMapping(value = "/getMaterialCategoryTree")
     @RequestMapping(value = "/getMaterialCategoryTree")
     @ApiOperation(value = "获取商品类别树数据")
     @ApiOperation(value = "获取商品类别树数据")
     public JSONArray getMaterialCategoryTree(@RequestParam("id") Long id) throws Exception{
     public JSONArray getMaterialCategoryTree(@RequestParam("id") Long id) throws Exception{
-       JSONArray arr=new JSONArray();
        List<TreeNode> materialCategoryTree = materialCategoryService.getMaterialCategoryTree(id);
        List<TreeNode> materialCategoryTree = materialCategoryService.getMaterialCategoryTree(id);
-       if(materialCategoryTree!=null&&materialCategoryTree.size()>0){
-           for(TreeNode node:materialCategoryTree){
-               String str=JSON.toJSONString(node);
-               JSONObject obj=JSON.parseObject(str);
-               arr.add(obj) ;
-           }
-       }
-        return arr;
+        return TreeNodeUtils.conversion(materialCategoryTree);
     }
     }
 }
 }

+ 12 - 13
src/main/java/com/jsh/erp/controller/MaterialController.java

@@ -2,7 +2,6 @@ package com.jsh.erp.controller;
 
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
-import com.jsh.erp.base.AjaxResult;
 import com.jsh.erp.base.BaseController;
 import com.jsh.erp.base.BaseController;
 import com.jsh.erp.base.TableDataInfo;
 import com.jsh.erp.base.TableDataInfo;
 import com.jsh.erp.datasource.dto.MaterialDto;
 import com.jsh.erp.datasource.dto.MaterialDto;
@@ -52,9 +51,6 @@ public class MaterialController extends BaseController {
     private DepotService depotService;
     private DepotService depotService;
 
 
     @Resource
     @Resource
-    private RoleService roleService;
-
-    @Resource
     private UserService userService;
     private UserService userService;
 
 
     @Resource
     @Resource
@@ -79,8 +75,7 @@ public class MaterialController extends BaseController {
 
 
     @GetMapping(value = "/list")
     @GetMapping(value = "/list")
     @ApiOperation(value = "获取信息列表")
     @ApiOperation(value = "获取信息列表")
-    public TableDataInfo getList(@RequestParam(value = Constants.SEARCH, required = false) String search,
-                                 HttpServletRequest request)throws Exception {
+    public TableDataInfo getList(@RequestParam(value = Constants.SEARCH, required = false) String search)throws Exception {
         String categoryId = StringUtil.getInfo(search, "categoryId");
         String categoryId = StringUtil.getInfo(search, "categoryId");
         String materialParam = StringUtil.getInfo(search, "materialParam");
         String materialParam = StringUtil.getInfo(search, "materialParam");
         String standard = StringUtil.getInfo(search, "standard");
         String standard = StringUtil.getInfo(search, "standard");
@@ -97,8 +92,9 @@ public class MaterialController extends BaseController {
         String enabled = StringUtil.getInfo(search, "enabled");
         String enabled = StringUtil.getInfo(search, "enabled");
         String remark = StringUtil.getInfo(search, "remark");
         String remark = StringUtil.getInfo(search, "remark");
         String mpList = StringUtil.getInfo(search, "mpList");
         String mpList = StringUtil.getInfo(search, "mpList");
+        String reminder = StringUtil.getInfo(search, "reminder");
         List<MaterialVo4Unit> list = materialService.select(materialParam, standard, model, color, brand, mfrs, materialOther, weight, expiryNum,
         List<MaterialVo4Unit> list = materialService.select(materialParam, standard, model, color, brand, mfrs, materialOther, weight, expiryNum,
-                enableSerialNumber, enableBatchNumber, position, enabled, remark, categoryId, mpList);
+                enableSerialNumber, enableBatchNumber, position, enabled, remark, categoryId, mpList, reminder);
         return getDataTable(list);
         return getDataTable(list);
     }
     }
 
 
@@ -609,23 +605,26 @@ public class MaterialController extends BaseController {
                         mvo.setBillPrice(mvo.getCommodityDecimal());
                         mvo.setBillPrice(mvo.getCommodityDecimal());
                     } else if ("CGDD".equals(prefixNo) || "CGRK".equals(prefixNo) || "CGTH".equals(prefixNo)) {
                     } else if ("CGDD".equals(prefixNo) || "CGRK".equals(prefixNo) || "CGTH".equals(prefixNo)) {
                         //采购价
                         //采购价
-                        mvo.setBillPrice(mvo.getPurchaseDecimal());
+                        mvo.setBillPrice(mvo.getDefaultPurchaseDecimal());
                     } else if("QTRK".equals(prefixNo) || "DBCK".equals(prefixNo) || "ZZD".equals(prefixNo) || "CXD".equals(prefixNo)
                     } else if("QTRK".equals(prefixNo) || "DBCK".equals(prefixNo) || "ZZD".equals(prefixNo) || "CXD".equals(prefixNo)
                             || "PDLR".equals(prefixNo) || "PDFP".equals(prefixNo)) {
                             || "PDLR".equals(prefixNo) || "PDFP".equals(prefixNo)) {
                         //采购价-给录入界面按权限屏蔽
                         //采购价-给录入界面按权限屏蔽
-                        mvo.setBillPrice(roleService.parseBillPriceByLimit(mvo.getPurchaseDecimal(), "buy", priceLimit, request));
-                    } if ("XSDD".equals(prefixNo) || "XSCK".equals(prefixNo) || "XSTH".equals(prefixNo) || "QTCK".equals(prefixNo)) {
+                       // mvo.setBillPrice(roleService.parseBillPriceByLimit(mvo.getPurchaseDecimal(), "buy", priceLimit, request));
+                        mvo.setBillPrice(mvo.getDefaultPurchaseDecimal());
+                    }
+                    if ("XSDD".equals(prefixNo) || "XSCK".equals(prefixNo) || "XSTH".equals(prefixNo) || "QTCK".equals(prefixNo)) {
                         //销售价
                         //销售价
                         if(organId == null) {
                         if(organId == null) {
-                            mvo.setBillPrice(mvo.getWholesaleDecimal());
+                            mvo.setBillPrice(mvo.getDefaultWholesaleDecimal());
                         } else {
                         } else {
                             //查询最后一单的销售价,实现不同的客户不同的销售价
                             //查询最后一单的销售价,实现不同的客户不同的销售价
                             BigDecimal lastUnitPrice = depotItemService.getLastUnitPriceByParam(organId, mvo.getMeId(), prefixNo);
                             BigDecimal lastUnitPrice = depotItemService.getLastUnitPriceByParam(organId, mvo.getMeId(), prefixNo);
-                            mvo.setBillPrice(lastUnitPrice!=null? lastUnitPrice : mvo.getWholesaleDecimal());
+                            mvo.setBillPrice(lastUnitPrice != null ? lastUnitPrice : mvo.getDefaultWholesaleDecimal());
                         }
                         }
                         //销售价-给录入界面按权限屏蔽价格
                         //销售价-给录入界面按权限屏蔽价格
                         if("QTCK".equals(prefixNo)) {
                         if("QTCK".equals(prefixNo)) {
-                            mvo.setBillPrice(roleService.parseBillPriceByLimit(mvo.getWholesaleDecimal(), "sale", priceLimit, request));
+                            //mvo.setBillPrice(roleService.parseBillPriceByLimit(mvo.getWholesaleDecimal(), "sale", priceLimit, request));
+                            mvo.setBillPrice(mvo.getDefaultWholesaleDecimal());
                         }
                         }
                     }
                     }
                     //仓库id
                     //仓库id

+ 14 - 11
src/main/java/com/jsh/erp/controller/OrganizationController.java

@@ -10,6 +10,7 @@ import com.jsh.erp.service.OrganizationService;
 import com.jsh.erp.service.UserService;
 import com.jsh.erp.service.UserService;
 import com.jsh.erp.utils.BaseResponseInfo;
 import com.jsh.erp.utils.BaseResponseInfo;
 import com.jsh.erp.utils.ErpInfo;
 import com.jsh.erp.utils.ErpInfo;
+import com.jsh.erp.utils.TreeNodeUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
@@ -148,16 +149,16 @@ public class OrganizationController {
     @GetMapping(value = "/getOrganizationTree")
     @GetMapping(value = "/getOrganizationTree")
     @ApiOperation(value = "获取机构树数据")
     @ApiOperation(value = "获取机构树数据")
     public JSONArray getOrganizationTree(@RequestParam("id") Long id) throws Exception{
     public JSONArray getOrganizationTree(@RequestParam("id") Long id) throws Exception{
-       JSONArray arr=new JSONArray();
+       //JSONArray arr=new JSONArray();
        List<TreeNode> organizationTree= organizationService.getOrganizationTree(id);
        List<TreeNode> organizationTree= organizationService.getOrganizationTree(id);
-       if(organizationTree!=null&&organizationTree.size()>0){
+       /*if(organizationTree!=null&&organizationTree.size()>0){
            for(TreeNode node:organizationTree){
            for(TreeNode node:organizationTree){
                String str=JSON.toJSONString(node);
                String str=JSON.toJSONString(node);
                JSONObject obj=JSON.parseObject(str);
                JSONObject obj=JSON.parseObject(str);
                arr.add(obj);
                arr.add(obj);
            }
            }
-       }
-        return arr;
+       }*/
+        return TreeNodeUtils.conversion(organizationTree);
     }
     }
 
 
     /**
     /**
@@ -174,13 +175,15 @@ public class OrganizationController {
         String roleType = userService.getRoleTypeByUserId(userId).getType();
         String roleType = userService.getRoleTypeByUserId(userId).getType();
         if(BusinessConstants.ROLE_TYPE_PUBLIC.equals(roleType)) {
         if(BusinessConstants.ROLE_TYPE_PUBLIC.equals(roleType)) {
             List<TreeNode> organizationTree = organizationService.getOrganizationTree(null);
             List<TreeNode> organizationTree = organizationService.getOrganizationTree(null);
-            if(organizationTree!=null && organizationTree.size()>0){
-                for(TreeNode node: organizationTree){
-                    String str = JSON.toJSONString(node);
-                    JSONObject obj = JSON.parseObject(str);
-                    arr.add(obj);
-                }
-            }
+            arr = TreeNodeUtils.conversion(organizationTree);
+//            if(organizationTree!=null && organizationTree.size()>0){
+//                for(TreeNode node: organizationTree){
+//                    String str = JSON.toJSONString(node);
+//                    JSONObject obj = JSON.parseObject(str);
+//                    arr.add(obj);
+//                }
+//            }
+
         }
         }
         return arr;
         return arr;
     }
     }

+ 4 - 4
src/main/java/com/jsh/erp/controller/SupplierController.java

@@ -77,17 +77,17 @@ public class SupplierController extends BaseController {
 
 
     @PostMapping(value = "/add")
     @PostMapping(value = "/add")
     @ApiOperation(value = "新增")
     @ApiOperation(value = "新增")
-    public String addResource(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception {
+    public String addResource(@RequestBody Supplier supplier, HttpServletRequest request)throws Exception {
         Map<String, Object> objectMap = new HashMap<>();
         Map<String, Object> objectMap = new HashMap<>();
-        int insert = supplierService.insertSupplier(obj, request);
+        int insert = supplierService.insertSupplier(supplier, request);
         return returnStr(objectMap, insert);
         return returnStr(objectMap, insert);
     }
     }
 
 
     @PutMapping(value = "/update")
     @PutMapping(value = "/update")
     @ApiOperation(value = "修改")
     @ApiOperation(value = "修改")
-    public String updateResource(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception {
+    public String updateResource(@RequestBody Supplier supplier, HttpServletRequest request)throws Exception {
         Map<String, Object> objectMap = new HashMap<>();
         Map<String, Object> objectMap = new HashMap<>();
-        int update = supplierService.updateSupplier(obj, request);
+        int update = supplierService.updateSupplier(supplier, request);
         return returnStr(objectMap, update);
         return returnStr(objectMap, update);
     }
     }
 
 

+ 12 - 20
src/main/java/com/jsh/erp/controller/pda/PdaController.java

@@ -19,9 +19,11 @@ import com.jsh.erp.datasource.pda.vo.*;
 import com.jsh.erp.datasource.vo.SpinnerVO;
 import com.jsh.erp.datasource.vo.SpinnerVO;
 import com.jsh.erp.datasource.vo.TaskStocktakingVO;
 import com.jsh.erp.datasource.vo.TaskStocktakingVO;
 import com.jsh.erp.datasource.vo.TreeNode;
 import com.jsh.erp.datasource.vo.TreeNode;
+import com.jsh.erp.exception.BusinessRunTimeException;
 import com.jsh.erp.query.LambdaQueryWrapperX;
 import com.jsh.erp.query.LambdaQueryWrapperX;
 import com.jsh.erp.service.*;
 import com.jsh.erp.service.*;
 import com.jsh.erp.utils.StringUtil;
 import com.jsh.erp.utils.StringUtil;
+import com.jsh.erp.utils.TreeNodeUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
@@ -82,10 +84,6 @@ public class PdaController extends BaseController {
     @Resource
     @Resource
     private MaterialBatchService materialBatchService;
     private MaterialBatchService materialBatchService;
 
 
-    /**
-     * 采购入库
-     * @return
-     */
     @PostMapping ("/purchaseInventory")
     @PostMapping ("/purchaseInventory")
     @ApiOperation(value = "采购入库")
     @ApiOperation(value = "采购入库")
     public TableDataInfo purchaseInventory(@RequestBody PDADepotHeadDTO pdaDepotHeadDTO) {
     public TableDataInfo purchaseInventory(@RequestBody PDADepotHeadDTO pdaDepotHeadDTO) {
@@ -136,14 +134,14 @@ public class PdaController extends BaseController {
     }
     }
 
 
     @ApiOperation("商品详情")
     @ApiOperation("商品详情")
-    @GetMapping("/materialDetail/{id}")
-    public AjaxResult materialDetail(@PathVariable("id") Long id) throws Exception {
-        return AjaxResult.success(depotItemService.pdaDetail(id));
+    @GetMapping("/materialDetail/{id}/{depotId}")
+    public AjaxResult materialDetail(@PathVariable("id") Long id, @PathVariable("depotId") Long depotId) throws Exception {
+        return AjaxResult.success(depotItemService.pdaDetail(id,depotId));
     }
     }
 
 
     @ApiOperation("商品库存详情")
     @ApiOperation("商品库存详情")
-    @GetMapping("/materialDepotDetail/{type}/{materialId}")
-    public TableDataInfo materialDepotDetail(@PathVariable("type") String type, @PathVariable("materialId") Long materialId) {
+    @GetMapping("/materialDepotDetail/{type}/{materialId}/{depotId}")
+    public TableDataInfo materialDepotDetail(@PathVariable("type") String type, @PathVariable("materialId") Long materialId,@PathVariable("depotId") Long depotId) {
         startPage();
         startPage();
         if ("in".equals(type)) {
         if ("in".equals(type)) {
             type = "入库";
             type = "入库";
@@ -185,16 +183,8 @@ public class PdaController extends BaseController {
     @ApiOperation(value = "获取商品类别树数据")
     @ApiOperation(value = "获取商品类别树数据")
     @GetMapping(value = "/getMaterialCategoryTree")
     @GetMapping(value = "/getMaterialCategoryTree")
     public JSONArray getMaterialCategoryTree(@RequestParam("id") Long id) throws Exception{
     public JSONArray getMaterialCategoryTree(@RequestParam("id") Long id) throws Exception{
-        JSONArray arr=new JSONArray();
         List<TreeNode> materialCategoryTree = materialCategoryService.getMaterialCategoryTree(id);
         List<TreeNode> materialCategoryTree = materialCategoryService.getMaterialCategoryTree(id);
-        if(materialCategoryTree!=null&&materialCategoryTree.size()>0){
-            for(TreeNode node:materialCategoryTree){
-                String str= JSON.toJSONString(node);
-                JSONObject obj=JSON.parseObject(str);
-                arr.add(obj) ;
-            }
-        }
-        return arr;
+        return TreeNodeUtils.conversion(materialCategoryTree);
     }
     }
 
 
     @ApiOperation("开始任务")
     @ApiOperation("开始任务")
@@ -270,9 +260,11 @@ public class PdaController extends BaseController {
     public AjaxResult orderSubmit(@RequestBody PDADepotHeadDTO pdaDepotHeadDTO) {
     public AjaxResult orderSubmit(@RequestBody PDADepotHeadDTO pdaDepotHeadDTO) {
         try {
         try {
             depotHeadService.pdaOrderSubmit(pdaDepotHeadDTO);
             depotHeadService.pdaOrderSubmit(pdaDepotHeadDTO);
-        } catch (Exception e) {
+        }catch (BusinessRunTimeException e) {
+            return AjaxResult.error(e.getMessage());
+        }catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
-            return AjaxResult.error();
+            return AjaxResult.error("入库失败");
         }
         }
         return AjaxResult.success();
         return AjaxResult.success();
     }
     }

+ 65 - 0
src/main/java/com/jsh/erp/datasource/dto/MaterialQueryDTO.java

@@ -0,0 +1,65 @@
+package com.jsh.erp.datasource.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class MaterialQueryDTO {
+
+    @ApiModelProperty("商品类别ID")
+    private String categoryId;
+
+    @ApiModelProperty("关键字")
+    private String materialParam;
+
+    @ApiModelProperty("规格")
+    private String standard;
+
+    @ApiModelProperty("型号")
+    private String model;
+
+    @ApiModelProperty("颜色")
+    private String color;
+
+    @ApiModelProperty("品牌")
+    private String brand;
+
+    @ApiModelProperty("启用状态 0-禁用  1-启用")
+    private String enabled;
+
+    @ApiModelProperty("是否开启序列号,0否,1是")
+    private String enableSerialNumber;
+
+    @ApiModelProperty("拓展信息")
+    private String materialOther;
+
+    @ApiModelProperty("基础重量")
+    private String weight;
+
+    @ApiModelProperty("商品提醒")
+    private String reminder;
+
+    @ApiModelProperty("备注")
+    private String remark;
+
+    @ApiModelProperty("商品类型ID集合")
+    private List<Long> idList;
+
+    @ApiModelProperty("保质期")
+    private String expiryNum;
+
+    @ApiModelProperty("是否开启批号,0否,1是")
+    private String enableBatchNumber;
+
+    @ApiModelProperty("库位")
+    private String position;
+
+    private String mpList;
+
+
+
+
+
+}

+ 40 - 0
src/main/java/com/jsh/erp/datasource/entities/AuditProcess.java

@@ -0,0 +1,40 @@
+package com.jsh.erp.datasource.entities;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 审核流程比表实体类
+ */
+@Data
+public class AuditProcess {
+
+    @ApiModelProperty("主键ID")
+    @TableId(type = IdType.AUTO)
+    private Long id;
+
+    @ApiModelProperty("流程名称")
+    private String name;
+
+    @ApiModelProperty("流程类型")
+    private String type;
+
+    @ApiModelProperty("描述")
+    private String description;
+
+    @ApiModelProperty("创建人")
+    private Long createBy;
+
+    @ApiModelProperty("创建时间")
+    private Date createTime;
+
+    @ApiModelProperty("删除标记,0.未删除,1.已删除")
+    private Boolean deletedFlag;
+
+
+
+}

+ 5 - 0
src/main/java/com/jsh/erp/datasource/entities/Depot.java

@@ -1,7 +1,12 @@
 package com.jsh.erp.datasource.entities;
 package com.jsh.erp.datasource.entities;
 
 
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 
 
+@TableName("jsh_depot")
+@Data
 public class Depot {
 public class Depot {
     private Long id;
     private Long id;
 
 

+ 6 - 0
src/main/java/com/jsh/erp/datasource/entities/DepotHead.java

@@ -157,6 +157,12 @@ public class DepotHead {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date submitTime;
     private Date submitTime;
 
 
+    @ApiModelProperty("复核人员")
+    private Long auditor;
+
+    @ApiModelProperty("税率")
+    private BigDecimal taxRate;
+
 
 
     public Long getId() {
     public Long getId() {
         return id;
         return id;

+ 6 - 0
src/main/java/com/jsh/erp/datasource/entities/DepotItemVo4WithInfoEx.java

@@ -86,6 +86,12 @@ public class DepotItemVo4WithInfoEx extends DepotItem{
     @ApiModelProperty("入库人名称")
     @ApiModelProperty("入库人名称")
     private String warehousingUserName;
     private String warehousingUserName;
 
 
+    @ApiModelProperty("默认销售价格")
+    private BigDecimal defaultPurchaseDecimal;
+
+    @ApiModelProperty("默认采购价格")
+    private BigDecimal defaultWholesaleDecimal;
+
     public Long getMId() {
     public Long getMId() {
         return MId;
         return MId;
     }
     }

+ 12 - 0
src/main/java/com/jsh/erp/datasource/entities/Material.java

@@ -87,6 +87,18 @@ public class Material {
     @ApiModelProperty("无动销提醒周期")
     @ApiModelProperty("无动销提醒周期")
     private String movingPinReminderCycle;
     private String movingPinReminderCycle;
 
 
+    @ApiModelProperty("保质期天数")
+    private int expiryNum;
+
+    @ApiModelProperty("默认采购价格")
+    private BigDecimal defaultPurchaseDecimal;
+
+    @ApiModelProperty("默认销售价格")
+    private BigDecimal defaultWholesaleDecimal;
+
+    @ApiModelProperty("商品提醒")
+    private String reminder;
+
     @TableField(exist = false)
     @TableField(exist = false)
     private List<MaterialExtend> list;
     private List<MaterialExtend> list;
 
 

+ 6 - 0
src/main/java/com/jsh/erp/datasource/entities/MaterialBatch.java

@@ -1,5 +1,7 @@
 package com.jsh.erp.datasource.entities;
 package com.jsh.erp.datasource.entities;
 
 
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.Data;
@@ -14,6 +16,7 @@ import java.util.Date;
 public class MaterialBatch {
 public class MaterialBatch {
 
 
     @ApiModelProperty("主键id")
     @ApiModelProperty("主键id")
+    @TableId(type = IdType.AUTO)
     private Long id;
     private Long id;
 
 
     @ApiModelProperty("商品id")
     @ApiModelProperty("商品id")
@@ -87,4 +90,7 @@ public class MaterialBatch {
     @ApiModelProperty("单据id")
     @ApiModelProperty("单据id")
     private Long depotItemId;
     private Long depotItemId;
 
 
+    @ApiModelProperty("商品扩展id")
+    private Long materialExtendId;
+
 }
 }

+ 15 - 0
src/main/java/com/jsh/erp/datasource/entities/MaterialCategory.java

@@ -1,6 +1,7 @@
 package com.jsh.erp.datasource.entities;
 package com.jsh.erp.datasource.entities;
 
 
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.Data;
 import lombok.experimental.Accessors;
 import lombok.experimental.Accessors;
 
 
@@ -14,28 +15,42 @@ import java.util.Date;
 @TableName("jsh_material_category")
 @TableName("jsh_material_category")
 public class MaterialCategory {
 public class MaterialCategory {
 
 
+    @ApiModelProperty("主键id")
     private Long id;
     private Long id;
 
 
+    @ApiModelProperty("名称")
     private String name;
     private String name;
 
 
+    @ApiModelProperty("等级")
     private Short categoryLevel;
     private Short categoryLevel;
 
 
+    @ApiModelProperty("上级id")
     private Long parentId;
     private Long parentId;
 
 
+    @ApiModelProperty("显示顺序")
     private String sort;
     private String sort;
 
 
+    @ApiModelProperty("编号")
     private Long serialNo;
     private Long serialNo;
 
 
+    @ApiModelProperty("备注")
     private String remark;
     private String remark;
 
 
+    @ApiModelProperty("创建时间")
     private Date createTime;
     private Date createTime;
 
 
+    @ApiModelProperty("更新时间")
     private Date updateTime;
     private Date updateTime;
 
 
+    @ApiModelProperty("租户id")
     private Long tenantId;
     private Long tenantId;
 
 
+    @ApiModelProperty("删除标记,0未删除,1删除")
     private String deleteFlag;
     private String deleteFlag;
 
 
+    @ApiModelProperty("有效期阈值")
+    private Integer expiryThreshold;
+
     public Long getId() {
     public Long getId() {
         return id;
         return id;
     }
     }

+ 0 - 3
src/main/java/com/jsh/erp/datasource/entities/MaterialVo4Unit.java

@@ -74,9 +74,6 @@ public class MaterialVo4Unit extends Material{
     @ApiModelProperty("生产日期")
     @ApiModelProperty("生产日期")
     private String productionDate;
     private String productionDate;
 
 
-    @ApiModelProperty("保质期天数")
-    private Integer expiryNum;
-
     @ApiModelProperty("供应商id")
     @ApiModelProperty("供应商id")
     private Long supplierId;
     private Long supplierId;
 
 

+ 9 - 0
src/main/java/com/jsh/erp/datasource/entities/Supplier.java

@@ -1,6 +1,7 @@
 package com.jsh.erp.datasource.entities;
 package com.jsh.erp.datasource.entities;
 
 
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.Data;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
@@ -109,6 +110,14 @@ public class Supplier {
     /** 合同附件存储路径 */
     /** 合同附件存储路径 */
     private String contractUpload;
     private String contractUpload;
 
 
+    @ApiModelProperty("供应商编码")
+    private String serialNo;
+
+    @ApiModelProperty("是否支持售后")
+    private String isAfterSales;
+
+    @ApiModelProperty("售后规则")
+    private String afterSalesRules;
 
 
     public Long getId() {
     public Long getId() {
         return id;
         return id;

+ 2 - 1
src/main/java/com/jsh/erp/datasource/mappers/MaterialMapperEx.java

@@ -37,7 +37,8 @@ public interface MaterialMapperEx {
             @Param("enabled") String enabled,
             @Param("enabled") String enabled,
             @Param("remark") String remark,
             @Param("remark") String remark,
             @Param("idList") List<Long> idList,
             @Param("idList") List<Long> idList,
-            @Param("mpList") String mpList);
+            @Param("mpList") String mpList,
+            @Param("reminder") String reminder);
 
 
     Long insertSelectiveEx(Material record);
     Long insertSelectiveEx(Material record);
 
 

+ 4 - 1
src/main/java/com/jsh/erp/datasource/mappers/SequenceMapperEx.java

@@ -4,7 +4,10 @@ import org.apache.ibatis.annotations.Param;
 
 
 public interface SequenceMapperEx {
 public interface SequenceMapperEx {
 
 
-    void updateBuildOnlyNumber();
+    /**
+     * 修改数加一
+     */
+    void updateBuildOnlyNumber(@Param("seq_name") String seq_name);
 
 
     /**
     /**
      * 获得一个全局唯一的数作为订单号的追加
      * 获得一个全局唯一的数作为订单号的追加

+ 2 - 0
src/main/java/com/jsh/erp/datasource/pda/dto/PDADepotHeadDTO.java

@@ -1,8 +1,10 @@
 package com.jsh.erp.datasource.pda.dto;
 package com.jsh.erp.datasource.pda.dto;
 
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.Data;
 
 
+import java.util.Date;
 import java.util.List;
 import java.util.List;
 
 
 @Data
 @Data

+ 3 - 0
src/main/java/com/jsh/erp/datasource/pda/dto/PDADepotMaterialDto.java

@@ -23,4 +23,7 @@ public class PDADepotMaterialDto {
     @JsonFormat(pattern = "yyyy-MM-dd")
     @JsonFormat(pattern = "yyyy-MM-dd")
     private Date productionDate;
     private Date productionDate;
 
 
+    @ApiModelProperty("仓位货架")
+    private String position;
+
 }
 }

+ 6 - 0
src/main/java/com/jsh/erp/datasource/vo/DepotHeadVo4List.java

@@ -1,10 +1,13 @@
 package com.jsh.erp.datasource.vo;
 package com.jsh.erp.datasource.vo;
 
 
 import com.jsh.erp.datasource.entities.DepotHead;
 import com.jsh.erp.datasource.entities.DepotHead;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.util.Date;
 import java.util.Date;
 
 
+@Data
 public class DepotHeadVo4List extends DepotHead{
 public class DepotHeadVo4List extends DepotHead{
 
 
     private String projectName;
     private String projectName;
@@ -57,6 +60,9 @@ public class DepotHeadVo4List extends DepotHead{
      */
      */
     private BigDecimal realNeedDebt;
     private BigDecimal realNeedDebt;
 
 
+    @ApiModelProperty("复核人名称")
+    private String auditorName;
+
     public String getProjectName() {
     public String getProjectName() {
         return projectName;
         return projectName;
     }
     }

+ 1 - 1
src/main/java/com/jsh/erp/service/DepotItemService.java

@@ -31,7 +31,7 @@ public interface DepotItemService extends IService<DepotItem> {
      * @param id 商品订单ID
      * @param id 商品订单ID
      * @return
      * @return
      */
      */
-    PDADepotItemVO pdaDetail(Long id) throws Exception;
+    PDADepotItemVO pdaDetail(Long id, Long depotId) throws Exception;
 
 
     /**
     /**
      * 商品库存详情列表
      * 商品库存详情列表

+ 25 - 5
src/main/java/com/jsh/erp/service/MaterialCategoryService.java

@@ -1,6 +1,6 @@
 package com.jsh.erp.service;
 package com.jsh.erp.service;
 
 
-import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.jsh.erp.datasource.entities.MaterialCategory;
 import com.jsh.erp.datasource.entities.MaterialCategory;
 import com.jsh.erp.datasource.vo.TreeNode;
 import com.jsh.erp.datasource.vo.TreeNode;
@@ -11,13 +11,21 @@ import java.util.List;
 
 
 public interface MaterialCategoryService extends IService<MaterialCategory> {
 public interface MaterialCategoryService extends IService<MaterialCategory> {
 
 
-
+    /**
+     * 根据id查询商品类别
+     */
     MaterialCategory getMaterialCategory(long id)throws Exception;
     MaterialCategory getMaterialCategory(long id)throws Exception;
 
 
+    /**
+     * 根据id集合查询商品类别
+     */
     List<MaterialCategory> getMaterialCategoryListByIds(String ids)throws Exception;
     List<MaterialCategory> getMaterialCategoryListByIds(String ids)throws Exception;
 
 
     List<MaterialCategory> getMaterialCategory()throws Exception;
     List<MaterialCategory> getMaterialCategory()throws Exception;
 
 
+    /**
+     * 根据父类型ID查询全部子类型集合
+     */
     List<MaterialCategory> getAllList(Long parentId)throws Exception;
     List<MaterialCategory> getAllList(Long parentId)throws Exception;
 
 
     List<MaterialCategory> getMCList(Long parentId)throws Exception;
     List<MaterialCategory> getMCList(Long parentId)throws Exception;
@@ -26,17 +34,17 @@ public interface MaterialCategoryService extends IService<MaterialCategory> {
 
 
     /**
     /**
      * 新增商品类别
      * 新增商品类别
-     * @param obj 商品类别数据
+     * @param materialCategory 商品类别数据
      */
      */
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
-    int insertMaterialCategory(JSONObject obj, HttpServletRequest request)throws Exception;
+    int insertMaterialCategory(MaterialCategory materialCategory, HttpServletRequest request)throws Exception;
 
 
     /**
     /**
      * 修改商品类别
      * 修改商品类别
      * @param obj 商品类别数据
      * @param obj 商品类别数据
      */
      */
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
-    int updateMaterialCategory(JSONObject obj, HttpServletRequest request) throws Exception;
+    int updateMaterialCategory(MaterialCategory obj, HttpServletRequest request) throws Exception;
 
 
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     int deleteMaterialCategory(Long id, HttpServletRequest request)throws Exception;
     int deleteMaterialCategory(Long id, HttpServletRequest request)throws Exception;
@@ -47,10 +55,21 @@ public interface MaterialCategoryService extends IService<MaterialCategory> {
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     int batchDeleteMaterialCategoryByIds(String ids) throws Exception;
     int batchDeleteMaterialCategoryByIds(String ids) throws Exception;
 
 
+    /**
+     * 检查类别名称是否存在
+     */
     int checkIsNameExist(Long id, String name)throws Exception;
     int checkIsNameExist(Long id, String name)throws Exception;
 
 
+
+    /**
+     * 根据类别id来查询类别信息
+     * @param id 类别id
+     */
     List<MaterialCategory> findById(Long id)throws Exception;
     List<MaterialCategory> findById(Long id)throws Exception;
 
 
+    /**
+     * 获取商品类别树数据
+     */
     List<TreeNode> getMaterialCategoryTree(Long id) throws Exception;
     List<TreeNode> getMaterialCategoryTree(Long id) throws Exception;
 
 
     void  checkMaterialCategorySerialNo(MaterialCategory mc)throws Exception;
     void  checkMaterialCategorySerialNo(MaterialCategory mc)throws Exception;
@@ -60,4 +79,5 @@ public interface MaterialCategoryService extends IService<MaterialCategory> {
      * @param name
      * @param name
      */
      */
     Long getCategoryIdByName(String name);
     Long getCategoryIdByName(String name);
+
 }
 }

+ 7 - 2
src/main/java/com/jsh/erp/service/MaterialService.java

@@ -35,8 +35,7 @@ public interface MaterialService extends IService<Material> {
     List<MaterialVo4Unit> select(String materialParam, String standard, String model, String color, String brand, String mfrs,
     List<MaterialVo4Unit> select(String materialParam, String standard, String model, String color, String brand, String mfrs,
                                  String materialOther, String weight, String expiryNum, String enableSerialNumber,
                                  String materialOther, String weight, String expiryNum, String enableSerialNumber,
                                  String enableBatchNumber, String position, String enabled, String remark, String categoryId,
                                  String enableBatchNumber, String position, String enabled, String remark, String categoryId,
-                                 String mpList)
-            throws Exception;
+                                 String mpList, String reminder);
 
 
     /**
     /**
      * 新增商品
      * 新增商品
@@ -168,6 +167,9 @@ public interface MaterialService extends IService<Material> {
 
 
     String getBigUnitStock(BigDecimal stock, Long unitId) throws Exception;
     String getBigUnitStock(BigDecimal stock, Long unitId) throws Exception;
 
 
+    /**
+     * 构造扩展信息
+     */
     String getMaterialOtherByParam(String[] mpArr, MaterialVo4Unit m);
     String getMaterialOtherByParam(String[] mpArr, MaterialVo4Unit m);
 
 
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
@@ -180,6 +182,9 @@ public interface MaterialService extends IService<Material> {
 
 
     MaterialExtend getMaterialExtendBySerialNumber(String serialNumber);
     MaterialExtend getMaterialExtendBySerialNumber(String serialNumber);
 
 
+    /**
+     * 根据商品id查询主表及子表信息
+     */
     Material getMaterialById(Long id);
     Material getMaterialById(Long id);
 
 
     List<MaterialVo4Unit> getMaterialBySystemSku(List<String> systemSkuList);
     List<MaterialVo4Unit> getMaterialBySystemSku(List<String> systemSkuList);

+ 8 - 81
src/main/java/com/jsh/erp/service/SequenceService.java

@@ -1,91 +1,18 @@
 package com.jsh.erp.service;
 package com.jsh.erp.service;
 
 
-import com.alibaba.fastjson.JSONObject;
-import com.jsh.erp.constants.BusinessConstants;
-import com.jsh.erp.datasource.entities.*;
-import com.jsh.erp.datasource.mappers.*;
-import com.jsh.erp.exception.JshException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 
 
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import java.util.List;
-
-/**
- * Description
- *
- * @Author: longyong
- * @Date: 2021/3/16 16:33
- */
-@Service
-public class SequenceService {
-    private Logger logger = LoggerFactory.getLogger(SequenceService.class);
-
-    @Resource
-    private SequenceMapperEx sequenceMapperEx;
-
-    public SerialNumber getSequence(long id)throws Exception {
-        return null;
-    }
-
-    public List<SerialNumberEx> select(String name, Integer offset, Integer rows)throws Exception {
-        return null;
-    }
-
-    public Long countSequence(String name)throws Exception {
-        return null;
-    }
-
-    @Transactional(value = "transactionManager", rollbackFor = Exception.class)
-    public int insertSequence(JSONObject obj, HttpServletRequest request)throws Exception {
-        return 0;
-    }
-
-    @Transactional(value = "transactionManager", rollbackFor = Exception.class)
-    public int updateSequence(JSONObject obj, HttpServletRequest request) throws Exception{
-        return 0;
-    }
-
-    @Transactional(value = "transactionManager", rollbackFor = Exception.class)
-    public int deleteSequence(Long id, HttpServletRequest request)throws Exception {
-        return 0;
-    }
+public interface SequenceService {
 
 
+    /**
+     * 获取单据编号
+     */
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
-    public int batchDeleteSequence(String ids, HttpServletRequest request)throws Exception {
-        return 0;
-    }
-
-    public int checkIsNameExist(Long id, String serialNumber)throws Exception {
-        return 0;
-    }
+    String buildOnlyNumber()throws Exception;
 
 
     /**
     /**
-     * 创建一个唯一的序列
-     * */
+     * 构建供应商编号
+     */
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
-    public String buildOnlyNumber()throws Exception{
-        Long buildOnlyNumber=null;
-        synchronized (this){
-            try{
-                sequenceMapperEx.updateBuildOnlyNumber(); //编号+1
-                buildOnlyNumber= sequenceMapperEx.getBuildOnlyNumber(BusinessConstants.DEPOT_NUMBER_SEQ);
-            }catch(Exception e){
-                JshException.writeFail(logger, e);
-            }
-        }
-        if(buildOnlyNumber<BusinessConstants.SEQ_TO_STRING_MIN_LENGTH){
-            StringBuffer sb=new StringBuffer(buildOnlyNumber.toString());
-            int len=BusinessConstants.SEQ_TO_STRING_MIN_LENGTH.toString().length()-sb.length();
-            for(int i=0;i<len;i++){
-                sb.insert(0,BusinessConstants.SEQ_TO_STRING_LESS_INSERT);
-            }
-            return sb.toString();
-        }else{
-            return buildOnlyNumber.toString();
-        }
-    }
+    String buildSupplierNumber();
 }
 }

+ 8 - 2
src/main/java/com/jsh/erp/service/SupplierService.java

@@ -22,11 +22,17 @@ public interface SupplierService extends IService<Supplier> {
 
 
     List<Supplier> select(String supplier, String type, String phonenum, String telephone) throws Exception;
     List<Supplier> select(String supplier, String type, String phonenum, String telephone) throws Exception;
 
 
+    /**
+     * 新增供应商
+     */
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
-    int insertSupplier(JSONObject obj, HttpServletRequest request)throws Exception;
+    int insertSupplier(Supplier supplier, HttpServletRequest request)throws Exception;
 
 
+    /**
+     * 修改供应商
+     */
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
-    int updateSupplier(JSONObject obj, HttpServletRequest request)throws Exception;
+    int updateSupplier(Supplier supplier, HttpServletRequest request)throws Exception;
 
 
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     int deleteSupplier(Long id, HttpServletRequest request)throws Exception;
     int deleteSupplier(Long id, HttpServletRequest request)throws Exception;

+ 27 - 5
src/main/java/com/jsh/erp/service/impl/DepotHeadServiceImpl.java

@@ -19,10 +19,7 @@ import com.jsh.erp.exception.JshException;
 import com.jsh.erp.query.LambdaQueryWrapperX;
 import com.jsh.erp.query.LambdaQueryWrapperX;
 import com.jsh.erp.query.QueryWrapperX;
 import com.jsh.erp.query.QueryWrapperX;
 import com.jsh.erp.service.*;
 import com.jsh.erp.service.*;
-import com.jsh.erp.utils.ExcelUtils;
-import com.jsh.erp.utils.PageUtils;
-import com.jsh.erp.utils.StringUtil;
-import com.jsh.erp.utils.Tools;
+import com.jsh.erp.utils.*;
 import jxl.Workbook;
 import jxl.Workbook;
 import jxl.write.WritableWorkbook;
 import jxl.write.WritableWorkbook;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
@@ -92,6 +89,8 @@ public class DepotHeadServiceImpl extends ServiceImpl<DepotHeadMapper, DepotHead
     private SyncTescoSystemService syncTescoSystemService;
     private SyncTescoSystemService syncTescoSystemService;
     @Resource
     @Resource
     private MaterialBatchService materialBatchService;
     private MaterialBatchService materialBatchService;
+    @Resource
+    private MaterialCategoryService materialCategoryService;
 
 
     /**
     /**
      * PDA查询订单
      * PDA查询订单
@@ -2013,6 +2012,27 @@ public class DepotHeadServiceImpl extends ServiceImpl<DepotHeadMapper, DepotHead
             MaterialExtend materialExtend = materialExtendService.getMaterialExtend(depotItem.getMaterialExtendId());
             MaterialExtend materialExtend = materialExtendService.getMaterialExtend(depotItem.getMaterialExtendId());
             //获取商品条码
             //获取商品条码
             String barCode = materialExtend.getBarCode();
             String barCode = materialExtend.getBarCode();
+            //校验商品保质期
+            if (depotHead.getType().equals("入库")){
+                //修改采购订单的生产日期和库位
+                depotItemService.update(new UpdateWrapper<DepotItem>().set("production_date",depotItem.getProductionDate())
+                                .set("position",depotItem.getPosition())
+                                .eq("id",depotItem.getId()));
+                //获取商品信息
+                Material m = materialService.getMaterial(materialExtend.getMaterialId());
+                //获取商品类别
+                MaterialCategory mc = materialCategoryService.getMaterialCategory(m.getCategoryId());
+                if (mc.getExpiryThreshold() != null && mc.getExpiryThreshold() > 0){
+                    //商品生产天数
+                    int productionDay = DateUtils.differentDaysByMillisecond(depotItem.getProductionDate(),new Date());
+                    //保质期剩余天数
+                    int day = depotItem.getExpiryNum() - productionDay;
+                    if (day < mc.getExpiryThreshold()){
+                        throw new BusinessRunTimeException(ExceptionConstants.SERVICE_SYSTEM_ERROR_CODE,
+                                "商品" + m.getName()  + "即将过期,不允许入库");
+                    }
+                }
+            }
             //修改原先采购订单实际入库数量
             //修改原先采购订单实际入库数量
             //depotItemService.update(new UpdateWrapper<DepotItem>().set("actual_quantity_in_storage", materialMap.get(batchNumber).getMaterialNumber()).eq("id", depotItem.getId()));
             //depotItemService.update(new UpdateWrapper<DepotItem>().set("actual_quantity_in_storage", materialMap.get(batchNumber).getMaterialNumber()).eq("id", depotItem.getId()));
             //设置单据主表id
             //设置单据主表id
@@ -2022,6 +2042,8 @@ public class DepotHeadServiceImpl extends ServiceImpl<DepotHeadMapper, DepotHead
             depotItem.setId(null);
             depotItem.setId(null);
             //设置实际入库数量
             //设置实际入库数量
             depotItem.setOperNumber(materialMap.get(barCode).getMaterialNumber());
             depotItem.setOperNumber(materialMap.get(barCode).getMaterialNumber());
+            depotItem.setProductionDate(materialMap.get(barCode).getProductionDate());
+            depotItem.setPosition(materialMap.get(barCode).getPosition());
             //以下进行单位换算
             //以下进行单位换算
             Unit unitInfo = materialService.findUnit(depotItem.getMaterialId()); //查询多单位信息
             Unit unitInfo = materialService.findUnit(depotItem.getMaterialId()); //查询多单位信息
             if (StringUtil.isExist(depotItem.getOperNumber())) {
             if (StringUtil.isExist(depotItem.getOperNumber())) {
@@ -2096,7 +2118,7 @@ public class DepotHeadServiceImpl extends ServiceImpl<DepotHeadMapper, DepotHead
             if (depotHead.getTotalPrice().compareTo(BigDecimal.ZERO) < 0){
             if (depotHead.getTotalPrice().compareTo(BigDecimal.ZERO) < 0){
                 totalPrice = totalPrice.negate();
                 totalPrice = totalPrice.negate();
             }
             }
-            this.update(new UpdateWrapper<DepotHead>().set("total_price",totalPrice).set("change_amount",totalPrice).set("discount_last_money",sum).eq("id",depotHead.getId()));
+            this.update(new UpdateWrapper<DepotHead>().set("total_price",totalPrice).set("discount_last_money",sum).eq("id",depotHead.getId()));
 
 
     }
     }
 
 

+ 10 - 8
src/main/java/com/jsh/erp/service/impl/DepotItemServiceImpl.java

@@ -114,14 +114,14 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public PDADepotItemVO pdaDetail(Long id) throws Exception {
+    public PDADepotItemVO pdaDetail(Long id, Long depotId) throws Exception {
         PDADepotItemVO itemVO = depotItemMapper.pdaDetail(id);
         PDADepotItemVO itemVO = depotItemMapper.pdaDetail(id);
         Unit unitInfo = materialService.findUnit(itemVO.getMaterialId()); //查询多单位信息
         Unit unitInfo = materialService.findUnit(itemVO.getMaterialId()); //查询多单位信息
         BigDecimal stock;
         BigDecimal stock;
         if (unitInfo != null && unitInfo.getId() != null){
         if (unitInfo != null && unitInfo.getId() != null){
-            stock = unitService.parseStockByUnit(materialService.getMaterialStockByMid(itemVO.getMaterialId()),unitInfo,itemVO.getCommodityUnit());
+            stock = unitService.parseStockByUnit(materialService.getCurrentStockByMaterialIdAndDepotId(itemVO.getMaterialId(),depotId),unitInfo,itemVO.getMaterialUnit());
         }else {
         }else {
-            stock = materialService.getMaterialStockByMid(itemVO.getMaterialId());
+            stock = materialService.getCurrentStockByMaterialIdAndDepotId(itemVO.getMaterialId(),depotId);
         }
         }
         itemVO.setInventory(stock.toString());
         itemVO.setInventory(stock.toString());
         return itemVO;
         return itemVO;
@@ -781,7 +781,7 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
                 if (StringUtil.isExist(rowObj.get("taxRate"))) {
                 if (StringUtil.isExist(rowObj.get("taxRate"))) {
                     depotItem.setTaxRate(rowObj.getBigDecimal("taxRate"));
                     depotItem.setTaxRate(rowObj.getBigDecimal("taxRate"));
                     //金额*税率
                     //金额*税率
-                    depotItem.setTaxLastMoney(depotItem.getAllPrice().multiply(depotItem.getTaxRate()).divide(new BigDecimal("100"),2,BigDecimal.ROUND_HALF_UP));
+                    depotItem.setTaxMoney(depotItem.getAllPrice().multiply(depotItem.getTaxRate()).divide(new BigDecimal("100"),2,BigDecimal.ROUND_HALF_UP));
                 }
                 }
                 //税额
                 //税额
                 if (StringUtil.isExist(rowObj.get("taxMoney"))) {
                 if (StringUtil.isExist(rowObj.get("taxMoney"))) {
@@ -792,7 +792,7 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
                 if (StringUtil.isExist(rowObj.get("taxLastMoney"))) {
                 if (StringUtil.isExist(rowObj.get("taxLastMoney"))) {
                     //单价总额 + 税额
                     //单价总额 + 税额
                     //depotItem.setTaxLastMoney(rowObj.getBigDecimal("taxLastMoney"));
                     //depotItem.setTaxLastMoney(rowObj.getBigDecimal("taxLastMoney"));
-                    depotItem.setTaxLastMoney(depotItem.getAllPrice().add(depotItem.getTaxLastMoney() == null ? BigDecimal.ZERO : depotItem.getTaxLastMoney()));
+                    depotItem.setTaxLastMoney(depotItem.getAllPrice().add(depotItem.getTaxMoney() == null ? BigDecimal.ZERO : depotItem.getTaxMoney()));
                 }
                 }
                 if (StringUtil.isExist(rowObj.get("mType"))) {
                 if (StringUtil.isExist(rowObj.get("mType"))) {
                     depotItem.setMaterialType(rowObj.getString("mType"));
                     depotItem.setMaterialType(rowObj.getString("mType"));
@@ -835,8 +835,8 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
                                 //跳过
                                 //跳过
                             } else {
                             } else {
                                 //售出序列号,获得当前操作人
                                 //售出序列号,获得当前操作人
-                                User userInfo = userService.getCurrentUser();
-                                serialNumberService.checkAndUpdateSerialNumber(depotItem, depotHead.getNumber(), userInfo, StringUtil.toNull(depotItem.getSnList()));
+                                //User userInfo = userService.getCurrentUser();
+                                //serialNumberService.checkAndUpdateSerialNumber(depotItem, depotHead.getNumber(), userInfo, StringUtil.toNull(depotItem.getSnList()));
                             }
                             }
                         }
                         }
                     }
                     }
@@ -856,7 +856,7 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
                 //更新当前库存
                 //更新当前库存
                 updateCurrentStock(depotItem);
                 updateCurrentStock(depotItem);
                 //更新当前成本价
                 //更新当前成本价
-                updateCurrentUnitPrice(depotItem);
+                //updateCurrentUnitPrice(depotItem);
                 //更新商品的价格
                 //更新商品的价格
                 updateMaterialExtendPrice(materialExtend.getId(), depotHead.getSubType(), depotHead.getBillType(), rowObj);
                 updateMaterialExtendPrice(materialExtend.getId(), depotHead.getSubType(), depotHead.getBillType(), rowObj);
             }
             }
@@ -1387,9 +1387,11 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
         if(mId!=null && dId!=null) {
         if(mId!=null && dId!=null) {
             //-先清除再插入,防止商品仓库变更,数据对不上
             //-先清除再插入,防止商品仓库变更,数据对不上
             materialCurrentStockMapper.delete(new LambdaQueryWrapperX<MaterialCurrentStock>().eq(MaterialCurrentStock::getMaterialId,mId).eqIfPresent(MaterialCurrentStock::getDepotId,dId));
             materialCurrentStockMapper.delete(new LambdaQueryWrapperX<MaterialCurrentStock>().eq(MaterialCurrentStock::getMaterialId,mId).eqIfPresent(MaterialCurrentStock::getDepotId,dId));
+            Material material = materialService.getOne(new LambdaQueryWrapperX<Material>().eq(Material::getId,mId));
             MaterialCurrentStock materialCurrentStock = new MaterialCurrentStock();
             MaterialCurrentStock materialCurrentStock = new MaterialCurrentStock();
             materialCurrentStock.setMaterialId(mId);
             materialCurrentStock.setMaterialId(mId);
             materialCurrentStock.setDepotId(dId);
             materialCurrentStock.setDepotId(dId);
+            materialCurrentStock.setCurrentUnitPrice(material.getDefaultPurchaseDecimal());
             //设置当前库存数量
             //设置当前库存数量
             materialCurrentStock.setCurrentNumber(getStockByParam(dId,mId,null,null));
             materialCurrentStock.setCurrentNumber(getStockByParam(dId,mId,null,null));
             //添加当前库存
             //添加当前库存

+ 56 - 32
src/main/java/com/jsh/erp/service/impl/MaterialBatchServiceImpl.java

@@ -4,10 +4,11 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jsh.erp.datasource.entities.*;
 import com.jsh.erp.datasource.entities.*;
 import com.jsh.erp.datasource.mappers.MaterialBatchMapper;
 import com.jsh.erp.datasource.mappers.MaterialBatchMapper;
-import com.jsh.erp.datasource.mappers.MaterialCategoryMapperEx;
+import com.jsh.erp.datasource.mappers.MaterialInitialStockMapper;
 import com.jsh.erp.datasource.vo.TaskStocktakingItemVO;
 import com.jsh.erp.datasource.vo.TaskStocktakingItemVO;
 import com.jsh.erp.exception.JshException;
 import com.jsh.erp.exception.JshException;
 import com.jsh.erp.query.LambdaQueryWrapperX;
 import com.jsh.erp.query.LambdaQueryWrapperX;
+import com.jsh.erp.query.QueryWrapperX;
 import com.jsh.erp.service.*;
 import com.jsh.erp.service.*;
 import com.jsh.erp.utils.DateUtils;
 import com.jsh.erp.utils.DateUtils;
 import com.jsh.erp.utils.RandomHelper;
 import com.jsh.erp.utils.RandomHelper;
@@ -18,7 +19,6 @@ import org.springframework.stereotype.Service;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Arrays;
 import java.util.Date;
 import java.util.Date;
 import java.util.List;
 import java.util.List;
@@ -43,12 +43,14 @@ public class MaterialBatchServiceImpl extends ServiceImpl<MaterialBatchMapper,Ma
     private InventoryLogService inventoryLogService;
     private InventoryLogService inventoryLogService;
 
 
     @Resource
     @Resource
-    private MaterialService materialService;
+    private MaterialInitialStockMapper materialInitialStockMapper;
 
 
 
 
+    /**
+     * 根据单据子表id生成商品批次数据
+     */
     @Override
     @Override
     public void generateMaterialBatchByDepotItemId(DepotItem depotItem, Long supplierId) throws Exception {
     public void generateMaterialBatchByDepotItemId(DepotItem depotItem, Long supplierId) throws Exception {
-        //获取单据子表信息
         //获取条码信息
         //获取条码信息
         MaterialExtend materialExtend = materialExtendService.getMaterialExtend(depotItem.getMaterialExtendId());
         MaterialExtend materialExtend = materialExtendService.getMaterialExtend(depotItem.getMaterialExtendId());
         //创建批次信息
         //创建批次信息
@@ -61,6 +63,10 @@ public class MaterialBatchServiceImpl extends ServiceImpl<MaterialBatchMapper,Ma
         materialBatch.setSupplierId(supplierId);
         materialBatch.setSupplierId(supplierId);
         //设置商品单位
         //设置商品单位
         materialBatch.setCommodityUnit(depotItem.getMaterialUnit());
         materialBatch.setCommodityUnit(depotItem.getMaterialUnit());
+        //设置采购价
+        materialBatch.setPurchaseDecimal(depotItem.getUnitPrice());
+        //设置销售价
+        materialBatch.setWholesaleDecimal(depotItem.getWholesaleDecimal());
         User user = userService.getCurrentUser();
         User user = userService.getCurrentUser();
         //创建人编码
         //创建人编码
         materialBatch.setCreateSerial(user.getLoginName());
         materialBatch.setCreateSerial(user.getLoginName());
@@ -81,28 +87,47 @@ public class MaterialBatchServiceImpl extends ServiceImpl<MaterialBatchMapper,Ma
         materialBatch.setPosition(depotItem.getPosition());
         materialBatch.setPosition(depotItem.getPosition());
         //条码
         //条码
         materialBatch.setBarCode(materialExtend.getBarCode());
         materialBatch.setBarCode(materialExtend.getBarCode());
+        materialBatch.setMaterialExtendId(materialExtend.getId());
         materialBatchMapper.insert(materialBatch);
         materialBatchMapper.insert(materialBatch);
     }
     }
 
 
     @Override
     @Override
     public void handleMaterialBatchByDepotItemId(Long diId) throws Exception {
     public void handleMaterialBatchByDepotItemId(Long diId) throws Exception {
         DepotItem depotItem = depotItemService.getDepotItem(diId);
         DepotItem depotItem = depotItemService.getDepotItem(diId);
+        //获取商品期初库存
+        MaterialInitialStock mis = materialInitialStockMapper.selectOne(new LambdaQueryWrapperX<MaterialInitialStock>()
+                .eq(MaterialInitialStock::getMaterialId,depotItem.getMaterialId())
+                .eq(MaterialInitialStock::getDepotId,depotItem.getDepotId())
+                .eq(MaterialInitialStock::getDeleteFlag,"0"));
         //根据单据商品id查询商品批次数据
         //根据单据商品id查询商品批次数据
         List<MaterialBatch> list = materialBatchMapper.getMaterialBatchByMaterialId(depotItem.getMaterialId(),depotItem.getDepotId());
         List<MaterialBatch> list = materialBatchMapper.getMaterialBatchByMaterialId(depotItem.getMaterialId(),depotItem.getDepotId());
         //根据单据子表基础单位数量减去批次库存
         //根据单据子表基础单位数量减去批次库存
         BigDecimal basicNumber = depotItem.getBasicNumber();
         BigDecimal basicNumber = depotItem.getBasicNumber();
-        for (MaterialBatch materialBatch : list) {
-            if (materialBatch.getInventory().compareTo(basicNumber) >= 0){
-                //批次库存足够,扣除库存,结束循环
-                BigDecimal inventory = materialBatch.getInventory().subtract(basicNumber);
-                materialBatch.setInventory(inventory);
-                updateInventory("出库",diId,materialBatch);
-                break;
-            }else {
-                //库存不足,扣除当前批次库存,继续循环
-                basicNumber = basicNumber.subtract(materialBatch.getInventory());
-                materialBatch.setInventory(BigDecimal.ZERO);
-                updateInventory("出库",diId,materialBatch);
+        if (mis != null && mis.getNumber() != null && mis.getNumber().compareTo(basicNumber) >= 0){
+            //初期库存足够,扣除期初库存
+            BigDecimal inventory = mis.getNumber().subtract(basicNumber);
+            mis.setNumber(inventory);
+            materialInitialStockMapper.updateByPrimaryKeySelective(mis);
+        }else {
+            //初期库存不为空,先扣除期初,再从批次扣除
+            if (mis != null && mis.getNumber() != null){
+                basicNumber = basicNumber.subtract(mis.getNumber());
+                mis.setNumber(BigDecimal.ZERO);
+                materialInitialStockMapper.updateByPrimaryKeySelective(mis);
+            }
+            for (MaterialBatch materialBatch : list) {
+                if (materialBatch.getInventory().compareTo(basicNumber) >= 0){
+                    //批次库存足够,扣除库存,结束循环
+                    BigDecimal inventory = materialBatch.getInventory().subtract(basicNumber);
+                    materialBatch.setInventory(inventory);
+                    updateInventory("出库",diId,materialBatch);
+                    break;
+                }else {
+                    //库存不足,扣除当前批次库存,继续循环
+                    basicNumber = basicNumber.subtract(materialBatch.getInventory());
+                    materialBatch.setInventory(BigDecimal.ZERO);
+                    updateInventory("出库",diId,materialBatch);
+                }
             }
             }
         }
         }
     }
     }
@@ -112,19 +137,19 @@ public class MaterialBatchServiceImpl extends ServiceImpl<MaterialBatchMapper,Ma
         if (materialBatch.getInventory() != null){
         if (materialBatch.getInventory() != null){
             //获取修改前库存
             //获取修改前库存
             int originalStock = materialBatchMapper.selectOne("id",materialBatch.getId()).getInventory().intValue();
             int originalStock = materialBatchMapper.selectOne("id",materialBatch.getId()).getInventory().intValue();
-                User user = userService.getCurrentUser();
-                InventoryLog log = new InventoryLog();
-                log.setUpdateUser(user.getId());
-                log.setUpdateTime(new Date());
-                log.setMaterialId(materialBatch.getMaterialId());
-                log.setMaterialExtendId(materialBatch.getId());
-                log.setOriginalStock(originalStock);
-                log.setCurrentStock(materialBatch.getInventory().intValue());
-                log.setItemId(id);
-                log.setType(type);
-                inventoryLogService.save(log);
-                update(new UpdateWrapper<MaterialBatch>().set("inventory",materialBatch.getInventory()).eq("id",materialBatch.getId()));
-                depotItemService.updateCurrentStockFun(materialBatch.getMaterialId(),materialBatch.getDepotId());
+            User user = userService.getCurrentUser();
+            InventoryLog log = new InventoryLog();
+            log.setUpdateUser(user.getId());
+            log.setUpdateTime(new Date());
+            log.setMaterialId(materialBatch.getMaterialId());
+            log.setMaterialExtendId(materialBatch.getId());
+            log.setOriginalStock(originalStock);
+            log.setCurrentStock(materialBatch.getInventory().intValue());
+            log.setItemId(id);
+            log.setType(type);
+            inventoryLogService.save(log);
+            update(new UpdateWrapper<MaterialBatch>().set("inventory",materialBatch.getInventory()).eq("id",materialBatch.getId()));
+            depotItemService.updateCurrentStockFun(materialBatch.getMaterialId(),materialBatch.getDepotId());
         }
         }
     }
     }
 
 
@@ -145,7 +170,6 @@ public class MaterialBatchServiceImpl extends ServiceImpl<MaterialBatchMapper,Ma
     public List<MaterialVo4Unit> findBySelectWithBarCode(Long categoryId, String q, String standardOrModel, String color, String brand, String mfrs, String enableSerialNumber, String enableBatchNumber, Integer offset, Integer rows, Long depotId) throws Exception {
     public List<MaterialVo4Unit> findBySelectWithBarCode(Long categoryId, String q, String standardOrModel, String color, String brand, String mfrs, String enableSerialNumber, String enableBatchNumber, Integer offset, Integer rows, Long depotId) throws Exception {
         List<MaterialVo4Unit> list =null;
         List<MaterialVo4Unit> list =null;
         try{
         try{
-
             if(StringUtil.isNotEmpty(q)) {
             if(StringUtil.isNotEmpty(q)) {
                 q = q.replace("'", "");
                 q = q.replace("'", "");
                 q = q.trim();
                 q = q.trim();
@@ -168,8 +192,8 @@ public class MaterialBatchServiceImpl extends ServiceImpl<MaterialBatchMapper,Ma
         if (barCodes != null && !barCodes.isEmpty()){
         if (barCodes != null && !barCodes.isEmpty()){
             barCodeList = Arrays.asList(barCodes.split(","));
             barCodeList = Arrays.asList(barCodes.split(","));
         }
         }
-        List<Long> ids = materialExtendService.selectIdsByBarCode(barCodeList);
-        List<MaterialBatch> list = materialBatchMapper.selectList(new LambdaQueryWrapperX<MaterialBatch>().eq(MaterialBatch::getDepotId,depotId).inIfPresent(MaterialBatch::getMaterialId,ids).gt(MaterialBatch::getInventory,BigDecimal.ZERO));
+        //List<Long> ids = materialExtendService.selectIdsByBarCode(barCodeList);
+        List<MaterialBatch> list = materialBatchMapper.selectList(new LambdaQueryWrapperX<MaterialBatch>().eq(MaterialBatch::getDepotId,depotId).inIfPresent(MaterialBatch::getBarCode,barCodeList).gt(MaterialBatch::getInventory,BigDecimal.ZERO));
         return list;
         return list;
     }
     }
 
 

+ 11 - 6
src/main/java/com/jsh/erp/service/impl/MaterialCategoryServiceImpl.java

@@ -44,11 +44,14 @@ public class MaterialCategoryServiceImpl extends ServiceImpl<MaterialCategoryMap
     @Resource
     @Resource
     private MaterialMapperEx materialMapperEx;
     private MaterialMapperEx materialMapperEx;
 
 
+    /**
+     * 根据id查询商品类别
+     */
     @Override
     @Override
     public MaterialCategory getMaterialCategory(long id)throws Exception {
     public MaterialCategory getMaterialCategory(long id)throws Exception {
-        MaterialCategory result=null;
+        MaterialCategory result = null;
         try{
         try{
-            result=materialCategoryMapper.selectByPrimaryKey(id);
+            result = materialCategoryMapper.selectByPrimaryKey(id);
         }catch(Exception e){
         }catch(Exception e){
             JshException.readFail(logger, e);
             JshException.readFail(logger, e);
         }
         }
@@ -126,11 +129,13 @@ public class MaterialCategoryServiceImpl extends ServiceImpl<MaterialCategoryMap
 
 
     @Override
     @Override
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
-    public int insertMaterialCategory(JSONObject obj, HttpServletRequest request)throws Exception {
-        MaterialCategory materialCategory = JSONObject.parseObject(obj.toJSONString(), MaterialCategory.class);
+    public int insertMaterialCategory(MaterialCategory materialCategory, HttpServletRequest request)throws Exception {
+        //创建时间
         materialCategory.setCreateTime(new Date());
         materialCategory.setCreateTime(new Date());
+        //修改时间
         materialCategory.setUpdateTime(new Date());
         materialCategory.setUpdateTime(new Date());
         User user = userService.getCurrentUser();
         User user = userService.getCurrentUser();
+        //租户id
         materialCategory.setTenantId(user.getId());
         materialCategory.setTenantId(user.getId());
         int result = 0;
         int result = 0;
         try{
         try{
@@ -145,8 +150,8 @@ public class MaterialCategoryServiceImpl extends ServiceImpl<MaterialCategoryMap
 
 
     @Override
     @Override
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
-    public int updateMaterialCategory(JSONObject obj, HttpServletRequest request) throws Exception{
-        MaterialCategory materialCategory = JSONObject.parseObject(obj.toJSONString(), MaterialCategory.class);
+    public int updateMaterialCategory(MaterialCategory materialCategory, HttpServletRequest request) throws Exception{
+        //修改时间
         materialCategory.setUpdateTime(new Date());
         materialCategory.setUpdateTime(new Date());
         int result=0;
         int result=0;
         try{
         try{

+ 0 - 1
src/main/java/com/jsh/erp/service/impl/MaterialExtendServiceImpl.java

@@ -311,7 +311,6 @@ public class MaterialExtendServiceImpl extends ServiceImpl<MaterialExtendMapper,
                 this.insertMaterialExtend(materialExtend);
                 this.insertMaterialExtend(materialExtend);
             }
             }
         }
         }
-
         //修改拓展行
         //修改拓展行
         if (!updatedList.isEmpty()) {
         if (!updatedList.isEmpty()) {
             for (MaterialExtend materialExtend : updatedList) {
             for (MaterialExtend materialExtend : updatedList) {

+ 155 - 105
src/main/java/com/jsh/erp/service/impl/MaterialServiceImpl.java

@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jsh.erp.constants.BusinessConstants;
 import com.jsh.erp.constants.BusinessConstants;
 import com.jsh.erp.constants.ExceptionConstants;
 import com.jsh.erp.constants.ExceptionConstants;
@@ -41,6 +42,7 @@ import java.io.File;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.*;
+import java.util.stream.Collectors;
 
 
 @Service
 @Service
 public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> implements MaterialService {
 public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> implements MaterialService {
@@ -134,12 +136,14 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
 
 
 
 
 
 
+    /**
+     * 查询商品管理-商品信息列表查询
+     */
     @Override
     @Override
     public List<MaterialVo4Unit> select(String materialParam, String standard, String model, String color, String brand, String mfrs,
     public List<MaterialVo4Unit> select(String materialParam, String standard, String model, String color, String brand, String mfrs,
                                         String materialOther, String weight, String expiryNum, String enableSerialNumber,
                                         String materialOther, String weight, String expiryNum, String enableSerialNumber,
                                         String enableBatchNumber, String position, String enabled, String remark, String categoryId,
                                         String enableBatchNumber, String position, String enabled, String remark, String categoryId,
-                                        String mpList)
-            throws Exception{
+                                        String mpList,String reminder) {
         String[] mpArr = new String[]{};
         String[] mpArr = new String[]{};
         if(StringUtil.isNotEmpty(mpList)){
         if(StringUtil.isNotEmpty(mpList)){
             mpArr= mpList.split(",");
             mpArr= mpList.split(",");
@@ -147,12 +151,13 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
         List<MaterialVo4Unit> list = new ArrayList<>();
         List<MaterialVo4Unit> list = new ArrayList<>();
         try{
         try{
             List<Long> idList = new ArrayList<>();
             List<Long> idList = new ArrayList<>();
+            //类型不为空,获取类型id集合
             if(StringUtil.isNotEmpty(categoryId)){
             if(StringUtil.isNotEmpty(categoryId)){
                 idList = getListByParentId(Long.parseLong(categoryId));
                 idList = getListByParentId(Long.parseLong(categoryId));
             }
             }
             PageUtils.startPage();
             PageUtils.startPage();
             list= materialMapperEx.selectByConditionMaterial(materialParam, standard, model, color, brand, mfrs, materialOther, weight, expiryNum,
             list= materialMapperEx.selectByConditionMaterial(materialParam, standard, model, color, brand, mfrs, materialOther, weight, expiryNum,
-                    enableSerialNumber, enableBatchNumber, position, enabled, remark, idList, mpList);
+                    enableSerialNumber, enableBatchNumber, position, enabled, remark, idList, mpList,reminder);
             if (null != list && list.size()>0) {
             if (null != list && list.size()>0) {
                 Map<Long,BigDecimal> initialStockMap = getInitialStockMapByMaterialList(list);
                 Map<Long,BigDecimal> initialStockMap = getInitialStockMapByMaterialList(list);
                 Map<Long,BigDecimal> currentStockMap = getCurrentStockMapByMaterialList(list);
                 Map<Long,BigDecimal> currentStockMap = getCurrentStockMapByMaterialList(list);
@@ -179,9 +184,9 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
      */
      */
     @Override
     @Override
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
-    public int insertMaterial(MaterialDto obj, HttpServletRequest request)throws Exception {
+    public int insertMaterial(MaterialDto material, HttpServletRequest request)throws Exception {
         //商品主表信息
         //商品主表信息
-        Material m = obj;
+        Material m = material;
         //设置状态
         //设置状态
         m.setEnabled(true);
         m.setEnabled(true);
         //获取类型编码
         //获取类型编码
@@ -189,39 +194,27 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
         String sku = serial_no + DateUtils.dateTimeNow()  + RandomHelper.getRandomStr(6);
         String sku = serial_no + DateUtils.dateTimeNow()  + RandomHelper.getRandomStr(6);
         //设置系统sku
         //设置系统sku
         m.setSystemSku(sku);
         m.setSystemSku(sku);
-        User user = userService.getCurrentUser();
         try{
         try{
             //添加商品
             //添加商品
             materialMapperEx.insertSelectiveEx(m);
             materialMapperEx.insertSelectiveEx(m);
             Long mId = m.getId();
             Long mId = m.getId();
             //添加商品条码信息
             //添加商品条码信息
-            materialExtendService.saveDetails(obj.getMbList(),obj.getSortList().toJSONString(),mId,"insert");
-            //materialExtendService.saveDetials(null, obj.getSortList(), mId, "insert");
+            materialExtendService.saveDetails(material.getMbList(),material.getSortList().toJSONString(),mId,"insert");
             //设置初始库存
             //设置初始库存
-            if(obj.getStock()!=null) {
-                List<MaterialInitialStock> stockArr = obj.getStock();
+            if(material.getStock()!=null) {
+                List<MaterialInitialStock> stockArr = material.getStock();
                 for (int i = 0; i < stockArr.size(); i++) {
                 for (int i = 0; i < stockArr.size(); i++) {
                     MaterialInitialStock jsonObj = stockArr.get(i);
                     MaterialInitialStock jsonObj = stockArr.get(i);
-                    //此时id为仓库id,仓库di、最低安全库存数量不为空
-                    if(jsonObj.getId() != null && jsonObj.getLowSafeStock() != null || jsonObj.getPosition() != null) {
-                        BigDecimal lowSafeStock = jsonObj.getLowSafeStock();
-                        BigDecimal highSafeStock = null;
-                        if(jsonObj.getHighSafeStock() != null) {
-                            highSafeStock = jsonObj.getHighSafeStock();
-                        }
+                    //此时id为仓库id,仓库id、最低安全库存数量、库位不为空
+                    if(jsonObj.getId() != null && jsonObj.getLowSafeStock() != null || jsonObj.getPosition() != null || jsonObj.getHighSafeStock() != null) {
                         Long depotId = jsonObj.getId();
                         Long depotId = jsonObj.getId();
                         jsonObj.setDepotId(depotId);
                         jsonObj.setDepotId(depotId);
                         jsonObj.setMaterialId(mId);
                         jsonObj.setMaterialId(mId);
                         jsonObj.setId(null);
                         jsonObj.setId(null);
-                        if(lowSafeStock != null || highSafeStock != null || jsonObj.getPosition() != null) {
-                            //设置初始库
-                            materialInitialStockMapper.insertSelective(jsonObj);
-                            //insertInitialStockByMaterialAndDepot(jsonObj);
-                            //设置当前库
-                            //insertCurrentStockByMaterialAndDepot(depotId, mId, parseBigDecimalEx(number));
-                            //更新当前库存
-                            //depotItemService.updateCurrentStockFun(mId, depotId);
-                        }
+                        //设置初始库
+                        materialInitialStockMapper.insertSelective(jsonObj);
+                        //更新当前库存
+                        depotItemService.updateCurrentStockFun(mId,jsonObj.getDepotId());
                     }
                     }
                 }
                 }
             }
             }
@@ -258,7 +251,7 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                 List<MaterialInitialStock> stockArr = obj.getStock();
                 List<MaterialInitialStock> stockArr = obj.getStock();
                 for (int i = 0; i < stockArr.size(); i++) {
                 for (int i = 0; i < stockArr.size(); i++) {
                     MaterialInitialStock jsonObj = stockArr.get(i);
                     MaterialInitialStock jsonObj = stockArr.get(i);
-                    if(jsonObj.getId() != null && jsonObj.getLowSafeStock() != null || jsonObj.getPosition() != null) {
+                    if(jsonObj.getId() != null && jsonObj.getLowSafeStock() != null || jsonObj.getPosition() != null || jsonObj.getNumber() != null) {
                         BigDecimal lowSafeStock = jsonObj.getLowSafeStock();
                         BigDecimal lowSafeStock = jsonObj.getLowSafeStock();
                         BigDecimal highSafeStock = null;
                         BigDecimal highSafeStock = null;
                         if(jsonObj.getHighSafeStock() != null) {
                         if(jsonObj.getHighSafeStock() != null) {
@@ -272,12 +265,12 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                         MaterialInitialStockExample example = new MaterialInitialStockExample();
                         MaterialInitialStockExample example = new MaterialInitialStockExample();
                         example.createCriteria().andMaterialIdEqualTo(material.getId()).andDepotIdEqualTo(depotId);
                         example.createCriteria().andMaterialIdEqualTo(material.getId()).andDepotIdEqualTo(depotId);
                         materialInitialStockMapper.deleteByExample(example);
                         materialInitialStockMapper.deleteByExample(example);
-                        if (lowSafeStock!=null || highSafeStock!=null || jsonObj.getPosition() != null) {
+                        if (lowSafeStock!=null || highSafeStock!=null || jsonObj.getPosition() != null || jsonObj.getNumber() != null) {
                             //insertInitialStockByMaterialAndDepot(depotId, material.getId(), parseBigDecimalEx("0"), lowSafeStock, highSafeStock);
                             //insertInitialStockByMaterialAndDepot(depotId, material.getId(), parseBigDecimalEx("0"), lowSafeStock, highSafeStock);
                             materialInitialStockMapper.insertSelective(jsonObj);
                             materialInitialStockMapper.insertSelective(jsonObj);
                         }
                         }
                         //更新当前库存
                         //更新当前库存
-                        //depotItemService.updateCurrentStockFun(material.getId(), depotId);
+                        depotItemService.updateCurrentStockFun(material.getId(), depotId);
                     }
                     }
                 }
                 }
             }
             }
@@ -309,7 +302,7 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
     @Override
     @Override
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     public int batchDeleteMaterialByIds(String ids) throws Exception{
     public int batchDeleteMaterialByIds(String ids) throws Exception{
-        String [] idArray=ids.split(",");
+        String [] idArray = ids.split(",");
         //校验单据子表	jsh_depot_item
         //校验单据子表	jsh_depot_item
         List<DepotItem> depotItemList =null;
         List<DepotItem> depotItemList =null;
         try{
         try{
@@ -436,7 +429,7 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
      */
      */
     @Override
     @Override
     public List<Long> getListByParentId(Long parentId) {
     public List<Long> getListByParentId(Long parentId) {
-        List<Long> idList = new ArrayList<Long>();
+        List<Long> idList = new ArrayList<>();
         List<MaterialCategory> list = materialCategoryMapperEx.getListByParentId(parentId);
         List<MaterialCategory> list = materialCategoryMapperEx.getListByParentId(parentId);
         idList.add(parentId);
         idList.add(parentId);
         if(list!=null && list.size()>0) {
         if(list!=null && list.size()>0) {
@@ -570,7 +563,7 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
             otherMaterialMap.putIfAbsent(me.getMaterialId(), me);
             otherMaterialMap.putIfAbsent(me.getMaterialId(), me);
         }
         }
         String nameStr = "名称*,规格,型号,颜色,品牌,类别,基础重量(kg),基本单位*,副单位,比例,多属性," +
         String nameStr = "名称*,规格,型号,颜色,品牌,类别,基础重量(kg),基本单位*,副单位,比例,多属性," +
-                "状态*,序列号,系统sku,商品条码,自定义1,自定义2,自定义3,备注";
+                "状态*,序列号,系统sku,商品条码,默认采购价,默认销售价,自定义1,自定义2,自定义3,备注";
         List<String> nameList = StringUtil.strToStringList(nameStr);
         List<String> nameList = StringUtil.strToStringList(nameStr);
         //仓库列表
         //仓库列表
         List<Depot> depotList = depotService.getAllList();
         List<Depot> depotList = depotService.getAllList();
@@ -608,12 +601,14 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                 objs[12] = m.getEnableSerialNumber();
                 objs[12] = m.getEnableSerialNumber();
                 objs[13] = m.getSystemSku();
                 objs[13] = m.getSystemSku();
                 objs[14] = m.getBarCode();
                 objs[14] = m.getBarCode();
-                objs[15] = m.getOtherField1();
-                objs[16] = m.getOtherField2();
-                objs[17] = m.getOtherField3();
-                objs[18] = m.getRemark();
+                objs[15] = m.getDefaultPurchaseDecimal() == null ? "" : m.getDefaultPurchaseDecimal().toString();
+                objs[16] = m.getDefaultWholesaleDecimal() == null ? "" : m.getDefaultWholesaleDecimal().toString();
+                objs[17] = m.getOtherField1();
+                objs[18] = m.getOtherField2();
+                objs[19] = m.getOtherField3();
+                objs[20] = m.getRemark();
                 //仓库期初库存
                 //仓库期初库存
-                int i = 19;
+                int i = 21;
 //                for(Depot depot: depotList) {
 //                for(Depot depot: depotList) {
 //                    BigDecimal number = misMap.get(m.getId() + "_" + depot.getId());
 //                    BigDecimal number = misMap.get(m.getId() + "_" + depot.getId());
 //                    objs[i] = number == null ? "0" : number.setScale(2, BigDecimal.ROUND_HALF_UP).toString();
 //                    objs[i] = number == null ? "0" : number.setScale(2, BigDecimal.ROUND_HALF_UP).toString();
@@ -1023,7 +1018,7 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
     private Map<Long, String> getExcelDepot(Sheet src, int depotCount, Map<String, Long> depotMap, int i) throws Exception {
     private Map<Long, String> getExcelDepot(Sheet src, int depotCount, Map<String, Long> depotMap, int i) throws Exception {
         Map<Long, String> stockMap = new HashMap<>();
         Map<Long, String> stockMap = new HashMap<>();
         for(int j = 1; j<= depotCount; j++) {
         for(int j = 1; j<= depotCount; j++) {
-            int col = 16 + j;
+            int col = 18 + j;
             if(col < src.getColumns()){
             if(col < src.getColumns()){
                 String depotName = ExcelUtils.getContent(src, 1, col); //获取仓库名称
                 String depotName = ExcelUtils.getContent(src, 1, col); //获取仓库名称
                 if(StringUtil.isNotEmpty(depotName)) {
                 if(StringUtil.isNotEmpty(depotName)) {
@@ -1031,6 +1026,12 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                     if(depotId!=null && depotId!=0L){
                     if(depotId!=null && depotId!=0L){
                         String stockStr = ExcelUtils.getContent(src, i, col);
                         String stockStr = ExcelUtils.getContent(src, i, col);
                         if(StringUtil.isNotEmpty(stockStr)) {
                         if(StringUtil.isNotEmpty(stockStr)) {
+                            String [] depots = stockStr.split(",");
+                            //校验库存是否是数字(含小数)
+                            if(!StringUtil.isPositiveBigDecimal(depots[0])) {
+                                throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_STOCK_NOT_DECIMAL_CODE,
+                                        String.format(ExceptionConstants.MATERIAL_STOCK_NOT_DECIMAL_MSG, i+1));
+                            }
                             stockMap.put(depotId, stockStr);
                             stockMap.put(depotId, stockStr);
                         }
                         }
                     }
                     }
@@ -1614,14 +1615,12 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
 
 
     /**
     /**
      * 根据商品id查询主表及子表信息
      * 根据商品id查询主表及子表信息
-     * @param id 商品id
-     * @return
      */
      */
     @Override
     @Override
     public Material getMaterialById(Long id){
     public Material getMaterialById(Long id){
         Material material = materialMapper.selectByPrimaryKey(id);
         Material material = materialMapper.selectByPrimaryKey(id);
-        List<MaterialExtend> list = materialExtendMapper.selectByMId(id);
-        material.setList(list);
+//        List<MaterialExtend> list = materialExtendMapper.selectByMId(id);
+//        material.setList(list);
         return material;
         return material;
     }
     }
 
 
@@ -1653,11 +1652,32 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
         List<String> expirationReminders = new ArrayList<>();
         List<String> expirationReminders = new ArrayList<>();
         List<String> inventoryReminders = new ArrayList<>();
         List<String> inventoryReminders = new ArrayList<>();
         //获取商品信息
         //获取商品信息
-        MaterialExample materialExample = new MaterialExample();
-        materialExample.createCriteria().andDeleteFlagEqualTo("0");
-        List<Material> materials = materialMapper.selectByExample(materialExample);
+        List<Material> materials = list(new LambdaQueryWrapperX<Material>().isNotNull(Material::getMovingPinReminderCycle).eq(Material::getDeleteFlag,"0"));
+        //所有商品提醒信息赋值为空
+        this.update(new UpdateWrapper<Material>().set("reminder","").eq("delete_flag","0"));
         //获取商品批次信息
         //获取商品批次信息
-        List<MaterialBatch> extendList = materialBatchService.list(new LambdaQueryWrapperX<MaterialBatch>().eq(MaterialBatch::getDeleteFlag,"0"));
+        List<MaterialBatch> extendList = materialBatchService.list(new LambdaQueryWrapperX<MaterialBatch>().gt(MaterialBatch::getInventory,"0").eq(MaterialBatch::getDeleteFlag,"0"));
+        Map<Long,Material> materialMap = new HashMap<>();
+        //过期提醒
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        extendList.stream().filter(v -> v.getInventory() != null && v.getInventory().doubleValue() > 0 && v.getProductionDate() != null && v.getExpiryNum() != null)
+                .forEach(v ->{
+                    if (DateUtils.differentDaysByMillisecond(v.getProductionDate(),new Date()) >  (v.getExpiryNum() -30)){
+                        String name = materialMapper.selectByPrimaryKey(v.getMaterialId()).getName();
+                        String str = "商品名称:" + name
+                                + ", 批次号:" + v.getBatchNumber()
+                                + ", 条码:" + v.getBarCode()
+                                + ", 生产日期:" + sdf.format(v.getProductionDate())
+                                + ", 保质期:" + v.getExpiryNum() + "天"
+                                + ", 库存:" + v.getInventory()
+                                + ",即将要过期,请及时处理";
+                        expirationReminders.add(str);
+                        if (materialMap.get(v.getMaterialId()) == null){
+                            materialMap.put(v.getMaterialId(),new Material().setId(v.getMaterialId()).setReminder("临期"));
+                        }
+                    }
+                });
+        vo.setExpirationReminder(expirationReminders);
         //无动销提醒
         //无动销提醒
         materials.stream().filter( v -> v.getMovingPinReminderCycle() != null && !"".equals(v.getMovingPinReminderCycle()))
         materials.stream().filter( v -> v.getMovingPinReminderCycle() != null && !"".equals(v.getMovingPinReminderCycle()))
                         .forEach(v -> {
                         .forEach(v -> {
@@ -1668,6 +1688,11 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                                     //当前时间对比订单时间是否大于动销提醒周期
                                     //当前时间对比订单时间是否大于动销提醒周期
                                     String str = "商品名称:" + v.getName() + ",在[无动销提醒周期]内,无动销,请及时处理";
                                     String str = "商品名称:" + v.getName() + ",在[无动销提醒周期]内,无动销,请及时处理";
                                     noMovingPinReminders.add(str);
                                     noMovingPinReminders.add(str);
+                                    if (materialMap.get(v.getId()) == null){
+                                        materialMap.put(v.getId(),new Material().setId(v.getId()).setReminder("无动销"));
+                                    }else {
+                                        materialMap.put(v.getId(),new Material().setId(v.getId()).setReminder(materialMap.get(v.getId()).getReminder() + ",无动销"));
+                                    }
                                 }
                                 }
                             }else{
                             }else{
                                 //获取商品批次信息
                                 //获取商品批次信息
@@ -1675,33 +1700,22 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                                 if (DateUtils.differentDaysByMillisecond(m.getCreateTime(),new Date()) > Integer.valueOf(v.getMovingPinReminderCycle())){
                                 if (DateUtils.differentDaysByMillisecond(m.getCreateTime(),new Date()) > Integer.valueOf(v.getMovingPinReminderCycle())){
                                     String str = "商品名称:" + v.getName() + ",在[无动销提醒周期]内,无动销,请及时处理";
                                     String str = "商品名称:" + v.getName() + ",在[无动销提醒周期]内,无动销,请及时处理";
                                     noMovingPinReminders.add(str);
                                     noMovingPinReminders.add(str);
+                                    if (materialMap.get(v.getId()) == null){
+                                        materialMap.put(v.getId(),new Material().setId(v.getId()).setReminder("无动销"));
+                                    }else {
+                                        materialMap.get(v.getId()).setRemark(materialMap.get(v.getId()).getReminder() + ",无动销");
+                                    }
                                 }
                                 }
                             }
                             }
 
 
                         });
                         });
         vo.setNoMovingPinReminder(noMovingPinReminders);
         vo.setNoMovingPinReminder(noMovingPinReminders);
-        //过期提醒
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-        extendList.stream().filter(v -> v.getInventory() != null && v.getInventory().doubleValue() > 0 && v.getProductionDate() != null && v.getExpiryNum() != null)
-                .forEach(v ->{
-                    if (DateUtils.differentDaysByMillisecond(v.getProductionDate(),new Date()) >  (v.getExpiryNum() -30)){
-                        String name = materialMapper.selectByPrimaryKey(v.getMaterialId()).getName();
-                        String str = "商品名称:" + name
-                                + ", 批次号:" + v.getBatchNumber()
-                                + ", 条码:" + v.getBarCode()
-                                + ", 生产日期:" + sdf.format(v.getProductionDate())
-                                + ", 保质期:" + v.getExpiryNum() + "天"
-                                + ", 库存:" + v.getInventory()
-                                + ",即将要过期,请及时处理";
-                        expirationReminders.add(str);
-                    }
-                });
-        vo.setExpirationReminder(expirationReminders);
         //库存提醒
         //库存提醒
         MaterialInitialStockExample initialStockExample = new MaterialInitialStockExample();
         MaterialInitialStockExample initialStockExample = new MaterialInitialStockExample();
         initialStockExample.createCriteria().andDeleteFlagEqualTo("0");
         initialStockExample.createCriteria().andDeleteFlagEqualTo("0");
-
         List<MaterialInitialStock> initialStocks = materialInitialStockMapper.selectByExample(initialStockExample);
         List<MaterialInitialStock> initialStocks = materialInitialStockMapper.selectByExample(initialStockExample);
+        List<Depot> depotList = depotService.list();
+        Map<Long,String> depotMap = depotList.stream().collect(Collectors.toMap(Depot::getId,Depot::getName));
         initialStocks.stream().filter(v -> v.getLowSafeStock() != null && v.getLowSafeStock().doubleValue() > 0)
         initialStocks.stream().filter(v -> v.getLowSafeStock() != null && v.getLowSafeStock().doubleValue() > 0)
                 .forEach(v -> {
                 .forEach(v -> {
                     //根据商品id和仓库id查询当前库存
                     //根据商品id和仓库id查询当前库存
@@ -1709,11 +1723,18 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                     if (currentNumber.doubleValue() <= v.getLowSafeStock().doubleValue()){
                     if (currentNumber.doubleValue() <= v.getLowSafeStock().doubleValue()){
                         Material material = materialMapper.selectByPrimaryKey(v.getMaterialId());
                         Material material = materialMapper.selectByPrimaryKey(v.getMaterialId());
                         String str = "商品名称:" + material.getName()
                         String str = "商品名称:" + material.getName()
-                                + ",库存告警,请及时处理";
+                                +depotMap.get(v.getDepotId()) + ",库存告警,请及时处理";
                         inventoryReminders.add(str);
                         inventoryReminders.add(str);
+                        if (materialMap.get(v.getMaterialId()) == null){
+                            materialMap.put(v.getMaterialId(),new Material().setId(v.getMaterialId()).setReminder("库存危险"));
+                        }else if (!materialMap.get(v.getMaterialId()).getReminder().contains("库存危险")){
+                            materialMap.get(v.getMaterialId()).setReminder(materialMap.get(v.getMaterialId()).getReminder() + ",库存危险");
+                        }
                     }
                     }
                 });
                 });
         vo.setInventoryReminder(inventoryReminders);
         vo.setInventoryReminder(inventoryReminders);
+        List<Material> materialList = new ArrayList<>(materialMap.values());
+        this.updateBatchById(materialList);
         return vo;
         return vo;
     }
     }
 
 
@@ -1760,10 +1781,12 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                 String enabled = ExcelUtils.getContent(src, i, 10); //状态
                 String enabled = ExcelUtils.getContent(src, i, 10); //状态
                 String enableSerialNumber = ExcelUtils.getContent(src, i, 11); //序列号
                 String enableSerialNumber = ExcelUtils.getContent(src, i, 11); //序列号
                 String barCode = ExcelUtils.getContent(src, i, 12); //商品条码
                 String barCode = ExcelUtils.getContent(src, i, 12); //商品条码
-                String otherField1 = ExcelUtils.getContent(src, i, 13); //自定义1
-                String otherField2 = ExcelUtils.getContent(src, i, 14); //自定义2
-                String otherField3 = ExcelUtils.getContent(src, i, 15); //自定义3
-                String remark = ExcelUtils.getContent(src, i, 16); //备注
+                String defaultPurchaseDecimal = ExcelUtils.getContent(src, i, 13); //默认销售价
+                String defaultWholesaleDecimal = ExcelUtils.getContent(src, i, 14); //默认采购价
+                String otherField1 = ExcelUtils.getContent(src, i, 15); //自定义1
+                String otherField2 = ExcelUtils.getContent(src, i, 16); //自定义2
+                String otherField3 = ExcelUtils.getContent(src, i, 17); //自定义3
+                String remark = ExcelUtils.getContent(src, i, 18); //备注
                 //校验字段
                 //校验字段
                 //名称为空
                 //名称为空
                 if(StringUtil.isEmpty(name)) {
                 if(StringUtil.isEmpty(name)) {
@@ -1824,6 +1847,26 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                     throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_BARCODE_LENGTH_ERROR_CODE,
                     throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_BARCODE_LENGTH_ERROR_CODE,
                             String.format(ExceptionConstants.MATERIAL_BARCODE_LENGTH_ERROR_MSG, barCode));
                             String.format(ExceptionConstants.MATERIAL_BARCODE_LENGTH_ERROR_MSG, barCode));
                 }
                 }
+                //默认采购价为空
+                if(StringUtil.isEmpty(defaultPurchaseDecimal)) {
+                    throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_DEFAULT_PURCHASE_DECIMAL_EMPTY_CODE,
+                            String.format(ExceptionConstants.MATERIAL_DEFAULT_PURCHASE_DECIMAL_EMPTY_MSG, i+1));
+                }
+                //校验默认采购价是否是数字(含小数)
+                if(!StringUtil.isPositiveBigDecimal(defaultPurchaseDecimal)) {
+                    throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_DEFAULT_PURCHASE_DECIMAL_NOT_DECIMAL_CODE,
+                            String.format(ExceptionConstants.MATERIAL_DEFAULT_PURCHASE_DECIMAL_NOT_DECIMAL_MSG, i+1));
+                }
+                //默认销售价为空
+                if(StringUtil.isEmpty(defaultWholesaleDecimal)) {
+                    throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_DEFAULT_WHOLESALE_DECIMAL_EMPTY_CODE,
+                            String.format(ExceptionConstants.MATERIAL_DEFAULT_WHOLESALE_DECIMAL_EMPTY_MSG, i+1));
+                }
+                //校验默认销售价是否是数字(含小数)
+                if(!StringUtil.isPositiveBigDecimal(defaultWholesaleDecimal)) {
+                    throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_DEFAULT_WHOLESALE_DECIMAL_NOT_DECIMAL_CODE,
+                            String.format(ExceptionConstants.MATERIAL_DEFAULT_WHOLESALE_DECIMAL_NOT_DECIMAL_MSG, i+1));
+                }
                 //批量校验excel中有无重复条码(1-文档自身校验,2-和数据库里面的商品校验)
                 //批量校验excel中有无重复条码(1-文档自身校验,2-和数据库里面的商品校验)
                 batchCheckExistBarCodeByParam(mList, barCode, null);
                 batchCheckExistBarCodeByParam(mList, barCode, null);
 //                Long depotId = null;
 //                Long depotId = null;
@@ -1862,6 +1905,10 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                 Long serial_no = categoryId == null ? null : materialCategoryService.getMaterialCategory(m.getCategoryId()).getSerialNo();
                 Long serial_no = categoryId == null ? null : materialCategoryService.getMaterialCategory(m.getCategoryId()).getSerialNo();
                 //设置系统sku
                 //设置系统sku
                 m.setSystemSku(serial_no + DateUtils.dateTimeNow() + RandomHelper.getRandomStr(6));
                 m.setSystemSku(serial_no + DateUtils.dateTimeNow() + RandomHelper.getRandomStr(6));
+                //设置默认采购价
+                m.setDefaultPurchaseDecimal(StringUtil.isNotEmpty(defaultPurchaseDecimal) ? new BigDecimal(defaultPurchaseDecimal) : null);
+                //设置默认销售价
+                m.setDefaultWholesaleDecimal(StringUtil.isNotEmpty(defaultWholesaleDecimal) ? new BigDecimal(defaultWholesaleDecimal) : null);
                 m.setOtherField1(StringUtil.isNotEmpty(otherField1)?otherField1:null);
                 m.setOtherField1(StringUtil.isNotEmpty(otherField1)?otherField1:null);
                 m.setOtherField2(StringUtil.isNotEmpty(otherField2)?otherField2:null);
                 m.setOtherField2(StringUtil.isNotEmpty(otherField2)?otherField2:null);
                 m.setOtherField3(StringUtil.isNotEmpty(otherField3)?otherField3:null);
                 m.setOtherField3(StringUtil.isNotEmpty(otherField3)?otherField3:null);
@@ -1905,11 +1952,14 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                     String position = stockMap.get(depot.getId());
                     String position = stockMap.get(depot.getId());
                     //新增或更新初始库存
                     //新增或更新初始库存
                     if(StringUtil.isNotEmpty(position)) {
                     if(StringUtil.isNotEmpty(position)) {
+                        String [] depots = position.split(",");
                         MaterialInitialStock materialInitialStock = new MaterialInitialStock();
                         MaterialInitialStock materialInitialStock = new MaterialInitialStock();
+                        materialInitialStock.setNumber(new BigDecimal(depots[0]));
                         materialInitialStock.setDepotId(depotId);
                         materialInitialStock.setDepotId(depotId);
                         materialInitialStock.setMaterialId(material.getId());
                         materialInitialStock.setMaterialId(material.getId());
-                        materialInitialStock.setPosition(position);
+                        materialInitialStock.setPosition(depots.length > 1 ? depots[1] : "");
                         materialInitialStockMapper.insertSelective(materialInitialStock);
                         materialInitialStockMapper.insertSelective(materialInitialStock);
+                        depotItemService.updateCurrentStockFun(material.getId(),depotId);
                     }
                     }
                 }
                 }
                 //添加商品子信息
                 //添加商品子信息
@@ -2064,41 +2114,41 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                     + "-" + m.getUnit();
                     + "-" + m.getUnit();
             if (materialMap.get(str) == null) {
             if (materialMap.get(str) == null) {
                 //商品主表不存在,创建商品主表
                 //商品主表不存在,创建商品主表
-                Material material = new Material();
-                //名称
-                material.setName(m.getName());
-                //型号
-                material.setModel(m.getModel());
-                //规格
-                material.setStandard(m.getStandard());
-                //品牌
-                material.setBrand(m.getBrand());
-                //助记码
-                material.setMnemonic(m.getMnemonic());
-                //颜色
-                material.setColor(m.getColor());
-                //商品类别
-                material.setCategoryId(m.getCategoryId());
-                //单位-单个
-                material.setUnit(m.getUnit());
-                //计量单位Id
-                material.setUnitId(m.getUnitId());
-                //备注
-                material.setRemark(m.getRemark());
-                //基础重量
-                material.setWeight(m.getWeight());
-                //启用 0-禁用  1-启用
-                material.setEnabled(m.getEnabled());
-                //自定义1
-                material.setOtherField1(m.getOtherField1());
-                //自定义2
-                material.setOtherField2(m.getOtherField2());
-                //自定义3
-                material.setOtherField3(m.getOtherField3());
-                //是否开启序列号
-                material.setEnableSerialNumber(m.getEnableSerialNumber());
-                //系统sku
-                material.setSystemSku(m.getSystemSku());
+                Material material = m;
+//                //名称
+//                material.setName(m.getName());
+//                //型号
+//                material.setModel(m.getModel());
+//                //规格
+//                material.setStandard(m.getStandard());
+//                //品牌
+//                material.setBrand(m.getBrand());
+//                //助记码
+//                material.setMnemonic(m.getMnemonic());
+//                //颜色
+//                material.setColor(m.getColor());
+//                //商品类别
+//                material.setCategoryId(m.getCategoryId());
+//                //单位-单个
+//                material.setUnit(m.getUnit());
+//                //计量单位Id
+//                material.setUnitId(m.getUnitId());
+//                //备注
+//                material.setRemark(m.getRemark());
+//                //基础重量
+//                material.setWeight(m.getWeight());
+//                //启用 0-禁用  1-启用
+//                material.setEnabled(m.getEnabled());
+//                //自定义1
+//                material.setOtherField1(m.getOtherField1());
+//                //自定义2
+//                material.setOtherField2(m.getOtherField2());
+//                //自定义3
+//                material.setOtherField3(m.getOtherField3());
+//                //是否开启序列号
+//                material.setEnableSerialNumber(m.getEnableSerialNumber());
+//                //系统sku
+//                material.setSystemSku(m.getSystemSku());
                 List<MaterialExtend> list = new ArrayList<>();
                 List<MaterialExtend> list = new ArrayList<>();
                 material.setList(list);
                 material.setList(list);
                 material.setDepotMap(m.getDepotMap());
                 material.setDepotMap(m.getDepotMap());

+ 76 - 0
src/main/java/com/jsh/erp/service/impl/SequenceServiceImpl.java

@@ -0,0 +1,76 @@
+package com.jsh.erp.service.impl;
+
+import com.jsh.erp.constants.BusinessConstants;
+import com.jsh.erp.datasource.mappers.*;
+import com.jsh.erp.exception.JshException;
+import com.jsh.erp.service.SequenceService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+
+/**
+ * Description
+ *
+ * @Author: longyong
+ * @Date: 2021/3/16 16:33
+ */
+@Service
+public class SequenceServiceImpl implements SequenceService {
+    private Logger logger = LoggerFactory.getLogger(SequenceServiceImpl.class);
+
+    @Resource
+    private SequenceMapperEx sequenceMapperEx;
+
+    /**
+     * 创建一个唯一的序列号
+     * */
+    @Transactional(value = "transactionManager", rollbackFor = Exception.class)
+    @Override
+    public String buildOnlyNumber()throws Exception{
+        Long buildOnlyNumber=null;
+        synchronized (this){
+            try{
+                sequenceMapperEx.updateBuildOnlyNumber(BusinessConstants.DEPOT_NUMBER_SEQ); //编号+1
+                buildOnlyNumber= sequenceMapperEx.getBuildOnlyNumber(BusinessConstants.DEPOT_NUMBER_SEQ);
+            }catch(Exception e){
+                JshException.writeFail(logger, e);
+            }
+        }
+        if(buildOnlyNumber<BusinessConstants.SEQ_TO_STRING_MIN_LENGTH){
+            StringBuffer sb=new StringBuffer(buildOnlyNumber.toString());
+            int len=BusinessConstants.SEQ_TO_STRING_MIN_LENGTH.toString().length()-sb.length();
+            for(int i=0;i<len;i++){
+                sb.insert(0,BusinessConstants.SEQ_TO_STRING_LESS_INSERT);
+            }
+            return sb.toString();
+        }else{
+            return buildOnlyNumber.toString();
+        }
+    }
+
+    /**
+     * 构建供应商编号
+     */
+    @Override
+    public String buildSupplierNumber() {
+        Long buildOnlyNumber = null;
+        synchronized (this){
+            sequenceMapperEx.updateBuildOnlyNumber(BusinessConstants.SUPPLIER_NUMBER_SEQ); //编号+1
+            buildOnlyNumber = sequenceMapperEx.getBuildOnlyNumber(BusinessConstants.SUPPLIER_NUMBER_SEQ);
+        }
+        if(buildOnlyNumber < BusinessConstants.SUPPLIER_SEQ_TO_STRING_MIN_LENGTH){
+            StringBuffer sb = new StringBuffer(buildOnlyNumber.toString());
+            int len = BusinessConstants.SUPPLIER_SEQ_TO_STRING_MIN_LENGTH.toString().length() - sb.length();
+            for(int i=0; i<len; i++){
+                sb.insert(0,BusinessConstants.SEQ_TO_STRING_LESS_INSERT);
+            }
+            return sb.toString();
+        }else{
+            return buildOnlyNumber.toString();
+        }
+    }
+
+}

+ 7 - 4
src/main/java/com/jsh/erp/service/impl/SupplierServiceImpl.java

@@ -56,6 +56,9 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> i
     @Resource
     @Resource
     private UserBusinessMapper userBusinessMapper;
     private UserBusinessMapper userBusinessMapper;
 
 
+    @Resource
+    private SequenceService sequenceService;
+
     @Override
     @Override
     public Supplier getSupplier(long id)throws Exception {
     public Supplier getSupplier(long id)throws Exception {
         Supplier result=null;
         Supplier result=null;
@@ -153,11 +156,12 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> i
 
 
     @Override
     @Override
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
-    public int insertSupplier(JSONObject obj, HttpServletRequest request)throws Exception {
-        Supplier supplier = JSONObject.parseObject(obj.toJSONString(), Supplier.class);
+    public int insertSupplier(Supplier supplier, HttpServletRequest request)throws Exception {
         int result=0;
         int result=0;
         try{
         try{
             supplier.setEnabled(true);
             supplier.setEnabled(true);
+            //设置供应商编号
+            supplier.setSerialNo("S" + sequenceService.buildSupplierNumber());
             User userInfo=userService.getCurrentUser();
             User userInfo=userService.getCurrentUser();
             supplier.setCreator(userInfo==null?null:userInfo.getId());
             supplier.setCreator(userInfo==null?null:userInfo.getId());
             result=supplierMapper.insertSelective(supplier);
             result=supplierMapper.insertSelective(supplier);
@@ -173,8 +177,7 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> i
 
 
     @Override
     @Override
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
-    public int updateSupplier(JSONObject obj, HttpServletRequest request)throws Exception {
-        Supplier supplier = JSONObject.parseObject(obj.toJSONString(), Supplier.class);
+    public int updateSupplier(Supplier supplier, HttpServletRequest request)throws Exception {
         if(supplier.getBeginNeedPay() == null) {
         if(supplier.getBeginNeedPay() == null) {
             supplier.setBeginNeedPay(BigDecimal.ZERO);
             supplier.setBeginNeedPay(BigDecimal.ZERO);
         }
         }

+ 28 - 0
src/main/java/com/jsh/erp/utils/TreeNodeUtils.java

@@ -0,0 +1,28 @@
+package com.jsh.erp.utils;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.jsh.erp.datasource.vo.TreeNode;
+
+import java.util.List;
+
+public class TreeNodeUtils {
+
+    /**
+     * 将树类型
+     * @param list
+     * @return
+     */
+    public static JSONArray conversion(List<TreeNode> list){
+        JSONArray arr=new JSONArray();
+        if(list != null && list.size()>0){
+            for(TreeNode node : list){
+                String str= JSON.toJSONString(node);
+                JSONObject obj=JSON.parseObject(str);
+                arr.add(obj) ;
+            }
+        }
+        return arr;
+    }
+}

+ 18 - 3
src/main/resources/mapper_xml/DepotHeadMapper.xml

@@ -279,8 +279,14 @@
       <if test="receiverAddress != null">
       <if test="receiverAddress != null">
         receiver_address,
         receiver_address,
       </if>
       </if>
+      <if test="depotId != null">
+        depot_id,
+      </if>
       <if test="operId != null">
       <if test="operId != null">
-        oper_id
+        oper_id,
+      </if>
+      <if test="taxRate != null">
+        tax_rate,
       </if>
       </if>
     </trim>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
     <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -401,8 +407,14 @@
       <if test="receiverAddress != null">
       <if test="receiverAddress != null">
         #{receiverAddress,jdbcType=VARCHAR},
         #{receiverAddress,jdbcType=VARCHAR},
       </if>
       </if>
+      <if test="depotId != null">
+        #{depotId},
+      </if>
       <if test="operId != null">
       <if test="operId != null">
-        #{operId,jdbcType=INTEGER}
+        #{operId,jdbcType=INTEGER},
+      </if>
+      <if test="taxRate != null">
+        #{taxRate},
       </if>
       </if>
     </trim>
     </trim>
   </insert>
   </insert>
@@ -703,7 +715,10 @@
         depot_id = #{depotId,jdbcType=BIGINT},
         depot_id = #{depotId,jdbcType=BIGINT},
       </if>
       </if>
       <if test="operId != null">
       <if test="operId != null">
-        oper_id = #{operId,jdbcType=BIGINT}
+        oper_id = #{operId,jdbcType=BIGINT},
+      </if>
+      <if test="taxRate != null">
+        tax_rate = #{taxRate}
       </if>
       </if>
     </set>
     </set>
     where id = #{id,jdbcType=BIGINT}
     where id = #{id,jdbcType=BIGINT}

+ 1 - 1
src/main/resources/mapper_xml/DepotItemMapper.xml

@@ -97,7 +97,7 @@
     id, header_id, material_id, material_extend_id, material_unit, sku, oper_number, 
     id, header_id, material_id, material_extend_id, material_unit, sku, oper_number, 
     basic_number, unit_price, purchase_unit_price, tax_unit_price, all_price, remark, 
     basic_number, unit_price, purchase_unit_price, tax_unit_price, all_price, remark, 
     depot_id, another_depot_id, tax_rate, tax_money, tax_last_money, material_type, sn_list, 
     depot_id, another_depot_id, tax_rate, tax_money, tax_last_money, material_type, sn_list, 
-    batch_number, expiration_date, link_id, tenant_id, delete_flag
+    batch_number, expiration_date, link_id, tenant_id, delete_flag,production_date,expiry_num,position,wholesale_decimal
   </sql>
   </sql>
   <select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="BaseResultMap">
   <select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="BaseResultMap">
     select
     select

+ 1 - 1
src/main/resources/mapper_xml/DepotItemMapperEx.xml

@@ -322,7 +322,7 @@
         m.other_field1 MOtherField1,m.other_field2 MOtherField2,m.other_field3 MOtherField3,m.enable_serial_number, m.enable_batch_number,
         m.other_field1 MOtherField1,m.other_field2 MOtherField2,m.other_field3 MOtherField3,m.enable_serial_number, m.enable_batch_number,
         m.brand, dp1.name DepotName,dp2.name AnotherDepotName, me.purchase_decimal,
         m.brand, dp1.name DepotName,dp2.name AnotherDepotName, me.purchase_decimal,
         me.production_date, me.expiry_num, me.supplier_id, me.bar_code, me.batch_number, me.position,s.supplier supplierName,u.name unit_name,me.inventory,
         me.production_date, me.expiry_num, me.supplier_id, me.bar_code, me.batch_number, me.position,s.supplier supplierName,u.name unit_name,me.inventory,
-        us.username warehousingUserName
+        us.username warehousingUserName,m.default_purchase_decimal,m.default_wholesale_decimal
         from jsh_depot_item di
         from jsh_depot_item di
         left join jsh_material m on di.material_id=m.id  and ifnull(m.delete_flag,'0') !='1'
         left join jsh_material m on di.material_id=m.id  and ifnull(m.delete_flag,'0') !='1'
         left join jsh_material_extend me on me.id=di.material_extend_id  and ifnull(me.delete_Flag,'0') !='1'
         left join jsh_material_extend me on me.id=di.material_extend_id  and ifnull(me.delete_Flag,'0') !='1'

+ 7 - 1
src/main/resources/mapper_xml/MaterialCategoryMapper.xml

@@ -74,7 +74,7 @@
   </sql>
   </sql>
   <sql id="Base_Column_List">
   <sql id="Base_Column_List">
     id, name, category_level, parent_id, sort, serial_no, remark, create_time, update_time, 
     id, name, category_level, parent_id, sort, serial_no, remark, create_time, update_time, 
-    tenant_id, delete_flag
+    tenant_id, delete_flag, expiry_threshold
   </sql>
   </sql>
   <select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.MaterialCategoryExample" resultMap="BaseResultMap">
   <select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.MaterialCategoryExample" resultMap="BaseResultMap">
     select
     select
@@ -151,6 +151,9 @@
       <if test="deleteFlag != null">
       <if test="deleteFlag != null">
         delete_flag,
         delete_flag,
       </if>
       </if>
+      <if test="expiryThreshold != null">
+        expiry_threshold,
+      </if>
     </trim>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       (select ifnull(MAX(id),0) + 10001 from jsh_material_category AS mc),
       (select ifnull(MAX(id),0) + 10001 from jsh_material_category AS mc),
@@ -185,6 +188,9 @@
       <if test="deleteFlag != null">
       <if test="deleteFlag != null">
         #{deleteFlag,jdbcType=VARCHAR},
         #{deleteFlag,jdbcType=VARCHAR},
       </if>
       </if>
+      <if test="expiryThreshold != null">
+        #{expiryThreshold},
+      </if>
     </trim>
     </trim>
   </insert>
   </insert>
 
 

+ 3 - 1
src/main/resources/mapper_xml/MaterialCategoryMapperEx.xml

@@ -83,6 +83,7 @@
         </if>
         </if>
         order by sort asc
         order by sort asc
     </select>
     </select>
+
     <insert id="addMaterialCategory" parameterType="com.jsh.erp.datasource.entities.MaterialCategory"
     <insert id="addMaterialCategory" parameterType="com.jsh.erp.datasource.entities.MaterialCategory"
             useGeneratedKeys="true" keyProperty="id" keyColumn="id">
             useGeneratedKeys="true" keyProperty="id" keyColumn="id">
        insert into jsh_material_category
        insert into jsh_material_category
@@ -107,7 +108,8 @@
        update jsh_material_category
        update jsh_material_category
        set update_time=#{updateTime},
        set update_time=#{updateTime},
         parent_id=#{parentId},sort=#{sort},
         parent_id=#{parentId},sort=#{sort},
-        name=#{name},remark=#{remark}
+        name=#{name},remark=#{remark},
+        expiry_threshold = #{expiryThreshold}
        where id =#{id}
        where id =#{id}
     </update>
     </update>
 
 

+ 1 - 1
src/main/resources/mapper_xml/MaterialExtendMapper.xml

@@ -439,7 +439,7 @@
         position = #{position,jdbcType=VARCHAR},
         position = #{position,jdbcType=VARCHAR},
       </if>
       </if>
       <if test="ratio != null">
       <if test="ratio != null">
-        position = #{ratio,jdbcType=INTEGER},
+        ratio = #{ratio,jdbcType=INTEGER},
       </if>
       </if>
     </set>
     </set>
     where id = #{id,jdbcType=BIGINT}
     where id = #{id,jdbcType=BIGINT}

+ 12 - 2
src/main/resources/mapper_xml/MaterialMapper.xml

@@ -91,7 +91,8 @@
   <sql id="Base_Column_List">
   <sql id="Base_Column_List">
     id, category_id, name, model, standard, brand, mnemonic, color, unit, remark,
     id, category_id, name, model, standard, brand, mnemonic, color, unit, remark,
     img_name, unit_id, weight, enabled, other_field1, other_field2, other_field3,
     img_name, unit_id, weight, enabled, other_field1, other_field2, other_field3,
-    enable_serial_number, enable_batch_number, tenant_id, delete_flag, system_sku, moving_pin_reminder_cycle
+    enable_serial_number, enable_batch_number, tenant_id, delete_flag, system_sku,
+    moving_pin_reminder_cycle,expiry_num,default_purchase_decimal,default_wholesale_decimal
   </sql>
   </sql>
 
 
   <select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="BaseResultMap">
   <select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="BaseResultMap">
@@ -459,6 +460,15 @@
       <if test="movingPinReminderCycle != null">
       <if test="movingPinReminderCycle != null">
         moving_pin_reminder_cycle = #{movingPinReminderCycle,jdbcType=VARCHAR},
         moving_pin_reminder_cycle = #{movingPinReminderCycle,jdbcType=VARCHAR},
       </if>
       </if>
+      <if test="expiryNum != null">
+        expiry_num = #{expiryNum},
+      </if>
+      <if test="defaultPurchaseDecimal != null">
+        default_purchase_decimal = #{defaultPurchaseDecimal},
+      </if>
+      <if test="defaultWholesaleDecimal != null">
+        default_wholesale_decimal = #{defaultWholesaleDecimal},
+      </if>
     </set>
     </set>
     where id = #{id,jdbcType=BIGINT}
     where id = #{id,jdbcType=BIGINT}
   </update>
   </update>
@@ -502,7 +512,7 @@
     FROM jsh_material m
     FROM jsh_material m
     left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1'
     left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1'
     left join jsh_material_initial_stock mis ON m.id= mis.material_id AND mis.depot_id = #{depotId}
     left join jsh_material_initial_stock mis ON m.id= mis.material_id AND mis.depot_id = #{depotId}
-    left JOIN (SELECT material_id,SUM(current_number) AS 'inventory' FROM jsh_material_current_stock GROUP BY material_id) mi ON m.id = mi.material_id
+    left JOIN (SELECT material_id,SUM(current_number) AS 'inventory' FROM jsh_material_current_stock WHERE depot_id = #{depotId} GROUP BY material_id) mi ON m.id = mi.material_id
     <where>
     <where>
       m.enabled = 1 and me.id is not null
       m.enabled = 1 and me.id is not null
       <if test="keyword != null and keyword !=''">
       <if test="keyword != null and keyword !=''">

+ 26 - 4
src/main/resources/mapper_xml/MaterialMapperEx.xml

@@ -48,7 +48,7 @@
         <result column="number" jdbcType="DECIMAL" property="number" />
         <result column="number" jdbcType="DECIMAL" property="number" />
     </resultMap>
     </resultMap>
 
 
-    <select id="selectByConditionMaterial" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultMapList">
+    <select id="selectByConditionMaterial" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultType="com.jsh.erp.datasource.entities.MaterialVo4Unit">
         select jm.*, u.name unitName, mc.name categoryName, jme.bar_code,
         select jm.*, u.name unitName, mc.name categoryName, jme.bar_code,
         jme.purchase_decimal, jme.commodity_decimal, jme.wholesale_decimal, jme.low_decimal, jme.sku
         jme.purchase_decimal, jme.commodity_decimal, jme.wholesale_decimal, jme.low_decimal, jme.sku
         from (select m.id, min(me.id) meId
         from (select m.id, min(me.id) meId
@@ -103,6 +103,10 @@
             <bind name="bindRemark" value="'%'+remark+'%'"/>
             <bind name="bindRemark" value="'%'+remark+'%'"/>
             and m.remark like #{bindRemark}
             and m.remark like #{bindRemark}
         </if>
         </if>
+        <if test="reminder != null and reminder !=''">
+            <bind name="bindReminder" value="'%'+reminder+'%'"/>
+            and m.reminder like #{bindReminder}
+        </if>
         <if test="idList.size()>0">
         <if test="idList.size()>0">
             and m.category_id in
             and m.category_id in
             <foreach collection="idList" item="item" index="index" separator="," open="(" close=")">
             <foreach collection="idList" item="item" index="index" separator="," open="(" close=")">
@@ -191,6 +195,15 @@
             <if test="movingPinReminderCycle != null">
             <if test="movingPinReminderCycle != null">
                 moving_pin_reminder_cycle,
                 moving_pin_reminder_cycle,
             </if>
             </if>
+            <if test="expiryNum != null">
+                expiry_num,
+            </if>
+            <if test="defaultPurchaseDecimal != null">
+                default_purchase_decimal,
+            </if>
+            <if test="defaultWholesaleDecimal != null">
+                default_wholesale_decimal,
+            </if>
         </trim>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">
             <if test="id != null">
@@ -262,6 +275,15 @@
             <if test="movingPinReminderCycle != null">
             <if test="movingPinReminderCycle != null">
                 #{movingPinReminderCycle,jdbcType=VARCHAR},
                 #{movingPinReminderCycle,jdbcType=VARCHAR},
             </if>
             </if>
+            <if test="expiryNum != null">
+                #{expiryNum},
+            </if>
+            <if test="defaultPurchaseDecimal != null">
+                #{defaultPurchaseDecimal},
+            </if>
+            <if test="defaultWholesaleDecimal != null">
+                #{defaultWholesaleDecimal},
+            </if>
         </trim>
         </trim>
     </insert>
     </insert>
 
 
@@ -392,7 +414,7 @@
         and ifnull(m.delete_flag,'0') !='1'
         and ifnull(m.delete_flag,'0') !='1'
     </select>
     </select>
 
 
-    <select id="exportExcel" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultMapList">
+    <select id="exportExcel" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultType="com.jsh.erp.datasource.entities.MaterialVo4Unit">
         select m.*,u.name unitName, u.ratio, mc.name categoryName,me.bar_code,me.commodity_unit,me.purchase_decimal, me.commodity_decimal,
         select m.*,u.name unitName, u.ratio, mc.name categoryName,me.bar_code,me.commodity_unit,me.purchase_decimal, me.commodity_decimal,
         me.wholesale_decimal, me.low_decimal, me.sku, me.production_date, me.expiry_num, me.supplier_id, me.bar_code, me.batch_number, me.depot_id, me.position
         me.wholesale_decimal, me.low_decimal, me.sku, me.production_date, me.expiry_num, me.supplier_id, me.bar_code, me.batch_number, me.depot_id, me.position
         from jsh_material m
         from jsh_material m
@@ -552,8 +574,8 @@
     </select>
     </select>
 
 
     <select id="getMaterialByBarCode" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultAndUnitMap">
     <select id="getMaterialByBarCode" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultAndUnitMap">
-        select m.*,u.name unit_name, me.id meId,me.bar_code m_bar_code, me.commodity_unit, me.purchase_decimal, me.commodity_decimal,
-        me.wholesale_decimal, me.low_decimal, me.sku, me.production_date, me.expiry_num, me.supplier_id, me.bar_code, me.batch_number, me.depot_id, me.position
+        select m.*,u.name unit_name, me.id meId,me.bar_code m_bar_code, me.commodity_unit,
+        me.sku, me.production_date, me.expiry_num, me.supplier_id, me.bar_code, me.batch_number, me.depot_id,me.ratio
         from jsh_material m
         from jsh_material m
         left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1'
         left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1'
         left join jsh_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1'
         left join jsh_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1'

+ 2 - 2
src/main/resources/mapper_xml/SequenceMapperEx.xml

@@ -3,11 +3,11 @@
 <mapper namespace="com.jsh.erp.datasource.mappers.SequenceMapperEx">
 <mapper namespace="com.jsh.erp.datasource.mappers.SequenceMapperEx">
 
 
     <update id="updateBuildOnlyNumber">
     <update id="updateBuildOnlyNumber">
-        update jsh_sequence set current_val = current_val + 1 where seq_name = 'depot_number_seq'
+        update jsh_sequence set current_val = current_val + 1 where seq_name = #{seq_name}
     </update>
     </update>
 
 
     <select id="getBuildOnlyNumber" resultType="java.lang.Long">
     <select id="getBuildOnlyNumber" resultType="java.lang.Long">
-      select current_val from jsh_sequence where seq_name = 'depot_number_seq'
+      select current_val from jsh_sequence where seq_name = #{seq_name}
     </select>
     </select>
 
 
 </mapper>
 </mapper>

+ 27 - 0
src/main/resources/mapper_xml/SupplierMapper.xml

@@ -248,6 +248,15 @@
       <if test="contractUpload != null">
       <if test="contractUpload != null">
         contract_upload,
         contract_upload,
       </if>
       </if>
+      <if test="serialNo != null">
+        serial_no,
+      </if>
+      <if test="isAfterSales != null">
+        is_after_sales,
+      </if>
+      <if test="afterSalesRules != null">
+        after_sales_rules,
+      </if>
     </trim>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
       <if test="id != null">
@@ -346,6 +355,15 @@
       <if test="contractUpload != null">
       <if test="contractUpload != null">
         #{contractUpload,jdbcType=VARCHAR},
         #{contractUpload,jdbcType=VARCHAR},
       </if>
       </if>
+      <if test="serialNo != null">
+        #{serialNo},
+      </if>
+      <if test="isAfterSales != null">
+        #{isAfterSales},
+      </if>
+      <if test="afterSalesRules != null">
+        #{afterSalesRules},
+      </if>
     </trim>
     </trim>
   </insert>
   </insert>
   <select id="countByExample" parameterType="com.jsh.erp.datasource.entities.SupplierExample" resultType="java.lang.Long">
   <select id="countByExample" parameterType="com.jsh.erp.datasource.entities.SupplierExample" resultType="java.lang.Long">
@@ -592,6 +610,15 @@
       <if test="contractUpload != null">
       <if test="contractUpload != null">
         contract_upload = #{contractUpload,jdbcType=VARCHAR},
         contract_upload = #{contractUpload,jdbcType=VARCHAR},
       </if>
       </if>
+      <if test="serialNo != null">
+        serial_no = #{serialNo},
+      </if>
+      <if test="isAfterSales != null">
+        is_after_sales = #{isAfterSales},
+      </if>
+      <if test="afterSalesRules != null">
+        after_sales_rules = #{afterSalesRules},
+      </if>
     </set>
     </set>
     where id = #{id,jdbcType=BIGINT}
     where id = #{id,jdbcType=BIGINT}
   </update>
   </update>

+ 1 - 1
src/main/resources/mapper_xml/TaskStocktakingItemMapper.xml

@@ -29,7 +29,7 @@
             AND tsi.task_stocktaking_id = #{taskId}
             AND tsi.task_stocktaking_id = #{taskId}
             <if test="number != null and number != ''">
             <if test="number != null and number != ''">
                 AND (m.name LIKE CONCAT('%',#{number},'%')
                 AND (m.name LIKE CONCAT('%',#{number},'%')
-                OR me.batch_number LIKE CONCAT('%',#{number},'%')
+                OR me.bar_code LIKE CONCAT('%',#{number},'%')
                 OR me.position LIKE CONCAT('%',#{number},'%')
                 OR me.position LIKE CONCAT('%',#{number},'%')
                 OR m.system_sku LIKE CONCAT('%',#{number},'%'))
                 OR m.system_sku LIKE CONCAT('%',#{number},'%'))
             </if>
             </if>