Skip to content

Commit 102b0f2

Browse files
committed
开发完成运营设置支付的功能
1 parent 94cdceb commit 102b0f2

File tree

15 files changed

+1249
-209
lines changed

15 files changed

+1249
-209
lines changed

public/components/community/addCommunityWechat/addCommunityWechat.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@
8282
$('#addCommunityWechatModel').modal('hide');
8383
$that.clearAddCommunityWechatInfo();
8484
vc.emit('communityWechat', 'listSmallWeChat', {});
85+
vc.emit('communityMini', 'listSmallWeChat', {});
86+
8587
vc.toast("添加成功");
8688
return;
8789
} else {

public/components/community/editCommunityWechat/editCommunityWechat.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@
9393
//关闭model
9494
$('#editCommunityWechatModel').modal('hide');
9595
vc.emit('communityWechat', 'listSmallWeChat', {});
96+
vc.emit('communityMini', 'listSmallWeChat', {});
97+
9698
return;
9799
}
98100
vc.message(json);
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<div id="addCommunityPaymentModel" class="modal fade" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
2+
<div class="modal-dialog modal-lg">
3+
<div class="modal-content">
4+
<div class="modal-body">
5+
<h3 class="m-t-none m-b ">
6+
<vc:i18n name="添加" namespace="addCommunityPayment"></vc:i18n>
7+
</h3>
8+
<div class="ibox-content">
9+
<div class="form-group row">
10+
<label class="col-sm-2 col-form-label">
11+
<vc:i18n name='名称' namespace='addCommunityPayment'></vc:i18n>
12+
</label>
13+
<div class="col-sm-10">
14+
<input v-model="addCommunityPaymentInfo.paymentName" type="text"
15+
:placeholder="vc.i18n('必填,请填写名称','addCommunityPayment')" class="form-control">
16+
</div>
17+
</div>
18+
<div class="form-group row">
19+
<label class="col-sm-2 col-form-label">
20+
<vc:i18n name='支付厂家' namespace='addCommunityPayment'></vc:i18n>
21+
</label>
22+
<div class="col-sm-10">
23+
<select class="custom-select" v-model="addCommunityPaymentInfo.paymentType" @change="_addChangeToType()">
24+
<option selected disabled value="">{{vc.i18n('必填,请选择支付厂家','addCommunityPayment')}}</option>
25+
<option :value="item.paymentType" v-for="(item,index) in addCommunityPaymentInfo.paymentTypes" :key="index">
26+
{{item.name}}</option>
27+
</select>
28+
</div>
29+
</div>
30+
<div class="form-group row" v-for="(item,index) in addCommunityPaymentInfo.paymentKeys" :key="index">
31+
<label class="col-sm-2 col-form-label">{{item.name}}</label>
32+
<div class="col-sm-10">
33+
<textarea v-model="item.columnValue" :placeholder="item.remark" class="form-control"></textarea>
34+
</div>
35+
</div>
36+
<div class="form-group row" v-if="addCommunityPaymentInfo.paymentType == 'WECHAT'">
37+
<label class="col-sm-2 col-form-label">
38+
<vc:i18n name="商户证书(.p12)" namespace="addCommunityPayment"></vc:i18n>
39+
</label>
40+
<div class="col-sm-10">
41+
<vc:create path="frame/uploadFile" callBackListener="addCommunityPayment" callBackFunction="notifyCert"
42+
namespace="addCommunityPayment">
43+
</vc:create>
44+
</div>
45+
</div>
46+
<div class="form-group row">
47+
<label class="col-sm-2 col-form-label">
48+
<vc:i18n name='支付范围' namespace='addCommunityPayment'></vc:i18n>
49+
</label>
50+
<div class="col-sm-10">
51+
<select class="custom-select" v-model="addCommunityPaymentInfo.payType">
52+
<option selected disabled value="">{{vc.i18n('必填,请选择支付范围','addCommunityPayment')}}</option>
53+
<option value="1001">小区费用</option>
54+
<option value="2002">临时停车费</option>
55+
<option value="3003">费用项</option>
56+
</select>
57+
</div>
58+
</div>
59+
<div class="form-group row" v-if="addCommunityPaymentInfo.payType == '3003'">
60+
<label class="col-sm-2 col-form-label">
61+
<vc:i18n name="费用项" namespace="addPropertyCompany"></vc:i18n>
62+
</label>
63+
<div class="col-sm-10">
64+
<label class="margin-left" v-for="(item,index) in addCommunityPaymentInfo.feeConfigs">
65+
<input type="checkbox" v-model="addCommunityPaymentInfo.configIds" :value="item.configId"> {{item.feeName}}
66+
</label>
67+
</div>
68+
</div>
69+
<div class="form-group row">
70+
<label class="col-sm-2 col-form-label">
71+
<vc:i18n name='使用说明' namespace='addCommunityPayment'></vc:i18n>
72+
</label>
73+
<div class="col-sm-10">
74+
<textarea v-model="addCommunityPaymentInfo.remark" :placeholder="vc.i18n('选填,请填写使用说明','addCommunityPayment')"
75+
class="form-control"></textarea>
76+
</div>
77+
</div>
78+
<div class="ibox-content">
79+
<button class="btn btn-primary float-right" type="button" v-on:click="savePaymentPoolInfo()"><i
80+
class="fa fa-check"></i>&nbsp;
81+
<span>
82+
<vc:i18n name="保存"></vc:i18n>
83+
</span>
84+
</button>
85+
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;" data-dismiss="modal">
86+
<vc:i18n name="取消"></vc:i18n>
87+
</button>
88+
</div>
89+
</div>
90+
</div>
91+
</div>
92+
</div>
93+
</div>
Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
(function (vc) {
2+
3+
vc.extends({
4+
data: {
5+
addCommunityPaymentInfo: {
6+
ppId: '',
7+
communityId: '',
8+
paymentName: '',
9+
paymentType: '',
10+
certPath: '',
11+
state: 'Y',
12+
remark: '',
13+
paymentTypes: [],
14+
paymentKeys: [],
15+
payType: '1001',
16+
feeConfigs: [],
17+
configIds: []
18+
}
19+
},
20+
_initMethod: function () {
21+
22+
},
23+
_initEvent: function () {
24+
vc.on('addCommunityPayment', 'openAddCommunityPaymentModal', function (_param) {
25+
$that.addCommunityPaymentInfo.communityId = _param.communityId;
26+
$that._loadAddConfigs();
27+
$that._loadAddPaymentAdapt();
28+
$('#addCommunityPaymentModel').modal('show');
29+
});
30+
vc.on('addCommunityPayment', 'notifyCert', function (_param) {
31+
$that.addCommunityPaymentInfo.certPath = _param.realFileName;
32+
})
33+
},
34+
methods: {
35+
addCommunityPaymentValidate() {
36+
return vc.validate.validate({
37+
addCommunityPaymentInfo: $that.addCommunityPaymentInfo
38+
}, {
39+
'addCommunityPaymentInfo.paymentName': [
40+
{
41+
limit: "required",
42+
param: "",
43+
errInfo: "名称不能为空"
44+
},
45+
{
46+
limit: "maxLength",
47+
param: "64",
48+
errInfo: "名称不能超过64"
49+
},
50+
],
51+
'addCommunityPaymentInfo.paymentType': [
52+
{
53+
limit: "required",
54+
param: "",
55+
errInfo: "支付厂家不能为空"
56+
},
57+
{
58+
limit: "maxLength",
59+
param: "64",
60+
errInfo: "支付厂家不能超过64"
61+
},
62+
],
63+
'addCommunityPaymentInfo.certPath': [
64+
{
65+
limit: "maxLength",
66+
param: "512",
67+
errInfo: "证书地址不能超过512"
68+
},
69+
],
70+
'addCommunityPaymentInfo.remark': [
71+
{
72+
limit: "maxLength",
73+
param: "512",
74+
errInfo: "使用说明不能超过512"
75+
},
76+
],
77+
});
78+
},
79+
savePaymentPoolInfo: function () {
80+
if (!$that.addCommunityPaymentValidate()) {
81+
vc.toast(vc.validate.errInfo);
82+
return;
83+
}
84+
85+
86+
vc.http.apiPost(
87+
'/payment.saveAdminPaymentPool',
88+
JSON.stringify($that.addCommunityPaymentInfo),
89+
{
90+
emulateJSON: true
91+
},
92+
function (json, res) {
93+
let _json = JSON.parse(json);
94+
if (_json.code == 0) {
95+
//关闭model
96+
$('#addCommunityPaymentModel').modal('hide');
97+
$that.clearAddCommunityPaymentInfo();
98+
vc.emit('communityPayment', 'listCommunityPayment', {});
99+
return;
100+
}
101+
vc.toast(_json.msg);
102+
103+
},
104+
function (errInfo, error) {
105+
console.log('请求失败处理');
106+
vc.toast(errInfo);
107+
});
108+
},
109+
clearAddCommunityPaymentInfo: function () {
110+
let _paymentTypes = $that.addCommunityPaymentInfo.paymentTypes;
111+
$that.addCommunityPaymentInfo = {
112+
paymentName: '',
113+
paymentType: '',
114+
paymentTypes: _paymentTypes,
115+
paymentKeys: [],
116+
certPath: '',
117+
state: 'Y',
118+
remark: '',
119+
payType: '1001',
120+
feeConfigs: [],
121+
configIds: []
122+
};
123+
124+
vc.emit('addCommunityPayment', 'uploadFile', 'clearVedio', {})
125+
},
126+
_addChangeToType: function () {
127+
if (!$that.addCommunityPaymentInfo.paymentType) {
128+
return;
129+
}
130+
let _param = {
131+
params: {
132+
paymentType: $that.addCommunityPaymentInfo.paymentType,
133+
page: 1,
134+
135+
row: 100
136+
}
137+
}
138+
//发送get请求
139+
vc.http.apiGet('/payment.listPaymentKey',
140+
_param,
141+
function (json, res) {
142+
let _json = JSON.parse(json);
143+
_json.data.forEach(item => {
144+
item.columnValue = '';
145+
})
146+
$that.addCommunityPaymentInfo.paymentKeys = _json.data;
147+
},
148+
function (errInfo, error) {
149+
console.log('请求失败处理');
150+
}
151+
);
152+
},
153+
_loadAddConfigs: function () {
154+
let param = {
155+
params: {
156+
page: 1,
157+
row: 100,
158+
isDefault: 'F',
159+
communityId: $that.addCommunityPaymentInfo.communityId
160+
}
161+
};
162+
//发送get请求
163+
vc.http.apiGet('/feeConfig.queryAdminFeeConfigs', param,
164+
function (json, res) {
165+
let _json = JSON.parse(json);
166+
$that.addCommunityPaymentInfo.feeConfigs = _json.feeConfigs;
167+
},
168+
function (errInfo, error) {
169+
console.log('请求失败处理');
170+
}
171+
);
172+
},
173+
174+
_loadAddPaymentAdapt:function(){
175+
let param = {
176+
params: {
177+
page: 1,
178+
row: 100,
179+
}
180+
};
181+
//发送get请求
182+
vc.http.apiGet('/payment.listPaymentAdapt', param,
183+
function (json, res) {
184+
let _json = JSON.parse(json);
185+
$that.addCommunityPaymentInfo.paymentTypes = _json.data;
186+
},
187+
function (errInfo, error) {
188+
console.log('请求失败处理');
189+
}
190+
);
191+
}
192+
193+
}
194+
});
195+
196+
})(window.vc);
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<div class="modal fade" id="deleteCommunityPaymentModel" role="dialog" aria-labelledby="exampleModalLabel"
2+
aria-hidden="true">
3+
<div class="modal-dialog" role="document">
4+
<div class="modal-content">
5+
<div class="modal-header">
6+
<h5 class="modal-title" id="exampleModalLabel">
7+
<vc:i18n name="请确认您的操作!"></vc:i18n>
8+
</h5>
9+
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
10+
<span aria-hidden="true">&times;</span>
11+
</button>
12+
</div>
13+
<div class="modal-body">
14+
<tr align="center">
15+
<th>
16+
<vc:i18n name="确定删除支付配置" namespace="deleteCommunityPayment"></vc:i18n>
17+
</th>
18+
</tr>
19+
</div>
20+
<div class="modal-footer">
21+
<button type="button" class="btn btn-secondary" data-dismiss="modal"
22+
v-on:click="closeDeleteCommunityPaymentModel()">
23+
<vc:i18n name="点错了"></vc:i18n>
24+
</button>
25+
<button type="button" class="btn btn-primary" v-on:click="deleteCommunityPayment()">
26+
<vc:i18n name="确认删除!"></vc:i18n>
27+
</button>
28+
</div>
29+
</div>
30+
</div>
31+
</div>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
(function(vc,vm){
2+
3+
vc.extends({
4+
data:{
5+
deleteCommunityPaymentInfo:{
6+
7+
}
8+
},
9+
_initMethod:function(){
10+
11+
},
12+
_initEvent:function(){
13+
vc.on('deleteCommunityPayment','openDeleteCommunityPaymentModal',function(_params){
14+
15+
$that.deleteCommunityPaymentInfo = _params;
16+
$('#deleteCommunityPaymentModel').modal('show');
17+
18+
});
19+
},
20+
methods:{
21+
deleteCommunityPayment:function(){
22+
vc.http.apiPost(
23+
'/payment.deleteAdminPaymentPool',
24+
JSON.stringify($that.deleteCommunityPaymentInfo),
25+
{
26+
emulateJSON:true
27+
},
28+
function(json,res){
29+
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
30+
let _json = JSON.parse(json);
31+
if (_json.code == 0) {
32+
//关闭model
33+
$('#deleteCommunityPaymentModel').modal('hide');
34+
vc.emit('communityPayment', 'listCommunityPayment', {});
35+
return ;
36+
}
37+
vc.toast(_json.msg);
38+
},
39+
function(errInfo,error){
40+
console.log('请求失败处理');
41+
vc.toast(json);
42+
43+
});
44+
},
45+
closeDeleteCommunityPaymentModel:function(){
46+
$('#deleteCommunityPaymentModel').modal('hide');
47+
}
48+
}
49+
});
50+
51+
})(window.vc,window.$that);

0 commit comments

Comments
 (0)