Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yindong-tongbai-automation
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lichunliang
yindong-tongbai-automation
Commits
6c5d8e92
Commit
6c5d8e92
authored
Apr 09, 2025
by
forevertyler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add:工种管理
parent
acf49d88
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
283 additions
and
1 deletion
+283
-1
workType.js
src/api/tyler/workType.js
+53
-0
index.vue
src/views/system/menu/index.vue
+0
-1
index.vue
src/views/system/workType/index.vue
+230
-0
No files found.
src/api/tyler/workType.js
0 → 100644
View file @
6c5d8e92
import
request
from
'
@/utils/request
'
// 查询工种列表
export
function
listType
(
query
)
{
return
request
({
url
:
'
/business/type/list
'
,
method
:
'
get
'
,
params
:
query
})
}
// 查询工种所有列表
export
function
listAllType
(
query
)
{
return
request
({
url
:
'
/business/type/listAll
'
,
method
:
'
get
'
,
params
:
query
})
}
// 查询工种详细
export
function
getType
(
id
)
{
return
request
({
url
:
'
/business/type/getInfo/
'
+
id
,
method
:
'
get
'
})
}
// 新增工种
export
function
addType
(
data
)
{
return
request
({
url
:
'
/business/type/add
'
,
method
:
'
post
'
,
data
:
data
})
}
// 修改工种
export
function
updateType
(
data
)
{
return
request
({
url
:
'
/business/type/edit
'
,
method
:
'
post
'
,
data
:
data
})
}
// 删除工种
export
function
delType
(
id
)
{
return
request
({
url
:
'
/business/type/remove/
'
+
id
,
method
:
'
get
'
})
}
src/views/system/menu/index.vue
View file @
6c5d8e92
...
@@ -33,7 +33,6 @@
...
@@ -33,7 +33,6 @@
icon=
"el-icon-plus"
icon=
"el-icon-plus"
size=
"mini"
size=
"mini"
@
click=
"handleAdd"
@
click=
"handleAdd"
v-hasPermi=
"['system:menu:add']"
>
新增
</el-button>
>
新增
</el-button>
</el-col>
</el-col>
<el-col
:span=
"1.5"
>
<el-col
:span=
"1.5"
>
...
...
src/views/system/workType/index.vue
0 → 100644
View file @
6c5d8e92
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"工种名称"
prop=
"worName"
>
<el-input
v-model=
"queryParams.worName"
placeholder=
"请输入工种名称"
clearable
@
keyup.enter.native=
"handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-form>
<el-table
v-loading=
"loading"
:data=
"typeList"
>
<!--
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
-->
<el-table-column
label=
"序号"
align=
"center"
type=
"index"
width=
"60"
/>
<el-table-column
label=
"工种名称"
align=
"center"
prop=
"worName"
/>
<!--
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['business:type:edit']"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['business:type:remove']"
>
删除
</el-button>
</
template
>
</el-table-column>
-->
</el-table>
<pagination
v-show=
"total>0"
:total=
"total"
:page.sync=
"queryParams.pageNum"
:limit.sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
<!-- 添加或修改工种对话框 -->
<el-dialog
:title=
"title"
:visible.sync=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"工种名称"
prop=
"worName"
>
<el-input
v-model=
"form.worName"
placeholder=
"请输入工种名称"
/>
</el-form-item>
<el-form-item
label=
"工种说明"
prop=
"description"
>
<el-input
v-model=
"form.description"
placeholder=
"请输入工种说明"
/>
</el-form-item>
<el-form-item
label=
"入井时间"
prop=
"entryWellTime"
>
<el-input
v-model=
"form.entryWellTime"
placeholder=
"请输入入井时间"
/>
</el-form-item>
<el-form-item
label=
"通用编码"
prop=
"generalCode"
>
<el-input
v-model=
"form.generalCode"
placeholder=
"请输入通用编码"
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
</div>
</template>
<
script
>
import
{
getType
,
listType
}
from
"
@/api/tyler/workType
"
;
export
default
{
name
:
"
Type
"
,
data
()
{
return
{
// 根路径
baseURL
:
process
.
env
.
VUE_APP_BASE_API
,
// 遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 工种表格数据
typeList
:
[],
// 弹出层标题
title
:
""
,
// 是否显示弹出层
open
:
false
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
worName
:
null
,
},
// 表单参数
form
:
{},
// 表单校验
rules
:
{
id
:
[
{
required
:
true
,
message
:
"
唯一标识符,自增主键不能为空
"
,
trigger
:
"
blur
"
}
],
worName
:
[
{
required
:
true
,
message
:
"
工种名称不能为空
"
,
trigger
:
"
blur
"
}
],
description
:
[
{
required
:
true
,
message
:
"
工种说明不能为空
"
,
trigger
:
"
blur
"
}
],
entryWellTime
:
[
{
required
:
true
,
message
:
"
入井时间不能为空
"
,
trigger
:
"
blur
"
}
],
generalCode
:
[
{
required
:
true
,
message
:
"
通用编码不能为空
"
,
trigger
:
"
blur
"
}
]
}
};
},
created
()
{
this
.
getList
();
},
methods
:
{
/** 查询工种列表 */
getList
()
{
this
.
loading
=
true
;
listType
(
this
.
queryParams
).
then
(
response
=>
{
this
.
typeList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
});
},
// 取消按钮
cancel
()
{
this
.
open
=
false
;
this
.
reset
();
},
// 表单重置
reset
()
{
this
.
form
=
{
id
:
null
,
worName
:
null
,
description
:
null
,
entryWellTime
:
null
,
generalCode
:
null
};
this
.
resetForm
(
"
form
"
);
},
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"
queryForm
"
);
this
.
handleQuery
();
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
id
)
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
();
this
.
open
=
true
;
this
.
title
=
"
添加工种
"
;
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
();
const
id
=
row
.
id
||
this
.
ids
getType
(
id
).
then
(
response
=>
{
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
title
=
"
修改工种
"
;
});
},
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"
form
"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
id
!=
null
)
{
updateType
(
this
.
form
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"
修改成功
"
);
this
.
open
=
false
;
this
.
getList
();
});
}
else
{
addType
(
this
.
form
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"
新增成功
"
);
this
.
open
=
false
;
this
.
getList
();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
ids
=
row
.
id
||
this
.
ids
;
this
.
$modal
.
confirm
(
'
是否确认删除工种编号为"
'
+
ids
+
'
"的数据项?
'
).
then
(
function
()
{
return
delType
(
ids
);
}).
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"
删除成功
"
);
}).
catch
(()
=>
{});
},
/** 导出按钮操作 */
handleExport
()
{
this
.
download
(
'
business/type/export
'
,
{
...
this
.
queryParams
},
`type_
${
new
Date
().
getTime
()}
.xlsx`
)
}
}
};
</
script
>
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