Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
Project
Project
Details
Activity
Releases
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
周远喜
mes-ui
Commits
c02693ba
Commit
c02693ba
authored
Apr 20, 2020
by
仇晓婷
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'product' of
http://git.mes123.com/zhouyx/mes-ui
into product
parents
d9c0b093
ad07d409
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
169 additions
and
149 deletions
+169
-149
user.vue
components/page/user.vue
+38
-43
henq.js
libs/henq.js
+11
-0
index.vue
pages/aps/dispatch/index.vue
+54
-9
index.js
store/index.js
+66
-97
No files found.
components/page/user.vue
View file @
c02693ba
...
@@ -2,22 +2,20 @@
...
@@ -2,22 +2,20 @@
<Poptip
placement=
"bottom-start"
trigger=
"hover"
width=
"240"
transfer
>
<Poptip
placement=
"bottom-start"
trigger=
"hover"
width=
"240"
transfer
>
<label
:class=
"css"
>
{{
user
.
name
}}
</label>
<label
:class=
"css"
>
{{
user
.
name
}}
</label>
<div
slot=
"content"
>
<div
slot=
"content"
>
<Avatar
<Avatar
v-if=
"user.face"
size=
"large"
:src=
"user.face"
></Avatar>
v-if=
"user.face"
size=
"large"
:src=
"user.face"
></Avatar>
<Avatar
<Avatar
v-else
v-else
size=
"large"
size=
"large"
style=
"color: #f56a00;background-color: #fde3cf; text-align:center"
style=
"color: #f56a00;background-color: #fde3cf; text-align:center"
:icon=
"user.gender=='男'?'md-person':'md-woman'"
:icon=
"user.gender=='男'?'md-person':'md-woman'"
></Avatar>
></Avatar>
<div>
姓名:
{{
user
.
name
}}
<div>
姓名:
{{
user
.
name
}}
<tag
v-if=
"user.isDeleted"
>
已删除
</tag>
<tag
v-if=
"user.isDeleted"
>
已删除
</tag>
</div>
</div>
<div>
状态:
<div>
<state
:value=
"user.status"
type=
"tag"
code=
"User.base.status"
/>
状态:
<state
:value=
"user.status"
type=
"tag"
code=
"User.base.status"
/>
</div>
</div>
<div>
性别:
{{
user
.
gender
}}
</div>
<div>
性别:
{{
user
.
gender
}}
</div>
<div>
部门:
{{
user
.
department
}}
</div>
<div>
部门:
{{
user
.
department
}}
</div>
...
@@ -27,7 +25,7 @@
...
@@ -27,7 +25,7 @@
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{
export
default
{
name
:
'User'
,
name
:
"User"
,
props
:
{
props
:
{
value
:
{
value
:
{
type
:
[
Number
,
String
],
type
:
[
Number
,
String
],
...
@@ -38,58 +36,55 @@ export default {
...
@@ -38,58 +36,55 @@ export default {
return
{
return
{
user
:
{
user
:
{
name
:
this
.
value
,
name
:
this
.
value
,
face
:
''
,
face
:
""
,
gender
:
''
,
gender
:
""
,
roles
:
''
,
roles
:
""
,
department
:
''
,
status
:
0
,
loginName
:
''
,
department
:
""
,
loginName
:
""
,
id
:
0
id
:
0
},
},
css
:
"s0"
css
:
"s0"
}
}
;
},
},
mounted
()
{
mounted
()
{
//{"id":77,"name":"杨华馥","gender":"男","department":"北京生产车间","roles":"admin","status":1,"isDeleted":false}
//{"id":77,"name":"杨华馥","gender":"男","department":"北京生产车间","roles":"admin","status":1,"isDeleted":false}
this
.
load
()
this
.
load
()
;
},
},
methods
:
{
methods
:
{
load
()
{
load
()
{
if
(
this
.
value
)
{
if
(
this
.
value
)
{
var
user
=
this
.
$store
.
getters
.
getUser
(
this
.
value
)
var
user
=
this
.
$store
.
getters
.
getUser
(
this
.
value
)
;
if
(
user
)
{
if
(
user
)
{
this
.
user
=
user
this
.
user
=
user
;
}
else
{
if
(
this
.
user
.
isDeleted
)
{
this
.
$api
this
.
css
=
"s2"
;
.
get
(
`
${
systemUrl
}
/user/getuser`
,
{
id
:
this
.
value
})
}
else
if
(
this
.
user
.
status
==
1
)
{
.
then
((
r
)
=>
{
this
.
css
=
"s1"
;
// alert(JSON.stringify( r.result))
}
if
(
r
.
success
)
{
if
(
this
.
user
.
face
)
{
this
.
user
=
r
.
result
this
.
user
.
face
=
fileUrlDown
+
this
.
user
.
face
;
if
(
this
.
user
.
isDeleted
){
}
this
.
css
=
"s2"
}
else
if
(
this
.
user
.
status
==
1
){
this
.
css
=
"s1"
}
if
(
this
.
user
.
face
){
this
.
user
.
face
=
fileUrlDown
+
this
.
user
.
face
;
}
// this.$store.commit('addUser', r.result)
}
})
}
}
}
}
}
}
},
},
watch
:
{
watch
:
{
value
(
v
)
{
value
(
v
)
{
if
(
v
>
0
)
this
.
load
()
if
(
v
>
0
)
this
.
load
()
;
}
}
}
}
}
}
;
</
script
>
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
.s2{color: red;}
.s2 {
.s1{color: #333}
color: red;
.s0{color:#ddd}
}
.s1 {
color: #333;
}
.s0 {
color: #ddd;
}
</
style
>
</
style
>
\ No newline at end of file
libs/henq.js
View file @
c02693ba
...
@@ -96,6 +96,17 @@ henq.getDate = (strDate) => {
...
@@ -96,6 +96,17 @@ henq.getDate = (strDate) => {
}).
match
(
/
\d
+/g
)
+
')'
);
}).
match
(
/
\d
+/g
)
+
')'
);
return
date
;
return
date
;
}
}
henq
.
group
=
(
array
,
f
)
=>
{
const
groups
=
{};
array
.
forEach
(
function
(
o
)
{
const
group
=
JSON
.
stringify
(
f
(
o
));
groups
[
group
]
=
groups
[
group
]
||
[];
groups
[
group
].
push
(
o
);
});
return
Object
.
keys
(
groups
).
map
(
function
(
group
)
{
return
groups
[
group
];
});
}
henq
.
toTree
=
(
list
,
rootId
,
format
,
parentFiledName
)
=>
{
henq
.
toTree
=
(
list
,
rootId
,
format
,
parentFiledName
)
=>
{
var
upId
=
parentFiledName
;
var
upId
=
parentFiledName
;
let
i
=
0
;
let
i
=
0
;
...
...
pages/aps/dispatch/index.vue
View file @
c02693ba
...
@@ -14,10 +14,21 @@
...
@@ -14,10 +14,21 @@
<Radio
label=
"2"
>
已排产
</Radio>
<Radio
label=
"2"
>
已排产
</Radio>
</RadioGroup>
</RadioGroup>
共
{{
listTask
.
length
}}
条
共
{{
listTask
.
length
}}
条
<span
class=
"check"
>
<RadioGroup
v-model=
"listShow"
type=
"button"
size=
"small"
>
<Radio
label=
"订单"
title=
"订单分类"
>
<Icon
type=
"ios-albums"
/>
</Radio>
<Radio
label=
"工单"
title=
"时间顺序"
>
<Icon
type=
"ios-calendar"
/>
</Radio>
</RadioGroup>
</span>
</p>
</p>
<div
class=
"dispatch_part_body"
:style=
"
{height:byheight}">
<div
class=
"dispatch_part_body"
:style=
"
{height:byheight}">
<!--
{{
ids
}}
-->
<!--
{{
ids
}}
-->
<Row
:gutter=
"15"
class=
"card_body01"
>
<Row
:gutter=
"15"
class=
"card_body01"
>
<!--
<p>
订单号:
{{
item
.
mesCode
}}
</p>
v-for="(item,index) in listTask" :key="index" -->
<Col
span=
"8"
class=
"dispatch_card"
v-for=
"(item,index) in listTask"
:key=
"index"
>
<Col
span=
"8"
class=
"dispatch_card"
v-for=
"(item,index) in listTask"
:key=
"index"
>
<Card>
<Card>
<p
slot=
"title"
class=
"card_top"
>
<p
slot=
"title"
class=
"card_top"
>
...
@@ -247,6 +258,7 @@ export default {
...
@@ -247,6 +258,7 @@ export default {
byheight
:
'450px'
,
byheight
:
'450px'
,
button1
:
'全部'
,
button1
:
'全部'
,
button2
:
'设备'
,
button2
:
'设备'
,
listShow
:
'订单'
,
shebei
:
''
,
shebei
:
''
,
dateRange
:
{
dateRange
:
{
//禁选工时时间区间
//禁选工时时间区间
...
@@ -428,13 +440,6 @@ export default {
...
@@ -428,13 +440,6 @@ export default {
let
formData
=
this
.
listTask
let
formData
=
this
.
listTask
let
timebegin
=
formData
[
0
].
beginTime
let
timebegin
=
formData
[
0
].
beginTime
let
timend
=
formData
[
0
].
endTime
let
timend
=
formData
[
0
].
endTime
if
(
this
.
button2
==
'设备'
)
{
this
.
entity
.
taskTime
=
[
timebegin
,
timend
]
this
.
facilityModal
=
true
}
else
{
this
.
pentity
.
taskTime
=
[
timebegin
,
timend
]
this
.
manModal
=
true
}
this
.
newList
=
[]
this
.
newList
=
[]
chekids
.
forEach
((
v
)
=>
{
chekids
.
forEach
((
v
)
=>
{
var
item
=
formData
.
filter
((
u
)
=>
{
var
item
=
formData
.
filter
((
u
)
=>
{
...
@@ -444,6 +449,20 @@ export default {
...
@@ -444,6 +449,20 @@ export default {
this
.
newList
.
push
(
item
[
0
])
this
.
newList
.
push
(
item
[
0
])
}
}
})
})
if
(
this
.
button2
==
'设备'
)
{
this
.
entity
.
taskTime
=
[
timebegin
,
timend
]
this
.
facilityModal
=
true
}
else
{
this
.
pentity
.
taskTime
=
[
timebegin
,
timend
]
if
(
formData
.
map
(
t
=>
{
this
.
newList
.
filter
(
m
=>
{
m
.
id
=
t
.
id
})
})){
}
this
.
manModal
=
true
}
console
.
log
(
'选中的数据'
,
this
.
newList
)
console
.
log
(
'选中的数据'
,
this
.
newList
)
},
},
// 设备派工
// 设备派工
...
@@ -481,7 +500,11 @@ export default {
...
@@ -481,7 +500,11 @@ export default {
// console.log(item)
// console.log(item)
this
.
$refs
[
'formpepole'
].
validate
((
valid
)
=>
{
this
.
$refs
[
'formpepole'
].
validate
((
valid
)
=>
{
if
(
valid
){
if
(
valid
){
Api
.
saveTeamentry
(
item
).
then
((
res
)
=>
{
let
params
=
{
isDispatch
:
1
,
//派工是1,保存是0
entryList
:
item
}
Api
.
saveTeamentry
(
params
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
if
(
res
.
success
)
{
this
.
$Message
.
success
(
'人员派工成功。'
)
this
.
$Message
.
success
(
'人员派工成功。'
)
this
.
getUserInfoFn
()
this
.
getUserInfoFn
()
...
@@ -494,7 +517,6 @@ export default {
...
@@ -494,7 +517,6 @@ export default {
this
.
$Message
.
error
(
'校验不通过...'
)
this
.
$Message
.
error
(
'校验不通过...'
)
}
}
})
})
},
},
// 拆分方法
// 拆分方法
setChai
(
item
,
index
)
{
setChai
(
item
,
index
)
{
...
@@ -512,6 +534,29 @@ export default {
...
@@ -512,6 +534,29 @@ export default {
detail
.
pid
=
this
.
$u
.
guid
()
detail
.
pid
=
this
.
$u
.
guid
()
detail
.
quantity
=
this
.
chaiNum
detail
.
quantity
=
this
.
chaiNum
this
.
listTask
.
splice
(
this
.
rowIndex
+
1
,
0
,
detail
)
this
.
listTask
.
splice
(
this
.
rowIndex
+
1
,
0
,
detail
)
this
.
saveFameData
()
},
// 拆分保存
saveFameData
()
{
// let item = this.newList
// item.map((u) => {
// u.userIds = this.peploeId
// u.remark = this.pentity.remark
// })
// console.log(item)
let
params
=
{
isDispatch
:
0
,
//派工是1,保存是0
entryList
:
this
.
listTask
}
Api
.
saveTeamentry
(
params
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
$Message
.
success
(
'拆分成功。'
)
// this.getUserInfoFn()
// this.manModal = false
}
else
{
this
.
$Message
.
error
(
'拆分失败...'
)
}
})
},
},
// 删除行
// 删除行
removeDetail
(
item
,
index
)
{
removeDetail
(
item
,
index
)
{
...
...
store/index.js
View file @
c02693ba
import
createVuexAlong
from
'vuex-along'
import
createVuexAlong
from
'vuex-along'
import
Api
from
'@/plugins/request'
import
Api
from
'@/plugins/request'
export
const
state
=
()
=>
({
export
const
state
=
()
=>
({
counter
:
0
,
counter
:
0
,
dictionary
:
new
Map
(),
//所有字典项
dictionary
:
new
Map
(),
//所有字典项
userMap
:
[],
//所有用户缓存;
userMap
:
new
Map
(),
//所有用户缓存;
userInfo
:
{
userInfo
:{
userId
:
0
,
userId
:
0
,
userName
:
""
userName
:
""
},
}
cart
:[],
count
:
0
,
countAps
:
0
,
//aps排产
countAi
:
0
,
//智能排产
countAll
:
0
,
//整机排产
countRun
:
0
,
//流水排产
})
})
export
const
getters
=
{
export
const
getters
=
{
dictionaryByKey
:
(
state
)
=>
(
key
)
=>
{
dictionaryByKey
:
(
state
)
=>
(
key
)
=>
{
if
(
state
.
dictionary
){
return
;
}
let
result
=
[];
let
result
=
[];
let
items
=
state
.
dictionary
.
get
(
key
);
let
items
=
state
.
dictionary
.
get
(
key
);
if
(
items
)
{
if
(
items
)
{
...
@@ -25,79 +22,51 @@ export const getters = {
...
@@ -25,79 +22,51 @@ export const getters = {
}
}
return
result
;
return
result
;
},
},
getUser
:
state
=>
key
=>
{
getUser
:(
state
)
=>
key
=>
{
// try{
// debugger
// if(state.userMap.has(key)){
if
(
state
.
userMap
&&
state
.
userMap
.
get
){
// return state.userMap.get(key);
return
state
.
userMap
.
get
(
key
);
// }
// }catch(e){
// console.log(e);
// }
let
user
=
state
.
userMap
.
filter
(
u
=>
{
return
u
.
id
==
key
});
if
(
user
.
length
>
0
)
{
return
user
[
0
]
}
else
{
return
null
;
}
}
}
}
}
}
export
const
mutations
=
{
export
const
mutations
=
{
increment
(
state
)
{
increment
(
state
){
state
.
counter
++
state
.
counter
++
},
},
setUserInfo
(
state
,
userInfo
)
{
setUserInfo
(
state
,
userInfo
)
{
state
.
userInfo
=
userInfo
;
state
.
userInfo
=
userInfo
;
// sessionStorage.setItem("userInfo", JSON.stringify(userInfo));
// sessionStorage.setItem("userInfo", JSON.stringify(userInfo));
// sessionStorage.setItem("token", userInfo.token);
// sessionStorage.setItem("token", userInfo.token);
},
},
addUser
(
state
,
user
)
{
setUsers
(
state
,
users
){
state
.
userMap
.
push
(
user
);
state
.
userMap
=
users
;
},
},
setDictionary
(
state
,
dictionary
)
{
addUser
(
state
,
user
){
state
.
dictionary
=
dictionary
;
state
.
userMap
.
push
(
user
);
},
},
setCart
(
state
,
cart
)
{
setDictionary
(
state
,
dictionary
)
{
state
.
cart
=
cart
;
state
.
dictionary
=
dictionary
;
},
},
setCartCount
(
state
,
count
)
{
state
.
count
=
count
;
},
setCountAps
(
state
,
count
)
{
//设置aps排产数量
state
.
countAps
=
count
;
},
setCountAi
(
state
,
count
)
{
//设置智能排产数量
state
.
countAi
=
count
;
},
setCountAll
(
state
,
count
)
{
//设置整机排产数量
state
.
countAll
=
count
;
},
setCountRun
(
state
,
count
)
{
//设置流水排产数量
state
.
countRun
=
count
;
}
}
}
export
const
actions
=
{
export
const
actions
=
{
async
loadUser
({
async
loadUser
({
commit
},
key
){
commit
},
key
)
{
let
{
result
}
=
await
Api
.
get
(
`
${
systemUrl
}
/user/getuser`
,{
id
:
key
});
console
.
warn
(
"result"
,
result
)
let
{
commit
(
"addUser"
,
result
);
result
},
}
=
await
this
.
$api
.
get
(
`
${
systemUrl
}
/user/getuser`
,
{
async
loadUsers
({
commit
}){
id
:
key
let
{
result
}
=
await
Api
.
get
(
`
${
systemUrl
}
/user/getuserlist`
);
var
map
=
new
Map
();
result
.
map
(
u
=>
{
map
.
set
(
u
.
id
,
u
);
});
});
console
.
warn
(
"result"
,
result
)
commit
(
"setUsers"
,
map
)
commit
(
"addUser"
,
result
);
},
},
async
loadDictionary
({
async
loadDictionary
({
commit
})
{
commit
})
{
let
url
=
`
${
systemUrl
}
/Dictionary/GetAll`
let
url
=
`
${
systemUrl
}
/Dictionary/GetAll`
let
{
let
{
result
}
=
await
Api
.
get
(
url
);
result
}
=
await
Api
.
get
(
url
);
var
map
=
new
Map
();
var
map
=
new
Map
();
...
@@ -110,20 +79,20 @@ export const actions = {
...
@@ -110,20 +79,20 @@ export const actions = {
}
}
}
}
export
const
plugins
=
[
export
const
plugins
=
[
createVuexAlong
({
createVuexAlong
({
// 设置保存的集合名字,避免同站点下的多项目数据冲突
// 设置保存的集合名字,避免同站点下的多项目数据冲突
name
:
"hyhmes"
,
name
:
"hyhmes"
,
local
:
{
local
:
{
list
:
[
"hyhmes"
],
list
:
[
"hyhmes"
],
// 过滤模块 ma 数据, 将其他的存入 localStorage
// 过滤模块 ma 数据, 将其他的存入 localStorage
isFilter
:
true
,
isFilter
:
true
,
},
},
session
:
{
session
:
{
// 保存模块 ma 中的 a1 到 sessionStorage
// 保存模块 ma 中的 a1 到 sessionStorage
list
:
[
"hyhmes.session"
],
list
:
[
"hyhmes.session"
],
},
},
}),
}),
]
]
//设置 strict 为不严格模式,即可在actions中修改state
//设置 strict 为不严格模式,即可在actions中修改state
export
const
strict
=
false
;
export
const
strict
=
false
;
\ No newline at end of file
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