gaoluyang
7 天以前 b176162c23294d8d1bfb9f09cf6bb759efb0124a
银川
1.库存现有量添加自定义出库入库功能
2.整理重复文件
已添加2个文件
已重命名1个文件
已修改10个文件
已删除160个文件
32519 ■■■■■ 文件已修改
src/api/mdm/item/index.ts 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/mes/wm/materialstock/index.ts 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/arrivalnotice/components/index.ts 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/arrivalnotice/components/line-select-dialog.vue 203 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/arrivalnotice/components/line-select.vue 153 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/arrivalnotice/components/select-dialog.vue 288 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/arrivalnotice/components/select.vue 141 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/arrivalnotice/data.ts 352 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/arrivalnotice/index.vue 179 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/arrivalnotice/modules/form.vue 171 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/arrivalnotice/modules/line-form.vue 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/arrivalnotice/modules/line-list.vue 140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/barcode/components/barcode.vue 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/barcode/components/detail.vue 169 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/barcode/components/index.ts 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/barcode/components/printer-label.vue 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/barcode/config/data.ts 114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/barcode/config/index.vue 150 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/barcode/config/modules/form.vue 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/barcode/data.ts 735 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/barcode/index.vue 234 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/barcode/modules/form.vue 111 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/mdm/data.ts 222 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/mdm/index.vue 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/mdm/modules/form.vue 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/batch/components/detail.vue 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/batch/components/index.ts 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/batch/components/select-dialog.vue 255 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/batch/components/select.vue 149 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/batch/data.ts 372 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/erp/purchase/supplier/components/index.ts 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/erp/purchase/supplier/components/select-dialog.vue 122 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/erp/purchase/supplier/components/select.vue 114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/itemreceipt/data.ts 527 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/itemreceipt/index.vue 201 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/itemreceipt/modules/detail-form.vue 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/itemreceipt/modules/detail-list.vue 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/itemreceipt/modules/form.vue 242 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/itemreceipt/modules/line-form.vue 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/itemreceipt/modules/line-list.vue 241 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/materialstock/components/index.ts 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/materialstock/components/select-dialog.vue 268 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/materialstock/components/select.vue 158 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/materialstock/data.ts 306 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/materialstock/index.vue 175 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/miscissue/data.ts 452 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/miscissue/index.vue 187 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/miscissue/modules/form.vue 199 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/miscissue/modules/line-form.vue 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/miscissue/modules/line-list.vue 140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/miscreceipt/data.ts 422 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/miscreceipt/index.vue 187 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/miscreceipt/modules/form.vue 200 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/miscreceipt/modules/line-form.vue 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/miscreceipt/modules/line-list.vue 140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/outsourceissue/data.ts 487 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/outsourceissue/index.vue 201 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/outsourceissue/modules/detail-form.vue 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/outsourceissue/modules/detail-list.vue 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/outsourceissue/modules/form.vue 236 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/outsourceissue/modules/line-form.vue 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/outsourceissue/modules/line-list.vue 227 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/outsourcereceipt/data.ts 540 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/outsourcereceipt/index.vue 201 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/outsourcereceipt/modules/detail-form.vue 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/outsourcereceipt/modules/detail-list.vue 127 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/outsourcereceipt/modules/form.vue 227 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/outsourcereceipt/modules/line-form.vue 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/outsourcereceipt/modules/line-list.vue 236 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/packages/components/index.ts 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/packages/components/select-dialog.vue 231 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/packages/components/select.vue 143 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/packages/data.ts 641 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/packages/index.vue 160 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/packages/modules/form.vue 193 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/packages/modules/line-form.vue 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/packages/modules/package-line-list.vue 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/packages/modules/sub-package-list.vue 126 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productissue/data.ts 475 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productissue/index.vue 219 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productissue/modules/detail-form.vue 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productissue/modules/detail-list.vue 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productissue/modules/form.vue 232 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productissue/modules/line-form.vue 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productissue/modules/line-list.vue 223 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productreceipt/data.ts 452 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productreceipt/index.vue 201 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productreceipt/modules/detail-form.vue 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productreceipt/modules/detail-list.vue 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productreceipt/modules/form.vue 243 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productreceipt/modules/line-form.vue 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productreceipt/modules/line-list.vue 254 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productsales/data.ts 701 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productsales/index.vue 215 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productsales/modules/detail-form.vue 110 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productsales/modules/detail-list.vue 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productsales/modules/form.vue 270 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productsales/modules/line-form.vue 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productsales/modules/line-list.vue 236 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/returnissue/data.ts 567 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/returnissue/index.vue 213 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/returnissue/modules/detail-form.vue 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/returnissue/modules/detail-list.vue 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/returnissue/modules/form.vue 222 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/returnissue/modules/line-form.vue 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/returnissue/modules/line-list.vue 250 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/returnsales/data.ts 515 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/returnsales/index.vue 213 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/returnsales/modules/detail-form.vue 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/returnsales/modules/detail-list.vue 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/returnsales/modules/form.vue 231 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/returnsales/modules/line-form.vue 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/returnsales/modules/line-list.vue 247 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/returnvendor/data.ts 530 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/returnvendor/index.vue 201 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/returnvendor/modules/detail-form.vue 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/returnvendor/modules/detail-list.vue 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/returnvendor/modules/form.vue 236 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/returnvendor/modules/line-form.vue 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/returnvendor/modules/line-list.vue 237 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesnotice/components/index.ts 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesnotice/components/line-select-dialog.vue 198 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesnotice/components/line-select.vue 153 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesnotice/components/select-dialog.vue 320 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesnotice/components/select.vue 141 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesnotice/data.ts 362 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesnotice/index.vue 168 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesnotice/modules/form.vue 182 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesnotice/modules/line-form.vue 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesnotice/modules/line-list.vue 140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/sn/data.ts 183 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/sn/index.vue 177 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/sn/modules/detail.vue 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/sn/modules/form.vue 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/stocktaking/plan/components/condition-value-input.vue 204 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/stocktaking/plan/components/index.ts 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/stocktaking/plan/components/select.vue 135 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/stocktaking/plan/data.ts 472 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/stocktaking/plan/index.vue 176 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/stocktaking/plan/modules/form.vue 126 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/stocktaking/plan/modules/param-form.vue 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/stocktaking/plan/modules/param-list.vue 131 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/stocktaking/task/data.ts 600 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/stocktaking/task/index.vue 201 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/stocktaking/task/modules/form.vue 226 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/stocktaking/task/modules/line-list.vue 151 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/stocktaking/task/modules/result-form.vue 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/stocktaking/task/modules/result-list.vue 136 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/transfer/data.ts 647 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/transfer/index.vue 214 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/transfer/modules/detail-form.vue 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/transfer/modules/detail-list.vue 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/transfer/modules/form.vue 258 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/transfer/modules/line-form.vue 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/transfer/modules/line-list.vue 228 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouse/area/data.ts 338 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouse/area/index.vue 211 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouse/area/modules/form.vue 149 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouse/components/area-select.vue 114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouse/components/index.ts 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouse/components/location-select.vue 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouse/components/select.vue 110 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouse/data.ts 221 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouse/index.vue 175 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouse/location/data.ts 193 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouse/location/index.vue 218 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouse/location/modules/form.vue 184 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouse/modules/form.vue 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/wls/batch/components/detail.vue 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/wls/itemreceipt/data.ts 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/wls/materialstock/components/batch-config-display.vue 89 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/wls/materialstock/components/stock-adjust-modal.vue 205 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vite.config.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/mdm/item/index.ts
@@ -37,6 +37,16 @@
    warehouseName?: string;
    remark?: string;
    createTime?: string;
    // åŒæ­¥ç›¸å…³å­—段
    syncMes?: boolean;
    // æ‰¹æ¬¡å±žæ€§é…ç½®å­—段
    produceDateFlag?: boolean;
    expireDateFlag?: boolean;
    receiptDateFlag?: boolean;
    vendorFlag?: boolean;
    purchaseOrderCodeFlag?: boolean;
    lotNumberFlag?: boolean;
    qualityStatusFlag?: boolean;
  }
  /** ç‰©æ–™åˆ†é¡µæŸ¥è¯¢å‚æ•° */
src/api/mes/wm/materialstock/index.ts
@@ -74,7 +74,11 @@
  batchCode?: string; // æ‰¹æ¬¡å·ï¼ˆæ–°å»ºæ‰¹æ¬¡æ—¶ä¼ å…¥ï¼‰
  produceDate?: string; // ç”Ÿäº§æ—¥æœŸï¼ˆæ–°å»ºæ‰¹æ¬¡æ—¶ä¼ å…¥ï¼‰
  expireDate?: string; // æœ‰æ•ˆæœŸï¼ˆæ–°å»ºæ‰¹æ¬¡æ—¶ä¼ å…¥ï¼‰
  receiptDate?: string; // å…¥åº“日期
  vendorId?: number; // ä¾›åº”商ID
  purchaseOrderCode?: string; // é‡‡è´­è®¢å•号
  lotNumber?: string; // ç”Ÿäº§æ‰¹å·
  qualityStatus?: string; // è´¨é‡çŠ¶æ€
  quantity: number; // å…¥åº“数量(必须大于0)
  reason?: string; // å…¥åº“原因
}
src/views/arrivalnotice/components/index.ts
ÎļþÒÑɾ³ý
src/views/arrivalnotice/components/line-select-dialog.vue
ÎļþÒÑɾ³ý
src/views/arrivalnotice/components/line-select.vue
ÎļþÒÑɾ³ý
src/views/arrivalnotice/components/select-dialog.vue
ÎļþÒÑɾ³ý
src/views/arrivalnotice/components/select.vue
ÎļþÒÑɾ³ý
src/views/arrivalnotice/data.ts
ÎļþÒÑɾ³ý
src/views/arrivalnotice/index.vue
ÎļþÒÑɾ³ý
src/views/arrivalnotice/modules/form.vue
ÎļþÒÑɾ³ý
src/views/arrivalnotice/modules/line-form.vue
ÎļþÒÑɾ³ý
src/views/arrivalnotice/modules/line-list.vue
ÎļþÒÑɾ³ý
src/views/barcode/components/barcode.vue
ÎļþÒÑɾ³ý
src/views/barcode/components/detail.vue
ÎļþÒÑɾ³ý
src/views/barcode/components/index.ts
ÎļþÒÑɾ³ý
src/views/barcode/components/printer-label.vue
ÎļþÒÑɾ³ý
src/views/barcode/config/data.ts
ÎļþÒÑɾ³ý
src/views/barcode/config/index.vue
ÎļþÒÑɾ³ý
src/views/barcode/config/modules/form.vue
ÎļþÒÑɾ³ý
src/views/barcode/data.ts
ÎļþÒÑɾ³ý
src/views/barcode/index.vue
ÎļþÒÑɾ³ý
src/views/barcode/modules/form.vue
ÎļþÒÑɾ³ý
src/views/basicData/mdm/data.ts
@@ -5,31 +5,29 @@
import { getDictOptions } from "#/packages/effects/hooks/src";
import { z } from '#/adapter/form';
import { getItemTypeSimpleList } from '#/api/mes/md/item/type';
import { getUnitPage } from '#/api/mdm/unit';
/** ç‰©æ–™ç±»åž‹é€‰é¡¹ */
export const ITEM_TYPE_OPTIONS = [
  { label: "原料", value: 1 },
  { label: "半成品", value: 2 },
  { label: "成品", value: 3 },
  { label: "辅料", value: 4 },
];
// ç¼“存单位列表
let unitListCache: any[] | null = null;
let unitListPromise: Promise<any[]> | null = null;
/** ç‰©æ–™ç±»åž‹æ˜ å°„ */
export const ITEM_TYPE_MAP: Record<number, string> = {
  1: "原料",
  2: "半成品",
  3: "成品",
  4: "辅料",
};
/** ç‰©æ–™ç±»åž‹é¢œè‰²æ˜ å°„ */
export const ITEM_TYPE_COLOR_MAP: Record<number, string> = {
  1: "green",
  2: "orange",
  3: "blue",
  4: "purple",
};
/** èŽ·å–å•ä½åˆ—è¡¨ï¼ˆå¸¦ç¼“å­˜ï¼‰ */
async function getUnitListCached() {
  if (unitListCache) {
    return unitListCache;
  }
  if (unitListPromise) {
    return unitListPromise;
  }
  unitListPromise = getUnitPage({ pageNo: 1, pageSize: 100, status: 0 }).then((res) => {
    unitListCache = res.list || [];
    return unitListCache;
  }).finally(() => {
    unitListPromise = null;
  });
  return unitListPromise;
}
/** æ–°å¢ž/修改的表单 */
export function useFormSchema(): VbenFormSchema[] {
@@ -61,15 +59,20 @@
      rules: "required",
    },
    {
      component: "RadioGroup",
      fieldName: "itemType",
      label: "物料类型",
      component: "ApiSelect",
      fieldName: "categoryId",
      label: "物料分类",
      rules: "selectRequired",
      componentProps: {
        options: ITEM_TYPE_OPTIONS,
        buttonStyle: "solid",
        optionType: "button",
        placeholder: "请选择物料分类",
        allowClear: true,
        api: async () => {
          const res = await getItemTypeSimpleList();
          return res || [];
      },
      rules: "required",
        labelField: "name",
        valueField: "id",
      },
    },
    {
      component: "Input",
@@ -88,10 +91,7 @@
      componentProps: {
        placeholder: "请选择计量单位",
        allowClear: true,
        api: async () => {
          const res = await getUnitPage({ pageNo: 1, pageSize: 100, status: 0 });
          return res.list || [];
        },
        api: getUnitListCached,
        labelField: "name",
        valueField: "id",
      },
@@ -104,10 +104,7 @@
      componentProps: {
        placeholder: "请选择辅单位1",
        allowClear: true,
        api: async () => {
          const res = await getUnitPage({ pageNo: 1, pageSize: 100, status: 0 });
          return res.list || [];
        },
        api: getUnitListCached,
        labelField: "name",
        valueField: "id",
      },
@@ -132,10 +129,7 @@
      componentProps: {
        placeholder: "请选择辅单位2",
        allowClear: true,
        api: async () => {
          const res = await getUnitPage({ pageNo: 1, pageSize: 100, status: 0 });
          return res.list || [];
        },
        api: getUnitListCached,
        labelField: "name",
        valueField: "id",
      },
@@ -238,13 +232,13 @@
      component: 'Switch',
      fieldName: 'isBatchManaged',
      label: '批次管理',
      defaultValue: true,
      defaultValue: false,
      componentProps: {
        class: "w-auto",
        checkedChildren: "是",
        unCheckedChildren: "否",
      },
      rules: z.boolean().default(true),
      rules: z.boolean().default(false),
    },
    {
      component: "Switch",
@@ -288,6 +282,126 @@
        rows: 3,
      },
    },
    // ===== æ‰¹æ¬¡å±žæ€§é…ç½®ï¼ˆisBatchManaged = true æ—¶æ˜¾ç¤ºï¼‰ =====
    {
      component: "Divider",
      fieldName: "batchConfigDivider",
      label: "批次属性配置",
      formItemClass: "col-span-2",
      componentProps: {
        orientation: "left",
        plain: true,
      },
      dependencies: {
        triggerFields: ["isBatchManaged"],
        show: (values) => values.isBatchManaged === true,
      },
    },
    {
      component: "Switch",
      fieldName: "produceDateFlag",
      label: "生产日期必填",
      defaultValue: false,
      componentProps: {
        class: "w-auto",
        checkedChildren: "是",
        unCheckedChildren: "否",
      },
      dependencies: {
        triggerFields: ["isBatchManaged"],
        show: (values) => values.isBatchManaged === true,
      },
    },
    {
      component: "Switch",
      fieldName: "expireDateFlag",
      label: "有效期必填",
      defaultValue: false,
      componentProps: {
        class: "w-auto",
        checkedChildren: "是",
        unCheckedChildren: "否",
      },
      dependencies: {
        triggerFields: ["isBatchManaged"],
        show: (values) => values.isBatchManaged === true,
      },
    },
    {
      component: "Switch",
      fieldName: "receiptDateFlag",
      label: "入库日期必填",
      defaultValue: false,
      componentProps: {
        class: "w-auto",
        checkedChildren: "是",
        unCheckedChildren: "否",
      },
      dependencies: {
        triggerFields: ["isBatchManaged"],
        show: (values) => values.isBatchManaged === true,
      },
    },
    {
      component: "Switch",
      fieldName: "vendorFlag",
      label: "供应商必填",
      defaultValue: false,
      componentProps: {
        class: "w-auto",
        checkedChildren: "是",
        unCheckedChildren: "否",
      },
      dependencies: {
        triggerFields: ["isBatchManaged"],
        show: (values) => values.isBatchManaged === true,
      },
    },
    {
      component: "Switch",
      fieldName: "purchaseOrderCodeFlag",
      label: "采购订单号必填",
      defaultValue: false,
      componentProps: {
        class: "w-auto",
        checkedChildren: "是",
        unCheckedChildren: "否",
      },
      dependencies: {
        triggerFields: ["isBatchManaged"],
        show: (values) => values.isBatchManaged === true,
      },
    },
    {
      component: "Switch",
      fieldName: "lotNumberFlag",
      label: "生产批号必填",
      defaultValue: false,
      componentProps: {
        class: "w-auto",
        checkedChildren: "是",
        unCheckedChildren: "否",
      },
      dependencies: {
        triggerFields: ["isBatchManaged"],
        show: (values) => values.isBatchManaged === true,
      },
    },
    {
      component: "Switch",
      fieldName: "qualityStatusFlag",
      label: "质量状态必填",
      defaultValue: false,
      componentProps: {
        class: "w-auto",
        checkedChildren: "是",
        unCheckedChildren: "否",
      },
      dependencies: {
        triggerFields: ["isBatchManaged"],
        show: (values) => values.isBatchManaged === true,
      },
    },
  ];
}
@@ -310,16 +424,6 @@
      componentProps: {
        placeholder: "请输入物料名称",
        allowClear: true,
      },
    },
    {
      fieldName: "itemType",
      label: "物料类型",
      component: "Select",
      componentProps: {
        placeholder: "请选择物料类型",
        allowClear: true,
        options: ITEM_TYPE_OPTIONS,
      },
    },
    {
@@ -355,6 +459,12 @@
      minWidth: 150,
    },
    {
      field: "categoryName",
      title: "物料分类",
      minWidth: 120,
      slots: { default: "categoryName" },
    },
    {
      field: "unitMeasureName",
      title: "单位",
      minWidth: 80,
@@ -383,12 +493,6 @@
      field: "warehouseName",
      title: "默认仓库",
      minWidth: 100,
    },
    {
      field: "itemType",
      title: "物料类型",
      minWidth: 100,
      slots: { default: "itemType" },
    },
    {
      field: "purchasePrice",
src/views/basicData/mdm/index.vue
@@ -1,6 +1,7 @@
<script lang="ts" setup>
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { MdmItemApi } from '#/api/mdm/item';
import type { MesMdItemTypeApi } from '#/api/mes/md/item/type';
import { ref } from 'vue';
@@ -17,9 +18,10 @@
  getItemPage,
  updateItemStatus,
} from '#/api/mdm/item';
import { getItemTypeSimpleList } from '#/api/mes/md/item/type';
import { $t } from '#/locales';
import { useGridColumns, useGridFormSchema, ITEM_TYPE_MAP, ITEM_TYPE_COLOR_MAP } from './data';
import { useGridColumns, useGridFormSchema } from './data';
import Form from './modules/form.vue';
defineOptions({ name: 'MdmItem' });
@@ -28,6 +30,16 @@
  connectedComponent: Form,
  destroyOnClose: true,
});
// åˆ†ç±»åˆ—表缓存
const categoryList = ref<MesMdItemTypeApi.ItemType[]>([]);
/** èŽ·å–åˆ†ç±»åç§° */
function getCategoryName(categoryId?: number) {
  if (!categoryId || !categoryList.value.length) return '';
  const category = categoryList.value.find((item) => item.id === categoryId);
  return category?.name || '';
}
/** åˆ·æ–°è¡¨æ ¼ */
function handleRefresh() {
@@ -118,6 +130,14 @@
    proxyConfig: {
      ajax: {
        query: async ({ page }, formValues) => {
          // åŠ è½½åˆ†ç±»åˆ—è¡¨ï¼ˆç”¨äºŽæ˜¾ç¤ºåˆ†ç±»åç§°ï¼‰
          if (!categoryList.value.length) {
            try {
              categoryList.value = await getItemTypeSimpleList();
            } catch {
              categoryList.value = [];
            }
          }
          return await getItemPage({
            pageNo: page.currentPage,
            pageSize: page.pageSize,
@@ -175,11 +195,13 @@
          ]"
        />
      </template>
      <template #itemType="{ row }">
        <Tag v-if="row.itemType === 1" color="green">原料</Tag>
        <Tag v-else-if="row.itemType === 2" color="orange">半成品</Tag>
        <Tag v-else-if="row.itemType === 3" color="blue">成品</Tag>
        <Tag v-else-if="row.itemType === 4" color="purple">辅料</Tag>
      <template #categoryName="{ row }">
        <Tag v-if="row.categoryId === 1" color="green">{{ getCategoryName(row.categoryId) }}</Tag>
        <Tag v-else-if="row.categoryId === 2" color="orange">{{ getCategoryName(row.categoryId) }}</Tag>
        <Tag v-else-if="row.categoryId === 3" color="blue">{{ getCategoryName(row.categoryId) }}</Tag>
        <Tag v-else-if="row.categoryId === 4" color="purple">{{ getCategoryName(row.categoryId) }}</Tag>
        <Tag v-else-if="row.categoryId === 5" color="cyan">{{ getCategoryName(row.categoryId) }}</Tag>
        <span v-else>{{ getCategoryName(row.categoryId) }}</span>
      </template>
      <template #isBatchManaged="{ row }">
        <Tag v-if="row.isBatchManaged" color="success">是</Tag>
src/views/basicData/mdm/modules/form.vue
@@ -1,9 +1,7 @@
<script lang="ts" setup>
import type { MdmItemApi } from '#/api/mdm/item';
import type { MdmItemBatchConfigApi } from '#/api/mes/md/item-batch-config';
import type { VbenFormApi } from '#/adapter/form';
import { computed, ref, watch } from 'vue';
import { ref } from 'vue';
  import { useVbenModal } from "#/packages/effects/common-ui/src";
@@ -11,27 +9,14 @@
import { useVbenForm } from '#/adapter/form';
import { createItem, getItem, updateItem } from '#/api/mdm/item';
import { saveItemBatchConfig } from '#/api/mes/md/item-batch-config';
import { $t } from '#/locales';
import { useFormSchema } from '../data';
import ItemBatchConfig from '../components/batch-config.vue';
  defineOptions({ name: "ItemForm" });
const emit = defineEmits(['success']);
const formData = ref<MdmItemApi.Item>();
const batchConfigRef = ref<InstanceType<typeof ItemBatchConfig>>();
const batchConfig = ref<Partial<MdmItemBatchConfigApi.ItemBatchConfig>>({});
// å½“前表单中的批次管理开关值(用于控制批次配置显示)
const currentIsBatchManaged = ref<boolean>(false);
const getTitle = computed(() => {
  return formData.value?.id
    ? $t('ui.actionTitle.edit', ['物料'])
    : $t('ui.actionTitle.create', ['物料']);
});
const [Form, formApi] = useVbenForm({
  commonConfig: {
@@ -44,10 +29,6 @@
  schema: useFormSchema(),
  showDefaultActions: false,
  wrapperClass: 'grid-cols-2',
  // ç›‘听表单值变化
  handleValuesChange: (values: any) => {
    currentIsBatchManaged.value = values?.isBatchManaged === true;
  },
});
const [Modal, modalApi] = useVbenModal({
@@ -59,18 +40,7 @@
    modalApi.lock();
    const data = (await formApi.getValues()) as MdmItemApi.Item;
    try {
      // ä¿å­˜ç‰©æ–™åŸºæœ¬ä¿¡æ¯
      const itemId = await (formData.value?.id ? updateItem(data) : createItem(data));
      const savedItemId = typeof itemId === 'number' ? itemId : data.id;
      // å¦‚果启用批次管理,保存批次配置
      if (data.isBatchManaged && savedItemId) {
        await saveItemBatchConfig({
          ...batchConfig.value,
          itemId: savedItemId,
        });
      }
      await (formData.value?.id ? updateItem(data) : createItem(data));
      await modalApi.close();
      emit('success');
      message.success($t('ui.actionMessage.operationSuccess'));
@@ -81,8 +51,6 @@
  async onOpenChange(isOpen: boolean) {
    if (!isOpen) {
      formData.value = undefined;
      batchConfig.value = {};
      currentIsBatchManaged.value = false;
      return;
    }
    const data = modalApi.getData<MdmItemApi.Item>();
@@ -92,11 +60,6 @@
      try {
        formData.value = await getItem(data.id);
        await formApi.setValues(formData.value);
        currentIsBatchManaged.value = formData.value?.isBatchManaged === true;
        // åŠ è½½æ‰¹æ¬¡é…ç½®
        if (batchConfigRef.value && currentIsBatchManaged.value) {
          await batchConfigRef.value.loadConfig();
        }
      } finally {
        modalApi.unlock();
      }
@@ -104,27 +67,13 @@
      // æ–°å¢žæ¨¡å¼
      formData.value = undefined;
      await formApi.resetForm();
      // èŽ·å–è¡¨å•é»˜è®¤å€¼ï¼ˆisBatchManaged é»˜è®¤ true)
      const defaultValues = await formApi.getValues();
      currentIsBatchManaged.value = defaultValues?.isBatchManaged === true;
    }
  },
});
/** å¤„理批次配置变化 */
function handleBatchConfigChange(config: Partial<MdmItemBatchConfigApi.ItemBatchConfig>) {
  batchConfig.value = config;
}
</script>
<template>
  <Modal class="w-[1000px]" :title="getTitle">
  <Modal class="w-[1000px]" :title="formData?.id ? $t('ui.actionTitle.edit', ['物料']) : $t('ui.actionTitle.create', ['物料'])">
    <Form class="mx-4" />
    <ItemBatchConfig
      ref="batchConfigRef"
      :item-id="formData?.id"
      :is-batch-managed="currentIsBatchManaged"
      @change="handleBatchConfigChange"
    />
  </Modal>
</template>
src/views/batch/components/detail.vue
ÎļþÒÑɾ³ý
src/views/batch/components/index.ts
ÎļþÒÑɾ³ý
src/views/batch/components/select-dialog.vue
ÎļþÒÑɾ³ý
src/views/batch/components/select.vue
ÎļþÒÑɾ³ý
src/views/batch/data.ts
ÎļþÒÑɾ³ý
src/views/erp/purchase/supplier/components/index.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,2 @@
export { default as ErpSupplierSelectDialog } from './select-dialog.vue';
export { default as ErpSupplierSelect } from './select.vue';
src/views/erp/purchase/supplier/components/select-dialog.vue
ÎļþÃû´Ó src/views/stocktaking/plan/components/select-dialog.vue ÐÞ¸Ä
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { MesWmStockTakingPlanApi } from '#/api/mes/wm/stocktaking/plan';
import type { ErpSupplierApi } from '#/api/erp/purchase/supplier';
import { nextTick, ref } from 'vue';
@@ -9,60 +9,53 @@
import { message, Modal } from 'ant-design-vue';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { getStockTakingPlanPage } from '#/api/mes/wm/stocktaking/plan';
import { getSupplierPage } from '#/api/erp/purchase/supplier';
import { useSelectGridColumns, useSelectGridFormSchema } from '../data';
defineOptions({ name: 'ErpSupplierSelectDialog' });
const emit = defineEmits<{
  selected: [rows: MesWmStockTakingPlanApi.StockTakingPlan[]];
  selected: [rows: ErpSupplierApi.Supplier[]];
}>();
const open = ref(false); // å¼¹çª—是否打开
const multiple = ref(true); // æ˜¯å¦å¤šé€‰
const selectedRows = ref<MesWmStockTakingPlanApi.StockTakingPlan[]>([]); // å·²é€‰ç›˜ç‚¹æ–¹æ¡ˆ
const preSelectedIds = ref<number[]>([]); // é¢„选盘点方案编号
const open = ref(false);
const multiple = ref(true);
const selectedRows = ref<ErpSupplierApi.Supplier[]>([]);
const preSelectedIds = ref<number[]>([]);
/** èŽ·å–å¤šé€‰è®°å½•ï¼ŒåŒ…å« VXE reserve è·¨é¡µè®°å½• */
function getTableRows() {
  return gridApi.grid.getTableData().fullData as ErpSupplierApi.Supplier[];
}
function getMultipleSelectedRows() {
  const selectedMap = new Map<
    number,
    MesWmStockTakingPlanApi.StockTakingPlan
  >();
  const selectedMap = new Map<number, ErpSupplierApi.Supplier>();
  const records = [
    ...(gridApi.grid.getCheckboxReserveRecords?.() ?? []),
    ...(gridApi.grid.getCheckboxRecords?.() ?? []),
  ] as MesWmStockTakingPlanApi.StockTakingPlan[];
  ] as ErpSupplierApi.Supplier[];
  records.forEach((row) => {
    if (row.id !== undefined && row.id !== null) {
      selectedMap.set(row.id, row);
    const rowId = row.id;
    if (rowId) {
      selectedMap.set(rowId, row);
    }
  });
  return [...selectedMap.values()];
}
/** å¤„理勾选变化 */
function handleCheckboxSelectChange() {
  selectedRows.value = getMultipleSelectedRows();
}
/** å¤„理单选变化 */
function handleRadioChange(row: MesWmStockTakingPlanApi.StockTakingPlan) {
function handleRadioChange(row: ErpSupplierApi.Supplier) {
  selectedRows.value = [row];
}
/** å¤šé€‰æ¨¡å¼ä¸‹åˆ‡æ¢è¡Œå‹¾é€‰ */
async function toggleMultipleRow(row: MesWmStockTakingPlanApi.StockTakingPlan) {
async function toggleMultipleRow(row: ErpSupplierApi.Supplier) {
  const selected = gridApi.grid.isCheckedByCheckboxRow(row);
  await gridApi.grid.setCheckboxRow(row, !selected);
  selectedRows.value = getMultipleSelectedRows();
}
/** å¤„理行双击:单选直接确认;多选切换勾选 */
async function handleCellDblclick({
  row,
}: {
  row: MesWmStockTakingPlanApi.StockTakingPlan;
}) {
async function handleCellDblclick({ row }: { row: ErpSupplierApi.Supplier }) {
  if (multiple.value) {
    await toggleMultipleRow(row);
    return;
@@ -72,13 +65,11 @@
  handleConfirm();
}
/** å›žæ˜¾é¢„选盘点方案 */
async function applyPreSelection() {
  if (preSelectedIds.value.length === 0) {
    return;
  }
  const rows =
    gridApi.grid.getData() as MesWmStockTakingPlanApi.StockTakingPlan[];
  const rows = getTableRows();
  for (const row of rows) {
    if (
      row.id === undefined ||
@@ -100,13 +91,56 @@
  }
}
function useSelectGridFormSchema() {
  return [
    {
      fieldName: 'name',
      label: '供应商名称',
      component: 'Input',
      componentProps: {
        placeholder: '请输入供应商名称',
        allowClear: true,
      },
    },
  ];
}
function useSelectGridColumns(multiple = false): VxeTableGridOptions<ErpSupplierApi.Supplier>['columns'] {
  return [
    {
      type: multiple ? 'checkbox' : 'radio',
      width: 50,
    },
    {
      field: 'name',
      title: '供应商名称',
      minWidth: 150,
    },
    {
      field: 'contact',
      title: '联系人',
      minWidth: 120,
    },
    {
      field: 'mobile',
      title: '手机号码',
      minWidth: 130,
    },
    {
      field: 'telephone',
      title: '联系电话',
      minWidth: 130,
    },
  ];
}
const [Grid, gridApi] = useVbenVxeGrid({
  formOptions: {
    schema: useSelectGridFormSchema(),
  },
  gridOptions: {
    columns: useSelectGridColumns(true),
    height: 480,
    height: 520,
    keepSource: true,
    checkboxConfig: {
      highlight: true,
@@ -120,11 +154,10 @@
    proxyConfig: {
      ajax: {
        query: async ({ page }, formValues) => {
          return await getStockTakingPlanPage({
          return await getSupplierPage({
            pageNo: page.currentPage,
            pageSize: page.pageSize,
            ...formValues,
            // é€‰æ‹©å™¨åªå±•示启用状态的方案
            status: CommonStatusEnum.ENABLE,
          });
        },
@@ -138,22 +171,17 @@
      refresh: true,
      search: true,
    },
  } as VxeTableGridOptions<MesWmStockTakingPlanApi.StockTakingPlan>,
  } as VxeTableGridOptions<ErpSupplierApi.Supplier>,
  gridEvents: {
    cellDblclick: handleCellDblclick,
    checkboxAll: handleCheckboxSelectChange,
    checkboxChange: handleCheckboxSelectChange,
    radioChange: ({
      row,
    }: {
      row: MesWmStockTakingPlanApi.StockTakingPlan;
    }) => {
    radioChange: ({ row }: { row: ErpSupplierApi.Supplier }) => {
      handleRadioChange(row);
    },
  },
});
/** é‡ç½®æŸ¥è¯¢å’Œé€‰æ‹©çŠ¶æ€ */
async function resetQueryState() {
  selectedRows.value = [];
  await gridApi.grid.clearCheckboxRow();
@@ -162,7 +190,6 @@
  await gridApi.formApi.resetForm();
}
/** æ‰“开盘点方案选择弹窗 */
async function openModal(
  selectedIds?: number[],
  options?: { multiple?: boolean },
@@ -180,12 +207,11 @@
  await applyPreSelection();
}
/** å…³é—­å¼¹çª— */
function closeModal() {
async function closeModal() {
  open.value = false;
  await resetQueryState();
}
/** ç¡®è®¤é€‰æ‹© */
function handleConfirm() {
  const rows = multiple.value ? getMultipleSelectedRows() : selectedRows.value;
  if (rows.length === 0) {
@@ -202,12 +228,12 @@
<template>
  <Modal
    v-model:open="open"
    :destroy-on-close="true"
    title="盘点方案选择"
    title="供应商选择"
    width="70%"
    @cancel="closeModal"
    :destroy-on-close="true"
    @ok="handleConfirm"
    @cancel="closeModal"
  >
    <Grid table-title="盘点方案列表" />
    <Grid table-title="供应商列表" />
  </Modal>
</template>
src/views/erp/purchase/supplier/components/select.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,114 @@
<script lang="ts" setup>
import type { ErpSupplierApi } from '#/api/erp/purchase/supplier';
import { computed, ref, useAttrs } from 'vue';
import { IconifyIcon } from '@vben/icons';
import { Input, Tooltip } from 'ant-design-vue';
import ErpSupplierSelectDialog from './select-dialog.vue';
defineOptions({ name: 'ErpSupplierSelect', inheritAttrs: false });
const props = withDefaults(
  defineProps<{
    allowClear?: boolean;
    disabled?: boolean;
    modelValue?: number;
    placeholder?: string;
    supplierName?: string;
  }>(),
  {
    allowClear: true,
    disabled: false,
    modelValue: undefined,
    placeholder: '请选择供应商',
    supplierName: undefined,
  },
);
const emit = defineEmits<{
  change: [item: ErpSupplierApi.Supplier | undefined];
  'update:modelValue': [value: number | undefined];
}>();
const attrs = useAttrs();
const dialogRef = ref<InstanceType<typeof ErpSupplierSelectDialog>>();
const hovering = ref(false);
const selectedItem = ref<ErpSupplierApi.Supplier>();
const displayLabel = computed(() => props.supplierName || selectedItem.value?.name || '');
const showClear = computed(
  () =>
    props.allowClear &&
    !props.disabled &&
    hovering.value &&
    props.modelValue !== null,
);
function clearSelected() {
  selectedItem.value = undefined;
  emit('update:modelValue', undefined);
  emit('change', undefined);
}
function handleClick(event: MouseEvent) {
  if (props.disabled) {
    return;
  }
  const target = event.target as HTMLElement;
  if (showClear.value && target.closest('.ant-input-suffix')) {
    event.stopPropagation();
    clearSelected();
    return;
  }
  const selectedIds = (
    props.modelValue === null ? [] : [props.modelValue]
  ) as number[];
  dialogRef.value?.open(selectedIds, { multiple: false });
}
function handleSelected(rows: ErpSupplierApi.Supplier[]) {
  const item = rows[0];
  if (!item) {
    return;
  }
  selectedItem.value = item;
  emit('update:modelValue', item.id);
  emit('change', item);
}
</script>
<template>
  <div
    v-bind="attrs"
    class="w-full"
    :class="disabled ? 'cursor-not-allowed' : 'cursor-pointer'"
    @click="handleClick"
    @mouseenter="hovering = true"
    @mouseleave="hovering = false"
  >
    <Tooltip :mouse-enter-delay="0.5" :open="selectedItem ? undefined : false">
      <template #title>
        <div v-if="selectedItem" class="leading-6">
          <div>名称:{{ selectedItem.name || '-' }}</div>
          <div>联系人:{{ selectedItem.contact || '-' }}</div>
          <div>电话:{{ selectedItem.mobile || selectedItem.telephone || '-' }}</div>
        </div>
      </template>
      <Input
        :disabled="disabled"
        :placeholder="placeholder"
        :value="displayLabel"
        readonly
      >
        <template #suffix>
          <IconifyIcon
            class="size-4"
            :icon="showClear ? 'lucide:circle-x' : 'lucide:search'"
          />
        </template>
      </Input>
    </Tooltip>
  </div>
  <ErpSupplierSelectDialog ref="dialogRef" @selected="handleSelected" />
</template>
src/views/itemreceipt/data.ts
ÎļþÒÑɾ³ý
src/views/itemreceipt/index.vue
ÎļþÒÑɾ³ý
src/views/itemreceipt/modules/detail-form.vue
ÎļþÒÑɾ³ý
src/views/itemreceipt/modules/detail-list.vue
ÎļþÒÑɾ³ý
src/views/itemreceipt/modules/form.vue
ÎļþÒÑɾ³ý
src/views/itemreceipt/modules/line-form.vue
ÎļþÒÑɾ³ý
src/views/itemreceipt/modules/line-list.vue
ÎļþÒÑɾ³ý
src/views/materialstock/components/index.ts
ÎļþÒÑɾ³ý
src/views/materialstock/components/select-dialog.vue
ÎļþÒÑɾ³ý
src/views/materialstock/components/select.vue
ÎļþÒÑɾ³ý
src/views/materialstock/data.ts
ÎļþÒÑɾ³ý
src/views/materialstock/index.vue
ÎļþÒÑɾ³ý
src/views/miscissue/data.ts
ÎļþÒÑɾ³ý
src/views/miscissue/index.vue
ÎļþÒÑɾ³ý
src/views/miscissue/modules/form.vue
ÎļþÒÑɾ³ý
src/views/miscissue/modules/line-form.vue
ÎļþÒÑɾ³ý
src/views/miscissue/modules/line-list.vue
ÎļþÒÑɾ³ý
src/views/miscreceipt/data.ts
ÎļþÒÑɾ³ý
src/views/miscreceipt/index.vue
ÎļþÒÑɾ³ý
src/views/miscreceipt/modules/form.vue
ÎļþÒÑɾ³ý
src/views/miscreceipt/modules/line-form.vue
ÎļþÒÑɾ³ý
src/views/miscreceipt/modules/line-list.vue
ÎļþÒÑɾ³ý
src/views/outsourceissue/data.ts
ÎļþÒÑɾ³ý
src/views/outsourceissue/index.vue
ÎļþÒÑɾ³ý
src/views/outsourceissue/modules/detail-form.vue
ÎļþÒÑɾ³ý
src/views/outsourceissue/modules/detail-list.vue
ÎļþÒÑɾ³ý
src/views/outsourceissue/modules/form.vue
ÎļþÒÑɾ³ý
src/views/outsourceissue/modules/line-form.vue
ÎļþÒÑɾ³ý
src/views/outsourceissue/modules/line-list.vue
ÎļþÒÑɾ³ý
src/views/outsourcereceipt/data.ts
ÎļþÒÑɾ³ý
src/views/outsourcereceipt/index.vue
ÎļþÒÑɾ³ý
src/views/outsourcereceipt/modules/detail-form.vue
ÎļþÒÑɾ³ý
src/views/outsourcereceipt/modules/detail-list.vue
ÎļþÒÑɾ³ý
src/views/outsourcereceipt/modules/form.vue
ÎļþÒÑɾ³ý
src/views/outsourcereceipt/modules/line-form.vue
ÎļþÒÑɾ³ý
src/views/outsourcereceipt/modules/line-list.vue
ÎļþÒÑɾ³ý
src/views/packages/components/index.ts
ÎļþÒÑɾ³ý
src/views/packages/components/select-dialog.vue
ÎļþÒÑɾ³ý
src/views/packages/components/select.vue
ÎļþÒÑɾ³ý
src/views/packages/data.ts
ÎļþÒÑɾ³ý
src/views/packages/index.vue
ÎļþÒÑɾ³ý
src/views/packages/modules/form.vue
ÎļþÒÑɾ³ý
src/views/packages/modules/line-form.vue
ÎļþÒÑɾ³ý
src/views/packages/modules/package-line-list.vue
ÎļþÒÑɾ³ý
src/views/packages/modules/sub-package-list.vue
ÎļþÒÑɾ³ý
src/views/productissue/data.ts
ÎļþÒÑɾ³ý
src/views/productissue/index.vue
ÎļþÒÑɾ³ý
src/views/productissue/modules/detail-form.vue
ÎļþÒÑɾ³ý
src/views/productissue/modules/detail-list.vue
ÎļþÒÑɾ³ý
src/views/productissue/modules/form.vue
ÎļþÒÑɾ³ý
src/views/productissue/modules/line-form.vue
ÎļþÒÑɾ³ý
src/views/productissue/modules/line-list.vue
ÎļþÒÑɾ³ý
src/views/productreceipt/data.ts
ÎļþÒÑɾ³ý
src/views/productreceipt/index.vue
ÎļþÒÑɾ³ý
src/views/productreceipt/modules/detail-form.vue
ÎļþÒÑɾ³ý
src/views/productreceipt/modules/detail-list.vue
ÎļþÒÑɾ³ý
src/views/productreceipt/modules/form.vue
ÎļþÒÑɾ³ý
src/views/productreceipt/modules/line-form.vue
ÎļþÒÑɾ³ý
src/views/productreceipt/modules/line-list.vue
ÎļþÒÑɾ³ý
src/views/productsales/data.ts
ÎļþÒÑɾ³ý
src/views/productsales/index.vue
ÎļþÒÑɾ³ý
src/views/productsales/modules/detail-form.vue
ÎļþÒÑɾ³ý
src/views/productsales/modules/detail-list.vue
ÎļþÒÑɾ³ý
src/views/productsales/modules/form.vue
ÎļþÒÑɾ³ý
src/views/productsales/modules/line-form.vue
ÎļþÒÑɾ³ý
src/views/productsales/modules/line-list.vue
ÎļþÒÑɾ³ý
src/views/returnissue/data.ts
ÎļþÒÑɾ³ý
src/views/returnissue/index.vue
ÎļþÒÑɾ³ý
src/views/returnissue/modules/detail-form.vue
ÎļþÒÑɾ³ý
src/views/returnissue/modules/detail-list.vue
ÎļþÒÑɾ³ý
src/views/returnissue/modules/form.vue
ÎļþÒÑɾ³ý
src/views/returnissue/modules/line-form.vue
ÎļþÒÑɾ³ý
src/views/returnissue/modules/line-list.vue
ÎļþÒÑɾ³ý
src/views/returnsales/data.ts
ÎļþÒÑɾ³ý
src/views/returnsales/index.vue
ÎļþÒÑɾ³ý
src/views/returnsales/modules/detail-form.vue
ÎļþÒÑɾ³ý
src/views/returnsales/modules/detail-list.vue
ÎļþÒÑɾ³ý
src/views/returnsales/modules/form.vue
ÎļþÒÑɾ³ý
src/views/returnsales/modules/line-form.vue
ÎļþÒÑɾ³ý
src/views/returnsales/modules/line-list.vue
ÎļþÒÑɾ³ý
src/views/returnvendor/data.ts
ÎļþÒÑɾ³ý
src/views/returnvendor/index.vue
ÎļþÒÑɾ³ý
src/views/returnvendor/modules/detail-form.vue
ÎļþÒÑɾ³ý
src/views/returnvendor/modules/detail-list.vue
ÎļþÒÑɾ³ý
src/views/returnvendor/modules/form.vue
ÎļþÒÑɾ³ý
src/views/returnvendor/modules/line-form.vue
ÎļþÒÑɾ³ý
src/views/returnvendor/modules/line-list.vue
ÎļþÒÑɾ³ý
src/views/salesnotice/components/index.ts
ÎļþÒÑɾ³ý
src/views/salesnotice/components/line-select-dialog.vue
ÎļþÒÑɾ³ý
src/views/salesnotice/components/line-select.vue
ÎļþÒÑɾ³ý
src/views/salesnotice/components/select-dialog.vue
ÎļþÒÑɾ³ý
src/views/salesnotice/components/select.vue
ÎļþÒÑɾ³ý
src/views/salesnotice/data.ts
ÎļþÒÑɾ³ý
src/views/salesnotice/index.vue
ÎļþÒÑɾ³ý
src/views/salesnotice/modules/form.vue
ÎļþÒÑɾ³ý
src/views/salesnotice/modules/line-form.vue
ÎļþÒÑɾ³ý
src/views/salesnotice/modules/line-list.vue
ÎļþÒÑɾ³ý
src/views/sn/data.ts
ÎļþÒÑɾ³ý
src/views/sn/index.vue
ÎļþÒÑɾ³ý
src/views/sn/modules/detail.vue
ÎļþÒÑɾ³ý
src/views/sn/modules/form.vue
ÎļþÒÑɾ³ý
src/views/stocktaking/plan/components/condition-value-input.vue
ÎļþÒÑɾ³ý
src/views/stocktaking/plan/components/index.ts
ÎļþÒÑɾ³ý
src/views/stocktaking/plan/components/select.vue
ÎļþÒÑɾ³ý
src/views/stocktaking/plan/data.ts
ÎļþÒÑɾ³ý
src/views/stocktaking/plan/index.vue
ÎļþÒÑɾ³ý
src/views/stocktaking/plan/modules/form.vue
ÎļþÒÑɾ³ý
src/views/stocktaking/plan/modules/param-form.vue
ÎļþÒÑɾ³ý
src/views/stocktaking/plan/modules/param-list.vue
ÎļþÒÑɾ³ý
src/views/stocktaking/task/data.ts
ÎļþÒÑɾ³ý
src/views/stocktaking/task/index.vue
ÎļþÒÑɾ³ý
src/views/stocktaking/task/modules/form.vue
ÎļþÒÑɾ³ý
src/views/stocktaking/task/modules/line-list.vue
ÎļþÒÑɾ³ý
src/views/stocktaking/task/modules/result-form.vue
ÎļþÒÑɾ³ý
src/views/stocktaking/task/modules/result-list.vue
ÎļþÒÑɾ³ý
src/views/transfer/data.ts
ÎļþÒÑɾ³ý
src/views/transfer/index.vue
ÎļþÒÑɾ³ý
src/views/transfer/modules/detail-form.vue
ÎļþÒÑɾ³ý
src/views/transfer/modules/detail-list.vue
ÎļþÒÑɾ³ý
src/views/transfer/modules/form.vue
ÎļþÒÑɾ³ý
src/views/transfer/modules/line-form.vue
ÎļþÒÑɾ³ý
src/views/transfer/modules/line-list.vue
ÎļþÒÑɾ³ý
src/views/warehouse/area/data.ts
ÎļþÒÑɾ³ý
src/views/warehouse/area/index.vue
ÎļþÒÑɾ³ý
src/views/warehouse/area/modules/form.vue
ÎļþÒÑɾ³ý
src/views/warehouse/components/area-select.vue
ÎļþÒÑɾ³ý
src/views/warehouse/components/index.ts
ÎļþÒÑɾ³ý
src/views/warehouse/components/location-select.vue
ÎļþÒÑɾ³ý
src/views/warehouse/components/select.vue
ÎļþÒÑɾ³ý
src/views/warehouse/data.ts
ÎļþÒÑɾ³ý
src/views/warehouse/index.vue
ÎļþÒÑɾ³ý
src/views/warehouse/location/data.ts
ÎļþÒÑɾ³ý
src/views/warehouse/location/index.vue
ÎļþÒÑɾ³ý
src/views/warehouse/location/modules/form.vue
ÎļþÒÑɾ³ý
src/views/warehouse/modules/form.vue
ÎļþÒÑɾ³ý
src/views/wls/batch/components/detail.vue
@@ -1,18 +1,58 @@
<script lang="ts" setup>
import type { MdmItemApi } from '#/api/mdm/item';
import type { MesWmBatchApi } from '#/api/mes/wm/batch';
import type { DescriptionItemSchema } from '#/components/description';
import { ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { getItem } from '#/api/mdm/item';
import { getBatch } from '#/api/mes/wm/batch';
import { useDescription } from '#/components/description';
import { useDetailSchema } from '../data';
const detailData = ref<MesWmBatchApi.Batch>(); // å½“前批次详情
const detailData = ref<MesWmBatchApi.Batch>();
const itemData = ref<MdmItemApi.Item>();
const [Descriptions] = useDescription({
/** æ ¹æ®ç‰©æ–™æ‰¹æ¬¡å±žæ€§é…ç½®è¿‡æ»¤è¯¦æƒ…字段 */
function filterSchemaByItemFlags(
  schema: DescriptionItemSchema[],
  item: MdmItemApi.Item | undefined,
): DescriptionItemSchema[] {
  // åŸºç¡€æ•°æ®å­—段始终显示
  const basicFields = new Set([
    'code',
    'itemCode',
    'itemName',
    'itemSpecification',
    'unitName',
  ]);
  // æ‰¹æ¬¡å±žæ€§å­—段与 flag çš„æ˜ å°„
  const flagFieldMap: Record<string, keyof MdmItemApi.Item> = {
    produceDate: 'produceDateFlag',
    expireDate: 'expireDateFlag',
    receiptDate: 'receiptDateFlag',
    vendorName: 'vendorFlag',
    purchaseOrderCode: 'purchaseOrderCodeFlag',
    lotNumber: 'lotNumberFlag',
    qualityStatus: 'qualityStatusFlag',
  };
  return schema.filter((s) => {
    if (basicFields.has(s.field!)) return true;
    const flagField = flagFieldMap[s.field!];
    if (flagField) {
      return item?.[flagField] === true;
    }
    // éžåŸºç¡€ã€éžæ‰¹æ¬¡å±žæ€§å­—段不展示
    return false;
  });
}
const [Descriptions, descApi] = useDescription({
  bordered: true,
  column: 3,
  schema: useDetailSchema(),
@@ -25,6 +65,7 @@
  async onOpenChange(isOpen) {
    if (!isOpen) {
      detailData.value = undefined;
      itemData.value = undefined;
      return;
    }
    const data = modalApi.getData<{ id?: number }>();
@@ -34,6 +75,15 @@
    modalApi.lock();
    try {
      detailData.value = await getBatch(data.id);
      // èŽ·å–ç‰©æ–™è¯¦æƒ…ä»¥è¯»å–æ‰¹æ¬¡å±žæ€§é…ç½®
      if (detailData.value?.itemId) {
        itemData.value = await getItem(detailData.value.itemId);
        const filtered = filterSchemaByItemFlags(
          useDetailSchema(),
          itemData.value,
        );
        descApi.setDescProps({ schema: filtered });
      }
    } finally {
      modalApi.unlock();
    }
src/views/wls/itemreceipt/data.ts
@@ -19,7 +19,7 @@
import { generateAutoCode } from '#/api/mes/md/autocode/record';
import { getRangePickerDefaultProps } from '#/utils';
import { MdItemSelect } from '#/views/mes/md/item/components';
import { MdVendorSelect } from '#/views/mes/md/vendor/components';
import { ErpSupplierSelect } from '#/views/erp/purchase/supplier/components';
import {
  WmArrivalNoticeLineSelect,
  WmArrivalNoticeSelect,
@@ -123,7 +123,7 @@
    {
      fieldName: 'vendorId',
      label: '供应商',
      component: markRaw(MdVendorSelect),
      component: markRaw(ErpSupplierSelect),
      componentProps: {
        placeholder: '请选择供应商',
      },
@@ -174,7 +174,7 @@
    {
      fieldName: 'vendorId',
      label: '供应商',
      component: markRaw(MdVendorSelect),
      component: markRaw(ErpSupplierSelect),
      componentProps: {
        placeholder: '请选择供应商',
      },
src/views/wls/materialstock/components/batch-config-display.vue
@@ -1,92 +1,41 @@
<script lang="ts" setup>
import type { MdmItemBatchConfigApi } from '#/api/mes/md/item-batch-config';
import type { MdmItemApi } from '#/api/mdm/item';
import { computed, ref, watch } from 'vue';
import { computed } from 'vue';
import { Divider, Tag } from 'ant-design-vue';
import { getItemBatchConfigByItemId } from '#/api/mes/md/item-batch-config';
const props = defineProps<{
  itemId?: number;
  isBatchManaged?: boolean;
  item?: MdmItemApi.Item | null;
}>();
// æ‰¹æ¬¡é…ç½®æ•°æ®
const config = ref<MdmItemBatchConfigApi.ItemBatchConfig | null>(null);
// æ˜¯å¦åŠ è½½ä¸­
const loading = ref(false);
// æ˜¯å¦æ˜¾ç¤ºï¼ˆå¯ç”¨æ‰¹æ¬¡ç®¡ç†æ—¶æ˜¾ç¤ºï¼‰
const visible = computed(() => props.isBatchManaged === true);
const visible = computed(() => props.item?.isBatchManaged === true);
// å·²å¯ç”¨çš„æ‰¹æ¬¡å±žæ€§åˆ—表(仅保留7个字段)
// å·²å¯ç”¨çš„æ‰¹æ¬¡å±žæ€§åˆ—表
const enabledProps = computed(() => {
  if (!config.value) return [];
  const props: { label: string; value: boolean }[] = [];
  if (config.value.produceDateFlag) props.push({ label: '生产日期', value: true });
  if (config.value.expireDateFlag) props.push({ label: '有效期', value: true });
  if (config.value.receiptDateFlag) props.push({ label: '入库日期', value: true });
  if (config.value.vendorFlag) props.push({ label: '供应商', value: true });
  if (config.value.purchaseOrderCodeFlag) props.push({ label: '采购订单号', value: true });
  if (config.value.lotNumberFlag) props.push({ label: '生产批号', value: true });
  if (config.value.qualityStatusFlag) props.push({ label: '质量状态', value: true });
  return props;
});
/** åŠ è½½æ‰¹æ¬¡é…ç½® */
async function loadConfig() {
  if (!props.itemId || !props.isBatchManaged) {
    config.value = null;
    return;
  }
  loading.value = true;
  try {
    const data = await getItemBatchConfigByItemId(props.itemId);
    config.value = data;
  } catch {
    config.value = null;
  } finally {
    loading.value = false;
  }
}
/** é‡ç½® */
function reset() {
  config.value = null;
  loading.value = false;
}
// ç›‘听 itemId å˜åŒ–,加载配置
watch(
  () => [props.itemId, props.isBatchManaged],
  () => {
    if (props.itemId && props.isBatchManaged) {
      loadConfig();
    } else {
      reset();
    }
  },
  { immediate: true },
);
defineExpose({
  loadConfig,
  reset,
  if (!props.item) return [];
  const list: string[] = [];
  if (props.item.produceDateFlag) list.push('生产日期');
  if (props.item.expireDateFlag) list.push('有效期');
  if (props.item.receiptDateFlag) list.push('入库日期');
  if (props.item.vendorFlag) list.push('供应商');
  if (props.item.purchaseOrderCodeFlag) list.push('采购订单号');
  if (props.item.lotNumberFlag) list.push('生产批号');
  if (props.item.qualityStatusFlag) list.push('质量状态');
  return list;
});
</script>
<template>
  <div v-if="visible" class="mt-4 rounded border border-gray-200 bg-gray-50 p-4">
  <div v-if="visible" class="mx-4 mt-4 rounded border border-gray-200 bg-gray-50 p-4">
    <Divider orientation="left">批次属性</Divider>
    <div v-if="loading" class="text-center text-gray-500">加载中...</div>
    <div v-else-if="enabledProps.length === 0" class="text-center text-gray-500">
    <div v-if="enabledProps.length === 0" class="text-center text-gray-500">
      è¯¥ç‰©æ–™æœªé…ç½®æ‰¹æ¬¡å±žæ€§
    </div>
    <div v-else class="flex flex-wrap gap-2">
      <Tag v-for="prop in enabledProps" :key="prop.label" color="blue">
        {{ prop.label }}
      <Tag v-for="prop in enabledProps" :key="prop" color="blue">
        {{ prop }}
      </Tag>
    </div>
    <p class="mt-2 text-xs text-gray-500">
src/views/wls/materialstock/components/stock-adjust-modal.vue
@@ -4,7 +4,6 @@
  MaterialStockAdjustOutParams,
} from '#/api/mes/wm/materialstock';
import type { MdmItemApi } from '#/api/mdm/item';
import type { MdmItemBatchConfigApi } from '#/api/mes/md/item-batch-config';
import type { VbenFormSchema } from '#/adapter/form';
import { ref } from 'vue';
@@ -20,9 +19,8 @@
  adjustMaterialStockOut,
} from '#/api/mes/wm/materialstock';
import { getItem } from '#/api/mdm/item';
import { getItemBatchConfigByItemId } from '#/api/mes/md/item-batch-config';
import { MdmItemSelect } from '#/views/basicData/mdm/components';
import { MdVendorSelect } from '#/views/mes/md/vendor/components';
import { ErpSupplierSelect } from '#/views/erp/purchase/supplier/components';
import BatchConfigDisplay from './batch-config-display.vue';
import {
  WmWarehouseAreaSelect,
@@ -44,56 +42,45 @@
const batchEnabled = ref(false);
// æ˜¯å¦æ‰‹åŠ¨å¡«å†™æ‰¹æ¬¡å·
const manualBatchEntry = ref(false);
// ç‰©æ–™æ‰¹æ¬¡é…ç½®
const batchConfig = ref<MdmItemBatchConfigApi.ItemBatchConfig | null>(null);
// æ‰¹æ¬¡é…ç½®å±•示组件引用
const batchConfigDisplayRef = ref<InstanceType<typeof BatchConfigDisplay>>();
// æ ‡é¢˜
const modalTitle = ref('库存调整');
/** åŠ è½½ç‰©æ–™æ‰¹æ¬¡é…ç½®å¹¶æ›´æ–°å­—æ®µæ˜¾ç¤º */
async function loadBatchConfigAndUpdateFields(itemId: number) {
  try {
    const config = await getItemBatchConfigByItemId(itemId);
    batchConfig.value = config;
  } catch {
    batchConfig.value = null;
  }
  await updateBatchFields();
}
/** æ›´æ–°æ‰¹æ¬¡å­—段显示(根据配置展示已启用的属性) */
/** æ›´æ–°æ‰¹æ¬¡å­—段显示(根据物料数据中的批次配置展示已启用的属性) */
async function updateBatchFields() {
  const enabled = selectedItem.value?.isBatchManaged === true;
  batchEnabled.value = enabled;
  if (!enabled) {
    // éšè—æ‰€æœ‰æ‰¹æ¬¡ç›¸å…³å­—段
    formApi.updateSchema([
      { fieldName: 'batchCode', dependencies: { show: () => false } },
      { fieldName: 'manualBatchEntry', dependencies: { show: () => false } },
      { fieldName: 'produceDate', dependencies: { show: () => false } },
      { fieldName: 'expireDate', dependencies: { show: () => false } },
      { fieldName: 'manualBatchEntry', dependencies: { show: () => false } },
      { fieldName: 'receiptDate', dependencies: { show: () => false } },
      { fieldName: 'vendorId', dependencies: { show: () => true } },
      { fieldName: 'purchaseOrderCode', dependencies: { show: () => false } },
      { fieldName: 'lotNumber', dependencies: { show: () => false } },
      { fieldName: 'qualityStatus', dependencies: { show: () => false } },
    ]);
    return;
  }
  // å¯ç”¨æ‰¹æ¬¡ç®¡ç†ï¼Œæ ¹æ®é…ç½®æ˜¾ç¤ºå­—段
  const config = batchConfig.value;
  const item = selectedItem.value;
  const isIn = operateType.value === 1;
  // æ˜¯å¦æ‰‹åŠ¨å¡«å†™æ‰¹æ¬¡å·æŽ§åˆ¶æ‰¹æ¬¡å·å­—æ®µçš„æ˜¾ç¤º
  const showBatchCode = manualBatchEntry.value;
  const showProduceDate = isIn && !!config?.produceDateFlag;
  const showExpireDate = isIn && !!config?.expireDateFlag;
  formApi.updateSchema([
    { fieldName: 'batchCode', dependencies: { show: () => showBatchCode } },
    { fieldName: 'produceDate', dependencies: { show: () => showProduceDate } },
    { fieldName: 'expireDate', dependencies: { show: () => showExpireDate } },
    { fieldName: 'batchCode', dependencies: { show: () => manualBatchEntry.value } },
    { fieldName: 'manualBatchEntry', dependencies: { show: () => true } },
    { fieldName: 'produceDate', dependencies: { show: () => isIn && !!item?.produceDateFlag } },
    { fieldName: 'expireDate', dependencies: { show: () => isIn && !!item?.expireDateFlag } },
    { fieldName: 'receiptDate', dependencies: { show: () => isIn && !!item?.receiptDateFlag } },
    { fieldName: 'vendorId', dependencies: { show: () => !isIn || !!item?.vendorFlag } },
    { fieldName: 'purchaseOrderCode', dependencies: { show: () => isIn && !!item?.purchaseOrderCodeFlag } },
    { fieldName: 'lotNumber', dependencies: { show: () => isIn && !!item?.lotNumberFlag } },
    { fieldName: 'qualityStatus', dependencies: { show: () => isIn && !!item?.qualityStatusFlag } },
  ]);
}
@@ -103,10 +90,9 @@
  if (item?.id) {
    const itemDetail = await getItem(item.id);
    selectedItem.value = itemDetail;
    // åŠ è½½ç‰©æ–™æ‰¹æ¬¡é…ç½®å¹¶æ›´æ–°å­—æ®µ
    await loadBatchConfigAndUpdateFields(item.id);
    // æ ¹æ®ç‰©æ–™æ•°æ®æ›´æ–°æ‰¹æ¬¡å­—段
    await updateBatchFields();
  } else {
    batchConfig.value = null;
    batchEnabled.value = false;
  }
  // æ¸…空批次相关值
@@ -290,17 +276,77 @@
      },
      dependencies: {
        triggerFields: ['itemId'],
        show: () => false, // é»˜è®¤éšè—
        show: () => false,
      },
    },
    // å…¥åº“日期(根据批次配置显示,仅入库)
    {
      fieldName: 'receiptDate',
      label: '入库日期',
      component: 'DatePicker',
      componentProps: {
        placeholder: '请选择入库日期',
        format: 'YYYY-MM-DD',
        valueFormat: 'YYYY-MM-DD',
      },
      dependencies: {
        triggerFields: ['itemId'],
        show: () => false,
      },
    },
    {
      fieldName: 'vendorId',
      label: '供应商',
      component: markRaw(MdVendorSelect),
      component: markRaw(ErpSupplierSelect),
      componentProps: {
        placeholder: '请选择供应商',
      },
      rules: 'selectRequired',
    },
    // é‡‡è´­è®¢å•号(根据批次配置显示,仅入库)
    {
      fieldName: 'purchaseOrderCode',
      label: '采购订单号',
      component: 'Input',
      componentProps: {
        placeholder: '请输入采购订单号',
      },
      dependencies: {
        triggerFields: ['itemId'],
        show: () => false,
      },
    },
    // ç”Ÿäº§æ‰¹å·ï¼ˆæ ¹æ®æ‰¹æ¬¡é…ç½®æ˜¾ç¤ºï¼Œä»…入库)
    {
      fieldName: 'lotNumber',
      label: '生产批号',
      component: 'Input',
      componentProps: {
        placeholder: '请输入生产批号',
      },
      dependencies: {
        triggerFields: ['itemId'],
        show: () => false,
      },
    },
    // è´¨é‡çŠ¶æ€ï¼ˆæ ¹æ®æ‰¹æ¬¡é…ç½®æ˜¾ç¤ºï¼Œä»…å…¥åº“ï¼‰
    {
      fieldName: 'qualityStatus',
      label: '质量状态',
      component: 'Select',
      componentProps: {
        placeholder: '请选择质量状态',
        allowClear: true,
        options: [
          { label: '合格', value: 'QUALIFIED' },
          { label: '不合格', value: 'UNQUALIFIED' },
          { label: '待检', value: 'PENDING' },
        ],
      },
      dependencies: {
        triggerFields: ['itemId'],
        show: () => false,
      },
    },
    {
      fieldName: 'quantity',
@@ -355,7 +401,6 @@
      selectedWarehouse.value = null;
      selectedLocation.value = null;
      batchEnabled.value = false;
      batchConfig.value = null;
      operateType.value = 1;
      modalTitle.value = '库存调整';
      return;
@@ -365,9 +410,13 @@
    // é»˜è®¤éšè—æ‰¹æ¬¡ç›¸å…³å­—段
    formApi.updateSchema([
      { fieldName: 'batchCode', dependencies: { show: () => false } },
      { fieldName: 'manualBatchEntry', dependencies: { show: () => false } },
      { fieldName: 'produceDate', dependencies: { show: () => false } },
      { fieldName: 'expireDate', dependencies: { show: () => false } },
      { fieldName: 'manualBatchEntry', dependencies: { show: () => false } },
      { fieldName: 'receiptDate', dependencies: { show: () => false } },
      { fieldName: 'purchaseOrderCode', dependencies: { show: () => false } },
      { fieldName: 'lotNumber', dependencies: { show: () => false } },
      { fieldName: 'qualityStatus', dependencies: { show: () => false } },
    ]);
    // é‡ç½®æ‰‹åŠ¨å¡«å†™æ‰¹æ¬¡å·çŠ¶æ€
    manualBatchEntry.value = false;
@@ -383,7 +432,7 @@
      if (data.itemId) {
        const itemDetail = await getItem(data.itemId);
        selectedItem.value = itemDetail;
        await loadBatchConfigAndUpdateFields(data.itemId);
        await updateBatchFields();
      }
    }
  },
@@ -399,35 +448,36 @@
  const values = await formApi.getValues();
  const {
    itemId,
    warehouseId,
    locationId,
    areaId,
    batchCode,
    produceDate,
    expireDate,
    vendorId,
    quantity,
    reason,
  } = values;
  // å¯ç”¨æ‰¹æ¬¡ç®¡ç†æ—¶çš„æ ¡éªŒ
  if (batchEnabled.value) {
    // æ‰‹åŠ¨å¡«å†™æ‰¹æ¬¡å·æ—¶ï¼Œæ‰¹æ¬¡å·å¿…å¡«
    if (manualBatchEntry.value && !batchCode) {
    if (manualBatchEntry.value && !values.batchCode) {
      message.error('请输入批次号');
      return;
    }
    // æ ¹æ®æ‰¹æ¬¡é…ç½®æ ¡éªŒå¿…填字段(仅入库)
    if (operateType.value === 1) {
      const config = batchConfig.value;
      if (config?.produceDateFlag && !produceDate) {
      const item = selectedItem.value;
      if (item?.produceDateFlag && !values.produceDate) {
        message.error('请选择生产日期');
        return;
      }
      if (config?.expireDateFlag && !expireDate) {
      if (item?.expireDateFlag && !values.expireDate) {
        message.error('请选择有效期');
        return;
      }
      if (item?.receiptDateFlag && !values.receiptDate) {
        message.error('请选择入库日期');
        return;
      }
      if (item?.purchaseOrderCodeFlag && !values.purchaseOrderCode) {
        message.error('请输入采购订单号');
        return;
      }
      if (item?.lotNumberFlag && !values.lotNumber) {
        message.error('请输入生产批号');
        return;
      }
      if (item?.qualityStatusFlag && !values.qualityStatus) {
        message.error('请选择质量状态');
        return;
      }
    }
@@ -439,30 +489,34 @@
    if (type === 1) {
      // å…¥åº“
      const params: MaterialStockAdjustInParams = {
        itemId,
        warehouseId,
        locationId,
        areaId,
        batchCode,
        produceDate,
        expireDate,
        vendorId,
        quantity,
        reason,
        itemId: values.itemId,
        warehouseId: values.warehouseId,
        locationId: values.locationId,
        areaId: values.areaId,
        batchCode: values.batchCode,
        produceDate: values.produceDate,
        expireDate: values.expireDate,
        receiptDate: values.receiptDate,
        vendorId: values.vendorId,
        purchaseOrderCode: values.purchaseOrderCode,
        lotNumber: values.lotNumber,
        qualityStatus: values.qualityStatus,
        quantity: values.quantity,
        reason: values.reason,
      };
      await adjustMaterialStockIn(params);
      message.success('入库成功');
    } else {
      // å‡ºåº“
      const params: MaterialStockAdjustOutParams = {
        itemId,
        warehouseId,
        locationId,
        areaId,
        batchCode,
        vendorId,
        quantity,
        reason,
        itemId: values.itemId,
        warehouseId: values.warehouseId,
        locationId: values.locationId,
        areaId: values.areaId,
        batchCode: values.batchCode,
        vendorId: values.vendorId,
        quantity: values.quantity,
        reason: values.reason,
      };
      await adjustMaterialStockOut(params);
      message.success('出库成功');
@@ -481,8 +535,7 @@
    <Form class="mx-4" />
    <BatchConfigDisplay
      ref="batchConfigDisplayRef"
      :item-id="selectedItem?.id"
      :is-batch-managed="batchEnabled"
      :item="selectedItem"
    />
  </Modal>
</template>
vite.config.ts
@@ -42,7 +42,7 @@
          "/admin-api": {
            changeOrigin: true,
            rewrite: path => path.replace(/^\/admin-api/, ""),
            target: "http://192.168.0.244:48080/admin-api",
            target: "http://192.168.0.226:48080/admin-api",
            ws: true,
          },
        },