MicroCommunityWeb/public/components/fee/wirteInvoiceEvent/wirteInvoiceEvent.js
2023-10-13 15:39:23 +08:00

60 lines
2.2 KiB
JavaScript

(function (vc) {
vc.extends({
data: {
wirteInvoiceEventInfo: {
applyId: '',
eventType:'',
remark: '',
}
},
_initMethod: function () {
},
_initEvent: function () {
vc.on('wirteInvoiceEvent', 'openWirteInvoiceModal', function(_param) {
vc.copyObject(_param,$that.wirteInvoiceEventInfo);
$('#wirteInvoiceEventModel').modal('show');
});
},
methods: {
_wirteEvent: function () {
let _eventType = $that.wirteInvoiceEventInfo.eventType;
if (!_eventType) {
vc.toast("请选择类型");
return;
}
$that.wirteInvoiceEventInfo.communityId = vc.getCurrentCommunity().communityId;
vc.http.apiPost(
'/invoice.writeInvoiceApply',
JSON.stringify($that.wirteInvoiceEventInfo), {
emulateJSON: true
},
function (json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
let _json = JSON.parse(json)
if (_json.code == '0') {
//关闭model
$('#wirteInvoiceEventModel').modal('hide');
$that.clearWirteInvoiceEventInfo();
vc.emit('invoiceApply', 'listInvoiceApply', {});
vc.toast("上传成功");
return;
} else {
vc.toast(_json.msg);
}
},
function (errInfo, error) {
vc.toast(errInfo);
});
},
clearWirteInvoiceEventInfo: function () {
$that.wirteInvoiceEventInfo = {
applyId: '',
eventType:'',
remark: '',
};
},
}
});
})(window.vc);