diff --git a/pc4mobx/hrmSalary/apis/otherDeduct.js b/pc4mobx/hrmSalary/apis/otherDeduct.js index 517046cf..4797a844 100644 --- a/pc4mobx/hrmSalary/apis/otherDeduct.js +++ b/pc4mobx/hrmSalary/apis/otherDeduct.js @@ -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); -}; diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js index 5182ea00..de3c33da 100644 --- a/pc4mobx/hrmSalary/apis/standingBook.js +++ b/pc4mobx/hrmSalary/apis/standingBook.js @@ -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); }; //删除退差数据 diff --git a/pc4mobx/hrmSalary/components/FormInfo/index.js b/pc4mobx/hrmSalary/components/FormInfo/index.js index 55fe099f..bdeb787a 100644 --- a/pc4mobx/hrmSalary/components/FormInfo/index.js +++ b/pc4mobx/hrmSalary/components/FormInfo/index.js @@ -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 = { field.checkboxValue = v === "1"; @@ -38,10 +39,14 @@ export default class FormInfo extends Component { }}/>; let coms; if (customerRender == null) { - coms = ; + coms = ; } 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 (
); + const { formFields, className, form } = this.props; + if (formFields == null || !form.isFormInit) return (
); return ( -
- {this.renderForm()} -
+
{this.renderForm()}
); } } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js index 4d967592..cb6a387b 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js @@ -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", diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/detailSettingsDialog.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/detailSettingsDialog.js index b4155c08..84627b47 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/detailSettingsDialog.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/detailSettingsDialog.js @@ -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 ( v && form.updateFields({ freeAmount: { value: toDecimal_n(v, 2) } })}/>); + }, + identificationNumber: (field, textAreaProps, form, formParams) => { + return (); + }, + effectiveDate: (field, textAreaProps, form, formParams) => { + return (
+ +
+ +
+
); + }, + donateDate: (field, textAreaProps, form, formParams) => { + return (
+ +
+ +
+
); + }, + yearPremium: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ yearPremium: { value: toDecimal_n(v, 2) } })}/>); + }, + monthPremium: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ monthPremium: { value: toDecimal_n(v, 2) } })}/>); + }, + currentDeduction: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ currentDeduction: { value: toDecimal_n(v, 2) } })}/>); + }, + donateAmount: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ donateAmount: { value: toDecimal_n(v, 2) } })}/>); + }, + deductionProportion: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ deductionProportion: { value: toDecimal_n(v, 2) } })}/>); + }, + actualDeduction: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ actualDeduction: { value: toDecimal_n(v, 2) } })}/>); + }, + derateAmount: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ derateAmount: { value: toDecimal_n(v, 2) } })}/>); + }, + otherDeduction: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ otherDeduction: { value: toDecimal_n(v, 2) } })}/>); + }, + payAmount: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ payAmount: { value: toDecimal_n(v, 2) } })}/>); } }; return ( {getLabel(111, "确定")}, ]} > + form={settingsForm} formFields={conditions}/> ); } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js index 424fa876..aa2c832e 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js @@ -299,7 +299,12 @@ class Index extends Component { ...o, label: getLabel(o.lanId, o.label), extraDom: !_.isEmpty(editId) && 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) + } + })}> })) diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/taxSetDialog.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/taxSetDialog.js index 77184674..5025d4b4 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/taxSetDialog.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/taxSetDialog.js @@ -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" ? - () : - ({text}) - })) - }); + 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" ? () : ({text}) + })) + }); + } + }); + }; + 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 ( - this.taxSetRef = dom} - title={getLabel(111, "数据采集明细")} - buttons={[ - , - - ]} - style={{ - width: "60vw", height: 600, minHeight: 200, minWidth: 380, - maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)" - }}> -
- -
- this.setState({ - detailSettingsDialog: { ...detailSettingsDialog, visible: true } - })}/> - -
- - this.setState({ - detailSettingsDialog: { ...detailSettingsDialog, visible: false } - })} onSuccess={this.getList}/> -
-
-
- ); + return ( 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)" + }}> +
+ +
+ this.setState({ + detailSettingsDialog: { ...detailSettingsDialog, visible: true } + })}/> + { + if (_.isEmpty(selectedRowKeys)) { + message.warning(getLabel(111, "请选择要删除的数据!")); + return; + } + this.handleDelete(selectedRowKeys); + }}/> +
+ + this.setState({ + detailSettingsDialog: { ...detailSettingsDialog, visible: false, id: "" } + })} onSuccess={this.getList}/> +
+
+
); } } diff --git a/pc4mobx/hrmSalary/stores/otherDeduct.js b/pc4mobx/hrmSalary/stores/otherDeduct.js index 67e23409..6f4432a9 100644 --- a/pc4mobx/hrmSalary/stores/otherDeduct.js +++ b/pc4mobx/hrmSalary/stores/otherDeduct.js @@ -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; // 高级搜索面板显示 diff --git a/pc4mobx/hrmSalary/style/index.less b/pc4mobx/hrmSalary/style/index.less index 7e589845..a034b045 100644 --- a/pc4mobx/hrmSalary/style/index.less +++ b/pc4mobx/hrmSalary/style/index.less @@ -108,6 +108,17 @@ overflow: hidden; } } + + .cust { + position: relative; + + .cus_helpful { + position: absolute; + right: -31px; + top: 50%; + transform: translateY(-8px); + } + } } //公式编辑框样式