mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-24 21:59:12 +08:00
优化账户转入错误 撤销功能
This commit is contained in:
parent
df98a1cda1
commit
6f9ca4eb15
@ -0,0 +1,41 @@
|
||||
<div id="cancelAccountDetailModel" class="modal fade" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<h3 class="m-t-none m-b "><span><vc:i18n name="预存撤销" namespace="cancelAccountDetail"></vc:i18n></span></h3>
|
||||
<div class="ibox-content">
|
||||
<div>
|
||||
<div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><span><vc:i18n name="账户名称" namespace="cancelAccountDetail"></vc:i18n></span></label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="cancelAccountDetailInfo.acctName" type="text" disabled :placeholder="vc.i18n('必填,请填写账户名称','cancelAccountDetail')" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><span><vc:i18n name="撤销金额" namespace="cancelAccountDetail"></vc:i18n></span></label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="cancelAccountDetailInfo.amount" type="text" disabled :placeholder="vc.i18n('必填,请填写撤销金额','cancelAccountDetail')" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><span><vc:i18n name="撤销原因" namespace="cancelAccountDetail"></vc:i18n></span></label>
|
||||
<div class="col-sm-10">
|
||||
<textarea cols="5" v-model="cancelAccountDetailInfo.remark" type="tel" :placeholder="vc.i18n('必填,请填写撤销原因','cancelAccountDetail')" class="form-control">
|
||||
</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button" v-on:click="_cancelAccountDetailInfo()">
|
||||
<i class="fa fa-check"></i> 提交
|
||||
</button>
|
||||
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;" data-dismiss="modal"><span><vc:i18n name="取消" namespace="cancelAccountDetail"></vc:i18n></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,77 @@
|
||||
(function(vc) {
|
||||
vc.extends({
|
||||
data: {
|
||||
cancelAccountDetailInfo: {
|
||||
detailId: '',
|
||||
acctName: '',
|
||||
amount: '',
|
||||
remark: '',
|
||||
}
|
||||
},
|
||||
_initMethod: function() {},
|
||||
_initEvent: function() {
|
||||
vc.on('cancelAccountDetail', 'openAddModal', function(_param) {
|
||||
$('#cancelAccountDetailModel').modal('show');
|
||||
|
||||
vc.copyObject(_param, $that.cancelAccountDetailInfo);
|
||||
that.cancelAccountDetailInfo.remark = '';
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
cancelAccountDetailValidate() {
|
||||
return vc.validate.validate({
|
||||
cancelAccountDetailInfo: vc.component.cancelAccountDetailInfo
|
||||
}, {
|
||||
'cancelAccountDetailInfo.detailId': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "明细不存在"
|
||||
}],
|
||||
'cancelAccountDetailInfo.remark': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "撤销原因不能空"
|
||||
}],
|
||||
});
|
||||
},
|
||||
_cancelAccountDetailInfo: function() {
|
||||
if (!vc.component.cancelAccountDetailValidate()) {
|
||||
vc.toast(vc.validate.errInfo);
|
||||
return;
|
||||
}
|
||||
vc.component.cancelAccountDetailInfo.communityId = vc.getCurrentCommunity().communityId;
|
||||
vc.http.apiPost(
|
||||
'/account.cancelAccountDetail',
|
||||
JSON.stringify(vc.component.cancelAccountDetailInfo), {
|
||||
emulateJSON: true
|
||||
},
|
||||
function(json, res) {
|
||||
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
||||
let _json = JSON.parse(json)
|
||||
if (_json.code == 0) {
|
||||
//关闭model
|
||||
$('#cancelAccountDetailModel').modal('hide');
|
||||
vc.component.clearPrestoreAccountInfo();
|
||||
vc.emit('accountDetailManage', 'listAccountDetail', {});
|
||||
vc.toast('撤销成功');
|
||||
return;
|
||||
}
|
||||
vc.toast(_json.msg);
|
||||
},
|
||||
function(errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
vc.component.cancelAccountDetailInfo.errorInfo = errInfo;
|
||||
});
|
||||
},
|
||||
clearPrestoreAccountInfo: function() {
|
||||
vc.component.cancelAccountDetailInfo = {
|
||||
detailId: '',
|
||||
acctName: '',
|
||||
amount: '',
|
||||
remark: '',
|
||||
};
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
})(window.vc);
|
||||
@ -28,10 +28,12 @@
|
||||
<td class="text-center">{{accountDetail.detailId}}</td>
|
||||
<td class="text-center">{{accountDetail.orderId}}</td>
|
||||
<td class="text-center">{{accountDetail.acctName}}</td>
|
||||
<td class="text-center">{{accountDetail.detailType =='1001'?'转入':'转出'}}</td>
|
||||
<td class="text-center" v-if="accountDetail.detailType =='1001'">转入(<a href="javascript:void(0)" @click="_cancelAccountDetail(accountDetail)">撤销</a>)</td>
|
||||
<td class="text-center" v-else-if="accountDetail.detailType =='3003'">转入已撤销</td>
|
||||
<td class="text-center" v-else>转出</td>
|
||||
<td class="text-center">{{accountDetail.amount}}</td>
|
||||
<td class="text-center">{{accountDetail.createTime}}</td>
|
||||
<td class="text-center">{{accountDetail.remark}}</td>
|
||||
<td class="text-center">{{accountDetail.remark || '无'}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
@ -48,5 +50,5 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<vc:create path="property/cancelAccountDetail"></vc:create>
|
||||
</div>
|
||||
@ -71,6 +71,9 @@
|
||||
vc.component.accountDetailManageInfo.moreCondition = true;
|
||||
}
|
||||
},
|
||||
_cancelAccountDetail: function(_detail) {
|
||||
vc.emit('cancelAccountDetail', 'openAddModal', _detail);
|
||||
},
|
||||
_goBack: function() {
|
||||
vc.goBack();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user