Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
electron-printer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhuzhequan
electron-printer
Commits
2af4e414
Commit
2af4e414
authored
Jun 09, 2026
by
linjinhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:修改问题
parent
f6e45c94
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
163 additions
and
69 deletions
+163
-69
src/config/index.js
+3
-0
src/server/entity/function.js
+21
-0
src/server/routes/index.js
+2
-0
src/server/utils/store.js
+48
-42
src/views/design/head/index.vue
+89
-27
No files found.
src/config/index.js
View file @
2af4e414
...
@@ -31,6 +31,9 @@ export const pathMap = {
...
@@ -31,6 +31,9 @@ export const pathMap = {
//判断 status 操作单状态
//判断 status 操作单状态
scanProduce
:
{
scanProduce
:
{
OP
:
"factory/podOrderOperation/scan-produce"
OP
:
"factory/podOrderOperation/scan-produce"
},
checkInventory
:
{
OP
:
"factory/podOrderOperation/check-inventory"
}
}
};
};
...
...
src/server/entity/function.js
View file @
2af4e414
...
@@ -631,5 +631,26 @@ export default {
...
@@ -631,5 +631,26 @@ export default {
console
.
log
(
"scanProduce"
,
error
);
console
.
log
(
"scanProduce"
,
error
);
res
.
json
({
code
:
500
,
msg
:
error
});
res
.
json
({
code
:
500
,
msg
:
error
});
}
}
},
checkInventory
:
async
(
req
,
res
)
=>
{
env
=
getHostApi
().
apiApiHost
;
const
token
=
req
.
headers
[
"jwt-token"
];
const
params
=
req
.
body
;
let
url
=
"factory/podOrderOperation/check-inventory"
;
console
.
log
(
"checkInventory"
,
`
${
env
}
/
${
url
}
`
);
try
{
let
{
data
}
=
await
axios
.
get
(
`
${
env
}
/
${
url
}
`
,
{
headers
:
{
"jwt-token"
:
token
},
params
:
{
id
:
params
.
id
,
status
:
params
.
status
}
});
res
.
send
(
data
);
}
catch
(
error
)
{
console
.
log
(
"checkInventory"
,
error
);
res
.
json
({
code
:
500
,
msg
:
error
});
}
}
}
};
};
src/server/routes/index.js
View file @
2af4e414
...
@@ -65,5 +65,7 @@ autoRegisterRouter(
...
@@ -65,5 +65,7 @@ autoRegisterRouter(
);
);
//操作单状态
//操作单状态
autoRegisterRouter
(
router
,
"scanProduce"
,
fn
.
scanProduce
);
autoRegisterRouter
(
router
,
"scanProduce"
,
fn
.
scanProduce
);
//检查库存
autoRegisterRouter
(
router
,
"checkInventory"
,
fn
.
checkInventory
);
export
{
router
as
default
};
export
{
router
as
default
};
src/server/utils/store.js
View file @
2af4e414
...
@@ -66,7 +66,7 @@ function getLatestOrderByPrefixNewId(targetNewId, type) {
...
@@ -66,7 +66,7 @@ function getLatestOrderByPrefixNewId(targetNewId, type) {
matchedKeyWithSuffix
.
push
({
matchedKeyWithSuffix
.
push
({
cacheKey
:
cacheKey
,
cacheKey
:
cacheKey
,
suffix
:
suffix
,
suffix
:
suffix
,
order
:
order
,
order
:
order
});
});
}
}
});
});
...
@@ -80,14 +80,14 @@ function getLatestOrderByPrefixNewId(targetNewId, type) {
...
@@ -80,14 +80,14 @@ function getLatestOrderByPrefixNewId(targetNewId, type) {
// ===== 核心新增:根据type过滤,只保留满足条件的条目 =====
// ===== 核心新增:根据type过滤,只保留满足条件的条目 =====
if
(
type
)
{
if
(
type
)
{
// 传入type时才执行过滤,提高灵活性
// 传入type时才执行过滤,提高灵活性
matchedKeyWithSuffix
=
matchedKeyWithSuffix
.
filter
(
(
item
)
=>
{
matchedKeyWithSuffix
=
matchedKeyWithSuffix
.
filter
(
item
=>
{
const
{
order
}
=
item
;
const
{
order
}
=
item
;
// 1. 容错:判断saveImgList是否存在且为数组,避免报错
// 1. 容错:判断saveImgList是否存在且为数组,避免报错
if
(
!
order
.
saveImgList
||
!
Array
.
isArray
(
order
.
saveImgList
))
{
if
(
!
order
.
saveImgList
||
!
Array
.
isArray
(
order
.
saveImgList
))
{
return
false
;
return
false
;
}
}
// 2. 查找是否存在:title===type 且 power===false
// 2. 查找是否存在:title===type 且 power===false
const
matchImgItem
=
order
.
saveImgList
.
find
(
(
imgItem
)
=>
{
const
matchImgItem
=
order
.
saveImgList
.
find
(
imgItem
=>
{
return
imgItem
.
title
===
type
&&
imgItem
.
power
===
false
;
return
imgItem
.
title
===
type
&&
imgItem
.
power
===
false
;
});
});
// 3. 存在则保留该条目,否则过滤掉
// 3. 存在则保留该条目,否则过滤掉
...
@@ -95,7 +95,7 @@ function getLatestOrderByPrefixNewId(targetNewId, type) {
...
@@ -95,7 +95,7 @@ function getLatestOrderByPrefixNewId(targetNewId, type) {
});
});
if
(
matchedKeyWithSuffix
.
length
===
0
)
{
if
(
matchedKeyWithSuffix
.
length
===
0
)
{
console
.
log
(
console
.
log
(
`未找到以
${
targetNewId
}
为前缀、且type=
${
type
}
(power=false)的订单`
,
`未找到以
${
targetNewId
}
为前缀、且type=
${
type
}
(power=false)的订单`
);
);
return
null
;
// 直接返回null,终止后续逻辑,避免报错
return
null
;
// 直接返回null,终止后续逻辑,避免报错
}
}
...
@@ -111,11 +111,11 @@ function getLatestOrderByPrefixNewId(targetNewId, type) {
...
@@ -111,11 +111,11 @@ function getLatestOrderByPrefixNewId(targetNewId, type) {
}
}
console
.
log
(
console
.
log
(
`找到以
${
targetNewId
}
为前缀的最新订单,cacheKey:
${
latestItem
.
cacheKey
}
,后缀:
${
latestItem
.
suffix
}
`
,
`找到以
${
targetNewId
}
为前缀的最新订单,cacheKey:
${
latestItem
.
cacheKey
}
,后缀:
${
latestItem
.
suffix
}
`
);
);
return
{
return
{
cacheKey
:
latestItem
.
cacheKey
,
cacheKey
:
latestItem
.
cacheKey
,
order
:
latestItem
.
order
,
order
:
latestItem
.
order
};
};
}
}
...
@@ -128,12 +128,12 @@ function refreshOrderCache() {
...
@@ -128,12 +128,12 @@ function refreshOrderCache() {
const
newCacheMap
=
new
Map
();
const
newCacheMap
=
new
Map
();
// 重新构建缓存key:前缀-数字,保持格式一致
// 重新构建缓存key:前缀-数字,保持格式一致
currentArray
.
forEach
(
(
item
)
=>
{
currentArray
.
forEach
(
item
=>
{
if
(
item
&&
item
[
DEFAULT_UNIQUE_KEY
])
{
if
(
item
&&
item
[
DEFAULT_UNIQUE_KEY
])
{
const
itemPrefix
=
item
[
DEFAULT_UNIQUE_KEY
];
const
itemPrefix
=
item
[
DEFAULT_UNIQUE_KEY
];
// 查找该前缀对应的所有订单,生成连续后缀
// 查找该前缀对应的所有订单,生成连续后缀
const
samePrefixItems
=
currentArray
.
filter
(
const
samePrefixItems
=
currentArray
.
filter
(
(
i
)
=>
i
[
DEFAULT_UNIQUE_KEY
]
===
itemPrefix
,
i
=>
i
[
DEFAULT_UNIQUE_KEY
]
===
itemPrefix
);
);
samePrefixItems
.
forEach
((
sameItem
,
index
)
=>
{
samePrefixItems
.
forEach
((
sameItem
,
index
)
=>
{
const
cacheKey
=
`
${
itemPrefix
}
-
${
index
+
1
}
`
;
const
cacheKey
=
`
${
itemPrefix
}
-
${
index
+
1
}
`
;
...
@@ -162,27 +162,27 @@ refreshOrderCache();
...
@@ -162,27 +162,27 @@ refreshOrderCache();
// ===== 7. 公开API(暴露给外部调用,核心逻辑+原有基础配置) =====
// ===== 7. 公开API(暴露给外部调用,核心逻辑+原有基础配置) =====
module
.
exports
=
{
module
.
exports
=
{
// === 原有基础配置方法(无改动,保留你的初始逻辑) ===
// === 原有基础配置方法(无改动,保留你的初始逻辑) ===
setVersion
:
(
version
)
=>
{
setVersion
:
version
=>
{
store
.
set
(
"desktoVersion"
,
version
);
store
.
set
(
"desktoVersion"
,
version
);
},
},
getVersion
:
()
=>
store
.
get
(
"desktoVersion"
)
||
"print"
,
getVersion
:
()
=>
store
.
get
(
"desktoVersion"
)
||
"print"
,
setNowDate
:
(
version
)
=>
{
setNowDate
:
version
=>
{
store
.
set
(
"nowDate"
,
version
);
store
.
set
(
"nowDate"
,
version
);
},
},
getNowDate
:
()
=>
store
.
get
(
"nowDate"
)
||
""
,
getNowDate
:
()
=>
store
.
get
(
"nowDate"
)
||
""
,
setSkip
:
(
value
)
=>
{
setSkip
:
value
=>
{
store
.
set
(
"skipValue"
,
value
);
store
.
set
(
"skipValue"
,
value
);
},
},
getSkipValue
:
()
=>
store
.
get
(
"skipValue"
)
||
2
,
getSkipValue
:
()
=>
store
.
get
(
"skipValue"
)
||
2
,
setSkipVersion
:
(
value
)
=>
{
setSkipVersion
:
value
=>
{
store
.
set
(
"skipVersion"
,
value
);
store
.
set
(
"skipVersion"
,
value
);
},
},
getSkipVersion
:
()
=>
store
.
get
(
"skipVersion"
)
||
"1.0"
,
getSkipVersion
:
()
=>
store
.
get
(
"skipVersion"
)
||
"1.0"
,
setApi
:
(
value
)
=>
{
setApi
:
value
=>
{
store
.
set
(
"hostApi"
,
value
);
store
.
set
(
"hostApi"
,
value
);
},
},
getHostApi
:
()
=>
getHostApi
:
()
=>
...
@@ -190,14 +190,14 @@ module.exports = {
...
@@ -190,14 +190,14 @@ module.exports = {
apiApiHost
:
"https://factory.jomalls.com/api"
,
apiApiHost
:
"https://factory.jomalls.com/api"
,
fileApiUrl
:
"https://factory.jomalls.com/upload/factory"
,
fileApiUrl
:
"https://factory.jomalls.com/upload/factory"
,
visionUrl
:
"https://console.jomalls.com"
,
visionUrl
:
"https://console.jomalls.com"
,
configPath
:
""
,
configPath
:
""
},
},
setBoard
:
(
version
)
=>
{
setBoard
:
version
=>
{
store
.
set
(
"desktoBoard"
,
version
);
store
.
set
(
"desktoBoard"
,
version
);
},
},
getBoard
:
()
=>
store
.
get
(
"desktoBoard"
)
||
3
,
getBoard
:
()
=>
store
.
get
(
"desktoBoard"
)
||
3
,
setIsOver
:
(
value
)
=>
{
setIsOver
:
value
=>
{
store
.
set
(
"isOver"
,
value
);
store
.
set
(
"isOver"
,
value
);
},
},
getIsOver
:
()
=>
store
.
get
(
"isOver"
)
||
false
,
getIsOver
:
()
=>
store
.
get
(
"isOver"
)
||
false
,
...
@@ -206,12 +206,12 @@ module.exports = {
...
@@ -206,12 +206,12 @@ module.exports = {
if
(
!
locationKey
)
return
;
if
(
!
locationKey
)
return
;
store
.
set
(
locationKey
,
version
);
store
.
set
(
locationKey
,
version
);
},
},
getLocation
:
(
locationKey
)
=>
{
getLocation
:
locationKey
=>
{
if
(
!
locationKey
)
return
""
;
if
(
!
locationKey
)
return
""
;
return
store
.
get
(
locationKey
)
||
""
;
return
store
.
get
(
locationKey
)
||
""
;
},
},
setDesktopDevice
:
(
version
)
=>
{
setDesktopDevice
:
version
=>
{
store
.
set
(
"desktopDevice"
,
version
);
store
.
set
(
"desktopDevice"
,
version
);
},
},
getDesktopDevice
:
()
=>
store
.
get
(
"desktopDevice"
)
||
1
,
getDesktopDevice
:
()
=>
store
.
get
(
"desktopDevice"
)
||
1
,
...
@@ -233,7 +233,7 @@ module.exports = {
...
@@ -233,7 +233,7 @@ module.exports = {
* 批量设置订单(保留永久上限逻辑,不修改订单内部数据)
* 批量设置订单(保留永久上限逻辑,不修改订单内部数据)
* @param {Array|Map} newData 待批量添加的订单数据
* @param {Array|Map} newData 待批量添加的订单数据
*/
*/
setOrderInfo
:
(
newData
)
=>
{
setOrderInfo
:
newData
=>
{
let
newObjArray
=
[];
let
newObjArray
=
[];
if
(
newData
instanceof
Map
)
{
if
(
newData
instanceof
Map
)
{
newObjArray
=
mapToArray
(
newData
);
newObjArray
=
mapToArray
(
newData
);
...
@@ -245,7 +245,7 @@ module.exports = {
...
@@ -245,7 +245,7 @@ module.exports = {
}
}
const
handledArray
=
[];
const
handledArray
=
[];
newObjArray
.
forEach
(
(
item
)
=>
{
newObjArray
.
forEach
(
item
=>
{
if
(
if
(
!
item
||
!
item
||
!
item
[
DEFAULT_UNIQUE_KEY
]
||
!
item
[
DEFAULT_UNIQUE_KEY
]
||
...
@@ -263,7 +263,7 @@ module.exports = {
...
@@ -263,7 +263,7 @@ module.exports = {
// 永久上限校验
// 永久上限校验
if
(
isOriginalIdPermanentLimit
(
originalNewId
))
{
if
(
isOriginalIdPermanentLimit
(
originalNewId
))
{
console
.
warn
(
console
.
warn
(
`批量添加跳过:
${
originalNewId
}
已达到永久上限
${
numLimit
}
,无法再添加`
,
`批量添加跳过:
${
originalNewId
}
已达到永久上限
${
numLimit
}
,无法再添加`
);
);
return
;
return
;
}
}
...
@@ -280,7 +280,7 @@ module.exports = {
...
@@ -280,7 +280,7 @@ module.exports = {
// 上限校验
// 上限校验
if
(
currentCount
>=
numLimit
)
{
if
(
currentCount
>=
numLimit
)
{
console
.
warn
(
console
.
warn
(
`批量添加跳过:
${
originalNewId
}
已达到永久上限
${
numLimit
}
`
,
`批量添加跳过:
${
originalNewId
}
已达到永久上限
${
numLimit
}
`
);
);
setPermanentMaxLimit
(
originalNewId
);
setPermanentMaxLimit
(
originalNewId
);
return
;
return
;
...
@@ -303,7 +303,7 @@ module.exports = {
...
@@ -303,7 +303,7 @@ module.exports = {
* 单个添加订单(保留永久上限逻辑,不修改订单内部数据)
* 单个添加订单(保留永久上限逻辑,不修改订单内部数据)
* @param {object} newOrderObj 待添加的单个订单
* @param {object} newOrderObj 待添加的单个订单
*/
*/
addToOrderInfo
:
(
newOrderObj
)
=>
{
addToOrderInfo
:
newOrderObj
=>
{
if
(
if
(
typeof
newOrderObj
!==
"object"
||
typeof
newOrderObj
!==
"object"
||
newOrderObj
===
null
||
newOrderObj
===
null
||
...
@@ -313,22 +313,28 @@ module.exports = {
...
@@ -313,22 +313,28 @@ module.exports = {
return
;
return
;
}
}
const
targetQuantity
=
newOrderObj
.
num
||
newOrderObj
.
customizedQuantity
||
0
;
// 统一校验:必须是 正整数
if
(
if
(
typeof
newOrderObj
.
num
!==
"number"
||
typeof
targetQuantity
!==
"number"
||
!
Number
.
isInteger
(
newOrderObj
.
num
)
||
!
Number
.
isInteger
(
targetQuantity
)
||
newOrderObj
.
num
<=
0
targetQuantity
<=
0
)
{
)
{
console
.
warn
(
"添加失败:订单缺少有效num永久上限(正整数)"
);
console
.
warn
(
"添加失败:订单缺少有效数量(num 或 customizedQuantity 需为正整数)"
);
return
;
return
;
}
}
const
originalNewId
=
newOrderObj
[
DEFAULT_UNIQUE_KEY
];
const
originalNewId
=
newOrderObj
[
DEFAULT_UNIQUE_KEY
];
const
numLimit
=
newOrderObj
.
num
;
const
numLimit
=
targetQuantity
;
// 永久上限校验
// 永久上限校验
if
(
isOriginalIdPermanentLimit
(
originalNewId
))
{
if
(
isOriginalIdPermanentLimit
(
originalNewId
))
{
console
.
warn
(
console
.
warn
(
`添加失败:
${
originalNewId
}
已达到永久上限
${
numLimit
}
,无法再添加`
,
`添加失败:
${
originalNewId
}
已达到永久上限
${
numLimit
}
,无法再添加`
);
);
return
;
return
;
}
}
...
@@ -382,7 +388,7 @@ module.exports = {
...
@@ -382,7 +388,7 @@ module.exports = {
* @param {string|number} targetNewId 原始newId前缀
* @param {string|number} targetNewId 原始newId前缀
* @param {string} [type] 可选,订单筛选辅助类型(保留兼容)
* @param {string} [type] 可选,订单筛选辅助类型(保留兼容)
*/
*/
removeFromOrderInfo
:
(
targetNewId
)
=>
{
removeFromOrderInfo
:
targetNewId
=>
{
if
(
!
targetNewId
||
orderCacheMap
.
size
===
0
)
{
if
(
!
targetNewId
||
orderCacheMap
.
size
===
0
)
{
console
.
log
(
`无有效参数或缓存为空,无法执行删除`
);
console
.
log
(
`无有效参数或缓存为空,无法执行删除`
);
return
;
return
;
...
@@ -399,7 +405,7 @@ module.exports = {
...
@@ -399,7 +405,7 @@ module.exports = {
matchedKeyWithSuffix
.
push
({
matchedKeyWithSuffix
.
push
({
cacheKey
:
cacheKey
,
// 保留唯一cacheKey
cacheKey
:
cacheKey
,
// 保留唯一cacheKey
suffix
:
suffix
,
suffix
:
suffix
,
order
:
order
,
order
:
order
});
});
}
}
});
});
...
@@ -411,7 +417,7 @@ module.exports = {
...
@@ -411,7 +417,7 @@ module.exports = {
}
}
// 步骤3:核心筛选:保留「saveImgList中所有power都为true」的订单
// 步骤3:核心筛选:保留「saveImgList中所有power都为true」的订单
const
qualifiedOrders
=
matchedKeyWithSuffix
.
filter
(
(
item
)
=>
{
const
qualifiedOrders
=
matchedKeyWithSuffix
.
filter
(
item
=>
{
const
{
order
}
=
item
;
const
{
order
}
=
item
;
// 容错1:saveImgList不存在或非数组,视为不满足条件
// 容错1:saveImgList不存在或非数组,视为不满足条件
...
@@ -425,7 +431,7 @@ module.exports = {
...
@@ -425,7 +431,7 @@ module.exports = {
}
}
// 核心判断:every() 验证所有条目都满足 power === true
// 核心判断:every() 验证所有条目都满足 power === true
return
order
.
saveImgList
.
every
(
(
imgItem
)
=>
{
return
order
.
saveImgList
.
every
(
imgItem
=>
{
return
!!
imgItem
&&
imgItem
.
power
===
true
;
return
!!
imgItem
&&
imgItem
.
power
===
true
;
});
});
});
});
...
@@ -433,7 +439,7 @@ module.exports = {
...
@@ -433,7 +439,7 @@ module.exports = {
// 步骤4:无满足条件的订单,返回提示
// 步骤4:无满足条件的订单,返回提示
if
(
qualifiedOrders
.
length
===
0
)
{
if
(
qualifiedOrders
.
length
===
0
)
{
console
.
log
(
console
.
log
(
`未找到以
${
targetNewId
}
为前缀、且saveImgList所有power都为true的订单`
,
`未找到以
${
targetNewId
}
为前缀、且saveImgList所有power都为true的订单`
);
);
return
;
return
;
}
}
...
@@ -447,11 +453,11 @@ module.exports = {
...
@@ -447,11 +453,11 @@ module.exports = {
const
originalOrderArray
=
store
.
get
(
"orderInfo"
)
||
[];
const
originalOrderArray
=
store
.
get
(
"orderInfo"
)
||
[];
// 先构建「本地订单数组」与「cacheKey」的映射关系(因为本地订单没有cacheKey,需要反向匹配)
// 先构建「本地订单数组」与「cacheKey」的映射关系(因为本地订单没有cacheKey,需要反向匹配)
const
orderToCacheKeyMap
=
new
Map
();
const
orderToCacheKeyMap
=
new
Map
();
originalOrderArray
.
forEach
(
(
item
)
=>
{
originalOrderArray
.
forEach
(
item
=>
{
if
(
item
&&
item
[
DEFAULT_UNIQUE_KEY
])
{
if
(
item
&&
item
[
DEFAULT_UNIQUE_KEY
])
{
const
itemPrefix
=
item
[
DEFAULT_UNIQUE_KEY
];
const
itemPrefix
=
item
[
DEFAULT_UNIQUE_KEY
];
const
samePrefixItems
=
originalOrderArray
.
filter
(
const
samePrefixItems
=
originalOrderArray
.
filter
(
(
i
)
=>
i
[
DEFAULT_UNIQUE_KEY
]
===
itemPrefix
,
i
=>
i
[
DEFAULT_UNIQUE_KEY
]
===
itemPrefix
);
);
samePrefixItems
.
forEach
((
sameItem
,
index
)
=>
{
samePrefixItems
.
forEach
((
sameItem
,
index
)
=>
{
const
itemCacheKey
=
`
${
itemPrefix
}
-
${
index
+
1
}
`
;
const
itemCacheKey
=
`
${
itemPrefix
}
-
${
index
+
1
}
`
;
...
@@ -463,7 +469,7 @@ module.exports = {
...
@@ -463,7 +469,7 @@ module.exports = {
});
});
// 精准过滤:只删除「cacheKey等于toDeleteCacheKey」的订单
// 精准过滤:只删除「cacheKey等于toDeleteCacheKey」的订单
const
newOrderArray
=
originalOrderArray
.
filter
(
(
item
)
=>
{
const
newOrderArray
=
originalOrderArray
.
filter
(
item
=>
{
const
itemKey
=
JSON
.
stringify
(
item
);
const
itemKey
=
JSON
.
stringify
(
item
);
const
itemCacheKey
=
orderToCacheKeyMap
.
get
(
itemKey
)
||
""
;
const
itemCacheKey
=
orderToCacheKeyMap
.
get
(
itemKey
)
||
""
;
// 只保留「cacheKey不等于要删除的cacheKey」的订单,精准无误伤
// 只保留「cacheKey不等于要删除的cacheKey」的订单,精准无误伤
...
@@ -488,7 +494,7 @@ module.exports = {
...
@@ -488,7 +494,7 @@ module.exports = {
refreshOrderCache
();
refreshOrderCache
();
console
.
log
(
console
.
log
(
`成功删除
${
targetNewId
}
对应的订单(cacheKey:
${
toDeleteCacheKey
}
,仅删除1条),缓存已更新`
,
`成功删除
${
targetNewId
}
对应的订单(cacheKey:
${
toDeleteCacheKey
}
,仅删除1条),缓存已更新`
);
);
},
},
...
@@ -515,11 +521,11 @@ module.exports = {
...
@@ -515,11 +521,11 @@ module.exports = {
const
originalOrderArray
=
store
.
get
(
"orderInfo"
)
||
[];
const
originalOrderArray
=
store
.
get
(
"orderInfo"
)
||
[];
// 合并更新字段,不修改订单内部核心数据
// 合并更新字段,不修改订单内部核心数据
const
newOrderArray
=
originalOrderArray
.
map
(
(
item
)
=>
{
const
newOrderArray
=
originalOrderArray
.
map
(
item
=>
{
if
(
JSON
.
stringify
(
item
)
===
JSON
.
stringify
(
order
))
{
if
(
JSON
.
stringify
(
item
)
===
JSON
.
stringify
(
order
))
{
return
{
return
{
...
item
,
...
item
,
...
newOrderFields
,
...
newOrderFields
};
};
}
}
return
item
;
return
item
;
...
@@ -530,10 +536,10 @@ module.exports = {
...
@@ -530,10 +536,10 @@ module.exports = {
refreshOrderCache
();
refreshOrderCache
();
console
.
log
(
console
.
log
(
`成功更新
${
targetNewId
}
对应的最新订单(cacheKey:
${
cacheKey
}
),缓存已更新`
,
`成功更新
${
targetNewId
}
对应的最新订单(cacheKey:
${
cacheKey
}
),缓存已更新`
);
);
},
},
clearMaxLimitRecord
:
()
=>
{
clearMaxLimitRecord
:
()
=>
{
return
store
.
set
(
MAX_LIMIT_RECORD_KEY
,
{});
return
store
.
set
(
MAX_LIMIT_RECORD_KEY
,
{});
}
,
}
};
};
src/views/design/head/index.vue
View file @
2af4e414
...
@@ -229,7 +229,7 @@ export default {
...
@@ -229,7 +229,7 @@ export default {
break
;
break
;
}
}
},
},
async
setData
(
data
)
{
async
setData
(
data
,
type
)
{
if
(
!
data
)
return
this
.
$message
.
warning
(
"请扫描生产单号/操作单号"
);
if
(
!
data
)
return
this
.
$message
.
warning
(
"请扫描生产单号/操作单号"
);
let
params
=
{
let
params
=
{
id
:
data
.
id
,
id
:
data
.
id
,
...
@@ -256,11 +256,47 @@ export default {
...
@@ -256,11 +256,47 @@ export default {
}
}
console
.
log
(
"本地数据removeFromOrderInfo:"
,
getOrderInfoMap
());
console
.
log
(
"本地数据removeFromOrderInfo:"
,
getOrderInfoMap
());
//生产完成后在本地删除
//生产完成后在本地删除
if
(
this
.
orderType
==
"OP"
&&
(
this
.
detail
.
status
==
"PENDING_PICK"
||
this
.
detail
.
status
==
"PENDING_REPLENISH"
)
)
{
const
{
code
,
data
}
=
await
this
.
$api
.
post
(
pathMap
[
"scanProduce"
][
this
.
orderType
],
params
);
if
(
code
==
301
)
{
this
.
$confirm
(
`<p>库存不足,无法进入生产!请联系仓库管理人员核对库存。</p>
<p>库存数量:
${
data
.
availableInventory
||
0
}
,生产中数量:
${
data
.
inventory
||
0
}
,可调配库存:
${
data
.
inventory
||
0
}
</p>`
,
"提示"
,
{
confirmButtonText
:
"确定"
,
type
:
"error"
,
dangerouslyUseHTMLString
:
true
,
// 🔥 关键:添加自定义类名
customClass
:
"custom-inventory-msgbox"
}
);
this
.
detail
=
""
;
this
.
productionNo
=
""
;
this
.
$refs
.
searchRef
?.
focus
();
return
;
}
}
else
{
await
this
.
$api
.
post
(
await
this
.
$api
.
post
(
pathMap
[
"completeDelivery"
][
this
.
orderType
],
pathMap
[
"completeDelivery"
][
this
.
orderType
],
params
params
);
);
}
this
.
$message
.
success
(
"操作成功"
);
this
.
$message
.
success
(
"操作成功"
);
}
else
{
if
(
type
==
"btn"
)
{
const
item
=
data
.
saveImgList
?.
find
(
el
=>
!
el
.
power
);
this
.
$message
.
warning
(
`该订单
${
item
.
title
}
面未打印,无法生产完成`
);
}
}
}
},
},
async
sureData
()
{
async
sureData
()
{
...
@@ -272,7 +308,7 @@ export default {
...
@@ -272,7 +308,7 @@ export default {
cancelButtonText
:
"取消"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
type
:
"warning"
}).
then
(
async
()
=>
{
}).
then
(
async
()
=>
{
await
this
.
setData
(
this
.
detail
);
await
this
.
setData
(
this
.
detail
,
"btn"
);
});
});
},
},
clearCache
()
{
clearCache
()
{
...
@@ -562,6 +598,8 @@ export default {
...
@@ -562,6 +598,8 @@ export default {
}
}
//如果该数据的图片第一次出现且素材图大于1张则把该数据储存到本地
//如果该数据的图片第一次出现且素材图大于1张则把该数据储存到本地
if (newImgList.length > 1 && !bool && this.desktopDevice == 3) {
if (newImgList.length > 1 && !bool && this.desktopDevice == 3) {
console.log("
addToOrderInfo
:
", this.detail);
addToOrderInfo(this.detail);
addToOrderInfo(this.detail);
console.log("
本地数据
addToOrderInfo
:
", getOrderInfoMap());
console.log("
本地数据
addToOrderInfo
:
", getOrderInfoMap());
}
}
...
@@ -689,31 +727,55 @@ export default {
...
@@ -689,31 +727,55 @@ export default {
(this.detail.status == "
PENDING_PICK
" ||
(this.detail.status == "
PENDING_PICK
" ||
this.detail.status == "
PENDING_REPLENISH
")
this.detail.status == "
PENDING_REPLENISH
")
) {
) {
const { data, code } = await this.$api.post(
// const {
pathMap["
scanProduce
"][this.orderType],
// data: checkInventoryData,
{ id: this.detail.id, status: this.detail.status }
// code: checkInventoryCode
);
// } = await this.$api.post(pathMap["
checkInventory
"][this.orderType], {
console.log("
scanProduce
---------
", data);
// id: this.detail.id,
// status: this.detail.status
if (code == 301) {
// });
this.$confirm(
// if (checkInventoryCode == 301) {
`<p>库存不足,无法进入生产!请联系仓库管理人员核对库存。</p>
// this.$confirm(
<p>库存数量:${data.availableInventory || 0},生产中数量:${data.inventory ||
// `<p>库存不足,无法进入生产!请联系仓库管理人员核对库存。</p>
0},可调配库存:${data.inventory || 0}</p>`,
// <p>库存数量:${checkInventoryData.availableInventory ||
"
提示
",
// 0},生产中数量:${checkInventoryData.inventory ||
{
// 0},可调配库存:${checkInventoryData.inventory || 0}</p>`,
confirmButtonText: "
确定
",
// "
提示
",
type: "
error
",
// {
dangerouslyUseHTMLString: true,
// confirmButtonText: "
确定
",
// 🔥 关键:添加自定义类名
// type: "
error
",
customClass: "
custom
-
inventory
-
msgbox
"
// dangerouslyUseHTMLString: true,
}
// customClass: "
custom
-
inventory
-
msgbox
"
);
// }
this.detail = "";
// );
this.productionNo = "";
// this.detail = "";
this.$refs.searchRef?.focus();
// this.productionNo = "";
return;
// this.$refs.searchRef?.focus();
}
// return;
// }
// const { data, code } = await this.$api.post(
// pathMap["
scanProduce
"][this.orderType],
// { id: this.detail.id, status: this.detail.status }
// );
// if (code == 301) {
// this.$confirm(
// `<p>库存不足,无法进入生产!请联系仓库管理人员核对库存。</p>
// <p>库存数量:${data.availableInventory || 0},生产中数量:${data.inventory ||
// 0},可调配库存:${data.inventory || 0}</p>`,
// "
提示
",
// {
// confirmButtonText: "
确定
",
// type: "
error
",
// dangerouslyUseHTMLString: true,
// // 🔥 关键:添加自定义类名
// customClass: "
custom
-
inventory
-
msgbox
"
// }
// );
// this.detail = "";
// this.productionNo = "";
// this.$refs.searchRef?.focus();
// return;
// }
}
}
let designImagesCanvasJsonList = this.detail.drParam;
let designImagesCanvasJsonList = this.detail.drParam;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment