Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
template_vue
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
胡宝山
template_vue
Commits
eeed2ff2
Commit
eeed2ff2
authored
Jul 29, 2023
by
kzy
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'project1' of
http://gitlab.91isoft.com:90/yangshuo/template_vue
into project1
parents
a42e3281
f93e5086
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
1633 additions
and
843 deletions
+1633
-843
draw.js
src/api/equipment/draw.js
+95
-0
InventoryRecord.js
src/api/processLibrary/InventoryRecord.js
+1
-0
basicInformation.js
src/api/sample/basicInformation.js
+38
-0
index.vue
src/components/Table/BaseTable/index.vue
+6
-46
permission.js
src/permission.js
+1
-1
user.js
src/store/modules/user.js
+1
-1
basicInfo.vue
src/views/equipment/basicInfo.vue
+63
-105
boundManagement.vue
src/views/equipment/boundManagement.vue
+16
-18
draw.vue
src/views/equipment/draw.vue
+371
-305
management.vue
src/views/equipment/management.vue
+16
-18
index.vue
src/views/processManagement/basicProcessManagement/index.vue
+16
-18
draw.vue
src/views/processManagement/draw.vue
+583
-0
index.vue
src/views/processManagement/inventoryRecord/index.vue
+316
-296
index.vue
src/views/sample/basicInformation/index.vue
+106
-31
index.vue
src/views/system/user/index.vue
+4
-4
No files found.
src/api/equipment/draw.js
0 → 100644
View file @
eeed2ff2
import
request
from
'@/utils/request'
import
Qs
from
'qs'
// 查询基础信息列表
export
function
listWbApply
(
query
)
{
return
request
({
url
:
'/wbapply/queryWbApplyByPagination'
,
method
:
'get'
,
params
:
query
})
}
export
function
getlistRole
()
{
return
request
({
url
:
'system/role/listAll'
,
method
:
'get'
})
}
// 查询角色详细
export
function
getRole
(
businessId
)
{
return
request
({
url
:
'/system/role/detail/'
+
businessId
,
method
:
'get'
})
}
// 新增角色
export
function
addRole
(
data
)
{
data
=
Qs
.
stringify
(
data
)
return
request
({
url
:
'/system/role/add'
,
method
:
'post'
,
data
:
data
,
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
})
}
// 修改角色
export
function
updateRole
(
data
)
{
const
businessId
=
data
.
businessId
data
=
Qs
.
stringify
(
data
)
return
request
({
url
:
'/system/role/update/'
+
businessId
,
method
:
'put'
,
data
,
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
})
}
// 角色数据权限
export
function
dataScope
(
data
)
{
data
=
Qs
.
stringify
(
data
)
return
request
({
url
:
'/system/role/dataScope'
,
method
:
'put'
,
data
,
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
})
}
// 角色状态修改
export
function
changeRoleStatus
(
businessId
,
flag
)
{
const
data
=
{
businessId
,
flag
}
return
request
({
url
:
'/system/role/changeStatus'
,
method
:
'put'
,
params
:
data
})
}
// 删除角色
export
function
delRole
(
roleId
)
{
return
request
({
url
:
'/system/role/deleteLogical/'
+
roleId
,
method
:
'delete'
})
}
// 导出角色
export
function
exportRole
(
query
)
{
return
request
({
url
:
'/system/role/export'
,
method
:
'get'
,
params
:
query
,
responseType
:
'blob'
})
}
src/api/processLibrary/InventoryRecord.js
View file @
eeed2ff2
import
request
from
'@/utils/request'
export
function
listLog
(
queryParams
)
{
console
.
log
(
'this is date:'
,
queryParams
.
dateRange
)
return
request
({
url
:
'/wbwarehouselog/queryWbWarehouseLogByPagination'
,
method
:
'get'
,
...
...
src/api/sample/basicInformation.js
View file @
eeed2ff2
...
...
@@ -8,3 +8,41 @@ export function queryList(params) {
params
})
}
// 添加基础信息接口
export
function
add
(
data
)
{
return
request
({
url
:
'/wbchemistrybaseinfo/add'
,
method
:
'post'
,
data
,
headers
:
{
'Content-Type'
:
'application/json;charset=UTF-8'
}
})
}
// 根据id查询基础信息接口
export
function
getDetailById
(
id
)
{
return
request
({
url
:
'/wbchemistrybaseinfo/detail/'
+
id
,
method
:
'get'
})
}
// 编辑基础信息接口
export
function
updataInfo
(
data
)
{
return
request
({
url
:
'/wbchemistrybaseinfo/update'
,
method
:
'put'
,
data
,
headers
:
{
'Content-Type'
:
'application/json;charset=UTF-8'
}
})
}
// 逻辑删除基础信息接口
export
function
deleteLogical
(
id
)
{
return
request
({
url
:
'/wbchemistrybaseinfo/deleteLogical/'
+
id
,
method
:
'delete'
})
}
src/components/Table/BaseTable/index.vue
View file @
eeed2ff2
<
template
>
<div>
<div
style=
"padding:5px 10px"
>
<div
class=
"mb12 font-small-bold"
>
{{
allTableArguments
.
listName
}}
</div>
<div
class=
"tableList"
style=
"height:600px;"
>
<div
class=
"tableList"
style=
"
height:600px;"
>
<el-scrollbar
style=
"height: 100%;"
>
<el-table
v-loading=
"allTableArguments.loading"
...
...
@@ -11,46 +11,6 @@
style=
"width: 100%"
@
selection-change=
"handleSelectionChange"
>
<!--
<el-table-column
type=
"index"
label=
"序号"
width=
"50"
:index=
"allTableArguments.nIndex"
/>
-->
<!--
<el-table-column
label=
"工序名称"
prop=
"processName"
:show-overflow-tooltip=
"true"
>
-->
<!--
<template
slot-scope=
"scope"
>
-->
<!--
{{
scope
.
row
.
processName
||
'-'
}}
-->
<!--
</
template
>
-->
<!-- </el-table-column>-->
<!-- <el-table-column label="生产车间" prop="workshop">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.workshop || '-' }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="操作时间" :show-overflow-tooltip="true" align="center" prop="createTime">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ scope.row.createTime | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="操作人" prop="createBy" width="210px">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.createBy || '-' }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column-->
<!-- label="操作"-->
<!-- class-name="small-padding fixed-width"-->
<!-- width="180px"-->
<!-- >-->
<!-- <template slot-scope="scope">-->
<!-- <div class="processListBtns">-->
<!-- <el-button :type="typeParent" :size="size" @click="handleDetail(scope.row)">-->
<!-- 详情-->
<!-- </el-button>-->
<!-- <el-button :type="typeParent" :size="size" @click="handleUpdate(scope.row)">-->
<!-- 修改-->
<!-- </el-button>-->
<!-- <el-button :type="typeParent" :size="size" @click="handleDelete(scope.row)">-->
<!-- 删除-->
<!-- </el-button>-->
<!-- </div>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
type=
"index"
label=
"序号"
width=
"50"
:index=
"allTableArguments.nIndex"
/>
...
...
@@ -100,14 +60,14 @@
<!-- 操作按钮 -->
<span
v-if=
"column.isOperation"
class=
"processListBtns"
>
<span
v-for=
"(operations, index) in column.operation"
:key=
"index"
>
<el-button
v-if=
"operations.isShow(row,$index)"
:icon=
"operations.icon"
:type=
"typeParent"
:style=
"
{color:operations.color}" :size="size" @click="operations.buttonClick(row,$index)">
{{
operations
.
label
}}
</el-button>
<el-button
v-if=
" operations.clickType === '1' "
:icon=
"operations.icon"
:type=
"typeParent"
:style=
"
{color:operations.color}" :size="size" @click="handleDetail">
{{
operations
.
label
}}
</el-button>
<el-button
v-else-if=
" operations.clickType === '2' "
:icon=
"operations.icon"
:type=
"typeParent"
:style=
"
{color:operations.color}" :size="size" @click="handleUpdate">
{{
operations
.
label
}}
</el-button>
<el-button
v-else-if=
" operations.clickType === '3' "
:icon=
"operations.icon"
:type=
"typeParent"
:style=
"
{color:operations.color}" :size="size" @click="handleDelete">
{{
operations
.
label
}}
</el-button>
</span>
</span>
</
template
>
</el-table-column>
</el-table>
</el-scrollbar>
<div
/>
</div>
...
...
@@ -171,7 +131,7 @@ export default {
/* TODO: 这里是控制内容列表的样式 */
.processListBtns
{
.el-button
{
margin
:
0
7
px
;
margin
:
0
12
px
;
}
}
...
...
src/permission.js
View file @
eeed2ff2
...
...
@@ -24,7 +24,7 @@ router.beforeEach((to, from, next) => {
store
.
dispatch
(
'GetInfo'
).
then
(
res
=>
{
// 判断用户是否有权限 有角色
if
(
res
.
data
.
roles
&&
res
.
data
.
roles
.
length
>
0
&&
res
.
data
.
permissions
&&
res
.
data
.
permissions
.
length
>
0
)
{
if
(
res
.
data
.
permissions
&&
res
.
data
.
permissions
.
length
>
0
)
{
// 拉取user_info
const
roles
=
res
.
data
.
roles
store
.
dispatch
(
'GenerateRoutes'
,
{
roles
}).
then
((
routers
)
=>
{
...
...
src/store/modules/user.js
View file @
eeed2ff2
...
...
@@ -61,10 +61,10 @@ const user = {
const
avatar
=
user
.
avatar
===
null
?
require
(
'@/assets/image/profile.jpg'
)
:
user
.
avatar
if
(
res
.
data
.
roles
&&
res
.
data
.
roles
.
length
>
0
)
{
// 验证返回的roles是否是一个非空数组
commit
(
'SET_ROLES'
,
res
.
data
.
roles
)
commit
(
'SET_PERMISSIONS'
,
res
.
data
.
permissions
)
}
else
{
commit
(
'SET_ROLES'
,
[
'ROLE_DEFAULT'
])
}
commit
(
'SET_PERMISSIONS'
,
res
.
data
.
permissions
)
commit
(
'SET_NAME'
,
user
.
username
)
commit
(
'SET_SPECIALTAG'
,
user
.
specialTag
)
commit
(
'SET_AVATAR'
,
avatar
)
...
...
src/views/equipment/basicInfo.vue
View file @
eeed2ff2
<
template
>
<div
class=
"app-container"
>
<el-form
ref=
"queryForm"
style=
"padding: 0 0 0 10px"
:model=
"queryParams"
:inline=
"true"
>
<el-form-item
label=
"pn"
prop=
"p
gx
"
>
<el-form-item
label=
"pn"
prop=
"p
n
"
>
<el-input
v-model=
"queryParams.pn"
placeholder=
"请输入pn"
...
...
@@ -25,36 +25,31 @@
<el-form-item
label=
"pgx"
prop=
"pgx"
>
<el-input
v-model=
"queryParams.pgx"
placeholder=
"请输入p
type
"
placeholder=
"请输入p
gx
"
clearable
size=
"small"
style=
"width: 150px"
@
keyup
.
enter
.
native=
"handleQuery"
/>
<el-form-item>
<el-button
type=
"primary"
size=
"small"
@
click=
"handleQuery"
>
查询
</el-button>
</el-form-item>
<div
style=
"float: right"
>
<el-form-item>
<el-button
type=
"primary"
size=
"small"
@
click=
"handleAdd"
>
新增
</el-button>
<el-button
style=
"padding: 8px 7px;"
type=
"success"
size=
"small"
icon=
"el-icon-download"
@
click=
"handleExport"
>
导出
</el-button>
</el-form-item>
</div>
</el-form-item></el-form>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
style=
"padding: 8px 7px;"
icon=
"el-icon-search"
size=
"small"
@
click=
"handleQuery"
>
查询
</el-button>
<el-button
type=
"primary"
style=
"padding: 8px 7px;"
icon=
"el-icon-refresh"
size=
"small"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
<div
style=
"float: right;padding:3px 15px;"
>
<el-button
style=
"padding: 8px 7px;"
type=
"primary"
size=
"small"
icon=
"el-icon-plus"
@
click=
"handleAdd"
>
新增
</el-button>
</div>
</el-form>
<div
class=
"placeholder"
/>
<div
style=
"padding:5px 10px"
>
<div
class=
"mb12 font-small-bold"
>
设备基本信息列表
</div>
<el-table
v-loading=
"loading"
border
:data=
"basicInfoList"
@
selection-change=
"handleSelectionChange"
>
<el-table
v-loading=
"loading"
border
:data=
"basicInfoList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"50"
/>
<el-table-column
label=
"pn"
prop=
"pn"
>
<template
slot-scope=
"scope"
>
...
...
@@ -96,12 +91,12 @@
{{
scope
.
row
.
createBy
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"操作时间"
:show-overflow-tooltip=
"true"
align=
"center"
prop=
"createTime"
>
<el-table-column
label=
"操作时间"
:show-overflow-tooltip=
"true"
align=
"center"
prop=
"createTime"
width=
"200px"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
createTime
|
transformDateByFormat
(
'YYYY-MM-DD HH:mm'
)
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
class-name=
"small-padding fixed-width"
width=
"
24
0px"
>
<el-table-column
label=
"操作"
class-name=
"small-padding fixed-width"
width=
"
15
0px"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
...
...
@@ -140,10 +135,23 @@
<el-input-number
v-model=
"form.pgx"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入pgx"
/>
</el-form-item>
<el-form-item
label=
"prank"
prop=
"prank"
>
<el-input-number
v-model=
"form.p
gx
"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入prank"
/>
<el-input-number
v-model=
"form.p
rank
"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入prank"
/>
</el-form-item>
<el-form-item
label=
"pissb"
prop=
"pissb"
>
<el-input-number
v-model=
"form.pissb"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入pissb"
/>
<el-select
v-model=
"form.pissb"
placeholder=
"请选择pissb"
clearable
size=
"small"
style=
"width: 150px"
>
<el-option
v-for=
"dict in statusOptions"
:key=
"dict.dictValue"
:label=
"dict.dictLabel"
:value=
"dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"psm"
prop=
"psm"
>
<el-input-number
v-model=
"form.psm"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入psm"
/>
...
...
@@ -151,9 +159,6 @@
<el-form-item
label=
"psy"
prop=
"psy"
>
<el-input-number
v-model=
"form.psy"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入psy"
/>
</el-form-item>
<el-form-item
label=
"备注"
>
<el-input
v-model
.
trim=
"form.remark"
maxlength=
"200"
show-word-limit
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
...
...
@@ -211,11 +216,11 @@ export default {
// 状态数据字典
statusOptions
:
[
{
dictLabel
:
'
启用
'
,
dictLabel
:
'
是
'
,
dictValue
:
'1'
},
{
dictLabel
:
'
停用
'
,
dictLabel
:
'
否
'
,
dictValue
:
'0'
}
],
...
...
@@ -242,17 +247,15 @@ export default {
label
:
'仅本人数据权限'
}
],
// 菜单列表
menuOptions
:
[],
// 部门列表
tOptions
:
[],
// 查询参数
queryParams
:
{
page
:
1
,
rows
:
10
,
roleName
:
undefined
,
roleKey
:
undefined
,
flag
:
undefined
pn
:
undefined
,
ptype
:
undefined
,
pgx
:
undefined
},
// 表单参数
form
:
{},
...
...
@@ -262,14 +265,26 @@ export default {
},
// 表单校验
rules
:
{
roleName
:
[
{
required
:
true
,
message
:
'请输入角色名称'
,
trigger
:
'blur'
}
pn
:
[
{
required
:
true
,
message
:
'请输入pn'
,
trigger
:
'blur'
}
],
ptype
:
[
{
required
:
true
,
message
:
'请输入ptype'
,
trigger
:
'blur'
}
],
pgx
:
[
{
required
:
true
,
message
:
'请输入pgx'
,
trigger
:
'blur'
}
],
prank
:
[
{
required
:
true
,
message
:
'请输入prank'
,
trigger
:
'blur'
}
],
roleKey
:
[
{
required
:
true
,
message
:
'请输入
权限字符
'
,
trigger
:
'blur'
}
pissb
:
[
{
required
:
true
,
message
:
'请输入
pissb
'
,
trigger
:
'blur'
}
],
roleSort
:
[
{
required
:
true
,
message
:
'请输入角色排序'
,
trigger
:
'blur'
}
psm
:
[
{
required
:
true
,
message
:
'请输入psm'
,
trigger
:
'blur'
}
],
psy
:
[
{
required
:
true
,
message
:
'请输入psy'
,
trigger
:
'blur'
}
]
},
deptOptions
:
[]
...
...
@@ -399,9 +414,9 @@ export default {
this
.
deptExpand
=
true
this
.
deptNodeAll
=
false
this
.
form
=
{
roleId
:
undefined
,
businessId
:
undefined
,
roleName
:
undefined
,
pn
:
undefined
,
ptype
:
undefined
,
pgx
:
undefined
,
roleKey
:
undefined
,
roleSort
:
0
,
flag
:
undefined
,
...
...
@@ -485,38 +500,13 @@ export default {
this
.
title
=
'修改角色'
})
},
/** 分配数据权限操作 选择菜单 */
handleMenu
(
row
)
{
this
.
reset
()
const
roleId
=
row
.
businessId
||
this
.
ids
this
.
getMenuList
(
roleId
)
// 查询菜单列表树形显示
getRole
(
roleId
).
then
(
response
=>
{
this
.
form
=
response
.
data
this
.
openDataScope
=
true
this
.
title
=
'分配数据权限'
})
},
/** 分配数据权限操作 */
handleDataScope
(
row
)
{
this
.
deptOptions
=
[]
this
.
form
.
dataScope
=
undefined
const
roleId
=
this
.
form
.
businessId
this
.
form
.
menuId
=
row
.
businessId
this
.
form
.
menuName
=
row
.
menuName
const
roleDeptTreeselect
=
this
.
getRoleDeptTreeselect
(
roleId
,
this
.
form
.
menuId
)
this
.
$nextTick
(()
=>
{
roleDeptTreeselect
.
then
(
res
=>
{
this
.
$refs
.
dept
.
setCheckedKeys
(
res
.
data
.
checkedKeys
)
})
})
this
.
title
=
'分配数据权限'
},
/** 提交按钮 */
submitForm
:
function
()
{
this
.
$refs
[
'form'
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
businessId
!==
undefined
)
{
this
.
form
.
menuIds
=
this
.
getMenuAllCheckedKeys
()
// eslint-disable-next-line no-undef
updateBasicInfo
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
'修改成功'
)
this
.
open
=
false
...
...
@@ -524,6 +514,7 @@ export default {
})
}
else
{
this
.
form
.
menuIds
=
this
.
getMenuAllCheckedKeys
()
// eslint-disable-next-line no-undef
addBasicInfo
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
'新增成功'
)
this
.
open
=
false
...
...
@@ -533,17 +524,6 @@ export default {
}
})
},
/** 提交按钮(数据权限) */
submitDataScope
:
function
()
{
if
(
this
.
form
.
businessId
!==
undefined
&&
this
.
form
.
menuId
!==
undefined
)
{
this
.
form
.
deptIds
=
this
.
getDeptAllCheckedKeys
()
dataScope
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
'修改成功'
)
this
.
openDataScope
=
false
this
.
getList
()
})
}
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
roleIds
=
row
.
businessId
||
this
.
ids
...
...
@@ -561,28 +541,6 @@ export default {
})
}).
catch
(
function
()
{
})
},
/** 导出按钮操作 */
handleExport
()
{
const
queryParams
=
this
.
queryParams
this
.
$confirm
(
'是否确认导出所有用户信息?'
,
'警告'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(
function
()
{
return
exportRole
(
queryParams
).
then
(
response
=>
{
const
blob
=
new
Blob
([
response
])
const
downloadElement
=
document
.
createElement
(
'a'
)
const
href
=
window
.
URL
.
createObjectURL
(
blob
)
// 创建下载的链接
downloadElement
.
href
=
href
downloadElement
.
download
=
'角色信息'
+
'.xls'
// 下载后文件名
document
.
body
.
appendChild
(
downloadElement
)
downloadElement
.
click
()
// 点击下载
document
.
body
.
removeChild
(
downloadElement
)
// 下载完成移除元素
window
.
URL
.
revokeObjectURL
(
href
)
// 释放掉blob对象
// this.download(response.msg);
})
})
}
}
}
...
...
src/views/equipment/boundManagement.vue
View file @
eeed2ff2
...
...
@@ -152,7 +152,6 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"plocation:"
prop=
"plocation"
>
...
...
@@ -160,21 +159,8 @@
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
" 操作时间:"
prop=
"createDate"
>
<el-input
v-model
.
trim=
"singleDetails.createDate"
:readonly=
"true"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"操作员:"
prop=
"createName"
>
<el-input
v-model
.
trim=
"singleDetails.createName"
:readonly=
"true"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"prank:"
prop=
"prank"
>
<el-input
v-model
.
trim=
"singleDetails.prank"
:readonly=
"true"
/>
<el-form-item
label=
"厚度:"
prop=
"phd"
>
<el-input
v-model
.
trim=
"singleDetails.phd"
:readonly=
"true"
/>
</el-form-item>
</el-col>
</el-row>
...
...
@@ -190,10 +176,22 @@
</el-form-item>
</el-col>
</el-row>
<el-form-item
label=
"
厚度:"
prop=
"phd
"
>
<el-input
v-model
.
trim=
"singleDetails.p
hd
"
:readonly=
"true"
/>
<el-form-item
label=
"
parnk:"
prop=
"prank
"
>
<el-input
v-model
.
trim=
"singleDetails.p
rank
"
:readonly=
"true"
/>
</el-form-item>
</el-form>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"操作员:"
prop=
"createName"
>
<el-input
v-model
.
trim=
"singleDetails.createName"
:readonly=
"true"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
" 操作时间:"
prop=
"createDate"
>
<el-input
v-model
.
trim=
"singleDetails.createDate"
:readonly=
"true"
/>
</el-form-item>
</el-col>
</el-row>
</el-dialog>
</div>
</template>
...
...
src/views/equipment/draw.vue
View file @
eeed2ff2
<
template
>
<div
class=
"app-container"
>
<!-- TODO: 基础设备管理-->
<el-form
ref=
"queryForm"
style=
"padding: 0 0 0 10px"
:model=
"queryParams"
:inline=
"true"
>
<el-form-item
label=
"
设备名称"
prop=
"roleName
"
>
<el-form-item
label=
"
pn"
prop=
"pn
"
>
<el-input
v-model=
"queryParams.
deviceName
"
placeholder=
"请输入
设备名称
"
v-model=
"queryParams.
pn
"
placeholder=
"请输入
pn
"
clearable
:maxlength=
"30"
size=
"small"
...
...
@@ -14,10 +12,20 @@
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"设备编码"
prop=
"roleKey"
>
<el-form-item
label=
"phd"
prop=
"phd"
>
<el-input
v-model=
"queryParams.phd"
placeholder=
"请输入phd"
clearable
size=
"small"
style=
"width: 150px"
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"prank"
prop=
"prank"
>
<el-input
v-model=
"queryParams.
deviceId
"
placeholder=
"请输入
设备编码
"
v-model=
"queryParams.
prank
"
placeholder=
"请输入
prank
"
clearable
size=
"small"
style=
"width: 150px"
...
...
@@ -25,110 +33,128 @@
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
size=
"small"
icon=
"el-icon-search"
@
click=
"handleQuery"
>
查询
</el-button>
<el-button
type=
"primary"
style=
"padding: 8px 7px;"
icon=
"el-icon-search"
size=
"small"
@
click=
"handleQuery"
>
查询
</el-button>
<el-button
type=
"primary"
style=
"padding: 8px 7px;"
icon=
"el-icon-refresh"
size=
"small"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
<div
style=
"float: right"
>
<el-form-item>
<el-button
style=
"padding: 8px 7px;"
:type=
"typePrimary"
:size=
"smallSize"
:icon=
"addIcon"
@
click=
"handleAdd"
>
{{
application
}}
</el-button>
</el-form-item>
</div>
</el-form>
<div
class=
"placeholder"
/>
<!-- TODO: 中间的分隔符号 -->
<div
style=
"padding:5px 10px"
>
<!-- TODO: 以下为基础设备管理列表 -->
<div
class=
"mb12 font-small-bold"
>
设备领用列表
</div>
<el-table
v-loading=
"loading"
border
:data=
"roleList"
@
selection-change=
"handleSelectionChange"
>
<div
class=
"mb12 font-small-bold"
>
设备领用信息列表
</div>
<el-table
v-loading=
"loading"
border
:data=
"equipmentapplyList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"50"
/>
<
!--
<el-table-column
label=
"设备名称"
prop=
"deviceName"
:show-overflow-tooltip=
"true
"
>
<
el-table-column
label=
"pn"
prop=
"pn
"
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
deviceName
||
'-'
}}
{{
scope
.
row
.
pn
||
'-'
}}
</
template
>
</el-table-column>
-->
<el-table-column
label=
"
设备编码"
prop=
"deviceId
"
>
</el-table-column>
<el-table-column
label=
"
phd"
prop=
"phd"
:show-overflow-tooltip=
"true
"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
deviceI
d
||
'-'
}}
{{
scope
.
row
.
ph
d
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"
LOT"
prop=
"LOT
"
>
<el-table-column
label=
"
prank"
prop=
"prank
"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
deviceId
||
'-'
}}
{{
scope
.
row
.
prank
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"
位置"
prop=
"location
"
>
<el-table-column
label=
"
pgx"
prop=
"pgx
"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
location
||
'-'
}}
{{
scope
.
row
.
pgx
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"
厚度"
prop=
"ply
"
>
<el-table-column
label=
"
pissb"
prop=
"pissb
"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
p
ly
||
'-'
}}
{{
scope
.
row
.
p
issb
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"
操作员"
prop=
"createBy
"
>
<el-table-column
label=
"
pstatus"
prop=
"pstatus
"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
createBy
||
'-'
}}
{{
scope
.
row
.
pstatus
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"
创建时间"
:show-overflow-tooltip=
"true"
align=
"center"
prop=
"createTim
e"
>
<el-table-column
label=
"
ptype"
prop=
"ptyp
e"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
createTime
|
transformDateByFormat
(
'YYYY-MM-DD HH:mm'
)
}}
</span>
{{
scope
.
row
.
ptype
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"状态"
prop=
"pstatus"
>
<
template
slot-scope=
"scope"
>
<span
v-if=
"scope.row.pstatus === '0'"
style=
"color: red"
>
未完成
</span>
<span
v-else
style=
"color: green"
>
已完成
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"操作员"
prop=
"createBy"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
createBy
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"
状态"
prop=
"state
"
>
<el-table-column
label=
"
操作时间"
:show-overflow-tooltip=
"true"
align=
"center"
prop=
"createTime"
width=
"200px
"
>
<
template
slot-scope=
"scope"
>
<span
:style=
"getFontColor(scope.row.state)"
>
{{
scope
.
row
.
state
||
'-'
}}
</span>
<span
>
{{
scope
.
row
.
createTime
|
transformDateByFormat
(
'YYYY-MM-DD HH:mm'
)
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
class-name=
"small-padding fixed-width"
width=
"1
4
0px"
>
<el-table-column
label=
"操作"
class-name=
"small-padding fixed-width"
width=
"1
5
0px"
>
<
template
slot-scope=
"scope"
>
<el-button
v-if=
"scope.row.state !== '已驳回'"
:type=
"typeParent"
:size=
"size"
@
click=
"handleDetail(scope.row)"
>
详情
</el-button>
<el-button
v-if=
"scope.row.state === '已驳回'"
:type=
"typeParent"
:size=
"size"
@
click=
"handleUpdate(scope.row)"
>
{{
updataName
}}
</el-button>
<el-button
v-if=
"scope.row.state !== ' '"
:type=
"typeParent"
:size=
"size"
size=
"mini"
type=
"text"
style=
"color: #49cec9"
@
click=
"handleUpdate(scope.row)"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
</div>
<el-pagination
background
layout=
"prev, pager, next"
:total=
"1000"
<pagination
v-show=
"total>0"
:total=
"total"
:page
.
sync=
"queryParams.page"
:limit
.
sync=
"queryParams.rows"
@
pagination=
"getList"
/>
<!--
TODO: 添加或修改设备
配置对话框 -->
<el-dialog
:title=
"title
"
:visible
.
sync=
"open"
width=
"500px"
append-to-body
>
<!--
添加或修改设备基本信息
配置对话框 -->
<el-dialog
title=
"设备基本信息
"
:visible
.
sync=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
size=
"small"
label-width=
"80px"
>
<el-form-item
label=
"设备名称"
prop=
"deviceName"
>
<el-input
v-model
.
trim=
"form.deviceName"
show-word-limit
:maxlength=
"30"
placeholder=
"请输入设备名称"
/>
<el-form-item
label=
"pn"
prop=
"pn"
>
<el-input
v-model
.
trim=
"form.pn"
show-word-limit
:maxlength=
"30"
placeholder=
"请输入pn"
/>
</el-form-item>
<el-form-item
label=
"ptype"
prop=
"ptype"
>
<el-input
v-model
.
trim=
"form.ptype"
show-word-limit
:maxlength=
"30"
placeholder=
"请输入ptype"
/>
</el-form-item>
<el-form-item
label=
"
设备编码"
prop=
"deviceId
"
>
<el-input
v-model
.
trim=
"form.deviceId"
show-word-limit
:maxlength=
"30"
placeholder=
"请输入设备编码
"
/>
<el-form-item
label=
"
pgx"
prop=
"pgx
"
>
<el-input
-number
v-model=
"form.pgx"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入pgx
"
/>
</el-form-item>
<el-form-item
label=
"
LOT"
prop=
"LOT
"
>
<el-input
v-model
.
trim=
"form.LOT"
show-word-limit
:maxlength=
"30"
placeholder=
"请输入LOT
"
/>
<el-form-item
label=
"
prank"
prop=
"prank
"
>
<el-input
-number
v-model=
"form.prank"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入prank
"
/>
</el-form-item>
<el-form-item
label=
"位置"
prop=
"location"
>
<el-input
v-model
.
trim=
"form.location"
show-word-limit
:maxlength=
"30"
placeholder=
"请输入设备编码"
/>
<el-form-item
label=
"pissb"
prop=
"pissb"
>
<el-select
v-model=
"form.pissb"
placeholder=
"请选择pissb"
clearable
size=
"small"
style=
"width: 150px"
>
<el-option
v-for=
"dict in statusOptions"
:key=
"dict.dictValue"
:label=
"dict.dictLabel"
:value=
"dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"
厚度"
prop=
"ply
"
>
<el-input
v-model
.
trim=
"form.ply"
show-word-limit
:maxlength=
"30"
placeholder=
"请输入设备编码
"
/>
<el-form-item
label=
"
psm"
prop=
"psm
"
>
<el-input
-number
v-model=
"form.psm"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入psm
"
/>
</el-form-item>
<el-form-item
label=
"
操作员"
prop=
"createB
y"
>
<el-input
v-model
.
trim=
"form.createBy"
:maxlength=
"30"
show-word-limit
placeholder=
"请输入创建人
"
/>
<el-form-item
label=
"
psy"
prop=
"ps
y"
>
<el-input
-number
v-model=
"form.psy"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入psy
"
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
...
...
@@ -136,78 +162,47 @@
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
</div>
</el-dialog>
<!-- TODO: 单项详情信息表单配置 -->
<el-dialog
class=
"aboutSingleDetails"
:title=
"title"
:visible
.
sync=
"openDetails"
width=
"700px"
append-to-body
>
<el-form
ref=
"formDetails"
:model=
"singleDetails"
size=
"small"
label-width=
"90px"
>
<el-form-item
label=
"名称:"
prop=
"deviceName"
>
<el-input
v-model
.
trim=
"singleDetails.deviceName"
:readonly=
"isReadOnly"
/>
</el-form-item>
<el-form-item
label=
"设备编码:"
prop=
"deviceId"
>
<el-input
v-model
.
trim=
"singleDetails.deviceId"
:readonly=
"isReadOnly"
/>
</el-form-item>
<el-form-item
label=
"LOT: "
prop=
"LOT"
>
<el-input
v-model
.
trim=
"singleDetails.LOT"
:readonly=
"isReadOnly"
/>
</el-form-item>
<el-form-item
label=
"位置:"
prop=
"location"
>
<el-input
v-model
.
trim=
"singleDetails.location"
:readonly=
"isReadOnly"
/>
</el-form-item>
<el-form-item
label=
"位置:"
prop=
"ply"
>
<el-input
v-model
.
trim=
"singleDetails.ply"
:readonly=
"isReadOnly"
/>
</el-form-item>
<el-form-item
label=
"创建时间:"
prop=
"createTime"
>
<el-input
v-model
.
trim=
"singleDetails.createTime"
:readonly=
"isReadOnly"
/>
</el-form-item>
<el-form-item
label=
"创建人:"
prop=
"createBy"
>
<el-input
v-model
.
trim=
"singleDetails.createBy"
:readonly=
"isReadOnly"
/>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"state"
>
<el-input
v-model
.
trim=
"singleDetails.state"
:readonly=
"isReadOnly"
/>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<
script
>
// import {
// addRole,
// changeRoleStatus,
// dataScope,
// delRole,
// exportRole,
// getRole,
// listBasicInfo,
// updateRole
// } from '@/api/equipment/basicInfo'
import
{
roleMenuTreeselect
,
roleMenuTreeselectMC
,
treeselect
as
menuTreeselect
}
from
'@/api/system/menu'
import
{
roleDeptTreeselect
,
treeselect
as
deptTreeselect
}
from
'@/api/system/dept'
import
{
listBasicInfo
}
from
'@/api/equipment/basicInfo'
import
{
listWbApply
}
from
'@/api/equipment/draw'
// import { getRolesByInsId } from '../../../api/businessManage/template'
export
default
{
name
:
'Role'
,
data
()
{
return
{
typeParent
:
'text'
,
typePrimary
:
'primary'
,
typeSuccess
:
'success'
,
nameParent
:
'删除'
,
resetName
:
'重置'
,
addName
:
'新增'
,
application
:
'申请领用'
,
updataName
:
'修改'
,
size
:
'mini'
,
smallSize
:
'small'
,
delicon
:
'el-icon-delete'
,
addIcon
:
'el-icon-plus'
,
exportIcon
:
'el-icon-download'
,
resetIcon
:
''
,
// TODO: 控制只读
isReadOnly
:
true
,
// 遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 总条数
total
:
0
,
//
角色
表格数据
role
List
:
[],
//
设备申请
表格数据
equipmentapply
List
:
[],
// 弹出层标题
title
:
''
,
// 是否显示弹出层
open
:
false
,
// 是否显示弹出层(数据
详情
)
openD
etails
:
false
,
// 是否显示弹出层(数据
权限
)
openD
ataScope
:
false
,
// 日期范围
// dateRange: [],
// 菜单表格数据
...
...
@@ -216,97 +211,79 @@ export default {
menuNodeAll
:
false
,
deptExpand
:
true
,
deptNodeAll
:
false
,
// 状态数据字典
statusOptions
:
[
{
dictLabel
:
'是'
,
dictValue
:
'1'
},
{
dictLabel
:
'否'
,
dictValue
:
'0'
}
],
// 数据范围选项
dataScopeOptions
:
[
{
value
:
'1'
,
label
:
'全部数据权限'
},
{
value
:
'2'
,
label
:
'自定数据权限'
},
{
value
:
'3'
,
label
:
'本部门数据权限'
},
{
value
:
'4'
,
label
:
'本部门及以下数据权限'
},
{
value
:
'5'
,
label
:
'仅本人数据权限'
}
],
// 部门列表
tOptions
:
[],
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
deviceName
:
undefined
,
deviceId
:
undefined
,
LOT
:
undefined
,
location
:
undefined
,
ply
:
undefined
,
state
:
undefined
,
flag
:
undefined
},
defaultProps
:
{},
// TODO: 表单参数
form
:
{
deviceName
:
''
,
deviceId
:
''
,
LOT
:
''
,
location
:
''
,
ply
:
''
,
state
:
''
,
flag
:
'1'
,
remark
:
''
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
''
},
// TODO: 表单初始参数
formReset
:
{
deviceName
:
''
,
deviceId
:
''
,
LOT
:
''
,
location
:
''
,
ply
:
''
,
state
:
''
,
flag
:
'1'
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
''
page
:
1
,
rows
:
10
,
pn
:
undefined
,
lot
:
undefined
,
plocation
:
undefined
,
ptype
:
1
},
// TODO: 表单里的单项详情参数
singleDetails
:
{
deviceName
:
''
,
deviceId
:
''
,
LOT
:
''
,
location
:
''
,
ply
:
''
,
state
:
''
,
flag
:
'1'
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
''
// 表单参数
form
:
{},
defaultProps
:
{
children
:
'children'
,
label
:
'label'
},
// TODO: 模拟测试数据
simulateDeviceList
:
[{
deviceName
:
'设备1'
,
deviceId
:
'0001'
,
flag
:
1
,
LOT
:
'0001'
,
location
:
'XXX'
,
ply
:
'YYY'
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
'admin'
,
state
:
'已驳回'
},
{
deviceName
:
'设备2'
,
deviceId
:
'0002'
,
flag
:
2
,
LOT
:
'0002'
,
location
:
'XXX'
,
ply
:
'YYY'
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
'admin'
,
state
:
'已驳回'
},
{
deviceName
:
'设备3'
,
deviceId
:
'0003'
,
flag
:
2
,
LOT
:
'0003'
,
location
:
'XXX'
,
ply
:
'YYY'
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
'admin'
,
state
:
'已驳回'
},
{
deviceName
:
'设备4'
,
deviceId
:
'0004'
,
flag
:
2
,
LOT
:
'0004'
,
location
:
'XXX'
,
ply
:
'YYY'
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
'admin'
,
state
:
'已驳回'
},
{
deviceName
:
'设备5'
,
deviceId
:
'0005'
,
flag
:
2
,
LOT
:
'0005'
,
location
:
'XXX'
,
ply
:
'YYY'
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
'admin'
,
state
:
'待审核'
},
{
deviceName
:
'设备6'
,
deviceId
:
'0006'
,
flag
:
2
,
LOT
:
'0006'
,
location
:
'XXX'
,
ply
:
'YYY'
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
'admin'
,
state
:
'待审核'
},
{
deviceName
:
'设备7'
,
deviceId
:
'0007'
,
flag
:
2
,
LOT
:
'0007'
,
location
:
'XXX'
,
ply
:
'YYY'
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
'admin'
,
state
:
'待审核'
},
{
deviceName
:
'设备8'
,
deviceId
:
'0008'
,
flag
:
2
,
LOT
:
'0008'
,
location
:
'XXX'
,
ply
:
'YYY'
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
'admin'
,
state
:
'待审核'
},
{
deviceName
:
'设备9'
,
deviceId
:
'0009'
,
flag
:
2
,
LOT
:
'0009'
,
location
:
'XXX'
,
ply
:
'YYY'
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
'admin'
,
state
:
'已通过'
},
{
deviceName
:
'设备10'
,
deviceId
:
'00010'
,
flag
:
2
,
LOT
:
'0010'
,
location
:
'XXX'
,
ply
:
'YYY'
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
'admin'
,
state
:
'已通过'
}
],
// 表单校验
rules
:
{
deviceName
:
[
{
required
:
true
,
message
:
'请输入设备名称'
,
trigger
:
'blur'
}
pn
:
[
{
required
:
true
,
message
:
'请输入pn'
,
trigger
:
'blur'
}
],
ptype
:
[
{
required
:
true
,
message
:
'请输入ptype'
,
trigger
:
'blur'
}
],
pgx
:
[
{
required
:
true
,
message
:
'请输入pgx'
,
trigger
:
'blur'
}
],
prank
:
[
{
required
:
true
,
message
:
'请输入prank'
,
trigger
:
'blur'
}
],
deviceId
:
[
{
required
:
true
,
message
:
'请输入
设备编码
'
,
trigger
:
'blur'
}
pissb
:
[
{
required
:
true
,
message
:
'请输入
pissb
'
,
trigger
:
'blur'
}
],
LOT
:
[
{
required
:
true
,
message
:
'请输入
LOT
'
,
trigger
:
'blur'
}
psm
:
[
{
required
:
true
,
message
:
'请输入
psm
'
,
trigger
:
'blur'
}
],
createB
y
:
[
{
required
:
true
,
message
:
'请输入
申请人
'
,
trigger
:
'blur'
}
ps
y
:
[
{
required
:
true
,
message
:
'请输入
psy
'
,
trigger
:
'blur'
}
]
},
deptOptions
:
[]
...
...
@@ -329,11 +306,14 @@ export default {
this
.
queryParams
=
{
...
param
}
}
this
.
getList
()
// this.getDicts(dictCons['NORMAL_DISABLE']).then(response => {
// this.statusOptions = response.data;
// });
},
methods
:
{
getFontColor
(
state
)
{
if
(
state
===
'已驳回'
)
{
return
'
color: red;
'
if
(
state
===
1
)
{
return
'
已完成
'
}
else
if
(
state
===
'待审核'
)
{
return
'color: orange;'
}
else
if
(
state
===
'已通过'
)
{
...
...
@@ -342,138 +322,240 @@ export default {
return
''
}
},
/** 查询
角色
列表 */
/** 查询
基础信息
列表 */
getList
()
{
this
.
loading
=
true
this
.
roleList
=
this
.
simulateDeviceList
console
.
log
(
this
.
roleList
)
this
.
loading
=
false
listWbApply
(
this
.
queryParams
).
then
(
response
=>
{
this
.
equipmentapplyList
=
response
.
rows
this
.
total
=
response
.
total
this
.
loading
=
false
}
)
},
/** 查询菜单树结构 */
getMenuTreeselect
()
{
menuTreeselect
().
then
(
response
=>
{
this
.
menuOptions
=
response
.
data
})
},
/** 查询菜单列表 */
getMenuList
(
roleId
)
{
roleMenuTreeselectMC
(
roleId
).
then
(
response
=>
{
this
.
menuList
=
this
.
handleTree
(
response
.
data
.
menus
,
'businessId'
)
this
.
loading
=
false
})
},
/** 查询部门树结构 */
getDeptTreeselect
()
{
deptTreeselect
().
then
(
response
=>
{
this
.
deptOptions
=
response
.
data
})
},
// 所有菜单节点数据
getMenuAllCheckedKeys
()
{
// 目前被选中的菜单节点
const
checkedKeys
=
this
.
$refs
.
menu
.
getHalfCheckedKeys
()
// 半选中的菜单节点
const
halfCheckedKeys
=
this
.
$refs
.
menu
.
getCheckedKeys
()
checkedKeys
.
unshift
.
apply
(
checkedKeys
,
halfCheckedKeys
)
return
checkedKeys
},
// 所有部门节点数据
getDeptAllCheckedKeys
()
{
// 目前被选中的部门节点
const
checkedKeys
=
this
.
$refs
.
dept
.
getHalfCheckedKeys
()
// // 半选中的部门节点
const
halfCheckedKeys
=
this
.
$refs
.
dept
.
getCheckedKeys
()
checkedKeys
.
unshift
.
apply
(
checkedKeys
,
halfCheckedKeys
)
return
this
.
$refs
.
dept
.
getCheckedKeys
()
},
/** 根据角色ID查询菜单树结构 */
getRoleMenuTreeselect
(
roleId
)
{
return
roleMenuTreeselect
(
roleId
).
then
(
response
=>
{
this
.
menuOptions
=
response
.
data
.
menus
return
response
})
},
/** 根据角色ID和菜单ID查询部门树结构 */
getRoleDeptTreeselect
(
roleId
,
menuId
)
{
return
roleDeptTreeselect
(
roleId
,
menuId
).
then
(
response
=>
{
this
.
form
.
deptCheckStrictly
=
response
.
data
.
deptCheckStrictly
this
.
deptOptions
=
response
.
data
.
depts
this
.
form
.
dataScope
=
this
.
dataScopeOptions
[
response
.
data
.
dataScope
-
1
].
value
return
response
})
},
// 角色状态修改
handleStatusChange
(
row
)
{
const
text
=
row
.
flag
===
'1'
?
'启用'
:
'停用'
this
.
$confirm
(
'确认要"'
+
text
+
'""'
+
row
.
roleName
+
'"角色吗?'
,
'警告'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(
function
()
{
return
changeRoleStatus
(
row
.
businessId
,
row
.
flag
)
}).
then
(()
=>
{
this
.
$message
({
message
:
text
+
'成功'
,
type
:
'success'
})
}).
catch
(
function
()
{
row
.
flag
=
row
.
flag
===
'0'
?
'1'
:
'0'
})
},
// 取消按钮
cancel
()
{
this
.
open
=
false
this
.
reset
()
},
// 取消按钮(数据权限)
cancelDataScope
()
{
this
.
openDataScope
=
false
this
.
reset
()
},
// 表单重置
reset
()
{
// TODO: 将模拟数据的空对象赋值给表单对象,达成清空填写表单的效果
if
(
this
.
$refs
.
menu
!==
undefined
)
{
this
.
$refs
.
menu
.
setCheckedKeys
([])
}
this
.
menuExpand
=
false
this
.
menuNodeAll
=
false
this
.
deptExpand
=
true
this
.
deptNodeAll
=
false
this
.
form
=
{
deviceName
:
''
,
deviceId
:
''
,
location
:
''
,
ply
:
''
,
state
:
''
,
flag
:
'1'
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
''
pn
:
undefined
,
ptype
:
undefined
,
pgx
:
undefined
,
roleKey
:
undefined
,
roleSort
:
0
,
flag
:
undefined
,
menuIds
:
[],
menuName
:
undefined
,
deptIds
:
[],
menuCheckStrictly
:
true
,
deptCheckStrictly
:
true
,
remark
:
undefined
}
this
.
resetForm
(
'form'
)
},
/**
TODO:
查询按钮操作 */
/** 查询按钮操作 */
handleQuery
()
{
this
.
queryParams
.
page
Num
=
1
this
.
queryParams
.
page
=
1
this
.
getList
()
},
/** TODO: 重置按钮操作 */
resetQuery
()
{},
/** 重置按钮操作 */
resetQuery
()
{
// this.dateRange = []
this
.
resetForm
(
'queryForm'
)
this
.
handleQuery
()
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{},
/** TODO: 新增按钮操作 */
handleAdd
()
{
// TODO: 初始化新增对话框的状态
this
.
reset
()
this
.
title
=
'申请领用设备'
this
.
open
=
!
this
.
open
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
roleId
)
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
},
// TODO: 获取所选行详情信息操作
handleDetail
(
row
)
{
this
.
singleDetails
=
this
.
formReset
this
.
singleDetails
=
row
this
.
title
=
'详情信息'
this
.
openDetails
=
!
this
.
openDetails
// 树权限(父子联动)
handleCheckedTreeConnect
(
value
,
type
)
{
if
(
type
===
'menu'
)
{
this
.
form
.
menuCheckStrictly
=
!!
value
}
else
if
(
type
===
'dept'
)
{
this
.
form
.
deptCheckStrictly
=
!!
value
}
},
/** TODO: 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
()
this
.
title
=
'修改申请'
const
upddeviceName
=
row
.
deviceName
for
(
const
pd
of
this
.
simulateDeviceList
)
{
if
(
pd
.
deviceName
===
upddeviceName
)
{
this
.
form
=
pd
// 树权限(全选/全不选)
handleCheckedTreeNodeAll
(
value
,
type
)
{
if
(
type
===
'menu'
)
{
this
.
$refs
.
menu
.
setCheckedNodes
(
value
?
this
.
menuOptions
:
[])
}
else
if
(
type
===
'dept'
)
{
this
.
$refs
.
dept
.
setCheckedNodes
(
value
?
this
.
deptOptions
:
[])
}
},
// 树权限(展开/折叠)
handleCheckedTreeExpand
(
value
,
type
)
{
if
(
type
===
'menu'
)
{
const
treeList
=
this
.
menuOptions
for
(
let
i
=
0
;
i
<
treeList
.
length
;
i
++
)
{
this
.
$refs
.
menu
.
store
.
nodesMap
[
treeList
[
i
].
id
].
expanded
=
value
}
}
else
if
(
type
===
'dept'
)
{
const
treeList
=
this
.
deptOptions
for
(
let
i
=
0
;
i
<
treeList
.
length
;
i
++
)
{
this
.
$refs
.
dept
.
store
.
nodesMap
[
treeList
[
i
].
id
].
expanded
=
value
}
}
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
()
this
.
getMenuTreeselect
()
this
.
open
=
true
this
.
title
=
'添加角色'
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
()
const
roleId
=
row
.
businessId
||
this
.
ids
const
roleMenu
=
this
.
getRoleMenuTreeselect
(
roleId
)
getRole
(
roleId
).
then
(
response
=>
{
this
.
form
=
response
.
data
this
.
open
=
true
this
.
getMenuTreeselect
(
roleId
)
this
.
$nextTick
(()
=>
{
roleMenu
.
then
(
res
=>
{
this
.
$refs
.
menu
.
setCheckedKeys
(
res
.
data
.
checkedKeys
)
})
})
this
.
title
=
'修改角色'
})
},
/**
TODO: 修改或增加list列表里的数据
*/
/**
提交按钮
*/
submitForm
:
function
()
{
this
.
$refs
[
'form'
].
validate
(
valid
=>
{
if
(
valid
)
{
// TODO: 模拟测试数据的修改,可删除
for
(
const
p
of
this
.
simulateDeviceList
)
{
if
(
p
.
deviceName
===
this
.
form
.
deviceName
)
{
this
.
simulateDeviceList
=
this
.
simulateDeviceList
.
map
(
obj
=>
obj
.
deviceName
===
this
.
form
.
deviceName
?
this
.
form
:
obj
)
this
.
msgSuccess
(
'申请成功'
)
if
(
this
.
form
.
businessId
!==
undefined
)
{
this
.
form
.
menuIds
=
this
.
getMenuAllCheckedKeys
()
// eslint-disable-next-line no-undef
updateBasicInfo
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
'修改成功'
)
this
.
open
=
false
this
.
getList
()
this
.
reset
()
this
.
open
=
!
this
.
open
return
}
else
{
if
(
this
.
form
!==
undefined
&&
this
.
form
!==
null
)
{
this
.
simulateDeviceList
.
push
(
this
.
form
)
this
.
msgSuccess
(
'申请成功'
)
this
.
getList
()
this
.
reset
()
this
.
open
=
!
this
.
open
return
}
}
})
}
else
{
this
.
form
.
menuIds
=
this
.
getMenuAllCheckedKeys
()
// eslint-disable-next-line no-undef
addBasicInfo
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
'新增成功'
)
this
.
open
=
false
this
.
getList
()
})
}
}
})
},
/** TODO: 关于模拟数据的 删除list数组所调用的删除方法,封装的函数如下 */
delDevice
(
delDeviceName
)
{
let
tip
=
false
for
(
const
pd0
of
this
.
simulateDeviceList
)
{
console
.
log
(
'This is pd0:'
,
pd0
)
if
(
pd0
.
deviceName
===
delDeviceName
)
{
this
.
simulateDeviceList
=
this
.
simulateDeviceList
.
filter
(
item
=>
item
.
deviceName
!==
delDeviceName
)
tip
=
true
break
}
}
return
tip
},
/** TODO:删除按钮操作 */
/** 删除按钮操作 */
handleDelete
(
row
)
{
this
.
$confirm
(
'是否确认操作?'
,
'提示'
,
{
const
roleIds
=
row
.
businessId
||
this
.
ids
this
.
$confirm
(
'所选择数据被删除后不可再恢复,是否继续?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(
()
=>
{
return
this
.
delDevice
(
row
.
deviceName
)
}).
then
(
function
()
{
return
delRole
(
roleIds
)
}).
then
(()
=>
{
this
.
getList
()
this
.
$message
({
message
:
'删除成功'
,
type
:
'success'
})
}).
catch
(()
=>
{
this
.
$message
({
type
:
'info'
,
message
:
'已取消删除'
})
}).
catch
(
function
()
{
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.app-container
{
font-size
:
18px
;
padding
:
0
;
...
...
@@ -498,20 +580,4 @@ export default {
height
:
12em
;
width
:
4px
;
}
.aboutSingleDetails
{
.el-form-item
{
.el-input
>>>
.el-input__inner
{
-webkit-appearance
:
none
;
background-color
:
#FFF
;
background-image
:
none
;
border-radius
:
4px
;
border
:
0
;
width
:
100%
;
}
}
}
</
style
>
src/views/equipment/management.vue
View file @
eeed2ff2
...
...
@@ -140,7 +140,6 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"plocation:"
prop=
"plocation"
>
...
...
@@ -148,21 +147,8 @@
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
" 操作时间:"
prop=
"createDate"
>
<el-input
v-model
.
trim=
"singleDetails.createDate"
:readonly=
"true"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"操作员:"
prop=
"createName"
>
<el-input
v-model
.
trim=
"singleDetails.createName"
:readonly=
"true"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"prank:"
prop=
"prank"
>
<el-input
v-model
.
trim=
"singleDetails.prank"
:readonly=
"true"
/>
<el-form-item
label=
"厚度:"
prop=
"phd"
>
<el-input
v-model
.
trim=
"singleDetails.phd"
:readonly=
"true"
/>
</el-form-item>
</el-col>
</el-row>
...
...
@@ -178,10 +164,22 @@
</el-form-item>
</el-col>
</el-row>
<el-form-item
label=
"
厚度:"
prop=
"phd
"
>
<el-input
v-model
.
trim=
"singleDetails.p
hd
"
:readonly=
"true"
/>
<el-form-item
label=
"
parnk:"
prop=
"prank
"
>
<el-input
v-model
.
trim=
"singleDetails.p
rank
"
:readonly=
"true"
/>
</el-form-item>
</el-form>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"操作员:"
prop=
"createName"
>
<el-input
v-model
.
trim=
"singleDetails.createName"
:readonly=
"true"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
" 操作时间:"
prop=
"createDate"
>
<el-input
v-model
.
trim=
"singleDetails.createDate"
:readonly=
"true"
/>
</el-form-item>
</el-col>
</el-row>
</el-dialog>
</div>
</template>
...
...
src/views/processManagement/basicProcessManagement/index.vue
View file @
eeed2ff2
...
...
@@ -149,7 +149,6 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"plocation:"
prop=
"plocation"
>
...
...
@@ -157,21 +156,8 @@
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
" 操作时间:"
prop=
"createDate"
>
<el-input
v-model
.
trim=
"singleDetails.createDate"
:readonly=
"true"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"操作员:"
prop=
"createName"
>
<el-input
v-model
.
trim=
"singleDetails.createName"
:readonly=
"true"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"prank:"
prop=
"prank"
>
<el-input
v-model
.
trim=
"singleDetails.prank"
:readonly=
"true"
/>
<el-form-item
label=
"厚度:"
prop=
"phd"
>
<el-input
v-model
.
trim=
"singleDetails.phd"
:readonly=
"true"
/>
</el-form-item>
</el-col>
</el-row>
...
...
@@ -187,10 +173,22 @@
</el-form-item>
</el-col>
</el-row>
<el-form-item
label=
"
厚度:"
prop=
"phd
"
>
<el-input
v-model
.
trim=
"singleDetails.p
hd
"
:readonly=
"true"
/>
<el-form-item
label=
"
parnk:"
prop=
"prank
"
>
<el-input
v-model
.
trim=
"singleDetails.p
rank
"
:readonly=
"true"
/>
</el-form-item>
</el-form>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"操作员:"
prop=
"createName"
>
<el-input
v-model
.
trim=
"singleDetails.createName"
:readonly=
"true"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
" 操作时间:"
prop=
"createDate"
>
<el-input
v-model
.
trim=
"singleDetails.createDate"
:readonly=
"true"
/>
</el-form-item>
</el-col>
</el-row>
</el-dialog>
</div>
</template>
...
...
src/views/processManagement/draw.vue
0 → 100644
View file @
eeed2ff2
<
template
>
<div
class=
"app-container"
>
<el-form
ref=
"queryForm"
style=
"padding: 0 0 0 10px"
:model=
"queryParams"
:inline=
"true"
>
<el-form-item
label=
"pn"
prop=
"pn"
>
<el-input
v-model=
"queryParams.pn"
placeholder=
"请输入pn"
clearable
:maxlength=
"30"
size=
"small"
style=
"width: 150px"
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"phd"
prop=
"phd"
>
<el-input
v-model=
"queryParams.phd"
placeholder=
"请输入phd"
clearable
size=
"small"
style=
"width: 150px"
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"prank"
prop=
"prank"
>
<el-input
v-model=
"queryParams.prank"
placeholder=
"请输入prank"
clearable
size=
"small"
style=
"width: 150px"
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
style=
"padding: 8px 7px;"
icon=
"el-icon-search"
size=
"small"
@
click=
"handleQuery"
>
查询
</el-button>
<el-button
type=
"primary"
style=
"padding: 8px 7px;"
icon=
"el-icon-refresh"
size=
"small"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-form>
<div
class=
"placeholder"
/>
<div
style=
"padding:5px 10px"
>
<div
class=
"mb12 font-small-bold"
>
设备领用信息列表
</div>
<el-table
v-loading=
"loading"
border
:data=
"equipmentapplyList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"50"
/>
<el-table-column
label=
"pn"
prop=
"pn"
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
pn
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"phd"
prop=
"phd"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
phd
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"prank"
prop=
"prank"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
prank
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"pgx"
prop=
"pgx"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
pgx
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"pissb"
prop=
"pissb"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
pissb
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"pstatus"
prop=
"pstatus"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
pstatus
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"ptype"
prop=
"ptype"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
ptype
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"状态"
prop=
"pstatus"
>
<
template
slot-scope=
"scope"
>
<span
v-if=
"scope.row.pstatus === '0'"
style=
"color: red"
>
未完成
</span>
<span
v-else
style=
"color: green"
>
已完成
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"操作员"
prop=
"createBy"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
createBy
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"操作时间"
:show-overflow-tooltip=
"true"
align=
"center"
prop=
"createTime"
width=
"200px"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
createTime
|
transformDateByFormat
(
'YYYY-MM-DD HH:mm'
)
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
class-name=
"small-padding fixed-width"
width=
"150px"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
style=
"color: #49cec9"
@
click=
"handleUpdate(scope.row)"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
</div>
<pagination
v-show=
"total>0"
:total=
"total"
:page
.
sync=
"queryParams.page"
:limit
.
sync=
"queryParams.rows"
@
pagination=
"getList"
/>
<!-- 添加或修改设备基本信息配置对话框 -->
<el-dialog
title=
"设备基本信息"
:visible
.
sync=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
size=
"small"
label-width=
"80px"
>
<el-form-item
label=
"pn"
prop=
"pn"
>
<el-input
v-model
.
trim=
"form.pn"
show-word-limit
:maxlength=
"30"
placeholder=
"请输入pn"
/>
</el-form-item>
<el-form-item
label=
"ptype"
prop=
"ptype"
>
<el-input
v-model
.
trim=
"form.ptype"
show-word-limit
:maxlength=
"30"
placeholder=
"请输入ptype"
/>
</el-form-item>
<el-form-item
label=
"pgx"
prop=
"pgx"
>
<el-input-number
v-model=
"form.pgx"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入pgx"
/>
</el-form-item>
<el-form-item
label=
"prank"
prop=
"prank"
>
<el-input-number
v-model=
"form.prank"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入prank"
/>
</el-form-item>
<el-form-item
label=
"pissb"
prop=
"pissb"
>
<el-select
v-model=
"form.pissb"
placeholder=
"请选择pissb"
clearable
size=
"small"
style=
"width: 150px"
>
<el-option
v-for=
"dict in statusOptions"
:key=
"dict.dictValue"
:label=
"dict.dictLabel"
:value=
"dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"psm"
prop=
"psm"
>
<el-input-number
v-model=
"form.psm"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入psm"
/>
</el-form-item>
<el-form-item
label=
"psy"
prop=
"psy"
>
<el-input-number
v-model=
"form.psy"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入psy"
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
</div>
</el-dialog>
</div>
</template>
<
script
>
// import {
// addRole,
// changeRoleStatus,
// dataScope,
// delRole,
// exportRole,
// getRole,
// listBasicInfo,
// updateRole
// } from '@/api/equipment/basicInfo'
import
{
roleMenuTreeselect
,
roleMenuTreeselectMC
,
treeselect
as
menuTreeselect
}
from
'@/api/system/menu'
import
{
roleDeptTreeselect
,
treeselect
as
deptTreeselect
}
from
'@/api/system/dept'
import
{
listBasicInfo
}
from
'@/api/equipment/basicInfo'
import
{
listWbApply
}
from
'@/api/equipment/draw'
// import { getRolesByInsId } from '../../../api/businessManage/template'
export
default
{
name
:
'Role'
,
data
()
{
return
{
// 遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 总条数
total
:
0
,
// 设备申请表格数据
equipmentapplyList
:
[],
// 弹出层标题
title
:
''
,
// 是否显示弹出层
open
:
false
,
// 是否显示弹出层(数据权限)
openDataScope
:
false
,
// 日期范围
// dateRange: [],
// 菜单表格数据
menuList
:
[],
menuExpand
:
false
,
menuNodeAll
:
false
,
deptExpand
:
true
,
deptNodeAll
:
false
,
// 状态数据字典
statusOptions
:
[
{
dictLabel
:
'是'
,
dictValue
:
'1'
},
{
dictLabel
:
'否'
,
dictValue
:
'0'
}
],
// 数据范围选项
dataScopeOptions
:
[
{
value
:
'1'
,
label
:
'全部数据权限'
},
{
value
:
'2'
,
label
:
'自定数据权限'
},
{
value
:
'3'
,
label
:
'本部门数据权限'
},
{
value
:
'4'
,
label
:
'本部门及以下数据权限'
},
{
value
:
'5'
,
label
:
'仅本人数据权限'
}
],
// 部门列表
tOptions
:
[],
// 查询参数
queryParams
:
{
page
:
1
,
rows
:
10
,
pn
:
undefined
,
lot
:
undefined
,
plocation
:
undefined
,
ptype
:
2
},
// 表单参数
form
:
{},
defaultProps
:
{
children
:
'children'
,
label
:
'label'
},
// 表单校验
rules
:
{
pn
:
[
{
required
:
true
,
message
:
'请输入pn'
,
trigger
:
'blur'
}
],
ptype
:
[
{
required
:
true
,
message
:
'请输入ptype'
,
trigger
:
'blur'
}
],
pgx
:
[
{
required
:
true
,
message
:
'请输入pgx'
,
trigger
:
'blur'
}
],
prank
:
[
{
required
:
true
,
message
:
'请输入prank'
,
trigger
:
'blur'
}
],
pissb
:
[
{
required
:
true
,
message
:
'请输入pissb'
,
trigger
:
'blur'
}
],
psm
:
[
{
required
:
true
,
message
:
'请输入psm'
,
trigger
:
'blur'
}
],
psy
:
[
{
required
:
true
,
message
:
'请输入psy'
,
trigger
:
'blur'
}
]
},
deptOptions
:
[]
}
},
/** 路由离开前存储筛选条件*/
beforeRouteLeave
(
to
,
from
,
next
)
{
this
.
$store
.
dispatch
(
'searchSave/searchParamsSet'
,
{
path
:
this
.
$route
.
path
,
param
:
{
...
this
.
queryParams
}
})
next
()
},
created
()
{
if
(
this
.
$store
.
getters
.
searchParams
[
this
.
$route
.
path
])
{
const
{
searchParams
}
=
this
.
$store
.
getters
;
const
{
path
}
=
this
.
$route
const
param
=
JSON
.
parse
(
searchParams
[
path
])
// 保留着的查询条件
this
.
queryParams
=
{
...
param
}
}
this
.
getList
()
// this.getDicts(dictCons['NORMAL_DISABLE']).then(response => {
// this.statusOptions = response.data;
// });
},
methods
:
{
getFontColor
(
state
)
{
if
(
state
===
1
)
{
return
'已完成'
}
else
if
(
state
===
'待审核'
)
{
return
'color: orange;'
}
else
if
(
state
===
'已通过'
)
{
return
'color: green;'
}
else
{
return
''
}
},
/** 查询基础信息列表 */
getList
()
{
this
.
loading
=
true
listWbApply
(
this
.
queryParams
).
then
(
response
=>
{
this
.
equipmentapplyList
=
response
.
rows
this
.
total
=
response
.
total
this
.
loading
=
false
}
)
},
/** 查询菜单树结构 */
getMenuTreeselect
()
{
menuTreeselect
().
then
(
response
=>
{
this
.
menuOptions
=
response
.
data
})
},
/** 查询菜单列表 */
getMenuList
(
roleId
)
{
roleMenuTreeselectMC
(
roleId
).
then
(
response
=>
{
this
.
menuList
=
this
.
handleTree
(
response
.
data
.
menus
,
'businessId'
)
this
.
loading
=
false
})
},
/** 查询部门树结构 */
getDeptTreeselect
()
{
deptTreeselect
().
then
(
response
=>
{
this
.
deptOptions
=
response
.
data
})
},
// 所有菜单节点数据
getMenuAllCheckedKeys
()
{
// 目前被选中的菜单节点
const
checkedKeys
=
this
.
$refs
.
menu
.
getHalfCheckedKeys
()
// 半选中的菜单节点
const
halfCheckedKeys
=
this
.
$refs
.
menu
.
getCheckedKeys
()
checkedKeys
.
unshift
.
apply
(
checkedKeys
,
halfCheckedKeys
)
return
checkedKeys
},
// 所有部门节点数据
getDeptAllCheckedKeys
()
{
// 目前被选中的部门节点
const
checkedKeys
=
this
.
$refs
.
dept
.
getHalfCheckedKeys
()
// // 半选中的部门节点
const
halfCheckedKeys
=
this
.
$refs
.
dept
.
getCheckedKeys
()
checkedKeys
.
unshift
.
apply
(
checkedKeys
,
halfCheckedKeys
)
return
this
.
$refs
.
dept
.
getCheckedKeys
()
},
/** 根据角色ID查询菜单树结构 */
getRoleMenuTreeselect
(
roleId
)
{
return
roleMenuTreeselect
(
roleId
).
then
(
response
=>
{
this
.
menuOptions
=
response
.
data
.
menus
return
response
})
},
/** 根据角色ID和菜单ID查询部门树结构 */
getRoleDeptTreeselect
(
roleId
,
menuId
)
{
return
roleDeptTreeselect
(
roleId
,
menuId
).
then
(
response
=>
{
this
.
form
.
deptCheckStrictly
=
response
.
data
.
deptCheckStrictly
this
.
deptOptions
=
response
.
data
.
depts
this
.
form
.
dataScope
=
this
.
dataScopeOptions
[
response
.
data
.
dataScope
-
1
].
value
return
response
})
},
// 角色状态修改
handleStatusChange
(
row
)
{
const
text
=
row
.
flag
===
'1'
?
'启用'
:
'停用'
this
.
$confirm
(
'确认要"'
+
text
+
'""'
+
row
.
roleName
+
'"角色吗?'
,
'警告'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(
function
()
{
return
changeRoleStatus
(
row
.
businessId
,
row
.
flag
)
}).
then
(()
=>
{
this
.
$message
({
message
:
text
+
'成功'
,
type
:
'success'
})
}).
catch
(
function
()
{
row
.
flag
=
row
.
flag
===
'0'
?
'1'
:
'0'
})
},
// 取消按钮
cancel
()
{
this
.
open
=
false
this
.
reset
()
},
// 取消按钮(数据权限)
cancelDataScope
()
{
this
.
openDataScope
=
false
this
.
reset
()
},
// 表单重置
reset
()
{
if
(
this
.
$refs
.
menu
!==
undefined
)
{
this
.
$refs
.
menu
.
setCheckedKeys
([])
}
this
.
menuExpand
=
false
this
.
menuNodeAll
=
false
this
.
deptExpand
=
true
this
.
deptNodeAll
=
false
this
.
form
=
{
pn
:
undefined
,
ptype
:
undefined
,
pgx
:
undefined
,
roleKey
:
undefined
,
roleSort
:
0
,
flag
:
undefined
,
menuIds
:
[],
menuName
:
undefined
,
deptIds
:
[],
menuCheckStrictly
:
true
,
deptCheckStrictly
:
true
,
remark
:
undefined
}
this
.
resetForm
(
'form'
)
},
/** 查询按钮操作 */
handleQuery
()
{
this
.
queryParams
.
page
=
1
this
.
getList
()
},
/** 重置按钮操作 */
resetQuery
()
{
// this.dateRange = []
this
.
resetForm
(
'queryForm'
)
this
.
handleQuery
()
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
roleId
)
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
},
// 树权限(父子联动)
handleCheckedTreeConnect
(
value
,
type
)
{
if
(
type
===
'menu'
)
{
this
.
form
.
menuCheckStrictly
=
!!
value
}
else
if
(
type
===
'dept'
)
{
this
.
form
.
deptCheckStrictly
=
!!
value
}
},
// 树权限(全选/全不选)
handleCheckedTreeNodeAll
(
value
,
type
)
{
if
(
type
===
'menu'
)
{
this
.
$refs
.
menu
.
setCheckedNodes
(
value
?
this
.
menuOptions
:
[])
}
else
if
(
type
===
'dept'
)
{
this
.
$refs
.
dept
.
setCheckedNodes
(
value
?
this
.
deptOptions
:
[])
}
},
// 树权限(展开/折叠)
handleCheckedTreeExpand
(
value
,
type
)
{
if
(
type
===
'menu'
)
{
const
treeList
=
this
.
menuOptions
for
(
let
i
=
0
;
i
<
treeList
.
length
;
i
++
)
{
this
.
$refs
.
menu
.
store
.
nodesMap
[
treeList
[
i
].
id
].
expanded
=
value
}
}
else
if
(
type
===
'dept'
)
{
const
treeList
=
this
.
deptOptions
for
(
let
i
=
0
;
i
<
treeList
.
length
;
i
++
)
{
this
.
$refs
.
dept
.
store
.
nodesMap
[
treeList
[
i
].
id
].
expanded
=
value
}
}
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
()
this
.
getMenuTreeselect
()
this
.
open
=
true
this
.
title
=
'添加角色'
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
()
const
roleId
=
row
.
businessId
||
this
.
ids
const
roleMenu
=
this
.
getRoleMenuTreeselect
(
roleId
)
getRole
(
roleId
).
then
(
response
=>
{
this
.
form
=
response
.
data
this
.
open
=
true
this
.
getMenuTreeselect
(
roleId
)
this
.
$nextTick
(()
=>
{
roleMenu
.
then
(
res
=>
{
this
.
$refs
.
menu
.
setCheckedKeys
(
res
.
data
.
checkedKeys
)
})
})
this
.
title
=
'修改角色'
})
},
/** 提交按钮 */
submitForm
:
function
()
{
this
.
$refs
[
'form'
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
businessId
!==
undefined
)
{
this
.
form
.
menuIds
=
this
.
getMenuAllCheckedKeys
()
// eslint-disable-next-line no-undef
updateBasicInfo
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
'修改成功'
)
this
.
open
=
false
this
.
getList
()
})
}
else
{
this
.
form
.
menuIds
=
this
.
getMenuAllCheckedKeys
()
// eslint-disable-next-line no-undef
addBasicInfo
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
'新增成功'
)
this
.
open
=
false
this
.
getList
()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
roleIds
=
row
.
businessId
||
this
.
ids
this
.
$confirm
(
'所选择数据被删除后不可再恢复,是否继续?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(
function
()
{
return
delRole
(
roleIds
)
}).
then
(()
=>
{
this
.
getList
()
this
.
$message
({
message
:
'删除成功'
,
type
:
'success'
})
}).
catch
(
function
()
{
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.app-container
{
font-size
:
18px
;
padding
:
0
;
.placeholder
{
height
:
1
.3vh
;
background-color
:
#F4F4F4
;
margin-bottom
:
10px
}
.table-drop
{
vertical-align
:
2px
;
line-height
:
20px
;
margin-left
:
15px
}
.el-switch
{
margin-left
:
15px
;
}
}
.el-divider--vertical
{
height
:
12em
;
width
:
4px
;
}
</
style
>
src/views/processManagement/inventoryRecord/index.vue
View file @
eeed2ff2
<
template
>
<div
class=
"app-container"
>
<el-form
v-show=
"showSearch"
ref=
"queryForm"
style=
"padding: 0 0 0 10px"
:model=
"queryParams"
:inline=
"true"
label-width=
"68px"
>
<el-form-item
label=
"设备编码"
prop=
"pn"
>
<el-input
v-model=
"queryParams.pn"
placeholder=
"请输入设备编码"
clearable
:maxlength=
"30"
style=
"width: 150px;"
size=
"small"
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"操作人"
prop=
"updateBy"
>
<el-input
v-model=
"queryParams.updateBy"
placeholder=
"请输入操作人"
clearable
:maxlength=
"30"
style=
"width: 150px;"
size=
"small"
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item>
<el-select
v-model=
"queryParams.selectValue"
filterable
placeholder=
"请选择库类型"
>
<el-option
v-for=
"option in selectOptions"
:key=
"option.value"
:label=
"option.label"
:value=
"option.value"
<div
class=
"ToolBar"
>
<el-form
v-show=
"showSearch"
ref=
"queryForm"
style=
"padding: 0 0 0 10px"
:model=
"queryParams"
:inline=
"true"
>
<el-form-item
label=
"pn"
prop=
"pn"
>
<el-input
v-model=
"queryParams.pn"
placeholder=
"Please enter pn"
clearable
:maxlength=
"30"
style=
"width: 150px;"
size=
"small"
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"lot"
prop=
"lot"
>
<el-input
v-model=
"queryParams.lot"
placeholder=
"Please enter lot"
clearable
:maxlength=
"30"
style=
"width: 150px;"
size=
"small"
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
size=
"small"
icon=
"el-icon-search"
@
click=
"handleQuery"
>
查询
</el-button>
</el-form-item>
<el-form-item
label=
"plocation"
prop=
"plocation"
>
<el-input
v-model=
"queryParams.plocation"
placeholder=
"Please enter plocation"
clearable
:maxlength=
"30"
style=
"width: 150px;"
size=
"small"
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
size=
"small"
icon=
"el-icon-search"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
<el-form-item
label=
"poperate"
prop=
"poperate"
>
<el-select
v-model=
"queryParams.poperate"
placeholder=
"库状态"
filterable
clearable
@
keyup
.
enter
.
native=
"handleQuery"
>
<el-option
v-for=
"option in selectOptionsAboutPoperate"
:key=
"option.value"
:label=
"option.label"
:value=
"option.value"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"ptype"
prop=
"ptype"
>
<el-select
v-model=
"queryParams.ptype"
placeholder=
"库类型"
filterable
clearable
@
keyup
.
enter
.
native=
"handleQuery"
>
<el-option
v-for=
"option in selectOptionsAboutPtype"
:key=
"option.value"
:label=
"option.label"
:value=
"option.value"
/>
</el-select>
</el-form-item>
<div
style=
"float: right"
>
<el-form-item>
<el-button
type=
"success"
size=
"small"
icon=
"el-icon-download"
@
click=
"handleExport"
>
盘点
</el-button>
<div
class=
"block"
>
<el-date-picker
v-model=
"dateRange"
value-format=
"yyyy-MM-dd"
type=
"datetimerange"
range-separator=
"-"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
:default-time=
"['00:00:00', '00:00:00']"
/>
</div>
</el-form-item>
<el-button
type=
"success"
size=
"small"
icon=
"el-icon-download"
@
click=
"handleExport"
>
导出
</el-button>
<el-form-item>
<el-button
type=
"primary"
size=
"small"
icon=
"el-icon-search"
@
click=
"handleQuery"
>
查询
</el-button>
</el-form-item>
</div>
</el-form>
<el-form-item>
<el-button
size=
"small"
icon=
"el-icon-refresh"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
<!--TODO: 导出和盘点按钮所在 -->
<el-row
:gutter=
"36"
class=
"mb8"
justify=
"start"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"primary"
size=
"small"
icon=
"el-icon-plus"
@
click=
"handleExport"
>
盘点
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"success"
size=
"small"
icon=
"el-icon-download"
@
click=
"handleExport"
>
导出
</el-button>
</el-col>
</el-row>
</el-form>
</div>
<!-- TODO: 分隔符-->
<div
class=
"placeholder"
/>
<!--TODO: Table表单-->
<transition
name=
"fade-transform"
mode=
"out-in"
>
<component
:is=
"BaseTable"
:key=
"queryParams.rows"
:all-table-arguments=
"allTableArguments"
@
handle-detail=
"handleDetail"
@
handle-update=
"handleUpdate"
@
handle-delete=
"handleDelete"
/>
</transition>
<!--TODO: 分页组件-->
<pagination
v-show=
"total>0"
:total=
"total"
...
...
@@ -85,63 +141,58 @@
@
pagination=
"getList"
/>
<!-- 清空弹窗-->
<el-dialog
title=
"选择清空月份"
:visible
.
sync=
"clearVisible"
width=
"30%"
:before-close=
"handleClose"
>
<el-form
ref=
"clear"
:model=
"clearFrom"
:rules=
"clearRule"
>
<el-form-item
label=
"月份"
prop=
"month"
>
<el-date-picker
v-model=
"clearFrom.month"
type=
"monthrange"
range-separator=
"至"
start-placeholder=
"开始月份"
end-placeholder=
"结束月份"
value-format=
"yyyy_MM"
:picker-options=
"endDatePicker"
@
change=
"timechange"
/>
</el-form-item>
<el-form-item
style=
"float: right;margin-top: 20px"
>
<el-button
@
click=
"clearVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"clear"
>
确 定
</el-button>
</el-form-item>
</el-form>
</el-dialog>
<!-- 导出弹窗-->
<el-dialog
title=
"选择盘点月份"
:visible
.
sync=
"exportVisible"
width=
"30%"
:before-close=
"handleClose"
>
<el-form
ref=
"export"
:model=
"exportFrom"
:rules=
"exportRule"
>
<el-form-item
label=
"月份"
prop=
"month"
>
<el-date-picker
v-model=
"exportFrom.month"
type=
"monthrange"
range-separator=
"至"
start-placeholder=
"开始月份"
end-placeholder=
"结束月份"
value-format=
"yyyy_MM"
:picker-options=
"endDatePicker"
@
change=
"timechange"
/>
</el-form-item>
<el-form-item
style=
"float: right;margin-top: 20px"
>
<el-button
@
click=
"exportVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"exportSubmit"
>
确 定
</el-button>
</el-form-item>
<!-- TODO: 单项详情信息表单配置 -->
<el-dialog
class=
"aboutSingleDetails"
:title=
"title"
:visible
.
sync=
"openDetails"
width=
"700px"
append-to-body
>
<el-form
ref=
"formDetails"
:model=
"singleDetails"
size=
"small"
label-width=
"90px"
>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"pn:"
prop=
"pn"
>
<el-input
v-model
.
trim=
"singleDetails.pn"
:readonly=
"true"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"lot:"
prop=
"workshop"
>
<el-input
v-model
.
trim=
"singleDetails.lot"
:readonly=
"true"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"plocation:"
prop=
"plocation"
>
<el-input
v-model
.
trim=
"singleDetails.ptype"
:readonly=
"true"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
" 操作时间:"
prop=
"createDate"
>
<el-input
v-model
.
trim=
"singleDetails.poperate"
:readonly=
"true"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"位置:"
prop=
"createName"
>
<el-input
v-model
.
trim=
"singleDetails.plocation"
:readonly=
"true"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"操作员:"
prop=
"user"
>
<el-input
v-model
.
trim=
"singleDetails.user"
:readonly=
"true"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-dialog>
</div>
</
template
>
<
script
>
import
{
listLog
}
from
'@/api/processLibrary/InventoryRecord'
import
{
listLog
}
from
'@/api/processLibrary/InventoryRecord'
import
BaseTable
from
'@/components/Table/BaseTable/index.vue'
export
default
{
...
...
@@ -151,50 +202,48 @@ export default {
],
data
()
{
return
{
processList
:
[],
endDatePicker
:
this
.
handelFixDate
(),
// 自定义按钮
deletetypePrimary
:
'danger'
,
textPrimary
:
'text'
,
deleteName
:
'删除'
,
deleteSize
:
'mini'
,
deleteDisabled
:
'multiple'
,
cleantypePrimary
:
'danger'
,
cleanName
:
'清空'
,
cleanSize
:
'small'
,
exporttypePrimary
:
'success'
,
exportName
:
'导出'
,
exportSize
:
'small'
,
delIcon
:
'el-icon-delete'
,
exportIcon
:
'el-icon-download'
,
clearVisible
:
false
,
exportVisible
:
false
,
exportFrom
:
{},
exportRule
:
{
month
:
[
{
required
:
true
,
message
:
'请选择月份'
,
trigger
:
'change'
}
]
},
// 遮罩层
// TODO:遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
// TODO: 显示搜索条件
showSearch
:
true
,
// 总条数
// TODO: 数据总条数
total
:
0
,
clearFrom
:
{},
clearRule
:
{
month
:
[
{
required
:
true
,
message
:
'请选择月份'
,
trigger
:
'change'
}
]
},
// 表格数据
list
:
[],
selectOptions
:
[
// TODO: 关于 Ptype的数据字典
selectOptionsAboutPoperate
:
[
{
value
:
'1'
,
label
:
'入库'
},
{
value
:
'2'
,
label
:
'出库'
},
{
value
:
'1'
,
label
:
'修正'
},
{
value
:
'2'
,
label
:
'废弃'
}
],
// TODO: 关于 Ptype的数据字典
selectOptionsAboutPtype
:
[
{
value
:
'1'
,
label
:
'设备库'
...
...
@@ -203,15 +252,26 @@ export default {
label
:
'工序库'
}
],
// 查询参数
// TODO: 查询参数
// TODO: 时间日期范围 调用全局方法来输入进去
dateRange
:
[],
queryParams
:
{
page
:
1
,
rows
:
10
,
pn
:
''
,
updateBy
:
''
,
selectValue
:
''
// TODO: 设备编码
pn
:
undefined
,
// TODO: lot
lot
:
undefined
,
// TODO: 位置
plocation
:
undefined
,
// TODO: 库状态 1 入,2出,3修正,4废弃
poperate
:
undefined
,
// TODO: 库类型 1设备库 2工序库
ptype
:
undefined
},
// TODO: 用来接收数据源
inventoryRecordList
:
[],
// TODO: 用来说明每一列的类型
columObj
:
{
// 选择框
...
...
@@ -222,109 +282,102 @@ export default {
return
true
}
},
lazy
:
'true'
,
// column列,columType(列类型,可选text(默认为普通文字模式),input(input可编辑框),switch(switch开关),image(图片),operation(操作按钮))
// prop(参数),label(列名),width(宽度),align(对齐方式),sortable(是否支持排序)
columnData
:
[{
ownDefined
:
true
,
prop
:
'ptype'
,
label
:
'库类型'
,
ownDefinedReturn
:
(
row
,
$index
)
=>
{
switch
(
row
.
poperate
)
{
case
'1'
:
return
'设备库'
case
'2'
:
return
'工序库'
default
:
return
''
columnData
:
[
{
text
:
true
,
prop
:
'pn'
,
label
:
'设备编码pn'
},
{
text
:
true
,
prop
:
'lot'
,
label
:
'lot'
},
{
ownDefined
:
true
,
prop
:
'ptype'
,
label
:
'库类型ptype'
,
ownDefinedReturn
:
(
row
,
$index
)
=>
{
switch
(
row
.
poperate
)
{
case
'1'
:
return
'设备库'
case
'2'
:
return
'工序库'
default
:
return
''
}
}
}
},
{
text
:
true
,
prop
:
'pn'
,
label
:
'设备编码'
},
{
ownDefined
:
true
,
prop
:
'poperate'
,
label
:
'poperate'
,
width
:
'180px'
,
ownDefinedReturn
:
(
row
,
$index
)
=>
{
switch
(
row
.
poperate
)
{
case
'1'
:
return
'入库'
case
'2'
:
return
'出库'
case
'3'
:
return
'修正'
case
'4'
:
return
'废弃'
default
:
return
''
},
{
ownDefined
:
true
,
prop
:
'poperate'
,
label
:
'库状态poperate'
,
width
:
'180px'
,
ownDefinedReturn
:
(
row
,
$index
)
=>
{
switch
(
row
.
poperate
)
{
case
'1'
:
return
'入库'
case
'2'
:
return
'出库'
case
'3'
:
return
'修正'
case
'4'
:
return
'废弃'
default
:
return
''
}
}
},
{
text
:
true
,
prop
:
'plocation'
,
label
:
'位置plocation'
,
sortable
:
false
,
width
:
'150px'
},
{
text
:
true
,
prop
:
'user'
,
label
:
'操作员user'
,
sortable
:
false
,
width
:
'150px'
},
{
time
:
true
,
prop
:
'updateDate'
,
label
:
'操作时间updateDate'
,
align
:
'center'
},
// TODO: 如果为操作列,则需要填写需要的操作按钮,类型为Object。operation(操作类型,可选edit,delete,see),type(按钮样式,参考el—botton类型),label(按钮文字)icon(参考el-icon),color(字体颜色)
{
isOperation
:
true
,
label
:
'操作'
,
width
:
'100px'
,
align
:
'center'
,
sortable
:
false
,
operation
:
[{
clickType
:
'1'
,
label
:
'详情'
,
icon
:
''
,
color
:
''
,
size
:
this
.
size
}]
}
},
{
time
:
true
,
prop
:
'updateDate'
,
label
:
'操作时间'
,
align
:
'center'
},
{
text
:
true
,
prop
:
'updateBy'
,
label
:
'操作人'
,
sortable
:
false
,
width
:
'210px'
},
// 如果为操作列,则需要填写需要的操作按钮,类型为Object。operation(操作类型,可选edit,delete,see),type(按钮样式,参考el—botton类型),label(按钮文字)icon(参考el-icon),color(字体颜色)
{
isOperation
:
true
,
label
:
'操作'
,
width
:
'180px'
,
align
:
'center'
,
sortable
:
false
,
operation
:
[{
type
:
this
.
typeParent
,
label
:
'详情'
,
icon
:
''
,
color
:
''
,
size
:
this
.
size
,
buttonClick
:
()
=>
{
return
'this.handleDetail'
},
isShow
:
(
row
,
$index
)
=>
{
return
true
}
},
{
type
:
this
.
typeParent
,
label
:
'修改'
,
icon
:
''
,
color
:
''
,
size
:
this
.
size
,
buttonClick
:
()
=>
{
return
'this.handleUpdate'
},
isShow
:
(
row
,
$index
)
=>
{
return
true
}
},
{
type
:
this
.
typeParent
,
label
:
'删除'
,
icon
:
''
,
color
:
''
,
size
:
this
.
size
,
buttonClick
:
()
=>
{
return
'this.handleDelete'
},
isShow
:
(
row
,
$index
)
=>
{
return
true
}
}]
}
]
},
// TODO: 表单里的单项详情参数
singleDetails
:
{
equipmentName
:
''
,
equipmentCode
:
''
,
lot
:
''
,
location
:
''
,
thickness
:
''
,
createName
:
''
,
createTime
:
''
}
}
},
...
...
@@ -333,7 +386,7 @@ export default {
return
BaseTable
},
/
/ TODO:自定义分页索引,实现索引继承
/
* TODO:自定义分页索引,实现索引继承 */
nIndex
(
index
)
{
// TODO: 当前页数 - 1 * 每页数据条数 + 1
const
page
=
this
.
queryParams
.
pageNum
// TODO: 当前页码
...
...
@@ -347,7 +400,7 @@ export default {
listName
:
'出入库记录列表'
,
nIndex
:
this
.
nIndex
,
loading
:
this
.
loading
,
processList
:
this
.
process
List
,
processList
:
this
.
inventoryRecord
List
,
queryParams
:
this
.
queryParams
,
columObj
:
this
.
columObj
}
...
...
@@ -364,32 +417,18 @@ export default {
next
()
},
created
()
{
if
(
this
.
$store
.
getters
.
searchParams
[
this
.
$route
.
path
])
{
const
{
searchParams
}
=
this
.
$store
.
getters
;
const
{
path
}
=
this
.
$route
const
param
=
JSON
.
parse
(
searchParams
[
path
])
// 保留着的查询条件
this
.
queryParams
=
{
...
param
}
}
// this.queryParams.loginTime = this.$parseDate(new Date(), 'YYYY-MM-DD HH:mm:ss')
this
.
getList
()
},
methods
:
{
// 清空和导出弹出框的日期选择器禁用当前月份之后的月份
handelFixDate
()
{
return
{
disabledDate
(
time
)
{
// 如果想蕴含本月本月 - 8.64e7 * t 就不须要了,
// 如果想之前的不能抉择把 > 换成
<
return
time
.
getTime
()
>
Date
.
now
()
}
}
},
/** 查询登录日志列表 */
/** TODO:查询工序库的出入库记录列表 */
getList
()
{
this
.
loading
=
true
listLog
(
this
.
queryParams
).
then
(
response
=>
{
this
.
total
=
response
.
rows
.
length
this
.
processList
=
response
.
rows
listLog
(
this
.
addDateRange
(
this
.
queryParams
,
this
.
dateRange
)).
then
(
response
=>
{
this
.
inventoryRecordList
=
response
.
rows
this
.
total
=
response
.
total
// 暂时还没写后端 this.selectOptionsAboutPoperate = selectOptionsAboutPoperate
// this.selectOptionsAboutPtype = selectOptionsAboutPtype
this
.
loading
=
false
})
},
...
...
@@ -401,49 +440,19 @@ export default {
// statusFormat(row, column) {
// return this.selectDictLabel(this.statusOptions, row.status)
// },
/** 查询按钮操作 */
/**
TODO:
查询按钮操作 */
handleQuery
()
{
this
.
queryParams
.
page
=
1
this
.
getList
()
},
/** 重置按钮操作 */
/**
TODO:
重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
'queryForm'
)
this
.
handleQuery
()
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
businessId
)
this
.
multiple
=
!
selection
.
length
},
exportSubmit
()
{
this
.
$refs
[
'export'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
const
that
=
this
const
query
=
{
beginTime
:
that
.
exportFrom
.
month
[
0
],
endTime
:
that
.
exportFrom
.
month
[
1
]
}
return
exportLogininfo
(
query
).
then
(
response
=>
{
const
blob
=
new
Blob
([
response
])
const
downloadElement
=
document
.
createElement
(
'a'
)
const
href
=
window
.
URL
.
createObjectURL
(
blob
)
// 创建下载的链接
downloadElement
.
href
=
href
downloadElement
.
download
=
'登录日志'
+
'.xls'
// 下载后文件名
document
.
body
.
appendChild
(
downloadElement
)
downloadElement
.
click
()
// 点击下载
document
.
body
.
removeChild
(
downloadElement
)
// 下载完成移除元素
window
.
URL
.
revokeObjectURL
(
href
)
// 释放掉blob对象
this
.
exportVisible
=
false
// this.download(response.msg)
})
}
})
},
/** 导出按钮操作 */
handleExport
()
{
this
.
exportVisible
=
true
this
.
exportFrom
=
{}
handleDetail
(
row
)
{
console
.
log
(
'success!'
)
}
}
}
...
...
@@ -453,10 +462,21 @@ export default {
padding
:
0
;
font-size
:
18px
;
.placeholder
{
height
:
1
4px
;
height
:
1
.3vh
;
background-color
:
#F4F4F4
;
margin-bottom
:
10px
}
/*TODO: 这里是调整ToolBar的样式的噢!*/
.ToolBar
{
.el-form
{
.el-form-item
{
.el-select
{
width
:
90px
;
}
}
}
}
}
</
style
>
src/views/sample/basicInformation/index.vue
View file @
eeed2ff2
...
...
@@ -49,7 +49,7 @@
<div
class=
"placeholder"
/>
<!-- 表单区 -->
<div
style=
"padding:5px 10px"
>
<div
class=
"mb12 font-small-bold"
>
基础
样式
列表
</div>
<div
class=
"mb12 font-small-bold"
>
基础
信息
列表
</div>
<el-table
v-loading=
"loading"
border
:data=
"basicinfoMationList"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"50"
/>
<el-table-column
label=
"pn"
prop=
"pn"
:show-overflow-tooltip=
"true"
>
...
...
@@ -57,24 +57,24 @@
{{
scope
.
row
.
pn
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"
qty"
prop=
"qty
"
:show-overflow-tooltip=
"true"
>
<el-table-column
label=
"
name"
prop=
"name
"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
qty
||
'-'
}}
{{
scope
.
row
.
name
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"
name"
prop=
"name
"
:show-overflow-tooltip=
"true"
>
<el-table-column
label=
"
qty"
prop=
"qty
"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
name
||
'-'
}}
{{
scope
.
row
.
qty
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"max_qty"
prop=
"max_qty"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
max
_q
ty
||
'-'
}}
{{
scope
.
row
.
max
Q
ty
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"min_qty"
prop=
"min_qty"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
min
_q
ty
||
'-'
}}
{{
scope
.
row
.
min
Q
ty
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"unit"
prop=
"unit"
:show-overflow-tooltip=
"true"
>
...
...
@@ -87,9 +87,9 @@
{{
scope
.
row
.
createName
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"操作时间"
prop=
"create
_d
ate"
:show-overflow-tooltip=
"true"
>
<el-table-column
label=
"操作时间"
prop=
"create
D
ate"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
create_date
||
'-'
}}
{{
parseTime
(
scope
.
row
.
createDate
,
'{y
}
-{m
}
-{d
}
'
)
||
'-'
}}
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"操作"
>
...
...
@@ -126,28 +126,25 @@
@
pagination
=
"getList"
/>
<!--
新增修改弹出
-->
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"500px"
append-to-body
>
<
el
-
dialog
:
title
=
"title"
:
visible
.
sync
=
"open"
width
=
"500px"
append
-
to
-
body
:
close
-
on
-
click
-
modal
=
"false"
@
close
=
"cancel"
>
<
el
-
form
ref
=
"form"
:
model
=
"form"
:
rules
=
"rules"
size
=
"small"
label
-
width
=
"80px"
>
<
el
-
form
-
item
label
=
"pn"
prop
=
"pn"
>
<el-input
v-model
.
trim=
"form.pn"
show-word-limit
:maxlength=
"30"
placeholder=
"请输入pn"
/>
</el-form-item>
<el-form-item
label=
"qty"
prop=
"qty"
>
<el-input
v-model
.
trim=
"form.qty"
show-word-limit
:maxlength=
"30"
placeholder=
"请输入qty"
/>
<
el
-
input
v
-
model
.
trim
=
"form.pn"
:
maxlength
=
"30"
placeholder
=
"请输入pn"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"name"
prop
=
"name"
>
<el-input
v-model
.
trim=
"form.name"
show-word-limit
:maxlength=
"30"
placeholder=
"请输入name"
/>
<
el
-
input
v
-
model
.
trim
=
"form.name"
:
maxlength
=
"30"
placeholder
=
"请输入name"
/>
<
/el-form-item
>
<el-form-item
label=
"
pgx"
prop=
"pgx
"
>
<el-input
-number
v-model=
"form.pgx"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入pgx
"
/>
<
el
-
form
-
item
label
=
"
qty"
prop
=
"qty
"
>
<
el
-
input
v
-
model
.
trim
=
"form.qty"
:
maxlength
=
"30"
placeholder
=
"请输入qty
"
/>
<
/el-form-item
>
<el-form-item
label=
"max
_qty"
prop=
"max_q
ty"
>
<el-input
-number
v-model=
"form.max_qty"
style=
"width: 100%"
controls-position=
"right"
:min=
"
0"
placeholder=
"请输入max_qty"
/>
<
el
-
form
-
item
label
=
"max
Qty"
prop
=
"maxQ
ty"
>
<
el
-
input
v
-
model
.
trim
=
"form.maxQty"
:
maxlength
=
"3
0"
placeholder
=
"请输入max_qty"
/>
<
/el-form-item
>
<el-form-item
label=
"min
_qty"
prop=
"min_q
ty"
>
<el-input
-number
v-model=
"form.min_qty"
style=
"width: 100%"
controls-position=
"right"
:min=
"
0"
placeholder=
"请输入min_qty"
/>
<
el
-
form
-
item
label
=
"min
Qty"
prop
=
"minQ
ty"
>
<
el
-
input
v
-
model
.
trim
=
"form.minQty"
:
maxlength
=
"3
0"
placeholder
=
"请输入min_qty"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"unit"
prop
=
"unit"
>
<el-input
-number
v-model=
"form.unit"
style=
"width: 100%"
controls-position=
"right"
:min=
"
0"
placeholder=
"请输入unit"
/>
<
el
-
input
v
-
model
.
trim
=
"form.unit"
:
maxlength
=
"3
0"
placeholder
=
"请输入unit"
/>
<
/el-form-item
>
<
/el-form
>
<
div
slot
=
"footer"
class
=
"dialog-footer"
>
...
...
@@ -159,7 +156,8 @@
<
/template
>
<
script
>
import
{
queryList
}
from
'@/api/sample/basicInformation'
import
{
queryList
,
add
,
getDetailById
,
updataInfo
,
deleteLogical
}
from
'@/api/sample/basicInformation'
import
{
parseTime
}
from
"@/utils"
;
export
default
{
name
:
'Index'
,
...
...
@@ -171,7 +169,12 @@ export default {
}
,
rules
:
{
pn
:
[{
required
:
true
,
message
:
'输入pn'
,
trigger
:
'change'
}]
pn
:
[{
required
:
true
,
message
:
'请输入pn'
,
trigger
:
'blur'
}
],
name
:
[{
required
:
true
,
message
:
'请输入name'
,
trigger
:
'blur'
}
],
qty
:
[{
pattern
:
/^
[
0-9
]
{1,9
}
(\.[
0-9
]
{1,3
}
)?
$/
,
message
:
'仅能输入数字和小数,限制三位小数'
,
trigger
:
'change'
}
],
maxQty
:
[{
pattern
:
/^
[
0-9
]
{1,9
}
(\.[
0-9
]
{1,3
}
)?
$/
,
message
:
'仅能输入数字和小数,限制三位小数'
,
trigger
:
'change'
}
],
minQty
:
[{
pattern
:
/^
[
0-9
]
{1,9
}
(\.[
0-9
]
{1,3
}
)?
$/
,
message
:
'仅能输入数字和小数,限制三位小数'
,
trigger
:
'change'
}
],
unit
:
[{
pattern
:
/^
[
0-9
]
{1,9
}
(\.[
0-9
]
{1,3
}
)?
$/
,
message
:
'仅能输入数字和小数,限制三位小数'
,
trigger
:
'change'
}
]
}
,
total
:
0
,
loading
:
false
,
...
...
@@ -189,23 +192,94 @@ export default {
this
.
getList
()
}
,
methods
:
{
// 清空表单
reFrom
()
{
this
.
form
=
{
businessId
:
undefined
,
pn
:
''
,
name
:
''
,
qty
:
''
,
maxQty
:
''
,
minQty
:
''
,
unit
:
''
}
this
.
$refs
.
form
.
clearValidate
()
}
,
// 提交
submitForm
()
{
this
.
$refs
.
form
.
validate
((
valid
)
=>
{
if
(
valid
)
{
// 校验通过,提交表单或进行其他操作
console
.
log
(
'form'
,
this
.
form
)
if
(
this
.
form
.
businessId
!==
undefined
)
{
console
.
log
(
'更新'
)
updataInfo
(
this
.
form
).
then
(
res
=>
{
console
.
log
(
'res'
,
res
)
if
(
res
.
code
===
200
)
{
this
.
open
=
false
this
.
$message
.
success
(
'操作成功'
)
this
.
getList
()
this
.
reFrom
()
}
else
if
(
res
.
code
===
null
)
{
this
.
$message
.
error
(
res
.
message
)
}
}
)
}
else
{
add
(
this
.
form
).
then
(
res
=>
{
console
.
log
(
'res'
,
res
)
if
(
res
.
code
===
200
)
{
this
.
open
=
false
this
.
$message
.
success
(
'操作成功'
)
this
.
getList
()
this
.
reFrom
()
}
else
if
(
res
.
code
===
null
)
{
this
.
$message
.
error
(
res
.
message
)
}
}
)
}
}
else
{
// 校验失败,显示错误信息或进行其他操作
console
.
log
(
'22222'
)
}
}
)
}
,
cancel
()
{
this
.
open
=
false
this
.
reFrom
()
}
,
handleDelete
()
{
handleDelete
(
row
)
{
console
.
log
(
'row'
,
row
)
const
id
=
row
.
businessId
this
.
$confirm
(
'是否确认操作?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}
).
then
(
res
=>
{
deleteLogical
(
id
).
then
(
res
=>
{
console
.
log
(
'res'
,
res
)
if
(
res
.
code
===
200
)
{
this
.
$message
.
success
(
'操作成功'
)
this
.
getList
()
}
}
)
}
)
}
,
handleUpdate
()
{
// 编辑
handleUpdate
(
row
)
{
console
.
log
(
'row'
,
row
)
const
id
=
row
.
businessId
getDetailById
(
id
).
then
(
res
=>
{
console
.
log
(
'res'
,
res
)
this
.
form
=
res
.
data
this
.
open
=
true
}
)
}
,
// 初始化获取数据
getList
()
{
this
.
loading
=
true
queryList
(
this
.
queryParams
).
then
(
res
=>
{
console
.
log
(
'res'
,
res
)
res
.
rows
.
createDate
=
parseTime
(
res
.
rows
.
createDate
,
'{y
}
-{m
}
-{d
}
'
)
this
.
total
=
res
.
total
this
.
basicinfoMationList
=
res
.
rows
this
.
loading
=
false
...
...
@@ -227,7 +301,8 @@ export default {
this
.
getList
()
}
,
handleAdd
()
{
this
.
open
=
true
this
.
title
=
'添加基础信息表单'
}
,
handleExport
()
{
...
...
src/views/system/user/index.vue
View file @
eeed2ff2
...
...
@@ -184,8 +184,8 @@
<pagination
v-show=
"total>0"
:total=
"total"
:page
.
sync=
"queryParams.page
Num
"
:limit
.
sync=
"queryParams.
pageSize
"
:page
.
sync=
"queryParams.page"
:limit
.
sync=
"queryParams.
rows
"
@
pagination=
"getList"
/>
</el-col>
...
...
@@ -529,8 +529,8 @@ export default {
},
// 查询参数
queryParams
:
{
page
Num
:
1
,
pageSize
:
10
,
page
:
1
,
rows
:
10
,
username
:
undefined
,
email
:
undefined
,
phone
:
undefined
,
...
...
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