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
788836a2
Commit
788836a2
authored
Oct 09, 2020
by
仇晓婷
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'product' of
http://git.mes123.com/zhouyx/mes-ui
into product
parents
e6203135
963b2aa4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1320 additions
and
1372 deletions
+1320
-1372
userSelect.vue
components/page/userSelect.vue
+403
-412
detail.vue
pages/handle/examine1/detail.vue
+94
-69
index.vue
pages/handle/index.vue
+276
-306
index.vue
pages/mesPlan/index.vue
+1
-0
index.vue
pages/resource/resource/index.vue
+546
-585
No files found.
components/page/userSelect.vue
View file @
788836a2
<
template
>
<
template
>
<div>
<div>
<div
v-if=
"theme == 'list'"
class=
"flex fd userSelect"
>
<div
v-if=
"theme == 'list'"
class=
"flex fd userSelect"
>
<div
class=
"fg1 users"
>
<div
class=
"fg1 users"
>
<dl
v-for=
"(g, i) in group"
:key=
"i"
>
<dl
v-for=
"(g, i) in group"
:key=
"i"
>
<dt
:class=
"
{ checked: g.opened }" class="flex fc-b">
<dt
:class=
"
{ checked: g.opened }" class="flex fc-b">
<div
class=
"ib fg"
>
<div
class=
"ib fg"
>
<Checkbox
v-model=
"g.checked"
@
on-change=
"checkAll(g, i)"
>
<Checkbox
v-model=
"g.checked"
@
on-change=
"checkAll(g, i)"
>
<span
class=
"ml10"
>
{{
g
.
departmentTitle
}}
</span>
<span
class=
"ml10"
>
{{
g
.
departmentTitle
}}
</span>
</Checkbox>
</Checkbox>
<!--
<span
class=
"ml20"
>
(
<span
v-text=
"g.children | vvv"
></span>
/
{{
g
.
children
.
length
}}
人)
</span></div>
-->
<!--
<span
class=
"ml20"
>
(
<span
v-text=
"g.children | vvv"
></span>
/
{{
g
.
children
.
length
}}
人)
</span></div>
-->
<span
class=
"ml20"
>
(
{{
g
.
children
.
length
}}
人)
</span>
<span
class=
"ml20"
>
(
{{
g
.
children
.
length
}}
人)
</span>
</div>
</div>
<a
class=
"op"
@
click=
"toggle(i)"
>
<a
class=
"op"
@
click=
"toggle(i)"
>
<Icon
<Icon
:type=
"g.opened ? 'ios-arrow-up' : 'ios-arrow-down'"
size=
"24"
/>
:type=
"g.opened ? 'ios-arrow-up' : 'ios-arrow-down'"
</a>
size=
"24"
</dt>
/>
<dd
v-show=
"g.opened"
v-for=
"(li, j) in g.children"
:key=
"j"
@
click=
"checkItem(i, j, li)"
:class=
"
{ checked: li.checked }">
</a>
{{
li
.
userName
}}
</dt>
</dd>
<dd
</dl>
v-show=
"g.opened"
v-for=
"(li, j) in g.children"
:key=
"j"
@
click=
"checkItem(i, j, li)"
:class=
"
{ checked: li.checked }"
>
{{
li
.
userName
}}
</dd>
</dl>
</div>
<div
class=
"footer flex"
>
<div
v-width=
"50"
class=
"fa-m fs"
>
<span>
已选项
</span>
</div>
</div>
<div
class=
"fg"
>
<div
class=
"footer flex"
>
<dl>
<div
v-width=
"50"
class=
"fa-m fs"
>
<dd
v-for=
"(li, i) in checkedItems"
:key=
"i"
>
<span>
已选项
</span>
<div
class=
"flex"
>
</div>
<span
class=
"fg"
>
{{
li
.
userName
}}
</span>
<div
class=
"fg"
>
<a
@
click=
"removeItem(li)"
>
<dl>
<Icon
type=
"md-close"
size=
"16"
/>
<dd
v-for=
"(li, i) in checkedItems"
:key=
"i"
>
</a>
<div
class=
"flex"
>
</div>
<span
class=
"fg"
>
{{
li
.
userName
}}
</span>
</dd>
<a
@
click=
"removeItem(li)"
>
</dl>
<Icon
type=
"md-close"
size=
"16"
/>
</a>
</div>
</dd>
</dl>
</div>
</div>
</div>
</div>
</div>
</div>
<Select
<Select
v-else
:placeholder=
"placeholder"
v-model=
"name"
@
on-change=
"change"
:multiple=
"multiple"
:departmentId=
"departmentId"
clearable
filterable
>
v-else
<Option
v-for=
"item in datas ? datas : dic"
:value=
"item.value"
:key=
"item.value"
:label=
"item.label"
>
:placeholder=
"placeholder"
<div>
v-model=
"name"
{{
item
.
label
}}
@
on-change=
"change"
<span
style=
"color: #c3c3c3"
v-if=
"item.cardNo"
>
(
{{
item
.
cardNo
}}
)
</span>
:multiple=
"multiple"
<br
/>
:departmentId=
"departmentId"
<span
style=
"color: #c3c3c3"
v-if=
"item.departmentTitle"
>
{{
clearable
filterable
>
<Option
v-for=
"item in datas ? datas : dic"
:value=
"item.value"
:key=
"item.value"
:label=
"item.label"
>
<div>
{{
item
.
label
}}
<span
style=
"color: #c3c3c3"
v-if=
"item.cardNo"
>
(
{{
item
.
cardNo
}}
)
</span
>
<br
/>
<span
style=
"color: #c3c3c3"
v-if=
"item.departmentTitle"
>
{{
item
.
departmentTitle
item
.
departmentTitle
}}
</span>
}}
</span>
</div>
</div>
</Option>
</Option>
</Select>
</Select>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{
export
default
{
model
:
{
model
:
{
prop
:
"value"
,
prop
:
"value"
,
event
:
"on-change"
,
event
:
"on-change"
,
},
data
()
{
return
{
name
:
this
.
value
,
data
:
[],
departId
:
""
,
group
:
[],
};
},
created
()
{
// let url = `${systemUrl}/user/getfordispatch_x`
// this.$api.get(url).then((r) => {
// this.data = r.result
// })
this
.
getselectuser
();
},
props
:
{
value
:
[
String
,
Number
,
Array
],
placeholder
:
{
type
:
String
,
default
:
"请选择人员"
,
},
multiple
:
{
type
:
Boolean
,
default
:
false
,
},
theme
:
{
type
:
String
,
default
:
"select"
,
},
type
:
{
type
:
Number
,
default
:
0
,
},
departmentId
:
{
type
:
Number
,
default
:
0
,
},
},
roleTitle
:
{
data
()
{
type
:
String
,
return
{
default
:
""
,
name
:
this
.
value
,
},
data
:
[],
datas
:
{
departId
:
""
,
//自定义用户数据
group
:
[],
type
:
Array
,
default
:
null
,
},
},
methods
:
{
change
(
event
)
{
let
name
=
""
;
this
.
data
.
forEach
((
e
)
=>
{
if
(
e
.
id
==
event
)
{
name
=
e
.
label
;
}
});
this
.
$emit
(
"on-change"
,
event
,
name
);
},
// 加载人员
getselectuser
(
id
)
{
let
url
=
`
${
systemUrl
}
/user/getselectuser`
;
var
paras
=
{
// pageIndex: 1,
departmentId
:
id
,
type
:
this
.
type
,
roleTitle
:
this
.
roleTitle
,
// pageSize: 0
};
};
if
(
this
.
type
=
99
){
//开发组
paras
=
{
conditions
:[
{
fieldName
:
"UserType"
,
fieldValue
:
"2"
,
conditionalType
:
"Equal"
,
},
]
};
}
this
.
$api
.
post
(
url
,
paras
)
.
then
((
r
)
=>
{
this
.
data
=
r
.
result
;
if
(
this
.
theme
==
"list"
)
{
this
.
departmentGroup
();
}
});
},
departmentGroup
()
{
var
group
=
[];
var
users
=
this
.
$u
.
clone
(
this
.
data
);
if
(
this
.
name
&&
this
.
name
.
length
>
0
)
{
users
.
map
((
u
)
=>
{
u
.
checked
=
this
.
name
.
indexOf
(
u
.
id
)
>
-
1
;
});
}
group
=
this
.
$u
.
group
(
users
,
(
u
)
=>
{
return
u
.
departmentId
;
});
var
deps
=
[];
group
.
map
((
u
,
i
)
=>
{
deps
.
push
({
departmentTitle
:
u
[
0
].
departmentTitle
,
departmentId
:
u
[
0
].
departmentId
,
children
:
u
,
opened
:
(
i
=
0
),
checked
:
false
,
});
});
this
.
group
=
deps
;
},
toggle
(
i
)
{
this
.
group
[
i
].
opened
=
!
this
.
group
[
i
].
opened
;
// this.$set(this.group,i,this.group[i])
},
checkItem
(
i
,
j
,
item
)
{
item
.
checked
=
!
item
.
checked
;
this
.
group
[
i
][
j
]
=
item
;
this
.
$set
(
this
.
group
,
i
,
this
.
group
[
i
]);
this
.
listSetValue
();
},
},
removeItem
(
item
)
{
created
()
{
this
.
group
.
map
((
u
,
i
)
=>
{
// let url = `${systemUrl}/user/getfordispatch_x`
if
(
u
.
departmentId
==
item
.
departmentId
)
{
// this.$api.get(url).then((r) => {
u
.
children
.
map
((
p
)
=>
{
// this.data = r.result
if
(
p
.
id
==
item
.
id
)
{
// })
p
.
checked
=
false
;
this
.
getselectuser
();
}
});
this
.
$set
(
this
.
group
,
i
,
u
);
}
});
this
.
listSetValue
();
},
//list 时,设置值。
listSetValue
()
{
var
ids
=
[];
this
.
checkedItems
.
map
((
u
)
=>
{
ids
.
push
(
u
.
id
);
});
this
.
$emit
(
"on-change"
,
ids
);
},
},
checkAll
(
item
,
i
)
{
props
:
{
item
.
children
.
map
((
u
)
=>
{
value
:
[
String
,
Number
,
Array
],
u
.
checked
=
item
.
checked
;
placeholder
:
{
});
type
:
String
,
this
.
$set
(
this
.
group
,
i
,
this
.
group
[
i
]);
default
:
"请选择人员"
,
this
.
listSetValue
();
},
multiple
:
{
type
:
Boolean
,
default
:
false
,
},
theme
:
{
type
:
String
,
default
:
"select"
,
},
type
:
{
type
:
Number
,
default
:
0
,
},
departmentId
:
{
type
:
Number
,
default
:
0
,
},
roleTitle
:
{
type
:
String
,
default
:
""
,
},
datas
:
{
//自定义用户数据
type
:
Array
,
default
:
null
,
},
},
},
//获取所有的选中项
methods
:
{
getSelectItems
()
{
change
(
event
)
{
var
items
=
[];
let
name
=
""
;
if
(
this
.
theme
==
"list"
)
{
this
.
data
.
forEach
((
e
)
=>
{
this
.
checkedItems
.
map
((
u
)
=>
{
if
(
e
.
id
==
event
)
{
items
.
push
(
u
);
name
=
e
.
label
;
});
}
}
else
{
});
if
(
!
this
.
multiple
)
{
this
.
$emit
(
"on-change"
,
event
,
name
);
//单选时返回信息
},
if
(
this
.
datas
&&
this
.
datas
.
length
>
0
)
{
// 加载人员
var
item2
=
this
.
datas
.
filter
((
u
)
=>
u
.
value
==
this
.
value
);
getselectuser
(
id
)
{
if
(
item2
&&
item2
[
0
])
{
let
url
=
`
${
systemUrl
}
/user/getselectuser`
;
items
.
push
(
item2
[
0
]);
var
paras
=
{
// pageIndex: 1,
departmentId
:
id
,
type
:
this
.
type
,
roleTitle
:
this
.
roleTitle
,
// pageSize: 0
};
if
(
this
.
type
==
99
)
{
//开发组
paras
=
{
conditions
:
[{
fieldName
:
"UserType"
,
fieldValue
:
"2"
,
conditionalType
:
"Equal"
,
},
]
};
}
}
}
else
{
this
.
$api
var
item1
=
this
.
dic
.
filter
((
u
)
=>
u
.
value
==
this
.
value
);
.
post
(
url
,
paras
)
if
(
item1
&&
item1
[
0
])
{
.
then
((
r
)
=>
{
items
.
push
(
item1
[
0
]);
this
.
data
=
r
.
result
;
if
(
this
.
theme
==
"list"
)
{
this
.
departmentGroup
();
}
});
},
departmentGroup
()
{
var
group
=
[];
var
users
=
this
.
$u
.
clone
(
this
.
data
);
if
(
this
.
name
&&
this
.
name
.
length
>
0
)
{
users
.
map
((
u
)
=>
{
u
.
checked
=
this
.
name
.
indexOf
(
u
.
id
)
>
-
1
;
});
}
}
}
group
=
this
.
$u
.
group
(
users
,
(
u
)
=>
{
}
else
{
return
u
.
departmentId
;
//复选时返回
if
(
this
.
datas
&&
this
.
datas
.
length
>
0
)
{
this
.
value
.
forEach
((
v
)
=>
{
var
item3
=
this
.
dic
.
filter
((
u
)
=>
u
.
value
==
v
);
if
(
item3
&&
item3
[
0
])
{
items
.
push
(
item3
[
0
]);
}
});
});
}
else
{
var
deps
=
[];
this
.
value
.
forEach
((
v
)
=>
{
group
.
map
((
u
,
i
)
=>
{
var
item
=
this
.
dic
.
filter
((
u
)
=>
u
.
value
==
v
);
deps
.
push
({
if
(
item
&&
item
[
0
])
{
departmentTitle
:
u
[
0
].
departmentTitle
,
items
.
push
(
item
[
0
]);
departmentId
:
u
[
0
].
departmentId
,
}
children
:
u
,
opened
:
(
i
=
0
),
checked
:
false
,
});
});
});
}
this
.
group
=
deps
;
}
},
}
toggle
(
i
)
{
this
.
group
[
i
].
opened
=
!
this
.
group
[
i
].
opened
;
// this.$set(this.group,i,this.group[i])
},
checkItem
(
i
,
j
,
item
)
{
item
.
checked
=
!
item
.
checked
;
this
.
group
[
i
][
j
]
=
item
;
this
.
$set
(
this
.
group
,
i
,
this
.
group
[
i
]);
this
.
listSetValue
();
},
removeItem
(
item
)
{
this
.
group
.
map
((
u
,
i
)
=>
{
if
(
u
.
departmentId
==
item
.
departmentId
)
{
u
.
children
.
map
((
p
)
=>
{
if
(
p
.
id
==
item
.
id
)
{
p
.
checked
=
false
;
}
});
this
.
$set
(
this
.
group
,
i
,
u
);
}
});
this
.
listSetValue
();
},
//list 时,设置值。
listSetValue
()
{
var
ids
=
[];
this
.
checkedItems
.
map
((
u
)
=>
{
ids
.
push
(
u
.
id
);
});
this
.
$emit
(
"on-change"
,
ids
);
},
checkAll
(
item
,
i
)
{
item
.
children
.
map
((
u
)
=>
{
u
.
checked
=
item
.
checked
;
});
this
.
$set
(
this
.
group
,
i
,
this
.
group
[
i
]);
this
.
listSetValue
();
},
//获取所有的选中项
getSelectItems
()
{
var
items
=
[];
if
(
this
.
theme
==
"list"
)
{
this
.
checkedItems
.
map
((
u
)
=>
{
items
.
push
(
u
);
});
}
else
{
if
(
!
this
.
multiple
)
{
//单选时返回信息
if
(
this
.
datas
&&
this
.
datas
.
length
>
0
)
{
var
item2
=
this
.
datas
.
filter
((
u
)
=>
u
.
value
==
this
.
value
);
if
(
item2
&&
item2
[
0
])
{
items
.
push
(
item2
[
0
]);
}
}
else
{
var
item1
=
this
.
dic
.
filter
((
u
)
=>
u
.
value
==
this
.
value
);
if
(
item1
&&
item1
[
0
])
{
items
.
push
(
item1
[
0
]);
}
}
}
else
{
//复选时返回
if
(
this
.
datas
&&
this
.
datas
.
length
>
0
)
{
this
.
value
.
forEach
((
v
)
=>
{
var
item3
=
this
.
dic
.
filter
((
u
)
=>
u
.
value
==
v
);
if
(
item3
&&
item3
[
0
])
{
items
.
push
(
item3
[
0
]);
}
});
}
else
{
this
.
value
.
forEach
((
v
)
=>
{
var
item
=
this
.
dic
.
filter
((
u
)
=>
u
.
value
==
v
);
if
(
item
&&
item
[
0
])
{
items
.
push
(
item
[
0
]);
}
});
}
}
}
return
items
;
return
items
;
},
},
//获取所有选中项的名称
//获取所有选中项的名称
getSelectNames
()
{
getSelectNames
()
{
var
names
=
[];
var
names
=
[];
if
(
this
.
theme
==
"list"
)
{
if
(
this
.
theme
==
"list"
)
{
this
.
checkedItems
.
map
((
u
)
=>
{
this
.
checkedItems
.
map
((
u
)
=>
{
items
.
push
(
u
.
userName
);
items
.
push
(
u
.
userName
);
});
});
}
else
{
}
else
{
this
.
getSelectItems
().
forEach
((
v
)
=>
{
this
.
getSelectItems
().
forEach
((
v
)
=>
{
names
.
push
(
v
.
label
);
names
.
push
(
v
.
label
);
});
});
}
}
return
names
;
return
names
;
},
},
},
computed
:
{
dic
()
{
let
result
=
[];
this
.
data
.
forEach
((
u
)
=>
{
// result.push({
// value: u.id,
// label: u.userName
// })
(
u
.
value
=
u
.
id
),
(
u
.
label
=
u
.
userName
);
result
.
push
(
u
);
});
return
result
;
},
checkedItems
()
{
var
items
=
[];
this
.
group
.
map
((
u
)
=>
{
u
.
children
.
map
((
l
)
=>
{
if
(
l
.
checked
)
{
items
.
push
(
l
);
}
});
});
return
items
;
},
},
filters
:
{
vvv
:
(
lis
)
=>
{
return
3
;
// return lis.filter(u=>{
// return u.checked==true
// }).lenght;
},
},
},
computed
:
{
watch
:
{
dic
()
{
value
:
{
let
result
=
[];
handler
(
v
,
o
)
{
this
.
data
.
forEach
((
u
)
=>
{
this
.
name
=
v
;
// result.push({
},
// value: u.id,
deep
:
true
,
// label: u.userName
// })
(
u
.
value
=
u
.
id
),
(
u
.
label
=
u
.
userName
);
result
.
push
(
u
);
});
return
result
;
},
checkedItems
()
{
var
items
=
[];
this
.
group
.
map
((
u
)
=>
{
u
.
children
.
map
((
l
)
=>
{
if
(
l
.
checked
)
{
items
.
push
(
l
);
}
});
});
return
items
;
},
},
},
departmentId
:
{
filters
:
{
handler
(
v
,
o
)
{
vvv
:
(
lis
)
=>
{
this
.
getselectuser
(
v
);
return
3
;
},
// return lis.filter(u=>{
deep
:
true
,
// return u.checked==true
// }).lenght;
},
},
},
datas
(
v
)
{
watch
:
{
if
(
v
)
{
value
:
{
//alert(JSON.stringify(v))
handler
(
v
,
o
)
{
}
this
.
name
=
v
;
},
deep
:
true
,
},
departmentId
:
{
handler
(
v
,
o
)
{
this
.
getselectuser
(
v
);
},
deep
:
true
,
},
datas
(
v
)
{
if
(
v
)
{
//alert(JSON.stringify(v))
}
},
},
},
},
};
};
</
script
>
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
@import "../../assets/css/custom.less";
@import "../../assets/css/custom.less";
.userSelect {
.userSelect {
.users {
.users {
width: 100%;
width: 100%;
border: 1px solid #2680eb;
border: 1px solid #2680eb;
max-height: 420px;
max-height: 420px;
overflow: auto;
overflow: auto;
font-size: 14px;
font-size: 14px;
}
dl {
width: 100%;
margin-bottom: 2px;
dt,
dd {
list-style: none;
padding: 0 15px;
}
dt {
width: 100%;
background: rgba(38, 128, 235, 0.1);
height: 48px;
font-weight: bold;
line-height: 48px;
color: rgba(81, 90, 110, 1);
a.op {
height: 26px;
width: 26px;
text-align: center;
display: inline-block;
padding-top: -15px;
line-height: 100%;
margin-top: 12px;
}
a.op:hover {
color: white;
background: rgba(38, 128, 235, 1.5);
border-radius: 4px;
}
}
}
dt.checked {
background: rgba(38, 128, 235);
dl {
color: white;
width: 100%;
a.op {
margin-bottom: 2px;
color: white;
}
dt,
a.op:hover {
dd {
background: white;
list-style: none;
color: rgba(38, 128, 235);
padding: 0 15px;
}
}
dt {
width: 100%;
background: rgba(38, 128, 235, 0.1);
height: 48px;
font-weight: bold;
line-height: 48px;
color: rgba(81, 90, 110, 1);
a.op {
height: 26px;
width: 26px;
text-align: center;
display: inline-block;
padding-top: -15px;
line-height: 100%;
margin-top: 12px;
}
a.op:hover {
color: white;
background: rgba(38, 128, 235, 1.5);
border-radius: 4px;
}
}
dt.checked {
background: rgba(38, 128, 235);
color: white;
a.op {
color: white;
}
a.op:hover {
background: white;
color: rgba(38, 128, 235);
}
}
dd {
min-width: 120px;
line-height: 32px;
height: 36px;
border-radius: 18px;
display: inline-block;
background: rgba(38, 128, 235, 0.1);
border: 2px solid transparent;
color: @table-color;
margin: 10px;
a {
display: inline-flex;
width: 20px;
height: 20px;
border-radius: 4px;
border: 1px solid transparent;
justify-items: center;
align-items: center;
margin-top: 5px;
}
a:hover {
background: rgb(241, 14, 14);
color: white;
}
}
dd:hover {
// background: rgba(38, 128, 235, 1);
// border:1px solid rgba(38,128,235,0.1);
background: rgba(38, 128, 235, 0.1);
border: 2px solid rgba(38, 128, 235, 1);
// color: white;
cursor: pointer;
}
dd.checked {
border: 2px solid rgba(38, 128, 235, 1);
}
}
}
dd {
min-width: 120px;
.footer {
line-height: 32px;
height: 36px;
border-radius: 18px;
display: inline-block;
background: rgba(38, 128, 235, 0.1);
border: 2px solid transparent;
color: @table-color;
margin: 10px;
a {
display: inline-flex;
width: 20px;
height: 20px;
border-radius: 4px;
border: 1px solid transparent;
justify-items: center;
align-items: center;
margin-top: 5px;
margin-top: 5px;
}
min-height: 68px;
a:hover {
background: rgb(241, 14, 14);
dl {
color: white;
background: rgba(245, 246, 250, 1);
}
border: 1px solid rgba(220, 223, 230, 1);
}
opacity: 1;
dd:hover {
border-radius: 4px;
// background: rgba(38, 128, 235, 1);
min-height: 48px;
// border:1px solid rgba(38,128,235,0.1);
flex-wrap: wrap;
background: rgba(38, 128, 235, 0.1);
}
border: 2px solid rgba(38, 128, 235, 1);
// color: white;
cursor: pointer;
}
dd.checked {
border: 2px solid rgba(38, 128, 235, 1);
}
}
.footer {
margin-top: 5px;
min-height: 68px;
dl {
background: rgba(245, 246, 250, 1);
border: 1px solid rgba(220, 223, 230, 1);
opacity: 1;
border-radius: 4px;
min-height: 48px;
flex-wrap: wrap;
}
}
}
}
}
</
style
>
</
style
>
\ No newline at end of file
pages/handle/examine1/detail.vue
View file @
788836a2
<
template
>
<
template
>
<div
class=
"detail table-detail"
>
<div
class=
"detail table-detail"
>
<Row>
<Row>
<Filed
:span=
"6"
:name=
"l('productName')"
>
{{
entity
.
productName
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('productName')"
>
{{
entity
.
productName
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('mesCode')"
>
{{
entity
.
mesCode
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('mesCode')"
>
{{
entity
.
mesCode
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('drawnNumber')"
>
{{
entity
.
drawnNumber
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('drawnNumber')"
>
{{
entity
.
drawnNumber
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('stage')"
><state
code=
"plan.order.stage"
:value=
"entity.stage+''"
type=
"text"
></state></Filed>
<Filed
:span=
"6"
:name=
"l('stage')"
v-if=
"false"
>
<Filed
:span=
"6"
:name=
"l('taskType')"
><state
code=
"plan.order.taskType"
:value=
"entity.taskType+''"
type=
"text"
></state></Filed>
<state
code=
"plan.order.stage"
:value=
"entity.stage+''"
type=
"text"
></state>
<Filed
:span=
"6"
:name=
"l('quantity')"
>
{{
entity
.
quantity
}}
</Filed>
</Filed>
<Filed
:span=
"6"
:name=
"l('materialId')"
><state
code=
"plan.order.material"
:value=
"entity.materialId+''"
type=
"text"
></state></Filed>
<Filed
:span=
"6"
:name=
"l('taskType')"
>
<Filed
:span=
"6"
:name=
"l('routing_Method')"
><state
code=
"plan.order.routingMethod"
:value=
"entity.routing_Method+''"
type=
"text"
></state></Filed>
<state
code=
"plan.order.taskType"
:value=
"entity.taskType+''"
type=
"text"
></state>
<Filed
:span=
"6"
:name=
"l('outer_Envelope_Size')"
>
{{
entity
.
outer_Envelope_Size
}}
</Filed>
</Filed>
<Filed
:span=
"6"
:name=
"l('demandStartDate')"
>
{{
entity
.
demandStartDate
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('quantity')"
>
{{
entity
.
quantity
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('demandFinishDate')"
>
{{
entity
.
demandFinishDate
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('materialId')"
v-if=
"false"
>
<Filed
:span=
"6"
:name=
"l('printSupply')"
><state
code=
"plan.order.printSupply"
:value=
"entity.printSupply+''"
type=
"text"
></state></Filed>
<state
code=
"plan.order.material"
:value=
"entity.materialId+''"
type=
"text"
></state>
<Filed
:span=
"6"
:name=
"l('guestName')"
><state
code=
"plan.order.guestName"
:value=
"entity.guestName+''"
type=
"text"
></state></Filed>
</Filed>
<Filed
:span=
"6"
:name=
"l('routing_Method')"
v-if=
"false"
>
<state
code=
"plan.order.routingMethod"
:value=
"entity.routing_Method+''"
type=
"text"
></state>
</Filed>
<Filed
:span=
"6"
:name=
"l('outer_Envelope_Size')"
v-if=
"false"
>
{{
entity
.
outer_Envelope_Size
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('demandStartDate')"
>
{{
entity
.
demandStartDate
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('demandFinishDate')"
>
{{
entity
.
demandFinishDate
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('printSupply')"
v-if=
"false"
>
<state
code=
"plan.order.printSupply"
:value=
"entity.printSupply+''"
type=
"text"
></state>
</Filed>
<Filed
:span=
"6"
:name=
"l('guestName')"
v-if=
"false"
>
<state
code=
"plan.order.guestName"
:value=
"entity.guestName+''"
type=
"text"
></state>
</Filed>
<Filed
:span=
"6"
:name=
"l('functionaryOffice')"
>
{{
entity
.
functionaryOffice
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('functionaryOffice')"
v-if=
"false"
>
{{
entity
.
functionaryOffice
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('taskRequire')"
>
{{
entity
.
taskRequire
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('taskRequire')"
>
{{
entity
.
taskRequire
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('taskInputDate')"
>
{{
entity
.
taskInputDate
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('taskInputDate')"
v-if=
"false"
>
{{
entity
.
taskInputDate
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('mainDepartmentId')"
><state
code=
"plan.order.mainDepartment"
:value=
"entity.mainDepartmentId+''"
type=
"text"
></state></Filed>
<Filed
:span=
"6"
:name=
"l('mainDepartmentId')"
v-if=
"false"
>
<Filed
:span=
"6"
:name=
"l('technologyDocmentCode')"
>
{{
entity
.
technologyDocmentCode
}}
</Filed>
<state
code=
"plan.order.mainDepartment"
:value=
"entity.mainDepartmentId+''"
type=
"text"
></state>
<Filed
:span=
"6"
:name=
"l('putintDocmentCode')"
>
{{
entity
.
putintDocmentCode
}}
</Filed>
</Filed>
<Filed
:span=
"6"
:name=
"l('outerDrawnNumber')"
>
{{
entity
.
outerDrawnNumber
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('technologyDocmentCode')"
v-if=
"false"
>
{{
entity
.
technologyDocmentCode
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('modelVersion')"
>
{{
entity
.
modelVersion
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('putintDocmentCode')"
v-if=
"false"
>
{{
entity
.
putintDocmentCode
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('designer')"
>
{{
entity
.
designer
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('outerDrawnNumber')"
v-if=
"false"
>
{{
entity
.
outerDrawnNumber
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('taskCode')"
>
{{
entity
.
taskCode
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('modelVersion')"
v-if=
"false"
>
{{
entity
.
modelVersion
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('mainRoutingPeople')"
>
{{
entity
.
mainRoutingPeople
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('designer')"
v-if=
"false"
>
{{
entity
.
designer
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('officeFunctionary')"
>
{{
entity
.
officeFunctionary
}}
v
</Filed>
<Filed
:span=
"6"
:name=
"l('taskCode')"
v-if=
"false"
>
{{
entity
.
taskCode
}}
</Filed>
<Filed
:span=
"24"
:name=
"l('remark')"
>
{{
entity
.
remark
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('mainRoutingPeople')"
v-if=
"false"
>
{{
entity
.
mainRoutingPeople
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('officeFunctionary')"
v-if=
"false"
>
{{
entity
.
officeFunctionary
}}
v
</Filed>
<Filed
:span=
"6"
:name=
"l('projectNumber')"
>
{{
entity
.
projectNumber
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('batchNumber')"
>
{{
entity
.
batchNumber
}}
</Filed>
<Filed
:span=
"6"
:name=
"l('urgencyLevel')"
>
<state
code=
"plan.order.urgencyLevel"
:value=
"entity.urgencyLevel+''"
type=
"text"
></state>
</Filed>
<Filed
:span=
"24"
:name=
"l('remark')"
>
{{
entity
.
remark
}}
</Filed>
</Row>
</Row>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
Api
from
'../api'
import
Api
from
'../api'
export
default
{
export
default
{
name
:
'detail'
,
name
:
'detail'
,
components
:
{
components
:
{},
},
props
:
{
props
:
{
idVal
:
{
idVal
:
{
type
:
String
,
type
:
String
,
default
:
''
default
:
''
}
}
},
},
async
fetch
({
async
fetch
({
store
,
params
})
{
store
,
await
store
.
dispatch
(
'loadDictionary'
)
// 加载数据字典
params
},
})
{
data
()
{
await
store
.
dispatch
(
'loadDictionary'
)
// 加载数据字典
return
{
},
entity
:
{
data
()
{
state
:
''
,
return
{
},
entity
:
{
}
state
:
''
,
},
},
created
()
{
}
this
.
dataImmut
=
[]
},
this
.
dataMut
=
[]
created
()
{
this
.
dataImmut
=
[]
this
.
dataMut
=
[]
Api
.
get
({
Id
:
this
.
idVal
}).
then
((
r
)
=>
{
if
(
r
.
success
)
{
let
formStr
=
r
.
result
.
formData
.
replace
(
/
\"
/g
,
'"'
)
this
.
entity
=
JSON
.
parse
(
formStr
)[
0
]
Api
.
get
({
Id
:
this
.
idVal
}).
then
((
r
)
=>
{
}
else
{
if
(
r
.
success
)
{
this
.
$Message
.
error
(
'加载失败'
)
let
formStr
=
r
.
result
.
formData
.
replace
(
/
\"
/g
,
'"'
)
}
this
.
entity
=
JSON
.
parse
(
formStr
)[
0
]
})
},
}
else
{
methods
:
{
this
.
$Message
.
error
(
'加载失败'
)
load
(
v
)
{},
}
l
(
key
)
{
})
key
=
'orderInfo'
+
'.'
+
key
},
return
this
.
$t
(
key
)
methods
:
{
}
load
(
v
)
{},
},
l
(
key
)
{
watch
:
{}
key
=
'orderInfo'
+
'.'
+
key
return
this
.
$t
(
key
)
}
},
watch
:
{}
}
}
</
script
>
</
script
>
\ No newline at end of file
pages/handle/index.vue
View file @
788836a2
<
template
>
<
template
>
<div
class=
"myBug"
>
<div
class=
"myBug"
>
<Tabs
:animated=
"false"
@
on-click=
"tab"
value=
"3"
>
<Tabs
:animated=
"false"
@
on-click=
"tab"
value=
"3"
>
<TabPane
label=
"我发起的"
name=
"0"
></TabPane>
<TabPane
label=
"我发起的"
name=
"0"
></TabPane>
<TabPane
label=
"待我审批的"
name=
"1"
></TabPane>
<TabPane
label=
"待我审批的"
name=
"1"
></TabPane>
<TabPane
label=
"我已审批的"
name=
"2"
></TabPane>
<TabPane
label=
"我已审批的"
name=
"2"
></TabPane>
<TabPane
label=
"待办任务"
name=
"3"
>
<TabPane
label=
"待办任务"
name=
"3"
>
<Task
v-if=
"tabIndex == 4"
></Task>
<Task
v-if=
"tabIndex == 4"
></Task>
</TabPane>
</TabPane>
</Tabs>
</Tabs>
<DataGrid
<DataGrid
:columns=
"columns"
ref=
"grid"
:action=
"action"
:conditions=
"easySearch"
:high=
"false"
v-show=
"tabIndex != 4"
:height=
"gridHeight"
>
:columns=
"columns"
<template
slot=
"easySearch"
>
ref=
"grid"
<Row
style=
"line-height: 32px; width: 1000px"
>
:action=
"action"
<Col
span=
"5"
>
:conditions=
"easySearch"
<Select
v-model=
"easySearch.schemaId.value"
style=
"width: 200px"
clearable
placeholder=
"请选择审批类别"
transfer
>
:high=
"false"
<Option
value
class=
"option-text"
>
请选择审批类别
</Option>
v-show=
"tabIndex != 4"
<Option
:value=
"item.id"
:label=
"item.name"
:key=
"index"
v-for=
"(item, index) in schemaList"
></Option>
:height=
"gridHeight"
</Select>
>
</Col>
<template
slot=
"easySearch"
>
<Col
span=
"10"
>
<Row
style=
"line-height: 32px; width: 1000px"
>
<DTSearch
v-model=
"easySearch.range.value"
@
on-change=
"setTime"
type=
"date"
></DTSearch>
<Col
span=
"5"
>
</Col>
<Select
<Col
span=
"9"
>
v-model=
"easySearch.schemaId.value"
<Input
search
enter-button
placeholder=
"请输入编号"
@
on-search=
"search"
v-model=
"easySearch.keys.value"
/>
style=
"width: 200px"
</Col>
clearable
</Row>
placeholder=
"请选择审批类别"
</
template
>
transfer
>
<Option
value
class=
"option-text"
>
请选择审批类别
</Option>
<Option
:value=
"item.id"
:label=
"item.name"
:key=
"index"
v-for=
"(item, index) in schemaList"
></Option>
</Select>
</Col>
<Col
span=
"10"
>
<DTSearch
v-model=
"easySearch.range.value"
@
on-change=
"setTime"
type=
"date"
></DTSearch>
</Col>
<Col
span=
"9"
>
<Input
search
enter-button
placeholder=
"请输入编号"
@
on-search=
"search"
v-model=
"easySearch.keys.value"
/>
</Col>
</Row>
</
template
>
</DataGrid>
</DataGrid>
<!-- 审批modal -->
<!-- 审批modal -->
<Modal
<Modal
v-model=
"modalOrderExamine"
:title=
"titleOrderExamine"
footer-hide
fullscreen
@
on-cancel=
"cancelModal"
>
v-model=
"modalOrderExamine"
<iframe
width=
"100%"
id=
"mainFrame"
:height=
"iframeHeight"
frameborder=
"0"
:src=
"srcUrl"
></iframe>
:title=
"titleOrderExamine"
footer-hide
fullscreen
@
on-cancel=
"cancelModal"
>
<iframe
width=
"100%"
id=
"mainFrame"
:height=
"iframeHeight"
frameborder=
"0"
:src=
"srcUrl"
></iframe>
</Modal>
</Modal>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
Api
from
"./api"
;
import
Api
from
"./api"
;
import
Task
from
"./task"
;
import
Task
from
"./task"
;
export
default
{
export
default
{
name
:
"handle"
,
name
:
"handle"
,
components
:
{
components
:
{
Task
,
Task
,
},
},
data
()
{
data
()
{
return
{
return
{
show
:
false
,
show
:
false
,
action
:
Api
.
index
,
action
:
Api
.
index
,
easySearch
:
{
easySearch
:
{
type
:
{
op
:
"Equal"
,
value
:
1
},
// 1我发起的 2待我审批的 3 我已审批的
type
:
{
keys
:
{
op
:
"code"
,
value
:
""
},
op
:
"Equal"
,
schemaId
:
{
op
:
"Equal"
,
value
:
null
},
//审批类别
value
:
1
range
:
{
op
:
"Range"
,
value
:
null
},
},
// 1我发起的 2待我审批的 3 我已审批的
},
keys
:
{
schemaList
:
[],
op
:
"code"
,
results
:
[],
value
:
""
footerBar
:
false
,
},
modalInfo
:
false
,
schemaId
:
{
tabIndex
:
4
,
op
:
"Equal"
,
columns
:
[
value
:
null
{
},
//审批类别
key
:
"id"
,
range
:
{
width
:
80
,
op
:
"Range"
,
title
:
this
.
l
(
"id"
),
value
:
null
hide
:
true
,
},
},
},
{
schemaList
:
[],
key
:
"code"
,
results
:
[],
width
:
240
,
footerBar
:
false
,
title
:
this
.
l
(
"code"
),
modalInfo
:
false
,
},
tabIndex
:
4
,
{
columns
:
[{
title
:
this
.
l
(
"schemaId"
),
key
:
"id"
,
key
:
"schemaId"
,
width
:
80
,
hide
:
true
,
title
:
this
.
l
(
"id"
),
},
hide
:
true
,
{
},
title
:
this
.
l
(
"status"
),
{
key
:
"status"
,
key
:
"code"
,
align
:
"center"
,
width
:
240
,
width
:
120
,
title
:
this
.
l
(
"code"
),
high
:
true
,
},
code
:
"Handle.todoList.status"
,
{
},
title
:
this
.
l
(
"schemaId"
),
{
key
:
"schemaId"
,
title
:
this
.
l
(
"creatorUserId"
),
hide
:
true
,
key
:
"creatorUserId"
,
},
hide
:
true
,
{
},
title
:
this
.
l
(
"status"
),
{
key
:
"status"
,
title
:
this
.
l
(
"creator"
),
align
:
"center"
,
key
:
"creator"
,
width
:
120
,
align
:
"center"
,
high
:
true
,
},
code
:
"Handle.todoList.status"
,
{
},
title
:
this
.
l
(
"creationTime"
),
{
key
:
"creationTime"
,
title
:
this
.
l
(
"creator"
),
align
:
"center"
,
key
:
"creatorUserId"
,
},
type
:
"user"
{
},
title
:
this
.
l
(
"schemaName"
),
{
key
:
"schemaName"
,
title
:
this
.
l
(
"creationTime"
),
},
key
:
"creationTime"
,
// {
align
:
"center"
,
// title: this.l('status'),
},
// key: 'status',
{
// hide: true
title
:
this
.
l
(
"schemaName"
),
// },
key
:
"schemaName"
,
{
},
title
:
this
.
l
(
"startRecordId"
),
// {
key
:
"startRecordId"
,
// title: this.l('status'),
hide
:
true
,
// key: 'status',
},
// hide: true
{
// },
title
:
this
.
l
(
"currentNodeId"
),
{
key
:
"currentNodeId"
,
title
:
this
.
l
(
"startRecordId"
),
hide
:
true
,
key
:
"startRecordId"
,
},
hide
:
true
,
{
},
title
:
this
.
l
(
"currentNodeName"
),
{
key
:
"currentNodeName"
,
title
:
this
.
l
(
"currentNodeId"
),
},
key
:
"currentNodeId"
,
{
hide
:
true
,
title
:
this
.
l
(
"nextNodeId"
),
},
key
:
"nextNodeId"
,
{
hide
:
true
,
title
:
this
.
l
(
"currentNodeName"
),
},
key
:
"currentNodeName"
,
{
},
title
:
this
.
l
(
"nextNodeName"
),
{
key
:
"nextNodeName"
,
title
:
this
.
l
(
"nextNodeId"
),
},
key
:
"nextNodeId"
,
hide
:
true
,
},
{
title
:
this
.
l
(
"nextNodeName"
),
key
:
"nextNodeName"
,
},
{
title
:
"操作"
,
align
:
"center"
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
},
[
h
(
"op"
,
{
{
attrs
:
{
title
:
"操作"
,
oprate
:
"detail"
,
align
:
"center"
,
title
:
this
.
tabIndex
==
2
?
"审核"
:
"查看"
,
render
:
(
h
,
params
)
=>
{
},
return
h
(
"div"
,
{
on
:
{
class
:
"action"
click
:
()
=>
{
},
[
this
.
listInfo
(
h
(
params
.
row
.
schemaId
,
"op"
,
{
params
.
row
.
schemaName
,
attrs
:
{
params
.
row
.
code
,
oprate
:
"detail"
,
params
.
row
.
id
title
:
this
.
tabIndex
==
2
?
"审核"
:
"查看"
,
);
},
on
:
{
click
:
()
=>
{
this
.
listInfo
(
params
.
row
.
schemaId
,
params
.
row
.
schemaName
,
params
.
row
.
code
,
params
.
row
.
id
);
},
},
},
this
.
tabIndex
==
2
?
"审核"
:
"查看"
),
]);
},
},
},
},
},
this
.
tabIndex
==
2
?
"审核"
:
"查看"
],
),
codeTypeName
:
""
,
//审核类型
]);
gridHeight
:
""
,
},
//订单审核开始
},
modalOrderExamine
:
false
,
],
srcUrl
:
""
,
codeTypeName
:
""
,
//审核类型
iframeHeight
:
""
,
gridHeight
:
""
,
titleOrderExamine
:
""
,
//订单审核开始
OrderExamine
:
""
,
modalOrderExamine
:
false
,
//订单审核结束
srcUrl
:
""
,
};
iframeHeight
:
""
,
},
titleOrderExamine
:
""
,
created
()
{
OrderExamine
:
""
,
//订单审核结束
};
},
created
()
{
window
.
screenHeight
=
window
.
innerHeight
;
this
.
iframeHeight
=
window
.
screenHeight
-
58
;
this
.
gridHeight
=
window
.
screenHeight
-
260
;
},
mounted
()
{
window
.
onresize
=
()
=>
{
///浏览器窗口大小变化
return
(()
=>
{
window
.
screenHeight
=
window
.
innerHeight
;
window
.
screenHeight
=
window
.
innerHeight
;
this
.
iframeHeight
=
window
.
screenHeight
-
58
;
this
.
iframeHeight
=
window
.
screenHeight
-
58
;
this
.
gridHeight
=
window
.
screenHeight
-
260
;
this
.
gridHeight
=
window
.
screenHeight
-
260
;
})();
};
this
.
getSchema
();
},
computed
:
{},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
methods
:
{
setTime
(
v
)
{
this
.
easySearch
.
range
.
value
=
v
;
},
//选项卡切换
tab
(
data
)
{
this
.
tabIndex
=
Number
(
data
)
+
1
;
this
.
easySearch
.
type
.
value
=
this
.
tabIndex
;
if
(
this
.
tabIndex
<
4
)
{
this
.
search
();
}
},
search
()
{
this
.
$refs
.
grid
.
easySearch
(
this
.
easySearch
);
},
//获取所以审核类型
getSchema
()
{
Api
.
getAll
().
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
schemaList
=
r
.
result
;
}
else
{
this
.
$Message
.
error
(
"加载类型失败"
);
}
});
},
},
//点击审核或查看
mounted
()
{
listInfo
(
schemaId
,
schemaName
,
code
,
id
)
{
window
.
onresize
=
()
=>
{
console
.
log
(
code
);
///浏览器窗口大小变化
let
type
=
this
.
returnType
(
schemaId
);
return
(()
=>
{
this
.
srcUrl
=
""
;
window
.
screenHeight
=
window
.
innerHeight
;
this
.
modalOrderExamine
=
true
;
this
.
iframeHeight
=
window
.
screenHeight
-
58
;
this
.
codeTypeName
=
schemaName
;
this
.
gridHeight
=
window
.
screenHeight
-
260
;
this
.
titleOrderExamine
=
this
.
codeTypeName
+
" 编号:"
+
code
;
})();
document
.
getElementById
(
"mainFrame"
).
contentWindow
.
location
.
reload
(
true
);
};
this
.
srcUrl
=
this
.
getSchema
();
"/handle/examine"
+
type
+
"?id="
+
id
+
"&statu="
+
this
.
tabIndex
;
},
},
//将schameId转为type1、2、3....
computed
:
{},
returnType
(
schemaId
)
{
async
fetch
({
console
.
log
(
schemaId
);
store
,
let
types
=
1
;
params
switch
(
schemaId
)
{
})
{
case
"123327da-42b3-41f6-b785-cf933f137a95"
:
//订单送审
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
types
=
1
;
break
;
case
"cf192e27-1e81-4000-98ee-392eeb539616"
:
//订单报价
types
=
2
;
break
;
case
"2085025d-9c38-4834-846a-8f9d2f4c8553"
:
//工艺规程
types
=
3
;
break
;
case
"0c7f3e21-0cf1-4fb0-8986-95c6fbda406e"
:
//材料消耗单
types
=
4
;
break
;
case
"56a0a52c-4d7f-45b1-8e31-860efcee5c6d"
:
//工艺数据
types
=
5
;
break
;
case
"d0cdafe3-2341-4499-a4f5-278ef0f30740"
:
//工艺更改单
types
=
6
;
break
;
case
"c2e09c9b-02a9-4188-97a6-cdb68d50a64a"
:
//不合格品审理
types
=
7
;
break
;
case
"2c921502-41a2-4fa5-b659-71d0e1e19ffc"
:
//生产调节单
types
=
8
;
break
;
case
"207b59eb-4fca-4324-b5cd-46f48a5ff21d"
:
//产品合格证
types
=
9
;
break
;
case
"00875796-7675-4c68-bd4f-47e70764dd9e"
:
//修复文件审批
types
=
10
;
break
;
case
"9ce046c3-9585-4bd5-992d-1667f60f8e8f"
:
//支撑文件审批
types
=
11
;
break
;
case
"bd2cb81a-d955-4b68-ae67-bcf7f92e8cb8"
:
//切片文件审批
types
=
12
;
break
;
case
"b6303ddc-8b5e-40a3-a51b-294657d1d913"
:
//物料审批
types
=
13
;
break
;
default
:
types
=
14
;
break
;
}
return
types
;
},
},
cancelModal
()
{
methods
:
{
this
.
search
();
setTime
(
v
)
{
},
this
.
easySearch
.
range
.
value
=
v
;
l
(
key
)
{
},
let
vkey
=
"handleList"
+
"."
+
key
;
//选项卡切换
return
this
.
$t
(
vkey
)
||
key
;
tab
(
data
)
{
this
.
tabIndex
=
Number
(
data
)
+
1
;
this
.
easySearch
.
type
.
value
=
this
.
tabIndex
;
if
(
this
.
tabIndex
<
4
)
{
this
.
search
();
}
},
search
()
{
this
.
$refs
.
grid
.
easySearch
(
this
.
easySearch
);
},
//获取所以审核类型
getSchema
()
{
Api
.
getAll
().
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
schemaList
=
r
.
result
;
}
else
{
this
.
$Message
.
error
(
"加载类型失败"
);
}
});
},
//点击审核或查看
listInfo
(
schemaId
,
schemaName
,
code
,
id
)
{
console
.
log
(
code
);
let
type
=
this
.
returnType
(
schemaId
);
this
.
srcUrl
=
""
;
this
.
modalOrderExamine
=
true
;
this
.
codeTypeName
=
schemaName
;
this
.
titleOrderExamine
=
this
.
codeTypeName
+
" 编号:"
+
code
;
document
.
getElementById
(
"mainFrame"
).
contentWindow
.
location
.
reload
(
true
);
this
.
srcUrl
=
"/handle/examine"
+
type
+
"?id="
+
id
+
"&statu="
+
this
.
tabIndex
;
},
//将schameId转为type1、2、3....
returnType
(
schemaId
)
{
console
.
log
(
schemaId
);
let
types
=
1
;
switch
(
schemaId
)
{
case
"123327da-42b3-41f6-b785-cf933f137a95"
:
//订单送审
types
=
1
;
break
;
case
"cf192e27-1e81-4000-98ee-392eeb539616"
:
//订单报价
types
=
2
;
break
;
case
"2085025d-9c38-4834-846a-8f9d2f4c8553"
:
//工艺规程
types
=
3
;
break
;
case
"0c7f3e21-0cf1-4fb0-8986-95c6fbda406e"
:
//材料消耗单
types
=
4
;
break
;
case
"56a0a52c-4d7f-45b1-8e31-860efcee5c6d"
:
//工艺数据
types
=
5
;
break
;
case
"d0cdafe3-2341-4499-a4f5-278ef0f30740"
:
//工艺更改单
types
=
6
;
break
;
case
"c2e09c9b-02a9-4188-97a6-cdb68d50a64a"
:
//不合格品审理
types
=
7
;
break
;
case
"2c921502-41a2-4fa5-b659-71d0e1e19ffc"
:
//生产调节单
types
=
8
;
break
;
case
"207b59eb-4fca-4324-b5cd-46f48a5ff21d"
:
//产品合格证
types
=
9
;
break
;
case
"00875796-7675-4c68-bd4f-47e70764dd9e"
:
//修复文件审批
types
=
10
;
break
;
case
"9ce046c3-9585-4bd5-992d-1667f60f8e8f"
:
//支撑文件审批
types
=
11
;
break
;
case
"bd2cb81a-d955-4b68-ae67-bcf7f92e8cb8"
:
//切片文件审批
types
=
12
;
break
;
case
"b6303ddc-8b5e-40a3-a51b-294657d1d913"
:
//物料审批
types
=
13
;
break
;
default
:
types
=
14
;
break
;
}
return
types
;
},
cancelModal
()
{
this
.
search
();
},
l
(
key
)
{
let
vkey
=
"handleList"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
;
},
},
},
},
};
};
</
script
>
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
.ivu-modal-fullscreen-no-footer .ivu-modal-body {
.ivu-modal-fullscreen-no-footer .ivu-modal-body {
padding: 0px;
padding: 0px;
}
}
</
style
>
</
style
>
pages/mesPlan/index.vue
View file @
788836a2
...
@@ -697,6 +697,7 @@ export default {
...
@@ -697,6 +697,7 @@ export default {
if
(
res
.
success
)
{
if
(
res
.
success
)
{
this
.
$Message
.
success
(
"订单送审成功!"
);
this
.
$Message
.
success
(
"订单送审成功!"
);
this
.
$refs
.
grid
.
load
();
this
.
$refs
.
grid
.
load
();
this
.
sendViewModal
=
false
;
}
else
{
}
else
{
this
.
$Message
.
error
(
"订单送审失败!"
);
this
.
$Message
.
error
(
"订单送审失败!"
);
}
}
...
...
pages/resource/resource/index.vue
View file @
788836a2
<
template
>
<
template
>
<Layout
class=
"full"
>
<Layout
class=
"full"
>
<Sider
hide-trigger
v-if=
"showMenu"
class=
"menu_side"
width=
"300"
>
<Sider
hide-trigger
v-if=
"showMenu"
class=
"menu_side"
width=
"300"
>
<StoreTree
@
on-hide=
"onHide"
@
on-select=
"productSearch"
/>
<StoreTree
@
on-hide=
"onHide"
@
on-select=
"productSearch"
/>
</Sider>
</Sider>
<!--
<Icon
type=
"icon iconfont icondaochu"
size=
"24"
/>
-->
<!--
<Icon
type=
"icon iconfont icondaochu"
size=
"24"
/>
-->
<div
v-if=
"!showMenu"
class=
"show_menu"
>
<div
v-if=
"!showMenu"
class=
"show_menu"
>
<a
class=
"menu_play fr"
@
click=
"showMenuFn"
title=
"展开"
>
<a
class=
"menu_play fr"
@
click=
"showMenuFn"
title=
"展开"
>
<Icon
type=
"ios-arrow-forward"
size=
"24"
/>
<Icon
type=
"ios-arrow-forward"
size=
"24"
/>
</a>
</a>
</div>
</div>
<Content
class=
"content"
:class=
"!showMenu?'con_bord':''"
>
<Content
class=
"content"
:class=
"!showMenu?'con_bord':''"
>
<DataGrid
<DataGrid
:columns=
"columns"
ref=
"grid"
:action=
"action"
:conditions=
"easySearch"
:batch=
"true"
:format=
"checkData"
@
all-change=
"allchange"
@
on-selection-change=
"onSelect"
exportTitle=
"制造资源"
>
:columns=
"columns"
<template
slot=
"easySearch"
>
ref=
"grid"
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
:action=
"action"
<FormItem
prop=
"keys"
>
:conditions=
"easySearch"
<Input
clearable
placeholder=
"请输入资源名称/资源编码/编码"
v-model
.
trim=
"easySearch.keys.value"
v-width=
"260"
/>
:batch=
"true"
</FormItem>
:format=
"checkData"
<FormItem>
@
all-change=
"allchange"
<Button
type=
"primary"
@
click=
"search"
>
查询
</Button>
@
on-selection-change=
"onSelect"
</FormItem>
exportTitle=
"制造资源"
<FormItem>
>
<a
href=
"#"
@
click=
"lendingRecord"
class=
"ml20"
>
借出记录
</a>
<template
slot=
"easySearch"
>
</FormItem>
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
</Form>
<FormItem
prop=
"keys"
>
</
template
>
<Input
<
template
slot=
"buttons"
>
clearable
<Button
type=
"primary"
@
click=
"add"
>
入库
</Button>
placeholder=
"请输入资源名称/资源编码/编码"
<!--
<Button
type=
"primary"
@
click=
"returnModel=true"
>
归还
</Button>
-->
v-model
.
trim=
"easySearch.keys.value"
<Badge
:count=
"this.$store.state.count"
overflow-count=
"99"
style=
"margin-right:5px;"
:offset=
'postion'
>
v-width=
"260"
<Button
icon=
"md-cart"
@
click=
"showCart"
>
借出车
</Button>
/>
</Badge>
</FormItem>
<Button
@
click=
"openModalIm"
>
导入
</Button>
<FormItem>
</
template
>
<Button
type=
"primary"
@
click=
"search"
>
查询
</Button>
<
template
slot=
"batch"
>
</FormItem>
<Button
type=
"primary"
class=
"mr10 ml10"
@
click=
"addCart"
>
加入借出车
</Button>
<FormItem>
</
template
>
<a
href=
"#"
@
click=
"lendingRecord"
class=
"ml20"
>
借出记录
</a>
</DataGrid>
</FormItem>
<Modal
v-model=
"modal"
:title=
"title"
width=
"1200"
footer-hide
:fullscreen=
"fscreeen"
>
</Form>
<component
:is=
"detail"
:eid=
"curId"
:rootName=
"rootName"
:storeTitle=
"storeTitle"
:materialType=
"materialType"
:codeRuleType=
"codeRuleType"
:storeId=
"storeId"
:mcode=
"mCode"
:cartList=
"this.$u.clone(this.$store.state.cart)"
@
on-close=
"cancel"
@
on-ok=
"ok"
@
substr=
"substr"
/>
</
template
>
</Modal>
<
template
slot=
"buttons"
>
<ImportExcel
ref=
"importExcel"
@
on-get-data=
"getData"
modalTitle=
"制造资源"
:columns=
"columns"
:open=
"ModalIm"
@
on-cancel=
"ModalImCancel"
@
on-ok=
"ok"
/>
<Button
type=
"primary"
@
click=
"add"
>
入库
</Button>
<!--
<Button
type=
"primary"
@
click=
"returnModel=true"
>
归还
</Button>
-->
<Badge
:count=
"this.$store.state.count"
overflow-count=
"99"
style=
"margin-right:5px;"
>
<Button
icon=
"md-cart"
@
click=
"showCart"
>
借出车
</Button>
</Badge>
<Button
@
click=
"openModalIm"
>
导入
</Button>
</
template
>
<
template
slot=
"batch"
>
<Button
type=
"primary"
class=
"mr10 ml10"
@
click=
"addCart"
>
加入借出车
</Button>
</
template
>
</DataGrid>
<Modal
v-model=
"modal"
:title=
"title"
width=
"1200"
footer-hide
:fullscreen=
"fscreeen"
>
<component
:is=
"detail"
:eid=
"curId"
:rootName=
"rootName"
:storeTitle=
"storeTitle"
:materialType=
"materialType"
:codeRuleType=
"codeRuleType"
:storeId=
"storeId"
:mcode=
"mCode"
:cartList=
"this.$u.clone(this.$store.state.cart)"
@
on-close=
"cancel"
@
on-ok=
"ok"
@
substr=
"substr"
/>
</Modal>
<ImportExcel
ref=
"importExcel"
@
on-get-data=
"getData"
modalTitle=
"制造资源"
:columns=
"columns"
:open=
"ModalIm"
@
on-cancel=
"ModalImCancel"
@
on-ok=
"ok"
/>
</Content>
</Content>
</Layout>
</Layout>
</template>
</template>
<
script
>
<
script
>
import
Api
from
"./api"
;
import
Api
from
"./api"
;
import
Search
from
"./search"
;
import
Search
from
"./search"
;
export
default
{
export
default
{
name
:
"list"
,
name
:
"list"
,
components
:
{
components
:
{
Search
,
Search
,
},
},
// head: {
// head: {
// title: "库存表",
// title: "库存表",
// author: "henq",
// author: "henq",
// description: "stock 7/13/2020 11:48:09 AM",
// description: "stock 7/13/2020 11:48:09 AM",
// },
// },
data
()
{
data
()
{
return
{
return
{
action
:
Api
.
index
,
action
:
Api
.
index
,
showMenu
:
true
,
showMenu
:
true
,
easySearch
:
{
easySearch
:
{
keys
:
{
keys
:
{
op
:
"nameOfResource,code,resourceCode"
,
op
:
"nameOfResource,code,resourceCode"
,
value
:
null
,
value
:
null
,
},
},
},
},
fscreeen
:
false
,
postion
:
[
10
,
10
],
modal
:
false
,
fscreeen
:
false
,
title
:
"新增"
,
modal
:
false
,
detail
:
null
,
title
:
"新增"
,
curId
:
0
,
detail
:
null
,
storeId
:
null
,
curId
:
0
,
rootName
:
""
,
storeId
:
null
,
storeTitle
:
""
,
rootName
:
""
,
materialType
:
""
,
storeTitle
:
""
,
mCode
:
""
,
materialType
:
""
,
columns
:
[
mCode
:
""
,
{
columns
:
[{
key
:
"selection"
,
key
:
"selection"
,
type
:
"selection"
,
type
:
"selection"
,
width
:
50
,
width
:
50
,
align
:
"center"
,
align
:
"center"
,
},
},
{
{
key
:
"id"
,
key
:
"id"
,
title
:
this
.
l
(
"id"
),
title
:
this
.
l
(
"id"
),
hide
:
true
,
hide
:
true
,
align
:
"left"
,
align
:
"left"
,
sortable
:
true
,
sortable
:
true
,
},
{
key
:
"ico"
,
title
:
" "
,
align
:
"center"
,
easy
:
true
,
high
:
true
,
width
:
60
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
,
},
[
h
(
params
.
row
.
numberAvailable
>
0
?
"op"
:
""
,
{
attrs
:
{
icon
:
"ios-cart-outline"
,
type
:
"icon"
,
},
on
:
{
click
:
()
=>
this
.
addCart
(
params
.
row
),
},
}),
]
);
},
},
{
key
:
"resourceCode"
,
title
:
this
.
l
(
"resourceId"
),
align
:
"left"
,
easy
:
true
,
},
{
key
:
"nameOfResource"
,
title
:
this
.
l
(
"nameOfResource"
),
align
:
"left"
,
easy
:
true
,
tooltip
:
true
,
},
{
key
:
"code"
,
title
:
"编码"
,
align
:
"left"
,
},
// {
// key: "creationTime",
// title: this.l("creationTime"),
// sortable: true,
// hide: true,
// align: "left",
// },
{
key
:
"creatorUserId"
,
title
:
this
.
l
(
"creatorUserId"
),
hide
:
false
,
type
:
"user"
,
align
:
"left"
,
},
{
key
:
"lastModificationTime"
,
title
:
this
.
l
(
"lastModificationTime"
),
hide
:
true
,
align
:
"left"
,
},
{
key
:
"lastModifierUserId"
,
title
:
this
.
l
(
"lastModifierUserId"
),
hide
:
true
,
align
:
"left"
,
},
{
key
:
"isDeleted"
,
title
:
this
.
l
(
"isDeleted"
),
hide
:
true
,
align
:
"left"
,
},
{
key
:
"deletionTime"
,
title
:
this
.
l
(
"deletionTime"
),
hide
:
true
,
align
:
"left"
,
},
{
key
:
"deleterUserId"
,
title
:
this
.
l
(
"deleterUserId"
),
hide
:
true
,
align
:
"left"
,
},
// {
// key: "specifications",
// title: this.l("specifications"),
// align: "left",
// easy: true,
// high: true,
// },
{
key
:
"totalNum"
,
title
:
this
.
l
(
"totalNum"
),
align
:
"right"
,
easy
:
true
,
},
{
key
:
"numberAvailable"
,
title
:
this
.
l
(
"numberAvailable"
),
align
:
"right"
,
easy
:
true
,
},
{
key
:
"measuringUnit"
,
title
:
this
.
l
(
"measuringUnit"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
},
{
key
:
"qualityCharacteristics"
,
title
:
this
.
l
(
"qualityCharacteristics"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
},
{
key
:
"batchNo"
,
title
:
this
.
l
(
"batchNo"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
},
{
key
:
"storeId"
,
title
:
this
.
l
(
"storeId"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
},
{
key
:
"storeTitle"
,
title
:
this
.
l
(
"storeTitle"
),
align
:
"left"
,
},
{
key
:
"state"
,
title
:
this
.
l
(
"state"
),
align
:
"center"
,
code
:
"mes_xingchi_resource.resource.state"
,
},
// {
// key: "resourceType",
// title: this.l("resourceType"),
// align: "left",
// high: true,
// code: "mes_xingchi_resource.resource.resource_type",
// },
{
title
:
"操作"
,
width
:
190
,
align
:
"center"
,
key
:
"action"
,
hide
:
false
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
,
},
[
h
(
"op"
,
{
attrs
:
{
oprate
:
"delete"
,
title
:
"删除"
,
},
class
:
params
.
row
.
totalNum
===
params
.
row
.
numberAvailable
?
"remove"
:
"disable"
,
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
),
},
},
"删除"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"detail"
,
title
:
"查看日志"
,
},
on
:
{
click
:
()
=>
this
.
logDetail
(
params
.
row
.
id
),
},
},
"查看日志"
),
]
);
},
},
],
treeData
:
[],
ocolumn
:
[],
treeHeight
:
""
,
ids
:
[],
list
:
[],
cartList
:
[],
cartListCount
:
0
,
selectRows
:
[],
//导入
ModalIm
:
false
,
codeRuleType
:
null
,
};
},
created
()
{
this
.
treeHeight
=
window
.
innerHeight
-
150
;
},
mounted
()
{
window
.
onresize
=
()
=>
{
///浏览器窗口大小变化
return
(()
=>
{
window
.
screenHeight
=
window
.
innerHeight
;
this
.
treeHeight
=
window
.
screenHeight
-
150
;
})();
};
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
computed
:
{},
methods
:
{
checkData
(
items
)
{
// console.warn("items", items);
return
items
.
map
((
u
)
=>
{
u
.
_disabled
=
u
.
numberAvailable
<=
0
;
u
.
_checked
=
false
;
return
u
;
});
},
},
{
key
:
"ico"
,
allchange
(
item
)
{
title
:
" "
,
this
.
selectRows
=
[];
align
:
"center"
,
this
.
selectRows
=
item
;
easy
:
true
,
high
:
true
,
width
:
60
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
,
},
[
h
(
params
.
row
.
numberAvailable
>
0
?
"op"
:
""
,
{
attrs
:
{
icon
:
"ios-cart-outline"
,
type
:
"icon"
,
},
on
:
{
click
:
()
=>
this
.
addCart
(
params
.
row
),
},
}),
]
);
},
},
},
{
onSelect
(
item
)
{
key
:
"resourceCode"
,
this
.
selectRows
=
[];
title
:
this
.
l
(
"resourceId"
),
this
.
selectRows
=
item
;
align
:
"left"
,
easy
:
true
,
},
},
{
key
:
"nameOfResource"
,
//加入借出车
title
:
this
.
l
(
"nameOfResource"
),
addCart
(
arr
)
{
align
:
"left"
,
this
.
cartListCount
=
this
.
$store
.
state
.
count
;
easy
:
true
,
this
.
cartList
=
this
.
$store
.
state
.
cart
;
tooltip
:
true
,
// console.log(this.cartListCount);
// console.log(this.cartList);
// console.log(this.selectRows);
if
(
arr
.
id
)
{
let
id
=
arr
.
id
;
if
(
arr
.
numberAvailable
>
0
)
{
const
index
=
this
.
$store
.
state
.
cart
.
findIndex
(
function
(
item
)
{
return
item
.
id
===
id
;
});
// console.log(index);
if
(
index
==
-
1
)
{
arr
.
numberAvailable1
=
arr
.
numberAvailable
;
//用于最大借出数量
this
.
cartList
.
push
(
arr
);
this
.
cartListCount
+=
1
;
this
.
$store
.
commit
(
"setCart"
,
this
.
cartList
);
this
.
$store
.
commit
(
"setCartCount"
,
this
.
cartListCount
);
this
.
$Message
.
success
(
"加入借出车成功"
);
}
else
{
this
.
$Message
.
error
(
"已加入借出车"
);
}
}
else
{
this
.
$Message
.
error
(
"资源无库存"
);
}
}
else
{
// this.$Message.success("已加入借出车,请在借出车查看");
let
arr
=
this
.
selectRows
.
concat
(
this
.
cartList
);
//两个数组对象合并
let
newArr
=
[];
//盛放去重后数据的新数组
arr
.
forEach
(
function
(
item
)
{
let
hasPush
=
false
;
newArr
.
forEach
((
item2
,
index
,
thisArr
)
=>
{
if
(
item
.
id
==
item2
.
id
)
{
hasPush
=
true
;
thisArr
[
index
]
=
{
...
item
,
...
item2
,
};
return
;
}
});
!
hasPush
&&
newArr
.
push
(
item
);
});
this
.
cartList
=
newArr
;
this
.
cartListCount
=
newArr
.
length
;
this
.
$store
.
commit
(
"setCart"
,
this
.
cartList
);
this
.
$store
.
commit
(
"setCartCount"
,
this
.
cartListCount
);
this
.
$refs
.
grid
.
load
();
this
.
$refs
.
grid
.
footerToolbar
=
false
;
}
},
},
{
//移除借出车
key
:
"code"
,
substr
(
value
,
index
)
{
title
:
"编码"
,
// console.log(value);
align
:
"left"
,
// console.log(index);
if
(
index
>
-
1
)
{
this
.
cartListCount
-=
value
;
this
.
cartList
.
splice
(
index
,
1
);
if
(
value
==
0
||
this
.
cartList
.
length
==
0
)
{
this
.
cartListCount
=
0
;
}
this
.
$store
.
commit
(
"setCart"
,
this
.
cartList
);
this
.
$store
.
commit
(
"setCartCount"
,
this
.
cartListCount
);
}
else
{
this
.
cartListCount
=
0
;
this
.
cartList
=
[];
this
.
$store
.
commit
(
"setCart"
,
this
.
cartList
);
this
.
$store
.
commit
(
"setCartCount"
,
this
.
cartListCount
);
}
// console.log(this.$store.state.count);
// console.log(this.$store.state.cart);
},
},
// {
showCart
()
{
// key: "creationTime",
if
(
this
.
$store
.
state
.
count
>
0
)
{
// title: this.l("creationTime"),
this
.
title
=
"借出车"
;
// sortable: true,
this
.
detail
=
()
=>
import
(
"./cart"
);
// hide: true,
this
.
fscreeen
=
false
;
// align: "left",
this
.
modal
=
true
;
// },
}
else
{
{
this
.
$Message
.
error
(
"请将资源加入借出车"
);
key
:
"creatorUserId"
,
}
title
:
this
.
l
(
"creatorUserId"
),
hide
:
false
,
type
:
"user"
,
align
:
"left"
,
},
},
{
lendingRecord
()
{
key
:
"lastModificationTime"
,
// window.open("/resource/resource/record", "_blank");
title
:
this
.
l
(
"lastModificationTime"
),
this
.
$router
.
push
(
"/resource/resource/record"
);
hide
:
true
,
align
:
"left"
,
},
},
{
ok
()
{
key
:
"lastModifierUserId"
,
this
.
$refs
.
grid
.
load
();
title
:
this
.
l
(
"lastModifierUserId"
),
this
.
modal
=
false
;
hide
:
true
,
this
.
fscreeen
=
false
;
align
:
"left"
,
this
.
cartList
=
[];
// this.curId = 0;
},
},
{
search
()
{
key
:
"isDeleted"
,
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
title
:
this
.
l
(
"isDeleted"
),
hide
:
true
,
align
:
"left"
,
},
},
{
add
()
{
key
:
"deletionTime"
,
if
(
this
.
curId
)
{
title
:
this
.
l
(
"deletionTime"
),
if
(
this
.
codeRuleType
==
3
)
{
hide
:
true
,
this
.
title
=
"新增"
;
align
:
"left"
,
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
fscreeen
=
false
;
this
.
modal
=
true
;
}
else
{
this
.
$Message
.
error
(
"请先选择正确的库房类型"
);
}
}
else
{
this
.
$Message
.
error
(
"请先选择库房库位"
);
}
},
},
{
copy
(
id
)
{
key
:
"deleterUserId"
,
this
.
curId
=
id
;
title
:
this
.
l
(
"deleterUserId"
),
this
.
title
=
"克隆"
;
hide
:
true
,
this
.
detail
=
()
=>
import
(
"./add"
);
align
:
"left"
,
this
.
modal
=
true
;
},
},
// {
remove
(
id
)
{
// key: "specifications",
Api
.
delete
(
id
).
then
((
r
)
=>
{
// title: this.l("specifications"),
if
(
r
.
success
)
{
// align: "left",
this
.
$refs
.
grid
.
load
();
// easy: true,
this
.
$Message
.
success
(
"删除成功"
);
// high: true,
}
// },
});
{
key
:
"totalNum"
,
title
:
this
.
l
(
"totalNum"
),
align
:
"right"
,
easy
:
true
,
},
},
{
logDetail
(
id
)
{
key
:
"numberAvailable"
,
this
.
curId
=
id
;
title
:
this
.
l
(
"numberAvailable"
),
this
.
title
=
"查看日志"
;
align
:
"right"
,
this
.
detail
=
()
=>
import
(
"./log"
);
easy
:
true
,
this
.
fscreeen
=
false
;
this
.
modal
=
true
;
},
},
{
cancel
()
{
key
:
"measuringUnit"
,
this
.
curId
=
0
;
title
:
this
.
l
(
"measuringUnit"
),
this
.
modal
=
false
;
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
},
},
{
onHide
()
{
key
:
"qualityCharacteristics"
,
// this.$Message.info("收起左侧树")
title
:
this
.
l
(
"qualityCharacteristics"
),
this
.
showMenu
=
false
;
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
},
},
{
showMenuFn
()
{
key
:
"batchNo"
,
//this.$Message.info("展开左侧树")
title
:
this
.
l
(
"batchNo"
),
this
.
showMenu
=
true
;
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
},
},
{
productSearch
(
item
,
ids
,
rootName
)
{
key
:
"storeId"
,
// console.log(item);
title
:
this
.
l
(
"storeId"
),
this
.
codeRuleType
=
null
;
align
:
"left"
,
this
.
curId
=
item
.
id
;
high
:
true
,
this
.
type
=
[];
hide
:
true
,
this
.
type
=
item
.
codeRuleType
.
split
(
","
);
if
(
this
.
type
)
{
this
.
type
.
forEach
((
e
)
=>
{
if
(
e
==
3
)
{
this
.
codeRuleType
=
3
;
}
});
}
this
.
storeTitle
=
item
.
title
;
this
.
rootName
=
rootName
.
join
(
" / "
);
this
.
materialType
=
item
.
materialType
;
let
where
=
{
storeId
:
{
op
:
"In"
,
value
:
ids
,
},
};
this
.
$refs
.
grid
.
reload
(
where
);
},
},
{
setNum
(
row
)
{
key
:
"storeTitle"
,
this
.
curId
=
row
.
id
;
title
:
this
.
l
(
"storeTitle"
),
this
.
title
=
"预警"
;
align
:
"left"
,
// this.detail = () => import("./setNum");
this
.
fscreeen
=
false
;
this
.
modal
=
true
;
},
},
{
//批量导入start
key
:
"state"
,
//导入功能
title
:
this
.
l
(
"state"
),
openModalIm
()
{
align
:
"center"
,
this
.
ModalIm
=
true
;
code
:
"mes_xingchi_resource.resource.state"
,
},
},
// {
ModalImCancel
()
{
// key: "resourceType",
this
.
ModalIm
=
false
;
// title: this.l("resourceType"),
},
// align: "left",
getData
(
val
)
{
// high: true,
let
url
=
`
${
resourceUrl
}
/resourceimportservice/import`
;
// code: "mes_xingchi_resource.resource.resource_type",
this
.
$refs
.
importExcel
.
deelData
(
// },
url
,
{
this
.
columns
,
title
:
"操作"
,
this
.
formatMethod
(
val
)
width
:
190
,
align
:
"center"
,
key
:
"action"
,
hide
:
false
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
,
},
[
h
(
"op"
,
{
attrs
:
{
oprate
:
"delete"
,
title
:
"删除"
,
},
class
:
params
.
row
.
totalNum
===
params
.
row
.
numberAvailable
?
"remove"
:
"disable"
,
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
),
},
},
"删除"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"detail"
,
title
:
"查看日志"
,
},
on
:
{
click
:
()
=>
this
.
logDetail
(
params
.
row
.
id
),
},
},
"查看日志"
),
]
);
);
},
},
},
],
//根据页面二次处理数据
treeData
:
[],
formatMethod
(
val
)
{
ocolumn
:
[],
let
tempData
=
this
.
$u
.
clone
(
val
);
treeHeight
:
""
,
let
tempList
=
[];
ids
:
[],
tempData
.
forEach
((
ele
)
=>
{
list
:
[],
let
obj
=
{
cartList
:
[],
nameOfResource
:
ele
.
nameOfResource
?
ele
.
nameOfResource
:
""
,
cartListCount
:
0
,
resourceCode
:
ele
.
resourceCode
?
ele
.
resourceCode
:
""
,
selectRows
:
[],
code
:
ele
.
code
?
ele
.
code
:
""
,
//导入
totalNum
:
ele
.
totalNum
?
ele
.
totalNum
:
0
,
ModalIm
:
false
,
storeTitle
:
ele
.
storeTitle
?
ele
.
storeTitle
:
""
,
codeRuleType
:
null
,
storeId
:
ele
.
storeId
?
ele
.
storeId
:
null
,
};
state
:
1
,
},
numberAvailable
:
ele
.
numberAvailable
?
ele
.
numberAvailable
:
0
,
created
()
{
json
:
{},
this
.
treeHeight
=
window
.
innerHeight
-
150
;
};
},
if
(
mounted
()
{
ele
.
nameOfResource
&&
window
.
onresize
=
()
=>
{
ele
.
nameOfResource
!=
""
&&
///浏览器窗口大小变化
ele
.
code
&&
return
(()
=>
{
ele
.
code
!=
""
&&
window
.
screenHeight
=
window
.
innerHeight
;
ele
.
resourceCode
&&
this
.
treeHeight
=
window
.
screenHeight
-
150
;
ele
.
resourceCode
!=
""
})();
)
{
};
obj
.
ico
=
false
;
},
}
else
{
async
fetch
({
store
,
params
})
{
obj
.
ico
=
true
;
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
}
},
tempList
.
push
(
obj
);
computed
:
{},
});
methods
:
{
return
tempList
;
checkData
(
items
)
{
},
// console.warn("items", items);
//批量导入end
return
items
.
map
((
u
)
=>
{
l
(
key
)
{
u
.
_disabled
=
u
.
numberAvailable
<=
0
;
let
vkey
=
"resource"
+
"."
+
key
;
u
.
_checked
=
false
;
return
this
.
$t
(
vkey
)
||
key
;
return
u
;
});
},
allchange
(
item
)
{
this
.
selectRows
=
[];
this
.
selectRows
=
item
;
},
onSelect
(
item
)
{
this
.
selectRows
=
[];
this
.
selectRows
=
item
;
},
//加入借出车
addCart
(
arr
)
{
this
.
cartListCount
=
this
.
$store
.
state
.
count
;
this
.
cartList
=
this
.
$store
.
state
.
cart
;
// console.log(this.cartListCount);
// console.log(this.cartList);
// console.log(this.selectRows);
if
(
arr
.
id
)
{
let
id
=
arr
.
id
;
if
(
arr
.
numberAvailable
>
0
)
{
const
index
=
this
.
$store
.
state
.
cart
.
findIndex
(
function
(
item
)
{
return
item
.
id
===
id
;
});
// console.log(index);
if
(
index
==
-
1
)
{
arr
.
numberAvailable1
=
arr
.
numberAvailable
;
//用于最大借出数量
this
.
cartList
.
push
(
arr
);
this
.
cartListCount
+=
1
;
this
.
$store
.
commit
(
"setCart"
,
this
.
cartList
);
this
.
$store
.
commit
(
"setCartCount"
,
this
.
cartListCount
);
this
.
$Message
.
success
(
"加入借出车成功"
);
}
else
{
this
.
$Message
.
error
(
"已加入借出车"
);
}
}
else
{
this
.
$Message
.
error
(
"资源无库存"
);
}
}
else
{
// this.$Message.success("已加入借出车,请在借出车查看");
let
arr
=
this
.
selectRows
.
concat
(
this
.
cartList
);
//两个数组对象合并
let
newArr
=
[];
//盛放去重后数据的新数组
arr
.
forEach
(
function
(
item
)
{
let
hasPush
=
false
;
newArr
.
forEach
((
item2
,
index
,
thisArr
)
=>
{
if
(
item
.
id
==
item2
.
id
)
{
hasPush
=
true
;
thisArr
[
index
]
=
{
...
item
,
...
item2
,
};
return
;
}
});
!
hasPush
&&
newArr
.
push
(
item
);
});
this
.
cartList
=
newArr
;
this
.
cartListCount
=
newArr
.
length
;
this
.
$store
.
commit
(
"setCart"
,
this
.
cartList
);
this
.
$store
.
commit
(
"setCartCount"
,
this
.
cartListCount
);
this
.
$refs
.
grid
.
load
();
this
.
$refs
.
grid
.
footerToolbar
=
false
;
}
},
//移除借出车
substr
(
value
,
index
)
{
// console.log(value);
// console.log(index);
if
(
index
>
-
1
)
{
this
.
cartListCount
-=
value
;
this
.
cartList
.
splice
(
index
,
1
);
if
(
value
==
0
||
this
.
cartList
.
length
==
0
)
{
this
.
cartListCount
=
0
;
}
this
.
$store
.
commit
(
"setCart"
,
this
.
cartList
);
this
.
$store
.
commit
(
"setCartCount"
,
this
.
cartListCount
);
}
else
{
this
.
cartListCount
=
0
;
this
.
cartList
=
[];
this
.
$store
.
commit
(
"setCart"
,
this
.
cartList
);
this
.
$store
.
commit
(
"setCartCount"
,
this
.
cartListCount
);
}
// console.log(this.$store.state.count);
// console.log(this.$store.state.cart);
},
showCart
()
{
if
(
this
.
$store
.
state
.
count
>
0
)
{
this
.
title
=
"借出车"
;
this
.
detail
=
()
=>
import
(
"./cart"
);
this
.
fscreeen
=
false
;
this
.
modal
=
true
;
}
else
{
this
.
$Message
.
error
(
"请将资源加入借出车"
);
}
},
lendingRecord
()
{
// window.open("/resource/resource/record", "_blank");
this
.
$router
.
push
(
"/resource/resource/record"
);
},
ok
()
{
this
.
$refs
.
grid
.
load
();
this
.
modal
=
false
;
this
.
fscreeen
=
false
;
this
.
cartList
=
[];
// this.curId = 0;
},
search
()
{
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
},
add
()
{
if
(
this
.
curId
)
{
if
(
this
.
codeRuleType
==
3
)
{
this
.
title
=
"新增"
;
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
fscreeen
=
false
;
this
.
modal
=
true
;
}
else
{
this
.
$Message
.
error
(
"请先选择正确的库房类型"
);
}
}
else
{
this
.
$Message
.
error
(
"请先选择库房库位"
);
}
},
copy
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"克隆"
;
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
modal
=
true
;
},
remove
(
id
)
{
Api
.
delete
(
id
).
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$refs
.
grid
.
load
();
this
.
$Message
.
success
(
"删除成功"
);
}
});
},
logDetail
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"查看日志"
;
this
.
detail
=
()
=>
import
(
"./log"
);
this
.
fscreeen
=
false
;
this
.
modal
=
true
;
},
cancel
()
{
this
.
curId
=
0
;
this
.
modal
=
false
;
},
onHide
()
{
// this.$Message.info("收起左侧树")
this
.
showMenu
=
false
;
},
showMenuFn
()
{
//this.$Message.info("展开左侧树")
this
.
showMenu
=
true
;
},
productSearch
(
item
,
ids
,
rootName
)
{
// console.log(item);
this
.
codeRuleType
=
null
;
this
.
curId
=
item
.
id
;
this
.
type
=
[];
this
.
type
=
item
.
codeRuleType
.
split
(
","
);
if
(
this
.
type
)
{
this
.
type
.
forEach
((
e
)
=>
{
if
(
e
==
3
)
{
this
.
codeRuleType
=
3
;
}
});
}
this
.
storeTitle
=
item
.
title
;
this
.
rootName
=
rootName
.
join
(
" / "
);
this
.
materialType
=
item
.
materialType
;
let
where
=
{
storeId
:
{
op
:
"In"
,
value
:
ids
,
},
},
};
this
.
$refs
.
grid
.
reload
(
where
);
},
setNum
(
row
)
{
this
.
curId
=
row
.
id
;
this
.
title
=
"预警"
;
// this.detail = () => import("./setNum");
this
.
fscreeen
=
false
;
this
.
modal
=
true
;
},
//批量导入start
//导入功能
openModalIm
()
{
this
.
ModalIm
=
true
;
},
ModalImCancel
()
{
this
.
ModalIm
=
false
;
},
getData
(
val
)
{
let
url
=
`
${
resourceUrl
}
/resourceimportservice/import`
;
this
.
$refs
.
importExcel
.
deelData
(
url
,
this
.
columns
,
this
.
formatMethod
(
val
)
);
},
//根据页面二次处理数据
formatMethod
(
val
)
{
let
tempData
=
this
.
$u
.
clone
(
val
);
let
tempList
=
[];
tempData
.
forEach
((
ele
)
=>
{
let
obj
=
{
nameOfResource
:
ele
.
nameOfResource
?
ele
.
nameOfResource
:
""
,
resourceCode
:
ele
.
resourceCode
?
ele
.
resourceCode
:
""
,
code
:
ele
.
code
?
ele
.
code
:
""
,
totalNum
:
ele
.
totalNum
?
ele
.
totalNum
:
0
,
storeTitle
:
ele
.
storeTitle
?
ele
.
storeTitle
:
""
,
storeId
:
ele
.
storeId
?
ele
.
storeId
:
null
,
state
:
1
,
numberAvailable
:
ele
.
numberAvailable
?
ele
.
numberAvailable
:
0
,
json
:
{},
};
if
(
ele
.
nameOfResource
&&
ele
.
nameOfResource
!=
""
&&
ele
.
code
&&
ele
.
code
!=
""
&&
ele
.
resourceCode
&&
ele
.
resourceCode
!=
""
)
{
obj
.
ico
=
false
;
}
else
{
obj
.
ico
=
true
;
}
tempList
.
push
(
obj
);
});
return
tempList
;
},
//批量导入end
l
(
key
)
{
let
vkey
=
"resource"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
;
},
},
},
};
};
</
script
>
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
.full {
.full {
margin-top: 0;
margin-top: 0;
.content {
.content {
margin-top: 6px;
margin-top: 6px;
.ivu-icon-ios-add:before {
.ivu-icon-ios-add:before {
content: "\f341";
content: "\f341";
}
}
.ivu-icon-ios-remove:before {
.ivu-icon-ios-remove:before {
content: "\f33d";
content: "\f33d";
}
}
}
}
}
}
</
style
>
</
style
>
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