35 Commits 271df808e2 ... b8a17a39a7

Author SHA1 Message Date
  廖泽勇 b8a17a39a7 Merge branch 'dev_ml' of http://121.40.253.172:3000/pengyue/jsh_erp 1 month ago
  廖泽勇 88653ed255 Merge branch 'test' of http://121.40.253.172:3000/pengyue/jsh_erp 1 month ago
  maliang 918281a136 fix:角色勾选bug修复 1 month ago
  yz 1708ff0856 Merge remote-tracking branch 'origin/master' 1 month ago
  yz dd29e3e7a9 Merge remote-tracking branch 'origin/dev_huangjunjie' 1 month ago
  huang 1e5653b53c 导入-添加期初库存后更新当前库存,出库bug修改 1 month ago
  maliang 2c3c189f22 fix:其它出库、其它入库详情字段调整 1 month ago
  huang 5f02343aee 更新sql 1 month ago
  maliang 8ed83787cb fix:其它出库价格比对 1 month ago
  yz 2b71d1f594 Merge remote-tracking branch 'origin/dev_ml' 1 month ago
  廖泽勇 321ab849f5 Merge branch 'dev_ml' of http://121.40.253.172:3000/pengyue/jsh_erp into test 1 month ago
  maliang 072f8741a3 fix:修改商品模版 1 month ago
  yz f044e67a87 Merge remote-tracking branch 'origin/dev_huangjunjie' 1 month ago
  huang 649c22b054 更新sql 1 month ago
  huang 98d037ccde 商品信息导入增加期初库存,pda商品库存增加仓库筛选 1 month ago
  maliang 71025b467b fix:回归测试bug 1 month ago
  廖泽勇 62f19bea04 Merge branch 'dev_ml' of http://121.40.253.172:3000/pengyue/jsh_erp into test 1 month ago
  maliang 49366ac2bf fix:修改 1 month ago
  yz ff8a32cbfe Merge remote-tracking branch 'origin/dev_huangjunjie' 1 month ago
  huang 6855528985 pda盘点商品条码搜索,pc商品信息导出、订单税额、序列号bug修改 1 month ago
  huang dc271a5f2a Merge branch 'master' of http://121.40.253.172:3000/pengyue/jsh_erp into dev_huangjunjie 1 month ago
  yz 93f7a62fe5 Merge remote-tracking branch 'origin/dev_huangjunjie' 1 month ago
  huang a18d733b47 二期: bug修改 1 month ago
  廖泽勇 09ce931f09 Merge branch 'dev_ml' of http://121.40.253.172:3000/pengyue/jsh_erp into test 1 month ago
  maliang 4ff72c2872 fix:bug 1 month ago
  maliang dcb06ee870 fix:bug 1 month ago
  maliang 77a146e8fd fix:bug 1 month ago
  廖泽勇 4a1e5e2506 Merge branch 'dev_huangjunjie' of http://121.40.253.172:3000/pengyue/jsh_erp into test 1 month ago
  廖泽勇 46eb38e903 Merge branch 'dev_ml' of http://121.40.253.172:3000/pengyue/jsh_erp into test 1 month ago
  廖泽勇 f8d7a3c13a Merge branch 'master' of http://121.40.253.172:3000/pengyue/jsh_erp into test 1 month ago
  huang 8aba73d5fd 二期:除审核外的需求修改 1 month ago
  maliang 7b1747b77d fix:关联订单 1 month ago
  maliang aee8a6c3d6 fix:修改 1 month ago
  maliang f6c02d12fe feat:二期修改 2 months ago
  廖泽勇 21349a8f3f Merge branch 'dev_ml_423' of http://121.40.253.172:3000/pengyue/jsh_erp into test 2 months ago
99 changed files with 2738 additions and 1335 deletions
  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`)
 ) 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 num 添加的行数,默认1
@@ -1648,13 +1656,14 @@ export default {
         this.recalcSortNumber()
         this.forceUpdateFormValues()
       })
-      // 触发 insert 事件
-      this.$emit('inserted', {
-        rows: newRows.map((row) => {
+      const emitRows = newRows.map((row) => {
           let r = cloneObject(row)
           r.id = this.getCleanId(r.id)
           return r
-        }),
+        })
+      // 触发 insert 事件
+      this.$emit('inserted', {
+        rows: emitRows,
         num,
         insertIndex,
         target: this,
@@ -1662,6 +1671,7 @@ export default {
       this.$nextTick(() => {
         this.autoJumpNextInputBill()
       })
+      return emitRows
     },
     /** 删除被选中的行 */
     removeSelectedRows() {

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

@@ -1,13 +1,13 @@
 <template>
   <a-modal
-    :width="modalWidth"
+    width="100%"
     :visible="visible"
     :title="title"
     :wrapClassName="wrapClassNameInfo()"
     @ok="handleSubmit"
     @cancel="close"
     cancelText="关闭(ESC)"
-    style="top: 20px; height: 95%"
+    style="top: 0; height: 100%"
   >
     <a-row :gutter="10" style="padding: 10px; margin: -10px">
       <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>
 <!-- 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) => {
         item.initialize()
       })
+      if(this.materialTable && this.materialTable.dataSource) {
+        this.materialTable.dataSource = []
+      }
       this.$emit('close')
     },
 

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

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

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

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

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

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

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

@@ -291,6 +291,7 @@ export default {
         'materialsList',
         'operTimeStr',
         'userName',
+        'auditorName',
         'materialCount',
         'totalPrice',
         'totalTaxLastMoney',
@@ -323,6 +324,7 @@ export default {
         { title: '商品信息', dataIndex: 'materialsList', width: 220, ellipsis: true },
         { title: '单据日期', dataIndex: 'operTimeStr', width: 145 },
         { title: '操作员', dataIndex: 'userName', width: 80, ellipsis: true },
+        { title: '复核人员', dataIndex: 'auditorName;', width: 80, ellipsis: true },
         { title: '数量', dataIndex: 'materialCount', width: 60 },
         { 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-col :lg="18" :md="12" :sm="24">
               <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
                   ref="table"
                   size="middle"
@@ -195,6 +220,31 @@
           <a-row class="form-row" :gutter="24">
             <a-col :lg="18" :md="12" :sm="24">
               <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
                   ref="table"
                   size="middle"
@@ -284,6 +334,31 @@
             <a-col :xl="6" :lg="8" :md="12" :sm="24"> </a-col>
           </a-row>
           <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
               ref="table"
               size="middle"
@@ -363,6 +438,31 @@
             </a-col>
           </a-row>
           <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
               ref="table"
               size="middle"
@@ -417,7 +517,7 @@
             </a-col>
             <a-col :xl="6" :lg="8" :md="12" :sm="24">
               <a-form-item
-                :labelCol="{ xs: { span: 24 }, sm: { span: 6 } }"
+                :labelCol="labelCol"
                 :wrapperCol="wrapperCol"
                 label="优惠后金额"
               >
@@ -470,6 +570,31 @@
             </a-col>
           </a-row>
           <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
               ref="table"
               size="middle"
@@ -612,6 +737,31 @@
             </a-col>
           </a-row>
           <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
               ref="table"
               size="middle"
@@ -726,6 +876,31 @@
             </a-col>
           </a-row>
           <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
               ref="table"
               size="middle"
@@ -837,6 +1012,31 @@
             </a-col>
           </a-row>
           <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
               ref="table"
               size="middle"
@@ -984,6 +1184,31 @@
             </a-col>
           </a-row>
           <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
               ref="table"
               size="middle"
@@ -1105,6 +1330,31 @@
             </a-col>
           </a-row>
           <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
               ref="table"
               size="middle"
@@ -1146,6 +1396,28 @@
               </a-form-item>
             </a-col>
           </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>
       </template>
       <!--其它出库-->
@@ -1178,6 +1450,31 @@
             </a-col>
           </a-row>
           <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
               ref="table"
               size="middle"
@@ -1219,6 +1516,28 @@
               </a-form-item>
             </a-col>
           </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>
       </template>
       <!--调拨出库-->
@@ -1239,6 +1558,31 @@
             <a-col :xl="6" :lg="8" :md="12" :sm="24"></a-col>
           </a-row>
           <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
               ref="table"
               size="middle"
@@ -1300,6 +1644,31 @@
             <a-col :xl="6" :lg="8" :md="12" :sm="24"></a-col>
           </a-row>
           <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
               ref="table"
               size="middle"
@@ -1361,6 +1730,31 @@
             <a-col :xl="6" :lg="8" :md="12" :sm="24"></a-col>
           </a-row>
           <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
               ref="table"
               size="middle"
@@ -1426,6 +1820,31 @@
             <a-col :xl="6" :lg="8" :md="12" :sm="24"></a-col>
           </a-row>
           <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
               ref="table"
               size="middle"
@@ -1516,6 +1935,7 @@ import { getMpListShort, getCheckFlag, exportXlsPost } from '@/utils/util'
 import BillPrintIframe from './BillPrintIframe'
 import FinancialDetail from '../../financial/dialog/FinancialDetail'
 import JUpload from '@/components/jeecg/JUpload'
+import JEllipsis from '@/components/jeecg/JEllipsis'
 import Vue from 'vue'
 // import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 // import QrcodeVue from 'qrcode.vue'
@@ -1529,6 +1949,7 @@ export default {
     FinancialDetail,
     JUpload,
     VueQrcode,
+    JEllipsis
     // VueQr,
   },
   data() {
@@ -1558,7 +1979,7 @@ export default {
       },
       labelCol: {
         xs: { span: 24 },
-        sm: { span: 6 },
+        sm: { span: 8 },
       },
       wrapperCol: {
         xs: { span: 24 },
@@ -1575,6 +1996,9 @@ export default {
       columns: [],
       //列定义
       defColumns: [],
+      // 实际索引
+      settingDataIndex: [],
+      prefixNo: '',
       retailOutColumns: [
         { title: '仓库名称', dataIndex: 'depotName' },
         { title: '条码', dataIndex: 'barCode' },
@@ -2097,7 +2521,6 @@ export default {
         for (let i = 0; i < this.defColumns.length; i++) {
           currentCol.push(this.defColumns[i])
         }
-        this.columns = currentCol
       } else if (record.purchaseStatus === '3') {
         //将已出库的标题转为已采购,针对销售订单转采购订单的场景
         for (let i = 0; i < this.defColumns.length; i++) {
@@ -2115,7 +2538,6 @@ export default {
           }
           currentCol.push(info)
         }
-        this.columns = currentCol
       } else {
         for (let i = 0; i < this.defColumns.length; i++) {
           //移除列
@@ -2153,8 +2575,10 @@ export default {
             currentCol.push(info)
           }
         }
-        this.columns = currentCol
       }
+      this.defColumns = currentCol
+      this.initColumnsSetting()
+      // this.columns = currentCol
     },
     initPlatform() {
       getPlatformConfigByKey({ platformKey: 'bill_print_flag' }).then((res) => {
@@ -2650,6 +3074,30 @@ export default {
         '单据日期:' + this.model.operTimeStr + ' ' + '单据编号:' + this.model.number + '' + '关联单号:' + linkNumber
       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>
@@ -2669,4 +3117,7 @@ export default {
   height: 100%;
   object-fit: cover;
 }
+.table-operator {
+  margin-bottom: 18px;
+}
 </style>

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

@@ -153,7 +153,7 @@ export default {
       discountMoney: '',
       deposit: '',
       remark: '',
-      defaultDepotId: '',
+      depotId: '',
       queryParam: {
         number: '',
         materialParam: '',
@@ -304,12 +304,12 @@ export default {
     },
     handleOk() {
       if (this.selectType === 'list') {
-        this.getDepotByCurrentUser()
         this.getSelectBillRows()
         this.selectType = 'detail'
         this.title = '请选择单据明细'
         if (this.selectBillRows && this.selectBillRows.length > 0) {
           let record = this.selectBillRows[0]
+          console.log('this.selectBillRows======', this.selectBillRows)
           this.linkNumber = record.number
           this.organId = record.organId
           this.accountId = record.accountId
@@ -317,6 +317,7 @@ export default {
           this.discountMoney = record.discountMoney
           this.deposit = record.changeAmount - record.finishDeposit
           this.remark = record.remark
+          this.depotId = record.depotId
           this.initListColumns()
           this.loadDetailData(1)
         }
@@ -331,7 +332,7 @@ export default {
             this.discountMoney,
             this.deposit,
             this.remark,
-            this.defaultDepotId,
+            this.depotId,
             this.accountId,
             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) {
       return {
         on: {

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

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

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

@@ -33,7 +33,6 @@ export const BillModalMixin = {
         options: [],
         value: '',
       },
-      currentSelectDepotId: '',
       depotList: [],
       accountList: [],
       accountIdList: [],
@@ -286,6 +285,13 @@ export const BillModalMixin = {
       getAction('/depot/findDepotByCurrentUser').then((res) => {
         if (res.code === 200) {
           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) {
             if (item.key == 'depotId' || item.key == 'anotherDepotId') {
               item.options = []
@@ -395,46 +401,47 @@ export const BillModalMixin = {
         .then((allValues) => {
           //获取单据明细列表信息
           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() {
@@ -454,37 +461,91 @@ export const BillModalMixin = {
       setTimeout(function () {
         that.$refs.materialDataTable.resetScrollTop((target.rows.length + 1) * that.$refs.materialDataTable.rowHeight)
       }, 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,
-            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()
       })
     },
@@ -494,96 +555,13 @@ export const BillModalMixin = {
       const { type, row, column, value, target } = event
       let param, snList, batchNumber, operNumber, unitPrice, allPrice, taxRate, taxMoney, taxLastMoney
       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
         case 'barCode':
           param = {
@@ -592,57 +570,37 @@ export const BillModalMixin = {
             mpList: getMpListShort(Vue.ls.get('materialPropertyList')), //扩展属性
             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) {
               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
-                  console.log('stock===',stock)
-                  console.log('position===',position)
+                  mObj.inventory = stock
                   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)
           }
           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':
           operNumber = value - 0
           taxRate = row.taxRate - 0 //税率
@@ -752,37 +665,38 @@ export const BillModalMixin = {
           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':
-          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':
           // row.actualQuantityInStorage=
           if (row.unitId) {
@@ -804,22 +718,19 @@ export const BillModalMixin = {
     parseInfoToObj(mInfo) {
       return {
         barCode: mInfo.barCode,
-        batchNumber: mInfo.batchNumber,
         name: mInfo.name,
         standard: mInfo.standard,
         model: mInfo.model,
         color: mInfo.color,
         brand: mInfo.brand,
-        mfrs: mInfo.mfrs,
         materialOther: mInfo.materialOther,
         unit: mInfo.commodityUnit,
         sku: mInfo.sku,
         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,
         expiryNum: mInfo.expiryNum,
@@ -833,6 +744,7 @@ export const BillModalMixin = {
         unitList: mInfo.unitList,
         depotId: mInfo.depotId,
         inventory: mInfo.inventory,
+        ratio: mInfo.ratio,
       }
     },
     //使得型号、颜色、扩展信息、sku等为隐藏
@@ -898,10 +810,10 @@ export const BillModalMixin = {
     },
     //改变优惠、本次付款、欠款的值
     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 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 discountLastMoney = (allTaxLastMoney - discountMoney).toFixed(2) - 0
       let changeAmountNew = (discountLastMoney + otherMoney).toFixed(2) - 0
@@ -915,7 +827,7 @@ export const BillModalMixin = {
           discountMoney: discountMoney,
           discountLastMoney: discountLastMoney,
           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
       let otherMoney = this.form.getFieldValue('otherMoney') ? this.form.getFieldValue('otherMoney') - 0 : 0
       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 discountLastMoneyNew = (allTaxLastMoney - discountMoneyNew).toFixed(2) - 0
       let changeAmountNew = (discountLastMoneyNew + otherMoney).toFixed(2) - 0
@@ -946,7 +858,7 @@ export const BillModalMixin = {
       const value = e.target.value - 0
       let otherMoney = this.form.getFieldValue('otherMoney') ? this.form.getFieldValue('otherMoney') - 0 : 0
       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 discountLastMoneyNew = (allTaxLastMoney - value).toFixed(2) - 0
       let changeAmountNew = (discountLastMoneyNew + otherMoney).toFixed(2) - 0
@@ -1011,6 +923,7 @@ export const BillModalMixin = {
           return getListData(this.form, tables)
         })
         .then((allValues) => {
+          console.log(1233444,allValues)
           let detailArr = allValues.tablesValue[0].values
           let batchNumberStr = ''
           for (let detail of detailArr) {

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

@@ -308,7 +308,7 @@ export default {
     //调用完edit()方法之后会自动调用此方法
     editAfter() {
       this.billStatus = '0'
-      this.currentSelectDepotId = ''
+      
       this.changeColumnHide()
       this.changeFormTypes(this.materialTable.columns, 'snList', 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()方法之后会自动调用此方法
     editAfter() {
       this.billStatus = '0'
-      this.currentSelectDepotId = ''
+      
       this.changeColumnHide()
       if (this.action === 'add') {
         this.addInit(this.prefixNo)

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

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

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

@@ -33,6 +33,7 @@
                 :dropdownMatchSelectWidth="false"
                 showSearch
                 optionFilterProp="children"
+                @change="getTatRate"
               >
                 <div slot="dropdownRender" slot-scope="menu">
                   <v-nodes :vnodes="menu" />
@@ -64,6 +65,28 @@
           </a-col>
           <a-col :lg="6" :md="12" :sm="24">
             <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"
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -123,15 +146,31 @@
               <a-button icon="import" @click="onImport(prefixNo)">导入明细</a-button>
             </a-row>
           </template>
-          <template #depotBatchSet>
-            <a-icon type="down" @click="handleBatchSetDepot" />
+          <template #depotId="{ value }">
+            <a-select
+              disabled
+              :value="value"
+              :options="depotList"
+            >
+            </a-select>
           </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 #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 }">
             <a-select
               placeholder="请选择"
@@ -270,18 +309,6 @@ export default {
         loading: false,
         dataSource: [],
         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: '商品条码',
             key: 'barCode',
@@ -292,8 +319,6 @@ export default {
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
           { title: '名称', key: 'name', width: '120px', type: FormTypes.normal },
-          // { title: '规格', key: 'standard', width: '9%', type: FormTypes.normal },
-
           {
             title: '生产日期',
             key: 'productionDate',
@@ -301,9 +326,8 @@ export default {
             type: FormTypes.datetime,
             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: 'unitName', width: '120px', type: FormTypes.normal },
 
@@ -318,16 +342,13 @@ export default {
             key: 'unit',
             width: '120px',
             type: FormTypes.normal,
-            // options: [],
-            // allowClear: false,
-            // slotName: 'unit',
           },
           {
             title: '销售价',
             key: 'wholesaleDecimal',
             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: '单位列表', key: 'unitList', width: '120px', type: FormTypes.hidden },
@@ -344,15 +365,8 @@ export default {
             statistics: true,
             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: 'reasonOfDifference', width: '120px', type: FormTypes.input },
           {
@@ -366,6 +380,8 @@ export default {
           { title: '入库时间', key: 'warehousingTime', width: '200px', type: FormTypes.date },
           { title: '备注', key: 'remark', width: '200px', type: FormTypes.input },
           { 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,
@@ -379,6 +395,9 @@ export default {
         type: {
           rules: [{ required: true, message: '请选择类型!' }],
         },
+        depotId: {
+          rules: [{ required: true, message: '请选择仓库名!' }],
+        },
       },
       url: {
         add: '/depotHead/addDepotHeadAndDetail',
@@ -393,7 +412,6 @@ export default {
     //调用完edit()方法之后会自动调用此方法
     editAfter() {
       this.billStatus = '0'
-      this.currentSelectDepotId = ''
       this.rowCanEdit = true
       this.materialTable.columns[0].type = FormTypes.popupJsh
       this.changeColumnHide()
@@ -429,7 +447,9 @@ export default {
               'discountLastMoney',
               'otherMoney',
               'accountId',
-              'changeAmount'
+              'changeAmount',
+              'depotId',
+              'taxRate'
             )
           )
         })

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

@@ -33,7 +33,7 @@
                 :dropdownMatchSelectWidth="false"
                 showSearch
                 optionFilterProp="children"
-                @change="handleOrganChange"
+                @change="getTatRate"
               >
                 <div slot="dropdownRender" slot-scope="menu">
                   <v-nodes :vnodes="menu" />
@@ -65,6 +65,28 @@
           </a-col>
           <a-col :lg="6" :md="12" :sm="24">
             <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"
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -124,15 +146,37 @@
               <a-button icon="import" @click="onImport(prefixNo)">导入明细</a-button>
             </a-row>
           </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 #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" />
             <div v-if="quickBtn.depot" style="padding: 4px 8px; cursor: pointer" @click="addDepot">
               <a-icon type="plus" /> 新增仓库
             </div>
-          </template>
+          </template> -->
           <template #unit="{ handleChange, handleFocus, value }">
             <a-select
               placeholder="请选择"
@@ -298,7 +342,7 @@ export default {
           // { title: '生产日期', key: 'productionDate', width: '200px', type: FormTypes.normal, disabled: true },
           // { title: '保质期', key: 'expiryNum', width: '120px', 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: 'unitName', width: '120px', type: FormTypes.normal },
 
@@ -317,7 +361,7 @@ export default {
             // allowClear: false,
             // 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: '单位列表', key: 'unitList', width: '120px', type: FormTypes.hidden },
           { title: '序列号', key: 'snList', width: '120px', type: FormTypes.popupJsh, kind: 'sn', multi: true },
@@ -333,15 +377,15 @@ export default {
             statistics: true,
             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: 'reasonOfDifference', width: '120px', type: FormTypes.input },
           {
@@ -355,6 +399,8 @@ export default {
           { title: '出库时间', key: 'warehousingTime', width: '200px', type: FormTypes.date },
           { title: '备注', key: 'remark', width: '120px', type: FormTypes.input },
           { 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,
@@ -368,6 +414,9 @@ export default {
         type: {
           rules: [{ required: true, message: '请选择类型!' }],
         },
+        depotId: {
+          rules: [{ required: true, message: '请选择仓库名!' }],
+        },
       },
       url: {
         add: '/depotHead/addDepotHeadAndDetail',
@@ -382,7 +431,7 @@ export default {
     //调用完edit()方法之后会自动调用此方法
     editAfter() {
       this.billStatus = '0'
-      this.currentSelectDepotId = ''
+      
       this.rowCanEdit = true
       this.materialTable.columns[0].type = FormTypes.popupJsh
       this.changeColumnHide()
@@ -417,7 +466,9 @@ export default {
               'discountLastMoney',
               'otherMoney',
               'accountId',
-              'changeAmount'
+              'changeAmount',
+              'depotId',
+              'taxRate'
             )
           )
         })

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

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

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

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

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

@@ -41,6 +41,7 @@
                 :dropdownMatchSelectWidth="false"
                 showSearch
                 optionFilterProp="children"
+                @change="getTatRate"
               >
                 <div slot="dropdownRender" slot-scope="menu">
                   <v-nodes :vnodes="menu" />
@@ -95,6 +96,34 @@
               />
             </a-form-item>
           </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>
         <j-editable-table
           id="billModal"
@@ -148,15 +177,15 @@
               <a-button icon="import" @click="onImport(prefixNo)">导入明细</a-button>
             </a-row>
           </template>
-          <template #depotBatchSet>
+          <!-- <template #depotBatchSet>
             <a-icon type="down" @click="handleBatchSetDepot" />
-          </template>
-          <template #depotAdd>
+          </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>
+          </template> -->
           <template #unit="{ handleChange, handleFocus, value }">
             <a-select
               placeholder="请选择"
@@ -188,6 +217,28 @@
             >
             </a-select>
           </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>
         <a-row class="form-row" :gutter="24">
           <a-col :lg="24" :md="24" :sm="24">
@@ -449,17 +500,6 @@ export default {
         loading: false,
         dataSource: [],
         columns: [
-          // {
-          //   title: '仓库名称',
-          //   key: 'depotId',
-          //   width: '8%',
-          //   type: FormTypes.select,
-          //   placeholder: '请选择${title}',
-          //   options: [],
-          //   allowSearch: true,
-          //   disabled: true,
-          //   validateRules: [{ required: true, message: '${title}不能为空' }],
-          // },
           {
             title: '商品条码',
             key: 'barCode',
@@ -481,9 +521,8 @@ export default {
             type: FormTypes.datetime,
             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: 'unitName', width: '120px', type: FormTypes.normal },
 
@@ -498,16 +537,13 @@ export default {
             key: 'unit',
             width: '120px',
             type: FormTypes.normal,
-            // options: [],
-            // allowClear: false,
-            // slotName: 'unit',
           },
           {
             title: '销售价',
             key: 'wholesaleDecimal',
             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: '单位列表', key: 'unitList', width: '120px', type: FormTypes.hidden },
@@ -524,9 +560,9 @@ export default {
             statistics: true,
             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: '税额',
             key: 'taxMoney',
@@ -535,15 +571,8 @@ export default {
             readonly: 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: 'reasonOfDifference', width: '120px', type: FormTypes.input },
           {
@@ -558,6 +587,8 @@ export default {
 
           { title: '备注', key: 'remark', width: '200px', type: FormTypes.input },
           { 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,
@@ -577,6 +608,9 @@ export default {
             { pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' },
           ],
         },
+        depotId: {
+          rules: [{ required: true, message: '请选择仓库名!' }],
+        },
       },
       url: {
         add: '/depotHead/addDepotHeadAndDetail',
@@ -591,8 +625,8 @@ export default {
   methods: {
     //调用完edit()方法之后会自动调用此方法
     editAfter() {
+      console.log('this.model======',this.model)
       this.billStatus = '0'
-      this.currentSelectDepotId = ''
       this.rowCanEdit = true
       this.materialTable.columns[0].type = FormTypes.popupJsh
       this.changeColumnHide()
@@ -654,7 +688,9 @@ export default {
               'accountId',
               'deposit',
               'changeAmount',
-              'debt'
+              'debt',
+              'depotId',
+              'taxRate'
             )
           )
         })
@@ -730,9 +766,9 @@ export default {
     linkBillListOk(selectBillDetailRows, linkNumber, organId, discountMoney, deposit, remark, depotId, accountId) {
       let that = this
       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) {
         let listEx = []
         let allTaxLastMoney = 0
@@ -764,24 +800,28 @@ export default {
           this.depositStatus = true
           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.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) {
-          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"
                 showSearch
                 optionFilterProp="children"
+                @change="getTatRate"
               >
                 <div slot="dropdownRender" slot-scope="menu">
                   <v-nodes :vnodes="menu" />
@@ -96,11 +97,39 @@
           </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-col :lg="6" :md="12" :sm="24">
+            <a-form-item
               v-if="purchaseBySaleFlag"
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
               label="关联订单"
-              data-step="3"
+              data-step="5"
               data-title="关联订单"
               data-intro="采购订单单据可以通过关联订单来选择已录入的销售订单,选择之后会自动加载订单的内容,
               提交之后原来的销售订单会对应的改变单据状态。另外本系统支持分批多次关联"
@@ -165,6 +194,28 @@
               <a-button icon="import" @click="onImport(prefixNo)">导入明细</a-button>
             </a-row>
           </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 }">
             <a-select
               placeholder="请选择"
@@ -413,7 +464,6 @@ export default {
         sm: { span: 16 },
       },
       refKeys: ['materialDataTable'],
-      tableKeys: ['materialDataTable'],
       activeKey: 'materialDataTable',
       materialTable: {
         loading: false,
@@ -438,9 +488,8 @@ export default {
             type: FormTypes.datetime,
             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: 'unitName', width: '120px', type: FormTypes.normal },
 
@@ -455,16 +504,13 @@ export default {
             key: 'unit',
             width: '120px',
             type: FormTypes.normal,
-            // options: [],
-            // allowClear: false,
-            // slotName: 'unit',
           },
           {
             title: '销售价',
             key: 'wholesaleDecimal',
             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: '单位列表', key: 'unitList', width: '120px', type: FormTypes.hidden },
@@ -479,28 +525,9 @@ export default {
             statistics: true,
             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: '税额',
             key: 'taxMoney',
@@ -509,9 +536,11 @@ export default {
             readonly: 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: '关联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,
@@ -522,6 +551,9 @@ export default {
         organId: {
           rules: [{ required: true, message: '请选择供应商!' }],
         },
+        depotId: {
+          rules: [{ required: true, message: '请选择仓库名!' }],
+        },
       },
       url: {
         add: '/depotHead/addDepotHeadAndDetail',
@@ -536,8 +568,8 @@ export default {
   methods: {
     //调用完edit()方法之后会自动调用此方法
     editAfter() {
+      console.log('this.model======',this.model)
       this.billStatus = '0'
-      this.currentSelectDepotId = ''
       this.rowCanEdit = true
       // this.materialTable.columns[1].type = FormTypes.popupJsh
       this.changeColumnHide()
@@ -581,7 +613,9 @@ export default {
               'discountMoney',
               'discountLastMoney',
               'accountId',
-              'changeAmount'
+              'changeAmount',
+              'depotId',
+              'taxRate',
             )
           )
         })

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

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

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

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

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

@@ -41,7 +41,7 @@
                 :dropdownMatchSelectWidth="false"
                 showSearch
                 optionFilterProp="children"
-                @change="handleOrganChange"
+                @change="getTatRate"
               >
                 <div slot="dropdownRender" slot-scope="menu">
                   <v-nodes :vnodes="menu" />
@@ -94,6 +94,34 @@
               />
             </a-form-item>
           </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>
         <j-editable-table
           id="billModal"
@@ -146,6 +174,21 @@
               <a-button icon="import" @click="onImport(prefixNo)">导入明细</a-button>
             </a-row>
           </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 }">
             <a-select
               placeholder="请选择"
@@ -401,7 +444,7 @@ export default {
           // { title: '生产日期', key: 'productionDate', width: '6%', type: FormTypes.normal },
           // { title: '保质期', key: 'expiryNum', 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: 'unitName', width: '120px', type: FormTypes.normal },
 
@@ -420,11 +463,11 @@ export default {
             // allowClear: false,
             // 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: 'sku', width: '120px', type: FormTypes.normal },
+          // { title: '多属性', key: 'sku', width: '120px', type: FormTypes.normal },
           // { title: '原数量', key: 'preNumber', width: '4%', type: FormTypes.normal },
           // { title: '已出库', key: 'finishNumber', width: '4%', type: FormTypes.normal },
           {
@@ -435,9 +478,9 @@ export default {
             statistics: true,
             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: '税额',
             key: 'taxMoney',
@@ -446,7 +489,7 @@ export default {
             readonly: 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: '实际出库数量',
@@ -468,6 +511,8 @@ export default {
 
           { title: '备注', key: 'remark', width: '200px', type: FormTypes.input },
           { 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,
@@ -478,6 +523,9 @@ export default {
         organId: {
           rules: [{ required: true, message: '请选择客户!' }],
         },
+        depotId: {
+          rules: [{ required: true, message: '请选择仓库名!' }],
+        },
       },
       url: {
         add: '/depotHead/addDepotHeadAndDetail',
@@ -492,7 +540,7 @@ export default {
     //调用完edit()方法之后会自动调用此方法
     editAfter() {
       this.billStatus = '0'
-      this.currentSelectDepotId = ''
+      
       this.changeColumnHide()
       if (this.action === 'add') {
         this.addInit(this.prefixNo)
@@ -529,7 +577,9 @@ export default {
               'salesMan',
               'receiverName',
               'receiverPhone',
-              'receiverAddress'
+              'receiverAddress',
+              'depotId',
+              'taxRate'
             )
           )
         })

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

@@ -42,7 +42,7 @@
                 :dropdownMatchSelectWidth="false"
                 showSearch
                 optionFilterProp="children"
-                @change="handleOrganChange"
+                @change="getTatRate"
               >
                 <div slot="dropdownRender" slot-scope="menu">
                   <v-nodes :vnodes="menu" />
@@ -97,6 +97,34 @@
               />
             </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-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>
         <j-editable-table
           id="billModal"
@@ -150,15 +178,15 @@
               <a-button icon="import" @click="onImport(prefixNo)">导入明细</a-button>
             </a-row>
           </template>
-          <template #depotBatchSet>
+          <!-- <template #depotBatchSet>
             <a-icon type="down" @click="handleBatchSetDepot" />
-          </template>
-          <template #depotAdd>
+          </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>
+          </template> -->
           <template #unit="{ handleChange, handleFocus, value }">
             <a-select
               placeholder="请选择"
@@ -190,6 +218,28 @@
             >
             </a-select>
           </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>
         <a-row class="form-row" :gutter="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: 'expiryNum', width: '6%', 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: 'unitName', width: '120px', type: FormTypes.normal },
 
@@ -536,9 +586,9 @@ export default {
             statistics: true,
             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: '税额',
             key: 'taxMoney',
@@ -547,7 +597,7 @@ export default {
             readonly: 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: '实际出库数量',
@@ -570,6 +620,8 @@ export default {
 
           { title: '备注', key: 'remark', width: '200px', type: FormTypes.input },
           { 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,
@@ -589,6 +641,9 @@ export default {
             { pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' },
           ],
         },
+        depotId: {
+          rules: [{ required: true, message: '请选择仓库名!' }],
+        },
       },
       url: {
         add: '/depotHead/addDepotHeadAndDetail',
@@ -603,7 +658,6 @@ export default {
     //调用完edit()方法之后会自动调用此方法
     editAfter() {
       this.billStatus = '0'
-      this.currentSelectDepotId = ''
       this.rowCanEdit = true
       this.materialTable.columns[0].type = FormTypes.popupJsh
       this.changeColumnHide()
@@ -672,7 +726,9 @@ export default {
               'salesMan',
               'receiverName',
               'receiverPhone',
-              'receiverAddress'
+              'receiverAddress',
+              'depotId',
+              'taxRate'
             )
           )
         })
@@ -760,9 +816,9 @@ export default {
     ) {
       let that = this
       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) {
         let listEx = []
         let allTaxLastMoney = 0
@@ -789,10 +845,13 @@ export default {
         }
         let discountLastMoney = (allTaxLastMoney - discountMoney).toFixed(2) - 0
         let changeAmount = discountLastMoney
+        console.log('deposit===',deposit)
         if (deposit) {
           this.depositStatus = true
           changeAmount = (discountLastMoney - deposit).toFixed(2) - 0
         }
+        
+        this.personList.value = salesMan
         this.$nextTick(() => {
           this.form.setFieldsValue({
             organId: organId,
@@ -807,14 +866,16 @@ export default {
             receiverName,
             receiverPhone,
             receiverAddress,
+            depotId: depotId,
           })
-          this.personList.value = salesMan
+          console.log('discount===',this.form.getFieldValue('discount'))
+          this.getTatRate(organId)
         })
         //判断后进行仓库的切换
         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">
           <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="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 v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          >
+          > -->
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

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

@@ -102,12 +102,12 @@
         <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" 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 v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          >
+          > -->
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

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

@@ -130,12 +130,12 @@
         <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" 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 v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          >
+          > -->
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

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

@@ -130,12 +130,12 @@
         <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" 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 v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          >
+          > -->
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

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

@@ -121,12 +121,12 @@
         <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" 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 v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          >
+          > -->
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

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

@@ -121,12 +121,12 @@
         <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" 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 v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          >
+          > -->
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

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

@@ -78,14 +78,14 @@ export const FinancialListMixin = {
           }
         })
       } else {
-        this.$message.warning('抱歉,只有未审核的单据才能编辑,请先进行反审核!')
+        this.$message.warning('抱歉,只有未审核的单据才能编辑!')
       }
     },
     myHandleDelete(record) {
       if (record.status === '0') {
         this.handleDelete(record.id)
       } else {
-        this.$message.warning('抱歉,只有未审核的单据才能删除,请先进行反审核!')
+        this.$message.warning('抱歉,只有未审核的单据才能删除!')
       }
     },
     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-form-item>
           <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 :labelCol="labelCol" :wrapperCol="wrapperCol" label="上级目录">
             <a-tree-select
@@ -86,6 +86,9 @@
           <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="备注">
             <a-textarea placeholder="请输入备注" :rows="2" v-decorator.trim="['remark']" />
           </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>
         <div class="anty-form-btn">
           <a-button @click="emptyCurrForm" type="default" htmlType="button" icon="sync">重置</a-button>
@@ -292,6 +295,7 @@ export default {
             record.parentId = res.data.parentId
             record.sort = res.data.sort
             record.remark = res.data.remark
+            record.expiryThreshold = res.data.expiryThreshold
             console.log('onSelect-record', record)
             this.currSelected = Object.assign({}, record)
             this.model = this.currSelected
@@ -316,7 +320,7 @@ export default {
     // 触发onSelect事件时,为类别树右侧的form表单赋值
     setValuesToForm(record) {
       this.$nextTick(() => {
-        this.form.setFieldsValue(pick(record, 'name', 'serialNo', 'parentId', 'sort', 'remark'))
+        this.form.setFieldsValue(pick(record, 'name', 'serialNo', 'parentId', 'sort', 'remark', 'expiryThreshold'))
       })
     },
     getCurrSelectedTitle() {

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

@@ -59,11 +59,6 @@
                     <a-input placeholder="请输入品牌查询" v-model="queryParam.brand"></a-input>
                   </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.mfrs"></a-input>
-                  </a-form-item>
-                </a-col> -->
                 <a-col :md="6" :sm="24">
                   <a-form-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
                     <a-select placeholder="请选择状态" v-model="queryParam.enabled">
@@ -80,23 +75,6 @@
                     </a-select>
                   </a-form-item>
                 </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-form-item label="扩展信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
                     <a-input
@@ -115,15 +93,15 @@
                     ></a-input-number>
                   </a-form-item>
                 </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-col> -->
+                </a-col>
                 <a-col :md="6" :sm="24">
                   <a-form-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol">
                     <a-input placeholder="请输入备注查询" v-model="queryParam.remark"></a-input>
@@ -220,9 +198,6 @@
                 </div>
               </a-popover>
             </template>
-            <template slot="customBarCode" slot-scope="text, record">
-              {{ record.mBarCode }}
-            </template>
             <template slot="customName" slot-scope="text, record">
               {{ record.name }}
               <a-tag v-if="record.enableSerialNumber == 1" color="orange">序</a-tag>
@@ -238,6 +213,11 @@
                 {{ text }}
               </a-tooltip>
             </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">
               <a-tag v-if="enabled" color="green">启用</a-tag>
               <a-tag v-if="!enabled" color="orange">禁用</a-tag>
@@ -295,14 +275,11 @@ export default {
         model: '',
         color: '',
         brand: '',
-        mfrs: '',
         materialOther: '',
         weight: '',
-        expiryNum: '',
         enabled: undefined,
         enableSerialNumber: undefined,
-        enableBatchNumber: undefined,
-        position: '',
+        reminder: undefined,
         remark: '',
         mpList: getMpListShort(Vue.ls.get('materialPropertyList')), //扩展属性
       },
@@ -316,7 +293,7 @@ export default {
       // 默认索引
       defDataIndex: [
         'action',
-        'mBarCode',
+        'barCode',
         'name',
         'standard',
         'model',
@@ -325,11 +302,12 @@ export default {
         'materialOther',
         'unit',
         'stock',
-        'purchaseDecimal',
+        'defaultPurchaseDecimal',
         'commodityDecimal',
-        'wholesaleDecimal',
+        'defaultWholesaleDecimal',
         'lowDecimal',
         'enabled',
+        'reminder'
       ],
       // 默认列
       defColumns: [
@@ -341,7 +319,7 @@ export default {
           scopedSlots: { customRender: 'action' },
         },
         { 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: '系统SKU', dataIndex: 'systemSku', width: 120 },
         { title: '规格', dataIndex: 'standard', width: 120 },
@@ -368,20 +346,16 @@ export default {
           },
         },
         { title: '基础重量', dataIndex: 'weight', width: 80 },
-        // { title: '保质期', dataIndex: 'expiryNum', width: 60 },
-        // { title: '制造商', dataIndex: 'mfrs', width: 120, ellipsis: true },
         {
           title: '初始库存',
           dataIndex: 'initialStock',
           width: 80,
           scopedSlots: { customRender: 'customRenderInitialStock' },
         },
+        { title: '默认采购价', dataIndex: 'defaultPurchaseDecimal', width: 100 },
+        { title: '默认销售价', dataIndex: 'defaultWholesaleDecimal', width: 100 },
         { 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: '状态',

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

@@ -21,7 +21,7 @@
         <a-tabs default-active-key="1" size="small">
           <a-tab-pane key="1" tab="基本信息" id="materialHeadModal" forceRender>
             <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
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
@@ -37,7 +37,7 @@
                   />
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <a-form-item
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
@@ -49,7 +49,7 @@
                   <a-input placeholder="请输入规格" v-decorator.trim="['standard', validatorRules.standard]" />
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <a-form-item
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
@@ -61,7 +61,7 @@
                   <a-input placeholder="请输入型号" v-decorator.trim="['model', validatorRules.model]" />
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <a-form-item
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
@@ -111,42 +111,7 @@
                   </a-row>
                 </a-form-item>
               </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
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
@@ -158,7 +123,7 @@
                   <a-input placeholder="请输入颜色" v-decorator.trim="['color']" />
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <a-form-item
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
@@ -170,7 +135,7 @@
                   <a-input placeholder="请输入品牌" v-decorator.trim="['brand']" />
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <a-form-item
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
@@ -182,7 +147,7 @@
                   <a-input placeholder="" v-decorator.trim="['mnemonic']" :readOnly="true" />
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <a-form-item
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
@@ -202,9 +167,7 @@
                   </a-tree-select>
                 </a-form-item>
               </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
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
@@ -216,7 +179,7 @@
                   <a-input-number style="width: 100%" placeholder="请输入基础重量(kg)" v-decorator.trim="['weight']" />
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <a-form-item
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
@@ -233,7 +196,7 @@
                   </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
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
@@ -245,7 +208,7 @@
                   <a-input placeholder="提交后自动生成" disabled v-decorator="['systemSku']" />
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <a-form-item
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
@@ -264,74 +227,46 @@
                   </a-tooltip>
                 </a-form-item>
               </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
-                  :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-col>
-              <a-col :md="12" :sm="24" v-if="manySkuSelected >= 2">
+              <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <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-col>
-              <a-col :md="12" :sm="24" v-if="manySkuSelected >= 3">
+              <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <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-col>
             </a-row>
             <div style="margin-top: 8px" id="materialDetailModal">
               <a-table
+                ref="meTable"
                 size="middle"
                 rowKey="id"
                 :loading="meTable.loading"
@@ -348,6 +283,18 @@
                 <template slot="depotId" slot-scope="text, record">
                   {{ formatDepotName(record.depotId) }}
                 </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>
             </div>
             <a-row class="form-row" :gutter="24">
@@ -426,7 +373,6 @@
               :actionButton="false"
             >
               <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-left: 8px" @click="batchSetStock('highSafeStock')">最高安全库存-批量</a-button>
               </template>
@@ -445,7 +391,7 @@
                   <j-image-upload v-model="fileList" bizPath="material" text="上传" isMultiple></j-image-upload>
                 </a-form-item>
               </a-col>
-              <a-col :lg="6" :md="6" :sm="24"></a-col>
+              <a-col :md="6" :sm="24"></a-col>
             </a-row>
             <a-row class="form-row" :gutter="24">
               <a-col :lg="18" :md="18" :sm="24">
@@ -457,7 +403,7 @@
                   图片最多4张,且单张大小不超过1M
                 </a-form-item>
               </a-col>
-              <a-col :lg="6" :md="6" :sm="24"></a-col>
+              <a-col :md="6" :sm="24"></a-col>
             </a-row>
           </a-tab-pane>
         </a-tabs>
@@ -482,13 +428,10 @@ import { FormTypes, getRefPromise, VALIDATE_NO_PASSED, validateFormAndTables } f
 import {
   checkMaterial,
   checkMaterialBarCode,
-  getMaterialAttributeNameList,
-  getMaterialAttributeValueListById,
-  getMaxBarCode,
   queryMaterialCategoryTreeList,
   changeNameToPinYin,
 } from '@/api/api'
-import { removeByVal, autoJumpNextInput, handleIntroJs } from '@/utils/util'
+import {  autoJumpNextInput, handleIntroJs } from '@/utils/util'
 import { getAction, httpAction } from '@/api/manage'
 import JImageUpload from '@/components/jeecg/JImageUpload'
 import JDate from '@/components/jeecg/JDate'
@@ -523,23 +466,9 @@ export default {
       unitList: [],
       depotList: [],
       fileList: [],
-      unitStatus: false,
-      manyUnitStatus: true,
       unitChecked: false,
-      manySkuStatus: false,
-      switchDisabled: false, //开关的启用状态
-      barCodeSwitch: false, //生成条码开关
-      maxBarCodeInfo: '', //最大条码
       meDeleteIdList: [], //删除条码信息的id数组
       prefixNo: 'material',
-      materialAttributeList: [],
-      skuOneTitle: '属性1',
-      skuTwoTitle: '属性2',
-      skuThreeTitle: '属性3',
-      skuOneList: [],
-      skuTwoList: [],
-      skuThreeList: [],
-      manySkuSelected: 0,
       model: {},
       showOkFlag: true,
       setTimeFlag: null,
@@ -572,6 +501,7 @@ export default {
           {
             title: '采购价',
             dataIndex: 'purchaseDecimal',
+            scopedSlots: { customRender: 'purchaseDecimal' } 
           },
           {
             title: '零售价',
@@ -580,6 +510,7 @@ export default {
           {
             title: '销售价',
             dataIndex: 'wholesaleDecimal',
+            scopedSlots: { customRender: 'wholesaleDecimal' } 
           },
           {
             title: '最低售价',
@@ -590,10 +521,6 @@ export default {
             dataIndex: 'productionDate',
           },
           {
-            title: '保质期(天)',
-            dataIndex: 'expiryNum',
-          },
-          {
             title: '供应商',
             dataIndex: 'supplierId',
             scopedSlots: { customRender: 'supplierId' } 
@@ -607,7 +534,10 @@ export default {
             dataIndex: 'depotId',
             scopedSlots: { customRender: 'depotId' } 
           },
-         
+          {
+            title: '库位',
+            dataIndex: 'position',
+          },
         ],
         pagination: {
           current: 1,
@@ -653,6 +583,14 @@ export default {
             type: FormTypes.normal,
           },
           {
+            title: '期初库存',
+            key: 'number',
+            width: '15%',
+            type: FormTypes.inputNumber,
+            defaultValue: '',
+            placeholder: '请输入${title}',
+          },
+          {
             title: '库存总数量',
             key: 'currentStock',
             width: '15%',
@@ -711,6 +649,12 @@ export default {
         unitId: {
           rules: [{ required: true, message: '请选择多单位!' }],
         },
+        defaultWholesaleDecimal: {
+          rules: [{ required: true, message: '请输入默认销售价!' }],
+        },
+        defaultPurchaseDecimal: {
+          rules: [{ required: true, message: '请输入默认采购价!' }],
+        },
       },
       url: {
         add: '/material/add',
@@ -770,13 +714,9 @@ export default {
       this.form.resetFields()
       this.model = Object.assign({}, record)
       this.activeKey = '1'
-      this.manySkuSelected = 0
-      this.barCodeSwitch = false
-      this.manySkuStatus = false
-      this.maxBarCodeInfo = ''
       this.visible = true
       this.meDeleteIdList = []
-      this.modalStyle = 'top:20px;height: 95%;'
+      this.modalStyle = 'top:0;height: 95%;'
       if (JSON.stringify(record) === '{}') {
         this.fileList = []
       } else {
@@ -799,6 +739,9 @@ export default {
             'categoryId',
             'enableSerialNumber',
             'movingPinReminderCycle',
+            'expiryNum',
+            'defaultPurchaseDecimal',
+            'defaultWholesaleDecimal',
             'systemSku',
             'weight',
             'remark',
@@ -810,22 +753,15 @@ export default {
         autoJumpNextInput('materialHeadModal')
         autoJumpNextInput('materialDetailModal')
       })
-      this.initMaterialAttribute()
       this.loadTreeData()
       this.loadUnitListData()
       // 加载子表数据
       if (this.model.id) {
-        //禁用多属性开关
-        this.switchDisabled = true
         // 判断是否是多单位
         if (this.model.unit) {
           this.unitChecked = false
-          this.unitStatus = false
-          this.manyUnitStatus = true
         } else {
           this.unitChecked = true
-          this.unitStatus = true
-          this.manyUnitStatus = false
           console.log('多单位-----', record)
           await this.getUnitListByID(record.unitId)
         }
@@ -834,7 +770,6 @@ export default {
         this.requestMeTableData()
         this.requestDepotTableData(this.url.depotWithStock, { mId: this.model.id }, this.depotTable)
       } else {
-        this.switchDisabled = false
         this.requestDepotTableData(this.url.depotWithStock, { mId: 0 }, this.depotTable)
       }
     },
@@ -882,7 +817,10 @@ export default {
       tab.loading = true
       getAction(url, params)
         .then((res) => {
-          tab.dataSource = res.data || []
+          tab.dataSource = (res.data || []).map(item => {
+            item.number = item.initStock
+            return item
+          })
           console.log('====================', res.data)
         })
         .finally(() => {
@@ -893,9 +831,9 @@ export default {
       this.$emit('close')
       this.visible = false
       this.modalStyle = ''
-      this.unitStatus = false
-      this.manyUnitStatus = true
       this.unitChecked = false
+      this.meTable.dataSource = []
+      this.meTable.pagination.current = 1
       this.getAllTable().then((editableTables) => {
         editableTables[0].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) {
       const { row, target } = event
       // 不勾选多单位
@@ -1296,14 +1089,6 @@ export default {
       // this.meDeleteIdList = 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) {
       this.$refs.stockModalForm.add(type)
       this.$refs.stockModalForm.disableSubmit = false
@@ -1332,13 +1117,6 @@ export default {
       }
       this.depotTable.dataSource = depotTableData
     },
-    initMaterialAttribute() {
-      getMaterialAttributeNameList().then((res) => {
-        if (res) {
-          this.materialAttributeList = res
-        }
-      })
-    },
     loadParseMaterialProperty() {
       let mpList = Vue.ls.get('materialPropertyList')
       for (let i = 0; i < mpList.length; i++) {
@@ -1380,12 +1158,6 @@ export default {
       }
     },
     onlyUnitOnChange(e) {
-      if (e.target.value) {
-        //单位有填写了之后则显示多属性的文本框
-        this.manySkuStatus = true
-      } else {
-        this.manySkuStatus = false
-      }
       console.log('onlyUnitOnChange=======',e.target.value)
       this.$refs.editableProBarCodeTable.getValues((error, values) => {
         let mArr = values
@@ -1404,12 +1176,8 @@ export default {
     unitOnChange(e) {
       let isChecked = e.target.checked
       if (isChecked) {
-        this.unitStatus = true
-        this.manyUnitStatus = false
         this.unitChecked = true
       } else {
-        this.unitStatus = false
-        this.manyUnitStatus = true
         this.unitChecked = false
       }
 

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

@@ -12,14 +12,6 @@
         ></filter-form>
         <div style="margin-bottom: 6px">
           <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>
         <a-table
           ref="table"
@@ -233,4 +225,6 @@ export default {
 }
 </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>
 
 <script>
-// import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import FilterForm from './components/FilterForm.vue'
 import table from './utils/table'
 import StockModal from './components/stockModal.vue'
@@ -240,4 +239,6 @@ export default {
 }
 </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>
-  <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">
         <edit-form
           :spinnerList="spinnerList"
@@ -129,22 +140,20 @@
 </template>
 
 <script>
-import { findBySelectOrgan, queryMaterialCategoryTreeList, getAllOrganizationTreeByUser } from '@/api/api'
+import {  queryMaterialCategoryTreeList } from '@/api/api'
 
 import editForm from './editForm.vue'
 import table from '../utils/table'
 import JSelectMaterialModal from '../../../components/jeecgbiz/modal/JSelectMaterialModal.vue'
 import { getAction, postAction } from '@/api/manage'
-import { getMaterialByBatchNumber } from '@/api/api'
 import { newTableMixin } from '@/mixins/newTableMixin'
 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 {
+  name: 'CheckModal',
   components: { editForm, JSelectMaterialModal },
-  mixins: [newTableMixin],
+  mixins: [ newTableMixin, mixinDevice ],
   props: {
     rules: {
       type: Object,

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

@@ -73,7 +73,7 @@
       </a-col>
       <a-col :xl="6" :lg="8" :md="12" :sm="24" class="form-col">
         <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-form-item>
       </a-col>
@@ -136,11 +136,11 @@ export default {
       ],
       labelCol: {
         xs: { span: 24 },
-        sm: { span: 8 },
+        sm: { span: 9 },
       },
       wrapperCol: {
         xs: { span: 24 },
-        sm: { span: 16 },
+        sm: { span: 15 },
       },
       taskTypeList: [
         { value: 1, label: '全盘' },

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

@@ -1,6 +1,17 @@
 <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">
         <edit-form
           :spinnerList="spinnerList"
@@ -68,14 +79,13 @@ import editForm from './editForm.vue'
 import table from '../utils/table'
 import JSelectMaterialModal from '../../../components/jeecgbiz/modal/JSelectMaterialModal2.vue'
 import { getAction, postAction } from '@/api/manage'
-import { getMaterialByBatchNumber } from '@/api/api'
 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 {
+  name: 'StockModal',
   components: { editForm, JSelectMaterialModal },
-  mixins: [newTableMixin],
+  mixins: [ newTableMixin, mixinDevice ],
   props: {
     rules: {
       type: Object,
@@ -165,6 +175,9 @@ export default {
           if (params.taskType === 2) {
             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
           postAction(url, params).then((res) => {
             if (res.code === 200) {

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

@@ -1,7 +1,7 @@
 <template>
   <a-row :gutter="24">
     <a-col :md="24">
-      <a-card :style="cardStyle" :bordered="false">
+      <a-card :bordered="false">
         <!-- 查询区域 -->
         <div class="table-page-search-wrapper">
           <!-- 搜索区域 -->
@@ -146,21 +146,33 @@ export default {
           align: 'center',
           scopedSlots: { customRender: 'action' },
         },
+        { title: '供应商编码', dataIndex: 'serialNo', width: 150, align: 'left' },
         { title: '名称', dataIndex: 'supplier', width: 150, align: 'left' },
         { title: '联系人', dataIndex: 'contacts', width: 70, align: 'left' },
         { title: '手机号码', dataIndex: 'telephone', width: 100, align: 'left' },
         { title: '联系电话', dataIndex: 'phoneNum', width: 100, align: 'left' },
         { title: '电子邮箱', dataIndex: 'email', width: 150, 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: '结算方式',
+          title: '结算周期',
           dataIndex: 'settlementMethod',
           width: 80,
           align: 'left',
           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: '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-form-item>
             </a-col>
-          </a-row>
-          <a-row class="form-row" :gutter="24">
             <a-col :span="24 / 2">
               <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="手机号码">
                 <a-input placeholder="请输入手机号码" v-decorator.trim="['telephone', validatorRules.telephone]" />
@@ -131,7 +129,10 @@ export default {
       form: this.$form.createForm(this),
       validatorRules: {
         telephone: {
-          rules: [{ required: true, message: '请输入手机号!' }],
+          rules: [
+            { required: true, message: '请输入手机号!' },
+            { pattern: /^(?:\+?86)?1[3-9]\d{9}$/, message: '手机号格式不正确!' },
+          ],
         },
         supplier: {
           rules: [
@@ -238,4 +239,9 @@ export default {
   },
 }
 </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"
             :loading="loading"
           >
-            <span slot="action" slot-scope="text, record">
+            <span slot="action" slot-scope="text, record, index">
               <a-checkbox
                 v-if="record.pushBtn.indexOf(1) > -1"
                 value="1"
                 :checked="record.btnStr ? record.btnStr.indexOf(1) > -1 : false"
-                @change="onChange(record, '1')"
+                @change="onChange(record, '1', index)"
                 >编辑</a-checkbox
               >
               <a-checkbox
                 v-if="record.pushBtn.indexOf(2) > -1"
                 value="2"
                 :checked="record.btnStr ? record.btnStr.indexOf(2) > -1 : false"
-                @change="onChange(record, '2')"
+                @change="onChange(record, '2', index)"
                 >审核</a-checkbox
               >
               <a-checkbox
                 v-if="record.pushBtn.indexOf(7) > -1"
                 value="7"
                 :checked="record.btnStr ? record.btnStr.indexOf(7) > -1 : false"
-                @change="onChange(record, '7')"
+                @change="onChange(record, '7', index)"
                 >反审核</a-checkbox
               >
               <a-checkbox
                 v-if="record.pushBtn.indexOf(3) > -1"
                 value="3"
                 :checked="record.btnStr ? record.btnStr.indexOf(3) > -1 : false"
-                @change="onChange(record, '3')"
+                @change="onChange(record, '3', index)"
                 >导出</a-checkbox
               >
               <a-checkbox
                 v-if="record.pushBtn.indexOf(4) > -1"
                 value="4"
                 :checked="record.btnStr ? record.btnStr.indexOf(4) > -1 : false"
-                @change="onChange(record, '4')"
+                @change="onChange(record, '4', index)"
                 >启用禁用</a-checkbox
               >
               <a-checkbox
                 v-if="record.pushBtn.indexOf(5) > -1"
                 value="5"
                 :checked="record.btnStr ? record.btnStr.indexOf(5) > -1 : false"
-                @change="onChange(record, '5')"
+                @change="onChange(record, '5', index)"
                 >打印</a-checkbox
               >
               <a-checkbox
                 v-if="record.pushBtn.indexOf(6) > -1"
                 value="6"
                 :checked="record.btnStr ? record.btnStr.indexOf(6) > -1 : false"
-                @change="onChange(record, '6')"
+                @change="onChange(record, '6', index)"
                 >作废</a-checkbox
               >
             </span>
@@ -233,7 +233,7 @@ export default {
     },
     toggleChecked() {
       this.checked = !this.checked
-      let funArray = this.dataSource
+      let funArray = this.dataSource.slice()
       if (this.checked) {
         for (let item of funArray) {
           item.btnStr = item.pushBtn
@@ -243,10 +243,11 @@ export default {
           item.btnStr = ''
         }
       }
+      this.dataSource = funArray
     },
     editToggleChecked() {
       this.editChecked = !this.editChecked
-      let funArray = this.dataSource
+      let funArray = this.dataSource.slice()
       if (this.editChecked) {
         for (let item of funArray) {
           item.btnStr = this.parseArrByParam(1, item.btnStr, 1)
@@ -256,10 +257,11 @@ export default {
           item.btnStr = this.parseArrByParam(1, item.btnStr, 0)
         }
       }
+      this.dataSource = funArray
     },
     auditToggleChecked() {
       this.auditChecked = !this.auditChecked
-      let funArray = this.dataSource
+      let funArray = this.dataSource.slice()
       if (this.auditChecked) {
         for (let item of funArray) {
           item.btnStr = this.parseArrByParam(2, item.btnStr, 1)
@@ -269,10 +271,11 @@ export default {
           item.btnStr = this.parseArrByParam(2, item.btnStr, 0)
         }
       }
+      this.dataSource = funArray
     },
     unAuditToggleChecked() {
       this.unAuditChecked = !this.unAuditChecked
-      let funArray = this.dataSource
+      let funArray = this.dataSource.slice()
       if (this.unAuditChecked) {
         for (let item of funArray) {
           item.btnStr = this.parseArrByParam(7, item.btnStr, 1)
@@ -282,10 +285,11 @@ export default {
           item.btnStr = this.parseArrByParam(7, item.btnStr, 0)
         }
       }
+      this.dataSource = funArray
     },
     exportToggleChecked() {
       this.exportChecked = !this.exportChecked
-      let funArray = this.dataSource
+      let funArray = this.dataSource.slice()
       if (this.exportChecked) {
         for (let item of funArray) {
           item.btnStr = this.parseArrByParam(3, item.btnStr, 1)
@@ -295,6 +299,7 @@ export default {
           item.btnStr = this.parseArrByParam(3, item.btnStr, 0)
         }
       }
+      this.dataSource = funArray
     },
     /**
      * 格式转换,控制按钮的显示或隐藏
@@ -324,7 +329,7 @@ export default {
       }
       return btnStr
     },
-    onChange(record, value) {
+    onChange(record, value, index) {
       let funArray = this.dataSource
       for (let item of funArray) {
         if (item.id === record.id) {
@@ -335,16 +340,19 @@ export default {
               //去掉勾选
               removeByVal(btnArr, value)
               item.btnStr = btnArr.join()
+              this.$set(this.dataSource, index, item)
             } else {
               //勾选
               btnArr.push(value)
               item.btnStr = btnArr.join()
+              this.$set(this.dataSource, index, item)
             }
           } else {
             let btnArr = []
             //勾选
             btnArr.push(value)
             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">
     <a-modal
       :title="title"
-      :width="1200"
+      width="100%"
       :visible="visible"
       :confirmLoading="confirmLoading"
       :getContainer="() => $refs.container"
@@ -14,7 +14,7 @@
       @cancel="handleCancel"
       cancelText="取消"
       okText="保存"
-      style="top: 10%"
+      style="top: 0; height: 100%"
     >
       <template slot="footer">
         <a-button key="back" v-if="isReadOnly" @click="handleCancel"> 取消 </a-button>
@@ -23,6 +23,11 @@
         <a-form :form="form" id="vendorModal">
           <a-row class="form-row" :gutter="24">
             <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-input placeholder="请输入名称" v-decorator.trim="['supplier', validatorRules.supplier]" />
               </a-form-item>
@@ -32,8 +37,6 @@
                 <a-input placeholder="请输入联系人" v-decorator.trim="['contacts']" />
               </a-form-item>
             </a-col>
-          </a-row>
-          <a-row class="form-row" :gutter="24">
             <a-col :span="24 / 2">
               <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="手机号码">
                 <a-input placeholder="请输入手机号码" v-decorator.trim="['telephone']" />
@@ -45,26 +48,6 @@
               </a-form-item>
             </a-col>
             <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-input placeholder="请输入纳税人识别号" v-decorator.trim="['taxNum']" />
               </a-form-item>
@@ -100,21 +83,23 @@
               </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-select
                   v-decorator.trim="['settlementMethod']"
                   :options="settleOptions"
-                  placeholder="请选择结算方式"
+                  placeholder="请选择结算周期"
                 ></a-select>
               </a-form-item>
             </a-col>
             <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']"
-                />
+                  placeholder="请选择付款方式"
+                >
+                  <a-select-option value="先款后货">先款后货</a-select-option>
+                  <a-select-option value="先货后款">先货后款</a-select-option>
+                </a-select>
               </a-form-item>
             </a-col>
             <a-col :span="24 / 2">
@@ -132,7 +117,7 @@
               </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-select
                   v-decorator.trim="['invoiceType']"
                   :options="invoiceOptions"
@@ -151,6 +136,22 @@
               </a-form-item>
             </a-col>
             <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-textarea :rows="2" placeholder="请输入备注" v-decorator.trim="['description']" />
               </a-form-item>
@@ -186,11 +187,11 @@ export default {
       isReadOnly: false,
       labelCol: {
         xs: { span: 24 },
-        sm: { span: 4 },
+        sm: { span: 6 },
       },
       wrapperCol: {
         xs: { span: 24 },
-        sm: { span: 20 },
+        sm: { span: 18 },
       },
       confirmLoading: false,
       form: this.$form.createForm(this),
@@ -267,7 +268,10 @@ export default {
             'procurementContact',
             'deliveryDays',
             'invoiceType',
-            'contractUpload'
+            'contractUpload',
+            'serialNo',
+            'isAfterSales',
+            'afterSalesRules',
           )
         )
         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 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
      * */

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

@@ -356,30 +356,40 @@ public class ExceptionConstants {
     //EXCEL中有副条码在系统中已存在(除自身商品之外)
     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 int MATERIAL_Category_Name_EMPTY_CODE = 8000029;
     public static final String MATERIAL_Category_Name_EMPTY_MSG = "第%s行类别为空";
-
-    //类型不存在错误
+    //类别不存在
     public static final int MATERIAL_TYPE_NOT_DECIMAL_CODE = 8000030;
     public static final String MATERIAL_TYPE_NOT_DECIMAL_MSG = "第%s行类别不存在";
-
-    //供应商不存在错误
+    //供应商不存在
     public static final int MATERIAL_SUPPLIER_NOT_DECIMAL_CODE = 8000031;
     public static final String MATERIAL_SUPPLIER_NOT_DECIMAL_MSG = "第%s行供应商不存在";
-
-    //仓库不存在错误
+    //仓库不存在
     public static final int MATERIAL_DEPOT_NOT_DECIMAL_CODE = 8000031;
     public static final String MATERIAL_DEPOT_NOT_DECIMAL_MSG = "第%s行仓库不存在";
-
     //erp_sku 不存在
     public static final int MATERIAL_ERP_SKU_NOT_DECIMAL_CODE = 8000032;
     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 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("warehousingUserName",diEx.getWarehousingUserName());
                     item.put("wholesaleDecimal",diEx.getWholesaleDecimal());
+                    item.put("defaultPurchaseDecimal",diEx.getDefaultPurchaseDecimal());
+                    item.put("defaultWholesaleDecimal",diEx.getDefaultWholesaleDecimal());
                     dataArray.add(item);
                     //合计数据汇总
                     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.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.ApiOperation;
 import org.slf4j.Logger;
@@ -66,17 +63,17 @@ public class MaterialCategoryController extends BaseController {
 
     @PostMapping(value = "/add")
     @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<>();
-        int insert = materialCategoryService.insertMaterialCategory(obj, request);
+        int insert = materialCategoryService.insertMaterialCategory(materialCategory, request);
         return returnStr(objectMap, insert);
     }
 
     @PutMapping(value = "/update")
     @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<>();
-        int update = materialCategoryService.updateMaterialCategory(obj, request);
+        int update = materialCategoryService.updateMaterialCategory(materialCategory, request);
         return returnStr(objectMap, update);
     }
 
@@ -133,14 +130,8 @@ public class MaterialCategoryController extends BaseController {
         return res;
     }
 
-    /**
-     * 根据id来查询商品名称
-     * @param id
-     * @param request
-     * @return
-     */
     @GetMapping(value = "/findById")
-    @ApiOperation(value = "根据id来查询商品名称")
+    @ApiOperation(value = "根据类别id来查询类别信息")
     public BaseResponseInfo findById(@RequestParam("id") Long id, HttpServletRequest request)throws Exception {
         BaseResponseInfo res = new BaseResponseInfo();
         try {
@@ -158,6 +149,7 @@ public class MaterialCategoryController extends BaseController {
                     outer.put("sort", mc.getSort());
                     outer.put("serialNo", mc.getSerialNo());
                     outer.put("remark", mc.getRemark());
+                    outer.put("expiryThreshold",mc.getExpiryThreshold());
                 }
             }
             res.code = 200;
@@ -171,21 +163,11 @@ public class MaterialCategoryController extends BaseController {
     }
     /**
      * 获取商品类别树数据
-     * @Param:
-     * @return com.alibaba.fastjson.JSONArray
      */
     @RequestMapping(value = "/getMaterialCategoryTree")
     @ApiOperation(value = "获取商品类别树数据")
     public JSONArray getMaterialCategoryTree(@RequestParam("id") Long id) throws Exception{
-       JSONArray arr=new JSONArray();
        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.JSONObject;
-import com.jsh.erp.base.AjaxResult;
 import com.jsh.erp.base.BaseController;
 import com.jsh.erp.base.TableDataInfo;
 import com.jsh.erp.datasource.dto.MaterialDto;
@@ -52,9 +51,6 @@ public class MaterialController extends BaseController {
     private DepotService depotService;
 
     @Resource
-    private RoleService roleService;
-
-    @Resource
     private UserService userService;
 
     @Resource
@@ -79,8 +75,7 @@ public class MaterialController extends BaseController {
 
     @GetMapping(value = "/list")
     @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 materialParam = StringUtil.getInfo(search, "materialParam");
         String standard = StringUtil.getInfo(search, "standard");
@@ -97,8 +92,9 @@ public class MaterialController extends BaseController {
         String enabled = StringUtil.getInfo(search, "enabled");
         String remark = StringUtil.getInfo(search, "remark");
         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,
-                enableSerialNumber, enableBatchNumber, position, enabled, remark, categoryId, mpList);
+                enableSerialNumber, enableBatchNumber, position, enabled, remark, categoryId, mpList, reminder);
         return getDataTable(list);
     }
 
@@ -609,23 +605,26 @@ public class MaterialController extends BaseController {
                         mvo.setBillPrice(mvo.getCommodityDecimal());
                     } 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)
                             || "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) {
-                            mvo.setBillPrice(mvo.getWholesaleDecimal());
+                            mvo.setBillPrice(mvo.getDefaultWholesaleDecimal());
                         } else {
                             //查询最后一单的销售价,实现不同的客户不同的销售价
                             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)) {
-                            mvo.setBillPrice(roleService.parseBillPriceByLimit(mvo.getWholesaleDecimal(), "sale", priceLimit, request));
+                            //mvo.setBillPrice(roleService.parseBillPriceByLimit(mvo.getWholesaleDecimal(), "sale", priceLimit, request));
+                            mvo.setBillPrice(mvo.getDefaultWholesaleDecimal());
                         }
                     }
                     //仓库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.utils.BaseResponseInfo;
 import com.jsh.erp.utils.ErpInfo;
+import com.jsh.erp.utils.TreeNodeUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.slf4j.Logger;
@@ -148,16 +149,16 @@ public class OrganizationController {
     @GetMapping(value = "/getOrganizationTree")
     @ApiOperation(value = "获取机构树数据")
     public JSONArray getOrganizationTree(@RequestParam("id") Long id) throws Exception{
-       JSONArray arr=new JSONArray();
+       //JSONArray arr=new JSONArray();
        List<TreeNode> organizationTree= organizationService.getOrganizationTree(id);
-       if(organizationTree!=null&&organizationTree.size()>0){
+       /*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 TreeNodeUtils.conversion(organizationTree);
     }
 
     /**
@@ -174,13 +175,15 @@ public class OrganizationController {
         String roleType = userService.getRoleTypeByUserId(userId).getType();
         if(BusinessConstants.ROLE_TYPE_PUBLIC.equals(roleType)) {
             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;
     }

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

@@ -77,17 +77,17 @@ public class SupplierController extends BaseController {
 
     @PostMapping(value = "/add")
     @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<>();
-        int insert = supplierService.insertSupplier(obj, request);
+        int insert = supplierService.insertSupplier(supplier, request);
         return returnStr(objectMap, insert);
     }
 
     @PutMapping(value = "/update")
     @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<>();
-        int update = supplierService.updateSupplier(obj, request);
+        int update = supplierService.updateSupplier(supplier, request);
         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.TaskStocktakingVO;
 import com.jsh.erp.datasource.vo.TreeNode;
+import com.jsh.erp.exception.BusinessRunTimeException;
 import com.jsh.erp.query.LambdaQueryWrapperX;
 import com.jsh.erp.service.*;
 import com.jsh.erp.utils.StringUtil;
+import com.jsh.erp.utils.TreeNodeUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiOperation;
@@ -82,10 +84,6 @@ public class PdaController extends BaseController {
     @Resource
     private MaterialBatchService materialBatchService;
 
-    /**
-     * 采购入库
-     * @return
-     */
     @PostMapping ("/purchaseInventory")
     @ApiOperation(value = "采购入库")
     public TableDataInfo purchaseInventory(@RequestBody PDADepotHeadDTO pdaDepotHeadDTO) {
@@ -136,14 +134,14 @@ public class PdaController extends BaseController {
     }
 
     @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("商品库存详情")
-    @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();
         if ("in".equals(type)) {
             type = "入库";
@@ -185,16 +183,8 @@ public class PdaController extends BaseController {
     @ApiOperation(value = "获取商品类别树数据")
     @GetMapping(value = "/getMaterialCategoryTree")
     public JSONArray getMaterialCategoryTree(@RequestParam("id") Long id) throws Exception{
-        JSONArray arr=new JSONArray();
         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("开始任务")
@@ -270,9 +260,11 @@ public class PdaController extends BaseController {
     public AjaxResult orderSubmit(@RequestBody PDADepotHeadDTO pdaDepotHeadDTO) {
         try {
             depotHeadService.pdaOrderSubmit(pdaDepotHeadDTO);
-        } catch (Exception e) {
+        }catch (BusinessRunTimeException e) {
+            return AjaxResult.error(e.getMessage());
+        }catch (Exception e) {
             e.printStackTrace();
-            return AjaxResult.error();
+            return AjaxResult.error("入库失败");
         }
         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;
 
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
 import java.math.BigDecimal;
 
+@TableName("jsh_depot")
+@Data
 public class Depot {
     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")
     private Date submitTime;
 
+    @ApiModelProperty("复核人员")
+    private Long auditor;
+
+    @ApiModelProperty("税率")
+    private BigDecimal taxRate;
+
 
     public Long getId() {
         return id;

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

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

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

@@ -87,6 +87,18 @@ public class Material {
     @ApiModelProperty("无动销提醒周期")
     private String movingPinReminderCycle;
 
+    @ApiModelProperty("保质期天数")
+    private int expiryNum;
+
+    @ApiModelProperty("默认采购价格")
+    private BigDecimal defaultPurchaseDecimal;
+
+    @ApiModelProperty("默认销售价格")
+    private BigDecimal defaultWholesaleDecimal;
+
+    @ApiModelProperty("商品提醒")
+    private String reminder;
+
     @TableField(exist = false)
     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;
 
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -14,6 +16,7 @@ import java.util.Date;
 public class MaterialBatch {
 
     @ApiModelProperty("主键id")
+    @TableId(type = IdType.AUTO)
     private Long id;
 
     @ApiModelProperty("商品id")
@@ -87,4 +90,7 @@ public class MaterialBatch {
     @ApiModelProperty("单据id")
     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;
 
 import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.experimental.Accessors;
 
@@ -14,28 +15,42 @@ import java.util.Date;
 @TableName("jsh_material_category")
 public class MaterialCategory {
 
+    @ApiModelProperty("主键id")
     private Long id;
 
+    @ApiModelProperty("名称")
     private String name;
 
+    @ApiModelProperty("等级")
     private Short categoryLevel;
 
+    @ApiModelProperty("上级id")
     private Long parentId;
 
+    @ApiModelProperty("显示顺序")
     private String sort;
 
+    @ApiModelProperty("编号")
     private Long serialNo;
 
+    @ApiModelProperty("备注")
     private String remark;
 
+    @ApiModelProperty("创建时间")
     private Date createTime;
 
+    @ApiModelProperty("更新时间")
     private Date updateTime;
 
+    @ApiModelProperty("租户id")
     private Long tenantId;
 
+    @ApiModelProperty("删除标记,0未删除,1删除")
     private String deleteFlag;
 
+    @ApiModelProperty("有效期阈值")
+    private Integer expiryThreshold;
+
     public Long getId() {
         return id;
     }

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

@@ -74,9 +74,6 @@ public class MaterialVo4Unit extends Material{
     @ApiModelProperty("生产日期")
     private String productionDate;
 
-    @ApiModelProperty("保质期天数")
-    private Integer expiryNum;
-
     @ApiModelProperty("供应商id")
     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;
 
 import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.math.BigDecimal;
@@ -109,6 +110,14 @@ public class Supplier {
     /** 合同附件存储路径 */
     private String contractUpload;
 
+    @ApiModelProperty("供应商编码")
+    private String serialNo;
+
+    @ApiModelProperty("是否支持售后")
+    private String isAfterSales;
+
+    @ApiModelProperty("售后规则")
+    private String afterSalesRules;
 
     public Long getId() {
         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("remark") String remark,
             @Param("idList") List<Long> idList,
-            @Param("mpList") String mpList);
+            @Param("mpList") String mpList,
+            @Param("reminder") String reminder);
 
     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 {
 
-    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;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.Date;
 import java.util.List;
 
 @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")
     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;
 
 import com.jsh.erp.datasource.entities.DepotHead;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 
 import java.math.BigDecimal;
 import java.util.Date;
 
+@Data
 public class DepotHeadVo4List extends DepotHead{
 
     private String projectName;
@@ -57,6 +60,9 @@ public class DepotHeadVo4List extends DepotHead{
      */
     private BigDecimal realNeedDebt;
 
+    @ApiModelProperty("复核人名称")
+    private String auditorName;
+
     public String getProjectName() {
         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
      * @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;
 
-import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.jsh.erp.datasource.entities.MaterialCategory;
 import com.jsh.erp.datasource.vo.TreeNode;
@@ -11,13 +11,21 @@ import java.util.List;
 
 public interface MaterialCategoryService extends IService<MaterialCategory> {
 
-
+    /**
+     * 根据id查询商品类别
+     */
     MaterialCategory getMaterialCategory(long id)throws Exception;
 
+    /**
+     * 根据id集合查询商品类别
+     */
     List<MaterialCategory> getMaterialCategoryListByIds(String ids)throws Exception;
 
     List<MaterialCategory> getMaterialCategory()throws Exception;
 
+    /**
+     * 根据父类型ID查询全部子类型集合
+     */
     List<MaterialCategory> getAllList(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)
-    int insertMaterialCategory(JSONObject obj, HttpServletRequest request)throws Exception;
+    int insertMaterialCategory(MaterialCategory materialCategory, HttpServletRequest request)throws Exception;
 
     /**
      * 修改商品类别
      * @param obj 商品类别数据
      */
     @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)
     int deleteMaterialCategory(Long id, HttpServletRequest request)throws Exception;
@@ -47,10 +55,21 @@ public interface MaterialCategoryService extends IService<MaterialCategory> {
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     int batchDeleteMaterialCategoryByIds(String ids) throws Exception;
 
+    /**
+     * 检查类别名称是否存在
+     */
     int checkIsNameExist(Long id, String name)throws Exception;
 
+
+    /**
+     * 根据类别id来查询类别信息
+     * @param id 类别id
+     */
     List<MaterialCategory> findById(Long id)throws Exception;
 
+    /**
+     * 获取商品类别树数据
+     */
     List<TreeNode> getMaterialCategoryTree(Long id) throws Exception;
 
     void  checkMaterialCategorySerialNo(MaterialCategory mc)throws Exception;
@@ -60,4 +79,5 @@ public interface MaterialCategoryService extends IService<MaterialCategory> {
      * @param 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,
                                  String materialOther, String weight, String expiryNum, String enableSerialNumber,
                                  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 getMaterialOtherByParam(String[] mpArr, MaterialVo4Unit m);
 
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
@@ -180,6 +182,9 @@ public interface MaterialService extends IService<Material> {
 
     MaterialExtend getMaterialExtendBySerialNumber(String serialNumber);
 
+    /**
+     * 根据商品id查询主表及子表信息
+     */
     Material getMaterialById(Long id);
 
     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;
 
-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 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)
-    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)
-    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;
 
+    /**
+     * 新增供应商
+     */
     @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)
-    int updateSupplier(JSONObject obj, HttpServletRequest request)throws Exception;
+    int updateSupplier(Supplier supplier, HttpServletRequest request)throws Exception;
 
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     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.QueryWrapperX;
 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.write.WritableWorkbook;
 import org.slf4j.Logger;
@@ -92,6 +89,8 @@ public class DepotHeadServiceImpl extends ServiceImpl<DepotHeadMapper, DepotHead
     private SyncTescoSystemService syncTescoSystemService;
     @Resource
     private MaterialBatchService materialBatchService;
+    @Resource
+    private MaterialCategoryService materialCategoryService;
 
     /**
      * PDA查询订单
@@ -2013,6 +2012,27 @@ public class DepotHeadServiceImpl extends ServiceImpl<DepotHeadMapper, DepotHead
             MaterialExtend materialExtend = materialExtendService.getMaterialExtend(depotItem.getMaterialExtendId());
             //获取商品条码
             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()));
             //设置单据主表id
@@ -2022,6 +2042,8 @@ public class DepotHeadServiceImpl extends ServiceImpl<DepotHeadMapper, DepotHead
             depotItem.setId(null);
             //设置实际入库数量
             depotItem.setOperNumber(materialMap.get(barCode).getMaterialNumber());
+            depotItem.setProductionDate(materialMap.get(barCode).getProductionDate());
+            depotItem.setPosition(materialMap.get(barCode).getPosition());
             //以下进行单位换算
             Unit unitInfo = materialService.findUnit(depotItem.getMaterialId()); //查询多单位信息
             if (StringUtil.isExist(depotItem.getOperNumber())) {
@@ -2096,7 +2118,7 @@ public class DepotHeadServiceImpl extends ServiceImpl<DepotHeadMapper, DepotHead
             if (depotHead.getTotalPrice().compareTo(BigDecimal.ZERO) < 0){
                 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
      */
     @Override
-    public PDADepotItemVO pdaDetail(Long id) throws Exception {
+    public PDADepotItemVO pdaDetail(Long id, Long depotId) throws Exception {
         PDADepotItemVO itemVO = depotItemMapper.pdaDetail(id);
         Unit unitInfo = materialService.findUnit(itemVO.getMaterialId()); //查询多单位信息
         BigDecimal stock;
         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 {
-            stock = materialService.getMaterialStockByMid(itemVO.getMaterialId());
+            stock = materialService.getCurrentStockByMaterialIdAndDepotId(itemVO.getMaterialId(),depotId);
         }
         itemVO.setInventory(stock.toString());
         return itemVO;
@@ -781,7 +781,7 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
                 if (StringUtil.isExist(rowObj.get("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"))) {
@@ -792,7 +792,7 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
                 if (StringUtil.isExist(rowObj.get("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"))) {
                     depotItem.setMaterialType(rowObj.getString("mType"));
@@ -835,8 +835,8 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
                                 //跳过
                             } 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);
                 //更新当前成本价
-                updateCurrentUnitPrice(depotItem);
+                //updateCurrentUnitPrice(depotItem);
                 //更新商品的价格
                 updateMaterialExtendPrice(materialExtend.getId(), depotHead.getSubType(), depotHead.getBillType(), rowObj);
             }
@@ -1387,9 +1387,11 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
         if(mId!=null && dId!=null) {
             //-先清除再插入,防止商品仓库变更,数据对不上
             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.setMaterialId(mId);
             materialCurrentStock.setDepotId(dId);
+            materialCurrentStock.setCurrentUnitPrice(material.getDefaultPurchaseDecimal());
             //设置当前库存数量
             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.jsh.erp.datasource.entities.*;
 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.exception.JshException;
 import com.jsh.erp.query.LambdaQueryWrapperX;
+import com.jsh.erp.query.QueryWrapperX;
 import com.jsh.erp.service.*;
 import com.jsh.erp.utils.DateUtils;
 import com.jsh.erp.utils.RandomHelper;
@@ -18,7 +19,6 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
@@ -43,12 +43,14 @@ public class MaterialBatchServiceImpl extends ServiceImpl<MaterialBatchMapper,Ma
     private InventoryLogService inventoryLogService;
 
     @Resource
-    private MaterialService materialService;
+    private MaterialInitialStockMapper materialInitialStockMapper;
 
 
+    /**
+     * 根据单据子表id生成商品批次数据
+     */
     @Override
     public void generateMaterialBatchByDepotItemId(DepotItem depotItem, Long supplierId) throws Exception {
-        //获取单据子表信息
         //获取条码信息
         MaterialExtend materialExtend = materialExtendService.getMaterialExtend(depotItem.getMaterialExtendId());
         //创建批次信息
@@ -61,6 +63,10 @@ public class MaterialBatchServiceImpl extends ServiceImpl<MaterialBatchMapper,Ma
         materialBatch.setSupplierId(supplierId);
         //设置商品单位
         materialBatch.setCommodityUnit(depotItem.getMaterialUnit());
+        //设置采购价
+        materialBatch.setPurchaseDecimal(depotItem.getUnitPrice());
+        //设置销售价
+        materialBatch.setWholesaleDecimal(depotItem.getWholesaleDecimal());
         User user = userService.getCurrentUser();
         //创建人编码
         materialBatch.setCreateSerial(user.getLoginName());
@@ -81,28 +87,47 @@ public class MaterialBatchServiceImpl extends ServiceImpl<MaterialBatchMapper,Ma
         materialBatch.setPosition(depotItem.getPosition());
         //条码
         materialBatch.setBarCode(materialExtend.getBarCode());
+        materialBatch.setMaterialExtendId(materialExtend.getId());
         materialBatchMapper.insert(materialBatch);
     }
 
     @Override
     public void handleMaterialBatchByDepotItemId(Long diId) throws Exception {
         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查询商品批次数据
         List<MaterialBatch> list = materialBatchMapper.getMaterialBatchByMaterialId(depotItem.getMaterialId(),depotItem.getDepotId());
         //根据单据子表基础单位数量减去批次库存
         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){
             //获取修改前库存
             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 {
         List<MaterialVo4Unit> list =null;
         try{
-
             if(StringUtil.isNotEmpty(q)) {
                 q = q.replace("'", "");
                 q = q.trim();
@@ -168,8 +192,8 @@ public class MaterialBatchServiceImpl extends ServiceImpl<MaterialBatchMapper,Ma
         if (barCodes != null && !barCodes.isEmpty()){
             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;
     }
 

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

@@ -44,11 +44,14 @@ public class MaterialCategoryServiceImpl extends ServiceImpl<MaterialCategoryMap
     @Resource
     private MaterialMapperEx materialMapperEx;
 
+    /**
+     * 根据id查询商品类别
+     */
     @Override
     public MaterialCategory getMaterialCategory(long id)throws Exception {
-        MaterialCategory result=null;
+        MaterialCategory result = null;
         try{
-            result=materialCategoryMapper.selectByPrimaryKey(id);
+            result = materialCategoryMapper.selectByPrimaryKey(id);
         }catch(Exception e){
             JshException.readFail(logger, e);
         }
@@ -126,11 +129,13 @@ public class MaterialCategoryServiceImpl extends ServiceImpl<MaterialCategoryMap
 
     @Override
     @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.setUpdateTime(new Date());
         User user = userService.getCurrentUser();
+        //租户id
         materialCategory.setTenantId(user.getId());
         int result = 0;
         try{
@@ -145,8 +150,8 @@ public class MaterialCategoryServiceImpl extends ServiceImpl<MaterialCategoryMap
 
     @Override
     @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());
         int result=0;
         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);
             }
         }
-
         //修改拓展行
         if (!updatedList.isEmpty()) {
             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.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jsh.erp.constants.BusinessConstants;
 import com.jsh.erp.constants.ExceptionConstants;
@@ -41,6 +42,7 @@ import java.io.File;
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.stream.Collectors;
 
 @Service
 public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> implements MaterialService {
@@ -134,12 +136,14 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
 
 
 
+    /**
+     * 查询商品管理-商品信息列表查询
+     */
     @Override
     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 enableBatchNumber, String position, String enabled, String remark, String categoryId,
-                                        String mpList)
-            throws Exception{
+                                        String mpList,String reminder) {
         String[] mpArr = new String[]{};
         if(StringUtil.isNotEmpty(mpList)){
             mpArr= mpList.split(",");
@@ -147,12 +151,13 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
         List<MaterialVo4Unit> list = new ArrayList<>();
         try{
             List<Long> idList = new ArrayList<>();
+            //类型不为空,获取类型id集合
             if(StringUtil.isNotEmpty(categoryId)){
                 idList = getListByParentId(Long.parseLong(categoryId));
             }
             PageUtils.startPage();
             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) {
                 Map<Long,BigDecimal> initialStockMap = getInitialStockMapByMaterialList(list);
                 Map<Long,BigDecimal> currentStockMap = getCurrentStockMapByMaterialList(list);
@@ -179,9 +184,9 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
      */
     @Override
     @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);
         //获取类型编码
@@ -189,39 +194,27 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
         String sku = serial_no + DateUtils.dateTimeNow()  + RandomHelper.getRandomStr(6);
         //设置系统sku
         m.setSystemSku(sku);
-        User user = userService.getCurrentUser();
         try{
             //添加商品
             materialMapperEx.insertSelectiveEx(m);
             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++) {
                     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();
                         jsonObj.setDepotId(depotId);
                         jsonObj.setMaterialId(mId);
                         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();
                 for (int i = 0; i < stockArr.size(); 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 highSafeStock = null;
                         if(jsonObj.getHighSafeStock() != null) {
@@ -272,12 +265,12 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                         MaterialInitialStockExample example = new MaterialInitialStockExample();
                         example.createCriteria().andMaterialIdEqualTo(material.getId()).andDepotIdEqualTo(depotId);
                         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);
                             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
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     public int batchDeleteMaterialByIds(String ids) throws Exception{
-        String [] idArray=ids.split(",");
+        String [] idArray = ids.split(",");
         //校验单据子表	jsh_depot_item
         List<DepotItem> depotItemList =null;
         try{
@@ -436,7 +429,7 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
      */
     @Override
     public List<Long> getListByParentId(Long parentId) {
-        List<Long> idList = new ArrayList<Long>();
+        List<Long> idList = new ArrayList<>();
         List<MaterialCategory> list = materialCategoryMapperEx.getListByParentId(parentId);
         idList.add(parentId);
         if(list!=null && list.size()>0) {
@@ -570,7 +563,7 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
             otherMaterialMap.putIfAbsent(me.getMaterialId(), me);
         }
         String nameStr = "名称*,规格,型号,颜色,品牌,类别,基础重量(kg),基本单位*,副单位,比例,多属性," +
-                "状态*,序列号,系统sku,商品条码,自定义1,自定义2,自定义3,备注";
+                "状态*,序列号,系统sku,商品条码,默认采购价,默认销售价,自定义1,自定义2,自定义3,备注";
         List<String> nameList = StringUtil.strToStringList(nameStr);
         //仓库列表
         List<Depot> depotList = depotService.getAllList();
@@ -608,12 +601,14 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                 objs[12] = m.getEnableSerialNumber();
                 objs[13] = m.getSystemSku();
                 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) {
 //                    BigDecimal number = misMap.get(m.getId() + "_" + depot.getId());
 //                    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 {
         Map<Long, String> stockMap = new HashMap<>();
         for(int j = 1; j<= depotCount; j++) {
-            int col = 16 + j;
+            int col = 18 + j;
             if(col < src.getColumns()){
                 String depotName = ExcelUtils.getContent(src, 1, col); //获取仓库名称
                 if(StringUtil.isNotEmpty(depotName)) {
@@ -1031,6 +1026,12 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                     if(depotId!=null && depotId!=0L){
                         String stockStr = ExcelUtils.getContent(src, i, col);
                         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);
                         }
                     }
@@ -1614,14 +1615,12 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
 
     /**
      * 根据商品id查询主表及子表信息
-     * @param id 商品id
-     * @return
      */
     @Override
     public Material getMaterialById(Long 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;
     }
 
@@ -1653,11 +1652,32 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
         List<String> expirationReminders = 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()))
                         .forEach(v -> {
@@ -1668,6 +1688,11 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                                     //当前时间对比订单时间是否大于动销提醒周期
                                     String str = "商品名称:" + v.getName() + ",在[无动销提醒周期]内,无动销,请及时处理";
                                     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{
                                 //获取商品批次信息
@@ -1675,33 +1700,22 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                                 if (DateUtils.differentDaysByMillisecond(m.getCreateTime(),new Date()) > Integer.valueOf(v.getMovingPinReminderCycle())){
                                     String str = "商品名称:" + v.getName() + ",在[无动销提醒周期]内,无动销,请及时处理";
                                     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);
-        //过期提醒
-        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();
         initialStockExample.createCriteria().andDeleteFlagEqualTo("0");
-
         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)
                 .forEach(v -> {
                     //根据商品id和仓库id查询当前库存
@@ -1709,11 +1723,18 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                     if (currentNumber.doubleValue() <= v.getLowSafeStock().doubleValue()){
                         Material material = materialMapper.selectByPrimaryKey(v.getMaterialId());
                         String str = "商品名称:" + material.getName()
-                                + ",库存告警,请及时处理";
+                                +depotMap.get(v.getDepotId()) + ",库存告警,请及时处理";
                         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);
+        List<Material> materialList = new ArrayList<>(materialMap.values());
+        this.updateBatchById(materialList);
         return vo;
     }
 
@@ -1760,10 +1781,12 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                 String enabled = ExcelUtils.getContent(src, i, 10); //状态
                 String enableSerialNumber = ExcelUtils.getContent(src, i, 11); //序列号
                 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)) {
@@ -1824,6 +1847,26 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                     throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_BARCODE_LENGTH_ERROR_CODE,
                             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-和数据库里面的商品校验)
                 batchCheckExistBarCodeByParam(mList, barCode, 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();
                 //设置系统sku
                 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.setOtherField2(StringUtil.isNotEmpty(otherField2)?otherField2: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());
                     //新增或更新初始库存
                     if(StringUtil.isNotEmpty(position)) {
+                        String [] depots = position.split(",");
                         MaterialInitialStock materialInitialStock = new MaterialInitialStock();
+                        materialInitialStock.setNumber(new BigDecimal(depots[0]));
                         materialInitialStock.setDepotId(depotId);
                         materialInitialStock.setMaterialId(material.getId());
-                        materialInitialStock.setPosition(position);
+                        materialInitialStock.setPosition(depots.length > 1 ? depots[1] : "");
                         materialInitialStockMapper.insertSelective(materialInitialStock);
+                        depotItemService.updateCurrentStockFun(material.getId(),depotId);
                     }
                 }
                 //添加商品子信息
@@ -2064,41 +2114,41 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                     + "-" + m.getUnit();
             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<>();
                 material.setList(list);
                 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
     private UserBusinessMapper userBusinessMapper;
 
+    @Resource
+    private SequenceService sequenceService;
+
     @Override
     public Supplier getSupplier(long id)throws Exception {
         Supplier result=null;
@@ -153,11 +156,12 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> i
 
     @Override
     @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;
         try{
             supplier.setEnabled(true);
+            //设置供应商编号
+            supplier.setSerialNo("S" + sequenceService.buildSupplierNumber());
             User userInfo=userService.getCurrentUser();
             supplier.setCreator(userInfo==null?null:userInfo.getId());
             result=supplierMapper.insertSelective(supplier);
@@ -173,8 +177,7 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> i
 
     @Override
     @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) {
             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">
         receiver_address,
       </if>
+      <if test="depotId != null">
+        depot_id,
+      </if>
       <if test="operId != null">
-        oper_id
+        oper_id,
+      </if>
+      <if test="taxRate != null">
+        tax_rate,
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -401,8 +407,14 @@
       <if test="receiverAddress != null">
         #{receiverAddress,jdbcType=VARCHAR},
       </if>
+      <if test="depotId != null">
+        #{depotId},
+      </if>
       <if test="operId != null">
-        #{operId,jdbcType=INTEGER}
+        #{operId,jdbcType=INTEGER},
+      </if>
+      <if test="taxRate != null">
+        #{taxRate},
       </if>
     </trim>
   </insert>
@@ -703,7 +715,10 @@
         depot_id = #{depotId,jdbcType=BIGINT},
       </if>
       <if test="operId != null">
-        oper_id = #{operId,jdbcType=BIGINT}
+        oper_id = #{operId,jdbcType=BIGINT},
+      </if>
+      <if test="taxRate != null">
+        tax_rate = #{taxRate}
       </if>
     </set>
     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, 
     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, 
-    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>
   <select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="BaseResultMap">
     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.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,
-        us.username warehousingUserName
+        us.username warehousingUserName,m.default_purchase_decimal,m.default_wholesale_decimal
         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_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 id="Base_Column_List">
     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>
   <select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.MaterialCategoryExample" resultMap="BaseResultMap">
     select
@@ -151,6 +151,9 @@
       <if test="deleteFlag != null">
         delete_flag,
       </if>
+      <if test="expiryThreshold != null">
+        expiry_threshold,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       (select ifnull(MAX(id),0) + 10001 from jsh_material_category AS mc),
@@ -185,6 +188,9 @@
       <if test="deleteFlag != null">
         #{deleteFlag,jdbcType=VARCHAR},
       </if>
+      <if test="expiryThreshold != null">
+        #{expiryThreshold},
+      </if>
     </trim>
   </insert>
 

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

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

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

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

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

@@ -91,7 +91,8 @@
   <sql id="Base_Column_List">
     id, category_id, name, model, standard, brand, mnemonic, color, unit, remark,
     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>
 
   <select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="BaseResultMap">
@@ -459,6 +460,15 @@
       <if test="movingPinReminderCycle != null">
         moving_pin_reminder_cycle = #{movingPinReminderCycle,jdbcType=VARCHAR},
       </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>
     where id = #{id,jdbcType=BIGINT}
   </update>
@@ -502,7 +512,7 @@
     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_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>
       m.enabled = 1 and me.id is not null
       <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" />
     </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,
         jme.purchase_decimal, jme.commodity_decimal, jme.wholesale_decimal, jme.low_decimal, jme.sku
         from (select m.id, min(me.id) meId
@@ -103,6 +103,10 @@
             <bind name="bindRemark" value="'%'+remark+'%'"/>
             and m.remark like #{bindRemark}
         </if>
+        <if test="reminder != null and reminder !=''">
+            <bind name="bindReminder" value="'%'+reminder+'%'"/>
+            and m.reminder like #{bindReminder}
+        </if>
         <if test="idList.size()>0">
             and m.category_id in
             <foreach collection="idList" item="item" index="index" separator="," open="(" close=")">
@@ -191,6 +195,15 @@
             <if test="movingPinReminderCycle != null">
                 moving_pin_reminder_cycle,
             </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 prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">
@@ -262,6 +275,15 @@
             <if test="movingPinReminderCycle != null">
                 #{movingPinReminderCycle,jdbcType=VARCHAR},
             </if>
+            <if test="expiryNum != null">
+                #{expiryNum},
+            </if>
+            <if test="defaultPurchaseDecimal != null">
+                #{defaultPurchaseDecimal},
+            </if>
+            <if test="defaultWholesaleDecimal != null">
+                #{defaultWholesaleDecimal},
+            </if>
         </trim>
     </insert>
 
@@ -392,7 +414,7 @@
         and ifnull(m.delete_flag,'0') !='1'
     </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,
         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
@@ -552,8 +574,8 @@
     </select>
 
     <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
         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'

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

@@ -3,11 +3,11 @@
 <mapper namespace="com.jsh.erp.datasource.mappers.SequenceMapperEx">
 
     <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>
 
     <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>
 
 </mapper>

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

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

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

@@ -29,7 +29,7 @@
             AND tsi.task_stocktaking_id = #{taskId}
             <if test="number != null and 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 m.system_sku LIKE CONCAT('%',#{number},'%'))
             </if>