release/2.18.2.2412.02-release/2.18.2.2412.02-个税

This commit is contained in:
lys 2024-12-26 18:12:37 +08:00
parent fa3d3a283e
commit 1d88fd9f35
9 changed files with 587 additions and 88 deletions

View File

@ -85,7 +85,3 @@ export const deleteAllData = (params) => {
export const extendToLastMonth = (params) => {
return postFetch("/api/bs/hrmsalary/otherDeduction/extendToLastMonth", params);
};
//免税收入保存
export const saveFreeIncome = (params) => {
return postFetch("/api/bs/hrmsalary/otherDeduction/saveFreeIncome", params);
};

View File

@ -123,7 +123,7 @@ export const recessionList = (params) => {
return postFetch("/api/bs/hrmsalary/siaccount/detail/recession/list", params);
};
//查询补差列表
export const balanceList = (params) => {
export const balanceList = (params, ids) => {
return postFetch("/api/bs/hrmsalary/siaccount/detail/balance/list", params);
};
//删除退差数据

View File

@ -1,8 +1,9 @@
import React, { Component } from "react";
import { WeaCheckbox, WeaFormItem, WeaSearchGroup } from "ecCom";
import { WeaCheckbox, WeaFormItem, WeaLocaleProvider, WeaSearchGroup } from "ecCom";
import { observer } from "mobx-react";
import { WeaSwitch } from "comsMobx";
const getLabel = WeaLocaleProvider.getLabel;
@observer
export default class FormInfo extends Component {
renderForm = () => {
@ -30,7 +31,7 @@ export default class FormInfo extends Component {
fields.items.map((field, j) => {
const customerRender = itemRender != null ? itemRender[field.domkey[0]] : null;
const showCheckbox = field.checkbox || false;
let label = field.label;
let label = getLabel(field.lanId, field.label);
if (showCheckbox)
label = <WeaCheckbox content={label} value={field.checkboxValue} onChange={(v) => {
field.checkboxValue = v === "1";
@ -38,10 +39,14 @@ export default class FormInfo extends Component {
}}/>;
let coms;
if (customerRender == null) {
coms = <WeaSwitch fieldConfig={{ ...field, ...textAreaProps, hasBorder: field.viewAttr === 1 }} form={form}
formParams={formParams}/>;
coms = <WeaSwitch fieldConfig={{
...field, helpfulTip: getLabel(field.helpfulTipLanId || "", field.helpfulTip || ""), ...textAreaProps,
hasBorder: false
}} form={form} formParams={formParams}/>;
} else {
coms = customerRender(field, textAreaProps, form, formParams);
coms = customerRender({
...field, helpfulTip: getLabel(field.helpfulTipLanId || "", field.helpfulTip || "")
}, textAreaProps, form, formParams);
}
Object.assign(itemProps, { label, error: form.getError(field) });
let col = 1;
@ -84,12 +89,10 @@ export default class FormInfo extends Component {
};
render() {
const { formFields, className } = this.props;
if (formFields == null) return (<div></div>);
const { formFields, className, form } = this.props;
if (formFields == null || !form.isFormInit) return (<div></div>);
return (
<div className={className}>
{this.renderForm()}
</div>
<div className={className}>{this.renderForm()}</div>
);
}
}

View File

@ -65,6 +65,7 @@ export const dataCollectCondition = [
{
conditionType: "INPUTNUMBER",
domkey: ["freeIncome"],
dataType: "freeIncome",
fieldcol: 14,
label: "免税收入",
labelcol: 8,
@ -76,6 +77,7 @@ export const dataCollectCondition = [
{
conditionType: "INPUTNUMBER",
domkey: ["businessHealthyInsurance"],
dataType: "healthInsurance",
fieldcol: 14,
label: "商业健康保险",
labelcol: 8,
@ -86,6 +88,7 @@ export const dataCollectCondition = [
{
conditionType: "INPUTNUMBER",
domkey: ["taxDelayEndowmentInsurance"],
dataType: "endowmentInsurance",
fieldcol: 14,
label: "税延养老保险",
labelcol: 8,
@ -96,6 +99,7 @@ export const dataCollectCondition = [
{
conditionType: "INPUTNUMBER",
domkey: ["deductionAllowedDonation"],
dataType: "grantDonation",
fieldcol: 14,
label: "准予扣除的捐赠额",
labelcol: 8,
@ -106,6 +110,7 @@ export const dataCollectCondition = [
{
conditionType: "INPUTNUMBER",
domkey: ["derateDeduction"],
dataType: "derateDeduction",
fieldcol: 14,
label: "减免税额",
labelcol: 8,
@ -116,6 +121,7 @@ export const dataCollectCondition = [
{
conditionType: "INPUTNUMBER",
domkey: ["otherDeduction"],
dataType: "otherDerateDeduction",
fieldcol: 14,
label: "其他",
labelcol: 8,
@ -126,6 +132,7 @@ export const dataCollectCondition = [
{
conditionType: "INPUTNUMBER",
domkey: ["privatePension"],
dataType: "personalPension",
fieldcol: 14,
label: "个人养老金",
labelcol: 8,
@ -147,6 +154,7 @@ export const taxDetailSettingsConditions = {
domkey: ["freeItem"],
fieldcol: 14,
label: "免税事项",
lanId: 111,
labelcol: 8,
value: "",
rules: "required|string",
@ -157,6 +165,7 @@ export const taxDetailSettingsConditions = {
domkey: ["freeProperty"],
fieldcol: 14,
label: "免税性质",
lanId: 111,
labelcol: 8,
value: "",
rules: "required|string",
@ -167,6 +176,377 @@ export const taxDetailSettingsConditions = {
domkey: ["freeAmount"],
fieldcol: 14,
label: "免税金额",
lanId: 111,
labelcol: 8,
value: "",
rules: "required",
precision: 2,
viewAttr: 3
}
],
title: "",
defaultshow: true,
col: 1
}],
healthInsurance: [{
items: [
{
conditionType: "INPUT",
domkey: ["identificationNumber"],
fieldcol: 14,
label: "税优识别码",
lanId: 111,
helpfulTip: "为确保税收优惠商业健康保险保单的唯一性、真实性和有效性,由商业健康保险信息平台按照“一人一单一码”的原则进行核发,填写个人保单凭证上打印的数字识别码。",
helpfulTipLanId: 111,
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "DATEPICKER",
domkey: ["effectiveDate"],
fieldcol: 14,
label: "保单生效日期",
lanId: 111,
helpfulTip: "该商业健康保险保单生效的日期。",
helpfulTipLanId: 111,
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "INPUTNUMBER",
domkey: ["yearPremium"],
fieldcol: 14,
label: "年度保费",
lanId: 111,
helpfulTip: "商业健康保险保单年度内该保单的总保费。",
helpfulTipLanId: 111,
labelcol: 8,
value: "",
rules: "required",
precision: 2,
viewAttr: 3
},
{
conditionType: "INPUTNUMBER",
domkey: ["monthPremium"],
fieldcol: 14,
label: "月度保费",
lanId: 111,
helpfulTip: "月缴费的保单填写每月所缴保费按年一次性缴费的保单填写年度保费除以12后的金额。",
helpfulTipLanId: 111,
labelcol: 8,
value: "",
rules: "required",
precision: 2,
viewAttr: 3
},
{
conditionType: "INPUTNUMBER",
domkey: ["currentDeduction"],
fieldcol: 14,
label: "本期扣除金额",
lanId: 111,
helpfulTip: "根据国家有关政策对个人购买或单位统一购买符合规定的商业健康保险产品的支出扣除限额为2400。",
helpfulTipLanId: 111,
labelcol: 8,
value: "",
rules: "required",
precision: 2,
viewAttr: 3
}
],
title: "",
defaultshow: true,
col: 1
}],
endowmentInsurance: [{
items: [
{
conditionType: "MONTHPICKER",
domkey: ["deductionMonth"],
fieldcol: 14,
label: "申报扣除月份",
lanId: 111,
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "INPUT",
domkey: ["accountNumber"],
fieldcol: 14,
label: "税延养老账户编号",
lanId: 111,
helpfulTip: "按照中国保险信息技术管理有限责任公司相关信息平台出具的《个人税收递延型商业养老保险扣除凭证》载明的对应项目填写。",
helpfulTipLanId: 111,
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "INPUT",
domkey: ["checkCode"],
fieldcol: 14,
label: "报税校验码",
lanId: 111,
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "INPUTNUMBER",
domkey: ["yearPremium"],
fieldcol: 14,
label: "年度保费",
lanId: 111,
labelcol: 8,
value: "",
rules: "required",
precision: 2,
viewAttr: 3
},
{
conditionType: "INPUTNUMBER",
domkey: ["monthPremium"],
fieldcol: 14,
label: "月度保费",
lanId: 111,
helpfulTip: "取得工资薪金所得、连续性劳务报酬所得(特定行业除外)的个人,填写《个人税收递延型商业养老保险扣除凭证》载明的月度保费金额,一次性缴费的保单填写月平均保费金额。",
helpfulTipLanId: 111,
labelcol: 8,
value: "",
rules: "required",
precision: 2,
viewAttr: 3
},
{
conditionType: "INPUTNUMBER",
domkey: ["currentDeduction"],
fieldcol: 14,
label: "本期扣除金额",
lanId: 111,
helpfulTip: "取得工资薪金所得的个人,应按税延养老保险扣除凭证记载的当月金额和扣除限额孰低的方法计算可扣除额。扣除限额按照申报扣除当月的工资薪金的 6%和1000元孰低的办法确定。",
helpfulTipLanId: 111,
labelcol: 8,
value: "",
rules: "required",
precision: 2,
viewAttr: 3
}
],
title: "",
defaultshow: true,
col: 1
}],
grantDonation: [{
items: [
{
conditionType: "INPUT",
domkey: ["recipientName"],
fieldcol: 14,
label: "受赠单位名称",
lanId: 111,
helpfulTip: "受赠单位名称填写受赠单位的法定名称全称。",
helpfulTipLanId: 111,
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "INPUT",
domkey: ["taxCode"],
fieldcol: 14,
label: "受赠单位纳税人识别号",
lanId: 111,
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "INPUT",
domkey: ["donationNumber"],
fieldcol: 14,
label: "捐赠凭证号",
lanId: 111,
helpfulTip: "捐赠凭证",
helpfulTipLanId: 111,
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "DATEPICKER",
domkey: ["donateDate"],
fieldcol: 14,
label: "捐赠日期",
lanId: 111,
helpfulTip: "填写个人发生的公益慈善事业捐赠的具体日期。",
helpfulTipLanId: 111,
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "INPUTNUMBER",
domkey: ["donateAmount"],
fieldcol: 14,
label: "捐赠金额",
lanId: 111,
helpfulTip: "填写个人发生的公益慈善事业捐赠的具体金额。",
helpfulTipLanId: 111,
labelcol: 8,
value: "",
rules: "required",
precision: 2,
viewAttr: 3
},
{
conditionType: "INPUTNUMBER",
domkey: ["deductionProportion"],
fieldcol: 14,
label: "扣除比例",
lanId: 111,
helpfulTip: "填写税法规定的可以公益慈善事业捐赠支出税前扣除比例。如:0.3(30%)或者1(100%),请注意,必须是小数形式的百分比。",
helpfulTipLanId: 111,
labelcol: 8,
value: "",
rules: "required",
precision: 2,
viewAttr: 3
},
{
conditionType: "INPUTNUMBER",
domkey: ["actualDeduction"],
fieldcol: 14,
label: "实际扣除金额",
lanId: 111,
helpfulTip: "填写个人取得“扣除所得项目”对应收入办理扣缴申报或者自行申报时,实际扣除的公益慈善事业捐赠支出金额。",
helpfulTipLanId: 111,
labelcol: 8,
value: "",
rules: "required",
precision: 2,
viewAttr: 3
}
],
title: "",
defaultshow: true,
col: 1
}],
derateDeduction: [{
items: [
{
conditionType: "INPUT",
domkey: ["derateItem"],
fieldcol: 14,
label: "减免事项",
lanId: 111,
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "INPUT",
domkey: ["derateProperty"],
fieldcol: 14,
label: "减免性质",
lanId: 111,
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "INPUTNUMBER",
domkey: ["derateAmount"],
fieldcol: 14,
label: "减免金额",
lanId: 111,
labelcol: 8,
value: "",
rules: "required",
precision: 2,
viewAttr: 3
}
],
title: "",
defaultshow: true,
col: 1
}],
otherDerateDeduction: [{
items: [
{
conditionType: "INPUTNUMBER",
domkey: ["otherDeduction"],
fieldcol: 14,
label: "减免税额",
lanId: 111,
labelcol: 8,
value: "",
rules: "required",
precision: 2,
viewAttr: 3
},
{
conditionType: "INPUT",
domkey: ["remark"],
fieldcol: 14,
label: "备注",
lanId: 111,
helpfulTip: "根据政策要求一定要在备注中写明具体扣除项目名称备注不超过20个字符。",
helpfulTipLanId: 111,
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
}
],
title: "",
defaultshow: true,
col: 1
}],
personalPension: [{
items: [
{
conditionType: "SELECT",
domkey: ["voucherTypeName"],
fieldcol: 14,
label: "凭证类型",
lanId: 111,
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "INPUT",
domkey: ["voucherNo"],
fieldcol: 14,
label: "凭证编码",
lanId: 111,
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "INPUTNUMBER",
domkey: ["payAmount"],
fieldcol: 14,
label: "缴费金额",
lanId: 111,
labelcol: 8,
value: "",
rules: "required",

View File

@ -9,14 +9,15 @@
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaDialog, WeaLocaleProvider } from "ecCom";
import { WeaDialog, WeaHelpfulTip, WeaLocaleProvider, WeaTools } from "ecCom";
import { WeaSwitch } from "comsMobx";
import FormInfo from "../../../components/FormInfo";
import { taxDetailSettingsConditions } from "./columns";
import * as API from "../../../apis/otherDeduct";
import { Button, message } from "antd";
import { toDecimal_n } from "../../../util";
import { getDomkes, toDecimal_n } from "../../../util";
import { postFetch } from "../../../util/request";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
@inject("otherDeductStore")
@ -25,33 +26,47 @@ class DetailSettingsDialog extends Component {
constructor(props) {
super(props);
this.state = {
loading: false
loading: false, conditions: []
};
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) {
this.props.otherDeductStore.settingsForm.initFormFields(taxDetailSettingsConditions[nextProps.dataType]);
this.setState({
conditions: _.map(taxDetailSettingsConditions[nextProps.dataType], item => ({
...item, items: _.map(item.items, o => ({
...o, options: getKey(o) === "voucherTypeName" ?
[{ key: "MONTH", showname: "月度" }, { key: "YEAR", showname: "年度" }] : []
}))
}))
}, () => {
this.props.otherDeductStore.settingsForm.initFormFields(this.state.conditions);
if (nextProps.id) _.map(getDomkes(this.state.conditions), domkey => {
this.props.otherDeductStore.settingsForm.updateFields({ [domkey]: { value: nextProps.record[domkey] } });
});
});
} else if (nextProps.visible !== this.props.visible && !nextProps.visible) {
this.props.otherDeductStore.settingsForm.resetForm();
this.props.otherDeductStore.initSettingsForm();
}
}
save = () => {
const { otherDeductStore: { settingsForm }, mainId } = this.props;
const { otherDeductStore: { settingsForm }, mainId, id, dataType } = this.props;
settingsForm.validateForm().then(f => {
if (f.isValid) {
const payload = settingsForm.getFormParams();
let { deductionMonth, ...payload } = settingsForm.getFormParams();
deductionMonth && (payload = { ...payload, deductionMonth: deductionMonth + "-01" });
this.setState({ loading: true });
API.saveFreeIncome({ ...payload, mainId }).then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(111, "操作成功!"));
this.props.onCancel(this.props.onSuccess());
} else {
message.error(errormsg);
}
});
postFetch(`/api/bs/hrmsalary/otherDeduction/save${_.upperFirst(dataType)}`, { ...payload, mainId, id })
.then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(111, "操作成功!"));
this.props.onCancel(this.props.onSuccess());
} else {
message.error(errormsg);
}
});
} else {
f.showErrors();
}
@ -59,24 +74,88 @@ class DetailSettingsDialog extends Component {
};
render() {
const { otherDeductStore: { settingsForm }, dataType } = this.props, { loading } = this.state;
const { otherDeductStore: { settingsForm } } = this.props, { loading, conditions } = this.state;
const itemRender = {
freeAmount: (field, textAreaProps, form, formParams) => {
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
form={form} formParams={formParams}
onBlur={(v) => v && form.updateFields({ freeAmount: { value: toDecimal_n(v, 2) } })}/>);
},
identificationNumber: (field, textAreaProps, form, formParams) => {
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }} form={form} formParams={formParams}/>);
},
effectiveDate: (field, textAreaProps, form, formParams) => {
return (<div className="cust">
<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }} form={form} formParams={formParams}/>
<div className="cus_helpful">
<WeaHelpfulTip title={getLabel(field.helpfulTipLanId, field.helpfulTip)}/>
</div>
</div>);
},
donateDate: (field, textAreaProps, form, formParams) => {
return (<div className="cust">
<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }} form={form} formParams={formParams}/>
<div className="cus_helpful">
<WeaHelpfulTip title={getLabel(field.helpfulTipLanId, field.helpfulTip)}/>
</div>
</div>);
},
yearPremium: (field, textAreaProps, form, formParams) => {
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
form={form} formParams={formParams}
onBlur={(v) => v && form.updateFields({ yearPremium: { value: toDecimal_n(v, 2) } })}/>);
},
monthPremium: (field, textAreaProps, form, formParams) => {
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
form={form} formParams={formParams}
onBlur={(v) => v && form.updateFields({ monthPremium: { value: toDecimal_n(v, 2) } })}/>);
},
currentDeduction: (field, textAreaProps, form, formParams) => {
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
form={form} formParams={formParams}
onBlur={(v) => v && form.updateFields({ currentDeduction: { value: toDecimal_n(v, 2) } })}/>);
},
donateAmount: (field, textAreaProps, form, formParams) => {
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
form={form} formParams={formParams}
onBlur={(v) => v && form.updateFields({ donateAmount: { value: toDecimal_n(v, 2) } })}/>);
},
deductionProportion: (field, textAreaProps, form, formParams) => {
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
form={form} formParams={formParams}
onBlur={(v) => v && form.updateFields({ deductionProportion: { value: toDecimal_n(v, 2) } })}/>);
},
actualDeduction: (field, textAreaProps, form, formParams) => {
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
form={form} formParams={formParams}
onBlur={(v) => v && form.updateFields({ actualDeduction: { value: toDecimal_n(v, 2) } })}/>);
},
derateAmount: (field, textAreaProps, form, formParams) => {
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
form={form} formParams={formParams}
onBlur={(v) => v && form.updateFields({ derateAmount: { value: toDecimal_n(v, 2) } })}/>);
},
otherDeduction: (field, textAreaProps, form, formParams) => {
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
form={form} formParams={formParams}
onBlur={(v) => v && form.updateFields({ otherDeduction: { value: toDecimal_n(v, 2) } })}/>);
},
payAmount: (field, textAreaProps, form, formParams) => {
return (<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }}
form={form} formParams={formParams}
onBlur={(v) => v && form.updateFields({ payAmount: { value: toDecimal_n(v, 2) } })}/>);
}
};
return (
<WeaDialog
{...this.props} style={{ width: 480, height: 174 }} initLoadCss title={getLabel(111, "明细设置")}
{...this.props} style={{ width: 480, minHeight: 127 }} initLoadCss title={getLabel(111, "明细设置")}
buttons={[
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(111, "确定")}</Button>,
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(111, "取消")}</Button>
]}
>
<FormInfo className="form-dialog-layout" center={false} itemRender={itemRender}
form={settingsForm} formFields={taxDetailSettingsConditions[dataType] || []}/>
form={settingsForm} formFields={conditions}/>
</WeaDialog>
);
}

View File

@ -299,7 +299,12 @@ class Index extends Component {
...o, label: getLabel(o.lanId, o.label),
extraDom: !_.isEmpty(editId) &&
<a href="javascript:void(0);" className="extra_tax" title={getLabel(111, "添加明细")}
onClick={() => this.setState({ taxSetDialog: { visible: true, dataType: getKey(o), id: editId.id } })}>
onClick={() => this.setState({
taxSetDialog: {
visible: true, dataType: o.dataType, id: editId.id,
label: getLabel(o.lanId, o.label)
}
})}>
<i className="icon-coms-mulujibenxinxi"/>
</a>
}))

View File

@ -9,7 +9,7 @@
*/
import React, { Component } from "react";
import { WeaButtonIcon, WeaDialog, WeaLocaleProvider, WeaTable } from "ecCom";
import { Button, Spin } from "antd";
import { message, Modal, Spin } from "antd";
import { postFetch } from "../../../util/request";
import DetailSettingsDialog from "./detailSettingsDialog";
@ -20,7 +20,7 @@ class TaxSetDialog extends Component {
super(props);
this.state = {
dataSource: [], columns: [], loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 },
selectedRowKeys: [], detailSettingsDialog: { visible: false, dataType: "", mainId: "", id: "" }
selectedRowKeys: [], detailSettingsDialog: { visible: false, dataType: "", mainId: "", id: "", record: {} }
};
}
@ -31,31 +31,55 @@ class TaxSetDialog extends Component {
}, () => this.getList(nextProps));
} else if (nextProps.visible !== this.props.visible && !nextProps.visible) {
this.setState({
dataSource: [], columns: [], loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 },
selectedRowKeys: [], detailSettingsDialog: { visible: false }
dataSource: [],
columns: [],
loading: false,
pageInfo: { current: 1, pageSize: 10, total: 0 },
selectedRowKeys: [],
detailSettingsDialog: { visible: false }
});
}
}
getList = (props) => {
const { id, dataType } = props || this.props, { pageInfo } = this.state;
const { id, dataType } = props || this.props, { pageInfo, detailSettingsDialog } = this.state;
this.setState({ loading: true });
postFetch(`/api/bs/hrmsalary/otherDeduction/${dataType}List`, { ...pageInfo, id }).then(({ status, data }) => {
this.setState({ loading: false });
if (status) {
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
this.setState({
dataSource, pageInfo: { current, pageSize, total },
columns: _.map(columns, o => ({
...o, width: o.dataIndex === "operate" && 120,
render: (text, record) => o.dataIndex === "operate" ?
(<div className="space_div">
<a href="javascript:void(0);">{getLabel(111, "编辑")}</a>
<a href="javascript:void(0);">{getLabel(111, "删除")}</a>
</div>) :
(<span>{text}</span>)
}))
});
postFetch(`/api/bs/hrmsalary/otherDeduction/${dataType}List`, { ...pageInfo, id })
.then(({ status, data }) => {
this.setState({ loading: false });
if (status) {
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
this.setState({
dataSource, pageInfo: { current, pageSize, total }, columns: _.map(columns, o => ({
...o,
width: o.dataIndex === "operate" && 120,
render: (text, record) => o.dataIndex === "operate" ? (<div className="space_div">
<a href="javascript:void(0);" onClick={() => this.setState({
detailSettingsDialog: { ...detailSettingsDialog, visible: true, id: record.id, record }
})}>{getLabel(111, "编辑")}</a>
<a href="javascript:void(0);"
onClick={() => this.handleDelete([record.id])}>{getLabel(111, "删除")}</a>
</div>) : (<span>{text}</span>)
}))
});
}
});
};
handleDelete = (ids = []) => {
const { selectedRowKeys } = this.state, { dataType } = this.props;
Modal.confirm({
title: getLabel(131329, "信息确认"),
content: getLabel(388758, "确认要删除吗?"),
onOk: () => {
postFetch(`/api/bs/hrmsalary/otherDeduction/delete${_.upperFirst(dataType)}`, { ids })
.then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(502230, "删除成功!"));
this.setState({ selectedRowKeys: _.difference(selectedRowKeys, ids) }, () => this.getList());
} else {
message.error(errormsg);
}
});
}
});
};
@ -78,37 +102,37 @@ class TaxSetDialog extends Component {
const rowSelection = {
selectedRowKeys, onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
};
return (
<WeaDialog {...this.props} initLoadCss className="sys-salary-wrapper" ref={dom => this.taxSetRef = dom}
title={getLabel(111, "数据采集明细")}
buttons={[
<Button type="primary">{getLabel(111, "确定")}</Button>,
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(111, "取消")}</Button>
]}
style={{
width: "60vw", height: 600, minHeight: 200, minWidth: 380,
maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
}}>
<div className="sys-item-table-box">
<Spin spinning={loading && pageInfo.total === 0}>
<div className="sys-item-table-opts">
<WeaButtonIcon buttonType="add" type="primary" title={getLabel(111, "添加")}
onClick={() => this.setState({
detailSettingsDialog: { ...detailSettingsDialog, visible: true }
})}/>
<WeaButtonIcon buttonType="del" type="primary" title={getLabel(111, "删除")}
disabled={_.isEmpty(selectedRowKeys)}/>
</div>
<WeaTable columns={columns} dataSource={dataSource} pagination={pagination} bordered
rowSelection={rowSelection} loading={loading}
scroll={{ y: this.taxSetRef ? this.taxSetRef.state.height - 156 : 600 }}/>
<DetailSettingsDialog {...detailSettingsDialog} onCancel={() => this.setState({
detailSettingsDialog: { ...detailSettingsDialog, visible: false }
})} onSuccess={this.getList}/>
</Spin>
</div>
</WeaDialog>
);
return (<WeaDialog {...this.props} initLoadCss className="sys-salary-wrapper" ref={dom => this.taxSetRef = dom}
title={`${getLabel(111, "数据采集明细")}${this.props.label}`}
style={{
width: "60vw", height: 600, minHeight: 200, minWidth: 380, maxHeight: "90%",
maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
}}>
<div className="sys-item-table-box">
<Spin spinning={loading && pageInfo.total === 0}>
<div className="sys-item-table-opts">
<WeaButtonIcon buttonType="add" type="primary" title={getLabel(111, "添加")}
onClick={() => this.setState({
detailSettingsDialog: { ...detailSettingsDialog, visible: true }
})}/>
<WeaButtonIcon buttonType="del" type="primary" title={getLabel(111, "删除")}
disabled={_.isEmpty(selectedRowKeys)} onClick={() => {
if (_.isEmpty(selectedRowKeys)) {
message.warning(getLabel(111, "请选择要删除的数据!"));
return;
}
this.handleDelete(selectedRowKeys);
}}/>
</div>
<WeaTable columns={columns} dataSource={dataSource} pagination={pagination} bordered
rowSelection={rowSelection} loading={loading} rowKey="id"
scroll={{ y: this.taxSetRef ? this.taxSetRef.state.height - 164 : 600 }}/>
<DetailSettingsDialog {...detailSettingsDialog} onCancel={() => this.setState({
detailSettingsDialog: { ...detailSettingsDialog, visible: false, id: "" }
})} onSuccess={this.getList}/>
</Spin>
</div>
</WeaDialog>);
}
}

View File

@ -14,6 +14,7 @@ export class OtherDeductStore {
@observable addForm = new WeaForm(); // 新增form
@action initAddForm = () => this.addForm = new WeaForm();
@observable settingsForm = new WeaForm(); // 其他个税申报明细form
@observable initSettingsForm = () => this.settingsForm = new WeaForm();
@observable condition = []; // 存储后台得到的form数据
@observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据
@observable showSearchAd = false; // 高级搜索面板显示

View File

@ -108,6 +108,17 @@
overflow: hidden;
}
}
.cust {
position: relative;
.cus_helpful {
position: absolute;
right: -31px;
top: 50%;
transform: translateY(-8px);
}
}
}
//公式编辑框样式