Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mes-pda-scan
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ximai
mes-pda-scan
Commits
755f316e
Commit
755f316e
authored
Jul 15, 2024
by
何远江
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加销售拣货缓存功能
parent
b2cae7a8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
434 additions
and
418 deletions
+434
-418
salesOutbound.vue
pages/salesOutbound/salesOutbound.vue
+2
-23
salesOutboundList.vue
pages/salesOutbound/salesOutboundList.vue
+329
-297
index.js
store/index.js
+103
-98
No files found.
pages/salesOutbound/salesOutbound.vue
View file @
755f316e
...
@@ -50,31 +50,12 @@ export default {
...
@@ -50,31 +50,12 @@ export default {
data
()
{
data
()
{
return
{
return
{
bgSrc
:
require
(
'@/static/images/qrcode.png'
),
bgSrc
:
require
(
'@/static/images/qrcode.png'
),
number
:
0
,
show
:
true
,
nlpla
:
''
,
wxparams
:
''
,
wxparams
:
''
,
btnArr
:
[
{
style
:
''
,
type
:
'primary'
,
text
:
'扫描单号'
,
way
:
'scanning'
},
// {
// style: '',
// type: 'warning',
// text: '查询单号',
// way: 'goClick'
// }
],
goodsList
:
[],
isFocus
:
false
,
isFocus
:
false
,
isDisabled
:
false
isDisabled
:
false
};
};
},
},
created
()
{
created
()
{
// this.getPlnr('80000033');
},
},
methods
:
{
methods
:
{
getBtnHandle
(
row
)
{
getBtnHandle
(
row
)
{
...
@@ -102,13 +83,11 @@ export default {
...
@@ -102,13 +83,11 @@ export default {
})
})
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
if
(
res
&&
res
.
BKDT
.
length
)
{
if
(
res
&&
res
.
BKDT
.
length
)
{
this
.
goodsList
=
res
.
BKDT
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
`/pages/salesOutbound/salesOutboundList?order=
${
JSON
.
stringify
(
this
.
goodsList
)
}
`
url
:
`/pages/salesOutbound/salesOutboundList?order=
${
VBELN
}
`
});
});
}
else
{
}
else
{
// res.forEach(element => {
// 删除本地缓存的单号
// });
this
.
$u
.
toast
(
res
.
MSG
[
0
].
MESSAGE
);
this
.
$u
.
toast
(
res
.
MSG
[
0
].
MESSAGE
);
}
}
this
.
loading
=
false
;
this
.
loading
=
false
;
...
...
pages/salesOutbound/salesOutboundList.vue
View file @
755f316e
This diff is collapsed.
Click to expand it.
store/index.js
View file @
755f316e
/**
/**
* Copyright (c) 2013-Now http://aidex.vip All rights reserved.
* Copyright (c) 2013-Now http://aidex.vip All rights reserved.
*/
*/
import
config
from
'@/common/config.js'
;
import
config
from
'@/common/config.js'
;
import
Vue
from
'vue'
import
Vue
from
'vue'
import
Vuex
from
'vuex'
import
Vuex
from
'vuex'
Vue
.
use
(
Vuex
)
Vue
.
use
(
Vuex
)
let
lifeData
=
{};
let
lifeData
=
{};
try
{
try
{
// 尝试获取本地是否存在lifeData变量,第一次启动APP时是不存在的
// 尝试获取本地是否存在lifeData变量,第一次启动APP时是不存在的
lifeData
=
uni
.
getStorageSync
(
'lifeData'
);
lifeData
=
uni
.
getStorageSync
(
'lifeData'
);
}
catch
(
e
){
}
catch
(
e
)
{
}
}
// 需要永久存储,且下次APP启动需要取出的,在state中的变量名
// 需要永久存储,且下次APP启动需要取出的,在state中的变量名
let
saveStateKeys
=
[
'vuex_user'
,
'vuex_user_factory'
,
'vuex_token'
,
'vuex_remember'
,
'vuex_locale'
,
'vuex_isAgent'
,
'vuex_workstation'
,
'vuex_task'
];
let
saveStateKeys
=
[
'vuex_user'
,
'vuex_user_factory'
,
'vuex_token'
,
'vuex_remember'
,
'vuex_locale'
,
'vuex_isAgent'
,
'vuex_workstation'
,
'vuex_task'
,
'vuex_sales_outbound'
// 保存变量到本地存储中
];
const
saveLifeData
=
function
(
key
,
value
){
// 判断变量名是否在需要存储的数组中
// 保存变量到本地存储中
if
(
saveStateKeys
.
indexOf
(
key
)
!=
-
1
)
{
const
saveLifeData
=
function
(
key
,
value
)
{
// 获取本地存储的lifeData对象,将变量添加到对象中
// 判断变量名是否在需要存储的数组中
let
tmp
=
uni
.
getStorageSync
(
'lifeData'
);
if
(
saveStateKeys
.
indexOf
(
key
)
!=
-
1
)
{
// 第一次打开APP,不存在lifeData变量,故放一个{}空对象
// 获取本地存储的lifeData对象,将变量添加到对象中
tmp
=
tmp
?
tmp
:
{};
let
tmp
=
uni
.
getStorageSync
(
'lifeData'
);
tmp
[
key
]
=
value
;
// 第一次打开APP,不存在lifeData变量,故放一个{}空对象
// 执行这一步后,所有需要存储的变量,都挂载在本地的lifeData对象中
tmp
=
tmp
?
tmp
:
{};
uni
.
setStorageSync
(
'lifeData'
,
tmp
);
tmp
[
key
]
=
value
;
}
// 执行这一步后,所有需要存储的变量,都挂载在本地的lifeData对象中
}
uni
.
setStorageSync
(
'lifeData'
,
tmp
);
// 简化 vuex 操作,文档:https://uviewui.com/components/vuexDetail.html
}
const
store
=
new
Vuex
.
Store
({
}
state
:
{
// 简化 vuex 操作,文档:https://uviewui.com/components/vuexDetail.html
// 如果上面从本地获取的lifeData对象下有对应的属性,就赋值给state中对应的变量
const
store
=
new
Vuex
.
Store
({
// 加上vuex_前缀,是防止变量名冲突,也让人一目了然
state
:
{
vuex_user
:
lifeData
.
vuex_user
?
lifeData
.
vuex_user
:
{
userName
:
'Aidex'
},
// 如果上面从本地获取的lifeData对象下有对应的属性,就赋值给state中对应的变量
vuex_token
:
lifeData
.
vuex_token
?
lifeData
.
vuex_token
:
''
,
// 加上vuex_前缀,是防止变量名冲突,也让人一目了然
vuex_remember
:
lifeData
.
vuex_remember
?
lifeData
.
vuex_remember
:
''
,
vuex_user
:
lifeData
.
vuex_user
?
lifeData
.
vuex_user
:
{
vuex_locale
:
lifeData
.
vuex_locale
?
lifeData
.
vuex_locale
:
''
,
userName
:
'Aidex'
vuex_isAgent
:
lifeData
.
vuex_isAgent
?
lifeData
.
vuex_isAgent
:
''
,
},
vuex_token
:
lifeData
.
vuex_token
?
lifeData
.
vuex_token
:
''
,
vuex_remember
:
lifeData
.
vuex_remember
?
lifeData
.
vuex_remember
:
''
,
vuex_locale
:
lifeData
.
vuex_locale
?
lifeData
.
vuex_locale
:
''
,
vuex_isAgent
:
lifeData
.
vuex_isAgent
?
lifeData
.
vuex_isAgent
:
''
,
vuex_user_factory
:
lifeData
.
vuex_user_factory
||
'1000'
,
vuex_user_factory
:
lifeData
.
vuex_user_factory
||
'1000'
,
vuex_sales_outbound
:
lifeData
.
vuex_sales_outbound
||
{},
// 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式
vuex_config
:
config
,
// 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式
//当前设备绑定的工作站
vuex_config
:
config
,
vuex_workstation
:
null
,
//当前设备绑定的工作站
vuex_workunit
:
null
,
vuex_workstation
:
null
,
//当前工作站正在进行的生产任务
vuex_workunit
:
null
,
vuex_task
:
null
,
//当前工作站正在进行的生产任务
vuex_task
:
null
,
// 自定义tabbar数据
// vuex_tabbar: [{
// 自定义tabbar数据
// iconPath: "/static/uview/example/component.png",
// vuex_tabbar: [{
// selectedIconPath: "/static/uview/example/component_select.png",
// iconPath: "/static/uview/example/component.png",
// text: '组件',
// selectedIconPath: "/static/uview/example/component_select.png",
// pagePath: '/pages/example/components'
// text: '组件',
// },
// pagePath: '/pages/example/components'
// {
// },
// iconPath: "/static/uview/example/js.png",
// {
// selectedIconPath: "/static/uview/example/js_select.png",
// iconPath: "/static/uview/example/js.png",
// text: '工具',
// selectedIconPath: "/static/uview/example/js_select.png",
// midButton: true,
// text: '工具',
// pagePath: '/pages/example/js'
// midButton: true,
// },
// pagePath: '/pages/example/js'
// {
// },
// iconPath: "/static/uview/example/template.png",
// {
// selectedIconPath: "/static/uview/example/template_select.png",
// iconPath: "/static/uview/example/template.png",
// text: '模板',
// selectedIconPath: "/static/uview/example/template_select.png",
// pagePath: '/pages/example/template'
// text: '模板',
// }
// pagePath: '/pages/example/template'
// ]
// }
},
// ]
mutations
:
{
},
$uStore
(
state
,
payload
)
{
mutations
:
{
// 判断是否多层级调用,state中为对象存在的情况,诸如user.info.score = 1
$uStore
(
state
,
payload
)
{
let
nameArr
=
payload
.
name
.
split
(
'.'
);
// 判断是否多层级调用,state中为对象存在的情况,诸如user.info.score = 1
let
saveKey
=
''
;
let
nameArr
=
payload
.
name
.
split
(
'.'
);
let
len
=
nameArr
.
length
;
let
saveKey
=
''
;
if
(
len
>=
2
)
{
let
len
=
nameArr
.
length
;
let
obj
=
state
[
nameArr
[
0
]];
if
(
len
>=
2
)
{
for
(
let
i
=
1
;
i
<
len
-
1
;
i
++
)
{
let
obj
=
state
[
nameArr
[
0
]];
obj
=
obj
[
nameArr
[
i
]];
for
(
let
i
=
1
;
i
<
len
-
1
;
i
++
)
{
}
obj
=
obj
[
nameArr
[
i
]];
obj
[
nameArr
[
len
-
1
]]
=
payload
.
value
;
}
saveKey
=
nameArr
[
0
];
obj
[
nameArr
[
len
-
1
]]
=
payload
.
value
;
}
else
{
saveKey
=
nameArr
[
0
];
// 单层级变量,在state就是一个普通变量的情况
}
else
{
state
[
payload
.
name
]
=
payload
.
value
;
// 单层级变量,在state就是一个普通变量的情况
saveKey
=
payload
.
name
;
state
[
payload
.
name
]
=
payload
.
value
;
}
saveKey
=
payload
.
name
;
// 保存变量到本地,见顶部函数定义
}
saveLifeData
(
saveKey
,
state
[
saveKey
])
// 保存变量到本地,见顶部函数定义
}
saveLifeData
(
saveKey
,
state
[
saveKey
])
}
}
})
}
})
export
default
store
export
default
store
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