Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TOSTUMI
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
Maple
TOSTUMI
Commits
5377ba07
Commit
5377ba07
authored
Feb 01, 2021
by
Sixiang_Zzb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新建服务商提交提示优化
parent
6e123393
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
36 deletions
+22
-36
ServiceProvider.ts
src/models/ServiceProvider.ts
+22
-36
No files found.
src/models/ServiceProvider.ts
View file @
5377ba07
import
*
as
service
from
'../services/tos'
;
import
{
message
,
Modal
}
from
'antd'
;
import
{
message
,
Modal
}
from
'antd'
;
import
{
history
}
from
'umi'
;
import
*
as
service
from
'../services/tos'
;
export
default
{
export
default
{
namespace
:
'ServiceProvider'
,
namespace
:
'ServiceProvider'
,
...
@@ -27,7 +28,6 @@ export default {
...
@@ -27,7 +28,6 @@ export default {
return
{
...
state
,
SaveChooseData
};
return
{
...
state
,
SaveChooseData
};
},
},
returnCurData
(
state
:
object
,
{
CurData
}:
any
)
{
returnCurData
(
state
:
object
,
{
CurData
}:
any
)
{
console
.
log
(
CurData
)
return
{
...
state
,
CurData
};
return
{
...
state
,
CurData
};
},
},
returnResult
(
state
:
object
,
{
Result
}:
any
)
{
returnResult
(
state
:
object
,
{
Result
}:
any
)
{
...
@@ -39,28 +39,22 @@ export default {
...
@@ -39,28 +39,22 @@ export default {
// 获取服务商
// 获取服务商
*
TosTosServiceProviderGet
({
playload
}:
any
,
{
call
,
put
}:
any
)
{
*
TosTosServiceProviderGet
({
playload
}:
any
,
{
call
,
put
}:
any
)
{
const
resp
=
yield
call
(
service
.
TosTosServiceProviderGet
,
playload
);
const
resp
=
yield
call
(
service
.
TosTosServiceProviderGet
,
playload
);
console
.
log
(
resp
);
if
(
resp
.
error_code
===
'0000'
)
{
if
(
resp
.
error_code
==
'0000'
)
{
const
Data
=
resp
.
data
;
let
Data
=
resp
.
data
;
yield
put
({
type
:
'returnPage'
,
Data
});
yield
put
({
type
:
'returnPage'
,
Data
});
}
else
{
}
else
{
console
.
log
(
resp
);
console
.
log
(
'请求错误码:'
+
resp
.
error_code
);
message
.
error
(
resp
.
error_msg
);
message
.
error
(
resp
.
error_msg
);
let
Data
=
undefined
;
const
Data
=
undefined
;
console
.
log
(
playload
);
yield
put
({
type
:
'returnPage'
,
Data
});
yield
put
({
type
:
'returnPage'
,
Data
});
}
}
},
},
// 新建服务商
// 新建服务商
*
TosTosServiceProviderSave
({
playload
}:
any
,
{
call
,
put
}:
any
)
{
*
TosTosServiceProviderSave
({
playload
}:
any
,
{
call
,
put
}:
any
)
{
console
.
log
(
playload
);
const
resp
=
yield
call
(
service
.
TosTosServiceProviderSave
,
playload
);
const
resp
=
yield
call
(
service
.
TosTosServiceProviderSave
,
playload
);
console
.
log
(
resp
);
// 服务范围选择错误
// 服务范围选择错误
if
(
resp
.
error_code
===
"0002"
)
{
if
(
resp
.
error_code
===
"0002"
)
{
le
t
CurData
:
Boolean
=
false
;
cons
t
CurData
:
Boolean
=
false
;
yield
put
({
type
:
"returnCurData"
,
CurData
});
yield
put
({
type
:
"returnCurData"
,
CurData
});
// message.error("Service scope selection error!!!")
// message.error("Service scope selection error!!!")
Modal
.
error
({
Modal
.
error
({
...
@@ -72,7 +66,7 @@ export default {
...
@@ -72,7 +66,7 @@ export default {
// 小区选择错误
// 小区选择错误
if
(
resp
.
error_code
===
"0003"
)
{
if
(
resp
.
error_code
===
"0003"
)
{
le
t
CurData
:
Boolean
=
false
;
cons
t
CurData
:
Boolean
=
false
;
yield
put
({
type
:
"returnCurData"
,
CurData
});
yield
put
({
type
:
"returnCurData"
,
CurData
});
Modal
.
error
({
Modal
.
error
({
title
:
'Service selection error'
,
title
:
'Service selection error'
,
...
@@ -83,7 +77,7 @@ export default {
...
@@ -83,7 +77,7 @@ export default {
// 提交失败
// 提交失败
if
(
resp
.
error_code
===
"0001"
)
{
if
(
resp
.
error_code
===
"0001"
)
{
le
t
CurData
:
Boolean
=
false
;
cons
t
CurData
:
Boolean
=
false
;
yield
put
({
type
:
'returnCurData'
,
CurData
});
yield
put
({
type
:
'returnCurData'
,
CurData
});
message
.
error
(
'Creation failed. Please try again!'
);
message
.
error
(
'Creation failed. Please try again!'
);
return
;
return
;
...
@@ -93,38 +87,35 @@ export default {
...
@@ -93,38 +87,35 @@ export default {
if
(
resp
.
error_code
===
"0000"
)
{
if
(
resp
.
error_code
===
"0000"
)
{
// message.success('Operator Success!', 1.5, () => {
// message.success('Operator Success!', 1.5, () => {
// });
// });
window
.
location
.
href
=
'/UserManagement/ServiceProviderManagement'
;
const
CurData
:
Boolean
=
true
;
let
CurData
:
Boolean
=
true
;
yield
put
({
type
:
'returnCurData'
,
CurData
});
yield
put
({
type
:
'returnCurData'
,
CurData
});
window
.
location
.
href
=
'/UserManagement/ServiceProviderManagement'
;
return
;
return
;
}
}
// 小区选择错误
// 小区选择错误
if
(
resp
.
error_code
===
"0004"
)
{
if
(
resp
.
error_code
===
"0004"
)
{
le
t
CurData
:
Boolean
=
false
;
cons
t
CurData
:
Boolean
=
false
;
yield
put
({
type
:
"returnCurData"
,
CurData
});
yield
put
({
type
:
"returnCurData"
,
CurData
});
message
.
error
(
"Company name already exists!"
)
message
.
error
(
"Company name already exists!"
);
return
;
}
}
},
},
//获取服务商保安根据服务商名
//
获取服务商保安根据服务商名
*
TosSecurityGuarderGet
({
playload
}:
any
,
{
call
,
put
}:
any
)
{
*
TosSecurityGuarderGet
({
playload
}:
any
,
{
call
,
put
}:
any
)
{
console
.
log
(
playload
);
const
resp
=
yield
call
(
service
.
TosSecurityGuarderGet
,
playload
);
const
resp
=
yield
call
(
service
.
TosSecurityGuarderGet
,
playload
);
console
.
log
(
resp
);
const
CurDataFollow
=
resp
.
data
.
rows
;
let
CurDataFollow
=
resp
.
data
.
rows
;
yield
put
({
type
:
'returnCurDataFollow'
,
CurDataFollow
});
yield
put
({
type
:
'returnCurDataFollow'
,
CurDataFollow
});
},
},
//获取服务商保安详情根据服务商名
//
获取服务商保安详情根据服务商名
*
GuarderById
({
playload
}:
any
,
{
call
,
put
}:
any
)
{
*
GuarderById
({
playload
}:
any
,
{
call
,
put
}:
any
)
{
le
t
CurDataFollowDetail
=
playload
;
cons
t
CurDataFollowDetail
=
playload
;
yield
put
({
type
:
'returnCurDataFollowDetail'
,
CurDataFollowDetail
});
yield
put
({
type
:
'returnCurDataFollowDetail'
,
CurDataFollowDetail
});
},
},
*
SaveChooseData
({
playload
}:
any
,
{
call
,
put
}:
any
)
{
*
SaveChooseData
({
playload
}:
any
,
{
call
,
put
}:
any
)
{
le
t
SaveChooseData
=
playload
;
cons
t
SaveChooseData
=
playload
;
yield
put
({
type
:
'returnSaveChooseData'
,
SaveChooseData
});
yield
put
({
type
:
'returnSaveChooseData'
,
SaveChooseData
});
},
},
...
@@ -132,36 +123,31 @@ export default {
...
@@ -132,36 +123,31 @@ export default {
*
DelServiceProvider
({
playload
}:
any
,
{
call
,
put
}:
any
)
{
*
DelServiceProvider
({
playload
}:
any
,
{
call
,
put
}:
any
)
{
const
resp
=
yield
call
(
service
.
TosTosServiceProviderDel
,
playload
);
const
resp
=
yield
call
(
service
.
TosTosServiceProviderDel
,
playload
);
if
(
resp
.
error_code
===
'0000'
)
{
if
(
resp
.
error_code
===
'0000'
)
{
le
t
Result
=
true
;
cons
t
Result
=
true
;
yield
put
({
type
:
'returnResult'
,
Result
});
yield
put
({
type
:
'returnResult'
,
Result
});
}
else
{
}
else
{
le
t
Result
=
false
;
cons
t
Result
=
false
;
yield
put
({
type
:
'returnResult'
,
Result
});
yield
put
({
type
:
'returnResult'
,
Result
});
}
}
},
},
*
ResultClear
({
playload
}:
any
,
{
call
,
put
}:
any
)
{
*
ResultClear
({
playload
}:
any
,
{
call
,
put
}:
any
)
{
console
.
log
(
'清除数据'
);
const
Result
=
null
;
let
Result
=
null
;
yield
put
({
type
:
'returnResult'
,
Result
});
yield
put
({
type
:
'returnResult'
,
Result
});
},
},
*
DelGuarder
({
playload
}:
any
,
{
call
,
put
}:
any
)
{
*
DelGuarder
({
playload
}:
any
,
{
call
,
put
}:
any
)
{
console
.
log
(
'删除保安'
);
console
.
log
(
playload
);
const
res
=
yield
call
(
service
.
TosGuarderDel
,
playload
);
const
res
=
yield
call
(
service
.
TosGuarderDel
,
playload
);
console
.
log
(
res
);
if
(
res
.
error_code
===
'0000'
)
{
if
(
res
.
error_code
===
'0000'
)
{
message
.
success
(
'Safer information deleted successfully!!!'
);
message
.
success
(
'Safer information deleted successfully!!!'
);
history
.
go
(
-
1
);
history
.
go
Back
(
);
}
else
{
}
else
{
message
.
error
(
'Deletion failed,Please try again'
);
message
.
error
(
'Deletion failed,Please try again'
);
}
}
},
},
*
CurDataClear
({
playload
}:
any
,
{
call
,
put
}:
any
)
{
*
CurDataClear
({
playload
}:
any
,
{
call
,
put
}:
any
)
{
console
.
log
(
'清除数据'
);
const
CurData
=
null
;
let
CurData
=
null
;
yield
put
({
type
:
'returnCurData'
,
CurData
});
yield
put
({
type
:
'returnCurData'
,
CurData
});
},
},
},
},
...
...
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