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
15a0c384
Commit
15a0c384
authored
Nov 13, 2020
by
仇晓婷
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.mes123.com/zhouyx/mes-ui
parents
51599112
96de0e7d
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
3273 additions
and
2921 deletions
+3273
-2921
base.less
assets/css/base.less
+3
-1
iview-reset.less
assets/css/iview-reset.less
+0
-1
Submenu.vue
components/page/bmenu/components/Submenu.vue
+48
-10
process.vue
components/page/import/process.vue
+57
-2
EditGrid.vue
components/page/treeGrid/EditGrid.vue
+996
-905
zh-CN.js
i18n/locale/zh-CN.js
+23
-12
henq.js
libs/henq.js
+4
-0
npm-shrinkwrap.json
npm-shrinkwrap.json
+10
-10
index.vue
pages/aps/aps/index.vue
+725
-744
index.vue
pages/aps/plan/index.vue
+773
-841
list.vue
pages/project/groupUser/list.vue
+3
-3
importTemplate.vue
pages/project/plan/importTemplate.vue
+61
-29
index.vue
pages/project/plan/index.vue
+124
-3
add.vue
pages/project/project/add.vue
+17
-3
api.js
pages/project/project/api.js
+4
-0
detail.vue
pages/project/resources/templates/detail.vue
+122
-7
index.vue
pages/project/resources/templates/index.vue
+4
-1
jcTreeGrid.vue
pages/test/example/components/jcTreeGrid.vue
+1
-1
test2.vue
pages/test/test2.vue
+85
-4
index.vue
pages/welcome/index.vue
+17
-151
index.js
store/index.js
+196
-193
No files found.
assets/css/base.less
View file @
15a0c384
...
...
@@ -21,7 +21,9 @@ ul,
li {
list-style: none;
}
.ivu-drawer-wrap{
z-index: 12000;
}
div::-webkit-scrollbar {
width: 10px;
height: 10px;
...
...
assets/css/iview-reset.less
View file @
15a0c384
...
...
@@ -18,7 +18,6 @@
box-sizing: border-box;
-webkit-tap-highlight-color: transparent;
}
.ivu-btn-primary {
color: #fff;
background-color: @primary-color;
...
...
components/page/bmenu/components/Submenu.vue
View file @
15a0c384
<
template
>
<transition
name=
"contextmenu-submenu-fade"
v-if=
"show"
>
<transition
name=
"contextmenu-submenu-fade"
>
<div
ref=
"menu"
:class=
"[commonClass.menu, 'menu', customClass]"
:style=
"
{left: style.left + 'px', top: style.top + 'px', minWidth: style.minWidth + 'px', zIndex: style.zIndex}" v-if="visible" @contextmenu="(e)=>e.preventDefault()">
<div
class=
"menu_body"
>
<template
v-for=
"(item,index) of items"
>
...
...
@@ -10,7 +10,7 @@
item.divided?'menu_item__divided':null
]"
:key=
"index"
v-if=
"item.disabled"
>
<div
class=
"menu_item_icon"
v-if=
"hasIcon"
>
<
i
:class=
"item.icon"
v-if=
"item.icon"
></i
>
<
Icon
v-if=
"item.icon"
:type=
"item.icon"
/
>
</div>
<span
class=
"menu_item_label"
>
{{
item
.
label
}}
</span>
<div
class=
"menu_item_expand_icon"
></div>
...
...
@@ -22,7 +22,7 @@
item.divided?'menu_item__divided':null
]"
:key=
"index"
@
mouseenter=
"($event)=>enterItem($event,item,index)"
v-else-if=
"item.children"
>
<div
class=
"menu_item_icon"
v-if=
"hasIcon"
>
<
i
:class=
"item.icon"
v-if=
"item.icon"
></i
>
<
Icon
v-if=
"item.icon"
:type=
"item.icon"
/
>
</div>
<span
class=
"menu_item_label"
>
{{
item
.
label
}}
</span>
<div
class=
"menu_item_expand_icon"
>
▶
</div>
...
...
@@ -33,7 +33,7 @@
item.divided?'menu_item__divided':null
]"
:key=
"index"
@
mouseenter=
"($event)=>enterItem($event,item,index)"
@
click=
"itemClick(item)"
v-else
>
<div
class=
"menu_item_icon"
v-if=
"hasIcon"
>
<
i
:class=
"item.icon"
v-if=
"item.icon"
></i
>
<
Icon
v-if=
"item.icon"
:type=
"item.icon"
/
>
</div>
<span
class=
"menu_item_label"
>
{{
item
.
label
}}
</span>
<div
class=
"menu_item_expand_icon"
></div>
...
...
@@ -54,6 +54,9 @@ import {
SUBMENU_OPEN_TREND_RIGHT
,
COMPONENT_NAME
}
from
"../constant"
;
import
{
getElementsByClassName
}
from
"../util"
;
export
default
{
name
:
"Submenu"
,
data
()
{
...
...
@@ -78,13 +81,15 @@ export default {
style
:
{
left
:
0
,
top
:
0
,
zIndex
:
2
,
zIndex
:
3
,
minWidth
:
150
},
customClass
:
null
,
visible
:
false
,
hasIcon
:
false
,
openTrend
:
SUBMENU_OPEN_TREND_RIGHT
openTrend
:
SUBMENU_OPEN_TREND_RIGHT
,
mouseListening
:
false
,
mainMenuInstance
:
null
,
};
},
props
:
{
...
...
@@ -104,8 +109,12 @@ export default {
mounted
()
{
if
(
this
.
data
!=
[])
{
this
.
load
(
this
.
data
)
this
.
addListener
();
}
},
destroyed
()
{
this
.
removeListener
();
},
methods
:
{
load
(
v
)
{
this
.
visible
=
true
;
...
...
@@ -194,13 +203,14 @@ export default {
};
this
.
activeSubmenu
.
instance
.
style
.
minWidth
=
typeof
item
.
minWidth
===
"number"
?
item
.
minWidth
:
this
.
style
.
minWidth
;
this
.
activeSubmenu
.
instance
.
style
.
zIndex
=
this
.
style
.
zIndex
;
this
.
activeSubmenu
.
instance
.
style
.
zIndex
=
'9999'
;
this
.
activeSubmenu
.
instance
.
customClass
=
typeof
item
.
customClass
===
"string"
?
item
.
customClass
:
this
.
customClass
;
this
.
activeSubmenu
.
instance
.
$mount
();
document
.
body
.
appendChild
(
this
.
activeSubmenu
.
instance
.
$el
);
},
itemClick
(
item
)
{
if
(
!
this
.
visible
)
{
...
...
@@ -220,9 +230,34 @@ export default {
if
(
this
.
activeSubmenu
.
instance
)
{
this
.
activeSubmenu
.
instance
.
close
();
}
this
.
$nextTick
(()
=>
{
this
.
$destroy
();
});
this
.
$nextTick
(()
=>
{});
},
showBm
()
{
this
.
visible
=
true
;
},
leaveBm
()
{
this
.
visible
=
false
;
},
mouseClickListener
(
e
)
{
//左键点击
this
.
close
();
},
addListener
()
{
if
(
!
this
.
mouseListening
)
{
document
.
addEventListener
(
"click"
,
this
.
mouseClickListener
);
//document.addEventListener("mousedown", this.mouseDownListener);
//document.addEventListener("mousewheel", this.mousewheelListener);
this
.
mouseListening
=
true
;
}
},
removeListener
()
{
if
(
this
.
mouseListening
)
{
document
.
removeEventListener
(
"click"
,
this
.
mouseClickListener
);
//document.removeEventListener("mousedown", this.mouseDownListener);
//document.removeEventListener("mousewheel", this.mousewheelListener);
this
.
mouseListening
=
false
;
}
}
},
watch
:
{
...
...
@@ -232,6 +267,9 @@ export default {
this
.
load
(
this
.
data
)
}
},
show
(
v
)
{
this
.
visible
=
v
}
},
};
</
script
>
...
...
components/page/import/process.vue
View file @
15a0c384
...
...
@@ -61,6 +61,7 @@
<
script
>
import
XLSX
from
"xlsx"
;
import
Api
from
'@/plugins/request'
import
{
Switch
}
from
"view-design"
;
...
...
@@ -82,6 +83,7 @@ export default {
formatList
:
[
"xlsx"
],
columnsImport
:
[],
departArr
:
[],
//部门list
usersArr
:
[],
sheetNames
:
[],
//excel的表明
workBook
:
{},
openDatas
:
[],
...
...
@@ -129,9 +131,21 @@ export default {
this
.
$api
.
get
(
`
${
systemUrl
}
/Department/GetDepartments`
).
then
((
r
)
=>
{
this
.
departArr
=
r
.
result
.
items
;
});
this
.
$api
.
get
(
`
${
systemUrl
}
/user/getuserlist`
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
usersArr
=
r
.
result
}
})
//导出对列表头进行预加载end
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
await
store
.
dispatch
(
"loadUsers"
);
// 加载数据字典
},
mounted
()
{
//if (this.eid > 0) {
// this.load(this.eid);
...
...
@@ -144,6 +158,7 @@ export default {
this
.
tdHeightExcel
=
window
.
screenHeight
-
180
;
})();
};
},
methods
:
{
//重新处理colum
...
...
@@ -198,6 +213,8 @@ export default {
temData
=
this
.
$u
.
clone
(
this
.
$refs
.
comExcel
.
excelData
);
}
let
arrTitleUse
=
[];
////使用数据字典的字段
let
arrUseName
=
[];
////使用单个用户字段
let
arrUseNames
=
[];
////使用多用户字段
temColPage
.
forEach
((
elCode
)
=>
{
if
(
elCode
.
code
)
{
arrTitleUse
.
push
({
...
...
@@ -205,6 +222,18 @@ export default {
code
:
elCode
.
code
,
});
}
if
(
elCode
.
type
==
"user"
)
{
arrUseName
.
push
({
key
:
elCode
.
key
,
code
:
elCode
.
type
,
});
}
if
(
elCode
.
type
==
"users"
)
{
arrUseNames
.
push
({
key
:
elCode
.
key
,
code
:
elCode
.
type
,
});
}
});
let
useData
=
[];
//重新组织list列表数据
temData
.
forEach
((
elData
,
index
)
=>
{
...
...
@@ -215,7 +244,7 @@ export default {
useData
.
push
(
objTm
);
});
//对列表里的部门及数据字典项进行处理
//对列表里的部门及数据字典项
、用户等
进行处理
useData
.
forEach
((
eles
)
=>
{
//如果导入文件没有departmentid,但存在departmentTitle的话,通过title获取id
if
(
...
...
@@ -247,7 +276,32 @@ export default {
}
});
}
//人员名称转换为userid,如果查不到此人员,则为空
arrUseName
.
forEach
((
euser
)
=>
{
if
(
eles
[
euser
.
key
]
&&
eles
[
euser
.
key
]
!=
""
&&
eles
[
euser
.
key
]
!=
null
)
{
this
.
usersArr
.
forEach
(
eluser
=>
{
if
(
eles
[
euser
.
key
]
==
eluser
.
name
)
{
eles
[
euser
.
key
]
=
eluser
.
id
}
})
}
});
//多个名称转换为数组
arrUseNames
.
forEach
((
eusers
)
=>
{
if
(
eles
[
eusers
.
key
]
&&
eles
[
eusers
.
key
]
!=
""
&&
eles
[
eusers
.
key
]
!=
null
)
{
let
arruserstemp
=
this
.
$u
.
clone
(
eles
[
eusers
.
key
].
split
(
','
)
||
eles
[
eusers
.
key
].
split
(
','
))
let
tempUserIds
=
[]
arruserstemp
.
forEach
(
eltempUsers
=>
{
this
.
usersArr
.
forEach
(
elusers
=>
{
if
(
eltempUsers
==
elusers
.
name
)
{
tempUserIds
.
push
(
elusers
.
id
)
}
})
})
eles
[
eusers
.
key
]
=
tempUserIds
}
});
arrTitleUse
.
forEach
((
elem
)
=>
{
if
(
eles
[
elem
.
key
]
&&
...
...
@@ -436,6 +490,7 @@ export default {
this
.
dataIm
=
formatList
;
this
.
batchImportUrl
=
url
;
},
l
(
key
)
{
key
=
"user"
+
"."
+
key
;
return
this
.
$t
(
key
);
...
...
components/page/treeGrid/EditGrid.vue
View file @
15a0c384
<
template
>
<div
class=
"table-content1"
>
<div
class=
"table-content1"
>
<div
class=
"table-tools"
>
<div
class=
"table-search"
>
<slot
name=
"easySearch"
></slot>
</div>
<div
class=
"btns"
>
<slot
name=
"buttons"
></slot>
<!--
<Button
@
click=
"config=
!config"
>
<div
class=
"table-search"
>
<slot
name=
"easySearch"
></slot>
</div>
<div
class=
"btns"
>
<slot
name=
"buttons"
></slot>
<Button
@
click=
"config =
!config"
>
<Icon
type=
"md-build"
class=
"table-set"
size=
"14"
title=
"列设置"
/>
</Button>
-->
</div>
</Button>
</div>
</div>
<div
class=
"table-main"
ref=
"main"
>
<div>
<table
class=
"table-head"
>
<thead>
<tr>
<th
v-for=
"(column, index) in columns"
:key=
"index"
:style=
"tdStyle(column)"
>
<label
v-if=
"column.type === 'selection'"
>
<Checkbox
v-model=
"checkAll"
@
on-change=
"checked"
:indeterminate=
"indeterminate"
></Checkbox>
</label>
<label
v-else
>
{{
renderHeader
(
column
,
index
)
}}
<span
class=
"ivu-table-sort"
v-if=
"column.sortable"
>
<Icon
type=
"arrow-up-b"
:class=
"
{ on: column._sortType === 'asc' }" @click.native="handleSort(index, 'asc')" />
<Icon
type=
"arrow-down-b"
:class=
"
{ on: column._sortType === 'desc' }" @click.native="handleSort(index, 'desc')" />
</span>
</label>
</th>
</tr>
</thead>
<tbody>
<tr
v-for=
"(item, index) in trs"
:key=
"item.id"
class=
"treetr"
:id=
"'tr' + index"
v-show=
"show(item)"
:draggable=
"drag && !item._drag"
@
dragstart=
"dragstart($event, index, item)"
@
drop=
"dragdrop($event, index, item)"
@
dragenter=
"dragenter($event, index, item)"
@
dragover=
"dragover($event, index, item)"
@
dragleave=
"dragleave($event, index, item)"
>
<!-- -->
<td
v-for=
"(column, snum) in columns"
:key=
"column.key"
:style=
"tdStyle(column)"
>
<!-- 多选 -->
<label
v-if=
"column.type === 'selection'"
@
click=
"rowChecked(item, index, $event)"
>
<Checkbox
v-model=
"item._checked"
:indeterminate=
"item._indeterminate"
></Checkbox>
</label>
<Icon
v-if=
"column.type === 'drag'"
type=
"md-more"
class=
"drag"
/>
<DTSpan
v-if=
"column.type == 'date'"
:value=
"item[column.key]"
/>
<div
v-if=
"column.type == 'user'"
>
<User
:value=
"item[column.key]"
/>
</div>
<div
v-if=
"
<div>
<table
class=
"table-head"
>
<thead>
<tr>
<th
v-for=
"(column, index) in columns"
:key=
"index"
:style=
"tdStyle(column)"
>
<label
v-if=
"column.type === 'selection'"
>
<Checkbox
v-model=
"checkAll"
@
on-change=
"allChecked"
:indeterminate=
"indeterminate"
></Checkbox>
</label>
<label
v-else
>
{{
renderHeader
(
column
,
index
)
}}
<span
class=
"ivu-table-sort"
v-if=
"column.sortable"
>
<Icon
type=
"arrow-up-b"
:class=
"
{ on: column._sortType === 'asc' }"
@click.native="handleSort(index, 'asc')"
/>
<Icon
type=
"arrow-down-b"
:class=
"
{ on: column._sortType === 'desc' }"
@click.native="handleSort(index, 'desc')"
/>
</span>
</label>
</th>
</tr>
</thead>
<tbody>
<tr
v-for=
"(item, index) in trs"
:key=
"item.id"
class=
"treetr"
:id=
"'tr' + index"
v-show=
"show(item)"
:draggable=
"drag && !item._drag"
@
dragstart=
"dragstart($event, index, item)"
@
drop=
"dragdrop($event, index, item)"
@
dragenter=
"dragenter($event, index, item)"
@
dragover=
"dragover($event, index, item)"
@
dragleave=
"dragleave($event, index, item)"
>
<!-- -->
<td
v-for=
"(column, snum) in columns"
:key=
"column.key"
:style=
"tdStyle(column)"
>
<!-- 多选 -->
<label
v-if=
"column.type === 'selection'"
@
click=
"rowChecked(item, index, $event)"
>
<Checkbox
v-model=
"item._checked"
:indeterminate=
"item._indeterminate"
></Checkbox>
{{
item
.
_checked
}}
</label>
<Icon
v-if=
"column.type === 'drag'"
type=
"md-more"
class=
"drag"
/>
<DTSpan
v-if=
"column.type == 'date'"
:value=
"item[column.key]"
/>
<div
v-if=
"column.type == 'user'"
>
<User
:value=
"item[column.key]"
/>
</div>
<div
v-if=
"
column.type == 'users' &&
item[column.key] &&
item[column.key].length > 0
"
>
<User
v-for=
"li in item[column.key]"
:value=
"li"
:key=
"li"
class=
"ml10"
/>
</div>
<state
v-if=
"column.code"
:code=
"column.code"
:value=
"item[column.key]"
/>
<!-- 树图标 -->
<span
@
click=
"toggle(index, item)"
v-if=
"snum == treeColumn()"
>
<span
class=
"ib"
v-width=
"spaceWidth * item._level"
></span>
<a
v-if=
"item._count > 0"
class=
"expand"
>
<Icon
:type=
"!item._expanded ? 'ios-add' : 'ios-remove'"
/>
</a><i
v-else
class=
"ms-tree-space"
></i>
</span>
<!-- 菜单名称、排序、请求地址 -->
<label
v-if=
"
"
>
<User
v-for=
"li in item[column.key]"
:value=
"li"
:key=
"li"
class=
"ml10"
/>
</div>
<state
v-if=
"column.code"
:code=
"column.code"
:value=
"item[column.key]"
/>
<!-- 树图标 -->
<span
@
click=
"toggle(index, item)"
v-if=
"snum == treeColumn()"
>
<span
class=
"ib"
v-width=
"spaceWidth * item._level"
></span>
<a
v-if=
"item._count > 0"
class=
"expand"
>
<Icon
:type=
"!item._expanded ? 'ios-add' : 'ios-remove'"
/>
</a
><i
v-else
class=
"ms-tree-space"
></i>
</span>
<!-- 菜单名称、排序、请求地址 -->
<label
v-if=
"
!column.type &&
!column.code &&
!column.render &&
!column.slot
"
>
{{
renderBody
(
item
,
column
)
}}
</label>
<table-expand
v-if=
"column.render && !column.type && !column.solt"
:row=
"item"
:column=
"column"
:index=
"snum"
:render=
"column.render"
></table-expand>
<column-slot
v-if=
"column.slot"
:row=
"item"
:column=
"column"
:index=
"snum"
></column-slot>
</td>
</tr>
</tbody>
</table>
</div>
"
>
{{
renderBody
(
item
,
column
)
}}
</label>
<table-expand
v-if=
"column.render && !column.type && !column.solt"
:row=
"item"
:column=
"column"
:index=
"snum"
:render=
"column.render"
></table-expand>
<column-slot
v-if=
"column.slot"
:row=
"item"
:column=
"column"
:index=
"snum"
></column-slot>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div
class=
"table-footer"
>
<slot
name=
"footer"
></slot>
<Page
v-if=
"page"
:total=
"search.total"
:current=
"search.page"
class=
"fr"
show-total
size=
"small"
show-elevator
show-sizer
:page-size=
"search.pageSize"
:page-size-opts=
"pageSizeOpts"
@
on-change=
"pageChange"
@
on-page-size-change=
"pageSizeChange"
/>
<slot
name=
"footer"
></slot>
<Page
v-if=
"page"
:total=
"search.total"
:current=
"search.page"
class=
"fr"
show-total
size=
"small"
show-elevator
show-sizer
:page-size=
"search.pageSize"
:page-size-opts=
"pageSizeOpts"
@
on-change=
"pageChange"
@
on-page-size-change=
"pageSizeChange"
/>
</div>
<Modal
v-if=
"high"
v-model=
"modalSearch"
title=
"高级搜索"
draggable
width=
"800"
ref=
"search"
>
<slot
name=
"searchForm"
></slot>
<div
slot=
"footer"
>
<Button
@
click=
"modalSearch = false"
class=
"mr20"
>
取消
</Button>
<Button
@
click=
"complexSearch"
type=
"primary"
class=
"mr20"
>
查询
</Button>
</div>
<Modal
v-if=
"high"
v-model=
"modalSearch"
title=
"高级搜索"
draggable
width=
"800"
ref=
"search"
>
<slot
name=
"searchForm"
></slot>
<div
slot=
"footer"
>
<Button
@
click=
"modalSearch = false"
class=
"mr20"
>
取消
</Button>
<Button
@
click=
"complexSearch"
type=
"primary"
class=
"mr20"
>
查询
</Button>
</div>
</Modal>
<Drawer
title=
"列设置"
v-if=
"set"
v-model=
"config"
:scrollable=
"true"
placement=
"left"
:mask=
"false"
>
<div
slot=
"header"
>
列设置
<a
@
click=
"undoConfig"
class=
"ml50"
>
<Icon
type=
"md-refresh"
title=
"恢复初始设置"
/>
</a>
</div>
<ul
class=
"table-columns"
>
<li
v-for=
"(li, index) in columnsCur"
:key=
"index"
v-dragging=
"
{ item: li, list: columnsCur, group: 'li' }">
<label
@
click=
"columnChange(li, index)"
:class=
"
{ dis: li.hide }">
<Icon
:type=
"li.hide ? 'md-eye-off' : 'md-eye'"
size=
"16"
class=
"mr10"
/>
<span>
{{
li
.
title
}}
</span>
</label>
<Icon
type=
"ios-move"
class=
"move"
size=
"18"
/>
</li>
</ul>
<Drawer
title=
"列设置"
v-if=
"set"
v-model=
"config"
:scrollable=
"true"
placement=
"left"
:mask=
"false"
>
<div
slot=
"header"
>
列设置
<a
@
click=
"undoConfig"
class=
"ml50"
>
<Icon
type=
"md-refresh"
title=
"恢复初始设置"
/>
</a>
</div>
<ul
class=
"table-columns"
>
<li
v-for=
"(li, index) in columnsCur"
:key=
"index"
v-dragging=
"
{ item: li, list: columnsCur, group: 'li' }"
>
<label
@
click=
"columnChange(li, index)"
:class=
"
{ dis: li.hide }">
<Icon
:type=
"li.hide ? 'md-eye-off' : 'md-eye'"
size=
"16"
class=
"mr10"
/>
<span>
{{
li
.
title
}}
</span>
</label>
<Icon
type=
"ios-move"
class=
"move"
size=
"18"
/>
</li>
</ul>
</Drawer>
<FooterToolbar
v-if=
"batch"
v-show=
"footerToolbar"
class=
"ftball"
>
<div
class=
"tip
"
>
已选
{{
selectItems
.
length
}}
项
</div>
<slot
name=
"batch"
></slot>
<Button
@
click=
"cancelBatch"
>
取消
</Button>
<div
class=
"ib
"
>
已选
{{
selectItems
.
length
}}
项
</div>
<slot
name=
"batch"
></slot>
<Button
@
click=
"cancelBatch"
>
取消
</Button>
</FooterToolbar>
</div>
</div>
</
template
>
<
script
>
import
TableExpand
from
"./expand"
;
import
ColumnSlot
from
"./columnSolt"
;
export
default
{
name
:
"treeGrid"
,
components
:
{
TableExpand
,
ColumnSlot
},
props
:
{
mode
:
{
type
:
[
String
,
Number
],
default
:
0
,
validator
:
(
v
)
=>
{
var
modes
=
[
"read"
,
"column"
,
"row"
];
if
(
/^
\d
+/
.
test
(
v
))
{
return
v
>=
0
&&
v
<
modes
.
length
;
}
return
modes
.
indexOf
(
v
)
>
-
1
;
},
},
border
:
{
//是否显示边框
type
:
Boolean
,
default
:
true
,
},
batch
:
{
//是否批量操作
type
:
Boolean
,
default
:
true
,
},
format
:
{
type
:
Function
,
default
:
null
,
},
initsearch
:
{
type
:
Function
,
default
:
null
,
},
lazy
:
{
//懒加载设置,设置为真时候,默认不加载数据。
type
:
Boolean
,
default
:
false
,
},
placeholder
:
{
type
:
String
,
default
:
"请输入关键字"
,
},
height
:
{
type
:
Number
,
default
:
0
,
},
tool
:
{
//是否显示工具栏
type
:
Boolean
,
default
:
true
,
},
easy
:
{
//是否显示简单搜索
type
:
Boolean
,
default
:
true
,
},
high
:
{
//是否显示高级搜索
type
:
Boolean
,
default
:
true
,
},
draggable
:
{
//是否可以拖拽
type
:
Boolean
,
default
:
false
,
},
set
:
{
//是否显示列设置
type
:
Boolean
,
default
:
true
,
},
page
:
{
//是否分页
type
:
Boolean
,
default
:
false
,
},
columns
:
Array
,
items
:
{
//接收树形数据
type
:
Array
,
default
()
{
return
[];
},
},
data
:
{
//接收UpId型数据
type
:
Array
,
default
()
{
return
[];
},
},
keyname
:
{
//默认行主键
type
:
[
String
],
default
:
"id"
,
},
upname
:
{
// 父级字段名称
type
:
String
,
default
:
"upId"
,
},
root
:
{
// 根级UpId的值.
type
:
[
String
,
Number
],
default
:
0
,
},
action
:
{
//接口地址
type
:
String
,
default
:
""
,
},
conditions
:
{
//查询条件
type
:
Object
,
default
:
function
()
{
return
{
keys
:
{
op
:
"name"
,
value
:
""
,
default
:
true
,
},
};
},
},
iconName
:
false
,
drag
:
{
//拖拽
type
:
Boolean
,
default
:
false
,
},
spaceWidth
:
{
//树形表格缩进距离
type
:
Number
,
default
:
20
,
},
exportTitle
:
{
type
:
String
,
default
:
""
,
},
},
provide
()
{
return
{
tableRoot
:
this
.
slots
,
};
name
:
"treeGrid"
,
components
:
{
TableExpand
,
ColumnSlot
,
},
props
:
{
mode
:
{
type
:
[
String
,
Number
],
default
:
0
,
validator
:
(
v
)
=>
{
var
modes
=
[
"read"
,
"column"
,
"row"
];
if
(
/^
\d
+/
.
test
(
v
))
{
return
v
>=
0
&&
v
<
modes
.
length
;
}
return
modes
.
indexOf
(
v
)
>
-
1
;
},
},
border
:
{
//是否显示边框
type
:
Boolean
,
default
:
true
,
},
batch
:
{
//是否批量操作
type
:
Boolean
,
default
:
true
,
},
format
:
{
type
:
Function
,
default
:
null
,
},
initsearch
:
{
type
:
Function
,
default
:
null
,
},
data
()
{
lazy
:
{
//懒加载设置,设置为真时候,默认不加载数据。
type
:
Boolean
,
default
:
false
,
},
placeholder
:
{
type
:
String
,
default
:
"请输入关键字"
,
},
height
:
{
type
:
Number
,
default
:
0
,
},
tool
:
{
//是否显示工具栏
type
:
Boolean
,
default
:
true
,
},
easy
:
{
//是否显示简单搜索
type
:
Boolean
,
default
:
true
,
},
high
:
{
//是否显示高级搜索
type
:
Boolean
,
default
:
true
,
},
draggable
:
{
//是否可以拖拽
type
:
Boolean
,
default
:
false
,
},
set
:
{
//是否显示列设置
type
:
Boolean
,
default
:
true
,
},
page
:
{
//是否分页
type
:
Boolean
,
default
:
false
,
},
columns
:
Array
,
items
:
{
//接收树形数据
type
:
Array
,
default
()
{
return
[];
},
},
data
:
{
//接收UpId型数据
type
:
Array
,
default
()
{
return
[];
},
},
keyname
:
{
//默认行主键
type
:
[
String
],
default
:
"id"
,
},
upname
:
{
// 父级字段名称
type
:
String
,
default
:
"upId"
,
},
root
:
{
// 根级UpId的值.
type
:
[
String
,
Number
],
default
:
0
,
},
action
:
{
//接口地址
type
:
String
,
default
:
""
,
},
conditions
:
{
//查询条件
type
:
Object
,
default
:
function
()
{
return
{
color
:
"#19be6b"
,
checkAll
:
false
,
keys
:
""
,
selectItems
:
[],
modalSearch
:
false
,
footerToolbar
:
false
,
search
:
{
pageIndex
:
1
,
pageSize
:
20
,
sortBy
:
"id"
,
isDesc
:
true
,
conditions
:
[],
},
searchConditions
:
this
.
search
,
pageSizeOpts
:
[
20
,
50
,
100
],
tableHeight
:
0
,
firstY
:
0
,
config
:
false
,
logs
:
[],
trs
:
[],
// 处理后数据数组
columnsCur
:
[],
// 处理后的表头数据
checkGroup
:
[],
// 复选框数组
checks
:
false
,
// 全选
tdsWidth
:
0
,
// td总宽
timer
:
false
,
// 控制监听时长
dataLength
:
0
,
// 树形数据长度
dragIndex
:
-
1
,
//拖拽开始的序号
allUser
:
[],
//所有user
keys
:
{
op
:
"name"
,
value
:
""
,
default
:
true
,
},
};
},
},
computed
:
{
indeterminate
()
{
var
checkeds
=
this
.
trs
.
filter
((
u
)
=>
{
return
u
.
_checked
;
}).
length
;
return
0
<
checkeds
&&
checkeds
<
this
.
trs
.
length
;
},
},
watch
:
{
items
()
{
if
(
this
.
items
)
{
this
.
trs
=
this
.
treeToList
(
this
.
items
);
this
.
checkGroup
=
this
.
renderCheck
(
this
.
items
);
if
(
this
.
checkGroup
.
length
==
this
.
dataLength
)
{
this
.
checks
=
true
;
}
else
{
this
.
checks
=
false
;
}
}
},
data
(
v
)
{},
columns
:
{
handler
()
{
this
.
columnsCur
=
this
.
makeColumns
();
},
deep
:
true
,
},
checkGroup
(
data
)
{
this
.
checkAllGroupChange
(
data
);
},
exportTitle
(
v
)
{
this
.
exportTitle
=
v
}
iconName
:
false
,
drag
:
{
//拖拽
type
:
Boolean
,
default
:
false
,
},
mounted
()
{
this
.
getAllUser
();
//获取所有用户
if
(
this
.
items
&&
this
.
items
.
length
>
0
)
{
this
.
trs
=
this
.
treeToList
(
this
.
items
);
this
.
columnsCur
=
this
.
makeColumns
();
this
.
checkGroup
=
this
.
renderCheck
(
this
.
items
);
if
(
this
.
checkGroup
.
length
==
this
.
dataLength
)
{
this
.
checks
=
true
;
}
else
{
this
.
checks
=
false
;
}
}
spaceWidth
:
{
//树形表格缩进距离
type
:
Number
,
default
:
20
,
},
methods
:
{
load
()
{},
complexSearch
()
{
var
search
=
this
.
$refs
.
search
.
$children
.
filter
((
u
)
=>
{
return
u
.
condition
;
});
if
(
search
)
{
var
conditions
=
search
[
0
].
condition
;
this
.
reload
(
conditions
);
}
},
slots
()
{
return
this
.
$scopedSlots
;
},
//拖拽开始
dragstart
(
e
,
index
,
row
)
{
this
.
dragIndex
=
index
;
console
.
log
(
index
);
},
//进入
dragenter
(
e
,
index
,
row
)
{
var
tr
=
document
.
getElementById
(
"tr"
+
index
);
if
(
this
.
dragIndex
>
index
)
{
tr
.
className
+=
" move"
;
}
else
if
(
this
.
dragIndex
<
index
)
{
tr
.
className
+=
" sort"
;
}
},
// 悬浮
dragover
(
e
,
index
,
row
)
{
e
.
preventDefault
();
// 鼠标Y
var
my
=
e
.
offsetY
;
var
h
=
e
.
toElement
.
clientHeight
;
var
tr
=
document
.
getElementById
(
"tr"
+
index
);
if
(
this
.
dragIndex
>
index
&&
my
/
h
<
0.5
)
{
tr
.
className
=
tr
.
className
.
replace
(
" move"
,
" sort"
);
}
if
(
this
.
dragIndex
<
index
&&
my
/
h
>
0.5
)
{
tr
.
className
=
tr
.
className
.
replace
(
" sort"
,
" move"
);
}
},
// 离开
dragleave
(
e
,
index
,
row
)
{
var
tr
=
document
.
getElementById
(
"tr"
+
index
);
tr
.
className
=
tr
.
className
.
replace
(
" move"
,
""
).
replace
(
" sort"
,
""
);
},
//放下
dragdrop
(
e
,
index
,
row
)
{
event
.
preventDefault
();
var
tr
=
document
.
getElementById
(
"tr"
+
index
);
tr
.
className
=
tr
.
className
.
replace
(
" move"
,
""
).
replace
(
" sort"
,
""
);
if
(
index
!=
this
.
dragIndex
)
{
this
.
$emit
(
"on-drag-drop"
,
this
.
dragIndex
,
index
,
this
.
trs
,
e
);
}
},
/**
exportTitle
:
{
type
:
String
,
default
:
""
,
},
},
provide
()
{
return
{
tableRoot
:
this
.
slots
,
};
},
data
()
{
return
{
color
:
"#19be6b"
,
checkAll
:
false
,
keys
:
""
,
selectItems
:
[],
modalSearch
:
false
,
footerToolbar
:
false
,
search
:
{
pageIndex
:
1
,
pageSize
:
20
,
sortBy
:
"id"
,
isDesc
:
true
,
conditions
:
[],
},
searchConditions
:
this
.
search
,
pageSizeOpts
:
[
20
,
50
,
100
],
tableHeight
:
0
,
firstY
:
0
,
config
:
false
,
logs
:
[],
trs
:
[],
// 处理后数据数组
columnsCur
:
[],
// 处理后的表头数据
checkGroup
:
[],
// 复选框数组
checks
:
false
,
// 全选
tdsWidth
:
0
,
// td总宽
timer
:
false
,
// 控制监听时长
dataLength
:
0
,
// 树形数据长度
dragIndex
:
-
1
,
//拖拽开始的序号
allUser
:
[],
//所有user
};
},
computed
:
{
indeterminate
()
{
var
checkeds
=
this
.
trs
.
filter
((
u
)
=>
{
return
u
.
_checked
;
}).
length
;
return
0
<
checkeds
&&
checkeds
<
this
.
trs
.
length
;
},
},
watch
:
{
items
()
{
if
(
this
.
items
)
{
this
.
trs
=
this
.
treeToList
(
this
.
items
);
}
},
data
(
v
)
{},
columns
:
{
handler
()
{
this
.
columnsCur
=
this
.
makeColumns
();
},
deep
:
true
,
},
exportTitle
(
v
)
{
this
.
exportTitle
=
v
;
},
},
mounted
()
{
this
.
getAllUser
();
//获取所有用户
if
(
this
.
items
&&
this
.
items
.
length
>
0
)
{
this
.
trs
=
this
.
treeToList
(
this
.
items
);
this
.
columnsCur
=
this
.
makeColumns
();
}
},
methods
:
{
load
()
{},
complexSearch
()
{
var
search
=
this
.
$refs
.
search
.
$children
.
filter
((
u
)
=>
{
return
u
.
condition
;
});
if
(
search
)
{
var
conditions
=
search
[
0
].
condition
;
this
.
reload
(
conditions
);
}
},
slots
()
{
return
this
.
$scopedSlots
;
},
//拖拽开始
dragstart
(
e
,
index
,
row
)
{
this
.
dragIndex
=
index
;
console
.
log
(
index
);
},
//进入
dragenter
(
e
,
index
,
row
)
{
var
tr
=
document
.
getElementById
(
"tr"
+
index
);
if
(
this
.
dragIndex
>
index
)
{
tr
.
className
+=
" move"
;
}
else
if
(
this
.
dragIndex
<
index
)
{
tr
.
className
+=
" sort"
;
}
},
// 悬浮
dragover
(
e
,
index
,
row
)
{
e
.
preventDefault
();
// 鼠标Y
var
my
=
e
.
offsetY
;
var
h
=
e
.
toElement
.
clientHeight
;
var
tr
=
document
.
getElementById
(
"tr"
+
index
);
if
(
this
.
dragIndex
>
index
&&
my
/
h
<
0.5
)
{
tr
.
className
=
tr
.
className
.
replace
(
" move"
,
" sort"
);
}
if
(
this
.
dragIndex
<
index
&&
my
/
h
>
0.5
)
{
tr
.
className
=
tr
.
className
.
replace
(
" sort"
,
" move"
);
}
},
// 离开
dragleave
(
e
,
index
,
row
)
{
var
tr
=
document
.
getElementById
(
"tr"
+
index
);
tr
.
className
=
tr
.
className
.
replace
(
" move"
,
""
).
replace
(
" sort"
,
""
);
},
//放下
dragdrop
(
e
,
index
,
row
)
{
event
.
preventDefault
();
var
tr
=
document
.
getElementById
(
"tr"
+
index
);
tr
.
className
=
tr
.
className
.
replace
(
" move"
,
""
).
replace
(
" sort"
,
""
);
if
(
index
!=
this
.
dragIndex
)
{
this
.
$emit
(
"on-drag-drop"
,
this
.
dragIndex
,
index
,
this
.
trs
,
e
);
}
},
/**
* @dragover="dragover($event, index, item)"
@dragleave="dragleave($event,index,item)"
*/
// 有无多选框折叠位置优化
treeColumn
()
{
var
num
=
0
;
for
(
let
i
=
0
,
len
=
this
.
columns
.
length
;
i
<
len
;
i
++
)
{
if
(
this
.
columns
[
i
].
tree
)
{
num
=
i
;
}
}
return
num
;
},
// 设置td宽度,td的align
tdStyle
(
column
)
{
const
style
=
{};
if
(
column
.
align
)
{
style
[
"text-align"
]
=
column
.
align
;
}
if
(
column
.
width
)
{
style
[
"width"
]
=
`
${
column
.
width
}
px`
;
}
if
(
column
.
hide
)
{
style
[
"display"
]
=
`none`
;
}
return
style
;
},
// 排序事件
handleSort
(
index
,
type
)
{
this
.
columnsCur
.
forEach
((
col
)
=>
(
col
.
_sortType
=
"normal"
));
if
(
this
.
columnsCur
[
index
].
_sortType
===
type
)
{
this
.
columnsCur
[
index
].
_sortType
=
"normal"
;
}
else
{
this
.
columnsCur
[
index
].
_sortType
=
type
;
}
this
.
$emit
(
"on-sort-change"
,
this
.
columnsCur
[
index
].
key
,
this
.
columnsCur
[
index
].
_sortType
);
},
// 点击某一行事件
RowClick
(
data
,
event
,
index
,
text
)
{
this
.
$emit
(
"on-row-click"
,
data
,
event
,
index
,
text
);
},
// 点击事件 返回数据处理
// 处理表头数据
makeColumns
()
{
const
columns
=
this
.
$u
.
clone
(
this
.
columns
);
this
.
tdsWidth
=
0
;
columns
.
forEach
((
column
,
index
)
=>
{
column
.
_index
=
index
;
column
.
_width
=
column
.
width
?
column
.
width
:
""
;
column
.
_sortType
=
"normal"
;
this
.
tdsWidth
+=
column
.
width
?
parseFloat
(
column
.
width
)
:
0
;
});
return
columns
;
},
// // 隐藏显示
toggle
(
index
,
item
)
{
if
(
item
.
_count
>
0
)
{
this
.
$set
(
this
.
trs
[
index
],
"_expanded"
,
!
item
.
_expanded
);
this
.
trs
.
forEach
((
u
,
i
)
=>
{
if
(
u
[
this
.
upname
]
===
item
.
id
)
{
this
.
$set
(
this
.
trs
[
i
],
"_show"
,
!
item
.
_expanded
);
}
});
// 有无多选框折叠位置优化
treeColumn
()
{
var
num
=
0
;
for
(
let
i
=
0
,
len
=
this
.
columns
.
length
;
i
<
len
;
i
++
)
{
if
(
this
.
columns
[
i
].
tree
)
{
num
=
i
;
}
}
return
num
;
},
// 设置td宽度,td的align
tdStyle
(
column
)
{
const
style
=
{};
if
(
column
.
align
)
{
style
[
"text-align"
]
=
column
.
align
;
}
if
(
column
.
width
)
{
style
[
"width"
]
=
`
${
column
.
width
}
px`
;
}
if
(
column
.
hide
)
{
style
[
"display"
]
=
`none`
;
}
return
style
;
},
// 排序事件
handleSort
(
index
,
type
)
{
this
.
columnsCur
.
forEach
((
col
)
=>
(
col
.
_sortType
=
"normal"
));
if
(
this
.
columnsCur
[
index
].
_sortType
===
type
)
{
this
.
columnsCur
[
index
].
_sortType
=
"normal"
;
}
else
{
this
.
columnsCur
[
index
].
_sortType
=
type
;
}
this
.
$emit
(
"on-sort-change"
,
this
.
columnsCur
[
index
].
key
,
this
.
columnsCur
[
index
].
_sortType
);
},
// 点击某一行事件
RowClick
(
data
,
event
,
index
,
text
)
{
this
.
$emit
(
"on-row-click"
,
data
,
event
,
index
,
text
);
},
// 点击事件 返回数据处理
// 处理表头数据
makeColumns
()
{
const
columns
=
this
.
$u
.
clone
(
this
.
columns
);
this
.
tdsWidth
=
0
;
columns
.
forEach
((
column
,
index
)
=>
{
column
.
_index
=
index
;
column
.
_width
=
column
.
width
?
column
.
width
:
""
;
column
.
_sortType
=
"normal"
;
this
.
tdsWidth
+=
column
.
width
?
parseFloat
(
column
.
width
)
:
0
;
});
return
columns
;
},
// // 隐藏显示
toggle
(
index
,
item
)
{
if
(
item
.
_count
>
0
)
{
this
.
$set
(
this
.
trs
[
index
],
"_expanded"
,
!
item
.
_expanded
);
this
.
trs
.
forEach
((
u
,
i
)
=>
{
if
(
u
[
this
.
upname
]
===
item
.
id
)
{
this
.
$set
(
this
.
trs
[
i
],
"_show"
,
!
item
.
_expanded
);
}
});
}
},
show
(
item
)
{
if
(
item
.
_level
==
0
)
{
return
true
;
}
else
{
var
parents
=
this
.
getRoots
(
item
);
return
(
parents
.
filter
((
u
)
=>
{
return
!
u
.
_expanded
;
}).
length
==
0
);
}
},
getRoots
(
item
)
{
var
parents
=
[];
var
root
=
this
.
trs
.
filter
((
u
)
=>
{
return
u
[
this
.
keyname
]
==
item
[
this
.
upname
];
});
while
(
root
.
length
==
1
)
{
parents
.
push
(
root
[
0
]);
root
=
this
.
trs
.
filter
((
u
)
=>
{
return
u
[
this
.
keyname
]
===
root
[
0
][
this
.
upname
];
});
}
return
parents
;
},
open
(
index
,
item
)
{
if
(
item
.
children
)
{
item
.
children
.
forEach
((
child
,
childIndex
)
=>
{
child
.
isShow
=
true
;
if
(
child
.
children
&&
child
.
expanded
)
{
this
.
open
(
index
+
childIndex
+
1
,
child
);
}
});
}
},
close
(
index
,
item
)
{
if
(
item
.
children
)
{
item
.
children
.
forEach
((
child
,
childIndex
)
=>
{
child
.
isShow
=
false
;
child
.
expanded
=
false
;
if
(
child
.
children
)
{
this
.
close
(
index
+
childIndex
+
1
,
child
);
}
});
}
},
// 点击check勾选框,判断是否有children节点 如果有就一并勾选
rowChecked
(
data
,
index
,
event
)
{
// this.$set(this.trs, index, data);
var
boys
=
this
.
getChildrens
(
data
);
if
(
boys
.
length
){
}
this
.
trs
.
forEach
((
u
,
i
)
=>
{
var
items
=
boys
.
filter
((
b
)
=>
{
return
b
[
this
.
keyname
]
==
u
[
this
.
keyname
];
});
if
(
items
.
length
==
1
)
{
this
.
$set
(
this
.
trs
[
i
],
"_checked"
,
!
data
.
_checked
);
}
});
this
.
checkAll
=
this
.
trs
.
length
>
this
.
trs
.
filter
((
u
)
=>
{
return
!
u
.
_checked
;
}).
length
;
this
.
$nextTick
(()
=>
{
this
.
selectionChange
();
});
},
getChildrens
(
data
)
{
var
childrens
=
[];
var
that
=
this
;
getChildren
(
data
);
function
getChildren
(
f
)
{
that
.
trs
.
forEach
((
u
)
=>
{
if
(
u
[
that
.
upname
]
==
f
[
that
.
keyname
])
{
childrens
.
push
(
u
);
getChildren
(
u
);
}
});
}
return
childrens
;
},
// checkbox 全选 选择事件
allChecked
(
v
)
{
this
.
trs
.
forEach
((
u
,
i
)
=>
{
this
.
$set
(
this
.
trs
[
i
],
"_checked"
,
v
);
});
this
.
$nextTick
(()
=>
{
this
.
selectionChange
();
});
},
selectionChange
()
{
var
items
=
this
.
trs
.
filter
((
u
)
=>
{
return
u
.
_checked
===
true
;
});
this
.
selectItems
=
items
;
this
.
$emit
(
"on-selection-change"
,
items
,
this
.
trs
);
this
.
footerToolbar
=
items
.
length
>
0
;
console
.
log
(
"footerToolbar"
,
items
,
this
.
trs
);
},
// 数组去重
getArray
(
a
)
{
const
hash
=
{};
const
len
=
a
.
length
;
const
result
=
[];
for
(
let
i
=
0
;
i
<
len
;
i
++
)
{
if
(
!
hash
[
a
[
i
]])
{
hash
[
a
[
i
]]
=
true
;
result
.
push
(
a
[
i
]);
}
}
return
result
;
},
All
(
data
)
{
let
arr
=
[];
data
.
forEach
((
item
)
=>
{
arr
.
push
(
item
.
id
);
if
(
item
.
children
&&
item
.
children
.
length
>
0
)
{
arr
=
arr
.
concat
(
this
.
All
(
item
.
children
));
}
});
return
arr
;
},
// 返回表头
renderHeader
(
column
,
$index
)
{
if
(
"renderHeader"
in
this
.
columns
[
$index
])
{
return
this
.
columns
[
$index
].
renderHeader
(
column
,
$index
);
}
return
column
.
title
||
"#"
;
},
treeToList
(
tree
)
{
var
that
=
this
;
let
list
=
[];
function
treeToList
(
data
,
level
)
{
data
.
map
((
u
)
=>
{
let
copy
=
that
.
$u
.
clone
(
u
);
copy
.
_count
=
0
;
copy
.
_level
=
level
;
copy
.
_expanded
=
copy
.
_expanded
||
that
.
level
>
level
;
copy
.
_show
=
true
;
copy
.
_indeterminate
=
false
;
copy
.
_checked
=
copy
.
_checked
||
false
;
list
.
push
(
copy
);
if
(
u
.
children
)
{
treeToList
(
u
.
children
,
level
+
1
);
copy
.
_count
=
u
.
children
.
length
;
delete
copy
.
children
;
}
});
}
treeToList
(
tree
,
0
);
return
list
;
},
// 返回内容
renderBody
(
row
,
column
,
index
)
{
return
row
[
column
.
key
];
},
//分页选择
pageChange
(
page
)
{
this
.
search
.
page
=
page
;
this
.
search
.
pageIndex
=
page
;
this
.
load
();
},
pageSizeChange
(
size
)
{
this
.
search
.
pageSize
=
size
;
this
.
search
.
pageIndex
=
1
;
this
.
load
();
},
columnChange
(
item
,
i
)
{
item
.
hide
=
!
item
.
hide
;
this
.
$set
(
this
.
columnsCur
,
item
,
i
);
this
.
saveUserconfig
();
},
onSelect
(
rows
,
row
)
{
this
.
$emit
(
"on-change"
,
rows
,
row
);
},
allChange
(
items
)
{
this
.
$emit
(
"all-change"
,
items
);
},
undoConfig
()
{
//列设置恢复初始化
this
.
columnsCur
=
this
.
$u
.
clone
(
this
.
columns
);
// this.saveUserconfig();
},
//批量取消
cancelBatch
()
{
this
.
footerToolbar
=
false
;
// this.$refs.table.selectAll(false);
},
//导出excel
export2Excel
()
{
//当前显示数据
let
list
=
[];
list
=
this
.
trs
;
const
tHeader
=
[];
// 设置Excel的表格第一行的标题
const
filterVal
=
[];
//list里对象的属性
var
tempCol
=
[];
var
tempCol1
=
[];
//存放物料相关表头
var
tempCol2
=
[];
//存放工艺规程相关表头
var
tempColUser
=
[];
//存放type=user的表头
var
tempColUsers
=
[];
//存放type=users的表头
var
columnsCur
=
this
.
$u
.
clone
(
this
.
columns
);
//导出列标题信息griddata this.$refs.grid.columnsCur
columnsCur
.
forEach
((
el
)
=>
{
if
(
el
.
export
)
{
if
(
el
.
code
)
{
tempCol
.
push
({
key
:
el
.
key
,
code
:
el
.
code
,
});
//临时存放code数据字典的字段及对应的数据字典code
}
if
(
el
.
materialKey
)
{
tempCol1
.
push
({
key
:
el
.
key
,
code
:
el
.
materialKey
,
});
//临时存放物料管理大类和子类列表
}
if
(
el
.
techKey
)
{
tempCol2
.
push
({
key
:
el
.
key
,
code
:
el
.
techKey
,
});
//临时存放工艺规程相关转换
}
if
(
el
.
type
&&
el
.
type
==
"user"
)
{
tempColUser
.
push
({
key
:
el
.
key
,
code
:
el
.
type
,
});
//临时存放user列
}
if
(
el
.
type
&&
el
.
type
==
"users"
)
{
tempColUsers
.
push
({
key
:
el
.
key
,
code
:
el
.
type
,
});
//临时存放user列
}
tHeader
.
push
(
el
.
title
);
filterVal
.
push
(
el
.
key
);
}
});
list
.
forEach
((
e
)
=>
{
tempCol
.
forEach
((
elem
)
=>
{
if
(
(
e
[
elem
.
key
]
&&
e
[
elem
.
key
]
!=
""
&&
e
[
elem
.
key
]
!=
null
)
||
e
[
elem
.
key
]
==
0
)
{
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值。
let
codeArr
=
[];
let
keyValue
=
e
[
elem
.
key
];
if
(
keyValue
.
length
>
0
&&
(
keyValue
.
indexOf
(
","
)
>
-
1
||
keyValue
.
indexOf
(
","
)
>
-
1
)
)
{
//如果对应的数据包含多个数据字典项,比如包含“,”或“,”
if
(
keyValue
.
indexOf
(
","
)
>
-
1
)
{
codeArr
=
keyValue
.
split
(
","
);
}
if
(
keyValue
.
indexOf
>
-
1
)
{
codeArr
=
keyValue
.
split
(
","
);
}
}
console
.
warn
(
index
,
item
.
_expanded
,
item
);
},
show
(
item
)
{
if
(
item
.
_level
==
0
)
{
return
true
;
if
(
codeArr
.
length
<=
1
)
{
//对应的数据包含一个数据字典项
e
[
elem
.
key
]
=
this
.
$u
.
dirName
(
this
.
$store
.
getters
.
dictionaryByKey
(
elem
.
code
),
e
[
elem
.
key
]
);
}
else
{
var
parents
=
this
.
getRoots
(
item
);
return
(
parents
.
filter
((
u
)
=>
{
return
!
u
.
_expanded
;
}).
length
==
0
);
//对应的数据包含多个数据字典项
let
codeInfo
=
""
;
codeArr
.
forEach
((
el
)
=>
{
codeInfo
=
codeInfo
+
this
.
$u
.
dirName
(
this
.
$store
.
getters
.
dictionaryByKey
(
elem
.
code
),
el
)
+
","
;
});
e
[
elem
.
key
]
=
codeInfo
.
substr
(
0
,
codeInfo
.
length
-
1
);
}
},
getRoots
(
item
)
{
var
parents
=
[];
var
root
=
this
.
trs
.
filter
((
u
)
=>
{
return
u
[
this
.
keyname
]
==
item
[
this
.
upname
];
}
});
//导出数据增加对应的物料管理信息 code: 1【rootCategoryId 大类】 2【categoryId 大类】 3【codeRuleId 编码名称】
tempCol1
.
forEach
((
elcol1
)
=>
{
if
(
elcol1
.
code
==
1
)
{
e
[
elcol1
.
key
]
=
this
.
getType1
(
e
[
elcol1
.
key
]);
}
else
if
(
elcol1
.
code
==
2
)
{
e
[
elcol1
.
key
]
=
this
.
getType2
(
e
[
elcol1
.
key
]);
}
else
if
(
elcol1
.
code
==
3
)
{
e
[
elcol1
.
key
]
=
this
.
getType3
(
e
[
elcol1
.
key
]);
}
});
//导出工艺规程相关转换表头信息
tempCol2
.
forEach
((
elcol2
)
=>
{
if
(
elcol2
.
code
==
1
)
{
e
[
elcol2
.
key
]
=
this
.
getRoutingHeaderName
(
e
[
elcol2
.
key
]);
}
});
//导出username相关信息
tempColUser
.
forEach
((
eluser
)
=>
{
if
(
Array
.
isArray
(
e
[
eluser
.
key
])
&&
e
[
eluser
.
key
].
length
>
0
)
{
let
temUsers
=
this
.
$u
.
clone
(
e
[
eluser
.
key
]);
let
temUserName
=
""
;
temUsers
.
forEach
((
u
)
=>
{
temUserName
=
temUserName
+
this
.
getUserName
(
u
);
});
while
(
root
.
length
==
1
)
{
parents
.
push
(
root
[
0
]);
root
=
this
.
trs
.
filter
((
u
)
=>
{
return
u
[
this
.
keyname
]
===
root
[
0
][
this
.
upname
];
});
}
return
parents
;
},
open
(
index
,
item
)
{
if
(
item
.
children
)
{
item
.
children
.
forEach
((
child
,
childIndex
)
=>
{
child
.
isShow
=
true
;
if
(
child
.
children
&&
child
.
expanded
)
{
this
.
open
(
index
+
childIndex
+
1
,
child
);
}
});
}
},
close
(
index
,
item
)
{
if
(
item
.
children
)
{
item
.
children
.
forEach
((
child
,
childIndex
)
=>
{
child
.
isShow
=
false
;
child
.
expanded
=
false
;
if
(
child
.
children
)
{
this
.
close
(
index
+
childIndex
+
1
,
child
);
}
});
}
},
// 点击check勾选框,判断是否有children节点 如果有就一并勾选
rowChecked
(
data
,
index
,
event
)
{
var
boys
=
this
.
getChildrens
(
data
);
this
.
trs
.
forEach
((
u
,
i
)
=>
{
var
items
=
boys
.
filter
((
b
)
=>
{
return
b
[
this
.
keyname
]
==
u
[
this
.
keyname
];
});
if
(
items
.
length
==
1
)
{
this
.
$set
(
this
.
trs
[
i
],
"_checked"
,
!
data
.
_checked
);
}
e
[
eluser
.
key
]
=
temUserName
;
}
if
(
e
[
eluser
.
key
]
&&
typeof
e
[
eluser
.
key
]
==
"string"
&&
e
[
eluser
.
key
]
!=
""
&&
e
[
eluser
.
key
]
!=
null
)
{
e
[
eluser
.
key
]
=
this
.
getUserName
(
e
[
eluser
.
key
]);
}
});
tempColUsers
.
forEach
((
elusers
)
=>
{
if
(
e
[
elusers
.
key
].
length
>
0
)
{
let
temUsers
=
this
.
$u
.
clone
(
e
[
elusers
.
key
]);
let
temUserName
=
""
;
temUsers
.
forEach
((
u
)
=>
{
temUserName
=
temUserName
+
this
.
getUserName
(
u
)
+
","
;
});
this
.
checkAll
=
this
.
trs
.
length
>
this
.
trs
.
filter
((
u
)
=>
{
return
!
u
.
_checked
;
}).
length
;
},
getChildrens
(
data
)
{
var
childrens
=
[];
var
that
=
this
;
getChildren
(
data
);
function
getChildren
(
f
)
{
that
.
trs
.
forEach
((
u
)
=>
{
if
(
u
[
that
.
upname
]
==
f
[
that
.
keyname
])
{
childrens
.
push
(
u
);
getChildren
(
u
);
}
});
}
return
childrens
;
},
// checkbox 全选 选择事件
checked
(
v
)
{
this
.
trs
.
forEach
((
u
,
i
)
=>
{
this
.
$set
(
this
.
trs
[
i
],
"_checked"
,
v
);
});
// this.$emit('on-selection-change', this.checkGroup)
},
// 数组去重
getArray
(
a
)
{
const
hash
=
{};
const
len
=
a
.
length
;
const
result
=
[];
for
(
let
i
=
0
;
i
<
len
;
i
++
)
{
if
(
!
hash
[
a
[
i
]])
{
hash
[
a
[
i
]]
=
true
;
result
.
push
(
a
[
i
]);
}
}
return
result
;
},
checkAllGroupChange
(
data
)
{
if
(
this
.
dataLength
>
0
&&
data
.
length
===
this
.
dataLength
)
{
this
.
checks
=
true
;
}
else
{
this
.
checks
=
false
;
}
this
.
$emit
(
"on-selection-change"
,
this
.
checkGroup
);
},
All
(
data
)
{
let
arr
=
[];
data
.
forEach
((
item
)
=>
{
arr
.
push
(
item
.
id
);
if
(
item
.
children
&&
item
.
children
.
length
>
0
)
{
arr
=
arr
.
concat
(
this
.
All
(
item
.
children
));
}
});
return
arr
;
},
e
[
elusers
.
key
]
=
temUserName
.
substr
(
0
,
temUserName
.
length
-
1
);
}
});
});
// 返回表头
renderHeader
(
column
,
$index
)
{
if
(
"renderHeader"
in
this
.
columns
[
$index
])
{
return
this
.
columns
[
$index
].
renderHeader
(
column
,
$index
);
}
return
column
.
title
||
"#"
;
},
treeToList
(
tree
)
{
var
that
=
this
;
let
list
=
[];
function
treeToList
(
data
,
level
)
{
data
.
map
((
u
)
=>
{
let
copy
=
that
.
$u
.
clone
(
u
);
copy
.
_count
=
0
;
copy
.
_level
=
level
;
copy
.
_expanded
=
copy
.
_expanded
||
that
.
level
>
level
;
copy
.
_show
=
true
;
copy
.
_indeterminate
=
false
;
copy
.
_checked
=
copy
.
_checked
||
false
;
list
.
push
(
copy
);
if
(
u
.
children
)
{
treeToList
(
u
.
children
,
level
+
1
);
copy
.
_count
=
u
.
children
.
length
;
delete
copy
.
children
;
}
});
}
treeToList
(
tree
,
0
);
return
list
;
},
// 返回内容
renderBody
(
row
,
column
,
index
)
{
return
row
[
column
.
key
];
},
// 默认选中
renderCheck
(
data
)
{
let
arr
=
[];
data
.
forEach
((
item
)
=>
{
if
(
item
.
_checked
)
{
arr
.
push
(
item
.
id
);
}
if
(
item
.
children
&&
item
.
children
.
length
>
0
)
{
arr
=
arr
.
concat
(
this
.
renderCheck
(
item
.
children
));
}
});
return
arr
;
},
//分页选择
pageChange
(
page
)
{
this
.
search
.
page
=
page
;
this
.
search
.
pageIndex
=
page
;
this
.
load
();
},
pageSizeChange
(
size
)
{
this
.
search
.
pageSize
=
size
;
this
.
search
.
pageIndex
=
1
;
this
.
load
();
},
columnChange
(
item
,
i
)
{
item
.
hide
=
!
item
.
hide
;
this
.
$set
(
this
.
columnsCur
,
item
,
i
);
this
.
saveUserconfig
();
},
selectionChange
(
items
)
{
this
.
$emit
(
"on-selection-change"
,
items
);
this
.
selectItems
=
items
;
this
.
footerToolbar
=
items
.
length
>
0
;
},
onSelect
(
rows
,
row
)
{
this
.
$emit
(
"on-change"
,
rows
,
row
);
},
allChange
(
items
)
{
this
.
$emit
(
"all-change"
,
items
);
},
undoConfig
()
{
//列设置恢复初始化
this
.
columnsCur
=
this
.
$u
.
clone
(
this
.
columns
);
// this.saveUserconfig();
},
//批量取消
cancelBatch
()
{
this
.
footerToolbar
=
false
;
this
.
$refs
.
table
.
selectAll
(
false
);
},
//导出excel
export2Excel
()
{
//当前显示数据
let
list
=
[];
list
=
this
.
trs
;
const
tHeader
=
[];
// 设置Excel的表格第一行的标题
const
filterVal
=
[];
//list里对象的属性
var
tempCol
=
[];
var
tempCol1
=
[];
//存放物料相关表头
var
tempCol2
=
[];
//存放工艺规程相关表头
var
tempColUser
=
[];
//存放type=user的表头
var
tempColUsers
=
[];
//存放type=users的表头
var
columnsCur
=
this
.
$u
.
clone
(
this
.
columns
);
//导出列标题信息griddata this.$refs.grid.columnsCur
columnsCur
.
forEach
((
el
)
=>
{
if
(
el
.
export
)
{
if
(
el
.
code
)
{
tempCol
.
push
({
key
:
el
.
key
,
code
:
el
.
code
,
});
//临时存放code数据字典的字段及对应的数据字典code
}
if
(
el
.
materialKey
)
{
tempCol1
.
push
({
key
:
el
.
key
,
code
:
el
.
materialKey
,
});
//临时存放物料管理大类和子类列表
}
if
(
el
.
techKey
)
{
tempCol2
.
push
({
key
:
el
.
key
,
code
:
el
.
techKey
,
});
//临时存放工艺规程相关转换
}
if
(
el
.
type
&&
el
.
type
==
"user"
)
{
tempColUser
.
push
({
key
:
el
.
key
,
code
:
el
.
type
,
});
//临时存放user列
}
if
(
el
.
type
&&
el
.
type
==
"users"
)
{
tempColUsers
.
push
({
key
:
el
.
key
,
code
:
el
.
type
,
});
//临时存放user列
}
tHeader
.
push
(
el
.
title
);
filterVal
.
push
(
el
.
key
);
}
});
list
.
forEach
((
e
)
=>
{
tempCol
.
forEach
((
elem
)
=>
{
if
((
e
[
elem
.
key
]
&&
e
[
elem
.
key
]
!=
""
&&
e
[
elem
.
key
]
!=
null
)
||
e
[
elem
.
key
]
==
0
)
{
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值。
let
codeArr
=
[];
let
keyValue
=
e
[
elem
.
key
];
if
(
keyValue
.
length
>
0
&&
(
keyValue
.
indexOf
(
","
)
>
-
1
||
keyValue
.
indexOf
(
","
)
>
-
1
)
)
{
//如果对应的数据包含多个数据字典项,比如包含“,”或“,”
if
(
keyValue
.
indexOf
(
","
)
>
-
1
)
{
codeArr
=
keyValue
.
split
(
","
);
}
if
(
keyValue
.
indexOf
>
-
1
)
{
codeArr
=
keyValue
.
split
(
","
);
}
}
if
(
codeArr
.
length
<=
1
)
{
//对应的数据包含一个数据字典项
e
[
elem
.
key
]
=
this
.
$u
.
dirName
(
this
.
$store
.
getters
.
dictionaryByKey
(
elem
.
code
),
e
[
elem
.
key
]
);
}
else
{
//对应的数据包含多个数据字典项
let
codeInfo
=
""
;
codeArr
.
forEach
((
el
)
=>
{
codeInfo
=
codeInfo
+
this
.
$u
.
dirName
(
this
.
$store
.
getters
.
dictionaryByKey
(
elem
.
code
),
el
)
+
","
;
});
e
[
elem
.
key
]
=
codeInfo
.
substr
(
0
,
codeInfo
.
length
-
1
);
}
}
});
//导出数据增加对应的物料管理信息 code: 1【rootCategoryId 大类】 2【categoryId 大类】 3【codeRuleId 编码名称】
tempCol1
.
forEach
((
elcol1
)
=>
{
if
(
elcol1
.
code
==
1
)
{
e
[
elcol1
.
key
]
=
this
.
getType1
(
e
[
elcol1
.
key
]);
}
else
if
(
elcol1
.
code
==
2
)
{
e
[
elcol1
.
key
]
=
this
.
getType2
(
e
[
elcol1
.
key
]);
}
else
if
(
elcol1
.
code
==
3
)
{
e
[
elcol1
.
key
]
=
this
.
getType3
(
e
[
elcol1
.
key
]);
}
});
//导出工艺规程相关转换表头信息
tempCol2
.
forEach
((
elcol2
)
=>
{
if
(
elcol2
.
code
==
1
)
{
e
[
elcol2
.
key
]
=
this
.
getRoutingHeaderName
(
e
[
elcol2
.
key
]);
}
});
//导出username相关信息
tempColUser
.
forEach
((
eluser
)
=>
{
if
(
Array
.
isArray
(
e
[
eluser
.
key
])
&&
e
[
eluser
.
key
].
length
>
0
)
{
let
temUsers
=
this
.
$u
.
clone
(
e
[
eluser
.
key
])
let
temUserName
=
''
temUsers
.
forEach
(
u
=>
{
temUserName
=
temUserName
+
this
.
getUserName
(
u
);
})
e
[
eluser
.
key
]
=
temUserName
}
if
(
e
[
eluser
.
key
]
&&
typeof
(
e
[
eluser
.
key
])
==
'string'
&&
e
[
eluser
.
key
]
!=
""
&&
e
[
eluser
.
key
]
!=
null
)
{
e
[
eluser
.
key
]
=
this
.
getUserName
(
e
[
eluser
.
key
]);
}
});
tempColUsers
.
forEach
((
elusers
)
=>
{
if
(
e
[
elusers
.
key
].
length
>
0
)
{
let
temUsers
=
this
.
$u
.
clone
(
e
[
elusers
.
key
])
let
temUserName
=
''
temUsers
.
forEach
(
u
=>
{
temUserName
=
temUserName
+
this
.
getUserName
(
u
)
+
','
;
})
e
[
elusers
.
key
]
=
temUserName
.
substr
(
0
,
temUserName
.
length
-
1
)
}
});
});
let
nowDate
=
this
.
$u
.
getNowTime
();
//年月日时分秒yyyyMMddhhmmss
//获取导出数据结束
let
nowDate
=
this
.
$u
.
getNowTime
();
//年月日时分秒yyyyMMddhhmmss
//获取导出数据结束
this
.
$nextTick
(()
=>
{
this
.
$u
.
outExcel
(
this
.
exportTitle
+
"("
+
nowDate
+
")"
,
tHeader
,
filterVal
,
list
);
})
},
//获取所有用户信息
getAllUser
()
{
this
.
$api
.
post
(
`
${
systemUrl
}
/user/paged`
,
{
conditions
:
[],
pageIndex
:
1
,
pageSize
:
100000
,
})
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
let
tempUserInfo
=
r
.
result
.
items
;
tempUserInfo
.
forEach
((
ele
)
=>
{
let
temObj
=
{
userId
:
ele
.
id
,
name
:
ele
.
userName
,
};
this
.
allUser
.
push
(
temObj
);
});
}
});
},
getUserName
(
id
)
{
let
name
=
""
;
this
.
allUser
.
forEach
((
ele
)
=>
{
if
(
id
==
ele
.
userId
)
{
name
=
ele
.
name
;
}
this
.
$nextTick
(()
=>
{
this
.
$u
.
outExcel
(
this
.
exportTitle
+
"("
+
nowDate
+
")"
,
tHeader
,
filterVal
,
list
);
});
},
//获取所有用户信息
getAllUser
()
{
this
.
$api
.
post
(
`
${
systemUrl
}
/user/paged`
,
{
conditions
:
[],
pageIndex
:
1
,
pageSize
:
100000
,
})
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
let
tempUserInfo
=
r
.
result
.
items
;
tempUserInfo
.
forEach
((
ele
)
=>
{
let
temObj
=
{
userId
:
ele
.
id
,
name
:
ele
.
userName
,
};
this
.
allUser
.
push
(
temObj
);
});
return
name
;
}
,
}
}
);
},
getUserName
(
id
)
{
let
name
=
""
;
this
.
allUser
.
forEach
((
ele
)
=>
{
if
(
id
==
ele
.
userId
)
{
name
=
ele
.
name
;
}
});
return
name
;
},
},
};
</
script
>
<
style
lang=
"less"
>
@import "../../../assets/css/custom.less";
@table_theme: #2680eb;
@table_head: #
e9f2fd
;
@table_head: #
f5f6fa
;
@table_line_height: 50px;
@table_hover: #f2f8fe;
@table_border: #accef7;
@table_border: #e8e9eb;
// @table_theme: #2680eb;
// @table_head: #e9f2fd;
// @table_line_height: 50px;
// @table_hover: #f2f8fe;
// @table_border: #accef7;
.table-content1 {
position: relative;
height: 100%;
display: flex;
flex-direction: column;
.table-tools {
line-height: 40px;
background: @right-header-bg;
.table-search {
float: left;
line-height: 40px;
min-width: 300px;
}
position: relative;
height: 100%;
display: flex;
flex-direction: column;
.btns {
float: right;
line-height: 40px;
}
.table-tools {
line-height: 40px;
background: @right-header-bg;
tr:hover {
background: #f7f7f7;
}
.table-search {
float: left;
line-height: 40px;
min-width: 300px;
}
.icon-set {
font-size: 17px;
margin-left: 5px;
display: inline-block;
.btns {
float: right;
line-height: 40px;
}
.icon-set .ivu-icon
{
cursor: pointer
;
tr:hover
{
background: #f7f7f7
;
}
}
table {
border-spacing: 0;
border-collapse: collapse;
margin: 0 auto;
width: 100%;
border: 1px solid @table_border;
.icon-set {
font-size: 17px;
margin-left: 5px;
display: inline-block;
}
th
{
background: @table_head
;
}
.icon-set .ivu-icon
{
cursor: pointer
;
}
td,
th {
border-left: @table_border solid 1px;
border-right: @table_border solid 1px;
border-bottom: #e8e9eb solid 1px;
line-height: 50px;
padding: 0 5px;
table {
border-spacing: 0;
border-collapse: collapse;
margin: 0 auto;
width: 100%;
border: 1px solid @table_border;
.drag:hover
{
cursor: move
;
}
th
{
background: @table_head
;
}
.expand {
width: 18px;
height: 18px;
border: 1px solid @table_border;
text-align: center;
padding: 0 1px;
font-size: 14px;
font-weight: bold;
}
td,
th {
border: @table_border solid 1px;
line-height: 40px;
padding: 0 5px;
.expand:hover {
background: @table_theme;
color: white;
}
.drag:hover {
cursor: move;
}
.ib {
display: inline-block;
}
}
.expand {
width: 18px;
height: 18px;
border: 1px solid @table_border;
text-align: center;
padding: 0 1px;
font-size: 14px;
font-weight: bold;
}
th {
border-top: @table_border solid 1px;
}
.expand:hover {
background: @table_theme;
color: white;
}
tr.treetr:hover td {
background: @table_hover;
}
.ib {
display: inline-block;
}
}
tr.move {
td {
background-color: #d3e6fb;
}
}
th {
border-top: @table_border solid 1px;
}
tr.sort {
td {
border-top: 2px solid #3b8ded;
}
}
tr.treetr:hover td {
background: @table_hover;
}
tbody {
border-bottom: @table_border solid 1px;
}
tr.move {
td {
background-color: #d3e6fb;
}
}
.ms-tree-space {
position: relative;
top: 1px;
display: inline-block;
font-style: normal;
font-weight: 400;
line-height: 1;
width: 14px;
height: 14px;
}
tr.sort {
td {
border-top: 2px solid #3b8ded;
}
}
tbody {
border-bottom: @table_border solid 1px;
}
.ms-tree-space {
position: relative;
top: 1px;
display: inline-block;
font-style: normal;
font-weight: 400;
line-height: 1;
width: 14px;
height: 14px;
}
}
}
</
style
>
i18n/locale/zh-CN.js
View file @
15a0c384
...
...
@@ -946,7 +946,7 @@ export default {
taskCode
:
'甲方任务号'
,
putintDocmentCode
:
'甲方投产输入文件(编号)'
,
technologyDocmentCode
:
'甲方技术输入文件(编号)'
,
productionType
:
'生产类型'
productionType
:
'生产类型'
},
mes_part_task_plan_simulate
:
{
id
:
''
,
...
...
@@ -1137,8 +1137,8 @@ export default {
multipleEquip
:
"是否多台安排设备"
,
// 否 是
multipleEquipIds
:
"设备id"
,
//用英文逗号分隔
discrete
:
'离散值'
,
routingHeaderCode
:
'工艺编号'
,
routingHeaderName
:
'工艺名称'
,
routingHeaderCode
:
'工艺编号'
,
routingHeaderName
:
'工艺名称'
,
},
routing_header
:
{
id
:
''
,
...
...
@@ -1489,9 +1489,9 @@ export default {
endTime
:
'结束时间'
,
planEndTime
:
'计划结束时间'
,
action
:
'操作'
,
subWorkHourStatus
:
'工时状态'
,
routingHeaderCode
:
'工艺编号'
,
routingHeaderName
:
'工艺名称'
subWorkHourStatus
:
'工时状态'
,
routingHeaderCode
:
'工艺编号'
,
routingHeaderName
:
'工艺名称'
},
product_level
:
{
name
:
'名称'
,
...
...
@@ -1824,6 +1824,8 @@ export default {
type
:
'类型'
,
attachment
:
'附件'
,
executor
:
'执行人'
,
upTitle
:
'上级名称'
,
deliverable
:
"交付物"
,
},
project_main
:
{
creationTime
:
'创建时间'
,
...
...
@@ -1922,10 +1924,9 @@ export default {
whour
:
'可用工日'
,
whourpd
:
'可用工时/天'
,
joindate
:
'加入日期'
}
,
//文档分类
document_category
:
{
},
//文档分类
document_category
:
{
creationTime
:
'创建时间'
,
creatorUserId
:
'创建人'
,
lastModificationTime
:
'更新时间'
,
...
...
@@ -2017,10 +2018,11 @@ document_category: {
deletionTime
:
'删除时间'
,
deleterUserId
:
'删除人'
,
projectId
:
'项目id'
,
direction
:
"方向"
,
deliverable
:
"交付物"
,
direction
:
"方向"
,
deliverable
:
"交付物"
,
upId
:
'父级'
,
title
:
'标题'
,
upTitle
:
'上级名称'
,
status
:
'状态'
,
note
:
'描述'
,
startDate
:
'开始日期'
,
...
...
@@ -2159,6 +2161,15 @@ document_category: {
template
:
'模板'
,
attachment
:
'附件'
,
type
:
'模版类型'
,
direction
:
'方向'
,
projectId
:
'项目id'
,
upId
:
'父级'
,
status
:
'状态'
,
startDate
:
'开始日期'
,
endDate
:
'结束日期'
,
executor
:
'执行人'
,
deliverable
:
'交付物'
},
workHour
:
{
userTitle
:
'员工姓名'
,
...
...
libs/henq.js
View file @
15a0c384
...
...
@@ -133,6 +133,10 @@ henq.toTree = (list, rootId, format, parentFiledName) => {
function
toTree
(
data
,
parentId
,
level
)
{
let
parents
=
data
.
filter
(
u
=>
{
if
(
u
[
upId
]
==
''
)
{
u
[
upId
]
=
null
}
return
u
[
upId
]
==
parentId
})
...
...
npm-shrinkwrap.json
View file @
15a0c384
...
...
@@ -4938,7 +4938,7 @@
"dependencies"
:
{
"commander"
:
{
"version"
:
"2.14.1"
,
"resolved"
:
"http
://r.cnpmjs.org/commander/download/
commander-2.14.1.tgz"
,
"resolved"
:
"http
s://registry.npm.taobao.org/commander/download/commander-2.14.1.tgz?cache=0&sync_timestamp=1595168224685&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2F
commander-2.14.1.tgz"
,
"integrity"
:
"sha1-IjUSPjevjKPGXfRbAm29NXsBuao="
}
}
...
...
@@ -5472,7 +5472,7 @@
},
"crc-32"
:
{
"version"
:
"1.2.0"
,
"resolved"
:
"http
://r.cnpmjs
.org/crc-32/download/crc-32-1.2.0.tgz"
,
"resolved"
:
"http
s://registry.npm.taobao
.org/crc-32/download/crc-32-1.2.0.tgz"
,
"integrity"
:
"sha1-yy224puIUI4y2d0OwWk+e0Ghggg="
,
"requires"
:
{
"exit-on-epipe"
:
"~1.0.1"
,
...
...
@@ -7369,7 +7369,7 @@
},
"exit-on-epipe"
:
{
"version"
:
"1.0.1"
,
"resolved"
:
"http
://r.cnpmjs
.org/exit-on-epipe/download/exit-on-epipe-1.0.1.tgz"
,
"resolved"
:
"http
s://registry.npm.taobao
.org/exit-on-epipe/download/exit-on-epipe-1.0.1.tgz"
,
"integrity"
:
"sha1-C92S6H1ShdJn2qgXHQ6wYVlolpI="
},
"expand-brackets"
:
{
...
...
@@ -8020,7 +8020,7 @@
},
"frac"
:
{
"version"
:
"1.1.2"
,
"resolved"
:
"http
://r.cnpmjs
.org/frac/download/frac-1.1.2.tgz"
,
"resolved"
:
"http
s://registry.npm.taobao
.org/frac/download/frac-1.1.2.tgz"
,
"integrity"
:
"sha1-PXT39keMiKG1AgMG10fcYxPHTQs="
},
"fragment-cache"
:
{
...
...
@@ -15092,7 +15092,7 @@
},
"printj"
:
{
"version"
:
"1.1.2"
,
"resolved"
:
"http
://r.cnpmjs
.org/printj/download/printj-1.1.2.tgz"
,
"resolved"
:
"http
s://registry.npm.taobao
.org/printj/download/printj-1.1.2.tgz"
,
"integrity"
:
"sha1-2Q3rKXWoufYA+zoclOP0xTx4oiI="
},
"private"
:
{
...
...
@@ -20545,7 +20545,7 @@
},
"script-loader"
:
{
"version"
:
"0.7.2"
,
"resolved"
:
"http
://r.cnpmjs
.org/script-loader/download/script-loader-0.7.2.tgz"
,
"resolved"
:
"http
s://registry.npm.taobao
.org/script-loader/download/script-loader-0.7.2.tgz"
,
"integrity"
:
"sha1-IBbbb4byX1z1baOJFdgzeLsWa6c="
,
"dev"
:
true
,
"requires"
:
{
...
...
@@ -21133,7 +21133,7 @@
},
"ssf"
:
{
"version"
:
"0.10.3"
,
"resolved"
:
"http
://r.cnpmjs
.org/ssf/download/ssf-0.10.3.tgz"
,
"resolved"
:
"http
s://registry.npm.taobao
.org/ssf/download/ssf-0.10.3.tgz"
,
"integrity"
:
"sha1-jq4fwpyQpVLnkhII+BiS1vd6yys="
,
"requires"
:
{
"frac"
:
"~1.1.2"
...
...
@@ -23788,7 +23788,7 @@
},
"wmf"
:
{
"version"
:
"1.0.2"
,
"resolved"
:
"http
://r.cnpmjs
.org/wmf/download/wmf-1.0.2.tgz"
,
"resolved"
:
"http
s://registry.npm.taobao
.org/wmf/download/wmf-1.0.2.tgz"
,
"integrity"
:
"sha1-fRnWIQcaCMK9xrfmiKnENSmMwto="
},
"word-wrap"
:
{
...
...
@@ -23943,7 +23943,7 @@
},
"xlsx"
:
{
"version"
:
"0.15.6"
,
"resolved"
:
"http
://r.cnpmjs.org/xlsx/download/
xlsx-0.15.6.tgz"
,
"resolved"
:
"http
s://registry.npm.taobao.org/xlsx/download/xlsx-0.15.6.tgz?cache=0&sync_timestamp=1597272342311&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fxlsx%2Fdownload%2F
xlsx-0.15.6.tgz"
,
"integrity"
:
"sha1-Rh+EHW2eoag3XizSRr8jrs4IodU="
,
"requires"
:
{
"adler-32"
:
"~1.2.0"
,
...
...
@@ -23958,7 +23958,7 @@
"dependencies"
:
{
"commander"
:
{
"version"
:
"2.17.1"
,
"resolved"
:
"http
://r.cnpmjs.org/commander/download/
commander-2.17.1.tgz"
,
"resolved"
:
"http
s://registry.npm.taobao.org/commander/download/commander-2.17.1.tgz?cache=0&sync_timestamp=1595168224685&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2F
commander-2.17.1.tgz"
,
"integrity"
:
"sha1-vXerfebelCBc6sxy8XFtKfIKd78="
}
}
...
...
pages/aps/aps/index.vue
View file @
15a0c384
<
template
>
<div>
<DataGrid
:columns=
"columns"
ref=
"grid"
:draggable=
"true"
:data=
"list"
:high=
"false"
@
on-drag-drop=
"onDragDrop"
:page=
"false"
@
on-change=
"onSelect"
:batch=
"true"
:border=
"true"
:easy=
"true"
>
<template
slot=
"easySearch"
>
<div>
<Select
placeholder=
"选择排序优先级"
v-model=
"tempValue"
style=
"width: 150px;"
@
on-change=
"tempValueChange"
clearable
>
<Option
v-for=
"(item,index) in listTemp"
:key=
"index"
:value=
"item.id"
:label=
"item.name"
></Option>
</Select>
<a
style=
"font-weight: bold;"
@
click=
"openaddModalTemp"
>
<Icon
type=
"md-color-palette"
size=
"14"
/>
自定义排序模板
</a>
<a
style=
"font-weight: bold;"
@
click=
"openDuration"
>
<Icon
type=
"md-create"
size=
"14"
/>
修改外协工期
</a>
<Select
placeholder=
"选择历史方案"
style=
"width: 150px;"
></Select>
</div>
</
template
>
<
template
slot=
"searchBack"
></
template
>
<
template
slot=
"searchForm"
>
<Search
/>
</
template
>
<
template
slot=
"buttons"
>
<DatePicker
type=
"date"
placeholder=
"设置基准日期"
style=
"width: 150px;"
v-model=
"entity.setTime"
@
on-change=
"getTime"
></DatePicker>
<a
style=
"font-weight: bold;"
@
click=
"openAddModel(1)"
>
<Icon
type=
"ios-options"
size=
"14"
/>
工序参数调整
</a>
<Button
type=
"primary"
@
click=
"goResults"
style=
"background:#515A6E;border:solid 1px #515A6E"
>
历史方案
</Button>
<Button
type=
"primary"
@
click=
"openApsModal"
>
APS排产
</Button>
</
template
>
<
template
slot=
"batch"
>
<Button
type=
"primary"
class=
"mr10 ml10"
@
click=
"removeOk"
>
移出排产
</Button>
</
template
>
<div>
<DataGrid
:columns=
"columns"
ref=
"grid"
:draggable=
"true"
:data=
"list"
:high=
"false"
@
on-drag-drop=
"onDragDrop"
:page=
"false"
@
on-selection-change=
"onSelect"
:batch=
"true"
:border=
"true"
:easy=
"true"
>
<template
slot=
"easySearch"
>
<div>
<Select
placeholder=
"选择排序优先级"
v-model=
"tempValue"
style=
"width: 150px;"
@
on-change=
"tempValueChange"
clearable
>
<Option
v-for=
"(item,index) in listTemp"
:key=
"index"
:value=
"item.id"
:label=
"item.name"
></Option>
</Select>
<a
style=
"font-weight: bold;"
@
click=
"openaddModalTemp"
>
<Icon
type=
"md-color-palette"
size=
"14"
/>
自定义排序模板
</a>
<a
style=
"font-weight: bold;"
@
click=
"openDuration"
>
<Icon
type=
"md-create"
size=
"14"
/>
修改外协工期
</a>
<Select
placeholder=
"选择历史方案"
style=
"width: 150px;"
></Select>
</div>
</
template
>
<
template
slot=
"searchBack"
></
template
>
<
template
slot=
"searchForm"
>
<Search
/>
</
template
>
<
template
slot=
"buttons"
>
<DatePicker
type=
"date"
placeholder=
"设置基准日期"
style=
"width: 150px;"
v-model=
"entity.setTime"
@
on-change=
"getTime"
></DatePicker>
<a
style=
"font-weight: bold;"
@
click=
"openAddModel(1)"
>
<Icon
type=
"ios-options"
size=
"14"
/>
工序参数调整
</a>
<Button
type=
"primary"
@
click=
"goResults"
style=
"background:#515A6E;border:solid 1px #515A6E"
>
历史方案
</Button>
<Button
type=
"primary"
@
click=
"openApsModal"
>
APS排产
</Button>
</
template
>
<
template
slot=
"batch"
>
<Button
type=
"primary"
class=
"mr10 ml10"
@
click=
"removeOk"
>
移出排产
</Button>
</
template
>
</DataGrid>
<Modal
v-model=
"addModalTemp"
title=
"自定义排序模板"
footer-hide
width=
"1000"
class=
"tempModal"
>
<Temp
:data=
"listTemp"
ref=
"tempRef"
></Temp>
<Temp
:data=
"listTemp"
ref=
"tempRef"
></Temp>
</Modal>
<Modal
v-model=
"modalDuration"
title=
"外协任务"
footer-hide
width=
"1000"
>
<Duration
ref=
"durationRef"
></Duration>
<Duration
ref=
"durationRef"
></Duration>
</Modal>
<Modal
v-model=
"addModal"
title=
"工序参数设置"
footer-hide
width=
"1000"
>
<Add
@
on-close=
"cancel"
@
on-parameter-ok=
"addOk"
:opTaskPk=
"setParams.opTaskPk"
:partTaskPk=
"setParams.partTaskPk"
:taskSeq=
"setParams.taskSeq"
:count=
"setParams.count"
/>
<Add
@
on-close=
"cancel"
@
on-parameter-ok=
"addOk"
:opTaskPk=
"setParams.opTaskPk"
:partTaskPk=
"setParams.partTaskPk"
:taskSeq=
"setParams.taskSeq"
:count=
"setParams.count"
/>
</Modal>
<Modal
v-model=
"apsModal"
title=
"确定APS排产"
@
on-ok=
"apsOk"
@
on-cancel=
"cancel"
>
<p>
确定进行APS排产?
</p>
<p>
确定进行APS排产?
</p>
</Modal>
<!-- <Modal v-model="resultModal" title="数据检查" width="1500" @on-ok="checkOk" @on-cancel="cancel">
<CheckResult :data="result"></CheckResult>
</Modal> -->
<Modal
v-model=
"resultModal"
title=
"数据检查"
width=
"1500"
@
on-ok=
"cancel"
@
on-cancel=
"cancel"
>
<CheckResult
:data=
"result"
></CheckResult>
<CheckResult
:data=
"result"
></CheckResult>
</Modal>
<Modal
v-model=
"apsCheckModal"
title=
"确定APS排产"
@
on-ok=
"apsCheckOk"
@
on-cancel=
"cancel"
>
<p>
已有排产方案,是否移出排产池?
</p>
<p>
已有排产方案,是否移出排产池?
</p>
</Modal>
<Modal
v-model=
"circleModal"
title
footer-hide
:mask-closable=
"false"
>
<div
slot=
"close"
></div>
<Row>
<Col
class=
"demo-spin-col"
span=
"24"
>
<Spin
fix
>
<Icon
type=
"ios-loading"
size=
"36"
class=
"demo-spin-icon-load"
></Icon>
<div>
APS排产进行中......
</div>
</Spin>
</Col>
</Row>
<div
slot=
"close"
></div>
<Row>
<Col
class=
"demo-spin-col"
span=
"24"
>
<Spin
fix
>
<Icon
type=
"ios-loading"
size=
"36"
class=
"demo-spin-icon-load"
></Icon>
<div>
APS排产进行中......
</div>
</Spin>
</Col>
</Row>
</Modal>
<Modal
v-model=
"insertlModal1"
:title=
"insertTItle1"
@
on-ok=
"insertOk1"
@
on-cancel=
"cancel"
>
<p>
确定进行 {{ insertTItle1 }} 操作?
</p>
<p>
确定进行 {{ insertTItle1 }} 操作?
</p>
</Modal>
</div>
</div>
</template>
<
script
>
var
myDate
=
new
Date
();
var
nowDate
=
myDate
.
getFullYear
()
+
"-"
+
(
myDate
.
getMonth
()
+
1
)
+
"-"
+
myDate
.
getDate
();
...
...
@@ -118,708 +79,728 @@ import Duration from "./duration";
import
Expand
from
"./components/excute"
;
import
CheckResult
from
"./components/check"
;
export
default
{
name
:
"list"
,
components
:
{
Add
,
Expand
,
Temp
,
Duration
,
CheckResult
},
data
()
{
return
{
action
:
Api
.
index
,
easySearch
:
{
keys
:
{
op
:
"notes"
,
value
:
null
}
},
result
:
{
res
:
true
,
datas
:
'{}'
},
resultModal
:
false
,
entity
:
{
setTime
:
this
.
getFormatDate
(
nowDate
)
},
addModal
:
false
,
editModal
:
false
,
detailModal
:
false
,
deletelModal
:
false
,
apsModal
:
false
,
addModalTemp
:
false
,
modalDuration
:
false
,
insertlModal1
:
false
,
apsCheckModal
:
false
,
tempParams
:
null
,
insertTItle1
:
"插单"
,
rowIndex1
:
null
,
list
:
[],
curId
:
0
,
columns
:
[
{
key
:
"move"
,
title
:
" "
,
hide
:
false
,
align
:
"center"
,
width
:
30
,
render
:
(
h
,
params
)
=>
{
return
h
(
"Icon"
,
{
attrs
:
{
type
:
"md-more"
,
size
:
18
},
class
:
"drag"
name
:
"list"
,
components
:
{
Add
,
Expand
,
Temp
,
Duration
,
CheckResult
},
data
()
{
return
{
action
:
Api
.
index
,
easySearch
:
{
keys
:
{
op
:
"notes"
,
value
:
null
}
},
result
:
{
res
:
true
,
datas
:
'{}'
},
resultModal
:
false
,
entity
:
{
setTime
:
this
.
getFormatDate
(
nowDate
)
},
addModal
:
false
,
editModal
:
false
,
detailModal
:
false
,
deletelModal
:
false
,
apsModal
:
false
,
addModalTemp
:
false
,
modalDuration
:
false
,
insertlModal1
:
false
,
apsCheckModal
:
false
,
tempParams
:
null
,
insertTItle1
:
"插单"
,
rowIndex1
:
null
,
list
:
[],
curId
:
0
,
columns
:
[{
key
:
"move"
,
title
:
" "
,
hide
:
false
,
align
:
"center"
,
width
:
30
,
render
:
(
h
,
params
)
=>
{
return
h
(
"Icon"
,
{
attrs
:
{
type
:
"md-more"
,
size
:
18
},
class
:
"drag"
});
}
},
{
type
:
"expand"
,
width
:
50
,
render
:
(
h
,
params
)
=>
{
return
h
(
Expand
,
{
props
:
{
rowId
:
params
.
row
.
part_task_pk
}
});
}
},
{
key
:
"selection"
,
type
:
"selection"
,
width
:
50
,
align
:
"center"
},
{
key
:
"id"
,
title
:
this
.
l
(
"id"
),
hide
:
true
,
align
:
"left"
,
sortable
:
true
,
width
:
50
},
{
key
:
"insert_flag"
,
title
:
this
.
l
(
"insert_flag"
),
align
:
"center"
,
width
:
70
,
high
:
true
,
render
:
(
h
,
params
)
=>
{
return
h
(
"Tooltip"
,
{
props
:
{
content
:
params
.
row
.
insert_flag
==
1
?
"取消插单"
:
"进行插单"
,
placement
:
"top"
},
class
:
"ico"
},
[
h
(
"Icon"
,
{
attrs
:
{
type
:
params
.
row
.
insert_flag
==
1
?
"ios-water"
:
"ios-water-outline"
,
size
:
20
,
color
:
params
.
row
.
insert_flag
==
1
?
"#2680EB"
:
"#aaa"
},
on
:
{
click
:
()
=>
this
.
changeFlag1
(
params
.
row
.
part_task_pk
,
params
.
index
)
}
})
]
);
}
},
{
key
:
"mesCode"
,
title
:
this
.
l
(
"mes_code"
),
align
:
"left"
,
high
:
true
,
width
:
240
},
{
key
:
"product_name"
,
title
:
this
.
l
(
"product_name"
),
align
:
"left"
,
high
:
true
},
{
key
:
"drawingnum"
,
title
:
this
.
l
(
"drawingnum"
),
align
:
"left"
,
high
:
true
},
{
key
:
"project_no"
,
title
:
this
.
l
(
"project_no"
),
align
:
"left"
,
high
:
true
},
{
key
:
"batchnum"
,
title
:
this
.
l
(
"batchnum"
),
align
:
"left"
,
high
:
true
},
{
key
:
"urgency_level"
,
title
:
this
.
l
(
"urgency_level"
),
align
:
"left"
,
high
:
true
,
code
:
"plan.order.urgencyLevel"
,
width
:
100
},
{
key
:
"priority"
,
title
:
this
.
l
(
"priority"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
render
:
(
h
,
params
)
=>
{
return
h
(
"span"
,
{},
params
.
index
+
1
);
}
},
{
key
:
"plan_qty"
,
title
:
this
.
l
(
"plan_qty"
),
align
:
"right"
,
width
:
100
,
high
:
true
},
{
key
:
"spare_qty"
,
title
:
this
.
l
(
"spare_qty"
),
align
:
"right"
,
width
:
100
,
high
:
true
,
hide
:
true
},
{
key
:
"plan_start"
,
title
:
this
.
l
(
"plan_start"
),
align
:
"center"
,
high
:
true
,
hide
:
true
,
resizable
:
true
,
width
:
150
},
{
key
:
"plan_finish"
,
title
:
this
.
l
(
"plan_finish"
),
align
:
"center"
,
high
:
true
,
hide
:
true
,
sortable
:
true
,
resizable
:
true
,
width
:
150
},
{
key
:
"notes"
,
title
:
this
.
l
(
"notes"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
},
{
key
:
"demand_start"
,
title
:
this
.
l
(
"demand_start"
),
align
:
"center"
,
resizable
:
true
,
width
:
150
,
type
:
"date"
},
{
key
:
"demand_finish"
,
title
:
this
.
l
(
"demand_finish"
),
align
:
"center"
,
high
:
true
,
resizable
:
true
,
width
:
150
,
type
:
"date"
},
{
key
:
"badjustflag"
,
title
:
this
.
l
(
"badjustflag"
),
align
:
"left"
,
high
:
true
,
hide
:
true
},
{
title
:
"操作"
,
key
:
"action"
,
width
:
140
,
align
:
"center"
,
// fixed:"right",
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
},
[
h
(
"op"
,
{
attrs
:
{
icon
:
"md-options"
,
type
:
"icon"
,
title
:
"工序参数设置"
,
oprate
:
"edit"
},
on
:
{
click
:
()
=>
this
.
openAddModel
(
2
,
params
.
row
)
}
}),
h
(
"op"
,
{
attrs
:
{
icon
:
"md-refresh"
,
type
:
"icon"
,
title
:
"恢复工序"
,
oprate
:
"edit"
,
msg
:
"确认要恢复工序吗?"
},
on
:
{
click
:
()
=>
this
.
refresh
(
params
.
row
.
part_task_pk
)
}
}),
h
(
"op"
,
{
attrs
:
{
icon
:
"ios-trash"
,
type
:
"icon"
,
title
:
"移出排产池"
,
oprate
:
"delete"
,
msg
:
"确认要移出排产吗?"
},
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
.
part_task_pk
)
}
})
]);
}
}
],
arrPartPkId
:
[],
//设置参数开始
setParams
:
{
opTaskPk
:
0
,
//工单ID
partTaskPk
:
0
,
//生产计划ID
taskSeq
:
""
,
//工序编号
count
:
0
//生产计划数量
},
//设置参数结束
circleModal
:
false
,
//进度条
listTemp
:
[],
//自定义模板排序下拉框列表
tempValue
:
null
,
tempStatu
:
0
//新建模型时传过来的id值
};
},
mounted
()
{
this
.
loadList
();
this
.
loadTemp
();
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
methods
:
{
//排产池加载数据列表
loadList
()
{
Api
.
getall
().
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
list
=
res
.
result
;
}
});
}
},
{
type
:
"expand"
,
width
:
50
,
render
:
(
h
,
params
)
=>
{
return
h
(
Expand
,
{
props
:
{
rowId
:
params
.
row
.
part_task_pk
}
loadTemp
()
{
Api
.
getdropsortlist
().
then
(
resDrop
=>
{
//加载排序模板列表
if
(
resDrop
.
success
)
{
this
.
listTemp
=
resDrop
.
result
;
}
});
}
},
{
key
:
"selection"
,
type
:
"selection"
,
width
:
50
,
align
:
"center"
},
{
key
:
"id"
,
title
:
this
.
l
(
"id"
),
hide
:
true
,
align
:
"left"
,
sortable
:
true
,
width
:
50
},
{
key
:
"insert_flag"
,
title
:
this
.
l
(
"insert_flag"
),
align
:
"center"
,
width
:
70
,
high
:
true
,
render
:
(
h
,
params
)
=>
{
return
h
(
"Tooltip"
,
{
props
:
{
content
:
params
.
row
.
insert_flag
==
1
?
"取消插单"
:
"进行插单"
,
placement
:
"top"
},
class
:
"ico"
},
[
h
(
"Icon"
,
{
attrs
:
{
type
:
params
.
row
.
insert_flag
==
1
?
"ios-water"
:
"ios-water-outline"
,
size
:
20
,
color
:
params
.
row
.
insert_flag
==
1
?
"#2680EB"
:
"#aaa"
},
on
:
{
click
:
()
=>
this
.
changeFlag1
(
params
.
row
.
part_task_pk
,
params
.
index
)
}
})
]
);
}
addOk
()
{
this
.
list
=
[];
this
.
loadList
();
this
.
addModal
=
false
;
this
.
detailModal
=
false
;
this
.
editModal
=
false
;
this
.
curId
=
0
;
},
{
key
:
"mesCode"
,
title
:
this
.
l
(
"mes_code"
),
align
:
"left"
,
high
:
true
,
width
:
240
detail
(
id
)
{
this
.
detailModal
=
true
;
this
.
curId
=
id
;
},
{
key
:
"product_name"
,
title
:
this
.
l
(
"product_name"
),
align
:
"left"
,
high
:
true
edit
(
id
)
{
this
.
editModal
=
true
;
this
.
curId
=
id
;
},
{
key
:
"drawingnum"
,
title
:
this
.
l
(
"drawingnum"
),
align
:
"left"
,
high
:
true
refresh
(
partPkId
)
{
//恢复工序
let
params
=
{
id
:
partPkId
};
Api
.
recoveryoptasksimluate
(
params
).
then
(
r
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"恢复成功"
);
this
.
list
=
[];
this
.
loadList
();
}
});
},
{
key
:
"project_no"
,
title
:
this
.
l
(
"project_no"
),
align
:
"left"
,
high
:
true
remove
(
partPkId
)
{
//移出排产池
this
.
tempParams
=
null
;
let
paramsArry
=
[];
if
(
partPkId
.
constructor
==
Array
)
{
paramsArry
=
partPkId
;
}
else
{
paramsArry
.
push
(
partPkId
);
}
let
params
=
{
partPks
:
paramsArry
};
Api
.
beforeshiftoutapspool
(
params
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
if
(
res
.
result
)
{
this
.
checkapspool
(
params
);
}
else
{
this
.
tempParams
=
null
;
this
.
tempParams
=
params
;
this
.
apsCheckModal
=
true
;
}
}
else
{
this
.
$Message
.
error
(
"校验失败"
);
}
})
.
catch
(
err
=>
{
this
.
$Message
.
error
(
"连接错误1"
);
});
},
{
key
:
"batchnum"
,
title
:
this
.
l
(
"batchnum"
),
align
:
"left"
,
high
:
true
apsCheckOk
()
{
this
.
checkapspool
(
this
.
tempParams
);
},
{
key
:
"urgency_level"
,
title
:
this
.
l
(
"urgency_level"
),
align
:
"left"
,
high
:
true
,
code
:
"plan.order.urgencyLevel"
,
width
:
100
checkapspool
(
params
)
{
Api
.
shiftoutapspool
(
params
)
.
then
(
r
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"移出排产池操作成功"
);
this
.
loadList
();
//移出排产后将aps对应的store数量去掉
this
.
$store
.
commit
(
"setCountAps"
,
this
.
$store
.
state
.
countAps
-
params
.
partPks
.
length
);
}
else
{
this
.
$Message
.
error
(
"移出排产池操作失败"
);
}
})
.
catch
(
err
=>
{
this
.
$Message
.
error
(
"连接失败2"
);
});
},
{
key
:
"priority"
,
title
:
this
.
l
(
"priority"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
render
:
(
h
,
params
)
=>
{
return
h
(
"span"
,
{},
params
.
index
+
1
);
}
onSelect
(
a
,
b
)
{
//批量选择
let
selectRows
=
a
;
this
.
arrPartPkId
=
[];
selectRows
.
forEach
(
e
=>
{
this
.
arrPartPkId
.
push
(
e
.
part_task_pk
);
});
},
{
key
:
"plan_qty"
,
title
:
this
.
l
(
"plan_qty"
),
align
:
"right"
,
width
:
100
,
high
:
true
removeOk
()
{
//批量选择移出排产池
this
.
remove
(
this
.
arrPartPkId
);
},
{
key
:
"spare_qty"
,
title
:
this
.
l
(
"spare_qty"
),
align
:
"right"
,
width
:
100
,
high
:
true
,
hide
:
true
removeCancel
()
{
this
.
deletelModal
=
false
;
},
{
key
:
"plan_start"
,
title
:
this
.
l
(
"plan_start"
),
align
:
"center"
,
high
:
true
,
hide
:
true
,
resizable
:
true
,
width
:
150
cancel
()
{
this
.
curId
=
0
;
this
.
addModal
=
false
;
this
.
detailModal
=
false
;
this
.
editModal
=
false
;
this
.
deletedlModal
=
false
;
this
.
apsModal
=
false
;
this
.
apsCheckModal
=
false
;
this
.
resultModal
=
false
;
},
{
key
:
"plan_finish"
,
title
:
this
.
l
(
"plan_finish"
),
align
:
"center"
,
high
:
true
,
hide
:
true
,
sortable
:
true
,
resizable
:
true
,
width
:
150
onDragDrop
(
a
,
b
)
{
//拖拽排序
//this.list.splice(b, 1, ...this.list.splice(a, 1, this.list[b]));
let
tempArray
=
this
.
list
[
a
];
this
.
list
.
splice
(
a
,
1
);
this
.
list
.
splice
(
b
,
0
,
tempArray
);
},
{
key
:
"notes"
,
title
:
this
.
l
(
"notes"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
openParms
(
id
)
{
this
.
addModal
=
true
;
},
{
key
:
"demand_start"
,
title
:
this
.
l
(
"demand_start"
),
align
:
"center"
,
resizable
:
true
,
width
:
150
,
type
:
"date"
getUserDepart
()
{
// alert("5656565");
// Api.getUserDepart().then(res=>{
// console.log("11111",res)
// return res
// })
},
{
key
:
"demand_finish"
,
title
:
this
.
l
(
"demand_finish"
),
align
:
"center"
,
high
:
true
,
resizable
:
true
,
width
:
150
,
type
:
"date"
l
(
key
)
{
let
vkey
=
"mes_part_task_plan_simulate"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
;
},
{
key
:
"badjustflag"
,
title
:
this
.
l
(
"badjustflag"
),
align
:
"left"
,
high
:
true
,
hide
:
true
getTime
(
value
)
{
this
.
entity
.
getTime
=
value
;
},
{
title
:
"操作"
,
key
:
"action"
,
width
:
140
,
align
:
"center"
,
// fixed:"right",
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
},
[
h
(
"op"
,
{
attrs
:
{
icon
:
"md-options"
,
type
:
"icon"
,
title
:
"工序参数设置"
,
oprate
:
"edit"
},
on
:
{
click
:
()
=>
this
.
openAddModel
(
2
,
params
.
row
)
}
}),
h
(
"op"
,
{
attrs
:
{
icon
:
"md-refresh"
,
type
:
"icon"
,
title
:
"恢复工序"
,
oprate
:
"edit"
,
msg
:
"确认要恢复工序吗?"
},
on
:
{
click
:
()
=>
this
.
refresh
(
params
.
row
.
part_task_pk
)
}
}),
h
(
"op"
,
{
attrs
:
{
icon
:
"ios-trash"
,
type
:
"icon"
,
title
:
"移出排产池"
,
oprate
:
"delete"
,
msg
:
"确认要移出排产吗?"
},
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
.
part_task_pk
)
}
})
]);
}
}
],
arrPartPkId
:
[],
//设置参数开始
setParams
:
{
opTaskPk
:
0
,
//工单ID
partTaskPk
:
0
,
//生产计划ID
taskSeq
:
""
,
//工序编号
count
:
0
//生产计划数量
},
//设置参数结束
circleModal
:
false
,
//进度条
listTemp
:
[],
//自定义模板排序下拉框列表
tempValue
:
null
,
tempStatu
:
0
//新建模型时传过来的id值
};
},
mounted
()
{
this
.
loadList
();
this
.
loadTemp
();
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
methods
:
{
//排产池加载数据列表
loadList
()
{
Api
.
getall
().
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
list
=
res
.
result
;
}
});
},
loadTemp
()
{
Api
.
getdropsortlist
().
then
(
resDrop
=>
{
//加载排序模板列表
if
(
resDrop
.
success
)
{
this
.
listTemp
=
resDrop
.
result
;
}
});
},
addOk
()
{
this
.
list
=
[];
this
.
loadList
();
this
.
addModal
=
false
;
this
.
detailModal
=
false
;
this
.
editModal
=
false
;
this
.
curId
=
0
;
},
detail
(
id
)
{
this
.
detailModal
=
true
;
this
.
curId
=
id
;
},
edit
(
id
)
{
this
.
editModal
=
true
;
this
.
curId
=
id
;
},
refresh
(
partPkId
)
{
//恢复工序
let
params
=
{
id
:
partPkId
};
Api
.
recoveryoptasksimluate
(
params
).
then
(
r
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"恢复成功"
);
this
.
list
=
[];
this
.
loadList
();
}
});
},
remove
(
partPkId
)
{
//移出排产池
this
.
tempParams
=
null
;
let
paramsArry
=
[];
if
(
partPkId
.
constructor
==
Array
)
{
paramsArry
=
partPkId
;
}
else
{
paramsArry
.
push
(
partPkId
);
}
let
params
=
{
partPks
:
paramsArry
};
Api
.
beforeshiftoutapspool
(
params
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
if
(
res
.
result
)
{
this
.
checkapspool
(
params
);
openApsModal
()
{
if
(
this
.
entity
.
setTime
!=
""
)
{
this
.
apsModal
=
true
;
}
else
{
this
.
tempParams
=
null
;
this
.
tempParams
=
params
;
this
.
apsCheckModal
=
true
;
this
.
$Message
.
error
(
"请设置基准日期"
);
}
}
else
{
this
.
$Message
.
error
(
"校验失败"
);
}
})
.
catch
(
err
=>
{
this
.
$Message
.
error
(
"连接错误1"
);
});
},
apsCheckOk
()
{
this
.
checkapspool
(
this
.
tempParams
);
},
checkapspool
(
params
)
{
Api
.
shiftoutapspool
(
params
)
.
then
(
r
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"移出排产池操作成功"
);
this
.
loadList
();
//移出排产后将aps对应的store数量去掉
this
.
$store
.
commit
(
"setCountAps"
,
this
.
$store
.
state
.
countAps
-
params
.
partPks
.
length
);
}
else
{
this
.
$Message
.
error
(
"移出排产池操作失败"
);
}
})
.
catch
(
err
=>
{
this
.
$Message
.
error
(
"连接失败2"
);
});
},
onSelect
(
a
,
b
)
{
//批量选择
let
selectRows
=
a
;
this
.
arrPartPkId
=
[];
selectRows
.
forEach
(
e
=>
{
this
.
arrPartPkId
.
push
(
e
.
part_task_pk
);
});
},
removeOk
()
{
//批量选择移出排产池
this
.
remove
(
this
.
arrPartPkId
);
},
removeCancel
()
{
this
.
deletelModal
=
false
;
},
cancel
()
{
this
.
curId
=
0
;
this
.
addModal
=
false
;
this
.
detailModal
=
false
;
this
.
editModal
=
false
;
this
.
deletedlModal
=
false
;
this
.
apsModal
=
false
;
this
.
apsCheckModal
=
false
;
this
.
resultModal
=
false
;
},
onDragDrop
(
a
,
b
)
{
//拖拽排序
//this.list.splice(b, 1, ...this.list.splice(a, 1, this.list[b]));
let
tempArray
=
this
.
list
[
a
];
this
.
list
.
splice
(
a
,
1
);
this
.
list
.
splice
(
b
,
0
,
tempArray
);
},
openParms
(
id
)
{
this
.
addModal
=
true
;
},
getUserDepart
()
{
// alert("5656565");
// Api.getUserDepart().then(res=>{
// console.log("11111",res)
// return res
// })
},
l
(
key
)
{
let
vkey
=
"mes_part_task_plan_simulate"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
;
},
getTime
(
value
)
{
this
.
entity
.
getTime
=
value
;
},
openApsModal
()
{
if
(
this
.
entity
.
setTime
!=
""
)
{
this
.
apsModal
=
true
;
}
else
{
this
.
$Message
.
error
(
"请设置基准日期"
);
}
},
//查看历史方案
goResults
()
{
this
.
$router
.
push
({
path
:
"/aps/results"
// params: { customerId: id }
});
},
//确定aps排产
apsOk
()
{
this
.
circleModal
=
true
;
//APS排产前订单优先级功能
let
parmsOrderpriority
=
{
alls
:
[]
};
let
arryIds
=
[];
this
.
list
.
forEach
((
e
,
index
)
=>
{
let
objIds
=
{};
objIds
.
orderId
=
e
.
part_task_pk
;
objIds
.
priority
=
index
+
1
;
arryIds
.
push
(
objIds
);
});
parmsOrderpriority
.
alls
=
arryIds
;
Api
.
orderpriority
(
parmsOrderpriority
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
if
(
res
.
result
)
{
//this.$Message.success("排序成功");
//apsp排产前检查
Api
.
apsdatachecked
()
.
then
(
res1
=>
{
if
(
res1
.
success
)
{
// this.result=res1.result;
// this.resultModal=true;
this
.
checkOk
();
}
else
{
// this.circleModal = false;
// this.$Message.error("操作失败:数据校验");
this
.
result
=
res1
.
result
;
this
.
resultModal
=
true
;
}
},
//查看历史方案
goResults
()
{
this
.
$router
.
push
({
path
:
"/aps/results"
// params: { customerId: id }
});
},
//确定aps排产
apsOk
()
{
this
.
circleModal
=
true
;
//APS排产前订单优先级功能
let
parmsOrderpriority
=
{
alls
:
[]
};
let
arryIds
=
[];
this
.
list
.
forEach
((
e
,
index
)
=>
{
let
objIds
=
{};
objIds
.
orderId
=
e
.
part_task_pk
;
objIds
.
priority
=
index
+
1
;
arryIds
.
push
(
objIds
);
});
parmsOrderpriority
.
alls
=
arryIds
;
Api
.
orderpriority
(
parmsOrderpriority
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
if
(
res
.
result
)
{
//this.$Message.success("排序成功");
//apsp排产前检查
Api
.
apsdatachecked
()
.
then
(
res1
=>
{
if
(
res1
.
success
)
{
// this.result=res1.result;
// this.resultModal=true;
this
.
checkOk
();
}
else
{
// this.circleModal = false;
// this.$Message.error("操作失败:数据校验");
this
.
result
=
res1
.
result
;
this
.
resultModal
=
true
;
}
})
.
catch
(
function
(
err
)
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"操作失败"
);
}.
bind
(
this
)
);
}
else
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"排序失败,请重新APS排产操作"
);
}
}
else
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"操作失败:排序"
);
}
})
.
catch
(
function
(
err
)
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"操作失败"
);
}.
bind
(
this
)
function
(
err
)
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"操作失败"
);
}.
bind
(
this
)
);
},
checkOk
()
{
//排产计算
let
paramsTime
=
{
setTime
:
this
.
entity
.
setTime
};
Api
.
apsprepareandcalc
(
paramsTime
)
.
then
(
res2
=>
{
if
(
res2
.
success
)
{
if
(
res2
.
result
.
res
)
{
this
.
$Message
.
success
(
"排产计算成功"
);
this
.
circleModal
=
false
;
this
.
$router
.
push
({
path
:
"/aps/results"
// params: { customerId: id }
});
}
else
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
res2
.
result
.
msg
);
}
}
else
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"操作失败:排产计算"
);
}
})
.
catch
(
function
(
err
)
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"操作失败"
);
}.
bind
(
this
)
);
},
//打开设置参数
openAddModel
(
type
,
row
)
{
if
(
type
==
2
)
{
this
.
setParams
=
{
opTaskPk
:
0
,
partTaskPk
:
row
.
part_task_pk
,
taskSeq
:
""
,
count
:
row
.
plan_qty
};
}
else
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"排序失败,请重新APS排产操作"
);
}
}
else
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"操作失败:排序"
);
}
})
.
catch
(
function
(
err
)
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"操作失败"
);
}.
bind
(
this
)
);
},
checkOk
()
{
//排产计算
let
paramsTime
=
{
setTime
:
this
.
entity
.
setTime
};
Api
.
apsprepareandcalc
(
paramsTime
)
.
then
(
res2
=>
{
if
(
res2
.
success
)
{
if
(
res2
.
result
.
res
)
{
this
.
$Message
.
success
(
"排产计算成功"
);
this
.
circleModal
=
false
;
this
.
$router
.
push
({
path
:
"/aps/results"
// params: { customerId: id }
});
}
else
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
res2
.
result
.
msg
);
this
.
setParams
=
{
opTaskPk
:
0
,
partTaskPk
:
0
,
taskSeq
:
""
,
count
:
0
};
}
}
else
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"操作失败:排产计算"
);
}
})
.
catch
(
function
(
err
)
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"操作失败"
);
}.
bind
(
this
)
);
},
//打开设置参数
openAddModel
(
type
,
row
)
{
if
(
type
==
2
)
{
this
.
setParams
=
{
opTaskPk
:
0
,
partTaskPk
:
row
.
part_task_pk
,
taskSeq
:
""
,
count
:
row
.
plan_qty
};
}
else
{
this
.
setParams
=
{
opTaskPk
:
0
,
partTaskPk
:
0
,
taskSeq
:
""
,
count
:
0
};
}
this
.
addModal
=
true
;
},
//自定义排序模板相关start------
//打开自定义排序模板窗口
openaddModalTemp
()
{
this
.
addModalTemp
=
true
;
},
//选择排序模板
tempValueChange
(
val
)
{
let
params
=
{
id
:
val
};
Api
.
usesorttemplate
(
params
)
.
then
(
r
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"设置成功"
);
this
.
list
=
[];
this
.
loadList
();
}
else
{
this
.
$Message
.
error
(
"设置失败"
);
}
})
.
catch
(
e
=>
{
this
.
$Message
.
error
(
"访问失败"
);
});
},
//自定义排序模板相关end------
//外协工期修改start------
//打开外协工期任务modal
openDuration
()
{
this
.
modalDuration
=
true
;
},
//外协工期修改end
//插单start
//插单事件start----
changeFlag1
(
id
,
index
)
{
this
.
rowIndex1
=
index
;
if
(
this
.
list
[
this
.
rowIndex1
].
insert_flag
==
1
)
{
this
.
insertTItle1
=
"取消插单"
;
}
else
{
this
.
insertTItle1
=
"插单"
;
}
this
.
insertlModal1
=
true
;
},
insertOk1
()
{
if
(
this
.
list
[
this
.
rowIndex1
].
insert_flag
==
1
)
{
//根据插单数据状态进行插单或取消插单操作
let
params1
=
{
partTaskPks
:
[
this
.
list
[
this
.
rowIndex1
].
part_task_pk
],
opTaskPks
:
[]
};
Api
.
cancelinsertorder
(
params1
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
$Message
.
success
(
"取消插单成功!"
);
this
.
list
[
this
.
rowIndex1
].
insert_flag
=
0
;
this
.
addModal
=
true
;
},
//自定义排序模板相关start------
//打开自定义排序模板窗口
openaddModalTemp
()
{
this
.
addModalTemp
=
true
;
},
//选择排序模板
tempValueChange
(
val
)
{
let
params
=
{
id
:
val
};
Api
.
usesorttemplate
(
params
)
.
then
(
r
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"设置成功"
);
this
.
list
=
[];
this
.
loadList
();
}
else
{
this
.
$Message
.
error
(
"设置失败"
);
}
})
.
catch
(
e
=>
{
this
.
$Message
.
error
(
"访问失败"
);
});
},
//自定义排序模板相关end------
//外协工期修改start------
//打开外协工期任务modal
openDuration
()
{
this
.
modalDuration
=
true
;
},
//外协工期修改end
//插单start
//插单事件start----
changeFlag1
(
id
,
index
)
{
this
.
rowIndex1
=
index
;
if
(
this
.
list
[
this
.
rowIndex1
].
insert_flag
==
1
)
{
this
.
insertTItle1
=
"取消插单"
;
}
else
{
this
.
$Message
.
error
(
"取消插单失败!"
)
;
this
.
insertTItle1
=
"插单"
;
}
})
.
catch
(
err
=>
{
this
.
$Message
.
error
(
"数据异常!"
);
});
}
else
{
let
params
=
{
partTaskPks
:
[
this
.
list
[
this
.
rowIndex1
].
part_task_pk
],
opTaskPks
:
[]
};
Api
.
saveinsertorder
(
params
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
$Message
.
success
(
"插单成功!"
);
this
.
list
[
this
.
rowIndex1
].
insert_flag
=
1
;
this
.
insertlModal1
=
true
;
},
insertOk1
()
{
if
(
this
.
list
[
this
.
rowIndex1
].
insert_flag
==
1
)
{
//根据插单数据状态进行插单或取消插单操作
let
params1
=
{
partTaskPks
:
[
this
.
list
[
this
.
rowIndex1
].
part_task_pk
],
opTaskPks
:
[]
};
Api
.
cancelinsertorder
(
params1
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
$Message
.
success
(
"取消插单成功!"
);
this
.
list
[
this
.
rowIndex1
].
insert_flag
=
0
;
}
else
{
this
.
$Message
.
error
(
"取消插单失败!"
);
}
})
.
catch
(
err
=>
{
this
.
$Message
.
error
(
"数据异常!"
);
});
}
else
{
this
.
$Message
.
error
(
"插单失败!"
);
let
params
=
{
partTaskPks
:
[
this
.
list
[
this
.
rowIndex1
].
part_task_pk
],
opTaskPks
:
[]
};
Api
.
saveinsertorder
(
params
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
$Message
.
success
(
"插单成功!"
);
this
.
list
[
this
.
rowIndex1
].
insert_flag
=
1
;
}
else
{
this
.
$Message
.
error
(
"插单失败!"
);
}
})
.
catch
(
err
=>
{
this
.
$Message
.
error
(
"数据异常!"
);
});
}
})
.
catch
(
err
=>
{
this
.
$Message
.
error
(
"数据异常!"
);
});
}
this
.
insertlModal1
=
false
;
},
//插单end
getFormatDate
(
dates
)
{
const
d
=
new
Date
(
dates
);
const
resDate
=
d
.
getFullYear
()
+
"-"
+
this
.
p
(
d
.
getMonth
()
+
1
)
+
"-"
+
this
.
p
(
d
.
getDate
())
+
" 00:00:01"
;
return
resDate
;
},
p
(
s
)
{
return
s
<
10
?
"0"
+
s
:
s
;
this
.
insertlModal1
=
false
;
},
//插单end
getFormatDate
(
dates
)
{
const
d
=
new
Date
(
dates
);
const
resDate
=
d
.
getFullYear
()
+
"-"
+
this
.
p
(
d
.
getMonth
()
+
1
)
+
"-"
+
this
.
p
(
d
.
getDate
())
+
" 00:00:01"
;
return
resDate
;
},
p
(
s
)
{
return
s
<
10
?
"0"
+
s
:
s
;
}
}
}
};
</
script
>
<
style
lang=
"less"
>
.drag {
cursor: move;
cursor: move;
}
.demo-spin-icon-load {
animation: ani-demo-spin 1s linear infinite;
animation: ani-demo-spin 1s linear infinite;
}
@keyframes ani-demo-spin {
from {
transform: rotate(0deg);
}
50% {
transform: rotate(180deg);
}
to {
transform: rotate(360deg);
}
from {
transform: rotate(0deg);
}
50% {
transform: rotate(180deg);
}
to {
transform: rotate(360deg);
}
}
.demo-spin-col {
height: 100px;
position: relative;
border: 0px solid #eee;
height: 100px;
position: relative;
border: 0px solid #eee;
}
.vertical-center-modal {
display: flex;
align-items: center;
justify-content: center;
display: flex;
align-items: center;
justify-content: center;
.ivu-modal {
top: 0;
}
.ivu-modal {
top: 0;
}
}
.tempModal {
.ivu-modal-body {
padding: 16px;
font-size: 14px;
line-height: 1.5;
padding-top: 2px;
padding-bottom: 0px;
}
.ivu-modal-footer {
border-top: none;
padding: 12px 18px 12px 18px;
text-align: right;
}
.ivu-modal-body {
padding: 16px;
font-size: 14px;
line-height: 1.5;
padding-top: 2px;
padding-bottom: 0px;
}
.ivu-modal-footer {
border-top: none;
padding: 12px 18px 12px 18px;
text-align: right;
}
}
</
style
>
pages/aps/plan/index.vue
View file @
15a0c384
<
template
>
<div
class=
"h100"
>
<DataGrid
:columns=
"columns"
ref=
"grid"
:action=
"action"
@
on-selection-change=
"selectInfo"
:batch=
"false"
>
<template
slot=
"easySearch"
>
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
<FormItem
prop=
"keys"
>
<Input
search
enter-button
placeholder=
"请输入关键字订单编号/项目名称"
v-model=
"easySearch.keys.value"
v-width=
"300"
@
on-search=
"search"
/>
</FormItem>
</Form>
</
template
>
<
template
slot=
"searchBack"
>
<Badge
:count=
"this.$store.state.countAps"
overflow-count=
"99"
style=
"margin-right: 15px"
type=
"info"
v-if=
"showAps"
>
<a
href=
"javascript:;"
@
click=
"goAps"
>
APS排产
</a>
</Badge>
<Badge
:count=
"this.$store.state.countAi"
overflow-count=
"99"
style=
"margin-right: 15px"
type=
"info"
v-if=
"showAi"
>
<a
href=
"javascript:;"
@
click=
"goAi"
>
智能排产
</a>
</Badge>
<Badge
:count=
"this.$store.state.countAll"
overflow-count=
"99"
style=
"margin-right: 15px"
type=
"info"
v-if=
"showAll"
>
<a
@
click=
"goCemplate"
>
整机排产
</a>
</Badge>
<Badge
:count=
"this.$store.state.countRun"
overflow-count=
"99"
type=
"info"
v-if=
"showRun"
>
<a
@
click=
"goStream"
>
流水排产
</a>
</Badge>
</
template
>
<
template
slot=
"searchForm"
>
<Search
/>
</
template
>
<
template
slot=
"buttons"
></
template
>
<div
class=
"h100"
>
<DataGrid
:columns=
"columns"
ref=
"grid"
:action=
"action"
@
on-selection-change=
"selectInfo"
:batch=
"false"
>
<template
slot=
"easySearch"
>
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
<FormItem
prop=
"keys"
>
<Input
search
enter-button
placeholder=
"请输入关键字订单编号/项目名称"
v-model=
"easySearch.keys.value"
v-width=
"300"
@
on-search=
"search"
/>
</FormItem>
</Form>
</
template
>
<
template
slot=
"searchBack"
>
<Badge
:count=
"this.$store.state.countAps"
overflow-count=
"99"
style=
"margin-right: 15px"
type=
"info"
v-if=
"showAps"
>
<a
href=
"javascript:;"
@
click=
"goAps"
>
APS排产
</a>
</Badge>
<Badge
:count=
"this.$store.state.countAi"
overflow-count=
"99"
style=
"margin-right: 15px"
type=
"info"
v-if=
"showAi"
>
<a
href=
"javascript:;"
@
click=
"goAi"
>
智能排产
</a>
</Badge>
<Badge
:count=
"this.$store.state.countAll"
overflow-count=
"99"
style=
"margin-right: 15px"
type=
"info"
v-if=
"showAll"
>
<a
@
click=
"goCemplate"
>
整机排产
</a>
</Badge>
<Badge
:count=
"this.$store.state.countRun"
overflow-count=
"99"
type=
"info"
v-if=
"showRun"
>
<a
@
click=
"goStream"
>
流水排产
</a>
</Badge>
</
template
>
<
template
slot=
"searchForm"
>
<Search
/>
</
template
>
<
template
slot=
"buttons"
></
template
>
</DataGrid>
<FooterToolbar
extra
v-if=
"footerBar"
class=
"ftball"
>
<Row>
<Checkbox
@
on-change=
"handleSelectAll(single)"
v-model=
"single"
>
全选
</Checkbox
>
<span
class=
"footerSpan"
>
已选 {{ selectCount }} 项
</span>
<Button
type=
"primary"
@
click=
"modalDispatch"
>
工艺派发
</Button
>
<Button
type=
"primary"
@
click=
"modalSchedule"
>
移入排产
</Button
>
<Button
@
click=
"canselFooter"
>
取消
</Button>
</Row>
<Row>
<Checkbox
@
on-change=
"handleSelectAll(single)"
v-model=
"single"
>
全选
</Checkbox>
<span
class=
"footerSpan"
>
已选 {{ selectCount }} 项
</span>
<Button
type=
"primary"
@
click=
"modalDispatch"
>
工艺派发
</Button>
<Button
type=
"primary"
@
click=
"modalSchedule"
>
移入排产
</Button>
<Button
@
click=
"canselFooter"
>
取消
</Button>
</Row>
</FooterToolbar>
<Modal
v-model=
"addModal"
title=
"新增"
footer-hide
>
<Add
@
on-close=
"cancel"
@
on-ok=
"addOk"
/>
<Add
@
on-close=
"cancel"
@
on-ok=
"addOk"
/>
</Modal>
<Modal
v-model=
"editModal"
title=
"编辑"
footer-hide
>
<Edit
:eid=
"curId"
@
on-close=
"cancel"
@
on-ok=
"addOk"
/>
<Edit
:eid=
"curId"
@
on-close=
"cancel"
@
on-ok=
"addOk"
/>
</Modal>
<Modal
v-model=
"detailModal"
title=
"详情"
>
<Detail
:eid=
"curId"
/>
<Detail
:eid=
"curId"
/>
</Modal>
<Modal
v-model=
"deletelModal"
title=
"删除"
@
on-ok=
"removeOk"
@
on-cancel=
"cancel"
>
<p>
确定删除?
</p>
<Modal
v-model=
"deletelModal"
title=
"删除"
@
on-ok=
"removeOk"
@
on-cancel=
"cancel"
>
<p>
确定删除?
</p>
</Modal>
<Modal
v-model=
"dispatchModal"
title=
"工艺派发"
footer-hide
width=
"800"
>
<Dispatch
@
on-close=
"cancel"
:ids=
"listBatchIds"
@
on-ok=
"addOk"
/>
<Dispatch
@
on-close=
"cancel"
:ids=
"listBatchIds"
@
on-ok=
"addOk"
/>
</Modal>
<Modal
v-model=
"scheduleModal"
title=
"移入排产"
width=
"800"
>
<p>
</p>
<h4>
请选择排产模型:
</h4>
<!--
<p>
</p>
<h4>
请选择排产模型:
</h4>
<!--
<Dictionary
code="aps.plan.scheduleType"
v-model="scheduleType"
...
...
@@ -110,59 +65,39 @@
@on-change="onchangeScheduleType"
></Dictionary>
-->
<RadioGroup
v-model=
"scheduleType"
class=
"radioList"
@
on-change=
"onchangeScheduleType"
>
<Radio
:label=
"1"
border
:disabled=
"this.$store.state.countAi > 0"
>
<span>
Aps排产
</span>
</Radio>
<Radio
:label=
"4"
border
:disabled=
"this.$store.state.countAps > 0"
>
<span>
智能排产
</span>
</Radio>
<Radio
:label=
"2"
border
>
<span>
整机排产
</span>
</Radio>
<Radio
:label=
"3"
border
>
<span>
流水排产
</span>
</Radio>
</RadioGroup>
<p
class=
"pl30 pt10"
v-show=
"scheduleType != null"
>
确定将订单
<span
class=
"fwBold"
>
{{ resultsOrderList }}
</span>
移入
<span
class=
"red fwBold"
>
{{ scheduleTypeName }}
</span
>
?
</p>
<p>
</p>
<p>
</p>
<div
slot=
"footer"
>
<Button
@
click=
"cancel"
>
取消
</Button>
<Button
type=
"primary"
@
click=
"scheduleOk"
>
确定
</Button>
</div>
<RadioGroup
v-model=
"scheduleType"
class=
"radioList"
@
on-change=
"onchangeScheduleType"
>
<Radio
:label=
"1"
border
:disabled=
"this.$store.state.countAi > 0"
>
<span>
Aps排产
</span>
</Radio>
<Radio
:label=
"4"
border
:disabled=
"this.$store.state.countAps > 0"
>
<span>
智能排产
</span>
</Radio>
<Radio
:label=
"2"
border
>
<span>
整机排产
</span>
</Radio>
<Radio
:label=
"3"
border
>
<span>
流水排产
</span>
</Radio>
</RadioGroup>
<p
class=
"pl30 pt10"
v-show=
"scheduleType != null"
>
确定将订单
<span
class=
"fwBold"
>
{{ resultsOrderList }}
</span>
移入
<span
class=
"red fwBold"
>
{{ scheduleTypeName }}
</span>
?
</p>
<p>
</p>
<p>
</p>
<div
slot=
"footer"
>
<Button
@
click=
"cancel"
>
取消
</Button>
<Button
type=
"primary"
@
click=
"scheduleOk"
>
确定
</Button>
</div>
</Modal>
<Modal
v-model=
"orderSupportModal"
title=
"配套下发"
footer-hide
width=
"1300"
>
<orderSupport
ref=
"orderSupport"
></orderSupport>
<Modal
v-model=
"orderSupportModal"
title=
"配套下发"
footer-hide
width=
"1300"
>
<orderSupport
ref=
"orderSupport"
></orderSupport>
</Modal>
<Modal
v-model=
"modalAccessory"
:title=
"title"
fullscreen
footer-hide
>
<component
:is=
"details"
:eid=
"orderId"
:mesCode=
"mesCode"
:productName=
"productName"
:drawnNumber=
"drawnNumber"
:productingPreparationPeople=
"productingPreparationPeople"
:count=
"count"
@
on-close=
"cancel"
@
on-ok=
"addOk"
/>
<component
:is=
"details"
:eid=
"orderId"
:mesCode=
"mesCode"
:productName=
"productName"
:drawnNumber=
"drawnNumber"
:productingPreparationPeople=
"productingPreparationPeople"
:count=
"count"
@
on-close=
"cancel"
@
on-ok=
"addOk"
/>
</Modal>
</div>
</div>
</template>
<
script
>
...
...
@@ -174,750 +109,747 @@ import Search from "./search";
import
Dispatch
from
"./dispatch"
;
import
orderSupport
from
"../../produce/orderSupport"
;
export
default
{
name
:
"list"
,
components
:
{
Add
,
Edit
,
Detail
,
Search
,
Dispatch
,
orderSupport
,
},
data
()
{
return
{
action
:
Api
.
index
,
productingPreparationPeople
:
0
,
easySearch
:
{
keys
:
{
op
:
"mesCode,projectNumber"
,
value
:
null
,
name
:
"list"
,
components
:
{
Add
,
Edit
,
Detail
,
Search
,
Dispatch
,
orderSupport
,
},
data
()
{
return
{
action
:
Api
.
index
,
productingPreparationPeople
:
0
,
easySearch
:
{
keys
:
{
op
:
"mesCode,projectNumber"
,
value
:
null
,
},
},
addModal
:
false
,
editModal
:
false
,
detailModal
:
false
,
deletelModal
:
false
,
dispatchModal
:
false
,
scheduleModal
:
false
,
orderSupportModal
:
false
,
curId
:
0
,
statuList
:
this
.
$store
.
getters
.
dictionaryByKey
(
"aps.plan.supportingStatus"
)
||
[],
name
:
""
,
items
:
null
,
title
:
""
,
details
:
null
,
uId
:
""
,
hid
:
0
,
orderId
:
0
,
mesCode
:
""
,
productName
:
""
,
drawnNumber
:
""
,
count
:
0
,
modalAccessory
:
false
,
columns
:
[{
key
:
"selection"
,
title
:
"多选"
,
type
:
"selection"
,
width
:
50
,
align
:
"center"
,
},
{
title
:
this
.
l
(
"mesCode"
),
key
:
"mesCode"
,
width
:
240
,
align
:
"left"
,
},
{
key
:
"productName"
,
title
:
this
.
l
(
"productName"
),
align
:
"left"
,
easy
:
true
,
width
:
160
,
high
:
true
,
tooltip
:
true
,
},
{
key
:
"status"
,
title
:
this
.
l
(
"status"
),
align
:
"center"
,
high
:
true
,
code
:
"plan.order.status"
,
},
{
key
:
"mainRoutingSetStatus"
,
title
:
this
.
l
(
"mainRoutingSetStatus"
),
align
:
"center"
,
high
:
true
,
code
:
"aps.plan.mainRoutingStatus"
,
},
{
key
:
"isSupportingFinish"
,
title
:
this
.
l
(
"isSupportingFinish"
),
align
:
"center"
,
render
:
(
h
,
params
)
=>
{
return
h
(
"op"
,
{
attrs
:
{
oprate
:
"detail"
,
},
style
:
{
color
:
this
.
setName
(
params
.
row
.
isSupportingFinish
).
color
,
},
on
:
{
click
:
()
=>
this
.
openAccessory
(
params
.
row
),
},
},
this
.
setName
(
params
.
row
.
isSupportingFinish
).
name
);
},
},
{
key
:
"projectNumber"
,
title
:
this
.
l
(
"projectNumber"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
},
{
key
:
"batchNumber"
,
title
:
this
.
l
(
"batchNumber"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
},
{
key
:
"urgencyLevel"
,
title
:
this
.
l
(
"urgencyLevel"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
code
:
"plan.order.urgencyLevel"
,
},
{
key
:
"taskType"
,
title
:
this
.
l
(
"taskType"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
code
:
"plan.order.taskType"
,
},
{
key
:
"drawnNumber"
,
title
:
this
.
l
(
"drawnNumber"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
},
{
key
:
"quantity"
,
title
:
this
.
l
(
"quantity"
),
align
:
"right"
,
high
:
true
,
},
{
key
:
"productCode"
,
title
:
this
.
l
(
"productCode"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
},
{
key
:
"isPreschedule"
,
title
:
this
.
l
(
"isPreschedule"
),
align
:
"center"
,
width
:
100
,
high
:
true
,
code
:
"aps.plan.ispreschedule"
,
},
{
key
:
"taskRequire"
,
title
:
this
.
l
(
"taskRequire"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
},
{
key
:
"productingPreparationPeople"
,
title
:
this
.
l
(
"productingPreparationPeople"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
type
:
"workShopName"
,
},
{
key
:
"productingPreparationFinishDate"
,
title
:
this
.
l
(
"productingPreparationFinishDate"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
},
{
key
:
"quotationPeople"
,
title
:
this
.
l
(
"quotationPeople"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
type
:
"user"
,
},
{
key
:
"quotationFinishDate"
,
title
:
this
.
l
(
"quotationFinishDate"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
},
{
key
:
"demandStartDate"
,
title
:
this
.
l
(
"demandStartDate"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
type
:
"date"
,
},
{
key
:
"demandFinishDate"
,
title
:
this
.
l
(
"demandFinishDate"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
type
:
"date"
,
},
// {
// key: "spareQty",
// title: this.l("spareQty"),
// align: "left",
// high: true,
// hide: true,
// },
// {
// key: "demandStart",
// title: this.l("demandStart"),
// align: "left",
// high: true,
// hide: true,
// },
// {
// key: "demandFinish",
// title: this.l("demandFinish"),
// align: "left",
// high: true,
// hide: true,
// },
// {
// key: "partNamePro",
// title: this.l("partNamePro"),
// align: "left",
// easy: true,
// high: true,
// hide: true,
// },
{
title
:
"操作"
,
key
:
"action"
,
width
:
140
,
align
:
"center"
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
,
},
[
h
(
"op"
,
{
attrs
:
{
oprate
:
"detail"
,
title
:
params
.
row
.
mainRoutingSetStatus
==
0
?
"工艺派发"
:
"移入排产"
,
},
style
:
{
color
:
params
.
row
.
mainRoutingSetStatus
==
0
?
"red"
:
""
,
},
on
:
{
click
:
()
=>
params
.
row
.
mainRoutingSetStatus
==
0
||
params
.
row
.
mainRoutingSetStatus
==
1
?
this
.
goMethod
(
params
.
row
)
:
null
,
},
},
params
.
row
.
mainRoutingSetStatus
==
0
&&
params
.
row
.
isPreschedule
==
0
?
"工艺派发"
:
params
.
row
.
mainRoutingSetStatus
==
1
&&
params
.
row
.
isPreschedule
==
0
?
"移入排产"
:
""
),
// h(
// "op",
// {
// attrs: {
// oprate: "detail",
// title:
// params.row.isSupportingFinish == 2 ||
// params.row.isSupportingFinish == 3
// ? "配套派发"
// : "",
// },
// style: {
// color: params.row.mainRoutingSetStatus == 0 ? "red" : "",
// },
// on: {
// click: () =>
// params.row.isSupportingFinish == 2 ||
// params.row.isSupportingFinish == 3
// ? this.supportDis(params.row)
// : null,
// },
// },
// params.row.isSupportingFinish == 2 ||
// params.row.isSupportingFinish == 3
// ? "配套派发"
// : ""
// ),
]
);
},
},
],
selectCount
:
0
,
selectList
:
[],
footerBar
:
false
,
results
:
[],
listBatchIds
:
[],
listBatchIds1
:
[],
//临时存储选择的ids
single
:
false
,
resultsStatusArr
:
[],
resultsStatus
:
0
,
dispatchStatus
:
0
,
//派发标识
scheduleStatus
:
0
,
//排产标识
resultsOrderList
:
""
,
scheduleType
:
null
,
scheduleTypeName
:
""
,
showAps
:
false
,
showAi
:
false
,
showAll
:
false
,
showRun
:
false
,
isPrescheduleStatu
:
0
,
};
},
mounted
()
{
this
.
loadInitCount
();
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
methods
:
{
handleSelectAll
(
status
)
{
//选择列表数据
this
.
$refs
.
grid
.
selectAll
(
status
);
},
},
addModal
:
false
,
editModal
:
false
,
detailModal
:
false
,
deletelModal
:
false
,
dispatchModal
:
false
,
scheduleModal
:
false
,
orderSupportModal
:
false
,
curId
:
0
,
statuList
:
this
.
$store
.
getters
.
dictionaryByKey
(
"aps.plan.supportingStatus"
)
||
[],
name
:
""
,
items
:
null
,
title
:
""
,
details
:
null
,
uId
:
""
,
hid
:
0
,
orderId
:
0
,
mesCode
:
""
,
productName
:
""
,
drawnNumber
:
""
,
count
:
0
,
modalAccessory
:
false
,
columns
:
[
{
key
:
"selection"
,
title
:
"多选"
,
type
:
"selection"
,
width
:
50
,
align
:
"center"
,
selectInfo
(
value
)
{
if
(
value
.
length
>
0
)
{
this
.
footerBar
=
true
;
}
else
{
this
.
footerBar
=
false
;
}
this
.
selectList
=
[];
this
.
selectList
=
value
;
this
.
selectCount
=
this
.
selectList
.
length
;
let
statueArry
=
[];
let
tempmesCodeList
=
[];
this
.
resultsStatusArr
=
[];
this
.
isPrescheduleStatu
=
0
;
value
.
forEach
((
data
)
=>
{
var
that
=
this
;
statueArry
.
push
(
data
.
id
);
this
.
resultsStatusArr
.
push
(
data
.
mainRoutingSetStatus
);
if
(
data
.
isPreschedule
==
2
)
{
this
.
isPrescheduleStatu
=
2
;
}
tempmesCodeList
.
push
(
data
.
mesCode
);
});
let
mainRS
=
this
.
uniq
(
this
.
resultsStatusArr
);
//数组去重
if
(
mainRS
.
length
==
1
)
{
this
.
results
=
[];
this
.
results
=
statueArry
;
this
.
getListId
(
statueArry
);
this
.
resultsOrderList
=
JSON
.
stringify
(
tempmesCodeList
)
//提示mesCode
.
replace
(
"["
,
""
)
.
replace
(
"]"
,
""
)
.
replace
(
/
\"
/g
,
""
);
if
(
mainRS
[
0
]
==
0
)
{
//未派发
this
.
dispatchStatus
=
1
;
this
.
scheduleStatus
=
0
;
}
else
if
(
mainRS
[
0
]
==
1
)
{
//已派发
this
.
dispatchStatus
=
0
;
this
.
scheduleStatus
=
1
;
}
else
{
//派发中
this
.
dispatchStatus
=
0
;
this
.
scheduleStatus
=
0
;
}
}
else
{
this
.
dispatchStatus
=
0
;
this
.
scheduleStatus
=
0
;
}
},
{
title
:
this
.
l
(
"mesCode"
),
key
:
"mesCode"
,
width
:
240
,
align
:
"left"
,
//得到需要批量操作的ids
getListId
(
value
)
{
this
.
listBatchIds1
=
value
;
if
(
this
.
listBatchIds1
.
length
>
0
)
{
this
.
footerBar
=
true
;
}
else
{
this
.
footerBar
=
false
;
}
},
{
key
:
"productName"
,
title
:
this
.
l
(
"productName"
),
align
:
"left"
,
easy
:
true
,
width
:
160
,
high
:
true
,
tooltip
:
true
,
canselFooter
()
{
this
.
footerBar
=
false
;
this
.
handleSelectAll
(
false
);
},
{
key
:
"status"
,
title
:
this
.
l
(
"status"
),
align
:
"center"
,
high
:
true
,
code
:
"plan.order.status"
,
modalDispatch
()
{
//打开工艺派发
this
.
listBatchIds
=
this
.
listBatchIds1
;
//用于列表操作时和多选时的listBatchId的冲突
if
(
this
.
dispatchStatus
==
1
)
{
this
.
dispatchModal
=
true
;
}
else
{
this
.
$Message
.
error
(
"所选订单里存在已派发订单!"
);
}
},
{
key
:
"mainRoutingSetStatus"
,
title
:
this
.
l
(
"mainRoutingSetStatus"
),
align
:
"center"
,
high
:
true
,
code
:
"aps.plan.mainRoutingStatus"
,
modalSchedule
()
{
//移入排产
this
.
scheduleType
=
null
;
this
.
scheduleTypeName
=
""
;
this
.
listBatchIds
=
this
.
listBatchIds1
;
if
(
this
.
scheduleStatus
==
1
&&
this
.
isPrescheduleStatu
!=
2
)
{
this
.
scheduleModal
=
true
;
}
else
{
this
.
$Message
.
error
(
"所选订单里存在未派发订单!"
);
}
},
{
key
:
"isSupportingFinish"
,
title
:
this
.
l
(
"isSupportingFinish"
),
align
:
"center"
,
render
:
(
h
,
params
)
=>
{
return
h
(
"op"
,
{
attrs
:
{
oprate
:
"detail"
,
},
style
:
{
color
:
this
.
setName
(
params
.
row
.
isSupportingFinish
).
color
,
},
on
:
{
click
:
()
=>
this
.
openAccessory
(
params
.
row
),
},
},
this
.
setName
(
params
.
row
.
isSupportingFinish
).
name
);
},
goMethod
(
value
)
{
//行内点击后面按钮
this
.
canselFooter
();
this
.
resultsOrderList
=
value
.
mesCode
;
this
.
listBatchIds
=
[
value
.
id
];
this
.
scheduleType
=
null
;
this
.
scheduleTypeName
=
""
;
if
(
value
.
mainRoutingSetStatus
==
0
)
{
//this.dispatchStatus = 1
//this.scheduleStatus = 0
this
.
dispatchModal
=
true
;
}
else
if
(
value
.
mainRoutingSetStatus
==
1
)
{
//this.dispatchStatus = 0
//this.scheduleStatus = 1
this
.
scheduleModal
=
true
;
}
},
{
key
:
"projectNumber"
,
title
:
this
.
l
(
"projectNumber"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
supportDis
(
value
)
{
(
this
.
orderSupportModal
=
true
),
this
.
$refs
.
orderSupport
.
loaddata
(
value
.
id
);
},
{
key
:
"batchNumber"
,
title
:
this
.
l
(
"batchNumber"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
scheduleOk
()
{
if
(
this
.
scheduleType
==
null
)
{
this
.
$Message
.
error
(
"请选择排产模型"
);
}
else
{
let
params
=
{
ids
:
this
.
listBatchIds
,
poolType
:
this
.
scheduleType
,
};
Api
.
moveinbatch
(
params
)
.
then
((
r
)
=>
{
if
(
r
.
success
&&
r
.
result
==
true
)
{
this
.
$Message
.
success
(
"移入排产成功"
);
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
this
.
changeCountOut
(
this
.
scheduleType
,
this
.
listBatchIds
.
length
);
}
else
{
if
(
!
r
.
result
.
res
)
{
this
.
$Message
.
error
(
r
.
result
.
msg
);
}
else
{
this
.
$Message
.
error
(
"移入排产失败"
);
}
}
})
.
catch
((
err
)
=>
{
this
.
$Message
.
error
(
"移入排产失败"
);
});
this
.
canselFooter
();
this
.
cancel
();
}
},
{
key
:
"urgencyLevel"
,
title
:
this
.
l
(
"urgencyLevel"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
code
:
"plan.order.urgencyLevel"
,
//跳转到aps排产池(有判断)
goAps
()
{
Api
.
moveintoaps
().
then
((
res
)
=>
{
if
(
res
.
success
)
{
if
(
res
.
result
.
res
)
{
this
.
$router
.
push
({
name
:
"aps-aps"
,
// params: { customerId: id }
});
}
else
{
this
.
$Message
.
error
(
res
.
result
.
msg
);
}
}
});
},
{
key
:
"taskType"
,
title
:
this
.
l
(
"taskType"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
code
:
"plan.order.taskType"
,
//跳转到智能排产池(有判断)
goAi
()
{
Api
.
moveintoai
().
then
((
res
)
=>
{
if
(
res
.
success
)
{
if
(
res
.
result
.
res
)
{
//test
this
.
$router
.
push
({
name
:
"aps-ai"
,
// params: { customerId: id }
});
}
else
{
this
.
$Message
.
error
(
res
.
result
.
msg
);
}
}
});
},
{
key
:
"drawnNumber"
,
title
:
this
.
l
(
"drawnNumber"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
goCemplate
()
{
this
.
$router
.
push
({
name
:
"aps-complete"
,
});
},
{
key
:
"quantity"
,
title
:
this
.
l
(
"quantity"
),
align
:
"right"
,
high
:
true
,
goStream
()
{
this
.
$router
.
push
({
name
:
"aps-stream"
,
});
},
{
key
:
"productCode"
,
title
:
this
.
l
(
"productCode"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
add
()
{
this
.
addModal
=
true
;
},
{
key
:
"isPreschedule"
,
title
:
this
.
l
(
"isPreschedule"
),
align
:
"center"
,
width
:
100
,
high
:
true
,
code
:
"aps.plan.ispreschedule"
,
addOk
()
{
this
.
$refs
.
grid
.
load
();
this
.
addModal
=
false
;
this
.
detailModal
=
false
;
this
.
editModal
=
false
;
this
.
curId
=
0
;
//aps
this
.
dispatchModal
=
false
;
this
.
scheduleModal
=
false
;
this
.
listBatchIds
=
[];
this
.
listBatchIds1
=
[];
this
.
canselFooter
();
this
.
modalAccessory
=
false
;
},
{
key
:
"taskRequire"
,
title
:
this
.
l
(
"taskRequire"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
search
()
{
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
},
{
key
:
"productingPreparationPeople"
,
title
:
this
.
l
(
"productingPreparationPeople"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
type
:
"workShopName"
,
detail
(
id
)
{
this
.
detailModal
=
true
;
this
.
curId
=
id
;
},
{
key
:
"productingPreparationFinishDate"
,
title
:
this
.
l
(
"productingPreparationFinishDate"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
edit
(
id
)
{
this
.
editModal
=
true
;
this
.
curId
=
id
;
},
{
key
:
"quotationPeople"
,
title
:
this
.
l
(
"quotationPeople"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
type
:
"user"
,
remove
(
id
)
{
this
.
deletelModal
=
true
;
this
.
curId
=
id
;
},
{
key
:
"quotationFinishDate"
,
title
:
this
.
l
(
"quotationFinishDate"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
removeOk
()
{
Api
.
delete
({
id
:
this
.
curId
,
}).
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$refs
.
grid
.
load
();
this
.
deletelModal
=
false
;
this
.
$Message
.
success
(
"删除成功"
);
}
});
},
{
key
:
"demandStartDate"
,
title
:
this
.
l
(
"demandStartDate"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
type
:
"date"
,
removeCancel
()
{
this
.
deletelModal
=
false
;
},
{
key
:
"demandFinishDate"
,
title
:
this
.
l
(
"demandFinishDate"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
type
:
"date"
,
cancel
()
{
this
.
curId
=
0
;
this
.
addModal
=
false
;
this
.
detailModal
=
false
;
this
.
editModal
=
false
;
this
.
deletedlModal
=
false
;
//aps
this
.
dispatchModal
=
false
;
this
.
scheduleModal
=
false
;
this
.
modalAccessory
=
false
;
// this.listBatchIds = []
// this.listBatchIds1 = []
// this.canselFooter()
},
// {
// key: "spareQty",
// title: this.l("spareQty"),
// align: "left",
// high: true,
// hide: true,
// },
// {
// key: "demandStart",
// title: this.l("demandStart"),
// align: "left",
// high: true,
// hide: true,
// },
// {
// key: "demandFinish",
// title: this.l("demandFinish"),
// align: "left",
// high: true,
// hide: true,
// },
// {
// key: "partNamePro",
// title: this.l("partNamePro"),
// align: "left",
// easy: true,
// high: true,
// hide: true,
// },
{
title
:
"操作"
,
key
:
"action"
,
width
:
140
,
align
:
"center"
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
,
},
[
h
(
"op"
,
{
attrs
:
{
oprate
:
"detail"
,
title
:
params
.
row
.
mainRoutingSetStatus
==
0
?
"工艺派发"
:
"移入排产"
,
},
style
:
{
color
:
params
.
row
.
mainRoutingSetStatus
==
0
?
"red"
:
""
,
},
on
:
{
click
:
()
=>
params
.
row
.
mainRoutingSetStatus
==
0
||
params
.
row
.
mainRoutingSetStatus
==
1
?
this
.
goMethod
(
params
.
row
)
:
null
,
},
},
params
.
row
.
mainRoutingSetStatus
==
0
&&
params
.
row
.
isPreschedule
==
0
?
"工艺派发"
:
params
.
row
.
mainRoutingSetStatus
==
1
&&
params
.
row
.
isPreschedule
==
0
?
"移入排产"
:
""
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"detail"
,
title
:
params
.
row
.
isSupportingFinish
==
2
||
params
.
row
.
isSupportingFinish
==
3
?
"配套派发"
:
""
,
},
style
:
{
color
:
params
.
row
.
mainRoutingSetStatus
==
0
?
"red"
:
""
,
},
on
:
{
click
:
()
=>
params
.
row
.
isSupportingFinish
==
2
||
params
.
row
.
isSupportingFinish
==
3
?
this
.
supportDis
(
params
.
row
)
:
null
,
},
},
params
.
row
.
isSupportingFinish
==
2
||
params
.
row
.
isSupportingFinish
==
3
?
"配套派发"
:
""
),
]
);
},
l
(
key
)
{
let
vkey
=
"mes_order"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
;
},
],
selectCount
:
0
,
selectList
:
[],
footerBar
:
false
,
results
:
[],
listBatchIds
:
[],
listBatchIds1
:
[],
//临时存储选择的ids
single
:
false
,
resultsStatusArr
:
[],
resultsStatus
:
0
,
dispatchStatus
:
0
,
//派发标识
scheduleStatus
:
0
,
//排产标识
resultsOrderList
:
""
,
scheduleType
:
null
,
scheduleTypeName
:
""
,
showAps
:
false
,
showAi
:
false
,
showAll
:
false
,
showRun
:
false
,
isPrescheduleStatu
:
0
,
};
},
mounted
()
{
this
.
loadInitCount
();
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
methods
:
{
handleSelectAll
(
status
)
{
//选择列表数据
this
.
$refs
.
grid
.
selectAll
(
status
);
},
selectInfo
(
value
)
{
if
(
value
.
length
>
0
)
{
this
.
footerBar
=
true
;
}
else
{
this
.
footerBar
=
false
;
}
this
.
selectList
=
[];
this
.
selectList
=
value
;
this
.
selectCount
=
this
.
selectList
.
length
;
let
statueArry
=
[];
let
tempmesCodeList
=
[];
this
.
resultsStatusArr
=
[];
this
.
isPrescheduleStatu
=
0
;
value
.
forEach
((
data
)
=>
{
var
that
=
this
;
statueArry
.
push
(
data
.
id
);
this
.
resultsStatusArr
.
push
(
data
.
mainRoutingSetStatus
);
if
(
data
.
isPreschedule
==
2
)
{
this
.
isPrescheduleStatu
=
2
;
}
tempmesCodeList
.
push
(
data
.
mesCode
);
});
let
mainRS
=
this
.
uniq
(
this
.
resultsStatusArr
);
//数组去重
if
(
mainRS
.
length
==
1
)
{
this
.
results
=
[];
this
.
results
=
statueArry
;
this
.
getListId
(
statueArry
);
this
.
resultsOrderList
=
JSON
.
stringify
(
tempmesCodeList
)
//提示mesCode
.
replace
(
"["
,
""
)
.
replace
(
"]"
,
""
)
.
replace
(
/
\"
/g
,
""
);
if
(
mainRS
[
0
]
==
0
)
{
//未派发
this
.
dispatchStatus
=
1
;
this
.
scheduleStatus
=
0
;
}
else
if
(
mainRS
[
0
]
==
1
)
{
//已派发
this
.
dispatchStatus
=
0
;
this
.
scheduleStatus
=
1
;
}
else
{
//派发中
this
.
dispatchStatus
=
0
;
this
.
scheduleStatus
=
0
;
}
}
else
{
this
.
dispatchStatus
=
0
;
this
.
scheduleStatus
=
0
;
}
},
//得到需要批量操作的ids
getListId
(
value
)
{
this
.
listBatchIds1
=
value
;
if
(
this
.
listBatchIds1
.
length
>
0
)
{
this
.
footerBar
=
true
;
}
else
{
this
.
footerBar
=
false
;
}
},
canselFooter
()
{
this
.
footerBar
=
false
;
this
.
handleSelectAll
(
false
);
},
modalDispatch
()
{
//打开工艺派发
this
.
listBatchIds
=
this
.
listBatchIds1
;
//用于列表操作时和多选时的listBatchId的冲突
if
(
this
.
dispatchStatus
==
1
)
{
this
.
dispatchModal
=
true
;
}
else
{
this
.
$Message
.
error
(
"所选订单里存在已派发订单!"
);
}
},
modalSchedule
()
{
//移入排产
this
.
scheduleType
=
null
;
this
.
scheduleTypeName
=
""
;
this
.
listBatchIds
=
this
.
listBatchIds1
;
if
(
this
.
scheduleStatus
==
1
&&
this
.
isPrescheduleStatu
!=
2
)
{
this
.
scheduleModal
=
true
;
}
else
{
this
.
$Message
.
error
(
"所选订单里存在未派发订单!"
);
}
},
goMethod
(
value
)
{
//行内点击后面按钮
this
.
canselFooter
();
this
.
resultsOrderList
=
value
.
mesCode
;
this
.
listBatchIds
=
[
value
.
id
];
this
.
scheduleType
=
null
;
this
.
scheduleTypeName
=
""
;
if
(
value
.
mainRoutingSetStatus
==
0
)
{
//this.dispatchStatus = 1
//this.scheduleStatus = 0
this
.
dispatchModal
=
true
;
}
else
if
(
value
.
mainRoutingSetStatus
==
1
)
{
//this.dispatchStatus = 0
//this.scheduleStatus = 1
this
.
scheduleModal
=
true
;
}
},
supportDis
(
value
)
{
(
this
.
orderSupportModal
=
true
),
this
.
$refs
.
orderSupport
.
loaddata
(
value
.
id
);
},
scheduleOk
()
{
if
(
this
.
scheduleType
==
null
)
{
this
.
$Message
.
error
(
"请选择排产模型"
);
}
else
{
let
params
=
{
ids
:
this
.
listBatchIds
,
poolType
:
this
.
scheduleType
,
};
Api
.
moveinbatch
(
params
)
.
then
((
r
)
=>
{
if
(
r
.
success
&&
r
.
result
==
true
)
{
this
.
$Message
.
success
(
"移入排产成功"
);
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
this
.
changeCountOut
(
this
.
scheduleType
,
this
.
listBatchIds
.
length
);
}
else
{
if
(
!
r
.
result
.
res
)
{
this
.
$Message
.
error
(
r
.
result
.
msg
);
}
else
{
this
.
$Message
.
error
(
"移入排产失败"
);
}
uniq
(
array
)
{
//数组去重
array
.
sort
();
var
temp
=
[];
temp
=
[
array
[
0
]];
for
(
var
i
=
1
;
i
<
array
.
length
;
i
++
)
{
if
(
array
[
i
]
!==
temp
[
temp
.
length
-
1
])
{
temp
.
push
(
array
[
i
]);
}
}
})
.
catch
((
err
)
=>
{
this
.
$Message
.
error
(
"移入排产失败"
);
});
this
.
canselFooter
();
this
.
cancel
();
}
},
//跳转到aps排产池(有判断)
goAps
()
{
Api
.
moveintoaps
().
then
((
res
)
=>
{
if
(
res
.
success
)
{
if
(
res
.
result
.
res
)
{
this
.
$router
.
push
({
name
:
"aps-aps"
,
// params: { customerId: id }
});
}
else
{
this
.
$Message
.
error
(
res
.
result
.
msg
);
}
}
});
},
//跳转到智能排产池(有判断)
goAi
()
{
Api
.
moveintoai
().
then
((
res
)
=>
{
if
(
res
.
success
)
{
if
(
res
.
result
.
res
)
{
//test
this
.
$router
.
push
({
name
:
"aps-ai"
,
// params: { customerId: id }
});
}
else
{
this
.
$Message
.
error
(
res
.
result
.
msg
);
}
}
});
},
goCemplate
()
{
this
.
$router
.
push
({
name
:
"aps-complete"
,
});
},
goStream
()
{
this
.
$router
.
push
({
name
:
"aps-stream"
,
});
},
add
()
{
this
.
addModal
=
true
;
},
addOk
()
{
this
.
$refs
.
grid
.
load
();
this
.
addModal
=
false
;
this
.
detailModal
=
false
;
this
.
editModal
=
false
;
this
.
curId
=
0
;
//aps
this
.
dispatchModal
=
false
;
this
.
scheduleModal
=
false
;
this
.
listBatchIds
=
[];
this
.
listBatchIds1
=
[];
this
.
canselFooter
();
this
.
modalAccessory
=
false
;
},
search
()
{
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
},
detail
(
id
)
{
this
.
detailModal
=
true
;
this
.
curId
=
id
;
},
edit
(
id
)
{
this
.
editModal
=
true
;
this
.
curId
=
id
;
},
remove
(
id
)
{
this
.
deletelModal
=
true
;
this
.
curId
=
id
;
},
removeOk
()
{
Api
.
delete
({
id
:
this
.
curId
,
}).
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$refs
.
grid
.
load
();
this
.
deletelModal
=
false
;
this
.
$Message
.
success
(
"删除成功"
);
}
});
},
removeCancel
()
{
this
.
deletelModal
=
false
;
},
cancel
()
{
this
.
curId
=
0
;
this
.
addModal
=
false
;
this
.
detailModal
=
false
;
this
.
editModal
=
false
;
this
.
deletedlModal
=
false
;
//aps
this
.
dispatchModal
=
false
;
this
.
scheduleModal
=
false
;
this
.
modalAccessory
=
false
;
// this.listBatchIds = []
// this.listBatchIds1 = []
// this.canselFooter()
},
l
(
key
)
{
let
vkey
=
"mes_order"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
;
},
uniq
(
array
)
{
//数组去重
array
.
sort
();
var
temp
=
[];
temp
=
[
array
[
0
]];
for
(
var
i
=
1
;
i
<
array
.
length
;
i
++
)
{
if
(
array
[
i
]
!==
temp
[
temp
.
length
-
1
])
{
temp
.
push
(
array
[
i
]);
}
}
return
temp
;
},
//移入排产前选择排产模型
onchangeScheduleType
(
val
)
{
switch
(
Number
(
val
))
{
case
4
:
this
.
scheduleTypeName
=
"智能排产"
;
break
;
case
2
:
this
.
scheduleTypeName
=
"整机排产"
;
break
;
case
3
:
this
.
scheduleTypeName
=
"流水排产"
;
break
;
default
:
this
.
scheduleTypeName
=
"APS排产"
;
}
},
//移入排产成功后给标题增加数量
changeCountOut
(
type
,
count
)
{
switch
(
type
)
{
case
4
:
//智能排产池排产订单数量
this
.
$store
.
commit
(
"setCountAi"
,
this
.
$store
.
state
.
countAi
+
count
);
break
;
case
2
:
//整机排产池排产订单数量
this
.
$store
.
commit
(
"setCountAll"
,
this
.
$store
.
state
.
countAll
+
count
);
break
;
case
3
:
//流水排产池排产订单数量
this
.
$store
.
commit
(
"setCountRun"
,
this
.
$store
.
state
.
countRun
+
count
);
break
;
default
:
//APS排产池排产订单数量
this
.
$store
.
commit
(
"setCountAps"
,
this
.
$store
.
state
.
countAps
+
count
);
}
},
//进入页面加载排产count-----
loadInitCount
()
{
let
currentUserId
=
this
.
$store
.
state
.
userInfo
.
userId
;
let
para
=
{
id
:
currentUserId
,
};
Api
.
listbyuser
(
para
).
then
((
datas
)
=>
{
if
(
datas
.
success
&&
datas
.
result
&&
datas
.
result
.
length
>
0
)
{
datas
.
result
.
forEach
((
dateScheduleId
)
=>
{
switch
(
dateScheduleId
.
apsScheduleId
)
{
case
1
:
this
.
showAps
=
true
;
break
;
case
2
:
this
.
showAll
=
true
;
break
;
case
3
:
this
.
showRun
=
true
;
break
;
default
:
this
.
showAi
=
true
;
return
temp
;
},
//移入排产前选择排产模型
onchangeScheduleType
(
val
)
{
switch
(
Number
(
val
))
{
case
4
:
this
.
scheduleTypeName
=
"智能排产"
;
break
;
case
2
:
this
.
scheduleTypeName
=
"整机排产"
;
break
;
case
3
:
this
.
scheduleTypeName
=
"流水排产"
;
break
;
default
:
this
.
scheduleTypeName
=
"APS排产"
;
}
});
}
});
this
.
$store
.
commit
(
"setCountAps"
,
0
);
this
.
$store
.
commit
(
"setCountAi"
,
0
);
this
.
$store
.
commit
(
"setCountAll"
,
0
);
this
.
$store
.
commit
(
"setCountRun"
,
0
);
Api
.
getpoolordercount
()
.
then
((
res
)
=>
{
if
(
res
.
success
&&
res
.
result
&&
res
.
result
.
length
>
0
)
{
res
.
result
.
forEach
((
data
)
=>
{
this
.
changeCountOut
(
data
.
poolType
,
data
.
count
);
},
//移入排产成功后给标题增加数量
changeCountOut
(
type
,
count
)
{
switch
(
type
)
{
case
4
:
//智能排产池排产订单数量
this
.
$store
.
commit
(
"setCountAi"
,
this
.
$store
.
state
.
countAi
+
count
);
break
;
case
2
:
//整机排产池排产订单数量
this
.
$store
.
commit
(
"setCountAll"
,
this
.
$store
.
state
.
countAll
+
count
);
break
;
case
3
:
//流水排产池排产订单数量
this
.
$store
.
commit
(
"setCountRun"
,
this
.
$store
.
state
.
countRun
+
count
);
break
;
default
:
//APS排产池排产订单数量
this
.
$store
.
commit
(
"setCountAps"
,
this
.
$store
.
state
.
countAps
+
count
);
}
},
//进入页面加载排产count-----
loadInitCount
()
{
let
currentUserId
=
this
.
$store
.
state
.
userInfo
.
userId
;
let
para
=
{
id
:
currentUserId
,
};
Api
.
listbyuser
(
para
).
then
((
datas
)
=>
{
if
(
datas
.
success
&&
datas
.
result
&&
datas
.
result
.
length
>
0
)
{
datas
.
result
.
forEach
((
dateScheduleId
)
=>
{
switch
(
dateScheduleId
.
apsScheduleId
)
{
case
1
:
this
.
showAps
=
true
;
break
;
case
2
:
this
.
showAll
=
true
;
break
;
case
3
:
this
.
showRun
=
true
;
break
;
default
:
this
.
showAi
=
true
;
}
});
}
});
}
})
.
catch
((
err
)
=>
{
this
.
$Message
.
error
(
"获取排产池排产数量失败"
);
});
},
//配套申请
setName
(
v
)
{
let
outPar
=
{
name
:
""
,
color
:
""
,
};
if
((
v
+
""
).
indexOf
(
","
)
==
-
1
)
{
var
item
;
this
.
statuList
.
map
((
u
)
=>
{
if
(
u
.
code
==
v
)
{
item
=
u
;
}
});
if
(
item
)
{
//this.items = item;
outPar
=
{
name
:
item
.
name
,
color
:
item
.
color
,
};
}
}
return
outPar
;
},
openAccessory
(
row
)
{
if
(
row
.
mainRoutingSetStatus
!=
1
)
{
this
.
$Message
.
error
(
"请设置订单工艺!"
);
return
;
}
else
{
this
.
orderId
=
row
.
id
;
this
.
mesCode
=
row
.
mesCode
;
this
.
productName
=
row
.
productName
;
this
.
drawnNumber
=
row
.
drawnNumber
;
this
.
count
=
row
.
quantity
;
this
.
productingPreparationPeople
=
row
.
productingPreparationPeople
;
if
(
row
.
mainRoutingSetStatus
==
1
&&
row
.
isSupportingFinish
==
0
)
{
this
.
$Message
.
error
(
"请去工艺设置生成料单!"
);
// this.title = "申请配套";
// this.details = () => import("./addAccessory");
}
else
{
this
.
title
=
"配套清单"
;
this
.
details
=
()
=>
import
(
"./editAccessory"
);
this
.
modalAccessory
=
true
;
}
}
},
ok
()
{
this
.
modalAccessory
=
false
;
this
.
curId
=
0
;
this
.
$store
.
commit
(
"setCountAps"
,
0
);
this
.
$store
.
commit
(
"setCountAi"
,
0
);
this
.
$store
.
commit
(
"setCountAll"
,
0
);
this
.
$store
.
commit
(
"setCountRun"
,
0
);
Api
.
getpoolordercount
()
.
then
((
res
)
=>
{
if
(
res
.
success
&&
res
.
result
&&
res
.
result
.
length
>
0
)
{
res
.
result
.
forEach
((
data
)
=>
{
this
.
changeCountOut
(
data
.
poolType
,
data
.
count
);
});
}
})
.
catch
((
err
)
=>
{
this
.
$Message
.
error
(
"获取排产池排产数量失败"
);
});
},
//配套申请
setName
(
v
)
{
let
outPar
=
{
name
:
""
,
color
:
""
,
};
if
((
v
+
""
).
indexOf
(
","
)
==
-
1
)
{
var
item
;
this
.
statuList
.
map
((
u
)
=>
{
if
(
u
.
code
==
v
)
{
item
=
u
;
}
});
if
(
item
)
{
//this.items = item;
outPar
=
{
name
:
item
.
name
,
color
:
item
.
color
,
};
}
}
return
outPar
;
},
openAccessory
(
row
)
{
if
(
row
.
mainRoutingSetStatus
!=
1
)
{
this
.
$Message
.
error
(
"请设置订单工艺!"
);
return
;
}
else
{
this
.
orderId
=
row
.
id
;
this
.
mesCode
=
row
.
mesCode
;
this
.
productName
=
row
.
productName
;
this
.
drawnNumber
=
row
.
drawnNumber
;
this
.
count
=
row
.
quantity
;
this
.
productingPreparationPeople
=
row
.
productingPreparationPeople
;
if
(
row
.
mainRoutingSetStatus
==
1
&&
row
.
isSupportingFinish
==
0
)
{
this
.
$Message
.
error
(
"请去工艺设置生成料单!"
);
// this.title = "申请配套";
// this.details = () => import("./addAccessory");
}
else
{
this
.
title
=
"配套清单"
;
this
.
details
=
()
=>
import
(
"./editAccessory"
);
this
.
modalAccessory
=
true
;
}
}
},
ok
()
{
this
.
modalAccessory
=
false
;
this
.
curId
=
0
;
},
},
},
};
</
script
>
<
style
lang=
"less"
>
.footerSpan {
width: 120px;
width: 120px;
}
.demo-badge-alone {
background: #5cb85c !important;
background: #5cb85c !important;
}
.radioList {
margin: 10px 30px;
margin: 10px 30px;
}
.radioList label {
margin-top: 5px;
margin-top: 5px;
}
</
style
>
pages/project/groupUser/list.vue
View file @
15a0c384
...
...
@@ -533,9 +533,9 @@ export default {
},
//新增时取消
remove
(
row
,
index
)
{
if
(
!
row
.
id
||
!
row
.
groupId
)
{
this
.
list
.
pop
();
}
//
if (!row.id || !row.groupId) {
//
this.list.pop();
//
}
this
.
edit
=
-
1
;
},
//新增保存或修改保存
...
...
pages/project/plan/importTemplate.vue
View file @
15a0c384
<
template
>
<div>
<EditGrid
:columns=
"columns"
ref=
"grid"
:items=
"list"
>
</EditGrid>
<EditGrid
:columns=
"columns"
ref=
"grid"
:items=
"list"
>
</EditGrid>
<Modal
v-model=
"modal"
:title=
"title"
width=
"1200"
footer-hide
fullscreen
>
<component
:is=
"detail"
:eid=
"curId"
:v=
"row"
/>
</Modal>
</div>
</
template
>
<
script
>
...
...
@@ -16,8 +21,12 @@ export default {
},
data
()
{
return
{
title
:
''
,
modal
:
false
,
curId
:
0
,
list
:[],
row
:
null
,
list
:
[],
detail
:
null
,
columns
:
[
{
key
:
"id"
,
...
...
@@ -32,7 +41,24 @@ export default {
align
:
"left"
,
easy
:
true
,
high
:
true
,
render
:
(
h
,
params
)
=>
{
return
h
(
"op"
,
{
attrs
:
{
oprate
:
"detail"
},
on
:
{
click
:
()
=>
this
.
view
(
params
.
row
)
},
},
params
.
row
.
title
);
},
},
// {
// key: "title",
// title: this.l("title"),
// align: "left",
// easy: true,
// high: true,
// },
{
key
:
"note"
,
title
:
this
.
l
(
"note"
),
...
...
@@ -69,19 +95,19 @@ export default {
h
(
"op"
,
{
attrs
:
{
oprate
:
"remove"
,
msg
:
"确定要导入模版吗?"
},
attrs
:
{
oprate
:
"remove"
,
msg
:
"确定要导入模版吗?"
},
on
:
{
click
:
()
=>
this
.
useTemplate
(
params
.
row
.
id
)
},
},
"导入"
),
// h(
// "op",
// {
// attrs: { oprate: "delete" },
// on: { click: () => this.remove(params.row.id) },
// },
// "删除"
// ),
// h(
// "op",
// {
// attrs: { oprate: "delete" },
// on: { click: () => this.remove(params.row.id) },
// },
// "删除"
// ),
]);
},
},
...
...
@@ -91,7 +117,7 @@ export default {
mounted
()
{
this
.
load
();
},
props
:
{
props
:
{
v
:
Object
,
eid
:
String
,
},
...
...
@@ -105,24 +131,30 @@ export default {
this
.
curId
=
""
;
},
load
()
{
Api
.
templates
({
}).
then
(
r
=>
{
this
.
list
=
r
.
result
;
})
Api
.
templates
({}).
then
((
r
)
=>
{
this
.
list
=
r
.
result
;
});
},
useTemplate
(
id
)
{
Api
.
useTemplate
({
id
:
id
,
projectId
:
this
.
eid
}).
then
(
r
=>
{
if
(
r
.
success
){
this
.
$Message
.
success
(
"导入成功"
);
this
.
$emit
(
"on-load"
)
}
})
Api
.
useTemplate
({
id
:
id
,
projectId
:
this
.
eid
,
}).
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"导入成功"
);
this
.
$emit
(
"on-load"
);
}
});
},
view
(
row
)
{
console
.
log
(
"111"
);
console
.
log
(
row
);
this
.
title
=
"查看"
;
this
.
modal
=
true
;
this
.
row
=
row
;
this
.
curId
=
row
.
id
;
this
.
detail
=
()
=>
import
(
"../resources/templates/detail.vue"
);
},
l
(
key
)
{
let
vkey
=
"project_template"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
;
...
...
pages/project/plan/index.vue
View file @
15a0c384
<
template
>
<div>
<Card>
<EditGrid
:columns=
"columns"
ref=
"grid"
:items=
"list"
:level=
"8"
:drag=
"true"
:exportTitle=
"exportTl"
>
<EditGrid
:columns=
"columns"
ref=
"grid"
:
batch=
"true"
:
items=
"list"
:level=
"8"
:drag=
"true"
:exportTitle=
"exportTl"
>
<template
slot=
"easySearch"
>
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
<FormItem
prop=
"keys"
><Input
placeholder=
"请输入关键字标题"
v-model=
"easySearch.keys.value"
/>
...
...
@@ -15,7 +15,8 @@
</template> -->
<
template
slot=
"buttons"
>
<Button
type=
"primary"
@
click=
"add(null)"
>
新增
</Button>
<Dropdown
@
on-click=
"show"
>
<Button
@
mouseenter
.
native=
"showBm"
ref=
"showBtn"
shape=
"circle"
icon=
"md-settings"
></Button>
<Dropdown
@
on-click=
"show"
v-if=
"false"
>
<Button
shape=
"circle"
icon=
"md-settings"
></Button>
<DropdownMenu
slot=
"list"
>
<DropdownItem
name=
"saveTemplate"
>
存为模版
</DropdownItem>
...
...
@@ -31,9 +32,11 @@
</
template
>
</EditGrid>
</Card>
<Submenus
:show=
"showStatu"
:data=
"tempItems"
:params=
"params"
></Submenus>
<Modal
v-model=
"modal"
:title=
"title"
width=
"1200"
footer-hide
>
<component
:is=
"detail"
:eid=
"curId"
:v=
"row"
@
on-close=
"cancel"
@
on-ok=
"ok"
/>
</Modal>
<ImportExcel
ref=
"importExcel"
@
on-get-data=
"getData"
:modalTitle=
"temTitle"
:columns=
"columns"
:open=
"ModalIm"
@
on-cancel=
"ModalImCancel"
@
on-ok=
"ok"
/>
</div>
</template>
...
...
@@ -77,7 +80,6 @@ export default {
},
modal
:
false
,
title
:
"新增"
,
exportTl
:
'项目目录'
,
detail
:
null
,
curId
:
null
,
list
:
[],
...
...
@@ -93,6 +95,12 @@ export default {
type
:
"selection"
,
align
:
'center'
},
{
key
:
"upTitle"
,
title
:
this
.
l
(
"upTitle"
),
hide
:
true
,
export
:
true
,
},
{
key
:
"title"
,
title
:
this
.
l
(
"title"
),
...
...
@@ -238,6 +246,14 @@ export default {
},
},
],
//setButon
showStatu
:
false
,
//控件是否显示
tempItems
:
[],
//控件数据
params
:
{},
//控件坐标位置
//导出导入
exportTl
:
'项目目录'
,
ModalIm
:
false
,
temTitle
:
"项目目录"
,
};
},
mounted
()
{
...
...
@@ -376,13 +392,118 @@ export default {
that
.
modal
=
true
;
},
}
//导出excel
if
(
name
==
'down'
)
{
this
.
exportTl
=
'项目目录-'
+
this
.
data
.
title
;
this
.
$refs
.
grid
.
export2Excel
()
}
if
(
name
==
'importExcel'
)
{
this
.
openModalIm
()
}
m
[
name
]
&&
m
[
name
](
name
);
},
saveTemplate
()
{
var
that
=
this
;
that
.
curId
=
that
.
eid
;
that
.
row
=
that
.
data
;
that
.
title
=
"保存模版"
;
that
.
detail
=
()
=>
import
(
"./saveTemplate"
);
that
.
modal
=
true
;
},
useTemplate
()
{
var
that
=
this
;
that
.
curId
=
that
.
eid
;
that
.
row
=
that
.
data
;
that
.
title
=
"导入模版"
;
that
.
detail
=
()
=>
import
(
"./importTemplate"
);
that
.
modal
=
true
;
},
down
()
{
this
.
exportTl
=
'项目目录-'
+
this
.
data
.
title
;
this
.
$refs
.
grid
.
export2Excel
()
},
importExcel
()
{
this
.
openModalIm
()
},
showBm
(
event
)
{
let
obj
=
event
.
target
let
objSet
=
obj
.
getBoundingClientRect
()
this
.
showStatu
=
true
;
this
.
params
=
{
x
:
objSet
.
x
,
y
:
objSet
.
bottom
};
console
.
log
(
event
)
this
.
tempItems
=
[{
label
:
"存为模版"
,
onClick
:
()
=>
{
this
.
saveTemplate
()
},
},
{
label
:
"导入模版"
,
divided
:
true
,
onClick
:
()
=>
{
this
.
useTemplate
()
},
},
{
label
:
"导出Excel"
,
icon
:
"md-cloud-download"
,
onClick
:
()
=>
{
this
.
down
()
},
},
{
label
:
"导入Excel"
,
icon
:
"md-cloud-upload"
,
onClick
:
()
=>
{
this
.
importExcel
()
},
}
];
},
//批量导入start
//导入功能
openModalIm
()
{
this
.
ModalIm
=
true
},
ModalImCancel
()
{
this
.
ModalIm
=
false
},
getData
(
val
)
{
let
url
=
`
${
material
}
/projectplan/importplans`
;
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
=
{
projectId
:
this
.
eid
,
upTitle
:
ele
.
upTitle
?
ele
.
upTitle
:
null
,
title
:
ele
.
title
?
ele
.
title
:
''
,
status
:
0
,
type
:
ele
.
type
?
ele
.
type
:
0
,
//?
startDate
:
ele
.
startDate
?
ele
.
startDate
:
""
,
//?
endDate
:
ele
.
endDate
?
ele
.
endDate
:
""
,
//?
direction
:
ele
.
direction
?
ele
.
direction
:
0
,
executor
:
ele
.
executor
?
ele
.
executor
:
[],
//?
deliverable
:
ele
.
deliverable
?
ele
.
deliverable
:
0
};
if
(
ele
.
title
&&
ele
.
title
!=
''
)
{
obj
.
ico
=
false
}
else
{
obj
.
ico
=
true
}
tempList
.
push
(
obj
);
});
return
tempList
},
//批量导入end
l
(
key
)
{
let
vkey
=
"project_plan"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
;
...
...
pages/project/project/add.vue
View file @
15a0c384
...
...
@@ -79,10 +79,9 @@
></Col>
<Col
:span=
"12"
>
<FormItem
label=
"开始结束时间"
prop=
"date"
>
<DateRange
v-model=
"entity"
edit
></DateRange>
</FormItem
<DateRange
v-model=
"entity"
edit
></DateRange>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('type')"
prop=
"type"
>
<Dictionary
...
...
@@ -200,8 +199,23 @@ export default {
}
Api
.
create
(
this
.
entity
)
.
then
((
r
)
=>
{
debugger
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
//添加当前登陆人为项目经理
var
user
=
this
.
$store
.
state
.
userInfo
;
var
entity
=
{
userId
:
user
.
id
,
role
:
0
,
status
:
1
,
joindate
:
""
,
whour
:
14
,
whourpd
:
7.0
,
authority
:
2
,
projectId
:
r
.
result
.
id
,
note
:
user
.
name
,
};
Api
.
addMaster
(
entity
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
...
...
pages/project/project/api.js
View file @
15a0c384
...
...
@@ -16,6 +16,10 @@ export default {
update
(
params
){
return
Api
.
post
(
`
${
material
}
/projectmain/update`
,
params
);
},
addMaster
(
params
)
{
return
Api
.
post
(
`
${
material
}
/projectgroupuser/create`
,
params
);
},
delete
(
id
)
{
return
Api
.
delete
(
`
${
material
}
/projectmain/delete`
,{
params
:{
id
:
id
}});
},
...
...
pages/project/resources/templates/detail.vue
View file @
15a0c384
...
...
@@ -19,13 +19,21 @@
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('deleterUserId')"
>
{{
entity
.
deleterUserId
}}
</Filed>
-->
<Filed
:span=
"12"
:name=
"l('title')"
>
{{
entity
.
title
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('template')"
>
{{
entity
.
template
}}
</Filed>
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('template')"
>
{{
entity
.
template
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('attachment')"
>
{{
entity
.
attachment
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('type')"
>
{{
entity
.
type
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('type')"
>
{{
entity
.
type
}}
</Filed>
-->
<Filed
:span=
"8"
:name=
"l('title')"
>
{{
entity
.
title
}}
</Filed>
<Filed
:span=
"8"
:name=
"l('creationTime')"
>
{{
entity
.
creationTime
}}
</Filed>
<Filed
:span=
"8"
:name=
"l('creatorUserId')"
>
<User
:value=
"entity.creatorUserId"
/>
</Filed>
<Filed
:span=
"24"
:name=
"l('note')"
>
{{
entity
.
note
}}
</Filed>
</Row>
<EditGrid
:columns=
"columns"
ref=
"grid"
:items=
"list"
:level=
"8"
>
</EditGrid>
</div>
</
template
>
<
script
>
...
...
@@ -39,20 +47,124 @@ export default {
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
code
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
},
exportTl
:
"项目目录"
,
list
:
[],
columns
:
[
{
key
:
"title"
,
title
:
this
.
l
(
"title"
),
align
:
"left"
,
tree
:
true
,
easy
:
true
,
high
:
true
,
export
:
true
,
},
{
key
:
"type"
,
width
:
90
,
title
:
this
.
l
(
"type"
),
align
:
"center"
,
high
:
true
,
code
:
"mes.project_plan.Type"
,
attr
:
{
type
:
"icon"
,
},
export
:
true
,
},
{
key
:
"direction"
,
title
:
this
.
l
(
"direction"
),
align
:
"center"
,
// code: "mes.project_plan.direction",
width
:
80
,
easy
:
true
,
high
:
true
,
export
:
true
,
},
{
key
:
"status"
,
title
:
this
.
l
(
"status"
),
align
:
"center"
,
width
:
80
,
high
:
true
,
// code: "mes.project_plan.Status",
export
:
true
,
},
{
key
:
"startDate"
,
title
:
"计划开始日期"
,
hide
:
true
,
export
:
true
,
},
{
key
:
"endDate"
,
title
:
"计划结束日期"
,
hide
:
true
,
export
:
true
,
},
{
key
:
"dateRange"
,
width
:
250
,
title
:
"计划日期"
,
align
:
"center"
,
render
(
h
,
param
)
{
return
h
(
"DateRange"
,
{
attrs
:
{
value
:
param
.
row
,
},
});
},
},
{
key
:
"executor"
,
title
:
this
.
l
(
"executor"
),
align
:
"left"
,
high
:
true
,
type
:
"users"
,
export
:
true
,
},
{
key
:
"deliverable"
,
title
:
this
.
l
(
"deliverable"
),
// code: "mes.project_plan.deliverable",
width
:
80
,
align
:
"center"
,
easy
:
true
,
high
:
true
,
export
:
true
,
},
],
};
},
props
:
{
eid
:
String
,
},
mounted
()
{
if
(
this
.
eid
)
{
if
(
this
.
eid
)
{
this
.
load
(
this
.
eid
);
}
},
async
fetch
({
store
,
params
})
{
// await store.dispatch("loadDictionary"); // 加载数据字典
},
methods
:
{
load
(
v
)
{
console
.
log
(
this
.
$store
.
state
.
dictionary
)
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
;
console
.
log
(
JSON
.
parse
(
this
.
entity
.
template
));
var
data
=
this
.
$u
.
toTree
(
JSON
.
parse
(
this
.
entity
.
template
),
null
,
(
u
)
=>
{
// console.log(u);
// u.expanded = true;
// u.selected = false;
// u.checked = false;
},
"upId"
);
this
.
list
=
data
;
this
.
$emit
(
"on-load"
);
});
},
...
...
@@ -66,7 +178,7 @@ export default {
},
watch
:
{
eid
(
v
)
{
if
(
v
!=
""
)
{
if
(
v
!=
""
)
{
this
.
load
(
v
);
}
},
...
...
@@ -74,7 +186,10 @@ export default {
};
</
script
>
<
style
lang=
"less"
scoped
>
.detail{
.detail
{
width: 100%;
}
.detail .ivu-row{
height: auto;
}
</
style
>
style>
\ No newline at end of file
pages/project/resources/templates/index.vue
View file @
15a0c384
...
...
@@ -21,7 +21,7 @@
<Button
type=
"primary"
@
click=
"add"
>
新增
</Button>
</
template
>
</DataGrid>
<Modal
v-model=
"modal"
:title=
"title"
width=
"1200"
footer-hide
>
<Modal
v-model=
"modal"
:title=
"title"
width=
"1200"
footer-hide
:fullscreen=
'fullscreen'
>
<component
:is=
"detail"
:eid=
"curId"
@
on-close=
"cancel"
@
on-ok=
"ok"
/>
</Modal>
</div>
...
...
@@ -41,6 +41,7 @@ export default {
},
data
()
{
return
{
fullscreen
:
false
,
action
:
Api
.
index
,
easySearch
:
{
keys
:
{
op
:
"title"
,
value
:
null
},
...
...
@@ -180,6 +181,7 @@ export default {
},
mounted
()
{
console
.
log
(
this
);
console
.
log
(
"dictionary"
,
this
.
$store
.
state
.
dictionary
)
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
...
...
@@ -206,6 +208,7 @@ export default {
this
.
modal
=
true
;
},
view
(
id
)
{
this
.
fullscreen
=
true
;
this
.
curId
=
id
;
this
.
title
=
"详情"
;
this
.
detail
=
()
=>
import
(
"./detail"
);
...
...
pages/test/example/components/jcTreeGrid.vue
View file @
15a0c384
...
...
@@ -5,7 +5,7 @@
<div
class=
"example_split"
></div>
<div
class=
"example-code"
:style=
"styleH"
>
<div
:style=
'opacity'
>
<pre><code
class=
"hljs"
><span
class=
"hljs-tag"
><
<
span
class=
"hljs-title"
>
template
</span>
>
</span>
<pre><code
class=
"hljs"
><span
class=
"hljs-tag"
><span
class=
"hljs-title"
>
template
</span>
>
</span>
<span
class=
"hljs-tag"
><<span
class=
"hljs-title"
>
Table
</span>
<span
class=
"hljs-attribute"
>
:columns
</span>
=
<span
class=
"hljs-value"
>
"columns1"
</span>
<span
class=
"hljs-attribute"
>
:data
</span>
=
<span
class=
"hljs-value"
>
"data1"
</span>
>
</span><span
class=
"hljs-tag"
></<span
class=
"hljs-title"
>
Table
</span>
>
</span>
<span
class=
"hljs-tag"
></<span
class=
"hljs-title"
>
template
</span>
>
</span>
<span
class=
"hljs-tag"
><<span
class=
"hljs-title"
>
script
</span>
>
</span><span
class=
"javascript"
>
...
...
pages/test/test2.vue
View file @
15a0c384
...
...
@@ -9,6 +9,14 @@
<h2>
Bmenu
</h2>
<div
@
contextmenu=
"onCon"
class=
"tc"
style=
"width:120px;height:40px;line-height:40px;background:#f5f5f5;border:#ccc solid 1px; border-radius: 5px;"
>
{{
message
}}
</div>
</div>
<div
class=
"mt50 pl10"
>
<h2>
mouseenter
</h2>
<p>
<Button
@
mouseenter
.
native=
"showBm"
ref=
"showBtn"
shape=
"circle"
icon=
"ios-settings"
></Button>
<div
@
mouseover=
"showBm"
v-if=
"false"
ref=
"showB"
class=
"tc"
style=
"width:120px;height:40px;line-height:40px;background:#f5f5f5;border:#ccc solid 1px; border-radius: 5px;"
>
mouseenter打开菜单
</div>
</p>
</div>
</div>
</
template
>
...
...
@@ -43,13 +51,13 @@ export default {
this
.
tempItems
=
[{
label
:
"返回(B)"
,
onClick
:
()
=>
{
this
.
showStatu
=
false
;
alert
(
"tttt"
)
},
},
{
label
:
"前进(F)"
,
disabled
:
true
,
onClick
:
()
=>
{
this
.
showStatu
=
false
;
alert
(
"11"
)
},
},
{
...
...
@@ -57,13 +65,13 @@ export default {
divided
:
true
,
icon
:
"el-icon-refresh"
,
onClick
:
()
=>
{
this
.
showStatu
=
false
;
alert
(
"222"
)
},
},
{
label
:
"另存为(A)..."
,
onClick
:
()
=>
{
this
.
showStatu
=
false
;
alert
(
"333"
)
},
},
{
...
...
@@ -223,6 +231,79 @@ export default {
});
event
.
preventDefault
();
},
showBm
(
event
)
{
let
obj
=
event
.
target
let
objSet
=
obj
.
getBoundingClientRect
()
this
.
showStatu
=
true
;
this
.
params
=
{
x
:
objSet
.
x
,
y
:
objSet
.
bottom
};
console
.
log
(
event
)
this
.
tempItems
=
[{
label
:
"返回(B)"
,
onClick
:
()
=>
{
alert
(
"11"
)
},
},
{
label
:
"前进(F)"
,
disabled
:
true
,
onClick
:
()
=>
{
alert
(
"222"
)
},
},
{
label
:
"重新加载(R)"
,
divided
:
true
,
icon
:
"el-icon-refresh"
,
onClick
:
()
=>
{
alert
(
"33"
)
},
},
{
label
:
"另存为(A)..."
,
onClick
:
()
=>
{
alert
(
"44"
)
},
},
{
label
:
"打印(P)..."
,
icon
:
"el-icon-printer"
,
onClick
:
()
=>
{
alert
(
"55"
)
},
},
{
label
:
"投射(C)..."
,
divided
:
true
,
onClick
:
()
=>
{
alert
(
"66"
)
},
},
{
label
:
"使用网页翻译(T)"
,
divided
:
true
,
minWidth
:
0
,
children
:
[{
label
:
"翻译成简体中文"
,
onClick
:
()
=>
{
alert
(
"77"
)
},
},
{
label
:
"翻译成繁体中文"
,
onClick
:
()
=>
{
alert
(
"88"
)
},
},
],
},
];
event
.
preventDefault
();
},
leaveBm
(
event
)
{
this
.
showStatu
=
false
;
}
},
};
</
script
>
...
...
pages/welcome/index.vue
View file @
15a0c384
...
...
@@ -7,7 +7,7 @@
:key=
"index"
@
mouseenter=
"navClick(item,index)"
>
<Icon
type=
"ios-stat
s"
class=
"f16"
/>
{{
item
.
name
}}
<Icon
:type=
"item.icon
s"
class=
"f16"
/>
{{
item
.
name
}}
</li>
</ul>
...
...
@@ -42,149 +42,7 @@ import viewerVue from "../test/viewer.vue";
export
default
{
data
()
{
return
{
navMenus
:
false
,
onetest
:
"0"
,
menus
:
[
{
name
:
"项目管理"
,
style
:{
left
:
'260px'
,
top
:
"100px"
},
children
:
[
{
name
:
"项目管理"
,
type
:
2
,
code
:
""
,
icon
:
""
,
target
:
0
,
url
:
"/project/project"
,
status
:
1
,
description
:
""
,
source
:
0
,
app
:
"mes_roter"
,
priority
:
0
,
id
:
541
,
title
:
"项目管理"
,
expand
:
true
,
upId
:
537
,
lay
:
2
,
children
:
null
,
data
:
null
,
},
{
name
:
"任务中心"
,
type
:
2
,
code
:
""
,
icon
:
""
,
target
:
0
,
url
:
"/project/task"
,
status
:
1
,
description
:
""
,
source
:
0
,
app
:
"mes_roter"
,
priority
:
0
,
id
:
542
,
title
:
"任务中心"
,
expand
:
true
,
upId
:
537
,
lay
:
2
,
children
:
null
,
data
:
null
,
},
{
name
:
"项目资源"
,
type
:
2
,
code
:
""
,
icon
:
""
,
target
:
0
,
url
:
"/project/resources"
,
status
:
1
,
description
:
""
,
source
:
0
,
app
:
"mes_roter"
,
priority
:
0
,
id
:
543
,
title
:
"项目资源"
,
expand
:
true
,
upId
:
537
,
lay
:
2
,
children
:
null
,
data
:
null
,
},
],
},
{
name
:
"文档管理"
,
style
:{
left
:
'260px'
,
top
:
"190px"
},
children
:
[
{
name
:
"文档分类"
,
type
:
2
,
code
:
""
,
icon
:
""
,
target
:
0
,
url
:
"/word/classification"
,
status
:
1
,
description
:
""
,
source
:
0
,
app
:
"mes_roter"
,
priority
:
0
,
id
:
544
,
title
:
"文档分类"
,
expand
:
true
,
upId
:
539
,
lay
:
2
,
children
:
null
,
data
:
null
,
},
{
name
:
"文档管理"
,
type
:
2
,
code
:
""
,
icon
:
""
,
target
:
0
,
url
:
"/word/document"
,
status
:
1
,
description
:
""
,
source
:
0
,
app
:
"mes_roter"
,
priority
:
0
,
id
:
545
,
title
:
"文档管理"
,
expand
:
true
,
upId
:
539
,
lay
:
2
,
children
:
null
,
data
:
null
,
},
{
name
:
"模板类型"
,
type
:
2
,
code
:
""
,
icon
:
""
,
target
:
0
,
url
:
"/word/template"
,
status
:
1
,
description
:
""
,
source
:
0
,
app
:
"mes_roter"
,
priority
:
0
,
id
:
546
,
title
:
"模板类型"
,
expand
:
true
,
upId
:
539
,
lay
:
2
,
children
:
null
,
data
:
null
,
},
],
},
{
name
:
"大屏展示"
},
],
menus
:
[],
list
:
[],
arrList
:
[],
isIndex
:
-
1
,
...
...
@@ -204,16 +62,25 @@ export default {
this
.
$api
.
get
(
`
${
systemUrl
}
/menu/getusermenu?id=mes_roter`
).
then
((
r
)
=>
{
if
(
r
.
result
)
{
let
arr
=
r
.
result
[
0
].
children
.
map
((
l
)
=>
{
if
(
!
this
.
$u
.
isNull
(
l
.
description
)
&&
l
.
description
.
indexOf
(
"{"
)
>
-
1
)
{
if
(
!
this
.
$u
.
isNull
(
l
.
description
)
&&
l
.
description
.
indexOf
(
"{"
)
>
-
1
)
{
l
.
style
=
eval
(
"("
+
l
.
description
+
")"
);
}
return
l
;
});
console
.
log
(
"arr"
,
arr
);
this
.
arrList
=
arr
;
this
.
arrList
.
map
(
v
=>
{
if
(
v
.
name
==
'项目管理'
){
this
.
menus
[
0
]
=
v
;
this
.
menus
[
0
].
icons
=
'ios-list-box-outline'
;
}
else
if
(
v
.
name
==
'文档管理'
){
this
.
menus
[
1
]
=
v
;
this
.
menus
[
1
].
icons
=
'md-document'
;
}
else
if
(
v
.
name
==
'大屏展示'
){
this
.
menus
[
2
]
=
v
;
this
.
menus
[
2
].
icons
=
'ios-stats'
;
}
})
console
.
log
(
this
.
menus
)
}
});
},
...
...
@@ -237,8 +104,7 @@ export default {
this
.
menuPos
=
{
left
,
top
};
}
},
navClick
(
v
,
index
)
{
navClick
(
v
,
index
)
{
if
(
v
.
children
&&
v
.
children
.
length
>
0
)
{
var
{
left
,
top
}
=
v
.
style
;
this
.
list
=
v
.
children
;
...
...
store/index.js
View file @
15a0c384
...
...
@@ -2,210 +2,213 @@ import createVuexAlong from 'vuex-along'
import
Api
from
'@/plugins/request'
// import Mock from 'mockjs'
export
const
state
=
()
=>
({
counter
:
0
,
dictionary
:
new
Map
(),
//所有字典项
userMap
:
new
Map
(),
//所有用户缓存;
departmentsMap
:
new
Map
(),
//部门缓存;
userInfo
:
{
userId
:
0
,
userName
:
""
},
messages
:
[],
departments
:{},
//部门列表
cart
:
[],
collect
:[],
//用户收藏
count
:
0
,
countAps
:
0
,
//aps排产
countAi
:
0
,
//智能排产
countAll
:
0
,
//整机排产
countRun
:
0
,
//流水排产
counter
:
0
,
dictionary
:
new
Map
(),
//所有字典项
userMap
:
new
Map
(),
//所有用户缓存;
departmentsMap
:
new
Map
(),
//部门缓存;
userInfo
:
{
userId
:
0
,
userName
:
""
},
messages
:
[],
departments
:
{},
//部门列表
cart
:
[],
collect
:
[],
//用户收藏
count
:
0
,
countAps
:
0
,
//aps排产
countAi
:
0
,
//智能排产
countAll
:
0
,
//整机排产
countRun
:
0
,
//流水排产
})
export
const
getters
=
{
dictionaryByKey
:
(
state
)
=>
(
key
)
=>
{
let
result
=
[];
let
items
=
state
.
dictionary
.
get
(
key
);
if
(
items
)
{
// console.info("items",items)
return
items
;
}
return
result
;
},
dictionaryByCode
:
(
state
)
=>
(
key
,
code
)
=>
{
let
result
=
null
;
let
items
=
state
.
dictionary
.
get
(
key
);
if
(
items
)
{
// console.info("items",items)
return
items
.
filter
(
u
=>
{
return
u
.
code
==
code
})[
0
];
}
return
result
;
},
getUser
:
(
state
)
=>
key
=>
{
// debugger
if
(
state
.
userMap
&&
state
.
userMap
.
get
)
{
return
state
.
userMap
.
get
(
key
);
}
},
getDepartment
:
(
state
)
=>
(
key
)
=>
{
let
items
=
state
.
departmentsMap
.
get
(
key
);
if
(
items
)
{
return
items
;
}
},
dictionaryByKey
:
(
state
)
=>
(
key
)
=>
{
let
result
=
[];
if
(
state
&&
state
.
dictionary
)
{
let
items
=
state
.
dictionary
.
get
(
key
);
if
(
items
)
{
// console.info("items",items)
return
items
;
}
}
return
result
;
},
dictionaryByCode
:
(
state
)
=>
(
key
,
code
)
=>
{
let
result
=
null
;
let
items
=
state
.
dictionary
.
get
(
key
);
if
(
items
)
{
// console.info("items",items)
return
items
.
filter
(
u
=>
{
return
u
.
code
==
code
})[
0
];
}
return
result
;
},
getUser
:
(
state
)
=>
key
=>
{
// debugger
if
(
state
.
userMap
&&
state
.
userMap
.
get
)
{
return
state
.
userMap
.
get
(
key
);
}
},
getDepartment
:
(
state
)
=>
(
key
)
=>
{
let
items
=
state
.
departmentsMap
.
get
(
key
);
if
(
items
)
{
return
items
;
}
},
}
export
const
mutations
=
{
increment
(
state
)
{
state
.
counter
++
},
setUserInfo
(
state
,
userInfo
)
{
state
.
userInfo
=
userInfo
;
// sessionStorage.setItem("userInfo", JSON.stringify(userInfo));
// sessionStorage.setItem("token", userInfo.token);
},
setUsers
(
state
,
users
)
{
state
.
userMap
=
users
;
},
addUser
(
state
,
user
)
{
state
.
userMap
.
push
(
user
);
},
setCollect
(
state
,
collectData
)
{
state
.
collect
=
collectData
;
},
setDictionary
(
state
,
dictionary
)
{
state
.
dictionary
=
dictionary
;
},
setCart
(
state
,
cart
)
{
state
.
cart
=
cart
;
},
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
;
},
setDepartments
(
state
,
departmentsMap
)
{
state
.
departmentsMap
=
departmentsMap
;
},
setMessages
(
state
,
list
){
state
.
messages
=
list
;
}
increment
(
state
)
{
state
.
counter
++
},
setUserInfo
(
state
,
userInfo
)
{
state
.
userInfo
=
userInfo
;
// sessionStorage.setItem("userInfo", JSON.stringify(userInfo));
// sessionStorage.setItem("token", userInfo.token);
},
setUsers
(
state
,
users
)
{
state
.
userMap
=
users
;
},
addUser
(
state
,
user
)
{
state
.
userMap
.
push
(
user
);
},
setCollect
(
state
,
collectData
)
{
state
.
collect
=
collectData
;
},
setDictionary
(
state
,
dictionary
)
{
state
.
dictionary
=
dictionary
;
},
setCart
(
state
,
cart
)
{
state
.
cart
=
cart
;
},
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
;
},
setDepartments
(
state
,
departmentsMap
)
{
state
.
departmentsMap
=
departmentsMap
;
},
setMessages
(
state
,
list
)
{
state
.
messages
=
list
;
}
}
export
const
actions
=
{
async
loadMessages
({
commit
}){
let
{
result
}
=
await
Api
.
get
(
`
${
systemUrl
}
/usermessage/getusermesssage`
,
{
status
:
0
,
userId
:
this
.
state
.
userInfo
.
userId
});
// console.warn("getusermesssage---", result)
commit
(
"setMessages"
,
result
);
// let data=Mock.mock({
// "result|1-30":[{
// id:"@guid",
// title:"@csentence",
// content:"@cparagraph(2,8)",
// read:"@boolean",
// time:"@datetime"
// }]
// })
// commit("setMessages", data.result);
},
async
collectList
({
commit
})
{
async
loadMessages
({
commit
})
{
let
{
result
}
=
await
Api
.
get
(
`
${
systemUrl
}
/usermessage/getusermesssage`
,
{
status
:
0
,
userId
:
this
.
state
.
userInfo
.
userId
});
// console.warn("getusermesssage---", result)
commit
(
"setMessages"
,
result
);
// let data=Mock.mock({
// "result|1-30":[{
// id:"@guid",
// title:"@csentence",
// content:"@cparagraph(2,8)",
// read:"@boolean",
// time:"@datetime"
// }]
// })
// commit("setMessages", data.result);
},
async
collectList
({
commit
})
{
let
{
result
}
=
await
Api
.
post
(
`
${
systemUrl
}
/favorite/listbyuser`
);
// console.warn("result---", result)
commit
(
"setCollect"
,
result
);
},
async
loadUser
({
commit
},
key
)
{
let
{
result
}
=
await
Api
.
post
(
`
${
systemUrl
}
/favorite/listbyuser`
);
// console.warn("result---", result)
commit
(
"setCollect"
,
result
);
},
async
loadUser
({
commit
},
key
)
{
let
{
result
}
=
await
Api
.
get
(
`
${
systemUrl
}
/user/getuser`
,
{
id
:
key
});
// console.warn("result", result)
commit
(
"addUser"
,
result
);
},
async
loadUsers
({
commit
})
{
let
{
result
}
=
await
Api
.
get
(
`
${
systemUrl
}
/user/getuserlist`
);
var
map
=
new
Map
();
result
.
map
(
u
=>
{
map
.
set
(
u
.
id
,
u
);
});
commit
(
"setUsers"
,
map
)
},
async
loadDictionary
({
commit
})
{
let
url
=
`
${
systemUrl
}
/Dictionary/GetAll`
let
{
result
}
=
await
Api
.
get
(
url
);
var
map
=
new
Map
();
let
{
result
}
=
await
Api
.
get
(
`
${
systemUrl
}
/user/getuser`
,
{
id
:
key
});
// console.warn("result", result)
commit
(
"addUser"
,
result
);
},
async
loadUsers
({
commit
})
{
let
{
result
}
=
await
Api
.
get
(
`
${
systemUrl
}
/user/getuserlist`
);
var
map
=
new
Map
();
result
.
map
(
u
=>
{
map
.
set
(
u
.
id
,
u
);
});
commit
(
"setUsers"
,
map
)
},
async
loadDictionary
({
commit
})
{
let
url
=
`
${
systemUrl
}
/Dictionary/GetAll`
let
{
result
}
=
await
Api
.
get
(
url
);
var
map
=
new
Map
();
for
(
const
key
in
result
)
{
if
(
result
.
hasOwnProperty
(
key
))
{
map
.
set
(
key
,
result
[
key
])
}
}
commit
(
"setDictionary"
,
map
);
for
(
const
key
in
result
)
{
if
(
result
.
hasOwnProperty
(
key
))
{
map
.
set
(
key
,
result
[
key
])
}
}
commit
(
"setDictionary"
,
map
);
let
r
=
await
Api
.
get
(
`
${
systemUrl
}
/user/getuserlist`
);
var
umap
=
new
Map
();
r
.
result
.
map
(
u
=>
{
umap
.
set
(
u
.
id
,
u
);
});
commit
(
"setUsers"
,
umap
);
},
async
loadDepartments
({
commit
})
{
let
rdep
=
await
Api
.
get
(
`
${
systemUrl
}
/department/getplantdepartments`
);
var
mapDep
=
new
Map
();
rdep
.
result
.
items
.
map
(
u
=>
{
mapDep
.
set
(
u
.
id
,
u
);
});
commit
(
"setDepartments"
,
mapDep
);
},
let
r
=
await
Api
.
get
(
`
${
systemUrl
}
/user/getuserlist`
);
var
umap
=
new
Map
();
r
.
result
.
map
(
u
=>
{
umap
.
set
(
u
.
id
,
u
);
});
commit
(
"setUsers"
,
umap
);
},
async
loadDepartments
({
commit
})
{
let
rdep
=
await
Api
.
get
(
`
${
systemUrl
}
/department/getplantdepartments`
);
var
mapDep
=
new
Map
();
rdep
.
result
.
items
.
map
(
u
=>
{
mapDep
.
set
(
u
.
id
,
u
);
});
commit
(
"setDepartments"
,
mapDep
);
},
}
export
const
plugins
=
[
createVuexAlong
({
// 设置保存的集合名字,避免同站点下的多项目数据冲突
name
:
"hyhmes"
,
local
:
{
list
:
[
"hyhmes"
],
// 过滤模块 ma 数据, 将其他的存入 localStorage
isFilter
:
true
,
},
session
:
{
// 保存模块 ma 中的 a1 到 sessionStorage
list
:
[
"hyhmes.session"
],
},
}),
]
//设置 strict 为不严格模式,即可在actions中修改state
export
const
strict
=
false
;
createVuexAlong
({
// 设置保存的集合名字,避免同站点下的多项目数据冲突
name
:
"hyhmes"
,
local
:
{
list
:
[
"hyhmes"
],
// 过滤模块 ma 数据, 将其他的存入 localStorage
isFilter
:
true
,
},
session
:
{
// 保存模块 ma 中的 a1 到 sessionStorage
list
:
[
"hyhmes.session"
],
},
}),
]
//设置 strict 为不严格模式,即可在actions中修改state
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