mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-24 05:46:03 +08:00
60 lines
2.2 KiB
JavaScript
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); |