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
206882e0
Commit
206882e0
authored
Mar 26, 2020
by
zhaoxiqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
4781e212
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
350 additions
and
13 deletions
+350
-13
bpo-admin/app/base/controller/impl/offlinecompanyCtl.js
+42
-0
bpo-admin/app/base/db/metadata/apps/platform.js
+0
-0
bpo-admin/app/base/db/models/offlinecompany.js
+0
-1
bpo-admin/app/base/service/impl/offlinecompanySve.js
+43
-12
bpo-admin/app/front/vues/pages/offlinecompany/offlinecompany.html
+100
-0
bpo-admin/app/front/vues/pages/offlinecompany/offlinecompany.js
+165
-0
No files found.
bpo-admin/app/base/controller/impl/offlinecompanyCtl.js
0 → 100644
View file @
206882e0
var
system
=
require
(
"../../system"
)
var
settings
=
require
(
"../../../config/settings"
);
const
CtlBase
=
require
(
"../ctl.base"
);
const
moment
=
require
(
"moment"
);
class
offlinecompanyCtl
extends
CtlBase
{
constructor
()
{
super
(
CtlBase
.
getServiceName
(
offlinecompanyCtl
));
}
async
allList
(
queryobj
,
qobj
,
req
)
{
try
{
var
params
=
qobj
;
var
page
=
await
this
.
service
.
pageByCondition
(
params
);
console
.
log
(
page
)
return
system
.
getResult2
(
page
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getErrResult2
(
"您的网络不稳, 请稍后重试"
);
}
}
async
getinfo
(
queryobj
,
qobj
,
req
){
console
.
log
(
qobj
)
let
channel
=
await
this
.
service
.
findById
(
qobj
.
id
);
return
system
.
getResult2
(
channel
);
}
async
companylSave
(
queryobj
,
qobj
,
req
){
try
{
var
rs
=
await
this
.
service
.
updateCreate
(
qobj
);
return
rs
;
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getErrResult2
(
"出现异常,请联系管理员"
);
}
}
}
module
.
exports
=
offlinecompanyCtl
;
bpo-admin/app/base/db/metadata/apps/platform.js
View file @
206882e0
This diff is collapsed.
Click to expand it.
bpo-admin/app/base/db/models/offlinecompany.js
View file @
206882e0
...
...
@@ -17,7 +17,6 @@ module.exports = (db, DataTypes) => {
// define the table's name
tableName
:
'c_offline_company'
,
validate
:
{
},
indexes
:[
// Create a unique index on email
...
...
bpo-admin/app/base/service/impl/offlinecompanySve.js
View file @
206882e0
...
...
@@ -6,25 +6,56 @@ class OfflinecompanyService extends ServiceBase{
super
(
ServiceBase
.
getDaoName
(
OfflinecompanyService
));
}
async
pageByCondition
(
params
)
{
var
currentPage
=
Number
(
params
.
currentPage
||
0
);
var
pageSize
=
Number
(
params
.
pageSize
||
10
);
var
where
=
{};
if
(
params
.
name
)
{
where
.
company_name
=
{
[
this
.
db
.
Op
.
like
]:
"%"
+
params
.
name
+
"%"
};
}
var
orderby
=
[
[
"id"
,
'desc'
]
];
var
attributes
=
[
"id"
,
"company_name"
,
"contact_man"
,
"contact_mobile"
,
"contact_email"
,
"contact_addr"
,
"created_at"
];
var
page
=
await
this
.
getPageList
(
currentPage
,
pageSize
,
where
,
orderby
,
attributes
);
if
(
page
&&
page
.
rows
)
{
for
(
var
row
of
page
.
rows
)
{
this
.
handleDate
(
row
,
[
"created_at"
],
null
,
-
8
);
}
}
return
page
;
}
async
updateCreate
(
params
){
params
.
company_name
=
params
.
merchant_name
;
var
offlinecompany
=
await
this
.
dao
.
findOne
({
company_name
:
params
.
merchant_name
});
if
(
offlinecompany
){
offlinecompany
.
contact_man
=
params
.
contact_man
;
offlinecompany
.
contact_mobile
=
params
.
contact_mobile
;
offlinecompany
.
contact_email
=
params
.
contact_email
;
offlinecompany
.
contact_addr
=
params
.
contact_addr
;
var
updates
=
await
offlinecompany
.
save
();
var
offlinecompany
=
await
this
.
dao
.
findOne
({
company_name
:
params
.
company_name
});
if
(
offlinecompany
&&
!
params
.
id
){
return
{
status
:
-
1
,
msg
:
"商户已存在"
}
}
if
(
params
.
id
){
var
offlinecompanys
=
await
this
.
dao
.
findById
(
params
.
id
);
offlinecompanys
.
company_name
=
params
.
company_name
;
offlinecompanys
.
contact_man
=
params
.
contact_man
;
offlinecompanys
.
contact_mobile
=
params
.
contact_mobile
;
offlinecompanys
.
contact_email
=
params
.
contact_email
;
offlinecompanys
.
contact_addr
=
params
.
contact_addr
;
var
updates
=
await
offlinecompanys
.
save
();
if
(
updates
.
id
>
0
){
return
updates
;
return
{
status
:
0
,
msg
:
"修改成功"
}
;
}
return
-
1
;
return
{
status
:
-
1
,
msg
:
"修改失败"
}
;
}
var
saves
=
await
this
.
dao
.
create
(
params
);
if
(
saves
.
id
>
0
){
return
saves
;
return
{
status
:
0
,
msg
:
"添加成功"
}
;
}
return
-
1
;
return
{
status
:
-
1
,
msg
:
"添加失败"
}
;
}
...
...
bpo-admin/app/front/vues/pages/offlinecompany/offlinecompany.html
0 → 100644
View file @
206882e0
<gsb-pcpage>
<style>
::el-radio-button__inner
{
border-color
:
#D9D9D9
;
}
</style>
<div
style=
"padding:20px;"
>
<div
style=
"height: auto;min-width: 1000px; max-width: 1500px;"
>
<el-card
style=
"background-color: #FFFFFF;padding:10px 10px 30px 10px;margin-top: 20px;"
>
<div
style=
"width:100%;line-height: 40px;"
>
<div
style=
"float:left;width: 300px;"
>
<span
style=
"color:2F2F2F;font-size: 14px;"
>
商户名称:
</span>
<el-input
v-model=
"search.name"
placeholder=
"请输商户名称"
maxlength=
"100"
clearable
style=
"max-width:200px;height: 36px;"
></el-input>
</div>
<div
style=
"float:left;margin-top:5px;"
>
<el-button
@
click=
"resetSearch()"
style=
"float:right;width:68px;height:36px;background-color: #54C4A7;color: #FFFFFF;font-size: 14px;padding-top:10px;"
>
重置
</el-button>
<el-button
@
click=
"opSearch"
style=
"float:right;width:68px;height:36px;background-color: #54C4A7;color: #FFFFFF;font-size: 14px;padding-top:10px;margin-right: 10px;"
>
搜索
</el-button>
</div>
</div>
</el-card>
<el-card
style=
"background-color: #FFFFFF;padding:10px 10px 30px 10px;margin-top: 20px;"
>
<div>
<div
style=
"line-height: 36px;padding-bottom: 20px;"
>
<span
style=
"float:left;color:#2F2F2F;font-size: 14px;"
>
共{{search.total}}条记录
</span>
<el-button
@
click=
"openEdit()"
style=
"float:right;width:100px;height:36px;color: #FFFFFF;font-weight: 400;border-radius: 4px;font-size: 14px;background-color: #59C1A6;padding-top:11px"
>
增加商户
</el-button>
</div>
<div>
<el-table
stripe
fix=
"true"
:data=
"search.list"
tooltip-effect=
"light"
style=
"min-width: 1000px;max-width: 1500px;margin-top: 23px;min-height: 500px;"
empty-text=
"暂无需求"
header-cell-style=
"background-color: #F5F5F5;color: #2F2F2F;font-size: 14px;font-weight:400;"
row-style=
"height:50px;"
>
<el-table-column
prop=
"id"
label=
"商户ID"
:formatter=
"onColFormater"
width=
"80"
align=
"center"
></el-table-column>
<el-table-column
prop=
"company_name"
label=
"商户名称"
:formatter=
"onColFormater"
align=
"center"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop=
"contact_man"
label=
"联系人"
:formatter=
"onColFormater"
align=
"center"
></el-table-column>
<el-table-column
prop=
"contact_mobile"
label=
"联系人电话"
:formatter=
"onColFormater"
align=
"center"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop=
"contact_email"
label=
"联系人邮箱"
:formatter=
"onColFormater"
align=
"center"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop=
"contact_addr"
label=
"联系地址"
:formatter=
"onColFormater"
align=
"center"
show-overflow-tooltip
></el-table-column>
<el-table-column
label=
"操作"
align=
"center"
>
<template
slot-scope=
"scope"
>
<a
href=
"javascript:;"
@
click=
"openEdit(scope.row.id)"
style=
"text-decoration: none;color:#59C1A6;font-size: 14px;"
>
修改
</a>
</template>
</el-table-column>
</el-table>
<div
style=
"width:100%;text-align: center;margin-top: 20px"
>
<el-pagination
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"search.currentPage"
:page-sizes=
"[10, 20, 50, 100]"
:page-size=
"search.pageSize"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"search.total"
>
</el-pagination>
</div>
</div>
</div>
</el-card>
<el-dialog
width=
"862px"
:visible
.
sync=
"showEdit"
>
<div
slot=
"title"
>
<span
style=
"margin-left:9px;margin-top:-3px;;width:72px; height:25px; font-size:18px; font-family:PingFangSC-Regular; font-weight:400; color:rgba(51,51,51,1); line-height:25px;"
>
{{editTitle}}商户
</span>
<div
style=
"width: 862px; height: 1px;background-color: #E3E3E3;margin: 17px 20px 0px -20px"
></div>
</div>
<el-form
:model=
"offlinecompanys"
:rules=
"rules"
ref=
"offlinecompanys"
label-width=
"100px"
label=
"right"
style=
"padding:0px 100px;"
>
<div
style=
"0px 10px; line-height: 15px;padding-bottom:40px;"
>
<div
style=
"width:2px;height:15px;float: left;background-color: #54C4A7"
>
</div>
<span
style=
"font-size:15px;color: #333333;float: left;font-weight:bold;margin-left: 7px;"
>
商户信息
</span>
</div>
<el-form-item
label=
"商户名称:"
prop=
"company_name"
>
<el-input
v-model=
"offlinecompanys.company_name"
placeholder=
"请输入商户名称"
maxlength=
"200"
style=
"width:468px;"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"联系人:"
prop=
"contact_man"
>
<el-input
v-model=
"offlinecompanys.contact_man"
placeholder=
"请输入联系人"
maxlength=
"200"
style=
"width:468px;"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"联系电话:"
prop=
"contact_mobile"
>
<el-input
v-model=
"offlinecompanys.contact_mobile"
placeholder=
"请输入联系电话"
maxlength=
"11"
style=
"width:468px;"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"联系邮箱:"
prop=
"contact_email"
>
<el-input
v-model=
"offlinecompanys.contact_email"
placeholder=
"请输入联系邮箱"
maxlength=
"100"
style=
"width:468px;"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"联系地址:"
prop=
"contact_addr"
>
<el-input
v-model=
"offlinecompanys.contact_addr"
placeholder=
"请输入联系地址"
maxlength=
"200"
style=
"width:468px;"
clearable
></el-input>
</el-form-item>
</el-form>
<div
style=
"margin-left: 200px;"
>
<el-button
:loading=
"saveLoading"
@
click=
"saveCompany"
style=
"width:120px;height:36px; background:#54C4A7; border-radius:4px;color: #FFFFFF;font-size: 16px;padding-top: 10px;"
>
保存
</el-button>
</div>
</el-dialog>
</div>
</gsb-pcpage>
bpo-admin/app/front/vues/pages/offlinecompany/offlinecompany.js
0 → 100644
View file @
206882e0
{
template
:
'${tmpl}'
,
data
:
function
()
{
var
validMethod
=
(
rule
,
value
,
callback
)
=>
{
return
this
.
validfileds
(
rule
,
value
,
callback
);
};
return
{
offlinecompanys
:
{},
editTitle
:
"新增"
,
showEdit
:
false
,
saveLoading
:
false
,
ownerList
:[],
ownerMap
:[],
ownerLoading
:
false
,
owner_id
:
""
,
search
:
{
list
:
[],
currentPage
:
1
,
pageSize
:
20
,
total
:
0
,
name
:
''
,
},
rules
:
{
company_name
:
[
{
required
:
true
,
message
:
'请输入商户名称'
,
trigger
:
'blur'
},
],
contact_man
:
[
{
required
:
true
,
message
:
'请输入联系人'
,
trigger
:
'blur'
},
],
contact_mobile
:
[
{
required
:
true
,
message
:
'请输入联系电话'
,
trigger
:
'blur'
},
],
contact_email
:
[
{
required
:
true
,
message
:
'请输入联系邮箱'
,
trigger
:
'blur'
},
],
contact_addr
:
[
{
required
:
true
,
message
:
'请输入联系地址'
,
trigger
:
'blur'
},
],
},
}
},
mounted
:
function
()
{
this
.
resetSearch
(
true
);
},
created
:
function
()
{},
methods
:
{
getEmptySearch
()
{
return
{
list
:
[],
currentPage
:
1
,
pageSize
:
20
,
total
:
0
,
name
:
''
,
}
},
resetSearch
()
{
this
.
search
=
this
.
getEmptySearch
();
this
.
getList
();
},
opSearch
()
{
this
.
search
.
currentPage
=
1
;
this
.
search
.
total
=
0
;
this
.
getList
();
},
getList
()
{
var
self
=
this
;
var
params
=
this
.
getParams
();
this
.
$root
.
postReq
(
"/web/offlinecompanyCtl/allList"
,
params
).
then
(
function
(
d
)
{
if
(
d
.
status
==
0
)
{
self
.
search
.
list
=
d
.
data
.
rows
||
[];
self
.
search
.
total
=
d
.
data
.
count
||
0
;
}
else
{
}
});
},
getParams
()
{
var
params
=
{};
for
(
var
f
in
this
.
search
)
{
if
(
f
==
"list"
)
{
continue
;
}
params
[
f
]
=
this
.
search
[
f
];
}
return
params
;
},
openEdit
(
id
)
{
this
.
ownerLoading
=
false
;
this
.
saveLoading
=
false
;
this
.
owner_id
=
null
;
if
(
this
.
$refs
.
offlinecompanys
)
{
this
.
$refs
.
offlinecompanys
.
resetFields
();
}
if
(
id
)
{
this
.
getDKcompany
(
id
);
this
.
editTitle
=
"修改"
;
}
else
{
this
.
editTitle
=
"新增"
;
this
.
offlinecompanys
=
{};
}
this
.
showEdit
=
true
;
},
getDKcompany
(
id
)
{
var
self
=
this
;
self
.
$root
.
postReq
(
"/web/offlinecompanyCtl/getinfo"
,
{
id
:
id
,
}).
then
(
function
(
d
)
{
if
(
d
.
status
==
0
)
{
self
.
offlinecompanys
=
d
.
data
;
}
else
{
self
.
$message
.
warning
(
d
.
msg
||
`您的网络不稳定, 请稍后重试`
);
}
});
},
onColFormater
(
row
,
column
,
cellValue
,
index
)
{
return
cellValue
||
"---"
;
},
handleSizeChange
(
val
)
{
this
.
search
.
pageSize
=
val
;
this
.
resetSearch
();
},
handleCurrentChange
(
val
)
{
this
.
search
.
currentPage
=
val
;
this
.
getList
();
},
saveCompany
()
{
var
self
=
this
;
self
.
saveLoading
=
true
;
self
.
$refs
.
offlinecompanys
.
validate
((
valid
)
=>
{
if
(
valid
)
{
self
.
$root
.
postReq
(
"/web/offlinecompanyCtl/companylSave"
,
self
.
offlinecompanys
).
then
(
function
(
d
)
{
if
(
d
.
status
==
0
)
{
self
.
$message
.
success
(
d
.
msg
);
self
.
showEdit
=
false
;
self
.
getList
();
}
else
{
self
.
$alert
(
d
.
msg
||
'保存失败'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
callback
:
action
=>
{}
});
}
self
.
saveLoading
=
false
;
});
}
else
{
self
.
saveLoading
=
false
;
return
false
;
}
});
setTimeout
(()
=>
{
self
.
saveLoading
=
false
;
},
5000
);
},
},
vname
:
"gsb-dkcompanyadmin"
}
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