diff --git a/pc4mobx/hrmSalary/components/CustomSelect/index.js b/pc4mobx/hrmSalary/components/CustomSelect/index.js new file mode 100644 index 00000000..43068096 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomSelect/index.js @@ -0,0 +1,127 @@ +/* + * 自定义多选下拉框 + * 支持搜索 + * @Author: 黎永顺 + * @Date: 2024/9/13 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaCheckbox, WeaInput, WeaLocaleProvider, WeaNewScroll } from "ecCom"; +import classNames from "classnames"; +import { Dropdown } from "antd"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + visible: false, value: props.value ? props.value.split(",") : [], + keywords: "" + }; + } + + isAllChecked = () => { + const { options } = this.props, { value, keywords } = this.state; + let v = "0"; + if (_.uniq(value).length === options.filter(k => k.showname.indexOf(keywords) >= 0).length) v = "1"; + return v; + }; + + isChecked = (v) => { + const { value } = this.state; + return value.indexOf(v) > -1 ? "1" : "0"; + }; + onAllChange = (v) => { + const { options, onChange } = this.props, { keywords } = this.state; + let values = [], shownames = []; + if (v == 1) { + options.filter(k => k.showname.indexOf(keywords) >= 0).forEach(o => { + values.push(o.key); + shownames.push(o.showname); + }); + } + this.setState({ value: values }); + onChange && onChange(values.join(","), shownames.join(",")); + }; + + onItemChange = (v, id) => { + const { onChange, options } = this.props, { value } = this.state; + let values = !_.isEmpty(value) ? value : [], shownames = []; + if (v == "1") { + values.push(id); + } else { + values = values.filter(val => val !== id); + } + values.forEach(val => { + let target = options.filter((data) => data.key == val)[0]; + if (target) shownames.push(target.showname); + }); + this.setState({ value: values }); + onChange && onChange(values.join(","), shownames.join(",")); + }; + + getList = () => { + const { options } = this.props, { keywords } = this.state; + let style = {}; + if (options.length > 5) style = { height: 200 }; + return
+ +
+ this.setState({ keywords })}/> +
+
+ + +
+ {options && options.filter(k => k.showname.indexOf(keywords) >= 0).map(o => { + return
+ this.onItemChange(v, o.key)} + > + +
; + })} +
+
; + }; + + getShownames = () => { + const { options } = this.props; + let { value } = this.state; + let shownames = []; + value.forEach(val => { + let target = options.filter((data) => data.key == val)[0]; + if (target) shownames.push(target.showname); + }); + return shownames.join(","); + }; + + render() { + const { visible } = this.state, { layout } = this.props; + const clsname = classNames({ + "wea-associative-search-mult": true + }); + return (
+ this.setState({ visible })} visible={visible} + getPopupContainer={() => (layout || document.body)}> +
+ {this.getShownames()} + {!this.state.visible ? : } +
+
+
); + } +} + +export default Index; \ No newline at end of file diff --git a/pc4mobx/hrmSalary/components/CustomSelect/index.less b/pc4mobx/hrmSalary/components/CustomSelect/index.less new file mode 100644 index 00000000..1ce20fb4 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomSelect/index.less @@ -0,0 +1,60 @@ +.customMuiSelect { + border: none; + padding: 0; + + .wea-select-input { + min-width: 100px; + width: 100%; + display: inline-block; + padding: 4px 17px 4px 4px; + position: relative; + min-height: 30px; + border: 1px solid #d9d9d9; + user-select: none; + height: 30px; + white-space: nowrap; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + -o-text-overflow: ellipsis; + text-overflow: ellipsis; + overflow: hidden; + + .wdb { + word-break: break-all !important; + word-wrap: break-word !important; + } + + .cursor-pointer { + cursor: pointer; + } + + &:hover, &:focus { + border-color: #57c5f7; + } + + .arrow { + position: absolute; + right: 4px; + top: 8px; + color: #979797; + } + } + +} + +.wea-select-panel { + padding: 5px 0; + max-height: 200px; + border-radius: 3px; + background: #fff; + border: 1px solid #ddd; + + .wea-select-panel-item { + padding: 5px 10px; + + &:hover { + background-color: #e9f7ff; + } + } +} \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js index 986bb1bb..c7798e3f 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js @@ -125,17 +125,18 @@ class EditCalcTable extends Component { }, 500); }); const { routeParams: { salaryAcctRecordId } } = this.props; - updateLockStatus({ ...payload, salaryAcctRecordId }).then(({ status, errormsg }) => { - if (status) { - clearInterval(this.timerLock); - this.setState({ - progressVisible: false, - progress: 0 - }, () => this.queryCalcResultList()); - } else { - message.error(errormsg); - } - }); + updateLockStatus({ ...payload, salaryAcctRecordId, acctEmpIds: this.state.selectedRowKeys }) + .then(({ status, errormsg }) => { + if (status) { + clearInterval(this.timerLock); + this.setState({ + progressVisible: false, + progress: 0 + }, () => this.queryCalcResultList()); + } else { + message.error(errormsg); + } + }); } }); }; @@ -341,4 +342,4 @@ const traverse = (arr, calcDetail) => { }; } }); -}; +}; \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/declare/generateDeclarationDetail.js b/pc4mobx/hrmSalary/pages/declare/generateDeclarationDetail.js index b111cc1d..e24617cc 100644 --- a/pc4mobx/hrmSalary/pages/declare/generateDeclarationDetail.js +++ b/pc4mobx/hrmSalary/pages/declare/generateDeclarationDetail.js @@ -4,6 +4,7 @@ import { WeaLocaleProvider, WeaTop } from "ecCom"; import DeclareDetailEditSlide from "./components/declareDetailEditSlide"; import { getQueryString } from "../../util/url"; import { getIframeParentHeight } from "../../util"; +import { sysinfo } from "../../apis/ruleconfig"; import * as API from "../../apis/declare"; import { Button, Spin } from "antd"; import "./index.less"; @@ -16,7 +17,7 @@ export default class GenerateDeclarationDetail extends React.Component { super(props); this.state = { loading: false, dataSource: [], columns: [], declareInfo: {}, declareSlide: { visible: false, record: {} }, - pageInfo: { current: 1, pageSize: 10, total: 0 } + pageInfo: { current: 1, pageSize: 10, total: 0 }, sysinfo: {} }; } @@ -33,6 +34,7 @@ export default class GenerateDeclarationDetail extends React.Component { if (type === "init") { this.getDetailList(); this.getDeclareInfo(); + this.getSysinfo(); } else if (type === "turn") { switch (id) { case "PAGEINFO": @@ -47,6 +49,11 @@ export default class GenerateDeclarationDetail extends React.Component { } }; + getSysinfo = () => { + sysinfo().then(({ status, data: sysinfo }) => { + if (status) this.setState({ sysinfo }); + }); + }; getDetailList = () => { const { pageInfo } = this.state; const payload = { @@ -94,9 +101,10 @@ export default class GenerateDeclarationDetail extends React.Component { window.open(url, "_self"); }; renderTitle = () => { - const { declareInfo } = this.state; + const { declareInfo, sysinfo } = this.state; + const title = sysinfo["TAX_DECLARATION_DATE_TYPE"] === "1" ? getLabel(111, "税款所属期") : getLabel(111, "薪资所属月"); return ( - {getLabel(111, "薪资所属月")}:{declareInfo.salaryMonth} + {title}:{declareInfo.salaryMonth} {getLabel(111, "个税扣缴义务人")}:{declareInfo.taxAgentName} ); }; @@ -126,4 +134,4 @@ export default class GenerateDeclarationDetail extends React.Component { ); } -} +} \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollDetail/payrollDetail.js b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/payrollDetail.js index a0c9e495..ab058017 100644 --- a/pc4mobx/hrmSalary/pages/payroll/payrollDetail/payrollDetail.js +++ b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/payrollDetail.js @@ -60,7 +60,8 @@ class PayrollDetail extends Component { render() { const { salarySendDetailBaseInfo, showSearchAd, conditions, isQuery, showTotalCell } = this.state; - const { taxAgentStore: { showOperateBtn } } = this.props; + const { taxAgentStore: { PageAndOptAuth } } = this.props; + const showOperateBtn = PageAndOptAuth.opts.length; const { salaryMonth, template } = salarySendDetailBaseInfo; const dropMenuDatas = [ { @@ -110,4 +111,4 @@ class PayrollDetail extends Component { } } -export default PayrollDetail; +export default PayrollDetail; \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js index c5e05729..66f4b8c1 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js @@ -27,7 +27,7 @@ class MakeupDifference extends Component { tmpUrl: "exportSiaccountWelfarebalanceimporttemplatetetemplate", cacheUrl: "cacheBalanceWelfareList", importUrl: "importBalanceInsuranceDetail", - importparams: {} + importparams: {}, ..._.pick(this.props, ["billMonth", "paymentOrganization"]) }, returnEditPersonSlide: { title: "", editId: "", visible: false @@ -152,4 +152,4 @@ class MakeupDifference extends Component { } } -export default MakeupDifference; +export default MakeupDifference; \ No newline at end of file