|
@@ -0,0 +1,246 @@
|
|
|
+shr.defineClass("shr.compensation.TaxDirectDeductionListEx", shr.compensation.TaxDirectDeductionListHandler, {
|
|
|
+ editViewDisable: true,
|
|
|
+ canEdit: 0,
|
|
|
+ initalizeDOM: function () {
|
|
|
+ shr.compensation.TaxDirectDeductionListEx.superClass.initalizeDOM.call(this);
|
|
|
+ },
|
|
|
+ collectAction: function () {
|
|
|
+ var _self = this;
|
|
|
+ var buttons = [], $dialog = $("#getPersonCollectDialog"), $body = $(document.body);
|
|
|
+ if ($dialog.size() == 0) {
|
|
|
+ $dialog = $("<div id='getPersonCollectDialog' class='tiny-dialog'></div>").appendTo($body);
|
|
|
+ }
|
|
|
+ var day = new Date();
|
|
|
+ var today = day.format("yyyy-MM");
|
|
|
+ var html = ['<div id="generateDataHtml">',
|
|
|
+ '<div class="sync-row row-fluid">',
|
|
|
+ '<div data-ctrlrole="labelContainer">',
|
|
|
+ '<div class="col-lg-2 textLeft"><div class="field_label" title="' + '纳税单位名称' + '">' +
|
|
|
+ '纳税单位名称' + '</div></div>',
|
|
|
+ '<div class="col-lg-7 field-ctrl"><input id="taxUnitF7" class="taxUnitF7" validate="{required:true}"></input></div>',
|
|
|
+ '</div>',
|
|
|
+ '</div>',
|
|
|
+ '<p></p>' ,
|
|
|
+ // '<table width="100%">',
|
|
|
+ // '<tr>',
|
|
|
+ // '<td width="20%"><h6>选择年份</h6></td>' ,
|
|
|
+ // '<td width="40%">',
|
|
|
+ // '<input type="text" id="taxPeriodDate" name="taxPeriodDate" class="input-height" style=""/>',
|
|
|
+ // '</td>',
|
|
|
+ // '<td width="40%"></td>',
|
|
|
+ // '</tr>',
|
|
|
+ // '</table>',
|
|
|
+ '</div>'];
|
|
|
+ var saveSettingButton = _self.getSaveSettingButton();
|
|
|
+ buttons.push(saveSettingButton);
|
|
|
+ showDialog("#getPersonCollectDialog",
|
|
|
+ '6万直接扣除人员归集',
|
|
|
+ html.join(""), buttons, 600, 290, '取消');
|
|
|
+ // var taxPeriodDate_json = {};
|
|
|
+ // taxPeriodDate_json.validate = "{required:true}";
|
|
|
+ // taxPeriodDate_json.id = "taxPeriodDate";
|
|
|
+ // taxPeriodDate_json.format = 'yyyy-mm';
|
|
|
+ // taxPeriodDate_json.maxDate = today;
|
|
|
+ //
|
|
|
+ // taxPeriodDate_json.isRemoveDay = true;
|
|
|
+ // taxPeriodDate_json.ctrlType = 'Date';
|
|
|
+ // $('#taxPeriodDate').shrDateTimePicker(taxPeriodDate_json);
|
|
|
+ // $('#taxPeriodDate').shrDateTimePicker("setValue",today);
|
|
|
+ var grid_f7_json = {
|
|
|
+ id: "taxUnitF7",
|
|
|
+ name: "taxUnitF7",
|
|
|
+ subWidgetName: "shrPromptGrid",
|
|
|
+ validate: "{required:true}",
|
|
|
+ subWidgetOptions: {
|
|
|
+ title: '选择纳税单位:',
|
|
|
+ uipk: "com.kingdee.shr.compensation.app.tax.TaxDeclareTaxUnitF7",
|
|
|
+ filter: '',
|
|
|
+ multiselect: true,
|
|
|
+ isInput: true,
|
|
|
+ },
|
|
|
+ };
|
|
|
+ // 默认当前员工所有的纳税单位数据权限
|
|
|
+ $("#taxUnitF7").shrPromptBox(grid_f7_json);
|
|
|
+ shr.callHandler({
|
|
|
+ handler: "com.kingdee.shr.compensation.web.handler.tax.TaxDirectDeductionListHandler",
|
|
|
+ action: "getTaxUnitForPersonCollect",
|
|
|
+ async: false,
|
|
|
+ param: {},
|
|
|
+ success: function (res) {
|
|
|
+ $("#taxUnitF7").shrPromptBox("setValue", res);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getSaveSettingButton: function () {
|
|
|
+ var _self = this;
|
|
|
+ return {
|
|
|
+ text: '确定',
|
|
|
+ click: function () {
|
|
|
+ var selectedTaxUnits = $('#taxUnitF7').shrPromptBox("getValue");
|
|
|
+ if (!selectedTaxUnits || selectedTaxUnits.length === 0) {
|
|
|
+ shr.showError({message: '纳税单位不能为空', hideAfter: 5});
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var taxUnitId = "";
|
|
|
+ for (var i = 0; i < selectedTaxUnits.length; i++) {
|
|
|
+ if (i === 0) {
|
|
|
+ taxUnitId = selectedTaxUnits[i].id;
|
|
|
+ } else {
|
|
|
+ taxUnitId = taxUnitId + "," + selectedTaxUnits[i].id;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var taxPeriodDate = '';//$('#taxPeriodDate').shrDateTimePicker("getValue");
|
|
|
+ _self.remoteCall({
|
|
|
+ method: "beforePersonCollect",
|
|
|
+ param: {taxUnitIds: taxUnitId,period: taxPeriodDate},
|
|
|
+ success: function (data) {
|
|
|
+ if (data.length > 0) {
|
|
|
+ shr.showConfirm('以下纳税单位【' + data + '】已经存在归集后的数据,确定覆盖更新吗?',
|
|
|
+ function () {
|
|
|
+ _self.doPersonCollect(taxUnitId,taxPeriodDate);
|
|
|
+ $("#getPersonCollectDialog").dialog("close");
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ _self.doPersonCollect(taxUnitId,taxPeriodDate);
|
|
|
+ $("#getPersonCollectDialog").dialog("close");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ doPersonCollect: function (taxUnitId,taxPeriodDate) {
|
|
|
+ var _self = this;
|
|
|
+ var param = {};
|
|
|
+ param.taxUnitIds = taxUnitId;
|
|
|
+ param.taxPeriodDate=taxPeriodDate;
|
|
|
+ _self.remoteCall({
|
|
|
+ type: "post",
|
|
|
+ method: "personCollect",
|
|
|
+ param: param,
|
|
|
+ success: function (res) {
|
|
|
+ shr.showInfo({message: "已提交金税系统获取不满6万元人员名单,需要等待几分钟,可在任务执行监控中查看运行进度;获取完成后将会推送消息告知。", hideAfter: 5});
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ taxPersonReportAction: function () {
|
|
|
+ var _self = this;
|
|
|
+ var buttons = [], $dialog = $("#getReportCollectDialog"), $body = $(document.body);
|
|
|
+ if ($dialog.size() == 0) {
|
|
|
+ $dialog = $("<div id='getReportCollectDialog' class='tiny-dialog'></div>").appendTo($body);
|
|
|
+ }
|
|
|
+ var day = new Date();
|
|
|
+ var today = day.format("yyyy-MM");
|
|
|
+ var html = ['<div id="generateReportDataHtml">',
|
|
|
+ '<div class="sync-row row-fluid">',
|
|
|
+ '<div data-ctrlrole="labelContainer">',
|
|
|
+ '<div class="col-lg-2 textLeft"><div class="field_label" title="' + '纳税单位名称' + '">' +
|
|
|
+ '纳税单位名称' + '</div></div>',
|
|
|
+ '<div class="col-lg-7 field-ctrl"><input id="taxUnitF7Report" class="taxUnitF7" validate="{required:true}"></input></div>',
|
|
|
+ '</div>',
|
|
|
+ '</div>',
|
|
|
+ '<p></p>' ,
|
|
|
+ '<table width="100%">',
|
|
|
+ '<tr>',
|
|
|
+ '<td width="20%"><h6>选择年份</h6></td>' ,
|
|
|
+ '<td width="40%">',
|
|
|
+ '<input type="text" id="taxPeriodDate" name="taxPeriodDate" class="input-height" style=""/>',
|
|
|
+ '</td>',
|
|
|
+ '<td width="40%"></td>',
|
|
|
+ '</tr>',
|
|
|
+ '</table>',
|
|
|
+ '</div>'];
|
|
|
+ var saveSettingButton = _self.getSaveReportButton();
|
|
|
+ buttons.push(saveSettingButton);
|
|
|
+ showDialog("#getReportCollectDialog",
|
|
|
+ '6万直接扣除人员归集',
|
|
|
+ html.join(""), buttons, 600, 290, '取消');
|
|
|
+ var taxPeriodDate_json = {};
|
|
|
+ taxPeriodDate_json.validate = "{required:true}";
|
|
|
+ taxPeriodDate_json.id = "taxPeriodDate";
|
|
|
+ taxPeriodDate_json.format = 'yyyy-mm';
|
|
|
+ taxPeriodDate_json.maxDate = today;
|
|
|
+
|
|
|
+ taxPeriodDate_json.isRemoveDay = true;
|
|
|
+ taxPeriodDate_json.ctrlType = 'Date';
|
|
|
+ $('#taxPeriodDate').shrDateTimePicker(taxPeriodDate_json);
|
|
|
+ $('#taxPeriodDate').shrDateTimePicker("setValue",today);
|
|
|
+ var grid_f7_json = {
|
|
|
+ id: "taxUnitF7Report",
|
|
|
+ name: "taxUnitF7",
|
|
|
+ subWidgetName: "shrPromptGrid",
|
|
|
+ validate: "{required:true}",
|
|
|
+ subWidgetOptions: {
|
|
|
+ title: '选择纳税单位:',
|
|
|
+ uipk: "com.kingdee.shr.compensation.app.tax.TaxDeclareTaxUnitF7",
|
|
|
+ filter: '',
|
|
|
+ multiselect: true,
|
|
|
+ isInput: true,
|
|
|
+ },
|
|
|
+ };
|
|
|
+ // 默认当前员工所有的纳税单位数据权限
|
|
|
+ $("#taxUnitF7Report").shrPromptBox(grid_f7_json);
|
|
|
+ shr.callHandler({
|
|
|
+ handler: "com.kingdee.shr.compensation.web.handler.tax.TaxDirectDeductionListHandler",
|
|
|
+ action: "getTaxUnitForPersonCollect",
|
|
|
+ async: false,
|
|
|
+ param: {},
|
|
|
+ success: function (res) {
|
|
|
+ $("#taxUnitF7Report").shrPromptBox("setValue", res);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getSaveReportButton: function () {
|
|
|
+ var _self = this;
|
|
|
+ return {
|
|
|
+ text: '确定',
|
|
|
+ click: function () {
|
|
|
+ var selectedTaxUnits = $('#taxUnitF7Report').shrPromptBox("getValue");
|
|
|
+ if (!selectedTaxUnits || selectedTaxUnits.length === 0) {
|
|
|
+ shr.showError({message: '纳税单位不能为空', hideAfter: 5});
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var taxUnitId = "";
|
|
|
+ for (var i = 0; i < selectedTaxUnits.length; i++) {
|
|
|
+ if (i === 0) {
|
|
|
+ taxUnitId = selectedTaxUnits[i].id;
|
|
|
+ } else {
|
|
|
+ taxUnitId = taxUnitId + "," + selectedTaxUnits[i].id;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var taxPeriodDate = $('#taxPeriodDate').shrDateTimePicker("getValue");
|
|
|
+ _self.remoteCall({
|
|
|
+ method: "beforePersonCollect",
|
|
|
+ param: {taxUnitIds: taxUnitId,period: taxPeriodDate},
|
|
|
+ success: function (data) {
|
|
|
+ if (data.length > 0) {
|
|
|
+ shr.showConfirm('以下纳税单位【' + data + '】已经存在归集后的数据,确定覆盖更新吗?',
|
|
|
+ function () {
|
|
|
+ _self.doPersonReportCollect(taxUnitId,taxPeriodDate);
|
|
|
+ $("#getPersonCollectDialog").dialog("close");
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ _self.doPersonReportCollect(taxUnitId,taxPeriodDate);
|
|
|
+ $("#getPersonCollectDialog").dialog("close");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ doPersonReportCollect: function (taxUnitId,taxPeriodDate) {
|
|
|
+ var _self = this;
|
|
|
+ var param = {};
|
|
|
+ param.taxUnitIds = taxUnitId;
|
|
|
+ param.period = taxPeriodDate;
|
|
|
+ _self.remoteCall({
|
|
|
+ type: "post",
|
|
|
+ method: "taxPersonReport",
|
|
|
+ param: param,
|
|
|
+ success: function (res) {
|
|
|
+ shr.showInfo({message: "已提交金税系统获取养老金,需要等待几分钟,可在任务执行监控中查看运行进度;获取完成后将会推送消息告知。", hideAfter: 5});
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+});
|