更新工序工价、库存查询、库位、领料、出库明细、入库等仓储模块,新增采购合同入库单移动端设计及SQL脚本

This commit is contained in:
Developer
2026-07-23 08:45:50 +08:00
parent 2b9058c69c
commit 33549c3787
17 changed files with 1124 additions and 46 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,120 @@
# 采购合同生成入库单移动端组件设计方案
## 目标
在不改动现有采购合同查询组件 `src/views/PurchasingManagement/OrderInquiry/index.vue` 的前提下,将其中“生成入库单”功能设计为一个独立的新组件,优先适配手机和平板操作,同时在桌面端保持可用。
![采购合同生成入库单移动端预览](./采购合同生成入库单移动端预览.svg)
## 现状梳理
现有入口位于采购合同查询页面工具栏,按钮触发 `addArrivalNotice()`,打开 `width="1000px"``el-dialog`。弹窗内包含供应商选择、合同号选择、查询、入库单号展示、合同明细表、到货数量输入、是否质检开关、推送部门展示、到货汇总、提交和取消。
现有逻辑主要包含:
- `getArrivalContract()`:按供应商加载可生成入库单的采购合同。
- `searchArrivalDetail()`:按供应商和合同查询合同明细,并读取后端返回的入库单号。
- `submitArrivalNotice()`:筛选本次到货数量大于 0 的明细,按是否质检拆分提示,并调用新增接口提交。
- 涉及接口名称包括 `仓储管理_采购入库合同_查询``采购管理_采购入库合同明细_查询``采购管理_到货内容_新增`
当前问题是弹窗宽度固定、明细依赖横向表格,手机端选择合同、输入到货数量、切换质检开关和确认汇总都不方便。
## 新组件建议
建议新增独立视图组件:
`src/views/PurchasingManagement/PurchaseInboundCreateMobile/index.vue`
也可以在后续实现时拆成业务组件:
`src/components/PurchaseInboundCreateMobile/index.vue`
若需要菜单直接访问,使用视图路径;若只作为其他页面内嵌入口,使用组件路径。为了满足“单独做一个新组件方便移动端使用”,本方案优先建议新增视图组件,后端配置菜单后通过动态路由进入,不影响原采购合同查询页面。
## 页面布局
移动端采用单列流程:
1. 顶部固定标题区:显示“生成入库单”、当前状态、返回按钮。
2. 查询条件区:供应商、合同号使用整行选择框,合同号随供应商联动加载。
3. 单据摘要区:展示入库单号、本次到货物料数、需质检数、直入库数。
4. 明细卡片区:每个物料一张卡片,展示合同号、物料名称、图号或型号、采购数、已到数、可到数。
5. 卡片操作区:到货数量使用 `el-input-number`,质检使用 `el-switch`,推送部门用标签显示“质检部/仓库”。
6. 底部固定操作栏:提交入库单、清空本次数量。
桌面端自适应为双栏:
- 左侧为条件和摘要。
- 右侧为明细表格或卡片网格。
- 最大宽度控制在内容区内,不再使用固定 1000px 弹窗。
## 交互流程
1. 用户进入新组件。
2. 选择供应商,组件调用合同查询接口刷新合同列表。
3. 选择合同号后自动查询明细,也保留“查询”按钮用于手动刷新。
4. 明细默认 `到货数量=0``需要质检=false`
5. 用户填写某一行到货数量后,该行质检开关可操作。
6. 汇总区实时计算本次到货条数、需质检条数、直入库条数。
7. 提交前校验至少一条明细 `到货数量 > 0`,并校验到货数量不超过 `采购数 - 已到数`
8. 提交成功后提示成功、清空当前明细或停留展示结果,由实现时按现场使用习惯确定。
## 数据设计
组件内部建议沿用原页面字段,不新增后端字段:
- `arrivalSupplierName`:供应商流水号。
- `arrivalContractNo`:采购合同流水号。
- `arrivalContractLabel`:采购合同编号。
- `入库单号`:后端返回的入库单号。
- `arrivalTableData`:合同明细数组。
- `到货数量`:前端临时输入字段。
- `需要质检`:前端临时开关字段。
提交参数继续沿用原逻辑:
- `通知内容`
- `发起人`
- `采购合同流水号`
- `到货数组`
- `物料流水号组`
- `质检标志组`
- `采购合同`
- `供应商流水号`
- `入库单号`
## 技术实现要点
- 使用 Vue 2 Options API不使用 Composition API。
- 请求继续使用 `this.CreateData()``this.ExecDatabase()`,不单独封装新的请求客户端。
- 生命周期使用普通函数,不使用箭头函数。
- 移动端样式放在 `<style scoped>`,通过媒体查询控制桌面和手机布局。
- 断点建议:`max-width: 768px` 使用单列卡片和底部固定按钮;`min-width: 769px` 使用双栏或表格。
- 明细卡片保留中文字段访问,和后端返回字段保持一致。
- 组件创建后不修改采购合同查询组件;若后续需要入口,可以由菜单配置或新增移动端菜单进入。
## 样式建议
- 手机端避免 `el-table` 作为主要录入载体,改用卡片列表承载物料明细。
- 数量输入按钮高度不小于 36px底部提交按钮高度不小于 44px。
- 顶部和底部区域使用 `position: sticky` 或固定布局,方便长列表滚动时随时提交。
- 摘要区使用三个轻量统计块:本次到货、需质检、直入库。
- 质检状态用颜色区分:需质检为橙色,直入库为绿色。
## 实施步骤
1. 新增 `PurchaseInboundCreateMobile/index.vue`,复制并整理原生成入库单相关 data、computed、methods。
2. 将明细展示从表格改为移动端卡片,桌面端可保留表格或两列卡片。
3. 增加响应式样式和底部固定提交栏。
4. 本地验证供应商联动、合同明细查询、数量上限、质检开关、汇总和提交参数。
5. 由后端配置菜单,指向新组件路径,原采购合同查询组件保持不动。
## 验收标准
- 手机端宽度 375px 下不出现横向滚动。
- 到货数量、质检开关、提交按钮在触屏下易点击。
- 提交参数与原弹窗一致。
- 原采购合同查询页面行为不变。
- 新组件可通过动态路由单独打开。
修改人:Ld 修改时间:2026-07-21 13:10:54;

View File

@@ -0,0 +1,98 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1320" height="860" viewBox="0 0 1320 860">
<rect width="1320" height="860" fill="#eef2f7"/>
<text x="64" y="62" font-family="Microsoft YaHei, Arial, sans-serif" font-size="28" font-weight="700" fill="#1f2937">采购合同生成入库单 - 移动端新组件预览</text>
<text x="64" y="96" font-family="Microsoft YaHei, Arial, sans-serif" font-size="16" fill="#64748b">独立组件,不改动采购合同查询原页面;手机优先,桌面端自适应为双栏。</text>
<g transform="translate(110,130)">
<rect x="0" y="0" width="390" height="690" rx="32" fill="#111827"/>
<rect x="14" y="16" width="362" height="658" rx="24" fill="#f8fafc"/>
<rect x="150" y="30" width="90" height="8" rx="4" fill="#111827" opacity=".35"/>
<rect x="14" y="52" width="362" height="74" fill="#ffffff"/>
<text x="32" y="86" font-family="Microsoft YaHei, Arial, sans-serif" font-size="19" font-weight="700" fill="#111827">生成入库单</text>
<text x="32" y="110" font-family="Microsoft YaHei, Arial, sans-serif" font-size="12" fill="#64748b">采购合同 CG-20260721001</text>
<rect x="278" y="76" width="76" height="28" rx="14" fill="#e0f2fe"/>
<text x="296" y="95" font-family="Microsoft YaHei, Arial, sans-serif" font-size="12" fill="#0369a1">待提交</text>
<rect x="30" y="146" width="330" height="118" rx="10" fill="#ffffff" stroke="#dbe3ef"/>
<text x="48" y="176" font-family="Microsoft YaHei, Arial, sans-serif" font-size="13" fill="#64748b">供应商</text>
<text x="48" y="202" font-family="Microsoft YaHei, Arial, sans-serif" font-size="17" font-weight="700" fill="#111827">江苏高精机械配件有限公司</text>
<line x1="48" y1="222" x2="342" y2="222" stroke="#e5e7eb"/>
<text x="48" y="245" font-family="Microsoft YaHei, Arial, sans-serif" font-size="13" fill="#64748b">合同号</text>
<text x="112" y="245" font-family="Microsoft YaHei, Arial, sans-serif" font-size="13" fill="#2563eb">点击切换</text>
<g transform="translate(30,282)">
<rect x="0" y="0" width="104" height="62" rx="10" fill="#ecfdf5"/>
<text x="16" y="25" font-family="Microsoft YaHei, Arial, sans-serif" font-size="12" fill="#047857">本次到货</text>
<text x="16" y="50" font-family="Arial, sans-serif" font-size="24" font-weight="700" fill="#065f46">8</text>
<rect x="113" y="0" width="104" height="62" rx="10" fill="#fff7ed"/>
<text x="129" y="25" font-family="Microsoft YaHei, Arial, sans-serif" font-size="12" fill="#c2410c">需质检</text>
<text x="129" y="50" font-family="Arial, sans-serif" font-size="24" font-weight="700" fill="#9a3412">3</text>
<rect x="226" y="0" width="104" height="62" rx="10" fill="#eff6ff"/>
<text x="242" y="25" font-family="Microsoft YaHei, Arial, sans-serif" font-size="12" fill="#1d4ed8">直入库</text>
<text x="242" y="50" font-family="Arial, sans-serif" font-size="24" font-weight="700" fill="#1e40af">5</text>
</g>
<g transform="translate(30,366)">
<rect x="0" y="0" width="330" height="118" rx="12" fill="#ffffff" stroke="#dbe3ef"/>
<text x="18" y="30" font-family="Microsoft YaHei, Arial, sans-serif" font-size="16" font-weight="700" fill="#111827">轴承座 / LRS250-01MP</text>
<text x="18" y="55" font-family="Microsoft YaHei, Arial, sans-serif" font-size="12" fill="#64748b">采购数 20 · 已到 12 · 可到 8</text>
<rect x="18" y="73" width="118" height="30" rx="6" fill="#f1f5f9"/>
<text x="34" y="94" font-family="Microsoft YaHei, Arial, sans-serif" font-size="13" fill="#111827">到货数量 4</text>
<rect x="234" y="73" width="78" height="30" rx="15" fill="#fef3c7"/>
<text x="252" y="94" font-family="Microsoft YaHei, Arial, sans-serif" font-size="13" fill="#92400e">质检</text>
</g>
<g transform="translate(30,498)">
<rect x="0" y="0" width="330" height="118" rx="12" fill="#ffffff" stroke="#dbe3ef"/>
<text x="18" y="30" font-family="Microsoft YaHei, Arial, sans-serif" font-size="16" font-weight="700" fill="#111827">直线导轨 / HGH25CA</text>
<text x="18" y="55" font-family="Microsoft YaHei, Arial, sans-serif" font-size="12" fill="#64748b">采购数 10 · 已到 0 · 可到 10</text>
<rect x="18" y="73" width="118" height="30" rx="6" fill="#f1f5f9"/>
<text x="34" y="94" font-family="Microsoft YaHei, Arial, sans-serif" font-size="13" fill="#111827">到货数量 4</text>
<rect x="234" y="73" width="78" height="30" rx="15" fill="#dcfce7"/>
<text x="252" y="94" font-family="Microsoft YaHei, Arial, sans-serif" font-size="13" fill="#166534">仓库</text>
</g>
<rect x="14" y="612" width="362" height="62" fill="#ffffff"/>
<rect x="30" y="624" width="330" height="40" rx="20" fill="#2563eb"/>
<text x="142" y="650" font-family="Microsoft YaHei, Arial, sans-serif" font-size="15" font-weight="700" fill="#ffffff">提交入库单</text>
</g>
<g transform="translate(575,154)">
<rect x="0" y="0" width="650" height="512" rx="12" fill="#ffffff" stroke="#dbe3ef"/>
<rect x="0" y="0" width="650" height="64" rx="12" fill="#f8fafc"/>
<text x="28" y="40" font-family="Microsoft YaHei, Arial, sans-serif" font-size="20" font-weight="700" fill="#111827">桌面端自适应状态</text>
<rect x="28" y="92" width="210" height="74" rx="8" fill="#f8fafc" stroke="#dbe3ef"/>
<text x="46" y="121" font-family="Microsoft YaHei, Arial, sans-serif" font-size="13" fill="#64748b">供应商</text>
<text x="46" y="148" font-family="Microsoft YaHei, Arial, sans-serif" font-size="15" font-weight="700" fill="#111827">江苏高精机械配件有限公司</text>
<rect x="258" y="92" width="210" height="74" rx="8" fill="#f8fafc" stroke="#dbe3ef"/>
<text x="276" y="121" font-family="Microsoft YaHei, Arial, sans-serif" font-size="13" fill="#64748b">合同号</text>
<text x="276" y="148" font-family="Microsoft YaHei, Arial, sans-serif" font-size="15" font-weight="700" fill="#111827">CG-20260721001</text>
<rect x="488" y="92" width="134" height="74" rx="8" fill="#eff6ff" stroke="#bfdbfe"/>
<text x="506" y="121" font-family="Microsoft YaHei, Arial, sans-serif" font-size="13" fill="#1d4ed8">入库单号</text>
<text x="506" y="148" font-family="Microsoft YaHei, Arial, sans-serif" font-size="15" font-weight="700" fill="#1e40af">RKD260721</text>
<rect x="28" y="196" width="594" height="48" rx="8" fill="#f1f5f9"/>
<text x="48" y="226" font-family="Microsoft YaHei, Arial, sans-serif" font-size="14" fill="#334155">明细以卡片/表格双模式展示:移动端卡片,桌面端表格;同一数据源和提交参数。</text>
<g transform="translate(28,270)">
<rect x="0" y="0" width="594" height="50" fill="#f8fafc" stroke="#dbe3ef"/>
<text x="20" y="31" font-family="Microsoft YaHei, Arial, sans-serif" font-size="13" font-weight="700" fill="#334155">物料</text>
<text x="238" y="31" font-family="Microsoft YaHei, Arial, sans-serif" font-size="13" font-weight="700" fill="#334155">可到</text>
<text x="336" y="31" font-family="Microsoft YaHei, Arial, sans-serif" font-size="13" font-weight="700" fill="#334155">本次到货</text>
<text x="488" y="31" font-family="Microsoft YaHei, Arial, sans-serif" font-size="13" font-weight="700" fill="#334155">去向</text>
<rect x="0" y="50" width="594" height="56" fill="#ffffff" stroke="#dbe3ef"/>
<text x="20" y="84" font-family="Microsoft YaHei, Arial, sans-serif" font-size="13" fill="#111827">轴承座 / LRS250-01MP</text>
<text x="250" y="84" font-family="Arial, sans-serif" font-size="14" fill="#111827">8</text>
<text x="368" y="84" font-family="Arial, sans-serif" font-size="14" fill="#111827">4</text>
<text x="488" y="84" font-family="Microsoft YaHei, Arial, sans-serif" font-size="13" fill="#92400e">质检部</text>
<rect x="0" y="106" width="594" height="56" fill="#ffffff" stroke="#dbe3ef"/>
<text x="20" y="140" font-family="Microsoft YaHei, Arial, sans-serif" font-size="13" fill="#111827">直线导轨 / HGH25CA</text>
<text x="250" y="140" font-family="Arial, sans-serif" font-size="14" fill="#111827">10</text>
<text x="368" y="140" font-family="Arial, sans-serif" font-size="14" fill="#111827">4</text>
<text x="488" y="140" font-family="Microsoft YaHei, Arial, sans-serif" font-size="13" fill="#166534">仓库</text>
</g>
</g>
<!-- 修改人:Ld 修改时间:2026-07-21 13:10:54; -->
</svg>

After

Width:  |  Height:  |  Size: 8.4 KiB

BIN
docs/调研报告.docx Normal file

Binary file not shown.

BIN
docs/调研报告.pdf Normal file

Binary file not shown.

View File

@@ -0,0 +1,139 @@
ALTER PROCEDURE [dbo].[_零件工序_取消派工]
@ INT = NULL,
@ INT = NULL,
@ INT = NULL,
@退 INT = NULL,
@ INT = NULL
AS
BEGIN
SET NOCOUNT ON;
SET XACT_ABORT ON;
DECLARE @ INT;
DECLARE @ FLOAT;
DECLARE @ INT;
DECLARE @ INT;
DECLARE @ INT;
DECLARE @ NVARCHAR(50);
DECLARE @ NVARCHAR(50);
DECLARE @ INT;
DECLARE @ INT;
DECLARE @ INT;
DECLARE @n INT = 0;
BEGIN TRY
BEGIN TRANSACTION;
SELECT
@ = ,
@ = ISNULL(, 0),
@ = ISNULL(, 0)
FROM dbo._零件工序_任务分配 WITH (UPDLOCK, HOLDLOCK)
WHERE = @
AND = @;
IF @ IS NULL
BEGIN
RAISERROR(N'派工任务不存在或已取消', 16, 1);
END;
IF @ > 0 OR @ > 0
BEGIN
RAISERROR(N'零件已加工或加工中,不能取消派工', 16, 1);
END;
IF ISNULL(@, 0) <= 0
BEGIN
RAISERROR(N'派工数量异常,不能取消派工', 16, 1);
END;
SELECT
@ = ,
@ =
FROM dbo._零件工序
WHERE = @;
IF @ = 1
BEGIN
SELECT
@ = RTRIM(LTRIM()) + N'MP',
@ = + N'MP'
FROM dbo._零件工艺计划_视图
WHERE = @;
SELECT @ =
FROM dbo._物料主文件_基本
WHERE RTRIM(LTRIM()) = @
AND RTRIM(LTRIM()) = @
AND ISNULL(, 0) = 0;
IF @ IS NOT NULL
BEGIN
SELECT
@ = COUNT(*),
@ = MAX()
FROM dbo._物料出库_出库记录 WITH (UPDLOCK, HOLDLOCK)
WHERE = @
AND = @
AND ISNULL(, 0) - ISNULL(退, 0) >= @;
IF ISNULL(@, 0) > 1
BEGIN
RAISERROR(N'同一订单同一毛坯存在多条可退出库记录,请先人工确认出库记录', 16, 1);
END;
IF ISNULL(@, 0) = 1
BEGIN
EXEC dbo._退料入库_执行
@ = @,
@退 = @,
@退 = @退;
END;
END;
END;
UPDATE dbo._零件工序
SET = ISNULL(, 0) - @
WHERE = @
AND ISNULL(, 0) >= @;
IF @@ROWCOUNT = 0
BEGIN
RAISERROR(N'工序已分配数不足,取消派工失败', 16, 1);
END;
DELETE FROM dbo._零件工序_任务分配
WHERE = @
AND = @;
IF @@ROWCOUNT = 0
BEGIN
RAISERROR(N'派工任务删除失败', 16, 1);
END;
SELECT @n = COUNT(*)
FROM dbo._零件工序_任务分配
WHERE IN
(
SELECT
FROM dbo._零件工序
WHERE = @
);
IF @n = 0
BEGIN
UPDATE dbo._零件工艺计划
SET = NULL
WHERE = @;
END;
COMMIT TRANSACTION;
SELECT '1' AS result;
END TRY
BEGIN CATCH
IF @@TRANCOUNT > 0
ROLLBACK TRANSACTION;
SELECT '0' AS result, ERROR_MESSAGE() AS msg;
END CATCH;
END;

View File

@@ -0,0 +1,73 @@
CREATE PROCEDURE [dbo].[_零件工序_取消派工]
@ int = null,
@ int = null,
@ int = null,
@退 int =null,
@ int = null
AS
declare @ int
declare @n int = 0
declare @ nvarchar(50)
declare @ nvarchar(50)
declare @ int
select @= from _零件工序 where =@
select @=+'MP',@ = +'MP' from _零件工艺计划_视图 where = @
select @ = from _出库记录_视图 where = @ AND = @ AND = @
if(@>0)
begin
EXEC _退料入库_执行 @,@,@退
end
update _零件工序 set = ISNULL(,0) - @ where =@
delete from _零件工序_任务分配 where =@
select @n=count(*) from _零件工序_任务分配 where in (select from _零件工序 where =@)
if @n = 0
begin
update _零件工艺计划 set = NULL where =@
end

View File

@@ -0,0 +1,146 @@
CREATE PROCEDURE [dbo].[_零件工序_取消派工]
@ INT = NULL,
@ INT = NULL,
@ INT = NULL,
@退 INT = NULL,
@ INT = NULL
AS
BEGIN
SET NOCOUNT ON;
SET XACT_ABORT ON;
DECLARE @ INT;
DECLARE @ FLO
AT;
DECLARE @ INT;
DECLARE @ INT;
DECLARE @ NVARCHAR(50);
DECLARE @ NVARCHAR(50);
DECLARE @ INT;
DECLARE @ INT;
DECLARE @ INT;
DECLARE @n INT = 0;
BEGIN TRY
BEGIN TRANSACTION;
SELECT
@ = ,
@ = ISNULL(, 0),
@ = ISNULL(, 0)
FROM dbo._零件工序_任务分配 WITH (UPDLOCK, HOLDLOCK)
WHERE = @
AND = @;
IF @
IS NULL
BEGIN
RAISERROR(N'派工任务不存在或已取消', 16, 1);
END;
IF @ > 0 OR @ > 0
BEGIN
RAISERROR(N'零件已加工或加工中,不能取消派工', 16, 1);
END;
IF ISNULL(@, 0) <= 0
BEGIN
RAISERROR(N'派工数量异常,不能取消派工', 16, 1);
END;
SELECT @ =
FROM dbo._零件工序
WHERE = @;
SELECT
@ = RTRIM(LTRIM()) + N'MP',
@ = + N'MP'
FROM
dbo._零件工艺计划_视图
WHERE = @;
SELECT @ =
FROM dbo._物料主文件_基本
WHERE RTRIM(LTRIM()) = @
AND RTRIM(LTRIM()) = @
AND ISNULL(, 0) = 0;
IF @ IS NOT N
ULL
BEGIN
SELECT
@ = COUNT(*),
@ = MAX()
FROM dbo._物料出库_出库记录 WITH (UPDLOCK, HOLDLOCK)
WHERE = @
AND = @
AND ISNULL(, 0) - ISNULL(退, 0) >= @;
IF ISNULL(@, 0) > 1
BEGIN
RAISERROR(N'同一订单同一毛坯存在多条可退出库记录,请先人工确认出库记录', 16, 1);
END;
IF ISNULL(@, 0) = 1
BEGIN
EXEC dbo._退料入库_执行
@ = @,
@退 = @,
@退 = @退;
END;
END;
UPDATE dbo._零件工序
SET = ISNULL(, 0) - @
WHERE = @
AND ISNULL(, 0) >= @;
IF @@ROWCOUNT = 0
BEGIN
RAISERROR(N'工序已分配数不足,取消派工失败', 16, 1);
END;
DELETE FROM dbo._零件工序_任务分配
WHERE = @
AN
D = @;
IF @@ROWCOUNT = 0
BEGIN
RAISERROR(N'派工任务删除失败', 16, 1);
END;
SELECT @n = COUNT(*)
FROM dbo._零件工序_任务分配
WHERE IN
(
SELECT
FROM
dbo._零件工序
WHERE = @
);
IF @n = 0
BEGIN
UPDATE dbo._零件工艺计划
SET = NULL
WHERE = @;
END;
COMMIT TRANSACTION;
SELECT '1' AS result;
END TRY
BEGIN CATCH
IF @@TRANCOUNT > 0
ROLLBACK TRANSACTION;
SELECT '0' AS result, ERROR_MESSAGE() AS msg;
END CATCH;
END;

View File

@@ -450,24 +450,53 @@ export default {
'id' 'id'
]) ])
}, },
watch: {
// 修改人:Ld 修改时间:2026-07-17 16:30:55; 同一路由再次跳转时组件会复用,监听 query 变化后重新赋值并查询
'$route.query': function(query) {
this.applyJumpQuery(query)
}
},
created() { created() {
// 修改人:Ld 修改时间:2026-07-17 08:44:08; 支持从工时统计跳转后按携带值直接查询工价 this.applyJumpQuery(this.$route.query, true)
if (this.$route.query.订单号) {
this.jumpQuery订单号 = this.$route.query.订单号
}
if (this.$route.query.零件名称 || this.$route.query.图号 || this.$route.query.工序名称) {
this.queryForm.零件名称 = this.$route.query.零件名称 || ''
this.queryForm.图号 = this.$route.query.图号 || ''
this.queryForm.工序名称 = this.$route.query.工序名称 || ''
this.jumpDirectQuery = true
}
this.getOrderNumberType() this.getOrderNumberType()
if (this.jumpDirectQuery) {
this.pageCurrent = 1
}
this.searchTable() this.searchTable()
}, },
methods: { methods: {
// 修改人:Ld 修改时间:2026-07-17 16:30:55; 统一处理工时统计跳转参数,避免再次跳转时保留上一次查询条件
applyJumpQuery(query) {
if (!query || (!query.订单号 && !query.零件名称 && !query.图号 && !query.工序名称)) {
return
}
this.jumpQuery订单号 = query.订单号 || ''
this.jumpDirectQuery = !!(query.零件名称 || query.图号 || query.工序名称)
this.jumpAutoCascade = false
if (this.jumpDirectQuery) {
this.queryForm.组件流水号 = ''
this.queryForm.工艺计划流水号 = ''
this.queryForm.零件名称 = query.零件名称 || ''
this.queryForm.图号 = query.图号 || ''
this.queryForm.工序名称 = query.工序名称 || ''
this.productName = []
this.partName = []
}
this.setJumpOrderValue()
this.pageCurrent = 1
this.searchTable()
},
// 修改人:Ld 修改时间:2026-07-17 16:30:55; 已加载订单下拉时,按跳转订单号补充订单流水号
setJumpOrderValue() {
if (!this.jumpQuery订单号 || !this.orderNumberType || this.orderNumberType.length === 0) {
return false
}
for (var i = 0; i < this.orderNumberType.length; i++) {
if (this.orderNumberType[i].label === this.jumpQuery订单号) {
this.queryForm.订单流水号 = this.orderNumberType[i].value
this.jumpQuery订单号 = ''
return true
}
}
return false
},
// 修改人:Ld 修改时间:2026-07-06 08:36:02 // 修改人:Ld 修改时间:2026-07-06 08:36:02
// 获取制定工艺组件同源订单下拉 // 获取制定工艺组件同源订单下拉
getOrderNumberType() { getOrderNumberType() {
@@ -481,11 +510,8 @@ export default {
value: response.data[i].订单流水号 value: response.data[i].订单流水号
}) })
} }
// 修改人:Ld 修改时间:2026-07-17 08:44:08; 跳转携带明细条件时仅补充订单赋值并按当前条件查询,避免自动选中第一个零件覆盖查询条件 // 修改人:Ld 修改时间:2026-07-17 16:30:55; 订单下拉异步加载完成后补充订单流水号,再按跳转条件查询
if (this.jumpQuery订单号) { if (this.setJumpOrderValue()) {
for (var j = 0; j < this.orderNumberType.length; j++) {
if (this.orderNumberType[j].label === this.jumpQuery订单号) {
this.queryForm.订单流水号 = this.orderNumberType[j].value
if (this.jumpDirectQuery) { if (this.jumpDirectQuery) {
this.pageCurrent = 1 this.pageCurrent = 1
this.searchTable() this.searchTable()
@@ -493,10 +519,6 @@ export default {
this.jumpAutoCascade = true this.jumpAutoCascade = true
this.getproductName() this.getproductName()
} }
this.jumpQuery订单号 = ''
break
}
}
} }
}) })
}, },

View File

@@ -478,22 +478,36 @@ export default {
}, },
getInventoryLocationRows(row) { getInventoryLocationRows(row) {
var param = [] var param = []
var materialName_check = row.物料名称 ? 1 : 0 var materialCode_check = row.物料编码 ? 1 : 0
var specificationsModel_check = row.图号或型号 ? 1 : 0 param[0] = ['物料名称_check', 0]
param[0] = ['物料名称_check', materialName_check] param[1] = ['物料名称', '']
param[1] = ['物料名称', row.物料名称] param[2] = ['图号或型号_check', 0]
param[2] = ['图号或型号_check', specificationsModel_check] param[3] = ['图号或型号', '']
param[3] = ['图号或型号', row.图号或型号]
param[4] = ['库位_check', 0] param[4] = ['库位_check', 0]
param[5] = ['库位', ''] param[5] = ['库位', '']
param[6] = ['排序名称', ''] param[6] = ['排序名称', '']
param[7] = ['排序方式', ''] param[7] = ['排序方式', '']
param[8] = ['物料编码_check', materialCode_check]
param[9] = ['物料编码', row.物料编码 || '']
var Data = this.CreateData('11', '仓储管理_库存盘点_查询', param) var Data = this.CreateData('11', '仓储管理_库存盘点_查询', param)
return this.ExecDatabase(Data).then(response => { return this.ExecDatabase(Data).then(response => {
var rows = response.data.rows || response.data || [] var rows = response.data.rows || response.data || []
// 备注:修改人:Ld 修改时间:2026-07-15 17:14:07; 库存小窗只显示有库存的库位和对应数量。 var locationMap = {}
return rows.filter(function(item) { // 备注:修改人:Ld 修改时间:2026-07-17 17:23:23; 库存小窗按物料编码精确过滤并按库位汇总,避免同名称或相似图号物料混入。
return Number(item.货位存量 || item.库存 || 0) > 0 rows.filter(function(item) {
return (!row.物料编码 || item.物料编码 === row.物料编码) && Number(item.货位存量 || item.库存 || 0) > 0
}).forEach(function(item) {
var locationName = item.货位名称 || ''
if (!locationMap[locationName]) {
locationMap[locationName] = {
货位名称: locationName,
货位存量: 0
}
}
locationMap[locationName].货位存量 = Number(locationMap[locationName].货位存量) + Number(item.货位存量 || item.库存 || 0)
})
return Object.keys(locationMap).map(function(key) {
return locationMap[key]
}) })
}) })
}, },

View File

@@ -7,10 +7,23 @@
<el-input v-model="DrawingNo" style="width: 200px " size="small" clearable placeholder="图号/型号"/> <el-input v-model="DrawingNo" style="width: 200px " size="small" clearable placeholder="图号/型号"/>
<el-input v-model="locationWarehouseValue" style="width:200px" placeholder="库位" size="small" clearable/> <el-input v-model="locationWarehouseValue" style="width:200px" placeholder="库位" size="small" clearable/>
<el-button style="margin-left: 7px;width: 80px" type="primary" plain size="small" @click="searchTable()">查询</el-button> <el-button style="margin-left: 7px;width: 80px" type="primary" plain size="small" @click="searchTable()">查询</el-button>
<!-- 修改人:Ld 修改时间:2026-07-22 10:17:30; 新增按Excel批量修改物料库位入口 -->
<el-button type="primary" icon="el-icon-upload2" style="margin-left: 7px" plain size="small" @click="openImportLocationDialog">导入修改库位</el-button>
<el-button type="primary" icon="el-icon-printer" style="margin-left: 7px" plain size="small" @click="printReceiptDoc1()">打印</el-button> <el-button type="primary" icon="el-icon-printer" style="margin-left: 7px" plain size="small" @click="printReceiptDoc1()">打印</el-button>
</div> </div>
<div> <div>
<el-table ref="table" v-loading="loading" :data="tableData" highlight-current-row show-summary border stripe size="small" style="width: 731px" height="740px" <!-- 修改人:Ld 修改时间:2026-07-22 09:59:17; 扩展表格宽度容纳修改库位操作列 -->
<el-table
v-loading="loading"
ref="table"
:data="tableData"
highlight-current-row
show-summary
border
stripe
size="small"
style="width: 880px"
height="740px"
@selection-change="handleSelectionChange"> @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50px"/> <el-table-column type="selection" width="50px"/>
<el-table-column :width="setColumnWidth('序号')" type="index" label="序号" align="center"/> <el-table-column :width="setColumnWidth('序号')" type="index" label="序号" align="center"/>
@@ -31,7 +44,31 @@
</el-table-column> </el-table-column>
<el-table-column label="库位" width="160px" align="center"> <el-table-column label="库位" width="160px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.货位名称 }} <!-- 修改人:Ld 修改时间:2026-07-22 09:59:17; 物料库位维护支持行内选择新库位 -->
<el-select
v-if="scope.row.edit"
v-model="scope.row.货位流水号"
size="mini"
style="width: 100%"
clearable
filterable
placeholder="请选择库位"
@change="handleLocationChange(scope.row)">
<el-option
v-for="item in storageLocation"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span v-else>{{ scope.row.货位名称 }}</span>
</template>
</el-table-column>
<!-- 修改人:Ld 修改时间:2026-07-22 09:59:17; 物料库位维护新增修改库位操作按钮 -->
<el-table-column label="操作" width="130px" align="center">
<template slot-scope="scope">
<el-button v-if="scope.row.edit" type="text" size="mini" @click="confirmEdit(scope.row)">确定</el-button>
<el-button v-if="scope.row.edit" type="text" size="mini" @click="cancelEdit(scope.row)">取消</el-button>
<el-button v-else type="text" size="mini" @click="openEdit(scope.row)">修改</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -47,6 +84,43 @@
@current-change="handleCurrentChanges"/> @current-change="handleCurrentChanges"/>
</div> </div>
</el-card> </el-card>
<!-- 修改人:Ld 修改时间:2026-07-22 10:17:30; 导入物料库位修改预校验与提交弹窗 -->
<el-dialog
v-el-drag-dialog
:visible.sync="dialogFormVisibleImportLocation"
title="导入修改库位"
center
width="1050px">
<upload-excel-component @on-selected-file="selectedImportLocation"/>
<div style="margin: 10px 0 0 45px">
<span v-show="importWorksheet.length > 1" style="cursor: pointer;width: 50px;" @click="removeAllImportLocation"><i class="el-icon-close"/></span>
<el-upload :on-remove="handleRemoveImportLocation" :file-list="importItemFile" style="width: 260px" action=""/>
</div>
<div style="margin: 12px 0">
<el-button type="primary" size="small" icon="el-icon-search" @click="previewImportLocation">预校验</el-button>
<el-button
:loading="importLocationSubmitting"
:disabled="importLocationData.length === 0"
type="success"
size="small"
icon="el-icon-check"
@click="submitImportLocation">确认修改</el-button>
<span style="margin-left: 12px;font-size: 13px;color: #606266">{{ importLocationSummary }}</span>
</div>
<el-table :data="importLocationData" border stripe size="mini" height="430px">
<el-table-column prop="导入序号" label="行号" width="70px" align="center"/>
<el-table-column prop="物料编码" label="物料编号" width="130px" align="center" show-overflow-tooltip/>
<el-table-column prop="物料名称" label="物料名称" width="160px" align="center" show-overflow-tooltip/>
<el-table-column prop="图号或型号" label="图号或型号" width="150px" align="center" show-overflow-tooltip/>
<el-table-column prop="原货位名称" label="原库位" width="100px" align="center" show-overflow-tooltip/>
<el-table-column prop="调整后库位" label="调整后库位" width="120px" align="center" show-overflow-tooltip/>
<el-table-column prop="处理状态" label="状态" width="100px" align="center"/>
<el-table-column prop="说明" label="说明" align="center" show-overflow-tooltip/>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogFormVisibleImportLocation=false">关闭</el-button>
</div>
</el-dialog>
<el-card v-show="false"> <el-card v-show="false">
<div style="width:900px;margin-left: 350px"> <div style="width:900px;margin-left: 350px">
<el-card> <el-card>
@@ -92,7 +166,9 @@ import { ExecDatabase } from '@/main'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import $ from 'jquery' import $ from 'jquery'
import { getNowDAY } from '@/utils' import { getNowDAY } from '@/utils'
import UploadExcelComponent from '@/views/TechnologyCenter/ImportBOM/UploadExcel/index.vue'
export default { export default {
components: { UploadExcelComponent },
data() { data() {
return { return {
NowTime: getNowDAY(), NowTime: getNowDAY(),
@@ -102,6 +178,13 @@ export default {
MaterialCode: '', MaterialCode: '',
MaterialName: '', MaterialName: '',
DrawingNo: '', DrawingNo: '',
dialogFormVisibleImportLocation: false, // 修改人:Ld 修改时间:2026-07-22 10:17:30; 导入修改库位弹窗。
importItemFile: [],
importWorksheet: [],
importLocationData: [],
importLocationDetailText: '',
importLocationDetailChunks: [],
importLocationSubmitting: false,
LocationName: '', LocationName: '',
materialName1: '', materialName1: '',
productName: [], productName: [],
@@ -110,6 +193,7 @@ export default {
total: 0, // 分页总数 total: 0, // 分页总数
tableData: [], // 合同信息表 tableData: [], // 合同信息表
tableData10: [], // 合同信息表 tableData10: [], // 合同信息表
storageLocation: [], // 修改人:Ld 修改时间:2026-07-22 09:59:17; 库位下拉数据用于修改物料库位。
pageCurrent: 1, // 分页当前页 pageCurrent: 1, // 分页当前页
pageSize: 20, // 分页每页显示条数 pageSize: 20, // 分页每页显示条数
orderName: '', // 排序列名 orderName: '', // 排序列名
@@ -120,12 +204,320 @@ export default {
...mapGetters([ ...mapGetters([
'id', 'id',
'token' 'token'
]) ]),
importLocationSummary() {
// 修改人:Ld 修改时间:2026-07-22 10:17:30; 汇总导入修改库位预校验和执行结果。
if (this.importLocationData.length === 0) {
return ''
}
var map = {}
for (let i = 0; i < this.importLocationData.length; i++) {
var status = this.importLocationData[i].处理状态 || '未知'
map[status] = (map[status] || 0) + 1
}
var text = []
for (var key in map) {
text.push(key + '' + map[key])
}
return '共' + this.importLocationData.length + '行,' + text.join('')
}
}, },
created() { created() {
// 修改人:Ld 修改时间:2026-07-22 09:59:17; 页面初始化时加载库位列表,供修改按钮使用。
this.getLocateName()
this.searchTable() this.searchTable()
}, },
methods: { methods: {
openImportLocationDialog() {
// 修改人:Ld 修改时间:2026-07-22 10:17:30; 打开导入修改库位弹窗并清空上次预览。
this.dialogFormVisibleImportLocation = true
this.importLocationData = []
this.importLocationDetailText = ''
this.importLocationDetailChunks = []
},
selectedImportLocation(data) {
// 修改人:Ld 修改时间:2026-07-22 10:17:30; 接收Excel上传组件解析出的工作表。
this.importWorksheet = data.worksheet
this.importItemFile = data.itemFile
this.importLocationData = []
this.importLocationDetailText = ''
this.importLocationDetailChunks = []
},
handleRemoveImportLocation(file) {
// 修改人:Ld 修改时间:2026-07-22 10:17:30; 移除导入文件时同步移除工作表数据。
for (let i = 0; i < this.importItemFile.length; i++) {
if (this.importItemFile[i].name === file.name) {
this.importWorksheet.splice(i, 1)
this.importItemFile.splice(i, 1)
this.importLocationData = []
this.importLocationDetailText = ''
this.importLocationDetailChunks = []
}
}
},
removeAllImportLocation() {
// 修改人:Ld 修改时间:2026-07-22 10:17:30; 清空所有待导入文件。
this.importWorksheet = []
this.importItemFile = []
this.importLocationData = []
this.importLocationDetailText = ''
this.importLocationDetailChunks = []
},
getExcelCellValue(sheet, col, row) {
var cell = sheet[col + row]
if (!cell || cell.v === undefined || cell.v === null) {
return ''
}
return String(cell.v).trim()
},
getImportLocationColumns(sheet) {
// 修改人:Ld 修改时间:2026-07-23 08:24:55; 自动识别物料编号、物料名称、图号型号、调整后库位和库存列。
var cols = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
]
var result = {
headerRow: 1,
materialCodeCol: 'A',
materialNameCol: 'B',
drawingCol: 'C',
locationCol: 'E',
inventoryCol: 'F'
}
for (let row = 1; row <= 10; row++) {
let materialCodeCol = ''
let materialNameCol = ''
let drawingCol = ''
let locationCol = ''
let inventoryCol = ''
for (let i = 0; i < cols.length; i++) {
var title = this.getExcelCellValue(sheet, cols[i], row).replace(/\s/g, '')
if (title === '物料编号' || title === '物料编码') {
materialCodeCol = cols[i]
}
if (title === '物料名称' || title === '名称' || title === '零件名称') {
materialNameCol = cols[i]
}
if (title === '图号型号' || title === '图号' || title === '图号或型号' || title === '图号/型号' || title === '规格型号') {
drawingCol = cols[i]
}
if (title === '调整后库位' || title === '库位') {
locationCol = cols[i]
}
if (title === '库存' || title === '库存数') {
inventoryCol = cols[i]
}
}
if (materialCodeCol || materialNameCol || drawingCol || locationCol || inventoryCol) {
result.headerRow = row
result.materialCodeCol = materialCodeCol || result.materialCodeCol
result.materialNameCol = materialNameCol || result.materialNameCol
result.drawingCol = drawingCol || result.drawingCol
result.locationCol = locationCol || result.locationCol
result.inventoryCol = inventoryCol || result.inventoryCol
return result
}
}
return result
},
getImportLocationDetail() {
// 修改人:Ld 修改时间:2026-07-23 08:24:55; 提取Excel中的物料编号、物料名称、图号型号、调整后库位和库存。
var detail = []
for (let j = 0; j < this.importWorksheet.length; j++) {
var sheet = this.importWorksheet[j]
var columns = this.getImportLocationColumns(sheet)
var emptyCount = 0
for (let row = columns.headerRow + 1; row <= 6000; row++) {
var materialCode = this.getExcelCellValue(sheet, columns.materialCodeCol, row)
var materialName = this.getExcelCellValue(sheet, columns.materialNameCol, row)
var drawing = this.getExcelCellValue(sheet, columns.drawingCol, row)
var locationName = this.getExcelCellValue(sheet, columns.locationCol, row)
var inventory = this.getExcelCellValue(sheet, columns.inventoryCol, row)
if (!materialCode && !materialName && !drawing && !locationName && !inventory) {
emptyCount++
if (emptyCount >= 20) {
break
}
continue
}
emptyCount = 0
detail.push({
行号: row,
物料编码: materialCode,
物料名称: materialName,
图号或型号: drawing,
调整后库位: locationName,
库存: inventory
})
}
}
return detail
},
getImportLocationInventoryValue(value) {
// 修改人:Ld 修改时间:2026-07-23 08:24:55; 多库位时按Excel库存数比较大小。
var num = Number(value)
if (isNaN(num)) {
return 0
}
return num
},
getImportLocationBestDetail(detail) {
// 修改人:Ld 修改时间:2026-07-23 08:24:55; 同一物料多库位时保留库存数最大的库位行。
var map = {}
var list = []
for (let i = 0; i < detail.length; i++) {
var materialCode = String(detail[i].物料编码 || '').trim()
var materialName = String(detail[i].物料名称 || '').trim()
var drawing = String(detail[i].图号或型号 || '').trim()
var key = materialCode || (materialName + '^' + drawing)
if (!key) {
key = 'ROW-' + detail[i].行号
}
if (!map[key]) {
map[key] = detail[i]
list.push(detail[i])
} else if (this.getImportLocationInventoryValue(detail[i].库存) > this.getImportLocationInventoryValue(map[key].库存)) {
var index = list.indexOf(map[key])
map[key] = detail[i]
if (index >= 0) {
list.splice(index, 1, detail[i])
}
}
}
return list
},
buildImportLocationDetailText(detail) {
// 修改人:Ld 修改时间:2026-07-23 08:24:55; 将导入明细转为后端批量过程可解析的字符串。
var list = []
var usedMap = {}
for (let i = 0; i < detail.length; i++) {
var materialCode = String(detail[i].物料编码 || '').replace(/\^|\|\|/g, '').trim()
var materialName = String(detail[i].物料名称 || '').replace(/\^|\|\|/g, '').trim()
var drawing = String(detail[i].图号或型号 || '').replace(/\^|\|\|/g, '').trim()
var locationName = String(detail[i].调整后库位 || '').replace(/\^|\|\|/g, '').trim()
var inventory = String(detail[i].库存 || '').replace(/\^|\|\|/g, '').trim()
var key = materialCode + '^' + materialName + '^' + drawing + '^' + locationName + '^' + inventory
if (!usedMap[key]) {
usedMap[key] = true
list.push(detail[i].行号 + '^' + materialCode + '^' + materialName + '^' + drawing + '^' + locationName + '^' + inventory)
}
}
return list.join('||')
},
buildImportLocationDetailChunks(detail) {
// 修改人:Ld 修改时间:2026-07-23 08:24:55; 大表分批提交,避免单次参数过长。
var chunks = []
var chunk = []
var usedMap = {}
for (let i = 0; i < detail.length; i++) {
var materialCode = String(detail[i].物料编码 || '').replace(/\^|\|\|/g, '').trim()
var materialName = String(detail[i].物料名称 || '').replace(/\^|\|\|/g, '').trim()
var drawing = String(detail[i].图号或型号 || '').replace(/\^|\|\|/g, '').trim()
var locationName = String(detail[i].调整后库位 || '').replace(/\^|\|\|/g, '').trim()
var inventory = String(detail[i].库存 || '').replace(/\^|\|\|/g, '').trim()
var key = materialCode + '^' + materialName + '^' + drawing + '^' + locationName + '^' + inventory
if (!usedMap[key]) {
usedMap[key] = true
chunk.push(detail[i].行号 + '^' + materialCode + '^' + materialName + '^' + drawing + '^' + locationName + '^' + inventory)
if (chunk.length >= 500) {
chunks.push(chunk.join('||'))
chunk = []
}
}
}
if (chunk.length > 0) {
chunks.push(chunk.join('||'))
}
return chunks
},
requestImportLocationPreview(index, rows) {
// 修改人:Ld 修改时间:2026-07-22 10:17:30; 分批调用预校验过程并合并展示。
if (index >= this.importLocationDetailChunks.length) {
this.importLocationData = rows
this.loading = false
this.$message.success('预校验完成')
return
}
var param = []
param[0] = ['导入明细', this.importLocationDetailChunks[index]]
var Data = this.CreateData('11', '仓储管理_物料库位_导入修改库位_预校验', param)
ExecDatabase(Data).then(response => {
var data = response.data.rows || response.data || []
this.requestImportLocationPreview(index + 1, rows.concat(data))
}).catch(() => {
this.loading = false
})
},
previewImportLocation() {
// 修改人:Ld 修改时间:2026-07-22 10:17:30; 上传后先预校验物料和库位变化。
var detail = this.getImportLocationDetail()
if (detail.length === 0) {
this.$message.warning('请导入包含物料编号和调整后库位的表格')
return
}
var validDetail = this.getImportLocationBestDetail(detail)
this.importLocationDetailText = this.buildImportLocationDetailText(validDetail)
this.importLocationDetailChunks = this.buildImportLocationDetailChunks(validDetail)
this.loading = true
if (this.importLocationDetailChunks.length === 0) {
this.importLocationData = []
this.loading = false
this.$message.warning('导入表中没有可提交的数据')
return
}
this.requestImportLocationPreview(0, [])
},
requestImportLocationSubmit(index, rows) {
// 修改人:Ld 修改时间:2026-07-22 10:17:30; 分批执行物料库位修改并合并返回结果。
if (index >= this.importLocationDetailChunks.length) {
this.importLocationData = rows
this.importLocationSubmitting = false
this.$message.success('导入修改完成')
this.getLocateName()
this.searchTable()
return
}
var param = []
param[0] = ['导入明细', this.importLocationDetailChunks[index]]
param[1] = ['修改人', this.id]
var Data = this.CreateData('12', '仓储管理_物料库位_导入修改库位_批量执行', param)
ExecDatabase(Data).then(response => {
var data = response.data.rows || response.data || []
this.requestImportLocationSubmit(index + 1, rows.concat(data))
}).catch(() => {
this.importLocationSubmitting = false
})
},
submitImportLocation() {
// 修改人:Ld 修改时间:2026-07-22 10:17:30; 确认后批量新建缺失库位并修改物料库位。
if (this.importLocationDetailChunks.length === 0) {
this.$message.warning('请先预校验')
return
}
this.$confirm('确认按导入表修改物料库位吗?缺失库位将自动新建。', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.importLocationSubmitting = true
this.requestImportLocationSubmit(0, [])
}).catch(() => {})
},
getLocateName() {
// 修改人:Ld 修改时间:2026-07-22 09:59:17; 复用库位管理查询接口加载可选库位。
this.storageLocation = []
var param = []
var Data = this.CreateData('11', '仓储管理_库位_查询', param)
ExecDatabase(Data).then(response => {
var rows = response.data.rows || response.data || []
for (let i = 0; i < rows.length; i++) {
this.storageLocation.push({
label: rows[i].货位名称,
value: Number(rows[i].货位流水号)
})
}
})
},
searchTable() { searchTable() {
this.loading = true this.loading = true
this.tableData10 = [] this.tableData10 = []
@@ -156,6 +548,7 @@ export default {
物料名称: response.data.rows[i].名称, 物料名称: response.data.rows[i].名称,
图号或型号: response.data.rows[i].代号, 图号或型号: response.data.rows[i].代号,
物料编号: response.data.rows[i].物料编码, 物料编号: response.data.rows[i].物料编码,
货位流水号_before: Number(response.data.rows[i].货位流水号), // 修改人:Ld 修改时间:2026-07-22 09:59:17; 保存修改前库位流水号用于取消和日志。
货位名称_before: response.data.rows[i].货位名称, 货位名称_before: response.data.rows[i].货位名称,
edit: false edit: false
}) })
@@ -179,6 +572,57 @@ export default {
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val this.multipleSelection = val
}, },
openEdit(row) {
// 修改人:Ld 修改时间:2026-07-22 09:59:17; 进入行内库位修改状态并备份原值。
row.货位流水号_before = row.货位流水号
row.货位名称_before = row.货位名称
row.edit = true
if (this.storageLocation.length === 0) {
this.getLocateName()
}
},
handleLocationChange(row) {
// 修改人:Ld 修改时间:2026-07-22 09:59:17; 下拉切换时同步展示库位名称。
row.货位名称 = ''
for (let i = 0; i < this.storageLocation.length; i++) {
if (Number(this.storageLocation[i].value) === Number(row.货位流水号)) {
row.货位名称 = this.storageLocation[i].label
return
}
}
},
confirmEdit(row) {
// 修改人:Ld 修改时间:2026-07-22 09:59:17; 保存物料库位修改并同步后端物料库位关系。
if (!row.货位流水号) {
this.$message.warning('请选择库位')
return
}
if (Number(row.货位流水号) === Number(row.货位流水号_before)) {
this.$message.warning('库位未变化')
row.edit = false
return
}
var param = []
param[0] = ['物料流水号', row.物料流水号]
param[1] = ['货位流水号', row.货位流水号]
param[2] = ['原货位流水号', row.货位流水号_before]
param[3] = ['修改人', this.id]
var Data = this.CreateData('12', '仓储管理_物料库位_编辑数据', param)
ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('修改成功')
this.searchTable()
} else {
this.$message.error(response.data[0].msg || '修改失败')
}
})
},
cancelEdit(row) {
// 修改人:Ld 修改时间:2026-07-22 09:59:17; 取消修改时恢复原库位。
row.货位流水号 = row.货位流水号_before
row.货位名称 = row.货位名称_before
row.edit = false
},
async printReceiptDoc1() { async printReceiptDoc1() {
const aa = this.printReceiptDoc() const aa = this.printReceiptDoc()
if (aa === 2) { if (aa === 2) {

View File

@@ -1,6 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card style="height: 1850px;padding: 0"> <el-card style="height: 850px;padding: 0">
<el-tabs v-model="PartType" type="border-card"> <el-tabs v-model="PartType" type="border-card">
<el-tab-pane label="生产领料" name="生产领料"> <el-tab-pane label="生产领料" name="生产领料">
<el-row> <el-row>
@@ -127,7 +127,7 @@
</el-table-column> </el-table-column>
<el-table-column width="136px" label="操作" align="center" show-overflow-tooltip> <el-table-column width="136px" label="操作" align="center" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<el-popover placement="right" width="535" trigger="click"> <el-popover placement="right" width="650" trigger="click">
<el-table :data="gridData" :header-cell-style="{background: '#19466E',color: 'white'}" border highlight-current-row size="mini" show-summary> <el-table :data="gridData" :header-cell-style="{background: '#19466E',color: 'white'}" border highlight-current-row size="mini" show-summary>
<el-table-column width="50px" align="center" type="index" label="序号"/> <el-table-column width="50px" align="center" type="index" label="序号"/>
<el-table-column width="150px" align="center" label="批次编号"> <el-table-column width="150px" align="center" label="批次编号">
@@ -135,6 +135,12 @@
{{ scope.row.批次编号 }} {{ scope.row.批次编号 }}
</template> </template>
</el-table-column> </el-table-column>
<!-- 备注修改人:Ld 修改时间:2026-07-20 16:23:04; 出库批次小窗库位列按货位流水号对应的库位号显示 -->
<el-table-column width="110px" align="center" label="库位" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.库位号 || scope.row.货位名称 }}
</template>
</el-table-column>
<el-table-column width="100px" align="center" label="批次库存" prop="货位存量"> <el-table-column width="100px" align="center" label="批次库存" prop="货位存量">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.货位存量 }} {{ scope.row.货位存量 }}
@@ -264,7 +270,7 @@
</el-table-column> </el-table-column>
<el-table-column width="171px" label="操作" align="center"> <el-table-column width="171px" label="操作" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-popover placement="right" width="880px" trigger="click"> <el-popover placement="right" width="990px" trigger="click">
<el-table :data="gridData1" :header-cell-style="{background: '#19466E',color: 'white'}" border highlight-current-row size="mini" show-summary> <el-table :data="gridData1" :header-cell-style="{background: '#19466E',color: 'white'}" border highlight-current-row size="mini" show-summary>
<el-table-column width="50px" align="center" type="index" label="序号"/> <el-table-column width="50px" align="center" type="index" label="序号"/>
<el-table-column width="150px" align="center" label="批次编号"> <el-table-column width="150px" align="center" label="批次编号">
@@ -272,6 +278,12 @@
{{ scope.row.批次编号 }} {{ scope.row.批次编号 }}
</template> </template>
</el-table-column> </el-table-column>
<!-- 备注修改人:Ld 修改时间:2026-07-20 16:23:04; 耗材出库批次小窗库位列按货位流水号对应的库位号显示 -->
<el-table-column width="110px" align="center" label="库位" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.库位号 || scope.row.货位名称 }}
</template>
</el-table-column>
<el-table-column width="100px" align="center" label="批次库存" prop="货位存量"> <el-table-column width="100px" align="center" label="批次库存" prop="货位存量">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.货位存量 }} {{ scope.row.货位存量 }}

View File

@@ -164,7 +164,7 @@
@size-change="handleSizeChanges" @size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/> @current-change="handleCurrentChanges"/>
</div> </div>
<el-dialog :visible.sync="batchDialogVisible" title="批次选择" width="600px" @close="closeBatchDialog"> <el-dialog :visible.sync="batchDialogVisible" title="批次选择" width="720px" @close="closeBatchDialog">
<el-table :data="batchData" border highlight-current-row size="mini" show-summary> <el-table :data="batchData" border highlight-current-row size="mini" show-summary>
<el-table-column width="50px" align="center" type="index" label="序号"/> <el-table-column width="50px" align="center" type="index" label="序号"/>
<el-table-column width="150px" align="center" label="批次编号"> <el-table-column width="150px" align="center" label="批次编号">
@@ -172,6 +172,12 @@
{{ batchScope.row.批次编号 }} {{ batchScope.row.批次编号 }}
</template> </template>
</el-table-column> </el-table-column>
<!-- 备注修改人:Ld 修改时间:2026-07-20 16:23:04; 批次选择小窗库位列按货位流水号对应的库位号显示 -->
<el-table-column width="110px" align="center" label="库位" show-overflow-tooltip>
<template slot-scope="batchScope">
{{ batchScope.row.库位号 || batchScope.row.货位名称 }}
</template>
</el-table-column>
<el-table-column width="100px" align="center" label="批次库存"> <el-table-column width="100px" align="center" label="批次库存">
<template slot-scope="batchScope"> <template slot-scope="batchScope">
{{ batchScope.row.货位存量 }} {{ batchScope.row.货位存量 }}

View File

@@ -850,6 +850,8 @@ export default {
return return
} }
this.supplierSelectionValue = row.供应商流水号 this.supplierSelectionValue = row.供应商流水号
// 修改人:Ld 修改时间:2026-07-22 09:05:29; 入库单查看后保留采购单号,供入库打印模板展示。
this.contractNumber = row.采购合同号 || row.采购合同编号 || ''
this.getContractState() this.getContractState()
this.$nextTick(() => { this.$nextTick(() => {
this.contractStateValue = row.采购合同流水号 this.contractStateValue = row.采购合同流水号
@@ -1313,6 +1315,8 @@ export default {
this.$message.warning('只能选择一个合同的物料') this.$message.warning('只能选择一个合同的物料')
return return
} }
// 修改人:Ld 修改时间:2026-07-22 09:05:29; 入库按钮打印前从勾选明细兜底同步采购单号。
this.contractNumber = this.multipleSelection[0].采购合同编号 || this.multipleSelection[0].采购合同号 || this.contractNumber
console.log(this.multipleSelection) console.log(this.multipleSelection)
// if (this.contractStateValue) { // if (this.contractStateValue) {
if (this.multipleSelection.length !== 0) { if (this.multipleSelection.length !== 0) {

View File

@@ -1,6 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card style="height: 850px"> <el-card style="height: 870px">
<div style="margin-top: 7px; margin-bottom: 7px"> <div style="margin-top: 7px; margin-bottom: 7px">
<el-input <el-input
v-model="入库单号Value" v-model="入库单号Value"