Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sgaqgl-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
李苏
sgaqgl-vue
Commits
cd3db3e4
Commit
cd3db3e4
authored
Dec 27, 2022
by
李苏
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备选择保养项目
parent
5f28c622
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
1231 additions
and
20 deletions
+1231
-20
sbbymx.js
src/api/equipment/sbbymx.js
+39
-0
index.js
src/router/index.js
+29
-14
byxm.vue
src/views/equipment/sbbymx/byxm.vue
+139
-0
dtlEdit.vue
src/views/equipment/sbbymx/dtlEdit.vue
+303
-0
edit.vue
src/views/equipment/sbbymx/edit.vue
+285
-0
index.vue
src/views/equipment/sbbymx/index.vue
+168
-0
selector.vue
src/views/equipment/sbbymx/selector.vue
+263
-0
edit.vue
src/views/equipment/sbbyxm/edit.vue
+5
-6
No files found.
src/api/equipment/sbbymx.js
0 → 100644
View file @
cd3db3e4
import
request
from
'common/src/utils/request'
/* 查询 */
export
function
doQuery
(
query
)
{
return
request
({
url
:
'/aqgl/sbgl/sbbymx/query'
,
method
:
'post'
,
data
:
query
||
{}
})
}
/* 更新 */
export
function
doUpdate
(
query
)
{
return
request
({
url
:
'/aqgl/sbgl/sbbymx/update'
,
method
:
'post'
,
data
:
query
||
{}
})
}
export
function
doAdd
(
query
)
{
return
request
({
url
:
'/aqgl/sbgl/sbbymx/add'
,
method
:
'post'
,
data
:
query
||
{}
})
}
export
function
doDelete
(
query
)
{
return
request
({
url
:
'/aqgl/sbgl/sbbymx/delete'
,
method
:
'post'
,
data
:
query
||
{}
})
}
export
function
doSave
(
query
)
{
return
request
({
url
:
'/aqgl/sbgl/sbbymx/save'
,
method
:
'post'
,
data
:
query
||
{}
})
}
src/router/index.js
View file @
cd3db3e4
...
...
@@ -1072,20 +1072,7 @@ export const powerRoutes=[
redirect
:
'equipmentClass'
,
meta
:
{
title
:
"设备管理"
,
icon
:
"fa-cog"
,
noCache
:
false
,
link
:
null
,
mkid
:
908000000
},
children
:
[
/* 设备保养项目*/
{
component
:
'equipment/sbbyxm/index'
,
hidden
:
false
,
meta
:{
"title"
:
"设备保养项目"
,
"icon"
:
""
,
"noCache"
:
false
,
"link"
:
null
,
"mkid"
:
'908000100'
,
},
name
:
'sbbyxm'
,
path
:
"sbbyxm"
},
{
component
:
'equipment/equipmentClass/index'
,
hidden
:
false
,
...
...
@@ -1163,6 +1150,34 @@ export const powerRoutes=[
},
name
:
'inspection'
,
path
:
"inspection"
},
/* 设备保养项目*/
{
component
:
'equipment/sbbyxm/index'
,
hidden
:
false
,
meta
:{
"title"
:
"保养项目维护"
,
"icon"
:
""
,
"noCache"
:
false
,
"link"
:
null
,
"mkid"
:
'908000100'
,
},
name
:
'sbbyxm'
,
path
:
"sbbyxm"
},
/* 设备保养项目*/
{
component
:
'equipment/sbbymx/index'
,
hidden
:
false
,
meta
:{
"title"
:
"设备保养项目"
,
"icon"
:
""
,
"noCache"
:
false
,
"link"
:
null
,
"mkid"
:
'908000100'
,
},
name
:
'sbbymx'
,
path
:
"sbbymx"
}
]
},
...
...
src/views/equipment/sbbymx/byxm.vue
0 → 100644
View file @
cd3db3e4
<
template
>
<DefaultDialog
:app=
'app'
>
<div
class=
"min_full"
slot=
'form'
style=
"height: 550px;border: 0px;"
>
<Selector
:app=
'this'
v-if=
'showDialog&&DialogName=="ksry"'
></Selector>
<!-- 按钮操作-->
<el-row
class=
"tool-bar"
>
<!--
<ViewButton
ref=
"view"
:app=
'this'
></ViewButton>
<AddButton
ref=
"add"
:app=
'this'
></AddButton>
<CopyButton
ref=
"copy"
:app=
'this'
></CopyButton>
<EditButton
ref=
"edit"
:app=
'this'
></EditButton>
-->
<el-button
@
click=
"xzry"
size=
'mini'
type=
"primary"
>
导入项目
</el-button>
<!-- 额外按钮-->
<!-- 表头设置 -->
<!-- 权限-->
</el-row>
<!-- 表格-->
<div
class=
"tablePagers"
style=
"height: 380px;"
>
<TablePager
:showPagination=
'false'
@
getData=
'getData'
:ref=
"'TablePager'"
:app=
'this'
:query=
'query'
@
selectItem=
'selectItem'
:delParams=
"'mxid'"
@
getRow=
'getRow'
>
</TablePager>
</div>
</div>
</DefaultDialog>
</
template
>
<
script
>
/* 引入需要的接口*/
import
Selector
from
'./selector'
import
{
doQuery
,
doAdd
,
doUpdate
,
doDelete
}
from
'@/api/equipment/sbbymx.js'
;
//
/* edit页面*/
import
DtlEdit
from
'./dtlEdit.vue'
import
{
tableMixin_noapp
}
from
'common'
export
default
{
props
:[
'app'
],
mixins
:
[
tableMixin_noapp
],
name
:
'aqgl.pxglPxsjmx'
,
/* 初始额外赋值*/
async
mounted
()
{
/* 存储试卷数据*/
this
.
sjdata
=
this
.
app
.
singleItem
//试卷的
this
.
queryParams
.
mid
=
this
.
app
.
singleItem
.
id
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'TablePager'
].
pageQuery
()
})
},
data
()
{
return
{
typeObj
:{
'M'
:
'多选题'
,
'S'
:
'单选题'
,
'J'
:
'判断题'
,
'F'
:
'填空题'
},
sjdata
:{},
/*需要的额外参数 */
showDialog
:
false
,
DialogName
:
''
,
type
:
''
,
DialogWidth
:
'85%'
,
DialogTitle
:
'导入试题'
,
/* 基础url*/
baseUrl
:
'/aqgl/pxgl/pxsjmx'
,
/* 查询参数*/
queryParams
:
{
info
:
''
,
mid
:
''
},
/* 表格标题对应参数*/
tableTitle
:
[
{
label
:
"编码"
,
prop
:
"code"
,
fieldType
:
"ftString"
,
width
:
120
},
{
label
:
"名称"
,
prop
:
"name"
,
fieldType
:
"ftString"
,
width
:
300
},
{
label
:
"保养周期-天"
,
prop
:
"byzq"
,
fieldType
:
"int"
,
width
:
252
},
{
label
:
"公司"
,
prop
:
"gsName"
,
fieldType
:
"ftString"
,
width
:
192
},
{
label
:
"停用标志"
,
prop
:
"tybz"
,
fieldType
:
"ftString"
,
width
:
100
},
{
label
:
"停用日期"
,
prop
:
"tyrq"
,
...
this
.
$common
(
'ftDateTime'
),
width
:
192
},
{
label
:
"标准工时"
,
prop
:
"bzgs"
,
fieldType
:
"float"
,
width
:
192
},
{
label
:
"附件数"
,
prop
:
"attachcount"
,
fieldType
:
"int"
,
width
:
192
},
{
label
:
"备注"
,
prop
:
"bz"
,
fieldType
:
"ftString"
,
width
:
300
},
{
label
:
"维护人"
,
prop
:
"whr"
,
fieldType
:
"ftString"
,
width
:
192
},
{
label
:
"维护时间"
,
prop
:
"whsj"
,
...
this
.
$common
(
'ftDateTime'
),
width
:
192
},
{
label
:
"创建人"
,
prop
:
"cjr"
,
fieldType
:
"ftString"
,
width
:
192
},
{
label
:
"创建时间"
,
prop
:
"cjsj"
,
...
this
.
$common
(
'ftDateTime'
),
width
:
192
},
]
}
},
methods
:
{
xzry
(){
if
(
this
.
app
.
selectOne
||
this
.
app
.
clickOne
)
{
this
.
DialogTitle
=
'选择保养项目'
this
.
showDialog
=
true
this
.
DialogName
=
'ksry'
}
else
{
this
.
$warning
(
'请选中一行操作'
);
}
},
drst
(){
this
.
showDialog
=
true
},
/* 基础查询*/
query
:
doQuery
,
/* 基础增*/
// apiAdd: doDtlAdd,
// /* 基础更新*/
// apiUpdate: doDtlUpdate,
// /* 删除操作*/
apiDelete
:
doDelete
,
/* 初始化赋值操作*/
init
()
{
}
},
components
:
{
DtlEdit
,
Selector
}
}
</
script
>
<
style
scoped
>
</
style
>
src/views/equipment/sbbymx/dtlEdit.vue
0 → 100644
View file @
cd3db3e4
<
template
>
<DefaultDialog
:app=
'app'
>
<div
slot=
'form'
class=
"min_full"
style=
"height: 70vh;border: 0px;"
>
<div
class=
"search"
v-condition
>
<SearchButton
@
click
.
native=
'search'
></SearchButton>
<el-row
:gutter=
"20"
class=
"search-row-1"
>
<el-col
:span=
"6"
class=
"search-col"
>
<div
class=
"search-item"
>
<span
class=
"search-span"
>
类型:
</span>
<RelSelect
filterable
style=
"width: 100%;"
clearable
src=
'aqgl/pxgl/pxst/init/type'
:match=
"
{value:'id',label:'name'}" v-model='type'>
</RelSelect>
</div>
</el-col>
<el-col
:span=
"18"
class=
"search-col"
>
<div
style=
"height: 50px;line-height: 50px;font-size: 12px;width: 450px;"
>
填空题(
{{
fcount
}}
/
{{
sjdata
.
fcount
}}
) 单选题(
{{
scount
}}
/
{{
sjdata
.
scount
}}
)多选题(
{{
mcount
}}
/
{{
sjdata
.
mcount
}}
)判断题(
{{
jcount
}}
/
{{
sjdata
.
jcount
}}
)
</div>
</el-col>
</el-row>
</div>
<div
class=
"tablePagers"
>
<el-table
height=
'50vh'
v-loading=
"loading"
ref=
"multipleTable"
:data=
"tableData"
@
select=
"selectChange"
@
select-all=
"selectAllChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
>
</el-table-column>
<el-table-column
prop=
"cont"
label=
"题目"
align=
"center"
>
</el-table-column>
<el-table-column
prop=
"type"
label=
"类型"
align=
"center"
:formatter=
"transType"
>
</el-table-column>
</el-table>
<el-row
type=
"flex"
class=
"pageBanner"
style=
"padding-top: 20px;"
justify=
"center"
>
<el-pagination
background
:total=
"total"
:page-size=
"pageSize"
@
size-change=
"pageSizeChange"
@
current-change=
"currentPageChange"
:current-page=
"currentPage"
:page-sizes=
"[10, 20, 30]"
layout=
"total, sizes, prev, pager, next"
>
</el-pagination>
</el-row>
</div>
</div>
<div
slot=
"reFooter"
class=
"refooter"
>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"save()"
>
导 入
</el-button>
</span>
</div>
</DefaultDialog>
</
template
>
<
script
>
import
{
doQuery
,
doAdd
,
doUpdate
,
doDelete
,
pxxmQuery
,
excelimport
}
from
'@/api/train/questionManage'
;
import
{
donDtlSave
}
from
'@/api/train/examination'
;
export
default
{
props
:[
'app'
],
data
()
{
return
{
typeObj
:{
'M'
:
'多选题'
,
'S'
:
'单选题'
,
'J'
:
'判断题'
,
'F'
:
'填空题'
},
type
:
''
,
pageSize
:
10
,
// 唯一标识符
id
:
"id"
,
loading
:
false
,
total
:
0
,
currentPage
:
1
,
selectedList
:
[
],
tableData
:
[],
};
},
created
()
{
this
.
sjdata
=
this
.
app
.
sjdata
this
.
selectedList
=
_
.
cloneDeep
(
this
.
app
.
tabData
)
console
.
log
(
this
.
selectedList
,
'传入已选'
)
/* 试题定量*/
/* 单选题*/
/* 多选题*/
/* 判断题*/
/* 填空题*/
},
mounted
()
{
this
.
$nextTick
(()
=>
{
this
.
getData
(
this
.
currentPage
,
this
.
pageSize
);
})
// 页面初始化时,首次加载数据
},
computed
:{
scount
(){
/* 单选数量*/
let
num
=
0
this
.
selectedList
.
forEach
(
item
=>
{
item
.
type
==
'S'
&&
num
++
})
return
num
},
mcount
(){
let
num
=
0
this
.
selectedList
.
forEach
(
item
=>
{
item
.
type
==
'M'
&&
num
++
})
/* 多选数量*/
return
num
},
jcount
(){
let
num
=
0
this
.
selectedList
.
forEach
(
item
=>
{
item
.
type
==
'J'
&&
num
++
})
/* 判断题数量*/
return
num
},
fcount
(){
let
num
=
0
this
.
selectedList
.
forEach
(
item
=>
{
item
.
type
==
'F'
&&
num
++
})
/* 填空题*/
return
num
}
},
methods
:
{
transType
(
a
,
b
,
c
){
let
val
=
this
.
typeObj
[
c
]
return
val
},
save
(){
/* 判断*/
if
(
this
.
scount
>
this
.
sjdata
.
scount
){
this
.
$warning
(
'单选题超出试卷允许设置范围'
)
return
}
if
(
this
.
mcount
>
this
.
sjdata
.
mcount
){
this
.
$warning
(
'多选题超出试卷允许设置范围'
)
return
}
if
(
this
.
jcount
>
this
.
sjdata
.
jcount
){
this
.
$warning
(
'判断题超出试卷允许设置范围'
)
return
}
if
(
this
.
fcount
>
this
.
sjdata
.
fcount
){
this
.
$warning
(
'填空题超出试卷允许设置范围'
)
return
}
let
params
=
{
id
:
this
.
sjdata
.
id
,
datas
:
this
.
selectedList
}
donDtlSave
(
params
).
then
(
res
=>
{
if
(
res
.
success
){
this
.
$success
(
'导入成功'
)
this
.
app
.
showDialog
=
false
this
.
app
.
$refs
[
'TablePager'
].
pageQuery
()
}
})
},
search
(
event
){
event
.
preventDefault
();
this
.
getData
(
this
.
currentPage
,
this
.
pageSize
);
},
// 单行前的勾选状态切换
selectChange
(
selectedRows
,
row
)
{
// true为选中, 0或false为取消选中
let
selected
=
selectedRows
.
length
&&
selectedRows
.
indexOf
(
row
)
!==
-
1
;
if
(
selected
)
{
this
.
addItem
(
row
);
}
else
{
this
.
removeItem
(
row
);
}
},
// 全选/取消全选
selectAllChange
(
selectedRows
)
{
let
selectedMarkList
=
this
.
selectedList
.
map
((
item
)
=>
item
[
this
.
id
]);
// 当前页选中行的标记列表
let
pageSelectedMarkList
=
Array
.
isArray
(
selectedRows
)
?
selectedRows
.
map
((
item
)
=>
item
[
this
.
id
])
:
[];
this
.
tableData
.
forEach
((
row
)
=>
{
if
(
pageSelectedMarkList
.
includes
(
row
[
this
.
id
]))
{
if
(
!
selectedMarkList
.
includes
(
row
[
this
.
id
]))
{
this
.
addItem
(
row
);
}
}
else
if
(
selectedMarkList
.
includes
(
row
[
this
.
id
]))
{
this
.
removeItem
(
row
);
}
});
},
// 切换每页显示条数
pageSizeChange
(
newPageSize
)
{
this
.
pageSize
=
newPageSize
;
this
.
getData
(
this
.
currentPage
,
this
.
pageSize
);
},
// 切换页码--翻页
currentPageChange
(
newPage
)
{
this
.
currentPage
=
newPage
;
this
.
getData
(
this
.
currentPage
,
this
.
pageSize
);
},
// 更新勾选标记
updateMark
()
{
let
selectedMarkList
=
this
.
selectedList
.
map
((
item
)
=>
item
[
this
.
id
]);
this
.
tableData
.
forEach
((
row
)
=>
{
if
(
selectedMarkList
.
includes
(
row
[
this
.
id
]))
{
// toggleRowSelection 需在$nextTick中使用!
this
.
$nextTick
(()
=>
{
this
.
$refs
.
multipleTable
.
toggleRowSelection
(
row
);
});
}
});
},
// 模拟访问接口获取数据
getData
(
page
,
pageSize
)
{
this
.
loading
=
true
;
let
params
=
{
xmid
:
this
.
sjdata
.
xmid
,
type
:
this
.
type
,
pageSize
:
pageSize
,
pageNo
:
page
}
doQuery
(
params
).
then
(
res
=>
{
this
.
loading
=
false
;
this
.
tableData
=
res
.
data
.
records
||
[]
this
.
total
=
res
.
data
.
total
this
.
updateMark
();
})
},
// 新增选中项
addItem
(
item
)
{
this
.
selectedList
.
push
(
item
);
},
// 移除选中项
removeItem
(
item
)
{
for
(
let
[
index
,
itemTemp
]
of
this
.
selectedList
.
entries
())
{
if
(
itemTemp
[
this
.
id
]
===
item
[
this
.
id
])
{
this
.
removeItemByIndex
(
index
);
break
;
}
}
},
// 根据下标移除选中项
removeItemByIndex
(
index
,
item
)
{
this
.
selectedList
.
splice
(
index
,
1
);
// 若有item,则是点击标签上的关闭按钮,移除选中项
if
(
item
)
{
this
.
$nextTick
(()
=>
{
this
.
$refs
.
multipleTable
.
toggleRowSelection
(
// 此处必须在 tableData 中查找对应的数据,否则 toggleRowSelection 会失效
this
.
tableData
.
find
((
row
)
=>
{
return
row
[
this
.
id
]
===
item
[
this
.
id
];
}),
false
);
});
}
},
},
};
</
script
>
<
style
scoped
>
.mainBox
{
margin
:
10px
;
}
.el-tag
{
margin
:
10px
;
}
.pageBanner
{
margin
:
10px
;
margin-bottom
:
0px
;
}
</
style
>
src/views/equipment/sbbymx/edit.vue
0 → 100644
View file @
cd3db3e4
This diff is collapsed.
Click to expand it.
src/views/equipment/sbbymx/index.vue
0 → 100644
View file @
cd3db3e4
<
template
>
<div
class=
"min_full"
>
<Byxm
:app=
'this'
v-if=
'showDialog&&DialogName=="byxm"'
></Byxm>
<!-- 查询条件-->
<div
class=
"search"
v-condition
>
<SearchButton
:app=
'app'
></SearchButton>
<el-row
:gutter=
"20"
class=
"search-row-1"
>
<el-col
:span=
"6"
class=
"search-col"
>
<div
class=
"search-item"
>
<span
class=
"search-span"
>
档案编号:
</span>
<el-input
v-model=
"queryParams.dabh"
></el-input>
</div>
</el-col>
<el-col
:span=
"6"
class=
"search-col"
>
<div
class=
"search-item"
>
<span
class=
"search-span"
>
设备名称:
</span>
<el-input
v-model=
"queryParams.sbxx"
></el-input>
</div>
</el-col>
<el-col
:span=
"6"
class=
"search-col"
>
<div
class=
"search-item"
>
<span
class=
"search-span"
>
是否已入档:
</span>
<el-select
v-model=
"queryParams.doc"
placeholder=
"请选择"
>
<el-option
v-for=
"item in options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
</div>
</el-col>
</el-row>
</div>
<!-- 按钮操作-->
<el-row
class=
"tool-bar"
>
<PrintButton
:app=
'app'
></PrintButton>
<ViewButton
ref=
"view"
:app=
'app'
></ViewButton>
<AddButton
ref=
"add"
:app=
'app'
></AddButton>
<CopyButton
ref=
"copy"
:app=
'app'
></CopyButton>
<EditButton
ref=
"edit"
:app=
'app'
></EditButton>
<AttachFileButton
:app=
'app'
></AttachFileButton>
<FieldButton
:app=
'app'
></FieldButton>
<ExcelButton
:app=
'app'
></ExcelButton>
<!-- 额外按钮-->
<el-button
@
click=
"byxm"
size=
'mini'
type=
"primary"
>
保养项目
</el-button>
<!-- 表头设置 -->
<!-- 权限-->
</el-row>
<!-- 表格-->
<div
class=
"tablePagers"
>
<TablePager
@
getData=
'getData'
:ref=
"'TablePager'"
:app=
'app'
:query=
'query'
@
selectItem=
'selectItem'
@
getRow=
'getRow'
>
</TablePager>
</div>
</div>
</
template
>
<
script
>
import
{
doQuery
,
doAdd
,
doUpdate
,
doDelete
}
from
'@/api/equipment/sbxx.js'
;
import
Byxm
from
'./byxm.vue'
/* edit页面*/
import
Edit
from
'./edit'
import
{
tableMixin
}
from
'common'
export
default
{
mixins
:
[
tableMixin
],
name
:
'appVersion'
,
/* 初始额外赋值*/
async
mounted
()
{
this
.
$refs
[
'TablePager'
].
pageQuery
()
},
data
()
{
return
{
options
:[
{
label
:
"是"
,
value
:
"Y"
},
{
label
:
"否"
,
value
:
"N"
},
],
/*需要的额外参数 */
DialogWidth
:
'75%'
,
showDialog
:
false
,
DialogName
:
''
,
type
:
''
,
DialogTitle
:
''
,
/* 基础url*/
baseUrl
:
'/aqgl/sbxx'
,
/* 查询参数*/
queryParams
:
{
dabh
:
''
,
sbxx
:
''
,
doc
:
''
,
xtfl
:
"0"
,
},
/* 表格标题对应参数*/
tableTitle
:
[
{
label
:
"档案编号"
,
prop
:
"dabh"
,
fieldType
:
"ftString"
,
width
:
100
},
{
label
:
"设备编号"
,
prop
:
"code"
,
fieldType
:
"ftString"
,
width
:
140
},
{
label
:
"设备名称"
,
prop
:
"name"
,
fieldType
:
"ftString"
,
width
:
160
},
// {label: "系统分类", prop: "xtflName", fieldType: "ftString",width:48},
// {label: "设备分类", prop: "sbflName", fieldType: "ftString",width:96},
{
label
:
"制造商"
,
prop
:
"productor"
,
fieldType
:
"ftString"
,
width
:
300
},
{
label
:
"型号"
,
prop
:
"model"
,
fieldType
:
"ftString"
,
width
:
300
},
{
label
:
"出厂编号"
,
prop
:
"serialno"
,
fieldType
:
"ftString"
,
width
:
300
},
{
label
:
"计量单位"
,
prop
:
"jldw"
,
fieldType
:
"ftString"
,
width
:
120
},
{
label
:
"启用日期"
,
prop
:
"qyrq"
,
fieldType
:
"ftDateTime"
},
/* {label: "停用日期", prop: "tyrq", fieldType: "ftDateTime"}, */
{
label
:
"使用状态"
,
prop
:
"tybzName"
,
fieldType
:
"ftString"
,
width
:
80
},
{
label
:
"使用地点"
,
prop
:
"sydd"
,
fieldType
:
"ftString"
,
width
:
300
},
{
label
:
"用途"
,
prop
:
"yt"
,
fieldType
:
"ftString"
,
width
:
300
},
{
label
:
"数量"
,
prop
:
"sl"
,
fieldType
:
"int"
},
{
label
:
"出厂日期"
,
prop
:
"ccrq"
,
fieldType
:
"ftDateTime"
},
{
label
:
"备注"
,
prop
:
"bz"
,
fieldType
:
"ftString"
,
width
:
300
},
{
label
:
"是否已入档"
,
prop
:
"doc"
,
fieldType
:
"ftString"
,
width
:
160
,
show
:
false
},
{
label
:
"是否已入档"
,
prop
:
"docName"
,
fieldType
:
"ftString"
,
width
:
160
}
]
}
},
methods
:
{
/* 查看人员*/
byxm
(){
if
(
this
.
app
.
selectOne
||
this
.
app
.
clickOne
)
{
this
.
DialogTitle
=
'保养项目'
this
.
showDialog
=
true
this
.
DialogName
=
'byxm'
}
else
{
this
.
$warning
(
'请选中一行操作'
);
}
},
/* 基础查询*/
query
:
doQuery
,
/* 基础增*/
apiAdd
:
doAdd
,
/* 基础更新*/
apiUpdate
:
doUpdate
,
/* 删除操作*/
apiDelete
:
doDelete
,
/* 初始化赋值操作*/
init
()
{
}
},
components
:
{
Edit
,
Byxm
}
}
</
script
>
<
style
scoped
>
</
style
>
src/views/equipment/sbbymx/selector.vue
0 → 100644
View file @
cd3db3e4
<
template
>
<DefaultDialog
:app=
'app'
>
<div
slot=
'form'
style=
"height:550px;display: flex;"
>
<div
class=
"min_full"
style=
"width:100%;height: 550px;"
>
<!-- 查询条件-->
<div
class=
"search"
v-condition
>
<SearchButton
@
click
.
native=
'search'
></SearchButton>
<!--
<el-row
:gutter=
"20"
class=
"search-row-1"
>
<el-col
:span=
"6"
class=
"search-col"
>
<div
class=
"search-item"
>
<span
class=
"search-span"
>
用户:
</span>
<el-input
v-model=
"queryParams.usercx"
size=
"small"
class=
"search-input"
></el-input>
</div>
</el-col>
<el-col
:span=
"6"
class=
"search-col"
>
<div
class=
"search-item"
>
<span
class=
"search-span"
>
电话:
</span>
<el-input
v-model=
"queryParams.phone"
size=
"small"
class=
"search-input"
></el-input>
</div>
</el-col>
</el-row>
-->
</div>
<!-- 按钮操作-->
<!-- 表格-->
<div
class=
"tablePagers"
style=
'height:450px'
>
<el-table
height=
'415'
v-loading=
"loading"
ref=
"multipleTable"
:data=
"tableData"
@
select=
"selectChange"
@
select-all=
"selectAllChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
>
</el-table-column>
<el-table-column
v-for=
"(item,index) in tableTitle"
:prop=
"item.prop"
:label=
"item.label"
align=
"center"
>
</el-table-column>
</el-table>
<el-row
type=
"flex"
class=
"pageBanner"
style=
"padding-top: 20px;"
justify=
"center"
>
<el-pagination
background
:total=
"total"
:page-size=
"pageSize"
@
size-change=
"pageSizeChange"
@
current-change=
"currentPageChange"
:current-page=
"currentPage"
:page-sizes=
"[10, 20, 30]"
layout=
"total, sizes, prev, pager, next"
>
</el-pagination>
</el-row>
</div>
</div>
</div>
<div
slot=
"reFooter"
class=
"refooter"
>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"save()"
>
确 认
</el-button>
</span>
</div>
</DefaultDialog>
</
template
>
<
script
>
/* 引入需要的接口*/
import
{
doQuery
,
doAdd
,
doUpdate
,
doDelete
}
from
'@/api/equipment/sbbyxm.js'
;
import
{
doSave
}
from
"@/api/equipment/sbbymx.js"
/* edit页面*/
import
{
tableMixin_noapp
}
from
'common'
export
default
{
mixins
:
[
tableMixin_noapp
],
props
:[
'app'
],
/* 初始额外赋值*/
async
mounted
()
{
this
.
selectedList
=
_
.
cloneDeep
(
this
.
app
.
tabData
)
this
.
getData
(
this
.
currentPage
,
this
.
pageSize
);
},
data
()
{
return
{
id
:
'id'
,
/* 已选人员列表*/
selectedList
:
[
],
pageSize
:
10
,
// 唯一标识符
id
:
"id"
,
loading
:
false
,
total
:
0
,
currentPage
:
1
,
/*需要的额外参数 */
showDialog
:
false
,
DialogName
:
''
,
type
:
''
,
DialogTitle
:
''
,
/* 基础url*/
/* 查询参数*/
queryParams
:
{
},
tableData
:[],
/* 树的标题 */
/* 表格标题对应参数*/
tableTitle
:
[
{
label
:
"编码"
,
prop
:
"code"
,
fieldType
:
"ftString"
,
width
:
120
},
{
label
:
"名称"
,
prop
:
"name"
,
fieldType
:
"ftString"
,
width
:
300
},
{
label
:
"保养周期-天"
,
prop
:
"byzq"
,
fieldType
:
"int"
,
width
:
252
},
{
label
:
"公司"
,
prop
:
"gsName"
,
fieldType
:
"ftString"
,
width
:
192
},
{
label
:
"标准工时"
,
prop
:
"bzgs"
,
fieldType
:
"float"
,
width
:
192
},
]
}
},
methods
:
{
search
(
event
){
console
.
log
(
this
.
tableTitle
)
event
.
stopPropagation
()
this
.
getData
(
this
.
currentPage
,
this
.
pageSize
);
},
getData
(
page
,
pageSize
)
{
this
.
loading
=
true
;
let
params
=
{
pageSize
:
pageSize
,
pageNo
:
page
}
params
=
{...
params
,...
this
.
queryParams
}
doQuery
(
params
).
then
(
res
=>
{
this
.
loading
=
false
;
this
.
tableData
=
res
.
data
.
records
||
[]
this
.
total
=
res
.
data
.
total
this
.
updateMark
();
})
},
addItem
(
item
)
{
this
.
selectedList
.
push
(
item
);
},
// 移除选中项
removeItem
(
item
)
{
for
(
let
[
index
,
itemTemp
]
of
this
.
selectedList
.
entries
())
{
if
(
itemTemp
[
this
.
id
]
===
item
[
this
.
id
])
{
this
.
removeItemByIndex
(
index
);
break
;
}
}
},
// 根据下标移除选中项
removeItemByIndex
(
index
,
item
)
{
this
.
selectedList
.
splice
(
index
,
1
);
// 若有item,则是点击标签上的关闭按钮,移除选中项
if
(
item
)
{
this
.
$nextTick
(()
=>
{
this
.
$refs
.
multipleTable
.
toggleRowSelection
(
// 此处必须在 tableData 中查找对应的数据,否则 toggleRowSelection 会失效
this
.
tableData
.
find
((
row
)
=>
{
return
row
[
this
.
id
]
===
item
[
this
.
id
];
}),
false
);
});
}
},
selectChange
(
selectedRows
,
row
)
{
// true为选中, 0或false为取消选中
let
selected
=
selectedRows
.
length
&&
selectedRows
.
indexOf
(
row
)
!==
-
1
;
if
(
selected
)
{
this
.
addItem
(
row
);
}
else
{
this
.
removeItem
(
row
);
}
},
// 全选/取消全选
selectAllChange
(
selectedRows
)
{
let
selectedMarkList
=
this
.
selectedList
.
map
((
item
)
=>
item
[
this
.
id
]);
// 当前页选中行的标记列表
let
pageSelectedMarkList
=
Array
.
isArray
(
selectedRows
)
?
selectedRows
.
map
((
item
)
=>
item
[
this
.
id
])
:
[];
this
.
tableData
.
forEach
((
row
)
=>
{
if
(
pageSelectedMarkList
.
includes
(
row
[
this
.
id
]))
{
if
(
!
selectedMarkList
.
includes
(
row
[
this
.
id
]))
{
this
.
addItem
(
row
);
}
}
else
if
(
selectedMarkList
.
includes
(
row
[
this
.
id
]))
{
this
.
removeItem
(
row
);
}
});
},
// 切换每页显示条数
pageSizeChange
(
newPageSize
)
{
this
.
pageSize
=
newPageSize
;
this
.
getData
(
this
.
currentPage
,
this
.
pageSize
);
},
// 切换页码--翻页
currentPageChange
(
newPage
)
{
this
.
currentPage
=
newPage
;
this
.
getData
(
this
.
currentPage
,
this
.
pageSize
);
},
// 更新勾选标记
updateMark
()
{
let
selectedMarkList
=
this
.
selectedList
.
map
((
item
)
=>
item
[
this
.
id
]);
this
.
tableData
.
forEach
((
row
)
=>
{
if
(
selectedMarkList
.
includes
(
row
[
this
.
id
]))
{
// toggleRowSelection 需在$nextTick中使用!
this
.
$nextTick
(()
=>
{
this
.
$refs
.
multipleTable
.
toggleRowSelection
(
row
);
});
}
});
},
/* 跨页*/
selectedTree
(
e
){
this
.
queryParams
.
bmid
=
e
.
id
||
'root'
this
.
getData
(
this
.
currentPage
,
this
.
pageSize
);
},
/* 基础查询*/
query
:
doQuery
,
/* treeQuery */
/* 初始化赋值操作*/
init
()
{
},
save
(){
let
params
=
{
id
:
this
.
app
.
queryParams
.
mid
,
data
:
this
.
selectedList
}
doSave
(
params
).
then
(
res
=>
{
if
(
res
.
success
){
this
.
$success
(
'保存成功'
)
this
.
app
.
$refs
[
'TablePager'
].
pageQuery
()
this
.
app
.
showDialog
=
false
}
})
}
},
components
:{
}
}
</
script
>
<
style
scoped
>
</
style
>
src/views/equipment/sbbyxm/edit.vue
View file @
cd3db3e4
...
...
@@ -14,10 +14,9 @@
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter=
"20"
>
<!--
<el-row
:gutter=
"20"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"停用标志"
ref=
"tybz"
prop=
"tybz"
>
<!--
<el-input
:readonly=
"readonly"
v-model=
"form.tybz"
></el-input>
-->
<el-select
style=
"width: 100%;"
v-model=
"form.tybz"
placeholder=
"请选择"
>
<el-option
v-for=
"item in options"
...
...
@@ -35,7 +34,7 @@
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-row>
-->
<el-row
:gutter=
"20"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"保养周期(天)"
ref=
"byzq"
prop=
"byzq"
>
...
...
@@ -93,9 +92,9 @@
//名称
name
:
''
,
//停用标志
tybz
:
''
,
//停用日期
tyrq
:
''
,
//
tybz:'',
//
//
停用日期
//
tyrq:'',
//标准工时
bzgs
:
''
,
//附件数
...
...
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