ソースを参照

Merge remote-tracking branch 'origin/dev' into dev

lucw 3 日 前
親
コミット
8280ca2585

+ 8 - 0
AGENTS.md

@@ -1,5 +1,13 @@
 # 前端数据契约
 
+- 需求管理 `purchaseNeedManage/components/detailDialog.vue` 关闭后须把 `form`、`detailData` 重置为对象,并把 `activeComp` 恢复为 `main`;组件没有 `formDef`,不可用 `copyObj(this.formDef)` 重置,否则再次打开时接口尚未返回,模板读取 `form.sourceTypeName` 会报错。流程页仅在 `processInstanceId` 非空时显示流程;为空时显示“暂无流程记录”,因为审批关闭时后端可直接将新需求置为已审核而不创建流程实例。
+
+- 销售发货新增/修改弹窗的物品清单使用 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',

+ 8 - 6
src/views/purchasingManage/purchaseNeedManage/components/detailDialog.vue

@@ -157,6 +157,10 @@
       v-if="activeComp === 'bpm' && form.processInstanceId"
       :id="form.processInstanceId"
     ></bpmDetail>
+    <el-empty
+      v-else-if="activeComp === 'bpm' && !loading"
+      description="暂无流程记录"
+    ></el-empty>
     <timeDialog ref="timeDialogRef" :view="true"></timeDialog>
 
     <div slot="footer" class="footer">
@@ -169,7 +173,6 @@
   import { getDetail } from '@/api/purchasingManage/purchaseNeedManage';
   import { getFile } from '@/api/system/file';
   import dictMixins from '@/mixins/dictMixins';
-  import { copyObj } from '@/utils/util';
   import bpmDetail from '@/views/bpm/processInstance/detail.vue';
   import timeDialog from '@/components/timeDialog/index.vue';
   // import fileMain from '@/components/addDoc/index';
@@ -198,6 +201,7 @@
           { key: 'bpm', name: '流程详情' }
         ],
         visible: false,
+        loading: false,
         title: '详情',
         row: {},
         form: {},
@@ -458,11 +462,9 @@
       },
       cancel() {
         this.$nextTick(() => {
-          // 关闭后,销毁所有的表单数据
-          (this.form = copyObj(this.formDef)),
-            (this.otherForm = copyObj(this.otherFormDef)),
-            (this.tableBankData = []);
-          this.tableLinkData = [];
+          this.form = {};
+          this.detailData = {};
+          this.activeComp = 'main';
           this.visible = false;
         });
       },

+ 15 - 6
src/views/purchasingManage/purchaseOrder/outSourceSend/components/addOrEditDialog.vue

@@ -218,7 +218,9 @@
         businessId: '',
         // 采购订单关联的采购计划 id / 计划回写的默认仓库映射(按产品匹配)
         purchasePlanId: '',
-        planWarehouse: null
+        planWarehouse: null,
+        // 订单详情请求序号:切换订单时丢弃过期响应
+        orderDetailSeq: 0
       };
     },
 
@@ -230,6 +232,8 @@
         this.row = row;
         this.purchasePlanId = purchasePlanId || '';
         this.planWarehouse = null;
+        // 使上一次打开时未返回的订单详情请求失效,避免把旧数据写进本次弹窗
+        this.orderDetailSeq = this.orderDetailSeq + 1;
         if (orderId) {
           await this.getPurchaseOrderDetail(orderId);
         }
@@ -304,15 +308,18 @@
       },
       //获取订单详情
       async getPurchaseOrderDetail(id) {
+        const seq = (this.orderDetailSeq = this.orderDetailSeq + 1);
         this.loading = true;
         const data = await getByIdCondition(id, 1);
-        this.loading = false;
+        if (seq !== this.orderDetailSeq) return;
         if (data) {
           // 订单未直接带出仓库时,按关联采购计划回写的默认仓库预选明细行仓库
-          this.planWarehouse =
-            (await this.getPlanWarehouse(
-              this.purchasePlanId || data.purchasePlanId
-            )) || null;
+          const planWarehouse = await this.getPlanWarehouse(
+            this.purchasePlanId || data.purchasePlanId
+          );
+          if (seq !== this.orderDetailSeq) return;
+          this.loading = false;
+          this.planWarehouse = planWarehouse || null;
           this.$nextTick(() => {
             let {
               partbId,
@@ -344,6 +351,8 @@
             this.$refs.inventoryTableref &&
               this.$refs.inventoryTableref.putTableValue(productList);
           });
+        } else {
+          this.loading = false;
         }
       },
 

+ 3 - 11
src/views/purchasingManage/purchaseOrder/outSourceSend/components/inventoryTable.vue

@@ -975,9 +975,8 @@
             }
             const warehouseList =
               (await getIdWarehouseList({ categoryId: item.productId })) || [];
-            // 采购计划回写的仓库(warehouseId/warehouseName/warehouseCode)优先回显,
-            // 不在该行可选仓库内时补到选项里,保证仓库名称按计划数据显示
-            // 按产品精确命中的计划仓库优先;整单默认仓库只在明细行自身没有仓库时使用
+            // 采购计划回写的仓库在校验过的可选仓库内才预选:按产品精确命中的优先,
+            // 整单默认仓库只在明细行自身没有仓库时使用;不在可选范围(权限)内不预选
             const specificWarehouse =
               this.planWarehouse?.[String(item.productId)] ||
               this.planWarehouse?.[String(item.categoryId)] ||
@@ -999,14 +998,7 @@
                     planWarehouse.warehouseCode &&
                     String(w.warehouseCode) ===
                       String(planWarehouse.warehouseCode)
-                ) || {
-                  warehouseId: planWarehouse.warehouseId,
-                  warehouseName: planWarehouse.warehouseName,
-                  warehouseCode: planWarehouse.warehouseCode
-                };
-              if (!warehouseList.includes(planMatched)) {
-                warehouseList.unshift(planMatched);
-              }
+                );
             }
             this.$set(
               this.form.datasource[index],

+ 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"
@@ -148,6 +148,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>
@@ -823,23 +831,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'
           },
 
           {
@@ -868,8 +873,6 @@
             prop: 'pricingWay',
             label: '计价方式',
             align: 'center',
-            fixed: 'left',
-
             formatter: (row, column) => {
               return pricingWayList.find((item) => item.id == row.pricingWay)
                 ?.name;
@@ -889,6 +892,13 @@
             align: 'center',
             formatter: (row) => row.systemBatchNo || '-'
           },
+          {
+            width: 150,
+            prop: 'reelSpecification',
+            label: '盘具',
+            slot: 'reelSpecification',
+            align: 'center'
+          },
           {
             width: 160,
             prop: 'productBrand',
@@ -1248,7 +1258,7 @@
             slot: 'remark',
             align: 'center'
           },
-          // 动态扩展字段默认排在最后(操作列固定在右侧,需留在最后)
+          // 动态扩展字段默认排在最后(操作列仍需排在末尾)
           ...this.dynamicsColumns,
           {
             columnKey: 'action',
@@ -1257,7 +1267,6 @@
             align: 'center',
             resizable: false,
             slot: 'action',
-            fixed: 'right',
             showOverflowTooltip: true
           }
         ]);
@@ -1295,6 +1304,10 @@
       this.syncColumnsSettingCache(this.dynamicsColumns);
     },
     methods: {
+      handleInventoryColumnsChange() {
+        this.handleColumnChange();
+        this.syncColumnsSettingCache(this.dynamicsColumns);
+      },
       // 覆写 mixin 的 getTabColumns:服务端列配置写入缓存后,动态列可能
       // 尚未到达、且服务端旧清单里操作列可能卡在中间——这里统一再归位一次
       //(dynamicsColumns 到达时 watch 也会兜一次,两者谁后到都以这次为准)
@@ -1328,7 +1341,7 @@
               added = true;
             }
           });
-          // 操作列固定在最右侧,列设置面板里也应排在最后:
+          // 操作列排在最后,列设置面板里也应排在最后:
           // 缓存顺序继承自服务端旧列清单,操作列可能卡在中间,这里统一归位
           const actionIdx = cached.findIndex(
             (c) => (c.columnKey || c.prop) === 'action' || c.label === '操作'
@@ -1339,8 +1352,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) {
@@ -1494,6 +1520,7 @@
           this.$set(row, 'batchStockId', '');
           this.$set(row, 'batchNo', '');
           this.$set(row, 'systemBatchNo', '');
+          this.$set(row, 'reelSpecification', '');
         }
         const batchStockId = row.batchStockId;
         // 换仓后原仓库的批次失效,先清空再拉新仓库的批次
@@ -1535,6 +1562,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', '');
 
@@ -1557,6 +1585,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',
@@ -2113,6 +2146,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',

+ 3 - 3
vue.config.js

@@ -2,7 +2,7 @@
  * @Author: mlchen 374826075@qq.com
  * @Date: 2026-07-22 15:43:30
  * @LastEditors: mlchen 374826075@qq.com
- * @LastEditTime: 2026-11-17 15:45:12
+ * @LastEditTime: 2026-11-19 17:00:39
  * @FilePath: /kd-aiot-frontend-eom/vue.config.js
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -61,12 +61,12 @@ module.exports = {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
         // target: 'http://192.168.1.251:18086', //开发
-        target: 'http://localhost:18086', //开发 // 本地联调临时指向本机后端(2026-11-05,联调后还原)
+        // target: 'http://localhost:18086', //开发 // 本地联调临时指向本机后端(2026-11-05,联调后还原)
         // target: 'http://192.168.1.251:18186', //测试
         // target: 'http://192.168.1.15:18086',//罗
         // target: 'http://192.168.1.144:18086',//付
         // target: 'http://192.168.1.9:18086', //c
-        // target: 'https://aiot.zoomwin.com.cn:51001/api',
+        target: 'https://aiot.zoomwin.com.cn:51001/api',
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''