Explorar el Código

fix:839【销售订单】【发货单】库存式订单,选择物品需要增加一列盘具,物品如果有盘具信息自动带出来,去发货的时候,盘具字段支持修改

mlchen hace 4 días
padre
commit
ffaf3f9d17

+ 6 - 0
AGENTS.md

@@ -1,5 +1,11 @@
 # 前端数据契约
 
+- 销售发货新增/修改弹窗的物品清单使用 Element UI 原生横向滚动条;主表的勾选、序号、订单编码、计价方式及操作列均不固定,避免左右固定层盖住滑块两端。`ele-pro-table` 的本地/服务端旧列配置会优先覆盖源码的 `fixed`,需在初始化及用户变更列设置时清掉这些列的旧固定标记并刷新列定义,同时保留列宽、显隐和顺序;该弹窗表格不使用 `v-table-scroll-sync`。
+
+- STORY #839:库存式销售订单通过 `isReelSpecification` 开启可编辑盘具列,新增/修改保存到订单明细;共用清单默认关闭,避免影响其他单据。发货清单盘具可独立修改,从订单带入时保留已改值及空串,只在原值为 NULL 时从唯一匹配库存补齐,切换库存批次才改用新盘具。不得把订单/发货盘具回写来源库存;后端发布前需执行 `V2026.11.19.01__STORY839销售发货盘具规格.sql` 和 `V2026.11.19.02__STORY839销售订单盘具规格.sql`。
+- 销售订单普通详情弹窗与销售订单信息抽屉分别使用共用 `inventoryTableDetails.vue`;两处都要在 `needProduce == 0` 时开启只读盘具列,盘具值直接读取订单明细的 `reelSpecification`。
+- 销售订单列表的“新建”和“修改”实际打开 `saleOrder/components/addDialogNew.vue`;`addDialog.vue` 是另一入口。库存式订单盘具列开关须覆盖实际使用的 `addDialogNew.vue`,仅 `needProduce == 0` 时显示。
+
 - 销售发货的订单来源产品在编辑初始化、重新选择时,必须在清空 `id` 前保留 `orderProductId || id`;换仓和换批次只改变实际库存身份,不能覆盖订单明细身份。不同订单行即使物品和批次相同,也分别使用各自剩余额度;同一订单行拆为多条发货明细时累计校验,雪花ID保持字符串。
 
 - 库存台账返回的 `provenance` 是展示字符串;向 EOM 发货接口提交产地时,使用 `purchaseOrigins` 产地编码数组转换为字符串数组。替代料与普通发货物品均需遵守此契约,不能把库存记录中的 `"[]"` 原样提交给 `JSONArray` 字段。

+ 19 - 0
src/BIZComponents/inventoryTable.vue

@@ -149,6 +149,11 @@
             </el-button>
           </el-form-item>
         </template>
+        <template v-slot:reelSpecification="{ row }">
+          <el-form-item>
+            <el-input v-model="row.reelSpecification" maxlength="100"></el-input>
+          </el-form-item>
+        </template>
         <template v-slot:sortCode="scope">
           <el-form-item prop="sortCode">
             <el-input
@@ -1247,6 +1252,10 @@
         default: '',
         type: String
       },
+      isReelSpecification: {
+        type: Boolean,
+        default: false
+      },
       isDiscountTotalPrice: {
         default: false,
         type: Boolean
@@ -1449,6 +1458,7 @@
         startTime: '',
         workHour: '',
         guaranteePeriodUnitCode: '',
+        reelSpecification: null,
         technicalDrawings: [],
         arrivalWay: 1,
         // 生产加工类型特有字段
@@ -1566,6 +1576,15 @@
             slot: 'productCode',
             align: 'center'
           },
+          {
+            width: 150,
+            prop: 'reelSpecification',
+            label: '盘具',
+            slot: 'reelSpecification',
+            isNone: !this.isReelSpecification,
+            showOverflowTooltip: true,
+            align: 'center'
+          },
           {
             width: 120,
             prop: 'specification',

+ 12 - 0
src/BIZComponents/inventoryTableDetails.vue

@@ -202,6 +202,10 @@
       timeDialog
     },
     props: {
+      isReelSpecification: {
+        type: Boolean,
+        default: false
+      },
       // 是否显示「操作」列(BOM详情):只有报价单详情传 true,其它单据不受影响
       showBomDetail: {
         default: false,
@@ -815,6 +819,14 @@
             isNone: this.quoteType === 2,
             align: 'center'
           },
+          {
+            width: 150,
+            prop: 'reelSpecification',
+            label: '盘具',
+            isNone: !this.isReelSpecification,
+            showOverflowTooltip: true,
+            align: 'center'
+          },
           {
             width: 160,
             prop: 'productBrand',

+ 1 - 0
src/views/saleManage/saleOrder/components/addDialog.vue

@@ -426,6 +426,7 @@
         :isContractId="!!form.contractId"
         :isChangeCount="false"
         :needProduce="form.needProduce"
+        :isReelSpecification="form.needProduce == 0"
         :isSupplier="true"
         :isArrivalWay="true"
         :cacheKeyUrl="cacheKeyUrl"

+ 1 - 0
src/views/saleManage/saleOrder/components/addDialogNew.vue

@@ -583,6 +583,7 @@
         :isContractId="!!form.contractId"
         :isChangeCount="false"
         :needProduce="form.needProduce"
+        :isReelSpecification="form.needProduce == 0"
         :isSupplier="true"
         :isArrivalWay="true"
         :cacheKeyUrl="cacheKeyUrl"

+ 1 - 0
src/views/saleManage/saleOrder/components/darwerComponents/saleOrderInfo.vue

@@ -330,6 +330,7 @@
     <inventoryTabledetail
       v-if="form.needProduce != 4"
       ref="inventoryTabledetailRef"
+      :isReelSpecification="form.needProduce == 0"
       :isCustomerMark="true"
       :isDiscountTotalPrice="true"
       :isArrivalWay="true"

+ 1 - 0
src/views/saleManage/saleOrder/components/detailDialog.vue

@@ -254,6 +254,7 @@
       <inventoryTabledetail
         v-if="form.needProduce != 4"
         ref="inventoryTabledetailRef"
+        :isReelSpecification="form.needProduce == 0"
         :isCustomerMark="true"
         :isDiscountTotalPrice="true"
         :isArrivalWay="true"

+ 49 - 13
src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue

@@ -15,7 +15,7 @@
         class="time-form"
         :class="{ 'time-form-busy': tableBusy }"
         :selection.sync="selection"
-        @columns-change="handleColumnChange"
+        @columns-change="handleInventoryColumnsChange"
         @header-dragend="handleHeaderDragend"
         :cache-key="cacheKeyUrl"
         height="350"
@@ -141,6 +141,14 @@
             </el-select>
           </el-form-item>
         </template>
+        <template v-slot:reelSpecification="{ row }">
+          <el-form-item>
+            <el-input
+              v-model="row.reelSpecification"
+              maxlength="100"
+            ></el-input>
+          </el-form-item>
+        </template>
         <!-- 生产编号 可编辑 -->
         <template v-slot:productionCodes="{ row }">
           <el-form-item>
@@ -816,23 +824,20 @@
             width: 45,
             type: 'selection',
             columnKey: 'selection',
-            align: 'center',
-            fixed: 'left'
+            align: 'center'
           },
           {
             width: 60,
             type: 'index',
             columnKey: 'index',
-            align: 'center',
-            fixed: 'left'
+            align: 'center'
           },
           {
             minWidth: 200,
             prop: 'orderNo',
             label: '订单编码',
             align: 'center',
-            slot: 'orderNo',
-            fixed: 'left'
+            slot: 'orderNo'
           },
 
           {
@@ -861,8 +866,6 @@
             prop: 'pricingWay',
             label: '计价方式',
             align: 'center',
-            fixed: 'left',
-
             formatter: (row, column) => {
               return pricingWayList.find((item) => item.id == row.pricingWay)
                 ?.name;
@@ -882,6 +885,13 @@
             align: 'center',
             formatter: (row) => row.systemBatchNo || '-'
           },
+          {
+            width: 150,
+            prop: 'reelSpecification',
+            label: '盘具',
+            slot: 'reelSpecification',
+            align: 'center'
+          },
           {
             width: 160,
             prop: 'productBrand',
@@ -1241,7 +1251,7 @@
             slot: 'remark',
             align: 'center'
           },
-          // 动态扩展字段默认排在最后(操作列固定在右侧,需留在最后)
+          // 动态扩展字段默认排在最后(操作列仍需排在末尾)
           ...this.dynamicsColumns,
           {
             columnKey: 'action',
@@ -1250,7 +1260,6 @@
             align: 'center',
             resizable: false,
             slot: 'action',
-            fixed: 'right',
             showOverflowTooltip: true
           }
         ]);
@@ -1288,6 +1297,10 @@
       this.syncColumnsSettingCache(this.dynamicsColumns);
     },
     methods: {
+      handleInventoryColumnsChange() {
+        this.handleColumnChange();
+        this.syncColumnsSettingCache(this.dynamicsColumns);
+      },
       // 覆写 mixin 的 getTabColumns:服务端列配置写入缓存后,动态列可能
       // 尚未到达、且服务端旧清单里操作列可能卡在中间——这里统一再归位一次
       //(dynamicsColumns 到达时 watch 也会兜一次,两者谁后到都以这次为准)
@@ -1321,7 +1334,7 @@
               added = true;
             }
           });
-          // 操作列固定在最右侧,列设置面板里也应排在最后:
+          // 操作列排在最后,列设置面板里也应排在最后:
           // 缓存顺序继承自服务端旧列清单,操作列可能卡在中间,这里统一归位
           const actionIdx = cached.findIndex(
             (c) => (c.columnKey || c.prop) === 'action' || c.label === '操作'
@@ -1332,8 +1345,21 @@
             cached.push(action);
             moved = true;
           }
-          if (added || moved) {
+          // 旧列设置里的 fixed 优先于列定义;清掉主表固定列,避免盖住横向滚动条。
+          let unfixed = false;
+          cached.forEach((col) => {
+            const key = col.columnKey || col.prop || col.id;
+            if (
+              ['selection', 'index', 'orderNo', 'pricingWay', 'action'].includes(key) &&
+              col.fixed
+            ) {
+              col.fixed = false;
+              unfixed = true;
+            }
+          });
+          if (added || moved || unfixed) {
             this.setStorage(storageKey, cached);
+            if (unfixed) this.columnsVersion++;
             // 同步服务端列配置(复用 mixin 的防抖保存),避免下次进入时
             // 服务端旧配置先到又把缓存覆盖回去
             if (this.debouncedSaveColumns) {
@@ -1487,6 +1513,7 @@
           this.$set(row, 'batchStockId', '');
           this.$set(row, 'batchNo', '');
           this.$set(row, 'systemBatchNo', '');
+          this.$set(row, 'reelSpecification', '');
         }
         const batchStockId = row.batchStockId;
         // 换仓后原仓库的批次失效,先清空再拉新仓库的批次
@@ -1528,6 +1555,7 @@
           this.$set(this.form.datasource[index], 'batchStockId', '');
           this.$set(this.form.datasource[index], 'batchNo', '');
           this.$set(this.form.datasource[index], 'systemBatchNo', '');
+          this.$set(this.form.datasource[index], 'reelSpecification', '');
           // 仓库列表改成懒加载后,这里不再预取仓库列表
           // this.$set(this.form.datasource[index], 'warehouseNum', '');
 
@@ -1550,6 +1578,11 @@
           return;
         }
         this.$set(this.form.datasource[index], 'batchNo', data.batchNo);
+        this.$set(
+          this.form.datasource[index],
+          'reelSpecification',
+          data.reelSpecification || ''
+        );
         this.$set(
           this.form.datasource[index],
           'systemBatchNo',
@@ -2106,6 +2139,9 @@
           if (matched.length == 1) {
             row.batchStockId = matched[0].id;
             row.systemBatchNo = matched[0].systemBatchNo || '';
+            if (row.reelSpecification == null) {
+              row.reelSpecification = matched[0].reelSpecification || '';
+            }
             this.$set(row, 'batchNoList', (list || []).slice());
             stockRows.push(row);
           } else {

+ 7 - 0
src/views/saleManage/saleOrder/invoice/components/inventoryTableDetails.vue

@@ -137,6 +137,13 @@
             align: 'center',
             formatter: (row) => row.systemBatchNo || '-'
           },
+          {
+            width: 150,
+            prop: 'reelSpecification',
+            label: '盘具',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
           {
             width: 160,
             prop: 'productBrand',

+ 7 - 0
src/views/saleManage/saleOrder/invoice/components/product-listNew.vue

@@ -174,6 +174,13 @@ import tabMixins from '@/mixins/tableColumnsMixin';
             slot: 'productCode',
             align: 'center'
           },
+          {
+            width: 150,
+            prop: 'reelSpecification',
+            label: '盘具',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
           {
             width: 200,
             prop: 'productCategoryName',