Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
founder_vue
Overview
Overview
Details
Activity
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
常超
founder_vue
Commits
f86fc371
Commit
f86fc371
authored
Dec 02, 2022
by
liuguorong93
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
技术人员信息(新增)
parent
343d11bd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
94 additions
and
8 deletions
+94
-8
src/api/menuDataApi/artisanManageApi.js
+9
-0
src/assets/styles/detailContent.scss
+0
-1
src/views/artisanManage/components/artisanManageEdit.vue
+85
-7
No files found.
src/api/menuDataApi/artisanManageApi.js
View file @
f86fc371
...
...
@@ -4,3 +4,11 @@ export let baseUrl = '/api'
// 获取警犬技术人员管理列表接口
export
const
getArtisanList
=
params
=>
postJson
(
`
${
baseUrl
}
/artisanController/getArtisanPage`
,
params
)
// 技术人员信息(新增)
export
const
addArtisan
=
params
=>
postJson
(
`
${
baseUrl
}
/artisanController/saveArtisan`
,
params
)
// 技术人员信息(编辑)
export
const
editArtisan
=
params
=>
postJson
(
`
${
baseUrl
}
/artisanController/updateArtisanById`
,
params
)
\ No newline at end of file
src/assets/styles/detailContent.scss
View file @
f86fc371
...
...
@@ -5,7 +5,6 @@
.detailContentClass
{
position
:
relative
;
width
:
100%
;
height
:
100%
;
padding
:
24px
;
.contents
{
...
...
src/views/artisanManage/components/artisanManageEdit.vue
View file @
f86fc371
<
template
>
<div
class=
"detailContentClass"
>
<div
class=
"detailContentClass"
v-loading=
"loading"
>
<div
class=
"contents"
>
<el-form
:model=
"detailInfo"
...
...
@@ -266,7 +269,10 @@
<div
class=
"hengLine"
></div>
<div
class=
"elBtns"
>
<el-button
size=
"medium"
>
返回
</el-button>
<el-button
size=
"medium"
@
click=
"goBack"
>
返回
</el-button>
<el-button
type=
"primary"
size=
"medium"
...
...
@@ -283,11 +289,14 @@ import moment from "moment";
import
{
getBirthAndSexForSfzh
}
from
"@/utils/mk.js"
;
import
{
getJsonDataApi
}
from
"@/utils/getJsonData.js"
;
import
rules
from
"@/utils/rules2.js"
;
import
{
addArtisan
,
editArtisan
}
from
"@/api/menuDataApi/artisanManageApi.js"
;
export
default
{
name
:
"artisanManageEdit"
,
data
()
{
return
{
loading
:
false
,
routeName
:
""
,
detailInfo
:
{
personName
:
""
,
idNo
:
""
,
...
...
@@ -352,8 +361,8 @@ export default {
workYears
:
[
{
required
:
true
,
message
:
"请
输入
从事警犬技术工作时间"
,
trigger
:
"
blur
"
,
message
:
"请
选择
从事警犬技术工作时间"
,
trigger
:
"
change
"
,
},
],
xxdjryXm
:
[
...
...
@@ -383,8 +392,8 @@ export default {
},
async
mounted
()
{
// 判断是新增/编辑页面
let
routeName
=
this
.
$route
.
name
||
""
;
if
(
routeName
===
"artisanManageEdit"
)
{
this
.
routeName
=
this
.
$route
.
name
||
""
;
if
(
this
.
routeName
===
"artisanManageEdit"
)
{
// 编辑
}
else
{
// 新增
...
...
@@ -421,9 +430,78 @@ export default {
saveData
()
{
this
.
$refs
.
detailInfoRef
.
validate
((
result
)
=>
{
if
(
result
)
{
console
.
log
(
"ok"
);
let
jqxph
=
""
;
if
(
this
.
tableData
&&
this
.
tableData
.
length
)
{
this
.
tableData
.
forEach
((
item
)
=>
{
if
(
item
.
xinpianhao
)
jqxph
=
jqxph
+
item
.
xinpianhao
+
","
;
});
jqxph
=
jqxph
.
substr
(
0
,
jqxph
.
length
-
1
);
}
let
params
=
{
personName
:
this
.
detailInfo
.
personName
,
idNo
:
this
.
detailInfo
.
idNo
,
gender
:
this
.
detailInfo
.
gender
===
"男"
?
"1"
:
"0"
,
birthDate
:
this
.
detailInfo
.
birthDate
,
isjwzy
:
this
.
detailInfo
.
isjwzy
,
school
:
this
.
detailInfo
.
school
,
unitName
:
this
.
detailInfo
.
unitName
,
jwjsxl
:
this
.
detailInfo
.
jwjsxl
,
workYears
:
String
(
this
.
detailInfo
.
workYears
),
sxjq
:
this
.
tableData
&&
this
.
tableData
.
length
?
String
(
this
.
tableData
.
length
)
:
"0"
,
jqxph
,
xxdjryXm
:
this
.
detailInfo
.
xxdjryXm
,
xxdjryGmsfhm
:
this
.
detailInfo
.
xxdjryGmsfhm
,
xxdjdwGajgmc
:
this
.
detailInfo
.
xxdjdwGajgmc
,
xxdjdwGajgjgdm
:
this
.
detailInfo
.
xxdjdwGajgjgdm
,
djsj
:
moment
().
format
(
"YYYY-MM-DD HH:mm:ss"
),
id
:
this
.
detailInfo
.
id
||
""
,
};
if
(
this
.
routeName
===
"artisanManageEdit"
)
{
this
.
editParams
(
params
);
}
else
{
this
.
addParams
(
params
);
}
}
});
},
editParams
(
params
)
{},
addParams
(
params
)
{
this
.
loading
=
true
;
addArtisan
(
params
)
.
then
((
res
)
=>
{
if
(
res
.
code
===
200
&&
res
.
success
)
{
this
.
$message
({
message
:
"保存成功"
,
type
:
"success"
,
duration
:
1000
,
});
this
.
loading
=
false
;
return
;
}
this
.
loading
=
false
;
this
.
$message
({
message
:
res
.
message
,
type
:
"warning"
,
duration
:
1000
,
});
})
.
catch
((
e
)
=>
{
console
.
log
(
e
);
this
.
loading
=
false
;
this
.
$message
({
message
:
"更新失败"
,
type
:
"warning"
,
duration
:
1000
,
});
});
},
goBack
()
{
this
.
$router
.
push
({
name
:
"artisanManage"
});
},
},
watch
:
{},
...
...
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