Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
a0aa16e2
Commit
a0aa16e2
authored
Nov 21, 2019
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
59bcc2bc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
6 deletions
+23
-6
bigdata/app/base/controller/impl/common/companyCtl.js
+2
-2
bigdata/app/base/service/impl/common/companySve.js
+12
-3
bigdata/app/front/vues/pages/apps/apps.js
+9
-1
No files found.
bigdata/app/base/controller/impl/common/companyCtl.js
View file @
a0aa16e2
...
...
@@ -40,8 +40,8 @@ class CompanyCtl extends CtlBase {
async
giveupApp
(
p
,
q
,
req
){
var
comid
=
p
.
compid
;
var
appid
=
p
.
appid
;
await
this
.
service
.
giveupApp
(
comid
,
appid
);
return
system
.
getResult
(
{}
);
var
rtn
=
await
this
.
service
.
giveupApp
(
comid
,
appid
);
return
system
.
getResult
(
rtn
);
}
//设置当前用户选择的公司为当前公司
async
settocompany
(
p
,
q
,
req
){
...
...
bigdata/app/base/service/impl/common/companySve.js
View file @
a0aa16e2
...
...
@@ -35,10 +35,19 @@ class CompanyService extends ServiceBase {
});
}
async
giveupApp
(
comid
,
appid
){
var
self
=
this
;
return
this
.
db
.
transaction
(
async
function
(
t
){
//检查当前company_id下面是否有
await
this
.
db
.
models
.
companyapp
.
destroy
({
where
:{
company_id
:
comid
,
app_id
:
appid
}});
return
{};
//检查当前company_id下面是否有用户存在,如果已经存在就不要删除了
var
c
=
await
self
.
db
.
models
.
user
.
count
({
where
:{
owner_id
:
comid
}});
if
(
c
>
1
){
return
null
;
}
else
{
if
(
c
==
1
){
await
self
.
db
.
models
.
user
.
destroy
({
where
:{
owner_id
:
comid
},
force
:
true
});
}
await
self
.
db
.
models
.
companyapp
.
destroy
({
where
:{
company_id
:
comid
,
app_id
:
appid
}});
return
{};
}
});
}
async
buyApp
(
p
,
cmid
,
user
){
...
...
bigdata/app/front/vues/pages/apps/apps.js
View file @
a0aa16e2
...
...
@@ -159,7 +159,15 @@
}
if
(
key
==
"giveup"
){
var
d
=
await
this
.
$root
.
postReq
(
"/web/common/companyCtl/giveupApp"
,
{
compid
:
this
.
selCompanyid
,
appid
:
row
.
id
});
this
.
$refs
.
cgrid
.
linkInInitQuery
(
"company_id"
,
this
.
selCompanyid
);
if
(
d
.
status
==
0
){
this
.
$refs
.
cgrid
.
linkInInitQuery
(
"company_id"
,
this
.
selCompanyid
);
}
else
{
this
.
$message
({
type
:
'warning'
,
message
:
'应用已经产生数据,不能解除应用'
});
}
}
this
.
currow
=
row
;
}
...
...
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